[vlc-commits] commit: avcodec: set some hopefully reasonable defaults to vp8 encoding ( Ilkka Ollakka )

git at videolan.org git at videolan.org
Wed May 26 11:19:35 CEST 2010


vlc/vlc-1.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed May 26 12:16:29 2010 +0300| [c1ffa82442a67c5f94becd3bbab005f82f77cc8e] | committer: Ilkka Ollakka 

avcodec: set some hopefully reasonable defaults to vp8 encoding
(cherry picked from commit 86263dcda269b17eff6b8a985f4865f176f44714)

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

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

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

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 60199b7..b3a3703 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -579,6 +579,20 @@ int OpenEncoder( vlc_object_t *p_this )
     /* Misc parameters */
     p_context->bit_rate = p_enc->fmt_out.i_bitrate;
 
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 68, 2 )
+    /* Set reasonable defaults to VP8, based on
+       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->lag = 16;
+        p_context->level = 216;
+        p_context->profile = 0;
+        p_context->rc_buffer_aggressivity = 0.95;
+        p_context->token_partitions = 4;
+    }
+#endif
+
     if( i_codec_id == CODEC_ID_RAWVIDEO )
     {
         /* XXX: hack: Force same codec (will be handled by transcode) */



More information about the vlc-commits mailing list