Commit Graph

82 Commits

Author SHA1 Message Date
Marco
8cf6f78fce vp9: Adjustments for aq-mode and pickmode for speed >= 8.
Adjust the threshold for turning off cyclic refresh for high motion,
and avoid testing golden in nonrd pickmode for speed >= 8 if
golden refresh was long ago.

No change/neutral on RTC metrics.
Change-Id: I40959b8d9637f3553e7458bbabd8c6024c2c09c0
2017-06-21 16:01:24 -07:00
Marco
2adc0443dd vp9: Adjustments to cyclic refresh for high motion.
For aq-mode=3: refactor the condition for turning off
the refresh. Add some adjustments for high motion content.

No/little change in RTC metrics, only affects high motion case.

Change-Id: I7da8eabfb0e61db014be4562806f72ee5ef4a43b
2017-05-21 22:21:44 -07:00
Marco
18b54ef468 vp9: Adjust consec_zeromv threshold for aq-mode=3.
To reduce refresh on partial super-blocks on boundary,
for noisy input. Reduces some artifacts on noisy input.

Change-Id: I10b5808a296874e08c7f378b3df58466591d8dbe
Edit
2017-04-07 08:54:09 -07:00
Marco
8097b49997 vp9: Adjust condition of golden update with cyclic refresh.
Base the low_content_frame metric on the motion vectors,
and adjust the logic for preventing golden update.

Small change in behavior: small positive gain (~0.2-1%) on clips
with high activity.

Change-Id: I0b861c8e9666cd82b45cde5ee57ee8a1e5ab453c
2017-04-04 09:55:24 -07:00
Marco
6b3f4bc794 vp9: 1 pass CBR: cleanup to cyclic refresh.
Code cleanup: merged two functions that were doing postencode
update for cylic refresh, remove some unused code and fix comments.

No change in behavior.

Change-Id: I9be0d7e346d34dec29bf4e5bb380a7bf81c8480a
2017-04-03 16:37:45 -07:00
Marco
7e79831016 vp9: aq-mode=3: On key frame reset cr->reduce_refresh to 0.
This prevent possible reduction of cyclic refresh after key frame.

Change-Id: Idd4e49b69cd95476e7eccfa31b2bd8669569e9e8
2017-02-22 10:50:08 -08:00
Marco
158b300952 vp9: Some code cleanup for aq-mode = 3.
The weight segment needs to only be computed once per frame,
so remove it from the funciton vp9_cyclic_refresh_rc_bits_per_mb(),
which is called within a loop inside vp9_rc_regulate_q.

Change-Id: Ia0e18b89abb97e42c466d4dbc47700d7f76555db
2017-02-15 14:07:04 -08:00
Marco
716c1d5ff5 Vp9: Speed 8 aq-mode=3: Reduce computation in estimating bits per mb.
vp9_compute_qdelta_by_rate has almost 2% overhead in profiling on Nexus 6.
Reduce the calling of that function in speed 8 by estimating the delta-q.
Both rtc and rtc_derf show little/no change in avg psnr/ssim.
Encoding speed is 2~3% faster on Nexus 6.

Change-Id: If25933715783f31104a18a5092ea347b1221b5f5
2017-02-15 09:28:16 -08:00
Marco
8d0c8c5e6b vp9: Adjust some parameters in aq-mode=3 mode.
Increase the qp-delta, mainly for low resolutions,
excluding case of very low bitrates.

avgPSNR/SSSIM gain of ~3-5% on rtc_derf set.
Small change on rtc set.

Change-Id: Ice03d04bd0340404d1957666ef154fd64fed0606
2017-01-24 14:18:02 -08:00
Marco
360ac89885 vp9: Adjust the weight factor for segment rate cost for aq-mode=3.
Use the segment weight factor based on the target (cr->percent_refresh)
if it less than the current estimate (avergae of past usage and target).
Small improvement at low bitrates.

Change-Id: Iba8fd909e203f94458901366d3a991f7ea854d49
2016-12-05 12:42:56 -08:00
Marco
d793950ec8 vp9: Adjust cyclic refresh parameters for low bitrates.
Increase the motion threshold and qp-delta for segment#2 boost.
This can increase the frame-drop at low bitrates, but generally
better spatial quality.

Only affects real-time mode with aq-mode=3, at very low bitrates.

Change-Id: I5ccb784667f70d0c27d369806b93b1f93d5605d1
2016-11-23 12:14:28 -08:00
Marco
18794d8ddc vp9: Adjust thresholds for limiting cyclic refresh for noisy content.
For noisy content, be more aggressive in skippping some blocks for
delta-qp to reduce noise pulsing artifact. Also treat frame boundary
case when dimension is not multiple of superblock size/64.

Only affects non-screen content case, and when source noise
is measured to be high (at least level kMedium).

Change-Id: Ib13a2a20ed1ce37ff3c44d95c3ef2635fd695222
2016-11-08 15:50:46 -08:00
Yury Gitman
7a730d5901 Add cpi parameter for forcing segmentation update
Change-Id: I1b0bcb1ffe7604117bfaa0b9989d0e25ff04d28c
2016-08-08 13:20:42 -07:00
clang-format
e0cc52db3f vp9/encoder: apply clang-format
Change-Id: I45d9fb4013f50766b24363a86365e8063e8954c2
2016-08-02 16:47:11 -07:00
Marco
f4b5076ad3 vp9: Reduce qp threshold for limiting cyclic refresh on steady blocks.
Makes the delta-qp stop little earlier on areas that have been refreshed enough.
This helps to reduce some pulsing artifact on noisy flat areas observed in some
noisy vc-clips.

Threshold changes only take effect for sources where noise level is estimated to
be >= medium level.

Only affects 1 pass CBR, non-screen content case.

Change-Id: Iacf557f6aa8abbcd6782c02ff2e6c14891960850
2016-05-05 11:31:43 -07:00
Marco
adf8533cee vp9: Move consec_zero_mv from cyclic refresh to cpi struct.
So it can be used even with aq-mode=3 not enabled.
Also cleans up some code in the places where its used.

No change in behavior.

Change-Id: Ib6b265308dbd483f691200da9a0be4da4b380dbc
2016-04-22 08:09:39 -07:00
Marco
ce39add465 vp9: Improvement to skin detection.
Add consec_zeromv to skin detection.
Reduces false detection in steady background areas.

Change-Id: Ic31c831537d29f082f58477f82ed78f313d7dd30
2016-03-17 16:26:10 -07:00
Marco
32c38a20ba vp9: Fix the threshold for gf update in cyclic refresh.
Fix the threshold for forcing refresh of golden frame based
on high motion. The current comparison was incorrect and
prevented this (force update of gf on high motion) from being used.
For now keep this logic under a flag (and off for now) so as to
not change behavior, until further testing.

Change-Id: Ib5f0082159a428b0603b9534e4bcb6f83e4ccb25
2016-03-17 12:24:58 -07:00
Marco
a0278cad3f vp9 aq-mode=3: Allow it to be used for 1 pass VBR mode.
Change-Id: I630b8e33106c78382545d49da5fb4c75b1b0b528
2016-02-22 17:44:20 -08:00
James Zern
7997c68ed4 vp9_cyclic_refresh_alloc: correct cleanup on error
previously only the CYCLIC_REFRESH allocation was being freed

Change-Id: I6e1783d077c5ca83c8d62ea9642f1fb03f2e5bf3
2016-02-17 12:36:49 -08:00
Marco
ae98a61e22 vp9-dynamic resize: On a resize trigger frame refresh alt_ref.
For 1 pass real-time mode. No change in behavior as only last
and golden are used as references in 1 pass real-time mode.

Change-Id: Ie4655014eee1a8b271542f29d74b2c6f7fed54c9
2016-02-05 16:32:49 -08:00
James Zern
f7b4364cbb vp9_aq_cyclicrefresh: fix unused-function warning
delete apply_cyclic_refresh_bitrate(). unused since:
3472cbb vp9 aq-mode=3: Keep it on even at low bitrates.

Change-Id: I0fac9a31b59504e31000ac3a8f0b68e8d4320113
2016-02-05 11:56:51 -08:00
Marco
3472cbbd88 vp9 aq-mode=3: Keep it on even at low bitrates.
Change-Id: I6a27db6b9dbe3d8cb3d47ef30fbd52557171cadd
2016-02-04 17:31:10 -08:00
Marco
734dc36173 vp9: Add flag to control usage of skin detection.
Set off as default; on for 1 pass cbr mode, speed >=5, non-screen-content.

Change-Id: I03f2497e4028b354fd83b8a7d0e072c2a6bec878
2016-02-01 11:57:56 -08:00
Marco
fab630fac9 vp9-aqmode=3: Limit on period for golden update.
For aqmode=3, golden period update is set based on period of cyclic refresh.
Put a limit on max golden period update, for now set to 40.
And fix comment.

Change-Id: Icb61dd87c796cce2a5f5f7331c6a129540994696
2016-01-27 12:07:49 -08:00
James Zern
bd4501fe28 vp9_aq_cyclicrefresh: fix double->float warning
Change-Id: I39d3a150de9a77967a4e25ca89d2eda51fd18d47
2016-01-21 14:07:33 -08:00
Marco
a925173da0 vp9-aqmode=3: Reduce condition below which we turn off delta-qp.
Add TODO to consider turning-off more smoothly.

Change-Id: Id6dd4c5c515f5b09c388af965eb27dbe24924362
2016-01-20 20:26:40 -08:00
Scott LaVarnway
5232326716 VP9: Eliminate MB_MODE_INFO
Change-Id: Ifa607dd2bb366ce09fa16dfcad3cc45a2440c185
2016-01-19 16:40:20 -08:00
Marco
a8b7c6aad3 vp9-skin detection: Refactoring.
Add function to compute skin map for a given block, as its
used in several places (cyclic refresh, noise estimation, and denoising).

Change-Id: Ied622908df43b6927f7fafc6c019d1867f2a24eb
2016-01-04 16:58:06 -08:00
Marco
b121a3e7b8 aq-mode=3: Don't reset segment if block is determined to be skin.
For coding block sizes <=16X16, if the block is determined to be skin,
then always allow for that block to be candidate for refresh. So if that
block happens to be on the boost segment(s), segment won't get reset to 0
and delta-q will be applied.

PSNR/SSIM metrics neutral (little/no change) on RTC clips.
Speed increase small/negligible (< 1%).
Some visual improvement on faces in a few RTC clips.

Change-Id: I6bf0fce6f39d820b491ce05d7c017ad168fce7d6
2015-12-22 10:23:44 -08:00
Marco
384fc5e381 Adjust motion threshold to limit cyclic refresh.
Change-Id: Icfca27a567eb8929c312c6315856ee130d982a04
2015-11-11 18:22:21 -08:00
Marco
c7da053d4b Move noise level estimate outside denoiser.
Source noise level estimate is also useful for
setting variance encoder parameters (variance thresholds,
qp-delta, mode selection, etc), so allow it to be used also
if denoising is not on.

Change-Id: I4fe23d47607b4e17a35287057f489c29114beed1
2015-11-02 12:15:26 -08:00
Marco
8a2fc54508 Adjustments to vp9-denoising.
Adjust variance threshold, delta-qp, and intra penalty cost,
based on estimated noise level in source.

Replace denoising_on with a level value=L/M/H.

Change-Id: I0c017dae75a5d897367d2c42dec26f2f37e447c1
2015-10-27 10:44:19 -07:00
Marco
b44c5cf639 Adjustment on limiting cyclic refresh on steady blocks.
Adjust the qp threshold and consec_zeromv threshold for
limiting cyclic refresh. Also increase the refresh period
when the limit amount is significant, and some code-cleanup.

Small gain in PSNR/SSIM metrics: ~0.25/0.3 gain on RTC set, speed 7.

Change only affects non-screen content.

Change-Id: I1ced87a89a132684c071e722616e445b2d18236a
2015-10-16 10:16:44 -07:00
Marco
d6bbda4bc2 Fix resetting of cyclic refresh on dynamic resize change.
Put the reset at the right place, during the setup and prior
to updating the map.

Change-Id: I75e550ae9d8cc15081330b8857edc04c23947875
2015-10-15 09:03:51 -07:00
Marco
bc137ff67b Move setting of refresh threshold outside loop.
Small code cleanup. consec_zeromv refresh threshold
does not need to be computed for every super-block.

No change in behavior.

Change-Id: I8c4b1b28072f42b01d917fff6d1f62722f1e1554
2015-10-06 17:51:30 -07:00
Marco
3f7656cc23 Limit cyclic refresh on steady background blocks.
Use the existing QP condition on limiting cyclic refresh, and add
addiitonal condition that block has been encoded with zero/small motion
x frames in row (where x is at least several times the refresh period).
Additional condition only affect non-screen content mode.

This helps to improve visual stability for noisy input, where on steady
background areas the application of delta_qp may lead to encoding the noise.

Also added a change to use the true skip (after encoding) to update the
last QP.

Change-Id: I234a1128d017d284cf767fdb58ef6c59d809f679
2015-09-25 10:40:35 -07:00
Marco
9b51b3a9ca Adjust rate-boost threshold in cyclic refresh for seg#2.
Small gain in metrics (average ~0.2dB), small
reduction in rate fluctuation.

Change-Id: Id75bd89c168486f075308fb474ebd26e3bdfb85b
2015-09-23 11:52:55 -07:00
Marco
eb53c69ece Add cyclic refresh parameters to svc-layer context.
For 1 pass CBR spatial-SVC:
Add cyclic refresh parameters to the svc-layer context.

This allows cyclic refresh (aq-mode=3) to be applied to
the whole super-frame (all spatial layers).
This gives a performance improvement for spatial layer encoding.

Addd the aq_mode mode on/off setting as command line option.

Change-Id: Ib9c3b5ba3cb7851bfb8c37d4f911664bef38e165
2015-09-15 10:06:36 -07:00
Alex Converse
575e81f7c9 CR: Don't attempt to read qindex_delta for segments CR is unaware of.
Found by the remoting VideoEncoderVpxTest.Vp9LossyUnchangedFrame unit
test under asan.

Change-Id: Icac63051bf37c7355e661837b57c257d58c764fc
2015-09-14 13:55:30 -07:00
Alex Converse
3d6b8a667f Prevent CR in screen mode from refreshing flat inter blocks forever.
Take the minimum last_codec_q_map on inter skip.

Change-Id: Ibb308526dd19793bb359f51ebd7b48d8692903fd
2015-09-10 15:03:13 -07:00
Marco
bda690d446 Move cyclic_refresh struct into .h file.
Change-Id: I9327cd52d0ec050887ba7e591b094d74bd36bce8
2015-09-08 13:49:24 -07:00
Johann
c5f11912ae Include vpx_dsp_common.h when using VPXMIN/MAX
Change-Id: I2e387a06484a06301f3cd6600c4ba2f4335b61ee
2015-08-31 14:36:35 -07:00
James Zern
5e16d397bd vpx_dsp_common: add VPX prefix to MIN/MAX
prevents redeclaration warnings;
vp8 has its own define which will be resolved in a future commit

Change-Id: Ic941fef3dd4262fcdce48b73075fe6b375f11c9c
2015-08-26 20:11:32 -07:00
Alex Converse
a8a08ce57e Move vp9_systemdependent.h to vpx_ports bitops.h and system_state.h
Use system_state.h in vpx_dsp and remove unneeded includes of
vp9_systemdependent.h.

Change-Id: I92557ec6dd5aa790160b4f31fe7967db0d7ec3c4
2015-08-10 15:37:14 -07:00
Marco
dc36e5aff0 Fix a setting in cyclic refresh.
Use the correct period (in terms of cr->percent_refresh) for the condition
of larger delta-qp following key frame.
And account for larger interval for temporal layers.

Change-Id: Ibb43f5200f9b1eeb8bbb8211327b08ecda3c3b8a
2015-08-07 10:34:47 -07:00
Marco
7ae1aa6b37 Dynamic resize for 1 pass: update of golden frame.
In aq-mode=3 under a resizing action (i.e., resize_pending != 0),
force an update of the golden reference frame.

Change-Id: I14806f6db71b5f8c827678cc5e1fc913c138a9a4
2015-07-16 09:27:20 -07:00
Marco
3dd9cde2a5 Fix to unstable build from commit 517a66.
Change-Id: I123db2d20ae65a10e2dec95eec61150e2f69546d
2015-06-24 17:28:57 -07:00
Marco
517a662005 aq-mode=3: Reduce boost for segment#2 at low bitrates/low res.
Reduce boost for segment#2 for low bitrates and low-res.

This change is to reduce the rate overshoot at low bitrates.
No change in behavior, except at the very low bitrates.

Change-Id: I0dbd9d3b6356da5804de94adf10fca6a7a8f8948
2015-06-23 16:50:43 -07:00
Alex Converse
90c9ede8e6 Limit cyclic refresh revisitng blocks at the same quantizer.
For screen content don't refresh a block at a quantizer higher than
it was last coded at. PReviosuly at realtime speeds the encoder had a
tendency to recode a block from GOLDEN with a higher Q than it was last
coded at.

Change-Id: Iacd561806c769dcce1a81b9827ffc70090f5ba18
2015-06-19 15:23:02 -07:00