Commit Graph

455 Commits

Author SHA1 Message Date
Marco
2136de9374 vp9: Temporal denoising: avoid denoising for speed <= 5.
Temporal denoiser runs in non-rd pickmode, so it is only used
for speed >= 5. Regression exists for speed 5, due to use of
reference_partition (which use non-rd pickmode for partitioning).
Avoid denoising for now at speed 5.

Change-Id: I74a74d2e1404d7cfd33dcf4ec06dd2e503256cf0
2017-04-05 16:43:39 -07:00
Yunqing Wang
41fac44707 Merge "Fix for out of range motion vector bug in sub-pel motion estimation" 2017-04-03 18:27:57 +00:00
Ranjit Kumar Tulabandu
bf15ca1091 Fix for out of range motion vector bug in sub-pel motion estimation
BUG=webm:1397

(yunqingwang)
To verify that this patch wouldn't cause much performance change,
the Borg tests were run. Here was the result:
       avg_psnr   overall_psnr  ssim
hdres: -0.002     0.006         0.013
midres:   0         0             0
lowres:   0         0             0

Change-Id: Iae395ae7b741e0513cf5bab9dcace110b792a67d
2017-04-03 16:16:49 +00:00
Marco
c824eda6cc vp9: SVC: Fix issue with artifact for svc-denoising.
Issue/bug happens for denoising with spatial layers, where
the golden (spatial) reference is used in pickmode, but
denoising is only done wrt to last (temporal).

Fix is to make sure set_ref_ptrs is set before build predictors
in denoiser.

Change-Id: I793cf441341edf7c4a88b8ab1e1b22b3cb0eb508
2017-03-31 10:05:32 -07:00
Marco
32b3d2f174 vp9: 1 pass SVC: Modify condition for intra-mode search.
Temporary override to condition for disallowing intra-search in SVC,
since golden (spatial) reference is currently suppressed due to
artifact issue.

Change-Id: I28ed7fdddc9fcdbcc0a4175a247a3ecc94c11767
2017-03-29 09:24:50 -07:00
Jerome Jiang
20c2892693 vp9: Enable adaptive_rd_threshold for row mt for realtime speed 8.
Change it to row based array to avoid the slow down cause by sync.
row-mt on, speed 8, 2 threads: ~4% speedup for VGA on ARM benefited
from adaptive_rd_threshold.

Change-Id: I887e65a53af20a6c4f48d293daaee09dab3512cf
2017-03-21 18:49:47 -07:00
Marco
06c8713e89 vp9: Use sb content measure to bias against golden.
For each superblock, keep track of how far from current frame
was the last significant content change, and use that (along
with GF distance), to turnoff GF search in non-rd pickmode.

Only enabled for speed >= 8.

avgPNSR on RTC/RTC_derf down by ~0.9/1.2.
Speedup on mac: ~3-5%.
Speedup on arm: 3.6% for VGA and 4.4% for HD.

Change-Id: Ic3f3d6a2af650aca6ba0064d2b1db8d48c035ac7
2017-03-20 12:42:26 -07:00
Marco
bc7d4935bb vp9: Fixes in non-rd pickmode for denoising with SVC.
Don't denoise spatial layer frames whose base layer is a key frame.

Disallow golden reference for SVC with denoising on frames
that will be denoised (highest layer), as this removes bad artifact.
Will re-enable when issue is resolved.

Change-Id: I87a6597812330500966458172acfce54af65f70f
2017-03-16 12:59:41 -07:00
Marco
c216c8d6f2 vp9: Speed >= 8: Enable simple_block_yrd speed feature.
Enable speed feature for resolutions > VGA.
avgPSNR on RTC down by ~1.7%.
Speedup on ARM: ~5%.

Change-Id: I7a3fe5f7425aa8df3f4a2eced1afa355bc0d4c95
2017-03-14 09:10:28 -07:00
Marco
8c18df7fcd vp9: Fix condition for intra search in non-rd pickmode.
Fixes an issue when the LAST and golden is not used as a reference,
in which case its possible no encoding mode is set (since intra may be
skipped under certain codtions). Fix is to make sure intra is searched
if no inter mode is checked.

Issue can happen for temporal layer pattern#7 in vpx_temporal_svc_encoder.c

Change-Id: I5ab4999b2f9dbd739044888e0916b5ec491d966b
2017-03-12 22:30:39 -07:00
Vignesh Venkatasubramanian
453f18040f vp9,realtime: Enable row multithreading for non-rd
Enable row level multithreading for realtime encodes where non-rd
path is used (speed >= 5).

Change-Id: I5439cb49a02171166d8e1de06c7d5e6f8e819a41
2017-03-02 11:03:56 -08:00
Marco
7e7d820d5b vp9: Non-rd pickmode: use simple block_yrd under some conditons.
For speed 8 only.
3% speed up for QVGA and 6.3% for VGA on Nexus 6.
~3% avgPSNR decrease on rtc_derf and 2.9% on rtc.

Disabled for now.

Change-Id: I70133f1f6c804d663d594df437bfe7fdb0030d6a
2017-02-22 13:22:53 -08:00
Johann Koenig
1e224dcb83 Merge "Drop zbin_ptr and quant_shift_ptr" 2017-02-21 18:16:38 +00:00
Marco
4e1ba35458 vp9: Fix for non-rd pickmode for high-bitdepth build.
Use the simple block_yrd under certain conditions.
The optimization code is completed but the speed is still slower
(~6% on 720p) than the low-bitdepth build.

For now, use the more complex block_yrd under certain conditions
(always use it for speed <= 5, otherwise use it on key frames and for
bsize >= 32x32).

This gives about ~2-3% gain in quality for speed 7 on RTC set
(over high bitdepth build), with about the same encoder fps as the
low bitdepth build.

Change-Id: Ibe92a1945d0bd635f880befb4c815727df62d754
2017-02-20 20:25:36 -08:00
Johann
ca4e27f5da Drop zbin_ptr and quant_shift_ptr
vp9[_highbd]_quantize]_fp[_32x32] and vp9_fdct8x8_quant do not make use
of these parameters.

scan is used for C code and iscan is used for SIMD implementations.

Change-Id: I908a0ff7d3febac33da97e0596e040ec7bc18ca5
2017-02-16 13:20:32 -08:00
Ranjit Kumar Tulabandu
71061e9332 Row based multi-threading of encoding stage
(Yunqing Wang)
This patch implements the row-based multi-threading within tiles in
the encoding pass, and substantially speeds up the multi-threaded
encoder in VP9.

Speed tests at speed 1 on STDHD(using 4 tiles) set show that the
average speedups of the encoding pass(second pass in the 2-pass
encoding) is 7% while using 2 threads, 16% while using 4 threads,
85% while using 8 threads, and 116% while using 16 threads.

Change-Id: I12e41dbc171951958af9e6d098efd6e2c82827de
2017-02-15 00:49:34 +00:00
Marco
22dcfa80aa vp9: Non-rd mode: use simple block_yrd for 8 bit high bitdepth builds
Temporary fix until optimization work for block_yrd is completed.
This essentially reverts back to the state before the change:
https://chromium-review.googlesource.com/c/433821/

Compression loss is about ~5-6% on RTC set.
Speed-up (from using this simple/model-based block_yrd) over the low
bitdepth builds (which uses more complex block_yrd) is ~5% on 720p.

Change-Id: Ie0af9eb0d111e5595f587870c44f08317403b8d8
2017-02-10 10:15:35 -08:00
Marco
1a5482d4d8 vp9: Denoiser speed-up: increase partition and ac skip thresholds.
Add factor to increase varianace partition and ac skip thresholds,
under certain conditions (noise level and sum_diff), to increase
denoiser speed.

Change-Id: I7671140ef3598bf5f114a72623d68792bcd7b77b
2017-02-07 10:33:13 -08:00
Jerome Jiang
aa327a1ed4 vp9: speed 8: Tune threshold of ac skip and partitioning.
Threshold for partitioning only affects VGA and lower res.
0.07% quality regression is observed in borg tests on rtc_derf
and 0.2% regression on rtc.
5.6% speed up for low res and 6.8% for VGA on Nexus 6.

Change-Id: If85a2919b48c991de66059c90f32ed06980452be
2017-02-06 16:27:53 -08:00
Yunqing Wang
770c6663d6 Merge "Changes to facilitate row based multi-threading of ARNR filtering" 2017-02-01 22:04:15 +00:00
Ranjit Kumar Tulabandu
359a6796da Changes to facilitate row based multi-threading of ARNR filtering
Change-Id: I2fd72af00afbbeb903e4fe364611abcc148f2fbb
2017-02-01 13:03:52 -08:00
Jingning Han
969957f9f2 Fix real-time compression regression in hbd mode
This commit resolves the compression performance regression in
real-time encoding setting when high bit-depth mode is enabled.

The current solution temporarily disables the SIMD implementations
of vpx_satd, hadamard8x8, and hadamard16x16 in high bit-depth mode.

The commit makes the coding results bit-wise identical between
regular coding pipeline and high bit-depth at profile 0.

BUG=webm:1365

Change-Id: Icfb900821733749685370460a1a5a7e07f76f4bf
2017-01-31 23:17:09 -08:00
Marco
d47f257484 vp9: Modify bsize condition for using model_rd_large for speed 7.
In non-rd pickmode: Allow speed 7 to also use larger block size in
model_rd. Small change in behavior for speed 7.

Change-Id: I8c5523e424308e8f0bc71b3f6324dec42a464cc8
2017-01-30 11:16:51 -08:00
Marco
b16c77cdc4 vp9: Modify bsize condition for using model_rd_large.
In non-rd pickmode: small change in behavior for speed 6 and 7.
Remove condition on HIGHBITDEPTH flag.

Change-Id: I360a13fcc313d72612fe9b918162ef4bb278cdea
2017-01-26 22:45:27 -08:00
Marco
f38ed0c560 vp9: Non-rd pickmode: fix to add ARF mode entries to THR_MODES.
BUG=webm:1359

Change-Id: Ie0c66efa2e19d1ec9c744d14e3fa8f1e6214cdd6
2017-01-23 10:56:29 -08:00
Marco
219cdab676 vp9: Add feature to use block source_sad for realtime mode.
Only for speed >= 7, and affects skipping of intra modes.
Threshold is set low for now, needs to be tuned.
Small/no difference in metrics on rtc clips.

Change-Id: If9bdbd43f08d1f80407cdd2e9e5e96780dcd2424
2017-01-20 11:57:02 -08:00
Marco
0f9760ab6f vp9: Modify usage of force_skip under low temporal variance in non-rd pickmode.
For short_circuit set to level 1, skip newmv for 64x64 blocks if the
low temporal variance flag is set. Also modify threshold for 64x64 split
in variance partitioning.

Overall speed-up on noisy clips of 2-4%.
Only affect speed >= 7.

Change-Id: I384b3772007e84de6f8707e480d2ddf1fe1f907d
2017-01-19 11:21:15 -08:00
Marco
7e3a82c384 vp9: Make the denoiser work with spatial SVC.
If enabled denoiser will only denoise the top spatial layer for now.

Added unittest for SVC with denoising.

Change-Id: Ifa373771c4ecfa208615eb163cc38f1c22c6664b
2017-01-10 17:23:58 -08:00
Marco
e7c453b613 vp9: 1 pass vbr: Skip find_predictors in pickmode when source is altref.
When source frame is altref, we only do zero-mv mode, so we can skip
the find_predictors(). No change in compression.
Small speed gain, ~1%.

Only affects 1 pass vbr with lookhead altref, for ytlive with
the macro flag USE_ALTREF_FOR_ONE_PASS on.

Change-Id: I9318c5da8521f017bf54919cd652438b3a6313d1
2016-12-21 12:12:55 -08:00
Marco
61b569b461 vp9 denoiser: Fix the logic for re-evaluating zeromv after denoising.
Correctly set interp_filter to SWITCHABLE for INTRA mode.
Also reduce threshold on noise level for re-evaluating zeromv.

Change-Id: Id32c01e193209fb380aa07204f0be3babf29f70a
2016-12-19 09:30:16 -08:00
Marco
4260a7f2b3 vp9: Change condition to enable recheck_zeromv_after_denoising.
For when denoising enabled: change condition to enable
the recheck_zeromv_after_denoising for only very high noise level.
This is causing an issue, so enabling it for very high noise
to effectively shut it off.

Change-Id: Ic40d6025f3f398338cedd270d17c0ccd9a3daa84
2016-12-16 15:00:21 -08:00
Marco
b6597745f9 vp9: Use more aggressive skip when short_circuit_low_temp_var = 1.
Use the same feature as https://chromium-review.googlesource.com/#/c/411327/,
but allow it to be used for speed  = 6 and 7, where
short_circuit_low_temp_var = 1.

Speed up of ~2-3% for speed 7, with little/no loss in compression.

Change-Id: I263a0f261ad9929034392d68f0153dc6376fdb5f
2016-11-22 14:54:28 -08:00
Jerome Jiang
360217a233 vp9: Speed 8: More aggresive golden skip for low res.
Add a new, more aggresive short circuit: short_circuit_low_temp_var = 3 to skip
golden of any mode when variance is lower than threshold for low res.
This change only affects speed = 8, low resolution.

Metrics for avgPSNR/SSIM on rtc_derf (low resolution) show loss of
0.27/0.31%.
On Nexus 6, the encoding time is reduced by ~2.3% on average across all
low-res clips.

Visually little change on rtc_derf clips.

Change-Id: Ia8f7366fc2d49181a96733a380b4dbd7390246ec
2016-11-15 13:56:27 -08:00
Marco
da9f762e24 vp9: Non-rd pickmode: fix logic in reference masking.
Add condition that usable_ref_frame > LAST.
This is to avoid potentially skipping all last-nonzero mv modes,
if golden is used as a reference but skipped completely for the
current block.

This has no effect currenty, as we always consider testing golden
mode for each block.

Change-Id: I3182cf44664081935a90ed43aa7b32e710e60e22
2016-11-03 10:32:57 -07:00
Marco
57c6bf291e 1 pass vbr: Allow for lookahead alt-ref in real-time mode.
For 1 pass vbr real-time mode:
Allow for the usage of alt-ref frame when non-zero lag-in-frames is used.
Use non-filtered alt-ref, and select usage based on fast scene/content
analysis/detection within the lag of frames.

Positive gains on ytlive set: overall avgPSNR ~3-4%.
Several clips are up between 5-14%, a few clips are neutral/small change.

Current speed decrease is about ~5-10%.

Use the flag USE_ALTREF_FOR_ONE_PASS to enable this feature
(off by default for now).

Change-Id: I802d2bf3d44f9cf01f6d15c76be9c90192314769
2016-10-11 10:13:17 -07:00
clang-format
5f6d143b41 apply clang-format
Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487
2016-09-15 15:07:53 -07:00
paulwilkins
3e9e77008c Casts to remove some warnings.
Added casts to remove warnings:
BUG=webm:1274

In regards to the safety of these casts they are of two types:-

- Normalized bits per (16x16) MB stored in a 32 bit int (This is safe as bits
per MB even with << 9 normalization cant overflow 32 bits. Even raw 12
bits hdr source even would only be  29 bits :- (4+4+12+9) and the encoder
imposes much stricter limits than this on max bit rate.

- Cast as part of variance calculations.  There is an internal cast up to 64 bit
for the Sum X Sum calculation, but after normalization dividing by the number
of points the result will always be <= the SSE value.

Change-Id: I4e700236ed83d6b2b1955e92e84c3b1978b9eaa0
2016-09-01 16:10:12 +01:00
James Zern
149d082377 vp9_pickmode: quiet float conversion warnings
Change-Id: I591e4f958955b3f2edb2f95a83c54cd83c8ef075
2016-08-19 01:28:01 -07:00
JackyChen
8be7e572a7 vp9 svc: SVC encoder speed up.
Bias towards base_mv and skip 1/4 pixel motion search when using base mv.
2~3% speed up for 2 spatial layers, 3~5% speed up for 3 spatial layers.
PSNR loss:
(2 layers) 0.07dB for gips_stationary, 0.04dB for gips_motion;
(3 layers) 0.07dB for gips_stationary, 0.06dB for gips_motion.

Change-Id: I773acbda080c301cabe8cd259f842bcc5b8bc999
2016-08-18 11:25:45 -07:00
Marco
7eb7d6b227 vp9 non-rd pickmode: Add limit on newmv-last and golden bias.
Add option, for newmv-last, to limit the rd-threshold update for early exit,
under a source varianace condition.
This can improve visual quality in low texture moving areas,
like forehead/faces.

Also add bias against golden to improve the speed/fps,
will little/negligible loss in quality.

Only affects CBR mode, non-svc, non-screen-content.

Change-Id: I3a5229eee860c71499a6fd464c450b167b07534d
2016-08-17 14:33:44 -07:00
Alex Converse
6554333b59 Refactor mv limits.
Change-Id: Ifebdc9ef37850508eb4b8e572fd0f6026ab04987
2016-08-08 11:54:00 -07:00
clang-format
e0cc52db3f vp9/encoder: apply clang-format
Change-Id: I45d9fb4013f50766b24363a86365e8063e8954c2
2016-08-02 16:47:11 -07:00
Alex Converse
34201e50c1 Unfork 8-bit in HBD path in vp9_model_rd_from_var_lapndz callers.
BUG=b/29583530

Change-Id: Ia88a75f9572e08f228559ab84b8a77efb5aff0af
2016-07-26 21:57:58 +00:00
Scott LaVarnway
c969b2b02b VP9: get_pred_context_switchable_interp() -- encoder side
Change-Id: I7217c90d5cf38c51b76759a2dc4f10070f3a40ac
2016-07-21 11:47:51 -07:00
Yaowu Xu
5adb43b8be Fix non-highbitdepth coding path for HBD build
Change-Id: I38eb42b8d051924a7cd1ccc3421a4057cf6e170f
2016-07-08 11:26:34 -07:00
Yaowu Xu
dc008cc17d Merge "Enable HBD support in real time encoding path" 2016-07-07 22:32:48 +00:00
Marco
f451b404ea vp9: Adjustment to mv bias for non-rd pickmode.
Replace the existing mv bias with a bias only for
NEWMV, and based on the motion vector difference of
its top/left neighbors.

For cbr non-screen-content mode.

Change-Id: I8a8cf56347cfa23e9ffd8ead69eec8746c8f9e09
2016-07-07 10:33:06 -07:00
Yaowu Xu
884c2ddc48 Enable HBD support in real time encoding path
BUG=webm:1223

Change-Id: If83a613784e3b2a33c9c93f9ad0ba39dd4d23056
2016-07-06 14:18:37 -07:00
JackyChen
2678aefc48 vp9: Choose the scheme for modeling rd for 32x32 based on skin color.
For real time CBR mode, use model_rd_for_sb_y for 32x32 if the sb is
a skin sb to avoid visual regression on the slowly moving face.

Refer to the cl: https://chromium-review.googlesource.com/#/c/356020/

Change-Id: I42c36666b2b474ce5ee274239d52ae8ab400fd46
2016-07-06 11:12:03 -07:00
Jingning Han
51aad61c8c Merge "Remove txfrm_block_to_raster_xy() from vp9 encoder" 2016-07-06 16:00:18 +00:00