Commit Graph

9294 Commits

Author SHA1 Message Date
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
paulwilkins
af3b0de732 Add casting to fix warning.
Frame bits can safely be stored int but group bits
(kf or arf) use 64bit.

Change-Id: I0800f2a28070f8749110a95721c116fc56987885
2016-08-17 11:18:07 +01:00
paulwilkins
ab7cd6d068 Add {} to try and keep Jenkins happy.
Change-Id: If1ca3cf83e058317c9751d7da6caa7cd75eb6845
2016-08-17 11:17:36 +01:00
paulwilkins
5d881770e5 Change default recode rule for good speed 0 and best.
Changes the default recode rule for Speed 0 and best quality
from ALLOW_RECODE to ALLOW_RECODE_KFARFGF.

Tested on the NF, hdres, midres and lowres test sets, this setting
when combined with patch I40cb559... now performs "as well" in
metrics terms (in fact it came out a tiny amount better overall)
but encode time is 9.6%  faster (measured as the average
from 27 mid rate local encodes on clips in the derf/lowres set.

Change-Id: I8c781c0cdfa3a9929cd9406d15582fce47d6ae3b
2016-08-15 10:52:54 +01:00
paulwilkins
de3b769524 Change to recode rules.
Allow recodes for the first inter frame in each arf group
even when the recode rule is set to ALLOW_RECODE_KFARFGF.

Small gains of 0.05%.

Change-Id: I40cb559d36a2bf0ebf5cf758c3f92e452b480577
2016-08-15 10:52:02 +01:00
Paul Wilkins
fe4dd4f43f Merge "Modified ARF group allocation." 2016-08-15 09:42:30 +00:00
Yunqing Wang
a413dbe594 Fix another motion vector out of range bug
This patch fixed a motion vector out of range bug:
vpxenc: ../libvpx/vp9/encoder/vp9_mcomp.c:69:
 mv_cost: Assertion `mv->col >= -((1 << (11 + 1 + 2)) - 1) &&
 mv->col < ((1 << (11 + 1 + 2)) - 1)' failed.

For blocks that returned without having full-pixel search, the original
MV limits were not restored, which caused the failure. Moved the set
MV limit function down to fix the bug.

Change-Id: Id7d798fc7214e95c6e4846c588f0233fcf1a4223
2016-08-12 09:27:58 -07:00
paulwilkins
656f4a88cf Modified ARF group allocation.
Small average gains in the range 0.05 - 0.1

Change-Id: I30e85c04be615cc84726427c5057388b20a6ff60
2016-08-10 14:22:01 -07:00
Alex Converse
941fe20336 Merge "Refactor mv limits." 2016-08-09 17:12:50 +00:00
Yury Gitman
c37d012ada Merge "Add cpi parameter for forcing segmentation update" 2016-08-08 21:29:42 +00:00
Yury Gitman
7a730d5901 Add cpi parameter for forcing segmentation update
Change-Id: I1b0bcb1ffe7604117bfaa0b9989d0e25ff04d28c
2016-08-08 13:20:42 -07:00
Alex Converse
6554333b59 Refactor mv limits.
Change-Id: Ifebdc9ef37850508eb4b8e572fd0f6026ab04987
2016-08-08 11:54:00 -07:00
Yunqing Wang
6a8d4631a8 Merge "Fix a motion vector out of range bug" 2016-08-08 17:59:50 +00:00
James Zern
19d2e73dea Merge changes Ice037acb,I806af11b,I344a7dd0,Ib7cb87fa
* changes:
  vp9: normalize vpx_enc_frame_flags_t usage
  args.c: add some explicit casts
  webmdec: quiet -Wshorten-64-to-32 warning
  test/decode_test_driver: rm unused deadline member
2016-08-06 01:20:52 +00:00
Yunqing Wang
2fb826c4d5 Fix a motion vector out of range bug
This patch fixed a motion vector(MV) out of range bug, which was caused
by not restoring the original values of the MV min/max thresholds after
the sub8x8 full pixel motion search. It occurred rarely and only was seen
while encoding a 4k clip for 200 frames.

BUG=webm:1271

Change-Id: Ibc4e0de80846f297431923cef8a0c80fe8dcc6a5
2016-08-05 15:23:05 -07:00
James Zern
7104833085 vp9: normalize vpx_enc_frame_flags_t usage
quiets -Wshorten-64-to-32 warnings

Change-Id: Ice037acb675d1d81bfedf2dfcfa91a8a29a19dfd
2016-08-04 23:37:49 -07:00
Johann Koenig
57f49db81f Merge changes I6ef79702,Id332c641,I354b5d22,I84438013
* changes:
  Use common transpose for vpx_idct32x32_1024_add_neon
  Use common transpose for vpx_idct8x8_[12|64]_add_neon
  Use common transpose for vp9_iht8x8_add_neon
  Use common transpose for vpx_idct16x16_[10|256]_add_neon
2016-08-04 22:30:47 +00:00
Johann
7103b5307d Use common transpose for vp9_iht8x8_add_neon
Change-Id: I354b5d22130d76b0eceda0748db1f871f58fa372
2016-08-04 20:13:03 +00:00
James Zern
70a7885a65 correct break placement
these should be placed within {}s when present

Change-Id: Ia775fac5373603e77360398f19b07958fb43f476
2016-08-04 13:00:14 -07:00
clang-format
3a4002b94d vp9_ratectrl.c: apply clang-format
after:
ff0a87c vp9 1pass vbr: Adjustment to gf interval.

Change-Id: I1296e53e601bf0c2b562e3a34082ac45c294a5f1
2016-08-04 11:57:00 -07:00
Marco Paniconi
9fdeeaf411 Merge "vp9 1pass vbr: Adjustment to gf interval." 2016-08-04 17:50:55 +00:00
Yaowu Xu
7a79fa1362 Fix msvc compiler warnings
MSVC 2013 complained about using 32 shift where 64 bit shift should be
used.

Change-Id: I7a2b165d1a92d3c0a91dd4511b27aba7709b5e55
2016-08-03 18:33:06 -07:00
Marco
ff0a87ce38 vp9 1pass vbr: Adjustment to gf interval.
Increase the minimum distance.
Reduces the overshoot somewhat on some clips,
small gain in avgPSNR (~0.1%) on ytlive set.

Change-Id: Id5ddde20c2907dbdb536e79542eff775019c142b
2016-08-03 15:36:27 -07:00
clang-format
08131055e4 vp9/decoder,vp9/*.[hc]: apply clang-format
Change-Id: Ic38ea06c7b2fb3e8e94a4c0910e82672a1acaea7
2016-08-03 14:29:31 -07:00
clang-format
8ff40f8bec vp9/common: apply clang-format
Change-Id: Ie0f150fdcfcbf7c4db52d3a08bc8238ed1c72e3b
2016-08-02 18:27:07 -07:00
clang-format
e0cc52db3f vp9/encoder: apply clang-format
Change-Id: I45d9fb4013f50766b24363a86365e8063e8954c2
2016-08-02 16:47:11 -07:00
Yaowu Xu
039f9e08f0 change HBD pixel value from uint8_t to uint16_t
This fixes a regression in 10/12 bit encoding results.

Change-Id: I438877352a41aae0a864a8d9979afe4aa2061d81
2016-08-02 11:01:39 -07:00
Yaowu Xu
dc5618f3bb Add pointer conversion for HBD buffers
This fixes a crash in HBD build.

Change-Id: I7f688f50227323e69bba65df0d56f4360f01771b
2016-08-01 15:56:43 -07:00
Alex Converse
004eebed31 Merge "Unfork 8-bit in HBD path in vp9_model_rd_from_var_lapndz callers." 2016-08-01 16:42:39 +00:00
Alex Converse
2c3807b89f Merge "Cache optimizations in optimize_b()." 2016-08-01 16:30:05 +00:00
Alex Converse
e446ffda45 Cache optimizations in optimize_b().
Move best index into the token state. Shrink it down to one byte. This
is more cache friendly (access are group together) and uses less total
memory.

Results in 4% fewer cycles in optimize_b().

Change-Id: I75db484fb3dc82f59928d54b659d79c80ee40452
2016-07-29 12:06:49 -07:00
Jacky Chen
462a7c9f0a Merge "vp9 svc: Enable different speed setting for each spatial layer." 2016-07-28 20:21:30 +00:00
Alex Converse
4508eb3123 Merge "Fix 64 to 32 narrowing warning." 2016-07-28 16:36:46 +00:00
Alex Converse
335cf67d8b Fix 64 to 32 narrowing warning.
- Solves potential integer overflow on 12-bit
- Fixes Visual Studio build

Change-Id: I26dd660451bbab23040e4123920d59e82585795c
2016-07-27 12:40:23 -07:00
JackyChen
47cc64cdf8 vp9 denoiser: Derefencing pointer should be after null check.
BUG=webm:1267

Change-Id: I899fc9e8d784c6eefcbe27945c619845adb7b6f0
2016-07-26 17:31:17 -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
Alex Converse
1c85230344 Merge "Only consider visible 4x4s in pixel domain error." 2016-07-26 19:39:54 +00:00
jackychen
8ce67d714a vp9 svc: Enable different speed setting for each spatial layer.
This change only affects 1 pass cbr svc mode.

Change-Id: If0da87bb200f7e7762755340c40c8157cc7a16ca
2016-07-25 15:11:43 -07:00
Alex Converse
d6c5ef4557 Only consider visible 4x4s in pixel domain error.
BDRATE change
derf144: -0.327
lowres: -0.048
midres: -0.125
hdres: -0.238

Change-Id: I789aba9870b5c2952373a7dd4fc8ed45590c3c54
2016-07-25 21:44:06 +00:00
James Zern
7aa0c748b3 Merge "vp9: fix frame-level threaded decode shutdown" 2016-07-25 19:00:37 +00:00
Alex Converse
511bf49b7e Merge "Minor skip segment simplification." 2016-07-25 17:50:43 +00:00
Scott LaVarnway
ad5fea03e6 Merge "VP9: get_pred_context_switchable_interp() -- encoder side" 2016-07-25 11:58:24 +00:00
James Zern
f368f86df6 vp9: fix frame-level threaded decode shutdown
Shutdown all threads before reclaiming any memory. The frame-level
parallel decoder may access data from another worker.

BUG=webm:1259

Change-Id: I26856ebd1f77cc4a4545331baa19bbf3e01c4ea4
2016-07-23 10:59:15 -07:00
Alex Converse
9a62ecbd35 Minor skip segment simplification.
Change-Id: I34863fce1abe94f9539e9a5a6149ae1efb6501bd
2016-07-22 15:31:18 -07:00
Marco Paniconi
53db633349 Merge "vp9 1pass-vbr: Adjust gf setting for nonzero-lag case." 2016-07-22 21:27:05 +00:00
Marco
c06a4b9df2 vp9 1pass-vbr: Adjust gf setting for nonzero-lag case.
Change-Id: I230c586c6d5ae56ee9a6d37b7d9452351bb4bd80
2016-07-22 11:48:09 -07:00
Paul Wilkins
830fa866a5 Merge "Sample points to reduce encode overhead." 2016-07-22 09:27:34 +00:00
Paul Wilkins
063e4a2914 Merge "Noise energy Experiment in first pass." 2016-07-22 09:27:19 +00:00
Scott LaVarnway
c969b2b02b VP9: get_pred_context_switchable_interp() -- encoder side
Change-Id: I7217c90d5cf38c51b76759a2dc4f10070f3a40ac
2016-07-21 11:47:51 -07:00
jackychen
71f9cbcfc8 vp9: Fix the clang warning of unsigned int type.
Change-Id: I6308db16bd626fa5943925471e9171f567669350
2016-07-20 15:58:35 -07:00
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