reported under clang-13; use a while loop in file_read() to force a size
check before attempting to read. buf (aux_buf) may be may be null when
no conversion is necessary.
y4minput.c:29:43: runtime error: applying zero offset to null pointer
James Zern [Wed, 27 Jul 2022 01:17:22 +0000 (18:17 -0700)]
highbd_temporal_filter_sse4: remove unused function params
this clears warnings under clang-13 of the form:
vp9/encoder/x86/highbd_temporal_filter_sse4.c|196 col 63| warning:
parameter 'v_pre' set but not used [-Wunused-but-set-parameter]
this is the high-bitdepth version of: 73b8aade8 temporal_filter_sse4: remove unused function params
Add unit tests for a 4 frame video, which could be considered as a
corner case.
Three different GOP settings are tested and verified as valid.
(1). The first GOP has 3 coding frames, no alt ref.
The second GOP has 1 coding frame, no alt ref.
The numer of coding frames is 4.
Their frame types are: keyframe, inter_frame, inter_frame,
golden_frame.
(2). The first GOP has 4 coding frames, use alt ref.
The second GOP has 1 coding frame, which is the overlay of
the first GOP's alt ref frame.
The numer of coding frames is 5.
Their types are: keyframe, alt_ref, inter_frame, inter_frame,
overlay_frame.
(3). Only one GOP with 4 coding frames, do not use alt ref.
The numer of coding frames is 4.
Their types are: keyframe, inter_frame, inter_frame, inter_frame.
James Zern [Tue, 19 Jul 2022 23:32:30 +0000 (16:32 -0700)]
pp_filter_test: quiet static analysis warning
in CheckLowFilterOutput(); use std::unique_ptr to avoid spurious memory
leak warning:
test/pp_filter_test.cc|466 col 3| warning: Potential leak of memory
pointed to by 'expected_output' [cplusplus.NewDeleteLeaks]
ASSERT_NE(expected_output, nullptr);
James Zern [Tue, 19 Jul 2022 23:30:59 +0000 (16:30 -0700)]
encode_api_test: quiet static analysis warning
in ConfigChangeThreadCount(); initialize cfg as the static analyzer can
assume AlwaysTrue() within EXPECT_NO_FATAL_FAILURE may return false
causing InitCodec() not to be called.
test/encode_api_test.cc|321 col 3| warning: 1st function call argument
is an uninitialized value [core.CallAndMessage]
video.SetSize(cfg.g_w, cfg.g_h);
James Zern [Tue, 19 Jul 2022 02:00:49 +0000 (19:00 -0700)]
avg_intrin_{sse2,avg2}: rm dead store in hadamard_8x8
this quiets a couple static analysis warnings with clang 11:
vpx_dsp/x86/avg_intrin_sse2.c:278:45: warning: Although the value stored
to 'src_diff' is used in the enclosing expression, the value is never
actually read from 'src_diff' [deadcode.DeadStores]
src[7] = _mm_load_si128((const __m128i *)(src_diff += src_stride));
^ ~~~~~~~~~~
vpx_dsp/x86/avg_intrin_avx2.c:307:49: warning: Although the value stored
to 'src_diff' is used in the enclosing expression, the value is never
actually read from 'src_diff' [deadcode.DeadStores]
src[7] = _mm256_loadu_si256((const __m256i *)(src_diff += src_stride));
^ ~~~~~~~~~~
Marco Paniconi [Tue, 28 Jun 2022 18:22:48 +0000 (11:22 -0700)]
rtc-svc: Fix to make SVC work for Profile 1
Added datarate unittest for 4:4:4 and 4:2:2 input,
for spatial and temporal layers.
Fix is needed in vp9_set_literal_size():
the sampling_x/y should be passed into update_inital_width(),
othewise sampling_x/y = 1/1 (4:2:0) was forced.
vp9_set_literal_size() is only called by the svc and
on dynamic resize.
Fix issue with the normative optimized scaler:
UV width/height was assumed to be 1/2 of Y, for
the ssse and neon code.
Also fix to assert for the scaled width/height:
in case scaled width/height is odd it should be
incremented by 1 (make it even).
Jerome Jiang [Tue, 28 Jun 2022 21:07:31 +0000 (17:07 -0400)]
Merge tag 'v1.12.0' into main
Release v1.12.0 Torrent Duck
2022-06-17 v1.12.0 "Torrent Duck"
This release adds optimizations for Loongarch, adds support for vp8 in the
real-time rate control library, upgrades GoogleTest to v1.11.0, updates
libwebm to libwebm-1.0.0.28-20-g206d268, and includes numerous bug fixes.
- Upgrading:
This release is ABI compatible with the previous release.
vp8 support in the real-time rate control library.
New codec control VP8E_SET_RTC_EXTERNAL_RATECTRL is added.
Configure support for darwin21 is added.
GoogleTest is upgraded to v1.11.0.
libwebm is updated to libwebm-1.0.0.28-20-g206d268.
- Enhancement:
Numerous improvements on checking memory allocations.
Optimizations for Loongarch.
Code clean-up.
- Bug fixes:
Fix to a crash related to {vp8/vp9}_set_roi_map.
Fix to compiling failure with -Wformat-nonliteral.
Fix to integer overflow with vp9 with high resolution content.
Fix to AddNoiseTest failure with ARMv7.
Fix to libvpx Null-dereference READ in vp8.
James Zern [Fri, 17 Jun 2022 01:43:44 +0000 (18:43 -0700)]
vp9_encode_sb_row: remove a branch w/CONFIG_REALTIME_ONLY
replace the check on use_nonrd_pick_mode with an assert. this is only a
start, there are many branches that could be removed that check mode ==
REALTIME, etc. with this configuration.
James Zern [Fri, 17 Jun 2022 01:22:52 +0000 (18:22 -0700)]
vp9_cx_iface: set default cpu_used=5 w/CONFIG_REALTIME_ONLY
this avoids a crash if cpu-used is not explicitly set as there are some
(unnecessary) checks against use_nonrd_pick_mode which would cause
encoding to be skipped if the old default of 0 were used
James Zern [Fri, 17 Jun 2022 01:43:44 +0000 (18:43 -0700)]
vp9_encode_sb_row: remove a branch w/CONFIG_REALTIME_ONLY
replace the check on use_nonrd_pick_mode with an assert. this is only a
start, there are many branches that could be removed that check mode ==
REALTIME, etc. with this configuration.
James Zern [Fri, 17 Jun 2022 01:22:52 +0000 (18:22 -0700)]
vp9_cx_iface: set default cpu_used=5 w/CONFIG_REALTIME_ONLY
this avoids a crash if cpu-used is not explicitly set as there are some
(unnecessary) checks against use_nonrd_pick_mode which would cause
encoding to be skipped if the old default of 0 were used
Wan-Teh Chang [Fri, 10 Jun 2022 20:52:31 +0000 (13:52 -0700)]
Convert EncoderTest::last_pts_ to a local variable
Convert the data member EncoderTest::last_pts_ to a local variable in
the EncoderTest::RunLoop() and VP9FrameSizeTestsLarge::RunLoop()
methods. EncoderTest::last_pts_ is only used in these two methods, and
these two methods first set EncoderTest::last_pts_ to 0 before using it.
So EncoderTest::last_pts_ is effectively a local variable in these two
methods.
Note that several subclasses of EncoderTest declare their own last_pts_
data member and use it to calculate the data rate. Apparently their own
last_pts_ data member hides the same-named data member in the base
class. Although this is allowed by C++, this is very confusing.
James Zern [Fri, 3 Jun 2022 02:38:03 +0000 (19:38 -0700)]
libs.mk,build/make/Makefile: make test targets ordinary rules
this fixes a regression in make 4.2 and still present in 4.3 causing
double colon rules to be serialized which breaks sharding done by the
test and test-no-data-check rules. these targets only define one set of
rules so ordinary rules work unlike clean. install may be another
candidate, but that's left for a follow up.
Change-Id: I9f074eca2ad266eeca6e31aae2e9f31eec8680e0
Tested: make 3.81, 4.1, 4.2, 4.2.1, 4.3
James Zern [Thu, 2 Jun 2022 01:55:10 +0000 (18:55 -0700)]
vp9,encoder: fix some integer sanitizer warnings
the issues fixed in this change are related to implicit conversions
between int / unsigned int:
vp9/encoder/vp9_segmentation.c:42:36: runtime error: implicit conversion
from type 'int' of value -9 (32-bit, signed) to type 'unsigned int'
changed the value to 4294967287 (32-bit, unsigned)
vpx_dsp/x86/sum_squares_sse2.c:36:52: runtime error: implicit conversion
from type 'unsigned int' of value 4294967295 (32-bit, unsigned) to type
'int' changed the value to -1 (32-bit, signed)
vpx_dsp/x86/sum_squares_sse2.c:36:67: runtime error: implicit conversion
from type 'unsigned int' of value 4294967295 (32-bit, unsigned) to type
'int' changed the value to -1 (32-bit, signed)
vp9/encoder/x86/vp9_diamond_search_sad_avx.c:81:45: runtime error:
implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4290576316 (32-bit, unsigned) to type 'int' changed the value to
-4390980 (32-bit, signed)
vp9/encoder/vp9_rdopt.c:3472:31: runtime error: implicit conversion from
type 'int' of value -1024 (32-bit, signed) to type 'uint16_t' (aka
'unsigned short') changed the value to 64512 (16-bit, unsigned)
unsigned is forced for masks and int is used with intel intrinsics
James Zern [Sat, 28 May 2022 22:25:49 +0000 (15:25 -0700)]
resize_test: add TODO for ResizeTest instantiation for VP9
this should match VP8 and use ONE_PASS_TEST_MODES, but currently the
code will produce integer sanitizer warnings and may segfault under
certain conditions
James Zern [Fri, 27 May 2022 02:38:01 +0000 (19:38 -0700)]
libs.doxy_template: remove some obsolete variables
- COLS_IN_ALPHA_INDEX
this was unused given ALPHABETICAL_INDEX = NO
- PERL_PATH / MSCGEN_PATH
these were unused
quiets warnings with doxygen 1.9.1:
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 1110 of file 'doxyfile' has
become obsolete.
warning: Tag 'PERL_PATH' at line 1105 of file 'doxyfile' has become
obsolete.
warning: Tag 'MSCGEN_PATH' at line 1126 of file 'doxyfile' has become
obsolete
Cheng Chen [Fri, 13 May 2022 20:42:28 +0000 (13:42 -0700)]
L2E: Add vp9 GOP decision helper function
Add a helper function to call the external rate control model.
The helper function is placed in the function where vp9 determines
GOP decisions.
The helper function passes frame information, including current
frame show index, coding index, etc to the external rate control
model, and then receives GOP decisions.
The received GOP decisions overwrites the default GOP decision, only
when the external rate control model is set to be active via
the codec control.
The decision should satisfy a few constraints, for example, larger
than min_gf_interval; smaller than max_gf_interval. Otherwise,
return error.
Unit tests are added to test the new functionality.
Original change's description:
> [NEON] Optimize vp9_diamond_search_sad() for NEON
>
> About 50% improvement in comparison to the C function.
> I have followed the AVX version with some simplifications.
>
> Change-Id: I72ddbdb2fbc5ed8a7f0210703fe05523a37db1c9
Marco Paniconi [Mon, 16 May 2022 05:15:29 +0000 (22:15 -0700)]
vp9-rtc: Fix to usage of active_maps when aq_mode=0
If aq_mode=0 the segmentation feature may still be used
for active_maps, so the condition active_maps.enabled
needs to be added in two places regarding segmentation
logic in encodeframe.c. Otherwise the active_maps would
have no effect.
This also resolves why the assert in bug webm:1762 was
not triggered when aq_mode=0.
Marco Paniconi [Thu, 12 May 2022 18:18:19 +0000 (11:18 -0700)]
vp9-rtc: Fix to interp_filter for segment skip
For segment skip feature: allow for setting the
mi->interp_filter to BILINEAR, if cm->interp_filter
is set BILIENAR. This can happen at speed 9 when the
segment skip feature is used (e.g., active_maps)
Without this fix the assert can be triggered with the
active_map_test.cc for speed 9 included.
Updated the test.
Fixes the assert triggered in the issue:
Bug: webm:1762