[FFmpeg-devel] [PATCH 6/7] libkvazaar: Fix setting target bitrate

Arttu Ylä-Outinen arttu.yla-outinen at tut.fi
Mon Sep 28 12:13:24 CEST 2015


The divisor and dividend in the equation had been swapped, making the
result the inverse of the actual bitrate.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen at tut.fi>
---
 libavcodec/libkvazaar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 0879844..0cf890f 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -73,7 +73,7 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
     cfg->width = avctx->width;
     cfg->height = avctx->height;
     cfg->framerate =
-      (double)(avctx->time_base.num * avctx->ticks_per_frame) / avctx->time_base.den;
+      avctx->time_base.den / (double)(avctx->time_base.num * avctx->ticks_per_frame);
     cfg->threads = avctx->thread_count;
     cfg->target_bitrate = avctx->bit_rate;
     cfg->vui.sar_width = avctx->sample_aspect_ratio.num;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list