avcodec: Remove deprecated AVCodecContext.coded_frame
Deprecated in 40cf1bbacc6220a0aa6bed5c331871d43f9ce370. (The currently disabled filter vf_mcdeint and vf_uspp were users of this field; they have not been changed, so that whoever wants to fix them can see the state of these filters when they were disabled.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
		
							parent
							
								
									95054bfa48
								
							
						
					
					
						commit
						11bc790893
					
				@ -33,13 +33,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
    int width, height, bits_pixel, i, j, length, ret;
 | 
			
		||||
    uint8_t *in_buf, *buf;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    width  = avctx->width;
 | 
			
		||||
    height = avctx->height;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -400,11 +400,6 @@ free_and_end:
 | 
			
		||||
    av_opt_free(avctx);
 | 
			
		||||
 | 
			
		||||
    if (av_codec_is_encoder(avctx->codec)) {
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        av_frame_free(&avctx->coded_frame);
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
        av_freep(&avctx->extradata);
 | 
			
		||||
        avctx->extradata_size = 0;
 | 
			
		||||
    }
 | 
			
		||||
@ -578,11 +573,6 @@ av_cold int avcodec_close(AVCodecContext *avctx)
 | 
			
		||||
    av_freep(&avctx->priv_data);
 | 
			
		||||
    if (av_codec_is_encoder(avctx->codec)) {
 | 
			
		||||
        av_freep(&avctx->extradata);
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        av_frame_free(&avctx->coded_frame);
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    } else if (av_codec_is_decoder(avctx->codec))
 | 
			
		||||
        av_freep(&avctx->subtitle_header);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1578,17 +1578,6 @@ typedef struct AVCodecContext {
 | 
			
		||||
     */
 | 
			
		||||
     int lowres;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
    /**
 | 
			
		||||
     * the picture in the bitstream
 | 
			
		||||
     * - encoding: Set by libavcodec.
 | 
			
		||||
     * - decoding: unused
 | 
			
		||||
     *
 | 
			
		||||
     * @deprecated use the quality factor packet side data instead
 | 
			
		||||
     */
 | 
			
		||||
    attribute_deprecated AVFrame *coded_frame;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * thread count
 | 
			
		||||
     * is used to decide how many independent tasks should be passed to execute()
 | 
			
		||||
 | 
			
		||||
@ -74,12 +74,6 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
    int bit_count = avctx->bits_per_coded_sample;
 | 
			
		||||
    uint8_t *ptr, *buf;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    switch (avctx->pix_fmt) {
 | 
			
		||||
    case AV_PIX_FMT_RGB444:
 | 
			
		||||
        compression = BMP_BITFIELDS;
 | 
			
		||||
 | 
			
		||||
@ -499,12 +499,6 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
 | 
			
		||||
        !FF_ALLOCZ_TYPED_ARRAY(ctx->mb_bits,    ctx->m.mb_num)    ||
 | 
			
		||||
        !FF_ALLOCZ_TYPED_ARRAY(ctx->mb_qscale,  ctx->m.mb_num))
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (avctx->active_thread_type == FF_THREAD_SLICE) {
 | 
			
		||||
        if (avctx->thread_count > MAX_THREADS) {
 | 
			
		||||
@ -1252,11 +1246,6 @@ static void dnxhd_load_picture(DNXHDEncContext *ctx, const AVFrame *frame)
 | 
			
		||||
        ctx->thread[i]->dct_uv_offset = ctx->m.uvlinesize*8;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    ctx->m.avctx->coded_frame->interlaced_frame = frame->interlaced_frame;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    ctx->cur_field = frame->interlaced_frame && !frame->top_field_first;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1317,12 +1306,6 @@ encode_coding_unit:
 | 
			
		||||
        goto encode_coding_unit;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->quality = ctx->qscale * FF_QP2LAMBDA;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    ff_side_data_set_encoder_stats(pkt, ctx->qscale * FF_QP2LAMBDA, NULL, 0, AV_PICTURE_TYPE_I);
 | 
			
		||||
 | 
			
		||||
    pkt->flags |= AV_PKT_FLAG_KEY;
 | 
			
		||||
 | 
			
		||||
@ -1169,12 +1169,6 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
 | 
			
		||||
 | 
			
		||||
    c->pix_fmt                = s->sys->pix_fmt;
 | 
			
		||||
    s->frame                  = frame;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    c->coded_frame->key_frame = 1;
 | 
			
		||||
    c->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    s->buf = pkt->data;
 | 
			
		||||
 | 
			
		||||
    dv_format_frame(s, pkt->data);
 | 
			
		||||
 | 
			
		||||
@ -527,14 +527,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
 | 
			
		||||
int ff_encode_preinit(AVCodecContext *avctx)
 | 
			
		||||
{
 | 
			
		||||
    int i;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame = av_frame_alloc();
 | 
			
		||||
    if (!avctx->coded_frame) {
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    }
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) {
 | 
			
		||||
        av_log(avctx, AV_LOG_ERROR, "The encoder timebase is not set.\n");
 | 
			
		||||
 | 
			
		||||
@ -745,12 +745,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
 | 
			
		||||
    if ((ret = ff_ffv1_allocate_initial_states(s)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (!s->transparency)
 | 
			
		||||
        s->plane_count = 2;
 | 
			
		||||
    if (!s->chroma_planes && s->version > 3)
 | 
			
		||||
@ -1174,11 +1168,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
    av_frame_unref(p);
 | 
			
		||||
    if ((ret = av_frame_ref(p, pict)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {
 | 
			
		||||
        put_rac(c, &keystate, 1);
 | 
			
		||||
@ -1244,12 +1233,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    if (avctx->flags & AV_CODEC_FLAG_PASS1)
 | 
			
		||||
        avctx->stats_out[0] = '\0';
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->key_frame = f->key_frame;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    f->picture_number++;
 | 
			
		||||
    pkt->size   = buf_p - pkt->data;
 | 
			
		||||
    pkt->pts    =
 | 
			
		||||
 | 
			
		||||
@ -245,21 +245,8 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
 | 
			
		||||
    //mark the frame type so the muxer can mux it correctly
 | 
			
		||||
    if (I_frame) {
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        avctx->coded_frame->pict_type      = AV_PICTURE_TYPE_I;
 | 
			
		||||
        avctx->coded_frame->key_frame      = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
        s->last_key_frame = avctx->frame_number;
 | 
			
		||||
        ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
 | 
			
		||||
    } else {
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
 | 
			
		||||
        avctx->coded_frame->key_frame = 0;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (I_frame)
 | 
			
		||||
 | 
			
		||||
@ -222,13 +222,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
 | 
			
		||||
    if (!avctx->extradata)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    s->bps = desc->comp[0].depth;
 | 
			
		||||
    s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;
 | 
			
		||||
    s->chroma = desc->nb_components > 2;
 | 
			
		||||
 | 
			
		||||
@ -413,18 +413,6 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static av_cold int encode_init_ls(AVCodecContext *ctx)
 | 
			
		||||
{
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    ctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define OFFSET(x) offsetof(JPEGLSContext, x)
 | 
			
		||||
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 | 
			
		||||
static const AVOption options[] = {
 | 
			
		||||
@ -450,7 +438,6 @@ AVCodec ff_jpegls_encoder = {
 | 
			
		||||
    .id             = AV_CODEC_ID_JPEGLS,
 | 
			
		||||
    .priv_data_size = sizeof(JPEGLSContext),
 | 
			
		||||
    .priv_class     = &jpegls_class,
 | 
			
		||||
    .init           = encode_init_ls,
 | 
			
		||||
    .capabilities   = AV_CODEC_CAP_FRAME_THREADS,
 | 
			
		||||
    .encode2        = encode_picture_ls,
 | 
			
		||||
    .pix_fmts       = (const enum AVPixelFormat[]) {
 | 
			
		||||
 | 
			
		||||
@ -121,13 +121,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
 | 
			
		||||
    if (!avctx->extradata)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
 | 
			
		||||
                            COMP_ZLIB_NORMAL :
 | 
			
		||||
                            av_clip(avctx->compression_level, 0, 9);
 | 
			
		||||
 | 
			
		||||
@ -276,20 +276,9 @@ static int libkvazaar_encode(AVCodecContext *avctx,
 | 
			
		||||
            av_log(avctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
 | 
			
		||||
            return AVERROR_EXTERNAL;
 | 
			
		||||
        }
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        avctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        ff_side_data_set_encoder_stats(avpkt, frame_info.qp * FF_QP2LAMBDA, NULL, 0, pict_type);
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        avctx->coded_frame->quality = frame_info.qp * FF_QP2LAMBDA;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        *got_packet_ptr = 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -346,11 +346,6 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt,
 | 
			
		||||
    // HACK: assumes no encoder delay, this is true until libtheora becomes
 | 
			
		||||
    // multithreaded (which will be disabled unless explicitly requested)
 | 
			
		||||
    pkt->pts = pkt->dts = frame->pts;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    if (!(o_packet.granulepos & h->keyframe_mask))
 | 
			
		||||
        pkt->flags |= AV_PKT_FLAG_KEY;
 | 
			
		||||
    *got_packet = 1;
 | 
			
		||||
 | 
			
		||||
@ -1179,28 +1179,12 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
 | 
			
		||||
        int pict_type;
 | 
			
		||||
        memcpy(pkt->data, cx_frame->buf, pkt->size);
 | 
			
		||||
        pkt->pts = pkt->dts = cx_frame->pts;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        avctx->coded_frame->pts       = cx_frame->pts;
 | 
			
		||||
        avctx->coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        if (!!(cx_frame->flags & VPX_FRAME_IS_KEY)) {
 | 
			
		||||
            pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
            avctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
            pkt->flags |= AV_PKT_FLAG_KEY;
 | 
			
		||||
        } else {
 | 
			
		||||
            pict_type = AV_PICTURE_TYPE_P;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
            avctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ff_side_data_set_encoder_stats(pkt, 0, cx_frame->sse + 1,
 | 
			
		||||
@ -1209,14 +1193,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        if (cx_frame->have_sse) {
 | 
			
		||||
            int i;
 | 
			
		||||
            /* Beware of the Y/U/V/all order! */
 | 
			
		||||
#if FF_API_CODED_FRAME && FF_API_ERROR_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
            avctx->coded_frame->error[0] = cx_frame->sse[1];
 | 
			
		||||
            avctx->coded_frame->error[1] = cx_frame->sse[2];
 | 
			
		||||
            avctx->coded_frame->error[2] = cx_frame->sse[3];
 | 
			
		||||
            avctx->coded_frame->error[3] = 0;    // alpha
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
            for (i = 0; i < 3; ++i) {
 | 
			
		||||
                avctx->error[i] += cx_frame->sse[i + 1];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -481,23 +481,12 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
 | 
			
		||||
        av_log(ctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
 | 
			
		||||
        return AVERROR_EXTERNAL;
 | 
			
		||||
    }
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    ctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe;
 | 
			
		||||
    if (ret) {
 | 
			
		||||
        ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
 | 
			
		||||
        if (wallclock)
 | 
			
		||||
            ff_side_data_set_prft(pkt, wallclock);
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        ctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    *got_packet = ret;
 | 
			
		||||
 | 
			
		||||
@ -566,12 +566,6 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
        return AVERROR_EXTERNAL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if X265_BUILD >= 130
 | 
			
		||||
    if (x265pic_out.sliceType == X265_TYPE_B)
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
@ -165,11 +165,6 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pts = pic_out.i_pts;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    pkt->pts = pic_out.i_pts;
 | 
			
		||||
    if (avctx->has_b_frames) {
 | 
			
		||||
        if (!x4->out_frame_count)
 | 
			
		||||
@ -194,29 +189,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    default:
 | 
			
		||||
        pict_type = AV_PICTURE_TYPE_NONE;
 | 
			
		||||
    }
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    /* There is no IDR frame in AVS JiZhun */
 | 
			
		||||
    /* Sequence header is used as a flag */
 | 
			
		||||
    if (pic_out.i_type == XAVS_TYPE_I) {
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
        pkt->flags |= AV_PKT_FLAG_KEY;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
 | 
			
		||||
 | 
			
		||||
    x4->out_frame_count++;
 | 
			
		||||
 | 
			
		||||
@ -828,31 +828,13 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
        else
 | 
			
		||||
            pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        avctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
        avctx->coded_frame->quality = xvid_enc_stats.quant * FF_QP2LAMBDA;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        ff_side_data_set_encoder_stats(pkt, xvid_enc_stats.quant * FF_QP2LAMBDA, NULL, 0, pict_type);
 | 
			
		||||
 | 
			
		||||
        if (xvid_enc_frame.out_flags & XVID_KEYFRAME) {
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
            avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
            pkt->flags  |= AV_PKT_FLAG_KEY;
 | 
			
		||||
            if (x->quicktime_format)
 | 
			
		||||
                return xvid_strip_vol_header(avctx, pkt,
 | 
			
		||||
                                             xvid_enc_stats.hlength, xerr);
 | 
			
		||||
        } else {
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
            avctx->coded_frame->key_frame = 0;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        pkt->size = xerr;
 | 
			
		||||
 | 
			
		||||
@ -281,13 +281,6 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    s->scratch = av_malloc_array(avctx->width + 1, sizeof(*s->scratch));
 | 
			
		||||
    if (!s->scratch)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
 | 
			
		||||
@ -1605,12 +1605,6 @@ static void frame_end(MpegEncContext *s)
 | 
			
		||||
    if (s->pict_type!= AV_PICTURE_TYPE_B)
 | 
			
		||||
        s->last_non_b_pict_type = s->pict_type;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    av_frame_unref(s->avctx->coded_frame);
 | 
			
		||||
    av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
#if FF_API_ERROR_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    memcpy(s->current_picture.f->error, s->current_picture.encoding_error,
 | 
			
		||||
 | 
			
		||||
@ -2041,12 +2041,6 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
 | 
			
		||||
        goto error;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    ff_side_data_set_encoder_stats(pkt,
 | 
			
		||||
        (lock_params.frameAvgQP - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -127,24 +127,11 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static av_cold int pam_encode_init(AVCodecContext *avctx)
 | 
			
		||||
{
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AVCodec ff_pam_encoder = {
 | 
			
		||||
    .name           = "pam",
 | 
			
		||||
    .long_name      = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
 | 
			
		||||
    .type           = AVMEDIA_TYPE_VIDEO,
 | 
			
		||||
    .id             = AV_CODEC_ID_PAM,
 | 
			
		||||
    .init           = pam_encode_init,
 | 
			
		||||
    .encode2        = pam_encode_frame,
 | 
			
		||||
    .pix_fmts       = (const enum AVPixelFormat[]){
 | 
			
		||||
        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
 | 
			
		||||
 | 
			
		||||
@ -33,18 +33,6 @@
 | 
			
		||||
 | 
			
		||||
static const uint32_t monoblack_pal[16] = { 0x000000, 0xFFFFFF };
 | 
			
		||||
 | 
			
		||||
static av_cold int pcx_encode_init(AVCodecContext *avctx)
 | 
			
		||||
{
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * PCX run-length encoder
 | 
			
		||||
 * @param dst output buffer
 | 
			
		||||
@ -209,7 +197,6 @@ AVCodec ff_pcx_encoder = {
 | 
			
		||||
    .long_name      = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
 | 
			
		||||
    .type           = AVMEDIA_TYPE_VIDEO,
 | 
			
		||||
    .id             = AV_CODEC_ID_PCX,
 | 
			
		||||
    .init           = pcx_encode_init,
 | 
			
		||||
    .encode2        = pcx_encode_frame,
 | 
			
		||||
    .pix_fmts       = (const enum AVPixelFormat[]){
 | 
			
		||||
        AV_PIX_FMT_RGB24,
 | 
			
		||||
 | 
			
		||||
@ -1008,13 +1008,6 @@ static av_cold int png_enc_init(AVCodecContext *avctx)
 | 
			
		||||
        avctx->bits_per_coded_sample = 8;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    ff_llvidencdsp_init(&s->llvidencdsp);
 | 
			
		||||
 | 
			
		||||
    if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK)
 | 
			
		||||
 | 
			
		||||
@ -148,25 +148,12 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static av_cold int pnm_encode_init(AVCodecContext *avctx)
 | 
			
		||||
{
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if CONFIG_PGM_ENCODER
 | 
			
		||||
AVCodec ff_pgm_encoder = {
 | 
			
		||||
    .name           = "pgm",
 | 
			
		||||
    .long_name      = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
 | 
			
		||||
    .type           = AVMEDIA_TYPE_VIDEO,
 | 
			
		||||
    .id             = AV_CODEC_ID_PGM,
 | 
			
		||||
    .init           = pnm_encode_init,
 | 
			
		||||
    .encode2        = pnm_encode_frame,
 | 
			
		||||
    .pix_fmts       = (const enum AVPixelFormat[]){
 | 
			
		||||
        AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE
 | 
			
		||||
@ -181,7 +168,6 @@ AVCodec ff_pgmyuv_encoder = {
 | 
			
		||||
    .long_name      = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
 | 
			
		||||
    .type           = AVMEDIA_TYPE_VIDEO,
 | 
			
		||||
    .id             = AV_CODEC_ID_PGMYUV,
 | 
			
		||||
    .init           = pnm_encode_init,
 | 
			
		||||
    .encode2        = pnm_encode_frame,
 | 
			
		||||
    .pix_fmts       = (const enum AVPixelFormat[]){
 | 
			
		||||
        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE
 | 
			
		||||
@ -196,7 +182,6 @@ AVCodec ff_ppm_encoder = {
 | 
			
		||||
    .long_name      = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
 | 
			
		||||
    .type           = AVMEDIA_TYPE_VIDEO,
 | 
			
		||||
    .id             = AV_CODEC_ID_PPM,
 | 
			
		||||
    .init           = pnm_encode_init,
 | 
			
		||||
    .encode2        = pnm_encode_frame,
 | 
			
		||||
    .pix_fmts       = (const enum AVPixelFormat[]){
 | 
			
		||||
        AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE
 | 
			
		||||
@ -211,7 +196,6 @@ AVCodec ff_pbm_encoder = {
 | 
			
		||||
    .long_name      = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
 | 
			
		||||
    .type           = AVMEDIA_TYPE_VIDEO,
 | 
			
		||||
    .id             = AV_CODEC_ID_PBM,
 | 
			
		||||
    .init           = pnm_encode_init,
 | 
			
		||||
    .encode2        = pnm_encode_frame,
 | 
			
		||||
    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE,
 | 
			
		||||
                                                  AV_PIX_FMT_NONE },
 | 
			
		||||
@ -225,7 +209,6 @@ AVCodec ff_pfm_encoder = {
 | 
			
		||||
    .long_name      = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"),
 | 
			
		||||
    .type           = AVMEDIA_TYPE_VIDEO,
 | 
			
		||||
    .id             = AV_CODEC_ID_PFM,
 | 
			
		||||
    .init           = pnm_encode_init,
 | 
			
		||||
    .encode2        = pnm_encode_frame,
 | 
			
		||||
    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32,
 | 
			
		||||
                                                    AV_PIX_FMT_NONE },
 | 
			
		||||
 | 
			
		||||
@ -1179,12 +1179,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
 | 
			
		||||
    int interlaced = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);
 | 
			
		||||
 | 
			
		||||
    avctx->bits_per_raw_sample = 10;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    ctx->fdct      = prores_fdct;
 | 
			
		||||
    ctx->scantable = interlaced ? ff_prores_interlaced_scan
 | 
			
		||||
 | 
			
		||||
@ -321,11 +321,6 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (for_user) {
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        dst->coded_frame = src->coded_frame;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
        if (dst->codec->update_thread_context_for_user)
 | 
			
		||||
            err = dst->codec->update_thread_context_for_user(dst, src);
 | 
			
		||||
    } else {
 | 
			
		||||
 | 
			
		||||
@ -1555,12 +1555,6 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
 | 
			
		||||
            return AVERROR_INVALIDDATA;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
        avctx->coded_frame->pict_type = pict_type;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if QSV_VERSION_ATLEAST(1, 26)
 | 
			
		||||
        if (avctx->codec_id == AV_CODEC_ID_H264) {
 | 
			
		||||
            enc_buf = bs->ExtParam;
 | 
			
		||||
 | 
			
		||||
@ -391,13 +391,6 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->key_frame = s->key_frame;
 | 
			
		||||
    avctx->coded_frame->pict_type = s->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (s->key_frame)
 | 
			
		||||
        pkt->flags |= AV_PKT_FLAG_KEY;
 | 
			
		||||
    *got_packet = 1;
 | 
			
		||||
 | 
			
		||||
@ -36,11 +36,6 @@ static av_cold int raw_encode_init(AVCodecContext *avctx)
 | 
			
		||||
{
 | 
			
		||||
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);
 | 
			
		||||
    if(!avctx->codec_tag)
 | 
			
		||||
        avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
 | 
			
		||||
 | 
			
		||||
@ -100,13 +100,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
    unsigned int width, height, depth, dimension;
 | 
			
		||||
    unsigned int bytes_per_channel, pixmax, put_be;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    width  = avctx->width;
 | 
			
		||||
    height = avctx->height;
 | 
			
		||||
    bytes_per_channel = 1;
 | 
			
		||||
 | 
			
		||||
@ -1618,22 +1618,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
        s->lambda = 0;
 | 
			
		||||
    }//else keep previous frame's qlog until after motion estimation
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    av_frame_unref(avctx->coded_frame);
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (s->current_picture->data[0]) {
 | 
			
		||||
        int w = s->avctx->width;
 | 
			
		||||
        int h = s->avctx->height;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
        ret = av_frame_make_writable(s->current_picture);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        s->mpvencdsp.draw_edges(s->current_picture->data[0],
 | 
			
		||||
                                s->current_picture->linesize[0], w   , h   ,
 | 
			
		||||
                                EDGE_WIDTH  , EDGE_WIDTH  , EDGE_TOP | EDGE_BOTTOM);
 | 
			
		||||
@ -1649,13 +1637,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ff_snow_frame_start(s);
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    ret = av_frame_ref(avctx->coded_frame, s->current_picture);
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    s->m.current_picture_ptr= &s->m.current_picture;
 | 
			
		||||
    s->m.current_picture.f = s->current_picture;
 | 
			
		||||
 | 
			
		||||
@ -615,13 +615,6 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
        s->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    s->quality = pict->quality;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = s->pict_type;
 | 
			
		||||
    avctx->coded_frame->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    ff_side_data_set_encoder_stats(pkt, pict->quality, NULL, 0, s->pict_type);
 | 
			
		||||
 | 
			
		||||
    svq1_write_header(s, s->pict_type);
 | 
			
		||||
 | 
			
		||||
@ -184,13 +184,6 @@ static av_cold int targa_encode_init(AVCodecContext *avctx)
 | 
			
		||||
        return AVERROR(EINVAL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -533,12 +533,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    s->avctx = avctx;
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
 | 
			
		||||
@ -621,15 +621,8 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
     * At least currently Ut Video is IDR only.
 | 
			
		||||
     * Set flags accordingly.
 | 
			
		||||
     */
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    pkt->size   = bytestream2_tell_p(&pb);
 | 
			
		||||
    pkt->flags |= AV_PKT_FLAG_KEY;
 | 
			
		||||
    pkt->size   = bytestream2_tell_p(&pb);
 | 
			
		||||
 | 
			
		||||
    /* Packet should be done */
 | 
			
		||||
    *got_packet = 1;
 | 
			
		||||
 | 
			
		||||
@ -101,12 +101,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
 | 
			
		||||
        return AVERROR(EINVAL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    ff_v210enc_init(s);
 | 
			
		||||
 | 
			
		||||
    avctx->bits_per_coded_sample = 20;
 | 
			
		||||
 | 
			
		||||
@ -51,13 +51,6 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
        return ret;
 | 
			
		||||
    dst = pkt->data;
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->key_frame = 1;
 | 
			
		||||
    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    y = (uint16_t *)pic->data[0];
 | 
			
		||||
    u = (uint16_t *)pic->data[1];
 | 
			
		||||
    v = (uint16_t *)pic->data[2];
 | 
			
		||||
 | 
			
		||||
@ -51,9 +51,6 @@
 | 
			
		||||
 * at once through the bump. This improves the git bisect-ability of the change.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef FF_API_CODED_FRAME
 | 
			
		||||
#define FF_API_CODED_FRAME       (LIBAVCODEC_VERSION_MAJOR < 59)
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef FF_API_OPENH264_SLICE_MODE
 | 
			
		||||
#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 59)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@ -180,12 +180,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 | 
			
		||||
    c->curfrm++;
 | 
			
		||||
    if(c->curfrm == c->keyint)
 | 
			
		||||
        c->curfrm = 0;
 | 
			
		||||
#if FF_API_CODED_FRAME
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    avctx->coded_frame->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
 | 
			
		||||
    avctx->coded_frame->key_frame = keyframe;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    palptr = (avctx->pix_fmt == AV_PIX_FMT_PAL8) ? (uint32_t *)p->data[1] : NULL;
 | 
			
		||||
    chpal = !keyframe && palptr && memcmp(palptr, c->pal2, 1024);
 | 
			
		||||
 | 
			
		||||
@ -981,27 +981,12 @@ fail:
 | 
			
		||||
 | 
			
		||||
static int v4l2_read_packet(AVFormatContext *ctx, AVPacket *pkt)
 | 
			
		||||
{
 | 
			
		||||
#if FF_API_CODED_FRAME && FF_API_LAVF_AVCTX
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    struct video_data *s = ctx->priv_data;
 | 
			
		||||
    AVFrame *frame = ctx->streams[0]->codec->coded_frame;
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
    int res;
 | 
			
		||||
 | 
			
		||||
    if ((res = mmap_read_frame(ctx, pkt)) < 0) {
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if FF_API_CODED_FRAME && FF_API_LAVF_AVCTX
 | 
			
		||||
FF_DISABLE_DEPRECATION_WARNINGS
 | 
			
		||||
    if (frame && s->interlaced) {
 | 
			
		||||
        frame->interlaced_frame = 1;
 | 
			
		||||
        frame->top_field_first = s->top_field_first;
 | 
			
		||||
    }
 | 
			
		||||
FF_ENABLE_DEPRECATION_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    return pkt->size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user