Commit Graph

9294 Commits

Author SHA1 Message Date
Yaowu Xu
690fcd793b Change to call vp9_post_proc_frame()
This commit changes the call in vp9 encoder from vp9_deblock() to
vp9_post_proc_frame() to ensure the data structures used in the call
are properly allocated. This fixes an encoder crash when configured
with --enable-internal-stats.

Change-Id: I2393b336c0f566665336df4f1ba91c405eb56764
2016-07-20 11:01:49 -07:00
James Zern
e3f7991f99 Merge changes Ia6004c08,I1954f9d6
* changes:
  cosmetics: Add a few explanatory comments
  cosmetics: Correct grammar/spelling in comments
2016-07-19 19:12:23 +00:00
Yury Gitman
e4ac882007 cosmetics: Add a few explanatory comments
Change-Id: Ia6004c08e6f5fd269a1bbd4df51ce9b76345150d
2016-07-19 10:39:00 -07:00
Marco
05fe0f20a6 vp9: Allow usage of lookahead for real-time, 1 pass vbr.
Allow usage of lookahead for VBR in real-time mode, for 1 pass vbr.

Current usage is for fast checking of future scene cuts/changes,
and adjusting rate control (gf interval and active_worst/target size).

Added unittests (datarate) for 1 pass vbr mode, with non-zero lag.

Added an experimental option to limit QP based on lookahead.

Overall positive gain in metrics on ytlive set:
avgPNSR/SSIM up on average ~1-3%; several clips up by 5, 7%.

Change-Id: I960d57dfc89de121c4824b9a9bf88d2814e74b56
2016-07-18 15:20:17 -07:00
Yury Gitman
bdfdd7d993 cosmetics: Correct grammar/spelling in comments
Change-Id: I1954f9d6e33abff9081fe7a5cf59d5497768e0df
2016-07-18 12:49:00 -07:00
James Bankoski
ce6678fdc9 Merge "addnoise : clear out static size for generated noise" 2016-07-16 01:48:07 +00:00
Jim Bankoski
cb957c302a addnoise : clear out static size for generated noise
Change-Id: I5d4343f2da9cd4b01dd37be7a048d159fec109d1
2016-07-15 15:52:45 -07:00
Jim Bankoski
da1bda0fb2 vp9_postproc.c : unused variable if not vp9_highbitdepth.
Change-Id: Ib89b128f23767934c40b5add3fcf9dbd875e82f9
2016-07-15 15:04:57 -07:00
Jim Bankoski
0dc69c70f7 postproc : fix function parameters for noise functions.
Change-Id: I582b6307f28bfc987dcf8910379a52c6f679173c
2016-07-15 08:27:34 -07:00
James Bankoski
7eec1f31b5 Merge "postproc: noise style fixes." 2016-07-13 22:04:47 +00:00
Hui Su
8dd3bef7ef Merge "Revert "Eliminate isolated and small tail coefficients:"" 2016-07-13 21:30:12 +00:00
Yaowu Xu
d6197b621d Merge "Fix encoder crashes for odd size input" 2016-07-13 20:05:09 +00:00
Jim Bankoski
e736691a6d postproc: noise style fixes.
Change-Id: Ifdcb36b8e77b65faeeb10644256e175acb32275d
2016-07-13 12:39:01 -07:00
hui su
248f6ad771 Revert "Eliminate isolated and small tail coefficients:"
This reverts commit ff19cdafdb.

Change-Id: I81f68870ca27a1ff683ee22090530b6997815fb2
2016-07-13 11:14:44 -07:00
Jingning Han
fed14a3e94 Merge "Disable trellis optimization when lossless is on" 2016-07-13 16:01:01 +00:00
James Bankoski
e93f2fdb83 Merge "postproc - move filling of noise buffer to vpx_dsp." 2016-07-13 15:31:17 +00:00
Jim Bankoski
2ca24b0075 postproc - move filling of noise buffer to vpx_dsp.
Change-Id: I63ba35dc0ae9286c9812367a531e01d79a4c1635
2016-07-13 07:35:25 -07:00
Jim Bankoski
b24373fec2 deblock: missing const on extern const.
Change-Id: I0df08f7c431daf939e266f008bf5158b0c97358b
2016-07-13 07:27:29 -07:00
Jim Bankoski
6f424a768e vp9_postproc.c missing extern.
BUG=webm:1256

Change-Id: I5271e71bc53cce033fb906040643dcdd5ccb2381
2016-07-12 17:47:49 -07:00
Yaowu Xu
98431cde07 Fix encoder crashes for odd size input
Change-Id: Id5c30c419282369cc8c3280d9a70b34a859a71d8
2016-07-12 11:11:26 -07:00
Jacky Chen
19c157afe2 Merge "vp9 svc: Reuse scaled_temp in two stage downscaling." 2016-07-12 17:59:09 +00:00
JackyChen
110a2ddc9b vp9 svc: Reuse scaled_temp in two stage downscaling.
This change eliminates redundant computation in the two stage
downscaling, which saves ~1% encoding time in 3-layer svc encoding.

Change-Id: Ib4b218811b68499a740af1f9b7b5a5445e28d671
2016-07-12 10:09:55 -07:00
Jingning Han
efccbc9fb5 Disable trellis optimization when lossless is on
Disable trellis coefficient optimization when the lossless mode
is turned on.

Change-Id: I9001bf626e86dc3c8c32331ede04fd39036e5f7c
2016-07-12 09:00:16 -07:00
Jim Bankoski
88e6951465 deblock filter : moved from vp8 code branch
The deblocking filters used in vp8 have been moved to vpx_dsp for
use by both vp8 and vp9.

Change-Id: I5209d76edafc894b550f751fc76d3aa6799b392d
2016-07-12 05:53:00 -07:00
James Zern
45ed7effed Merge "remove *debugmodes.c from the default build" 2016-07-11 23:49:29 +00:00
Scott LaVarnway
2e93fcf893 Merge "vp9_rd_pick_intra_mode_sb(): set interp_filter to" 2016-07-11 22:31:06 +00:00
paulwilkins
3a986eac57 Sample points to reduce encode overhead.
Only noise filter sampled points in first pass to reduce
any first pass speed overhead.

Change-Id: Ic80d4400e59146d1c3332336c4350faf28ff8b17
2016-07-11 11:45:52 +01:00
Scott LaVarnway
ed7786869a vp9_rd_pick_intra_mode_sb(): set interp_filter to
SWITCHABLE_FILTERS.  This is a partial fix for the build
issues with Change 357240.

Change-Id: I4e507c196175bae729a4f1397878ec8776b0146c
2016-07-09 09:47:34 -07:00
Yaowu Xu
5adb43b8be Fix non-highbitdepth coding path for HBD build
Change-Id: I38eb42b8d051924a7cd1ccc3421a4057cf6e170f
2016-07-08 11:26:34 -07:00
Marco Paniconi
20946cdd3b Merge "vp9: Adjustment of gfu_boost and af_ratio for 1 pass vbr." 2016-07-08 16:26:06 +00:00
Yaowu Xu
dc008cc17d Merge "Enable HBD support in real time encoding path" 2016-07-07 22:32:48 +00:00
Marco
cc431ad50a vp9: Adjustment of gfu_boost and af_ratio for 1 pass vbr.
Modify the gfu_boost and af_ratio setting based on the
average frame motion level.

Change only affects 1 pass vbr.

Metrics overall positive on ytlive set.
On average up by ~1%, several clips up by 2-4%.

Change-Id: Ic18c49eb2df74cb4986b63cdb11be36d86ab5e8d
2016-07-07 15:18:14 -07:00
Marco Paniconi
a75965fa94 Merge "vp9: Adjustment to mv bias for non-rd pickmode." 2016-07-07 21:07:37 +00:00
Jingning Han
2f28f9072e Enable coeff optimization for intra modes
This further improves the coding performance by
lowres 0.3%
midres 0.5%
hdres  0.6%

Change-Id: I6a03b6da210b9cbc261474bad4a103e0ba021c68
2016-07-07 12:25:41 -07:00
Jingning Han
44354ee7bf Use precise context to estimate coeff rate cost
Use the precise context to estimate the zero token cost in trellis
optimization process. This improves the speed 0 coding performance
by 0.15% for lowres and 0.1% for midres. It improves the speed 1
coding performance by 0.2% for midres and hdres.

Change-Id: I59c7c08702fc79dc4f8534b64ca594da909e2c91
2016-07-07 12:25:33 -07:00
Jingning Han
62aa642d71 Enable uniform quantization with trellis optimization in speed 0
This commit allows the inter prediction residual to use uniform
quantization followed by trellis coefficient optimization in
speed 0. It improves the coding performance by

lowres 0.79%
midres 1.07%
hdres  1.44%

Change-Id: I46ef8cfe042a4ccc7a0055515012cd6cbf5c9619
2016-07-07 12:25:33 -07:00
Jingning Han
541eb78994 Refactor coeff_cost() function
Move the operations that update the context buffers outside this
function. The coeff_cost() takes all input as const value and returns
the coefficient cost.

This makes preparation for the next coefficient optimization CLs.

Change-Id: I850eec6e5470b91ea84646ff26b9231b09f70a0c
2016-07-07 18:09:39 +00:00
Jingning Han
7c1fdf02cd Merge "Support measure distortion in the pixel domain" 2016-07-07 18:09:20 +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
paulwilkins
2580e7d63e Noise energy Experiment in first pass.
Use a measure of noise energy to adjust Q estimate and
arf filter strength.

Gains 0.3-0.5% on Lowres and |Netflix sets.
Hdres and Midres neutral.

Change-Id: Ic0de552e7b6763e70eeeaa3651619831b423e151
2016-07-07 14:50:21 +01:00
Paul Wilkins
f037cf80c9 Merge "Add experimental spatial de-noise filter on key frames." 2016-07-07 13:30:07 +00:00
Jingning Han
e357b9efe0 Support measure distortion in the pixel domain
Use pixel domain distortion metric in speed 0. This improves the
compression performance by 0.3% for both low and high resolution
test sets.

Change-Id: I5b5b7115960de73f0b5e5d0c69db305e490e6f1d
2016-07-06 18:25:17 -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
Debargha Mukherjee
adbad6092f Merge "Remove decode asserts from better-hw-compatibility" 2016-07-06 20:55:29 +00:00
Jacky Chen
aa6108382e Merge "vp9: Choose the scheme for modeling rd for 32x32 based on skin color." 2016-07-06 20:03:55 +00:00
Debargha Mukherjee
4b6e4e1813 Remove decode asserts from better-hw-compatibility
Safer to have the decoder operate normally and have
better-hw-compatibility only implement encoding changes.
Fixes some test failures.

Change-Id: I0dd70d002e4e893992f0cd59774b9363e6f7fe76
2016-07-06 12:26:38 -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
Min Ye
ff19cdafdb Eliminate isolated and small tail coefficients:
Improve hdres PSNR by 0.696%
Improve midres PSNR by 0.313%
Improve lowres PSNR by 0.142%

Change-Id: Icabde78aa9689f539f6a03ec09f712c20758796c
2016-07-06 11:08:23 -07:00
Jingning Han
51aad61c8c Merge "Remove txfrm_block_to_raster_xy() from vp9 encoder" 2016-07-06 16:00:18 +00:00
Jingning Han
14011f037d Remove txfrm_block_to_raster_xy() from vp9 encoder
The transform block row and column positions are always available
outside the callees. There is no need to re-compute these values
again. This approach has been used by the decoder. This commit
removes txfrm_block_to_raster_xy() function.

Change-Id: I5b90f91a0d8b7c35cfa7d171da9edf8202630108
2016-07-04 18:41:47 -07:00
James Zern
d2b40894be remove *debugmodes.c from the default build
these are debug-only modules that can be added in manually when needed.
leave a reference in vp8_common.mk / vp9_common.mk for easy addition.

quiets -Wmissing-prototypes warning

BUG=b/29584271

Change-Id: Ifc8637d877edfbd562b34dc5c540428bba7951fc
2016-07-01 19:10:04 -07:00
Yunqing Wang
0a075cb39c Make set_reference control API work in VP9
Moved the API patch from NextGenv2. An example was included.
To try it, for example, run the following command:
$ examples/vpx_cx_set_ref vp9 352 288 in.yuv out.ivf 4 30

Change-Id: I4cf8f23b86d7ebd85ffd2630dcfbd799c0b88101
2016-07-01 17:58:02 -07:00
Jacky Chen
ee78c541a4 Merge "vp9 postproc: Bug fix and code clean." 2016-06-30 21:59:44 +00:00
Johann Koenig
3c41d7358c Merge "vp9: remove x86inc.asm distinction" 2016-06-30 17:42:17 +00:00
Paul Wilkins
1d3f1983b2 Merge "Fix error in get_ul_intra_threshold() for 10/12 bit." 2016-06-30 16:26:14 +00:00
Paul Wilkins
f7c2d2a3de Merge "Fix error in get_smooth_intra_threshold() for 10/12 bit." 2016-06-30 16:25:55 +00:00
paulwilkins
e25d6252a4 Fix error in get_ul_intra_threshold() for 10/12 bit.
The scaling of the threshold for 10 and 12 bit here appears
to be in the wrong direction. For 10 and 12 bit we expect sse
values to be higher and hence the threshold used should be
scaled up not down.

Change-Id: I2678116652b539aef48100e0f22873edd4f5a786
2016-06-30 13:38:57 +01:00
paulwilkins
f9a3d08f1b Fix error in get_smooth_intra_threshold() for 10/12 bit.
This function seems to scale the threshold for testing an
SSE value in the wrong direction for 10 and 12 bit inputs.

Also for a true SSE the scalings should probably be << 4 and 8

Change-Id: Iba8047b3f70d04aa46d9688a824f3d49c1c58e90
2016-06-30 13:34:11 +01:00
Jacky Chen
e85607410e Merge "vp9: Change the scheme for modeling rd for 32x32 on newmv_last mode." 2016-06-30 05:59:46 +00:00
Johann
fe96dbda15 vp9: remove x86inc.asm distinction
BUG=b:29583530

Change-Id: I952da3fc0d4716dec897be0d2e9806af6612722b
2016-06-29 18:55:28 -07:00
JackyChen
5fc2d6cb9f vp9: Change the scheme for modeling rd for 32x32 on newmv_last mode.
For real time CBR mode, use model_rd_for_sb_y for 32x32 if the mode is
newmv last, which is less aggressive in skipping transform and
quantization, to avoid quality regression in some conditions.

Change-Id: Ifa30be587f2a8a4a7f182a172de6ce277c0f8556
2016-06-29 16:28:15 -07:00
James Zern
3a6a81fc9a Merge changes I9433d858,Iafd05637,If08ce6ca
* changes:
  tests: remove redundant round() definition
  remove visual studio < 2010 workarounds
  configure: remove old visual studio support (<2010)
2016-06-29 23:07:16 +00:00
paulwilkins
be013eb396 Add experimental spatial de-noise filter on key frames.
For forced key frames in particular this helps to make them
blend better with the surrounding frames where noise tends
to be suppressed by a combination of quantization and alt
ref filtering.

Currently disabled by default under and IFDEF flag pending
wider testing.

Change-Id: I971b5cc2b2a4b9e1f11fe06c67ef073f01b25056
2016-06-29 17:25:41 +01:00
Scott LaVarnway
74bb78df82 Merge "VP9: handle_inter_mode()... Use interp_filter" 2016-06-29 11:41:52 +00:00
James Zern
c125f4a594 remove visual studio < 2010 workarounds
BUG=b/29583530

Change-Id: Iafd05637eb65f4da54a9c857e79204a77646858a
2016-06-28 20:58:49 -07:00
jackychen
6b4463dc1f vp9 postproc: Bug fix and code clean.
Bug fix: The crash is caused by not allocating buffer for prev_mip in
postproc_state and prev_mip in postproc_state is only used for MFQE,
ohter postproc modules, deblocking and etc., should not use it.

BUG=webm:1251

Change-Id: I3120d2f50603b4a2d400e92d583960a513953a28
2016-06-28 16:13:44 -07:00
Scott LaVarnway
feb7e9a372 VP9: handle_inter_mode()... Use interp_filter
only if above/left is inter.

Change-Id: I0cc1f926425c021c84536df8271e9ee5f3f87caf
2016-06-28 14:09:59 -07:00
Jacky Chen
d004c64013 Merge "vp9: Increase thr_var for 32x32 blocks in var-based partitioning." 2016-06-28 20:54:06 +00:00
Jacky Chen
4736e5f9d1 Merge "vp9: Move chroma sensitivity check out from choose_partitioning." 2016-06-28 20:53:23 +00:00
jackychen
91038e0eb6 vp9: Move chroma sensitivity check out from choose_partitioning.
Change-Id: Ie78185a30cac4d1841be3708bd23e6505d3733b6
2016-06-28 09:58:51 -07:00
James Zern
f51f67602e *.asm: normalize label format
add a trailing ':', though it's optional with the tools we support, it's
more common to use it to mark a label. this also quiets the
orphan-labels warning with nasm/yasm.

BUG=b/29583530

Change-Id: I46e95255e12026dd542d9838e2dd3fbddf7b56e2
2016-06-27 19:46:57 -07:00
jackychen
8cbd4f8701 vp9: Increase thr_var for 32x32 blocks in var-based partitioning.
For real-time mode, increase variance threshold for 32x32 blocks in
var-based partitioning for resolution >= 720p, so that it is more
likely to stay at 32x32 for high resolution which accelerates the
encoding speed with little/no PSNR drop.

PSNR effect on different speed settings:
speed 8 rtc: 0.02 overall PSNR drop, 0.285% SSIM drop
speed 7 rtc: 0.196% overall PSNR increase, 0.066% SSIM increase
speed 5 rtc_derf: no effect.

Speed up:
gips_motion_WHD, 1mbps: 2.5% faster on speed 7, 2.6% faster on speed8
gips_stat_WHD, 1mbps: 4.6% faster on speed 7, 5.6% faster on speed8

Change-Id: Ie7c33c4d2dd7d09294917e031357fc5476c3a4bb
2016-06-27 14:44:27 -07:00
Yaowu Xu
7676defca9 Merge "Port metric computation changes from nextgenv2" 2016-06-27 19:18:00 +00:00
Yaowu Xu
b9ec759bc2 Fix ubsan warnings: vp9/encoder/vp9_pickmode.c
This commit fixes a number of integer out of range issue in HBD build.

BUG=webm:1219

Change-Id: Ib4192dc74a500e1b86c37a399114c7f6d4ed5185
2016-06-27 05:53:46 +00:00
James Zern
913081ab02 Merge "s/UINT32_MAX/UINT_MAX/" 2016-06-25 21:09:55 +00:00
James Zern
ca88d22f39 s/UINT32_MAX/UINT_MAX/
provides better toolchain compatibility

Change-Id: I8561a6de668a68ff54fe3886a4ee6300f0ae9c04
2016-06-25 12:15:51 -07:00
James Zern
1c0a9f36f1 vp9_pickmode: revert rd modeling change for hbd
Avoids a segfault in high-bitdepth builds.
This restores the condition to its state prior to:
7991241 vp9: Change the scheme for modeling rd for bsize 32x32.

BUG=webm:1250

Change-Id: I6183d5b34cb89dfbf27b7bb589812148a72cd7de
2016-06-25 11:40:26 -07:00
Jacky Chen
168eea5d60 Merge "vp9: Change the scheme for modeling rd for bsize 32x32." 2016-06-25 00:43:40 +00:00
Jacky Chen
723e357ead Merge "vp9: Code clean, move low temp var logic out of choose_partitioning." 2016-06-24 22:00:49 +00:00
James Zern
b34705f64f Merge "cosmetics: Beautify whitespaces and line wrapping" 2016-06-24 21:51:01 +00:00
James Zern
efad6feb9a Merge "cosmetics: Change few types to their posix version" 2016-06-24 21:50:45 +00:00
James Zern
9e5f355daf Merge "cosmetics: Make few conditions clearer" 2016-06-24 21:50:32 +00:00
Yaowu Xu
003a9d20ad Port metric computation changes from nextgenv2
Change-Id: I4aceffcdf7af59ffeb51984f0345c3a4c7e76a9f
2016-06-24 13:52:50 -07:00
jackychen
dd07443f72 vp9: Code clean, move low temp var logic out of choose_partitioning.
Change-Id: I7093e74131e0964471c9993c1e972b4617c4731d
2016-06-24 13:38:22 -07:00
jackychen
7991241a50 vp9: Change the scheme for modeling rd for bsize 32x32.
For real-time CBR mode, use model_rd_for_sb_y_large instead of
model_rd_for_sb_y for 32x32 block. In the former model, transform
might be skipped more aggressively in some condtions, which speeds
up encoding time with only a little PSNR/SSIM drop on rtc test set.
No obvious visual quality regression.

PSNR effect on different speed settings:
speed 8 rtc:  0.129% overall PSNR drop, 0.137% SSIM drop
speed 7 rtc:  0.135% overall PSNR drop, 0.062% SSIM drop
speed 5 rtc_derf: 0.105% overall PSNR drop, 0.095% SSIM drop

Speed up:
gips_motion_WHD, 1mbps: 3.29% faster on speed 7, 2.56% faster on speed8
gips_stat_WHD, 1mbps: 2.17% faster on speed 7, 1.62% faster on speed8

BUG=webm:1250

Change-Id: I818babce5b8549b4b1a7c3978df8591bffde7173
2016-06-24 12:09:13 -07:00
Yury Gitman
67611119b5 cosmetics: Beautify whitespaces and line wrapping
Change-Id: I9afa02cae671bd3527cf344695e53d0cc767f549
2016-06-24 10:18:06 -07:00
Yury Gitman
3b2e2f2f77 cosmetics: Change few types to their posix version
Change-Id: I6d7bc9ed7396e7b0d63ee97bfa473fdea002f9ee
2016-06-24 10:18:06 -07:00
Yury Gitman
79436fadfb cosmetics: Make few conditions clearer
Change-Id: Ib024b3e42efc7ce1af56824a4644fdefcd45b215
2016-06-24 10:17:51 -07:00
Yaowu Xu
7ed1d54ab4 Merge "Revert "vp9: Change the scheme for modeling rd for bsize 32x32."" 2016-06-24 16:05:55 +00:00
Yaowu Xu
26daa30da4 Merge "Rationalize type to avoid integer out of range" 2016-06-24 13:58:36 +00:00
Yaowu Xu
7738bcb350 Rationalize type to avoid integer out of range
BUG=webm:1250

Change-Id: Id5bb2762ca1bf996ba4f9a60eec977a7994c1d94
2016-06-24 13:58:02 +00:00
James Zern
d4596485be Revert "vp9: Change the scheme for modeling rd for bsize 32x32."
This reverts commit 5c29ee726e.

Causes segfaults in VP9/EndToEndTestLarge.EndtoEndPSNRTest.

BUG=webm:1250

Change-Id: I8a30e97be30589abdb76820b5c3c37c46cd6cafb
2016-06-23 15:59:25 -07:00
Vignesh Venkatasubramanian
692fe74deb Merge "vp9: Fix potential SEGV in decoder_peek_si_internal" 2016-06-23 21:33:13 +00:00
Angie Chiang
424982bc41 Merge "set interp_filter to SWITCHABLE_FILTER for intra block" 2016-06-23 18:56:27 +00:00
Vignesh Venkatasubramanian
aa1c813c43 vp9: Fix potential SEGV in decoder_peek_si_internal
decoder_peek_si_internal could potentially read more bytes than
what actually exists in the input buffer. We check for the buffer
size to be at least 8, but we try to read up to 10 bytes in the
worst case. A well crafted file could thus cause a segfault.
Likely change that introduced this bug was:
https://chromium-review.googlesource.com/#/c/70439 (git hash:
7c43fb6)

BUG=chromium:621095

Change-Id: Id74880cfdded44caaa45bbdbaac859c09d3db752
2016-06-23 09:39:26 -07:00
Angie Chiang
d9c417cb49 set interp_filter to SWITCHABLE_FILTER for intra block
In vp9_pick_inter_mode(), instead of using
vp9_get_pred_context_switchable_interp(xd) to assign filter_ref,
we use a less strict condition on assigning filter_ref.
This is to reduce the probabily of entering the flow of not
assigning filter_ref and then skipping filter search.

Overall PSNR gain 0.074% for rtc dataset

Details:
Low    Mid     High
0.185% -0.008% -0.082%

Change-Id: Id5c5ab38d3766c213d5681e17b4d1afd1529e676
2016-06-22 17:19:43 -07:00
Alex Converse
b2597527a5 Merge "Repack vp9_token_state." 2016-06-23 00:17:23 +00:00
Jacky Chen
8496390e73 Merge "vp9: Change the scheme for modeling rd for bsize 32x32." 2016-06-22 23:50:46 +00:00
James Zern
527a9fea76 Merge "remove vp10" 2016-06-22 22:35:57 +00:00
jackychen
5c29ee726e vp9: Change the scheme for modeling rd for bsize 32x32.
For real-time CBR mode, use model_rd_for_sb_y_large instead of
model_rd_for_sb_y for 32x32 block. In the former model, transform
might be skipped more aggressively in some condtions, which speeds
up encoding time with only a little PSNR/SSIM drop on rtc test set.
No obvious visual quality regression.

PSNR effect on different speed setting:
speed 8 rtc:  0.129% overall PSNR drop, 0.137% SSIM drop
speed 7 rtc:  0.135% overall PSNR drop, 0.062% SSIM drop
speed 5 rtc_derf: 0.105% overall PSNR drop, 0.095% SSIM drop

Speed up:
gips_motion_WHD, 1mbps: 3.29% faster on speed 7, 2.56% faster on speed8
gips_stat_WHD, 1mbps: 2.17% faster on speed 7, 1.62% faster on speed8

Change-Id: I902f62def225ea01c145d7e5a93497398b8f5edf
2016-06-22 11:17:56 -07:00
Yaowu Xu
b3933e2d3c Merge "Fix ubsan warnings: vp9/encoder/vp9_mcomp.c" 2016-06-22 00:12:58 +00:00
Yaowu Xu
87bf1a149c Fix ubsan warnings: vp9/encoder/vp9_mcomp.c
This commit fixes a number of ubsan warnings in HBD build.

BUG=webm:1219

Change-Id: I05f0fd0ef50e93db4ba34205005c54af1ed32acc
2016-06-21 15:37:59 -07:00
hui su
a5af392aae Add a hardware compatibility feature
This commit adds an encoder workaround to support better
compatibility with a non-compliant hardware vp9 profile 2 decoder.

The known issue with this decoder is:
The decoder assumes a wrong value, 127 instead of the correct
value of 511 and 2047, for any assumed top-left corner pixel in
UV planes for 10 and 12 bit, respectively. Such assumed
top-left corner pixel is used for INTRA prediction when a real
decoded/reconstructed pixel is not avalable, e.g. when it is
located inside the row above the top row or inside the column
left to the leftest column of a video image.

Change-Id: Ic15a938a3107e1b85e96cb7903a5c4220986b99d
2016-06-21 10:33:57 -07:00
Alex Converse
50d3629c61 Repack vp9_token_state.
Reduces size from 32 bytes to 24 bytes on x86_64.

Change-Id: I8a22552343a1fc916117f35267fe6a295250f742
2016-06-20 12:56:32 -07:00
Yaowu Xu
aee577b691 Merge "Fix ubsan warning: vp9/encoder/vp9_encodeframe.c" 2016-06-20 19:33:33 +00:00
James Zern
67edc5e83b remove vp10
development has moved to the nextgenv2 branch and a snapshot from here
was used to seed aomedia

BUG=b/29457125

Change-Id: Iedaca11ec7870fb3a4e50b2c9ea0c2b056a0d3c0
2016-06-17 18:26:08 -07:00
Jingning Han
9e185ed177 Refactor optimize_b for speed performance
This commit refactors the trellis coefficient optimization process.
It saves multiplications used to generate the final dequantized
coefficients. It removes two memset operations on quantized
and dequantized coefficient sets. This improves the unit speed
by 10%.

Change-Id: I23f47c6e14582520a7f952f03ce8f72183e7f0e6
2016-06-17 17:41:09 -07:00
Jingning Han
dba1d1a63d Port optimize_b speed-up from vp10
This commit back ports the speed-up from vp10. It improves the
unit speed by 15%.

Change-Id: Ibe8c0e0974b03266d6abd16a41e89c3b91d8db2a
2016-06-17 17:41:05 -07:00
Yaowu Xu
40477f1f70 Fix ubsan warning: vp9/encoder/vp9_encodeframe.c
BUG=webm:1219

Change-Id: I29b896c7f61abf871d7853b1d8200aa5a9f6a95c
2016-06-17 17:07:06 -07:00
Jingning Han
f99f78c7af Use 64-bit integer to store distortion in optimize_b
This fixes the overflow issue.

Bug=webm:1241

Change-Id: Ia168b7fae1ad214a6837aaa785a08bf8506987dd
2016-06-17 15:07:00 -07:00
Yaowu Xu
c5fae00227 Merge "Fix ubsan warnings: vp9/encoder/vp9_encoder.c" 2016-06-17 19:29:19 +00:00
Tom Finegan
5a9f21db54 Output frames in first pass for VPX_DL_REALTIME.
Since combining VPX_DL_REALTIME with VPX_RC_FIRST_PASS is basically
nonsense, ignore the user's pass setting when this happens and
behave as if the requested encode is a single pass encode.

BUG=webm:1233

Change-Id: I5ee4c4e5838c4ca6d24988890aae490b10826db2
2016-06-17 11:25:55 -07:00
Yaowu Xu
754eb95105 Fix ubsan warnings: vp9/encoder/vp9_encoder.c
BUG=webm:1219

Change-Id: I433a688fbbc87094afa888c1e7d49f3eefc0e765
2016-06-17 11:25:11 -07:00
James Zern
cf2bfcd9d8 Merge "vp9_pickmode: quiet int64->int conversion warning" 2016-06-17 03:58:46 +00:00
Yaowu Xu
0c1da40ea8 Merge "Fix an ubsan warning: vp9_quantizer.c" 2016-06-16 21:42:41 +00:00
Yaowu Xu
77318b0aec Merge "Fix ubsan warning: vp9_cx_iface.c" 2016-06-16 16:44:35 +00:00
Marco Paniconi
8870756ac6 Merge "vp9: Adjustments to nonrd-pickmode for vbr" 2016-06-16 16:07:06 +00:00
Yaowu Xu
1387f5550f Fix ubsan warning: vp9_cx_iface.c
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1219

Change-Id: I77584af8b9e25db484d9ced6013da3163a9592c0
2016-06-16 08:28:33 -07:00
Yaowu Xu
25110f2837 Fix an ubsan warning: vp9_quantizer.c
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1219

Change-Id: Ie1bfda4d51c1567f551515f0ed113eec1bc1d98c
2016-06-16 15:23:21 +00:00
James Zern
ff8edd3509 vp9_pickmode: quiet int64->int conversion warning
since:
7901a05 VP9: block_yrd(): Use RD_COST * instead

Change-Id: I808be7a7bc96b81eb7d6255ae96cea7e9b1ecf1f
2016-06-15 23:34:09 -07:00
Hui Su
bbe5ddfdfb Merge "Add vp9 encoder API VP9E_GET_LEVEL to provide bitstream level" 2016-06-15 23:52:19 +00:00
Jacky Chen
7751651ea1 Merge "vp9: Add bias to last frame in choose_partitioning." 2016-06-15 22:50:05 +00:00
Marco
8e070558b0 vp9: Adjustments to nonrd-pickmode for vbr
For VBR: (1) allow newmv mode for golden ref to
select interpolation filter (as in last ref case), and
(2) don't use the more aggressive tx-skip testing logic for large blocks.

Only affects 1 pass real-time vbr mode (speed >= 5).

PSNR/SSIM metrics on ytlive set are all positive, ~0.5-2% gain.

Change-Id: I0ffbb0a9755563a5acd6230c58236e4f19a47266
2016-06-15 14:31:28 -07:00
Scott LaVarnway
55d0ffeb54 Merge "VP9: block_yrd(): Use RD_COST * instead" 2016-06-15 21:02:45 +00:00
JackyChen
7abc05c9af vp9: Add bias to last frame in choose_partitioning.
This change is only for real-time mode if short_circuit_low_temp_var
is on. Add bias to last frame in choosing ref frame for partitioning,
when y_sad and y_sad_g are close. It speeds up real-time encoding by
0.5% on some clips with less than 0.1% overall PSNR drop on rtc test set.

Change-Id: I2a2110fe36455f3d8f0fc404aef2228f512e8df8
2016-06-15 13:46:24 -07:00
hui su
72d4890caf Add vp9 encoder API VP9E_GET_LEVEL to provide bitstream level
Change-Id: I1ef3df0192491035728fe9d5eb25cc66dc2965de
2016-06-15 12:53:28 -07:00
Jacky Chen
9c90830165 Merge "vp9: Code clean up for short circuit feature in low temp variance." 2016-06-15 16:49:32 +00:00
Scott LaVarnway
7901a051c9 VP9: block_yrd(): Use RD_COST * instead
of int *rate, int *dist.

Change-Id: I7cbaea5252615b6b45b33e896f637cf7d076588a
2016-06-15 05:39:00 -07:00
Scott LaVarnway
221fcdac85 Merge "VP9: minor block_yrd() refactoring" 2016-06-15 11:46:54 +00:00
JackyChen
17962ab2c0 vp9: Code clean up for short circuit feature in low temp variance.
Change-Id: I7573a5cf0ab79abed8d124019c0ed6d9531277f9
2016-06-14 16:53:13 -07:00
Jacky Chen
d5be4a17ef Merge "vp9: Encoding cycle reduction for speed 8." 2016-06-14 15:41:32 +00:00
Paul Wilkins
19a4ce904d Merge "Small re-arrangement." 2016-06-14 11:46:58 +00:00
JackyChen
f9c0587200 vp9: Encoding cycle reduction for speed 8.
1. Skip golden non-zeromv and newmv-last for bsize >= 16x16 if the
temporal variance obtained from choose_partitioning is very low.
2. Skip horz and vert INTRA mode for speed 8.

This change works best on the clips with little noise and with some
motion (e.g. gips_motion which has > 5% speed up). PSNR drop is 1.78%
on rtc test set, no obvious visual quality regression found.

Change-Id: Ib43b5b20e67809d03c5a6890818ddff59e1fc94a
2016-06-13 09:33:22 -07:00
Scott LaVarnway
580317160c VP9: minor block_yrd() refactoring
Change-Id: Ic0a81fb5816c8252ca4876753320fde5c28d893f
2016-06-13 07:35:45 -07:00
Marco Paniconi
181988d372 Merge "vp9: Put lower limit on frames_to_key adjustment to gf interval." 2016-06-10 22:49:48 +00:00
James Zern
40e3bf8630 Merge "vp9_diamond_search_sad_avx cosmetics" 2016-06-10 17:30:39 +00:00
Marco
9b61c709c4 vp9: Put lower limit on frames_to_key adjustment to gf interval.
For 1 pass vbr.

Change-Id: I6c1c1cca3944150140e896e175b07ed518641b9b
2016-06-10 10:08:56 -07:00
Scott LaVarnway
2a0e1bcc83 vp9_diamond_search_sad_avx cosmetics
Fixed cosmetic issues noted in Change 349854.

Change-Id: I1d94070e4066fa920173013c5a36a30dd1cb357d
2016-06-10 04:56:21 -07:00
paulwilkins
fba94b8cfd Small re-arrangement.
Move initialization of a some new "twopass" values
to the function vp9_init_second_pass() and some other
small  changes.

Remove #if GROUP_ADAPTIVE_MAXQ as this is always
enabled now.

Change-Id: I1dbec2fd7c419779848aa987c4cd7824d4df8456
2016-06-09 11:32:34 +01:00
James Zern
5b7960fa82 vp9_subexp.h: normalize function prototype
vp9_prob_diff_update_savings_search_model

updated in:
19e0b40 Refactor probability savings search.

Change-Id: I13ae3106961f0271f51df17ee1c70c99f2d75f8f
2016-06-08 22:55:53 -07:00
Marco Paniconi
5aeadbb4f6 Merge "vp9: Use nonrd_pick_partition on scene-cut, for speed 5 vbr mode." 2016-06-09 00:49:02 +00:00
Marco
3fc01f95da vp9: Use nonrd_pick_partition on scene-cut, for speed 5 vbr mode.
On scene-cut detected frames (i.e., high_source_sad = 1), use
nonrd_pick_partition (over choose_part + select_part), as
the nonrd_pick partitioning is generally better.

Small positive increase in metrics on ytlive set (~0.5 - 1%).
Negligle overall speed decrease, as its only used on scene-cut frames.

Only affects 1 pass vbr mode, speed = 5.

Change-Id: I07c89cbdc75f5bb16eb8e0e2773ead0980d2de5c
2016-06-08 16:05:59 -07:00
Marco
77ffea92c5 vp9: Reduce overshoot factor for setting longer gf interval.
Only affects 1 pass vbr mode.

Change-Id: Ifd7ff3771eabe322a371b35b159cace6baa3b070
2016-06-08 15:15:15 -07:00
Alex Converse
d00aaa9c12 Merge "Refactor probability savings search." 2016-06-08 17:49:52 +00:00
James Zern
97b4f8fe92 Merge "Revert "remove vp9_diamond_search_sad_avx.c"" 2016-06-08 02:56:00 +00:00
Hui Su
28a93d6588 Merge "Avoid a potential assertion fail in optimize_b()" 2016-06-08 00:33:48 +00:00
Scott LaVarnway
eb09bbe88b Revert "remove vp9_diamond_search_sad_avx.c"
This reverts commit be12fefa4b
and commit 057c1c4034.

Also, the mismatch between the avx version and the
c version has been fixed.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1168

For a rt encode using 1080p@60fps material, up to 11% performance
improvement overall was seen.

Change-Id: Icd1f216209ebc6fc0b8da885f32f356fa4355ed0
2016-06-07 17:21:01 -07:00
hui su
a554bd8dac Avoid a potential assertion fail in optimize_b()
The eob of a block is not perperly set when skip_recode is true,
thus triggering assert(eob <= default_eob) to fail.

Change-Id: Ifecbe33dce2dc4903e0a80bd384dc09bf0dd8a44
2016-06-07 15:45:04 -07:00
Marco
f0b08aa4fa vp9: Replace the avg_size_inter metric, for 1 pass vbr.
Code cleaup, use existing rolling_actual/target metrics instead,
set threshold to get same/similar effect.

Little/no change in metrics on ytlive set.

Change-Id: I74f3c3d0a143a9cf20dc9c3dee54c0f7e6a97a51
2016-06-07 11:29:33 -07:00
Marco
3de42ac27b vp9: Small ajustment to settings gf_interval, 1 pass vbr.
Add a max condition and lower the min value.

No change in behavior (metrics for yt live set) for the
default min/max_gf_interval=4/16 settings.
Small positive change when min/max_gf_interval=7/16
(for 60fps clips on ytlive set).

Change-Id: I1c1d72425c86c69419ea43fb9730130e81062f91
2016-06-07 09:51:41 -07:00
James Zern
4539267916 Merge "Fix Visual Studio build failure in filter_selectively_vert_row2() calls" 2016-06-03 20:07:47 +00:00
Paul Wilkins
03a401c4d9 Merge "Slightly more damped VBR adjustment." 2016-06-03 17:14:12 +00:00
Paul Wilkins
fd38ef4b99 Merge "Change to get_twopass_worst_quality()" 2016-06-03 17:13:51 +00:00
Paul Wilkins
a160533e41 Merge "Removed unused data structure." 2016-06-03 17:13:33 +00:00
Paul Wilkins
bfff16af67 Merge "Adjustment to VBR rate correction." 2016-06-03 17:13:14 +00:00
Paul Wilkins
5ef54c1536 Merge "Adjustment calculation of active worst quality." 2016-06-03 17:12:52 +00:00
Paul Wilkins
7a586cad07 Merge "Remove gf_zeromotion_pct." 2016-06-03 17:12:25 +00:00
Linfeng Zhang
304d310975 Fix Visual Studio build failure in filter_selectively_vert_row2() calls
Error messages:
 ..\vp9\common\vp9_loopfilter.c(1312): warning C4244: 'function' :
conversion from 'uint64_t' to 'unsigned int', possible loss of data
[.build-x86_64-win64-vs10\vpx.vcxproj]

..\vp9\common\vp9_loopfilter.c(1313): warning C4244: 'function' :
conversion from 'uint64_t' to 'unsigned int', possible loss of data
[.build-x86_64-win64-vs10\vpx.vcxproj]

..\vp9\common\vp9_loopfilter.c(1312): error C2220: warning treated as
error - no 'object' file generated
[.build-x86_64-win64-vs10\vpx.vcxproj]

Change-Id: Ia69260611997cd2ba41c7184a85ecead740a7c07
2016-06-03 09:36:58 -07:00
paulwilkins
45a26dd9c8 Slightly more damped VBR adjustment.
Increase in the damping used in adjusting the active Q range.
This does hurt rate accuracy a little in a few extreme cases
especially if the clip is very short*, but helps metrics.

* Note that the adjustment is applied at the GF/ARF group level based
on what happened in the last group.  Hence for very short clips where
the length of a single group may be a significant % of the clip length
there is still scope for some drift that cannot be accommodated.

In practice most data points in our test sets are now much closer to target
than was previously the case with default settings and in some cases are
better even than they were with the command line undershoot and overshoot
parameter was set very low (e.g. 2%). For example in bridge_close at high rates
the old mechanism was unable to adapt enough to prevent extreme overshoot.

Change-Id: I634f8f0e015b5ee64a9f0ccaa2bcfdbc1d360489
2016-06-03 13:19:51 +01:00
paulwilkins
552fd02cf0 Change to get_twopass_worst_quality()
Change to the calculation of the error divisor used in
get_twopass_worst_quality(). This follows on from other
changes to the rate control that impact the output of this
function.

Change-Id: I414fa9aa1e6a68a64dccea17c3712f44b8a0c10c
2016-06-03 13:18:29 +01:00
paulwilkins
f9865d1701 Removed unused data structure.
Removed unused element from TWOPASS data structure.

Change-Id: I9b662fd8eea727a7978055bc14f7c7328f048a5e
2016-06-03 13:18:09 +01:00
paulwilkins
c7ac2f3864 Adjustment to VBR rate correction.
Changes to the function the redistributes bits from overshoot
or undershoot throughout the rest of the clip to respond more
quickly.

Change-Id: I90f10900cdd82cf2ce1d8da4b6f91eb5934310da
2016-06-03 13:17:43 +01:00
paulwilkins
cd700e1ab9 Adjustment calculation of active worst quality.
Added a factor based on the bit spend in the last arf group vs the
target to adjust the choice of the active worst quality in subsequent
groups.

Helps clips where previously there was a big overshoot or undershoot
to adapt and get closer to the target rate.

Change-Id: I67034b801679b99024409489a2273ea6fe23b8e6
2016-06-03 13:17:21 +01:00
paulwilkins
4328b08521 Remove gf_zeromotion_pct.
The use of this value is preventing rate adjustment on clips
or sections that have very little motion but high noise and
this can give rise to some sections with massive overshoot.

Change-Id: I9a65c7c1148dc5d3a7d8b23e50fc1733f3661621
2016-06-03 12:13:03 +01:00
JackyChen
891dbe1e52 vp9: Fix valgrind failure for short circuit on low temporal vaiance block.
Add check for actual split before using the variance of the split.

Change-Id: If0f93248be0b16d17738675d16c90516054dad2b
2016-06-02 15:56:58 -07:00
JackyChen
a32f341539 Disable short circuit feature for low temporal variance.
The featrue fails in libvpx_unit_tests-valgrind. Will re-enable it after
fixing the issue.

Change-Id: I8ba132f04e98f4615b31fbff2097eda83c5e42bc
2016-06-02 09:45:00 -07:00
Linfeng Zhang
10969dfc6e Merge "Update filter_selectively_vert_row2()" 2016-06-02 16:22:21 +00:00
jackychen
bacc67f4a8 vp9: Skip some modes when variance is low for big blocks, for 1 pass real-time.
Skip intra-mode and some inter-modes (newmv, nearmv, nearestmv) for
golden frame if the variance got from choose_partitioning is very low.
Only for 1 pass real-time CBR mode and bsize >= 32x32, it has ~2.5%
speed up with less than 0.1% PSNR drop for rtc test set. Don't see
visual regression.

Change-Id: I70efbc95a1007231ae36f02c5b2fbf6cd35077ad
2016-06-01 13:54:18 -07:00
Linfeng Zhang
b26232eb1b Update filter_selectively_vert_row2()
Reduce operations and jumps. perf shows CPU time reduced from 1.9% to
1.6% when decoding fdJc1_IBKJA.248.webm on Xeon E5.
Will apply the changes to vp10 after code review.

Change-Id: I9351509922855d8896ddef1ed093b3ca12619a61
2016-06-01 11:20:47 -07:00
Marco
bedf1c3af6 vp9: Skip computation of best_sad for newmv, unless needed.
For non-rd pickmode:
best_pred_sad, computed for NEWMV-last, is only used for
skipping golden non-zero modes. Add condition to avoid this
computation if not used (i.e, if golden nonzero modes are not used).

And remove code for computing best_pred_sad for NEWMV-golden,
since that sad is not used.

No change in behavior; small speed gain (~1%) for svc encodes.

Change-Id: Ic2cbdef6c4e9a233a57c0db0eeac8ad5fcead366
2016-05-31 10:29:00 -07:00
Linfeng Zhang
2ab7b9a6c9 Merge "Upgrade fwht4x4_mmx() to fwht4x4_sse2() for vp9 and vp10." 2016-05-27 17:51:35 +00:00
Linfeng Zhang
af7fb17c09 Upgrade fwht4x4_mmx() to fwht4x4_sse2() for vp9 and vp10.
Function level timing test shows about 27% time saving on
a Xeon E5-2680 v2 desktop.

Rename vp9_dct_sse2.c to vp9_dct_intrin_sse2.c for vp9 and
rename dct_sse2.c to dct_intrin_sse2.c for vp10 to avoid
duplicate basenames.

Actually vp9_fwht4x4_mmx/sse2() and vp10_fwht4x4_mmx/sse2()
are identical. TODO: They should be unified later if there is
no intention to keep a duplicate.

Change-Id: I3e537b7bbd9ba417c606cd7c68c4dbbfa583f77d
2016-05-27 09:51:16 -07:00
Alex Converse
19e0b406c9 Refactor probability savings search.
- Avoid excessive copying

- Don't both searching if no update can possibly offer savings

- Simplify the interface

- Remove the confusing vp9_cost_upd256 macro

Change-Id: Id9d9676a361fd1203b27e930cd29c23b2813ce59
2016-05-25 13:00:09 -07:00
Yaowu Xu
e5b7f14ea7 Merge "Fix comments in build_intra_predictors_high()" 2016-05-25 19:58:18 +00:00
Yaowu Xu
ba8651d474 Fix comments in build_intra_predictors_high()
1. Removed TODOs, no longer applicable to finalized vp9 profiles.
2. Added explanation on assumed values for highbitdepth profiles.

Change-Id: I59e0bebaaab900cc611ed284daa5fa0bdedb8097
2016-05-25 12:18:35 -07:00
Yaowu Xu
75b6cfe1c5 Prevent read to invalid RefBuffer
This commit adds check to validate RefBuffer before reading into the
data structure, to prevent invalid read.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=614701

Change-Id: Ie111e95bd18e88fa19d8b25e097cdf52b7139cb6
2016-05-25 09:28:36 -07:00
James Zern
be12fefa4b remove vp9_diamond_search_sad_avx.c
vp9_diamond_search_sad_avx was disabled in:
057c1c4 disable vp9_diamond_search_sad_avx

this removes a missing prototype warning as the prototype is no longer
included in vp9_rtcd.h. the file can be restored if someone gets around
to fixing the issue.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1168

Change-Id: Ia9fda4b81c53dc5fba7c31d780d761f886940b52
2016-05-24 12:02:22 -07:00
jackychen
6f397b8a5b vp9: Remove a redundent condition in sub-pixel filter choosing.
Change-Id: I5cbb0f452ec9622437482b3a9496ead1253acfe0
2016-05-20 14:38:45 -07:00
Jacky Chen
fa5d54f937 Merge "vp9: Refactor some denoiser logic in vp9_pick_inter_mode." 2016-05-19 23:05:32 +00:00
JackyChen
af0a9fcf70 vp9: Refactor some denoiser logic in vp9_pick_inter_mode.
Move the logic for rechecking zeromv on denoised block out to simplify
the function. To simplify the param passing, add a new structure
VP9_PICKMODE_CTX_DEN which is only used when denoiser is enabled.

Change-Id: Iaa9b4396dfcb8147236c02d4a1868a09103a4476
2016-05-19 15:28:25 -07:00
Yaowu Xu
489f8b2d88 Merge "Prevent invalid read" 2016-05-18 23:54:56 +00:00
Alex Converse
284be1c9e0 Merge "Move, rename, and inline high_inter_predictor." 2016-05-18 21:20:04 +00:00
Alex Converse
a5191f3e60 Move, rename, and inline high_inter_predictor.
The inlining mirrors what was done with the low bit depth
inter_predictor. And the new highbd_inter_predictor name is more
consistent with other high bit depth functions.

Change-Id: I96437f745759aeec6260c6e39a974bf36f1c211c
2016-05-18 09:39:49 -07:00
Yaowu Xu
4f0e4d6cef Prevent invalid read
This commit adds a check before reading into RefBuffer to prevent OOB
read.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=612023

Change-Id: I5b02951932e7f457cfbe6b2e650790496b8577ae
2016-05-18 07:40:49 -07:00
Scott LaVarnway
8b8e296019 Merge "VP9: _get_pred_context_switchable_interp()" 2016-05-18 12:42:54 +00:00
Scott LaVarnway
3036fd761a VP9: _get_pred_context_switchable_interp()
Remove unnecessary checks.

Change-Id: Ic7bce8277ac5f4ae88d4ab7d0ae3ab110b2f225b
2016-05-17 15:26:12 -07:00
Yaowu Xu
2240d83d78 Promote to uint32_t before left shift
This commit change to promote uint8_t explicitly to uint32_t before
left shift operation.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=612021

Change-Id: Id7059154efb5bdfa45889dabe72aaafd46d79f23
2016-05-17 11:39:57 -07:00
Marco Paniconi
bdfbd6325e Merge "vp9: Update to rc-metric for keeping track of average frame size." 2016-05-16 21:09:46 +00:00
JackyChen
0dfa6b38dc Move non-zero mv bias on large block out of vp9_pick_inter_mode.
This is to simplify pick inter mode funtion and is bitexact.

Change-Id: Ib1a115bac5fbd212c626be194bcd4a6ce4af9bf2
2016-05-13 15:29:05 -07:00
Marco
8a79769aff vp9: Update to rc-metric for keeping track of average frame size.
Rename and change to how its updated.
Only affects 1 pass vbr.

Small change in metrics (< ~0.1%) on ytlive set.

Change-Id: Ibb1fe485699b6c4a8194951c8f229abe2f64b9a5
2016-05-13 14:31:57 -07:00
hui su
3c206aca04 Fix typos in control function for VP9E_SET_TARGET_LEVEL
Change-Id: Ic797c6be579c3434681a5e9dbb3900ae49c43958
2016-05-11 20:23:52 -07:00
Marco
0c60db7def vp9: Fix to quality regression issue for 1 pass.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1217

Issue introduced in https://chromium-review.googlesource.com/#/c/339162/.
The factor on avg_frame_qindex[INTER_FRAME] in that CL, used for q-basis to
set active_best, can cause the QP to decrease too slowly or get stuck
in some cases when max-q=63.

Removing that factor fixes the regression in issue#1217.

Change-Id: I97fe28dca3c2bc2d852b1775f39c62164e032d4f
2016-05-11 14:01:21 -07:00
Alex Converse
ccf4f47b99 Merge changes I412c24aa,I28a8bbf0
* changes:
  mcomp: Remove an obsolete undef.
  mcomp: Remove an obsolete comment.
2016-05-11 20:03:21 +00:00
Yaowu Xu
a45596cff7 Merge "Added a measure of rc drift." 2016-05-11 18:02:00 +00:00
Paul Wilkins
5fd142e763 Merge "Fixed 8K two pass encoder crash." 2016-05-11 16:25:25 +00:00
paulwilkins
45df87ca57 Added a measure of rc drift.
Added actual and absolute rate miss values to the opsnr.stt
stats output line.

Changes to the borg graphing may be needed before merge.

Change-Id: I1e9d548ce445d29002f0c59ebfd3957a6f15e702
2016-05-11 15:15:07 +01:00
paulwilkins
65732c36a8 Fixed 8K two pass encoder crash.
Bug found by Yunqing relating to the correction for size at 8K and
above in get_twopass_worst_quality().

The basis for the correction was changed to the linear size relative to
1080P as a baseline and the adjustment has been clamped to prevent
problems at extreme images sizes.

For 1080P the results on our test sets were neutral but the low res and
mid res sets saw a small gain (0.1%-0.2% average).

I would also expect some gains on 4k and larger content where the
previous correction was overly aggressive.

Change-Id: I30b026b5f4535e9601e3178d738066459d19c8fb
2016-05-11 14:45:50 +01:00
Alex Converse
6dd5ec7efb mcomp: Remove an obsolete undef.
The macro was removed in 6724676.

Change-Id: I412c24aac49bd1ff60a331a30933e0d8ae3f2dd5
2016-05-10 18:04:24 -07:00
Alex Converse
7764f8af3e mcomp: Remove an obsolete comment.
This was copied over from VP8. VP9 doesn't seem to do this buffer copy.

Change-Id: I28a8bbf0503a7f99b2cb60620ab3674adde863bb
2016-05-10 18:04:24 -07:00
hui su
be3f0698b0 Add VP9 encoder API for level specification.
Add control API VP9E_SET_TARGET_LEVEL that allows the encoder to
control the output bitstream level and/or keep level related
statistics.

Usage:
               255         do not care about level (default)
               0           keep level related stats only
               10          target for level 1
               11          target for level 1.1
               .
               .
               .
               62          target for level 6.2

Usage for vpxenc:

--target-level=0/255/10/11...

Change-Id: I31d1aeca19358b893e7577b4e63748c8e614034a
2016-05-10 11:48:16 -07:00
Hui Su
e2b696c390 Merge "Fix comment for target_bandwidth in VP9 and VP10" 2016-05-10 16:34:54 +00:00
hui su
667f6320b0 Fix comment for target_bandwidth in VP9 and VP10
Unlike in VP8, it is in units of bits per second in VP9 and VP10.

Change-Id: Iee1936cc58cdfaff205624c2fe87cecdf7eda123
2016-05-09 16:43:02 -07:00
Alex Converse
f5f5ca03ca Merge "pickmode: Fix a pair of unsigned overflows." 2016-05-09 22:16:22 +00:00
Alex Converse
d8a18186ba pickmode: Fix a pair of unsigned overflows.
block_variance: This operates on 8x8s and would be safe with a int32 *
int32 to uint32 multiply, but this is potentially unsafe for 12-bit
input. Unfortunately the code already segfaults on 12-bit input:
https://bugs.chromium.org/p/webm/issues/detail?id=1223

calculate_variance: This operates on up to a 32x32 of 8x8s and can
overflow even with 8-bit input (log2((256*32*32)**2) == 36).

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1220

Change-Id: I1ca4ff6092db9a7580da371ee9a21f403fdadc40
2016-05-09 11:21:20 -07:00
Marco
36f796d2d0 vp9: 1 pass vbr: Reduce base qp for active_best_quality for inter-frames.
Reduce factor for setting base-qp for active_best_quality (for inter-frames).
Small increase in metrics on yt live set.

Change-Id: I9cf0ac797783aeddbfaf1ff510696c9035d7c5ee
2016-05-09 10:21:44 -07:00
James Zern
5e679848e8 Merge changes from topic 'missing-proto'
* changes:
  vp9_frame_scale_ssse3.c: make 2 functions static
  vp9_pickmode.c: make function static
  vp9_noise_estimate.c: make function static
  vp9_aq_360.c: add missing include
  vp9_idct_intrin_sse2: add missing vp9_rtcd.h include
  vpx_dsp/*.[hc]: add missing vpx_dsp_rtcd.h include
2016-05-06 02:25:29 +00:00
Marco Paniconi
e313fc8514 Merge "vp9: Modify logic for gf setting based on up-coming key frame." 2016-05-05 21:23:03 +00: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
1fc21052ab vp9: Modify logic for gf setting based on up-coming key frame.
For 1 pass vbr mode:
Refactor to move the logic for gf setting based on up-coming
key frames to a separate function, so same logic can be used for
scene-cuts/changes.

Change-Id: Ic4ede308e08ba869bb62e4566e19ea31222c5229
2016-05-05 09:33:27 -07:00
James Zern
272afa9a43 vp9_frame_scale_ssse3.c: make 2 functions static
downsample_2_to_1_ssse3/upsample_1_to_2_ssse3() are local to this module

Change-Id: I78a9de8e1eca475ba1bf137102580c531aa3f7dd
2016-05-04 15:10:24 -07:00
James Zern
9bfa12764c vp9_pickmode.c: make function static
set_intra_cost_penalty() is local to this module

Change-Id: Ie277bfc5e8a26f05a04fd261bdb888388ad0e2a1
2016-05-04 15:10:00 -07:00
James Zern
264c174fca vp9_noise_estimate.c: make function static
enable_noise_estimation() is local to this module

Change-Id: Id736c419387ca1959695dd327ce164bec029b597
2016-05-04 15:09:05 -07:00
James Zern
bc08689fa5 vp9_aq_360.c: add missing include
Change-Id: Ia8ac9b7023211b1da2294b0934cf076fb1cdc65f
2016-05-04 15:08:10 -07:00
James Zern
70c149db7f vp9_idct_intrin_sse2: add missing vp9_rtcd.h include
Change-Id: I39a67ffea7b0a55b45cdf935986439537b65601f
2016-05-04 15:07:27 -07:00
Marco Paniconi
f38648742a Merge "vp9-noise estimation. Decrease frame period for estimating noise." 2016-05-04 22:02:53 +00:00
Yaowu Xu
939d7d9de8 Merge "Change to use proper type in vp{9,10}_token_state" 2016-05-04 21:57:12 +00:00
Marco
ff3866dc43 vp9-noise estimation. Decrease frame period for estimating noise.
Makes the noise estimation react little faster.
Little/no change in metrics.

Change only affects 1 pass cbr.

Change-Id: I13f0daa90ecbf9d49eb1cf2e48febd9d92292940
2016-05-04 12:43:02 -07:00
Yaowu Xu
81eb71f00c Change to use proper type in vp{9,10}_token_state
"qc" in vp{9,10}_token_state is used to save quantized coefficients, this
commit changes the type from short to tran_low_t to properly reflect
the value range for highbitdepth build.

This fixes an out-of-range bug when optimize_b is used in highbitdepth
build.

Change-Id: Ibf330879e6ac6ae8f099e085caa9d3d9a889fde8
2016-05-04 12:14:11 -07:00
Alex Converse
8620dea882 variance aq: Fix a variance calculation overflow bug.
This is an actual overflow where the result of the calculation is
materially changed, not just a negative value that is stored in an
unsigned.

Caught with fsanitize=integer on the VP9/AqSegmentTest.TestNoMisMatchAQ2/1 test.

Change-Id: I514b0ef4ae7ad50e3e08c0079aa204d59fa679aa
2016-05-04 11:40:55 -07:00
Alex Converse
a309742a5f Merge "Fix unsigned overflows in temporal filter." 2016-05-03 19:11:17 +00:00
Alex Converse
f76158131d Fix unsigned overflows in temporal filter.
Change-Id: Iebdc8304d30c78f03f99f6dc665003ff41c8b1cd
2016-05-03 10:55:44 -07:00
James Bankoski
e755a283dd Merge "Move vpx_add_plane from codec to vpx_dsp and dedup." 2016-05-03 14:11:57 +00:00
Alex Converse
8307045cb5 Merge "Use signed variables in the lookahead." 2016-05-02 21:32:39 +00:00
Jacky Chen
04a6db562a Merge "vp9: Refactor vp9_denoiser_NxM_sse2." 2016-05-02 21:28:08 +00:00
JackyChen
b29612fbbe vp9: Refactor vp9_denoiser_NxM_sse2.
Denoiser is ~1.5% faster in speed 6~8.

Change-Id: I7b350f3c50cce6773d9c4eded4c0c1b722d0a5fc
2016-05-02 13:19:40 -07:00
Jim Bankoski
fce3cee8dd Move vpx_add_plane from codec to vpx_dsp and dedup.
Change-Id: I12218d8331c0558c0587a66321e3ca46da7e5cc7
2016-05-02 12:17:39 -07:00
JackyChen
136c29e3a3 vp9: Refactor choose_partitioning.
Move skin superblock force split out of this function as well
as some minor code refactors. Checked bitexact for different speed
settings and different resolutions.

Change-Id: I6078cbe88dd9ce6c0b69470a8a0a8f8d2274161b
2016-05-02 10:15:03 -07:00
Marco
7bd73b638a vp9: Move the initialization of some rc variables to rc_init.
And initialize a variable (avg_source_sad) that was not initialized to 0.

Change-Id: I63223e20fffe2a2ea38f03da62dad16af0618ea4
2016-04-28 17:10:37 -07:00
Alex Converse
94806e029d Merge "Avoid an unsigned overflow in invert_quant" 2016-04-28 19:44:03 +00:00
JackyChen
c69a141a9e vp9: Don't force block size to 8x8 in denoiser.
First, we only set use_4x4_partition for key frame where we don't
denoise; second, envision we have small partitions, we should pass the
actual block size to denoiser and make an early termination if needed.

Change-Id: I331f42046d792b17360723d17ff817d601394658
2016-04-27 22:18:11 -07:00
Alex Converse
918a2fd726 Use signed variables in the lookahead.
Wrap around behavior is enforced manually and we use the values in
arithmetic involving negative integers.

Change-Id: I199706b6f3af91f4fb6fe2ef302fbbc6d0cf5785
2016-04-27 16:01:20 -07:00
Alex Converse
d3fe3b2abb Avoid an unsigned overflow in invert_quant
Change-Id: I16a570b2af66b6580d1cd6f8345a25f079009bf4
2016-04-27 15:07:22 -07:00
Hui Su
03b6f5f8e3 Merge "VP9: adjust trellis quant optimization RD parameters" 2016-04-26 19:12:09 +00:00
Hui Su
f16cf9fbcc Merge "VP9: enable trellis quantization optimization for intra blocks" 2016-04-26 19:11:49 +00:00
Marco Paniconi
fbefe470bf Merge "vp9: Fix condition to update consec_zero_mv." 2016-04-26 18:15:27 +00:00
Jacky Chen
29ade0d3cf Merge "vp9: Simplify the logic in denoiser SSE2 code." 2016-04-26 17:43:49 +00:00
hui su
c3a9247e09 VP9: adjust trellis quant optimization RD parameters
Coding gain:
lowres  0.64%
midres  0.38%
hdres   0.58%

Change-Id: I233fa2a4b24bd1e15091a5f5ef6aff661f3f50ec
2016-04-26 10:17:38 -07:00
hui su
c8f56d2303 VP9: enable trellis quantization optimization for intra blocks
Coding gain:
lowres  0.18%
midres  0.23%
hdres   0.36%

Change-Id: I044c8afbc481fc55b23d440352941071355b0afb
2016-04-26 10:17:29 -07:00
JackyChen
1a53c0c9e1 vp9: Simplify the logic in denoiser SSE2 code.
Block size passed into denoiser filter is always >= BLOCK_8X8 (in
vp9_pick_inter_mode), it is not necessary to check smaller block
size. Passed the bitexact test on clips with different resolutions and
noise levels.

Change-Id: I19fa3195d18c27d9e5de60dc11cff1522ef3714e
2016-04-26 09:04:39 -07:00
Paul Wilkins
779840c9f4 Merge "Resolve a couple of TODOs in firstpass.c" 2016-04-26 12:57:09 +00:00
Paul Wilkins
7a4c2c7671 Merge "Experiment to adapt for net AQ offset." 2016-04-26 12:56:52 +00:00
Marco
b7e8b3cbb6 vp9: Fix consec_zero_mv in skin detection.
This was missed in https://chromium-review.googlesource.com/#/c/340135/.

Change-Id: Iafc83141f4ff744819bdbde7d239678b215feb9d
2016-04-25 15:39:15 -07:00
Marco
9f90473ef8 vp9: Fix condition to update consec_zero_mv.
Fix will reset the consec_zero_mv map on non-skipped blocks with non-zero mv.
Adjust thresholds on consec_zero_mv in noise estimation and skin detection,
as more possible reset on map means lower thresholds should be used.

Change-Id: Ibe8520057472b3609585260b51b6f95a38fb777d
2016-04-25 15:29:11 -07:00
Marco Paniconi
97d8adef82 Merge "vp9: 1 pass vbr: Adjust gf boost/interval on motion level." 2016-04-25 21:13:56 +00:00
Marco
e172e8aa26 vp9: 1 pass vbr: Adjust gf boost/interval on motion level.
Add some adjustment for high motion case.

Change-Id: If700be1ce849c187ed031221ea7cabbc8d91ec2b
2016-04-25 11:54:10 -07:00
JackyChen
57c7c11633 vp9: Fix a bug where best_sse_mv is not set properly.
In VP9 internal denoiser, motion magnitude is computed from
best_sse_mv, which should be set to 0 at the begining. This bug may
cause visual aritifact in denoiser. Also, delete two improper comments.

Change-Id: I8710d2acba23320bc85cf72af17d65245c19438b
2016-04-25 11:44:40 -07:00
Marco Paniconi
bd3c874cac Merge "vp9-denoiser: Bugfix and some adjustments for high noise case." 2016-04-25 17:16:10 +00:00
Marco
229c686c89 vp9-denoiser: Bugfix and some adjustments for high noise case.
Need to check that sse for non-zero mv has been set for the current block
(i.e., check that nonzero-mv is tested as a mode, so newmv_sse != UINT_MAX)
before forcing to not use zero-mv for denoising.

Also increase some thresholds (sse and sse_diff) for high noise case,
and use shift operaton instead of multiplication on a threshold computation.

Change-Id: Iae7339475d57240316b7fa8b887c4ee3c0d0dbec
2016-04-25 10:15:03 -07:00
Marco
8b25dd599f vp9: Add rc quantity to track amount of low motion in scene.
Use it for now in noise estimation to bypass estimation if
motion level is high.

Change-Id: I033662dc909f2060e4e81abf562a7ad262dc8170
2016-04-25 09:07:35 -07:00
Scott LaVarnway
cc5023d55f Merge "VP9: Do not call vp9_adjust_mask() in vp9_setup_mask()" 2016-04-25 13:39:29 +00:00
paulwilkins
015c43f0c1 Resolve a couple of TODOs in firstpass.c
Resolved two TODO items.

Force a minimum value of 1.0 for frame duration as per section duration.

Column inactive zone is currently set to 0 as most of the serious issues
relating to inactive regions relate to letter boxing.

Change-Id: Ifbab3acf2c089d7305620a7ff7ed7c3536cc9235
2016-04-25 12:38:10 +01:00
paulwilkins
4b590058c8 Experiment to adapt for net AQ offset.
In Aq mode 1 the segment and AQ delta for each block is based
on spatial variance. There may be a net imbalance between blocks
that have lower Q than the baseline value and those that have higher Q.

This patch monitors that imbalance and extends the allowed baseline
Q range for the frame to accommodate adjustment of that baseline value
to compensate.

Change-Id: Iae8a48c7c01fe2af94a141e149d03acf467237ca
2016-04-25 12:07:07 +01:00
Scott LaVarnway
9e0efb6008 VP9: Do not call vp9_adjust_mask() in vp9_setup_mask()
vp9_adjust_mask() is called again in loop_filter_rows().

Change-Id: If52f5339dfa7971c47b12f9e05f87951044d9391
2016-04-22 13:53:32 -07:00
Marco Paniconi
cf82222316 Merge "vp9: Some adjustments to denoiser under high-noise condition." 2016-04-22 18:55:57 +00:00
Marco
80ed9e4f5c vp9-noise estimation: Add check on whether skin detection is enabled.
Change-Id: Ie80b7a14e3505c40b5742793f84aa6fb9d21dab5
2016-04-22 10:37:00 -07:00
Marco
80bbba1494 vp9: Some adjustments to denoiser under high-noise condition.
Change-Id: Ib47d742d07f13c7c39cea85e228c19ae298baf4a
2016-04-22 10:31:19 -07:00
Marco Paniconi
2c8338f982 Merge "vp9: Move consec_zero_mv from cyclic refresh to cpi struct." 2016-04-22 17:06:31 +00: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
James Bankoski
b816eea5ef Merge "vp9_loopfilter.c : fix / clarify todo" 2016-04-21 20:40:41 +00:00
James Bankoski
2bcec13e5f Merge "vp9_loopfilter.c: Todo clean up encoder should work like decoder." 2016-04-21 20:40:35 +00:00
James Bankoski
166fc7cb43 Merge "vp9_loopfilter.c : todo cleanup" 2016-04-21 20:40:24 +00:00
Jim Bankoski
996ccc3311 vp9_loopfilter.c : fix / clarify todo
Change-Id: Ie3ec67a83d1877d3deae9c7922b6899d915aa19e
2016-04-21 20:39:56 +00:00
Jim Bankoski
6bd28a2d05 vp9_loopfilter.c: Todo clean up encoder should work like decoder.
Change-Id: I570c6859d6e18cd94ce4a29068477b937489399c
2016-04-21 20:36:39 +00:00
Jim Bankoski
1de659af06 vp9_encodemb.c: TODO clean up
huisu did in nextgen branch -> please try in vp9

Change-Id: I0ff35db07ac38464e0e2858e303be686c03a5d0e
2016-04-21 20:35:54 +00:00
Jim Bankoski
df4c95afce vp9_loopfilter.c : todo cleanup
Removed this todo because of another todo which says none of this code
should exist. It should be integrated into the block by block encode
process as per the decoder.

Change-Id: I076bd15140a060e69c014dd7d7cd07fea260aba3
2016-04-21 20:35:30 +00:00
Yaowu Xu
d179b784f9 Merge "vp9_loopfilter.c: Todo try inloop calculation." 2016-04-21 15:38:12 +00:00
Jim Bankoski
b627af0eb0 vp9_loopfilter.c: Todo try inloop calculation.
This is implemented in the decoder already.  Will add a todo for the
encoder.

Change-Id: I5e78c045cb2edb5ba171022aeeb70051a708b916
2016-04-20 23:53:20 +00:00
Marco
83f17eeede vp9: 1 pass vbr: Small fix on reset avg_intersize_gfint on scene cut.
Change-Id: Ie73d1bbc2c953d010b32097440698f0d060750be
2016-04-20 16:32:09 -07:00
Marco
8a906039a7 vp9: 1 pass vbr: small adjustment to active_best factor for inter.
Change-Id: I9c68aa9e72969b0ffbf57eb186380ff666745aeb
2016-04-20 14:25:13 -07:00
Marco
9ca6b46cef vp9: Adjust gf period for high average Q and overshoot.
For 1 pass vbr mode.
Increase the gf interval for case where average Q is close to
max and high overshoot is detected.

Small increase in overall avg_psnr/sssim metrics (~0.2/0.1%) for ytlive,
but improves the low-end (low bitrate) for several clips (less overshoot).

Change-Id: Ifba40f25b4861b2e0d9832c82d5359a6a3dce9f2
2016-04-19 17:18:11 -07:00
Marco
9cc1f692bd vp9: 1 pass vbr: More even spacing for gf near key frame.
More even spacing near key frame and avoid gf on scene cut
if its close to key frame.

Small increase in metrics for ytlive set (which uses key-period=150).
(~0.2% gain)

Change only affects 1 pass vbr mode.

Change-Id: If1e5a59baf1e0befbaf998522fbc47d94ac5b5df
2016-04-18 14:40:55 -07:00
Marco
d488236ce3 vp9: Adjustment to active_best_quality for inter_frame, 1 pass vbr.
Change only affects 1 pass vbr.

Use a q value somewhat larger (~6%) than avg_frame_qindex[INTER]
as basis for active_best_quality for inter-frames.
And use the minium of this (avg_frame_qindex) and the active_worst_quality.

This reduces some overshoot in ytlive clips.
Overall small but positive average increase in metrics (up on average ~0.2%).

Change-Id: Icdbaae7872d5675fd38a13c0ec6ce0e2e3b919ce
2016-04-18 13:01:27 -07:00
Paul Wilkins
2e0841931c Merge "Adjustment to prediction decay." 2016-04-18 18:47:13 +00:00
Scott LaVarnway
9faa0296b8 Merge "VP9: inline vp9_get_intra_inter_context()" 2016-04-15 19:06:33 +00:00
Scott LaVarnway
ef98a8f61f VP9: inline vp9_get_intra_inter_context()
Change-Id: I71366140799b9b39474b9b459082cdb250bd1905
2016-04-15 04:58:37 -07:00
Marco Paniconi
e6657f32c5 Merge "vp9: Adjustment to scene-cut detection." 2016-04-13 22:36:29 +00:00
Marco
24db57f0e1 vp9: Adjustment to scene-cut detection.
Change recursive weight for average_source_sad and
put some constraint on spacing between detected scene-cuts.

Change only affects 1 pass real-time mode.

Change-Id: I1917e748d845e244812d11aec2a9d755372ec182
2016-04-13 14:40:08 -07:00
Yunqing Wang
885872f899 Fix Visual Studio build warning
Fixed warning C4244: '-=' : conversion from 'const double' to 'int',
possible loss of data.

Change-Id: Ic4691346037767b244e7f71248c2f871f92002f3
2016-04-13 09:09:08 -07:00
Marco
6a3cf099aa vp9: Adjust threshold for scene-change detection.
For 1 pass vbr.

Change-Id: I10b7eefc36d65c30844d205e139515bec7fed6af
2016-04-12 18:28:04 -07:00
Marco Paniconi
f81b0000f6 Merge "vp9: Fix to active_best for GF/ARF in 1 pass vbr." 2016-04-12 21:18:41 +00:00
Debargha Mukherjee
ff72cca8bb Merge "Step towards making the 2-pass cq mode perceptual" 2016-04-12 19:42:06 +00:00
Marco
3861b25be1 vp9: Fix to active_best for GF/ARF in 1 pass vbr.
Correct the setting of Q basis of GF/ARF in 1 pass vbr.

Existing logic would switch to using avg_QP of key frame if
avg_QP of inter is less than active worst (even if key frame is
not last frame).

Instead fix the logic (as per the comment) to use the lower of
active_worst_quality and avg_Q for inter as basis for GF/ARF
active_best_quality (unless last frame was key frame).

Increase in metrics: AvgPSNR/SSIM up by ~0.7/0.3 on ytlive set.

Change-Id: I9a628378ec6684bfda9457ebfc2384ef6d8579f7
2016-04-12 10:37:45 -07:00
Alex Converse
a3a10a323b pickmode: only cost the skip flag once per prediction block
RTC speed 6:
File    Match   Avg     BDRate  Low     Mid     High
OVERALL ✔       -0.040  -0.045  -0.031  -0.084  0.004

Screencast speed 6:
File     Match   Avg     BDRate  Low     Mid     High
OVERALL ✔       1.115   -0.162  0.203   2.470   0.541

Change-Id: I46bbc11c89301015b5d3eac25294c709f23f0897
2016-04-11 15:39:52 -07:00
Alex Converse
5b3d3b1909 Merge "Remove obsolete segment skip checks from tokenization." 2016-04-11 18:58:32 +00:00
Paul Wilkins
1c187c4be0 Adjustment to prediction decay.
Adjustment to stop excessive prediction decay triggered by blocks
or frames with extremely low spatial complexity which rendered the
comparison of intra and inter coded errors meaningless.

This was causing much shorter than expected groups on some 4k
test content.

Change-Id: I3f2c64200ef6dcef4721fc9f2ec09e480056ffc2
2016-04-11 13:25:33 +01:00
Paul Wilkins
f659c7e99e Merge "Adjust motion component of prediction decay." 2016-04-11 10:27:30 +00:00
Paul Wilkins
c5a89b46b9 Merge "Trap very short arf group just before a kf." 2016-04-11 10:27:12 +00:00
Scott LaVarnway
ad47d1d194 Merge "VP9: Combine TileData with TileWorkerData" 2016-04-10 22:17:45 +00:00
Debargha Mukherjee
c47c460f69 Step towards making the 2-pass cq mode perceptual
Uses a metric on fraction of smooth blocks derived from first pass
stats in a frame to adjust down the cq_level modestly in the cq mode.
The current implementation does not add much complexity, and is
fairly light in the adaptation.

Change-Id: Ic484e810d5bd51b7bb6b8945f378c7c3d9d27053
2016-04-09 06:24:18 -07:00
Alex Converse
fa4ca4037e Remove obsolete segment skip checks from tokenization.
Change-Id: Iac7bc0d0eba459a04688aae224d34ae9b59742db
2016-04-08 11:38:25 -07:00
Hui Su
6a0e771555 Merge "Correct comments for scan order neighbors" 2016-04-08 18:03:22 +00:00
Marco Paniconi
989d536861 Merge "vp9-denoiser: Avoid copy-block when denoising is at LowLow level." 2016-04-08 17:51:54 +00:00
paulwilkins
81d1e7bf28 Adjust motion component of prediction decay.
Adjust the motion decay component to account for image size.
This has very little impact for smaller image sizes.

Average bdrate results for our HD test sets:-

Hdres set:  opsnr +0,92%,  Fast SSIM +1.6%
Netflix hd set:  opsnr + 1.5%, Fast SSIM +3.1%

There are a couple of notable -ve clips such as cyclist and sunflower
which seem to be better with a shorter interval but also a few very big
wins such as Jets >12% psnr 22% Fast SSIM and from the Netflix
Netflix set PierSeaside 9.7% psnr and 18.2% Fast SSIM.

Change-Id: Ie43aaedaa74331ed83d624a13548094ac64fed9e
2016-04-08 10:28:40 +01:00
Marco
f6f544278e vp9: Some adjustments to scene-cut detection.
Change only affects 1 pass vbr mode, speed >=5.
Increase min_thresh, decrease boost, and set a min/max
value for gf_interval.

Change-Id: I9c1e1a1ab0c5780064eb62714ee39a72ea4d2107
2016-04-07 14:26:15 -07:00
Scott LaVarnway
7cb4ab56ea VP9: Combine TileData with TileWorkerData
Change-Id: I83536734a54ef7b85f90f56a51878d94fac7ff22
2016-04-07 11:44:27 -07:00
hui su
69c7ad3407 Correct comments for scan order neighbors
Change-Id: I5e2dc39bf0ee8e501e4dd358be2e92ae50934593
2016-04-07 11:07:21 -07:00
Marco Paniconi
e96f0c3db3 Merge "vp9-1 pass vbr: Use average QP for active_worst_quality, for inter-frames." 2016-04-07 16:31:12 +00:00
paulwilkins
107de19698 Trap very short arf group just before a kf.
Trap the case where we end up with a very short arf group just before
a key frame. Such a group often has poor quality and may cause pulsing.

For example if the KF is 17 frames away we are better doing two mid-size
groups of 9 and 8 than a group of 15 followed by a group of 2.

This becomes more and more important when coding with a short forced
kf interval though it may not impact our standard tests much.

Change-Id: I29d83d6637b203eac69be320dd35a7401a4678c1
2016-04-07 14:56:24 +01:00
Scott LaVarnway
c93946bbc3 Merge "VP9: refactor read_switchable_interp_filter()" 2016-04-06 20:51:27 +00:00
Scott LaVarnway
25920137ec VP9: refactor read_switchable_interp_filter()
Change-Id: I8f88b7ff21a0991297860c4a744a014629b0fa05
2016-04-06 04:53:43 -07:00