Lines Matching refs:frame
44 int frame_size; /* size of the frame in bytes */
132 static void flip(AVCodecContext *avctx, AVFrame *frame)
134 frame->data[0] += frame->linesize[0] * (avctx->height - 1);
135 frame->linesize[0] *= -1;
166 static int raw_decode(AVCodecContext *avctx, AVFrame *frame,
229 frame->pict_type = AV_PICTURE_TYPE_I;
230 frame->key_frame = 1;
232 res = ff_decode_frame_props(avctx, frame);
236 frame->pkt_pos = avctx->internal->last_pkt_props->pos;
237 frame->pkt_duration = avctx->internal->last_pkt_props->duration;
240 frame->interlaced_frame = 1;
241 frame->top_field_first = context->tff;
248 frame->buf[0] = av_buffer_alloc(FFMAX(context->frame_size, buf_size));
250 frame->buf[0] = av_buffer_ref(avpkt->buf);
251 if (!frame->buf[0])
257 uint8_t *dst = frame->buf[0]->data;
316 uint8_t *dst = frame->buf[0]->data;
340 memcpy(frame->buf[0]->data, buf, buf_size);
341 buf = frame->buf[0]->data;
351 av_buffer_unref(&frame->buf[0]);
355 if ((res = av_image_fill_arrays(frame->data, frame->linesize,
358 av_buffer_unref(&frame->buf[0]);
368 av_buffer_unref(&frame->buf[0]);
373 av_buffer_unref(&frame->buf[0]);
378 frame->palette_has_changed = 1;
386 frame->palette_has_changed = 1;
400 FFALIGN(frame->linesize[0], linesize_align) * avctx->height <= buf_size)
401 frame->linesize[0] = FFALIGN(frame->linesize[0], linesize_align);
404 FFALIGN(frame->linesize[0], linesize_align) * avctx->height +
405 FFALIGN(frame->linesize[1], linesize_align) * ((avctx->height + 1) / 2) <= buf_size) {
406 int la0 = FFALIGN(frame->linesize[0], linesize_align);
407 frame->data[1] += (la0 - frame->linesize[0]) * avctx->height;
408 frame->linesize[0] = la0;
409 frame->linesize[1] = FFALIGN(frame->linesize[1], linesize_align);
413 frame->buf[1] = av_buffer_ref(context->palette);
414 if (!frame->buf[1]) {
415 av_buffer_unref(&frame->buf[0]);
418 frame->data[1] = frame->buf[1]->data;
422 ((frame->linesize[0] + 3) & ~3) * avctx->height <= buf_size)
423 frame->linesize[0] = (frame->linesize[0] + 3) & ~3;
426 flip(avctx, frame);
432 FFSWAP(uint8_t *, frame->data[1], frame->data[2]);
435 frame->data[1] = frame->data[1] + (avctx->width+1)*(avctx->height+1) -avctx->width*avctx->height;
436 frame->data[2] = frame->data[2] + ((avctx->width+1)*(avctx->height+1) -avctx->width*avctx->height)*5/4;
442 uint8_t *line = frame->data[0];
446 line += frame->linesize[0];
452 uint8_t *dst = frame->data[0];
460 dst += frame->linesize[0];
465 frame->interlaced_frame = 1;
467 frame->top_field_first = 1;