platform/upstream/libvpx.git
2 years agoregister_state_check.h: add compiler barrier
James Zern [Mon, 25 Apr 2022 22:12:02 +0000 (15:12 -0700)]
register_state_check.h: add compiler barrier

around ASM_REGISTER_STATE_CHECK() this helps keep the call ordering
consistent avoiding some code reordering which may affect the registers
being checked

fixes issue with armv7 and multiple versions of gcc:
[ RUN      ] C/AddNoiseTest.CheckNoiseAdded/0
test/register_state_check.h:116: Failure
Expected equality of these values:
  pre_store_[i]
    Which is: 0
  post_store[i]
    Which is: 4618441417868443648

Bug: webm:1760
Change-Id: Ib8bcefd2c4d263f9fc4d4b4d4ffb853fe89d1152
Fixed: webm:1760

2 years agoadd_noise_test.cc: remove stale TODO
James Zern [Mon, 25 Apr 2022 18:20:48 +0000 (11:20 -0700)]
add_noise_test.cc: remove stale TODO

this was completed in:
0dc69c70f postproc : fix function parameters for noise functions.

Change-Id: I84f789ca333e9690e70e696d44475dd59339593b

2 years agovp9[loongarch]: Optimize horizontal/vertical_4/dual
yuanhecai [Sun, 3 Apr 2022 10:49:52 +0000 (18:49 +0800)]
vp9[loongarch]: Optimize horizontal/vertical_4/dual

1. vpx_lpf_horizontal_4_lsx
2. vpx_lpf_vertical_4_lsx
3. vpx_lpf_horizontal_4_dual_lsx
3. vpx_lpf_vertical_4_dual_lsx

Bug: webm:1755

Change-Id: I12e9f27cafd9514b24cfbf2354cc66c7d1238687

2 years agovp9[loongarch]: Optimize convolve8_avg_vert/convolve_copy
yuanhecai [Mon, 18 Apr 2022 08:21:04 +0000 (16:21 +0800)]
vp9[loongarch]: Optimize convolve8_avg_vert/convolve_copy

1. vpx_convolve8_avg_vert_lsx
2. vpx_convolve_copy_lsx
3. vpx_idct32x32_135_add_lsx

Bug: webm:1755

Change-Id: I6bdfe5836a91a5e361ab869b26641e86c5ebb68d

2 years agovp9[loongarch]: Optimize vertical/horizontal_8_dual
yuanhecai [Mon, 18 Apr 2022 08:17:17 +0000 (16:17 +0800)]
vp9[loongarch]: Optimize vertical/horizontal_8_dual

1. vpx_lpf_vertical_8_dual_lsx
2. vpx_lpf_horizontal_8_dual_lsx

Bug: webm:1755

Change-Id: I354df02cc215f36b4edf6558af0ff7fd6909deac

2 years agoMerge "vp8_decode: free mt buffers early on resolution change" into main
James Zern [Fri, 22 Apr 2022 00:16:28 +0000 (00:16 +0000)]
Merge "vp8_decode: free mt buffers early on resolution change" into main

2 years agofdct16x16_neon.h,cosmetics: fix include-guard case
James Zern [Wed, 20 Apr 2022 02:26:37 +0000 (19:26 -0700)]
fdct16x16_neon.h,cosmetics: fix include-guard case

Change-Id: I593735bb7f88d63f2ddab57484099479c8759a3d

2 years agovp8_decode: free mt buffers early on resolution change
James Zern [Wed, 20 Apr 2022 00:24:26 +0000 (17:24 -0700)]
vp8_decode: free mt buffers early on resolution change

this avoids a desynchronization of mb_rows if an allocation prior to
vp8mt_alloc_temp_buffers() fails and the decoder is then destroyed

Bug: webm:1759
Change-Id: I75457ef9ceb24c8a8fd213c3690e7c1cf0ec425f

2 years agowebmdec: fix double free
James Zern [Tue, 19 Apr 2022 02:10:11 +0000 (19:10 -0700)]
webmdec: fix double free

when no frames were decoded, for example due to a decoder initialization
failure, an orphan buffer pointer from webm_guess_framerate() via
webm_read_frame() would have been freed during cleanup

Change-Id: I6ea3defdd13dd75427f79c516e207b682391e4fa

2 years agovp9_dx_iface,init_buffer_callbacks: return on alloc failure
James Zern [Tue, 19 Apr 2022 02:07:39 +0000 (19:07 -0700)]
vp9_dx_iface,init_buffer_callbacks: return on alloc failure

use an error code as a jmp target is not currently set in init_decoder()

Change-Id: If7798039439f13c739298a8a92a55aaa24e2210c

2 years agovp9_encoder: check context buffer allocations
James Zern [Tue, 19 Apr 2022 01:59:57 +0000 (18:59 -0700)]
vp9_encoder: check context buffer allocations

previously the returns for alloc_context_buffers_ext() and
vp9_alloc_context_buffers() were ignored which would result in a NULL
access during encoding should they fail

Change-Id: Icd76576f3d5f8d57697adc9ae926a3a5be731327

2 years agovp9_alloc_internal_frame_buffers: fix num buffers assignment
James Zern [Tue, 19 Apr 2022 01:57:51 +0000 (18:57 -0700)]
vp9_alloc_internal_frame_buffers: fix num buffers assignment

avoid setting num_internal_frame_buffers until the allocation is
checked, avoiding an invalid access in vp9_free_internal_frame_buffers()

Change-Id: I28a544a2553d62a6b5cb7c45bf10591caa4ebab6

2 years agovp9_alloccommon: add missing pointer checks
James Zern [Tue, 19 Apr 2022 01:56:49 +0000 (18:56 -0700)]
vp9_alloccommon: add missing pointer checks

in vp9_free_ref_frame_buffers() and vp9_free_context_buffers(); pool and
free_mi may be NULL due to earlier allocation failures

Change-Id: I3bd26ea29b3aea6c58f33d5b7f5a280eb6250ec7

2 years agoMerge changes If8318068,I21519b5b into main
James Zern [Tue, 19 Apr 2022 00:16:29 +0000 (00:16 +0000)]
Merge changes If8318068,I21519b5b into main

* changes:
  temporal_filter_sse4,cosmetics: fix some typos
  temporal_filter_sse4: remove unused function params

2 years agotemporal_filter_sse4,cosmetics: fix some typos
James Zern [Thu, 14 Apr 2022 20:08:58 +0000 (13:08 -0700)]
temporal_filter_sse4,cosmetics: fix some typos

Change-Id: If8318068a32da52d15c0ba595f80092611f4c847

2 years agoMerge "Upgrade GoogleTest to v1.11.0" into main
James Zern [Mon, 18 Apr 2022 18:10:30 +0000 (18:10 +0000)]
Merge "Upgrade GoogleTest to v1.11.0" into main

2 years agoUpgrade GoogleTest to v1.11.0
James Zern [Fri, 15 Apr 2022 23:45:26 +0000 (16:45 -0700)]
Upgrade GoogleTest to v1.11.0

The release tag is release-1.11.0.

Ref: https://aomedia-review.googlesource.com/c/aom/+/156641
79c98a122 Upgrade GoogleTest to v1.11.0

Note the tree structure differs from libaom, but is left untouched to
avoid breaking test include paths in this commit.

Change-Id: Ia3c6861d45a3befc2decb1da5b1018bcfd38f95a

2 years agovp8,get_sub_mv_ref_prob: change arguments to uint32_t
James Zern [Sat, 16 Apr 2022 05:29:31 +0000 (22:29 -0700)]
vp8,get_sub_mv_ref_prob: change arguments to uint32_t

this matches the call with int_mv::as_int and fixes a warning with
clang-13 -fsanitize=integer:
vp8/decoder/decodemv.c:240:32: runtime error: implicit conversion from
type 'uint32_t' (aka 'unsigned int') of value 4282515456 (32-bit,
unsigned) to type 'int' changed the value to -12451840 (32-bit, signed)

Bug: webm:1759
Change-Id: I7c0aa72baa45421929afac26566e149adc6669d7

2 years agovp8: fix some implicit unsigned -> int conversions
James Zern [Sat, 16 Apr 2022 05:23:05 +0000 (22:23 -0700)]
vp8: fix some implicit unsigned -> int conversions

fixes some warnings with clang-13 -fsanitize=integer:
vp8/decoder/threading.c:77:27: runtime error: implicit conversion
from type 'unsigned int' of value 4294967295 (32-bit, unsigned) to type
'int' changed the value to -1 (32-bit, signed)

these bitmask constants were missed in:
1676cddaa vp8: fix some implicit signed -> unsigned conv warnings

Bug: webm:1759
Change-Id: I5d894d08fd41e32b91b56a4d91276837b3415ee4

2 years agoMerge changes I9c24f75e,I83bce11c into main
James Zern [Sat, 16 Apr 2022 04:51:13 +0000 (04:51 +0000)]
Merge changes I9c24f75e,I83bce11c into main

* changes:
  vp9[loongarch]: Optimize idct32x32_1024/1/34_add
  vp9[loongarch]: Optimize vpx_fdct32x32/32x32_rd

2 years agoMerge "Fix int overflow in intermediate calculation" into main
Jerome Jiang [Fri, 15 Apr 2022 14:51:37 +0000 (14:51 +0000)]
Merge "Fix int overflow in intermediate calculation" into main

2 years agovp9[loongarch]: Optimize idct32x32_1024/1/34_add
yuanhecai [Thu, 14 Apr 2022 03:30:55 +0000 (11:30 +0800)]
vp9[loongarch]: Optimize idct32x32_1024/1/34_add

1. vpx_idct32x32_1024_add_lsx
2. vpx_idct32x32_34_add_lsx
3. vpx_idct32x32_1_add_lsx

Bug: webm:1755

Change-Id: I9c24f75e0d93613754d8e30da7e007b8d1374e60

2 years agovp9[loongarch]: Optimize vpx_fdct32x32/32x32_rd
yuanhecai [Wed, 16 Mar 2022 06:16:33 +0000 (14:16 +0800)]
vp9[loongarch]: Optimize vpx_fdct32x32/32x32_rd

1. vpx_fdct32x32_lsx
2. vpx_fdct32x32_rd_lsx

Bug: webm:1755

Change-Id: I83bce11c0d905cf137545a46cd756aef9cedce47

2 years agotemporal_filter_sse4: remove unused function params
James Zern [Thu, 14 Apr 2022 05:24:08 +0000 (22:24 -0700)]
temporal_filter_sse4: remove unused function params

this clears warnings under clang-13 of the form:
../vp9/encoder/x86/temporal_filter_sse4.c:275:39: warning: parameter
'u_pre' set but not used [-Wunused-but-set-parameter]

Change-Id: I21519b5b0b9c21b04b174327415e0e73b56bdfda

2 years agoFix int overflow in intermediate calculation
Jerome Jiang [Wed, 6 Apr 2022 16:46:57 +0000 (09:46 -0700)]
Fix int overflow in intermediate calculation

This is not a complete fix to webm:1751.

Bug: webm:1751
Change-Id: Ieed6c823744f5f0625d529db3746cfe4f549c8c0

2 years agoMerge "vp9,update_mbgraph_frame_stats: rm unused variables" into main
James Zern [Thu, 14 Apr 2022 17:28:52 +0000 (17:28 +0000)]
Merge "vp9,update_mbgraph_frame_stats: rm unused variables" into main

2 years agovp9,update_mbgraph_frame_stats: rm unused variables
James Zern [Thu, 14 Apr 2022 05:16:30 +0000 (22:16 -0700)]
vp9,update_mbgraph_frame_stats: rm unused variables

this quiets warnings under clang-13 of the form:
../vp9/encoder/vp9_mbgraph.c:222:42: warning: variable 'gld_y_offset'
set but not used [-Wunused-but-set-variable]

Change-Id: I32170b90c07058f780b4e8100ee5217232149db8

2 years agovp8,define_gf_group: remove unused variable
James Zern [Thu, 14 Apr 2022 05:14:33 +0000 (22:14 -0700)]
vp8,define_gf_group: remove unused variable

this clears a warning under clang-13:
vp8/encoder/firstpass.c:1634:10: warning: variable
'mod_err_per_mb_accumulator' set but not used
[-Wunused-but-set-variable]

Change-Id: I694a99d56724be89090e01c45559237c0fda147a

2 years agoUpdate loongson_intrinsics.h from v1.0.5 to v1.2.1
yuanhecai [Thu, 31 Mar 2022 07:01:30 +0000 (15:01 +0800)]
Update loongson_intrinsics.h from v1.0.5 to v1.2.1

Bug: webm:1755

Change-Id: Ib636d2aa521332b76b6aa1b0aa0a9005aafbf32b

2 years agovp9[loongarch]: Optimize vpx_variance64x64/32x32
yuanhecai [Sat, 19 Mar 2022 02:44:27 +0000 (10:44 +0800)]
vp9[loongarch]: Optimize vpx_variance64x64/32x32

1. vpx_variance64x64_lsx
2. vpx_variance32x32_lsx

Bug: webm:1755

Change-Id: I45c5aa94cbbf7128473894a990d931acaa40e102

2 years agovp9[loongarch]: Optimize sad64x64/32x32/16x16
yuanhecai [Tue, 15 Mar 2022 08:15:36 +0000 (16:15 +0800)]
vp9[loongarch]: Optimize sad64x64/32x32/16x16

1. vpx_sad64x64x4d_lsx
2. vpx_sad32x32x4d_lsx
3. vpx_sad16x16x4d_lsx
4. vpx_sad64x64_lsx
5. vpx_sad32x32_lsx

Bug: webm:1755

Change-Id: Ief71c2216f697b261d7c1fc481c89c9f1a6098e6

2 years agoMerge "vpxdec: add some allocation checks" into main
James Zern [Mon, 11 Apr 2022 20:28:44 +0000 (20:28 +0000)]
Merge "vpxdec: add some allocation checks" into main

2 years agovpxdec: add some allocation checks
James Zern [Mon, 11 Apr 2022 18:41:19 +0000 (11:41 -0700)]
vpxdec: add some allocation checks

see also: https://crbug.com/aomedia/3244

Change-Id: I7d151e63a91b8c1a5ee4e861f0b8461eeece6a2f

2 years agorate_hist,show_histogram: fix crash w/0 buckets
James Zern [Mon, 11 Apr 2022 18:08:12 +0000 (11:08 -0700)]
rate_hist,show_histogram: fix crash w/0 buckets

this can occur if 0 frames are encoded, e.g., due to --skip

see also: https://crbug.com/aomedia/3243

Change-Id: I791d5ad6611dbcb60d790e6b705298328ec48126

2 years agoMerge "L2E: Make SimpleEncode take vp9 level as an input" into main
Cheng Chen [Tue, 5 Apr 2022 18:25:23 +0000 (18:25 +0000)]
Merge "L2E: Make SimpleEncode take vp9 level as an input" into main

2 years agoMerge changes I0b6520be,I1f006daa,I7ee8e367 into main
James Zern [Tue, 5 Apr 2022 02:52:06 +0000 (02:52 +0000)]
Merge changes I0b6520be,I1f006daa,I7ee8e367 into main

* changes:
  vp9[loongarch]: Optimize vpx_convolve8_avg_horiz_c
  vp8[loongarch]: Optimize dequant_idct_add_y/uv_block
  loongarch: Fix bugs

2 years agoMerge "remove unused vp8_encode_intra parameter" into main
Johann Koenig [Mon, 4 Apr 2022 00:59:23 +0000 (00:59 +0000)]
Merge "remove unused vp8_encode_intra parameter" into main

2 years agoMerge changes I4c63beeb,I28f3b98f into main
James Zern [Thu, 31 Mar 2022 21:54:24 +0000 (21:54 +0000)]
Merge changes I4c63beeb,I28f3b98f into main

* changes:
  Revert "quantize: replace highbd versions"
  Revert "quantize: remove highbd version"

2 years agoMerge "subpel variance: add speed test" into main
Johann Koenig [Thu, 31 Mar 2022 21:43:47 +0000 (21:43 +0000)]
Merge "subpel variance: add speed test" into main

2 years agoRevert "quantize: replace highbd versions"
James Zern [Thu, 31 Mar 2022 19:11:01 +0000 (12:11 -0700)]
Revert "quantize: replace highbd versions"

This reverts commit 2200039d33c49a9f7a5c438656df143755b022c4.

This causes failures with VP9/EndToEndTestLarge.EndtoEndPSNRTest/*; it
seems the assembly does not match the C code.

Bug: webm:1586
Change-Id: I4c63beebf88d4c12789d681b0d38014510b147fe

2 years agoRevert "quantize: remove highbd version"
James Zern [Thu, 31 Mar 2022 19:10:03 +0000 (12:10 -0700)]
Revert "quantize: remove highbd version"

This reverts commit 89cfe3835c47dabf77d38edb3af190155984fa9a.

This is a prerequisite for reverting
2200039d33c49a9f7a5c438656df143755b022c4 which causes high bitdepth test
failures

Bug: webm:1586
Change-Id: I28f3b98f3339f3573b1492b88bf733dade133fc0

2 years agovp9[loongarch]: Optimize vpx_convolve8_avg_horiz_c
yuanhecai [Wed, 30 Mar 2022 06:04:10 +0000 (14:04 +0800)]
vp9[loongarch]: Optimize vpx_convolve8_avg_horiz_c

1. vpx_convolve8_avg_horiz_lsx

Bug: webm:1755

Change-Id: I0b6520be0afa1689da329f56ec6cd95c1730250c

2 years agovp8[loongarch]: Optimize dequant_idct_add_y/uv_block
yuanhecai [Mon, 28 Mar 2022 09:12:57 +0000 (17:12 +0800)]
vp8[loongarch]: Optimize dequant_idct_add_y/uv_block

1. vp8_dequant_idct_add_uv_block_lsx
2. vp8_dequant_idct_add_y_block_lsx

Bug: webm:1755

Change-Id: I1f006daaefb2075b422bc72a3f69c5abee776e2e

2 years agoloongarch: Fix bugs
yuanhecai [Tue, 22 Mar 2022 05:58:50 +0000 (13:58 +0800)]
loongarch: Fix bugs

Fix bugs from loopfilter_filters_lsx.c, vpx_convolve8_avg_lsx.c

Bug: webm:1755

Change-Id: I7ee8e367d66a49f3be10d7e417837d3b6ef50bdb

2 years agoMerge "quantize: remove highbd version" into main
Johann Koenig [Thu, 31 Mar 2022 05:45:23 +0000 (05:45 +0000)]
Merge "quantize: remove highbd version" into main

2 years agoquantize: remove highbd version
Johann [Wed, 30 Mar 2022 06:33:40 +0000 (15:33 +0900)]
quantize: remove highbd version

The only difference between the code is the clamp. For
8 bit it is purely an optimization. The values outside
this range will still saturate.

Change-Id: I2a770b140690d99e151b00957789bd72f7a11e13

2 years agoremove unused vp8_encode_intra parameter
Johann [Mon, 4 Nov 2019 21:58:07 +0000 (15:58 -0600)]
remove unused vp8_encode_intra parameter

Follow it up and also remove it from other functions.

BUG=webm:1612

Change-Id: I9d3cb785ab0d68c6fcae185043c896d8a135e284

2 years agoMerge "Optimize FHT functions for NEON" into main
James Zern [Thu, 31 Mar 2022 01:53:51 +0000 (01:53 +0000)]
Merge "Optimize FHT functions for NEON" into main

2 years agosubpel variance: add speed test
Johann [Thu, 31 Mar 2022 01:43:29 +0000 (10:43 +0900)]
subpel variance: add speed test

Was used to verify assembly speed versus an attempt to rewrite
in intrinsics.

Change-Id: I011fe5494334b8fcda04b9d54c6093dbcfc55710

2 years agoMerge "remove sad x3,x8 specializations" into main
Johann Koenig [Thu, 31 Mar 2022 00:45:31 +0000 (00:45 +0000)]
Merge "remove sad x3,x8 specializations" into main

2 years agoquantize: replace highbd versions
Johann [Wed, 30 Mar 2022 05:57:46 +0000 (14:57 +0900)]
quantize: replace highbd versions

The optimized quantize functions were already built to handle
highbd values. The only difference is the clamping. All highbd
functions expand to 32bits when running in highbd mode.

Removes vpx_highbd_quantize_32x32_sse2 as it is slower than the
C version in the worst case.

Bug: webm:1586
Change-Id: I49bf8a6a2041f78450bf43a4f655c67656b0f8d9

2 years agoL2E: Make SimpleEncode take vp9 level as an input
Cheng Chen [Wed, 30 Mar 2022 22:47:17 +0000 (15:47 -0700)]
L2E: Make SimpleEncode take vp9 level as an input

Level conformance is standadized in vp9.
If a specific target level is set, the vp9 encoder is required to
produce conformant bitstream with limit on frame size, rate,
min alt-ref distance, etc.

This change makes the SimpleEncode environment take the target level
as an input.

To make existing tests pass, we set the level to 0.

Change-Id: Ia35224f75c2fe50338b5b86a50c84355f5daf6fd

2 years agoOptimize FHT functions for NEON
Konstantinos Margaritis [Wed, 16 Mar 2022 14:27:27 +0000 (16:27 +0200)]
Optimize FHT functions for NEON

[NEON]
Optimize vp9_fht4x4, vp9_fht8x8, vp9_fht16x16 for NEON

Following change #3516278, the improvement for these functions is:

Before:
     4.10%     0.75%  vpxenc   vpxenc              [.] vp9_fht16x16_c
     2.93%     0.65%  vpxenc   vpxenc              [.] vp9_fht8x8_c
     0.93%     0.77%  vpxenc   vpxenc              [.] vp9_fht4x4_c

And after the patch:

     0.69%     0.16%  vpxenc   vpxenc              [.] vp9_fht16x16_neon
     0.28%     0.28%  vpxenc   vpxenc              [.] vp9_fht8x8_neon
     0.54%     0.53%  vpxenc   vpxenc              [.] vp9_fht4x4_neon

Bug: webm:1634
Change-Id: I6748a0c4e0cfaafa3eefdd4848d0ac3aab6900e4

2 years agosad4d_avx2: fix VS 2014 build error
James Zern [Wed, 30 Mar 2022 03:00:00 +0000 (20:00 -0700)]
sad4d_avx2: fix VS 2014 build error

after:
d60b671a7 gcc 11 warning: mismatched bound

error C2719: 'sums': formal parameter with requested alignment of 32
won't be aligned

Change-Id: Iaba46d00ef2334a5e2d9ee69b5d03478fdc73a60

2 years agoremove skip_block from quantize
Johann [Tue, 29 Mar 2022 03:40:12 +0000 (12:40 +0900)]
remove skip_block from quantize

Whether a block is skipped is handled by mi->skip. x->skip_block
is kept exclusively to verify that the quantize functions are not
called for skip blocks.

Finishes the cleanup in 13eed991f

Bug: libvpx:1612
Change-Id: I1598c3b682d3c5e6c57a15fa4cb5df2c65b3a58a

2 years agoremove sad x3,x8 specializations
Johann [Mon, 28 Mar 2022 06:27:46 +0000 (15:27 +0900)]
remove sad x3,x8 specializations

These would compute the sum of absolute differences (sad) for a
group of 3 or 8 references. This was used as part of an exhaustive
search.

vp8 only uses these functions in speed 0 and best quality.

For vp9 this is only used with the --enable-non-greedy-mv
experiment.

This removes the 3- and 8-at-a-time optimized functions and uses
the fall back code which will process 1 or 4 (vpx_sadMxNx4d) at
a time.

For configure --target=x86_64-linux-gcc --enable-realtime-only:
libvpx.a
before: 3002424 after: 2937622 delta: 64802
after 'strip libvpx.a'
before: 2116998 after: 2073090 delta: 43908

Change-Id: I566d06e027c327b3bede68649dd551bba81a848e

2 years agoMerge "gcc 11 warning: mismatched bound" into main
Johann Koenig [Tue, 29 Mar 2022 03:18:02 +0000 (03:18 +0000)]
Merge "gcc 11 warning: mismatched bound" into main

2 years agogcc 11 warning: mismatched bound
Johann [Wed, 23 Mar 2022 05:28:29 +0000 (14:28 +0900)]
gcc 11 warning: mismatched bound

Clean up a new build warning with gcc11:
argument 3 of type ‘const uint8_t * const[]’ with
mismatched bound [-Warray-parameter=]

Standardize sad functions with array sizes.

Change-Id: Iea4144e61368f6a8279e2f3ae96c78aff06c8b41

2 years agoads2armasm_ms.pl: fix thumb::FixThumbInstructions call
James Zern [Sat, 26 Mar 2022 17:25:18 +0000 (10:25 -0700)]
ads2armasm_ms.pl: fix thumb::FixThumbInstructions call

broken since:
642529248 ads2gas[_apple].pl: remove unused stanzas

Change-Id: I1eac77e2fe23cc3f162251e9e0102a4909f7b997

2 years agoMerge "Make sure only NEON FDCT functions are called." into main
James Zern [Thu, 24 Mar 2022 19:39:10 +0000 (19:39 +0000)]
Merge "Make sure only NEON FDCT functions are called." into main

2 years agoads2gas: maintain whitespace
Johann [Wed, 23 Mar 2022 05:18:58 +0000 (14:18 +0900)]
ads2gas: maintain whitespace

Don't use tabs during conversion. Save and restore
existing spacing.

Change-Id: Ib8f443db542c091d36e9ab9836e3e3e292d711f7

2 years agoads2gas: fix .size measurement
Johann [Wed, 23 Mar 2022 04:58:46 +0000 (13:58 +0900)]
ads2gas: fix .size measurement

The distance between PROC and END is used to generate .size
information for debugging. When the leading underscore was
removed the pattern used to match the function name broke.

Change-Id: I90bf67d95ecdc2d214606e663773f88d2a2d6b9c

2 years agoMerge "ads2gas*.pl: strip trailing whitespace after transforms" into main
Johann Koenig [Wed, 23 Mar 2022 04:24:28 +0000 (04:24 +0000)]
Merge "ads2gas*.pl: strip trailing whitespace after transforms" into main

2 years agoads2gas*.pl: strip trailing whitespace after transforms
James Zern [Tue, 22 Mar 2022 20:51:27 +0000 (13:51 -0700)]
ads2gas*.pl: strip trailing whitespace after transforms

Change-Id: I0bea977b256e464231706c72cc14a5c8b6e90775

2 years agoFix ClangTidy style warning
Jerome Jiang [Tue, 22 Mar 2022 20:07:31 +0000 (13:07 -0700)]
Fix ClangTidy style warning

Change-Id: I6c4711e488cda6b97af96d5e1b6b249786e709de

2 years agoMake sure only NEON FDCT functions are called.
Konstantinos Margaritis [Fri, 11 Mar 2022 18:19:25 +0000 (20:19 +0200)]
Make sure only NEON FDCT functions are called.

[NEON]
Added vpx_fdct4x4_pass1_neon(),
Added vpx_fdct8x8_pass1_notranspose_neon(),
Added vpx_fdct8x8_pass1_neon() to avoid code duplication
Refactored vpx_fdct4x4_neon() and vpx_dct8x8_neon() to use the above
Rename dct_body to vpx_fdct16x16_body to reuse later
Add transpose_s16_16x16()

I have run make test and all tests/configurations seem to pass.

Profiled using this command on an Ampere Altra VM:
sudo perf record -g ./vpxenc --codec=vp9 --height=1080 --width=1920 \
   --fps=25/1 --limit=20 -o output.mkv \
   ../original_videos_Sports_1080P_Sports_1080P-0063.mkv --debug –rt

Before this optimization:
1.32%     1.32%  vpxenc   vpxenc              [.] vpx_fdct4x4_neon
0.16%     0.16%  vpxenc   vpxenc              [.] vpx_fdct4x4_c
0.79%     0.79%  vpxenc   vpxenc              [.] vpx_fdct8x8_c
0.52%     0.52%  vpxenc   vpxenc              [.] vpx_fdct8x8_neon
1.23%     1.23%  vpxenc   vpxenc              [.] vpx_fdct16x16_c
0.54%     0.54%  vpxenc   vpxenc              [.] vpx_fdct16x16_neon

So, even though a _neon() version exists, the C version was called \
as well. After this patch:

1.42%     1.36%  vpxenc   vpxenc              [.] vpx_fdct4x4_neon
0.87%     0.82%  vpxenc   vpxenc              [.] vpx_fdct8x8_neon
0.74%     0.74%  vpxenc   vpxenc              [.] vpx_fdct16x16_neon

Change-Id: Id4e1dd315c67b4355fe4e5a1b59e181a349f16d0

2 years agovp8[loongarch]: Optimize idct_add, filter_bv/bh
yuanhecai [Fri, 11 Mar 2022 02:56:07 +0000 (10:56 +0800)]
vp8[loongarch]: Optimize idct_add, filter_bv/bh

1. vp8_dc_only_idct_add_lsx
2. vp8_loop_filter_bh_lsx
3. vp8_loop_filter_bv_lsx

Bug: webm:1755

Change-Id: I9b629767e2a4e9db8cbb3ee2369186502dc6eb00

2 years agovp9[loongarch]: Optimize convolve/convolve8_avg_c
yuanhecai [Thu, 10 Mar 2022 06:56:42 +0000 (14:56 +0800)]
vp9[loongarch]: Optimize convolve/convolve8_avg_c

1. vpx_convolve8_avg_lsx
2. vpx_convolve_avg_lsx

Bug: webm:1755

Change-Id: I4af5c362a94f11d0b5d1760e18326660bdbc0559

2 years agovp9[loongarch]: Optimize convolve8_horiz/vert/c
yuanhecai [Tue, 1 Mar 2022 08:33:47 +0000 (16:33 +0800)]
vp9[loongarch]: Optimize convolve8_horiz/vert/c

1. vpx_convolve8_lsx
2. vpx_convolve8_vert_lsx
3. vpx_convolve8_horiz_lsx

Bug: webm:1755

Change-Id: I9897e1ed6a904ac74d1078bd22b275af44db142d

2 years agoads2gas_apple.pl: remove gcc-isms
Johann [Sat, 12 Mar 2022 22:02:03 +0000 (07:02 +0900)]
ads2gas_apple.pl: remove gcc-isms

The gcc assembler was incompatible for a long
time. It is now based on clang and accepts
more modern syntax, although not enough to
remove the script entirely.

Change-Id: I667d29dca005ea02a995c1025c45eb844081f64b

2 years agoads2gas[_apple].pl: remove unused stanzas
Johann [Sat, 12 Mar 2022 21:28:16 +0000 (06:28 +0900)]
ads2gas[_apple].pl: remove unused stanzas

Many of the features in ads2gas are no longer used.
Remove all patterns which are no longer used in
libvpx.

Simplify between the two to minimize differences.

Change-Id: Ia1151eb8b694cbe51845a1374a876cc7b798899c

2 years agoMerge "vp9[loongarch]: Optimize horizontal/vertical_8_c" into main
James Zern [Thu, 3 Mar 2022 18:35:53 +0000 (18:35 +0000)]
Merge "vp9[loongarch]: Optimize horizontal/vertical_8_c" into main

2 years agovp9[loongarch]: Optimize horizontal/vertical_8_c
yuanhecai [Tue, 1 Mar 2022 01:48:13 +0000 (09:48 +0800)]
vp9[loongarch]: Optimize horizontal/vertical_8_c

1. vpx_lpf_vertical_8_lsx
2. vpx_lpf_horizontal_8_lsx

Bug: webm:1755

Change-Id: I6b05d6b1b2ac4d2a75beb9c9ca9700976fc3af55

2 years agovp9-svc: Remove VP9E_SET_TEMPORAL_LAYERING_MODE
Marco Paniconi [Wed, 2 Mar 2022 07:03:27 +0000 (23:03 -0800)]
vp9-svc: Remove VP9E_SET_TEMPORAL_LAYERING_MODE

The control was never implemented, no need to keep this.
temporal_layering_mode is set in the config.

Bug: webm:1753
Change-Id: I9a6eb50e82344605ab62775911783af82ac2d401

2 years agovp9[loongarch]: Optimize lpf_horizontal/vertical_16_dual with LSX
yuanhecai [Wed, 23 Feb 2022 03:23:52 +0000 (11:23 +0800)]
vp9[loongarch]: Optimize lpf_horizontal/vertical_16_dual with LSX

Change-Id: I82c6bc16ea57c3f7ac5f4d212a12a5f70cb55ffc

2 years agosvc_datarate_test.cc: remove stale TODO
James Zern [Fri, 11 Feb 2022 20:43:29 +0000 (12:43 -0800)]
svc_datarate_test.cc: remove stale TODO

Bug: webm:1554
Change-Id: I547223763b86c6a24fa32851f7b30ebab4b7472a

2 years agosupport visual studio 2022 (vs17)
Gregor Jasny [Thu, 10 Feb 2022 08:01:49 +0000 (09:01 +0100)]
support visual studio 2022 (vs17)

Change-Id: I8380283d09b0c90183f224399f953dcc527181c5

2 years agoMerge "rtc-vp9: Fix intra-only for bypass mode" into main
Marco Paniconi [Wed, 9 Feb 2022 02:41:23 +0000 (02:41 +0000)]
Merge "rtc-vp9: Fix intra-only for bypass mode" into main

2 years agortc-vp9: Fix intra-only for bypass mode
Marco Paniconi [Tue, 8 Feb 2022 20:36:39 +0000 (12:36 -0800)]
rtc-vp9: Fix intra-only for bypass mode

Allow intra-only frame in svc to also work
in bypass (flexible-svc) mode.

Added unittest for the flexible svc case.

And fix the gld_fb_idx for (SL0, TL1) in bypass/flexible
mode pattern in the sample encoder: force it to be 0
(same as lst_fb_idx), since the slot is unused on SL0.

Change-Id: Iada9d1b052e470a0d5d25220809ad0c87cd46268

2 years agovp8[loongarch]: Optimize vp8_loop/sixtap, vpx_dc with LSX.
Lu Wang [Wed, 10 Nov 2021 07:21:17 +0000 (15:21 +0800)]
vp8[loongarch]: Optimize vp8_loop/sixtap, vpx_dc with LSX.

1. vp8_loop_filter_mbh, vp8_loop_filter_mbv
2. vp8_sixtap_predict16x16, vp8_sixtap_predict8x8
3. vpx_dc_predictor_16x16, vpx_dc_predictor_8x8

./vpxdec --progress -o YUV_1920X1080.yuv original_1200f/VP8_1920X1080.webm

before: 37.77fps
after : 220.90fps

Bug: webm:1755

Change-Id: I1a3ce16f0c872261d813b6531cfdf25bd59bb774

2 years agovpx_util[loongarch]: Add loongson_intrinsics.h v1.0.5.
Lu Wang [Wed, 10 Nov 2021 07:05:42 +0000 (15:05 +0800)]
vpx_util[loongarch]: Add loongson_intrinsics.h v1.0.5.

Bug: webm:1755

Change-Id: Id2fa999bdb8788bd4285114c748c547fa262a95e

2 years agoMerge "Handle NV12 in vpx_img_chroma_subsampling()" into main
Wan-Teh Chang [Tue, 8 Feb 2022 02:20:35 +0000 (02:20 +0000)]
Merge "Handle NV12 in vpx_img_chroma_subsampling()" into main

2 years agoHandle NV12 in vpx_img_chroma_subsampling()
Wan-Teh Chang [Sat, 5 Feb 2022 22:32:49 +0000 (14:32 -0800)]
Handle NV12 in vpx_img_chroma_subsampling()

Change-Id: Ibac9f6f8dcdcae0d0c10ae1a118d13baf2407270

2 years agoUpdate error messages in validate_img()
Wan-Teh Chang [Sat, 5 Feb 2022 20:14:37 +0000 (12:14 -0800)]
Update error messages in validate_img()

Change-Id: I4aa6d2e16e077d29e4e9eabfc7056fcfed6786d6

2 years agoMerge "rtc-vp9: Fix to tests for intra-only frame." into main
Marco Paniconi [Thu, 3 Feb 2022 17:04:46 +0000 (17:04 +0000)]
Merge "rtc-vp9: Fix to tests for intra-only frame." into main

2 years agortc-vp9: Fix to tests for intra-only frame.
Marco Paniconi [Thu, 3 Feb 2022 00:17:58 +0000 (16:17 -0800)]
rtc-vp9: Fix to tests for intra-only frame.

Fix some issues with the test, and add new
test that verifies that we can decode base stream
startinig at middle of sequence where intra-only
frame is inserted.

Change-Id: I398d23927113eb58ef64694feca25e60ce60a5f7

2 years agovp9_roi_test: apply iwyu
James Zern [Wed, 2 Feb 2022 00:24:07 +0000 (16:24 -0800)]
vp9_roi_test: apply iwyu

Change-Id: I715c27e329495940d989f95df65ac10e021261d2

2 years agovp9_thread_test: parameterize VP9DecodeMultiThreadedTest
James Zern [Tue, 1 Feb 2022 19:57:05 +0000 (11:57 -0800)]
vp9_thread_test: parameterize VP9DecodeMultiThreadedTest

on a per-file basis; this will make sharding more effective

Change-Id: Ib797681a7cc3bd7ec835bb0c1c7a8d9f23512a0d

2 years agoMerge "Use background segmentation mask with ROI" into main
Jerome Jiang [Mon, 31 Jan 2022 15:17:22 +0000 (15:17 +0000)]
Merge "Use background segmentation mask with ROI" into main

2 years agoMerge "vpx/vp8[cd]x.h,cosmetics: normalize ctrls to enum order" into main
James Zern [Sat, 29 Jan 2022 03:20:41 +0000 (03:20 +0000)]
Merge "vpx/vp8[cd]x.h,cosmetics: normalize ctrls to enum order" into main

2 years agovpx/vp8[cd]x.h,cosmetics: normalize ctrls to enum order
James Zern [Fri, 28 Jan 2022 19:47:08 +0000 (11:47 -0800)]
vpx/vp8[cd]x.h,cosmetics: normalize ctrls to enum order

Change-Id: I49bbd956b3a64008d1abe54de87d7831bc3eede6

2 years agolibvpx[loongarch]: Add loongarch support.
Jin Bo [Tue, 6 Jul 2021 09:18:48 +0000 (17:18 +0800)]
libvpx[loongarch]: Add loongarch support.

LSX and LASX are enabled by default if compiler supports them.

Bug: webm:1754

Change-Id: Ic36b113bc4313c50e9d2bbab91199b3aa46d00dc

2 years agoMerge changes I2db20130,I4e643c83 into main
James Zern [Thu, 27 Jan 2022 21:16:55 +0000 (21:16 +0000)]
Merge changes I2db20130,I4e643c83 into main

* changes:
  vp8dx.h,cosmetics: normalize #define/type order
  vp8dx.h: add missing define for VP9_SET_BYTE_ALIGNMENT

2 years agoMerge "fix some include guards" into main
James Zern [Thu, 27 Jan 2022 21:16:08 +0000 (21:16 +0000)]
Merge "fix some include guards" into main

2 years agoUse background segmentation mask with ROI
Jerome Jiang [Tue, 28 Sep 2021 23:59:21 +0000 (16:59 -0700)]
Use background segmentation mask with ROI

RTC sample encoder vpx_temporal_svc_encoder can take mask files as input
when ROI_MAP is set to 1.

Uses ROI and segmentation of vp9 to skip background encoding when
source_sad is low and the correspond block in previous frame is also
skipped.

Change-Id: I8590e6f9a88cecfa1d7f375d4cc480f0f2af87b6

2 years agovp8dx.h,cosmetics: normalize #define/type order
James Zern [Thu, 27 Jan 2022 03:44:33 +0000 (19:44 -0800)]
vp8dx.h,cosmetics: normalize #define/type order

Change-Id: I2db20130cc366bead5e576b375479917f9aee024

2 years agovp8dx.h: add missing define for VP9_SET_BYTE_ALIGNMENT
James Zern [Thu, 27 Jan 2022 03:41:41 +0000 (19:41 -0800)]
vp8dx.h: add missing define for VP9_SET_BYTE_ALIGNMENT

Change-Id: I4e643c837bb010bd58f4fc8179045f8df18f8ae1

2 years agofix some include guards
James Zern [Wed, 26 Jan 2022 23:05:22 +0000 (15:05 -0800)]
fix some include guards

Change-Id: I0233d352c134bdda3ca160d41b4671d1c45ab01c

2 years agoMerge "libwebm: update to libwebm-1.0.0.28-28-gee0bab5" into main
James Zern [Wed, 26 Jan 2022 18:40:27 +0000 (18:40 +0000)]
Merge "libwebm: update to libwebm-1.0.0.28-28-gee0bab5" into main

2 years agolibwebm: update to libwebm-1.0.0.28-28-gee0bab5
James Zern [Wed, 26 Jan 2022 04:06:59 +0000 (20:06 -0800)]
libwebm: update to libwebm-1.0.0.28-28-gee0bab5

https://chromium.googlesource.com/webm/libwebm/+log/206d268d4d8066e5a37c49025325b80c95c771dd..ee0bab576c338c9807249b99588e352b7268cb62

only one commit affects this snapshot:
ee0bab5 Revert "mkvmuxer,Cluster::Size: make uint64 conversion explicit"

Change-Id: Ib1f21fc5589098af346d110ff88c94bb1ba0a027