diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-11-30 12:19:36 -0500 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-12-07 11:27:42 -0500 |
commit | 16216b713f9a21865cc07993961cf5d0ece24916 (patch) | |
tree | 9c377726ecbf0f1cc9c77ce60d054f159760ecea /libavcodec/aacenc.c | |
parent | be00ec832c519427cd92218abac77dafdc1d5487 (diff) | |
download | ffmpeg-16216b713f9a21865cc07993961cf5d0ece24916.tar.gz |
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/aacenc.c')
-rw-r--r-- | libavcodec/aacenc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 00261c095e..c247c5b390 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -510,6 +510,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ChannelElement *cpe; int i, ch, w, g, chans, tag, start_ch, ret; int chan_el_counter[4]; + int frame_bits; FFPsyWindowInfo windows[AAC_MAX_CHANNELS]; if (s->last_frame == 2) @@ -577,8 +578,6 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } do { - int frame_bits; - init_put_bits(&s->pb, avpkt->data, avpkt->size); if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) @@ -651,11 +650,16 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, put_bits(&s->pb, 3, TYPE_END); flush_put_bits(&s->pb); - avctx->frame_bits = put_bits_count(&s->pb); + frame_bits = put_bits_count(&s->pb); +#if FF_API_STAT_BITS +FF_DISABLE_DEPRECATION_WARNINGS + avctx->frame_bits = frame_bits; +FF_ENABLE_DEPRECATION_WARNINGS +#endif // rate control stuff if (!(avctx->flags & AV_CODEC_FLAG_QSCALE)) { - float ratio = avctx->bit_rate * 1024.0f / avctx->sample_rate / avctx->frame_bits; + float ratio = avctx->bit_rate * 1024.0f / avctx->sample_rate / frame_bits; s->lambda *= ratio; s->lambda = FFMIN(s->lambda, 65536.f); } |