When the modified_error_left accumulator exceeds INT_MAX, an incorrect
cast to int resulted in a negative value, causing the rate control to
allocate no bits to that keyframe group, leading to severe undershoot
and subsequent poor quality.
This error was exposed by the recent change to the rolling target and
actual spend accumulators in commit 305be4e4 which fixed them to
actually calculate the average value rather than be re-initialized
on every frame to the average per-frame bitrate. When this bug was
triggered, the target bitrate could be 0, so the rolling target
becomes small, which causes the undershoot. The code prior to 305be4e4
did not exhibit this behavior because the rolling target was always
set to a reasonable value and was independent of the actual target
bitrate. With this patch, the actual target bitrate is calculated
correctly, and the rate control tracks as expected.
This cast was likely added to silence a compiler warning on a comparison
between a double (modified_error_left) and an int (0). Instead, this
patch removes the cast and changes the comparison to be against 0.0,
which should prevent the warning from reoccuring.
This fixes issue #289. Special thanks to gnafu for his efforts in
reporting and debugging this fix.
Change-Id: Ie5cc1a7b516c578a76c3a50c892a6f04a11621fe
This allows the base documentation to be built without the need for php
which is required to produce the example documentation
Change-Id: Id1861723c672fa8da132a074a4657e2cb94c1e79
This fixes an overflow problem in the frame error accumulators.
The overflow condition is extreme but did trigger when Frank B.
coded some high motion interlaced HD content.
The observed effect was a catastrophic breakdown of the rate
control leading to massive undershoot and poor bit allocation.
All the error values should really be unsigned but I will look at this
separately.
Change-Id: I9745f5c5ca2783620426b66b568b2088b579151f
- correct spelling
- remove explicit file name w/\file (unnecessary when contained in the
same file and prone to desync)
Change-Id: I68a3960ac5ab84d0f2e5c9b2e29799f26dfccf23
Currently, when the video frame width is not multiples of 16, the
source buffer has a stride of non-multiples of 16, which forces
an unaligned load in SAD function and hurts the performance. To
avoid that, this change allocates source buffers to be multiples
of 16.
Change-Id: Ib7506e3eb2cea06657d56be5a899f38dfe3eeb39
In real-time mode, vp8_sad16x16 function is called heavily in
motion search part. Improvement of this function gives 1.2%
encoding performance gain (real-time mode, tulip clip).
Change-Id: I23c401fc40c061f732a9767e8d383737a179bd58
checks added to make sure that cpi->tplist
is freed correctly in vp8_dealloc_compressor_data
and vp8_alloc_compressor_data.
Change-Id: I66149dbbd25c958800ad94f4379d723191d9680d
Eliminated unnecessary calculations. Improved performance
by 10% on keyframes and 1.6% overall for the test clip used.
Change-Id: I87671b26af5e2cc439e81d0fee3b15c7cd2a3309