OSDN Git Service

Fix potential crash in libbluray
[handbrake-jp/handbrake-jp-git.git] / libhb / encx264.c
index b74d4f2..2a3c2b6 100644 (file)
@@ -123,9 +123,6 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
         }
     }
     
-    /* Temporary hack to use old b-pyramid default */
-    param.i_bframe_pyramid = 0;
-
     /* Enable metrics */
     param.analyse.b_psnr = 1;
     param.analyse.b_ssim = 1;
@@ -161,14 +158,12 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
                we still want the same keyframe intervals as the 1st pass,
                so the 1st pass stats won't conflict on frame decisions.    */
             hb_interjob_t * interjob = hb_interjob_get( job->h );
-            param.i_keyint_min =      ( ( (double)interjob->vrate / (double)interjob->vrate_base ) + 0.5 );
             param.i_keyint_max = ( ( 10 * (double)interjob->vrate / (double)interjob->vrate_base ) + 0.5 );
         }
         else
         {
             /* adjust +0.5 for when fps has remainder to bump
                { 23.976, 29.976, 59.94 } to { 24, 30, 60 } */
-            param.i_keyint_min =      ( ( (double)job->vrate / (double)job->vrate_base ) + 0.5 );
             param.i_keyint_max = ( ( 10 * (double)job->vrate / (double)job->vrate_base ) + 0.5 );
         }
     }
@@ -223,18 +218,6 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
                 value++;
             }
 
-            if( !( strcmp( name, "b-pyramid" ) ) )
-            {
-                if( value == NULL || !strcmp( value, "1" ) )
-                {
-                    value = "normal";
-                }
-                else if( !strcmp( value, "0" ) )
-                {
-                    value = "none";
-                }
-            }
-
             /* Here's where the strings are passed to libx264 for parsing. */
             ret = x264_param_parse( &param, name, value );
 
@@ -267,8 +250,9 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
         job->areBframes = 0;
     }
     
-    if( param.i_keyint_min != 25 || param.i_keyint_max != 250 )
-        hb_log("encx264: keyint-min: %i, keyint-max: %i", param.i_keyint_min, param.i_keyint_max);
+    if( param.i_keyint_min != X264_KEYINT_MIN_AUTO || param.i_keyint_max != 250 )
+        hb_log("encx264: min-keyint: %i, keyint: %i", param.i_keyint_min == X264_KEYINT_MIN_AUTO ? param.i_keyint_max / 10 : param.i_keyint_min,
+                                                      param.i_keyint_max);
 
     /* set up the VUI color model & gamma to match what the COLR atom
      * set in muxmp4.c says. See libhb/muxmp4.c for notes. */