if( h->param.analyse.i_subpel_refine >= 10 && (h->param.analyse.i_trellis != 2 || !h->param.rc.i_aq_mode) )
h->param.analyse.i_subpel_refine = 9;
+ if( b_open )
{
const x264_level_t *l = x264_levels;
if( h->param.i_level_idc < 0 )
mbcmp_init( h );
if( !ret )
- x264_sps_init( h->sps, h->param.i_sps_id, &h->param );
+ x264_sps_init_reconfigurable( h->sps, &h->param );
/* Supported reconfiguration options (1-pass only):
* vbv-maxrate
sps->b_mb_adaptive_frame_field = param->b_interlaced;
sps->b_direct8x8_inference = 1;
- sps->crop.i_left = param->crop_rect.i_left;
- sps->crop.i_top = param->crop_rect.i_top;
- sps->crop.i_right = param->crop_rect.i_right + sps->i_mb_width*16 - param->i_width;
- sps->crop.i_bottom = (param->crop_rect.i_bottom + sps->i_mb_height*16 - param->i_height) >> !sps->b_frame_mbs_only;
- sps->b_crop = sps->crop.i_left || sps->crop.i_top ||
- sps->crop.i_right || sps->crop.i_bottom;
-
- sps->vui.b_aspect_ratio_info_present = 0;
- if( param->vui.i_sar_width > 0 && param->vui.i_sar_height > 0 )
- {
- 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;
- }
+ x264_sps_init_reconfigurable( sps, param );
sps->vui.b_overscan_info_present = param->vui.i_overscan > 0 && param->vui.i_overscan <= 2;
if( sps->vui.b_overscan_info_present )
}
}
+void x264_sps_init_reconfigurable( x264_sps_t *sps, x264_param_t *param )
+{
+ sps->crop.i_left = param->crop_rect.i_left;
+ sps->crop.i_top = param->crop_rect.i_top;
+ sps->crop.i_right = param->crop_rect.i_right + sps->i_mb_width*16 - param->i_width;
+ sps->crop.i_bottom = (param->crop_rect.i_bottom + sps->i_mb_height*16 - param->i_height) >> !sps->b_frame_mbs_only;
+ sps->b_crop = sps->crop.i_left || sps->crop.i_top ||
+ sps->crop.i_right || sps->crop.i_bottom;
+
+ sps->vui.b_aspect_ratio_info_present = 0;
+ if( param->vui.i_sar_width > 0 && param->vui.i_sar_height > 0 )
+ {
+ 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;
+ }
+}
+
void x264_sps_write( bs_t *s, x264_sps_t *sps )
{
bs_realign( s );
#define X264_ENCODER_SET_H
void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param );
+void x264_sps_init_reconfigurable( x264_sps_t *sps, x264_param_t *param );
void x264_sps_write( bs_t *s, x264_sps_t *sps );
void x264_pps_init( x264_pps_t *pps, int i_id, x264_param_t *param, x264_sps_t *sps );
void x264_pps_write( bs_t *s, x264_sps_t *sps, x264_pps_t *pps );