[vlc-commits] avcodec: use qscale=3 as default if videobitrate	isn't provided
    Ilkka Ollakka 
    git at videolan.org
       
    Sat Nov 29 14:24:55 CET 2014
    
    
  
vlc/vlc-2.2 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Nov 29 13:52:26 2014 +0200| [b8ef86ccaf3abb41e44055fe094e4d33a660d71b] | 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).
(cherry picked from commit 20f32dd168a37dde277edae8aee90906e79dcef4)
Signed-off-by: Ilkka Ollakka <ileoo at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=b8ef86ccaf3abb41e44055fe094e4d33a660d71b
---
 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 2a710f3..1807712 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -215,7 +215,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 c0098d3..0b25b6c 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -627,7 +627,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