Luc Trudeau [Tue, 22 May 2018 18:16:15 +0000 (14:16 -0400)]
Bench Class For More Robust Speed Tests
To make speed testing more robust, the AbstractBench runs the
desired code multiple times and report the median run time with
mean absolute deviation around the median.
To use the AbstractBench, simply add it as a parent to your test
class, and implement the run() method (with the code you want to
benchmark).
Sample output for VP9QuantizeTest
[ BENCH ] Bypass calculations 4x4 165.8 ms ( ±1.0 ms )
[ BENCH ] Full calculations 4x4 165.8 ms ( ±0.9 ms )
[ BENCH ] Bypass calculations 8x8 129.7 ms ( ±0.9 ms )
[ BENCH ] Full calculations 8x8 130.3 ms ( ±1.4 ms )
[ BENCH ] Bypass calculations 16x16 110.3 ms ( ±1.4 ms )
[ BENCH ] Full calculations 16x16 110.1 ms ( ±0.9 ms )
Marco Paniconi [Sat, 26 May 2018 04:51:33 +0000 (21:51 -0700)]
vp9-realtime: Move frame dropper to after scene detection.
Move frame dropper to after scene detection and noise estimation.
Scene detection and noise estimation operate on source data and
update metrics along sequence, so they should be moved before
the frame dropper.
Also we don't want to drop on scene change, as the scene detection
and (possible) re-encode step will be missed.
Marco Paniconi [Tue, 29 May 2018 02:32:01 +0000 (19:32 -0700)]
vp9-svc: Fix to allowed value of max_consec_drop.
For the max_consec_drop parameter in svc frame drop:
since passing value 0 in the control would completely
disable the dropper, only allow for values >= 1 to be set.
Jerome Jiang [Wed, 23 May 2018 22:43:00 +0000 (15:43 -0700)]
VP8: Fix use-after-free in postproc.
The pointer in vp8 postproc refers to show_frame_mi which is only
updated on show frame. However, when there is a no-show frame which also
changes the size (thus new frame buffers allocated), show_frame_mi is
not updated with new frame buffer memory.
Change the pointer in postproc to mi which is always updated.
Marco Paniconi [Wed, 23 May 2018 21:51:00 +0000 (14:51 -0700)]
vp9: Rate control adjustments for screen content.
For screen content mode: changes to reduce occurence of
significant QP decrease (from one frame to next),
which can cause large frames (overshoot/delay).
-cap the buffer increase to optimal level for frame drop
mode where full superframe can drop
-reduce the max_adjustment_down due to buffer overflow
-reduce qp threshold to trigger re-encode on large frame
Marco Paniconi [Fri, 18 May 2018 22:09:55 +0000 (15:09 -0700)]
vp9-svc: Fix on disabling inter_layer prediction.
In vp9_svc_constrain_inter_layer_pred() we disable the
inter_layer prediction if anything but only the previous
spatial layer (from same supeframe) is used for inter_layer
prediction. This check and disabling was only allowed when
the control VP9E_SET_SVC_INTER_LAYER_PRED is set to
INTER_LAYER_PRED_ON_CONSTRAINED.
But the control VP9E_SET_SVC_INTER_LAYER_PRED is needed for setting:
INTER_LAYER_PRED_ON/INTER_LAYER_PRED_OFF/INTER_LAYER_PRED_OFF_NONKEY.
So there is a conflict with setting INTER_LAYER_PRED_ON_CONSTRAINED.
Fix for now is to always allow for this disabling check
(disable inter_layer reference if its not previous spatial layer) as
long as inter_layer prediction is used (i.e., not set to _OFF).
A separate fix if needed may be to invoke another control for setting
INTER_LAYER_PRED_ON_CONSTRAINED.
This was causing an issue with enabling spatial layers on the fly
(say spatial layer 2), where since INTER_LAYER_PRED_ON_CONSTRAINED was
not set (default), the inter_layer prediction was then using a reference
from 2 spatial layers below (spatial layer 0).
Marco Paniconi [Fri, 18 May 2018 21:50:46 +0000 (14:50 -0700)]
vp9-svc: Fix issue with reseting lst_fb_idx.
When encoding a given spatial layer and the same spatial layer
on previous superframe was dropped (or disabled due to 0 bitrate),
the lst_fb_idx for current layer is set to the buffer index that
was last updated on TL0 frame (for the same spatial layer).
This condition was to maintain proper temporal prediction pattern
under frame drops, and it should only apply to INTER frames.
But the condition was causing an assert to be triggered on spatial
layers whose base are key frames. Fix is to condition this reset of
lst_fb_idx on the "is_key_frame" flag. Also initialize the
fb_idx_upd_tl0 to -1 and only use it for a given spatial layer
if its been set.
These issues can happen when superframe drop happens just before
a key frame, or when stream starts with lower layers and dynamically
enabled higher spatial layers.
Added datarate unittest the inserts key frame after superframe drop,
and verified that this fix is needed for test to pass.
Also modified the existing DisableEnable spatial layer test to trigger
the issue of using fb_idx_upd_tl0 when it hasn't been set for a
spatial layer.
Paul Wilkins [Fri, 18 May 2018 16:36:30 +0000 (17:36 +0100)]
Experiment regarding playback problems on Bravia TVs.
This patch experimentally reduces the maximum GF interval for
static content such as slide shows.
It does not fully revert the previous slide show patches as this
still allows the codec to code static sections only using GFs
groups rather than ARF groups or a mix of ARF and GF groups.
However, the maximum group length is reduced.
Marco Paniconi [Tue, 15 May 2018 03:52:20 +0000 (20:52 -0700)]
vp9: Some speed feature settings for speed 9.
Disable 8x8 blocks for higher resolutions,
reduce mv_thresh for 1/2 subpel motion, and
disable golden reference at superblock level
based on source sad and motion content.
~6% loss in RTC metrics over current speed 9.
Speedup about ~10% for high motion clip on linux.
Marco Paniconi [Tue, 8 May 2018 18:05:03 +0000 (11:05 -0700)]
vp9-svc: Fix to SVC for frame dropping.
When the previous frame is dropped, for the current
spatial layer make sure the lst_fb_idx corresponds
to the buffer index last updated on the (last) encoded
TL0 frame(for same spatial layer).
This is needed to preserve the temporal prediction pattern
for fixed/non-flexible mode under frame dropping.
This patch improves coding of slide shows with fade or other
complex transitions.
Previously, fades and other complex transitions between static "slides"
were sometimes being incorrectly marked such that they were coded
as a single static slide rather than two slides with a transition.
As the initial key frame for the first slide is not necessarily a good
predictor of the second slide and ARFs were turned off, this led to a
poor visual and metrics outcome in some such cases.
This patch allows for long GF groups in static sections before and after
a complex transition (instead of just with simple slide transitions) with
one or more normal ARF groups during the transition. It also enforces a
single "normal" length GF group after the transition before any extended
group is allowed. The reason for this is that the ARF that spans the
transition my not have a very high quality and hence may not act as a
good GF for the long static section that follows.
Martin Storsjo [Fri, 4 May 2018 06:32:41 +0000 (09:32 +0300)]
configure: Disable pthread_h if linking failed
When doing both check_header and check_lib, the check_header call
will already enable pthread_h if the header was found. This was
overlooked when the pthread linking check was amended into a header
check and a separate linking check in 9b7d4cce635e.
This brings back the same result as the original check in 38dc27cc6.
Marco Paniconi [Thu, 3 May 2018 01:04:35 +0000 (18:04 -0700)]
vp9-svc: On key frame update all reference slots for SVC.
Key frame updates the slots corresponding to the 3 references
last/golden/altref, but for SVC where more references buffers
may be in use, especialy for dynamically swithing up/down in layers,
make sure we should update all 8 slots on key frame.