Lines Matching refs:state
212 int v4l2_fwht_encode(struct v4l2_fwht_state *state, u8 *p_in, u8 *p_out)
214 unsigned int size = state->stride * state->coded_height;
215 unsigned int chroma_stride = state->stride;
216 const struct v4l2_fwht_pixfmt_info *info = state->info;
236 cf.i_frame_qp = state->i_frame_qp;
237 cf.p_frame_qp = state->p_frame_qp;
240 encoding = fwht_encode_frame(&rf, &state->ref_frame, &cf,
241 !state->gop_cnt,
242 state->gop_cnt == state->gop_size - 1,
243 state->visible_width,
244 state->visible_height,
245 state->stride, chroma_stride);
247 state->gop_cnt = 0;
248 if (++state->gop_cnt >= state->gop_size)
249 state->gop_cnt = 0;
255 p_hdr->width = htonl(state->visible_width);
256 p_hdr->height = htonl(state->visible_height);
274 p_hdr->colorspace = htonl(state->colorspace);
275 p_hdr->xfer_func = htonl(state->xfer_func);
276 p_hdr->ycbcr_enc = htonl(state->ycbcr_enc);
277 p_hdr->quantization = htonl(state->quantization);
282 int v4l2_fwht_decode(struct v4l2_fwht_state *state, u8 *p_in, u8 *p_out)
291 unsigned int dst_chroma_stride = state->stride;
292 unsigned int ref_chroma_stride = state->ref_stride;
293 unsigned int dst_size = state->stride * state->coded_height;
296 if (!state->info)
299 info = state->info;
301 version = ntohl(state->header.version);
308 if (state->header.magic1 != FWHT_MAGIC1 ||
309 state->header.magic2 != FWHT_MAGIC2)
313 if (ntohl(state->header.width) != state->visible_width ||
314 ntohl(state->header.height) != state->visible_height)
317 flags = ntohl(state->header.flags);
329 state->colorspace = ntohl(state->header.colorspace);
330 state->xfer_func = ntohl(state->header.xfer_func);
331 state->ycbcr_enc = ntohl(state->header.ycbcr_enc);
332 state->quantization = ntohl(state->header.quantization);
334 cf.size = ntohl(state->header.size);
355 ref_size = state->ref_stride * state->coded_height;
357 if (prepare_raw_frame(&state->ref_frame, info, state->ref_frame.buf,
362 state->visible_width, state->visible_height,
363 &state->ref_frame, state->ref_stride, ref_chroma_stride,
364 &dst_rf, state->stride, dst_chroma_stride))