History

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.)

Andreas Rheinhardt committed 5 years ago

Commit 11bc7901 parent 95054bf42 files · +1 −407Browse files

Unified · Split

42 files
  1. libavcodec/aliaspixenc.c +0 −7
  2. libavcodec/avcodec.c +0 −10
  3. libavcodec/avcodec.h +0 −11
  4. libavcodec/bmpenc.c +0 −6
  5. libavcodec/dnxhdenc.c +0 −17
  6. libavcodec/dvenc.c +0 −6
  7. libavcodec/encode.c +0 −8
  8. libavcodec/ffv1enc.c +0 −17
  9. libavcodec/flashsvenc.c +0 −13
  10. libavcodec/huffyuvenc.c +0 −7
  11. libavcodec/jpeglsenc.c +0 −13
  12. libavcodec/lclenc.c +0 −7
  13. libavcodec/libkvazaar.c +0 −11
  14. libavcodec/libtheoraenc.c +0 −5
  15. libavcodec/libvpxenc.c +0 −24
  16. libavcodec/libx264.c +0 −11
  17. libavcodec/libx265.c +0 −6
  18. libavcodec/libxavs.c +0 −21
  19. libavcodec/libxvid.c +0 −18
  20. libavcodec/ljpegenc.c +0 −7
  21. libavcodec/mpegvideo_enc.c +0 −6
  22. libavcodec/nvenc.c +0 −6
  23. libavcodec/pamenc.c +0 −13
  24. libavcodec/pcxenc.c +0 −13
  25. libavcodec/pngenc.c +0 −7
  26. libavcodec/pnmenc.c +0 −17
  27. libavcodec/proresenc_kostya.c +0 −6
  28. libavcodec/pthread_frame.c +0 −5
  29. libavcodec/qsvenc.c +0 −6
  30. libavcodec/qtrleenc.c +0 −7
  31. libavcodec/rawenc.c +0 −5
  32. libavcodec/sgienc.c +0 −7
  33. libavcodec/snowenc.c +0 −19
  34. libavcodec/svq1enc.c +0 −7
  35. libavcodec/targaenc.c +0 −7
  36. libavcodec/tiffenc.c +0 −6
  37. libavcodec/utvideoenc.c +1 −8
  38. libavcodec/v210enc.c +0 −6
  39. libavcodec/v410enc.c +0 −7
  40. libavcodec/version.h +0 −3
  41. libavcodec/zmbvenc.c +0 −6
  42. libavdevice/v4l2.c +0 −15
libavcodec/aliaspixenc.c+0−7
@@ -33,13 +33,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 32 unmodified lines
3333 int width, height, bits_pixel, i, j, length, ret;
3434 uint8_t *in_buf, *buf;
3535
36−#if FF_API_CODED_FRAME
37−FF_DISABLE_DEPRECATION_WARNINGS
38− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
39− avctx->coded_frame->key_frame = 1;
40−FF_ENABLE_DEPRECATION_WARNINGS
41−#endif
42−
4336 width = avctx->width;
4437 height = avctx->height;
4538
libavcodec/avcodec.c+0−10
@@ -400,11 +400,6 @@ free_and_end: · 399 unmodified lines
400400 av_opt_free(avctx);
401401
402402 if (av_codec_is_encoder(avctx->codec)) {
403−#if FF_API_CODED_FRAME
404−FF_DISABLE_DEPRECATION_WARNINGS
405− av_frame_free(&avctx->coded_frame);
406−FF_ENABLE_DEPRECATION_WARNINGS
407−#endif
408403 av_freep(&avctx->extradata);
409404 avctx->extradata_size = 0;
410405 }
@@ -578,11 +573,6 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 167 unmodified lines
578573 av_freep(&avctx->priv_data);
579574 if (av_codec_is_encoder(avctx->codec)) {
580575 av_freep(&avctx->extradata);
581−#if FF_API_CODED_FRAME
582−FF_DISABLE_DEPRECATION_WARNINGS
583− av_frame_free(&avctx->coded_frame);
584−FF_ENABLE_DEPRECATION_WARNINGS
585−#endif
586576 } else if (av_codec_is_decoder(avctx->codec))
587577 av_freep(&avctx->subtitle_header);
588578
libavcodec/avcodec.h+0−11
@@ -1578,17 +1578,6 @@ typedef struct AVCodecContext { · 1577 unmodified lines
15781578 */
15791579 int lowres;
15801580
1581−#if FF_API_CODED_FRAME
1582− /**
1583− * the picture in the bitstream
1584− * - encoding: Set by libavcodec.
1585− * - decoding: unused
1586− *
1587− * @deprecated use the quality factor packet side data instead
1588− */
1589− attribute_deprecated AVFrame *coded_frame;
1590−#endif
1591−
15921581 /**
15931582 * thread count
15941583 * is used to decide how many independent tasks should be passed to execute()
libavcodec/bmpenc.c+0−6
@@ -74,12 +74,6 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 73 unmodified lines
7474 int bit_count = avctx->bits_per_coded_sample;
7575 uint8_t *ptr, *buf;
7676
77−#if FF_API_CODED_FRAME
78−FF_DISABLE_DEPRECATION_WARNINGS
79− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
80− avctx->coded_frame->key_frame = 1;
81−FF_ENABLE_DEPRECATION_WARNINGS
82−#endif
8377 switch (avctx->pix_fmt) {
8478 case AV_PIX_FMT_RGB444:
8579 compression = BMP_BITFIELDS;
libavcodec/dnxhdenc.c+0−17
@@ -499,12 +499,6 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) · 498 unmodified lines
499499 !FF_ALLOCZ_TYPED_ARRAY(ctx->mb_bits, ctx->m.mb_num) ||
500500 !FF_ALLOCZ_TYPED_ARRAY(ctx->mb_qscale, ctx->m.mb_num))
501501 return AVERROR(ENOMEM);
502−#if FF_API_CODED_FRAME
503−FF_DISABLE_DEPRECATION_WARNINGS
504− avctx->coded_frame->key_frame = 1;
505− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
506−FF_ENABLE_DEPRECATION_WARNINGS
507−#endif
508502
509503 if (avctx->active_thread_type == FF_THREAD_SLICE) {
510504 if (avctx->thread_count > MAX_THREADS) {
@@ -1252,11 +1246,6 @@ static void dnxhd_load_picture(DNXHDEncContext *ctx, const AVFrame *frame) · 741 unmodified lines
12521246 ctx->thread[i]->dct_uv_offset = ctx->m.uvlinesize*8;
12531247 }
12541248
1255−#if FF_API_CODED_FRAME
1256−FF_DISABLE_DEPRECATION_WARNINGS
1257− ctx->m.avctx->coded_frame->interlaced_frame = frame->interlaced_frame;
1258−FF_ENABLE_DEPRECATION_WARNINGS
1259−#endif
12601249 ctx->cur_field = frame->interlaced_frame && !frame->top_field_first;
12611250 }
12621251
@@ -1317,12 +1306,6 @@ encode_coding_unit: · 54 unmodified lines
13171306 goto encode_coding_unit;
13181307 }
13191308
1320−#if FF_API_CODED_FRAME
1321−FF_DISABLE_DEPRECATION_WARNINGS
1322− avctx->coded_frame->quality = ctx->qscale * FF_QP2LAMBDA;
1323−FF_ENABLE_DEPRECATION_WARNINGS
1324−#endif
1325−
13261309 ff_side_data_set_encoder_stats(pkt, ctx->qscale * FF_QP2LAMBDA, NULL, 0, AV_PICTURE_TYPE_I);
13271310
13281311 pkt->flags |= AV_PKT_FLAG_KEY;
libavcodec/dvenc.c+0−6
@@ -1169,12 +1169,6 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt, · 1168 unmodified lines
11691169
11701170 c->pix_fmt = s->sys->pix_fmt;
11711171 s->frame = frame;
1172−#if FF_API_CODED_FRAME
1173−FF_DISABLE_DEPRECATION_WARNINGS
1174− c->coded_frame->key_frame = 1;
1175− c->coded_frame->pict_type = AV_PICTURE_TYPE_I;
1176−FF_ENABLE_DEPRECATION_WARNINGS
1177−#endif
11781172 s->buf = pkt->data;
11791173
11801174 dv_format_frame(s, pkt->data);
libavcodec/encode.c+0−8
@@ -527,14 +527,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, · 526 unmodified lines
527527 int ff_encode_preinit(AVCodecContext *avctx)
528528 {
529529 int i;
530−#if FF_API_CODED_FRAME
531−FF_DISABLE_DEPRECATION_WARNINGS
532− avctx->coded_frame = av_frame_alloc();
533− if (!avctx->coded_frame) {
534− return AVERROR(ENOMEM);
535− }
536−FF_ENABLE_DEPRECATION_WARNINGS
537−#endif
538530
539531 if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) {
540532 av_log(avctx, AV_LOG_ERROR, "The encoder timebase is not set.\n");
libavcodec/ffv1enc.c+0−17
@@ -745,12 +745,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 744 unmodified lines
745745 if ((ret = ff_ffv1_allocate_initial_states(s)) < 0)
746746 return ret;
747747
748−#if FF_API_CODED_FRAME
749−FF_DISABLE_DEPRECATION_WARNINGS
750− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
751−FF_ENABLE_DEPRECATION_WARNINGS
752−#endif
753−
754748 if (!s->transparency)
755749 s->plane_count = 2;
756750 if (!s->chroma_planes && s->version > 3)
@@ -1174,11 +1168,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 417 unmodified lines
11741168 av_frame_unref(p);
11751169 if ((ret = av_frame_ref(p, pict)) < 0)
11761170 return ret;
1177−#if FF_API_CODED_FRAME
1178−FF_DISABLE_DEPRECATION_WARNINGS
1179− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
1180−FF_ENABLE_DEPRECATION_WARNINGS
1181−#endif
11821171
11831172 if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {
11841173 put_rac(c, &keystate, 1);
@@ -1244,12 +1233,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 59 unmodified lines
12441233 if (avctx->flags & AV_CODEC_FLAG_PASS1)
12451234 avctx->stats_out[0] = '\0';
12461235
1247−#if FF_API_CODED_FRAME
1248−FF_DISABLE_DEPRECATION_WARNINGS
1249− avctx->coded_frame->key_frame = f->key_frame;
1250−FF_ENABLE_DEPRECATION_WARNINGS
1251−#endif
1252−
12531236 f->picture_number++;
12541237 pkt->size = buf_p - pkt->data;
12551238 pkt->pts =
libavcodec/flashsvenc.c+0−13
@@ -245,21 +245,8 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 244 unmodified lines
245245
246246 //mark the frame type so the muxer can mux it correctly
247247 if (I_frame) {
248−#if FF_API_CODED_FRAME
249−FF_DISABLE_DEPRECATION_WARNINGS
250− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
251− avctx->coded_frame->key_frame = 1;
252−FF_ENABLE_DEPRECATION_WARNINGS
253−#endif
254248 s->last_key_frame = avctx->frame_number;
255249 ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
256− } else {
257−#if FF_API_CODED_FRAME
258−FF_DISABLE_DEPRECATION_WARNINGS
259− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
260− avctx->coded_frame->key_frame = 0;
261−FF_ENABLE_DEPRECATION_WARNINGS
262−#endif
263250 }
264251
265252 if (I_frame)
libavcodec/huffyuvenc.c+0−7
@@ -222,13 +222,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 221 unmodified lines
222222 if (!avctx->extradata)
223223 return AVERROR(ENOMEM);
224224
225−#if FF_API_CODED_FRAME
226−FF_DISABLE_DEPRECATION_WARNINGS
227− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
228− avctx->coded_frame->key_frame = 1;
229−FF_ENABLE_DEPRECATION_WARNINGS
230−#endif
231−
232225 s->bps = desc->comp[0].depth;
233226 s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;
234227 s->chroma = desc->nb_components > 2;
libavcodec/jpeglsenc.c+0−13
@@ -413,18 +413,6 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, · 412 unmodified lines
413413 return 0;
414414 }
415415
416−static av_cold int encode_init_ls(AVCodecContext *ctx)
417−{
418−#if FF_API_CODED_FRAME
419−FF_DISABLE_DEPRECATION_WARNINGS
420− ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
421− ctx->coded_frame->key_frame = 1;
422−FF_ENABLE_DEPRECATION_WARNINGS
423−#endif
424−
425− return 0;
426−}
427−
428416 #define OFFSET(x) offsetof(JPEGLSContext, x)
429417 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
430418 static const AVOption options[] = {
@@ -450,7 +438,6 @@ AVCodec ff_jpegls_encoder = { · 19 unmodified lines
450438 .id = AV_CODEC_ID_JPEGLS,
451439 .priv_data_size = sizeof(JPEGLSContext),
452440 .priv_class = &jpegls_class,
453− .init = encode_init_ls,
454441 .capabilities = AV_CODEC_CAP_FRAME_THREADS,
455442 .encode2 = encode_picture_ls,
456443 .pix_fmts = (const enum AVPixelFormat[]) {
libavcodec/lclenc.c+0−7
@@ -121,13 +121,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 120 unmodified lines
121121 if (!avctx->extradata)
122122 return AVERROR(ENOMEM);
123123
124−#if FF_API_CODED_FRAME
125−FF_DISABLE_DEPRECATION_WARNINGS
126− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
127− avctx->coded_frame->key_frame = 1;
128−FF_ENABLE_DEPRECATION_WARNINGS
129−#endif
130−
131124 c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
132125 COMP_ZLIB_NORMAL :
133126 av_clip(avctx->compression_level, 0, 9);
libavcodec/libkvazaar.c+0−11
@@ -276,20 +276,9 @@ static int libkvazaar_encode(AVCodecContext *avctx, · 275 unmodified lines
276276 av_log(avctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
277277 return AVERROR_EXTERNAL;
278278 }
279−#if FF_API_CODED_FRAME
280−FF_DISABLE_DEPRECATION_WARNINGS
281− avctx->coded_frame->pict_type = pict_type;
282−FF_ENABLE_DEPRECATION_WARNINGS
283−#endif
284279
285280 ff_side_data_set_encoder_stats(avpkt, frame_info.qp * FF_QP2LAMBDA, NULL, 0, pict_type);
286281
287−#if FF_API_CODED_FRAME
288−FF_DISABLE_DEPRECATION_WARNINGS
289− avctx->coded_frame->quality = frame_info.qp * FF_QP2LAMBDA;
290−FF_ENABLE_DEPRECATION_WARNINGS
291−#endif
292−
293282 *got_packet_ptr = 1;
294283 }
295284
libavcodec/libtheoraenc.c+0−5
@@ -346,11 +346,6 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt, · 345 unmodified lines
346346 // HACK: assumes no encoder delay, this is true until libtheora becomes
347347 // multithreaded (which will be disabled unless explicitly requested)
348348 pkt->pts = pkt->dts = frame->pts;
349−#if FF_API_CODED_FRAME
350−FF_DISABLE_DEPRECATION_WARNINGS
351− avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
352−FF_ENABLE_DEPRECATION_WARNINGS
353−#endif
354349 if (!(o_packet.granulepos & h->keyframe_mask))
355350 pkt->flags |= AV_PKT_FLAG_KEY;
356351 *got_packet = 1;
libavcodec/libvpxenc.c+0−24
@@ -1179,28 +1179,12 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, · 1178 unmodified lines
11791179 int pict_type;
11801180 memcpy(pkt->data, cx_frame->buf, pkt->size);
11811181 pkt->pts = pkt->dts = cx_frame->pts;
1182−#if FF_API_CODED_FRAME
1183−FF_DISABLE_DEPRECATION_WARNINGS
1184− avctx->coded_frame->pts = cx_frame->pts;
1185− avctx->coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
1186−FF_ENABLE_DEPRECATION_WARNINGS
1187−#endif
11881182
11891183 if (!!(cx_frame->flags & VPX_FRAME_IS_KEY)) {
11901184 pict_type = AV_PICTURE_TYPE_I;
1191−#if FF_API_CODED_FRAME
1192−FF_DISABLE_DEPRECATION_WARNINGS
1193− avctx->coded_frame->pict_type = pict_type;
1194−FF_ENABLE_DEPRECATION_WARNINGS
1195−#endif
11961185 pkt->flags |= AV_PKT_FLAG_KEY;
11971186 } else {
11981187 pict_type = AV_PICTURE_TYPE_P;
1199−#if FF_API_CODED_FRAME
1200−FF_DISABLE_DEPRECATION_WARNINGS
1201− avctx->coded_frame->pict_type = pict_type;
1202−FF_ENABLE_DEPRECATION_WARNINGS
1203−#endif
12041188 }
12051189
12061190 ff_side_data_set_encoder_stats(pkt, 0, cx_frame->sse + 1,
@@ -1209,14 +1193,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 2 unmodified lines
12091193 if (cx_frame->have_sse) {
12101194 int i;
12111195 /* Beware of the Y/U/V/all order! */
1212−#if FF_API_CODED_FRAME && FF_API_ERROR_FRAME
1213−FF_DISABLE_DEPRECATION_WARNINGS
1214− avctx->coded_frame->error[0] = cx_frame->sse[1];
1215− avctx->coded_frame->error[1] = cx_frame->sse[2];
1216− avctx->coded_frame->error[2] = cx_frame->sse[3];
1217− avctx->coded_frame->error[3] = 0; // alpha
1218−FF_ENABLE_DEPRECATION_WARNINGS
1219−#endif
12201196 for (i = 0; i < 3; ++i) {
12211197 avctx->error[i] += cx_frame->sse[i + 1];
12221198 }
libavcodec/libx264.c+0−11
@@ -481,23 +481,12 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, · 480 unmodified lines
481481 av_log(ctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
482482 return AVERROR_EXTERNAL;
483483 }
484−#if FF_API_CODED_FRAME
485−FF_DISABLE_DEPRECATION_WARNINGS
486− ctx->coded_frame->pict_type = pict_type;
487−FF_ENABLE_DEPRECATION_WARNINGS
488−#endif
489484
490485 pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe;
491486 if (ret) {
492487 ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
493488 if (wallclock)
494489 ff_side_data_set_prft(pkt, wallclock);
495−
496−#if FF_API_CODED_FRAME
497−FF_DISABLE_DEPRECATION_WARNINGS
498− ctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
499−FF_ENABLE_DEPRECATION_WARNINGS
500−#endif
501490 }
502491
503492 *got_packet = ret;
libavcodec/libx265.c+0−6
@@ -566,12 +566,6 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 565 unmodified lines
566566 return AVERROR_EXTERNAL;
567567 }
568568
569−#if FF_API_CODED_FRAME
570−FF_DISABLE_DEPRECATION_WARNINGS
571− avctx->coded_frame->pict_type = pict_type;
572−FF_ENABLE_DEPRECATION_WARNINGS
573−#endif
574−
575569 #if X265_BUILD >= 130
576570 if (x265pic_out.sliceType == X265_TYPE_B)
577571 #else
libavcodec/libxavs.c+0−21
@@ -165,11 +165,6 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt, · 164 unmodified lines
165165 return 0;
166166 }
167167
168−#if FF_API_CODED_FRAME
169−FF_DISABLE_DEPRECATION_WARNINGS
170− avctx->coded_frame->pts = pic_out.i_pts;
171−FF_ENABLE_DEPRECATION_WARNINGS
172−#endif
173168 pkt->pts = pic_out.i_pts;
174169 if (avctx->has_b_frames) {
175170 if (!x4->out_frame_count)
@@ -194,29 +189,13 @@ FF_ENABLE_DEPRECATION_WARNINGS · 18 unmodified lines
194189 default:
195190 pict_type = AV_PICTURE_TYPE_NONE;
196191 }
197−#if FF_API_CODED_FRAME
198−FF_DISABLE_DEPRECATION_WARNINGS
199− avctx->coded_frame->pict_type = pict_type;
200−FF_ENABLE_DEPRECATION_WARNINGS
201−#endif
202192
203193 /* There is no IDR frame in AVS JiZhun */
204194 /* Sequence header is used as a flag */
205195 if (pic_out.i_type == XAVS_TYPE_I) {
206−#if FF_API_CODED_FRAME
207−FF_DISABLE_DEPRECATION_WARNINGS
208− avctx->coded_frame->key_frame = 1;
209−FF_ENABLE_DEPRECATION_WARNINGS
210−#endif
211196 pkt->flags |= AV_PKT_FLAG_KEY;
212197 }
213198
214−#if FF_API_CODED_FRAME
215−FF_DISABLE_DEPRECATION_WARNINGS
216− avctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
217−FF_ENABLE_DEPRECATION_WARNINGS
218−#endif
219−
220199 ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
221200
222201 x4->out_frame_count++;
libavcodec/libxvid.c+0−18
@@ -828,31 +828,13 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 827 unmodified lines
828828 else
829829 pict_type = AV_PICTURE_TYPE_I;
830830
831−#if FF_API_CODED_FRAME
832−FF_DISABLE_DEPRECATION_WARNINGS
833− avctx->coded_frame->pict_type = pict_type;
834− avctx->coded_frame->quality = xvid_enc_stats.quant * FF_QP2LAMBDA;
835−FF_ENABLE_DEPRECATION_WARNINGS
836−#endif
837−
838831 ff_side_data_set_encoder_stats(pkt, xvid_enc_stats.quant * FF_QP2LAMBDA, NULL, 0, pict_type);
839832
840833 if (xvid_enc_frame.out_flags & XVID_KEYFRAME) {
841−#if FF_API_CODED_FRAME
842−FF_DISABLE_DEPRECATION_WARNINGS
843− avctx->coded_frame->key_frame = 1;
844−FF_ENABLE_DEPRECATION_WARNINGS
845−#endif
846834 pkt->flags |= AV_PKT_FLAG_KEY;
847835 if (x->quicktime_format)
848836 return xvid_strip_vol_header(avctx, pkt,
849837 xvid_enc_stats.hlength, xerr);
850− } else {
851−#if FF_API_CODED_FRAME
852−FF_DISABLE_DEPRECATION_WARNINGS
853− avctx->coded_frame->key_frame = 0;
854−FF_ENABLE_DEPRECATION_WARNINGS
855−#endif
856838 }
857839
858840 pkt->size = xerr;
libavcodec/ljpegenc.c+0−7
@@ -281,13 +281,6 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx) · 280 unmodified lines
281281 if (ret < 0)
282282 return ret;
283283
284−#if FF_API_CODED_FRAME
285−FF_DISABLE_DEPRECATION_WARNINGS
286− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
287− avctx->coded_frame->key_frame = 1;
288−FF_ENABLE_DEPRECATION_WARNINGS
289−#endif
290−
291284 s->scratch = av_malloc_array(avctx->width + 1, sizeof(*s->scratch));
292285 if (!s->scratch)
293286 return AVERROR(ENOMEM);
libavcodec/mpegvideo_enc.c+0−6
@@ -1605,12 +1605,6 @@ static void frame_end(MpegEncContext *s) · 1604 unmodified lines
16051605 if (s->pict_type!= AV_PICTURE_TYPE_B)
16061606 s->last_non_b_pict_type = s->pict_type;
16071607
1608−#if FF_API_CODED_FRAME
1609−FF_DISABLE_DEPRECATION_WARNINGS
1610− av_frame_unref(s->avctx->coded_frame);
1611− av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
1612−FF_ENABLE_DEPRECATION_WARNINGS
1613−#endif
16141608 #if FF_API_ERROR_FRAME
16151609 FF_DISABLE_DEPRECATION_WARNINGS
16161610 memcpy(s->current_picture.f->error, s->current_picture.encoding_error,
libavcodec/nvenc.c+0−6
@@ -2041,12 +2041,6 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur · 2040 unmodified lines
20412041 goto error;
20422042 }
20432043
2044−#if FF_API_CODED_FRAME
2045−FF_DISABLE_DEPRECATION_WARNINGS
2046− avctx->coded_frame->pict_type = pict_type;
2047−FF_ENABLE_DEPRECATION_WARNINGS
2048−#endif
2049−
20502044 ff_side_data_set_encoder_stats(pkt,
20512045 (lock_params.frameAvgQP - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
20522046
libavcodec/pamenc.c+0−13
@@ -127,24 +127,11 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 126 unmodified lines
127127 return 0;
128128 }
129129
130−static av_cold int pam_encode_init(AVCodecContext *avctx)
131−{
132−#if FF_API_CODED_FRAME
133−FF_DISABLE_DEPRECATION_WARNINGS
134− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
135− avctx->coded_frame->key_frame = 1;
136−FF_ENABLE_DEPRECATION_WARNINGS
137−#endif
138−
139− return 0;
140−}
141−
142130 AVCodec ff_pam_encoder = {
143131 .name = "pam",
144132 .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
145133 .type = AVMEDIA_TYPE_VIDEO,
146134 .id = AV_CODEC_ID_PAM,
147− .init = pam_encode_init,
148135 .encode2 = pam_encode_frame,
149136 .pix_fmts = (const enum AVPixelFormat[]){
150137 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
libavcodec/pcxenc.c+0−13
@@ -33,18 +33,6 @@ · 32 unmodified lines
3333
3434 static const uint32_t monoblack_pal[16] = { 0x000000, 0xFFFFFF };
3535
36−static av_cold int pcx_encode_init(AVCodecContext *avctx)
37−{
38−#if FF_API_CODED_FRAME
39−FF_DISABLE_DEPRECATION_WARNINGS
40− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
41− avctx->coded_frame->key_frame = 1;
42−FF_ENABLE_DEPRECATION_WARNINGS
43−#endif
44−
45− return 0;
46−}
47−
4836 /**
4937 * PCX run-length encoder
5038 * @param dst output buffer
@@ -209,7 +197,6 @@ AVCodec ff_pcx_encoder = { · 158 unmodified lines
209197 .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
210198 .type = AVMEDIA_TYPE_VIDEO,
211199 .id = AV_CODEC_ID_PCX,
212− .init = pcx_encode_init,
213200 .encode2 = pcx_encode_frame,
214201 .pix_fmts = (const enum AVPixelFormat[]){
215202 AV_PIX_FMT_RGB24,
libavcodec/pngenc.c+0−7
@@ -1008,13 +1008,6 @@ static av_cold int png_enc_init(AVCodecContext *avctx) · 1007 unmodified lines
10081008 avctx->bits_per_coded_sample = 8;
10091009 }
10101010
1011−#if FF_API_CODED_FRAME
1012−FF_DISABLE_DEPRECATION_WARNINGS
1013− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
1014− avctx->coded_frame->key_frame = 1;
1015−FF_ENABLE_DEPRECATION_WARNINGS
1016−#endif
1017−
10181011 ff_llvidencdsp_init(&s->llvidencdsp);
10191012
10201013 if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK)
libavcodec/pnmenc.c+0−17
@@ -148,25 +148,12 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 147 unmodified lines
148148 return 0;
149149 }
150150
151−static av_cold int pnm_encode_init(AVCodecContext *avctx)
152−{
153−#if FF_API_CODED_FRAME
154−FF_DISABLE_DEPRECATION_WARNINGS
155− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
156− avctx->coded_frame->key_frame = 1;
157−FF_ENABLE_DEPRECATION_WARNINGS
158−#endif
159−
160− return 0;
161−}
162−
163151 #if CONFIG_PGM_ENCODER
164152 AVCodec ff_pgm_encoder = {
165153 .name = "pgm",
166154 .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
167155 .type = AVMEDIA_TYPE_VIDEO,
168156 .id = AV_CODEC_ID_PGM,
169− .init = pnm_encode_init,
170157 .encode2 = pnm_encode_frame,
171158 .pix_fmts = (const enum AVPixelFormat[]){
172159 AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE
@@ -181,7 +168,6 @@ AVCodec ff_pgmyuv_encoder = { · 8 unmodified lines
181168 .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
182169 .type = AVMEDIA_TYPE_VIDEO,
183170 .id = AV_CODEC_ID_PGMYUV,
184− .init = pnm_encode_init,
185171 .encode2 = pnm_encode_frame,
186172 .pix_fmts = (const enum AVPixelFormat[]){
187173 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE
@@ -196,7 +182,6 @@ AVCodec ff_ppm_encoder = { · 8 unmodified lines
196182 .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
197183 .type = AVMEDIA_TYPE_VIDEO,
198184 .id = AV_CODEC_ID_PPM,
199− .init = pnm_encode_init,
200185 .encode2 = pnm_encode_frame,
201186 .pix_fmts = (const enum AVPixelFormat[]){
202187 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE
@@ -211,7 +196,6 @@ AVCodec ff_pbm_encoder = { · 8 unmodified lines
211196 .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
212197 .type = AVMEDIA_TYPE_VIDEO,
213198 .id = AV_CODEC_ID_PBM,
214− .init = pnm_encode_init,
215199 .encode2 = pnm_encode_frame,
216200 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE,
217201 AV_PIX_FMT_NONE },
@@ -225,7 +209,6 @@ AVCodec ff_pfm_encoder = { · 7 unmodified lines
225209 .long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"),
226210 .type = AVMEDIA_TYPE_VIDEO,
227211 .id = AV_CODEC_ID_PFM,
228− .init = pnm_encode_init,
229212 .encode2 = pnm_encode_frame,
230213 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32,
231214 AV_PIX_FMT_NONE },
libavcodec/proresenc_kostya.c+0−6
@@ -1179,12 +1179,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 1178 unmodified lines
11791179 int interlaced = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);
11801180
11811181 avctx->bits_per_raw_sample = 10;
1182−#if FF_API_CODED_FRAME
1183−FF_DISABLE_DEPRECATION_WARNINGS
1184− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
1185− avctx->coded_frame->key_frame = 1;
1186−FF_ENABLE_DEPRECATION_WARNINGS
1187−#endif
11881182
11891183 ctx->fdct = prores_fdct;
11901184 ctx->scantable = interlaced ? ff_prores_interlaced_scan
libavcodec/pthread_frame.c+0−5
@@ -321,11 +321,6 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, · 320 unmodified lines
321321 }
322322
323323 if (for_user) {
324−#if FF_API_CODED_FRAME
325−FF_DISABLE_DEPRECATION_WARNINGS
326− dst->coded_frame = src->coded_frame;
327−FF_ENABLE_DEPRECATION_WARNINGS
328−#endif
329324 if (dst->codec->update_thread_context_for_user)
330325 err = dst->codec->update_thread_context_for_user(dst, src);
331326 } else {
libavcodec/qsvenc.c+0−6
@@ -1555,12 +1555,6 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, · 1554 unmodified lines
15551555 return AVERROR_INVALIDDATA;
15561556 }
15571557
1558−#if FF_API_CODED_FRAME
1559−FF_DISABLE_DEPRECATION_WARNINGS
1560− avctx->coded_frame->pict_type = pict_type;
1561−FF_ENABLE_DEPRECATION_WARNINGS
1562−#endif
1563−
15641558 #if QSV_VERSION_ATLEAST(1, 26)
15651559 if (avctx->codec_id == AV_CODEC_ID_H264) {
15661560 enc_buf = bs->ExtParam;
libavcodec/qtrleenc.c+0−7
@@ -391,13 +391,6 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 390 unmodified lines
391391 return ret;
392392 }
393393
394−#if FF_API_CODED_FRAME
395−FF_DISABLE_DEPRECATION_WARNINGS
396− avctx->coded_frame->key_frame = s->key_frame;
397− avctx->coded_frame->pict_type = s->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
398−FF_ENABLE_DEPRECATION_WARNINGS
399−#endif
400−
401394 if (s->key_frame)
402395 pkt->flags |= AV_PKT_FLAG_KEY;
403396 *got_packet = 1;
libavcodec/rawenc.c+0−5
@@ -36,11 +36,6 @@ static av_cold int raw_encode_init(AVCodecContext *avctx) · 35 unmodified lines
3636 {
3737 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
3838
39−#if FF_API_CODED_FRAME
40−FF_DISABLE_DEPRECATION_WARNINGS
41− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
42−FF_ENABLE_DEPRECATION_WARNINGS
43−#endif
4439 avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);
4540 if(!avctx->codec_tag)
4641 avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
libavcodec/sgienc.c+0−7
@@ -100,13 +100,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 99 unmodified lines
100100 unsigned int width, height, depth, dimension;
101101 unsigned int bytes_per_channel, pixmax, put_be;
102102
103−#if FF_API_CODED_FRAME
104−FF_DISABLE_DEPRECATION_WARNINGS
105− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
106− avctx->coded_frame->key_frame = 1;
107−FF_ENABLE_DEPRECATION_WARNINGS
108−#endif
109−
110103 width = avctx->width;
111104 height = avctx->height;
112105 bytes_per_channel = 1;
libavcodec/snowenc.c+0−19
@@ -1618,22 +1618,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 1617 unmodified lines
16181618 s->lambda = 0;
16191619 }//else keep previous frame's qlog until after motion estimation
16201620
1621−#if FF_API_CODED_FRAME
1622−FF_DISABLE_DEPRECATION_WARNINGS
1623− av_frame_unref(avctx->coded_frame);
1624−FF_ENABLE_DEPRECATION_WARNINGS
1625−#endif
1626−
16271621 if (s->current_picture->data[0]) {
16281622 int w = s->avctx->width;
16291623 int h = s->avctx->height;
16301624
1631−#if FF_API_CODED_FRAME
1632− ret = av_frame_make_writable(s->current_picture);
1633− if (ret < 0)
1634− return ret;
1635−#endif
1636−
16371625 s->mpvencdsp.draw_edges(s->current_picture->data[0],
16381626 s->current_picture->linesize[0], w , h ,
16391627 EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM);
@@ -1649,13 +1637,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 9 unmodified lines
16491637 }
16501638
16511639 ff_snow_frame_start(s);
1652−#if FF_API_CODED_FRAME
1653−FF_DISABLE_DEPRECATION_WARNINGS
1654− ret = av_frame_ref(avctx->coded_frame, s->current_picture);
1655−FF_ENABLE_DEPRECATION_WARNINGS
1656−#endif
1657− if (ret < 0)
1658− return ret;
16591640
16601641 s->m.current_picture_ptr= &s->m.current_picture;
16611642 s->m.current_picture.f = s->current_picture;
libavcodec/svq1enc.c+0−7
@@ -615,13 +615,6 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 614 unmodified lines
615615 s->pict_type = AV_PICTURE_TYPE_I;
616616 s->quality = pict->quality;
617617
618−#if FF_API_CODED_FRAME
619−FF_DISABLE_DEPRECATION_WARNINGS
620− avctx->coded_frame->pict_type = s->pict_type;
621− avctx->coded_frame->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
622−FF_ENABLE_DEPRECATION_WARNINGS
623−#endif
624−
625618 ff_side_data_set_encoder_stats(pkt, pict->quality, NULL, 0, s->pict_type);
626619
627620 svq1_write_header(s, s->pict_type);
libavcodec/targaenc.c+0−7
@@ -184,13 +184,6 @@ static av_cold int targa_encode_init(AVCodecContext *avctx) · 183 unmodified lines
184184 return AVERROR(EINVAL);
185185 }
186186
187−#if FF_API_CODED_FRAME
188−FF_DISABLE_DEPRECATION_WARNINGS
189− avctx->coded_frame->key_frame = 1;
190− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
191−FF_ENABLE_DEPRECATION_WARNINGS
192−#endif
193−
194187 return 0;
195188 }
196189
libavcodec/tiffenc.c+0−6
@@ -533,12 +533,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 532 unmodified lines
533533 }
534534 #endif
535535
536−#if FF_API_CODED_FRAME
537−FF_DISABLE_DEPRECATION_WARNINGS
538− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
539− avctx->coded_frame->key_frame = 1;
540−FF_ENABLE_DEPRECATION_WARNINGS
541−#endif
542536 s->avctx = avctx;
543537
544538 return 0;
libavcodec/utvideoenc.c+1−8
@@ -621,15 +621,8 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 620 unmodified lines
621621 * At least currently Ut Video is IDR only.
622622 * Set flags accordingly.
623623 */
624−#if FF_API_CODED_FRAME
625−FF_DISABLE_DEPRECATION_WARNINGS
626− avctx->coded_frame->key_frame = 1;
627− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
628−FF_ENABLE_DEPRECATION_WARNINGS
629−#endif
630−
631− pkt->size = bytestream2_tell_p(&pb);
632624 pkt->flags |= AV_PKT_FLAG_KEY;
625+ pkt->size = bytestream2_tell_p(&pb);
633626
634627 /* Packet should be done */
635628 *got_packet = 1;
libavcodec/v210enc.c+0−6
@@ -101,12 +101,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 100 unmodified lines
101101 return AVERROR(EINVAL);
102102 }
103103
104−#if FF_API_CODED_FRAME
105−FF_DISABLE_DEPRECATION_WARNINGS
106− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
107−FF_ENABLE_DEPRECATION_WARNINGS
108−#endif
109−
110104 ff_v210enc_init(s);
111105
112106 avctx->bits_per_coded_sample = 20;
libavcodec/v410enc.c+0−7
@@ -51,13 +51,6 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 50 unmodified lines
5151 return ret;
5252 dst = pkt->data;
5353
54−#if FF_API_CODED_FRAME
55−FF_DISABLE_DEPRECATION_WARNINGS
56− avctx->coded_frame->key_frame = 1;
57− avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
58−FF_ENABLE_DEPRECATION_WARNINGS
59−#endif
60−
6154 y = (uint16_t *)pic->data[0];
6255 u = (uint16_t *)pic->data[1];
6356 v = (uint16_t *)pic->data[2];
libavcodec/version.h+0−3
@@ -51,9 +51,6 @@ · 50 unmodified lines
5151 * at once through the bump. This improves the git bisect-ability of the change.
5252 */
5353
54−#ifndef FF_API_CODED_FRAME
55−#define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59)
56−#endif
5754 #ifndef FF_API_OPENH264_SLICE_MODE
5855 #define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 59)
5956 #endif
libavcodec/zmbvenc.c+0−6
@@ -180,12 +180,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 179 unmodified lines
180180 c->curfrm++;
181181 if(c->curfrm == c->keyint)
182182 c->curfrm = 0;
183−#if FF_API_CODED_FRAME
184−FF_DISABLE_DEPRECATION_WARNINGS
185− avctx->coded_frame->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
186− avctx->coded_frame->key_frame = keyframe;
187−FF_ENABLE_DEPRECATION_WARNINGS
188−#endif
189183
190184 palptr = (avctx->pix_fmt == AV_PIX_FMT_PAL8) ? (uint32_t *)p->data[1] : NULL;
191185 chpal = !keyframe && palptr && memcmp(palptr, c->pal2, 1024);
libavdevice/v4l2.c+0−15
@@ -981,27 +981,12 @@ fail: · 980 unmodified lines
981981
982982 static int v4l2_read_packet(AVFormatContext *ctx, AVPacket *pkt)
983983 {
984−#if FF_API_CODED_FRAME && FF_API_LAVF_AVCTX
985−FF_DISABLE_DEPRECATION_WARNINGS
986− struct video_data *s = ctx->priv_data;
987− AVFrame *frame = ctx->streams[0]->codec->coded_frame;
988−FF_ENABLE_DEPRECATION_WARNINGS
989−#endif
990984 int res;
991985
992986 if ((res = mmap_read_frame(ctx, pkt)) < 0) {
993987 return res;
994988 }
995989
996−#if FF_API_CODED_FRAME && FF_API_LAVF_AVCTX
997−FF_DISABLE_DEPRECATION_WARNINGS
998− if (frame && s->interlaced) {
999− frame->interlaced_frame = 1;
1000− frame->top_field_first = s->top_field_first;
1001− }
1002−FF_ENABLE_DEPRECATION_WARNINGS
1003−#endif
1004−
1005990 return pkt->size;
1006991 }
1007992

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t