[FFmpeg-cvslog] lavc/libmp3lame: add comments about CBR/VBR modes

Timothy Gu git at videolan.org
Thu Oct 24 11:33:48 CEST 2013


ffmpeg | branch: master | Timothy Gu <timothygu99 at gmail.com> | Wed Oct 23 20:57:36 2013 -0700| [07e7bc9cbda12921ddf0ae6bbbf9328f29c3c63e] | committer: Stefano Sabatini

lavc/libmp3lame: add comments about CBR/VBR modes

Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
Signed-off-by: Stefano Sabatini <stefasab at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=07e7bc9cbda12921ddf0ae6bbbf9328f29c3c63e
---

 libavcodec/libmp3lame.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 6402d3e..0fb9c6a 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -115,11 +115,11 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
         lame_set_quality(s->gfp, avctx->compression_level);
 
     /* rate control */
-    if (avctx->flags & CODEC_FLAG_QSCALE) {
+    if (avctx->flags & CODEC_FLAG_QSCALE) { // VBR
         lame_set_VBR(s->gfp, vbr_default);
         lame_set_VBR_quality(s->gfp, avctx->global_quality / (float)FF_QP2LAMBDA);
     } else {
-        if (avctx->bit_rate)
+        if (avctx->bit_rate)                // CBR
             lame_set_brate(s->gfp, avctx->bit_rate / 1000);
     }
 



More information about the ffmpeg-cvslog mailing list