From f1c48203a9985d05ed97c32c9ff9c9d76cd8d9c8 Mon Sep 17 00:00:00 2001 From: Fiona Glaser Date: Thu, 16 Sep 2010 03:36:17 -0700 Subject: [PATCH] Make intra refresh finish one frame faster In some cases, the last frame of intra refresh was redundant. Saves a few bits. --- encoder/encoder.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/encoder/encoder.c b/encoder/encoder.c index 2691595a..d642a1c7 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; } } -- 2.40.0