]> git.sesse.net Git - vlc/commitdiff
Merge branch 'master' of git@git.videolan.org:vlc
authorIlkka Ollakka <ileoo@videolan.org>
Thu, 26 Jun 2008 07:38:53 +0000 (10:38 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Thu, 26 Jun 2008 07:38:53 +0000 (10:38 +0300)
modules/codec/avcodec/avcodec.c
modules/codec/avcodec/avcodec.h
modules/codec/avcodec/encoder.c

index 0e554da2cbbcfd716acb17391e0f64a48221655b..3fa80a5bcbb02bdce96ca5a45cdad5b2e6ac920a 100644 (file)
@@ -153,8 +153,6 @@ vlc_module_begin();
                  ENC_VT_LONGTEXT, true );
     add_bool( ENC_CFG_PREFIX "pre-me", 0, NULL, ENC_PRE_ME_TEXT,
               ENC_PRE_ME_LONGTEXT, true );
-    add_bool( ENC_CFG_PREFIX "strict-rc", 0, NULL, ENC_RC_STRICT_TEXT,
-              ENC_RC_STRICT_LONGTEXT, true );
     add_integer( ENC_CFG_PREFIX "rc-buffer-size", 224*1024*8, NULL,
                  ENC_RC_BUF_TEXT, ENC_RC_BUF_LONGTEXT, true );
     add_float( ENC_CFG_PREFIX "rc-buffer-aggressivity", 1.0, NULL,
index c80aa878845350e3e04313587052fcbe8dcb719d..591d1258db8b6aa8b2f82c39439cb84afa8fa779 100644 (file)
@@ -141,10 +141,6 @@ void EndAudioDec( decoder_t *p_dec );
 #define ENC_PRE_ME_LONGTEXT N_( "Enable the pre-motion " \
   "estimation algorithm.")
 
-#define ENC_RC_STRICT_TEXT N_( "Strict rate control" )
-#define ENC_RC_STRICT_LONGTEXT N_( "Enable the strict rate " \
-  "control algorithm." )
-
 #define ENC_RC_BUF_TEXT N_( "Rate control buffer size" )
 #define ENC_RC_BUF_LONGTEXT N_( "Rate control " \
   "buffer size (in kbytes). A bigger buffer will allow for better rate " \
index 23c2674465ef3a08507432b61864e87f8c713f54..49763f21c0efd0132d8d8a092b77f2750fcdb228 100644 (file)
@@ -131,7 +131,6 @@ struct encoder_sys_t
     int        i_qmin;
     int        i_qmax;
     int        i_hq;
-    bool       b_strict_rc;
     int        i_rc_buffer_size;
     float      f_rc_buffer_aggressivity;
     bool       b_pre_me;
@@ -153,7 +152,7 @@ struct encoder_sys_t
 };
 
 static const char *const ppsz_enc_options[] = {
-    "keyint", "bframes", "vt", "qmin", "qmax", "hq", "strict-rc",
+    "keyint", "bframes", "vt", "qmin", "qmax", "hq", 
     "rc-buffer-size", "rc-buffer-aggressivity", "pre-me", "hurry-up",
     "interlace", "i-quant-factor", "noise-reduction", "mpeg4-matrix",
     "trellis", "qscale", "strict", "lumi-masking", "dark-masking",
@@ -318,8 +317,6 @@ int OpenEncoder( vlc_object_t *p_this )
         p_sys->i_noise_reduction = 1;
     }
 
-    var_Get( p_enc, ENC_CFG_PREFIX "strict-rc", &val );
-    p_sys->b_strict_rc = val.b_bool;
     var_Get( p_enc, ENC_CFG_PREFIX "rc-buffer-size", &val );
     p_sys->i_rc_buffer_size = val.i_int;
     var_Get( p_enc, ENC_CFG_PREFIX "rc-buffer-aggressivity", &val );
@@ -475,17 +472,6 @@ int OpenEncoder( vlc_object_t *p_this )
             p_enc->fmt_in.i_codec = GetVlcChroma( p_context->pix_fmt );
         }
 
-        if ( p_sys->b_strict_rc )
-        {
-            p_context->rc_qsquish = 1.0;
-            p_context->rc_max_rate = p_enc->fmt_out.i_bitrate;
-            p_context->rc_min_rate = p_enc->fmt_out.i_bitrate;
-            p_context->rc_buffer_size = p_sys->i_rc_buffer_size;
-            /* This is from ffmpeg's ffmpeg.c : */
-            p_context->rc_initial_buffer_occupancy
-                = p_sys->i_rc_buffer_size * 3/4;
-            p_context->rc_buffer_aggressivity = p_sys->f_rc_buffer_aggressivity;
-        }
 
         if ( p_sys->f_i_quant_factor != 0.0 )
             p_context->i_quant_factor = p_sys->f_i_quant_factor;
@@ -560,6 +546,17 @@ int OpenEncoder( vlc_object_t *p_this )
         {
             p_context->flags |= CODEC_FLAG_QSCALE;
             p_context->global_quality = p_sys->i_quality;
+        } 
+        else 
+        {
+            p_context->rc_qsquish = 1.0;
+            p_context->rc_max_rate = p_enc->fmt_out.i_bitrate;
+            p_context->rc_min_rate = p_enc->fmt_out.i_bitrate;
+            p_context->rc_buffer_size = p_sys->i_rc_buffer_size;
+            /* This is from ffmpeg's ffmpeg.c : */
+            p_context->rc_initial_buffer_occupancy
+                = p_sys->i_rc_buffer_size * 3/4;
+            p_context->rc_buffer_aggressivity = p_sys->f_rc_buffer_aggressivity;
         }
     }
     else if( p_enc->fmt_in.i_cat == AUDIO_ES )
@@ -575,8 +572,8 @@ int OpenEncoder( vlc_object_t *p_this )
         if ( p_enc->fmt_out.i_codec == VLC_FOURCC('m','p','4','a') )
         {
             /* XXX: FAAC does resample only when setting the INPUT samplerate
-             * to the desired value (-R option of the faac frontend) */
-            p_enc->fmt_in.audio.i_rate = p_context->sample_rate;
+             * to the desired value (-R option of the faac frontend) 
+            p_enc->fmt_in.audio.i_rate = p_context->sample_rate;*/
 #if LIBAVCODEC_VERSION_INT >= ((51<<16)+(40<<8)+4)
         /* Ignore FF_PROFILE_UNKNOWN */
         if( p_sys->i_aac_profile >= FF_PROFILE_AAC_MAIN )