break;
default:
- fprintf( stderr, "Arg invalid CSP\n" );
+ x264_log( h, X264_LOG_ERROR, "Arg invalid CSP\n" );
break;
}
}
else
{
/* FIXME */
- fprintf( stderr, "deblocking filter doesn't work yet with B slice\n" );
+ x264_log( h, X264_LOG_ERROR, "deblocking filter doesn't work yet with B slice\n" );
return;
}
}
}
else if( h->mb.i_type == B_8x8 || h->mb.i_type == B_DIRECT )
{
- fprintf( stderr, "mc_luma with unsupported mb\n" );
+ x264_log( h, X264_LOG_ERROR, "mc_luma with unsupported mb\n" );
return;
}
else /* B_*x* */
h->param.i_cabac_init_idc = x264_clip3( h->param.i_cabac_init_idc, -1, 2 );
+ /* VUI */
+ if( h->param.vui.i_sar_width > 0 && h->param.vui.i_sar_height > 0 )
+ {
+ int w = param->vui.i_sar_width;
+ int h = param->vui.i_sar_height;
+ int a = w, b = h;
+
+ while( b != 0 )
+ {
+ int t = a;
+
+ a = b;
+ b = t % b;
+ }
+
+ w /= a;
+ h /= a;
+ while( w > 65535 || h > 65535 )
+ {
+ w /= 2;
+ h /= 2;
+ }
+
+ h->param.vui.i_sar_width = 0;
+ h->param.vui.i_sar_height = 0;
+ if( w == 0 || h == 0 )
+ {
+ x264_log( h, X264_LOG_ERROR, "cannot create valid sample aspect ratio\n" );
+ }
+ else if( w == h )
+ {
+ x264_log( h, X264_LOG_INFO, "no need for a SAR\n" );
+ }
+ else
+ {
+ x264_log( h, X264_LOG_INFO, "using SAR=%d/%d\n", w, h );
+ h->param.vui.i_sar_width = w;
+ h->param.vui.i_sar_height = h;
+ }
+ }
+
+
/* Init x264_t */
h->out.i_nal = 0;
h->out.i_bitstream = 1000000; /* FIXME estimate max size (idth/height) */
}
sps->b_vui = 0;
+ sps->vui.b_aspect_ratio_info_present = 0;
if( param->vui.i_sar_width > 0 && param->vui.i_sar_height > 0 )
{
- int w = param->vui.i_sar_width;
- int h = param->vui.i_sar_height;
- int a = w, b = h;
-
- while( b != 0 )
- {
- int t = a;
-
- a = b;
- b = t % b;
- }
-
- w /= a;
- h /= a;
- while( w > 65535 || h > 65535 )
- {
- w /= 2;
- h /= 2;
- }
-
- if( w == 0 || h == 0 )
- {
- fprintf( stderr, "x264: cannot create valid sample aspect ratio\n" );
- sps->vui.b_aspect_ratio_info_present = 0;
- }
- else if( w == h )
- {
- fprintf( stderr, "x264: no need for a SAR\n" );
- sps->vui.b_aspect_ratio_info_present = 0;
- }
- else
- {
- fprintf( stderr, "x264: using SAR=%d/%d\n", w, h );
- sps->vui.b_aspect_ratio_info_present = 1;
- sps->vui.i_sar_width = w;
- sps->vui.i_sar_height= h;
- }
+ sps->vui.b_aspect_ratio_info_present = 1;
+ sps->vui.i_sar_width = param->vui.i_sar_width;
+ sps->vui.i_sar_height= param->vui.i_sar_height;
}
sps->b_vui |= sps->vui.b_aspect_ratio_info_present;