[FFmpeg-cvslog] avcodec/mpegvideo_parser: consider vbv_delay in bitrate heuristic also for mpeg2

Michael Niedermayer git at videolan.org
Mon Aug 25 15:14:16 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Aug 20 20:01:40 2014 +0200| [d647ef0c8069876e53f9ce630890f1fb09986247] | committer: Michael Niedermayer

avcodec/mpegvideo_parser: consider vbv_delay in bitrate heuristic also for mpeg2

Fixes bitrate detection in CBR mpeg2
Fixes ticket3678

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

 libavcodec/mpegvideo_parser.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index 7aa3660..44bf26d 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -145,8 +145,9 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
  the_end: ;
     if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) {
         avctx->rc_max_rate = 400*bit_rate;
-    } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate &&
-               (bit_rate != 0x3FFFF || vbv_delay != 0xFFFF)) {
+    }
+    if (bit_rate &&
+        ((avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate != 0x3FFFF) || vbv_delay != 0xFFFF)) {
         avctx->bit_rate = 400*bit_rate;
     }
 }



More information about the ffmpeg-cvslog mailing list