Marco Paniconi [Fri, 15 Mar 2019 16:13:45 +0000 (09:13 -0700)]
vp9-rtc: Adjustments for base layer in screen.
On scene/content changes for base layer of screen:
reduce 32x32 split threshold, bias rdcost for flat
blocks if sse_y is non-zero, and avoid early exit on
intra-check.
Paul Wilkins [Wed, 13 Mar 2019 16:20:23 +0000 (16:20 +0000)]
Improve key frame detection
Improve detection of key frames especially in low contrast
and low motion regions.
This patch adds a function to the key frame detection to test
for specific patterns in the intra signal in the first pass stats
that tend to be indicative of a key frame.
This is intended to compliment the existing code and finds some
scene cuts that were previously being misssed.
Tested on two clips where the existing code was struggling to
identify the key frames this patch improved detection as follows.
Film clip 1: (detected / actual)
Old (2/5) New (5/5)
Film Clip 2
Old 4/11 and one false +, New 7/11 and 1 false +.
Short 4K Film Scene
Old 1/2 New 2/2
In testing so far I have not seen many extra false +'s though
it is likely that there will be some cases and this may need
further tweaking.
One one of our longer form film test reels ~20k frames)
the change picked up around 35 key frames that were
previously missed, mainly in darker scenes. There were a few
extra (or different) false positives cause by bright flashes or
explosions but these were cases where there was little
difference between inter and intra coding.
Marco Paniconi [Fri, 15 Mar 2019 00:27:58 +0000 (17:27 -0700)]
vp9-rtc: Some adjustments for low-resolns real-time
Force smooth_interpol filter for low resolutions at high Q,
avoid the loopfilter strength reduction for similar conditon,
and reduce thresh_motion for cyclic refresh turnoff.
Jingning Han [Thu, 14 Mar 2019 15:28:44 +0000 (08:28 -0700)]
Refactor tile boundary condition for intra prediction
Explicitly compare the block location against tile coordinate to
decide if intra prediction boundary is available. No coding stats
will be changed by this refactoring.
Marco Paniconi [Wed, 13 Mar 2019 20:46:12 +0000 (13:46 -0700)]
vp9-svc: Reorganize the simulcast mode
Set the lst/gld/alt_fb_idx and refresh flags for
key frames at the start of encoding (in svc_set_params).
This then avoids new code/function in update_references()
and in copy_flags_ref_update().
Jingning Han [Tue, 5 Mar 2019 18:45:16 +0000 (10:45 -0800)]
Set up Wiener variance for macroblocks in a frame
This commit introduces a Wiener variance term. For each block in
the source frame, we first estimate its film grain noise level
using median filter in the transform domain. Each transform
coefficient is then processed using Wiener filter to account for
the impact on the energy level due to film grain noise. The result
leads to a second moment of the denoised signal.
Paul Wilkins [Thu, 28 Feb 2019 14:10:12 +0000 (14:10 +0000)]
Change to mode early breakout rules for FILM mode.
The biggest offender in terms of preventing retention of film
grain in high rate film content is the use of DC-PRED mode.
Some of the directional modes whilst not strictly preserving
grain do better at at least preserving some texture.
This change blocks the early breakout of the rd loop based
on the reference frame giving the best result so far. In practice,
unless DC-PRED was chosen as the best mode so far, the other
directional intra modes would not even be considered.
As the film grain mode also tends to bias against DC-PRED (or
intra in general) this was pretty much blocking all use of directional
intra modes.
The patch also allows for a broader spectrum of DC modes at the
16x16 transform level than previously.
Marco Paniconi [Sat, 9 Mar 2019 05:00:48 +0000 (21:00 -0800)]
vp9-screen: Rework the mode skip logic for screen
Don't force skip of zero-golden reference when
zero_temp_sad_source = 0, as it be may the
inter-layer reference. And remove the flatness conditon
when superblock is static.
Marco Paniconi [Fri, 8 Mar 2019 18:04:31 +0000 (10:04 -0800)]
vp9-screen: Fix to screen wth layered encoding
zero_temp_sad_source is only computed when
compute_source_sad_onepass and sf->use_source_sad are
on, which currently is only for the top layer of the
layered encoding. So qualify the usage of
zero_temp_sad_source on those flags.
This affects the quality/speed of the lower layers of
screen content mode when SVC (quality layers) are used.
Marco Paniconi [Thu, 7 Mar 2019 04:28:26 +0000 (20:28 -0800)]
vp9-rtc: Improve mode check on flat blocks in screen mode
For nonrd-pickmode in screen content mode: modify logic for
inter and intra mode check for spatially flat blocks.
Condition skip of non-zero/zero inter mode based on
zero_temp_sad_source, and force intra/DC check regardless.
Johann [Tue, 5 Mar 2019 00:55:10 +0000 (16:55 -0800)]
add -Wmissing-prototypes
clang treats -Wmissing-declarations differently than gcc. This
provides similar coverage for clang.
Fix vpx_clear_system_state() warning on 32bit builds:
note: this declaration is not a prototype; add 'void' to make it a
prototype for a zero-parameter function
Marco Paniconi [Sat, 2 Mar 2019 06:03:10 +0000 (22:03 -0800)]
vp9-rtc: Adjust force split logic for screen mode
In variance partition for screen content mode:
force split to 32x32 if source pre-process detects
non-zero temporal sad.
Reduce artifacts in scroll motion content.
Marco Paniconi [Fri, 1 Mar 2019 19:18:36 +0000 (11:18 -0800)]
vp9-rtc: Fix for scroll motion for rtc
Increase threshold to detect frames with high
num of motion blocks, and fix conditions to detect
horiz & vert scroll and avoid split below 16x16 blocks
in variance partition.
Reduces artifacts in horizonal scroll screenshare testing.
Marco Paniconi [Fri, 1 Mar 2019 01:53:18 +0000 (17:53 -0800)]
vp9-rtc: Reduce thresholds for skip golden
For nonrd-pickmode CBR mode: reduce the skip
golden ref thresholds, to reduce some psnr
regression in some clips, while still effectively
reducing flashing block artifact occurrence.
paulwilkins [Tue, 26 Feb 2019 12:34:07 +0000 (12:34 +0000)]
Fix RD multiplier bug impacting AQ1.
Change to the default RD multiplier computation in set_segment_rdmult()
The default here is wrong as for modes like AQ 1 setting the rdmult based on the
segment ID for bsize will tend to result in the RD loop favoring partition sizes where
the resulting segment assignment has the lowest Q, as these partition sizes will be
then evaluated with a lower value of rdmult. For a valid rd comparison between
partition sizes within a single SB64 we need to use the same value of rdmult.
This change fixes an observed issue with AQ 1 where almost all the blocks were being
assigned to segment 0.
Marco Paniconi [Thu, 28 Feb 2019 00:19:33 +0000 (16:19 -0800)]
vp9-rtc: Change init level of denoiser & noise level
Change to init/reset level of the denoiser from
kDenLow to kDenMedium, and the init noise level to kLow.
This affects the denoiser level during the initialization
stage of the noise estimation.
Improves denoising for noisy content during init stage of
noise estimation, with little effect for low noise/clean content.