]> granicus.if.org Git - libx264/commitdiff
Make bs_align_10 imply bs_flush
authorAnton Mitrofanov <BugMaster@narod.ru>
Sun, 1 Apr 2018 17:34:18 +0000 (20:34 +0300)
committerHenrik Gramner <henrik@gramner.com>
Sun, 27 May 2018 18:58:54 +0000 (20:58 +0200)
Now behaves the same as bs_align_0 and bs_align_1.

common/bitstream.h
encoder/set.c

index a9ae447947fb8dc333c83a338eb9fa698d79eae9..40ecc7adc06be1288dade2a6cffdcd265f0a387a 100644 (file)
@@ -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 */
index 39e5f07d1dc597303b5ba972529bafbca64fe4df..6471180ef39fd9716e843835a133d22766a7a7fd 100644 (file)
@@ -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 );
 }