From: Yusuke Nakamura Date: Tue, 20 Sep 2011 16:15:38 +0000 (+0900) Subject: Fix frame packing SEI with --frame-packing 0 X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=926a03a9c1f48d0fbd54b0e802d740774c100a78;p=x264.git Fix frame packing SEI with --frame-packing 0 According to the spec, when frame_packing_arrangement_type is equal to 0, quincunx_sampling_flag shall be equal to 1. --- diff --git a/encoder/set.c b/encoder/set.c index 09be96e5..a498c945 100644 --- a/encoder/set.c +++ b/encoder/set.c @@ -643,6 +643,7 @@ void x264_sei_pic_timing_write( x264_t *h, bs_t *s ) void x264_sei_frame_packing_write( x264_t *h, bs_t *s ) { + int quincunx_sampling_flag = h->param.i_frame_packing == 0; bs_t q; uint8_t tmp_buf[100]; bs_init( &q, tmp_buf, 100 ); @@ -652,7 +653,7 @@ void x264_sei_frame_packing_write( x264_t *h, bs_t *s ) bs_write_ue( &q, 0 ); // frame_packing_arrangement_id bs_write1( &q, 0 ); // frame_packing_arrangement_cancel_flag bs_write ( &q, 7, h->param.i_frame_packing ); // frame_packing_arrangement_type - bs_write1( &q, 0 ); // quincunx_sampling_flag + bs_write1( &q, quincunx_sampling_flag ); // quincunx_sampling_flag // 0: views are unrelated, 1: left view is on the left, 2: left view is on the right bs_write ( &q, 6, 1 ); // content_interpretation_type @@ -663,7 +664,7 @@ void x264_sei_frame_packing_write( x264_t *h, bs_t *s ) bs_write1( &q, h->param.i_frame_packing == 5 && !(h->fenc->i_frame&1) ); // current_frame_is_frame0_flag bs_write1( &q, 0 ); // frame0_self_contained_flag bs_write1( &q, 0 ); // frame1_self_contained_flag - if ( /* quincunx_sampling_flag == 0 && */ h->param.i_frame_packing != 5 ) + if ( quincunx_sampling_flag == 0 && h->param.i_frame_packing != 5 ) { bs_write( &q, 4, 0 ); // frame0_grid_position_x bs_write( &q, 4, 0 ); // frame0_grid_position_y