From: Jason Garrett-Glaser Date: Thu, 16 Sep 2010 10:36:17 +0000 (-0700) Subject: Make intra refresh finish one frame faster X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=0974adfbb024af0afe511a803af73cdc283686d7;p=x264.git Make intra refresh finish one frame faster In some cases, the last frame of intra refresh was redundant. Saves a few bits. --- diff --git a/encoder/encoder.c b/encoder/encoder.c index e9aa05cd..0439a3a2 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -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; } }