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

2 years agoMerge "Android.mk: import LICENSE indicators from AOSP" into main
James Zern [Mon, 11 Oct 2021 20:32:51 +0000 (20:32 +0000)]
Merge "Android.mk: import LICENSE indicators from AOSP" into main

2 years agoAndroid.mk: import LICENSE indicators from AOSP
James Zern [Sat, 9 Oct 2021 17:33:37 +0000 (10:33 -0700)]
Android.mk: import LICENSE indicators from AOSP

https://android-review.googlesource.com/c/platform/external/libvpx/+/1588942
https://android.googlesource.com/platform/external/libvpx/+/099828b5c770ef8630741721be4b6c25a8394204

Change-Id: Ieca1c882f82bcbc7546944b43af7fab358f925d2

2 years agovp8_yv12_realloc_frame_buffer: move allocation check
James Zern [Fri, 8 Oct 2021 23:24:23 +0000 (16:24 -0700)]
vp8_yv12_realloc_frame_buffer: move allocation check

to before the memset used under msan to avoid any spurious reports in
OOM conditions

Change-Id: I0c4ee92829bbcb356e94f503a4615caf891bb49d

2 years agoMerge branch 'smew' into main
Jerome Jiang [Thu, 7 Oct 2021 17:47:25 +0000 (10:47 -0700)]
Merge branch 'smew' into main

Bug: webm:1732

Change-Id: Id782a897d8005d316dc5b72859657c219edabf30

2 years agoUpdate AUTHORS and version info in libs.mk v1.11.0
Jerome Jiang [Tue, 5 Oct 2021 22:57:34 +0000 (15:57 -0700)]
Update AUTHORS and version info in libs.mk

Bug: webm:1732
Change-Id: I29ce77c7d02bd2f5cb0ef8412333df032744b668

2 years ago{vp8,vp9}_set_roi_map: fix validation with INT_MIN
James Zern [Fri, 1 Oct 2021 20:46:02 +0000 (13:46 -0700)]
{vp8,vp9}_set_roi_map: fix validation with INT_MIN

previously ranges were checked with abs() whose behavior is undefined
with INT_MIN. this fixes a crash when the original value is returned and
it later used as and offset into a table.

Bug: webm:1742
Change-Id: I345970b75c46699587a4fbc4a059e59277f4c2c8

2 years agoMerge changes If2ef4400,I345970b7 into main
Jerome Jiang [Mon, 4 Oct 2021 17:43:28 +0000 (17:43 +0000)]
Merge changes If2ef4400,I345970b7 into main

* changes:
  vpx_roi_map: add delta range info
  {vp8,vp9}_set_roi_map: fix validation with INT_MIN

2 years agovpx_roi_map: add delta range info
James Zern [Fri, 1 Oct 2021 22:42:50 +0000 (15:42 -0700)]
vpx_roi_map: add delta range info

Change-Id: If2ef4400562075b4e7abadc01638a46c0c7f1859

2 years ago{vp8,vp9}_set_roi_map: fix validation with INT_MIN
James Zern [Fri, 1 Oct 2021 20:46:02 +0000 (13:46 -0700)]
{vp8,vp9}_set_roi_map: fix validation with INT_MIN

previously ranges were checked with abs() whose behavior is undefined
with INT_MIN. this fixes a crash when the original value is returned and
it later used as and offset into a table.

Bug: webm:1742
Change-Id: I345970b75c46699587a4fbc4a059e59277f4c2c8

2 years agoMerge "vp8: Condition decimation drop logic on drop_frames_allowed" into main
Marco Paniconi [Fri, 1 Oct 2021 22:25:12 +0000 (22:25 +0000)]
Merge "vp8: Condition decimation drop logic on drop_frames_allowed" into main

2 years agovp8: Condition decimation drop logic on drop_frames_allowed
Marco Paniconi [Fri, 1 Oct 2021 20:16:56 +0000 (13:16 -0700)]
vp8: Condition decimation drop logic on drop_frames_allowed

This allows user to make sure frame will be encoded
when drop_frames is set off (on the fly), no matter
the state of the buffer.

Change-Id: Ia7b39b93fe3721dd586bdbede72c525db87b6890

2 years agovp8: For screen mode: clip buffer from below
Marco Paniconi [Fri, 1 Oct 2021 18:54:53 +0000 (11:54 -0700)]
vp8: For screen mode: clip buffer from below

Condition already existed for screen content mode,
but only when frame-dropper was off. Remove the
frame drop condition.

Change-Id: Ie7357041f5ca05b01e78b4bd3b40da060382591b

2 years agoCHANGELOG for Smew v1.11.0 v1.11.0-rc1
Jerome Jiang [Mon, 27 Sep 2021 22:52:53 +0000 (15:52 -0700)]
CHANGELOG for Smew v1.11.0

Bug: webm:1732
Change-Id: I6038f401cf1dfdcaca85b81d0b8b2c04967b44dd

2 years agoCap duration to avoid overflow
Jerome Jiang [Mon, 20 Sep 2021 20:37:43 +0000 (13:37 -0700)]
Cap duration to avoid overflow

Bug: webm:1728
Change-Id: Id13475660fa921e8ddcc89847e978da4c8d85886
(cherry picked from commit 09775194ffdb84b4979f3988e7ef301575b661df)

2 years agoDefine the VPX_NO_RETURN macro for MSVC
Wan-Teh Chang [Fri, 10 Sep 2021 22:54:51 +0000 (15:54 -0700)]
Define the VPX_NO_RETURN macro for MSVC

Define VPX_NO_RETURN as __declspec(noreturn) for MSVC. See
https://docs.microsoft.com/en-us/cpp/cpp/noreturn?view=msvc-160

This requires moving VPX_NO_RETURN before function declarations because
__declspec(noreturn) must be placed there. Fortunately GCC's
__attribute__((noreturn)) can be placed either before or after function
declarations.

Change-Id: Id9bb0077e2a4f16ec2ca9c913dd93673a0e385cf
(cherry picked from commit 8a6fbc0b4eb8538e213782bcdc3969a08b44e73b)

2 years agovp8 rc: Clear system state at the end of calls
Jerome Jiang [Fri, 24 Sep 2021 21:56:00 +0000 (14:56 -0700)]
vp8 rc: Clear system state at the end of calls

Clear system state at the end of rc calls to make sure the state is
consistent before and after

Change-Id: I59fe9c99485b1a8603c20db37961339b7575455f

2 years agoMerge "vp8 rc: support temporal layers" into main
Jerome Jiang [Thu, 23 Sep 2021 22:10:57 +0000 (22:10 +0000)]
Merge "vp8 rc: support temporal layers" into main

2 years agovp8 rc: support temporal layers
Jerome Jiang [Thu, 16 Sep 2021 17:16:44 +0000 (10:16 -0700)]
vp8 rc: support temporal layers

Change-Id: I2c7d5de0e17b072cb763f1659b1badce4fe0b82b

2 years agoMerge "Cap duration to avoid overflow" into main
Jerome Jiang [Wed, 22 Sep 2021 17:27:26 +0000 (17:27 +0000)]
Merge "Cap duration to avoid overflow" into main

2 years agoCap duration to avoid overflow
Jerome Jiang [Mon, 20 Sep 2021 20:37:43 +0000 (13:37 -0700)]
Cap duration to avoid overflow

Bug: webm:1728
Change-Id: Id13475660fa921e8ddcc89847e978da4c8d85886

2 years agovp8 rc: explicit cast to avoid VS build failure
Jerome Jiang [Thu, 16 Sep 2021 17:19:09 +0000 (10:19 -0700)]
vp8 rc: explicit cast to avoid VS build failure

Change-Id: I6a4daca12b79cf996964661e1af85aa6e258b446

2 years agoDefine the VPX_NO_RETURN macro for MSVC
Wan-Teh Chang [Fri, 10 Sep 2021 22:54:51 +0000 (15:54 -0700)]
Define the VPX_NO_RETURN macro for MSVC

Define VPX_NO_RETURN as __declspec(noreturn) for MSVC. See
https://docs.microsoft.com/en-us/cpp/cpp/noreturn?view=msvc-160

This requires moving VPX_NO_RETURN before function declarations because
__declspec(noreturn) must be placed there. Fortunately GCC's
__attribute__((noreturn)) can be placed either before or after function
declarations.

Change-Id: Id9bb0077e2a4f16ec2ca9c913dd93673a0e385cf

2 years agoAdd vp8 support to rc lib
Jerome Jiang [Tue, 31 Aug 2021 17:22:22 +0000 (10:22 -0700)]
Add vp8 support to rc lib

For 1 layer CBR only.
Support for temporal layers comes later.

Rename the library to libvpxrc

Bug: b/188853141

Change-Id: Ib7f977b64c05b1a0596870cb7f8e6768cb483850

2 years agovp8 rc: always update correction factor
Jerome Jiang [Wed, 8 Sep 2021 23:52:51 +0000 (16:52 -0700)]
vp8 rc: always update correction factor

Change-Id: Id40b9cb5a85a15fb313a2a93f14f6768259f7c15

2 years agoAdd codec control for vp8 external rc
Jerome Jiang [Thu, 2 Sep 2021 23:15:13 +0000 (16:15 -0700)]
Add codec control for vp8 external rc

disable cyclic refresh

Change-Id: I7905602919d5780831fad840577e97730ce0afc2

2 years agovp9 rc lib: Allow aq 3 to work for SVC with unit test
Jerome Jiang [Tue, 24 Aug 2021 21:30:54 +0000 (14:30 -0700)]
vp9 rc lib: Allow aq 3 to work for SVC with unit test

Also use round to cast float to int with more accurate calculation to
avoid error accumulation which causes qp to be different after ~290
frames.

Change-Id: Iff65a8fdc67401814fd253dbf148afe9887df97f

2 years agoMerge "vpx_ports/x86.h: sync with aom_ports/x86.h" into main
James Zern [Fri, 30 Jul 2021 00:48:08 +0000 (00:48 +0000)]
Merge "vpx_ports/x86.h: sync with aom_ports/x86.h" into main

2 years agovp9 rc: Fills VP9_COMP zero at initialization
Hirokazu Honda [Thu, 29 Jul 2021 17:42:35 +0000 (02:42 +0900)]
vp9 rc: Fills VP9_COMP zero at initialization

Change-Id: Ib1a544ce87e8fdbe23c0e54b6426ee228011b126

2 years agovpx_ports/x86.h: sync with aom_ports/x86.h
James Zern [Mon, 26 Jul 2021 23:52:56 +0000 (16:52 -0700)]
vpx_ports/x86.h: sync with aom_ports/x86.h

adds a few comments and makes the file ascii:
854b2766a Replace non-ASCII characters

Change-Id: I6c2d76b293158bcad9f1ded7a91a81bda1e700fb

2 years agoFix some instances of -Wunused-but-set-variable.
Peter Kasting [Mon, 26 Jul 2021 10:57:55 +0000 (03:57 -0700)]
Fix some instances of -Wunused-but-set-variable.

Bug: chromium:1203071
Change-Id: Ieb628f95d676ba3814b5caf8a02a884330928c77

2 years agoMerge "Remove unused old FP_MB_STATS code" into main
Yunqing Wang [Mon, 26 Jul 2021 20:13:38 +0000 (20:13 +0000)]
Merge "Remove unused old FP_MB_STATS code" into main

2 years agoMerge "Clean up allow_partition_search_skip code" into main
Yunqing Wang [Mon, 26 Jul 2021 19:19:02 +0000 (19:19 +0000)]
Merge "Clean up allow_partition_search_skip code" into main

2 years agoMerge "Disable allow_partition_search_skip feature" into main
Yunqing Wang [Sun, 25 Jul 2021 22:42:59 +0000 (22:42 +0000)]
Merge "Disable allow_partition_search_skip feature" into main

2 years agoRemove unused old FP_MB_STATS code
Yunqing Wang [Sat, 24 Jul 2021 05:45:45 +0000 (22:45 -0700)]
Remove unused old FP_MB_STATS code

Change-Id: I78ac1f8ce1598de295efd2ac1fe8244072d9b501