1807 Commits

Author SHA1 Message Date
Matt Oliver ef79796c8d project: Update for 1.15.1 merge. 2025-06-14 21:52:12 +10:00
Matt Oliver 8186b704b7 Merge commit '39e8b9dcd4696d9ac3ebd4722e012488382f1adb' 2025-06-14 21:02:34 +10:00
Matt Oliver bcecc98a79 project: Update for 1.15.0 merge. 2025-06-14 19:48:26 +10:00
Matt Oliver 70414c8112 Merge commit '9f9b7e9ba2eb9d01640a9e69a3d655866265cf7f' 2025-06-14 19:22:24 +10:00
Jerome Jiang 39e8b9dcd4 Bump VPX_EXT_RATECTRL_ABI_VERSION
Fix the order of the newly added codec control

Bug: webm:384672478
Change-Id: I045c58865399ea9d74c91c1a5521215a0d2032f7
2025-01-10 14:30:59 -05:00
Jerome Jiang 2f1ad02bd5 Add changelog for v1.15.1 release
Bug: webm:384672478
Change-Id: I3346b06eb05e306eb23f7281b65ff7e9c84e7e6b
2025-01-09 14:52:08 -05:00
Jerome Jiang 69da847f66 Bump up version major
Before v1.15.0: c=10, a=1, r=0

Rule #3: source code has changed, increment r:
r=1

Rule #4: interfaces were removed in vpx_tpl.h, set r=0, increment c:
c=11, r=0

Rule #5: no interfaces have been added

Rule #6: interfaces were removed in vpx_tpl.h, set a=0:
a=0

After release: c=11, a=0, r=0

major = c-a = 11
minor = a = 0
patch = r = 0

Bug: webm:384672478
Change-Id: I2e70e7e35c64ece32eaf1dc5625640965483f9b9
2025-01-07 14:17:40 -05:00
James Zern 82a0c8a2db configure: add support for darwin24 (macOS 15.x)
Bug: webm:379534940
Change-Id: I8777b6bb8653a31080801e35916df9aa39a4c999
(cherry picked from commit 6e23d972a7a717f2ba3970c82b6b96d350b5bcde)
2024-11-19 22:03:26 +00:00
Matt Oliver bbedc9be7c project: Update template file for WinRT. 2024-11-09 19:38:13 +11:00
Jerome Jiang 9f9b7e9ba2 Changelog: add neon optimization speed up stats
Bug: webm:372498543
Change-Id: I297be5efb602b0181c2b25ff8b50060c10263130
2024-10-23 14:24:57 -04:00
Jerome Jiang 0ba09cc79f Update CHANGELOG and version
Bug: webm:372498543
Change-Id: Ieddfa0b18f8c5e53ab65e04b52b5a601c672ba62
2024-10-22 15:36:11 -04:00
James Zern 3939c5ebb0 vpx_highbd_convolve8_avg_sve2: fix C fallback typo
vpx_highbd_convolve8_c -> vpx_highbd_convolve8_avg_c

Change-Id: I8bc73c59d3e654739ee5c42a295f4ecdee6d7631
(cherry picked from commit 3500e57e52b6af057ed54223e15e560a95df8479)
2024-10-10 13:32:53 -04:00
Jerome Jiang 816a90fe76 Update AUTHORS and .mailmap
Bug: webm:372498543
Change-Id: I5041fd1558c0a36dce10395ec6e836f3d55384dc
2024-10-09 15:18:53 -04:00
Marco Paniconi 192b4a4ce7 rtc-vp9: Always disable svc_use_low_part
Possible fix for issue below. It was only disabled
for screen in a previous change, but we force it off
always to check if it clears the issue.

The speed feature disabled is only used for 3 spatial
layers and at least 2 temporal. The impact on speed is
expected to be small, ~2%, so ok to disable for now and
see if it clears the issue.

Bug: 366146260
Change-Id: If7af006425e1e0ef297b9d6466507ea4c90ddb6f
(cherry picked from commit 09b3d5fc5aa48752f95f4c0c37b0bd4ff55c0ba1)
2024-10-09 15:07:31 -04:00
Marco Paniconi cdd4e35015 vp8: Fix integer overflow in encode_frame_to_data_rate
Integer overflow in encode_frame_to_data_rate()
for the update:
lc->total_target_vs_actual += bits_off_for_this_layer

Fix is to use int64_t for total_target_vs_actual.

Bug: chromium:368114043
Change-Id: I9a01e1a69e26ae748e8ae23d9e1287431510388d
2024-09-20 09:50:41 -07:00
Wan-Teh Chang aa73610d03 Fix a typo: avg_frame_index => avg_frame_qindex
Change-Id: I8fd9f6f01ae712a9bf3dc9e34fe5f7115a305109
2024-09-19 00:09:36 -07:00
Marco Paniconi 417204d7fd rtc-vp9: Fix to integer overflow in vp9-svc
Divide by 3 instead of multiple by 3, in comparison of
lrc->avg_frame_bandwidth vd lrc->last_avg_frame_bandwidth,
in two functions for reset rc.
Small loss in precision, so acceptable.

Similar change to:
https://chromium-review.googlesource.com/c/webm/libvpx/+/5698570

Bug: chromium:367892770
Change-Id: Ia9ef09a9f6beba930fedd496407cfa7057e39336
2024-09-18 14:33:49 -07:00
James Zern ac68e7f999 aarch64_cpudetect: detect SVE/SVE2 on Windows
PF_ARM_SVE_INSTRUCTIONS_AVAILABLE and PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE
are available in WinSDK 10.0.26100 and recent versions of mingw-w64.

Based on a patch by Martin Storsjö on ffmpeg-devel:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-September/333611.html

Change-Id: I34b2341a559f95aa400e84d709f3eb36da5dbb7b
2024-09-18 19:43:10 +00:00
James Zern 729b78a127 aarch64_cpudetect: detect I8MM on Windows via SVE-I8MM
There's no direct processor feature constant for I8MM alone, but
there is a flag for SVE-I8MM (added in WinSDK 10.0.26100 and
recent versions of mingw-w64). If SVE-I8MM is available, we can
assume that I8MM is available.

While HW supporting these features isn't yet commonly running
Windows, this at least allows detecting and running the I8MM codepaths
in Windows builds in Wine (possibly running in QEMU).

Based on patch from Martin Storsjö on ffmpeg-devel:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-September/333609.html

Change-Id: I77117bee8516924fddcdecccae8bab3cf5beed96
2024-09-18 19:43:10 +00:00
James Zern 6dfdc4ee10 tiny_ssim: fix argc check
The program requires a minimum of 2 parameters. Previously the tool
would crash if only one input file was given.

Bug: webm:365481206
Change-Id: I875d81b2db4fcc4338061c03b23bb51b0aad58e4
2024-09-18 19:06:17 +00:00
Marco Paniconi 696c488d35 rtc-vp9: Disable svc_use_low_part for screen
Possible fix for issue below. The speed feature disabled
is only used for 3 spatial layers and at least 2 temporal.
The impact on speed is expected to be small, ~2%, so ok
to disable for now and see if it clears the issue.

Bug: 366146260

Change-Id: I94ab991d583cc2ce758db337abbbb463a65f0767
2024-09-17 23:07:24 +00:00
Jerome Jiang c6de95ce0e Initialize gf_picture in vp9 tpl
Bug: b/365068397
Change-Id: Id267532928353148f916b73feb19de515db14cb9
2024-09-06 13:02:12 -04:00
James Zern 3ba1fada8b vpx_image.h: add lifetime note for img_data
The wrapped storage must exist for the duration of the vpx_image_t
allocation.

Bug: aomedia:363806063
Change-Id: Ic6b79a56b6c07776222d1767490d873d7408ced0
2024-09-03 19:19:09 -07:00
Marco Paniconi fbf63dff1f vp9: clamp the calculation of sb64_target_rate to INT_MAX
Bug: b/361617762
Change-Id: Ie7d2b0973e6de23d6e992ee058cbb94b826fda65
2024-08-28 14:48:57 +00:00
James Zern 507aea8e29 vp9_speed_features.h: fix partition_search_type comment
FIXED_SIZE_PARTITION -> FIXED_PARTITION

Change-Id: I5e6a561042d7dfa87d6f11b033052d340e433440
2024-08-27 17:38:43 -07:00
James Zern 50aa6cca4d README: add security report note
The default template for https://issues.webmproject.org/ is a public bug
report. Security issues can be reported securely using the 'Security
report' template.

Change-Id: Ic7144a6c7a144772b78852d1415a51a570c79d50
2024-08-26 15:30:01 -07:00
Wan-Teh Chang f00fa3ce74 Add macro name as comment for header guard #endif
Change-Id: I948f21f414fc269ad03673636506fa83acf5f5f6
2024-08-23 00:35:45 +00:00
Wan-Teh Chang 35b908f808 Add #ifndef header guard to vpx_version.h
Change-Id: Ief028037a3a56b1f18998298ad594a86cf906bd3
2024-08-22 14:40:16 -07:00
James Zern 2c778f4da6 remove vp9_{highbd_,}resize_frame*()
and examples/resize_util.c. These functions were added in:
  3cd37dfeb Adds a non-normative resize library to vp9 encoder
but never used meaningfully in the library.

This mirrors the change in libaom:
  d10029bb4b Restore function prototype of av1_resize_frame420
except that vp9_resize_frame420() was never exported in the shared
library, so can be deleted along with the rest.

The reasoning for removing examples/resize_util.c is the same: it is not
useful and examples should use the public functions of the libvpx
library.

Change-Id: I386080d3f1a3ef81dfc87fcdf5bbdf459d996f03
2024-08-21 19:22:48 -07:00
James Zern 312a9004c1 remove vpx_ssim_parms_16x16()
The last reference to this function was removed in:
5511968f2 Removed several unused functions.

Change-Id: I644482b4f0c9c4765035adcdc21ec495e3e3a6e6
2024-08-20 17:47:07 -07:00
Yunqing Wang a5ea71f091 Key frame temporal filtering
Added key frame temporal filtering. Enabled it for VOD encoding
with encoder speed < 2.
Minor improvement in prediction.
Added the restriction of using no more than "arnr_max_frames"
frames for temporal filtering.
Key frame temporal filtering is turned off by default for now. To
enable it, set "--enable-keyframe-filtering=1"

Borg result with "--enable-keyframe-filtering=1"
         avg_psnr:  ovr_psnr:   ssim:    vmaf:
hdres2:   -0.762     -0.863    -0.903   -0.680
midres2:  -0.813     -0.753    -0.757   -0.743
lowres2:  -0.492     -0.598    -0.737   -0.881
The impact on the encoder time is minimal.

Change-Id: If6abea3e21efcb96f1978cd9dfaa742c40dc2a56
2024-08-19 17:59:58 +00:00
Jerome Jiang 5d20cc3081 IWYU: include vp9_ext_ratectrl.h for tpl
Change-Id: Ia00dc7f79a69eb73c85fb409418861bef459e863
2024-08-19 11:05:38 -04:00
Jerome Jiang ee2552d903 vp9 ext rc: TPL & final encoding use same QP
Removed codec control VP9E_ENABLE_EXTERNAL_RC_TPL since it is
no longer needed.

Change-Id: I151254ff3f0496c017ddf73c2caf94783ef38f31
2024-08-16 17:16:29 -04:00
Jerome Jiang a69eeb0af2 ext rc: Override encode QP in TPL pass for VBR
Change-Id: I8f32b5847b57313d00401f5596ed62ac7c4817f0
2024-08-16 16:50:21 -04:00
Jerome Jiang d9d6c5e2c9 Remove ext_rc_recode
This flag is always set to 0

Change-Id: I228b3befae478517e7b31228d4a6553af4fd7a27
2024-08-16 13:54:02 -04:00
James Zern 95568674c2 remove redundant && __GNUC__ preproc check
`#if defined(__GNUC__)` is enough if a specific version isn't being
looked for.

Bug: aomedia:356832974
Change-Id: I3fcbecf9d547c6a2d89d7b5456e83ee08ddc6f5e
2024-08-16 16:43:45 +00:00
Yunqing Wang fcd1f39e56 Improve temporal filter prediction and process
Applied 12-tap filter to temporal filter prediction for better
result. Improved the calculation of frames to be used in temporal
filtering.

The overall PSNR gain was -0.511% (lowres), -0.338% (midres), and
-0.288% (hdres).
Encoder time was increased by ~2%, which would be largely reduced
by the following SIMD optimization.

Change-Id: If3ece30f1614beadc99ebf6b4dc3f2d988d3bdb9
2024-08-09 23:05:32 +00:00
Jerome Jiang 13be4a7190 Remove a stale TODO in ext RC
Change-Id: Ie871a476a7a0b04cf88db17da8402dad1c3247f7
2024-08-09 18:02:00 +00:00
Wan-Teh Chang b222d72285 Add the saturate_cast_double_to_int() function
Move the saturate_cast_double_to_int() function in
vp8/encoder/firstpass.c to vpx_dsp/vpx_dsp_common.h so that it can be
used in other files.

Change-Id: I748fea969520542dca68d7a46500d3272f22e16f
2024-08-08 11:42:03 -07:00
Jerome Jiang c18b9f7c68 Add min/max q index to ext rc config
Change-Id: I5d152f3b0868e78c6b33fe651c6a40597b42feef
2024-08-08 10:24:29 -04:00
James Zern 634e1f8fb1 vp9_calc_iframe_target_size_one_pass_cbr: clamp final target
to INT_MAX. This matches calc_iframe_target_size() in VP8
(http://crbug.com/1473473). If rc->avg_frame_bandwidth is large even
small kf_boost values will overflow an int.

Change-Id: Iaca5b47fe97793ae70930b3b2c2f42725d2c96fb
2024-08-08 02:37:47 +00:00
James Zern bb95d3652b update libwebm to libwebm-1.0.0.31-10-g3b63004
This fixes a build error seen in gcc 15:
3b63004 mkvparser/mkvparser.cc: add missing <cstdint> include

Bug: aomedia:357622679
Change-Id: I6c4a1795d189f9993d4f2c5c9f0375912bc58f0c
2024-08-06 11:31:25 -07:00
Wan-Teh Chang 428f3104fa Include "gtest/gtest.h" using the shorter path
Rely on the -I or -system compiler option to find "gtest/gtest.h". This
makes it easier to build our tests against a copy of gtest outside the
libvpx source tree.

Bug: webm:42330726
Change-Id: I3b189c6345e13b36b236d1eedc6ee091bfa71f48
2024-08-02 22:42:20 +00:00
Jerome Jiang 1865f20e9a Extend border for vp8 loopfilter
Bug: webm:356482713
Change-Id: I149d077a57d55c46fe1924cff4c5cfcf5c7609b0
2024-08-02 14:59:58 -04:00
Wan-Teh Chang 9f06827eeb Run clang-format on three files
Change-Id: I055186d915d4660e848f6d856d7895953aaf76ba
2024-08-02 07:03:40 -07:00
James Zern 0c4af6b4c1 vpx_fdct16x16_avx2: add missing cast
Fixes:
vpx_dsp/x86/fwd_txfm_avx2.c:378:50: error: incompatible pointer types
  passing 'int16_t *' (aka 'short *') to parameter of type
  'tran_low_t *' (aka 'int *') [-Werror,-Wincompatible-pointer-types]

Change-Id: I9f50547c1fc885c24b4b91e4c7d6857d397cceed
2024-08-02 00:14:58 +00:00
James Zern b5451de5c5 vp9_extrc_update_encodeframe_result: normalize decl & def
Fixes compiler warning in visual studio after:
2ab292e9e Remove unused parameters from ext rc callback

vp9\encoder\vp9_ext_ratectrl.c(186): warning C4028: formal parameter 3
different from declaration

Change-Id: I4cfddb3f55fb7191ebaf578851ab3bc2c55106e3
2024-08-02 00:14:58 +00:00
James Zern 4295bf4f0f Update third_party/libwebm to commit f4b07ec
Change-Id: I18ff0e388d3c8b683385d98d76bff3e238488a94
2024-08-01 13:38:00 -07:00
Jerome Jiang 2ab292e9e1 Remove unused parameters from ext rc callback
Bug: b/356424505
Change-Id: I1c684e7f4cc9bb7b916354d391abd1ae168af39f
2024-07-31 22:03:08 +00:00
James Zern 3cc287bbd7 vpx_scale,scale1d_c: add assert(dest_scale != 0)
This fixes a 'division by zero' static analysis report (seen with
clang-14).

Bug: b:328632178
Change-Id: I4c051631ff1a948e8f83a831286e01fc50ff1c1d
2024-07-31 18:25:19 +00:00
James Zern 8db1b663e2 vp9_subexp,remap_prob: add an assert
Fixes a 'Result of operation is garbage or undefined' static analysis
report (seen with clang-14) related to left shifting a negative value.

Bug: b:328632178
Change-Id: I18f0100eca0deac1cac9be0c7e848685d2911fb3
2024-07-30 14:54:01 -07:00
James Zern f987e3514c doxygen: quiet warnings in decoder-only config
Fixes:
warning: explicit link request to 'VP9E_SET_EXTERNAL_RATE_CONTROL' could
not be resolved

Change-Id: If7a0d97412cc8fad3457031fbf29cb447635f4a0
2024-07-30 17:55:49 +00:00
James Zern 85d386599d systemdependent.c: fix warning w/CONFIG_MULTITHREAD=0
fixes:
vp8/common/generic/systemdependent.c: In function
   'vp8_machine_specific_config':
vp8/common/generic/systemdependent.c:63:46: warning: unused parameter
   'ctx' [-Wunused-parameter]
    63 | void vp8_machine_specific_config(VP8_COMMON *ctx) {

Change-Id: I0eeaa0c27ccfa901cc62150eed590f5056eb9238
2024-07-29 13:23:58 -07:00
James Zern cdf8da4c03 vp8: fix OOB access in x->MVcount
Motion vectors are now clamped in
vp8_find_best_sub_pixel_step_iteratively, vp8_find_best_sub_pixel_step,
vp8_find_best_half_pixel_step, vp8_full_search_sad,
vp8_refining_search_sadx4 and vp8_refining_search_sad_c (the rtcd for
other optimizations are redirects to vp8_refining_search_sadx4).

The difference of valid motion vectors may still go beyond the range of
the MVcount array, however, so additional checks are added to
rd_update_mvcount() and update_mvcount().

Note the test source and settings (speed 1 and GOOD quality mode) come
from the issue report; additional coverage is added for realtime. The
realtime path does not trigger the error without the fix, but as it's
similar to the rd path, the same clamp is done to be safe.

Fixes:
vp8/encoder/rdopt.c:1579:5: runtime error: index 17467 out of bounds for
  type 'unsigned int[2047]'

Bug: oss-fuzz:69906
Change-Id: Ia8bd087cfe4475ab09ba711ed806fbcbaa72e552
2024-07-25 15:08:02 -07:00
James Zern f9120b789d vp8,calc_iframe_target_size: clamp kf_boost
cpi->output_framerate may be as large as 10M. Previously this would
cause kf_boost to be ~20M which would overflow an int when multiplied by
values in kf_boost_qadjustment[].

Fixes:
vp8/encoder/ratectrl.c:340:25: runtime error: signed integer overflow:
  19999984 * 220 cannot be represented in type 'int'

Bug: oss-fuzz:69100
Change-Id: I2d77c9d2912412f6265f6a8dc0e6b361b63b8242
2024-07-25 19:43:53 +00:00
Jingning Han d63ecb4117 Reset the ref_table array for the key frame GOP
Change-Id: Idda6ad9352d4c74dcbe8f2b6e1615d10e958e4c8
2024-07-24 16:02:39 -07:00
Jingning Han f809c987b5 Remove repeated ref_frame assignments
Change-Id: I0daa5a40489ce14582cb6a1c2816df354f1134f9
2024-07-24 16:01:24 -07:00
Bohan f96deb0bb4 Add tpl propagation with updated ref_frame idx
Change-Id: I6fcef44a90fc434e18447964aa1b4585c7f62310
2024-07-24 18:57:29 +00:00
Wan-Teh Chang 3fb0e5d75d Remove unneeded cpi->output_framerate assignment
The assignment "cpi->output_framerate = cpi->framerate;" after the
vp8_new_framerate() call is not needed, because vp8_new_framerate() sets
cpi->framerate and cpi->output_framerate to the same value.

Change-Id: I4de97b43957142d658e0c08ecfc6628844ce453a
2024-07-23 15:22:55 -07:00
Angie Chiang 057e53d759 Small refactoring in vp9_firstpass.c
Change-Id: If5e76b05f584650ff675363e6eb347bedae7728c
2024-07-19 21:38:08 +00:00
James Zern 9a1e8ae7aa README: add link to issue tracker
Change-Id: Ic8bc0167e5d1975e006135e20afacf27ee6badcf
2024-07-18 23:46:57 +00:00
James Zern efe615f804 add repro for crbug.com/352414650
+ fix an additional double -> int overflow warning (chrome's fuzzers do
  not have the float-cast-overflow sanitizer enabled)

Bug: chromium:352414650
Change-Id: I634bb421a74236eac434df138ed71dadf197596a
2024-07-18 13:36:10 -07:00
Marco Paniconi 3219f76cea Remove printf warning statements in set_size_literal()
Bug: b/347890801
Change-Id: I78c8dd0907d54f6cd1d3972ea6c3897f4b0c5adc
2024-07-15 11:33:26 -07:00
Wan-Teh Chang 72018e8c74 Some cleanup in vbr_rate_correction()
The only real change is in the initialization of frame_window. The (int)
cast is moved to the result of VPXMIN(), so that
cpi->twopass.total_stats.count - cpi->common.current_video_frame is
calculated in double.

Change-Id: Ia80f24614af7184b37cfdd99d8a8b1639460f273
2024-07-13 00:16:11 +00:00
James Zern 77974ec041 vp9_svc_adjust_avg_frame_qindex: fix int overflow
rc->avg_frame_bandwidth is capped at INT_MAX. Rather than multiply the
value by 3, divide projected_frame_size by 3 to avoid the overflow.
Without rounding this differs slightly from the original, but loss of
precision is acceptable in this case.

Bug: chromium:348440590
Change-Id: Id5960825c79d7c764d257e9b4bd0a1de751878d8
2024-07-11 17:34:57 -07:00
Wan-Teh Chang a40848c80f Do not include vpx_version.h
Replace the VERSION_STRING_NOSP macro by the public API function
vpx_codec_version_str().

Treat vpx_version.h as an absolutely internal header of the libvpx
library.

Change-Id: I86ba8548a62adae91ae7f5caad98169707f3fc64
2024-07-09 16:57:20 -07:00
Angie Chiang 1640ed4089 Turn off frame_stats == NULL error.
This change happens in define_gf_group().
Since this part is not critical for ext_ratectrl,
turn off the error reporting for now.

Change-Id: Ie74aa06a116edb8c5d9e7b29cadbd366232fbc1d
2024-07-09 13:35:00 -07:00
Wan-Teh Chang 066ea57e3d Fix unused function warnings in real-time only
The compare_fp_stats() and compare_fp_stats_md5() functions are not used
when CONFIG_REALTIME_ONLY is equal to 1. Define these functions only if
CONFIG_REALTIME_ONLY is 0 to avoid the -Wunused-function warnings.

Change-Id: Iaae208f67708cfaeee5304b0320ebce63c863f96
2024-07-08 14:31:23 -07:00
Jingning Han 7cc7bbba1f Allow TPL group to reference more frames
Allow the TPL group to use up to 3 reference frames from the
previous GOP. This slightly changes the coding stats in the range
of <0.1%.

STATS_CHANGED

Change-Id: Ieb4e948a783bf8ef9ca78717d56ff750f3f795a4
2024-07-08 17:02:15 +00:00
Wan-Teh Chang 4ac9c4ba32 Fix int cast errors in vp8 on max target bitrate
Fix double-to-int cast overflows in vp8 code caused by setting the
target bitrate to the maximum value (2000000).

Tested: Build libvpx with UndefinedBehaviorSanitizer and then run
./vpxenc husky.yuv -o AV1_husky_2000000_10000000_10000000.webm --good \
  --cpu-used=2 -v -t 0 -w 352 -h 288 --fps=10000000/10000000 \
  --target-bitrate=2000000 --limit=150 --test-decode=fatal --passes=2 \
  --lag-in-frames=25 --min-q=0 --max-q=63 --arnr-maxframes=7 \
  --arnr-strength=5 --kf-max-dist=9999 --undershoot-pct=100 \
  --overshoot-pct=100 --bias-pct=50 --codec=vp8

Note: This is essentially the VP8 version of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/191361.

Bug: 349440066
Change-Id: Ia43e1aad8fcab60ace49da960579081c2c3a5445
2024-07-03 17:09:52 +00:00
Wan-Teh Chang 27c39522f5 vpxenc.c: Fix UBSan integer errors in test_decode
Fix the following UBSan integer errors in test_decode():
vpxenc.c:1589:57: runtime error: implicit conversion from type 'int' of
value -16 (32-bit, signed) to type 'unsigned int' changed the value to
4294967280 (32-bit, unsigned)
vpxenc.c:1590:58: runtime error: implicit conversion from type 'int' of
value -16 (32-bit, signed) to type 'unsigned int' changed the value to
4294967280 (32-bit, unsigned)

Tested: Build libvpx with -fsanitize=integer and then run
./vpxenc husky.yuv -o AV1_husky_2000000_10000000_10000000.webm --good \
  --cpu-used=2 -v -t 0 -w 352 -h 288 --fps=10000000/10000000 \
  --target-bitrate=2000000 --limit=150 --test-decode=fatal --passes=2 \
  --lag-in-frames=25 --min-q=0 --max-q=63 --arnr-maxframes=7 \
  --arnr-strength=5 --kf-max-dist=9999 --undershoot-pct=100 \
  --overshoot-pct=100 --bias-pct=50 --codec=vp8

Bug: 349440066
Change-Id: Ice2f0e7176ffec664856559e2c02bd51113c4d74
2024-07-03 16:26:46 +00:00
Wan-Teh Chang a396ac214d Fix unsigned int overflow in init_rate_histogram()
Tested: Build libvpx with -fsanitize=integer and then run
./vpxenc husky.yuv -o AV1_husky_2000000_10000000_10000000.webm --good \
  --cpu-used=2 -v -t 0 -w 352 -h 288 --fps=10000000/10000000 \
  --target-bitrate=2000000 --limit=150 --test-decode=fatal --passes=2 \
  --lag-in-frames=25 --min-q=0 --max-q=63 --min-gf-interval=4 \
  --max-gf-interval=22 --arnr-maxframes=7 --arnr-strength=5 \
  --kf-max-dist=9999 --aq-mode=0 --undershoot-pct=100 \
  --overshoot-pct=100 --bias-pct=50

This unsigned integer overflow seems to be caused by
g_timebase.num=1000000.

Note: This is a port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/191401.

Bug: 349440066
Change-Id: I924fa9c653400764dd7320938b88b4ea40f38172
2024-07-02 15:25:11 -07:00
Wan-Teh Chang af599a0c5f Fix further overflow issue in VBR.
This patch fixes some additional cases where under extreme conditions
some of the VBR adjustment variables can wrap.

As this happens on a per frame level the extra saturation checks should
not be an issue for performance.

Note: This CL is a port of the following libaom CLs:
https://aomedia-review.googlesource.com/c/aom/+/190521
https://aomedia-review.googlesource.com/c/aom/+/190888

Change-Id: I87c4ecca10f39767002f7d90d0f43b19c7150832
2024-06-28 21:29:04 -07:00
Wan-Teh Chang ac117ca7f9 Remove static from vars in parse_stream_params()
Those variables in parse_stream_params() don't need to be function-scope
static variables.

Change-Id: I5e0b0f78deb0aa8b4f95dcd2352d89342b9d528a
2024-06-27 17:30:01 -07:00
Angie Chiang 2693255a25 Let vp9_ext_ratectrl getting key frame decision
BUG = b/347936295

Change-Id: Ic152d3f6873ebe02977c1ede6a5663bd5f9be363
2024-06-21 11:21:18 -07:00
Marco Paniconi 253d6365e3 rtc-vp9: Allow scene detection for all speeds
Current code was disallowing scene detection for
speeds >= 8, to avoid any encode_time increase
(see comment in the code).

But we can expect the cost to be small even at speed 8,9,
and that concern on encode_time was from some time ago
before 8 and 9 were further optimized. And this is
needed for content with scene changes (see issue attached).
So allow scene detection now for all RTC speed settings (speed >= 5).

Bug: b/346846607
Change-Id: I678dbb88ff1399ed89b2bf9770ae9427e3044fc4
2024-06-18 16:58:00 +00:00
James Zern f07ca82f7a set_analyzer_env.sh: remove -fno-strict-aliasing
The last reference to the flag in configure was removed in:
fad70a358 Remove -fno-strict-aliasing flag

The library should be expected to function without this flag; it's built
and tested elsewhere without it.

Bug: webm:570, webm:603
Change-Id: Icf85fd9bd5c9cb0c81d6eecf10fba07807f48b4a
2024-06-14 12:16:33 -07:00
James Zern d6ae3ea465 rtcd.pl: add license header to generated files
Bug: aomedia:3525
Change-Id: I614056558fb5439b448342e0c01e53bd8da85585
2024-06-13 11:54:43 -07:00
Angie Chiang 68deb7ee20 Add missing header in vp9_firstpass.c
Change-Id: I675fa2b74b567e47f2a8fe2a7e4b4d3e77880d13
2024-06-12 14:29:08 -07:00
Angie Chiang ff67a4f209 Fix typo of received again
Change-Id: I6df009ec0423c2ef244399107c968ae1255337e5
2024-06-12 14:17:00 -07:00
Angie Chiang 277a5cdaa4 Remove redundant setting of max_layer_depth.
Change-Id: Ide2b6852339471b8e82109c846ba24fe7dc94aaa
2024-06-12 12:30:41 -07:00
Angie Chiang 2ca6e875c3 Typo recieved -> received
Change-Id: I140b5c2a5cefc346b3961dad09fd145d85d44d17
2024-06-12 10:28:12 -07:00
James Zern fb01e53c98 configure: add -c to ASFLAGS for android + AS=clang
The GNU Assembler was removed in r24. clang's internal assembler works,
but `-c` is necessary to avoid linking.

Bug: webm:1856
Change-Id: I61f80cf78657d3b71d5e73c5b2510575533ca5ea
2024-06-11 22:55:22 +00:00
James Zern b0c9d0c6fe configure: remove unused NM & RANLIB variables
+ update list in README

Change-Id: I363e9bc36b2e160de43d0fbcba4700297a582549
2024-06-11 22:55:22 +00:00
Angie Chiang ed95b102c4 Move ext_rc_define_gf_group_structure
Move the function into define_gf_group().
define_gf_group() has a lot of settings that might cause
performance drop if skipped.

Imitate define_gf_group_structure()'s behavior which add
an extra overlay frame at the end of gf_group whenever
alt_ref is used.

After this change, we can feed the baseline decision through
webmrc and get the same result as baseline.

This CL is tested with city_cif.yuv using ffmpeg

BUG = b/345528565

Change-Id: Ib61f0a0a72251f8662fb4072e0cfd7f456a243b3
2024-06-11 20:19:04 +00:00
James Zern 271b3f0bf0 tiny_ssim: mv read error checks closer to assignment
Quiets some spurious -Wmaybe-uninitialized warnings with gcc 14.1.0.

In function 'calc_plane_error16',
    inlined from 'main' at ../tools/tiny_ssim.c:464:5:
../tools/tiny_ssim.c:37:12: warning: 'v[0]' may be used uninitialized
  [-Wmaybe-uninitialized]
   37 |   if (orig == NULL || recon == NULL) {
      |            ^
In function 'calc_plane_error16',
    inlined from 'main' at ../tools/tiny_ssim.c:462:5:
../tools/tiny_ssim.c:37:12: warning: 'u[0]' may be used uninitialized
  [-Wmaybe-uninitialized]
   37 |   if (orig == NULL || recon == NULL) {
      |            ^
In function 'calc_plane_error',
    inlined from 'main' at ../tools/tiny_ssim.c:461:5:
../tools/tiny_ssim.c:61:12: warning: 'y[0]' may be used uninitialized
  [-Wmaybe-uninitialized]
   61 |   if (orig == NULL || recon == NULL) {

To reduce confusion, read_input_file() is changed to return an int as
previously it would only return (size_t)-1/0/1 (and now returns 0/1).

Change-Id: I2344048ecc2bd233891ffcef08002ee98d6d262a
2024-06-10 16:05:06 -07:00
Matt Oliver c1cc9ebd58 project: Update for 1.14.1 merge. 2024-06-08 22:45:23 +10:00
Matt Oliver 68a5066df4 Merge commit '12f3a2ac603e8f10742105519e0cd03c3b8f71dd' 2024-06-08 20:02:59 +10:00
James Zern a2508b5711 configure: disable runtime cpu detect w/armv7*-darwin
The default behavior changed in:
148d1085f Refactor and extend run-time CPU feature detection on Arm

This fixes build errors with these targets as there is no runtime cpu
detection defined for them.

Change-Id: Ie6b0bae1fc3e244d7dfcc823f60c3e466ccade79
2024-06-07 10:59:16 -07:00
Wan-Teh Chang ec129c190a Document the internal maximum of rc_target_bitrate
Both VP8 and VP9 internally cap the target bitrate to the smaller of the
uncompressed bitrate and 1000000 kilobits per second.

Change-Id: I4008ce09b5e709e75111800341d015e41eb1da42
2024-06-05 17:13:48 -07:00
Wan-Teh Chang b401a1ff2e Remove unnecessary double cast for cpi->framerate
cpi->framerate is already of the double type.

Change-Id: Ia9211b699e25b1c603585a40370a1ed66e7cbf03
2024-06-05 22:57:48 +00:00
Marco Paniconi faf12bdb83 vp9: round for framerate and _min/max_gf_interval()
Fixes for the comments in:
https://chromium-review.googlesource.com/c/webm/libvpx/+/5598161

Change-Id: Ib7db69649c848098cd3f6e4a88233d333e84f628
2024-06-05 14:21:58 -07:00
James Zern 713e0faca0 vp9: round avg_frame_bandwidth result
in vp9_rc_update_framerate() and in functions in vp9_svc_layercontext.c.

This matches the code in VP8 and AV1 as discussed in
https://chromium-review.googlesource.com/c/webm/libvpx/+/5566050/2/vp8/encoder/onyx_if.c

Change-Id: I084f8002f8f6c8efffc511566910b3f3df47ba4e
2024-06-05 00:14:34 +00:00
Marco Paniconi 60807f0aba Use round for RC calcutions in cyclic_refresh
Same as the fix in libaom:
https://aomedia-review.googlesource.com/c/aom/+/190881

Bug: aomedia:3579

Change-Id: Idb4026943a970189e6cd47a29e54e16623595e31
2024-06-04 14:50:58 -07:00
Angie Chiang 9d734db169 Rename gop_size by show_frame_count
Change-Id: Id95fbeaa0ceeb10c077bfd628f45fe880b42b3de
2024-06-03 07:35:49 -07:00
Wan-Teh Chang fd84dccd51 Fix high target data rate overflow.
These change fixes issues that can occur if the user specifies a very
high target data rate or rate per frame.

Fixes some issue with overflow of int variables used to hold bitrate
values (rate per second, rate per frame etc).

Note: This CL is a port of the following libaom CLs:
https://aomedia-review.googlesource.com/c/aom/+/190381
https://aomedia-review.googlesource.com/c/aom/+/190462

All the changes were ported to VP9. For VP8, only the new type of
cpi->bytes (equivalent to ppi->total_bytes in libaom) was ported.

Change-Id: I438dd46efd5a134389b893ffae1f8a2381207906
2024-05-31 16:00:25 -07:00
Jingning Han ffe9c9a457 Handle ARF and GF gop cases
Allow the inference scheme to cover GOPs with and without ARFs.

Change-Id: I68518791e96d7d5b92355c34360bbb74f2ecc436
2024-05-31 09:25:51 -07:00
Jingning Han ddf3c281e6 Remove a redundant condition in firstpass.c
Remove a redundant condition to trigger ext_rc gop structure
function all.

Change-Id: Ia3f135c67982b5539b9a2e8a74ba13edd9b5e46f
2024-05-30 18:56:47 +00:00
Jerome Jiang b5ba2274a0 Merge tag 'v1.14.1' into main-merge-1.14.1
2024-05-21 v1.14.1 "Venetian Duck"

  This release includes enhancements and bug fixes.

  - Upgrading:
    This release is ABI compatible with the previous release.

  - Enhancement:
    Improved the detection of compiler support for AArch64 extensions,
    particularly SVE.

    Added vpx_codec_get_global_headers() support for VP9.

  - Bug fixes:

    Added buffer bounds checks to vpx_writer and vpx_write_bit_buffer.
    Fix to GetSegmentationData() crash in aq_mode=0 for RTC rate control.
    Fix to alloc for row_base_thresh_freq_fac.
    Free row mt memory before freeing cpi->tile_data.
    Fix to buffer alloc for vp9_bitstream_worker_data.
    Fix to VP8 race issue for multi-thread with pnsr_calc.
    Fix to uv width/height in vp9_scale_and_extend_frame_ssse3.
    Fix to integer division by zero and overflow in calc_pframe_target_size().
    Fix to integer overflow in vpx_img_alloc() & vpx_img_wrap()(CVE-2024-5197).
    Fix to UBSan error in vp9_rc_update_framerate().
    Fix to UBSan errors in vp8_new_framerate().
    Fix to integer overflow in vp8 encodeframe.c.
    Handle EINTR from sem_wait().

Change-Id: Ic5e274fdc35c9141591a65e825bf012d2cca3caa
2024-05-30 11:35:52 -04:00
Jerome Jiang 12f3a2ac60 Update CHANGELOG
Bug: webm:1854
Change-Id: I3242d7fd58838aa8c4103ae07a67deb9dcc7dd37
2024-05-29 16:00:23 -04:00
Jerome Jiang be3ea68f9e Update CHANGELOG for fixes to ubsan errors
Bug: webm:1854
Change-Id: I81050a6a69721062078e818ca3ce23994749f711
2024-05-29 12:10:08 -04:00
Wan-Teh Chang 1dbb3b28e8 Fix some UBSan errors in vp8_new_framerate()
Fix some UBSan errors in the calculations of cpi->av_per_frame_bandwidth
and cpi->min_frame_bandwidth in vp8_new_framerate() and in the
calculation of cpi->per_frame_bandwidth in encode_frame_to_data_rate().

A port of the VP9 changes in
https://chromium-review.googlesource.com/c/webm/libvpx/+/4944271 and
https://chromium-review.googlesource.com/c/webm/libvpx/+/5565157 to VP8.
Similar to the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/190462.

Bug: aomedia:3509
Change-Id: I77b0e0b2f9fe667428daa9c4ceec0a35aafbfa81
(cherry picked from commit 25540b3c12)
2024-05-28 17:08:30 +00:00
Wan-Teh Chang c60622ebac Fix a UBSan error in vp9_rc_update_framerate()
Fix a UBSan error in the calculation of rc->min_frame_bandwidth in
vp9_rc_update_framerate().

A follow-up to
https://chromium-review.googlesource.com/c/webm/libvpx/+/4944271.
Similar to the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/190462.

Bug: aomedia:3509
Change-Id: I36168a6d00cd81e60ae19a7d74c21f2e6c2f0caf
(cherry picked from commit 1f65facb63)
2024-05-24 18:13:42 +00:00
Wan-Teh Chang 25540b3c12 Fix some UBSan errors in vp8_new_framerate()
Fix some UBSan errors in the calculations of cpi->av_per_frame_bandwidth
and cpi->min_frame_bandwidth in vp8_new_framerate() and in the
calculation of cpi->per_frame_bandwidth in encode_frame_to_data_rate().

A port of the VP9 changes in
https://chromium-review.googlesource.com/c/webm/libvpx/+/4944271 and
https://chromium-review.googlesource.com/c/webm/libvpx/+/5565157 to VP8.
Similar to the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/190462.

Bug: aomedia:3509
Change-Id: I77b0e0b2f9fe667428daa9c4ceec0a35aafbfa81
2024-05-23 18:05:54 -07:00
Wan-Teh Chang 495c4b596c Add a #endif comment for CONFIG_VP9_HIGHBITDEPTH
Change-Id: Idc388e722e2579ce6935b52b1786038bdf2d5d47
2024-05-23 23:50:28 +00:00
James Zern f3e064e1d8 {aarch*,arm}_cpudetect: align define with comment
ANDROID_USE_CPU_FEATURES_LIB -> VPX_USE_ANDROID_CPU_FEATURES

Change-Id: I2d425cf3cd28219e570efb0c442b33f1a64447ae
2024-05-23 23:48:22 +00:00
Wan-Teh Chang 1f65facb63 Fix a UBSan error in vp9_rc_update_framerate()
Fix a UBSan error in the calculation of rc->min_frame_bandwidth in
vp9_rc_update_framerate().

A follow-up to
https://chromium-review.googlesource.com/c/webm/libvpx/+/4944271.
Similar to the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/190462.

Bug: aomedia:3509
Change-Id: I36168a6d00cd81e60ae19a7d74c21f2e6c2f0caf
2024-05-23 14:38:50 -07:00
Wan-Teh Chang db4d6a5f54 Fix a typo in the CpuSpeedTest.TestTuneScreen test
Change the second rc_2pass_vbr_minsection_pct to
rc_2pass_vbr_maxsection_pct.

This copy-and-paste error was introduced in
https://chromium-review.googlesource.com/c/webm/libvpx/+/332653.

Change-Id: If2c61cd2ce0a6808643b8e80a27f054f7339e0fd
2024-05-22 16:04:40 -07:00
Angie Chiang 6c079c8beb Account for gop_decision->use_alt_ref
The change is in ext_rc_define_gf_group_structure()

Bug: b/339314081

Change-Id: I03576a0407105ced3e7cff4c33986e9a9a83b77f
2024-05-22 10:46:39 -07:00
Jerome Jiang 18da85657c Update AUTHOR, version and CHANGELOG
Bug: webm:1854
Change-Id: I0801e9b685d395c7556e2269601f4c01ab310661
2024-05-22 11:35:53 -04:00
Wan-Teh Chang 61c4d556bd Fix a bug in alloc_size for high bit depths
I introduced this bug in commit 2e32276:
https://chromium-review.googlesource.com/c/webm/libvpx/+/5446333

I changed the line

  stride_in_bytes = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s;

to three lines:

  s = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s;
  if (s > INT_MAX) goto fail;
  stride_in_bytes = (int)s;

But I didn't realize that `s` is used later in the calculation of
alloc_size.

As a quick fix, undo the effect of s * 2 for high bit depths after `s`
has been assigned to stride_in_bytes.

Bug: chromium:332382766
Change-Id: I53fbf405555645ab1d7254d31aadabe4f426be8c
(cherry picked from commit 74c70af016)
2024-05-21 18:43:46 +00:00
Wan-Teh Chang 5193ce7167 Apply stride_align to byte count, not pixel count
A port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/188962.

stride_align is documented to be the "alignment, in bytes, of each row
in the image (stride)."

Change-Id: I2184b50dc3607611f47719319fa5adb3adcef2fd
(cherry picked from commit 7d37ffacc6)
2024-05-21 18:43:07 +00:00
Wan-Teh Chang 5a83437ffc Avoid wasted calc of stride_in_bytes if !img_data
Change-Id: If1ddde5e894a06359f15486a2cee054a2f0cb1a2
(cherry picked from commit 8b2f8baee5)
2024-05-21 18:42:17 +00:00
Wan-Teh Chang 9d7054c0cb Avoid integer overflows in arithmetic operations
A port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/188823.

Impose maximum values on the input parameters so that we can perform
arithmetic operations without worrying about overflows.

Also change the VpxImageTest.VpxImgAllocHugeWidth test to write to the
first and last samples in the first row of the Y plane, so that the test
will crash if there is unsigned integer overflow in the calculation of
stride_in_bytes.

Bug: chromium:332382766
Change-Id: I54cec6c9e26377abaa8a991042ba277ff70afdf3
(cherry picked from commit 06af417e79)
2024-05-21 18:30:51 +00:00
Wan-Teh Chang c5640e3300 Fix integer overflows in calc of stride_in_bytes
A port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/188761.

Fix unsigned integer overflows in the calculation of stride_in_bytes in
img_alloc_helper() when d_w is huge.

Change the type of stride_in_bytes from unsigned int to int because it
will be assigned to img->stride[VPX_PLANE_Y], which is of the int type.

Test:
. ../libvpx/tools/set_analyzer_env.sh integer
../libvpx/configure --enable-debug --disable-optimizations
make -j
./test_libvpx --gtest_filter=VpxImageTest.VpxImgAllocHugeWidth

Bug: chromium:332382766
Change-Id: I3b39d78f61c7255e10cbf72ba2f4975425a05a82
(cherry picked from commit 2e32276277)
2024-05-21 18:30:29 +00:00
Wan-Teh Chang f60da3e3ea Add test/vpx_image_test.cc
Ported from test/aom_image_test.cc in libaom commit 04d6253.

Change-Id: I56478d0a5603cfb5b65e644add0918387ff69a00
(cherry picked from commit 3dbab0e664)
2024-05-21 18:29:47 +00:00
Wan-Teh Chang b9c4f1951f Make img_alloc_helper() fail on VPX_IMG_FMT_NONE
If fmt is VPX_IMG_FMT_NONE, currently img_alloc_helper() allocates a
single plane because VPX_IMG_FMT_NONE (0) is not a planar format (the
VPX_IMG_FMT_PLANAR bit is not set in VPX_IMG_FMT_NONE).

Although this seems correct, the problem is that most of the code in
libvpx assumes planar formats and is likely to dereference a null
pointer when it uses img->planes[1]. Also, VPX_IMG_FMT_NONE isn't really
a valid image format. So it is safer to make img_alloc_helper() fail if
fmt is VPX_IMG_FMT_NONE.

Change-Id: I05b47f4b5eceb631a02384b2cce1c2f6fdca8673
(cherry picked from commit d3a946de8c)
2024-05-21 18:28:09 +00:00
Marco Paniconi 5b4cfe88e4 vp9-rtc: Fix integer overflow in key frame target size
The integer overflow happens
in vp9_calc_iframe_target_size_one_pass_cbr(), when
calculating the target size for L1T3 encoding.

The input target bitrate(kbps) is very large, so it gets set
to INT_MAX (before being multiplied by 1000 to convert to bps),
and avg_frame_bandwidth is then set to (INT_MAX / lc->framerate),
which when multipled by (16 + kf_boost) can exceed INT_MAX.
Fix is to cast the operands to int64_t and final result to int.

Bug: chromium:340918567
Change-Id: Ic00094b22c1f12ca988c0cb1fcaed473e1f8ed2b
2024-05-16 11:51:47 -07:00
Deepa K G ea0cd1a38d Fix error handling in vp9_pack_bitstream()
In multi-threaded scenario, when the bitstream
buffer allocated is insufficient, the main thread
called 'longjmp' without waiting for the completion
of workers. In this patch, 'longjmp' is called by
the main thread after joining other worker threads.

This resolves the assertion failure as reported in
Bug: webm:1847

Bug: webm:1844

Change-Id: I399c76087b65e7b8d9a9fa4f12d784408243d648
(cherry picked from commit 611d9ba0a5)
2024-05-14 15:04:00 -04:00
Wan-Teh Chang 58955cf5f5 Perform bounds checks in vpx_write_bit_buffer
Add the `size` and `error` members to the vpx_write_bit_buffer struct.
Add the vpx_wb_init() and vpx_wb_has_error() functions.

Instances of the vpx_write_bit_buffer struct are only allocated in the
vp9_pack_bitstream() function. So vp9_pack_bitstream() is the only
function outside vpx_dsp/bitwriter_buffer.* that needs updating.

This CL completes the work of adding output buffer bounds checks to
vp9/encoder/vp9_bitstream.c.

Bug: webm:1844
Change-Id: I6b362be572852ee51d96023b35bfb334faada7e1
(cherry picked from commit d790001fd5)
2024-05-14 13:04:03 -04:00
Wan-Teh Chang 3bfd83a70c Perform bounds checks in vpx_writer
In the vpx_writer struct, change the buffer_end field to the size field.
Change vpx_stop_encode() to return true on success, false on failure
(output buffer full).

In write_compressed_header(), remove the assertion
assert(header_bc.pos <= 0xffff). The caller (vp9_pack_bitstream()) will
check that condition.

In vp9_pack_bitstream(), the variable "first_part_size" is renamed
"compressed_hdr_size".

Bug: webm:1844
Change-Id: I4ed6ab905a707ad44d875e53036d5a42523a65d0
(cherry picked from commit 73703c188b)
2024-05-14 13:04:03 -04:00
James Zern 34d3114348 vp9_pack_bitstream: remove a dead store
Fixes a static analysis warning:
Value stored to 'data_size' is never read

Bug: webm:1844
Change-Id: Ia27181b1051bb2c3a6bc4a4c2549df8b0525e889
(cherry picked from commit 9f73377821)
2024-05-14 13:04:03 -04:00
Wan-Teh Chang b1cb83ca01 Add the buffer_end field to the vpx_writer struct
The buffer_end field will allow bounds checking when vpx_writer writes
to the output buffer. This CL sets up the plumbing to pass the output
buffer size from vp9_pack_bitstream() to vpx_start_encode(), which
initializes the vpx_writer struct. vpx_writer doesn't use the output
buffer size in bounds checks yet, but the code in vp9_bitstream.c does.

Bug: webm:1844
Change-Id: I995e469ab453c02d740f54b46e0b08c7f2eb1a2e
(cherry picked from commit e387187438)
2024-05-14 10:20:16 -04:00
Wan-Teh Chang ac433759d1 Pass output buffer size to vp9_pack_bitstream()
Set up the plumbing to pass the size of the output buffer `dest` to
vp9_pack_bitstream(). The output buffer is the cx_data buffer in the
encoder_encode() function in vp9/vp9_cx_iface.c, and its size is
cx_data_sz.

In this CL vp9_pack_bitstream() ignores the `dest_size` parameter.

Bug: webm:1844
Change-Id: I53c80280143d409cf16f87c4d6deec3d9338aea3
(cherry picked from commit d48577579b)
2024-05-14 10:19:55 -04:00
Deepa K G 611d9ba0a5 Fix error handling in vp9_pack_bitstream()
In multi-threaded scenario, when the bitstream
buffer allocated is insufficient, the main thread
called 'longjmp' without waiting for the completion
of workers. In this patch, 'longjmp' is called by
the main thread after joining other worker threads.

This resolves the assertion failure as reported in
Bug: webm:1847

Bug: webm:1844

Change-Id: I399c76087b65e7b8d9a9fa4f12d784408243d648
2024-05-14 01:14:15 +05:30
Wan-Teh Chang b1cf64c40b vpx_decoder.h: Change "size member" to "sz member"
That member of vpx_codec_stream_info_t is named "sz", not "size".

Change-Id: I6cc878709d9dae37b9911cf746ba248a06ec1b1a
2024-05-13 17:03:10 +00:00
Wan-Teh Chang 498097b15b vpx_dec_fuzzer.cc: Initialize stream_info.sz
stream_info.sz should be initialized to sizeof(stream_info).

Bug: oss-fuzz:68912
Change-Id: I0cc0fcdfc93b7188a834ee1896f0bb4cf8c32fa9
2024-05-13 16:59:39 +00:00
Angie Chiang 5913401ebb Add vp9_ratectrl.h header to vp9_firstpass.c
KF_STD/GF_ARF_STD are used in vp9_firstpass.c
and defined in vp9_ratectrl.h

Change-Id: I5a6e42faa23e5f50630926e336daef37055fd195
2024-05-13 01:07:24 +00:00
Wan-Teh Chang db25581967 Assert a vpx_img_set_rect call always succeed
The vpx_img_set_rect() call at the end of img_alloc_helper() always
succeeds, so assert its return value is equal to 0.

A port of the changes to aom/src/aom_image.c in the libaom CLs
https://aomedia-review.googlesource.com/c/aom/+/90307 and
https://aomedia-review.googlesource.com/c/aom/+/190011.

Bug: webm:1850
Change-Id: I559820db245a596b4aed2042bfa7ebe7dd2d69b7
2024-05-10 23:58:23 +00:00
James Zern 1a3cd4922b vpx_dec_fuzzer: add vpx_codec_peek_stream_info coverage
Change-Id: I511539292cb8c2098c81f5fe3d711b9739482ffa
2024-05-09 17:19:33 -07:00
Jerome Jiang e934e35515 vp9 rc: also run tpl for GOPs without ARF
Tested with ffmpeg integration end to end test.

Bug: b/338393251
Change-Id: I4048036d35f8ab64c07305b838d091f765f64a8d
2024-05-09 15:19:35 -04:00
Hirokazu Honda bff1fe63ea vp9 rc: Fix GetSegmentationData() crash in aq_mode=0
cpi_->cyclic_refresh is nullptr if aq_mode is 0, in other words, the
rate controller runs in non adaptive quantization mode. This CL fixes
the crash in GetSegmentationData() in non aq mode.

Bug: b/259487065
Test: video encoding on ChromeOS

Change-Id: I503b30d15c697c8dd1da203b3c7361b91c428e87
(cherry picked from commit 1d007eafa3)
2024-05-08 19:07:00 -04:00
Marco Paniconi 08a79efb18 vp9: Fix to alloc for row_base_thresh_freq_fac
Issue happens for real-time nonrd pickmode.
Due to speed feature: sf->adaptive_rd_thresh_row_mt,
enabled for speed >= 8, and for speed >= 7 svc only.

Issue occurs where resolution (sb_rows) changes and
row_base_thresh_freq_fact needs to be re-allocated.

Fix is to add sb_rows to TileDataEnc and check for
re-alloc of row_base_thresh_freq_fac.

Bug: b:331108922
Change-Id: I1a1ca94c14f343200c180725e4cb8d91d3c55b83
(cherry picked from commit 3f8f19372b)
2024-05-08 19:07:00 -04:00
Wan-Teh Chang 669654dda0 Free row mt memory before freeing cpi->tile_data
In vp9_init_tile_data(), call vp9_row_mt_mem_dealloc(cpi) to free the
row mt memory in cpi->tile_data before freeing cpi->tile_data.

Bug: b:331086799, b:331108729
Change-Id: Idc79984ce7e0110e6858139b2ed286492a2e8622
(cherry picked from commit 34277e53ad)
2024-05-08 19:07:00 -04:00
James Zern 41fd571e7a encode_api_test.cc: assert encoder is initialized
Before proceeding with Encode(). This avoids some static analysis
warnings about uninitialized `cfg_` members.

Change-Id: Ib67b278d6706ab1034219e8c1ad9ba0c5b574ba8
(cherry picked from commit 108f5128e2)
2024-05-08 19:07:00 -04:00
James Zern 8433fe6393 vpx_ext_ratectrl.h,cosmetics: Correspondent -> Corresponds
+ add some doxygen autolinks

Change-Id: Ifceb7d9e89d31037d0b690b1d661cebcd6fa67b8
2024-05-08 14:07:50 -07:00
Wan-Teh Chang 1e5823f682 Handle EINTR from sem_wait()
sem_wait() may be interrupted by a signal and fail with EINTR:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_wait.html

Retry the sem_wait() call if it fails with EINTR.

This finishes the fix started in
https://chromium-review.googlesource.com/c/webm/libvpx/+/5299569. As a
speculative fix, that CL fixed only the sem_wait(&cpi->h_event_end_lpf)
calls responsible for bug chromium:324459561. ClusterFuzz verified the
fix, so this CL extends it to the other sem_wait() calls.

Note that sem_wait() calls like the following do not need this fix,
because the while (1) loop retries the sem_wait() call if it fails:

  while (1) {
    if (vpx_atomic_load_acquire(&cpi->b_multi_threaded) == 0) break;

    if (sem_wait(&cpi->h_event_start_lpf) == 0) {
      ...
    }
  }

Bug: chromium:324459561
Change-Id: I0f0612616eee37fb3da68049e49b3e86927b5e24
(cherry picked from commit d4959f9825)
2024-05-07 18:29:13 +00:00
James Zern 108f5128e2 encode_api_test.cc: assert encoder is initialized
Before proceeding with Encode(). This avoids some static analysis
warnings about uninitialized `cfg_` members.

Change-Id: Ib67b278d6706ab1034219e8c1ad9ba0c5b574ba8
2024-05-03 22:00:56 +00:00
Yunqing Wang 314ee14b64 Fix a rare memory overflow bug
In very rare cases (e.g. encoding with very high bit rate), the
allocated token memory isn't enough, which causes a buffer overflow
and then an encoder failure. This is fixed by using the aligned
number of blocks while allocating this buffer.

BUG=b/328803779

Change-Id: I5437cce13398206bf9982d57f35d6f9da17b187f
2024-05-03 21:01:23 +00:00
James Zern 9f73377821 vp9_pack_bitstream: remove a dead store
Fixes a static analysis warning:
Value stored to 'data_size' is never read

Bug: webm:1844
Change-Id: Ia27181b1051bb2c3a6bc4a4c2549df8b0525e889
2024-05-03 20:59:31 +00:00
James Zern a0c4e53665 configure: Do more elaborate test of whether SVE can be compiled
This is a port of the change in libaom:
https://aomedia-review.googlesource.com/c/aom/+/189761
5ccdc66ab6 cpu.cmake: Do more elaborate test of whether SVE can be compiled

For Windows targets, Clang will successfully compile simpler
SVE functions, but if the function requires backing up and restoring
SVE registers (as part of the AAPCS calling convention), Clang
will fail to generate unwind data for this function, resulting
in an error.

This issue is tracked upstream in Clang in
https://github.com/llvm/llvm-project/issues/80009.

Check whether the compiler can compile such a function, and
disable SVE if it is unable to handle that case.

Change-Id: I8550248abd6a7876bd8ecf6ba66bc70518133566
(cherry picked from commit 35f0262c5e)
2024-05-03 17:46:53 +00:00
James Zern e44918bd4e VP9: add vpx_codec_get_global_headers() support
This returns the contents of CodecPrivate described in:
https://www.webmproject.org/docs/container/#vp9-codec-feature-metadata-codecprivate

The value for 4:2:0 is 1 (colocated) to match the default given for the
codec parameter string:
https://www.webmproject.org/vp9/mp4/#codecs-parameter-string

Bug: b:332052663
Change-Id: Ie50dd8d76e2d7389ac01bf4dbec801f9c8ea0e21
(cherry picked from commit 63b9c2c0e2)
2024-05-02 15:26:47 -07:00
James Zern 35f0262c5e configure: Do more elaborate test of whether SVE can be compiled
This is a port of the change in libaom:
https://aomedia-review.googlesource.com/c/aom/+/189761
5ccdc66ab6 cpu.cmake: Do more elaborate test of whether SVE can be compiled

For Windows targets, Clang will successfully compile simpler
SVE functions, but if the function requires backing up and restoring
SVE registers (as part of the AAPCS calling convention), Clang
will fail to generate unwind data for this function, resulting
in an error.

This issue is tracked upstream in Clang in
https://github.com/llvm/llvm-project/issues/80009.

Check whether the compiler can compile such a function, and
disable SVE if it is unable to handle that case.

Change-Id: I8550248abd6a7876bd8ecf6ba66bc70518133566
2024-05-02 15:21:07 -07:00
James Zern 3e713e39ae vp9_ethread_test: move 'best' mode to a Large test
This mode is used infrequently and is quite slow. This shifts the tests
to nightly to speed up the presubmit.

Change-Id: I3020887e0ca0150d7cbea9cc726649c11f94d56c
2024-05-02 22:20:00 +00:00
Angie Chiang 6db3f6e576 Add several utility functions to set gf_group
Use the utility functions and set gf_group_size in
ext_rc_define_gf_group_structure()

Avoid using gop_decision->update_type to keep the logic simple
for now.

Also simplify the interface.

Change-Id: I78fd5892e6f9731d50d6e5da97598b46c70a1dde
2024-05-02 21:41:30 +00:00
Wan-Teh Chang f65aff7b99 Remove vpx_ports/msvc.h
The vpx_ports/msvc.h header provides snprintf() and round() for MSVC
older than Visual Studio 2015 and Visual Studio 2013, respectively.

Since configure now requires vs14 (Visual Studio 2015) or later, it is
safe to remove vpx_ports/msvc.h.

Change-Id: I2fe4c41eaa126f4cf17639c11895f1e464294c76
2024-05-02 20:01:11 +00:00
James Zern 8372a5cfe1 vpx_ext_ratectrl.h: make rate_ctrl_log_path const
Change-Id: I499d77b25ca3dcdbd3c72fb319f9023e9a2823b0
2024-05-02 09:59:34 -07:00
Jerome Jiang 847b3548b4 Better format comments for vpx_ext_ratectrl.h
For vpx_rc_type_t: comment for each enum is moved to where it is
defined.

Change-Id: Ic1e2097ed381e7d71746792e0d517106db882685
2024-05-02 10:01:00 -04:00
Jerome Jiang 1c77f7fc0e Fix comments in vpx_ext_ratectrl.h
Added file level descriptor

Added comments for vpx_rc_ref_frame_t

Change-Id: Ifb000650821eab719b6e0fd003a00027ea132b9f
2024-05-02 10:01:00 -04:00
Wan-Teh Chang c0db981eaa Include <stdio.h> or <cstdio> for *printf()
Change-Id: Ifc0537fe5ae1223418fb68da5583cc72ae2c32a8
2024-05-02 02:26:16 +00:00
James Zern e9be4f607b encode_api_test.cc: apply iwyu
add missing <cstdio> and <cstdlib> and delete some unused headers.

Change-Id: I6c66368f557e6df896bffb2aa90228811f14f027
2024-05-02 02:25:43 +00:00
James Zern 7a0089dc08 vpx_ext_ratectrl.h: fix doxygen comments
fixes a few warnings about undocumented members update_type,
update_ref_index and ref_frame_list.

Change-Id: I668c61f6a511ba9e6c0907f6dafb0be614678e60
2024-05-01 13:24:59 -07:00
Angie Chiang f93e6aa333 Print gop_index in ENCODE_FRAME_RESULT
Change-Id: Icb522110dd2a7f87212ec0e7fc2638245008365f
2024-05-01 18:26:02 +00:00
James Zern b61b272208 vp9_rdopt.c: make init_frame_mv static
fixes a -Wmissing-prototypes warning

Change-Id: Ie380f9e4211ffab461f15dfe84184b8769d4f7bd
2024-04-26 12:54:08 -07:00
James Zern 63b9c2c0e2 VP9: add vpx_codec_get_global_headers() support
This returns the contents of CodecPrivate described in:
https://www.webmproject.org/docs/container/#vp9-codec-feature-metadata-codecprivate

The value for 4:2:0 is 1 (colocated) to match the default given for the
codec parameter string:
https://www.webmproject.org/vp9/mp4/#codecs-parameter-string

Bug: b:332052663
Change-Id: Ie50dd8d76e2d7389ac01bf4dbec801f9c8ea0e21
2024-04-25 15:20:18 -07:00
Angie Chiang 3015c41f06 Add VPX_RC_NONE
Change-Id: I8ca4caa7ffc4e9f8590ad8d02de0348b88c45254
2024-04-19 22:38:33 +00:00
James Zern 6f5839f986 vp9_encoder.c: fix printf format string
Replace %ld with %zu for `size_t`. Added in:
fd28f6f3c Add rate_ctrl_log_path

Fixes:
vp9\encoder\vp9_encoder.c(5748,15): warning C4477: 'fprintf' : format
  string '%ld' requires an argument of type 'long', but variadic
  argument 2 has type 'size_t'

Change-Id: I36fa9c7a9e14d4a2d9ef51a7f5c55de71bb34518
2024-04-19 10:55:20 -07:00
James Zern 2b88a07bc9 vpx_image_test.cc: add missing stdint include
fixes clang-tidy warning:
no header providing "uint16_t" is directly included

Change-Id: Ic71045ce6f88659ecd22243d473a3b6dc8c827dd
2024-04-18 12:50:01 -07:00
Angie Chiang fd28f6f3cc Add rate_ctrl_log_path
Change-Id: I4dc25c9ce4103cf3de44cff4d63e8ff8c82f35c0
2024-04-17 19:43:37 -07:00
Jerome Jiang 85dafa9c61 Initialize frame_mv in rd pick inter
Bug: b/334626386
Change-Id: Ie480a08f09c1b212b4163a5f6eb191c35510236f
2024-04-16 14:51:27 -04:00
Wan-Teh Chang 976134c50d Add 10 and 12b ranges to vpx_color_range_t comment
Add note about undefined behavior in vpx_codec_encode() description.

A port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/158001
by Yannis Guyon <yguyon@google.com>.

Bug: webm:1850
Change-Id: Ia90f0bfd8265e35e9f33c17400c1c065d7915b77
2024-04-13 03:20:57 +00:00
Wan-Teh Chang 89efe85cd4 Clarify comment about buf_align in vpx_img_wrap.
If img_data is not NULL, img_alloc_helper ignores buf_align, so
vpx_img_wrap can set buf_align to any placeholder value.

A port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/90362.

Bug: webm:1850
Change-Id: I42bc45aecf822a9314caf23058fe123d0574dc20
2024-04-13 03:19:57 +00:00
Wan-Teh Chang 3f4055b05b Introduce local vars uv_x,uv_y in vpx_img_set_rect
Port the changes to aom/src/aom_image.c in the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/56643. The changes
related to `border` are not ported.

Bug: webm:1850
Change-Id: Ie81fffe0c84e912da880ffca245ae27cd71cf348
2024-04-13 03:19:00 +00:00
Wan-Teh Chang 74c70af016 Fix a bug in alloc_size for high bit depths
I introduced this bug in commit 2e32276:
https://chromium-review.googlesource.com/c/webm/libvpx/+/5446333

I changed the line

  stride_in_bytes = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s;

to three lines:

  s = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s;
  if (s > INT_MAX) goto fail;
  stride_in_bytes = (int)s;

But I didn't realize that `s` is used later in the calculation of
alloc_size.

As a quick fix, undo the effect of s * 2 for high bit depths after `s`
has been assigned to stride_in_bytes.

Bug: chromium:332382766
Change-Id: I53fbf405555645ab1d7254d31aadabe4f426be8c
2024-04-12 15:48:04 -07:00
Wan-Teh Chang 7d37ffacc6 Apply stride_align to byte count, not pixel count
A port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/188962.

stride_align is documented to be the "alignment, in bytes, of each row
in the image (stride)."

Change-Id: I2184b50dc3607611f47719319fa5adb3adcef2fd
2024-04-11 16:46:13 -07:00
Wan-Teh Chang 8b2f8baee5 Avoid wasted calc of stride_in_bytes if !img_data
Change-Id: If1ddde5e894a06359f15486a2cee054a2f0cb1a2
2024-04-11 15:59:44 -07:00
Wan-Teh Chang 06af417e79 Avoid integer overflows in arithmetic operations
A port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/188823.

Impose maximum values on the input parameters so that we can perform
arithmetic operations without worrying about overflows.

Also change the VpxImageTest.VpxImgAllocHugeWidth test to write to the
first and last samples in the first row of the Y plane, so that the test
will crash if there is unsigned integer overflow in the calculation of
stride_in_bytes.

Bug: chromium:332382766
Change-Id: I54cec6c9e26377abaa8a991042ba277ff70afdf3
2024-04-11 10:29:38 -07:00
Wan-Teh Chang 2e32276277 Fix integer overflows in calc of stride_in_bytes
A port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/188761.

Fix unsigned integer overflows in the calculation of stride_in_bytes in
img_alloc_helper() when d_w is huge.

Change the type of stride_in_bytes from unsigned int to int because it
will be assigned to img->stride[VPX_PLANE_Y], which is of the int type.

Test:
. ../libvpx/tools/set_analyzer_env.sh integer
../libvpx/configure --enable-debug --disable-optimizations
make -j
./test_libvpx --gtest_filter=VpxImageTest.VpxImgAllocHugeWidth

Bug: chromium:332382766
Change-Id: I3b39d78f61c7255e10cbf72ba2f4975425a05a82
2024-04-10 20:47:45 -07:00
Wan-Teh Chang 3dbab0e664 Add test/vpx_image_test.cc
Ported from test/aom_image_test.cc in libaom commit 04d6253.

Change-Id: I56478d0a5603cfb5b65e644add0918387ff69a00
2024-04-10 18:15:00 -07:00
Matt Oliver f4d13145a2 project: Update for 1.14.0 merge. 2024-04-06 22:50:00 +11:00
Matt Oliver 9e260c493d Merge commit '602e2e8979d111b02c959470da5322797dd96a19' 2024-04-06 22:13:57 +11:00
Wan-Teh Chang 8762f5efb2 Define the MAX_NUM_THREADS macro in vp9_ethread.h
The MAX_NUM_THREADS macro is unrelated to the VPxWorkerInterface, so it
doesn't need to be defined in vpx_util/vpx_thread.h.

The VP8 code doesn't seem to depend on MAX_NUM_THREADS, so VP8 can use
64 directly in the range check of its g_threads option. Move the
definition of the MAX_NUM_THREADS macro to vp9/encoder/vp9_ethread.h and
use it in VP9 code only.

Change-Id: Ibf788ca2496c743a2ac0498fefaab8a3c181228d
2024-04-04 20:27:32 +00:00
Chun-Min Chang 0752960c6a Add missing header for EBUSY on mingw
The `error: use of undeclared identifier 'EBUSY'` in
vpx_util/vpx_pthread.h was found in Mozilla's bug 1886318 [1]. This
patch addresses the issue by adding the `<errno.h>` header to introduce
the `EBUSY` identifier, resolving the problem.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1886318#c1

Change-Id: Ic417dafebf5ab160060dd29f692fa9c40d8db05a
2024-04-04 10:10:37 -07:00
Wan-Teh Chang 6445da1b40 Fix GCC -Wmissing-braces warnings
warning: missing braces around initializer [-Wmissing-braces]

Bug: webm:1846
Change-Id: I007a68d09f48d4199ecd948136e69f9cf5f219f5
2024-04-04 00:03:35 +00:00
Casey Smalley 2bafeadd3e Add missing configuration includes
The Google cpp style guide dictates that you should "include what you
use" with respect to symbols. This CL adds vpx_config.h imports to unit
tests that rely on config flags but were otherwise indirectly included.

Change-Id: Ia70a512cebe6c104d2d64afbed3cde8a405c68df
2024-04-03 20:20:44 +00:00
Casey Smalley 588beb020b Unit test config changes for Chromium
This CL will help run libvpx tests under Chromium against its partition
allocator. The allocator does not support single allocations above
3.998GiB. Because of this tests related to large video sizes that
Chromium is configured for are expected to fail.

Chromium also only supports the CONFIG_REALTIME_ONLY option,
some changes are scoped behind this flag.

Change-Id: I80e8743c0619ce502688109ce0be01cb252d5f92
2024-04-03 20:20:44 +00:00
Wan-Teh Chang 05a4c855be Compare ctx->pending_cx_data with NULL
ctx->pending_cx_data is a pointer. It looks nicer to compare
ctx->pending_cx_data with NULL than with 0.

Change-Id: I18815907b3d75551abfc603cb3c5c0297dceed23
2024-04-03 02:53:45 +00:00
Hirokazu Honda 1d007eafa3 vp9 rc: Fix GetSegmentationData() crash in aq_mode=0
cpi_->cyclic_refresh is nullptr if aq_mode is 0, in other words, the
rate controller runs in non adaptive quantization mode. This CL fixes
the crash in GetSegmentationData() in non aq mode.

Bug: b/259487065
Test: video encoding on ChromeOS

Change-Id: I503b30d15c697c8dd1da203b3c7361b91c428e87
2024-04-02 23:00:50 +00:00
Wan-Teh Chang 976cedd643 Set priv->cx_data_sz to 0 if cx_data alloc fails
Change-Id: I6553cd7b09270b4d60ccd7199d499e03c22b3936
2024-04-02 22:53:17 +00:00
Wan-Teh Chang 419f36e8ed encoder_encode: Assert pending_cx_data_sz is valid
In encoder_encode(), assert ctx->pending_cx_data_sz is not too big
before the memmove() call.

Change-Id: Icd1e95f6d751b0bf67386d0d99218b256bc91ebd
2024-04-02 21:52:03 +00:00
Wan-Teh Chang dc74cf923b Dont use VPX_CODEC_CORRUPT_FRAME in set_frame_size
VPX_CODEC_CORRUPT_FRAME is a decoder error. It is strange for
vpx_codec_encode() to fail with this error. In set_frame_size(), change
VPX_CODEC_CORRUPT_FRAME to VPX_CODEC_ERROR.

The use of VPX_CODEC_CORRUPT_FRAME was originally added in
commit 1ed56a46b3.

Change-Id: Iee92ed4cfca5061289b278ece2ba475cf98fec06
2024-04-02 17:56:48 +00:00
Gerda Zsejke More bf932674a8 Add SVE2 implementation of vpx_highbd_convolve8_avg
Add SVE2 implementation of vpx_highbd_convolve8_avg function and the
corresponding tests as well.

Change-Id: I2ff707da55d11b1d5376eb0a7ec85c343a2709c2
2024-04-02 13:32:51 +02:00
Gerda Zsejke More 9274c2bbf0 Merge horiz. and vert. passes in HBD SVE2 2D 4tap convolution
The current SVE2 approach to 2D convolution is:
1) Filter horizontally, storing to an intermediate buffer.
2) Filter vertically and store the final output.

This patch merges the two phases for high bitdepth 2D convolution for
filter sizes smaller or equal to 4 to avoid the storing and
re-loading from the intermediate buffer.

This approach is not beneficial when applying an 8tap filter in the
convolution.

Change-Id: Ie090eb79f1cbf182300d9343ae63069396ef3956
2024-04-02 13:29:48 +02:00
Jingning Han 43d12d5079 Update yv12_mb initialization
BUG=webm:1846

Change-Id: If8475d46397f04ef769f3e4647de5c2d4b6760a4
2024-03-30 00:02:02 +00:00
Jerome Jiang 5396643be6 Add invalid value to gop decision enums
These invalid value definitions are necessary to initialize
the gop decision in external RC so libvpx can tell which is populated
and which is not

Bug: b/329483680
Change-Id: I06bbb41fa59d0fb95296aebd0d05a703ec953b81
2024-03-29 21:20:42 +00:00
Wan-Teh Chang 5f5dfb3303 Assert the return value of read_tx_mode() is < 5
Coverity somehow thinks the return value of read_tx_mode() is between 0
and 7 (inclusive).

Hopefully this will fix Coverity CID 1584457: Out-of-bounds access in
read_coef_probs().

Change-Id: I49fbddf6fd6861bc9def9dfa91eaaaa4aefe5710
2024-03-29 11:22:41 -07:00
Jingning Han ccefddef33 Initialize yv12_mb array
This array will be partially configured and used in later rate
distortion optimization search.

BUG=webm:1846

Change-Id: I83daba341c56767187031edb1c10d4528a4257a3
2024-03-29 09:10:23 -07:00
Wan-Teh Chang d790001fd5 Perform bounds checks in vpx_write_bit_buffer
Add the `size` and `error` members to the vpx_write_bit_buffer struct.
Add the vpx_wb_init() and vpx_wb_has_error() functions.

Instances of the vpx_write_bit_buffer struct are only allocated in the
vp9_pack_bitstream() function. So vp9_pack_bitstream() is the only
function outside vpx_dsp/bitwriter_buffer.* that needs updating.

This CL completes the work of adding output buffer bounds checks to
vp9/encoder/vp9_bitstream.c.

Bug: webm:1844
Change-Id: I6b362be572852ee51d96023b35bfb334faada7e1
2024-03-28 14:05:47 -07:00
Jerome Jiang d5501945fc vp9 rc: override GF_GROUP decisions using ext RC
Bug: b/329483680
Change-Id: I2e02673f1bca56bfa24545b4e25d5e3fd3b0e863
2024-03-28 17:33:54 +00:00
Marco Paniconi 3f8f19372b vp9: Fix to alloc for row_base_thresh_freq_fac
Issue happens for real-time nonrd pickmode.
Due to speed feature: sf->adaptive_rd_thresh_row_mt,
enabled for speed >= 8, and for speed >= 7 svc only.

Issue occurs where resolution (sb_rows) changes and
row_base_thresh_freq_fact needs to be re-allocated.

Fix is to add sb_rows to TileDataEnc and check for
re-alloc of row_base_thresh_freq_fac.

Bug: b:331108922
Change-Id: I1a1ca94c14f343200c180725e4cb8d91d3c55b83
2024-03-28 16:47:45 +00:00
Wan-Teh Chang 73703c188b Perform bounds checks in vpx_writer
In the vpx_writer struct, change the buffer_end field to the size field.
Change vpx_stop_encode() to return true on success, false on failure
(output buffer full).

In write_compressed_header(), remove the assertion
assert(header_bc.pos <= 0xffff). The caller (vp9_pack_bitstream()) will
check that condition.

In vp9_pack_bitstream(), the variable "first_part_size" is renamed
"compressed_hdr_size".

Bug: webm:1844
Change-Id: I4ed6ab905a707ad44d875e53036d5a42523a65d0
2024-03-27 09:07:03 -07:00
Wan-Teh Chang 5bea4606dd Fix a typo in comment: "it" -> "is"
Change-Id: I5d36c5198c67cbb2f424901ec045d0620fea2f04
2024-03-27 14:48:55 +00:00
Wan-Teh Chang 34277e53ad Free row mt memory before freeing cpi->tile_data
In vp9_init_tile_data(), call vp9_row_mt_mem_dealloc(cpi) to free the
row mt memory in cpi->tile_data before freeing cpi->tile_data.

Bug: b:331086799, b:331108729
Change-Id: Idc79984ce7e0110e6858139b2ed286492a2e8622
2024-03-26 23:38:09 +00:00
Marco Paniconi c84d23c6cd vp9: fix to integer overflow test
failure for the 16k test: issue introduced
in: c29e637283

Bug: b/329088759, b/329674887, b/329179808

Change-Id: I88e8a36b7f13223997c3006c84aec9cfa48c0bcf
(cherry picked from commit 19832b1702)
2024-03-26 19:22:17 +00:00
Marco Paniconi b6847dcf72 Fix to buffer alloc for vp9_bitstream_worker_data
The code was using the bitstream_worker_data when it
wasn't allocated for big enough size. This is because
the existing condition was to only re-alloc the
bitstream_worker_data when current dest_size was larger
than the current frame_size. But under resolution change
where frame_size is increased, beyond the current dest_size,
we need to allow re-alloc to the new size.

The existing condition to re-alloc when dest_size is
larger than frame_size (which is not required) is kept
for now.

Also increase the dest_size to account for image format.

Added tests, for both ROW_MT=0 and 1, that reproduce
the failures in the bugs below.

Note: this issue only affects the REALTIME encoding path.

Bug: b/329088759, b/329674887, b/329179808

Change-Id: Icd65dbc5317120304d803f648d4bd9405710db6f
(cherry picked from commit c29e637283)
2024-03-26 19:21:31 +00:00
Wan-Teh Chang 08781b2e51 Add high bit depths, 4:2:2, 4:4:4 to VP9Encoder
A port of the changes to vp9_encoder_fuzz_test.cc in
https://chromium-review.googlesource.com/c/chromium/src/+/5292940.

Change-Id: Ie143ffd9cffbd6a8639812c72e85c9a017aa554e
(cherry picked from commit 8c36d36bcc)
2024-03-26 19:20:29 +00:00
Gerda Zsejke More d2ba3a22b4 Add 2D-specific highbd SVE2 horizontal convolution function
2D 8-tap convolution filtering is performed in two passes -
horizontal and vertical. The horizontal pass must produce enough
input data for the subsequent vertical pass - 3 rows above and 4 rows
below, in addition to the actual block height.

At present, all highbd SVE horizontal convolution algorithms process
4 rows at a time, but this means we end up doing at least 1 row too
much work in the 2D first pass case where we need h + 7, not h + 8
rows of output.

This patch adds an additional SVE2 path that processes h + 7 rows of
data exactly, saving the work of the unnecessary extra row.

Change-Id: I2f5d39ad737dbd7eccb08dd2b51586c6710119b8
2024-03-26 19:00:26 +00:00
Gerda Zsejke More cd9d72c065 Add SVE2 implementation of vpx_highbd_convolve8
Add SVE2 implementation of vpx_highbd_convolve8 function. Add the
corresponding tests as well.

Change-Id: I783cc083f1bce5f13ce721bc191b34c48033f5ae
2024-03-26 19:00:26 +00:00
Jerome Jiang 219d7e6a0c Fix several clang-tidy complaints
Change-Id: I78721d6b7ed692ad9363b5cac4e3324a3136d5b6
(cherry picked from commit 4c2435c33e)
2024-03-26 17:42:20 +00:00
Wan-Teh Chang c9bd573531 Replace "cpi->common." with "pc->"
If a local variable "pc" is defined as &cpi->common, replace
"cpi->common." with "pc->".

Also replace a memcpy() call with a struct assignment.

Change-Id: I6f4f12e69d9989beaa6e04c83d93230e7d726278
2024-03-25 14:46:50 -07:00
Wan-Teh Chang 4f579df337 Declare VP9BitstreamWorkerData dest_size as size_t
Declare the dest_size member of the VP9BitstreamWorkerData struct as
size_t instead of int.

Fix the following MSVC warning:
vp9\encoder\vp9_bitstream.c(1031,37): warning C4267: '=':
conversion from 'size_t' to 'int', possible loss of data

Change-Id: Idab5ad5d4bf4d1e4754f011a3073c9a89da29f55
2024-03-23 11:20:22 -07:00
Wan-Teh Chang e387187438 Add the buffer_end field to the vpx_writer struct
The buffer_end field will allow bounds checking when vpx_writer writes
to the output buffer. This CL sets up the plumbing to pass the output
buffer size from vp9_pack_bitstream() to vpx_start_encode(), which
initializes the vpx_writer struct. vpx_writer doesn't use the output
buffer size in bounds checks yet, but the code in vp9_bitstream.c does.

Bug: webm:1844
Change-Id: I995e469ab453c02d740f54b46e0b08c7f2eb1a2e
2024-03-23 02:15:42 +00:00
James Zern 9137f7fa4b rtcd.pl: add empty specialize() check
This was added in libaom in:
5ddac0aac8 RTCD defs: Remove empty specialize statements once and for all.
https://aomedia-review.googlesource.com/c/aom/+/9062

Change-Id: I9c8fb0c8e4bd4dc9373d8533ab083dff816e7cbe
2024-03-22 09:45:42 -07:00
Wan-Teh Chang d48577579b Pass output buffer size to vp9_pack_bitstream()
Set up the plumbing to pass the size of the output buffer `dest` to
vp9_pack_bitstream(). The output buffer is the cx_data buffer in the
encoder_encode() function in vp9/vp9_cx_iface.c, and its size is
cx_data_sz.

In this CL vp9_pack_bitstream() ignores the `dest_size` parameter.

Bug: webm:1844
Change-Id: I53c80280143d409cf16f87c4d6deec3d9338aea3
2024-03-21 18:59:58 -07:00
James Zern cab4f31e1d encodeframe.c: remove some unused includes
clears some clang-tidy warnings

Change-Id: I82c1d212126b9c7b010b6bc8ac32d92453f6d376
2024-03-21 01:59:48 +00:00
James Zern 3c58cb1bc2 VP8_COMMON: remove unused cpu_caps member
This was set, but not read; rtcd covers this.

Change-Id: I1d8b8f8d8ed9e7bc56c3734cb96b79b937b5e20c
2024-03-20 13:14:35 -07:00
Wan-Teh Chang 6e879c6173 Save encode_tiles_buffer_alloc_size() result
Avoid calling encode_tiles_buffer_alloc_size() twice by saving its
return value in a local variable.

Change-Id: I3050f9cf7c3520f7edc80abf66620ba233fadad8
2024-03-20 20:03:57 +00:00
James Zern afc8b452b8 aarch64_cpudetect: add missing include
clears clang-tidy warning for HAS_*

Change-Id: I1b21326480b7c5c3be18c055f848071df0076915
2024-03-20 18:24:37 +00:00
James Zern 55d4b736b2 vpx_scaled_convolve8_neon: add missing include
clears clang-tidy warnings for types and constants in vpx_filter.h

Change-Id: I1f3f843b9ab6fd0ad038e33a048e8708cbd2a950
2024-03-20 18:24:37 +00:00
Jerome Jiang 6358ef6261 vp9 rc: Add ref frame list for each frame in GOP
Bug: b/329483680
Change-Id: I24573c25e70b41b7af243c473f28fa1b290cc373
2024-03-20 12:17:52 -04:00
Jerome Jiang 18059190d7 Remove vpx_rc_gop_info_t
Not being used anywhere any more. This was used to pass
GOP info to ML models.

Bug: b/617172914
Change-Id: Ibcfa00bc8215b73f43d9a11edbe00b6a2d7fb137
2024-03-20 16:17:23 +00:00
Jerome Jiang 6641e9e03c Add update type and ref update idx to gop decision
Bug: b/329483680
Change-Id: Ifc82ad79415400bbec4efe6ab9b78496d5f73ee7
2024-03-20 16:17:23 +00:00
Jerome Jiang 458e1c6875 Remove TPL IO functions
These are not used in libvpx.

Bug: webm:1837
Change-Id: Ic234b2dcd47d6614030b8a066c921e4285af5e99
2024-03-19 19:05:24 +00:00
Marco Paniconi 19832b1702 vp9: fix to integer overflow test
failure for the 16k test: issue introduced
in: c29e637283

Bug: b/329088759, b/329674887, b/329179808

Change-Id: I88e8a36b7f13223997c3006c84aec9cfa48c0bcf
2024-03-17 10:07:34 -07:00
Marco Paniconi c29e637283 Fix to buffer alloc for vp9_bitstream_worker_data
The code was using the bitstream_worker_data when it
wasn't allocated for big enough size. This is because
the existing condition was to only re-alloc the
bitstream_worker_data when current dest_size was larger
than the current frame_size. But under resolution change
where frame_size is increased, beyond the current dest_size,
we need to allow re-alloc to the new size.

The existing condition to re-alloc when dest_size is
larger than frame_size (which is not required) is kept
for now.

Also increase the dest_size to account for image format.

Added tests, for both ROW_MT=0 and 1, that reproduce
the failures in the bugs below.

Note: this issue only affects the REALTIME encoding path.

Bug: b/329088759, b/329674887, b/329179808

Change-Id: Icd65dbc5317120304d803f648d4bd9405710db6f
2024-03-15 21:43:28 +00:00
Wan-Teh Chang 7fb8ceccf9 Restrict ranges of duration,deadline to UINT32_MAX
Bug: webm:1828
Change-Id: I3b1d208cf300d7c4c5584681183d45b1e97c7380
2024-03-15 01:11:50 +00:00
Wan-Teh Chang bc5a22eb60 Replace timestamp_ratio by oxcf->g_timebase_in_ts
Fix a TODO comment in encoder_init().

Change-Id: Id737142202c807a3f538fdf50612e77ca790990c
2024-03-14 14:32:44 -07:00
Wan-Teh Chang 6c0bf97a98 Detect integer overflows related to pts & duration
A port of the following two libaom CLs:
https://aomedia-review.googlesource.com/c/aom/+/187902
https://aomedia-review.googlesource.com/c/aom/+/188161

Bug: webm:1828
Change-Id: Id25039b000c3d04e7a4c8d71579a6932e9fd65ef
2024-03-14 11:14:25 -07:00
Wan-Teh Chang 8c36d36bcc Add high bit depths, 4:2:2, 4:4:4 to VP9Encoder
A port of the changes to vp9_encoder_fuzz_test.cc in
https://chromium-review.googlesource.com/c/chromium/src/+/5292940.

Change-Id: Ie143ffd9cffbd6a8639812c72e85c9a017aa554e
2024-03-13 13:45:41 -07:00
Jonathan Wright ad1d0ece31 Disable SVE2 if compiler doesn't support arm_neon_sve_bridge.h
SVE and SVE2 code paths in libvpx require intrinsics from
arm_neon_sve_bridge.h. SVE is disabled if the compiler does not
support this header. This patch conditionally disables SVE2 in the
same way.

Also gate the check for arm_neon_sve_bridge.h on whether SVE is
enabled in the first place. The check isn't necessary if the user has
explicitly disabled SVE. (Explicitly disabling SVE already disables
SVE2 since the former is a pre-requisite for the latter.)

Change-Id: Ibb21f09e8b2470d1ce5d98b71b101f5b7f7dbcdc
2024-03-13 18:38:10 +00:00
James Zern c1494fa57e neon: fix -Woverflow warnings
with signed char values, 128 -> -128

Change-Id: Iec2257729d7878459794d6a3d6bc3f745d39e97c
2024-03-13 18:36:14 +00:00
Wan-Teh Chang daa33cca37 Remove return statement after vpx_internal_error()
In encoder_encode(), remove the return statement after a
vpx_internal_error() call because setjmp() has been called at that
point.

Change-Id: Ib8ebbfbacb21097ce7f1b4e3bf53004bbe88a42b
2024-03-13 00:57:33 +00:00
Wan-Teh Chang 0ba7b50338 Ignore the pts parameter when flushing the encoder
Change-Id: I8380a4a7ffcbf7a6f183d02d363473273b47f064
2024-03-12 11:02:30 -07:00
Wan-Teh Chang 7f6ba04e87 Move the local variable sd to the innermost scope
Change-Id: Ie6bfda6247ba408b9dbcf0b94fa95dbca0c57adb
2024-03-11 17:07:39 -07:00
James Zern cf1b7a65ff VP9RateControlRtcConfig: relocate some initializations
use default member initializers for all members for consistency.

Change-Id: I1956163c995d94aadbde38b4edaf21dc722e50c4
2024-03-11 18:50:00 +00:00
James Zern 0af7244971 ratectrl_rtc.h: remove use of vp9_zero()
This is an internal define that shouldn't be exposed in this header.

Change-Id: I43b793ab18c19ffab8bcc71fcd7097216989ca5a
2024-03-11 18:50:00 +00:00
James Zern ca7fd396e7 ratectrl_rtc.h: move some includes to .cc
This is the first step in removing the use of internal headers in a
public header.

Change-Id: Ia71b0b16a01037baa72942fc8ee7aeb4ffc04b86
2024-03-11 18:50:00 +00:00
James Zern 0ba67bb93d *ratectrl_rtc.h: remove unneeded 'public:'
in struct VP8RateControlRtcConfig and struct VP9RateControlRtcConfig;
structs default to public access.

Change-Id: Icdc5b44fb4c7297b0cb3c6cde8bec33ea5cee18c
2024-03-11 18:50:00 +00:00
James Zern cd88d25c53 vp8_ratectrl_rtc.cc: fix include order
vp8/vp8_ratectrl_rtc.h should come first as it's implemented in this
module. Split the rest of the groups on C/C++/vpx bounds.

Change-Id: If6bbbd8f3adf3766fa36fbc53ae06c9f6f76ebe9
2024-03-11 18:48:31 +00:00
Gerda Zsejke More 5391609fbe Add SVE2 implementation of vpx_highbd_convolve8_avg_vert
Add SVE2 implementation of vpx_highbd_convolve8_avg_vert function.
Add the corresponding tests as well.

Change-Id: I20ca19e09a1686bb00c0b51bf756ddab0adbc2c0
2024-03-11 18:43:35 +00:00
Gerda Zsejke More 45ea306dad Add SVE implementation of vpx_highbd_convolve8_avg_horiz
Add SVE implementation of vpx_highbd_convolve8_avg_horiz function.
Add the corresponding tests as well.

Change-Id: If13793fa653834dfdfeddfee60b80129eea85dd7
2024-03-11 18:43:35 +00:00
Gerda Zsejke More 2c3a9b69e7 Add SVE2 implementation of vpx_highbd_convolve8_vert
Add SVE2 implementation of vpx_highbd_convolve8_vert function. Add
the corresponding tests as well.

Change-Id: I289ac79d4493935217feaa4fd2fa0b8ef9a62972
2024-03-11 18:43:35 +00:00
Gerda Zsejke More 282e9aa0eb Add Arm SVE2 build flags and run-time CPU feature detection
Add 'sve2' arch options to the configure, build and unit test files -
adding appropriate conditional options where necessary. Arm SIMD
extensions are treated as supersets in libvpx, so disable SVE2 if
SVE is unavailable.

Change-Id: Icdec2aace357e36fba77c77cd8b70da1e5427fce
2024-03-11 18:43:35 +00:00
Wan-Teh Chang a87978a53d VP8: Always reset the setjmp flag before returning
Always reset the setjmp flag to 0 before returning from the function
where setjmp() was called.

Change-Id: I80bf39ef1769f656f53c6c6657c06e34489750f4
2024-03-11 16:45:59 +00:00
Wan-Teh Chang f51417671e Include system headers first
Change-Id: Ia096dacb3dd102829196e5ebd1bc148cf2ea2f93
2024-03-09 18:27:18 +00:00
James Zern 03c7f6a108 libs.doxy_template: remove DOT_TRANSPARENT
This was deprecated in 1.9.5 [1]. It is now enabled by default. For
earlier versions of doxygen this will set the value to false, but I
don't believe we were relying on this functionality.

[1]: https://www.doxygen.nl/manual/changelog.html#log_1_9_5

Change-Id: I75f576d35ca86636761cf70fda0dd0ad37f71d71
2024-03-09 02:33:16 +00:00
Wan-Teh Chang f46d99bcf7 Clear dangling ptr in vp8_remove_decoder_instances
Change-Id: I80c7d41c4675305efbbfbaddd45b42122979b318
2024-03-09 01:02:58 +00:00
Wan-Teh Chang ec06dcc314 Subtract pts_offset from pts after calling setjmp
This allows us to call vpx_internal_error() if the relative pts would be
negative.

Change-Id: I9ca314c4e32bb2c17bbe20ede6ea854bf9701ade
2024-03-08 14:07:38 -08:00
James Zern 99e887c09e vp8/encoder/encodeframe.c: sort includes
Change-Id: I30a8117754e8168a3f6fe37c4ea459475ad1b9aa
2024-03-07 19:57:44 -08:00
Wan-Teh Chang a6647c9cab Add vp8_ prefix to sem_* macro names
The sem_* macros do not behave exactly like the POSIX sem_* functions.
Add the vp8_ prefix to the sem_* macro names to make it clear that they
are not the POSIX sem_* functions. Another reason for adding the vp8_
prefix is that we need to wrap sem_wait() (to handle EINTR) on the Unix
platforms that have real sem_wait() function.

Handle EINTR in the Unix (non-Apple) definition of vp8_sem_wait().

Change-Id: I3df02a30f851d41691a55cf7a84aa2ff054bba9c
2024-03-08 01:46:59 +00:00
Jonathan Wright 6b6916be0a Refactor standard bitdepth Neon scaled convolve
Tidy up the standard bitdepth Armv8.0 Neon implementation of scaled
convolution.

Change-Id: I9e48e773b4a4b252b9254a22af23c8e834407b8a
2024-03-08 00:39:58 +00:00
Jonathan Wright 9b94b7bd01 Optimize Arm Neon implementation of transpose_u8_8x8()
Operate on 128-bit vectors to reduce the total number of instructions
by two.

Change-Id: I252e67831ccbb51adcfe5caaadb3205d3eb11b79
2024-03-08 00:39:58 +00:00
James Zern fa64af7bbf vp8/encoder/encodeframe.c: add missing include
Based on a clang-tidy warning:
  `no header providing "sem_wait" is directly included`
Though this may not clear it entirely, it's the closest that can be
done given the platform-dependent includes and implementation in
vp8/common/threading.h

Change-Id: I19984f820f3f380e58deef40563a2f0c66187748
2024-03-07 13:53:56 -08:00
James Zern 1f066bf77c build/make/Android.mk: update configure/build comments
set --target to the more modern aarch64-android-gcc and remove an
incorrect comment regarding realtime-only.

Change-Id: I5f6c9de9fcd96a60817e37fc6f6505725ddea6b9
2024-03-07 00:40:17 +00:00
George Steed b0e26cdcfd aarch64_cpudetect.c: Avoid unused variable warning
When dot-product and SVE support are disabled the hwcap variable is
currently unused. Fix this by wrapping it in an #ifdef matching the
conditions where it is needed.

Change-Id: I1c2e302d861c6c726b314e374f07d4fafe17ffc7
2024-03-06 18:52:38 +00:00
Jerome Jiang 148c7f65f0 IWYU: fix clang-tidy complaints
Include vp9_firstpass.h for KF_UPDATE

Change-Id: Ie1805a2201f3c42c7d3a0102e4eaa0378cca315e
2024-03-06 10:11:46 -05:00
Daniel Cheng b207d1c9bd Only #define __builtin_prefetch if it doesn't exist.
libvpx's check for conditionally defining __builtin_prefetch is broken,
since clang-cl defines __builtin_prefetch on Win ARM64: in addition, it
supports up to 3 arguments, with the latter 2 being optional. This
causes build breaks when paired with other libraries, like Abseil, which
do perform the conditional test correctly.

The real fix here is to define something like VPX_PREFETCH rather than
trying to #define an implementation-reserved name, which is undefined
behavior.

Bug: 328105513
Change-Id: Ibe14d9ce34306654bd20e560973f76c3b40036ee
2024-03-04 18:11:26 -08:00
Jerome Jiang a571299b07 vp9 ext rc: Do motion search on key frame in TPL
Bug: b/327254742
Change-Id: I7448c09994441c89c36420e780cd2641c6f1aa5a
2024-03-04 21:54:11 +00:00
Jonathan Wright 9d8d71b41b Refactor Arm Neon transpose_concat_*() to not need lookup table
Refactor the transpose_concat_*() helper function used in the Arm Neon
DotProd and I8MM vertical convolution implementations to not use TBL
instructions. Using vzip* to achieve the same outcome (with the same
number of instructions) avoids needing/loading the lookup indices and
also increases performance on little (in-order) Arm Cortex cores.

Change-Id: Iff62a44f8a9bf0ee239d5bb36be8424cab0dbca5
2024-03-04 20:24:03 +00:00
Jonathan Wright 5a8e2f705e Cosmetic: Remove 'vpx_' prefix from static Neon functions
Tidy up some of the naming in Arm Neon convolution functions.

Change-Id: I9cfd925dbcb754bdf9fe0860a46a1c9dca2c7f9a
2024-03-04 20:24:03 +00:00
Cheng Chen f394f2be74 Delete "public" from struct definitions
Struct by default is public.

Change-Id: I87dc164d6a63fcc950c6e513901fc2826e53a8ae
2024-02-29 14:16:55 -08:00
Wan-Teh Chang d4959f9825 Handle EINTR from sem_wait()
sem_wait() may be interrupted by a signal and fail with EINTR:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_wait.html

Retry the sem_wait() call if it fails with EINTR.

This finishes the fix started in
https://chromium-review.googlesource.com/c/webm/libvpx/+/5299569. As a
speculative fix, that CL fixed only the sem_wait(&cpi->h_event_end_lpf)
calls responsible for bug chromium:324459561. ClusterFuzz verified the
fix, so this CL extends it to the other sem_wait() calls.

Note that sem_wait() calls like the following do not need this fix,
because the while (1) loop retries the sem_wait() call if it fails:

  while (1) {
    if (vpx_atomic_load_acquire(&cpi->b_multi_threaded) == 0) break;

    if (sem_wait(&cpi->h_event_start_lpf) == 0) {
      ...
    }
  }

Bug: chromium:324459561
Change-Id: I0f0612616eee37fb3da68049e49b3e86927b5e24
2024-02-28 21:06:36 +00:00
George Steed 793c0b9196 Only enable AArch64 extensions if the compiler supports them
We already have some logic in the configure.sh file to selectively
disable code dependent on particular architecture extensions, however we
do not yet have anything to check that the compiler being supplied
recognises and can compile code using these extensions.

This commit adds compiler "-march=..." flag tests to the existing
extension-disable loop so that we now correctly disable extensions that
are not supported by the compiler. For AArch64 this loop also needs to
move below the existing compiler/OS handling to ensure that prefixes
like $CROSS are handled correctly before running compiler tests.

Bug: webm:1841
Change-Id: I936b911c4b0ebf03abc34b7532b2bb4568129f57
(cherry picked from commit fa50b26848)
2024-02-28 02:46:29 +00:00
Gerda Zsejke More 3ac1316c46 Require Arm Neon-SVE bridge header for enabling SVE
Disable SVE feature if arm_neon_sve_bridge header is not supported
by the compiler.

Change-Id: I3f78be2dd95b37b8d51b9f1fceca1f9701535eca
(cherry picked from commit 6ea3b51ec2)
2024-02-28 02:45:59 +00:00
Wan-Teh Chang b7b5d0a568 Use the value param in Win32 version of sem_init
Name the three parameters of sem_init() as sem, pshared, value. See
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_init.html.

Pass the `value` parameter to CreateSemaphore() as the second
(lInitialCount) parameter:
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsemaphorea

Remove unneeded parentheses around semaphore_wait(*sem).

Change-Id: I1735c94adb511ca539159dfea19421595ec15d24
2024-02-27 13:44:23 -08:00
Wan-Teh Chang 7b9843099c Handle EINTR from sem_wait(&cpi->h_event_end_lpf)
sem_wait() may be interrupted by a signal and fail with EINTR:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_wait.html

Retry the sem_wait(&cpi->h_event_end_lpf) call if it fails with EINTR.

Bug: chromium:324459561
Change-Id: Icc957e8b9f21f25ec3c95e22cab502af417443f2
(cherry picked from commit d63efe0679)
2024-02-27 12:11:58 -08:00
Marco Paniconi 4c80888a71 vp8: Fix to race issue for multi-thread with pnsr_calc
Added unitest which triggers the data race in the
bug below, when only C code is forced.

The data race is between the loopfilter and variance
computation from generate_psnr_packet calculation.
Proposed fix is to move the wait for loopfilter thread to
finish up before entering generate_psnr_packet().

Bug: b/266833179.

Change-Id: Id2871c53274be0f404e65601c9a5c98aaead0c72
(cherry picked from commit 756b29a776)
2024-02-27 19:57:23 +00:00
George Steed fa50b26848 Only enable AArch64 extensions if the compiler supports them
We already have some logic in the configure.sh file to selectively
disable code dependent on particular architecture extensions, however we
do not yet have anything to check that the compiler being supplied
recognises and can compile code using these extensions.

This commit adds compiler "-march=..." flag tests to the existing
extension-disable loop so that we now correctly disable extensions that
are not supported by the compiler. For AArch64 this loop also needs to
move below the existing compiler/OS handling to ensure that prefixes
like $CROSS are handled correctly before running compiler tests.

Bug: webm:1841
Change-Id: I936b911c4b0ebf03abc34b7532b2bb4568129f57
2024-02-27 19:53:03 +00:00
Gerda Zsejke More 3646b12927 Specialise highbd_convolve8_horiz_sve for 4-tap filter
Add SVE implementation for vpx_highbd_convolve8_horiz that specialises
for 4-tap filters. This way we avoid a lot of redundant work to
multiply and add zero, given that some of the 8-tap filters are
zero-padded, so they are effectively 4-tap filters.

Change-Id: Ib5e0377f924df1d893e9436f443fcbe7d196ea27
2024-02-27 19:38:09 +00:00
Gerda Zsejke More c78f1ef4a0 Rename dot_neon_sve_bridge header file
Rename dot_neon_sve_bridge.h to vpx_neon_sve_bridge.h in order to
reflect that other instructions can be implemented in the header
file. In a subsequent patch, the usage of vtbl with Neon-SVE bridge
intrinsics will be added.

Change-Id: I8f71aad2b7fb4932c9554badf041a80aca58c7cf
2024-02-27 19:38:09 +00:00
Jonathan Wright 2bc1012c53 Remove redundant code for neon_dotprod 2D convolution
Remove the 4-tap Neon DotProd path for the horizontal pass of 2D
convolution since it has been made redundant by the horizontal-
vertical merged implementation. Also move the 8-tap path closer to
where it is used and call it explicitly rather than the filter-
agnostic wrapper.

Change-Id: I1861dc88a67a759c3e8deb0b471ec447a62063f2
2024-02-26 22:28:05 +00:00
Jonathan Wright baece7460d Merge h. and v. passes in 4-tap SBD Neon DotProd 2D convolution
The current SBD Neon DotProd approach to 2D convolution is:
1) Filter horizontally, storing to an intermediate buffer.
2) Filter vertically and store the final output.

This patch merges the two phases for 4-tap standard bitdepth 2D
convolution to avoid storing to and re-loading from the intermediate
buffer - giving a 10-25% speedup depending on block size. Merging the
passes for 8-tap filters does not have the same benefit, so keep the
existing implementation.

Change-Id: Ic6008836d1a499ee2cd957b9db194fca5671ccb4
2024-02-26 22:28:05 +00:00
Jonathan Wright d191c5f984 Remove redundant code for neon_i8mm 2D convolution
Remove the 4-tap Neon i8mm path for the horizontal pass of 2D
convolution since it has been made redundant by the horizontal-
vertical merged implementation. Also move the 8-tap path closer to
where it is used and call it explicitly rather than the filter-
agnostic wrapper.

Change-Id: Icddecb7e133656c54aa5e79536b49759715b6fcb
2024-02-26 20:59:41 +00:00
Jonathan Wright cef5b0da97 Merge h. and v. passes in 4-tap SBD Neon i8mm 2D convolution
The current SBD Neon i8mm approach to 2D convolution is:
1) Filter horizontally, storing to an intermediate buffer.
2) Filter vertically and store the final output.

This patch merges the two phases for 4-tap standard bitdepth 2D
convolution to avoid storing to and re-loading from the intermediate
buffer - giving a 5-40% speedup depending on block size. Merging the
passes for 8-tap filters does not have the same benefit, so keep the
existing implementation.

Change-Id: Ic8ec2822681176ef879dcaf8424d8d91c5e8d2df
2024-02-26 20:59:41 +00:00
James Zern a3209600f2 codec_factory.h: fix -Wpedantic warnings
With either CONFIG_VP8=0 or CONFIG_VP9=0. Fixes a warning about an extra
';' outside of a function due to VP[89]_INSTANTIATE_TEST_SUITE() being
defined to nothing.

Change-Id: I1878d7596e39c5166efbe96450a733efc08665ea
2024-02-26 20:52:35 +00:00
Jerome Jiang b5578f1283 Add inter/intra_pred_err to VpxTplBlockStats
inter/intra_cost in VP9 TPL is calculated with SATD
which should be close enough to be used as inter/intra_pred_err

Bug: b/326262148
Change-Id: Ic0fd08708fcf3640398fc22a1a6bb6f449b2a9b8
2024-02-26 12:27:38 -05:00
Jerome Jiang ff9591f8df vp9 ext rc: assign srcrf_dist/rate instead
Bug: b/326262148
Change-Id: I3af0b5d28c58447862eb11d5b10afa8a32d82ada
2024-02-26 17:27:11 +00:00
James Zern 5433b943a4 resize_test.cc: fix warning w/CONFIG_VP9=0
fixes -Wunused-but-set-variable

Change-Id: Id9431342745baa1492f5da0e32d09372e10fdcd2
2024-02-24 00:53:28 +00:00
James Zern fca3d1755f fix void param declarations
These should be funcname(void) rather than funcname(). Quiets some
-Wstrict-prototypes warnings.

Change-Id: I68705fe53f4438c9584e7040c39cecec859af27c
2024-02-22 15:13:03 -08:00
James Zern 5e90a97fa2 tokenize.h: remove undefined vp8_tokenize_initialize()
It was removed in:
f039a85fd Make global data const

Change-Id: Ib5aa35500c3ee7caf1ec216e0351c32ef373f5f2
2024-02-22 13:33:26 -08:00
Marco Paniconi 79284f4c84 vp8: add uv_delta_q support to external RC
Bug: b/321137490

Change-Id: Id9ccf8e80d693b296b224846094fc7c0f71c5d0a
2024-02-22 17:31:40 +00:00
James Zern 1659e73b0b vp9_context_tree.h: add name to union
Anonymous unions are not supported in C99, they were added in C11:
https://en.cppreference.com/w/c/language/union

Fixes -Wpendantic warning:
vp9/encoder/vp9_context_tree.h:93:4: warning: ISO C99 doesn’t support
  unnamed structs/unions [-Wpedantic]

Change-Id: Ibd29d6deca35d81ea886e80e9f44575c73ecd96d
2024-02-21 23:15:19 +00:00
James Zern 5d022e45ec vp9_rdopt,skip_iters: normalize use of const
Fixes a -Wpedantic warning:
vp9/encoder/vp9_rdopt.c:1988:20: warning: invalid use of pointers to
  arrays with different qualifiers in ISO C before C2X [-Wpedantic]

Change-Id: I581e21d7e59c0bae0e44056a3b3f049c5a4e7cf2
2024-02-20 13:56:59 -08:00
Gerda Zsejke More 9c0c5144e7 Add SVE implementation of vpx_highbd_convolve8_horiz
Add SVE implementation of vpx_highbd_convolve8_horiz function. Add
the corresponding tests as well.

Change-Id: I0b2815831daf203e167ea5289307087ce53ff9da
2024-02-20 19:14:56 +00:00
Jonathan Wright 7e9da9702c Use Armv8.0 Neon 4-tap vertical convolution for all arch levels
The new Armv8.0 Neon implementation of 4-tap vertical convolution is
faster than Armv8.4 DotProd and Armv8.6 I8MM implementations. This
patch removes the DotProd and I8MM implementations in favour of using
the Armv8.0 version everywhere.

Change-Id: I126470fd4862d8bb116153e90bb2e4f2f2dba1e4
2024-02-20 15:22:35 +00:00
Jonathan Wright 9f7a70bdf2 Further accelerate Armv8.0 Neon 4-tap convolution
Refactor Armv8.0 Neon 4-tap convolution functions to operate on 8-bit
types directly, rather than first widening to 16-bit.

2-tap (bilinear) filter values are always positive, but 4-tap filter
values are negative on the outer edges (taps 0 and 3), with taps 1
and 2 having much greater positive values to compensate. To use
instructions that operate on 8-bit types we also need the types to be
unsigned. In the convolution kernel, subtracting the products of taps
0 and 3 from the products of taps 1 and 2 always works since 2-tap
filters are 0-padded.

Co-authored by: Hari Limaye <hari.limaye@arm.com>

Change-Id: I87b32e2ef8cbd21eebb8cd2642e8826b704905b1
2024-02-20 15:22:22 +00:00
Wan-Teh Chang 4340382bb0 Move THREADFN macro definitions to vpx_pthread.h
The THREADFN and THREAD_EXIT_SUCCESS macros are used to define the
thread start routines passed to our implementation of pthread_create(),
so it makes sense to define these macros in vpx_util/vpx_pthread.h. This
also allows the VP8 and VP9 code to share the macro definitions.

Replace the THREAD_FUNCTION macro by THREADFN. They have the same
definition.

Change-Id: I79a7476e43652667af6a8da7ad7ce346b1b6b024
2024-02-16 09:46:39 -08:00
Wan-Teh Chang 4e384da53d Delete a duplicate definition of thread_sleep()
There are two identical definitions of thread_sleep() for Win32. Delete
the first one.

Change-Id: I617e180e3459a24fbafec5b060bbdcd4fcee8128
2024-02-15 20:31:25 -08:00
Wan-Teh Chang 3316c11240 Delete unused macro definitions
Change-Id: Ic12d5b9ec9b18743e8ef67d132ed3bbbc90c7fa6
2024-02-15 17:04:32 -08:00
Wan-Teh Chang d63efe0679 Handle EINTR from sem_wait(&cpi->h_event_end_lpf)
sem_wait() may be interrupted by a signal and fail with EINTR:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_wait.html

Retry the sem_wait(&cpi->h_event_end_lpf) call if it fails with EINTR.

Bug: chromium:324459561
Change-Id: Icc957e8b9f21f25ec3c95e22cab502af417443f2
2024-02-16 00:14:40 +00:00
Jerome Jiang e1da3834ba Add base qp to ext rc config
Change-Id: I0eb7e0dbe3d1784c4408fdddf763d2b64c90fbb5
2024-02-15 13:08:46 -05:00
Peter Kasting e92dd05124 Add VPX_WORKER_STATUS_ to values of global-scope status enum.
This helps prevent name clashes if code e.g. #includes headers from both
libvpx and libaom.

Bug: none
Change-Id: Ifc9e7ac4862dc04a399e7777d2636e1453627970
2024-02-14 20:37:40 -08:00
Peter Kasting 4c0cf7458c Split pthread wrapper to vpx_pthread.h.
Also does a bit of cleanup to the THREAD macros as suggested in review.

Bug: none
Change-Id: I1fbfacf99b2439ac1147e346e53d72d7ee39c298
2024-02-14 18:54:43 +00:00
Jerome Jiang b01d61c9af Remove unused signals for get_encodeframe_decision
Bug: b/323234722
Change-Id: Iab5c27b232552f924b05fdd7fa1cd6792e04faed
2024-02-14 10:46:18 -05:00
Jerome Jiang 591c787436 vp9 ext rc: Remove initializer for gop_decision
Change-Id: Ie4ebcc39ab8c34631395ce81e2916c766c3a7f13
2024-02-13 23:21:18 +00:00
Jonathan Wright 455cb26998 Optimize Arm Neon USDOT narrowing sequences in convolve kernels
Currently we use two rounds of complex right-shift operations to
narrow and pack results from the dot-product convolution kernels.
This patch refactors these sequences to use one "simple" right-shift
and one complex right-shift - reducing the latency by 4 cycles on
modern out-of-order Arm CPUs.

Change-Id: I3fd38560bb14d85826e417f40d35f11165ab80da
2024-02-13 19:58:25 +00:00
Jonathan Wright 939bcd4026 Optimize Arm Neon SDOT narrowing sequences in convolve kernels
Currently we use two rounds of complex right-shift operations to
narrow and pack results from the dot-product convolution kernels.
This patch refactors these sequences to use one "simple" right-shift
and one complex right-shift - reducing the latency by 4 cycles on
modern out-of-order Arm CPUs.

Change-Id: I908147ed65a87157009363782399ff398406cdf9
2024-02-13 19:58:25 +00:00
Jerome Jiang a64bf87fb9 Fix gop decision and gop index in TPL pass
- Initialize gop_decision
 - Initialize GF group for a new one
 - GF group index for key frame special treatment is not needed any more
   when key frame is decided by the RC

Bug: b/323050877
Change-Id: Iaf36ea4f671b833f3ba4c524b9799a3093412dfa
2024-02-13 18:01:20 +00:00
Peter Kasting 8cf26c1284 Backport thread-related changes from libaom.
This ports changes that touched aom_thread.[c,h] from the time after
libaom copied libvpx' sources, where they hadn't already been present.
The goal here is to unify the two repos' thread implementations in hopes
of ultimately sharing one.

The list of commits is approximately as follows; however, I made a few
other changes as necessary where noted.
https://aomedia-review.googlesource.com/c/aom/+/64044
  Edited other hook func return values similarly.
https://aomedia-review.googlesource.com/c/aom/+/71321
https://aomedia-review.googlesource.com/c/aom/+/71327
https://aomedia-review.googlesource.com/c/aom/+/71436
https://aomedia-review.googlesource.com/c/aom/+/72481
  Also removed conflicting MAX_NUM_THREADS definition of 80. I think
  this was incorrect as the relevant array was indexed by variables that
  were in turn controlled by the global config values that were clamped
  to <=64.
https://aomedia-review.googlesource.com/c/aom/+/102621
  Also removed a pre-XP handling block in
  vp8/common/generic/systemdependent.c.
https://aomedia-review.googlesource.com/c/aom/+/102601
  MAX_DECODE_THREADS was the only relevant piece.
https://aomedia-review.googlesource.com/c/aom/+/102741
https://aomedia-review.googlesource.com/c/aom/+/109025
https://aomedia-review.googlesource.com/c/aom/+/160961
https://aomedia-review.googlesource.com/c/aom/+/169684
  Also removed OS/2 support from elsewhere.
https://aomedia-review.googlesource.com/c/aom/+/169823
https://aomedia-review.googlesource.com/c/aom/+/170022
https://aomedia-review.googlesource.com/c/aom/+/169685
https://aomedia-review.googlesource.com/c/aom/+/173761
https://aomedia-review.googlesource.com/c/aom/+/174842

Bug: none
Change-Id: I91462873a57e9efa120288d1bd8af3a6c09d423d
2024-02-12 18:45:00 -08:00
Jonathan Wright 491c16a9f3 Merge horiz. and vert. passes in HBD Neon 2D avg convolution
The current Neon approach to 2D convolution is:
1) Filter horizontally, storing to an intermediate buffer.
2) Filter vertically, average with the dst block and store the final
   output.

This patch merges the two phases for high bitdepth 2D convolution to
avoid the storing and re-loading from the intermediate buffer. This
provides a small gain (<5%) for large block sizes but the benefit
increases for small block sizes - as the proportion of compute to
memory access decreases. These effects are amplified further when
considering little (in-order) core performance.

Change-Id: I84f1cafcfbbfa48b2cfe4b20881da9c4bc3b56ac
2024-02-12 13:22:19 +00:00
Jonathan Wright 364326c37f Merge horiz. and vert. passes in HBD Neon 2D convolution
The current Neon approach to 2D convolution is:
1) Filter horizontally, storing to an intermediate buffer.
2) Filter vertically and store the final output.

This patch merges the two phases for high bitdepth 2D convolution to
avoid the storing and re-loading from the intermediate buffer. This
provides a small gain (<5%) for large block sizes but the benefit
increases for small block sizes - as the proportion of compute to
memory access decreases. These effects are amplified further when
considering little (in-order) core performance.

Change-Id: I8ec13fb9edd642fdb927bf5394a3c2a349d22a29
2024-02-12 12:58:45 +00:00
Jonathan Wright 58731e2b7a Specialise highbd Neon 2D horiz convolution for 4-tap filters
Add a highbd Neon implementation of the horizontal portion of 2D
convolution specialised for executing with 4-tap filters. This new
path is also used when executing with bilinear (2-tap) filters.

Change-Id: I513e35c4f8857bc89e0def5e9402bc31ddd46440
2024-02-09 17:05:47 +00:00
Jonathan Wright 3127962e71 Specialise highbd Neon vert convolution for 4-tap filters
Add a highbd Neon implementation of vertical convolution specialised
for executing with 4-tap filters. This new path is also used when
executing with bilinear (2-tap) filters.

Change-Id: I30469c7b8e6ccff31d96588a3e4c21b401f1ed09
2024-02-09 15:37:51 +00:00
Jonathan Wright 70b14bf4dc Specialise highbd Neon horiz convolution for 4-tap filters
Add a highbd Neon implementation of horizontal convolution specialised
for executing with 4-tap filters. This new path is also used when
executing with bilinear (2-tap) filters.

Change-Id: Icabeea295af3e0bbeda755168996668cb960b0de
2024-02-09 15:37:51 +00:00
Jonathan Wright b1c9bbeaae Remove unneeded assert in vpx_filter.h
Filter tap reporting was made more granular recently[1] to enable Arm
Neon optimizations that specialise convolution implementations
according to the filter size. This patch removes an assert that
should have been removed during that change - it no longer serves any
purpose to assert that the filter being used is a no-op filter.

This change is a pre-requisite for some highbd Neon convolution
changes that specialise implementations according to filter size.
(Without this change a convolve-copy test would fail should we
interrogate the size of the filter.)

[1] https://chromium-review.googlesource.com/c/webm/libvpx/+/5063929

Change-Id: I2a71680d27134535e6c0663b1668ba1b150b1a6f
2024-02-09 15:29:18 +00:00
Jonathan Wright 00135942da Add 2D-specific highbd Neon horizontal convolution function
2D 8-tap convolution filtering is performed in two passes -
horizontal and vertical. The horizontal pass must produce enough
input data for the subsequent vertical pass - 3 rows above and 4 rows
below, in addition to the actual block height.

At present, all highbd Neon horizontal convolution algorithms process
4 rows at a time, but this means we end up doing at least 1 row too
much work in the 2D first pass case where we need h + 7, not h + 8
rows of output.

This patch adds an additional Neon path that processes h + 7 rows of
data exactly, saving the work of the unnecessary extra row.

Change-Id: Id6658b4e9e774effc760ff131e188b6907a57676
2024-02-09 10:38:12 +00:00
Jonathan Wright 08eb51bc1a Call scalar impl. immediately from HBD Neon 2D convolution
Call scalar C implementation of 2D convolution immediately if scaling
is required - instead of entering the Neon functions for the
horizontal and vertical passses and then falling back to the scalar
implementation. This has the benefit of being able to allocate a
smaller intermediate buffer.

Change-Id: Icacdd5f3a1401395951b613da1cd6932955bd0f8
2024-02-09 10:37:19 +00:00
Jonathan Wright ef3fd00c27 Refactor Neon highbd 2D convolution definitions and merge files
There's no reason for these files to be separate, and merging them
will make life easier in subsequent commits adding a horizontal pass
specialised for the first pass of 2D.

Also perform some refactoring for 2D convolution definitions:
- Add a comment deriving the intermediate buffer height.
- Align the intermediate buffers to 32 bytes.

Change-Id: Ib92524396e6f9c58295339de54d08d894ace3bd1
2024-02-08 17:49:45 +00:00
Jonathan Wright 72cc21e3a2 Refactor SBD Armv8.0 Neon horizontal convolve8 paths
Mostly a cosmetic change:
1) Remove forward declarations.
2) Remove excessive prefetches.

Change-Id: I88d42d8f9ee828c6c4095ffaec8e0333d776a4a1
2024-02-08 09:44:33 +00:00
Jonathan Wright 81ce6067cc Refactor SBD Armv8.0 Neon vertical convolve8 paths
Mostly a cosmetic change:
1) Remove forward declarations.
2) Remove excessive prefetches - some of which were wrong, prefetching
   data that had just been loaded.

Change-Id: I17d8accc2abf3a9b2050603f859fce588a1f7178
2024-02-08 09:44:19 +00:00
James Zern e32f9d4139 configure: remove profile from CONFIG_LIST
CONFIG_PROFILE is unused currently. The option can still be selected
because it is in the CMDLINE_SELECT list and interpreted by configure
directly.

Bug: webm:1835
Change-Id: Id9667289113335a10018803f578b255967bd60b1
2024-02-08 02:49:44 +00:00
James Zern 8408251f47 README,cosmetics: break some long lines / fix whitespace
+ normalize configure commands

Change-Id: Id21ebca85e7e8e4df128e986d4f4ec33c7f1483f
2024-02-07 19:24:45 +00:00
Jonathan Wright 96b64eaac5 Refactor Neon highbd_convolve8 kernels
Move narrowing shift and max value clipping into the 4-pixel-output
kernel. As well as cleaning up the code quite a bit, this also
improves performance by 5-10% as it eliminates the implied top /
bottom register shuffling of the previous approach.

Also clean up the formatting and magic numbers in the 8-pixel-output
kernel.

Change-Id: I77a5e9e317ef4097f187330d4b32973022ba573f
2024-02-07 00:35:02 +00:00
Jonathan Wright 18bc7ffe59 Optimize vpx_highbd_convolve8_horiz_avg_neon
Avoid transposes before and after convolution kernels by using extra
loads.

Change-Id: Iddee4752d7f9ed644502176ed863742fa77fe5a6
2024-02-07 00:34:19 +00:00
Jonathan Wright 04c8813a2c Optimize vpx_highbd_convolve8_horiz_neon
Avoid transposes before and after convolution kernels by using extra
loads.

Change-Id: I20c622fcb208e83534d604af50a58ba5ac472264
2024-02-07 00:33:55 +00:00
Wan-Teh Chang a0f3eb8ce4 Delete a useless clamp(q, x, y) call
In https://chromium-review.googlesource.com/c/webm/libvpx/+/71356, the
statement
  clamp(q, active_best_quality, active_worst_quality);
was added to rc_pick_q_and_bounds_two_pass() (recently renamed
vp9_rc_pick_q_and_bounds_two_pass()).

The result of the clamp() call is not used, so the clamp() call has no
side effect.

Fix Coverity CID 1577645 Useless call:
  side_effect_free: Calling
  clamp(q, active_best_quality, active_worst_quality) is only useful for
  its return value, which is ignored.

Change-Id: I014c3e4caf2bc999fe480000acc4e49e7ad15aaf
2024-02-06 23:31:27 +00:00
Jerome Jiang f5e1a0ab7e Include headers to fix clang-tidy complaints
Change-Id: I7fd2a10b4775e7e7fca49339832c257d84d99e33
2024-02-06 22:26:21 +00:00
Jonathan Wright 6c00356485 Refactor vpx_highbd_convolve8_avg_vert_neon
Various bits of tidying up to make the code more compact:
- Use appropriate load/store helper functions from mem_neon.h.
- Remove variable forward declarations.
- Use != 0 instead of > 0 in loop termination tests.
- Remove excessive prefetches.

Change-Id: I114cf4d2a34f02acc130558d125d2c191c6c5992
2024-02-06 21:24:27 +00:00
Jonathan Wright 01edfb3df4 Refactor vpx_highbd_convolve8_vert_neon
Various bits of tidying up to make the code more compact:
- Use/create appropriate mem_neon.h load/store helper functions.
- Remove variable forward declarations.
- Use != 0 instead of > 0 in loop termination tests.
- Remove excessive prefetches.

Change-Id: Ida7d3c4a3fe084600417f196baa26501c6e2d45a
2024-02-06 21:24:27 +00:00
Jonathan Wright de7883604f Init using 0-vector instead of load-broadcast in mem_neon.h
Initialise result vectors of mem_neon.h helpers with vdup_n_<type>(0)
instead of load-broadcast of the first loaded elements. The former is
more easily optimized by modern compilers.

Change-Id: If967e2bb55523670c3e433dd66d060665e13b4f2
2024-02-05 21:40:36 +00:00
Jonathan Wright a7a853c3a2 Remove stride width == 4 tests in mem_neon.h helpers
This condition is only ever true in unit tests. It does not benefit
real usage scenarios.

Change-Id: I0c1b09b0b371cfe99ba1e26aba57740a67434070
2024-02-05 21:40:36 +00:00
Jonathan Wright 4084250ccd Align intermediate buffers for 2D Neon convolutions
Align the intermediate buffers to 32 bytes and always use a stride of
64, regardless of the actual data block width.

Change-Id: I738eaa711168bc8231d8ac54d9e5e5e87b62e703
2024-02-05 21:40:36 +00:00
Zoltan Kuscsik c6a8fa27b7 Added documentation on PGO for optimization analysis
tools/README.pgo.md: documentation added

Bug: webm:1835
Change-Id: Iad72ca63fd143a1c36c7347f723578d11158e81b
2024-02-05 21:12:01 +00:00
Zoltan Kuscsik 7eec109a83 Add profile guided optimization support
Tested on x64/ARM64.

To generate a new profile
$ export CC=clang
$ export CXX=clang++
$ ./libvpx/configure --enable-encode_perf_tests --enable-profile

Using the profile:

$  make clean
$  llvm-profdata  merge  -o perf.profdata  default_xxx_0.profraw
$ ./libvpx/configure --use-profile=perf.profdata

Bug:webm:1835
Change-Id: I8ab53fef1f8e2cc98c3b0f5c0f50eece5466965d
2024-02-05 21:12:01 +00:00
Gerda Zsejke More 58fb0f1d27 Add SVE implementation of vp9_block_error_fp
Add SVE implementation of vp9_block_error_fp function. Add the
corresponding tests as well.

Change-Id: I81f4b11bd2f1d0b9f377553bb9298d735308da30
2024-02-05 21:09:18 +00:00
Gerda Zsejke More a9d91d7a0a Add SVE implementation of vp9_block_error function
Add SVE implementation of vp9_block_error function. Add the
corresponding tests as well.

Change-Id: Iebba73ee845855be939e120326e1005237230c2a
2024-02-05 21:09:18 +00:00
Gerda Zsejke More 075569f3a5 Add SVE implementation of vpx_sum_squares_2d_i16
Add SVE implementation of vpx_sum_squares_2d_i16 function. Add the
corresponding test as well.

Change-Id: If3b31c9882e2b7bed0106011efb0bb5522de7008
2024-02-05 21:09:18 +00:00
Jerome Jiang 1258773dc2 Ext rc: Remove max_frame_size from frame decision
Add rdmult to the frame decision as RC can return this information, and
we may want to use it in the future.

Bug: b/323234722
Change-Id: I8ddb7038073d89af1ef84932448b1abaf1937cee
2024-02-05 14:21:29 +00:00
Wan-Teh Chang a9bd789d24 Delete #if USE_PARTIAL_COPY code
The USE_PARTIAL_COPY macro was added in
https://chromium-review.googlesource.com/c/webm/libvpx/+/51505 and
the location of #if USE_PARTIAL_COPY was slightly adjusted in
https://chromium-review.googlesource.com/c/webm/libvpx/+/73600.

Delete the unused function vp9_copy_and_extend_frame_with_rect().

Change-Id: I160b312177ba2fabbea2638172af37f8144d60b1
2024-02-02 18:16:09 +00:00
James Zern fecaf72c30 vp9_scale_and_extend_frame_ssse3: fix uv width/height
Use uv_crop_(width|height). This fixes an issue with 1 to 2 scaling from
1x1 where the unrounded value would go to zero, resulting in a heap
overflow. This path is only executed when the library is built without
--enable-vp9-highbitdepth.

Bug: b:319964497
Change-Id: I9cb6632f864ec54c045608af86aede20657d6253
(cherry picked from commit 7ad5f4f695)
2024-02-02 01:35:18 +00:00
James Zern d10bdbcc40 encode_api_test,RandomPixelsVp8: fix stack overflow
Observed when built using Visual Studio 2019.

Move 720P image allocation to the heap.

Bug: webm:1831
Change-Id: I4e343af08d2f282618ad1b328a39d7dba5e79654
(cherry picked from commit 43e1c8bf10)
2024-02-02 01:35:04 +00:00
Marco Paniconi 4f94206a53 vp8: Fix to integer division by zero and overflow
This can happen in the setting of the frame
target size for delta frames, for non-CBR mode
(end_usage != USAGE_STREAM_FROM_SERVER) and with
temporal layers.

In calc_pframe_target_size(): the percent_high
(factor to adjust the target_size) may end up dividing
bits_off_target by total_byte_count. The total_byte_count
is define per layer for temporal layers, so it will be zero
for delta frames if the enhancement layer has never been
encoded before.

Since percent_high is capped to over_shoot_pct, the proposed
fix is to apply this cap if total_byte_count is zero.
Also this CL fixes a few integer overflow issues in setting
the layer target_bandwidth, the recale function, and in
setting target_bits_per_mb.

Unittest is added by Wan-Teh which triggers this issue.

Bug: chromium:1514684

Change-Id: I091158e720ece75d7ab9b7c4d18d30a5783102ab
(cherry picked from commit 43bd567950)
2024-02-02 01:34:49 +00:00
Marco Paniconi 9b913654e8 Fix to integer overflow in vp8 encodeframe.c
Unit test added.

Bug:webm:1831

Change-Id: Ib85f4f0fbdbebc0b49555f206a36376cea687df6
(cherry picked from commit 193b151195)
2024-02-02 01:34:23 +00:00
Wan-Teh Chang 105bc8ff18 Make encoder know frame size increase from config
Equivalent to the change to av1_change_config() in the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/182413.

Because we call alloc_compressor_data() only if
cm->mi_alloc_size < new_mi_size, this change won't cause
alloc_compressor_data() to be called unnecessarily, unlike the libaom
bug https://crbug.com/aomedia/3526.

Bug: b:317105128
Change-Id: I8a772a1d5c4766846641a6d541a6d861bf76c60f
(cherry picked from commit aef73b22cb)
2024-02-02 01:26:45 +00:00
Jonathan Wright c35f3e9e35 Cosmetic: Refactor Arm Neon i8mm convolution functions
Tweak some comments and remove forward declarations.

Change-Id: I6eb01621cee838f29981853ee1ef615947e05563
2024-02-02 00:24:06 +00:00
Jonathan Wright 224f2dc82a Refactor Arm Neon DotProd convolution functions
This change was intended to be cosmetic in that it tweaks some
comments, removes forward declarations and moves some constant
declarations into the kernels where they're used. However, it also
adds some performance for 8-tap vertical convolution paths as it
appears removing forward declarations also removes some false loop-
carried dependencies that the compiler wasn't able to figure out.

Change-Id: Ic58658b10fbe8378062920199819359d2df008de
2024-02-02 00:24:06 +00:00
Jerome Jiang 3b1039c822 Rewrite ext RC test
The updated test will validate the QP / frame type / ARF settings by the
rate controller and callbacks, making sure the callbacks are working as
expected.

Removed the old tests that verify the signals from the encoder, which
are not needed any more.

Change-Id: Ida3c484e2ac520f3e81358d7cbf7918abfdaca54
2024-02-01 12:29:35 -05:00
Jerome Jiang 9aefcb317a Ext RC: remove gop_info parameter
This is not used any more

Bug: b/323234722

Change-Id: I74bbed38a4a23f2aec8e05413754565e67437e9e
2024-01-31 21:08:07 -05:00
Jerome Jiang 91bc8ec56a vp9: Set VPX_FRAME_IS_INVISIBLE for no show frame
Detect if the frame is arf without parsing bitstream.

Change-Id: I3dd70369ef156508624c45591302b682b1785fa8
2024-01-31 21:07:07 -05:00
Jerome Jiang 861981b135 Allow external RC to control key frame
Disable some tests because they rely on vpx_rc_gop_info_t
which isn't populated when the callback is used for key frame

This parameter will be deleted / cleaned up in the follow-up.

Bug: b/323050877
Change-Id: If1c0476eac8d324c8d5a460bfc9afdb6d93aacdf
2024-01-31 22:17:06 +00:00
Jerome Jiang 56b67113d0 Move vp9_estimate_qp_gop to vp9_tpl_model.c
vp9_estimate_qp_gop is only used for TPL
Rename to vp9_estimate_tpl_qp_gop

Change-Id: I87246f72e90174bf3ba3bf8e1061f5f31edfddff
2024-01-30 19:49:31 -05:00
Jerome Jiang 8630b18323 Fix gf group index used in TPL pass for WebM RC
Change-Id: Ia781caf2de550015822ef5c954b36314ba8a2942
2024-01-30 23:19:00 +00:00
James Zern 7ad5f4f695 vp9_scale_and_extend_frame_ssse3: fix uv width/height
Use uv_crop_(width|height). This fixes an issue with 1 to 2 scaling from
1x1 where the unrounded value would go to zero, resulting in a heap
overflow. This path is only executed when the library is built without
--enable-vp9-highbitdepth.

Bug: b:319964497
Change-Id: I9cb6632f864ec54c045608af86aede20657d6253
2024-01-30 20:50:56 +00:00
James Zern ef09c2e1a4 vp9_encoder.c: make vp9_svc_twostage_scale static
Change-Id: Id7fa33df3f45e46968869ec15a6892c79aac263c
2024-01-30 20:50:33 +00:00
James Zern adac06ace7 vp9_scale_references: condense hbd #if
Change-Id: I6f1d85885b6bdced3925f86da0a60421a6058e91
2024-01-30 20:50:16 +00:00
Jonathan Wright 6cf6e1f082 Simplify Armv8.4 DotProd correction constant computation
Simplify the computation of the Armv8.4 DotProd convolution
correction constant. Summing 128 * filter_tap[0,7] is always the same
as 128 * 128 since the filter taps always sum to 128.

Change-Id: I227ba47ae47bed8304a695a2395bcc85f33c245c
2024-01-30 11:02:37 +00:00
Jonathan Wright fd6b80b153 Move Neon dotprod and i8mm convolution kernels into .c files
Move the convolution kernels using Armv8.4 dotprod and Armv8.6 i8mm
instructions into the respective .c files. These kernels are only used
in the respective .c files so it isn't useful for them to be declared
in a header.

This change also removes the need for feature-macro guarding - which
wasn't being done correctly for MSVC (since Microsoft's Arm
architecture feature macros are named differently to those defined by
GNU-compliant compilers.)

Bug: webm:1838
Change-Id: I495fca2a982c34978b6c9102f144bb9c45352a9a
2024-01-29 15:46:06 +00:00
Jonathan Wright 189c135d5d Merge Arm Neon dotprod and i8mm convolution files
Move the Arm Neon dotprod and i8mm 2D convolution functions into the
appropriate vpx_convolve8_neon_[dotprod|i8mm].c file. Only the
Armv7/Armv8.0 Neon files needed to be split in this way to allow
linking against a handwritten assembly implementation of the kernels
for Armv7 builds.

Change-Id: Ifc363556c3961aa78b9e53761537d4816c5b9964
2024-01-29 15:43:50 +00:00
James Zern 433577ae31 Update third_party/libwebm to commit affd7f4
This is one commit after the libwebm-1.0.0.31 tag:
affd7f4 In MakeUID(), call rand() under #ifdef _WIN32

Change-Id: I5979a8cd3b064d4f4f0dbeca9f84f6791e593b47
2024-01-27 03:02:10 +00:00
Marco Paniconi 2edd69749f Pass the aligned width/height in lookahead_push
Also use the crop_width/height for the setting
of larger_dimensions.

Change-Id: I6b3a3e49944b17f7b51f0705d7a95c2a43255f8c
2024-01-26 20:19:40 +00:00
Jonathan Wright fed0dfe965 Allow SVE variance functions to be called from Neon subpel var
Call indirect RTCD high bitdepth variance functions (instead of the
Neon functions) in the high bitdepth Neon subpel variance paths so
that faster SVE variance functions can be used on CPUs where SVE is
supported.

Change-Id: I04bdef235afac06f2100df0cbaccfb8caef41ac7
2024-01-26 00:16:50 +00:00
Gerda Zsejke More 33ef1caf2f Add SVE implementation of HBD get<w>x<h>var functions
Add SVE implementation of get<w>x<h>var functions for 8-, 10-, 12- bit
depth. Add the corresponding tests as well.

Change-Id: Id4feb8726a3eb0a963e3dd8932ee52374a67da48
2024-01-25 20:58:29 +00:00
Gerda Zsejke More 0e23256348 Enable HBDGetVariance test for different implementations
Enable HBDGetVariance test for Neon and SSE2 implementations.

Change-Id: I77dcf0243784e79b21d956f3899903e2e13a545a
2024-01-25 20:58:29 +00:00
Gerda Zsejke More c43ec846f3 Enable GetVariance test for different implementations
Enable GetVariance test for Neon, Neon Dotprod, SSE2, MSA, VSX
implementations.

Change-Id: Ia6f42af5ef99ad1bc6319cdb46e6bd164f7eea94
2024-01-25 20:58:29 +00:00
Gerda Zsejke More 95d0fcae01 Add unit tests for vpx_get<w>x<h>var functions
Add standard and high bitdepth unit tests for vpx_get<w>x<h>var
functions. Enable these unit tests for the C implementation.

Change-Id: I8716fd6a9718dab3eef218a8a60a1efd4c0e316c
2024-01-25 20:58:29 +00:00
Wan-Teh Chang 989c393b2b Initialize members in VP8/VP9RateControlRTC ctors
Fix Coverity defects CID 1568604 and CID 1568615 (Uninitialized pointer
field). Since the constructors are private and the Create() factory
methods set the cpi_ pointer field, these two Coverity defects are
harmless.

Define the constructors with "= default" instead of "{}".

Change-Id: Ie6b45fce66c23941a9a5c38ee0bccbc4b7d3a2a2
2024-01-24 14:04:24 -08:00
Gerda Zsejke More d84436d533 Add SVE implementation of HBD variance functions
Add SVE implementation of variance functions for 8-, 10-, 12- bit
depth. Add the corresponding tests as well.

Change-Id: I785d85760ad4346cbfbf0f842784b4945870afee
2024-01-22 22:57:55 +00:00
James Zern 0f6a274964 vp9_ratectrl.c: add missing include for INTER_LAYER_PRED_ON
clears a clang-tidy warning

Change-Id: Ie5b8825ef645658304252b0d0554cdefa3de26c2
2024-01-22 20:21:06 +00:00
James Zern 43e1c8bf10 encode_api_test,RandomPixelsVp8: fix stack overflow
Observed when built using Visual Studio 2019.

Move 720P image allocation to the heap.

Bug: webm:1831
Change-Id: I4e343af08d2f282618ad1b328a39d7dba5e79654
2024-01-22 18:04:03 +00:00
Wan-Teh Chang eeb1be7f23 Support VPX_IMG_FMT_NV12 in vpx_img_read/write
read_yuv_frame() supports VPX_IMG_FMT_NV12. Port its code to
vpx_img_read() and vpx_img_write().

The code in vp9/simple_encode.cc, including img_read(), doesn't support
VPX_IMG_FMT_NV12. Check before the vpx_img_alloc() calls and abort the
process if the image format is VPX_IMG_FMT_NV12.

Bug: chromium:1510090
Change-Id: Ie77e29c2c9ee7a01e6a59c8ad3cbcc769d9f2d4c
2024-01-19 11:48:46 -08:00
Wan-Teh Chang d3a946de8c Make img_alloc_helper() fail on VPX_IMG_FMT_NONE
If fmt is VPX_IMG_FMT_NONE, currently img_alloc_helper() allocates a
single plane because VPX_IMG_FMT_NONE (0) is not a planar format (the
VPX_IMG_FMT_PLANAR bit is not set in VPX_IMG_FMT_NONE).

Although this seems correct, the problem is that most of the code in
libvpx assumes planar formats and is likely to dereference a null
pointer when it uses img->planes[1]. Also, VPX_IMG_FMT_NONE isn't really
a valid image format. So it is safer to make img_alloc_helper() fail if
fmt is VPX_IMG_FMT_NONE.

Change-Id: I05b47f4b5eceb631a02384b2cce1c2f6fdca8673
2024-01-19 19:43:26 +00:00
James Zern db6a5c09ce README: remove library version
This often falls out of sync with the release and the version is already
contained in CHANGELOG.

Bug: webm:1833
Change-Id: Ieee6ca40249bf6e77037fbec30d87b109ca8fe21
2024-01-18 15:44:19 -08:00
Jerome Jiang 2dead7118a Merge tag 'v1.14.0'
Release v1.14.0 Venetian Duck

2024-01-18 v1.14.0 "Venetian Duck"

  This release drops support for old C compilers, such as Visual Studio 2012
  and older, that disallow mixing variable declarations and statements (a C99
  feature). It adds support for run-time CPU feature detection for Arm
  platforms, as well as support for darwin23 (macOS 14).

  - Upgrading:
    This release is ABI incompatible with the previous release.

    Various new features for rate control library for real-time: SVC parallel
    encoding, loopfilter level, support for frame dropping, and screen content.

    New callback function send_tpl_gop_stats for vp9 external rate control
    library, which can be used to transmit TPL stats for a group of pictures. A
    public header vpx_tpl.h is added for the definition of TPL stats used in
    this callback.

    libwebm is upgraded to libwebm-1.0.0.29-9-g1930e3c.

  - Enhancement:
    Improvements on Neon optimizations: VoD: 12-35% speed up for bitdepth 8,
    68%-151% speed up for high bitdepth.
    Improvements on AVX2 and SSE optimizations.
    Improvements on LSX optimizations for LoongArch.
    42-49% speedup on speed 0 VoD encoding.
    Android API level predicates.

  - Bug fixes:
    Fix to missing prototypes from the rtcd header.
    Fix to segfault when total size is enlarged but width is smaller.
    Fix to the build for arm64ec using MSVC.
    Fix to copy BLOCK_8X8's mi to PICK_MODE_CONTEXT::mic.
    Fix to -Wshadow warnings.
    Fix to heap overflow in vpx_get4x4sse_cs_neon.
    Fix to buffer overrun in highbd Neon subpel variance filters.
    Added bitexact encode test script.
    Fix to -Wl,-z,defs with Clang's sanitizers.
    Fix to decoder stability after error & continued decoding.
    Fix to mismatch of VP9 encode with NEON intrinsics with C only version.
    Fix to Arm64 MSVC compile vpx_highbd_fdct4x4_neon.
    Fix to fragments count before use.
    Fix to a case where target bandwidth is 0 for SVC.
    Fix mask in vp9_quantize_avx2,highbd_get_max_lane_eob.
    Fix to int overflow in vp9_calc_pframe_target_size_one_pass_cbr.
    Fix to integer overflow in vp8,ratectrl.c.
    Fix to interger overflow in vp9 svc.
    Fix to avg_frame_bandwidth overflow.
    Fix to per frame qp for temporal layers.
    Fix to unsigned integer overflow in sse computation.
    Fix to uninitialized mesh feature for BEST mode.
    Fix to overflow in highbd temporal_filter.
    Fix to unaligned loads w/w==4 in vpx_convolve_copy_neon.
    Skip arm64_neon.h workaround w/VS >= 2019.
    Fix to c vs avx mismatch of diamond_search_sad().
    Fix to c vs intrinsic mismatch of vpx_hadamard_32x32() function.
    Fix to a bug in vpx_hadamard_32x32_neon().
    Fix to Clang -Wunreachable-code-aggressive warnings.
    Fix to a bug in vpx_highbd_hadamard_32x32_neon().
    Fix to -Wunreachable-code in mfqe_partition.
    Force mode search on 64x64 if no mode is selected.
    Fix to ubsan failure caused by left shift of negative.
    Fix to integer overflow in calc_pframe_target_size.
    Fix to float-cast-overflow in vp8_change_config().
    Fix to a null ptr before use.
    Conditionally skip using inter frames in speed features.
    Remove invalid reference frames.
    Disable intra mode search speed features conditionally.
    Set nonrd keyframe under dynamic change of deadline for rtc.
    Fix to scaled reference offsets.
    Set skip_recode=0 in nonrd_pick_sb_modes.
    Fix to an edge case when downsizing to one.
    Fix to a bug in frame scaling.
    Fix to pred buffer stride.
    Fix to a bug in simple motion search.
    Update frame size in actual encoding.

Change-Id: I9c27fb2b917f9b80ed4bcc5cb3b4f87c56b62c2f
2024-01-18 12:33:56 -05:00
Gerda Zsejke More 71a5cb6e8a Add SVE implementation of HBD MSE functions
Add SVE implementation of MSE functions for 10-, 12- bit depth. Add
the corresponding tests as well.

An implementation was not added for 8 bit depth as the Neon DotProd
version is faster than the SVE implementation.

Change-Id: I0c5712ba2735a2879a0aa3a9a52980032fddc7a6
2024-01-17 21:38:54 +00:00
Marco Paniconi b95d175726 vp9-rtc: Fix to reset on scene change for temporal layers
Revert the part of the fix regarding temporal layers in:
https://chromium-review.googlesource.com/c/webm/libvpx/+/5191480

Keep it as it was for now until further testing.

Change-Id: If747aabf907ba93cc20bcc067d2ca8f7758a91dd
2024-01-17 18:33:32 +00:00
Gerda Zsejke More e001eeb5bc Enable Neon Dotprod impl for HBD MSE
Enable Neon Dotprod 8-bit high bitdepth implementation for MSE
function as it is now not called with bit depth 10 or 12.

Bug: webm:1819
Change-Id: I9d1d506401aa0523fba2d8ea4978dc00fdacbb95
2024-01-17 18:15:17 +00:00
Gerda Zsejke More 41e0655e5e Fix highbd_get_block_variance_fn input parameter
Instead of always calling highbd_get_block_variance_fn with bit depth
8 use the macroblock's bit depth.

Bug: webm:1819
Change-Id: Ib4b19703384e897ee9ffeef73a11a8af2d262558
2024-01-17 18:15:17 +00:00
Marco Paniconi 25f03e456f vp9-svc: Fix to sample encoder for mismatch check
Don't check for mismatch for superframes whose
top spatial layer resolution was dropped.

Change-Id: I0abef43a710f0fb52ba2490fc784e57cda9952a0
2024-01-16 19:49:06 +00:00
Marco Paniconi cc306fac74 vp9-svc: Fix to max-q on scene change for svc
For svc with no inter-layer prediction: reset
the RC and force max_qp on all spatial layers
on scene/slide changes. In the current code it was only
reset on current spatial layer because it was assumed
we can predict off lower spatial layer to avoid
prediction across scene change. But this does not apply
when inter-layer prediction is off on delta frames.

Also reset only up to current temporal layer.
Because of the hierarchical prediction structure
only the lower temporal layers need the RC to be reset.

This helps to reduce excessive frame drops for the
full_superframe_drop mode.

Change-Id: I76925681850b82aa7fff7f9b1c1a0a605cf3cf3b
2024-01-16 15:49:10 +00:00
Jerome Jiang 8aeb5848a5 Do not use TPL QP from RC for final encoding
Bug: b/316610379
Change-Id: Ie7c6f8be0132602155102a72a16b2ee94c1c3dbd
2024-01-12 21:26:42 +00:00
James Zern 0eecce72b2 vp9_quantize.c: add missing include for get_msb()
clears a clang-tidy warning

Change-Id: Iaf58775084e758246a8fe0a4828ae954ea95f5b1
2024-01-11 16:33:53 -08:00
James Zern 0a91e18eca vp8_datarate_test.cc: add missing include
for VPX_CODEC_USE_PSNR. This clears a clang-tidy warning. vpx_encoder.h
exports vpx_codec.h so it shouldn't be necessary.

Change-Id: I863b6f8689eeef59cd9eadf3cdc177247a0653f8
2024-01-11 16:30:21 -08:00
Marco Paniconi 43bd567950 vp8: Fix to integer division by zero and overflow
This can happen in the setting of the frame
target size for delta frames, for non-CBR mode
(end_usage != USAGE_STREAM_FROM_SERVER) and with
temporal layers.

In calc_pframe_target_size(): the percent_high
(factor to adjust the target_size) may end up dividing
bits_off_target by total_byte_count. The total_byte_count
is define per layer for temporal layers, so it will be zero
for delta frames if the enhancement layer has never been
encoded before.

Since percent_high is capped to over_shoot_pct, the proposed
fix is to apply this cap if total_byte_count is zero.
Also this CL fixes a few integer overflow issues in setting
the layer target_bandwidth, the recale function, and in
setting target_bits_per_mb.

Unittest is added by Wan-Teh which triggers this issue.

Bug: chromium:1514684

Change-Id: I091158e720ece75d7ab9b7c4d18d30a5783102ab
2024-01-11 23:05:47 +00:00
Gerda Zsejke More aeb4928c68 Add SVE 16-bit dot-product helper functions
Add header file containing helper functions to make use of SVE
dot-product intrinsics via the Neon-SVE bridge.

Change-Id: I6cd198f8202559672817cbc19f890db35c03d3ff
2024-01-11 19:26:52 +00:00
Salome Thirot 0801bfca3f Add -flax-vector-conversions=none to Clang builds
GCC already does not allow implicit vector type conversions by default,
add -flax-vector-conversions=none to Clang builds to have the same
behavior.

Change-Id: I9d1adb836377077cf48818c80fe71025e2d2bdc7
2024-01-11 18:26:28 +00:00
Zoltan Kuscsik e03c9d2a62 Update of get_files.py to support Python3.x
Change-Id: I92aeb2a060338bdfc0083602b837b99181a8421c
2024-01-11 18:25:39 +00:00
Gerda Zsejke More 6ea3b51ec2 Require Arm Neon-SVE bridge header for enabling SVE
Disable SVE feature if arm_neon_sve_bridge header is not supported
by the compiler.

Change-Id: I3f78be2dd95b37b8d51b9f1fceca1f9701535eca
2024-01-11 18:23:46 +00:00
Marco Paniconi 756b29a776 vp8: Fix to race issue for multi-thread with pnsr_calc
Added unitest which triggers the data race in the
bug below, when only C code is forced.

The data race is between the loopfilter and variance
computation from generate_psnr_packet calculation.
Proposed fix is to move the wait for loopfilter thread to
finish up before entering generate_psnr_packet().

Bug: b/266833179.

Change-Id: Id2871c53274be0f404e65601c9a5c98aaead0c72
2024-01-11 00:07:08 +00:00
Wan-Teh Chang aef73b22cb Make encoder know frame size increase from config
Equivalent to the change to av1_change_config() in the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/182413.

Because we call alloc_compressor_data() only if
cm->mi_alloc_size < new_mi_size, this change won't cause
alloc_compressor_data() to be called unnecessarily, unlike the libaom
bug https://crbug.com/aomedia/3526.

Bug: b:317105128
Change-Id: I8a772a1d5c4766846641a6d541a6d861bf76c60f
2024-01-10 21:42:45 +00:00
Wan-Teh Chang c5f8086709 Move VPX_TPL_ABI_VERSION to the ext RC ABI version
The VpxTpl* structs defined in vpx_tpl.h are only used by the external
rate control library. Add a VPX_TPL_ABI_VERSION component to
VPX_EXT_RATECTRL_ABI_VERSION and remove the VPX_TPL_ABI_VERSION
component from VPX_ENCODER_ABI_VERSION.

The current value of VPX_TPL_ABI_VERSION is 2. It is subtracted from
VPX_EXT_RATECTRL_ABI_VERSION and added to VPX_ENCODER_ABI_VERSION so
that the values of those two macros stay the same.

Add a note to explain why VPX_ENCODER_ABI_VERSION has a
VPX_EXT_RATECTRL_ABI_VERSION component.

Change-Id: I680b8522dc04328cd51df6de590fdec75ca88ae8
2024-01-09 21:18:26 +00:00
Jerome Jiang 602e2e8979 Fix a typo in changelog for v1.14.0
Bug: webm:1833
Change-Id: I8133f678cf4231f2d048c61e42622b883897712a
2024-01-09 16:12:22 -05:00
Hari Limaye 469150a922 configure: add -arch flag when targeting darwin23
Commit db83435 introduced support for configuring for *-darwin23-gcc.
However configuring for *-darwin23-gcc does not currently add the
`-arch` flag to CFLAGS/LDFLAGS, so correct this here.

Change-Id: Ieeda1a5039ad40590dfcdcc6ba615a1d1697d54d
2024-01-09 20:38:58 +00:00
Jerome Jiang 2b1f6859f6 Update version
Before release:
c-a=8, a=0, r=1 -> c=8, a=0, r=1

After release:
 - If the library source code has changed at all since the last
   update, then increment revision:
   c=8, a=0, r=r+1=2

 - If any interfaces have been added, removed, or changed since
   the last update, increment current, and set revision to 0:
   c=c+1=9, a=0, r=0

 - If any interfaces have been added since the last public release,
   then increment age:
   c=9, a=a+1=1, r=0

 - If any interfaces have been removed or changed since the last
   public release, then set age to 0:
   c=9, a=0, r=0 (VpxTpl* structure changes)

MAJOR=c-a=9
MINOR=a=0
PATCH=r=0

Bug: webm:1833
Change-Id: Id24c9a0ff415a6f625d17b6098cdd0baf27432e3
2024-01-09 09:18:35 -05:00
Jerome Jiang e32df98af5 Update changelog with vp9 ext rc
Bug: webm:1833
Change-Id: I7e6e1da7965f098c8b62c55a09619d0bf703b516
2024-01-04 15:23:38 -05:00
Jerome Jiang 3b3e8b5f29 vp9 ext rc: if->assert, more comment for TPL ctrl
Change if to assertion in vp9_extrc_get_encodeframe_decision

Clarify comment for VP9E_ENABLE_EXTERNAL_RC_TPL that
rc_type | VPX_RC_QP must be non zero for this control to work.

Change-Id: I2c54cf7eda1f0f12f4ff7ac929e8e6a1fdd2215d
2024-01-04 13:49:03 -05:00
Jerome Jiang 1474e3c729 Return error if TPL related interface isn't set
Bug: b/316610379
Change-Id: I391d9ef308a1c2d763b124e451ebb22a05060102
2024-01-03 11:11:41 -05:00
Jerome Jiang 22b17dc3fb Update changelog
Bug: webm:1833
Change-Id: I90ffd457cafe705a040f9a63b870da66c076076e
2024-01-02 16:05:38 -05:00
Jerome Jiang f6b7166a2b Clear some clang-tidy complaints
Change-Id: I749c0b2b97f26923fc5e1c1e46a1c017cf25823f
2024-01-02 15:08:06 -05:00
Jerome Jiang bd78034078 Add codec ctrl to control TPL by external RC
Bug: b/316610379
Change-Id: Ic18aad8da35436b3de81b9ddf9359407da522701
2024-01-02 15:24:00 +00:00
Matt Oliver 33ecc6cc5f project: Update for 1.13.1 merge. 2023-12-24 00:07:29 +11:00
Matt Oliver a5f55b5c6b Merge commit '10b9492dcf05b652e2e4b370e205bd605d421972' 2023-12-24 00:01:10 +11:00
Zoltan Kuscsik 655da33b89 Use get_lsb in vp9 and vp8 invert_quant functions
Performance optimization. get_msb utilizes
the compiler/platform specific last significant bit
operator.

Note: 32 bit unsigned assumed, like all get_msb implementations do.
Change-Id: Ib013ad24aa0ea845efeb52aacd448b067edf91da
2023-12-21 14:23:04 +01:00
Jerome Jiang b8b6b4d4cc Remove VP9E_GET_TPL_STATS
This is never used.
A callback in external rc func was added and used instead.

Change-Id: Iade6f361072f0c28af98904baf457d2f0e9ca904
(cherry picked from commit 41ced868a6)
2023-12-18 12:23:32 -05:00
Jerome Jiang 41ced868a6 Remove VP9E_GET_TPL_STATS
This is never used.
A callback in external rc func was added and used instead.

Change-Id: Iade6f361072f0c28af98904baf457d2f0e9ca904
2023-12-16 20:12:34 +00:00
Jerome Jiang d0e2c30aa4 Update AUTHORS and .mailmap
Bug: webm:1833
Change-Id: I4569b9dc1ec1c70458120bebc45b2c963796ed87
2023-12-14 23:52:30 +00:00
Hari Limaye 0c2314d82e configure: add -arch flag when targeting darwin23
Commit db83435 introduced support for configuring for *-darwin23-gcc.
However configuring for *-darwin23-gcc does not currently add the
`-arch` flag to CFLAGS/LDFLAGS, so correct this here.

Change-Id: Ieeda1a5039ad40590dfcdcc6ba615a1d1697d54d
2023-12-14 20:23:26 +00:00
Wan-Teh Chang df655cf4fb Clarify the comment for update_error_state()
Explain why the encoder init functions cannot call update_error_state().

In vp8/vp8_cx_iface.c, this comment should have been added in
https://chromium-review.googlesource.com/c/webm/libvpx/+/4506609.

Rewrite update_error_state() in vp8/vp8_cx_iface.c to look like the
versions in vp9/vp9_cx_iface.c and av1/av1_cx_iface.c (in libaom).

Change-Id: I3f153d67b8c549ca5ac8ea0cfbcaad4ae705c8e6
2023-12-13 20:46:29 +00:00
Wan-Teh Chang 4fe07a0c41 Return correct error after longjmp in vp8e_encode
After a longjmp() call in vp8e_encode(), call update_error_state() so
that we return the error code and error detail set by the
vpx_internal_error() call.

Change-Id: I1f2428eb1b1f61e46c02604e16a5d44dcf162479
2023-12-13 10:56:28 -08:00
Marco Paniconi 193b151195 Fix to integer overflow in vp8 encodeframe.c
Unit test added.

Bug:webm:1831

Change-Id: Ib85f4f0fbdbebc0b49555f206a36376cea687df6
2023-12-12 22:49:46 +00:00
Hari Limaye a75859c439 Remove redundant comment in convolve8_4_usdot
The function convolve8_4_usdot contains a comment relating to the
SDOT implementation of convolve8, which requires addition of a
correction constant to account for range clamp of the input values.

This is not performed in the i8mm USDOT implementation - so remove the
comment.

Also add some const qualifiers to function arguments.

Change-Id: I10aff560d20403897f708ee293bf873be9c35761
2023-12-12 20:21:38 +00:00
James Zern 7be2dadc76 README: update target list
Change-Id: I001179ce34b2bf2350dce5f0197b6be175ab1c37
(cherry picked from commit f9b7c85768)
2023-12-11 21:24:10 +00:00
Wan-Teh Chang 7e735cdf43 IWYU: include vp9_scale.h and vpx_codec.h
Fix the following clang-tidy misc-include-cleaner warnings:
vp9/encoder/vp9_encoder.c:
  no header providing "vp9_is_valid_scale" is directly included
  no header providing "VPX_CODEC_CORRUPT_FRAME" is directly included
vp9/vp9_cx_iface.c:
  no header providing "valid_ref_frame_size" is directly included

Change-Id: I20e846f5b14c42c72aaefec0718b4ae9c7eea44a
2023-12-09 00:15:40 +00:00
Wan-Teh Chang 3a88c0c204 Avoid dangling pointers in vp9_encode_free_mt_data
Set cpi->tile_thr_data and cpi->workers to NULL after freeing them.

Change-Id: I46fec5f08a6dd034c8d76828f4d546630442f216
2023-12-08 14:39:18 -08:00
Cheng Chen 6bb806b177 Update frame size in actual encoding
Issue explanation:
The unit test calls set_config function twice after encoding the
first frame.
The first call of set_config reduces frame width, but is still within
half of the first frame.
The second call reduces frame width even more, making is less than
half of the first frame, which according to the encoder logic,
there is no valid ref frames, and this frame should be set as a
forced keyframe. This leads to null pointer access in scale_factors
later.

Solution:
To make sure the correct detection of a forced key frame,
we need to update the frame width and height only when the actual
encoding is performed.

Bug: b/311985118

Change-Id: Ie2cd3b760d4a4b399845693d7421c4eb11a12775
(cherry picked from commit 1ed56a46b3)
2023-12-08 21:34:57 +00:00
Yunqing Wang 75d7727f58 Fix a bug in simple motion search
This change fixed a bug revealed by b/311294795.
In simple motion search, the reference buffer pointer needs to be
restored after the search. Otherwise, it causes problems while the
reference frame scaling happens. This CL fixes the bug.

Bug: b/311294795
Change-Id: I093722d5888de3cc6a6542de82a6ec9d601f897d
(cherry picked from commit 50ed636e49)
2023-12-08 19:29:46 +00:00
Jerome Jiang 36b2dec5ee Set pred buffer stride correctly
Bug: b/312875957
Change-Id: I2eb5ab86d5fe30079b3ed1cbdb8b45bb2dc72a1d
(cherry picked from commit 585798f756)
2023-12-08 19:29:46 +00:00
Bohan Li eba5ceb9d1 Improve test comments.
Change-Id: I42dddb946193e30cf07e39b43eaad051c5da479a
(cherry picked from commit 9ad598f249)
2023-12-08 02:12:17 +00:00
Marco Paniconi c884b2e60e Add unittest for issue b/314857577
Bug: b/314857577

Change-Id: I591036c1ad3362023686d395adb4783c51baa62d
(cherry picked from commit 12e928cb34)
2023-12-08 01:45:50 +00:00
Wan-Teh Chang 6fca4de48e Remove SSE code for 128x* blocks
The maximum block size is 64x64 in VP9.

Bug: webm:1819
Change-Id: If9802be9f81b51dbcdbc8a68d5afe48ca6d3d0e7
(cherry picked from commit c4c9208054)
2023-12-08 00:34:23 +00:00
Wan-Teh Chang 0d5811e4ef Use vpx_sse instead of vpx_mse to compute SSE
Use vpx_sse and vpx_highbd_sse instead of vpx_mse16x16 and
vpx_highbd_8_mse16x16 respectively to compute SSE for PSNR
calculations. This solves an issue whereby vpx_highbd_8_mse16x16
was being used to calculate SSE for 10- and 12-bit input.

This is a port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/175063
by Jonathan Wright <jonathan.wright@arm.com>.

Bug: webm:1819
Change-Id: I37e3ac72835e67ccb44ac89a4ed16df62c2169a7
(cherry picked from commit 7dfe343199)
2023-12-08 00:34:23 +00:00
James Zern c64a85d25a vp9_frame_scale.c,cosmetics: funnction -> function
Change-Id: I8ecbd52037ff096f5c84c834b193b0a34c55a8b7
(cherry picked from commit 2f258fdee1)
2023-12-07 20:45:55 +00:00
Jerome Jiang fa60c7d9c1 IWYU: include yv12config.h for YV12_BUFFER_CONFIG
Fix clang-tiday warning

Change-Id: Ic4d6739cb933a37168176f6b481afdfd2562acfc
2023-12-07 12:35:30 -05:00
Cheng Chen 1ed56a46b3 Update frame size in actual encoding
Issue explanation:
The unit test calls set_config function twice after encoding the
first frame.
The first call of set_config reduces frame width, but is still within
half of the first frame.
The second call reduces frame width even more, making is less than
half of the first frame, which according to the encoder logic,
there is no valid ref frames, and this frame should be set as a
forced keyframe. This leads to null pointer access in scale_factors
later.

Solution:
To make sure the correct detection of a forced key frame,
we need to update the frame width and height only when the actual
encoding is performed.

Bug: b/311985118

Change-Id: Ie2cd3b760d4a4b399845693d7421c4eb11a12775
2023-12-06 21:46:54 -08:00
Yunqing Wang 50ed636e49 Fix a bug in simple motion search
This change fixed a bug revealed by b/311294795.
In simple motion search, the reference buffer pointer needs to be
restored after the search. Otherwise, it causes problems while the
reference frame scaling happens. This CL fixes the bug.

Bug: b/311294795
Change-Id: I093722d5888de3cc6a6542de82a6ec9d601f897d
2023-12-06 16:50:33 -08:00
Wan-Teh Chang c3b821fd4a Add the needed Android API level predicates.
fseeko and ftello are available on Android only from API level 24. Add
the needed guards for these functions.

Suggested by Yifan Yang.

Change-Id: I3a6721d31e1d961ab10b434ea6e92959bd5a70ab
(cherry picked from commit bf07554183)
2023-12-06 18:57:20 -05:00
Jerome Jiang 585798f756 Set pred buffer stride correctly
Bug: b/312875957
Change-Id: I2eb5ab86d5fe30079b3ed1cbdb8b45bb2dc72a1d
2023-12-06 23:54:31 +00:00
Yunqing Wang ebca0ab6fa Fix a bug in frame scaling
This change fixed a corner case bug reealed by b/311394513.
During the frame scaling, vpx_highbd_convolve8() and vpx_scaled_2d()
requires both x_step_q4 and y_step_q4 are less than or equal to a
defined value. Otherwise, it needs to call vp9_scale_and_extend_
frame_nonnormative() that supports arbitrary scaling.

The fix was done in LBD and HBD funnctions.

Bug: b/311394513
Change-Id: Id0d34e7910ec98859030ef968ac19331488046d4
(cherry picked from commit 8bf3649d41)
2023-12-06 16:22:35 -05:00
Bohan Li ffd533161a Fix edge case when downsizing to one.
BUG: b/310329177
Change-Id: I2ebf4165adbc7351d6cc73554827812dedc4d362
(cherry picked from commit a9f1bfdb8e)
2023-12-06 16:22:24 -05:00
Angie Chiang 5d49fa1f01 Set skip_recode=0 in nonrd_pick_sb_modes
Need to set skip_recode properly so that
vp9_encode_block_intra() can work properly when it is
called by block_rd_txfm(). We can not skip "recode" because
it is still at the rd search stage.

Bug: b/310340241
Change-Id: I7d7600ef72addd341636549c2dad1868ad90e1cb
(cherry picked from commit f10481dc0a)
2023-12-06 16:22:10 -05:00
James Zern 2f258fdee1 vp9_frame_scale.c,cosmetics: funnction -> function
Change-Id: I8ecbd52037ff096f5c84c834b193b0a34c55a8b7
2023-12-06 20:45:12 +00:00
Wan-Teh Chang 476d02a2d2 Fix two clang-tidy misc-include-cleaner warnings
no header providing "CONFIG_VP9_HIGHBITDEPTH" is directly included
no header providing "VPX_BITS_8" is directly included

Change-Id: Ie6d78c79ab462501417f2b451bbe808a1fdce931
2023-12-06 19:17:08 +00:00
James Zern f9b7c85768 README: update target list
Change-Id: I001179ce34b2bf2350dce5f0197b6be175ab1c37
2023-12-06 19:11:27 +00:00
Bohan Li 6f1001a894 Fix scaled reference offsets.
Since the reference frame is already scaled, do not scale the offsets.

BUG: b/311489136, b/312656387
Change-Id: Ib346242e7ec8c4d3ed26668fa4094271218278ed
(cherry picked from commit 845a817c05)
2023-12-06 14:01:33 -05:00
Gerda Zsejke More a05cfd672d configure: Add darwin23 support
Add target arm64-darwin23-gcc, x86_64-darwin23-gcc for MacOS 14.

Change-Id: I6b68a6a61d51aaa78ec11a5055bb95ce77a81d9c
(cherry picked from commit db83435afb)
2023-12-06 13:57:50 -05:00
Wan-Teh Chang c4c9208054 Remove SSE code for 128x* blocks
The maximum block size is 64x64 in VP9.

Bug: webm:1819
Change-Id: If9802be9f81b51dbcdbc8a68d5afe48ca6d3d0e7
2023-12-05 14:29:37 -08:00
Wan-Teh Chang 7dfe343199 Use vpx_sse instead of vpx_mse to compute SSE
Use vpx_sse and vpx_highbd_sse instead of vpx_mse16x16 and
vpx_highbd_8_mse16x16 respectively to compute SSE for PSNR
calculations. This solves an issue whereby vpx_highbd_8_mse16x16
was being used to calculate SSE for 10- and 12-bit input.

This is a port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/175063
by Jonathan Wright <jonathan.wright@arm.com>.

Bug: webm:1819
Change-Id: I37e3ac72835e67ccb44ac89a4ed16df62c2169a7
2023-12-05 22:13:43 +00:00
Jerome Jiang 4c2435c33e Fix several clang-tidy complaints
Change-Id: I78721d6b7ed692ad9363b5cac4e3324a3136d5b6
2023-12-05 22:08:56 +00:00
Marco Paniconi 12e928cb34 Add unittest for issue b/314857577
Bug: b/314857577

Change-Id: I591036c1ad3362023686d395adb4783c51baa62d
2023-12-05 22:02:45 +00:00
Wan-Teh Chang 97184161d5 Add "IWYU pragma: export" to some public headers
vpx/vpx_integer.h is clearly intended as the facade header for the
Standard C Library headers <stddef.h>, <inttypes.h>, and <stdint.h>.

It is reasonable to expect that vpx/vpx_decoder.h and vpx/vpx_encoder.h
should provide the symbols from vpx/vpx_codec.h.

Change-Id: I220797e63b2efc3dd9e2ac197fe2f918bf80d247
2023-12-05 21:18:45 +00:00
Jerome Jiang 7cfc58de48 RTC RC: add screen content support for vp8
Bug: b/281463780
Change-Id: I446c00bf8d794aa9134e4fe37960dd8a465448a4
2023-12-05 19:53:38 +00:00
Yunqing Wang 8bf3649d41 Fix a bug in frame scaling
This change fixed a corner case bug reealed by b/311394513.
During the frame scaling, vpx_highbd_convolve8() and vpx_scaled_2d()
requires both x_step_q4 and y_step_q4 are less than or equal to a
defined value. Otherwise, it needs to call vp9_scale_and_extend_
frame_nonnormative() that supports arbitrary scaling.

The fix was done in LBD and HBD funnctions.

Bug: b/311394513
Change-Id: Id0d34e7910ec98859030ef968ac19331488046d4
2023-12-04 19:39:08 -08:00
Bohan Li 9ad598f249 Improve test comments.
Change-Id: I42dddb946193e30cf07e39b43eaad051c5da479a
2023-12-04 23:32:08 +00:00
Gerda Zsejke More db83435afb configure: Add darwin23 support
Add target arm64-darwin23-gcc, x86_64-darwin23-gcc for MacOS 14.

Change-Id: I6b68a6a61d51aaa78ec11a5055bb95ce77a81d9c
2023-12-04 21:22:35 +00:00
Angie Chiang f10481dc0a Set skip_recode=0 in nonrd_pick_sb_modes
Need to set skip_recode properly so that
vp9_encode_block_intra() can work properly when it is
called by block_rd_txfm(). We can not skip "recode" because
it is still at the rd search stage.

Bug: b/310340241
Change-Id: I7d7600ef72addd341636549c2dad1868ad90e1cb
2023-12-02 07:18:11 +00:00
Wan-Teh Chang 5dcb4c1740 Define VPX_DL_* macros as unsigned long constants
Define the VPX_DL_REALTIME, VPX_DL_GOOD_QUALITY, and VPX_DL_BEST_QUALITY
macros as unsigned long, because the deadline parameter of
vpx_codec_encode() is of the unsigned long type. This enables C++
templates to deduce the unsigned long type from these macros.

Change-Id: I2173e3bbf5e15c84c11843790df93a497a35ed7d
2023-12-02 02:28:57 +00:00
Wan-Teh Chang bf07554183 Add the needed Android API level predicates.
fseeko and ftello are available on Android only from API level 24. Add
the needed guards for these functions.

Suggested by Yifan Yang.

Change-Id: I3a6721d31e1d961ab10b434ea6e92959bd5a70ab
2023-12-02 02:13:32 +00:00
Wan-Teh Chang 378af160ff Merge "Document vpx_codec_decode() ignores deadline param" into main 2023-12-01 23:09:06 +00:00
Wan-Teh Chang 478df94cd2 Merge "Define vpx_enc_deadline_t type for encode deadline" into main 2023-12-01 22:57:58 +00:00
Bohan Li a9f1bfdb8e Fix edge case when downsizing to one.
BUG: b/310329177
Change-Id: I2ebf4165adbc7351d6cc73554827812dedc4d362
2023-12-01 13:44:56 -08:00
Wan-Teh Chang 967c59b190 Merge "Fix scaled reference offsets." into main 2023-12-01 21:40:42 +00:00
James Zern d5ec829489 Merge "CHANGELOG: add CVE for issue #1642" into main 2023-12-01 21:39:31 +00:00
James Zern a88e7d869f Merge changes Ic2c3cb30,I027eaf2d,I455e5a94,I8f7633d9,I5116d10d, ... into main
* changes:
  Specialise Armv8.0 Neon horiz convolution for 4-tap filters
  Specialise Armv8.0 Neon vert convolution for 4-tap filters
  Specialise Armv8.6 Neon 2D horiz convolution for 4-tap filters
  Specialise Armv8.6 Neon horiz convolution for 4-tap filters
  Specialise Armv8.4 Neon 2D horiz convolution for 4-tap filters
  Specialise Armv8.4 Neon horiz convolution for 4-tap filters
  Specialise Armv8.6 Neon vert convolution for 4-tap filters
  Specialise Armv8.4 Neon vert convolution for 4-tap filters
  Make reporting of filter sizes more granular
  Delete redundant code in Neon SDOT/USDOT vertical convolutions
2023-12-01 21:38:51 +00:00
James Zern 5cad6fdc92 CHANGELOG: add CVE for issue #1642
CVE-2023-6349 was reserved for this issue. It's not yet published.

Bug: webm:1642, b:302710624
Change-Id: Iaab2a0bcae449a45e35678f5c049413fe0a4d2a4
2023-12-01 13:10:58 -08:00
Wan-Teh Chang 070d7e5cf3 Document vpx_codec_decode() ignores deadline param
The changes in this CL show that both the VP8 and VP9 implementations of
the decode function eventually discard the deadline parameter. Change
the code to ignore the deadline parameter in vpx_codec_decode() without
passing it to the decode function, and document that the deadline
parameter is ignored and 0 should be passed.

Change-Id: Ia977e16cdbdf97901207aa2d749887980137c4c0
2023-12-01 09:55:23 -08:00
Bohan Li 845a817c05 Fix scaled reference offsets.
Since the reference frame is already scaled, do not scale the offsets.

BUG: b/311489136, b/312656387
Change-Id: Ib346242e7ec8c4d3ed26668fa4094271218278ed
2023-12-01 09:52:59 -08:00
Wan-Teh Chang 4e29b9638d Merge "Add a test for b/312517065" into main 2023-12-01 02:18:21 +00:00
Jonathan Wright d144e6e95d Specialise Armv8.0 Neon horiz convolution for 4-tap filters
Add an Armv8.0 MLA Neon implementation of horizontal convolution
specialised for executing with 4-tap filters (the most common filter
size for settings --good --cpu-used=1.) This new path is also used
when executing with bilinear (2-tap) filters.

Change-Id: Ic2c3cb307b95964cd0ba86f1c42eece3a8ab7cf4
2023-12-01 00:20:00 +00:00
Wan-Teh Chang 15c2a9a02f Add a test for b/312517065
Bug: b/312517065
Change-Id: I6b5529a8e034fb0468f110e420fafb4944a19d0f
2023-11-30 16:10:04 -08:00
Jonathan Wright a33ac12dc0 Specialise Armv8.0 Neon vert convolution for 4-tap filters
Add an Armv8.0 MLA Neon implementation of vertical convolution
specialised for executing with 4-tap filters (the most common filter
size for settings --good --cpu-used=1.) This new path is also used
when executing with bilinear (2-tap) filters.

Change-Id: I027eaf2d1bb9711c2217cc8aa6b1e379d3e66b26
2023-11-30 12:00:00 +00:00
Wan-Teh Chang b027590c30 Define vpx_enc_deadline_t type for encode deadline
The deadline parameter of vpx_codec_encode() is of the unsigned long
type. The cpplint runtime/int check and the clang-tidy
google-runtime-int warn about the use of the unsigned long type. Adding
a type alias works around this issue.

Note: vpx_codec_decode() also has a deadline parameter, but it is of the
long type. So unfortuntely this type alias cannot be simply named
vpx_codec_deadline_t and the name must suggest it is encoder-specific.

Change-Id: I27b6b25730b620b328422ec3f91e63fdc55b377a
2023-11-29 17:36:24 -08:00
James Zern 97a0d139ce psnr.h,cosmetics: fix a typo (PNSR -> PSNR)
Change-Id: I2adea9f150852c106acc57e5aeeac571d6bd15fb
2023-11-29 16:47:34 -08:00
Jerome Jiang 2f3d3726b2 Merge "vp9 rc: support screen content" into main 2023-11-29 23:52:13 +00:00
Jerome Jiang fe5dc9f7fc vp9 rc: support screen content
Bug: b/281463780
Change-Id: I23668550257b28031bdca0537459f93ec63f1e2e
2023-11-29 17:38:38 -05:00
Wan-Teh Chang 57b72fe807 Add VP9Encoder class to simplify fuzz test cases
Bug: b:306422625
Change-Id: I8344cb7fb4e1aee87d46f683746517cdcddf5c5d
2023-11-29 14:22:10 -08:00
Wan-Teh Chang 73e38df5d5 Merge "Adding "const" to vpx_codec_iface_t is redundant" into main 2023-11-29 20:04:24 +00:00
Hirokazu Honda 2faf9c3e0e Merge "ratectrl_rtc: Remove duplicated DropFrameReason enum class" into main 2023-11-29 01:32:21 +00:00
Wan-Teh Chang 59a3b791fb Merge "Add vpx_sse and vpx_highbd_sse" into main 2023-11-28 18:39:49 +00:00
Marco Paniconi 77b4614b2f Merge "rtc: Set nonrd keyframe under dynamic change of deadline" into main 2023-11-28 17:24:48 +00:00
Marco Paniconi adebf364cb rtc: Set nonrd keyframe under dynamic change of deadline
For realtime mode: if the deadline mode (good/best/realtime)
is changed on the fly (via codec_encode() call), force a
key frame and set the speed feature nonrd_keyframe = 1 to
avoid entering the rd pickmode.

nonrd_pickmode=0/off is the only feature in realtime mode that
involves rd pickmode, so by forcing it on/1 we can cleanly
separate nonrd (realtime) from rd (good/best), so we can
avoid possible issues on this dynamic mode switch, such as in
bug listed below.

Dynamic change of deadline, in particular for realtime mode,
involves a lot of coding/speed feature changes, so best to
also force reset with keyframe.

Added unitest that triggers the issue in the bug.
Bug: b/310663186

Change-Id: Idf8fd7c9ee54b301968184be5481ee9faa06468d
2023-11-27 20:08:57 -08:00
Wan-Teh Chang 72a57ebe48 Merge "Tests kf_max_dist in one-pass zero-lag encoding" into main 2023-11-27 23:54:04 +00:00
Marco Paniconi d7358ed53a Unitest for issue: b/310477034
Fix is made here:
https://chromium-review.googlesource.com/c/webm/libvpx/+/5055827

Bug: b/310477034
Change-Id: Id1cc7a6a95e1ea5d1a022f36d7971915c9918339
2023-11-27 09:35:10 -08:00
Jonathan Wright cc89450a48 Specialise Armv8.6 Neon 2D horiz convolution for 4-tap filters
Add an Armv8.6 USDOT Neon path for the horizontal portion of 2D
convolution, specialised for executing with 4-tap filters (the most
common filter size for settings --good --cpu-used=1.) This new path
is also used when executing with bilinear (2-tap) filters.

Change-Id: I455e5a94bdcea1358025bd8e4d4c8c62e373aa5d
2023-11-27 16:44:02 +00:00
Jonathan Wright 0dc67ecf54 Specialise Armv8.6 Neon horiz convolution for 4-tap filters
Add an Armv8.6 USDOT Neon implementation of horizontal convolution
specialised for executing with 4-tap filters (the most common filter
size for settings --good --cpu-used=1.) This new path is also used
when executing with bilinear (2-tap) filters.

Change-Id: I8f7633d9852ebfe8feb9b4a055715f849cccf297
2023-11-27 16:43:56 +00:00
Jonathan Wright 9cdb688919 Specialise Armv8.4 Neon 2D horiz convolution for 4-tap filters
Add an Armv8.4 SDOT Neon path for the horizontal portion of 2D
convolution, specialised for executing with 4-tap filters (the most
common filter size for settings --good --cpu-used=1.) This new path
is also used when executing with bilinear (2-tap) filters.

Change-Id: I5116d10ddb371ac2cf302ef905d06f2140dc7600
2023-11-27 16:43:21 +00:00
Jonathan Wright 68ef57f997 Specialise Armv8.4 Neon horiz convolution for 4-tap filters
Add an Armv8.4 SDOT Neon implementation of horizontal convolution
specialised for executing with 4-tap filters (the most common filter
size for settings --good --cpu-used=1.) This new path is also used
when executing with bilinear (2-tap) filters.

Change-Id: Ib396681b3f7b8b0eeba94381fbe33a06cf7b4a13
2023-11-27 16:43:15 +00:00
Jonathan Wright 2f8e94715d Specialise Armv8.6 Neon vert convolution for 4-tap filters
Add an Armv8.6 USDOT Neon implementation of vertical convolution
specialised for executing with 4-tap filters (the most common filter
size for settings --good --cpu-used=1.) This new path is also used
when executing with bilinear (2-tap) filters.

Change-Id: Ic893b25541e3317c5d5c270c338f868f080aed7c
2023-11-27 16:38:20 +00:00
Jonathan Wright bdc9e1c9d4 Specialise Armv8.4 Neon vert convolution for 4-tap filters
Add an Armv8.4 SDOT Neon implementation of vertical convolution
specialised for executing with 4-tap filters (the most common filter
size for settings --good --cpu-used=1.) This new path is also used
when executing with bilinear (2-tap) filters.

Change-Id: I3eb00b5a34f5676b68bda60a2a29be56e3d7d0cd
2023-11-27 16:37:56 +00:00
Jonathan Wright 1b3ec0676c Make reporting of filter sizes more granular
vpx_get_filter_taps() currently reports either 8-tap or 2-tap.
However, many 8-tap filters are actually 0-padded, resulting in a
lot of redundant work (multiplying by, and adding, 0) when processing
using an 8-tap convolution function. In preparation for adding 2- and
4-tap SIMD implementations for the convolution paths, make the filter
size reporting more granular, stripping any 0 padding. Filter sizes
can now be reported as 2-, 4-, 6- or 8-tap.

Change-Id: I100133aac7173134af34b918c9ad3007d98d6060
2023-11-23 15:11:11 +00:00
Jonathan Wright 9b729500d5 Delete redundant code in Neon SDOT/USDOT vertical convolutions
Delete redundant transpose/permute code in the Neon dot-product
vertical convolution paths. Variable values were assigned but never
used before subsequent assignment.

Change-Id: I15b29d0c993f56599e0d18ac1d5787e6385d2a3a
2023-11-23 13:58:42 +00:00
Wan-Teh Chang 366425079b Tests kf_max_dist in one-pass zero-lag encoding
The test shows that the comment for kf_max_dist in vpx/vpx_encoder.h
differs from its behavior by one. We should modify the comment to match
the encoding behavior.

Bug: webm:1829
Change-Id: Icdc58b8f6b25353f10ce8ecc481c862bd3fe86df
2023-11-22 17:50:42 -08:00
Jingning Han 3bd54a37d0 Disable intra mode search speed features conditionally
When all the inter reference frames are invalid, disable the speed
features that bypass intra mode search.

BUG=b/312517065

Change-Id: I246c953fad3be61b9d307da11c752a21a36b90ff
2023-11-22 15:38:27 -08:00
Wan-Teh Chang 635eba3319 Adding "const" to vpx_codec_iface_t is redundant
vpx_codec_iface_t is defined as follows:

  typedef const struct vpx_codec_iface vpx_codec_iface_t;

Since vpx_codec_iface_t is already a const struct, it is redundant to
add "const" to vpx_codec_iface_t.

Note: I think vpx_codec_iface_t should not have been defined as a const
struct, but it is too late to change that now.

Change-Id: Ifbd3f8a63c1d48e9169ff77fa0b505ea1e65519d
2023-11-22 15:38:04 -08:00
Jingning Han b562fdd4e6 Remove invalid reference frames
Remove the reference frames whose scaling factor is not in the
supported range.

BUG=b/312517065

Change-Id: Iaf8610ff7a95cd4a433bf529f741459d820d4f8b
2023-11-22 15:07:04 -08:00
Jingning Han 79257fd459 Conditionally skip using inter frames in speed features
When the reference frame's scaling factor is not in the supported
range, skip using it for motion compensation prediction in the
partition speed features.

BUG=b/312517065

Change-Id: Ie3687186521ad2616be258e80d3e5b16e5f2d5e9
2023-11-22 15:06:29 -08:00
Jerome Jiang 741b8f6228 Check null ptr before use
prev_mi is a pointer to pointer

Bug: b/310401647
Bug: b/310590556
Change-Id: Ic3c39a7eec14693357bd2485a5451d4b7f031b5e
2023-11-21 16:33:50 -05:00
Hirokazu Honda 56c78a68b0 ratectrl_rtc: Remove duplicated DropFrameReason enum class
DropFrameReason is declared in two places. This moves it
to the common place.

Change-Id: I04c16db4a49135588edff7e1746dcf9172750bb9
2023-11-21 17:10:48 +09:00
James Zern b067e73e4b Merge "vp8_dx_iface.c: add include for MAX_PARTITIONS" into main 2023-11-21 02:21:20 +00:00
Wan-Teh Chang a8db542b24 Add vpx_sse and vpx_highbd_sse
The code is ported from libaom's aom_sse and aom_highbd_sse at
commit 1e20d2da96515524864b21010dbe23809cff2e9b.

The vpx_sse and vpx_highbd_sse functions will be used by vpx_dsp/psnr.c.

Bug: webm:1819
Change-Id: I4fbffa9000ab92755de5387b1ddd4370cb7020f7
2023-11-20 14:59:27 -08:00
James Zern 1231fce45e vp8_dx_iface.c: add include for MAX_PARTITIONS
fixes clang-tidy warning:
no header providing "MAX_PARTITIONS" is directly included

Change-Id: Iba7a9d95df7f5bdee76e7975df764cd71461fc93
2023-11-20 11:55:49 -08:00
James Zern 9f8776ff4a vp8_ratectrl_rtc.h: fix a few typos
is -> if
returns -> computes

in the documentation for ComputeQP().

This is the same as:
9142314c2 ratectrl_rtc.h: fix a few typos

+ remove a duplicate, commented out, version of GetLoopfilterLevel()

Change-Id: I8832e628b63b0b7dac6236631072f36ad55d90e8
2023-11-20 11:49:14 -08:00
James Zern 9142314c2c ratectrl_rtc.h: fix a few typos
is -> if
returns -> computes

in the documentation for ComputeQP().

Change-Id: If70706736b0dc2ae56e45e2489dc208c61fd557a
2023-11-15 18:55:04 -08:00
Marco Paniconi 81aaa7f04b rtc: Add frame dropper to VP8 external RC
Move some internal drop_frame code to separate
function so the external RC can use.
And add new flag setting under VP8E_SET_RTC_EXTERNAL_RATECTRL
to disable vp8_drop_encodedframe_overshoot() for
testing the external RC.

Unittest added for single layer and 3 temporal layers.

Bug: b/280363228

Change-Id: Ibea2f627cc54e7156ff35259a64dd111d42d146c
2023-11-14 12:06:17 -08:00
Wan-Teh Chang b7d847d0e7 Merge "Delete -Wdeclaration-after-statement" into main 2023-11-11 02:29:46 +00:00
Wan-Teh Chang e4127f591d Document how VP9 treats a negative speed value
Change-Id: I12948b08a7bb5beb5024b8676de9dafc239f8e89
2023-11-10 13:14:18 -08:00
Wan-Teh Chang d15a1970c1 Delete -Wdeclaration-after-statement
Older versions of MSVC do not allow declarations after statements in C
files. We don't need to support those versions of MSVC now.

Use -std=gnu99 instead of -std=gnu89.

Change-Id: I76ba962f5a2bca30d6a5b2b05c5786507398ad32
2023-11-09 19:23:24 -08:00
Wan-Teh Chang f05122d35c Fix ClangTidy warnings
Most are related to include-what-you-use. One is to avoid using the
unsigned long type explicitly (by passing VPX_DL_REALTIME directly to
vpx_codec_encode).

Change-Id: Ieaf3418382ad8516cb4b172f7678893286fcb8cf
2023-11-09 18:35:51 -08:00
Wan-Teh Chang 97833b61ee Merge "Declare oxcf arg of vp8_create_compressor as const" into main 2023-11-10 01:40:17 +00:00
Wan-Teh Chang ef3eb01269 Merge "Fix float-cast-overflow in vp8_change_config()" into main 2023-11-09 23:10:35 +00:00
Wan-Teh Chang 296784c83a Declare oxcf arg of vp8_create_compressor as const
Declare the oxcf parameters of vp8_create_compressor() and init_config()
as const. This helps code analysis.

Change-Id: I344ef3e6afc3adced2b2865b7e0057c6d4b1d3c0
2023-11-09 12:42:58 -08:00
Wan-Teh Chang 4e05c38c85 Document the units of VP8 target_bandwidth/bitrate
Change-Id: I6298a0acb4ef546ae198bb1f16dea50ed34b2dae
2023-11-09 12:38:05 -08:00
Wan-Teh Chang 7ab673a9f6 Fix float-cast-overflow in vp8_change_config()
Bug: b:309716574
Change-Id: I9c523d5e9211f895c7497a9e3674b55f6be6c742
2023-11-09 12:01:13 -08:00
Wan-Teh Chang 8a35c7e585 Merge "Use symbolic constant VPX_CBR instead of 1" into main 2023-11-08 02:40:28 +00:00
Wan-Teh Chang c732fa7070 Use symbolic constant VPX_CBR instead of 1
Change-Id: Idae94cfc6d7a882691deeb4fa3ce0015f80ed937
2023-11-07 15:47:43 -08:00
Jerome Jiang 11b98025c3 Merge "Check fragments count before use" into main 2023-11-07 15:26:52 +00:00
James Zern 5b8d24f678 configure: detect PIE and enable PIC
Fixes the creation of DT_TEXTREL entries in binaries built with PIE
enabled:
  /usr/bin/ld: warning: creating DT_TEXTREL in a PIE

This matches the changes made in libaom:
1df26009da aom_configure: only override CONFIG_PIC if not set on cmd line
7235e65746 aom_configure.cmake: detect PIE and set CONFIG_PIC

Change-Id: I0a43e964af2d8eb8c5e7811ce14ad39285eec3a8
2023-11-06 15:17:19 -08:00
Jerome Jiang 879c9bd906 Check fragments count before use
Bug: webm:1827
Change-Id: I8d603d5db92476222cbee1c61fece957ad03a49f
2023-11-03 16:24:46 -04:00
Yunqing Wang f08d238867 Merge "Modify C vs SIMD test script" into main 2023-11-03 16:11:24 +00:00
Anupam Pandey 1464d7738a Modify C vs SIMD test script
- Enable C vs SIMD test for x86 32-bit platform
- Correct a print message in run_tests()

BUG=webm:1800

Change-Id: Ib1ccd3a87a64b5ec6cde524a14d5d1b7e200abfb
2023-11-03 18:26:33 +05:30
Yunqing Wang 54fc6a7558 Merge "Add an emms instruction to vpx_subtract_block" into main 2023-11-02 03:39:59 +00:00
Marco Paniconi 0d3ef6ffd2 vp9-RC: Add drop_frame support to external RC
Supports single layer and svc. For svc only the
framedrop_mode = FULL_SUPERFRAME_DROP is allowed
for now.

Dropping frames due to overshoot is enabled by the
oxcf->drop_frames_water_mark, which is zero as default.
Note that this CL also allows for drop/skip encoding of
enhancement layers if that layer bitrate is zero.

max_consec_drop is also added, set to INT_MAX as default.
Note that max_consec_drop is only used for svc mode.
It has not been added yet for single layer in libvpx encoder.

Tests added for single layer and svc case.

Change-Id: Ic12f6a0eb3fbf07d8eb8456c46cec27b2e1930d3
2023-10-31 09:34:42 -07:00
James Zern cab1f4b9b2 Merge "calc_pframe_target_size: fix integer overflow" into main 2023-10-30 19:20:46 +00:00
James Zern 7b51f50205 Merge "Fix 'unused variable' warning when neon_i8mm is disabled" into main 2023-10-30 19:20:18 +00:00
Jonathan Wright 3f3576098f Fix 'unused variable' warning when neon_i8mm is disabled
Guard hwcap2 feature interrogation on HAVE_NEON_I8MM so that it gets
disabled if neon_i8mm is disabled when configuring the build.

Bug: webm:1825
Change-Id: Ic6ff71f17387b96219591928a583d43560bb7c7a
2023-10-30 15:53:18 +00:00
Xiahong Bao 61c927a4ed calc_pframe_target_size: fix integer overflow
The intermediate value in the target bandwidth
calculation may exceed integer bounds.

Bug: 308007926

Change-Id: I8288c5820db06a550d88bf91fccc86106996deaa
Signed-off-by: Xiahong Bao <xiahong.bao@nxp.com>
2023-10-30 11:17:17 +09:00
Marco Paniconi b759032a0e Clear some clang-tidy complaints on header includes
Change-Id: Id6f54dc4643172f6a5576dc4846c47c8eda31c0f
2023-10-27 10:02:46 -07:00
Jonathan Wright 6457f06529 Add Arm SVE build flags and run-time CPU feature detection
Add 'sve' arch options to the configure, build and unit test files -
adding appropriate conditional options where necessary. Arm SIMD
extensions are treated as supersets in libvpx, so disable SVE if
either Neon DotProd or I8MM are unavailable.

Change-Id: I39dd24f2b209251084d1e28d7ac68099460309bb
2023-10-24 10:42:06 +01:00
Jerome Jiang 974c14578c Merge "Reduce memory usage of test with large frame size" into main 2023-10-20 21:14:18 +00:00
Jerome Jiang 352f9f64df Reduce memory usage of test with large frame size
- Use smaller frame size that still triggers the overflow
 - Do not run encoder as the encoder init also triggers the overflow

Bug: chromium:1492864
Change-Id: I392549abf69f1cfb3754cc847a214513ec9bedc5
2023-10-20 15:40:43 -04:00
Wan-Teh Chang 9004ace978 Also test VPX_ARCH_AARCH64 for 64-bit platforms
Change-Id: Ic11ccd791ff78801e0aba1d12ad2d99b9941ce9d
2023-10-19 18:28:48 -07:00
Jerome Jiang 424723dc02 Run bitrate overflow test only on 64bit systems
Frame size caps the target bitrate internally, so the frame size needs
to be large enough to reproduce the target bitrate overflow in the
fuzzing test.

However the frame size needed exceeds the max buffer allowed on 32bit
system defined by VPX_MAX_ALLOCABLE_MEMORY

Bug: chromium:1492864

Change-Id: Ia3a9a78cd35516373897039a7769b492e29e8450
2023-10-19 11:36:47 -04:00
Jerome Jiang e4db6c3aac Cap avg_frame_bandwidth at INT_MAX
avg_frame_bandwidth = target_bandwidth / framerate

If target_bandwidth is too big and/or framerate is too small (< 1),
avg_frame_bandwidth could be overflow

Bug: chromium:1492864
Change-Id: I32314da1414b472ae4bf2acdcd81b8a948286146
2023-10-17 17:06:28 -04:00
Jerome Jiang 0129e64a65 Fix ubsan failure caused by left shift of negative
Bug: b/305642441
Change-Id: Iddb1572c284161140da48f61b04cf600e5b57ecc
2023-10-16 11:22:48 -04:00
Jerome Jiang 2ab7ba8251 Force mode search on 64x64 if no mode is selected
A speed feature disable_split_mask (set to 63) could cause no mode and
partition to be selected in rd_pick_partition because:

-> thresh_mult_sub8x8 all INT_MAX
-> All modes skipped for sub8x8 blocks
-> found_best_rd is 0 -> break from the loop of 4 sub blocks
-> sum_rdc is INT_MAX -> No rd update -> should_encode_sb is 0
-> Propagating to top of the tree
-> No partition / mode is selected

Bug: b/290499385
Change-Id: Ia655e262f3b32445347ae0aaf1a2d868cea997f3
2023-10-13 20:28:21 -04:00
Wan-Teh Chang 9c377eafbe Handle Arm/AArch64 runtime feature detection
Port the following libaom CLs to libvpx:
https://aomedia-review.googlesource.com/c/aom/+/178361
https://aomedia-review.googlesource.com/c/aom/+/180701
https://aomedia-review.googlesource.com/c/aom/+/181821

The tests themselves are not feature-gated in the same way that they are
used in the rest of the codebase since they are not controlled by
rtcd.pl. This means that tests that assume the existence of features not
present on the target can cause SIGILL to be thrown.

This commit extends init_vpx_test.cc to match the behaviour for other
targets and automatically disable testing for features that are not
available on the machine running the tests.

Call arm_cpu_caps() and x86_simd_caps() inside #if !CONFIG_SHARED.
All the SIMD-specialized functions (arm or x86) are internal functions,
so they are not exported from the libvpx shared library. If
CONFIG_SHARED is 1, it is not necessary to call arm_cpu_caps(),
x86_simd_caps(), and append_negative_gtest_filter() either.

Change-Id: I330631816bdb52842020c5aa2a1ad802865cc285
2023-10-10 09:27:20 -07:00
Wan-Teh Chang 7c31749387 Declare some "VP8_CONFIG *oxcf" params as const
Change-Id: Ia5e8445098e18da5978aacf17281f16252413f17
2023-10-07 07:23:11 -07:00
Wan-Teh Chang 8cb4544c21 VP8: allow thread count changes
Fix the TODO(https://crbug.com/1486441) comment in vp8/vp8_cx_iface.c.

Make vp8cx_create_encoder_threads() work after it has been called
before. If there are already the exact number of threads it needs to
create, return immediately. Otherwise, shut down the existing threads
(by calling vp8cx_remove_encoder_threads()) and create the required
number of threads.

Call vp8cx_create_encoder_threads() in vp8e_set_config() to respond to
changes in g_threads or g_w (which also affects the number of threads
through cm->mb_cols and cpi->mt_sync_range).

Change-Id: I552eeca5b1f1f5313f59559eb1da396f270a2429
2023-10-06 10:40:14 -07:00
Wan-Teh Chang c23da380a3 VP8: Allocate cpi->mt_current_mb_col array lazily
Add the mt_current_mb_col_size field to VP8_COMP to record the size of
the mt_current_mb_col array.

Move the allocation of the mt_current_mb_col array from
vp8_alloc_compressor_data() to vp8_encode_frame(), where the use of
mt_current_mb_col starts. Allocate mt_current_mb_col right before use
if mt_current_mb_col hasn't been allocated or if the current size is
incorrect.

Move the deallocation of the mt_current_mb_col array from
dealloc_compressor_data() to vp8cx_remove_encoder_threads().

Move the TODO(https://crbug.com/1486441) comment from
vp8/encoder/onyx_if.c to vp8/vp8_cx_iface.c.

Change-Id: Ic5a0793278c2cc94876669aaa0dd732412876673
2023-10-04 13:05:18 -07:00
Wan-Teh Chang 874bcaa164 Merge "Clean up vp8cx_create/remove_encoder_threads()" into main 2023-10-04 19:50:20 +00:00
Jerome Jiang 25a9a8e35a Merge "Use correct include guards for init_vpx_test.h" into main 2023-10-04 13:42:09 +00:00
Anupam Pandey 41caf8fef5 Add an emms instruction to vpx_subtract_block
This CL adds an `emms` instruction at the end of the MMX assembly
for the vpx_subtract_block function, to properly clear the register
state. This resolves a mismatch between x86 build and C only build.

BUG=webm:1816

Change-Id: I79d2947da7f587f3558a2ae17df214d2faf59e74
2023-10-04 11:13:05 +05:30
James Zern 448c5e8684 Merge "vp9_encoder: normalize sizeof() calls" into main 2023-10-04 04:42:16 +00:00
Wan-Teh Chang a1d4b56208 Merge "Declare cur_row inside #if CONFIG_MULTITHREAD" into main 2023-10-04 03:50:39 +00:00
Wan-Teh Chang d7c7383298 Merge "Have vp9_enc_build and vp9_enc_test restore cwd" into main 2023-10-04 03:21:50 +00:00
Wan-Teh Chang 450dfa908b Merge "Fix a potential resource leak and add alloc checks" into main 2023-10-04 03:20:27 +00:00
Wan-Teh Chang ea67878f8c Clean up vp8cx_create/remove_encoder_threads()
Make vp8cx_create_encoder_threads() undo everything cleanly before
returning an error.

Make vp8cx_remove_encoder_threads() reset pointer fields to NULL after
freeing them, reset encoding_thread_count to 0, and reset b_lpf_running
to 0 (false). This makes it safe to call vp8cx_create_encoder_threads()
after calling vp8cx_remove_encoder_threads().

Change-Id: I586f06ce3d5b1c88ca46884bb4d6667ffc97e440
2023-10-03 20:08:18 -07:00
Wan-Teh Chang f67f9ce346 Declare cur_row inside #if CONFIG_MULTITHREAD
Fix the following compiler warning when libvpx is configured with
the --disable-multithread option:

  vp9/common/vp9_thread_common.c:391:7: warning:
  variable 'cur_row' set but not used [-Wunused-but-set-variable]
    int cur_row;
        ^

Change-Id: I53aa279152715083df40990eb7fdcaeb77a66777
2023-10-03 19:16:36 -07:00
Jerome Jiang f73026c2cc Use correct include guards for init_vpx_test.h
Bug: b/303112617
Change-Id: Ie18df33b2bcab91c18e920825f4ed3a29e18373b
2023-10-03 22:00:02 -04:00
Jerome Jiang 5b6ceba996 Include vpx_config.h for macros
Clear some clang-tidy complaints

Change-Id: I6690428d336c81709befd19a33e11c1367275df3
2023-10-03 14:26:50 -04:00
Jerome Jiang 0a3e2b4ca1 Factor out common code used in test binaries
Bug: b/303112617
Change-Id: Icbe16e95ff334a9578a692cc51b4773393ad0005
2023-10-03 14:26:44 -04:00
Wan-Teh Chang b729684b05 Use big cfg.g_w in ConfigResizeChangeThreadCount
vp8cx_create_encoder_threads() caps the thread count at
(cm->mb_cols / cpi->mt_sync_range) - 1. If cfg.g_w is 16, cm->mb_cols is
only 1 (see vp8_alloc_frame_buffers: mb_cols = width >> 4), so we won't
be using multiple threads. To reproduce bug chromium:1486441, the test
just needs to increase cfg.g_h sufficiently.

Bug: chromium:1486441
Change-Id: Ie6b2da2e31cfa1717a481f55eebc8c875db94d87
2023-10-02 13:55:16 -07:00
James Zern 95cb5eae70 Merge "Merge tag 'v1.13.1'" into main 2023-10-02 19:11:51 +00:00
Wan-Teh Chang b863d8bb47 Have vp9_enc_build and vp9_enc_test restore cwd
Use $PWD to get the current directory.

Quote directory pathnames.

Suggested by James Zern.

Bug: webm:1800
Change-Id: I51e922b24da0e89d936370f858eab55d193ebdcb
2023-09-30 10:32:49 -07:00
Wan-Teh Chang 6512f994da Disable vpx_highbd_8_mse16x16_neon_dotprod, etc.
These functions assume the uint16_t samples are <= 255 (bit depth 8),
but vpx_highbd_8_mse16x16() is called for any bit depth, not just 8.

A better fix is to port the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/175063 to libvpx, but
that requires porting aom_sse() and aom_highbd_sse() to libvpx, which is
quite involved. So disable vpx_highbd_8_mse16x16_neon_dotprod, etc.
first.

Bug: webm:1819
Change-Id: If495a5dedc58d9981317b9993c9fbb81ff3ab50c
2023-09-29 16:58:26 -07:00
James Zern 1672f4db71 Merge tag 'v1.13.1'
libvpx 1.13.1

2023-09-29 v1.13.1 "Ugly Duckling"
  This release contains two security related fixes. One each for VP8 and VP9.

  - Upgrading:
    This release is ABI compatible with the previous release.

  - Bug fixes:
    https://crbug.com/1486441 (CVE-2023-5217)
    Fix to a crash related to VP9 encoding (#1642)

* tag 'v1.13.1':
  update CHANGELOG
  update version to 1.13.1
  Fix bug with smaller width bigger size
  vp9_alloccommon: clear allocation sizes on free
  VP8: disallow thread count changes
  encode_api_test: add ConfigResizeChangeThreadCount
  README: update release version to 1.13.0

Bug: webm:1818
Change-Id: I732e2423f635d4115890f00fd63f9886e31f39a6
2023-09-29 16:36:46 -07:00
James Zern ec9e1ed41f vp9_encoder: normalize sizeof() calls
use sizeof(var) instead of sizeof(type) and sizeof(*var) instead of
sizeof(var[0]) for consistency in some places.

Change-Id: Ibd9a783cfef5ce1d06131df3831a4093821a502f
2023-09-29 15:17:37 -07:00
Wan-Teh Chang 7f568f9876 Fix a potential resource leak and add alloc checks
Backport fixes from libaom:
https://aomedia-review.googlesource.com/c/aom/+/109061
https://aomedia-review.googlesource.com/c/aom/+/158102

Change-Id: Ia9d42d474be2898f9ae2fdc28606273377da3e90
2023-09-29 15:08:28 -07:00
James Zern 10b9492dcf update CHANGELOG
Bug: webm:1818
Change-Id: Ic0a943b5d1c69a3621ad3f91012fb5308a0c11f1
2023-09-29 15:06:14 -07:00
James Zern 490a7067e8 update version to 1.13.1
SO_VERSION_MAJOR = 8
SO_VERSION_MINOR = 0
SO_VERSION_PATCH = 1

The increase of the patch number corresponds to the revision number in
the libtool text.

3. If the library source code has changed at all since the last update,
then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).

Bug: webm:1818
Change-Id: Ia114368e9fd7a908e7fcf6e4d3142f142770e3f4
2023-09-29 13:13:47 -07:00
Jerome Jiang df9fd9d5b7 Fix bug with smaller width bigger size
Fixed previous patch that clusterfuzz failed on.

Local fuzzing passing overnight.

Bug: webm:1642
Change-Id: If0e08e72abd2e042efe4dcfac21e4cc51afdfdb9
(cherry picked from commit 263682c9a2)
2023-09-29 13:13:47 -07:00
James Zern a53700e4a3 vp9_alloccommon: clear allocation sizes on free
This fixes reallocations (and avoids potential crashes) if any
allocations fails and the application continues to call
vpx_codec_decode().

Found with vpx_dec_fuzzer_vp9 & Nallocfuzz
(https://github.com/catenacyber/nallocfuzz).

Bug: webm:1807
Change-Id: If5dc96b73c02efc94ec84c25eb50d10ad6b645a6
(cherry picked from commit 02ab555e99)
2023-09-29 13:13:47 -07:00
Wan-Teh Chang 4697b110ac Update 32-bit version of horizontal_add_uint32x2
The code was originally added in
https://aomedia-review.googlesource.com/c/aom/+/162267
by Jonathan Wright.

Change-Id: Iafd9e31d82abe22387e0d68f02c7ab81e85367ed
2023-09-29 10:35:20 -07:00
Cheng Chen fd2052d4c9 Properly determine end of sequence
When the next frame is null and the current frame is an overlay
frame, which is equivalent to there is an active alt ref frame,
we call this an end of sequence.

Change-Id: I49c2cf7a001df98aff8b62ba034317e408274bd4
2023-09-28 18:36:21 -07:00
Wan-Teh Chang a9998b53c2 Merge "vp9_c_vs_simd_encode: Restore cwd at end of test" into main 2023-09-28 17:52:22 +00:00
Jerome Jiang 18bc7ffea7 Merge "Fix bug with smaller width bigger size" into main 2023-09-28 17:39:23 +00:00
Wan-Teh Chang e462a0de03 vp9_c_vs_simd_encode: Restore cwd at end of test
Restore the original current directory at the end of
vp9_c_vs_simd_enc_test().

Bug: webm:1800
Change-Id: Iad64848a231e3c900149cc2b248055b02dda80a6
2023-09-28 09:03:40 -07:00
Wan-Teh Chang 58a854fb27 Skip the y4m_360p_10bit_input clip for armv8
It is a known mismatch.

Bug: webm:1819
Change-Id: Ieb707a6f53ddf6c7b0d1202c6520599d3e45da76
2023-09-27 16:12:12 -07:00
Yunqing Wang 8e63202fb3 Merge "Modify vp9_c_vs_simd_enc_test script" into main 2023-09-27 20:33:39 +00:00
Jerome Jiang 263682c9a2 Fix bug with smaller width bigger size
Fixed previous patch that clusterfuzz failed on.

Bug: webm:1642
Change-Id: If0e08e72abd2e042efe4dcfac21e4cc51afdfdb9
2023-09-27 11:21:11 -04:00
James Zern baed121877 VP8: disallow thread count changes
Currently allocations are done at encoder creation time. Going from
threaded to non-threaded would cause a crash.

Bug: chromium:1486441
Change-Id: Ie301c2a70847dff2f0daae408fbef1e4d42e73d4
(cherry picked from commit 3fbd1dca6a)
2023-09-26 18:42:50 -07:00
James Zern 452199ca85 encode_api_test: add ConfigResizeChangeThreadCount
Update thread counts and resolution to ensure allocations are updated
correctly. VP8 is disabled to avoid a crash.

Bug: chromium:1486441
Change-Id: Ie89776d9818d27dc351eff298a44c699e850761b
(cherry picked from commit af6dedd715)
2023-09-26 18:41:50 -07:00
Yunqing Wang 61f868bcf7 Modify vp9_c_vs_simd_enc_test script
Applied James' change to the script. Enabled the test:
vp9_c_vs_simd_enc_test

BUG=webm:1800

Change-Id: If1e33e5ccb6ca9315004f3e3f5b910f8a8255317
2023-09-26 14:12:14 -07:00
James Zern 3fbd1dca6a VP8: disallow thread count changes
Currently allocations are done at encoder creation time. Going from
threaded to non-threaded would cause a crash.

Bug: chromium:1486441
Change-Id: Ie301c2a70847dff2f0daae408fbef1e4d42e73d4
2023-09-25 19:33:07 -07:00
James Zern af6dedd715 encode_api_test: add ConfigResizeChangeThreadCount
Update thread counts and resolution to ensure allocations are updated
correctly. VP8 is disabled to avoid a crash.

Bug: chromium:1486441
Change-Id: Ie89776d9818d27dc351eff298a44c699e850761b
2023-09-25 19:28:08 -07:00
Jerome Jiang 67bfb41ed8 Do not call WebM RC for new GOP at the end of seq
define_gf_group is called at the last frame of each GOP to get GOP size
for next one, which means it'll also be called at the last GOP of the
sequence, when calling WebM RC will be returned with error since WebM RC
does not have any more GOP to return.

When gop_coding_frames from the encoder is 1, it means it's running out
of firstpass stats, which means end of sequence.

Bug: b/299610956
Change-Id: I30e077a28fe41593ebabbc1dc0c2915a4bcbece3
2023-09-21 18:10:27 -04:00
Martin Storsjo ad3301e6a3 aarch64: Generalize Windows cpu detection to any Windows variant
This cpu detection implementation doesn't do anything MSVC specific,
it just calls the IsProcessorFeaturePresent function. This can be
compiled with mingw compilers just as well.

Change-Id: I55e607a47c8f5b70d9f707ef96b2fa7553f2f79f
2023-09-18 11:56:51 -07:00
Jerome Jiang 8f8e741468 Add max/min_gf_interval to vpx_rc_config_t
Bug: b/300499738
Change-Id: Id32cb5e3ce667539c0d1efe1ff5fcc7a49e35329
2023-09-14 16:04:19 -04:00
Jerome Jiang 8e61b3cd1b Fix ref frame buffer in TPL stats for RC
The original ref frame index was the index in the GF group; RC expects
the index to be the one for ref frame buffer.

Change-Id: I9a2b0e72b6332023fb2e8da131b557f82db02e39
2023-09-14 13:27:39 -04:00
Jerome Jiang 9c2e33ff74 Set frame width height for 1st TPL GOP frame
Change-Id: Ic92dfd232bf90e8cbe6c6233af523ed40d12097a
2023-09-14 11:59:57 -04:00
yuanhecai eb232b662a loongarch: Fix bugs from vp8_sixtap_predict4x4/16x16_lsx
Bug: webm:1755

Change-Id: I7295e0f9a1551b8a418d5b65a2b7351df1fdc063
2023-09-13 10:06:23 +08:00
yuanhecai 391bb5604b loongarch: simplify vpx_quantize_b/b_32x32_lsx args
Bug: webm:1755

Change-Id: I42fdb1c34f959dd1204b343b8192e3d9b49821b4
2023-09-13 10:05:34 +08:00
Jerome Jiang d549cb74b9 Add missing headers for clang-tidy warnings
Change-Id: I97edec8ecffdcc79b8f3528deb60a3a0332ea0cc
2023-09-12 15:28:06 -04:00
Jonathan Wright 1a1f50a89d Use run-time feature detection for Neon DotProd HBD MSE
Arm Neon DotProd implementations of vpx_highbd_8_mse<w>x<h> currently
need to be enabled at compile time since they're guarded by #ifdef
feature macros. Now that run-time feature detection has been enabled
for Arm platforms, expose these implementations with distinct
*neon_dotprod names in a separate file and wire them up to the build
system and rtcd.pl. Also add new test cases for the new functions.

Change-Id: I26be6fb587258c8fa9fbf03509b7602358a001a8
2023-09-03 23:04:50 +01:00
Jonathan Wright 15d6215716 Use run-time feature detection for Neon DotProd specialty var.
Enable Arm Neon DotProd implementations of vpx_get_var_sse_sum*
specialty variance functions via run-time feature detection, wiring
up the new *neon_dotprod names to rtcd.pl. Also add new test cases.

Change-Id: I04ac3db87d32ee7f94702b6c0360254e5688f713
2023-09-03 23:04:49 +01:00
Jonathan Wright ad4f28abaa Use run-time feature detection for Neon DotProd variance
Arm Neon DotProd implementations of vpx_variance<w>x<h> currently
need to be enabled at compile time since they're guarded by #ifdef
feature macros. Now that run-time feature detection has been enabled
for Arm platforms, expose these implementations with distinct
*neon_dotprod names in a separate file and wire them up to the build
system and rtcd.pl. Also add new test cases for the new functions.

Remove the _neon suffix in functions making reference to
vpx_variance<w>x<h>_neon() (e.g. sub-pixel variance) - enabling use
of the appropriate *neon or *neon_dotprod version at run time.

Similar changes for the specialty variance and MSE functions will be
made in a subsequent commit.

Change-Id: I69a0ef0d622ecb2d15bd90b4ace53273a32ed22d
2023-09-03 23:04:49 +01:00
Jonathan Wright 7009fe55a9 Use run-time CPU feature detection for Neon DotProd SAD4D
Arm Neon DotProd implementations of vpx_sad*4d currently need to be
enabled at compile time since they're guarded by ifdef feature
macros. Now that run-time feature detection has been enabled for Arm
platforms, expose these implementations with distinct *neon_dotprod
names in separate files and wire them up to the build system and
rtcd.pl. Also add new test cases for the new DotProd functions.

Change-Id: Ie99ee0b03ec488626f52c3f13e4111fe26cc5619
2023-09-03 23:04:49 +01:00
Jonathan Wright 02dc617f8c Use run-time CPU feature detection for Neon DotProd SAD
Arm Neon DotProd implementations of vpx_sad* currently need to be
enabled at compile time since they're guarded by ifdef feature
macros. Now that run-time feature detection has been enabled for Arm
platforms, expose these implementations with distinct *neon_dotprod
names in separate files and wire them up to the build system and
rtcd.pl. Also add new test cases for the new DotProd functions.

Change-Id: Ic6906c28240276ba89787eadbc9393a232374f95
2023-09-03 23:04:41 +01:00
Jonathan Wright 91158c99f7 Use run-time CPU feature detection for vpx_convolve8_neon
Arm Neon DotProd and I8MM implementations of vpx_convolve8* currently
need to be enabled at compile time since they're guarded by ifdef
feature macros. Now that run-time feature detection has been enabled
for Arm platforms, expose these implementations with distinct
*neon_dotprod/*neon_i8mm names in separate files and wire them up to
the build system and rtcd.pl. Also add new test cases for the new
DotProd and I8MM functions.

Change-Id: I3db3cd62e8596099d9fec7805ca3ee86b2a01c74
2023-09-03 20:43:06 +01:00
Jonathan Wright 148d1085f7 Refactor and extend run-time CPU feature detection on Arm
1) Overhaul the Arm CPU feature detection code, taking inspiration
   from similar recent changes in libaom.
2) Add neon_dotprod and neon_i8mm arch options in the configure,
   build and unit test files, adding appropriate conditional options
   where necessary.
3) Soft-enable run-time CPU feature detection by default for both 32-
   bit and 64-bit Arm platforms.

Change-Id: I3f13317d88324acc5753394351188baa8d18a261
2023-09-01 20:25:17 +01:00
Jonathan Wright 7ee16bc178 Simplify Neon MSE helper function params/return values
Simplify the parameters and return values of the Neon MSE helper
functions for both standard and high bitdepth - avoiding unused
return values.

Change-Id: I6f9208f9ce890fbe58346d9c7d9d701f28f2f90f
2023-08-31 14:21:01 +01:00
Marco Paniconi 6da1bd01d6 vp9 svc: fix interger overflow
Overflow was happening in two places:
one in set_encoder_config(), where the input
layer_target_bitrates are converted from kbps to bps,
the other in vp9_calc_pframe_target_size_one_pass_vbr(),
where target is scaled by kf_ratio.

vp9_ratectrl.c:2039: runtime error: signed integer overflow:
-137438983 * 25 cannot be represented in type 'int'

Bug: chromium:1475943

Change-Id: I1ab0980862548c8827fae461df9a7a74425209ff
2023-08-29 11:35:12 -07:00
Jerome Jiang e052ada780 Do not call ext rc functions when they're null
Change-Id: Ie78afadd4ad5845e42bd4d5412703369f8d5e0f5
2023-08-25 10:56:23 -04:00
James Zern 24c0dcc851 Merge "vp9_calc_pframe_target_size_one_pass_cbr: fix int overflow" into main 2023-08-21 22:46:42 +00:00
James Zern 99a4462b8d Merge "vp8,ratectrl.c: fix integer overflow" into main 2023-08-21 22:46:25 +00:00
James Zern b124b05dcb Merge "fdct4x4_neon: fix compile w/cl" into main 2023-08-21 19:05:49 +00:00
Jerome Jiang ade6905e39 vp9 ext rc: copy under/overshoot% for all RC modes
Bug: b/295507002
Change-Id: Ie4b302b82fa2d83e0be450cea60c59907b37f954
2023-08-21 10:05:15 -04:00
James Zern c7aa75ac55 vp9_calc_pframe_target_size_one_pass_cbr: fix int overflow
vp9/encoder/vp9_ratectrl.c:2171:23: runtime error: signed integer
overflow: 103079280 * -22 cannot be represented in type 'int'

Bug: chromium:1473268
Change-Id: Ic1de7d48e74d94c2a992e53ec4382b5b44dba7af
2023-08-18 14:04:33 -07:00
James Zern 80b1b5a7e9 vp8,ratectrl.c: fix integer overflow
in calc_iframe_target_size():
vp8/encoder/ratectrl.c:349:31: runtime error: signed integer overflow:
38 * 343597280 cannot be represented in type 'int'

Bug: chromium:1473473
Change-Id: Ie8f7b147efb27c92314df09837b66f7d97046883
2023-08-18 12:36:45 -07:00
James Zern 401d8f36be vp9_cx_iface: fix code compatibility
Remove '= {}' (C23 [1]) and use memset to clear a vpx_rc_config_t
instance.

after:
6e2c3b9b3 Add RC mode to vpx external RC interface

Fixes compile with -pedantic and Microsoft's cl compiler.

[1] https://en.cppreference.com/w/c/language/initialization

Change-Id: I2019cdf0c42103cfc80b1e58c68b7596e497007f
2023-08-18 09:10:00 -07:00
Jerome Jiang d3188cab65 Merge "vp9 ext rc: Assign over/undershoot % for CQ mode" into main 2023-08-17 17:47:50 +00:00
Jerome Jiang 87a467f356 vp9 ext rc: Assign over/undershoot % for CQ mode
Bug: b/295507002
Change-Id: Ie5b4dabc620f6d17c4039f186e0709d8e9479b47
2023-08-17 12:34:48 -04:00
Jerome Jiang e7bfd8b6c2 Merge "Extend ext RC mode to have CQ mode" into main 2023-08-17 15:11:48 +00:00
Jerome Jiang 4b1ac3c23f Extend ext RC mode to have CQ mode
Also do not return error if it's not specified.

Bug: b/295507002
Change-Id: Ib1f83551272bdde1bceff03554abc4c02d95ca09
2023-08-16 16:05:01 -04:00
James Zern bbf36c8839 Merge "tools_common,die_codec(): output to stderr" into main 2023-08-16 19:41:23 +00:00
James Zern 58eed626d8 tools_common,die_codec(): output to stderr
This function is used to report a failure, messages of this type should
go to stderr.

Change-Id: I0dee246dddc886a3278b247a770a356446658864
2023-08-16 11:15:55 -07:00
Jerome Jiang 6e2c3b9b3c Add RC mode to vpx external RC interface
Bug: b/295507002
Change-Id: Id2dd21482828ec64eef9abdf6a1cca83100d21ba
2023-08-15 16:11:43 -04:00
James Zern 8d2c357eab fdct4x4_neon: fix compile w/cl
Use an array for constant initialization rather than array syntax which
assumes the underlying type is a vector. Fixes compile error with
cl targeting Windows Arm64:

vpx_dsp\arm\fdct4x4_neon.c(55,52): error C2078: too many initializers

No change in assembly with gcc 12.2.0 & clang 14.

Bug: b/277255390
Bug: webm:1810
Fixed: webm:1810

Change-Id: Ia30edcdbb45067dfe865b9958a5eecf1fd9ddfc8
2023-08-11 15:52:26 -07:00
James Zern 335728c987 *quantize*.c: fix visual studio warnings
after:
22818907d normalize *const in rtcd

fixes warnings of the form:
vpx_dsp\x86\quantize_avx.c(145): warning C4028: formal parameter 2
different from declaration

Change-Id: I4dc423f11ec4a9171e18bdb6be2fa8dfb65ee61a
2023-08-11 13:42:49 -07:00
Jonathan Wright c8610c266c Fix bug and re-enable vpx_int_pro_row/col_neon
Fix a bug in vpx_int_pro_row_neon (increment pointer after peeled
first loop iteration) and re-enable both vpx_int_pro_row/col_neon
paths.

Also fix IntProRowTest to use width_ (instead of 0) as the src_stride
for the input data block. The test's use of 0 for src_stride is the
reason the tests passed with the buggy Neon implementation noted in
the listed bugs. (The old buggy Neon implementation fails the
adjusted unit tests.)

BUG=webm:1800
BUG=webm:1809

Change-Id: I1f4572ee155653a7596fe2c10b5938ea7a3f63ae
2023-08-11 00:08:56 +01:00
Yunqing Wang 67961dc5f7 Merge "Enable arm test in c vs SIMD bit-exactness test" into main 2023-08-08 20:32:52 +00:00
Yunqing Wang 32a4ecc3cf Merge "Disable vpx_int_pro_row/col neon SIMD functions" into main 2023-08-08 20:32:41 +00:00
Yunqing Wang 685715b698 Enable arm test in c vs SIMD bit-exactness test
Arm SIMD testing was enabled in c vs SIMD bit-exactness test after
arm SIMD mismatch was resolved.

BUG=webm:1800

Change-Id: Id60127313a0955f4a5c8468281fd5a441668fddb
2023-08-07 22:06:58 +00:00
Yunqing Wang 6e5fc00001 Disable vpx_int_pro_row/col neon SIMD functions
The vpx_int_pro_row/col neon SIMD version caused a mismatch between
neon encoding vs c encoding. Disabled them for now to ensure the
correctness of VP9 encoding on the arm platform. Since these 2
functions were not used much, so this wouldn't affect the overall
encoder speed much.

BUG=webm:1800
BUG=webm:1809

Change-Id: Id1a7d542fc03d4cf9fa1039a49832abf35fb722f
2023-08-07 15:04:43 -07:00
Jerome Jiang 242c743170 VP9 RC: Add pixel row/col of a TPL block
Bug: b/294049605
Change-Id: I383a88a037a2a48a5fc1b9def6f991278c3665a8
2023-08-07 16:42:43 -04:00
Jerome Jiang d4b6132d2b Fix more clang-tidy warnings
- Include vpx/vpx_ext_ratectrl.h in vp9_ext_ratectrl.c
 - Include vpx/internal/vpx_codec_internal.h
 - Include <stddef.h> for NULL

Bug: b/294049605
Change-Id: Iedd8b3864da27fde1678bfa6606e6fc5630a7a09
2023-08-07 10:33:18 -04:00
Jerome Jiang fc29b8533e Fix some clang-tidy warnings
- Use zero initializer instead of memset to avoid including <cstring>
 - Include vpx_codec.h for vpx_codec_err_t and error codes
 - Include vpx_tpl.h for VpxTplGopStats

Change-Id: Iac5837ce2173bd945bfe8eeb401ff4dfd04fd2e1
2023-08-04 16:29:10 -04:00
Jerome Jiang f6aaad370d Fix include path fpr vpx_tpl.h,vpx_ext_ratectrl.h
Bug: b/294049605
Change-Id: I6422fc4250c2192f985cce2e296a19a05934969b
2023-08-04 16:29:06 -04:00
Jerome Jiang 5556ebd894 Merge "vp9_quantize_fp_neon: Same params name as in decl" into main 2023-08-03 19:28:44 +00:00
Jerome Jiang 7dfeaffacc Merge "vp9 ext rc: Add callback for tpl stats" into main 2023-08-03 18:33:32 +00:00
Jerome Jiang 44f2819298 vp9_quantize_fp_neon: Same params name as in decl
Clear some clang-tidy warnings

Change-Id: Iea4c4e77b3d515ec6384bd34875a0002ab13c14c
2023-08-03 14:07:55 -04:00
Jerome Jiang 2f2761c261 vp9 ext rc: Add callback for tpl stats
Added test

Bug: b/294049605
Change-Id: I3967a0f915e1a6e7a0d34d04732c33e1ca6f35e7
2023-08-03 13:16:42 -04:00
Anupam Pandey 6075b1a36f Add test to check bit exactness of C and SIMD in VP9 encoder
This CL adds a shell script to test bit exactness of C and SIMD
VP9 encoder for x86 platform.

As C Vs NEON encoding outputs are not bit-exact (BUG=webm:1809),
ARM tests are currently disabled.

BUG=webm:1800

Change-Id: Iffcc70863e8cf83ccb5bc5be73e8866165697358
2023-08-03 15:03:38 +05:30
Yunqing Wang 2b82efa769 Add a 10-bit test file
Added a 10-bit test file for VP9 end-to-end c vs SIMD bit-
exactness test.

BUG=webm:1800

Change-Id: I4a864f1a740abee27049d68231adf2ec308f9a96
2023-08-01 21:04:09 -07:00
Johann 22818907d2 normalize *const in rtcd
Change-Id: Iece50143b43263c0c8f90299bedd7d2a5b9aa56b
2023-07-29 05:44:56 +09:00
Johann e7a4730fcc remove incorrect (void)
n_coeffs is used in this function

Change-Id: I5f5d2933304bb636a33e0fa294b4526edb65a08d
2023-07-28 20:21:34 +09:00
Johann 7c7ab9165a quantize_fp: reduce parameters
apply similar steps as to the other quantize functions to switch to
macroblock_plane and ScanOrder

Change-Id: I486d653326aaf52ffd3beafd2e891ba6a5d57ef3
2023-07-28 20:13:24 +09:00
Johann 70fc756383 quantize: reduce parameters
Pass macroblock_plane and ScanOrder instead of looking up the values
beforehand. Avoids pushing arguments to the stack.

Change-Id: I22df6f645eb1a1d89ba5a4d9bc58acb77af51aa9
2023-07-28 17:34:43 +09:00
James Zern 4f19de3826 resize_test: prefer 'override' to 'virtual'
Update functions in WRITE_COMPRESSED_STREAM blocks, which are disabled
by default. This caused them to be missed in:
84e6b7ab0 test/*.cc: prefer 'override' to 'virtual'

Change-Id: I0e462263f19c15eb0a30d0c0f4e145062f789489
2023-07-27 17:52:49 -07:00
James Zern 626e37e777 test/*.h: prefer 'override' to 'virtual'
created with clang-tidy --fix --checks=-*,modernize-use-override

Change-Id: I53412f35590799574edb573ae417a4a004cccd1e
2023-07-27 17:52:49 -07:00
James Zern d899b97945 encode_test_driver.h: use bool literal
Change-Id: If47be9ca0daa18d92cb849484f9e139e65e3560e
2023-07-27 17:52:49 -07:00
James Zern d62edaf41f test/**.cc: use bool literals
created with clang-tidy --fix --checks=-*,modernize-use-bool-literals

Change-Id: Ifaed8ca824676555acaf1053b2a5a52c51a70638
2023-07-25 12:18:03 -07:00
James Zern 5740cb3929 test/decode_perf_test.cc: use nullptr
created with clang-tidy --fix --checks=-*,modernize-use-nullptr

Change-Id: Ibf4a80fa00e9b59d471c92788ec4c7c72e4662e5
2023-07-25 12:10:21 -07:00
James Zern 1c2297b2bc test/*.cc: use '= default'
created with clang-tidy --fix --checks=-*,modernize-use-equals-default

Change-Id: Ie373fb5501491fce53479d20f3a6d908c4b7c535
2023-07-25 12:04:57 -07:00
James Zern f9e577cecb Merge changes I71e1b442,Ibbfb949b into main
* changes:
  test/*.cc: prefer 'override' to 'virtual'
  test,AbstractBench: fix -Wnon-virtual-dtor
2023-07-25 18:27:34 +00:00
James Zern 84e6b7ab02 test/*.cc: prefer 'override' to 'virtual'
created with clang-tidy --fix --checks=-*,modernize-use-override

Change-Id: I71e1b4423c143b3e47fe90929ee110b307cdb565
2023-07-24 18:09:31 -07:00
James Zern 5fb280ebb9 test,AbstractBench: fix -Wnon-virtual-dtor
In file included from ../test/bench.cc:14:
../test/bench.h:17:7: warning: 'AbstractBench' has virtual functions but
non-virtual destructor [-Wnon-virtual-dtor]
class AbstractBench {

Change-Id: Ibbfb949b63c8dff936c7ed4f2d056dea0343377b
2023-07-24 17:07:51 -07:00
Jerome Jiang e1c124f896 Add new_mv_count to ext rate control interface
Bug: b/290385227
Change-Id: Ia87c4bf1e9315bf1134c998f88e9d5548c497777
2023-07-24 18:04:58 -04:00
Jerome Jiang 37200b6abb cleanup: _pt -> _ptr in vp9 external RC interface
Change-Id: Ic483488f8f6273e8977cfc324466bda41f1e47a7
2023-07-24 13:08:05 -04:00
James Zern 1d1ee888d3 vp9_rdopt,handle_inter_mode: fix -Wmaybe-uninitialized warning
With gcc 13.1.1

In function ‘handle_inter_mode’,
inlined from ‘vp9_rd_pick_inter_mode_sb’ at
    ../vp9/encoder/vp9_rdopt.c:3872:17:
../vp9/encoder/vp9_rdopt.c:3142:8: warning: ‘tmp_rd’ may be used
    uninitialized [-Wmaybe-uninitialized]
 3142 |     rd = tmp_rd + RDCOST(x->rdmult, x->rddiv, rs, 0);
../vp9/encoder/vp9_rdopt.c: In function ‘vp9_rd_pick_inter_mode_sb’:
../vp9/encoder/vp9_rdopt.c:2846:15: note: ‘tmp_rd’ was declared here
 2846 |   int64_t rd, tmp_rd, best_rd = INT64_MAX;

Change-Id: I8608957cc8bbeb1ae525f3c3dad6fe9785b2a9b4
2023-07-13 09:49:30 -07:00
James Zern 9ad950a9c4 Merge "vp8: remove missing prototypes from the rtcd header" into main 2023-07-11 00:55:30 +00:00
L. E. Segovia e9b9972ca4 vp8: remove missing prototypes from the rtcd header
These were removed in If7a49e920e12f7fca0541190b87e6dae510df05c but
the leftovers can cause a build to fail if the code isn't optimized out.
I just found this out in the Meson port of libvpx for GStreamer.

BUG=webm:1584

Change-Id: I1c953720a2cbec3796200d4ec4020dca0b672bfb
2023-07-10 22:38:24 +00:00
James Zern f30532a6d9 vpx_free_tpl_gop_stats: normalize param name
this fixes a clang-tidy warning

Change-Id: I13f4750c15b7d6a395494c8dbcb896bde125b3c4
2023-07-10 10:06:13 -07:00
James Zern b2c2955c82 Merge "delete some dead code" into main 2023-07-06 17:10:37 +00:00
James Zern dcb91aa3dd mfqe_partition: fix -Wunreachable-code
vp9/common/vp9_mfqe.c|240 col 16| warning: code will never be executed
[-Wunreachable-code]
 BLOCK_SIZE mfqe_bs, bs_tmp;
            ^~~~~~~

Change-Id: I566b20d8c294e19bc4b90b57b730f933048e71a5
2023-06-29 09:52:26 -07:00
Wan-Teh Chang 3ef9934789 Fix a bug in vpx_highbd_hadamard_32x32_neon().
This CL is the highbd version of
https://chromium-review.googlesource.com/c/webm/libvpx/+/4646573.

The bug is caused by the incorrect assumption that
(a / 2) + (b / 2) == (a + b) / 2 and (a / 2) - (b / 2) == (a - b) / 2.

Also fix the Rand() inputs to Hadamard functions in unit tests.

This CL ports the following libaom CLs to libvpx:
https://aomedia-review.googlesource.com/c/aom/+/177101
https://aomedia-review.googlesource.com/c/aom/+/177241

Change-Id: Ic20e7684eab5d6507417fa2b75e572064d37ad2c
2023-06-28 16:09:36 -07:00
James Zern dc26707f80 delete some dead code
follow-up to:
3ecba3980 Fix Clang -Wunreachable-code-aggressive warnings

Change-Id: I364312987bc838c69c010cce024bd3d62a918417
2023-06-28 12:26:32 -07:00
James Zern 9598c384bc Merge "Fix Clang -Wunreachable-code-aggressive warnings" into main 2023-06-28 19:21:40 +00:00
James Zern 3ecba39802 Fix Clang -Wunreachable-code-aggressive warnings
Based on the change in libaom:
fe36011455 Fix Clang -Wunreachable-code-aggressive warnings

Clang's -Wunreachable-code-aggressive flag enables several warning flags
such as -Wunreachable-code-break and -Wunreachable-code-return. Chrome's
build system enables -Wunreachable-code-aggressive (in
build/config/compiler/BUILD.gn), so it would be good if libvpx could be
compiled without -Wunreachable-code-aggressive warnings.

This requires the VPX_NO_RETURN macro be defined correctly for all the
compilers we support, otherwise some compilers may warn about missing
return statements after a die() or fatal() call (which does not return).

Change-Id: I0c069133af45a7a61759538b6d74c681ea087dcd
2023-06-28 11:06:50 -07:00
Jerome Jiang 3bd65ac776 vp9 firstpass stats in a separate header
Change-Id: If91c5c74c71affc48eb858beb314a6c194b14023
2023-06-28 11:17:15 -04:00
James Zern 44d6cacec6 Merge changes I1c17302f,Ic084894b,I9867f5fc,Ie3faf7b3,If5dc96b7, ... into main
* changes:
  vp8_decode: fix keyframe resync after decode error
  vp8_decode: only remove threads on thread create failure
  vp8_decode: clear stream info on decoder create failure
  vp9_decodeframe,init_mt: free tile_workers on alloc failure
  vp9_alloccommon: clear allocation sizes on free
  vp9_dx_iface: fix leaks on init_decoder() failure
2023-06-28 00:02:47 +00:00
James Zern 44a5eaa3ba vp8_decode: fix keyframe resync after decode error
This fixes a crash if the application continues to call
vpx_codec_decode(). Previously a non-keyframe could cause a crash if the
decoder failed before fully initializing due to an allocation failure.
The stream info and frame resolution would be 0, skipping an allocation.

Found with vpx_dec_fuzzer_vp8 & Nallocfuzz
(https://github.com/catenacyber/nallocfuzz).

Bug: webm:1807
Change-Id: I1c17302f4d3a488ba3b4eefe0bf53853dc558bc1
2023-06-27 12:58:28 -07:00
James Zern a166c52d3a vp8_decode: only remove threads on thread create failure
This fixes a crash if the application continues to call
vpx_codec_decode(). Previously the decoder instance would be freed,
causing a crash when attempting to access it with restart_threads=1.

Found with vpx_dec_fuzzer_vp8 & Nallocfuzz
(https://github.com/catenacyber/nallocfuzz).

Bug: webm:1807
Change-Id: Ic084894b776729bb1572f747082cef002f0832a8
2023-06-26 19:23:58 -07:00
James Zern 263ddc9e38 vp8_decode: clear stream info on decoder create failure
This fixes a crash if the application continues to call
vpx_codec_decode().

Found with vpx_dec_fuzzer_vp8 & Nallocfuzz
(https://github.com/catenacyber/nallocfuzz).

Bug: webm:1807
Change-Id: I9867f5fc3d1163026f521a9609d3cbbc00568d1d
2023-06-26 19:23:41 -07:00
James Zern a31e818ef8 vp9_decodeframe,init_mt: free tile_workers on alloc failure
This avoids a crash if any of the thread allocations fail and the
application continues to call vpx_codec_decode(). Previously
num_tile_workers would be non-zero, but not equal to num_threads, which
would cause a crash during later thread management.

Found with vpx_dec_fuzzer_vp9 & Nallocfuzz
(https://github.com/catenacyber/nallocfuzz).

Bug: webm:1807
Change-Id: Ie3faf7b36764aebedac0924acb6e4cb7545aec7d
2023-06-26 19:20:41 -07:00
James Zern 02ab555e99 vp9_alloccommon: clear allocation sizes on free
This fixes reallocations (and avoids potential crashes) if any
allocations fails and the application continues to call
vpx_codec_decode().

Found with vpx_dec_fuzzer_vp9 & Nallocfuzz
(https://github.com/catenacyber/nallocfuzz).

Bug: webm:1807
Change-Id: If5dc96b73c02efc94ec84c25eb50d10ad6b645a6
2023-06-26 19:15:30 -07:00
James Zern 885ecc7c66 vp9_dx_iface: fix leaks on init_decoder() failure
If any allocations fail in init_decoder() and the application continues
to call vpx_codec_decode() some of the allocations would be orphaned or
the decoder would be left in a partially initialized state.

Found with vpx_dec_fuzzer_vp9 & Nallocfuzz
(https://github.com/catenacyber/nallocfuzz).

Bug: webm:1807
Change-Id: I44f662526d715ecaeac6180070af40672cd42611
2023-06-26 19:14:14 -07:00
Wan-Teh Chang 19f3a754d6 Fix a bug in vpx_hadamard_32x32_neon()
A right shift by 2 is equivalent to two halving operations if there is
no no addition or subtraction between the two halving operations.

Note: Since vhaddq_s16() and vhsubq_s16() have 17-bit intermediate
precision, the Neon code doesn't need to go to int32_t as was done in
https://chromium-review.googlesource.com/c/webm/libvpx/+/4604169.

Change-Id: Ibe0691cde0fd3b94ee7c497845ba459d30d503b0
2023-06-26 15:48:03 -07:00
James Zern 14e52008ed Merge "configure.sh: Improve a comment." into main 2023-06-20 20:06:32 +00:00
Yunqing Wang 74e8c77425 Merge "Remove vp9_diamond_search_sad_avx function" into main 2023-06-20 16:34:58 +00:00
Anupam Pandey 80d4172f07 Remove vp9_diamond_search_sad_avx function
This CL removes the avx of vp9_diamond_search_sad function as
there is no speed up seen wrt C.

Change-Id: Ife6005d8e444ea2c8d07ac0f686c840344b9e0ea
2023-06-19 16:05:12 +05:30
Chen Wang af40910197 configure.sh: Improve a comment.
The corresponding case block is not only for ARM.
Original comment text makes reader confused.

Test: N/A, just comment text changes.

Change-Id: I3154d18d3b3d237c1eecfe07dc7ec237c98194cf
Signed-off-by: Chen Wang <wangchen20@iscas.ac.cn>
2023-06-17 00:42:17 +00:00
Jerome Jiang 8cee267d3d Add new_mv_count to firstpass stats
Mostly follows the logic of how it's calculated in libaom.

Bug: b/287283080
Change-Id: I9ee67d844ef9db7cca63339b5304459eaa28d324
2023-06-16 14:13:29 -04:00
Yunqing Wang 8789421bf3 Merge "Fix c vs intrinsic mismatch of vpx_hadamard_32x32() function" into main 2023-06-12 16:44:21 +00:00
Jerome Jiang bdb8ccc0af RTC RC: clean up unnecessary headers
Change-Id: I77c407be59f4eb0c70a89a5fffd88c648e634123
2023-06-09 15:33:39 -04:00
Anupam Pandey 8c308aefea Fix c vs intrinsic mismatch of vpx_hadamard_32x32() function
This CL resolves the mismatch between C and intrinsic implementation
of vpx_hadamard_32x32 function. The mismatch was due to integer
overflow during the addition operation in the intrinsic functions.
Specifically, the addition in the intrinsic function was performed
at the 16-bit level, while the calculation of a0 + a1 resulted in
a 17-bit value.

This code change addresses the problem by performing
the addition at the 32-bit level (with sign extension) in both SSE2
and AVX2, and then converting the results back to the 16-bit level
after a right shift.

STATS_CHANGED

Change-Id: I576ca64e3b9ebb31d143fcd2da64322790bc5853
2023-06-09 17:15:37 +05:30
Jerome Jiang 2245df50a6 Replace NONE with NO_REF_FRAME
NONE is a common name and it has conflicts with symbols defined in
Chromium.

Bug: b/286163500
Change-Id: I3d935a786f771a4d90b258fabc6fd6c2ecbf1c59
2023-06-08 11:08:23 -04:00
Jerome Jiang da02ccde30 Merge "Fix more typos (n/n)" into main 2023-06-08 14:11:24 +00:00
Jerome Jiang fb6aebcbbf Merge "Fix more typos (3/n)" into main 2023-06-07 21:10:04 +00:00
Jerome Jiang d42b7fd661 Fix more typos (n/n)
impace -> impact
taget -> target
prediciton -> prediction
addtion -> addition
the the -> the

Bug: webm:1803
Change-Id: I759c9d930a037ca69662164fcd6be160ed707d77
2023-06-07 16:41:18 -04:00
Jerome Jiang 6a8eb04fec Fix more typos (3/n)
Propogation -> Propagation
propogate -> propagate
cant -> can't
upto -> up to
canddiates -> candidates
refernce -> reference
USEAGE -> USAGE

Change-Id: Iadaf2dffd86b54e04411910f667e8c2dfc6c4c77
2023-06-07 15:46:33 -04:00
Jerome Jiang da9735a37e Merge "Fix more typos (2/n)" into main 2023-06-07 19:10:43 +00:00
Jerome Jiang aafa55cc3f Merge "Fix more typos (1/n)" into main 2023-06-07 19:10:36 +00:00
Jerome Jiang 1c95f5d17b Merge "Fix a few typos" into main 2023-06-07 18:19:08 +00:00
Jerome Jiang ffb9345109 Fix more typos (2/n)
kernal -> kernel
e.g -> e.g.
paritioning -> partitioning
partioning -> partitioning
coefficents -> coefficients
i.e, -> i.e.,
equivalend -> equivalent
recive -> receive
resoultions -> resolutions

Bug: webm:1803
Change-Id: I1d6176202ee5daee7a64bf59114e8b304aeb4db7
2023-06-07 13:09:58 -04:00
Jerome Jiang ad14a32b33 Fix more typos (1/n)
Dont -> Don't
setings -> settings
thresold -> thresh
thresold -> threshold
becasue -> because
itterations -> iterations
its a -> it's a
an constant -> a constant

Bug: webm:1803
Change-Id: I1e019393939ed25c59c898c88d4941ec360b026d
2023-06-07 13:09:39 -04:00
Jerome Jiang bcd491a6be Fix a few typos
segement -> segment
dont -> don't
useage -> usage
devide -> divide

Bug: webm:1803
Change-Id: I0153380b0003825c4b62cf323d4f2bc837c8a264
2023-06-07 12:39:07 -04:00
Deepa K G e510716d7e Add comments in vp9_diamond_search_sad_avx()
Added comments related to re-arranging the
elements of the SAD vector to find the
minimum.

Change-Id: I58b702d304a6cdd32f04775fba603e39c19a8947
2023-06-06 14:35:14 +05:30
Deepa K G 7b66c730a2 Fix c vs avx mismatch of diamond_search_sad()
In the function vp9_diamond_search_sad_avx(), arranged
the cost vector in a specific order. This ensures that
the motion vector with the least index is selected,
when there exists more than one candidate motion
vector with the minimum cost, thus resolving the
c vs avx mismatch.

STATS_CHANGED

Change-Id: I4f8864f464f9ea2aae6250db3d8ad91cb08b26e2
2023-06-05 12:48:24 +05:30
Jerome Jiang 575bd73f61 Merge "Trim tpl stats by 2 extra frames" into main 2023-05-31 19:31:04 +00:00
Jerome Jiang 1aff4a5655 Trim tpl stats by 2 extra frames
Not applicable to the last GOP.

Bug: b/284162396
Change-Id: I55b7e04e9fc4b68a08ce3e00b10743823c828954
2023-05-31 14:26:49 -04:00
James Zern 60ee1b149b Merge changes I6a906803,I0307a3b6 into main
* changes:
  Optimize Neon implementation of vpx_int_pro_row
  Optimize Neon implementation of vpx_int_pro_col
2023-05-31 17:44:00 +00:00
Jonathan Wright c36aa2e9c4 Optimize Neon implementation of vpx_int_pro_row
Double the number of accumulator registers to remove the bottleneck.
Also peel the first loop iteration.

Change-Id: I6a90680369f9c33cdfe14ea547ac1569ec3f50de
2023-05-31 14:34:43 +01:00
Jonathan Wright c738e87f27 Optimize Neon implementation of vpx_int_pro_col
Use widening pairwise addition instructions to halve the number of
additions required.

Change-Id: I0307a3b65e50d2b1ae582938bc5df9c2b21df734
2023-05-31 14:30:02 +01:00
James Zern ad5677eafc Merge changes Ia3647698,I55caf34e,Id2c60f39 into main
* changes:
  vpx_dsp_common.h,clip_pixel: work around VS2022 Arm64 issue
  fdct_partial_neon.c: work around VS2022 Arm64 issue
  fdct8x8_test.cc: work around VS2022 Arm64 issue
2023-05-25 04:54:09 +00:00
James Zern 47fa9804b2 Merge "examples.mk,vpxdec: rm libwebm muxer dependency" into main 2023-05-24 17:43:20 +00:00
Jerome Jiang 31c07211ba Merge "Add IO for TPL stats" into main 2023-05-24 16:27:20 +00:00
James Zern 25f2e1ef25 vpx_dsp_common.h,clip_pixel: work around VS2022 Arm64 issue
cl.exe targeting AArch64 with optimizations enabled
produces invalid code for clip_pixel() when the return type is uint8_t.
See:
https://developercommunity.visualstudio.com/t/Misoptimization-for-ARM64-in-VS-2022-17/10363361

Bug: b/277255076
Bug: webm:1788
Change-Id: Ia3647698effd34f1cf196cd33fa4a8cab9fa53d6
2023-05-23 15:52:09 -07:00
James Zern 95b56ab7df fdct_partial_neon.c: work around VS2022 Arm64 issue
cl.exe targeting AArch64 with optimizations enabled
will fail with an internal compiler error.
See:
https://developercommunity.visualstudio.com/t/Compiler-crash-C1001-when-building-a-for/10346110

Bug: b/277255076
Bug: webm:1788
Change-Id: I55caf34e910dab47a7775f07280677cdfe606f5b
2023-05-23 15:52:05 -07:00
James Zern 62d09a3e94 fdct8x8_test.cc: work around VS2022 Arm64 issue
cl.exe targeting AArch64 with optimizations enabled
produces invalid code in RunExtremalCheck() and RunInvAccuracyCheck().
See:
https://developercommunity.visualstudio.com/t/1770-preview-1:-Misoptimization-for-AR/10369786

Bug: b/277255076
Bug: webm:1788
Change-Id: Id2c60f3948d8f788c78602aea1b5232133415dea
2023-05-23 15:51:56 -07:00
Jerome Jiang d45cc8edda Add IO for TPL stats
Overload TempOutFile constructor to allow IO mode.

Bug: b/281563704

Change-Id: I1f4f5b29db0e331941b6795e478eeeab51f625ad
2023-05-23 17:58:01 -04:00
Jerome Jiang 7a5f328a66 Merge "Add new vpx_tpl.h API file" into main 2023-05-18 17:20:03 +00:00
Yunqing Wang 4bbdd6b046 Merge "Improve convolve AVX2 intrinsic for speed" into main 2023-05-18 15:48:49 +00:00
Jerome Jiang 7e7a1706e3 Add new vpx_tpl.h API file
New file (vpx_tpl.c) in the following CLs will add new APIs dealing with
TPL stats from VP9 encoder.

Change-Id: I5102ef64214cba1ca6ecea9582a19049666c6ca4
2023-05-17 20:43:35 -04:00
Anupam Pandey e6b9a8d667 Improve convolve AVX2 intrinsic for speed
This CL refactors the code related to convolve function.
Furthermore, improved the AVX2 intrinsic to compute
convolve vertical for w = 4 case, and convolve horiz for
w = 16 case.

Please note the module level scaling w.r.t C function
(timer based) for existing (AVX2) and new AVX2 intrinsics:

Block     Scaling
Size   AVX2       AVX2
     (existing)   (New)
4x4    5.34x      5.91x
4x8    7.10x      7.79x
16x8  23.52x     25.63x
16x16 29.47x     30.22x
16x32 33.42x     33.44x

This is a bit exact change.

Change-Id: If130183bc12faab9ca2bcec0ceeaa8d0af05e413
2023-05-17 14:24:34 +05:30
James Zern 99522d307c Merge changes Ie77ad184,Idfcac43c into main
* changes:
  Add 2D-specific Neon horizontal convolution functions
  Refactor standard bitdepth Neon convolution functions
2023-05-16 00:05:05 +00:00
Jonathan Wright 3e1e38d117 Add 2D-specific Neon horizontal convolution functions
2D 8-tap convolution filtering is performed in two passes -
horizontal and vertical. The horizontal pass must produce enough
input data for the subsequent vertical pass - 3 rows above and 4 rows
below, in addition to the actual block height.

At present, all Neon horizontal convolution algorithms process 4 rows
at a time, but this means we end up doing at least 1 row too much
work in the 2D first pass case where we need h + 7, not h + 8 rows of
output.

This patch adds additional dot-product (SDOT and USDOT) Neon paths
that process h + 7 rows of data exactly, saving the work of the
unnecessary extra row. It is impractical to take a similar approach
for the Armv8.0 MLA paths since we have to transpose the data block
both before and after calling the convolution helper functions.

vpx_convolve_neon performance impact: we observe a speedup of ~9% for
smaller (and wider) blocks, and a speedup of 0-3% for larger blocks.
This is to be expected since the proportion of redundant work
decreases as the block height increases.

Change-Id: Ie77ad1848707d2d48bb8851345a469aae9d097e1
2023-05-13 20:43:20 +01:00
James Zern 8adf1be644 Merge "Don't use -Wl,-z,defs with Clang's sanitizers" into main 2023-05-12 19:23:47 +00:00
James Zern 2a9b810d3d Don't use -Wl,-z,defs with Clang's sanitizers
This avoids link errors related to the sanitizers:
https://clang.llvm.org/docs/AddressSanitizer.html#usage
"When linking shared libraries, the AddressSanitizer run-time is not
linked, so -Wl,-z,defs may cause link errors ..."

See also:
https://crbug.com/aomedia/3438

Bug: webm:1801
Fixed: webm:1801
Change-Id: Ie212318005a5f7222e5486775175534025306367
2023-05-12 10:20:54 -07:00
Jonathan Wright 8ecf584321 Refactor standard bitdepth Neon convolution functions
1) Use #define constant instead of magic numbers for right shifts.
2) Move saturating narrow into helper functions that return 4-element
   result vectors.
3) Use mem_neon.h helpers for load/store sequences in Armv8.0 paths.
4) Tidy up: assert conditions and some longer variable names.
5) Prefer != 0 to > 0 where possible for loop termination conditions.

Change-Id: Idfcac43ca38faf729dca07b8cc8f7f45ad264d24
2023-05-12 14:53:51 +01:00
James Zern 9e0fc37f6f configure: add -Wshadow
libraries under third_party/ are out of scope for this change.

Bug: webm:1793
Change-Id: I562065a3c0ea9fdfc9615d1a6b1ae47da79b8ce0
2023-05-09 14:04:19 -07:00
James Zern 894262fb8f Merge "vp8_macros_msa.h: clear -Wshadow warnings" into main 2023-05-09 21:03:31 +00:00
James Zern bf5facce39 Merge changes Iac020280,I8ca8660a into main
* changes:
  gen_msvs_vcxproj: add ARM64EC w/VS >= 2022
  configure: add clang-cl vs1[67] arm64 targets
2023-05-09 20:55:55 +00:00
Yunqing Wang cc1b3886f2 Merge "Add AVX2 intrinsic for vpx_comp_avg_pred() function" into main 2023-05-09 15:57:09 +00:00
Anupam Pandey 457b7f5986 Add AVX2 intrinsic for vpx_comp_avg_pred() function
The module level scaling w.r.t C function (timer based) for
existing (SSE2) and new AVX2 intrinsics:

If ref_padding = 0
Block     Scaling
size    SSE2    AVX2
8x4     3.24x   3.24x
8x8     4.22x   4.90x
8x16    5.91x   5.93x
16x8    1.63x   3.52x
16x16   1.53x   4.19x
16x32   1.38x   4.82x
32x16   1.28x   3.08x
32x32   1.45x   3.13x
32x64   1.38x   3.04x
64x32   1.39x   2.12x
64x64   1.46x   2.24x

If ref_padding = 8
Block     Scaling
size    SSE2    AVX2
8x4     3.20x   3.21x
8x8     4.61x   4.83x
8x16    5.50x   6.45x
16x8    1.56x   3.35x
16x16   1.53x   4.19x
16x32   1.37x   4.83x
32x16   1.28x   3.07x
32x32   1.46x   3.29x
32x64   1.38x   3.22x
64x32   1.38x   2.14x
64x64   1.38x   2.12x

This is a bit-exact change.

Change-Id: I72c5d155f64d0c630bc8c3aef21dc8bbd045d9e6
2023-05-09 16:33:59 +05:30
James Zern fbbe1d0115 vp8_macros_msa.h: clear -Wshadow warnings
Bug: webm:1793
Change-Id: Ia940b06bd23a915a050432e03bb630567e891d8d
2023-05-08 21:44:32 -07:00
James Zern 19ec57e149 Merge "README: update target list" into main 2023-05-08 20:52:52 +00:00
James Zern 2108b7a26f Merge changes Ie165d410,I6d9bb8da,I6858e574 into main
* changes:
  vp8_[cd]x_iface: clear setjmp flag on function exit
  vp9_decodeframe,tile_worker_hook: relocate setjmp=1
  vp9,encoder_set_config: set setjmp flag after setjmp()
2023-05-08 20:52:31 +00:00
Jerome Jiang f5f3a64862 Merge "Add VpxTplGopStats" into main 2023-05-08 19:47:30 +00:00
Jerome Jiang 7ab013f8a9 Merge "Unify implementation of CHECK_MEM_ERROR" into main 2023-05-08 19:47:21 +00:00
Jerome Jiang 62cd0c9c3e Merge "CHECK_MEM_ERROR to return in vp9_set_roi_map" into main 2023-05-08 19:46:44 +00:00
James Zern 3916e0e130 gen_msvs_vcxproj: add ARM64EC w/VS >= 2022
rather than define new targets, add a platform to the arm64 list as they
share the same configuration.

Bug: webm:1788
Change-Id: Iac020280b1103fb12b559f21439aeff26568fba4
2023-05-08 10:53:21 -07:00
James Zern 3fe1365884 configure: add clang-cl vs1[67] arm64 targets
x86 and armv7 are skipped for now as the intrinsics will need different
flags than cl.exe (/arch:... -> -m...).

Bug: webm:1788
Change-Id: I8ca8660a8644cdd84c51cb1f75005e371ba8207d
2023-05-08 10:53:21 -07:00
Jerome Jiang 745c6392f7 Add VpxTplGopStats
Contains the size of GOP - also the size of the list of TPL stats for
each frame in this GOP.

VpxTplGopStats will be the unit for VP9E_GET_TPL_STATS control to return
TPL stats from the encoder.

Bug: b/273736974
Change-Id: I1682242fc6db4aafcd6314af023aa0d704976585
2023-05-08 13:27:26 -04:00
Jerome Jiang 1710c9282a Unify implementation of CHECK_MEM_ERROR
There were multiple implementations of CHECK_MEM_ERROR across the
library that take different arguments and used in different places.

This CL will unify them and have only one implementation that takes
vpx_internal_error_info.

Change-Id: I2c568639473815bc00b1fc2b72be56e5ccba1a35
2023-05-08 13:27:24 -04:00
Jerome Jiang 75f9551efb CHECK_MEM_ERROR to return in vp9_set_roi_map
Also change the return type of vp9_set_roi_map to vpx_codec_err_t

Change-Id: I60d9ff45f2d3dfc44cd6e2aab2cb1ba389ff15f3
2023-05-08 13:25:36 -04:00
James Zern b14d20b470 examples.mk,vpxdec: rm libwebm muxer dependency
vpxdec only requires the parser.

Change-Id: I54ead453d4af400ca5c3412a3211d6d0b1383046
2023-05-06 15:48:58 -07:00
James Zern 4818f997fe Merge "vp9_encoder: clear -Wshadow warning" into main 2023-05-06 02:26:55 +00:00
James Zern 3d57fb69af README: update target list
Change-Id: If2d5811a55f6bb60eeba7d28b69c78157a17e87f
2023-05-05 19:12:27 -07:00
Jerome Jiang 905f991acd Merge "Set setjmp flag in VP9 RTC rate control library" into main 2023-05-05 23:02:14 +00:00
Jerome Jiang 5636f098b3 Set setjmp flag in VP9 RTC rate control library
Change-Id: Ic5ec8dc7d9637091d4137a47d793cf29e76fdc45
2023-05-05 15:41:33 -04:00
James Zern 497f246d29 sixtap_filter_msa.c: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I5f9c09f31b06fecc123c6a9d01f5fbed39142356
2023-05-05 12:26:13 -07:00
James Zern 662af59716 Merge "macros_msa.h: clear -Wshadow warnings" into main 2023-05-05 19:15:29 +00:00
James Zern 851a76ff65 vp8_[cd]x_iface: clear setjmp flag on function exit
in vp8e_encode, also move setting the setjmp() call closer to setting
the flag.

Change-Id: Ie165d4100b84776f9c34eddcf64657bd78cce4f5
2023-05-05 11:18:08 -07:00
James Zern eb7014c80c vp9_decodeframe,tile_worker_hook: relocate setjmp=1
after the call to setjmp(); this is more correct and consistent with
other code.

Change-Id: I6d9bb8daad6a959bfe4f25484f9d6664b99da19e
2023-05-05 11:03:19 -07:00
James Zern b030d033b8 vp9,encoder_set_config: set setjmp flag after setjmp()
Change-Id: I6858e574d24aaff64f725404706f58e04e43717d
2023-05-05 11:01:50 -07:00
James Zern e2f217c075 Merge changes I8089e90a,I46890224,I1b0e090d into main
* changes:
  Overwrite cm->error->detail before freeing
  Have vpx_codec_error take const vpx_codec_ctx_t *
  Add comments about vpx_codec_enc_init_ver failure
2023-05-05 17:26:11 +00:00
James Zern b3920105c3 Merge "vpx_subpixel_8t_intrin_avx2,cosmetics: shorten long comment" into main 2023-05-05 16:47:28 +00:00
James Zern 28c5d70650 vp9_encoder: clear -Wshadow warning
with --enable-experimental --enable-rate-ctrl

Bug: webm:1793
Change-Id: I9ca664538bcf0c2aca8aea73283bbb0232eb86e9
2023-05-05 09:46:53 -07:00
James Zern c85b7331a5 macros_msa.h: clear -Wshadow warnings
Bug: webm:1793
Change-Id: Ib2e3bd3c52632cdd4410cb2c54d69750e64e5201
2023-05-05 09:25:52 -07:00
Yunqing Wang 17f1a23f55 Merge "Add AVX2 intrinsic for idct16x16 and idct32x32 functions" into main 2023-05-05 15:33:21 +00:00
Anupam Pandey 255ee18885 Add AVX2 intrinsic for idct16x16 and idct32x32 functions
Added AVX2 intrinsic optimization for the following functions
1. vpx_idct16x16_256_add
2. vpx_idct32x32_1024_add
3. vpx_idct32x32_135_add

The module level scaling w.r.t C function (timer based) for
existing (SSE2) and new AVX2 intrinsics:
                            Scaling
   Function Name         SSE2      AVX2
vpx_idct32x32_1024_add  3.62x     7.49x
vpx_idct32x32_135_add   4.85x     9.41x
vpx_idct16x16_256_add   4.82x     7.70x

This is a bit-exact change.

Change-Id: Id9dda933aa1f5093bb6b35ac3b8a41846afca9d2
2023-05-05 15:55:16 +05:30
Wan-Teh Chang 3d6b86e704 Overwrite cm->error->detail before freeing
Help detect use after free of the return value of
vpx_codec_error_detail(). If vpx_codec_error_detail() is called after
vpx_codec_encode() fails, the return value may be equal to
cm->error->detail, which is freed when vpx_codec_destroy() is called.

Document the lifetime of the string returned by
vpx_codec_error_detail().

Change-Id: I8089e90a4499b4f3cc5b9cfdbb25d72368faa319
2023-05-04 22:08:21 -07:00
Wan-Teh Chang 8e47341b0e Have vpx_codec_error take const vpx_codec_ctx_t *
Also have vpx_codec_error_detail take vpx_codec_ctx_t *. Both functions
are getter functions that don't modify the codec context.

Change-Id: I4689022425efbf7b1da5034255ac052fce5e5b4f
2023-05-04 22:08:21 -07:00
Wan-Teh Chang 601a98b154 Add comments about vpx_codec_enc_init_ver failure
Address the questions:
1. If vpx_codec_enc_init_ver() fails, should I still call
   vpx_codec_destroy() on the encoder context?
2. Is it safe to call vpx_codec_error_detail() when
   vpx_codec_enc_init_ver() failed?

Change-Id: I1b0e090d11dd9f853fe203f4cbb6080c3c7b0506
2023-05-04 22:08:21 -07:00
James Zern 4e23e7abfe vpx_subpixel_8t_intrin_avx2,cosmetics: shorten long comment
Change-Id: I8badedc2ad07d60896e45de28b707ad9f6c4d499
2023-05-04 17:17:10 -07:00
Jerome Jiang 3580bc559a Merge "Add num_blocks to VpxTplFrameStats" into main 2023-05-04 18:06:10 +00:00
Jerome Jiang bd3a5ae3ea Merge "Add Vpx* prefix to Tpl{Block,Frame}Stats" into main 2023-05-04 18:00:51 +00:00
Chi Yo Tsai 4379041094 Merge changes I226215a2,Ia4918eb0,If6219446,Ibf00a6e1,I900a0a48 into main
* changes:
  Fix mismatched param names in vpx_dsp/x86/sad4d_avx2.c
  Fix mismatched param names in vpx_dsp/arm/highbd_sad4d_neon.c
  Fix mismatched param names in vpx_dsp/arm/sad4d_neon.c
  Fix mismatched param names in vpx_dsp/arm/highbd_avg_neon.c
  Fix clang warning on const-qualification of parameters
2023-05-04 17:04:17 +00:00
Jerome Jiang 2e5261647f Add num_blocks to VpxTplFrameStats
I realized the calculation of the size of the list of VpxTplBlockStats
is non-trivial. So it's better to add the field for the size.

Bug: b/273736974
Change-Id: Ic1b50597c1f89a8f866b5669ca676407be6dc9d8
2023-05-04 10:59:46 -04:00
Jerome Jiang f059f9ee2d Add Vpx* prefix to Tpl{Block,Frame}Stats
This is to avoid symbols redifinition when integrating with other
libraries.

Bug: b/273736974
Change-Id: I891af78b1907504d5bb9f735164aea18c2aba944
2023-05-04 10:33:07 -04:00
James Zern 4dd3afc00e Merge changes I4d26f5f8,I12e25710 into main
* changes:
  s/__aarch64__/VPX_ARCH_AARCH64/
  configure: add aarch64 to ARCH_LIST
2023-05-04 02:16:12 +00:00
Jerome Jiang 69d5d16552 Merge "Add codec control to export TPL stats" into main 2023-05-04 01:55:41 +00:00
Jerome Jiang de45e4b612 Add codec control to export TPL stats
new codec control: VP9E_GET_TPL_STATS with unit test

Bug: b/273736974
Change-Id: I27343bd3f6dffafc86925234537bcdb557bc4079
2023-05-03 19:16:24 -04:00
chiyotsai 2c03388231 Fix mismatched param names in vpx_dsp/x86/sad4d_avx2.c
Change-Id: I226215a2ff8798b72abe0c2caf3d18875595caa5
2023-05-03 14:45:13 -07:00
chiyotsai 174e782fe5 Fix mismatched param names in vpx_dsp/arm/highbd_sad4d_neon.c
Change-Id: Ia4918eb0bac3b28b27e1ef205b9171680b2eb9a4
2023-05-03 14:44:08 -07:00
chiyotsai 701392c1b0 Fix mismatched param names in vpx_dsp/arm/sad4d_neon.c
Change-Id: If621944684cf9bb9f353db5961ed8b4b4ae38f24
2023-05-03 14:12:41 -07:00
chiyotsai 8782fd070d Fix mismatched param names in vpx_dsp/arm/highbd_avg_neon.c
Change-Id: Ibf00a6e1029284e637b10ef01ac9b31ffadc74ca
2023-05-03 14:12:19 -07:00
chiyotsai 3dbadd1b83 Fix clang warning on const-qualification of parameters
Change-Id: I900a0a48dde5fcb262157b191ac536e18269feb3
2023-05-03 14:12:12 -07:00
James Zern a398b60d6c fdct8x8_test: EXPECT_* -> ASSERT_*
This avoids unnecessary logging when a block has multiple errors.

Change-Id: If0f3e6f8ff5bd284655f7cabfd23c253c93d44c5
2023-05-03 10:09:03 -07:00
James Zern 57b9afa58f s/__aarch64__/VPX_ARCH_AARCH64/
This allows AArch64 to be correctly detected when building with Visual
Studio (cl.exe) and fixes a crash in vp9_diamond_search_sad_neon.c.
There are still test failures, however.

Microsoft's compiler doesn't define __ARM_FEATURE_*. To use those paths
we may need to rely on _M_ARM64_EXTENSION.

Bug: webm:1788
Bug: b/277255076
Change-Id: I4d26f5f84dbd0cbcd1cdf0d7d932ebcf109febe5
2023-05-03 10:04:34 -07:00
James Zern 33aba6ecc1 configure: add aarch64 to ARCH_LIST
This will allow identifying Windows Visual Studio targets as aarch64;
the Microsoft compiler does not define __aarch64__.

An alternative would be to define this in the code, checking for
_M_ARM64 or _M_ARM64EC. For now we'll use the existing VPX_ARCH_*
system. For compatibility VPX_ARCH_ARM will continue to be defined to 1
in this case.

Bug: webm:1788
Bug: b/277255076
Change-Id: I12e25710891e86f0c7339ba96884c18ed90ba16f
2023-05-02 17:43:39 -07:00
Jerome Jiang 84a180fe85 Move TplFrameStats to public header
Get ready for changes to follow:

- Custom reader/writer IO functions
- Codec control to get TPL stats from the encoder

Move the definition of TplFrameStats to public header so applications
can use them directly.

Bug: b/273736974
Change-Id: Ieb0db4560ddd966df1bc01f6a7e179cc97f9bac1
2023-05-01 13:39:01 -04:00
Jerome Jiang dbb1e8c7a6 Clean up a stale TODO in tpl
Change-Id: Ieccaff1cc94cbb2c5a294d83f3080f7407267016
2023-04-27 15:58:08 -04:00
James Zern 1a3e5567f2 Merge "register_state_check: clear -Wshadow warning" into main 2023-04-25 20:34:13 +00:00
James Zern 97d40abf9a Merge "highbd_vpx_convolve8_neon: clear -Wshadow warning" into main 2023-04-25 20:21:24 +00:00
James Zern 59d40c1415 Merge "vp9_highbd_iht16x16_add_neon: clear -Wshadow warning" into main 2023-04-25 20:12:30 +00:00
Yunqing Wang 52076a9c79 Merge "Reduce joint motion search iters based on bsize" into main 2023-04-24 21:15:14 +00:00
Neeraj Gadgil e7b58b69fd Reduce joint motion search iters based on bsize
Joint motion search during compound mode eval is optimized by
reducing the number of mv search iterations based on bsize.
The sf 'comp_inter_joint_search_thresh' is renamed as
'comp_inter_joint_search_iter_level' and used to add the logic.

cpu  Testset  Instr. Cnt     BD Rate loss (%)
               Red (%)   avg. psnr  ovr.psnr    ssim
 0   LOWRES2    5.373     0.0917     0.1088    0.0294
 0   MIDRES2    3.395     0.0239     0.0520    0.0783
 0    HDRES2    2.291     0.0223     0.0301    0.0053
 0   Average    3.686     0.0460     0.0636    0.0377

STATS_CHANGED

Change-Id: I7ee8873ebc8af967382324ae8f5c70c26665d5e6
2023-04-24 10:40:56 +05:30
Jerome Jiang 24802201ac Reland "Calculate recrf_dist and recrf_rate"
This is a reland of commit 3c59378e4e

Addressed issues from the previous CL:

- Both recon_error and rate_cost are scaled up
- recon_error and rate_cost are not accumulated across ref frames,
  instead they are calculated with the best ref frame picked.
- get_quantize_error() is put where it was, so there is no behavior
  change for vp9.

Bug: b/273736974

Original change's description:
> Calculate recrf_dist and recrf_rate
>
> Change-Id: I74e74807436b92d729e2ccaab96149780f1f52d9

Change-Id: I20e1f5543e83b576a074bd4e6b44d99da65f4b56
2023-04-21 19:18:37 -04:00
James Zern fed3de997c highbd_vpx_convolve8_neon: clear -Wshadow warning
Bug: webm:1793
Change-Id: If1a46fe183cd18e05b5538b1eba098e420b745ec
2023-04-21 13:07:04 -07:00
James Zern ec2a75ce9c vp9_highbd_iht16x16_add_neon: clear -Wshadow warning
Bug: webm:1793
Change-Id: I4e79a4d7d41b6abf88e3e60c54ab48a92b0346d2
2023-04-21 13:06:07 -07:00
Jerome Jiang a425371ccd Revert "Calculate recrf_dist and recrf_rate"
This reverts commit 3c59378e4e.

Reason for revert:

recon_error and recon_rate is summed by mistake across reference frames, as pointed out by Angie.

It could also cause vp9 behavior changes.

Original change's description:
> Calculate recrf_dist and recrf_rate
>
> Change-Id: I74e74807436b92d729e2ccaab96149780f1f52d9

Change-Id: I6106ce77cb0fe8c12b2bcf070d01513ffa8dc613
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2023-04-21 18:10:46 +00:00
Jerome Jiang 3c59378e4e Calculate recrf_dist and recrf_rate
Change-Id: I74e74807436b92d729e2ccaab96149780f1f52d9
2023-04-20 20:20:46 -04:00
Jerome Jiang 85fe280196 Merge "Store tpl stats before propagation" into main 2023-04-21 00:16:02 +00:00
James Zern b27cf67c30 register_state_check: clear -Wshadow warning
with --target=x86_64-win64-gcc

Bug: webm:1793
Change-Id: I265533af4e8d05adbe1d66a62b6dcb191ca48747
2023-04-20 14:18:26 -07:00
James Zern a7a9983314 Merge "configure: skip arm64_neon.h workaround w/VS >= 2019" into main 2023-04-20 21:11:09 +00:00
James Zern 885a533482 Merge "vp9_tpl_model: clear -Wshadow warning" into main 2023-04-20 19:51:56 +00:00
Jerome Jiang f49879a2a3 Store tpl stats before propagation
Add two new structs TplBlockStats and TplFrameStats to store tpl stats
before propagation

Change-Id: I903db99326b199ed8f2d8b19ccb973a8c8910501
2023-04-20 15:24:18 -04:00
James Zern f7d5c3eff8 configure: skip arm64_neon.h workaround w/VS >= 2019
Visual Studio 2019+ include arm64_neon.h from arm_neon.h

Bug: b/277255076
Change-Id: I52f42b69a5efe8214a4c541b68e940ad07499584
2023-04-20 12:20:23 -07:00
James Zern 5248bf6be5 Merge "vp9_spatial_svc_encoder: quiet -Wunused-but-set-variable" into main 2023-04-20 16:56:29 +00:00
James Zern 76c8f5dbcf Merge "vp9_ratectrl,vp9_encodedframe_overshoot: rm unused var" into main 2023-04-20 16:56:13 +00:00
James Zern 57e48bc8f7 Merge "onyx_if,encode_frame_to_data_rate: rm unused var" into main 2023-04-20 16:55:59 +00:00
James Zern 4cf48ce099 Merge "libs.mk: quote $(LIBVPX_TEST_DATA_PATH)" into main 2023-04-20 16:55:38 +00:00
James Zern e8fa7a038b libs.mk: quote $(LIBVPX_TEST_DATA_PATH)
This allows the testdata target to work environments like cygwin/msys
when a windows style path is used. It may also fix using paths with
spaces, though that's not generally recommended.

Change-Id: Id444c14468b05d589bce49c1f612aa712a3f0c8c
2023-04-19 18:58:59 -07:00
James Zern 4366ff7222 vp9_spatial_svc_encoder: quiet -Wunused-but-set-variable
with clang-17. Move frames_received under OUTPUT_FRAME_STATS; it's only
used in a printf.

Change-Id: Idfdd59ccd04e43df1855203db82bb4c8a1d059fb
2023-04-19 18:46:11 -07:00
James Zern 895317cdf1 vp9_ratectrl,vp9_encodedframe_overshoot: rm unused var
quiets -Wunused-but-set-variable with clang-17

Change-Id: I5212a20286d0252e45a8e8813d15cb780494b0ad
2023-04-19 18:46:05 -07:00
James Zern 84b4dfa5ba vp9_encodeframe: rm unused vars
in get_rdmult_delta() and compute_frame_aq_offset().

quiets -Wunused-but-set-variable with clang-17

Change-Id: I726852f3bc42afa80a18475de910040a9436b0bb
2023-04-19 18:46:00 -07:00
James Zern 933cf345dd onyx_if,encode_frame_to_data_rate: rm unused var
quiets -Wunused-but-set-variable with clang-17

Change-Id: Ia819beac84cbd57f4eeca6174c785fd320bc40c6
2023-04-19 18:45:53 -07:00
James Zern 860f245de9 Merge changes Ib0c2f852,Ieb77661e,I56ea656e,Ibda734c2 into main
* changes:
  Add Neon implementations of vpx_highbd_sad_skip_<w>x<h>x4d
  Add Neon implementation of vpx_sad_skip_<w>x<h>x4d functions
  Add Neon implementation of vpx_highbd_sad_skip_<w>x<h> functions
  Add Neon implementation of vpx_sad_skip_<w>x<h> functions
2023-04-19 23:17:10 +00:00
Jonathan Wright ab830fe6a1 Add Neon implementations of vpx_highbd_sad_skip_<w>x<h>x4d
Add Neon implementations of high bitdepth downsampling SAD4D
functions for all block sizes.

Also add corresponding unit tests.

Change-Id: Ib0c2f852e269cbd6cbb8f4dfb54349654abb0adb
2023-04-19 00:57:25 +01:00
Jonathan Wright 42c0cbb9cb Add Neon implementation of vpx_sad_skip_<w>x<h>x4d functions
Add Neon implementations of standard bitdepth downsampling SAD4D
functions for all block sizes.

Also add corresponding unit tests.

Change-Id: Ieb77661ea2bbe357529862a5fb54956e34e8d758
2023-04-19 00:57:18 +01:00
Jonathan Wright 05b244af52 Add Neon implementation of vpx_highbd_sad_skip_<w>x<h> functions
Add Neon implementations of high bitdepth downsampling SAD functions
for all block sizes.

Also add corresponding unit tests.

Change-Id: I56ea656e9bb5f8b2aedfdc4637c9ab4e1951b31b
2023-04-19 00:57:08 +01:00
Jonathan Wright 7b7f84fe14 Add Neon implementation of vpx_sad_skip_<w>x<h> functions
Add Neon implementations of standard bitdepth downsampling SAD
functions for all block sizes.

Also add corresponding unit tests.

Change-Id: Ibda734c270278d947673ffcc29ef17a2f4970b01
2023-04-19 00:56:43 +01:00
James Zern e85f9003be Merge "mr_dissim: clear -Wshadow warning" into main 2023-04-18 23:51:04 +00:00
James Zern 873fd58973 Merge "onyx_if: clear -Wshadow warning" into main 2023-04-18 19:24:35 +00:00
James Zern 1dda358cb0 Merge "vp9_rdcost: clear -Wshadow warnings" into main 2023-04-18 19:19:45 +00:00
Yunqing Wang 3d7358796d Merge "Downsample SAD computation in motion search" into main 2023-04-18 16:11:01 +00:00
James Zern d725bdd8a1 vp9_tpl_model: clear -Wshadow warning
with --enable-experimental --enable-non-greedy-mv

Bug: webm:1793
Change-Id: I19e38d7196291ae1ffbb5fb3daa70a4fefd54c55
2023-04-17 22:09:17 -07:00
James Zern eef765751a mr_dissim: clear -Wshadow warning
Bug: webm:1793
Change-Id: I73ced43aba45215264134f917fd69ab0b1f10d01
2023-04-17 22:09:09 -07:00
James Zern 7bdce0887b onyx_if: clear -Wshadow warning
with --enable-internal-stats

Bug: webm:1793
Change-Id: I9d375e4cb45f78b82afe455f2c7ad2b56e217f7d
2023-04-17 22:09:02 -07:00
Yunqing Wang 8f14f66490 Merge "Add AVX2 intrinsic for vpx_fdct16x16() function" into main 2023-04-17 20:21:21 +00:00
Anupam Pandey e15c2e3445 Add AVX2 intrinsic for vpx_fdct16x16() function
Introduced AVX2 intrinsic to compute FDCT for block size
16x16 case. This is a bit-exact change.

Please check the module level scaling w.r.t C function (timer based)
for existing (SSE2) and new AVX2 intrinsics:

   Scaling
SSE2      AVX2
3.88x     5.95x

Change-Id: I02299c3746fcb52d808e2a75d30aa62652c816dc
2023-04-17 15:23:51 +05:30
James Zern bdba4591a7 vp9_rdcost: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I6d48038d74e510ecb5773dfffbdc4c10b765c2aa
2023-04-14 10:25:58 -07:00
Jerome Jiang 27171320f5 Merge "Add VP8RateControlRTC::GetLoopfilterLevel" into main 2023-04-14 17:25:07 +00:00
James Zern 11d6f069ee Merge "libs.mk: Fix wrong scope end comments" into main 2023-04-14 17:22:47 +00:00
L. E. Segovia dca0a8b860 libs.mk: Fix wrong scope end comments
I believe the following comments are wrongly scoped, possibly left over
from previous changesets. This made me very confused when reading the
test suite Makefile, in order to port it to Meson.

Change-Id: Ice3c7ba50c6909a9c7dfd4001afa1e1ddfa4b5ce
2023-04-14 10:41:20 +00:00
Jerome Jiang 536c986764 Add VP8RateControlRTC::GetLoopfilterLevel
New linear model to calculate loopfilter level from frame qp.

Linear regression was done on qvga, vga, and hd clips.

Bug: b/275304642
Change-Id: I552b312212bb4de21b53b762d139aa9588c64ae2
2023-04-13 17:02:51 -04:00
James Zern dfe285a6b9 Merge "vp9_frame_scale_ssse3: clear -Wshadow warnings" into main 2023-04-13 20:59:43 +00:00
James Zern e3c50aa072 Merge changes I2a26c929,I0b7f0136,Ib65a2dff into main
* changes:
  vpxenc: clear -Wshadow warnings
  vpxdec: clear -Wshadow warnings
  svc_encodeframe: clear -Wshadow warnings
2023-04-13 18:35:49 +00:00
James Zern ec2993d549 Merge changes I571a9d64,I22db73cb into main
* changes:
  dct_test: clear -Wshadow warnings
  convolve_test: clear -Wshadow warning
2023-04-13 18:35:21 +00:00
James Zern 329fa7009a Merge "vp9_pickmode: clear -Wshadow warnings" into main 2023-04-13 18:35:10 +00:00
James Zern 6c65608253 vpxenc: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I2a26c9297016d3fa2c32e8974ef3d7dab1e524c4
2023-04-12 14:57:28 -07:00
James Zern 556e4f6cad vpxdec: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I0b7f013682229cde50df7c62db9dab6eab0fd341
2023-04-12 14:57:28 -07:00
James Zern a3eb39ab6f svc_encodeframe: clear -Wshadow warnings
Bug: webm:1793
Change-Id: Ib65a2dff124034d8e653572f8ada65984e55ed70
2023-04-12 14:57:28 -07:00
James Zern 968960c7b3 dct_test: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I571a9d641b2f7f4b9d7c473ca815d4ea10b9f9af
2023-04-12 14:57:13 -07:00
James Zern 698eb779f2 convolve_test: clear -Wshadow warning
Bug: webm:1793
Change-Id: I22db73cb756c6c680b73684caef1e08bb6e729d8
2023-04-12 14:57:13 -07:00
James Zern ff4123215d vp9_frame_scale_ssse3: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I85608ac7bb6d3a61649ba342c13c3bf6a39a5dea
2023-04-12 14:56:16 -07:00
James Zern 39a6b6c136 vp9_temporal_filter: clear -Wshadow warnings
Bug: webm:1793
Change-Id: Ia681ce636ae99f95b875ee1b0189bc6fa66a7608
2023-04-12 14:56:00 -07:00
James Zern 2513f6d5f4 vp9_svc_layercontext: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I63669de9835713ec70dafa88ca8f2c2459e59698
2023-04-12 14:56:00 -07:00
James Zern aaffc6e306 vp9_pickmode: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I26c063818144d11c4c91165c3fcbf6f258453cc7
2023-04-12 14:55:45 -07:00
James Zern f254e6da84 vp9_speed_features: clear -Wshadow warning
Bug: webm:1793
Change-Id: I9f509c4461631e358f80b98afbb745ce88e9d7a2
2023-04-11 21:47:10 -07:00
James Zern bde26b9961 vp9_ratectrl: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I2476a9d8e1d62414fdbe6feee87d5167058f499b
2023-04-11 21:47:10 -07:00
James Zern e3c458149c vp9_mbgraph: clear -Wshadow warnings
Bug: webm:1793
Change-Id: Ibffb62775f09922d37f7d0460aa2751e74c36738
2023-04-11 19:16:28 -07:00
James Zern cd2ec5c3df Merge "vp9_quantize_avx2,highbd_get_max_lane_eob: fix mask" into main 2023-04-11 18:40:00 +00:00
Yunqing Wang 5f615708e4 Merge "Add assert to ensure NEARESTMV or NEWMV modes are not skipped" into main 2023-04-11 18:35:10 +00:00
Yunqing Wang 23d37b3d04 Merge "Avoid redundant start MV SAD calculation" into main 2023-04-11 18:31:25 +00:00
Deepa K G 232f8659aa Downsample SAD computation in motion search
Added a speed feature to skip every other row
in SAD computation during motion search.

                 Instruction Count        BD-Rate Loss(%)
cpu   Resolution   Reduction(%)    avg.psnr   ovr.psnr    ssim
 0       LOWRES2      0.958         0.0204     0.0095    0.0275
 0       MIDRES2      1.891        -0.0636     0.0032    0.0247
 0        HDRES2      2.869         0.0434     0.0345    0.0686
 0       Average      1.905         0.0000     0.0157    0.0403

STATS_CHANGED

Change-Id: I1a8692757ed0cbcb2259729b3ecfb0436cdf49ce
2023-04-11 19:11:51 +05:30
Cherma Rajan A 35c32b1d22 Add assert to ensure NEARESTMV or NEWMV modes are not skipped
Added an assert for prune_single_mode_based_on_mv_diff_mode_rate
speed feature. This ensures NEARMV or ZEROMV modes are pruned
only when NEARESTMV and NEWMV modes are not early terminated.

Change-Id: Id8b03eef6d1ef3f16714a9cbfde0c171c0c6fe0b
2023-04-11 17:15:08 +05:30
Deepa K G 987ed6937b Avoid redundant start MV SAD calculation
Avoided repeated calculation of start MV
SAD during full pixel motion search.

                 Instruction Count
cpu   Resolution   Reduction(%)
 0       LOWRES2      0.162
 0       MIDRES2      0.246
 0        HDRES2      0.325
 0       Average      0.245

Change-Id: I2b4786901f254ce32ee8ca8a3d56f1c9f112f1d4
2023-04-11 17:07:06 +05:30
James Zern 61709a177a vp9_quantize_avx2,highbd_get_max_lane_eob: fix mask
Pack nz_mask with zero. After the result is permuted this has the effect
of ignoring the upper half of the iscan register which is only loaded
with 128-bits. Depending on the optimization level and the load used the
upper half of the ymm register may contain undefined values which can
produce an incorrect eob. If this is large enough it can cause a crash.

Bug: chromium:1431729
Change-Id: I4ebae9fa39f228bdd29dcc19935f3f07759d75f5
2023-04-10 14:47:06 -07:00
Yunqing Wang 31b6d12892 Merge "Add AVX2 intrinsic for variance function for block width 8" into main 2023-04-10 18:50:09 +00:00
Yunqing Wang bd53ceef3a Merge "Prune single ref modes based on mv difference and mode rate" into main 2023-04-10 17:01:19 +00:00
James Zern 6fd360c684 Merge "Optimize Armv8.0 Neon SAD4D 16xh, 32xh, and 64xh functions" into main 2023-04-07 22:19:18 +00:00
James Zern 12ab4af3ae vp9_dx_iface: clear -Wshadow warnings
Bug: webm:1793
Change-Id: Ice6cd08f145e5813e24345d03e0913e5eda5289f
2023-04-06 15:37:40 -07:00
James Zern bebc860915 vp9_encoder: clear -Wshadow warning
Bug: webm:1793
Change-Id: Id390c61f82b9f15063d0310a2c252b02b479d9c5
2023-04-06 15:37:26 -07:00
James Zern 868674d330 vpx_subpixel_8t_intrin_avx2: clear -Wshadow warning
Bug: webm:1793
Change-Id: Icba4ad242dcd0cad736b9a203829361c5bd1ca3f
2023-04-06 12:57:23 -07:00
James Zern 3c0c01357f Merge "Optimize Neon paths of high bitdepth SAD and SAD4d for 8xh blocks" into main 2023-04-06 17:50:00 +00:00
Jonathan Wright ff8a965856 Optimize Armv8.0 Neon SAD4D 16xh, 32xh, and 64xh functions
Add a widening 4D reduction function operating on uint16x8_t vectors
and use it to optimize the final reduction in Armv8.0 Neon standard
bitdepth 16xh, 32xh and 64h SAD4D computations.

Also simplify the Armv8.0 Neon version of the sad64xhx4d_neon helper
function since VP9 block sizes are not large enough to require
widening to 32-bit accumulators before the final reduction.

Change-Id: I32b0a283d7688d8cdf21791add9476ed24c66a28
2023-04-06 17:41:01 +01:00
Jonathan Wright a5801b00a8 Optimize 4D Neon reduction for 4xh and 8xh SAD4D blocks
Add a 4D reduction function operating on uint16x8_t vectors and use
it to optimize the final reduction in standard bitdepth 4xh and 8xh
SAD4D computations. Similar 4D reduction optimizations have already
been implemented for all other standard bitdepth block sizes, and all
high bitdepth block sizes.[1]

[1] https://chromium-review.googlesource.com/c/webm/libvpx/+/4224681

Change-Id: I0aa0b6e0f70449776f316879cafc4b830e86ea51
2023-04-04 14:52:52 +01:00
Anupam Pandey e2465dfc25 Add AVX2 intrinsic for variance function for block width 8
Added AVX2 intrinsic optimization for the following functions
1. vpx_variance8x4
2. vpx_variance8x8
3. vpx_variance8x16

This is a bit-exact change.

                 Instruction Count
cpu   Resolution   Reduction(%)
 0       LOWRES2      0.698
 0       MIDRES2      0.577
 0        HDRES2      0.469
 0       Average      0.582

Change-Id: Iae8fdf9344fd012cda4955ed140633141d60ba86
2023-04-04 15:36:22 +05:30
James Zern 0f42bd3fb8 Merge changes Idaf49de6,I6d7d96ff,I0d64c923 into main
* changes:
  svc_datarate_test: clear -Wshadow warning
  vp9_mcomp.c: clear -Wshadow warnings
  vp9_rc_get_second_pass_params: clear -Wshadow warning
2023-03-30 22:44:51 +00:00
Cherma Rajan A 1025d37b03 Prune single ref modes based on mv difference and mode rate
This patch introduces a speed feature to prune single reference
modes - NEARMV and ZEROMV based on motion vector difference and
mode rate w.r.t previously evaluated single reference modes
corresponding to the same reference frame.

                Instruction Count        BD-Rate Loss(%)
cpu   Resolution   Reduction(%)    avg.psnr   ovr.psnr    ssim
 0       LOWRES2      1.686        -0.0039    -0.0105   -0.0098
 0       MIDRES2      1.026        -0.0234     0.0029    0.0120
 0        HDRES2      0.000         0.0000     0.0000    0.0000
 0       Average      0.889        -0.0091    -0.0025    0.0007

STATS_CHANGED

Change-Id: I387acd3a73d8256904a7ce684b198d251cf3dd04
2023-03-30 14:37:06 +05:30
George Steed a257b4d6be Avoid vshr and vget_{low,high} in Neon d135 predictor impl
The shift instructions have marginally worse performance on some
micro-architectures, and the vget_{low,high} instructions are
unnecessary.

This commit improves performance of the d135 predictors by 1.5% geomean
averaged across a range of compilers and micro-architectures.

Change-Id: Ied4c3eecc12fc973841696459d868ce403ed4e6c
2023-03-30 09:00:26 +00:00
George Steed c1c7dd3138 Use sum_neon.h helpers in Neon DC predictors
Use sum_neon.h helpers for horizontal reductions in Neon DC predictors,
enabling use of dedicated Neon reduction instructions on AArch64. Some
of the surrounding code is also optimized to remove redundant broadcast
instructions in the dc_store helpers.

Performance is largely unchanged on both the standard as well as the
high bit-depth predictors. The main improvement appears to be the 16x16
standard-bitdepth dc predictor, which improves by 10-15% when
benchmarked on Neoverse N1.

Change-Id: Ibfcc6ecf4b1b2f87ce1e1f63c314d0cc35a0c76f
2023-03-30 09:00:19 +00:00
James Zern 01d282ac95 Merge changes Ie4ffa298,If5ec220a,I670dc379 into main
* changes:
  Avoid LD2/ST2 instructions in highbd v predictors in Neon
  Avoid interleaving loads/stores in Neon for highbd dc predictor
  Avoid LD2/ST2 instructions in vpx_dc_predictor_32x32_neon
2023-03-29 20:52:46 +00:00
Jerome Jiang e47676c11c Merge "svc: Fix a case where target bandwidth is 0" into main 2023-03-29 18:24:18 +00:00
Jerome Jiang 0f893ea0b6 svc: Fix a case where target bandwidth is 0
Bug: webrtc:15033
Change-Id: Iea2997c2ce8982f106a1eed3ec4f7dd1c6e83666
2023-03-29 13:06:19 -04:00
Salome Thirot cf1efecebf Optimize Neon paths of high bitdepth SAD and SAD4d for 8xh blocks
For these block sizes there is no need to widen to 32-bits until the
final reduction, so use a single vabaq instead of vabd + vpadalq.

Change-Id: I9c19d620f7bb8b3a6b0bedd37789c03bb628b563
2023-03-29 16:50:34 +01:00
George Steed 9824167ad2 Avoid LD2/ST2 instructions in highbd v predictors in Neon
The interleaving load/store instructions (LD2/LD3/LD4 and ST2/ST3/ST4)
are useful if we are dealing with interleaved data (e.g. real/imag
components of complex numbers), but for simply loading or storing larger
quantities of data it is preferable to simply use the normal load/store
instructions.

This patch replaces such occurrences in the two larger block sizes:
vpx_highbd_v_predictor_16x16_neon and vpx_highbd_v_predictor_32x32_neon.

Change-Id: Ie4ffa298a2466ceaf893566fd0aefe3f66f439e4
2023-03-29 08:39:35 +00:00
George Steed 83def747ff Avoid interleaving loads/stores in Neon for highbd dc predictor
The interleaving load/store instructions (LD2/LD3/LD4 and ST2/ST3/ST4)
are useful if we are dealing with interleaved data (e.g. real/imag
components of complex numbers), but for simply loading or storing larger
quantities of data it is preferable to simply use two or more of the
normal load/store instructions.

This patch replaces such occurrences in the two larger block sizes:
vpx_highbd_dc_predictor_16x16_neon, vpx_highbd_dc_predictor_32x32_neon,
and related helper functions.

Speedups over the original Neon code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 | 16x16 |    1.25
Neoverse N1 |  LLVM 15 | 32x32 |    1.13
Neoverse N1 |   GCC 12 | 16x16 |    1.56
Neoverse N1 |   GCC 12 | 32x32 |    1.52
Neoverse V1 |  LLVM 15 | 16x16 |    1.63
Neoverse V1 |  LLVM 15 | 32x32 |    1.08
Neoverse V1 |   GCC 12 | 16x16 |    1.59
Neoverse V1 |   GCC 12 | 32x32 |    1.37

Change-Id: If5ec220aba9dd19785454eabb0f3d6affec0cc8b
2023-03-29 08:39:35 +00:00
George Steed 4cf9819282 Avoid LD2/ST2 instructions in vpx_dc_predictor_32x32_neon
The LD2 and ST2 instructions are useful if we are dealing with
interleaved data (e.g. real/imag components of complex numbers), but for
simply loading or storing larger quantities of data it is preferable to
simply use two of the normal load/store instructions.

This patch replaces such occurrences in vpx_dc_predictor_32x32_neon and
related functions.

With Clang-15 this speeds up this function by 10-30% depending on the
micro-architecture being benchmarked on. With GCC-12 this speeds up the
function by 40-60% depending on the micro-architecture being benchmarked
on.

Change-Id: I670dc37908aa238f360104efd74d6c2108ecf945
2023-03-29 08:39:35 +00:00
Yunqing Wang 6d0e5e56ae Merge "Add AVX2 for convolve vertical filter for block width 4" into main 2023-03-28 22:14:51 +00:00
James Zern aba570ac95 Merge changes If83ff1ad,I8fb00a15,Iaad58e77,Iac166d60 into main
* changes:
  Randomize second half of above_row_ in intrapred tests for Neon
  Allow non-uniform above array in d63 predictor Neon impl
  Allow non-uniform above array in d45 predictor Neon impl
  Allow non-uniform above array in highbd d45 predictor Neon impl
2023-03-28 20:14:12 +00:00
James Zern 8e58d504fa Merge "update libwebm to libwebm-1.0.0.29-9-g1930e3c" into main 2023-03-28 18:36:01 +00:00
Jerome Jiang 972149cafe svc: Fix a case where target bandwidth is 0
Bug: webrtc:15033
Change-Id: I28636de66842671b03284408186c4c18254109a5
2023-03-28 11:26:54 -04:00
George Steed 100ca0356d Randomize second half of above_row_ in intrapred tests for Neon
The existing tests duplicate `above_row_[block_size - 1]` after the
first `block_size` elements, which can lead to tests incorrectly passing
due to differing behaviour when calculating the average for the last
elements of the output.

This change adjusts the above array setup to be fully random instead,
allowing us to catch such issues here rather than in other larger tests
like the external MD5 tests.

It doesn't appear that other architectures are fully clean with this
change so restrict it to just Neon for now until they are fixed.

Bug: webm:1797
Change-Id: If83ff1adbf1e8d30f2a92474d7186c65840a5d0b
2023-03-28 13:46:11 +00:00
George Steed 911d6e165e Allow non-uniform above array in d63 predictor Neon impl
The existing standard bitdepth implementation doesn't appear to manifest
as a failure in any of the predictor or MD5 tests, but it does rely on
the predictor tests filling the second `bs` elements of the `above`
input array with copies of `above[bs - 1]` in order to match the C
implementation.

This patch adjusts the Neon implementation to correctly match the C
implementation in the case where the elements of the `above` array all
differ.

The geomean of performance for the predictor is approximately a 2%
slowdown compared to the previous vectorized implementation. This is
still considerably faster than the unspecialized naive C implementation.

Bug: webm:1797
Change-Id: I8fb00a154288d54b24a72a7ff63c816bdcf3aca3
2023-03-28 13:27:22 +00:00
George Steed 3eb3781589 Allow non-uniform above array in d45 predictor Neon impl
The existing implementation doesn't appear to manifest as a failure in
any of the predictor or MD5 tests, but it does rely on the predictor
tests filling the second `bs` elements of the `above` input array with
copies of `above[bs - 1]` in order to match the C implementation.

This patch adjusts the Neon implementation to correctly match the C
implementation in the case where the elements of the `above` array all
differ.

Performance of the predictor is mostly unchanged, except for the 32x32
block size where it appears to have gotten about 40% faster when
compiled with clang-15.

Bug: webm:1797
Change-Id: Iaad58e77c5467307a3c80d6989b7cf2988e09311
2023-03-28 13:27:11 +00:00
George Steed 25825f6a78 Allow non-uniform above array in highbd d45 predictor Neon impl
The existing implementation doesn't appear to manifest as a failure in
any of the predictor or MD5 tests, but it does rely on the predictor
tests filling the second `bs` elements of the `above` input array with
copies of `above[bs - 1]` in order to match the C implementation.

This patch adjusts the Neon implementation to correctly match the C
implementation in the case where the elements of the `above` array all
differ.

Performance of the predictor is mostly unchanged, except for the 16x16
block size where it appears to have gotten marginally faster across most
compiler/micro-architecture combinations.

Bug: webm:1797
Change-Id: Iac166d6047316c0382e0f2790ce780fc99674b43
2023-03-28 08:29:01 +00:00
Anupam Pandey b4d154c948 Add AVX2 for convolve vertical filter for block width 4
Introduced AVX2 intrinsic to compute convolve vertical for
w = 4 case. This is a bit-exact change.

                 Instruction Count
cpu   Resolution   Reduction(%)
 0       LOWRES2      0.364
 0       MIDRES2      0.236
 0        HDRES2      0.162
 0       Average      0.254

Change-Id: I413f58aa6333a6f2421d4c10d49dec01e55b2098
2023-03-28 10:01:03 +05:30
James Zern 8f17482e82 vp9_rdopt,block_rd_txfm: fix clang-tidy warning
argument name 'recon' in comment does not match parameter name
'out_recon'.

https://clang.llvm.org/extra/clang-tidy/checks/bugprone/argument-comment.html

+ normalize similar calls, using /*var=*/NULL to better match the style
  guidelines

https://google.github.io/styleguide/cppguide.html#Function_Argument_Comments

Change-Id: I089591317f7138965735f737c1536a8b16fcd4e4
2023-03-27 16:20:22 -07:00
James Zern 66885a69ff svc_datarate_test: clear -Wshadow warning
rename class member from ref_frame_config to the correct style:
ref_frame_config_.

Bug: webm:1793
Change-Id: Idaf49de6d724014adee75f81efe974b2031241ba
2023-03-24 11:23:12 -07:00
James Zern 89765feb99 vp9_mcomp.c: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I6d7d96ffb3e388eac94d1d41563f7079a8297c85
2023-03-24 11:23:12 -07:00
James Zern 601904d1f7 vp9_rc_get_second_pass_params: clear -Wshadow warning
Bug: webm:1793
Change-Id: I0d64c9234b4bdcfb49a06566dc41df26f5862c1f
2023-03-24 11:23:12 -07:00
James Zern 5b05f6f3a0 Merge changes Ide512788,I77c7abae into main
* changes:
  vp9_scan.h: rename scan_order struct to ScanOrder
  vp9_encodeframe.c: clear -Wshadow warnings
2023-03-24 18:04:19 +00:00
James Zern bad39ce7a3 vp9_scan.h: rename scan_order struct to ScanOrder
This matches the style guide and fixes some -Wshadow warnings related to
variables with the same name. Something similar was done in libaom in:
03f6fdcfca Fix warnings reported by -Wshadow: Part1b: scan_order struct
           and variable

Bug: webm:1793
Change-Id: Ide5127886b7fd7778e6d8a983bfba6edda21ff28
2023-03-24 09:35:55 -07:00
James Zern 1701d55e33 vp9_encodeframe.c: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I77c7abae7bbb1e1f4972cd31e3a67d62477b896e
2023-03-23 19:21:27 -07:00
James Zern cda56fa019 update libwebm to libwebm-1.0.0.29-9-g1930e3c
changelog:
https://chromium.googlesource.com/webm/libwebm/+log/ee0bab576..1930e3ca2

Bug: webm:1792
Change-Id: I5c5c30c767d357528f102ff38957655e2ec0c645
2023-03-23 19:14:31 -07:00
Wan-Teh Chang 5817bce969 Fix comment typos (likely copy-and-paste errors)
Fix comment typos for vpx_codec_destroy() and vpx_codec_enc_init_ver().

Based on the change made in libaom:
https://aomedia.googlesource.com/aom/+/365a968684
365a968684 Fix comment typos (likely copy-and-paste errors)

Change-Id: I39edae835ed0752b569e8e7328d0709c59724ac2
2023-03-23 17:54:35 -07:00
James Zern 81250791dd Merge "Add Neon implementations of vpx_highbd_avg_<w>x<h>_c" into main 2023-03-23 21:40:13 +00:00
James Zern 5afeb89867 Merge "test.mk: use CONFIG_VP(8|9)_ENCODER for vp8/vp9-only tests" into main 2023-03-23 17:22:28 +00:00
James Zern 27424a8176 Merge "svc_encodeframe.c: fix -Wstringop-truncation" into main 2023-03-23 17:21:57 +00:00
Jerome Jiang ccb0597e4b Merge "Revert "Add codec control to get tpl stats"" into main 2023-03-22 20:48:44 +00:00
Jerome Jiang 78bb8e1c0a Revert "Add codec control to get tpl stats"
This reverts commit 9c15fb62b3.

Reason for revert:

vpxenc should only use public interface

Original change's description:
> Add codec control to get tpl stats
>
> Add command line flag to vpxenc to export tpl stats
>
> Bug: b/273736974
> Change-Id: I6980096531b0c12fbf7a307fdef4c562d0c29e32

Bug: b/273736974
Change-Id: Ifa8951bb34e5936bbfc33086b22e9fc36d379bc9
2023-03-22 20:18:39 +00:00
Wan-Teh Chang a0bf98de0d Merge "Change UpdateRateControl() to return bool" into main 2023-03-22 16:09:24 +00:00
Salome Thirot 5c7867beac Add Neon implementations of vpx_highbd_avg_<w>x<h>_c
Add Neon implementation of vpx_highbd_avg_4x4_c and vpx_highbd_avg_8x8_c
as well as the corresponding tests.

Change-Id: Ib1b06af5206774347690c9c56e194b76aa409c91
2023-03-22 10:50:17 +00:00
James Zern 882399bd54 Merge changes I8abac3c9,If678fc19 into main
* changes:
  vp9_bitstream.c: clear -Wshadow warnings
  vp9_setup_mask: clear -Wshadow warnings
2023-03-22 02:14:12 +00:00
James Zern 0a5f886a0c Merge changes I650b305c,If3e4cf37,I4c791e3a into main
* changes:
  sixtappredict_neon.c: remove redundant returns
  sixtappredict_neon.c,cosmetics: fix a typo
  vp8_sixtap_predict16x16_neon: fix overread
2023-03-21 20:20:51 +00:00
Jerome Jiang 9c643a5ef2 Merge "Add codec control to get tpl stats" into main 2023-03-21 18:34:34 +00:00
James Zern d3c9e39635 Merge "Reland "quantize: use scan_order instead of passing scan/iscan"" into main 2023-03-21 00:33:00 +00:00
James Zern 3b6909977c test.mk: use CONFIG_VP(8|9)_ENCODER for vp8/vp9-only tests
fixes some uninstantiated test failures when configured with
--disable-vp8 or --disable-vp9

Change-Id: If9a6705bd070edee02306e89da103ed474688ec8
2023-03-20 17:28:11 -07:00
James Zern 1c37aefcbd svc_encodeframe.c: fix -Wstringop-truncation
use sizeof(buf) - 1 with strncpy.

fixes:
examples/svc_encodeframe.c:282:3: warning: ‘strncpy’ specified bound
1024 equals destination size [-Wstringop-truncation]
  282 |   strncpy(si->options, options, sizeof(si->options));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I46980872f9865ae1dc2b56330c3a65d8bc6cf1f7
2023-03-20 17:09:42 -07:00
James Zern 44250287fb sixtappredict_neon.c: remove redundant returns
Change-Id: I650b305c2599fc32353daba030e6241d330796a7
2023-03-20 16:58:28 -07:00
James Zern faa9142f5d sixtappredict_neon.c,cosmetics: fix a typo
Change-Id: If3e4cf372fc6ed076f0d42c435a72262494aab68
2023-03-20 16:56:58 -07:00
James Zern e4f0df53ec vp8_sixtap_predict16x16_neon: fix overread
Shift the final read from the source by 3 to avoid breaking the
assumption that the 6-tap filter needs only 5 pixels outside of the
macroblock; this matches the sse2 and ssse3 implementations.

It's possible this restriction could be removed if the source buffers
are assumed to be padded.

Bug: webm:1795
Change-Id: I4c791e3a214898a503c78f4cedca154c75cdbaef
Fixed: webm:1795
2023-03-20 16:51:51 -07:00
Yunqing Wang c0f11c7f6c Merge "Skip trellis coeff opt based on tx block properties" into main 2023-03-20 16:35:44 +00:00
Yunqing Wang 97aa7b2a4c Merge "Refactor logic of skipping trellis coeff opt" into main 2023-03-20 16:27:53 +00:00
Jerome Jiang 9c15fb62b3 Add codec control to get tpl stats
Add command line flag to vpxenc to export tpl stats

Bug: b/273736974
Change-Id: I6980096531b0c12fbf7a307fdef4c562d0c29e32
2023-03-20 12:02:38 -04:00
Deepa K G 55e102dc54 Skip trellis coeff opt based on tx block properties
The trellis coefficient optimization is skipped for blocks
with larger residual mse.

                 Instruction Count        BD-Rate Loss(%)
cpu   Resolution   Reduction(%)    avg.psnr   ovr.psnr    ssim
 0       LOWRES2      9.467        0.0921     0.1057    0.0362
 0       MIDRES2      4.328       -0.0155     0.0694    0.0178
 0        HDRES2      1.858        0.0231     0.0214   -0.0034
 0       Average      5.218        0.0332     0.0655    0.0169

STATS_CHANGED

Change-Id: I321a9b1a34ebb59b7b6a065b5b2d717c8767a4a5
2023-03-19 23:12:04 +05:30
Deepa K G 405ae85666 Refactor logic of skipping trellis coeff opt
The code to enable trellis coefficient optimization
is refactored using the sf 'trellis_opt_tx_rd'. This
change facilitates adaptive skipping of trellis
optimization based on block properties.

Change-Id: Ia1ff7cbbe5acf86414410f62655d46c099387847
2023-03-19 22:13:11 +05:30
James Zern 492f4c5538 vp9_bitstream.c: clear -Wshadow warnings
Bug: webm:1793
Change-Id: I8abac3c901ad24b642b39ea6e6081d8ba626853d
2023-03-17 19:33:50 -07:00
James Zern cb5b047ad8 vp9_setup_mask: clear -Wshadow warnings
Bug: webm:1793
Change-Id: If678fc195ef87cc634d31fb7b24e0c844a5cb7b0
2023-03-17 19:24:20 -07:00
Johann f23f27bb80 Reland "quantize: use scan_order instead of passing scan/iscan"
This is a reland of commit 14fc40040f

Parent change fixed in crrev.com/c/webm/libvpx/+/4305500

Original change's description:
> quantize: use scan_order instead of passing scan/iscan
>
> further reduces the arguments for the 32x32. This will be applied to the base
> version as well.
>
> Change-Id: I25a162b5248b14af53d9e20c6a7fa2a77028a6d1

Change-Id: I2a7654558eaddd68bd09336bf317b297f18559d2
2023-03-18 06:39:45 +09:00
James Zern 6788c75055 Merge changes I5d9444a2,I1f127df9 into main
* changes:
  Add Neon implementation of vpx_highbd_minmax_8x8_c
  Add tests for vpx_highbd_minmax_8x8_c
2023-03-17 20:35:24 +00:00
James Zern d446ddd32d Merge "Reland "quantize: simplifly highbd 32x32_b args"" into main 2023-03-17 20:32:11 +00:00
Salome Thirot fff4e76b55 Add Neon implementation of vpx_highbd_minmax_8x8_c
Add Neon implementation of vpx_highbd_minmax_8x8_c as well as the
corresponding tests.

Change-Id: I5d9444a239fb1baa53634c1bdb5292b44067d90c
2023-03-17 18:40:41 +00:00
Salome Thirot c6da2329b9 Add tests for vpx_highbd_minmax_8x8_c
Write tests for vpx_highbd_minmax_8x8_c, and fix initial value of min in
vpx_highbd_minmax_8x8_c.

Change-Id: I1f127df945bbb8c7d373c5430ff5f94f28575968
2023-03-17 18:40:41 +00:00
Johann 02fd7d6aeb Reland "quantize: simplifly highbd 32x32_b args"
This is a reland of commit 573f5e662b

Alignment issue with tests fixed in crrev.com/c/webm/libvpx/+/4305500

Original change's description:
> quantize: simplify highbd 32x32_b args
>
> Change-Id: I431a41279c4c4193bc70cfe819da6ea7e1d2fba1

Change-Id: Ic868b6f987c99d88672858fedd092fa49c125e19
2023-03-17 12:52:15 +00:00
Wan-Teh Chang 430c6c1553 Change UpdateRateControl() to return bool
Change the VP9RateControlRtcConfig constructor to initialize
ss_number_layers (to 1).

Change UpdateRateControl() to return bool so that it can report failure
(due to invalid configuration).

Also change InitRateControl() to return bool to propagate the return
value of UpdateRateControl().

Note: This is a port of the libaom CL
https://aomedia-review.googlesource.com/c/aom/+/172042.

Change-Id: I90b60353b5f15692dba5d89e7b1a9c81bb2fdd89
2023-03-16 19:55:41 -07:00
Wan-Teh Chang af63e31978 Merge "Set oxcf->ts_rate_decimator[tl] only once" into main 2023-03-17 02:54:21 +00:00
Wan-Teh Chang d92681b06f Set oxcf->ts_rate_decimator[tl] only once
The code that sets oxcf->ts_rate_decimator[tl] does not need to be
inside a loop that iterates over sl. Move the code out of the sl loop so
that oxcf->ts_rate_decimator[tl] is set only once.

Change-Id: I22f6c117d200ec38a757b749a8700660d15436c1
2023-03-16 18:36:13 -07:00
Wan-Teh Chang d6b6f85063 Remove repeated field from VP9RateControlRtcConfig
Remove the `ts_number_layers` field from VP9RateControlRtcConfig because
the base class VpxRateControlRtcConfig already has that field.

Note: In commit 65a1751e5b,
`ts_number_layers` was moved to the newly created base class
VpxRateControlRtcConfig but was inadvertently left in
VP9RateControlRtcConfig:
https://chromium-review.googlesource.com/c/webm/libvpx/+/3140048,

Change-Id: I98d48e152683ec2e5e62efffb56b7f010c5d0695
2023-03-16 15:32:02 -07:00
Wan-Teh Chang 4265e364ff Merge "Update the sample code for VP9RateControlRTC" into main 2023-03-16 21:40:14 +00:00
Yunqing Wang 5ca4953569 Merge "Add AVX2 for convolve horizontal filter for block width 4" into main 2023-03-16 20:44:11 +00:00
Wan-Teh Chang d67a0021e7 Update the sample code for VP9RateControlRTC
Update the sample code to the current VP9RateControlRTC interface.

Change-Id: I30b0712c897f93fd62ebce51ce39afce3cac1fd7
2023-03-16 13:37:56 -07:00
Anupam Pandey 5c2cd048a0 Add AVX2 for convolve horizontal filter for block width 4
Introduced AVX2 intrinsic to compute convolve horizontal for
w = 4 case. This is a bit-exact change.

                 Instruction Count
cpu   Resolution   Reduction(%)
 0       LOWRES2      0.763
 0       MIDRES2      0.466
 0        HDRES2      0.317
 0       Average      0.516

Change-Id: I124f3f8e994c24461812f4963b113819466db44f
2023-03-16 08:48:45 +05:30
Salome Thirot 362c69cfe5 Optimize vpx_minmax_8x8_neon for aarch64
Optimize vpx_minmax_8x8_neon on AArch64 targets by using the UMAXV and
UMINV instructions - computing the maximum and minimum elements in a
Neon vector.

Change-Id: I54c3a3a087d266f6774e6113e5947253df288a64
2023-03-14 22:43:04 +00:00
James Zern bbd6bc85a3 Merge "Add Neon implementation of vpx_highbd_satd_c" into main 2023-03-14 19:38:04 +00:00
James Zern f4400abb25 Merge "Optimize vpx_satd_neon" into main 2023-03-14 19:32:32 +00:00
James Zern bfe0ec066b Merge "Add Neon implementation of vp9_highbd_block_error_c" into main 2023-03-14 19:31:02 +00:00
Salome Thirot be84aa14dc Add Neon implementation of vpx_highbd_satd_c
Add Neon implementation of vpx_highbd_satd_c as well as the
corresponding tests.

Change-Id: I3d50e6abdf168fb13743e7d8da9364f072308b7f
2023-03-14 09:32:42 +00:00
Salome Thirot f7dbd848e4 Optimize vpx_satd_neon
Optimize Neon implementation of vpx_satd by using ABD and UADALP instead
of ABAL and ABAL2, splitting the accumulator and using a dedicated
helper function to perform the final reduction.

Change-Id: Idcfa49e001b68b1dcd87c13fd9acc317a208cd2a
2023-03-14 09:24:39 +00:00
Salome Thirot e553e3acff Add Neon implementation of vp9_highbd_block_error_c
Add Neon implementation of vp9_highbd_block_error_c as well as the
corresponding tests.

Change-Id: Ibe0eb077f959ced0dcd7d0d8d9d529d3b5bc1874
2023-03-14 09:11:43 +00:00
Konstantinos Margaritis 29beea8243 [NEON] Add temporal filter functions, 8-bit and highbd
Both are around 3x faster than original C version. 8-bit gives a
small 0.5% speed increase, whereas highbd gives ~2.5%.

Change-Id: I71d75ddd2757b19aa201e879fd9fa8f3a25431ad
2023-03-14 08:22:40 +00:00
James Zern d32a410880 Merge "Fix buffer overrun in highbd Neon subpel variance filters" into main 2023-03-14 00:22:31 +00:00
Matt Oliver c21151bf84 project: Update for 1.13.0 merge. 2023-03-12 03:00:05 +11:00
Matt Oliver cdedb9afd4 Merge commit 'd6eb9696aa72473c1a11d34d928d35a3acc0c9a9' 2023-03-12 01:59:24 +11:00
James Zern f40c89459f Merge "reland: quantize: simplify 32x32_b args" into main 2023-03-10 21:40:59 +00:00
Yunqing Wang d40a8608cc Merge "Add AVX2 for vpx_filter_block1d8_v8() function" into main 2023-03-10 01:02:25 +00:00
Anupam Pandey 775d594e46 Add AVX2 for vpx_filter_block1d8_v8() function
Introduced AVX2 intrinsic to compute convolve vertical for
w = 8 case. This is a bit-exact change.

                 Instruction Count
cpu   Resolution   Reduction(%)
 0       LOWRES2      1.347
 0       MIDRES2      1.046
 0        HDRES2      0.805
 0       Average      1.066

Change-Id: Idf77fff054beaf2c985b9bf2335591bda47e811f
2023-03-09 16:50:40 +05:30
Neeraj Gadgil 4959770032 Rename function 'model_rd_for_sb_earlyterm'
Function renamed as 'build_inter_pred_model_rd_earlyterm' and
added a comment to explain its behavior.

Change-Id: I804e6273558ba36241232f62cf18ea754b85e369
2023-03-09 15:22:51 +05:30
Jonathan Wright eab52a4f3c Fix buffer overrun in highbd Neon subpel variance filters
The high bitdepth Neon code applying the first pass of the bilinear
filter for subpixel variance on blocks of width 4 processed two rows
at a time. This resulted in a source buffer overread, attempting to
produce two rows of padding for the second (vertical) pass of the
bilinear filter.

This patch modifies highbd_var_filter_block2d_bil_w4 and
highbd_avg_pred_var_filter_block2d_bil_w4 such that they only process
a single row per iteration, and only require a single row of padding
for the second pass. This prevents the buffer overread.

Since all block sizes are now processed one row at a time, there is
no need for a "padding" macro parameter - the value is always 1, with
no special case for 4xh blocks. As well as re-enabling the Neon paths
and their associated tests, we remove the now-redundant 'padding'
macro parameter.

Bug: webm:1796
Change-Id: Icd6076b38eb4476139795bb1734ca800c9edf079
2023-03-08 23:40:14 +00:00
James Zern 79b1347a51 Merge "disable vpx_highbd_*_sub_pixel_avg_variance4x{4,8}_neon" into main 2023-03-08 23:05:08 +00:00
James Zern 7a47294675 Merge "Optimize vpx_sum_squares_2d_i16_neon" into main 2023-03-08 21:54:30 +00:00
James Zern a47967700d disable vpx_highbd_*_sub_pixel_avg_variance4x{4,8}_neon
vpx_highbd_8_sub_pixel_avg_variance4x4_neon
vpx_highbd_8_sub_pixel_avg_variance4x8_neon
vpx_highbd_10_sub_pixel_avg_variance4x4_neon
vpx_highbd_10_sub_pixel_avg_variance4x8_neon
vpx_highbd_12_sub_pixel_avg_variance4x4_neon
vpx_highbd_12_sub_pixel_avg_variance4x8_neon

all cause heap overflows of the form:

i[ RUN      ] NEON/VpxHBDSubpelAvgVarianceTest.Ref/33
=================================================================
==535205==ERROR: AddressSanitizer: heap-buffer-overflow on address
0xffff95bb0b89 at pc 0x00000116dabc bp 0xffffd09f6430 sp 0xffffd09f6428
READ of size 8 at 0xffff95bb0b89 thread T0
    #0 0x116dab8 in load_unaligned_u16q vpx_dsp/arm/mem_neon.h:176:3
    #1 0x116dab8 in highbd_var_filter_block2d_bil_w4
       vpx_dsp/arm/highbd_subpel_variance_neon.c:49:21
    #2 0x116dab8 in vpx_highbd_8_sub_pixel_avg_variance4x4_neon
       vpx_dsp/arm/highbd_subpel_variance_neon.c:543:1
    ...

0xffff95bb0b89 is located 0 bytes to the right of 73-byte region
[0xffff95bb0b40,0xffff95bb0b89)
allocated by thread T0 here:
    #0 0x5f18b0 in malloc (test_libvpx+0x5f18b0)
    #1 0xce4a40 in vpx_memalign vpx_mem/vpx_mem.c:62:10
    #2 0xce4a40 in vpx_malloc vpx_mem/vpx_mem.c:70:40
    #3 0xa52238 in (anonymous namespace)::SubpelVarianceTest<unsigned
       int (*)(unsigned char const*, int, int, int, unsigned char
               const*, int, unsigned int*, unsigned char
               const*)>::SetUp()
       test/variance_test.cc:586:14
    ...

This is the same issue as:
  e33d4c276 disable vpx_highbd_*_sub_pixel_variance4x{4,8}_neon
They have highbd_var_filter_block2d_bil_w4 in common.

Bug: webm:1796
Change-Id: I3ed70d0ba22e127720542612ea9f6665948eedfc
2023-03-08 13:17:17 -08:00
James Zern e33d4c276d disable vpx_highbd_*_sub_pixel_variance4x{4,8}_neon
vpx_highbd_8_sub_pixel_variance4x4_neon
vpx_highbd_8_sub_pixel_variance4x8_neon
vpx_highbd_10_sub_pixel_variance4x4_neon
vpx_highbd_10_sub_pixel_variance4x8_neon
vpx_highbd_12_sub_pixel_variance4x4_neon
vpx_highbd_12_sub_pixel_variance4x8_neon

all cause heap overflows of the form:

[ RUN      ] NEON/VpxHBDSubpelVarianceTest.Ref/24
=================================================================
==450528==ERROR: AddressSanitizer: heap-buffer-overflow on address
0xffff8311a571 at pc 0x0000010ca52c bp 0xffffc63e96b0 sp 0xffffc63e96a8
READ of size 8 at 0xffff8311a571 thread T0
    #0 0x10ca528 in load_unaligned_u16q vpx_dsp/arm/mem_neon.h:176:3
    #1 0x10ca528 in highbd_var_filter_block2d_bil_w4
       vpx_dsp/arm/highbd_subpel_variance_neon.c:49:21
    #2 0x10ca528 in vpx_highbd_10_sub_pixel_variance4x8_neon
       vpx_dsp/arm/highbd_subpel_variance_neon.c:257:1
    ...

0xffff8311a571 is located 0 bytes to the right of 113-byte region
[0xffff8311a500,0xffff8311a571)
allocated by thread T0 here:
    #0 0x5f18b0 in malloc (test_libvpx+0x5f18b0)
    #1 0xce4f90 in vpx_memalign vpx_mem/vpx_mem.c:62:10
    #2 0xce4f90 in vpx_malloc vpx_mem/vpx_mem.c:70:40
    #3 0xa4ad44 in (anonymous namespace)::SubpelVarianceTest<unsigned
       int (*)(unsigned char const*, int, int, int, unsigned char
       const*, int, unsigned int*)>::SetUp() test/variance_test.cc:586:14

Bug: webm:1796
Change-Id: I39f7f936bae2bcbbe1f803fb10375ec02d1c1277
2023-03-07 22:16:56 -08:00
James Zern 0f17aa986a Merge "[SSE4_1] Fix overflow in highbd temporal_filter" into main 2023-03-07 23:40:10 +00:00
James Zern ccdcba6dc9 Merge changes I79247b5a,Ic6016cf8,Ibab7ec5f into main
* changes:
  Add Neon implementation of vp9_block_error_c
  Fix return type of horizontal_add_int64x2 helper
  Optimize vp9_block_error_fp_neon
2023-03-07 23:00:19 +00:00
James Zern 13bd85f687 Merge changes Ic021e82e,I2bce6f19,I250ab56e,I910692b1,Iefaa774d into main
* changes:
  Implement highbd_d207_predictor using Neon
  Implement highbd_d153_predictor using Neon
  Implement d207_predictor using Neon
  Implement d153_predictor using Neon
  Implement highbd_d63_predictor using Neon
2023-03-07 22:48:54 +00:00
Yunqing Wang 8874873bef Merge "Add AVX2 for vpx_filter_block1d8_h8() function" into main 2023-03-07 16:40:52 +00:00
Yunqing Wang ba3d606630 Merge "Use cb pattern for interp eval when filter is not switchable" into main 2023-03-07 16:37:22 +00:00
Yunqing Wang f138a4004d Merge "Early terminate interp filt search based on best RD cost" into main 2023-03-07 16:35:18 +00:00
Anupam Pandey b7fabadc5d Add AVX2 for vpx_filter_block1d8_h8() function
Introduced AVX2 intrinsic to compute convolve horizontal for
w = 8 case. This is a bit-exact change.

                 Instruction Count
cpu   Resolution   Reduction(%)
 0       LOWRES2      1.509
 0       MIDRES2      1.165
 0        HDRES2      0.898
 0       Average      1.191

Change-Id: I699c94aa3d7ea74c58f901df906eed0b81b4ee79
2023-03-07 18:20:30 +05:30
Salome Thirot eec4808393 Add Neon implementation of vp9_block_error_c
Add Neon implementation of vp9_block_error_c as well as the
corresponding tests.

Change-Id: I79247b5ae24f51b7b55fc5e517d5e403dc86367a
2023-03-07 12:04:25 +00:00
Salome Thirot 57c6ea9752 Fix return type of horizontal_add_int64x2 helper
horizontal_add_int64x2 was incorrectly returning a uint64_t instead of
an int64_t. This patch fixes that.

Change-Id: Ic6016cf87aebfc6a14f540b784d6648757e12b49
2023-03-07 11:34:05 +00:00
Salome Thirot 5ae84ea5ae Optimize vp9_block_error_fp_neon
Currently vp9_block_error_fp_neon is only used when
CONFIG_VP9_HIGHBITDEPTH is set to false. This patch optimizes the
implementation and uses tran_low_t instead of int16_t so that the
function can also be used in builds where vp9_highbitdepth is enabled.

Change-Id: Ibab7ec5f74b7652fa2ae5edf328f9ec587088fd3
2023-03-07 11:29:31 +00:00
Neeraj Gadgil b9933679bf Use cb pattern for interp eval when filter is not switchable
This CL uses a checkerboard pattern for interp filter eval when
the filter is not switchable.

                 Instruction Count        BD-Rate Loss(%)
cpu   Resolution   Reduction(%)    avg.psnr   ovr.psnr    ssim
 0       LOWRES2      0.725         0.0017    -0.0000    0.0192
 0       MIDRES2      0.968         0.0004     0.0504    0.0810
 0        HDRES2      1.135         0.0089     0.0130    0.0113
 0       Average      0.943         0.0037     0.0211    0.0372

STATS_CHANGED

Change-Id: Ia713e5170101302f264ffaa2350bc0ab15c27090
2023-03-07 12:39:10 +05:30
Neeraj Gadgil f2210fd290 Early terminate interp filt search based on best RD cost
The CL prunes interpolation filter search based on rdcost of
individual planes.

                 Instruction Count        BD-Rate Loss(%)
cpu   Resolution   Reduction(%)    avg.psnr   ovr.psnr    ssim
 0       LOWRES2      1.613         0.0143     0.0208    0.0146
 0       MIDRES2      1.637         0.0214    -0.0316    0.0036
 0        HDRES2      1.369         0.0171     0.0178    0.1222
 0       Average      1.539         0.0176     0.0023    0.0468

STATS_CHANGED

Change-Id: I4be30bd1c7bbbc93c6bbc840565893a97d2598a4
2023-03-07 12:36:00 +05:30
James Zern 2d7d2fcf7b Merge "Fix heap buffer overrun in vpx_get4x4sse_cs_neon" into main 2023-03-07 05:45:53 +00:00
James Zern 925b8156d9 Merge changes I05dc4d43,Ia0977ff0 into main
* changes:
  Fix potential buffer over-read in highbd d117 predictor Neon
  Implement d117_predictor using Neon
2023-03-07 01:28:15 +00:00
Jonathan Wright 5a2bb12c52 Fix heap buffer overrun in vpx_get4x4sse_cs_neon
Use a mem_neon.h helper to do strided 4-byte loads instead of Neon
8-byte loads - where the last 4 bytes are out of bounds.

Re-enable the Neon code path and the tests.

Bug: webm:1794
Change-Id: I69ccff730f4a5cbf585dd6a9aa0f3eb13e150074
2023-03-07 00:05:10 +00:00
James Zern d94e16404a vpx_convolve_copy_neon: fix unaligned loads w/w==4
Fixes a -fsanitize=undefined warning:

vpx_dsp/arm/vpx_convolve_copy_neon.c:29:26: runtime error: load of
misaligned address 0xffffa8242bea for type 'const uint32_t' (aka 'const
unsigned int'), which requires 4 byte alignment
0xffffa8242bea: note: pointer points here
 88 81  7d 7d 7d 7d 7d 81 81 7d  81 80 87 97 a8 ab a0 91 ...
              ^
    #0 0xb0447c in vpx_convolve_copy_neon
       vpx_dsp/arm/vpx_convolve_copy_neon.c:29:26
    #1 0x12285c8 in inter_predictor vp9/common/vp9_reconinter.h:29:3
    #2 0x1228430 in dec_build_inter_predictors
       vp9/decoder/vp9_decodeframe.c
    ...

Change-Id: Iaec4ac2a400b6e6db72d12e5a7acb316262b12a7
2023-03-06 15:19:31 -08:00
Jonathan Wright 6b783c6975 Optimize vpx_sum_squares_2d_i16_neon
Add an additional 32-bit vector accumulator to allow parallel
processing on CPUs that have more than one Neon multiply-accumulate
pipeline. Also use sum_neon.h horizontal-add helpers for reduction.

Change-Id: Ibcb48a738f5dee1430c3ebcd305b5ea8ea344c40
2023-03-06 18:34:23 +00:00
George Steed 9e35c35945 Implement highbd_d207_predictor using Neon
Add Neon implementations of the highbd d207 predictor for 4x4, 8x8,
16x16 and 32x32 block sizes. Also update tests to add new corresponding
cases.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    1.61
Neoverse N1 |  LLVM 15 |   8x8 |    5.30
Neoverse N1 |  LLVM 15 | 16x16 |    8.93
Neoverse N1 |  LLVM 15 | 32x32 |    8.35
Neoverse N1 |   GCC 12 |   4x4 |    2.16
Neoverse N1 |   GCC 12 |   8x8 |    5.75
Neoverse N1 |   GCC 12 | 16x16 |    7.28
Neoverse N1 |   GCC 12 | 32x32 |    3.31
Neoverse V1 |  LLVM 15 |   4x4 |    1.71
Neoverse V1 |  LLVM 15 |   8x8 |    7.46
Neoverse V1 |  LLVM 15 | 16x16 |   10.09
Neoverse V1 |  LLVM 15 | 32x32 |    8.10
Neoverse V1 |   GCC 12 |   4x4 |    1.99
Neoverse V1 |   GCC 12 |   8x8 |    7.81
Neoverse V1 |   GCC 12 | 16x16 |    8.34
Neoverse V1 |   GCC 12 | 32x32 |    5.74

Change-Id: Ic021e82eed0c7bc8263eb68606411354eb5e4870
2023-03-06 13:35:45 +00:00
George Steed cf85ae9a49 Implement highbd_d153_predictor using Neon
Add Neon implementations of the highbd d153 predictor for 4x4, 8x8,
16x16 and 32x32 block sizes. Also update tests to add new corresponding
cases.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    1.71
Neoverse N1 |  LLVM 15 |   8x8 |    4.05
Neoverse N1 |  LLVM 15 | 16x16 |    7.04
Neoverse N1 |  LLVM 15 | 32x32 |    7.71
Neoverse N1 |   GCC 12 |   4x4 |    1.84
Neoverse N1 |   GCC 12 |   8x8 |    4.19
Neoverse N1 |   GCC 12 | 16x16 |    6.07
Neoverse N1 |   GCC 12 | 32x32 |    3.14
Neoverse V1 |  LLVM 15 |   4x4 |    3.19
Neoverse V1 |  LLVM 15 |   8x8 |    5.51
Neoverse V1 |  LLVM 15 | 16x16 |    7.73
Neoverse V1 |  LLVM 15 | 32x32 |    7.72
Neoverse V1 |   GCC 12 |   4x4 |    3.97
Neoverse V1 |   GCC 12 |   8x8 |    5.52
Neoverse V1 |   GCC 12 | 16x16 |    6.31
Neoverse V1 |   GCC 12 | 32x32 |    5.36

Change-Id: I2bce6f1921d76d1c10d163e0cd4f395b40799184
2023-03-06 13:35:27 +00:00
George Steed 33f3ae3414 Fix potential buffer over-read in highbd d117 predictor Neon
The load of `left[bs]` in the standard bitdepth d117 Neon implementation
triggered an address-sanitizer failure.

The highbd equivalent does not appear to trigger any asan failures when
running the VP9/ExternalFrameBufferMD5Test or
VP9/TestVectorTest.MD5Match tests, but for consistency with the standard
bitdepth implementation we adjust it to avoid the over-read.

Performance is roughly identical, with a 0.8% performance improvement on
average over the previous optimised code.

Change-Id: I05dc4d43f244f4915c0ccc52cc0af999bbacb018
2023-03-06 13:34:35 +00:00
George Steed 872476c66b Implement d207_predictor using Neon
Add Neon implementations of the d207 predictor for 4x4, 8x8, 16x16 and
32x32 block sizes. Also update tests to add new corresponding cases.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    1.72
Neoverse N1 |  LLVM 15 |   8x8 |    5.68
Neoverse N1 |  LLVM 15 | 16x16 |   12.30
Neoverse N1 |  LLVM 15 | 32x32 |   16.70
Neoverse N1 |   GCC 12 |   4x4 |    1.71
Neoverse N1 |   GCC 12 |   8x8 |    6.01
Neoverse N1 |   GCC 12 | 16x16 |   12.40
Neoverse N1 |   GCC 12 | 32x32 |    6.71
Neoverse V1 |  LLVM 15 |   4x4 |    1.99
Neoverse V1 |  LLVM 15 |   8x8 |    8.28
Neoverse V1 |  LLVM 15 | 16x16 |   14.36
Neoverse V1 |  LLVM 15 | 32x32 |   17.55
Neoverse V1 |   GCC 12 |   4x4 |    1.99
Neoverse V1 |   GCC 12 |   8x8 |    8.43
Neoverse V1 |   GCC 12 | 16x16 |   14.41
Neoverse V1 |   GCC 12 | 32x32 |    7.82

Change-Id: I250ab56edab3390b0bac9dc96995a4bf9a4da641
2023-03-06 13:34:35 +00:00
George Steed 7e88600bf9 Implement d117_predictor using Neon
Add Neon implementations of the d117 predictor for 4x4, 8x8, 16x16 and
32x32 block sizes. Also update tests to add new corresponding cases.

This re-lands commit 360e9069b6,
previously reverted in commit 394de691a0.

The implementation is mostly identical to the original but with an
adjustment to how data is loaded from the `left` array. In particular
the left array cannot be guaranteed to be larger than the block size, so
the read of e.g. `left[32]` in the `bs=32` case is not valid. This turns
out to be not a problem since the last lane loaded in this case is
unused. I have added comments in the code to explain why this is the
case.

Since we cannot load the last element directly, we instead construct it
from the previous aligned read. This seems to have an inconsistent
affect on performance, improving by up to 10% in some cases and
regressing by up to 10% on others. Either way it is still significantly
faster than the original C code.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    1.88
Neoverse N1 |  LLVM 15 |   8x8 |    5.19
Neoverse N1 |  LLVM 15 | 16x16 |    9.63
Neoverse N1 |  LLVM 15 | 32x32 |   13.85
Neoverse N1 |   GCC 12 |   4x4 |    2.04
Neoverse N1 |   GCC 12 |   8x8 |    4.62
Neoverse N1 |   GCC 12 | 16x16 |    9.79
Neoverse N1 |   GCC 12 | 32x32 |    4.69
Neoverse V1 |  LLVM 15 |   4x4 |    1.75
Neoverse V1 |  LLVM 15 |   8x8 |    6.71
Neoverse V1 |  LLVM 15 | 16x16 |    9.62
Neoverse V1 |  LLVM 15 | 32x32 |   13.81
Neoverse V1 |   GCC 12 |   4x4 |    1.75
Neoverse V1 |   GCC 12 |   8x8 |    6.01
Neoverse V1 |   GCC 12 | 16x16 |    6.91
Neoverse V1 |   GCC 12 | 32x32 |    4.39

Change-Id: Ia0977ff0b0eba2c41c7884b64e7c22ff9bc9549d
2023-03-06 13:34:35 +00:00
George Steed 8b0a60f91c Implement d153_predictor using Neon
Add Neon implementations of the d153 predictor for 4x4, 8x8, 16x16 and
32x32 block sizes. Also update tests to add new corresponding cases.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    1.59
Neoverse N1 |  LLVM 15 |   8x8 |    4.46
Neoverse N1 |  LLVM 15 | 16x16 |    8.77
Neoverse N1 |  LLVM 15 | 32x32 |   15.21
Neoverse N1 |   GCC 12 |   4x4 |    1.90
Neoverse N1 |   GCC 12 |   8x8 |    4.70
Neoverse N1 |   GCC 12 | 16x16 |    9.55
Neoverse N1 |   GCC 12 | 32x32 |    5.95
Neoverse V1 |  LLVM 15 |   4x4 |    2.89
Neoverse V1 |  LLVM 15 |   8x8 |    6.94
Neoverse V1 |  LLVM 15 | 16x16 |   10.20
Neoverse V1 |  LLVM 15 | 32x32 |   15.63
Neoverse V1 |   GCC 12 |   4x4 |    4.45
Neoverse V1 |   GCC 12 |   8x8 |    7.71
Neoverse V1 |   GCC 12 | 16x16 |    9.08
Neoverse V1 |   GCC 12 | 32x32 |    7.93

Change-Id: I910692b14917cde8a8952fab5b9c78bed7f7c6ad
2023-03-06 13:34:35 +00:00
George Steed 6282757546 Implement highbd_d63_predictor using Neon
Add Neon implementations of the highbd d63 predictor for 4x4, 8x8, 16x16
and 32x32 block sizes. Also update tests to add new corresponding cases.

This re-lands commit 7cdf139e3d,
previously reverted in 7478b7e4e4.

Compared to the previous implementation attempt we now correctly match
the behaviour of the C code when handling the final element loaded from
the 'above' input array. In particular:

- The C code for a 4x4 block performs a full average of the last element
  rather than duplicating the final element from the input 'above'
  array.

- The C code for other block sizes performs a full average for the
  stride=0 and stride=1, and otherwise shifts in duplicates of the final
  element from the input 'above' array. Notably this shifting for later
  strides _replaces_ the final element which we previously performed an
  average on (see {d0,d1}_ext in the code).

It is worth noting that this difference is not caught by the existing
VP9HighbdIntraPredTest test cases since the test vector initialisation
contains this loop:

    for (int x = block_size; x < 2 * block_size; x++) {
        above_row_[x] = above_row_[block_size - 1];
    }

Since AVG2(a, a) and AVG3(a, a, a) are simply 'a', such differences in
behaviour for the final element are not observed.

Tested on AArch64 with:

- ./test_libvpx --gtest_filter="*VP9HighbdIntraPredTest*"
- ./test_libvpx --gtest_filter="*VP9/TestVectorTest.MD5Match*"
- ./test_libvpx --gtest_filter="*VP9/ExternalFrameBufferMD5Test*"

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    2.43
Neoverse N1 |  LLVM 15 |   8x8 |    3.92
Neoverse N1 |  LLVM 15 | 16x16 |    3.19
Neoverse N1 |  LLVM 15 | 32x32 |    4.13
Neoverse N1 |   GCC 12 |   4x4 |    2.92
Neoverse N1 |   GCC 12 |   8x8 |    6.51
Neoverse N1 |   GCC 12 | 16x16 |    4.55
Neoverse N1 |   GCC 12 | 32x32 |    3.18
Neoverse V1 |  LLVM 15 |   4x4 |    1.99
Neoverse V1 |  LLVM 15 |   8x8 |    3.65
Neoverse V1 |  LLVM 15 | 16x16 |    3.72
Neoverse V1 |  LLVM 15 | 32x32 |    3.26
Neoverse V1 |   GCC 12 |   4x4 |    2.39
Neoverse V1 |   GCC 12 |   8x8 |    4.76
Neoverse V1 |   GCC 12 | 16x16 |    3.24
Neoverse V1 |   GCC 12 | 32x32 |    2.44

Change-Id: Iefaa774d6a20388b523eaa7f5df6bc5f5cf249e4
2023-03-06 13:34:35 +00:00
Johann 0384a2aab7 reland: quantize: simplify 32x32_b args
Allocate mb_plane_ on the heap to ensure src is aligned.

Now that all the implementations of the 32x32 quantize are in
intrinsics we can reference struct members directly. Saves
pushing them to the stack.

n_coeffs is not used at all for this function.

Change-Id: Ib551f7f583977602504d962b72063bc6eda9dda9
2023-03-06 09:16:04 +09:00
James Zern 5fae248f2a disable vp8_sixtap_predict16x16_neon
This causes various buffer overflows in the tests:

[ RUN      ] NEON/SixtapPredictTest.TestWithPresetData/0
=================================================================
==22346==ERROR: AddressSanitizer: global-buffer-overflow on address
0x0000012b4a5b at pc 0x000000df0f60 bp 0xffffcf6e64b0 sp 0xffffcf6e64a8
READ of size 8 at 0x0000012b4a5b thread T0
    #0 0xdf0f5c in vp8_sixtap_predict16x16_neon
       vp8/common/arm/neon/sixtappredict_neon.c:1507:13
    #1 0x8819e4 in (anonymous
        namespace)::SixtapPredictTest_TestWithPresetData_Test::TestBody()
       test/predict_test.cc:293:3
    ...

0x0000012b4a5b is located 2 bytes to the right of global variable
'kTestData' defined in '../test/predict_test.cc:237:24' (0x12b48a0) of
size 441

[ RUN      ] NEON/SixtapPredictTest.TestWithRandomData/0
=================================================================
==22338==ERROR: AddressSanitizer: heap-buffer-overflow on address
0xffff8b5321fb at pc 0x000000df0f60 bp 0xfffff7e0cf30 sp 0xfffff7e0cf28
READ of size 8 at 0xffff8b5321fb thread T0
    #0 0xdf0f5c in vp8_sixtap_predict16x16_neon
       vp8/common/arm/neon/sixtappredict_neon.c:1507:13
    #1 0x87d4c0 in (anonymous
       namespace)::PredictTestBase::TestWithRandomData(void (*)(unsigned
       char*, int, int, int, unsigned char*, int))
       test/predict_test.cc:170:9
    ...

0xffff8b5321fb is located 2 bytes to the right of 441-byte region
[0xffff8b532040,0xffff8b5321f9)
allocated by thread T0 here:
    #0 0x5fd4f0 in operator new[](unsigned long) (test_libvpx+0x5fd4f0)
    #1 0x87c2e0 in (anonymous namespace)::PredictTestBase::SetUp()
       test/predict_test.cc:47:12
    #2 0x87d074 in non-virtual thunk to (anonymous
       namespace)::PredictTestBase::SetUp() test/predict_test.cc
    ...

Bug: webm:1795
Change-Id: I32213a381eef91547d00f88acf90f1cf2ec2ea75
2023-03-03 15:33:16 -08:00
James Zern f5dfa780ce disable vpx_get4x4sse_cs_neon
This function causes a heap overflow in the tests:
[ RUN      ] NEON/VpxSseTest.RefSse/0
=================================================================
==876922==ERROR: AddressSanitizer: heap-buffer-overflow on address
0xffff8949d903 at pc 0x000000dd95d4 bp 0xfffffdd7f260 sp 0xfffffdd7f258
READ of size 8 at 0xffff8949d903 thread T0
    #0 0xdd95d0 in vpx_get4x4sse_cs_neon
       vpx_dsp/arm/variance_neon.c:556:10
    #1 0x9d4894 in (anonymous namespace)::MainTestClass<unsigned int
       (*)(unsigned char const*, int, unsigned char const*,
           int)>::RefTestSse() test/variance_test.cc:531:5
    #2 0x9d4894 in (anonymous
       namespace)::VpxSseTest_RefSse_Test::TestBody()
           test/variance_test.cc:772:30
    ...

0xffff8949d903 is located 3 bytes to the right of 16-byte region
[0xffff8949d8f0,0xffff8949d900)
allocated by thread T0 here:
    #0 0x5fd050 in operator new[](unsigned long) (test_libvpx+0x5fd050)
    #1 0x9d3e04 in (anonymous namespace)::MainTestClass<unsigned int
       (*)(unsigned char const*, int, unsigned char const*,
           int)>::SetUp() test/variance_test.cc:299:12

Bug: webm:1794
Change-Id: I4bc681eb9a436743ef8bfe2a2abae59ce754309c
2023-03-03 13:24:02 -08:00
James Zern 394de691a0 Revert "Implement d117_predictor using Neon"
This reverts commit 360e9069b6.

This causes ASan errors:
[ RUN      ] VP9/TestVectorTest.MD5Match/1
=================================================================
==837858==ERROR: AddressSanitizer: stack-buffer-overflow on address
0xffff82ecad40 at pc 0x000000c494d4 bp 0xffffe1695800 sp 0xffffe16957f8
READ of size 16 at 0xffff82ecad40 thread T0
    #0 0xc494d0 in vpx_d117_predictor_32x32_neon (test_libvpx+0xc494d0)
    #1 0x1040b34 in vp9_predict_intra_block (test_libvpx+0x1040b34)
    #2 0xf8feec in decode_block (test_libvpx+0xf8feec)
    #3 0xf8f588 in decode_partition (test_libvpx+0xf8f588)
    #4 0xf7be5c in vp9_decode_frame (test_libvpx+0xf7be5c)
    ...
Address 0xffff82ecad40 is located in stack of thread T0 at offset 64 in
frame
    #0 0x103fd3c in vp9_predict_intra_block (test_libvpx+0x103fd3c)

  This frame has 2 object(s):
    [32, 64) 'left_col.i' <== Memory access at offset 64 overflows this
                              variable
    [96, 176) 'above_data.i'

Change-Id: I058213364617dfe1036126c33a3307f8288d9ae0
2023-03-03 12:34:36 -08:00
Johann ca0c51f05f Revert "Allow macroblock_plane to have its own rounding buffer"
This reverts commit 5359ae810c.

Reason for revert: Blocks quantize cleanups

Original change's description:
> Allow macroblock_plane to have its own rounding buffer
>
> Add 8 bytes buffer to macroblock_plane to support rounding factor.
>
> Change-Id: I3751689e4449c0caea28d3acf6cd17d7f39508ed

Change-Id: Ia2424d2114207370f0b45350313a5ff8521d25a8
2023-03-03 06:24:41 +00:00
Konstantinos Margaritis 817248e1be [SSE4_1] Fix overflow in highbd temporal_filter
While porting this function to NEON, using SSE4_1 implementation
as base I noticed that both were producing files with different
checksums to the C reference implementation. After investigating
further I found that this saturating pack was the culprit. Doing
the multiplication on the 32-bit values, leads to producing the
correct results with the C implementation.

Change-Id: I40c2a36551b2db363a58ea9aa19ef327f2676de3
2023-03-02 00:02:16 +00:00
James Zern 508bfc1ff4 Revert "quantize: simplify 32x32_b args"
This reverts commit 848f6e7337.

This has alignment issues, causing crashes in the tests:
SSSE3/VP9QuantizeTest.EOBCheck/*

Change-Id: Ic12014ab0a78ed3cde02d642509061552cdc8fc9
2023-03-01 15:54:49 -08:00
James Zern e4b423e140 Revert "quantize: simplifly highbd 32x32_b args"
This reverts commit 573f5e662b.

This has alignment issues, causing crashes in the tests:
SSSE3/VP9QuantizeTest.EOBCheck/*

Change-Id: Ibf05e6b116c46f6e2c11187b3e3578bbd2d2c227
2023-03-01 15:54:48 -08:00
James Zern d98a7b8bd9 Revert "quantize: use scan_order instead of passing scan/iscan"
This reverts commit 14fc40040f.

This has alignment issues, causing crashes in the tests:
SSSE3/VP9QuantizeTest.EOBCheck/*

Change-Id: I934f9a4c3ce3db33058a65180fa645c8649c3670
2023-03-01 15:54:46 -08:00
James Zern 0e7804ca30 Merge "Optimize Neon implementation of high bitdepth MSE functions" into main 2023-03-01 23:13:34 +00:00
James Zern 7478b7e4e4 Revert "Implement highbd_d63_predictor using Neon"
This reverts commit 7cdf139e3d.

This causes failures in the VP9/ExternalFrameBufferMD5Test and
VP9/TestVectorTest.MD5Match tests in both armv7 and aarch64 builds.

Change-Id: I7ac4ba0ddc70e7e7860df9f962e6658defe1cdd5
2023-03-01 12:17:00 -08:00
Salome Thirot 096cd0ba8a Optimize Neon implementation of high bitdepth MSE functions
Currently MSE functions just call the variance helpers but don't
actually use the computed sum. This patch adds dedicated helpers to
perform the computation of sse.

Add the corresponding tests as well.

Change-Id: I96a8590e3410e84d77f7187344688e02efe03902
2023-03-01 13:35:03 +00:00
Johann 14fc40040f quantize: use scan_order instead of passing scan/iscan
further reduces the arguments for the 32x32. This will be applied to the base
version as well.

Change-Id: I25a162b5248b14af53d9e20c6a7fa2a77028a6d1
2023-03-01 07:48:01 +09:00
Johann 573f5e662b quantize: simplifly highbd 32x32_b args
Change-Id: I431a41279c4c4193bc70cfe819da6ea7e1d2fba1
2023-03-01 07:35:15 +09:00
James Zern 1ad49b2878 Merge changes I892fbd2c,Ic59df16c,I7228327b,Ib4a1a2cb into main
* changes:
  Implement highbd_d117_predictor using Neon
  Implement highbd_d63_predictor using Neon
  Implement d117_predictor using Neon
  Implement d63_predictor using Neon
2023-02-28 21:50:11 +00:00
James Zern 002ca3fc72 Merge "quantize: simplify 32x32_b args" into main 2023-02-28 21:40:26 +00:00
George Steed 74e4587c89 Implement highbd_d117_predictor using Neon
Add Neon implementations of the highbd d117 predictor for 4x4, 8x8,
16x16 and 32x32 block sizes. Also update tests to add new corresponding
cases.

An explanation of the general implementation strategy is given in the
8x8 implementation body, and is mostly identical to the non-highbd
version.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    1.99
Neoverse N1 |  LLVM 15 |   8x8 |    4.37
Neoverse N1 |  LLVM 15 | 16x16 |    6.81
Neoverse N1 |  LLVM 15 | 32x32 |    6.49
Neoverse N1 |   GCC 12 |   4x4 |    2.49
Neoverse N1 |   GCC 12 |   8x8 |    4.10
Neoverse N1 |   GCC 12 | 16x16 |    5.58
Neoverse N1 |   GCC 12 | 32x32 |    2.16
Neoverse V1 |  LLVM 15 |   4x4 |    1.99
Neoverse V1 |  LLVM 15 |   8x8 |    5.03
Neoverse V1 |  LLVM 15 | 16x16 |    6.61
Neoverse V1 |  LLVM 15 | 32x32 |    6.01
Neoverse V1 |   GCC 12 |   4x4 |    2.09
Neoverse V1 |   GCC 12 |   8x8 |    4.52
Neoverse V1 |   GCC 12 | 16x16 |    4.23
Neoverse V1 |   GCC 12 | 32x32 |    2.70

Change-Id: I892fbd2c17ac527ddc22b91acca907ffc84c5cd2
2023-02-28 11:46:40 +00:00
George Steed 7cdf139e3d Implement highbd_d63_predictor using Neon
Add Neon implementations of the highbd d63 predictor for 4x4, 8x8, 16x16
and 32x32 block sizes. Also update tests to add new corresponding cases.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    2.43
Neoverse N1 |  LLVM 15 |   8x8 |    4.03
Neoverse N1 |  LLVM 15 | 16x16 |    3.07
Neoverse N1 |  LLVM 15 | 32x32 |    4.11
Neoverse N1 |   GCC 12 |   4x4 |    2.92
Neoverse N1 |   GCC 12 |   8x8 |    7.20
Neoverse N1 |   GCC 12 | 16x16 |    4.43
Neoverse N1 |   GCC 12 | 32x32 |    3.18
Neoverse V1 |  LLVM 15 |   4x4 |    1.99
Neoverse V1 |  LLVM 15 |   8x8 |    3.66
Neoverse V1 |  LLVM 15 | 16x16 |    3.60
Neoverse V1 |  LLVM 15 | 32x32 |    3.29
Neoverse V1 |   GCC 12 |   4x4 |    2.39
Neoverse V1 |   GCC 12 |   8x8 |    4.76
Neoverse V1 |   GCC 12 | 16x16 |    3.29
Neoverse V1 |   GCC 12 | 32x32 |    2.43

Change-Id: Ic59df16ceeb468003754b4374be2f4d9af6589e4
2023-02-28 11:46:34 +00:00
George Steed 360e9069b6 Implement d117_predictor using Neon
Add Neon implementations of the d117 predictor for 4x4, 8x8, 16x16 and
32x32 block sizes. Also update tests to add new corresponding cases.

An explanation of the general implementation strategy is given in the
8x8 implementation body.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    1.73
Neoverse N1 |  LLVM 15 |   8x8 |    5.24
Neoverse N1 |  LLVM 15 | 16x16 |    9.77
Neoverse N1 |  LLVM 15 | 32x32 |   14.13
Neoverse N1 |   GCC 12 |   4x4 |    2.04
Neoverse N1 |   GCC 12 |   8x8 |    4.70
Neoverse N1 |   GCC 12 | 16x16 |    8.64
Neoverse N1 |   GCC 12 | 32x32 |    4.57
Neoverse V1 |  LLVM 15 |   4x4 |    1.75
Neoverse V1 |  LLVM 15 |   8x8 |    6.79
Neoverse V1 |  LLVM 15 | 16x16 |    9.16
Neoverse V1 |  LLVM 15 | 32x32 |   14.47
Neoverse V1 |   GCC 12 |   4x4 |    1.75
Neoverse V1 |   GCC 12 |   8x8 |    6.00
Neoverse V1 |   GCC 12 | 16x16 |    7.63
Neoverse V1 |   GCC 12 | 32x32 |    4.32

Change-Id: I7228327b5be27ee7a68deecafa05be0bd2a40ff4
2023-02-28 11:33:21 +00:00
George Steed a7ab16aed1 Implement d63_predictor using Neon
Add Neon implementations of the d63 predictor for 4x4, 8x8, 16x16 and
32x32 block sizes. Also update tests to add new corresponding cases.

Speedups over the C code (higher is better):

Microarch.  | Compiler | Block | Speedup
Neoverse N1 |  LLVM 15 |   4x4 |    2.10
Neoverse N1 |  LLVM 15 |   8x8 |    4.45
Neoverse N1 |  LLVM 15 | 16x16 |    4.74
Neoverse N1 |  LLVM 15 | 32x32 |    2.27
Neoverse N1 |   GCC 12 |   4x4 |    2.46
Neoverse N1 |   GCC 12 |   8x8 |   10.37
Neoverse N1 |   GCC 12 | 16x16 |   11.46
Neoverse N1 |   GCC 12 | 32x32 |    6.57
Neoverse V1 |  LLVM 15 |   4x4 |    2.24
Neoverse V1 |  LLVM 15 |   8x8 |    3.53
Neoverse V1 |  LLVM 15 | 16x16 |    4.44
Neoverse V1 |  LLVM 15 | 32x32 |    2.17
Neoverse V1 |   GCC 12 |   4x4 |    2.25
Neoverse V1 |   GCC 12 |   8x8 |    7.67
Neoverse V1 |   GCC 12 | 16x16 |    8.97
Neoverse V1 |   GCC 12 | 32x32 |    4.77

Change-Id: Ib4a1a2cb5a5c4495ae329529f8847664cbd0dfe0
2023-02-28 11:32:32 +00:00
Johann 848f6e7337 quantize: simplify 32x32_b args
Now that all the implementations of the 32x32 quantize are in
intrinsics we can reference struct members directly. Saves
pushing them to the stack.

n_coeffs is not used at all for this function.

Change-Id: I2104fea3fa20c455087e21b347d6abd7ea1f3e1e
2023-02-28 18:46:16 +09:00
James Zern 372989240d Merge "Add Neon implementations of standard bitdepth MSE functions" into main 2023-02-28 02:44:28 +00:00
James Zern c70d57c71a Merge "Optimize transpose_neon.h helper functions" into main 2023-02-28 02:36:41 +00:00
James Zern 112945ac7b tools_common,VpxInterface: remove unneeded const
Change-Id: Ic309aab2ff1750bdbcc36e8aafe05d52930ba694
2023-02-27 13:48:47 -08:00
James Zern 0824c8c556 Merge "tools_common,VpxInterface: fix interface fn ptr proto" into main 2023-02-27 19:52:18 +00:00
Salome Thirot ccc101e6bb Add Neon implementations of standard bitdepth MSE functions
Currently only vpx_mse16x16 has a Neon implementation. This patch adds
optimized Armv8.0 and Armv8.4 dot-product paths for all block sizes:
8x8, 8x16, 16x8 and 16x16.

Add the corresponding tests as well.

Change-Id: Ib0357fdcdeb05860385fec89633386e34395e260
2023-02-27 18:03:22 +00:00
Jonathan Wright b25cca8c2e Optimize transpose_neon.h helper functions
1) Use vtrn[12]q_[su]64 in vpx_vtrnq_[su]64* helpers on AArch64
   targets. This produces half as many TRN1/2 instructions compared to
   the number of MOVs that result from vcombine.

2) Use vpx_vtrnq_[su]64* helpers wherever applicable.

3) Refactor transpose_4x8_s16 to operate on 128-bit vectors.

Change-Id: I9a8b1c1fe2a98a429e0c5f39def5eb2f65759127
2023-02-27 09:49:02 +00:00
James Zern 5b2d3d5e42 tools_common,VpxInterface: fix interface fn ptr proto
Use (void) to indicate an empty parameter list and match the declaration
of vpx_codec_vp[89]_[cd]x. This fixes a cfi sanitizer error.

Change-Id: I190f432eea4d1765afffd84c7458ec44d863f90c
2023-02-24 19:25:39 -08:00
James Zern 45dc0d34d2 Merge changes I65d86038,If3299fe5,I3ef1ff19 into main
* changes:
  Add Neon implementation of high bitdepth 32x32 hadamard transform
  Add Neon implementation of high bitdepth 16x16 hadamard transform
  Add Neon implementation of high bitdepth 8x8 hadamard transform
2023-02-24 17:58:15 +00:00
James Zern 3cf0568ace Merge changes Ia64d175a,Ie4ea8f0a into main
* changes:
  vp9_loop_filter_alloc: clear -Wshadow warnings
  vp9_adapt_mode_probs: clear -Wshadow warning
2023-02-24 17:49:25 +00:00
Salome Thirot 111068923b Add Neon implementation of high bitdepth 32x32 hadamard transform
Add Neon implementation of vpx_highbd_hadamard_32x32 as well as the
corresponding tests.

Change-Id: I65d8603896649de1996b353aa79eee54824b4708
2023-02-24 11:10:14 +00:00
Salome Thirot 6ec45f933c Add Neon implementation of high bitdepth 16x16 hadamard transform
Add Neon implementation of vpx_highbd_hadamard_16x16 as well as the
corresponding tests.

Change-Id: If3299fe556351dfe3db994ac171d83a95ea1504b
2023-02-24 11:09:57 +00:00
Jerome Jiang 1614895e06 Merge "vp9 rc test: change param type to bool" into main 2023-02-24 01:45:54 +00:00
Jerome Jiang 221d76ab9c vp9 rc test: change param type to bool
Change-Id: Ib45522e32d9137678da9062830044e9dd87537e5
2023-02-23 14:28:30 -05:00
Chi Yo Tsai 49807f88d6 Merge "Disable some intra modes for TX_32X32" into main 2023-02-23 18:01:05 +00:00
Salome Thirot aab93ee6b6 Add Neon implementation of high bitdepth 8x8 hadamard transform
Add Neon implementation of vpx_highbd_hadamard_8x8 as well as the
corresponding tests.

Change-Id: I3ef1ff199d76b6b010591ef15a81b0f36c9ded03
2023-02-23 17:09:52 +00:00
James Zern 76389886ee vp9_loop_filter_alloc: clear -Wshadow warnings
Bug: webm:1793
Change-Id: Ia64d175aa69dc2ecde2babf64bde04f02b32795b
2023-02-22 22:13:02 -08:00
James Zern f569a4d68c vp9_adapt_mode_probs: clear -Wshadow warning
Bug: webm:1793
Change-Id: Ie4ea8f0a3295e6f58dc6f7d5c61d46700c539d40
2023-02-22 22:08:36 -08:00
James Zern 03b97add02 Merge "vp9_block.h: rename diff struct to Diff" into main 2023-02-23 06:07:25 +00:00
chiyotsai 4ba3be9324 Disable some intra modes for TX_32X32
Performance:
| SPD_SET | TESTSET | AVG_PSNR | OVR_PSNR |  SSIM   | ENC_T |
|---------|---------|----------|----------|---------|-------|
|    0    | hdres2  | +0.036%  | +0.032%  | +0.014% | -3.9% |
|    0    | lowres2 | -0.002%  | -0.011%  | +0.020% | -3.6% |
|    0    | midres2 | +0.045%  | +0.025%  | -0.007% | -4.0% |

STATS_CHANGED

Change-Id: I75a927333d26f2a37f0dda57a641b455b845f5b9
2023-02-22 14:36:21 -08:00
James Zern 3712a5869c vpx_subpixel_8t_intrin_avx2: clear -Wshadow warnings
no changes to assembly

Bug: webm:1793
Change-Id: I6a82290cafee7f4a7909d497ccfdefd5a78fb8ed
2023-02-22 12:54:54 -08:00
James Zern 46add73f7e vp9_block.h: rename diff struct to Diff
This matches the style guide and fixes some -Wshadow warnings related to
variables with the same name. Something similar was done in libaom in:
863b04994b Fix warnings reported by -Wshadow: Part2: av1 directory

Bug: webm:1793
Change-Id: I4df1bbc8d079a3174d75f0d35d54c200ffdbb677
2023-02-22 11:59:02 -08:00
Yunqing Wang 910245f1fe Merge "Skip redundant iterations in joint motion search " into main 2023-02-22 19:28:17 +00:00
Jerome Jiang f7ca33c46c Merge "vp9 rc: Make it work for SVC parallel encoding" into main 2023-02-22 14:59:49 +00:00
Salome Thirot 6ed9639e43 Optimize Neon implementation of high bitpdeth variance functions
Specialize implementation of high bitdepth variance functions such that
we only widen data processing element types when absolutely necessary.

Change-Id: If4cc3fea7b5ab0821e3129ebd79ff63706a512bf
2023-02-21 20:03:56 +00:00
Deepa K G c4ee2b2f03 Skip redundant iterations in joint motion search
In joint_motion_search, there are four iterations.
Even iterations search in the first reference frame
and odd iterations search in the second. The last two
iterations use the search result of the first two
iterations as the start point. If the search result does
not change,last two iterations are not necessary and can
be skipped.

          Instruction Count
cpu-used   Reduction(%)
  0          1.411

Change-Id: Ie583c9f75dd0a22bbdfb432ccdd62eea6ec4fce8
2023-02-21 18:05:23 +05:30
Jerome Jiang 0f888815c5 vp9 rc: Make it work for SVC parallel encoding
Added unit test.

Keep track of spatial layer id and frame type in case where spatial
layers are encoded parallel by the hardware encoder.

ComputeQP() / PostEncodeUpdate() doesn't need to be called sequentially
when there is no inter layer prediction.

Bug: b/257368998
Change-Id: I50beaefcfc205d3f9a9d3dbe11fead5bfdc71489
2023-02-17 20:44:22 -05:00
Jerome Jiang 32c1a4bf3f Merge "vp9 rc: Verify QP for all spatial layers" into main 2023-02-17 02:11:31 +00:00
Jerome Jiang be2fd0c740 vp9 rc: Verify QP for all spatial layers
Change-Id: Ic669c96d25d7c039d370e9acd00dc45e09054552
2023-02-16 19:23:42 -05:00
chiyotsai b737865480 Relax frame recode tolerance on speed 0 to 1 above 480p
Performance:
| SPD_SET | TESTSET | AVG_PSNR | OVR_PSNR |  SSIM   | ENC_T |
|---------|---------|----------|----------|---------|-------|
|    0    | hdres2  | -0.028%  | +0.030%  | -0.408% | -2.0% |
|    0    | lowres2 | +0.000%  | +0.000%  | +0.000% | +0.0% |
|    0    | midres2 | -0.138%  | +0.042%  | -0.427% | -2.5% |
|---------|---------|----------|----------|---------|-------|
|    1    | hdres2  | -0.032%  | +0.018%  | -0.342% | -1.1% |
|    1    | lowres2 | +0.000%  | +0.000%  | +0.000% | +0.0% |
|    1    | midres2 | +0.050%  | +0.060%  | -0.257% | -1.6% |

Rate Error:
|         |         |     AVG_RC_ERROR    |     MAX_RC_ERROR    |
|         |         |---------------------|---------------------|
| SPD_SET | TESTSET |   BASE   |   TEST   |   BASE   |   TEST   |
|---------|---------|----------|----------|----------|----------|
|    0    | hdres2  |  33.044% |  33.065% | 149.903% | 149.903% |
|    0    | midres2 |  59.632% |  59.566% |  79.091% |  79.249% |
|---------|---------|----------|----------|----------|----------|
|    1    | hdres2  |  33.050% |  33.057% | 151.278% | 151.278% |
|    1    | midres2 |  59.640% |  59.614% |  78.707% |  78.842% |

STATS_CHANGED

Change-Id: I5d09601fede3912d5173717ce9dd070df3a97ec8
2023-02-16 13:25:06 -08:00
chiyotsai 660031ccf3 Enable some more speed features on speed 0 to 2
Performance:
| SPD_SET | TESTSET | AVG_PSNR | OVR_PSNR |  SSIM   | ENC_T |
|---------|---------|----------|----------|---------|-------|
|    0    | hdres2  | +0.034%  | +0.030%  | +0.033% | -3.7% |
|    0    | lowres2 | +0.012%  | +0.017%  | +0.044% | -2.1% |
|    0    | midres2 | +0.030%  | +0.035%  | +0.060% | -1.9% |
|---------|---------|----------|----------|---------|-------|
|    1    | hdres2  | +0.027%  | +0.036%  | +0.030% | -2.7% |
|    1    | lowres2 | -0.006%  | -0.002%  | +0.006% | -1.0% |
|    1    | midres2 | -0.006%  | -0.012%  | -0.010% | -1.0% |
|---------|---------|----------|----------|---------|-------|
|    2    | hdres2  | -0.006%  | -0.001%  | -0.020% | -2.4% |
|    2    | lowres2 | -0.010%  | -0.015%  | -0.001% | -0.9% |
|    2    | midres2 | +0.006%  | -0.005%  | +0.009% | -1.0% |

STATS_CHANGED

Change-Id: I1431ac07215bb844739a410697387b9aead82792
2023-02-14 10:11:58 -08:00
James Zern bc2965ff72 Merge changes Id74a6d9c,I5c31e0e9,Id5a2b2d9,I73182c97,I2f5916d5, ... into main
* changes:
  Optimize vpx_highbd_comp_avg_pred_neon
  Add Neon AvgPredTestHBD test suite
  Specialize Neon high bitdepth avg subpel variance by filter value
  Specialize Neon high bitdepth subpel variance by filter value
  Refactor Neon high bitdepth avg subpel variance functions
  Optimize Neon high bitdepth subpel variance functions
2023-02-14 02:46:51 +00:00
Salome Thirot ed68c267cf Optimize vpx_highbd_comp_avg_pred_neon
Optimize the implementation of vpx_highbd_comp_avg_pred_neon by making
use of the URHADD instruction to compute the average.

Change-Id: Id74a6d9c33e89bc548c3c7ecace59af69051b4a7
2023-02-13 20:23:14 +00:00
Salome Thirot b17993ca67 Add Neon AvgPredTestHBD test suite
Add test suite for vpx_highbd_comp_avg_pred_neon.

Change-Id: I5c31e0e990661ee3b8030bb517829c088fceae4d
2023-02-13 20:23:09 +00:00
Salome Thirot e03217c9d5 Specialize Neon high bitdepth avg subpel variance by filter value
Use the same specialization as for standard bitdepth. The rationale for
the specialization is as follows:

The optimal implementation of the bilinear interpolation depends on the
filter values being used. For both horizontal and vertical interpolation
this can simplify to just taking the source values, or averaging the
source and reference values - which can be computed more easily than a
bilinear interpolation with arbitrary filter values.

This patch introduces tests to find the most optimal bilinear
interpolation implementation based on the filter values being used.
This new specialization is only used for larger block sizes.

Change-Id: Id5a2b2d9fac6f878795a6ed9de2bc27d9e62d661
2023-02-13 20:23:02 +00:00
Salome Thirot c113d6b027 Specialize Neon high bitdepth subpel variance by filter value
Use the same specialization as for standard bitdepth. The rationale for
the specialization is as follows:

The optimal implementation of the bilinear interpolation depends on the
filter values being used. For both horizontal and vertical interpolation
this can simplify to just taking the source values, or averaging the
source and reference values - which can be computed more easily than a
bilinear interpolation with arbitrary filter values.

This patch introduces tests to find the most optimal bilinear
interpolation implementation based on the filter values being used.
This new specialization is only used for larger block sizes.

Change-Id: I73182c979255f0332a274f2e5907df7f38c9eeb3
2023-02-13 20:22:56 +00:00
Salome Thirot 7343d56c1b Refactor Neon high bitdepth avg subpel variance functions
Use the same general code style as in the standard bitdepth Neon
implementation - merging the computation of vpx_highbd_comp_avg_pred
with the second pass of the bilinear filter to avoid storing and loading
the block again.

Also move vpx_highbd_comp_avg_pred_neon to its own file (like the
standard bitdepth implementation) since we're no longer using it for
averaging sub-pixel variance.

Change-Id: I2f5916d5b397db44b3247b478ef57046797dae6c
2023-02-13 20:22:50 +00:00
Salome Thirot 42cb3dbf94 Optimize Neon high bitdepth subpel variance functions
Use the same general code style as in the standard bitdepth Neon
implementation. Additionally, do not unnecessarily widen to 32-bit data
types when doing bilinear filtering - allowing us to process twice as
many elements per instruction.

Change-Id: I1e178991d2aa71f5f77a376e145d19257481e90f
2023-02-13 20:19:30 +00:00
James Zern b5e1945af0 README: update release version to 1.13.0
this was missed in the v1.13.0 tag

Bug: webm:1780
Change-Id: I3044534123bf67861174970e6241f6586055358e
(cherry picked from commit 184a886917)
2023-02-13 18:35:10 +00:00
James Zern 184a886917 README: update release version to 1.13.0
this was missed in the v1.13.0 tag

Bug: webm:1780
Change-Id: I3044534123bf67861174970e6241f6586055358e
2023-02-10 19:04:41 -08:00
Chi Yo Tsai 5595e18870 Merge "Remove CONFIG_CONSISTENT_RECODE flag" into main 2023-02-10 22:13:50 +00:00
chiyotsai 086f0e6538 Remove CONFIG_CONSISTENT_RECODE flag
Currently, libvpx does not properly clear and re-initialize the memories
when it re-encodes a frame. As a result, out-of-date values are used in
the encoding process, and re-encoding a frame with the same parameter
will give different outputs.

This commit enables the code under CONFIG_CONSISTENT_RECODE to correct
this behavior. This change has minor effect on the coding performance,
but it ensures valid values are used in the encoding process.

Furthermore, the flag is removed as it is now always turned on.

Performance:
| SPD_SET | TESTSET | AVG_PSNR | OVR_PSNR |  SSIM   | ENC_T |
|---------|---------|----------|----------|---------|-------|
|    0    | hdres2  | -0.012%  | -0.021%  | -0.030% | +0.1% |
|    0    | lowres2 | +0.029%  | +0.019%  | +0.047% | +0.1% |
|    0    | midres2 | -0.004%  | +0.009%  | +0.026% | +0.1% |
|---------|---------|----------|----------|---------|-------|
|    1    | hdres2  | +0.032%  | +0.032%  | -0.000% | -0.0% |
|    1    | lowres2 | -0.005%  | -0.011%  | -0.014% | +0.0% |
|    1    | midres2 | +0.004%  | +0.020%  | +0.027% | +0.2% |
|---------|---------|----------|----------|---------|-------|
|    2    | hdres2  | +0.048%  | +0.056%  | +0.057% | +0.1% |
|    2    | lowres2 | +0.007%  | +0.002%  | -0.016% | -0.0% |
|    2    | midres2 | -0.015%  | -0.008%  | -0.002% | +0.1% |
|---------|---------|----------|----------|---------|-------|
|    3    | hdres2  | +0.010%  | +0.014%  | +0.004% | -0.0% |
|    3    | lowres2 | +0.000%  | -0.021%  | -0.001% | +0.0% |
|    3    | midres2 | +0.007%  | -0.038%  | +0.012% | -0.2% |
|---------|---------|----------|----------|---------|-------|
|    4    | hdres2  | +0.107%  | +0.136%  | +0.124% | -0.0% |
|    4    | lowres2 | -0.012%  | -0.024%  | -0.020% | -0.0% |
|    4    | midres2 | +0.055%  | -0.004%  | +0.048% | -0.1% |
|---------|---------|----------|----------|---------|-------|
|    5    | hdres2  | +0.026%  | +0.027%  | +0.020% | -0.0% |
|    5    | lowres2 | +0.009%  | -0.008%  | +0.028% | +0.1% |
|    5    | midres2 | -0.025%  | +0.021%  | -0.020% | -0.1% |

STATS_CHANGED

Change-Id: I3967aee8c8e4d0608a492e07f99ab8de9744ba57
2023-02-10 13:06:51 -08:00
James Zern 924716523e Merge "Optimize Neon high bitdepth convolve copy" into main 2023-02-10 03:35:22 +00:00
Jerome Jiang f903d99650 Merge "Merge tag 'v1.13.0'" into main 2023-02-09 22:07:28 +00:00
Jerome Jiang e8bd0842c5 Merge "Remove onyx_int.h from vp8 rc header" into main 2023-02-09 21:27:59 +00:00
Jerome Jiang 5edaa583e1 Remove onyx_int.h from vp8 rc header
Also move the FRAME_TYPE declaration to common.h

Bug: webm:1766

Change-Id: Ic3016bd16548a5d2e0ae828a7fd7ad8adda8b8f6
2023-02-09 15:15:59 -05:00
Jerome Jiang 121dc7513f Merge tag 'v1.13.0'
Release v1.13.0 Ugly Duckling

2023-01-31 v1.13.0 "Ugly Duckling"

  This release includes more Neon and AVX2 optimizations, adds a new codec
  control to set per frame QP, upgrades GoogleTest to v1.12.1, and includes
  numerous bug fixes.

- Upgrading:
    This release is ABI incompatible with the previous release.

    New codec control VP9E_SET_QUANTIZER_ONE_PASS to set per frame QP.

    GoogleTest is upgraded to v1.12.1.

    .clang-format is upgraded to clang-format-11.

    VPX_EXT_RATECTRL_ABI_VERSION was bumped due to incompatible changes to the
    feature of using external rate control models for vp9.

- Enhancement:
    Numerous improvements on Neon optimizations.
    Numerous improvements on AVX2 optimizations.
    Additional ARM targets added for Visual Studio.

- Bug fixes:
    Fix to calculating internal stats when frame dropped.
    Fix to segfault for external resize test in vp9.
    Fix to build system with replacing egrep with grep -E.
    Fix to a few bugs with external RTC rate control library.
    Fix to make SVC work with VBR.
    Fix to key frame setting in VP9 external RC.
    Fix to -Wimplicit-int (Clang 16).
    Fix to VP8 external RC for buffer levels.
    Fix to VP8 external RC for dynamic update of layers.
    Fix to VP9 auto level.
    Fix to off-by-one error of max w/h in validate_config.
    Fix to make SVC work for Profile 1.

Bug: webm:1780

Change-Id: I371fc1444ead56f8d7fc510e05582b6415c3ddb1
2023-02-09 20:00:46 +00:00
Jonathan Wright 459cfc8bae Optimize Neon high bitdepth convolve copy
Use standard loads and stores instead of the significantly slower
interleaving/de-interleaving variants. Also move all loads in loop
bodies above all stores as a mitigation against the compiler thinking
that the src and dst pointers alias (since we can't use restrict in
C89.)

Change-Id: Idd59dca51387f553f8db27144a2b8f2377c937d3
2023-02-09 12:14:18 +00:00
Chi Yo Tsai d3275163c1 Merge "Copy BLOCK_8X8's mi to PICK_MODE_CONTEXT::mic" into main 2023-02-08 23:16:48 +00:00
chiyotsai b6951d2b0f Copy BLOCK_8X8's mi to PICK_MODE_CONTEXT::mic
STATS_CHANGED

BUG=webm:1789

Change-Id: I74efe28bdf90a179c59fe3d1f5a15d497f57080d
2023-02-08 14:01:19 -08:00
Salome Thirot bb065c6c6d Add missing high bitdepth Neon subpel variance tests
Add missing 4x4 and 4x8 tests for both high bitdepth sub-pixel variance
and high bitdepth averaging sub-pixel variance.

Change-Id: I042752c5b7ccc14f58075694d0bb1d36f144ad06
2023-02-08 19:28:09 +00:00
Cheng Chen d6eb9696aa Fix unsigned integer overflow in sse computation
Basically port the fix from libaom:
https://aomedia-review.googlesource.com/c/aom/+/169361

Change-Id: Id06a5db91372037832399200ded75d514e096726
(cherry picked from commit a94cdd57ff)
2023-02-08 01:33:51 +00:00
Chi Yo Tsai 73cdc9fd1e Merge "Enable some speed features on speed 0" into main 2023-02-08 00:44:46 +00:00
chiyotsai 03ddac40df Enable some speed features on speed 0
Performance:
| SPD_SET | TESTSET | AVG_PSNR | OVR_PSNR |  SSIM   | ENC_T |
|---------|---------|----------|----------|---------|-------|
|    0    | hdres2  | +0.069%  | +0.067%  | +0.100% | -8.6% |
|    0    | midres2 | +0.116%  | +0.103%  | +0.062% | -9.6% |
|    0    | lowres2 | +0.276%  | +0.283%  | +0.214% |-11.9% |

STATS_CHANGED

Change-Id: I8b26c0be2312fcd0f8c9e889367682e80ea8de4b
2023-02-07 15:06:06 -08:00
Salome Thirot 25a6b2b181 Use 4D reduction Neon helper for standard bitdepth SAD4D
Move the 4D reduction helper function to sum_neon.h and use this for
both standard and high bitdepth SAD4D paths. This also removes the
AArch64 requirement for using the UDOT Neon SAD4D paths.

Change-Id: I207f76b3d42aa541809b0672c3b3d86e54d133ff
2023-02-07 17:08:48 +00:00
Yunqing Wang 9b910a65ed Merge "Move TPL to a new file" into main 2023-02-07 04:22:40 +00:00
James Zern 9a26870002 Merge changes Ica45c44f,I75c5f099,I9e626d7f into main
* changes:
  Optimize Neon implementation of high bitdepth SAD4D functions
  Optimize Neon implementation of high bitdepth avg SAD functions
  Optimize Neon implementation of high bitdepth SAD functions
2023-02-07 01:32:03 +00:00
Yunqing Wang ec8e2fe1cf Move TPL to a new file
This is a refactoring CL.

Change-Id: Ic8c1575601d27f14ecd1b1bf0a038e447eaae458
2023-02-06 16:34:08 -08:00
Jerome Jiang d2557313d2 Merge "Remove duplicated VPX_SCALING declaration" into main 2023-02-06 22:16:41 +00:00
Salome Thirot 6b8e9e1f3e Optimize Neon implementation of high bitdepth SAD4D functions
Optimizations take a similar form to those implemented for Armv8.0
standard bitdepth SAD4D:

- Use ABD, UADALP instead of ABAL, ABAL2 (double the throughput on
  modern out-of-order Arm-designed cores.)
- Use more accumulator registers to make better use of Neon pipeline
  resources on Arm CPUs that have four Neon pipes.
- Compute the four SAD sums in parallel so that we only load the source
  block once - instead of four times.

Change-Id: Ica45c44fd167e5fcc83871d8c138fc72ed3a9723
2023-02-06 21:04:52 +00:00
Jerome Jiang 5eea5c7666 Remove duplicated VPX_SCALING declaration
Use VPX_SCALING_MODE instead

Change-Id: Iab9d29f20838703e00bd9f7641035d8ebd69af53
2023-02-06 13:32:37 -05:00
Salome Thirot 9a5cbfbc08 Optimize Neon implementation of high bitdepth avg SAD functions
Optimizations take a similar form to those implemented for standard
bitdepth averaging SAD:

- Use ABD, UADALP instead of ABAL, ABAL2 (double the throughput on
  modern out-of-order Arm-designed cores.)
- Use more accumulator registers to make better use of Neon pipeline
  resources on Arm CPUs that have four Neon pipes.

Change-Id: I75c5f09948f6bf17200f82e00e7a827a80451108
2023-02-06 15:54:57 +00:00
Salome Thirot e3028ddbb4 Optimize Neon implementation of high bitdepth SAD functions
Optimizations take a similar form to those implemented for standard
bitdepth SAD:

- Use ABD, UADALP instead of ABAL, ABAL2 (double the throughput on
  modern out-of-order Arm-designed cores.)
- Use more accumulator registers to make better use of Neon pipeline
  resources on Arm CPUs that have four Neon pipes.

Change-Id: I9e626d7fa0e271908dc43448405a7985b80e6230
2023-02-06 15:51:43 +00:00
Yunqing Wang a77c7a78ae Merge "Fix uninitialized mesh feature for BEST mode" into main 2023-02-03 23:22:58 +00:00
Wan-Teh Chang 18a3421b7d Set _img->bit_depth in y4m_input_fetch_frame()
This is a port of
https://aomedia-review.googlesource.com/c/aom/+/169961.

Change-Id: I2aa0d12cafde0c73448bf8c57eab0cd92e846468
2023-02-03 14:07:09 -08:00
Yunqing Wang d6382e4469 Fix uninitialized mesh feature for BEST mode
At BEST encoding mode, the mesh search range wasn't initialized for
non FC_GRAPHICS_ANIMATION content type, which actually/mistakenly
used speed 0's setting. Fixed it by adding the initialization.

There were 2 ways to fix this. Patchset 1 set to use speed 0's setting
for non FC_GRAPHICS_ANIMATION type. This didn't change BEST mode's
encoding results much, and only a couple of clips' results were changed.

Borg result for BEST mode:
         avg_psnr:  ovr_psnr:  ssim:  encoding_spdup:
lowres2:  -0.004     -0.003   -0.000    0.030
midres2:  -0.006     -0.009   -0.012    0.033
hdres2:    0.002      0.002    0.004    0.015

Patchset 2 set to use BEST's setting for non FC_GRAPHICS_ANIMATION type.
However, the majority of test clips' BDrate got changed up to
~0.5% (gain or loss), and overall it didn't give better performance
than patchset 1. So, we chose to use patchset 1.

Change-Id: Ibbf578dad04420e6ba22cb9a3ddec137a7e4deef
2023-02-03 12:02:11 -08:00
James Zern 858a8c611f vp9_diamond_search_sad_neon: use DECLARE_ALIGNED
rather than the gcc specific __attribute__((aligned())); fixes build
targeting ARM64 windows.

Bug: webm:1788
Change-Id: I2210fc215f44d90c1ce9dee9b54888eb1b78c99e
2023-02-01 14:50:01 -08:00
Jerome Jiang b5a2b3a929 Update AUTHORS .mailmap and version
Bug: webm:1780
Change-Id: I75a24bdd076dc1746b23bababfaafccbce3b4214
2023-02-01 16:30:35 -05:00
Jerome Jiang aa5b62236a Fix per frame qp for temporal layers
Also add tests with fixed temporal layering mode.

Change-Id: If516fe94e3fb7f5a745821d1788bfe6cf90edaac
(cherry picked from commit db69ce6aea)
2023-01-31 18:58:26 -05:00
Jerome Jiang 3f109f786a Update CHANGELOG
Bug: webm:1780
Change-Id: I3ab4729bff1d27ef7127ef26e780a469e9278c21
2023-01-31 18:58:21 -05:00
James Zern 50e1b76e32 Merge "Use load_unaligned mem_neon.h helpers in SAD and SAD4D" into main 2023-01-31 21:20:16 +00:00
Jonathan Wright 472c839c9f Use load_unaligned mem_neon.h helpers in SAD and SAD4D
Use the load_unaligned helper functions in mem_neon.h to load strided
sequences of 4 bytes where alignment is not guaranteed in the Neon
SAD and SAD4D paths.

Change-Id: I941d226ef94fd7a633b09fc92165a00ba68a1501
2023-01-31 15:39:21 +00:00
Cheng Chen a94cdd57ff Fix unsigned integer overflow in sse computation
Basically port the fix from libaom:
https://aomedia-review.googlesource.com/c/aom/+/169361

Change-Id: Id06a5db91372037832399200ded75d514e096726
2023-01-30 23:02:22 +00:00
James Zern 7a8ba7ea02 Merge "Refactor 8x8 16-bit Neon transpose functions" into main 2023-01-30 19:30:45 +00:00
Salome Thirot 8047e6f2b3 Refactor Neon implementation of SAD4D functions
Refactor and optimize the Neon implementation of SAD4D functions -
effectively backporting these libaom changes[1,2].

[1] https://aomedia-review.googlesource.com/c/aom/+/162181
[2] https://aomedia-review.googlesource.com/c/aom/+/162183

Change-Id: Icb04bd841d86f2d0e2596aa7ba86b74f8d2d360b
2023-01-30 13:14:54 +00:00
Yunqing Wang 698392d7fe Merge "Add encoder component timing information" into main 2023-01-28 00:27:57 +00:00
Yunqing Wang 5dd3d70a4f Add encoder component timing information
Change-Id: Iaa5b73a9593ecfd74b6426ed47d2b529ec7ae2b5
2023-01-27 11:33:29 -08:00
Gerda Zsejke More 5e92d6d103 Refactor 8x8 16-bit Neon transpose functions
Refactor the Neon implementation of transpose_s16_8x8(q) and
transpose_u16_8x8 so that the final step compiles to 8 ZIP1/ZIP2
instructions as opposed to 8 EXT, MOV pairs. This change removes 8
instructions per call to transpose_s16_8x8(q), transpose_u16_8x8
where the result stays in registers for further processing - rather
than being stored to memory - like in vpx_hadamard_8x8_neon, for
example.

This is a backport of this libaom patch[1].
[1] https://aomedia-review.googlesource.com/c/aom/+/169426

Change-Id: Icef3e51d40efeca7008e1c4fc701bf39bd319c88
2023-01-27 17:13:30 +01:00
Jerome Jiang 5c38ffbfa3 Merge "Fix per frame qp for temporal layers" into main 2023-01-26 21:31:14 +00:00
Jerome Jiang db69ce6aea Fix per frame qp for temporal layers
Also add tests with fixed temporal layering mode.

Change-Id: If516fe94e3fb7f5a745821d1788bfe6cf90edaac
2023-01-26 14:53:40 -05:00
James Zern ade7b131cc Merge "Refactor Neon implementation of SAD functions" into main 2023-01-26 03:26:38 +00:00
James Zern 2f24e444dd Merge "[NEON] Add Highbd FHT 8x8/16x16 functions" into main 2023-01-26 03:23:31 +00:00
Salome Thirot 7fed9187c4 Refactor Neon implementation of SAD functions
Refactor and optimize the Neon implementation of SAD functions -
effectively backporting these libaom changes[1,2,3].

[1] https://aomedia-review.googlesource.com/c/aom/+/161921
[2] https://aomedia-review.googlesource.com/c/aom/+/161923
[3] https://aomedia-review.googlesource.com/c/aom/+/166963

Change-Id: I2d72fd0f27d61a3e31a78acd33172e2afb044cb8
2023-01-25 15:35:51 +00:00
Konstantinos Margaritis 3384b83da0 [NEON] Add Highbd FHT 8x8/16x16 functions
In total this gives about 9% extra performance for both rt/best
profiles.
Furthermore, add transpose_s32 16x16 function

Change-Id: Ib6f368bbb9af7f03c9ce0deba1664cef77632fe2
2023-01-24 20:56:02 +00:00
Jerome Jiang 72cfcdd95a Skip calculating internal stats when frame dropped
Bug: webm:1771
Change-Id: I30cd5b7ec0945b521a1cc03999d39ec6a25f1696
2023-01-24 14:08:17 -05:00
Salome Thirot 67abc67389 Specialize Neon averaging subpel variance by filter value
Use the same specialization for averaging subpel variance functions
as used for the non-averaging variants. The rationale for the
specialization is as follows:

The optimal implementation of the bilinear interpolation depends on
the filter values being used. For both horizontal and vertical
interpolation this can simplify to just taking the source values, or
averaging the source and reference values - which can be computed
more easily than a bilinear interpolation with arbitrary filter
values.

This patch introduces tests to find the most optimal bilinear
interpolation implementation based on the filter values being used.
This new specialization is only used for larger block sizes

This is a backport of this libaom change[1].

After this change, the only differences between the code in libvpx and
libaom are due to libvpx being compiled with ISO C90, which forbids
mixing declarations and code [-Wdeclaration-after-statement].

[1] https://aomedia-review.googlesource.com/c/aom/+/166962

Change-Id: I7860c852db94a7c9c3d72ae4411316685f3800a4
2023-01-23 15:06:28 +00:00
Salome Thirot b7f6c64139 Refactor Neon averaging subpel variance functions
Merge the computation of vpx_comp_avg_pred into the second pass of the
bilinear filter - avoiding the overhead of loading and storing the
entire block again.

This is a backport of this libaom change[1].

[1] https://aomedia-review.googlesource.com/c/aom/+/166961

Change-Id: I9327ff7382a46d50c42a5213a11379b957146372
2023-01-23 15:06:20 +00:00
Salome Thirot ae5b60cb47 Specialize Neon subpel variance by filter value for large blocks
The optimal implementation of the bilinear interpolation depends on
the filter values being used. For both horizontal and vertical
interpolation this can simplify to just taking the source values, or
averaging the source and reference values - which can be computed
more easily than a bilinear interpolation with arbitrary filter
values.

This patch introduces tests to find the most optimal bilinear
interpolation implementation based on the filter values being used.
This new specialization is only used for larger block sizes
(>= 16x16) as we need to be doing enough work to make the cost of
finding the optimal implementation worth it.

This is a backport of this libaom change[1].

After this change, the only differences between the code in libvpx and
libaom are due to libvpx being compiled with ISO C90, which forbids
mixing declarations and code [-Wdeclaration-after-statement].

[1] https://aomedia-review.googlesource.com/c/aom/+/162463

Change-Id: Ia818e148f6fd126656e8411d59c184b55dd43094
2023-01-23 13:11:59 +00:00
Salome Thirot fcfb471ce2 Refactor Neon subpel variance functions
Refactor the Neon implementation of the sub-pixel variance bilinear
filter helper functions - effectively backporting this libaom patch[1].

[1] https://aomedia-review.googlesource.com/c/aom/+/162462

Change-Id: I3dee32e8125250bbeffeb63d1fef5da559bacbf1
2023-01-23 12:03:20 +00:00
Jerome Jiang b7c22b3a95 Merge "Add codec control to set per frame QP" into main 2023-01-20 17:14:04 +00:00
Jerome Jiang ae4240edc7 Add codec control to set per frame QP
Use case is for 1 pass encoding.
Forces max_quantizer = min_quantizer and aq-mode = 0.
Applicalble to spatial layers, where user may set
the QP per spatial layer.

Change-Id: Idfcb7daefde94c475ed1bc0eb8af47c9f309110b
2023-01-19 20:38:44 -05:00
James Zern 308d8638aa Merge "Refactor Neon implementation of variance functions" into main 2023-01-19 19:44:43 +00:00
James Zern 5e86179533 */Android.mk: add a check for NDK_ROOT
This simplifies integration with the Android platform and avoids the
files from being used when a non-NDK build is performed. In that case
Android.bp is preferred.

Change-Id: I803912146dac788b7f0af27199c7613cabbc9fa0
2023-01-18 19:19:01 -08:00
Salome Thirot 0ce866562f Refactor Neon implementation of variance functions
Refactor and optimize the Neon implementation of variance functions -
effectively backporting these libaom changes[1,2].

After this change, the only differences between the code in libvpx and
libaom are due to libvpx being compiled with ISO C90, which forbids
mixing declarations and code [-Wdeclaration-after-statement].

[1] https://aomedia-review.googlesource.com/c/aom/+/162241
[2] https://aomedia-review.googlesource.com/c/aom/+/162262

Change-Id: Ia4e8fff4d53297511d1a1e43bca8053bf811e551
2023-01-18 21:35:33 +00:00
Marco Paniconi 7a8052ccda Merge "Fix to segfault for external resize test in vp9" into main 2023-01-18 02:04:18 +00:00
Marco Paniconi 71d01660cc Fix to segfault for external resize test in vp9
Failure occurs for 1 pass non-realtime mode at speed 0.
Due to speed feautre rd_ml_partition.var_pruning, which
doesn't check for scaled reference in simple_motion_search().

Bug: webm:1768

Change-Id: Iddcb56033bac042faebb5196eed788317590b23f
2023-01-13 20:21:12 -08:00
Scott LaVarnway 59d4a68616 variance_test.cc: Enable HBDMse speed test.
Change-Id: If0226307a6efd704f8a35cb986f570304d698b95
2023-01-13 07:39:41 -08:00
Scott LaVarnway 35008f5e13 Merge "variance_test.cc: Enable VpxHBDMseTest for C and SSE2." into main 2023-01-13 13:36:15 +00:00
Scott LaVarnway 32878bb1f3 variance_test.cc: Enable VpxHBDMseTest for C and SSE2.
Change-Id: I66c0db6c605876d6757684fd715614881ca261e7
2023-01-12 13:29:49 -08:00
James Zern e9cc25c51c Merge changes Ifbf46768,If19f5872 into main
* changes:
  Implement vertical convolutions using Neon USDOT instruction
  Implement horizontal convolutions using Neon USDOT instruction
2023-01-12 18:41:27 +00:00
Jonathan Wright 5645938c36 Implement vertical convolutions using Neon USDOT instruction
Add additional AArch64 paths for vpx_convolve8_vert_neon and
vpx_convolve8_avg_vert_neon that use the Armv8.6-A USDOT (mixed-sign
dot-product) instruction. The USDOT instruction takes an 8-bit
unsigned operand vector and a signed 8-bit operand vector to produce
a signed 32-bit result. This is helpful because convolution filters
often have both positive and negative values, while the 8-bit pixel
channel data being filtered is all unsigned. As a result, the USDOT
convolution paths added here do not have to do the "transform the
pixel channel data to [-128, 128) and correct for it later" dance
that we have to do with the SDOT paths.

The USDOT instruction is optional from Armv8.2 to Armv8.5 but
mandatory from Armv8.6 onwards. The availability of the USDOT
instruction is indicated by the feature macro
__ARM_FEATURE_MATMUL_INT8. The SDOT paths are retained for use on
target CPUs that do not implement the USDOT instructions.

Change-Id: Ifbf467681dd53bb1d26e22359885e6edde3c5c72
2023-01-12 10:43:13 +00:00
Jonathan Wright f952068691 Implement horizontal convolutions using Neon USDOT instruction
Add additional AArch64 paths for vpx_convolve8_horiz_neon and
vpx_convolve8_avg_horiz_neon that use the Armv8.6-A USDOT (mixed-sign
dot-product) instruction. The USDOT instruction takes an 8-bit
unsigned operand vector and a signed 8-bit operand vector to produce
a signed 32-bit result. This is helpful because convolution filters
often have both positive and negative values, while the 8-bit pixel
channel data being filtered is all unsigned. As a result, the USDOT
convolution paths added here do not have to do the "transform the
pixel channel data to [-128, 128) and correct for it later" dance
that we have to do with the SDOT paths.

The USDOT instruction is optional from Armv8.2 to Armv8.5 but
mandatory from Armv8.6 onwards. The availability of the USDOT
instruction is indicated by the feature macro
__ARM_FEATURE_MATMUL_INT8. The SDOT paths are retained for use on
target CPUs that do not implement the USDOT instructions.

Change-Id: If19f5872c3453458a8cfb7c7d2be82a2c0eab46a
2023-01-11 12:18:45 +00:00
James Zern e067469e77 build: replace egrep with grep -E
avoids a warning on some platforms:
egrep: warning: egrep is obsolescent; using grep -E

Bug: webm:1786
Change-Id: Ia434297731303aacb0b02cf3dcbfd8e03936485d
Fixed: webm:1786
2023-01-10 13:49:15 -08:00
Jonathan Wright 708c4aa854 Use Neon load/store helper functions consistently
Define all Neon load/store helper functions in mem_neon.h and use
them consistently in Neon convolution functions.

Change-Id: I57905bc0a3574c77999cf4f4a73442c3420fa2be
2023-01-05 17:34:56 +00:00
Jonathan Wright ab1192c290 Use lane-referencing intrinsics in Neon convolution kernels
The Neon convolution helper functions take a pointer to a filter and
load the 8 values into a single Neon register. For some reason,
filter values 3 and 4 are then duplicated into their own separate
registers.

This patch modifies these helper functions so that they access filter
values 3 and 4 via the lane-referencing versions of the various Neon
multiply instructions. This reduces register pressure and tidies up
the source code quite a bit.

Change-Id: Ia4aeee8b46fe218658fb8577dc07ff04a9324b3e
2023-01-05 12:20:03 +00:00
Jerome Jiang 11151943b1 Remove references to deprecated NumPy type aliases
This change replaces references to a number of deprecated NumPy type
aliases (np.bool, np.int, np.float, np.complex, np.object, np.str)
with their recommended replacement
(bool, int, float, complex, object, str).

NumPy 1.24 drops the deprecated aliases
so we must remove uses before updating NumPy.

Change-Id: I9f5dfcbb11fe6534fce358054f210c7653f278c3
2022-12-21 11:17:04 -05:00
Scott LaVarnway e022d5b71f [x86]: Add vpx_highbd_comp_avg_pred_sse2().
C vs SSE2

4x4: 3.38x
8x8: 3.45x
16x16: 2.06x
32x32: 2.19x
64x64: 1.39x

Change-Id: I46638fe187b49a78fee554114fac51c485d74474
2022-12-20 15:59:20 -08:00
Scott LaVarnway 8838630016 Add vpx_highbd_comp_avg_pred_c() test.
Change-Id: I6b2c3379c49a62e56e5ac56fd4782a50b3c4e12a
2022-12-16 13:49:38 -08:00
Marco Paniconi 6eb4e9fcb3 Merge "rc-svc: Add tests for dynamic svc in external RC" into main 2022-12-14 17:08:21 +00:00
Marco Paniconi 55d3184503 rc-svc: Add tests for dynamic svc in external RC
Test to verify RC for going down and back up in
spatial layers. Going back up has an issue so added
a TODO.

Make the test more flexible to handle dynamic layers.
Test for dyanmic change in temporal layers to follow.

Change-Id: Ic5542f7b274135277429e116f56ba54e682e96a0
2022-12-14 00:19:47 -08:00
Anton Venema 89b8032ff5 Add additional ARM targets for Visual Studio.
configure: Add an armv7-win32-vs16 target
configure: Add an armv7-win32-vs17 target
configure: Add an arm64-win64-vs16 target
configure: Add an arm64-win64-vs17 target

Change-Id: I11d6cd6e51f7703939d6fd3fc6a7469591e3b09d
2022-12-13 18:09:56 -08:00
Cheng Chen 58e69d6c6a Merge "L2E: Add a new interface to control rdmult" into main 2022-12-13 01:24:00 +00:00
Scott LaVarnway a7bb04b435 [x86]: Add vpx_highbd_subtract_block_avx2().
Up to 4x faster than "sse2 vectorized C".

Change-Id: Ie9b3c12a437c5cddf92c4d5349c4f659ca6b82ea
2022-12-08 12:04:53 -08:00
Scott LaVarnway 1450ec46e2 Add vpx highbd subtract test.
Change-Id: I069ae0fe22bfc82ad5083df85a7fdf9058a285eb
2022-12-07 15:56:55 -08:00
Cheng Chen 5887bd234e L2E: Add a new interface to control rdmult
Allow external model to control frame rdmult.

A function is called per frame to get the value of rdmult from
the external model.

The external rdmult will overwrite libvpx's default rdmult unless
a reserved value is selected.

A unit test is added to test when the default rdmult value is set.

Change-Id: I2f17a036c188de66dc00709beef4bf2ed86a919a
2022-12-07 14:13:06 -08:00
Marco Paniconi cbb780ab0b rc-rtc: Test for periodic key in SVC external RC
This test catches the fix merged in here:
https://chromium-review.googlesource.com/c/webm/libvpx/+/4022904

Change-Id: Ib68fbcba694b5d465a9faf3ca7d6880bfe8eabb3
2022-12-05 14:34:58 -08:00
Marco Paniconi 2a8a25cf44 rc-rtc: Remove frame_flags_ change in svc ratectril rtc test
SVC test is only in CBR and the frame_flags are
set by the SVC pattern, so we shouldn't undo them
for svc mode.

Change-Id: I5ffa65dd58a7b47f287d124d9e71ba1dc7c5a549
2022-12-05 11:57:35 -08:00
Marco Paniconi d998bd8237 Merge "vp9/rate_ctrl_rtc: Improve get cyclic refresh data" into main 2022-11-18 04:16:26 +00:00
Hirokazu Honda 3fa698a6e8 vp9/rate_ctrl_rtc: Improve get cyclic refresh data
A client of the vp9 rate controller needs to know whether the
segmentation is enabled and the size of delta_q. It is also nicer to
know the size of map. This CL changes the interface to achieve these.

Bug: b:259487065
Test: Build

Change-Id: If05854530f97e1430a7b97788910f277ab673a87
2022-11-18 11:43:34 +09:00
Marco Paniconi 605350bd5b Merge "vp9-svc: Fixes to make SVC work with VBR" into main 2022-11-15 21:45:07 +00:00
Marco Paniconi 76e9bf7a18 vp9-svc: Fixes to make SVC work with VBR
Prior to this CL SVC with VBR mode was broken.
Fixes made here to make VBR rate control work for SVC.
Rename is_one_pass_cbr_svc() --> is_one_pass_svc(),
as it can be used now for both CBR and VBR.

Added rate targetting unittest for (2SL, 3TL).

Bug: chromium:1375111
Change-Id: I5a62ffe7fbea29dc5949c88a284768386b1907a9
2022-11-15 11:48:21 -08:00
James Zern c1406fc267 Merge "[NEON] Optimize FHT functions, add highbd FHT 4x4" into main 2022-11-15 19:19:43 +00:00
Johann aeb6ae7393 quantize: remove vp9_regular_quantize_b_4x4
This was just a helper function which called vpx_quantize_b or
vpx_highbd_quantize_b. It also checked for skip_block, which was
necessary when webm:1439 was filed but does not appear to be
necessary now.

Removes a quantize variant and makes subsequent cleanups easier.

Change-Id: Ibe545eccd19370f07ff26c8e151f290c642efd2a
2022-11-14 17:59:45 +09:00
Konstantinos Margaritis f951514a40 [NEON] Optimize FHT functions, add highbd FHT 4x4
Refactor & optimize FHT functions further, use new butterfly functions
4x4 5% faster, 8x8 & 16x16 10% faster than previous versions.
Highbd 4x4 FHT version 2.27x faster than C version for --rt.

Change-Id: I3ebcd26010f6c5c067026aa9353cde46669c5d94
2022-11-11 13:53:54 +00:00
Marco Paniconi 78ac7af95c vp9-rc: Fix key frame setting in external RC
Bug: b/257368998

Change-Id: I03e35915ac99b50cb6bdf7bce8b8f9ec5aef75b7
2022-11-10 22:10:07 -08:00
James Zern fb2d1616f6 Merge "Add Neon implementation of vpx_hadamard_32x32" into main 2022-11-07 21:48:50 +00:00
Sam James 62dee8012e build: fix -Wimplicit-int (Clang 16)
Clang 16 will make -Wimplicit-int error by default which can, in addition to
other things, lead to some configure tests silently failing/returning the wrong result.

Fixes this error:
```
+/var/tmp/portage/media-libs/libvpx-1.12.0/temp/vpx-conf-1802-30624.c:1:15: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
```

For more information, see LWN.net [0] or LLVM's Discourse [1], gentoo-dev@ [2],
or the (new) c-std-porting mailing list [3].

[0] https://lwn.net/Articles/913505/
[1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
[2] https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
[3] hosted at lists.linux.dev.

Bug: https://bugs.gentoo.org/879705
Change-Id: Id73a98944ab3c99a368b9da7a5e902ddff9d937f
Signed-off-by: Sam James <sam@gentoo.org>
2022-11-06 04:17:20 +00:00
Andrew Salkeld 5d26626e7a Add Neon implementation of vpx_hadamard_32x32
Add an Arm Neon implementation of vpx_hadamard_32x32 and use it
instead of the scalar C implementation.

Also add test coverage for the new Neon implementation.

Change-Id: Iccc018eec4dbbe629fb0c6f8ad6ea8554e7a0b13
2022-11-04 23:05:36 +00:00
Konstantinos Margaritis 3f08aa0d0b [NEON] Optimize highbd 32x32 DCT
For --best quality, resulting function
vpx_highbd_fdct32x32_rd_neon takes 0.27% of cpu time in
profiling, vs 6.27% for the sum of scalar functions:
vpx_fdct32, vpx_fdct32.constprop.0, vpx_fdct32x32_rd_c for rd.
For --rt quality, the function takes 0.19% vs 4.57% for the scalar
version.
Overall, this improves encoding time by ~6% compared for highbd
for --best and ~9% for --rt.

Change-Id: I1ce4bbef6e364bbadc76264056aa3f86b1a8edc5
2022-11-03 17:55:13 +00:00
James Zern f02a119100 Merge "[NEON] Optimize and homogenize Butterfly DCT functions" into main 2022-11-02 02:21:18 +00:00
Konstantinos Margaritis 3121783fec [NEON] Optimize and homogenize Butterfly DCT functions
Provide a set of commonly used Butterfly DCT functions for use in
DCT 4x4, 8x8, 16x16, 32x32 functions. These are provided in various
forms, using vqrdmulh_s16/vqrdmulh_s32 for _fast variants, which
unfortunately are only usable in pass1 of most DCTs, as they do not
provide the necessary precision in pass2.
This gave a performance gain ranging from 5% to 15% in 16x16 case.
Also, for 32x32, the loads were rearranged, along with the butterfly
optimizations, this gave 10% gain in 32x32_rd function.
This refactoring was necessary to allow easier porting of highbd
32x32 functions -follows this patchset.

Change-Id: I6282e640b95a95938faff76c3b2bace3dc298bc3
2022-11-01 23:07:27 +00:00
Johann Koenig ddca3dec36 Merge "MacOS 13 is darwin22" into main 2022-10-27 08:38:48 +00:00
Johann Koenig 17fbc6cfa1 Merge "rtcd: allow disabling neon on armv8" into main 2022-10-27 08:38:18 +00:00
Johann ebf22e2e8d MacOS 13 is darwin22
Bug: webm:1783
Change-Id: I97d94ab8c8aebe13aedb58e280dc37474814ad5d
2022-10-27 05:14:35 +00:00
Johann 9e1bdd12c7 rtcd: allow disabling neon on armv8
Change-Id: Idef943775456eb95b46be5c92c114c1d215f38d7
2022-10-27 09:19:45 +09:00
Johann 4b659f3c34 mailmap: add johann@duck.com
Change-Id: I3b48951e69ba1f4a9fafdbb81fac48f79587a342
2022-10-26 17:14:21 +09:00
James Zern dcb566e69f Merge changes I36545ff4,Id1aa29da into main
* changes:
  vp9_highbd_quantize_fp*_neon: normalize fn param name
  highbd_sad_avx2: normalize function param names
2022-10-25 19:16:46 +00:00
James Zern 2b99ea1b43 Merge "SAD*Test: mark virtual Run() as overridden" into main 2022-10-25 19:16:08 +00:00
Johann Koenig fc6d0d74ba Merge "quantize: consolidate sse2 conditionals" into main 2022-10-25 13:26:37 +00:00
Johann Koenig b14bb4c87a Merge "vp9 quantize: rewrite ssse3 in intrinsics" into main 2022-10-25 13:26:22 +00:00
James Zern ee12bc390d SAD*Test: mark virtual Run() as overridden
this comes from AbstractBench

Change-Id: Ie0b5a26a68bfbffd80f132125d15a1bdfc990c22
2022-10-24 15:37:26 -07:00
James Zern d667193e6a vp9_highbd_quantize_fp*_neon: normalize fn param name
count -> n_coeffs. aligns the name with the rtcd header; clears a
clang-tidy warning

Change-Id: I36545ff479df92b117c95e494f16002e6990f433
2022-10-24 15:32:10 -07:00
James Zern 228d8a4fed highbd_sad_avx2: normalize function param names
(src|ref)8_ptr -> (src|ref)_ptr. aligns the names with the rtcd header;
clears some clang-tidy warnings

Change-Id: Id1aa29da8c0fa5860b46ac902f5b2620c0d3ff54
2022-10-24 15:30:10 -07:00
Marco Paniconi 5245f6e9cb Fix to VP8 external RC for buffer levels
On a dynamic change of temporal layers:
starting/maimum/optimal were being set twice,
causing incorrect large values.

Bug: b/253927937
Change-Id: I204e885cff92530336a9ed9a4363c486c5bf80ae
2022-10-18 00:12:20 -07:00
Johann e8fc52ada4 quantize: consolidate sse2 conditionals
Change-Id: I43de579e30f2967b97064063e29676e0af1a498f
2022-10-17 16:22:23 +09:00
Johann 828d05d4a4 vp9 quantize: rewrite ssse3 in intrinsics
Change-Id: I3177251a5935453a23a23c39ea5f6fd41254775e
2022-10-17 12:23:24 +09:00
Marco Paniconi 79b718abdb Merge "Fix to VP8 external RC for dynamic update of layers" into main 2022-10-15 01:56:46 +00:00
Marco Paniconi 4007a057fc Fix to VP8 external RC for dynamic update of layers
On change/update of rc_cfg: when number of temporal
layers change call vp8_reset_temporal_layer_change(),
which in turn will call vp8_init_temporal_layer_context()
only for the new layers.

Bug:b/249644737

Change-Id: Ib20d746c7eacd10b78806ca6a5362c750d9ca0b3
2022-10-14 12:21:10 -07:00
Konstantinos Margaritis 124e57be95 [NEON] fix clang compile warnings
Change-Id: Ib7ce7a774ec89ba51169ea64d24c878109ef07d1
2022-10-13 16:49:15 +00:00
Scott LaVarnway 06a9d0e5dc Merge "Add vpx_highbd_sad64x{64,32}_avg_avx2." into main 2022-10-13 11:31:51 +00:00
Konstantinos Margaritis 45b280eb0f [NEON] Add highbd FDCT 16x16 function
90-95% faster than C version in best/rt profiles

Change-Id: I41d5e9acdc348b57153637ec736498a25ed84c25
2022-10-12 21:10:46 +00:00
James Zern e36c0a9495 Merge "[NEON] Add highbd FDCT 8x8 function" into main 2022-10-12 20:07:51 +00:00
Scott LaVarnway 5145c09c94 Merge "Add vpx_highbd_sad32x{64,32,16}_avg_avx2." into main 2022-10-12 19:50:55 +00:00
Scott LaVarnway 8e2ba7750e Merge "Add vpx_highbd_sad16x{32,16,8}_avg_avx2." into main 2022-10-12 19:44:44 +00:00
Konstantinos Margaritis a49f896352 [NEON] Add highbd FDCT 8x8 function
50% faster than C version in best/rt profiles

Change-Id: I0f9504ed52b5d5f7722407e91108ed4056d66bc2
2022-10-12 18:59:52 +00:00
Scott LaVarnway 7142689f00 Add vpx_highbd_sad64x{64,32}_avg_avx2.
~2.8x faster than the sse2 version.

Bug: b/245917257

Change-Id: Ib727ba8a8c8fa4df450bafdde30ed99fd283f06d
2022-10-12 11:43:39 -07:00
Konstantinos Margaritis 165935a1b6 [NEON] Add highbd FDCT 4x4 function
~80% faster than C version for both best/rt profiles.

Change-Id: Ibb3c8e1862131d2a020922420d53c66b31d5c2c3
2022-10-12 17:43:33 +00:00
Scott LaVarnway 50d5093a4f Add vpx_highbd_sad32x{64,32,16}_avg_avx2.
2.1x to 2.8x faster than the sse2 version.

Bug: b/245917257

Change-Id: I1aaffa4a1debbe5559784e854b8fc6fba07e5000
2022-10-12 07:00:31 -07:00
Scott LaVarnway 85484d5960 Add vpx_highbd_sad16x{32,16,8}_avg_avx2.
1.6x to 2.1x faster than the sse2 version.

Bug: b/245917257

Change-Id: I56c467a850297ae3abcca4b4843302bb8d5d0ac1
2022-10-12 03:28:53 -07:00
Konstantinos Margaritis f538a02244 [NEON] Move helper functions for reuse
Move all butterfly functions to fdct_neon.h
Slightly optimize load/scale/cross functions
in fdct 16x16.
These will be reused in highbd variants.

Change-Id: I28b6e0cc240304bab6b94d9c3f33cca77b8cb073
2022-10-12 08:11:53 +00:00
Scott LaVarnway 5c9d20cf44 Merge "SADavgTest: Add speed test." into main 2022-10-10 20:34:02 +00:00
Scott LaVarnway af274914f2 SADavgTest: Add speed test.
Change-Id: Ie14c0f6d15f410adf749f7ab74cf9f2bf35f3d5f
2022-10-10 12:20:37 -07:00
Konstantinos Margaritis 6f8537c4c8 [NEON] move transpose_8x8 to reuse
Change-Id: I3915b6c9971aedaac9c23f21fdb88bc271216208
2022-10-10 18:43:27 +00:00
James Zern 46bd6574aa Merge "[NEON] highbd partial DCT functions" into main 2022-10-10 18:37:05 +00:00
Konstantinos Margaritis 2d87b886a3 [NEON] highbd partial DCT functions
Change-Id: I7dd4e698469562f5b1f948cc36f8403b490dcb6a
2022-10-10 11:47:39 +00:00
Scott LaVarnway 06b09ebd35 Add vpx_highbd_sad64x{64,32}_avx2.
~2.8x faster than the sse2 version.

Bug: b/245917257

Change-Id: Ibc8e5d030ec145c9a9b742fff98fbd9131c9ede4
2022-10-07 09:47:01 -07:00
Johann Koenig 4cca8b1c8c Merge "vp9 quantize: change index" into main 2022-10-07 08:17:03 +00:00
Scott LaVarnway 4955b945d8 Add vpx_highbd_sad32x{64,32,16}_avx2.
2.7x to 3.1x faster than the sse2 version.

Bug: b/245917257

Change-Id: Idff3284932f7ee89d036f38893205bf622a159a3
2022-10-06 05:33:40 -07:00
Scott LaVarnway c03c882785 Add vpx_highbd_sad16x{32,16,8}_avx2.
1.9x to 2.4x faster than the sse2 version.

Bug: b/245917257

Change-Id: I686452772f9b72233930de2207af36a0cd72e0bb
2022-10-05 10:04:30 -07:00
Cheng Chen dca6dcef0a Merge "L2E: Rework recode decisions for external max frame size and q" into main 2022-10-04 16:15:49 +00:00
Johann eeea3daacb vp9 quantize: change index
In assembly it made sense to iterate using n_coeffs.
In intrinsics it's just as fast to use index and
easier to read.

Change-Id: I403c959709309dad68123d0a3d0efe183874543d
2022-10-01 11:50:46 +09:00
Scott LaVarnway 87c7da21c2 vpx_subpixel_8t_intrin_avx2.c: quiet -Wuninitialized
warning: ‘s2[3]’ may be used uninitialized
and
warning: ‘s1[3]’ may be used uninitialized

The warnings exposed unused code.

Change-Id: I75cf1f9db75e811cb42e2f143be1ad76f3e4dee9
2022-09-30 07:32:48 -07:00
Scott LaVarnway 381a8c9e01 Merge "vp9_rd.c quiet -Wstringop-overflow" into main 2022-09-26 23:18:04 +00:00
Johann f74ce37a3a quantize: standardize vp9_quantize_fp_sse2
Match style for vpx_quantize_b_sse2 and prepare to rewrite
ssse3 version in intrinsics.

Need to evaluate the value of threshold breakout before
going further.

Change-Id: I9cfceb1bb0dc237cd6b73fc8d41d78bba444a15b
2022-09-26 22:10:35 +00:00
Scott LaVarnway a1ba7188a8 vp9_rd.c quiet -Wstringop-overflow
../libvpx/vp9/encoder/vp9_rd.c:594:20: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  594 |         t_above[i] = !!*(const uint32_t *)&above[i];
      |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libvpx/vp9/encoder/vp9_rd.c:572:47: note: at offset [64, 254] into destination object ‘t_above’ of size [0, 16]
  572 |                               ENTROPY_CONTEXT t_above[16],
      |                               ~~~~~~~~~~~~~~~~^~~~~~~~~~~

Change-Id: Ie9ef24e685af417cdd35f6aa7284805e422b6ae2
2022-09-26 14:24:40 -07:00
Johann 00608eb1de quantize: add untested function
vp9_quantize_fp_sse2 was only tested in non-hbd
configuration. Missed when fixing this for
vpx_quantize_b_sse2.

Change-Id: Ide346e5727d74281c774f605c90d280050e0bf62
2022-09-24 10:56:17 +09:00
Johann c8874f74a7 quantize: increase iscan by 1
All of the assembly adds 1 to iscan to convert from
a 0 based array to the EOB value.

Add 1 to all iscan values and remove the extra
instructions from the assembly.

Change-Id: I219dd7f2bd10533ab24b206289565703176dc5e9
2022-09-23 21:17:34 +09:00
Scott LaVarnway 5820823ef8 Merge "resize_test.cc: quiet -Wmaybe-uninitialized" into main 2022-09-21 23:41:42 +00:00
Scott LaVarnway 8b0c92ebdf resize_test.cc: quiet -Wmaybe-uninitialized
warning: ‘expected_w’ may be used uninitialized
Change-Id: I915efd82d3263250cea90391345f7683c1330fc8
2022-09-21 14:16:56 -07:00
Scott LaVarnway 729739b36b Merge "post_proc_sse2.c: quiet -Wuninitialized" into main 2022-09-21 20:53:07 +00:00
Scott LaVarnway f6939699b6 post_proc_sse2.c: quiet -Wuninitialized
In file included from ../libvpx/vpx_dsp/x86/post_proc_sse2.c:12:
In function ‘_mm_add_epi16’,
    inlined from ‘vpx_mbpost_proc_down_sse2’ at ../libvpx/vpx_dsp/x86/post_proc_sse2.c:88:13:
/usr/lib/gcc/x86_64-linux-gnu/12/include/emmintrin.h:1060:35: warning: ‘below_context’ may be used uninitialized [-Wmaybe-uninitialized]
 1060 |   return (__m128i) ((__v8hu)__A + (__v8hu)__B);
      |                                   ^~~~~~~~~~~
../libvpx/vpx_dsp/x86/post_proc_sse2.c: In function ‘vpx_mbpost_proc_down_sse2’:
../libvpx/vpx_dsp/x86/post_proc_sse2.c:39:13: note: ‘below_context’ was declared here
   39 |     __m128i below_context;

Change-Id: I2fc592f121c4e85d0aff1640014c3444f5eb09fd
2022-09-21 11:37:04 -07:00
James Zern 417adb3aca Merge "CHECK_MEM_ERROR: add an assert for a valid jmp target" into main 2022-09-20 23:24:44 +00:00
Johann Koenig d678c1a170 Merge "quantize: test lowbd in highbd builds" into main 2022-09-20 00:12:13 +00:00
Johann 884837a580 quantize: test lowbd in highbd builds
Change-Id: I7af273e979415a8b8cafb7494728d2736862f4a5
2022-09-18 10:26:00 +09:00
Johann 3cd417b6d2 fwd_txfm: remove avx2 file from non-hbd
Resolves warning on OS X:
file: libvpx_g.a(fwd_txfm_avx2.c.o) has no symbols

Change-Id: Ie8b290bb3ed329656beb883d552c98353f1ed5e5
2022-09-17 07:54:40 +09:00
Cheng Chen 7ed6b47c60 L2E: Rework recode decisions for external max frame size and q
Allow to handle external q and external max frame size separately.
Rely on libvpx's decision to catch overshoot/undershoot and recode frames.

Previously, when external max frame size is set, we didn't handle
undershoot cases, and now we fall back to libvpx's decision to
recode a frame if overshoot/undershoot is seen.

Change-Id: Ic3eee042cfe104b528c5f2c6c82b98dd5d8fa8ca
2022-09-14 14:42:07 -07:00
Scott LaVarnway 34284e930a Add vpx_highbd_sad64x{64,32}x4d_avx2.
~2x faster than the sse2 version.

Bug: b/245917257

Change-Id: I4742950ab7b90d7f09e8d4687e1e967138acee39
2022-09-14 14:08:16 -07:00
Scott LaVarnway b39722f851 Add vpx_highbd_sad32x{64,32,16}x4d_avx2.
~2.4x faster than the sse2 version.

Bug: b/245917257

Change-Id: I6df2bd62b46e5e175c8ad80daa6de3a1c313db0f
2022-09-13 04:24:43 -07:00
James Zern fd615b4348 CHECK_MEM_ERROR: add an assert for a valid jmp target
callers of CHECK_MEM_ERROR() expect failures to not return

tested with:
configure --enable-debug --enable-vp9-postproc --enable-postproc \
  --enable-multi-res-encoding --enable-vp9-temporal-denoising \
  --enable-error-concealment

--enable-internal-stats has unrelated assertion failures currently

Change-Id: Ic12073b1ae80a6f434f14d24f652e64d30f63eea
2022-09-12 19:00:47 -07:00
Scott LaVarnway 6f1fa67010 Merge "Add vpx_highbd_sad16x{32,16,8}x4d_avx2." into main 2022-09-12 12:18:19 +00:00
Wan-Teh Chang 33c43c14ee Update third_party/googletest to v1.12.1
See https://github.com/google/googletest/releases/tag/release-1.12.1.

Modeled after https://aomedia-review.googlesource.com/c/aom/+/162601.

Change-Id: If0ced3097b4c8490985e3381aaac9b3266d52ae7
2022-09-09 14:38:15 -07:00
Scott LaVarnway 0d734728f6 Add vpx_highbd_sad16x{32,16,8}x4d_avx2.
1.98x to 2.3x faster than the sse2 version.

Bug: b/245917257

Change-Id: Ie4f9bb942ffaf4af7d395fb5a5978b41aabfc93c
2022-09-09 09:47:50 -07:00
James Zern a46ca4b6bd vp8_decode: declare 2 variables volatile
fixes -Wclobbered warnings with gcc 12.1.0:
vp8/vp8_dx_iface.c|278 col 16| warning: variable 'w' might be clobbered
by 'longjmp' or 'vfork' [-Wclobbered]
vp8/vp8_dx_iface.c|278 col 19| warning: variable 'h' might be clobbered
by 'longjmp' or 'vfork' [-Wclobbered]

Change-Id: Ib2c606a3450188d7869c066cacaf5615d9746181
2022-09-07 18:43:22 -07:00
James Zern a3abfc9874 Merge "x86,cosmetics: prefer _mm_setzero_si128/_mm256_setzero_si256" into main 2022-09-06 22:23:30 +00:00
James Zern a7527a26e8 sad_neon: enable UDOT implementation w/aarch32
Change-Id: Ia28305ec5c61518b732cbacbd102acd2cb7f9d82
2022-09-02 18:34:59 -07:00
James Zern b3317970e7 variance_neon.cc: simplify __ARM_FEATURE_DOTPROD check
missed in
447e27588 vpx_dsp,neon: simplify __ARM_FEATURE_DOTPROD check

+ fix #if comments

only check that the macro is defined, the value doesn't have any effect.

from https://arm-software.github.io/acle/main/acle.html:

5.5.7.7.  Dot Product extension
  __ARM_FEATURE_DOTPROD is defined if the dot product data manipulation
  instructions are supported and the vector intrinsics are available.
  Note that this implies:
    - __ARM_NEON == 1

Change-Id: I098b96421b7de5928bb3b11612ca1f32e7b6cbc4
2022-09-02 16:44:14 -07:00
James Zern 2faa4bfc5c x86,cosmetics: prefer _mm_setzero_si128/_mm256_setzero_si256
over *_set1_*(0)

Change-Id: I136e1798a2ce286480ebb9418db67a2f1e92b9a2
2022-09-02 16:17:52 -07:00
James Zern 447e275880 vpx_dsp,neon: simplify __ARM_FEATURE_DOTPROD check
only check that the macro is defined, the value doesn't have any effect.

from https://arm-software.github.io/acle/main/acle.html:

5.5.7.7.  Dot Product extension
  __ARM_FEATURE_DOTPROD is defined if the dot product data manipulation
  instructions are supported and the vector intrinsics are available.
  Note that this implies:
    - __ARM_NEON == 1

Change-Id: I164fe121ccefda99050a9b6a99738a2b518520f3
2022-09-02 12:21:17 -07:00
Matt Oliver 4df285b2c6 project: Add TargetPlatformMinVersion. 2022-09-03 00:53:21 +10:00
James Zern 281dfae835 neon,load_unaligned_*: use dup for lane 0
this produces better assembly with gcc (11.3.0-3); no change in assembly
using clang from the r24 android sdk (Android (8075178, based on
r437112b) clang version 14.0.1
(https://android.googlesource.com/toolchain/llvm-project
8671348b81b95fc603505dfc881b45103bee1731)

Change-Id: Ifec252d4f499f23be1cd94aa8516caf6b3fbbc11
2022-09-01 18:47:50 -07:00
James Zern 028fc1b50f test/*,cosmetics: normalize void parameter lists
replace (void) with (); use of this synonym is more common in C++ code.

Change-Id: I9813e82234dc9caa7115918a0491b0040f6afaf4
2022-08-31 16:35:08 -07:00
Yaowu Xu 9d6d0624d7 Remove const for pass-by-value parameters
This also fixes MSVC compiler warnings.

Change-Id: I20dc9ac821275ba95598f3016fc6b23e884e13b7
2022-08-30 09:09:18 -07:00
Cheng Chen ac76d3ccda Merge "L2E: Add gop size and ARF existence to frame info" into main 2022-08-30 04:25:33 +00:00
James Zern 27fd546079 highbd_variance_neon,cosmetics: reorder a few lines
Change-Id: Ia6fa54652d7f94687e64108482bb0f28ca06cf49
2022-08-26 22:12:44 -07:00
Cheng Chen fd45d11380 L2E: Add gop size and ARF existence to frame info
Pass the encode frame info to external ml model, with the information
of gop size and whether alt ref is used.

Change-Id: I55be2d3de83d7182c1a1a174e44ead7e19045c9d
2022-08-26 14:32:17 -07:00
James Zern 4bfab03e81 Merge "[NEON] Add highbd *variance* functions" into main 2022-08-26 02:07:34 +00:00
James Zern df1979e245 Merge "vpx_encoder.h: note VPX_ERROR_RESILIENT_PARTITIONS is VP8-only" into main 2022-08-26 02:01:55 +00:00
Konstantinos Margaritis 13970b7eca [NEON] Add highbd *variance* functions
Total gain for 12-bit encoding:
        * ~7.2% for best profile
        * ~5.8% for rt profile

Change-Id: I5b70415fb89d1bbb02a0c139eb317ba6b08adede
2022-08-25 21:58:34 +00:00
James Zern b0b66556dc Merge "vp9: fix ubsan sub-overflows" into main 2022-08-25 20:44:41 +00:00
James Zern 722d4daf35 vpx_encoder.h: note VPX_ERROR_RESILIENT_PARTITIONS is VP8-only
Change-Id: If71b2ec766f9f41253ce5a34987ffd208f9c8381
2022-08-25 10:50:16 -07:00
James Zern 4d24a5bca9 Merge "vp8_ratectrl_rtc_test.cc: ensure frame_type is initialized" into main 2022-08-25 16:55:42 +00:00
James Zern 7663fcb467 libs.doxy_template: remove obsolete CLASS_DIAGRAMS
This was reported with doxygen 1.9.4.

Also update the comment for CLASS_GRAPH by running "doxygen -u" because
the original comment for CLASS_GRAPH mentions the obsolete tag
'CLASS_DIAGRAMS',

Change-Id: I3bca547201f794d363bd814b7c7f7c9d7088797a
2022-08-24 18:52:10 -07:00
James Zern 2c7657202e vp8_ratectrl_rtc_test.cc: ensure frame_type is initialized
this fixes a valgrind failure:
==1095597== Conditional jump or move depends on uninitialised value(s)
==1095597==    at 0x12E0CC: (anonymous
namespace)::Vp8RcInterfaceTest::PreEncodeFrameHook(libvpx_test::VideoSource*,
libvpx_test::  > Encoder*) (vp8_ratectrl_rtc_test.cc:131)
==1095597==    by 0x1255A9:
libvpx_test::EncoderTest::RunLoop(libvpx_test::VideoSource*)
(encode_test_driver.cc:205)

Bug: webm:1776
Change-Id: Id3b40f62573ee513e79c74b6315c71b6ecd22c9a
Fixed: webm:1776
2022-08-24 15:57:02 -07:00
James Zern cef289f4cd Merge "[NEON] Improve vpx_quantize_b* functions" into main 2022-08-24 19:18:25 +00:00
clang-format a3c9b9126d .clang-format: update to clang-format-11
only store the deltas from --style Google in the file and reapply using
Debian clang-format version 11.1.0-6+build1

Bug: b/229626362
Change-Id: I3e18a2e7c17a90a48405b3cf1b37ebc652aba0db
2022-08-23 15:39:57 -07:00
Konstantinos Margaritis daae445b2a [NEON] Improve vpx_quantize_b* functions
Slight optimization, prefetch gives a 1% improvement in 1st pass

Change-Id: Iba4664964664234666406ab53893e02d481fbe61
2022-08-23 10:29:01 +00:00
James Zern a689fe68a3 vp9_ratectrl_rtc_test: initialize loopfilter_ctrl[]
this was added in:
  7beafefd1 vp9: Allow for disabling loopfilter per spatial layer
but the test doesn't zero initialize its svc_params_ member.

fixes the use of an uninitialized value, reported by valgrind and
integer sanitizer:
[ RUN      ] VP9/RcInterfaceSvcTest.Svc/0
==1064682== Conditional jump or move depends on uninitialised value(s)
==1064682==    at 0x1C5624: loopfilter_frame (vp9_encoder.c:3285)
==1064682==    by 0x1C9B54: encode_frame_to_data_rate (vp9_encoder.c:5595)
==1064682==    by 0x1CA2EE: SvcEncode (vp9_encoder.c:5789)
==1064682==    by 0x1CEA01: vp9_get_compressed_data (vp9_encoder.c:7891)
==1064682==    by 0x185F0E: encoder_encode (vp9_cx_iface.c:1437)
==1064682==    by 0x1503BB: vpx_codec_encode (vpx_encoder.c:208)

vp9/encoder/vp9_svc_layercontext.c:362:26: runtime error: implicit
conversion from type 'int' of value -1 (32-bit, signed) to type
'LOOPFILTER_CONTROL' changed the value to 4294967295 (32-bit, unsigned)
    #0 0x558925f45377 in vp9_restore_layer_context vp9/encoder/vp9_svc_layercontext.c:362:26
    #1 0x558925ef89fd in vp9_get_compressed_data vp9/encoder/vp9_encoder.c:7781:5
    #2 0x558925e3ef3e in encoder_encode vp9/vp9_cx_iface.c:1437:20

Bug: b/229626362
Change-Id: I33d244be7752c68b71efa9c62ca45d6b202ec761
2022-08-22 19:33:26 -07:00
James Zern f88dae639c Merge "vp9.read_inter_block_mode_info: return on corruption" into main 2022-08-22 22:36:09 +00:00
James Zern 7ab8fa2ac0 Merge "highbd_quantize_neon.c: remove unneeded assert.h" into main 2022-08-22 22:21:46 +00:00
James Zern 431ab4e626 Merge "vp9,search_new_mv: descale rather than scale sse" into main 2022-08-22 22:21:28 +00:00
James Zern 249d93e147 Merge changes Iabed118b,I60a384b2 into main
* changes:
  use VPX_NO_UNSIGNED_SHIFT_CHECK with entropy functions
  compiler_attributes.h: add VPX_NO_UNSIGNED_SHIFT_CHECK
2022-08-22 22:21:00 +00:00
Konstantinos Margaritis a6d95698fe [NEON] Add vpx_highbd_subtract_block function
Total gain for 12-bit encoding:
    * ~1% for best and rt profile

Change-Id: I4039120dc570baab1ae519a5e38b1acff38d81f0
2022-08-22 19:54:43 +00:00
Konstantinos Margaritis d050161f0d [NEON] Added vpx_highbd_sad* functions
Total gain for 12-bit encoding:
    * ~7.8% for best profile
    * ~10% for rt profile

Change-Id: I89eda5c4372a5b628c9df84cdeb4c8486fc44789
2022-08-22 18:09:35 +00:00
James Zern a8980078a1 highbd_quantize_neon.c: remove unneeded assert.h
Change-Id: I041f5fb23b856a2b519669b5bf8a40d3772b4a6e
2022-08-22 10:48:40 -07:00
James Zern b652b1da51 Merge "[NEON] Added vpx_highbd_quantize_b* functions" into main 2022-08-22 17:45:52 +00:00
Scott LaVarnway 0154634923 Merge "Fix TEST_P(SADx4Test, DISABLED_Speed)" into main 2022-08-22 10:36:09 +00:00
Konstantinos Margaritis ebf4caa857 [NEON] Added vpx_highbd_quantize_b* functions
Total gain for 12-bit encoding:
    * ~4.8% for best profile
    * ~6.2% for rt profile

Change-Id: I61e646ab7aedf06a25db1365d6d1cf7b05101c21
2022-08-20 19:37:58 +00:00
James Zern f66f2b9312 Merge "loopfilter.c: normalize flat func param type" into main 2022-08-20 00:00:06 +00:00
James Zern 595bf7022a vp9.read_inter_block_mode_info: return on corruption
with block sizes < 8x8 previously only the inner loop was aborted. this
could cause propagation of invalid motion vectors to scale_mv().

this quiets integer sanitizer warnings of the form:
vp9/common/vp9_mvref_common.h:239:18: runtime error: implicit conversion
from type 'int' of value 32768 (32-bit, signed) to type 'int16_t' (aka
'short') changed the value to -32768 (16-bit, signed)

Bug: b/229626362
Change-Id: I58b5a425adf21542cbf4cc4dd5ab3cc5ed008264
2022-08-19 09:58:39 -07:00
James Zern b55ef982b0 use VPX_NO_UNSIGNED_SHIFT_CHECK with entropy functions
these shift values off the most significant bit as part of the process;
vp8_regular_quantize_b_sse4_1 is included here for a special case of
mask creation

quiets warnings of the form:
vp8/decoder/dboolhuff.h:81:11: runtime error: left shift of
2373679303235599696 by 3 places cannot be represented in type
'VP8_BD_VALUE' (aka 'unsigned long')

vp8/encoder/bitstream.c:257:18: runtime error: left shift of 2147493041
by 1 places cannot be represented in type 'unsigned int'

vp8/encoder/x86/quantize_sse4.c:114:18: runtime error: left shift of
4294967294 by 1 places cannot be represented in type 'unsigned int'

vp9/encoder/vp9_pickmode.c:1632:41: runtime error: left shift of
4294967295 by 1 places cannot be represented in type 'unsigned int'

Bug: b/229626362
Change-Id: Iabed118b2a094232783e5ad0e586596d874103ca
2022-08-18 19:12:59 -07:00
James Zern 002b6b1ce0 compiler_attributes.h: add VPX_NO_UNSIGNED_SHIFT_CHECK
and use it on MD5Transform(); this behavior is well defined and is only
a warning with -fsanitize=integer, not -fsanitize=undefined.

quiets warnings of the form:
md5_utils.c:163:3: runtime error: left shift of 143704723 by 7 places
cannot be represented in type 'unsigned int'

Bug: b/229626362
Change-Id: I60a384b2c2556f5ce71ad8ebce050329aba0b4e4
2022-08-18 19:12:51 -07:00
James Zern c7358d8016 vp9,search_new_mv: descale rather than scale sse
this changes from scaling best sse to downscaling base sse in
comparisons.

this quiets an integer sanitizer warning of the form:
vp9/encoder/vp9_pickmode.c:1632:41: runtime error: left shift of
4294967295 by 1 places cannot be represented in type 'unsigned int'

Bug: b/229626362
Change-Id: Iee2920474ba700a46177d4514ba6ef7691958069
2022-08-18 18:23:41 -07:00
James Zern 2694c7bc92 update_thresh_freq_fact_row_mt: normalize param types
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)

Bug: b/229626362
Change-Id: I812c6ca914507bf25cad323dea3d91a3a2ea4f1d
2022-08-18 18:23:30 -07:00
James Zern df619cb823 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)

Bug: b/229626362
Change-Id: Iacb6ae052d4cb2b6e0ebccbacf59ece9501d3b5f
2022-08-18 18:23:22 -07:00
James Zern cf5ef2b985 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
2022-08-18 23:16:33 +00:00
Scott LaVarnway 7a0e2bf1bc Fix TEST_P(SADx4Test, DISABLED_Speed)
The reference code was being timed instead of the optimized code.

Change-Id: I67eb08dcda80e20eaa075dc2c91b7e8ef5c0cdfb
2022-08-18 12:19:08 -07:00
Scott LaVarnway 37dcf75bb9 Merge "Add vp9_highbd_quantize_fp_32x32_neon()." into main 2022-08-17 10:59:57 +00:00
James Zern 9db0ec67e3 vpx_encoder.h: make flag constants unsigned
this matches the type for vpx_codec_frame_flags_t and
vpx_codec_er_flags_t and quiets int sanitizer warnings of the form:

implicit conversion from type 'int' of value -9 (32-bit, signed) to type
'unsigned int' changed the value to 4294967287 (32-bit, unsigned)

Bug: b/229626362
Change-Id: Icfc5993250f37cedb300c7032cab28ce4bec1f86
2022-08-16 21:59:20 -07:00
James Zern a76a022835 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)

Bug: b/229626362
Change-Id: I3d1ca618bf1b3cd57a5dca65a3067f351c1473f8
2022-08-16 18:25:14 -07:00
James Zern cb18d72c30 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)

Bug: b/229626362
Change-Id: Id3966912f802aee3c0f7852225b55f3057c3e76a
2022-08-16 18:25:14 -07:00
James Zern b77b6b68d3 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)

Bug: b/229626362
Change-Id: I56f74981050b2c9d00bad20e68f1b73ce7454729
2022-08-16 18:25:14 -07:00
James Zern d939886809 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)

Bug: b/229626362
Change-Id: Ia9a5dc5e1f57cbf4f8f8fa457bb674ef43369d37
2022-08-16 18:25:08 -07:00
James Zern c1fb6c6624 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)

Bug: b/229626362
Change-Id: I150cc0a6a6b85143c3bf96886686fe3a40897db5
2022-08-16 18:25:02 -07:00
James Zern d22e5a49e3 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

Bug: b/229626362
Change-Id: I01595c641763c4cd4242e02f2cc5cbabfe69d03e
2022-08-16 13:58:46 -07:00
James Zern b6f289e90a Merge "configure: add -Wc++{14,17,20}-extensions" into main 2022-08-16 20:04:09 +00:00
Scott LaVarnway 37a3999f5a Add vp9_highbd_quantize_fp_32x32_neon().
Up to 2.6x faster than vp9_highbd_quantize_fp_32x32_c() for full
calculations.

Bug: b/237714063

Change-Id: Icfeff2ad4dcd57d0ceb47fe04789710807b9cbad
2022-08-16 08:36:04 -07:00
James Zern fecec6293f simple_encode.cc: clear -Wextra-semi-stmt warnings
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);

Bug: b/229626362
Change-Id: I1c9b0ae9927cdd7c31da000633bcb6e2b8242cd4
2022-08-15 17:27:52 -07:00
James Zern 2f2ede692e Merge "examples/svc_encodeframe.c: rm empty {}s in switch" into main 2022-08-15 23:21:53 +00:00
Scott LaVarnway f73d07dfd6 Merge "VPX: Add vp9_highbd_quantize_fp_neon()." into main 2022-08-15 21:34:42 +00:00
Scott LaVarnway c13788bae9 vp9_quantize_fp_32x32_neon() cleanup.
No change in performance.

Bug: b/237714063

Change-Id: If6ad5fc27de4babe0bfff3fdbb4b7fd99a0544ab
2022-08-15 12:01:41 -07:00
Scott LaVarnway 763167aac7 VPX: Add vp9_highbd_quantize_fp_neon().
Up to 4.1x faster than vp9_highbd_quantize_fp_c() for full
calculations.

~1.3% overall encoder improvement for the test clip used.

Bug: b/237714063

Change-Id: I8c6466bdbcf1c398b1d8b03cab4165c1d8556b0c
2022-08-15 10:45:43 -07:00
James Zern 14b8eaf7da examples/svc_encodeframe.c: rm empty {}s in switch
these have been unnecessary since:
0e97e7049 remove spatial svc experiment

Bug: b/229626362
Change-Id: I57528af4dcb9092b752161c8eaba2e2808c29c5f
2022-08-14 15:58:09 -07:00
James Zern 33b385ec4e configure: add -Wc++{14,17,20}-extensions
the snapshot of googletest and the test files themselves are targeting
c++11 currently; these warnings are supported by recent versions of
clang

Change-Id: I5d36b3bd4058ba1610f0c8b27cad27aadee85939
2022-08-12 22:24:39 -07:00
Scott LaVarnway c082f0ca15 Merge "VPX: vp9_quantize_fp_neon() cleanup." into main 2022-08-12 00:27:02 +00:00
Scott LaVarnway 1e07619a0a VPX: vp9_quantize_fp_neon() cleanup.
No change in performance.

Bug: b/237714063

Change-Id: I868cda7acb0de840fbc85b23f3e36c50b39c331b
2022-08-11 04:33:04 -07:00
James Zern dcb2a300ff Merge "vp9_cx_iface,encoder_encode: only calc ts when img!=NULL" into main 2022-08-10 22:38:45 +00:00
Scott LaVarnway 8786aee582 Merge "VPX: Fix vp9_quantize_fp_avx2() VS build error." into main 2022-08-09 20:20:52 +00:00
Scott LaVarnway 3c2b21c22e VPX: Fix vp9_quantize_fp_avx2() VS build error.
Add build fix for _mm256_extract_epi16() being undefined.

Bug: b/237714063

Change-Id: I855b1828ce1b6b2b2f063fe097999481881bf074
2022-08-09 10:00:33 -07:00
Cheng Chen ec4aa6d191 Use level defined min gf interval
Assume the level definition of min_gf_interval is the minimum allowed
gf_interval. We take this level comformant min_gf_interval instead of
+1.

Change-Id: I9c7e62f210c95b356e9716579ee4c19638de8e35
2022-08-08 17:35:52 -07:00
Cheng Chen 3cf0a24156 L2E: Add target level in GOP unit tests
Change-Id: Icecc3031e1052bb5a94f6c5957ec5190aae990ba
2022-08-08 17:35:52 -07:00
Cheng Chen 1560454474 Merge "Fix VP9 auto level" into main 2022-08-09 00:33:51 +00:00
James Zern 4355a392e6 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)

Bug: b/229626362
Change-Id: I68ba19b7d6de35cc185707dfb6b43406b7165035
2022-08-08 11:28:27 -07:00
Cheng Chen eaf0b5b47e Fix VP9 auto level
The iteration index is wrong, causing the starting level to be chosen
is "LEVEL_5_2", which is intended for videos of a large resolution.

Change-Id: Id88836981bdcbd7494bd06193d6a433ac75a6d2e
2022-08-08 17:46:03 +00:00
Scott LaVarnway c9f049fd91 VPX: Add vpx_subtract_block_avx2().
~1.3x faster than vpx_subtract_block_sse2().

Based on aom_subtract_block_avx2().

Bug: b/241580104

Change-Id: I17da036363f213d53c6546c3e858e4c3cba44a5b
2022-08-05 16:02:38 -07:00
James Zern aa2dc0cc72 Merge "vp9_active_[hv]_edge: add missing vpx_clear_system_state" into main 2022-08-04 18:09:02 +00:00
Scott LaVarnway 2e61a623d4 VPX: Add vp9_highbd_quantize_fp_32x32_avx2().
~4x faster than vp9_highbd_quantize_fp_32x32_c() for full
calculations.

Bug: b/237714063

Change-Id: Iff2182b8e7b1ac79811e33080d1f6cac6679382d
2022-08-03 16:45:42 -07:00
Scott LaVarnway a55e248349 VPX: Add vp9_highbd_quantize_fp_avx2().
Up to 5.37x faster than vp9_highbd_quantize_fp_c() for full
calculations.

~1.6% overall encoder improvement for the test clip used.

Bug: b/237714063

Change-Id: I584fd1f60a3e02f1ded092de98970725fc66c5b8
2022-08-03 05:39:49 -07:00
Scott LaVarnway 34ee3843e6 Merge "VPX: Add vp9_quantize_fp_32x32_avx2()." into main 2022-08-02 15:09:40 +00:00
James Zern 822bfca8e5 Merge "Provide Arm SDOT optimizations for SAD functions" into main 2022-08-01 18:21:32 +00:00
Scott LaVarnway 29db7fe975 VPX: Add vp9_quantize_fp_32x32_avx2().
Up to 1.80x faster than vp9_quantize_fp_32x32_ssse3() for full
calculations.

Bug: b/237714063

Change-Id: Ic4ae4724fce7ac85c7a089535b16a999e02f0a10
2022-08-01 11:12:38 -07:00
Wan-Teh Chang 0b3d411446 Fix off-by-one error of max w/h in validate_config
Fix the off-by-one errors of maximum g_w and g_h in validate_config().

Bug: webm:1774
Change-Id: I343783d06c1f53222be2366be79171b214486201
2022-07-29 15:46:42 -07:00
Konstantinos Margaritis b3536cfafe Provide Arm SDOT optimizations for SAD functions
Change-Id: I497ee1c45d1fc4d643cefad7d87e5aaacd77869c
2022-07-29 12:49:39 +00:00
James Zern 59acf6739c Merge changes I0c6604ef,Id7e13b3d,I7291d9bd,Ic7c0a2e7,Ic7ce0fd9, ... into main
* changes:
  x86: normalize type with _mm_cvtsi128_si32
  vp9_filter_block_plane_non420: fix implicit conversion warnings
  variance_avx2.c: fix implicit conversion warnings
  vp8,read_mb_modes_mv: fix implicit conversion warnings
  vp8_find_near_mvs: fix implicit conversion warnings
  encode_test_driver: normalize frame_flags type
  vp9,decoder_decode: fix ubsan null/zero offset warning
  y4m_input_fetch_frame: fix ubsan null/zero offset warning
2022-07-29 02:05:22 +00:00
James Zern 1ce49998f7 vp9_active_[hv]_edge: add missing vpx_clear_system_state
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'

Bug: b/229626362
Change-Id: Ic9a5063c840b4fce7056f61362234721add056a6
2022-07-27 18:56:22 -07:00
James Zern 4667992d8b 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)

Bug: b/229626362
Change-Id: I0c6604efc188f2660c531eddfc7aa10060637813
2022-07-27 16:59:21 -07:00
James Zern e533d989ea vp9_filter_block_plane_non420: fix implicit conversion warnings
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)

Bug: b/229626362
Change-Id: Id7e13b3d494ccd1a2351db8fab6fdb6a9a771d51
2022-07-27 16:59:21 -07:00
James Zern aecf7ba51a 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)

Bug: b/229626362
Change-Id: I7291d9bd5cacea0d88d9f4c4624c096764f4a472
2022-07-27 16:59:21 -07:00
James Zern b6d06a6e26 vp8,read_mb_modes_mv: fix implicit conversion warnings
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)

Bug: b/229626362
Change-Id: Ic7c0a2e7b64a1dd6fd5cc64adcd5765318c2a956
2022-07-27 16:59:21 -07:00
James Zern 9763f3c549 vp8_find_near_mvs: fix implicit conversion warnings
unsigned -> int and vice versa

reported by clang -fsanitize=integer

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)

Bug: b/229626362
Change-Id: Ic7ce0fd98255ccf9307ac73e9fb6a8189b268214
2022-07-27 15:37:11 -07:00
James Zern 7dab508cd9 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)

Bug: b/229626362
Change-Id: I0fc1dbe44a258f397cf1a05347d8cb86ee70b1b8
2022-07-27 15:37:11 -07:00
James Zern ed78231aa5 vp9,decoder_decode: fix ubsan null/zero offset warning
reported under clang-13. null data may be passed as a flush; move
data_end after that check

vp9/vp9_dx_iface.c:337:40: runtime error: applying zero offset to null
pointer

Bug: b/229626362
Change-Id: I845726fd6eb6ac7a776e49272c6477a5ad30ffdf
2022-07-27 15:37:11 -07:00
James Zern 1c0c4d51b4 y4m_input_fetch_frame: fix ubsan null/zero offset warning
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

Bug: b/229626362
Change-Id: Ia3250d6ff9c325faf48eaa31f4399e20837f8f7b
2022-07-27 15:37:06 -07:00
Scott LaVarnway ce484db211 VPX: vp9_quantize_fp_avx2() cleanup.
No change in performance.

Bug: b/237714063

Change-Id: I8ea42759cc4dc57be6a29c23784997cb90ad4090
2022-07-27 10:59:49 -07:00
Scott LaVarnway 9c09d36ee7 Merge "VPX: Add vpx_highbd_quantize_b_32x32_avx2()." into main 2022-07-27 12:54:09 +00:00
James Zern ea13f315c9 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

Change-Id: I9b2c9bf27c16975e4855df6a2c967da4c8c63a3a
2022-07-26 18:17:39 -07:00
Scott LaVarnway 90ef3906a2 VPX: Add vpx_highbd_quantize_b_32x32_avx2().
Up to 11.78x faster than vpx_quantize_b_32x32_sse2() for full
calculations.

~1.7% overall encoder improvement for the test clip used.

Bug: b/237714063

Change-Id: Ib759056db94d3487239cb2748ffef1184a89ae18
2022-07-26 04:41:17 -07:00
Scott LaVarnway 90c5493ff5 VPX: Add vpx_highbd_quantize_b_avx2().
Up to 3.61x faster than vpx_highbd_quantize_b_sse2() for full
calculations.

~2.3% overall encoder improvement for the test clip used.

Bug: b/237714063
Change-Id: I23f88d2a7f96aaa4103778372f4f552207f73cee
2022-07-25 17:16:44 +00:00
Scott LaVarnway 78c9a61f79 Merge "VPX: Add vpx_quantize_b_32x32_avx2()." into main 2022-07-25 11:38:13 +00:00
Cheng Chen 6c007885b4 Merge "L2E: Add more unit tests for GOP API" into main 2022-07-22 20:27:51 +00:00
Cheng Chen 4e504233f8 L2E: Add more unit tests for GOP API
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.

Change-Id: I4079ff5065da79834b363b1e1976f65efed3f91f
2022-07-21 22:46:08 -07:00
James Zern 59b27f758c avg_intrin_avx2: rm dead store in highbd_hadamard_8x8
missed in:
53dd1e8e7 avg_intrin_{sse2,avg2}: rm dead store in hadamard_8x8

Change-Id: I378e4a388ceb193a4cfee4d9d317fc62fcc4b39e
2022-07-20 09:59:43 -07:00
James Zern a36d42f8bd 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);

Bug: b/229626362
Change-Id: Ie9e06c9b9442ffa134e514d2aee70841d19c8ecb
2022-07-20 09:59:38 -07:00
James Zern cc8610e189 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);

Bug: b/229626362
Change-Id: I54899ed0a207ca685416bed3a0e9c9644668e163
2022-07-19 16:36:15 -07:00
Scott LaVarnway 414b4f0512 VPX: Add vpx_quantize_b_32x32_avx2().
Up to 1.36x faster than vpx_quantize_b_32x32_avx() for full
calculations. Up to 1.29x faster for VP9_HIGHBITDEPTH builds.

Bug: b/237714063

Change-Id: I97aa6a18d4dc2f3187b76800f91bbba7be447ef1
2022-07-19 06:13:34 -07:00
James Zern 53dd1e8e78 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));
                                                ^           ~~~~~~~~~~

Bug: b/229626362
Change-Id: I4b0201bd39775885df0afc03fa5da70910b9dad6
2022-07-18 21:50:48 -07:00
James Zern a5ead0427c vpx_int_pro_row_c: add an assert for height
this quiets a static analysis warning with clang 11:

vpx_dsp/avg.c:353:15: warning: Assigned value is garbage or undefined
[core.uninitialized.Assign]
    hbuf[idx] /= norm_factor;
              ^  ~~~~~~~~~~~

the same fix was applied in libaom:
1ad0889bc aom_int_pro_row_c: add an assert for height

Bug: b/229626362
Change-Id: Ic8a249f866b33b02ec9f378581e51ac104d97169
2022-07-18 19:11:28 -07:00
Matt Oliver a656a12ab2 project: Update for 1.12.0 merge. 2022-07-16 17:21:29 +10:00
Matt Oliver 5f243f4891 Merge commit '03265cd42b3783532de72f2ded5436652e6f5ce3'
# Conflicts:
#	vpx_dsp/x86/sad_sse3.asm
#	vpx_dsp/x86/sad_sse4.asm
#	vpx_dsp/x86/sad_ssse3.asm
2022-07-16 15:17:59 +10:00
Cheng Chen 68d9e7aa2f L2E: Update the description of allow_alt_ref
It is fixed per each encoding and can not be changed per GOP.

Change-Id: I5905b712437142f2274bfa674ceef6093495457f
2022-07-14 16:29:35 -07:00
James Zern 168b312774 vpxenc: fix --disable-loopfilter help alignment
Change-Id: I34444e6437ca0e735d6db07bf98bfa4741ad2c01
2022-07-13 21:56:29 -07:00
Konstantinos Margaritis cc8236f1d2 Actually include the fix for commit 8f4d1890c.
Change-Id: I6780f610151f2e092da525ff064d4b69f74fa61b
2022-07-13 17:21:31 +00:00
Scott LaVarnway 68c68ae959 Merge "VPX: Add vpx_quantize_b_avx2()." into main 2022-07-11 21:48:55 +00:00
James Zern fefc38a0a5 Merge "vp8_macros_msa.h: avoid shadowing variables in defines" into main 2022-07-11 20:23:28 +00:00
Scott LaVarnway e2603ead67 VPX: Add vpx_quantize_b_avx2().
Up to 1.58x faster than vpx_quantize_b_avx() depending
on the size.

Bug: b/237714063

Change-Id: I595a6bb32ebee63f69f27b5a15322fdeae1bf70e
2022-07-11 13:12:05 -07:00
James Zern 5b3cdae38c Merge "Revert "Revert "[NEON] Optimize vp9_diamond_search_sad() for NEON""" into main 2022-07-11 19:58:21 +00:00
James Zern 873aab02ad vp8_macros_msa.h: avoid shadowing variables in defines
this avoids a warning with certain versions of gcc; observed with:
mipsisa32r6el-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110

Change-Id: I8999f487a79a9d53133816d572054b2423330bcf
2022-07-09 14:49:54 -07:00
Konstantinos Margaritis 8f4d1890cb Revert "Revert "[NEON] Optimize vp9_diamond_search_sad() for NEON""
This reverts commit 9f1329f8ac
and fixes a dumb mistake in evaluation of vfcmv. Used vdupq_n_s16,
instead of vdupq_n_s32.

Change-Id: Ie236c878c166405c49bc0f93f6d63a6715534a0a
2022-07-08 21:37:46 +00:00
Scott LaVarnway db2cafa7d9 Merge "VPX: Add quantize speed test for ref vs opt." into main 2022-07-07 22:15:45 +00:00
Scott LaVarnway ba56eafb57 VPX: Add quantize speed test for ref vs opt.
Bug: b/237714063

Change-Id: I4304ba8d976fed3613e28442983b04a9cfc15b79
2022-07-07 13:09:43 -07:00
James Zern 933b6b90a5 Revert "Fix bug with smaller width bigger size"
This reverts commit 5b530fc962.

This fixes memory related fuzzer failures in the decoder.

Bug: webm:1642
Bug: oss-fuzz:48609
Bug: oss-fuzz:48629
Bug: oss-fuzz:48632
Bug: oss-fuzz:48638
Bug: oss-fuzz:48639
Bug: oss-fuzz:48651
Bug: oss-fuzz:48657
Bug: oss-fuzz:48659
Bug: oss-fuzz:48660
Bug: oss-fuzz:48661
Bug: oss-fuzz:48680
Bug: oss-fuzz:48686
Bug: oss-fuzz:48697
Bug: oss-fuzz:48706
Bug: oss-fuzz:48712
Bug: oss-fuzz:48717
Bug: oss-fuzz:48728
Bug: oss-fuzz:48732
Bug: oss-fuzz:48780
Bug: oss-fuzz:48781
Bug: oss-fuzz:48782
Bug: oss-fuzz:48785
Change-Id: I67a8539a3083f00eec1164fef5c6a8bc209f91fc
2022-07-06 15:10:39 -07:00
Jerome Jiang 7b65e46983 Merge "Fix bug with smaller width bigger size" into main 2022-07-01 14:37:32 +00:00
Jerome Jiang 5b530fc962 Fix bug with smaller width bigger size
Bug: webm:1642

Change-Id: I831b7701495eebeeff6bdc0b570f737bb6d536c6
2022-06-30 18:43:38 -04:00
Jerome Jiang dbac8e01e0 ABI compatibility to CHANGELOG for prev releases.
Bug: webm:1757
Change-Id: I19576aa0bc065045dcb0eaf770ae5b0d9ac9d684
2022-06-30 16:22:12 -04:00
Marco Paniconi 711bef6740 rtc: Add svc test for profile 2 10/12 bit
Add TODO to fix the superframe parser
for 10/12 bit.

Change-Id: Ib76c4daa0ff2f516510829ead6a397c89abba2f3
2022-06-29 14:43:17 -07:00
Marco Paniconi 896b59f44d 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).

Change-Id: I3a2e40effa53c505f44ef05aaa3132e1b7f57dd5
2022-06-28 19:29:20 -07:00
Jerome Jiang f43636a3e0 Merge "Merge tag 'v1.12.0' into main" into main 2022-06-28 22:59:24 +00:00
Jerome Jiang b355ab5046 Add vp8_ prefix for quantize_lsx.c
Duplicate name as vpx_dsp/loongarch/quantize_lsx.c
Chromium update script fails.

Bug: webm:1755
Change-Id: Ifb956c2292d909496eb2b9e1833993f1b021b07e
2022-06-28 21:19:54 +00:00
Jerome Jiang 90a63a0de0 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.

Change-Id: I6964e96bccf016f977cc6e83dc0a192d66a19618
2022-06-28 17:07:31 -04:00
Jerome Jiang 03265cd42b Replace date with version and release from README
CHANGELOG has the date.

Bug: webm:1752
Change-Id: I2888ce2afed8619f043eee1e9ca23bdf9d75e607
2022-06-28 15:00:48 -04:00
Cheng Chen ec58d55c3a L2E: Distinguish fixed and active gf_interval
min/max_gf_interval is fixed and can be passed from the command line.
It must satisfy the level constraints.

active_min/max_gf_interval might be changing based on
min/max_gf_interval. It is determined per GOP.

Change-Id: If456c691c97a8b4c946859c05cedd39ca7defa9c
2022-06-27 13:58:54 -07:00
James Zern 10178e6161 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.

Bug: webm:1773
Change-Id: I38cf9f83e7c085eb8e87d5cf6db7dc75359b611b
(cherry picked from commit 08b86d7622)
2022-06-21 16:03:10 -04:00
James Zern 1584682025 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

Bug: webm:1773
Change-Id: I62fba5fb51d8afa422689b7de3f03e8f7570e50b
Fixed: webm:1773
(cherry picked from commit 95d196fdf4)
2022-06-21 16:02:50 -04:00
Jerome Jiang 5df4da4026 Update CHANGELOG for L2E
Bug: webm:1752
Change-Id: I5335e0360501503d5c162be4bbdef3ad73151e9f
2022-06-21 14:54:16 -04:00
Jerome Jiang 03d4c6fed9 Update CHANGELOG and version info
A stale codec control was removed, but compatibility was restored.

New codec control was added.

Bump *current* and *age*, and keep *revision* as 0.

Bug: webm:1752
Bug: webm:1757

Change-Id: I76179f129a10c06d897b5c62462808ed9b9c2923
2022-06-17 18:35:21 -04:00
James Zern 08b86d7622 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.

Bug: webm:1773
Change-Id: I38cf9f83e7c085eb8e87d5cf6db7dc75359b611b
2022-06-17 10:07:28 -07:00
James Zern 95d196fdf4 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

Bug: webm:1773
Change-Id: I62fba5fb51d8afa422689b7de3f03e8f7570e50b
Fixed: webm:1773
2022-06-17 10:07:08 -07:00
James Zern 638e0b7bba Merge "vp9,encoder: fix some integer sanitizer warnings" into main 2022-06-14 01:24:23 +00:00
Jerome Jiang 027d710a6e Restore backward compatibility
This CL breaks the backward compatibility:

1365e7e1a vp9-svc: Remove VP9E_SET_TEMPORAL_LAYERING_MODE

Forcing the value of the next element

Bug: webm:1752
Change-Id: I83c774b3aa6cca25f2f14995590fb20c0a1668d4
(cherry picked from commit 013ec5722c)
2022-06-13 18:24:55 -04:00
Jerome Jiang 878266136b Update AUTHORS
Bug: webm:1752
Change-Id: I08b4100a0e8c003cd9a7bdaf72926c268e02d53c
2022-06-13 16:36:07 -04:00
Jerome Jiang 013ec5722c Restore backward compatibility
This CL breaks the backward compatibility:

1365e7e1a vp9-svc: Remove VP9E_SET_TEMPORAL_LAYERING_MODE

Forcing the value of the next element

Bug: webm:1752
Change-Id: I83c774b3aa6cca25f2f14995590fb20c0a1668d4
2022-06-13 16:29:31 -04:00
Wan-Teh Chang 46bfeed2c9 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.

Change-Id: I55ce1cf8cc62e07333d8a902d65b46343a3d5881
2022-06-10 16:08:20 -07:00
Cheng Chen 7b1b9f7cd2 L2E: Use libvpx's default q in case of invalid external value
If the external model recommends an invalid q value, we use the
default q selected by libvpx's rate control strategy.

We update the test so that when the external model wants to control
GOP decision, it could get per frame information and just recommend
an invalid q.

Change-Id: I69be4b0ee0800e7ab0706d305242bb87f001b1f7
2022-06-07 11:42:25 -07:00
Cheng Chen 7bb4bd3612 L2E: rename 'gop_index' to 'gop_global_index'
'gop_index' has already been used in vpx_rc_encodeframe_info_t,
which represents the frame index inside the current
group of picture (gop).

We therefore use 'gop_global_index' to represent the index of
the current gop to avoid duplicate names.

Change-Id: I3eb8987dd878f650649b013e0036e23d0846b5f0
2022-06-06 22:38:10 -07:00
Cheng Chen b216340736 L2E: send first pass stats before gop decisions
This change let the encoder send first pass stats before gop
decisioins so that external models could make use of it.

Change-Id: Iafc7eddab93aa77ceaf8e1f7663a52b27d94af80
2022-06-06 14:53:46 -07:00
Cheng Chen 3c5529e313 L2E: Use bit mask to represent control type
The bit mask allows us to easily add an additional control mode
which both the QP and GOP are controlled by an external model.

Change-Id: I49f676f622a6e70feb2a39dc97a4e5050b7f4760
2022-06-06 12:45:25 -07:00
James Zern 883292030b Merge "libs.mk,build/make/Makefile: make test targets ordinary rules" into main 2022-06-03 17:39:48 +00:00
James Zern db754a4532 vp9_change_config: check vp9_alloc_loop_filter return
Change-Id: I4cba67a5ab192d1cf1dbfb5c039a93a4952b071e
(cherry picked from commit 6549e76307)
2022-06-03 10:18:32 -04:00
James Zern 6e7f636396 vp9e_set_config: setjmp before calling vp9_change_config
vp9_change_config may call functions that perform allocations which
expect failures detected by CHECK_MEM_ERROR to not return.

Change-Id: I1dd1eca9c661ed157d51b4a6a77fc9f88236d794
(cherry picked from commit 3997d9bc62)
2022-06-03 10:18:21 -04:00
James Zern 386f25be53 vp8e_set_config: setjmp before calling vp8_change_config
vp8_change_config may call vp8_alloc_compressor_data which expects
failures detected by CHECK_MEM_ERROR to not return.

Change-Id: Ib7fbf4af904bd9b539402bb61c8f87855eef2ad6
(cherry picked from commit 365eebc147)
2022-06-03 10:17:58 -04:00
James Zern 9546c699fb 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
2022-06-02 21:51:20 -07:00
James Zern 22610e3bbc Merge ".gitignore: add android studio / vscode folders" into main 2022-06-03 00:49:18 +00:00
James Zern 7bddf81451 Merge changes I4cba67a5,I1dd1eca9,Ib7fbf4af into main
* changes:
  vp9_change_config: check vp9_alloc_loop_filter return
  vp9e_set_config: setjmp before calling vp9_change_config
  vp8e_set_config: setjmp before calling vp8_change_config
2022-06-02 23:44:29 +00:00
James Zern abfca783ed test/*: normalize use of nullptr
this is preferred over NULL in C++11

Change-Id: Ic48ddcc6dfb8975a57f6713549ad04d93db21415
(cherry picked from commit c304ec38d0)
2022-06-02 19:34:59 -04:00
James Zern 36c9b2d690 .gitignore: add android studio / vscode folders
Change-Id: I039a96bc33f55d9ba8bca9f9f6b69135659d2351
2022-06-02 16:34:21 -07:00
Cheng Chen b0a819825e Merge "L2E: Return error when GOP model is not set" into main 2022-06-02 20:38:43 +00:00
Cheng Chen 4e7c56332d L2E: Return error when GOP model is not set
- Return error instead of OK when GOP model is not set.
- Update descriptions for a few variables.

Change-Id: I213f6b7085c487507c3935e7ce615e807f4474cc
2022-06-01 22:18:45 -07:00
James Zern 3dc6aa01ba 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

Bug: webm:1767
Change-Id: Icfa4179e13bc98a36ac29586b60d65819d3ce9ee
Fixed: webm:1767
2022-06-01 19:03:44 -07:00
James Zern 6549e76307 vp9_change_config: check vp9_alloc_loop_filter return
Change-Id: I4cba67a5ab192d1cf1dbfb5c039a93a4952b071e
2022-05-31 22:15:55 -07:00
James Zern 3997d9bc62 vp9e_set_config: setjmp before calling vp9_change_config
vp9_change_config may call functions that perform allocations which
expect failures detected by CHECK_MEM_ERROR to not return.

Change-Id: I1dd1eca9c661ed157d51b4a6a77fc9f88236d794
2022-05-31 22:15:55 -07:00
James Zern 365eebc147 vp8e_set_config: setjmp before calling vp8_change_config
vp8_change_config may call vp8_alloc_compressor_data which expects
failures detected by CHECK_MEM_ERROR to not return.

Change-Id: Ib7fbf4af904bd9b539402bb61c8f87855eef2ad6
2022-05-31 22:15:43 -07:00
James Zern 9d279c88c3 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

Bug: webm:1767,webm:1768
Change-Id: I6482ff1862f19716fde3d57522591bc61d76a84f
2022-05-31 22:04:54 -07:00
James Zern 8f56e1c074 resize_test: add TODO for test failure
DISABLED_TestExternalResizeSmallerWidthBiggerSize was added for
webm:1642, but never fixed

Bug: webm:1642
Change-Id: I0fa368a44dda550241ea997068c58eaff551233c
2022-05-31 22:52:17 +00:00
James Zern d353916ab5 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

Change-Id: I6229311afaa3318a3f9bcaf40fafcc5ea71ae271
2022-05-31 18:16:02 +00:00
Cheng Chen f05314d634 Merge "L2E: Add vp9 GOP decision helper function" into main 2022-05-31 17:30:48 +00:00
Cheng Chen 305f0eeacf Merge "L2E: Add control type for the external rate control API" into main 2022-05-31 17:30:31 +00:00
James Zern c304ec38d0 test/*: normalize use of nullptr
this is preferred over NULL in C++11

Change-Id: Ic48ddcc6dfb8975a57f6713549ad04d93db21415
2022-05-27 21:57:11 -07:00
Cheng Chen 3e7685cf62 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.

Change-Id: Id129b4e1a91c844ee5c356a7801c862b1130a3d8
2022-05-27 15:02:32 -07:00
Cheng Chen 4832bcff20 L2E: Add control type for the external rate control API
Two control types are defined: QP and GOP control.
Now the API only supports the QP model.

Change-Id: Ib3a712964b9d2282c93993ee56e0558e4795fb46
2022-05-27 14:36:13 -07:00
Jerome Jiang 9f1329f8ac Revert "[NEON] Optimize vp9_diamond_search_sad() for NEON"
This reverts commit 258affdeab.

Reason for revert:

Not bitexact with C version

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

Change-Id: I5c210b3dfe1f6dec525da857dd8c83946be566fc
2022-05-26 14:20:14 +00:00
James Zern 52f3bef481 Merge changes Iecb26f38,Ib3ee9b59 into main
* changes:
  GetTempOutFile(): use testing::TempDir()
  y4m_test: check temp file ptr
2022-05-26 05:03:17 +00:00
James Zern 58919dd7f1 GetTempOutFile(): use testing::TempDir()
rather than tmpfile(). this allows for setting the path with TEST_TMPDIR
and provides a valid default for android.

Change-Id: Iecb26f381b6a6ec97da62cfa0b7200f427440a2f
2022-05-26 02:36:42 +00:00
yuanhecai 44874ab879 loongarch: Remove redundant code
Simplify architecture support code and remove redundant code
to improve efficiency.

Bug: webm:1755

Change-Id: I03bc251aca115b0379fe19907abd165e0876355b
2022-05-25 11:20:13 +08:00
James Zern c0cee345a3 y4m_test: check temp file ptr
GetTempOutFile() and TempOutFile::file() may return null if the open
fails

Change-Id: Ib3ee9b592140d30d12aecefa7dfc5f569fa28a34
2022-05-24 17:25:51 -07:00
James Zern b163db1a6a tools/*.py: update to python3
only lint-hunks.py is tested as part of the presubmit; the rest may
need further changes as they're used.

Bug: b/229626362
Change-Id: I2fd6e96deab8d892d34527e484ea65e3df86d162
2022-05-23 15:06:17 -07:00
yuanhecai f92c451e6c loongarch: Modify the representation of macros
Some macros have been changed to "#define do {...} While (0)",
change the rest to "static INLINE ..."

Bug: webm:1755

Change-Id: I445ac0c543f12df38f086b479394b111058367d0
2022-05-20 10:58:38 +08:00
yuanhecai 63378a94f9 loongarch: Reduce the number of instructions
Replace some redundant instructions to improve the efficiency
of the program.

1. txfm_macros_lsx.h
2. vpx_convolve8_avg_lsx.c
3. vpx_convolve8_horiz_lsx.c
4. vpx_convolve8_lsx.c
5. vpx_convolve8_vert_lsx.c
6. vpx_convolve_copy_lsx.c
7. vpx_convolve_lsx.h

Bug: webm:1755

Change-Id: I9b7fdf6900338a26f9b1775609ad387648684f3d
2022-05-19 14:35:22 +08:00
yuanhecai 17959f9c94 vp9[loongarch]: Optimize vpx_quantize_b/b_32x32
1. vpx_quantize_b_lsx
2. vpx_quantize_b_32x32_lsx

Bug: webm:1755

Change-Id: I476c8677a2c2aed7248e088e62c3777c9bed2adb
2022-05-18 16:19:48 +08:00
yuanhecai 1c39c62526 vp8[loongarch]: Optimize vp8_sixtap_predict4x4
1. vp8_sixtap_predict4x4

Bug: webm:1755

Change-Id: If7d844496ef2cfe2252f2ef12bb7cded63ad03dd
2022-05-17 20:53:30 +08:00
yuanhecai 508c0aff89 vp8[loongarch]: Optimize fdct8x4/diamond_search_sad
1. vp8_short_fdct8x4_lsx
2. vp8_diamond_search_sad_lsx
3. vpx_sad8x8_lsx

Bug: webm:1755

Change-Id: Ic9df84ead2d4fc07ec58e9730d6a12ac2b2d31c1
2022-05-17 20:53:25 +08:00
yuanhecai bfbb79e252 vp8[loongarch]: Optimize sub_pixel_variance8x8/16x16
1. vpx_sub_pixel_variance8x8_lsx
1. vpx_sub_pixel_variance16x16_lsx
2. vpx_mse16x16_lsx

Bug: webm:1755

Change-Id: Iaedd8393c950c13042a0597d0d47b534a2723317
2022-05-17 20:53:14 +08:00
Hao Chen 8486953e5e vp8[loongarch]: Optimize vp8 encoding partial function
1. vp8_short_fdct4x4
2. vp8_regular_quantize_b
3. vp8_block_error
4. vp8_mbblock_error
5. vpx_subtract_block

Bug: webm:1755

Change-Id: I3dbfc7e3937af74090fc53fb4c9664e6cdda29ef
2022-05-17 20:53:06 +08:00
Marco Paniconi ca89bed50d 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.

Change-Id: Ibd68e9b5c3f81728241a168d3fb3567d6845633d
2022-05-15 22:26:55 -07:00
James Zern 40a46f2034 Merge changes I7d68c7f2,If283fc08,I3b1e0a2c into main
* changes:
  vp9[loongarch]: Optimize avg_variance64x64/variance8x8
  vp9[loongarch]: Optimize fdct4x4/8x8_lsx
  vp9[loongarch]: Optimize vpx_hadamard_16x16/8x8
2022-05-13 19:15:59 +00:00
yuanhecai a44e61db29 vp9[loongarch]: Optimize avg_variance64x64/variance8x8
1. vpx_variance8x8_lsx
2. vpx_sub_pixel_avg_variance64x64_lsx

Bug: webm:1755

Change-Id: I7d68c7f2f5c8d27dc31cfd32298aeefb68f5d560
2022-05-13 15:18:14 +08:00
yuanhecai 65d9ac5b5a vp9[loongarch]: Optimize fdct4x4/8x8_lsx
1. vpx_fdct4x4_lsx
2. vpx_fdct8x8_lsx

Bug: webm:1755

Change-Id: If283fc08f9bedcbecd2c4052adb210f8fe00d4f0
2022-05-13 15:18:08 +08:00
yuanhecai 0d51bb2fc5 vp9[loongarch]: Optimize vpx_hadamard_16x16/8x8
1. vpx_hadamard_16x16_lsx
2. vpx_hadamard_8x8_lsx

Bug: webm:1755

Change-Id: I3b1e0a2c026c3806b7bbbd191d0edf0e78912af7
2022-05-13 15:18:03 +08:00
Jerome Jiang 617698706c Add aq mode 0 and 3 to active map test
Bug: webm:1762
Change-Id: Ia827f6686e8d0cdc09f3d07d07dacaa4fcd801ab
2022-05-12 23:22:20 -04:00
Marco Paniconi a6bff83a60 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

Change-Id: I462e0bdd966e4f3cb5b7bc746685916ac8808358
2022-05-12 18:28:08 -07:00
James Zern e8579cc3d4 Merge "[NEON] Optimize vp9_diamond_search_sad() for NEON" into main 2022-05-09 17:40:49 +00:00
Konstantinos Margaritis 258affdeab [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
2022-05-07 16:38:36 +03:00
James Zern cb1abee145 add some missing realloc checks
Change-Id: I0fd1e094085c18b1d9a32333e876c2affeb6de23
2022-05-06 11:55:56 -07:00
James Zern f3b4c9a8f6 vp8[cd]x.h: document vpx_codec_vp[89]_[cd]x*
+ mark the _algo variables as deprecated.
this quiets some doxygen warnings

Bug: webm:1752
Change-Id: I53b9b796c3d8fef5c713ee4278641198f95b5864
2022-05-06 11:47:06 -07:00
Jerome Jiang 8ac72859e1 vp9 svc sample: set fps from y4m file
Change-Id: I082c0409910da4cda5bf852b20ffa11ba5c2ebd6
2022-05-03 10:46:46 -04:00
James Zern 872732b2c9 examples: add missing argv_dup alloc checks
Change-Id: Ia3080cbf50071d599c7168a20466392a963f101a
2022-04-28 17:45:47 -07:00
James Zern 2858ef9ec6 Merge changes I99ee0ef3,Ie087e8be,I6b19d016,I6fb7771d,I54f83733, ... into main
* changes:
  y4m_input_open: check allocs
  fastssim,fs_ctx_init: check alloc
  vp9_get_smooth_motion_field: check alloc
  vp9_row_mt_alloc_rd_thresh: check alloc
  simple_encode,init_encoder: check buffer_pool alloc
  VP9RateControlRTC::Create: check segmentation_map alloc
  vp9_speed_features.c: check allocations
  vp9_alloc_motion_field_info: check motion_field_array alloc
  vp9_enc_grp_get_next_job: check job queue alloc
  vp9: check postproc_state.limits allocs
  vp9,encode_tiles_buffer_alloc: fix allocation check
2022-04-28 17:03:32 +00:00
yuanhecai 1b00ad5263 vp9[loongarch]: Optimize sad8x8/32x64/64x32x4d
1. vpx_sad8x8x4d_lsx
2. vpx_sad32x64x4d_lsx
3. vpx_sad64x32x4d_lsx

Bug: webm:1755

Change-Id: I08a2b8717ec8623ffdd4451a04e68fa3a7228668
2022-04-28 09:35:30 +08:00
yuanhecai b1ed8e08a2 vp9[loongarch]: Optimize sad64x64/32x32_avg,comp_avg_pred
1. vpx_sad64x64_avg_lsx
2. vpx_sad32x32_avg_lsx
3. comp_avg_pred_lsx

Bug: webm:1755

Change-Id: I58dabdcdd4265bd6ebd5670db8a132d2e838683f
2022-04-28 09:34:51 +08:00
James Zern 8baaa7b5a3 y4m_input_open: check allocs
Change-Id: I99ee0ef3ab28a22923cb413ccf5935fdc38862be
2022-04-27 15:28:53 -07:00
James Zern c3d2df2f2f fastssim,fs_ctx_init: check alloc
Change-Id: Ie087e8be1e943b94327ed520db447a0e3a927738
2022-04-26 22:22:33 -07:00
James Zern c152584107 vp9_get_smooth_motion_field: check alloc
Change-Id: I6b19d0169d127f622abf97b3b8590eee957bdc51
2022-04-26 22:22:33 -07:00
James Zern e82c5a85c9 vp9_row_mt_alloc_rd_thresh: check alloc
Change-Id: I6fb7771d9fa6ec54d81f24a02a289e8b852e7332
2022-04-26 22:22:33 -07:00
James Zern b2d57a8808 simple_encode,init_encoder: check buffer_pool alloc
Change-Id: I54f83733260abf828166400c5fd0c4c7e3ccec2f
2022-04-26 19:18:15 -07:00
James Zern a5ad89018e VP9RateControlRTC::Create: check segmentation_map alloc
Change-Id: I17b23915c32accf834def5ab26a8e4e188f9993a
2022-04-26 19:18:14 -07:00
James Zern 58fff2f9ef vp9_speed_features.c: check allocations
Change-Id: If3b319c1ce7036c2259440f4eeb2e645bf559f4c
2022-04-26 19:18:14 -07:00
James Zern 72fa1d505e vp9_alloc_motion_field_info: check motion_field_array alloc
Change-Id: I4ae11242e645feb3b85eaea186f14b3676ae40a8
2022-04-26 19:18:14 -07:00
James Zern e93e2ca0e3 vp9_enc_grp_get_next_job: check job queue alloc
+ reverse conditional order; var == constant is more readable

Change-Id: I9f2b4394024c262fd5fe9576a8bf33afe197c050
2022-04-26 19:18:14 -07:00
James Zern 1b70db4be9 vp9: check postproc_state.limits allocs
Change-Id: I9d5df96580074375e4847d2e2f60a6a6d56eeea5
2022-04-26 19:06:29 -07:00
James Zern 19b45a26c6 vp9,encode_tiles_buffer_alloc: fix allocation check
previously vp9_bitstream_worker_data was checked after it was memset();
this change uses CHECK_MEM_ERROR for consistency to ensure the pointer
is checked first

Change-Id: I532d0eb0e746dc6b8d694b616eba693c5c0053ac
2022-04-26 18:44:06 -07:00
yuanhecai f6de5b51b8 vp9[loongarch]: Optimize fdct/get/variance16x16
1. vpx_fdct16x16_lsx
2. vpx_get16x16var_lsx
3. vpx_variance16x16_lsx

Bug: webm:1755

Change-Id: I27090406dc28cfdca64760fea4bc16ae11b74628
2022-04-26 20:54:41 +08:00
James Zern 8a29e27e17 Merge changes Ib8bcefd2,I84f789ca into main
* changes:
  register_state_check.h: add compiler barrier
  add_noise_test.cc: remove stale TODO
2022-04-26 01:15:30 +00:00
James Zern d18407a171 register_state_check.h: add compiler barrier
around ASM_REGISTER_STATE_CHECK() this helps keep the call ordering
consistent avoiding some code reordering which may affect the registers
being checked

fixes issue with armv7 and multiple versions of gcc:
[ RUN      ] C/AddNoiseTest.CheckNoiseAdded/0
test/register_state_check.h:116: Failure
Expected equality of these values:
  pre_store_[i]
    Which is: 0
  post_store[i]
    Which is: 4618441417868443648

Bug: webm:1760
Change-Id: Ib8bcefd2c4d263f9fc4d4b4d4ffb853fe89d1152
Fixed: webm:1760
2022-04-25 15:21:05 -07:00
James Zern 192c85c431 add_noise_test.cc: remove stale TODO
this was completed in:
0dc69c70f postproc : fix function parameters for noise functions.

Change-Id: I84f789ca333e9690e70e696d44475dd59339593b
2022-04-25 11:20:48 -07:00
yuanhecai 76b7350cee vp9[loongarch]: Optimize sub_pixel_variance32x32/sad16x16
1. vpx_sad16x16_lsx
2. vpx_sub_pixel_variance32x32_lsx

Bug: webm:1755

Change-Id: I9926ace710903993ccbb42caef320fa895e90127
2022-04-24 17:32:10 +08:00
yuanhecai 618739f59f vp9[loongarch]: Optimize horizontal/vertical_4/dual
1. vpx_lpf_horizontal_4_lsx
2. vpx_lpf_vertical_4_lsx
3. vpx_lpf_horizontal_4_dual_lsx
3. vpx_lpf_vertical_4_dual_lsx

Bug: webm:1755

Change-Id: I12e9f27cafd9514b24cfbf2354cc66c7d1238687
2022-04-22 15:04:53 +08:00
yuanhecai 608a28e30b vp9[loongarch]: Optimize convolve8_avg_vert/convolve_copy
1. vpx_convolve8_avg_vert_lsx
2. vpx_convolve_copy_lsx
3. vpx_idct32x32_135_add_lsx

Bug: webm:1755

Change-Id: I6bdfe5836a91a5e361ab869b26641e86c5ebb68d
2022-04-22 15:03:34 +08:00
yuanhecai 2651113a64 vp9[loongarch]: Optimize vertical/horizontal_8_dual
1. vpx_lpf_vertical_8_dual_lsx
2. vpx_lpf_horizontal_8_dual_lsx

Bug: webm:1755

Change-Id: I354df02cc215f36b4edf6558af0ff7fd6909deac
2022-04-22 15:00:40 +08:00
James Zern d1cc027ae6 Merge "vp8_decode: free mt buffers early on resolution change" into main 2022-04-22 00:16:28 +00:00
James Zern f2ef29f746 fdct16x16_neon.h,cosmetics: fix include-guard case
Change-Id: I593735bb7f88d63f2ddab57484099479c8759a3d
2022-04-19 19:26:37 -07:00
James Zern 8da05d39b9 vp8_decode: free mt buffers early on resolution change
this avoids a desynchronization of mb_rows if an allocation prior to
vp8mt_alloc_temp_buffers() fails and the decoder is then destroyed

Bug: webm:1759
Change-Id: I75457ef9ceb24c8a8fd213c3690e7c1cf0ec425f
2022-04-19 17:27:39 -07:00
James Zern 665f6a3065 webmdec: fix double free
when no frames were decoded, for example due to a decoder initialization
failure, an orphan buffer pointer from webm_guess_framerate() via
webm_read_frame() would have been freed during cleanup

Change-Id: I6ea3defdd13dd75427f79c516e207b682391e4fa
2022-04-18 19:14:30 -07:00
James Zern 6ea4ef1d24 vp9_dx_iface,init_buffer_callbacks: return on alloc failure
use an error code as a jmp target is not currently set in init_decoder()

Change-Id: If7798039439f13c739298a8a92a55aaa24e2210c
2022-04-18 19:14:30 -07:00
James Zern f1d42a92bb vp9_encoder: check context buffer allocations
previously the returns for alloc_context_buffers_ext() and
vp9_alloc_context_buffers() were ignored which would result in a NULL
access during encoding should they fail

Change-Id: Icd76576f3d5f8d57697adc9ae926a3a5be731327
2022-04-18 19:14:30 -07:00
James Zern 0ca5af7e24 vp9_alloc_internal_frame_buffers: fix num buffers assignment
avoid setting num_internal_frame_buffers until the allocation is
checked, avoiding an invalid access in vp9_free_internal_frame_buffers()

Change-Id: I28a544a2553d62a6b5cb7c45bf10591caa4ebab6
2022-04-18 19:14:30 -07:00
James Zern 45fb0161b0 vp9_alloccommon: add missing pointer checks
in vp9_free_ref_frame_buffers() and vp9_free_context_buffers(); pool and
free_mi may be NULL due to earlier allocation failures

Change-Id: I3bd26ea29b3aea6c58f33d5b7f5a280eb6250ec7
2022-04-18 18:56:49 -07:00
James Zern 8064a69aba Merge changes If8318068,I21519b5b into main
* changes:
  temporal_filter_sse4,cosmetics: fix some typos
  temporal_filter_sse4: remove unused function params
2022-04-19 00:16:29 +00:00
James Zern 90749e8663 temporal_filter_sse4,cosmetics: fix some typos
Change-Id: If8318068a32da52d15c0ba595f80092611f4c847
2022-04-18 12:57:28 -07:00
James Zern 5b6914a72d Merge "Upgrade GoogleTest to v1.11.0" into main 2022-04-18 18:10:30 +00:00
James Zern 946bcdf906 Upgrade GoogleTest to v1.11.0
The release tag is release-1.11.0.

Ref: https://aomedia-review.googlesource.com/c/aom/+/156641
79c98a122 Upgrade GoogleTest to v1.11.0

Note the tree structure differs from libaom, but is left untouched to
avoid breaking test include paths in this commit.

Change-Id: Ia3c6861d45a3befc2decb1da5b1018bcfd38f95a
2022-04-18 10:01:20 -07:00
James Zern 9750257826 vp8,get_sub_mv_ref_prob: change arguments to uint32_t
this matches the call with int_mv::as_int and fixes a warning with
clang-13 -fsanitize=integer:
vp8/decoder/decodemv.c:240:32: runtime error: implicit conversion from
type 'uint32_t' (aka 'unsigned int') of value 4282515456 (32-bit,
unsigned) to type 'int' changed the value to -12451840 (32-bit, signed)

Bug: webm:1759
Change-Id: I7c0aa72baa45421929afac26566e149adc6669d7
2022-04-15 22:33:11 -07:00
James Zern c8b9bf2b28 vp8: fix some implicit unsigned -> int conversions
fixes some warnings with clang-13 -fsanitize=integer:
vp8/decoder/threading.c:77:27: 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)

these bitmask constants were missed in:
1676cddaa vp8: fix some implicit signed -> unsigned conv warnings

Bug: webm:1759
Change-Id: I5d894d08fd41e32b91b56a4d91276837b3415ee4
2022-04-15 22:32:51 -07:00
James Zern 36ea80f3d6 Merge changes I9c24f75e,I83bce11c into main
* changes:
  vp9[loongarch]: Optimize idct32x32_1024/1/34_add
  vp9[loongarch]: Optimize vpx_fdct32x32/32x32_rd
2022-04-16 04:51:13 +00:00
Jerome Jiang 3b5de1ee8c Merge "Fix int overflow in intermediate calculation" into main 2022-04-15 14:51:37 +00:00
yuanhecai 81e5841a16 vp9[loongarch]: Optimize idct32x32_1024/1/34_add
1. vpx_idct32x32_1024_add_lsx
2. vpx_idct32x32_34_add_lsx
3. vpx_idct32x32_1_add_lsx

Bug: webm:1755

Change-Id: I9c24f75e0d93613754d8e30da7e007b8d1374e60
2022-04-15 17:23:09 +08:00
yuanhecai a067d8a5bc vp9[loongarch]: Optimize vpx_fdct32x32/32x32_rd
1. vpx_fdct32x32_lsx
2. vpx_fdct32x32_rd_lsx

Bug: webm:1755

Change-Id: I83bce11c0d905cf137545a46cd756aef9cedce47
2022-04-15 17:22:55 +08:00
James Zern 73b8aade83 temporal_filter_sse4: remove unused function params
this clears warnings under clang-13 of the form:
../vp9/encoder/x86/temporal_filter_sse4.c:275:39: warning: parameter
'u_pre' set but not used [-Wunused-but-set-parameter]

Change-Id: I21519b5b0b9c21b04b174327415e0e73b56bdfda
2022-04-14 13:21:07 -07:00
Jerome Jiang 474a50c648 Fix int overflow in intermediate calculation
This is not a complete fix to webm:1751.

Bug: webm:1751
Change-Id: Ieed6c823744f5f0625d529db3746cfe4f549c8c0
2022-04-14 12:13:15 -07:00
James Zern 4b965fba78 Merge "vp9,update_mbgraph_frame_stats: rm unused variables" into main 2022-04-14 17:28:52 +00:00
James Zern a165f4ba64 vp9,update_mbgraph_frame_stats: rm unused variables
this quiets warnings under clang-13 of the form:
../vp9/encoder/vp9_mbgraph.c:222:42: warning: variable 'gld_y_offset'
set but not used [-Wunused-but-set-variable]

Change-Id: I32170b90c07058f780b4e8100ee5217232149db8
2022-04-13 22:16:30 -07:00
James Zern e87f6d0a2c vp8,define_gf_group: remove unused variable
this clears a warning under clang-13:
vp8/encoder/firstpass.c:1634:10: warning: variable
'mod_err_per_mb_accumulator' set but not used
[-Wunused-but-set-variable]

Change-Id: I694a99d56724be89090e01c45559237c0fda147a
2022-04-13 22:14:33 -07:00
yuanhecai d387c89e86 Update loongson_intrinsics.h from v1.0.5 to v1.2.1
Bug: webm:1755

Change-Id: Ib636d2aa521332b76b6aa1b0aa0a9005aafbf32b
2022-04-14 11:17:42 +08:00
yuanhecai caf65c14a8 vp9[loongarch]: Optimize vpx_variance64x64/32x32
1. vpx_variance64x64_lsx
2. vpx_variance32x32_lsx

Bug: webm:1755

Change-Id: I45c5aa94cbbf7128473894a990d931acaa40e102
2022-04-12 10:48:29 +08:00
yuanhecai 3a3645dbdc vp9[loongarch]: Optimize sad64x64/32x32/16x16
1. vpx_sad64x64x4d_lsx
2. vpx_sad32x32x4d_lsx
3. vpx_sad16x16x4d_lsx
4. vpx_sad64x64_lsx
5. vpx_sad32x32_lsx

Bug: webm:1755

Change-Id: Ief71c2216f697b261d7c1fc481c89c9f1a6098e6
2022-04-12 10:48:24 +08:00
James Zern fb2f58e118 Merge "vpxdec: add some allocation checks" into main 2022-04-11 20:28:44 +00:00
James Zern a3cd75e29b vpxdec: add some allocation checks
see also: https://crbug.com/aomedia/3244

Change-Id: I7d151e63a91b8c1a5ee4e861f0b8461eeece6a2f
2022-04-11 11:41:19 -07:00
James Zern d04f78b563 rate_hist,show_histogram: fix crash w/0 buckets
this can occur if 0 frames are encoded, e.g., due to --skip

see also: https://crbug.com/aomedia/3243

Change-Id: I791d5ad6611dbcb60d790e6b705298328ec48126
2022-04-11 11:08:12 -07:00
Cheng Chen 6e1b7c6c14 Merge "L2E: Make SimpleEncode take vp9 level as an input" into main 2022-04-05 18:25:23 +00:00
James Zern 96a509ee03 Merge changes I0b6520be,I1f006daa,I7ee8e367 into main
* changes:
  vp9[loongarch]: Optimize vpx_convolve8_avg_horiz_c
  vp8[loongarch]: Optimize dequant_idct_add_y/uv_block
  loongarch: Fix bugs
2022-04-05 02:52:06 +00:00
Johann Koenig 49808fa296 Merge "remove unused vp8_encode_intra parameter" into main 2022-04-04 00:59:23 +00:00
James Zern a3afed22ad Merge changes I4c63beeb,I28f3b98f into main
* changes:
  Revert "quantize: replace highbd versions"
  Revert "quantize: remove highbd version"
2022-03-31 21:54:24 +00:00
Johann Koenig 1ce16542f4 Merge "subpel variance: add speed test" into main 2022-03-31 21:43:47 +00:00
James Zern d00fd066e8 Revert "quantize: replace highbd versions"
This reverts commit 2200039d33.

This causes failures with VP9/EndToEndTestLarge.EndtoEndPSNRTest/*; it
seems the assembly does not match the C code.

Bug: webm:1586
Change-Id: I4c63beebf88d4c12789d681b0d38014510b147fe
2022-03-31 12:14:16 -07:00
James Zern 6ac395ed77 Revert "quantize: remove highbd version"
This reverts commit 89cfe3835c.

This is a prerequisite for reverting
2200039d33 which causes high bitdepth test
failures

Bug: webm:1586
Change-Id: I28f3b98f3339f3573b1492b88bf733dade133fc0
2022-03-31 12:14:09 -07:00
yuanhecai 8ff9f66b8d vp9[loongarch]: Optimize vpx_convolve8_avg_horiz_c
1. vpx_convolve8_avg_horiz_lsx

Bug: webm:1755

Change-Id: I0b6520be0afa1689da329f56ec6cd95c1730250c
2022-03-31 20:35:22 +08:00
yuanhecai d406064721 vp8[loongarch]: Optimize dequant_idct_add_y/uv_block
1. vp8_dequant_idct_add_uv_block_lsx
2. vp8_dequant_idct_add_y_block_lsx

Bug: webm:1755

Change-Id: I1f006daaefb2075b422bc72a3f69c5abee776e2e
2022-03-31 20:35:13 +08:00
yuanhecai 176acaf9f6 loongarch: Fix bugs
Fix bugs from loopfilter_filters_lsx.c, vpx_convolve8_avg_lsx.c

Bug: webm:1755

Change-Id: I7ee8e367d66a49f3be10d7e417837d3b6ef50bdb
2022-03-31 20:35:04 +08:00
Johann Koenig 81eb99386b Merge "quantize: remove highbd version" into main 2022-03-31 05:45:23 +00:00
Johann 89cfe3835c quantize: remove highbd version
The only difference between the code is the clamp. For
8 bit it is purely an optimization. The values outside
this range will still saturate.

Change-Id: I2a770b140690d99e151b00957789bd72f7a11e13
2022-03-31 13:07:35 +09:00
Johann e6ede58a5a remove unused vp8_encode_intra parameter
Follow it up and also remove it from other functions.

BUG=webm:1612

Change-Id: I9d3cb785ab0d68c6fcae185043c896d8a135e284
2022-03-31 10:59:50 +09:00
James Zern 19f222f8b6 Merge "Optimize FHT functions for NEON" into main 2022-03-31 01:53:51 +00:00
Johann 3c98caa6a4 subpel variance: add speed test
Was used to verify assembly speed versus an attempt to rewrite
in intrinsics.

Change-Id: I011fe5494334b8fcda04b9d54c6093dbcfc55710
2022-03-31 10:43:29 +09:00
Johann Koenig 6d1844e54d Merge "remove sad x3,x8 specializations" into main 2022-03-31 00:45:31 +00:00
Johann 2200039d33 quantize: replace highbd versions
The optimized quantize functions were already built to handle
highbd values. The only difference is the clamping. All highbd
functions expand to 32bits when running in highbd mode.

Removes vpx_highbd_quantize_32x32_sse2 as it is slower than the
C version in the worst case.

Bug: webm:1586
Change-Id: I49bf8a6a2041f78450bf43a4f655c67656b0f8d9
2022-03-31 00:43:52 +00:00
Cheng Chen 2c32425851 L2E: Make SimpleEncode take vp9 level as an input
Level conformance is standadized in vp9.
If a specific target level is set, the vp9 encoder is required to
produce conformant bitstream with limit on frame size, rate,
min alt-ref distance, etc.

This change makes the SimpleEncode environment take the target level
as an input.

To make existing tests pass, we set the level to 0.

Change-Id: Ia35224f75c2fe50338b5b86a50c84355f5daf6fd
2022-03-30 16:29:29 -07:00
Konstantinos Margaritis 247658efb0 Optimize FHT functions for NEON
[NEON]
Optimize vp9_fht4x4, vp9_fht8x8, vp9_fht16x16 for NEON

Following change #3516278, the improvement for these functions is:

Before:
     4.10%     0.75%  vpxenc   vpxenc              [.] vp9_fht16x16_c
     2.93%     0.65%  vpxenc   vpxenc              [.] vp9_fht8x8_c
     0.93%     0.77%  vpxenc   vpxenc              [.] vp9_fht4x4_c

And after the patch:

     0.69%     0.16%  vpxenc   vpxenc              [.] vp9_fht16x16_neon
     0.28%     0.28%  vpxenc   vpxenc              [.] vp9_fht8x8_neon
     0.54%     0.53%  vpxenc   vpxenc              [.] vp9_fht4x4_neon

Bug: webm:1634
Change-Id: I6748a0c4e0cfaafa3eefdd4848d0ac3aab6900e4
2022-03-30 11:35:35 +03:00
James Zern 1239be9e5f 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
2022-03-29 20:01:02 -07:00
Johann 02808ecbcc 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
2022-03-30 01:56:23 +00:00
Johann afd60bd07d remove sad x3,x8 specializations
These would compute the sum of absolute differences (sad) for a
group of 3 or 8 references. This was used as part of an exhaustive
search.

vp8 only uses these functions in speed 0 and best quality.

For vp9 this is only used with the --enable-non-greedy-mv
experiment.

This removes the 3- and 8-at-a-time optimized functions and uses
the fall back code which will process 1 or 4 (vpx_sadMxNx4d) at
a time.

For configure --target=x86_64-linux-gcc --enable-realtime-only:
libvpx.a
before: 3002424 after: 2937622 delta: 64802
after 'strip libvpx.a'
before: 2116998 after: 2073090 delta: 43908

Change-Id: I566d06e027c327b3bede68649dd551bba81a848e
2022-03-29 12:31:02 +09:00
Johann Koenig 64f58f5e0a Merge "gcc 11 warning: mismatched bound" into main 2022-03-29 03:18:02 +00:00
Johann d60b671a73 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
2022-03-29 10:56:27 +09:00
James Zern 9c424b7556 ads2armasm_ms.pl: fix thumb::FixThumbInstructions call
broken since:
642529248 ads2gas[_apple].pl: remove unused stanzas

Change-Id: I1eac77e2fe23cc3f162251e9e0102a4909f7b997
2022-03-26 10:25:18 -07:00
James Zern b0087f6cd2 Merge "Make sure only NEON FDCT functions are called." into main 2022-03-24 19:39:10 +00:00
Johann 29cde7ec1a ads2gas: maintain whitespace
Don't use tabs during conversion. Save and restore
existing spacing.

Change-Id: Ib8f443db542c091d36e9ab9836e3e3e292d711f7
2022-03-23 14:20:29 +09:00
Johann da0cfd3d59 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
2022-03-23 13:58:46 +09:00
Johann Koenig b0ee4c21ed Merge "ads2gas*.pl: strip trailing whitespace after transforms" into main 2022-03-23 04:24:28 +00:00
James Zern f6344745d9 ads2gas*.pl: strip trailing whitespace after transforms
Change-Id: I0bea977b256e464231706c72cc14a5c8b6e90775
2022-03-22 13:51:27 -07:00
Jerome Jiang f3711cae5a Fix ClangTidy style warning
Change-Id: I6c4711e488cda6b97af96d5e1b6b249786e709de
2022-03-22 13:07:31 -07:00
Konstantinos Margaritis f79d256cb2 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
2022-03-17 13:07:12 +02:00
yuanhecai bf672f23a5 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
2022-03-17 10:39:34 +08:00
yuanhecai 31441d45f7 vp9[loongarch]: Optimize convolve/convolve8_avg_c
1. vpx_convolve8_avg_lsx
2. vpx_convolve_avg_lsx

Bug: webm:1755

Change-Id: I4af5c362a94f11d0b5d1760e18326660bdbc0559
2022-03-16 12:21:21 +08:00
yuanhecai 220643c862 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
2022-03-16 12:19:46 +08:00
Johann 4ee32be84b 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
2022-03-13 07:50:37 +09:00
Johann 642529248f 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
2022-03-13 07:50:33 +09:00
James Zern 8a50f70ffc Merge "vp9[loongarch]: Optimize horizontal/vertical_8_c" into main 2022-03-03 18:35:53 +00:00
yuanhecai 624b136700 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
2022-03-03 20:37:26 +08:00
Marco Paniconi 1365e7e1a5 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
2022-03-02 11:38:38 -08:00
yuanhecai 3b21aeac8b vp9[loongarch]: Optimize lpf_horizontal/vertical_16_dual with LSX
Change-Id: I82c6bc16ea57c3f7ac5f4d212a12a5f70cb55ffc
2022-02-25 11:42:22 +08:00
James Zern 2da19ac033 svc_datarate_test.cc: remove stale TODO
Bug: webm:1554
Change-Id: I547223763b86c6a24fa32851f7b30ebab4b7472a
2022-02-11 12:43:29 -08:00
Gregor Jasny cafe7cc1f1 support visual studio 2022 (vs17)
Change-Id: I8380283d09b0c90183f224399f953dcc527181c5
2022-02-10 09:01:49 +01:00
Marco Paniconi df0d06de6d Merge "rtc-vp9: Fix intra-only for bypass mode" into main 2022-02-09 02:41:23 +00:00
Marco Paniconi 232ad814de 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
2022-02-08 13:40:24 -08:00
Lu Wang b3cc4b625d 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
2022-02-08 14:55:09 +08:00
Lu Wang 85a9bdc6cc vpx_util[loongarch]: Add loongson_intrinsics.h v1.0.5.
Bug: webm:1755

Change-Id: Id2fa999bdb8788bd4285114c748c547fa262a95e
2022-02-08 14:54:42 +08:00
Wan-Teh Chang 41f444bee8 Merge "Handle NV12 in vpx_img_chroma_subsampling()" into main 2022-02-08 02:20:35 +00:00
Wan-Teh Chang b22edeb26b Handle NV12 in vpx_img_chroma_subsampling()
Change-Id: Ibac9f6f8dcdcae0d0c10ae1a118d13baf2407270
2022-02-05 14:32:49 -08:00
Wan-Teh Chang e2cc35cb67 Update error messages in validate_img()
Change-Id: I4aa6d2e16e077d29e4e9eabfc7056fcfed6786d6
2022-02-05 12:14:37 -08:00
Marco Paniconi 0156be2ab3 Merge "rtc-vp9: Fix to tests for intra-only frame." into main 2022-02-03 17:04:46 +00:00
Marco Paniconi 74c0f504c4 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
2022-02-02 19:07:46 -08:00
James Zern 847a0ef84f vp9_roi_test: apply iwyu
Change-Id: I715c27e329495940d989f95df65ac10e021261d2
2022-02-01 16:30:24 -08:00
James Zern fc2a31cfb9 vp9_thread_test: parameterize VP9DecodeMultiThreadedTest
on a per-file basis; this will make sharding more effective

Change-Id: Ib797681a7cc3bd7ec835bb0c1c7a8d9f23512a0d
2022-02-01 12:26:21 -08:00
Jerome Jiang 5eab88970a Merge "Use background segmentation mask with ROI" into main 2022-01-31 15:17:22 +00:00
Matt Oliver 9d7b81da66 Update README.markdown 2022-01-31 10:44:11 +11:00
Matt Oliver fa0122decc project: Update appveyor yasm version. 2022-01-31 10:31:19 +11:00
James Zern 8fb2686f8b Merge "vpx/vp8[cd]x.h,cosmetics: normalize ctrls to enum order" into main 2022-01-29 03:20:41 +00:00
James Zern 0494625b7b vpx/vp8[cd]x.h,cosmetics: normalize ctrls to enum order
Change-Id: I49bbd956b3a64008d1abe54de87d7831bc3eede6
2022-01-28 12:25:47 -08:00
Jin Bo 479758aeb1 libvpx[loongarch]: Add loongarch support.
LSX and LASX are enabled by default if compiler supports them.

Bug: webm:1754

Change-Id: Ic36b113bc4313c50e9d2bbab91199b3aa46d00dc
2022-01-28 16:05:51 +08:00
James Zern f7941622f2 Merge changes I2db20130,I4e643c83 into main
* changes:
  vp8dx.h,cosmetics: normalize #define/type order
  vp8dx.h: add missing define for VP9_SET_BYTE_ALIGNMENT
2022-01-27 21:16:55 +00:00
James Zern db7ef15281 Merge "fix some include guards" into main 2022-01-27 21:16:08 +00:00
Jerome Jiang 8a0af65f34 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
2022-01-27 13:12:29 -08:00
James Zern 531c60e2a2 vp8dx.h,cosmetics: normalize #define/type order
Change-Id: I2db20130cc366bead5e576b375479917f9aee024
2022-01-26 19:44:33 -08:00
James Zern 9353509586 vp8dx.h: add missing define for VP9_SET_BYTE_ALIGNMENT
Change-Id: I4e643c837bb010bd58f4fc8179045f8df18f8ae1
2022-01-26 19:41:41 -08:00
James Zern ae5d16173d fix some include guards
Change-Id: I0233d352c134bdda3ca160d41b4671d1c45ab01c
2022-01-26 15:05:22 -08:00
James Zern a0233ebcd8 Merge "libwebm: update to libwebm-1.0.0.28-28-gee0bab5" into main 2022-01-26 18:40:27 +00:00
James Zern 395732f679 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
2022-01-25 20:06:59 -08:00
Jianhui Dai 82014b6675 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
2022-01-19 11:11:51 +08:00
Jerome Jiang 51415c4076 Revert "Set unused reference frames to first ref"
This reverts commit e7f33a53cf.

Change-Id: I54e807220885cb78af6f3c6e48b3eb2c9f1e70b4
2022-01-11 08:49:12 -08:00
Jerome Jiang 6982214de5 Revert "Add vp9 ref frame to flag map function"
This reverts commit 44e611482e.

Change-Id: Ic900cc01be4de7983fab42178a488277efab77b3
2022-01-11 08:47:34 -08:00
Jianhui Dai 44e611482e Add vp9 ref frame to flag map function
Change-Id: I371c2346b9e0153c0f8053cab399ce14cd286c56
2022-01-01 12:34:28 +08:00
James Zern 6b68c81892 Merge "vp9_prob_diff_update_savings_search_model: quiet conv warnings" into main 2021-12-22 03:03:11 +00:00
James Zern b685d6f02f 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
2021-12-21 13:33:58 -08:00
James Zern 94972ca7ea 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
2021-12-21 11:45:56 -08:00
Fyodor Kyslov e478500ff2 Merge "vp9 encoder: fix test failure on 32 bit arch" into main 2021-12-16 22:29:13 +00:00
Fyodor Kyslov 6bf761a7ef vp9 encoder: fix test failure on 32 bit arch
test fails with memory error. Reducing testing resolution

bug: webm:1750
Change-Id: I75664088022aa660bdf6e69de2d11121db44716f
2021-12-15 23:14:18 -08:00
Marco Paniconi 72d8c6616a Merge "Set unused reference frames to first ref" into main 2021-12-15 19:27:09 +00:00
Fyodor Kyslov 79d4362b12 Merge "vp9 encoder: fix integer overflows" into main 2021-12-15 02:51:31 +00:00
Fyodor Kyslov ea042a676e vp9 encoder: fix integer overflows
fixing integer overflow with 16K content and enabling the test

Bug: webm:1750
Fixed: webm:1750
Change-Id: I76eebd915bcae55bc755613251a98e1716dea4c0
2021-12-14 10:01:50 -08:00
Jianhui Dai e7f33a53cf 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
2021-12-11 19:11:18 +08:00
James Zern 7f45e94d9a Merge "vp9_diamond_search_sad_avx: quiet -Wmaybe-uninitialized warning" into main 2021-12-10 19:42:06 +00:00
James Zern b2b4e79b75 Merge "vp[89]_initalize_enc(): protect against multiple invocations" into main 2021-12-10 18:32:44 +00:00
James Zern 03a8106846 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
2021-12-09 18:37:01 -08:00
James Zern 3cff8be3d8 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
2021-12-09 18:06:05 -08:00
James Zern f3e2a690cd 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
2021-12-09 17:36:31 -08:00
James Zern 7fbcee49da quiet -Warray-parameter warnings
w/gcc-11
this matches the definition of the function with the declaration

Change-Id: I757b731b9560cb0b0ceec4ec258ec5af5a183b3d
2021-12-09 11:11:19 -08:00
James Zern fc46500115 Merge "test_intra_pred_speed: match above ext w/reconintra" into main 2021-12-09 18:03:55 +00:00
James Zern 093a8c4824 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
2021-12-08 21:35:26 -08:00
James Zern 69146697b5 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
2021-12-08 19:34:47 -08:00
James Zern ab35ee100a 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
2021-12-07 13:26:30 -08:00
James Zern 31b954debe clear -Wextra-semi/-Wextra-semi-stmt warnings
Bug: chromium:1257449
Change-Id: Ia9aafccc09b611521d4a7aedfe3723393a840c62
2021-12-02 16:53:20 -08:00
Matt Oliver 60906e44b4 project: Add appveyor VS2022 build. 2021-11-25 23:09:05 +11:00
James Zern 13f984c216 Merge "vp9 encoder: fix row-mt crash w/thread config change" into main 2021-11-19 03:06:17 +00:00
James Zern 1794f6db24 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
2021-11-18 14:47:27 -08:00
James Zern 13b7ae5d8f Merge "vp9 encoder: fix some integer overflows" into main 2021-11-18 22:35:20 +00:00
Johann Koenig 6627a7c35b Merge "replaced bsr() with get_msb() from bitops.h" into main 2021-11-18 07:13:09 +00:00
Fyodor Kyslov 2d9e4d3c7a 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
2021-11-17 21:17:09 -08:00
Johann Koenig 52cfa1ca35 Merge "faster vp8_regular_quantize_b_sse4_1" into main 2021-11-18 04:41:58 +00:00
Ilya Kurdyukov 87ce2bc3e3 replaced bsr() with get_msb() from bitops.h
The modified line should now compile into two instructions instead of four.

Change-Id: Ie2eb6b13ff1e29b3107cb9e76f37ff9065504316
2021-11-18 03:24:52 +00:00
Ilya Kurdyukov 4a5a0a9a79 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
2021-11-17 04:07:50 +00:00
James Zern c0ba429863 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
2021-11-16 19:59:58 -08:00
Johann Koenig 7a37d69cae Merge "MacOS 12 is darwin21" into main 2021-11-17 03:35:50 +00:00
Yunqing Wang 4569745514 Merge "test/DummyVideoSource::ReallocImage: check img_ alloc" into main 2021-11-16 21:47:09 +00:00
Johann c59de7bc91 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
2021-11-17 06:05:34 +09:00
Mikko Koivisto bf93b61f78 vp9: fix ubsan sub-overflows
Fix errors reported by UBSan diagnostics:
1. /vp9/encoder/vp9_pickmode.c:308:29: unsigned integer overflow:
   99 - 100 cannot be represented in type 'unsigned int'
2. /vp9/encoder/vp9_pickmode.c:330:27: unsigned integer overflow:
   21976 - 21978 cannot be represented in type 'unsigned int'
3. /vp9/encoder/vp9_pickmode.c:468:13: unsigned integer overflow:
   18852144 - 18852149 cannot be represented in type 'unsigned int'

(Notice that line numbers might vary a bit because fixes have
been applied incrementally i.e. fix for error #1 affects line
number reported in #2)

Fix by calculating difference instead of wrapping around to
a value near maximum.

Test: Cuttlefish webrtc with VP9 codec
Change-Id: I4f85712028647e915a4e2da31e4b0a266e9e2705
2021-11-16 13:11:38 +00:00
Mikko Koivisto 9fb780c5e7 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
2021-11-16 05:32:39 +00:00
Matt Oliver ff822c78c2 project: Support VS2022. 2021-11-14 22:11:10 +11:00
James Zern 7e4c6fed0c test/DummyVideoSource::ReallocImage: check img_ alloc
prevents a crash on the next line accessing img_ members

Bug: aomedia:3191
Change-Id: I430fb4ee662b0001629096eb8b554f8a2b30cce0
2021-11-11 13:43:29 -08:00
James Zern 2d2637547d Merge "update libwebm to libwebm-1.0.0.28-20-g206d268" into main 2021-11-11 21:09:38 +00:00
James Zern ec80f88c5d 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
2021-11-10 21:30:07 +00:00
James Zern 888bafc78d 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
2021-11-08 16:30:16 -08:00
James Zern 16333de289 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
2021-11-08 13:43:09 -08:00
James Zern 2e73da326a 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
2021-11-08 13:43:09 -08:00
James Zern 1676cddaaa vp8: fix some implicit signed -> unsigned conv warnings
and vice-versa mostly when dealing with bitmasks

w/clang-11 -fsanitize=undefined

Change-Id: I6d8f676bf87679ba1dad9cb7f55eea172103d9d3
2021-11-08 13:43:09 -08:00
James Zern 40c21ff6fe 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
2021-11-08 13:43:09 -08:00
James Zern 23796337ce 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
2021-11-08 13:09:21 -08:00
James Zern 69d08cb9d3 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
2021-11-08 13:04:09 -08:00
James Zern ca93fc740e 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
2021-11-04 16:41:33 -07:00
James Zern fd2fcaecb8 Merge "update tools/cpplint.py" into main 2021-11-04 20:01:01 +00:00
James Zern f3b95b1f56 update tools/cpplint.py
https://github.com/google/styleguide.git
100755 blob 4a82bde4f95cef8103520bc2c019483397ec51f4    cpplint/cpplint.py

Bug: aomedia:3178
Change-Id: I9e11d647096fc2082b18d74731026dabb52639bb
2021-11-03 16:23:06 -07:00
James Zern dd10ac8f69 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
2021-11-02 17:21:56 -07:00
James Zern 340f60524f 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
2021-11-02 17:21:30 -07:00
Matt Oliver b78dc572e8 project: Update for 1.11.0 merge. 2021-10-20 06:49:33 +11:00
Matt Oliver a67686b374 Merge commit '626ff35955c2c35b806b3e0ecf551a1a8611cdbf' 2021-10-20 06:47:02 +11:00
Matt Oliver 97257813a2 project: Correctly export DATA types. 2021-10-20 04:32:25 +11:00
James Zern c56ab7d0c6 Merge "vp8_yv12_realloc_frame_buffer: move allocation check" into main 2021-10-15 20:08:58 +00:00
James Zern e259e6951d 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
2021-10-12 11:57:39 -07:00
James Zern 73400ca025 Merge "Android.mk: import LICENSE indicators from AOSP" into main 2021-10-11 20:32:51 +00:00
James Zern 9039995e94 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
2021-10-09 10:33:37 -07:00
James Zern 27b8a778bd 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
2021-10-08 16:26:26 -07:00
Jerome Jiang f644f5b75d Merge branch 'smew' into main
Bug: webm:1732

Change-Id: Id782a897d8005d316dc5b72859657c219edabf30
2021-10-07 10:48:36 -07:00
Jerome Jiang 626ff35955 Update AUTHORS and version info in libs.mk
Bug: webm:1732
Change-Id: I29ce77c7d02bd2f5cb0ef8412333df032744b668
2021-10-06 10:41:19 -07:00
James Zern 2ea1b908d8 {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
2021-10-04 11:46:48 -07:00
Jerome Jiang 7aabd69682 Merge changes If2ef4400,I345970b7 into main
* changes:
  vpx_roi_map: add delta range info
  {vp8,vp9}_set_roi_map: fix validation with INT_MIN
2021-10-04 17:43:28 +00:00
James Zern fe3b58cffa vpx_roi_map: add delta range info
Change-Id: If2ef4400562075b4e7abadc01638a46c0c7f1859
2021-10-01 15:52:43 -07:00
James Zern fccaa5fa7a {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
2021-10-01 15:52:38 -07:00
Marco Paniconi fd70206fa4 Merge "vp8: Condition decimation drop logic on drop_frames_allowed" into main 2021-10-01 22:25:12 +00:00
Marco Paniconi 167de33ca8 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
2021-10-01 13:19:29 -07:00
Marco Paniconi f8733b3fb7 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
2021-10-01 11:58:37 -07:00
Jerome Jiang 16837ae168 CHANGELOG for Smew v1.11.0
Bug: webm:1732
Change-Id: I6038f401cf1dfdcaca85b81d0b8b2c04967b44dd
2021-09-28 15:00:17 -07:00
Jerome Jiang d00e68ad87 Cap duration to avoid overflow
Bug: webm:1728
Change-Id: Id13475660fa921e8ddcc89847e978da4c8d85886
(cherry picked from commit 09775194ff)
2021-09-27 15:18:25 -07:00
Wan-Teh Chang 5df4195b43 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 8a6fbc0b4e)
2021-09-27 15:17:19 -07:00
Jerome Jiang b68877a7eb 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
2021-09-24 14:56:00 -07:00
Jerome Jiang f84650be2d Merge "vp8 rc: support temporal layers" into main 2021-09-23 22:10:57 +00:00
Jerome Jiang 0de415cf6a vp8 rc: support temporal layers
Change-Id: I2c7d5de0e17b072cb763f1659b1badce4fe0b82b
2021-09-23 13:30:49 -07:00
Jerome Jiang b247f6e8e4 Merge "Cap duration to avoid overflow" into main 2021-09-22 17:27:26 +00:00
Jerome Jiang 09775194ff Cap duration to avoid overflow
Bug: webm:1728
Change-Id: Id13475660fa921e8ddcc89847e978da4c8d85886
2021-09-21 10:11:51 -07:00
Jerome Jiang 7366195e5a vp8 rc: explicit cast to avoid VS build failure
Change-Id: I6a4daca12b79cf996964661e1af85aa6e258b446
2021-09-16 10:19:09 -07:00
Wan-Teh Chang 8a6fbc0b4e 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
2021-09-10 15:54:51 -07:00
Jerome Jiang 65a1751e5b 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
2021-09-10 10:46:26 -07:00
Jerome Jiang ca40ca9bed vp8 rc: always update correction factor
Change-Id: Id40b9cb5a85a15fb313a2a93f14f6768259f7c15
2021-09-08 16:52:51 -07:00
Jerome Jiang ee73384f03 Add codec control for vp8 external rc
disable cyclic refresh

Change-Id: I7905602919d5780831fad840577e97730ce0afc2
2021-09-02 16:20:24 -07:00
Jerome Jiang 59c9e1d87e 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
2021-08-24 16:09:40 -07:00
James Zern 15a75b4530 Merge "vpx_ports/x86.h: sync with aom_ports/x86.h" into main 2021-07-30 00:48:08 +00:00
Hirokazu Honda f685d508da vp9 rc: Fills VP9_COMP zero at initialization
Change-Id: Ib1a544ce87e8fdbe23c0e54b6426ee228011b126
2021-07-30 02:42:35 +09:00
James Zern 0d1aec7373 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
2021-07-26 16:52:56 -07:00
Peter Kasting fc04a9491e Fix some instances of -Wunused-but-set-variable.
Bug: chromium:1203071
Change-Id: Ieb628f95d676ba3814b5caf8a02a884330928c77
2021-07-26 22:01:01 +00:00
Yunqing Wang 3db0921ec3 Merge "Remove unused old FP_MB_STATS code" into main 2021-07-26 20:13:38 +00:00
Yunqing Wang e050db0b8c Merge "Clean up allow_partition_search_skip code" into main 2021-07-26 19:19:02 +00:00
Yunqing Wang 977e77006e Merge "Disable allow_partition_search_skip feature" into main 2021-07-25 22:42:59 +00:00
Yunqing Wang 0973ac05ba Remove unused old FP_MB_STATS code
Change-Id: I78ac1f8ce1598de295efd2ac1fe8244072d9b501
2021-07-23 22:49:09 -07:00
Yunqing Wang 7c00f0ce18 Clean up allow_partition_search_skip code
Change-Id: Ia05157fc3e613d93f10df5abddd77a740a0005ca
2021-07-23 22:37:01 -07:00
Yunqing Wang cf64eb2805 Disable allow_partition_search_skip feature
This feature was added to help speed up still images and slideshows.
It didn't work anymore, and thus was disabled. Code cleanup will
follow.

This had negligible impact to regular test sets. Borg test result
on ugc360p set at speed 3.
  avg_psnr:  ovr_psnr:  ssim:    speed:
   -0.244    -0.278    -0.153    -0.973

Change-Id: If74edabce0c93be1361e645ffd2eec063c2db76b
2021-07-23 22:36:41 -07:00
Jerome Jiang 1d13d705a5 Merge "Add control to get QP for all spatial layers" into main 2021-07-23 18:20:39 +00:00
Jerome Jiang 4a4ea28a38 Add control to get QP for all spatial layers
Change-Id: I77a9884351e71649c8f8632293d9515c60f6adbc
2021-07-22 17:02:12 -07:00
Jerome Jiang c382caa4d1 Merge "Use round to be more accurate casting float to int" into main 2021-07-22 17:07:58 +00:00
Jerome Jiang cd260eba10 Add cyclic refresh to vp9 rtc external ratecontrol
Change-Id: Ia2a881399aa31ca0f34481b975362ddd4ad87f1c
2021-07-21 10:38:06 -07:00
Jerome Jiang 6b4b82fd7a Use round to be more accurate casting float to int
Change-Id: Ifd5961917831752b176dd75d39d6b2cba6ce72fa
2021-07-20 17:02:38 -07:00
Jerome Jiang 0702d5ab27 Merge "Refactor rtc rate control test" into main 2021-07-19 21:00:35 +00:00
Jerome Jiang f9b565f7ec Refactor rtc rate control test
Remove golden files. Run actual encoding as the ground truth.

Change-Id: I1cea001278c1e9409bb02d33823cf69192c790a4
2021-07-19 12:44:29 -07:00
Bohan Li b1f2532b4d Avoid chroma resampling for 420mpeg2 input
BUG=aomedia:3080

Change-Id: I4ed81abf4b799224085485560f675c10c318cde6
2021-07-15 23:06:56 +00:00
Jerome Jiang 76ad30b6fb Add codec control for rtc external ratectrl lib
This will do 3 things:

Turn off low motion computation
Turn off gf update constrain on key frame frequency
turn off content mode for cyclic refresh

Those are used to verify the external ratectrl lib works as expected.

Change-Id: Ic6e61498de82d6b3973e58df246cf5e05f838680
2021-07-13 21:51:37 -07:00
Wan-Teh Chang 69fc604636 Check for addition overflows in vpx_img_set_rect()
Check for x + w and y + h overflows in vpx_img_set_rect().

Move the declaration of the local variable 'data' to the block it is
used in.

Change-Id: I6bda875e1853c03135ec6ce29015bcc78bb8b7ba
2021-07-09 12:48:00 -07:00
Wan-Teh Chang df7dc31cdf Document vpx_img_set_rect() more precisely
Document the side effects and return value of vpx_img_set_rect() more
precisely.

Change-Id: Id1120bc478ff090a70b4ddd23c4798026bbefe10
2021-07-09 12:45:55 -07:00
Yaowu Xu 826d7ca4d9 Merge "Avoid overflow in calc_iframe_target_size" into main 2021-07-08 19:59:34 +00:00
Jerome Jiang 002f14078f Merge "Add codec control to get loopfilter level" into main 2021-07-02 22:59:08 +00:00
Jerome Jiang c64022fa3c Add codec control to get loopfilter level
Change-Id: I70d417da900082160e7ba53315af98eceede257c
2021-07-02 11:33:04 -07:00
James Zern 350b0b47f2 ratectrl_rtc.h: quiet MSVC int64_t->int conv warning
target_bandwidth is int64_t, but layer_target_bitrate[0] is an int. this
is safe in the only place it's set because target_bandwidth defaults to
1000. target_bandwidth is later used to populate the cpi's target, which
is an unsigned int so there may be further fixes/cleanups that can be
done.

Change-Id: I35dbaa2e55a0fca22e0e2680dcac9ea4c6b2815a
2021-07-01 22:20:30 -07:00
Jorge E. Moreira 5f345a9246 Avoid overflow in calc_iframe_target_size
The changed product was observed to attempt to multiply 1800 by 2500000,
which overflows unsigned 32 bits. Converting to unsigned 64 bits first
and testing whether the final result fits in 32 bits solves the problem.

BUG=b:179686142

Change-Id: I5d27317bf14b0311b739144c451d8e172db01945
2021-07-01 20:32:22 -07:00
Marco Paniconi 40e7b4a5be Merge "vp9-rtc: Extract content dependency in cyclic refresh" into main 2021-06-29 18:34:46 +00:00
Cheng Chen 7c5574a635 Merge "Disallow skipping transform and quantization" into main 2021-06-29 16:48:29 +00:00
Matt Oliver 95fbe8c53f project: Update github token. 2021-06-27 14:27:12 +10:00
Cheng Chen fe1c7d2d8c Disallow skipping transform and quantization
The encoder has a feature to skip transform and quantization based
on model rd analysis. It could happen that the model
based analysis lets the encoder skips transform and quantization, while
a bad prediction occurs, leading to bad reconstructed blocks, which
are intrusive and apparently coding errors.

We add a speed feature to guard the skipping feature.
Due to the risk of bad perceptual quality, we disallow such skipping
by default.

On hdres test set, speed 2, the coding performance difference is 0.025%,
speed difference is 1.2%, which can be considered non significant.

BUG=webm:1729

Change-Id: I48af01ae8dcc7a76c05c695f3f3e68b866c89574
2021-06-25 16:31:58 -07:00
Marco Paniconi 67bfbcfbf7 vp9-rtc: Extract content dependency in cyclic refresh
For usage in the external RC. When content_mode = 0,
the cyclic refresh has no dependency on the content
(motion, spatial variance, motion vectors, etc,).

The content_mode = 0, when compared to content_mode = 1,
on rtc set for speed 7: has some regression on some
clips (~3-5%), but overall/average bdrate loss is
about ~1-2%.

Comparing aq_mode=3 with content_mode = 0, vs aq_mode=3:
about ~14% avg/overall bdrate gain, but has ~3-7% regression
on some hard motion clip (e.g.m street).

Change-Id: I93117fabb8f7f89032c15baf1292b201e8c07362
2021-06-25 13:24:12 -07:00
Jerome Jiang bd53f0cc9f Add constructor to VP9RateControlRtcConfig
Also add max_inter_bitrate_pct

Change-Id: Ie2c0e7f1397ca0bb55214251906412cdf24e42e2
2021-06-25 10:56:49 -07:00
Jerome Jiang eebc5cd487 Merge "rc: turn off gf constrain for external RC" into main 2021-06-22 22:13:38 +00:00
Jerome Jiang a00c56373e rc: turn off gf constrain for external RC
Added a new flag in rate control which turns off gf interval constrain
on key frame frequency for external RC.

It remains on for libvpx.

Change-Id: I18bb0d8247a421193f023619f906d0362b873b31
2021-06-22 13:05:25 -07:00
James Zern 7c1b546457 Merge "test-data.sha1: add missing sha sums" into main 2021-06-22 03:02:58 +00:00
Angie Chiang 49370b9c2a Merge changes I9f0852a0,Ieecb98a7 into main
* changes:
  Add use_simple_encode_api to oxcf
  Fix flaky assertions in SimpleEncode
2021-06-22 01:44:02 +00:00
Angie Chiang 0bb7bb6df8 Add use_simple_encode_api to oxcf
Use this flag to change the encoder behavior when
SimpleEncode APIs are used

BUG=webm:1733

Change-Id: I9f0852a03ff99faa01cdd8eee8ab71718cc58632
2021-06-21 14:39:40 -07:00
Angie Chiang a1fdfbb174 Fix flaky assertions in SimpleEncode
Bug: webm:1731

Change-Id: Ieecb98a7ac19e6291acd5d51432dc6a3789e9552
2021-06-21 14:38:13 -07:00
James Zern 9873d61b25 test-data.sha1: add missing sha sums
for rc_interface_test_one_layer_vbr and
rc_interface_test_one_layer_vbr_periodic_key added in:
1f45e7b07 vp9 rc: add vbr to rtc rate control library

Change-Id: I8bfa3698284c8ff289e830f7b8fa1ca42b752563
2021-06-21 13:33:44 -07:00
Jerome Jiang 4546b5db47 Merge "vp9 rc: add vbr to rtc rate control library" into main 2021-06-18 23:25:53 +00:00
Jerome Jiang 1f45e7b07e vp9 rc: add vbr to rtc rate control library
Change-Id: I3d2565572c2b905966d60bcaa6e5e6f057b1bd51
2021-06-18 14:47:43 -07:00
James Zern 2380e13da8 normalize vp9_calc_[ip]frame declarations and definitions
fixes warnings under visual studio:

vp9\encoder\vp9_ratectrl.c(2012): warning C4028: formal parameter 1
different from declaration
vp9\encoder\vp9_ratectrl.c(2027): warning C4028: formal parameter 1
different from declaration

Change-Id: Ia0740db597fb7a259f90d362b483f58662f9f584
2021-06-18 13:38:03 -07:00
Marco Paniconi 338013712e vp9: Adjust logic for gf update in 1 pass vbr
This reduces some regression when external RC
is used, for which avg_frame_low_motion is not
set/updated (=0).

Change-Id: I2408e62bd97592e892cefa0f183357c641aa5eea
2021-06-17 12:18:49 -07:00
Chunbo Hua 364f0e31fe Initialize VP9EncoderConfig profile and bit depth
Change-Id: I5c42013a08677cdef8d47f348458118338ff0138
2021-06-16 19:30:25 -07:00
Jerome Jiang a945f344e0 Change the data path in svc rate control test
Change-Id: Iba58e2aa2578964b5c8b48ab0acbee9b44bcdada
2021-06-15 14:55:29 -07:00
Marco Paniconi 9a25e3169b vp9-rtc: Refactor 1 pass vbr rate control
This refactoring is needed to allow the
RC_rtc library to support VBR.

Change-Id: I863a4a65096fed06b02307098febf7976360e0f3
2021-06-14 16:11:23 -07:00
James Zern d85c54d4e8 Update some comments for rc_target_bitrate
this mirrors the change from libaom:
5b150b150 Update some comments for rc_target_bitrate

Change-Id: Iaabee5924e0320609a29dc8ab71327923fb4c5d2
2021-06-11 16:34:41 -07:00
James Zern 5d678fe78a simple_encode: fix some -Wsign-compare warnings
Bug: webm:1731
Change-Id: I1db777c0c3a8784fb3dcf7cd39f78ebf833ab915
2021-06-09 15:08:15 -07:00
James Zern 71d09c34ff simple_encode_test: fix input file path
this allows the file to be located in LIBVPX_TEST_DATA_PATH similar to
other test sources.

Bug: webm:1731
Change-Id: I51606635d91871e7c179aa8d20d4841b0d60b6ad
2021-06-09 14:54:35 -07:00
Cheng Chen 463d33145d L2E: properly init two pass rc parameters
Two pass rc parameters are only initialized in the second pass
in vp9 normal two pass encoding.
However, the simple_encode API queries the keyframe group, arf group,
and number of coding frames without going throught the two pass
route.
Since recent libvpx rc changes, parameters in the TWO_PASS
struct have a great influence on the determination of the above
information.
We therefore need to properly init two pass rc parameters in
the simple_encode related environment.

Change-Id: Ie14b86d6e7ebf171b638d2da24a7fdcf5a15c3d9
2021-06-07 17:41:23 -07:00
Cheng Chen b8273e8ae5 Fix simple encode
Properly init and delete cpi struct in simple encode functions.

Change-Id: I6e66bcac852cbb3dec9b754ba3fb01a348ac98b8
2021-05-26 15:17:18 -07:00
Chunbo Hua d42b93a15f Fixed redundant wording for decoder algorithm interface
Change-Id: Id56e03dc9cf6d4e70c4681896f29893a9b4c76f2
2021-05-26 02:05:25 -07:00
James Zern 76a4e44563 Merge changes I2e86b005,I971c6261,I87fe4dad
* changes:
  Use 'ptrdiff_t' instead of 'int' for pointer offset parameters
  Implement vpx_convolve8_avg_vert_neon using SDOT instruction
  Merge transpose and permute in Neon SDOT vertical convolution
2021-05-25 03:00:47 +00:00
James Zern 2c6a6171a7 Merge "img_alloc_helper: make align var unsigned" 2021-05-25 02:37:05 +00:00
Jonathan Wright dbda032fcf Use 'ptrdiff_t' instead of 'int' for pointer offset parameters
A number of the load/store functions in mem_neon.h use type 'int' for
the 'stride' pointer offset parameter. This causes Clang to generate
the following warning every time these functions are called with a
wider type passed in for 'stride':

warning: implicit conversion loses integer precision: 'ptrdiff_t'
(aka 'long') to 'int' [-Wshorten-64-to-32]

This patch changes all such instances of 'int' to 'ptrdiff_t'.

Bug: b/181236880
Change-Id: I2e86b005219e1fbb54f7cf2465e918b7c077f7ee
2021-05-24 17:12:23 -07:00
Jonathan Wright 35bce9389e Implement vpx_convolve8_avg_vert_neon using SDOT instruction
Add an alternative AArch64 implementation of
vpx_convolve8_avg_vert_neon for targets that implement the Armv8.4-A
SDOT (signed dot product) instruction.

The existing MLA-based implementation of vpx_convolve8_avg_vert_neon
is retained and used on target CPUs that do not implement the SDOT
instruction (or CPUs executing in AArch32 mode). The availability of
the SDOT instruction is indicated by the feature macro
__ARM_FEATURE_DOTPROD.

Bug: b/181236880
Change-Id: I971c626116155e1384bff4c76fd3420312c7a15b
2021-05-24 17:12:19 -07:00
Jonathan Wright 10823f5468 Merge transpose and permute in Neon SDOT vertical convolution
The original dot-product implementation of vpx_convolve8_vert_neon
used a separate transpose before and after the convolution operation.
This patch merges the first transpose with the TBL permute (necessary
before using SDOT to compute the convolution) to significantly reduce
the amount of data re-arrangement. This new approach also allows for
more effective data re-use between loop iterations.

Co-authored by: James Greenhalgh <james.greenhalgh@arm.com>

Bug: b/181236880
Change-Id: I87fe4dadd312c3ad6216943b71a5410ddf4a1b5b
2021-05-24 17:08:32 -07:00
Jonathan Wright 66c1ff6850 Implement vpx_convolve8_avg_horiz_neon using SDOT instruction
Add an alternative AArch64 implementation of
vpx_convolve8_avg_horiz_neon for targets that implement the Armv8.4-A
SDOT (signed dot product) instruction.

The existing MLA-based implementation of vpx_convolve8_avg_horiz_neon
is retained and used on target CPUs that do not implement the SDOT
instruction (or CPUs executing in AArch32 mode). The availability of
the SDOT instruction is indicated by the feature macro
__ARM_FEATURE_DOTPROD.

Bug: b/181236880
Change-Id: Ib435107c47c485f325248da87ba5618d68b0c8ed
2021-05-18 13:33:46 -07:00
Jonathan Wright 4808d831db Optimize remaining mse and sse functions in variance_neon.c
Implement sum of squared difference calculations in vpx_mse16x16_neon
and vpx_get4x4sse_cs_neon using the ABD and UDOT instructions -
instead of widening subtracts followed by a sequence of MLAs.

The existing implementation is retained for use on CPUs that do not
implement the Armv8.4-A UDOT instruction. This commit also updates
the variable names used in the existing implementations to be more
descriptive.

Bug: b/181236880
Change-Id: Id4ad8ea7c808af1ac9bb5f1b63327ab487e4b1c7
2021-05-13 15:41:15 -07:00
Jonathan Wright 231aa6ae32 Implement vertical convolution using Neon SDOT instruction
Add an alternative AArch64 implementation of vpx_convolve8_vert_neon
for targets that implement the Armv8.4-A SDOT (signed dot product)
instruction.

The existing MLA-based implementation of vpx_convolve8_vert_neon is
retained and used on target CPUs that do not implement the SDOT
instruction (or CPUs executing in AArch32 mode). The availability of
the SDOT instruction is indicated by the feature macro
__ARM_FEATURE_DOTPROD.

Bug: b/181236880
Change-Id: Iebb8c77aba1d45b553b5112f3d87071fef3076f0
2021-05-12 14:03:52 -07:00
Jonathan Wright c8b0432505 Implement Neon variance functions using UDOT instruction
Accelerate Neon variance functions by implementing the sum of squares
calculation using the Armv8.4-A UDOT instruction instead of 4 MLAs.

The previous implementation is retained for use on CPUs that do not
implement the Armv8.4-A dot product instructions.

Bug: b/181236880
Change-Id: I9ab3d52634278b9b6f0011f39390a1195210bc75
2021-05-12 14:03:05 -07:00
Jonathan Wright 2db85c269b Use ABD and UDOT to implement Neon sad_4d functions
Implementing sad16_neon using ABD, UDOT instead of ABAL, ABAL2 saves
a cycle and removes resource contention for a single SIMD pipe on
modern out-of-order Arm CPUs. The UDOT accumulation into 32-bit
elements also allows for a faster reduction at the end of each SAD
function.

The existing implementation is retained for CPUs that do not
implement the Armv8.4-A UDOT instruction, and CPUs executing in
AArch32 mode.

Bug: b/181236880
Change-Id: Ibd0da46e86751d2f808c7b1e424f82b046a1aa6f
2021-05-10 15:20:29 +01:00
Jonathan Wright 0f563e5fad Optimize Neon reductions in sum_neon.h using ADDV instruction
Use the AArch64-only ADDV and ADDLV instructions to accelerate
reductions that add across a Neon vector in sum_neon.h. This commit
also refactors the inline functions to return a scalar instead of a
vector - allowing for optimization of the surrounding code at each
call site.

Bug: b/181236880
Change-Id: Ieed2a2dd3c74f8a52957bf404141ffc044bd5d79
2021-05-09 20:12:48 +01:00
James Zern 43df64a9ac img_alloc_helper: make align var unsigned
quiets an integer sanitizer warning:
vpx/src/vpx_image.c:101:25: runtime error: implicit conversion from
type 'int' of value -2 (32-bit, signed) to type 'unsigned int' changed
the value to 4294967294 (32-bit, unsigned)

Change-Id: Ifeac31cc80811081c1ba10aadaa94dc36cd46efa
2021-05-07 19:35:25 -07:00
Jonathan Wright f7364c0574 Manually unroll the inner loop of Neon sad16x_4d()
Manually unrolling the inner loop is sufficient to stop the compiler
getting confused and emitting inefficient code.

Co-authored by: James Greenhalgh <james.greenhalgh@arm.com>

Bug: b/181236880
Change-Id: I860768ce0e6c0e0b6286d3fc1b94f0eae95d0a1a
2021-05-07 11:49:37 -07:00
Jonathan Wright a28d43658e Optimize Neon SAD reductions using wider ADDP instruction
Implement AArch64-only paths for each of the Neon SAD reduction
functions, making use of a wider pairwise addition instruction only
available on AArch64.

This change removes the need for shuffling between high and low
halves of Neon vectors - resulting in a faster reduction that requires
fewer instructions.

Bug: b/181236880
Change-Id: I1c48580b4aec27222538eeab44e38ecc1f2009dc
2021-05-07 11:49:26 -07:00
James Zern 7ef83148cf Merge "Implement horizontal convolution using Neon SDOT instruction" 2021-05-05 19:57:10 +00:00
Jonathan Wright c1f77a3689 Implement horizontal convolution using Neon SDOT instruction
Add an alternative AArch64 implementation of vpx_convolve8_horiz_neon
for targets that implement the Armv8.4-A SDOT (signed dot product)
instruction.

The existing MLA-based implementation of vpx_convolve8_horiz_neon is
retained and used on target CPUs that do not implement the SDOT
instruction (or CPUs executing in AArch32 mode). The availability of
the SDOT instruction is indicated by the feature macro
__ARM_FEATURE_DOTPROD.

Co-authored by: James Greenhalgh <james.greenhalgh@arm.com>

Change-Id: I5337286b0f5f2775ad7cdbc0174785ae694363cc
2021-05-05 16:07:18 +01:00
James Zern 12a1491394 vp9_denoiser_neon,horizontal_add_s8x16: use vaddlv w/aarch64
this reduces the number of instructions to compute the sum

Change-Id: Icae4d4fb3e343d5b6e5a095c60ac6d171b3e7d54
2021-05-04 12:28:13 -07:00
James Zern abc7105acd test.mk: enable vp9_denoiser_test w/NEON
this file uses GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST so it's
safe to enable unconditionally. the filter check fell out of sync with
the code, there's a sse2 and neon implementation for the filter.

Change-Id: I2a3336ccef3fb524ca5d9b8f88279240c9a276aa
2021-05-04 12:28:01 -07:00
Paul Wilkins 2eb934d9c1 Merge "Add assert for zero_motion_factor range" 2021-04-29 16:31:52 +00:00
Paul Wilkins e14026ac21 Add assert for zero_motion_factor range
Change clamp to an assert so we are warned if changes to input
ranges or defaults in the future lead to an invalid value.

Change-Id: Idb4e0729f477a519bfff3083cdce3891e2fc6faa
2021-04-29 11:12:40 +01:00
Cheng Chen 4ec84326cc Bump ABI version
Due to recent changes to command line options for rate control
parameters.

Change-Id: I1de7cb4ff2850a3ed19ec216dd9d07f64a118e92
2021-04-28 13:54:07 -07:00
James Zern c4fceb9c70 Merge changes Iebe9842f,I174b67a5,I80ed1a16
* changes:
  vpx_convolve_neon: prefer != 0 to > 0 in tests
  vpx_convolve_avg_neon: prefer != 0 to > 0 in tests
  vpx_convolve_copy_neon: prefer != 0 to > 0 in tests
2021-04-28 17:30:48 +00:00
James Zern 55643371e1 Merge "vp8: enc: Fix valid range for under/over_shoot pct" 2021-04-28 02:27:54 +00:00
James Zern ff67c84811 vpx_convolve_neon: prefer != 0 to > 0 in tests
this produces better assembly code; the horizontal convolve is called
with an adjusted intermediate_height where it may over process some rows
so the checks in those functions remain.

Change-Id: Iebe9842f2a13a4960d9a5addde9489452f5ce33a
2021-04-27 18:04:08 -07:00
James Zern 07cf024d4d vpx_convolve_avg_neon: prefer != 0 to > 0 in tests
this produces better assembly code

Change-Id: I174b67a595d7efeb60c921f066302043b1c7d84e
2021-04-27 18:03:30 -07:00
James Zern 5ca8c5f31d vpx_convolve_copy_neon: prefer != 0 to > 0 in tests
this produces better assembly code

Change-Id: I80ed1a165512e941b35a4965faa0c44403357e91
2021-04-27 18:02:35 -07:00
Paul Wilkins 9f57bc4d6c Add limits to Vizier input parameters.
Imposed provisional upper and lower limits to each parameter
that can be adjusted in the Vizier ML experiment.

Also in some cases applied secondary limits on on the
range of the final "used" values.

Defaults and limits may well require further tuning after
subsequent rounds of experimentation.

Re-factor get_sr_decay_rate().

Change-Id: I28e804ce3d3710f30cd51a203348e4ab23ef06c0
2021-04-26 16:35:53 +01:00
James Zern c15555c62f sync CONTRIBUTING.md w/libwebm
Change-Id: I63ffea52d079b0d50002526e209ae3fb64811bac
2021-04-23 16:50:48 -07:00
Sreerenj Balachandran adc185feb7 vp8: enc: Fix valid range for under/over_shoot pct
The overshoot_pct & undershoot_pct attributes for rate control
are expressed as a percentage of the target bitrate, so the range
should be 0-100.

Change-Id: I67af3c8be7ab814c711c2eaf30786f1e2fa4f5a3
2021-04-21 11:58:27 -07:00
Paul Wilkins c911c2d9c5 Further normalization of Vizier parameters.
Further changes to normalize the Vizier command line parameters.
The intent is that the default behavior for any given parameter
is signaled by the value 1.0 (expressed on the command line as a
rational).

The final values used in the two pass code are obtained by multiplying
the passed in factors by a default values if use_vizier_rc_params is 1.
Where  use_vizier_rc_params is 0 the values are explicitly set to
the defaults.

This patch also changes the default value of each parameter to 1.0
even if not set explicitly. This should ensure safe /default behavior
if the user sets use_vizier_rc_params to 1 but does not set all the
the individual parameters.

Change-Id: Ied08b3c22df18f42f446a4cc9363473cad097f69
2021-04-20 17:51:05 +01:00
Cheng Chen 665cccfd6c Pass vizier rd parameter values
Add command line options for three rd parameters.
They are controlled by --use_vizier_rc_params, together with
other rc parameters.
If not set from command line, current default values will be used.

Change-Id: Ie1b9a98a50326551cc1d5940c4b637cb01a61aa0
2021-04-14 22:49:51 -07:00
Cheng Chen ba2bfcf2eb Merge "Set vizier rc parameters" 2021-04-14 16:31:40 +00:00
Cheng Chen 1b07aae9e4 Set vizier rc parameters
If pass --use-vizier-rc-params=1, the rc parameters are overwittern
by pass in values. It --use-vizier-rc-params=0, the rc parameters
remain the default values.

Change-Id: I7a3e806e0918f49e8970997379a6e99af6bb7cac
2021-04-13 15:26:51 -07:00
Paul Wilkins 461c1f1b89 Merge "Removed unused constant" 2021-04-13 19:04:49 +00:00
Paul Wilkins c77a7f6004 Removed unused constant
Deleted #define that is no longer referenced.

Change-Id: If0b132c5a40dd8910f535fffdee7d2d1c7df4748
2021-04-12 13:51:44 +01:00
James Zern 1c792f2991 vpx_image: clear user provided vpx_image_t early
this avoids uninitialized values and potential misuse of them which
could lead to a crash should the function fail

this is the same fix that was applied in libaom:
d0cac70b5 Fix a free on invalid ptr when img allocation fails

Bug: webm:1722
Change-Id: If7a8d08c4b010f12e2e1d848613c0fa7328f1f9c
2021-04-08 17:34:16 -07:00
Cheng Chen 72dc6478ac Merge "Fix compilation for CONFIG_RATE_CTRL" 2021-04-07 19:03:53 +00:00
Paul Wilkins 7b87b35153 Merge "Delete unused constants." 2021-04-07 12:53:07 +00:00
Paul Wilkins a40cb691b6 Merge "Change zm_factor for Vizier." 2021-04-07 12:52:47 +00:00
Cheng Chen 7a5596fa78 Fix compilation for CONFIG_RATE_CTRL
Recently, some function signatures have been changed.
This change fixes compilation error if --enable-rate-ctrl is used.

Change-Id: Ib8e9cb5e181ba1d4a6969883e377f3dd93e9289a
2021-04-06 20:28:32 -07:00
Cheng Chen 06fee5a89b Adjust end to end psnr value
A recent change leads to slight difference of encoding results:
d3aaac367 Change calculation of rd multiplier,
which is caught by Jenkins nightly test.

Adjust the threshold to silence the test failure.

BUG=webm:1725

Change-Id: I7e8b3a26b72c831ae4d88d0fca681b354314739d
2021-04-07 03:15:41 +00:00
Paul Wilkins ab4383063c Change zm_factor for Vizier.
Changes the exposed zm_factor parameter.

This patch alters the meaning of the zm_factor
parameter that will be exposed for the Vizier project.

The previous power factor was hard to interpret in terms
of its meaning and effect and has been replaced by a linear factor.
Given that the initial Vizier results suggested a lower zero motion
effect for all formats, the default impact has been reduced.

The patch as it stands gives a modest improvement for PSNR
but is slightly down on some sets for SSIM

(overall psnr, ssim % bdrate change: -ve is better)

lowres    -0.111, 0.001
ugc360p   -0.282, -0.068
midres2   -0.183, 0.059
hdres2    -0.042, 0.172

Change-Id: Id6566433ceed8470d5fad1f30282daed56de385d
2021-04-06 21:04:48 +01:00
Paul Wilkins 0d05ca39f2 Delete unused constants.
Delete some #defines that are no longer needed.

Change-Id: I9e4e4df10716598b0d62b0c70f538d4b78a32296
2021-04-06 20:49:30 +01:00
Cheng Chen afe1ba7f3f Pass vizier rc parameter values with range check
This is similar to the change:
https://chromium-review.googlesource.com/c/webm/libvpx/+/2771081
Which fails libvpx nightly test.

Here we add range check to get rid of the warning of
"divided by zero".

BUG=webm:1723

Change-Id: I7712efe7abd4b11cdb725643d51fd1c0a300d924
2021-04-05 21:27:42 +00:00
Tom Finegan 8b3e575a45 Revert "Pass vizier rc parameter values from command line to twopass"
This reverts commit f32829a2e5.

BUG=webm:1723

Change-Id: I866cdf288f9873c350b32091515a6d5f4df362a3
2021-04-02 09:41:44 -07:00
Paul Wilkins 806faf17f6 Merge "Change calculation of rd multiplier." 2021-04-01 13:55:21 +00:00
James Zern f510019140 Merge "vp9_ext_ratectrl_test: use uintptr_t for void* value" 2021-03-31 22:49:26 +00:00
Paul Wilkins 939e8d291d Merge "Convert Vizier RD parameters to normalized factors" 2021-03-31 16:28:30 +00:00
Paul Wilkins d3aaac367b Change calculation of rd multiplier.
Change the way the rd multiplier is adjusted for Q and frame type.

Previously in VP9 the rd multiplier was adjusted based on crude Q bins
and whether the frame was a key frame or inter frame.

The Q bins create some problems as they potentially introduce
discontinuities in the RD curve. For example, rate rising with a
stepwise increase in Q instead of falling. As such, in AV1 they
have been removed.

A further issue was identified when examining the first round of
results from from the Vizier project. Here the multiplier for each Q bin
and each frame type was optimized for a training set, for various video
formats, using single point encodes at the appropriate YT rates.

These initial results appeared to show a trend for increased rd
multiplier at higher Q for key frames. This fits with intuition as in
this encoding context a higher Q indicates that a clip is harder to
encode and frames  less well predicted.  However, the situation
appeared to reverse for inter frames with higher rd multipliers
chosen at low Q.

My initial suspicion was that this was a result of over fitting, but on
closer analysis I realized that this may be more related to frame type
within the broader inter frame classification. Specifically frames coded
at low Q are predominantly ARF frames, for the mid Q bin there will
likely be a mix of ARF and normal inter frames, and for the high Q bin
the frames will almost exclusively be normal inter frames from difficult
content.

ARF frames are inherently less well predicted than other inter frames
being further apart and not having access to as many prediction modes.
We also know from previous work that ARF frames have a higher
incidence of INTRA coding and may well behave more like key frames
in this context.

This patch replaces the bin based approach with a linear function
that applies a small but smooth Q based adjustment. It also splits
ARF frames and normal inter frames into separate categories.

With this done number of parameters that will be exposed for the
next round of Vizier training is reduced from 7 to 3 (one adjustment
factor each for inter, ARF and key frames)

This patch gives net BDATE gains for our test sets even with the
baseline / default factors as follows: (% BDRATE change in overall
PSNR and SSIM, -ve is better)

LowRes 		-0.231, -0.050
ugc360p		 0.160,  -0.315
midres2		-0.348, -1.170
hdres2		-0.407, -0.691

Change-Id: I46dd2fea77b1c2849c122f10fd0df74bbd3fcc7f
2021-03-31 17:08:04 +01:00
Cheng Chen f32829a2e5 Pass vizier rc parameter values from command line to twopass
Change-Id: I02eabeccf2fe4604875820d38e23c2586a63e290
2021-03-29 21:05:31 -07:00
Cheng Chen c19de35ed2 Add command line options for a few rc parameters
These rate control parameters are for the Vizier experiment.
They are defined as rational numbers.

Change-Id: I23f382dd49158db463b75b5ad8a82d8e0d536308
2021-03-29 20:55:37 -07:00
Matt Oliver 60c38f8a9a project: Update for 1.10.0 merge. 2021-03-29 22:01:45 +11:00
Matt Oliver 57b3cf86b4 Merge commit 'b41ffb53f1000ab2227c1736d8c1355aa5081c40' 2021-03-29 19:37:31 +11:00
James Zern deef895506 vp9_ext_ratectrl_test: use uintptr_t for void* value
this avoids a warning about differences in size between void* and
unsigned int under msvc:
vp9_ext_ratectrl_test.cc(40,3): warning C4312: 'reinterpret_cast':
conversion from 'const unsigned int' to 'void *' of greater size

Change-Id: I5a412ec785ddcaeff2ec71bb83a6048505400293
2021-03-26 10:55:29 -07:00
Jerome Jiang d55cab425d Merge tag 'v1.10.0'
Release v1.10.0 Ruddy Duck

2021-03-09 v1.10.0 "Ruddy Duck"

  This maintenance release adds support for darwin20 and new codec controls, as
  well as numerous bug fixes.

  - Upgrading:

    New codec control is added to disable loopfilter for VP9.

    New encoder control is added to disable feature to increase Q on overshoot
    detection for CBR.

    Configure support for darwin20 is added.

    New codec control is added for VP9 rate control. The control ID of this
    interface is VP9E_SET_EXTERNAL_RATE_CONTROL. To make VP9 use a customized
    external rate control model, users will have to implement each callback
    function in vpx_rc_funcs_t and register them using libvpx API
    vpx_codec_control_() with the control ID.

  - Enhancement:

    Use -std=gnu++11 instead of -std=c++11 for c++ files.

  - Bug fixes:

    Override assembler with --as option of configure for MSVS.

    Fix several compilation issues with gcc 4.8.5.

    Fix to resetting rate control for temporal layers.

    Fix to the rate control stats of SVC example encoder when number of spatial
    layers is 1.

    Fix to reusing motion vectors from the base spatial layer in SVC.

    2 pass related flags removed from SVC example encoder.

Bug: webm:1712

Change-Id: I4d807da7aee5a4d9d7a7af66b927983622e9cefa
2021-03-24 16:50:50 -07:00
Paul Wilkins e37ee40f7e Convert Vizier RD parameters to normalized factors
This patch converts the Vizier custom RD multipliers, to factors
that adjust each RD multiplier either side of its default value, where
a factor of 1.0 will give the previous default  behavior.

Ultimately I would like to replace the multiple RD multipliers
triggered at different Q thresholds (eg, low, medium, high q)
with a function that adjusts the rd behavior smoothly as Q
changes.

Vizier could then be presented with a single adjustment control
for each of key frame and inter frame rd.

The current behavior is problematic.

Firstly having hard threshold Q values at which rd behavior changes
may cause anomalies in the rate distortion curve, where in some
situations, raising  Q, for example,  may not cause the expected drop
in rate and rise in distortion, because we have crossed a threshold
where the rate distortion multiplier changes sharply and this alters
the balance of bits spent in the prediction and residual parts of the
signal.

Having a single  value that is used for a range of Q index values
(eg 0-64), (65-128)  may also cause problems and over-fitting in
the context of the Vizier ML project. This project tries to optimize
the values for each Q range, for various YT formats, but does so
by analyzing the results of single point encodes on a set of clips.
For a given format all the clips are encoded with the same parameters
(target rate etc) so  there is likely to be clustering in regards to the
Q values used. For example the training set may give a new value
for the Q  range 0-64 but most of the data points used may have Q
close 64.

It will likely require several iterations working with the Vizier team
to get this right. This patch just gives an initial framework for
testing.

Change-Id: Iaa4cd5561b95a202bcae7a1d876c4f40ef444fa2
2021-03-23 15:05:32 +00:00
Paul Wilkins 90c1cc6515 Merge "Change SR_diff calculation and representation" 2021-03-19 19:44:38 +00:00
Adam B. Goode b41ffb53f1 Msvc builds convert to windows path w/msys env
Bug: webm:1720
Change-Id: I56689ad408f8086c511e1711dfa9c8d404727b2e
(cherry picked from commit 04086a3066)
2021-03-18 12:59:46 -07:00
Paul Wilkins b5e754a840 Change SR_diff calculation and representation
This patch changes the way prediction decay is calculated.

We expect that frames that are further from an ALT-REF frame (or Golden
 Frame) will be less well predicted by that ALT-REF frame. As such it is
desirable that they should contribute less to the boost calculation used
to assign bits to the ALT_REF.

This code looks at the reduction in prediction quality between the last
frame and the second reference frame (usually two frames old). We make
the assumption that we can accumulate this to get a proxy for the likely
loss of prediction quality over multiple frames.

Previously the calculation looked at the absolute difference in the
coded errors. The issue here is that the meaning of a unit difference
is not the same for very complex frames as it is for easy frames.

In this patch we scale the decay value based on how the error difference
compares to the overall frame complexity as represented by the intra
coding error.

This was tuned experimentally to give  test results that
were approximately neutral for our various test sets. There was
 a slight drop in Overall PSNR but a consistent improvement in
SSIM. This balance may be improved with tuning further as it is
noteworthy that it was much better on the hd_res set.

Results (Overall PSNR, SSIM -ve better) for low_res, ugc360, midres2,
ugc480P and hd_res are as follows:

0.173	-0.688
0.118	-0.153
0.132	-0.239
0.261	-0.405
-0.305	-1.109

As part of this adjustment the contribution of motion amplitude was
removed.

This patch also changes the control mechanism that will be exposed
on the command line for use by the Vizier project. The control is now
a linear factor which defaults to 1.0, where values < 1.0 mean a lower
decay rate and values > 1.0 mean an increased decay rate.

This presents a more easily understandable interface for use in
optimizing the decay behavior for various formats, where it is clear
what a passed in value means relative to the default.

With the new decay mechanism the current values for various formats
are almost certainly wrong and we still need to define sensible upper
and lower bounds for use during future training.

Change-Id: Ib1074bbea97c725cdbf25772ee8ed66831461ce3
2021-03-18 14:33:44 +00:00
Adam B. Goode 04086a3066 Msvc builds convert to windows path w/msys env
Bug: webm:1720
Change-Id: I56689ad408f8086c511e1711dfa9c8d404727b2e
2021-03-17 16:49:53 -07:00
James Zern cb0d8ce313 Merge "vp8: restrict 1st pass cpu_used range" 2021-03-12 19:44:42 +00:00
Marco Paniconi 973726c38b vp9-rtc: Add postencode_drop control to sample encoder
Change-Id: I1c989f26b0a7b9239adf37df8d96776f33b89a8b
2021-03-12 09:54:59 -08:00
Jerome Jiang 24b43c4ea5 Prepare for v1.10.0 release.
Update CHANGELOG, AUTHORS, README, libs.mk

Bug: webm:1712
Change-Id: Ic99de12b91a92c32f8a9485dcb759c48bc3eccd6
2021-03-11 20:37:39 -08:00
Paul Wilkins cbc4ead586 Vizer: Added in experimental max KF boost values.
Added the experimental max per frame KF boost values derived from
the Vizier experiments.

These are still all off by default.

When enabled I expect these to cause significant regression as they
fluctuate wildly and in a way that makes no sense from format to format.

I suspect these values reflect over fitting perhaps from a subset of
training clips with more frequent mid chunk key frames and or short key
frame groups.

Also fixed incorrect value for gf boost for one format.

Experiment to moderate these values and use different values for first
and subsequent KF groups to follow.

Change-Id: Ibeb4268957f2edacdb4549d74930255a22a2fcc5
2021-03-10 14:41:40 +00:00
Paul Wilkins 8851ed5787 Vizier: Add in field for min kf frame boost.
Added kf_frame_min_boost field to hold the minimum per frame
boost in key frame boost calculations. Replaces hard wired value.
To be used in conjunction with and tied to the maximum value.

Change-Id: I67a39ecb3f21b5918512a5ccd9a1b214d7971e45
2021-03-10 14:40:50 +00:00
Paul Wilkins 2823cc4d0d Merge "Vizier: Add defaults for > 1080P" 2021-03-10 14:35:53 +00:00
Cheng Chen b7d9113ea0 Merge "L2E: let vp9 encoder respect external max frame size constraint" 2021-03-10 05:50:50 +00:00
Paul Wilkins fb98bdb723 Merge "Further integration for Vizier." 2021-03-09 17:30:04 +00:00
Paul Wilkins cc3444f01c Vizier: Add defaults for > 1080P
Previous code did not have sensible defaults for larger image formats.

Added defaults for Vizier RD parameters for sizes > 1080P and changed
the first pass parameters for large formats to use the 1080P values.
No supplied value  for rd_mult_q_sq_key_high_qp case yet so set to
old hard wired default value.

If the Vizier parameters were enabled the lack of sensible defaults
caused a large regression for 2K clips in one of our test sets.

Change-Id: I306c0cd76eab00d50880c91fadb5842faf6661ff
2021-03-09 16:43:14 +00:00
Cheng Chen 36013909a5 L2E: let vp9 encoder respect external max frame size constraint
Change-Id: Ib926e694d4bc4675af1435a32f6316a587756380
2021-03-08 14:21:47 -08:00
Paul Wilkins f27c62c5df Further integration for Vizier.
Further integration of Vizier adjustable parameters,

This patch connects up additional configurable two pass rate control
parameters for the Vizier project.  This still needs to be connected up
to a command line interface and at the moment should still be using
default values that match previous behavior.

Do not submit until verified that defaults are all working correctly.

Change-Id: If1241c2dba6759395e6efa349c4659a0c345361d
2021-03-08 15:51:07 +00:00
James Touton 56b1a197b2 Check for _WIN32 instead of WIN32.
_WIN32 is predefined for the Windows platform in MSVC, whereas WIN32 is not, and WIN32 is also not defined in the makefiles.

Change-Id: I8b58e42d891608dbe1e1313dc9629c2be588d9ec
2021-03-04 18:43:29 -08:00
Paul Wilkins 3cc45a0522 Merge "Add fields into RC for Vizier ML experiments." 2021-03-04 21:17:28 +00:00
Jerome Jiang a58265f795 Merge "override assembler with --as option on msvs" 2021-03-04 20:30:02 +00:00
Jerome Jiang f7c386bab0 Use -std=gnu++11 instead of -std=c++11
Cygwin and msys2 have stricter compliance requirement over standard c
headers.

Bug: webm:1708
Change-Id: I676b1227b9dd304149e50016468df0f057c6a78f
2021-03-04 11:16:06 -08:00
Jerome Jiang 2570e33ece override assembler with --as option on msvs
Bug: webm:1709
Change-Id: I962a64c00042fe95cc1cd845b187f71ad6cfd1b7
2021-03-03 20:20:49 -08:00
Paul Wilkins d0567bd779 Add fields into RC for Vizier ML experiments.
This patch adds fields into the RC data structure for the Vizier.

The added fields allow control of some extra rate control parameters
and rate distortion.

This patch also adds functions to initialize the various parameters
though many are not yet used / wired in and for now all are set to
default values. Ultimately many will be set through new command
line options.

Change-Id: I41591bb627d3837d2104fb363845adedbddf2e02
2021-03-03 17:07:08 +00:00
Wan-Teh Chang ebefb90b75 Remove comments for removed 'active_map' parameter
Change-Id: I8635f6121e13089c25e201df033d5bc68e2862b4
2021-02-26 18:02:24 -08:00
Jerome Jiang 02392eeccc Remove two pass related code from svc sample encoder.
SVC sample encoder is only supposed to be used for realtime SVC.

Bug: webm:1705
Change-Id: I5c0c3491732db3e148073aaf7f90ee8d662b57b5
2021-02-18 09:28:45 -08:00
James Zern 24bd0733ef vp8_denoiser_sse2_test: disable BitexactCheck w/gcc-8+
this test fails under gcc 8-10, but not with other compilers

Bug: webm:1718
Change-Id: I8c6c7a25c4aaf019a7f91f835a1a2c9a731cfadc
2021-02-05 10:21:39 -08:00
Marco Paniconi 0d8354669a svc: Fix an existing unittest for flexible mode
The flag update_pattern_ was being set to 0
(because it was set before reset) instead of 1.
And the example flexible mode pattern was not setting
non-reference frame on top temporal top spatial.

Change-Id: I8aee56ce13cc4e0d614126592f9d0f691fe527b0
2021-02-03 22:12:25 -08:00
Cheng Chen 5a4cfa9563 Merge "L2E: let external rate control pass in a max frame size" 2021-02-03 23:57:00 +00:00
Marco Paniconi 7cbe65b6f4 Merge "svc: Unittest for ksvc flexible mode with no updates on TL > 0" 2021-02-03 22:30:41 +00:00
Marco Paniconi 158aa20c95 svc: Unittest for ksvc flexible mode with no updates on TL > 0
Catches tsan issue fixed in: 7b93b56

Change-Id: I34b17c289afd0f8691987a1e4afa533f6c7f2806
2021-02-03 13:26:05 -08:00
James Zern 6c7989e676 Merge "vp8_denoiser_sse2_test: use ASSERT instead of EXPECT" 2021-02-03 21:16:01 +00:00
James Zern b3506b3307 vp8_denoiser_sse2_test: use ASSERT instead of EXPECT
when test block contents to avoid producing unnecessary output on
failure.

Bug: webm:1718
Change-Id: Ie2cf8245ec8c03556549ad1eea65c8bef15a9735
2021-02-03 13:14:50 -08:00
Cheng Chen 557368a8fa L2E: let external rate control pass in a max frame size
And allow the frame to recode when the frame size is larger
than the input max frame size.

If the max frame size is not specified, let vp9 decide whether
to recode.  The recode follows the vp9's current recoding mechanism.

The rate control api will return the new qindex back to the
external model.

Change-Id: I796fbf713ad50a5b413b0e2501583b565ed2343f
2021-02-03 11:29:06 -08:00
Marco Paniconi 6c5377fd35 Fix to vpx_temporal_svc_encoder
Avoid division by zero.

Change-Id: Icf3f40aa32fe30f42c46417a1437ebe235e3ac96
2021-02-03 10:07:27 -08:00
Elliott Karpilovsky 61edec1efb Relax constraints on Y4M header parsing
Previous parser assumed that the header would not exceed
80 characters. However, with latest FFMPEG changes, the header
of Y4M files can exceed this limit.

New parser can parse an arbitrarily long header, as long each
tag is 255 or less characters.

BUG=aomedia:2876

Change-Id: I9e6e42c50f4e49251dd697eef8036485ad5a1228
2021-01-29 09:52:02 -08:00
Elliott Karpilovsky ebb5ffc1d4 Relax constraints on Y4M header parsing
Previous parser assumed that the header would not exceed
80 characters. However, with latest FFMPEG changes, the header
of Y4M files can exceed this limit.

New parser can parse up to ~200 characters. Arbitrary parsing in
future commit.

BUG=aomedia:2876

Change-Id: I2ab8a7930cb5b76004e6731321d0ea20ddf333c1
2021-01-28 11:52:41 -08:00
James Zern deff7ddd27 Merge changes I43d9d477,I8d4661ec
* changes:
  vp9_end_to_end_test: fix compile with gcc 4.8.5
  sad_test: fix compilation w/gcc 4.8.5
2021-01-27 23:39:14 +00:00
Jerome Jiang 768b6b5e0d Merge "svc: turn off use_base_mv on non base layer." 2021-01-27 20:08:47 +00:00
Jerome Jiang f46b66ac83 svc: turn off use_base_mv on non base layer.
Change-Id: I4a9402f468e54c58081c882ed37f59ee0269c0fc
2021-01-27 10:11:43 -08:00
James Zern 987dd3a9be vp9_end_to_end_test: fix compile with gcc 4.8.5
use Values() rather than ValuesIn() with an initializer list as this
version of gcc under CentOS fails to deduce the type:

../third_party/googletest/src/include/gtest/gtest-param-test.h:304:29:
note:   template argument deduction/substitution failed:
../test/vp9_end_to_end_test.cc:346:59: note:   couldn't deduce template
parameter ‘T’
                            ::testing::ValuesIn({ 6, 7, 8 }));

Bug: webm:1690
Change-Id: I43d9d4777fcd74a4f8fa8bdcd9834cdca5e546ff
2021-01-26 18:09:27 -08:00
James Zern bd8dfea54d sad_test: fix compilation w/gcc 4.8.5
use a #define for kDataAlignment as it's used with DECLARE_ALIGNED
(__attribute__((aligned(n)))) and this version under CentOS is more
strict over integer constants:

../vpx_ports/mem.h:18:72: error: requested alignment is not an integer constant
 #define DECLARE_ALIGNED(n, typ, val) typ val __attribute__((aligned(n)))

Bug: webm:1690
Change-Id: I8d4661ec1c2c1b1522bdc210689715d2302c7e72
2021-01-26 18:09:16 -08:00
Jerome Jiang 14f132648a Merge "Do not reuse mv in base spatial layer if curr buf same as prev." 2021-01-23 02:19:55 +00:00
Jerome Jiang 7b93b56ab9 Do not reuse mv in base spatial layer if curr buf same as prev.
Bug: b/154890543
Change-Id: Iad5791912f781d225e610a61bc13f3dbaef81bb9
2021-01-21 17:09:02 -08:00
Angie Chiang b0050f27e2 Use VPX_CODEC_INVALID_PARAM when ext_ratectrl=NULL
Bug: webm:1716

Change-Id: Ic60c367aabfc03d94816e85476895b988aced5f1
2021-01-20 17:52:35 -08:00
Angie Chiang f57fa3f1df Handle vp9_extrc functions' return status properly
Bug: webm:1716
Change-Id: I204cd3ab35b493759808500b799da3b9e55686d4
2021-01-20 17:52:03 -08:00
Angie Chiang 3aecf4a0ba Merge changes Ib016ab5a,Ie6d63a68,I96b18436,I0b98741d
* changes:
  Add return to vp9_extrc_update_encodeframe_result
  Add status in vp9_extrc_get_encodeframe_decision
  Return status in vp9_extrc_send_firstpass_stats
  Return status in vp9_extrc_create/init/delete
2021-01-21 01:33:09 +00:00
Angie Chiang d49700e25b Add return to vp9_extrc_update_encodeframe_result
Bug: webm:1716
Change-Id: Ib016ab5a49c765971366cc8d2b75bcca3ed5bd0f
2021-01-19 18:54:07 -08:00
Angie Chiang d890579a2e Add status in vp9_extrc_get_encodeframe_decision
Bug: webm:1716
Change-Id: Ie6d63a68539369c51fefefa528e299b00a967e29
2021-01-19 18:54:07 -08:00
Angie Chiang 27f1838519 Return status in vp9_extrc_send_firstpass_stats
Bug: webm:1716

Change-Id: I96b18436c58ed888fcf677097819cc0093b6f41d
2021-01-19 18:54:07 -08:00
Angie Chiang f4fc562489 Return status in vp9_extrc_create/init/delete
Bug: webm:1716

Change-Id: I0b98741db8c639bdddd899fd6ad359da7b916086
2021-01-19 18:54:00 -08:00
James Zern fe1c96d111 {highbd_,}loopfilter_neon.c: quiet -Wmaybe-uninitialized
Seen with arm-linux-gnueabihf-gcc-8 (8.3.0 & 8.4.0)

Without reworking the code or adding an additional branch this warning
cannot be silenced otherwise. The loopfilter is only called when needed
for a block so these output pixels will be set.

BUG=b/176822719

Change-Id: I9cf6e59bd5de901e168867ccbe021d28d0c04933
2021-01-19 18:38:23 -08:00
Elliott Karpilovsky ecbb0e0e2a Relax constraints on Y4M header parsing
Some refactoring and cleanup -- do not count the first 9 bytes against
the header limit. Add a unit test.

BUG=aomedia:2876

Change-Id: Id897d565e2917b48460cc77cd082cec4c98b42cb
2021-01-14 16:18:40 -08:00
Hui Su 576e0801f9 vpxenc: initalize the image object
Otherwise it would cause problem when calling vpx_img_free() at the end
if no frame is read.

Change-Id: Ide0ed28eeb142d65d04703442cc4f098ac8edb34
2021-01-13 10:51:39 -08:00
Angie Chiang 3a38edea2c Fix show_index in vp9_extrc_encodeframe_decision()
Change-Id: I93bb1fb3c14126d881d3f691d30875a0062e436c
2020-12-17 18:09:55 -08:00
Angie Chiang 67b1d7f174 Correct pixel_count in encode_frame_result
Change-Id: I3270af4f793f8e453e10d1caf8ffa1a8d5d584a7
2020-12-17 17:32:26 -08:00
Matt Oliver c027576d54 project: Split winrt projects. 2020-12-18 00:20:11 +11:00
Hui Su 8ed23d5f7f First pass: skip motion search for intra-only
BUG=webm:1713

Change-Id: Ibad79cf5d12aa913e8c87a31d7d2124c00958691
2020-12-15 22:40:09 -08:00
James Zern 2392fe53ab Merge "configure: add darwin20 cross-compile support" 2020-12-11 19:58:17 +00:00
Gregor Jasny 723fca7dd1 configure: add darwin20 cross-compile support
Change-Id: I91c0e832a6e76172397e97413329fd43edc81c78
2020-12-11 10:17:18 -08:00
Jeremy Leconte ffc179d8bf Fix nullptr with offset.
The error occurs with low resolution when LibvpxVp8Encoder::NumberOfThreads returns 1.

Bug: b:175283098
Change-Id: Icc9387c75f4ac6e4f09f102b3143e83c998c5e38
2020-12-10 18:54:53 +00:00
Angie Chiang ebac57ce92 Fix typos in simple_encode.h
Change-Id: Id83eff6cc12c441ce991fb1a73820d106311cf5e
2020-11-25 12:58:24 -08:00
Angie Chiang 0de1df6bf7 Merge "Revert "Close out file in EndEncode()"" 2020-11-24 03:10:44 +00:00
Angie Chiang 5459c4ab98 Revert "Close out file in EndEncode()"
This reverts commit 7370cecd89.

Reason for revert: I accidentally check in this CL

Change-Id: I71ff0b98649070df3edd13b98170a7091541057b
2020-11-24 02:55:24 +00:00
Angie Chiang 71c8e0c009 Merge "Close out file in EndEncode()" 2020-11-24 02:49:12 +00:00
Angie Chiang 1b0fc6a5d6 Merge "Refine documentation of vpx_ext_ratectrl.h" 2020-11-24 02:49:01 +00:00
Angie Chiang 53f8c24374 Merge "Allow user to set rc_mode and cq_level in SimpleEncode" 2020-11-24 02:47:28 +00:00
Angie Chiang c341440874 Refine documentation of vpx_ext_ratectrl.h
Bug: webm:1707
Change-Id: Iba04b5292c157e22dd8618a79e8c977ec9fc2199
2020-11-20 17:41:09 -08:00
Angie Chiang 2ccee3928d Allow user to set rc_mode and cq_level in SimpleEncode
Change-Id: If3f56837e2c78a8b0fe7e0040f297c3f3ddb9c8b
2020-11-20 17:40:04 -08:00
Angie Chiang e56e8dcd6f Add gop_index to vpx_ext_ratectrl.h
Bug: webm:1707

Change-Id: I48826d5f3a7cc292825a7f1e30ac6d0f57adc569
2020-11-19 20:15:18 -08:00
Angie Chiang 5b63f0f821 Capitalize VPX_RC_OK / VPX_RC_ERROR
Change-Id: I526bd6a6c2d2095db564f96d63c7ab7ee4dd90ad
2020-11-17 16:50:44 -08:00
Angie Chiang 275c276993 Add doxygen for vpx_rc_funcs_t
Change-Id: If75215d574fe0b075add50154a9eece5d387741a
2020-11-17 16:50:35 -08:00
Angie Chiang a7731ba488 Add doxygen for vpx_rc_config
Bug: webm:1707

Change-Id: I65bab6b2b792653e70cb136a5f9a21796e34b829
2020-11-17 15:23:18 -08:00
Angie Chiang c22a783bea Copy first pass stats documentation from AV1 to VP9
Bug: webm:1707
Change-Id: Iae7eaa9ba681272b70b6dad17cd2247edab6ef79
2020-11-17 15:23:18 -08:00
Angie Chiang ca7a16babc Add doxygen to structs in vpx_ext_ratectrl.h
Bug: webm:1707

Change-Id: Ib5f6b6f143f55e5279e39eb386fcd3340211de59
2020-11-17 15:23:12 -08:00
Angie Chiang a44cf4592a Merge changes I12a72d3a,I1a6c5752
* changes:
  Fix uninitialized warning in resize_test.cc
  Fix the warning of C90 mixed declarations and code
2020-11-17 21:40:55 +00:00
Jerome Jiang b5d77a48d7 Remove condition on copying svc loopfilter flag
Change-Id: Ib37ef0aa3dc0ec73b25332be6d89969093bd7aeb
2020-11-16 14:12:50 -08:00
Angie Chiang 4e7fd0273a Fix uninitialized warning in resize_test.cc
Change-Id: I12a72d3aa57b13dbcbeb037e1deea41529ea4194
2020-11-13 18:17:48 -08:00
Angie Chiang d4453c73ff Fix the warning of C90 mixed declarations and code
Change-Id: I1a6c57525bbe8bf1a97057ecd64985bc23d1df2e
2020-11-13 18:13:14 -08:00
Marco Paniconi 3f7fee29ed Merge "vp9: Allow for disabling loopfilter per spatial layer" 2020-11-13 04:26:34 +00:00
Marco Paniconi 7beafefd16 vp9: Allow for disabling loopfilter per spatial layer
For SVC: add parameter to the control SET_SVC_PARAMS to
allow for disabling the loopfilter per spatial layer.
Note this svc setting will override the setting via
VP9E_SET_DISABLE_LOOPFILTER (which should only be used
for non-SVC).

Add unittest to handle both SVC (spatial or temporal layers)
and non-SVC (single layer) case.

Change-Id: I4092f01668bae42aac724a6df5b6f6a604337448
2020-11-12 11:31:42 -08:00
Cheng Chen b1d704f12a Accumulate frame tpl stats and pass through rate control api
Tpl stats is computed at the beginning of encoding the altref
frame. We aggregate tpl stats of all blocks for every frame of
the current group of picture.

After the altref frame is encoded, the tpl stats is passed through
the encode frame result to external environment.
Change-Id: I2284f8cf9c45d35ba02f3ea45f0187edbbf48294
2020-11-09 13:14:19 -08:00
James Zern 220e4331bd Merge "libs.mk: set LC_ALL=C w/egrep invocations" 2020-10-30 04:57:32 +00:00
Wan-Teh Chang 98919178f4 Merge "Add a comment about bitdeptharg and inbitdeptharg" 2020-10-29 23:33:54 +00:00
James Zern 9ab65c55d9 libs.mk: set LC_ALL=C w/egrep invocations
this guarantees consistent interpretation of the character ranges

BUG=webm:1711

Change-Id: Ia9123f079cc7ac248b9eff4d817e2e103d627b2b
2020-10-29 15:46:21 -07:00
Wan-Teh Chang 8b27a92490 Add a comment about bitdeptharg and inbitdeptharg
Add a comment to vp9_args to point out that bitdeptharg and
inbitdeptharg do not have a corresponding entry in vp9_arg_ctrl_map and
must be listed at the end of vp9_args.

Change-Id: Ic9834ab72599c067156ca5a315824c7f0760824a
2020-10-27 18:01:22 -07:00
James Zern 89ddf6f32a vp9_ext_ratectrl_test: add missing override
for ~ExtRateCtrlTest()

Change-Id: I311a400093c8c1ee2c002ba000d0b33c4fde209f
2020-10-27 17:09:08 -07:00
Jerome Jiang 4c3d05f13e Merge "Add cmd line option to control loopfilter for vpxenc" 2020-10-27 22:33:20 +00:00
Jerome Jiang 8b8b15e086 Add cmd line option to control loopfilter for vpxenc
Change-Id: I4f5e6ce2f1b535a586bdb6c9e55a3d49ebf61af4
2020-10-27 13:25:24 -07:00
Angie Chiang 16154dae71 Download bus_352x288_420_f20_b8.yuv properly
Bug: webm:1707

Change-Id: I6aabad7cdcddf2bc41a0cc7b5cdfd7d9759f9fae
2020-10-26 11:13:56 -07:00
Angie Chiang ee482c87c7 Merge changes I27932c41,I2ff9e54a,I4ebed472
* changes:
  Small changes of vp9_ext_ratectrl_test.cc
  Add ref frame info to vpx_rc_encodeframe_info_t
  Add vpx_rc_status_t
2020-10-21 21:26:34 +00:00
Angie Chiang a207a0f6b9 Small changes of vp9_ext_ratectrl_test.cc
Change-Id: I27932c41a826cd3c10cc7801956cd32e4877133a
2020-10-20 17:32:27 -07:00
Angie Chiang 13aad8bb64 Merge "Add unit test for vp9_ext_ratectrl" 2020-10-21 00:21:51 +00:00
Angie Chiang 9bfdf4a9d0 Add ref frame info to vpx_rc_encodeframe_info_t
Bug: webm:1707

Change-Id: I2ff9e54a9c8ae535628c1c471a2d078652f49a31
2020-10-20 17:14:10 -07:00
angiebird 90271b2201 Add vpx_rc_status_t
Let callback functions in vpx_ext_ratectrl.h
return vpx_rc_status_t

Bug: webm:1707

Change-Id: I4ebed47278b228740f6c73b07aa472787b2617d2
2020-10-20 17:13:59 -07:00
Marco Paniconi 94384b5c68 vp9-rtc: Fix to control for disabling loopfilter
Adding unit test.

Change-Id: Ic3c03fee7e9c2c224d927bb09914551422bdf816
2020-10-20 10:43:58 -07:00
Angie Chiang e94000aa35 Add unit test for vp9_ext_ratectrl
Fix three bugs along the way.
1) Call vp9_extrc_send_firstpass_stats() after vp9_extrc_create()
2) Pass in model pointer in vp9_extrc_create()
3) Free frame_stats buffer in vp9_extrc_delete()

Bug: webm:1707

Change-Id: Ic8bd62c7b4ebd85a7479ae5e4c82d7f6059d782f
2020-10-19 21:49:38 -07:00
angiebird 8bfc920631 Add vp9_extrc_update_encodeframe_result()
Bug: webm:1707

Change-Id: I962ffa23f03b953f7c0dfd81f49dc79d1975bbba
2020-10-15 18:52:05 -07:00
angiebird f71dd6e23e vp9_extrc_get_encodeframe_decision()
Bug: webm:1707

Change-Id: I90a327b97d7158b65767fe3fbfd5f260030e17f5
2020-10-15 18:51:39 -07:00
James Zern 122a74eda7 install vpx_ext_ratectrl.h
fixes encoder detection / compile with installed headers after:
6dba0d0a0 Add callback functions for external_rate_control

Bug: webm:1707
Change-Id: I370d8c94d6f1b8201002a722077ecf6b3d8cede5
2020-10-15 17:11:53 -07:00
angiebird 9857515cd6 Call vp9_extrc_send_firstpass_stats() properly
Change-Id: I28db5010ba647cc91b8c0aa59309d7e953cd1216
2020-10-09 19:09:36 -07:00
angiebird 705bf9de8c Add vpx_rc_frame_stats_t
Change-Id: I496ce13592f71779bb00cc8bbb601835bca8ff09
2020-10-09 19:08:36 -07:00
angiebird e6208a9507 Add vp9_extrc_send_firstpass_stats()
Change-Id: Ia2457b416200a2b2d1558600bff90ac2746cf396
2020-10-09 19:08:29 -07:00
angiebird 20bca1350a Add vp9_extrc_init/create/delete
Change-Id: I9fcb9f4cc5c565794229593fadde87286fcf0ffd
2020-10-09 17:30:54 -07:00
angiebird 6dba0d0a05 Add callback functions for external_rate_control
Change-Id: I20a1179a2131d2cd069dae9076aa2c18b80784f3
2020-10-09 17:30:49 -07:00
angiebird a04f68148f Add codec control for external rate control lib
VP9E_SET_EXTERNAL_RATE_CONTROL
One can assign an external library using the control flag,
VP9E_SET_EXTERNAL_RATE_CONTROL.
The args alongside the control flag should be of type char**.
args[0]: char* points to the path of rate control library
args[1]: char* points to the config of the rate control library.

Change-Id: Iae47362cdfafa00614bac427884bffcf6944c583
2020-10-02 19:31:36 -07:00
angiebird da7c503fe5 Add SetEncodeConfig and DumpEncodeConfigs
Change-Id: Ie6864b1133c26021d9c4883df033ecd2969585ed
2020-10-02 19:29:36 -07:00
Jerome Jiang 7e8ea22e40 Add codec control to disable loopfilter for vp9
Change-Id: I6d693e84570c353d20ec314acea43363956c0590
2020-10-02 12:09:01 -07:00
James Zern d017a63feb Merge "ratectrl_rtc_test.cc: fix signed/unsigned comparison" 2020-10-01 02:40:49 +00:00
Jerome Jiang 037190e55f Merge "Add file for rate control interface test." 2020-09-30 22:17:19 +00:00
Jerome Jiang 73681bf6a4 Add file for rate control interface test.
Change-Id: Id09dc5b653c1e5bb2b02f63579ac776f887ce0eb
2020-09-30 11:39:27 -07:00
James Zern 3c31fb8053 ratectrl_rtc_test.cc: fix signed/unsigned comparison
Change-Id: Id522c12faf4c959f60b5df1b0f7312f14a71720d
2020-09-29 10:58:56 -07:00
James Zern 956d3cac34 configure.sh: fix arm64-darwin-gcc match
after:
979e27c97 configure: add darwin20 support

make the condition more specific by including the trailing -gcc (-*)

Change-Id: I78f481b6c5ad9137e6b6973198e8671e806ee82c
2020-09-29 10:38:41 -07:00
James Zern 979e27c970 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
2020-09-25 13:21:11 -07:00
James Zern aea631263d Merge "vp9_ratectrl,vp9_resize_one_pass_cbr: rm redundant casts" 2020-09-16 23:48:21 +00:00
James Zern c211b82d08 vp9_ratectrl,vp9_resize_one_pass_cbr: rm redundant casts
avg_frame_bandwidth is an int, quiets a clang-tidy warning

Change-Id: I2a2822652ca6a06e9d1d6d4318f544d419d437e8
2020-09-16 13:43:05 -07:00
James Zern 58d02a8501 test/encode_test_driver: rm redundant get() w/unique_ptr
Change-Id: I3c1ece92ba9f43df4cbaf47109e35aaf0a807d97
2020-09-16 13:40:01 -07:00
Joel Fernandes 97356acb50 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>
2020-09-14 20:49:42 +00:00
Sarah Parker 478c70f6d2 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
2020-09-10 20:33:02 -07:00
Sarah Parker ea0bc1b321 Upstream GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST
BUG=b/159031848

Change-Id: I013770f4e54d0ea92304fa3e9cf4d46f5723f129
2020-09-11 02:25:24 +00:00
Marco Paniconi d1a78971eb 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
2020-08-25 13:06:41 -07:00
Daniel Sommermann c413c8f18e 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
2020-08-19 11:56:25 -07:00
James Zern ebbe5b82a0 Merge "Refine MMI & MSA detection for mips" 2020-08-19 02:49:29 +00:00
Marco Paniconi 53747dfe65 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
2020-08-18 18:01:53 -07:00
jinbo ea6562f2fc 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
2020-08-19 07:57:21 +08:00
Marco Paniconi 529c29bb0f rtc-vp9: Fix to rcstats in vp9_spatial_svc_encoder
Fixes the rcstats for case when #spatial_layers = 1.

Change-Id: Ie28d99852033307bc4c69c7e738e1d4cab4e8cf5
2020-08-17 21:52:12 -07:00
Jerome Jiang 2d20a42ab6 Merge "Merge remote-tracking branch 'origin/quacking' into master" 2020-08-13 16:31:42 +00:00
James Zern b0aa5f1852 Merge "test/*: use canonical downloads.webmproject url" 2020-08-12 22:35:47 +00:00
angiebird 6ac8a0c9b0 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
2020-08-10 19:53:10 -07:00
angiebird 343c4dca64 Cosmetic changes in simple_encode.h
Change-Id: If7d2711e7f37f00629874914f7c4d2396358e39d
2020-08-10 19:39:55 -07:00
angiebird 7370cecd89 Close out file in EndEncode()
Change-Id: Ib6549f954ce6d5d966eef09a119b46f0cc2f54f7
2020-08-10 16:13:16 -07:00
angiebird 04db83211c Correct the first pass motion vector scale
Change-Id: I005a648f7f9ead9d36a39330dfbb096919affb34
2020-08-10 16:06:49 -07:00
angiebird 7122eea6a4 Cosmetic change for simple_encode_test.cc
Change-Id: I50b4d38f7deceb5b416e72dd944d2ed31e42dafa
2020-08-10 16:06:49 -07:00
angiebird 246a65c696 Make target_frame_bits error margin configurable.
Change-Id: I05dd4d60741743c13951727ce6608acf4224ebec
2020-08-10 15:00:51 -07:00
angiebird d6f2ae2c12 Avoid division by zero for rate q_step model
Change-Id: Ic5709b79131a3969fcb2a0eb3f53994f788b5cc9
2020-08-10 15:00:45 -07:00
angiebird 3ec043a795 Add rq_history to encode_frame_result
Change-Id: Ic2a52dcf5e5a6d57b80d390a2c48ee498e89e7b2
2020-08-07 16:48:08 -07:00
angiebird bb7a2ccc38 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
2020-08-07 15:48:32 -07:00
James Zern 68e1198375 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
2020-08-07 13:32:39 -07:00
angiebird e3ae48b861 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
2020-08-06 15:45:12 -07:00
angiebird 927fad4847 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
2020-08-06 15:35:21 -07:00
Angie Chiang ca9a262b1d Merge "Cosmetic changes for rate_ctrl experiment" 2020-08-06 22:21:46 +00:00
angiebird 3e0967af8f Cosmetic changes for rate_ctrl experiment
Change-Id: I133c93c2ad4c824fc97a18de3ac2cb2aedac9013
2020-08-05 13:52:30 -07:00
Cheng Chen f9ab864199 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
2020-08-03 22:46:38 -07:00
Angie Chiang 8a8e780b58 Merge "Add recode loop logics for rate_ctrl experiment" 2020-08-04 02:50:55 +00:00
angiebird 566905e91e Add recode loop logics for rate_ctrl experiment
Change-Id: I4de5a38e25d6b0836d90e8fcd0e56d268e5fd838
2020-08-03 17:06:54 -07:00
Jerome Jiang a3fc027cc9 Merge remote-tracking branch 'origin/quacking' into master
BUG=webm:1686

Change-Id: I3ba5215b3791fc2bb63521d11429087cb2abd5b1
2020-07-31 16:45:08 -07:00
Hui Su bdbf872524 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
2020-07-31 17:40:55 +00:00
Jerome Jiang b358f9076f NULL -> nullptr in CPP files
This should clean up clangtidy warnings

Change-Id: Ifb5a986121b2d0bd71b9ad39a79dd46c63bdb998
2020-07-27 11:51:04 -07:00
James Zern dbe00bb68b Merge "libs.mk: quiet curl output" 2020-07-23 20:29:05 +00:00
James Zern 859d66fabf libs.mk: quiet curl output
+ fix error return

Change-Id: I48a9ed70fe05df603a49b3c11f813119906fc4fb
2020-07-23 11:50:07 -07:00
Jerome Jiang 7a92a785f2 Silience warnings about uninitiated test cases
BUG=b/159031848

Change-Id: I6bb88c24bd08e0590ec6b8ebfb696fd9b07ed011
2020-07-23 09:22:43 -07:00
James Zern fbfd3fdfb7 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
2020-07-22 15:54:38 -07:00
James Zern b79f25b546 Merge "vp8,vpx_dsp: [loongson] fix msa optimization bugs" 2020-07-20 23:44:08 +00:00
Angie Chiang a4f5a74288 Merge "Build libsimple_encode.a separately" 2020-07-20 21:30:28 +00:00
angiebird 642f6a195d Add init version of EncodeFrameWithTargetFrameBits()
Will add a unit test in a followup CL.

Change-Id: I6a6354f307c427e1a352be7c6421927323eb5e1b
2020-07-20 11:07:45 -07:00
jinbo c2f82351e4 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
2020-07-18 14:06:33 +08:00
angiebird 56345d256a Build libsimple_encode.a separately
BUG=webm:1689

Change-Id: Id920816315c6586cd652ba6cd1b3a76dfc1f12b7
2020-07-17 18:04:09 -07:00
angiebird 16935397ee Add SetEncodeSpeed() to SimpleEncode
Change-Id: I2fcf37045a96bb101de3359e2e69dcc266c1dc10
2020-07-15 14:53:01 -07:00
Jerome Jiang 8c7142d773 Merge "Cap target bitrate to raw rate internally" 2020-07-13 19:24:11 +00:00
Jerome Jiang baefbe85d0 Cap target bitrate to raw rate internally
BUG=webm:1685

Change-Id: Ida72fe854fadb19c3745724e74b67d88087eb83c
2020-07-09 20:25:45 -07:00
James Zern bf3fe26f7e Merge "test/*: rename *TestCase to TestSuite" 2020-07-10 02:35:32 +00:00
James Zern 6ee3f3649f 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
2020-07-09 16:38:00 -07:00
jinbo 5b7882139c 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
2020-07-07 09:25:58 +08:00
Marco Paniconi a1cee8dc91 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
2020-07-06 14:06:49 -07:00
Marco Paniconi 9e15c30585 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
2020-07-06 11:35:43 -07:00
Sreerenj Balachandran 1e9929390c 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
2020-07-01 10:40:20 -07:00
James Zern 220b00dd0d 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
2020-06-29 19:50:36 -07:00
jinbo c039b5442b 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
2020-06-29 18:57:06 +00:00
Marco Paniconi de4aedaec3 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
2020-06-26 17:08:54 -07:00
Marco Paniconi 3f18b08397 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
2020-06-25 13:53:04 -07:00
James Zern d9a69a1e29 Merge "tools/lint-hunks.py: skip third_party files" 2020-06-19 18:15:00 +00:00
James Zern 7ec916e818 Merge changes I07f2c208,I79762df8
* changes:
  update googletest to v1.10.0
  vp9_skip_loopfilter_test: make Init() return a bool
2020-06-19 02:52:58 +00:00
James Zern 1c9fd977aa tools/lint-hunks.py: skip third_party files
Change-Id: I2fda3119c08b5755f1a9b2fad1125090b0d86850
2020-06-18 18:34:55 -07:00
Marco Paniconi 769129fb29 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
2020-06-18 11:26:46 -07:00
James Zern 83769e3d25 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
2020-06-18 10:56:39 -07:00
James Zern 0370a43816 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
2020-06-18 10:54:23 -07:00
Marco Paniconi e9c6cb6474 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
2020-06-18 09:36:09 -07:00
Marco Paniconi 3101666d2a 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
2020-06-16 12:31:04 -07:00
Marco Paniconi 5174eb5b92 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
2020-06-15 19:33:11 -07:00
angiebird e753d4930f Let SetExternalGroupOfPicturesMap use c-style arr
Change-Id: Ic92ce5a3cc5bb74120eb32fc6219e43b1b861f14
2020-06-11 15:10:38 -07:00
angiebird 812eb89b26 Fix assertion error in simple_encode.cc
Change-Id: I271d11cc35d34d5450a8b56fabcedaf2bb7c6565
2020-06-08 16:46:15 -07:00
Angie Chiang e53dc9f2ea Merge "Refactor simple_encode_test.cc" 2020-06-03 23:31:45 +00:00
angiebird d1ed2f0d7a 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
2020-06-02 15:27:59 -07:00
James Zern 3359c1e5dd vp8: restrict 1st pass cpu_used range
< 4 isn't meaningful in the first pass; additional analysis will be
done, but thrown out, unnecessarily increasing the runtime.

Change-Id: Ic3de77e3eaa7a8a3371f76f84693e9655c60fdba
2019-05-30 20:16:46 -07:00
653 changed files with 89658 additions and 33099 deletions
+1 -141
View File
@@ -1,149 +1,9 @@
---
Language: Cpp
# BasedOnStyle: Google
# Generated with clang-format 7.0.1
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
BasedOnStyle: Google
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakTemplateDeclaration: 10
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Right
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...
+2
View File
@@ -7,8 +7,10 @@
*.o
*~
.cproject
.idea
.project
.settings
.vscode
/*-*.mk
/*.asm
/*.doxy
+7 -2
View File
@@ -5,6 +5,7 @@ Aex Converse <alexconv@twitch.tv> <alex.converse@gmail.com>
Alexis Ballier <aballier@gentoo.org> <alexis.ballier@gmail.com>
Alpha Lam <hclam@google.com> <hclam@chromium.org>
Angie Chiang <angiebird@google.com>
Bohan Li <bohanli@google.com>
Chris Cunningham <chcunningham@chromium.org>
Chi Yo Tsai <chiyotsai@google.com>
Daniele Castagna <dcastagna@chromium.org> <dcastagna@google.com>
@@ -12,17 +13,21 @@ Deb Mukherjee <debargha@google.com>
Elliott Karpilovsky <elliottk@google.com>
Erik Niemeyer <erik.a.niemeyer@intel.com> <erik.a.niemeyer@gmail.com>
Fyodor Kyslov <kyslov@google.com>
Gregor Jasny <gjasny@gmail.com>
Gregor Jasny <gjasny@gmail.com> <gjasny@googlemail.com>
Guillaume Martres <gmartres@google.com> <smarter3@gmail.com>
Hangyu Kuang <hkuang@google.com>
Hui Su <huisu@google.com>
Jacky Chen <jackychen@google.com>
Jim Bankoski <jimbankoski@google.com>
Johann Koenig <johannkoenig@google.com>
Johann Koenig <johannkoenig@google.com> <johannkoenig@dhcp-172-19-7-52.mtv.corp.google.com>
Johann Koenig <johannkoenig@google.com> <johann.koenig@duck.com>
Johann Koenig <johannkoenig@google.com> <johann.koenig@gmail.com>
Johann Koenig <johannkoenig@google.com> <johannkoenig@chromium.org>
Johann <johann@duck.com> <johann.koenig@gmail.com>
John Koleszar <jkoleszar@google.com>
Joshua Litt <joshualitt@google.com> <joshualitt@chromium.org>
Konstantinos Margaritis <konma@vectorcamp.gr> <konstantinos@vectorcamp.gr>
Marco Paniconi <marpan@google.com>
Marco Paniconi <marpan@google.com> <marpan@chromium.org>
Martin Storsjö <martin@martin.st>
@@ -50,4 +55,4 @@ Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com>
Yaowu Xu <yaowu@google.com> <Yaowu Xu>
Venkatarama NG. Avadhani <venkatarama.avadhani@ittiam.com>
Vitaly Buka <vitalybuka@chromium.org> <vitlaybuka@chromium.org>
xiwei gu <guxiwei-hf@loongson.cn>
Xiwei Gu <guxiwei-hf@loongson.cn>
+38 -1
View File
@@ -3,6 +3,7 @@
Aaron Watry <awatry@gmail.com>
Abo Talib Mahfoodh <ab.mahfoodh@gmail.com>
Adam B. Goode <adam.mckee84@gmail.com>
Adrian Grange <agrange@google.com>
Ahmad Sharif <asharif@google.com>
Aidan Welch <aidansw@yahoo.com>
@@ -20,23 +21,34 @@ Andoni Morales Alastruey <ylatuya@gmail.com>
Andres Mejia <mcitadel@gmail.com>
Andrew Lewis <andrewlewis@google.com>
Andrew Russell <anrussell@google.com>
Andrew Salkeld <andrew.salkeld@arm.com>
Angie Chen <yunqi@google.com>
Angie Chiang <angiebird@google.com>
Anton Venema <anton.venema@liveswitch.com>
Anupam Pandey <anupam.pandey@ittiam.com>
Aron Rosenberg <arosenberg@logitech.com>
Attila Nagy <attilanagy@google.com>
Birk Magnussen <birk.magnussen@googlemail.com>
Bohan Li <bohanli@google.com>
Brian Foley <bpfoley@google.com>
Brion Vibber <bvibber@wikimedia.org>
Casey Smalley <casey.smalley@arm.com>
changjun.yang <changjun.yang@intel.com>
Charles 'Buck' Krasic <ckrasic@google.com>
Cheng Chen <chengchen@google.com>
Chen Wang <wangchen20@iscas.ac.cn>
Cherma Rajan A <cherma.rajan@ittiam.com>
Chi Yo Tsai <chiyotsai@google.com>
chm <chm@rock-chips.com>
Chris Cunningham <chcunningham@chromium.org>
Christian Duvivier <cduvivier@google.com>
Chunbo Hua <chunbo.hua@intel.com>
Chun-Min Chang <chun.m.chang@gmail.com>
Clement Courbet <courbet@google.com>
Daniel Cheng <dcheng@chromium.org>
Daniele Castagna <dcastagna@chromium.org>
Daniel Kang <ddkang@google.com>
Daniel Sommermann <dcsommer@gmail.com>
Dan Zhu <zxdan@google.com>
Deb Mukherjee <debargha@google.com>
Deepa K G <deepa.kg@ittiam.com>
@@ -54,6 +66,8 @@ Fritz Koenig <frkoenig@google.com>
Fyodor Kyslov <kyslov@google.com>
Gabriel Marin <gmx@chromium.org>
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
George Steed <george.steed@arm.com>
Gerda Zsejke More <gerdazsejke.more@arm.com>
Geza Lore <gezalore@gmail.com>
Ghislain MARY <ghislainmary2@gmail.com>
Giuseppe Scrivano <gscrivano@gnu.org>
@@ -64,15 +78,20 @@ Guillermo Ballester Valor <gbvalor@gmail.com>
Hangyu Kuang <hkuang@google.com>
Hanno Böck <hanno@hboeck.de>
Han Shen <shenhan@google.com>
Hao Chen <chenhao@loongson.cn>
Hari Limaye <hari.limaye@arm.com>
Harish Mahendrakar <harish.mahendrakar@ittiam.com>
Henrik Lundin <hlundin@google.com>
Hien Ho <hienho@google.com>
Hirokazu Honda <hiroh@chromium.org>
Hui Su <huisu@google.com>
Ilya Kurdyukov <jpegqs@gmail.com>
Ivan Krasin <krasin@chromium.org>
Ivan Maltz <ivanmaltz@google.com>
Jacek Caban <cjacek@gmail.com>
Jacky Chen <jackychen@google.com>
James Berry <jamesberry@google.com>
James Touton <bekenn@gmail.com>
James Yu <james.yu@linaro.org>
James Zern <jzern@google.com>
Jan Gerber <j@mailb.org>
@@ -82,16 +101,23 @@ Jean-Yves Avenard <jyavenard@mozilla.com>
Jeff Faust <jfaust@google.com>
Jeff Muizelaar <jmuizelaar@mozilla.com>
Jeff Petkau <jpet@chromium.org>
Jeremy Leconte <jleconte@google.com>
Jerome Jiang <jianj@google.com>
Jia Jia <jia.jia@linaro.org>
Jianhui Dai <jianhui.j.dai@intel.com>
Jian Zhou <zhoujian@google.com>
Jim Bankoski <jimbankoski@google.com>
jinbo <jinbo-hf@loongson.cn>
Jin Bo <jinbo@loongson.cn>
Jingning Han <jingning@google.com>
Joel Fernandes <joelaf@google.com>
Joey Parrish <joeyparrish@google.com>
Johann <johann@duck.com>
Johann Koenig <johannkoenig@google.com>
John Koleszar <jkoleszar@google.com>
Johnny Klonaris <google@jawknee.com>
John Stark <jhnstrk@gmail.com>
Jonathan Wright <jonathan.wright@arm.com>
Jon Kunkee <jkunkee@microsoft.com>
Jorge E. Moreira <jemoreira@google.com>
Joshua Bleecher Snyder <josh@treelinelabs.com>
@@ -101,13 +127,16 @@ Justin Clift <justin@salasaga.org>
Justin Lebar <justin.lebar@gmail.com>
Kaustubh Raste <kaustubh.raste@imgtec.com>
KO Myung-Hun <komh@chollian.net>
Konstantinos Margaritis <konma@vectorcamp.gr>
Kyle Siefring <kylesiefring@gmail.com>
Lawrence Velázquez <larryv@macports.org>
L. E. Segovia <amy@amyspark.me>
Linfeng Zhang <linfengz@google.com>
Liu Peng <pengliu.mail@gmail.com>
Lou Quillio <louquillio@google.com>
Luca Barbato <lu_zero@gentoo.org>
Luc Trudeau <luc@trud.ca>
Lu Wang <wanglu@loongson.cn>
Makoto Kato <makoto.kt@gmail.com>
Mans Rullgard <mans@mansr.com>
Marco Paniconi <marpan@google.com>
@@ -121,6 +150,7 @@ Michael Kohler <michaelkohler@live.com>
Mike Frysinger <vapier@chromium.org>
Mike Hommey <mhommey@mozilla.com>
Mikhal Shemer <mikhal@google.com>
Mikko Koivisto <mikko.koivisto@unikie.com>
Min Chen <chenm003@gmail.com>
Minghai Shang <minghai@google.com>
Min Ye <yeemmi@google.com>
@@ -128,6 +158,7 @@ Mirko Bonadei <mbonadei@google.com>
Moriyoshi Koizumi <mozo@mozo.jp>
Morton Jonuschat <yabawock@gmail.com>
Nathan E. Egge <negge@mozilla.com>
Neeraj Gadgil <neeraj.gadgil@ittiam.com>
Neil Birkbeck <neil.birkbeck@gmail.com>
Nico Weber <thakis@chromium.org>
Niveditha Rau <niveditha.rau@gmail.com>
@@ -141,6 +172,7 @@ Pengchong Jin <pengchong@google.com>
Peter Boström <pbos@chromium.org>
Peter Collingbourne <pcc@chromium.org>
Peter de Rivaz <peter.derivaz@gmail.com>
Peter Kasting <pkasting@chromium.org>
Philip Jägenstedt <philipj@opera.com>
Priit Laes <plaes@plaes.org>
Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
@@ -156,7 +188,9 @@ Rob Bradford <rob@linux.intel.com>
Ronald S. Bultje <rsbultje@gmail.com>
Rui Ueyama <ruiu@google.com>
Sai Deng <sdeng@google.com>
Salome Thirot <salome.thirot@arm.com>
Sami Pietilä <samipietila@google.com>
Sam James <sam@gentoo.org>
Sarah Parker <sarahparker@google.com>
Sasi Inguva <isasi@google.com>
Scott Graham <scottmg@chromium.org>
@@ -191,15 +225,18 @@ Vitaly Buka <vitalybuka@chromium.org>
Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Wan-Teh Chang <wtc@google.com>
Wonkap Jang <wonkap@google.com>
xiwei gu <guxiwei-hf@loongson.cn>
Xiahong Bao <xiahong.bao@nxp.com>
Xiwei Gu <guxiwei-hf@loongson.cn>
Yaowu Xu <yaowu@google.com>
Yi Luo <luoyi@google.com>
Yongzhe Wang <yongzhe@google.com>
yuanhecai <yuanhecai@loongson.cn>
Yue Chen <yuec@google.com>
Yun Liu <yliuyliu@google.com>
Yunqing Wang <yunqingwang@google.com>
Yury Gitman <yuryg@google.com>
Zoe Liu <zoeliu@google.com>
Zoltan Kuscsik <zoltan@s57.io>
Google Inc.
The Mozilla Foundation
The Xiph.Org Foundation
+330 -1
View File
@@ -1,8 +1,334 @@
2025-01-09 v1.15.1 "Wigeon Duck"
This release bumps up the SO major version and fixes the language about ABI
compatibility in the previous release changelog.
2024-10-22 v1.15.0 "Wigeon Duck"
This release includes new codec control for key frame filtering, more Neon
optimizations, improvements to RTC encoding and bug fixes.
- Upgrading:
This release is ABI incompatible with the previous release.
It is strongly recommended to skip this release and upgrade to v1.15.1 since
the shared object was versioned incorrectly, as shown in
https://issues.webmproject.org/issues/384672478.
Temporal filtering improvement that can be turned on with the new codec
control VP9E_SET_KEY_FRAME_FILTERING, which gives 1+% BD-rate saving with
minimal encoder time increase.
libwebm is upgraded to libwebm-1.0.0.31-10-g3b63004
- Enhancement:
Neon optimization speed up
1-3% speed up across speed 5 to 10 for RTC
3% speed up for speed 0 and 1 for VoD in standard bitdepth
3% and 7% speed up for speed 0 and 1 respectively for VoD in high bitdepth
Scene detection is allowed for all RTC speeds (>=5)
Support profile guided optimizations
Delta quantization parameters for UV channels for vp8 is supported in RTC
rate control library
Rate control parameters are reset and maximum QP is enforced on scene
changes in SVC when there is no inter-layer prediction
- Bug fixes:
Fix to Uninitialized scalar variable in `vp9_rd_pick_inter_mode_sb()`
Fix to Integer-overflow in `resize_multistep`
Fix to Heap-buffer-overflow in `vpx_sad64x64_avx2`
Fix to Crash in `vpx_sad8x8_sse2`
Fix to Assertion in `write_modes`
Support profile guided optimizations
Fix to Integer-overflow in `encode_frame_to_data_rate`
Fix to Integer-overflow in `vp9_svc_check_reset_layer_rc_flag`
Fix to core dump error from /usr/bin/tools/tiny_ssim --help
Fix to use-of-uninitialized-value in `vp9_setup_tpl_stats`
Fix to Undefined-shift in `vp9_cyclic_refresh_setup`
Fix to redundant `&& __GNUC__` preproc check
Fix to valgrind warning in EncodeAPI.OssFuzz69906
Fix to Index-out-of-bounds in `vp8_rd_pick_inter_mode`
Fix to Integer-overflow in `vp8_pick_frame_size`
Fix to Use-of-uninitialized-value in `vpx_codec_peek_stream_info`
Fix to log clutters with the message "Warning: Desired height too large"
Fix to Integer-overflow in `vp9_svc_adjust_avg_frame_qindex`
Fix to integer overflows caused by huge target bitrate, frame rate, or
g_timebase numerator or denominator
Fix to missing license headers
Fix to build failure for Android Armv7
Fix to integer overflows in image helpers
Fix to Integer-overflow in `vp9_calc_iframe_target_size_one_pass_cbr`
Fix to Heap-buffer-overflow in `vp9_pick_inter_mode`
Fix to Segv in `vp9_multi_thread_tile_init`
Fix to Use-of-uninitialized-value in `vp9_row_mt_sync_mem_dealloc`
Fix to Crash in `mbloop_filter_vertical_edge_c`
Fix to Check failed in CheckUnwind
Fix to Heap-buffer-overflow in `write_modes_b` and `vpx_write`
Fix to Possible signed integer overflow found in `vpx_codec_encode`
Fix to build conflicts between Abseil and libaom/libvpx in Win ARM64 builds
Fix to build failures on aarch64
Fix to Data race in libvpx ARM NEON
Fix to Heap-buffer-overflow in `scale_plane_1_to_2_phase_0`
Fix to integer overflow in `encode_mb_row`
Fix to Floating-point-exception in `vp8_pick_frame_size`
Fix to Heap-buffer-overflow in `vp9_enc_setup_mi`
Fix to build failure with --target=arm64-win64-vs17
Fix to heap-buffer-overflow write in `vpx_img_read()`
Fix to C vs armv8-linux-gcc encode mismatches for `y4m_360p_10bit_input`
Fix to Null-dereference READ in `ml_predict_var_rd_partitioning`
Fix to Heap-buffer-overflow in `vpx_scaled_2d_ssse3`
Fix to Crash in `convolve_horiz`
Fix to Ill in `vpx_scaled_2d_ssse3`
Fix to Global-buffer-overflow in `cost_coeffs`
2024-05-21 v1.14.1 "Venetian Duck"
This release includes enhancements and bug fixes.
- Upgrading:
This release is ABI compatible with the previous release.
- Enhancement:
Improved the detection of compiler support for AArch64 extensions,
particularly SVE.
Added vpx_codec_get_global_headers() support for VP9.
- Bug fixes:
Added buffer bounds checks to vpx_writer and vpx_write_bit_buffer.
Fix to GetSegmentationData() crash in aq_mode=0 for RTC rate control.
Fix to alloc for row_base_thresh_freq_fac.
Free row mt memory before freeing cpi->tile_data.
Fix to buffer alloc for vp9_bitstream_worker_data.
Fix to VP8 race issue for multi-thread with pnsr_calc.
Fix to uv width/height in vp9_scale_and_extend_frame_ssse3.
Fix to integer division by zero and overflow in calc_pframe_target_size().
Fix to integer overflow in vpx_img_alloc() & vpx_img_wrap()(CVE-2024-5197).
Fix to UBSan error in vp9_rc_update_framerate().
Fix to UBSan errors in vp8_new_framerate().
Fix to integer overflow in vp8 encodeframe.c.
Handle EINTR from sem_wait().
2024-01-02 v1.14.0 "Venetian Duck"
This release drops support for old C compilers, such as Visual Studio 2012
and older, that disallow mixing variable declarations and statements (a C99
feature). It adds support for run-time CPU feature detection for Arm
platforms, as well as support for darwin23 (macOS 14).
- Upgrading:
This release is ABI incompatible with the previous release.
Various new features for rate control library for real-time: SVC parallel
encoding, loopfilter level, support for frame dropping, and screen content.
New callback function send_tpl_gop_stats for vp9 external rate control
library, which can be used to transmit TPL stats for a group of pictures. A
public header vpx_tpl.h is added for the definition of TPL stats used in
this callback.
libwebm is upgraded to libwebm-1.0.0.29-9-g1930e3c.
- Enhancement:
Improvements on Neon optimizations: VoD: 12-35% speed up for bitdepth 8,
68%-151% speed up for high bitdepth.
Improvements on AVX2 and SSE optimizations.
Improvements on LSX optimizations for LoongArch.
42-49% speedup on speed 0 VoD encoding.
Android API level predicates.
- Bug fixes:
Fix to missing prototypes from the rtcd header.
Fix to segfault when total size is enlarged but width is smaller.
Fix to the build for arm64ec using MSVC.
Fix to copy BLOCK_8X8's mi to PICK_MODE_CONTEXT::mic.
Fix to -Wshadow warnings.
Fix to heap overflow in vpx_get4x4sse_cs_neon.
Fix to buffer overrun in highbd Neon subpel variance filters.
Added bitexact encode test script.
Fix to -Wl,-z,defs with Clang's sanitizers.
Fix to decoder stability after error & continued decoding.
Fix to mismatch of VP9 encode with NEON intrinsics with C only version.
Fix to Arm64 MSVC compile vpx_highbd_fdct4x4_neon.
Fix to fragments count before use.
Fix to a case where target bandwidth is 0 for SVC.
Fix mask in vp9_quantize_avx2,highbd_get_max_lane_eob.
Fix to int overflow in vp9_calc_pframe_target_size_one_pass_cbr.
Fix to integer overflow in vp8,ratectrl.c.
Fix to integer overflow in vp9 svc.
Fix to avg_frame_bandwidth overflow.
Fix to per frame qp for temporal layers.
Fix to unsigned integer overflow in sse computation.
Fix to uninitialized mesh feature for BEST mode.
Fix to overflow in highbd temporal_filter.
Fix to unaligned loads w/w==4 in vpx_convolve_copy_neon.
Skip arm64_neon.h workaround w/VS >= 2019.
Fix to c vs avx mismatch of diamond_search_sad().
Fix to c vs intrinsic mismatch of vpx_hadamard_32x32() function.
Fix to a bug in vpx_hadamard_32x32_neon().
Fix to Clang -Wunreachable-code-aggressive warnings.
Fix to a bug in vpx_highbd_hadamard_32x32_neon().
Fix to -Wunreachable-code in mfqe_partition.
Force mode search on 64x64 if no mode is selected.
Fix to ubsan failure caused by left shift of negative.
Fix to integer overflow in calc_pframe_target_size.
Fix to float-cast-overflow in vp8_change_config().
Fix to a null ptr before use.
Conditionally skip using inter frames in speed features.
Remove invalid reference frames.
Disable intra mode search speed features conditionally.
Set nonrd keyframe under dynamic change of deadline for rtc.
Fix to scaled reference offsets.
Set skip_recode=0 in nonrd_pick_sb_modes.
Fix to an edge case when downsizing to one.
Fix to a bug in frame scaling.
Fix to pred buffer stride.
Fix to a bug in simple motion search.
Update frame size in actual encoding.
2023-09-29 v1.13.1 "Ugly Duckling"
This release contains two security related fixes. One each for VP8 and VP9.
- Upgrading:
This release is ABI compatible with the previous release.
- Bug fixes:
https://crbug.com/1486441 (CVE-2023-5217)
Fix to a crash related to VP9 encoding (#1642, CVE-2023-6349)
2023-01-31 v1.13.0 "Ugly Duckling"
This release includes more Neon and AVX2 optimizations, adds a new codec
control to set per frame QP, upgrades GoogleTest to v1.12.1, and includes
numerous bug fixes.
- Upgrading:
This release is ABI incompatible with the previous release.
New codec control VP9E_SET_QUANTIZER_ONE_PASS to set per frame QP.
GoogleTest is upgraded to v1.12.1.
.clang-format is upgraded to clang-format-11.
VPX_EXT_RATECTRL_ABI_VERSION was bumped due to incompatible changes to the
feature of using external rate control models for vp9.
- Enhancement:
Numerous improvements on Neon optimizations.
Numerous improvements on AVX2 optimizations.
Additional ARM targets added for Visual Studio.
- Bug fixes:
Fix to calculating internal stats when frame dropped.
Fix to segfault for external resize test in vp9.
Fix to build system with replacing egrep with grep -E.
Fix to a few bugs with external RTC rate control library.
Fix to make SVC work with VBR.
Fix to key frame setting in VP9 external RC.
Fix to -Wimplicit-int (Clang 16).
Fix to VP8 external RC for buffer levels.
Fix to VP8 external RC for dynamic update of layers.
Fix to VP9 auto level.
Fix to off-by-one error of max w/h in validate_config.
Fix to make SVC work for Profile 1.
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.
Allow SimpleEncode environment to take target level as input to match
the level conformance in vp9.
- 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.
2021-09-27 v1.11.0 "Smew Duck"
This maintenance release adds support for VBR mode in VP9 rate control
interface, new codec controls to get quantization parameters and loop filter
levels, and includes several improvements to NEON and numerous bug fixes.
- Upgrading:
This release is ABI incompatible with the previous release.
New codec control is added to get quantization parameters and loop filter
levels.
VBR mode is supported in VP9 rate control library.
- Enhancement:
Numerous improvements for Neon optimizations.
Code clean-up and refactoring.
Calculation of rd multiplier is changed with BDRATE gains.
- Bug fixes:
Fix to overflow on duration.
Fix to several instances of -Wunused-but-set-variable.
Fix to avoid chroma resampling for 420mpeg2 input.
Fix to overflow in calc_iframe_target_size.
Fix to disallow skipping transform and quantization.
Fix some -Wsign-compare warnings in simple_encode.
Fix input file path in simple_encode_test.
Fix valid range for under/over_shoot pct.
2021-03-09 v1.10.0 "Ruddy Duck"
This maintenance release adds support for darwin20 and new codec controls, as
well as numerous bug fixes.
- Upgrading:
This release is ABI incompatible with the previous release.
New codec control is added to disable loopfilter for VP9.
New encoder control is added to disable feature to increase Q on overshoot
detection for CBR.
Configure support for darwin20 is added.
New codec control is added for VP9 rate control. The control ID of this
interface is VP9E_SET_EXTERNAL_RATE_CONTROL. To make VP9 use a customized
external rate control model, users will have to implement each callback
function in vpx_rc_funcs_t and register them using libvpx API
vpx_codec_control_() with the control ID.
- Enhancement:
Use -std=gnu++11 instead of -std=c++11 for c++ files.
- Bug fixes:
Override assembler with --as option of configure for MSVS.
Fix several compilation issues with gcc 4.8.5.
Fix to resetting rate control for temporal layers.
Fix to the rate control stats of SVC example encoder when number of spatial
layers is 1.
Fix to reusing motion vectors from the base spatial layer in SVC.
2 pass related flags removed from SVC example encoder.
2020-07-29 v1.9.0 "Quacking Duck"
This release adds support for NV12, a separate library for rate control, as
well as incremental improvements.
- Upgrading:
This release is ABI compatible with the previous release.
NV12 support is added to this release.
A new interface is added for VP9 rate control. The new library libvp9rc.a
must be linked by applications.
@@ -26,12 +352,14 @@
This release collects incremental improvements to many aspects of the library.
- Upgrading:
This release is ABI compatible with the previous release.
ARCH_* defines have been removed in favor of VPX_ARCH_*.
2019-07-15 v1.8.1 "Orpington Duck"
This release collects incremental improvements to many aspects of the library.
- Upgrading:
This release is ABI incompatible with the previous release.
VP8E_SET_CPUUSED now accepts values up to 9 for vp9.
VPX_CTRL_VP9E_SET_MAX_INTER_BITRATE_PCT had a spelling fix (was VP8E).
The --sdk-path option has been removed. If you were using it to build for
@@ -50,7 +378,8 @@
This release focused on encoding performance for realtime and VOD use cases.
- Upgrading:
This adds and improves several vp9 controls. Most are related to SVC:
This release is ABI incompatible with the previous release. This adds and
improves several vp9 controls. Most are related to SVC:
VP9E_SET_SVC_FRAME_DROP_LAYER:
- Frame dropping in SVC.
VP9E_SET_SVC_INTER_LAYER_PRED:
+3 -4
View File
@@ -19,10 +19,9 @@ again.
All submissions, including submissions by project members, require review. We
use a [Gerrit](https://www.gerritcodereview.com) instance hosted at
https://chromium-review.googlesource.com for this purpose.
See https://www.webmproject.org/code/contribute/submitting-patches for an
example of a typical gerrit workflow.
https://chromium-review.googlesource.com for this purpose. See the
[WebM Project page](https://www.webmproject.org/code/contribute/submitting-patches/)
for additional details.
## Community Guidelines
+72 -11
View File
@@ -1,5 +1,3 @@
README - 20 July 2020
Welcome to the WebM VP8/VP9 Codec SDK!
COMPILING THE APPLICATIONS/LIBRARIES:
@@ -10,14 +8,14 @@ COMPILING THE APPLICATIONS/LIBRARIES:
1. Prerequisites
* All x86 targets require the Yasm[1] assembler be installed[2].
* All Windows builds require that Cygwin[3] be installed.
* Building the documentation requires Doxygen[4]. If you do not
* All Windows builds require that Cygwin[3] or MSYS2[4] be installed.
* Building the documentation requires Doxygen[5]. If you do not
have this package, the install-docs option will be disabled.
* Downloading the data for the unit tests requires curl[5] and sha1sum.
* Downloading the data for the unit tests requires curl[6] and sha1sum.
sha1sum is provided via the GNU coreutils, installed by default on
many *nix platforms, as well as MinGW and Cygwin. If coreutils is not
available, a compatible version of sha1sum can be built from
source[6]. These requirements are optional if not running the unit
source[7]. These requirements are optional if not running the unit
tests.
[1]: http://www.tortall.net/projects/yasm
@@ -26,9 +24,10 @@ COMPILING THE APPLICATIONS/LIBRARIES:
yasm-<version>-<arch>.exe to yasm.exe and place it in:
Program Files (x86)/Microsoft Visual Studio/2017/<level>/Common7/Tools/
[3]: http://www.cygwin.com
[4]: http://www.doxygen.org
[5]: http://curl.haxx.se
[6]: http://www.microbrew.org/tools/md5sha1sum/
[4]: http://www.msys2.org/
[5]: http://www.doxygen.org
[6]: http://curl.haxx.se
[7]: http://www.microbrew.org/tools/md5sha1sum/
2. Out-of-tree builds
Out of tree builds are a supported method of building the application. For
@@ -62,9 +61,18 @@ COMPILING THE APPLICATIONS/LIBRARIES:
arm64-android-gcc
arm64-darwin-gcc
arm64-darwin20-gcc
arm64-darwin21-gcc
arm64-darwin22-gcc
arm64-darwin23-gcc
arm64-darwin24-gcc
arm64-linux-gcc
arm64-win64-gcc
arm64-win64-vs15
arm64-win64-vs16
arm64-win64-vs16-clangcl
arm64-win64-vs17
arm64-win64-vs17-clangcl
armv7-android-gcc
armv7-darwin-gcc
armv7-linux-rvct
@@ -73,8 +81,12 @@ COMPILING THE APPLICATIONS/LIBRARIES:
armv7-win32-gcc
armv7-win32-vs14
armv7-win32-vs15
armv7-win32-vs16
armv7-win32-vs17
armv7s-darwin-gcc
armv8-linux-gcc
loongarch32-linux-gcc
loongarch64-linux-gcc
mips32-linux-gcc
mips64-linux-gcc
ppc64le-linux-gcc
@@ -101,6 +113,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
x86-win32-vs14
x86-win32-vs15
x86-win32-vs16
x86-win32-vs17
x86_64-android-gcc
x86_64-darwin9-gcc
x86_64-darwin10-gcc
@@ -113,6 +126,11 @@ COMPILING THE APPLICATIONS/LIBRARIES:
x86_64-darwin17-gcc
x86_64-darwin18-gcc
x86_64-darwin19-gcc
x86_64-darwin20-gcc
x86_64-darwin21-gcc
x86_64-darwin22-gcc
x86_64-darwin23-gcc
x86_64-darwin24-gcc
x86_64-iphonesimulator-gcc
x86_64-linux-gcc
x86_64-linux-icc
@@ -121,6 +139,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
x86_64-win64-vs14
x86_64-win64-vs15
x86_64-win64-vs16
x86_64-win64-vs17
generic-gnu
The generic-gnu target, in conjunction with the CROSS environment variable,
@@ -133,8 +152,8 @@ COMPILING THE APPLICATIONS/LIBRARIES:
$ CROSS=mipsel-linux-uclibc- ../libvpx/configure
In addition, the executables to be invoked can be overridden by specifying the
environment variables: CC, AR, LD, AS, STRIP, NM. Additional flags can be
passed to these executables with CFLAGS, LDFLAGS, and ASFLAGS.
environment variables: AR, AS, CC, CXX, LD, STRIP. Additional flags can be
passed to these executables with ASFLAGS, CFLAGS, CXXFLAGS, and LDFLAGS.
6. Configuration errors
If the configuration step fails, the first step is to look in the error log.
@@ -164,7 +183,49 @@ CODE STYLE:
See also: http://clang.llvm.org/docs/ClangFormat.html
PROFILE GUIDED OPTIMIZATION (PGO)
Profile Guided Optimization can be enabled for Clang builds using the
commands:
$ export CC=clang
$ export CXX=clang++
$ ../libvpx/configure --enable-profile
$ make
Generate one or multiple PGO profile files by running vpxdec or vpxenc. For
example:
$ ./vpxdec ../vpx/out_ful/vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm \
-o - > /dev/null
To convert and merge the raw profile files, use the llvm-profdata tool:
$ llvm-profdata merge -o perf.profdata default_8382761441159425451_0.profraw
Then, rebuild the project with the new profile file:
$ make clean
$ ../libvpx/configure --use-profile=perf.profdata
$ make
Note: Always use the llvm-profdata from the toolchain that is used for
compiling the PGO-enabled binary.
To observe the improvements from a PGO-enabled build, enable and compare the
list of failed optimizations by using the -Rpass-missed compiler flag. For
example, to list the failed loop vectorizations:
$ ../libvpx/configure --use-profile=perf.profdata \
--extra-cflags=-Rpass-missed=loop-vectorize
For guidance on utilizing PGO files to identify potential optimization
opportunities, see: tools/README.pgo.md
SUPPORT
This library is an open source project supported by its community. Please
email webm-discuss@webmproject.org for help.
BUG REPORTS
Bug reports can be filed in the libvpx issue tracker:
https://issues.webmproject.org/.
For security reports, select 'Security report' from the Template dropdown.
+1 -1
View File
@@ -16,7 +16,7 @@ VP8/VP9 Codec SDK. [https://www.webmproject.org/code/](https://www.webmproject.o
## Downloads
Development libraries are available from the [releases](https://github.com/ShiftMediaProject/libvpx/releases) page. These libraries are available for each supported Visual Studio version (2013, 2015 or 2017) with a different download for each version. Each download contains both static and dynamic libraries to choose from in both 32bit and 64bit versions.
Development libraries are available from the [releases](https://github.com/ShiftMediaProject/libvpx/releases) page. These libraries are available for each supported Visual Studio version with a different download for each version. Each download contains both static and dynamic libraries to choose from in both 32bit and 64bit versions.
## Code
+1 -37
View File
@@ -107,44 +107,8 @@ index b3af677d2..7b65bb4a7 100644
;macro in deblock functions
%macro FIRST_2_ROWS 0
movdqa xmm4, xmm0
diff --git a/vpx_dsp/x86/sad_sse3.asm b/vpx_dsp/x86/sad_sse3.asm
index acbd2e4fa..4a4e621f5 100644
--- a/vpx_dsp/x86/sad_sse3.asm
+++ b/vpx_dsp/x86/sad_sse3.asm
@@ -10,6 +10,7 @@
%include "vpx_ports/x86_abi_support.asm"
+section .text
%macro STACK_FRAME_CREATE_X3 0
%if ABI_IS_32BIT
%define src_ptr rsi
diff --git a/vpx_dsp/x86/sad_sse4.asm b/vpx_dsp/x86/sad_sse4.asm
index 0818ed5f0..03912c4f4 100644
--- a/vpx_dsp/x86/sad_sse4.asm
+++ b/vpx_dsp/x86/sad_sse4.asm
@@ -11,6 +11,7 @@
%include "vpx_ports/x86_abi_support.asm"
+section .text
%macro PROCESS_16X2X8 1
%if %1
movdqa xmm0, XMMWORD PTR [rsi]
diff --git a/vpx_dsp/x86/sad_ssse3.asm b/vpx_dsp/x86/sad_ssse3.asm
index a5bc6d730..54ab46d38 100644
--- a/vpx_dsp/x86/sad_ssse3.asm
+++ b/vpx_dsp/x86/sad_ssse3.asm
@@ -11,6 +11,7 @@
%include "vpx_ports/x86_abi_support.asm"
+section .text
%macro PROCESS_16X2X3 1
%if %1
movdqa xmm0, XMMWORD PTR [rsi]
diff --git a/vpx_dsp/x86/ssim_opt_x86_64.asm b/vpx_dsp/x86/ssim_opt_x86_64.asm
index 41ffbb07e..efb7759f5 100644
index 1ad3b88c8..d019e549d 100644
--- a/vpx_dsp/x86/ssim_opt_x86_64.asm
+++ b/vpx_dsp/x86/ssim_opt_x86_64.asm
@@ -10,6 +10,7 @@
+10 -4
View File
@@ -20,6 +20,8 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- MSVC_VER: 16
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- MSVC_VER: 17
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
install:
# Install GitLink
@@ -32,7 +34,9 @@ before_build:
# Setup msvc environment for required compiler version (specified by MSVC_VER)
- ps: >-
if ($env:MSVC_VER -eq 16) {
if ($env:MSVC_VER -eq 17) {
$env:VCVARS="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat"
} elseif ($env:MSVC_VER -eq 16) {
$env:VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat"
} elseif ($env:MSVC_VER -eq 15) {
$env:VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
@@ -104,7 +108,9 @@ before_build:
# Set Targets path so that gitlink works correctly
- ps: $env:MSBUILDDIR=((Get-Command msbuild.exe).Path | Split-Path -parent)
- ps: >-
if ($env:MSVC_VER -eq 16) {
if ($env:MSVC_VER -eq 17) {
$env:VCTargetsPath="$env:MSBUILDDIR\..\..\..\Microsoft\VC\v170\"
} elseif ($env:MSVC_VER -eq 16) {
$env:VCTargetsPath="$env:MSBUILDDIR\..\..\Microsoft\VC\v160\"
} elseif ($env:MSVC_VER -eq 15) {
$env:VCTargetsPath="$env:MSBUILDDIR\..\..\..\Common7\IDE\VC\VCTargets"
@@ -113,7 +119,7 @@ before_build:
}
# Download and install yasm integration
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/ShiftMediaProject/VSYASM/releases/download/0.5/VSYASM.zip', "$pwd\yasm.zip")
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/ShiftMediaProject/VSYASM/releases/download/0.7/VSYASM.zip', "$pwd\yasm.zip")
- ps: Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory("$pwd\yasm.zip", "$pwd\TempYASMUnpack")
- cmd: call ".\TempYASMUnpack\install_script.bat"
# Additional yasm location in order to fix gitlink error
@@ -134,6 +140,6 @@ deploy:
tag: $(APPVEYOR_REPO_TAG_NAME)
description: Pre-built static and shared libraries in 32b and 64b for $(APPVEYOR_PROJECT_NAME) $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: aiTcAD/YitqgwuiBdC3ImXiUlHfIIDD7ayjCs3Y3aAO5vEm1gA7flCZpUZ60a5am
secure: c9Sads7Y16h7FP+LrR3IjVygYAgh8GByE8TtazxDg7jpPVxc+XDV81z7MoUc2Ada
artifact: $(APPVEYOR_PROJECT_NAME)_$(APPVEYOR_REPO_TAG_NAME)_msvc$(MSVC_VER)
force_update: true
+4 -4
View File
@@ -1,12 +1,12 @@
EXPORTS
vpx_codec_vp8_cx_algo
vpx_codec_vp8_cx_algo DATA
vpx_codec_vp8_cx
vpx_codec_vp8_dx_algo
vpx_codec_vp8_dx_algo DATA
vpx_codec_vp8_dx
vpx_codec_vp9_cx_algo
vpx_codec_vp9_cx_algo DATA
vpx_codec_vp9_cx
vpx_codec_vp9_dx_algo
vpx_codec_vp9_dx_algo DATA
vpx_codec_vp9_dx
vpx_codec_build_config
vpx_codec_control_
+34 -16
View File
@@ -4,6 +4,8 @@ VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 12.0.30501.0
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvpx", "libvpx.vcxproj", "{8293418A-603A-4119-B7B4-1E6204606BA9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvpx_winrt", "libvpx_winrt.vcxproj", "{A293418A-603A-4119-B7B4-1E6204606BA9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -32,14 +34,10 @@ Global
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLL|x64.Build.0 = DebugDLL|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLL|x86.ActiveCfg = DebugDLL|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLL|x86.Build.0 = DebugDLL|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x64.ActiveCfg = DebugDLLWinRT|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x64.Build.0 = DebugDLLWinRT|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x86.ActiveCfg = DebugDLLWinRT|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x86.Build.0 = DebugDLLWinRT|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x64.ActiveCfg = DebugWinRT|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x64.Build.0 = DebugWinRT|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x86.ActiveCfg = DebugWinRT|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x86.Build.0 = DebugWinRT|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x64.ActiveCfg = DebugDLL|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x86.ActiveCfg = DebugDLL|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x64.ActiveCfg = Debug|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x86.ActiveCfg = Debug|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.Release|x64.ActiveCfg = Release|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.Release|x64.Build.0 = Release|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.Release|x86.ActiveCfg = Release|Win32
@@ -48,14 +46,34 @@ Global
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x64.ActiveCfg = ReleaseDLLWinRT|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x64.Build.0 = ReleaseDLLWinRT|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x86.ActiveCfg = ReleaseDLLWinRT|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x86.Build.0 = ReleaseDLLWinRT|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x64.ActiveCfg = ReleaseWinRT|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x64.Build.0 = ReleaseWinRT|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x86.ActiveCfg = ReleaseWinRT|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x86.Build.0 = ReleaseWinRT|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x64.ActiveCfg = ReleaseDLL|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x86.ActiveCfg = ReleaseDLL|Win32
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x64.ActiveCfg = Release|x64
{8293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x86.ActiveCfg = Release|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.Debug|x64.ActiveCfg = DebugWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.Debug|x86.ActiveCfg = DebugWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLL|x64.ActiveCfg = DebugDLLWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLL|x86.ActiveCfg = DebugDLLWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x64.ActiveCfg = DebugDLLWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x64.Build.0 = DebugDLLWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x86.ActiveCfg = DebugDLLWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugDLLWinRT|x86.Build.0 = DebugDLLWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x64.ActiveCfg = DebugWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x64.Build.0 = DebugWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x86.ActiveCfg = DebugWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.DebugWinRT|x86.Build.0 = DebugWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.Release|x64.ActiveCfg = ReleaseWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.Release|x86.ActiveCfg = ReleaseWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLLWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLL|x86.ActiveCfg = ReleaseDLLWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x64.ActiveCfg = ReleaseDLLWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x64.Build.0 = ReleaseDLLWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x86.ActiveCfg = ReleaseDLLWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseDLLWinRT|x86.Build.0 = ReleaseDLLWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x64.ActiveCfg = ReleaseWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x64.Build.0 = ReleaseWinRT|x64
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x86.ActiveCfg = ReleaseWinRT|Win32
{A293418A-603A-4119-B7B4-1E6204606BA9}.ReleaseWinRT|x86.Build.0 = ReleaseWinRT|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+13 -1742
View File
File diff suppressed because it is too large Load Diff
+90 -18
View File
@@ -130,14 +130,14 @@
<Filter Include="Header Files\libvpx\vpx_util">
<UniqueIdentifier>{0f1488e1-b863-436b-a38e-233c1a2e23d6}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\libvpx\vpx\internal">
<UniqueIdentifier>{b0c7e733-ec6f-46fd-a3f9-aea2e4952d9f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="vpx_config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\vpx\internal\vpx_codec_internal.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx_mem\vpx_mem.h">
<Filter>Header Files\libvpx\vpx_mem</Filter>
</ClInclude>
@@ -708,6 +708,51 @@
<ClInclude Include="..\vpx_ports\static_assert.h">
<Filter>Header Files\libvpx\vpx_ports</Filter>
</ClInclude>
<ClInclude Include="..\vpx\internal\vpx_codec_internal.h">
<Filter>Header Files\libvpx\vpx\internal</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vp8.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vp8cx.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vp8dx.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vpx_codec.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vpx_decoder.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vpx_encoder.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vpx_frame_buffer.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vpx_image.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vpx_integer.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vpx_ext_ratectrl.h">
<Filter>Header Files\libvpx\vpx</Filter>
</ClInclude>
<ClInclude Include="..\vp9\encoder\vp9_ext_ratectrl.h">
<Filter>Header Files\libvpx\vp9\encoder</Filter>
</ClInclude>
<ClInclude Include="..\vp9\encoder\vp9_firstpass_stats.h">
<Filter>Header Files\libvpx\vp9\encoder</Filter>
</ClInclude>
<ClInclude Include="..\vp9\encoder\vp9_tpl_model.h">
<Filter>Header Files\libvpx\vp9\encoder</Filter>
</ClInclude>
<ClInclude Include="..\vpx\vpx_tpl.h">
<Filter>Source Files\libvpx\vpx</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\vpx\src\vpx_encoder.c">
@@ -1238,9 +1283,6 @@
<ClCompile Include="..\vp9\encoder\x86\vp9_dct_intrin_sse2.c">
<Filter>Source Files\libvpx\vp9\encoder\x86</Filter>
</ClCompile>
<ClCompile Include="..\vp9\encoder\x86\vp9_diamond_search_sad_avx.c">
<Filter>Source Files\libvpx\vp9\encoder\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\add_noise.c">
<Filter>Source Files\libvpx\vpx_dsp</Filter>
</ClCompile>
@@ -1379,6 +1421,48 @@
<ClCompile Include="..\vp9\vp9_iface_common.c">
<Filter>Source Files\libvpx\vp9</Filter>
</ClCompile>
<ClCompile Include="..\vp9\encoder\vp9_ext_ratectrl.c">
<Filter>Source Files\libvpx\vp9\encoder</Filter>
</ClCompile>
<ClCompile Include="..\vp9\encoder\x86\vp9_quantize_ssse3.c">
<Filter>Source Files\libvpx\vp9\encoder\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\subtract_avx2.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\highbd_quantize_intrin_avx2.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\quantize_avx2.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\highbd_sad4d_avx2.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\highbd_sad_avx2.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\avg_pred_avx2.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\inv_txfm_avx2.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx\src\vpx_tpl.c">
<Filter>Source Files\libvpx\vpx</Filter>
</ClCompile>
<ClCompile Include="..\vp9\encoder\vp9_tpl_model.c">
<Filter>Source Files\libvpx\vp9\encoder</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\sse.c">
<Filter>Source Files\libvpx\vpx_dsp</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\sse_sse4.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\sse_avx2.c">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="libvpx.def">
@@ -1434,9 +1518,6 @@
<YASM Include="..\vp9\common\x86\vp9_mfqe_sse2.asm">
<Filter>Source Files\libvpx\vp9\common\x86</Filter>
</YASM>
<YASM Include="..\vp9\encoder\x86\vp9_quantize_ssse3_x86_64.asm">
<Filter>Source Files\libvpx\vp9\encoder\x86</Filter>
</YASM>
<YASM Include="..\vpx_dsp\x86\vpx_subpixel_bilinear_sse2.asm">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</YASM>
@@ -1473,15 +1554,6 @@
<YASM Include="..\vpx_dsp\x86\sad_sse2.asm">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</YASM>
<YASM Include="..\vpx_dsp\x86\sad_sse3.asm">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</YASM>
<YASM Include="..\vpx_dsp\x86\sad_sse4.asm">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</YASM>
<YASM Include="..\vpx_dsp\x86\sad_ssse3.asm">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</YASM>
<YASM Include="..\vpx_dsp\x86\sad4d_sse2.asm">
<Filter>Source Files\libvpx\vpx_dsp\x86</Filter>
</YASM>
+515
View File
@@ -0,0 +1,515 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClInclude Include="..\vp8\common\alloccommon.h" />
<ClInclude Include="..\vp8\common\blockd.h" />
<ClInclude Include="..\vp8\common\entropy.h" />
<ClInclude Include="..\vp8\common\entropymode.h" />
<ClInclude Include="..\vp8\common\entropymv.h" />
<ClInclude Include="..\vp8\common\extend.h" />
<ClInclude Include="..\vp8\common\filter.h" />
<ClInclude Include="..\vp8\common\findnearmv.h" />
<ClInclude Include="..\vp8\common\header.h" />
<ClInclude Include="..\vp8\common\loopfilter.h" />
<ClInclude Include="..\vp8\common\modecont.h" />
<ClInclude Include="..\vp8\common\postproc.h" />
<ClInclude Include="..\vp8\common\quant_common.h" />
<ClInclude Include="..\vp8\common\reconinter.h" />
<ClInclude Include="..\vp8\common\reconintra.h" />
<ClInclude Include="..\vp8\common\reconintra4x4.h" />
<ClInclude Include="..\vp8\common\setupintrarecon.h" />
<ClInclude Include="..\vp8\common\swapyv12buffer.h" />
<ClInclude Include="..\vp8\common\treecoder.h" />
<ClInclude Include="..\vp8\common\vp8_skin_detection.h" />
<ClInclude Include="..\vp8\decoder\dboolhuff.h" />
<ClInclude Include="..\vp8\decoder\decodemv.h" />
<ClInclude Include="..\vp8\decoder\decoderthreading.h" />
<ClInclude Include="..\vp8\decoder\detokenize.h" />
<ClInclude Include="..\vp8\decoder\onyxd_int.h" />
<ClInclude Include="..\vp8\decoder\treereader.h" />
<ClInclude Include="..\vp8\encoder\bitstream.h" />
<ClInclude Include="..\vp8\encoder\block.h" />
<ClInclude Include="..\vp8\encoder\boolhuff.h" />
<ClInclude Include="..\vp8\encoder\dct_value_cost.h" />
<ClInclude Include="..\vp8\encoder\dct_value_tokens.h" />
<ClInclude Include="..\vp8\encoder\defaultcoefcounts.h" />
<ClInclude Include="..\vp8\encoder\denoising.h" />
<ClInclude Include="..\vp8\encoder\encodeframe.h" />
<ClInclude Include="..\vp8\encoder\encodeintra.h" />
<ClInclude Include="..\vp8\encoder\encodemb.h" />
<ClInclude Include="..\vp8\encoder\encodemv.h" />
<ClInclude Include="..\vp8\encoder\ethreading.h" />
<ClInclude Include="..\vp8\encoder\firstpass.h" />
<ClInclude Include="..\vp8\encoder\lookahead.h" />
<ClInclude Include="..\vp8\encoder\mcomp.h" />
<ClInclude Include="..\vp8\encoder\modecosts.h" />
<ClInclude Include="..\vp8\encoder\onyx_int.h" />
<ClInclude Include="..\vp8\encoder\pickinter.h" />
<ClInclude Include="..\vp8\encoder\picklpf.h" />
<ClInclude Include="..\vp8\encoder\quantize.h" />
<ClInclude Include="..\vp8\encoder\ratectrl.h" />
<ClInclude Include="..\vp8\encoder\rdopt.h" />
<ClInclude Include="..\vp8\encoder\segmentation.h" />
<ClInclude Include="..\vp8\encoder\temporal_filter.h" />
<ClInclude Include="..\vp8\encoder\tokenize.h" />
<ClInclude Include="..\vp8\encoder\treewriter.h" />
<ClInclude Include="..\vp9\common\vp9_alloccommon.h" />
<ClInclude Include="..\vp9\common\vp9_blockd.h" />
<ClInclude Include="..\vp9\common\vp9_common.h" />
<ClInclude Include="..\vp9\common\vp9_common_data.h" />
<ClInclude Include="..\vp9\common\vp9_entropy.h" />
<ClInclude Include="..\vp9\common\vp9_entropymode.h" />
<ClInclude Include="..\vp9\common\vp9_entropymv.h" />
<ClInclude Include="..\vp9\common\vp9_enums.h" />
<ClInclude Include="..\vp9\common\vp9_filter.h" />
<ClInclude Include="..\vp9\common\vp9_frame_buffers.h" />
<ClInclude Include="..\vp9\common\vp9_idct.h" />
<ClInclude Include="..\vp9\common\vp9_loopfilter.h" />
<ClInclude Include="..\vp9\common\vp9_mfqe.h" />
<ClInclude Include="..\vp9\common\vp9_mv.h" />
<ClInclude Include="..\vp9\common\vp9_mvref_common.h" />
<ClInclude Include="..\vp9\common\vp9_ppflags.h" />
<ClInclude Include="..\vp9\common\vp9_pred_common.h" />
<ClInclude Include="..\vp9\common\vp9_quant_common.h" />
<ClInclude Include="..\vp9\common\vp9_reconinter.h" />
<ClInclude Include="..\vp9\common\vp9_reconintra.h" />
<ClInclude Include="..\vp9\common\vp9_scale.h" />
<ClInclude Include="..\vp9\common\vp9_scan.h" />
<ClInclude Include="..\vp9\common\vp9_seg_common.h" />
<ClInclude Include="..\vp9\common\vp9_thread_common.h" />
<ClInclude Include="..\vp9\common\vp9_tile_common.h" />
<ClInclude Include="..\vp9\decoder\vp9_decodeframe.h" />
<ClInclude Include="..\vp9\decoder\vp9_decodemv.h" />
<ClInclude Include="..\vp9\decoder\vp9_decoder.h" />
<ClInclude Include="..\vp9\decoder\vp9_detokenize.h" />
<ClInclude Include="..\vp9\decoder\vp9_dsubexp.h" />
<ClInclude Include="..\vp9\decoder\vp9_job_queue.h" />
<ClInclude Include="..\vp9\encoder\vp9_alt_ref_aq.h" />
<ClInclude Include="..\vp9\encoder\vp9_aq_360.h" />
<ClInclude Include="..\vp9\encoder\vp9_aq_complexity.h" />
<ClInclude Include="..\vp9\encoder\vp9_aq_cyclicrefresh.h" />
<ClInclude Include="..\vp9\encoder\vp9_aq_variance.h" />
<ClInclude Include="..\vp9\encoder\vp9_bitstream.h" />
<ClInclude Include="..\vp9\encoder\vp9_block.h" />
<ClInclude Include="..\vp9\encoder\vp9_blockiness.h" />
<ClInclude Include="..\vp9\encoder\vp9_context_tree.h" />
<ClInclude Include="..\vp9\encoder\vp9_cost.h" />
<ClInclude Include="..\vp9\encoder\vp9_denoiser.h" />
<ClInclude Include="..\vp9\encoder\vp9_encodeframe.h" />
<ClInclude Include="..\vp9\encoder\vp9_encodemb.h" />
<ClInclude Include="..\vp9\encoder\vp9_encodemv.h" />
<ClInclude Include="..\vp9\encoder\vp9_encoder.h" />
<ClInclude Include="..\vp9\encoder\vp9_ethread.h" />
<ClInclude Include="..\vp9\encoder\vp9_extend.h" />
<ClInclude Include="..\vp9\encoder\vp9_ext_ratectrl.h" />
<ClInclude Include="..\vp9\encoder\vp9_firstpass.h" />
<ClInclude Include="..\vp9\encoder\vp9_firstpass_stats.h" />
<ClInclude Include="..\vp9\encoder\vp9_job_queue.h" />
<ClInclude Include="..\vp9\encoder\vp9_lookahead.h" />
<ClInclude Include="..\vp9\encoder\vp9_mbgraph.h" />
<ClInclude Include="..\vp9\encoder\vp9_mcomp.h" />
<ClInclude Include="..\vp9\encoder\vp9_multi_thread.h" />
<ClInclude Include="..\vp9\encoder\vp9_noise_estimate.h" />
<ClInclude Include="..\vp9\encoder\vp9_partition_models.h" />
<ClInclude Include="..\vp9\encoder\vp9_picklpf.h" />
<ClInclude Include="..\vp9\encoder\vp9_pickmode.h" />
<ClInclude Include="..\vp9\encoder\vp9_quantize.h" />
<ClInclude Include="..\vp9\encoder\vp9_ratectrl.h" />
<ClInclude Include="..\vp9\encoder\vp9_rd.h" />
<ClInclude Include="..\vp9\encoder\vp9_rdopt.h" />
<ClInclude Include="..\vp9\encoder\vp9_resize.h" />
<ClInclude Include="..\vp9\encoder\vp9_segmentation.h" />
<ClInclude Include="..\vp9\encoder\vp9_skin_detection.h" />
<ClInclude Include="..\vp9\encoder\vp9_speed_features.h" />
<ClInclude Include="..\vp9\encoder\vp9_subexp.h" />
<ClInclude Include="..\vp9\encoder\vp9_svc_layercontext.h" />
<ClInclude Include="..\vp9\encoder\vp9_temporal_filter.h" />
<ClInclude Include="..\vp9\encoder\vp9_tokenize.h" />
<ClInclude Include="..\vp9\encoder\vp9_tpl_model.h" />
<ClInclude Include="..\vp9\encoder\vp9_treewriter.h" />
<ClInclude Include="..\vp9\vp9_dx_iface.h" />
<ClInclude Include="..\vp9\vp9_iface_common.h" />
<ClInclude Include="..\vpx\vp8.h" />
<ClInclude Include="..\vpx\vp8cx.h" />
<ClInclude Include="..\vpx\vp8dx.h" />
<ClInclude Include="..\vpx\vpx_codec.h" />
<ClInclude Include="..\vpx\vpx_decoder.h" />
<ClInclude Include="..\vpx\vpx_encoder.h" />
<ClInclude Include="..\vpx\vpx_ext_ratectrl.h" />
<ClInclude Include="..\vpx\vpx_frame_buffer.h" />
<ClInclude Include="..\vpx\vpx_image.h" />
<ClInclude Include="..\vpx\vpx_integer.h" />
<ClInclude Include="..\vpx\vpx_tpl.h" />
<ClInclude Include="..\vpx\internal\vpx_codec_internal.h" />
<ClInclude Include="..\vpx_dsp\bitreader.h" />
<ClInclude Include="..\vpx_dsp\bitreader_buffer.h" />
<ClInclude Include="..\vpx_dsp\bitwriter.h" />
<ClInclude Include="..\vpx_dsp\bitwriter_buffer.h" />
<ClInclude Include="..\vpx_dsp\fwd_txfm.h" />
<ClInclude Include="..\vpx_dsp\inv_txfm.h" />
<ClInclude Include="..\vpx_dsp\postproc.h" />
<ClInclude Include="..\vpx_dsp\prob.h" />
<ClInclude Include="..\vpx_dsp\psnr.h" />
<ClInclude Include="..\vpx_dsp\quantize.h" />
<ClInclude Include="..\vpx_dsp\skin_detection.h" />
<ClInclude Include="..\vpx_dsp\txfm_common.h" />
<ClInclude Include="..\vpx_dsp\variance.h" />
<ClInclude Include="..\vpx_dsp\vpx_convolve.h" />
<ClInclude Include="..\vpx_dsp\vpx_dsp_common.h" />
<ClInclude Include="..\vpx_dsp\vpx_filter.h" />
<ClInclude Include="..\vpx_dsp\x86\bitdepth_conversion_avx2.h" />
<ClInclude Include="..\vpx_dsp\x86\bitdepth_conversion_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\convolve.h" />
<ClInclude Include="..\vpx_dsp\x86\convolve_avx2.h" />
<ClInclude Include="..\vpx_dsp\x86\convolve_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\convolve_ssse3.h" />
<ClInclude Include="..\vpx_dsp\x86\fwd_dct32x32_impl_avx2.h" />
<ClInclude Include="..\vpx_dsp\x86\fwd_dct32x32_impl_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\fwd_txfm_impl_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\fwd_txfm_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\highbd_inv_txfm_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\highbd_inv_txfm_sse4.h" />
<ClInclude Include="..\vpx_dsp\x86\inv_txfm_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\inv_txfm_ssse3.h" />
<ClInclude Include="..\vpx_dsp\x86\mem_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\quantize_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\quantize_ssse3.h" />
<ClInclude Include="..\vpx_dsp\x86\transpose_sse2.h" />
<ClInclude Include="..\vpx_dsp\x86\txfm_common_sse2.h" />
<ClInclude Include="..\vpx_mem\include\vpx_mem_intrnl.h" />
<ClInclude Include="..\vpx_mem\vpx_mem.h" />
<ClInclude Include="..\vpx_ports\bitops.h" />
<ClInclude Include="..\vpx_ports\compiler_attributes.h" />
<ClInclude Include="..\vpx_ports\emmintrin_compat.h" />
<ClInclude Include="..\vpx_ports\mem.h" />
<ClInclude Include="..\vpx_ports\mem_ops.h" />
<ClInclude Include="..\vpx_ports\mem_ops_aligned.h" />
<ClInclude Include="..\vpx_ports\static_assert.h" />
<ClInclude Include="..\vpx_ports\system_state.h" />
<ClInclude Include="..\vpx_ports\vpx_once.h" />
<ClInclude Include="..\vpx_ports\vpx_timer.h" />
<ClInclude Include="..\vpx_ports\x86.h" />
<ClInclude Include="..\vpx_scale\vpx_scale.h" />
<ClInclude Include="..\vpx_scale\yv12config.h" />
<ClInclude Include="..\vpx_util\endian_inl.h" />
<ClInclude Include="..\vpx_util\vpx_atomics.h" />
<ClInclude Include="..\vpx_util\vpx_thread.h" />
<ClInclude Include="..\vpx_util\vpx_timestamp.h" />
<ClInclude Include="..\vpx_util\vpx_write_yuv_frame.h" />
<ClInclude Include="vpx_config.h" />
<ClInclude Include="vpx_version.h" />
<ClInclude Include="x86\vp8_rtcd.h" />
<ClInclude Include="x86\vp9_rtcd.h" />
<ClInclude Include="x86\vpx_dsp_rtcd.h" />
<ClInclude Include="x86\vpx_scale_rtcd.h" />
<ClInclude Include="x86_64\vp8_rtcd.h" />
<ClInclude Include="x86_64\vp9_rtcd.h" />
<ClInclude Include="x86_64\vpx_dsp_rtcd.h" />
<ClInclude Include="x86_64\vpx_scale_rtcd.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\vp8\common\alloccommon.c" />
<ClCompile Include="..\vp8\common\blockd.c" />
<ClCompile Include="..\vp8\common\debugmodes.c" />
<ClCompile Include="..\vp8\common\dequantize.c" />
<ClCompile Include="..\vp8\common\entropy.c" />
<ClCompile Include="..\vp8\common\entropymode.c" />
<ClCompile Include="..\vp8\common\entropymv.c" />
<ClCompile Include="..\vp8\common\extend.c" />
<ClCompile Include="..\vp8\common\filter.c" />
<ClCompile Include="..\vp8\common\findnearmv.c" />
<ClCompile Include="..\vp8\common\generic\systemdependent.c" />
<ClCompile Include="..\vp8\common\idctllm.c" />
<ClCompile Include="..\vp8\common\idct_blk.c" />
<ClCompile Include="..\vp8\common\loopfilter_filters.c" />
<ClCompile Include="..\vp8\common\mbpitch.c" />
<ClCompile Include="..\vp8\common\mfqe.c" />
<ClCompile Include="..\vp8\common\modecont.c" />
<ClCompile Include="..\vp8\common\postproc.c" />
<ClCompile Include="..\vp8\common\quant_common.c" />
<ClCompile Include="..\vp8\common\reconinter.c" />
<ClCompile Include="..\vp8\common\reconintra.c" />
<ClCompile Include="..\vp8\common\reconintra4x4.c" />
<ClCompile Include="..\vp8\common\rtcd.c" />
<ClCompile Include="..\vp8\common\setupintrarecon.c" />
<ClCompile Include="..\vp8\common\swapyv12buffer.c" />
<ClCompile Include="..\vp8\common\treecoder.c" />
<ClCompile Include="..\vp8\common\vp8_loopfilter.c" />
<ClCompile Include="..\vp8\common\vp8_skin_detection.c" />
<ClCompile Include="..\vp8\common\x86\bilinear_filter_sse2.c" />
<ClCompile Include="..\vp8\common\x86\idct_blk_mmx.c" />
<ClCompile Include="..\vp8\common\x86\idct_blk_sse2.c" />
<ClCompile Include="..\vp8\common\x86\loopfilter_x86.c" />
<ClCompile Include="..\vp8\common\x86\vp8_asm_stubs.c" />
<ClCompile Include="..\vp8\decoder\dboolhuff.c" />
<ClCompile Include="..\vp8\decoder\decodeframe.c" />
<ClCompile Include="..\vp8\decoder\decodemv.c" />
<ClCompile Include="..\vp8\decoder\detokenize.c" />
<ClCompile Include="..\vp8\decoder\onyxd_if.c" />
<ClCompile Include="..\vp8\decoder\threading.c" />
<ClCompile Include="..\vp8\encoder\bitstream.c" />
<ClCompile Include="..\vp8\encoder\boolhuff.c" />
<ClCompile Include="..\vp8\encoder\copy_c.c" />
<ClCompile Include="..\vp8\encoder\dct.c" />
<ClCompile Include="..\vp8\encoder\denoising.c" />
<ClCompile Include="..\vp8\encoder\encodeframe.c" />
<ClCompile Include="..\vp8\encoder\encodeintra.c" />
<ClCompile Include="..\vp8\encoder\encodemb.c" />
<ClCompile Include="..\vp8\encoder\encodemv.c" />
<ClCompile Include="..\vp8\encoder\ethreading.c" />
<ClCompile Include="..\vp8\encoder\firstpass.c" />
<ClCompile Include="..\vp8\encoder\lookahead.c" />
<ClCompile Include="..\vp8\encoder\mcomp.c" />
<ClCompile Include="..\vp8\encoder\modecosts.c" />
<ClCompile Include="..\vp8\encoder\onyx_if.c" />
<ClCompile Include="..\vp8\encoder\pickinter.c" />
<ClCompile Include="..\vp8\encoder\picklpf.c" />
<ClCompile Include="..\vp8\encoder\ratectrl.c" />
<ClCompile Include="..\vp8\encoder\rdopt.c" />
<ClCompile Include="..\vp8\encoder\segmentation.c" />
<ClCompile Include="..\vp8\encoder\temporal_filter.c" />
<ClCompile Include="..\vp8\encoder\tokenize.c" />
<ClCompile Include="..\vp8\encoder\treewriter.c" />
<ClCompile Include="..\vp8\encoder\vp8_quantize.c" />
<ClCompile Include="..\vp8\encoder\x86\denoising_sse2.c" />
<ClCompile Include="..\vp8\encoder\x86\quantize_sse4.c" />
<ClCompile Include="..\vp8\encoder\x86\vp8_enc_stubs_sse2.c" />
<ClCompile Include="..\vp8\encoder\x86\vp8_quantize_sse2.c" />
<ClCompile Include="..\vp8\encoder\x86\vp8_quantize_ssse3.c" />
<ClCompile Include="..\vp8\vp8_cx_iface.c" />
<ClCompile Include="..\vp8\vp8_dx_iface.c" />
<ClCompile Include="..\vp9\common\vp9_alloccommon.c" />
<ClCompile Include="..\vp9\common\vp9_blockd.c" />
<ClCompile Include="..\vp9\common\vp9_common_data.c" />
<ClCompile Include="..\vp9\common\vp9_debugmodes.c" />
<ClCompile Include="..\vp9\common\vp9_entropy.c" />
<ClCompile Include="..\vp9\common\vp9_entropymode.c" />
<ClCompile Include="..\vp9\common\vp9_entropymv.c" />
<ClCompile Include="..\vp9\common\vp9_filter.c" />
<ClCompile Include="..\vp9\common\vp9_frame_buffers.c" />
<ClCompile Include="..\vp9\common\vp9_idct.c" />
<ClCompile Include="..\vp9\common\vp9_loopfilter.c" />
<ClCompile Include="..\vp9\common\vp9_mvref_common.c" />
<ClCompile Include="..\vp9\common\vp9_pred_common.c" />
<ClCompile Include="..\vp9\common\vp9_quant_common.c" />
<ClCompile Include="..\vp9\common\vp9_reconinter.c" />
<ClCompile Include="..\vp9\common\vp9_reconintra.c" />
<ClCompile Include="..\vp9\common\vp9_rtcd.c" />
<ClCompile Include="..\vp9\common\vp9_scale.c" />
<ClCompile Include="..\vp9\common\vp9_scan.c" />
<ClCompile Include="..\vp9\common\vp9_seg_common.c" />
<ClCompile Include="..\vp9\common\vp9_thread_common.c" />
<ClCompile Include="..\vp9\common\vp9_tile_common.c" />
<ClCompile Include="..\vp9\common\x86\vp9_highbd_iht16x16_add_sse4.c" />
<ClCompile Include="..\vp9\common\x86\vp9_highbd_iht4x4_add_sse4.c" />
<ClCompile Include="..\vp9\common\x86\vp9_highbd_iht8x8_add_sse4.c" />
<ClCompile Include="..\vp9\common\x86\vp9_idct_intrin_sse2.c" />
<ClCompile Include="..\vp9\decoder\vp9_decodeframe.c" />
<ClCompile Include="..\vp9\decoder\vp9_decodemv.c" />
<ClCompile Include="..\vp9\decoder\vp9_decoder.c" />
<ClCompile Include="..\vp9\decoder\vp9_detokenize.c" />
<ClCompile Include="..\vp9\decoder\vp9_dsubexp.c" />
<ClCompile Include="..\vp9\decoder\vp9_job_queue.c" />
<ClCompile Include="..\vp9\encoder\vp9_alt_ref_aq.c" />
<ClCompile Include="..\vp9\encoder\vp9_aq_360.c" />
<ClCompile Include="..\vp9\encoder\vp9_aq_complexity.c" />
<ClCompile Include="..\vp9\encoder\vp9_aq_cyclicrefresh.c" />
<ClCompile Include="..\vp9\encoder\vp9_aq_variance.c" />
<ClCompile Include="..\vp9\encoder\vp9_bitstream.c" />
<ClCompile Include="..\vp9\encoder\vp9_blockiness.c" />
<ClCompile Include="..\vp9\encoder\vp9_context_tree.c" />
<ClCompile Include="..\vp9\encoder\vp9_cost.c" />
<ClCompile Include="..\vp9\encoder\vp9_dct.c" />
<ClCompile Include="..\vp9\encoder\vp9_encodeframe.c" />
<ClCompile Include="..\vp9\encoder\vp9_encodemb.c" />
<ClCompile Include="..\vp9\encoder\vp9_encodemv.c" />
<ClCompile Include="..\vp9\encoder\vp9_encoder.c" />
<ClCompile Include="..\vp9\encoder\vp9_ethread.c" />
<ClCompile Include="..\vp9\encoder\vp9_ext_ratectrl.c" />
<ClCompile Include="..\vp9\encoder\vp9_extend.c" />
<ClCompile Include="..\vp9\encoder\vp9_firstpass.c" />
<ClCompile Include="..\vp9\encoder\vp9_frame_scale.c" />
<ClCompile Include="..\vp9\encoder\vp9_lookahead.c" />
<ClCompile Include="..\vp9\encoder\vp9_mbgraph.c" />
<ClCompile Include="..\vp9\encoder\vp9_mcomp.c" />
<ClCompile Include="..\vp9\encoder\vp9_multi_thread.c" />
<ClCompile Include="..\vp9\encoder\vp9_noise_estimate.c" />
<ClCompile Include="..\vp9\encoder\vp9_picklpf.c" />
<ClCompile Include="..\vp9\encoder\vp9_pickmode.c" />
<ClCompile Include="..\vp9\encoder\vp9_quantize.c" />
<ClCompile Include="..\vp9\encoder\vp9_ratectrl.c" />
<ClCompile Include="..\vp9\encoder\vp9_rd.c" />
<ClCompile Include="..\vp9\encoder\vp9_rdopt.c" />
<ClCompile Include="..\vp9\encoder\vp9_resize.c" />
<ClCompile Include="..\vp9\encoder\vp9_segmentation.c" />
<ClCompile Include="..\vp9\encoder\vp9_skin_detection.c" />
<ClCompile Include="..\vp9\encoder\vp9_speed_features.c" />
<ClCompile Include="..\vp9\encoder\vp9_subexp.c" />
<ClCompile Include="..\vp9\encoder\vp9_svc_layercontext.c" />
<ClCompile Include="..\vp9\encoder\vp9_temporal_filter.c" />
<ClCompile Include="..\vp9\encoder\vp9_tokenize.c" />
<ClCompile Include="..\vp9\encoder\vp9_tpl_model.c" />
<ClCompile Include="..\vp9\encoder\vp9_treewriter.c" />
<ClCompile Include="..\vp9\encoder\x86\highbd_temporal_filter_sse4.c" />
<ClCompile Include="..\vp9\encoder\x86\temporal_filter_sse4.c" />
<ClCompile Include="..\vp9\encoder\x86\vp9_dct_intrin_sse2.c" />
<ClCompile Include="..\vp9\encoder\x86\vp9_error_avx2.c" />
<ClCompile Include="..\vp9\encoder\x86\vp9_frame_scale_ssse3.c" />
<ClCompile Include="..\vp9\encoder\x86\vp9_highbd_block_error_intrin_sse2.c" />
<ClCompile Include="..\vp9\encoder\x86\vp9_quantize_avx2.c" />
<ClCompile Include="..\vp9\encoder\x86\vp9_quantize_sse2.c" />
<ClCompile Include="..\vp9\encoder\x86\vp9_quantize_ssse3.c" />
<ClCompile Include="..\vp9\vp9_cx_iface.c" />
<ClCompile Include="..\vp9\vp9_dx_iface.c" />
<ClCompile Include="..\vp9\vp9_iface_common.c" />
<ClCompile Include="..\vpx\src\vpx_codec.c" />
<ClCompile Include="..\vpx\src\vpx_decoder.c" />
<ClCompile Include="..\vpx\src\vpx_encoder.c" />
<ClCompile Include="..\vpx\src\vpx_image.c" />
<ClCompile Include="..\vpx_dsp\add_noise.c" />
<ClCompile Include="..\vpx_dsp\avg.c" />
<ClCompile Include="..\vpx_dsp\bitreader.c" />
<ClCompile Include="..\vpx_dsp\bitreader_buffer.c" />
<ClCompile Include="..\vpx_dsp\bitwriter.c" />
<ClCompile Include="..\vpx_dsp\bitwriter_buffer.c" />
<ClCompile Include="..\vpx_dsp\deblock.c" />
<ClCompile Include="..\vpx_dsp\fwd_txfm.c" />
<ClCompile Include="..\vpx_dsp\intrapred.c" />
<ClCompile Include="..\vpx_dsp\inv_txfm.c" />
<ClCompile Include="..\vpx_dsp\loopfilter.c" />
<ClCompile Include="..\vpx_dsp\prob.c" />
<ClCompile Include="..\vpx_dsp\psnr.c" />
<ClCompile Include="..\vpx_dsp\quantize.c" />
<ClCompile Include="..\vpx_dsp\sad.c" />
<ClCompile Include="..\vpx_dsp\sse.c" />
<ClCompile Include="..\vpx_dsp\skin_detection.c" />
<ClCompile Include="..\vpx_dsp\subtract.c" />
<ClCompile Include="..\vpx_dsp\sum_squares.c" />
<ClCompile Include="..\vpx_dsp\variance.c" />
<ClCompile Include="..\vpx_dsp\vpx_convolve.c" />
<ClCompile Include="..\vpx_dsp\vpx_dsp_rtcd.c" />
<ClCompile Include="..\vpx_dsp\x86\avg_intrin_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\avg_intrin_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\avg_pred_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\avg_pred_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\fwd_txfm_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\fwd_txfm_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_convolve_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_idct16x16_add_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_idct16x16_add_sse4.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_idct32x32_add_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_idct32x32_add_sse4.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_idct4x4_add_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_idct4x4_add_sse4.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_idct8x8_add_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_idct8x8_add_sse4.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_intrapred_intrin_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_intrapred_intrin_ssse3.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_loopfilter_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_sad4d_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_sad_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_quantize_intrin_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_quantize_intrin_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\highbd_variance_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\inv_txfm_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\inv_txfm_ssse3.c" />
<ClCompile Include="..\vpx_dsp\x86\inv_txfm_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\loopfilter_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\loopfilter_sse2.c">
<ObjectFileName>$(IntDir)\vpx_%(Filename).obj</ObjectFileName>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\post_proc_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\quantize_avx.c" />
<ClCompile Include="..\vpx_dsp\x86\quantize_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\quantize_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\quantize_ssse3.c" />
<ClCompile Include="..\vpx_dsp\x86\sad4d_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\sad4d_avx512.c">
<ExcludedFromBuild Condition="'$(VisualStudioVersion)' == '14.0'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(VisualStudioVersion)' == '12.0'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\vpx_dsp\x86\sad_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\sse_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\sse_sse4.c" />
<ClCompile Include="..\vpx_dsp\x86\subtract_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\sum_squares_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\variance_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\variance_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\vpx_subpixel_4t_intrin_sse2.c" />
<ClCompile Include="..\vpx_dsp\x86\vpx_subpixel_8t_intrin_avx2.c" />
<ClCompile Include="..\vpx_dsp\x86\vpx_subpixel_8t_intrin_ssse3.c" />
<ClCompile Include="..\vpx_mem\vpx_mem.c" />
<ClCompile Include="..\vpx_scale\generic\gen_scalers.c" />
<ClCompile Include="..\vpx_scale\generic\vpx_scale.c" />
<ClCompile Include="..\vpx_scale\generic\yv12config.c" />
<ClCompile Include="..\vpx_scale\generic\yv12extend.c" />
<ClCompile Include="..\vpx_scale\vpx_scale_rtcd.c" />
<ClCompile Include="..\vpx_util\vpx_thread.c" />
<ClCompile Include="..\vpx_util\vpx_write_yuv_frame.c" />
<ClCompile Include="dce_defs.c" />
<ClCompile Include="vpx_config.c">
<ObjectFileName>$(IntDir)\vpx_config_.obj</ObjectFileName>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="libvpx.def" />
</ItemGroup>
<ItemGroup>
<YASM Include="..\vp8\common\x86\dequantize_mmx.asm" />
<YASM Include="..\vp8\common\x86\idctllm_mmx.asm" />
<YASM Include="..\vp8\common\x86\idctllm_sse2.asm" />
<YASM Include="..\vp8\common\x86\iwalsh_sse2.asm" />
<YASM Include="..\vp8\common\x86\loopfilter_block_sse2_x86_64.asm">
<ExcludedFromBuild Condition="'$(Platform)'=='Win32'">true</ExcludedFromBuild>
</YASM>
<YASM Include="..\vp8\common\x86\loopfilter_sse2.asm" />
<YASM Include="..\vp8\common\x86\mfqe_sse2.asm" />
<YASM Include="..\vp8\common\x86\recon_mmx.asm" />
<YASM Include="..\vp8\common\x86\recon_sse2.asm" />
<YASM Include="..\vp8\common\x86\subpixel_mmx.asm" />
<YASM Include="..\vp8\common\x86\subpixel_sse2.asm" />
<YASM Include="..\vp8\common\x86\subpixel_ssse3.asm" />
<YASM Include="..\vp8\encoder\x86\block_error_sse2.asm" />
<YASM Include="..\vp8\encoder\x86\copy_sse2.asm" />
<YASM Include="..\vp8\encoder\x86\copy_sse3.asm" />
<YASM Include="..\vp8\encoder\x86\dct_sse2.asm" />
<YASM Include="..\vp8\encoder\x86\fwalsh_sse2.asm" />
<YASM Include="..\vp8\encoder\x86\temporal_filter_apply_sse2.asm" />
<YASM Include="..\vp9\common\x86\vp9_mfqe_sse2.asm" />
<YASM Include="..\vp9\encoder\x86\vp9_dct_sse2.asm" />
<YASM Include="..\vp9\encoder\x86\vp9_error_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\add_noise_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\avg_ssse3_x86_64.asm">
<ExcludedFromBuild Condition="'$(Platform)'=='Win32'">true</ExcludedFromBuild>
</YASM>
<YASM Include="..\vpx_dsp\x86\bitdepth_conversion_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\deblock_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\fwd_txfm_ssse3_x86_64.asm">
<ExcludedFromBuild Condition="'$(Platform)'=='Win32'">true</ExcludedFromBuild>
</YASM>
<YASM Include="..\vpx_dsp\x86\highbd_intrapred_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\highbd_sad4d_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\highbd_sad_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\highbd_subpel_variance_impl_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\highbd_variance_impl_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\intrapred_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\intrapred_ssse3.asm" />
<YASM Include="..\vpx_dsp\x86\inv_wht_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\sad4d_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\sad_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\ssim_opt_x86_64.asm">
<ExcludedFromBuild Condition="'$(Platform)'=='Win32'">true</ExcludedFromBuild>
</YASM>
<YASM Include="..\vpx_dsp\x86\subpel_variance_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\subtract_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\vpx_convolve_copy_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\vpx_high_subpixel_8t_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\vpx_high_subpixel_bilinear_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\vpx_subpixel_8t_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\vpx_subpixel_8t_ssse3.asm" />
<YASM Include="..\vpx_dsp\x86\vpx_subpixel_bilinear_sse2.asm" />
<YASM Include="..\vpx_dsp\x86\vpx_subpixel_bilinear_ssse3.asm" />
<YASM Include="..\vpx_ports\emms_mmx.asm" />
<YASM Include="..\vpx_ports\float_control_word.asm" />
</ItemGroup>
</Project>
+513
View File
@@ -0,0 +1,513 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{A293418A-603A-4119-B7B4-1E6204606BA9}</ProjectGuid>
<RootNamespace>vpx</RootNamespace>
</PropertyGroup>
<ImportGroup Label="PropertySheets">
<Import Project="smp_winrt.props" />
<Import Project="libvpx_files.props" />
</ImportGroup>
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\yasm.props" />
</ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugWinRT|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\;..\;.\x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4752;4703;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Lib>
<AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
</Lib>
<PostBuildEvent>
<Command>mkdir "$(OutDir)"\include
mkdir "$(OutDir)"\include\vpx
copy ..\vpx\*.h "$(OutDir)"\include\vpx
mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\libvpx.txt</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>if exist ..\vpx_config.h (
del ..\vpx_config.h
)
if exist ..\vpx_config.c (
del ..\vpx_config.c
)
if exist ..\vpx_config.asm (
del ..\vpx_config.asm
)
if exist ..\vpx_version.h (
del ..\vpx_version.h
)
if exist ..\vpx_scale_rtcd.h (
del ..\vpx_scale_rtcd.h
)
if exist ..\vpx_dsp_rtcd.h (
del ..\vpx_dsp_rtcd.h
)
if exist ..\vp8_rtcd.h (
del ..\vp8_rtcd.h
)
if exist ..\vp9_rtcd.h (
del ..\vp9_rtcd.h
)
if exist "$(OutDir)"\include\vpx (
rd /s /q "$(OutDir)"\include\vpx
cd ../
cd $(ProjectDir)
)</Command>
</PreBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir);$(ProjectDir)\..\;%(IncludePaths)</IncludePaths>
</YASM>
<CustomBuildStep>
<Message>Custom Clean Step</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>force_clean</Outputs>
<Command>if exist "$(OutDir)"\include\vpx (
rmdir /s /q "$(OutDir)"\include\vpx
)
if exist $(OutDir)\licenses\libvpx.txt (
del /f /q $(OutDir)\licenses\libvpx.txt
)</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugWinRT|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\;..\;.\x86_64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4752;4703;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Lib>
<AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
</Lib>
<PostBuildEvent>
<Command>mkdir "$(OutDir)"\include
mkdir "$(OutDir)"\include\vpx
copy ..\vpx\*.h "$(OutDir)"\include\vpx
mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\libvpx.txt</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>if exist ..\vpx_config.h (
del ..\vpx_config.h
)
if exist ..\vpx_config.c (
del ..\vpx_config.c
)
if exist ..\vpx_config.asm (
del ..\vpx_config.asm
)
if exist ..\vpx_version.h (
del ..\vpx_version.h
)
if exist ..\vpx_scale_rtcd.h (
del ..\vpx_scale_rtcd.h
)
if exist ..\vpx_dsp_rtcd.h (
del ..\vpx_dsp_rtcd.h
)
if exist ..\vp8_rtcd.h (
del ..\vp8_rtcd.h
)
if exist ..\vp9_rtcd.h (
del ..\vp9_rtcd.h
)
if exist "$(OutDir)"\include\vpx (
rd /s /q "$(OutDir)"\include\vpx
cd ../
cd $(ProjectDir)
)</Command>
</PreBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir);$(ProjectDir)\..\;%(IncludePaths)</IncludePaths>
</YASM>
<CustomBuildStep>
<Message>Custom Clean Step</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>force_clean</Outputs>
<Command>if exist "$(OutDir)"\include\vpx (
rmdir /s /q "$(OutDir)"\include\vpx
)
if exist $(OutDir)\licenses\libvpx.txt (
del /f /q $(OutDir)\licenses\libvpx.txt
)</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLLWinRT|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\;..\;.\x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4752;4703;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<ModuleDefinitionFile>.\libvpx.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>mkdir "$(OutDir)"\include
mkdir "$(OutDir)"\include\vpx
copy ..\vpx\*.h "$(OutDir)"\include\vpx
mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\libvpx.txt</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>if exist ..\vpx_config.h (
del ..\vpx_config.h
)
if exist ..\vpx_config.c (
del ..\vpx_config.c
)
if exist ..\vpx_config.asm (
del ..\vpx_config.asm
)
if exist ..\vpx_version.h (
del ..\vpx_version.h
)
if exist ..\vpx_scale_rtcd.h (
del ..\vpx_scale_rtcd.h
)
if exist ..\vpx_dsp_rtcd.h (
del ..\vpx_dsp_rtcd.h
)
if exist ..\vp8_rtcd.h (
del ..\vp8_rtcd.h
)
if exist ..\vp9_rtcd.h (
del ..\vp9_rtcd.h
)
if exist "$(OutDir)"\include\vpx (
rd /s /q "$(OutDir)"\include\vpx
cd ../
cd $(ProjectDir)
)</Command>
</PreBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir);$(ProjectDir)\..\;%(IncludePaths)</IncludePaths>
</YASM>
<CustomBuildStep>
<Message>Custom Clean Step</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>force_clean</Outputs>
<Command>if exist "$(OutDir)"\include\vpx (
rmdir /s /q "$(OutDir)"\include\vpx
)
if exist $(OutDir)\licenses\libvpx.txt (
del /f /q $(OutDir)\licenses\libvpx.txt
)</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLLWinRT|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\;..\;.\x86_64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4752;4703;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<ModuleDefinitionFile>.\libvpx.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>mkdir "$(OutDir)"\include
mkdir "$(OutDir)"\include\vpx
copy ..\vpx\*.h "$(OutDir)"\include\vpx
mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\libvpx.txt</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>if exist ..\vpx_config.h (
del ..\vpx_config.h
)
if exist ..\vpx_config.c (
del ..\vpx_config.c
)
if exist ..\vpx_config.asm (
del ..\vpx_config.asm
)
if exist ..\vpx_version.h (
del ..\vpx_version.h
)
if exist ..\vpx_scale_rtcd.h (
del ..\vpx_scale_rtcd.h
)
if exist ..\vpx_dsp_rtcd.h (
del ..\vpx_dsp_rtcd.h
)
if exist ..\vp8_rtcd.h (
del ..\vp8_rtcd.h
)
if exist ..\vp9_rtcd.h (
del ..\vp9_rtcd.h
)
if exist "$(OutDir)"\include\vpx (
rd /s /q "$(OutDir)"\include\vpx
cd ../
cd $(ProjectDir)
)</Command>
</PreBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir);$(ProjectDir)\..\;%(IncludePaths)</IncludePaths>
</YASM>
<CustomBuildStep>
<Message>Custom Clean Step</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>force_clean</Outputs>
<Command>if exist "$(OutDir)"\include\vpx (
rmdir /s /q "$(OutDir)"\include\vpx
)
if exist $(OutDir)\licenses\libvpx.txt (
del /f /q $(OutDir)\licenses\libvpx.txt
)</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWinRT|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\;..\;.\x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4752;4703;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Lib>
<AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
</Lib>
<PostBuildEvent>
<Command>mkdir "$(OutDir)"\include
mkdir "$(OutDir)"\include\vpx
copy ..\vpx\*.h "$(OutDir)"\include\vpx
mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\libvpx.txt</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>if exist ..\vpx_config.h (
del ..\vpx_config.h
)
if exist ..\vpx_config.c (
del ..\vpx_config.c
)
if exist ..\vpx_config.asm (
del ..\vpx_config.asm
)
if exist ..\vpx_version.h (
del ..\vpx_version.h
)
if exist ..\vpx_scale_rtcd.h (
del ..\vpx_scale_rtcd.h
)
if exist ..\vpx_dsp_rtcd.h (
del ..\vpx_dsp_rtcd.h
)
if exist ..\vp8_rtcd.h (
del ..\vp8_rtcd.h
)
if exist ..\vp9_rtcd.h (
del ..\vp9_rtcd.h
)
if exist "$(OutDir)"\include\vpx (
rd /s /q "$(OutDir)"\include\vpx
cd ../
cd $(ProjectDir)
)</Command>
</PreBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir);$(ProjectDir)\..\;%(IncludePaths)</IncludePaths>
</YASM>
<CustomBuildStep>
<Message>Custom Clean Step</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>force_clean</Outputs>
<Command>if exist "$(OutDir)"\include\vpx (
rmdir /s /q "$(OutDir)"\include\vpx
)
if exist $(OutDir)\licenses\libvpx.txt (
del /f /q $(OutDir)\licenses\libvpx.txt
)</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWinRT|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\;..\;.\x86_64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4752;4703;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Lib>
<AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
</Lib>
<PostBuildEvent>
<Command>mkdir "$(OutDir)"\include
mkdir "$(OutDir)"\include\vpx
copy ..\vpx\*.h "$(OutDir)"\include\vpx
mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\libvpx.txt</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>if exist ..\vpx_config.h (
del ..\vpx_config.h
)
if exist ..\vpx_config.c (
del ..\vpx_config.c
)
if exist ..\vpx_config.asm (
del ..\vpx_config.asm
)
if exist ..\vpx_version.h (
del ..\vpx_version.h
)
if exist ..\vpx_scale_rtcd.h (
del ..\vpx_scale_rtcd.h
)
if exist ..\vpx_dsp_rtcd.h (
del ..\vpx_dsp_rtcd.h
)
if exist ..\vp8_rtcd.h (
del ..\vp8_rtcd.h
)
if exist ..\vp9_rtcd.h (
del ..\vp9_rtcd.h
)
if exist "$(OutDir)"\include\vpx (
rd /s /q "$(OutDir)"\include\vpx
cd ../
cd $(ProjectDir)
)</Command>
</PreBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir);$(ProjectDir)\..\;%(IncludePaths)</IncludePaths>
</YASM>
<CustomBuildStep>
<Message>Custom Clean Step</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>force_clean</Outputs>
<Command>if exist "$(OutDir)"\include\vpx (
rmdir /s /q "$(OutDir)"\include\vpx
)
if exist $(OutDir)\licenses\libvpx.txt (
del /f /q $(OutDir)\licenses\libvpx.txt
)</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLLWinRT|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\;..\;.\x86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4752;4703;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<ModuleDefinitionFile>.\libvpx.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>mkdir "$(OutDir)"\include
mkdir "$(OutDir)"\include\vpx
copy ..\vpx\*.h "$(OutDir)"\include\vpx
mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\libvpx.txt</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>if exist ..\vpx_config.h (
del ..\vpx_config.h
)
if exist ..\vpx_config.c (
del ..\vpx_config.c
)
if exist ..\vpx_config.asm (
del ..\vpx_config.asm
)
if exist ..\vpx_version.h (
del ..\vpx_version.h
)
if exist ..\vpx_scale_rtcd.h (
del ..\vpx_scale_rtcd.h
)
if exist ..\vpx_dsp_rtcd.h (
del ..\vpx_dsp_rtcd.h
)
if exist ..\vp8_rtcd.h (
del ..\vp8_rtcd.h
)
if exist ..\vp9_rtcd.h (
del ..\vp9_rtcd.h
)
if exist "$(OutDir)"\include\vpx (
rd /s /q "$(OutDir)"\include\vpx
cd ../
cd $(ProjectDir)
)</Command>
</PreBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir);$(ProjectDir)\..\;%(IncludePaths)</IncludePaths>
</YASM>
<CustomBuildStep>
<Message>Custom Clean Step</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>force_clean</Outputs>
<Command>if exist "$(OutDir)"\include\vpx (
rmdir /s /q "$(OutDir)"\include\vpx
)
if exist $(OutDir)\licenses\libvpx.txt (
del /f /q $(OutDir)\licenses\libvpx.txt
)</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLLWinRT|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\;..\;.\x86_64;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4752;4703;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<ModuleDefinitionFile>.\libvpx.def</ModuleDefinitionFile>
</Link>
<PostBuildEvent>
<Command>mkdir "$(OutDir)"\include
mkdir "$(OutDir)"\include\vpx
copy ..\vpx\*.h "$(OutDir)"\include\vpx
mkdir $(OutDir)\licenses
copy ..\LICENSE $(OutDir)\licenses\libvpx.txt</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>if exist ..\vpx_config.h (
del ..\vpx_config.h
)
if exist ..\vpx_config.c (
del ..\vpx_config.c
)
if exist ..\vpx_config.asm (
del ..\vpx_config.asm
)
if exist ..\vpx_version.h (
del ..\vpx_version.h
)
if exist ..\vpx_scale_rtcd.h (
del ..\vpx_scale_rtcd.h
)
if exist ..\vpx_dsp_rtcd.h (
del ..\vpx_dsp_rtcd.h
)
if exist ..\vp8_rtcd.h (
del ..\vp8_rtcd.h
)
if exist ..\vp9_rtcd.h (
del ..\vp9_rtcd.h
)
if exist "$(OutDir)"\include\vpx (
rd /s /q "$(OutDir)"\include\vpx
cd ../
cd $(ProjectDir)
)</Command>
</PreBuildEvent>
<YASM>
<IncludePaths>$(ProjectDir);$(ProjectDir)\..\;%(IncludePaths)</IncludePaths>
</YASM>
<CustomBuildStep>
<Message>Custom Clean Step</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>force_clean</Outputs>
<Command>if exist "$(OutDir)"\include\vpx (
rmdir /s /q "$(OutDir)"\include\vpx
)
if exist $(OutDir)\licenses\libvpx.txt (
del /f /q $(OutDir)\licenses\libvpx.txt
)</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\yasm.targets" />
</ImportGroup>
</Project>
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -18,7 +18,7 @@ When using the WinRT/UWP project configurations the projects will automatically
the default application target for the Version of Visual Studio being used:
VS 2013: 8.1
VS 2015: 8.1
VS 2017: 10.0.10240.0
VS 2017+: 10.0.10240.0
*** Building with YASM ***
+350
View File
@@ -0,0 +1,350 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugDLL|Win32">
<Configuration>DebugDLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugDLL|x64">
<Configuration>DebugDLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDLL|Win32">
<Configuration>ReleaseDLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDLL|x64">
<Configuration>ReleaseDLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' != ''">$(WindowsTargetPlatformVersion)</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)'&gt;= '16.0'">10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>lib$(RootNamespace)d</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>lib$(RootNamespace)d</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">
<TargetName>$(RootNamespace)d</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
<TargetName>$(RootNamespace)d</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>lib$(RootNamespace)</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>lib$(RootNamespace)</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
<TargetName>$(RootNamespace)</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
<TargetName>$(RootNamespace)</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_WINDOWS;WIN32;_WIN32_WINNT=0x0601;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDataBaseFileName>
<MinimalRebuild>false</MinimalRebuild>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)\lib\x86\$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX86</TargetMachine>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_WINDOWS;WIN32;_WIN32_WINNT=0x0601;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDataBaseFileName>
<MinimalRebuild>false</MinimalRebuild>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)\lib\x64\$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_WINDOWS;WIN32;_WIN32_WINNT=0x0601;_DEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>true</BufferSecurityCheck>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<MinimalRebuild>false</MinimalRebuild>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<OutputFile>$(OutDir)\bin\x86\$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)\lib\x86\$(TargetName).lib</ImportLibrary>
<ProfileGuidedDatabase>$(IntDir)\$(TargetName).pgd</ProfileGuidedDatabase>
<LargeAddressAware>true</LargeAddressAware>
<AdditionalLibraryDirectories>$(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion>6.1</MinimumRequiredVersion>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_WINDOWS;WIN32;_WIN32_WINNT=0x0601;_DEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<MinimalRebuild>false</MinimalRebuild>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<OutputFile>$(OutDir)\bin\x64\$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)\lib\x64\$(TargetName).lib</ImportLibrary>
<ProfileGuidedDatabase>$(IntDir)\$(TargetName).pgd</ProfileGuidedDatabase>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion>6.1</MinimumRequiredVersion>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<PreprocessorDefinitions>_WINDOWS;WIN32;_WIN32_WINNT=0x0601;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<InterproceduralOptimization>SingleFile</InterproceduralOptimization>
<ProgramDataBaseFileName>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDataBaseFileName>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)\lib\x86\$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX86</TargetMachine>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<PreprocessorDefinitions>_WINDOWS;WIN32;_WIN32_WINNT=0x0601;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<InterproceduralOptimization>SingleFile</InterproceduralOptimization>
<ProgramDataBaseFileName>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDataBaseFileName>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)\lib\x64\$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<PreprocessorDefinitions>_WINDOWS;WIN32;_WIN32_WINNT=0x0601;NDEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\bin\x86\$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)\lib\x86\$(TargetName).lib</ImportLibrary>
<ProfileGuidedDatabase>$(IntDir)\$(TargetName).pgd</ProfileGuidedDatabase>
<LargeAddressAware>true</LargeAddressAware>
<AdditionalLibraryDirectories>$(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion>6.1</MinimumRequiredVersion>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLL|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<PreprocessorDefinitions>_WINDOWS;WIN32;_WIN32_WINNT=0x0601;NDEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\bin\x64\$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)\lib\x64\$(TargetName).lib</ImportLibrary>
<ProfileGuidedDatabase>$(IntDir)\$(TargetName).pgd</ProfileGuidedDatabase>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion>6.1</MinimumRequiredVersion>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ItemGroup />
</Project>
+392
View File
@@ -0,0 +1,392 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugDLLWinRT|Win32">
<Configuration>DebugDLLWinRT</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugDLLWinRT|x64">
<Configuration>DebugDLLWinRT</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugWinRT|Win32">
<Configuration>DebugWinRT</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugWinRT|x64">
<Configuration>DebugWinRT</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDLLWinRT|Win32">
<Configuration>ReleaseDLLWinRT</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseDLLWinRT|x64">
<Configuration>ReleaseDLLWinRT</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseWinRT|Win32">
<Configuration>ReleaseWinRT</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseWinRT|x64">
<Configuration>ReleaseWinRT</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' != ''">$(WindowsTargetPlatformVersion)</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)'&gt;= '16.0'">10.0</WindowsTargetPlatformVersion>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '12.0'">v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<DefaultLanguage>en-US</DefaultLanguage>
<WindowsAppContainer>true</WindowsAppContainer>
<AppContainerApplication>true</AppContainerApplication>
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision Condition="'$(VisualStudioVersion)' == '17.0'">10.0</ApplicationTypeRevision>
<ApplicationTypeRevision Condition="'$(VisualStudioVersion)' == '16.0'">10.0</ApplicationTypeRevision>
<ApplicationTypeRevision Condition="'$(VisualStudioVersion)' == '15.0'">10.0</ApplicationTypeRevision>
<ApplicationTypeRevision Condition="'$(VisualStudioVersion)' == '14.0'">8.1</ApplicationTypeRevision>
<ApplicationTypeRevision Condition="'$(VisualStudioVersion)' == '12.0'">8.1</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition="'$(ApplicationTypeRevision)|$(WindowsTargetPlatformVersion)' == '10.0|'">10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion Condition="'$(ApplicationTypeRevision)' == '10.0'">10.0.10240.0</WindowsTargetPlatformMinVersion>
<TargetPlatformMinVersion Condition="'$(ApplicationTypeRevision)' == '10.0'">10.0.10240.0</TargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugWinRT|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugWinRT|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLLWinRT|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLLWinRT|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWinRT|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWinRT|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLLWinRT|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLLWinRT|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugWinRT|Win32'">
<TargetName>lib$(RootNamespace)d_winrt</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugWinRT|x64'">
<TargetName>lib$(RootNamespace)d_winrt</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLLWinRT|Win32'">
<TargetName>$(RootNamespace)d_winrt</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLLWinRT|x64'">
<TargetName>$(RootNamespace)d_winrt</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWinRT|Win32'">
<TargetName>lib$(RootNamespace)_winrt</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWinRT|x64'">
<TargetName>lib$(RootNamespace)_winrt</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLLWinRT|Win32'">
<TargetName>$(RootNamespace)_winrt</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLLWinRT|x64'">
<TargetName>$(RootNamespace)_winrt</TargetName>
<OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
<GeneratedFilesDir>$(ProjectDir)obj\Generated</GeneratedFilesDir>
<CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugWinRT|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDataBaseFileName>
<MinimalRebuild>false</MinimalRebuild>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)\lib\x86\$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX86</TargetMachine>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugWinRT|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDataBaseFileName>
<MinimalRebuild>false</MinimalRebuild>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)\lib\x64\$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLLWinRT|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>true</BufferSecurityCheck>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<MinimalRebuild>false</MinimalRebuild>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<OutputFile>$(OutDir)\bin\x86\$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)\lib\x86\$(TargetName).lib</ImportLibrary>
<ProfileGuidedDatabase>$(IntDir)\$(TargetName).pgd</ProfileGuidedDatabase>
<LargeAddressAware>true</LargeAddressAware>
<AdditionalLibraryDirectories>$(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion Condition="'$(ApplicationTypeRevision)' == '10.0'">10.0</MinimumRequiredVersion>
<MinimumRequiredVersion Condition="'$(ApplicationTypeRevision)' == '8.1'">8.1</MinimumRequiredVersion>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<WindowsMetadataFile>$(OutDir)\lib\x86\$(RootNamespace).winmd</WindowsMetadataFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLLWinRT|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<MinimalRebuild>false</MinimalRebuild>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<OutputFile>$(OutDir)\bin\x64\$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)\lib\x64\$(TargetName).lib</ImportLibrary>
<ProfileGuidedDatabase>$(IntDir)\$(TargetName).pgd</ProfileGuidedDatabase>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion Condition="'$(ApplicationTypeRevision)' == '10.0'">10.0</MinimumRequiredVersion>
<MinimumRequiredVersion Condition="'$(ApplicationTypeRevision)' == '8.1'">8.1</MinimumRequiredVersion>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<WindowsMetadataFile>$(OutDir)\lib\x64\$(RootNamespace).winmd</WindowsMetadataFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWinRT|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<InterproceduralOptimization>SingleFile</InterproceduralOptimization>
<ProgramDataBaseFileName>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDataBaseFileName>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)\lib\x86\$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX86</TargetMachine>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWinRT|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<InterproceduralOptimization>SingleFile</InterproceduralOptimization>
<ProgramDataBaseFileName>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)\lib\x64\$(TargetName)$(TargetExt)</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLLWinRT|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\bin\x86\$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)\lib\x86\$(TargetName).lib</ImportLibrary>
<ProfileGuidedDatabase>$(IntDir)\$(TargetName).pgd</ProfileGuidedDatabase>
<LargeAddressAware>true</LargeAddressAware>
<AdditionalLibraryDirectories>$(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion Condition="'$(ApplicationTypeRevision)' == '10.0'">10.0</MinimumRequiredVersion>
<MinimumRequiredVersion Condition="'$(ApplicationTypeRevision)' == '8.1'">8.1</MinimumRequiredVersion>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<WindowsMetadataFile>$(OutDir)\lib\x86\$(RootNamespace).winmd</WindowsMetadataFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseDLLWinRT|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<OmitFramePointers>true</OmitFramePointers>
<StringPooling>true</StringPooling>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<TreatSpecificWarningsAsErrors>4113;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\bin\x64\$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)\lib\x64\$(TargetName).lib</ImportLibrary>
<ProfileGuidedDatabase>$(IntDir)\$(TargetName).pgd</ProfileGuidedDatabase>
<AdditionalLibraryDirectories>$(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<MinimumRequiredVersion Condition="'$(ApplicationTypeRevision)' == '10.0'">10.0</MinimumRequiredVersion>
<MinimumRequiredVersion Condition="'$(ApplicationTypeRevision)' == '8.1'">8.1</MinimumRequiredVersion>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<WindowsMetadataFile>$(OutDir)\lib\x64\$(RootNamespace).winmd</WindowsMetadataFile>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ItemGroup />
</Project>
+11 -3
View File
@@ -1,4 +1,5 @@
VPX_ARCH_ARM equ 0
VPX_ARCH_AARCH64 equ 0
VPX_ARCH_MIPS equ 0
%ifidn __OUTPUT_FORMAT__,win64
VPX_ARCH_X86 equ 0
@@ -11,8 +12,13 @@ VPX_ARCH_X86 equ 1
VPX_ARCH_X86_64 equ 0
%endif
VPX_ARCH_PPC equ 0
HAVE_NEON equ 0
VPX_ARCH_LOONGARCH equ 0
HAVE_NEON_ASM equ 0
HAVE_NEON equ 0
HAVE_NEON_DOTPROD equ 0
HAVE_NEON_I8MM equ 0
HAVE_SVE equ 0
HAVE_SVE2 equ 0
HAVE_MIPS32 equ 0
HAVE_DSPR2 equ 0
HAVE_MSA equ 0
@@ -28,6 +34,8 @@ HAVE_AVX2 equ 1
HAVE_AVX512 equ 1
HAVE_VSX equ 0
HAVE_MMI equ 0
HAVE_LSX equ 0
HAVE_LASX equ 0
HAVE_VPX_PORTS equ 1
HAVE_PTHREAD_H equ 0
HAVE_UNISTD_H equ 0
@@ -43,7 +51,7 @@ CONFIG_GCOV equ 0
CONFIG_RVCT equ 0
CONFIG_GCC equ 0
CONFIG_MSVS equ 1
CONFIG_PIC equ 0
CONFIG_PIC equ 1
CONFIG_BIG_ENDIAN equ 0
CONFIG_CODEC_SRCS equ 0
CONFIG_DEBUG_LIBS equ 0
@@ -80,7 +88,6 @@ CONFIG_ENCODE_PERF_TESTS equ 0
CONFIG_MULTI_RES_ENCODING equ 0
CONFIG_TEMPORAL_DENOISING equ 1
CONFIG_VP9_TEMPORAL_DENOISING equ 0
CONFIG_CONSISTENT_RECODE equ 0
CONFIG_COEFFICIENT_RANGE_CHECKING equ 0
CONFIG_VP9_HIGHBITDEPTH equ 1
CONFIG_BETTER_HW_COMPATIBILITY equ 0
@@ -93,3 +100,4 @@ CONFIG_FP_MB_STATS equ 0
CONFIG_EMULATE_HARDWARE equ 0
CONFIG_NON_GREEDY_MV equ 0
CONFIG_RATE_CTRL equ 0
CONFIG_COLLECT_COMPONENT_TIMING equ 0
+11 -3
View File
@@ -11,6 +11,7 @@
#define RESTRICT
#define INLINE __inline
#define VPX_ARCH_ARM 0
#define VPX_ARCH_AARCH64 0
#define VPX_ARCH_MIPS 0
#if defined(__x86_64) || defined(_M_X64)
#define VPX_ARCH_X86 0
@@ -20,8 +21,13 @@
#define VPX_ARCH_X86_64 0
#endif
#define VPX_ARCH_PPC 0
#define HAVE_NEON 0
#define VPX_ARCH_LOONGARCH 0
#define HAVE_NEON_ASM 0
#define HAVE_NEON 0
#define HAVE_NEON_DOTPROD 0
#define HAVE_NEON_I8MM 0
#define HAVE_SVE 0
#define HAVE_SVE2 0
#define HAVE_MIPS32 0
#define HAVE_DSPR2 0
#define HAVE_MSA 0
@@ -41,6 +47,8 @@
#endif
#define HAVE_VSX 0
#define HAVE_MMI 0
#define HAVE_LSX 0
#define HAVE_LASX 0
#define HAVE_VPX_PORTS 1
#define HAVE_PTHREAD_H 0
#define HAVE_UNISTD_H 0
@@ -56,7 +64,7 @@
#define CONFIG_RVCT 0
#define CONFIG_GCC 0
#define CONFIG_MSVS 1
#define CONFIG_PIC 0
#define CONFIG_PIC 1
#define CONFIG_BIG_ENDIAN 0
#define CONFIG_CODEC_SRCS 0
#define CONFIG_DEBUG_LIBS 0
@@ -102,7 +110,6 @@
#define CONFIG_MULTI_RES_ENCODING 0
#define CONFIG_TEMPORAL_DENOISING 1
#define CONFIG_VP9_TEMPORAL_DENOISING 0
#define CONFIG_CONSISTENT_RECODE 0
#define CONFIG_COEFFICIENT_RANGE_CHECKING 0
#define CONFIG_VP9_HIGHBITDEPTH 1
#define CONFIG_BETTER_HW_COMPATIBILITY 0
@@ -115,4 +122,5 @@
#define CONFIG_EMULATE_HARDWARE 0
#define CONFIG_NON_GREEDY_MV 0
#define CONFIG_RATE_CTRL 0
#define CONFIG_COLLECT_COMPONENT_TIMING 0
#endif /* VPX_CONFIG_H */
+7 -4
View File
@@ -1,8 +1,11 @@
// This file is generated. Do not edit.
#ifndef VPX_VERSION_H_
#define VPX_VERSION_H_
#define VERSION_MAJOR 1
#define VERSION_MINOR 9
#define VERSION_PATCH 0
#define VERSION_MINOR 15
#define VERSION_PATCH 1
#define VERSION_EXTRA ""
#define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH))
#define VERSION_STRING_NOSP "v1.9.0"
#define VERSION_STRING " v1.9.0"
#define VERSION_STRING_NOSP "v1.15.1"
#define VERSION_STRING " v1.15.1"
#endif // VPX_VERSION_H_
+11 -18
View File
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2025 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This file is generated. Do not edit.
#ifndef VP8_RTCD_H_
#define VP8_RTCD_H_
@@ -45,15 +55,6 @@ void vp8_bilinear_predict8x8_sse2(unsigned char *src_ptr, int src_pixels_per_lin
void vp8_bilinear_predict8x8_ssse3(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch);
RTCD_EXTERN void (*vp8_bilinear_predict8x8)(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch);
void vp8_blend_b_c(unsigned char *y, unsigned char *u, unsigned char *v, int y_1, int u_1, int v_1, int alpha, int stride);
#define vp8_blend_b vp8_blend_b_c
void vp8_blend_mb_inner_c(unsigned char *y, unsigned char *u, unsigned char *v, int y_1, int u_1, int v_1, int alpha, int stride);
#define vp8_blend_mb_inner vp8_blend_mb_inner_c
void vp8_blend_mb_outer_c(unsigned char *y, unsigned char *u, unsigned char *v, int y_1, int u_1, int v_1, int alpha, int stride);
#define vp8_blend_mb_outer vp8_blend_mb_outer_c
int vp8_block_error_c(short *coeff, short *dqcoeff);
int vp8_block_error_sse2(short *coeff, short *dqcoeff);
RTCD_EXTERN int (*vp8_block_error)(short *coeff, short *dqcoeff);
@@ -123,11 +124,6 @@ void vp8_filter_by_weight8x8_c(unsigned char *src, int src_stride, unsigned char
void vp8_filter_by_weight8x8_sse2(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight);
RTCD_EXTERN void (*vp8_filter_by_weight8x8)(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight);
int vp8_full_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
int vp8_full_search_sadx3(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
int vp8_full_search_sadx8(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
RTCD_EXTERN int (*vp8_full_search_sad)(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, struct loop_filter_info *lfi);
void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, struct loop_filter_info *lfi);
RTCD_EXTERN void (*vp8_loop_filter_bh)(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, struct loop_filter_info *lfi);
@@ -278,9 +274,6 @@ static void setup_rtcd_internal(void)
if (flags & HAS_SSE2) vp8_filter_by_weight16x16 = vp8_filter_by_weight16x16_sse2;
vp8_filter_by_weight8x8 = vp8_filter_by_weight8x8_c;
if (flags & HAS_SSE2) vp8_filter_by_weight8x8 = vp8_filter_by_weight8x8_sse2;
vp8_full_search_sad = vp8_full_search_sad_c;
if (flags & HAS_SSE3) vp8_full_search_sad = vp8_full_search_sadx3;
if (flags & HAS_SSE4_1) vp8_full_search_sad = vp8_full_search_sadx8;
vp8_loop_filter_bh = vp8_loop_filter_bh_c;
if (flags & HAS_SSE2) vp8_loop_filter_bh = vp8_loop_filter_bh_sse2;
vp8_loop_filter_bv = vp8_loop_filter_bv_c;
@@ -337,4 +330,4 @@ static void setup_rtcd_internal(void)
} // extern "C"
#endif
#endif
#endif // VP8_RTCD_H_
+39 -17
View File
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2025 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This file is generated. Do not edit.
#ifndef VP9_RTCD_H_
#define VP9_RTCD_H_
@@ -21,7 +31,9 @@ struct macroblockd;
/* Encoder forward decls */
struct macroblock;
struct vp9_variance_vtable;
struct macroblock_plane;
struct vp9_sad_table;
struct ScanOrder;
struct search_site_config;
struct mv;
union int_mv;
@@ -45,9 +57,8 @@ int64_t vp9_block_error_fp_sse2(const tran_low_t *coeff, const tran_low_t *dqcoe
int64_t vp9_block_error_fp_avx2(const tran_low_t *coeff, const tran_low_t *dqcoeff, int block_size);
RTCD_EXTERN int64_t (*vp9_block_error_fp)(const tran_low_t *coeff, const tran_low_t *dqcoeff, int block_size);
int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv);
int vp9_diamond_search_sad_avx(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv);
RTCD_EXTERN int (*vp9_diamond_search_sad)(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv);
int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, uint32_t start_mv_sad, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_sad_table *sad_fn_ptr, const struct mv *center_mv);
#define vp9_diamond_search_sad vp9_diamond_search_sad_c
void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type);
void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, int tx_type);
@@ -97,11 +108,13 @@ void vp9_highbd_iht8x8_64_add_c(const tran_low_t *input, uint16_t *dest, int str
void vp9_highbd_iht8x8_64_add_sse4_1(const tran_low_t *input, uint16_t *dest, int stride, int tx_type, int bd);
RTCD_EXTERN void (*vp9_highbd_iht8x8_64_add)(const tran_low_t *input, uint16_t *dest, int stride, int tx_type, int bd);
void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
#define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c
void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_highbd_quantize_fp_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
RTCD_EXTERN void (*vp9_highbd_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
#define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c
void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_highbd_quantize_fp_32x32_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
RTCD_EXTERN void (*vp9_highbd_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_highbd_temporal_filter_apply_c(const uint8_t *frame1, unsigned int stride, const uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int *blk_fw, int use_32x32, uint32_t *accumulator, uint16_t *count);
#define vp9_highbd_temporal_filter_apply vp9_highbd_temporal_filter_apply_c
@@ -118,13 +131,16 @@ void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int
void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, int tx_type);
RTCD_EXTERN void (*vp9_iht8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride, int tx_type);
void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
#define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c
void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_32x32_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst, INTERP_FILTER filter_type, int phase_scaler);
void vp9_scale_and_extend_frame_ssse3(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst, INTERP_FILTER filter_type, int phase_scaler);
@@ -148,8 +164,6 @@ static void setup_rtcd_internal(void)
vp9_block_error_fp = vp9_block_error_fp_c;
if (flags & HAS_SSE2) vp9_block_error_fp = vp9_block_error_fp_sse2;
if (flags & HAS_AVX2) vp9_block_error_fp = vp9_block_error_fp_avx2;
vp9_diamond_search_sad = vp9_diamond_search_sad_c;
if (flags & HAS_AVX) vp9_diamond_search_sad = vp9_diamond_search_sad_avx;
vp9_fht16x16 = vp9_fht16x16_c;
if (flags & HAS_SSE2) vp9_fht16x16 = vp9_fht16x16_sse2;
vp9_fht4x4 = vp9_fht4x4_c;
@@ -168,6 +182,10 @@ static void setup_rtcd_internal(void)
if (flags & HAS_SSE4_1) vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_sse4_1;
vp9_highbd_iht8x8_64_add = vp9_highbd_iht8x8_64_add_c;
if (flags & HAS_SSE4_1) vp9_highbd_iht8x8_64_add = vp9_highbd_iht8x8_64_add_sse4_1;
vp9_highbd_quantize_fp = vp9_highbd_quantize_fp_c;
if (flags & HAS_AVX2) vp9_highbd_quantize_fp = vp9_highbd_quantize_fp_avx2;
vp9_highbd_quantize_fp_32x32 = vp9_highbd_quantize_fp_32x32_c;
if (flags & HAS_AVX2) vp9_highbd_quantize_fp_32x32 = vp9_highbd_quantize_fp_32x32_avx2;
vp9_iht16x16_256_add = vp9_iht16x16_256_add_c;
if (flags & HAS_SSE2) vp9_iht16x16_256_add = vp9_iht16x16_256_add_sse2;
vp9_iht4x4_16_add = vp9_iht4x4_16_add_c;
@@ -176,7 +194,11 @@ static void setup_rtcd_internal(void)
if (flags & HAS_SSE2) vp9_iht8x8_64_add = vp9_iht8x8_64_add_sse2;
vp9_quantize_fp = vp9_quantize_fp_c;
if (flags & HAS_SSE2) vp9_quantize_fp = vp9_quantize_fp_sse2;
if (flags & HAS_SSSE3) vp9_quantize_fp = vp9_quantize_fp_ssse3;
if (flags & HAS_AVX2) vp9_quantize_fp = vp9_quantize_fp_avx2;
vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_c;
if (flags & HAS_SSSE3) vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_ssse3;
if (flags & HAS_AVX2) vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_avx2;
vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_c;
if (flags & HAS_SSSE3) vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_ssse3;
}
@@ -186,4 +208,4 @@ static void setup_rtcd_internal(void)
} // extern "C"
#endif
#endif
#endif // VP9_RTCD_H_
+545 -170
View File
File diff suppressed because it is too large Load Diff
+11 -1
View File
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2025 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This file is generated. Do not edit.
#ifndef VPX_SCALE_RTCD_H_
#define VPX_SCALE_RTCD_H_
@@ -70,4 +80,4 @@ static void setup_rtcd_internal(void)
} // extern "C"
#endif
#endif
#endif // VPX_SCALE_RTCD_H_
+11 -18
View File
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2025 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This file is generated. Do not edit.
#ifndef VP8_RTCD_H_
#define VP8_RTCD_H_
@@ -45,15 +55,6 @@ void vp8_bilinear_predict8x8_sse2(unsigned char *src_ptr, int src_pixels_per_lin
void vp8_bilinear_predict8x8_ssse3(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch);
RTCD_EXTERN void (*vp8_bilinear_predict8x8)(unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch);
void vp8_blend_b_c(unsigned char *y, unsigned char *u, unsigned char *v, int y_1, int u_1, int v_1, int alpha, int stride);
#define vp8_blend_b vp8_blend_b_c
void vp8_blend_mb_inner_c(unsigned char *y, unsigned char *u, unsigned char *v, int y_1, int u_1, int v_1, int alpha, int stride);
#define vp8_blend_mb_inner vp8_blend_mb_inner_c
void vp8_blend_mb_outer_c(unsigned char *y, unsigned char *u, unsigned char *v, int y_1, int u_1, int v_1, int alpha, int stride);
#define vp8_blend_mb_outer vp8_blend_mb_outer_c
int vp8_block_error_c(short *coeff, short *dqcoeff);
int vp8_block_error_sse2(short *coeff, short *dqcoeff);
#define vp8_block_error vp8_block_error_sse2
@@ -123,11 +124,6 @@ void vp8_filter_by_weight8x8_c(unsigned char *src, int src_stride, unsigned char
void vp8_filter_by_weight8x8_sse2(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight);
#define vp8_filter_by_weight8x8 vp8_filter_by_weight8x8_sse2
int vp8_full_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
int vp8_full_search_sadx3(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
int vp8_full_search_sadx8(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
RTCD_EXTERN int (*vp8_full_search_sad)(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, struct loop_filter_info *lfi);
void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, struct loop_filter_info *lfi);
#define vp8_loop_filter_bh vp8_loop_filter_bh_sse2
@@ -242,9 +238,6 @@ static void setup_rtcd_internal(void)
if (flags & HAS_SSE3) vp8_copy32xn = vp8_copy32xn_sse3;
vp8_fast_quantize_b = vp8_fast_quantize_b_sse2;
if (flags & HAS_SSSE3) vp8_fast_quantize_b = vp8_fast_quantize_b_ssse3;
vp8_full_search_sad = vp8_full_search_sad_c;
if (flags & HAS_SSE3) vp8_full_search_sad = vp8_full_search_sadx3;
if (flags & HAS_SSE4_1) vp8_full_search_sad = vp8_full_search_sadx8;
vp8_regular_quantize_b = vp8_regular_quantize_b_sse2;
if (flags & HAS_SSE4_1) vp8_regular_quantize_b = vp8_regular_quantize_b_sse4_1;
vp8_sixtap_predict16x16 = vp8_sixtap_predict16x16_sse2;
@@ -262,4 +255,4 @@ static void setup_rtcd_internal(void)
} // extern "C"
#endif
#endif
#endif // VP8_RTCD_H_
+36 -19
View File
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2025 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This file is generated. Do not edit.
#ifndef VP9_RTCD_H_
#define VP9_RTCD_H_
@@ -21,7 +31,9 @@ struct macroblockd;
/* Encoder forward decls */
struct macroblock;
struct vp9_variance_vtable;
struct macroblock_plane;
struct vp9_sad_table;
struct ScanOrder;
struct search_site_config;
struct mv;
union int_mv;
@@ -45,9 +57,8 @@ int64_t vp9_block_error_fp_sse2(const tran_low_t *coeff, const tran_low_t *dqcoe
int64_t vp9_block_error_fp_avx2(const tran_low_t *coeff, const tran_low_t *dqcoeff, int block_size);
RTCD_EXTERN int64_t (*vp9_block_error_fp)(const tran_low_t *coeff, const tran_low_t *dqcoeff, int block_size);
int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv);
int vp9_diamond_search_sad_avx(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv);
RTCD_EXTERN int (*vp9_diamond_search_sad)(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv);
int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, uint32_t start_mv_sad, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_sad_table *sad_fn_ptr, const struct mv *center_mv);
#define vp9_diamond_search_sad vp9_diamond_search_sad_c
void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type);
void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, int tx_type);
@@ -97,11 +108,13 @@ void vp9_highbd_iht8x8_64_add_c(const tran_low_t *input, uint16_t *dest, int str
void vp9_highbd_iht8x8_64_add_sse4_1(const tran_low_t *input, uint16_t *dest, int stride, int tx_type, int bd);
RTCD_EXTERN void (*vp9_highbd_iht8x8_64_add)(const tran_low_t *input, uint16_t *dest, int stride, int tx_type, int bd);
void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
#define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c
void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_highbd_quantize_fp_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
RTCD_EXTERN void (*vp9_highbd_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
#define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c
void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_highbd_quantize_fp_32x32_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
RTCD_EXTERN void (*vp9_highbd_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_highbd_temporal_filter_apply_c(const uint8_t *frame1, unsigned int stride, const uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int *blk_fw, int use_32x32, uint32_t *accumulator, uint16_t *count);
#define vp9_highbd_temporal_filter_apply vp9_highbd_temporal_filter_apply_c
@@ -118,15 +131,16 @@ void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int
void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, int tx_type);
#define vp9_iht8x8_64_add vp9_iht8x8_64_add_sse2
void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan);
void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_quantize_fp_32x32_avx2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order);
void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst, INTERP_FILTER filter_type, int phase_scaler);
void vp9_scale_and_extend_frame_ssse3(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst, INTERP_FILTER filter_type, int phase_scaler);
@@ -148,8 +162,6 @@ static void setup_rtcd_internal(void)
if (flags & HAS_AVX2) vp9_block_error = vp9_block_error_avx2;
vp9_block_error_fp = vp9_block_error_fp_sse2;
if (flags & HAS_AVX2) vp9_block_error_fp = vp9_block_error_fp_avx2;
vp9_diamond_search_sad = vp9_diamond_search_sad_c;
if (flags & HAS_AVX) vp9_diamond_search_sad = vp9_diamond_search_sad_avx;
vp9_highbd_apply_temporal_filter = vp9_highbd_apply_temporal_filter_c;
if (flags & HAS_SSE4_1) vp9_highbd_apply_temporal_filter = vp9_highbd_apply_temporal_filter_sse4_1;
vp9_highbd_iht16x16_256_add = vp9_highbd_iht16x16_256_add_c;
@@ -158,11 +170,16 @@ static void setup_rtcd_internal(void)
if (flags & HAS_SSE4_1) vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_sse4_1;
vp9_highbd_iht8x8_64_add = vp9_highbd_iht8x8_64_add_c;
if (flags & HAS_SSE4_1) vp9_highbd_iht8x8_64_add = vp9_highbd_iht8x8_64_add_sse4_1;
vp9_highbd_quantize_fp = vp9_highbd_quantize_fp_c;
if (flags & HAS_AVX2) vp9_highbd_quantize_fp = vp9_highbd_quantize_fp_avx2;
vp9_highbd_quantize_fp_32x32 = vp9_highbd_quantize_fp_32x32_c;
if (flags & HAS_AVX2) vp9_highbd_quantize_fp_32x32 = vp9_highbd_quantize_fp_32x32_avx2;
vp9_quantize_fp = vp9_quantize_fp_sse2;
if (flags & HAS_SSSE3) vp9_quantize_fp = vp9_quantize_fp_ssse3;
if (flags & HAS_AVX2) vp9_quantize_fp = vp9_quantize_fp_avx2;
vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_c;
if (flags & HAS_SSSE3) vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_ssse3;
if (flags & HAS_AVX2) vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_avx2;
vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_c;
if (flags & HAS_SSSE3) vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_ssse3;
}
@@ -172,4 +189,4 @@ static void setup_rtcd_internal(void)
} // extern "C"
#endif
#endif
#endif // VP9_RTCD_H_
+523 -177
View File
File diff suppressed because it is too large Load Diff
+11 -1
View File
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2025 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This file is generated. Do not edit.
#ifndef VPX_SCALE_RTCD_H_
#define VPX_SCALE_RTCD_H_
@@ -70,4 +80,4 @@ static void setup_rtcd_internal(void)
} // extern "C"
#endif
#endif
#endif // VPX_SCALE_RTCD_H_
+6 -6
View File
@@ -8,16 +8,18 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "args.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/msvc.h"
#if defined(__GNUC__) && __GNUC__
extern void die(const char *fmt, ...) __attribute__((noreturn));
#if defined(__GNUC__)
__attribute__((noreturn)) extern void die(const char *fmt, ...);
#elif defined(_MSC_VER)
__declspec(noreturn) extern void die(const char *fmt, ...);
#else
extern void die(const char *fmt, ...);
#endif
@@ -81,6 +83,7 @@ const char *arg_next(struct arg *arg) {
char **argv_dup(int argc, const char **argv) {
char **new_argv = malloc((argc + 1) * sizeof(*argv));
if (!new_argv) return NULL;
memcpy(new_argv, argv, argc * sizeof(*argv));
new_argv[argc] = NULL;
@@ -132,7 +135,6 @@ unsigned int arg_parse_uint(const struct arg *arg) {
}
die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
return 0;
}
int arg_parse_int(const struct arg *arg) {
@@ -149,7 +151,6 @@ int arg_parse_int(const struct arg *arg) {
}
die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
return 0;
}
struct vpx_rational {
@@ -206,7 +207,6 @@ int arg_parse_enum(const struct arg *arg) {
if (!strcmp(arg->val, listptr->name)) return listptr->val;
die("Option %s: Invalid value '%s'\n", arg->name, arg->val);
return 0;
}
int arg_parse_enum_or_int(const struct arg *arg) {
+12 -7
View File
@@ -8,18 +8,16 @@
## be found in the AUTHORS file in the root of the source tree.
##
# Ignore this file during non-NDK builds.
ifdef NDK_ROOT
#
# This file is to be used for compiling libvpx for Android using the NDK.
# In an Android project place a libvpx checkout in the jni directory.
# Run the configure script from the jni directory. Base libvpx
# encoder/decoder configuration will look similar to:
# ./libvpx/configure --target=armv7-android-gcc --disable-examples \
# ./libvpx/configure --target=arm64-android-gcc --disable-examples \
# --enable-external-build
#
# When targeting Android, realtime-only is enabled by default. This can
# be overridden by adding the command line flag:
# --disable-realtime-only
#
# This will create .mk files that contain variables that contain the
# source files to compile.
#
@@ -36,11 +34,14 @@
# but the resulting library *must* be run on devices supporting all of the
# enabled extensions. They can be disabled individually with
# --disable-{sse2, sse3, ssse3, sse4_1, avx, avx2, avx512}
# --disable-neon[-asm]
# --disable-neon{, -asm, -neon-dotprod, -neon-i8mm}
# --disable-sve
# --disable-{dspr2, msa}
#
# Running ndk-build will build libvpx and include it in your project.
# Running ndk-build will build libvpx and include it in your project. Set
# APP_ABI to match the --target passed to configure:
# https://developer.android.com/ndk/guides/application_mk#app_abi.
#
CONFIG_DIR := $(LOCAL_PATH)/
@@ -166,6 +167,9 @@ LOCAL_CFLAGS += \
-I$(ASM_CNV_PATH)/libvpx
LOCAL_MODULE := libvpx
LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
LOCAL_LICENSE_CONDITIONS := notice
LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE $(LOCAL_PATH)/../../PATENTS
ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
LOCAL_STATIC_LIBRARIES := cpufeatures
@@ -209,3 +213,4 @@ endif
ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
$(call import-module,android/cpufeatures)
endif
endif # NDK_ROOT
+42 -8
View File
@@ -21,9 +21,9 @@ all: .DEFAULT
clean:: .DEFAULT
exampletest: .DEFAULT
install:: .DEFAULT
test:: .DEFAULT
test-no-data-check:: .DEFAULT
testdata:: .DEFAULT
test: .DEFAULT
test-no-data-check: .DEFAULT
testdata: .DEFAULT
utiltest: .DEFAULT
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
test_%: .DEFAULT ;
@@ -111,13 +111,13 @@ exampletest:
.PHONY: install
install::
.PHONY: test
test::
test:
.PHONY: testdata
testdata::
testdata:
.PHONY: utiltest
utiltest:
.PHONY: test-no-data-check exampletest-no-data-check utiltest-no-data-check
test-no-data-check::
test-no-data-check:
exampletest-no-data-check utiltest-no-data-check:
# Force to realign stack always on OS/2
@@ -143,10 +143,30 @@ $(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2
$(BUILD_PFX)%_avx512.c.d: CFLAGS += -mavx512f -mavx512cd -mavx512bw -mavx512dq -mavx512vl
$(BUILD_PFX)%_avx512.c.o: CFLAGS += -mavx512f -mavx512cd -mavx512bw -mavx512dq -mavx512vl
# AARCH64
$(BUILD_PFX)%_neon_dotprod.c.d: CFLAGS += -march=armv8.2-a+dotprod
$(BUILD_PFX)%_neon_dotprod.c.o: CFLAGS += -march=armv8.2-a+dotprod
$(BUILD_PFX)%_neon_i8mm.c.d: CFLAGS += -march=armv8.2-a+dotprod+i8mm
$(BUILD_PFX)%_neon_i8mm.c.o: CFLAGS += -march=armv8.2-a+dotprod+i8mm
$(BUILD_PFX)%_sve.c.d: CFLAGS += -march=armv8.2-a+dotprod+i8mm+sve
$(BUILD_PFX)%_sve.c.o: CFLAGS += -march=armv8.2-a+dotprod+i8mm+sve
$(BUILD_PFX)%_sve2.c.d: CFLAGS += -march=armv9-a+sve2
$(BUILD_PFX)%_sve2.c.o: CFLAGS += -march=armv9-a+sve2
# POWER
$(BUILD_PFX)%_vsx.c.d: CFLAGS += -maltivec -mvsx
$(BUILD_PFX)%_vsx.c.o: CFLAGS += -maltivec -mvsx
# MIPS
$(BUILD_PFX)%_msa.c.d: CFLAGS += -mmsa
$(BUILD_PFX)%_msa.c.o: CFLAGS += -mmsa
# LOONGARCH
$(BUILD_PFX)%_lsx.c.d: CFLAGS += -mlsx
$(BUILD_PFX)%_lsx.c.o: CFLAGS += -mlsx
$(BUILD_PFX)%_lasx.c.d: CFLAGS += -mlasx
$(BUILD_PFX)%_lasx.c.o: CFLAGS += -mlasx
$(BUILD_PFX)%.c.d: %.c
$(if $(quiet),@echo " [DEP] $@")
$(qexec)mkdir -p $(dir $@)
@@ -294,6 +314,19 @@ $(1):
$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
endef
# Don't use -Wl,-z,defs with Clang's sanitizers.
#
# Clang's AddressSanitizer documentation says "When linking shared libraries,
# the AddressSanitizer run-time is not linked, so -Wl,-z,defs may cause link
# errors (don't use it with AddressSanitizer)." See
# https://clang.llvm.org/docs/AddressSanitizer.html#usage.
NO_UNDEFINED := -Wl,-z,defs
ifeq ($(findstring clang,$(CC)),clang)
ifneq ($(filter -fsanitize=%,$(LDFLAGS)),)
NO_UNDEFINED :=
endif
endif
define so_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
@@ -303,7 +336,8 @@ define so_template
$(1):
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(LD) -shared $$(LDFLAGS) \
-Wl,--no-undefined -Wl,-soname,$$(SONAME) \
$(NO_UNDEFINED) \
-Wl,-soname,$$(SONAME) \
-Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
$$(filter %.o,$$^) $$(extralibs)
endef
@@ -455,6 +489,6 @@ INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins
all: $(BUILD_TARGETS)
install:: $(INSTALL_TARGETS)
dist: $(INSTALL_TARGETS)
test::
test:
.SUFFIXES: # Delete default suffix rules
+1 -1
View File
@@ -28,7 +28,7 @@ while (<STDIN>)
s/qsubaddx/qsax/i;
s/qaddsubx/qasx/i;
thumb::FixThumbInstructions($_, 1);
thumb::FixThumbInstructions($_);
s/ldrneb/ldrbne/i;
s/ldrneh/ldrhne/i;
+35 -116
View File
@@ -32,7 +32,7 @@ foreach my $arg (@ARGV) {
print "@ This file was created from a .asm file\n";
print "@ using the ads2gas.pl script.\n";
print "\t.syntax unified\n";
print ".syntax unified\n";
if ($thumb) {
print "\t.thumb\n";
}
@@ -42,39 +42,11 @@ if ($thumb) {
while (<STDIN>)
{
undef $comment;
undef $line;
$comment_char = ";";
$comment_sub = "@";
# Handle comments.
if (/$comment_char/)
{
$comment = "";
($line, $comment) = /(.*?)$comment_char(.*)/;
$_ = $line;
}
# Load and store alignment
s/@/,:/g;
# Hexadecimal constants prefaced by 0x
s/#&/#0x/g;
# Convert :OR: to |
s/:OR:/ | /g;
# Convert :AND: to &
s/:AND:/ & /g;
# Convert :NOT: to ~
s/:NOT:/ ~ /g;
# Convert :SHL: to <<
s/:SHL:/ << /g;
# Convert :SHR: to >>
s/:SHR:/ >> /g;
# Comment character
s/;/@/;
# Convert ELSE to .else
s/\bELSE\b/.else/g;
@@ -82,105 +54,51 @@ while (<STDIN>)
# Convert ENDIF to .endif
s/\bENDIF\b/.endif/g;
# Convert ELSEIF to .elseif
s/\bELSEIF\b/.elseif/g;
# Convert LTORG to .ltorg
s/\bLTORG\b/.ltorg/g;
# Convert endfunc to nothing.
s/\bendfunc\b//ig;
# Convert FUNCTION to nothing.
s/\bFUNCTION\b//g;
s/\bfunction\b//g;
s/\bENTRY\b//g;
s/\bMSARMASM\b/0/g;
s/^\s+end\s+$//g;
# Convert IF :DEF:to .if
# gcc doesn't have the ability to do a conditional
# if defined variable that is set by IF :DEF: on
# armasm, so convert it to a normal .if and then
# make sure to define a value elesewhere
if (s/\bIF :DEF:\b/.if /g)
{
s/=/==/g;
}
# Convert IF to .if
if (s/\bIF\b/.if/g)
{
if (s/\bIF\b/.if/g) {
s/=+/==/g;
}
# Convert INCLUDE to .INCLUDE "file"
s/INCLUDE(\s*)(.*)$/.include $1\"$2\"/;
# Code directive (ARM vs Thumb)
s/CODE([0-9][0-9])/.code $1/;
s/INCLUDE\s?(.*)$/.include \"$1\"/;
# No AREA required
# But ALIGNs in AREA must be obeyed
s/^\s*AREA.*ALIGN=([0-9])$/.text\n.p2align $1/;
s/^(\s*)\bAREA\b.*ALIGN=([0-9])$/$1.text\n$1.p2align $2/;
# If no ALIGN, strip the AREA and align to 4 bytes
s/^\s*AREA.*$/.text\n.p2align 2/;
s/^(\s*)\bAREA\b.*$/$1.text\n$1.p2align 2/;
# DCD to .word
# This one is for incoming symbols
s/DCD\s+\|(\w*)\|/.long $1/;
# DCW to .short
s/DCW\s+\|(\w*)\|/.short $1/;
s/DCW(.*)/.short $1/;
# Constants defined in scope
s/DCD(.*)/.long $1/;
s/DCB(.*)/.byte $1/;
# Make function visible to linker, and make additional symbol with
# prepended underscore
# Make function visible to linker.
if ($elf) {
s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
s/(\s*)EXPORT\s+\|([\$\w]*)\|/$1.global $2\n$1.type $2, function/;
} else {
s/EXPORT\s+\|([\$\w]*)\|/.global $1/;
s/(\s*)EXPORT\s+\|([\$\w]*)\|/$1.global $2/;
}
s/IMPORT\s+\|([\$\w]*)\|/.global $1/;
s/EXPORT\s+([\$\w]*)/.global $1/;
s/export\s+([\$\w]*)/.global $1/;
# No vertical bars required; make additional symbol with prepended
# underscore
s/^\|(\$?\w+)\|/_$1\n\t$1:/g;
# No vertical bars on function names
s/^\|(\$?\w+)\|/$1/g;
# Labels need trailing colon
# s/^(\w+)/$1:/ if !/EQU/;
# put the colon at the end of the line in the macro
s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
# ALIGN directive
s/\bALIGN\b/.balign/g;
if ($thumb) {
# ARM code - we force everything to thumb with the declaration in the header
s/\sARM//g;
# ARM code - we force everything to thumb with the declaration in the
# header
s/\bARM\b//g;
} else {
# ARM code
s/\sARM/.arm/g;
s/\bARM\b/.arm/g;
}
# push/pop
s/(push\s+)(r\d+)/stmdb sp\!, \{$2\}/g;
s/(pop\s+)(r\d+)/ldmia sp\!, \{$2\}/g;
# NEON code
s/(vld1.\d+\s+)(q\d+)/$1\{$2\}/g;
s/(vtbl.\d+\s+[^,]+),([^,]+)/$1,\{$2\}/g;
if ($thumb) {
thumb::FixThumbInstructions($_, 0);
thumb::FixThumbInstructions($_);
}
# eabi_attributes numerical equivalents can be found in the
@@ -188,31 +106,31 @@ while (<STDIN>)
if ($elf) {
# REQUIRE8 Stack is required to be 8-byte aligned
s/\sREQUIRE8/.eabi_attribute 24, 1 \@Tag_ABI_align_needed/g;
s/\bREQUIRE8\b/.eabi_attribute 24, 1 \@Tag_ABI_align_needed/g;
# PRESERVE8 Stack 8-byte align is preserved
s/\sPRESERVE8/.eabi_attribute 25, 1 \@Tag_ABI_align_preserved/g;
s/\bPRESERVE8\b/.eabi_attribute 25, 1 \@Tag_ABI_align_preserved/g;
} else {
s/\sREQUIRE8//;
s/\sPRESERVE8//;
s/\bREQUIRE8\b//;
s/\bPRESERVE8\b//;
}
# Use PROC and ENDP to give the symbols a .size directive.
# This makes them show up properly in debugging tools like gdb and valgrind.
if (/\bPROC\b/)
{
if (/\bPROC\b/) {
my $proc;
/^_([\.0-9A-Z_a-z]\w+)\b/;
# Match the function name so it can be stored in $proc
/^([\.0-9A-Z_a-z]\w+)\b/;
$proc = $1;
push(@proc_stack, $proc) if ($proc);
s/\bPROC\b/@ $&/;
}
if (/\bENDP\b/)
{
if (/\bENDP\b/) {
my $proc;
s/\bENDP\b/@ $&/;
$proc = pop(@proc_stack);
$_ = "\t.size $proc, .-$proc".$_ if ($proc and $elf);
$_ = ".size $proc, .-$proc".$_ if ($proc and $elf);
}
# EQU directive
@@ -220,19 +138,20 @@ while (<STDIN>)
# Begin macro definition
if (/\bMACRO\b/) {
# Process next line down, which will be the macro definition
$_ = <STDIN>;
s/^/.macro/;
s/\$//g; # remove formal param reference
s/;/@/g; # change comment characters
s/\$//g; # Remove $ from the variables in the declaration
}
# For macros, use \ to reference formal params
s/\$/\\/g; # End macro definition
s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
s/\$/\\/g; # Use \ to reference formal parameters
# End macro definition
s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
next if /^\s*END\s*$/;
s/[ \t]+$//;
print;
print "$comment_sub$comment\n" if defined $comment;
}
# Mark that this object doesn't need an executable stack.
printf ("\t.section\t.note.GNU-stack,\"\",\%\%progbits\n") if $elf;
printf (" .section .note.GNU-stack,\"\",\%\%progbits\n") if $elf;
+28 -116
View File
@@ -20,17 +20,14 @@
print "@ This file was created from a .asm file\n";
print "@ using the ads2gas_apple.pl script.\n\n";
print "\t.syntax unified\n";
print ".syntax unified\n";
my %register_aliases;
my %macro_aliases;
my @mapping_list = ("\$0", "\$1", "\$2", "\$3", "\$4", "\$5", "\$6", "\$7", "\$8", "\$9");
my @incoming_array;
my @imported_functions;
# Perl trim function to remove whitespace from the start and end of the string
sub trim($)
{
@@ -46,25 +43,7 @@ while (<STDIN>)
s/@/,:/g;
# Comment character
s/;/ @/g;
# Hexadecimal constants prefaced by 0x
s/#&/#0x/g;
# Convert :OR: to |
s/:OR:/ | /g;
# Convert :AND: to &
s/:AND:/ & /g;
# Convert :NOT: to ~
s/:NOT:/ ~ /g;
# Convert :SHL: to <<
s/:SHL:/ << /g;
# Convert :SHR: to >>
s/:SHR:/ >> /g;
s/;/@/;
# Convert ELSE to .else
s/\bELSE\b/.else/g;
@@ -72,131 +51,64 @@ while (<STDIN>)
# Convert ENDIF to .endif
s/\bENDIF\b/.endif/g;
# Convert ELSEIF to .elseif
s/\bELSEIF\b/.elseif/g;
# Convert LTORG to .ltorg
s/\bLTORG\b/.ltorg/g;
# Convert IF :DEF:to .if
# gcc doesn't have the ability to do a conditional
# if defined variable that is set by IF :DEF: on
# armasm, so convert it to a normal .if and then
# make sure to define a value elesewhere
if (s/\bIF :DEF:\b/.if /g)
{
s/=/==/g;
}
# Convert IF to .if
if (s/\bIF\b/.if/g)
{
s/=/==/g;
if (s/\bIF\b/.if/g) {
s/=+/==/g;
}
# Convert INCLUDE to .INCLUDE "file"
s/INCLUDE(\s*)(.*)$/.include $1\"$2\"/;
# Code directive (ARM vs Thumb)
s/CODE([0-9][0-9])/.code $1/;
s/INCLUDE\s?(.*)$/.include \"$1\"/;
# No AREA required
# But ALIGNs in AREA must be obeyed
s/^\s*AREA.*ALIGN=([0-9])$/.text\n.p2align $1/;
s/^(\s*)\bAREA\b.*ALIGN=([0-9])$/$1.text\n$1.p2align $2/;
# If no ALIGN, strip the AREA and align to 4 bytes
s/^\s*AREA.*$/.text\n.p2align 2/;
s/^(\s*)\bAREA\b.*$/$1.text\n$1.p2align 2/;
# DCD to .word
# This one is for incoming symbols
s/DCD\s+\|(\w*)\|/.long $1/;
# Make function visible to linker.
s/EXPORT\s+\|([\$\w]*)\|/.globl _$1/;
# DCW to .short
s/DCW\s+\|(\w*)\|/.short $1/;
s/DCW(.*)/.short $1/;
# No vertical bars on function names
s/^\|(\$?\w+)\|/$1/g;
# Constants defined in scope
s/DCD(.*)/.long $1/;
s/DCB(.*)/.byte $1/;
# Labels and functions need a leading underscore and trailing colon
s/^([a-zA-Z_0-9\$]+)/_$1:/ if !/EQU/;
# Make function visible to linker, and make additional symbol with
# prepended underscore
s/EXPORT\s+\|([\$\w]*)\|/.globl _$1\n\t.globl $1/;
# Prepend imported functions with _
if (s/IMPORT\s+\|([\$\w]*)\|/.globl $1/)
{
$function = trim($1);
push(@imported_functions, $function);
}
foreach $function (@imported_functions)
{
s/$function/_$function/;
}
# No vertical bars required; make additional symbol with prepended
# underscore
s/^\|(\$?\w+)\|/_$1\n\t$1:/g;
# Labels need trailing colon
# s/^(\w+)/$1:/ if !/EQU/;
# put the colon at the end of the line in the macro
s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
# Branches need to call the correct, underscored, function
s/^(\s+b[egln]?[teq]?\s+)([a-zA-Z_0-9\$]+)/$1 _$2/ if !/EQU/;
# ALIGN directive
s/\bALIGN\b/.balign/g;
# Strip ARM
s/\sARM/@ ARM/g;
s/\s+ARM//;
# Strip REQUIRE8
#s/\sREQUIRE8/@ REQUIRE8/g;
s/\sREQUIRE8/@ /g;
s/\s+REQUIRE8//;
# Strip PRESERVE8
s/\sPRESERVE8/@ PRESERVE8/g;
s/\s+PRESERVE8//;
# Strip PROC and ENDPROC
s/\bPROC\b/@/g;
s/\bENDP\b/@/g;
s/\bPROC\b//g;
s/\bENDP\b//g;
# EQU directive
s/(.*)EQU(.*)/.set $1, $2/;
s/(\S+\s+)EQU(\s+\S+)/.equ $1, $2/;
# Begin macro definition
if (/\bMACRO\b/)
{
if (/\bMACRO\b/) {
# Process next line down, which will be the macro definition
$_ = <STDIN>;
$trimmed = trim($_);
# remove commas that are separating list
$trimmed =~ s/,//g;
# string to array
@incoming_array = split(/\s+/, $trimmed);
print ".macro @incoming_array[0]\n";
# remove the first element, as that is the name of the macro
shift (@incoming_array);
@macro_aliases{@incoming_array} = @mapping_list;
next;
s/^/.macro/;
s/\$//g; # Remove $ from the variables in the declaration
}
while (($key, $value) = each(%macro_aliases))
{
$key =~ s/\$/\\\$/;
s/$key\b/$value/g;
}
s/\$/\\/g; # Use \ to reference formal parameters
# End macro definition
# For macros, use \ to reference formal params
# s/\$/\\/g; # End macro definition
s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
next if /^\s*END\s*$/;
s/[ \t]+$//;
print;
}
+206 -45
View File
@@ -74,6 +74,8 @@ Build options:
--cpu=CPU optimize for a specific cpu rather than a family
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
--extra-cxxflags=ECXXFLAGS add ECXXFLAGS to CXXFLAGS [$CXXFLAGS]
--use-profile=PROFILE_FILE
Use PROFILE_FILE for PGO
${toggle_extra_warnings} emit harmless warnings (always non-fatal)
${toggle_werror} treat warnings as errors, if possible
(not available with all compilers)
@@ -81,6 +83,7 @@ Build options:
${toggle_pic} turn on/off Position Independent Code
${toggle_ccache} turn on/off compiler cache
${toggle_debug} enable/disable debug mode
${toggle_profile} enable/disable profiling
${toggle_gprof} enable/disable gprof profiling instrumentation
${toggle_gcov} enable/disable gcov coverage instrumentation
${toggle_thumb} enable/disable building arm assembly in thumb mode
@@ -262,6 +265,9 @@ if [ -z "$source_path" ] || [ "$source_path" = "." ]; then
source_path="`pwd`"
disable_feature source_path_used
fi
# Makefiles greedily process the '#' character as a comment, even if it is
# inside quotes. So, this character must be escaped in all paths in Makefiles.
source_path_mk=$(echo $source_path | sed -e 's;\#;\\\#;g')
if test ! -z "$TMPDIR" ; then
TMPDIRx="${TMPDIR}"
@@ -426,6 +432,42 @@ check_gcc_machine_options() {
fi
}
check_neon_sve_bridge_compiles() {
if enabled sve; then
check_cc -march=armv8.2-a+dotprod+i8mm+sve <<EOF
#ifndef __ARM_NEON_SVE_BRIDGE
#error 1
#endif
#include <arm_sve.h>
#include <arm_neon_sve_bridge.h>
EOF
compile_result=$?
if [ ${compile_result} -eq 0 ]; then
# Check whether the compiler can compile SVE functions that require
# backup/restore of SVE registers according to AAPCS. Clang for Windows
# used to fail this, see
# https://github.com/llvm/llvm-project/issues/80009.
check_cc -march=armv8.2-a+dotprod+i8mm+sve <<EOF
#include <arm_sve.h>
void other(void);
svfloat32_t func(svfloat32_t a) {
other();
return a;
}
EOF
compile_result=$?
fi
if [ ${compile_result} -ne 0 ]; then
log_echo " disabling sve: arm_neon_sve_bridge.h not supported by compiler"
log_echo " disabling sve2: arm_neon_sve_bridge.h not supported by compiler"
disable_feature sve
disable_feature sve2
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-sve --disable-sve2 "
fi
fi
}
check_gcc_avx512_compiles() {
if disabled gcc; then
return
@@ -446,6 +488,17 @@ EOF
fi
}
check_inline_asm() {
log check_inline_asm "$@"
name="$1"
code="$2"
shift 2
disable_feature $name
check_cc "$@" <<EOF && enable_feature $name
void foo(void) { __asm__ volatile($code); }
EOF
}
write_common_config_banner() {
print_webm_license config.mk "##" ""
echo '# This file automatically generated by configure. Do not edit!' >> config.mk
@@ -481,11 +534,11 @@ write_common_target_config_mk() {
cat >> $1 << EOF
# This file automatically generated by configure. Do not edit!
SRC_PATH="$source_path"
SRC_PATH_BARE=$source_path
SRC_PATH="$source_path_mk"
SRC_PATH_BARE=$source_path_mk
BUILD_PFX=${BUILD_PFX}
TOOLCHAIN=${toolchain}
ASM_CONVERSION=${asm_conversion_cmd:-${source_path}/build/make/ads2gas.pl}
ASM_CONVERSION=${asm_conversion_cmd:-${source_path_mk}/build/make/ads2gas.pl}
GEN_VCPROJ=${gen_vcproj_cmd}
MSVS_ARCH_DIR=${msvs_arch_dir}
@@ -495,7 +548,6 @@ AR=${AR}
LD=${LD}
AS=${AS}
STRIP=${STRIP}
NM=${NM}
CFLAGS = ${CFLAGS}
CXXFLAGS = ${CXXFLAGS}
@@ -507,6 +559,7 @@ AS_SFX = ${AS_SFX:-.asm}
EXE_SFX = ${EXE_SFX}
VCPROJ_SFX = ${VCPROJ_SFX}
RTCD_OPTIONS = ${RTCD_OPTIONS}
LIBWEBM_CXXFLAGS = ${LIBWEBM_CXXFLAGS}
LIBYUV_CXXFLAGS = ${LIBYUV_CXXFLAGS}
EOF
@@ -596,6 +649,9 @@ process_common_cmdline() {
--extra-cxxflags=*)
extra_cxxflags="${optval}"
;;
--use-profile=*)
pgo_file=${optval}
;;
--enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
if is_in ${option} ${ARCH_EXT_LIST}; then
@@ -692,7 +748,6 @@ setup_gnu_toolchain() {
LD=${LD:-${CROSS}${link_with_cc:-ld}}
AS=${AS:-${CROSS}as}
STRIP=${STRIP:-${CROSS}strip}
NM=${NM:-${CROSS}nm}
AS_SFX=.S
EXE_SFX=
}
@@ -763,6 +818,12 @@ process_common_toolchain() {
*mips32el*)
tgt_isa=mips32
;;
loongarch32*)
tgt_isa=loongarch32
;;
loongarch64*)
tgt_isa=loongarch64
;;
esac
# detect tgt_os
@@ -771,6 +832,10 @@ process_common_toolchain() {
tgt_isa=x86_64
tgt_os=`echo $gcctarget | sed 's/.*\(darwin1[0-9]\).*/\1/'`
;;
*darwin2[0-4]*)
tgt_isa=`uname -m`
tgt_os=`echo $gcctarget | sed 's/.*\(darwin2[0-9]\).*/\1/'`
;;
x86_64*mingw32*)
tgt_os=win64
;;
@@ -818,6 +883,10 @@ process_common_toolchain() {
# Enable the architecture family
case ${tgt_isa} in
arm64 | armv8)
enable_feature arm
enable_feature aarch64
;;
arm*)
enable_feature arm
;;
@@ -827,10 +896,21 @@ process_common_toolchain() {
ppc*)
enable_feature ppc
;;
loongarch*)
soft_enable lsx
soft_enable lasx
enable_feature loongarch
;;
esac
# PIC is probably what we want when building shared libs
# Position independent code (PIC) is probably what we want when building
# shared libs or position independent executable (PIE) targets.
enabled shared && soft_enable pic
check_cpp << EOF || soft_enable pic
#if !(__pie__ || __PIE__)
#error Neither __pie__ or __PIE__ are set
#endif
EOF
# Minimum iOS version for all target platforms (darwin and iphonesimulator).
# Shared library framework builds are only possible on iOS 8 and later.
@@ -845,7 +925,7 @@ process_common_toolchain() {
# Handle darwin variants. Newer SDKs allow targeting older
# platforms, so use the newest one available.
case ${toolchain} in
arm*-darwin*)
arm*-darwin-*)
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
if [ -d "${iphoneos_sdk_dir}" ]; then
@@ -853,7 +933,7 @@ process_common_toolchain() {
add_ldflags "-isysroot ${iphoneos_sdk_dir}"
fi
;;
x86*-darwin*)
*-darwin*)
osx_sdk_dir="$(show_darwin_sdk_path macosx)"
if [ -d "${osx_sdk_dir}" ]; then
add_cflags "-isysroot ${osx_sdk_dir}"
@@ -911,6 +991,10 @@ process_common_toolchain() {
add_cflags "-mmacosx-version-min=10.15"
add_ldflags "-mmacosx-version-min=10.15"
;;
*-darwin2[0-4]-*)
add_cflags "-arch ${toolchain%%-*}"
add_ldflags "-arch ${toolchain%%-*}"
;;
*-iphonesimulator-*)
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
@@ -932,27 +1016,30 @@ process_common_toolchain() {
;;
esac
# Process ARM architecture variants
# Process architecture variants
case ${toolchain} in
arm*)
# on arm, isa versions are supersets
case ${tgt_isa} in
arm64|armv8)
soft_enable neon
case ${toolchain} in
armv7*-darwin*)
# Runtime cpu detection is not defined for these targets.
enabled runtime_cpu_detect && disable_feature runtime_cpu_detect
;;
armv7|armv7s)
soft_enable neon
# Only enable neon_asm when neon is also enabled.
enabled neon && soft_enable neon_asm
# If someone tries to force it through, die.
if disabled neon && enabled neon_asm; then
die "Disabling neon while keeping neon-asm is not supported"
fi
*)
soft_enable runtime_cpu_detect
;;
esac
asm_conversion_cmd="cat"
if [ ${tgt_isa} = "armv7" ] || [ ${tgt_isa} = "armv7s" ]; then
soft_enable neon
# Only enable neon_asm when neon is also enabled.
enabled neon && soft_enable neon_asm
# If someone tries to force it through, die.
if disabled neon && enabled neon_asm; then
die "Disabling neon while keeping neon-asm is not supported"
fi
fi
asm_conversion_cmd="cat"
case ${tgt_cc} in
gcc)
link_with_cc=gcc
@@ -984,7 +1071,7 @@ EOF
fi
enabled debug && add_asflags -g
asm_conversion_cmd="${source_path}/build/make/ads2gas.pl"
asm_conversion_cmd="${source_path_mk}/build/make/ads2gas.pl"
case ${tgt_os} in
win*)
@@ -1006,7 +1093,7 @@ EOF
# respective SDKs' limitations. Fortunately, these are all 32-bit ABIs
# and so can be selected as 'win32'.
if [ ${tgt_os} = "win32" ]; then
asm_conversion_cmd="${source_path}/build/make/ads2armasm_ms.pl"
asm_conversion_cmd="${source_path_mk}/build/make/ads2armasm_ms.pl"
AS_SFX=.S
msvs_arch_dir=arm-msvs
disable_feature multithread
@@ -1033,8 +1120,11 @@ EOF
enable_feature win_arm64_neon_h_workaround
else
# If a probe is not possible, assume this is the pure Windows
# SDK and so the workaround is necessary.
enable_feature win_arm64_neon_h_workaround
# SDK and so the workaround is necessary when using Visual
# Studio < 2019.
if [ ${tgt_cc##vs} -lt 16 ]; then
enable_feature win_arm64_neon_h_workaround
fi
fi
fi
fi
@@ -1045,7 +1135,6 @@ EOF
AS=armasm
LD="${source_path}/build/make/armlink_adapter.sh"
STRIP=arm-none-linux-gnueabi-strip
NM=arm-none-linux-gnueabi-nm
tune_cflags="--cpu="
tune_asflags="--cpu="
if [ -z "${tune_cpu}" ]; then
@@ -1082,9 +1171,17 @@ EOF
echo "See build/make/Android.mk for details."
check_add_ldflags -static
soft_enable unit_tests
case "$AS" in
*clang)
# The GNU Assembler was removed in the r24 version of the NDK.
# clang's internal assembler works, but `-c` is necessary to
# avoid linking.
add_asflags -c
;;
esac
;;
darwin*)
darwin)
if ! enabled external_build; then
XCRUN_FIND="xcrun --sdk iphoneos --find"
CXX="$(${XCRUN_FIND} clang++)"
@@ -1092,8 +1189,6 @@ EOF
AR="$(${XCRUN_FIND} ar)"
AS="$(${XCRUN_FIND} as)"
STRIP="$(${XCRUN_FIND} strip)"
NM="$(${XCRUN_FIND} nm)"
RANLIB="$(${XCRUN_FIND} ranlib)"
AS_SFX=.S
LD="${CXX:-$(${XCRUN_FIND} ld)}"
@@ -1141,7 +1236,7 @@ EOF
fi
fi
asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
asm_conversion_cmd="${source_path_mk}/build/make/ads2gas_apple.pl"
;;
linux*)
@@ -1168,6 +1263,38 @@ EOF
fi
;;
esac
# AArch64 ISA extensions are treated as supersets.
if [ ${tgt_isa} = "arm64" ] || [ ${tgt_isa} = "armv8" ]; then
aarch64_arch_flag_neon="arch=armv8-a"
aarch64_arch_flag_neon_dotprod="arch=armv8.2-a+dotprod"
aarch64_arch_flag_neon_i8mm="arch=armv8.2-a+dotprod+i8mm"
aarch64_arch_flag_sve="arch=armv8.2-a+dotprod+i8mm+sve"
aarch64_arch_flag_sve2="arch=armv9-a+sve2"
for ext in ${ARCH_EXT_LIST_AARCH64}; do
if [ "$disable_exts" = "yes" ]; then
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${ext} "
soft_disable $ext
else
# Check the compiler supports the -march flag for the extension.
# This needs to happen after toolchain/OS inspection so we handle
# $CROSS etc correctly when checking for flags, else these will
# always fail.
flag="$(eval echo \$"aarch64_arch_flag_${ext}")"
check_gcc_machine_option "${flag}" "${ext}"
if ! enabled $ext; then
# Disable higher order extensions to simplify dependencies.
disable_exts="yes"
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${ext} "
soft_disable $ext
fi
fi
done
if enabled sve; then
check_neon_sve_bridge_compiles
fi
fi
;;
mips*)
link_with_cc=gcc
@@ -1195,25 +1322,27 @@ EOF
check_add_asflags -mips64r6 -mabi=64 -mhard-float -mfp64
check_add_ldflags -mips64r6 -mabi=64 -mfp64
;;
loongson3*)
check_cflags -march=loongson3a && soft_enable mmi \
|| disable_feature mmi
check_cflags -mmsa && soft_enable msa \
|| disable_feature msa
tgt_isa=loongson3a
;;
esac
if enabled mmi || enabled msa; then
soft_enable runtime_cpu_detect
fi
if enabled msa; then
# TODO(libyuv:793)
# The new mips functions in libyuv do not build
# with the toolchains we currently use for testing.
soft_disable libyuv
add_cflags -mmsa
add_asflags -mmsa
add_ldflags -mmsa
fi
fi
if enabled mmi; then
tgt_isa=loongson3a
check_add_ldflags -march=loongson3a
fi
check_add_cflags -march=${tgt_isa}
check_add_asflags -march=${tgt_isa}
check_add_asflags -KPIC
@@ -1283,10 +1412,6 @@ EOF
enabled optimizations && disabled gprof && check_add_cflags -fomit-frame-pointer
;;
vs*)
# When building with Microsoft Visual Studio the assembler is
# invoked directly. Checking at configure time is unnecessary.
# Skip the check by setting AS arbitrarily
AS=msvs
msvs_arch_dir=x86-msvs
case ${tgt_cc##vs} in
14)
@@ -1410,6 +1535,15 @@ EOF
;;
esac
;;
loongarch*)
link_with_cc=gcc
setup_gnu_toolchain
enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr1"'
enabled lsx && soft_enable runtime_cpu_detect
enabled lasx && check_inline_asm lasx '"xvadd.b $xr0, $xr1, $xr1"'
enabled lasx && soft_enable runtime_cpu_detect
;;
*-gcc|generic-gnu)
link_with_cc=gcc
enable_feature gcc
@@ -1417,6 +1551,14 @@ EOF
;;
esac
# Enable PGO
if [ -n "${pgo_file}" ]; then
check_add_cflags -fprofile-use=${pgo_file} || \
die "-fprofile-use is not supported by compiler"
check_add_ldflags -fprofile-use=${pgo_file} || \
die "-fprofile-use is not supported by linker"
fi
# Try to enable CPU specific tuning
if [ -n "${tune_cpu}" ]; then
if [ -n "${tune_cflags}" ]; then
@@ -1437,6 +1579,9 @@ EOF
else
check_add_cflags -DNDEBUG
fi
enabled profile &&
check_add_cflags -fprofile-generate &&
check_add_ldflags -fprofile-generate
enabled gprof && check_add_cflags -pg && check_add_ldflags -pg
enabled gcov &&
@@ -1471,7 +1616,7 @@ EOF
# Try to find which inline keywords are supported
check_cc <<EOF && INLINE="inline"
static inline function() {}
static inline int function(void) {}
EOF
# Almost every platform uses pthreads.
@@ -1512,6 +1657,22 @@ EOF
;;
esac
# only for LOONGARCH platforms
case ${toolchain} in
loongarch*)
if enabled big_endian; then
if enabled lsx; then
echo "lsx optimizations are available only for little endian platforms"
disable_feature lsx
fi
if enabled lasx; then
echo "lasx optimizations are available only for little endian platforms"
disable_feature lasx
fi
fi
;;
esac
# glibc needs these
if enabled linux; then
add_cflags -D_LARGEFILE_SOURCE
+1 -1
View File
@@ -42,7 +42,7 @@ done
[ -n "$srcfile" ] || show_help
sfx=${sfx:-asm}
includes=$(LC_ALL=C egrep -i "include +\"?[a-z0-9_/]+\.${sfx}" $srcfile |
includes=$(LC_ALL=C grep -E -i "include +\"?[a-z0-9_/]+\.${sfx}" $srcfile |
perl -p -e "s;.*?([a-z0-9_/]+.${sfx}).*;\1;")
#" restore editor state
for inc in ${includes}; do
+3 -2
View File
@@ -25,7 +25,7 @@ files.
Options:
--help Print this message
--out=outfile Redirect output to a file
--ver=version Version (14-16) of visual studio to generate for
--ver=version Version (14-17) of visual studio to generate for
--target=isa-os-cc Target specifier
EOF
exit 1
@@ -219,6 +219,7 @@ for opt in "$@"; do
14) vs_year=2015 ;;
15) vs_year=2017 ;;
16) vs_year=2019 ;;
17) vs_year=2022 ;;
*) die Unrecognized Visual Studio Version in $opt ;;
esac
;;
@@ -232,7 +233,7 @@ done
outfile=${outfile:-/dev/stdout}
mkoutfile=${mkoutfile:-/dev/stdout}
case "${vs_ver}" in
1[4-6])
1[4-7])
# VS has used Format Version 12.00 continuously since vs11.
sln_vers="12.00"
sln_vers_str="Visual Studio ${vs_year}"
+37 -14
View File
@@ -141,7 +141,17 @@ for opt in "$@"; do
case "$opt" in
--help|-h) show_help
;;
--target=*) target="${optval}"
--target=*)
target="${optval}"
platform_toolset=$(echo ${target} | awk 'BEGIN{FS="-"}{print $4}')
case "$platform_toolset" in
clangcl) platform_toolset="ClangCl"
;;
"")
;;
*) die Unrecognized Visual Studio Platform Toolset in $opt
;;
esac
;;
--out=*) outfile="$optval"
;;
@@ -157,6 +167,8 @@ for opt in "$@"; do
;;
--lib) proj_kind="lib"
;;
--as=*) as="${optval}"
;;
--src-path-bare=*)
src_path_bare=$(fix_path "$optval")
src_path_bare=${src_path_bare%/}
@@ -168,7 +180,7 @@ for opt in "$@"; do
--ver=*)
vs_ver="$optval"
case "$optval" in
1[4-6])
1[4-7])
;;
*) die Unrecognized Visual Studio Version in $opt
;;
@@ -247,16 +259,20 @@ libs=${libs// /;}
case "$target" in
x86_64*)
platforms[0]="x64"
asm_Debug_cmdline="yasm -Xvc -g cv8 -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
asm_Release_cmdline="yasm -Xvc -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
asm_Debug_cmdline="${as} -Xvc -gcv8 -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
asm_Release_cmdline="${as} -Xvc -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
;;
x86*)
platforms[0]="Win32"
asm_Debug_cmdline="yasm -Xvc -g cv8 -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
asm_Release_cmdline="yasm -Xvc -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
asm_Debug_cmdline="${as} -Xvc -gcv8 -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
asm_Release_cmdline="${as} -Xvc -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
;;
arm64*)
platforms[0]="ARM64"
# As of Visual Studio 2022 17.5.5, clang-cl does not support ARM64EC.
if [ "$vs_ver" -ge 17 -a "$platform_toolset" != "ClangCl" ]; then
platforms[1]="ARM64EC"
fi
asm_Debug_cmdline="armasm64 -nologo -oldit &quot;%(FullPath)&quot;"
asm_Release_cmdline="armasm64 -nologo -oldit &quot;%(FullPath)&quot;"
;;
@@ -333,14 +349,21 @@ generate_vcxproj() {
else
tag_content ConfigurationType StaticLibrary
fi
if [ "$vs_ver" = "14" ]; then
tag_content PlatformToolset v140
fi
if [ "$vs_ver" = "15" ]; then
tag_content PlatformToolset v141
fi
if [ "$vs_ver" = "16" ]; then
tag_content PlatformToolset v142
if [ -n "$platform_toolset" ]; then
tag_content PlatformToolset "$platform_toolset"
else
if [ "$vs_ver" = "14" ]; then
tag_content PlatformToolset v140
fi
if [ "$vs_ver" = "15" ]; then
tag_content PlatformToolset v141
fi
if [ "$vs_ver" = "16" ]; then
tag_content PlatformToolset v142
fi
if [ "$vs_ver" = "17" ]; then
tag_content PlatformToolset v143
fi
fi
tag_content CharacterSet Unicode
if [ "$config" = "Release" ]; then
+2 -1
View File
@@ -9,7 +9,8 @@
## be found in the AUTHORS file in the root of the source tree.
##
if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] \
shell_name="$(uname -o 2>/dev/null)"
if [[ "$shell_name" = "Cygwin" || "$shell_name" = "Msys" ]] \
&& cygpath --help >/dev/null 2>&1; then
FIXPATH='cygpath -m'
else
+84 -9
View File
@@ -73,6 +73,10 @@ sub vpx_config($) {
}
sub specialize {
if (@_ <= 1) {
die "'specialize' must be called with a function name and at least one ",
"architecture ('C' is implied): \n@_\n";
}
my $fn=$_[0];
shift;
foreach my $opt (@_) {
@@ -208,7 +212,19 @@ sub filter {
#
sub common_top() {
my $include_guard = uc($opts{sym})."_H_";
my @time = localtime;
my $year = $time[5] + 1900;
print <<EOF;
/*
* Copyright (c) ${year} The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This file is generated. Do not edit.
#ifndef ${include_guard}
#define ${include_guard}
@@ -238,13 +254,14 @@ EOF
}
sub common_bottom() {
my $include_guard = uc($opts{sym})."_H_";
print <<EOF;
#ifdef __cplusplus
} // extern "C"
#endif
#endif
#endif // ${include_guard}
EOF
}
@@ -315,14 +332,26 @@ EOF
sub mips() {
determine_indirection("c", @ALL_ARCHS);
# Assign the helper variable for each enabled extension
foreach my $opt (@ALL_ARCHS) {
my $opt_uc = uc $opt;
eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
}
common_top;
print <<EOF;
#include "vpx_config.h"
#ifdef RTCD_C
#include "vpx_ports/mips.h"
static void setup_rtcd_internal(void)
{
int flags = mips_cpu_caps();
(void)flags;
EOF
set_function_pointers("c", @ALL_ARCHS);
@@ -375,6 +404,37 @@ EOF
common_bottom;
}
sub loongarch() {
determine_indirection("c", @ALL_ARCHS);
# Assign the helper variable for each enabled extension
foreach my $opt (@ALL_ARCHS) {
my $opt_uc = uc $opt;
eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
}
common_top;
print <<EOF;
#include "vpx_config.h"
#ifdef RTCD_C
#include "vpx_ports/loongarch.h"
static void setup_rtcd_internal(void)
{
int flags = loongarch_cpu_caps();
(void)flags;
EOF
set_function_pointers("c", @ALL_ARCHS);
print <<EOF;
}
#endif
EOF
common_bottom;
}
sub unoptimized() {
determine_indirection "c";
common_top;
@@ -410,35 +470,50 @@ if ($opts{arch} eq 'x86') {
&require(@REQUIRES);
x86;
} elsif ($opts{arch} eq 'mips32' || $opts{arch} eq 'mips64') {
my $have_dspr2 = 0;
my $have_msa = 0;
my $have_mmi = 0;
@ALL_ARCHS = filter("$opts{arch}");
open CONFIG_FILE, $opts{config} or
die "Error opening config file '$opts{config}': $!\n";
while (<CONFIG_FILE>) {
if (/HAVE_DSPR2=yes/) {
@ALL_ARCHS = filter("$opts{arch}", qw/dspr2/);
last;
$have_dspr2 = 1;
}
if (/HAVE_MSA=yes/) {
@ALL_ARCHS = filter("$opts{arch}", qw/msa/);
last;
$have_msa = 1;
}
if (/HAVE_MMI=yes/) {
@ALL_ARCHS = filter("$opts{arch}", qw/mmi/);
last;
$have_mmi = 1;
}
}
close CONFIG_FILE;
if ($have_dspr2 == 1) {
@ALL_ARCHS = filter("$opts{arch}", qw/dspr2/);
} elsif ($have_msa == 1 && $have_mmi == 1) {
@ALL_ARCHS = filter("$opts{arch}", qw/mmi msa/);
} elsif ($have_msa == 1) {
@ALL_ARCHS = filter("$opts{arch}", qw/msa/);
} elsif ($have_mmi == 1) {
@ALL_ARCHS = filter("$opts{arch}", qw/mmi/);
} else {
unoptimized;
}
mips;
} elsif ($opts{arch} =~ /armv7\w?/) {
@ALL_ARCHS = filter(qw/neon_asm neon/);
arm;
} elsif ($opts{arch} eq 'armv8' || $opts{arch} eq 'arm64' ) {
@ALL_ARCHS = filter(qw/neon/);
&require("neon");
@ALL_ARCHS = filter(qw/neon neon_dotprod neon_i8mm sve sve2/);
@REQUIRES = filter(qw/neon/);
&require(@REQUIRES);
arm;
} elsif ($opts{arch} =~ /^ppc/ ) {
@ALL_ARCHS = filter(qw/vsx/);
ppc;
} elsif ($opts{arch} =~ /loongarch/ ) {
@ALL_ARCHS = filter(qw/lsx lasx/);
loongarch;
} else {
unoptimized;
}
+1 -4
View File
@@ -11,11 +11,8 @@
package thumb;
sub FixThumbInstructions($$)
sub FixThumbInstructions($)
{
my $short_branches = $_[1];
my $branch_shift_offset = $short_branches ? 1 : 0;
# Write additions with shifts, such as "add r10, r11, lsl #8",
# in three operand form, "add r10, r10, r11, lsl #8".
s/(add\s+)(r\d+),\s*(r\d+),\s*(lsl #\d+)/$1$2, $2, $3, $4/g;
+3
View File
@@ -61,6 +61,8 @@ if [ ${bare} ]; then
else
cat<<EOF>$$.tmp
// This file is generated. Do not edit.
#ifndef VPX_VERSION_H_
#define VPX_VERSION_H_
#define VERSION_MAJOR $major_version
#define VERSION_MINOR $minor_version
#define VERSION_PATCH $patch_version
@@ -68,6 +70,7 @@ else
#define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH))
#define ${id}_NOSP "${version_str}"
#define ${id} " ${version_str}"
#endif // VPX_VERSION_H_
EOF
fi
if [ -n "$out_file" ]; then
Vendored
+66 -15
View File
@@ -99,9 +99,18 @@ EOF
# alphabetically by architecture, generic-gnu last.
all_platforms="${all_platforms} arm64-android-gcc"
all_platforms="${all_platforms} arm64-darwin-gcc"
all_platforms="${all_platforms} arm64-darwin20-gcc"
all_platforms="${all_platforms} arm64-darwin21-gcc"
all_platforms="${all_platforms} arm64-darwin22-gcc"
all_platforms="${all_platforms} arm64-darwin23-gcc"
all_platforms="${all_platforms} arm64-darwin24-gcc"
all_platforms="${all_platforms} arm64-linux-gcc"
all_platforms="${all_platforms} arm64-win64-gcc"
all_platforms="${all_platforms} arm64-win64-vs15"
all_platforms="${all_platforms} arm64-win64-vs16"
all_platforms="${all_platforms} arm64-win64-vs16-clangcl"
all_platforms="${all_platforms} arm64-win64-vs17"
all_platforms="${all_platforms} arm64-win64-vs17-clangcl"
all_platforms="${all_platforms} armv7-android-gcc" #neon Cortex-A8
all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8
all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8
@@ -110,8 +119,12 @@ all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8
all_platforms="${all_platforms} armv7-win32-gcc"
all_platforms="${all_platforms} armv7-win32-vs14"
all_platforms="${all_platforms} armv7-win32-vs15"
all_platforms="${all_platforms} armv7-win32-vs16"
all_platforms="${all_platforms} armv7-win32-vs17"
all_platforms="${all_platforms} armv7s-darwin-gcc"
all_platforms="${all_platforms} armv8-linux-gcc"
all_platforms="${all_platforms} loongarch32-linux-gcc"
all_platforms="${all_platforms} loongarch64-linux-gcc"
all_platforms="${all_platforms} mips32-linux-gcc"
all_platforms="${all_platforms} mips64-linux-gcc"
all_platforms="${all_platforms} ppc64le-linux-gcc"
@@ -138,6 +151,7 @@ all_platforms="${all_platforms} x86-win32-gcc"
all_platforms="${all_platforms} x86-win32-vs14"
all_platforms="${all_platforms} x86-win32-vs15"
all_platforms="${all_platforms} x86-win32-vs16"
all_platforms="${all_platforms} x86-win32-vs17"
all_platforms="${all_platforms} x86_64-android-gcc"
all_platforms="${all_platforms} x86_64-darwin9-gcc"
all_platforms="${all_platforms} x86_64-darwin10-gcc"
@@ -150,6 +164,11 @@ all_platforms="${all_platforms} x86_64-darwin16-gcc"
all_platforms="${all_platforms} x86_64-darwin17-gcc"
all_platforms="${all_platforms} x86_64-darwin18-gcc"
all_platforms="${all_platforms} x86_64-darwin19-gcc"
all_platforms="${all_platforms} x86_64-darwin20-gcc"
all_platforms="${all_platforms} x86_64-darwin21-gcc"
all_platforms="${all_platforms} x86_64-darwin22-gcc"
all_platforms="${all_platforms} x86_64-darwin23-gcc"
all_platforms="${all_platforms} x86_64-darwin24-gcc"
all_platforms="${all_platforms} x86_64-iphonesimulator-gcc"
all_platforms="${all_platforms} x86_64-linux-gcc"
all_platforms="${all_platforms} x86_64-linux-icc"
@@ -158,6 +177,7 @@ all_platforms="${all_platforms} x86_64-win64-gcc"
all_platforms="${all_platforms} x86_64-win64-vs14"
all_platforms="${all_platforms} x86_64-win64-vs15"
all_platforms="${all_platforms} x86_64-win64-vs16"
all_platforms="${all_platforms} x86_64-win64-vs17"
all_platforms="${all_platforms} generic-gnu"
# all_targets is a list of all targets that can be configured
@@ -229,11 +249,22 @@ CODEC_FAMILIES="
ARCH_LIST="
arm
aarch64
mips
x86
x86_64
ppc
loongarch
"
ARCH_EXT_LIST_AARCH64="
neon
neon_dotprod
neon_i8mm
sve
sve2
"
ARCH_EXT_LIST_X86="
mmx
sse
@@ -248,11 +279,13 @@ ARCH_EXT_LIST_X86="
ARCH_EXT_LIST_LOONGSON="
mmi
lsx
lasx
"
ARCH_EXT_LIST="
neon
neon_asm
${ARCH_EXT_LIST_AARCH64}
mips32
dspr2
@@ -276,6 +309,7 @@ EXPERIMENT_LIST="
emulate_hardware
non_greedy_mv
rate_ctrl
collect_component_timing
"
CONFIG_LIST="
dependency_tracking
@@ -325,7 +359,6 @@ CONFIG_LIST="
multi_res_encoding
temporal_denoising
vp9_temporal_denoising
consistent_recode
coefficient_range_checking
vp9_highbitdepth
better_hw_compatibility
@@ -346,6 +379,7 @@ CMDLINE_SELECT="
install_libs
install_srcs
debug
profile
gprof
gcov
pic
@@ -389,7 +423,6 @@ CMDLINE_SELECT="
multi_res_encoding
temporal_denoising
vp9_temporal_denoising
consistent_recode
coefficient_range_checking
better_hw_compatibility
vp9_highbitdepth
@@ -616,9 +649,11 @@ process_toolchain() {
if enabled gcc; then
enabled werror && check_add_cflags -Werror
check_add_cflags -Wall
check_add_cflags -Wdeclaration-after-statement
check_add_cflags -Wdisabled-optimization
check_add_cflags -Wextra-semi
check_add_cflags -Wextra-semi-stmt
check_add_cflags -Wfloat-conversion
check_add_cflags -Wformat=2
check_add_cflags -Wparentheses-equality
check_add_cflags -Wpointer-arith
check_add_cflags -Wtype-limits
@@ -627,8 +662,10 @@ process_toolchain() {
check_add_cflags -Wimplicit-function-declaration
check_add_cflags -Wmissing-declarations
check_add_cflags -Wmissing-prototypes
check_add_cflags -Wshadow
check_add_cflags -Wstrict-prototypes
check_add_cflags -Wuninitialized
check_add_cflags -Wunreachable-code-loop-increment
check_add_cflags -Wunreachable-code-aggressive
check_add_cflags -Wunused
check_add_cflags -Wextra
# check_add_cflags also adds to cxxflags. gtest does not do well with
@@ -639,24 +676,38 @@ process_toolchain() {
if enabled mips || [ -z "${INLINE}" ]; then
enabled extra_warnings || check_add_cflags -Wno-unused-function
fi
# Enforce c89 for c files. Don't be too strict about it though. Allow
# gnu extensions like "//" for comments.
check_cflags -std=gnu89 && add_cflags_only -std=gnu89
# Enforce C99 for C files. Allow GNU extensions.
check_cflags -std=gnu99 && add_cflags_only -std=gnu99
# Avoid this warning for third_party C++ sources. Some reorganization
# would be needed to apply this only to test/*.cc.
check_cflags -Wshorten-64-to-32 && add_cflags_only -Wshorten-64-to-32
# Do not allow implicit vector type conversions on Clang builds (this
# is already the default on GCC builds).
check_add_cflags -flax-vector-conversions=none
# Quiet gcc 6 vs 7 abi warnings:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77728
if enabled arm; then
check_add_cxxflags -Wno-psabi
fi
# disable some warnings specific to libyuv.
# Enforce C++11 compatibility.
check_add_cxxflags -Wc++14-extensions
check_add_cxxflags -Wc++17-extensions
check_add_cxxflags -Wc++20-extensions
check_add_cxxflags -Wnon-virtual-dtor
# disable some warnings specific to libyuv / libwebm.
check_cxxflags -Wno-missing-declarations \
&& LIBYUV_CXXFLAGS="${LIBYUV_CXXFLAGS} -Wno-missing-declarations"
check_cxxflags -Wno-missing-prototypes \
&& LIBYUV_CXXFLAGS="${LIBYUV_CXXFLAGS} -Wno-missing-prototypes"
check_cxxflags -Wno-pass-failed \
&& LIBYUV_CXXFLAGS="${LIBYUV_CXXFLAGS} -Wno-pass-failed"
check_cxxflags -Wno-shadow \
&& LIBWEBM_CXXFLAGS="${LIBWEBM_CXXFLAGS} -Wno-shadow" \
&& LIBYUV_CXXFLAGS="${LIBYUV_CXXFLAGS} -Wno-shadow"
check_cxxflags -Wno-unused-parameter \
&& LIBYUV_CXXFLAGS="${LIBYUV_CXXFLAGS} -Wno-unused-parameter"
fi
@@ -729,33 +780,33 @@ process_toolchain() {
soft_enable libyuv
;;
*-android-*)
check_add_cxxflags -std=c++11 && soft_enable webm_io
check_add_cxxflags -std=gnu++11 && soft_enable webm_io
soft_enable libyuv
# GTestLog must be modified to use Android logging utilities.
;;
*-darwin-*)
check_add_cxxflags -std=c++11
check_add_cxxflags -std=gnu++11
# iOS/ARM builds do not work with gtest. This does not match
# x86 targets.
;;
*-iphonesimulator-*)
check_add_cxxflags -std=c++11 && soft_enable webm_io
check_add_cxxflags -std=gnu++11 && soft_enable webm_io
soft_enable libyuv
;;
*-win*)
# Some mingw toolchains don't have pthread available by default.
# Treat these more like visual studio where threading in gtest
# would be disabled for the same reason.
check_add_cxxflags -std=c++11 && soft_enable unit_tests \
check_add_cxxflags -std=gnu++11 && soft_enable unit_tests \
&& soft_enable webm_io
check_cxx "$@" <<EOF && soft_enable libyuv
int z;
EOF
;;
*)
enabled pthread_h && check_add_cxxflags -std=c++11 \
enabled pthread_h && check_add_cxxflags -std=gnu++11 \
&& soft_enable unit_tests
check_add_cxxflags -std=c++11 && soft_enable webm_io
check_add_cxxflags -std=gnu++11 && soft_enable webm_io
check_cxx "$@" <<EOF && soft_enable libyuv
int z;
EOF
+2 -20
View File
@@ -57,6 +57,7 @@ LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser/mkvparser.cc \
# Add compile flags and include path for libwebm sources.
ifeq ($(CONFIG_WEBM_IO),yes)
CXXFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
$(BUILD_PFX)third_party/libwebm/%.cc.o: CXXFLAGS += $(LIBWEBM_CXXFLAGS)
INC_PATH-yes += $(SRC_PATH_BARE)/third_party/libwebm
endif
@@ -68,7 +69,6 @@ vpxdec.SRCS += md5_utils.c md5_utils.h
vpxdec.SRCS += vpx_ports/compiler_attributes.h
vpxdec.SRCS += vpx_ports/mem_ops.h
vpxdec.SRCS += vpx_ports/mem_ops_aligned.h
vpxdec.SRCS += vpx_ports/msvc.h
vpxdec.SRCS += vpx_ports/vpx_timer.h
vpxdec.SRCS += vpx/vpx_integer.h
vpxdec.SRCS += args.c args.h
@@ -81,8 +81,6 @@ ifeq ($(CONFIG_LIBYUV),yes)
$(BUILD_PFX)third_party/libyuv/%.cc.o: CXXFLAGS += ${LIBYUV_CXXFLAGS}
endif
ifeq ($(CONFIG_WEBM_IO),yes)
vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS)
vpxdec.SRCS += $(LIBWEBM_MUXER_SRCS)
vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS)
vpxdec.SRCS += webmdec.cc webmdec.h
endif
@@ -97,7 +95,6 @@ vpxenc.SRCS += tools_common.c tools_common.h
vpxenc.SRCS += warnings.c warnings.h
vpxenc.SRCS += vpx_ports/mem_ops.h
vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
vpxenc.SRCS += vpx_ports/msvc.h
vpxenc.SRCS += vpx_ports/vpx_timer.h
vpxenc.SRCS += vpxstats.c vpxstats.h
ifeq ($(CONFIG_LIBYUV),yes)
@@ -119,24 +116,18 @@ vp9_spatial_svc_encoder.SRCS += y4minput.c y4minput.h
vp9_spatial_svc_encoder.SRCS += tools_common.c tools_common.h
vp9_spatial_svc_encoder.SRCS += video_common.h
vp9_spatial_svc_encoder.SRCS += video_writer.h video_writer.c
vp9_spatial_svc_encoder.SRCS += vpx_ports/msvc.h
vp9_spatial_svc_encoder.SRCS += vpxstats.c vpxstats.h
vp9_spatial_svc_encoder.SRCS += examples/svc_encodeframe.c
vp9_spatial_svc_encoder.SRCS += examples/svc_context.h
vp9_spatial_svc_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D
vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder
ifneq ($(CONFIG_SHARED),yes)
EXAMPLES-$(CONFIG_VP9_ENCODER) += resize_util.c
endif
EXAMPLES-$(CONFIG_ENCODERS) += vpx_temporal_svc_encoder.c
vpx_temporal_svc_encoder.SRCS += ivfenc.c ivfenc.h
vpx_temporal_svc_encoder.SRCS += y4minput.c y4minput.h
vpx_temporal_svc_encoder.SRCS += tools_common.c tools_common.h
vpx_temporal_svc_encoder.SRCS += video_common.h
vpx_temporal_svc_encoder.SRCS += video_writer.h video_writer.c
vpx_temporal_svc_encoder.SRCS += vpx_ports/msvc.h
vpx_temporal_svc_encoder.GUID = B18C08F2-A439-4502-A78E-849BE3D60947
vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder
EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c
@@ -148,7 +139,6 @@ simple_decoder.SRCS += video_common.h
simple_decoder.SRCS += video_reader.h video_reader.c
simple_decoder.SRCS += vpx_ports/mem_ops.h
simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h
simple_decoder.SRCS += vpx_ports/msvc.h
simple_decoder.DESCRIPTION = Simplified decoder loop
EXAMPLES-$(CONFIG_DECODERS) += postproc.c
postproc.SRCS += ivfdec.h ivfdec.c
@@ -158,7 +148,6 @@ postproc.SRCS += video_common.h
postproc.SRCS += video_reader.h video_reader.c
postproc.SRCS += vpx_ports/mem_ops.h
postproc.SRCS += vpx_ports/mem_ops_aligned.h
postproc.SRCS += vpx_ports/msvc.h
postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7
postproc.DESCRIPTION = Decoder postprocessor control
EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c
@@ -171,7 +160,6 @@ decode_to_md5.SRCS += video_reader.h video_reader.c
decode_to_md5.SRCS += vpx_ports/compiler_attributes.h
decode_to_md5.SRCS += vpx_ports/mem_ops.h
decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h
decode_to_md5.SRCS += vpx_ports/msvc.h
decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42
decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum
EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c
@@ -180,7 +168,6 @@ simple_encoder.SRCS += y4minput.c y4minput.h
simple_encoder.SRCS += tools_common.h tools_common.c
simple_encoder.SRCS += video_common.h
simple_encoder.SRCS += video_writer.h video_writer.c
simple_encoder.SRCS += vpx_ports/msvc.h
simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
simple_encoder.DESCRIPTION = Simplified encoder loop
EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_lossless_encoder.c
@@ -189,7 +176,6 @@ vp9_lossless_encoder.SRCS += y4minput.c y4minput.h
vp9_lossless_encoder.SRCS += tools_common.h tools_common.c
vp9_lossless_encoder.SRCS += video_common.h
vp9_lossless_encoder.SRCS += video_writer.h video_writer.c
vp9_lossless_encoder.SRCS += vpx_ports/msvc.h
vp9_lossless_encoder.GUID = B63C7C88-5348-46DC-A5A6-CC151EF93366
vp9_lossless_encoder.DESCRIPTION = Simplified lossless VP9 encoder
EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c
@@ -198,7 +184,6 @@ twopass_encoder.SRCS += y4minput.c y4minput.h
twopass_encoder.SRCS += tools_common.h tools_common.c
twopass_encoder.SRCS += video_common.h
twopass_encoder.SRCS += video_writer.h video_writer.c
twopass_encoder.SRCS += vpx_ports/msvc.h
twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8
twopass_encoder.DESCRIPTION = Two-pass encoder loop
EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c
@@ -209,7 +194,6 @@ decode_with_drops.SRCS += video_common.h
decode_with_drops.SRCS += video_reader.h video_reader.c
decode_with_drops.SRCS += vpx_ports/mem_ops.h
decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h
decode_with_drops.SRCS += vpx_ports/msvc.h
decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
decode_with_drops.DESCRIPTION = Drops frames while decoding
EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c
@@ -218,7 +202,6 @@ set_maps.SRCS += y4minput.c y4minput.h
set_maps.SRCS += tools_common.h tools_common.c
set_maps.SRCS += video_common.h
set_maps.SRCS += video_writer.h video_writer.c
set_maps.SRCS += vpx_ports/msvc.h
set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
set_maps.DESCRIPTION = Set active and ROI maps
EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c
@@ -227,7 +210,6 @@ vp8cx_set_ref.SRCS += y4minput.c y4minput.h
vp8cx_set_ref.SRCS += tools_common.h tools_common.c
vp8cx_set_ref.SRCS += video_common.h
vp8cx_set_ref.SRCS += video_writer.h video_writer.c
vp8cx_set_ref.SRCS += vpx_ports/msvc.h
vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame
@@ -251,7 +233,6 @@ vp8_multi_resolution_encoder.SRCS += ivfenc.h ivfenc.c
vp8_multi_resolution_encoder.SRCS += y4minput.c y4minput.h
vp8_multi_resolution_encoder.SRCS += tools_common.h tools_common.c
vp8_multi_resolution_encoder.SRCS += video_writer.h video_writer.c
vp8_multi_resolution_encoder.SRCS += vpx_ports/msvc.h
vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS)
vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de
vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
@@ -376,6 +357,7 @@ $(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
--ver=$$(CONFIG_VS_VERSION)\
--proj-guid=$$($$(@:.$(VCPROJ_SFX)=).GUID)\
--src-path-bare="$(SRC_PATH_BARE)" \
--as=$$(AS) \
$$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
$$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^
+1 -1
View File
@@ -109,7 +109,7 @@ int main(int argc, char **argv) {
0 };
if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
die_codec(&codec, "Failed to turn on postproc.");
};
}
// Decode the frame with 15ms deadline
if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 15000))
-123
View File
@@ -1,123 +0,0 @@
/*
* Copyright (c) 2014 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../tools_common.h"
#include "../vp9/encoder/vp9_resize.h"
static const char *exec_name = NULL;
static void usage() {
printf("Usage:\n");
printf("%s <input_yuv> <width>x<height> <target_width>x<target_height> ",
exec_name);
printf("<output_yuv> [<frames>]\n");
}
void usage_exit(void) {
usage();
exit(EXIT_FAILURE);
}
static int parse_dim(char *v, int *width, int *height) {
char *x = strchr(v, 'x');
if (x == NULL) x = strchr(v, 'X');
if (x == NULL) return 0;
*width = atoi(v);
*height = atoi(&x[1]);
if (*width <= 0 || *height <= 0)
return 0;
else
return 1;
}
int main(int argc, char *argv[]) {
char *fin, *fout;
FILE *fpin, *fpout;
uint8_t *inbuf, *outbuf;
uint8_t *inbuf_u, *outbuf_u;
uint8_t *inbuf_v, *outbuf_v;
int f, frames;
int width, height, target_width, target_height;
exec_name = argv[0];
if (argc < 5) {
printf("Incorrect parameters:\n");
usage();
return 1;
}
fin = argv[1];
fout = argv[4];
if (!parse_dim(argv[2], &width, &height)) {
printf("Incorrect parameters: %s\n", argv[2]);
usage();
return 1;
}
if (!parse_dim(argv[3], &target_width, &target_height)) {
printf("Incorrect parameters: %s\n", argv[3]);
usage();
return 1;
}
fpin = fopen(fin, "rb");
if (fpin == NULL) {
printf("Can't open file %s to read\n", fin);
usage();
return 1;
}
fpout = fopen(fout, "wb");
if (fpout == NULL) {
printf("Can't open file %s to write\n", fout);
usage();
return 1;
}
if (argc >= 6)
frames = atoi(argv[5]);
else
frames = INT_MAX;
printf("Input size: %dx%d\n", width, height);
printf("Target size: %dx%d, Frames: ", target_width, target_height);
if (frames == INT_MAX)
printf("All\n");
else
printf("%d\n", frames);
inbuf = (uint8_t *)malloc(width * height * 3 / 2);
outbuf = (uint8_t *)malloc(target_width * target_height * 3 / 2);
inbuf_u = inbuf + width * height;
inbuf_v = inbuf_u + width * height / 4;
outbuf_u = outbuf + target_width * target_height;
outbuf_v = outbuf_u + target_width * target_height / 4;
f = 0;
while (f < frames) {
if (fread(inbuf, width * height * 3 / 2, 1, fpin) != 1) break;
vp9_resize_frame420(inbuf, width, inbuf_u, inbuf_v, width / 2, height,
width, outbuf, target_width, outbuf_u, outbuf_v,
target_width / 2, target_height, target_width);
fwrite(outbuf, target_width * target_height * 3 / 2, 1, fpout);
f++;
}
printf("%d frames processed\n", f);
fclose(fpin);
fclose(fpout);
free(inbuf);
free(outbuf);
return 0;
}
+16 -16
View File
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#define VPX_DISABLE_CTRL_TYPECHECKS 1
#include "../tools_common.h"
#include "./vpx_config.h"
#include "./svc_context.h"
#include "vpx/vp8cx.h"
@@ -95,8 +96,9 @@ static const SvcInternal_t *get_const_svc_internal(const SvcContext *svc_ctx) {
return (const SvcInternal_t *)svc_ctx->internal;
}
static int svc_log(SvcContext *svc_ctx, SVC_LOG_LEVEL level, const char *fmt,
...) {
static VPX_TOOLS_FORMAT_PRINTF(3, 4) int svc_log(SvcContext *svc_ctx,
SVC_LOG_LEVEL level,
const char *fmt, ...) {
char buf[512];
int retval = 0;
va_list ap;
@@ -264,7 +266,7 @@ static vpx_codec_err_t parse_options(SvcContext *svc_ctx, const char *options) {
if (alt_ref_enabled > REF_FRAMES - svc_ctx->spatial_layers) {
svc_log(svc_ctx, SVC_LOG_ERROR,
"svc: auto alt ref: Maxinum %d(REF_FRAMES - layers) layers could"
"enabled auto alt reference frame, but % layers are enabled\n",
"enabled auto alt reference frame, but %d layers are enabled\n",
REF_FRAMES - svc_ctx->spatial_layers, alt_ref_enabled);
res = VPX_CODEC_INVALID_PARAM;
}
@@ -277,7 +279,7 @@ vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options) {
if (svc_ctx == NULL || options == NULL || si == NULL) {
return VPX_CODEC_INVALID_PARAM;
}
strncpy(si->options, options, sizeof(si->options));
strncpy(si->options, options, sizeof(si->options) - 1);
si->options[sizeof(si->options) - 1] = '\0';
return VPX_CODEC_OK;
}
@@ -379,7 +381,7 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
vpx_codec_iface_t *iface,
vpx_codec_enc_cfg_t *enc_cfg) {
vpx_codec_err_t res;
int i, sl, tl;
int sl, tl;
SvcInternal_t *const si = get_svc_internal(svc_ctx);
if (svc_ctx == NULL || codec_ctx == NULL || iface == NULL ||
enc_cfg == NULL) {
@@ -431,7 +433,7 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
}
for (tl = 0; tl < svc_ctx->temporal_layers; ++tl) {
for (sl = 0; sl < svc_ctx->spatial_layers; ++sl) {
i = sl * svc_ctx->temporal_layers + tl;
const int i = sl * svc_ctx->temporal_layers + tl;
si->svc_params.max_quantizers[i] = MAX_QUANTIZER;
si->svc_params.min_quantizers[i] = 0;
if (enc_cfg->rc_end_usage == VPX_CBR &&
@@ -456,10 +458,11 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
svc_ctx->temporal_layers = VPX_TS_MAX_LAYERS;
if (svc_ctx->temporal_layers * svc_ctx->spatial_layers > VPX_MAX_LAYERS) {
svc_log(svc_ctx, SVC_LOG_ERROR,
"spatial layers * temporal layers exceeds the maximum number of "
"allowed layers of %d\n",
svc_ctx->spatial_layers * svc_ctx->temporal_layers, VPX_MAX_LAYERS);
svc_log(
svc_ctx, SVC_LOG_ERROR,
"spatial layers * temporal layers (%d) exceeds the maximum number of "
"allowed layers of %d\n",
svc_ctx->spatial_layers * svc_ctx->temporal_layers, VPX_MAX_LAYERS);
return VPX_CODEC_INVALID_PARAM;
}
res = assign_layer_bitrates(svc_ctx, enc_cfg);
@@ -500,7 +503,7 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
for (tl = 0; tl < svc_ctx->temporal_layers; ++tl) {
for (sl = 0; sl < svc_ctx->spatial_layers; ++sl) {
i = sl * svc_ctx->temporal_layers + tl;
const int i = sl * svc_ctx->temporal_layers + tl;
if (enc_cfg->rc_end_usage == VPX_CBR &&
enc_cfg->g_pass == VPX_RC_ONE_PASS) {
si->svc_params.max_quantizers[i] = enc_cfg->rc_max_quantizer;
@@ -549,11 +552,8 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
iter = NULL;
while ((cx_pkt = vpx_codec_get_cx_data(codec_ctx, &iter))) {
switch (cx_pkt->kind) {
case VPX_CODEC_PSNR_PKT: {
}
++si->psnr_pkt_received;
break;
default: { break; }
case VPX_CODEC_PSNR_PKT: ++si->psnr_pkt_received; break;
default: break;
}
}
+2 -1
View File
@@ -84,6 +84,7 @@ static int get_frame_stats(vpx_codec_ctx_t *ctx, const vpx_image_t *img,
const uint8_t *const pkt_buf = pkt->data.twopass_stats.buf;
const size_t pkt_size = pkt->data.twopass_stats.sz;
stats->buf = realloc(stats->buf, stats->sz + pkt_size);
if (!stats->buf) die("Failed to reallocate stats buffer.");
memcpy((uint8_t *)stats->buf + stats->sz, pkt_buf, pkt_size);
stats->sz += pkt_size;
}
@@ -221,7 +222,7 @@ int main(int argc, char **argv) {
die("Invalid frame size: %dx%d", w, h);
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, w, h, 1))
die("Failed to allocate image", w, h);
die("Failed to allocate image (%dx%d)", w, h);
printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
+3 -3
View File
@@ -352,7 +352,7 @@ int main(int argc, char **argv) {
framerate = (int)strtol(argv[3], NULL, 0);
if (width < 16 || width % 2 || height < 16 || height % 2)
die("Invalid resolution: %ldx%ld", width, height);
die("Invalid resolution: %dx%d", width, height);
/* Open input video file for encoding */
if (!(infile = fopen(argv[4], "rb")))
@@ -380,7 +380,7 @@ int main(int argc, char **argv) {
(int)strtol(argv[2 * NUM_ENCODERS + 5 + i], NULL, 0);
if (num_temporal_layers[i] < 1 || num_temporal_layers[i] > 3)
die("Invalid temporal layers: %d, Must be 1, 2, or 3. \n",
num_temporal_layers);
num_temporal_layers[i]);
}
/* Open file to write out each spatially downsampled input stream. */
@@ -468,7 +468,7 @@ int main(int argc, char **argv) {
/* Allocate image for each encoder */
for (i = 0; i < NUM_ENCODERS; i++)
if (!vpx_img_alloc(&raw[i], VPX_IMG_FMT_I420, cfg[i].g_w, cfg[i].g_h, 32))
die("Failed to allocate image", cfg[i].g_w, cfg[i].g_h);
die("Failed to allocate image (%dx%d)", cfg[i].g_w, cfg[i].g_h);
if (raw[0].stride[VPX_PLANE_Y] == (int)raw[0].d_w)
read_frame_p = mulres_read_frame;
+41 -79
View File
@@ -16,6 +16,7 @@
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -32,6 +33,7 @@
#include "vp9/encoder/vp9_encoder.h"
#include "./y4minput.h"
#define OUTPUT_FRAME_STATS 0
#define OUTPUT_RC_STATS 1
#define SIMULCAST_MODE 0
@@ -66,12 +68,6 @@ static const arg_def_t kf_dist_arg =
ARG_DEF("k", "kf-dist", 1, "number of frames between keyframes");
static const arg_def_t scale_factors_arg =
ARG_DEF("r", "scale-factors", 1, "scale factors (lowest to highest layer)");
static const arg_def_t passes_arg =
ARG_DEF("p", "passes", 1, "Number of passes (1/2)");
static const arg_def_t pass_arg =
ARG_DEF(NULL, "pass", 1, "Pass to execute (1/2)");
static const arg_def_t fpf_name_arg =
ARG_DEF(NULL, "fpf", 1, "First pass statistics file name");
static const arg_def_t min_q_arg =
ARG_DEF(NULL, "min-q", 1, "Minimum quantizer");
static const arg_def_t max_q_arg =
@@ -125,9 +121,6 @@ static const arg_def_t *svc_args[] = { &frames_arg,
&spatial_layers_arg,
&kf_dist_arg,
&scale_factors_arg,
&passes_arg,
&pass_arg,
&fpf_name_arg,
&min_q_arg,
&max_q_arg,
&min_bitrate_arg,
@@ -173,8 +166,6 @@ typedef struct {
uint32_t frames_to_skip;
struct VpxInputContext input_ctx;
stats_io_t rc_stats;
int passes;
int pass;
int tune_content;
int inter_layer_pred;
} AppInput;
@@ -197,9 +188,6 @@ static void parse_command_line(int argc, const char **argv_,
char **argi = NULL;
char **argj = NULL;
vpx_codec_err_t res;
int passes = 0;
int pass = 0;
const char *fpf_file_name = NULL;
unsigned int min_bitrate = 0;
unsigned int max_bitrate = 0;
char string_options[1024] = { 0 };
@@ -236,6 +224,10 @@ static void parse_command_line(int argc, const char **argv_,
// process command line options
argv = argv_dup(argc - 1, argv_ + 1);
if (!argv) {
fprintf(stderr, "Error allocating argument list\n");
exit(EXIT_FAILURE);
}
for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) {
arg.argv_step = 1;
@@ -289,18 +281,6 @@ static void parse_command_line(int argc, const char **argv_,
sizeof(string_options) - strlen(string_options) - 1);
strncat(string_options, arg.val,
sizeof(string_options) - strlen(string_options) - 1);
} else if (arg_match(&arg, &passes_arg, argi)) {
passes = arg_parse_uint(&arg);
if (passes < 1 || passes > 2) {
die("Error: Invalid number of passes (%d)\n", passes);
}
} else if (arg_match(&arg, &pass_arg, argi)) {
pass = arg_parse_uint(&arg);
if (pass < 1 || pass > 2) {
die("Error: Invalid pass selected (%d)\n", pass);
}
} else if (arg_match(&arg, &fpf_name_arg, argi)) {
fpf_file_name = arg.val;
} else if (arg_match(&arg, &min_q_arg, argi)) {
strncat(string_options, " min-quantizers=",
sizeof(string_options) - strlen(string_options) - 1);
@@ -337,7 +317,6 @@ static void parse_command_line(int argc, const char **argv_,
break;
default:
die("Error: Invalid bit depth selected (%d)\n", enc_cfg->g_bit_depth);
break;
}
#endif // CONFIG_VP9_HIGHBITDEPTH
} else if (arg_match(&arg, &dropframe_thresh_arg, argi)) {
@@ -355,35 +334,7 @@ static void parse_command_line(int argc, const char **argv_,
if (strlen(string_options) > 0)
vpx_svc_set_options(svc_ctx, string_options + 1);
if (passes == 0 || passes == 1) {
if (pass) {
fprintf(stderr, "pass is ignored since there's only one pass\n");
}
enc_cfg->g_pass = VPX_RC_ONE_PASS;
} else {
if (pass == 0) {
die("pass must be specified when passes is 2\n");
}
if (fpf_file_name == NULL) {
die("fpf must be specified when passes is 2\n");
}
if (pass == 1) {
enc_cfg->g_pass = VPX_RC_FIRST_PASS;
if (!stats_open_file(&app_input->rc_stats, fpf_file_name, 0)) {
fatal("Failed to open statistics store");
}
} else {
enc_cfg->g_pass = VPX_RC_LAST_PASS;
if (!stats_open_file(&app_input->rc_stats, fpf_file_name, 1)) {
fatal("Failed to open statistics store");
}
enc_cfg->rc_twopass_stats_in = stats_get(&app_input->rc_stats);
}
app_input->passes = passes;
app_input->pass = pass;
}
enc_cfg->g_pass = VPX_RC_ONE_PASS;
if (enc_cfg->rc_target_bitrate > 0) {
if (min_bitrate > 0) {
@@ -411,6 +362,8 @@ static void parse_command_line(int argc, const char **argv_,
if (app_input->input_ctx.file_type == FILE_TYPE_Y4M) {
enc_cfg->g_w = app_input->input_ctx.width;
enc_cfg->g_h = app_input->input_ctx.height;
enc_cfg->g_timebase.den = app_input->input_ctx.framerate.numerator;
enc_cfg->g_timebase.num = app_input->input_ctx.framerate.denominator;
}
if (enc_cfg->g_w < 16 || enc_cfg->g_w % 2 || enc_cfg->g_h < 16 ||
@@ -633,7 +586,8 @@ static void set_frame_flags_bypass_mode_ex0(
ref_frame_config->alt_fb_idx[sl] = 0;
} else if (tl == 1) {
ref_frame_config->lst_fb_idx[sl] = sl;
ref_frame_config->gld_fb_idx[sl] = num_spatial_layers + sl - 1;
ref_frame_config->gld_fb_idx[sl] =
(sl == 0) ? 0 : num_spatial_layers + sl - 1;
ref_frame_config->alt_fb_idx[sl] = num_spatial_layers + sl;
}
// Set the reference and update flags.
@@ -828,12 +782,15 @@ static void svc_output_rc_stats(
vpx_codec_control(codec, VP9E_GET_SVC_LAYER_ID, layer_id);
parse_superframe_index(cx_pkt->data.frame.buf, cx_pkt->data.frame.sz,
sizes_parsed, &count);
if (enc_cfg->ss_number_layers == 1) sizes[0] = cx_pkt->data.frame.sz;
for (sl = 0; sl < enc_cfg->ss_number_layers; ++sl) {
sizes[sl] = 0;
if (cx_pkt->data.frame.spatial_layer_encoded[sl]) {
sizes[sl] = sizes_parsed[num_layers_encoded];
num_layers_encoded++;
if (enc_cfg->ss_number_layers == 1) {
sizes[0] = cx_pkt->data.frame.sz;
} else {
for (sl = 0; sl < enc_cfg->ss_number_layers; ++sl) {
sizes[sl] = 0;
if (cx_pkt->data.frame.spatial_layer_encoded[sl]) {
sizes[sl] = sizes_parsed[num_layers_encoded];
num_layers_encoded++;
}
}
}
for (sl = 0; sl < enc_cfg->ss_number_layers; ++sl) {
@@ -924,7 +881,9 @@ int main(int argc, const char **argv) {
int pts = 0; /* PTS starts at 0 */
int frame_duration = 1; /* 1 timebase tick per frame */
int end_of_stream = 0;
#if OUTPUT_FRAME_STATS
int frames_received = 0;
#endif
#if OUTPUT_RC_STATS
VpxVideoWriter *outfile[VPX_SS_MAX_LAYERS] = { NULL };
struct RateControlStats rc;
@@ -1001,13 +960,11 @@ int main(int argc, const char **argv) {
info.time_base.numerator = enc_cfg.g_timebase.num;
info.time_base.denominator = enc_cfg.g_timebase.den;
if (!(app_input.passes == 2 && app_input.pass == 1)) {
// We don't save the bitstream for the 1st pass on two pass rate control
writer =
vpx_video_writer_open(app_input.output_filename, kContainerIVF, &info);
if (!writer)
die("Failed to open %s for writing\n", app_input.output_filename);
}
writer =
vpx_video_writer_open(app_input.output_filename, kContainerIVF, &info);
if (!writer)
die("Failed to open %s for writing\n", app_input.output_filename);
#if OUTPUT_RC_STATS
// Write out spatial layer stream.
// TODO(marpan/jianj): allow for writing each spatial and temporal stream.
@@ -1050,6 +1007,9 @@ int main(int argc, const char **argv) {
vpx_codec_control(&encoder, VP9E_SET_TUNE_CONTENT, app_input.tune_content);
vpx_codec_control(&encoder, VP9E_SET_DISABLE_OVERSHOOT_MAXQ_CBR, 0);
vpx_codec_control(&encoder, VP9E_SET_DISABLE_LOOPFILTER, 0);
svc_drop_frame.framedrop_mode = FULL_SUPERFRAME_DROP;
for (sl = 0; sl < (unsigned int)svc_ctx.spatial_layers; ++sl)
svc_drop_frame.framedrop_thresh[sl] = enc_cfg.rc_dropframe_thresh;
@@ -1169,14 +1129,14 @@ int main(int argc, const char **argv) {
}
#endif
}
/*
#if OUTPUT_FRAME_STATS
printf("SVC frame: %d, kf: %d, size: %d, pts: %d\n", frames_received,
!!(cx_pkt->data.frame.flags & VPX_FRAME_IS_KEY),
(int)cx_pkt->data.frame.sz, (int)cx_pkt->data.frame.pts);
*/
++frames_received;
#endif
if (enc_cfg.ss_number_layers == 1 && enc_cfg.ts_number_layers == 1)
si->bytes_sum[0] += (int)cx_pkt->data.frame.sz;
++frames_received;
#if CONFIG_VP9_DECODER && !SIMULCAST_MODE
if (vpx_codec_decode(&decoder, cx_pkt->data.frame.buf,
(unsigned int)cx_pkt->data.frame.sz, NULL, 0))
@@ -1189,18 +1149,21 @@ int main(int argc, const char **argv) {
cx_pkt->data.twopass_stats.sz);
break;
}
default: { break; }
default: {
break;
}
}
#if CONFIG_VP9_DECODER && !SIMULCAST_MODE
vpx_codec_control(&encoder, VP9E_GET_SVC_LAYER_ID, &layer_id);
// Don't look for mismatch on top spatial and top temporal layers as they
// are non reference frames.
// are non reference frames. Don't look at frames whose top spatial layer
// is dropped.
if ((enc_cfg.ss_number_layers > 1 || enc_cfg.ts_number_layers > 1) &&
cx_pkt->data.frame
.spatial_layer_encoded[enc_cfg.ss_number_layers - 1] &&
!(layer_id.temporal_layer_id > 0 &&
layer_id.temporal_layer_id == (int)enc_cfg.ts_number_layers - 1 &&
cx_pkt->data.frame
.spatial_layer_encoded[enc_cfg.ss_number_layers - 1])) {
layer_id.temporal_layer_id == (int)enc_cfg.ts_number_layers - 1)) {
test_decode(&encoder, &decoder, frame_cnt, &mismatch_seen);
}
#endif
@@ -1224,7 +1187,6 @@ int main(int argc, const char **argv) {
#endif
if (vpx_codec_destroy(&encoder))
die_codec(&encoder, "Failed to destroy codec");
if (app_input.passes == 2) stats_close(&app_input.rc_stats, 1);
if (writer) {
vpx_video_writer_close(writer);
}
+1 -1
View File
@@ -60,7 +60,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr,
"Usage: %s <width> <height> <infile> <outfile> "
"<frame> <limit(optional)>\n",
+8 -3
View File
@@ -41,7 +41,7 @@
$make -j32
* Build vp9 fuzzer
$ $CXX $CXXFLAGS -std=c++11 -DDECODER=vp9 \
$ $CXX $CXXFLAGS -std=gnu++11 -DDECODER=vp9 \
-fsanitize=fuzzer -I../libvpx -I. -Wl,--start-group \
../libvpx/examples/vpx_dec_fuzzer.cc -o ./vpx_dec_fuzzer_vp9 \
./libvpx.a -Wl,--end-group
@@ -110,8 +110,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
data += IVF_FRAME_HDR_SZ;
frame_size = std::min(size, frame_size);
const vpx_codec_err_t err =
vpx_codec_decode(&codec, data, frame_size, nullptr, 0);
vpx_codec_stream_info_t stream_info;
stream_info.sz = sizeof(stream_info);
vpx_codec_err_t err = vpx_codec_peek_stream_info(VPXD_INTERFACE(DECODER),
data, size, &stream_info);
static_cast<void>(err);
err = vpx_codec_decode(&codec, data, frame_size, nullptr, 0);
static_cast<void>(err);
vpx_codec_iter_t iter = nullptr;
vpx_image_t *img = nullptr;
+98 -11
View File
@@ -30,7 +30,7 @@
#define ROI_MAP 0
#define zero(Dest) memset(&(Dest), 0, sizeof(Dest));
#define zero(Dest) memset(&(Dest), 0, sizeof(Dest))
static const char *exec_name;
@@ -240,6 +240,38 @@ static void set_roi_map(const char *enc_name, vpx_codec_enc_cfg_t *cfg,
}
}
}
static void set_roi_skip_map(vpx_codec_enc_cfg_t *cfg, vpx_roi_map_t *roi,
int *skip_map, int *prev_mask_map, int frame_num) {
const int block_size = 8;
unsigned int i, j;
roi->rows = (cfg->g_h + block_size - 1) / block_size;
roi->cols = (cfg->g_w + block_size - 1) / block_size;
zero(roi->skip);
zero(roi->delta_q);
zero(roi->delta_lf);
memset(roi->ref_frame, -1, sizeof(roi->ref_frame));
roi->ref_frame[1] = 1;
// Use segment 3 for skip.
roi->skip[3] = 1;
roi->roi_map =
(uint8_t *)calloc(roi->rows * roi->cols, sizeof(*roi->roi_map));
for (i = 0; i < roi->rows; ++i) {
for (j = 0; j < roi->cols; ++j) {
const int idx = i * roi->cols + j;
// Use segment 3 for skip.
// prev_mask_map keeps track of blocks that have been stably on segment 3
// for the past 10 frames. Only skip when the block is on segment 3 in
// both current map and prev_mask_map.
if (skip_map[idx] == 1 && prev_mask_map[idx] == 1) roi->roi_map[idx] = 3;
// Reset it every 10 frames so it doesn't propagate for too many frames.
if (frame_num % 10 == 0)
prev_mask_map[idx] = skip_map[idx];
else if (prev_mask_map[idx] == 1 && skip_map[idx] == 0)
prev_mask_map[idx] = 0;
}
}
}
#endif
// Temporal scaling parameters:
@@ -574,6 +606,23 @@ static void set_temporal_layer_pattern(int layering_mode,
}
}
#if ROI_MAP
static void read_mask(FILE *mask_file, int *seg_map) {
int mask_rows, mask_cols, i, j;
int *map_start = seg_map;
fscanf(mask_file, "%d %d\n", &mask_cols, &mask_rows);
for (i = 0; i < mask_rows; i++) {
for (j = 0; j < mask_cols; j++) {
fscanf(mask_file, "%d ", &seg_map[j]);
// reverse the bit
seg_map[j] = 1 - seg_map[j];
}
seg_map += mask_cols;
}
seg_map = map_start;
}
#endif
int main(int argc, char **argv) {
VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = { NULL };
vpx_codec_ctx_t codec;
@@ -613,7 +662,14 @@ int main(int argc, char **argv) {
double sum_bitrate = 0.0;
double sum_bitrate2 = 0.0;
double framerate = 30.0;
#if ROI_MAP
FILE *mask_file = NULL;
int block_size = 8;
int mask_rows = 0;
int mask_cols = 0;
int *mask_map;
int *prev_mask_map;
#endif
zero(rc.layer_target_bitrate);
memset(&layer_id, 0, sizeof(vpx_svc_layer_id_t));
memset(&input_ctx, 0, sizeof(input_ctx));
@@ -657,9 +713,15 @@ int main(int argc, char **argv) {
die("Invalid layering mode (0..12) %s", argv[12]);
}
#if ROI_MAP
if (argc != min_args + mode_to_num_layers[layering_mode] + 1) {
die("Invalid number of arguments");
}
#else
if (argc != min_args + mode_to_num_layers[layering_mode]) {
die("Invalid number of arguments");
}
#endif
input_ctx.filename = argv[1];
open_input_file(&input_ctx);
@@ -687,14 +749,14 @@ int main(int argc, char **argv) {
&raw,
bit_depth == VPX_BITS_8 ? VPX_IMG_FMT_I420 : VPX_IMG_FMT_I42016,
width, height, 32)) {
die("Failed to allocate image", width, height);
die("Failed to allocate image (%dx%d)", width, height);
}
}
#else
// Y4M reader has its own allocation.
if (input_ctx.file_type != FILE_TYPE_Y4M) {
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, width, height, 32)) {
die("Failed to allocate image", width, height);
die("Failed to allocate image (%dx%d)", width, height);
}
}
#endif // CONFIG_VP9_HIGHBITDEPTH
@@ -817,6 +879,13 @@ int main(int argc, char **argv) {
#endif // CONFIG_VP9_HIGHBITDEPTH
die("Failed to initialize encoder");
#if ROI_MAP
mask_rows = (cfg.g_h + block_size - 1) / block_size;
mask_cols = (cfg.g_w + block_size - 1) / block_size;
mask_map = (int *)calloc(mask_rows * mask_cols, sizeof(*mask_map));
prev_mask_map = (int *)calloc(mask_rows * mask_cols, sizeof(*mask_map));
#endif
if (strncmp(encoder->name, "vp8", 3) == 0) {
vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed);
vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, kVp8DenoiserOff);
@@ -827,10 +896,11 @@ int main(int argc, char **argv) {
if (vpx_codec_control(&codec, VP8E_SET_ROI_MAP, &roi))
die_codec(&codec, "Failed to set ROI map");
#endif
} else if (strncmp(encoder->name, "vp9", 3) == 0) {
vpx_svc_extra_cfg_t svc_params;
memset(&svc_params, 0, sizeof(svc_params));
vpx_codec_control(&codec, VP9E_SET_POSTENCODE_DROP, 0);
vpx_codec_control(&codec, VP9E_SET_DISABLE_OVERSHOOT_MAXQ_CBR, 0);
vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
vpx_codec_control(&codec, VP9E_SET_GF_CBR_BOOST_PCT, 0);
@@ -840,12 +910,8 @@ int main(int argc, char **argv) {
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0);
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, get_msb(cfg.g_threads));
#if ROI_MAP
set_roi_map(encoder->name, &cfg, &roi);
if (vpx_codec_control(&codec, VP9E_SET_ROI_MAP, &roi))
die_codec(&codec, "Failed to set ROI map");
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 0);
#endif
vpx_codec_control(&codec, VP9E_SET_DISABLE_LOOPFILTER, 0);
if (cfg.g_threads > 1)
vpx_codec_control(&codec, VP9E_SET_ROW_MT, 1);
else
@@ -878,6 +944,9 @@ int main(int argc, char **argv) {
struct vpx_usec_timer timer;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt;
#if ROI_MAP
char mask_file_name[255];
#endif
// Update the temporal layer_id. No spatial layers in this test.
layer_id.spatial_layer_id = 0;
layer_id.temporal_layer_id =
@@ -891,6 +960,19 @@ int main(int argc, char **argv) {
}
flags = layer_flags[frame_cnt % flag_periodicity];
if (layering_mode == 0) flags = 0;
#if ROI_MAP
snprintf(mask_file_name, sizeof(mask_file_name), "%s%05d.txt",
argv[argc - 1], frame_cnt);
mask_file = fopen(mask_file_name, "r");
if (mask_file != NULL) {
read_mask(mask_file, mask_map);
fclose(mask_file);
// set_roi_map(encoder->name, &cfg, &roi);
set_roi_skip_map(&cfg, &roi, mask_map, prev_mask_map, frame_cnt);
if (vpx_codec_control(&codec, VP9E_SET_ROI_MAP, &roi))
die_codec(&codec, "Failed to set ROI map");
}
#endif
frame_avail = read_frame(&input_ctx, &raw);
if (frame_avail) ++rc.layer_input_frames[layer_id.temporal_layer_id];
vpx_usec_timer_start(&timer);
@@ -928,6 +1010,7 @@ int main(int argc, char **argv) {
// Update for short-time encoding bitrate states, for moving window
// of size rc->window, shifted by rc->window / 2.
// Ignore first window segment, due to key frame.
if (rc.window_size == 0) rc.window_size = 15;
if (frame_cnt > rc.window_size) {
sum_bitrate += 0.001 * 8.0 * pkt->data.frame.sz * framerate;
if (frame_cnt % rc.window_size == 0) {
@@ -959,6 +1042,10 @@ int main(int argc, char **argv) {
++frame_cnt;
pts += frame_duration;
}
#if ROI_MAP
free(mask_map);
free(prev_mask_map);
#endif
close_input_file(&input_ctx);
printout_rate_control_summary(&rc, &cfg, frame_cnt);
printf("\n");
+8 -40
View File
@@ -654,12 +654,6 @@ VERBATIM_HEADERS = YES
ALPHABETICAL_INDEX = NO
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
@@ -1099,32 +1093,10 @@ ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and la_te_x) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
# this option is superseded by the HAVE_DOT option below. This is only a
# fallback. It is recommended to install and use dot, since it yields more
# powerful graphs.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to
# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to
# specify the directory where the mscgen tool resides. If left empty the tool is assumed to
# be found in the default search path.
MSCGEN_PATH =
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
@@ -1138,10 +1110,14 @@ HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a
# graph for each documented class showing the direct and indirect inheritance
# relations. In case HAVE_DOT is set as well dot will be used to draw the graph,
# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set
# to TEXT the direct and indirect inheritance relations will be shown as texts /
# links.
# Possible values are: NO, YES, TEXT and GRAPH.
# The default value is: YES.
CLASS_GRAPH = YES
@@ -1247,14 +1223,6 @@ DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, which results in a white background.
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
DOT_TRANSPARENT = YES
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10)
+80 -38
View File
@@ -63,6 +63,7 @@ ifeq ($(CONFIG_VP8_ENCODER),yes)
CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
INSTALL-LIBS-yes += include/vpx/vpx_ext_ratectrl.h
INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
CODEC_DOC_SECTIONS += vp8 vp8_encoder
endif
@@ -87,18 +88,34 @@ ifeq ($(CONFIG_VP9_ENCODER),yes)
CODEC_SRCS-yes += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_CX_SRCS))
CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_CX_EXPORTS))
CODEC_SRCS-yes += $(VP9_PREFIX)vp9cx.mk vpx/vp8.h vpx/vp8cx.h
CODEC_SRCS-yes += vpx/vpx_ext_ratectrl.h
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
INSTALL-LIBS-yes += include/vpx/vpx_ext_ratectrl.h
INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/%
CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h vpx/vpx_ext_ratectrl.h
CODEC_DOC_SECTIONS += vp9 vp9_encoder
endif
RC_RTC_SRCS := $(addprefix $(VP9_PREFIX),$(call enabled,VP9_CX_SRCS))
RC_RTC_SRCS += $(VP9_PREFIX)vp9cx.mk vpx/vp8.h vpx/vp8cx.h
RC_RTC_SRCS := vpx/vp8.h vpx/vp8cx.h
RC_RTC_SRCS += vpx/vpx_ext_ratectrl.h
RC_RTC_SRCS += vpx/internal/vpx_ratectrl_rtc.h
ifeq ($(CONFIG_VP9_ENCODER),yes)
VP9_PREFIX=vp9/
RC_RTC_SRCS += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_CX_SRCS))
RC_RTC_SRCS += $(VP9_PREFIX)vp9cx.mk
RC_RTC_SRCS += $(VP9_PREFIX)ratectrl_rtc.cc
RC_RTC_SRCS += $(VP9_PREFIX)ratectrl_rtc.h
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP9_PREFIX)ratectrl_rtc.cc
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP9_PREFIX)ratectrl_rtc.h
endif
ifeq ($(CONFIG_VP8_ENCODER),yes)
VP8_PREFIX=vp8/
RC_RTC_SRCS += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
RC_RTC_SRCS += $(VP8_PREFIX)vp8_ratectrl_rtc.cc
RC_RTC_SRCS += $(VP8_PREFIX)vp8_ratectrl_rtc.h
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP8_PREFIX)vp8_ratectrl_rtc.cc
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP8_PREFIX)vp8_ratectrl_rtc.h
endif
ifeq ($(CONFIG_VP9_DECODER),yes)
VP9_PREFIX=vp9/
@@ -122,7 +139,7 @@ endif
ifeq ($(CONFIG_MSVS),yes)
CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
GTEST_LIB=$(if $(CONFIG_STATIC_MSVCRT),gtestmt,gtestmd)
RC_RTC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vp9rcmt,vp9rcmd)
RC_RTC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxrcmt,vpxrcmd)
# This variable uses deferred expansion intentionally, since the results of
# $(wildcard) may change during the course of the Make.
VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
@@ -161,6 +178,7 @@ INSTALL-LIBS-yes += include/vpx/vpx_image.h
INSTALL-LIBS-yes += include/vpx/vpx_integer.h
INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_tpl.h
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
ifeq ($(CONFIG_MSVS),yes)
INSTALL-LIBS-yes += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB).lib)
@@ -228,6 +246,7 @@ vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def
--ver=$(CONFIG_VS_VERSION) \
--src-path-bare="$(SRC_PATH_BARE)" \
--out=$@ $(CFLAGS) \
--as=$(AS) \
$(filter $(SRC_PATH_BARE)/vp8/%.c, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vp8/%.h, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vp9/%.c, $(VCPROJ_SRCS)) \
@@ -244,20 +263,21 @@ PROJECTS-yes += vpx.$(VCPROJ_SFX)
vpx.$(VCPROJ_SFX): vpx_config.asm
vpx.$(VCPROJ_SFX): $(RTCD)
vp9rc.$(VCPROJ_SFX): \
vpxrc.$(VCPROJ_SFX): \
VCPROJ_SRCS=$(filter-out $(addprefix %, $(ASM_INCLUDES)), $^)
vp9rc.$(VCPROJ_SFX): $(RC_RTC_SRCS)
vpxrc.$(VCPROJ_SFX): $(RC_RTC_SRCS)
@echo " [CREATE] $@"
$(qexec)$(GEN_VCPROJ) \
$(if $(CONFIG_SHARED),--dll,--lib) \
--target=$(TOOLCHAIN) \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--name=vp9rc \
--name=vpxrc \
--proj-guid=C26FF952-9494-4838-9A3F-7F3D4F613385 \
--ver=$(CONFIG_VS_VERSION) \
--src-path-bare="$(SRC_PATH_BARE)" \
--out=$@ $(CFLAGS) \
--as=$(AS) \
$(filter $(SRC_PATH_BARE)/vp9/%.c, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vp9/%.cc, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vp9/%.h, $(VCPROJ_SRCS)) \
@@ -269,10 +289,10 @@ vp9rc.$(VCPROJ_SFX): $(RC_RTC_SRCS)
$(VCPROJ_SRCS)) \
--src-path-bare="$(SRC_PATH_BARE)" \
PROJECTS-yes += vp9rc.$(VCPROJ_SFX)
PROJECTS-yes += vpxrc.$(VCPROJ_SFX)
vp9rc.$(VCPROJ_SFX): vpx_config.asm
vp9rc.$(VCPROJ_SFX): $(RTCD)
vpxrc.$(VCPROJ_SFX): vpx_config.asm
vpxrc.$(VCPROJ_SFX): $(RTCD)
endif # ifeq ($(CONFIG_MSVS),yes)
else # ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
@@ -281,8 +301,20 @@ OBJS-yes += $(LIBVPX_OBJS)
LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
$(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
SO_VERSION_MAJOR := 6
SO_VERSION_MINOR := 3
# Updating version info.
# https://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
# For libtool: c=<current>, a=<age>, r=<revision>
# libtool generates .so file as .so.[c-a].a.r, while -version-info c:r:a is
# passed to libtool.
#
# libvpx library file is generated as libvpx.so.<MAJOR>.<MINOR>.<PATCH>
# MAJOR = c-a, MINOR = a, PATCH = r
#
# To determine SO_VERSION_{MAJOR,MINOR,PATCH}, calculate c,a,r with current
# SO_VERSION_* then follow the rules in the link to detemine the new version
# (c1, a1, r1) and set MAJOR to [c1-a1], MINOR to a1 and PATCH to r1
SO_VERSION_MAJOR := 11
SO_VERSION_MINOR := 0
SO_VERSION_PATCH := 0
ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
LIBVPX_SO := libvpx.$(SO_VERSION_MAJOR).dylib
@@ -380,12 +412,11 @@ INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
CLEAN-OBJS += vpx.pc
ifeq ($(CONFIG_VP9_ENCODER),yes)
RC_RTC_OBJS=$(call objs,$(RC_RTC_SRCS))
ifeq ($(CONFIG_ENCODERS),yes)
RC_RTC_OBJS=$(call objs,$(RC_RTC_SRCS))
OBJS-yes += $(RC_RTC_OBJS)
LIBS-yes += $(BUILD_PFX)libvp9rc.a $(BUILD_PFX)libvp9rc_g.a
$(BUILD_PFX)libvp9rc_g.a: $(RC_RTC_OBJS)
LIBS-yes += $(BUILD_PFX)libvpxrc.a $(BUILD_PFX)libvpxrc_g.a
$(BUILD_PFX)libvpxrc_g.a: $(RC_RTC_OBJS)
endif
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_RATE_CTRL),yesyes)
@@ -416,13 +447,13 @@ ifeq ($(VPX_ARCH_X86)$(VPX_ARCH_X86_64),yes)
# YASM
$(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
@echo " [CREATE] $@"
@egrep "#define [A-Z0-9_]+ [01]" $< \
@LC_ALL=C grep -E "#define [A-Z0-9_]+ [01]" $< \
| awk '{print $$2 " equ " $$3}' > $@
else
ADS2GAS=$(if $(filter yes,$(CONFIG_GCC)),| $(ASM_CONVERSION))
$(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
@echo " [CREATE] $@"
@egrep "#define [A-Z0-9_]+ [01]" $< \
@LC_ALL=C grep -E "#define [A-Z0-9_]+ [01]" $< \
| awk '{print $$2 " EQU " $$3}' $(ADS2GAS) > $@
@echo " END" $(ADS2GAS) >> $@
CLEAN-OBJS += $(BUILD_PFX)vpx_config.asm
@@ -475,10 +506,12 @@ TEST_INTRA_PRED_SPEED_SRCS=$(call addprefix_clean,test/,\
$(call enabled,TEST_INTRA_PRED_SPEED_SRCS))
TEST_INTRA_PRED_SPEED_OBJS := $(sort $(call objs,$(TEST_INTRA_PRED_SPEED_SRCS)))
ifeq ($(CONFIG_ENCODERS),yes)
RC_INTERFACE_TEST_BIN=./test_rc_interface$(EXE_SFX)
RC_INTERFACE_TEST_SRCS=$(call addprefix_clean,test/,\
$(call enabled,RC_INTERFACE_TEST_SRCS))
RC_INTERFACE_TEST_OBJS := $(sort $(call objs,$(RC_INTERFACE_TEST_SRCS)))
endif
SIMPLE_ENCODE_TEST_BIN=./test_simple_encode$(EXE_SFX)
SIMPLE_ENCODE_TEST_SRCS=$(call addprefix_clean,test/,\
@@ -490,20 +523,21 @@ libvpx_test_srcs.txt:
@echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
CLEAN-OBJS += libvpx_test_srcs.txt
# Attempt to download the file using curl, retrying once if it fails for a
# partial file (18).
$(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1
@echo " [DOWNLOAD] $@"
# Attempt to download the file using curl, retrying once if it fails for a
# partial file (18).
$(qexec)( \
trap 'rm -f $@' INT TERM; \
curl="curl --retry 1 -L -o $@ $(call libvpx_test_data_url,$(@F))"; \
$$curl; \
case "$$?" in \
18) $$curl -C -;; \
curl="curl -S -s --retry 1 -L -o $@ $(call libvpx_test_data_url,$(@F))"; \
$$curl; ret=$$?; \
case "$$ret" in \
18) $$curl -C - ;; \
*) exit $$ret ;; \
esac \
)
testdata:: $(LIBVPX_TEST_DATA)
testdata: $(LIBVPX_TEST_DATA)
$(qexec)[ -x "$$(which sha1sum)" ] && sha1sum=sha1sum;\
[ -x "$$(which shasum)" ] && sha1sum=shasum;\
[ -x "$$(which sha1)" ] && sha1sum=sha1;\
@@ -512,7 +546,7 @@ testdata:: $(LIBVPX_TEST_DATA)
echo "Checking test data:";\
for f in $(call enabled,LIBVPX_TEST_DATA); do\
grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
(cd $(LIBVPX_TEST_DATA_PATH); $${sha1sum} -c);\
(cd "$(LIBVPX_TEST_DATA_PATH)"; $${sha1sum} -c);\
done; \
else\
echo "Skipping test data integrity check, sha1sum not found.";\
@@ -531,6 +565,7 @@ gtest.$(VCPROJ_SFX): $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.c
--proj-guid=EC00E1EC-AF68-4D92-A255-181690D1C9B1 \
--ver=$(CONFIG_VS_VERSION) \
--src-path-bare="$(SRC_PATH_BARE)" \
--as=$(AS) \
-D_VARIADIC_MAX=10 \
--out=gtest.$(VCPROJ_SFX) $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" -I"$(SRC_PATH_BARE)/third_party/googletest/src"
@@ -547,6 +582,7 @@ test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_
--proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
--ver=$(CONFIG_VS_VERSION) \
--src-path-bare="$(SRC_PATH_BARE)" \
--as=$(AS) \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
@@ -569,16 +605,18 @@ test_intra_pred_speed.$(VCPROJ_SFX): $(TEST_INTRA_PRED_SPEED_SRCS) vpx.$(VCPROJ_
--proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
--ver=$(CONFIG_VS_VERSION) \
--src-path-bare="$(SRC_PATH_BARE)" \
--as=$(AS) \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
-L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
endif # TEST_INTRA_PRED_SPEED
ifeq ($(CONFIG_ENCODERS),yes)
ifneq ($(strip $(RC_INTERFACE_TEST_OBJS)),)
PROJECTS-$(CONFIG_MSVS) += test_rc_interface.$(VCPROJ_SFX)
test_rc_interface.$(VCPROJ_SFX): $(RC_INTERFACE_TEST_SRCS) vpx.$(VCPROJ_SFX) \
vp9rc.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
vpxrc.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
@echo " [CREATE] $@"
$(qexec)$(GEN_VCPROJ) \
--exe \
@@ -587,13 +625,15 @@ test_rc_interface.$(VCPROJ_SFX): $(RC_INTERFACE_TEST_SRCS) vpx.$(VCPROJ_SFX) \
-D_VARIADIC_MAX=10 \
--proj-guid=30458F88-1BC6-4689-B41C-50F3737AAB27 \
--ver=$(CONFIG_VS_VERSION) \
--as=$(AS) \
--src-path-bare="$(SRC_PATH_BARE)" \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
-L. -l$(CODEC_LIB) -l$(RC_RTC_LIB) -l$(GTEST_LIB) $^
endif # RC_INTERFACE_TEST
endif
endif # CONFIG_ENCODERS
endif # CONFIG_MSVS
else
include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk
@@ -634,17 +674,19 @@ $(eval $(call linkerxx_template,$(TEST_INTRA_PRED_SPEED_BIN), \
-L. -lvpx -lgtest $(extralibs) -lm))
endif # TEST_INTRA_PRED_SPEED
ifeq ($(CONFIG_ENCODERS),yes)
ifneq ($(strip $(RC_INTERFACE_TEST_OBJS)),)
$(RC_INTERFACE_TEST_OBJS) $(RC_INTERFACE_TEST_OBJS:.o=.d): \
CXXFLAGS += $(GTEST_INCLUDES)
OBJS-yes += $(RC_INTERFACE_TEST_OBJS)
BINS-yes += $(RC_INTERFACE_TEST_BIN)
$(RC_INTERFACE_TEST_BIN): $(TEST_LIBS) libvp9rc.a
$(RC_INTERFACE_TEST_BIN): $(TEST_LIBS) libvpxrc.a
$(eval $(call linkerxx_template,$(RC_INTERFACE_TEST_BIN), \
$(RC_INTERFACE_TEST_OBJS) \
-L. -lvpx -lgtest -lvp9rc $(extralibs) -lm))
-L. -lvpx -lgtest -lvpxrc $(extralibs) -lm))
endif # RC_INTERFACE_TEST
endif # CONFIG_ENCODERS
ifneq ($(strip $(SIMPLE_ENCODE_TEST_OBJS)),)
$(SIMPLE_ENCODE_TEST_OBJS) $(SIMPLE_ENCODE_TEST_OBJS:.o=.d): \
@@ -658,7 +700,7 @@ $(eval $(call linkerxx_template,$(SIMPLE_ENCODE_TEST_BIN), \
-L. -lsimple_encode -lvpx -lgtest $(extralibs) -lm))
endif # SIMPLE_ENCODE_TEST
endif # CONFIG_UNIT_TESTS
endif # CONFIG_EXTERNAL_BUILD
# Install test sources only if codec source is included
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
@@ -668,22 +710,22 @@ INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(TEST_INTRA_PRED_SPEED_SRCS)
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(RC_INTERFACE_TEST_SRCS)
define test_shard_template
test:: test_shard.$(1)
test-no-data-check:: test_shard_ndc.$(1)
test: test_shard.$(1)
test-no-data-check: test_shard_ndc.$(1)
test_shard.$(1) test_shard_ndc.$(1): $(LIBVPX_TEST_BIN)
@set -e; \
export GTEST_SHARD_INDEX=$(1); \
export GTEST_TOTAL_SHARDS=$(2); \
$(LIBVPX_TEST_BIN)
test_shard.$(1): testdata
.PHONY: test_shard.$(1)
.PHONY: test_shard.$(1) test_shard_ndc.$(1)
endef
NUM_SHARDS := 10
SHARDS := 0 1 2 3 4 5 6 7 8 9
$(foreach s,$(SHARDS),$(eval $(call test_shard_template,$(s),$(NUM_SHARDS))))
endif
endif # CONFIG_UNIT_TESTS
##
## documentation directives
@@ -723,10 +765,10 @@ TEST_BIN_PATH := $(addsuffix /$(TGT_OS:win64=x64)/Release, $(TEST_BIN_PATH))
endif
utiltest utiltest-no-data-check:
$(qexec)$(SRC_PATH_BARE)/test/vpxdec.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \
--test-data-path "$(LIBVPX_TEST_DATA_PATH)" \
--bin-path $(TEST_BIN_PATH)
$(qexec)$(SRC_PATH_BARE)/test/vpxenc.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \
--test-data-path "$(LIBVPX_TEST_DATA_PATH)" \
--bin-path $(TEST_BIN_PATH)
utiltest: testdata
else
@@ -750,7 +792,7 @@ EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release
endif
exampletest exampletest-no-data-check: examples
$(qexec)$(SRC_PATH_BARE)/test/examples.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \
--test-data-path "$(LIBVPX_TEST_DATA_PATH)" \
--bin-path $(EXAMPLES_BIN_PATH)
exampletest: testdata
else
+2 -2
View File
@@ -151,8 +151,8 @@ void MD5Final(md5byte digest[16], struct MD5Context *ctx) {
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
VPX_NO_UNSIGNED_OVERFLOW_CHECK void MD5Transform(UWORD32 buf[4],
UWORD32 const in[16]) {
VPX_NO_UNSIGNED_OVERFLOW_CHECK VPX_NO_UNSIGNED_SHIFT_CHECK void MD5Transform(
UWORD32 buf[4], UWORD32 const in[16]) {
UWORD32 a, b, c, d;
a = buf[0];
+25 -20
View File
@@ -9,10 +9,11 @@
*/
#include <assert.h>
#include <stdlib.h>
#include <limits.h>
#include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "./rate_hist.h"
@@ -48,7 +49,8 @@ struct rate_hist *init_rate_histogram(const vpx_codec_enc_cfg_t *cfg,
// Determine the number of samples in the buffer. Use the file's framerate
// to determine the number of frames in rc_buf_sz milliseconds, with an
// adjustment (5/4) to account for alt-refs
hist->samples = cfg->rc_buf_sz * 5 / 4 * fps->num / fps->den / 1000;
hist->samples =
(int)((int64_t)cfg->rc_buf_sz * 5 / 4 * fps->num / fps->den / 1000);
// prevent division by zero
if (hist->samples == 0) hist->samples = 1;
@@ -193,40 +195,42 @@ static int merge_hist_buckets(struct hist_bucket *bucket, int max_buckets,
static void show_histogram(const struct hist_bucket *bucket, int buckets,
int total, int scale) {
const char *pat1, *pat2;
int width1, width2;
int i;
if (!buckets) return;
assert(bucket != NULL);
assert(buckets > 0);
switch ((int)(log(bucket[buckets - 1].high) / log(10)) + 1) {
case 1:
case 2:
pat1 = "%4d %2s: ";
pat2 = "%4d-%2d: ";
width1 = 4;
width2 = 2;
break;
case 3:
pat1 = "%5d %3s: ";
pat2 = "%5d-%3d: ";
width1 = 5;
width2 = 3;
break;
case 4:
pat1 = "%6d %4s: ";
pat2 = "%6d-%4d: ";
width1 = 6;
width2 = 4;
break;
case 5:
pat1 = "%7d %5s: ";
pat2 = "%7d-%5d: ";
width1 = 7;
width2 = 5;
break;
case 6:
pat1 = "%8d %6s: ";
pat2 = "%8d-%6d: ";
width1 = 8;
width2 = 6;
break;
case 7:
pat1 = "%9d %7s: ";
pat2 = "%9d-%7d: ";
width1 = 9;
width2 = 7;
break;
default:
pat1 = "%12d %10s: ";
pat2 = "%12d-%10d: ";
width1 = 12;
width2 = 10;
break;
}
@@ -241,9 +245,10 @@ static void show_histogram(const struct hist_bucket *bucket, int buckets,
assert(len <= HIST_BAR_MAX);
if (bucket[i].low == bucket[i].high)
fprintf(stderr, pat1, bucket[i].low, "");
fprintf(stderr, "%*d %*s: ", width1, bucket[i].low, width2, "");
else
fprintf(stderr, pat2, bucket[i].low, bucket[i].high);
fprintf(stderr, "%*d-%*d: ", width1, bucket[i].low, width2,
bucket[i].high);
for (j = 0; j < HIST_BAR_MAX; j++) fprintf(stderr, j < len ? "=" : " ");
fprintf(stderr, "\t%5d (%6.2f%%)\n", bucket[i].count, pct);
+12 -17
View File
@@ -15,7 +15,7 @@
#include <limits>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "vpx/vpx_integer.h"
@@ -28,43 +28,38 @@ class ACMRandom {
explicit ACMRandom(int seed) : random_(seed) {}
void Reset(int seed) { random_.Reseed(seed); }
uint16_t Rand16(void) {
uint16_t Rand16() {
const uint32_t value =
random_.Generate(testing::internal::Random::kMaxRange);
return (value >> 15) & 0xffff;
}
int32_t Rand20Signed(void) {
int32_t Rand20Signed() {
// Use 20 bits: values between 524287 and -524288.
const uint32_t value = random_.Generate(1048576);
return static_cast<int32_t>(value) - 524288;
}
int16_t Rand16Signed(void) {
int16_t Rand16Signed() {
// Use 16 bits: values between 32767 and -32768.
return static_cast<int16_t>(random_.Generate(65536));
}
int16_t Rand13Signed(void) {
// Use 13 bits: values between 4095 and -4096.
const uint32_t value = random_.Generate(8192);
return static_cast<int16_t>(value) - 4096;
uint16_t Rand12() {
const uint32_t value =
random_.Generate(testing::internal::Random::kMaxRange);
// There's a bit more entropy in the upper bits of this implementation.
return (value >> 19) & 0xfff;
}
int16_t Rand9Signed(void) {
// Use 9 bits: values between 255 (0x0FF) and -256 (0x100).
const uint32_t value = random_.Generate(512);
return static_cast<int16_t>(value) - 256;
}
uint8_t Rand8(void) {
uint8_t Rand8() {
const uint32_t value =
random_.Generate(testing::internal::Random::kMaxRange);
// There's a bit more entropy in the upper bits of this implementation.
return (value >> 23) & 0xff;
}
uint8_t Rand8Extremes(void) {
uint8_t Rand8Extremes() {
// Returns a random value near 0 or near 255, to better exercise
// saturation behavior.
const uint8_t r = Rand8();
@@ -82,7 +77,7 @@ class ACMRandom {
int operator()(int n) { return PseudoUniform(n); }
static int DeterministicSeed(void) { return 0xbaba; }
static int DeterministicSeed() { return 0xbaba; }
private:
testing::internal::Random random_;
+6 -6
View File
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <algorithm>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/util.h"
@@ -62,16 +62,16 @@ class ActiveMapRefreshTest
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
ActiveMapRefreshTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~ActiveMapRefreshTest() {}
~ActiveMapRefreshTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(GET_PARAM(1));
cpu_used_ = GET_PARAM(2);
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
::libvpx_test::Y4mVideoSource *y4m_video =
static_cast<libvpx_test::Y4mVideoSource *>(video);
if (video->frame() == 0) {
@@ -80,7 +80,7 @@ class ActiveMapRefreshTest
} else if (video->frame() >= 2 && video->img()) {
vpx_image_t *current = video->img();
vpx_image_t *previous = y4m_holder_->img();
ASSERT_TRUE(previous != NULL);
ASSERT_NE(previous, nullptr);
vpx_active_map_t map = vpx_active_map_t();
const int width = static_cast<int>(current->d_w);
const int height = static_cast<int>(current->d_h);
+10 -8
View File
@@ -9,7 +9,7 @@
*/
#include <climits>
#include <vector>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
@@ -19,24 +19,26 @@ namespace {
class ActiveMapTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
public ::libvpx_test::CodecTestWith3Params<libvpx_test::TestMode, int,
int> {
protected:
static const int kWidth = 208;
static const int kHeight = 144;
ActiveMapTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~ActiveMapTest() {}
~ActiveMapTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(GET_PARAM(1));
cpu_used_ = GET_PARAM(2);
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
encoder->Control(VP9E_SET_AQ_MODE, GET_PARAM(3));
} else if (video->frame() == 3) {
vpx_active_map_t map = vpx_active_map_t();
/* clang-format off */
@@ -62,7 +64,7 @@ class ActiveMapTest
vpx_active_map_t map = vpx_active_map_t();
map.cols = (kWidth + 15) / 16;
map.rows = (kHeight + 15) / 16;
map.active_map = NULL;
map.active_map = nullptr;
encoder->Control(VP8E_SET_ACTIVEMAP, &map);
}
}
@@ -87,5 +89,5 @@ TEST_P(ActiveMapTest, Test) {
VP9_INSTANTIATE_TEST_SUITE(ActiveMapTest,
::testing::Values(::libvpx_test::kRealTime),
::testing::Range(0, 9));
::testing::Range(5, 10), ::testing::Values(0, 3));
} // namespace
+7 -7
View File
@@ -10,12 +10,13 @@
#include <math.h>
#include <tuple>
#include "gtest/gtest.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_dsp_rtcd.h"
#include "vpx/vpx_integer.h"
#include "vpx_config.h"
#include "vpx_dsp/postproc.h"
#include "vpx_mem/vpx_mem.h"
@@ -23,7 +24,6 @@ namespace {
static const int kNoiseSize = 3072;
// TODO(jimbankoski): make width and height integers not unsigned.
typedef void (*AddNoiseFunc)(uint8_t *start, const int8_t *noise,
int blackclamp, int whiteclamp, int width,
int height, int pitch);
@@ -33,8 +33,8 @@ typedef std::tuple<double, AddNoiseFunc> AddNoiseTestFPParam;
class AddNoiseTest : public ::testing::Test,
public ::testing::WithParamInterface<AddNoiseTestFPParam> {
public:
virtual void TearDown() { libvpx_test::ClearSystemState(); }
virtual ~AddNoiseTest() {}
void TearDown() override { libvpx_test::ClearSystemState(); }
~AddNoiseTest() override = default;
};
double stddev6(char a, char b, char c, char d, char e, char f) {
@@ -53,7 +53,7 @@ TEST_P(AddNoiseTest, CheckNoiseAdded) {
const int clamp = vpx_setup_noise(GET_PARAM(0), noise, kNoiseSize);
uint8_t *const s =
reinterpret_cast<uint8_t *>(vpx_calloc(image_size, sizeof(*s)));
ASSERT_TRUE(s != NULL);
ASSERT_NE(s, nullptr);
memset(s, 99, image_size * sizeof(*s));
ASM_REGISTER_STATE_CHECK(
@@ -106,8 +106,8 @@ TEST_P(AddNoiseTest, CheckCvsAssembly) {
uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
uint8_t *const d = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
ASSERT_TRUE(s != NULL);
ASSERT_TRUE(d != NULL);
ASSERT_NE(s, nullptr);
ASSERT_NE(d, nullptr);
memset(s, 99, image_size);
memset(d, 99, image_size);
+5 -5
View File
@@ -7,7 +7,7 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
@@ -20,9 +20,9 @@ class AltRefAqSegmentTest
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
AltRefAqSegmentTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~AltRefAqSegmentTest() {}
~AltRefAqSegmentTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(GET_PARAM(1));
set_cpu_used_ = GET_PARAM(2);
@@ -30,8 +30,8 @@ class AltRefAqSegmentTest
alt_ref_aq_mode_ = 0;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
encoder->Control(VP9E_SET_ALT_REF_AQ, alt_ref_aq_mode_);
+13 -12
View File
@@ -7,11 +7,12 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
#include "vpx_config.h"
namespace {
#if CONFIG_VP8_ENCODER
@@ -24,24 +25,24 @@ class AltRefTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<int> {
protected:
AltRefTest() : EncoderTest(GET_PARAM(0)), altref_count_(0) {}
virtual ~AltRefTest() {}
~AltRefTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(libvpx_test::kTwoPassGood);
}
virtual void BeginPassHook(unsigned int /*pass*/) { altref_count_ = 0; }
void BeginPassHook(unsigned int /*pass*/) override { altref_count_ = 0; }
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
encoder->Control(VP8E_SET_CPUUSED, 3);
}
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
void FramePktHook(const vpx_codec_cx_pkt_t *pkt) override {
if (pkt->data.frame.flags & VPX_FRAME_IS_INVISIBLE) ++altref_count_;
}
@@ -75,17 +76,17 @@ class AltRefForcedKeyTestLarge
AltRefForcedKeyTestLarge()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
cpu_used_(GET_PARAM(2)), forced_kf_frame_num_(1), frame_num_(0) {}
virtual ~AltRefForcedKeyTestLarge() {}
~AltRefForcedKeyTestLarge() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(encoding_mode_);
cfg_.rc_end_usage = VPX_VBR;
cfg_.g_threads = 0;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
@@ -100,7 +101,7 @@ class AltRefForcedKeyTestLarge
(video->frame() == forced_kf_frame_num_) ? VPX_EFLAG_FORCE_KF : 0;
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
void FramePktHook(const vpx_codec_cx_pkt_t *pkt) override {
if (frame_num_ == forced_kf_frame_num_) {
ASSERT_TRUE(!!(pkt->data.frame.flags & VPX_FRAME_IS_KEY))
<< "Frame #" << frame_num_ << " isn't a keyframe!";
+10
View File
@@ -10,6 +10,9 @@
# The test app itself runs on the command line through adb shell
# The paths are really messed up as the libvpx make file
# expects to be made from a parent directory.
# Ignore this file during non-NDK builds.
ifdef NDK_ROOT
CUR_WD := $(call my-dir)
BINDINGS_DIR := $(CUR_WD)/../../..
LOCAL_PATH := $(CUR_WD)/../../..
@@ -34,6 +37,9 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/third_party/googletest/src/
LOCAL_C_INCLUDES += $(LOCAL_PATH)/third_party/googletest/src/include/
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/third_party/googletest/src/include/
LOCAL_SRC_FILES := ./third_party/googletest/src/src/gtest-all.cc
LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
LOCAL_LICENSE_CONDITIONS := notice
LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE $(LOCAL_PATH)/../../PATENTS
include $(BUILD_STATIC_LIBRARY)
#libvpx_test
@@ -48,6 +54,9 @@ else
LOCAL_STATIC_LIBRARIES += vpx
endif
LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
LOCAL_LICENSE_CONDITIONS := notice
LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE $(LOCAL_PATH)/../../PATENTS
include $(LOCAL_PATH)/test/test.mk
LOCAL_C_INCLUDES := $(BINDINGS_DIR)
FILTERED_SRC := $(sort $(filter %.cc %.c, $(LIBVPX_TEST_SRCS-yes)))
@@ -55,3 +64,4 @@ LOCAL_SRC_FILES := $(addprefix ./test/, $(FILTERED_SRC))
# some test files depend on *_rtcd.h, ensure they're generated first.
$(eval $(call rtcd_dep_template))
include $(BUILD_EXECUTABLE)
endif # NDK_ROOT
+1 -1
View File
@@ -16,7 +16,7 @@ Note: Both adb and ndk-build are available at:
3) Run get_files.py to download the test files:
python get_files.py -i /path/to/test-data.sha1 -o /path/to/put/files \
-u http://downloads.webmproject.org/test_data/libvpx
-u https://storage.googleapis.com/downloads.webmproject.org/test_data/libvpx
4) Transfer files to device using adb. Ensure you have proper permissions for
the target
+9 -8
View File
@@ -38,7 +38,7 @@ def get_file_sha(filename):
buf = file.read(HASH_CHUNK)
return sha_hash.hexdigest()
except IOError:
print "Error reading " + filename
print("Error reading " + filename)
# Downloads a file from a url, and then checks the sha against the passed
# in sha
@@ -67,7 +67,7 @@ try:
getopt.getopt(sys.argv[1:], \
"u:i:o:", ["url=", "input_csv=", "output_dir="])
except:
print 'get_files.py -u <url> -i <input_csv> -o <output_dir>'
print('get_files.py -u <url> -i <input_csv> -o <output_dir>')
sys.exit(2)
for opt, arg in opts:
@@ -79,7 +79,7 @@ for opt, arg in opts:
local_resource_path = os.path.join(arg)
if len(sys.argv) != 7:
print "Expects two paths and a url!"
print("Expects two paths and a url!")
exit(1)
if not os.path.isdir(local_resource_path):
@@ -89,7 +89,7 @@ file_list_csv = open(file_list_path, "rb")
# Our 'csv' file uses multiple spaces as a delimiter, python's
# csv class only uses single character delimiters, so we convert them below
file_list_reader = csv.reader((re.sub(' +', ' ', line) \
file_list_reader = csv.reader((re.sub(' +', ' ', line.decode('utf-8')) \
for line in file_list_csv), delimiter = ' ')
file_shas = []
@@ -104,15 +104,16 @@ for row in file_list_reader:
file_list_csv.close()
# Download files, only if they don't already exist and have correct shas
for filename, sha in itertools.izip(file_names, file_shas):
for filename, sha in zip(file_names, file_shas):
filename = filename.lstrip('*')
path = os.path.join(local_resource_path, filename)
if os.path.isfile(path) \
and get_file_sha(path) == sha:
print path + ' exists, skipping'
print(path + ' exists, skipping')
continue
for retry in range(0, ftp_retries):
print "Downloading " + path
print("Downloading " + path)
if not download_and_check_sha(url, filename, sha):
print "Sha does not match, retrying..."
print("Sha does not match, retrying...")
else:
break
+5 -5
View File
@@ -7,7 +7,7 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
@@ -20,17 +20,17 @@ class AqSegmentTest
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
AqSegmentTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~AqSegmentTest() {}
~AqSegmentTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(GET_PARAM(1));
set_cpu_used_ = GET_PARAM(2);
aq_mode_ = 0;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
encoder->Control(VP9E_SET_AQ_MODE, aq_mode_);
+58 -29
View File
@@ -13,7 +13,7 @@
#include <string.h>
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_config.h"
@@ -35,12 +35,12 @@ template <typename Pixel>
class AverageTestBase : public ::testing::Test {
public:
AverageTestBase(int width, int height)
: width_(width), height_(height), source_data_(NULL), source_stride_(0),
bit_depth_(8) {}
: width_(width), height_(height), source_data_(nullptr),
source_stride_(0), bit_depth_(8) {}
virtual void TearDown() {
void TearDown() override {
vpx_free(source_data_);
source_data_ = NULL;
source_data_ = nullptr;
libvpx_test::ClearSystemState();
}
@@ -49,10 +49,10 @@ class AverageTestBase : public ::testing::Test {
static const int kDataAlignment = 16;
static const int kDataBlockSize = 64 * 128;
virtual void SetUp() {
void SetUp() override {
source_data_ = reinterpret_cast<Pixel *>(
vpx_memalign(kDataAlignment, kDataBlockSize * sizeof(source_data_[0])));
ASSERT_TRUE(source_data_ != NULL);
ASSERT_NE(source_data_, nullptr);
source_stride_ = (width_ + 31) & ~31;
bit_depth_ = 8;
rnd_.Reset(ACMRandom::DeterministicSeed());
@@ -152,6 +152,7 @@ class AverageTestHBD : public AverageTestBase<uint16_t>,
};
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON || HAVE_SSE2 || HAVE_MSA
typedef void (*IntProRowFunc)(int16_t hbuf[16], uint8_t const *ref,
const int ref_stride, const int height);
@@ -161,16 +162,17 @@ class IntProRowTest : public AverageTestBase<uint8_t>,
public ::testing::WithParamInterface<IntProRowParam> {
public:
IntProRowTest()
: AverageTestBase(16, GET_PARAM(0)), hbuf_asm_(NULL), hbuf_c_(NULL) {
: AverageTestBase(16, GET_PARAM(0)), hbuf_asm_(nullptr),
hbuf_c_(nullptr) {
asm_func_ = GET_PARAM(1);
c_func_ = GET_PARAM(2);
}
protected:
virtual void SetUp() {
void SetUp() override {
source_data_ = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBlockSize * sizeof(source_data_[0])));
ASSERT_TRUE(source_data_ != NULL);
ASSERT_NE(source_data_, nullptr);
hbuf_asm_ = reinterpret_cast<int16_t *>(
vpx_memalign(kDataAlignment, sizeof(*hbuf_asm_) * 16));
@@ -178,18 +180,19 @@ class IntProRowTest : public AverageTestBase<uint8_t>,
vpx_memalign(kDataAlignment, sizeof(*hbuf_c_) * 16));
}
virtual void TearDown() {
void TearDown() override {
vpx_free(source_data_);
source_data_ = NULL;
source_data_ = nullptr;
vpx_free(hbuf_c_);
hbuf_c_ = NULL;
hbuf_c_ = nullptr;
vpx_free(hbuf_asm_);
hbuf_asm_ = NULL;
hbuf_asm_ = nullptr;
}
void RunComparison() {
ASM_REGISTER_STATE_CHECK(c_func_(hbuf_c_, source_data_, 0, height_));
ASM_REGISTER_STATE_CHECK(asm_func_(hbuf_asm_, source_data_, 0, height_));
ASM_REGISTER_STATE_CHECK(c_func_(hbuf_c_, source_data_, width_, height_));
ASM_REGISTER_STATE_CHECK(
asm_func_(hbuf_asm_, source_data_, width_, height_));
EXPECT_EQ(0, memcmp(hbuf_c_, hbuf_asm_, sizeof(*hbuf_c_) * 16))
<< "Output mismatch";
}
@@ -200,6 +203,7 @@ class IntProRowTest : public AverageTestBase<uint8_t>,
int16_t *hbuf_asm_;
int16_t *hbuf_c_;
};
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(IntProRowTest);
typedef int16_t (*IntProColFunc)(uint8_t const *ref, const int width);
@@ -226,6 +230,8 @@ class IntProColTest : public AverageTestBase<uint8_t>,
int16_t sum_asm_;
int16_t sum_c_;
};
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(IntProColTest);
#endif // HAVE_NEON || HAVE_SSE2 || HAVE_MSA
typedef int (*SatdFunc)(const tran_low_t *coeffs, int length);
typedef std::tuple<int, SatdFunc> SatdTestParam;
@@ -233,16 +239,16 @@ typedef std::tuple<int, SatdFunc> SatdTestParam;
class SatdTest : public ::testing::Test,
public ::testing::WithParamInterface<SatdTestParam> {
protected:
virtual void SetUp() {
void SetUp() override {
satd_size_ = GET_PARAM(0);
satd_func_ = GET_PARAM(1);
rnd_.Reset(ACMRandom::DeterministicSeed());
src_ = reinterpret_cast<tran_low_t *>(
vpx_memalign(16, sizeof(*src_) * satd_size_));
ASSERT_TRUE(src_ != NULL);
ASSERT_NE(src_, nullptr);
}
virtual void TearDown() {
void TearDown() override {
libvpx_test::ClearSystemState();
vpx_free(src_);
}
@@ -271,7 +277,7 @@ class SatdTest : public ::testing::Test,
class SatdLowbdTest : public SatdTest {
protected:
virtual void FillRandom() {
void FillRandom() override {
for (int i = 0; i < satd_size_; ++i) {
const int16_t tmp = rnd_.Rand16Signed();
src_[i] = (tran_low_t)tmp;
@@ -287,7 +293,7 @@ class BlockErrorTestFP
: public ::testing::Test,
public ::testing::WithParamInterface<BlockErrorTestFPParam> {
protected:
virtual void SetUp() {
void SetUp() override {
txfm_size_ = GET_PARAM(0);
block_error_func_ = GET_PARAM(1);
rnd_.Reset(ACMRandom::DeterministicSeed());
@@ -295,11 +301,11 @@ class BlockErrorTestFP
vpx_memalign(16, sizeof(*coeff_) * txfm_size_));
dqcoeff_ = reinterpret_cast<tran_low_t *>(
vpx_memalign(16, sizeof(*dqcoeff_) * txfm_size_));
ASSERT_TRUE(coeff_ != NULL);
ASSERT_TRUE(dqcoeff_ != NULL);
ASSERT_NE(coeff_, nullptr);
ASSERT_NE(dqcoeff_, nullptr);
}
virtual void TearDown() {
void TearDown() override {
libvpx_test::ClearSystemState();
vpx_free(coeff_);
vpx_free(dqcoeff_);
@@ -378,6 +384,7 @@ TEST_P(AverageTestHBD, Random) {
}
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON || HAVE_SSE2 || HAVE_MSA
TEST_P(IntProRowTest, MinValue) {
FillConstant(0);
RunComparison();
@@ -407,6 +414,7 @@ TEST_P(IntProColTest, Random) {
FillRandom();
RunComparison();
}
#endif
TEST_P(SatdLowbdTest, MinValue) {
const int kMin = -32640;
@@ -456,7 +464,7 @@ TEST_P(SatdLowbdTest, DISABLED_Speed) {
#if CONFIG_VP9_HIGHBITDEPTH
class SatdHighbdTest : public SatdTest {
protected:
virtual void FillRandom() {
void FillRandom() override {
for (int i = 0; i < satd_size_; ++i) {
src_[i] = rnd_.Rand20Signed();
}
@@ -575,6 +583,13 @@ INSTANTIATE_TEST_SUITE_P(
make_tuple(16, 16, 1, 4, &vpx_highbd_avg_4x4_sse2)));
#endif // HAVE_SSE2
#if HAVE_NEON
INSTANTIATE_TEST_SUITE_P(
NEON, AverageTestHBD,
::testing::Values(make_tuple(16, 16, 1, 8, &vpx_highbd_avg_8x8_neon),
make_tuple(16, 16, 1, 4, &vpx_highbd_avg_4x4_neon)));
#endif // HAVE_NEON
INSTANTIATE_TEST_SUITE_P(C, SatdHighbdTest,
::testing::Values(make_tuple(16, &vpx_satd_c),
make_tuple(64, &vpx_satd_c),
@@ -687,18 +702,32 @@ INSTANTIATE_TEST_SUITE_P(NEON, SatdLowbdTest,
make_tuple(256, &vpx_satd_neon),
make_tuple(1024, &vpx_satd_neon)));
// TODO(jianj): Remove the highbitdepth flag once the SIMD functions are
// in place.
#if !CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_SUITE_P(
NEON, SatdHighbdTest,
::testing::Values(make_tuple(16, &vpx_highbd_satd_neon),
make_tuple(64, &vpx_highbd_satd_neon),
make_tuple(256, &vpx_highbd_satd_neon),
make_tuple(1024, &vpx_highbd_satd_neon)));
#endif // CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_SUITE_P(
NEON, BlockErrorTestFP,
::testing::Values(make_tuple(16, &vp9_block_error_fp_neon),
make_tuple(64, &vp9_block_error_fp_neon),
make_tuple(256, &vp9_block_error_fp_neon),
make_tuple(1024, &vp9_block_error_fp_neon)));
#endif // !CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_NEON
#if HAVE_SVE
INSTANTIATE_TEST_SUITE_P(
SVE, BlockErrorTestFP,
::testing::Values(make_tuple(16, &vp9_block_error_fp_sve),
make_tuple(64, &vp9_block_error_fp_sve),
make_tuple(256, &vp9_block_error_fp_sve),
make_tuple(1024, &vp9_block_error_fp_sve)));
#endif // HAVE_SVE
#if HAVE_MSA
INSTANTIATE_TEST_SUITE_P(
MSA, AverageTest,
+1
View File
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <algorithm>
#include <cstdlib>
#include "test/bench.h"
#include "vpx_ports/vpx_timer.h"
+2
View File
@@ -16,6 +16,8 @@
class AbstractBench {
public:
virtual ~AbstractBench() = default;
void RunNTimes(int n);
void PrintMedian(const char *title);
+7 -7
View File
@@ -13,7 +13,7 @@
#include <string.h>
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP9_ENCODER
@@ -44,19 +44,19 @@ class BlockinessTestBase : public ::testing::Test {
static void TearDownTestSuite() {
vpx_free(source_data_);
source_data_ = NULL;
source_data_ = nullptr;
vpx_free(reference_data_);
reference_data_ = NULL;
reference_data_ = nullptr;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
void TearDown() override { libvpx_test::ClearSystemState(); }
protected:
// Handle frames up to 640x480
static const int kDataAlignment = 16;
static const int kDataBufferSize = 640 * 480;
virtual void SetUp() {
void SetUp() override {
source_stride_ = (width_ + 31) & ~31;
reference_stride_ = width_ * 2;
rnd_.Reset(ACMRandom::DeterministicSeed());
@@ -154,8 +154,8 @@ class BlockinessVP9Test
};
#endif // CONFIG_VP9_ENCODER
uint8_t *BlockinessTestBase::source_data_ = NULL;
uint8_t *BlockinessTestBase::reference_data_ = NULL;
uint8_t *BlockinessTestBase::source_data_ = nullptr;
uint8_t *BlockinessTestBase::reference_data_ = nullptr;
#if CONFIG_VP9_ENCODER
TEST_P(BlockinessVP9Test, SourceBlockierThanReference) {
+12 -6
View File
@@ -9,11 +9,12 @@
*/
#include <climits>
#include <vector>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
#include "vpx_config.h"
namespace {
@@ -22,15 +23,15 @@ class BordersTest
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
BordersTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~BordersTest() {}
~BordersTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(GET_PARAM(1));
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, 1);
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
@@ -40,7 +41,7 @@ class BordersTest
}
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
void FramePktHook(const vpx_codec_cx_pkt_t *pkt) override {
if (pkt->data.frame.flags & VPX_FRAME_IS_KEY) {
}
}
@@ -79,6 +80,11 @@ TEST_P(BordersTest, TestLowBitrate) {
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
#if CONFIG_REALTIME_ONLY
VP9_INSTANTIATE_TEST_SUITE(BordersTest,
::testing::Values(::libvpx_test::kRealTime));
#else
VP9_INSTANTIATE_TEST_SUITE(BordersTest,
::testing::Values(::libvpx_test::kTwoPassGood));
#endif
} // namespace
+8 -8
View File
@@ -15,7 +15,7 @@
#include <limits>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/acm_random.h"
#include "vpx/vpx_integer.h"
@@ -31,7 +31,7 @@ class Buffer {
: width_(width), height_(height), top_padding_(top_padding),
left_padding_(left_padding), right_padding_(right_padding),
bottom_padding_(bottom_padding), alignment_(0), padding_value_(0),
stride_(0), raw_size_(0), num_elements_(0), raw_buffer_(NULL) {}
stride_(0), raw_size_(0), num_elements_(0), raw_buffer_(nullptr) {}
Buffer(int width, int height, int top_padding, int left_padding,
int right_padding, int bottom_padding, unsigned int alignment)
@@ -39,19 +39,19 @@ class Buffer {
left_padding_(left_padding), right_padding_(right_padding),
bottom_padding_(bottom_padding), alignment_(alignment),
padding_value_(0), stride_(0), raw_size_(0), num_elements_(0),
raw_buffer_(NULL) {}
raw_buffer_(nullptr) {}
Buffer(int width, int height, int padding)
: width_(width), height_(height), top_padding_(padding),
left_padding_(padding), right_padding_(padding),
bottom_padding_(padding), alignment_(0), padding_value_(0), stride_(0),
raw_size_(0), num_elements_(0), raw_buffer_(NULL) {}
raw_size_(0), num_elements_(0), raw_buffer_(nullptr) {}
Buffer(int width, int height, int padding, unsigned int alignment)
: width_(width), height_(height), top_padding_(padding),
left_padding_(padding), right_padding_(padding),
bottom_padding_(padding), alignment_(alignment), padding_value_(0),
stride_(0), raw_size_(0), num_elements_(0), raw_buffer_(NULL) {}
stride_(0), raw_size_(0), num_elements_(0), raw_buffer_(nullptr) {}
~Buffer() {
if (alignment_) {
@@ -103,7 +103,7 @@ class Buffer {
bool CheckValues(const Buffer<T> &a) const;
bool Init() {
if (raw_buffer_ != NULL) return false;
if (raw_buffer_ != nullptr) return false;
EXPECT_GT(width_, 0);
EXPECT_GT(height_, 0);
EXPECT_GE(top_padding_, 0);
@@ -126,7 +126,7 @@ class Buffer {
} else {
raw_buffer_ = new (std::nothrow) T[num_elements_];
}
EXPECT_TRUE(raw_buffer_ != NULL);
EXPECT_NE(raw_buffer_, nullptr);
SetPadding(std::numeric_limits<T>::max());
return !::testing::Test::HasFailure();
}
@@ -150,7 +150,7 @@ class Buffer {
template <typename T>
T *Buffer<T>::TopLeftPixel() const {
if (!raw_buffer_) return NULL;
if (!raw_buffer_) return nullptr;
return raw_buffer_ + (top_padding_ * stride_) + left_padding_;
}
+11 -10
View File
@@ -55,23 +55,24 @@ const ByteAlignmentTestParam kBaTestParams[] = {
class ByteAlignmentTest
: public ::testing::TestWithParam<ByteAlignmentTestParam> {
protected:
ByteAlignmentTest() : video_(NULL), decoder_(NULL), md5_file_(NULL) {}
ByteAlignmentTest()
: video_(nullptr), decoder_(nullptr), md5_file_(nullptr) {}
virtual void SetUp() {
void SetUp() override {
video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
ASSERT_TRUE(video_ != NULL);
ASSERT_NE(video_, nullptr);
video_->Init();
video_->Begin();
const vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
decoder_ = new libvpx_test::VP9Decoder(cfg, 0);
ASSERT_TRUE(decoder_ != NULL);
ASSERT_NE(decoder_, nullptr);
OpenMd5File(kVP9Md5File);
}
virtual void TearDown() {
if (md5_file_ != NULL) fclose(md5_file_);
void TearDown() override {
if (md5_file_ != nullptr) fclose(md5_file_);
delete decoder_;
delete video_;
@@ -90,7 +91,7 @@ class ByteAlignmentTest
}
vpx_codec_err_t DecodeRemainingFrames(int byte_alignment_to_check) {
for (; video_->cxdata() != NULL; video_->Next()) {
for (; video_->cxdata() != nullptr; video_->Next()) {
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
if (res != VPX_CODEC_OK) return res;
@@ -113,7 +114,7 @@ class ByteAlignmentTest
const vpx_image_t *img;
// Get decompressed data
while ((img = dec_iter.Next()) != NULL) {
while ((img = dec_iter.Next()) != nullptr) {
if (byte_alignment_to_check == kLegacyByteAlignment) {
CheckByteAlignment(img->planes[0], kLegacyYPlaneByteAlignment);
} else {
@@ -128,12 +129,12 @@ class ByteAlignmentTest
// TODO(fgalligan): Move the MD5 testing code into another class.
void OpenMd5File(const std::string &md5_file_name_) {
md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
ASSERT_TRUE(md5_file_ != NULL)
ASSERT_NE(md5_file_, nullptr)
<< "MD5 file open failed. Filename: " << md5_file_name_;
}
void CheckMd5(const vpx_image_t &img) {
ASSERT_TRUE(md5_file_ != NULL);
ASSERT_NE(md5_file_, nullptr);
char expected_md5[33];
char junk[128];
+37 -35
View File
@@ -40,7 +40,7 @@ class CodecFactory {
const vpx_codec_flags_t flags) const = 0;
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
vpx_enc_deadline_t deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const = 0;
@@ -84,27 +84,27 @@ class VP8Decoder : public Decoder {
: Decoder(cfg, flag) {}
protected:
virtual vpx_codec_iface_t *CodecInterface() const {
vpx_codec_iface_t *CodecInterface() const override {
#if CONFIG_VP8_DECODER
return &vpx_codec_vp8_dx_algo;
#else
return NULL;
return nullptr;
#endif
}
};
class VP8Encoder : public Encoder {
public:
VP8Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline,
VP8Encoder(vpx_codec_enc_cfg_t cfg, vpx_enc_deadline_t deadline,
const unsigned long init_flags, TwopassStatsStore *stats)
: Encoder(cfg, deadline, init_flags, stats) {}
protected:
virtual vpx_codec_iface_t *CodecInterface() const {
vpx_codec_iface_t *CodecInterface() const override {
#if CONFIG_VP8_ENCODER
return &vpx_codec_vp8_cx_algo;
#else
return NULL;
return nullptr;
#endif
}
};
@@ -113,25 +113,24 @@ class VP8CodecFactory : public CodecFactory {
public:
VP8CodecFactory() : CodecFactory() {}
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const {
Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const override {
return CreateDecoder(cfg, 0);
}
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags) const {
Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags) const override {
#if CONFIG_VP8_DECODER
return new VP8Decoder(cfg, flags);
#else
(void)cfg;
(void)flags;
return NULL;
return nullptr;
#endif
}
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const {
Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg, vpx_enc_deadline_t deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const override {
#if CONFIG_VP8_ENCODER
return new VP8Encoder(cfg, deadline, init_flags, stats);
#else
@@ -139,12 +138,12 @@ class VP8CodecFactory : public CodecFactory {
(void)deadline;
(void)init_flags;
(void)stats;
return NULL;
return nullptr;
#endif
}
virtual vpx_codec_err_t DefaultEncoderConfig(vpx_codec_enc_cfg_t *cfg,
int usage) const {
vpx_codec_err_t DefaultEncoderConfig(vpx_codec_enc_cfg_t *cfg,
int usage) const override {
#if CONFIG_VP8_ENCODER
return vpx_codec_enc_config_default(&vpx_codec_vp8_cx_algo, cfg, usage);
#else
@@ -165,7 +164,9 @@ const libvpx_test::VP8CodecFactory kVP8;
&libvpx_test::kVP8)), \
__VA_ARGS__))
#else
#define VP8_INSTANTIATE_TEST_SUITE(test, ...)
// static_assert() is used to avoid warnings about an extra ';' outside of a
// function.
#define VP8_INSTANTIATE_TEST_SUITE(test, ...) static_assert(CONFIG_VP8 == 0, "")
#endif // CONFIG_VP8
/*
@@ -180,27 +181,27 @@ class VP9Decoder : public Decoder {
: Decoder(cfg, flag) {}
protected:
virtual vpx_codec_iface_t *CodecInterface() const {
vpx_codec_iface_t *CodecInterface() const override {
#if CONFIG_VP9_DECODER
return &vpx_codec_vp9_dx_algo;
#else
return NULL;
return nullptr;
#endif
}
};
class VP9Encoder : public Encoder {
public:
VP9Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline,
VP9Encoder(vpx_codec_enc_cfg_t cfg, vpx_enc_deadline_t deadline,
const unsigned long init_flags, TwopassStatsStore *stats)
: Encoder(cfg, deadline, init_flags, stats) {}
protected:
virtual vpx_codec_iface_t *CodecInterface() const {
vpx_codec_iface_t *CodecInterface() const override {
#if CONFIG_VP9_ENCODER
return &vpx_codec_vp9_cx_algo;
#else
return NULL;
return nullptr;
#endif
}
};
@@ -209,25 +210,24 @@ class VP9CodecFactory : public CodecFactory {
public:
VP9CodecFactory() : CodecFactory() {}
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const {
Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const override {
return CreateDecoder(cfg, 0);
}
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags) const {
Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags) const override {
#if CONFIG_VP9_DECODER
return new VP9Decoder(cfg, flags);
#else
(void)cfg;
(void)flags;
return NULL;
return nullptr;
#endif
}
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const {
Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg, vpx_enc_deadline_t deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const override {
#if CONFIG_VP9_ENCODER
return new VP9Encoder(cfg, deadline, init_flags, stats);
#else
@@ -235,12 +235,12 @@ class VP9CodecFactory : public CodecFactory {
(void)deadline;
(void)init_flags;
(void)stats;
return NULL;
return nullptr;
#endif
}
virtual vpx_codec_err_t DefaultEncoderConfig(vpx_codec_enc_cfg_t *cfg,
int usage) const {
vpx_codec_err_t DefaultEncoderConfig(vpx_codec_enc_cfg_t *cfg,
int usage) const override {
#if CONFIG_VP9_ENCODER
return vpx_codec_enc_config_default(&vpx_codec_vp9_cx_algo, cfg, usage);
#else
@@ -261,7 +261,9 @@ const libvpx_test::VP9CodecFactory kVP9;
&libvpx_test::kVP9)), \
__VA_ARGS__))
#else
#define VP9_INSTANTIATE_TEST_SUITE(test, ...)
// static_assert() is used to avoid warnings about an extra ';' outside of a
// function.
#define VP9_INSTANTIATE_TEST_SUITE(test, ...) static_assert(CONFIG_VP9 == 0, "")
#endif // CONFIG_VP9
} // namespace libvpx_test
+143 -53
View File
@@ -8,13 +8,14 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/buffer.h"
#include "test/register_state_check.h"
#include "vpx_config.h"
#include "vpx_ports/vpx_timer.h"
namespace {
@@ -22,42 +23,51 @@ namespace {
using ::libvpx_test::ACMRandom;
using ::libvpx_test::Buffer;
typedef void (*AvgPredFunc)(uint8_t *a, const uint8_t *b, int w, int h,
const uint8_t *c, int c_stride);
template <typename Pixel>
Pixel avg_with_rounding(Pixel a, Pixel b) {
return (a + b + 1) >> 1;
}
uint8_t avg_with_rounding(uint8_t a, uint8_t b) { return (a + b + 1) >> 1; }
void reference_pred(const Buffer<uint8_t> &pred, const Buffer<uint8_t> &ref,
int width, int height, Buffer<uint8_t> *avg) {
ASSERT_TRUE(avg->TopLeftPixel() != NULL);
ASSERT_TRUE(pred.TopLeftPixel() != NULL);
ASSERT_TRUE(ref.TopLeftPixel() != NULL);
template <typename Pixel>
void reference_pred(const Buffer<Pixel> &pred, const Buffer<Pixel> &ref,
int width, int height, Buffer<Pixel> *avg) {
ASSERT_NE(avg->TopLeftPixel(), nullptr);
ASSERT_NE(pred.TopLeftPixel(), nullptr);
ASSERT_NE(ref.TopLeftPixel(), nullptr);
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
avg->TopLeftPixel()[y * avg->stride() + x] =
avg_with_rounding(pred.TopLeftPixel()[y * pred.stride() + x],
ref.TopLeftPixel()[y * ref.stride() + x]);
avg_with_rounding<Pixel>(pred.TopLeftPixel()[y * pred.stride() + x],
ref.TopLeftPixel()[y * ref.stride() + x]);
}
}
}
using AvgPredFunc = void (*)(uint8_t *a, const uint8_t *b, int w, int h,
const uint8_t *c, int c_stride);
template <int bitdepth, typename Pixel>
class AvgPredTest : public ::testing::TestWithParam<AvgPredFunc> {
public:
virtual void SetUp() {
void SetUp() override {
avg_pred_func_ = GetParam();
rnd_.Reset(ACMRandom::DeterministicSeed());
}
void TestSizeCombinations();
void TestCompareReferenceRandom();
void TestSpeed();
protected:
AvgPredFunc avg_pred_func_;
ACMRandom rnd_;
};
TEST_P(AvgPredTest, SizeCombinations) {
template <int bitdepth, typename Pixel>
void AvgPredTest<bitdepth, Pixel>::TestSizeCombinations() {
// This is called as part of the sub pixel variance. As such it must be one of
// the variance block sizes.
for (int width_pow = 2; width_pow <= 6; ++width_pow) {
for (int height_pow = width_pow - 1; height_pow <= width_pow + 1;
++height_pow) {
@@ -70,23 +80,30 @@ TEST_P(AvgPredTest, SizeCombinations) {
const int width = 1 << width_pow;
const int height = 1 << height_pow;
// Only the reference buffer may have a stride not equal to width.
Buffer<uint8_t> ref =
Buffer<uint8_t>(width, height, ref_padding ? 8 : 0);
Buffer<Pixel> ref = Buffer<Pixel>(width, height, ref_padding ? 8 : 0);
ASSERT_TRUE(ref.Init());
Buffer<uint8_t> pred = Buffer<uint8_t>(width, height, 0, 16);
Buffer<Pixel> pred = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(pred.Init());
Buffer<uint8_t> avg_ref = Buffer<uint8_t>(width, height, 0, 16);
Buffer<Pixel> avg_ref = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(avg_ref.Init());
Buffer<uint8_t> avg_chk = Buffer<uint8_t>(width, height, 0, 16);
Buffer<Pixel> avg_chk = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(avg_chk.Init());
const int bitdepth_mask = (1 << bitdepth) - 1;
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
ref.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
}
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
pred.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
}
ref.Set(&rnd_, &ACMRandom::Rand8);
pred.Set(&rnd_, &ACMRandom::Rand8);
reference_pred(pred, ref, width, height, &avg_ref);
ASM_REGISTER_STATE_CHECK(
avg_pred_func_(avg_chk.TopLeftPixel(), pred.TopLeftPixel(), width,
height, ref.TopLeftPixel(), ref.stride()));
reference_pred<Pixel>(pred, ref, width, height, &avg_ref);
ASM_REGISTER_STATE_CHECK(avg_pred_func_(
(uint8_t *)avg_chk.TopLeftPixel(), (uint8_t *)pred.TopLeftPixel(),
width, height, (uint8_t *)ref.TopLeftPixel(), ref.stride()));
EXPECT_TRUE(avg_chk.CheckValues(avg_ref));
if (HasFailure()) {
@@ -99,26 +116,36 @@ TEST_P(AvgPredTest, SizeCombinations) {
}
}
TEST_P(AvgPredTest, CompareReferenceRandom) {
template <int bitdepth, typename Pixel>
void AvgPredTest<bitdepth, Pixel>::TestCompareReferenceRandom() {
const int width = 64;
const int height = 32;
Buffer<uint8_t> ref = Buffer<uint8_t>(width, height, 8);
Buffer<Pixel> ref = Buffer<Pixel>(width, height, 8);
ASSERT_TRUE(ref.Init());
Buffer<uint8_t> pred = Buffer<uint8_t>(width, height, 0, 16);
Buffer<Pixel> pred = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(pred.Init());
Buffer<uint8_t> avg_ref = Buffer<uint8_t>(width, height, 0, 16);
Buffer<Pixel> avg_ref = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(avg_ref.Init());
Buffer<uint8_t> avg_chk = Buffer<uint8_t>(width, height, 0, 16);
Buffer<Pixel> avg_chk = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(avg_chk.Init());
for (int i = 0; i < 500; ++i) {
ref.Set(&rnd_, &ACMRandom::Rand8);
pred.Set(&rnd_, &ACMRandom::Rand8);
const int bitdepth_mask = (1 << bitdepth) - 1;
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
ref.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
}
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
pred.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
}
reference_pred(pred, ref, width, height, &avg_ref);
ASM_REGISTER_STATE_CHECK(avg_pred_func_(avg_chk.TopLeftPixel(),
pred.TopLeftPixel(), width, height,
ref.TopLeftPixel(), ref.stride()));
reference_pred<Pixel>(pred, ref, width, height, &avg_ref);
ASM_REGISTER_STATE_CHECK(avg_pred_func_(
(uint8_t *)avg_chk.TopLeftPixel(), (uint8_t *)pred.TopLeftPixel(),
width, height, (uint8_t *)ref.TopLeftPixel(), ref.stride()));
EXPECT_TRUE(avg_chk.CheckValues(avg_ref));
if (HasFailure()) {
printf("Width: %d Height: %d\n", width, height);
@@ -128,7 +155,8 @@ TEST_P(AvgPredTest, CompareReferenceRandom) {
}
}
TEST_P(AvgPredTest, DISABLED_Speed) {
template <int bitdepth, typename Pixel>
void AvgPredTest<bitdepth, Pixel>::TestSpeed() {
for (int width_pow = 2; width_pow <= 6; ++width_pow) {
for (int height_pow = width_pow - 1; height_pow <= width_pow + 1;
++height_pow) {
@@ -138,22 +166,30 @@ TEST_P(AvgPredTest, DISABLED_Speed) {
for (int ref_padding = 0; ref_padding < 2; ref_padding++) {
const int width = 1 << width_pow;
const int height = 1 << height_pow;
Buffer<uint8_t> ref =
Buffer<uint8_t>(width, height, ref_padding ? 8 : 0);
Buffer<Pixel> ref = Buffer<Pixel>(width, height, ref_padding ? 8 : 0);
ASSERT_TRUE(ref.Init());
Buffer<uint8_t> pred = Buffer<uint8_t>(width, height, 0, 16);
Buffer<Pixel> pred = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(pred.Init());
Buffer<uint8_t> avg = Buffer<uint8_t>(width, height, 0, 16);
Buffer<Pixel> avg = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(avg.Init());
ref.Set(&rnd_, &ACMRandom::Rand8);
pred.Set(&rnd_, &ACMRandom::Rand8);
const int bitdepth_mask = (1 << bitdepth) - 1;
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
ref.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
}
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
pred.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
}
vpx_usec_timer timer;
vpx_usec_timer_start(&timer);
for (int i = 0; i < 10000000 / (width * height); ++i) {
avg_pred_func_(avg.TopLeftPixel(), pred.TopLeftPixel(), width, height,
ref.TopLeftPixel(), ref.stride());
for (int i = 0; i < 100000000 / (width * height); ++i) {
avg_pred_func_((uint8_t *)avg.TopLeftPixel(),
(uint8_t *)pred.TopLeftPixel(), width, height,
(uint8_t *)ref.TopLeftPixel(), ref.stride());
}
vpx_usec_timer_mark(&timer);
@@ -166,21 +202,75 @@ TEST_P(AvgPredTest, DISABLED_Speed) {
}
}
INSTANTIATE_TEST_SUITE_P(C, AvgPredTest,
using AvgPredTestLBD = AvgPredTest<8, uint8_t>;
TEST_P(AvgPredTestLBD, SizeCombinations) { TestSizeCombinations(); }
TEST_P(AvgPredTestLBD, CompareReferenceRandom) { TestCompareReferenceRandom(); }
TEST_P(AvgPredTestLBD, DISABLED_Speed) { TestSpeed(); }
INSTANTIATE_TEST_SUITE_P(C, AvgPredTestLBD,
::testing::Values(&vpx_comp_avg_pred_c));
#if HAVE_SSE2
INSTANTIATE_TEST_SUITE_P(SSE2, AvgPredTest,
INSTANTIATE_TEST_SUITE_P(SSE2, AvgPredTestLBD,
::testing::Values(&vpx_comp_avg_pred_sse2));
#endif // HAVE_SSE2
#if HAVE_AVX2
INSTANTIATE_TEST_SUITE_P(AVX2, AvgPredTestLBD,
::testing::Values(&vpx_comp_avg_pred_avx2));
#endif // HAVE_AVX2
#if HAVE_NEON
INSTANTIATE_TEST_SUITE_P(NEON, AvgPredTest,
INSTANTIATE_TEST_SUITE_P(NEON, AvgPredTestLBD,
::testing::Values(&vpx_comp_avg_pred_neon));
#endif // HAVE_NEON
#if HAVE_VSX
INSTANTIATE_TEST_SUITE_P(VSX, AvgPredTest,
INSTANTIATE_TEST_SUITE_P(VSX, AvgPredTestLBD,
::testing::Values(&vpx_comp_avg_pred_vsx));
#endif // HAVE_VSX
#if HAVE_LSX
INSTANTIATE_TEST_SUITE_P(LSX, AvgPredTestLBD,
::testing::Values(&vpx_comp_avg_pred_lsx));
#endif // HAVE_LSX
#if CONFIG_VP9_HIGHBITDEPTH
using HighbdAvgPredFunc = void (*)(uint16_t *a, const uint16_t *b, int w, int h,
const uint16_t *c, int c_stride);
template <HighbdAvgPredFunc fn>
void highbd_wrapper(uint8_t *a, const uint8_t *b, int w, int h,
const uint8_t *c, int c_stride) {
fn((uint16_t *)a, (const uint16_t *)b, w, h, (const uint16_t *)c, c_stride);
}
using AvgPredTestHBD = AvgPredTest<12, uint16_t>;
TEST_P(AvgPredTestHBD, SizeCombinations) { TestSizeCombinations(); }
TEST_P(AvgPredTestHBD, CompareReferenceRandom) { TestCompareReferenceRandom(); }
TEST_P(AvgPredTestHBD, DISABLED_Speed) { TestSpeed(); }
INSTANTIATE_TEST_SUITE_P(
C, AvgPredTestHBD,
::testing::Values(&highbd_wrapper<vpx_highbd_comp_avg_pred_c>));
#if HAVE_SSE2
INSTANTIATE_TEST_SUITE_P(
SSE2, AvgPredTestHBD,
::testing::Values(&highbd_wrapper<vpx_highbd_comp_avg_pred_sse2>));
#endif // HAVE_SSE2
#if HAVE_NEON
INSTANTIATE_TEST_SUITE_P(
NEON, AvgPredTestHBD,
::testing::Values(&highbd_wrapper<vpx_highbd_comp_avg_pred_neon>));
#endif // HAVE_NEON
#endif // CONFIG_VP9_HIGHBITDEPTH
} // namespace
+6 -6
View File
@@ -7,7 +7,7 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/util.h"
@@ -22,24 +22,24 @@ class ConfigTest
ConfigTest()
: EncoderTest(GET_PARAM(0)), frame_count_in_(0), frame_count_out_(0),
frame_count_max_(0) {}
virtual ~ConfigTest() {}
~ConfigTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(GET_PARAM(1));
}
virtual void BeginPassHook(unsigned int /*pass*/) {
void BeginPassHook(unsigned int /*pass*/) override {
frame_count_in_ = 0;
frame_count_out_ = 0;
}
virtual void PreEncodeFrameHook(libvpx_test::VideoSource * /*video*/) {
void PreEncodeFrameHook(libvpx_test::VideoSource * /*video*/) override {
++frame_count_in_;
abort_ |= (frame_count_in_ >= frame_count_max_);
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {
void FramePktHook(const vpx_codec_cx_pkt_t * /*pkt*/) override {
++frame_count_out_;
}
+10 -10
View File
@@ -13,7 +13,7 @@
#include <string.h>
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP9_ENCODER
@@ -54,25 +54,25 @@ class ConsistencyTestBase : public ::testing::Test {
static void ClearSsim() { memset(ssim_array_, 0, kDataBufferSize / 16); }
static void TearDownTestSuite() {
vpx_free(source_data_[0]);
source_data_[0] = NULL;
source_data_[0] = nullptr;
vpx_free(reference_data_[0]);
reference_data_[0] = NULL;
reference_data_[0] = nullptr;
vpx_free(source_data_[1]);
source_data_[1] = NULL;
source_data_[1] = nullptr;
vpx_free(reference_data_[1]);
reference_data_[1] = NULL;
reference_data_[1] = nullptr;
delete[] ssim_array_;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
void TearDown() override { libvpx_test::ClearSystemState(); }
protected:
// Handle frames up to 640x480
static const int kDataAlignment = 16;
static const int kDataBufferSize = 640 * 480;
virtual void SetUp() {
void SetUp() override {
source_stride_ = (width_ + 31) & ~31;
reference_stride_ = width_ * 2;
rnd_.Reset(ACMRandom::DeterministicSeed());
@@ -145,9 +145,9 @@ class ConsistencyVP9Test
};
#endif // CONFIG_VP9_ENCODER
uint8_t *ConsistencyTestBase::source_data_[2] = { NULL, NULL };
uint8_t *ConsistencyTestBase::reference_data_[2] = { NULL, NULL };
Ssimv *ConsistencyTestBase::ssim_array_ = NULL;
uint8_t *ConsistencyTestBase::source_data_[2] = { nullptr, nullptr };
uint8_t *ConsistencyTestBase::reference_data_[2] = { nullptr, nullptr };
Ssimv *ConsistencyTestBase::ssim_array_ = nullptr;
#if CONFIG_VP9_ENCODER
TEST_P(ConsistencyVP9Test, ConsistencyIsZero) {
+163 -26
View File
@@ -11,7 +11,7 @@
#include <string.h>
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_config.h"
@@ -244,7 +244,7 @@ void highbd_filter_block2d_8_c(const uint16_t *src_ptr,
// Vertical pass (transposed intermediate -> dst).
{
uint16_t *src_ptr = intermediate_buffer;
src_ptr = intermediate_buffer;
const int dst_next_row_stride = dst_stride - output_width;
unsigned int i, j;
for (i = 0; i < output_height; ++i) {
@@ -361,22 +361,22 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
#endif
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
void TearDown() override { libvpx_test::ClearSystemState(); }
static void TearDownTestSuite() {
vpx_free(input_ - 1);
input_ = NULL;
input_ = nullptr;
vpx_free(output_);
output_ = NULL;
output_ = nullptr;
vpx_free(output_ref_);
output_ref_ = NULL;
output_ref_ = nullptr;
#if CONFIG_VP9_HIGHBITDEPTH
vpx_free(input16_ - 1);
input16_ = NULL;
input16_ = nullptr;
vpx_free(output16_);
output16_ = NULL;
output16_ = nullptr;
vpx_free(output16_ref_);
output16_ref_ = NULL;
output16_ref_ = nullptr;
#endif
}
@@ -403,7 +403,7 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
i % kOuterBlockSize >= (BorderLeft() + Width()));
}
virtual void SetUp() {
void SetUp() override {
UUT_ = GET_PARAM(2);
#if CONFIG_VP9_HIGHBITDEPTH
if (UUT_->use_highbd_ != 0) {
@@ -541,13 +541,13 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
#endif
};
uint8_t *ConvolveTest::input_ = NULL;
uint8_t *ConvolveTest::output_ = NULL;
uint8_t *ConvolveTest::output_ref_ = NULL;
uint8_t *ConvolveTest::input_ = nullptr;
uint8_t *ConvolveTest::output_ = nullptr;
uint8_t *ConvolveTest::output_ref_ = nullptr;
#if CONFIG_VP9_HIGHBITDEPTH
uint16_t *ConvolveTest::input16_ = NULL;
uint16_t *ConvolveTest::output16_ = NULL;
uint16_t *ConvolveTest::output16_ref_ = NULL;
uint16_t *ConvolveTest::input16_ = nullptr;
uint16_t *ConvolveTest::output16_ = nullptr;
uint16_t *ConvolveTest::output16_ref_ = nullptr;
#endif
TEST_P(ConvolveTest, GuardBlocks) { CheckGuardBlocks(); }
@@ -562,7 +562,7 @@ TEST_P(ConvolveTest, DISABLED_Copy_Speed) {
vpx_usec_timer_start(&timer);
for (int n = 0; n < kNumTests; ++n) {
UUT_->copy_[0](in, kInputStride, out, kOutputStride, NULL, 0, 0, 0, 0,
UUT_->copy_[0](in, kInputStride, out, kOutputStride, nullptr, 0, 0, 0, 0,
width, height);
}
vpx_usec_timer_mark(&timer);
@@ -582,7 +582,7 @@ TEST_P(ConvolveTest, DISABLED_Avg_Speed) {
vpx_usec_timer_start(&timer);
for (int n = 0; n < kNumTests; ++n) {
UUT_->copy_[1](in, kInputStride, out, kOutputStride, NULL, 0, 0, 0, 0,
UUT_->copy_[1](in, kInputStride, out, kOutputStride, nullptr, 0, 0, 0, 0,
width, height);
}
vpx_usec_timer_mark(&timer);
@@ -780,7 +780,8 @@ TEST_P(ConvolveTest, Copy) {
uint8_t *const out = output();
ASM_REGISTER_STATE_CHECK(UUT_->copy_[0](in, kInputStride, out, kOutputStride,
NULL, 0, 0, 0, 0, Width(), Height()));
nullptr, 0, 0, 0, 0, Width(),
Height()));
CheckGuardBlocks();
@@ -799,7 +800,8 @@ TEST_P(ConvolveTest, Avg) {
CopyOutputToRef();
ASM_REGISTER_STATE_CHECK(UUT_->copy_[1](in, kInputStride, out, kOutputStride,
NULL, 0, 0, 0, 0, Width(), Height()));
nullptr, 0, 0, 0, 0, Width(),
Height()));
CheckGuardBlocks();
@@ -955,9 +957,9 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
UUT_->h8_[i](in, kInputStride, out, kOutputStride, filters,
filter_x, 16, 0, 16, Width(), Height()));
else
ASM_REGISTER_STATE_CHECK(UUT_->copy_[i](in, kInputStride, out,
kOutputStride, NULL, 0, 0,
0, 0, Width(), Height()));
ASM_REGISTER_STATE_CHECK(
UUT_->copy_[i](in, kInputStride, out, kOutputStride, nullptr, 0,
0, 0, 0, Width(), Height()));
CheckGuardBlocks();
@@ -1053,9 +1055,9 @@ TEST_P(ConvolveTest, FilterExtremes) {
UUT_->h8_[0](in, kInputStride, out, kOutputStride, filters,
filter_x, 16, 0, 16, Width(), Height()));
else
ASM_REGISTER_STATE_CHECK(UUT_->copy_[0](in, kInputStride, out,
kOutputStride, NULL, 0, 0,
0, 0, Width(), Height()));
ASM_REGISTER_STATE_CHECK(
UUT_->copy_[0](in, kInputStride, out, kOutputStride, nullptr,
0, 0, 0, 0, Width(), Height()));
for (int y = 0; y < Height(); ++y) {
for (int x = 0; x < Width(); ++x)
@@ -1216,6 +1218,30 @@ WRAP(convolve8_neon, 12)
WRAP(convolve8_avg_neon, 12)
#endif // HAVE_NEON
#if HAVE_SVE
WRAP(convolve8_horiz_sve, 8)
WRAP(convolve8_avg_horiz_sve, 8)
WRAP(convolve8_horiz_sve, 10)
WRAP(convolve8_avg_horiz_sve, 10)
WRAP(convolve8_horiz_sve, 12)
WRAP(convolve8_avg_horiz_sve, 12)
#endif // HAVE_SVE
#if HAVE_SVE2
WRAP(convolve8_sve2, 8)
WRAP(convolve8_avg_sve2, 8)
WRAP(convolve8_vert_sve2, 8)
WRAP(convolve8_avg_vert_sve2, 8)
WRAP(convolve8_sve2, 10)
WRAP(convolve8_avg_sve2, 10)
WRAP(convolve8_vert_sve2, 10)
WRAP(convolve8_avg_vert_sve2, 10)
WRAP(convolve8_sve2, 12)
WRAP(convolve8_avg_sve2, 12)
WRAP(convolve8_vert_sve2, 12)
WRAP(convolve8_avg_vert_sve2, 12)
#endif // HAVE_SVE2
WRAP(convolve_copy_c, 8)
WRAP(convolve_avg_c, 8)
WRAP(convolve8_horiz_c, 8)
@@ -1421,6 +1447,104 @@ INSTANTIATE_TEST_SUITE_P(NEON, ConvolveTest,
::testing::ValuesIn(kArrayConvolve_neon));
#endif // HAVE_NEON
#if HAVE_NEON_DOTPROD
const ConvolveFunctions convolve8_neon_dotprod(
vpx_convolve_copy_c, vpx_convolve_avg_c, vpx_convolve8_horiz_neon_dotprod,
vpx_convolve8_avg_horiz_neon_dotprod, vpx_convolve8_vert_neon_dotprod,
vpx_convolve8_avg_vert_neon_dotprod, vpx_convolve8_neon_dotprod,
vpx_convolve8_avg_neon_dotprod, vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c, vpx_scaled_2d_c,
vpx_scaled_avg_2d_c, 0);
const ConvolveParam kArrayConvolve_neon_dotprod[] = { ALL_SIZES(
convolve8_neon_dotprod) };
INSTANTIATE_TEST_SUITE_P(NEON_DOTPROD, ConvolveTest,
::testing::ValuesIn(kArrayConvolve_neon_dotprod));
#endif // HAVE_NEON_DOTPROD
#if HAVE_SVE
#if CONFIG_VP9_HIGHBITDEPTH
const ConvolveFunctions convolve8_sve(
wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, wrap_convolve8_horiz_sve_8,
wrap_convolve8_avg_horiz_sve_8, wrap_convolve8_vert_c_8,
wrap_convolve8_avg_vert_c_8, wrap_convolve8_c_8, wrap_convolve8_avg_c_8,
wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8, wrap_convolve8_c_8,
wrap_convolve8_avg_c_8, 8);
const ConvolveFunctions convolve10_sve(
wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
wrap_convolve8_horiz_sve_10, wrap_convolve8_avg_horiz_sve_10,
wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10, wrap_convolve8_c_10,
wrap_convolve8_avg_c_10, wrap_convolve8_horiz_c_10,
wrap_convolve8_avg_horiz_c_10, wrap_convolve8_vert_c_10,
wrap_convolve8_avg_vert_c_10, wrap_convolve8_c_10, wrap_convolve8_avg_c_10,
10);
const ConvolveFunctions convolve12_sve(
wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
wrap_convolve8_horiz_sve_12, wrap_convolve8_avg_horiz_sve_12,
wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12, wrap_convolve8_c_12,
wrap_convolve8_avg_c_12, wrap_convolve8_horiz_c_12,
wrap_convolve8_avg_horiz_c_12, wrap_convolve8_vert_c_12,
wrap_convolve8_avg_vert_c_12, wrap_convolve8_c_12, wrap_convolve8_avg_c_12,
12);
const ConvolveParam kArrayConvolve_sve[] = { ALL_SIZES(convolve8_sve),
ALL_SIZES(convolve10_sve),
ALL_SIZES(convolve12_sve) };
INSTANTIATE_TEST_SUITE_P(SVE, ConvolveTest,
::testing::ValuesIn(kArrayConvolve_sve));
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_SVE
#if HAVE_SVE2
#if CONFIG_VP9_HIGHBITDEPTH
const ConvolveFunctions convolve8_sve2(
wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, wrap_convolve8_horiz_c_8,
wrap_convolve8_avg_horiz_c_8, wrap_convolve8_vert_sve2_8,
wrap_convolve8_avg_vert_sve2_8, wrap_convolve8_sve2_8,
wrap_convolve8_avg_sve2_8, wrap_convolve8_horiz_c_8,
wrap_convolve8_avg_horiz_c_8, wrap_convolve8_vert_c_8,
wrap_convolve8_avg_vert_c_8, wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8);
const ConvolveFunctions convolve10_sve2(
wrap_convolve_copy_c_10, wrap_convolve_avg_c_10, wrap_convolve8_horiz_c_10,
wrap_convolve8_avg_horiz_c_10, wrap_convolve8_vert_sve2_10,
wrap_convolve8_avg_vert_sve2_10, wrap_convolve8_sve2_10,
wrap_convolve8_avg_sve2_10, wrap_convolve8_horiz_c_10,
wrap_convolve8_avg_horiz_c_10, wrap_convolve8_vert_c_10,
wrap_convolve8_avg_vert_c_10, wrap_convolve8_c_10, wrap_convolve8_avg_c_10,
10);
const ConvolveFunctions convolve12_sve2(
wrap_convolve_copy_c_12, wrap_convolve_avg_c_12, wrap_convolve8_horiz_c_12,
wrap_convolve8_avg_horiz_c_12, wrap_convolve8_vert_sve2_12,
wrap_convolve8_avg_vert_sve2_12, wrap_convolve8_sve2_12,
wrap_convolve8_avg_sve2_12, wrap_convolve8_horiz_c_12,
wrap_convolve8_avg_horiz_c_12, wrap_convolve8_vert_c_12,
wrap_convolve8_avg_vert_c_12, wrap_convolve8_c_12, wrap_convolve8_avg_c_12,
12);
const ConvolveParam kArrayConvolve_sve2[] = { ALL_SIZES(convolve8_sve2),
ALL_SIZES(convolve10_sve2),
ALL_SIZES(convolve12_sve2) };
INSTANTIATE_TEST_SUITE_P(SVE2, ConvolveTest,
::testing::ValuesIn(kArrayConvolve_sve2));
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_SVE2
#if HAVE_NEON_I8MM
const ConvolveFunctions convolve8_neon_i8mm(
vpx_convolve_copy_c, vpx_convolve_avg_c, vpx_convolve8_horiz_neon_i8mm,
vpx_convolve8_avg_horiz_neon_i8mm, vpx_convolve8_vert_neon_i8mm,
vpx_convolve8_avg_vert_neon_i8mm, vpx_convolve8_neon_i8mm,
vpx_convolve8_avg_neon_i8mm, vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c, vpx_scaled_2d_c,
vpx_scaled_avg_2d_c, 0);
const ConvolveParam kArrayConvolve_neon_i8mm[] = { ALL_SIZES(
convolve8_neon_i8mm) };
INSTANTIATE_TEST_SUITE_P(NEON_I8MM, ConvolveTest,
::testing::ValuesIn(kArrayConvolve_neon_i8mm));
#endif // HAVE_NEON_I8MM
#if HAVE_DSPR2
const ConvolveFunctions convolve8_dspr2(
vpx_convolve_copy_dspr2, vpx_convolve_avg_dspr2, vpx_convolve8_horiz_dspr2,
@@ -1447,6 +1571,19 @@ INSTANTIATE_TEST_SUITE_P(MSA, ConvolveTest,
::testing::ValuesIn(kArrayConvolve8_msa));
#endif // HAVE_MSA
#if HAVE_LSX
const ConvolveFunctions convolve8_lsx(
vpx_convolve_copy_lsx, vpx_convolve_avg_lsx, vpx_convolve8_horiz_lsx,
vpx_convolve8_avg_horiz_lsx, vpx_convolve8_vert_lsx,
vpx_convolve8_avg_vert_lsx, vpx_convolve8_lsx, vpx_convolve8_avg_lsx,
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c, vpx_scaled_vert_c,
vpx_scaled_avg_vert_c, vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
const ConvolveParam kArrayConvolve8_lsx[] = { ALL_SIZES(convolve8_lsx) };
INSTANTIATE_TEST_SUITE_P(LSX, ConvolveTest,
::testing::ValuesIn(kArrayConvolve8_lsx));
#endif // HAVE_LSX
#if HAVE_VSX
const ConvolveFunctions convolve8_vsx(
vpx_convolve_copy_vsx, vpx_convolve_avg_vsx, vpx_convolve8_horiz_vsx,
+9 -12
View File
@@ -7,7 +7,7 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
@@ -26,9 +26,9 @@ class CpuSpeedTest
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
set_cpu_used_(GET_PARAM(2)), min_psnr_(kMaxPSNR),
tune_content_(VP9E_CONTENT_DEFAULT) {}
virtual ~CpuSpeedTest() {}
~CpuSpeedTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(encoding_mode_);
if (encoding_mode_ != ::libvpx_test::kRealTime) {
@@ -40,10 +40,10 @@ class CpuSpeedTest
}
}
virtual void BeginPassHook(unsigned int /*pass*/) { min_psnr_ = kMaxPSNR; }
void BeginPassHook(unsigned int /*pass*/) override { min_psnr_ = kMaxPSNR; }
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
encoder->Control(VP9E_SET_TUNE_CONTENT, tune_content_);
@@ -56,7 +56,7 @@ class CpuSpeedTest
}
}
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) override {
if (pkt->data.psnr.psnr[0] < min_psnr_) min_psnr_ = pkt->data.psnr.psnr[0];
}
@@ -105,7 +105,7 @@ TEST_P(CpuSpeedTest, TestTuneScreen) {
::libvpx_test::Y4mVideoSource video("screendata.y4m", 0, 25);
cfg_.g_timebase = video.timebase();
cfg_.rc_2pass_vbr_minsection_pct = 5;
cfg_.rc_2pass_vbr_minsection_pct = 2000;
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
cfg_.rc_target_bitrate = 2000;
cfg_.rc_max_quantizer = 63;
cfg_.rc_min_quantizer = 0;
@@ -148,9 +148,6 @@ TEST_P(CpuSpeedTest, TestLowBitrate) {
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
VP9_INSTANTIATE_TEST_SUITE(CpuSpeedTest,
::testing::Values(::libvpx_test::kTwoPassGood,
::libvpx_test::kOnePassGood,
::libvpx_test::kRealTime),
VP9_INSTANTIATE_TEST_SUITE(CpuSpeedTest, ONE_PASS_TEST_MODES,
::testing::Range(0, 10));
} // namespace
+14 -8
View File
@@ -9,11 +9,12 @@
*/
#include <cmath>
#include <map>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
#include "vpx_config.h"
namespace {
@@ -50,21 +51,21 @@ class CQTest : public ::libvpx_test::EncoderTest,
init_flags_ = VPX_CODEC_USE_PSNR;
}
virtual ~CQTest() {}
~CQTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(libvpx_test::kTwoPassGood);
}
virtual void BeginPassHook(unsigned int /*pass*/) {
void BeginPassHook(unsigned int /*pass*/) override {
file_size_ = 0;
psnr_ = 0.0;
n_frames_ = 0;
}
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
if (cfg_.rc_end_usage == VPX_CQ) {
encoder->Control(VP8E_SET_CQ_LEVEL, cq_level_);
@@ -73,12 +74,12 @@ class CQTest : public ::libvpx_test::EncoderTest,
}
}
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) override {
psnr_ += pow(10.0, pkt->data.psnr.psnr[0] / 10.0);
n_frames_++;
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
void FramePktHook(const vpx_codec_cx_pkt_t *pkt) override {
file_size_ += pkt->data.frame.sz;
}
@@ -104,6 +105,10 @@ CQTest::BitrateMap CQTest::bitrates_;
TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) {
const vpx_rational timebase = { 33333333, 1000000000 };
#if CONFIG_REALTIME_ONlY
GTEST_SKIP()
<< "Non-zero g_lag_in_frames is unsupported with CONFIG_REALTIME_ONLY";
#else
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = kCQTargetBitrate;
cfg_.g_lag_in_frames = 25;
@@ -124,6 +129,7 @@ TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) {
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
const double vbr_psnr_lin = GetLinearPSNROverBitrate();
EXPECT_GE(cq_psnr_lin, vbr_psnr_lin);
#endif // CONFIG_REALTIME_ONLY
}
VP8_INSTANTIATE_TEST_SUITE(CQTest, ::testing::Range(kCQLevelMin, kCQLevelMax,
+181 -20
View File
@@ -13,7 +13,7 @@
#include <string.h>
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
@@ -25,8 +25,9 @@
#include "vp9/common/vp9_scan.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_config.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/msvc.h" // for round()
#include "vpx_ports/vpx_timer.h"
using libvpx_test::ACMRandom;
@@ -309,7 +310,7 @@ void idct16x16_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
class Trans16x16TestBase {
public:
virtual ~Trans16x16TestBase() {}
virtual ~Trans16x16TestBase() = default;
protected:
virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0;
@@ -548,12 +549,50 @@ class Trans16x16TestBase {
}
}
void RunSpeedTest() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 10000;
int c_sum_time = 0;
int simd_sum_time = 0;
DECLARE_ALIGNED(32, int16_t, input_block[kNumCoeffs]);
DECLARE_ALIGNED(32, tran_low_t, output_ref_block[kNumCoeffs]);
DECLARE_ALIGNED(32, tran_low_t, output_block[kNumCoeffs]);
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
}
vpx_usec_timer timer_c;
vpx_usec_timer_start(&timer_c);
for (int i = 0; i < count_test_block; ++i) {
vpx_fdct16x16_c(input_block, output_ref_block, pitch_);
}
vpx_usec_timer_mark(&timer_c);
c_sum_time += static_cast<int>(vpx_usec_timer_elapsed(&timer_c));
vpx_usec_timer timer_mod;
vpx_usec_timer_start(&timer_mod);
for (int i = 0; i < count_test_block; ++i) {
RunFwdTxfm(input_block, output_block, pitch_);
}
vpx_usec_timer_mark(&timer_mod);
simd_sum_time += static_cast<int>(vpx_usec_timer_elapsed(&timer_mod));
printf(
"c_time = %d \t simd_time = %d \t Gain = %4.2f \n", c_sum_time,
simd_sum_time,
(static_cast<float>(c_sum_time) / static_cast<float>(simd_sum_time)));
}
void CompareInvReference(IdctFunc ref_txfm, int thresh) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 10000;
const int eob = 10;
const int16_t *scan = vp9_default_scan_orders[TX_16X16].scan;
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(32, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
@@ -604,6 +643,80 @@ class Trans16x16TestBase {
}
}
void RunInvTrans16x16SpeedTest(IdctFunc ref_txfm, int thresh) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 10000;
const int eob = 10;
const int16_t *scan = vp9_default_scan_orders[TX_16X16].scan;
int64_t c_sum_time = 0;
int64_t simd_sum_time = 0;
DECLARE_ALIGNED(32, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
#endif // CONFIG_VP9_HIGHBITDEPTH
for (int j = 0; j < kNumCoeffs; ++j) {
if (j < eob) {
// Random values less than the threshold, either positive or negative
coeff[scan[j]] = rnd(thresh);
} else {
coeff[scan[j]] = 0;
}
if (bit_depth_ == VPX_BITS_8) {
dst[j] = 0;
ref[j] = 0;
#if CONFIG_VP9_HIGHBITDEPTH
} else {
dst16[j] = 0;
ref16[j] = 0;
#endif // CONFIG_VP9_HIGHBITDEPTH
}
}
if (bit_depth_ == VPX_BITS_8) {
vpx_usec_timer timer_c;
vpx_usec_timer_start(&timer_c);
for (int i = 0; i < count_test_block; ++i) {
ref_txfm(coeff, ref, pitch_);
}
vpx_usec_timer_mark(&timer_c);
c_sum_time += vpx_usec_timer_elapsed(&timer_c);
vpx_usec_timer timer_mod;
vpx_usec_timer_start(&timer_mod);
for (int i = 0; i < count_test_block; ++i) {
RunInvTxfm(coeff, dst, pitch_);
}
vpx_usec_timer_mark(&timer_mod);
simd_sum_time += vpx_usec_timer_elapsed(&timer_mod);
} else {
#if CONFIG_VP9_HIGHBITDEPTH
vpx_usec_timer timer_c;
vpx_usec_timer_start(&timer_c);
for (int i = 0; i < count_test_block; ++i) {
ref_txfm(coeff, CAST_TO_BYTEPTR(ref16), pitch_);
}
vpx_usec_timer_mark(&timer_c);
c_sum_time += vpx_usec_timer_elapsed(&timer_c);
vpx_usec_timer timer_mod;
vpx_usec_timer_start(&timer_mod);
for (int i = 0; i < count_test_block; ++i) {
RunInvTxfm(coeff, CAST_TO_BYTEPTR(dst16), pitch_);
}
vpx_usec_timer_mark(&timer_mod);
simd_sum_time += vpx_usec_timer_elapsed(&timer_mod);
#endif // CONFIG_VP9_HIGHBITDEPTH
}
printf(
"c_time = %" PRId64 " \t simd_time = %" PRId64 " \t Gain = %4.2f \n",
c_sum_time, simd_sum_time,
(static_cast<float>(c_sum_time) / static_cast<float>(simd_sum_time)));
}
int pitch_;
int tx_type_;
vpx_bit_depth_t bit_depth_;
@@ -615,9 +728,9 @@ class Trans16x16TestBase {
class Trans16x16DCT : public Trans16x16TestBase,
public ::testing::TestWithParam<Dct16x16Param> {
public:
virtual ~Trans16x16DCT() {}
~Trans16x16DCT() override = default;
virtual void SetUp() {
void SetUp() override {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
@@ -636,13 +749,13 @@ class Trans16x16DCT : public Trans16x16TestBase,
inv_txfm_ref = idct16x16_ref;
#endif
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
void TearDown() override { libvpx_test::ClearSystemState(); }
protected:
void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) override {
fwd_txfm_(in, out, stride);
}
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) override {
inv_txfm_(out, dst, stride);
}
@@ -664,12 +777,14 @@ TEST_P(Trans16x16DCT, QuantCheck) {
TEST_P(Trans16x16DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); }
TEST_P(Trans16x16DCT, DISABLED_Speed) { RunSpeedTest(); }
class Trans16x16HT : public Trans16x16TestBase,
public ::testing::TestWithParam<Ht16x16Param> {
public:
virtual ~Trans16x16HT() {}
~Trans16x16HT() override = default;
virtual void SetUp() {
void SetUp() override {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
@@ -688,13 +803,13 @@ class Trans16x16HT : public Trans16x16TestBase,
inv_txfm_ref = iht16x16_ref;
#endif
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
void TearDown() override { libvpx_test::ClearSystemState(); }
protected:
void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {
void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) override {
fwd_txfm_(in, out, stride, tx_type_);
}
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) override {
inv_txfm_(out, dst, stride, tx_type_);
}
@@ -717,9 +832,9 @@ TEST_P(Trans16x16HT, QuantCheck) {
class InvTrans16x16DCT : public Trans16x16TestBase,
public ::testing::TestWithParam<Idct16x16Param> {
public:
virtual ~InvTrans16x16DCT() {}
~InvTrans16x16DCT() override = default;
virtual void SetUp() {
void SetUp() override {
ref_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
thresh_ = GET_PARAM(2);
@@ -727,11 +842,12 @@ class InvTrans16x16DCT : public Trans16x16TestBase,
pitch_ = 16;
mask_ = (1 << bit_depth_) - 1;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
void TearDown() override { libvpx_test::ClearSystemState(); }
protected:
void RunFwdTxfm(int16_t * /*in*/, tran_low_t * /*out*/, int /*stride*/) {}
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
void RunFwdTxfm(int16_t * /*in*/, tran_low_t * /*out*/,
int /*stride*/) override {}
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) override {
inv_txfm_(out, dst, stride);
}
@@ -739,11 +855,16 @@ class InvTrans16x16DCT : public Trans16x16TestBase,
IdctFunc inv_txfm_;
int thresh_;
};
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(InvTrans16x16DCT);
TEST_P(InvTrans16x16DCT, CompareReference) {
CompareInvReference(ref_txfm_, thresh_);
}
TEST_P(InvTrans16x16DCT, DISABLED_Speed) {
RunInvTrans16x16SpeedTest(ref_txfm_, thresh_);
}
using std::make_tuple;
#if CONFIG_VP9_HIGHBITDEPTH
@@ -784,15 +905,31 @@ INSTANTIATE_TEST_SUITE_P(
make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8),
make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3, VPX_BITS_8)));
INSTANTIATE_TEST_SUITE_P(C, InvTrans16x16DCT,
::testing::Values(make_tuple(&vpx_idct16x16_256_add_c,
&vpx_idct16x16_256_add_c,
6225, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON && !CONFIG_EMULATE_HARDWARE
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_SUITE_P(
NEON, Trans16x16DCT,
::testing::Values(make_tuple(&vpx_fdct16x16_neon,
&vpx_idct16x16_256_add_neon, 0, VPX_BITS_8)));
#endif // HAVE_NEON && !CONFIG_EMULATE_HARDWARE
#if HAVE_NEON && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_SUITE_P(
NEON, Trans16x16DCT,
::testing::Values(
make_tuple(&vpx_highbd_fdct16x16_neon, &idct16x16_10, 0, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct16x16_neon, &idct16x16_12, 0, VPX_BITS_12),
make_tuple(&vpx_fdct16x16_neon, &vpx_idct16x16_256_add_c, 0,
VPX_BITS_8)));
#endif // HAVE_NEON && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_SUITE_P(
SSE2, Trans16x16DCT,
@@ -808,8 +945,25 @@ INSTANTIATE_TEST_SUITE_P(
2, VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
3, VPX_BITS_8)));
INSTANTIATE_TEST_SUITE_P(SSE2, InvTrans16x16DCT,
::testing::Values(make_tuple(
&vpx_idct16x16_256_add_c,
&vpx_idct16x16_256_add_sse2, 6225, VPX_BITS_8)));
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_SUITE_P(
AVX2, Trans16x16DCT,
::testing::Values(make_tuple(&vpx_fdct16x16_avx2,
&vpx_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
INSTANTIATE_TEST_SUITE_P(AVX2, InvTrans16x16DCT,
::testing::Values(make_tuple(
&vpx_idct16x16_256_add_c,
&vpx_idct16x16_256_add_avx2, 6225, VPX_BITS_8)));
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_SUITE_P(
SSE2, Trans16x16DCT,
@@ -865,4 +1019,11 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Values(make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_vsx,
0, VPX_BITS_8)));
#endif // HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_LSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_SUITE_P(LSX, Trans16x16DCT,
::testing::Values(make_tuple(&vpx_fdct16x16_lsx,
&vpx_idct16x16_256_add_c,
0, VPX_BITS_8)));
#endif // HAVE_LSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace
+211 -6
View File
@@ -13,7 +13,7 @@
#include <string.h>
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_config.h"
@@ -24,10 +24,11 @@
#include "test/register_state_check.h"
#include "test/util.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_scan.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/msvc.h" // for round()
#include "vpx_ports/vpx_timer.h"
using libvpx_test::ACMRandom;
@@ -71,6 +72,9 @@ typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride);
typedef std::tuple<FwdTxfmFunc, InvTxfmFunc, int, vpx_bit_depth_t>
Trans32x32Param;
typedef std::tuple<InvTxfmFunc, InvTxfmFunc, int, vpx_bit_depth_t, int, int>
InvTrans32x32Param;
#if CONFIG_VP9_HIGHBITDEPTH
void idct32x32_10(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct32x32_1024_add_c(in, CAST_TO_SHORTPTR(out), stride, 10);
@@ -84,8 +88,8 @@ void idct32x32_12(const tran_low_t *in, uint8_t *out, int stride) {
class Trans32x32Test : public AbstractBench,
public ::testing::TestWithParam<Trans32x32Param> {
public:
virtual ~Trans32x32Test() {}
virtual void SetUp() {
~Trans32x32Test() override = default;
void SetUp() override {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
version_ = GET_PARAM(2); // 0: high precision forward transform
@@ -94,7 +98,7 @@ class Trans32x32Test : public AbstractBench,
mask_ = (1 << bit_depth_) - 1;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
void TearDown() override { libvpx_test::ClearSystemState(); }
protected:
int version_;
@@ -105,7 +109,7 @@ class Trans32x32Test : public AbstractBench,
int16_t *bench_in_;
tran_low_t *bench_out_;
virtual void Run();
void Run() override;
};
void Trans32x32Test::Run() { fwd_txfm_(bench_in_, bench_out_, 32); }
@@ -314,6 +318,174 @@ TEST_P(Trans32x32Test, InverseAccuracy) {
}
}
class InvTrans32x32Test : public ::testing::TestWithParam<InvTrans32x32Param> {
public:
~InvTrans32x32Test() override = default;
void SetUp() override {
ref_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
version_ = GET_PARAM(2); // 0: high precision forward transform
// 1: low precision version for rd loop
bit_depth_ = GET_PARAM(3);
eob_ = GET_PARAM(4);
thresh_ = GET_PARAM(4);
mask_ = (1 << bit_depth_) - 1;
pitch_ = 32;
}
void TearDown() override { libvpx_test::ClearSystemState(); }
protected:
void RunRefTxfm(tran_low_t *out, uint8_t *dst, int stride) {
ref_txfm_(out, dst, stride);
}
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
inv_txfm_(out, dst, stride);
}
int version_;
vpx_bit_depth_t bit_depth_;
int mask_;
int eob_;
int thresh_;
InvTxfmFunc ref_txfm_;
InvTxfmFunc inv_txfm_;
int pitch_;
void RunInvTrans32x32SpeedTest() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 10000;
int64_t c_sum_time = 0;
int64_t simd_sum_time = 0;
const int16_t *scan = vp9_default_scan_orders[TX_32X32].scan;
DECLARE_ALIGNED(32, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
#endif // CONFIG_VP9_HIGHBITDEPTH
for (int j = 0; j < kNumCoeffs; ++j) {
if (j < eob_) {
// Random values less than the threshold, either positive or negative
coeff[scan[j]] = rnd(thresh_);
} else {
coeff[scan[j]] = 0;
}
if (bit_depth_ == VPX_BITS_8) {
dst[j] = 0;
ref[j] = 0;
#if CONFIG_VP9_HIGHBITDEPTH
} else {
dst16[j] = 0;
ref16[j] = 0;
#endif // CONFIG_VP9_HIGHBITDEPTH
}
}
if (bit_depth_ == VPX_BITS_8) {
vpx_usec_timer timer_c;
vpx_usec_timer_start(&timer_c);
for (int i = 0; i < count_test_block; ++i) {
RunRefTxfm(coeff, ref, pitch_);
}
vpx_usec_timer_mark(&timer_c);
c_sum_time += vpx_usec_timer_elapsed(&timer_c);
vpx_usec_timer timer_mod;
vpx_usec_timer_start(&timer_mod);
for (int i = 0; i < count_test_block; ++i) {
RunInvTxfm(coeff, dst, pitch_);
}
vpx_usec_timer_mark(&timer_mod);
simd_sum_time += vpx_usec_timer_elapsed(&timer_mod);
} else {
#if CONFIG_VP9_HIGHBITDEPTH
vpx_usec_timer timer_c;
vpx_usec_timer_start(&timer_c);
for (int i = 0; i < count_test_block; ++i) {
RunRefTxfm(coeff, CAST_TO_BYTEPTR(ref16), pitch_);
}
vpx_usec_timer_mark(&timer_c);
c_sum_time += vpx_usec_timer_elapsed(&timer_c);
vpx_usec_timer timer_mod;
vpx_usec_timer_start(&timer_mod);
for (int i = 0; i < count_test_block; ++i) {
RunInvTxfm(coeff, CAST_TO_BYTEPTR(dst16), pitch_);
}
vpx_usec_timer_mark(&timer_mod);
simd_sum_time += vpx_usec_timer_elapsed(&timer_mod);
#endif // CONFIG_VP9_HIGHBITDEPTH
}
printf(
"c_time = %" PRId64 " \t simd_time = %" PRId64 " \t Gain = %4.2f \n",
c_sum_time, simd_sum_time,
(static_cast<float>(c_sum_time) / static_cast<float>(simd_sum_time)));
}
void CompareInvReference32x32() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 10000;
const int eob = 31;
const int16_t *scan = vp9_default_scan_orders[TX_32X32].scan;
DECLARE_ALIGNED(32, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
#endif // CONFIG_VP9_HIGHBITDEPTH
for (int i = 0; i < count_test_block; ++i) {
for (int j = 0; j < kNumCoeffs; ++j) {
if (j < eob) {
coeff[scan[j]] = rnd.Rand8Extremes();
} else {
coeff[scan[j]] = 0;
}
if (bit_depth_ == VPX_BITS_8) {
dst[j] = 0;
ref[j] = 0;
#if CONFIG_VP9_HIGHBITDEPTH
} else {
dst16[j] = 0;
ref16[j] = 0;
#endif // CONFIG_VP9_HIGHBITDEPTH
}
}
if (bit_depth_ == VPX_BITS_8) {
RunRefTxfm(coeff, ref, pitch_);
RunInvTxfm(coeff, dst, pitch_);
} else {
#if CONFIG_VP9_HIGHBITDEPTH
RunRefTxfm(coeff, CAST_TO_BYTEPTR(ref16), pitch_);
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(coeff, CAST_TO_BYTEPTR(dst16), pitch_));
#endif // CONFIG_VP9_HIGHBITDEPTH
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
const uint32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j];
#else
const uint32_t diff = dst[j] - ref[j];
#endif // CONFIG_VP9_HIGHBITDEPTH
const uint32_t error = diff * diff;
EXPECT_EQ(0u, error) << "Error: 32x32 IDCT Comparison has error "
<< error << " at index " << j;
}
}
}
};
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(InvTrans32x32Test);
TEST_P(InvTrans32x32Test, DISABLED_Speed) { RunInvTrans32x32SpeedTest(); }
TEST_P(InvTrans32x32Test, CompareReference) { CompareInvReference32x32(); }
using std::make_tuple;
#if CONFIG_VP9_HIGHBITDEPTH
@@ -334,6 +506,14 @@ INSTANTIATE_TEST_SUITE_P(
VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_c, &vpx_idct32x32_1024_add_c,
1, VPX_BITS_8)));
INSTANTIATE_TEST_SUITE_P(
C, InvTrans32x32Test,
::testing::Values(
(make_tuple(&vpx_idct32x32_1024_add_c, &vpx_idct32x32_1024_add_c, 0,
VPX_BITS_8, 32, 6225)),
make_tuple(&vpx_idct32x32_135_add_c, &vpx_idct32x32_135_add_c, 0,
VPX_BITS_8, 16, 6255)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON && !CONFIG_EMULATE_HARDWARE
@@ -352,6 +532,14 @@ INSTANTIATE_TEST_SUITE_P(
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_sse2,
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
INSTANTIATE_TEST_SUITE_P(
SSE2, InvTrans32x32Test,
::testing::Values(
(make_tuple(&vpx_idct32x32_1024_add_c, &vpx_idct32x32_1024_add_sse2, 0,
VPX_BITS_8, 32, 6225)),
make_tuple(&vpx_idct32x32_135_add_c, &vpx_idct32x32_135_add_sse2, 0,
VPX_BITS_8, 16, 6225)));
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
@@ -377,6 +565,14 @@ INSTANTIATE_TEST_SUITE_P(
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_avx2,
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
INSTANTIATE_TEST_SUITE_P(
AVX2, InvTrans32x32Test,
::testing::Values(
(make_tuple(&vpx_idct32x32_1024_add_c, &vpx_idct32x32_1024_add_avx2, 0,
VPX_BITS_8, 32, 6225)),
make_tuple(&vpx_idct32x32_135_add_c, &vpx_idct32x32_135_add_avx2, 0,
VPX_BITS_8, 16, 6225)));
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
@@ -396,4 +592,13 @@ INSTANTIATE_TEST_SUITE_P(
make_tuple(&vpx_fdct32x32_rd_vsx,
&vpx_idct32x32_1024_add_vsx, 1, VPX_BITS_8)));
#endif // HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_LSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_SUITE_P(
LSX, Trans32x32Test,
::testing::Values(make_tuple(&vpx_fdct32x32_lsx,
&vpx_idct32x32_1024_add_lsx, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_lsx,
&vpx_idct32x32_1024_add_lsx, 1, VPX_BITS_8)));
#endif // HAVE_LSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace
+13 -6
View File
@@ -14,7 +14,7 @@
#include <limits>
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
@@ -22,6 +22,7 @@
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx_config.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_dsp/vpx_dsp_common.h"
@@ -39,7 +40,7 @@ typedef tuple<PartialFdctFunc, int /* size */, vpx_bit_depth_t>
tran_low_t partial_fdct_ref(const Buffer<int16_t> &in, int size) {
int64_t sum = 0;
if (in.TopLeftPixel() != NULL) {
if (in.TopLeftPixel() != nullptr) {
for (int y = 0; y < size; ++y) {
for (int x = 0; x < size; ++x) {
sum += in.TopLeftPixel()[y * in.stride() + x];
@@ -67,7 +68,7 @@ class PartialFdctTest : public ::testing::TestWithParam<PartialFdctParam> {
bit_depth_ = GET_PARAM(2);
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
void TearDown() override { libvpx_test::ClearSystemState(); }
protected:
void RunTest() {
@@ -81,7 +82,7 @@ class PartialFdctTest : public ::testing::TestWithParam<PartialFdctParam> {
Buffer<tran_low_t> output_block = Buffer<tran_low_t>(size_, size_, 0, 16);
ASSERT_TRUE(output_block.Init());
if (output_block.TopLeftPixel() != NULL) {
if (output_block.TopLeftPixel() != nullptr) {
for (int i = 0; i < 100; ++i) {
if (i == 0) {
input_block.Set(maxvalue);
@@ -145,11 +146,17 @@ INSTANTIATE_TEST_SUITE_P(
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_SUITE_P(
NEON, PartialFdctTest,
::testing::Values(make_tuple(&vpx_fdct32x32_1_neon, 32, VPX_BITS_8),
make_tuple(&vpx_fdct16x16_1_neon, 16, VPX_BITS_8),
::testing::Values(make_tuple(&vpx_highbd_fdct32x32_1_neon, 32, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct32x32_1_neon, 32, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct32x32_1_neon, 32, VPX_BITS_8),
make_tuple(&vpx_highbd_fdct16x16_1_neon, 16, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct16x16_1_neon, 16, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct16x16_1_neon, 16, VPX_BITS_8),
make_tuple(&vpx_fdct8x8_1_neon, 8, VPX_BITS_12),
make_tuple(&vpx_fdct8x8_1_neon, 8, VPX_BITS_10),
make_tuple(&vpx_fdct8x8_1_neon, 8, VPX_BITS_8),
make_tuple(&vpx_fdct4x4_1_neon, 4, VPX_BITS_12),
make_tuple(&vpx_fdct4x4_1_neon, 4, VPX_BITS_10),
make_tuple(&vpx_fdct4x4_1_neon, 4, VPX_BITS_8)));
#else
INSTANTIATE_TEST_SUITE_P(
+58 -23
View File
@@ -13,7 +13,7 @@
#include <string.h>
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
@@ -23,6 +23,7 @@
#include "test/register_state_check.h"
#include "test/util.h"
#include "vp9/common/vp9_entropy.h"
#include "vpx_config.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
@@ -134,7 +135,7 @@ void fwht_ref(const Buffer<int16_t> &in, Buffer<tran_low_t> *out, int size,
class TransTestBase : public ::testing::TestWithParam<DctParam> {
public:
virtual void SetUp() {
void SetUp() override {
rnd_.Reset(ACMRandom::DeterministicSeed());
const int idx = GET_PARAM(0);
const FuncInfo *func_info = &(GET_PARAM(1)[idx]);
@@ -160,17 +161,17 @@ class TransTestBase : public ::testing::TestWithParam<DctParam> {
src_ = reinterpret_cast<uint8_t *>(
vpx_memalign(16, pixel_size_ * block_size_));
ASSERT_TRUE(src_ != NULL);
ASSERT_NE(src_, nullptr);
dst_ = reinterpret_cast<uint8_t *>(
vpx_memalign(16, pixel_size_ * block_size_));
ASSERT_TRUE(dst_ != NULL);
ASSERT_NE(dst_, nullptr);
}
virtual void TearDown() {
void TearDown() override {
vpx_free(src_);
src_ = NULL;
src_ = nullptr;
vpx_free(dst_);
dst_ = NULL;
dst_ = nullptr;
libvpx_test::ClearSystemState();
}
@@ -211,7 +212,7 @@ class TransTestBase : public ::testing::TestWithParam<DctParam> {
Buffer<int16_t> test_input_block =
Buffer<int16_t>(size_, size_, 8, size_ == 4 ? 0 : 16);
ASSERT_TRUE(test_input_block.Init());
ASSERT_TRUE(test_input_block.TopLeftPixel() != NULL);
ASSERT_NE(test_input_block.TopLeftPixel(), nullptr);
Buffer<tran_low_t> test_temp_block =
Buffer<tran_low_t>(size_, size_, 0, 16);
ASSERT_TRUE(test_temp_block.Init());
@@ -316,7 +317,7 @@ class TransTestBase : public ::testing::TestWithParam<DctParam> {
} else if (i == 1) {
input_extreme_block.Set(-max_pixel_value_);
} else {
ASSERT_TRUE(input_extreme_block.TopLeftPixel() != NULL);
ASSERT_NE(input_extreme_block.TopLeftPixel(), nullptr);
for (int h = 0; h < size_; ++h) {
for (int w = 0; w < size_; ++w) {
input_extreme_block
@@ -331,7 +332,7 @@ class TransTestBase : public ::testing::TestWithParam<DctParam> {
// The minimum quant value is 4.
EXPECT_TRUE(output_block.CheckValues(output_ref_block));
ASSERT_TRUE(output_block.TopLeftPixel() != NULL);
ASSERT_NE(output_block.TopLeftPixel(), nullptr);
for (int h = 0; h < size_; ++h) {
for (int w = 0; w < size_; ++w) {
EXPECT_GE(
@@ -358,18 +359,10 @@ class TransTestBase : public ::testing::TestWithParam<DctParam> {
ASSERT_TRUE(in.Init());
Buffer<tran_low_t> coeff = Buffer<tran_low_t>(size_, size_, 0, 16);
ASSERT_TRUE(coeff.Init());
Buffer<uint8_t> dst = Buffer<uint8_t>(size_, size_, 0, 16);
ASSERT_TRUE(dst.Init());
Buffer<uint8_t> src = Buffer<uint8_t>(size_, size_, 0);
ASSERT_TRUE(src.Init());
Buffer<uint16_t> dst16 = Buffer<uint16_t>(size_, size_, 0, 16);
ASSERT_TRUE(dst16.Init());
Buffer<uint16_t> src16 = Buffer<uint16_t>(size_, size_, 0);
ASSERT_TRUE(src16.Init());
for (int i = 0; i < count_test_block; ++i) {
InitMem();
ASSERT_TRUE(in.TopLeftPixel() != NULL);
ASSERT_NE(in.TopLeftPixel(), nullptr);
// Initialize a test block with input range [-max_pixel_value_,
// max_pixel_value_].
for (int h = 0; h < size_; ++h) {
@@ -539,6 +532,18 @@ INSTANTIATE_TEST_SUITE_P(AVX2, TransDCT,
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON
#if CONFIG_VP9_HIGHBITDEPTH
static const FuncInfo dct_neon_func_info[] = {
{ &fdct_wrapper<vpx_highbd_fdct4x4_neon>,
&highbd_idct_wrapper<vpx_highbd_idct4x4_16_add_neon>, 4, 2 },
{ &fdct_wrapper<vpx_highbd_fdct8x8_neon>,
&highbd_idct_wrapper<vpx_highbd_idct8x8_64_add_neon>, 8, 2 },
{ &fdct_wrapper<vpx_highbd_fdct16x16_neon>,
&highbd_idct_wrapper<vpx_highbd_idct16x16_256_add_neon>, 16, 2 },
/* { &fdct_wrapper<vpx_highbd_fdct32x32_neon>,
&highbd_idct_wrapper<vpx_highbd_idct32x32_1024_add_neon>, 32, 2 },*/
};
#else
static const FuncInfo dct_neon_func_info[4] = {
{ &fdct_wrapper<vpx_fdct4x4_neon>, &idct_wrapper<vpx_idct4x4_16_add_neon>, 4,
1 },
@@ -549,12 +554,15 @@ static const FuncInfo dct_neon_func_info[4] = {
{ &fdct_wrapper<vpx_fdct32x32_neon>,
&idct_wrapper<vpx_idct32x32_1024_add_neon>, 32, 1 }
};
#endif // CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_SUITE_P(
NEON, TransDCT,
::testing::Combine(::testing::Range(0, 4),
::testing::Values(dct_neon_func_info),
::testing::Values(0), ::testing::Values(VPX_BITS_8)));
::testing::Combine(
::testing::Range(0, static_cast<int>(sizeof(dct_neon_func_info) /
sizeof(dct_neon_func_info[0]))),
::testing::Values(dct_neon_func_info), ::testing::Values(0),
::testing::Values(VPX_BITS_8, VPX_BITS_10, VPX_BITS_12)));
#endif // HAVE_NEON
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH
@@ -586,6 +594,23 @@ INSTANTIATE_TEST_SUITE_P(VSX, TransDCT,
VPX_BITS_8)));
#endif // HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH &&
#if HAVE_LSX && !CONFIG_VP9_HIGHBITDEPTH
static const FuncInfo dct_lsx_func_info[4] = {
{ &fdct_wrapper<vpx_fdct4x4_lsx>, &idct_wrapper<vpx_idct4x4_16_add_c>, 4, 1 },
{ &fdct_wrapper<vpx_fdct8x8_lsx>, &idct_wrapper<vpx_idct8x8_64_add_c>, 8, 1 },
{ &fdct_wrapper<vpx_fdct16x16_lsx>, &idct_wrapper<vpx_idct16x16_256_add_c>,
16, 1 },
{ &fdct_wrapper<vpx_fdct32x32_lsx>, &idct_wrapper<vpx_idct32x32_1024_add_lsx>,
32, 1 }
};
INSTANTIATE_TEST_SUITE_P(
LSX, TransDCT,
::testing::Combine(::testing::Range(0, 4),
::testing::Values(dct_lsx_func_info),
::testing::Values(0), ::testing::Values(VPX_BITS_8)));
#endif // HAVE_LSX && !CONFIG_VP9_HIGHBITDEPTH
#endif // !CONFIG_EMULATE_HARDWARE
/* -------------------------------------------------------------------------- */
@@ -635,14 +660,23 @@ static const FuncInfo ht_neon_func_info[] = {
#if CONFIG_VP9_HIGHBITDEPTH
{ &vp9_highbd_fht4x4_c, &highbd_iht_wrapper<vp9_highbd_iht4x4_16_add_neon>, 4,
2 },
{ &vp9_highbd_fht4x4_neon, &highbd_iht_wrapper<vp9_highbd_iht4x4_16_add_neon>,
4, 2 },
{ &vp9_highbd_fht8x8_c, &highbd_iht_wrapper<vp9_highbd_iht8x8_64_add_neon>, 8,
2 },
{ &vp9_highbd_fht8x8_neon, &highbd_iht_wrapper<vp9_highbd_iht8x8_64_add_neon>,
8, 2 },
{ &vp9_highbd_fht16x16_c,
&highbd_iht_wrapper<vp9_highbd_iht16x16_256_add_neon>, 16, 2 },
{ &vp9_highbd_fht16x16_neon,
&highbd_iht_wrapper<vp9_highbd_iht16x16_256_add_neon>, 16, 2 },
#endif
{ &vp9_fht4x4_c, &iht_wrapper<vp9_iht4x4_16_add_neon>, 4, 1 },
{ &vp9_fht4x4_neon, &iht_wrapper<vp9_iht4x4_16_add_neon>, 4, 1 },
{ &vp9_fht8x8_c, &iht_wrapper<vp9_iht8x8_64_add_neon>, 8, 1 },
{ &vp9_fht16x16_c, &iht_wrapper<vp9_iht16x16_256_add_neon>, 16, 1 }
{ &vp9_fht8x8_neon, &iht_wrapper<vp9_iht8x8_64_add_neon>, 8, 1 },
{ &vp9_fht16x16_c, &iht_wrapper<vp9_iht16x16_256_add_neon>, 16, 1 },
{ &vp9_fht16x16_neon, &iht_wrapper<vp9_iht16x16_256_add_neon>, 16, 1 }
};
INSTANTIATE_TEST_SUITE_P(
@@ -753,4 +787,5 @@ INSTANTIATE_TEST_SUITE_P(VSX, TransWHT,
::testing::Values(make_tuple(0, &wht_vsx_func_info, 0,
VPX_BITS_8)));
#endif // HAVE_VSX && !CONFIG_EMULATE_HARDWARE
} // namespace
+4 -4
View File
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vpx_config.h"
#include "test/ivf_video_source.h"
@@ -20,7 +20,7 @@ namespace {
#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0]))
TEST(DecodeAPI, InvalidParams) {
static const vpx_codec_iface_t *kCodecs[] = {
static vpx_codec_iface_t *kCodecs[] = {
#if CONFIG_VP8_DECODER
&vpx_codec_vp8_dx_algo,
#endif
@@ -120,7 +120,7 @@ void TestVp9Controls(vpx_codec_ctx_t *dec) {
}
TEST(DecodeAPI, Vp9InvalidDecode) {
const vpx_codec_iface_t *const codec = &vpx_codec_vp9_dx_algo;
vpx_codec_iface_t *const codec = &vpx_codec_vp9_dx_algo;
const char filename[] =
"invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf";
libvpx_test::IVFVideoSource video(filename);
@@ -147,7 +147,7 @@ TEST(DecodeAPI, Vp9InvalidDecode) {
void TestPeekInfo(const uint8_t *const data, uint32_t data_sz,
uint32_t peek_size) {
const vpx_codec_iface_t *const codec = &vpx_codec_vp9_dx_algo;
vpx_codec_iface_t *const codec = &vpx_codec_vp9_dx_algo;
// Verify behavior of vpx_codec_decode. vpx_codec_decode doesn't even get
// to decoder_peek_si_internal on frames of size < 8.
if (data_sz >= 8) {
+13 -12
View File
@@ -10,12 +10,13 @@
#include <tuple>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/util.h"
#include "test/i420_video_source.h"
#include "vpx_config.h"
#include "vpx_mem/vpx_mem.h"
namespace {
@@ -28,9 +29,9 @@ class DecodeCorruptedFrameTest
DecodeCorruptedFrameTest() : EncoderTest(GET_PARAM(0)) {}
protected:
virtual ~DecodeCorruptedFrameTest() {}
~DecodeCorruptedFrameTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(::libvpx_test::kRealTime);
cfg_.g_lag_in_frames = 0;
@@ -44,16 +45,16 @@ class DecodeCorruptedFrameTest
dec_cfg_.threads = 1;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) encoder->Control(VP8E_SET_CPUUSED, 7);
}
virtual void MismatchHook(const vpx_image_t * /*img1*/,
const vpx_image_t * /*img2*/) {}
void MismatchHook(const vpx_image_t * /*img1*/,
const vpx_image_t * /*img2*/) override {}
virtual const vpx_codec_cx_pkt_t *MutateEncoderOutputHook(
const vpx_codec_cx_pkt_t *pkt) {
const vpx_codec_cx_pkt_t *MutateEncoderOutputHook(
const vpx_codec_cx_pkt_t *pkt) override {
// Don't edit frame packet on key frame.
if (pkt->data.frame.flags & VPX_FRAME_IS_KEY) return pkt;
if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) return pkt;
@@ -66,9 +67,9 @@ class DecodeCorruptedFrameTest
return &modified_pkt_;
}
virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
const libvpx_test::VideoSource & /*video*/,
libvpx_test::Decoder *decoder) {
bool HandleDecodeResult(const vpx_codec_err_t res_dec,
const libvpx_test::VideoSource & /*video*/,
libvpx_test::Decoder *decoder) override {
EXPECT_NE(res_dec, VPX_CODEC_MEM_ERROR) << decoder->DecodeError();
return VPX_CODEC_MEM_ERROR != res_dec;
}
+17 -17
View File
@@ -19,9 +19,9 @@
#include "test/md5_helper.h"
#include "test/util.h"
#include "test/webm_video_source.h"
#include "vpx/vpx_codec.h"
#include "vpx_ports/vpx_timer.h"
#include "./ivfenc.h"
#include "./vpx_version.h"
using std::make_tuple;
@@ -87,7 +87,7 @@ TEST_P(DecodePerfTest, PerfTest) {
vpx_usec_timer t;
vpx_usec_timer_start(&t);
for (video.Begin(); video.cxdata() != NULL; video.Next()) {
for (video.Begin(); video.cxdata() != nullptr; video.Next()) {
decoder.DecodeFrame(video.cxdata(), video.frame_size());
}
@@ -98,7 +98,7 @@ TEST_P(DecodePerfTest, PerfTest) {
printf("{\n");
printf("\t\"type\" : \"decode_perf_test\",\n");
printf("\t\"version\" : \"%s\",\n", VERSION_STRING_NOSP);
printf("\t\"version\" : \"%s\",\n", vpx_codec_version_str());
printf("\t\"videoName\" : \"%s\",\n", video_name);
printf("\t\"threadCount\" : %u,\n", threads);
printf("\t\"decodeTimeSecs\" : %f,\n", elapsed_secs);
@@ -116,11 +116,11 @@ class VP9NewEncodeDecodePerfTest
protected:
VP9NewEncodeDecodePerfTest()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), speed_(0),
outfile_(0), out_frames_(0) {}
outfile_(nullptr), out_frames_(0) {}
virtual ~VP9NewEncodeDecodePerfTest() {}
~VP9NewEncodeDecodePerfTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(encoding_mode_);
@@ -137,8 +137,8 @@ class VP9NewEncodeDecodePerfTest
cfg_.rc_end_usage = VPX_VBR;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, speed_);
encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING, 1);
@@ -146,24 +146,24 @@ class VP9NewEncodeDecodePerfTest
}
}
virtual void BeginPassHook(unsigned int /*pass*/) {
void BeginPassHook(unsigned int /*pass*/) override {
const std::string data_path = getenv("LIBVPX_TEST_DATA_PATH");
const std::string path_to_source = data_path + "/" + kNewEncodeOutputFile;
outfile_ = fopen(path_to_source.c_str(), "wb");
ASSERT_TRUE(outfile_ != NULL);
ASSERT_NE(outfile_, nullptr);
}
virtual void EndPassHook() {
if (outfile_ != NULL) {
void EndPassHook() override {
if (outfile_ != nullptr) {
if (!fseek(outfile_, 0, SEEK_SET)) {
ivf_write_file_header(outfile_, &cfg_, VP9_FOURCC, out_frames_);
}
fclose(outfile_);
outfile_ = NULL;
outfile_ = nullptr;
}
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
void FramePktHook(const vpx_codec_cx_pkt_t *pkt) override {
++out_frames_;
// Write initial file header if first frame.
@@ -177,7 +177,7 @@ class VP9NewEncodeDecodePerfTest
pkt->data.frame.sz);
}
virtual bool DoDecode() const { return false; }
bool DoDecode() const override { return false; }
void set_speed(unsigned int speed) { speed_ = speed; }
@@ -236,7 +236,7 @@ TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) {
vpx_usec_timer t;
vpx_usec_timer_start(&t);
for (decode_video.Begin(); decode_video.cxdata() != NULL;
for (decode_video.Begin(); decode_video.cxdata() != nullptr;
decode_video.Next()) {
decoder.DecodeFrame(decode_video.cxdata(), decode_video.frame_size());
}
@@ -249,7 +249,7 @@ TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) {
printf("{\n");
printf("\t\"type\" : \"decode_perf_test\",\n");
printf("\t\"version\" : \"%s\",\n", VERSION_STRING_NOSP);
printf("\t\"version\" : \"%s\",\n", vpx_codec_version_str());
printf("\t\"videoName\" : \"%s\",\n", kNewEncodeOutputFile);
printf("\t\"threadCount\" : %u,\n", threads);
printf("\t\"decodeTimeSecs\" : %f,\n", elapsed_secs);
+9 -10
View File
@@ -25,17 +25,16 @@ class DecodeSvcTest : public ::libvpx_test::DecoderTest,
public ::libvpx_test::CodecTestWithParam<const char *> {
protected:
DecodeSvcTest() : DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)) {}
virtual ~DecodeSvcTest() {}
~DecodeSvcTest() override = default;
virtual void PreDecodeFrameHook(
const libvpx_test::CompressedVideoSource &video,
libvpx_test::Decoder *decoder) {
void PreDecodeFrameHook(const libvpx_test::CompressedVideoSource &video,
libvpx_test::Decoder *decoder) override {
if (video.frame_number() == 0)
decoder->Control(VP9_DECODE_SVC_SPATIAL_LAYER, spatial_layer_);
}
virtual void DecompressedFrameHook(const vpx_image_t &img,
const unsigned int frame_number) {
void DecompressedFrameHook(const vpx_image_t &img,
const unsigned int frame_number) override {
ASSERT_EQ(img.d_w, width_);
ASSERT_EQ(img.d_h, height_);
total_frames_ = frame_number;
@@ -56,7 +55,7 @@ TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer0) {
const std::string filename = GET_PARAM(1);
std::unique_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
ASSERT_NE(video.get(), nullptr);
video->Init();
total_frames_ = 0;
spatial_layer_ = 0;
@@ -73,7 +72,7 @@ TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer1) {
const std::string filename = GET_PARAM(1);
std::unique_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
ASSERT_NE(video.get(), nullptr);
video->Init();
total_frames_ = 0;
spatial_layer_ = 1;
@@ -90,7 +89,7 @@ TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer2) {
const std::string filename = GET_PARAM(1);
std::unique_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
ASSERT_NE(video.get(), nullptr);
video->Init();
total_frames_ = 0;
spatial_layer_ = 2;
@@ -108,7 +107,7 @@ TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer10) {
const std::string filename = GET_PARAM(1);
std::unique_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
ASSERT_NE(video.get(), nullptr);
video->Init();
total_frames_ = 0;
spatial_layer_ = 10;
+6 -6
View File
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/decode_test_driver.h"
@@ -26,7 +26,7 @@ vpx_codec_err_t Decoder::PeekStream(const uint8_t *cxdata, size_t size,
}
vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, size_t size) {
return DecodeFrame(cxdata, size, NULL);
return DecodeFrame(cxdata, size, nullptr);
}
vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, size_t size,
@@ -67,7 +67,7 @@ void DecoderTest::HandlePeekResult(Decoder *const decoder,
void DecoderTest::RunLoop(CompressedVideoSource *video,
const vpx_codec_dec_cfg_t &dec_cfg) {
Decoder *const decoder = codec_->CreateDecoder(dec_cfg, flags_);
ASSERT_TRUE(decoder != NULL);
ASSERT_NE(decoder, nullptr);
bool end_of_file = false;
// Decode frames.
@@ -78,7 +78,7 @@ void DecoderTest::RunLoop(CompressedVideoSource *video,
vpx_codec_stream_info_t stream_info;
stream_info.sz = sizeof(stream_info);
if (video->cxdata() != NULL) {
if (video->cxdata() != nullptr) {
const vpx_codec_err_t res_peek = decoder->PeekStream(
video->cxdata(), video->frame_size(), &stream_info);
HandlePeekResult(decoder, video, res_peek);
@@ -89,13 +89,13 @@ void DecoderTest::RunLoop(CompressedVideoSource *video,
if (!HandleDecodeResult(res_dec, *video, decoder)) break;
} else {
// Signal end of the file to the decoder.
const vpx_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0);
const vpx_codec_err_t res_dec = decoder->DecodeFrame(nullptr, 0);
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
end_of_file = true;
}
DxDataIterator dec_iter = decoder->GetDxData();
const vpx_image_t *img = NULL;
const vpx_image_t *img = nullptr;
// Get decompressed data
while (!::testing::Test::HasFailure() && (img = dec_iter.Next())) {
+2 -2
View File
@@ -11,7 +11,7 @@
#ifndef VPX_TEST_DECODE_TEST_DRIVER_H_
#define VPX_TEST_DECODE_TEST_DRIVER_H_
#include <cstring>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vpx_config.h"
#include "vpx/vpx_decoder.h"
@@ -24,7 +24,7 @@ class CompressedVideoSource;
class DxDataIterator {
public:
explicit DxDataIterator(vpx_codec_ctx_t *decoder)
: decoder_(decoder), iter_(NULL) {}
: decoder_(decoder), iter_(nullptr) {}
const vpx_image_t *Next() { return vpx_codec_get_frame(decoder_, &iter_); }
+1771 -39
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -7,15 +7,15 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <cstdio>
#include <string>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#include "./vpx_version.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
#include "test/y4m_video_source.h"
#include "vpx/vpx_codec.h"
#include "vpx_ports/vpx_timer.h"
namespace {
@@ -61,9 +61,9 @@ class VP9EncodePerfTest
: EncoderTest(GET_PARAM(0)), min_psnr_(kMaxPsnr), nframes_(0),
encoding_mode_(GET_PARAM(1)), speed_(0), threads_(1) {}
virtual ~VP9EncodePerfTest() {}
~VP9EncodePerfTest() override = default;
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(encoding_mode_);
@@ -82,8 +82,8 @@ class VP9EncodePerfTest
cfg_.g_threads = threads_;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) override {
if (video->frame() == 0) {
const int log2_tile_columns = 3;
encoder->Control(VP8E_SET_CPUUSED, speed_);
@@ -93,19 +93,19 @@ class VP9EncodePerfTest
}
}
virtual void BeginPassHook(unsigned int /*pass*/) {
void BeginPassHook(unsigned int /*pass*/) override {
min_psnr_ = kMaxPsnr;
nframes_ = 0;
}
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) override {
if (pkt->data.psnr.psnr[0] < min_psnr_) {
min_psnr_ = pkt->data.psnr.psnr[0];
}
}
// for performance reasons don't decode
virtual bool DoDecode() const { return false; }
bool DoDecode() const override { return false; }
double min_psnr() const { return min_psnr_; }
@@ -169,7 +169,7 @@ TEST_P(VP9EncodePerfTest, PerfTest) {
printf("{\n");
printf("\t\"type\" : \"encode_perf_test\",\n");
printf("\t\"version\" : \"%s\",\n", VERSION_STRING_NOSP);
printf("\t\"version\" : \"%s\",\n", vpx_codec_version_str());
printf("\t\"videoName\" : \"%s\",\n", display_name.c_str());
printf("\t\"encodeTimeSecs\" : %f,\n", elapsed_secs);
printf("\t\"totalFrames\" : %u,\n", frames);
+12 -11
View File
@@ -11,7 +11,7 @@
#include <memory>
#include <string>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vpx_config.h"
#include "test/codec_factory.h"
@@ -52,7 +52,8 @@ void Encoder::InitEncoder(VideoSource *video) {
}
}
void Encoder::EncodeFrame(VideoSource *video, const unsigned long frame_flags) {
void Encoder::EncodeFrame(VideoSource *video,
const vpx_enc_frame_flags_t frame_flags) {
if (video->img()) {
EncodeFrameInternal(*video, frame_flags);
} else {
@@ -70,7 +71,7 @@ void Encoder::EncodeFrame(VideoSource *video, const unsigned long frame_flags) {
}
void Encoder::EncodeFrameInternal(const VideoSource &video,
const unsigned long frame_flags) {
const vpx_enc_frame_flags_t frame_flags) {
vpx_codec_err_t res;
const vpx_image_t *img = video.img();
@@ -91,7 +92,7 @@ void Encoder::EncodeFrameInternal(const VideoSource &video,
void Encoder::Flush() {
const vpx_codec_err_t res =
vpx_codec_encode(&encoder_, NULL, 0, 0, 0, deadline_);
vpx_codec_encode(&encoder_, nullptr, 0, 0, 0, deadline_);
if (!encoder_.priv)
ASSERT_EQ(VPX_CODEC_ERROR, res) << EncoderError();
else
@@ -169,7 +170,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
ASSERT_TRUE(passes_ == 1 || passes_ == 2);
for (unsigned int pass = 0; pass < passes_; pass++) {
last_pts_ = 0;
vpx_codec_pts_t last_pts = 0;
if (passes_ == 1) {
cfg_.g_pass = VPX_RC_ONE_PASS;
@@ -182,7 +183,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
BeginPassHook(pass);
std::unique_ptr<Encoder> encoder(
codec_->CreateEncoder(cfg_, deadline_, init_flags_, &stats_));
ASSERT_TRUE(encoder.get() != NULL);
ASSERT_NE(encoder.get(), nullptr);
ASSERT_NO_FATAL_FAILURE(video->Begin());
encoder->InitEncoder(video);
@@ -198,7 +199,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
codec_->CreateDecoder(dec_cfg, dec_init_flags));
bool again;
for (again = true; again; video->Next()) {
again = (video->img() != NULL);
again = (video->img() != nullptr);
PreEncodeFrameHook(video);
PreEncodeFrameHook(video, encoder.get());
@@ -216,7 +217,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
switch (pkt->kind) {
case VPX_CODEC_CX_FRAME_PKT:
has_cxdata = true;
if (decoder.get() != NULL && DoDecode()) {
if (decoder != nullptr && DoDecode()) {
PreDecodeFrameHook(video, decoder.get());
vpx_codec_err_t res_dec = decoder->DecodeFrame(
(const uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz);
@@ -225,8 +226,8 @@ void EncoderTest::RunLoop(VideoSource *video) {
has_dxdata = true;
}
ASSERT_GE(pkt->data.frame.pts, last_pts_);
last_pts_ = pkt->data.frame.pts;
ASSERT_GE(pkt->data.frame.pts, last_pts);
last_pts = pkt->data.frame.pts;
FramePktHook(pkt);
break;
@@ -240,7 +241,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
// Flush the decoder when there are no more fragments.
if ((init_flags_ & VPX_CODEC_USE_OUTPUT_PARTITION) && has_dxdata) {
const vpx_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0);
const vpx_codec_err_t res_dec = decoder->DecodeFrame(nullptr, 0);
if (!HandleDecodeResult(res_dec, *video, decoder.get())) break;
}
+34 -15
View File
@@ -13,13 +13,13 @@
#include <string>
#include <vector>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
#include "vpx/vp8cx.h"
#endif
#include "vpx/vpx_encoder.h"
#include "vpx/vpx_tpl.h"
namespace libvpx_test {
@@ -33,15 +33,24 @@ enum TestMode {
kTwoPassGood,
kTwoPassBest
};
#if CONFIG_REALTIME_ONLY
#define ALL_TEST_MODES ::testing::Values(::libvpx_test::kRealTime)
#define ONE_PASS_TEST_MODES ::testing::Values(::libvpx_test::kRealTime)
#define ONE_OR_TWO_PASS_TEST_MODES ::testing::Values(::libvpx_test::kRealTime)
#else
#define ALL_TEST_MODES \
::testing::Values(::libvpx_test::kRealTime, ::libvpx_test::kOnePassGood, \
::libvpx_test::kOnePassBest, ::libvpx_test::kTwoPassGood, \
::libvpx_test::kTwoPassBest)
#define ONE_PASS_TEST_MODES \
::testing::Values(::libvpx_test::kRealTime, ::libvpx_test::kOnePassGood, \
::libvpx_test::kOnePassBest)
#define ONE_OR_TWO_PASS_TEST_MODES \
::testing::Values(::libvpx_test::kOnePassGood, ::libvpx_test::kTwoPassGood)
#endif
#define TWO_PASS_TEST_MODES \
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kTwoPassBest)
@@ -49,7 +58,7 @@ enum TestMode {
class CxDataIterator {
public:
explicit CxDataIterator(vpx_codec_ctx_t *encoder)
: encoder_(encoder), iter_(NULL) {}
: encoder_(encoder), iter_(nullptr) {}
const vpx_codec_cx_pkt_t *Next() {
return vpx_codec_get_cx_data(encoder_, &iter_);
@@ -86,7 +95,7 @@ class TwopassStatsStore {
// level of abstraction will be fleshed out as more tests are written.
class Encoder {
public:
Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline,
Encoder(vpx_codec_enc_cfg_t cfg, vpx_enc_deadline_t deadline,
const unsigned long init_flags, TwopassStatsStore *stats)
: cfg_(cfg), deadline_(deadline), init_flags_(init_flags), stats_(stats) {
memset(&encoder_, 0, sizeof(encoder_));
@@ -103,7 +112,7 @@ class Encoder {
}
// This is a thin wrapper around vpx_codec_encode(), so refer to
// vpx_encoder.h for its semantics.
void EncodeFrame(VideoSource *video, const unsigned long frame_flags);
void EncodeFrame(VideoSource *video, vpx_enc_frame_flags_t frame_flags);
// Convenience wrapper for EncodeFrame()
void EncodeFrame(VideoSource *video) { EncodeFrame(video, 0); }
@@ -148,6 +157,18 @@ class Encoder {
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
#if CONFIG_VP9_ENCODER
void Control(int ctrl_id, vpx_rc_funcs_t *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, VpxTplGopStats *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
#endif // CONFIG_VP9_ENCODER
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
void Control(int ctrl_id, vpx_active_map_t *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
@@ -165,7 +186,7 @@ class Encoder {
cfg_ = *cfg;
}
void set_deadline(unsigned long deadline) { deadline_ = deadline; }
void set_deadline(vpx_enc_deadline_t deadline) { deadline_ = deadline; }
protected:
virtual vpx_codec_iface_t *CodecInterface() const = 0;
@@ -177,14 +198,14 @@ class Encoder {
// Encode an image
void EncodeFrameInternal(const VideoSource &video,
const unsigned long frame_flags);
vpx_enc_frame_flags_t frame_flags);
// Flush the encoder on EOS
void Flush();
vpx_codec_ctx_t encoder_;
vpx_codec_enc_cfg_t cfg_;
unsigned long deadline_;
vpx_enc_deadline_t deadline_;
unsigned long init_flags_;
TwopassStatsStore *stats_;
};
@@ -199,8 +220,7 @@ class Encoder {
class EncoderTest {
protected:
explicit EncoderTest(const CodecFactory *codec)
: codec_(codec), abort_(false), init_flags_(0), frame_flags_(0),
last_pts_(0) {
: codec_(codec), abort_(false), init_flags_(0), frame_flags_(0) {
// Default to 1 thread.
cfg_.g_threads = 1;
}
@@ -253,7 +273,7 @@ class EncoderTest {
const CodecFactory *codec_;
// Hook to determine whether to decode frame after encoding
virtual bool DoDecode() const { return 1; }
virtual bool DoDecode() const { return true; }
// Hook to handle encode/decode mismatch
virtual void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2);
@@ -280,11 +300,10 @@ class EncoderTest {
vpx_codec_enc_cfg_t cfg_;
vpx_codec_dec_cfg_t dec_cfg_;
unsigned int passes_;
unsigned long deadline_;
vpx_enc_deadline_t deadline_;
TwopassStatsStore stats_;
unsigned long init_flags_;
unsigned long frame_flags_;
vpx_codec_pts_t last_pts_;
vpx_enc_frame_flags_t frame_flags_;
};
} // namespace libvpx_test
+22 -16
View File
@@ -8,11 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
#include "vpx_config.h"
namespace {
@@ -30,7 +31,7 @@ class ErrorResilienceTestLarge
Reset();
}
virtual ~ErrorResilienceTestLarge() {}
~ErrorResilienceTestLarge() override = default;
void Reset() {
error_nframes_ = 0;
@@ -38,19 +39,19 @@ class ErrorResilienceTestLarge
pattern_switch_ = 0;
}
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(encoding_mode_);
}
virtual void BeginPassHook(unsigned int /*pass*/) {
void BeginPassHook(unsigned int /*pass*/) override {
psnr_ = 0.0;
nframes_ = 0;
mismatch_psnr_ = 0.0;
mismatch_nframes_ = 0;
}
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) override {
psnr_ += pkt->data.psnr.psnr[0];
nframes_++;
}
@@ -90,7 +91,7 @@ class ErrorResilienceTestLarge
return frame_flags;
}
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video) {
void PreEncodeFrameHook(libvpx_test::VideoSource *video) override {
frame_flags_ &=
~(VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF);
// For temporal layer case.
@@ -129,21 +130,21 @@ class ErrorResilienceTestLarge
return 0.0;
}
virtual bool DoDecode() const {
bool DoDecode() const override {
if (error_nframes_ > 0 &&
(cfg_.g_pass == VPX_RC_LAST_PASS || cfg_.g_pass == VPX_RC_ONE_PASS)) {
for (unsigned int i = 0; i < error_nframes_; ++i) {
if (error_frames_[i] == nframes_ - 1) {
std::cout << " Skipping decoding frame: "
<< error_frames_[i] << "\n";
return 0;
return false;
}
}
}
return 1;
return true;
}
virtual void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2) {
void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2) override {
double mismatch_psnr = compute_psnr(img1, img2);
mismatch_psnr_ += mismatch_psnr;
++mismatch_nframes_;
@@ -194,6 +195,10 @@ class ErrorResilienceTestLarge
};
TEST_P(ErrorResilienceTestLarge, OnVersusOff) {
#if CONFIG_REALTIME_ONLY
GTEST_SKIP()
<< "Non-zero g_lag_in_frames is unsupported with CONFIG_REALTIME_ONLY";
#else
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = 2000;
@@ -222,6 +227,7 @@ TEST_P(ErrorResilienceTestLarge, OnVersusOff) {
EXPECT_GE(psnr_ratio, 0.9);
EXPECT_LE(psnr_ratio, 1.1);
}
#endif // CONFIG_REALTIME_ONLY
}
// Check for successful decoding and no encoder/decoder mismatch
@@ -381,7 +387,7 @@ class ErrorResilienceTestLargeCodecControls
Reset();
}
virtual ~ErrorResilienceTestLargeCodecControls() {}
~ErrorResilienceTestLargeCodecControls() override = default;
void Reset() {
last_pts_ = 0;
@@ -393,7 +399,7 @@ class ErrorResilienceTestLargeCodecControls
duration_ = 0.0;
}
virtual void SetUp() {
void SetUp() override {
InitializeConfig();
SetMode(encoding_mode_);
}
@@ -460,8 +466,8 @@ class ErrorResilienceTestLargeCodecControls
return layer_id;
}
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) {
void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) override {
if (cfg_.ts_number_layers > 1) {
int layer_id = SetLayerId(video->frame(), cfg_.ts_number_layers);
int frame_flags = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
@@ -476,7 +482,7 @@ class ErrorResilienceTestLargeCodecControls
}
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
void FramePktHook(const vpx_codec_cx_pkt_t *pkt) override {
// Time since last timestamp = duration.
vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
if (duration > 1) {
@@ -496,7 +502,7 @@ class ErrorResilienceTestLargeCodecControls
++tot_frame_number_;
}
virtual void EndPassHook(void) {
void EndPassHook() override {
duration_ = (last_pts_ + 1) * timebase_;
if (cfg_.ts_number_layers > 1) {
for (int layer = 0; layer < static_cast<int>(cfg_.ts_number_layers);
+39 -38
View File
@@ -36,7 +36,7 @@ struct ExternalFrameBuffer {
class ExternalFrameBufferList {
public:
ExternalFrameBufferList()
: num_buffers_(0), num_used_buffers_(0), ext_fb_list_(NULL) {}
: num_buffers_(0), num_used_buffers_(0), ext_fb_list_(nullptr) {}
virtual ~ExternalFrameBufferList() {
for (int i = 0; i < num_buffers_; ++i) {
@@ -51,7 +51,7 @@ class ExternalFrameBufferList {
num_buffers_ = num_buffers;
ext_fb_list_ = new ExternalFrameBuffer[num_buffers_];
EXPECT_TRUE(ext_fb_list_ != NULL);
EXPECT_NE(ext_fb_list_, nullptr);
memset(ext_fb_list_, 0, sizeof(ext_fb_list_[0]) * num_buffers_);
return true;
}
@@ -61,7 +61,7 @@ class ExternalFrameBufferList {
// frame buffer is in use by libvpx. Finally sets |fb| to point to the
// external frame buffer. Returns < 0 on an error.
int GetFreeFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
EXPECT_TRUE(fb != NULL);
EXPECT_NE(fb, nullptr);
const int idx = FindFreeBufferIndex();
if (idx == num_buffers_) return -1;
@@ -81,13 +81,13 @@ class ExternalFrameBufferList {
// Test function that will not allocate any data for the frame buffer.
// Returns < 0 on an error.
int GetZeroFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
EXPECT_TRUE(fb != NULL);
EXPECT_NE(fb, nullptr);
const int idx = FindFreeBufferIndex();
if (idx == num_buffers_) return -1;
if (ext_fb_list_[idx].size < min_size) {
delete[] ext_fb_list_[idx].data;
ext_fb_list_[idx].data = NULL;
ext_fb_list_[idx].data = nullptr;
ext_fb_list_[idx].size = min_size;
}
@@ -98,14 +98,14 @@ class ExternalFrameBufferList {
// Marks the external frame buffer that |fb| is pointing to as free.
// Returns < 0 on an error.
int ReturnFrameBuffer(vpx_codec_frame_buffer_t *fb) {
if (fb == NULL) {
EXPECT_TRUE(fb != NULL);
if (fb == nullptr) {
EXPECT_NE(fb, nullptr);
return -1;
}
ExternalFrameBuffer *const ext_fb =
reinterpret_cast<ExternalFrameBuffer *>(fb->priv);
if (ext_fb == NULL) {
EXPECT_TRUE(ext_fb != NULL);
if (ext_fb == nullptr) {
EXPECT_NE(ext_fb, nullptr);
return -1;
}
EXPECT_EQ(1, ext_fb->in_use);
@@ -117,7 +117,7 @@ class ExternalFrameBufferList {
// Checks that the vpx_image_t data is contained within the external frame
// buffer private data passed back in the vpx_image_t.
void CheckImageFrameBuffer(const vpx_image_t *img) {
if (img->fb_priv != NULL) {
if (img->fb_priv != nullptr) {
const struct ExternalFrameBuffer *const ext_fb =
reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv);
@@ -143,7 +143,7 @@ class ExternalFrameBufferList {
// Sets |fb| to an external frame buffer. idx is the index into the frame
// buffer list.
void SetFrameBuffer(int idx, vpx_codec_frame_buffer_t *fb) {
ASSERT_TRUE(fb != NULL);
ASSERT_NE(fb, nullptr);
fb->data = ext_fb_list_[idx].data;
fb->size = ext_fb_list_[idx].size;
ASSERT_EQ(0, ext_fb_list_[idx].in_use);
@@ -208,15 +208,14 @@ class ExternalFrameBufferMD5Test
protected:
ExternalFrameBufferMD5Test()
: DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)),
md5_file_(NULL), num_buffers_(0) {}
md5_file_(nullptr), num_buffers_(0) {}
virtual ~ExternalFrameBufferMD5Test() {
if (md5_file_ != NULL) fclose(md5_file_);
~ExternalFrameBufferMD5Test() override {
if (md5_file_ != nullptr) fclose(md5_file_);
}
virtual void PreDecodeFrameHook(
const libvpx_test::CompressedVideoSource &video,
libvpx_test::Decoder *decoder) {
void PreDecodeFrameHook(const libvpx_test::CompressedVideoSource &video,
libvpx_test::Decoder *decoder) override {
if (num_buffers_ > 0 && video.frame_number() == 0) {
// Have libvpx use frame buffers we create.
ASSERT_TRUE(fb_list_.CreateBufferList(num_buffers_));
@@ -228,13 +227,13 @@ class ExternalFrameBufferMD5Test
void OpenMD5File(const std::string &md5_file_name_) {
md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
ASSERT_TRUE(md5_file_ != NULL)
ASSERT_NE(md5_file_, nullptr)
<< "Md5 file open failed. Filename: " << md5_file_name_;
}
virtual void DecompressedFrameHook(const vpx_image_t &img,
const unsigned int frame_number) {
ASSERT_TRUE(md5_file_ != NULL);
void DecompressedFrameHook(const vpx_image_t &img,
const unsigned int frame_number) override {
ASSERT_NE(md5_file_, nullptr);
char expected_md5[33];
char junk[128];
@@ -286,24 +285,25 @@ const char kVP9NonRefTestFile[] = "vp90-2-22-svc_1280x720_1.webm";
// Class for testing passing in external frame buffers to libvpx.
class ExternalFrameBufferTest : public ::testing::Test {
protected:
ExternalFrameBufferTest() : video_(NULL), decoder_(NULL), num_buffers_(0) {}
ExternalFrameBufferTest()
: video_(nullptr), decoder_(nullptr), num_buffers_(0) {}
virtual void SetUp() {
void SetUp() override {
video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
ASSERT_TRUE(video_ != NULL);
ASSERT_NE(video_, nullptr);
video_->Init();
video_->Begin();
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
decoder_ = new libvpx_test::VP9Decoder(cfg, 0);
ASSERT_TRUE(decoder_ != NULL);
ASSERT_NE(decoder_, nullptr);
}
virtual void TearDown() {
void TearDown() override {
delete decoder_;
decoder_ = NULL;
decoder_ = nullptr;
delete video_;
video_ = NULL;
video_ = nullptr;
}
// Passes the external frame buffer information to libvpx.
@@ -327,7 +327,7 @@ class ExternalFrameBufferTest : public ::testing::Test {
}
vpx_codec_err_t DecodeRemainingFrames() {
for (; video_->cxdata() != NULL; video_->Next()) {
for (; video_->cxdata() != nullptr; video_->Next()) {
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
if (res != VPX_CODEC_OK) return res;
@@ -338,10 +338,10 @@ class ExternalFrameBufferTest : public ::testing::Test {
void CheckDecodedFrames() {
libvpx_test::DxDataIterator dec_iter = decoder_->GetDxData();
const vpx_image_t *img = NULL;
const vpx_image_t *img = nullptr;
// Get decompressed data
while ((img = dec_iter.Next()) != NULL) {
while ((img = dec_iter.Next()) != nullptr) {
fb_list_.CheckImageFrameBuffer(img);
}
}
@@ -354,15 +354,15 @@ class ExternalFrameBufferTest : public ::testing::Test {
class ExternalFrameBufferNonRefTest : public ExternalFrameBufferTest {
protected:
virtual void SetUp() {
void SetUp() override {
video_ = new libvpx_test::WebMVideoSource(kVP9NonRefTestFile);
ASSERT_TRUE(video_ != NULL);
ASSERT_NE(video_, nullptr);
video_->Init();
video_->Begin();
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
decoder_ = new libvpx_test::VP9Decoder(cfg, 0);
ASSERT_TRUE(decoder_ != NULL);
ASSERT_NE(decoder_, nullptr);
}
virtual void CheckFrameBufferRelease() {
@@ -405,7 +405,7 @@ TEST_P(ExternalFrameBufferMD5Test, ExtFBMD5Match) {
return;
#endif
}
ASSERT_TRUE(video.get() != NULL);
ASSERT_NE(video.get(), nullptr);
video->Init();
// Construct md5 file name.
@@ -482,13 +482,14 @@ TEST_F(ExternalFrameBufferTest, NullGetFunction) {
const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
ASSERT_EQ(
VPX_CODEC_INVALID_PARAM,
SetFrameBufferFunctions(num_buffers, NULL, release_vp9_frame_buffer));
SetFrameBufferFunctions(num_buffers, nullptr, release_vp9_frame_buffer));
}
TEST_F(ExternalFrameBufferTest, NullReleaseFunction) {
const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
ASSERT_EQ(VPX_CODEC_INVALID_PARAM,
SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer, NULL));
ASSERT_EQ(
VPX_CODEC_INVALID_PARAM,
SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer, nullptr));
}
TEST_F(ExternalFrameBufferTest, SetAfterDecode) {

Some files were not shown because too many files have changed in this diff Show More