Commit Graph

184 Commits

Author SHA1 Message Date
Linfeng Zhang
71b38a144e Add 2 to 1 scaling NEON optimization
BUG=webm:1419

Change-Id: I99c954ffa50a62ccff2c4ab54162916141826d9b
2017-09-07 12:33:50 -07:00
Scott LaVarnway
fa85cf131c vp9: strip temporal filter code
when CONFIG_REALTIME_ONLY is enabled.

BUG=webm:1446

Change-Id: Id547783ec75383966c40ab5cf6abb4a0f7984f52
2017-08-14 14:27:53 -07:00
Scott LaVarnway
e702b68b6c vp9: strip mb graph code
when CONFIG_REALTIME_ONLY is enabled.

BUG=webm:1446

Change-Id: I4b1b8e9a456830ba1b1bd3a8882e038d37ee7903
2017-08-11 12:59:40 -07:00
James Zern
df18412f32 remove vp9_firstpass.c w/CONFIG_REALTIME_ONLY
BUG=webm:1446

Change-Id: I6e0ea9342c715d354c641109737172afa649b85b
2017-07-11 13:10:16 -07:00
Jerome Jiang
3453c8d6c4 Merge "vp9: Neon optimization for denoiser. Add unit tests." 2017-05-06 01:28:32 +00:00
Jerome Jiang
069eedb3a0 vp9: Neon optimization for denoiser. Add unit tests.
Denoiser on Neon is 5x faster than C code.

BUG=webm:1420

Change-Id: I805ab64f809ff2137354116be6213e7ec29c1dcb
2017-05-05 16:40:52 -07:00
Johann
2ff01aa1e4 move vp9_error_intrin_avx2.c
There is only one avx2 implementation. Drop '_intrin'

Change-Id: I887a0d27d58567eaad49f749f127eca61313f312
2017-05-01 09:13:01 -07:00
Johann
6dfeea6592 vp9 temporal filter: sse4 implementation
Approximates division using multiply and shift.

Speeds up both sizes (8x8 and 16x16) by 30 times.

Fix the call sites to use the RTCD function.

Delete sse2 and mips implementation. They were based on a previous
implementation of the filter. It was changed in Dec 2015:
ece4fd5d22

BUG=webm:1378

Change-Id: I0818e767a802966520b5c6e7999584ad13159276
2017-04-26 22:03:05 -07:00
James Zern
2f31a16445 move vp9_scale_and_extend_frame_c to vp9_frame_scale.c
this is similar to the x86 configuration and helps mitigate an issue
with a circular dependency between this function and the ssse3 variant
causing an outsized increase in binary size (~300K for chrome)
chrome.dll:
.text 255B000 -> 252B000
.data 7B000 -> 75000
-221184 bytes

BUG=chromium:697956

Change-Id: Ic95b142ecd62dd4f1795788aa27dd8fab59b708c
2017-03-08 21:13:50 -08:00
Jerome Jiang
e96ab22462 Merge "Make vp9_scale_and_extend_frame_ssse3 work for hbd when bitdepth = 8." 2017-02-24 16:56:33 +00:00
Johann
904b957ae9 consolidate block_error functions
vp9_highbd_block_error_8bit_c was a very simple wrapper around
vp9_block_error_c. The SSE2 implemention was practically identical to
the non-HBD one. It was missing some minor improvements which only
went into the original version.

In quick speed tests, the AVX implementation showed minimal
improvement over SSE2 when it does not detect overflow. However, when
overflow is detected the function is run a second time. The
OperationCheck test seems to trigger this case and reverses any
speed benefits by running ~60% slower. AVX2 on the other hand is
always 30-40% faster.

Change-Id: I9fcb9afbcb560f234c7ae1b13ddb69eca3988ba1
2017-02-24 05:25:26 +00:00
Jerome Jiang
0998a146d4 Make vp9_scale_and_extend_frame_ssse3 work for hbd when bitdepth = 8.
Only works for bitdepth = 8 when compiled with high bitdepth flag.
4x speed ups for handling 1:2 down/upsampling.

Validated manually for:
1) Dynamic resize for a single layer encoding
2) SVC encoding with 3 spatial layers
Results are bitexact with the patch and the speed gain (~4x) in the
scaling was verified.

BUG=webm:1371

Change-Id: I1bdb5f4d4bd0df67763fc271b6aa355e60f34712
2017-02-23 20:40:28 -08:00
Johann
3e7aa8fda9 vp9 fdct higbd neon: connect existing highbd calls
Change-Id: Ia8f822bd6e70b3911bc433a5a750bfb6f9a3a75c
2017-02-14 22:11:49 +00:00
Johann
537949a9df block_error_fp highbd sse2: use tran_low_t for coeff
BUG=webm:1365

Change-Id: Id2ed3ebaaaa6a4b68628c23e08b64ea5f1341761
2017-02-07 15:03:28 +00:00
Ranjit Kumar Tulabandu
8b0c11c358 Multi-threading of first pass stats collection
(yunqingwang)
1. Rebased the patch. Incorporated recent first pass changes.
2. Turned on the first pass unit test.

Change-Id: Ia2f7ba8152d0b6dd6bf8efb9dfaf505ba7d8edee
2017-01-24 15:48:02 -08:00
Yury Gitman
507d272265 Move vp9_alt_ref_aq_private.h to vp9_alt_ref_aq.c
+ add a temporary dummy element to ALT_REF_AQ to avoid a warning about
an empty struct

Change-Id: Ib6e5c39ff62ad96eb4e3686d4882228a42b3843f
2016-08-27 10:53:41 -07:00
Yury Gitman
292d221fed Create interface for the ALT_REF_AQ class
Current commit is just an API template  for the rest of the code, and
I will add inner logic later.

Altref  frames  generate a  lot  of  bitrate  and  at the  same  time
other  frames  refer to  them  a  lot, so  it  makes  sense to  apply
special  compensation-based adaptive  quantization scheme  for altref
frames. E.g.,  for blocks  that are  good predictors  for the  future
apply rate-control  chosen quantizer  while for bad  predictors apply
worse one.

Change-Id: Iba3f8ec349470673b7249f6a125f6859336a47c8
2016-08-25 10:55:14 -07:00
Johann
fe96dbda15 vp9: remove x86inc.asm distinction
BUG=b:29583530

Change-Id: I952da3fc0d4716dec897be0d2e9806af6612722b
2016-06-29 18:55:28 -07: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
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
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
Scott LaVarnway
0840c6fb8f BUG FIX: undefined reference to `vp9_scale_and_extend_frame_c'
See https://bugs.chromium.org/p/webm/issues/detail?id=1145

Change-Id: I778ee07dc39a524e3f729bef47a7abeed51e0cee
2016-02-08 13:42:56 -08:00
Scott LaVarnway
989c69303d Vidyo patch: Optimization for 1-to-2 downsampling and upsampling.
Change-Id: I9cc9780f506e025aea57485a9e21f0835faf173c
2016-02-04 14:50:26 -08:00
Debargha Mukherjee
02345be986 Adding an aq mode for 360 videos
Different quality levels are used for different regions in
the frame depending on how far they are vertically from the
center. Specifically, three segments are used based on the
mi_row index with respect number to the number of mi_rows in
the frame.

Change-Id: Ifc8b777bc58ea8521dffc4640360c67d99f8d381
2016-01-13 16:17:37 -08:00
James Zern
d36659cec7 move vp9_avg to vpx_dsp
Change-Id: I7bc991abea383db1f86c1bb0f2e849837b54d90f
2015-12-14 14:42:12 -08:00
Geza Lore
5eefd3ebfd Add AVX vectorized vp9_diamond_search_sad
This function now has an AVX intrinsics version which is about 80%
faster compared to the C implementation. This provides a 2-4% total
speed-up for encode, depending on encoding parameters. The function
utilizes 3 properties of the cost function lookup table, constructed
in 'cal_nmvjointsadcost' and 'cal_nmvsadcosts'.
For the joint cost:
  - mvjointsadcost[1] == mvjointsadcost[2] == mvjointsadcost[3]
For the component costs:
  - For all i: mvsadcost[0][i] == mvsadcost[1][i]
        (equal per component cost)
  - For all i: mvsadcost[0][i] == mvsadcost[0][-i]
        (Cost function is even)
These must hold, otherwise the AVX version of the function cannot be used.

Change-Id: I6c2791d43022822a9e6ab43cd124a773946d0bdc
2015-11-11 14:03:47 +00:00
James Zern
30466f26b4 Revert "Add AVX vectorized vp9_diamond_search_sad"
This reverts commit f1342a7b07.

This breaks 32-bit builds:
 runtime error: load of misaligned address 0xf72fdd48 for type 'const
__m128i' (vector of 2 'long long' values), which requires 16 byte
alignment

+ _mm_set1_epi64x is incompatible with some versions of visual studio

Change-Id: I6f6fc3c11403344cef78d1c432cdc9147e5c1673
2015-11-06 13:15:01 -08:00
Yunqing Wang
57cae22c1e Merge "Add AVX vectorized vp9_diamond_search_sad" 2015-11-05 20:17:13 +00:00
Geza Lore
f1342a7b07 Add AVX vectorized vp9_diamond_search_sad
This function now has an AVX intrinsics version which is about 80%
faster compared to the C implementation. This provides a 2-4% total
speed-up for encode, depending on encoding parameters. The function
utilizes 3 properties of the cost function lookup table, constructed
in 'cal_nmvjointsadcost' and 'cal_nmvsadcosts'.
For the joint cost:
  - mvjointsadcost[1] == mvjointsadcost[2] == mvjointsadcost[3]
For the component costs:
  - For all i: mvsadcost[0][i] == mvsadcost[1][i]
        (equal per component cost)
  - For all i: mvsadcost[0][i] == mvsadcost[0][-i]
        (Cost function is even)
These must hold, otherwise the AVX version of the function cannot be used.

Change-Id: I184055b864c5a2dc37b2d8c5c9012eb801e9daf6
2015-11-05 10:02:17 +00:00
Marco
c7da053d4b Move noise level estimate outside denoiser.
Source noise level estimate is also useful for
setting variance encoder parameters (variance thresholds,
qp-delta, mode selection, etc), so allow it to be used also
if denoising is not on.

Change-Id: I4fe23d47607b4e17a35287057f489c29114beed1
2015-11-02 12:15:26 -08:00
Geza Lore
aa8f85223b Optimize vp9_highbd_block_error_8bit assembly.
A new version of vp9_highbd_error_8bit is now available which is
optimized with AVX assembly. AVX itself does not buy us too much, but
the non-destructive 3 operand format encoding of the 128bit SSEn integer
instructions helps to eliminate move instructions. The Sandy Bridge
micro-architecture cannot eliminate move instructions in the processor
front end, so AVX will help on these machines.

Further 2 optimizations are applied:

1. The common case of computing block error on 4x4 blocks is optimized
as a special case.
2. All arithmetic is speculatively done on 32 bits only. At the end of
the loop, the code detects if overflow might have happened and if so,
the whole computation is re-executed using higher precision arithmetic.
This case however is extremely rare in real use, so we can achieve a
large net gain here.

The optimizations rely on the fact that the coefficients are in the
range [-(2^15-1), 2^15-1], and that the quantized coefficients always
have the same sign as the input coefficients (in the worst case they are
0). These are the same assumptions that the old SSE2 assembly code for
the non high bitdepth configuration relied on. The unit tests have been
updated to take this constraint into consideration when generating test
input data.

Change-Id: I57d9888a74715e7145a5d9987d67891ef68f39b7
2015-10-21 12:30:40 +01:00
Geza Lore
0134764fa6 Optimization of 8bit block error for high bitdepth
If high bit depth configuration is enabled, but encoding in profile 0,
the code now falls back on optimized SSE2 assembler to compute the
block errors, similar to when high bit depth is not enabled.

Change-Id: I471d1494e541de61a4008f852dbc0d548856484f
2015-10-08 14:05:25 -07:00
Alex Converse
c7b7011b9b Move VP9 SSIM metrics to vpx_dsp.
Change-Id: I20c7b42631b579fade6cf7ebf6d4c69b2fcb5e5e
2015-08-06 18:25:25 -07:00
James Zern
f42012e526 Merge "add vp9_block_error_fp_neon" 2015-07-29 00:47:09 +00:00
Jingning Han
a7e9178d80 Remove vp9_dct.h file
The forward 32x32 2D-DCT functions are aligned in vpx_dsp folder.
The vp9_dct.h file is not effectively used now.

Change-Id: Ie7946b6fdd784b8e91496242337bc9002c75c281
2015-07-28 15:27:36 -07:00
Jingning Han
d19033fa4e Move DC only forward 2D-DCT functions to vpx_dsp
This completes the forward transform functions layout refactoring.

Change-Id: I996fb0fb795f41e2040f7b21db985774098aedbd
2015-07-28 14:52:30 -07:00
Jingning Han
a6a4659bea Factor 32x32 fwd DCT to vpx_dsp folder
Move the 32x32 2D-DCT implementations from vp9/ to vpx_dsp/.

Change-Id: Id3980696f8b69906ff7a59ff9fb2b9013d60047d
2015-07-28 11:13:41 -07:00
James Zern
ea990af7f5 add vp9_block_error_fp_neon
~60-70% faster depending on the block size

Change-Id: Icdbaa9977a91a63cbcc6ead0cf19d5a2af7f27e1
2015-07-27 19:59:50 -07:00
Jingning Han
8eefb36ca9 Move forward dct sse2 header file to vpx_dsp
Change-Id: Iba03852ce778c956200818e3473cfb2b48cf8d8e
2015-07-27 14:59:57 -07:00
Jingning Han
b67821f37b Factor forward 2D-DCT transforms into vpx_dsp
This commit factors the 4x4, 8x8, and 16x16 2D-DCT forward
transform operations into vpx_dsp folder.

Change-Id: I084b117b79c0925edcbcabb93f62b9f4bf8dbe7d
2015-07-22 15:48:17 -07:00
Yaowu Xu
c5ad31e518 Move bit writer files to vpx_dsp/
Change-Id: Id27e0007a0feac821ca66bcecbf3a723305da82d
2015-07-20 11:20:02 -07:00
Yunqing Wang
38f1fbbb75 Migrate quantization functions from vp9/ to vpx_dsp/
The following quantization functions were moved:
vp9_quantize_b
vp9_quantize_b_32x32
vp9_highbd_quantize_b
vp9_highbd_quantize_b_32x32

vp9_quantize_dc
vp9_quantize_dc_32x32
vp9_highbd_quantize_dc
vp9_highbd_quantize_dc_32x32

The purpose of doing that was to allow these functions to be shared
by multiple codecs.

Change-Id: Id8ab939f283353cdd07bd930d47db3d932a5d87f
2015-07-17 16:38:14 -07:00
Johann
6a82f0d7fb Move sub pixel variance to vpx_dsp
Change-Id: I66bf6720c396c89aa2d1fd26d5d52bf5d5e3dff1
2015-07-07 15:51:04 -07:00
James Zern
1696114587 Merge "mips msa vp9 subpel variance optimization" 2015-07-06 22:43:01 +00:00
Parag Salasakar
fbe67d307a mips msa vp9 subpel variance optimization
Change-Id: If88401bf8c5d8ee58200278734d7a5058d1585d0
2015-07-06 14:59:01 -07:00
Jingning Han
432cd4bfb7 Move subtract functions from vp9 to vpx_dsp
Factor out the subtraction operator as common function.

Change-Id: I526e703477c6a290e0e3e3c8898f8bb1ca82779b
2015-07-06 12:22:47 -07:00
James Zern
97946622c0 Revert "mips msa vp9 subpel variance optimization"
This reverts commit a42df86c03.

this change causes MSA/VP9SubpelVarianceTest.Ref and
MSA/VP9SubpelVarianceTest.ExtremeRef failures under
mips32r5el-msa-linux-gnu and mips64r6el-msa-linux-gnu

Change-Id: I40b71a0b774eaeb31f66f795733f95cf360909f7
2015-07-02 12:06:51 -07:00
Johann
ff8505a54d Fix --disable-use-x86inc
Change-Id: I374fcd8fb45a6893dcdeac6896671be142a99f06
2015-07-01 13:15:51 -07:00
Parag Salasakar
a42df86c03 mips msa vp9 subpel variance optimization
average improvement ~3x-5x

Change-Id: I4cbba2711467b0e205904769ebbb4a1fcbb1a311
2015-07-01 07:51:34 +05:30