]> git.videolan.org Git - x264.git/commitdiff
Make intra refresh finish one frame faster
authorJason Garrett-Glaser <darkshikari@gmail.com>
Thu, 16 Sep 2010 10:36:17 +0000 (03:36 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.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 e9aa05cd734cf8b855d810aafce1028c5f1e9f93..0439a3a2bca780104893b40797d2221df06c3cb4 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;
         }
     }