[x264-devel] Make bs_align_10 imply bs_flush

Anton Mitrofanov git at videolan.org
Tue Aug 7 00:05:17 CEST 2018


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Sun Apr  1 20:34:18 2018 +0300| [7e457290cdd6da592ae63aa25facc47cd09d2128] | committer: Henrik Gramner

Make bs_align_10 imply bs_flush

Now behaves the same as bs_align_0 and bs_align_1.

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

 common/bitstream.h | 1 +
 encoder/set.c      | 6 ------
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/common/bitstream.h b/common/bitstream.h
index a9ae4479..40ecc7ad 100644
--- a/common/bitstream.h
+++ b/common/bitstream.h
@@ -188,6 +188,7 @@ static inline void bs_align_10( bs_t *s )
 {
     if( s->i_left&7 )
         bs_write( s, s->i_left&7, 1 << ( (s->i_left&7) - 1 ) );
+    bs_flush( s );
 }
 
 /* golomb functions */
diff --git a/encoder/set.c b/encoder/set.c
index 39e5f07d..6471180e 100644
--- a/encoder/set.c
+++ b/encoder/set.c
@@ -555,7 +555,6 @@ void x264_sei_recovery_point_write( x264_t *h, bs_t *s, int recovery_frame_cnt )
     bs_write( &q, 2, 0 ); //changing_slice_group 0
 
     bs_align_10( &q );
-    bs_flush( &q );
 
     x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_RECOVERY_POINT );
 }
@@ -610,7 +609,6 @@ void x264_sei_buffering_period_write( x264_t *h, bs_t *s )
     }
 
     bs_align_10( &q );
-    bs_flush( &q );
 
     x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_BUFFERING_PERIOD );
 }
@@ -642,7 +640,6 @@ void x264_sei_pic_timing_write( x264_t *h, bs_t *s )
     }
 
     bs_align_10( &q );
-    bs_flush( &q );
 
     x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_PIC_TIMING );
 }
@@ -685,7 +682,6 @@ void x264_sei_frame_packing_write( x264_t *h, bs_t *s )
     bs_write1( &q, 0 );                           // frame_packing_arrangement_extension_flag
 
     bs_align_10( &q );
-    bs_flush( &q );
 
     x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_FRAME_PACKING );
 }
@@ -702,7 +698,6 @@ void x264_sei_alternative_transfer_write( x264_t *h, bs_t *s )
     bs_write ( &q, 8, h->param.i_alternative_transfer ); // preferred_transfer_characteristics
 
     bs_align_10( &q );
-    bs_flush( &q );
 
     x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_ALTERNATIVE_TRANSFER );
 }
@@ -746,7 +741,6 @@ void x264_sei_dec_ref_pic_marking_write( x264_t *h, bs_t *s )
     }
 
     bs_align_10( &q );
-    bs_flush( &q );
 
     x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_DEC_REF_PIC_MARKING );
 }



More information about the x264-devel mailing list