From db8fa86a6c217002511d54f9af05824d486333db Mon Sep 17 00:00:00 2001 From: paulwilkins Date: Tue, 8 Aug 2017 12:01:46 +0100 Subject: [PATCH] Patch relating to Issue 1456. Testing of 4k videos encoded with a fixed arbitrary chunking interval uncovered a bug where by if a chunk ends 1 frame before a real scene cut, the next chunk may be encoded with two consecutive key frames at the start with the first being assigned 0 bits. This fix insures that where there is a key frame group of length 1 it is at least assigned 1 frames worth of bits not 0. See also patch Change-Id: I692311a709ccdb6003e705103de9d05b59bf840a which by virtue of allowing fast adaptation of Q made this bug more visible. BUG=webm:1456 Change-Id: Ic9e016cb66d489b829412052273238975dc6f6ab --- vp9/encoder/vp9_firstpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index a970f6d97..3fcb30566 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2126,7 +2126,7 @@ static int calculate_boost_bits(int frame_count, int boost, int allocation_chunks; // return 0 for invalid inputs (could arise e.g. through rounding errors) - if (!boost || (total_group_bits <= 0) || (frame_count <= 0)) return 0; + if (!boost || (total_group_bits <= 0) || (frame_count < 0)) return 0; allocation_chunks = (frame_count * 100) + boost; -- 2.49.0