make source_variance unsigned; this matches update_thresh_freq_fact()
and the type of the MACROBLOCK member.
quiets integer sanitizer warnings of the form:
vp9/encoder/vp9_pickmode.c:2710:58: 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)
James Zern [Thu, 18 Aug 2022 18:45:49 +0000 (11:45 -0700)]
loopfilter.c: normalize flat func param type
flat/flat2 are stored as int8_t as returned by the filter_mask*
functions.
this quiets integer sanitizer warnings of the form:
vpx_dsp/loopfilter.c:197:28: runtime error: implicit conversion from
type 'int8_t' (aka 'signed char') of value -1 (8-bit, signed) to type
'uint8_t' (aka 'unsigned char') changed the value to 255 (8-bit,
unsigned)
James Zern [Thu, 18 Aug 2022 23:16:33 +0000 (23:16 +0000)]
Merge changes Icfc59932,I3d1ca618,Id3966912,I56f74981,Ia9a5dc5e, ... into main
* changes:
vpx_encoder.h: make flag constants unsigned
vp8,VP8_COMP: normalize segment_encode_breakout type
webmdec,WebmInputContext: make timestamp_ns signed
highbd_quantize_intrin_sse2: quiet int sanitizer warnings
load_unaligned_u32: use an int w/_mm_cvtsi32_si128
variance_sse2.c: add some missing casts
James Zern [Wed, 17 Aug 2022 00:46:24 +0000 (17:46 -0700)]
vp8,VP8_COMP: normalize segment_encode_breakout type
use unsigned int as the API value is of this type; this quiets some
integer sanitizer warnings of the form:
implicit conversion from type 'unsigned int' of value 2147483648
(32-bit, unsigned) to type 'int' changed the value to -2147483648
(32-bit, signed)
James Zern [Wed, 17 Aug 2022 00:54:14 +0000 (17:54 -0700)]
webmdec,WebmInputContext: make timestamp_ns signed
this matches the type returned from libwebm, which uses -1 as an error;
quiets integer sanitizer warnings of the form:
implicit conversion from type 'long long' of value -1 (64-bit, signed)
to type 'uint64_t' (aka 'unsigned long') changed the value to 18446744073709551615 (64-bit, unsigned)
James Zern [Wed, 17 Aug 2022 00:28:08 +0000 (17:28 -0700)]
highbd_quantize_intrin_sse2: quiet int sanitizer warnings
add a missing cast in ^ operations; quiets warnings of the form:
implicit conversion from type 'int' of value -1 (32-bit, signed) to type
'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
James Zern [Tue, 16 Aug 2022 23:52:06 +0000 (16:52 -0700)]
load_unaligned_u32: use an int w/_mm_cvtsi32_si128
this matches the type of the function parameter; quiets integer
sanitizer warnings of the form:
implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 3215646151 (32-bit, unsigned) to type 'int' changed the value to
-1079321145 (32-bit, signed)
James Zern [Tue, 16 Aug 2022 23:48:00 +0000 (16:48 -0700)]
variance_sse2.c: add some missing casts
quiets integer sanitizer warnings of the form:
../vpx_dsp/x86/variance_sse2.c:100:10: runtime error: implicit
conversion from type 'unsigned int' of value 4294966272 (32-bit,
unsigned) to type 'int' changed the value to -1024 (32-bit, signed)
James Zern [Tue, 16 Aug 2022 20:57:25 +0000 (13:57 -0700)]
configure: add -Wno-pass-failed for libyuv
with certain optimization flags or sanitizers enabled some code may fail
to vectorize:
third_party/libyuv/source/row_common.cc:3178:7: warning: loop not
vectorized: the optimizer was unable to perform the requested
transformation; the transformation might be disabled or specified as
part of an unsupported transformation ordering
[-Wpass-failed=transform-warning]
this was observed with integer/undefined sanitizers using clang 11/13
fixes warnings of the form:
../vp9/simple_encode.cc:755:48: warning: empty expression statement has
no effect; remove unnecessary ';' to silence this warning
[-Wextra-semi-stmt]
SET_STRUCT_VALUE(config, oxcf, ret, key_freq);
James Zern [Mon, 8 Aug 2022 18:28:27 +0000 (11:28 -0700)]
vp9_cx_iface,encoder_encode: only calc ts when img!=NULL
avoid calculating the end timestamp when performing a flush to prevent
an implicit conversion warning when applying a non-zero offset to a 0
pts used in that case:
vp9/vp9_cx_iface.c:1361:50: runtime error: implicit conversion from type
'vpx_codec_pts_t' (aka 'long') of value -15 (64-bit, signed) to type
'unsigned long' changed the value to 18446744073709551601 (64-bit,
unsigned)
this fixes runtime errors with clang -fsanitize=integer in x86 builds:
../vp9/encoder/vp9_rdopt.c:3250:17: runtime error: signed integer
overflow: 18 - -2147483648 cannot be represented in type 'int'
../vp9/encoder/vp9_rdopt.c:3277:16: runtime error: signed integer
overflow: 26 - -2147483648 cannot be represented in type 'int'
James Zern [Wed, 27 Jul 2022 22:22:37 +0000 (15:22 -0700)]
x86: normalize type with _mm_cvtsi128_si32
prefer int in most cases
w/clang -fsanitize=integer fixes warnings of the form:
implicit conversion from type 'int' of value -809931979 (32-bit, signed)
to type 'uint32_t' (aka 'unsigned int') changed the value to 3485035317
(32-bit, unsigned)
w/clang -fsanitize=integer fixes warnings of the form:
implicit conversion from type 'int' of value -2 (32-bit, signed) to type
'unsigned int' changed the value to 4294967294 (32-bit, unsigned)
James Zern [Wed, 27 Jul 2022 22:41:00 +0000 (15:41 -0700)]
variance_avx2.c: fix implicit conversion warnings
w/clang -fsanitize=integer fixes warnings of the form:
implicit conversion from type 'int' of value -1323 (32-bit, signed) to
type 'unsigned int' changed the value to 4294965973 (32-bit, unsigned)
w/clang -fsanitize=integer fixes warnings of the form:
implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294443008 (32-bit, unsigned) to type 'int' changed the value to -524288
(32-bit, signed)
vp8/common/findnearmv.c:108:11: runtime error: implicit conversion from
type 'uint32_t' (aka 'unsigned int') of value 4294443008 (32-bit,
unsigned) to type 'int' changed the value to -524288 (32-bit, signed)
vp8/common/findnearmv.c:110:33: runtime error: implicit conversion from
type 'int' of value -524288 (32-bit, signed) to type 'uint32_t' (aka
'unsigned int') changed the value to 4294443008 (32-bit, unsigned)
James Zern [Wed, 27 Jul 2022 20:29:41 +0000 (13:29 -0700)]
encode_test_driver: normalize frame_flags type
use vpx_enc_frame_flags_t; this avoids int -> unsigned conversion
warnings; reported w/clang -fsanitize=integer:
test/error_resilience_test.cc:95:9: runtime error: implicit conversion
from type 'int' of value -12845057 (32-bit, signed) to type 'unsigned
long' changed the value to 4282122239 (32-bit, unsigned)
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