platform/upstream/libvpx.git
3 years agoconfigure: add darwin20 support
James Zern [Fri, 25 Sep 2020 20:21:11 +0000 (13:21 -0700)]
configure: add darwin20 support

this release will have arm64 and x86_64 support. in the future it might
be useful to move to mac/iphone targets to help disambiguate
arm64-darwin-gcc and arm64-darwin20-gcc.

Change-Id: I1f8b145303204af316955822f5e8bab51c47f353

3 years agoMerge "vp9_ratectrl,vp9_resize_one_pass_cbr: rm redundant casts"
James Zern [Wed, 16 Sep 2020 23:48:21 +0000 (23:48 +0000)]
Merge "vp9_ratectrl,vp9_resize_one_pass_cbr: rm redundant casts"

3 years agovp9_ratectrl,vp9_resize_one_pass_cbr: rm redundant casts
James Zern [Wed, 16 Sep 2020 20:43:05 +0000 (13:43 -0700)]
vp9_ratectrl,vp9_resize_one_pass_cbr: rm redundant casts

avg_frame_bandwidth is an int, quiets a clang-tidy warning

Change-Id: I2a2822652ca6a06e9d1d6d4318f544d419d437e8

3 years agotest/encode_test_driver: rm redundant get() w/unique_ptr
James Zern [Wed, 16 Sep 2020 20:40:01 +0000 (13:40 -0700)]
test/encode_test_driver: rm redundant get() w/unique_ptr

Change-Id: I3c1ece92ba9f43df4cbaf47109e35aaf0a807d97

3 years agovp8: Remove sched_yield on POSIX systems
Joel Fernandes [Mon, 14 Sep 2020 02:05:47 +0000 (22:05 -0400)]
vp8: Remove sched_yield on POSIX systems

libvpx does sched_yield() on Linux. This is highly frowned upon these
days mainly because it is not needed and causes high scheduler overhead.

It is not needed because the kernel will preempt the task while it is
spinning which will imply a yield. On ChromeOS, not yielding has the
following improvements:

1. power_VideoCall test as seen on perf profile:

With yield:
     9.40%  [kernel]            [k] __pi___clean_dcache_area_poc
     7.32%  [kernel]            [k] _raw_spin_unlock_irq  <-- kernel scheduler

Without yield:
     8.76%  [kernel]            [k] __pi___clean_dcache_area_poc
     2.27%  [kernel]            [k] _raw_spin_unlock_irq  <-- kernel scheduler

As you can see, there is a 5% drop in the scheduler's CPU utilization.

2. power_VideoCall test results:

There is a 3% improvement on max video FPS, from 30 to 31. This
improvement is consistent.

Also note that the sched_yield() manpage itself says it is intended
only for RT tasks. From manpagE: "sched_yield() is intended for use
with real-time scheduling policies (i.e., SCHED_FIFO or SCHED_RR)
and very likely means your application design is broken."

BUG=b/168205004

Change-Id: Idb84ab19e94f6d0c7f9e544e7a407c946d5ced5c
Signed-off-by: Joel Fernandes <joelaf@google.com>
3 years agogoogletest: enable failure on uninstantiated tests
Sarah Parker [Fri, 11 Sep 2020 03:33:02 +0000 (20:33 -0700)]
googletest: enable failure on uninstantiated tests

Similar to the change in
https://aomedia-review.googlesource.com/c/aom/+/115162.
This currently is a warning, but the tree should be clean now in the
default x86-64 configuration so we can use it to prevent regressions and
find any remaining issues in other configurations.

BUG=b/159031844

Change-Id: I097537ff018668492d37164fdba5edd241dc5dbe

3 years agoUpstream GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST
Sarah Parker [Wed, 9 Sep 2020 23:10:17 +0000 (16:10 -0700)]
Upstream GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST

BUG=b/159031848

Change-Id: I013770f4e54d0ea92304fa3e9cf4d46f5723f129

3 years agovp9-rtc: Add control to disable maxq on overshoot
Marco Paniconi [Mon, 11 May 2020 19:22:19 +0000 (12:22 -0700)]
vp9-rtc: Add control to disable maxq on overshoot

Add encoder control to disable feature to increase Q
on overshoot detection, for CBR. Default (no usage
of the control) means the feature is internally enabled.

Add the control to the sample encoders, but keep it
disabled as default (set to 0, so feature is on).

Change-Id: Ia2237bc4aaea9770e5080dab20bfff9e3fd09199

3 years agoEscape number sign in Makefiles
Daniel Sommermann [Mon, 17 Aug 2020 16:42:08 +0000 (09:42 -0700)]
Escape number sign in Makefiles

Number signs are handled differently in Makefile variable parsing as
compared to bash variable parsing. See this demo:

```
$ cat Makefile
A=foo#bar
B='foo#bar'
C="foo#bar"
D=foo\#bar
E='foo\#bar'
F="foo\#bar"

$(info $(A))
$(info $(B))
$(info $(C))
$(info $(D))
$(info $(E))
$(info $(F))

$ make
foo
'foo
"foo
foo#bar
'foo#bar'
"foo#bar"
make: *** No targets.  Stop.

$ make -v
GNU Make 4.2.1
```

In other words, the `#` character is evaluated first when parsing
Makefiles, causing the rest of the line to become a comment. The effect of
this is that paths that contain embedded `#` symbols are not handled
properly in the vpx build system.

To test this change, clone vpx to a directory containing a `#` symbol and
attempt a build. With this change, it worked for me on Fedora 31, however
without the change the build failed.

Change-Id: Iaee6383e2435049b680484cc5cefdea9f2d9df46

3 years agoMerge "Refine MMI & MSA detection for mips"
James Zern [Wed, 19 Aug 2020 02:49:29 +0000 (02:49 +0000)]
Merge "Refine MMI & MSA detection for mips"

3 years agovp9-svc: Fix to resetting RC for temporal layers
Marco Paniconi [Wed, 19 Aug 2020 00:56:51 +0000 (17:56 -0700)]
vp9-svc: Fix to resetting RC for temporal layers

Fix to reset RC for temporal layers: the
first_spatial_layer_to_encode is usually/default 0,
so the logic to reset for temporal layers was not
being executed. Use VPXMAX(1, ) to make sure  all
temporal layers will be reset (when max-q is used
for overshoot).

Change-Id: Iec669870c865420d01d52eab9425cd6c7714eddc

3 years agoRefine MMI & MSA detection for mips
jinbo [Sat, 15 Aug 2020 09:20:36 +0000 (17:20 +0800)]
Refine MMI & MSA detection for mips

1.Add compile check to probe the native ability of
toolchain to decide whether a feature can be enabled.
2.Add runtime check to probe cpu supported features.
MSA will be prefered if MSA and MMI are both supported.
3.You can configure and build as following commands:
./configure --cpu=loongson3a && make -j4

Change-Id: I057553216dbc79cfaba9c691d5f4cdab144e1123

3 years agortc-vp9: Fix to rcstats in vp9_spatial_svc_encoder
Marco Paniconi [Tue, 18 Aug 2020 04:49:41 +0000 (21:49 -0700)]
rtc-vp9: Fix to rcstats in vp9_spatial_svc_encoder

Fixes the rcstats for case when #spatial_layers = 1.

Change-Id: Ie28d99852033307bc4c69c7e738e1d4cab4e8cf5

3 years agoMerge "Merge remote-tracking branch 'origin/quacking' into master"
Jerome Jiang [Thu, 13 Aug 2020 16:31:42 +0000 (16:31 +0000)]
Merge "Merge remote-tracking branch 'origin/quacking' into master"

3 years agoMerge "test/*: use canonical downloads.webmproject url"
James Zern [Wed, 12 Aug 2020 22:35:47 +0000 (22:35 +0000)]
Merge "test/*: use canonical downloads.webmproject url"

3 years agoAvoid re-allocating fp_motion_vector_info
angiebird [Tue, 11 Aug 2020 02:53:10 +0000 (19:53 -0700)]
Avoid re-allocating fp_motion_vector_info

Replace fp_motion_vector_info_init() by
fp_motion_vector_info_reset() in first_pass_encode()

Change-Id: Iadacb1ecc4f07435340399564fdd3bfd4ac702f4

3 years agoCosmetic changes in simple_encode.h
angiebird [Tue, 11 Aug 2020 02:37:30 +0000 (19:37 -0700)]
Cosmetic changes in simple_encode.h

Change-Id: If7d2711e7f37f00629874914f7c4d2396358e39d

3 years agoCorrect the first pass motion vector scale
angiebird [Mon, 10 Aug 2020 22:59:30 +0000 (15:59 -0700)]
Correct the first pass motion vector scale

Change-Id: I005a648f7f9ead9d36a39330dfbb096919affb34

3 years agoCosmetic change for simple_encode_test.cc
angiebird [Mon, 10 Aug 2020 22:46:37 +0000 (15:46 -0700)]
Cosmetic change for simple_encode_test.cc

Change-Id: I50b4d38f7deceb5b416e72dd944d2ed31e42dafa

3 years agoMake target_frame_bits error margin configurable.
angiebird [Sat, 8 Aug 2020 01:39:18 +0000 (18:39 -0700)]
Make target_frame_bits error margin configurable.

Change-Id: I05dd4d60741743c13951727ce6608acf4224ebec

3 years agoAvoid division by zero for rate q_step model
angiebird [Sat, 8 Aug 2020 01:12:18 +0000 (18:12 -0700)]
Avoid division by zero for rate q_step model

Change-Id: Ic5709b79131a3969fcb2a0eb3f53994f788b5cc9

3 years agoAdd rq_history to encode_frame_result
angiebird [Tue, 4 Aug 2020 02:49:43 +0000 (19:49 -0700)]
Add rq_history to encode_frame_result

Change-Id: Ic2a52dcf5e5a6d57b80d390a2c48ee498e89e7b2

3 years agoFix ObserveFirstPassMotionVectors()
angiebird [Fri, 7 Aug 2020 22:44:08 +0000 (15:44 -0700)]
Fix ObserveFirstPassMotionVectors()

1) Use kRefFrameTypeNone in the unit test
2) Reset mv_info in fp_motion_vector_info_init
3) Call fp_motion_vector_info_init() in first_pass_encode()
4) Set mv_info for intra frame.
5) Set mv_info with zero mv as default for inter frame
6) Remove duplicated fp_motion_vector_info in encode_frame_info

Change-Id: I2f7db5cd4cf1f19db039c9ce638d17b832f45b6e

3 years agotest/*: use canonical downloads.webmproject url
James Zern [Fri, 7 Aug 2020 20:32:39 +0000 (13:32 -0700)]
test/*: use canonical downloads.webmproject url

prefer
https://storage.googleapis.com/downloads.webmproject.org/
to
http://downloads.webmproject.org/

similar to libs.mk

BUG=b/163149610

Change-Id: I6abe0848120849b9512fc5a6122ddc54b5cc2240

3 years agoMake initial q_index guess at 128
angiebird [Wed, 5 Aug 2020 20:44:01 +0000 (13:44 -0700)]
Make initial q_index guess at 128

This reduce the average recode times per frame from 2.81 to 2.73
when targeting 15% error for target bitrate per frame.

Change-Id: I58f0be86443643ba23623cb1d522ae41897734a3

3 years agoCorrect rq_model_update when recode_count == 1
angiebird [Wed, 5 Aug 2020 19:16:50 +0000 (12:16 -0700)]
Correct rq_model_update when recode_count == 1

This will reduce the avg recode times per frame form
3.19 to 2.81 when targeting 15% error margin for
target bitrate per frame.

Change-Id: I28c9ec09a1b1318c09fe5229ccb7e51b32b9dfb9

3 years agoMerge "Cosmetic changes for rate_ctrl experiment"
Angie Chiang [Thu, 6 Aug 2020 22:21:46 +0000 (22:21 +0000)]
Merge "Cosmetic changes for rate_ctrl experiment"

3 years agoCosmetic changes for rate_ctrl experiment
angiebird [Tue, 4 Aug 2020 02:52:31 +0000 (19:52 -0700)]
Cosmetic changes for rate_ctrl experiment

Change-Id: I133c93c2ad4c824fc97a18de3ac2cb2aedac9013

3 years agoL2E: Add ObserveFirstPassMotionVector
Cheng Chen [Wed, 29 Jul 2020 19:49:51 +0000 (12:49 -0700)]
L2E: Add ObserveFirstPassMotionVector

Store motion vectors for each 16x16 block found in the first pass
motion search.
Provide an api "ObserveFirstPassMotionVector()" in SimpleEncode
class, similar to "ObserveFirstPassStats()".

Change-Id: Ia86386b7e4aa549f7000e7965c287380bf52e62c

3 years agoMerge "Add recode loop logics for rate_ctrl experiment"
Angie Chiang [Tue, 4 Aug 2020 02:50:55 +0000 (02:50 +0000)]
Merge "Add recode loop logics for rate_ctrl experiment"

3 years agoAdd recode loop logics for rate_ctrl experiment
angiebird [Sat, 1 Aug 2020 20:03:46 +0000 (13:03 -0700)]
Add recode loop logics for rate_ctrl experiment

Change-Id: I4de5a38e25d6b0836d90e8fcd0e56d268e5fd838

3 years agoMerge remote-tracking branch 'origin/quacking' into master
Jerome Jiang [Fri, 31 Jul 2020 17:46:14 +0000 (10:46 -0700)]
Merge remote-tracking branch 'origin/quacking' into master

BUG=webm:1686

Change-Id: I3ba5215b3791fc2bb63521d11429087cb2abd5b1

3 years agoAssign correct values for zcoeff_blk in sub8x8 RDO
Hui Su [Fri, 31 Jul 2020 05:48:09 +0000 (22:48 -0700)]
Assign correct values for zcoeff_blk in sub8x8 RDO

This fixes a lossless encoding bug as reported in the issue tracker.
Coding performance change is neutral.

BUG=webm:1700

Change-Id: I0f034b16b57e917e722709a7e9addef864b83d27

3 years agoUpdate CHANGELOG upstream-git upstream/quacking v1.9.0
Jerome Jiang [Wed, 29 Jul 2020 22:00:28 +0000 (15:00 -0700)]
Update CHANGELOG

BUG=webm:1686

Change-Id: I51ecd0fb3da5f0aa36764706f3538d0056fac268

3 years agovp9-svc: Fix the bitrate control for spatial svc
Sreerenj Balachandran [Wed, 1 Jul 2020 02:46:17 +0000 (19:46 -0700)]
vp9-svc: Fix the bitrate control for spatial svc

Make sure to initialize the layer context for spatial-svc
which has a single temporal layer.

Change-Id: I026ecec483555658e09d6d8893e56ab62ee6914b
(cherry picked from commit 1e9929390c8c18ffda02e0073481625e5afb2529)

3 years agovp9-svc: Fix to setting frame size for dynamic resize
Marco Paniconi [Fri, 26 Jun 2020 22:34:35 +0000 (15:34 -0700)]
vp9-svc: Fix to setting frame size for dynamic resize

For svc with dynamic resize (only for single_layer_svc mode),
add flag to indicate resized width/height has already been set,
otherwise on the resized/trigger frame (resize_pending=1), the
wrong resolution may be set if oxcf->width/height is different
than layer width/height in single_layer_svc mode.

Change-Id: I24403ee93fc96b830a9bf7c66d763a48762cdcb4
(cherry picked from commit de4aedaec33c6c29f882f99a740713596713a1f9)

3 years agovp9-rtc: Fix to resetting drop_spatial_layer
Marco Paniconi [Thu, 18 Jun 2020 18:24:28 +0000 (11:24 -0700)]
vp9-rtc: Fix to resetting drop_spatial_layer

The reset happens on the base spatial layer, before
encoding. But it should be reset on the
first_spatial_layer_to_encode, which may not be 0.

Change-Id: I38ef686b4459ca7433062adbfe32ef2134e1ad60
(cherry picked from commit 769129fb29fc66720be2b01276a472c334757d2d)

3 years agovp9-svc: Add svc test for denoiser and dynamic resize
Marco Paniconi [Tue, 16 Jun 2020 18:41:00 +0000 (11:41 -0700)]
vp9-svc: Add svc test for denoiser and dynamic resize

This catches the assert/crash fixed in 5174eb5.

Also fix to only check for dynamic resize in SVC mode
for base temporal layer.

Change-Id: Ie6eb7d233cc43eafb1b78cec4aeb94fb4d7fe11a
(cherry picked from commit 3101666d2a8b5b2e6bff14ffb39db685f1cc98a0)

3 years agovp9-svc: Fix to dynamic resize for svc denoising
Marco Paniconi [Tue, 16 Jun 2020 02:11:53 +0000 (19:11 -0700)]
vp9-svc: Fix to dynamic resize for svc denoising

Fix the logic to allow denoiser reset on resize for SVC mode,
as dynamic resize is allowed for SVC under single_layer mode.

Change-Id: I7776c68dadff2ccbce9b0b4a7f0d12624c2ccf90
(cherry picked from commit 5174eb5b9236a76c24e7bfadd0665d7b765395e1)

3 years agoNULL -> nullptr in CPP files
Jerome Jiang [Thu, 23 Jul 2020 23:46:01 +0000 (16:46 -0700)]
NULL -> nullptr in CPP files

This should clean up clangtidy warnings

Change-Id: Ifb5a986121b2d0bd71b9ad39a79dd46c63bdb998

3 years agoMerge "libs.mk: quiet curl output"
James Zern [Thu, 23 Jul 2020 20:29:05 +0000 (20:29 +0000)]
Merge "libs.mk: quiet curl output"

3 years agolibs.mk: quiet curl output
James Zern [Thu, 23 Jul 2020 18:48:54 +0000 (11:48 -0700)]
libs.mk: quiet curl output

+ fix error return

Change-Id: I48a9ed70fe05df603a49b3c11f813119906fc4fb

3 years agoSilience warnings about uninitiated test cases
Jerome Jiang [Tue, 21 Jul 2020 23:13:39 +0000 (16:13 -0700)]
Silience warnings about uninitiated test cases

BUG=b/159031848

Change-Id: I6bb88c24bd08e0590ec6b8ebfb696fd9b07ed011

3 years agoupdate googletest to release-1.10.0-224-g23b2a3b1
James Zern [Wed, 22 Jul 2020 18:37:40 +0000 (11:37 -0700)]
update googletest to release-1.10.0-224-g23b2a3b1

this matches libaom and provides
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST

BUG=webm:1695
BUG=b/159031848

Change-Id: Icdaf61481ab2012dd0e517dd1e600045c937c0dd

3 years agoUpdate README, AUTHORS and libs.mk
Jerome Jiang [Tue, 21 Jul 2020 00:10:49 +0000 (17:10 -0700)]
Update README, AUTHORS and libs.mk

BUG=webm:1686

Change-Id: I307cf79a74ca31ea53554a14f468b0582089aa74

3 years agoMerge "Build libsimple_encode.a separately" into quacking v1.9.0-rc1
Jerome Jiang [Mon, 20 Jul 2020 23:53:54 +0000 (23:53 +0000)]
Merge "Build libsimple_encode.a separately" into quacking

3 years agoMerge "vp8,vpx_dsp: [loongson] fix msa optimization bugs"
James Zern [Mon, 20 Jul 2020 23:44:08 +0000 (23:44 +0000)]
Merge "vp8,vpx_dsp: [loongson] fix msa optimization bugs"

3 years agoBuild libsimple_encode.a separately
angiebird [Wed, 15 Jul 2020 21:52:02 +0000 (14:52 -0700)]
Build libsimple_encode.a separately

BUG=webm:1689

Change-Id: Id920816315c6586cd652ba6cd1b3a76dfc1f12b7
(cherry picked from commit 56345d256ae191e6de042ad82ccf458de3102b8a)

3 years agoMerge "Build libsimple_encode.a separately"
Angie Chiang [Mon, 20 Jul 2020 21:30:28 +0000 (21:30 +0000)]
Merge "Build libsimple_encode.a separately"

3 years agoAdd init version of EncodeFrameWithTargetFrameBits()
angiebird [Sat, 18 Jul 2020 01:43:06 +0000 (18:43 -0700)]
Add init version of EncodeFrameWithTargetFrameBits()

Will add a unit test in a followup CL.

Change-Id: I6a6354f307c427e1a352be7c6421927323eb5e1b

3 years agovp8,vpx_dsp: [loongson] fix msa optimization bugs
jinbo [Sat, 18 Jul 2020 04:25:47 +0000 (12:25 +0800)]
vp8,vpx_dsp: [loongson] fix msa optimization bugs

Fix two bugs reported by clang when enable msa optimizatons:
1. clang dose not support uld instruction.
2. ulw instruction will result in unit cases coredump.

Change-Id: I171bed11d18b58252cbc8853428c039e2549cb95

3 years agoBuild libsimple_encode.a separately
angiebird [Wed, 15 Jul 2020 21:52:02 +0000 (14:52 -0700)]
Build libsimple_encode.a separately

BUG=webm:1689

Change-Id: Id920816315c6586cd652ba6cd1b3a76dfc1f12b7

3 years agoAdd SetEncodeSpeed() to SimpleEncode
angiebird [Mon, 15 Jun 2020 22:09:01 +0000 (15:09 -0700)]
Add SetEncodeSpeed() to SimpleEncode

Change-Id: I2fcf37045a96bb101de3359e2e69dcc266c1dc10

3 years agoMerge "test/*: rename *TestCase to TestSuite" into quacking
James Zern [Wed, 15 Jul 2020 20:10:45 +0000 (20:10 +0000)]
Merge "test/*: rename *TestCase to TestSuite" into quacking

3 years agoCap target bitrate to raw rate internally
Jerome Jiang [Wed, 8 Jul 2020 00:44:13 +0000 (17:44 -0700)]
Cap target bitrate to raw rate internally

BUG=webm:1685

Change-Id: Ida72fe854fadb19c3745724e74b67d88087eb83c
(cherry picked from commit baefbe85d09f7b884923437d9413b3e6ba4a1c7d)

3 years agoMerge "Cap target bitrate to raw rate internally"
Jerome Jiang [Mon, 13 Jul 2020 19:24:11 +0000 (19:24 +0000)]
Merge "Cap target bitrate to raw rate internally"

4 years agoCap target bitrate to raw rate internally
Jerome Jiang [Wed, 8 Jul 2020 00:44:13 +0000 (17:44 -0700)]
Cap target bitrate to raw rate internally

BUG=webm:1685

Change-Id: Ida72fe854fadb19c3745724e74b67d88087eb83c

4 years agotest/*: rename *TestCase to TestSuite
James Zern [Thu, 9 Jul 2020 23:38:00 +0000 (16:38 -0700)]
test/*: rename *TestCase to TestSuite

similar to the TEST_CASE -> TEST_SUITE changes in:
83769e3d2 update googletest to v1.10.0

BUG=webm:1695

Change-Id: Ib2bdb6bc0e4ed02d61523f8a8315b017b8ad6dad
(cherry picked from commit 6ee3f3649f21b83cfec6d08265e3724693a846af)

4 years agoMerge "test/*: rename *TestCase to TestSuite"
James Zern [Fri, 10 Jul 2020 02:35:32 +0000 (02:35 +0000)]
Merge "test/*: rename *TestCase to TestSuite"

4 years agotest/*: rename *TestCase to TestSuite
James Zern [Thu, 9 Jul 2020 23:38:00 +0000 (16:38 -0700)]
test/*: rename *TestCase to TestSuite

similar to the TEST_CASE -> TEST_SUITE changes in:
83769e3d2 update googletest to v1.10.0

BUG=webm:1695

Change-Id: Ib2bdb6bc0e4ed02d61523f8a8315b017b8ad6dad

4 years agovp8,vpx_dsp:[loongson] fix bugs reported by clang
jinbo [Wed, 1 Jul 2020 00:56:25 +0000 (08:56 +0800)]
vp8,vpx_dsp:[loongson] fix bugs reported by clang

1. Adjust variable type to match clang compiler.
Clang is more strict on the type of asm operands, float or double
type variable should use constraint 'f', integer variable should
use constraint 'r'.

2. Fix prob of using r-value in output operands.
clang report error: 'invalid use of a cast in a inline asm context
requiring an l-value: remove the cast or build with -fheinous-gnu-extensions'.

Change-Id: Iae9e08f55f249059066c391534013e320812463e

4 years agovp9: Update last_q for dropped frames
Marco Paniconi [Mon, 6 Jul 2020 21:04:57 +0000 (14:04 -0700)]
vp9: Update last_q for dropped frames

last_q is used in resize logic, should
always be last Q selected for previous
frame, encoded or dropped.

Change-Id: Ie9019ccf5a9e3acc8456a2e70cc2aa8d1c90236e

4 years agovp9: Fix to use last_q for resize check
Marco Paniconi [Mon, 6 Jul 2020 18:28:56 +0000 (11:28 -0700)]
vp9: Fix to use last_q for resize check

For temporal layers resize is only checked
on the base/TL0 frames. So rc->last_q should be used,
which because rc is in the layer context, rc->last_q
will correspond to the qindex on last TL0 frame.
In the previous code cm->base_qindex was used, which
would correspond to qindex on last encoded frame, which
is not TL0 when temporal_layers > 1.

Change-Id: Iaf86f7156d2d48ae99a1b34ad576d453d490e746

4 years agovp9-svc: Fix the bitrate control for spatial svc
Sreerenj Balachandran [Wed, 1 Jul 2020 02:46:17 +0000 (19:46 -0700)]
vp9-svc: Fix the bitrate control for spatial svc

Make sure to initialize the layer context for spatial-svc
which has a single temporal layer.

Change-Id: I026ecec483555658e09d6d8893e56ab62ee6914b

4 years agoadd CONTRIBUTING.md
James Zern [Tue, 30 Jun 2020 02:43:18 +0000 (19:43 -0700)]
add CONTRIBUTING.md

serves as a brief introduction and adds a link to the gerrit
instructions on webmproject.org.

Bug: webm:1669
Change-Id: If1d483eb48e2edcda8c51e66bdd1a86b7c35b986
(cherry picked from commit 220b00dd0d624a24a081fa60e35b024357c506ad)

4 years agoadd CONTRIBUTING.md
James Zern [Tue, 30 Jun 2020 02:43:18 +0000 (19:43 -0700)]
add CONTRIBUTING.md

serves as a brief introduction and adds a link to the gerrit
instructions on webmproject.org.

Bug: webm:1669
Change-Id: If1d483eb48e2edcda8c51e66bdd1a86b7c35b986

4 years agovp8,vpx_dsp:[loongson] fix specification of instruction name
jinbo [Wed, 24 Jun 2020 09:10:20 +0000 (17:10 +0800)]
vp8,vpx_dsp:[loongson] fix specification of instruction name

1.'xor,or,and' to 'pxor,por,pand'. In the case of operating FPR,
  gcc supports both of them, clang only supports the second type.
2.'dsrl,srl' to 'ssrld,ssrlw'. In the case of operating FPR, gcc
  supports both of them, clang only supports the second type.

Change-Id: I93b47348e7c6580d99f57dc11165b4645236533c

4 years agovp9-svc: Fix to setting frame size for dynamic resize
Marco Paniconi [Fri, 26 Jun 2020 22:34:35 +0000 (15:34 -0700)]
vp9-svc: Fix to setting frame size for dynamic resize

For svc with dynamic resize (only for single_layer_svc mode),
add flag to indicate resized width/height has already been set,
otherwise on the resized/trigger frame (resize_pending=1), the
wrong resolution may be set if oxcf->width/height is different
than layer width/height in single_layer_svc mode.

Change-Id: I24403ee93fc96b830a9bf7c66d763a48762cdcb4

4 years agovp9-svc: Allow scale_references for single layer svc
Marco Paniconi [Wed, 24 Jun 2020 02:20:01 +0000 (19:20 -0700)]
vp9-svc: Allow scale_references for single layer svc

This is needed to allow for newmv search in nonrd_pickmode
for resize/scaled frame, and for int_pro_motion_estimation
on resized/scaled frame.

Change-Id: I5e2fdbc4706a10813c1b00f6194e2442f648905a

4 years agoupdate googletest to v1.10.0
James Zern [Wed, 17 Jun 2020 19:16:51 +0000 (12:16 -0700)]
update googletest to v1.10.0

this moves the framework to c++11 and changes *_TEST_CASE* to
_TEST_SUITE

BUG=webm:1695,webm:1686

Change-Id: I07f2c20850312a9c7e381b38353d2f9f45889cb1
(cherry picked from commit 83769e3d250b05df0bb97fc619f5886587b2a310)

4 years agovp9_skip_loopfilter_test: make Init() return a bool
James Zern [Thu, 18 Jun 2020 17:54:23 +0000 (10:54 -0700)]
vp9_skip_loopfilter_test: make Init() return a bool

ASSERT's in the function only force a return, not termination. this
fixes a static analyzer issue with using a null decoder object in
following calls.

BUG=webm:1695,webm:1686

Change-Id: I79762df8076d029c5c8fef4d5e06ed655719de62
(cherry picked from commit 0370a43816cadc4939661d7b214a2077f8d25e88)

4 years agoMerge "tools/lint-hunks.py: skip third_party files"
James Zern [Fri, 19 Jun 2020 18:15:00 +0000 (18:15 +0000)]
Merge "tools/lint-hunks.py: skip third_party files"

4 years agoMerge changes I07f2c208,I79762df8
James Zern [Fri, 19 Jun 2020 02:52:58 +0000 (02:52 +0000)]
Merge changes I07f2c208,I79762df8

* changes:
  update googletest to v1.10.0
  vp9_skip_loopfilter_test: make Init() return a bool

4 years agotools/lint-hunks.py: skip third_party files
James Zern [Fri, 19 Jun 2020 01:34:55 +0000 (18:34 -0700)]
tools/lint-hunks.py: skip third_party files

Change-Id: I2fda3119c08b5755f1a9b2fad1125090b0d86850

4 years agovp9-rtc: Fix to resetting drop_spatial_layer
Marco Paniconi [Thu, 18 Jun 2020 18:24:28 +0000 (11:24 -0700)]
vp9-rtc: Fix to resetting drop_spatial_layer

The reset happens on the base spatial layer, before
encoding. But it should be reset on the
first_spatial_layer_to_encode, which may not be 0.

Change-Id: I38ef686b4459ca7433062adbfe32ef2134e1ad60

4 years agoupdate googletest to v1.10.0
James Zern [Wed, 17 Jun 2020 19:16:51 +0000 (12:16 -0700)]
update googletest to v1.10.0

this moves the framework to c++11 and changes *_TEST_CASE* to
_TEST_SUITE

BUG=webm:1695

Change-Id: I07f2c20850312a9c7e381b38353d2f9f45889cb1

4 years agovp9_skip_loopfilter_test: make Init() return a bool
James Zern [Thu, 18 Jun 2020 17:54:23 +0000 (10:54 -0700)]
vp9_skip_loopfilter_test: make Init() return a bool

ASSERT's in the function only force a return, not termination. this
fixes a static analyzer issue with using a null decoder object in
following calls.

BUG=webm:1695

Change-Id: I79762df8076d029c5c8fef4d5e06ed655719de62

4 years agovp9-rtc: Fixes to resizer for real-time
Marco Paniconi [Wed, 17 Jun 2020 17:27:39 +0000 (10:27 -0700)]
vp9-rtc: Fixes to resizer for real-time

Reduce the time before sampling begins (after key)
and reduce averaging window, to make resize act
faster.

Reset RC paramaters for temporal layers on resize.

Add per-frame-bandwidth thresholds to force
downsize for extreme case, for HD input.

Change-Id: I8e08580b2216a2e6981502552025370703cd206c

4 years agovp9-svc: Add svc test for denoiser and dynamic resize
Marco Paniconi [Tue, 16 Jun 2020 18:41:00 +0000 (11:41 -0700)]
vp9-svc: Add svc test for denoiser and dynamic resize

This catches the assert/crash fixed in 5174eb5.

Also fix to only check for dynamic resize in SVC mode
for base temporal layer.

Change-Id: Ie6eb7d233cc43eafb1b78cec4aeb94fb4d7fe11a

4 years agovp9-svc: Fix to dynamic resize for svc denoising
Marco Paniconi [Tue, 16 Jun 2020 02:11:53 +0000 (19:11 -0700)]
vp9-svc: Fix to dynamic resize for svc denoising

Fix the logic to allow denoiser reset on resize for SVC mode,
as dynamic resize is allowed for SVC under single_layer mode.

Change-Id: I7776c68dadff2ccbce9b0b4a7f0d12624c2ccf90

4 years agoLet SetExternalGroupOfPicturesMap use c-style arr
angiebird [Thu, 11 Jun 2020 22:10:38 +0000 (15:10 -0700)]
Let SetExternalGroupOfPicturesMap use c-style arr

Change-Id: Ic92ce5a3cc5bb74120eb32fc6219e43b1b861f14

4 years agoFix assertion error in simple_encode.cc
angiebird [Mon, 8 Jun 2020 23:46:15 +0000 (16:46 -0700)]
Fix assertion error in simple_encode.cc

Change-Id: I271d11cc35d34d5450a8b56fabcedaf2bb7c6565

4 years agoMerge "Refactor simple_encode_test.cc"
Angie Chiang [Wed, 3 Jun 2020 23:31:45 +0000 (23:31 +0000)]
Merge "Refactor simple_encode_test.cc"

4 years agoMerge "Add NV12 support"
Jerome Jiang [Tue, 2 Jun 2020 22:28:57 +0000 (22:28 +0000)]
Merge "Add NV12 support"

4 years agoRefactor simple_encode_test.cc
angiebird [Fri, 29 May 2020 23:26:57 +0000 (16:26 -0700)]
Refactor simple_encode_test.cc

1) Avoid using global variables.

2) Add comments to EncodeConsistencyTest.

3) Check frame_type and show_idx in EncodeConsistencyTest.

Change-Id: I2261a0bd65189beb70432d62c077ef618a2712ab

4 years agoAdd NV12 support
Jerome Jiang [Wed, 27 May 2020 20:57:50 +0000 (13:57 -0700)]
Add NV12 support

Change-Id: Ia2a8221a156e0882079c5a252f59bc84d8f516b1

4 years agoAdd extra check / unit test to SetExternalGroupOfPicturesMap()
angiebird [Wed, 27 May 2020 07:30:11 +0000 (00:30 -0700)]
Add extra check / unit test to SetExternalGroupOfPicturesMap()

Let SetExternalGroupOfPicturesMap() modify the gop_map_ to satisfy
the following constraints.
1) Each key frame position should be at the start of a gop.
2) The last gop should not use an alt ref.

Add unit test for SetExternalGroupOfPicturesMap()

Change-Id: Iee9bd238ad0fc5c2ccbf2fbd065a280c854cd718

4 years agoMerge "Refactor decode_api_test and realtime_test"
Angie Chiang [Thu, 28 May 2020 05:40:26 +0000 (05:40 +0000)]
Merge "Refactor decode_api_test and realtime_test"

4 years agoAdd functions to compute/observe key frame map
angiebird [Wed, 27 May 2020 02:02:33 +0000 (19:02 -0700)]
Add functions to compute/observe key frame map

Change-Id: I2fc0efb2ac35e64af3350bddaa802a206d1aa13c

4 years agoInit static_scene_max_gf_interval in vp9_rc_init()
angiebird [Tue, 26 May 2020 21:44:10 +0000 (14:44 -0700)]
Init static_scene_max_gf_interval in vp9_rc_init()

Change-Id: I2cad885fac2fd5f3e84d02b905a2ce59eb66760e

4 years agoMake SetExternalGroupOfPicture support no arf mode
angiebird [Tue, 26 May 2020 19:00:36 +0000 (12:00 -0700)]
Make SetExternalGroupOfPicture support no arf mode

Rename external_arf_indexes by gop_map

Use kGopMapFlagStart to indicate the start of a gop in the gop_map.
Use kGopMapFlagUseAltRef to indicate whether to use altref in the
gop_map.

Change-Id: I743e3199a24b9ae1abd5acd290da1a1f8660e6ac

4 years agoAdd GOP_COMMAND
angiebird [Sat, 23 May 2020 23:28:40 +0000 (16:28 -0700)]
Add GOP_COMMAND

Send GOP_COMMAND to vp9 for setting gop decisions on the fly.
GOP_COMMAND has three members.
use: use this command to set gop or use vp9's gop decision.
show_frame_count: number of show frames in this gop.
use_alt_ref: use alt ref frame or not.

Move the logic of processing external_arf_indexes_ from
get_gop_coding_frame_num() to GetGopCommand() and
GetCodingFrameNumFromGopMap().

Change-Id: Ic1942c7a4cf6eecdf3507864577688350c7ef0cf

4 years agoRefactor decode_api_test and realtime_test
angiebird [Tue, 19 May 2020 02:33:05 +0000 (19:33 -0700)]
Refactor decode_api_test and realtime_test

Replace NULL by nullptr.
Use override specifier over virtual specifier.

Change-Id: Iac2c97f997abd6ed9a5cd3991e052e79996f40f4

4 years agovp9_decoder: free postproc_state.prev_mip
James Zern [Tue, 19 May 2020 23:41:54 +0000 (16:41 -0700)]
vp9_decoder: free postproc_state.prev_mip

this fixes a leak when using MFQE

BUG=webm:1692

Change-Id: I19fb2f07155769f59924e0843989b3d3f8899bf6

4 years agovp9-svc: Fix key frame update refresh simulcast flexible svc
Marco Paniconi [Fri, 15 May 2020 21:02:00 +0000 (14:02 -0700)]
vp9-svc: Fix key frame update refresh simulcast flexible svc

For flexible svc in simulcast mode: don't allow refresh
of all reference slots on key frame. Which slots to update
should be based on the user flags.

Change-Id: I3597c61ebcdfed2055bbdffec7ce701fad892744

4 years agoMerge "vp9_firstpass.c: limit mv_limits with MV_MAX in motion_search"
Yunqing Wang [Fri, 15 May 2020 16:17:52 +0000 (16:17 +0000)]
Merge "vp9_firstpass.c: limit mv_limits with MV_MAX in motion_search"

4 years agovp9-rtc: Increase thresh for scene detection
Marco Paniconi [Wed, 13 May 2020 22:08:15 +0000 (15:08 -0700)]
vp9-rtc: Increase thresh for scene detection

For CBR screen content mode. Makes it more
robust to false detections.

Change-Id: Icad89adb6f79b530b589bba2c71ba88ee5088d37

4 years agoMerge "Don't collect stats if they won't be used"
Jerome Jiang [Tue, 12 May 2020 16:54:29 +0000 (16:54 +0000)]
Merge "Don't collect stats if they won't be used"

4 years agoMerge "Temporarily convert to 64 bits to avoid overflows"
James Zern [Tue, 12 May 2020 00:32:03 +0000 (00:32 +0000)]
Merge "Temporarily convert to 64 bits to avoid overflows"

4 years agoTemporarily convert to 64 bits to avoid overflows
Jorge E. Moreira [Fri, 8 May 2020 22:23:48 +0000 (15:23 -0700)]
Temporarily convert to 64 bits to avoid overflows

In the vp8_cost_branch function a couple of unsigned int are being
multiplied by integer coefficients and added to later be divided by
256. While the end result most likely fits an unsigned int, the
intermediary result of multiplying and adding sometimes doesn't (I was
able to reproduce it by leaving the encoder running at 60 fps for a
while). To avoid the multiplication overflow (which is undefined
behavior and causes a wrong result anyways) the calculation is
performed using unsigned long long instead and cast to unsigned int
for return.

Bug: b/154172422
Test: run cuttlefish with webrtc enabled for an hour
Change-Id: If7ebbda38b2450a59ed3c99ffbb59dc62431a324