summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-11-30 12:19:36 -0500
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-12-07 11:27:42 -0500
commit16216b713f9a21865cc07993961cf5d0ece24916 (patch)
tree9c377726ecbf0f1cc9c77ce60d054f159760ecea /libavcodec/mpegvideo_enc.c
parentbe00ec832c519427cd92218abac77dafdc1d5487 (diff)
lavc: Drop exporting 2-pass encoding stats
These variables are coming from mpegvideoenc where are supposedly used as bit counters on various frame properties. However their use is unclear as they lack documentation, are available only from a very small subset of encoders, and they are hardly used in the wild. Also frame_bits in aacenc is employed in a similar way. Remove this functionality from AVCodecContex, these variable are mostly frame properties, and too few encoders support setting them with anything useful. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 4e97f4d3ab..6f5858554d 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1659,6 +1659,8 @@ vbv_retry:
if (encode_picture(s, s->picture_number) < 0)
return -1;
+#if FF_API_STAT_BITS
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->header_bits = s->header_bits;
avctx->mv_bits = s->mv_bits;
avctx->misc_bits = s->misc_bits;
@@ -1668,6 +1670,8 @@ vbv_retry:
// FIXME f/b_count in avctx
avctx->p_count = s->mb_num - s->i_count - s->skip_count;
avctx->skip_count = s->skip_count;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
frame_end(s);
@@ -1727,9 +1731,9 @@ vbv_retry:
}
if (s->avctx->flags & AV_CODEC_FLAG_PASS1)
- assert(avctx->header_bits + avctx->mv_bits + avctx->misc_bits +
- avctx->i_tex_bits + avctx->p_tex_bits ==
- put_bits_count(&s->pb));
+ assert(put_bits_count(&s->pb) == s->header_bits + s->mv_bits +
+ s->misc_bits + s->i_tex_bits +
+ s->p_tex_bits);
flush_put_bits(&s->pb);
s->frame_bits = put_bits_count(&s->pb);
@@ -1811,7 +1815,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
s->total_bits += s->frame_bits;
+#if FF_API_STAT_BITS
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->frame_bits = s->frame_bits;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
pkt->pts = s->current_picture.f->pts;
if (!s->low_delay && s->pict_type != AV_PICTURE_TYPE_B) {