]> granicus.if.org Git - libx264/commitdiff
Various cosmetics
authorFiona Glaser <fiona@x264.com>
Mon, 27 Sep 2010 12:39:02 +0000 (05:39 -0700)
committerFiona Glaser <fiona@x264.com>
Tue, 28 Sep 2010 13:36:46 +0000 (06:36 -0700)
encoder/encoder.c
encoder/set.c

index 7cac3af9b941e5d3057900dedc6f7e0e43e6c592..f83ed619f3a8486fbdcbd7c5961c8b0d580fa10a 100644 (file)
@@ -2943,12 +2943,12 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
 
     /* Remove duplicates, must be done near the end as breaks h->fref0 array
      * by freeing some of its pointers. */
-     for( int i = 0; i < h->i_ref0; i++ )
-         if( h->fref0[i] && h->fref0[i]->b_duplicate )
-         {
-             x264_frame_push_blank_unused( h, h->fref0[i] );
-             h->fref0[i] = 0;
-         }
+    for( int i = 0; i < h->i_ref0; i++ )
+        if( h->fref0[i] && h->fref0[i]->b_duplicate )
+        {
+            x264_frame_push_blank_unused( h, h->fref0[i] );
+            h->fref0[i] = 0;
+        }
 
     if( h->param.psz_dump_yuv )
         x264_frame_dump( h );
index b0d2149b84919bc845237372636579f761b913a9..a0030128347d9686650760f8003428baa1ece9bf 100644 (file)
@@ -294,34 +294,21 @@ void x264_sps_write( bs_t *s, x264_sps_t *sps )
     }
     else if( sps->i_poc_type == 1 )
     {
-        int i;
-
         bs_write( s, 1, sps->b_delta_pic_order_always_zero );
         bs_write_se( s, sps->i_offset_for_non_ref_pic );
         bs_write_se( s, sps->i_offset_for_top_to_bottom_field );
         bs_write_ue( s, sps->i_num_ref_frames_in_poc_cycle );
 
-        for( i = 0; i < sps->i_num_ref_frames_in_poc_cycle; i++ )
-        {
+        for( int i = 0; i < sps->i_num_ref_frames_in_poc_cycle; i++ )
             bs_write_se( s, sps->i_offset_for_ref_frame[i] );
-        }
     }
     bs_write_ue( s, sps->i_num_ref_frames );
     bs_write( s, 1, sps->b_gaps_in_frame_num_value_allowed );
     bs_write_ue( s, sps->i_mb_width - 1 );
-    if (sps->b_frame_mbs_only)
-    {
-        bs_write_ue( s, sps->i_mb_height - 1);
-    }
-    else // interlaced
-    {
-        bs_write_ue( s, sps->i_mb_height/2 - 1);
-    }
+    bs_write_ue( s, (sps->i_mb_height >> !sps->b_frame_mbs_only) - 1);
     bs_write( s, 1, sps->b_frame_mbs_only );
     if( !sps->b_frame_mbs_only )
-    {
         bs_write( s, 1, sps->b_mb_adaptive_frame_field );
-    }
     bs_write( s, 1, sps->b_direct8x8_inference );
 
     bs_write( s, 1, sps->b_crop );