paulwilkins [Mon, 4 Dec 2017 13:41:44 +0000 (13:41 +0000)]
Bug fix for second reference stats.
Immediately following a key frame the trailing second reference
error in the first pass stats will be based on a reference frame from
the prior key frame group and will thus usually be much larger.
This fix eliminates that effect (which typically triggers a short arf
group immediately after a key frame). It also changes the accounting
for the first frame in each new arf group.
This change gives large gains on a couple of clips that contain mid
sequence key frames (e.g. 6% on 1080P tennis). Overall there was
a net gain in PSNR and PSNR-HVS ~(0.05- 0.4%) and mixed results for
SSIM (+/- 0.2%).
Marco [Thu, 30 Nov 2017 20:08:00 +0000 (12:08 -0800)]
Nonrd-pickmode: avoid duplicate computation of UV predictor.
Avoids duplicate computation of UV predictor.
Bit-exact when static_threshold is zero.
Small/neutral difference on RTC set with nonzero static_threshold
(since UV predictor won't be skipped with this change).
James Zern [Thu, 30 Nov 2017 18:52:25 +0000 (10:52 -0800)]
decouple spatial-svc from encoder abi
this is only meant for testing. along with --enable-experimental
--enable-spatial-svc require VPX_TEST_SPATIAL_SVC to be defined rather
than bumping the encoder ABI.
Marco [Tue, 21 Nov 2017 23:04:53 +0000 (15:04 -0800)]
vp9-svc: Fix to the layer buffer settings.
For the case when the number of temporal layers > 1,
the buffer levels (starting/optimal_buffer_level,
and maximum_buffer_size) were not scaled properly.
In vp9_update_layer_context_change_config():
when setting the layer-buffer levels, fix is to scale
the layer-target_bandwidth by the target_bandwidth
(which is the full stream bandwidth) instead of the
spatial_layer_target.
This is needed because prior to the call
vp9_update_layer_context_change_config(), set_rc_buffer_sizes()
is called which sets the buffer levels based on target bandwidth
(which is the full bandwidth for the SVC stream).
This fix properly sets the layer-buffer levels based on the
layer-bandwidth, and leads to better rate targeting.
Small/neutral change in avgPSNR/SSIM metrics on RTC set.
Vlad Tsyrklevich [Mon, 20 Nov 2017 21:40:54 +0000 (13:40 -0800)]
[CFI] Remove function pointer casts
Control Flow Integrity [1] indirect call checking verifies that function
pointers only call valid functions with a matching type signature. This
change eliminates function pointer casts to make libvpx CFI-safe.
paulwilkins [Thu, 16 Nov 2017 16:15:06 +0000 (16:15 +0000)]
Disable allow_partition_search_skip for speed 2.
When allow_partition_search_skip is set the two pass code
can optionally skip the partition search in the rd loop if the image
appears static (based on selection of 0,0 motion).
Unfortunately 0,0 motion does not necessarily mean that there are
no meaningful changes or that motion or intra modes will not be selected
in the second pass.
Disabling "allow_partition_search_skip" may hurt the encode speed a little
for a small number of clips but can have a big impact on compression.
The most notable example of this in our test sets is "bridge_close_cif"
where this change gives a gains of 18%, 12% and 16% in opsnr, ssim and
psnr-hvs.
paulwilkins [Wed, 15 Nov 2017 16:58:05 +0000 (16:58 +0000)]
Remove decay_accumulator clause from alt ref breakout.
The decay accumulator clause covers similar ground to the
new clause that tests the accumulated second reference error
so it has been removed to reduce complexity.
paulwilkins [Wed, 15 Nov 2017 16:39:54 +0000 (16:39 +0000)]
Add clause to alt ref group breakout.
Add a clause to the breakout test for alt ref groups that
examines the size of the accumulated second reference
frame error compared to the cost of intra coding.
This clause causes a reduction in the average group length for many
clips. Alongside the change to the group length the minimum
boost is increased.
On balance the results are positive for psnr and psnr-hvs
but is negative for ssim/fast ssim for the smaller image formats.
Strong gains on some harder clips (eg ducks take off (midres) ~20%,
husky (lowres) 6-17%. Most of the negative cases are lower motion
clips. Subsequent patch hopefully will help with those.
For new VP9 only content type adjust the rate distortion and ARF
filter based on the relative spatial variance of the source and
reconstruction.
In regards to the RD loop the method favors modes where the
reconstruction variance is similar to the source variance. However it
is currently only applied to regions where the source variance is quite
low.
For very low variance blocks it applies a further bias against intra
coding and large prediction block sizes (the later in particular limit
the usefulness of the loop filter).
The final part of this change is to lower the strength of the ARF
filter for blocks where the source has very low spatial variance, to
encourage some low amplitude texture or noise to pass through
the filter.
This change improves the retention of film grain and fine noise /
texture in spatially flat regions, but as expected causes a significant
drop in PSNR on many clips. This is to be expected because similar
but misaligned noise or texture will give a lower PSNR than a flat
noise free reconstruction. However, it is worth noting that most clips
show a strong gain in FAST SSIM.
The features are enabled on the vpxenc command line by setting
--tune-content=film.
VPX_ENCODER_ABI_VERSION bumped for this change and cvbr.
Jerome Jiang [Wed, 8 Nov 2017 23:12:44 +0000 (15:12 -0800)]
vp9: SVC feature to use partition from lower resolution.
For SVC with 3 spatial layers:
Add feature to copy/upscale partition from middle spatial layer
to the upper/highest resolution, when superblock sad is not high.
Enabled for speed >= 7 and only for non-reference frames.
paulwilkins [Wed, 1 Nov 2017 14:21:39 +0000 (14:21 +0000)]
Fix to frames considered in arf boost calculation.
For a chosen interval "i" the existing arf boost calculation examined frames
+/- (i-1) frames from the current location in the second pass.
This change checks to make sure that the forward search does not extend
beyond the next key frame in the event that the distance to the next key
frame is < (i - 1).
Small metrics gains on all our test sets but these are localized to a few clips
(e.g. midres set psnr-hvs sintel -2.59% but overall average was only -0.185%)
Jerome Jiang [Wed, 8 Nov 2017 01:20:34 +0000 (17:20 -0800)]
vp9: Add nonref frame buffer test.
The new test will run a SVC bitstream which has non ref frames.
It checks the number of buffer acquired and released to make sure all
external frame buffers are released.
Add a new test bitstream:
vp90-2-22-svc_1280x720_1.webm
which has 400 frames in total, and 1 spatial layer and 2 temporal layers.
There is one non ref frame every other frame.
paulwilkins [Tue, 10 Oct 2017 18:49:59 +0000 (19:49 +0100)]
CVBR command line option.
Added command line control of Corpus VBR.
The new corpus vbr mode is a variant of standard
VBR (end-usage=0) where the complexity distribution
mid point is passed in rather than calculated for a specific
clip or chunk.
The new variant is enabled by setting a new command line
parameter --corpus-complexity to a zero value. Omitting
this parameter or setting it to 0 will cause the codec to use
standard vbr mode.
The correct value for a given corpus needs to be derived
experimentally using a training set such that the average
rate for the corpus is close to the target value.
For example our using our low res test set with upper and lower
vbr limits of 50%-150% and a corpus complexity value of 650
gives a similar average data rate across the set to using standard
vbr. However, with the corpus mode easier clips will be allocated
fewer bits and harder clips more bits rather than having the same
rate target for all.
James Zern [Wed, 20 Jul 2016 03:56:25 +0000 (20:56 -0700)]
vp8: correct if/else '{' placement
swap '{' and c-style comments removing a few redundant ones along the
way; covers most leftovers from the clang-tidy run against an
x86_64-linux config.
Marco [Mon, 23 Oct 2017 17:58:28 +0000 (10:58 -0700)]
vp9-svc: Allow for adapt_rd_thresh with row-mt.
Set adaptive_row_thresh_mt = 1 at speed >= 7,
for svc when multi-threading is used with row-mt.
This allow the adaptive_rd_thresh feature to be used
in the nonrd-pickmode.
~1-2% speedup for SVC encoding with small quality
loss (< 0.6%) on RTC set.
Jerome Jiang [Thu, 12 Oct 2017 22:03:22 +0000 (15:03 -0700)]
vp8: Enable use of ROI map.
Disable cyclic refresh if ROI is used and add flag to properly handle
the static_thresh deltas.
Remove the ROI test for cyclic refresh (it's allowed but disabled if ROI
is used).
Add an example in vpx_temporal_svc_encoder.c. Turned off by default.