summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2009-12-08 15:48:40 +0000
committerjbrjake <[email protected]>2009-12-08 15:48:40 +0000
commit2156f5f59c48b03dd536485ab29e1891925e5db3 (patch)
tree7a64ff6275b190213cba55d9f2e0b14d0708d563
parent718c04e00317956ba14d2d5499410480847c2d62 (diff)
Use the correct render offset when b-pyramid is enabled in the x264 parameter string but is being disabled inside libx264 due to mb-tree. Thanks, Rodeo, and good catch! Also adds a logging message to note weight-p being disabled in bframeless encodes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3013 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/encx264.c63
1 files changed, 24 insertions, 39 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c
index bd41839a1..d237d913d 100644
--- a/libhb/encx264.c
+++ b/libhb/encx264.c
@@ -113,18 +113,12 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
value++;
}
- /*
- When B-frames are enabled, the max frame count increments
- by 1 (regardless of the number of B-frames). If you don't
- change the duration of the video track when you mux, libmp4
- barfs. So, check if the x264opts aren't using B-frames, and
- when they aren't, set the boolean job->areBframes as false.
- */
if( !( strcmp( name, "bframes" ) ) )
{
if( atoi( value ) == 0 )
{
param.analyse.i_weighted_pred = X264_WEIGHTP_NONE;
+ hb_log("encx264: no bframes, disabling weight-p unless told otherwise");
}
}
}
@@ -169,8 +163,6 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
param.i_keyint_min = fps;
param.i_keyint_max = fps * 10;
}
-
- hb_log("encx264: keyint-min: %i, keyint-max: %i", param.i_keyint_min, param.i_keyint_max);
}
param.i_log_level = X264_LOG_INFO;
@@ -181,9 +173,6 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
hb_log( "encx264: encoding at level %i",
param.i_level_idc );
}
-
- /* B-frames are on by default.*/
- job->areBframes = 1;
/*
This section passes the string x264opts to libx264 for parsing into
@@ -226,35 +215,8 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
value++;
}
- /*
- When B-frames are enabled, the max frame count increments
- by 1 (regardless of the number of B-frames). If you don't
- change the duration of the video track when you mux, libmp4
- barfs. So, check if the x264opts aren't using B-frames, and
- when they aren't, set the boolean job->areBframes as false.
- */
- if( !( strcmp( name, "bframes" ) ) )
- {
- if( atoi( value ) == 0 )
- {
- job->areBframes = 0;
- }
- }
-
- /* Note b-pyramid here, so the initial delay can be doubled */
if( !( strcmp( name, "b-pyramid" ) ) )
{
- if( value != NULL )
- {
- if( atoi( value ) > 0 )
- {
- job->areBframes = 2;
- }
- }
- else
- {
- job->areBframes = 2;
- }
if( value == NULL || !strcmp( value, "1" ) )
{
value = "normal";
@@ -276,6 +238,29 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
}
free(x264opts_start);
}
+
+ /* B-frames are on by default.*/
+ job->areBframes = 1;
+
+ if(!param.rc.b_mb_tree && param.i_bframe && param.i_bframe_pyramid)
+ {
+ /* Note b-pyramid here, so the initial delay can be doubled */
+ job->areBframes = 2;
+ }
+ else if (!param.i_bframe)
+ {
+ /*
+ When B-frames are enabled, the max frame count increments
+ by 1 (regardless of the number of B-frames). If you don't
+ change the duration of the video track when you mux, libmp4
+ barfs. So, check if the x264opts aren't using B-frames, and
+ when they aren't, set the boolean job->areBframes as false.
+ */
+ 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);
/* set up the VUI color model & gamma to match what the COLR atom
* set in muxmp4.c says. See libhb/muxmp4.c for notes. */