From 43792a1b1bbd00193bf26c21f37be03777b8eb6d Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Sun, 13 Jun 2010 23:14:15 +0400 Subject: [PATCH] Don't allow baseline profile streams with fake-interlaced Indicate use of --fake-interlaced in encoding options SEI. --- common/common.c | 7 +++++-- encoder/set.c | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/common.c b/common/common.c index 97daf529..4fa5e4bf 100644 --- a/common/common.c +++ b/common/common.c @@ -428,7 +428,10 @@ int x264_param_apply_profile( x264_param_t *param, const char *profile ) return -1; } if( param->b_fake_interlaced ) - x264_log( NULL, X264_LOG_WARNING, "baseline profile doesn't support fake interlacing\n" ); + { + x264_log( NULL, X264_LOG_ERROR, "baseline profile doesn't support fake interlacing\n" ); + return -1; + } } else if( !strcasecmp( profile, "main" ) ) { @@ -1176,7 +1179,7 @@ char *x264_param2string( x264_param_t *p, int b_res ) s += sprintf( s, " slice_max_mbs=%d", p->i_slice_max_mbs ); s += sprintf( s, " nr=%d", p->analyse.i_noise_reduction ); s += sprintf( s, " decimate=%d", p->analyse.b_dct_decimate ); - s += sprintf( s, " interlaced=%s", p->b_interlaced ? p->b_tff ? "tff" : "bff" : "0" ); + s += sprintf( s, " interlaced=%s", p->b_interlaced ? p->b_tff ? "tff" : "bff" : p->b_fake_interlaced ? "fake" : "0" ); s += sprintf( s, " constrained_intra=%d", p->b_constrained_intra ); diff --git a/encoder/set.c b/encoder/set.c index 28de4b5a..86b4a305 100644 --- a/encoder/set.c +++ b/encoder/set.c @@ -105,7 +105,7 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param ) sps->i_profile_idc = PROFILE_HIGH444_PREDICTIVE; else if( param->analyse.b_transform_8x8 || param->i_cqm_preset != X264_CQM_FLAT ) sps->i_profile_idc = PROFILE_HIGH; - else if( param->b_cabac || param->i_bframe > 0 || param->b_interlaced || param->analyse.i_weighted_pred > 0 ) + else if( param->b_cabac || param->i_bframe > 0 || param->b_interlaced || param->b_fake_interlaced || param->analyse.i_weighted_pred > 0 ) sps->i_profile_idc = PROFILE_MAIN; else sps->i_profile_idc = PROFILE_BASELINE; @@ -149,7 +149,7 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param ) sps->b_gaps_in_frame_num_value_allowed = 0; sps->i_mb_width = ( param->i_width + 15 ) / 16; sps->i_mb_height= ( param->i_height + 15 ) / 16; - sps->b_frame_mbs_only = param->b_interlaced ? 0 : !param->b_fake_interlaced; + sps->b_frame_mbs_only = !(param->b_interlaced || param->b_fake_interlaced); if( !sps->b_frame_mbs_only ) sps->i_mb_height = ( sps->i_mb_height + 1 ) & ~1; sps->b_mb_adaptive_frame_field = param->b_interlaced; -- 2.40.0