]> granicus.if.org Git - libx264/commitdiff
Make intra refresh finish one frame faster
authorFiona Glaser <fiona@x264.com>
Thu, 16 Sep 2010 10:36:17 +0000 (03:36 -0700)
committerFiona Glaser <fiona@x264.com>
Thu, 16 Sep 2010 10:37:59 +0000 (03:37 -0700)
In some cases, the last frame of intra refresh was redundant.
Saves a few bits.

encoder/encoder.c

index 2691595aaa6c8e20a83a2e9044a385a608a91ca8..d642a1c7839a000409722e1685a149b3a18dd390 100644 (file)
@@ -2576,6 +2576,9 @@ int     x264_encoder_encode( x264_t *h,
             h->fdec->i_pir_start_col = h->fdec->f_pir_position+0.5;
             h->fdec->f_pir_position += increment * pocdiff;
             h->fdec->i_pir_end_col = h->fdec->f_pir_position+0.5;
+            /* If our intra refresh has reached the right side of the frame, we're done. */
+            if( h->fdec->i_pir_end_col >= h->mb.i_mb_width - 1 )
+                h->fdec->f_pir_position = h->mb.i_mb_width;
         }
     }