[x264-devel] More correctly write frame-packing SEI flags

Jason Garrett-Glaser git at videolan.org
Wed Jan 26 02:56:56 CET 2011


x264 | branch: master | Jason Garrett-Glaser <jason at x264.com> | Tue Jan 18 12:31:26 2011 -0800| [62b661a4a1f569f79f07dc81634a9371a8887c28] | committer: Jason Garrett-Glaser

More correctly write frame-packing SEI flags

Bug reported by Nero.

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

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

diff --git a/encoder/set.c b/encoder/set.c
index eb1aa71..6082401 100644
--- a/encoder/set.c
+++ b/encoder/set.c
@@ -654,12 +654,10 @@ void x264_sei_frame_packing_write( x264_t *h, bs_t *s )
     // 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
 
-    /* The following flags shall be set to 0 and ignored by the decoder
-     * (Why, then, do they even exist?  Who knows.) */
     bs_write1( &q, 0 );                           // spatial_flipping_flag
     bs_write1( &q, 0 );                           // frame0_flipped_flag
     bs_write1( &q, 0 );                           // field_views_flag
-    bs_write1( &q, 0 );                           // current_frame_is_frame0_flag
+    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 )
@@ -670,7 +668,7 @@ void x264_sei_frame_packing_write( x264_t *h, bs_t *s )
         bs_write( &q, 4, 0 );                     // frame1_grid_position_y
     }
     bs_write( &q, 8, 0 );                         // frame_packing_arrangement_reserved_byte
-    bs_write_ue( &q, 0 );                         // frame_packing_arrangement_repetition_period
+    bs_write_ue( &q, 1 );                         // frame_packing_arrangement_repetition_period
     bs_write1( &q, 0 );                           // frame_packing_arrangement_extension_flag
 
     bs_align_10( &q );



More information about the x264-devel mailing list