[FFmpeg-cvslog] mpegenc: simplify muxrate calculation

Janne Grunau git at videolan.org
Tue Jan 3 03:14:38 CET 2012


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Sun Jan  1 23:32:15 2012 +0100| [af9240cd3c6fb257ac2d0843334145f022ef5959] | committer: Janne Grunau

mpegenc: simplify muxrate calculation

The fate-h264-bsf-mp4toannexb failures were caused by an integer
overflow of the unneeded multiplication.

Inspired by patch by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/mpegenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index d537af6..b2ca35a 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -429,7 +429,7 @@ static int mpeg_mux_init(AVFormatContext *ctx)
     if (!s->mux_rate) {
         /* we increase slightly the bitrate to take into account the
            headers. XXX: compute it exactly */
-        bitrate += bitrate*5/100;
+        bitrate += bitrate / 20;
         bitrate += 10000;
         s->mux_rate = (bitrate + (8 * 50) - 1) / (8 * 50);
     }



More information about the ffmpeg-cvslog mailing list