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
33 int width, height, bits_pixel, i, j, length, ret;33 int width, height, bits_pixel, i, j, length, ret;
34 uint8_t *in_buf, *buf;34 uint8_t *in_buf, *buf;
35 35
36#if FF_API_CODED_FRAME
37FF_DISABLE_DEPRECATION_WARNINGS
38 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
39 avctx->coded_frame->key_frame = 1;
40FF_ENABLE_DEPRECATION_WARNINGS
41#endif
42
43 width = avctx->width;36 width = avctx->width;
44 height = avctx->height;37 height = avctx->height;
45 38
libavcodec/avcodec.c+0−10
@@ -400,11 +400,6 @@ free_and_end: · 399 unmodified lines
400 av_opt_free(avctx);400 av_opt_free(avctx);
401 401
402 if (av_codec_is_encoder(avctx->codec)) {402 if (av_codec_is_encoder(avctx->codec)) {
403#if FF_API_CODED_FRAME
404FF_DISABLE_DEPRECATION_WARNINGS
405 av_frame_free(&avctx->coded_frame);
406FF_ENABLE_DEPRECATION_WARNINGS
407#endif
408 av_freep(&avctx->extradata);403 av_freep(&avctx->extradata);
409 avctx->extradata_size = 0;404 avctx->extradata_size = 0;
410 }405 }
@@ -578,11 +573,6 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 167 unmodified lines
578 av_freep(&avctx->priv_data);573 av_freep(&avctx->priv_data);
579 if (av_codec_is_encoder(avctx->codec)) {574 if (av_codec_is_encoder(avctx->codec)) {
580 av_freep(&avctx->extradata);575 av_freep(&avctx->extradata);
581#if FF_API_CODED_FRAME
582FF_DISABLE_DEPRECATION_WARNINGS
583 av_frame_free(&avctx->coded_frame);
584FF_ENABLE_DEPRECATION_WARNINGS
585#endif
586 } else if (av_codec_is_decoder(avctx->codec))576 } else if (av_codec_is_decoder(avctx->codec))
587 av_freep(&avctx->subtitle_header);577 av_freep(&avctx->subtitle_header);
588 578
libavcodec/avcodec.h+0−11
@@ -1578,17 +1578,6 @@ typedef struct AVCodecContext { · 1577 unmodified lines
1578 */1578 */
1579 int lowres;1579 int lowres;
1580 1580
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
1592 /**1581 /**
1593 * thread count1582 * thread count
1594 * is used to decide how many independent tasks should be passed to execute()1583 * 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
74 int bit_count = avctx->bits_per_coded_sample;74 int bit_count = avctx->bits_per_coded_sample;
75 uint8_t *ptr, *buf;75 uint8_t *ptr, *buf;
76 76
77#if FF_API_CODED_FRAME
78FF_DISABLE_DEPRECATION_WARNINGS
79 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
80 avctx->coded_frame->key_frame = 1;
81FF_ENABLE_DEPRECATION_WARNINGS
82#endif
83 switch (avctx->pix_fmt) {77 switch (avctx->pix_fmt) {
84 case AV_PIX_FMT_RGB444:78 case AV_PIX_FMT_RGB444:
85 compression = BMP_BITFIELDS;79 compression = BMP_BITFIELDS;
libavcodec/dnxhdenc.c+0−17
@@ -499,12 +499,6 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) · 498 unmodified lines
499 !FF_ALLOCZ_TYPED_ARRAY(ctx->mb_bits, ctx->m.mb_num) ||499 !FF_ALLOCZ_TYPED_ARRAY(ctx->mb_bits, ctx->m.mb_num) ||
500 !FF_ALLOCZ_TYPED_ARRAY(ctx->mb_qscale, ctx->m.mb_num))500 !FF_ALLOCZ_TYPED_ARRAY(ctx->mb_qscale, ctx->m.mb_num))
501 return AVERROR(ENOMEM);501 return AVERROR(ENOMEM);
502#if FF_API_CODED_FRAME
503FF_DISABLE_DEPRECATION_WARNINGS
504 avctx->coded_frame->key_frame = 1;
505 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
506FF_ENABLE_DEPRECATION_WARNINGS
507#endif
508 502
509 if (avctx->active_thread_type == FF_THREAD_SLICE) {503 if (avctx->active_thread_type == FF_THREAD_SLICE) {
510 if (avctx->thread_count > MAX_THREADS) {504 if (avctx->thread_count > MAX_THREADS) {
@@ -1252,11 +1246,6 @@ static void dnxhd_load_picture(DNXHDEncContext *ctx, const AVFrame *frame) · 741 unmodified lines
1252 ctx->thread[i]->dct_uv_offset = ctx->m.uvlinesize*8;1246 ctx->thread[i]->dct_uv_offset = ctx->m.uvlinesize*8;
1253 }1247 }
1254 1248
1255#if FF_API_CODED_FRAME
1256FF_DISABLE_DEPRECATION_WARNINGS
1257 ctx->m.avctx->coded_frame->interlaced_frame = frame->interlaced_frame;
1258FF_ENABLE_DEPRECATION_WARNINGS
1259#endif
1260 ctx->cur_field = frame->interlaced_frame && !frame->top_field_first;1249 ctx->cur_field = frame->interlaced_frame && !frame->top_field_first;
1261}1250}
1262 1251
@@ -1317,12 +1306,6 @@ encode_coding_unit: · 54 unmodified lines
1317 goto encode_coding_unit;1306 goto encode_coding_unit;
1318 }1307 }
1319 1308
1320#if FF_API_CODED_FRAME
1321FF_DISABLE_DEPRECATION_WARNINGS
1322 avctx->coded_frame->quality = ctx->qscale * FF_QP2LAMBDA;
1323FF_ENABLE_DEPRECATION_WARNINGS
1324#endif
1325
1326 ff_side_data_set_encoder_stats(pkt, ctx->qscale * FF_QP2LAMBDA, NULL, 0, AV_PICTURE_TYPE_I);1309 ff_side_data_set_encoder_stats(pkt, ctx->qscale * FF_QP2LAMBDA, NULL, 0, AV_PICTURE_TYPE_I);
1327 1310
1328 pkt->flags |= AV_PKT_FLAG_KEY;1311 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
1169 1169
1170 c->pix_fmt = s->sys->pix_fmt;1170 c->pix_fmt = s->sys->pix_fmt;
1171 s->frame = frame;1171 s->frame = frame;
1172#if FF_API_CODED_FRAME
1173FF_DISABLE_DEPRECATION_WARNINGS
1174 c->coded_frame->key_frame = 1;
1175 c->coded_frame->pict_type = AV_PICTURE_TYPE_I;
1176FF_ENABLE_DEPRECATION_WARNINGS
1177#endif
1178 s->buf = pkt->data;1172 s->buf = pkt->data;
1179 1173
1180 dv_format_frame(s, pkt->data);1174 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
527int ff_encode_preinit(AVCodecContext *avctx)527int ff_encode_preinit(AVCodecContext *avctx)
528{528{
529 int i;529 int i;
530#if FF_API_CODED_FRAME
531FF_DISABLE_DEPRECATION_WARNINGS
532 avctx->coded_frame = av_frame_alloc();
533 if (!avctx->coded_frame) {
534 return AVERROR(ENOMEM);
535 }
536FF_ENABLE_DEPRECATION_WARNINGS
537#endif
538 530
539 if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) {531 if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) {
540 av_log(avctx, AV_LOG_ERROR, "The encoder timebase is not set.\n");532 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
745 if ((ret = ff_ffv1_allocate_initial_states(s)) < 0)745 if ((ret = ff_ffv1_allocate_initial_states(s)) < 0)
746 return ret;746 return ret;
747 747
748#if FF_API_CODED_FRAME
749FF_DISABLE_DEPRECATION_WARNINGS
750 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
751FF_ENABLE_DEPRECATION_WARNINGS
752#endif
753
754 if (!s->transparency)748 if (!s->transparency)
755 s->plane_count = 2;749 s->plane_count = 2;
756 if (!s->chroma_planes && s->version > 3)750 if (!s->chroma_planes && s->version > 3)
@@ -1174,11 +1168,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 417 unmodified lines
1174 av_frame_unref(p);1168 av_frame_unref(p);
1175 if ((ret = av_frame_ref(p, pict)) < 0)1169 if ((ret = av_frame_ref(p, pict)) < 0)
1176 return ret;1170 return ret;
1177#if FF_API_CODED_FRAME
1178FF_DISABLE_DEPRECATION_WARNINGS
1179 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
1180FF_ENABLE_DEPRECATION_WARNINGS
1181#endif
1182 1171
1183 if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {1172 if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {
1184 put_rac(c, &keystate, 1);1173 put_rac(c, &keystate, 1);
@@ -1244,12 +1233,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 59 unmodified lines
1244 if (avctx->flags & AV_CODEC_FLAG_PASS1)1233 if (avctx->flags & AV_CODEC_FLAG_PASS1)
1245 avctx->stats_out[0] = '\0';1234 avctx->stats_out[0] = '\0';
1246 1235
1247#if FF_API_CODED_FRAME
1248FF_DISABLE_DEPRECATION_WARNINGS
1249 avctx->coded_frame->key_frame = f->key_frame;
1250FF_ENABLE_DEPRECATION_WARNINGS
1251#endif
1252
1253 f->picture_number++;1236 f->picture_number++;
1254 pkt->size = buf_p - pkt->data;1237 pkt->size = buf_p - pkt->data;
1255 pkt->pts =1238 pkt->pts =
libavcodec/flashsvenc.c+0−13
@@ -245,21 +245,8 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 244 unmodified lines
245 245
246 //mark the frame type so the muxer can mux it correctly246 //mark the frame type so the muxer can mux it correctly
247 if (I_frame) {247 if (I_frame) {
248#if FF_API_CODED_FRAME
249FF_DISABLE_DEPRECATION_WARNINGS
250 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
251 avctx->coded_frame->key_frame = 1;
252FF_ENABLE_DEPRECATION_WARNINGS
253#endif
254 s->last_key_frame = avctx->frame_number;248 s->last_key_frame = avctx->frame_number;
255 ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);249 ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
256 } else {
257#if FF_API_CODED_FRAME
258FF_DISABLE_DEPRECATION_WARNINGS
259 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
260 avctx->coded_frame->key_frame = 0;
261FF_ENABLE_DEPRECATION_WARNINGS
262#endif
263 }250 }
264 251
265 if (I_frame)252 if (I_frame)
libavcodec/huffyuvenc.c+0−7
@@ -222,13 +222,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 221 unmodified lines
222 if (!avctx->extradata)222 if (!avctx->extradata)
223 return AVERROR(ENOMEM);223 return AVERROR(ENOMEM);
224 224
225#if FF_API_CODED_FRAME
226FF_DISABLE_DEPRECATION_WARNINGS
227 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
228 avctx->coded_frame->key_frame = 1;
229FF_ENABLE_DEPRECATION_WARNINGS
230#endif
231
232 s->bps = desc->comp[0].depth;225 s->bps = desc->comp[0].depth;
233 s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;226 s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;
234 s->chroma = desc->nb_components > 2;227 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
413 return 0;413 return 0;
414}414}
415 415
416static av_cold int encode_init_ls(AVCodecContext *ctx)
417{
418#if FF_API_CODED_FRAME
419FF_DISABLE_DEPRECATION_WARNINGS
420 ctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
421 ctx->coded_frame->key_frame = 1;
422FF_ENABLE_DEPRECATION_WARNINGS
423#endif
424
425 return 0;
426}
427
428#define OFFSET(x) offsetof(JPEGLSContext, x)416#define OFFSET(x) offsetof(JPEGLSContext, x)
429#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM417#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
430static const AVOption options[] = {418static const AVOption options[] = {
@@ -450,7 +438,6 @@ AVCodec ff_jpegls_encoder = { · 19 unmodified lines
450 .id = AV_CODEC_ID_JPEGLS,438 .id = AV_CODEC_ID_JPEGLS,
451 .priv_data_size = sizeof(JPEGLSContext),439 .priv_data_size = sizeof(JPEGLSContext),
452 .priv_class = &jpegls_class,440 .priv_class = &jpegls_class,
453 .init = encode_init_ls,
454 .capabilities = AV_CODEC_CAP_FRAME_THREADS,441 .capabilities = AV_CODEC_CAP_FRAME_THREADS,
455 .encode2 = encode_picture_ls,442 .encode2 = encode_picture_ls,
456 .pix_fmts = (const enum AVPixelFormat[]) {443 .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
121 if (!avctx->extradata)121 if (!avctx->extradata)
122 return AVERROR(ENOMEM);122 return AVERROR(ENOMEM);
123 123
124#if FF_API_CODED_FRAME
125FF_DISABLE_DEPRECATION_WARNINGS
126 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
127 avctx->coded_frame->key_frame = 1;
128FF_ENABLE_DEPRECATION_WARNINGS
129#endif
130
131 c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?124 c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
132 COMP_ZLIB_NORMAL :125 COMP_ZLIB_NORMAL :
133 av_clip(avctx->compression_level, 0, 9);126 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
276 av_log(avctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");276 av_log(avctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
277 return AVERROR_EXTERNAL;277 return AVERROR_EXTERNAL;
278 }278 }
279#if FF_API_CODED_FRAME
280FF_DISABLE_DEPRECATION_WARNINGS
281 avctx->coded_frame->pict_type = pict_type;
282FF_ENABLE_DEPRECATION_WARNINGS
283#endif
284 279
285 ff_side_data_set_encoder_stats(avpkt, frame_info.qp * FF_QP2LAMBDA, NULL, 0, pict_type);280 ff_side_data_set_encoder_stats(avpkt, frame_info.qp * FF_QP2LAMBDA, NULL, 0, pict_type);
286 281
287#if FF_API_CODED_FRAME
288FF_DISABLE_DEPRECATION_WARNINGS
289 avctx->coded_frame->quality = frame_info.qp * FF_QP2LAMBDA;
290FF_ENABLE_DEPRECATION_WARNINGS
291#endif
292
293 *got_packet_ptr = 1;282 *got_packet_ptr = 1;
294 }283 }
295 284
libavcodec/libtheoraenc.c+0−5
@@ -346,11 +346,6 @@ static int encode_frame(AVCodecContext* avc_context, AVPacket *pkt, · 345 unmodified lines
346 // HACK: assumes no encoder delay, this is true until libtheora becomes346 // HACK: assumes no encoder delay, this is true until libtheora becomes
347 // multithreaded (which will be disabled unless explicitly requested)347 // multithreaded (which will be disabled unless explicitly requested)
348 pkt->pts = pkt->dts = frame->pts;348 pkt->pts = pkt->dts = frame->pts;
349#if FF_API_CODED_FRAME
350FF_DISABLE_DEPRECATION_WARNINGS
351 avc_context->coded_frame->key_frame = !(o_packet.granulepos & h->keyframe_mask);
352FF_ENABLE_DEPRECATION_WARNINGS
353#endif
354 if (!(o_packet.granulepos & h->keyframe_mask))349 if (!(o_packet.granulepos & h->keyframe_mask))
355 pkt->flags |= AV_PKT_FLAG_KEY;350 pkt->flags |= AV_PKT_FLAG_KEY;
356 *got_packet = 1;351 *got_packet = 1;
libavcodec/libvpxenc.c+0−24
@@ -1179,28 +1179,12 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, · 1178 unmodified lines
1179 int pict_type;1179 int pict_type;
1180 memcpy(pkt->data, cx_frame->buf, pkt->size);1180 memcpy(pkt->data, cx_frame->buf, pkt->size);
1181 pkt->pts = pkt->dts = cx_frame->pts;1181 pkt->pts = pkt->dts = cx_frame->pts;
1182#if FF_API_CODED_FRAME
1183FF_DISABLE_DEPRECATION_WARNINGS
1184 avctx->coded_frame->pts = cx_frame->pts;
1185 avctx->coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
1186FF_ENABLE_DEPRECATION_WARNINGS
1187#endif
1188 1182
1189 if (!!(cx_frame->flags & VPX_FRAME_IS_KEY)) {1183 if (!!(cx_frame->flags & VPX_FRAME_IS_KEY)) {
1190 pict_type = AV_PICTURE_TYPE_I;1184 pict_type = AV_PICTURE_TYPE_I;
1191#if FF_API_CODED_FRAME
1192FF_DISABLE_DEPRECATION_WARNINGS
1193 avctx->coded_frame->pict_type = pict_type;
1194FF_ENABLE_DEPRECATION_WARNINGS
1195#endif
1196 pkt->flags |= AV_PKT_FLAG_KEY;1185 pkt->flags |= AV_PKT_FLAG_KEY;
1197 } else {1186 } else {
1198 pict_type = AV_PICTURE_TYPE_P;1187 pict_type = AV_PICTURE_TYPE_P;
1199#if FF_API_CODED_FRAME
1200FF_DISABLE_DEPRECATION_WARNINGS
1201 avctx->coded_frame->pict_type = pict_type;
1202FF_ENABLE_DEPRECATION_WARNINGS
1203#endif
1204 }1188 }
1205 1189
1206 ff_side_data_set_encoder_stats(pkt, 0, cx_frame->sse + 1,1190 ff_side_data_set_encoder_stats(pkt, 0, cx_frame->sse + 1,
@@ -1209,14 +1193,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 2 unmodified lines
1209 if (cx_frame->have_sse) {1193 if (cx_frame->have_sse) {
1210 int i;1194 int i;
1211 /* Beware of the Y/U/V/all order! */1195 /* Beware of the Y/U/V/all order! */
1212#if FF_API_CODED_FRAME && FF_API_ERROR_FRAME
1213FF_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
1218FF_ENABLE_DEPRECATION_WARNINGS
1219#endif
1220 for (i = 0; i < 3; ++i) {1196 for (i = 0; i < 3; ++i) {
1221 avctx->error[i] += cx_frame->sse[i + 1];1197 avctx->error[i] += cx_frame->sse[i + 1];
1222 }1198 }
libavcodec/libx264.c+0−11
@@ -481,23 +481,12 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, · 480 unmodified lines
481 av_log(ctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");481 av_log(ctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
482 return AVERROR_EXTERNAL;482 return AVERROR_EXTERNAL;
483 }483 }
484#if FF_API_CODED_FRAME
485FF_DISABLE_DEPRECATION_WARNINGS
486 ctx->coded_frame->pict_type = pict_type;
487FF_ENABLE_DEPRECATION_WARNINGS
488#endif
489 484
490 pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe;485 pkt->flags |= AV_PKT_FLAG_KEY*pic_out.b_keyframe;
491 if (ret) {486 if (ret) {
492 ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);487 ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
493 if (wallclock)488 if (wallclock)
494 ff_side_data_set_prft(pkt, wallclock);489 ff_side_data_set_prft(pkt, wallclock);
495
496#if FF_API_CODED_FRAME
497FF_DISABLE_DEPRECATION_WARNINGS
498 ctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
499FF_ENABLE_DEPRECATION_WARNINGS
500#endif
501 }490 }
502 491
503 *got_packet = ret;492 *got_packet = ret;
libavcodec/libx265.c+0−6
@@ -566,12 +566,6 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 565 unmodified lines
566 return AVERROR_EXTERNAL;566 return AVERROR_EXTERNAL;
567 }567 }
568 568
569#if FF_API_CODED_FRAME
570FF_DISABLE_DEPRECATION_WARNINGS
571 avctx->coded_frame->pict_type = pict_type;
572FF_ENABLE_DEPRECATION_WARNINGS
573#endif
574
575#if X265_BUILD >= 130569#if X265_BUILD >= 130
576 if (x265pic_out.sliceType == X265_TYPE_B)570 if (x265pic_out.sliceType == X265_TYPE_B)
577#else571#else
libavcodec/libxavs.c+0−21
@@ -165,11 +165,6 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt, · 164 unmodified lines
165 return 0;165 return 0;
166 }166 }
167 167
168#if FF_API_CODED_FRAME
169FF_DISABLE_DEPRECATION_WARNINGS
170 avctx->coded_frame->pts = pic_out.i_pts;
171FF_ENABLE_DEPRECATION_WARNINGS
172#endif
173 pkt->pts = pic_out.i_pts;168 pkt->pts = pic_out.i_pts;
174 if (avctx->has_b_frames) {169 if (avctx->has_b_frames) {
175 if (!x4->out_frame_count)170 if (!x4->out_frame_count)
@@ -194,29 +189,13 @@ FF_ENABLE_DEPRECATION_WARNINGS · 18 unmodified lines
194 default:189 default:
195 pict_type = AV_PICTURE_TYPE_NONE;190 pict_type = AV_PICTURE_TYPE_NONE;
196 }191 }
197#if FF_API_CODED_FRAME
198FF_DISABLE_DEPRECATION_WARNINGS
199 avctx->coded_frame->pict_type = pict_type;
200FF_ENABLE_DEPRECATION_WARNINGS
201#endif
202 192
203 /* There is no IDR frame in AVS JiZhun */193 /* There is no IDR frame in AVS JiZhun */
204 /* Sequence header is used as a flag */194 /* Sequence header is used as a flag */
205 if (pic_out.i_type == XAVS_TYPE_I) {195 if (pic_out.i_type == XAVS_TYPE_I) {
206#if FF_API_CODED_FRAME
207FF_DISABLE_DEPRECATION_WARNINGS
208 avctx->coded_frame->key_frame = 1;
209FF_ENABLE_DEPRECATION_WARNINGS
210#endif
211 pkt->flags |= AV_PKT_FLAG_KEY;196 pkt->flags |= AV_PKT_FLAG_KEY;
212 }197 }
213 198
214#if FF_API_CODED_FRAME
215FF_DISABLE_DEPRECATION_WARNINGS
216 avctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
217FF_ENABLE_DEPRECATION_WARNINGS
218#endif
219
220 ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);199 ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
221 200
222 x4->out_frame_count++;201 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
828 else828 else
829 pict_type = AV_PICTURE_TYPE_I;829 pict_type = AV_PICTURE_TYPE_I;
830 830
831#if FF_API_CODED_FRAME
832FF_DISABLE_DEPRECATION_WARNINGS
833 avctx->coded_frame->pict_type = pict_type;
834 avctx->coded_frame->quality = xvid_enc_stats.quant * FF_QP2LAMBDA;
835FF_ENABLE_DEPRECATION_WARNINGS
836#endif
837
838 ff_side_data_set_encoder_stats(pkt, xvid_enc_stats.quant * FF_QP2LAMBDA, NULL, 0, pict_type);831 ff_side_data_set_encoder_stats(pkt, xvid_enc_stats.quant * FF_QP2LAMBDA, NULL, 0, pict_type);
839 832
840 if (xvid_enc_frame.out_flags & XVID_KEYFRAME) {833 if (xvid_enc_frame.out_flags & XVID_KEYFRAME) {
841#if FF_API_CODED_FRAME
842FF_DISABLE_DEPRECATION_WARNINGS
843 avctx->coded_frame->key_frame = 1;
844FF_ENABLE_DEPRECATION_WARNINGS
845#endif
846 pkt->flags |= AV_PKT_FLAG_KEY;834 pkt->flags |= AV_PKT_FLAG_KEY;
847 if (x->quicktime_format)835 if (x->quicktime_format)
848 return xvid_strip_vol_header(avctx, pkt,836 return xvid_strip_vol_header(avctx, pkt,
849 xvid_enc_stats.hlength, xerr);837 xvid_enc_stats.hlength, xerr);
850 } else {
851#if FF_API_CODED_FRAME
852FF_DISABLE_DEPRECATION_WARNINGS
853 avctx->coded_frame->key_frame = 0;
854FF_ENABLE_DEPRECATION_WARNINGS
855#endif
856 }838 }
857 839
858 pkt->size = xerr;840 pkt->size = xerr;
libavcodec/ljpegenc.c+0−7
@@ -281,13 +281,6 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx) · 280 unmodified lines
281 if (ret < 0)281 if (ret < 0)
282 return ret;282 return ret;
283 283
284#if FF_API_CODED_FRAME
285FF_DISABLE_DEPRECATION_WARNINGS
286 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
287 avctx->coded_frame->key_frame = 1;
288FF_ENABLE_DEPRECATION_WARNINGS
289#endif
290
291 s->scratch = av_malloc_array(avctx->width + 1, sizeof(*s->scratch));284 s->scratch = av_malloc_array(avctx->width + 1, sizeof(*s->scratch));
292 if (!s->scratch)285 if (!s->scratch)
293 return AVERROR(ENOMEM);286 return AVERROR(ENOMEM);
libavcodec/mpegvideo_enc.c+0−6
@@ -1605,12 +1605,6 @@ static void frame_end(MpegEncContext *s) · 1604 unmodified lines
1605 if (s->pict_type!= AV_PICTURE_TYPE_B)1605 if (s->pict_type!= AV_PICTURE_TYPE_B)
1606 s->last_non_b_pict_type = s->pict_type;1606 s->last_non_b_pict_type = s->pict_type;
1607 1607
1608#if FF_API_CODED_FRAME
1609FF_DISABLE_DEPRECATION_WARNINGS
1610 av_frame_unref(s->avctx->coded_frame);
1611 av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
1612FF_ENABLE_DEPRECATION_WARNINGS
1613#endif
1614#if FF_API_ERROR_FRAME1608#if FF_API_ERROR_FRAME
1615FF_DISABLE_DEPRECATION_WARNINGS1609FF_DISABLE_DEPRECATION_WARNINGS
1616 memcpy(s->current_picture.f->error, s->current_picture.encoding_error,1610 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
2041 goto error;2041 goto error;
2042 }2042 }
2043 2043
2044#if FF_API_CODED_FRAME
2045FF_DISABLE_DEPRECATION_WARNINGS
2046 avctx->coded_frame->pict_type = pict_type;
2047FF_ENABLE_DEPRECATION_WARNINGS
2048#endif
2049
2050 ff_side_data_set_encoder_stats(pkt,2044 ff_side_data_set_encoder_stats(pkt,
2051 (lock_params.frameAvgQP - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);2045 (lock_params.frameAvgQP - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
2052 2046
libavcodec/pamenc.c+0−13
@@ -127,24 +127,11 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 126 unmodified lines
127 return 0;127 return 0;
128}128}
129 129
130static av_cold int pam_encode_init(AVCodecContext *avctx)
131{
132#if FF_API_CODED_FRAME
133FF_DISABLE_DEPRECATION_WARNINGS
134 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
135 avctx->coded_frame->key_frame = 1;
136FF_ENABLE_DEPRECATION_WARNINGS
137#endif
138
139 return 0;
140}
141
142AVCodec ff_pam_encoder = {130AVCodec ff_pam_encoder = {
143 .name = "pam",131 .name = "pam",
144 .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),132 .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
145 .type = AVMEDIA_TYPE_VIDEO,133 .type = AVMEDIA_TYPE_VIDEO,
146 .id = AV_CODEC_ID_PAM,134 .id = AV_CODEC_ID_PAM,
147 .init = pam_encode_init,
148 .encode2 = pam_encode_frame,135 .encode2 = pam_encode_frame,
149 .pix_fmts = (const enum AVPixelFormat[]){136 .pix_fmts = (const enum AVPixelFormat[]){
150 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,137 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
libavcodec/pcxenc.c+0−13
@@ -33,18 +33,6 @@ · 32 unmodified lines
33 33
34static const uint32_t monoblack_pal[16] = { 0x000000, 0xFFFFFF };34static const uint32_t monoblack_pal[16] = { 0x000000, 0xFFFFFF };
35 35
36static av_cold int pcx_encode_init(AVCodecContext *avctx)
37{
38#if FF_API_CODED_FRAME
39FF_DISABLE_DEPRECATION_WARNINGS
40 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
41 avctx->coded_frame->key_frame = 1;
42FF_ENABLE_DEPRECATION_WARNINGS
43#endif
44
45 return 0;
46}
47
48/**36/**
49 * PCX run-length encoder37 * PCX run-length encoder
50 * @param dst output buffer38 * @param dst output buffer
@@ -209,7 +197,6 @@ AVCodec ff_pcx_encoder = { · 158 unmodified lines
209 .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),197 .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
210 .type = AVMEDIA_TYPE_VIDEO,198 .type = AVMEDIA_TYPE_VIDEO,
211 .id = AV_CODEC_ID_PCX,199 .id = AV_CODEC_ID_PCX,
212 .init = pcx_encode_init,
213 .encode2 = pcx_encode_frame,200 .encode2 = pcx_encode_frame,
214 .pix_fmts = (const enum AVPixelFormat[]){201 .pix_fmts = (const enum AVPixelFormat[]){
215 AV_PIX_FMT_RGB24,202 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
1008 avctx->bits_per_coded_sample = 8;1008 avctx->bits_per_coded_sample = 8;
1009 }1009 }
1010 1010
1011#if FF_API_CODED_FRAME
1012FF_DISABLE_DEPRECATION_WARNINGS
1013 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
1014 avctx->coded_frame->key_frame = 1;
1015FF_ENABLE_DEPRECATION_WARNINGS
1016#endif
1017
1018 ff_llvidencdsp_init(&s->llvidencdsp);1011 ff_llvidencdsp_init(&s->llvidencdsp);
1019 1012
1020 if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK)1013 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
148 return 0;148 return 0;
149}149}
150 150
151static av_cold int pnm_encode_init(AVCodecContext *avctx)
152{
153#if FF_API_CODED_FRAME
154FF_DISABLE_DEPRECATION_WARNINGS
155 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
156 avctx->coded_frame->key_frame = 1;
157FF_ENABLE_DEPRECATION_WARNINGS
158#endif
159
160 return 0;
161}
162
163#if CONFIG_PGM_ENCODER151#if CONFIG_PGM_ENCODER
164AVCodec ff_pgm_encoder = {152AVCodec ff_pgm_encoder = {
165 .name = "pgm",153 .name = "pgm",
166 .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),154 .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
167 .type = AVMEDIA_TYPE_VIDEO,155 .type = AVMEDIA_TYPE_VIDEO,
168 .id = AV_CODEC_ID_PGM,156 .id = AV_CODEC_ID_PGM,
169 .init = pnm_encode_init,
170 .encode2 = pnm_encode_frame,157 .encode2 = pnm_encode_frame,
171 .pix_fmts = (const enum AVPixelFormat[]){158 .pix_fmts = (const enum AVPixelFormat[]){
172 AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE159 AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE
@@ -181,7 +168,6 @@ AVCodec ff_pgmyuv_encoder = { · 8 unmodified lines
181 .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),168 .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
182 .type = AVMEDIA_TYPE_VIDEO,169 .type = AVMEDIA_TYPE_VIDEO,
183 .id = AV_CODEC_ID_PGMYUV,170 .id = AV_CODEC_ID_PGMYUV,
184 .init = pnm_encode_init,
185 .encode2 = pnm_encode_frame,171 .encode2 = pnm_encode_frame,
186 .pix_fmts = (const enum AVPixelFormat[]){172 .pix_fmts = (const enum AVPixelFormat[]){
187 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE173 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE
@@ -196,7 +182,6 @@ AVCodec ff_ppm_encoder = { · 8 unmodified lines
196 .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),182 .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
197 .type = AVMEDIA_TYPE_VIDEO,183 .type = AVMEDIA_TYPE_VIDEO,
198 .id = AV_CODEC_ID_PPM,184 .id = AV_CODEC_ID_PPM,
199 .init = pnm_encode_init,
200 .encode2 = pnm_encode_frame,185 .encode2 = pnm_encode_frame,
201 .pix_fmts = (const enum AVPixelFormat[]){186 .pix_fmts = (const enum AVPixelFormat[]){
202 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE187 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE
@@ -211,7 +196,6 @@ AVCodec ff_pbm_encoder = { · 8 unmodified lines
211 .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),196 .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
212 .type = AVMEDIA_TYPE_VIDEO,197 .type = AVMEDIA_TYPE_VIDEO,
213 .id = AV_CODEC_ID_PBM,198 .id = AV_CODEC_ID_PBM,
214 .init = pnm_encode_init,
215 .encode2 = pnm_encode_frame,199 .encode2 = pnm_encode_frame,
216 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE,200 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE,
217 AV_PIX_FMT_NONE },201 AV_PIX_FMT_NONE },
@@ -225,7 +209,6 @@ AVCodec ff_pfm_encoder = { · 7 unmodified lines
225 .long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"),209 .long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"),
226 .type = AVMEDIA_TYPE_VIDEO,210 .type = AVMEDIA_TYPE_VIDEO,
227 .id = AV_CODEC_ID_PFM,211 .id = AV_CODEC_ID_PFM,
228 .init = pnm_encode_init,
229 .encode2 = pnm_encode_frame,212 .encode2 = pnm_encode_frame,
230 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32,213 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32,
231 AV_PIX_FMT_NONE },214 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
1179 int interlaced = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);1179 int interlaced = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);
1180 1180
1181 avctx->bits_per_raw_sample = 10;1181 avctx->bits_per_raw_sample = 10;
1182#if FF_API_CODED_FRAME
1183FF_DISABLE_DEPRECATION_WARNINGS
1184 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
1185 avctx->coded_frame->key_frame = 1;
1186FF_ENABLE_DEPRECATION_WARNINGS
1187#endif
1188 1182
1189 ctx->fdct = prores_fdct;1183 ctx->fdct = prores_fdct;
1190 ctx->scantable = interlaced ? ff_prores_interlaced_scan1184 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
321 }321 }
322 322
323 if (for_user) {323 if (for_user) {
324#if FF_API_CODED_FRAME
325FF_DISABLE_DEPRECATION_WARNINGS
326 dst->coded_frame = src->coded_frame;
327FF_ENABLE_DEPRECATION_WARNINGS
328#endif
329 if (dst->codec->update_thread_context_for_user)324 if (dst->codec->update_thread_context_for_user)
330 err = dst->codec->update_thread_context_for_user(dst, src);325 err = dst->codec->update_thread_context_for_user(dst, src);
331 } else {326 } else {
libavcodec/qsvenc.c+0−6
@@ -1555,12 +1555,6 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, · 1554 unmodified lines
1555 return AVERROR_INVALIDDATA;1555 return AVERROR_INVALIDDATA;
1556 }1556 }
1557 1557
1558#if FF_API_CODED_FRAME
1559FF_DISABLE_DEPRECATION_WARNINGS
1560 avctx->coded_frame->pict_type = pict_type;
1561FF_ENABLE_DEPRECATION_WARNINGS
1562#endif
1563
1564#if QSV_VERSION_ATLEAST(1, 26)1558#if QSV_VERSION_ATLEAST(1, 26)
1565 if (avctx->codec_id == AV_CODEC_ID_H264) {1559 if (avctx->codec_id == AV_CODEC_ID_H264) {
1566 enc_buf = bs->ExtParam;1560 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
391 return ret;391 return ret;
392 }392 }
393 393
394#if FF_API_CODED_FRAME
395FF_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;
398FF_ENABLE_DEPRECATION_WARNINGS
399#endif
400
401 if (s->key_frame)394 if (s->key_frame)
402 pkt->flags |= AV_PKT_FLAG_KEY;395 pkt->flags |= AV_PKT_FLAG_KEY;
403 *got_packet = 1;396 *got_packet = 1;
libavcodec/rawenc.c+0−5
@@ -36,11 +36,6 @@ static av_cold int raw_encode_init(AVCodecContext *avctx) · 35 unmodified lines
36{36{
37 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);37 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
38 38
39#if FF_API_CODED_FRAME
40FF_DISABLE_DEPRECATION_WARNINGS
41 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
42FF_ENABLE_DEPRECATION_WARNINGS
43#endif
44 avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);39 avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc);
45 if(!avctx->codec_tag)40 if(!avctx->codec_tag)
46 avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);41 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
100 unsigned int width, height, depth, dimension;100 unsigned int width, height, depth, dimension;
101 unsigned int bytes_per_channel, pixmax, put_be;101 unsigned int bytes_per_channel, pixmax, put_be;
102 102
103#if FF_API_CODED_FRAME
104FF_DISABLE_DEPRECATION_WARNINGS
105 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
106 avctx->coded_frame->key_frame = 1;
107FF_ENABLE_DEPRECATION_WARNINGS
108#endif
109
110 width = avctx->width;103 width = avctx->width;
111 height = avctx->height;104 height = avctx->height;
112 bytes_per_channel = 1;105 bytes_per_channel = 1;
libavcodec/snowenc.c+0−19
@@ -1618,22 +1618,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 1617 unmodified lines
1618 s->lambda = 0;1618 s->lambda = 0;
1619 }//else keep previous frame's qlog until after motion estimation1619 }//else keep previous frame's qlog until after motion estimation
1620 1620
1621#if FF_API_CODED_FRAME
1622FF_DISABLE_DEPRECATION_WARNINGS
1623 av_frame_unref(avctx->coded_frame);
1624FF_ENABLE_DEPRECATION_WARNINGS
1625#endif
1626
1627 if (s->current_picture->data[0]) {1621 if (s->current_picture->data[0]) {
1628 int w = s->avctx->width;1622 int w = s->avctx->width;
1629 int h = s->avctx->height;1623 int h = s->avctx->height;
1630 1624
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
1637 s->mpvencdsp.draw_edges(s->current_picture->data[0],1625 s->mpvencdsp.draw_edges(s->current_picture->data[0],
1638 s->current_picture->linesize[0], w , h ,1626 s->current_picture->linesize[0], w , h ,
1639 EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM);1627 EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM);
@@ -1649,13 +1637,6 @@ FF_ENABLE_DEPRECATION_WARNINGS · 9 unmodified lines
1649 }1637 }
1650 1638
1651 ff_snow_frame_start(s);1639 ff_snow_frame_start(s);
1652#if FF_API_CODED_FRAME
1653FF_DISABLE_DEPRECATION_WARNINGS
1654 ret = av_frame_ref(avctx->coded_frame, s->current_picture);
1655FF_ENABLE_DEPRECATION_WARNINGS
1656#endif
1657 if (ret < 0)
1658 return ret;
1659 1640
1660 s->m.current_picture_ptr= &s->m.current_picture;1641 s->m.current_picture_ptr= &s->m.current_picture;
1661 s->m.current_picture.f = s->current_picture;1642 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
615 s->pict_type = AV_PICTURE_TYPE_I;615 s->pict_type = AV_PICTURE_TYPE_I;
616 s->quality = pict->quality;616 s->quality = pict->quality;
617 617
618#if FF_API_CODED_FRAME
619FF_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;
622FF_ENABLE_DEPRECATION_WARNINGS
623#endif
624
625 ff_side_data_set_encoder_stats(pkt, pict->quality, NULL, 0, s->pict_type);618 ff_side_data_set_encoder_stats(pkt, pict->quality, NULL, 0, s->pict_type);
626 619
627 svq1_write_header(s, s->pict_type);620 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
184 return AVERROR(EINVAL);184 return AVERROR(EINVAL);
185 }185 }
186 186
187#if FF_API_CODED_FRAME
188FF_DISABLE_DEPRECATION_WARNINGS
189 avctx->coded_frame->key_frame = 1;
190 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
191FF_ENABLE_DEPRECATION_WARNINGS
192#endif
193
194 return 0;187 return 0;
195}188}
196 189
libavcodec/tiffenc.c+0−6
@@ -533,12 +533,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 532 unmodified lines
533 }533 }
534#endif534#endif
535 535
536#if FF_API_CODED_FRAME
537FF_DISABLE_DEPRECATION_WARNINGS
538 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
539 avctx->coded_frame->key_frame = 1;
540FF_ENABLE_DEPRECATION_WARNINGS
541#endif
542 s->avctx = avctx;536 s->avctx = avctx;
543 537
544 return 0;538 return 0;
libavcodec/utvideoenc.c+1−8
@@ -621,15 +621,8 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 620 unmodified lines
621 * At least currently Ut Video is IDR only.621 * At least currently Ut Video is IDR only.
622 * Set flags accordingly.622 * Set flags accordingly.
623 */623 */
624#if FF_API_CODED_FRAME
625FF_DISABLE_DEPRECATION_WARNINGS
626 avctx->coded_frame->key_frame = 1;
627 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
628FF_ENABLE_DEPRECATION_WARNINGS
629#endif
630
631 pkt->size = bytestream2_tell_p(&pb);
632 pkt->flags |= AV_PKT_FLAG_KEY;624 pkt->flags |= AV_PKT_FLAG_KEY;
625 pkt->size = bytestream2_tell_p(&pb);
633 626
634 /* Packet should be done */627 /* Packet should be done */
635 *got_packet = 1;628 *got_packet = 1;
libavcodec/v210enc.c+0−6
@@ -101,12 +101,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 100 unmodified lines
101 return AVERROR(EINVAL);101 return AVERROR(EINVAL);
102 }102 }
103 103
104#if FF_API_CODED_FRAME
105FF_DISABLE_DEPRECATION_WARNINGS
106 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
107FF_ENABLE_DEPRECATION_WARNINGS
108#endif
109
110 ff_v210enc_init(s);104 ff_v210enc_init(s);
111 105
112 avctx->bits_per_coded_sample = 20;106 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
51 return ret;51 return ret;
52 dst = pkt->data;52 dst = pkt->data;
53 53
54#if FF_API_CODED_FRAME
55FF_DISABLE_DEPRECATION_WARNINGS
56 avctx->coded_frame->key_frame = 1;
57 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
58FF_ENABLE_DEPRECATION_WARNINGS
59#endif
60
61 y = (uint16_t *)pic->data[0];54 y = (uint16_t *)pic->data[0];
62 u = (uint16_t *)pic->data[1];55 u = (uint16_t *)pic->data[1];
63 v = (uint16_t *)pic->data[2];56 v = (uint16_t *)pic->data[2];
libavcodec/version.h+0−3
@@ -51,9 +51,6 @@ · 50 unmodified lines
51 * at once through the bump. This improves the git bisect-ability of the change.51 * at once through the bump. This improves the git bisect-ability of the change.
52 */52 */
53 53
54#ifndef FF_API_CODED_FRAME
55#define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59)
56#endif
57#ifndef FF_API_OPENH264_SLICE_MODE54#ifndef FF_API_OPENH264_SLICE_MODE
58#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 59)55#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 59)
59#endif56#endif
libavcodec/zmbvenc.c+0−6
@@ -180,12 +180,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 179 unmodified lines
180 c->curfrm++;180 c->curfrm++;
181 if(c->curfrm == c->keyint)181 if(c->curfrm == c->keyint)
182 c->curfrm = 0;182 c->curfrm = 0;
183#if FF_API_CODED_FRAME
184FF_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;
187FF_ENABLE_DEPRECATION_WARNINGS
188#endif
189 183
190 palptr = (avctx->pix_fmt == AV_PIX_FMT_PAL8) ? (uint32_t *)p->data[1] : NULL;184 palptr = (avctx->pix_fmt == AV_PIX_FMT_PAL8) ? (uint32_t *)p->data[1] : NULL;
191 chpal = !keyframe && palptr && memcmp(palptr, c->pal2, 1024);185 chpal = !keyframe && palptr && memcmp(palptr, c->pal2, 1024);
libavdevice/v4l2.c+0−15
@@ -981,27 +981,12 @@ fail: · 980 unmodified lines
981 981
982static int v4l2_read_packet(AVFormatContext *ctx, AVPacket *pkt)982static int v4l2_read_packet(AVFormatContext *ctx, AVPacket *pkt)
983{983{
984#if FF_API_CODED_FRAME && FF_API_LAVF_AVCTX
985FF_DISABLE_DEPRECATION_WARNINGS
986 struct video_data *s = ctx->priv_data;
987 AVFrame *frame = ctx->streams[0]->codec->coded_frame;
988FF_ENABLE_DEPRECATION_WARNINGS
989#endif
990 int res;984 int res;
991 985
992 if ((res = mmap_read_frame(ctx, pkt)) < 0) {986 if ((res = mmap_read_frame(ctx, pkt)) < 0) {
993 return res;987 return res;
994 }988 }
995 989
996#if FF_API_CODED_FRAME && FF_API_LAVF_AVCTX
997FF_DISABLE_DEPRECATION_WARNINGS
998 if (frame && s->interlaced) {
999 frame->interlaced_frame = 1;
1000 frame->top_field_first = s->top_field_first;
1001 }
1002FF_ENABLE_DEPRECATION_WARNINGS
1003#endif
1004
1005 return pkt->size;990 return pkt->size;
1006}991}
1007 992

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