platform/upstream/libvpx.git
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 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

2 years agoReland "Add vp9 ref frame to flag map function"
Jianhui Dai [Sat, 1 Jan 2022 00:01:48 +0000 (08:01 +0800)]
Reland "Add vp9 ref frame to flag map function"

Original change's description:
> Add vp9 ref frame to flag map function
>
> Change-Id: I371c2346b9e0153c0f8053cab399ce14cd286c56

Change-Id: I04a407ee0ef66c01a0d224b4468e043213f8791f

2 years agoRevert "Set unused reference frames to first ref"
Jerome Jiang [Tue, 11 Jan 2022 16:47:52 +0000 (08:47 -0800)]
Revert "Set unused reference frames to first ref"

This reverts commit e7f33a53cf404bbb3688af9b13375b5c090daae4.

Change-Id: I54e807220885cb78af6f3c6e48b3eb2c9f1e70b4

2 years agoRevert "Add vp9 ref frame to flag map function"
Jerome Jiang [Tue, 11 Jan 2022 16:46:59 +0000 (08:46 -0800)]
Revert "Add vp9 ref frame to flag map function"

This reverts commit 44e611482e13fdffa0acde780a20dd68ee153498.

Change-Id: Ic900cc01be4de7983fab42178a488277efab77b3

2 years agoAdd vp9 ref frame to flag map function
Jianhui Dai [Sat, 1 Jan 2022 00:01:48 +0000 (08:01 +0800)]
Add vp9 ref frame to flag map function

Change-Id: I371c2346b9e0153c0f8053cab399ce14cd286c56

2 years agoMerge "vp9_prob_diff_update_savings_search_model: quiet conv warnings" into main
James Zern [Wed, 22 Dec 2021 03:03:11 +0000 (03:03 +0000)]
Merge "vp9_prob_diff_update_savings_search_model: quiet conv warnings" into main

2 years agovp9_prob_diff_update_savings_search_model: quiet conv warnings
James Zern [Tue, 21 Dec 2021 19:53:51 +0000 (11:53 -0800)]
vp9_prob_diff_update_savings_search_model: quiet conv warnings

under Visual Studio:
Warning C4244 '=': conversion from 'int64_t' to 'vpx_prob', possible loss of
data

after:
ea042a676 vp9 encoder: fix integer overflows

'newp' has already been range checked earlier in the loop so the cast won't
have any unexpected results

Change-Id: Ic10877db2c0633d53fffdf8852d5095403c23a02

2 years agovpx_int_pro_row: normalize declaration w/aom
James Zern [Tue, 21 Dec 2021 03:56:01 +0000 (19:56 -0800)]
vpx_int_pro_row: normalize declaration w/aom

this is a followup to:
  7fbcee49d quiet -Warray-parameter warnings
and conforms to aom in:
  06e13e817 quiet -Warray-parameter warnings

the sad functions are more varied in libvpx and will require a separate
pass

Change-Id: I765fd6704df615e836ba0b184ff8266ce926c394

2 years agoMerge "vp9 encoder: fix test failure on 32 bit arch" into main
Fyodor Kyslov [Thu, 16 Dec 2021 22:29:13 +0000 (22:29 +0000)]
Merge "vp9 encoder: fix test failure on 32 bit arch" into main

2 years agovp9 encoder: fix test failure on 32 bit arch
Fyodor Kyslov [Thu, 16 Dec 2021 07:11:15 +0000 (23:11 -0800)]
vp9 encoder: fix test failure on 32 bit arch

test fails with memory error. Reducing testing resolution

bug: webm:1750
Change-Id: I75664088022aa660bdf6e69de2d11121db44716f

2 years agoMerge "Set unused reference frames to first ref" into main
Marco Paniconi [Wed, 15 Dec 2021 19:27:09 +0000 (19:27 +0000)]
Merge "Set unused reference frames to first ref" into main

2 years agoMerge "vp9 encoder: fix integer overflows" into main
Fyodor Kyslov [Wed, 15 Dec 2021 02:51:31 +0000 (02:51 +0000)]
Merge "vp9 encoder: fix integer overflows" into main

2 years agovp9 encoder: fix integer overflows
Fyodor Kyslov [Tue, 14 Dec 2021 17:59:17 +0000 (09:59 -0800)]
vp9 encoder: fix integer overflows

fixing integer overflow with 16K content and enabling the test

Bug: webm:1750
Fixed: webm:1750
Change-Id: I76eebd915bcae55bc755613251a98e1716dea4c0

2 years agoSet unused reference frames to first ref
Jianhui Dai [Thu, 9 Dec 2021 05:38:22 +0000 (13:38 +0800)]
Set unused reference frames to first ref

If a reference frame is not referenced, then set the index for that
reference to the first one used/referenced instead of unused slot.
Unused slot means key frame, as key frame resets all slots with itself.

This CL extracts `get_first_ref_frame()` from `reset_fb_idx_unused()`
with a typo fixing, and sets all unused reference frames to first ref in
vp9 uncompressed header.

Bug: webrtc:13442
Change-Id: I99523bc2ceedf27efe376d1113851ff342982181

2 years agoMerge "vp9_diamond_search_sad_avx: quiet -Wmaybe-uninitialized warning" into main
James Zern [Fri, 10 Dec 2021 19:42:06 +0000 (19:42 +0000)]
Merge "vp9_diamond_search_sad_avx: quiet -Wmaybe-uninitialized warning" into main

2 years agoMerge "vp[89]_initalize_enc(): protect against multiple invocations" into main
James Zern [Fri, 10 Dec 2021 18:32:44 +0000 (18:32 +0000)]
Merge "vp[89]_initalize_enc(): protect against multiple invocations" into main

2 years agovp[89]_initalize_enc(): protect against multiple invocations
James Zern [Fri, 10 Dec 2021 02:34:18 +0000 (18:34 -0800)]
vp[89]_initalize_enc(): protect against multiple invocations

this removes the burden from callers; the rtcd functions are left with a
mostly redundant (outside of tests) once() as top-level functions should
ensure their constraints are met

Change-Id: I5bdbcfa4671c6a1492cfe9c7d886c361c26caaa9

2 years agovp9_diamond_search_sad_avx: quiet -Wmaybe-uninitialized warning
James Zern [Fri, 10 Dec 2021 02:02:30 +0000 (18:02 -0800)]
vp9_diamond_search_sad_avx: quiet -Wmaybe-uninitialized warning

w/gcc-11

v_these_mv_w is always initialized in this block with _mm_add_epi16();
converting this to a _mm_storeu_si32(tmp) call also works, but
introduces more stack usage

|| ../vp9/encoder/x86/vp9_diamond_search_sad_avx.c: In function
‘vp9_diamond_search_sad_avx’:
vp9/encoder/x86/vp9_diamond_search_sad_avx.c|285 col 19| warning:
‘v_these_mv_w’ may be used uninitialized [-Wmaybe-uninitialized]
||   285 |           new_bmv = ((const int_mv *)&v_these_mv_w)[local_best_idx];
||       |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vp9/encoder/x86/vp9_diamond_search_sad_avx.c|149 col 21| note:
‘v_these_mv_w’ declared here
||   149 |       const __m128i v_these_mv_w = _mm_add_epi16(v_bmv_w, v_ss_mv_w);
||       |                     ^~~~~~~~~~~~

Change-Id: I1cd2fcb41030db16f51c94f3a70eb8eb2a526401

2 years agovp9_bitstream.c: quiet -Wstringop-overflow warning
James Zern [Fri, 10 Dec 2021 01:32:30 +0000 (17:32 -0800)]
vp9_bitstream.c: quiet -Wstringop-overflow warning

w/gcc-11

as noted in
the size of interp_filter_selected[][]'s first dimension varies between
VP9_COMP and VP9BitstreamWorkerData as noted in the latter's definition:
  // The size of interp_filter_selected in VP9_COMP is actually
  // MAX_REFERENCE_FRAMES x SWITCHABLE. But when encoding tiles, all we ever do
  // is increment the very first index (index 0) for the first dimension. Hence
  // this is sufficient.
  int interp_filter_selected[1][SWITCHABLE];

normalize the function signatures of write_modes*(), etc. to take this
into account.

vp9/encoder/vp9_bitstream.c|948 col 3| warning: ‘write_modes’ accessing
64 bytes in a region of size 16 [-Wstringop-overflow=]
||   948 |   write_modes(cpi, xd, &cpi->tile_data[data->tile_idx].tile_info,
||       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
||   949 |               &data->bit_writer, tile_row, data->tile_idx,
||       |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
||   950 |               &data->max_mv_magnitude, data->interp_filter_selected);
||       |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vp9/encoder/vp9_bitstream.c|948 col 3| note: referencing argument 8 of
type ‘int (*)[4]’
vp9/encoder/vp9_bitstream.c|488 col 13| note: in a call to function
‘write_modes’

Change-Id: I0898cd7c3431633c382a0c3a1be2f0a0bea8d0f9

2 years agoquiet -Warray-parameter warnings
James Zern [Thu, 9 Dec 2021 05:42:28 +0000 (21:42 -0800)]
quiet -Warray-parameter warnings

w/gcc-11
this matches the definition of the function with the declaration

Change-Id: I757b731b9560cb0b0ceec4ec258ec5af5a183b3d

2 years agoMerge "test_intra_pred_speed: match above ext w/reconintra" into main
James Zern [Thu, 9 Dec 2021 18:03:55 +0000 (18:03 +0000)]
Merge "test_intra_pred_speed: match above ext w/reconintra" into main

2 years agotest_intra_pred_speed: match above ext w/reconintra
James Zern [Thu, 9 Dec 2021 05:35:26 +0000 (21:35 -0800)]
test_intra_pred_speed: match above ext w/reconintra

only 2 x block_size is needed

+ remove a related TODO; C & assembly rely on this extension

Change-Id: Iea430267624251cccbbdaec8045eb81d01ae1db1

2 years agovp9_thread_test.cc: remove incorrect TODO
James Zern [Thu, 9 Dec 2021 03:34:47 +0000 (19:34 -0800)]
vp9_thread_test.cc: remove incorrect TODO

the row-based loop filter is ok (and being used) in this case; since
it's serialized the previous row will always be done

Change-Id: I024a0c78e7488178956cc22a4c4680a00dc6eade

2 years agoclear -Wextra-semi/-Wextra-semi-stmt warnings x2
James Zern [Tue, 7 Dec 2021 21:11:46 +0000 (13:11 -0800)]
clear -Wextra-semi/-Wextra-semi-stmt warnings x2

some additional neon file updates after:
31b954deb clear -Wextra-semi/-Wextra-semi-stmt warnings

Bug: chromium:1257449
Change-Id: I3e2664f2bd8f6f7328ec91bf6595ba5fc09862bd

2 years agoclear -Wextra-semi/-Wextra-semi-stmt warnings
James Zern [Thu, 2 Dec 2021 21:11:56 +0000 (13:11 -0800)]
clear -Wextra-semi/-Wextra-semi-stmt warnings

Bug: chromium:1257449
Change-Id: Ia9aafccc09b611521d4a7aedfe3723393a840c62

2 years agoMerge "vp9 encoder: fix row-mt crash w/thread config change" into main
James Zern [Fri, 19 Nov 2021 03:06:17 +0000 (03:06 +0000)]
Merge "vp9 encoder: fix row-mt crash w/thread config change" into main

2 years agovp9 encoder: fix row-mt crash w/thread config change
James Zern [Wed, 17 Nov 2021 02:21:34 +0000 (18:21 -0800)]
vp9 encoder: fix row-mt crash w/thread config change

previously row-mt would allocate thread data once, so increasing the
number of threads with a config change would cause a heap overflow.

Bug: chromium:1261415
Bug: chromium:1270689
Change-Id: I3c5ec8444ae91964fa34a19dd780bd2cbb0368bf

2 years agoMerge "vp9 encoder: fix some integer overflows" into main
James Zern [Thu, 18 Nov 2021 22:35:20 +0000 (22:35 +0000)]
Merge "vp9 encoder: fix some integer overflows" into main

2 years agoMerge "replaced bsr() with get_msb() from bitops.h" into main
Johann Koenig [Thu, 18 Nov 2021 07:13:09 +0000 (07:13 +0000)]
Merge "replaced bsr() with get_msb() from bitops.h" into main

2 years agovp9 encoder: fix some integer overflows
Fyodor Kyslov [Wed, 17 Nov 2021 21:15:00 +0000 (13:15 -0800)]
vp9 encoder: fix some integer overflows

cap bitrate to 1000Mbps, change bitsaving budget to int64_t

this make test coverage for 2048x2048 - same as for vp8

Bug: webm:1749
Fixed: webm:1749
Change-Id: Ic58d73cb7529b0826d1f501ad09af8e80f706a6e

2 years agoMerge "faster vp8_regular_quantize_b_sse4_1" into main
Johann Koenig [Thu, 18 Nov 2021 04:41:58 +0000 (04:41 +0000)]
Merge "faster vp8_regular_quantize_b_sse4_1" into main

2 years agoreplaced bsr() with get_msb() from bitops.h
Ilya Kurdyukov [Wed, 17 Nov 2021 07:16:02 +0000 (14:16 +0700)]
replaced bsr() with get_msb() from bitops.h

The modified line should now compile into two instructions instead of four.

Change-Id: Ie2eb6b13ff1e29b3107cb9e76f37ff9065504316

2 years agofaster vp8_regular_quantize_b_sse4_1
Ilya Kurdyukov [Sat, 13 Nov 2021 11:22:14 +0000 (18:22 +0700)]
faster vp8_regular_quantize_b_sse4_1

Gives 10% faster VP8 encoding in simple tests.
This patch requires testing on wider datasets and encoder
settings to see if this speedup is achieved on most data.

Change-Id: If8e04819623e78fff126c413db66c964c0b4c11a

2 years agoencode_api_test.cc: unify kCodecs[] definitions
James Zern [Tue, 16 Nov 2021 03:20:36 +0000 (19:20 -0800)]
encode_api_test.cc: unify kCodecs[] definitions

and rename the table to kCodecIfaces[] to be a little more specific and
avoid shadowing kCodecs[] in SetRoi()

Change-Id: I64905f48d8bf76e812bdba8374b82e3f7654686f

2 years agoMerge "MacOS 12 is darwin21" into main
Johann Koenig [Wed, 17 Nov 2021 03:35:50 +0000 (03:35 +0000)]
Merge "MacOS 12 is darwin21" into main

2 years agoMerge "test/DummyVideoSource::ReallocImage: check img_ alloc" into main
Yunqing Wang [Tue, 16 Nov 2021 21:47:09 +0000 (21:47 +0000)]
Merge "test/DummyVideoSource::ReallocImage: check img_ alloc" into main

2 years agoMacOS 12 is darwin21
Johann [Tue, 16 Nov 2021 21:02:15 +0000 (06:02 +0900)]
MacOS 12 is darwin21

Remove -mmacosx-version-min. The library does not use
any calls which are affected by the platform version.
There is also no version 10.16 as it went from 10.15
to 11 and now to 12.

At some point it may be good to clarify that the bare
-darwin- target is for iOS and the -darwinN- targets
are for macOS.

Change-Id: I2fd5f7cae2637905acf3ab77bfddfbe367abbb68

2 years agovp9: Fix multiplication overflow
Mikko Koivisto [Mon, 15 Nov 2021 18:47:05 +0000 (18:47 +0000)]
vp9: Fix multiplication overflow

Fix UBSan error reported from aosp Cuttlefish device:
/vp9/encoder/vp9_ratectrl.c:238:33: unsigned integer overflow:
2500000 * 1800 cannot be represented in type 'unsigned int'

...by casting the operand and the result of multiplication
to 64bit integer.

Test: vp9 webrtc streaming with Cuttlefish
Change-Id: Id5bb3d4071a96179caffae0829d3cc4e48c7614b

2 years agotest/DummyVideoSource::ReallocImage: check img_ alloc
James Zern [Thu, 11 Nov 2021 21:42:35 +0000 (13:42 -0800)]
test/DummyVideoSource::ReallocImage: check img_ alloc

prevents a crash on the next line accessing img_ members

Bug: aomedia:3191
Change-Id: I430fb4ee662b0001629096eb8b554f8a2b30cce0

2 years agoMerge "update libwebm to libwebm-1.0.0.28-20-g206d268" into main
James Zern [Thu, 11 Nov 2021 21:09:38 +0000 (21:09 +0000)]
Merge "update libwebm to libwebm-1.0.0.28-20-g206d268" into main

2 years agoMerge changes I1425f12d,I1e9e9ffa,I6d8f676b,I92013086 into main
James Zern [Wed, 10 Nov 2021 21:30:07 +0000 (21:30 +0000)]
Merge changes I1425f12d,I1e9e9ffa,I6d8f676b,I92013086 into main

* changes:
  mem_sse2.h: loadu_uint32 -> loadu_int32
  mem_sse2.h: storeu_uint32 -> storeu_int32
  vp8: fix some implicit signed -> unsigned conv warnings
  video_source.h,ReallocImage: quiet implicit conv warning

2 years agovp8 encoder: fix some integer overflows
James Zern [Sat, 6 Nov 2021 17:42:46 +0000 (10:42 -0700)]
vp8 encoder: fix some integer overflows

cap the bitrate to 1000Mbps to avoid many instances of bitrate * 3 / 2
overflowing.

this adds coverage for 2048x2048 in the default test for VP8 with TODOs
for issues at that resolution for VP9 and at max resolution for both.

Bug: b/189602769
Bug: chromium:1264506
Bug: webm:1748
Bug: webm:1749
Bug: webm:1750
Bug: webm:1751
Change-Id: Iedee4dd8d3609c2504271f94d22433dfcd828429

2 years agomem_sse2.h: loadu_uint32 -> loadu_int32
James Zern [Sat, 6 Nov 2021 23:48:13 +0000 (16:48 -0700)]
mem_sse2.h: loadu_uint32 -> loadu_int32

this changes the return to int32_t which matches the type with usage
of this call as input to _mm_cvtsi32_si128(), _mm_set_epi32(), etc.
fixes implicit conversion warning with clang-11 -fsanitize=undefined

Change-Id: I1425f12d4f79155dd5d7af0eb00fbdb9f1940544

2 years agomem_sse2.h: storeu_uint32 -> storeu_int32
James Zern [Sat, 6 Nov 2021 23:43:11 +0000 (16:43 -0700)]
mem_sse2.h: storeu_uint32 -> storeu_int32

this changes the parameter to int32_t which matches the type with usage
of this call using _mm_cvtsi128_si32() as a parameter. quiets an
implicit conversion warning with clang-11 -fsanitize=undefined

Change-Id: I1e9e9ffac5d2996962d29611458311221eca8ea0

2 years agovp8: fix some implicit signed -> unsigned conv warnings
James Zern [Sat, 6 Nov 2021 23:33:00 +0000 (16:33 -0700)]
vp8: fix some implicit signed -> unsigned conv warnings

and vice-versa mostly when dealing with bitmasks

w/clang-11 -fsanitize=undefined

Change-Id: I6d8f676bf87679ba1dad9cb7f55eea172103d9d3

2 years agovideo_source.h,ReallocImage: quiet implicit conv warning
James Zern [Sat, 6 Nov 2021 17:42:37 +0000 (10:42 -0700)]
video_source.h,ReallocImage: quiet implicit conv warning

with -fsanitize=undefined

test/video_source.h:194:33: runtime error: implicit conversion from type
'int' of value -32 (32-bit, signed) to type 'unsigned int' changed the
value to 4294967264 (32-bit, unsigned)

Change-Id: I92013086d517fecf01c9e4cdfe6737b8ce733a1f

2 years agovp8,calc_pframe_target_size: fix integer overflow
James Zern [Mon, 8 Nov 2021 20:57:12 +0000 (12:57 -0800)]
vp8,calc_pframe_target_size: fix integer overflow

this is similar to the fix for calc_iframe_target_size:
5f345a924 Avoid overflow in calc_iframe_target_size

Bug: chromium:1264506
Change-Id: I2f0e161cf9da59ca0724692d581f1594c8098ebb

2 years agovp8_update_rate_correction_factors: fix integer overflow
James Zern [Sat, 6 Nov 2021 17:42:46 +0000 (10:42 -0700)]
vp8_update_rate_correction_factors: fix integer overflow

the intermediate value in the correction_factor calculation may exceed
integer bounds

Bug: b/189602769
Change-Id: I75726b12f3095663911d78333f3ea26eb6dee21e

2 years agoupdate libwebm to libwebm-1.0.0.28-20-g206d268
James Zern [Wed, 27 Oct 2021 17:05:19 +0000 (10:05 -0700)]
update libwebm to libwebm-1.0.0.28-20-g206d268

picks up Android.mk license updates from AOSP and fixes as part of the
1.0.0.28 release

changelog:
https://chromium.googlesource.com/webm/libwebm/+log/37d9b86..206d268

Change-Id: I18d5238f7d1aff2678d903018929da952410fa0e

2 years agoMerge "update tools/cpplint.py" into main
James Zern [Thu, 4 Nov 2021 20:01:01 +0000 (20:01 +0000)]
Merge "update tools/cpplint.py" into main

2 years agoupdate tools/cpplint.py
James Zern [Wed, 3 Nov 2021 23:23:06 +0000 (16:23 -0700)]
update tools/cpplint.py

https://github.com/google/styleguide.git
100755 blob 4a82bde4f95cef8103520bc2c019483397ec51f4    cpplint/cpplint.py

Bug: aomedia:3178
Change-Id: I9e11d647096fc2082b18d74731026dabb52639bb

2 years agotools_common.h: add VPX_TOOLS_FORMAT_PRINTF
James Zern [Wed, 3 Nov 2021 00:19:10 +0000 (17:19 -0700)]
tools_common.h: add VPX_TOOLS_FORMAT_PRINTF

and use it to set the format attribute for printf like functions. this
allows the examples to be built with -Wformat-nonliteral without
producing warnings.

Bug: webm:1744
Change-Id: I26b4c41c9a42790053b1ae0e4a678af8f2cd1d82
Fixed: webm:1744

2 years agovpx_codec_internal.h: add LIBVPX_FORMAT_PRINTF
James Zern [Tue, 2 Nov 2021 23:29:52 +0000 (16:29 -0700)]
vpx_codec_internal.h: add LIBVPX_FORMAT_PRINTF

and use it to set the format attribute for the printf like function
vpx_internal_error(). this allows the main library to be built with
-Wformat-nonliteral without producing warnings; the examples will be
handled in a followup.

Bug: webm:1744
Change-Id: Iebc322e24db35d902c5a2b1ed767d2e10e9c91b9

2 years agoMerge "vp8_yv12_realloc_frame_buffer: move allocation check" into main
James Zern [Fri, 15 Oct 2021 20:08:58 +0000 (20:08 +0000)]
Merge "vp8_yv12_realloc_frame_buffer: move allocation check" into main

2 years agotest/Android.mk: import LICENSE indicators from AOSP
James Zern [Tue, 12 Oct 2021 18:57:39 +0000 (11:57 -0700)]
test/Android.mk: import LICENSE indicators from AOSP

https://android-review.googlesource.com/c/platform/external/libvpx/+/1853628
https://android.googlesource.com/platform/external/libvpx/+/e40f8afb1e51d3bd13d662c1881e3cfb616fa2b8

Change-Id: I15f185ab7c7661f4456c4ad7296fdda01dfb8d53