Compare commits
14 Commits
m52-2743
...
sandbox/ji
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0fe7ee6df5 | ||
![]() |
35b121b0d8 | ||
![]() |
e50c37ba82 | ||
![]() |
db7312483f | ||
![]() |
e38e2b8343 | ||
![]() |
fb27ffbb06 | ||
![]() |
29a325f78e | ||
![]() |
f4e1933c57 | ||
![]() |
cb8b7d0dc2 | ||
![]() |
1d8526d0cc | ||
![]() |
9cec9cb26f | ||
![]() |
006085d4a7 | ||
![]() |
b75e4d0f13 | ||
![]() |
c39736a550 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -30,17 +30,14 @@
|
||||
/examples/decode_with_partial_drops
|
||||
/examples/example_xma
|
||||
/examples/postproc
|
||||
/examples/resize_util
|
||||
/examples/set_maps
|
||||
/examples/simple_decoder
|
||||
/examples/simple_encoder
|
||||
/examples/twopass_encoder
|
||||
/examples/vp8_multi_resolution_encoder
|
||||
/examples/vp8cx_set_ref
|
||||
/examples/vp9_lossless_encoder
|
||||
/examples/vp9_spatial_scalable_encoder
|
||||
/examples/vpx_temporal_scalable_patterns
|
||||
/examples/vpx_temporal_svc_encoder
|
||||
/ivfdec
|
||||
/ivfdec.dox
|
||||
/ivfenc
|
||||
@@ -48,14 +45,12 @@
|
||||
/libvpx.so*
|
||||
/libvpx.ver
|
||||
/samples.dox
|
||||
/test_intra_pred_speed
|
||||
/test_libvpx
|
||||
/vp8_api1_migration.dox
|
||||
/vp[89x]_rtcd.h
|
||||
/vpx.pc
|
||||
/vpx_config.c
|
||||
/vpx_config.h
|
||||
/vpx_dsp_rtcd.h
|
||||
/vpx_scale_rtcd.h
|
||||
/vpx_version.h
|
||||
/vpxdec
|
||||
|
8
.mailmap
8
.mailmap
@@ -1,18 +1,14 @@
|
||||
Adrian Grange <agrange@google.com>
|
||||
Aℓex Converse <aconverse@google.com>
|
||||
Aℓex Converse <aconverse@google.com> <alex.converse@gmail.com>
|
||||
Alex Converse <aconverse@google.com> <alex.converse@gmail.com>
|
||||
Alexis Ballier <aballier@gentoo.org> <alexis.ballier@gmail.com>
|
||||
Alpha Lam <hclam@google.com> <hclam@chromium.org>
|
||||
Deb Mukherjee <debargha@google.com>
|
||||
Erik Niemeyer <erik.a.niemeyer@intel.com> <erik.a.niemeyer@gmail.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> <johann.koenig@duck.com>
|
||||
Johann Koenig <johannkoenig@google.com> <johann.koenig@gmail.com>
|
||||
John Koleszar <jkoleszar@google.com>
|
||||
Joshua Litt <joshualitt@google.com> <joshualitt@chromium.org>
|
||||
Marco Paniconi <marpan@google.com>
|
||||
@@ -21,12 +17,10 @@ Pascal Massimino <pascal.massimino@gmail.com>
|
||||
Paul Wilkins <paulwilkins@google.com>
|
||||
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
|
||||
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
|
||||
Ronald S. Bultje <rsbultje@gmail.com> <rbultje@google.com>
|
||||
Sami Pietilä <samipietila@google.com>
|
||||
Tamar Levy <tamar.levy@intel.com>
|
||||
Tamar Levy <tamar.levy@intel.com> <levytamar82@gmail.com>
|
||||
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
|
||||
Timothy B. Terriberry <tterribe@xiph.org> Tim Terriberry <tterriberry@mozilla.com>
|
||||
Tom Finegan <tomfinegan@google.com>
|
||||
Tom Finegan <tomfinegan@google.com> <tomfinegan@chromium.org>
|
||||
Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com>
|
||||
|
15
AUTHORS
15
AUTHORS
@@ -5,9 +5,9 @@ Aaron Watry <awatry@gmail.com>
|
||||
Abo Talib Mahfoodh <ab.mahfoodh@gmail.com>
|
||||
Adam Xu <adam@xuyaowu.com>
|
||||
Adrian Grange <agrange@google.com>
|
||||
Aℓex Converse <aconverse@google.com>
|
||||
Ahmad Sharif <asharif@google.com>
|
||||
Alexander Voronov <avoronov@graphics.cs.msu.ru>
|
||||
Alex Converse <aconverse@google.com>
|
||||
Alexis Ballier <aballier@gentoo.org>
|
||||
Alok Ahuja <waveletcoeff@gmail.com>
|
||||
Alpha Lam <hclam@google.com>
|
||||
@@ -16,10 +16,8 @@ Ami Fischman <fischman@chromium.org>
|
||||
Andoni Morales Alastruey <ylatuya@gmail.com>
|
||||
Andres Mejia <mcitadel@gmail.com>
|
||||
Andrew Russell <anrussell@google.com>
|
||||
Angie Chiang <angiebird@google.com>
|
||||
Aron Rosenberg <arosenberg@logitech.com>
|
||||
Attila Nagy <attilanagy@google.com>
|
||||
Brion Vibber <bvibber@wikimedia.org>
|
||||
changjun.yang <changjun.yang@intel.com>
|
||||
Charles 'Buck' Krasic <ckrasic@google.com>
|
||||
chm <chm@rock-chips.com>
|
||||
@@ -29,7 +27,6 @@ Deb Mukherjee <debargha@google.com>
|
||||
Dim Temp <dimtemp0@gmail.com>
|
||||
Dmitry Kovalev <dkovalev@google.com>
|
||||
Dragan Mrdjan <dmrdjan@mips.com>
|
||||
Ed Baker <edward.baker@intel.com>
|
||||
Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||
Erik Niemeyer <erik.a.niemeyer@intel.com>
|
||||
Fabio Pedretti <fabio.ped@libero.it>
|
||||
@@ -37,8 +34,6 @@ Frank Galligan <fgalligan@google.com>
|
||||
Fredrik Söderquist <fs@opera.com>
|
||||
Fritz Koenig <frkoenig@google.com>
|
||||
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
|
||||
Geza Lore <gezalore@gmail.com>
|
||||
Ghislain MARY <ghislainmary2@gmail.com>
|
||||
Giuseppe Scrivano <gscrivano@gnu.org>
|
||||
Gordana Cmiljanovic <gordana.cmiljanovic@imgtec.com>
|
||||
Guillaume Martres <gmartres@google.com>
|
||||
@@ -49,7 +44,7 @@ Henrik Lundin <hlundin@google.com>
|
||||
Hui Su <huisu@google.com>
|
||||
Ivan Maltz <ivanmaltz@google.com>
|
||||
Jacek Caban <cjacek@gmail.com>
|
||||
Jacky Chen <jackychen@google.com>
|
||||
JackyChen <jackychen@google.com>
|
||||
James Berry <jamesberry@google.com>
|
||||
James Yu <james.yu@linaro.org>
|
||||
James Zern <jzern@google.com>
|
||||
@@ -65,11 +60,9 @@ Jingning Han <jingning@google.com>
|
||||
Joey Parrish <joeyparrish@google.com>
|
||||
Johann Koenig <johannkoenig@google.com>
|
||||
John Koleszar <jkoleszar@google.com>
|
||||
Johnny Klonaris <google@jawknee.com>
|
||||
John Stark <jhnstrk@gmail.com>
|
||||
Joshua Bleecher Snyder <josh@treelinelabs.com>
|
||||
Joshua Litt <joshualitt@google.com>
|
||||
Julia Robson <juliamrobson@gmail.com>
|
||||
Justin Clift <justin@salasaga.org>
|
||||
Justin Lebar <justin.lebar@gmail.com>
|
||||
KO Myung-Hun <komh@chollian.net>
|
||||
@@ -89,7 +82,6 @@ Mike Hommey <mhommey@mozilla.com>
|
||||
Mikhal Shemer <mikhal@google.com>
|
||||
Minghai Shang <minghai@google.com>
|
||||
Morton Jonuschat <yabawock@gmail.com>
|
||||
Nico Weber <thakis@chromium.org>
|
||||
Parag Salasakar <img.mips1@gmail.com>
|
||||
Pascal Massimino <pascal.massimino@gmail.com>
|
||||
Patrik Westin <patrik.westin@gmail.com>
|
||||
@@ -104,7 +96,7 @@ Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
|
||||
Rafaël Carré <funman@videolan.org>
|
||||
Ralph Giles <giles@xiph.org>
|
||||
Rob Bradford <rob@linux.intel.com>
|
||||
Ronald S. Bultje <rsbultje@gmail.com>
|
||||
Ronald S. Bultje <rbultje@google.com>
|
||||
Rui Ueyama <ruiu@google.com>
|
||||
Sami Pietilä <samipietila@google.com>
|
||||
Scott Graham <scottmg@chromium.org>
|
||||
@@ -112,7 +104,6 @@ Scott LaVarnway <slavarnway@google.com>
|
||||
Sean McGovern <gseanmcg@gmail.com>
|
||||
Sergey Ulanov <sergeyu@chromium.org>
|
||||
Shimon Doodkin <helpmepro1@gmail.com>
|
||||
Shunyao Li <shunyaoli@google.com>
|
||||
Stefan Holmer <holmer@google.com>
|
||||
Suman Sunkara <sunkaras@google.com>
|
||||
Taekhyun Kim <takim@nvidia.com>
|
||||
|
24
CHANGELOG
24
CHANGELOG
@@ -1,23 +1,7 @@
|
||||
Next Release
|
||||
- Incompatible changes:
|
||||
The VP9 encoder's default keyframe interval changed to 128 from 9999.
|
||||
|
||||
2015-11-09 v1.5.0 "Javan Whistling Duck"
|
||||
This release improves upon the VP9 encoder and speeds up the encoding and
|
||||
decoding processes.
|
||||
|
||||
- Upgrading:
|
||||
This release is ABI incompatible with 1.4.0. It drops deprecated VP8
|
||||
controls and adds a variety of VP9 controls for testing.
|
||||
|
||||
The vpxenc utility now prefers VP9 by default.
|
||||
|
||||
- Enhancements:
|
||||
Faster VP9 encoding and decoding
|
||||
Smaller library size by combining functions used by VP8 and VP9
|
||||
|
||||
- Bug Fixes:
|
||||
A variety of fuzzing issues
|
||||
xxxx-yy-zz v1.4.0 "Changes for next release"
|
||||
vpxenc is changed to use VP9 by default.
|
||||
Encoder controls added for 1 pass SVC.
|
||||
Decoder control to toggle on/off loopfilter.
|
||||
|
||||
2015-04-03 v1.4.0 "Indian Runner Duck"
|
||||
This release includes significant improvements to the VP9 codec.
|
||||
|
5
README
5
README
@@ -47,6 +47,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
||||
--help output of the configure script. As of this writing, the list of
|
||||
available targets is:
|
||||
|
||||
armv6-darwin-gcc
|
||||
armv6-linux-rvct
|
||||
armv6-linux-gcc
|
||||
armv6-none-rvct
|
||||
@@ -58,7 +59,6 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
||||
armv7-none-rvct
|
||||
armv7-win32-vs11
|
||||
armv7-win32-vs12
|
||||
armv7-win32-vs14
|
||||
armv7s-darwin-gcc
|
||||
mips32-linux-gcc
|
||||
mips64-linux-gcc
|
||||
@@ -85,8 +85,6 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
||||
x86-win32-vs10
|
||||
x86-win32-vs11
|
||||
x86-win32-vs12
|
||||
x86-win32-vs14
|
||||
x86_64-android-gcc
|
||||
x86_64-darwin9-gcc
|
||||
x86_64-darwin10-gcc
|
||||
x86_64-darwin11-gcc
|
||||
@@ -103,7 +101,6 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
||||
x86_64-win64-vs10
|
||||
x86_64-win64-vs11
|
||||
x86_64-win64-vs12
|
||||
x86_64-win64-vs14
|
||||
generic-gnu
|
||||
|
||||
The generic-gnu target, in conjunction with the CROSS environment variable,
|
||||
|
@@ -67,8 +67,6 @@ else ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
LOCAL_ARM_MODE := arm
|
||||
else ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
include $(CONFIG_DIR)libs-x86-android-gcc.mk
|
||||
else ifeq ($(TARGET_ARCH_ABI),x86_64)
|
||||
include $(CONFIG_DIR)libs-x86_64-android-gcc.mk
|
||||
else ifeq ($(TARGET_ARCH_ABI),mips)
|
||||
include $(CONFIG_DIR)libs-mips-android-gcc.mk
|
||||
else
|
||||
@@ -166,22 +164,17 @@ endif
|
||||
|
||||
# Add a dependency to force generation of the RTCD files.
|
||||
define rtcd_dep_template
|
||||
rtcd_dep_template_SRCS := $(addprefix $(LOCAL_PATH)/, $(LOCAL_SRC_FILES))
|
||||
rtcd_dep_template_SRCS := $$(rtcd_dep_template_SRCS:.neon=)
|
||||
ifeq ($(CONFIG_VP8), yes)
|
||||
$$(rtcd_dep_template_SRCS): vp8_rtcd.h
|
||||
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp8_rtcd.h
|
||||
endif
|
||||
ifeq ($(CONFIG_VP9), yes)
|
||||
$$(rtcd_dep_template_SRCS): vp9_rtcd.h
|
||||
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp9_rtcd.h
|
||||
endif
|
||||
ifeq ($(CONFIG_VP10), yes)
|
||||
$$(rtcd_dep_template_SRCS): vp10_rtcd.h
|
||||
endif
|
||||
$$(rtcd_dep_template_SRCS): vpx_scale_rtcd.h
|
||||
$$(rtcd_dep_template_SRCS): vpx_dsp_rtcd.h
|
||||
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_scale_rtcd.h
|
||||
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_dsp_rtcd.h
|
||||
|
||||
ifneq ($(findstring $(TARGET_ARCH_ABI),x86 x86_64),)
|
||||
$$(rtcd_dep_template_SRCS): vpx_config.asm
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_config.asm
|
||||
endif
|
||||
endef
|
||||
|
||||
|
@@ -140,8 +140,6 @@ $(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%vp9_reconintra.c.d: CFLAGS += $(STACKREALIGN)
|
||||
$(BUILD_PFX)%vp9_reconintra.c.o: CFLAGS += $(STACKREALIGN)
|
||||
|
||||
$(BUILD_PFX)%.c.d: %.c
|
||||
$(if $(quiet),@echo " [DEP] $@")
|
||||
@@ -287,7 +285,7 @@ define archive_template
|
||||
# for creating them.
|
||||
$(1):
|
||||
$(if $(quiet),@echo " [AR] $$@")
|
||||
$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
|
||||
$(qexec)$$(AR) $$(ARFLAGS) $$@ $$?
|
||||
endef
|
||||
|
||||
define so_template
|
||||
|
@@ -73,7 +73,6 @@ Build options:
|
||||
--target=TARGET target platform tuple [generic-gnu]
|
||||
--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]
|
||||
${toggle_extra_warnings} emit harmless warnings (always non-fatal)
|
||||
${toggle_werror} treat warnings as errors, if possible
|
||||
(not available with all compilers)
|
||||
@@ -201,10 +200,6 @@ disabled(){
|
||||
eval test "x\$$1" = "xno"
|
||||
}
|
||||
|
||||
# Iterates through positional parameters, checks to confirm the parameter has
|
||||
# not been explicitly (force) disabled, and enables the setting controlled by
|
||||
# the parameter when the setting is not disabled.
|
||||
# Note: Does NOT alter RTCD generation options ($RTCD_OPTIONS).
|
||||
soft_enable() {
|
||||
for var in $*; do
|
||||
if ! disabled $var; then
|
||||
@@ -214,10 +209,6 @@ soft_enable() {
|
||||
done
|
||||
}
|
||||
|
||||
# Iterates through positional parameters, checks to confirm the parameter has
|
||||
# not been explicitly (force) enabled, and disables the setting controlled by
|
||||
# the parameter when the setting is not enabled.
|
||||
# Note: Does NOT alter RTCD generation options ($RTCD_OPTIONS).
|
||||
soft_disable() {
|
||||
for var in $*; do
|
||||
if ! enabled $var; then
|
||||
@@ -346,10 +337,6 @@ check_add_cflags() {
|
||||
check_cflags "$@" && add_cflags_only "$@"
|
||||
}
|
||||
|
||||
check_add_cxxflags() {
|
||||
check_cxxflags "$@" && add_cxxflags_only "$@"
|
||||
}
|
||||
|
||||
check_add_asflags() {
|
||||
log add_asflags "$@"
|
||||
add_asflags "$@"
|
||||
@@ -441,7 +428,7 @@ NM=${NM}
|
||||
|
||||
CFLAGS = ${CFLAGS}
|
||||
CXXFLAGS = ${CXXFLAGS}
|
||||
ARFLAGS = -crs\$(if \$(quiet),,v)
|
||||
ARFLAGS = -rus\$(if \$(quiet),c,v)
|
||||
LDFLAGS = ${LDFLAGS}
|
||||
ASFLAGS = ${ASFLAGS}
|
||||
extralibs = ${extralibs}
|
||||
@@ -516,9 +503,6 @@ process_common_cmdline() {
|
||||
--extra-cflags=*)
|
||||
extra_cflags="${optval}"
|
||||
;;
|
||||
--extra-cxxflags=*)
|
||||
extra_cxxflags="${optval}"
|
||||
;;
|
||||
--enable-?*|--disable-?*)
|
||||
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
||||
if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
|
||||
@@ -633,24 +617,16 @@ show_darwin_sdk_path() {
|
||||
xcodebuild -sdk $1 -version Path 2>/dev/null
|
||||
}
|
||||
|
||||
# Print the major version number of the Darwin SDK specified by $1.
|
||||
show_darwin_sdk_major_version() {
|
||||
xcrun --sdk $1 --show-sdk-version 2>/dev/null | cut -d. -f1
|
||||
}
|
||||
|
||||
process_common_toolchain() {
|
||||
if [ -z "$toolchain" ]; then
|
||||
gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
|
||||
|
||||
# detect tgt_isa
|
||||
case "$gcctarget" in
|
||||
aarch64*)
|
||||
tgt_isa=arm64
|
||||
;;
|
||||
armv6*)
|
||||
tgt_isa=armv6
|
||||
;;
|
||||
armv7*-hardfloat* | armv7*-gnueabihf | arm-*-gnueabihf)
|
||||
armv7*-hardfloat*)
|
||||
tgt_isa=armv7
|
||||
float_abi=hard
|
||||
;;
|
||||
@@ -691,10 +667,6 @@ process_common_toolchain() {
|
||||
tgt_isa=x86_64
|
||||
tgt_os=darwin14
|
||||
;;
|
||||
*darwin15*)
|
||||
tgt_isa=x86_64
|
||||
tgt_os=darwin15
|
||||
;;
|
||||
x86_64*mingw32*)
|
||||
tgt_os=win64
|
||||
;;
|
||||
@@ -757,14 +729,13 @@ process_common_toolchain() {
|
||||
# platforms, so use the newest one available.
|
||||
case ${toolchain} in
|
||||
arm*-darwin*)
|
||||
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
|
||||
iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
|
||||
if [ -d "${iphoneos_sdk_dir}" ]; then
|
||||
add_cflags "-isysroot ${iphoneos_sdk_dir}"
|
||||
add_ldflags "-isysroot ${iphoneos_sdk_dir}"
|
||||
ios_sdk_dir="$(show_darwin_sdk_path iphoneos)"
|
||||
if [ -d "${ios_sdk_dir}" ]; then
|
||||
add_cflags "-isysroot ${ios_sdk_dir}"
|
||||
add_ldflags "-isysroot ${ios_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}"
|
||||
@@ -802,10 +773,6 @@ process_common_toolchain() {
|
||||
add_cflags "-mmacosx-version-min=10.10"
|
||||
add_ldflags "-mmacosx-version-min=10.10"
|
||||
;;
|
||||
*-darwin15-*)
|
||||
add_cflags "-mmacosx-version-min=10.11"
|
||||
add_ldflags "-mmacosx-version-min=10.11"
|
||||
;;
|
||||
*-iphonesimulator-*)
|
||||
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
|
||||
add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
|
||||
@@ -844,35 +811,16 @@ process_common_toolchain() {
|
||||
die "Disabling neon while keeping neon-asm is not supported"
|
||||
fi
|
||||
case ${toolchain} in
|
||||
# Apple iOS SDKs no longer support armv6 as of the version 9
|
||||
# release (coincides with release of Xcode 7). Only enable media
|
||||
# when using earlier SDK releases.
|
||||
*-darwin*)
|
||||
if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
|
||||
soft_enable media
|
||||
else
|
||||
soft_disable media
|
||||
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-media "
|
||||
fi
|
||||
# Neon is guaranteed on iOS 6+ devices, while old media extensions
|
||||
# no longer assemble with iOS 9 SDK
|
||||
;;
|
||||
*)
|
||||
soft_enable media
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
armv6)
|
||||
case ${toolchain} in
|
||||
*-darwin*)
|
||||
if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
|
||||
soft_enable media
|
||||
else
|
||||
die "Your iOS SDK does not support armv6."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
soft_enable media
|
||||
;;
|
||||
esac
|
||||
soft_enable media
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -880,6 +828,7 @@ process_common_toolchain() {
|
||||
|
||||
case ${tgt_cc} in
|
||||
gcc)
|
||||
CROSS=${CROSS:-arm-none-linux-gnueabi-}
|
||||
link_with_cc=gcc
|
||||
setup_gnu_toolchain
|
||||
arch_int=${tgt_isa##armv}
|
||||
@@ -989,10 +938,8 @@ EOF
|
||||
awk '{ print $1 }' | tail -1`
|
||||
fi
|
||||
|
||||
if [ -d "${alt_libc}" ]; then
|
||||
add_cflags "--sysroot=${alt_libc}"
|
||||
add_ldflags "--sysroot=${alt_libc}"
|
||||
fi
|
||||
add_cflags "--sysroot=${alt_libc}"
|
||||
add_ldflags "--sysroot=${alt_libc}"
|
||||
|
||||
# linker flag that routes around a CPU bug in some
|
||||
# Cortex-A8 implementations (NDK Dev Guide)
|
||||
@@ -1018,7 +965,18 @@ EOF
|
||||
NM="$(${XCRUN_FIND} nm)"
|
||||
RANLIB="$(${XCRUN_FIND} ranlib)"
|
||||
AS_SFX=.s
|
||||
LD="${CXX:-$(${XCRUN_FIND} ld)}"
|
||||
|
||||
# Special handling of ld for armv6 because libclang_rt.ios.a does
|
||||
# not contain armv6 support in Apple's clang package:
|
||||
# Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn).
|
||||
# TODO(tomfinegan): Remove this. Our minimum iOS version (6.0)
|
||||
# renders support for armv6 unnecessary because the 3GS and up
|
||||
# support neon.
|
||||
if [ "${tgt_isa}" = "armv6" ]; then
|
||||
LD="$(${XCRUN_FIND} ld)"
|
||||
else
|
||||
LD="${CXX:-$(${XCRUN_FIND} ld)}"
|
||||
fi
|
||||
|
||||
# ASFLAGS is written here instead of using check_add_asflags
|
||||
# because we need to overwrite all of ASFLAGS and purge the
|
||||
@@ -1045,12 +1003,6 @@ EOF
|
||||
done
|
||||
|
||||
asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
|
||||
|
||||
if [ "$(show_darwin_sdk_major_version iphoneos)" -gt 8 ]; then
|
||||
check_add_cflags -fembed-bitcode
|
||||
check_add_asflags -fembed-bitcode
|
||||
check_add_ldflags -fembed-bitcode
|
||||
fi
|
||||
;;
|
||||
|
||||
linux*)
|
||||
@@ -1058,7 +1010,7 @@ EOF
|
||||
if enabled rvct; then
|
||||
# Check if we have CodeSourcery GCC in PATH. Needed for
|
||||
# libraries
|
||||
which arm-none-linux-gnueabi-gcc 2>&- || \
|
||||
hash arm-none-linux-gnueabi-gcc 2>&- || \
|
||||
die "Couldn't find CodeSourcery GCC from PATH"
|
||||
|
||||
# Use armcc as a linker to enable translation of
|
||||
@@ -1126,12 +1078,10 @@ EOF
|
||||
CC=${CC:-${CROSS}gcc}
|
||||
CXX=${CXX:-${CROSS}g++}
|
||||
LD=${LD:-${CROSS}gcc}
|
||||
CROSS=${CROSS-g}
|
||||
CROSS=${CROSS:-g}
|
||||
;;
|
||||
os2)
|
||||
disable_feature pic
|
||||
AS=${AS:-nasm}
|
||||
add_ldflags -Zhigh-mem
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1179,12 +1129,6 @@ EOF
|
||||
soft_disable avx2
|
||||
;;
|
||||
esac
|
||||
case $vc_version in
|
||||
7|8|9)
|
||||
echo "${tgt_cc} omits stdint.h, disabling webm-io..."
|
||||
soft_disable webm_io
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1205,43 +1149,32 @@ EOF
|
||||
soft_enable runtime_cpu_detect
|
||||
# We can't use 'check_cflags' until the compiler is configured and CC is
|
||||
# populated.
|
||||
for ext in ${ARCH_EXT_LIST_X86}; do
|
||||
# disable higher order extensions to simplify asm dependencies
|
||||
if [ "$disable_exts" = "yes" ]; then
|
||||
if ! disabled $ext; then
|
||||
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${ext} "
|
||||
disable_feature $ext
|
||||
fi
|
||||
elif disabled $ext; then
|
||||
disable_exts="yes"
|
||||
else
|
||||
# use the shortened version for the flag: sse4_1 -> sse4
|
||||
check_gcc_machine_option ${ext%_*} $ext
|
||||
fi
|
||||
done
|
||||
check_gcc_machine_option mmx
|
||||
check_gcc_machine_option sse
|
||||
check_gcc_machine_option sse2
|
||||
check_gcc_machine_option sse3
|
||||
check_gcc_machine_option ssse3
|
||||
check_gcc_machine_option sse4 sse4_1
|
||||
check_gcc_machine_option avx
|
||||
check_gcc_machine_option avx2
|
||||
|
||||
if enabled external_build; then
|
||||
log_echo " skipping assembler detection"
|
||||
else
|
||||
case "${AS}" in
|
||||
auto|"")
|
||||
which nasm >/dev/null 2>&1 && AS=nasm
|
||||
which yasm >/dev/null 2>&1 && AS=yasm
|
||||
if [ "${AS}" = nasm ] ; then
|
||||
# Apple ships version 0.98 of nasm through at least Xcode 6. Revisit
|
||||
# this check if they start shipping a compatible version.
|
||||
apple=`nasm -v | grep "Apple"`
|
||||
[ -n "${apple}" ] \
|
||||
&& echo "Unsupported version of nasm: ${apple}" \
|
||||
&& AS=""
|
||||
fi
|
||||
[ "${AS}" = auto ] || [ -z "${AS}" ] \
|
||||
&& die "Neither yasm nor nasm have been found." \
|
||||
"See the prerequisites section in the README for more info."
|
||||
;;
|
||||
esac
|
||||
log_echo " using $AS"
|
||||
fi
|
||||
case "${AS}" in
|
||||
auto|"")
|
||||
which nasm >/dev/null 2>&1 && AS=nasm
|
||||
which yasm >/dev/null 2>&1 && AS=yasm
|
||||
if [ "${AS}" = nasm ] ; then
|
||||
# Apple ships version 0.98 of nasm through at least Xcode 6. Revisit
|
||||
# this check if they start shipping a compatible version.
|
||||
apple=`nasm -v | grep "Apple"`
|
||||
[ -n "${apple}" ] \
|
||||
&& echo "Unsupported version of nasm: ${apple}" \
|
||||
&& AS=""
|
||||
fi
|
||||
[ "${AS}" = auto ] || [ -z "${AS}" ] \
|
||||
&& die "Neither yasm nor nasm have been found"
|
||||
;;
|
||||
esac
|
||||
log_echo " using $AS"
|
||||
[ "${AS##*/}" = nasm ] && add_asflags -Ox
|
||||
AS_SFX=.asm
|
||||
case ${tgt_os} in
|
||||
@@ -1277,13 +1210,6 @@ EOF
|
||||
enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64"
|
||||
add_cflags ${sim_arch}
|
||||
add_ldflags ${sim_arch}
|
||||
|
||||
if [ "$(show_darwin_sdk_major_version iphonesimulator)" -gt 8 ]; then
|
||||
# yasm v1.3.0 doesn't know what -fembed-bitcode means, so turning it
|
||||
# on is pointless (unless building a C-only lib). Warn the user, but
|
||||
# do nothing here.
|
||||
log "Warning: Bitcode embed disabled for simulator targets."
|
||||
fi
|
||||
;;
|
||||
os2)
|
||||
add_asflags -f aout
|
||||
@@ -1397,6 +1323,12 @@ EOF
|
||||
add_cflags -D_LARGEFILE_SOURCE
|
||||
add_cflags -D_FILE_OFFSET_BITS=64
|
||||
fi
|
||||
|
||||
# append any user defined extra cflags
|
||||
if [ -n "${extra_cflags}" ] ; then
|
||||
check_add_cflags ${extra_cflags} || \
|
||||
die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler"
|
||||
fi
|
||||
}
|
||||
|
||||
process_toolchain() {
|
||||
|
@@ -73,10 +73,6 @@ generate_filter() {
|
||||
open_tag File RelativePath="$f"
|
||||
|
||||
if [ "$pat" == "asm" ] && $asm_use_custom_step; then
|
||||
# Avoid object file name collisions, i.e. vpx_config.c and
|
||||
# vpx_config.asm produce the same object file without
|
||||
# this additional suffix.
|
||||
objf=${objf%.obj}_asm.obj
|
||||
for plat in "${platforms[@]}"; do
|
||||
for cfg in Debug Release; do
|
||||
open_tag FileConfiguration \
|
||||
@@ -193,7 +189,7 @@ for opt in "$@"; do
|
||||
done
|
||||
|
||||
# Make one call to fix_path for file_list to improve performance.
|
||||
fix_file_list file_list
|
||||
fix_file_list
|
||||
|
||||
outfile=${outfile:-/dev/stdout}
|
||||
guid=${guid:-`generate_uuid`}
|
||||
|
@@ -19,13 +19,13 @@ show_help() {
|
||||
cat <<EOF
|
||||
Usage: ${self_basename} [options] file1 [file2 ...]
|
||||
|
||||
This script generates a Visual Studio solution file from a list of project
|
||||
This script generates a Visual Studio 2005 solution file from a list of project
|
||||
files.
|
||||
|
||||
Options:
|
||||
--help Print this message
|
||||
--out=outfile Redirect output to a file
|
||||
--ver=version Version (7,8,9,10,11,12,14) of visual studio to generate for
|
||||
--ver=version Version (7,8,9,10,11) of visual studio to generate for
|
||||
--target=isa-os-cc Target specifier
|
||||
EOF
|
||||
exit 1
|
||||
@@ -255,7 +255,7 @@ for opt in "$@"; do
|
||||
;;
|
||||
--ver=*) vs_ver="$optval"
|
||||
case $optval in
|
||||
[789]|10|11|12|14)
|
||||
[789]|10|11|12)
|
||||
;;
|
||||
*) die Unrecognized Visual Studio Version in $opt
|
||||
;;
|
||||
@@ -300,15 +300,12 @@ case "${vs_ver:-8}" in
|
||||
12) sln_vers="12.00"
|
||||
sln_vers_str="Visual Studio 2013"
|
||||
;;
|
||||
14) sln_vers="14.00"
|
||||
sln_vers_str="Visual Studio 2015"
|
||||
;;
|
||||
esac
|
||||
case "${vs_ver:-8}" in
|
||||
[789])
|
||||
sfx=vcproj
|
||||
;;
|
||||
10|11|12|14)
|
||||
10|11|12)
|
||||
sfx=vcxproj
|
||||
;;
|
||||
esac
|
||||
|
@@ -34,7 +34,7 @@ Options:
|
||||
--name=project_name Name of the project (required)
|
||||
--proj-guid=GUID GUID to use for the project
|
||||
--module-def=filename File containing export definitions (for DLLs)
|
||||
--ver=version Version (10,11,12,14) of visual studio to generate for
|
||||
--ver=version Version (10,11,12) of visual studio to generate for
|
||||
--src-path-bare=dir Path to root of source tree
|
||||
-Ipath/to/include Additional include directories
|
||||
-DFLAG[=value] Preprocessor macros to define
|
||||
@@ -168,7 +168,7 @@ for opt in "$@"; do
|
||||
--ver=*)
|
||||
vs_ver="$optval"
|
||||
case "$optval" in
|
||||
10|11|12|14)
|
||||
10|11|12)
|
||||
;;
|
||||
*) die Unrecognized Visual Studio Version in $opt
|
||||
;;
|
||||
@@ -211,14 +211,14 @@ for opt in "$@"; do
|
||||
done
|
||||
|
||||
# Make one call to fix_path for file_list to improve performance.
|
||||
fix_file_list file_list
|
||||
fix_file_list
|
||||
|
||||
outfile=${outfile:-/dev/stdout}
|
||||
guid=${guid:-`generate_uuid`}
|
||||
asm_use_custom_step=false
|
||||
uses_asm=${uses_asm:-false}
|
||||
case "${vs_ver:-11}" in
|
||||
10|11|12|14)
|
||||
10|11|12)
|
||||
asm_use_custom_step=$uses_asm
|
||||
;;
|
||||
esac
|
||||
@@ -344,9 +344,6 @@ generate_vcxproj() {
|
||||
# has to enable AppContainerApplication as well.
|
||||
tag_content PlatformToolset v120
|
||||
fi
|
||||
if [ "$vs_ver" = "14" ]; then
|
||||
tag_content PlatformToolset v140
|
||||
fi
|
||||
tag_content CharacterSet Unicode
|
||||
if [ "$config" = "Release" ]; then
|
||||
tag_content WholeProgramOptimization true
|
||||
|
@@ -24,44 +24,32 @@ CONFIGURE_ARGS="--disable-docs
|
||||
--disable-unit-tests"
|
||||
DIST_DIR="_dist"
|
||||
FRAMEWORK_DIR="VPX.framework"
|
||||
FRAMEWORK_LIB="VPX.framework/VPX"
|
||||
HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx"
|
||||
MAKE_JOBS=1
|
||||
SCRIPT_DIR=$(dirname "$0")
|
||||
LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd)
|
||||
LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo)
|
||||
ORIG_PWD="$(pwd)"
|
||||
ARM_TARGETS="arm64-darwin-gcc
|
||||
armv7-darwin-gcc
|
||||
armv7s-darwin-gcc"
|
||||
SIM_TARGETS="x86-iphonesimulator-gcc
|
||||
x86_64-iphonesimulator-gcc"
|
||||
OSX_TARGETS="x86-darwin15-gcc
|
||||
x86_64-darwin15-gcc"
|
||||
TARGETS="${ARM_TARGETS} ${SIM_TARGETS}"
|
||||
TARGETS="arm64-darwin-gcc
|
||||
armv7-darwin-gcc
|
||||
armv7s-darwin-gcc
|
||||
x86-iphonesimulator-gcc
|
||||
x86_64-iphonesimulator-gcc"
|
||||
|
||||
# Configures for the target specified by $1, and invokes make with the dist
|
||||
# target using $DIST_DIR as the distribution output directory.
|
||||
build_target() {
|
||||
local target="$1"
|
||||
local old_pwd="$(pwd)"
|
||||
local target_specific_flags=""
|
||||
|
||||
vlog "***Building target: ${target}***"
|
||||
|
||||
case "${target}" in
|
||||
x86-*)
|
||||
target_specific_flags="--enable-pic"
|
||||
vlog "Enabled PIC for ${target}"
|
||||
;;
|
||||
esac
|
||||
|
||||
mkdir "${target}"
|
||||
cd "${target}"
|
||||
eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \
|
||||
${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${target_specific_flags} \
|
||||
${devnull}
|
||||
${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${devnull}
|
||||
export DIST_DIR
|
||||
eval make dist ${devnull}
|
||||
eval make -j ${MAKE_JOBS} dist ${devnull}
|
||||
cd "${old_pwd}"
|
||||
|
||||
vlog "***Done building target: ${target}***"
|
||||
@@ -138,44 +126,6 @@ create_vpx_framework_config_shim() {
|
||||
printf "#endif // ${include_guard}" >> "${config_file}"
|
||||
}
|
||||
|
||||
# Verifies that $FRAMEWORK_LIB fat library contains requested builds.
|
||||
verify_framework_targets() {
|
||||
local requested_cpus=""
|
||||
local cpu=""
|
||||
|
||||
# Extract CPU from full target name.
|
||||
for target; do
|
||||
cpu="${target%%-*}"
|
||||
if [ "${cpu}" = "x86" ]; then
|
||||
# lipo -info outputs i386 for libvpx x86 targets.
|
||||
cpu="i386"
|
||||
fi
|
||||
requested_cpus="${requested_cpus}${cpu} "
|
||||
done
|
||||
|
||||
# Get target CPUs present in framework library.
|
||||
local targets_built=$(${LIPO} -info ${FRAMEWORK_LIB})
|
||||
|
||||
# $LIPO -info outputs a string like the following:
|
||||
# Architectures in the fat file: $FRAMEWORK_LIB <architectures>
|
||||
# Capture only the architecture strings.
|
||||
targets_built=${targets_built##*: }
|
||||
|
||||
# Sort CPU strings to make the next step a simple string compare.
|
||||
local actual=$(echo ${targets_built} | tr " " "\n" | sort | tr "\n" " ")
|
||||
local requested=$(echo ${requested_cpus} | tr " " "\n" | sort | tr "\n" " ")
|
||||
|
||||
vlog "Requested ${FRAMEWORK_LIB} CPUs: ${requested}"
|
||||
vlog "Actual ${FRAMEWORK_LIB} CPUs: ${actual}"
|
||||
|
||||
if [ "${requested}" != "${actual}" ]; then
|
||||
elog "Actual ${FRAMEWORK_LIB} targets do not match requested target list."
|
||||
elog " Requested target CPUs: ${requested}"
|
||||
elog " Actual target CPUs: ${actual}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Configures and builds each target specified by $1, and then builds
|
||||
# VPX.framework.
|
||||
build_framework() {
|
||||
@@ -215,13 +165,13 @@ build_framework() {
|
||||
# Copy in vpx_version.h.
|
||||
cp -p "${BUILD_ROOT}/${target}/vpx_version.h" "${HEADER_DIR}"
|
||||
|
||||
# Confirm VPX.framework/VPX contains the targets requested.
|
||||
verify_framework_targets ${targets}
|
||||
|
||||
vlog "Created fat library ${FRAMEWORK_LIB} containing:"
|
||||
vlog "Created fat library ${FRAMEWORK_DIR}/VPX containing:"
|
||||
for lib in ${lib_list}; do
|
||||
vlog " $(echo ${lib} | awk -F / '{print $2, $NF}')"
|
||||
done
|
||||
|
||||
# TODO(tomfinegan): Verify that expected targets are included within
|
||||
# VPX.framework/VPX via lipo -info.
|
||||
}
|
||||
|
||||
# Trap function. Cleans up the subtree used to build all targets contained in
|
||||
@@ -239,29 +189,16 @@ cleanup() {
|
||||
fi
|
||||
}
|
||||
|
||||
print_list() {
|
||||
local indent="$1"
|
||||
shift
|
||||
local list="$@"
|
||||
for entry in ${list}; do
|
||||
echo "${indent}${entry}"
|
||||
done
|
||||
}
|
||||
|
||||
iosbuild_usage() {
|
||||
cat << EOF
|
||||
Usage: ${0##*/} [arguments]
|
||||
--help: Display this message and exit.
|
||||
--extra-configure-args <args>: Extra args to pass when configuring libvpx.
|
||||
--macosx: Uses darwin15 targets instead of iphonesimulator targets for x86
|
||||
and x86_64. Allows linking to framework when builds target MacOSX
|
||||
instead of iOS.
|
||||
--jobs: Number of make jobs.
|
||||
--preserve-build-output: Do not delete the build directory.
|
||||
--show-build-output: Show output from each library build.
|
||||
--targets <targets>: Override default target list. Defaults:
|
||||
$(print_list " " ${TARGETS})
|
||||
--test-link: Confirms all targets can be linked. Functionally identical to
|
||||
passing --enable-examples via --extra-configure-args.
|
||||
${TARGETS}
|
||||
--verbose: Output information about the environment and each stage of the
|
||||
build.
|
||||
EOF
|
||||
@@ -290,22 +227,20 @@ while [ -n "$1" ]; do
|
||||
iosbuild_usage
|
||||
exit
|
||||
;;
|
||||
--jobs)
|
||||
MAKE_JOBS="$2"
|
||||
shift
|
||||
;;
|
||||
--preserve-build-output)
|
||||
PRESERVE_BUILD_OUTPUT=yes
|
||||
;;
|
||||
--show-build-output)
|
||||
devnull=
|
||||
;;
|
||||
--test-link)
|
||||
EXTRA_CONFIGURE_ARGS="${EXTRA_CONFIGURE_ARGS} --enable-examples"
|
||||
;;
|
||||
--targets)
|
||||
TARGETS="$2"
|
||||
shift
|
||||
;;
|
||||
--macosx)
|
||||
TARGETS="${ARM_TARGETS} ${OSX_TARGETS}"
|
||||
;;
|
||||
--verbose)
|
||||
VERBOSE=yes
|
||||
;;
|
||||
@@ -324,19 +259,16 @@ cat << EOF
|
||||
CONFIGURE_ARGS=${CONFIGURE_ARGS}
|
||||
EXTRA_CONFIGURE_ARGS=${EXTRA_CONFIGURE_ARGS}
|
||||
FRAMEWORK_DIR=${FRAMEWORK_DIR}
|
||||
FRAMEWORK_LIB=${FRAMEWORK_LIB}
|
||||
HEADER_DIR=${HEADER_DIR}
|
||||
MAKE_JOBS=${MAKE_JOBS}
|
||||
PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
|
||||
LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR}
|
||||
LIPO=${LIPO}
|
||||
MAKEFLAGS=${MAKEFLAGS}
|
||||
ORIG_PWD=${ORIG_PWD}
|
||||
PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
|
||||
TARGETS="$(print_list "" ${TARGETS})"
|
||||
OSX_TARGETS="${OSX_TARGETS}"
|
||||
SIM_TARGETS="${SIM_TARGETS}"
|
||||
TARGETS="${TARGETS}"
|
||||
EOF
|
||||
fi
|
||||
|
||||
build_framework "${TARGETS}"
|
||||
echo "Successfully built '${FRAMEWORK_DIR}' for:"
|
||||
print_list "" ${TARGETS}
|
||||
echo " ${TARGETS}"
|
||||
|
@@ -39,12 +39,11 @@ fix_path() {
|
||||
}
|
||||
|
||||
# Corrects the paths in file_list in one pass for efficiency.
|
||||
# $1 is the name of the array to be modified.
|
||||
fix_file_list() {
|
||||
declare -n array_ref=$1
|
||||
files=$(fix_path "${array_ref[@]}")
|
||||
# TODO(jzern): this could be more generic and take the array as a param.
|
||||
files=$(fix_path "${file_list[@]}")
|
||||
local IFS=$'\n'
|
||||
array_ref=($files)
|
||||
file_list=($files)
|
||||
}
|
||||
|
||||
generate_uuid() {
|
||||
|
@@ -319,15 +319,14 @@ EOF
|
||||
|
||||
print <<EOF;
|
||||
#if HAVE_DSPR2
|
||||
void vpx_dsputil_static_init();
|
||||
#if CONFIG_VP8
|
||||
void dsputil_static_init();
|
||||
#endif
|
||||
|
||||
vpx_dsputil_static_init();
|
||||
#if CONFIG_VP8
|
||||
dsputil_static_init();
|
||||
#endif
|
||||
#if CONFIG_VP9
|
||||
void vp9_dsputil_static_init();
|
||||
vp9_dsputil_static_init();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@@ -24,9 +24,8 @@ out_file=${2}
|
||||
id=${3:-VERSION_STRING}
|
||||
|
||||
git_version_id=""
|
||||
if [ -e "${source_path}/.git" ]; then
|
||||
if [ -d "${source_path}/.git" ]; then
|
||||
# Source Path is a git working copy. Check for local modifications.
|
||||
# Note that git submodules may have a file as .git, not a directory.
|
||||
export GIT_DIR="${source_path}/.git"
|
||||
git_version_id=`git describe --match=v[0-9]* 2>/dev/null`
|
||||
fi
|
||||
|
@@ -1,4 +0,0 @@
|
||||
# This file is used by gcl to get repository specific information.
|
||||
GERRIT_HOST: chromium-review.googlesource.com
|
||||
GERRIT_PORT: 29418
|
||||
CODE_REVIEW_SERVER: chromium-review.googlesource.com
|
75
configure
vendored
75
configure
vendored
@@ -35,12 +35,8 @@ Advanced options:
|
||||
${toggle_debug_libs} in/exclude debug version of libraries
|
||||
${toggle_static_msvcrt} use static MSVCRT (VS builds only)
|
||||
${toggle_vp9_highbitdepth} use VP9 high bit depth (10/12) profiles
|
||||
${toggle_better_hw_compatibility}
|
||||
enable encoder to produce streams with better
|
||||
hardware decoder compatibility
|
||||
${toggle_vp8} VP8 codec support
|
||||
${toggle_vp9} VP9 codec support
|
||||
${toggle_vp10} VP10 codec support
|
||||
${toggle_internal_stats} output of encoder internal stats for debug, if supported (encoders)
|
||||
${toggle_postproc} postprocessing
|
||||
${toggle_vp9_postproc} vp9 specific postprocessing
|
||||
@@ -98,11 +94,11 @@ EOF
|
||||
|
||||
# all_platforms is a list of all supported target platforms. Maintain
|
||||
# alphabetically by architecture, generic-gnu last.
|
||||
all_platforms="${all_platforms} armv6-darwin-gcc"
|
||||
all_platforms="${all_platforms} armv6-linux-rvct"
|
||||
all_platforms="${all_platforms} armv6-linux-gcc"
|
||||
all_platforms="${all_platforms} armv6-none-rvct"
|
||||
all_platforms="${all_platforms} arm64-darwin-gcc"
|
||||
all_platforms="${all_platforms} arm64-linux-gcc"
|
||||
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,7 +106,6 @@ all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8
|
||||
all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8
|
||||
all_platforms="${all_platforms} armv7-win32-vs11"
|
||||
all_platforms="${all_platforms} armv7-win32-vs12"
|
||||
all_platforms="${all_platforms} armv7-win32-vs14"
|
||||
all_platforms="${all_platforms} armv7s-darwin-gcc"
|
||||
all_platforms="${all_platforms} mips32-linux-gcc"
|
||||
all_platforms="${all_platforms} mips64-linux-gcc"
|
||||
@@ -125,7 +120,6 @@ all_platforms="${all_platforms} x86-darwin11-gcc"
|
||||
all_platforms="${all_platforms} x86-darwin12-gcc"
|
||||
all_platforms="${all_platforms} x86-darwin13-gcc"
|
||||
all_platforms="${all_platforms} x86-darwin14-gcc"
|
||||
all_platforms="${all_platforms} x86-darwin15-gcc"
|
||||
all_platforms="${all_platforms} x86-iphonesimulator-gcc"
|
||||
all_platforms="${all_platforms} x86-linux-gcc"
|
||||
all_platforms="${all_platforms} x86-linux-icc"
|
||||
@@ -138,15 +132,12 @@ all_platforms="${all_platforms} x86-win32-vs9"
|
||||
all_platforms="${all_platforms} x86-win32-vs10"
|
||||
all_platforms="${all_platforms} x86-win32-vs11"
|
||||
all_platforms="${all_platforms} x86-win32-vs12"
|
||||
all_platforms="${all_platforms} x86-win32-vs14"
|
||||
all_platforms="${all_platforms} x86_64-android-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin9-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin10-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin11-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin12-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin13-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin14-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin15-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"
|
||||
@@ -157,7 +148,6 @@ all_platforms="${all_platforms} x86_64-win64-vs9"
|
||||
all_platforms="${all_platforms} x86_64-win64-vs10"
|
||||
all_platforms="${all_platforms} x86_64-win64-vs11"
|
||||
all_platforms="${all_platforms} x86_64-win64-vs12"
|
||||
all_platforms="${all_platforms} x86_64-win64-vs14"
|
||||
all_platforms="${all_platforms} generic-gnu"
|
||||
|
||||
# all_targets is a list of all targets that can be configured
|
||||
@@ -197,10 +187,6 @@ fi
|
||||
# disable codecs when their source directory does not exist
|
||||
[ -d "${source_path}/vp8" ] || disable_feature vp8
|
||||
[ -d "${source_path}/vp9" ] || disable_feature vp9
|
||||
[ -d "${source_path}/vp10" ] || disable_feature vp10
|
||||
|
||||
# disable vp10 codec by default
|
||||
disable_feature vp10
|
||||
|
||||
# install everything except the sources, by default. sources will have
|
||||
# to be enabled when doing dist builds, since that's no longer a common
|
||||
@@ -222,13 +208,10 @@ CODECS="
|
||||
vp8_decoder
|
||||
vp9_encoder
|
||||
vp9_decoder
|
||||
vp10_encoder
|
||||
vp10_decoder
|
||||
"
|
||||
CODEC_FAMILIES="
|
||||
vp8
|
||||
vp9
|
||||
vp10
|
||||
"
|
||||
|
||||
ARCH_LIST="
|
||||
@@ -237,16 +220,6 @@ ARCH_LIST="
|
||||
x86
|
||||
x86_64
|
||||
"
|
||||
ARCH_EXT_LIST_X86="
|
||||
mmx
|
||||
sse
|
||||
sse2
|
||||
sse3
|
||||
ssse3
|
||||
sse4_1
|
||||
avx
|
||||
avx2
|
||||
"
|
||||
ARCH_EXT_LIST="
|
||||
edsp
|
||||
media
|
||||
@@ -258,19 +231,29 @@ ARCH_EXT_LIST="
|
||||
msa
|
||||
mips64
|
||||
|
||||
${ARCH_EXT_LIST_X86}
|
||||
mmx
|
||||
sse
|
||||
sse2
|
||||
sse3
|
||||
ssse3
|
||||
sse4_1
|
||||
avx
|
||||
avx2
|
||||
"
|
||||
HAVE_LIST="
|
||||
${ARCH_EXT_LIST}
|
||||
vpx_ports
|
||||
stdint_h
|
||||
pthread_h
|
||||
sys_mman_h
|
||||
unistd_h
|
||||
"
|
||||
EXPERIMENT_LIST="
|
||||
spatial_svc
|
||||
fp_mb_stats
|
||||
full_buffer_test
|
||||
internal_resize
|
||||
emulate_hardware
|
||||
misc_fixes
|
||||
"
|
||||
CONFIG_LIST="
|
||||
dependency_tracking
|
||||
@@ -323,7 +306,6 @@ CONFIG_LIST="
|
||||
vp9_temporal_denoising
|
||||
coefficient_range_checking
|
||||
vp9_highbitdepth
|
||||
better_hw_compatibility
|
||||
experimental
|
||||
size_limit
|
||||
${EXPERIMENT_LIST}
|
||||
@@ -382,7 +364,6 @@ CMDLINE_SELECT="
|
||||
temporal_denoising
|
||||
vp9_temporal_denoising
|
||||
coefficient_range_checking
|
||||
better_hw_compatibility
|
||||
vp9_highbitdepth
|
||||
experimental
|
||||
"
|
||||
@@ -548,12 +529,16 @@ process_detect() {
|
||||
# Specialize windows and POSIX environments.
|
||||
case $toolchain in
|
||||
*-win*-*)
|
||||
# Don't check for any headers in Windows builds.
|
||||
false
|
||||
;;
|
||||
case $header-$toolchain in
|
||||
stdint*-gcc) true;;
|
||||
*) false;;
|
||||
esac && enable_feature $var
|
||||
;;
|
||||
*)
|
||||
case $header in
|
||||
stdint.h) true;;
|
||||
pthread.h) true;;
|
||||
sys/mman.h) true;;
|
||||
unistd.h) true;;
|
||||
*) false;;
|
||||
esac && enable_feature $var
|
||||
@@ -569,7 +554,9 @@ process_detect() {
|
||||
int main(void) {return 0;}
|
||||
EOF
|
||||
# check system headers
|
||||
check_header stdint.h
|
||||
check_header pthread.h
|
||||
check_header sys/mman.h
|
||||
check_header unistd.h # for sysconf(3) and friends.
|
||||
|
||||
check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports
|
||||
@@ -600,11 +587,7 @@ process_toolchain() {
|
||||
;;
|
||||
*) check_add_cflags -Wunused-but-set-variable ;;
|
||||
esac
|
||||
if enabled mips || [ -z "${INLINE}" ]; then
|
||||
enabled extra_warnings || check_add_cflags -Wno-unused-function
|
||||
else
|
||||
check_add_cflags -Wunused-function
|
||||
fi
|
||||
enabled extra_warnings || check_add_cflags -Wno-unused-function
|
||||
fi
|
||||
|
||||
if enabled icc; then
|
||||
@@ -657,7 +640,7 @@ process_toolchain() {
|
||||
VCPROJ_SFX=vcproj
|
||||
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_proj.sh
|
||||
;;
|
||||
10|11|12|14)
|
||||
10|11|12)
|
||||
VCPROJ_SFX=vcxproj
|
||||
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
|
||||
enabled werror && gen_vcproj_cmd="${gen_vcproj_cmd} --enable-werror"
|
||||
@@ -723,16 +706,6 @@ EOF
|
||||
esac
|
||||
# libwebm needs to be linked with C++ standard library
|
||||
enabled webm_io && LD=${CXX}
|
||||
|
||||
# append any user defined extra cflags
|
||||
if [ -n "${extra_cflags}" ] ; then
|
||||
check_add_cflags ${extra_cflags} || \
|
||||
die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler"
|
||||
fi
|
||||
if [ -n "${extra_cxxflags}" ]; then
|
||||
check_add_cxxflags ${extra_cxxflags} || \
|
||||
die "Requested extra CXXFLAGS '${extra_cxxflags}' not supported by compiler"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
49
examples.mk
49
examples.mk
@@ -22,44 +22,33 @@ LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \
|
||||
third_party/libyuv/source/planar_functions.cc \
|
||||
third_party/libyuv/source/row_any.cc \
|
||||
third_party/libyuv/source/row_common.cc \
|
||||
third_party/libyuv/source/row_gcc.cc \
|
||||
third_party/libyuv/source/row_mips.cc \
|
||||
third_party/libyuv/source/row_neon.cc \
|
||||
third_party/libyuv/source/row_neon64.cc \
|
||||
third_party/libyuv/source/row_posix.cc \
|
||||
third_party/libyuv/source/row_win.cc \
|
||||
third_party/libyuv/source/scale.cc \
|
||||
third_party/libyuv/source/scale_any.cc \
|
||||
third_party/libyuv/source/scale_common.cc \
|
||||
third_party/libyuv/source/scale_gcc.cc \
|
||||
third_party/libyuv/source/scale_mips.cc \
|
||||
third_party/libyuv/source/scale_neon.cc \
|
||||
third_party/libyuv/source/scale_neon64.cc \
|
||||
third_party/libyuv/source/scale_posix.cc \
|
||||
third_party/libyuv/source/scale_win.cc \
|
||||
|
||||
LIBWEBM_COMMON_SRCS += third_party/libwebm/common/hdr_util.cc \
|
||||
third_party/libwebm/common/hdr_util.h \
|
||||
third_party/libwebm/common/webmids.h
|
||||
|
||||
LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer/mkvmuxer.cc \
|
||||
third_party/libwebm/mkvmuxer/mkvmuxerutil.cc \
|
||||
third_party/libwebm/mkvmuxer/mkvwriter.cc \
|
||||
third_party/libwebm/mkvmuxer/mkvmuxer.h \
|
||||
third_party/libwebm/mkvmuxer/mkvmuxertypes.h \
|
||||
third_party/libwebm/mkvmuxer/mkvmuxerutil.h \
|
||||
third_party/libwebm/mkvparser/mkvparser.h \
|
||||
third_party/libwebm/mkvmuxer/mkvwriter.h
|
||||
|
||||
LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser/mkvparser.cc \
|
||||
third_party/libwebm/mkvparser/mkvreader.cc \
|
||||
third_party/libwebm/mkvparser/mkvparser.h \
|
||||
third_party/libwebm/mkvparser/mkvreader.h
|
||||
|
||||
# Add compile flags and include path for libwebm sources.
|
||||
ifeq ($(CONFIG_WEBM_IO),yes)
|
||||
CXXFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
|
||||
INC_PATH-yes += $(SRC_PATH_BARE)/third_party/libwebm
|
||||
endif
|
||||
LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \
|
||||
third_party/libwebm/mkvmuxerutil.cpp \
|
||||
third_party/libwebm/mkvwriter.cpp \
|
||||
third_party/libwebm/mkvmuxer.hpp \
|
||||
third_party/libwebm/mkvmuxertypes.hpp \
|
||||
third_party/libwebm/mkvmuxerutil.hpp \
|
||||
third_party/libwebm/mkvparser.hpp \
|
||||
third_party/libwebm/mkvwriter.hpp \
|
||||
third_party/libwebm/webmids.hpp
|
||||
|
||||
LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser.cpp \
|
||||
third_party/libwebm/mkvreader.cpp \
|
||||
third_party/libwebm/mkvparser.hpp \
|
||||
third_party/libwebm/mkvreader.hpp
|
||||
|
||||
# List of examples to build. UTILS are tools meant for distribution
|
||||
# while EXAMPLES demonstrate specific portions of the API.
|
||||
@@ -78,8 +67,6 @@ ifeq ($(CONFIG_LIBYUV),yes)
|
||||
vpxdec.SRCS += $(LIBYUV_SRCS)
|
||||
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
|
||||
@@ -101,9 +88,7 @@ ifeq ($(CONFIG_LIBYUV),yes)
|
||||
vpxenc.SRCS += $(LIBYUV_SRCS)
|
||||
endif
|
||||
ifeq ($(CONFIG_WEBM_IO),yes)
|
||||
vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS)
|
||||
vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS)
|
||||
vpxenc.SRCS += $(LIBWEBM_PARSER_SRCS)
|
||||
vpxenc.SRCS += webmenc.cc webmenc.h
|
||||
endif
|
||||
vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
|
||||
@@ -339,8 +324,8 @@ endif
|
||||
# the makefiles). We may want to revisit this.
|
||||
define vcproj_template
|
||||
$(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
|
||||
$(if $(quiet),@echo " [vcproj] $$@")
|
||||
$(qexec)$$(GEN_VCPROJ)\
|
||||
@echo " [vcproj] $$@"
|
||||
$$(GEN_VCPROJ)\
|
||||
--exe\
|
||||
--target=$$(TOOLCHAIN)\
|
||||
--name=$$(@:.$(VCPROJ_SFX)=)\
|
||||
|
@@ -29,6 +29,13 @@
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
#include <sys/time.h>
|
||||
#if USE_POSIX_MMAP
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "vpx_ports/vpx_timer.h"
|
||||
#include "vpx/vpx_encoder.h"
|
||||
#include "vpx/vp8cx.h"
|
||||
@@ -347,7 +354,8 @@ int main(int argc, char **argv)
|
||||
double psnr_totals[NUM_ENCODERS][4] = {{0,0}};
|
||||
int psnr_count[NUM_ENCODERS] = {0};
|
||||
|
||||
int64_t cx_time = 0;
|
||||
double cx_time = 0;
|
||||
struct timeval tv1, tv2, difftv;
|
||||
|
||||
/* Set the required target bitrates for each resolution level.
|
||||
* If target bitrate for highest-resolution level is set to 0,
|
||||
@@ -581,7 +589,6 @@ int main(int argc, char **argv)
|
||||
|
||||
while(frame_avail || got_data)
|
||||
{
|
||||
struct vpx_usec_timer timer;
|
||||
vpx_codec_iter_t iter[NUM_ENCODERS]={NULL};
|
||||
const vpx_codec_cx_pkt_t *pkt[NUM_ENCODERS];
|
||||
|
||||
@@ -636,18 +643,18 @@ int main(int argc, char **argv)
|
||||
vpx_codec_control(&codec[i], VP8E_SET_TEMPORAL_LAYER_ID, layer_id);
|
||||
}
|
||||
|
||||
gettimeofday(&tv1, NULL);
|
||||
/* Encode each frame at multi-levels */
|
||||
/* Note the flags must be set to 0 in the encode call if they are set
|
||||
for each frame with the vpx_codec_control(), as done above. */
|
||||
vpx_usec_timer_start(&timer);
|
||||
if(vpx_codec_encode(&codec[0], frame_avail? &raw[0] : NULL,
|
||||
frame_cnt, 1, 0, arg_deadline))
|
||||
{
|
||||
die_codec(&codec[0], "Failed to encode frame");
|
||||
}
|
||||
vpx_usec_timer_mark(&timer);
|
||||
cx_time += vpx_usec_timer_elapsed(&timer);
|
||||
|
||||
gettimeofday(&tv2, NULL);
|
||||
timersub(&tv2, &tv1, &difftv);
|
||||
cx_time += (double)(difftv.tv_sec * 1000000 + difftv.tv_usec);
|
||||
for (i=NUM_ENCODERS-1; i>=0 ; i--)
|
||||
{
|
||||
got_data = 0;
|
||||
@@ -686,10 +693,8 @@ int main(int argc, char **argv)
|
||||
frame_cnt++;
|
||||
}
|
||||
printf("\n");
|
||||
printf("Frame cnt and encoding time/FPS stats for encoding: %d %f %f \n",
|
||||
frame_cnt,
|
||||
1000 * (float)cx_time / (double)(frame_cnt * 1000000),
|
||||
1000000 * (double)frame_cnt / (double)cx_time);
|
||||
printf("FPS for encoding %d %f %f \n", frame_cnt, (float)cx_time / 1000000,
|
||||
1000000 * (double)frame_cnt / (double)cx_time);
|
||||
|
||||
fclose(infile);
|
||||
|
||||
|
@@ -25,12 +25,10 @@
|
||||
#include "../tools_common.h"
|
||||
#include "../video_writer.h"
|
||||
|
||||
#include "../vpx_ports/vpx_timer.h"
|
||||
#include "vpx/svc_context.h"
|
||||
#include "vpx/vp8cx.h"
|
||||
#include "vpx/vpx_encoder.h"
|
||||
#include "../vpxstats.h"
|
||||
#include "vp9/encoder/vp9_encoder.h"
|
||||
#define OUTPUT_RC_STATS 1
|
||||
|
||||
static const arg_def_t skip_frames_arg =
|
||||
@@ -81,8 +79,6 @@ static const arg_def_t rc_end_usage_arg =
|
||||
ARG_DEF(NULL, "rc-end-usage", 1, "0 - 3: VBR, CBR, CQ, Q");
|
||||
static const arg_def_t speed_arg =
|
||||
ARG_DEF("sp", "speed", 1, "speed configuration");
|
||||
static const arg_def_t aqmode_arg =
|
||||
ARG_DEF("aq", "aqmode", 1, "aq-mode off/on");
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
static const struct arg_enum_list bitdepth_enum[] = {
|
||||
@@ -104,7 +100,7 @@ static const arg_def_t *svc_args[] = {
|
||||
&kf_dist_arg, &scale_factors_arg, &passes_arg, &pass_arg,
|
||||
&fpf_name_arg, &min_q_arg, &max_q_arg, &min_bitrate_arg,
|
||||
&max_bitrate_arg, &temporal_layers_arg, &temporal_layering_mode_arg,
|
||||
&lag_in_frame_arg, &threads_arg, &aqmode_arg,
|
||||
&lag_in_frame_arg, &threads_arg,
|
||||
#if OUTPUT_RC_STATS
|
||||
&output_rc_stats_arg,
|
||||
#endif
|
||||
@@ -224,8 +220,6 @@ static void parse_command_line(int argc, const char **argv_,
|
||||
#endif
|
||||
} else if (arg_match(&arg, &speed_arg, argi)) {
|
||||
svc_ctx->speed = arg_parse_uint(&arg);
|
||||
} else if (arg_match(&arg, &aqmode_arg, argi)) {
|
||||
svc_ctx->aqmode = arg_parse_uint(&arg);
|
||||
} else if (arg_match(&arg, &threads_arg, argi)) {
|
||||
svc_ctx->threads = arg_parse_uint(&arg);
|
||||
} else if (arg_match(&arg, &temporal_layering_mode_arg, argi)) {
|
||||
@@ -409,10 +403,7 @@ static void set_rate_control_stats(struct RateControlStats *rc,
|
||||
for (tl = 0; tl < cfg->ts_number_layers; ++tl) {
|
||||
const int layer = sl * cfg->ts_number_layers + tl;
|
||||
const int tlayer0 = sl * cfg->ts_number_layers;
|
||||
if (cfg->ts_number_layers == 1)
|
||||
rc->layer_framerate[layer] = framerate;
|
||||
else
|
||||
rc->layer_framerate[layer] =
|
||||
rc->layer_framerate[layer] =
|
||||
framerate / cfg->ts_rate_decimator[tl];
|
||||
if (tl > 0) {
|
||||
rc->layer_pfb[layer] = 1000.0 *
|
||||
@@ -548,59 +539,6 @@ vpx_codec_err_t parse_superframe_index(const uint8_t *data,
|
||||
}
|
||||
#endif
|
||||
|
||||
// Example pattern for spatial layers and 2 temporal layers used in the
|
||||
// bypass/flexible mode. The pattern corresponds to the pattern
|
||||
// VP9E_TEMPORAL_LAYERING_MODE_0101 (temporal_layering_mode == 2) used in
|
||||
// non-flexible mode.
|
||||
void set_frame_flags_bypass_mode(int sl, int tl, int num_spatial_layers,
|
||||
int is_key_frame,
|
||||
vpx_svc_ref_frame_config_t *ref_frame_config) {
|
||||
for (sl = 0; sl < num_spatial_layers; ++sl) {
|
||||
if (!tl) {
|
||||
if (!sl) {
|
||||
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_GF |
|
||||
VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_GF |
|
||||
VP8_EFLAG_NO_UPD_ARF;
|
||||
} else {
|
||||
if (is_key_frame) {
|
||||
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_LAST |
|
||||
VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_GF |
|
||||
VP8_EFLAG_NO_UPD_ARF;
|
||||
} else {
|
||||
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_GF |
|
||||
VP8_EFLAG_NO_UPD_ARF;
|
||||
}
|
||||
}
|
||||
} else if (tl == 1) {
|
||||
if (!sl) {
|
||||
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_GF |
|
||||
VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_LAST |
|
||||
VP8_EFLAG_NO_UPD_GF;
|
||||
} else {
|
||||
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_LAST |
|
||||
VP8_EFLAG_NO_UPD_GF;
|
||||
}
|
||||
}
|
||||
if (tl == 0) {
|
||||
ref_frame_config->lst_fb_idx[sl] = sl;
|
||||
if (sl)
|
||||
ref_frame_config->gld_fb_idx[sl] = sl - 1;
|
||||
else
|
||||
ref_frame_config->gld_fb_idx[sl] = 0;
|
||||
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->alt_fb_idx[sl] = num_spatial_layers + sl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv) {
|
||||
AppInput app_input = {0};
|
||||
VpxVideoWriter *writer = NULL;
|
||||
@@ -621,14 +559,11 @@ int main(int argc, const char **argv) {
|
||||
VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = {NULL};
|
||||
struct RateControlStats rc;
|
||||
vpx_svc_layer_id_t layer_id;
|
||||
vpx_svc_ref_frame_config_t ref_frame_config;
|
||||
int sl, tl;
|
||||
double sum_bitrate = 0.0;
|
||||
double sum_bitrate2 = 0.0;
|
||||
double framerate = 30.0;
|
||||
#endif
|
||||
struct vpx_usec_timer timer;
|
||||
int64_t cx_time = 0;
|
||||
memset(&svc_ctx, 0, sizeof(svc_ctx));
|
||||
svc_ctx.log_print = 1;
|
||||
exec_name = argv[0];
|
||||
@@ -697,9 +632,6 @@ int main(int argc, const char **argv) {
|
||||
vpx_codec_control(&codec, VP8E_SET_CPUUSED, svc_ctx.speed);
|
||||
if (svc_ctx.threads)
|
||||
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (svc_ctx.threads >> 1));
|
||||
if (svc_ctx.speed >= 5 && svc_ctx.aqmode == 1)
|
||||
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
|
||||
|
||||
|
||||
// Encode frames
|
||||
while (!end_of_stream) {
|
||||
@@ -711,46 +643,11 @@ int main(int argc, const char **argv) {
|
||||
end_of_stream = 1;
|
||||
}
|
||||
|
||||
// For BYPASS/FLEXIBLE mode, set the frame flags (reference and updates)
|
||||
// and the buffer indices for each spatial layer of the current
|
||||
// (super)frame to be encoded. The temporal layer_id for the current frame
|
||||
// also needs to be set.
|
||||
// TODO(marpan): Should rename the "VP9E_TEMPORAL_LAYERING_MODE_BYPASS"
|
||||
// mode to "VP9E_LAYERING_MODE_BYPASS".
|
||||
if (svc_ctx.temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
|
||||
layer_id.spatial_layer_id = 0;
|
||||
// Example for 2 temporal layers.
|
||||
if (frame_cnt % 2 == 0)
|
||||
layer_id.temporal_layer_id = 0;
|
||||
else
|
||||
layer_id.temporal_layer_id = 1;
|
||||
// Note that we only set the temporal layer_id, since we are calling
|
||||
// the encode for the whole superframe. The encoder will internally loop
|
||||
// over all the spatial layers for the current superframe.
|
||||
vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id);
|
||||
set_frame_flags_bypass_mode(sl, layer_id.temporal_layer_id,
|
||||
svc_ctx.spatial_layers,
|
||||
frame_cnt == 0,
|
||||
&ref_frame_config);
|
||||
vpx_codec_control(&codec, VP9E_SET_SVC_REF_FRAME_CONFIG,
|
||||
&ref_frame_config);
|
||||
// Keep track of input frames, to account for frame drops in rate control
|
||||
// stats/metrics.
|
||||
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
|
||||
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
|
||||
layer_id.temporal_layer_id];
|
||||
}
|
||||
}
|
||||
|
||||
vpx_usec_timer_start(&timer);
|
||||
res = vpx_svc_encode(&svc_ctx, &codec, (end_of_stream ? NULL : &raw),
|
||||
pts, frame_duration, svc_ctx.speed >= 5 ?
|
||||
VPX_DL_REALTIME : VPX_DL_GOOD_QUALITY);
|
||||
vpx_usec_timer_mark(&timer);
|
||||
cx_time += vpx_usec_timer_elapsed(&timer);
|
||||
|
||||
printf("%s", vpx_svc_get_message(&svc_ctx));
|
||||
fflush(stdout);
|
||||
if (res != VPX_CODEC_OK) {
|
||||
die_codec(&codec, "Failed to encode frame");
|
||||
}
|
||||
@@ -758,7 +655,6 @@ int main(int argc, const char **argv) {
|
||||
while ((cx_pkt = vpx_codec_get_cx_data(&codec, &iter)) != NULL) {
|
||||
switch (cx_pkt->kind) {
|
||||
case VPX_CODEC_CX_FRAME_PKT: {
|
||||
SvcInternal_t *const si = (SvcInternal_t *)svc_ctx.internal;
|
||||
if (cx_pkt->data.frame.sz > 0) {
|
||||
#if OUTPUT_RC_STATS
|
||||
uint32_t sizes[8];
|
||||
@@ -774,16 +670,9 @@ int main(int argc, const char **argv) {
|
||||
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, &count);
|
||||
// Note computing input_layer_frames here won't account for frame
|
||||
// drops in rate control stats.
|
||||
// TODO(marpan): Fix this for non-bypass mode so we can get stats
|
||||
// for dropped frames.
|
||||
if (svc_ctx.temporal_layering_mode !=
|
||||
VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
|
||||
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
|
||||
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
|
||||
layer_id.temporal_layer_id];
|
||||
}
|
||||
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
|
||||
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
|
||||
layer_id.temporal_layer_id];
|
||||
}
|
||||
for (tl = layer_id.temporal_layer_id;
|
||||
tl < enc_cfg.ts_number_layers; ++tl) {
|
||||
@@ -854,8 +743,6 @@ int main(int argc, const char **argv) {
|
||||
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);
|
||||
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;
|
||||
break;
|
||||
}
|
||||
@@ -876,16 +763,6 @@ int main(int argc, const char **argv) {
|
||||
pts += frame_duration;
|
||||
}
|
||||
}
|
||||
|
||||
// Compensate for the extra frame count for the bypass mode.
|
||||
if (svc_ctx.temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
|
||||
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
|
||||
const int layer = sl * enc_cfg.ts_number_layers +
|
||||
layer_id.temporal_layer_id;
|
||||
--rc.layer_input_frames[layer];
|
||||
}
|
||||
}
|
||||
|
||||
printf("Processed %d frames\n", frame_cnt);
|
||||
fclose(infile);
|
||||
#if OUTPUT_RC_STATS
|
||||
@@ -907,10 +784,6 @@ int main(int argc, const char **argv) {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
printf("Frame cnt and encoding time/FPS stats for encoding: %d %f %f \n",
|
||||
frame_cnt,
|
||||
1000 * (float)cx_time / (double)(frame_cnt * 1000000),
|
||||
1000000 * (double)frame_cnt / (double)cx_time);
|
||||
vpx_img_free(&raw);
|
||||
// display average size, psnr
|
||||
printf("%s", vpx_svc_dump_statistics(&svc_ctx));
|
||||
|
@@ -41,7 +41,7 @@ enum denoiserState {
|
||||
kDenoiserOnAdaptive
|
||||
};
|
||||
|
||||
static int mode_to_num_layers[13] = {1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3, 3};
|
||||
static int mode_to_num_layers[12] = {1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3};
|
||||
|
||||
// For rate control encoding stats.
|
||||
struct RateControlMetrics {
|
||||
@@ -432,32 +432,7 @@ static void set_temporal_layer_pattern(int layering_mode,
|
||||
layer_flags[7] = layer_flags[3];
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
// 3-layers structure with one reference frame.
|
||||
// This works same as temporal_layering_mode 3.
|
||||
// This was added to compare with vp9_spatial_svc_encoder.
|
||||
|
||||
// 3-layers, 4-frame period.
|
||||
int ids[4] = {0, 2, 1, 2};
|
||||
cfg->ts_periodicity = 4;
|
||||
*flag_periodicity = 4;
|
||||
cfg->ts_number_layers = 3;
|
||||
cfg->ts_rate_decimator[0] = 4;
|
||||
cfg->ts_rate_decimator[1] = 2;
|
||||
cfg->ts_rate_decimator[2] = 1;
|
||||
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
|
||||
// 0=L, 1=GF, 2=ARF, Intra-layer prediction disabled.
|
||||
layer_flags[0] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
|
||||
layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
|
||||
layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
|
||||
layer_flags[3] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_ARF |
|
||||
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
case 11:
|
||||
default: {
|
||||
// 3-layers structure as in case 10, but no sync/refresh points for
|
||||
// layer 1 and 2.
|
||||
@@ -555,7 +530,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
layering_mode = strtol(argv[10], NULL, 0);
|
||||
if (layering_mode < 0 || layering_mode > 13) {
|
||||
if (layering_mode < 0 || layering_mode > 12) {
|
||||
die("Invalid layering mode (0..12) %s", argv[10]);
|
||||
}
|
||||
|
||||
@@ -709,15 +684,14 @@ int main(int argc, char **argv) {
|
||||
if (strncmp(encoder->name, "vp8", 3) == 0) {
|
||||
vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed);
|
||||
vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, kDenoiserOff);
|
||||
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
|
||||
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 0);
|
||||
} else if (strncmp(encoder->name, "vp9", 3) == 0) {
|
||||
vpx_svc_extra_cfg_t svc_params;
|
||||
vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
|
||||
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
|
||||
vpx_codec_control(&codec, VP9E_SET_FRAME_PERIODIC_BOOST, 0);
|
||||
vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, kDenoiserOff);
|
||||
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
|
||||
vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0);
|
||||
vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0);
|
||||
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 0);
|
||||
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (cfg.g_threads >> 1));
|
||||
if (vpx_codec_control(&codec, VP9E_SET_SVC, layering_mode > 0 ? 1: 0))
|
||||
die_codec(&codec, "Failed to set SVC");
|
||||
|
63
libs.mk
63
libs.mk
@@ -50,10 +50,7 @@ CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
|
||||
include $(SRC_PATH_BARE)/vpx_dsp/vpx_dsp.mk
|
||||
CODEC_SRCS-yes += $(addprefix vpx_dsp/,$(call enabled,DSP_SRCS))
|
||||
|
||||
include $(SRC_PATH_BARE)/vpx_util/vpx_util.mk
|
||||
CODEC_SRCS-yes += $(addprefix vpx_util/,$(call enabled,UTIL_SRCS))
|
||||
|
||||
ifeq ($(CONFIG_VP8),yes)
|
||||
ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
|
||||
VP8_PREFIX=vp8/
|
||||
include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk
|
||||
endif
|
||||
@@ -76,7 +73,7 @@ ifeq ($(CONFIG_VP8_DECODER),yes)
|
||||
CODEC_DOC_SECTIONS += vp8 vp8_decoder
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_VP9),yes)
|
||||
ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),)
|
||||
VP9_PREFIX=vp9/
|
||||
include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9_common.mk
|
||||
endif
|
||||
@@ -109,40 +106,6 @@ endif
|
||||
VP9_PREFIX=vp9/
|
||||
$(BUILD_PFX)$(VP9_PREFIX)%.c.o: CFLAGS += -Wextra
|
||||
|
||||
# VP10 make file
|
||||
ifeq ($(CONFIG_VP10),yes)
|
||||
VP10_PREFIX=vp10/
|
||||
include $(SRC_PATH_BARE)/$(VP10_PREFIX)vp10_common.mk
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_VP10_ENCODER),yes)
|
||||
VP10_PREFIX=vp10/
|
||||
include $(SRC_PATH_BARE)/$(VP10_PREFIX)vp10cx.mk
|
||||
CODEC_SRCS-yes += $(addprefix $(VP10_PREFIX),$(call enabled,VP10_CX_SRCS))
|
||||
CODEC_EXPORTS-yes += $(addprefix $(VP10_PREFIX),$(VP10_CX_EXPORTS))
|
||||
CODEC_SRCS-yes += $(VP10_PREFIX)vp10cx.mk vpx/vp8.h vpx/vp8cx.h
|
||||
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
|
||||
INSTALL-LIBS-$(CONFIG_SPATIAL_SVC) += include/vpx/svc_context.h
|
||||
INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP10_PREFIX)/%
|
||||
CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
|
||||
CODEC_DOC_SECTIONS += vp9 vp9_encoder
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_VP10_DECODER),yes)
|
||||
VP10_PREFIX=vp10/
|
||||
include $(SRC_PATH_BARE)/$(VP10_PREFIX)vp10dx.mk
|
||||
CODEC_SRCS-yes += $(addprefix $(VP10_PREFIX),$(call enabled,VP10_DX_SRCS))
|
||||
CODEC_EXPORTS-yes += $(addprefix $(VP10_PREFIX),$(VP10_DX_EXPORTS))
|
||||
CODEC_SRCS-yes += $(VP10_PREFIX)vp10dx.mk vpx/vp8.h vpx/vp8dx.h
|
||||
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h
|
||||
INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP10_PREFIX)/%
|
||||
CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8dx.h
|
||||
CODEC_DOC_SECTIONS += vp9 vp9_decoder
|
||||
endif
|
||||
|
||||
VP10_PREFIX=vp10/
|
||||
$(BUILD_PFX)$(VP10_PREFIX)%.c.o: CFLAGS += -Wextra
|
||||
|
||||
ifeq ($(CONFIG_ENCODERS),yes)
|
||||
CODEC_DOC_SECTIONS += encoder
|
||||
endif
|
||||
@@ -183,9 +146,6 @@ INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm
|
||||
endif
|
||||
CODEC_EXPORTS-yes += vpx/exports_com
|
||||
CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
|
||||
ifeq ($(CONFIG_SPATIAL_SVC),yes)
|
||||
CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_spatial_svc
|
||||
endif
|
||||
CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
|
||||
|
||||
INSTALL-LIBS-yes += include/vpx/vpx_codec.h
|
||||
@@ -263,7 +223,7 @@ 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 := 3
|
||||
SO_VERSION_MAJOR := 2
|
||||
SO_VERSION_MINOR := 0
|
||||
SO_VERSION_PATCH := 0
|
||||
ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
|
||||
@@ -397,12 +357,6 @@ $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
|
||||
$(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h)
|
||||
CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
|
||||
|
||||
#
|
||||
# Add include path for libwebm sources.
|
||||
#
|
||||
ifeq ($(CONFIG_WEBM_IO),yes)
|
||||
CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/libwebm
|
||||
endif
|
||||
|
||||
##
|
||||
## libvpx test directives
|
||||
@@ -438,10 +392,12 @@ testdata:: $(LIBVPX_TEST_DATA)
|
||||
if [ -n "$${sha1sum}" ]; then\
|
||||
set -e;\
|
||||
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);\
|
||||
done; \
|
||||
if [ -n "$(LIBVPX_TEST_DATA)" ]; then\
|
||||
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);\
|
||||
done; \
|
||||
fi; \
|
||||
else\
|
||||
echo "Skipping test data integrity check, sha1sum not found.";\
|
||||
fi
|
||||
@@ -478,7 +434,6 @@ test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_
|
||||
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
|
||||
--out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
|
||||
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
|
||||
$(if $(CONFIG_WEBM_IO),-I"$(SRC_PATH_BARE)/third_party/libwebm") \
|
||||
-L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
|
||||
|
||||
PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX)
|
||||
|
15
md5_utils.c
15
md5_utils.c
@@ -150,23 +150,12 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx) {
|
||||
#define MD5STEP(f,w,x,y,z,in,s) \
|
||||
(w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
|
||||
|
||||
#if defined(__clang__) && defined(__has_attribute)
|
||||
#if __has_attribute(no_sanitize)
|
||||
#define VPX_NO_UNSIGNED_OVERFLOW_CHECK \
|
||||
__attribute__((no_sanitize("unsigned-integer-overflow")))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef VPX_NO_UNSIGNED_OVERFLOW_CHECK
|
||||
#define VPX_NO_UNSIGNED_OVERFLOW_CHECK
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The core of the MD5 algorithm, this alters an existing MD5 hash to
|
||||
* 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
|
||||
void
|
||||
MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) {
|
||||
register UWORD32 a, b, c, d;
|
||||
|
||||
@@ -249,6 +238,4 @@ MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) {
|
||||
buf[3] += d;
|
||||
}
|
||||
|
||||
#undef VPX_NO_UNSIGNED_OVERFLOW_CHECK
|
||||
|
||||
#endif
|
||||
|
@@ -32,12 +32,6 @@ class ACMRandom {
|
||||
return (value >> 15) & 0xffff;
|
||||
}
|
||||
|
||||
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) {
|
||||
const uint32_t value =
|
||||
random_.Generate(testing::internal::Random::kMaxRange);
|
||||
|
@@ -1,127 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 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 <algorithm>
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "test/codec_factory.h"
|
||||
#include "test/encode_test_driver.h"
|
||||
#include "test/util.h"
|
||||
#include "test/y4m_video_source.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// Check if any pixel in a 16x16 macroblock varies between frames.
|
||||
int CheckMb(const vpx_image_t ¤t, const vpx_image_t &previous,
|
||||
int mb_r, int mb_c) {
|
||||
for (int plane = 0; plane < 3; plane++) {
|
||||
int r = 16 * mb_r;
|
||||
int c0 = 16 * mb_c;
|
||||
int r_top = std::min(r + 16, static_cast<int>(current.d_h));
|
||||
int c_top = std::min(c0 + 16, static_cast<int>(current.d_w));
|
||||
r = std::max(r, 0);
|
||||
c0 = std::max(c0, 0);
|
||||
if (plane > 0 && current.x_chroma_shift) {
|
||||
c_top = (c_top + 1) >> 1;
|
||||
c0 >>= 1;
|
||||
}
|
||||
if (plane > 0 && current.y_chroma_shift) {
|
||||
r_top = (r_top + 1) >> 1;
|
||||
r >>= 1;
|
||||
}
|
||||
for (; r < r_top; ++r) {
|
||||
for (int c = c0; c < c_top; ++c) {
|
||||
if (current.planes[plane][current.stride[plane] * r + c] !=
|
||||
previous.planes[plane][previous.stride[plane] * r + c])
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GenerateMap(int mb_rows, int mb_cols, const vpx_image_t ¤t,
|
||||
const vpx_image_t &previous, uint8_t *map) {
|
||||
for (int mb_r = 0; mb_r < mb_rows; ++mb_r) {
|
||||
for (int mb_c = 0; mb_c < mb_cols; ++mb_c) {
|
||||
map[mb_r * mb_cols + mb_c] = CheckMb(current, previous, mb_r, mb_c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const int kAqModeCyclicRefresh = 3;
|
||||
|
||||
class ActiveMapRefreshTest
|
||||
: public ::libvpx_test::EncoderTest,
|
||||
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
|
||||
protected:
|
||||
ActiveMapRefreshTest() : EncoderTest(GET_PARAM(0)) {}
|
||||
virtual ~ActiveMapRefreshTest() {}
|
||||
|
||||
virtual void SetUp() {
|
||||
InitializeConfig();
|
||||
SetMode(GET_PARAM(1));
|
||||
cpu_used_ = GET_PARAM(2);
|
||||
}
|
||||
|
||||
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
|
||||
::libvpx_test::Encoder *encoder) {
|
||||
::libvpx_test::Y4mVideoSource *y4m_video =
|
||||
static_cast<libvpx_test::Y4mVideoSource *>(video);
|
||||
if (video->frame() == 1) {
|
||||
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
|
||||
encoder->Control(VP9E_SET_AQ_MODE, kAqModeCyclicRefresh);
|
||||
} else if (video->frame() >= 2 && video->img()) {
|
||||
vpx_image_t *current = video->img();
|
||||
vpx_image_t *previous = y4m_holder_->img();
|
||||
ASSERT_TRUE(previous != NULL);
|
||||
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);
|
||||
const int mb_width = (width + 15) / 16;
|
||||
const int mb_height = (height + 15) / 16;
|
||||
uint8_t *active_map = new uint8_t[mb_width * mb_height];
|
||||
GenerateMap(mb_height, mb_width, *current, *previous, active_map);
|
||||
map.cols = mb_width;
|
||||
map.rows = mb_height;
|
||||
map.active_map = active_map;
|
||||
encoder->Control(VP8E_SET_ACTIVEMAP, &map);
|
||||
delete[] active_map;
|
||||
}
|
||||
if (video->img()) {
|
||||
y4m_video->SwapBuffers(y4m_holder_);
|
||||
}
|
||||
}
|
||||
|
||||
int cpu_used_;
|
||||
::libvpx_test::Y4mVideoSource *y4m_holder_;
|
||||
};
|
||||
|
||||
TEST_P(ActiveMapRefreshTest, Test) {
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
cfg_.g_profile = 1;
|
||||
cfg_.rc_target_bitrate = 600;
|
||||
cfg_.rc_resize_allowed = 0;
|
||||
cfg_.rc_min_quantizer = 8;
|
||||
cfg_.rc_max_quantizer = 30;
|
||||
cfg_.g_pass = VPX_RC_ONE_PASS;
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
cfg_.kf_max_dist = 90000;
|
||||
|
||||
::libvpx_test::Y4mVideoSource video("desktop_credits.y4m", 0, 30);
|
||||
::libvpx_test::Y4mVideoSource video_holder("desktop_credits.y4m", 0, 30);
|
||||
video_holder.Begin();
|
||||
y4m_holder_ = &video_holder;
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
}
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(ActiveMapRefreshTest,
|
||||
::testing::Values(::libvpx_test::kRealTime),
|
||||
::testing::Range(5, 6));
|
||||
} // namespace
|
@@ -85,5 +85,5 @@ TEST_P(ActiveMapTest, Test) {
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(ActiveMapTest,
|
||||
::testing::Values(::libvpx_test::kRealTime),
|
||||
::testing::Range(0, 9));
|
||||
::testing::Range(0, 6));
|
||||
} // namespace
|
||||
|
@@ -1,202 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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 <math.h>
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// TODO(jimbankoski): make width and height integers not unsigned.
|
||||
typedef void (*AddNoiseFunc)(unsigned char *start, char *noise,
|
||||
char blackclamp[16], char whiteclamp[16],
|
||||
char bothclamp[16], unsigned int width,
|
||||
unsigned int height, int pitch);
|
||||
|
||||
class AddNoiseTest
|
||||
: public ::testing::TestWithParam<AddNoiseFunc> {
|
||||
public:
|
||||
virtual void TearDown() {
|
||||
libvpx_test::ClearSystemState();
|
||||
}
|
||||
virtual ~AddNoiseTest() {}
|
||||
};
|
||||
|
||||
double stddev6(char a, char b, char c, char d, char e, char f) {
|
||||
const double n = (a + b + c + d + e + f) / 6.0;
|
||||
const double v = ((a - n) * (a - n) + (b - n) * (b - n) + (c - n) * (c - n) +
|
||||
(d - n) * (d - n) + (e - n) * (e - n) + (f - n) * (f - n)) /
|
||||
6.0;
|
||||
return sqrt(v);
|
||||
}
|
||||
|
||||
// TODO(jimbankoski): The following 2 functions are duplicated in each codec.
|
||||
// For now the vp9 one has been copied into the test as is. We should normalize
|
||||
// these in vpx_dsp and not have 3 copies of these unless there is different
|
||||
// noise we add for each codec.
|
||||
|
||||
double gaussian(double sigma, double mu, double x) {
|
||||
return 1 / (sigma * sqrt(2.0 * 3.14159265)) *
|
||||
(exp(-(x - mu) * (x - mu) / (2 * sigma * sigma)));
|
||||
}
|
||||
|
||||
int setup_noise(int size_noise, char *noise) {
|
||||
char char_dist[300];
|
||||
const int ai = 4;
|
||||
const int qi = 24;
|
||||
const double sigma = ai + .5 + .6 * (63 - qi) / 63.0;
|
||||
|
||||
/* set up a lookup table of 256 entries that matches
|
||||
* a gaussian distribution with sigma determined by q.
|
||||
*/
|
||||
int next = 0;
|
||||
|
||||
for (int i = -32; i < 32; i++) {
|
||||
int a_i = (int) (0.5 + 256 * gaussian(sigma, 0, i));
|
||||
|
||||
if (a_i) {
|
||||
for (int j = 0; j < a_i; j++) {
|
||||
char_dist[next + j] = (char)(i);
|
||||
}
|
||||
|
||||
next = next + a_i;
|
||||
}
|
||||
}
|
||||
|
||||
for (; next < 256; next++)
|
||||
char_dist[next] = 0;
|
||||
|
||||
for (int i = 0; i < size_noise; i++) {
|
||||
noise[i] = char_dist[rand() & 0xff]; // NOLINT
|
||||
}
|
||||
|
||||
// Returns the most negative value in distribution.
|
||||
return char_dist[0];
|
||||
}
|
||||
|
||||
TEST_P(AddNoiseTest, CheckNoiseAdded) {
|
||||
DECLARE_ALIGNED(16, char, blackclamp[16]);
|
||||
DECLARE_ALIGNED(16, char, whiteclamp[16]);
|
||||
DECLARE_ALIGNED(16, char, bothclamp[16]);
|
||||
const int width = 64;
|
||||
const int height = 64;
|
||||
const int image_size = width * height;
|
||||
char noise[3072];
|
||||
|
||||
const int clamp = setup_noise(3072, noise);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
blackclamp[i] = -clamp;
|
||||
whiteclamp[i] = -clamp;
|
||||
bothclamp[i] = -2 * clamp;
|
||||
}
|
||||
|
||||
uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
|
||||
memset(s, 99, image_size);
|
||||
|
||||
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
|
||||
bothclamp, width, height, width));
|
||||
|
||||
// Check to make sure we don't end up having either the same or no added
|
||||
// noise either vertically or horizontally.
|
||||
for (int i = 0; i < image_size - 6 * width - 6; ++i) {
|
||||
const double hd = stddev6(s[i] - 99, s[i + 1] - 99, s[i + 2] - 99,
|
||||
s[i + 3] - 99, s[i + 4] - 99, s[i + 5] - 99);
|
||||
const double vd = stddev6(s[i] - 99, s[i + width] - 99,
|
||||
s[i + 2 * width] - 99, s[i + 3 * width] - 99,
|
||||
s[i + 4 * width] - 99, s[i + 5 * width] - 99);
|
||||
|
||||
EXPECT_NE(hd, 0);
|
||||
EXPECT_NE(vd, 0);
|
||||
}
|
||||
|
||||
// Initialize pixels in the image to 255 and check for roll over.
|
||||
memset(s, 255, image_size);
|
||||
|
||||
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
|
||||
bothclamp, width, height, width));
|
||||
|
||||
// Check to make sure don't roll over.
|
||||
for (int i = 0; i < image_size; ++i) {
|
||||
EXPECT_GT((int)s[i], 10) << "i = " << i;
|
||||
}
|
||||
|
||||
// Initialize pixels in the image to 0 and check for roll under.
|
||||
memset(s, 0, image_size);
|
||||
|
||||
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
|
||||
bothclamp, width, height, width));
|
||||
|
||||
// Check to make sure don't roll under.
|
||||
for (int i = 0; i < image_size; ++i) {
|
||||
EXPECT_LT((int)s[i], 245) << "i = " << i;
|
||||
}
|
||||
|
||||
vpx_free(s);
|
||||
}
|
||||
|
||||
TEST_P(AddNoiseTest, CheckCvsAssembly) {
|
||||
DECLARE_ALIGNED(16, char, blackclamp[16]);
|
||||
DECLARE_ALIGNED(16, char, whiteclamp[16]);
|
||||
DECLARE_ALIGNED(16, char, bothclamp[16]);
|
||||
const int width = 64;
|
||||
const int height = 64;
|
||||
const int image_size = width * height;
|
||||
char noise[3072];
|
||||
|
||||
const int clamp = setup_noise(3072, noise);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
blackclamp[i] = -clamp;
|
||||
whiteclamp[i] = -clamp;
|
||||
bothclamp[i] = -2 * clamp;
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
memset(s, 99, image_size);
|
||||
memset(d, 99, image_size);
|
||||
|
||||
srand(0);
|
||||
ASM_REGISTER_STATE_CHECK(GetParam()(s, noise, blackclamp, whiteclamp,
|
||||
bothclamp, width, height, width));
|
||||
srand(0);
|
||||
ASM_REGISTER_STATE_CHECK(vpx_plane_add_noise_c(d, noise, blackclamp,
|
||||
whiteclamp, bothclamp,
|
||||
width, height, width));
|
||||
|
||||
for (int i = 0; i < image_size; ++i) {
|
||||
EXPECT_EQ((int)s[i], (int)d[i]) << "i = " << i;
|
||||
}
|
||||
|
||||
vpx_free(d);
|
||||
vpx_free(s);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(C, AddNoiseTest,
|
||||
::testing::Values(vpx_plane_add_noise_c));
|
||||
|
||||
#if HAVE_MMX
|
||||
INSTANTIATE_TEST_CASE_P(MMX, AddNoiseTest,
|
||||
::testing::Values(vpx_plane_add_noise_mmx));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, AddNoiseTest,
|
||||
::testing::Values(vpx_plane_add_noise_sse2));
|
||||
#endif
|
||||
|
||||
#if HAVE_MSA
|
||||
INSTANTIATE_TEST_CASE_P(MSA, AddNoiseTest,
|
||||
::testing::Values(vpx_plane_add_noise_msa));
|
||||
#endif
|
||||
} // namespace
|
@@ -14,8 +14,6 @@
|
||||
#include "test/util.h"
|
||||
namespace {
|
||||
|
||||
#if CONFIG_VP8_ENCODER
|
||||
|
||||
// lookahead range: [kLookAheadMin, kLookAheadMax).
|
||||
const int kLookAheadMin = 5;
|
||||
const int kLookAheadMax = 26;
|
||||
@@ -65,106 +63,7 @@ TEST_P(AltRefTest, MonotonicTimestamps) {
|
||||
EXPECT_GE(altref_count(), 1);
|
||||
}
|
||||
|
||||
|
||||
VP8_INSTANTIATE_TEST_CASE(AltRefTest,
|
||||
::testing::Range(kLookAheadMin, kLookAheadMax));
|
||||
|
||||
#endif // CONFIG_VP8_ENCODER
|
||||
|
||||
class AltRefForcedKeyTestLarge
|
||||
: public ::libvpx_test::EncoderTest,
|
||||
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
|
||||
protected:
|
||||
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() {}
|
||||
|
||||
virtual void SetUp() {
|
||||
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) {
|
||||
if (video->frame() == 0) {
|
||||
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
|
||||
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
|
||||
// override test default for tile columns if necessary.
|
||||
#if CONFIG_VP9_ENCODER
|
||||
if (GET_PARAM(0) == &libvpx_test::kVP9) {
|
||||
encoder->Control(VP9E_SET_TILE_COLUMNS, 6);
|
||||
}
|
||||
#endif
|
||||
#if CONFIG_VP10_ENCODER
|
||||
if (GET_PARAM(0) == &libvpx_test::kVP10) {
|
||||
encoder->Control(VP9E_SET_TILE_COLUMNS, 6);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
frame_flags_ =
|
||||
(video->frame() == forced_kf_frame_num_) ? VPX_EFLAG_FORCE_KF : 0;
|
||||
}
|
||||
|
||||
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
|
||||
if (frame_num_ == forced_kf_frame_num_) {
|
||||
ASSERT_TRUE(!!(pkt->data.frame.flags & VPX_FRAME_IS_KEY))
|
||||
<< "Frame #" << frame_num_ << " isn't a keyframe!";
|
||||
}
|
||||
++frame_num_;
|
||||
}
|
||||
|
||||
::libvpx_test::TestMode encoding_mode_;
|
||||
int cpu_used_;
|
||||
unsigned int forced_kf_frame_num_;
|
||||
unsigned int frame_num_;
|
||||
};
|
||||
|
||||
TEST_P(AltRefForcedKeyTestLarge, Frame1IsKey) {
|
||||
const vpx_rational timebase = { 1, 30 };
|
||||
const int lag_values[] = { 3, 15, 25, -1 };
|
||||
|
||||
forced_kf_frame_num_ = 1;
|
||||
for (int i = 0; lag_values[i] != -1; ++i) {
|
||||
frame_num_ = 0;
|
||||
cfg_.g_lag_in_frames = lag_values[i];
|
||||
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
timebase.den, timebase.num, 0, 30);
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(AltRefForcedKeyTestLarge, ForcedFrameIsKey) {
|
||||
const vpx_rational timebase = { 1, 30 };
|
||||
const int lag_values[] = { 3, 15, 25, -1 };
|
||||
|
||||
for (int i = 0; lag_values[i] != -1; ++i) {
|
||||
frame_num_ = 0;
|
||||
forced_kf_frame_num_ = lag_values[i] - 1;
|
||||
cfg_.g_lag_in_frames = lag_values[i];
|
||||
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
timebase.den, timebase.num, 0, 30);
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
}
|
||||
}
|
||||
|
||||
VP8_INSTANTIATE_TEST_CASE(
|
||||
AltRefForcedKeyTestLarge,
|
||||
::testing::Values(::libvpx_test::kOnePassGood),
|
||||
::testing::Range(0, 9));
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(
|
||||
AltRefForcedKeyTestLarge,
|
||||
::testing::Values(::libvpx_test::kOnePassGood),
|
||||
::testing::Range(0, 9));
|
||||
|
||||
VP10_INSTANTIATE_TEST_CASE(
|
||||
AltRefForcedKeyTestLarge,
|
||||
::testing::Values(::libvpx_test::kOnePassGood),
|
||||
::testing::Range(0, 9));
|
||||
|
||||
} // namespace
|
||||
|
@@ -8,11 +8,10 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#if CONFIG_VP9_ENCODER
|
||||
@@ -23,6 +22,7 @@
|
||||
#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_mem/vpx_mem.h"
|
||||
|
||||
|
@@ -52,7 +52,7 @@ TEST_P(BordersTest, TestEncodeHighBitrate) {
|
||||
// extend into the border and test the border condition.
|
||||
cfg_.g_lag_in_frames = 25;
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 5;
|
||||
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 2000;
|
||||
cfg_.rc_target_bitrate = 2000;
|
||||
cfg_.rc_max_quantizer = 10;
|
||||
|
||||
@@ -80,7 +80,4 @@ TEST_P(BordersTest, TestLowBitrate) {
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
|
||||
::libvpx_test::kTwoPassGood));
|
||||
|
||||
VP10_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
|
||||
::libvpx_test::kTwoPassGood));
|
||||
} // namespace
|
||||
|
@@ -21,14 +21,14 @@
|
||||
|
||||
namespace {
|
||||
|
||||
#if CONFIG_WEBM_IO
|
||||
|
||||
const int kLegacyByteAlignment = 0;
|
||||
const int kLegacyYPlaneByteAlignment = 32;
|
||||
const int kNumPlanesToCheck = 3;
|
||||
const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
|
||||
const char kVP9Md5File[] = "vp90-2-02-size-lf-1920x1080.webm.md5";
|
||||
|
||||
#if CONFIG_WEBM_IO
|
||||
|
||||
struct ByteAlignmentTestParam {
|
||||
int byte_alignment;
|
||||
vpx_codec_err_t expected_value;
|
||||
|
@@ -13,10 +13,10 @@
|
||||
#include "./vpx_config.h"
|
||||
#include "vpx/vpx_decoder.h"
|
||||
#include "vpx/vpx_encoder.h"
|
||||
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER || CONFIG_VP10_ENCODER
|
||||
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
|
||||
#include "vpx/vp8cx.h"
|
||||
#endif
|
||||
#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER || CONFIG_VP10_DECODER
|
||||
#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER
|
||||
#include "vpx/vp8dx.h"
|
||||
#endif
|
||||
|
||||
@@ -233,8 +233,6 @@ class VP9CodecFactory : public CodecFactory {
|
||||
int usage) const {
|
||||
#if CONFIG_VP9_ENCODER
|
||||
return vpx_codec_enc_config_default(&vpx_codec_vp9_cx_algo, cfg, usage);
|
||||
#elif CONFIG_VP10_ENCODER
|
||||
return vpx_codec_enc_config_default(&vpx_codec_vp10_cx_algo, cfg, usage);
|
||||
#else
|
||||
return VPX_CODEC_INCAPABLE;
|
||||
#endif
|
||||
@@ -253,96 +251,7 @@ const libvpx_test::VP9CodecFactory kVP9;
|
||||
#define VP9_INSTANTIATE_TEST_CASE(test, ...)
|
||||
#endif // CONFIG_VP9
|
||||
|
||||
/*
|
||||
* VP10 Codec Definitions
|
||||
*/
|
||||
#if CONFIG_VP10
|
||||
class VP10Decoder : public Decoder {
|
||||
public:
|
||||
VP10Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline)
|
||||
: Decoder(cfg, deadline) {}
|
||||
|
||||
VP10Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag,
|
||||
unsigned long deadline) // NOLINT
|
||||
: Decoder(cfg, flag, deadline) {}
|
||||
|
||||
protected:
|
||||
virtual vpx_codec_iface_t* CodecInterface() const {
|
||||
#if CONFIG_VP10_DECODER
|
||||
return &vpx_codec_vp10_dx_algo;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
class VP10Encoder : public Encoder {
|
||||
public:
|
||||
VP10Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline,
|
||||
const unsigned long init_flags, TwopassStatsStore *stats)
|
||||
: Encoder(cfg, deadline, init_flags, stats) {}
|
||||
|
||||
protected:
|
||||
virtual vpx_codec_iface_t* CodecInterface() const {
|
||||
#if CONFIG_VP10_ENCODER
|
||||
return &vpx_codec_vp10_cx_algo;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
class VP10CodecFactory : public CodecFactory {
|
||||
public:
|
||||
VP10CodecFactory() : CodecFactory() {}
|
||||
|
||||
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
|
||||
unsigned long deadline) const {
|
||||
return CreateDecoder(cfg, 0, deadline);
|
||||
}
|
||||
|
||||
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
|
||||
const vpx_codec_flags_t flags,
|
||||
unsigned long deadline) const { // NOLINT
|
||||
#if CONFIG_VP10_DECODER
|
||||
return new VP10Decoder(cfg, flags, deadline);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
|
||||
unsigned long deadline,
|
||||
const unsigned long init_flags,
|
||||
TwopassStatsStore *stats) const {
|
||||
#if CONFIG_VP10_ENCODER
|
||||
return new VP10Encoder(cfg, deadline, init_flags, stats);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual vpx_codec_err_t DefaultEncoderConfig(vpx_codec_enc_cfg_t *cfg,
|
||||
int usage) const {
|
||||
#if CONFIG_VP10_ENCODER
|
||||
return vpx_codec_enc_config_default(&vpx_codec_vp10_cx_algo, cfg, usage);
|
||||
#else
|
||||
return VPX_CODEC_INCAPABLE;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
const libvpx_test::VP10CodecFactory kVP10;
|
||||
|
||||
#define VP10_INSTANTIATE_TEST_CASE(test, ...)\
|
||||
INSTANTIATE_TEST_CASE_P(VP10, test, \
|
||||
::testing::Combine( \
|
||||
::testing::Values(static_cast<const libvpx_test::CodecFactory*>( \
|
||||
&libvpx_test::kVP10)), \
|
||||
__VA_ARGS__))
|
||||
#else
|
||||
#define VP10_INSTANTIATE_TEST_CASE(test, ...)
|
||||
#endif // CONFIG_VP10
|
||||
|
||||
} // namespace libvpx_test
|
||||
|
||||
#endif // TEST_CODEC_FACTORY_H_
|
||||
|
@@ -8,11 +8,10 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#if CONFIG_VP9_ENCODER
|
||||
@@ -23,11 +22,12 @@
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
#include "vpx_dsp/ssim.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "vp9/encoder/vp9_ssim.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
extern "C"
|
||||
double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch,
|
||||
double vp9_get_ssim_metrics(uint8_t *img1, int img1_pitch,
|
||||
uint8_t *img2, int img2_pitch,
|
||||
int width, int height,
|
||||
Ssimv *sv2, Metrics *m,
|
||||
@@ -65,7 +65,7 @@ class ConsistencyTestBase : public ::testing::Test {
|
||||
vpx_free(reference_data_[1]);
|
||||
reference_data_[1] = NULL;
|
||||
|
||||
delete[] ssim_array_;
|
||||
delete ssim_array_;
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
@@ -144,7 +144,7 @@ class ConsistencyVP9Test
|
||||
double CheckConsistency(int frame) {
|
||||
EXPECT_LT(frame, 2)<< "Frame to check has to be less than 2.";
|
||||
return
|
||||
vpx_get_ssim_metrics(source_data_[frame], source_stride_,
|
||||
vp9_get_ssim_metrics(source_data_[frame], source_stride_,
|
||||
reference_data_[frame], reference_stride_,
|
||||
width_, height_, ssim_array_, &metrics_, 1);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -26,8 +26,7 @@ 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) {}
|
||||
min_psnr_(kMaxPSNR) {}
|
||||
virtual ~CpuSpeedTest() {}
|
||||
|
||||
virtual void SetUp() {
|
||||
@@ -50,7 +49,6 @@ class CpuSpeedTest
|
||||
::libvpx_test::Encoder *encoder) {
|
||||
if (video->frame() == 1) {
|
||||
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
|
||||
encoder->Control(VP9E_SET_TUNE_CONTENT, tune_content_);
|
||||
if (encoding_mode_ != ::libvpx_test::kRealTime) {
|
||||
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
|
||||
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
|
||||
@@ -68,7 +66,6 @@ class CpuSpeedTest
|
||||
::libvpx_test::TestMode encoding_mode_;
|
||||
int set_cpu_used_;
|
||||
double min_psnr_;
|
||||
int tune_content_;
|
||||
};
|
||||
|
||||
TEST_P(CpuSpeedTest, TestQ0) {
|
||||
@@ -77,7 +74,7 @@ TEST_P(CpuSpeedTest, TestQ0) {
|
||||
// the encoder to producing lots of big partitions which will likely
|
||||
// extend into the border and test the border condition.
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 5;
|
||||
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 2000;
|
||||
cfg_.rc_target_bitrate = 400;
|
||||
cfg_.rc_max_quantizer = 0;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
@@ -95,7 +92,7 @@ TEST_P(CpuSpeedTest, TestScreencastQ0) {
|
||||
::libvpx_test::Y4mVideoSource video("screendata.y4m", 0, 25);
|
||||
cfg_.g_timebase = video.timebase();
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 5;
|
||||
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 2000;
|
||||
cfg_.rc_target_bitrate = 400;
|
||||
cfg_.rc_max_quantizer = 0;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
@@ -106,28 +103,13 @@ TEST_P(CpuSpeedTest, TestScreencastQ0) {
|
||||
EXPECT_GE(min_psnr_, kMaxPSNR);
|
||||
}
|
||||
|
||||
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_target_bitrate = 2000;
|
||||
cfg_.rc_max_quantizer = 63;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
tune_content_ = VP9E_CONTENT_SCREEN;
|
||||
|
||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
}
|
||||
|
||||
TEST_P(CpuSpeedTest, TestEncodeHighBitrate) {
|
||||
// Validate that this non multiple of 64 wide clip encodes and decodes
|
||||
// without a mismatch when passing in a very low max q. This pushes
|
||||
// the encoder to producing lots of big partitions which will likely
|
||||
// extend into the border and test the border condition.
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 5;
|
||||
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 2000;
|
||||
cfg_.rc_target_bitrate = 12000;
|
||||
cfg_.rc_max_quantizer = 10;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
@@ -143,7 +125,7 @@ TEST_P(CpuSpeedTest, TestLowBitrate) {
|
||||
// when passing in a very high min q. This pushes the encoder to producing
|
||||
// lots of small partitions which might will test the other condition.
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 5;
|
||||
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 2000;
|
||||
cfg_.rc_target_bitrate = 200;
|
||||
cfg_.rc_min_quantizer = 40;
|
||||
|
||||
@@ -158,9 +140,4 @@ VP9_INSTANTIATE_TEST_CASE(
|
||||
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
|
||||
::libvpx_test::kRealTime),
|
||||
::testing::Range(0, 9));
|
||||
|
||||
VP10_INSTANTIATE_TEST_CASE(
|
||||
CpuSpeedTest,
|
||||
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood),
|
||||
::testing::Range(0, 3));
|
||||
} // namespace
|
||||
|
@@ -519,9 +519,6 @@ TEST_P(DatarateTestVP9Large, ChangingDropFrameThresh) {
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
cfg_.rc_target_bitrate = 200;
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
// TODO(marpan): Investigate datarate target failures with a smaller keyframe
|
||||
// interval (128).
|
||||
cfg_.kf_max_dist = 9999;
|
||||
|
||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 140);
|
||||
@@ -541,7 +538,7 @@ TEST_P(DatarateTestVP9Large, ChangingDropFrameThresh) {
|
||||
<< " The first dropped frame for drop_thresh " << i
|
||||
<< " > first dropped frame for drop_thresh "
|
||||
<< i - kDropFrameThreshTestStep;
|
||||
ASSERT_GE(num_drops_, last_num_drops * 0.85)
|
||||
ASSERT_GE(num_drops_, last_num_drops * 0.90)
|
||||
<< " The number of dropped frames for drop_thresh " << i
|
||||
<< " < number of dropped frames for drop_thresh "
|
||||
<< i - kDropFrameThreshTestStep;
|
||||
@@ -764,8 +761,6 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
||||
first_drop_ = 0;
|
||||
bits_total_ = 0;
|
||||
duration_ = 0.0;
|
||||
mismatch_psnr_ = 0.0;
|
||||
mismatch_nframes_ = 0;
|
||||
}
|
||||
virtual void BeginPassHook(unsigned int /*pass*/) {
|
||||
}
|
||||
@@ -773,16 +768,19 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
||||
::libvpx_test::Encoder *encoder) {
|
||||
if (video->frame() == 0) {
|
||||
int i;
|
||||
for (i = 0; i < VPX_MAX_LAYERS; ++i) {
|
||||
for (i = 0; i < 2; ++i) {
|
||||
svc_params_.max_quantizers[i] = 63;
|
||||
svc_params_.min_quantizers[i] = 0;
|
||||
}
|
||||
svc_params_.scaling_factor_num[0] = 144;
|
||||
svc_params_.scaling_factor_den[0] = 288;
|
||||
svc_params_.scaling_factor_num[1] = 288;
|
||||
svc_params_.scaling_factor_den[1] = 288;
|
||||
encoder->Control(VP9E_SET_SVC, 1);
|
||||
encoder->Control(VP9E_SET_SVC_PARAMETERS, &svc_params_);
|
||||
encoder->Control(VP8E_SET_CPUUSED, speed_setting_);
|
||||
encoder->Control(VP9E_SET_TILE_COLUMNS, 0);
|
||||
encoder->Control(VP8E_SET_MAX_INTRA_BITRATE_PCT, 300);
|
||||
encoder->Control(VP9E_SET_TILE_COLUMNS, (cfg_.g_threads >> 1));
|
||||
}
|
||||
const vpx_rational_t tb = video->timebase();
|
||||
timebase_ = static_cast<double>(tb.num) / tb.den;
|
||||
@@ -813,21 +811,11 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
||||
if (bits_total_) {
|
||||
const double file_size_in_kb = bits_total_ / 1000.; // bits per kilobit
|
||||
duration_ = (last_pts_ + 1) * timebase_;
|
||||
effective_datarate_ = (bits_total_ - bits_in_last_frame_) / 1000.0
|
||||
/ (cfg_.rc_buf_initial_sz / 1000.0 + duration_);
|
||||
file_datarate_ = file_size_in_kb / duration_;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void MismatchHook(const vpx_image_t *img1,
|
||||
const vpx_image_t *img2) {
|
||||
double mismatch_psnr = compute_psnr(img1, img2);
|
||||
mismatch_psnr_ += mismatch_psnr;
|
||||
++mismatch_nframes_;
|
||||
}
|
||||
|
||||
unsigned int GetMismatchFrames() {
|
||||
return mismatch_nframes_;
|
||||
}
|
||||
|
||||
vpx_codec_pts_t last_pts_;
|
||||
int64_t bits_in_buffer_model_;
|
||||
double timebase_;
|
||||
@@ -836,17 +824,17 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
||||
int64_t bits_total_;
|
||||
double duration_;
|
||||
double file_datarate_;
|
||||
double effective_datarate_;
|
||||
size_t bits_in_last_frame_;
|
||||
vpx_svc_extra_cfg_t svc_params_;
|
||||
int speed_setting_;
|
||||
double mismatch_psnr_;
|
||||
int mismatch_nframes_;
|
||||
};
|
||||
static void assign_layer_bitrates(vpx_codec_enc_cfg_t *const enc_cfg,
|
||||
const vpx_svc_extra_cfg_t *svc_params,
|
||||
int spatial_layers,
|
||||
int temporal_layers,
|
||||
int temporal_layering_mode) {
|
||||
int temporal_layering_mode,
|
||||
unsigned int total_rate) {
|
||||
int sl, spatial_layer_target;
|
||||
float total = 0;
|
||||
float alloc_ratio[VPX_MAX_LAYERS] = {0};
|
||||
@@ -879,8 +867,8 @@ static void assign_layer_bitrates(vpx_codec_enc_cfg_t *const enc_cfg,
|
||||
}
|
||||
|
||||
// Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and
|
||||
// 3 temporal layers. Run CIF clip with 1 thread.
|
||||
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers) {
|
||||
// 3 temporal layers.
|
||||
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc) {
|
||||
cfg_.rc_buf_initial_sz = 500;
|
||||
cfg_.rc_buf_optimal_sz = 500;
|
||||
cfg_.rc_buf_sz = 1000;
|
||||
@@ -894,242 +882,38 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers) {
|
||||
cfg_.ts_rate_decimator[1] = 2;
|
||||
cfg_.ts_rate_decimator[2] = 1;
|
||||
cfg_.g_error_resilient = 1;
|
||||
cfg_.g_threads = 1;
|
||||
cfg_.temporal_layering_mode = 3;
|
||||
svc_params_.scaling_factor_num[0] = 144;
|
||||
svc_params_.scaling_factor_den[0] = 288;
|
||||
svc_params_.scaling_factor_num[1] = 288;
|
||||
svc_params_.scaling_factor_den[1] = 288;
|
||||
cfg_.rc_dropframe_thresh = 10;
|
||||
cfg_.kf_max_dist = 9999;
|
||||
// TODO(wonkap/marpan): No frame drop for now, we need to implement correct
|
||||
// frame dropping for SVC.
|
||||
cfg_.rc_dropframe_thresh = 0;
|
||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 200);
|
||||
// TODO(wonkap/marpan): Check that effective_datarate for each layer hits the
|
||||
// layer target_bitrate.
|
||||
for (int i = 200; i <= 800; i += 200) {
|
||||
// layer target_bitrate. Also check if test can pass at lower bitrate (~200k).
|
||||
for (int i = 400; i <= 800; i += 200) {
|
||||
cfg_.rc_target_bitrate = i;
|
||||
ResetModel();
|
||||
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
|
||||
cfg_.ts_number_layers, cfg_.temporal_layering_mode);
|
||||
cfg_.ts_number_layers, cfg_.temporal_layering_mode,
|
||||
cfg_.rc_target_bitrate);
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
|
||||
ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_ * 0.85)
|
||||
<< " The datarate for the file exceeds the target by too much!";
|
||||
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15)
|
||||
<< " The datarate for the file is lower than the target by too much!";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
}
|
||||
}
|
||||
|
||||
// Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and 3
|
||||
// temporal layers. Run CIF clip with 1 thread, and few short key frame periods.
|
||||
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayersSmallKf) {
|
||||
cfg_.rc_buf_initial_sz = 500;
|
||||
cfg_.rc_buf_optimal_sz = 500;
|
||||
cfg_.rc_buf_sz = 1000;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
cfg_.rc_max_quantizer = 63;
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
cfg_.ss_number_layers = 2;
|
||||
cfg_.ts_number_layers = 3;
|
||||
cfg_.ts_rate_decimator[0] = 4;
|
||||
cfg_.ts_rate_decimator[1] = 2;
|
||||
cfg_.ts_rate_decimator[2] = 1;
|
||||
cfg_.g_error_resilient = 1;
|
||||
cfg_.g_threads = 1;
|
||||
cfg_.temporal_layering_mode = 3;
|
||||
svc_params_.scaling_factor_num[0] = 144;
|
||||
svc_params_.scaling_factor_den[0] = 288;
|
||||
svc_params_.scaling_factor_num[1] = 288;
|
||||
svc_params_.scaling_factor_den[1] = 288;
|
||||
cfg_.rc_dropframe_thresh = 10;
|
||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 200);
|
||||
cfg_.rc_target_bitrate = 400;
|
||||
// For this 3 temporal layer case, pattern repeats every 4 frames, so choose
|
||||
// 4 key neighboring key frame periods (so key frame will land on 0-2-1-2).
|
||||
for (int j = 64; j <= 67; j++) {
|
||||
cfg_.kf_max_dist = j;
|
||||
ResetModel();
|
||||
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
|
||||
cfg_.ts_number_layers, cfg_.temporal_layering_mode);
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
|
||||
<< " The datarate for the file exceeds the target by too much!";
|
||||
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15)
|
||||
<< " The datarate for the file is lower than the target by too much!";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
}
|
||||
}
|
||||
|
||||
// Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and
|
||||
// 3 temporal layers. Run HD clip with 4 threads.
|
||||
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers4threads) {
|
||||
cfg_.rc_buf_initial_sz = 500;
|
||||
cfg_.rc_buf_optimal_sz = 500;
|
||||
cfg_.rc_buf_sz = 1000;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
cfg_.rc_max_quantizer = 63;
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
cfg_.ss_number_layers = 2;
|
||||
cfg_.ts_number_layers = 3;
|
||||
cfg_.ts_rate_decimator[0] = 4;
|
||||
cfg_.ts_rate_decimator[1] = 2;
|
||||
cfg_.ts_rate_decimator[2] = 1;
|
||||
cfg_.g_error_resilient = 1;
|
||||
cfg_.g_threads = 4;
|
||||
cfg_.temporal_layering_mode = 3;
|
||||
svc_params_.scaling_factor_num[0] = 144;
|
||||
svc_params_.scaling_factor_den[0] = 288;
|
||||
svc_params_.scaling_factor_num[1] = 288;
|
||||
svc_params_.scaling_factor_den[1] = 288;
|
||||
cfg_.rc_dropframe_thresh = 10;
|
||||
cfg_.kf_max_dist = 9999;
|
||||
::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
|
||||
30, 1, 0, 300);
|
||||
cfg_.rc_target_bitrate = 800;
|
||||
ResetModel();
|
||||
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
|
||||
cfg_.ts_number_layers, cfg_.temporal_layering_mode);
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
|
||||
<< " The datarate for the file exceeds the target by too much!";
|
||||
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15)
|
||||
<< " The datarate for the file is lower than the target by too much!";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
}
|
||||
|
||||
// Check basic rate targeting for 1 pass CBR SVC: 3 spatial layers and
|
||||
// 3 temporal layers. Run CIF clip with 1 thread.
|
||||
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers) {
|
||||
cfg_.rc_buf_initial_sz = 500;
|
||||
cfg_.rc_buf_optimal_sz = 500;
|
||||
cfg_.rc_buf_sz = 1000;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
cfg_.rc_max_quantizer = 63;
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
cfg_.ss_number_layers = 3;
|
||||
cfg_.ts_number_layers = 3;
|
||||
cfg_.ts_rate_decimator[0] = 4;
|
||||
cfg_.ts_rate_decimator[1] = 2;
|
||||
cfg_.ts_rate_decimator[2] = 1;
|
||||
cfg_.g_error_resilient = 1;
|
||||
cfg_.g_threads = 1;
|
||||
cfg_.temporal_layering_mode = 3;
|
||||
svc_params_.scaling_factor_num[0] = 72;
|
||||
svc_params_.scaling_factor_den[0] = 288;
|
||||
svc_params_.scaling_factor_num[1] = 144;
|
||||
svc_params_.scaling_factor_den[1] = 288;
|
||||
svc_params_.scaling_factor_num[2] = 288;
|
||||
svc_params_.scaling_factor_den[2] = 288;
|
||||
cfg_.rc_dropframe_thresh = 10;
|
||||
cfg_.kf_max_dist = 9999;
|
||||
::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
|
||||
30, 1, 0, 300);
|
||||
cfg_.rc_target_bitrate = 800;
|
||||
ResetModel();
|
||||
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
|
||||
cfg_.ts_number_layers, cfg_.temporal_layering_mode);
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
|
||||
<< " The datarate for the file exceeds the target by too much!";
|
||||
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.22)
|
||||
<< " The datarate for the file is lower than the target by too much!";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
}
|
||||
|
||||
// Check basic rate targeting for 1 pass CBR SVC: 3 spatial layers and 3
|
||||
// temporal layers. Run CIF clip with 1 thread, and few short key frame periods.
|
||||
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) {
|
||||
cfg_.rc_buf_initial_sz = 500;
|
||||
cfg_.rc_buf_optimal_sz = 500;
|
||||
cfg_.rc_buf_sz = 1000;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
cfg_.rc_max_quantizer = 63;
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
cfg_.ss_number_layers = 3;
|
||||
cfg_.ts_number_layers = 3;
|
||||
cfg_.ts_rate_decimator[0] = 4;
|
||||
cfg_.ts_rate_decimator[1] = 2;
|
||||
cfg_.ts_rate_decimator[2] = 1;
|
||||
cfg_.g_error_resilient = 1;
|
||||
cfg_.g_threads = 1;
|
||||
cfg_.temporal_layering_mode = 3;
|
||||
svc_params_.scaling_factor_num[0] = 72;
|
||||
svc_params_.scaling_factor_den[0] = 288;
|
||||
svc_params_.scaling_factor_num[1] = 144;
|
||||
svc_params_.scaling_factor_den[1] = 288;
|
||||
svc_params_.scaling_factor_num[2] = 288;
|
||||
svc_params_.scaling_factor_den[2] = 288;
|
||||
cfg_.rc_dropframe_thresh = 10;
|
||||
::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
|
||||
30, 1, 0, 300);
|
||||
cfg_.rc_target_bitrate = 800;
|
||||
// For this 3 temporal layer case, pattern repeats every 4 frames, so choose
|
||||
// 4 key neighboring key frame periods (so key frame will land on 0-2-1-2).
|
||||
for (int j = 32; j <= 35; j++) {
|
||||
cfg_.kf_max_dist = j;
|
||||
ResetModel();
|
||||
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
|
||||
cfg_.ts_number_layers, cfg_.temporal_layering_mode);
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
|
||||
<< " The datarate for the file exceeds the target by too much!";
|
||||
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.30)
|
||||
<< " The datarate for the file is lower than the target by too much!";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
}
|
||||
}
|
||||
|
||||
// Check basic rate targeting for 1 pass CBR SVC: 3 spatial layers and
|
||||
// 3 temporal layers. Run HD clip with 4 threads.
|
||||
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers4threads) {
|
||||
cfg_.rc_buf_initial_sz = 500;
|
||||
cfg_.rc_buf_optimal_sz = 500;
|
||||
cfg_.rc_buf_sz = 1000;
|
||||
cfg_.rc_min_quantizer = 0;
|
||||
cfg_.rc_max_quantizer = 63;
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
cfg_.ss_number_layers = 3;
|
||||
cfg_.ts_number_layers = 3;
|
||||
cfg_.ts_rate_decimator[0] = 4;
|
||||
cfg_.ts_rate_decimator[1] = 2;
|
||||
cfg_.ts_rate_decimator[2] = 1;
|
||||
cfg_.g_error_resilient = 1;
|
||||
cfg_.g_threads = 4;
|
||||
cfg_.temporal_layering_mode = 3;
|
||||
svc_params_.scaling_factor_num[0] = 72;
|
||||
svc_params_.scaling_factor_den[0] = 288;
|
||||
svc_params_.scaling_factor_num[1] = 144;
|
||||
svc_params_.scaling_factor_den[1] = 288;
|
||||
svc_params_.scaling_factor_num[2] = 288;
|
||||
svc_params_.scaling_factor_den[2] = 288;
|
||||
cfg_.rc_dropframe_thresh = 10;
|
||||
cfg_.kf_max_dist = 9999;
|
||||
::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
|
||||
30, 1, 0, 300);
|
||||
cfg_.rc_target_bitrate = 800;
|
||||
ResetModel();
|
||||
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
|
||||
cfg_.ts_number_layers, cfg_.temporal_layering_mode);
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
|
||||
<< " The datarate for the file exceeds the target by too much!";
|
||||
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.22)
|
||||
<< " The datarate for the file is lower than the target by too much!";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
}
|
||||
|
||||
VP8_INSTANTIATE_TEST_CASE(DatarateTestLarge, ALL_TEST_MODES);
|
||||
VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9Large,
|
||||
::testing::Values(::libvpx_test::kOnePassGood,
|
||||
::libvpx_test::kRealTime),
|
||||
::testing::Range(2, 9));
|
||||
::testing::Range(2, 7));
|
||||
VP9_INSTANTIATE_TEST_CASE(DatarateOnePassCbrSvc,
|
||||
::testing::Values(::libvpx_test::kRealTime),
|
||||
::testing::Range(5, 9));
|
||||
::testing::Range(5, 8));
|
||||
} // namespace
|
||||
|
@@ -13,13 +13,12 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_entropy.h"
|
||||
#include "vp9/common/vp9_scan.h"
|
||||
#include "vpx/vpx_codec.h"
|
||||
@@ -40,6 +39,30 @@ static int round(double x) {
|
||||
#endif
|
||||
|
||||
const int kNumCoeffs = 256;
|
||||
const double PI = 3.1415926535898;
|
||||
void reference2_16x16_idct_2d(double *input, double *output) {
|
||||
double x;
|
||||
for (int l = 0; l < 16; ++l) {
|
||||
for (int k = 0; k < 16; ++k) {
|
||||
double s = 0;
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
for (int j = 0; j < 16; ++j) {
|
||||
x = cos(PI * j * (l + 0.5) / 16.0) *
|
||||
cos(PI * i * (k + 0.5) / 16.0) *
|
||||
input[i * 16 + j] / 256;
|
||||
if (i != 0)
|
||||
x *= sqrt(2.0);
|
||||
if (j != 0)
|
||||
x *= sqrt(2.0);
|
||||
s += x;
|
||||
}
|
||||
}
|
||||
output[k*16+l] = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const double C1 = 0.995184726672197;
|
||||
const double C2 = 0.98078528040323;
|
||||
const double C3 = 0.956940335732209;
|
||||
@@ -248,12 +271,12 @@ typedef std::tr1::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t>
|
||||
|
||||
void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
int /*tx_type*/) {
|
||||
vpx_fdct16x16_c(in, out, stride);
|
||||
vp9_fdct16x16_c(in, out, stride);
|
||||
}
|
||||
|
||||
void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
|
||||
int /*tx_type*/) {
|
||||
vpx_idct16x16_256_add_c(in, dest, stride);
|
||||
vp9_idct16x16_256_add_c(in, dest, stride);
|
||||
}
|
||||
|
||||
void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
@@ -268,20 +291,20 @@ void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct16x16_256_add_c(in, out, stride, 10);
|
||||
vp9_highbd_idct16x16_256_add_c(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct16x16_256_add_c(in, out, stride, 12);
|
||||
vp9_highbd_idct16x16_256_add_c(in, out, stride, 12);
|
||||
}
|
||||
|
||||
void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride,
|
||||
int /*tx_type*/) {
|
||||
int tx_type) {
|
||||
idct16x16_10(in, out, stride);
|
||||
}
|
||||
|
||||
void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride,
|
||||
int /*tx_type*/) {
|
||||
int tx_type) {
|
||||
idct16x16_12(in, out, stride);
|
||||
}
|
||||
|
||||
@@ -293,29 +316,29 @@ void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
||||
vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 12);
|
||||
}
|
||||
|
||||
#if HAVE_SSE2
|
||||
void idct16x16_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct16x16_10_add_c(in, out, stride, 10);
|
||||
vp9_highbd_idct16x16_10_add_c(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct16x16_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct16x16_10_add_c(in, out, stride, 12);
|
||||
vp9_highbd_idct16x16_10_add_c(in, out, stride, 12);
|
||||
}
|
||||
|
||||
#if HAVE_SSE2
|
||||
void idct16x16_256_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct16x16_256_add_sse2(in, out, stride, 10);
|
||||
vp9_highbd_idct16x16_256_add_sse2(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct16x16_256_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct16x16_256_add_sse2(in, out, stride, 12);
|
||||
vp9_highbd_idct16x16_256_add_sse2(in, out, stride, 12);
|
||||
}
|
||||
|
||||
void idct16x16_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct16x16_10_add_sse2(in, out, stride, 10);
|
||||
vp9_highbd_idct16x16_10_add_sse2(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct16x16_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct16x16_10_add_sse2(in, out, stride, 12);
|
||||
vp9_highbd_idct16x16_10_add_sse2(in, out, stride, 12);
|
||||
}
|
||||
#endif // HAVE_SSE2
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
@@ -778,7 +801,7 @@ class InvTrans16x16DCT
|
||||
virtual void TearDown() { 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) {}
|
||||
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
|
||||
inv_txfm_(out, dst, stride);
|
||||
}
|
||||
@@ -792,81 +815,20 @@ TEST_P(InvTrans16x16DCT, CompareReference) {
|
||||
CompareInvReference(ref_txfm_, thresh_);
|
||||
}
|
||||
|
||||
class PartialTrans16x16Test
|
||||
: public ::testing::TestWithParam<
|
||||
std::tr1::tuple<FdctFunc, vpx_bit_depth_t> > {
|
||||
public:
|
||||
virtual ~PartialTrans16x16Test() {}
|
||||
virtual void SetUp() {
|
||||
fwd_txfm_ = GET_PARAM(0);
|
||||
bit_depth_ = GET_PARAM(1);
|
||||
}
|
||||
|
||||
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||
|
||||
protected:
|
||||
vpx_bit_depth_t bit_depth_;
|
||||
FdctFunc fwd_txfm_;
|
||||
};
|
||||
|
||||
TEST_P(PartialTrans16x16Test, Extremes) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
const int16_t maxval =
|
||||
static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
|
||||
#else
|
||||
const int16_t maxval = 255;
|
||||
#endif
|
||||
const int minval = -maxval;
|
||||
DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
|
||||
|
||||
for (int i = 0; i < kNumCoeffs; ++i) input[i] = maxval;
|
||||
output[0] = 0;
|
||||
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
|
||||
EXPECT_EQ((maxval * kNumCoeffs) >> 1, output[0]);
|
||||
|
||||
for (int i = 0; i < kNumCoeffs; ++i) input[i] = minval;
|
||||
output[0] = 0;
|
||||
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
|
||||
EXPECT_EQ((minval * kNumCoeffs) >> 1, output[0]);
|
||||
}
|
||||
|
||||
TEST_P(PartialTrans16x16Test, Random) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
const int16_t maxval =
|
||||
static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
|
||||
#else
|
||||
const int16_t maxval = 255;
|
||||
#endif
|
||||
DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
||||
int sum = 0;
|
||||
for (int i = 0; i < kNumCoeffs; ++i) {
|
||||
const int val = (i & 1) ? -rnd(maxval + 1) : rnd(maxval + 1);
|
||||
input[i] = val;
|
||||
sum += val;
|
||||
}
|
||||
output[0] = 0;
|
||||
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 16));
|
||||
EXPECT_EQ(sum >> 1, output[0]);
|
||||
}
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
@@ -885,11 +847,6 @@ INSTANTIATE_TEST_CASE_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_CASE_P(
|
||||
C, PartialTrans16x16Test,
|
||||
::testing::Values(make_tuple(&vpx_highbd_fdct16x16_1_c, VPX_BITS_8),
|
||||
make_tuple(&vpx_highbd_fdct16x16_1_c, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct16x16_1_c, VPX_BITS_12)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans16x16HT,
|
||||
@@ -898,25 +855,22 @@ INSTANTIATE_TEST_CASE_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_CASE_P(C, PartialTrans16x16Test,
|
||||
::testing::Values(make_tuple(&vpx_fdct16x16_1_c,
|
||||
VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_neon, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_neon, 0, VPX_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct16x16_sse2,
|
||||
&vpx_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct16x16_sse2,
|
||||
&vp9_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16HT,
|
||||
::testing::Values(
|
||||
@@ -928,28 +882,33 @@ INSTANTIATE_TEST_CASE_P(
|
||||
VPX_BITS_8),
|
||||
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3,
|
||||
VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test,
|
||||
::testing::Values(make_tuple(&vpx_fdct16x16_1_sse2,
|
||||
VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_fdct16x16_sse2,
|
||||
make_tuple(&vp9_highbd_fdct16x16_sse2,
|
||||
&idct16x16_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct16x16_c,
|
||||
make_tuple(&vp9_highbd_fdct16x16_c,
|
||||
&idct16x16_256_add_10_sse2, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct16x16_sse2,
|
||||
make_tuple(&vp9_highbd_fdct16x16_sse2,
|
||||
&idct16x16_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vpx_highbd_fdct16x16_c,
|
||||
make_tuple(&vp9_highbd_fdct16x16_c,
|
||||
&idct16x16_256_add_12_sse2, 0, VPX_BITS_12),
|
||||
make_tuple(&vpx_fdct16x16_sse2,
|
||||
&vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct16x16_sse2,
|
||||
&vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans16x16HT,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_10, 1, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_10, 2, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_10, 3, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_12, 1, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_12, 2, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_12, 3, VPX_BITS_12),
|
||||
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8),
|
||||
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
|
||||
@@ -968,17 +927,14 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&idct16x16_10_add_12_sse2, 3167, VPX_BITS_12),
|
||||
make_tuple(&idct16x16_12,
|
||||
&idct16x16_256_add_12_sse2, 3167, VPX_BITS_12)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans16x16Test,
|
||||
::testing::Values(make_tuple(&vpx_fdct16x16_1_sse2,
|
||||
VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans16x16DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct16x16_msa,
|
||||
&vpx_idct16x16_256_add_msa, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct16x16_msa,
|
||||
&vp9_idct16x16_256_add_msa, 0, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans16x16HT,
|
||||
::testing::Values(
|
||||
@@ -987,8 +943,5 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 2, VPX_BITS_8),
|
||||
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 3,
|
||||
VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(MSA, PartialTrans16x16Test,
|
||||
::testing::Values(make_tuple(&vpx_fdct16x16_1_msa,
|
||||
VPX_BITS_8)));
|
||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
} // namespace
|
||||
|
@@ -13,14 +13,13 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_entropy.h"
|
||||
#include "vpx/vpx_codec.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
@@ -81,12 +80,16 @@ typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmFunc, int, vpx_bit_depth_t>
|
||||
Trans32x32Param;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
void idct32x32_8(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vp9_highbd_idct32x32_1024_add_c(in, out, stride, 8);
|
||||
}
|
||||
|
||||
void idct32x32_10(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct32x32_1024_add_c(in, out, stride, 10);
|
||||
vp9_highbd_idct32x32_1024_add_c(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct32x32_12(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct32x32_1024_add_c(in, out, stride, 12);
|
||||
vp9_highbd_idct32x32_1024_add_c(in, out, stride, 12);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
@@ -191,7 +194,7 @@ TEST_P(Trans32x32Test, CoeffCheck) {
|
||||
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
|
||||
|
||||
const int stride = 32;
|
||||
vpx_fdct32x32_c(input_block, output_ref_block, stride);
|
||||
vp9_fdct32x32_c(input_block, output_ref_block, stride);
|
||||
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input_block, output_block, stride));
|
||||
|
||||
if (version_ == 0) {
|
||||
@@ -228,7 +231,7 @@ TEST_P(Trans32x32Test, MemCheck) {
|
||||
}
|
||||
|
||||
const int stride = 32;
|
||||
vpx_fdct32x32_c(input_extreme_block, output_ref_block, stride);
|
||||
vp9_fdct32x32_c(input_extreme_block, output_ref_block, stride);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
fwd_txfm_(input_extreme_block, output_block, stride));
|
||||
|
||||
@@ -305,165 +308,87 @@ TEST_P(Trans32x32Test, InverseAccuracy) {
|
||||
}
|
||||
}
|
||||
|
||||
class PartialTrans32x32Test
|
||||
: public ::testing::TestWithParam<
|
||||
std::tr1::tuple<FwdTxfmFunc, vpx_bit_depth_t> > {
|
||||
public:
|
||||
virtual ~PartialTrans32x32Test() {}
|
||||
virtual void SetUp() {
|
||||
fwd_txfm_ = GET_PARAM(0);
|
||||
bit_depth_ = GET_PARAM(1);
|
||||
}
|
||||
|
||||
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||
|
||||
protected:
|
||||
vpx_bit_depth_t bit_depth_;
|
||||
FwdTxfmFunc fwd_txfm_;
|
||||
};
|
||||
|
||||
TEST_P(PartialTrans32x32Test, Extremes) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
const int16_t maxval =
|
||||
static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
|
||||
#else
|
||||
const int16_t maxval = 255;
|
||||
#endif
|
||||
const int minval = -maxval;
|
||||
DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
|
||||
|
||||
for (int i = 0; i < kNumCoeffs; ++i) input[i] = maxval;
|
||||
output[0] = 0;
|
||||
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 32));
|
||||
EXPECT_EQ((maxval * kNumCoeffs) >> 3, output[0]);
|
||||
|
||||
for (int i = 0; i < kNumCoeffs; ++i) input[i] = minval;
|
||||
output[0] = 0;
|
||||
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 32));
|
||||
EXPECT_EQ((minval * kNumCoeffs) >> 3, output[0]);
|
||||
}
|
||||
|
||||
TEST_P(PartialTrans32x32Test, Random) {
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
const int16_t maxval =
|
||||
static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
|
||||
#else
|
||||
const int16_t maxval = 255;
|
||||
#endif
|
||||
DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
||||
int sum = 0;
|
||||
for (int i = 0; i < kNumCoeffs; ++i) {
|
||||
const int val = (i & 1) ? -rnd(maxval + 1) : rnd(maxval + 1);
|
||||
input[i] = val;
|
||||
sum += val;
|
||||
}
|
||||
output[0] = 0;
|
||||
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 32));
|
||||
EXPECT_EQ(sum >> 3, output[0]);
|
||||
}
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans32x32Test,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_fdct32x32_c,
|
||||
make_tuple(&vp9_highbd_fdct32x32_c,
|
||||
&idct32x32_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct32x32_rd_c,
|
||||
make_tuple(&vp9_highbd_fdct32x32_rd_c,
|
||||
&idct32x32_10, 1, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct32x32_c,
|
||||
make_tuple(&vp9_highbd_fdct32x32_c,
|
||||
&idct32x32_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vpx_highbd_fdct32x32_rd_c,
|
||||
make_tuple(&vp9_highbd_fdct32x32_rd_c,
|
||||
&idct32x32_12, 1, VPX_BITS_12),
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_c,
|
||||
&vpx_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, PartialTrans32x32Test,
|
||||
::testing::Values(make_tuple(&vpx_highbd_fdct32x32_1_c, VPX_BITS_8),
|
||||
make_tuple(&vpx_highbd_fdct32x32_1_c, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct32x32_1_c, VPX_BITS_12)));
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_fdct32x32_rd_c,
|
||||
&vp9_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans32x32Test,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_c,
|
||||
&vpx_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(C, PartialTrans32x32Test,
|
||||
::testing::Values(make_tuple(&vpx_fdct32x32_1_c,
|
||||
VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_fdct32x32_rd_c,
|
||||
&vp9_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans32x32Test,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_neon, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_c,
|
||||
&vpx_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_neon, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_fdct32x32_rd_c,
|
||||
&vp9_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans32x32Test,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_sse2,
|
||||
&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_CASE_P(SSE2, PartialTrans32x32Test,
|
||||
::testing::Values(make_tuple(&vpx_fdct32x32_1_sse2,
|
||||
VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct32x32_sse2,
|
||||
&vp9_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_fdct32x32_rd_sse2,
|
||||
&vp9_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans32x32Test,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_fdct32x32_sse2, &idct32x32_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct32x32_rd_sse2, &idct32x32_10, 1,
|
||||
make_tuple(&vp9_highbd_fdct32x32_sse2, &idct32x32_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fdct32x32_rd_sse2, &idct32x32_10, 1,
|
||||
VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct32x32_sse2, &idct32x32_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vpx_highbd_fdct32x32_rd_sse2, &idct32x32_12, 1,
|
||||
make_tuple(&vp9_highbd_fdct32x32_sse2, &idct32x32_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_fdct32x32_rd_sse2, &idct32x32_12, 1,
|
||||
VPX_BITS_12),
|
||||
make_tuple(&vpx_fdct32x32_sse2, &vpx_idct32x32_1024_add_c, 0,
|
||||
make_tuple(&vp9_fdct32x32_sse2, &vp9_idct32x32_1024_add_c, 0,
|
||||
VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_sse2, &vpx_idct32x32_1024_add_c, 1,
|
||||
make_tuple(&vp9_fdct32x32_rd_sse2, &vp9_idct32x32_1024_add_c, 1,
|
||||
VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, PartialTrans32x32Test,
|
||||
::testing::Values(make_tuple(&vpx_fdct32x32_1_sse2,
|
||||
VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX2, Trans32x32Test,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_avx2,
|
||||
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_avx2,
|
||||
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct32x32_avx2,
|
||||
&vp9_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_fdct32x32_rd_avx2,
|
||||
&vp9_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans32x32Test,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_msa,
|
||||
&vpx_idct32x32_1024_add_msa, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_fdct32x32_rd_msa,
|
||||
&vpx_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(MSA, PartialTrans32x32Test,
|
||||
::testing::Values(make_tuple(&vpx_fdct32x32_1_msa,
|
||||
VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct32x32_msa,
|
||||
&vp9_idct32x32_1024_add_msa, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_fdct32x32_rd_msa,
|
||||
&vp9_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
|
||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
} // namespace
|
||||
|
@@ -7,11 +7,10 @@
|
||||
* 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 "./vpx_config.h"
|
||||
#include "test/ivf_video_source.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "vpx/vp8dx.h"
|
||||
#include "vpx/vpx_decoder.h"
|
||||
|
||||
@@ -26,9 +25,6 @@ TEST(DecodeAPI, InvalidParams) {
|
||||
#endif
|
||||
#if CONFIG_VP9_DECODER
|
||||
&vpx_codec_vp9_dx_algo,
|
||||
#endif
|
||||
#if CONFIG_VP10_DECODER
|
||||
&vpx_codec_vp10_dx_algo,
|
||||
#endif
|
||||
};
|
||||
uint8_t buf[1] = {0};
|
||||
@@ -133,53 +129,14 @@ TEST(DecodeAPI, Vp9InvalidDecode) {
|
||||
vpx_codec_ctx_t dec;
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_dec_init(&dec, codec, NULL, 0));
|
||||
const uint32_t frame_size = static_cast<uint32_t>(video.frame_size());
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
EXPECT_EQ(VPX_CODEC_MEM_ERROR,
|
||||
vpx_codec_decode(&dec, video.cxdata(), frame_size, NULL, 0));
|
||||
#else
|
||||
EXPECT_EQ(VPX_CODEC_UNSUP_BITSTREAM,
|
||||
vpx_codec_decode(&dec, video.cxdata(), frame_size, NULL, 0));
|
||||
#endif
|
||||
vpx_codec_iter_t iter = NULL;
|
||||
EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter));
|
||||
|
||||
TestVp9Controls(&dec);
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec));
|
||||
}
|
||||
|
||||
TEST(DecodeAPI, Vp9PeekSI) {
|
||||
const vpx_codec_iface_t *const codec = &vpx_codec_vp9_dx_algo;
|
||||
// The first 9 bytes are valid and the rest of the bytes are made up. Until
|
||||
// size 10, this should return VPX_CODEC_UNSUP_BITSTREAM and after that it
|
||||
// should return VPX_CODEC_CORRUPT_FRAME.
|
||||
const uint8_t data[32] = {
|
||||
0x85, 0xa4, 0xc1, 0xa1, 0x38, 0x81, 0xa3, 0x49,
|
||||
0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
};
|
||||
|
||||
for (uint32_t data_sz = 1; data_sz <= 32; ++data_sz) {
|
||||
// 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) {
|
||||
vpx_codec_ctx_t dec;
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_dec_init(&dec, codec, NULL, 0));
|
||||
EXPECT_EQ((data_sz < 10) ?
|
||||
VPX_CODEC_UNSUP_BITSTREAM : VPX_CODEC_CORRUPT_FRAME,
|
||||
vpx_codec_decode(&dec, data, data_sz, NULL, 0));
|
||||
vpx_codec_iter_t iter = NULL;
|
||||
EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter));
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec));
|
||||
}
|
||||
|
||||
// Verify behavior of vpx_codec_peek_stream_info.
|
||||
vpx_codec_stream_info_t si;
|
||||
si.sz = sizeof(si);
|
||||
EXPECT_EQ((data_sz < 10) ? VPX_CODEC_UNSUP_BITSTREAM : VPX_CODEC_OK,
|
||||
vpx_codec_peek_stream_info(codec, data, data_sz, &si));
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_VP9_DECODER
|
||||
|
||||
} // namespace
|
||||
|
@@ -7,11 +7,9 @@
|
||||
* 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 "test/codec_factory.h"
|
||||
#include "test/decode_test_driver.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/video_source.h"
|
||||
|
||||
|
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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 "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "vpx/vp8cx.h"
|
||||
#include "vpx/vpx_encoder.h"
|
||||
|
||||
namespace {
|
||||
|
||||
#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0]))
|
||||
|
||||
TEST(EncodeAPI, InvalidParams) {
|
||||
static const vpx_codec_iface_t *kCodecs[] = {
|
||||
#if CONFIG_VP8_ENCODER
|
||||
&vpx_codec_vp8_cx_algo,
|
||||
#endif
|
||||
#if CONFIG_VP9_ENCODER
|
||||
&vpx_codec_vp9_cx_algo,
|
||||
#endif
|
||||
#if CONFIG_VP10_ENCODER
|
||||
&vpx_codec_vp10_cx_algo,
|
||||
#endif
|
||||
};
|
||||
uint8_t buf[1] = {0};
|
||||
vpx_image_t img;
|
||||
vpx_codec_ctx_t enc;
|
||||
vpx_codec_enc_cfg_t cfg;
|
||||
|
||||
EXPECT_EQ(&img, vpx_img_wrap(&img, VPX_IMG_FMT_I420, 1, 1, 1, buf));
|
||||
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_enc_init(NULL, NULL, NULL, 0));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_enc_init(&enc, NULL, NULL, 0));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_encode(NULL, NULL, 0, 0, 0, 0));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_encode(NULL, &img, 0, 0, 0, 0));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_destroy(NULL));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
|
||||
vpx_codec_enc_config_default(NULL, NULL, 0));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
|
||||
vpx_codec_enc_config_default(NULL, &cfg, 0));
|
||||
EXPECT_TRUE(vpx_codec_error(NULL) != NULL);
|
||||
|
||||
for (int i = 0; i < NELEMENTS(kCodecs); ++i) {
|
||||
SCOPED_TRACE(vpx_codec_iface_name(kCodecs[i]));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
|
||||
vpx_codec_enc_init(NULL, kCodecs[i], NULL, 0));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
|
||||
vpx_codec_enc_init(&enc, kCodecs[i], NULL, 0));
|
||||
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
|
||||
vpx_codec_enc_config_default(kCodecs[i], &cfg, 1));
|
||||
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_enc_config_default(kCodecs[i], &cfg, 0));
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_enc_init(&enc, kCodecs[i], &cfg, 0));
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_encode(&enc, NULL, 0, 0, 0, 0));
|
||||
|
||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&enc));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
@@ -10,14 +10,13 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "test/codec_factory.h"
|
||||
#include "test/decode_test_driver.h"
|
||||
#include "test/encode_test_driver.h"
|
||||
#include "test/decode_test_driver.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/video_source.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
namespace libvpx_test {
|
||||
void Encoder::InitEncoder(VideoSource *video) {
|
||||
@@ -42,15 +41,6 @@ void Encoder::InitEncoder(VideoSource *video) {
|
||||
log2_tile_columns);
|
||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
||||
} else
|
||||
#endif
|
||||
#if CONFIG_VP10_ENCODER
|
||||
if (CodecInterface() == &vpx_codec_vp10_cx_algo) {
|
||||
// Default to 1 tile column for VP10.
|
||||
const int log2_tile_columns = 0;
|
||||
res = vpx_codec_control_(&encoder_, VP9E_SET_TILE_COLUMNS,
|
||||
log2_tile_columns);
|
||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if CONFIG_VP8_ENCODER
|
||||
@@ -195,7 +185,6 @@ void EncoderTest::RunLoop(VideoSource *video) {
|
||||
|
||||
video->Begin();
|
||||
encoder->InitEncoder(video);
|
||||
ASSERT_FALSE(::testing::Test::HasFatalFailure());
|
||||
|
||||
unsigned long dec_init_flags = 0; // NOLINT
|
||||
// Use fragment decoder if encoder outputs partitions.
|
||||
|
@@ -13,13 +13,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER || CONFIG_VP10_ENCODER
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "vpx/vpx_encoder.h"
|
||||
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
|
||||
#include "vpx/vp8cx.h"
|
||||
#endif
|
||||
#include "vpx/vpx_encoder.h"
|
||||
|
||||
namespace libvpx_test {
|
||||
|
||||
@@ -124,11 +123,6 @@ class Encoder {
|
||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
||||
}
|
||||
|
||||
void Control(int ctrl_id, int *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, struct vpx_scaling_mode *arg) {
|
||||
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
|
||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
||||
@@ -143,7 +137,7 @@ class Encoder {
|
||||
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
|
||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
||||
}
|
||||
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER || CONFIG_VP10_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);
|
||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
||||
|
@@ -20,11 +20,10 @@ const int kMaxErrorFrames = 12;
|
||||
const int kMaxDroppableFrames = 12;
|
||||
|
||||
class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
|
||||
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, bool> {
|
||||
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
|
||||
protected:
|
||||
ErrorResilienceTestLarge()
|
||||
: EncoderTest(GET_PARAM(0)),
|
||||
svc_support_(GET_PARAM(2)),
|
||||
psnr_(0.0),
|
||||
nframes_(0),
|
||||
mismatch_psnr_(0.0),
|
||||
@@ -100,7 +99,7 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
|
||||
}
|
||||
|
||||
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
|
||||
::libvpx_test::Encoder * /*encoder*/) {
|
||||
::libvpx_test::Encoder *encoder) {
|
||||
frame_flags_ &= ~(VP8_EFLAG_NO_UPD_LAST |
|
||||
VP8_EFLAG_NO_UPD_GF |
|
||||
VP8_EFLAG_NO_UPD_ARF);
|
||||
@@ -194,8 +193,6 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
|
||||
pattern_switch_ = frame_switch;
|
||||
}
|
||||
|
||||
bool svc_support_;
|
||||
|
||||
private:
|
||||
double psnr_;
|
||||
unsigned int nframes_;
|
||||
@@ -305,10 +302,6 @@ TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) {
|
||||
// two layer temporal pattern. The base layer does not predict from the top
|
||||
// layer, so successful decoding is expected.
|
||||
TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) {
|
||||
// This test doesn't run if SVC is not supported.
|
||||
if (!svc_support_)
|
||||
return;
|
||||
|
||||
const vpx_rational timebase = { 33333333, 1000000000 };
|
||||
cfg_.g_timebase = timebase;
|
||||
cfg_.rc_target_bitrate = 500;
|
||||
@@ -354,10 +347,6 @@ TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) {
|
||||
// for a two layer temporal pattern, where at some point in the
|
||||
// sequence, the LAST ref is not used anymore.
|
||||
TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) {
|
||||
// This test doesn't run if SVC is not supported.
|
||||
if (!svc_support_)
|
||||
return;
|
||||
|
||||
const vpx_rational timebase = { 33333333, 1000000000 };
|
||||
cfg_.g_timebase = timebase;
|
||||
cfg_.rc_target_bitrate = 500;
|
||||
@@ -590,13 +579,8 @@ TEST_P(ErrorResilienceTestLargeCodecControls, CodecControl3TemporalLayers) {
|
||||
}
|
||||
}
|
||||
|
||||
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES,
|
||||
::testing::Values(true));
|
||||
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
|
||||
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLargeCodecControls,
|
||||
ONE_PASS_TEST_MODES);
|
||||
VP9_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES,
|
||||
::testing::Values(true));
|
||||
// SVC-related tests don't run for VP10 since SVC is not supported.
|
||||
VP10_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES,
|
||||
::testing::Values(false));
|
||||
VP9_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
|
||||
} // namespace
|
||||
|
@@ -24,6 +24,7 @@
|
||||
namespace {
|
||||
|
||||
const int kVideoNameParam = 1;
|
||||
const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
|
||||
|
||||
struct ExternalFrameBuffer {
|
||||
uint8_t *data;
|
||||
@@ -154,8 +155,6 @@ class ExternalFrameBufferList {
|
||||
ExternalFrameBuffer *ext_fb_list_;
|
||||
};
|
||||
|
||||
#if CONFIG_WEBM_IO
|
||||
|
||||
// Callback used by libvpx to request the application to return a frame
|
||||
// buffer of at least |min_size| in bytes.
|
||||
int get_vp9_frame_buffer(void *user_priv, size_t min_size,
|
||||
@@ -198,8 +197,6 @@ int do_not_release_vp9_frame_buffer(void *user_priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // CONFIG_WEBM_IO
|
||||
|
||||
// Class for testing passing in external frame buffers to libvpx.
|
||||
class ExternalFrameBufferMD5Test
|
||||
: public ::libvpx_test::DecoderTest,
|
||||
@@ -281,8 +278,6 @@ class ExternalFrameBufferMD5Test
|
||||
};
|
||||
|
||||
#if CONFIG_WEBM_IO
|
||||
const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
|
||||
|
||||
// Class for testing passing in external frame buffers to libvpx.
|
||||
class ExternalFrameBufferTest : public ::testing::Test {
|
||||
protected:
|
||||
|
@@ -13,13 +13,12 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_entropy.h"
|
||||
#include "vpx/vpx_codec.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
@@ -40,8 +39,8 @@ typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct4x4Param;
|
||||
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht4x4Param;
|
||||
|
||||
void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
int /*tx_type*/) {
|
||||
vpx_fdct4x4_c(in, out, stride);
|
||||
int tx_type) {
|
||||
vp9_fdct4x4_c(in, out, stride);
|
||||
}
|
||||
|
||||
void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||
@@ -49,17 +48,17 @@ void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||
}
|
||||
|
||||
void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
int /*tx_type*/) {
|
||||
int tx_type) {
|
||||
vp9_fwht4x4_c(in, out, stride);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
void idct4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct4x4_16_add_c(in, out, stride, 10);
|
||||
vp9_highbd_idct4x4_16_add_c(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct4x4_16_add_c(in, out, stride, 12);
|
||||
vp9_highbd_idct4x4_16_add_c(in, out, stride, 12);
|
||||
}
|
||||
|
||||
void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
||||
@@ -71,20 +70,20 @@ void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
||||
}
|
||||
|
||||
void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_iwht4x4_16_add_c(in, out, stride, 10);
|
||||
vp9_highbd_iwht4x4_16_add_c(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void iwht4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_iwht4x4_16_add_c(in, out, stride, 12);
|
||||
vp9_highbd_iwht4x4_16_add_c(in, out, stride, 12);
|
||||
}
|
||||
|
||||
#if HAVE_SSE2
|
||||
void idct4x4_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct4x4_16_add_sse2(in, out, stride, 10);
|
||||
vp9_highbd_idct4x4_16_add_sse2(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct4x4_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct4x4_16_add_sse2(in, out, stride, 12);
|
||||
vp9_highbd_idct4x4_16_add_sse2(in, out, stride, 12);
|
||||
}
|
||||
#endif // HAVE_SSE2
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
@@ -419,14 +418,14 @@ using std::tr1::make_tuple;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vp9_fdct4x4_c, &vp9_idct4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct4x4_c, &vpx_idct4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct4x4_c, &vp9_idct4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
@@ -461,20 +460,20 @@ INSTANTIATE_TEST_CASE_P(
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fwht4x4_c, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Trans4x4WHT,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fwht4x4_c, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct4x4_c,
|
||||
&vpx_idct4x4_16_add_neon, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct4x4_c,
|
||||
&vp9_idct4x4_16_add_neon, 0, VPX_BITS_8)));
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
@@ -492,23 +491,15 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MMX, Trans4x4WHT,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_fwht4x4_mmx, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if CONFIG_USE_X86INC && HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && \
|
||||
!CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4WHT,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_fwht4x4_c, &vpx_iwht4x4_16_add_sse2, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fwht4x4_mmx, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct4x4_sse2,
|
||||
&vpx_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct4x4_sse2,
|
||||
&vp9_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4HT,
|
||||
::testing::Values(
|
||||
@@ -522,16 +513,24 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12_sse2, 0, VPX_BITS_12),
|
||||
make_tuple(&vpx_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, VPX_BITS_12),
|
||||
make_tuple(&vpx_fdct4x4_sse2, &vpx_idct4x4_16_add_c, 0,
|
||||
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_12_sse2, 0, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, VPX_BITS_12),
|
||||
make_tuple(&vp9_fdct4x4_sse2, &vp9_idct4x4_16_add_c, 0,
|
||||
VPX_BITS_8)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Trans4x4HT,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 1, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 2, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 3, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 0, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 1, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 2, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 3, VPX_BITS_12),
|
||||
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8),
|
||||
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8),
|
||||
@@ -542,7 +541,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans4x4DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct4x4_msa, &vpx_idct4x4_16_add_msa, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct4x4_msa, &vp9_idct4x4_16_add_msa, 0, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Trans4x4HT,
|
||||
::testing::Values(
|
||||
|
@@ -13,13 +13,12 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_entropy.h"
|
||||
#include "vp9/common/vp9_scan.h"
|
||||
#include "vpx/vpx_codec.h"
|
||||
@@ -47,7 +46,7 @@ typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct8x8Param;
|
||||
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht8x8Param;
|
||||
typedef std::tr1::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t> Idct8x8Param;
|
||||
|
||||
void reference_8x8_dct_1d(const double in[8], double out[8]) {
|
||||
void reference_8x8_dct_1d(const double in[8], double out[8], int stride) {
|
||||
const double kInvSqrt2 = 0.707106781186547524400844362104;
|
||||
for (int k = 0; k < 8; k++) {
|
||||
out[k] = 0.0;
|
||||
@@ -65,7 +64,7 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs],
|
||||
double temp_in[8], temp_out[8];
|
||||
for (int j = 0; j < 8; ++j)
|
||||
temp_in[j] = input[j*8 + i];
|
||||
reference_8x8_dct_1d(temp_in, temp_out);
|
||||
reference_8x8_dct_1d(temp_in, temp_out, 1);
|
||||
for (int j = 0; j < 8; ++j)
|
||||
output[j * 8 + i] = temp_out[j];
|
||||
}
|
||||
@@ -74,7 +73,7 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs],
|
||||
double temp_in[8], temp_out[8];
|
||||
for (int j = 0; j < 8; ++j)
|
||||
temp_in[j] = output[j + i*8];
|
||||
reference_8x8_dct_1d(temp_in, temp_out);
|
||||
reference_8x8_dct_1d(temp_in, temp_out, 1);
|
||||
// Scale by some magic number
|
||||
for (int j = 0; j < 8; ++j)
|
||||
output[j + i * 8] = temp_out[j] * 2;
|
||||
@@ -82,9 +81,8 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs],
|
||||
}
|
||||
|
||||
|
||||
void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||
int /*tx_type*/) {
|
||||
vpx_fdct8x8_c(in, out, stride);
|
||||
void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||
vp9_fdct8x8_c(in, out, stride);
|
||||
}
|
||||
|
||||
void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||
@@ -93,11 +91,11 @@ void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
void idct8x8_10(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_64_add_c(in, out, stride, 10);
|
||||
vp9_highbd_idct8x8_64_add_c(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct8x8_12(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_64_add_c(in, out, stride, 12);
|
||||
vp9_highbd_idct8x8_64_add_c(in, out, stride, 12);
|
||||
}
|
||||
|
||||
void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
||||
@@ -108,30 +106,29 @@ void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
||||
vp9_highbd_iht8x8_64_add_c(in, out, stride, tx_type, 12);
|
||||
}
|
||||
|
||||
#if HAVE_SSE2
|
||||
|
||||
void idct8x8_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_10_add_c(in, out, stride, 10);
|
||||
vp9_highbd_idct8x8_10_add_c(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct8x8_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_10_add_c(in, out, stride, 12);
|
||||
vp9_highbd_idct8x8_10_add_c(in, out, stride, 12);
|
||||
}
|
||||
|
||||
#if HAVE_SSE2
|
||||
void idct8x8_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_10_add_sse2(in, out, stride, 10);
|
||||
vp9_highbd_idct8x8_10_add_sse2(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct8x8_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_10_add_sse2(in, out, stride, 12);
|
||||
vp9_highbd_idct8x8_10_add_sse2(in, out, stride, 12);
|
||||
}
|
||||
|
||||
void idct8x8_64_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_64_add_sse2(in, out, stride, 10);
|
||||
vp9_highbd_idct8x8_64_add_sse2(in, out, stride, 10);
|
||||
}
|
||||
|
||||
void idct8x8_64_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
||||
vpx_highbd_idct8x8_64_add_sse2(in, out, stride, 12);
|
||||
vp9_highbd_idct8x8_64_add_sse2(in, out, stride, 12);
|
||||
}
|
||||
#endif // HAVE_SSE2
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
@@ -643,7 +640,7 @@ class InvTrans8x8DCT
|
||||
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
|
||||
inv_txfm_(out, dst, stride);
|
||||
}
|
||||
void RunFwdTxfm(int16_t * /*out*/, tran_low_t * /*dst*/, int /*stride*/) {}
|
||||
void RunFwdTxfm(int16_t *out, tran_low_t *dst, int stride) {}
|
||||
|
||||
IdctFunc ref_txfm_;
|
||||
IdctFunc inv_txfm_;
|
||||
@@ -660,14 +657,14 @@ using std::tr1::make_tuple;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12)));
|
||||
make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
@@ -687,6 +684,8 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 2, VPX_BITS_8),
|
||||
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 3, VPX_BITS_8)));
|
||||
#else
|
||||
// TODO(jingning): re-enable after this handles the expanded range [0, 65535]
|
||||
// returned from Rand16().
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
@@ -697,10 +696,12 @@ INSTANTIATE_TEST_CASE_P(
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
// TODO(jingning): re-enable after this handles the expanded range [0, 65535]
|
||||
// returned from Rand16().
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_neon, &vpx_idct8x8_64_add_neon, 0,
|
||||
make_tuple(&vp9_fdct8x8_neon, &vp9_idct8x8_64_add_neon, 0,
|
||||
VPX_BITS_8)));
|
||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
@@ -715,10 +716,12 @@ INSTANTIATE_TEST_CASE_P(
|
||||
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
// TODO(jingning): re-enable after these handle the expanded range [0, 65535]
|
||||
// returned from Rand16().
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_sse2, &vpx_idct8x8_64_add_sse2, 0,
|
||||
make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_sse2, 0,
|
||||
VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, FwdTrans8x8HT,
|
||||
@@ -733,16 +736,18 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_sse2, &vpx_idct8x8_64_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vpx_highbd_fdct8x8_c,
|
||||
make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8),
|
||||
make_tuple(&vp9_highbd_fdct8x8_c,
|
||||
&idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct8x8_sse2,
|
||||
make_tuple(&vp9_highbd_fdct8x8_sse2,
|
||||
&idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_fdct8x8_c,
|
||||
make_tuple(&vp9_highbd_fdct8x8_c,
|
||||
&idct8x8_64_add_12_sse2, 12, VPX_BITS_12),
|
||||
make_tuple(&vpx_highbd_fdct8x8_sse2,
|
||||
make_tuple(&vp9_highbd_fdct8x8_sse2,
|
||||
&idct8x8_64_add_12_sse2, 12, VPX_BITS_12)));
|
||||
|
||||
// TODO(jingning): re-enable after these handle the expanded range [0, 65535]
|
||||
// returned from Rand16().
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
@@ -766,12 +771,14 @@ INSTANTIATE_TEST_CASE_P(
|
||||
&idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
|
||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC && ARCH_X86_64 && \
|
||||
!CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
|
||||
!CONFIG_EMULATE_HARDWARE
|
||||
// TODO(jingning): re-enable after this handles the expanded range [0, 65535]
|
||||
// returned from Rand16().
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_ssse3, &vpx_idct8x8_64_add_ssse3, 0,
|
||||
make_tuple(&vp9_fdct8x8_ssse3, &vp9_idct8x8_64_add_ssse3, 0,
|
||||
VPX_BITS_8)));
|
||||
#endif
|
||||
|
||||
@@ -779,7 +786,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, FwdTrans8x8DCT,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_msa, &vpx_idct8x8_64_add_msa, 0, VPX_BITS_8)));
|
||||
make_tuple(&vp9_fdct8x8_msa, &vp9_idct8x8_64_add_msa, 0, VPX_BITS_8)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, FwdTrans8x8HT,
|
||||
::testing::Values(
|
||||
|
@@ -74,7 +74,7 @@ TEST_F(VP9FrameSizeTestsLarge, ValidSizes) {
|
||||
// size or almost 1 gig of memory.
|
||||
// In total the allocations will exceed 2GiB which may cause a failure with
|
||||
// mingw + wine, use a smaller size in that case.
|
||||
#if defined(_WIN32) && !defined(_WIN64) || defined(__OS2__)
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
video.SetSize(4096, 3072);
|
||||
#else
|
||||
video.SetSize(4096, 4096);
|
||||
|
@@ -1,126 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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 <algorithm>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
|
||||
#include "test/acm_random.h"
|
||||
#include "test/register_state_check.h"
|
||||
|
||||
namespace {
|
||||
|
||||
using ::libvpx_test::ACMRandom;
|
||||
|
||||
typedef void (*Hadamard8x8Func)(const int16_t *a, int a_stride,
|
||||
int16_t *b);
|
||||
|
||||
class HadamardTest : public ::testing::TestWithParam<Hadamard8x8Func> {
|
||||
public:
|
||||
virtual void SetUp() {
|
||||
h_func_ = GetParam();
|
||||
rnd_.Reset(ACMRandom::DeterministicSeed());
|
||||
}
|
||||
|
||||
protected:
|
||||
Hadamard8x8Func h_func_;
|
||||
ACMRandom rnd_;
|
||||
};
|
||||
|
||||
void hadamard_loop(const int16_t *a, int a_stride, int16_t *out) {
|
||||
int16_t b[8];
|
||||
for (int i = 0; i < 8; i += 2) {
|
||||
b[i + 0] = a[i * a_stride] + a[(i + 1) * a_stride];
|
||||
b[i + 1] = a[i * a_stride] - a[(i + 1) * a_stride];
|
||||
}
|
||||
int16_t c[8];
|
||||
for (int i = 0; i < 8; i += 4) {
|
||||
c[i + 0] = b[i + 0] + b[i + 2];
|
||||
c[i + 1] = b[i + 1] + b[i + 3];
|
||||
c[i + 2] = b[i + 0] - b[i + 2];
|
||||
c[i + 3] = b[i + 1] - b[i + 3];
|
||||
}
|
||||
out[0] = c[0] + c[4];
|
||||
out[7] = c[1] + c[5];
|
||||
out[3] = c[2] + c[6];
|
||||
out[4] = c[3] + c[7];
|
||||
out[2] = c[0] - c[4];
|
||||
out[6] = c[1] - c[5];
|
||||
out[1] = c[2] - c[6];
|
||||
out[5] = c[3] - c[7];
|
||||
}
|
||||
|
||||
void reference_hadamard(const int16_t *a, int a_stride, int16_t *b) {
|
||||
int16_t buf[64];
|
||||
for (int i = 0; i < 8; i++) {
|
||||
hadamard_loop(a + i, a_stride, buf + i * 8);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
hadamard_loop(buf + i, 8, b + i * 8);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(HadamardTest, CompareReferenceRandom) {
|
||||
DECLARE_ALIGNED(16, int16_t, a[64]);
|
||||
DECLARE_ALIGNED(16, int16_t, b[64]);
|
||||
int16_t b_ref[64];
|
||||
for (int i = 0; i < 64; i++) {
|
||||
a[i] = rnd_.Rand9Signed();
|
||||
}
|
||||
memset(b, 0, sizeof(b));
|
||||
memset(b_ref, 0, sizeof(b_ref));
|
||||
|
||||
reference_hadamard(a, 8, b_ref);
|
||||
ASM_REGISTER_STATE_CHECK(h_func_(a, 8, b));
|
||||
|
||||
// The order of the output is not important. Sort before checking.
|
||||
std::sort(b, b + 64);
|
||||
std::sort(b_ref, b_ref + 64);
|
||||
EXPECT_EQ(0, memcmp(b, b_ref, sizeof(b)));
|
||||
}
|
||||
|
||||
TEST_P(HadamardTest, VaryStride) {
|
||||
DECLARE_ALIGNED(16, int16_t, a[64 * 8]);
|
||||
DECLARE_ALIGNED(16, int16_t, b[64]);
|
||||
int16_t b_ref[64];
|
||||
for (int i = 0; i < 64 * 8; i++) {
|
||||
a[i] = rnd_.Rand9Signed();
|
||||
}
|
||||
|
||||
for (int i = 8; i < 64; i += 8) {
|
||||
memset(b, 0, sizeof(b));
|
||||
memset(b_ref, 0, sizeof(b_ref));
|
||||
|
||||
reference_hadamard(a, i, b_ref);
|
||||
ASM_REGISTER_STATE_CHECK(h_func_(a, i, b));
|
||||
|
||||
// The order of the output is not important. Sort before checking.
|
||||
std::sort(b, b + 64);
|
||||
std::sort(b_ref, b_ref + 64);
|
||||
EXPECT_EQ(0, memcmp(b, b_ref, sizeof(b)));
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(C, HadamardTest,
|
||||
::testing::Values(&vpx_hadamard_8x8_c));
|
||||
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, HadamardTest,
|
||||
::testing::Values(&vpx_hadamard_8x8_sse2));
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC && ARCH_X86_64
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, HadamardTest,
|
||||
::testing::Values(&vpx_hadamard_8x8_ssse3));
|
||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC && ARCH_X86_64
|
||||
} // namespace
|
@@ -14,7 +14,8 @@
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
|
||||
#include "test/acm_random.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
|
||||
@@ -67,6 +68,43 @@ void reference_dct_2d(int16_t input[64], double output[64]) {
|
||||
output[i] *= 2;
|
||||
}
|
||||
|
||||
void reference_idct_1d(double input[8], double output[8]) {
|
||||
const double kPi = 3.141592653589793238462643383279502884;
|
||||
const double kSqrt2 = 1.414213562373095048801688724209698;
|
||||
for (int k = 0; k < 8; k++) {
|
||||
output[k] = 0.0;
|
||||
for (int n = 0; n < 8; n++) {
|
||||
output[k] += input[n]*cos(kPi*(2*k+1)*n/16.0);
|
||||
if (n == 0)
|
||||
output[k] = output[k]/kSqrt2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void reference_idct_2d(double input[64], int16_t output[64]) {
|
||||
double out[64], out2[64];
|
||||
// First transform rows
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
double temp_in[8], temp_out[8];
|
||||
for (int j = 0; j < 8; ++j)
|
||||
temp_in[j] = input[j + i*8];
|
||||
reference_idct_1d(temp_in, temp_out);
|
||||
for (int j = 0; j < 8; ++j)
|
||||
out[j + i*8] = temp_out[j];
|
||||
}
|
||||
// Then transform columns
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
double temp_in[8], temp_out[8];
|
||||
for (int j = 0; j < 8; ++j)
|
||||
temp_in[j] = out[j*8 + i];
|
||||
reference_idct_1d(temp_in, temp_out);
|
||||
for (int j = 0; j < 8; ++j)
|
||||
out2[j*8 + i] = temp_out[j];
|
||||
}
|
||||
for (int i = 0; i < 64; ++i)
|
||||
output[i] = round(out2[i]/32);
|
||||
}
|
||||
|
||||
TEST(VP9Idct8x8Test, AccuracyCheck) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = 10000;
|
||||
@@ -87,7 +125,7 @@ TEST(VP9Idct8x8Test, AccuracyCheck) {
|
||||
reference_dct_2d(input, output_r);
|
||||
for (int j = 0; j < 64; ++j)
|
||||
coeff[j] = round(output_r[j]);
|
||||
vpx_idct8x8_64_add_c(coeff, dst, 8);
|
||||
vp9_idct8x8_64_add_c(coeff, dst, 8);
|
||||
for (int j = 0; j < 64; ++j) {
|
||||
const int diff = dst[j] - src[j];
|
||||
const int error = diff * diff;
|
||||
|
@@ -10,11 +10,10 @@
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp8_rtcd.h"
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "vpx/vpx_integer.h"
|
||||
|
||||
typedef void (*IdctFunc)(int16_t *input, unsigned char *pred_ptr,
|
||||
@@ -114,8 +113,4 @@ INSTANTIATE_TEST_CASE_P(C, IDCTTest, ::testing::Values(vp8_short_idct4x4llm_c));
|
||||
INSTANTIATE_TEST_CASE_P(MMX, IDCTTest,
|
||||
::testing::Values(vp8_short_idct4x4llm_mmx));
|
||||
#endif
|
||||
#if HAVE_MSA
|
||||
INSTANTIATE_TEST_CASE_P(MSA, IDCTTest,
|
||||
::testing::Values(vp8_short_idct4x4llm_msa));
|
||||
#endif
|
||||
}
|
||||
|
396
test/intrapred_test.cc
Normal file
396
test/intrapred_test.cc
Normal file
@@ -0,0 +1,396 @@
|
||||
/*
|
||||
* Copyright (c) 2012 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 <string.h>
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp8_rtcd.h"
|
||||
#include "vp8/common/blockd.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
namespace {
|
||||
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
class IntraPredBase {
|
||||
public:
|
||||
virtual ~IntraPredBase() { libvpx_test::ClearSystemState(); }
|
||||
|
||||
protected:
|
||||
void SetupMacroblock(MACROBLOCKD *mbptr,
|
||||
MODE_INFO *miptr,
|
||||
uint8_t *data,
|
||||
int block_size,
|
||||
int stride,
|
||||
int num_planes) {
|
||||
mbptr_ = mbptr;
|
||||
miptr_ = miptr;
|
||||
mbptr_->up_available = 1;
|
||||
mbptr_->left_available = 1;
|
||||
mbptr_->mode_info_context = miptr_;
|
||||
stride_ = stride;
|
||||
block_size_ = block_size;
|
||||
num_planes_ = num_planes;
|
||||
for (int p = 0; p < num_planes; p++)
|
||||
data_ptr_[p] = data + stride * (block_size + 1) * p +
|
||||
stride + block_size;
|
||||
}
|
||||
|
||||
void FillRandom() {
|
||||
// Fill edges with random data
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
for (int p = 0; p < num_planes_; p++) {
|
||||
for (int x = -1 ; x <= block_size_; x++)
|
||||
data_ptr_[p][x - stride_] = rnd.Rand8();
|
||||
for (int y = 0; y < block_size_; y++)
|
||||
data_ptr_[p][y * stride_ - 1] = rnd.Rand8();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Predict(MB_PREDICTION_MODE mode) = 0;
|
||||
|
||||
void SetLeftUnavailable() {
|
||||
mbptr_->left_available = 0;
|
||||
for (int p = 0; p < num_planes_; p++)
|
||||
for (int i = -1; i < block_size_; ++i)
|
||||
data_ptr_[p][stride_ * i - 1] = 129;
|
||||
}
|
||||
|
||||
void SetTopUnavailable() {
|
||||
mbptr_->up_available = 0;
|
||||
for (int p = 0; p < num_planes_; p++)
|
||||
memset(&data_ptr_[p][-1 - stride_], 127, block_size_ + 2);
|
||||
}
|
||||
|
||||
void SetTopLeftUnavailable() {
|
||||
SetLeftUnavailable();
|
||||
SetTopUnavailable();
|
||||
}
|
||||
|
||||
int BlockSizeLog2Min1() const {
|
||||
switch (block_size_) {
|
||||
case 16:
|
||||
return 3;
|
||||
case 8:
|
||||
return 2;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// check DC prediction output against a reference
|
||||
void CheckDCPrediction() const {
|
||||
for (int p = 0; p < num_planes_; p++) {
|
||||
// calculate expected DC
|
||||
int expected;
|
||||
if (mbptr_->up_available || mbptr_->left_available) {
|
||||
int sum = 0, shift = BlockSizeLog2Min1() + mbptr_->up_available +
|
||||
mbptr_->left_available;
|
||||
if (mbptr_->up_available)
|
||||
for (int x = 0; x < block_size_; x++)
|
||||
sum += data_ptr_[p][x - stride_];
|
||||
if (mbptr_->left_available)
|
||||
for (int y = 0; y < block_size_; y++)
|
||||
sum += data_ptr_[p][y * stride_ - 1];
|
||||
expected = (sum + (1 << (shift - 1))) >> shift;
|
||||
} else {
|
||||
expected = 0x80;
|
||||
}
|
||||
// check that all subsequent lines are equal to the first
|
||||
for (int y = 1; y < block_size_; ++y)
|
||||
ASSERT_EQ(0, memcmp(data_ptr_[p], &data_ptr_[p][y * stride_],
|
||||
block_size_));
|
||||
// within the first line, ensure that each pixel has the same value
|
||||
for (int x = 1; x < block_size_; ++x)
|
||||
ASSERT_EQ(data_ptr_[p][0], data_ptr_[p][x]);
|
||||
// now ensure that that pixel has the expected (DC) value
|
||||
ASSERT_EQ(expected, data_ptr_[p][0]);
|
||||
}
|
||||
}
|
||||
|
||||
// check V prediction output against a reference
|
||||
void CheckVPrediction() const {
|
||||
// check that all lines equal the top border
|
||||
for (int p = 0; p < num_planes_; p++)
|
||||
for (int y = 0; y < block_size_; y++)
|
||||
ASSERT_EQ(0, memcmp(&data_ptr_[p][-stride_],
|
||||
&data_ptr_[p][y * stride_], block_size_));
|
||||
}
|
||||
|
||||
// check H prediction output against a reference
|
||||
void CheckHPrediction() const {
|
||||
// for each line, ensure that each pixel is equal to the left border
|
||||
for (int p = 0; p < num_planes_; p++)
|
||||
for (int y = 0; y < block_size_; y++)
|
||||
for (int x = 0; x < block_size_; x++)
|
||||
ASSERT_EQ(data_ptr_[p][-1 + y * stride_],
|
||||
data_ptr_[p][x + y * stride_]);
|
||||
}
|
||||
|
||||
static int ClipByte(int value) {
|
||||
if (value > 255)
|
||||
return 255;
|
||||
else if (value < 0)
|
||||
return 0;
|
||||
return value;
|
||||
}
|
||||
|
||||
// check TM prediction output against a reference
|
||||
void CheckTMPrediction() const {
|
||||
for (int p = 0; p < num_planes_; p++)
|
||||
for (int y = 0; y < block_size_; y++)
|
||||
for (int x = 0; x < block_size_; x++) {
|
||||
const int expected = ClipByte(data_ptr_[p][x - stride_]
|
||||
+ data_ptr_[p][stride_ * y - 1]
|
||||
- data_ptr_[p][-1 - stride_]);
|
||||
ASSERT_EQ(expected, data_ptr_[p][y * stride_ + x]);
|
||||
}
|
||||
}
|
||||
|
||||
// Actual test
|
||||
void RunTest() {
|
||||
{
|
||||
SCOPED_TRACE("DC_PRED");
|
||||
FillRandom();
|
||||
Predict(DC_PRED);
|
||||
CheckDCPrediction();
|
||||
}
|
||||
{
|
||||
SCOPED_TRACE("DC_PRED LEFT");
|
||||
FillRandom();
|
||||
SetLeftUnavailable();
|
||||
Predict(DC_PRED);
|
||||
CheckDCPrediction();
|
||||
}
|
||||
{
|
||||
SCOPED_TRACE("DC_PRED TOP");
|
||||
FillRandom();
|
||||
SetTopUnavailable();
|
||||
Predict(DC_PRED);
|
||||
CheckDCPrediction();
|
||||
}
|
||||
{
|
||||
SCOPED_TRACE("DC_PRED TOP_LEFT");
|
||||
FillRandom();
|
||||
SetTopLeftUnavailable();
|
||||
Predict(DC_PRED);
|
||||
CheckDCPrediction();
|
||||
}
|
||||
{
|
||||
SCOPED_TRACE("H_PRED");
|
||||
FillRandom();
|
||||
Predict(H_PRED);
|
||||
CheckHPrediction();
|
||||
}
|
||||
{
|
||||
SCOPED_TRACE("V_PRED");
|
||||
FillRandom();
|
||||
Predict(V_PRED);
|
||||
CheckVPrediction();
|
||||
}
|
||||
{
|
||||
SCOPED_TRACE("TM_PRED");
|
||||
FillRandom();
|
||||
Predict(TM_PRED);
|
||||
CheckTMPrediction();
|
||||
}
|
||||
}
|
||||
|
||||
MACROBLOCKD *mbptr_;
|
||||
MODE_INFO *miptr_;
|
||||
uint8_t *data_ptr_[2]; // in the case of Y, only [0] is used
|
||||
int stride_;
|
||||
int block_size_;
|
||||
int num_planes_;
|
||||
};
|
||||
|
||||
typedef void (*IntraPredYFunc)(MACROBLOCKD *x,
|
||||
uint8_t *yabove_row,
|
||||
uint8_t *yleft,
|
||||
int left_stride,
|
||||
uint8_t *ypred_ptr,
|
||||
int y_stride);
|
||||
|
||||
class IntraPredYTest
|
||||
: public IntraPredBase,
|
||||
public ::testing::TestWithParam<IntraPredYFunc> {
|
||||
public:
|
||||
static void SetUpTestCase() {
|
||||
mb_ = reinterpret_cast<MACROBLOCKD*>(
|
||||
vpx_memalign(32, sizeof(MACROBLOCKD)));
|
||||
mi_ = reinterpret_cast<MODE_INFO*>(
|
||||
vpx_memalign(32, sizeof(MODE_INFO)));
|
||||
data_array_ = reinterpret_cast<uint8_t*>(
|
||||
vpx_memalign(kDataAlignment, kDataBufferSize));
|
||||
}
|
||||
|
||||
static void TearDownTestCase() {
|
||||
vpx_free(data_array_);
|
||||
vpx_free(mi_);
|
||||
vpx_free(mb_);
|
||||
data_array_ = NULL;
|
||||
}
|
||||
|
||||
protected:
|
||||
static const int kBlockSize = 16;
|
||||
static const int kDataAlignment = 16;
|
||||
static const int kStride = kBlockSize * 3;
|
||||
// We use 48 so that the data pointer of the first pixel in each row of
|
||||
// each macroblock is 16-byte aligned, and this gives us access to the
|
||||
// top-left and top-right corner pixels belonging to the top-left/right
|
||||
// macroblocks.
|
||||
// We use 17 lines so we have one line above us for top-prediction.
|
||||
static const int kDataBufferSize = kStride * (kBlockSize + 1);
|
||||
|
||||
virtual void SetUp() {
|
||||
pred_fn_ = GetParam();
|
||||
SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 1);
|
||||
}
|
||||
|
||||
virtual void Predict(MB_PREDICTION_MODE mode) {
|
||||
mbptr_->mode_info_context->mbmi.mode = mode;
|
||||
ASM_REGISTER_STATE_CHECK(pred_fn_(mbptr_,
|
||||
data_ptr_[0] - kStride,
|
||||
data_ptr_[0] - 1, kStride,
|
||||
data_ptr_[0], kStride));
|
||||
}
|
||||
|
||||
IntraPredYFunc pred_fn_;
|
||||
static uint8_t* data_array_;
|
||||
static MACROBLOCKD * mb_;
|
||||
static MODE_INFO *mi_;
|
||||
};
|
||||
|
||||
MACROBLOCKD* IntraPredYTest::mb_ = NULL;
|
||||
MODE_INFO* IntraPredYTest::mi_ = NULL;
|
||||
uint8_t* IntraPredYTest::data_array_ = NULL;
|
||||
|
||||
TEST_P(IntraPredYTest, IntraPredTests) {
|
||||
RunTest();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(C, IntraPredYTest,
|
||||
::testing::Values(
|
||||
vp8_build_intra_predictors_mby_s_c));
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, IntraPredYTest,
|
||||
::testing::Values(
|
||||
vp8_build_intra_predictors_mby_s_sse2));
|
||||
#endif
|
||||
#if HAVE_SSSE3
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredYTest,
|
||||
::testing::Values(
|
||||
vp8_build_intra_predictors_mby_s_ssse3));
|
||||
#endif
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(NEON, IntraPredYTest,
|
||||
::testing::Values(
|
||||
vp8_build_intra_predictors_mby_s_neon));
|
||||
#endif
|
||||
|
||||
typedef void (*IntraPredUvFunc)(MACROBLOCKD *x,
|
||||
uint8_t *uabove_row,
|
||||
uint8_t *vabove_row,
|
||||
uint8_t *uleft,
|
||||
uint8_t *vleft,
|
||||
int left_stride,
|
||||
uint8_t *upred_ptr,
|
||||
uint8_t *vpred_ptr,
|
||||
int pred_stride);
|
||||
|
||||
class IntraPredUVTest
|
||||
: public IntraPredBase,
|
||||
public ::testing::TestWithParam<IntraPredUvFunc> {
|
||||
public:
|
||||
static void SetUpTestCase() {
|
||||
mb_ = reinterpret_cast<MACROBLOCKD*>(
|
||||
vpx_memalign(32, sizeof(MACROBLOCKD)));
|
||||
mi_ = reinterpret_cast<MODE_INFO*>(
|
||||
vpx_memalign(32, sizeof(MODE_INFO)));
|
||||
data_array_ = reinterpret_cast<uint8_t*>(
|
||||
vpx_memalign(kDataAlignment, kDataBufferSize));
|
||||
}
|
||||
|
||||
static void TearDownTestCase() {
|
||||
vpx_free(data_array_);
|
||||
vpx_free(mi_);
|
||||
vpx_free(mb_);
|
||||
data_array_ = NULL;
|
||||
}
|
||||
|
||||
protected:
|
||||
static const int kBlockSize = 8;
|
||||
static const int kDataAlignment = 8;
|
||||
static const int kStride = kBlockSize * 3;
|
||||
// We use 24 so that the data pointer of the first pixel in each row of
|
||||
// each macroblock is 8-byte aligned, and this gives us access to the
|
||||
// top-left and top-right corner pixels belonging to the top-left/right
|
||||
// macroblocks.
|
||||
// We use 9 lines so we have one line above us for top-prediction.
|
||||
// [0] = U, [1] = V
|
||||
static const int kDataBufferSize = 2 * kStride * (kBlockSize + 1);
|
||||
|
||||
virtual void SetUp() {
|
||||
pred_fn_ = GetParam();
|
||||
SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 2);
|
||||
}
|
||||
|
||||
virtual void Predict(MB_PREDICTION_MODE mode) {
|
||||
mbptr_->mode_info_context->mbmi.uv_mode = mode;
|
||||
pred_fn_(mbptr_, data_ptr_[0] - kStride, data_ptr_[1] - kStride,
|
||||
data_ptr_[0] - 1, data_ptr_[1] - 1, kStride,
|
||||
data_ptr_[0], data_ptr_[1], kStride);
|
||||
}
|
||||
|
||||
IntraPredUvFunc pred_fn_;
|
||||
// We use 24 so that the data pointer of the first pixel in each row of
|
||||
// each macroblock is 8-byte aligned, and this gives us access to the
|
||||
// top-left and top-right corner pixels belonging to the top-left/right
|
||||
// macroblocks.
|
||||
// We use 9 lines so we have one line above us for top-prediction.
|
||||
// [0] = U, [1] = V
|
||||
static uint8_t* data_array_;
|
||||
static MACROBLOCKD* mb_;
|
||||
static MODE_INFO* mi_;
|
||||
};
|
||||
|
||||
MACROBLOCKD* IntraPredUVTest::mb_ = NULL;
|
||||
MODE_INFO* IntraPredUVTest::mi_ = NULL;
|
||||
uint8_t* IntraPredUVTest::data_array_ = NULL;
|
||||
|
||||
TEST_P(IntraPredUVTest, IntraPredTests) {
|
||||
RunTest();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(C, IntraPredUVTest,
|
||||
::testing::Values(
|
||||
vp8_build_intra_predictors_mbuv_s_c));
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, IntraPredUVTest,
|
||||
::testing::Values(
|
||||
vp8_build_intra_predictors_mbuv_s_sse2));
|
||||
#endif
|
||||
#if HAVE_SSSE3
|
||||
INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredUVTest,
|
||||
::testing::Values(
|
||||
vp8_build_intra_predictors_mbuv_s_ssse3));
|
||||
#endif
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(NEON, IntraPredUVTest,
|
||||
::testing::Values(
|
||||
vp8_build_intra_predictors_mbuv_s_neon));
|
||||
#endif
|
||||
|
||||
} // namespace
|
@@ -63,22 +63,9 @@ class InvalidFileTest
|
||||
EXPECT_NE(res, EOF) << "Read result data failed";
|
||||
|
||||
// Check results match.
|
||||
const DecodeParam input = GET_PARAM(1);
|
||||
if (input.threads > 1) {
|
||||
// The serial decode check is too strict for tile-threaded decoding as
|
||||
// there is no guarantee on the decode order nor which specific error
|
||||
// will take precedence. Currently a tile-level error is not forwarded so
|
||||
// the frame will simply be marked corrupt.
|
||||
EXPECT_TRUE(res_dec == expected_res_dec ||
|
||||
res_dec == VPX_CODEC_CORRUPT_FRAME)
|
||||
<< "Results don't match: frame number = " << video.frame_number()
|
||||
<< ". (" << decoder->DecodeError() << "). Expected: "
|
||||
<< expected_res_dec << " or " << VPX_CODEC_CORRUPT_FRAME;
|
||||
} else {
|
||||
EXPECT_EQ(expected_res_dec, res_dec)
|
||||
<< "Results don't match: frame number = " << video.frame_number()
|
||||
<< ". (" << decoder->DecodeError() << ")";
|
||||
}
|
||||
EXPECT_EQ(expected_res_dec, res_dec)
|
||||
<< "Results don't match: frame number = " << video.frame_number()
|
||||
<< ". (" << decoder->DecodeError() << ")";
|
||||
|
||||
return !HasFailure();
|
||||
}
|
||||
@@ -125,9 +112,7 @@ TEST_P(InvalidFileTest, ReturnCode) {
|
||||
|
||||
const DecodeParam kVP9InvalidFileTests[] = {
|
||||
{1, "invalid-vp90-02-v2.webm"},
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
{1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf"},
|
||||
#endif
|
||||
{1, "invalid-vp90-03-v3.webm"},
|
||||
{1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"},
|
||||
{1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"},
|
||||
@@ -158,7 +143,7 @@ TEST_P(InvalidFileInvalidPeekTest, ReturnCode) {
|
||||
}
|
||||
|
||||
const DecodeParam kVP9InvalidFileInvalidPeekTests[] = {
|
||||
{1, "invalid-vp90-01-v3.webm"},
|
||||
{1, "invalid-vp90-01-v2.webm"},
|
||||
};
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest,
|
||||
|
@@ -13,13 +13,13 @@
|
||||
#include <string>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_entropy.h"
|
||||
#include "vp9/common/vp9_loopfilter.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
@@ -37,23 +37,120 @@ const int number_of_iterations = 10000;
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
typedef void (*loop_op_t)(uint16_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int bd);
|
||||
int count, int bd);
|
||||
typedef void (*dual_loop_op_t)(uint16_t *s, int p, const uint8_t *blimit0,
|
||||
const uint8_t *limit0, const uint8_t *thresh0,
|
||||
const uint8_t *blimit1, const uint8_t *limit1,
|
||||
const uint8_t *thresh1, int bd);
|
||||
#else
|
||||
typedef void (*loop_op_t)(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh);
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count);
|
||||
typedef void (*dual_loop_op_t)(uint8_t *s, int p, const uint8_t *blimit0,
|
||||
const uint8_t *limit0, const uint8_t *thresh0,
|
||||
const uint8_t *blimit1, const uint8_t *limit1,
|
||||
const uint8_t *thresh1);
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
typedef std::tr1::tuple<loop_op_t, loop_op_t, int> loop8_param_t;
|
||||
typedef std::tr1::tuple<loop_op_t, loop_op_t, int, int> loop8_param_t;
|
||||
typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
void wrapper_vertical_16_sse2(uint16_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count, int bd) {
|
||||
vp9_highbd_lpf_vertical_16_sse2(s, p, blimit, limit, thresh, bd);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_c(uint16_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count, int bd) {
|
||||
vp9_highbd_lpf_vertical_16_c(s, p, blimit, limit, thresh, bd);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_dual_sse2(uint16_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count, int bd) {
|
||||
vp9_highbd_lpf_vertical_16_dual_sse2(s, p, blimit, limit, thresh, bd);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_dual_c(uint16_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count, int bd) {
|
||||
vp9_highbd_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh, bd);
|
||||
}
|
||||
#else
|
||||
void wrapper_vertical_16_sse2(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_sse2(s, p, blimit, limit, thresh);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_c(s, p, blimit, limit, thresh);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_dual_sse2(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_dual_sse2(s, p, blimit, limit, thresh);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_NEON_ASM
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
// No neon high bitdepth functions.
|
||||
#else
|
||||
void wrapper_vertical_16_neon(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_neon(s, p, blimit, limit, thresh);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_c(s, p, blimit, limit, thresh);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_dual_neon(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_dual_neon(s, p, blimit, limit, thresh);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh);
|
||||
}
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // HAVE_NEON_ASM
|
||||
|
||||
#if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
void wrapper_vertical_16_msa(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_msa(s, p, blimit, limit, thresh);
|
||||
}
|
||||
|
||||
void wrapper_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
|
||||
const uint8_t *limit, const uint8_t *thresh,
|
||||
int count) {
|
||||
vp9_lpf_vertical_16_c(s, p, blimit, limit, thresh);
|
||||
}
|
||||
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
|
||||
class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
|
||||
public:
|
||||
virtual ~Loop8Test6Param() {}
|
||||
@@ -61,6 +158,7 @@ class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
|
||||
loopfilter_op_ = GET_PARAM(0);
|
||||
ref_loopfilter_op_ = GET_PARAM(1);
|
||||
bit_depth_ = GET_PARAM(2);
|
||||
count_ = GET_PARAM(3);
|
||||
mask_ = (1 << bit_depth_) - 1;
|
||||
}
|
||||
|
||||
@@ -68,6 +166,7 @@ class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
|
||||
|
||||
protected:
|
||||
int bit_depth_;
|
||||
int count_;
|
||||
int mask_;
|
||||
loop_op_t loopfilter_op_;
|
||||
loop_op_t ref_loopfilter_op_;
|
||||
@@ -154,13 +253,13 @@ TEST_P(Loop8Test6Param, OperationCheck) {
|
||||
ref_s[j] = s[j];
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bd);
|
||||
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, count_, bd);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd));
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_, bd));
|
||||
#else
|
||||
ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh);
|
||||
ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh, count_);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
@@ -226,13 +325,13 @@ TEST_P(Loop8Test6Param, ValueCheck) {
|
||||
ref_s[j] = s[j];
|
||||
}
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, bd);
|
||||
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, count_, bd);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, bd));
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_, bd));
|
||||
#else
|
||||
ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh);
|
||||
ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh, count_);
|
||||
ASM_REGISTER_STATE_CHECK(
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
|
||||
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||
err_count += ref_s[j] != s[j];
|
||||
@@ -430,85 +529,68 @@ TEST_P(Loop8Test9Param, ValueCheck) {
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_MMX && CONFIG_USE_X86INC && !CONFIG_VP9_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MMX, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_lpf_horizontal_4_mmx,
|
||||
&vpx_lpf_horizontal_4_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_mmx,
|
||||
&vpx_lpf_vertical_4_c, 8)));
|
||||
#endif // HAVE_MMX
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
|
||||
&vpx_highbd_lpf_horizontal_4_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
|
||||
&vpx_highbd_lpf_vertical_4_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
|
||||
&vpx_highbd_lpf_horizontal_8_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
|
||||
&vpx_highbd_lpf_horizontal_edge_8_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
|
||||
&vpx_highbd_lpf_horizontal_edge_16_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
|
||||
&vpx_highbd_lpf_vertical_8_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
|
||||
&vpx_highbd_lpf_vertical_16_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
|
||||
&vpx_highbd_lpf_horizontal_4_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
|
||||
&vpx_highbd_lpf_vertical_4_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
|
||||
&vpx_highbd_lpf_horizontal_8_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
|
||||
&vpx_highbd_lpf_horizontal_edge_8_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
|
||||
&vpx_highbd_lpf_horizontal_edge_16_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
|
||||
&vpx_highbd_lpf_vertical_8_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
|
||||
&vpx_highbd_lpf_vertical_16_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
|
||||
&vpx_highbd_lpf_horizontal_4_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
|
||||
&vpx_highbd_lpf_vertical_4_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
|
||||
&vpx_highbd_lpf_horizontal_8_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_edge_8_sse2,
|
||||
&vpx_highbd_lpf_horizontal_edge_8_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_edge_16_sse2,
|
||||
&vpx_highbd_lpf_horizontal_edge_16_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
|
||||
&vpx_highbd_lpf_vertical_8_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_16_sse2,
|
||||
&vpx_highbd_lpf_vertical_16_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_16_dual_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_16_dual_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_16_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_16_dual_c, 12)));
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_4_sse2,
|
||||
&vp9_highbd_lpf_horizontal_4_c, 8, 1),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_4_sse2,
|
||||
&vp9_highbd_lpf_vertical_4_c, 8, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_8_sse2,
|
||||
&vp9_highbd_lpf_horizontal_8_c, 8, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||
&vp9_highbd_lpf_horizontal_16_c, 8, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||
&vp9_highbd_lpf_horizontal_16_c, 8, 2),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
|
||||
&vp9_highbd_lpf_vertical_8_c, 8, 1),
|
||||
make_tuple(&wrapper_vertical_16_sse2,
|
||||
&wrapper_vertical_16_c, 8, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_4_sse2,
|
||||
&vp9_highbd_lpf_horizontal_4_c, 10, 1),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_4_sse2,
|
||||
&vp9_highbd_lpf_vertical_4_c, 10, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_8_sse2,
|
||||
&vp9_highbd_lpf_horizontal_8_c, 10, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||
&vp9_highbd_lpf_horizontal_16_c, 10, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||
&vp9_highbd_lpf_horizontal_16_c, 10, 2),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
|
||||
&vp9_highbd_lpf_vertical_8_c, 10, 1),
|
||||
make_tuple(&wrapper_vertical_16_sse2,
|
||||
&wrapper_vertical_16_c, 10, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_4_sse2,
|
||||
&vp9_highbd_lpf_horizontal_4_c, 12, 1),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_4_sse2,
|
||||
&vp9_highbd_lpf_vertical_4_c, 12, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_8_sse2,
|
||||
&vp9_highbd_lpf_horizontal_8_c, 12, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||
&vp9_highbd_lpf_horizontal_16_c, 12, 1),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||
&vp9_highbd_lpf_horizontal_16_c, 12, 2),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
|
||||
&vp9_highbd_lpf_vertical_8_c, 12, 1),
|
||||
make_tuple(&wrapper_vertical_16_sse2,
|
||||
&wrapper_vertical_16_c, 12, 1),
|
||||
make_tuple(&wrapper_vertical_16_dual_sse2,
|
||||
&wrapper_vertical_16_dual_c, 8, 1),
|
||||
make_tuple(&wrapper_vertical_16_dual_sse2,
|
||||
&wrapper_vertical_16_dual_c, 10, 1),
|
||||
make_tuple(&wrapper_vertical_16_dual_sse2,
|
||||
&wrapper_vertical_16_dual_c, 12, 1)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_lpf_horizontal_8_sse2,
|
||||
&vpx_lpf_horizontal_8_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_edge_8_sse2,
|
||||
&vpx_lpf_horizontal_edge_8_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_edge_16_sse2,
|
||||
&vpx_lpf_horizontal_edge_16_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_sse2,
|
||||
&vpx_lpf_vertical_8_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_16_sse2,
|
||||
&vpx_lpf_vertical_16_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_16_dual_sse2,
|
||||
&vpx_lpf_vertical_16_dual_c, 8)));
|
||||
make_tuple(&vp9_lpf_horizontal_8_sse2, &vp9_lpf_horizontal_8_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_horizontal_16_sse2, &vp9_lpf_horizontal_16_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_horizontal_16_sse2, &vp9_lpf_horizontal_16_c, 8, 2),
|
||||
make_tuple(&vp9_lpf_vertical_8_sse2, &vp9_lpf_vertical_8_c, 8, 1),
|
||||
make_tuple(&wrapper_vertical_16_sse2, &wrapper_vertical_16_c, 8, 1)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif
|
||||
|
||||
@@ -516,10 +598,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX2, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_lpf_horizontal_edge_8_avx2,
|
||||
&vpx_lpf_horizontal_edge_8_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_edge_16_avx2,
|
||||
&vpx_lpf_horizontal_edge_16_c, 8)));
|
||||
make_tuple(&vp9_lpf_horizontal_16_avx2, &vp9_lpf_horizontal_16_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_horizontal_16_avx2, &vp9_lpf_horizontal_16_c, 8,
|
||||
2)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2
|
||||
@@ -527,42 +608,42 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Loop8Test9Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
|
||||
&vpx_highbd_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
|
||||
&vpx_highbd_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_8_dual_c, 8),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
|
||||
&vpx_highbd_lpf_horizontal_4_dual_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
|
||||
&vpx_highbd_lpf_horizontal_8_dual_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_4_dual_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_8_dual_c, 10),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
|
||||
&vpx_highbd_lpf_horizontal_4_dual_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
|
||||
&vpx_highbd_lpf_horizontal_8_dual_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_4_dual_c, 12),
|
||||
make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
|
||||
&vpx_highbd_lpf_vertical_8_dual_c, 12)));
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_4_dual_sse2,
|
||||
&vp9_highbd_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_8_dual_sse2,
|
||||
&vp9_highbd_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_4_dual_sse2,
|
||||
&vp9_highbd_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_8_dual_sse2,
|
||||
&vp9_highbd_lpf_vertical_8_dual_c, 8),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_4_dual_sse2,
|
||||
&vp9_highbd_lpf_horizontal_4_dual_c, 10),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_8_dual_sse2,
|
||||
&vp9_highbd_lpf_horizontal_8_dual_c, 10),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_4_dual_sse2,
|
||||
&vp9_highbd_lpf_vertical_4_dual_c, 10),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_8_dual_sse2,
|
||||
&vp9_highbd_lpf_vertical_8_dual_c, 10),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_4_dual_sse2,
|
||||
&vp9_highbd_lpf_horizontal_4_dual_c, 12),
|
||||
make_tuple(&vp9_highbd_lpf_horizontal_8_dual_sse2,
|
||||
&vp9_highbd_lpf_horizontal_8_dual_c, 12),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_4_dual_sse2,
|
||||
&vp9_highbd_lpf_vertical_4_dual_c, 12),
|
||||
make_tuple(&vp9_highbd_lpf_vertical_8_dual_sse2,
|
||||
&vp9_highbd_lpf_vertical_8_dual_c, 12)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, Loop8Test9Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_lpf_horizontal_4_dual_sse2,
|
||||
&vpx_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_8_dual_sse2,
|
||||
&vpx_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_dual_sse2,
|
||||
&vpx_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_dual_sse2,
|
||||
&vpx_lpf_vertical_8_dual_c, 8)));
|
||||
make_tuple(&vp9_lpf_horizontal_4_dual_sse2,
|
||||
&vp9_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_horizontal_8_dual_sse2,
|
||||
&vp9_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_vertical_4_dual_sse2,
|
||||
&vp9_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_vertical_8_dual_sse2,
|
||||
&vp9_lpf_vertical_8_dual_c, 8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif
|
||||
|
||||
@@ -576,103 +657,60 @@ INSTANTIATE_TEST_CASE_P(
|
||||
#if HAVE_NEON_ASM
|
||||
// Using #if inside the macro is unsupported on MSVS but the tests are not
|
||||
// currently built for MSVS with ARM and NEON.
|
||||
make_tuple(&vpx_lpf_horizontal_edge_8_neon,
|
||||
&vpx_lpf_horizontal_edge_8_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_edge_16_neon,
|
||||
&vpx_lpf_horizontal_edge_16_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_16_neon,
|
||||
&vpx_lpf_vertical_16_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_16_dual_neon,
|
||||
&vpx_lpf_vertical_16_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_horizontal_16_neon,
|
||||
&vp9_lpf_horizontal_16_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_horizontal_16_neon,
|
||||
&vp9_lpf_horizontal_16_c, 8, 2),
|
||||
make_tuple(&wrapper_vertical_16_neon,
|
||||
&wrapper_vertical_16_c, 8, 1),
|
||||
make_tuple(&wrapper_vertical_16_dual_neon,
|
||||
&wrapper_vertical_16_dual_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_horizontal_8_neon,
|
||||
&vp9_lpf_horizontal_8_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_vertical_8_neon,
|
||||
&vp9_lpf_vertical_8_c, 8, 1),
|
||||
#endif // HAVE_NEON_ASM
|
||||
make_tuple(&vpx_lpf_horizontal_8_neon,
|
||||
&vpx_lpf_horizontal_8_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_neon,
|
||||
&vpx_lpf_vertical_8_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_4_neon,
|
||||
&vpx_lpf_horizontal_4_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_neon,
|
||||
&vpx_lpf_vertical_4_c, 8)));
|
||||
make_tuple(&vp9_lpf_horizontal_4_neon,
|
||||
&vp9_lpf_horizontal_4_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_vertical_4_neon,
|
||||
&vp9_lpf_vertical_4_c, 8, 1)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, Loop8Test9Param,
|
||||
::testing::Values(
|
||||
#if HAVE_NEON_ASM
|
||||
make_tuple(&vpx_lpf_horizontal_8_dual_neon,
|
||||
&vpx_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_dual_neon,
|
||||
&vpx_lpf_vertical_8_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_horizontal_8_dual_neon,
|
||||
&vp9_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_vertical_8_dual_neon,
|
||||
&vp9_lpf_vertical_8_dual_c, 8),
|
||||
#endif // HAVE_NEON_ASM
|
||||
make_tuple(&vpx_lpf_horizontal_4_dual_neon,
|
||||
&vpx_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_dual_neon,
|
||||
&vpx_lpf_vertical_4_dual_c, 8)));
|
||||
make_tuple(&vp9_lpf_horizontal_4_dual_neon,
|
||||
&vp9_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_vertical_4_dual_neon,
|
||||
&vp9_lpf_vertical_4_dual_c, 8)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // HAVE_NEON
|
||||
|
||||
#if HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
DSPR2, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_lpf_horizontal_4_dspr2,
|
||||
&vpx_lpf_horizontal_4_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_8_dspr2,
|
||||
&vpx_lpf_horizontal_8_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_edge_8,
|
||||
&vpx_lpf_horizontal_edge_8, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_edge_16,
|
||||
&vpx_lpf_horizontal_edge_16, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_dspr2,
|
||||
&vpx_lpf_vertical_4_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_dspr2,
|
||||
&vpx_lpf_vertical_8_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_16_dspr2,
|
||||
&vpx_lpf_vertical_16_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_16_dual_dspr2,
|
||||
&vpx_lpf_vertical_16_dual_c, 8)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
DSPR2, Loop8Test9Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_lpf_horizontal_4_dual_dspr2,
|
||||
&vpx_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_8_dual_dspr2,
|
||||
&vpx_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_dual_dspr2,
|
||||
&vpx_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_dual_dspr2,
|
||||
&vpx_lpf_vertical_8_dual_c, 8)));
|
||||
#endif // HAVE_DSPR2 && !CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
#if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Loop8Test6Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_lpf_horizontal_4_msa,
|
||||
&vpx_lpf_horizontal_4_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_8_msa,
|
||||
&vpx_lpf_horizontal_8_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_edge_8_msa,
|
||||
&vpx_lpf_horizontal_edge_8_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_edge_16_msa,
|
||||
&vpx_lpf_horizontal_edge_16_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_msa,
|
||||
&vpx_lpf_vertical_4_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_msa,
|
||||
&vpx_lpf_vertical_8_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_16_msa,
|
||||
&vpx_lpf_vertical_16_c, 8)));
|
||||
make_tuple(&vp9_lpf_horizontal_8_msa, &vp9_lpf_horizontal_8_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_horizontal_16_msa, &vp9_lpf_horizontal_16_c, 8, 1),
|
||||
make_tuple(&vp9_lpf_horizontal_16_msa, &vp9_lpf_horizontal_16_c, 8, 2),
|
||||
make_tuple(&vp9_lpf_vertical_8_msa, &vp9_lpf_vertical_8_c, 8, 1),
|
||||
make_tuple(&wrapper_vertical_16_msa, &wrapper_vertical_16_c, 8, 1)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, Loop8Test9Param,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_lpf_horizontal_4_dual_msa,
|
||||
&vpx_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_horizontal_8_dual_msa,
|
||||
&vpx_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_4_dual_msa,
|
||||
&vpx_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vpx_lpf_vertical_8_dual_msa,
|
||||
&vpx_lpf_vertical_8_dual_c, 8)));
|
||||
make_tuple(&vp9_lpf_horizontal_4_dual_msa,
|
||||
&vp9_lpf_horizontal_4_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_horizontal_8_dual_msa,
|
||||
&vp9_lpf_horizontal_8_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_vertical_4_dual_msa,
|
||||
&vp9_lpf_vertical_4_dual_c, 8),
|
||||
make_tuple(&vp9_lpf_vertical_8_dual_msa,
|
||||
&vp9_lpf_vertical_8_dual_c, 8)));
|
||||
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||
|
||||
} // namespace
|
||||
|
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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 <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
|
||||
#include "test/acm_random.h"
|
||||
#include "test/register_state_check.h"
|
||||
|
||||
namespace {
|
||||
|
||||
using ::libvpx_test::ACMRandom;
|
||||
|
||||
typedef void (*MinMaxFunc)(const uint8_t *a, int a_stride,
|
||||
const uint8_t *b, int b_stride,
|
||||
int *min, int *max);
|
||||
|
||||
class MinMaxTest : public ::testing::TestWithParam<MinMaxFunc> {
|
||||
public:
|
||||
virtual void SetUp() {
|
||||
mm_func_ = GetParam();
|
||||
rnd_.Reset(ACMRandom::DeterministicSeed());
|
||||
}
|
||||
|
||||
protected:
|
||||
MinMaxFunc mm_func_;
|
||||
ACMRandom rnd_;
|
||||
};
|
||||
|
||||
void reference_minmax(const uint8_t *a, int a_stride,
|
||||
const uint8_t *b, int b_stride,
|
||||
int *min_ret, int *max_ret) {
|
||||
int min = 255;
|
||||
int max = 0;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int j = 0; j < 8; j++) {
|
||||
const int diff = abs(a[i * a_stride + j] - b[i * b_stride + j]);
|
||||
if (min > diff) min = diff;
|
||||
if (max < diff) max = diff;
|
||||
}
|
||||
}
|
||||
|
||||
*min_ret = min;
|
||||
*max_ret = max;
|
||||
}
|
||||
|
||||
TEST_P(MinMaxTest, MinValue) {
|
||||
for (int i = 0; i < 64; i++) {
|
||||
uint8_t a[64], b[64];
|
||||
memset(a, 0, sizeof(a));
|
||||
memset(b, 255, sizeof(b));
|
||||
b[i] = i; // Set a minimum difference of i.
|
||||
|
||||
int min, max;
|
||||
ASM_REGISTER_STATE_CHECK(mm_func_(a, 8, b, 8, &min, &max));
|
||||
EXPECT_EQ(255, max);
|
||||
EXPECT_EQ(i, min);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(MinMaxTest, MaxValue) {
|
||||
for (int i = 0; i < 64; i++) {
|
||||
uint8_t a[64], b[64];
|
||||
memset(a, 0, sizeof(a));
|
||||
memset(b, 0, sizeof(b));
|
||||
b[i] = i; // Set a maximum difference of i.
|
||||
|
||||
int min, max;
|
||||
ASM_REGISTER_STATE_CHECK(mm_func_(a, 8, b, 8, &min, &max));
|
||||
EXPECT_EQ(i, max);
|
||||
EXPECT_EQ(0, min);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(MinMaxTest, CompareReference) {
|
||||
uint8_t a[64], b[64];
|
||||
for (int j = 0; j < 64; j++) {
|
||||
a[j] = rnd_.Rand8();
|
||||
b[j] = rnd_.Rand8();
|
||||
}
|
||||
|
||||
int min_ref, max_ref, min, max;
|
||||
reference_minmax(a, 8, b, 8, &min_ref, &max_ref);
|
||||
ASM_REGISTER_STATE_CHECK(mm_func_(a, 8, b, 8, &min, &max));
|
||||
EXPECT_EQ(max_ref, max);
|
||||
EXPECT_EQ(min_ref, min);
|
||||
}
|
||||
|
||||
TEST_P(MinMaxTest, CompareReferenceAndVaryStride) {
|
||||
uint8_t a[8 * 64], b[8 * 64];
|
||||
for (int i = 0; i < 8 * 64; i++) {
|
||||
a[i] = rnd_.Rand8();
|
||||
b[i] = rnd_.Rand8();
|
||||
}
|
||||
for (int a_stride = 8; a_stride <= 64; a_stride += 8) {
|
||||
for (int b_stride = 8; b_stride <= 64; b_stride += 8) {
|
||||
int min_ref, max_ref, min, max;
|
||||
reference_minmax(a, a_stride, b, b_stride, &min_ref, &max_ref);
|
||||
ASM_REGISTER_STATE_CHECK(mm_func_(a, a_stride, b, b_stride, &min, &max));
|
||||
EXPECT_EQ(max_ref, max) << "when a_stride = " << a_stride
|
||||
<< " and b_stride = " << b_stride;;
|
||||
EXPECT_EQ(min_ref, min) << "when a_stride = " << a_stride
|
||||
<< " and b_stride = " << b_stride;;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(C, MinMaxTest, ::testing::Values(&vpx_minmax_8x8_c));
|
||||
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, MinMaxTest,
|
||||
::testing::Values(&vpx_minmax_8x8_sse2));
|
||||
#endif
|
||||
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(NEON, MinMaxTest,
|
||||
::testing::Values(&vpx_minmax_8x8_neon));
|
||||
#endif
|
||||
|
||||
} // namespace
|
@@ -13,13 +13,12 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_blockd.h"
|
||||
#include "vp9/common/vp9_scan.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
@@ -202,62 +201,62 @@ using std::tr1::make_tuple;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, PartialIDctTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c,
|
||||
&vpx_idct32x32_34_add_c,
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c,
|
||||
&vp9_idct32x32_34_add_c,
|
||||
TX_32X32, 34),
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c,
|
||||
&vpx_idct32x32_1_add_c,
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c,
|
||||
&vp9_idct32x32_1_add_c,
|
||||
TX_32X32, 1),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_c,
|
||||
&vpx_idct16x16_10_add_c,
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_c,
|
||||
&vp9_idct16x16_10_add_c,
|
||||
TX_16X16, 10),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_c,
|
||||
&vpx_idct16x16_1_add_c,
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_c,
|
||||
&vp9_idct16x16_1_add_c,
|
||||
TX_16X16, 1),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_12_add_c,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_12_add_c,
|
||||
TX_8X8, 12),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_1_add_c,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_1_add_c,
|
||||
TX_8X8, 1),
|
||||
make_tuple(&vpx_fdct4x4_c,
|
||||
&vpx_idct4x4_16_add_c,
|
||||
&vpx_idct4x4_1_add_c,
|
||||
make_tuple(&vp9_fdct4x4_c,
|
||||
&vp9_idct4x4_16_add_c,
|
||||
&vp9_idct4x4_1_add_c,
|
||||
TX_4X4, 1)));
|
||||
|
||||
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, PartialIDctTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c,
|
||||
&vpx_idct32x32_1_add_neon,
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c,
|
||||
&vp9_idct32x32_1_add_neon,
|
||||
TX_32X32, 1),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_c,
|
||||
&vpx_idct16x16_10_add_neon,
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_c,
|
||||
&vp9_idct16x16_10_add_neon,
|
||||
TX_16X16, 10),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_c,
|
||||
&vpx_idct16x16_1_add_neon,
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_c,
|
||||
&vp9_idct16x16_1_add_neon,
|
||||
TX_16X16, 1),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_12_add_neon,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_12_add_neon,
|
||||
TX_8X8, 12),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_1_add_neon,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_1_add_neon,
|
||||
TX_8X8, 1),
|
||||
make_tuple(&vpx_fdct4x4_c,
|
||||
&vpx_idct4x4_16_add_c,
|
||||
&vpx_idct4x4_1_add_neon,
|
||||
make_tuple(&vp9_fdct4x4_c,
|
||||
&vp9_idct4x4_16_add_c,
|
||||
&vp9_idct4x4_1_add_neon,
|
||||
TX_4X4, 1)));
|
||||
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
@@ -265,44 +264,44 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, PartialIDctTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c,
|
||||
&vpx_idct32x32_34_add_sse2,
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c,
|
||||
&vp9_idct32x32_34_add_sse2,
|
||||
TX_32X32, 34),
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c,
|
||||
&vpx_idct32x32_1_add_sse2,
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c,
|
||||
&vp9_idct32x32_1_add_sse2,
|
||||
TX_32X32, 1),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_c,
|
||||
&vpx_idct16x16_10_add_sse2,
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_c,
|
||||
&vp9_idct16x16_10_add_sse2,
|
||||
TX_16X16, 10),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_c,
|
||||
&vpx_idct16x16_1_add_sse2,
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_c,
|
||||
&vp9_idct16x16_1_add_sse2,
|
||||
TX_16X16, 1),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_12_add_sse2,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_12_add_sse2,
|
||||
TX_8X8, 12),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_1_add_sse2,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_1_add_sse2,
|
||||
TX_8X8, 1),
|
||||
make_tuple(&vpx_fdct4x4_c,
|
||||
&vpx_idct4x4_16_add_c,
|
||||
&vpx_idct4x4_1_add_sse2,
|
||||
make_tuple(&vp9_fdct4x4_c,
|
||||
&vp9_idct4x4_16_add_c,
|
||||
&vp9_idct4x4_1_add_sse2,
|
||||
TX_4X4, 1)));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC && ARCH_X86_64 && \
|
||||
!CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
#if HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
|
||||
!CONFIG_EMULATE_HARDWARE
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3_64, PartialIDctTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_12_add_ssse3,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_12_add_ssse3,
|
||||
TX_8X8, 12)));
|
||||
#endif
|
||||
|
||||
@@ -310,33 +309,33 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, PartialIDctTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c,
|
||||
&vpx_idct32x32_34_add_msa,
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c,
|
||||
&vp9_idct32x32_34_add_msa,
|
||||
TX_32X32, 34),
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vpx_idct32x32_1024_add_c,
|
||||
&vpx_idct32x32_1_add_msa,
|
||||
make_tuple(&vp9_fdct32x32_c,
|
||||
&vp9_idct32x32_1024_add_c,
|
||||
&vp9_idct32x32_1_add_msa,
|
||||
TX_32X32, 1),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_c,
|
||||
&vpx_idct16x16_10_add_msa,
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_c,
|
||||
&vp9_idct16x16_10_add_msa,
|
||||
TX_16X16, 10),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vpx_idct16x16_256_add_c,
|
||||
&vpx_idct16x16_1_add_msa,
|
||||
make_tuple(&vp9_fdct16x16_c,
|
||||
&vp9_idct16x16_256_add_c,
|
||||
&vp9_idct16x16_1_add_msa,
|
||||
TX_16X16, 1),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_12_add_msa,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_12_add_msa,
|
||||
TX_8X8, 10),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vpx_idct8x8_64_add_c,
|
||||
&vpx_idct8x8_1_add_msa,
|
||||
make_tuple(&vp9_fdct8x8_c,
|
||||
&vp9_idct8x8_64_add_c,
|
||||
&vp9_idct8x8_1_add_msa,
|
||||
TX_8X8, 1),
|
||||
make_tuple(&vpx_fdct4x4_c,
|
||||
&vpx_idct4x4_16_add_c,
|
||||
&vpx_idct4x4_1_add_msa,
|
||||
make_tuple(&vp9_fdct4x4_c,
|
||||
&vp9_idct4x4_16_add_c,
|
||||
&vp9_idct4x4_1_add_msa,
|
||||
TX_4X4, 1)));
|
||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||
|
||||
|
@@ -110,9 +110,4 @@ INSTANTIATE_TEST_CASE_P(SSE2, VP8PostProcessingFilterTest,
|
||||
::testing::Values(vp8_post_proc_down_and_across_mb_row_sse2));
|
||||
#endif
|
||||
|
||||
#if HAVE_MSA
|
||||
INSTANTIATE_TEST_CASE_P(MSA, VP8PostProcessingFilterTest,
|
||||
::testing::Values(vp8_post_proc_down_and_across_mb_row_msa));
|
||||
#endif
|
||||
|
||||
} // namespace
|
||||
|
@@ -11,13 +11,13 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp8_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp8_rtcd.h"
|
||||
#include "vp8/common/blockd.h"
|
||||
#include "vp8/common/onyx.h"
|
||||
#include "vp8/encoder/block.h"
|
||||
@@ -192,12 +192,4 @@ INSTANTIATE_TEST_CASE_P(NEON, QuantizeTest,
|
||||
::testing::Values(make_tuple(&vp8_fast_quantize_b_neon,
|
||||
&vp8_fast_quantize_b_c)));
|
||||
#endif // HAVE_NEON
|
||||
|
||||
#if HAVE_MSA
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, QuantizeTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vp8_fast_quantize_b_msa, &vp8_fast_quantize_b_c),
|
||||
make_tuple(&vp8_regular_quantize_b_msa, &vp8_regular_quantize_b_c)));
|
||||
#endif // HAVE_MSA
|
||||
} // namespace
|
||||
|
@@ -30,16 +30,20 @@
|
||||
|
||||
#if defined(_WIN64)
|
||||
|
||||
#undef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define _WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <winnt.h>
|
||||
|
||||
namespace testing {
|
||||
namespace internal {
|
||||
|
||||
inline bool operator==(const M128A& lhs, const M128A& rhs) {
|
||||
return (lhs.Low == rhs.Low && lhs.High == rhs.High);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace testing
|
||||
|
||||
namespace libvpx_test {
|
||||
|
||||
// Compares the state of xmm[6-15] at construction with their state at
|
||||
@@ -92,7 +96,7 @@ class RegisterStateCheck {
|
||||
|
||||
extern "C" {
|
||||
// Save the d8-d15 registers into store.
|
||||
void vpx_push_neon(int64_t *store);
|
||||
void vp9_push_neon(int64_t *store);
|
||||
}
|
||||
|
||||
namespace libvpx_test {
|
||||
@@ -107,7 +111,7 @@ class RegisterStateCheck {
|
||||
|
||||
private:
|
||||
static bool StoreRegisters(int64_t store[8]) {
|
||||
vpx_push_neon(store);
|
||||
vp9_push_neon(store);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -115,7 +119,7 @@ class RegisterStateCheck {
|
||||
bool Check() const {
|
||||
if (!initialized_) return false;
|
||||
int64_t post_store[8];
|
||||
vpx_push_neon(post_store);
|
||||
vp9_push_neon(post_store);
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
EXPECT_EQ(pre_store_[i], post_store[i]) << "d"
|
||||
<< i + 8 << " has been modified";
|
||||
|
@@ -7,8 +7,6 @@
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
#include <climits>
|
||||
#include <vector>
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
@@ -83,187 +81,34 @@ static void write_ivf_frame_header(const vpx_codec_cx_pkt_t *const pkt,
|
||||
const unsigned int kInitialWidth = 320;
|
||||
const unsigned int kInitialHeight = 240;
|
||||
|
||||
struct FrameInfo {
|
||||
FrameInfo(vpx_codec_pts_t _pts, unsigned int _w, unsigned int _h)
|
||||
: pts(_pts), w(_w), h(_h) {}
|
||||
|
||||
vpx_codec_pts_t pts;
|
||||
unsigned int w;
|
||||
unsigned int h;
|
||||
};
|
||||
|
||||
void ScaleForFrameNumber(unsigned int frame,
|
||||
unsigned int initial_w,
|
||||
unsigned int initial_h,
|
||||
unsigned int *w,
|
||||
unsigned int *h,
|
||||
int flag_codec) {
|
||||
if (frame < 10) {
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
return;
|
||||
}
|
||||
if (frame < 20) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 30) {
|
||||
*w = initial_w / 2;
|
||||
*h = initial_h / 2;
|
||||
return;
|
||||
}
|
||||
if (frame < 40) {
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
return;
|
||||
}
|
||||
if (frame < 50) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 60) {
|
||||
*w = initial_w / 2;
|
||||
*h = initial_h / 2;
|
||||
return;
|
||||
}
|
||||
if (frame < 70) {
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
return;
|
||||
}
|
||||
if (frame < 80) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 90) {
|
||||
*w = initial_w / 2;
|
||||
*h = initial_h / 2;
|
||||
return;
|
||||
}
|
||||
if (frame < 100) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 110) {
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
return;
|
||||
}
|
||||
if (frame < 120) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 130) {
|
||||
*w = initial_w / 2;
|
||||
*h = initial_h / 2;
|
||||
return;
|
||||
}
|
||||
if (frame < 140) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 150) {
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
return;
|
||||
}
|
||||
if (frame < 160) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 170) {
|
||||
*w = initial_w / 2;
|
||||
*h = initial_h / 2;
|
||||
return;
|
||||
}
|
||||
if (frame < 180) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 190) {
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
return;
|
||||
}
|
||||
if (frame < 200) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 210) {
|
||||
*w = initial_w / 2;
|
||||
*h = initial_h / 2;
|
||||
return;
|
||||
}
|
||||
if (frame < 220) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 230) {
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
return;
|
||||
}
|
||||
if (frame < 240) {
|
||||
*w = initial_w * 3 / 4;
|
||||
*h = initial_h * 3 / 4;
|
||||
return;
|
||||
}
|
||||
if (frame < 250) {
|
||||
*w = initial_w / 2;
|
||||
*h = initial_h / 2;
|
||||
return;
|
||||
}
|
||||
if (frame < 260) {
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
return;
|
||||
}
|
||||
// Go down very low.
|
||||
if (frame < 270) {
|
||||
*w = initial_w / 4;
|
||||
*h = initial_h / 4;
|
||||
return;
|
||||
}
|
||||
if (flag_codec == 1) {
|
||||
// Cases that only works for VP9.
|
||||
// For VP9: Swap width and height of original.
|
||||
if (frame < 320) {
|
||||
*w = initial_h;
|
||||
*h = initial_w;
|
||||
return;
|
||||
}
|
||||
}
|
||||
*w = initial_w;
|
||||
*h = initial_h;
|
||||
unsigned int ScaleForFrameNumber(unsigned int frame, unsigned int val) {
|
||||
if (frame < 10)
|
||||
return val;
|
||||
if (frame < 20)
|
||||
return val / 2;
|
||||
if (frame < 30)
|
||||
return val * 2 / 3;
|
||||
if (frame < 40)
|
||||
return val / 4;
|
||||
if (frame < 50)
|
||||
return val * 7 / 8;
|
||||
return val;
|
||||
}
|
||||
|
||||
class ResizingVideoSource : public ::libvpx_test::DummyVideoSource {
|
||||
public:
|
||||
ResizingVideoSource() {
|
||||
SetSize(kInitialWidth, kInitialHeight);
|
||||
limit_ = 350;
|
||||
limit_ = 60;
|
||||
}
|
||||
int flag_codec_;
|
||||
|
||||
virtual ~ResizingVideoSource() {}
|
||||
|
||||
protected:
|
||||
virtual void Next() {
|
||||
++frame_;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
ScaleForFrameNumber(frame_, kInitialWidth, kInitialHeight, &width, &height,
|
||||
flag_codec_);
|
||||
SetSize(width, height);
|
||||
SetSize(ScaleForFrameNumber(frame_, kInitialWidth),
|
||||
ScaleForFrameNumber(frame_, kInitialHeight));
|
||||
FillFrame();
|
||||
}
|
||||
};
|
||||
@@ -275,6 +120,15 @@ class ResizeTest : public ::libvpx_test::EncoderTest,
|
||||
|
||||
virtual ~ResizeTest() {}
|
||||
|
||||
struct FrameInfo {
|
||||
FrameInfo(vpx_codec_pts_t _pts, unsigned int _w, unsigned int _h)
|
||||
: pts(_pts), w(_w), h(_h) {}
|
||||
|
||||
vpx_codec_pts_t pts;
|
||||
unsigned int w;
|
||||
unsigned int h;
|
||||
};
|
||||
|
||||
virtual void SetUp() {
|
||||
InitializeConfig();
|
||||
SetMode(GET_PARAM(1));
|
||||
@@ -290,17 +144,15 @@ class ResizeTest : public ::libvpx_test::EncoderTest,
|
||||
|
||||
TEST_P(ResizeTest, TestExternalResizeWorks) {
|
||||
ResizingVideoSource video;
|
||||
video.flag_codec_ = 0;
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
|
||||
for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
|
||||
info != frame_info_list_.end(); ++info) {
|
||||
const unsigned int frame = static_cast<unsigned>(info->pts);
|
||||
unsigned int expected_w;
|
||||
unsigned int expected_h;
|
||||
ScaleForFrameNumber(frame, kInitialWidth, kInitialHeight,
|
||||
&expected_w, &expected_h, 0);
|
||||
const unsigned int expected_w = ScaleForFrameNumber(frame, kInitialWidth);
|
||||
const unsigned int expected_h = ScaleForFrameNumber(frame, kInitialHeight);
|
||||
|
||||
EXPECT_EQ(expected_w, info->w)
|
||||
<< "Frame " << frame << " had unexpected width";
|
||||
EXPECT_EQ(expected_h, info->h)
|
||||
@@ -344,27 +196,13 @@ class ResizeInternalTest : public ResizeTest {
|
||||
|
||||
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
|
||||
libvpx_test::Encoder *encoder) {
|
||||
if (change_config_) {
|
||||
int new_q = 60;
|
||||
if (video->frame() == 0) {
|
||||
struct vpx_scaling_mode mode = {VP8E_ONETWO, VP8E_ONETWO};
|
||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||
}
|
||||
if (video->frame() == 1) {
|
||||
struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
|
||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = new_q;
|
||||
encoder->Config(&cfg_);
|
||||
}
|
||||
} else {
|
||||
if (video->frame() == kStepDownFrame) {
|
||||
struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};
|
||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||
}
|
||||
if (video->frame() == kStepUpFrame) {
|
||||
struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
|
||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||
}
|
||||
if (video->frame() == kStepDownFrame) {
|
||||
struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};
|
||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||
}
|
||||
if (video->frame() == kStepUpFrame) {
|
||||
struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
|
||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,7 +227,6 @@ class ResizeInternalTest : public ResizeTest {
|
||||
#endif
|
||||
|
||||
double frame0_psnr_;
|
||||
bool change_config_;
|
||||
#if WRITE_COMPRESSED_STREAM
|
||||
FILE *outfile_;
|
||||
unsigned int out_frames_;
|
||||
@@ -400,7 +237,6 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
|
||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 10);
|
||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||
change_config_ = false;
|
||||
|
||||
// q picked such that initial keyframe on this clip is ~30dB PSNR
|
||||
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;
|
||||
@@ -425,198 +261,6 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(ResizeInternalTest, TestInternalResizeChangeConfig) {
|
||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 10);
|
||||
cfg_.g_w = 352;
|
||||
cfg_.g_h = 288;
|
||||
change_config_ = true;
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
}
|
||||
|
||||
class ResizeRealtimeTest : public ::libvpx_test::EncoderTest,
|
||||
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
|
||||
protected:
|
||||
ResizeRealtimeTest() : EncoderTest(GET_PARAM(0)) {}
|
||||
virtual ~ResizeRealtimeTest() {}
|
||||
|
||||
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
|
||||
libvpx_test::Encoder *encoder) {
|
||||
if (video->frame() == 0) {
|
||||
encoder->Control(VP9E_SET_AQ_MODE, 3);
|
||||
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
|
||||
}
|
||||
|
||||
if (change_bitrate_ && video->frame() == 120) {
|
||||
change_bitrate_ = false;
|
||||
cfg_.rc_target_bitrate = 500;
|
||||
encoder->Config(&cfg_);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SetUp() {
|
||||
InitializeConfig();
|
||||
SetMode(GET_PARAM(1));
|
||||
set_cpu_used_ = GET_PARAM(2);
|
||||
}
|
||||
|
||||
virtual void DecompressedFrameHook(const vpx_image_t &img,
|
||||
vpx_codec_pts_t pts) {
|
||||
frame_info_list_.push_back(FrameInfo(pts, img.d_w, img.d_h));
|
||||
}
|
||||
|
||||
virtual void MismatchHook(const vpx_image_t *img1,
|
||||
const vpx_image_t *img2) {
|
||||
double mismatch_psnr = compute_psnr(img1, img2);
|
||||
mismatch_psnr_ += mismatch_psnr;
|
||||
++mismatch_nframes_;
|
||||
}
|
||||
|
||||
unsigned int GetMismatchFrames() {
|
||||
return mismatch_nframes_;
|
||||
}
|
||||
|
||||
void DefaultConfig() {
|
||||
cfg_.rc_buf_initial_sz = 500;
|
||||
cfg_.rc_buf_optimal_sz = 600;
|
||||
cfg_.rc_buf_sz = 1000;
|
||||
cfg_.rc_min_quantizer = 2;
|
||||
cfg_.rc_max_quantizer = 56;
|
||||
cfg_.rc_undershoot_pct = 50;
|
||||
cfg_.rc_overshoot_pct = 50;
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
cfg_.kf_mode = VPX_KF_AUTO;
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
cfg_.kf_min_dist = cfg_.kf_max_dist = 3000;
|
||||
// Enable dropped frames.
|
||||
cfg_.rc_dropframe_thresh = 1;
|
||||
// Enable error_resilience mode.
|
||||
cfg_.g_error_resilient = 1;
|
||||
// Enable dynamic resizing.
|
||||
cfg_.rc_resize_allowed = 1;
|
||||
// Run at low bitrate.
|
||||
cfg_.rc_target_bitrate = 200;
|
||||
}
|
||||
|
||||
std::vector< FrameInfo > frame_info_list_;
|
||||
int set_cpu_used_;
|
||||
bool change_bitrate_;
|
||||
double mismatch_psnr_;
|
||||
int mismatch_nframes_;
|
||||
};
|
||||
|
||||
TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
|
||||
ResizingVideoSource video;
|
||||
video.flag_codec_ = 1;
|
||||
DefaultConfig();
|
||||
// Disable internal resize for this test.
|
||||
cfg_.rc_resize_allowed = 0;
|
||||
change_bitrate_ = false;
|
||||
mismatch_psnr_ = 0.0;
|
||||
mismatch_nframes_ = 0;
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
|
||||
for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
|
||||
info != frame_info_list_.end(); ++info) {
|
||||
const unsigned int frame = static_cast<unsigned>(info->pts);
|
||||
unsigned int expected_w;
|
||||
unsigned int expected_h;
|
||||
ScaleForFrameNumber(frame, kInitialWidth, kInitialHeight,
|
||||
&expected_w, &expected_h, 1);
|
||||
EXPECT_EQ(expected_w, info->w)
|
||||
<< "Frame " << frame << " had unexpected width";
|
||||
EXPECT_EQ(expected_h, info->h)
|
||||
<< "Frame " << frame << " had unexpected height";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
}
|
||||
}
|
||||
|
||||
// Verify the dynamic resizer behavior for real time, 1 pass CBR mode.
|
||||
// Run at low bitrate, with resize_allowed = 1, and verify that we get
|
||||
// one resize down event.
|
||||
TEST_P(ResizeRealtimeTest, TestInternalResizeDown) {
|
||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 299);
|
||||
DefaultConfig();
|
||||
cfg_.g_w = 352;
|
||||
cfg_.g_h = 288;
|
||||
change_bitrate_ = false;
|
||||
mismatch_psnr_ = 0.0;
|
||||
mismatch_nframes_ = 0;
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
|
||||
unsigned int last_w = cfg_.g_w;
|
||||
unsigned int last_h = cfg_.g_h;
|
||||
int resize_count = 0;
|
||||
for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
|
||||
info != frame_info_list_.end(); ++info) {
|
||||
if (info->w != last_w || info->h != last_h) {
|
||||
// Verify that resize down occurs.
|
||||
ASSERT_LT(info->w, last_w);
|
||||
ASSERT_LT(info->h, last_h);
|
||||
last_w = info->w;
|
||||
last_h = info->h;
|
||||
resize_count++;
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_DECODER
|
||||
// Verify that we get 1 resize down event in this test.
|
||||
ASSERT_EQ(1, resize_count) << "Resizing should occur.";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
#else
|
||||
printf("Warning: VP9 decoder unavailable, unable to check resize count!\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// Verify the dynamic resizer behavior for real time, 1 pass CBR mode.
|
||||
// Start at low target bitrate, raise the bitrate in the middle of the clip,
|
||||
// scaling-up should occur after bitrate changed.
|
||||
TEST_P(ResizeRealtimeTest, TestInternalResizeDownUpChangeBitRate) {
|
||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||
30, 1, 0, 359);
|
||||
DefaultConfig();
|
||||
cfg_.g_w = 352;
|
||||
cfg_.g_h = 288;
|
||||
change_bitrate_ = true;
|
||||
mismatch_psnr_ = 0.0;
|
||||
mismatch_nframes_ = 0;
|
||||
// Disable dropped frames.
|
||||
cfg_.rc_dropframe_thresh = 0;
|
||||
// Starting bitrate low.
|
||||
cfg_.rc_target_bitrate = 80;
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||
|
||||
unsigned int last_w = cfg_.g_w;
|
||||
unsigned int last_h = cfg_.g_h;
|
||||
int resize_count = 0;
|
||||
for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
|
||||
info != frame_info_list_.end(); ++info) {
|
||||
if (info->w != last_w || info->h != last_h) {
|
||||
resize_count++;
|
||||
if (resize_count == 1) {
|
||||
// Verify that resize down occurs.
|
||||
ASSERT_LT(info->w, last_w);
|
||||
ASSERT_LT(info->h, last_h);
|
||||
} else if (resize_count == 2) {
|
||||
// Verify that resize up occurs.
|
||||
ASSERT_GT(info->w, last_w);
|
||||
ASSERT_GT(info->h, last_h);
|
||||
}
|
||||
last_w = info->w;
|
||||
last_h = info->h;
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_DECODER
|
||||
// Verify that we get 2 resize events in this test.
|
||||
ASSERT_EQ(resize_count, 2) << "Resizing should occur twice.";
|
||||
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
|
||||
#else
|
||||
printf("Warning: VP9 decoder unavailable, unable to check resize count!\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
vpx_img_fmt_t CspForFrameNumber(int frame) {
|
||||
if (frame < 10)
|
||||
return VPX_IMG_FMT_I420;
|
||||
@@ -727,9 +371,6 @@ VP9_INSTANTIATE_TEST_CASE(ResizeTest,
|
||||
::testing::Values(::libvpx_test::kRealTime));
|
||||
VP9_INSTANTIATE_TEST_CASE(ResizeInternalTest,
|
||||
::testing::Values(::libvpx_test::kOnePassBest));
|
||||
VP9_INSTANTIATE_TEST_CASE(ResizeRealtimeTest,
|
||||
::testing::Values(::libvpx_test::kRealTime),
|
||||
::testing::Range(5, 9));
|
||||
VP9_INSTANTIATE_TEST_CASE(ResizeCspTest,
|
||||
::testing::Values(::libvpx_test::kRealTime));
|
||||
} // namespace
|
||||
|
941
test/sad_test.cc
941
test/sad_test.cc
File diff suppressed because it is too large
Load Diff
@@ -11,15 +11,13 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp8_rtcd.h"
|
||||
#include "test/acm_random.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_config.h"
|
||||
#include "./vp8_rtcd.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
@@ -186,48 +184,58 @@ TEST_P(SixtapPredictTest, TestWithRandomData) {
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
const SixtapPredictFunc sixtap_16x16_c = vp8_sixtap_predict16x16_c;
|
||||
const SixtapPredictFunc sixtap_8x8_c = vp8_sixtap_predict8x8_c;
|
||||
const SixtapPredictFunc sixtap_8x4_c = vp8_sixtap_predict8x4_c;
|
||||
const SixtapPredictFunc sixtap_4x4_c = vp8_sixtap_predict4x4_c;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, SixtapPredictTest, ::testing::Values(
|
||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_c),
|
||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_c),
|
||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_c),
|
||||
make_tuple(4, 4, &vp8_sixtap_predict4x4_c)));
|
||||
make_tuple(16, 16, sixtap_16x16_c),
|
||||
make_tuple(8, 8, sixtap_8x8_c),
|
||||
make_tuple(8, 4, sixtap_8x4_c),
|
||||
make_tuple(4, 4, sixtap_4x4_c)));
|
||||
#if HAVE_NEON
|
||||
const SixtapPredictFunc sixtap_16x16_neon = vp8_sixtap_predict16x16_neon;
|
||||
const SixtapPredictFunc sixtap_8x8_neon = vp8_sixtap_predict8x8_neon;
|
||||
const SixtapPredictFunc sixtap_8x4_neon = vp8_sixtap_predict8x4_neon;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, SixtapPredictTest, ::testing::Values(
|
||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_neon),
|
||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_neon),
|
||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_neon)));
|
||||
DISABLED_NEON, SixtapPredictTest, ::testing::Values(
|
||||
make_tuple(16, 16, sixtap_16x16_neon),
|
||||
make_tuple(8, 8, sixtap_8x8_neon),
|
||||
make_tuple(8, 4, sixtap_8x4_neon)));
|
||||
#endif
|
||||
#if HAVE_MMX
|
||||
const SixtapPredictFunc sixtap_16x16_mmx = vp8_sixtap_predict16x16_mmx;
|
||||
const SixtapPredictFunc sixtap_8x8_mmx = vp8_sixtap_predict8x8_mmx;
|
||||
const SixtapPredictFunc sixtap_8x4_mmx = vp8_sixtap_predict8x4_mmx;
|
||||
const SixtapPredictFunc sixtap_4x4_mmx = vp8_sixtap_predict4x4_mmx;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MMX, SixtapPredictTest, ::testing::Values(
|
||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_mmx),
|
||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_mmx),
|
||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_mmx),
|
||||
make_tuple(4, 4, &vp8_sixtap_predict4x4_mmx)));
|
||||
make_tuple(16, 16, sixtap_16x16_mmx),
|
||||
make_tuple(8, 8, sixtap_8x8_mmx),
|
||||
make_tuple(8, 4, sixtap_8x4_mmx),
|
||||
make_tuple(4, 4, sixtap_4x4_mmx)));
|
||||
#endif
|
||||
#if HAVE_SSE2
|
||||
const SixtapPredictFunc sixtap_16x16_sse2 = vp8_sixtap_predict16x16_sse2;
|
||||
const SixtapPredictFunc sixtap_8x8_sse2 = vp8_sixtap_predict8x8_sse2;
|
||||
const SixtapPredictFunc sixtap_8x4_sse2 = vp8_sixtap_predict8x4_sse2;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, SixtapPredictTest, ::testing::Values(
|
||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_sse2),
|
||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_sse2),
|
||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_sse2)));
|
||||
make_tuple(16, 16, sixtap_16x16_sse2),
|
||||
make_tuple(8, 8, sixtap_8x8_sse2),
|
||||
make_tuple(8, 4, sixtap_8x4_sse2)));
|
||||
#endif
|
||||
#if HAVE_SSSE3
|
||||
const SixtapPredictFunc sixtap_16x16_ssse3 = vp8_sixtap_predict16x16_ssse3;
|
||||
const SixtapPredictFunc sixtap_8x8_ssse3 = vp8_sixtap_predict8x8_ssse3;
|
||||
const SixtapPredictFunc sixtap_8x4_ssse3 = vp8_sixtap_predict8x4_ssse3;
|
||||
const SixtapPredictFunc sixtap_4x4_ssse3 = vp8_sixtap_predict4x4_ssse3;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSSE3, SixtapPredictTest, ::testing::Values(
|
||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_ssse3),
|
||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_ssse3),
|
||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_ssse3),
|
||||
make_tuple(4, 4, &vp8_sixtap_predict4x4_ssse3)));
|
||||
#endif
|
||||
#if HAVE_MSA
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, SixtapPredictTest, ::testing::Values(
|
||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_msa),
|
||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_msa),
|
||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_msa),
|
||||
make_tuple(4, 4, &vp8_sixtap_predict4x4_msa)));
|
||||
make_tuple(16, 16, sixtap_16x16_ssse3),
|
||||
make_tuple(8, 8, sixtap_8x8_ssse3),
|
||||
make_tuple(8, 4, sixtap_8x4_ssse3),
|
||||
make_tuple(4, 4, sixtap_4x4_ssse3)));
|
||||
#endif
|
||||
} // namespace
|
||||
|
123
test/subtract_test.cc
Normal file
123
test/subtract_test.cc
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright (c) 2012 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 "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp8_rtcd.h"
|
||||
#include "vp8/common/blockd.h"
|
||||
#include "vp8/encoder/block.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
typedef void (*SubtractBlockFunc)(BLOCK *be, BLOCKD *bd, int pitch);
|
||||
|
||||
namespace {
|
||||
|
||||
class SubtractBlockTest : public ::testing::TestWithParam<SubtractBlockFunc> {
|
||||
public:
|
||||
virtual void TearDown() {
|
||||
libvpx_test::ClearSystemState();
|
||||
}
|
||||
};
|
||||
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
TEST_P(SubtractBlockTest, SimpleSubtract) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
BLOCK be;
|
||||
BLOCKD bd;
|
||||
// in libvpx, this stride is always 16
|
||||
const int kDiffPredStride = 16;
|
||||
const int kSrcStride[] = {32, 16, 8, 4, 0};
|
||||
const int kBlockWidth = 4;
|
||||
const int kBlockHeight = 4;
|
||||
|
||||
// Allocate... align to 16 for mmx/sse tests
|
||||
uint8_t *source = reinterpret_cast<uint8_t*>(
|
||||
vpx_memalign(16, kBlockHeight * kSrcStride[0] * sizeof(*source)));
|
||||
be.src_diff = reinterpret_cast<int16_t*>(
|
||||
vpx_memalign(16, kBlockHeight * kDiffPredStride * sizeof(*be.src_diff)));
|
||||
bd.predictor = reinterpret_cast<unsigned char*>(
|
||||
vpx_memalign(16, kBlockHeight * kDiffPredStride * sizeof(*bd.predictor)));
|
||||
|
||||
for (int i = 0; kSrcStride[i] > 0; ++i) {
|
||||
// start at block0
|
||||
be.src = 0;
|
||||
be.base_src = &source;
|
||||
be.src_stride = kSrcStride[i];
|
||||
|
||||
// set difference
|
||||
int16_t *src_diff = be.src_diff;
|
||||
for (int r = 0; r < kBlockHeight; ++r) {
|
||||
for (int c = 0; c < kBlockWidth; ++c) {
|
||||
src_diff[c] = static_cast<int16_t>(0xa5a5u);
|
||||
}
|
||||
src_diff += kDiffPredStride;
|
||||
}
|
||||
|
||||
// set destination
|
||||
uint8_t *base_src = *be.base_src;
|
||||
for (int r = 0; r < kBlockHeight; ++r) {
|
||||
for (int c = 0; c < kBlockWidth; ++c) {
|
||||
base_src[c] = rnd.Rand8();
|
||||
}
|
||||
base_src += be.src_stride;
|
||||
}
|
||||
|
||||
// set predictor
|
||||
uint8_t *predictor = bd.predictor;
|
||||
for (int r = 0; r < kBlockHeight; ++r) {
|
||||
for (int c = 0; c < kBlockWidth; ++c) {
|
||||
predictor[c] = rnd.Rand8();
|
||||
}
|
||||
predictor += kDiffPredStride;
|
||||
}
|
||||
|
||||
ASM_REGISTER_STATE_CHECK(GetParam()(&be, &bd, kDiffPredStride));
|
||||
|
||||
base_src = *be.base_src;
|
||||
src_diff = be.src_diff;
|
||||
predictor = bd.predictor;
|
||||
for (int r = 0; r < kBlockHeight; ++r) {
|
||||
for (int c = 0; c < kBlockWidth; ++c) {
|
||||
EXPECT_EQ(base_src[c], (src_diff[c] + predictor[c])) << "r = " << r
|
||||
<< ", c = " << c;
|
||||
}
|
||||
src_diff += kDiffPredStride;
|
||||
predictor += kDiffPredStride;
|
||||
base_src += be.src_stride;
|
||||
}
|
||||
}
|
||||
vpx_free(be.src_diff);
|
||||
vpx_free(source);
|
||||
vpx_free(bd.predictor);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(C, SubtractBlockTest,
|
||||
::testing::Values(vp8_subtract_b_c));
|
||||
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(NEON, SubtractBlockTest,
|
||||
::testing::Values(vp8_subtract_b_neon));
|
||||
#endif
|
||||
|
||||
#if HAVE_MMX
|
||||
INSTANTIATE_TEST_CASE_P(MMX, SubtractBlockTest,
|
||||
::testing::Values(vp8_subtract_b_mmx));
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, SubtractBlockTest,
|
||||
::testing::Values(vp8_subtract_b_sse2));
|
||||
#endif
|
||||
|
||||
} // namespace
|
@@ -16,13 +16,8 @@
|
||||
|
||||
namespace {
|
||||
|
||||
const int kTestMode = 0;
|
||||
const int kSuperframeSyntax = 1;
|
||||
|
||||
typedef std::tr1::tuple<libvpx_test::TestMode,int> SuperframeTestParam;
|
||||
|
||||
class SuperframeTest : public ::libvpx_test::EncoderTest,
|
||||
public ::libvpx_test::CodecTestWithParam<SuperframeTestParam> {
|
||||
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
|
||||
protected:
|
||||
SuperframeTest() : EncoderTest(GET_PARAM(0)), modified_buf_(NULL),
|
||||
last_sf_pts_(0) {}
|
||||
@@ -30,13 +25,9 @@ class SuperframeTest : public ::libvpx_test::EncoderTest,
|
||||
|
||||
virtual void SetUp() {
|
||||
InitializeConfig();
|
||||
const SuperframeTestParam input = GET_PARAM(1);
|
||||
const libvpx_test::TestMode mode = std::tr1::get<kTestMode>(input);
|
||||
const int syntax = std::tr1::get<kSuperframeSyntax>(input);
|
||||
SetMode(mode);
|
||||
SetMode(GET_PARAM(1));
|
||||
sf_count_ = 0;
|
||||
sf_count_max_ = INT_MAX;
|
||||
is_vp10_style_superframe_ = syntax;
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
@@ -59,8 +50,7 @@ class SuperframeTest : public ::libvpx_test::EncoderTest,
|
||||
const uint8_t marker = buffer[pkt->data.frame.sz - 1];
|
||||
const int frames = (marker & 0x7) + 1;
|
||||
const int mag = ((marker >> 3) & 3) + 1;
|
||||
const unsigned int index_sz =
|
||||
2 + mag * (frames - is_vp10_style_superframe_);
|
||||
const unsigned int index_sz = 2 + mag * frames;
|
||||
if ((marker & 0xe0) == 0xc0 &&
|
||||
pkt->data.frame.sz >= index_sz &&
|
||||
buffer[pkt->data.frame.sz - index_sz] == marker) {
|
||||
@@ -85,7 +75,6 @@ class SuperframeTest : public ::libvpx_test::EncoderTest,
|
||||
return pkt;
|
||||
}
|
||||
|
||||
int is_vp10_style_superframe_;
|
||||
int sf_count_;
|
||||
int sf_count_max_;
|
||||
vpx_codec_cx_pkt_t modified_pkt_;
|
||||
@@ -103,11 +92,6 @@ TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) {
|
||||
EXPECT_EQ(sf_count_, 1);
|
||||
}
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
|
||||
::testing::Values(::libvpx_test::kTwoPassGood),
|
||||
::testing::Values(0)));
|
||||
|
||||
VP10_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
|
||||
::testing::Values(::libvpx_test::kTwoPassGood),
|
||||
::testing::Values(CONFIG_MISC_FIXES)));
|
||||
VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(
|
||||
::libvpx_test::kTwoPassGood));
|
||||
} // namespace
|
||||
|
@@ -18,7 +18,6 @@ LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_422.y4m
|
||||
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_444.y4m
|
||||
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_440.yuv
|
||||
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += desktop_credits.y4m
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += niklas_1280_720_30.y4m
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += rush_hour_444.y4m
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += screendata.y4m
|
||||
@@ -418,18 +417,6 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-130x132.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-130x132.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-132x130.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-132x130.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-132x132.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-132x132.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-178x180.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-178x180.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-180x178.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-180x178.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-180x180.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-180x180.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm
|
||||
@@ -562,8 +549,6 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-352x288.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-352x288.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-05-resize.ivf
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-05-resize.ivf.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-06-bilinear.webm
|
||||
@@ -656,34 +641,6 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-fp-tiles-8-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-1-2-4-8.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-1-2-4-8.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-1-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-1-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-1-8.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-1-8.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-2-1.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-2-1.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-2-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-2-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-2-8.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-2-8.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-4-1.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-4-1.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-4-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-4-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-4-8.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-4-8.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-8-1.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-8-1.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-8-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-8-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-8-4-2-1.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-8-4-2-1.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-8-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-14-resize-10frames-fp-tiles-8-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey_adpq.webm
|
||||
@@ -730,8 +687,8 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv444.webm.md5
|
||||
endif # CONFIG_VP9_HIGHBITDEPTH
|
||||
|
||||
# Invalid files for testing libvpx error checking.
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-01-v3.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-01-v3.webm.res
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-01-v2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-01-v2.webm.res
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-02-v2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-02-v2.webm.res
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-03-v3.webm
|
||||
@@ -811,53 +768,3 @@ endif # CONFIG_ENCODE_PERF_TESTS
|
||||
|
||||
# sort and remove duplicates
|
||||
LIBVPX_TEST_DATA-yes := $(sort $(LIBVPX_TEST_DATA-yes))
|
||||
|
||||
# VP9 dynamic resizing test (decoder)
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_5_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x180_7_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_5_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_320x240_7_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_5_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x360_7_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_5_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_640x480_7_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_5_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1280x720_7_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_5_3-4.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_1-2.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_1-2.webm.md5
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_3-4.webm
|
||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-21-resize_inter_1920x1080_7_3-4.webm.md5
|
||||
|
@@ -6,8 +6,8 @@ b87815bf86020c592ccc7a846ba2e28ec8043902 *hantro_odd.yuv
|
||||
456d1493e52d32a5c30edf44a27debc1fa6b253a *invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf.res
|
||||
c123d1f9f02fb4143abb5e271916e3a3080de8f6 *invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf
|
||||
456d1493e52d32a5c30edf44a27debc1fa6b253a *invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf.res
|
||||
fe346136b9b8c1e6f6084cc106485706915795e4 *invalid-vp90-01-v3.webm
|
||||
5d9474c0309b7ca09a182d888f73b37a8fe1362c *invalid-vp90-01-v3.webm.res
|
||||
fe346136b9b8c1e6f6084cc106485706915795e4 *invalid-vp90-01-v2.webm
|
||||
25751f5d3b05ff03f0719ad42cd625348eb8961e *invalid-vp90-01-v2.webm.res
|
||||
d78e2fceba5ac942246503ec8366f879c4775ca5 *invalid-vp90-02-v2.webm
|
||||
8e2eff4af87d2b561cce2365713269e301457ef3 *invalid-vp90-02-v2.webm.res
|
||||
df1a1453feb3c00d7d89746c7003b4163523bff3 *invalid-vp90-03-v3.webm
|
||||
@@ -550,8 +550,6 @@ d17bc08eedfc60c4c23d576a6c964a21bf854d1f *vp90-2-03-size-226x202.webm
|
||||
83c6d8f2969b759e10e5c6542baca1265c874c29 *vp90-2-03-size-226x224.webm.md5
|
||||
fe0af2ee47b1e5f6a66db369e2d7e9d870b38dce *vp90-2-03-size-226x226.webm
|
||||
94ad19b8b699cea105e2ff18f0df2afd7242bcf7 *vp90-2-03-size-226x226.webm.md5
|
||||
52bc1dfd3a97b24d922eb8a31d07527891561f2a *vp90-2-03-size-352x288.webm
|
||||
3084d6d0a1eec22e85a394422fbc8faae58930a5 *vp90-2-03-size-352x288.webm.md5
|
||||
b6524e4084d15b5d0caaa3d3d1368db30cbee69c *vp90-2-03-deltaq.webm
|
||||
65f45ec9a55537aac76104818278e0978f94a678 *vp90-2-03-deltaq.webm.md5
|
||||
4dbb87494c7f565ffc266c98d17d0d8c7a5c5aba *vp90-2-05-resize.ivf
|
||||
@@ -745,92 +743,3 @@ d06285d109ecbaef63b0cbcc44d70a129186f51c *invalid-vp90-2-03-size-224x196.webm.iv
|
||||
e60d859b0ef2b331b21740cf6cb83fabe469b079 *invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf
|
||||
0ae808dca4d3c1152a9576e14830b6faa39f1b4a *invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf.res
|
||||
9cfc855459e7549fd015c79e8eca512b2f2cb7e3 *niklas_1280_720_30.y4m
|
||||
5b5763b388b1b52a81bb82b39f7ec25c4bd3d0e1 *desktop_credits.y4m
|
||||
85771f6ab44e4a0226e206c0cde8351dd5918953 *vp90-2-02-size-130x132.webm
|
||||
512dad5eabbed37b4bbbc64ce153f1a5484427b8 *vp90-2-02-size-130x132.webm.md5
|
||||
01f7127d40360289db63b27f61cb9afcda350e95 *vp90-2-02-size-132x130.webm
|
||||
4a94275328ae076cf60f966c097a8721010fbf5a *vp90-2-02-size-132x130.webm.md5
|
||||
f41c0400b5716b4b70552c40dd03d44be131e1cc *vp90-2-02-size-132x132.webm
|
||||
1a69e989f697e424bfe3e3e8a77bb0c0992c8e47 *vp90-2-02-size-132x132.webm.md5
|
||||
94a5cbfacacba100e0c5f7861c72a1b417feca0f *vp90-2-02-size-178x180.webm
|
||||
dedfecf1d784bcf70629592fa5e6f01d5441ccc9 *vp90-2-02-size-178x180.webm.md5
|
||||
4828b62478c04014bba3095a83106911a71cf387 *vp90-2-02-size-180x178.webm
|
||||
423da2b861050c969d78ed8e8f8f14045d1d8199 *vp90-2-02-size-180x178.webm.md5
|
||||
338f7c9282f43e29940f5391118aadd17e4f9234 *vp90-2-02-size-180x180.webm
|
||||
6c2ef013392310778dca5dd5351160eca66b0a60 *vp90-2-02-size-180x180.webm.md5
|
||||
679fa7d6807e936ff937d7b282e7dbd8ac76447e *vp90-2-14-resize-10frames-fp-tiles-1-2-4-8.webm
|
||||
fc7267ab8fc2bf5d6c234e34ee6c078a967b4888 *vp90-2-14-resize-10frames-fp-tiles-1-2-4-8.webm.md5
|
||||
9d33a137c819792209c5ce4e4e1ee5da73d574fe *vp90-2-14-resize-10frames-fp-tiles-1-2.webm
|
||||
0c78a154956a8605d050bdd75e0dcc4d39c040a6 *vp90-2-14-resize-10frames-fp-tiles-1-2.webm.md5
|
||||
d6a8d8c57f66a91d23e8e7df480f9ae841e56c37 *vp90-2-14-resize-10frames-fp-tiles-1-4.webm
|
||||
e9b4e8c7b33b5fda745d340c3f47e6623ae40cf2 *vp90-2-14-resize-10frames-fp-tiles-1-4.webm.md5
|
||||
aa6fe043a0c4a42b49c87ebbe812d4afd9945bec *vp90-2-14-resize-10frames-fp-tiles-1-8.webm
|
||||
028520578994c2d013d4c0129033d4f2ff31bbe0 *vp90-2-14-resize-10frames-fp-tiles-1-8.webm.md5
|
||||
d1d5463c9ea7b5cc5f609ddedccddf656f348d1a *vp90-2-14-resize-10frames-fp-tiles-2-1.webm
|
||||
92d5872f5bdffbed721703b7e959b4f885e3d77a *vp90-2-14-resize-10frames-fp-tiles-2-1.webm.md5
|
||||
677cb29de1215d97346015af5807a9b1faad54cf *vp90-2-14-resize-10frames-fp-tiles-2-4.webm
|
||||
a5db19f977094ec3fd60b4f7671b3e6740225e12 *vp90-2-14-resize-10frames-fp-tiles-2-4.webm.md5
|
||||
cdd3c52ba21067efdbb2de917fe2a965bf27332e *vp90-2-14-resize-10frames-fp-tiles-2-8.webm
|
||||
db17ec5d894ea8b8d0b7f32206d0dd3d46dcfa6d *vp90-2-14-resize-10frames-fp-tiles-2-8.webm.md5
|
||||
0f6093c472125d05b764d7d1965c1d56771c0ea2 *vp90-2-14-resize-10frames-fp-tiles-4-1.webm
|
||||
bc7c79e1bee07926dd970462ce6f64fc30eec3e1 *vp90-2-14-resize-10frames-fp-tiles-4-1.webm.md5
|
||||
c5142e2bff4091338196c8ea8bc9266e64f548bc *vp90-2-14-resize-10frames-fp-tiles-4-2.webm
|
||||
22aa3dd430b69fd3d92f6561bac86deeed90486d *vp90-2-14-resize-10frames-fp-tiles-4-2.webm.md5
|
||||
ede8b1466d2f26e1b1bd9602addb9cd1017e1d8c *vp90-2-14-resize-10frames-fp-tiles-4-8.webm
|
||||
508d5ebb9c0eac2a4100281a3ee052ec2fc19217 *vp90-2-14-resize-10frames-fp-tiles-4-8.webm.md5
|
||||
2b292e3392854cd1d76ae597a6f53656cf741cfa *vp90-2-14-resize-10frames-fp-tiles-8-1.webm
|
||||
1c24e54fa19e94e1722f24676404444e941c3d31 *vp90-2-14-resize-10frames-fp-tiles-8-1.webm.md5
|
||||
61beda21064e09634564caa6697ab90bd53c9af7 *vp90-2-14-resize-10frames-fp-tiles-8-2.webm
|
||||
9c0657b4d9e1d0e4c9d28a90e5a8630a65519124 *vp90-2-14-resize-10frames-fp-tiles-8-2.webm.md5
|
||||
1758c50a11a7c92522749b4a251664705f1f0d4b *vp90-2-14-resize-10frames-fp-tiles-8-4-2-1.webm
|
||||
4f454a06750614314ae15a44087b79016fe2db97 *vp90-2-14-resize-10frames-fp-tiles-8-4-2-1.webm.md5
|
||||
3920c95ba94f1f048a731d9d9b416043b44aa4bd *vp90-2-14-resize-10frames-fp-tiles-8-4.webm
|
||||
4eb347a0456d2c49a1e1d8de5aa1c51acc39887e *vp90-2-14-resize-10frames-fp-tiles-8-4.webm.md5
|
||||
4b95a74c032a473b6683d7ad5754db1b0ec378e9 *vp90-2-21-resize_inter_1280x720_5_1-2.webm
|
||||
a7826dd386bedfe69d02736969bfb47fb6a40a5e *vp90-2-21-resize_inter_1280x720_5_1-2.webm.md5
|
||||
5cfff79e82c4d69964ccb8e75b4f0c53b9295167 *vp90-2-21-resize_inter_1280x720_5_3-4.webm
|
||||
a18f57db4a25e1f543a99f2ceb182e00db0ee22f *vp90-2-21-resize_inter_1280x720_5_3-4.webm.md5
|
||||
d26db0811bf30eb4131d928669713e2485f8e833 *vp90-2-21-resize_inter_1280x720_7_1-2.webm
|
||||
fd6f9f332cd5bea4c0f0d57be4297bea493cc5a1 *vp90-2-21-resize_inter_1280x720_7_1-2.webm.md5
|
||||
5c7d73d4d268e2ba9593b31cb091fd339505c7fd *vp90-2-21-resize_inter_1280x720_7_3-4.webm
|
||||
7bbb949cabc1e70dadcc74582739f63b833034e0 *vp90-2-21-resize_inter_1280x720_7_3-4.webm.md5
|
||||
f2d2a41a60eb894aff0c5854afca15931f1445a8 *vp90-2-21-resize_inter_1920x1080_5_1-2.webm
|
||||
66d7789992613ac9d678ff905ff1059daa1b89e4 *vp90-2-21-resize_inter_1920x1080_5_1-2.webm.md5
|
||||
764edb75fe7dd64e73a1b4f3b4b2b1bf237a4dea *vp90-2-21-resize_inter_1920x1080_5_3-4.webm
|
||||
f78bea1075983fd990e7f25d4f31438f9b5efa34 *vp90-2-21-resize_inter_1920x1080_5_3-4.webm.md5
|
||||
96496f2ade764a5de9f0c27917c7df1f120fb2ef *vp90-2-21-resize_inter_1920x1080_7_1-2.webm
|
||||
2632b635135ed5ecd67fd22dec7990d29c4f4cb5 *vp90-2-21-resize_inter_1920x1080_7_1-2.webm.md5
|
||||
74889ea42001bf41428cb742ca74e65129c886dc *vp90-2-21-resize_inter_1920x1080_7_3-4.webm
|
||||
d2cf3b25956415bb579d368e7098097e482dd73a *vp90-2-21-resize_inter_1920x1080_7_3-4.webm.md5
|
||||
4658986a8ce36ebfcc80a1903e446eaab3985336 *vp90-2-21-resize_inter_320x180_5_1-2.webm
|
||||
8a3d8cf325109ffa913cc9426c32eea8c202a09a *vp90-2-21-resize_inter_320x180_5_1-2.webm.md5
|
||||
16303aa45176520ee42c2c425247aadc1506b881 *vp90-2-21-resize_inter_320x180_5_3-4.webm
|
||||
41cab1ddf7715b680a4dbce42faa9bcd72af4e5c *vp90-2-21-resize_inter_320x180_5_3-4.webm.md5
|
||||
56648adcee66dd0e5cb6ac947f5ee1b9cc8ba129 *vp90-2-21-resize_inter_320x180_7_1-2.webm
|
||||
70047377787003cc03dda7b2394e6d7eaa666d9e *vp90-2-21-resize_inter_320x180_7_1-2.webm.md5
|
||||
d2ff99165488499cc55f75929f1ce5ca9c9e359b *vp90-2-21-resize_inter_320x180_7_3-4.webm
|
||||
e69019e378114a4643db283b66d1a7e304761a56 *vp90-2-21-resize_inter_320x180_7_3-4.webm.md5
|
||||
4834d129bed0f4289d3a88f2ae3a1736f77621b0 *vp90-2-21-resize_inter_320x240_5_1-2.webm
|
||||
a75653c53d22b623c1927fc0088da21dafef21f4 *vp90-2-21-resize_inter_320x240_5_1-2.webm.md5
|
||||
19818e1b7fd1c1e63d8873c31b0babe29dd33ba6 *vp90-2-21-resize_inter_320x240_5_3-4.webm
|
||||
8d89814ff469a186312111651b16601dfbce4336 *vp90-2-21-resize_inter_320x240_5_3-4.webm.md5
|
||||
ac8057bae52498f324ce92a074d5f8207cc4a4a7 *vp90-2-21-resize_inter_320x240_7_1-2.webm
|
||||
2643440898c83c08cc47bc744245af696b877c24 *vp90-2-21-resize_inter_320x240_7_1-2.webm.md5
|
||||
cf4a4cd38ac8b18c42d8c25a3daafdb39132256b *vp90-2-21-resize_inter_320x240_7_3-4.webm
|
||||
70ba8ec9120b26e9b0ffa2c79b432f16cbcb50ec *vp90-2-21-resize_inter_320x240_7_3-4.webm.md5
|
||||
669f10409fe1c4a054010162ca47773ea1fdbead *vp90-2-21-resize_inter_640x360_5_1-2.webm
|
||||
6355a04249004a35fb386dd1024214234f044383 *vp90-2-21-resize_inter_640x360_5_1-2.webm.md5
|
||||
c23763b950b8247c1775d1f8158d93716197676c *vp90-2-21-resize_inter_640x360_5_3-4.webm
|
||||
59e6fc381e3ec3b7bdaac586334e0bc944d18fb6 *vp90-2-21-resize_inter_640x360_5_3-4.webm.md5
|
||||
71b45cbfdd068baa1f679a69e5e6f421d256a85f *vp90-2-21-resize_inter_640x360_7_1-2.webm
|
||||
1416fc761b690c54a955c4cf017fa078520e8c18 *vp90-2-21-resize_inter_640x360_7_1-2.webm.md5
|
||||
6c409903279448a697e4db63bab1061784bcd8d2 *vp90-2-21-resize_inter_640x360_7_3-4.webm
|
||||
60de1299793433a630b71130cf76c9f5965758e2 *vp90-2-21-resize_inter_640x360_7_3-4.webm.md5
|
||||
852b597b8af096d90c80bf0ed6ed3b336b851f19 *vp90-2-21-resize_inter_640x480_5_1-2.webm
|
||||
f6856f19236ee46ed462bd0a2e7e72b9c3b9cea6 *vp90-2-21-resize_inter_640x480_5_1-2.webm.md5
|
||||
792a16c6f60043bd8dceb515f0b95b8891647858 *vp90-2-21-resize_inter_640x480_5_3-4.webm
|
||||
68ffe59877e9a7863805e1c0a3ce18ce037d7c9d *vp90-2-21-resize_inter_640x480_5_3-4.webm.md5
|
||||
61e044c4759972a35ea3db8c1478a988910a4ef4 *vp90-2-21-resize_inter_640x480_7_1-2.webm
|
||||
7739bfca167b1b43fea72f807f01e097b7cb98d8 *vp90-2-21-resize_inter_640x480_7_1-2.webm.md5
|
||||
7291af354b4418917eee00e3a7e366086a0b7a10 *vp90-2-21-resize_inter_640x480_7_3-4.webm
|
||||
4a18b09ccb36564193f0215f599d745d95bb558c *vp90-2-21-resize_inter_640x480_7_3-4.webm.md5
|
||||
|
55
test/test.mk
55
test/test.mk
@@ -18,16 +18,15 @@ LIBVPX_TEST_SRCS-yes += video_source.h
|
||||
LIBVPX_TEST_SRCS-yes += ../md5_utils.h ../md5_utils.c
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ivf_video_source.h
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += ../y4minput.h ../y4minput.c
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += altref_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += aq_segment_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += datarate_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += encode_api_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += error_resilience_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += i420_video_source.h
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += resize_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += y4m_video_source.h
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += yuv_video_source.h
|
||||
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += altref_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += config_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += cq_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += keyframe_test.cc
|
||||
@@ -37,7 +36,6 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += external_frame_buffer_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += invalid_file_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += user_priv_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_frame_parallel_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += active_map_refresh_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += active_map_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += borders_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += cpu_speed_test.cc
|
||||
@@ -59,10 +57,10 @@ LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += y4m_test.cc ../y4menc.c ../y4menc.h
|
||||
|
||||
## WebM Parsing
|
||||
ifeq ($(CONFIG_WEBM_IO), yes)
|
||||
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvparser.cc
|
||||
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvreader.cc
|
||||
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvparser.h
|
||||
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser/mkvreader.h
|
||||
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser.cpp
|
||||
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvreader.cpp
|
||||
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvparser.hpp
|
||||
LIBWEBM_PARSER_SRCS += ../third_party/libwebm/mkvreader.hpp
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += $(LIBWEBM_PARSER_SRCS)
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../tools_common.h
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.cc
|
||||
@@ -95,7 +93,7 @@ endif
|
||||
ifeq ($(CONFIG_SHARED),)
|
||||
|
||||
## VP8
|
||||
ifeq ($(CONFIG_VP8),yes)
|
||||
ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
|
||||
|
||||
# These tests require both the encoder and decoder to be built.
|
||||
ifeq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),yesyes)
|
||||
@@ -103,15 +101,16 @@ LIBVPX_TEST_SRCS-yes += vp8_boolcoder_test.cc
|
||||
LIBVPX_TEST_SRCS-yes += vp8_fragments_test.cc
|
||||
endif
|
||||
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_POSTPROC) += add_noise_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_POSTPROC) += pp_filter_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += vp8_decrypt_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += quantize_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += set_roi.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += subtract_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += variance_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += vp8_fdct4x4_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += quantize_test.cc
|
||||
|
||||
LIBVPX_TEST_SRCS-yes += idct_test.cc
|
||||
LIBVPX_TEST_SRCS-yes += intrapred_test.cc
|
||||
LIBVPX_TEST_SRCS-yes += sixtap_predict_test.cc
|
||||
LIBVPX_TEST_SRCS-yes += vpx_scale_test.cc
|
||||
|
||||
@@ -122,7 +121,7 @@ endif
|
||||
endif # VP8
|
||||
|
||||
## VP9
|
||||
ifeq ($(CONFIG_VP9),yes)
|
||||
ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),)
|
||||
|
||||
# These tests require both the encoder and decoder to be built.
|
||||
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),yesyes)
|
||||
@@ -135,26 +134,26 @@ LIBVPX_TEST_SRCS-yes += vp9_boolcoder_test.cc
|
||||
LIBVPX_TEST_SRCS-yes += vp9_encoder_parms_get_to_decoder.cc
|
||||
endif
|
||||
|
||||
LIBVPX_TEST_SRCS-yes += convolve_test.cc
|
||||
LIBVPX_TEST_SRCS-yes += lpf_8_test.cc
|
||||
LIBVPX_TEST_SRCS-yes += vp9_intrapred_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_decrypt_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9) += convolve_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_thread_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_decrypt_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct16x16_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct32x32_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct4x4_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct8x8_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += hadamard_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += minmax_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += variance_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_subtract_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += lpf_8_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_avg_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_error_block_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_quantize_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_subtract_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9) += vp9_intrapred_test.cc
|
||||
|
||||
ifeq ($(CONFIG_VP9_ENCODER),yes)
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_SPATIAL_SVC) += svc_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_INTERNAL_STATS) += blockiness_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_INTERNAL_STATS) += consistency_test.cc
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_TEMPORAL_DENOISING),yesyes)
|
||||
@@ -164,24 +163,10 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_arf_freq_test.cc
|
||||
|
||||
endif # VP9
|
||||
|
||||
## VP10
|
||||
ifeq ($(CONFIG_VP10),yes)
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc
|
||||
|
||||
LIBVPX_TEST_SRCS-yes += vp10_inv_txfm_test.cc
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER) += vp10_dct_test.cc
|
||||
|
||||
endif # VP10
|
||||
|
||||
## Multi-codec / unconditional whitebox tests.
|
||||
|
||||
ifeq ($(findstring yes,$(CONFIG_VP9_ENCODER)$(CONFIG_VP10_ENCODER)),yes)
|
||||
LIBVPX_TEST_SRCS-yes += avg_test.cc
|
||||
endif
|
||||
|
||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc
|
||||
|
||||
TEST_INTRA_PRED_SPEED_SRCS-yes := test_intra_pred_speed.cc
|
||||
TEST_INTRA_PRED_SPEED_SRCS-yes += ../md5_utils.h ../md5_utils.c
|
||||
TEST_INTRA_PRED_SPEED_SRCS-$(CONFIG_VP9_DECODER) := test_intra_pred_speed.cc
|
||||
TEST_INTRA_PRED_SPEED_SRCS-$(CONFIG_VP9_DECODER) += ../md5_utils.h ../md5_utils.c
|
||||
|
||||
endif # CONFIG_SHARED
|
||||
|
||||
|
@@ -7,14 +7,14 @@
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
// Test and time VPX intra-predictor functions
|
||||
// Test and time VP9 intra-predictor functions
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/md5_helper.h"
|
||||
@@ -170,203 +170,215 @@ void TestIntraPred32(VpxPredFunc const *pred_funcs) {
|
||||
#define INTRA_PRED_TEST(arch, test_func, dc, dc_left, dc_top, dc_128, v, h, \
|
||||
d45, d135, d117, d153, d207, d63, tm) \
|
||||
TEST(arch, test_func) { \
|
||||
static const VpxPredFunc vpx_intra_pred[] = { \
|
||||
static const VpxPredFunc vp9_intra_pred[] = { \
|
||||
dc, dc_left, dc_top, dc_128, v, h, d45, \
|
||||
d135, d117, d153, d207, d63, tm}; \
|
||||
test_func(vpx_intra_pred); \
|
||||
test_func(vp9_intra_pred); \
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// 4x4
|
||||
|
||||
INTRA_PRED_TEST(C, TestIntraPred4, vpx_dc_predictor_4x4_c,
|
||||
vpx_dc_left_predictor_4x4_c, vpx_dc_top_predictor_4x4_c,
|
||||
vpx_dc_128_predictor_4x4_c, vpx_v_predictor_4x4_c,
|
||||
vpx_h_predictor_4x4_c, vpx_d45_predictor_4x4_c,
|
||||
vpx_d135_predictor_4x4_c, vpx_d117_predictor_4x4_c,
|
||||
vpx_d153_predictor_4x4_c, vpx_d207_predictor_4x4_c,
|
||||
vpx_d63_predictor_4x4_c, vpx_tm_predictor_4x4_c)
|
||||
INTRA_PRED_TEST(C, TestIntraPred4, vp9_dc_predictor_4x4_c,
|
||||
vp9_dc_left_predictor_4x4_c, vp9_dc_top_predictor_4x4_c,
|
||||
vp9_dc_128_predictor_4x4_c, vp9_v_predictor_4x4_c,
|
||||
vp9_h_predictor_4x4_c, vp9_d45_predictor_4x4_c,
|
||||
vp9_d135_predictor_4x4_c, vp9_d117_predictor_4x4_c,
|
||||
vp9_d153_predictor_4x4_c, vp9_d207_predictor_4x4_c,
|
||||
vp9_d63_predictor_4x4_c, vp9_tm_predictor_4x4_c)
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
INTRA_PRED_TEST(SSE2, TestIntraPred4, vpx_dc_predictor_4x4_sse2,
|
||||
vpx_dc_left_predictor_4x4_sse2, vpx_dc_top_predictor_4x4_sse2,
|
||||
vpx_dc_128_predictor_4x4_sse2, vpx_v_predictor_4x4_sse2,
|
||||
vpx_h_predictor_4x4_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
vpx_tm_predictor_4x4_sse2)
|
||||
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
#if HAVE_SSE
|
||||
INTRA_PRED_TEST(SSE, TestIntraPred4, vp9_dc_predictor_4x4_sse,
|
||||
vp9_dc_left_predictor_4x4_sse, vp9_dc_top_predictor_4x4_sse,
|
||||
vp9_dc_128_predictor_4x4_sse, vp9_v_predictor_4x4_sse, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, vp9_tm_predictor_4x4_sse)
|
||||
#endif // HAVE_SSE
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC
|
||||
#if HAVE_SSSE3
|
||||
INTRA_PRED_TEST(SSSE3, TestIntraPred4, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_d45_predictor_4x4_ssse3, NULL, NULL,
|
||||
vpx_d153_predictor_4x4_ssse3, vpx_d207_predictor_4x4_ssse3,
|
||||
vpx_d63_predictor_4x4_ssse3, NULL)
|
||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
|
||||
vp9_h_predictor_4x4_ssse3, vp9_d45_predictor_4x4_ssse3, NULL,
|
||||
NULL, vp9_d153_predictor_4x4_ssse3,
|
||||
vp9_d207_predictor_4x4_ssse3, vp9_d63_predictor_4x4_ssse3, NULL)
|
||||
#endif // HAVE_SSSE3
|
||||
|
||||
#if HAVE_DSPR2
|
||||
INTRA_PRED_TEST(DSPR2, TestIntraPred4, vpx_dc_predictor_4x4_dspr2, NULL, NULL,
|
||||
NULL, NULL, vpx_h_predictor_4x4_dspr2, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, vpx_tm_predictor_4x4_dspr2)
|
||||
INTRA_PRED_TEST(DSPR2, TestIntraPred4, vp9_dc_predictor_4x4_dspr2, NULL, NULL,
|
||||
NULL, NULL, vp9_h_predictor_4x4_dspr2, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, vp9_tm_predictor_4x4_dspr2)
|
||||
#endif // HAVE_DSPR2
|
||||
|
||||
#if HAVE_NEON
|
||||
INTRA_PRED_TEST(NEON, TestIntraPred4, vpx_dc_predictor_4x4_neon,
|
||||
vpx_dc_left_predictor_4x4_neon, vpx_dc_top_predictor_4x4_neon,
|
||||
vpx_dc_128_predictor_4x4_neon, vpx_v_predictor_4x4_neon,
|
||||
vpx_h_predictor_4x4_neon, vpx_d45_predictor_4x4_neon,
|
||||
vpx_d135_predictor_4x4_neon, NULL, NULL, NULL, NULL,
|
||||
vpx_tm_predictor_4x4_neon)
|
||||
INTRA_PRED_TEST(NEON, TestIntraPred4, vp9_dc_predictor_4x4_neon,
|
||||
vp9_dc_left_predictor_4x4_neon, vp9_dc_top_predictor_4x4_neon,
|
||||
vp9_dc_128_predictor_4x4_neon, vp9_v_predictor_4x4_neon,
|
||||
vp9_h_predictor_4x4_neon, vp9_d45_predictor_4x4_neon,
|
||||
vp9_d135_predictor_4x4_neon, NULL, NULL, NULL, NULL,
|
||||
vp9_tm_predictor_4x4_neon)
|
||||
#endif // HAVE_NEON
|
||||
|
||||
#if HAVE_MSA
|
||||
INTRA_PRED_TEST(MSA, TestIntraPred4, vpx_dc_predictor_4x4_msa,
|
||||
vpx_dc_left_predictor_4x4_msa, vpx_dc_top_predictor_4x4_msa,
|
||||
vpx_dc_128_predictor_4x4_msa, vpx_v_predictor_4x4_msa,
|
||||
vpx_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_tm_predictor_4x4_msa)
|
||||
INTRA_PRED_TEST(MSA, TestIntraPred4, vp9_dc_predictor_4x4_msa,
|
||||
vp9_dc_left_predictor_4x4_msa, vp9_dc_top_predictor_4x4_msa,
|
||||
vp9_dc_128_predictor_4x4_msa, vp9_v_predictor_4x4_msa,
|
||||
vp9_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vp9_tm_predictor_4x4_msa)
|
||||
#endif // HAVE_MSA
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// 8x8
|
||||
|
||||
INTRA_PRED_TEST(C, TestIntraPred8, vpx_dc_predictor_8x8_c,
|
||||
vpx_dc_left_predictor_8x8_c, vpx_dc_top_predictor_8x8_c,
|
||||
vpx_dc_128_predictor_8x8_c, vpx_v_predictor_8x8_c,
|
||||
vpx_h_predictor_8x8_c, vpx_d45_predictor_8x8_c,
|
||||
vpx_d135_predictor_8x8_c, vpx_d117_predictor_8x8_c,
|
||||
vpx_d153_predictor_8x8_c, vpx_d207_predictor_8x8_c,
|
||||
vpx_d63_predictor_8x8_c, vpx_tm_predictor_8x8_c)
|
||||
INTRA_PRED_TEST(C, TestIntraPred8, vp9_dc_predictor_8x8_c,
|
||||
vp9_dc_left_predictor_8x8_c, vp9_dc_top_predictor_8x8_c,
|
||||
vp9_dc_128_predictor_8x8_c, vp9_v_predictor_8x8_c,
|
||||
vp9_h_predictor_8x8_c, vp9_d45_predictor_8x8_c,
|
||||
vp9_d135_predictor_8x8_c, vp9_d117_predictor_8x8_c,
|
||||
vp9_d153_predictor_8x8_c, vp9_d207_predictor_8x8_c,
|
||||
vp9_d63_predictor_8x8_c, vp9_tm_predictor_8x8_c)
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
INTRA_PRED_TEST(SSE2, TestIntraPred8, vpx_dc_predictor_8x8_sse2,
|
||||
vpx_dc_left_predictor_8x8_sse2, vpx_dc_top_predictor_8x8_sse2,
|
||||
vpx_dc_128_predictor_8x8_sse2, vpx_v_predictor_8x8_sse2,
|
||||
vpx_h_predictor_8x8_sse2, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_tm_predictor_8x8_sse2)
|
||||
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
#if HAVE_SSE
|
||||
INTRA_PRED_TEST(SSE, TestIntraPred8, vp9_dc_predictor_8x8_sse,
|
||||
vp9_dc_left_predictor_8x8_sse, vp9_dc_top_predictor_8x8_sse,
|
||||
vp9_dc_128_predictor_8x8_sse, vp9_v_predictor_8x8_sse, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL)
|
||||
#endif // HAVE_SSE
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC
|
||||
#if HAVE_SSE2
|
||||
INTRA_PRED_TEST(SSE2, TestIntraPred8, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, vp9_tm_predictor_8x8_sse2)
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSSE3
|
||||
INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_d45_predictor_8x8_ssse3, NULL, NULL,
|
||||
vpx_d153_predictor_8x8_ssse3, vpx_d207_predictor_8x8_ssse3,
|
||||
vpx_d63_predictor_8x8_ssse3, NULL)
|
||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
|
||||
vp9_h_predictor_8x8_ssse3, vp9_d45_predictor_8x8_ssse3, NULL,
|
||||
NULL, vp9_d153_predictor_8x8_ssse3,
|
||||
vp9_d207_predictor_8x8_ssse3, vp9_d63_predictor_8x8_ssse3, NULL)
|
||||
#endif // HAVE_SSSE3
|
||||
|
||||
#if HAVE_DSPR2
|
||||
INTRA_PRED_TEST(DSPR2, TestIntraPred8, vpx_dc_predictor_8x8_dspr2, NULL, NULL,
|
||||
NULL, NULL, vpx_h_predictor_8x8_dspr2, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, vpx_tm_predictor_8x8_c)
|
||||
INTRA_PRED_TEST(DSPR2, TestIntraPred8, vp9_dc_predictor_8x8_dspr2, NULL, NULL,
|
||||
NULL, NULL, vp9_h_predictor_8x8_dspr2, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, vp9_tm_predictor_8x8_c)
|
||||
#endif // HAVE_DSPR2
|
||||
|
||||
#if HAVE_NEON
|
||||
INTRA_PRED_TEST(NEON, TestIntraPred8, vpx_dc_predictor_8x8_neon,
|
||||
vpx_dc_left_predictor_8x8_neon, vpx_dc_top_predictor_8x8_neon,
|
||||
vpx_dc_128_predictor_8x8_neon, vpx_v_predictor_8x8_neon,
|
||||
vpx_h_predictor_8x8_neon, vpx_d45_predictor_8x8_neon, NULL,
|
||||
NULL, NULL, NULL, NULL, vpx_tm_predictor_8x8_neon)
|
||||
INTRA_PRED_TEST(NEON, TestIntraPred8, vp9_dc_predictor_8x8_neon,
|
||||
vp9_dc_left_predictor_8x8_neon, vp9_dc_top_predictor_8x8_neon,
|
||||
vp9_dc_128_predictor_8x8_neon, vp9_v_predictor_8x8_neon,
|
||||
vp9_h_predictor_8x8_neon, vp9_d45_predictor_8x8_neon, NULL,
|
||||
NULL, NULL, NULL, NULL, vp9_tm_predictor_8x8_neon)
|
||||
|
||||
#endif // HAVE_NEON
|
||||
|
||||
#if HAVE_MSA
|
||||
INTRA_PRED_TEST(MSA, TestIntraPred8, vpx_dc_predictor_8x8_msa,
|
||||
vpx_dc_left_predictor_8x8_msa, vpx_dc_top_predictor_8x8_msa,
|
||||
vpx_dc_128_predictor_8x8_msa, vpx_v_predictor_8x8_msa,
|
||||
vpx_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_tm_predictor_8x8_msa)
|
||||
INTRA_PRED_TEST(MSA, TestIntraPred8, vp9_dc_predictor_8x8_msa,
|
||||
vp9_dc_left_predictor_8x8_msa, vp9_dc_top_predictor_8x8_msa,
|
||||
vp9_dc_128_predictor_8x8_msa, vp9_v_predictor_8x8_msa,
|
||||
vp9_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vp9_tm_predictor_8x8_msa)
|
||||
#endif // HAVE_MSA
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// 16x16
|
||||
|
||||
INTRA_PRED_TEST(C, TestIntraPred16, vpx_dc_predictor_16x16_c,
|
||||
vpx_dc_left_predictor_16x16_c, vpx_dc_top_predictor_16x16_c,
|
||||
vpx_dc_128_predictor_16x16_c, vpx_v_predictor_16x16_c,
|
||||
vpx_h_predictor_16x16_c, vpx_d45_predictor_16x16_c,
|
||||
vpx_d135_predictor_16x16_c, vpx_d117_predictor_16x16_c,
|
||||
vpx_d153_predictor_16x16_c, vpx_d207_predictor_16x16_c,
|
||||
vpx_d63_predictor_16x16_c, vpx_tm_predictor_16x16_c)
|
||||
INTRA_PRED_TEST(C, TestIntraPred16, vp9_dc_predictor_16x16_c,
|
||||
vp9_dc_left_predictor_16x16_c, vp9_dc_top_predictor_16x16_c,
|
||||
vp9_dc_128_predictor_16x16_c, vp9_v_predictor_16x16_c,
|
||||
vp9_h_predictor_16x16_c, vp9_d45_predictor_16x16_c,
|
||||
vp9_d135_predictor_16x16_c, vp9_d117_predictor_16x16_c,
|
||||
vp9_d153_predictor_16x16_c, vp9_d207_predictor_16x16_c,
|
||||
vp9_d63_predictor_16x16_c, vp9_tm_predictor_16x16_c)
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
INTRA_PRED_TEST(SSE2, TestIntraPred16, vpx_dc_predictor_16x16_sse2,
|
||||
vpx_dc_left_predictor_16x16_sse2,
|
||||
vpx_dc_top_predictor_16x16_sse2,
|
||||
vpx_dc_128_predictor_16x16_sse2, vpx_v_predictor_16x16_sse2,
|
||||
vpx_h_predictor_16x16_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
vpx_tm_predictor_16x16_sse2)
|
||||
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
#if HAVE_SSE2
|
||||
INTRA_PRED_TEST(SSE2, TestIntraPred16, vp9_dc_predictor_16x16_sse2,
|
||||
vp9_dc_left_predictor_16x16_sse2,
|
||||
vp9_dc_top_predictor_16x16_sse2,
|
||||
vp9_dc_128_predictor_16x16_sse2, vp9_v_predictor_16x16_sse2,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
vp9_tm_predictor_16x16_sse2)
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC
|
||||
#if HAVE_SSSE3
|
||||
INTRA_PRED_TEST(SSSE3, TestIntraPred16, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_d45_predictor_16x16_ssse3,
|
||||
NULL, NULL, vpx_d153_predictor_16x16_ssse3,
|
||||
vpx_d207_predictor_16x16_ssse3, vpx_d63_predictor_16x16_ssse3,
|
||||
vp9_h_predictor_16x16_ssse3, vp9_d45_predictor_16x16_ssse3,
|
||||
NULL, NULL, vp9_d153_predictor_16x16_ssse3,
|
||||
vp9_d207_predictor_16x16_ssse3, vp9_d63_predictor_16x16_ssse3,
|
||||
NULL)
|
||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
|
||||
#endif // HAVE_SSSE3
|
||||
|
||||
#if HAVE_DSPR2
|
||||
INTRA_PRED_TEST(DSPR2, TestIntraPred16, vpx_dc_predictor_16x16_dspr2, NULL,
|
||||
NULL, NULL, NULL, vpx_h_predictor_16x16_dspr2, NULL, NULL, NULL,
|
||||
INTRA_PRED_TEST(DSPR2, TestIntraPred16, vp9_dc_predictor_16x16_dspr2, NULL,
|
||||
NULL, NULL, NULL, vp9_h_predictor_16x16_dspr2, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL)
|
||||
#endif // HAVE_DSPR2
|
||||
|
||||
#if HAVE_NEON
|
||||
INTRA_PRED_TEST(NEON, TestIntraPred16, vpx_dc_predictor_16x16_neon,
|
||||
vpx_dc_left_predictor_16x16_neon,
|
||||
vpx_dc_top_predictor_16x16_neon,
|
||||
vpx_dc_128_predictor_16x16_neon, vpx_v_predictor_16x16_neon,
|
||||
vpx_h_predictor_16x16_neon, vpx_d45_predictor_16x16_neon, NULL,
|
||||
NULL, NULL, NULL, NULL, vpx_tm_predictor_16x16_neon)
|
||||
INTRA_PRED_TEST(NEON, TestIntraPred16, vp9_dc_predictor_16x16_neon,
|
||||
vp9_dc_left_predictor_16x16_neon,
|
||||
vp9_dc_top_predictor_16x16_neon,
|
||||
vp9_dc_128_predictor_16x16_neon, vp9_v_predictor_16x16_neon,
|
||||
vp9_h_predictor_16x16_neon, vp9_d45_predictor_16x16_neon, NULL,
|
||||
NULL, NULL, NULL, NULL, vp9_tm_predictor_16x16_neon)
|
||||
#endif // HAVE_NEON
|
||||
|
||||
#if HAVE_MSA
|
||||
INTRA_PRED_TEST(MSA, TestIntraPred16, vpx_dc_predictor_16x16_msa,
|
||||
vpx_dc_left_predictor_16x16_msa, vpx_dc_top_predictor_16x16_msa,
|
||||
vpx_dc_128_predictor_16x16_msa, vpx_v_predictor_16x16_msa,
|
||||
vpx_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_tm_predictor_16x16_msa)
|
||||
INTRA_PRED_TEST(MSA, TestIntraPred16, vp9_dc_predictor_16x16_msa,
|
||||
vp9_dc_left_predictor_16x16_msa, vp9_dc_top_predictor_16x16_msa,
|
||||
vp9_dc_128_predictor_16x16_msa, vp9_v_predictor_16x16_msa,
|
||||
vp9_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vp9_tm_predictor_16x16_msa)
|
||||
#endif // HAVE_MSA
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// 32x32
|
||||
|
||||
INTRA_PRED_TEST(C, TestIntraPred32, vpx_dc_predictor_32x32_c,
|
||||
vpx_dc_left_predictor_32x32_c, vpx_dc_top_predictor_32x32_c,
|
||||
vpx_dc_128_predictor_32x32_c, vpx_v_predictor_32x32_c,
|
||||
vpx_h_predictor_32x32_c, vpx_d45_predictor_32x32_c,
|
||||
vpx_d135_predictor_32x32_c, vpx_d117_predictor_32x32_c,
|
||||
vpx_d153_predictor_32x32_c, vpx_d207_predictor_32x32_c,
|
||||
vpx_d63_predictor_32x32_c, vpx_tm_predictor_32x32_c)
|
||||
INTRA_PRED_TEST(C, TestIntraPred32, vp9_dc_predictor_32x32_c,
|
||||
vp9_dc_left_predictor_32x32_c, vp9_dc_top_predictor_32x32_c,
|
||||
vp9_dc_128_predictor_32x32_c, vp9_v_predictor_32x32_c,
|
||||
vp9_h_predictor_32x32_c, vp9_d45_predictor_32x32_c,
|
||||
vp9_d135_predictor_32x32_c, vp9_d117_predictor_32x32_c,
|
||||
vp9_d153_predictor_32x32_c, vp9_d207_predictor_32x32_c,
|
||||
vp9_d63_predictor_32x32_c, vp9_tm_predictor_32x32_c)
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
INTRA_PRED_TEST(SSE2, TestIntraPred32, vpx_dc_predictor_32x32_sse2,
|
||||
vpx_dc_left_predictor_32x32_sse2,
|
||||
vpx_dc_top_predictor_32x32_sse2,
|
||||
vpx_dc_128_predictor_32x32_sse2, vpx_v_predictor_32x32_sse2,
|
||||
vpx_h_predictor_32x32_sse2, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_tm_predictor_32x32_sse2)
|
||||
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
#if HAVE_SSE2
|
||||
#if ARCH_X86_64
|
||||
INTRA_PRED_TEST(SSE2, TestIntraPred32, vp9_dc_predictor_32x32_sse2,
|
||||
vp9_dc_left_predictor_32x32_sse2,
|
||||
vp9_dc_top_predictor_32x32_sse2,
|
||||
vp9_dc_128_predictor_32x32_sse2, vp9_v_predictor_32x32_sse2,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
vp9_tm_predictor_32x32_sse2)
|
||||
#else
|
||||
INTRA_PRED_TEST(SSE2, TestIntraPred32, vp9_dc_predictor_32x32_sse2,
|
||||
vp9_dc_left_predictor_32x32_sse2,
|
||||
vp9_dc_top_predictor_32x32_sse2,
|
||||
vp9_dc_128_predictor_32x32_sse2, vp9_v_predictor_32x32_sse2,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
|
||||
#endif // ARCH_X86_64
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC
|
||||
#if HAVE_SSSE3
|
||||
INTRA_PRED_TEST(SSSE3, TestIntraPred32, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_d45_predictor_32x32_ssse3, NULL, NULL,
|
||||
vpx_d153_predictor_32x32_ssse3, vpx_d207_predictor_32x32_ssse3,
|
||||
vpx_d63_predictor_32x32_ssse3, NULL)
|
||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
|
||||
vp9_h_predictor_32x32_ssse3, vp9_d45_predictor_32x32_ssse3,
|
||||
NULL, NULL, vp9_d153_predictor_32x32_ssse3,
|
||||
vp9_d207_predictor_32x32_ssse3, vp9_d63_predictor_32x32_ssse3,
|
||||
NULL)
|
||||
#endif // HAVE_SSSE3
|
||||
|
||||
#if HAVE_NEON
|
||||
INTRA_PRED_TEST(NEON, TestIntraPred32, vpx_dc_predictor_32x32_neon,
|
||||
vpx_dc_left_predictor_32x32_neon,
|
||||
vpx_dc_top_predictor_32x32_neon,
|
||||
vpx_dc_128_predictor_32x32_neon, vpx_v_predictor_32x32_neon,
|
||||
vpx_h_predictor_32x32_neon, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
vpx_tm_predictor_32x32_neon)
|
||||
INTRA_PRED_TEST(NEON, TestIntraPred32, vp9_dc_predictor_32x32_neon,
|
||||
vp9_dc_left_predictor_32x32_neon,
|
||||
vp9_dc_top_predictor_32x32_neon,
|
||||
vp9_dc_128_predictor_32x32_neon, vp9_v_predictor_32x32_neon,
|
||||
vp9_h_predictor_32x32_neon, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
vp9_tm_predictor_32x32_neon)
|
||||
#endif // HAVE_NEON
|
||||
|
||||
#if HAVE_MSA
|
||||
INTRA_PRED_TEST(MSA, TestIntraPred32, vpx_dc_predictor_32x32_msa,
|
||||
vpx_dc_left_predictor_32x32_msa, vpx_dc_top_predictor_32x32_msa,
|
||||
vpx_dc_128_predictor_32x32_msa, vpx_v_predictor_32x32_msa,
|
||||
vpx_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vpx_tm_predictor_32x32_msa)
|
||||
INTRA_PRED_TEST(MSA, TestIntraPred32, vp9_dc_predictor_32x32_msa,
|
||||
vp9_dc_left_predictor_32x32_msa, vp9_dc_top_predictor_32x32_msa,
|
||||
vp9_dc_128_predictor_32x32_msa, vp9_v_predictor_32x32_msa,
|
||||
vp9_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL, vp9_tm_predictor_32x32_msa)
|
||||
#endif // HAVE_MSA
|
||||
|
||||
#include "test/test_libvpx.cc"
|
||||
|
@@ -8,9 +8,6 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
#include <string>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#if ARCH_X86 || ARCH_X86_64
|
||||
#include "vpx_ports/x86.h"
|
||||
@@ -25,8 +22,8 @@ extern void vp9_rtcd();
|
||||
extern void vpx_dsp_rtcd();
|
||||
extern void vpx_scale_rtcd();
|
||||
}
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#if ARCH_X86 || ARCH_X86_64
|
||||
static void append_negative_gtest_filter(const char *str) {
|
||||
std::string filter = ::testing::FLAGS_gtest_filter;
|
||||
// Negative patterns begin with one '-' followed by a ':' separated list.
|
||||
@@ -34,7 +31,6 @@ static void append_negative_gtest_filter(const char *str) {
|
||||
filter += str;
|
||||
::testing::FLAGS_gtest_filter = filter;
|
||||
}
|
||||
#endif // ARCH_X86 || ARCH_X86_64
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
@@ -57,7 +53,7 @@ int main(int argc, char **argv) {
|
||||
append_negative_gtest_filter(":AVX.*:AVX/*");
|
||||
if (!(simd_caps & HAS_AVX2))
|
||||
append_negative_gtest_filter(":AVX2.*:AVX2/*");
|
||||
#endif // ARCH_X86 || ARCH_X86_64
|
||||
#endif
|
||||
|
||||
#if !CONFIG_SHARED
|
||||
// Shared library builds don't support whitebox tests
|
||||
|
@@ -10,7 +10,6 @@
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "../tools_common.h"
|
||||
@@ -45,12 +44,6 @@ class TestVectorTest : public ::libvpx_test::DecoderTest,
|
||||
TestVectorTest()
|
||||
: DecoderTest(GET_PARAM(0)),
|
||||
md5_file_(NULL) {
|
||||
#if CONFIG_VP9_DECODER
|
||||
resize_clips_.insert(
|
||||
::libvpx_test::kVP9TestVectorsResize,
|
||||
::libvpx_test::kVP9TestVectorsResize +
|
||||
::libvpx_test::kNumVP9TestVectorsResize);
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual ~TestVectorTest() {
|
||||
@@ -84,10 +77,6 @@ class TestVectorTest : public ::libvpx_test::DecoderTest,
|
||||
<< "Md5 checksums don't match: frame number = " << frame_number;
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_DECODER
|
||||
std::set<std::string> resize_clips_;
|
||||
#endif
|
||||
|
||||
private:
|
||||
FILE *md5_file_;
|
||||
};
|
||||
@@ -103,19 +92,11 @@ TEST_P(TestVectorTest, MD5Match) {
|
||||
const int mode = std::tr1::get<kDecodeMode>(input);
|
||||
libvpx_test::CompressedVideoSource *video = NULL;
|
||||
vpx_codec_flags_t flags = 0;
|
||||
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
|
||||
vpx_codec_dec_cfg_t cfg = {0};
|
||||
char str[256];
|
||||
|
||||
if (mode == kFrameParallelMode) {
|
||||
flags |= VPX_CODEC_USE_FRAME_THREADING;
|
||||
#if CONFIG_VP9_DECODER
|
||||
// TODO(hkuang): Fix frame parallel decode bug. See issue 1086.
|
||||
if (resize_clips_.find(filename) != resize_clips_.end()) {
|
||||
printf("Skipping the test file: %s, due to frame parallel decode bug.\n",
|
||||
filename.c_str());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
cfg.threads = threads;
|
||||
@@ -163,7 +144,7 @@ VP8_INSTANTIATE_TEST_CASE(
|
||||
::testing::ValuesIn(libvpx_test::kVP8TestVectors,
|
||||
libvpx_test::kVP8TestVectors +
|
||||
libvpx_test::kNumVP8TestVectors)));
|
||||
#endif // CONFIG_VP8_DECODER
|
||||
#endif
|
||||
|
||||
// Test VP9 decode in serial mode with single thread.
|
||||
#if CONFIG_VP9_DECODER
|
||||
|
@@ -52,31 +52,6 @@ const char *const kVP8TestVectors[] = {
|
||||
const int kNumVP8TestVectors = NELEMENTS(kVP8TestVectors);
|
||||
#endif // CONFIG_VP8_DECODER
|
||||
#if CONFIG_VP9_DECODER
|
||||
#define RESIZE_TEST_VECTORS "vp90-2-21-resize_inter_320x180_5_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_320x180_5_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_320x180_7_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_320x180_7_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_320x240_5_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_320x240_5_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_320x240_7_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_320x240_7_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_640x360_5_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_640x360_5_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_640x360_7_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_640x360_7_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_640x480_5_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_640x480_5_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_640x480_7_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_640x480_7_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_1280x720_5_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_1280x720_5_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_1280x720_7_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_1280x720_7_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_1920x1080_5_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_1920x1080_5_3-4.webm", \
|
||||
"vp90-2-21-resize_inter_1920x1080_7_1-2.webm", \
|
||||
"vp90-2-21-resize_inter_1920x1080_7_3-4.webm",
|
||||
|
||||
const char *const kVP9TestVectors[] = {
|
||||
"vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
|
||||
"vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.webm",
|
||||
@@ -145,10 +120,7 @@ const char *const kVP9TestVectors[] = {
|
||||
"vp90-2-02-size-66x10.webm", "vp90-2-02-size-66x16.webm",
|
||||
"vp90-2-02-size-66x18.webm", "vp90-2-02-size-66x32.webm",
|
||||
"vp90-2-02-size-66x34.webm", "vp90-2-02-size-66x64.webm",
|
||||
"vp90-2-02-size-66x66.webm", "vp90-2-02-size-130x132.webm",
|
||||
"vp90-2-02-size-132x130.webm", "vp90-2-02-size-132x132.webm",
|
||||
"vp90-2-02-size-178x180.webm", "vp90-2-02-size-180x178.webm",
|
||||
"vp90-2-02-size-180x180.webm", "vp90-2-03-size-196x196.webm",
|
||||
"vp90-2-02-size-66x66.webm", "vp90-2-03-size-196x196.webm",
|
||||
"vp90-2-03-size-196x198.webm", "vp90-2-03-size-196x200.webm",
|
||||
"vp90-2-03-size-196x202.webm", "vp90-2-03-size-196x208.webm",
|
||||
"vp90-2-03-size-196x210.webm", "vp90-2-03-size-196x224.webm",
|
||||
@@ -180,8 +152,7 @@ const char *const kVP9TestVectors[] = {
|
||||
"vp90-2-03-size-226x198.webm", "vp90-2-03-size-226x200.webm",
|
||||
"vp90-2-03-size-226x202.webm", "vp90-2-03-size-226x208.webm",
|
||||
"vp90-2-03-size-226x210.webm", "vp90-2-03-size-226x224.webm",
|
||||
"vp90-2-03-size-226x226.webm", "vp90-2-03-size-352x288.webm",
|
||||
"vp90-2-03-deltaq.webm",
|
||||
"vp90-2-03-size-226x226.webm", "vp90-2-03-deltaq.webm",
|
||||
"vp90-2-05-resize.ivf", "vp90-2-06-bilinear.webm",
|
||||
"vp90-2-07-frame_parallel.webm", "vp90-2-08-tile_1x2_frame_parallel.webm",
|
||||
"vp90-2-08-tile_1x2.webm", "vp90-2-08-tile_1x4_frame_parallel.webm",
|
||||
@@ -211,20 +182,6 @@ const char *const kVP9TestVectors[] = {
|
||||
"vp90-2-14-resize-fp-tiles-4-2.webm", "vp90-2-14-resize-fp-tiles-4-8.webm",
|
||||
"vp90-2-14-resize-fp-tiles-8-16.webm", "vp90-2-14-resize-fp-tiles-8-1.webm",
|
||||
"vp90-2-14-resize-fp-tiles-8-2.webm", "vp90-2-14-resize-fp-tiles-8-4.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-1-2-4-8.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-1-2.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-1-4.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-1-8.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-2-1.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-2-4.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-2-8.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-4-1.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-4-2.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-4-8.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-8-1.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-8-2.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-8-4-2-1.webm",
|
||||
"vp90-2-14-resize-10frames-fp-tiles-8-4.webm",
|
||||
"vp90-2-15-segkey.webm", "vp90-2-15-segkey_adpq.webm",
|
||||
"vp90-2-16-intra-only.webm", "vp90-2-17-show-existing-frame.webm",
|
||||
"vp90-2-18-resize.ivf", "vp90-2-19-skip.webm",
|
||||
@@ -236,16 +193,10 @@ const char *const kVP9TestVectors[] = {
|
||||
"vp93-2-20-10bit-yuv422.webm", "vp93-2-20-12bit-yuv422.webm",
|
||||
"vp93-2-20-10bit-yuv440.webm", "vp93-2-20-12bit-yuv440.webm",
|
||||
"vp93-2-20-10bit-yuv444.webm", "vp93-2-20-12bit-yuv444.webm",
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH`
|
||||
"vp90-2-20-big_superframe-01.webm", "vp90-2-20-big_superframe-02.webm",
|
||||
RESIZE_TEST_VECTORS
|
||||
};
|
||||
const int kNumVP9TestVectors = NELEMENTS(kVP9TestVectors);
|
||||
const char *const kVP9TestVectorsResize[] = {
|
||||
RESIZE_TEST_VECTORS
|
||||
};
|
||||
const int kNumVP9TestVectorsResize = NELEMENTS(kVP9TestVectorsResize);
|
||||
#undef RESIZE_TEST_VECTORS
|
||||
#endif // CONFIG_VP9_DECODER
|
||||
|
||||
} // namespace libvpx_test
|
||||
|
@@ -23,8 +23,6 @@ extern const char *const kVP8TestVectors[];
|
||||
#if CONFIG_VP9_DECODER
|
||||
extern const int kNumVP9TestVectors;
|
||||
extern const char *const kVP9TestVectors[];
|
||||
extern const int kNumVP9TestVectorsResize;
|
||||
extern const char *const kVP9TestVectorsResize[];
|
||||
#endif // CONFIG_VP9_DECODER
|
||||
|
||||
} // namespace libvpx_test
|
||||
|
@@ -104,5 +104,4 @@ TEST_P(TileIndependenceTest, MD5Match) {
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1));
|
||||
|
||||
VP10_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1));
|
||||
} // namespace
|
||||
|
@@ -19,7 +19,8 @@
|
||||
// Macros
|
||||
#define GET_PARAM(k) std::tr1::get< k >(GetParam())
|
||||
|
||||
inline double compute_psnr(const vpx_image_t *img1, const vpx_image_t *img2) {
|
||||
static double compute_psnr(const vpx_image_t *img1,
|
||||
const vpx_image_t *img2) {
|
||||
assert((img1->fmt == img2->fmt) &&
|
||||
(img1->d_w == img2->d_w) &&
|
||||
(img1->d_h == img2->d_h));
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -11,9 +11,6 @@
|
||||
#define TEST_VIDEO_SOURCE_H_
|
||||
|
||||
#if defined(_WIN32)
|
||||
#undef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <cstdio>
|
||||
@@ -51,7 +48,7 @@ static std::string GetDataPath() {
|
||||
#undef TO_STRING
|
||||
#undef STRINGIFY
|
||||
|
||||
inline FILE *OpenTestDataFile(const std::string& file_name) {
|
||||
static FILE *OpenTestDataFile(const std::string& file_name) {
|
||||
const std::string path_to_source = GetDataPath() + "/" + file_name;
|
||||
return fopen(path_to_source.c_str(), "rb");
|
||||
}
|
||||
|
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 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 <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <new>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/util.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "vpx_ports/msvc.h"
|
||||
|
||||
#undef CONFIG_COEFFICIENT_RANGE_CHECKING
|
||||
#define CONFIG_COEFFICIENT_RANGE_CHECKING 1
|
||||
#include "vp10/encoder/dct.c"
|
||||
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
namespace {
|
||||
void reference_dct_1d(const double *in, double *out, int size) {
|
||||
const double PI = 3.141592653589793238462643383279502884;
|
||||
const double kInvSqrt2 = 0.707106781186547524400844362104;
|
||||
for (int k = 0; k < size; ++k) {
|
||||
out[k] = 0;
|
||||
for (int n = 0; n < size; ++n) {
|
||||
out[k] += in[n] * cos(PI * (2 * n + 1) * k / (2 * size));
|
||||
}
|
||||
if (k == 0)
|
||||
out[k] = out[k] * kInvSqrt2;
|
||||
}
|
||||
}
|
||||
|
||||
typedef void (*FdctFuncRef)(const double *in, double *out, int size);
|
||||
typedef void (*IdctFuncRef)(const double *in, double *out, int size);
|
||||
typedef void (*FdctFunc)(const tran_low_t *in, tran_low_t *out);
|
||||
typedef void (*IdctFunc)(const tran_low_t *in, tran_low_t *out);
|
||||
|
||||
class TransTestBase {
|
||||
public:
|
||||
virtual ~TransTestBase() {}
|
||||
|
||||
protected:
|
||||
void RunFwdAccuracyCheck() {
|
||||
tran_low_t *input = new tran_low_t[txfm_size_];
|
||||
tran_low_t *output = new tran_low_t[txfm_size_];
|
||||
double *ref_input = new double[txfm_size_];
|
||||
double *ref_output = new double[txfm_size_];
|
||||
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = 5000;
|
||||
for (int ti = 0; ti < count_test_block; ++ti) {
|
||||
for (int ni = 0; ni < txfm_size_; ++ni) {
|
||||
input[ni] = rnd.Rand8() - rnd.Rand8();
|
||||
ref_input[ni] = static_cast<double>(input[ni]);
|
||||
}
|
||||
|
||||
fwd_txfm_(input, output);
|
||||
fwd_txfm_ref_(ref_input, ref_output, txfm_size_);
|
||||
|
||||
for (int ni = 0; ni < txfm_size_; ++ni) {
|
||||
EXPECT_LE(
|
||||
abs(output[ni] - static_cast<tran_low_t>(round(ref_output[ni]))),
|
||||
max_error_);
|
||||
}
|
||||
}
|
||||
|
||||
delete[] input;
|
||||
delete[] output;
|
||||
delete[] ref_input;
|
||||
delete[] ref_output;
|
||||
}
|
||||
|
||||
double max_error_;
|
||||
int txfm_size_;
|
||||
FdctFunc fwd_txfm_;
|
||||
FdctFuncRef fwd_txfm_ref_;
|
||||
};
|
||||
|
||||
typedef std::tr1::tuple<FdctFunc, FdctFuncRef, int, int> FdctParam;
|
||||
class Vp10FwdTxfm
|
||||
: public TransTestBase,
|
||||
public ::testing::TestWithParam<FdctParam> {
|
||||
public:
|
||||
virtual void SetUp() {
|
||||
fwd_txfm_ = GET_PARAM(0);
|
||||
fwd_txfm_ref_ = GET_PARAM(1);
|
||||
txfm_size_ = GET_PARAM(2);
|
||||
max_error_ = GET_PARAM(3);
|
||||
}
|
||||
virtual void TearDown() {}
|
||||
};
|
||||
|
||||
TEST_P(Vp10FwdTxfm, RunFwdAccuracyCheck) {
|
||||
RunFwdAccuracyCheck();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Vp10FwdTxfm,
|
||||
::testing::Values(
|
||||
FdctParam(&fdct4, &reference_dct_1d, 4, 1),
|
||||
FdctParam(&fdct8, &reference_dct_1d, 8, 1),
|
||||
FdctParam(&fdct16, &reference_dct_1d, 16, 2)));
|
||||
} // namespace
|
@@ -1,321 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013 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 <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vp10_rtcd.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
#include "vp10/common/blockd.h"
|
||||
#include "vp10/common/scan.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
#include "vp10/common/vp10_inv_txfm.h"
|
||||
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
namespace {
|
||||
const double PI = 3.141592653589793238462643383279502884;
|
||||
const double kInvSqrt2 = 0.707106781186547524400844362104;
|
||||
|
||||
void reference_idct_1d(const double *in, double *out, int size) {
|
||||
for (int n = 0; n < size; ++n) {
|
||||
out[n] = 0;
|
||||
for (int k = 0; k < size; ++k) {
|
||||
if (k == 0)
|
||||
out[n] += kInvSqrt2 * in[k] * cos(PI * (2 * n + 1) * k / (2 * size));
|
||||
else
|
||||
out[n] += in[k] * cos(PI * (2 * n + 1) * k / (2 * size));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef void (*IdctFuncRef)(const double *in, double *out, int size);
|
||||
typedef void (*IdctFunc)(const tran_low_t *in, tran_low_t *out);
|
||||
|
||||
class TransTestBase {
|
||||
public:
|
||||
virtual ~TransTestBase() {}
|
||||
|
||||
protected:
|
||||
void RunInvAccuracyCheck() {
|
||||
tran_low_t *input = new tran_low_t[txfm_size_];
|
||||
tran_low_t *output = new tran_low_t[txfm_size_];
|
||||
double *ref_input = new double[txfm_size_];
|
||||
double *ref_output = new double[txfm_size_];
|
||||
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
const int count_test_block = 5000;
|
||||
for (int ti = 0; ti < count_test_block; ++ti) {
|
||||
for (int ni = 0; ni < txfm_size_; ++ni) {
|
||||
input[ni] = rnd.Rand8() - rnd.Rand8();
|
||||
ref_input[ni] = static_cast<double>(input[ni]);
|
||||
}
|
||||
|
||||
fwd_txfm_(input, output);
|
||||
fwd_txfm_ref_(ref_input, ref_output, txfm_size_);
|
||||
|
||||
for (int ni = 0; ni < txfm_size_; ++ni) {
|
||||
EXPECT_LE(
|
||||
abs(output[ni] - static_cast<tran_low_t>(round(ref_output[ni]))),
|
||||
max_error_);
|
||||
}
|
||||
}
|
||||
|
||||
delete[] input;
|
||||
delete[] output;
|
||||
delete[] ref_input;
|
||||
delete[] ref_output;
|
||||
}
|
||||
|
||||
double max_error_;
|
||||
int txfm_size_;
|
||||
IdctFunc fwd_txfm_;
|
||||
IdctFuncRef fwd_txfm_ref_;
|
||||
};
|
||||
|
||||
typedef std::tr1::tuple<IdctFunc, IdctFuncRef, int, int> IdctParam;
|
||||
class Vp10InvTxfm
|
||||
: public TransTestBase,
|
||||
public ::testing::TestWithParam<IdctParam> {
|
||||
public:
|
||||
virtual void SetUp() {
|
||||
fwd_txfm_ = GET_PARAM(0);
|
||||
fwd_txfm_ref_ = GET_PARAM(1);
|
||||
txfm_size_ = GET_PARAM(2);
|
||||
max_error_ = GET_PARAM(3);
|
||||
}
|
||||
virtual void TearDown() {}
|
||||
};
|
||||
|
||||
TEST_P(Vp10InvTxfm, RunInvAccuracyCheck) {
|
||||
RunInvAccuracyCheck();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Vp10InvTxfm,
|
||||
::testing::Values(
|
||||
IdctParam(&vp10_idct4_c, &reference_idct_1d, 4, 1),
|
||||
IdctParam(&vp10_idct8_c, &reference_idct_1d, 8, 2),
|
||||
IdctParam(&vp10_idct16_c, &reference_idct_1d, 16, 4),
|
||||
IdctParam(&vp10_idct32_c, &reference_idct_1d, 32, 6))
|
||||
);
|
||||
|
||||
typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride);
|
||||
typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride);
|
||||
typedef std::tr1::tuple<FwdTxfmFunc,
|
||||
InvTxfmFunc,
|
||||
InvTxfmFunc,
|
||||
TX_SIZE, int> PartialInvTxfmParam;
|
||||
const int kMaxNumCoeffs = 1024;
|
||||
class Vp10PartialIDctTest
|
||||
: public ::testing::TestWithParam<PartialInvTxfmParam> {
|
||||
public:
|
||||
virtual ~Vp10PartialIDctTest() {}
|
||||
virtual void SetUp() {
|
||||
ftxfm_ = GET_PARAM(0);
|
||||
full_itxfm_ = GET_PARAM(1);
|
||||
partial_itxfm_ = GET_PARAM(2);
|
||||
tx_size_ = GET_PARAM(3);
|
||||
last_nonzero_ = GET_PARAM(4);
|
||||
}
|
||||
|
||||
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||
|
||||
protected:
|
||||
int last_nonzero_;
|
||||
TX_SIZE tx_size_;
|
||||
FwdTxfmFunc ftxfm_;
|
||||
InvTxfmFunc full_itxfm_;
|
||||
InvTxfmFunc partial_itxfm_;
|
||||
};
|
||||
|
||||
TEST_P(Vp10PartialIDctTest, RunQuantCheck) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
int size;
|
||||
switch (tx_size_) {
|
||||
case TX_4X4:
|
||||
size = 4;
|
||||
break;
|
||||
case TX_8X8:
|
||||
size = 8;
|
||||
break;
|
||||
case TX_16X16:
|
||||
size = 16;
|
||||
break;
|
||||
case TX_32X32:
|
||||
size = 32;
|
||||
break;
|
||||
default:
|
||||
FAIL() << "Wrong Size!";
|
||||
break;
|
||||
}
|
||||
DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint8_t, dst1[kMaxNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint8_t, dst2[kMaxNumCoeffs]);
|
||||
|
||||
const int count_test_block = 1000;
|
||||
const int block_size = size * size;
|
||||
|
||||
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kMaxNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kMaxNumCoeffs]);
|
||||
|
||||
int max_error = 0;
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
// clear out destination buffer
|
||||
memset(dst1, 0, sizeof(*dst1) * block_size);
|
||||
memset(dst2, 0, sizeof(*dst2) * block_size);
|
||||
memset(test_coef_block1, 0, sizeof(*test_coef_block1) * block_size);
|
||||
memset(test_coef_block2, 0, sizeof(*test_coef_block2) * block_size);
|
||||
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
// Initialize a test block with input range [-255, 255].
|
||||
if (i == 0) {
|
||||
for (int j = 0; j < block_size; ++j)
|
||||
input_extreme_block[j] = 255;
|
||||
} else if (i == 1) {
|
||||
for (int j = 0; j < block_size; ++j)
|
||||
input_extreme_block[j] = -255;
|
||||
} else {
|
||||
for (int j = 0; j < block_size; ++j) {
|
||||
input_extreme_block[j] = rnd.Rand8() % 2 ? 255 : -255;
|
||||
}
|
||||
}
|
||||
|
||||
ftxfm_(input_extreme_block, output_ref_block, size);
|
||||
|
||||
// quantization with maximum allowed step sizes
|
||||
test_coef_block1[0] = (output_ref_block[0] / 1336) * 1336;
|
||||
for (int j = 1; j < last_nonzero_; ++j)
|
||||
test_coef_block1[vp10_default_scan_orders[tx_size_].scan[j]]
|
||||
= (output_ref_block[j] / 1828) * 1828;
|
||||
}
|
||||
|
||||
ASM_REGISTER_STATE_CHECK(full_itxfm_(test_coef_block1, dst1, size));
|
||||
ASM_REGISTER_STATE_CHECK(partial_itxfm_(test_coef_block1, dst2, size));
|
||||
|
||||
for (int j = 0; j < block_size; ++j) {
|
||||
const int diff = dst1[j] - dst2[j];
|
||||
const int error = diff * diff;
|
||||
if (max_error < error)
|
||||
max_error = error;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_EQ(0, max_error)
|
||||
<< "Error: partial inverse transform produces different results";
|
||||
}
|
||||
|
||||
TEST_P(Vp10PartialIDctTest, ResultsMatch) {
|
||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||
int size;
|
||||
switch (tx_size_) {
|
||||
case TX_4X4:
|
||||
size = 4;
|
||||
break;
|
||||
case TX_8X8:
|
||||
size = 8;
|
||||
break;
|
||||
case TX_16X16:
|
||||
size = 16;
|
||||
break;
|
||||
case TX_32X32:
|
||||
size = 32;
|
||||
break;
|
||||
default:
|
||||
FAIL() << "Wrong Size!";
|
||||
break;
|
||||
}
|
||||
DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint8_t, dst1[kMaxNumCoeffs]);
|
||||
DECLARE_ALIGNED(16, uint8_t, dst2[kMaxNumCoeffs]);
|
||||
const int count_test_block = 1000;
|
||||
const int max_coeff = 32766 / 4;
|
||||
const int block_size = size * size;
|
||||
int max_error = 0;
|
||||
for (int i = 0; i < count_test_block; ++i) {
|
||||
// clear out destination buffer
|
||||
memset(dst1, 0, sizeof(*dst1) * block_size);
|
||||
memset(dst2, 0, sizeof(*dst2) * block_size);
|
||||
memset(test_coef_block1, 0, sizeof(*test_coef_block1) * block_size);
|
||||
memset(test_coef_block2, 0, sizeof(*test_coef_block2) * block_size);
|
||||
int max_energy_leftover = max_coeff * max_coeff;
|
||||
for (int j = 0; j < last_nonzero_; ++j) {
|
||||
int16_t coef = static_cast<int16_t>(sqrt(1.0 * max_energy_leftover) *
|
||||
(rnd.Rand16() - 32768) / 65536);
|
||||
max_energy_leftover -= coef * coef;
|
||||
if (max_energy_leftover < 0) {
|
||||
max_energy_leftover = 0;
|
||||
coef = 0;
|
||||
}
|
||||
test_coef_block1[vp10_default_scan_orders[tx_size_].scan[j]] = coef;
|
||||
}
|
||||
|
||||
memcpy(test_coef_block2, test_coef_block1,
|
||||
sizeof(*test_coef_block2) * block_size);
|
||||
|
||||
ASM_REGISTER_STATE_CHECK(full_itxfm_(test_coef_block1, dst1, size));
|
||||
ASM_REGISTER_STATE_CHECK(partial_itxfm_(test_coef_block2, dst2, size));
|
||||
|
||||
for (int j = 0; j < block_size; ++j) {
|
||||
const int diff = dst1[j] - dst2[j];
|
||||
const int error = diff * diff;
|
||||
if (max_error < error)
|
||||
max_error = error;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_EQ(0, max_error)
|
||||
<< "Error: partial inverse transform produces different results";
|
||||
}
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, Vp10PartialIDctTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vp10_idct32x32_1024_add_c,
|
||||
&vp10_idct32x32_34_add_c,
|
||||
TX_32X32, 34),
|
||||
make_tuple(&vpx_fdct32x32_c,
|
||||
&vp10_idct32x32_1024_add_c,
|
||||
&vp10_idct32x32_1_add_c,
|
||||
TX_32X32, 1),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vp10_idct16x16_256_add_c,
|
||||
&vp10_idct16x16_10_add_c,
|
||||
TX_16X16, 10),
|
||||
make_tuple(&vpx_fdct16x16_c,
|
||||
&vp10_idct16x16_256_add_c,
|
||||
&vp10_idct16x16_1_add_c,
|
||||
TX_16X16, 1),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vp10_idct8x8_64_add_c,
|
||||
&vp10_idct8x8_12_add_c,
|
||||
TX_8X8, 12),
|
||||
make_tuple(&vpx_fdct8x8_c,
|
||||
&vp10_idct8x8_64_add_c,
|
||||
&vp10_idct8x8_1_add_c,
|
||||
TX_8X8, 1),
|
||||
make_tuple(&vpx_fdct4x4_c,
|
||||
&vp10_idct4x4_16_add_c,
|
||||
&vp10_idct4x4_1_add_c,
|
||||
TX_4X4, 1)));
|
||||
} // namespace
|
@@ -16,13 +16,13 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "test/acm_random.h"
|
||||
#include "vp8/decoder/dboolhuff.h"
|
||||
#include "vp8/encoder/boolhuff.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
|
||||
#include "vp8/encoder/boolhuff.h"
|
||||
#include "vp8/decoder/dboolhuff.h"
|
||||
|
||||
namespace {
|
||||
const int num_tests = 10;
|
||||
|
||||
|
@@ -15,10 +15,10 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vp8_rtcd.h"
|
||||
|
||||
#include "test/acm_random.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
|
||||
namespace {
|
||||
|
@@ -8,13 +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 "test/codec_factory.h"
|
||||
#include "test/encode_test_driver.h"
|
||||
#include "test/util.h"
|
||||
#include "test/y4m_video_source.h"
|
||||
#include "test/yuv_video_source.h"
|
||||
#include "test/util.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "vp9/encoder/vp9_ratectrl.h"
|
||||
|
||||
namespace {
|
||||
@@ -22,8 +21,8 @@ namespace {
|
||||
const unsigned int kFrames = 100;
|
||||
const int kBitrate = 500;
|
||||
|
||||
#define ARF_NOT_SEEN 1000001
|
||||
#define ARF_SEEN_ONCE 1000000
|
||||
#define ARF_NOT_SEEN 1000001
|
||||
#define ARF_SEEN_ONCE 1000000
|
||||
|
||||
typedef struct {
|
||||
const char *filename;
|
||||
@@ -109,7 +108,7 @@ class ArfFreqTest
|
||||
}
|
||||
|
||||
virtual void BeginPassHook(unsigned int) {
|
||||
min_run_ = ARF_NOT_SEEN;
|
||||
min_arf_ = ARF_NOT_SEEN;
|
||||
run_of_visible_frames_ = 0;
|
||||
}
|
||||
|
||||
@@ -138,15 +137,15 @@ class ArfFreqTest
|
||||
if (frames == 1) {
|
||||
run_of_visible_frames_++;
|
||||
} else if (frames == 2) {
|
||||
if (min_run_ == ARF_NOT_SEEN) {
|
||||
min_run_ = ARF_SEEN_ONCE;
|
||||
} else if (min_run_ == ARF_SEEN_ONCE ||
|
||||
run_of_visible_frames_ < min_run_) {
|
||||
min_run_ = run_of_visible_frames_;
|
||||
if (min_arf_ == ARF_NOT_SEEN) {
|
||||
min_arf_ = ARF_SEEN_ONCE;
|
||||
} else if (min_arf_ == ARF_SEEN_ONCE ||
|
||||
run_of_visible_frames_ < min_arf_) {
|
||||
min_arf_ = run_of_visible_frames_;
|
||||
}
|
||||
run_of_visible_frames_ = 1;
|
||||
} else {
|
||||
min_run_ = 0;
|
||||
min_arf_ = 0;
|
||||
run_of_visible_frames_ = 1;
|
||||
}
|
||||
}
|
||||
@@ -167,8 +166,8 @@ class ArfFreqTest
|
||||
}
|
||||
}
|
||||
|
||||
int GetMinVisibleRun() const {
|
||||
return min_run_;
|
||||
int GetMinArfDistance() const {
|
||||
return min_arf_;
|
||||
}
|
||||
|
||||
int GetMinArfDistanceRequested() const {
|
||||
@@ -186,7 +185,7 @@ class ArfFreqTest
|
||||
|
||||
private:
|
||||
int min_arf_requested_;
|
||||
int min_run_;
|
||||
int min_arf_;
|
||||
int run_of_visible_frames_;
|
||||
};
|
||||
|
||||
@@ -215,10 +214,9 @@ TEST_P(ArfFreqTest, MinArfFreqTest) {
|
||||
}
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
||||
const int min_run = GetMinVisibleRun();
|
||||
const int min_arf_dist = GetMinArfDistance();
|
||||
const int min_arf_dist_requested = GetMinArfDistanceRequested();
|
||||
if (min_run != ARF_NOT_SEEN && min_run != ARF_SEEN_ONCE) {
|
||||
const int min_arf_dist = min_run + 1;
|
||||
if (min_arf_dist != ARF_NOT_SEEN && min_arf_dist != ARF_SEEN_ONCE) {
|
||||
EXPECT_GE(min_arf_dist, min_arf_dist_requested);
|
||||
}
|
||||
delete(video);
|
||||
@@ -229,24 +227,4 @@ VP9_INSTANTIATE_TEST_CASE(
|
||||
::testing::ValuesIn(kTestVectors),
|
||||
::testing::ValuesIn(kEncodeVectors),
|
||||
::testing::ValuesIn(kMinArfVectors));
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
# if CONFIG_VP10_ENCODER
|
||||
// TODO(angiebird): 25-29 fail in high bitdepth mode.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
DISABLED_VP10, ArfFreqTest,
|
||||
::testing::Combine(
|
||||
::testing::Values(static_cast<const libvpx_test::CodecFactory *>(
|
||||
&libvpx_test::kVP10)),
|
||||
::testing::ValuesIn(kTestVectors),
|
||||
::testing::ValuesIn(kEncodeVectors),
|
||||
::testing::ValuesIn(kMinArfVectors)));
|
||||
# endif // CONFIG_VP10_ENCODER
|
||||
#else
|
||||
VP10_INSTANTIATE_TEST_CASE(
|
||||
ArfFreqTest,
|
||||
::testing::ValuesIn(kTestVectors),
|
||||
::testing::ValuesIn(kEncodeVectors),
|
||||
::testing::ValuesIn(kMinArfVectors));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
@@ -8,20 +8,22 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#if CONFIG_VP9_ENCODER
|
||||
#include "./vp9_rtcd.h"
|
||||
#endif
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
@@ -55,19 +57,19 @@ class AverageTestBase : public ::testing::Test {
|
||||
}
|
||||
|
||||
// Sum Pixels
|
||||
unsigned int ReferenceAverage8x8(const uint8_t* source, int pitch) {
|
||||
unsigned int ReferenceAverage8x8(const uint8_t* source, int pitch ) {
|
||||
unsigned int average = 0;
|
||||
for (int h = 0; h < 8; ++h)
|
||||
for (int w = 0; w < 8; ++w)
|
||||
average += source[h * pitch + w];
|
||||
average += source[h * source_stride_ + w];
|
||||
return ((average + 32) >> 6);
|
||||
}
|
||||
|
||||
unsigned int ReferenceAverage4x4(const uint8_t* source, int pitch) {
|
||||
unsigned int ReferenceAverage4x4(const uint8_t* source, int pitch ) {
|
||||
unsigned int average = 0;
|
||||
for (int h = 0; h < 4; ++h)
|
||||
for (int w = 0; w < 4; ++w)
|
||||
average += source[h * pitch + w];
|
||||
average += source[h * source_stride_ + w];
|
||||
return ((average + 8) >> 4);
|
||||
}
|
||||
|
||||
@@ -192,48 +194,6 @@ class IntProColTest
|
||||
int16_t sum_c_;
|
||||
};
|
||||
|
||||
typedef int (*SatdFunc)(const int16_t *coeffs, int length);
|
||||
typedef std::tr1::tuple<int, SatdFunc> SatdTestParam;
|
||||
|
||||
class SatdTest
|
||||
: public ::testing::Test,
|
||||
public ::testing::WithParamInterface<SatdTestParam> {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
satd_size_ = GET_PARAM(0);
|
||||
satd_func_ = GET_PARAM(1);
|
||||
rnd_.Reset(ACMRandom::DeterministicSeed());
|
||||
src_ = reinterpret_cast<int16_t*>(
|
||||
vpx_memalign(16, sizeof(*src_) * satd_size_));
|
||||
ASSERT_TRUE(src_ != NULL);
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
libvpx_test::ClearSystemState();
|
||||
vpx_free(src_);
|
||||
}
|
||||
|
||||
void FillConstant(const int16_t val) {
|
||||
for (int i = 0; i < satd_size_; ++i) src_[i] = val;
|
||||
}
|
||||
|
||||
void FillRandom() {
|
||||
for (int i = 0; i < satd_size_; ++i) src_[i] = rnd_.Rand16();
|
||||
}
|
||||
|
||||
void Check(const int expected) {
|
||||
int total;
|
||||
ASM_REGISTER_STATE_CHECK(total = satd_func_(src_, satd_size_));
|
||||
EXPECT_EQ(expected, total);
|
||||
}
|
||||
|
||||
int satd_size_;
|
||||
|
||||
private:
|
||||
int16_t *src_;
|
||||
SatdFunc satd_func_;
|
||||
ACMRandom rnd_;
|
||||
};
|
||||
|
||||
uint8_t* AverageTestBase::source_data_ = NULL;
|
||||
|
||||
@@ -286,126 +246,58 @@ TEST_P(IntProColTest, Random) {
|
||||
RunComparison();
|
||||
}
|
||||
|
||||
|
||||
TEST_P(SatdTest, MinValue) {
|
||||
const int kMin = -32640;
|
||||
const int expected = -kMin * satd_size_;
|
||||
FillConstant(kMin);
|
||||
Check(expected);
|
||||
}
|
||||
|
||||
TEST_P(SatdTest, MaxValue) {
|
||||
const int kMax = 32640;
|
||||
const int expected = kMax * satd_size_;
|
||||
FillConstant(kMax);
|
||||
Check(expected);
|
||||
}
|
||||
|
||||
TEST_P(SatdTest, Random) {
|
||||
int expected;
|
||||
switch (satd_size_) {
|
||||
case 16: expected = 205298; break;
|
||||
case 64: expected = 1113950; break;
|
||||
case 256: expected = 4268415; break;
|
||||
case 1024: expected = 16954082; break;
|
||||
default:
|
||||
FAIL() << "Invalid satd size (" << satd_size_
|
||||
<< ") valid: 16/64/256/1024";
|
||||
}
|
||||
FillRandom();
|
||||
Check(expected);
|
||||
}
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, AverageTest,
|
||||
::testing::Values(
|
||||
make_tuple(16, 16, 1, 8, &vpx_avg_8x8_c),
|
||||
make_tuple(16, 16, 1, 4, &vpx_avg_4x4_c)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
C, SatdTest,
|
||||
::testing::Values(
|
||||
make_tuple(16, &vpx_satd_c),
|
||||
make_tuple(64, &vpx_satd_c),
|
||||
make_tuple(256, &vpx_satd_c),
|
||||
make_tuple(1024, &vpx_satd_c)));
|
||||
make_tuple(16, 16, 1, 8, &vp9_avg_8x8_c),
|
||||
make_tuple(16, 16, 1, 4, &vp9_avg_4x4_c)));
|
||||
|
||||
#if HAVE_SSE2
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, AverageTest,
|
||||
::testing::Values(
|
||||
make_tuple(16, 16, 0, 8, &vpx_avg_8x8_sse2),
|
||||
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_sse2),
|
||||
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_sse2),
|
||||
make_tuple(16, 16, 0, 4, &vpx_avg_4x4_sse2),
|
||||
make_tuple(16, 16, 5, 4, &vpx_avg_4x4_sse2),
|
||||
make_tuple(32, 32, 15, 4, &vpx_avg_4x4_sse2)));
|
||||
make_tuple(16, 16, 0, 8, &vp9_avg_8x8_sse2),
|
||||
make_tuple(16, 16, 5, 8, &vp9_avg_8x8_sse2),
|
||||
make_tuple(32, 32, 15, 8, &vp9_avg_8x8_sse2),
|
||||
make_tuple(16, 16, 0, 4, &vp9_avg_4x4_sse2),
|
||||
make_tuple(16, 16, 5, 4, &vp9_avg_4x4_sse2),
|
||||
make_tuple(32, 32, 15, 4, &vp9_avg_4x4_sse2)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, IntProRowTest, ::testing::Values(
|
||||
make_tuple(16, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
|
||||
make_tuple(32, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
|
||||
make_tuple(64, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c)));
|
||||
make_tuple(16, &vp9_int_pro_row_sse2, &vp9_int_pro_row_c),
|
||||
make_tuple(32, &vp9_int_pro_row_sse2, &vp9_int_pro_row_c),
|
||||
make_tuple(64, &vp9_int_pro_row_sse2, &vp9_int_pro_row_c)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, IntProColTest, ::testing::Values(
|
||||
make_tuple(16, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
|
||||
make_tuple(32, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
|
||||
make_tuple(64, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, SatdTest,
|
||||
::testing::Values(
|
||||
make_tuple(16, &vpx_satd_sse2),
|
||||
make_tuple(64, &vpx_satd_sse2),
|
||||
make_tuple(256, &vpx_satd_sse2),
|
||||
make_tuple(1024, &vpx_satd_sse2)));
|
||||
make_tuple(16, &vp9_int_pro_col_sse2, &vp9_int_pro_col_c),
|
||||
make_tuple(32, &vp9_int_pro_col_sse2, &vp9_int_pro_col_c),
|
||||
make_tuple(64, &vp9_int_pro_col_sse2, &vp9_int_pro_col_c)));
|
||||
#endif
|
||||
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, AverageTest,
|
||||
::testing::Values(
|
||||
make_tuple(16, 16, 0, 8, &vpx_avg_8x8_neon),
|
||||
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_neon),
|
||||
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_neon),
|
||||
make_tuple(16, 16, 0, 4, &vpx_avg_4x4_neon),
|
||||
make_tuple(16, 16, 5, 4, &vpx_avg_4x4_neon),
|
||||
make_tuple(32, 32, 15, 4, &vpx_avg_4x4_neon)));
|
||||
make_tuple(16, 16, 0, 8, &vp9_avg_8x8_neon),
|
||||
make_tuple(16, 16, 5, 8, &vp9_avg_8x8_neon),
|
||||
make_tuple(32, 32, 15, 8, &vp9_avg_8x8_neon)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, IntProRowTest, ::testing::Values(
|
||||
make_tuple(16, &vpx_int_pro_row_neon, &vpx_int_pro_row_c),
|
||||
make_tuple(32, &vpx_int_pro_row_neon, &vpx_int_pro_row_c),
|
||||
make_tuple(64, &vpx_int_pro_row_neon, &vpx_int_pro_row_c)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, IntProColTest, ::testing::Values(
|
||||
make_tuple(16, &vpx_int_pro_col_neon, &vpx_int_pro_col_c),
|
||||
make_tuple(32, &vpx_int_pro_col_neon, &vpx_int_pro_col_c),
|
||||
make_tuple(64, &vpx_int_pro_col_neon, &vpx_int_pro_col_c)));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, SatdTest,
|
||||
::testing::Values(
|
||||
make_tuple(16, &vpx_satd_neon),
|
||||
make_tuple(64, &vpx_satd_neon),
|
||||
make_tuple(256, &vpx_satd_neon),
|
||||
make_tuple(1024, &vpx_satd_neon)));
|
||||
#endif
|
||||
|
||||
#if HAVE_MSA
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
MSA, AverageTest,
|
||||
::testing::Values(
|
||||
make_tuple(16, 16, 0, 8, &vpx_avg_8x8_msa),
|
||||
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_msa),
|
||||
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_msa),
|
||||
make_tuple(16, 16, 0, 4, &vpx_avg_4x4_msa),
|
||||
make_tuple(16, 16, 5, 4, &vpx_avg_4x4_msa),
|
||||
make_tuple(32, 32, 15, 4, &vpx_avg_4x4_msa)));
|
||||
make_tuple(16, 16, 0, 8, &vp9_avg_8x8_msa),
|
||||
make_tuple(16, 16, 5, 8, &vp9_avg_8x8_msa),
|
||||
make_tuple(32, 32, 15, 8, &vp9_avg_8x8_msa),
|
||||
make_tuple(16, 16, 0, 4, &vp9_avg_4x4_msa),
|
||||
make_tuple(16, 16, 5, 4, &vp9_avg_4x4_msa),
|
||||
make_tuple(32, 32, 15, 4, &vp9_avg_4x4_msa)));
|
||||
#endif
|
||||
|
||||
} // namespace
|
@@ -14,10 +14,11 @@
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "vp9/decoder/vp9_reader.h"
|
||||
#include "vp9/encoder/vp9_writer.h"
|
||||
|
||||
#include "test/acm_random.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
#include "vpx_dsp/bitreader.h"
|
||||
#include "vpx_dsp/bitwriter.h"
|
||||
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
@@ -49,9 +50,9 @@ TEST(VP9, TestBitIO) {
|
||||
const int random_seed = 6432;
|
||||
const int kBufferSize = 10000;
|
||||
ACMRandom bit_rnd(random_seed);
|
||||
vpx_writer bw;
|
||||
vp9_writer bw;
|
||||
uint8_t bw_buffer[kBufferSize];
|
||||
vpx_start_encode(&bw, bw_buffer);
|
||||
vp9_start_encode(&bw, bw_buffer);
|
||||
|
||||
int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
|
||||
for (int i = 0; i < kBitsToTest; ++i) {
|
||||
@@ -60,16 +61,16 @@ TEST(VP9, TestBitIO) {
|
||||
} else if (bit_method == 3) {
|
||||
bit = bit_rnd(2);
|
||||
}
|
||||
vpx_write(&bw, bit, static_cast<int>(probas[i]));
|
||||
vp9_write(&bw, bit, static_cast<int>(probas[i]));
|
||||
}
|
||||
|
||||
vpx_stop_encode(&bw);
|
||||
vp9_stop_encode(&bw);
|
||||
|
||||
// First bit should be zero
|
||||
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
|
||||
|
||||
vpx_reader br;
|
||||
vpx_reader_init(&br, bw_buffer, kBufferSize, NULL, NULL);
|
||||
vp9_reader br;
|
||||
vp9_reader_init(&br, bw_buffer, kBufferSize, NULL, NULL);
|
||||
bit_rnd.Reset(random_seed);
|
||||
for (int i = 0; i < kBitsToTest; ++i) {
|
||||
if (bit_method == 2) {
|
||||
@@ -77,7 +78,7 @@ TEST(VP9, TestBitIO) {
|
||||
} else if (bit_method == 3) {
|
||||
bit = bit_rnd(2);
|
||||
}
|
||||
GTEST_ASSERT_EQ(vpx_read(&br, probas[i]), bit)
|
||||
GTEST_ASSERT_EQ(vp9_read(&br, probas[i]), bit)
|
||||
<< "pos: " << i << " / " << kBitsToTest
|
||||
<< " bit_method: " << bit_method
|
||||
<< " method: " << method;
|
||||
|
@@ -94,7 +94,8 @@ TEST_P(VP9DenoiserTest, BitexactCheck) {
|
||||
// Test for all block size.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, VP9DenoiserTest,
|
||||
::testing::Values(BLOCK_8X8, BLOCK_8X16, BLOCK_16X8, BLOCK_16X16,
|
||||
BLOCK_16X32, BLOCK_32X16, BLOCK_32X32, BLOCK_32X64,
|
||||
BLOCK_64X32, BLOCK_64X64));
|
||||
::testing::Values(BLOCK_4X4, BLOCK_4X8, BLOCK_8X4, BLOCK_8X8,
|
||||
BLOCK_8X16, BLOCK_16X8, BLOCK_16X16, BLOCK_16X32,
|
||||
BLOCK_32X16, BLOCK_32X32, BLOCK_32X64, BLOCK_64X32,
|
||||
BLOCK_64X64));
|
||||
} // namespace
|
||||
|
@@ -8,16 +8,43 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "test/codec_factory.h"
|
||||
#include "test/encode_test_driver.h"
|
||||
#include "test/util.h"
|
||||
#include "test/y4m_video_source.h"
|
||||
#include "vp9/vp9_dx_iface.h"
|
||||
#include "test/yuv_video_source.h"
|
||||
#include "test/util.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "vp9/decoder/vp9_decoder.h"
|
||||
|
||||
typedef vpx_codec_stream_info_t vp9_stream_info_t;
|
||||
struct vpx_codec_alg_priv {
|
||||
vpx_codec_priv_t base;
|
||||
vpx_codec_dec_cfg_t cfg;
|
||||
vp9_stream_info_t si;
|
||||
struct VP9Decoder *pbi;
|
||||
int postproc_cfg_set;
|
||||
vp8_postproc_cfg_t postproc_cfg;
|
||||
vpx_decrypt_cb decrypt_cb;
|
||||
void *decrypt_state;
|
||||
vpx_image_t img;
|
||||
int img_avail;
|
||||
int flushed;
|
||||
int invert_tile_order;
|
||||
int frame_parallel_decode;
|
||||
|
||||
// External frame buffer info to save for VP9 common.
|
||||
void *ext_priv; // Private data associated with the external frame buffers.
|
||||
vpx_get_frame_buffer_cb_fn_t get_ext_fb_cb;
|
||||
vpx_release_frame_buffer_cb_fn_t release_ext_fb_cb;
|
||||
};
|
||||
|
||||
static vpx_codec_alg_priv_t *get_alg_priv(vpx_codec_ctx_t *ctx) {
|
||||
return (vpx_codec_alg_priv_t *)ctx->priv;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
const unsigned int kFramerate = 50;
|
||||
const int kCpuUsed = 2;
|
||||
|
||||
struct EncodePerfTestVideo {
|
||||
@@ -38,29 +65,37 @@ struct EncodeParameters {
|
||||
int32_t lossless;
|
||||
int32_t error_resilient;
|
||||
int32_t frame_parallel;
|
||||
vpx_color_range_t color_range;
|
||||
vpx_color_space_t cs;
|
||||
int render_size[2];
|
||||
// TODO(JBB): quantizers / bitrate
|
||||
};
|
||||
|
||||
const EncodeParameters kVP9EncodeParameterSet[] = {
|
||||
{0, 0, 0, 1, 0, VPX_CR_STUDIO_RANGE, VPX_CS_BT_601, { 0, 0 }},
|
||||
{0, 0, 0, 0, 0, VPX_CR_FULL_RANGE, VPX_CS_BT_709, { 0, 0 }},
|
||||
{0, 0, 1, 0, 0, VPX_CR_FULL_RANGE, VPX_CS_BT_2020, { 0, 0 }},
|
||||
{0, 2, 0, 0, 1, VPX_CR_STUDIO_RANGE, VPX_CS_UNKNOWN, { 640, 480 }},
|
||||
// TODO(JBB): Test profiles (requires more work).
|
||||
{0, 0, 0, 1, 0, VPX_CS_BT_601},
|
||||
{0, 0, 0, 0, 0, VPX_CS_BT_709},
|
||||
{0, 0, 1, 0, 0, VPX_CS_BT_2020},
|
||||
{0, 2, 0, 0, 1, VPX_CS_UNKNOWN},
|
||||
// TODO(JBB): Test profiles (requires more work).
|
||||
};
|
||||
|
||||
class VpxEncoderParmsGetToDecoder
|
||||
int is_extension_y4m(const char *filename) {
|
||||
const char *dot = strrchr(filename, '.');
|
||||
if (!dot || dot == filename)
|
||||
return 0;
|
||||
else
|
||||
return !strcmp(dot, ".y4m");
|
||||
}
|
||||
|
||||
class Vp9EncoderParmsGetToDecoder
|
||||
: public ::libvpx_test::EncoderTest,
|
||||
public ::libvpx_test::CodecTestWith2Params<EncodeParameters,
|
||||
public ::libvpx_test::CodecTestWith2Params<EncodeParameters, \
|
||||
EncodePerfTestVideo> {
|
||||
protected:
|
||||
VpxEncoderParmsGetToDecoder()
|
||||
: EncoderTest(GET_PARAM(0)), encode_parms(GET_PARAM(1)) {}
|
||||
Vp9EncoderParmsGetToDecoder()
|
||||
: EncoderTest(GET_PARAM(0)),
|
||||
encode_parms(GET_PARAM(1)) {
|
||||
}
|
||||
|
||||
virtual ~VpxEncoderParmsGetToDecoder() {}
|
||||
virtual ~Vp9EncoderParmsGetToDecoder() {}
|
||||
|
||||
virtual void SetUp() {
|
||||
InitializeConfig();
|
||||
@@ -76,7 +111,6 @@ class VpxEncoderParmsGetToDecoder
|
||||
::libvpx_test::Encoder *encoder) {
|
||||
if (video->frame() == 1) {
|
||||
encoder->Control(VP9E_SET_COLOR_SPACE, encode_parms.cs);
|
||||
encoder->Control(VP9E_SET_COLOR_RANGE, encode_parms.color_range);
|
||||
encoder->Control(VP9E_SET_LOSSLESS, encode_parms.lossless);
|
||||
encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING,
|
||||
encode_parms.frame_parallel);
|
||||
@@ -87,44 +121,37 @@ class VpxEncoderParmsGetToDecoder
|
||||
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
|
||||
encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
|
||||
encoder->Control(VP8E_SET_ARNR_TYPE, 3);
|
||||
if (encode_parms.render_size[0] > 0 && encode_parms.render_size[1] > 0)
|
||||
encoder->Control(VP9E_SET_RENDER_SIZE, encode_parms.render_size);
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
|
||||
const libvpx_test::VideoSource & /*video*/,
|
||||
const libvpx_test::VideoSource& video,
|
||||
libvpx_test::Decoder *decoder) {
|
||||
vpx_codec_ctx_t *const vp9_decoder = decoder->GetDecoder();
|
||||
vpx_codec_alg_priv_t *const priv =
|
||||
reinterpret_cast<vpx_codec_alg_priv_t *>(vp9_decoder->priv);
|
||||
FrameWorkerData *const worker_data =
|
||||
reinterpret_cast<FrameWorkerData *>(priv->frame_workers[0].data1);
|
||||
VP9_COMMON *const common = &worker_data->pbi->common;
|
||||
vpx_codec_ctx_t* vp9_decoder = decoder->GetDecoder();
|
||||
vpx_codec_alg_priv_t* priv =
|
||||
(vpx_codec_alg_priv_t*) get_alg_priv(vp9_decoder);
|
||||
|
||||
VP9Decoder* pbi = priv->pbi;
|
||||
VP9_COMMON* common = &pbi->common;
|
||||
|
||||
if (encode_parms.lossless) {
|
||||
EXPECT_EQ(0, common->base_qindex);
|
||||
EXPECT_EQ(0, common->y_dc_delta_q);
|
||||
EXPECT_EQ(0, common->uv_dc_delta_q);
|
||||
EXPECT_EQ(0, common->uv_ac_delta_q);
|
||||
EXPECT_EQ(ONLY_4X4, common->tx_mode);
|
||||
EXPECT_EQ(common->base_qindex, 0);
|
||||
EXPECT_EQ(common->y_dc_delta_q, 0);
|
||||
EXPECT_EQ(common->uv_dc_delta_q, 0);
|
||||
EXPECT_EQ(common->uv_ac_delta_q, 0);
|
||||
EXPECT_EQ(common->tx_mode, ONLY_4X4);
|
||||
}
|
||||
EXPECT_EQ(encode_parms.error_resilient, common->error_resilient_mode);
|
||||
EXPECT_EQ(common->error_resilient_mode, encode_parms.error_resilient);
|
||||
if (encode_parms.error_resilient) {
|
||||
EXPECT_EQ(1, common->frame_parallel_decoding_mode);
|
||||
EXPECT_EQ(0, common->use_prev_frame_mvs);
|
||||
EXPECT_EQ(common->frame_parallel_decoding_mode, 1);
|
||||
EXPECT_EQ(common->use_prev_frame_mvs, 0);
|
||||
} else {
|
||||
EXPECT_EQ(encode_parms.frame_parallel,
|
||||
common->frame_parallel_decoding_mode);
|
||||
EXPECT_EQ(common->frame_parallel_decoding_mode,
|
||||
encode_parms.frame_parallel);
|
||||
}
|
||||
EXPECT_EQ(encode_parms.color_range, common->color_range);
|
||||
EXPECT_EQ(encode_parms.cs, common->color_space);
|
||||
if (encode_parms.render_size[0] > 0 && encode_parms.render_size[1] > 0) {
|
||||
EXPECT_EQ(encode_parms.render_size[0], common->render_width);
|
||||
EXPECT_EQ(encode_parms.render_size[1], common->render_height);
|
||||
}
|
||||
EXPECT_EQ(encode_parms.tile_cols, common->log2_tile_cols);
|
||||
EXPECT_EQ(encode_parms.tile_rows, common->log2_tile_rows);
|
||||
EXPECT_EQ(common->color_space, encode_parms.cs);
|
||||
EXPECT_EQ(common->log2_tile_cols, encode_parms.tile_cols);
|
||||
EXPECT_EQ(common->log2_tile_rows, encode_parms.tile_rows);
|
||||
|
||||
EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
|
||||
return VPX_CODEC_OK == res_dec;
|
||||
@@ -136,18 +163,31 @@ class VpxEncoderParmsGetToDecoder
|
||||
EncodeParameters encode_parms;
|
||||
};
|
||||
|
||||
TEST_P(VpxEncoderParmsGetToDecoder, BitstreamParms) {
|
||||
// TODO(hkuang): This test conflicts with frame parallel decode. So disable it
|
||||
// for now until fix.
|
||||
TEST_P(Vp9EncoderParmsGetToDecoder, DISABLED_BitstreamParms) {
|
||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||
|
||||
libvpx_test::VideoSource *const video =
|
||||
new libvpx_test::Y4mVideoSource(test_video_.name, 0, test_video_.frames);
|
||||
ASSERT_TRUE(video != NULL);
|
||||
libvpx_test::VideoSource *video;
|
||||
if (is_extension_y4m(test_video_.name)) {
|
||||
video = new libvpx_test::Y4mVideoSource(test_video_.name,
|
||||
0, test_video_.frames);
|
||||
} else {
|
||||
video = new libvpx_test::YUVVideoSource(test_video_.name,
|
||||
VPX_IMG_FMT_I420,
|
||||
test_video_.width,
|
||||
test_video_.height,
|
||||
kFramerate, 1, 0,
|
||||
test_video_.frames);
|
||||
}
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
||||
delete video;
|
||||
delete(video);
|
||||
}
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(VpxEncoderParmsGetToDecoder,
|
||||
::testing::ValuesIn(kVP9EncodeParameterSet),
|
||||
::testing::ValuesIn(kVP9EncodePerfTestVectors));
|
||||
VP9_INSTANTIATE_TEST_CASE(
|
||||
Vp9EncoderParmsGetToDecoder,
|
||||
::testing::ValuesIn(kVP9EncodeParameterSet),
|
||||
::testing::ValuesIn(kVP9EncodePerfTestVectors));
|
||||
|
||||
} // namespace
|
||||
|
@@ -8,13 +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 "test/codec_factory.h"
|
||||
#include "test/encode_test_driver.h"
|
||||
#include "test/util.h"
|
||||
#include "test/y4m_video_source.h"
|
||||
#include "test/yuv_video_source.h"
|
||||
#include "test/util.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -187,23 +186,4 @@ VP9_INSTANTIATE_TEST_CASE(
|
||||
::testing::ValuesIn(kTestVectors),
|
||||
::testing::ValuesIn(kCpuUsedVectors));
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
# if CONFIG_VP10_ENCODER
|
||||
// TODO(angiebird): many fail in high bitdepth mode.
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
DISABLED_VP10, EndToEndTestLarge,
|
||||
::testing::Combine(
|
||||
::testing::Values(static_cast<const libvpx_test::CodecFactory *>(
|
||||
&libvpx_test::kVP10)),
|
||||
::testing::ValuesIn(kEncodingModeVectors),
|
||||
::testing::ValuesIn(kTestVectors),
|
||||
::testing::ValuesIn(kCpuUsedVectors)));
|
||||
# endif // CONFIG_VP10_ENCODER
|
||||
#else
|
||||
VP10_INSTANTIATE_TEST_CASE(
|
||||
EndToEndTestLarge,
|
||||
::testing::ValuesIn(kEncodingModeVectors),
|
||||
::testing::ValuesIn(kTestVectors),
|
||||
::testing::ValuesIn(kCpuUsedVectors));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
@@ -14,12 +14,12 @@
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_entropy.h"
|
||||
#include "vpx/vpx_codec.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
@@ -67,22 +67,12 @@ TEST_P(ErrorBlockTest, OperationCheck) {
|
||||
int64_t ret;
|
||||
int64_t ref_ssz;
|
||||
int64_t ref_ret;
|
||||
const int msb = bit_depth_ + 8 - 1;
|
||||
for (int i = 0; i < kNumIterations; ++i) {
|
||||
int err_count = 0;
|
||||
block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64
|
||||
for (int j = 0; j < block_size; j++) {
|
||||
// coeff and dqcoeff will always have at least the same sign, and this
|
||||
// can be used for optimization, so generate test input precisely.
|
||||
if (rnd(2)) {
|
||||
// Positive number
|
||||
coeff[j] = rnd(1 << msb);
|
||||
dqcoeff[j] = rnd(1 << msb);
|
||||
} else {
|
||||
// Negative number
|
||||
coeff[j] = -rnd(1 << msb);
|
||||
dqcoeff[j] = -rnd(1 << msb);
|
||||
}
|
||||
coeff[j] = rnd(2 << 20) - (1 << 20);
|
||||
dqcoeff[j] = rnd(2 << 20) - (1 << 20);
|
||||
}
|
||||
ref_ret = ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz,
|
||||
bit_depth_);
|
||||
@@ -95,7 +85,7 @@ TEST_P(ErrorBlockTest, OperationCheck) {
|
||||
err_count_total += err_count;
|
||||
}
|
||||
EXPECT_EQ(0, err_count_total)
|
||||
<< "Error: Error Block Test, C output doesn't match optimized output. "
|
||||
<< "Error: Error Block Test, C output doesn't match SSE2 output. "
|
||||
<< "First failed at test case " << first_failure;
|
||||
}
|
||||
|
||||
@@ -110,36 +100,23 @@ TEST_P(ErrorBlockTest, ExtremeValues) {
|
||||
int64_t ret;
|
||||
int64_t ref_ssz;
|
||||
int64_t ref_ret;
|
||||
const int msb = bit_depth_ + 8 - 1;
|
||||
int max_val = ((1 << msb) - 1);
|
||||
int max_val = ((1 << 20) - 1);
|
||||
for (int i = 0; i < kNumIterations; ++i) {
|
||||
int err_count = 0;
|
||||
int k = (i / 9) % 9;
|
||||
int k = (i / 9) % 5;
|
||||
|
||||
// Change the maximum coeff value, to test different bit boundaries
|
||||
if ( k == 8 && (i % 9) == 0 ) {
|
||||
if ( k == 4 && (i % 9) == 0 ) {
|
||||
max_val >>= 1;
|
||||
}
|
||||
block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64
|
||||
for (int j = 0; j < block_size; j++) {
|
||||
if (k < 4) {
|
||||
// Test at positive maximum values
|
||||
coeff[j] = k % 2 ? max_val : 0;
|
||||
dqcoeff[j] = (k >> 1) % 2 ? max_val : 0;
|
||||
} else if (k < 8) {
|
||||
// Test at negative maximum values
|
||||
coeff[j] = k % 2 ? -max_val : 0;
|
||||
dqcoeff[j] = (k >> 1) % 2 ? -max_val : 0;
|
||||
if (k < 4) { // Test at maximum values
|
||||
coeff[j] = k % 2 ? max_val : -max_val;
|
||||
dqcoeff[j] = (k >> 1) % 2 ? max_val : -max_val;
|
||||
} else {
|
||||
if (rnd(2)) {
|
||||
// Positive number
|
||||
coeff[j] = rnd(1 << 14);
|
||||
dqcoeff[j] = rnd(1 << 14);
|
||||
} else {
|
||||
// Negative number
|
||||
coeff[j] = -rnd(1 << 14);
|
||||
dqcoeff[j] = -rnd(1 << 14);
|
||||
}
|
||||
coeff[j] = rnd(2 << 14) - (1 << 14);
|
||||
dqcoeff[j] = rnd(2 << 14) - (1 << 14);
|
||||
}
|
||||
}
|
||||
ref_ret = ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz,
|
||||
@@ -153,30 +130,13 @@ TEST_P(ErrorBlockTest, ExtremeValues) {
|
||||
err_count_total += err_count;
|
||||
}
|
||||
EXPECT_EQ(0, err_count_total)
|
||||
<< "Error: Error Block Test, C output doesn't match optimized output. "
|
||||
<< "Error: Error Block Test, C output doesn't match SSE2 output. "
|
||||
<< "First failed at test case " << first_failure;
|
||||
}
|
||||
|
||||
using std::tr1::make_tuple;
|
||||
|
||||
#if CONFIG_USE_X86INC
|
||||
int64_t wrap_vp9_highbd_block_error_8bit_c(const tran_low_t *coeff,
|
||||
const tran_low_t *dqcoeff,
|
||||
intptr_t block_size,
|
||||
int64_t *ssz, int bps) {
|
||||
EXPECT_EQ(8, bps);
|
||||
return vp9_highbd_block_error_8bit_c(coeff, dqcoeff, block_size, ssz);
|
||||
}
|
||||
|
||||
#if HAVE_SSE2
|
||||
int64_t wrap_vp9_highbd_block_error_8bit_sse2(const tran_low_t *coeff,
|
||||
const tran_low_t *dqcoeff,
|
||||
intptr_t block_size,
|
||||
int64_t *ssz, int bps) {
|
||||
EXPECT_EQ(8, bps);
|
||||
return vp9_highbd_block_error_8bit_sse2(coeff, dqcoeff, block_size, ssz);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, ErrorBlockTest,
|
||||
::testing::Values(
|
||||
@@ -185,27 +145,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
make_tuple(&vp9_highbd_block_error_sse2,
|
||||
&vp9_highbd_block_error_c, VPX_BITS_12),
|
||||
make_tuple(&vp9_highbd_block_error_sse2,
|
||||
&vp9_highbd_block_error_c, VPX_BITS_8),
|
||||
make_tuple(&wrap_vp9_highbd_block_error_8bit_sse2,
|
||||
&wrap_vp9_highbd_block_error_8bit_c, VPX_BITS_8)));
|
||||
&vp9_highbd_block_error_c, VPX_BITS_8)));
|
||||
#endif // HAVE_SSE2
|
||||
|
||||
#if HAVE_AVX
|
||||
int64_t wrap_vp9_highbd_block_error_8bit_avx(const tran_low_t *coeff,
|
||||
const tran_low_t *dqcoeff,
|
||||
intptr_t block_size,
|
||||
int64_t *ssz, int bps) {
|
||||
EXPECT_EQ(8, bps);
|
||||
return vp9_highbd_block_error_8bit_avx(coeff, dqcoeff, block_size, ssz);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
AVX, ErrorBlockTest,
|
||||
::testing::Values(
|
||||
make_tuple(&wrap_vp9_highbd_block_error_8bit_avx,
|
||||
&wrap_vp9_highbd_block_error_8bit_c, VPX_BITS_8)));
|
||||
#endif // HAVE_AVX
|
||||
|
||||
#endif // CONFIG_USE_X86INC
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
@@ -18,20 +18,27 @@
|
||||
#include "test/y4m_video_source.h"
|
||||
|
||||
namespace {
|
||||
class VPxEncoderThreadTest
|
||||
class VP9EncoderThreadTest
|
||||
: public ::libvpx_test::EncoderTest,
|
||||
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
|
||||
protected:
|
||||
VPxEncoderThreadTest()
|
||||
VP9EncoderThreadTest()
|
||||
: EncoderTest(GET_PARAM(0)),
|
||||
encoder_initialized_(false),
|
||||
tiles_(2),
|
||||
encoding_mode_(GET_PARAM(1)),
|
||||
set_cpu_used_(GET_PARAM(2)) {
|
||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
|
||||
cfg.w = 1280;
|
||||
cfg.h = 720;
|
||||
decoder_ = codec_->CreateDecoder(cfg, 0);
|
||||
|
||||
md5_.clear();
|
||||
}
|
||||
virtual ~VPxEncoderThreadTest() {}
|
||||
virtual ~VP9EncoderThreadTest() {
|
||||
delete decoder_;
|
||||
}
|
||||
|
||||
virtual void SetUp() {
|
||||
InitializeConfig();
|
||||
@@ -41,7 +48,7 @@ class VPxEncoderThreadTest
|
||||
cfg_.g_lag_in_frames = 3;
|
||||
cfg_.rc_end_usage = VPX_VBR;
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 5;
|
||||
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
|
||||
cfg_.rc_2pass_vbr_minsection_pct = 2000;
|
||||
} else {
|
||||
cfg_.g_lag_in_frames = 0;
|
||||
cfg_.rc_end_usage = VPX_CBR;
|
||||
@@ -55,7 +62,7 @@ class VPxEncoderThreadTest
|
||||
encoder_initialized_ = false;
|
||||
}
|
||||
|
||||
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource * /*video*/,
|
||||
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
|
||||
::libvpx_test::Encoder *encoder) {
|
||||
if (!encoder_initialized_) {
|
||||
// Encode 4 column tiles.
|
||||
@@ -74,32 +81,31 @@ class VPxEncoderThreadTest
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DecompressedFrameHook(const vpx_image_t &img,
|
||||
vpx_codec_pts_t /*pts*/) {
|
||||
::libvpx_test::MD5 md5_res;
|
||||
md5_res.Add(&img);
|
||||
md5_.push_back(md5_res.Get());
|
||||
}
|
||||
|
||||
virtual bool HandleDecodeResult(const vpx_codec_err_t res,
|
||||
const libvpx_test::VideoSource& /*video*/,
|
||||
libvpx_test::Decoder * /*decoder*/) {
|
||||
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
|
||||
const vpx_codec_err_t res = decoder_->DecodeFrame(
|
||||
reinterpret_cast<uint8_t*>(pkt->data.frame.buf), pkt->data.frame.sz);
|
||||
if (res != VPX_CODEC_OK) {
|
||||
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||
return false;
|
||||
abort_ = true;
|
||||
ASSERT_EQ(VPX_CODEC_OK, res);
|
||||
}
|
||||
const vpx_image_t *img = decoder_->GetDxData().Next();
|
||||
|
||||
return true;
|
||||
if (img) {
|
||||
::libvpx_test::MD5 md5_res;
|
||||
md5_res.Add(img);
|
||||
md5_.push_back(md5_res.Get());
|
||||
}
|
||||
}
|
||||
|
||||
bool encoder_initialized_;
|
||||
int tiles_;
|
||||
::libvpx_test::TestMode encoding_mode_;
|
||||
int set_cpu_used_;
|
||||
::libvpx_test::Decoder *decoder_;
|
||||
std::vector<std::string> md5_;
|
||||
};
|
||||
|
||||
TEST_P(VPxEncoderThreadTest, EncoderResultTest) {
|
||||
TEST_P(VP9EncoderThreadTest, EncoderResultTest) {
|
||||
std::vector<std::string> single_thr_md5, multi_thr_md5;
|
||||
|
||||
::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 15, 20);
|
||||
@@ -124,13 +130,8 @@ TEST_P(VPxEncoderThreadTest, EncoderResultTest) {
|
||||
}
|
||||
|
||||
VP9_INSTANTIATE_TEST_CASE(
|
||||
VPxEncoderThreadTest,
|
||||
VP9EncoderThreadTest,
|
||||
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
|
||||
::libvpx_test::kRealTime),
|
||||
::testing::Range(1, 9));
|
||||
|
||||
VP10_INSTANTIATE_TEST_CASE(
|
||||
VPxEncoderThreadTest,
|
||||
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood),
|
||||
::testing::Range(1, 3));
|
||||
} // namespace
|
||||
|
@@ -10,17 +10,17 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.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_config.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_blockd.h"
|
||||
#include "vp9/common/vp9_pred_common.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "test/util.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -34,7 +34,7 @@ class VP9IntraPredBase {
|
||||
virtual ~VP9IntraPredBase() { libvpx_test::ClearSystemState(); }
|
||||
|
||||
protected:
|
||||
virtual void Predict() = 0;
|
||||
virtual void Predict(PREDICTION_MODE mode) = 0;
|
||||
|
||||
void CheckPrediction(int test_case_number, int *error_count) const {
|
||||
// For each pixel ensure that the calculated value is the same as reference.
|
||||
@@ -73,7 +73,7 @@ class VP9IntraPredBase {
|
||||
left_col_[y] = rnd.Rand16() & mask_;
|
||||
}
|
||||
}
|
||||
Predict();
|
||||
Predict(DC_PRED);
|
||||
CheckPrediction(i, &error_count);
|
||||
}
|
||||
ASSERT_EQ(0, error_count);
|
||||
@@ -106,7 +106,7 @@ class VP9IntraPredTest
|
||||
mask_ = (1 << bit_depth_) - 1;
|
||||
}
|
||||
|
||||
virtual void Predict() {
|
||||
virtual void Predict(PREDICTION_MODE mode) {
|
||||
const uint16_t *const_above_row = above_row_;
|
||||
const uint16_t *const_left_col = left_col_;
|
||||
ref_fn_(ref_dst_, stride_, const_above_row, const_left_col, bit_depth_);
|
||||
@@ -131,101 +131,168 @@ using std::tr1::make_tuple;
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
#if CONFIG_USE_X86INC
|
||||
#if ARCH_X86_64
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_8, VP9IntraPredTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_dc_predictor_32x32_sse2,
|
||||
&vpx_highbd_dc_predictor_32x32_c, 32, 8),
|
||||
make_tuple(&vpx_highbd_tm_predictor_16x16_sse2,
|
||||
&vpx_highbd_tm_predictor_16x16_c, 16, 8),
|
||||
make_tuple(&vpx_highbd_tm_predictor_32x32_sse2,
|
||||
&vpx_highbd_tm_predictor_32x32_c, 32, 8),
|
||||
make_tuple(&vpx_highbd_dc_predictor_4x4_sse2,
|
||||
&vpx_highbd_dc_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vpx_highbd_dc_predictor_8x8_sse2,
|
||||
&vpx_highbd_dc_predictor_8x8_c, 8, 8),
|
||||
make_tuple(&vpx_highbd_dc_predictor_16x16_sse2,
|
||||
&vpx_highbd_dc_predictor_16x16_c, 16, 8),
|
||||
make_tuple(&vpx_highbd_v_predictor_4x4_sse2,
|
||||
&vpx_highbd_v_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vpx_highbd_v_predictor_8x8_sse2,
|
||||
&vpx_highbd_v_predictor_8x8_c, 8, 8),
|
||||
make_tuple(&vpx_highbd_v_predictor_16x16_sse2,
|
||||
&vpx_highbd_v_predictor_16x16_c, 16, 8),
|
||||
make_tuple(&vpx_highbd_v_predictor_32x32_sse2,
|
||||
&vpx_highbd_v_predictor_32x32_c, 32, 8),
|
||||
make_tuple(&vpx_highbd_tm_predictor_4x4_sse2,
|
||||
&vpx_highbd_tm_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vpx_highbd_tm_predictor_8x8_sse2,
|
||||
&vpx_highbd_tm_predictor_8x8_c, 8, 8)));
|
||||
|
||||
make_tuple(&vp9_highbd_dc_predictor_32x32_sse2,
|
||||
&vp9_highbd_dc_predictor_32x32_c, 32, 8),
|
||||
make_tuple(&vp9_highbd_tm_predictor_16x16_sse2,
|
||||
&vp9_highbd_tm_predictor_16x16_c, 16, 8),
|
||||
make_tuple(&vp9_highbd_tm_predictor_32x32_sse2,
|
||||
&vp9_highbd_tm_predictor_32x32_c, 32, 8),
|
||||
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||
&vp9_highbd_dc_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||
&vp9_highbd_dc_predictor_8x8_c, 8, 8),
|
||||
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||
&vp9_highbd_dc_predictor_16x16_c, 16, 8),
|
||||
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||
&vp9_highbd_v_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||
&vp9_highbd_v_predictor_8x8_c, 8, 8),
|
||||
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||
&vp9_highbd_v_predictor_16x16_c, 16, 8),
|
||||
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||
&vp9_highbd_v_predictor_32x32_c, 32, 8),
|
||||
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||
&vp9_highbd_tm_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||
&vp9_highbd_tm_predictor_8x8_c, 8, 8)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_8, VP9IntraPredTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||
&vp9_highbd_dc_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||
&vp9_highbd_dc_predictor_8x8_c, 8, 8),
|
||||
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||
&vp9_highbd_dc_predictor_16x16_c, 16, 8),
|
||||
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||
&vp9_highbd_v_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||
&vp9_highbd_v_predictor_8x8_c, 8, 8),
|
||||
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||
&vp9_highbd_v_predictor_16x16_c, 16, 8),
|
||||
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||
&vp9_highbd_v_predictor_32x32_c, 32, 8),
|
||||
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||
&vp9_highbd_tm_predictor_4x4_c, 4, 8),
|
||||
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||
&vp9_highbd_tm_predictor_8x8_c, 8, 8)));
|
||||
#endif
|
||||
#if ARCH_X86_64
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_10, VP9IntraPredTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_dc_predictor_32x32_sse2,
|
||||
&vpx_highbd_dc_predictor_32x32_c, 32,
|
||||
make_tuple(&vp9_highbd_dc_predictor_32x32_sse2,
|
||||
&vp9_highbd_dc_predictor_32x32_c, 32,
|
||||
10),
|
||||
make_tuple(&vpx_highbd_tm_predictor_16x16_sse2,
|
||||
&vpx_highbd_tm_predictor_16x16_c, 16,
|
||||
make_tuple(&vp9_highbd_tm_predictor_16x16_sse2,
|
||||
&vp9_highbd_tm_predictor_16x16_c, 16,
|
||||
10),
|
||||
make_tuple(&vpx_highbd_tm_predictor_32x32_sse2,
|
||||
&vpx_highbd_tm_predictor_32x32_c, 32,
|
||||
make_tuple(&vp9_highbd_tm_predictor_32x32_sse2,
|
||||
&vp9_highbd_tm_predictor_32x32_c, 32,
|
||||
10),
|
||||
make_tuple(&vpx_highbd_dc_predictor_4x4_sse2,
|
||||
&vpx_highbd_dc_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vpx_highbd_dc_predictor_8x8_sse2,
|
||||
&vpx_highbd_dc_predictor_8x8_c, 8, 10),
|
||||
make_tuple(&vpx_highbd_dc_predictor_16x16_sse2,
|
||||
&vpx_highbd_dc_predictor_16x16_c, 16,
|
||||
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||
&vp9_highbd_dc_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||
&vp9_highbd_dc_predictor_8x8_c, 8, 10),
|
||||
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||
&vp9_highbd_dc_predictor_16x16_c, 16,
|
||||
10),
|
||||
make_tuple(&vpx_highbd_v_predictor_4x4_sse2,
|
||||
&vpx_highbd_v_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vpx_highbd_v_predictor_8x8_sse2,
|
||||
&vpx_highbd_v_predictor_8x8_c, 8, 10),
|
||||
make_tuple(&vpx_highbd_v_predictor_16x16_sse2,
|
||||
&vpx_highbd_v_predictor_16x16_c, 16,
|
||||
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||
&vp9_highbd_v_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||
&vp9_highbd_v_predictor_8x8_c, 8, 10),
|
||||
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||
&vp9_highbd_v_predictor_16x16_c, 16,
|
||||
10),
|
||||
make_tuple(&vpx_highbd_v_predictor_32x32_sse2,
|
||||
&vpx_highbd_v_predictor_32x32_c, 32,
|
||||
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||
&vp9_highbd_v_predictor_32x32_c, 32,
|
||||
10),
|
||||
make_tuple(&vpx_highbd_tm_predictor_4x4_sse2,
|
||||
&vpx_highbd_tm_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vpx_highbd_tm_predictor_8x8_sse2,
|
||||
&vpx_highbd_tm_predictor_8x8_c, 8, 10)));
|
||||
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||
&vp9_highbd_tm_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||
&vp9_highbd_tm_predictor_8x8_c, 8, 10)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_10, VP9IntraPredTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||
&vp9_highbd_dc_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||
&vp9_highbd_dc_predictor_8x8_c, 8, 10),
|
||||
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||
&vp9_highbd_dc_predictor_16x16_c, 16,
|
||||
10),
|
||||
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||
&vp9_highbd_v_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||
&vp9_highbd_v_predictor_8x8_c, 8, 10),
|
||||
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||
&vp9_highbd_v_predictor_16x16_c, 16, 10),
|
||||
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||
&vp9_highbd_v_predictor_32x32_c, 32, 10),
|
||||
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||
&vp9_highbd_tm_predictor_4x4_c, 4, 10),
|
||||
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||
&vp9_highbd_tm_predictor_8x8_c, 8, 10)));
|
||||
#endif
|
||||
|
||||
#if ARCH_X86_64
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_12, VP9IntraPredTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_dc_predictor_32x32_sse2,
|
||||
&vpx_highbd_dc_predictor_32x32_c, 32,
|
||||
make_tuple(&vp9_highbd_dc_predictor_32x32_sse2,
|
||||
&vp9_highbd_dc_predictor_32x32_c, 32,
|
||||
12),
|
||||
make_tuple(&vpx_highbd_tm_predictor_16x16_sse2,
|
||||
&vpx_highbd_tm_predictor_16x16_c, 16,
|
||||
make_tuple(&vp9_highbd_tm_predictor_16x16_sse2,
|
||||
&vp9_highbd_tm_predictor_16x16_c, 16,
|
||||
12),
|
||||
make_tuple(&vpx_highbd_tm_predictor_32x32_sse2,
|
||||
&vpx_highbd_tm_predictor_32x32_c, 32,
|
||||
make_tuple(&vp9_highbd_tm_predictor_32x32_sse2,
|
||||
&vp9_highbd_tm_predictor_32x32_c, 32,
|
||||
12),
|
||||
make_tuple(&vpx_highbd_dc_predictor_4x4_sse2,
|
||||
&vpx_highbd_dc_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vpx_highbd_dc_predictor_8x8_sse2,
|
||||
&vpx_highbd_dc_predictor_8x8_c, 8, 12),
|
||||
make_tuple(&vpx_highbd_dc_predictor_16x16_sse2,
|
||||
&vpx_highbd_dc_predictor_16x16_c, 16,
|
||||
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||
&vp9_highbd_dc_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||
&vp9_highbd_dc_predictor_8x8_c, 8, 12),
|
||||
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||
&vp9_highbd_dc_predictor_16x16_c, 16,
|
||||
12),
|
||||
make_tuple(&vpx_highbd_v_predictor_4x4_sse2,
|
||||
&vpx_highbd_v_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vpx_highbd_v_predictor_8x8_sse2,
|
||||
&vpx_highbd_v_predictor_8x8_c, 8, 12),
|
||||
make_tuple(&vpx_highbd_v_predictor_16x16_sse2,
|
||||
&vpx_highbd_v_predictor_16x16_c, 16,
|
||||
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||
&vp9_highbd_v_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||
&vp9_highbd_v_predictor_8x8_c, 8, 12),
|
||||
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||
&vp9_highbd_v_predictor_16x16_c, 16,
|
||||
12),
|
||||
make_tuple(&vpx_highbd_v_predictor_32x32_sse2,
|
||||
&vpx_highbd_v_predictor_32x32_c, 32,
|
||||
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||
&vp9_highbd_v_predictor_32x32_c, 32,
|
||||
12),
|
||||
make_tuple(&vpx_highbd_tm_predictor_4x4_sse2,
|
||||
&vpx_highbd_tm_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vpx_highbd_tm_predictor_8x8_sse2,
|
||||
&vpx_highbd_tm_predictor_8x8_c, 8, 12)));
|
||||
|
||||
#endif // CONFIG_USE_X86INC
|
||||
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||
&vp9_highbd_tm_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||
&vp9_highbd_tm_predictor_8x8_c, 8, 12)));
|
||||
#else
|
||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_12, VP9IntraPredTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||
&vp9_highbd_dc_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||
&vp9_highbd_dc_predictor_8x8_c, 8, 12),
|
||||
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||
&vp9_highbd_dc_predictor_16x16_c, 16,
|
||||
12),
|
||||
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||
&vp9_highbd_v_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||
&vp9_highbd_v_predictor_8x8_c, 8, 12),
|
||||
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||
&vp9_highbd_v_predictor_16x16_c, 16, 12),
|
||||
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||
&vp9_highbd_v_predictor_32x32_c, 32, 12),
|
||||
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||
&vp9_highbd_tm_predictor_4x4_c, 4, 12),
|
||||
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||
&vp9_highbd_tm_predictor_8x8_c, 8, 12)));
|
||||
#endif
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
#endif // HAVE_SSE2
|
||||
} // namespace
|
||||
|
@@ -7,10 +7,8 @@
|
||||
* 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 "./vpx_config.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "test/codec_factory.h"
|
||||
#include "test/encode_test_driver.h"
|
||||
#include "test/i420_video_source.h"
|
||||
@@ -127,8 +125,4 @@ VP9_INSTANTIATE_TEST_CASE(LosslessTest,
|
||||
::testing::Values(::libvpx_test::kRealTime,
|
||||
::libvpx_test::kOnePassGood,
|
||||
::libvpx_test::kTwoPassGood));
|
||||
|
||||
VP10_INSTANTIATE_TEST_CASE(LosslessTest,
|
||||
::testing::Values(::libvpx_test::kOnePassGood,
|
||||
::libvpx_test::kTwoPassGood));
|
||||
} // namespace
|
||||
|
@@ -14,12 +14,12 @@
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "test/util.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_entropy.h"
|
||||
#include "vp9/common/vp9_scan.h"
|
||||
#include "vpx/vpx_codec.h"
|
||||
@@ -331,21 +331,21 @@ using std::tr1::make_tuple;
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, VP9QuantizeTest,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_quantize_b_sse2,
|
||||
&vpx_highbd_quantize_b_c, VPX_BITS_8),
|
||||
make_tuple(&vpx_highbd_quantize_b_sse2,
|
||||
&vpx_highbd_quantize_b_c, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_quantize_b_sse2,
|
||||
&vpx_highbd_quantize_b_c, VPX_BITS_12)));
|
||||
make_tuple(&vp9_highbd_quantize_b_sse2,
|
||||
&vp9_highbd_quantize_b_c, VPX_BITS_8),
|
||||
make_tuple(&vp9_highbd_quantize_b_sse2,
|
||||
&vp9_highbd_quantize_b_c, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_quantize_b_sse2,
|
||||
&vp9_highbd_quantize_b_c, VPX_BITS_12)));
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SSE2, VP9Quantize32Test,
|
||||
::testing::Values(
|
||||
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
||||
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_8),
|
||||
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
||||
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_10),
|
||||
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
||||
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_12)));
|
||||
make_tuple(&vp9_highbd_quantize_b_32x32_sse2,
|
||||
&vp9_highbd_quantize_b_32x32_c, VPX_BITS_8),
|
||||
make_tuple(&vp9_highbd_quantize_b_32x32_sse2,
|
||||
&vp9_highbd_quantize_b_32x32_c, VPX_BITS_10),
|
||||
make_tuple(&vp9_highbd_quantize_b_32x32_sse2,
|
||||
&vp9_highbd_quantize_b_32x32_c, VPX_BITS_12)));
|
||||
#endif // HAVE_SSE2
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
} // namespace
|
||||
|
@@ -54,7 +54,7 @@ vp9_spatial_svc() {
|
||||
if [ "$(vp9_encode_available)" = "yes" ]; then
|
||||
local readonly test_name="vp9_spatial_svc"
|
||||
for layers in $(seq 1 ${vp9_ssvc_test_layers}); do
|
||||
vp9_spatial_svc_encoder "${test_name}" -sl ${layers}
|
||||
vp9_spatial_svc_encoder "${test_name}" -l ${layers}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
@@ -9,13 +9,11 @@
|
||||
*/
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_dsp_rtcd.h"
|
||||
#include "test/acm_random.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "./vp9_rtcd.h"
|
||||
#include "vp9/common/vp9_blockd.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
@@ -91,19 +89,15 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) {
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(C, VP9SubtractBlockTest,
|
||||
::testing::Values(vpx_subtract_block_c));
|
||||
::testing::Values(vp9_subtract_block_c));
|
||||
|
||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
||||
INSTANTIATE_TEST_CASE_P(SSE2, VP9SubtractBlockTest,
|
||||
::testing::Values(vpx_subtract_block_sse2));
|
||||
::testing::Values(vp9_subtract_block_sse2));
|
||||
#endif
|
||||
#if HAVE_NEON
|
||||
INSTANTIATE_TEST_CASE_P(NEON, VP9SubtractBlockTest,
|
||||
::testing::Values(vpx_subtract_block_neon));
|
||||
#endif
|
||||
#if HAVE_MSA
|
||||
INSTANTIATE_TEST_CASE_P(MSA, VP9SubtractBlockTest,
|
||||
::testing::Values(vpx_subtract_block_msa));
|
||||
::testing::Values(vp9_subtract_block_neon));
|
||||
#endif
|
||||
|
||||
} // namespace vp9
|
||||
|
@@ -18,33 +18,33 @@
|
||||
#if CONFIG_WEBM_IO
|
||||
#include "test/webm_video_source.h"
|
||||
#endif
|
||||
#include "vpx_util/vpx_thread.h"
|
||||
#include "vp9/common/vp9_thread.h"
|
||||
|
||||
namespace {
|
||||
|
||||
using std::string;
|
||||
|
||||
class VPxWorkerThreadTest : public ::testing::TestWithParam<bool> {
|
||||
class VP9WorkerThreadTest : public ::testing::TestWithParam<bool> {
|
||||
protected:
|
||||
virtual ~VPxWorkerThreadTest() {}
|
||||
virtual ~VP9WorkerThreadTest() {}
|
||||
virtual void SetUp() {
|
||||
vpx_get_worker_interface()->init(&worker_);
|
||||
vp9_get_worker_interface()->init(&worker_);
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
vpx_get_worker_interface()->end(&worker_);
|
||||
vp9_get_worker_interface()->end(&worker_);
|
||||
}
|
||||
|
||||
void Run(VPxWorker* worker) {
|
||||
void Run(VP9Worker* worker) {
|
||||
const bool synchronous = GetParam();
|
||||
if (synchronous) {
|
||||
vpx_get_worker_interface()->execute(worker);
|
||||
vp9_get_worker_interface()->execute(worker);
|
||||
} else {
|
||||
vpx_get_worker_interface()->launch(worker);
|
||||
vp9_get_worker_interface()->launch(worker);
|
||||
}
|
||||
}
|
||||
|
||||
VPxWorker worker_;
|
||||
VP9Worker worker_;
|
||||
};
|
||||
|
||||
int ThreadHook(void* data, void* return_value) {
|
||||
@@ -53,12 +53,12 @@ int ThreadHook(void* data, void* return_value) {
|
||||
return *reinterpret_cast<int*>(return_value);
|
||||
}
|
||||
|
||||
TEST_P(VPxWorkerThreadTest, HookSuccess) {
|
||||
TEST_P(VP9WorkerThreadTest, HookSuccess) {
|
||||
// should be a no-op.
|
||||
EXPECT_NE(vpx_get_worker_interface()->sync(&worker_), 0);
|
||||
EXPECT_NE(vp9_get_worker_interface()->sync(&worker_), 0);
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
EXPECT_NE(vpx_get_worker_interface()->reset(&worker_), 0);
|
||||
EXPECT_NE(vp9_get_worker_interface()->reset(&worker_), 0);
|
||||
|
||||
int hook_data = 0;
|
||||
int return_value = 1; // return successfully from the hook
|
||||
@@ -67,17 +67,17 @@ TEST_P(VPxWorkerThreadTest, HookSuccess) {
|
||||
worker_.data2 = &return_value;
|
||||
|
||||
Run(&worker_);
|
||||
EXPECT_NE(vpx_get_worker_interface()->sync(&worker_), 0);
|
||||
EXPECT_NE(vp9_get_worker_interface()->sync(&worker_), 0);
|
||||
EXPECT_FALSE(worker_.had_error);
|
||||
EXPECT_EQ(5, hook_data);
|
||||
|
||||
// should be a no-op.
|
||||
EXPECT_NE(vpx_get_worker_interface()->sync(&worker_), 0);
|
||||
EXPECT_NE(vp9_get_worker_interface()->sync(&worker_), 0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(VPxWorkerThreadTest, HookFailure) {
|
||||
EXPECT_NE(vpx_get_worker_interface()->reset(&worker_), 0);
|
||||
TEST_P(VP9WorkerThreadTest, HookFailure) {
|
||||
EXPECT_NE(vp9_get_worker_interface()->reset(&worker_), 0);
|
||||
|
||||
int hook_data = 0;
|
||||
int return_value = 0; // return failure from the hook
|
||||
@@ -86,29 +86,29 @@ TEST_P(VPxWorkerThreadTest, HookFailure) {
|
||||
worker_.data2 = &return_value;
|
||||
|
||||
Run(&worker_);
|
||||
EXPECT_FALSE(vpx_get_worker_interface()->sync(&worker_));
|
||||
EXPECT_FALSE(vp9_get_worker_interface()->sync(&worker_));
|
||||
EXPECT_EQ(1, worker_.had_error);
|
||||
|
||||
// Ensure _reset() clears the error and _launch() can be called again.
|
||||
return_value = 1;
|
||||
EXPECT_NE(vpx_get_worker_interface()->reset(&worker_), 0);
|
||||
EXPECT_NE(vp9_get_worker_interface()->reset(&worker_), 0);
|
||||
EXPECT_FALSE(worker_.had_error);
|
||||
vpx_get_worker_interface()->launch(&worker_);
|
||||
EXPECT_NE(vpx_get_worker_interface()->sync(&worker_), 0);
|
||||
vp9_get_worker_interface()->launch(&worker_);
|
||||
EXPECT_NE(vp9_get_worker_interface()->sync(&worker_), 0);
|
||||
EXPECT_FALSE(worker_.had_error);
|
||||
}
|
||||
|
||||
TEST_P(VPxWorkerThreadTest, EndWithoutSync) {
|
||||
TEST_P(VP9WorkerThreadTest, EndWithoutSync) {
|
||||
// Create a large number of threads to increase the chances of detecting a
|
||||
// race. Doing more work in the hook is no guarantee as any race would occur
|
||||
// post hook execution in the main thread loop driver.
|
||||
static const int kNumWorkers = 64;
|
||||
VPxWorker workers[kNumWorkers];
|
||||
VP9Worker workers[kNumWorkers];
|
||||
int hook_data[kNumWorkers];
|
||||
int return_value[kNumWorkers];
|
||||
|
||||
for (int n = 0; n < kNumWorkers; ++n) {
|
||||
vpx_get_worker_interface()->init(&workers[n]);
|
||||
vp9_get_worker_interface()->init(&workers[n]);
|
||||
return_value[n] = 1; // return successfully from the hook
|
||||
workers[n].hook = ThreadHook;
|
||||
workers[n].data1 = &hook_data[n];
|
||||
@@ -117,7 +117,7 @@ TEST_P(VPxWorkerThreadTest, EndWithoutSync) {
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
for (int n = 0; n < kNumWorkers; ++n) {
|
||||
EXPECT_NE(vpx_get_worker_interface()->reset(&workers[n]), 0);
|
||||
EXPECT_NE(vp9_get_worker_interface()->reset(&workers[n]), 0);
|
||||
hook_data[n] = 0;
|
||||
}
|
||||
|
||||
@@ -126,16 +126,16 @@ TEST_P(VPxWorkerThreadTest, EndWithoutSync) {
|
||||
}
|
||||
|
||||
for (int n = kNumWorkers - 1; n >= 0; --n) {
|
||||
vpx_get_worker_interface()->end(&workers[n]);
|
||||
vp9_get_worker_interface()->end(&workers[n]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST(VPxWorkerThreadTest, TestInterfaceAPI) {
|
||||
EXPECT_EQ(0, vpx_set_worker_interface(NULL));
|
||||
EXPECT_TRUE(vpx_get_worker_interface() != NULL);
|
||||
TEST(VP9WorkerThreadTest, TestInterfaceAPI) {
|
||||
EXPECT_EQ(0, vp9_set_worker_interface(NULL));
|
||||
EXPECT_TRUE(vp9_get_worker_interface() != NULL);
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
VPxWorkerInterface winterface = *vpx_get_worker_interface();
|
||||
VP9WorkerInterface winterface = *vp9_get_worker_interface();
|
||||
switch (i) {
|
||||
default:
|
||||
case 0: winterface.init = NULL; break;
|
||||
@@ -145,7 +145,7 @@ TEST(VPxWorkerThreadTest, TestInterfaceAPI) {
|
||||
case 4: winterface.execute = NULL; break;
|
||||
case 5: winterface.end = NULL; break;
|
||||
}
|
||||
EXPECT_EQ(0, vpx_set_worker_interface(&winterface));
|
||||
EXPECT_EQ(0, vp9_set_worker_interface(&winterface));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ string DecodeFile(const string& filename, int num_threads) {
|
||||
void DecodeFiles(const FileList files[]) {
|
||||
for (const FileList *iter = files; iter->name != NULL; ++iter) {
|
||||
SCOPED_TRACE(iter->name);
|
||||
for (int t = 1; t <= 8; ++t) {
|
||||
for (int t = 2; t <= 8; ++t) {
|
||||
EXPECT_EQ(iter->expected_md5, DecodeFile(iter->name, t))
|
||||
<< "threads = " << t;
|
||||
}
|
||||
@@ -202,21 +202,21 @@ void DecodeFiles(const FileList files[]) {
|
||||
// hang.
|
||||
namespace impl {
|
||||
|
||||
void Init(VPxWorker *const worker) { memset(worker, 0, sizeof(*worker)); }
|
||||
int Reset(VPxWorker *const /*worker*/) { return 1; }
|
||||
int Sync(VPxWorker *const worker) { return !worker->had_error; }
|
||||
void Init(VP9Worker *const worker) { memset(worker, 0, sizeof(*worker)); }
|
||||
int Reset(VP9Worker *const /*worker*/) { return 1; }
|
||||
int Sync(VP9Worker *const worker) { return !worker->had_error; }
|
||||
|
||||
void Execute(VPxWorker *const worker) {
|
||||
void Execute(VP9Worker *const worker) {
|
||||
worker->had_error |= !worker->hook(worker->data1, worker->data2);
|
||||
}
|
||||
|
||||
void Launch(VPxWorker *const worker) { Execute(worker); }
|
||||
void End(VPxWorker *const /*worker*/) {}
|
||||
void Launch(VP9Worker *const worker) { Execute(worker); }
|
||||
void End(VP9Worker *const /*worker*/) {}
|
||||
|
||||
} // namespace impl
|
||||
|
||||
TEST(VPxWorkerThreadTest, TestSerialInterface) {
|
||||
static const VPxWorkerInterface serial_interface = {
|
||||
TEST(VP9WorkerThreadTest, TestSerialInterface) {
|
||||
static const VP9WorkerInterface serial_interface = {
|
||||
impl::Init, impl::Reset, impl::Sync, impl::Launch, impl::Execute, impl::End
|
||||
};
|
||||
// TODO(jzern): Avoid using a file that will use the row-based thread
|
||||
@@ -225,23 +225,23 @@ TEST(VPxWorkerThreadTest, TestSerialInterface) {
|
||||
// progress in the row above before proceeding.
|
||||
static const char expected_md5[] = "b35a1b707b28e82be025d960aba039bc";
|
||||
static const char filename[] = "vp90-2-03-size-226x226.webm";
|
||||
VPxWorkerInterface default_interface = *vpx_get_worker_interface();
|
||||
VP9WorkerInterface default_interface = *vp9_get_worker_interface();
|
||||
|
||||
EXPECT_NE(vpx_set_worker_interface(&serial_interface), 0);
|
||||
EXPECT_NE(vp9_set_worker_interface(&serial_interface), 0);
|
||||
EXPECT_EQ(expected_md5, DecodeFile(filename, 2));
|
||||
|
||||
// Reset the interface.
|
||||
EXPECT_NE(vpx_set_worker_interface(&default_interface), 0);
|
||||
EXPECT_NE(vp9_set_worker_interface(&default_interface), 0);
|
||||
EXPECT_EQ(expected_md5, DecodeFile(filename, 2));
|
||||
}
|
||||
|
||||
TEST(VP9DecodeMultiThreadedTest, NoTilesNonFrameParallel) {
|
||||
TEST(VP9DecodeMultiThreadedTest, Decode) {
|
||||
// no tiles or frame parallel; this exercises loop filter threading.
|
||||
EXPECT_EQ("b35a1b707b28e82be025d960aba039bc",
|
||||
DecodeFile("vp90-2-03-size-226x226.webm", 2));
|
||||
}
|
||||
|
||||
TEST(VP9DecodeMultiThreadedTest, FrameParallel) {
|
||||
TEST(VP9DecodeMultiThreadedTest, Decode2) {
|
||||
static const FileList files[] = {
|
||||
{ "vp90-2-08-tile_1x2_frame_parallel.webm",
|
||||
"68ede6abd66bae0a2edf2eb9232241b6" },
|
||||
@@ -255,7 +255,8 @@ TEST(VP9DecodeMultiThreadedTest, FrameParallel) {
|
||||
DecodeFiles(files);
|
||||
}
|
||||
|
||||
TEST(VP9DecodeMultiThreadedTest, FrameParallelResize) {
|
||||
// Test tile quantity changes within one file.
|
||||
TEST(VP9DecodeMultiThreadedTest, Decode3) {
|
||||
static const FileList files[] = {
|
||||
{ "vp90-2-14-resize-fp-tiles-1-16.webm",
|
||||
"0cd5e632c326297e975f38949c31ea94" },
|
||||
@@ -306,21 +307,8 @@ TEST(VP9DecodeMultiThreadedTest, FrameParallelResize) {
|
||||
|
||||
DecodeFiles(files);
|
||||
}
|
||||
|
||||
TEST(VP9DecodeMultiThreadedTest, NonFrameParallel) {
|
||||
static const FileList files[] = {
|
||||
{ "vp90-2-08-tile_1x2.webm", "570b4a5d5a70d58b5359671668328a16" },
|
||||
{ "vp90-2-08-tile_1x4.webm", "988d86049e884c66909d2d163a09841a" },
|
||||
{ "vp90-2-08-tile_1x8.webm", "0941902a52e9092cb010905eab16364c" },
|
||||
{ "vp90-2-08-tile-4x1.webm", "06505aade6647c583c8e00a2f582266f" },
|
||||
{ "vp90-2-08-tile-4x4.webm", "85c2299892460d76e2c600502d52bfe2" },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
DecodeFiles(files);
|
||||
}
|
||||
#endif // CONFIG_WEBM_IO
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Synchronous, VPxWorkerThreadTest, ::testing::Bool());
|
||||
INSTANTIATE_TEST_CASE_P(Synchronous, VP9WorkerThreadTest, ::testing::Bool());
|
||||
|
||||
} // namespace
|
||||
|
@@ -10,10 +10,11 @@
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_scale_rtcd.h"
|
||||
#include "test/clear_system_state.h"
|
||||
#include "test/register_state_check.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_scale_rtcd.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "vpx_scale/yv12config.h"
|
||||
|
||||
|
@@ -62,7 +62,7 @@ class WebMVideoSource : public CompressedVideoSource {
|
||||
|
||||
void FillFrame() {
|
||||
ASSERT_TRUE(vpx_ctx_->file != NULL);
|
||||
const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_);
|
||||
const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_);
|
||||
ASSERT_GE(status, 0) << "webm_read_frame failed";
|
||||
if (status == 1) {
|
||||
end_of_file_ = true;
|
||||
@@ -72,7 +72,7 @@ class WebMVideoSource : public CompressedVideoSource {
|
||||
void SeekToNextKeyFrame() {
|
||||
ASSERT_TRUE(vpx_ctx_->file != NULL);
|
||||
do {
|
||||
const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_);
|
||||
const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_);
|
||||
ASSERT_GE(status, 0) << "webm_read_frame failed";
|
||||
++frame_;
|
||||
if (status == 1) {
|
||||
|
@@ -9,14 +9,12 @@
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./y4menc.h"
|
||||
#include "test/md5_helper.h"
|
||||
#include "test/util.h"
|
||||
#include "test/y4m_video_source.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "./vpx_config.h"
|
||||
#include "./y4menc.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
#ifndef TEST_Y4M_VIDEO_SOURCE_H_
|
||||
#define TEST_Y4M_VIDEO_SOURCE_H_
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
#include "test/video_source.h"
|
||||
@@ -92,18 +91,6 @@ class Y4mVideoSource : public VideoSource {
|
||||
y4m_input_fetch_frame(&y4m_, input_file_, img_.get());
|
||||
}
|
||||
|
||||
// Swap buffers with another y4m source. This allows reading a new frame
|
||||
// while keeping the old frame around. A whole Y4mSource is required and
|
||||
// not just a vpx_image_t because of how the y4m reader manipulates
|
||||
// vpx_image_t internals,
|
||||
void SwapBuffers(Y4mVideoSource *other) {
|
||||
std::swap(other->y4m_.dst_buf, y4m_.dst_buf);
|
||||
vpx_image_t *tmp;
|
||||
tmp = other->img_.release();
|
||||
other->img_.reset(img_.release());
|
||||
img_.reset(tmp);
|
||||
}
|
||||
|
||||
protected:
|
||||
void CloseSource() {
|
||||
y4m_input_close(&y4m_);
|
||||
|
22
third_party/libwebm/Android.mk
vendored
22
third_party/libwebm/Android.mk
vendored
@@ -1,17 +1,11 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:= libwebm
|
||||
LOCAL_CPPFLAGS:=-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
|
||||
LOCAL_CPPFLAGS+=-D__STDC_LIMIT_MACROS -Wno-extern-c-compat
|
||||
LOCAL_C_INCLUDES:= $(LOCAL_PATH)
|
||||
LOCAL_EXPORT_C_INCLUDES:= $(LOCAL_PATH)
|
||||
|
||||
LOCAL_SRC_FILES:= common/file_util.cc \
|
||||
common/hdr_util.cc \
|
||||
mkvparser/mkvparser.cc \
|
||||
mkvparser/mkvreader.cc \
|
||||
mkvmuxer/mkvmuxer.cc \
|
||||
mkvmuxer/mkvmuxerutil.cc \
|
||||
mkvmuxer/mkvwriter.cc
|
||||
LOCAL_CPP_EXTENSION := .cpp
|
||||
LOCAL_SRC_FILES := mkvmuxer.cpp \
|
||||
mkvmuxerutil.cpp \
|
||||
mkvparser.cpp \
|
||||
mkvreader.cpp \
|
||||
mkvwriter.cpp
|
||||
LOCAL_MODULE := libwebm
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
2
third_party/libwebm/PATENTS.TXT
vendored
2
third_party/libwebm/PATENTS.TXT
vendored
@@ -17,7 +17,7 @@ or agree to the institution of patent litigation or any other patent
|
||||
enforcement activity against any entity (including a cross-claim or
|
||||
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
||||
or any code incorporated within any of these implementations of WebM
|
||||
constitute direct or contributory patent infringement, or inducement of
|
||||
constitutes direct or contributory patent infringement, or inducement of
|
||||
patent infringement, then any patent rights granted to you under this License
|
||||
for these implementations of WebM shall terminate as of the date such
|
||||
litigation is filed.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user