James Zern [Sat, 2 Jun 2018 06:22:48 +0000 (23:22 -0700)]
test,cosmetics: fix func/member naming, decl order
functions: upper camelcase
members: lowercase with trailing '_'
decl order: functions (overrides marked virtual), members
after: 656e8ac61 VSX version of vpx_post_proc_down_and_across_mb_row 766d875b9 VSX version of vpx_mbpost_proc_ip 35e98a70b VSX version of vpx_mbpost_proc_down b2898a9ad Bench Class For More Robust Speed Tests
Jerome Jiang [Fri, 1 Jun 2018 21:27:34 +0000 (14:27 -0700)]
vp9-svc: Allow usage of second (long term) temporal reference.
Allow for second temporal reference for top spatial layer in SVC,
when inter-layer prediction is disabled on INTER frames.
The second temporal reference is labelled as the golden reference
and the update/refresh of this reference buffer is only on base
temporal layer superframes. For now the period of refresh is
fixed at every 20 TL0 superframes.
Average gain is ~4% on RTC set, several clips up
by ~8-12%. Speed loss is about ~2% on mac.
Jerome Jiang [Wed, 23 May 2018 18:52:37 +0000 (11:52 -0700)]
VP9: Allow for bilinear subpel interp at speed 9 for high motion.
Fixed some settings in nonrd pick mode to allow for frame-level bilinear
to be set.
On Galaxy S8+ it has 4% speed up on high motion clips. Almost the same
for low motion.
Marco Paniconi [Thu, 31 May 2018 16:59:15 +0000 (09:59 -0700)]
vp9-svc: Fix to some frame metrics for real-time mode.
Add condition of LAST frame to the consec_zeromv and
avg_frame_low_motion metrics. This is needed for SVC as
the golden reference is a spatial reference and should
not be included in the metric computation.
Hui Su [Mon, 14 May 2018 21:35:25 +0000 (14:35 -0700)]
Improve the ML based partition pruning
Add a neural net model that uses the same features as the existing
linear model. Make the pruning decision based on both the linear
and the neural net model. It provides more accurate predictions,
and may improve compression and/or encoding speed.
This only affects speed 0.
Coding gain:
0.37% on midres
0.34% on hdres
0.50% on jvet8b720p
Encoding speed impact(average over locally tested 20 clips from midres
and hdres):
QP=20: down by 2.5%.
QP=30: down by 3.9%.
QP=40: donw by 4.5%.
QP=50: up by 5.2%.
Marco Paniconi [Wed, 30 May 2018 23:01:53 +0000 (16:01 -0700)]
vp9-svc: Fix to compute some metrics on top spatiail layer.
The avg_frame_low_motion and consec_zeromv are frame-level
metrics that are updated on every frame. For SVC these should be
updated on top spatial layer (full resolution).
James Zern [Tue, 29 May 2018 23:38:46 +0000 (16:38 -0700)]
Revert 3 slide show coding changes
This is a combination of the following 3 reverts. The changes cause
issues on certain hardware devices. We'll pull them for now to allow for
further investigation.
Revert "Experiment regarding playback problems on Bravia TVs."
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.