~ubuntu-branches/ubuntu/precise/x264/precise

« back to all changes in this revision

Viewing changes to encoder/set.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2011-08-09 21:57:53 UTC
  • mfrom: (1.2.6 upstream) (12.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110809215753-bbpvvmfal2jtn3gy
Tags: 2:0.116.2042+git178455c-1ubuntu1
* Merge from debian (seriously!), remaining changes
  - tighten dependencies on Libav 0.7
  - Build against libffms2-dev
  - build against libgpac-dev to enable .mp4 output

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
 
100
100
void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
101
101
{
 
102
    int csp = param->i_csp & X264_CSP_MASK;
 
103
 
102
104
    sps->i_id = i_id;
103
105
    sps->i_mb_width = ( param->i_width + 15 ) / 16;
104
106
    sps->i_mb_height= ( param->i_height + 15 ) / 16;
105
 
    sps->i_chroma_format_idc = param->i_csp >= X264_CSP_I444 ? 3 : 1;
 
107
    sps->i_chroma_format_idc = csp >= X264_CSP_I444 ? 3 : 1;
106
108
 
107
109
    sps->b_qpprime_y_zero_transform_bypass = param->rc.i_rc_method == X264_RC_CQP && param->rc.i_qp_constant == 0;
108
110
    if( sps->b_qpprime_y_zero_transform_bypass || sps->i_chroma_format_idc == 3 )
203
205
    sps->vui.b_signal_type_present = 0;
204
206
    sps->vui.i_vidformat = ( param->vui.i_vidformat >= 0 && param->vui.i_vidformat <= 5 ? param->vui.i_vidformat : 5 );
205
207
    sps->vui.b_fullrange = ( param->vui.b_fullrange >= 0 && param->vui.b_fullrange <= 1 ? param->vui.b_fullrange :
206
 
                           ( param->i_csp >= X264_CSP_BGR ? 1 : 0 ) );
 
208
                           ( csp >= X264_CSP_BGR ? 1 : 0 ) );
207
209
    sps->vui.b_color_description_present = 0;
208
210
 
209
211
    sps->vui.i_colorprim = ( param->vui.i_colorprim >= 0 && param->vui.i_colorprim <=  8 ? param->vui.i_colorprim : 2 );
210
212
    sps->vui.i_transfer  = ( param->vui.i_transfer  >= 0 && param->vui.i_transfer  <= 10 ? param->vui.i_transfer  : 2 );
211
213
    sps->vui.i_colmatrix = ( param->vui.i_colmatrix >= 0 && param->vui.i_colmatrix <=  8 ? param->vui.i_colmatrix :
212
 
                           ( param->i_csp >= X264_CSP_BGR ? 0 : 2 ) );
 
214
                           ( csp >= X264_CSP_BGR ? 0 : 2 ) );
213
215
    if( sps->vui.i_colorprim != 2 ||
214
216
        sps->vui.i_transfer  != 2 ||
215
217
        sps->vui.i_colmatrix != 2 )