Lines Matching refs:frame
51 static int process_frame(DecodeContext *dc, AVFrame *frame)
57 if (!frame)
61 pd->scaler = sws_getContext(frame->width, frame->height, frame->format,
67 av_pix_fmt_get_chroma_sub_sample(frame->format, &pd->h_shift_src, &pd->v_shift_src);
70 /* scale the whole input frame as reference */
71 ret = sws_scale(pd->scaler, (const uint8_t **)frame->data, frame->linesize, 0, frame->height,
77 while (slice_start < frame->height) {
81 slice_height = av_lfg_get(&pd->lfg) % (frame->height - slice_start);
84 for (int j = 0; j < FF_ARRAY_ELEMS(src) && frame->data[j]; j++) {
86 src[j] = frame->data[j] + frame->linesize[j] * (slice_start >> shift);
89 ret = sws_scale(pd->scaler, src, frame->linesize, slice_start, slice_height,
103 fprintf(stderr, "mismatch frame %d seed %u\n",
148 AVFrame *frame = av_frame_alloc();
149 if (!frame) {
154 frame->width = width;
155 frame->height = height;
156 frame->format = pix_fmt;
158 ret = av_frame_get_buffer(frame, 0);
160 fprintf(stderr, "Error allocating frame data\n");
165 for (int j = 0; j < 4 && frame->data[j]; j++) {
167 memset(frame->data[j], 0,
168 frame->linesize[j] * (height >> shift));
170 if (i) pd.frame_ref = frame;
171 else pd.frame_dst = frame;