[x264-devel] Fix frame packing SEI with --frame-packing 0

Yusuke Nakamura git at videolan.org
Wed Sep 21 21:34:40 CEST 2011


x264 | branch: master | Yusuke Nakamura <muken.the.vfrmaniac at gmail.com> | Wed Sep 21 01:15:38 2011 +0900| [926a03a9c1f48d0fbd54b0e802d740774c100a78] | committer: Jason Garrett-Glaser

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.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=926a03a9c1f48d0fbd54b0e802d740774c100a78
---

 encoder/set.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/encoder/set.c b/encoder/set.c
index 09be96e..a498c94 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



More information about the x264-devel mailing list