Commit dab6f065 authored by Laurent Aimar's avatar Laurent Aimar

* all: more fprintf -> x264_log.


git-svn-id: svn://svn.videolan.org/x264/trunk@35 df754926-b1dd-0310-bc7b-ec298dee348c
parent f53a7ae0
......@@ -116,7 +116,7 @@ void x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_picture_t *src
break;
default:
fprintf( stderr, "Arg invalid CSP\n" );
x264_log( h, X264_LOG_ERROR, "Arg invalid CSP\n" );
break;
}
}
......@@ -639,7 +639,7 @@ void x264_frame_deblocking_filter( x264_t *h, int i_slice_type )
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;
}
}
......
......@@ -485,7 +485,7 @@ void x264_mb_mc( x264_t *h )
}
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* */
......
......@@ -341,6 +341,48 @@ x264_t *x264_encoder_open ( x264_param_t *param )
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) */
......
......@@ -107,46 +107,13 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
}
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment