Marco Paniconi [Tue, 10 Jul 2018 17:02:21 +0000 (10:02 -0700)]
vp9: Initialize source variance in nonrd-pickmode.
It is already initialized at superblock level, but since
it is computed per coding block, based on some speed features,
better to initialize it in pick_inter.
No change in behavior, as currently the speed features
that enable use of source_variance in pick_inter are fixed
at the frame-level.
Marco Paniconi [Wed, 11 Apr 2018 17:59:34 +0000 (10:59 -0700)]
vp9-svc: Intra-only frame for spatial layers.
Use case is for layered (SVC) coding to allow higher
resolution layers to continue decoding with temporal references,
while base spatial layer is intra-only frame.
Made encoder changes to real-time path for encoding intra-only
frame. The intra-only frame will be followed by the overlay/copy
frame (with both packed in the same superframe).
Use existing control to enable intra_only frame.
Intra only is only applied to base spatial layer, and only
allowed under fixed/non-flexible SVC mode, and only for
1 < number_spatial_layers < 4.
Added svc datarate unittest for inserting intra_only frame
as sync frame. Added svc end to end tests to check mismatch.
Change-Id: I2f4f0106b2c4f51ce77aa2c1c6823ba83ff2f7a0 Signed-off-by: Marco Paniconi <marpan@google.com>
Sergey Silkin [Thu, 28 Jun 2018 09:00:00 +0000 (11:00 +0200)]
vp9-svc: add more command line options to test app.
This adds the following command line options to
vp9_spatial_svc_encoder test app:
--drop-frame=<arg> Temporal resampling threshold (buf %)
--tune-content=<arg> Tune content type default, screen, film
--inter-layer-pred=<arg> 0 - 3: On, Off, Key-frames, Constrained
Marco Paniconi [Fri, 29 Jun 2018 22:34:54 +0000 (15:34 -0700)]
vp9: Reset params for cyclic refresh on slide change
Reset the last_coded_q_map and the sb->index in the cyclic_refresh
on a re-encode for slide change, so the refresh can start again
right after slide change.
Jingning Han [Wed, 20 Jun 2018 20:15:10 +0000 (13:15 -0700)]
Exploit the spatial variance in temporal dependency model
Adapt the Lagrangian multipler based on the spatial variance in
the temporal dependency model. The functionality is disabled by
default. To turn on, set enable_tpl_model to 1.
Marco Paniconi [Thu, 28 Jun 2018 23:08:55 +0000 (16:08 -0700)]
vp9-svc: Adjust threshold for early exit on golden
Use the avg_frame_low_motion to reduce/turnoff this
early exit for higher motion content. Get some quality
back for higher motion clips and keep the same exit
thresh for low motion clips.
Paul Wilkins [Tue, 26 Jun 2018 14:57:51 +0000 (15:57 +0100)]
Enhanced partition experiment.
This patch relates to motion artifacts as described in Issue 73484098
The aim of this patch is to promote the use of smaller partition
sizes in places where some of the sub blocks have very low
spatial complexity and some have much higher complexity.
The patch can have a small impact on encode speed, but much
less than alternative approaches such as lowering the rd thresholds
that limit the partition search when distortion is low.
The patch also applies a similar sub block strategy for AQ1.
Metrics results for our standard sets over typical YT rates.
(Overall PSNR, SSIM, PSNR HVS) % -ve better.
Low Res -0.274, -0.303, -0.330
Mid Res 0.001, - 0.128, -0.100
Hd Res -0.236, -0.371, -0.349
N 2K -0.663, -0.798, -0.708
N 4K -0.488, -0.588, -0.517
Marco Paniconi [Wed, 27 Jun 2018 20:04:18 +0000 (13:04 -0700)]
vp9-svc: Set avg_frame_low_motion for lower layers.
The avg_frame_low_motion metric is only computed on the
top spatial layer, and since its part of the layer context
struct, it needs to written to all lower spatial layers for
consistency.
Small/minor change in metrics.
Change-Id: I92a001c37aeb332e613212288b13a2ed9745af88
Marco Paniconi [Wed, 27 Jun 2018 19:26:09 +0000 (12:26 -0700)]
vp9-svc: Fix to early golden exit nonrd-pickmode
For SVC: apply the sse_zeromv early exit also to
the case where golden is second temporal reference.
Set the thresh_svc_golden threshold for this case.
This is reduce the encode time for case where golden
is second temporal reference for SVC.
Change-Id: I8c0c87dd746579d3c4f5e983c7f9dd0a1e1476e0
Marco Paniconi [Mon, 25 Jun 2018 04:44:29 +0000 (21:44 -0700)]
vp9: Add lower Q limt to cyclic refresh usage.
Disable the cyclic refresh for very low average Q.
This reduces encoded bitrate for static slides after the
the quality has ramped up well enough (low Q). And as the
cyclic refresh is not needed at low Q in most cases, this
has minimal/no effect on quality on RTC set.
Marco Paniconi [Mon, 25 Jun 2018 05:00:58 +0000 (22:00 -0700)]
vp9: Fixes for lossless mode for real-time mode.
Fixes to nonrd coding mode for lossless mode: keep
skip_txfm to 0 (no skip) and disable the encoder breakout.
This makes the encoding lossless when that mode is selected
for real-time (nonrd pickmode).
Also the disable the cyclic refresh for lossless mode.
Zoe Liu [Fri, 22 Jun 2018 02:26:32 +0000 (19:26 -0700)]
Add reference frame update flags for hierarchical
Previous CLs have implemented the construction of the hierarchical
structure at the encoder side. This CL is to define and configure the
according flags that will guide the reference frame update according to
the constructed hierarchical structure.
Zoe Liu [Thu, 21 Jun 2018 23:28:15 +0000 (16:28 -0700)]
Add extra altref option for hierarchical structure
This CL is to hook up the implemented hierarchical structure
construction as well as its corresponding bitrate allocation
functionality with the defining of a GF group.
Currently the hierarchical structure is off by default. Hence this CL
has no impact on coding performance.
Fix mingw builds for x86_32 by updating past:
https://chromium.googlesource.com/libyuv/libyuv/+/8fa02df3c0591754958a50
Pick up upstream fixes for clang 5 builds with --disable-optimizations.
Disable libyuv by default when building for msa. We have not been able
to update libyuv because of build issues with mips. This can be
revisited when we update the mips compiler used in Jenkins.
Zoe Liu [Wed, 20 Jun 2018 01:11:08 +0000 (18:11 -0700)]
Add bit allocation for hierarchical layer
This CL migrates the bit allocation scheme from libaom and combines the
scheme for hierarchical layer with the updated scheme in libvpx that
uses a modified scheme to calculate the target bitrate per frame.
Johann [Wed, 20 Jun 2018 20:10:54 +0000 (13:10 -0700)]
libyuv: remove problematic functions
These fail to build with clang on 32 bit with
--disable-optimizations
Upstream libyuv has addressed these and we will get updated
versions on the next roll. At the moment, we don't use
libyuv for copying alpha data and so this is a quick fix.
Marco Paniconi [Tue, 12 Jun 2018 18:50:29 +0000 (11:50 -0700)]
vp9-svc: Add support for spatial layer sync frames.
Add encoder control to allow application to insert
spatial layer sync frame. The sync frame disables
temporal prediction for that spatial layer.
This is useful for RTC application to have receiver
start decoding a higher spatial layer, without inserting
a key frame on base spatial layer.
If the layer sync is requested on the base spatial layer
this then force a key frame, otherwise it only disables
the temporal reference for that spatial layer, allowing
temporal prediction to continue for the other layers.
Although the temporal prediction is disabled and reset
on a layer sync frame, the inter-layer prediction for the
sync frame is enabled on INTER frames. So the meaning of
INTER_LAYER_PRED_OFF_NONKEY is modified to mean disable
inter-layer prediction on non-key and non-sync frames.
Added unittest for inserting layer sync frames.
Bump up ABI version.
Change-Id: Id458acc400a77c853551f125c4e7b6d001991f03
Jingning Han [Wed, 30 May 2018 20:31:08 +0000 (13:31 -0700)]
Refactor partition mode cost calculation
Compute the coding block partition mode cost as additional rdcost
to the cumulative rate-distortion cost from each coding block. This
changes the coding performance slightly due to the rounding error.
The compression performance change is neutral.
Hui Su [Tue, 12 Jun 2018 18:56:09 +0000 (11:56 -0700)]
Improve the partition search breakout speed feature
Use a linear model to make partition search breakout decisions.
Currently the model is tuned for large quantizers and small resolutions.
So it is only used when q-index is larger than 200 and frame
width/height is smaller than 720. Also it's not yet supported for high
bit depth.
Tested speed 1 and 2 on lowres and midres. Compression performance is
neutral. At low bitrates, encoding speedup is up to 50% for speed 1;
up to 30% for speed 2.
Some sample numbers: