- if( job->h264_level )
- {
- param.i_threads = 1;
- param.b_cabac = 0;
- param.i_level_idc = job->h264_level;
- hb_log( "encx264: encoding at level %i",
- param.i_level_idc );
- }
-
- /* Slightly faster with minimal quality lost */
- param.analyse.i_subpel_refine = 4;
-
- /* This section passes the string x264opts to libx264 for parsing into parameter names and values.
-
- The string is set up like this:
- option1=value1:option2=value 2
-
- So, you have to iterate through based on the colons, and then put the left side of the equals sign in "name"
- and the right side into "value." Then you hand those strings off to x264 for interpretation.
-
- This is all based on the universal x264 option handling Loren Merritt implemented in the Mplayer/Mencoder project.
- */
-
- char *x264opts = job->x264opts;
- if(x264opts != NULL && *x264opts != '\0')
- {
- while(*x264opts)
- {
- char *name = x264opts;
- char *value;
- int ret;
-
- x264opts += strcspn(x264opts, ":");
- if(*x264opts)
- {
- *x264opts = 0;
- x264opts++;
- }
-
- value = strchr( name, '=' );
- if(value)
- {
- *value = 0;
- 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 are using B-frames, and when they are, set the boolean job->areBframes as true.
- */
-
- if (!(strcmp(name, "bframes")))
- {
- if (atoi(value) > 0)
- {
- job->areBframes = 1;
- }
- }
+ if( job->h264_level )
+ {
+ param.b_cabac = 0;
+ param.i_level_idc = job->h264_level;
+ hb_log( "encx264: encoding at level %i",
+ param.i_level_idc );
+ }
+
+ /* Slightly faster with minimal quality lost */
+ param.analyse.i_subpel_refine = 4;
+
+ /*
+ This section passes the string x264opts to libx264 for parsing into
+ parameter names and values.
+
+ The string is set up like this:
+ option1=value1:option2=value 2
+
+ So, you have to iterate through based on the colons, and then put
+ the left side of the equals sign in "name" and the right side into
+ "value." Then you hand those strings off to x264 for interpretation.
+
+ This is all based on the universal x264 option handling Loren
+ Merritt implemented in the Mplayer/Mencoder project.
+ */
+
+ char *x264opts = job->x264opts;
+ if( x264opts != NULL && *x264opts != '\0' )
+ {
+ while( *x264opts )
+ {
+ char *name = x264opts;
+ char *value;
+ int ret;
+
+ x264opts += strcspn( x264opts, ":" );
+ if( *x264opts )
+ {
+ *x264opts = 0;
+ x264opts++;
+ }
+
+ value = strchr( name, '=' );
+ if( value )
+ {
+ *value = 0;
+ 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 are using B-frames, and
+ when they are, set the boolean job->areBframes as true.
+ */
+
+ if( !( strcmp( name, "bframes" ) ) )
+ {
+ if( atoi( value ) > 0 )
+ {
+ job->areBframes = 1;
+ }
+ }