[vlc-commits] avcodec: use qscale=3 as default if videobitrate isn't provided

Ilkka Ollakka git at videolan.org
Sat Nov 29 12:58:56 CET 2014


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Nov 29 13:52:26 2014 +0200| [20f32dd168a37dde277edae8aee90906e79dcef4] | committer: Ilkka Ollakka

avcodec: use qscale=3 as default if videobitrate isn't provided

If user doesn't give videobitrate use some reasonable default to get ok output
from avcodec transcode (for example mpeg4 video).

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

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

diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index 73e7ca4..ed53cbd 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -208,7 +208,7 @@ vlc_module_begin ()
                  ENC_QMAX_TEXT, ENC_QMAX_LONGTEXT, true )
     add_bool( ENC_CFG_PREFIX "trellis", false,
               ENC_TRELLIS_TEXT, ENC_TRELLIS_LONGTEXT, true )
-    add_float( ENC_CFG_PREFIX "qscale", 0,
+    add_float( ENC_CFG_PREFIX "qscale", 3,
                ENC_QSCALE_TEXT, ENC_QSCALE_LONGTEXT, true )
     add_integer( ENC_CFG_PREFIX "strict", 0,
                  ENC_STRICT_TEXT, ENC_STRICT_LONGTEXT, true )
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 1425c06..b5e6e25 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -631,7 +631,7 @@ int OpenEncoder( vlc_object_t *p_this )
 
         p_context->mb_decision = p_sys->i_hq;
 
-        if( p_sys->i_quality )
+        if( p_sys->i_quality && !p_enc->fmt_out.i_bitrate )
         {
             p_context->flags |= CODEC_FLAG_QSCALE;
             p_context->global_quality = p_sys->i_quality;



More information about the vlc-commits mailing list