[vlc-commits] commit: avcodec: add littlebit options that are adjusted for VP8 ( Ilkka Ollakka )

git at videolan.org git at videolan.org
Wed May 26 14:57:53 CEST 2010


vlc/vlc-1.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed May 26 15:54:52 2010 +0300| [80b3b510608964122d54fa47c8f5a04f029c2a58] | committer: Ilkka Ollakka 

avcodec: add littlebit options that are adjusted for VP8

Seems that maxrate needs somekinda exponential function from bitrate (comparing
ffmpeg's libvpx presets) and cbr isn't something you likely will get out of this.
(cherry picked from commit d3c422e310bfaed687554e2553357b89b3b2a82e)

Signed-off-by: Ilkka Ollakka <ileoo at iki.fi>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=80b3b510608964122d54fa47c8f5a04f029c2a58
---

 modules/codec/avcodec/encoder.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index b3a3703..88e8edb 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -584,12 +584,18 @@ int OpenEncoder( vlc_object_t *p_this )
        libvpx-720p preset from libvpx ffmpeg-patch */
     if( i_codec_id == CODEC_ID_VP8 )
     {
-        p_context->bit_rate_tolerance = 2* p_enc->fmt_out.i_bitrate;
+        p_context->bit_rate_tolerance = __MAX(2 * p_enc->fmt_out.i_bitrate, p_sys->i_vtolerance );
+        /* I used Harrison-stetson method here to get there values */
+        p_context->rc_max_rate = 3 * p_enc->fmt_out.i_bitrate;
+        p_context->rc_min_rate = p_enc->fmt_out.i_bitrate / 200;
+
+
         p_context->lag = 16;
         p_context->level = 216;
         p_context->profile = 0;
         p_context->rc_buffer_aggressivity = 0.95;
         p_context->token_partitions = 4;
+        p_context->mb_static_threshold = 0;
     }
 #endif
 



More information about the vlc-commits mailing list