Compare commits
14 Commits
m49-2623
...
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/decode_with_partial_drops
|
||||||
/examples/example_xma
|
/examples/example_xma
|
||||||
/examples/postproc
|
/examples/postproc
|
||||||
/examples/resize_util
|
|
||||||
/examples/set_maps
|
/examples/set_maps
|
||||||
/examples/simple_decoder
|
/examples/simple_decoder
|
||||||
/examples/simple_encoder
|
/examples/simple_encoder
|
||||||
/examples/twopass_encoder
|
/examples/twopass_encoder
|
||||||
/examples/vp8_multi_resolution_encoder
|
/examples/vp8_multi_resolution_encoder
|
||||||
/examples/vp8cx_set_ref
|
/examples/vp8cx_set_ref
|
||||||
/examples/vp9_lossless_encoder
|
|
||||||
/examples/vp9_spatial_scalable_encoder
|
/examples/vp9_spatial_scalable_encoder
|
||||||
/examples/vpx_temporal_scalable_patterns
|
/examples/vpx_temporal_scalable_patterns
|
||||||
/examples/vpx_temporal_svc_encoder
|
|
||||||
/ivfdec
|
/ivfdec
|
||||||
/ivfdec.dox
|
/ivfdec.dox
|
||||||
/ivfenc
|
/ivfenc
|
||||||
@@ -48,14 +45,12 @@
|
|||||||
/libvpx.so*
|
/libvpx.so*
|
||||||
/libvpx.ver
|
/libvpx.ver
|
||||||
/samples.dox
|
/samples.dox
|
||||||
/test_intra_pred_speed
|
|
||||||
/test_libvpx
|
/test_libvpx
|
||||||
/vp8_api1_migration.dox
|
/vp8_api1_migration.dox
|
||||||
/vp[89x]_rtcd.h
|
/vp[89x]_rtcd.h
|
||||||
/vpx.pc
|
/vpx.pc
|
||||||
/vpx_config.c
|
/vpx_config.c
|
||||||
/vpx_config.h
|
/vpx_config.h
|
||||||
/vpx_dsp_rtcd.h
|
|
||||||
/vpx_scale_rtcd.h
|
/vpx_scale_rtcd.h
|
||||||
/vpx_version.h
|
/vpx_version.h
|
||||||
/vpxdec
|
/vpxdec
|
||||||
|
8
.mailmap
8
.mailmap
@@ -1,18 +1,14 @@
|
|||||||
Adrian Grange <agrange@google.com>
|
Adrian Grange <agrange@google.com>
|
||||||
Aℓex Converse <aconverse@google.com>
|
Alex Converse <aconverse@google.com> <alex.converse@gmail.com>
|
||||||
Aℓex Converse <aconverse@google.com> <alex.converse@gmail.com>
|
|
||||||
Alexis Ballier <aballier@gentoo.org> <alexis.ballier@gmail.com>
|
Alexis Ballier <aballier@gentoo.org> <alexis.ballier@gmail.com>
|
||||||
Alpha Lam <hclam@google.com> <hclam@chromium.org>
|
Alpha Lam <hclam@google.com> <hclam@chromium.org>
|
||||||
Deb Mukherjee <debargha@google.com>
|
Deb Mukherjee <debargha@google.com>
|
||||||
Erik Niemeyer <erik.a.niemeyer@intel.com> <erik.a.niemeyer@gmail.com>
|
Erik Niemeyer <erik.a.niemeyer@intel.com> <erik.a.niemeyer@gmail.com>
|
||||||
Guillaume Martres <gmartres@google.com> <smarter3@gmail.com>
|
Guillaume Martres <gmartres@google.com> <smarter3@gmail.com>
|
||||||
Hangyu Kuang <hkuang@google.com>
|
Hangyu Kuang <hkuang@google.com>
|
||||||
Hui Su <huisu@google.com>
|
|
||||||
Jacky Chen <jackychen@google.com>
|
|
||||||
Jim Bankoski <jimbankoski@google.com>
|
Jim Bankoski <jimbankoski@google.com>
|
||||||
Johann Koenig <johannkoenig@google.com>
|
Johann Koenig <johannkoenig@google.com>
|
||||||
Johann Koenig <johannkoenig@google.com> <johann.koenig@duck.com>
|
Johann Koenig <johannkoenig@google.com> <johann.koenig@duck.com>
|
||||||
Johann Koenig <johannkoenig@google.com> <johann.koenig@gmail.com>
|
|
||||||
John Koleszar <jkoleszar@google.com>
|
John Koleszar <jkoleszar@google.com>
|
||||||
Joshua Litt <joshualitt@google.com> <joshualitt@chromium.org>
|
Joshua Litt <joshualitt@google.com> <joshualitt@chromium.org>
|
||||||
Marco Paniconi <marpan@google.com>
|
Marco Paniconi <marpan@google.com>
|
||||||
@@ -21,12 +17,10 @@ Pascal Massimino <pascal.massimino@gmail.com>
|
|||||||
Paul Wilkins <paulwilkins@google.com>
|
Paul Wilkins <paulwilkins@google.com>
|
||||||
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
|
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
|
||||||
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
|
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
|
||||||
Ronald S. Bultje <rsbultje@gmail.com> <rbultje@google.com>
|
|
||||||
Sami Pietilä <samipietila@google.com>
|
Sami Pietilä <samipietila@google.com>
|
||||||
Tamar Levy <tamar.levy@intel.com>
|
Tamar Levy <tamar.levy@intel.com>
|
||||||
Tamar Levy <tamar.levy@intel.com> <levytamar82@gmail.com>
|
Tamar Levy <tamar.levy@intel.com> <levytamar82@gmail.com>
|
||||||
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
|
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
|
||||||
Timothy B. Terriberry <tterribe@xiph.org> Tim Terriberry <tterriberry@mozilla.com>
|
Timothy B. Terriberry <tterribe@xiph.org> Tim Terriberry <tterriberry@mozilla.com>
|
||||||
Tom Finegan <tomfinegan@google.com>
|
Tom Finegan <tomfinegan@google.com>
|
||||||
Tom Finegan <tomfinegan@google.com> <tomfinegan@chromium.org>
|
|
||||||
Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com>
|
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>
|
Abo Talib Mahfoodh <ab.mahfoodh@gmail.com>
|
||||||
Adam Xu <adam@xuyaowu.com>
|
Adam Xu <adam@xuyaowu.com>
|
||||||
Adrian Grange <agrange@google.com>
|
Adrian Grange <agrange@google.com>
|
||||||
Aℓex Converse <aconverse@google.com>
|
|
||||||
Ahmad Sharif <asharif@google.com>
|
Ahmad Sharif <asharif@google.com>
|
||||||
Alexander Voronov <avoronov@graphics.cs.msu.ru>
|
Alexander Voronov <avoronov@graphics.cs.msu.ru>
|
||||||
|
Alex Converse <aconverse@google.com>
|
||||||
Alexis Ballier <aballier@gentoo.org>
|
Alexis Ballier <aballier@gentoo.org>
|
||||||
Alok Ahuja <waveletcoeff@gmail.com>
|
Alok Ahuja <waveletcoeff@gmail.com>
|
||||||
Alpha Lam <hclam@google.com>
|
Alpha Lam <hclam@google.com>
|
||||||
@@ -16,10 +16,8 @@ Ami Fischman <fischman@chromium.org>
|
|||||||
Andoni Morales Alastruey <ylatuya@gmail.com>
|
Andoni Morales Alastruey <ylatuya@gmail.com>
|
||||||
Andres Mejia <mcitadel@gmail.com>
|
Andres Mejia <mcitadel@gmail.com>
|
||||||
Andrew Russell <anrussell@google.com>
|
Andrew Russell <anrussell@google.com>
|
||||||
Angie Chiang <angiebird@google.com>
|
|
||||||
Aron Rosenberg <arosenberg@logitech.com>
|
Aron Rosenberg <arosenberg@logitech.com>
|
||||||
Attila Nagy <attilanagy@google.com>
|
Attila Nagy <attilanagy@google.com>
|
||||||
Brion Vibber <bvibber@wikimedia.org>
|
|
||||||
changjun.yang <changjun.yang@intel.com>
|
changjun.yang <changjun.yang@intel.com>
|
||||||
Charles 'Buck' Krasic <ckrasic@google.com>
|
Charles 'Buck' Krasic <ckrasic@google.com>
|
||||||
chm <chm@rock-chips.com>
|
chm <chm@rock-chips.com>
|
||||||
@@ -29,7 +27,6 @@ Deb Mukherjee <debargha@google.com>
|
|||||||
Dim Temp <dimtemp0@gmail.com>
|
Dim Temp <dimtemp0@gmail.com>
|
||||||
Dmitry Kovalev <dkovalev@google.com>
|
Dmitry Kovalev <dkovalev@google.com>
|
||||||
Dragan Mrdjan <dmrdjan@mips.com>
|
Dragan Mrdjan <dmrdjan@mips.com>
|
||||||
Ed Baker <edward.baker@intel.com>
|
|
||||||
Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||||
Erik Niemeyer <erik.a.niemeyer@intel.com>
|
Erik Niemeyer <erik.a.niemeyer@intel.com>
|
||||||
Fabio Pedretti <fabio.ped@libero.it>
|
Fabio Pedretti <fabio.ped@libero.it>
|
||||||
@@ -37,8 +34,6 @@ Frank Galligan <fgalligan@google.com>
|
|||||||
Fredrik Söderquist <fs@opera.com>
|
Fredrik Söderquist <fs@opera.com>
|
||||||
Fritz Koenig <frkoenig@google.com>
|
Fritz Koenig <frkoenig@google.com>
|
||||||
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
|
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
|
||||||
Geza Lore <gezalore@gmail.com>
|
|
||||||
Ghislain MARY <ghislainmary2@gmail.com>
|
|
||||||
Giuseppe Scrivano <gscrivano@gnu.org>
|
Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
Gordana Cmiljanovic <gordana.cmiljanovic@imgtec.com>
|
Gordana Cmiljanovic <gordana.cmiljanovic@imgtec.com>
|
||||||
Guillaume Martres <gmartres@google.com>
|
Guillaume Martres <gmartres@google.com>
|
||||||
@@ -49,7 +44,7 @@ Henrik Lundin <hlundin@google.com>
|
|||||||
Hui Su <huisu@google.com>
|
Hui Su <huisu@google.com>
|
||||||
Ivan Maltz <ivanmaltz@google.com>
|
Ivan Maltz <ivanmaltz@google.com>
|
||||||
Jacek Caban <cjacek@gmail.com>
|
Jacek Caban <cjacek@gmail.com>
|
||||||
Jacky Chen <jackychen@google.com>
|
JackyChen <jackychen@google.com>
|
||||||
James Berry <jamesberry@google.com>
|
James Berry <jamesberry@google.com>
|
||||||
James Yu <james.yu@linaro.org>
|
James Yu <james.yu@linaro.org>
|
||||||
James Zern <jzern@google.com>
|
James Zern <jzern@google.com>
|
||||||
@@ -65,11 +60,9 @@ Jingning Han <jingning@google.com>
|
|||||||
Joey Parrish <joeyparrish@google.com>
|
Joey Parrish <joeyparrish@google.com>
|
||||||
Johann Koenig <johannkoenig@google.com>
|
Johann Koenig <johannkoenig@google.com>
|
||||||
John Koleszar <jkoleszar@google.com>
|
John Koleszar <jkoleszar@google.com>
|
||||||
Johnny Klonaris <google@jawknee.com>
|
|
||||||
John Stark <jhnstrk@gmail.com>
|
John Stark <jhnstrk@gmail.com>
|
||||||
Joshua Bleecher Snyder <josh@treelinelabs.com>
|
Joshua Bleecher Snyder <josh@treelinelabs.com>
|
||||||
Joshua Litt <joshualitt@google.com>
|
Joshua Litt <joshualitt@google.com>
|
||||||
Julia Robson <juliamrobson@gmail.com>
|
|
||||||
Justin Clift <justin@salasaga.org>
|
Justin Clift <justin@salasaga.org>
|
||||||
Justin Lebar <justin.lebar@gmail.com>
|
Justin Lebar <justin.lebar@gmail.com>
|
||||||
KO Myung-Hun <komh@chollian.net>
|
KO Myung-Hun <komh@chollian.net>
|
||||||
@@ -89,7 +82,6 @@ Mike Hommey <mhommey@mozilla.com>
|
|||||||
Mikhal Shemer <mikhal@google.com>
|
Mikhal Shemer <mikhal@google.com>
|
||||||
Minghai Shang <minghai@google.com>
|
Minghai Shang <minghai@google.com>
|
||||||
Morton Jonuschat <yabawock@gmail.com>
|
Morton Jonuschat <yabawock@gmail.com>
|
||||||
Nico Weber <thakis@chromium.org>
|
|
||||||
Parag Salasakar <img.mips1@gmail.com>
|
Parag Salasakar <img.mips1@gmail.com>
|
||||||
Pascal Massimino <pascal.massimino@gmail.com>
|
Pascal Massimino <pascal.massimino@gmail.com>
|
||||||
Patrik Westin <patrik.westin@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>
|
Rafaël Carré <funman@videolan.org>
|
||||||
Ralph Giles <giles@xiph.org>
|
Ralph Giles <giles@xiph.org>
|
||||||
Rob Bradford <rob@linux.intel.com>
|
Rob Bradford <rob@linux.intel.com>
|
||||||
Ronald S. Bultje <rsbultje@gmail.com>
|
Ronald S. Bultje <rbultje@google.com>
|
||||||
Rui Ueyama <ruiu@google.com>
|
Rui Ueyama <ruiu@google.com>
|
||||||
Sami Pietilä <samipietila@google.com>
|
Sami Pietilä <samipietila@google.com>
|
||||||
Scott Graham <scottmg@chromium.org>
|
Scott Graham <scottmg@chromium.org>
|
||||||
@@ -112,7 +104,6 @@ Scott LaVarnway <slavarnway@google.com>
|
|||||||
Sean McGovern <gseanmcg@gmail.com>
|
Sean McGovern <gseanmcg@gmail.com>
|
||||||
Sergey Ulanov <sergeyu@chromium.org>
|
Sergey Ulanov <sergeyu@chromium.org>
|
||||||
Shimon Doodkin <helpmepro1@gmail.com>
|
Shimon Doodkin <helpmepro1@gmail.com>
|
||||||
Shunyao Li <shunyaoli@google.com>
|
|
||||||
Stefan Holmer <holmer@google.com>
|
Stefan Holmer <holmer@google.com>
|
||||||
Suman Sunkara <sunkaras@google.com>
|
Suman Sunkara <sunkaras@google.com>
|
||||||
Taekhyun Kim <takim@nvidia.com>
|
Taekhyun Kim <takim@nvidia.com>
|
||||||
|
20
CHANGELOG
20
CHANGELOG
@@ -1,19 +1,7 @@
|
|||||||
2015-11-09 v1.5.0 "Javan Whistling Duck"
|
xxxx-yy-zz v1.4.0 "Changes for next release"
|
||||||
This release improves upon the VP9 encoder and speeds up the encoding and
|
vpxenc is changed to use VP9 by default.
|
||||||
decoding processes.
|
Encoder controls added for 1 pass SVC.
|
||||||
|
Decoder control to toggle on/off loopfilter.
|
||||||
- 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
|
|
||||||
|
|
||||||
2015-04-03 v1.4.0 "Indian Runner Duck"
|
2015-04-03 v1.4.0 "Indian Runner Duck"
|
||||||
This release includes significant improvements to the VP9 codec.
|
This release includes significant improvements to the VP9 codec.
|
||||||
|
4
README
4
README
@@ -59,7 +59,6 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||||||
armv7-none-rvct
|
armv7-none-rvct
|
||||||
armv7-win32-vs11
|
armv7-win32-vs11
|
||||||
armv7-win32-vs12
|
armv7-win32-vs12
|
||||||
armv7-win32-vs14
|
|
||||||
armv7s-darwin-gcc
|
armv7s-darwin-gcc
|
||||||
mips32-linux-gcc
|
mips32-linux-gcc
|
||||||
mips64-linux-gcc
|
mips64-linux-gcc
|
||||||
@@ -86,8 +85,6 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||||||
x86-win32-vs10
|
x86-win32-vs10
|
||||||
x86-win32-vs11
|
x86-win32-vs11
|
||||||
x86-win32-vs12
|
x86-win32-vs12
|
||||||
x86-win32-vs14
|
|
||||||
x86_64-android-gcc
|
|
||||||
x86_64-darwin9-gcc
|
x86_64-darwin9-gcc
|
||||||
x86_64-darwin10-gcc
|
x86_64-darwin10-gcc
|
||||||
x86_64-darwin11-gcc
|
x86_64-darwin11-gcc
|
||||||
@@ -104,7 +101,6 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||||||
x86_64-win64-vs10
|
x86_64-win64-vs10
|
||||||
x86_64-win64-vs11
|
x86_64-win64-vs11
|
||||||
x86_64-win64-vs12
|
x86_64-win64-vs12
|
||||||
x86_64-win64-vs14
|
|
||||||
generic-gnu
|
generic-gnu
|
||||||
|
|
||||||
The generic-gnu target, in conjunction with the CROSS environment variable,
|
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
|
LOCAL_ARM_MODE := arm
|
||||||
else ifeq ($(TARGET_ARCH_ABI),x86)
|
else ifeq ($(TARGET_ARCH_ABI),x86)
|
||||||
include $(CONFIG_DIR)libs-x86-android-gcc.mk
|
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)
|
else ifeq ($(TARGET_ARCH_ABI),mips)
|
||||||
include $(CONFIG_DIR)libs-mips-android-gcc.mk
|
include $(CONFIG_DIR)libs-mips-android-gcc.mk
|
||||||
else
|
else
|
||||||
@@ -166,22 +164,17 @@ endif
|
|||||||
|
|
||||||
# Add a dependency to force generation of the RTCD files.
|
# Add a dependency to force generation of the RTCD files.
|
||||||
define rtcd_dep_template
|
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)
|
ifeq ($(CONFIG_VP8), yes)
|
||||||
$$(rtcd_dep_template_SRCS): vp8_rtcd.h
|
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp8_rtcd.h
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_VP9), yes)
|
ifeq ($(CONFIG_VP9), yes)
|
||||||
$$(rtcd_dep_template_SRCS): vp9_rtcd.h
|
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp9_rtcd.h
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_VP10), yes)
|
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_scale_rtcd.h
|
||||||
$$(rtcd_dep_template_SRCS): vp10_rtcd.h
|
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_dsp_rtcd.h
|
||||||
endif
|
|
||||||
$$(rtcd_dep_template_SRCS): vpx_scale_rtcd.h
|
|
||||||
$$(rtcd_dep_template_SRCS): vpx_dsp_rtcd.h
|
|
||||||
|
|
||||||
ifneq ($(findstring $(TARGET_ARCH_ABI),x86 x86_64),)
|
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||||
$$(rtcd_dep_template_SRCS): vpx_config.asm
|
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_config.asm
|
||||||
endif
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@@ -140,8 +140,6 @@ $(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx $(STACKREALIGN)
|
|||||||
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx $(STACKREALIGN)
|
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx $(STACKREALIGN)
|
||||||
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2 $(STACKREALIGN)
|
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2 $(STACKREALIGN)
|
||||||
$(BUILD_PFX)%_avx2.c.o: 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
|
$(BUILD_PFX)%.c.d: %.c
|
||||||
$(if $(quiet),@echo " [DEP] $@")
|
$(if $(quiet),@echo " [DEP] $@")
|
||||||
@@ -287,7 +285,7 @@ define archive_template
|
|||||||
# for creating them.
|
# for creating them.
|
||||||
$(1):
|
$(1):
|
||||||
$(if $(quiet),@echo " [AR] $$@")
|
$(if $(quiet),@echo " [AR] $$@")
|
||||||
$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
|
$(qexec)$$(AR) $$(ARFLAGS) $$@ $$?
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define so_template
|
define so_template
|
||||||
|
@@ -73,7 +73,6 @@ Build options:
|
|||||||
--target=TARGET target platform tuple [generic-gnu]
|
--target=TARGET target platform tuple [generic-gnu]
|
||||||
--cpu=CPU optimize for a specific cpu rather than a family
|
--cpu=CPU optimize for a specific cpu rather than a family
|
||||||
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
|
--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_extra_warnings} emit harmless warnings (always non-fatal)
|
||||||
${toggle_werror} treat warnings as errors, if possible
|
${toggle_werror} treat warnings as errors, if possible
|
||||||
(not available with all compilers)
|
(not available with all compilers)
|
||||||
@@ -201,10 +200,6 @@ disabled(){
|
|||||||
eval test "x\$$1" = "xno"
|
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() {
|
soft_enable() {
|
||||||
for var in $*; do
|
for var in $*; do
|
||||||
if ! disabled $var; then
|
if ! disabled $var; then
|
||||||
@@ -214,10 +209,6 @@ soft_enable() {
|
|||||||
done
|
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() {
|
soft_disable() {
|
||||||
for var in $*; do
|
for var in $*; do
|
||||||
if ! enabled $var; then
|
if ! enabled $var; then
|
||||||
@@ -346,10 +337,6 @@ check_add_cflags() {
|
|||||||
check_cflags "$@" && add_cflags_only "$@"
|
check_cflags "$@" && add_cflags_only "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_add_cxxflags() {
|
|
||||||
check_cxxflags "$@" && add_cxxflags_only "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_add_asflags() {
|
check_add_asflags() {
|
||||||
log add_asflags "$@"
|
log add_asflags "$@"
|
||||||
add_asflags "$@"
|
add_asflags "$@"
|
||||||
@@ -441,7 +428,7 @@ NM=${NM}
|
|||||||
|
|
||||||
CFLAGS = ${CFLAGS}
|
CFLAGS = ${CFLAGS}
|
||||||
CXXFLAGS = ${CXXFLAGS}
|
CXXFLAGS = ${CXXFLAGS}
|
||||||
ARFLAGS = -crs\$(if \$(quiet),,v)
|
ARFLAGS = -rus\$(if \$(quiet),c,v)
|
||||||
LDFLAGS = ${LDFLAGS}
|
LDFLAGS = ${LDFLAGS}
|
||||||
ASFLAGS = ${ASFLAGS}
|
ASFLAGS = ${ASFLAGS}
|
||||||
extralibs = ${extralibs}
|
extralibs = ${extralibs}
|
||||||
@@ -516,9 +503,6 @@ process_common_cmdline() {
|
|||||||
--extra-cflags=*)
|
--extra-cflags=*)
|
||||||
extra_cflags="${optval}"
|
extra_cflags="${optval}"
|
||||||
;;
|
;;
|
||||||
--extra-cxxflags=*)
|
|
||||||
extra_cxxflags="${optval}"
|
|
||||||
;;
|
|
||||||
--enable-?*|--disable-?*)
|
--enable-?*|--disable-?*)
|
||||||
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
||||||
if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
|
if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
|
||||||
@@ -633,11 +617,6 @@ show_darwin_sdk_path() {
|
|||||||
xcodebuild -sdk $1 -version Path 2>/dev/null
|
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() {
|
process_common_toolchain() {
|
||||||
if [ -z "$toolchain" ]; then
|
if [ -z "$toolchain" ]; then
|
||||||
gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
|
gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
|
||||||
@@ -688,10 +667,6 @@ process_common_toolchain() {
|
|||||||
tgt_isa=x86_64
|
tgt_isa=x86_64
|
||||||
tgt_os=darwin14
|
tgt_os=darwin14
|
||||||
;;
|
;;
|
||||||
*darwin15*)
|
|
||||||
tgt_isa=x86_64
|
|
||||||
tgt_os=darwin15
|
|
||||||
;;
|
|
||||||
x86_64*mingw32*)
|
x86_64*mingw32*)
|
||||||
tgt_os=win64
|
tgt_os=win64
|
||||||
;;
|
;;
|
||||||
@@ -754,14 +729,13 @@ process_common_toolchain() {
|
|||||||
# platforms, so use the newest one available.
|
# platforms, so use the newest one available.
|
||||||
case ${toolchain} in
|
case ${toolchain} in
|
||||||
arm*-darwin*)
|
arm*-darwin*)
|
||||||
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
|
ios_sdk_dir="$(show_darwin_sdk_path iphoneos)"
|
||||||
iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
|
if [ -d "${ios_sdk_dir}" ]; then
|
||||||
if [ -d "${iphoneos_sdk_dir}" ]; then
|
add_cflags "-isysroot ${ios_sdk_dir}"
|
||||||
add_cflags "-isysroot ${iphoneos_sdk_dir}"
|
add_ldflags "-isysroot ${ios_sdk_dir}"
|
||||||
add_ldflags "-isysroot ${iphoneos_sdk_dir}"
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
x86*-darwin*)
|
*-darwin*)
|
||||||
osx_sdk_dir="$(show_darwin_sdk_path macosx)"
|
osx_sdk_dir="$(show_darwin_sdk_path macosx)"
|
||||||
if [ -d "${osx_sdk_dir}" ]; then
|
if [ -d "${osx_sdk_dir}" ]; then
|
||||||
add_cflags "-isysroot ${osx_sdk_dir}"
|
add_cflags "-isysroot ${osx_sdk_dir}"
|
||||||
@@ -799,10 +773,6 @@ process_common_toolchain() {
|
|||||||
add_cflags "-mmacosx-version-min=10.10"
|
add_cflags "-mmacosx-version-min=10.10"
|
||||||
add_ldflags "-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-*)
|
*-iphonesimulator-*)
|
||||||
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
|
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
|
||||||
add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
|
add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
|
||||||
@@ -841,35 +811,16 @@ process_common_toolchain() {
|
|||||||
die "Disabling neon while keeping neon-asm is not supported"
|
die "Disabling neon while keeping neon-asm is not supported"
|
||||||
fi
|
fi
|
||||||
case ${toolchain} in
|
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*)
|
*-darwin*)
|
||||||
if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
|
# Neon is guaranteed on iOS 6+ devices, while old media extensions
|
||||||
soft_enable media
|
# no longer assemble with iOS 9 SDK
|
||||||
else
|
|
||||||
soft_disable media
|
|
||||||
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-media "
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
soft_enable media
|
soft_enable media
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
armv6)
|
armv6)
|
||||||
case ${toolchain} in
|
|
||||||
*-darwin*)
|
|
||||||
if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
|
|
||||||
soft_enable media
|
soft_enable media
|
||||||
else
|
|
||||||
die "Your iOS SDK does not support armv6."
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
soft_enable media
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -987,10 +938,8 @@ EOF
|
|||||||
awk '{ print $1 }' | tail -1`
|
awk '{ print $1 }' | tail -1`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "${alt_libc}" ]; then
|
|
||||||
add_cflags "--sysroot=${alt_libc}"
|
add_cflags "--sysroot=${alt_libc}"
|
||||||
add_ldflags "--sysroot=${alt_libc}"
|
add_ldflags "--sysroot=${alt_libc}"
|
||||||
fi
|
|
||||||
|
|
||||||
# linker flag that routes around a CPU bug in some
|
# linker flag that routes around a CPU bug in some
|
||||||
# Cortex-A8 implementations (NDK Dev Guide)
|
# Cortex-A8 implementations (NDK Dev Guide)
|
||||||
@@ -1054,12 +1003,6 @@ EOF
|
|||||||
done
|
done
|
||||||
|
|
||||||
asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
|
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*)
|
linux*)
|
||||||
@@ -1138,9 +1081,7 @@ EOF
|
|||||||
CROSS=${CROSS:-g}
|
CROSS=${CROSS:-g}
|
||||||
;;
|
;;
|
||||||
os2)
|
os2)
|
||||||
disable_feature pic
|
|
||||||
AS=${AS:-nasm}
|
AS=${AS:-nasm}
|
||||||
add_ldflags -Zhigh-mem
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -1208,24 +1149,15 @@ EOF
|
|||||||
soft_enable runtime_cpu_detect
|
soft_enable runtime_cpu_detect
|
||||||
# We can't use 'check_cflags' until the compiler is configured and CC is
|
# We can't use 'check_cflags' until the compiler is configured and CC is
|
||||||
# populated.
|
# populated.
|
||||||
for ext in ${ARCH_EXT_LIST_X86}; do
|
check_gcc_machine_option mmx
|
||||||
# disable higher order extensions to simplify asm dependencies
|
check_gcc_machine_option sse
|
||||||
if [ "$disable_exts" = "yes" ]; then
|
check_gcc_machine_option sse2
|
||||||
if ! disabled $ext; then
|
check_gcc_machine_option sse3
|
||||||
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${ext} "
|
check_gcc_machine_option ssse3
|
||||||
disable_feature $ext
|
check_gcc_machine_option sse4 sse4_1
|
||||||
fi
|
check_gcc_machine_option avx
|
||||||
elif disabled $ext; then
|
check_gcc_machine_option avx2
|
||||||
disable_exts="yes"
|
|
||||||
else
|
|
||||||
# use the shortened version for the flag: sse4_1 -> sse4
|
|
||||||
check_gcc_machine_option ${ext%_*} $ext
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if enabled external_build; then
|
|
||||||
log_echo " skipping assembler detection"
|
|
||||||
else
|
|
||||||
case "${AS}" in
|
case "${AS}" in
|
||||||
auto|"")
|
auto|"")
|
||||||
which nasm >/dev/null 2>&1 && AS=nasm
|
which nasm >/dev/null 2>&1 && AS=nasm
|
||||||
@@ -1239,12 +1171,10 @@ EOF
|
|||||||
&& AS=""
|
&& AS=""
|
||||||
fi
|
fi
|
||||||
[ "${AS}" = auto ] || [ -z "${AS}" ] \
|
[ "${AS}" = auto ] || [ -z "${AS}" ] \
|
||||||
&& die "Neither yasm nor nasm have been found." \
|
&& die "Neither yasm nor nasm have been found"
|
||||||
"See the prerequisites section in the README for more info."
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
log_echo " using $AS"
|
log_echo " using $AS"
|
||||||
fi
|
|
||||||
[ "${AS##*/}" = nasm ] && add_asflags -Ox
|
[ "${AS##*/}" = nasm ] && add_asflags -Ox
|
||||||
AS_SFX=.asm
|
AS_SFX=.asm
|
||||||
case ${tgt_os} in
|
case ${tgt_os} in
|
||||||
@@ -1280,13 +1210,6 @@ EOF
|
|||||||
enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64"
|
enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64"
|
||||||
add_cflags ${sim_arch}
|
add_cflags ${sim_arch}
|
||||||
add_ldflags ${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)
|
os2)
|
||||||
add_asflags -f aout
|
add_asflags -f aout
|
||||||
@@ -1400,6 +1323,12 @@ EOF
|
|||||||
add_cflags -D_LARGEFILE_SOURCE
|
add_cflags -D_LARGEFILE_SOURCE
|
||||||
add_cflags -D_FILE_OFFSET_BITS=64
|
add_cflags -D_FILE_OFFSET_BITS=64
|
||||||
fi
|
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() {
|
process_toolchain() {
|
||||||
|
@@ -73,10 +73,6 @@ generate_filter() {
|
|||||||
open_tag File RelativePath="$f"
|
open_tag File RelativePath="$f"
|
||||||
|
|
||||||
if [ "$pat" == "asm" ] && $asm_use_custom_step; then
|
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 plat in "${platforms[@]}"; do
|
||||||
for cfg in Debug Release; do
|
for cfg in Debug Release; do
|
||||||
open_tag FileConfiguration \
|
open_tag FileConfiguration \
|
||||||
|
@@ -19,13 +19,13 @@ show_help() {
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: ${self_basename} [options] file1 [file2 ...]
|
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.
|
files.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--help Print this message
|
--help Print this message
|
||||||
--out=outfile Redirect output to a file
|
--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
|
--target=isa-os-cc Target specifier
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
exit 1
|
||||||
@@ -255,7 +255,7 @@ for opt in "$@"; do
|
|||||||
;;
|
;;
|
||||||
--ver=*) vs_ver="$optval"
|
--ver=*) vs_ver="$optval"
|
||||||
case $optval in
|
case $optval in
|
||||||
[789]|10|11|12|14)
|
[789]|10|11|12)
|
||||||
;;
|
;;
|
||||||
*) die Unrecognized Visual Studio Version in $opt
|
*) die Unrecognized Visual Studio Version in $opt
|
||||||
;;
|
;;
|
||||||
@@ -300,15 +300,12 @@ case "${vs_ver:-8}" in
|
|||||||
12) sln_vers="12.00"
|
12) sln_vers="12.00"
|
||||||
sln_vers_str="Visual Studio 2013"
|
sln_vers_str="Visual Studio 2013"
|
||||||
;;
|
;;
|
||||||
14) sln_vers="14.00"
|
|
||||||
sln_vers_str="Visual Studio 2015"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
case "${vs_ver:-8}" in
|
case "${vs_ver:-8}" in
|
||||||
[789])
|
[789])
|
||||||
sfx=vcproj
|
sfx=vcproj
|
||||||
;;
|
;;
|
||||||
10|11|12|14)
|
10|11|12)
|
||||||
sfx=vcxproj
|
sfx=vcxproj
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@@ -34,7 +34,7 @@ Options:
|
|||||||
--name=project_name Name of the project (required)
|
--name=project_name Name of the project (required)
|
||||||
--proj-guid=GUID GUID to use for the project
|
--proj-guid=GUID GUID to use for the project
|
||||||
--module-def=filename File containing export definitions (for DLLs)
|
--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
|
--src-path-bare=dir Path to root of source tree
|
||||||
-Ipath/to/include Additional include directories
|
-Ipath/to/include Additional include directories
|
||||||
-DFLAG[=value] Preprocessor macros to define
|
-DFLAG[=value] Preprocessor macros to define
|
||||||
@@ -168,7 +168,7 @@ for opt in "$@"; do
|
|||||||
--ver=*)
|
--ver=*)
|
||||||
vs_ver="$optval"
|
vs_ver="$optval"
|
||||||
case "$optval" in
|
case "$optval" in
|
||||||
10|11|12|14)
|
10|11|12)
|
||||||
;;
|
;;
|
||||||
*) die Unrecognized Visual Studio Version in $opt
|
*) die Unrecognized Visual Studio Version in $opt
|
||||||
;;
|
;;
|
||||||
@@ -218,7 +218,7 @@ guid=${guid:-`generate_uuid`}
|
|||||||
asm_use_custom_step=false
|
asm_use_custom_step=false
|
||||||
uses_asm=${uses_asm:-false}
|
uses_asm=${uses_asm:-false}
|
||||||
case "${vs_ver:-11}" in
|
case "${vs_ver:-11}" in
|
||||||
10|11|12|14)
|
10|11|12)
|
||||||
asm_use_custom_step=$uses_asm
|
asm_use_custom_step=$uses_asm
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -344,9 +344,6 @@ generate_vcxproj() {
|
|||||||
# has to enable AppContainerApplication as well.
|
# has to enable AppContainerApplication as well.
|
||||||
tag_content PlatformToolset v120
|
tag_content PlatformToolset v120
|
||||||
fi
|
fi
|
||||||
if [ "$vs_ver" = "14" ]; then
|
|
||||||
tag_content PlatformToolset v140
|
|
||||||
fi
|
|
||||||
tag_content CharacterSet Unicode
|
tag_content CharacterSet Unicode
|
||||||
if [ "$config" = "Release" ]; then
|
if [ "$config" = "Release" ]; then
|
||||||
tag_content WholeProgramOptimization true
|
tag_content WholeProgramOptimization true
|
||||||
|
@@ -25,42 +25,31 @@ CONFIGURE_ARGS="--disable-docs
|
|||||||
DIST_DIR="_dist"
|
DIST_DIR="_dist"
|
||||||
FRAMEWORK_DIR="VPX.framework"
|
FRAMEWORK_DIR="VPX.framework"
|
||||||
HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx"
|
HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx"
|
||||||
|
MAKE_JOBS=1
|
||||||
SCRIPT_DIR=$(dirname "$0")
|
SCRIPT_DIR=$(dirname "$0")
|
||||||
LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd)
|
LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd)
|
||||||
LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo)
|
LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo)
|
||||||
ORIG_PWD="$(pwd)"
|
ORIG_PWD="$(pwd)"
|
||||||
ARM_TARGETS="arm64-darwin-gcc
|
TARGETS="arm64-darwin-gcc
|
||||||
armv7-darwin-gcc
|
armv7-darwin-gcc
|
||||||
armv7s-darwin-gcc"
|
armv7s-darwin-gcc
|
||||||
SIM_TARGETS="x86-iphonesimulator-gcc
|
x86-iphonesimulator-gcc
|
||||||
x86_64-iphonesimulator-gcc"
|
x86_64-iphonesimulator-gcc"
|
||||||
OSX_TARGETS="x86-darwin15-gcc
|
|
||||||
x86_64-darwin15-gcc"
|
|
||||||
TARGETS="${ARM_TARGETS} ${SIM_TARGETS}"
|
|
||||||
|
|
||||||
# Configures for the target specified by $1, and invokes make with the dist
|
# Configures for the target specified by $1, and invokes make with the dist
|
||||||
# target using $DIST_DIR as the distribution output directory.
|
# target using $DIST_DIR as the distribution output directory.
|
||||||
build_target() {
|
build_target() {
|
||||||
local target="$1"
|
local target="$1"
|
||||||
local old_pwd="$(pwd)"
|
local old_pwd="$(pwd)"
|
||||||
local target_specific_flags=""
|
|
||||||
|
|
||||||
vlog "***Building target: ${target}***"
|
vlog "***Building target: ${target}***"
|
||||||
|
|
||||||
case "${target}" in
|
|
||||||
x86-*)
|
|
||||||
target_specific_flags="--enable-pic"
|
|
||||||
vlog "Enabled PIC for ${target}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
mkdir "${target}"
|
mkdir "${target}"
|
||||||
cd "${target}"
|
cd "${target}"
|
||||||
eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \
|
eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \
|
||||||
${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${target_specific_flags} \
|
${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${devnull}
|
||||||
${devnull}
|
|
||||||
export DIST_DIR
|
export DIST_DIR
|
||||||
eval make dist ${devnull}
|
eval make -j ${MAKE_JOBS} dist ${devnull}
|
||||||
cd "${old_pwd}"
|
cd "${old_pwd}"
|
||||||
|
|
||||||
vlog "***Done building target: ${target}***"
|
vlog "***Done building target: ${target}***"
|
||||||
@@ -200,29 +189,16 @@ cleanup() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
print_list() {
|
|
||||||
local indent="$1"
|
|
||||||
shift
|
|
||||||
local list="$@"
|
|
||||||
for entry in ${list}; do
|
|
||||||
echo "${indent}${entry}"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
iosbuild_usage() {
|
iosbuild_usage() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Usage: ${0##*/} [arguments]
|
Usage: ${0##*/} [arguments]
|
||||||
--help: Display this message and exit.
|
--help: Display this message and exit.
|
||||||
--extra-configure-args <args>: Extra args to pass when configuring libvpx.
|
--extra-configure-args <args>: Extra args to pass when configuring libvpx.
|
||||||
--macosx: Uses darwin15 targets instead of iphonesimulator targets for x86
|
--jobs: Number of make jobs.
|
||||||
and x86_64. Allows linking to framework when builds target MacOSX
|
|
||||||
instead of iOS.
|
|
||||||
--preserve-build-output: Do not delete the build directory.
|
--preserve-build-output: Do not delete the build directory.
|
||||||
--show-build-output: Show output from each library build.
|
--show-build-output: Show output from each library build.
|
||||||
--targets <targets>: Override default target list. Defaults:
|
--targets <targets>: Override default target list. Defaults:
|
||||||
$(print_list " " ${TARGETS})
|
${TARGETS}
|
||||||
--test-link: Confirms all targets can be linked. Functionally identical to
|
|
||||||
passing --enable-examples via --extra-configure-args.
|
|
||||||
--verbose: Output information about the environment and each stage of the
|
--verbose: Output information about the environment and each stage of the
|
||||||
build.
|
build.
|
||||||
EOF
|
EOF
|
||||||
@@ -251,22 +227,20 @@ while [ -n "$1" ]; do
|
|||||||
iosbuild_usage
|
iosbuild_usage
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
--jobs)
|
||||||
|
MAKE_JOBS="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--preserve-build-output)
|
--preserve-build-output)
|
||||||
PRESERVE_BUILD_OUTPUT=yes
|
PRESERVE_BUILD_OUTPUT=yes
|
||||||
;;
|
;;
|
||||||
--show-build-output)
|
--show-build-output)
|
||||||
devnull=
|
devnull=
|
||||||
;;
|
;;
|
||||||
--test-link)
|
|
||||||
EXTRA_CONFIGURE_ARGS="${EXTRA_CONFIGURE_ARGS} --enable-examples"
|
|
||||||
;;
|
|
||||||
--targets)
|
--targets)
|
||||||
TARGETS="$2"
|
TARGETS="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--macosx)
|
|
||||||
TARGETS="${ARM_TARGETS} ${OSX_TARGETS}"
|
|
||||||
;;
|
|
||||||
--verbose)
|
--verbose)
|
||||||
VERBOSE=yes
|
VERBOSE=yes
|
||||||
;;
|
;;
|
||||||
@@ -286,17 +260,15 @@ cat << EOF
|
|||||||
EXTRA_CONFIGURE_ARGS=${EXTRA_CONFIGURE_ARGS}
|
EXTRA_CONFIGURE_ARGS=${EXTRA_CONFIGURE_ARGS}
|
||||||
FRAMEWORK_DIR=${FRAMEWORK_DIR}
|
FRAMEWORK_DIR=${FRAMEWORK_DIR}
|
||||||
HEADER_DIR=${HEADER_DIR}
|
HEADER_DIR=${HEADER_DIR}
|
||||||
|
MAKE_JOBS=${MAKE_JOBS}
|
||||||
|
PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
|
||||||
LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR}
|
LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR}
|
||||||
LIPO=${LIPO}
|
LIPO=${LIPO}
|
||||||
MAKEFLAGS=${MAKEFLAGS}
|
|
||||||
ORIG_PWD=${ORIG_PWD}
|
ORIG_PWD=${ORIG_PWD}
|
||||||
PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
|
TARGETS="${TARGETS}"
|
||||||
TARGETS="$(print_list "" ${TARGETS})"
|
|
||||||
OSX_TARGETS="${OSX_TARGETS}"
|
|
||||||
SIM_TARGETS="${SIM_TARGETS}"
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build_framework "${TARGETS}"
|
build_framework "${TARGETS}"
|
||||||
echo "Successfully built '${FRAMEWORK_DIR}' for:"
|
echo "Successfully built '${FRAMEWORK_DIR}' for:"
|
||||||
print_list "" ${TARGETS}
|
echo " ${TARGETS}"
|
||||||
|
@@ -319,15 +319,14 @@ EOF
|
|||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
#if HAVE_DSPR2
|
#if HAVE_DSPR2
|
||||||
void vpx_dsputil_static_init();
|
|
||||||
#if CONFIG_VP8
|
#if CONFIG_VP8
|
||||||
void dsputil_static_init();
|
void dsputil_static_init();
|
||||||
#endif
|
|
||||||
|
|
||||||
vpx_dsputil_static_init();
|
|
||||||
#if CONFIG_VP8
|
|
||||||
dsputil_static_init();
|
dsputil_static_init();
|
||||||
#endif
|
#endif
|
||||||
|
#if CONFIG_VP9
|
||||||
|
void vp9_dsputil_static_init();
|
||||||
|
vp9_dsputil_static_init();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -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
|
|
53
configure
vendored
53
configure
vendored
@@ -35,12 +35,8 @@ Advanced options:
|
|||||||
${toggle_debug_libs} in/exclude debug version of libraries
|
${toggle_debug_libs} in/exclude debug version of libraries
|
||||||
${toggle_static_msvcrt} use static MSVCRT (VS builds only)
|
${toggle_static_msvcrt} use static MSVCRT (VS builds only)
|
||||||
${toggle_vp9_highbitdepth} use VP9 high bit depth (10/12) profiles
|
${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_vp8} VP8 codec support
|
||||||
${toggle_vp9} VP9 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_internal_stats} output of encoder internal stats for debug, if supported (encoders)
|
||||||
${toggle_postproc} postprocessing
|
${toggle_postproc} postprocessing
|
||||||
${toggle_vp9_postproc} vp9 specific postprocessing
|
${toggle_vp9_postproc} vp9 specific postprocessing
|
||||||
@@ -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-none-rvct" #neon Cortex-A8
|
||||||
all_platforms="${all_platforms} armv7-win32-vs11"
|
all_platforms="${all_platforms} armv7-win32-vs11"
|
||||||
all_platforms="${all_platforms} armv7-win32-vs12"
|
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} armv7s-darwin-gcc"
|
||||||
all_platforms="${all_platforms} mips32-linux-gcc"
|
all_platforms="${all_platforms} mips32-linux-gcc"
|
||||||
all_platforms="${all_platforms} mips64-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-darwin12-gcc"
|
||||||
all_platforms="${all_platforms} x86-darwin13-gcc"
|
all_platforms="${all_platforms} x86-darwin13-gcc"
|
||||||
all_platforms="${all_platforms} x86-darwin14-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-iphonesimulator-gcc"
|
||||||
all_platforms="${all_platforms} x86-linux-gcc"
|
all_platforms="${all_platforms} x86-linux-gcc"
|
||||||
all_platforms="${all_platforms} x86-linux-icc"
|
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-vs10"
|
||||||
all_platforms="${all_platforms} x86-win32-vs11"
|
all_platforms="${all_platforms} x86-win32-vs11"
|
||||||
all_platforms="${all_platforms} x86-win32-vs12"
|
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-darwin9-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-darwin10-gcc"
|
all_platforms="${all_platforms} x86_64-darwin10-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-darwin11-gcc"
|
all_platforms="${all_platforms} x86_64-darwin11-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-darwin12-gcc"
|
all_platforms="${all_platforms} x86_64-darwin12-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-darwin13-gcc"
|
all_platforms="${all_platforms} x86_64-darwin13-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-darwin14-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-iphonesimulator-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-linux-gcc"
|
all_platforms="${all_platforms} x86_64-linux-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-linux-icc"
|
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-vs10"
|
||||||
all_platforms="${all_platforms} x86_64-win64-vs11"
|
all_platforms="${all_platforms} x86_64-win64-vs11"
|
||||||
all_platforms="${all_platforms} x86_64-win64-vs12"
|
all_platforms="${all_platforms} x86_64-win64-vs12"
|
||||||
all_platforms="${all_platforms} x86_64-win64-vs14"
|
|
||||||
all_platforms="${all_platforms} generic-gnu"
|
all_platforms="${all_platforms} generic-gnu"
|
||||||
|
|
||||||
# all_targets is a list of all targets that can be configured
|
# 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
|
# disable codecs when their source directory does not exist
|
||||||
[ -d "${source_path}/vp8" ] || disable_feature vp8
|
[ -d "${source_path}/vp8" ] || disable_feature vp8
|
||||||
[ -d "${source_path}/vp9" ] || disable_feature vp9
|
[ -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
|
# install everything except the sources, by default. sources will have
|
||||||
# to be enabled when doing dist builds, since that's no longer a common
|
# to be enabled when doing dist builds, since that's no longer a common
|
||||||
@@ -222,13 +208,10 @@ CODECS="
|
|||||||
vp8_decoder
|
vp8_decoder
|
||||||
vp9_encoder
|
vp9_encoder
|
||||||
vp9_decoder
|
vp9_decoder
|
||||||
vp10_encoder
|
|
||||||
vp10_decoder
|
|
||||||
"
|
"
|
||||||
CODEC_FAMILIES="
|
CODEC_FAMILIES="
|
||||||
vp8
|
vp8
|
||||||
vp9
|
vp9
|
||||||
vp10
|
|
||||||
"
|
"
|
||||||
|
|
||||||
ARCH_LIST="
|
ARCH_LIST="
|
||||||
@@ -237,16 +220,6 @@ ARCH_LIST="
|
|||||||
x86
|
x86
|
||||||
x86_64
|
x86_64
|
||||||
"
|
"
|
||||||
ARCH_EXT_LIST_X86="
|
|
||||||
mmx
|
|
||||||
sse
|
|
||||||
sse2
|
|
||||||
sse3
|
|
||||||
ssse3
|
|
||||||
sse4_1
|
|
||||||
avx
|
|
||||||
avx2
|
|
||||||
"
|
|
||||||
ARCH_EXT_LIST="
|
ARCH_EXT_LIST="
|
||||||
edsp
|
edsp
|
||||||
media
|
media
|
||||||
@@ -258,7 +231,14 @@ ARCH_EXT_LIST="
|
|||||||
msa
|
msa
|
||||||
mips64
|
mips64
|
||||||
|
|
||||||
${ARCH_EXT_LIST_X86}
|
mmx
|
||||||
|
sse
|
||||||
|
sse2
|
||||||
|
sse3
|
||||||
|
ssse3
|
||||||
|
sse4_1
|
||||||
|
avx
|
||||||
|
avx2
|
||||||
"
|
"
|
||||||
HAVE_LIST="
|
HAVE_LIST="
|
||||||
${ARCH_EXT_LIST}
|
${ARCH_EXT_LIST}
|
||||||
@@ -271,8 +251,9 @@ HAVE_LIST="
|
|||||||
EXPERIMENT_LIST="
|
EXPERIMENT_LIST="
|
||||||
spatial_svc
|
spatial_svc
|
||||||
fp_mb_stats
|
fp_mb_stats
|
||||||
|
full_buffer_test
|
||||||
|
internal_resize
|
||||||
emulate_hardware
|
emulate_hardware
|
||||||
misc_fixes
|
|
||||||
"
|
"
|
||||||
CONFIG_LIST="
|
CONFIG_LIST="
|
||||||
dependency_tracking
|
dependency_tracking
|
||||||
@@ -325,7 +306,6 @@ CONFIG_LIST="
|
|||||||
vp9_temporal_denoising
|
vp9_temporal_denoising
|
||||||
coefficient_range_checking
|
coefficient_range_checking
|
||||||
vp9_highbitdepth
|
vp9_highbitdepth
|
||||||
better_hw_compatibility
|
|
||||||
experimental
|
experimental
|
||||||
size_limit
|
size_limit
|
||||||
${EXPERIMENT_LIST}
|
${EXPERIMENT_LIST}
|
||||||
@@ -384,7 +364,6 @@ CMDLINE_SELECT="
|
|||||||
temporal_denoising
|
temporal_denoising
|
||||||
vp9_temporal_denoising
|
vp9_temporal_denoising
|
||||||
coefficient_range_checking
|
coefficient_range_checking
|
||||||
better_hw_compatibility
|
|
||||||
vp9_highbitdepth
|
vp9_highbitdepth
|
||||||
experimental
|
experimental
|
||||||
"
|
"
|
||||||
@@ -661,7 +640,7 @@ process_toolchain() {
|
|||||||
VCPROJ_SFX=vcproj
|
VCPROJ_SFX=vcproj
|
||||||
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_proj.sh
|
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_proj.sh
|
||||||
;;
|
;;
|
||||||
10|11|12|14)
|
10|11|12)
|
||||||
VCPROJ_SFX=vcxproj
|
VCPROJ_SFX=vcxproj
|
||||||
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
|
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
|
||||||
enabled werror && gen_vcproj_cmd="${gen_vcproj_cmd} --enable-werror"
|
enabled werror && gen_vcproj_cmd="${gen_vcproj_cmd} --enable-werror"
|
||||||
@@ -727,16 +706,6 @@ EOF
|
|||||||
esac
|
esac
|
||||||
# libwebm needs to be linked with C++ standard library
|
# libwebm needs to be linked with C++ standard library
|
||||||
enabled webm_io && LD=${CXX}
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
16
examples.mk
16
examples.mk
@@ -22,22 +22,19 @@ LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \
|
|||||||
third_party/libyuv/source/planar_functions.cc \
|
third_party/libyuv/source/planar_functions.cc \
|
||||||
third_party/libyuv/source/row_any.cc \
|
third_party/libyuv/source/row_any.cc \
|
||||||
third_party/libyuv/source/row_common.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_mips.cc \
|
||||||
third_party/libyuv/source/row_neon.cc \
|
third_party/libyuv/source/row_neon.cc \
|
||||||
third_party/libyuv/source/row_neon64.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/row_win.cc \
|
||||||
third_party/libyuv/source/scale.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_common.cc \
|
||||||
third_party/libyuv/source/scale_gcc.cc \
|
|
||||||
third_party/libyuv/source/scale_mips.cc \
|
third_party/libyuv/source/scale_mips.cc \
|
||||||
third_party/libyuv/source/scale_neon.cc \
|
third_party/libyuv/source/scale_neon.cc \
|
||||||
third_party/libyuv/source/scale_neon64.cc \
|
third_party/libyuv/source/scale_neon64.cc \
|
||||||
|
third_party/libyuv/source/scale_posix.cc \
|
||||||
third_party/libyuv/source/scale_win.cc \
|
third_party/libyuv/source/scale_win.cc \
|
||||||
|
|
||||||
LIBWEBM_COMMON_SRCS += third_party/libwebm/webmids.hpp
|
|
||||||
|
|
||||||
LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \
|
LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \
|
||||||
third_party/libwebm/mkvmuxerutil.cpp \
|
third_party/libwebm/mkvmuxerutil.cpp \
|
||||||
third_party/libwebm/mkvwriter.cpp \
|
third_party/libwebm/mkvwriter.cpp \
|
||||||
@@ -45,7 +42,8 @@ LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \
|
|||||||
third_party/libwebm/mkvmuxertypes.hpp \
|
third_party/libwebm/mkvmuxertypes.hpp \
|
||||||
third_party/libwebm/mkvmuxerutil.hpp \
|
third_party/libwebm/mkvmuxerutil.hpp \
|
||||||
third_party/libwebm/mkvparser.hpp \
|
third_party/libwebm/mkvparser.hpp \
|
||||||
third_party/libwebm/mkvwriter.hpp
|
third_party/libwebm/mkvwriter.hpp \
|
||||||
|
third_party/libwebm/webmids.hpp
|
||||||
|
|
||||||
LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser.cpp \
|
LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser.cpp \
|
||||||
third_party/libwebm/mkvreader.cpp \
|
third_party/libwebm/mkvreader.cpp \
|
||||||
@@ -69,7 +67,6 @@ ifeq ($(CONFIG_LIBYUV),yes)
|
|||||||
vpxdec.SRCS += $(LIBYUV_SRCS)
|
vpxdec.SRCS += $(LIBYUV_SRCS)
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_WEBM_IO),yes)
|
ifeq ($(CONFIG_WEBM_IO),yes)
|
||||||
vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS)
|
|
||||||
vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS)
|
vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS)
|
||||||
vpxdec.SRCS += webmdec.cc webmdec.h
|
vpxdec.SRCS += webmdec.cc webmdec.h
|
||||||
endif
|
endif
|
||||||
@@ -91,7 +88,6 @@ ifeq ($(CONFIG_LIBYUV),yes)
|
|||||||
vpxenc.SRCS += $(LIBYUV_SRCS)
|
vpxenc.SRCS += $(LIBYUV_SRCS)
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_WEBM_IO),yes)
|
ifeq ($(CONFIG_WEBM_IO),yes)
|
||||||
vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS)
|
|
||||||
vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS)
|
vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS)
|
||||||
vpxenc.SRCS += webmenc.cc webmenc.h
|
vpxenc.SRCS += webmenc.cc webmenc.h
|
||||||
endif
|
endif
|
||||||
@@ -328,8 +324,8 @@ endif
|
|||||||
# the makefiles). We may want to revisit this.
|
# the makefiles). We may want to revisit this.
|
||||||
define vcproj_template
|
define vcproj_template
|
||||||
$(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
|
$(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
|
||||||
$(if $(quiet),@echo " [vcproj] $$@")
|
@echo " [vcproj] $$@"
|
||||||
$(qexec)$$(GEN_VCPROJ)\
|
$$(GEN_VCPROJ)\
|
||||||
--exe\
|
--exe\
|
||||||
--target=$$(TOOLCHAIN)\
|
--target=$$(TOOLCHAIN)\
|
||||||
--name=$$(@:.$(VCPROJ_SFX)=)\
|
--name=$$(@:.$(VCPROJ_SFX)=)\
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
#include "../tools_common.h"
|
#include "../tools_common.h"
|
||||||
#include "../video_writer.h"
|
#include "../video_writer.h"
|
||||||
|
|
||||||
#include "../vpx_ports/vpx_timer.h"
|
|
||||||
#include "vpx/svc_context.h"
|
#include "vpx/svc_context.h"
|
||||||
#include "vpx/vp8cx.h"
|
#include "vpx/vp8cx.h"
|
||||||
#include "vpx/vpx_encoder.h"
|
#include "vpx/vpx_encoder.h"
|
||||||
@@ -80,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");
|
ARG_DEF(NULL, "rc-end-usage", 1, "0 - 3: VBR, CBR, CQ, Q");
|
||||||
static const arg_def_t speed_arg =
|
static const arg_def_t speed_arg =
|
||||||
ARG_DEF("sp", "speed", 1, "speed configuration");
|
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
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
static const struct arg_enum_list bitdepth_enum[] = {
|
static const struct arg_enum_list bitdepth_enum[] = {
|
||||||
@@ -103,7 +100,7 @@ static const arg_def_t *svc_args[] = {
|
|||||||
&kf_dist_arg, &scale_factors_arg, &passes_arg, &pass_arg,
|
&kf_dist_arg, &scale_factors_arg, &passes_arg, &pass_arg,
|
||||||
&fpf_name_arg, &min_q_arg, &max_q_arg, &min_bitrate_arg,
|
&fpf_name_arg, &min_q_arg, &max_q_arg, &min_bitrate_arg,
|
||||||
&max_bitrate_arg, &temporal_layers_arg, &temporal_layering_mode_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
|
#if OUTPUT_RC_STATS
|
||||||
&output_rc_stats_arg,
|
&output_rc_stats_arg,
|
||||||
#endif
|
#endif
|
||||||
@@ -223,8 +220,6 @@ static void parse_command_line(int argc, const char **argv_,
|
|||||||
#endif
|
#endif
|
||||||
} else if (arg_match(&arg, &speed_arg, argi)) {
|
} else if (arg_match(&arg, &speed_arg, argi)) {
|
||||||
svc_ctx->speed = arg_parse_uint(&arg);
|
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)) {
|
} else if (arg_match(&arg, &threads_arg, argi)) {
|
||||||
svc_ctx->threads = arg_parse_uint(&arg);
|
svc_ctx->threads = arg_parse_uint(&arg);
|
||||||
} else if (arg_match(&arg, &temporal_layering_mode_arg, argi)) {
|
} else if (arg_match(&arg, &temporal_layering_mode_arg, argi)) {
|
||||||
@@ -408,9 +403,6 @@ static void set_rate_control_stats(struct RateControlStats *rc,
|
|||||||
for (tl = 0; tl < cfg->ts_number_layers; ++tl) {
|
for (tl = 0; tl < cfg->ts_number_layers; ++tl) {
|
||||||
const int layer = sl * cfg->ts_number_layers + tl;
|
const int layer = sl * cfg->ts_number_layers + tl;
|
||||||
const int tlayer0 = sl * cfg->ts_number_layers;
|
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];
|
framerate / cfg->ts_rate_decimator[tl];
|
||||||
if (tl > 0) {
|
if (tl > 0) {
|
||||||
@@ -547,59 +539,6 @@ vpx_codec_err_t parse_superframe_index(const uint8_t *data,
|
|||||||
}
|
}
|
||||||
#endif
|
#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) {
|
int main(int argc, const char **argv) {
|
||||||
AppInput app_input = {0};
|
AppInput app_input = {0};
|
||||||
VpxVideoWriter *writer = NULL;
|
VpxVideoWriter *writer = NULL;
|
||||||
@@ -620,14 +559,11 @@ int main(int argc, const char **argv) {
|
|||||||
VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = {NULL};
|
VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = {NULL};
|
||||||
struct RateControlStats rc;
|
struct RateControlStats rc;
|
||||||
vpx_svc_layer_id_t layer_id;
|
vpx_svc_layer_id_t layer_id;
|
||||||
vpx_svc_ref_frame_config_t ref_frame_config;
|
|
||||||
int sl, tl;
|
int sl, tl;
|
||||||
double sum_bitrate = 0.0;
|
double sum_bitrate = 0.0;
|
||||||
double sum_bitrate2 = 0.0;
|
double sum_bitrate2 = 0.0;
|
||||||
double framerate = 30.0;
|
double framerate = 30.0;
|
||||||
#endif
|
#endif
|
||||||
struct vpx_usec_timer timer;
|
|
||||||
int64_t cx_time = 0;
|
|
||||||
memset(&svc_ctx, 0, sizeof(svc_ctx));
|
memset(&svc_ctx, 0, sizeof(svc_ctx));
|
||||||
svc_ctx.log_print = 1;
|
svc_ctx.log_print = 1;
|
||||||
exec_name = argv[0];
|
exec_name = argv[0];
|
||||||
@@ -696,9 +632,6 @@ int main(int argc, const char **argv) {
|
|||||||
vpx_codec_control(&codec, VP8E_SET_CPUUSED, svc_ctx.speed);
|
vpx_codec_control(&codec, VP8E_SET_CPUUSED, svc_ctx.speed);
|
||||||
if (svc_ctx.threads)
|
if (svc_ctx.threads)
|
||||||
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (svc_ctx.threads >> 1));
|
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
|
// Encode frames
|
||||||
while (!end_of_stream) {
|
while (!end_of_stream) {
|
||||||
@@ -710,43 +643,9 @@ int main(int argc, const char **argv) {
|
|||||||
end_of_stream = 1;
|
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),
|
res = vpx_svc_encode(&svc_ctx, &codec, (end_of_stream ? NULL : &raw),
|
||||||
pts, frame_duration, svc_ctx.speed >= 5 ?
|
pts, frame_duration, svc_ctx.speed >= 5 ?
|
||||||
VPX_DL_REALTIME : VPX_DL_GOOD_QUALITY);
|
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));
|
printf("%s", vpx_svc_get_message(&svc_ctx));
|
||||||
if (res != VPX_CODEC_OK) {
|
if (res != VPX_CODEC_OK) {
|
||||||
@@ -771,17 +670,10 @@ int main(int argc, const char **argv) {
|
|||||||
vpx_codec_control(&codec, VP9E_GET_SVC_LAYER_ID, &layer_id);
|
vpx_codec_control(&codec, VP9E_GET_SVC_LAYER_ID, &layer_id);
|
||||||
parse_superframe_index(cx_pkt->data.frame.buf,
|
parse_superframe_index(cx_pkt->data.frame.buf,
|
||||||
cx_pkt->data.frame.sz, sizes, &count);
|
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) {
|
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
|
||||||
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
|
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
|
||||||
layer_id.temporal_layer_id];
|
layer_id.temporal_layer_id];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
for (tl = layer_id.temporal_layer_id;
|
for (tl = layer_id.temporal_layer_id;
|
||||||
tl < enc_cfg.ts_number_layers; ++tl) {
|
tl < enc_cfg.ts_number_layers; ++tl) {
|
||||||
vpx_video_writer_write_frame(outfile[tl],
|
vpx_video_writer_write_frame(outfile[tl],
|
||||||
@@ -871,16 +763,6 @@ int main(int argc, const char **argv) {
|
|||||||
pts += frame_duration;
|
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);
|
printf("Processed %d frames\n", frame_cnt);
|
||||||
fclose(infile);
|
fclose(infile);
|
||||||
#if OUTPUT_RC_STATS
|
#if OUTPUT_RC_STATS
|
||||||
@@ -902,10 +784,6 @@ int main(int argc, const char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#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);
|
vpx_img_free(&raw);
|
||||||
// display average size, psnr
|
// display average size, psnr
|
||||||
printf("%s", vpx_svc_dump_statistics(&svc_ctx));
|
printf("%s", vpx_svc_dump_statistics(&svc_ctx));
|
||||||
|
@@ -684,15 +684,14 @@ int main(int argc, char **argv) {
|
|||||||
if (strncmp(encoder->name, "vp8", 3) == 0) {
|
if (strncmp(encoder->name, "vp8", 3) == 0) {
|
||||||
vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed);
|
vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed);
|
||||||
vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, kDenoiserOff);
|
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) {
|
} else if (strncmp(encoder->name, "vp9", 3) == 0) {
|
||||||
vpx_svc_extra_cfg_t svc_params;
|
vpx_svc_extra_cfg_t svc_params;
|
||||||
vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
|
vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
|
||||||
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
|
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_FRAME_PERIODIC_BOOST, 0);
|
||||||
vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0);
|
vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0);
|
||||||
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
|
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 0);
|
||||||
vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0);
|
|
||||||
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (cfg.g_threads >> 1));
|
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))
|
if (vpx_codec_control(&codec, VP9E_SET_SVC, layering_mode > 0 ? 1: 0))
|
||||||
die_codec(&codec, "Failed to set SVC");
|
die_codec(&codec, "Failed to set SVC");
|
||||||
|
45
libs.mk
45
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
|
include $(SRC_PATH_BARE)/vpx_dsp/vpx_dsp.mk
|
||||||
CODEC_SRCS-yes += $(addprefix vpx_dsp/,$(call enabled,DSP_SRCS))
|
CODEC_SRCS-yes += $(addprefix vpx_dsp/,$(call enabled,DSP_SRCS))
|
||||||
|
|
||||||
include $(SRC_PATH_BARE)/vpx_util/vpx_util.mk
|
ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
|
||||||
CODEC_SRCS-yes += $(addprefix vpx_util/,$(call enabled,UTIL_SRCS))
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_VP8),yes)
|
|
||||||
VP8_PREFIX=vp8/
|
VP8_PREFIX=vp8/
|
||||||
include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk
|
include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk
|
||||||
endif
|
endif
|
||||||
@@ -76,7 +73,7 @@ ifeq ($(CONFIG_VP8_DECODER),yes)
|
|||||||
CODEC_DOC_SECTIONS += vp8 vp8_decoder
|
CODEC_DOC_SECTIONS += vp8 vp8_decoder
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_VP9),yes)
|
ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),)
|
||||||
VP9_PREFIX=vp9/
|
VP9_PREFIX=vp9/
|
||||||
include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9_common.mk
|
include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9_common.mk
|
||||||
endif
|
endif
|
||||||
@@ -109,40 +106,6 @@ endif
|
|||||||
VP9_PREFIX=vp9/
|
VP9_PREFIX=vp9/
|
||||||
$(BUILD_PFX)$(VP9_PREFIX)%.c.o: CFLAGS += -Wextra
|
$(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)
|
ifeq ($(CONFIG_ENCODERS),yes)
|
||||||
CODEC_DOC_SECTIONS += encoder
|
CODEC_DOC_SECTIONS += encoder
|
||||||
endif
|
endif
|
||||||
@@ -260,7 +223,7 @@ OBJS-yes += $(LIBVPX_OBJS)
|
|||||||
LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
|
LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
|
||||||
$(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
|
$(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
|
||||||
|
|
||||||
SO_VERSION_MAJOR := 3
|
SO_VERSION_MAJOR := 2
|
||||||
SO_VERSION_MINOR := 0
|
SO_VERSION_MINOR := 0
|
||||||
SO_VERSION_PATCH := 0
|
SO_VERSION_PATCH := 0
|
||||||
ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
|
ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
|
||||||
@@ -429,10 +392,12 @@ testdata:: $(LIBVPX_TEST_DATA)
|
|||||||
if [ -n "$${sha1sum}" ]; then\
|
if [ -n "$${sha1sum}" ]; then\
|
||||||
set -e;\
|
set -e;\
|
||||||
echo "Checking test data:";\
|
echo "Checking test data:";\
|
||||||
|
if [ -n "$(LIBVPX_TEST_DATA)" ]; then\
|
||||||
for f in $(call enabled,LIBVPX_TEST_DATA); do\
|
for f in $(call enabled,LIBVPX_TEST_DATA); do\
|
||||||
grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
|
grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
|
||||||
(cd $(LIBVPX_TEST_DATA_PATH); $${sha1sum} -c);\
|
(cd $(LIBVPX_TEST_DATA_PATH); $${sha1sum} -c);\
|
||||||
done; \
|
done; \
|
||||||
|
fi; \
|
||||||
else\
|
else\
|
||||||
echo "Skipping test data integrity check, sha1sum not found.";\
|
echo "Skipping test data integrity check, sha1sum not found.";\
|
||||||
fi
|
fi
|
||||||
|
@@ -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
|
|
@@ -8,11 +8,10 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "./vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
@@ -23,6 +22,7 @@
|
|||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
|
|
||||||
|
@@ -80,7 +80,4 @@ TEST_P(BordersTest, TestLowBitrate) {
|
|||||||
|
|
||||||
VP9_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
|
VP9_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
|
||||||
::libvpx_test::kTwoPassGood));
|
::libvpx_test::kTwoPassGood));
|
||||||
|
|
||||||
VP10_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
|
|
||||||
::libvpx_test::kTwoPassGood));
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -13,10 +13,10 @@
|
|||||||
#include "./vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#include "vpx/vpx_decoder.h"
|
#include "vpx/vpx_decoder.h"
|
||||||
#include "vpx/vpx_encoder.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"
|
#include "vpx/vp8cx.h"
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER || CONFIG_VP10_DECODER
|
#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER
|
||||||
#include "vpx/vp8dx.h"
|
#include "vpx/vp8dx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -233,8 +233,6 @@ class VP9CodecFactory : public CodecFactory {
|
|||||||
int usage) const {
|
int usage) const {
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
return vpx_codec_enc_config_default(&vpx_codec_vp9_cx_algo, cfg, usage);
|
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
|
#else
|
||||||
return VPX_CODEC_INCAPABLE;
|
return VPX_CODEC_INCAPABLE;
|
||||||
#endif
|
#endif
|
||||||
@@ -253,96 +251,7 @@ const libvpx_test::VP9CodecFactory kVP9;
|
|||||||
#define VP9_INSTANTIATE_TEST_CASE(test, ...)
|
#define VP9_INSTANTIATE_TEST_CASE(test, ...)
|
||||||
#endif // CONFIG_VP9
|
#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
|
} // namespace libvpx_test
|
||||||
|
|
||||||
#endif // TEST_CODEC_FACTORY_H_
|
#endif // TEST_CODEC_FACTORY_H_
|
||||||
|
@@ -8,11 +8,10 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "./vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
@@ -23,11 +22,12 @@
|
|||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.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"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
|
|
||||||
extern "C"
|
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,
|
uint8_t *img2, int img2_pitch,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
Ssimv *sv2, Metrics *m,
|
Ssimv *sv2, Metrics *m,
|
||||||
@@ -65,7 +65,7 @@ class ConsistencyTestBase : public ::testing::Test {
|
|||||||
vpx_free(reference_data_[1]);
|
vpx_free(reference_data_[1]);
|
||||||
reference_data_[1] = NULL;
|
reference_data_[1] = NULL;
|
||||||
|
|
||||||
delete[] ssim_array_;
|
delete ssim_array_;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void TearDown() {
|
virtual void TearDown() {
|
||||||
@@ -144,7 +144,7 @@ class ConsistencyVP9Test
|
|||||||
double CheckConsistency(int frame) {
|
double CheckConsistency(int frame) {
|
||||||
EXPECT_LT(frame, 2)<< "Frame to check has to be less than 2.";
|
EXPECT_LT(frame, 2)<< "Frame to check has to be less than 2.";
|
||||||
return
|
return
|
||||||
vpx_get_ssim_metrics(source_data_[frame], source_stride_,
|
vp9_get_ssim_metrics(source_data_[frame], source_stride_,
|
||||||
reference_data_[frame], reference_stride_,
|
reference_data_[frame], reference_stride_,
|
||||||
width_, height_, ssim_array_, &metrics_, 1);
|
width_, height_, ssim_array_, &metrics_, 1);
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -140,9 +140,4 @@ VP9_INSTANTIATE_TEST_CASE(
|
|||||||
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
|
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
|
||||||
::libvpx_test::kRealTime),
|
::libvpx_test::kRealTime),
|
||||||
::testing::Range(0, 9));
|
::testing::Range(0, 9));
|
||||||
|
|
||||||
VP10_INSTANTIATE_TEST_CASE(
|
|
||||||
CpuSpeedTest,
|
|
||||||
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood),
|
|
||||||
::testing::Range(0, 3));
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -538,7 +538,7 @@ TEST_P(DatarateTestVP9Large, ChangingDropFrameThresh) {
|
|||||||
<< " The first dropped frame for drop_thresh " << i
|
<< " The first dropped frame for drop_thresh " << i
|
||||||
<< " > first dropped frame for drop_thresh "
|
<< " > first dropped frame for drop_thresh "
|
||||||
<< i - kDropFrameThreshTestStep;
|
<< 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
|
<< " The number of dropped frames for drop_thresh " << i
|
||||||
<< " < number of dropped frames for drop_thresh "
|
<< " < number of dropped frames for drop_thresh "
|
||||||
<< i - kDropFrameThreshTestStep;
|
<< i - kDropFrameThreshTestStep;
|
||||||
@@ -761,8 +761,6 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
|||||||
first_drop_ = 0;
|
first_drop_ = 0;
|
||||||
bits_total_ = 0;
|
bits_total_ = 0;
|
||||||
duration_ = 0.0;
|
duration_ = 0.0;
|
||||||
mismatch_psnr_ = 0.0;
|
|
||||||
mismatch_nframes_ = 0;
|
|
||||||
}
|
}
|
||||||
virtual void BeginPassHook(unsigned int /*pass*/) {
|
virtual void BeginPassHook(unsigned int /*pass*/) {
|
||||||
}
|
}
|
||||||
@@ -770,7 +768,7 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
|||||||
::libvpx_test::Encoder *encoder) {
|
::libvpx_test::Encoder *encoder) {
|
||||||
if (video->frame() == 0) {
|
if (video->frame() == 0) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < VPX_MAX_LAYERS; ++i) {
|
for (i = 0; i < 2; ++i) {
|
||||||
svc_params_.max_quantizers[i] = 63;
|
svc_params_.max_quantizers[i] = 63;
|
||||||
svc_params_.min_quantizers[i] = 0;
|
svc_params_.min_quantizers[i] = 0;
|
||||||
}
|
}
|
||||||
@@ -783,7 +781,6 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
|||||||
encoder->Control(VP8E_SET_CPUUSED, speed_setting_);
|
encoder->Control(VP8E_SET_CPUUSED, speed_setting_);
|
||||||
encoder->Control(VP9E_SET_TILE_COLUMNS, 0);
|
encoder->Control(VP9E_SET_TILE_COLUMNS, 0);
|
||||||
encoder->Control(VP8E_SET_MAX_INTRA_BITRATE_PCT, 300);
|
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();
|
const vpx_rational_t tb = video->timebase();
|
||||||
timebase_ = static_cast<double>(tb.num) / tb.den;
|
timebase_ = static_cast<double>(tb.num) / tb.den;
|
||||||
@@ -819,18 +816,6 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
|||||||
file_datarate_ = file_size_in_kb / 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_;
|
vpx_codec_pts_t last_pts_;
|
||||||
int64_t bits_in_buffer_model_;
|
int64_t bits_in_buffer_model_;
|
||||||
double timebase_;
|
double timebase_;
|
||||||
@@ -843,8 +828,6 @@ class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
|
|||||||
size_t bits_in_last_frame_;
|
size_t bits_in_last_frame_;
|
||||||
vpx_svc_extra_cfg_t svc_params_;
|
vpx_svc_extra_cfg_t svc_params_;
|
||||||
int speed_setting_;
|
int speed_setting_;
|
||||||
double mismatch_psnr_;
|
|
||||||
int mismatch_nframes_;
|
|
||||||
};
|
};
|
||||||
static void assign_layer_bitrates(vpx_codec_enc_cfg_t *const enc_cfg,
|
static void assign_layer_bitrates(vpx_codec_enc_cfg_t *const enc_cfg,
|
||||||
const vpx_svc_extra_cfg_t *svc_params,
|
const vpx_svc_extra_cfg_t *svc_params,
|
||||||
@@ -884,7 +867,7 @@ 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
|
// Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and
|
||||||
// 3 temporal layers. Run CIF clip with 1 thread.
|
// 3 temporal layers.
|
||||||
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc) {
|
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc) {
|
||||||
cfg_.rc_buf_initial_sz = 500;
|
cfg_.rc_buf_initial_sz = 500;
|
||||||
cfg_.rc_buf_optimal_sz = 500;
|
cfg_.rc_buf_optimal_sz = 500;
|
||||||
@@ -899,7 +882,6 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc) {
|
|||||||
cfg_.ts_rate_decimator[1] = 2;
|
cfg_.ts_rate_decimator[1] = 2;
|
||||||
cfg_.ts_rate_decimator[2] = 1;
|
cfg_.ts_rate_decimator[2] = 1;
|
||||||
cfg_.g_error_resilient = 1;
|
cfg_.g_error_resilient = 1;
|
||||||
cfg_.g_threads = 1;
|
|
||||||
cfg_.temporal_layering_mode = 3;
|
cfg_.temporal_layering_mode = 3;
|
||||||
svc_params_.scaling_factor_num[0] = 144;
|
svc_params_.scaling_factor_num[0] = 144;
|
||||||
svc_params_.scaling_factor_den[0] = 288;
|
svc_params_.scaling_factor_den[0] = 288;
|
||||||
@@ -923,50 +905,9 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc) {
|
|||||||
<< " The datarate for the file exceeds the target by too much!";
|
<< " The datarate for the file exceeds the target by too much!";
|
||||||
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15)
|
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15)
|
||||||
<< " The datarate for the file is lower than the target by too much!";
|
<< " The datarate for the file is lower than the target by too much!";
|
||||||
EXPECT_EQ(GetMismatchFrames(), (unsigned int) 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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, OnePassCbrSvc4threads) {
|
|
||||||
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;
|
|
||||||
// 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("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,
|
|
||||||
cfg_.rc_target_bitrate);
|
|
||||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
|
||||||
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(GetMismatchFrames(), (unsigned int) 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
VP8_INSTANTIATE_TEST_CASE(DatarateTestLarge, ALL_TEST_MODES);
|
VP8_INSTANTIATE_TEST_CASE(DatarateTestLarge, ALL_TEST_MODES);
|
||||||
VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9Large,
|
VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9Large,
|
||||||
::testing::Values(::libvpx_test::kOnePassGood,
|
::testing::Values(::libvpx_test::kOnePassGood,
|
||||||
|
@@ -13,13 +13,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "vp9/common/vp9_scan.h"
|
#include "vp9/common/vp9_scan.h"
|
||||||
#include "vpx/vpx_codec.h"
|
#include "vpx/vpx_codec.h"
|
||||||
@@ -40,6 +39,30 @@ static int round(double x) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const int kNumCoeffs = 256;
|
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 C1 = 0.995184726672197;
|
||||||
const double C2 = 0.98078528040323;
|
const double C2 = 0.98078528040323;
|
||||||
const double C3 = 0.956940335732209;
|
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,
|
void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||||
int /*tx_type*/) {
|
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,
|
void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
|
||||||
int /*tx_type*/) {
|
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,
|
void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||||
@@ -268,11 +291,11 @@ void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
|
|||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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,
|
void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride,
|
||||||
@@ -294,28 +317,28 @@ void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void idct16x16_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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
|
#if HAVE_SSE2
|
||||||
void idct16x16_256_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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) {
|
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) {
|
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 // HAVE_SSE2
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
@@ -798,14 +821,14 @@ using std::tr1::make_tuple;
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, Trans16x16DCT,
|
C, Trans16x16DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10),
|
make_tuple(&vp9_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10),
|
||||||
make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12),
|
make_tuple(&vp9_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_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||||
#else
|
#else
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, Trans16x16DCT,
|
C, Trans16x16DCT,
|
||||||
::testing::Values(
|
::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
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
@@ -838,16 +861,16 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
NEON, Trans16x16DCT,
|
NEON, Trans16x16DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_neon, 0, VPX_BITS_8)));
|
&vp9_idct16x16_256_add_neon, 0, VPX_BITS_8)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans16x16DCT,
|
SSE2, Trans16x16DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct16x16_sse2,
|
make_tuple(&vp9_fdct16x16_sse2,
|
||||||
&vpx_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
|
&vp9_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans16x16HT,
|
SSE2, Trans16x16HT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
@@ -865,19 +888,27 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans16x16DCT,
|
SSE2, Trans16x16DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_fdct16x16_sse2,
|
make_tuple(&vp9_highbd_fdct16x16_sse2,
|
||||||
&idct16x16_10, 0, VPX_BITS_10),
|
&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),
|
&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),
|
&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),
|
&idct16x16_256_add_12_sse2, 0, VPX_BITS_12),
|
||||||
make_tuple(&vpx_fdct16x16_sse2,
|
make_tuple(&vp9_fdct16x16_sse2,
|
||||||
&vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
&vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans16x16HT,
|
SSE2, Trans16x16HT,
|
||||||
::testing::Values(
|
::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, 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, 1, VPX_BITS_8),
|
||||||
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
|
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
|
||||||
@@ -902,8 +933,8 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, Trans16x16DCT,
|
MSA, Trans16x16DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct16x16_msa,
|
make_tuple(&vp9_fdct16x16_msa,
|
||||||
&vpx_idct16x16_256_add_msa, 0, VPX_BITS_8)));
|
&vp9_idct16x16_256_add_msa, 0, VPX_BITS_8)));
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, Trans16x16HT,
|
MSA, Trans16x16HT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
|
@@ -13,14 +13,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "vpx/vpx_codec.h"
|
#include "vpx/vpx_codec.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
@@ -82,15 +81,15 @@ typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmFunc, int, vpx_bit_depth_t>
|
|||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
void idct32x32_8(const tran_low_t *in, uint8_t *out, int stride) {
|
void idct32x32_8(const tran_low_t *in, uint8_t *out, int stride) {
|
||||||
vpx_highbd_idct32x32_1024_add_c(in, out, stride, 8);
|
vp9_highbd_idct32x32_1024_add_c(in, out, stride, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void idct32x32_10(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
@@ -195,7 +194,7 @@ TEST_P(Trans32x32Test, CoeffCheck) {
|
|||||||
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
|
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
|
||||||
|
|
||||||
const int stride = 32;
|
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));
|
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input_block, output_block, stride));
|
||||||
|
|
||||||
if (version_ == 0) {
|
if (version_ == 0) {
|
||||||
@@ -232,7 +231,7 @@ TEST_P(Trans32x32Test, MemCheck) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int stride = 32;
|
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(
|
ASM_REGISTER_STATE_CHECK(
|
||||||
fwd_txfm_(input_extreme_block, output_block, stride));
|
fwd_txfm_(input_extreme_block, output_block, stride));
|
||||||
|
|
||||||
@@ -315,61 +314,61 @@ using std::tr1::make_tuple;
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, Trans32x32Test,
|
C, Trans32x32Test,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_fdct32x32_c,
|
make_tuple(&vp9_highbd_fdct32x32_c,
|
||||||
&idct32x32_10, 0, VPX_BITS_10),
|
&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),
|
&idct32x32_10, 1, VPX_BITS_10),
|
||||||
make_tuple(&vpx_highbd_fdct32x32_c,
|
make_tuple(&vp9_highbd_fdct32x32_c,
|
||||||
&idct32x32_12, 0, VPX_BITS_12),
|
&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),
|
&idct32x32_12, 1, VPX_BITS_12),
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
&vp9_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
||||||
make_tuple(&vpx_fdct32x32_rd_c,
|
make_tuple(&vp9_fdct32x32_rd_c,
|
||||||
&vpx_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
&vp9_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
||||||
#else
|
#else
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, Trans32x32Test,
|
C, Trans32x32Test,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
&vp9_idct32x32_1024_add_c, 0, VPX_BITS_8),
|
||||||
make_tuple(&vpx_fdct32x32_rd_c,
|
make_tuple(&vp9_fdct32x32_rd_c,
|
||||||
&vpx_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
&vp9_idct32x32_1024_add_c, 1, VPX_BITS_8)));
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
NEON, Trans32x32Test,
|
NEON, Trans32x32Test,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_neon, 0, VPX_BITS_8),
|
&vp9_idct32x32_1024_add_neon, 0, VPX_BITS_8),
|
||||||
make_tuple(&vpx_fdct32x32_rd_c,
|
make_tuple(&vp9_fdct32x32_rd_c,
|
||||||
&vpx_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
|
&vp9_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
|
||||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans32x32Test,
|
SSE2, Trans32x32Test,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_sse2,
|
make_tuple(&vp9_fdct32x32_sse2,
|
||||||
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
&vp9_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
||||||
make_tuple(&vpx_fdct32x32_rd_sse2,
|
make_tuple(&vp9_fdct32x32_rd_sse2,
|
||||||
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
&vp9_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
||||||
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans32x32Test,
|
SSE2, Trans32x32Test,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_fdct32x32_sse2, &idct32x32_10, 0, VPX_BITS_10),
|
make_tuple(&vp9_highbd_fdct32x32_sse2, &idct32x32_10, 0, VPX_BITS_10),
|
||||||
make_tuple(&vpx_highbd_fdct32x32_rd_sse2, &idct32x32_10, 1,
|
make_tuple(&vp9_highbd_fdct32x32_rd_sse2, &idct32x32_10, 1,
|
||||||
VPX_BITS_10),
|
VPX_BITS_10),
|
||||||
make_tuple(&vpx_highbd_fdct32x32_sse2, &idct32x32_12, 0, VPX_BITS_12),
|
make_tuple(&vp9_highbd_fdct32x32_sse2, &idct32x32_12, 0, VPX_BITS_12),
|
||||||
make_tuple(&vpx_highbd_fdct32x32_rd_sse2, &idct32x32_12, 1,
|
make_tuple(&vp9_highbd_fdct32x32_rd_sse2, &idct32x32_12, 1,
|
||||||
VPX_BITS_12),
|
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),
|
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)));
|
VPX_BITS_8)));
|
||||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
@@ -377,19 +376,19 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
AVX2, Trans32x32Test,
|
AVX2, Trans32x32Test,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_avx2,
|
make_tuple(&vp9_fdct32x32_avx2,
|
||||||
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
&vp9_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
|
||||||
make_tuple(&vpx_fdct32x32_rd_avx2,
|
make_tuple(&vp9_fdct32x32_rd_avx2,
|
||||||
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
&vp9_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
|
||||||
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, Trans32x32Test,
|
MSA, Trans32x32Test,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_msa,
|
make_tuple(&vp9_fdct32x32_msa,
|
||||||
&vpx_idct32x32_1024_add_msa, 0, VPX_BITS_8),
|
&vp9_idct32x32_1024_add_msa, 0, VPX_BITS_8),
|
||||||
make_tuple(&vpx_fdct32x32_rd_msa,
|
make_tuple(&vp9_fdct32x32_rd_msa,
|
||||||
&vpx_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
|
&vp9_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
|
||||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -7,11 +7,10 @@
|
|||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
#include "./vpx_config.h"
|
|
||||||
#include "test/ivf_video_source.h"
|
#include "test/ivf_video_source.h"
|
||||||
|
#include "./vpx_config.h"
|
||||||
#include "vpx/vp8dx.h"
|
#include "vpx/vp8dx.h"
|
||||||
#include "vpx/vpx_decoder.h"
|
#include "vpx/vpx_decoder.h"
|
||||||
|
|
||||||
@@ -26,9 +25,6 @@ TEST(DecodeAPI, InvalidParams) {
|
|||||||
#endif
|
#endif
|
||||||
#if CONFIG_VP9_DECODER
|
#if CONFIG_VP9_DECODER
|
||||||
&vpx_codec_vp9_dx_algo,
|
&vpx_codec_vp9_dx_algo,
|
||||||
#endif
|
|
||||||
#if CONFIG_VP10_DECODER
|
|
||||||
&vpx_codec_vp10_dx_algo,
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
uint8_t buf[1] = {0};
|
uint8_t buf[1] = {0};
|
||||||
@@ -133,13 +129,8 @@ TEST(DecodeAPI, Vp9InvalidDecode) {
|
|||||||
vpx_codec_ctx_t dec;
|
vpx_codec_ctx_t dec;
|
||||||
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_dec_init(&dec, codec, NULL, 0));
|
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());
|
const uint32_t frame_size = static_cast<uint32_t>(video.frame_size());
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
|
||||||
EXPECT_EQ(VPX_CODEC_MEM_ERROR,
|
EXPECT_EQ(VPX_CODEC_MEM_ERROR,
|
||||||
vpx_codec_decode(&dec, video.cxdata(), frame_size, NULL, 0));
|
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;
|
vpx_codec_iter_t iter = NULL;
|
||||||
EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter));
|
EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter));
|
||||||
|
|
||||||
|
@@ -7,11 +7,9 @@
|
|||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* 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/codec_factory.h"
|
||||||
#include "test/decode_test_driver.h"
|
#include "test/decode_test_driver.h"
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/video_source.h"
|
#include "test/video_source.h"
|
||||||
|
|
||||||
|
@@ -10,14 +10,13 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "./vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#include "test/codec_factory.h"
|
#include "test/codec_factory.h"
|
||||||
#include "test/decode_test_driver.h"
|
|
||||||
#include "test/encode_test_driver.h"
|
#include "test/encode_test_driver.h"
|
||||||
|
#include "test/decode_test_driver.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/video_source.h"
|
#include "test/video_source.h"
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
namespace libvpx_test {
|
namespace libvpx_test {
|
||||||
void Encoder::InitEncoder(VideoSource *video) {
|
void Encoder::InitEncoder(VideoSource *video) {
|
||||||
@@ -42,15 +41,6 @@ void Encoder::InitEncoder(VideoSource *video) {
|
|||||||
log2_tile_columns);
|
log2_tile_columns);
|
||||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
||||||
} else
|
} 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
|
#endif
|
||||||
{
|
{
|
||||||
#if CONFIG_VP8_ENCODER
|
#if CONFIG_VP8_ENCODER
|
||||||
@@ -195,7 +185,6 @@ void EncoderTest::RunLoop(VideoSource *video) {
|
|||||||
|
|
||||||
video->Begin();
|
video->Begin();
|
||||||
encoder->InitEncoder(video);
|
encoder->InitEncoder(video);
|
||||||
ASSERT_FALSE(::testing::Test::HasFatalFailure());
|
|
||||||
|
|
||||||
unsigned long dec_init_flags = 0; // NOLINT
|
unsigned long dec_init_flags = 0; // NOLINT
|
||||||
// Use fragment decoder if encoder outputs partitions.
|
// Use fragment decoder if encoder outputs partitions.
|
||||||
|
@@ -13,13 +13,12 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "./vpx_config.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"
|
#include "vpx/vp8cx.h"
|
||||||
#endif
|
#endif
|
||||||
#include "vpx/vpx_encoder.h"
|
|
||||||
|
|
||||||
namespace libvpx_test {
|
namespace libvpx_test {
|
||||||
|
|
||||||
@@ -124,11 +123,6 @@ class Encoder {
|
|||||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
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) {
|
void Control(int ctrl_id, struct vpx_scaling_mode *arg) {
|
||||||
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
|
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
|
||||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
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);
|
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
|
||||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
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) {
|
void Control(int ctrl_id, vpx_active_map_t *arg) {
|
||||||
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
|
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
|
||||||
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
|
||||||
|
@@ -20,11 +20,10 @@ const int kMaxErrorFrames = 12;
|
|||||||
const int kMaxDroppableFrames = 12;
|
const int kMaxDroppableFrames = 12;
|
||||||
|
|
||||||
class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
|
class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
|
||||||
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, bool> {
|
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
|
||||||
protected:
|
protected:
|
||||||
ErrorResilienceTestLarge()
|
ErrorResilienceTestLarge()
|
||||||
: EncoderTest(GET_PARAM(0)),
|
: EncoderTest(GET_PARAM(0)),
|
||||||
svc_support_(GET_PARAM(2)),
|
|
||||||
psnr_(0.0),
|
psnr_(0.0),
|
||||||
nframes_(0),
|
nframes_(0),
|
||||||
mismatch_psnr_(0.0),
|
mismatch_psnr_(0.0),
|
||||||
@@ -194,8 +193,6 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
|
|||||||
pattern_switch_ = frame_switch;
|
pattern_switch_ = frame_switch;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool svc_support_;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double psnr_;
|
double psnr_;
|
||||||
unsigned int nframes_;
|
unsigned int nframes_;
|
||||||
@@ -305,10 +302,6 @@ TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) {
|
|||||||
// two layer temporal pattern. The base layer does not predict from the top
|
// two layer temporal pattern. The base layer does not predict from the top
|
||||||
// layer, so successful decoding is expected.
|
// layer, so successful decoding is expected.
|
||||||
TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) {
|
TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) {
|
||||||
// This test doesn't run if SVC is not supported.
|
|
||||||
if (!svc_support_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const vpx_rational timebase = { 33333333, 1000000000 };
|
const vpx_rational timebase = { 33333333, 1000000000 };
|
||||||
cfg_.g_timebase = timebase;
|
cfg_.g_timebase = timebase;
|
||||||
cfg_.rc_target_bitrate = 500;
|
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
|
// for a two layer temporal pattern, where at some point in the
|
||||||
// sequence, the LAST ref is not used anymore.
|
// sequence, the LAST ref is not used anymore.
|
||||||
TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) {
|
TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) {
|
||||||
// This test doesn't run if SVC is not supported.
|
|
||||||
if (!svc_support_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const vpx_rational timebase = { 33333333, 1000000000 };
|
const vpx_rational timebase = { 33333333, 1000000000 };
|
||||||
cfg_.g_timebase = timebase;
|
cfg_.g_timebase = timebase;
|
||||||
cfg_.rc_target_bitrate = 500;
|
cfg_.rc_target_bitrate = 500;
|
||||||
@@ -590,13 +579,8 @@ TEST_P(ErrorResilienceTestLargeCodecControls, CodecControl3TemporalLayers) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES,
|
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
|
||||||
::testing::Values(true));
|
|
||||||
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLargeCodecControls,
|
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLargeCodecControls,
|
||||||
ONE_PASS_TEST_MODES);
|
ONE_PASS_TEST_MODES);
|
||||||
VP9_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, 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));
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -13,13 +13,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "vpx/vpx_codec.h"
|
#include "vpx/vpx_codec.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
@@ -41,7 +40,7 @@ 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,
|
void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride,
|
||||||
int tx_type) {
|
int tx_type) {
|
||||||
vpx_fdct4x4_c(in, out, stride);
|
vp9_fdct4x4_c(in, out, stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||||
@@ -55,11 +54,11 @@ void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
|
|||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
void idct4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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) {
|
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) {
|
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) {
|
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
|
#if HAVE_SSE2
|
||||||
void idct4x4_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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 // HAVE_SSE2
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
@@ -419,14 +418,14 @@ using std::tr1::make_tuple;
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, Trans4x4DCT,
|
C, Trans4x4DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_10, 0, VPX_BITS_10),
|
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_10, 0, VPX_BITS_10),
|
||||||
make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12),
|
make_tuple(&vp9_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_fdct4x4_c, &vp9_idct4x4_16_add_c, 0, VPX_BITS_8)));
|
||||||
#else
|
#else
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, Trans4x4DCT,
|
C, Trans4x4DCT,
|
||||||
::testing::Values(
|
::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
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
@@ -461,20 +460,20 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_10, 0, VPX_BITS_10),
|
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_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
|
#else
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, Trans4x4WHT,
|
C, Trans4x4WHT,
|
||||||
::testing::Values(
|
::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
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
NEON, Trans4x4DCT,
|
NEON, Trans4x4DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct4x4_c,
|
make_tuple(&vp9_fdct4x4_c,
|
||||||
&vpx_idct4x4_16_add_neon, 0, VPX_BITS_8)));
|
&vp9_idct4x4_16_add_neon, 0, VPX_BITS_8)));
|
||||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
#if HAVE_NEON && !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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MMX, Trans4x4WHT,
|
MMX, Trans4x4WHT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vp9_fwht4x4_mmx, &vpx_iwht4x4_16_add_c, 0, VPX_BITS_8)));
|
make_tuple(&vp9_fwht4x4_mmx, &vp9_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)));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans4x4DCT,
|
SSE2, Trans4x4DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct4x4_sse2,
|
make_tuple(&vp9_fdct4x4_sse2,
|
||||||
&vpx_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
|
&vp9_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans4x4HT,
|
SSE2, Trans4x4HT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
@@ -522,16 +513,24 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans4x4DCT,
|
SSE2, Trans4x4DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, VPX_BITS_10),
|
make_tuple(&vp9_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(&vp9_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(&vp9_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(&vp9_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, VPX_BITS_12),
|
||||||
make_tuple(&vpx_fdct4x4_sse2, &vpx_idct4x4_16_add_c, 0,
|
make_tuple(&vp9_fdct4x4_sse2, &vp9_idct4x4_16_add_c, 0,
|
||||||
VPX_BITS_8)));
|
VPX_BITS_8)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Trans4x4HT,
|
SSE2, Trans4x4HT,
|
||||||
::testing::Values(
|
::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, 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, 1, VPX_BITS_8),
|
||||||
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 2, 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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, Trans4x4DCT,
|
MSA, Trans4x4DCT,
|
||||||
::testing::Values(
|
::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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, Trans4x4HT,
|
MSA, Trans4x4HT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
|
@@ -13,13 +13,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "vp9/common/vp9_scan.h"
|
#include "vp9/common/vp9_scan.h"
|
||||||
#include "vpx/vpx_codec.h"
|
#include "vpx/vpx_codec.h"
|
||||||
@@ -83,7 +82,7 @@ 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) {
|
void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||||
vpx_fdct8x8_c(in, out, stride);
|
vp9_fdct8x8_c(in, out, stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
||||||
@@ -92,11 +91,11 @@ void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
|
|||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
void idct8x8_10(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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) {
|
void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
||||||
@@ -108,28 +107,28 @@ void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void idct8x8_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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
|
#if HAVE_SSE2
|
||||||
void idct8x8_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
|
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) {
|
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) {
|
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) {
|
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 // HAVE_SSE2
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
@@ -658,14 +657,14 @@ using std::tr1::make_tuple;
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, FwdTrans8x8DCT,
|
C, FwdTrans8x8DCT,
|
||||||
::testing::Values(
|
::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),
|
||||||
make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10),
|
make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10),
|
||||||
make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12)));
|
make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12)));
|
||||||
#else
|
#else
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, FwdTrans8x8DCT,
|
C, FwdTrans8x8DCT,
|
||||||
::testing::Values(
|
::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
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
@@ -685,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, 2, VPX_BITS_8),
|
||||||
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 3, VPX_BITS_8)));
|
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 3, VPX_BITS_8)));
|
||||||
#else
|
#else
|
||||||
|
// TODO(jingning): re-enable after this handles the expanded range [0, 65535]
|
||||||
|
// returned from Rand16().
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, FwdTrans8x8HT,
|
C, FwdTrans8x8HT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
@@ -695,10 +696,12 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
NEON, FwdTrans8x8DCT,
|
NEON, FwdTrans8x8DCT,
|
||||||
::testing::Values(
|
::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)));
|
VPX_BITS_8)));
|
||||||
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
@@ -713,10 +716,12 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
#if HAVE_SSE2 && !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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, FwdTrans8x8DCT,
|
SSE2, FwdTrans8x8DCT,
|
||||||
::testing::Values(
|
::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)));
|
VPX_BITS_8)));
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, FwdTrans8x8HT,
|
SSE2, FwdTrans8x8HT,
|
||||||
@@ -731,16 +736,18 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, FwdTrans8x8DCT,
|
SSE2, FwdTrans8x8DCT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct8x8_sse2, &vpx_idct8x8_64_add_c, 0, VPX_BITS_8),
|
make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8),
|
||||||
make_tuple(&vpx_highbd_fdct8x8_c,
|
make_tuple(&vp9_highbd_fdct8x8_c,
|
||||||
&idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
|
&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),
|
&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),
|
&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)));
|
&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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, FwdTrans8x8HT,
|
SSE2, FwdTrans8x8HT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
@@ -764,12 +771,14 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
&idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
|
&idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
|
||||||
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC && ARCH_X86_64 && \
|
#if HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
|
||||||
!CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
!CONFIG_EMULATE_HARDWARE
|
||||||
|
// TODO(jingning): re-enable after this handles the expanded range [0, 65535]
|
||||||
|
// returned from Rand16().
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSSE3, FwdTrans8x8DCT,
|
SSSE3, FwdTrans8x8DCT,
|
||||||
::testing::Values(
|
::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)));
|
VPX_BITS_8)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -777,7 +786,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, FwdTrans8x8DCT,
|
MSA, FwdTrans8x8DCT,
|
||||||
::testing::Values(
|
::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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, FwdTrans8x8HT,
|
MSA, FwdTrans8x8HT,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
|
@@ -74,7 +74,7 @@ TEST_F(VP9FrameSizeTestsLarge, ValidSizes) {
|
|||||||
// size or almost 1 gig of memory.
|
// size or almost 1 gig of memory.
|
||||||
// In total the allocations will exceed 2GiB which may cause a failure with
|
// In total the allocations will exceed 2GiB which may cause a failure with
|
||||||
// mingw + wine, use a smaller size in that case.
|
// 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);
|
video.SetSize(4096, 3072);
|
||||||
#else
|
#else
|
||||||
video.SetSize(4096, 4096);
|
video.SetSize(4096, 4096);
|
||||||
|
@@ -14,7 +14,8 @@
|
|||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
@@ -67,6 +68,43 @@ void reference_dct_2d(int16_t input[64], double output[64]) {
|
|||||||
output[i] *= 2;
|
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) {
|
TEST(VP9Idct8x8Test, AccuracyCheck) {
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
const int count_test_block = 10000;
|
const int count_test_block = 10000;
|
||||||
@@ -87,7 +125,7 @@ TEST(VP9Idct8x8Test, AccuracyCheck) {
|
|||||||
reference_dct_2d(input, output_r);
|
reference_dct_2d(input, output_r);
|
||||||
for (int j = 0; j < 64; ++j)
|
for (int j = 0; j < 64; ++j)
|
||||||
coeff[j] = round(output_r[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) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
const int diff = dst[j] - src[j];
|
const int diff = dst[j] - src[j];
|
||||||
const int error = diff * diff;
|
const int error = diff * diff;
|
||||||
|
@@ -10,11 +10,10 @@
|
|||||||
|
|
||||||
#include "./vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#include "./vp8_rtcd.h"
|
#include "./vp8_rtcd.h"
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
typedef void (*IdctFunc)(int16_t *input, unsigned char *pred_ptr,
|
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,
|
INSTANTIATE_TEST_CASE_P(MMX, IDCTTest,
|
||||||
::testing::Values(vp8_short_idct4x4llm_mmx));
|
::testing::Values(vp8_short_idct4x4llm_mmx));
|
||||||
#endif
|
#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";
|
EXPECT_NE(res, EOF) << "Read result data failed";
|
||||||
|
|
||||||
// Check results match.
|
// 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)
|
EXPECT_EQ(expected_res_dec, res_dec)
|
||||||
<< "Results don't match: frame number = " << video.frame_number()
|
<< "Results don't match: frame number = " << video.frame_number()
|
||||||
<< ". (" << decoder->DecodeError() << ")";
|
<< ". (" << decoder->DecodeError() << ")";
|
||||||
}
|
|
||||||
|
|
||||||
return !HasFailure();
|
return !HasFailure();
|
||||||
}
|
}
|
||||||
@@ -125,9 +112,7 @@ TEST_P(InvalidFileTest, ReturnCode) {
|
|||||||
|
|
||||||
const DecodeParam kVP9InvalidFileTests[] = {
|
const DecodeParam kVP9InvalidFileTests[] = {
|
||||||
{1, "invalid-vp90-02-v2.webm"},
|
{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"},
|
{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-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-.ivf"},
|
||||||
{1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.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[] = {
|
const DecodeParam kVP9InvalidFileInvalidPeekTests[] = {
|
||||||
{1, "invalid-vp90-01-v3.webm"},
|
{1, "invalid-vp90-01-v2.webm"},
|
||||||
};
|
};
|
||||||
|
|
||||||
VP9_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest,
|
VP9_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest,
|
||||||
|
@@ -13,13 +13,13 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "vp9/common/vp9_loopfilter.h"
|
#include "vp9/common/vp9_loopfilter.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
@@ -60,49 +60,49 @@ typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t;
|
|||||||
void wrapper_vertical_16_sse2(uint16_t *s, int p, const uint8_t *blimit,
|
void wrapper_vertical_16_sse2(uint16_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, int bd) {
|
int count, int bd) {
|
||||||
vpx_highbd_lpf_vertical_16_sse2(s, p, blimit, limit, thresh, 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,
|
void wrapper_vertical_16_c(uint16_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, int bd) {
|
int count, int bd) {
|
||||||
vpx_highbd_lpf_vertical_16_c(s, p, blimit, limit, thresh, 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,
|
void wrapper_vertical_16_dual_sse2(uint16_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, int bd) {
|
int count, int bd) {
|
||||||
vpx_highbd_lpf_vertical_16_dual_sse2(s, p, blimit, limit, thresh, 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,
|
void wrapper_vertical_16_dual_c(uint16_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, int bd) {
|
int count, int bd) {
|
||||||
vpx_highbd_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh, bd);
|
vp9_highbd_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh, bd);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void wrapper_vertical_16_sse2(uint8_t *s, int p, const uint8_t *blimit,
|
void wrapper_vertical_16_sse2(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_sse2(s, p, blimit, limit, thresh);
|
vp9_lpf_vertical_16_sse2(s, p, blimit, limit, thresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wrapper_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
|
void wrapper_vertical_16_c(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_c(s, p, blimit, limit, thresh);
|
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,
|
void wrapper_vertical_16_dual_sse2(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_dual_sse2(s, p, blimit, limit, thresh);
|
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,
|
void wrapper_vertical_16_dual_c(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh);
|
vp9_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh);
|
||||||
}
|
}
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
#endif // HAVE_SSE2
|
#endif // HAVE_SSE2
|
||||||
@@ -114,25 +114,25 @@ void wrapper_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit,
|
|||||||
void wrapper_vertical_16_neon(uint8_t *s, int p, const uint8_t *blimit,
|
void wrapper_vertical_16_neon(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_neon(s, p, blimit, limit, thresh);
|
vp9_lpf_vertical_16_neon(s, p, blimit, limit, thresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wrapper_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
|
void wrapper_vertical_16_c(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_c(s, p, blimit, limit, thresh);
|
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,
|
void wrapper_vertical_16_dual_neon(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_dual_neon(s, p, blimit, limit, thresh);
|
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,
|
void wrapper_vertical_16_dual_c(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh);
|
vp9_lpf_vertical_16_dual_c(s, p, blimit, limit, thresh);
|
||||||
}
|
}
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
#endif // HAVE_NEON_ASM
|
#endif // HAVE_NEON_ASM
|
||||||
@@ -141,13 +141,13 @@ void wrapper_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit,
|
|||||||
void wrapper_vertical_16_msa(uint8_t *s, int p, const uint8_t *blimit,
|
void wrapper_vertical_16_msa(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_msa(s, p, blimit, limit, thresh);
|
vp9_lpf_vertical_16_msa(s, p, blimit, limit, thresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wrapper_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
|
void wrapper_vertical_16_c(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) {
|
int count) {
|
||||||
vpx_lpf_vertical_16_c(s, p, blimit, limit, thresh);
|
vp9_lpf_vertical_16_c(s, p, blimit, limit, thresh);
|
||||||
}
|
}
|
||||||
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||||
|
|
||||||
@@ -534,46 +534,46 @@ using std::tr1::make_tuple;
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Loop8Test6Param,
|
SSE2, Loop8Test6Param,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_4_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_4_c, 8, 1),
|
&vp9_highbd_lpf_horizontal_4_c, 8, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_4_sse2,
|
||||||
&vpx_highbd_lpf_vertical_4_c, 8, 1),
|
&vp9_highbd_lpf_vertical_4_c, 8, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_8_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_8_c, 8, 1),
|
&vp9_highbd_lpf_horizontal_8_c, 8, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_16_c, 8, 1),
|
&vp9_highbd_lpf_horizontal_16_c, 8, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_16_c, 8, 2),
|
&vp9_highbd_lpf_horizontal_16_c, 8, 2),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
|
||||||
&vpx_highbd_lpf_vertical_8_c, 8, 1),
|
&vp9_highbd_lpf_vertical_8_c, 8, 1),
|
||||||
make_tuple(&wrapper_vertical_16_sse2,
|
make_tuple(&wrapper_vertical_16_sse2,
|
||||||
&wrapper_vertical_16_c, 8, 1),
|
&wrapper_vertical_16_c, 8, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_4_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_4_c, 10, 1),
|
&vp9_highbd_lpf_horizontal_4_c, 10, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_4_sse2,
|
||||||
&vpx_highbd_lpf_vertical_4_c, 10, 1),
|
&vp9_highbd_lpf_vertical_4_c, 10, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_8_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_8_c, 10, 1),
|
&vp9_highbd_lpf_horizontal_8_c, 10, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_16_c, 10, 1),
|
&vp9_highbd_lpf_horizontal_16_c, 10, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_16_c, 10, 2),
|
&vp9_highbd_lpf_horizontal_16_c, 10, 2),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
|
||||||
&vpx_highbd_lpf_vertical_8_c, 10, 1),
|
&vp9_highbd_lpf_vertical_8_c, 10, 1),
|
||||||
make_tuple(&wrapper_vertical_16_sse2,
|
make_tuple(&wrapper_vertical_16_sse2,
|
||||||
&wrapper_vertical_16_c, 10, 1),
|
&wrapper_vertical_16_c, 10, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_4_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_4_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_4_c, 12, 1),
|
&vp9_highbd_lpf_horizontal_4_c, 12, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_4_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_4_sse2,
|
||||||
&vpx_highbd_lpf_vertical_4_c, 12, 1),
|
&vp9_highbd_lpf_vertical_4_c, 12, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_8_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_8_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_8_c, 12, 1),
|
&vp9_highbd_lpf_horizontal_8_c, 12, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_16_c, 12, 1),
|
&vp9_highbd_lpf_horizontal_16_c, 12, 1),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_16_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_16_c, 12, 2),
|
&vp9_highbd_lpf_horizontal_16_c, 12, 2),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
|
||||||
&vpx_highbd_lpf_vertical_8_c, 12, 1),
|
&vp9_highbd_lpf_vertical_8_c, 12, 1),
|
||||||
make_tuple(&wrapper_vertical_16_sse2,
|
make_tuple(&wrapper_vertical_16_sse2,
|
||||||
&wrapper_vertical_16_c, 12, 1),
|
&wrapper_vertical_16_c, 12, 1),
|
||||||
make_tuple(&wrapper_vertical_16_dual_sse2,
|
make_tuple(&wrapper_vertical_16_dual_sse2,
|
||||||
@@ -586,13 +586,11 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Loop8Test6Param,
|
SSE2, Loop8Test6Param,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_lpf_horizontal_8_sse2, &vpx_lpf_horizontal_8_c, 8, 1),
|
make_tuple(&vp9_lpf_horizontal_8_sse2, &vp9_lpf_horizontal_8_c, 8, 1),
|
||||||
make_tuple(&vpx_lpf_horizontal_16_sse2, &vpx_lpf_horizontal_16_c, 8, 1),
|
make_tuple(&vp9_lpf_horizontal_16_sse2, &vp9_lpf_horizontal_16_c, 8, 1),
|
||||||
make_tuple(&vpx_lpf_horizontal_16_sse2, &vpx_lpf_horizontal_16_c, 8, 2),
|
make_tuple(&vp9_lpf_horizontal_16_sse2, &vp9_lpf_horizontal_16_c, 8, 2),
|
||||||
make_tuple(&vpx_lpf_vertical_8_sse2, &vpx_lpf_vertical_8_c, 8, 1),
|
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),
|
make_tuple(&wrapper_vertical_16_sse2, &wrapper_vertical_16_c, 8, 1)));
|
||||||
make_tuple(&wrapper_vertical_16_dual_sse2,
|
|
||||||
&wrapper_vertical_16_dual_c, 8, 1)));
|
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -600,8 +598,8 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
AVX2, Loop8Test6Param,
|
AVX2, Loop8Test6Param,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_lpf_horizontal_16_avx2, &vpx_lpf_horizontal_16_c, 8, 1),
|
make_tuple(&vp9_lpf_horizontal_16_avx2, &vp9_lpf_horizontal_16_c, 8, 1),
|
||||||
make_tuple(&vpx_lpf_horizontal_16_avx2, &vpx_lpf_horizontal_16_c, 8,
|
make_tuple(&vp9_lpf_horizontal_16_avx2, &vp9_lpf_horizontal_16_c, 8,
|
||||||
2)));
|
2)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -610,42 +608,42 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Loop8Test9Param,
|
SSE2, Loop8Test9Param,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_4_dual_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_4_dual_c, 8),
|
&vp9_highbd_lpf_horizontal_4_dual_c, 8),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_8_dual_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_8_dual_c, 8),
|
&vp9_highbd_lpf_horizontal_8_dual_c, 8),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_4_dual_sse2,
|
||||||
&vpx_highbd_lpf_vertical_4_dual_c, 8),
|
&vp9_highbd_lpf_vertical_4_dual_c, 8),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_8_dual_sse2,
|
||||||
&vpx_highbd_lpf_vertical_8_dual_c, 8),
|
&vp9_highbd_lpf_vertical_8_dual_c, 8),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_4_dual_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_4_dual_c, 10),
|
&vp9_highbd_lpf_horizontal_4_dual_c, 10),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_8_dual_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_8_dual_c, 10),
|
&vp9_highbd_lpf_horizontal_8_dual_c, 10),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_4_dual_sse2,
|
||||||
&vpx_highbd_lpf_vertical_4_dual_c, 10),
|
&vp9_highbd_lpf_vertical_4_dual_c, 10),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_8_dual_sse2,
|
||||||
&vpx_highbd_lpf_vertical_8_dual_c, 10),
|
&vp9_highbd_lpf_vertical_8_dual_c, 10),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_4_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_4_dual_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_4_dual_c, 12),
|
&vp9_highbd_lpf_horizontal_4_dual_c, 12),
|
||||||
make_tuple(&vpx_highbd_lpf_horizontal_8_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_horizontal_8_dual_sse2,
|
||||||
&vpx_highbd_lpf_horizontal_8_dual_c, 12),
|
&vp9_highbd_lpf_horizontal_8_dual_c, 12),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_4_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_4_dual_sse2,
|
||||||
&vpx_highbd_lpf_vertical_4_dual_c, 12),
|
&vp9_highbd_lpf_vertical_4_dual_c, 12),
|
||||||
make_tuple(&vpx_highbd_lpf_vertical_8_dual_sse2,
|
make_tuple(&vp9_highbd_lpf_vertical_8_dual_sse2,
|
||||||
&vpx_highbd_lpf_vertical_8_dual_c, 12)));
|
&vp9_highbd_lpf_vertical_8_dual_c, 12)));
|
||||||
#else
|
#else
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, Loop8Test9Param,
|
SSE2, Loop8Test9Param,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_lpf_horizontal_4_dual_sse2,
|
make_tuple(&vp9_lpf_horizontal_4_dual_sse2,
|
||||||
&vpx_lpf_horizontal_4_dual_c, 8),
|
&vp9_lpf_horizontal_4_dual_c, 8),
|
||||||
make_tuple(&vpx_lpf_horizontal_8_dual_sse2,
|
make_tuple(&vp9_lpf_horizontal_8_dual_sse2,
|
||||||
&vpx_lpf_horizontal_8_dual_c, 8),
|
&vp9_lpf_horizontal_8_dual_c, 8),
|
||||||
make_tuple(&vpx_lpf_vertical_4_dual_sse2,
|
make_tuple(&vp9_lpf_vertical_4_dual_sse2,
|
||||||
&vpx_lpf_vertical_4_dual_c, 8),
|
&vp9_lpf_vertical_4_dual_c, 8),
|
||||||
make_tuple(&vpx_lpf_vertical_8_dual_sse2,
|
make_tuple(&vp9_lpf_vertical_8_dual_sse2,
|
||||||
&vpx_lpf_vertical_8_dual_c, 8)));
|
&vp9_lpf_vertical_8_dual_c, 8)));
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -659,36 +657,36 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
#if HAVE_NEON_ASM
|
#if HAVE_NEON_ASM
|
||||||
// Using #if inside the macro is unsupported on MSVS but the tests are not
|
// Using #if inside the macro is unsupported on MSVS but the tests are not
|
||||||
// currently built for MSVS with ARM and NEON.
|
// currently built for MSVS with ARM and NEON.
|
||||||
make_tuple(&vpx_lpf_horizontal_16_neon,
|
make_tuple(&vp9_lpf_horizontal_16_neon,
|
||||||
&vpx_lpf_horizontal_16_c, 8, 1),
|
&vp9_lpf_horizontal_16_c, 8, 1),
|
||||||
make_tuple(&vpx_lpf_horizontal_16_neon,
|
make_tuple(&vp9_lpf_horizontal_16_neon,
|
||||||
&vpx_lpf_horizontal_16_c, 8, 2),
|
&vp9_lpf_horizontal_16_c, 8, 2),
|
||||||
make_tuple(&wrapper_vertical_16_neon,
|
make_tuple(&wrapper_vertical_16_neon,
|
||||||
&wrapper_vertical_16_c, 8, 1),
|
&wrapper_vertical_16_c, 8, 1),
|
||||||
make_tuple(&wrapper_vertical_16_dual_neon,
|
make_tuple(&wrapper_vertical_16_dual_neon,
|
||||||
&wrapper_vertical_16_dual_c, 8, 1),
|
&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
|
#endif // HAVE_NEON_ASM
|
||||||
make_tuple(&vpx_lpf_horizontal_8_neon,
|
make_tuple(&vp9_lpf_horizontal_4_neon,
|
||||||
&vpx_lpf_horizontal_8_c, 8, 1),
|
&vp9_lpf_horizontal_4_c, 8, 1),
|
||||||
make_tuple(&vpx_lpf_vertical_8_neon,
|
make_tuple(&vp9_lpf_vertical_4_neon,
|
||||||
&vpx_lpf_vertical_8_c, 8, 1),
|
&vp9_lpf_vertical_4_c, 8, 1)));
|
||||||
make_tuple(&vpx_lpf_horizontal_4_neon,
|
|
||||||
&vpx_lpf_horizontal_4_c, 8, 1),
|
|
||||||
make_tuple(&vpx_lpf_vertical_4_neon,
|
|
||||||
&vpx_lpf_vertical_4_c, 8, 1)));
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
NEON, Loop8Test9Param,
|
NEON, Loop8Test9Param,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
#if HAVE_NEON_ASM
|
#if HAVE_NEON_ASM
|
||||||
make_tuple(&vpx_lpf_horizontal_8_dual_neon,
|
make_tuple(&vp9_lpf_horizontal_8_dual_neon,
|
||||||
&vpx_lpf_horizontal_8_dual_c, 8),
|
&vp9_lpf_horizontal_8_dual_c, 8),
|
||||||
make_tuple(&vpx_lpf_vertical_8_dual_neon,
|
make_tuple(&vp9_lpf_vertical_8_dual_neon,
|
||||||
&vpx_lpf_vertical_8_dual_c, 8),
|
&vp9_lpf_vertical_8_dual_c, 8),
|
||||||
#endif // HAVE_NEON_ASM
|
#endif // HAVE_NEON_ASM
|
||||||
make_tuple(&vpx_lpf_horizontal_4_dual_neon,
|
make_tuple(&vp9_lpf_horizontal_4_dual_neon,
|
||||||
&vpx_lpf_horizontal_4_dual_c, 8),
|
&vp9_lpf_horizontal_4_dual_c, 8),
|
||||||
make_tuple(&vpx_lpf_vertical_4_dual_neon,
|
make_tuple(&vp9_lpf_vertical_4_dual_neon,
|
||||||
&vpx_lpf_vertical_4_dual_c, 8)));
|
&vp9_lpf_vertical_4_dual_c, 8)));
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
#endif // HAVE_NEON
|
#endif // HAVE_NEON
|
||||||
|
|
||||||
@@ -696,23 +694,23 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, Loop8Test6Param,
|
MSA, Loop8Test6Param,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_lpf_horizontal_8_msa, &vpx_lpf_horizontal_8_c, 8, 1),
|
make_tuple(&vp9_lpf_horizontal_8_msa, &vp9_lpf_horizontal_8_c, 8, 1),
|
||||||
make_tuple(&vpx_lpf_horizontal_16_msa, &vpx_lpf_horizontal_16_c, 8, 1),
|
make_tuple(&vp9_lpf_horizontal_16_msa, &vp9_lpf_horizontal_16_c, 8, 1),
|
||||||
make_tuple(&vpx_lpf_horizontal_16_msa, &vpx_lpf_horizontal_16_c, 8, 2),
|
make_tuple(&vp9_lpf_horizontal_16_msa, &vp9_lpf_horizontal_16_c, 8, 2),
|
||||||
make_tuple(&vpx_lpf_vertical_8_msa, &vpx_lpf_vertical_8_c, 8, 1),
|
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)));
|
make_tuple(&wrapper_vertical_16_msa, &wrapper_vertical_16_c, 8, 1)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, Loop8Test9Param,
|
MSA, Loop8Test9Param,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_lpf_horizontal_4_dual_msa,
|
make_tuple(&vp9_lpf_horizontal_4_dual_msa,
|
||||||
&vpx_lpf_horizontal_4_dual_c, 8),
|
&vp9_lpf_horizontal_4_dual_c, 8),
|
||||||
make_tuple(&vpx_lpf_horizontal_8_dual_msa,
|
make_tuple(&vp9_lpf_horizontal_8_dual_msa,
|
||||||
&vpx_lpf_horizontal_8_dual_c, 8),
|
&vp9_lpf_horizontal_8_dual_c, 8),
|
||||||
make_tuple(&vpx_lpf_vertical_4_dual_msa,
|
make_tuple(&vp9_lpf_vertical_4_dual_msa,
|
||||||
&vpx_lpf_vertical_4_dual_c, 8),
|
&vp9_lpf_vertical_4_dual_c, 8),
|
||||||
make_tuple(&vpx_lpf_vertical_8_dual_msa,
|
make_tuple(&vp9_lpf_vertical_8_dual_msa,
|
||||||
&vpx_lpf_vertical_8_dual_c, 8)));
|
&vp9_lpf_vertical_8_dual_c, 8)));
|
||||||
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -13,13 +13,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_blockd.h"
|
#include "vp9/common/vp9_blockd.h"
|
||||||
#include "vp9/common/vp9_scan.h"
|
#include "vp9/common/vp9_scan.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
@@ -202,62 +201,62 @@ using std::tr1::make_tuple;
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, PartialIDctTest,
|
C, PartialIDctTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c,
|
&vp9_idct32x32_1024_add_c,
|
||||||
&vpx_idct32x32_34_add_c,
|
&vp9_idct32x32_34_add_c,
|
||||||
TX_32X32, 34),
|
TX_32X32, 34),
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c,
|
&vp9_idct32x32_1024_add_c,
|
||||||
&vpx_idct32x32_1_add_c,
|
&vp9_idct32x32_1_add_c,
|
||||||
TX_32X32, 1),
|
TX_32X32, 1),
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_c,
|
&vp9_idct16x16_256_add_c,
|
||||||
&vpx_idct16x16_10_add_c,
|
&vp9_idct16x16_10_add_c,
|
||||||
TX_16X16, 10),
|
TX_16X16, 10),
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_c,
|
&vp9_idct16x16_256_add_c,
|
||||||
&vpx_idct16x16_1_add_c,
|
&vp9_idct16x16_1_add_c,
|
||||||
TX_16X16, 1),
|
TX_16X16, 1),
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_12_add_c,
|
&vp9_idct8x8_12_add_c,
|
||||||
TX_8X8, 12),
|
TX_8X8, 12),
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_1_add_c,
|
&vp9_idct8x8_1_add_c,
|
||||||
TX_8X8, 1),
|
TX_8X8, 1),
|
||||||
make_tuple(&vpx_fdct4x4_c,
|
make_tuple(&vp9_fdct4x4_c,
|
||||||
&vpx_idct4x4_16_add_c,
|
&vp9_idct4x4_16_add_c,
|
||||||
&vpx_idct4x4_1_add_c,
|
&vp9_idct4x4_1_add_c,
|
||||||
TX_4X4, 1)));
|
TX_4X4, 1)));
|
||||||
|
|
||||||
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
NEON, PartialIDctTest,
|
NEON, PartialIDctTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c,
|
&vp9_idct32x32_1024_add_c,
|
||||||
&vpx_idct32x32_1_add_neon,
|
&vp9_idct32x32_1_add_neon,
|
||||||
TX_32X32, 1),
|
TX_32X32, 1),
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_c,
|
&vp9_idct16x16_256_add_c,
|
||||||
&vpx_idct16x16_10_add_neon,
|
&vp9_idct16x16_10_add_neon,
|
||||||
TX_16X16, 10),
|
TX_16X16, 10),
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_c,
|
&vp9_idct16x16_256_add_c,
|
||||||
&vpx_idct16x16_1_add_neon,
|
&vp9_idct16x16_1_add_neon,
|
||||||
TX_16X16, 1),
|
TX_16X16, 1),
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_12_add_neon,
|
&vp9_idct8x8_12_add_neon,
|
||||||
TX_8X8, 12),
|
TX_8X8, 12),
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_1_add_neon,
|
&vp9_idct8x8_1_add_neon,
|
||||||
TX_8X8, 1),
|
TX_8X8, 1),
|
||||||
make_tuple(&vpx_fdct4x4_c,
|
make_tuple(&vp9_fdct4x4_c,
|
||||||
&vpx_idct4x4_16_add_c,
|
&vp9_idct4x4_16_add_c,
|
||||||
&vpx_idct4x4_1_add_neon,
|
&vp9_idct4x4_1_add_neon,
|
||||||
TX_4X4, 1)));
|
TX_4X4, 1)));
|
||||||
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
||||||
|
|
||||||
@@ -265,44 +264,44 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, PartialIDctTest,
|
SSE2, PartialIDctTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c,
|
&vp9_idct32x32_1024_add_c,
|
||||||
&vpx_idct32x32_34_add_sse2,
|
&vp9_idct32x32_34_add_sse2,
|
||||||
TX_32X32, 34),
|
TX_32X32, 34),
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c,
|
&vp9_idct32x32_1024_add_c,
|
||||||
&vpx_idct32x32_1_add_sse2,
|
&vp9_idct32x32_1_add_sse2,
|
||||||
TX_32X32, 1),
|
TX_32X32, 1),
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_c,
|
&vp9_idct16x16_256_add_c,
|
||||||
&vpx_idct16x16_10_add_sse2,
|
&vp9_idct16x16_10_add_sse2,
|
||||||
TX_16X16, 10),
|
TX_16X16, 10),
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_c,
|
&vp9_idct16x16_256_add_c,
|
||||||
&vpx_idct16x16_1_add_sse2,
|
&vp9_idct16x16_1_add_sse2,
|
||||||
TX_16X16, 1),
|
TX_16X16, 1),
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_12_add_sse2,
|
&vp9_idct8x8_12_add_sse2,
|
||||||
TX_8X8, 12),
|
TX_8X8, 12),
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_1_add_sse2,
|
&vp9_idct8x8_1_add_sse2,
|
||||||
TX_8X8, 1),
|
TX_8X8, 1),
|
||||||
make_tuple(&vpx_fdct4x4_c,
|
make_tuple(&vp9_fdct4x4_c,
|
||||||
&vpx_idct4x4_16_add_c,
|
&vp9_idct4x4_16_add_c,
|
||||||
&vpx_idct4x4_1_add_sse2,
|
&vp9_idct4x4_1_add_sse2,
|
||||||
TX_4X4, 1)));
|
TX_4X4, 1)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC && ARCH_X86_64 && \
|
#if HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
|
||||||
!CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
!CONFIG_EMULATE_HARDWARE
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSSE3_64, PartialIDctTest,
|
SSSE3_64, PartialIDctTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_12_add_ssse3,
|
&vp9_idct8x8_12_add_ssse3,
|
||||||
TX_8X8, 12)));
|
TX_8X8, 12)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -310,33 +309,33 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, PartialIDctTest,
|
MSA, PartialIDctTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c,
|
&vp9_idct32x32_1024_add_c,
|
||||||
&vpx_idct32x32_34_add_msa,
|
&vp9_idct32x32_34_add_msa,
|
||||||
TX_32X32, 34),
|
TX_32X32, 34),
|
||||||
make_tuple(&vpx_fdct32x32_c,
|
make_tuple(&vp9_fdct32x32_c,
|
||||||
&vpx_idct32x32_1024_add_c,
|
&vp9_idct32x32_1024_add_c,
|
||||||
&vpx_idct32x32_1_add_msa,
|
&vp9_idct32x32_1_add_msa,
|
||||||
TX_32X32, 1),
|
TX_32X32, 1),
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_c,
|
&vp9_idct16x16_256_add_c,
|
||||||
&vpx_idct16x16_10_add_msa,
|
&vp9_idct16x16_10_add_msa,
|
||||||
TX_16X16, 10),
|
TX_16X16, 10),
|
||||||
make_tuple(&vpx_fdct16x16_c,
|
make_tuple(&vp9_fdct16x16_c,
|
||||||
&vpx_idct16x16_256_add_c,
|
&vp9_idct16x16_256_add_c,
|
||||||
&vpx_idct16x16_1_add_msa,
|
&vp9_idct16x16_1_add_msa,
|
||||||
TX_16X16, 1),
|
TX_16X16, 1),
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_12_add_msa,
|
&vp9_idct8x8_12_add_msa,
|
||||||
TX_8X8, 10),
|
TX_8X8, 10),
|
||||||
make_tuple(&vpx_fdct8x8_c,
|
make_tuple(&vp9_fdct8x8_c,
|
||||||
&vpx_idct8x8_64_add_c,
|
&vp9_idct8x8_64_add_c,
|
||||||
&vpx_idct8x8_1_add_msa,
|
&vp9_idct8x8_1_add_msa,
|
||||||
TX_8X8, 1),
|
TX_8X8, 1),
|
||||||
make_tuple(&vpx_fdct4x4_c,
|
make_tuple(&vp9_fdct4x4_c,
|
||||||
&vpx_idct4x4_16_add_c,
|
&vp9_idct4x4_16_add_c,
|
||||||
&vpx_idct4x4_1_add_msa,
|
&vp9_idct4x4_1_add_msa,
|
||||||
TX_4X4, 1)));
|
TX_4X4, 1)));
|
||||||
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
|
#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));
|
::testing::Values(vp8_post_proc_down_and_across_mb_row_sse2));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_MSA
|
|
||||||
INSTANTIATE_TEST_CASE_P(MSA, VP8PostProcessingFilterTest,
|
|
||||||
::testing::Values(vp8_post_proc_down_and_across_mb_row_msa));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -11,13 +11,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
#include "./vp8_rtcd.h"
|
||||||
#include "vp8/common/blockd.h"
|
#include "vp8/common/blockd.h"
|
||||||
#include "vp8/common/onyx.h"
|
#include "vp8/common/onyx.h"
|
||||||
#include "vp8/encoder/block.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,
|
::testing::Values(make_tuple(&vp8_fast_quantize_b_neon,
|
||||||
&vp8_fast_quantize_b_c)));
|
&vp8_fast_quantize_b_c)));
|
||||||
#endif // HAVE_NEON
|
#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
|
} // namespace
|
||||||
|
@@ -30,9 +30,7 @@
|
|||||||
|
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
|
|
||||||
#undef NOMINMAX
|
#define _WIN32_LEAN_AND_MEAN
|
||||||
#define NOMINMAX
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winnt.h>
|
#include <winnt.h>
|
||||||
|
|
||||||
@@ -98,7 +96,7 @@ class RegisterStateCheck {
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// Save the d8-d15 registers into store.
|
// Save the d8-d15 registers into store.
|
||||||
void vpx_push_neon(int64_t *store);
|
void vp9_push_neon(int64_t *store);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace libvpx_test {
|
namespace libvpx_test {
|
||||||
@@ -113,7 +111,7 @@ class RegisterStateCheck {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static bool StoreRegisters(int64_t store[8]) {
|
static bool StoreRegisters(int64_t store[8]) {
|
||||||
vpx_push_neon(store);
|
vp9_push_neon(store);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +119,7 @@ class RegisterStateCheck {
|
|||||||
bool Check() const {
|
bool Check() const {
|
||||||
if (!initialized_) return false;
|
if (!initialized_) return false;
|
||||||
int64_t post_store[8];
|
int64_t post_store[8];
|
||||||
vpx_push_neon(post_store);
|
vp9_push_neon(post_store);
|
||||||
for (int i = 0; i < 8; ++i) {
|
for (int i = 0; i < 8; ++i) {
|
||||||
EXPECT_EQ(pre_store_[i], post_store[i]) << "d"
|
EXPECT_EQ(pre_store_[i], post_store[i]) << "d"
|
||||||
<< i + 8 << " has been modified";
|
<< i + 8 << " has been modified";
|
||||||
|
@@ -81,15 +81,6 @@ static void write_ivf_frame_header(const vpx_codec_cx_pkt_t *const pkt,
|
|||||||
const unsigned int kInitialWidth = 320;
|
const unsigned int kInitialWidth = 320;
|
||||||
const unsigned int kInitialHeight = 240;
|
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
unsigned int ScaleForFrameNumber(unsigned int frame, unsigned int val) {
|
unsigned int ScaleForFrameNumber(unsigned int frame, unsigned int val) {
|
||||||
if (frame < 10)
|
if (frame < 10)
|
||||||
return val;
|
return val;
|
||||||
@@ -129,6 +120,15 @@ class ResizeTest : public ::libvpx_test::EncoderTest,
|
|||||||
|
|
||||||
virtual ~ResizeTest() {}
|
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() {
|
virtual void SetUp() {
|
||||||
InitializeConfig();
|
InitializeConfig();
|
||||||
SetMode(GET_PARAM(1));
|
SetMode(GET_PARAM(1));
|
||||||
@@ -196,19 +196,6 @@ class ResizeInternalTest : public ResizeTest {
|
|||||||
|
|
||||||
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
|
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
|
||||||
libvpx_test::Encoder *encoder) {
|
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) {
|
if (video->frame() == kStepDownFrame) {
|
||||||
struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};
|
struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};
|
||||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||||
@@ -218,7 +205,6 @@ class ResizeInternalTest : public ResizeTest {
|
|||||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
|
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
|
||||||
if (!frame0_psnr_)
|
if (!frame0_psnr_)
|
||||||
@@ -241,7 +227,6 @@ class ResizeInternalTest : public ResizeTest {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
double frame0_psnr_;
|
double frame0_psnr_;
|
||||||
bool change_config_;
|
|
||||||
#if WRITE_COMPRESSED_STREAM
|
#if WRITE_COMPRESSED_STREAM
|
||||||
FILE *outfile_;
|
FILE *outfile_;
|
||||||
unsigned int out_frames_;
|
unsigned int out_frames_;
|
||||||
@@ -252,7 +237,6 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
|
|||||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||||
30, 1, 0, 10);
|
30, 1, 0, 10);
|
||||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||||
change_config_ = false;
|
|
||||||
|
|
||||||
// q picked such that initial keyframe on this clip is ~30dB PSNR
|
// q picked such that initial keyframe on this clip is ~30dB PSNR
|
||||||
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;
|
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;
|
||||||
@@ -277,164 +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));
|
|
||||||
}
|
|
||||||
|
|
||||||
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_;
|
|
||||||
};
|
|
||||||
|
|
||||||
TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
|
|
||||||
ResizingVideoSource video;
|
|
||||||
DefaultConfig();
|
|
||||||
change_bitrate_ = false;
|
|
||||||
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);
|
|
||||||
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)
|
|
||||||
<< "Frame " << frame << " had unexpected height";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
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++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify that we get 1 resize down event in this test.
|
|
||||||
ASSERT_EQ(1, resize_count) << "Resizing should occur.";
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify that we get 2 resize events in this test.
|
|
||||||
ASSERT_EQ(resize_count, 2) << "Resizing should occur twice.";
|
|
||||||
}
|
|
||||||
|
|
||||||
vpx_img_fmt_t CspForFrameNumber(int frame) {
|
vpx_img_fmt_t CspForFrameNumber(int frame) {
|
||||||
if (frame < 10)
|
if (frame < 10)
|
||||||
return VPX_IMG_FMT_I420;
|
return VPX_IMG_FMT_I420;
|
||||||
@@ -545,9 +371,6 @@ VP9_INSTANTIATE_TEST_CASE(ResizeTest,
|
|||||||
::testing::Values(::libvpx_test::kRealTime));
|
::testing::Values(::libvpx_test::kRealTime));
|
||||||
VP9_INSTANTIATE_TEST_CASE(ResizeInternalTest,
|
VP9_INSTANTIATE_TEST_CASE(ResizeInternalTest,
|
||||||
::testing::Values(::libvpx_test::kOnePassBest));
|
::testing::Values(::libvpx_test::kOnePassBest));
|
||||||
VP9_INSTANTIATE_TEST_CASE(ResizeRealtimeTest,
|
|
||||||
::testing::Values(::libvpx_test::kRealTime),
|
|
||||||
::testing::Range(5, 9));
|
|
||||||
VP9_INSTANTIATE_TEST_CASE(ResizeCspTest,
|
VP9_INSTANTIATE_TEST_CASE(ResizeCspTest,
|
||||||
::testing::Values(::libvpx_test::kRealTime));
|
::testing::Values(::libvpx_test::kRealTime));
|
||||||
} // namespace
|
} // namespace
|
||||||
|
933
test/sad_test.cc
933
test/sad_test.cc
File diff suppressed because it is too large
Load Diff
@@ -11,15 +11,13 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.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/vpx_integer.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
|
|
||||||
@@ -186,48 +184,58 @@ TEST_P(SixtapPredictTest, TestWithRandomData) {
|
|||||||
|
|
||||||
using std::tr1::make_tuple;
|
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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, SixtapPredictTest, ::testing::Values(
|
C, SixtapPredictTest, ::testing::Values(
|
||||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_c),
|
make_tuple(16, 16, sixtap_16x16_c),
|
||||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_c),
|
make_tuple(8, 8, sixtap_8x8_c),
|
||||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_c),
|
make_tuple(8, 4, sixtap_8x4_c),
|
||||||
make_tuple(4, 4, &vp8_sixtap_predict4x4_c)));
|
make_tuple(4, 4, sixtap_4x4_c)));
|
||||||
#if HAVE_NEON
|
#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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
NEON, SixtapPredictTest, ::testing::Values(
|
DISABLED_NEON, SixtapPredictTest, ::testing::Values(
|
||||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_neon),
|
make_tuple(16, 16, sixtap_16x16_neon),
|
||||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_neon),
|
make_tuple(8, 8, sixtap_8x8_neon),
|
||||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_neon)));
|
make_tuple(8, 4, sixtap_8x4_neon)));
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_MMX
|
#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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MMX, SixtapPredictTest, ::testing::Values(
|
MMX, SixtapPredictTest, ::testing::Values(
|
||||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_mmx),
|
make_tuple(16, 16, sixtap_16x16_mmx),
|
||||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_mmx),
|
make_tuple(8, 8, sixtap_8x8_mmx),
|
||||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_mmx),
|
make_tuple(8, 4, sixtap_8x4_mmx),
|
||||||
make_tuple(4, 4, &vp8_sixtap_predict4x4_mmx)));
|
make_tuple(4, 4, sixtap_4x4_mmx)));
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_SSE2
|
#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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, SixtapPredictTest, ::testing::Values(
|
SSE2, SixtapPredictTest, ::testing::Values(
|
||||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_sse2),
|
make_tuple(16, 16, sixtap_16x16_sse2),
|
||||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_sse2),
|
make_tuple(8, 8, sixtap_8x8_sse2),
|
||||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_sse2)));
|
make_tuple(8, 4, sixtap_8x4_sse2)));
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_SSSE3
|
#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(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSSE3, SixtapPredictTest, ::testing::Values(
|
SSSE3, SixtapPredictTest, ::testing::Values(
|
||||||
make_tuple(16, 16, &vp8_sixtap_predict16x16_ssse3),
|
make_tuple(16, 16, sixtap_16x16_ssse3),
|
||||||
make_tuple(8, 8, &vp8_sixtap_predict8x8_ssse3),
|
make_tuple(8, 8, sixtap_8x8_ssse3),
|
||||||
make_tuple(8, 4, &vp8_sixtap_predict8x4_ssse3),
|
make_tuple(8, 4, sixtap_8x4_ssse3),
|
||||||
make_tuple(4, 4, &vp8_sixtap_predict4x4_ssse3)));
|
make_tuple(4, 4, sixtap_4x4_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)));
|
|
||||||
#endif
|
#endif
|
||||||
} // namespace
|
} // 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 {
|
namespace {
|
||||||
|
|
||||||
const int kTestMode = 0;
|
|
||||||
const int kSuperframeSyntax = 1;
|
|
||||||
|
|
||||||
typedef std::tr1::tuple<libvpx_test::TestMode,int> SuperframeTestParam;
|
|
||||||
|
|
||||||
class SuperframeTest : public ::libvpx_test::EncoderTest,
|
class SuperframeTest : public ::libvpx_test::EncoderTest,
|
||||||
public ::libvpx_test::CodecTestWithParam<SuperframeTestParam> {
|
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
|
||||||
protected:
|
protected:
|
||||||
SuperframeTest() : EncoderTest(GET_PARAM(0)), modified_buf_(NULL),
|
SuperframeTest() : EncoderTest(GET_PARAM(0)), modified_buf_(NULL),
|
||||||
last_sf_pts_(0) {}
|
last_sf_pts_(0) {}
|
||||||
@@ -30,13 +25,9 @@ class SuperframeTest : public ::libvpx_test::EncoderTest,
|
|||||||
|
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
InitializeConfig();
|
InitializeConfig();
|
||||||
const SuperframeTestParam input = GET_PARAM(1);
|
SetMode(GET_PARAM(1));
|
||||||
const libvpx_test::TestMode mode = std::tr1::get<kTestMode>(input);
|
|
||||||
const int syntax = std::tr1::get<kSuperframeSyntax>(input);
|
|
||||||
SetMode(mode);
|
|
||||||
sf_count_ = 0;
|
sf_count_ = 0;
|
||||||
sf_count_max_ = INT_MAX;
|
sf_count_max_ = INT_MAX;
|
||||||
is_vp10_style_superframe_ = syntax;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void TearDown() {
|
virtual void TearDown() {
|
||||||
@@ -59,8 +50,7 @@ class SuperframeTest : public ::libvpx_test::EncoderTest,
|
|||||||
const uint8_t marker = buffer[pkt->data.frame.sz - 1];
|
const uint8_t marker = buffer[pkt->data.frame.sz - 1];
|
||||||
const int frames = (marker & 0x7) + 1;
|
const int frames = (marker & 0x7) + 1;
|
||||||
const int mag = ((marker >> 3) & 3) + 1;
|
const int mag = ((marker >> 3) & 3) + 1;
|
||||||
const unsigned int index_sz =
|
const unsigned int index_sz = 2 + mag * frames;
|
||||||
2 + mag * (frames - is_vp10_style_superframe_);
|
|
||||||
if ((marker & 0xe0) == 0xc0 &&
|
if ((marker & 0xe0) == 0xc0 &&
|
||||||
pkt->data.frame.sz >= index_sz &&
|
pkt->data.frame.sz >= index_sz &&
|
||||||
buffer[pkt->data.frame.sz - index_sz] == marker) {
|
buffer[pkt->data.frame.sz - index_sz] == marker) {
|
||||||
@@ -85,7 +75,6 @@ class SuperframeTest : public ::libvpx_test::EncoderTest,
|
|||||||
return pkt;
|
return pkt;
|
||||||
}
|
}
|
||||||
|
|
||||||
int is_vp10_style_superframe_;
|
|
||||||
int sf_count_;
|
int sf_count_;
|
||||||
int sf_count_max_;
|
int sf_count_max_;
|
||||||
vpx_codec_cx_pkt_t modified_pkt_;
|
vpx_codec_cx_pkt_t modified_pkt_;
|
||||||
@@ -103,11 +92,6 @@ TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) {
|
|||||||
EXPECT_EQ(sf_count_, 1);
|
EXPECT_EQ(sf_count_, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
|
VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(
|
||||||
::testing::Values(::libvpx_test::kTwoPassGood),
|
::libvpx_test::kTwoPassGood));
|
||||||
::testing::Values(0)));
|
|
||||||
|
|
||||||
VP10_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
|
|
||||||
::testing::Values(::libvpx_test::kTwoPassGood),
|
|
||||||
::testing::Values(CONFIG_MISC_FIXES)));
|
|
||||||
} // namespace
|
} // 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_444.y4m
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_440.yuv
|
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) += niklas_1280_720_30.y4m
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += rush_hour_444.y4m
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += rush_hour_444.y4m
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += screendata.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-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
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm.md5
|
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
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm.md5
|
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
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm
|
||||||
@@ -654,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-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
|
||||||
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-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
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey.webm.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey.webm.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey_adpq.webm
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey_adpq.webm
|
||||||
@@ -728,8 +687,8 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp93-2-20-12bit-yuv444.webm.md5
|
|||||||
endif # CONFIG_VP9_HIGHBITDEPTH
|
endif # CONFIG_VP9_HIGHBITDEPTH
|
||||||
|
|
||||||
# Invalid files for testing libvpx error checking.
|
# 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-v2.webm
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-01-v3.webm.res
|
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
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-02-v2.webm.res
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-02-v2.webm.res
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-03-v3.webm
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-03-v3.webm
|
||||||
@@ -809,53 +768,3 @@ endif # CONFIG_ENCODE_PERF_TESTS
|
|||||||
|
|
||||||
# sort and remove duplicates
|
# sort and remove duplicates
|
||||||
LIBVPX_TEST_DATA-yes := $(sort $(LIBVPX_TEST_DATA-yes))
|
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
|
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
|
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
|
456d1493e52d32a5c30edf44a27debc1fa6b253a *invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf.res
|
||||||
fe346136b9b8c1e6f6084cc106485706915795e4 *invalid-vp90-01-v3.webm
|
fe346136b9b8c1e6f6084cc106485706915795e4 *invalid-vp90-01-v2.webm
|
||||||
5d9474c0309b7ca09a182d888f73b37a8fe1362c *invalid-vp90-01-v3.webm.res
|
25751f5d3b05ff03f0719ad42cd625348eb8961e *invalid-vp90-01-v2.webm.res
|
||||||
d78e2fceba5ac942246503ec8366f879c4775ca5 *invalid-vp90-02-v2.webm
|
d78e2fceba5ac942246503ec8366f879c4775ca5 *invalid-vp90-02-v2.webm
|
||||||
8e2eff4af87d2b561cce2365713269e301457ef3 *invalid-vp90-02-v2.webm.res
|
8e2eff4af87d2b561cce2365713269e301457ef3 *invalid-vp90-02-v2.webm.res
|
||||||
df1a1453feb3c00d7d89746c7003b4163523bff3 *invalid-vp90-03-v3.webm
|
df1a1453feb3c00d7d89746c7003b4163523bff3 *invalid-vp90-03-v3.webm
|
||||||
@@ -743,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
|
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
|
0ae808dca4d3c1152a9576e14830b6faa39f1b4a *invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf.res
|
||||||
9cfc855459e7549fd015c79e8eca512b2f2cb7e3 *niklas_1280_720_30.y4m
|
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
|
|
||||||
|
39
test/test.mk
39
test/test.mk
@@ -36,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) += invalid_file_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += user_priv_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_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) += active_map_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += borders_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += borders_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += cpu_speed_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += cpu_speed_test.cc
|
||||||
@@ -94,7 +93,7 @@ endif
|
|||||||
ifeq ($(CONFIG_SHARED),)
|
ifeq ($(CONFIG_SHARED),)
|
||||||
|
|
||||||
## VP8
|
## VP8
|
||||||
ifeq ($(CONFIG_VP8),yes)
|
ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
|
||||||
|
|
||||||
# These tests require both the encoder and decoder to be built.
|
# These tests require both the encoder and decoder to be built.
|
||||||
ifeq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),yesyes)
|
ifeq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),yesyes)
|
||||||
@@ -104,12 +103,14 @@ endif
|
|||||||
|
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_POSTPROC) += pp_filter_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_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) += 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) += variance_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += vp8_fdct4x4_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 += idct_test.cc
|
||||||
|
LIBVPX_TEST_SRCS-yes += intrapred_test.cc
|
||||||
LIBVPX_TEST_SRCS-yes += sixtap_predict_test.cc
|
LIBVPX_TEST_SRCS-yes += sixtap_predict_test.cc
|
||||||
LIBVPX_TEST_SRCS-yes += vpx_scale_test.cc
|
LIBVPX_TEST_SRCS-yes += vpx_scale_test.cc
|
||||||
|
|
||||||
@@ -120,7 +121,7 @@ endif
|
|||||||
endif # VP8
|
endif # VP8
|
||||||
|
|
||||||
## VP9
|
## VP9
|
||||||
ifeq ($(CONFIG_VP9),yes)
|
ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),)
|
||||||
|
|
||||||
# These tests require both the encoder and decoder to be built.
|
# These tests require both the encoder and decoder to be built.
|
||||||
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),yesyes)
|
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),yesyes)
|
||||||
@@ -133,24 +134,26 @@ LIBVPX_TEST_SRCS-yes += vp9_boolcoder_test.cc
|
|||||||
LIBVPX_TEST_SRCS-yes += vp9_encoder_parms_get_to_decoder.cc
|
LIBVPX_TEST_SRCS-yes += vp9_encoder_parms_get_to_decoder.cc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBVPX_TEST_SRCS-yes += convolve_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9) += 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_DECODER) += vp9_thread_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) += dct16x16_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct32x32_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) += fdct4x4_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct8x8_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct8x8_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += variance_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_error_block_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_quantize_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)
|
ifeq ($(CONFIG_VP9_ENCODER),yes)
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_SPATIAL_SVC) += svc_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_SPATIAL_SVC) += svc_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_INTERNAL_STATS) += blockiness_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_INTERNAL_STATS) += blockiness_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_INTERNAL_STATS) += consistency_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_INTERNAL_STATS) += consistency_test.cc
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_TEMPORAL_DENOISING),yesyes)
|
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_TEMPORAL_DENOISING),yesyes)
|
||||||
@@ -160,24 +163,10 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_arf_freq_test.cc
|
|||||||
|
|
||||||
endif # VP9
|
endif # VP9
|
||||||
|
|
||||||
## VP10
|
|
||||||
ifeq ($(CONFIG_VP10),yes)
|
|
||||||
|
|
||||||
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
|
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc
|
||||||
|
|
||||||
TEST_INTRA_PRED_SPEED_SRCS-yes := test_intra_pred_speed.cc
|
TEST_INTRA_PRED_SPEED_SRCS-$(CONFIG_VP9_DECODER) := 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) += ../md5_utils.h ../md5_utils.c
|
||||||
|
|
||||||
endif # CONFIG_SHARED
|
endif # CONFIG_SHARED
|
||||||
|
|
||||||
|
@@ -7,14 +7,14 @@
|
|||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* 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 <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/md5_helper.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, \
|
#define INTRA_PRED_TEST(arch, test_func, dc, dc_left, dc_top, dc_128, v, h, \
|
||||||
d45, d135, d117, d153, d207, d63, tm) \
|
d45, d135, d117, d153, d207, d63, tm) \
|
||||||
TEST(arch, test_func) { \
|
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, \
|
dc, dc_left, dc_top, dc_128, v, h, d45, \
|
||||||
d135, d117, d153, d207, d63, tm}; \
|
d135, d117, d153, d207, d63, tm}; \
|
||||||
test_func(vpx_intra_pred); \
|
test_func(vp9_intra_pred); \
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// 4x4
|
// 4x4
|
||||||
|
|
||||||
INTRA_PRED_TEST(C, TestIntraPred4, vpx_dc_predictor_4x4_c,
|
INTRA_PRED_TEST(C, TestIntraPred4, vp9_dc_predictor_4x4_c,
|
||||||
vpx_dc_left_predictor_4x4_c, vpx_dc_top_predictor_4x4_c,
|
vp9_dc_left_predictor_4x4_c, vp9_dc_top_predictor_4x4_c,
|
||||||
vpx_dc_128_predictor_4x4_c, vpx_v_predictor_4x4_c,
|
vp9_dc_128_predictor_4x4_c, vp9_v_predictor_4x4_c,
|
||||||
vpx_h_predictor_4x4_c, vpx_d45_predictor_4x4_c,
|
vp9_h_predictor_4x4_c, vp9_d45_predictor_4x4_c,
|
||||||
vpx_d135_predictor_4x4_c, vpx_d117_predictor_4x4_c,
|
vp9_d135_predictor_4x4_c, vp9_d117_predictor_4x4_c,
|
||||||
vpx_d153_predictor_4x4_c, vpx_d207_predictor_4x4_c,
|
vp9_d153_predictor_4x4_c, vp9_d207_predictor_4x4_c,
|
||||||
vpx_d63_predictor_4x4_c, vpx_tm_predictor_4x4_c)
|
vp9_d63_predictor_4x4_c, vp9_tm_predictor_4x4_c)
|
||||||
|
|
||||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
#if HAVE_SSE
|
||||||
INTRA_PRED_TEST(SSE2, TestIntraPred4, vpx_dc_predictor_4x4_sse2,
|
INTRA_PRED_TEST(SSE, TestIntraPred4, vp9_dc_predictor_4x4_sse,
|
||||||
vpx_dc_left_predictor_4x4_sse2, vpx_dc_top_predictor_4x4_sse2,
|
vp9_dc_left_predictor_4x4_sse, vp9_dc_top_predictor_4x4_sse,
|
||||||
vpx_dc_128_predictor_4x4_sse2, vpx_v_predictor_4x4_sse2,
|
vp9_dc_128_predictor_4x4_sse, vp9_v_predictor_4x4_sse, NULL,
|
||||||
vpx_h_predictor_4x4_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, vp9_tm_predictor_4x4_sse)
|
||||||
vpx_tm_predictor_4x4_sse2)
|
#endif // HAVE_SSE
|
||||||
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
|
|
||||||
|
|
||||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC
|
#if HAVE_SSSE3
|
||||||
INTRA_PRED_TEST(SSSE3, TestIntraPred4, NULL, NULL, NULL, NULL, NULL,
|
INTRA_PRED_TEST(SSSE3, TestIntraPred4, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, vpx_d45_predictor_4x4_ssse3, NULL, NULL,
|
vp9_h_predictor_4x4_ssse3, vp9_d45_predictor_4x4_ssse3, NULL,
|
||||||
vpx_d153_predictor_4x4_ssse3, vpx_d207_predictor_4x4_ssse3,
|
NULL, vp9_d153_predictor_4x4_ssse3,
|
||||||
vpx_d63_predictor_4x4_ssse3, NULL)
|
vp9_d207_predictor_4x4_ssse3, vp9_d63_predictor_4x4_ssse3, NULL)
|
||||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
|
#endif // HAVE_SSSE3
|
||||||
|
|
||||||
#if HAVE_DSPR2
|
#if HAVE_DSPR2
|
||||||
INTRA_PRED_TEST(DSPR2, TestIntraPred4, vpx_dc_predictor_4x4_dspr2, NULL, NULL,
|
INTRA_PRED_TEST(DSPR2, TestIntraPred4, vp9_dc_predictor_4x4_dspr2, NULL, NULL,
|
||||||
NULL, NULL, vpx_h_predictor_4x4_dspr2, NULL, NULL, NULL, NULL,
|
NULL, NULL, vp9_h_predictor_4x4_dspr2, NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, vpx_tm_predictor_4x4_dspr2)
|
NULL, NULL, vp9_tm_predictor_4x4_dspr2)
|
||||||
#endif // HAVE_DSPR2
|
#endif // HAVE_DSPR2
|
||||||
|
|
||||||
#if HAVE_NEON
|
#if HAVE_NEON
|
||||||
INTRA_PRED_TEST(NEON, TestIntraPred4, vpx_dc_predictor_4x4_neon,
|
INTRA_PRED_TEST(NEON, TestIntraPred4, vp9_dc_predictor_4x4_neon,
|
||||||
vpx_dc_left_predictor_4x4_neon, vpx_dc_top_predictor_4x4_neon,
|
vp9_dc_left_predictor_4x4_neon, vp9_dc_top_predictor_4x4_neon,
|
||||||
vpx_dc_128_predictor_4x4_neon, vpx_v_predictor_4x4_neon,
|
vp9_dc_128_predictor_4x4_neon, vp9_v_predictor_4x4_neon,
|
||||||
vpx_h_predictor_4x4_neon, vpx_d45_predictor_4x4_neon,
|
vp9_h_predictor_4x4_neon, vp9_d45_predictor_4x4_neon,
|
||||||
vpx_d135_predictor_4x4_neon, NULL, NULL, NULL, NULL,
|
vp9_d135_predictor_4x4_neon, NULL, NULL, NULL, NULL,
|
||||||
vpx_tm_predictor_4x4_neon)
|
vp9_tm_predictor_4x4_neon)
|
||||||
#endif // HAVE_NEON
|
#endif // HAVE_NEON
|
||||||
|
|
||||||
#if HAVE_MSA
|
#if HAVE_MSA
|
||||||
INTRA_PRED_TEST(MSA, TestIntraPred4, vpx_dc_predictor_4x4_msa,
|
INTRA_PRED_TEST(MSA, TestIntraPred4, vp9_dc_predictor_4x4_msa,
|
||||||
vpx_dc_left_predictor_4x4_msa, vpx_dc_top_predictor_4x4_msa,
|
vp9_dc_left_predictor_4x4_msa, vp9_dc_top_predictor_4x4_msa,
|
||||||
vpx_dc_128_predictor_4x4_msa, vpx_v_predictor_4x4_msa,
|
vp9_dc_128_predictor_4x4_msa, vp9_v_predictor_4x4_msa,
|
||||||
vpx_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL,
|
vp9_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, vpx_tm_predictor_4x4_msa)
|
NULL, vp9_tm_predictor_4x4_msa)
|
||||||
#endif // HAVE_MSA
|
#endif // HAVE_MSA
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// 8x8
|
// 8x8
|
||||||
|
|
||||||
INTRA_PRED_TEST(C, TestIntraPred8, vpx_dc_predictor_8x8_c,
|
INTRA_PRED_TEST(C, TestIntraPred8, vp9_dc_predictor_8x8_c,
|
||||||
vpx_dc_left_predictor_8x8_c, vpx_dc_top_predictor_8x8_c,
|
vp9_dc_left_predictor_8x8_c, vp9_dc_top_predictor_8x8_c,
|
||||||
vpx_dc_128_predictor_8x8_c, vpx_v_predictor_8x8_c,
|
vp9_dc_128_predictor_8x8_c, vp9_v_predictor_8x8_c,
|
||||||
vpx_h_predictor_8x8_c, vpx_d45_predictor_8x8_c,
|
vp9_h_predictor_8x8_c, vp9_d45_predictor_8x8_c,
|
||||||
vpx_d135_predictor_8x8_c, vpx_d117_predictor_8x8_c,
|
vp9_d135_predictor_8x8_c, vp9_d117_predictor_8x8_c,
|
||||||
vpx_d153_predictor_8x8_c, vpx_d207_predictor_8x8_c,
|
vp9_d153_predictor_8x8_c, vp9_d207_predictor_8x8_c,
|
||||||
vpx_d63_predictor_8x8_c, vpx_tm_predictor_8x8_c)
|
vp9_d63_predictor_8x8_c, vp9_tm_predictor_8x8_c)
|
||||||
|
|
||||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
#if HAVE_SSE
|
||||||
INTRA_PRED_TEST(SSE2, TestIntraPred8, vpx_dc_predictor_8x8_sse2,
|
INTRA_PRED_TEST(SSE, TestIntraPred8, vp9_dc_predictor_8x8_sse,
|
||||||
vpx_dc_left_predictor_8x8_sse2, vpx_dc_top_predictor_8x8_sse2,
|
vp9_dc_left_predictor_8x8_sse, vp9_dc_top_predictor_8x8_sse,
|
||||||
vpx_dc_128_predictor_8x8_sse2, vpx_v_predictor_8x8_sse2,
|
vp9_dc_128_predictor_8x8_sse, vp9_v_predictor_8x8_sse, NULL,
|
||||||
vpx_h_predictor_8x8_sse2, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL)
|
||||||
NULL, vpx_tm_predictor_8x8_sse2)
|
#endif // HAVE_SSE
|
||||||
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
|
|
||||||
|
|
||||||
#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,
|
INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, vpx_d45_predictor_8x8_ssse3, NULL, NULL,
|
vp9_h_predictor_8x8_ssse3, vp9_d45_predictor_8x8_ssse3, NULL,
|
||||||
vpx_d153_predictor_8x8_ssse3, vpx_d207_predictor_8x8_ssse3,
|
NULL, vp9_d153_predictor_8x8_ssse3,
|
||||||
vpx_d63_predictor_8x8_ssse3, NULL)
|
vp9_d207_predictor_8x8_ssse3, vp9_d63_predictor_8x8_ssse3, NULL)
|
||||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
|
#endif // HAVE_SSSE3
|
||||||
|
|
||||||
#if HAVE_DSPR2
|
#if HAVE_DSPR2
|
||||||
INTRA_PRED_TEST(DSPR2, TestIntraPred8, vpx_dc_predictor_8x8_dspr2, NULL, NULL,
|
INTRA_PRED_TEST(DSPR2, TestIntraPred8, vp9_dc_predictor_8x8_dspr2, NULL, NULL,
|
||||||
NULL, NULL, vpx_h_predictor_8x8_dspr2, NULL, NULL, NULL, NULL,
|
NULL, NULL, vp9_h_predictor_8x8_dspr2, NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, vpx_tm_predictor_8x8_c)
|
NULL, NULL, vp9_tm_predictor_8x8_c)
|
||||||
#endif // HAVE_DSPR2
|
#endif // HAVE_DSPR2
|
||||||
|
|
||||||
#if HAVE_NEON
|
#if HAVE_NEON
|
||||||
INTRA_PRED_TEST(NEON, TestIntraPred8, vpx_dc_predictor_8x8_neon,
|
INTRA_PRED_TEST(NEON, TestIntraPred8, vp9_dc_predictor_8x8_neon,
|
||||||
vpx_dc_left_predictor_8x8_neon, vpx_dc_top_predictor_8x8_neon,
|
vp9_dc_left_predictor_8x8_neon, vp9_dc_top_predictor_8x8_neon,
|
||||||
vpx_dc_128_predictor_8x8_neon, vpx_v_predictor_8x8_neon,
|
vp9_dc_128_predictor_8x8_neon, vp9_v_predictor_8x8_neon,
|
||||||
vpx_h_predictor_8x8_neon, vpx_d45_predictor_8x8_neon, NULL,
|
vp9_h_predictor_8x8_neon, vp9_d45_predictor_8x8_neon, NULL,
|
||||||
NULL, NULL, NULL, NULL, vpx_tm_predictor_8x8_neon)
|
NULL, NULL, NULL, NULL, vp9_tm_predictor_8x8_neon)
|
||||||
|
|
||||||
#endif // HAVE_NEON
|
#endif // HAVE_NEON
|
||||||
|
|
||||||
#if HAVE_MSA
|
#if HAVE_MSA
|
||||||
INTRA_PRED_TEST(MSA, TestIntraPred8, vpx_dc_predictor_8x8_msa,
|
INTRA_PRED_TEST(MSA, TestIntraPred8, vp9_dc_predictor_8x8_msa,
|
||||||
vpx_dc_left_predictor_8x8_msa, vpx_dc_top_predictor_8x8_msa,
|
vp9_dc_left_predictor_8x8_msa, vp9_dc_top_predictor_8x8_msa,
|
||||||
vpx_dc_128_predictor_8x8_msa, vpx_v_predictor_8x8_msa,
|
vp9_dc_128_predictor_8x8_msa, vp9_v_predictor_8x8_msa,
|
||||||
vpx_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL,
|
vp9_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, vpx_tm_predictor_8x8_msa)
|
NULL, vp9_tm_predictor_8x8_msa)
|
||||||
#endif // HAVE_MSA
|
#endif // HAVE_MSA
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// 16x16
|
// 16x16
|
||||||
|
|
||||||
INTRA_PRED_TEST(C, TestIntraPred16, vpx_dc_predictor_16x16_c,
|
INTRA_PRED_TEST(C, TestIntraPred16, vp9_dc_predictor_16x16_c,
|
||||||
vpx_dc_left_predictor_16x16_c, vpx_dc_top_predictor_16x16_c,
|
vp9_dc_left_predictor_16x16_c, vp9_dc_top_predictor_16x16_c,
|
||||||
vpx_dc_128_predictor_16x16_c, vpx_v_predictor_16x16_c,
|
vp9_dc_128_predictor_16x16_c, vp9_v_predictor_16x16_c,
|
||||||
vpx_h_predictor_16x16_c, vpx_d45_predictor_16x16_c,
|
vp9_h_predictor_16x16_c, vp9_d45_predictor_16x16_c,
|
||||||
vpx_d135_predictor_16x16_c, vpx_d117_predictor_16x16_c,
|
vp9_d135_predictor_16x16_c, vp9_d117_predictor_16x16_c,
|
||||||
vpx_d153_predictor_16x16_c, vpx_d207_predictor_16x16_c,
|
vp9_d153_predictor_16x16_c, vp9_d207_predictor_16x16_c,
|
||||||
vpx_d63_predictor_16x16_c, vpx_tm_predictor_16x16_c)
|
vp9_d63_predictor_16x16_c, vp9_tm_predictor_16x16_c)
|
||||||
|
|
||||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
#if HAVE_SSE2
|
||||||
INTRA_PRED_TEST(SSE2, TestIntraPred16, vpx_dc_predictor_16x16_sse2,
|
INTRA_PRED_TEST(SSE2, TestIntraPred16, vp9_dc_predictor_16x16_sse2,
|
||||||
vpx_dc_left_predictor_16x16_sse2,
|
vp9_dc_left_predictor_16x16_sse2,
|
||||||
vpx_dc_top_predictor_16x16_sse2,
|
vp9_dc_top_predictor_16x16_sse2,
|
||||||
vpx_dc_128_predictor_16x16_sse2, vpx_v_predictor_16x16_sse2,
|
vp9_dc_128_predictor_16x16_sse2, vp9_v_predictor_16x16_sse2,
|
||||||
vpx_h_predictor_16x16_sse2, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
vpx_tm_predictor_16x16_sse2)
|
vp9_tm_predictor_16x16_sse2)
|
||||||
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
|
#endif // HAVE_SSE2
|
||||||
|
|
||||||
#if HAVE_SSSE3 && CONFIG_USE_X86INC
|
#if HAVE_SSSE3
|
||||||
INTRA_PRED_TEST(SSSE3, TestIntraPred16, NULL, NULL, NULL, NULL, NULL,
|
INTRA_PRED_TEST(SSSE3, TestIntraPred16, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, vpx_d45_predictor_16x16_ssse3,
|
vp9_h_predictor_16x16_ssse3, vp9_d45_predictor_16x16_ssse3,
|
||||||
NULL, NULL, vpx_d153_predictor_16x16_ssse3,
|
NULL, NULL, vp9_d153_predictor_16x16_ssse3,
|
||||||
vpx_d207_predictor_16x16_ssse3, vpx_d63_predictor_16x16_ssse3,
|
vp9_d207_predictor_16x16_ssse3, vp9_d63_predictor_16x16_ssse3,
|
||||||
NULL)
|
NULL)
|
||||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
|
#endif // HAVE_SSSE3
|
||||||
|
|
||||||
#if HAVE_DSPR2
|
#if HAVE_DSPR2
|
||||||
INTRA_PRED_TEST(DSPR2, TestIntraPred16, vpx_dc_predictor_16x16_dspr2, NULL,
|
INTRA_PRED_TEST(DSPR2, TestIntraPred16, vp9_dc_predictor_16x16_dspr2, NULL,
|
||||||
NULL, NULL, NULL, vpx_h_predictor_16x16_dspr2, NULL, NULL, NULL,
|
NULL, NULL, NULL, vp9_h_predictor_16x16_dspr2, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL)
|
NULL, NULL, NULL, NULL)
|
||||||
#endif // HAVE_DSPR2
|
#endif // HAVE_DSPR2
|
||||||
|
|
||||||
#if HAVE_NEON
|
#if HAVE_NEON
|
||||||
INTRA_PRED_TEST(NEON, TestIntraPred16, vpx_dc_predictor_16x16_neon,
|
INTRA_PRED_TEST(NEON, TestIntraPred16, vp9_dc_predictor_16x16_neon,
|
||||||
vpx_dc_left_predictor_16x16_neon,
|
vp9_dc_left_predictor_16x16_neon,
|
||||||
vpx_dc_top_predictor_16x16_neon,
|
vp9_dc_top_predictor_16x16_neon,
|
||||||
vpx_dc_128_predictor_16x16_neon, vpx_v_predictor_16x16_neon,
|
vp9_dc_128_predictor_16x16_neon, vp9_v_predictor_16x16_neon,
|
||||||
vpx_h_predictor_16x16_neon, vpx_d45_predictor_16x16_neon, NULL,
|
vp9_h_predictor_16x16_neon, vp9_d45_predictor_16x16_neon, NULL,
|
||||||
NULL, NULL, NULL, NULL, vpx_tm_predictor_16x16_neon)
|
NULL, NULL, NULL, NULL, vp9_tm_predictor_16x16_neon)
|
||||||
#endif // HAVE_NEON
|
#endif // HAVE_NEON
|
||||||
|
|
||||||
#if HAVE_MSA
|
#if HAVE_MSA
|
||||||
INTRA_PRED_TEST(MSA, TestIntraPred16, vpx_dc_predictor_16x16_msa,
|
INTRA_PRED_TEST(MSA, TestIntraPred16, vp9_dc_predictor_16x16_msa,
|
||||||
vpx_dc_left_predictor_16x16_msa, vpx_dc_top_predictor_16x16_msa,
|
vp9_dc_left_predictor_16x16_msa, vp9_dc_top_predictor_16x16_msa,
|
||||||
vpx_dc_128_predictor_16x16_msa, vpx_v_predictor_16x16_msa,
|
vp9_dc_128_predictor_16x16_msa, vp9_v_predictor_16x16_msa,
|
||||||
vpx_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL,
|
vp9_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, vpx_tm_predictor_16x16_msa)
|
NULL, vp9_tm_predictor_16x16_msa)
|
||||||
#endif // HAVE_MSA
|
#endif // HAVE_MSA
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// 32x32
|
// 32x32
|
||||||
|
|
||||||
INTRA_PRED_TEST(C, TestIntraPred32, vpx_dc_predictor_32x32_c,
|
INTRA_PRED_TEST(C, TestIntraPred32, vp9_dc_predictor_32x32_c,
|
||||||
vpx_dc_left_predictor_32x32_c, vpx_dc_top_predictor_32x32_c,
|
vp9_dc_left_predictor_32x32_c, vp9_dc_top_predictor_32x32_c,
|
||||||
vpx_dc_128_predictor_32x32_c, vpx_v_predictor_32x32_c,
|
vp9_dc_128_predictor_32x32_c, vp9_v_predictor_32x32_c,
|
||||||
vpx_h_predictor_32x32_c, vpx_d45_predictor_32x32_c,
|
vp9_h_predictor_32x32_c, vp9_d45_predictor_32x32_c,
|
||||||
vpx_d135_predictor_32x32_c, vpx_d117_predictor_32x32_c,
|
vp9_d135_predictor_32x32_c, vp9_d117_predictor_32x32_c,
|
||||||
vpx_d153_predictor_32x32_c, vpx_d207_predictor_32x32_c,
|
vp9_d153_predictor_32x32_c, vp9_d207_predictor_32x32_c,
|
||||||
vpx_d63_predictor_32x32_c, vpx_tm_predictor_32x32_c)
|
vp9_d63_predictor_32x32_c, vp9_tm_predictor_32x32_c)
|
||||||
|
|
||||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
#if HAVE_SSE2
|
||||||
INTRA_PRED_TEST(SSE2, TestIntraPred32, vpx_dc_predictor_32x32_sse2,
|
#if ARCH_X86_64
|
||||||
vpx_dc_left_predictor_32x32_sse2,
|
INTRA_PRED_TEST(SSE2, TestIntraPred32, vp9_dc_predictor_32x32_sse2,
|
||||||
vpx_dc_top_predictor_32x32_sse2,
|
vp9_dc_left_predictor_32x32_sse2,
|
||||||
vpx_dc_128_predictor_32x32_sse2, vpx_v_predictor_32x32_sse2,
|
vp9_dc_top_predictor_32x32_sse2,
|
||||||
vpx_h_predictor_32x32_sse2, NULL, NULL, NULL, NULL, NULL,
|
vp9_dc_128_predictor_32x32_sse2, vp9_v_predictor_32x32_sse2,
|
||||||
NULL, vpx_tm_predictor_32x32_sse2)
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
|
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,
|
INTRA_PRED_TEST(SSSE3, TestIntraPred32, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, vpx_d45_predictor_32x32_ssse3, NULL, NULL,
|
vp9_h_predictor_32x32_ssse3, vp9_d45_predictor_32x32_ssse3,
|
||||||
vpx_d153_predictor_32x32_ssse3, vpx_d207_predictor_32x32_ssse3,
|
NULL, NULL, vp9_d153_predictor_32x32_ssse3,
|
||||||
vpx_d63_predictor_32x32_ssse3, NULL)
|
vp9_d207_predictor_32x32_ssse3, vp9_d63_predictor_32x32_ssse3,
|
||||||
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
|
NULL)
|
||||||
|
#endif // HAVE_SSSE3
|
||||||
|
|
||||||
#if HAVE_NEON
|
#if HAVE_NEON
|
||||||
INTRA_PRED_TEST(NEON, TestIntraPred32, vpx_dc_predictor_32x32_neon,
|
INTRA_PRED_TEST(NEON, TestIntraPred32, vp9_dc_predictor_32x32_neon,
|
||||||
vpx_dc_left_predictor_32x32_neon,
|
vp9_dc_left_predictor_32x32_neon,
|
||||||
vpx_dc_top_predictor_32x32_neon,
|
vp9_dc_top_predictor_32x32_neon,
|
||||||
vpx_dc_128_predictor_32x32_neon, vpx_v_predictor_32x32_neon,
|
vp9_dc_128_predictor_32x32_neon, vp9_v_predictor_32x32_neon,
|
||||||
vpx_h_predictor_32x32_neon, NULL, NULL, NULL, NULL, NULL, NULL,
|
vp9_h_predictor_32x32_neon, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
vpx_tm_predictor_32x32_neon)
|
vp9_tm_predictor_32x32_neon)
|
||||||
#endif // HAVE_NEON
|
#endif // HAVE_NEON
|
||||||
|
|
||||||
#if HAVE_MSA
|
#if HAVE_MSA
|
||||||
INTRA_PRED_TEST(MSA, TestIntraPred32, vpx_dc_predictor_32x32_msa,
|
INTRA_PRED_TEST(MSA, TestIntraPred32, vp9_dc_predictor_32x32_msa,
|
||||||
vpx_dc_left_predictor_32x32_msa, vpx_dc_top_predictor_32x32_msa,
|
vp9_dc_left_predictor_32x32_msa, vp9_dc_top_predictor_32x32_msa,
|
||||||
vpx_dc_128_predictor_32x32_msa, vpx_v_predictor_32x32_msa,
|
vp9_dc_128_predictor_32x32_msa, vp9_v_predictor_32x32_msa,
|
||||||
vpx_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL,
|
vp9_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, vpx_tm_predictor_32x32_msa)
|
NULL, vp9_tm_predictor_32x32_msa)
|
||||||
#endif // HAVE_MSA
|
#endif // HAVE_MSA
|
||||||
|
|
||||||
#include "test/test_libvpx.cc"
|
#include "test/test_libvpx.cc"
|
||||||
|
@@ -8,9 +8,6 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "./vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#if ARCH_X86 || ARCH_X86_64
|
#if ARCH_X86 || ARCH_X86_64
|
||||||
#include "vpx_ports/x86.h"
|
#include "vpx_ports/x86.h"
|
||||||
@@ -25,8 +22,8 @@ extern void vp9_rtcd();
|
|||||||
extern void vpx_dsp_rtcd();
|
extern void vpx_dsp_rtcd();
|
||||||
extern void vpx_scale_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) {
|
static void append_negative_gtest_filter(const char *str) {
|
||||||
std::string filter = ::testing::FLAGS_gtest_filter;
|
std::string filter = ::testing::FLAGS_gtest_filter;
|
||||||
// Negative patterns begin with one '-' followed by a ':' separated list.
|
// 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;
|
filter += str;
|
||||||
::testing::FLAGS_gtest_filter = filter;
|
::testing::FLAGS_gtest_filter = filter;
|
||||||
}
|
}
|
||||||
#endif // ARCH_X86 || ARCH_X86_64
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
@@ -57,7 +53,7 @@ int main(int argc, char **argv) {
|
|||||||
append_negative_gtest_filter(":AVX.*:AVX/*");
|
append_negative_gtest_filter(":AVX.*:AVX/*");
|
||||||
if (!(simd_caps & HAS_AVX2))
|
if (!(simd_caps & HAS_AVX2))
|
||||||
append_negative_gtest_filter(":AVX2.*:AVX2/*");
|
append_negative_gtest_filter(":AVX2.*:AVX2/*");
|
||||||
#endif // ARCH_X86 || ARCH_X86_64
|
#endif
|
||||||
|
|
||||||
#if !CONFIG_SHARED
|
#if !CONFIG_SHARED
|
||||||
// Shared library builds don't support whitebox tests
|
// Shared library builds don't support whitebox tests
|
||||||
|
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <set>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "../tools_common.h"
|
#include "../tools_common.h"
|
||||||
@@ -45,12 +44,6 @@ class TestVectorTest : public ::libvpx_test::DecoderTest,
|
|||||||
TestVectorTest()
|
TestVectorTest()
|
||||||
: DecoderTest(GET_PARAM(0)),
|
: DecoderTest(GET_PARAM(0)),
|
||||||
md5_file_(NULL) {
|
md5_file_(NULL) {
|
||||||
#if CONFIG_VP9_DECODER
|
|
||||||
resize_clips_.insert(
|
|
||||||
::libvpx_test::kVP9TestVectorsResize,
|
|
||||||
::libvpx_test::kVP9TestVectorsResize +
|
|
||||||
::libvpx_test::kNumVP9TestVectorsResize);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~TestVectorTest() {
|
virtual ~TestVectorTest() {
|
||||||
@@ -84,10 +77,6 @@ class TestVectorTest : public ::libvpx_test::DecoderTest,
|
|||||||
<< "Md5 checksums don't match: frame number = " << frame_number;
|
<< "Md5 checksums don't match: frame number = " << frame_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_VP9_DECODER
|
|
||||||
std::set<std::string> resize_clips_;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FILE *md5_file_;
|
FILE *md5_file_;
|
||||||
};
|
};
|
||||||
@@ -108,14 +97,6 @@ TEST_P(TestVectorTest, MD5Match) {
|
|||||||
|
|
||||||
if (mode == kFrameParallelMode) {
|
if (mode == kFrameParallelMode) {
|
||||||
flags |= VPX_CODEC_USE_FRAME_THREADING;
|
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;
|
cfg.threads = threads;
|
||||||
@@ -163,7 +144,7 @@ VP8_INSTANTIATE_TEST_CASE(
|
|||||||
::testing::ValuesIn(libvpx_test::kVP8TestVectors,
|
::testing::ValuesIn(libvpx_test::kVP8TestVectors,
|
||||||
libvpx_test::kVP8TestVectors +
|
libvpx_test::kVP8TestVectors +
|
||||||
libvpx_test::kNumVP8TestVectors)));
|
libvpx_test::kNumVP8TestVectors)));
|
||||||
#endif // CONFIG_VP8_DECODER
|
#endif
|
||||||
|
|
||||||
// Test VP9 decode in serial mode with single thread.
|
// Test VP9 decode in serial mode with single thread.
|
||||||
#if CONFIG_VP9_DECODER
|
#if CONFIG_VP9_DECODER
|
||||||
|
@@ -52,31 +52,6 @@ const char *const kVP8TestVectors[] = {
|
|||||||
const int kNumVP8TestVectors = NELEMENTS(kVP8TestVectors);
|
const int kNumVP8TestVectors = NELEMENTS(kVP8TestVectors);
|
||||||
#endif // CONFIG_VP8_DECODER
|
#endif // CONFIG_VP8_DECODER
|
||||||
#if CONFIG_VP9_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[] = {
|
const char *const kVP9TestVectors[] = {
|
||||||
"vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
|
"vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
|
||||||
"vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.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-66x10.webm", "vp90-2-02-size-66x16.webm",
|
||||||
"vp90-2-02-size-66x18.webm", "vp90-2-02-size-66x32.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-66x34.webm", "vp90-2-02-size-66x64.webm",
|
||||||
"vp90-2-02-size-66x66.webm", "vp90-2-02-size-130x132.webm",
|
"vp90-2-02-size-66x66.webm", "vp90-2-03-size-196x196.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-03-size-196x198.webm", "vp90-2-03-size-196x200.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-196x202.webm", "vp90-2-03-size-196x208.webm",
|
||||||
"vp90-2-03-size-196x210.webm", "vp90-2-03-size-196x224.webm",
|
"vp90-2-03-size-196x210.webm", "vp90-2-03-size-196x224.webm",
|
||||||
@@ -210,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-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-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-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-15-segkey.webm", "vp90-2-15-segkey_adpq.webm",
|
||||||
"vp90-2-16-intra-only.webm", "vp90-2-17-show-existing-frame.webm",
|
"vp90-2-16-intra-only.webm", "vp90-2-17-show-existing-frame.webm",
|
||||||
"vp90-2-18-resize.ivf", "vp90-2-19-skip.webm",
|
"vp90-2-18-resize.ivf", "vp90-2-19-skip.webm",
|
||||||
@@ -235,16 +193,10 @@ const char *const kVP9TestVectors[] = {
|
|||||||
"vp93-2-20-10bit-yuv422.webm", "vp93-2-20-12bit-yuv422.webm",
|
"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-yuv440.webm", "vp93-2-20-12bit-yuv440.webm",
|
||||||
"vp93-2-20-10bit-yuv444.webm", "vp93-2-20-12bit-yuv444.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",
|
"vp90-2-20-big_superframe-01.webm", "vp90-2-20-big_superframe-02.webm",
|
||||||
RESIZE_TEST_VECTORS
|
|
||||||
};
|
};
|
||||||
const int kNumVP9TestVectors = NELEMENTS(kVP9TestVectors);
|
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
|
#endif // CONFIG_VP9_DECODER
|
||||||
|
|
||||||
} // namespace libvpx_test
|
} // namespace libvpx_test
|
||||||
|
@@ -23,8 +23,6 @@ extern const char *const kVP8TestVectors[];
|
|||||||
#if CONFIG_VP9_DECODER
|
#if CONFIG_VP9_DECODER
|
||||||
extern const int kNumVP9TestVectors;
|
extern const int kNumVP9TestVectors;
|
||||||
extern const char *const kVP9TestVectors[];
|
extern const char *const kVP9TestVectors[];
|
||||||
extern const int kNumVP9TestVectorsResize;
|
|
||||||
extern const char *const kVP9TestVectorsResize[];
|
|
||||||
#endif // CONFIG_VP9_DECODER
|
#endif // CONFIG_VP9_DECODER
|
||||||
|
|
||||||
} // namespace libvpx_test
|
} // namespace libvpx_test
|
||||||
|
@@ -104,5 +104,4 @@ TEST_P(TileIndependenceTest, MD5Match) {
|
|||||||
|
|
||||||
VP9_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1));
|
VP9_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1));
|
||||||
|
|
||||||
VP10_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1));
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -19,7 +19,8 @@
|
|||||||
// Macros
|
// Macros
|
||||||
#define GET_PARAM(k) std::tr1::get< k >(GetParam())
|
#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) &&
|
assert((img1->fmt == img2->fmt) &&
|
||||||
(img1->d_w == img2->d_w) &&
|
(img1->d_w == img2->d_w) &&
|
||||||
(img1->d_h == img2->d_h));
|
(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_
|
#define TEST_VIDEO_SOURCE_H_
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#undef NOMINMAX
|
|
||||||
#define NOMINMAX
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@@ -51,7 +48,7 @@ static std::string GetDataPath() {
|
|||||||
#undef TO_STRING
|
#undef TO_STRING
|
||||||
#undef STRINGIFY
|
#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;
|
const std::string path_to_source = GetDataPath() + "/" + file_name;
|
||||||
return fopen(path_to_source.c_str(), "rb");
|
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 <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "test/acm_random.h"
|
#include "test/acm_random.h"
|
||||||
#include "vp8/decoder/dboolhuff.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "vp8/encoder/boolhuff.h"
|
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
|
#include "vp8/encoder/boolhuff.h"
|
||||||
|
#include "vp8/decoder/dboolhuff.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const int num_tests = 10;
|
const int num_tests = 10;
|
||||||
|
|
||||||
|
@@ -15,10 +15,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "./vp8_rtcd.h"
|
#include "./vp8_rtcd.h"
|
||||||
|
|
||||||
#include "test/acm_random.h"
|
#include "test/acm_random.h"
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@@ -8,13 +8,12 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* 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/codec_factory.h"
|
||||||
#include "test/encode_test_driver.h"
|
#include "test/encode_test_driver.h"
|
||||||
#include "test/util.h"
|
|
||||||
#include "test/y4m_video_source.h"
|
#include "test/y4m_video_source.h"
|
||||||
#include "test/yuv_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"
|
#include "vp9/encoder/vp9_ratectrl.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -109,7 +108,7 @@ class ArfFreqTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void BeginPassHook(unsigned int) {
|
virtual void BeginPassHook(unsigned int) {
|
||||||
min_run_ = ARF_NOT_SEEN;
|
min_arf_ = ARF_NOT_SEEN;
|
||||||
run_of_visible_frames_ = 0;
|
run_of_visible_frames_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,15 +137,15 @@ class ArfFreqTest
|
|||||||
if (frames == 1) {
|
if (frames == 1) {
|
||||||
run_of_visible_frames_++;
|
run_of_visible_frames_++;
|
||||||
} else if (frames == 2) {
|
} else if (frames == 2) {
|
||||||
if (min_run_ == ARF_NOT_SEEN) {
|
if (min_arf_ == ARF_NOT_SEEN) {
|
||||||
min_run_ = ARF_SEEN_ONCE;
|
min_arf_ = ARF_SEEN_ONCE;
|
||||||
} else if (min_run_ == ARF_SEEN_ONCE ||
|
} else if (min_arf_ == ARF_SEEN_ONCE ||
|
||||||
run_of_visible_frames_ < min_run_) {
|
run_of_visible_frames_ < min_arf_) {
|
||||||
min_run_ = run_of_visible_frames_;
|
min_arf_ = run_of_visible_frames_;
|
||||||
}
|
}
|
||||||
run_of_visible_frames_ = 1;
|
run_of_visible_frames_ = 1;
|
||||||
} else {
|
} else {
|
||||||
min_run_ = 0;
|
min_arf_ = 0;
|
||||||
run_of_visible_frames_ = 1;
|
run_of_visible_frames_ = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,8 +166,8 @@ class ArfFreqTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetMinVisibleRun() const {
|
int GetMinArfDistance() const {
|
||||||
return min_run_;
|
return min_arf_;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetMinArfDistanceRequested() const {
|
int GetMinArfDistanceRequested() const {
|
||||||
@@ -186,7 +185,7 @@ class ArfFreqTest
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int min_arf_requested_;
|
int min_arf_requested_;
|
||||||
int min_run_;
|
int min_arf_;
|
||||||
int run_of_visible_frames_;
|
int run_of_visible_frames_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -215,10 +214,9 @@ TEST_P(ArfFreqTest, MinArfFreqTest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
||||||
const int min_run = GetMinVisibleRun();
|
const int min_arf_dist = GetMinArfDistance();
|
||||||
const int min_arf_dist_requested = GetMinArfDistanceRequested();
|
const int min_arf_dist_requested = GetMinArfDistanceRequested();
|
||||||
if (min_run != ARF_NOT_SEEN && min_run != ARF_SEEN_ONCE) {
|
if (min_arf_dist != ARF_NOT_SEEN && min_arf_dist != ARF_SEEN_ONCE) {
|
||||||
const int min_arf_dist = min_run + 1;
|
|
||||||
EXPECT_GE(min_arf_dist, min_arf_dist_requested);
|
EXPECT_GE(min_arf_dist, min_arf_dist_requested);
|
||||||
}
|
}
|
||||||
delete(video);
|
delete(video);
|
||||||
@@ -229,24 +227,4 @@ VP9_INSTANTIATE_TEST_CASE(
|
|||||||
::testing::ValuesIn(kTestVectors),
|
::testing::ValuesIn(kTestVectors),
|
||||||
::testing::ValuesIn(kEncodeVectors),
|
::testing::ValuesIn(kEncodeVectors),
|
||||||
::testing::ValuesIn(kMinArfVectors));
|
::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
|
} // namespace
|
||||||
|
@@ -8,20 +8,22 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "./vpx_config.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
using libvpx_test::ACMRandom;
|
using libvpx_test::ACMRandom;
|
||||||
|
|
||||||
@@ -192,48 +194,6 @@ class IntProColTest
|
|||||||
int16_t sum_c_;
|
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;
|
uint8_t* AverageTestBase::source_data_ = NULL;
|
||||||
|
|
||||||
@@ -286,126 +246,58 @@ TEST_P(IntProColTest, Random) {
|
|||||||
RunComparison();
|
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;
|
using std::tr1::make_tuple;
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
C, AverageTest,
|
C, AverageTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(16, 16, 1, 8, &vpx_avg_8x8_c),
|
make_tuple(16, 16, 1, 8, &vp9_avg_8x8_c),
|
||||||
make_tuple(16, 16, 1, 4, &vpx_avg_4x4_c)));
|
make_tuple(16, 16, 1, 4, &vp9_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)));
|
|
||||||
|
|
||||||
#if HAVE_SSE2
|
#if HAVE_SSE2
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, AverageTest,
|
SSE2, AverageTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(16, 16, 0, 8, &vpx_avg_8x8_sse2),
|
make_tuple(16, 16, 0, 8, &vp9_avg_8x8_sse2),
|
||||||
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_sse2),
|
make_tuple(16, 16, 5, 8, &vp9_avg_8x8_sse2),
|
||||||
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_sse2),
|
make_tuple(32, 32, 15, 8, &vp9_avg_8x8_sse2),
|
||||||
make_tuple(16, 16, 0, 4, &vpx_avg_4x4_sse2),
|
make_tuple(16, 16, 0, 4, &vp9_avg_4x4_sse2),
|
||||||
make_tuple(16, 16, 5, 4, &vpx_avg_4x4_sse2),
|
make_tuple(16, 16, 5, 4, &vp9_avg_4x4_sse2),
|
||||||
make_tuple(32, 32, 15, 4, &vpx_avg_4x4_sse2)));
|
make_tuple(32, 32, 15, 4, &vp9_avg_4x4_sse2)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, IntProRowTest, ::testing::Values(
|
SSE2, IntProRowTest, ::testing::Values(
|
||||||
make_tuple(16, &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, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
|
make_tuple(32, &vp9_int_pro_row_sse2, &vp9_int_pro_row_c),
|
||||||
make_tuple(64, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c)));
|
make_tuple(64, &vp9_int_pro_row_sse2, &vp9_int_pro_row_c)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, IntProColTest, ::testing::Values(
|
SSE2, IntProColTest, ::testing::Values(
|
||||||
make_tuple(16, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
|
make_tuple(16, &vp9_int_pro_col_sse2, &vp9_int_pro_col_c),
|
||||||
make_tuple(32, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
|
make_tuple(32, &vp9_int_pro_col_sse2, &vp9_int_pro_col_c),
|
||||||
make_tuple(64, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c)));
|
make_tuple(64, &vp9_int_pro_col_sse2, &vp9_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)));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_NEON
|
#if HAVE_NEON
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
NEON, AverageTest,
|
NEON, AverageTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(16, 16, 0, 8, &vpx_avg_8x8_neon),
|
make_tuple(16, 16, 0, 8, &vp9_avg_8x8_neon),
|
||||||
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_neon),
|
make_tuple(16, 16, 5, 8, &vp9_avg_8x8_neon),
|
||||||
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_neon),
|
make_tuple(32, 32, 15, 8, &vp9_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)));
|
|
||||||
|
|
||||||
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
|
#endif
|
||||||
|
|
||||||
#if HAVE_MSA
|
#if HAVE_MSA
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
MSA, AverageTest,
|
MSA, AverageTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(16, 16, 0, 8, &vpx_avg_8x8_msa),
|
make_tuple(16, 16, 0, 8, &vp9_avg_8x8_msa),
|
||||||
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_msa),
|
make_tuple(16, 16, 5, 8, &vp9_avg_8x8_msa),
|
||||||
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_msa),
|
make_tuple(32, 32, 15, 8, &vp9_avg_8x8_msa),
|
||||||
make_tuple(16, 16, 0, 4, &vpx_avg_4x4_msa),
|
make_tuple(16, 16, 0, 4, &vp9_avg_4x4_msa),
|
||||||
make_tuple(16, 16, 5, 4, &vpx_avg_4x4_msa),
|
make_tuple(16, 16, 5, 4, &vp9_avg_4x4_msa),
|
||||||
make_tuple(32, 32, 15, 4, &vpx_avg_4x4_msa)));
|
make_tuple(32, 32, 15, 4, &vp9_avg_4x4_msa)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
@@ -14,10 +14,11 @@
|
|||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#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 "test/acm_random.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
#include "vpx_dsp/bitreader.h"
|
|
||||||
#include "vpx_dsp/bitwriter.h"
|
|
||||||
|
|
||||||
using libvpx_test::ACMRandom;
|
using libvpx_test::ACMRandom;
|
||||||
|
|
||||||
@@ -49,9 +50,9 @@ TEST(VP9, TestBitIO) {
|
|||||||
const int random_seed = 6432;
|
const int random_seed = 6432;
|
||||||
const int kBufferSize = 10000;
|
const int kBufferSize = 10000;
|
||||||
ACMRandom bit_rnd(random_seed);
|
ACMRandom bit_rnd(random_seed);
|
||||||
vpx_writer bw;
|
vp9_writer bw;
|
||||||
uint8_t bw_buffer[kBufferSize];
|
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;
|
int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
|
||||||
for (int i = 0; i < kBitsToTest; ++i) {
|
for (int i = 0; i < kBitsToTest; ++i) {
|
||||||
@@ -60,16 +61,16 @@ TEST(VP9, TestBitIO) {
|
|||||||
} else if (bit_method == 3) {
|
} else if (bit_method == 3) {
|
||||||
bit = bit_rnd(2);
|
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
|
// First bit should be zero
|
||||||
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
|
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
|
||||||
|
|
||||||
vpx_reader br;
|
vp9_reader br;
|
||||||
vpx_reader_init(&br, bw_buffer, kBufferSize, NULL, NULL);
|
vp9_reader_init(&br, bw_buffer, kBufferSize, NULL, NULL);
|
||||||
bit_rnd.Reset(random_seed);
|
bit_rnd.Reset(random_seed);
|
||||||
for (int i = 0; i < kBitsToTest; ++i) {
|
for (int i = 0; i < kBitsToTest; ++i) {
|
||||||
if (bit_method == 2) {
|
if (bit_method == 2) {
|
||||||
@@ -77,7 +78,7 @@ TEST(VP9, TestBitIO) {
|
|||||||
} else if (bit_method == 3) {
|
} else if (bit_method == 3) {
|
||||||
bit = bit_rnd(2);
|
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
|
<< "pos: " << i << " / " << kBitsToTest
|
||||||
<< " bit_method: " << bit_method
|
<< " bit_method: " << bit_method
|
||||||
<< " method: " << method;
|
<< " method: " << method;
|
||||||
|
@@ -8,16 +8,43 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* 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/codec_factory.h"
|
||||||
#include "test/encode_test_driver.h"
|
#include "test/encode_test_driver.h"
|
||||||
#include "test/util.h"
|
|
||||||
#include "test/y4m_video_source.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 {
|
namespace {
|
||||||
|
|
||||||
|
const unsigned int kFramerate = 50;
|
||||||
const int kCpuUsed = 2;
|
const int kCpuUsed = 2;
|
||||||
|
|
||||||
struct EncodePerfTestVideo {
|
struct EncodePerfTestVideo {
|
||||||
@@ -38,29 +65,37 @@ struct EncodeParameters {
|
|||||||
int32_t lossless;
|
int32_t lossless;
|
||||||
int32_t error_resilient;
|
int32_t error_resilient;
|
||||||
int32_t frame_parallel;
|
int32_t frame_parallel;
|
||||||
vpx_color_range_t color_range;
|
|
||||||
vpx_color_space_t cs;
|
vpx_color_space_t cs;
|
||||||
int render_size[2];
|
|
||||||
// TODO(JBB): quantizers / bitrate
|
// TODO(JBB): quantizers / bitrate
|
||||||
};
|
};
|
||||||
|
|
||||||
const EncodeParameters kVP9EncodeParameterSet[] = {
|
const EncodeParameters kVP9EncodeParameterSet[] = {
|
||||||
{0, 0, 0, 1, 0, VPX_CR_STUDIO_RANGE, VPX_CS_BT_601},
|
{0, 0, 0, 1, 0, VPX_CS_BT_601},
|
||||||
{0, 0, 0, 0, 0, VPX_CR_FULL_RANGE, VPX_CS_BT_709},
|
{0, 0, 0, 0, 0, VPX_CS_BT_709},
|
||||||
{0, 0, 1, 0, 0, VPX_CR_FULL_RANGE, VPX_CS_BT_2020},
|
{0, 0, 1, 0, 0, VPX_CS_BT_2020},
|
||||||
{0, 2, 0, 0, 1, VPX_CR_STUDIO_RANGE, VPX_CS_UNKNOWN, { 640, 480 }},
|
{0, 2, 0, 0, 1, VPX_CS_UNKNOWN},
|
||||||
// TODO(JBB): Test profiles (requires more work).
|
// 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::EncoderTest,
|
||||||
public ::libvpx_test::CodecTestWith2Params<EncodeParameters,
|
public ::libvpx_test::CodecTestWith2Params<EncodeParameters, \
|
||||||
EncodePerfTestVideo> {
|
EncodePerfTestVideo> {
|
||||||
protected:
|
protected:
|
||||||
VpxEncoderParmsGetToDecoder()
|
Vp9EncoderParmsGetToDecoder()
|
||||||
: EncoderTest(GET_PARAM(0)), encode_parms(GET_PARAM(1)) {}
|
: EncoderTest(GET_PARAM(0)),
|
||||||
|
encode_parms(GET_PARAM(1)) {
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~VpxEncoderParmsGetToDecoder() {}
|
virtual ~Vp9EncoderParmsGetToDecoder() {}
|
||||||
|
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
InitializeConfig();
|
InitializeConfig();
|
||||||
@@ -76,7 +111,6 @@ class VpxEncoderParmsGetToDecoder
|
|||||||
::libvpx_test::Encoder *encoder) {
|
::libvpx_test::Encoder *encoder) {
|
||||||
if (video->frame() == 1) {
|
if (video->frame() == 1) {
|
||||||
encoder->Control(VP9E_SET_COLOR_SPACE, encode_parms.cs);
|
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_LOSSLESS, encode_parms.lossless);
|
||||||
encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING,
|
encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING,
|
||||||
encode_parms.frame_parallel);
|
encode_parms.frame_parallel);
|
||||||
@@ -87,44 +121,37 @@ class VpxEncoderParmsGetToDecoder
|
|||||||
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
|
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
|
||||||
encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
|
encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
|
||||||
encoder->Control(VP8E_SET_ARNR_TYPE, 3);
|
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,
|
virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
|
||||||
const libvpx_test::VideoSource &video,
|
const libvpx_test::VideoSource& video,
|
||||||
libvpx_test::Decoder *decoder) {
|
libvpx_test::Decoder *decoder) {
|
||||||
vpx_codec_ctx_t *const vp9_decoder = decoder->GetDecoder();
|
vpx_codec_ctx_t* vp9_decoder = decoder->GetDecoder();
|
||||||
vpx_codec_alg_priv_t *const priv =
|
vpx_codec_alg_priv_t* priv =
|
||||||
reinterpret_cast<vpx_codec_alg_priv_t *>(vp9_decoder->priv);
|
(vpx_codec_alg_priv_t*) get_alg_priv(vp9_decoder);
|
||||||
FrameWorkerData *const worker_data =
|
|
||||||
reinterpret_cast<FrameWorkerData *>(priv->frame_workers[0].data1);
|
VP9Decoder* pbi = priv->pbi;
|
||||||
VP9_COMMON *const common = &worker_data->pbi->common;
|
VP9_COMMON* common = &pbi->common;
|
||||||
|
|
||||||
if (encode_parms.lossless) {
|
if (encode_parms.lossless) {
|
||||||
EXPECT_EQ(0, common->base_qindex);
|
EXPECT_EQ(common->base_qindex, 0);
|
||||||
EXPECT_EQ(0, common->y_dc_delta_q);
|
EXPECT_EQ(common->y_dc_delta_q, 0);
|
||||||
EXPECT_EQ(0, common->uv_dc_delta_q);
|
EXPECT_EQ(common->uv_dc_delta_q, 0);
|
||||||
EXPECT_EQ(0, common->uv_ac_delta_q);
|
EXPECT_EQ(common->uv_ac_delta_q, 0);
|
||||||
EXPECT_EQ(ONLY_4X4, common->tx_mode);
|
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) {
|
if (encode_parms.error_resilient) {
|
||||||
EXPECT_EQ(1, common->frame_parallel_decoding_mode);
|
EXPECT_EQ(common->frame_parallel_decoding_mode, 1);
|
||||||
EXPECT_EQ(0, common->use_prev_frame_mvs);
|
EXPECT_EQ(common->use_prev_frame_mvs, 0);
|
||||||
} else {
|
} else {
|
||||||
EXPECT_EQ(encode_parms.frame_parallel,
|
EXPECT_EQ(common->frame_parallel_decoding_mode,
|
||||||
common->frame_parallel_decoding_mode);
|
encode_parms.frame_parallel);
|
||||||
}
|
}
|
||||||
EXPECT_EQ(encode_parms.color_range, common->color_range);
|
EXPECT_EQ(common->color_space, encode_parms.cs);
|
||||||
EXPECT_EQ(encode_parms.cs, common->color_space);
|
EXPECT_EQ(common->log2_tile_cols, encode_parms.tile_cols);
|
||||||
if (encode_parms.render_size[0] > 0 && encode_parms.render_size[1] > 0) {
|
EXPECT_EQ(common->log2_tile_rows, encode_parms.tile_rows);
|
||||||
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(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
|
EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
|
||||||
return VPX_CODEC_OK == res_dec;
|
return VPX_CODEC_OK == res_dec;
|
||||||
@@ -136,18 +163,31 @@ class VpxEncoderParmsGetToDecoder
|
|||||||
EncodeParameters encode_parms;
|
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;
|
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||||
|
|
||||||
libvpx_test::VideoSource *const video =
|
libvpx_test::VideoSource *video;
|
||||||
new libvpx_test::Y4mVideoSource(test_video_.name, 0, test_video_.frames);
|
if (is_extension_y4m(test_video_.name)) {
|
||||||
ASSERT_TRUE(video != NULL);
|
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));
|
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
||||||
delete video;
|
delete(video);
|
||||||
}
|
}
|
||||||
|
|
||||||
VP9_INSTANTIATE_TEST_CASE(VpxEncoderParmsGetToDecoder,
|
VP9_INSTANTIATE_TEST_CASE(
|
||||||
|
Vp9EncoderParmsGetToDecoder,
|
||||||
::testing::ValuesIn(kVP9EncodeParameterSet),
|
::testing::ValuesIn(kVP9EncodeParameterSet),
|
||||||
::testing::ValuesIn(kVP9EncodePerfTestVectors));
|
::testing::ValuesIn(kVP9EncodePerfTestVectors));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -8,13 +8,12 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* 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/codec_factory.h"
|
||||||
#include "test/encode_test_driver.h"
|
#include "test/encode_test_driver.h"
|
||||||
#include "test/util.h"
|
|
||||||
#include "test/y4m_video_source.h"
|
#include "test/y4m_video_source.h"
|
||||||
#include "test/yuv_video_source.h"
|
#include "test/yuv_video_source.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -187,23 +186,4 @@ VP9_INSTANTIATE_TEST_CASE(
|
|||||||
::testing::ValuesIn(kTestVectors),
|
::testing::ValuesIn(kTestVectors),
|
||||||
::testing::ValuesIn(kCpuUsedVectors));
|
::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
|
} // namespace
|
||||||
|
@@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
#include "./vpx_config.h"
|
|
||||||
#include "./vp9_rtcd.h"
|
|
||||||
#include "test/acm_random.h"
|
#include "test/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "vpx/vpx_codec.h"
|
#include "vpx/vpx_codec.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
@@ -67,22 +67,12 @@ TEST_P(ErrorBlockTest, OperationCheck) {
|
|||||||
int64_t ret;
|
int64_t ret;
|
||||||
int64_t ref_ssz;
|
int64_t ref_ssz;
|
||||||
int64_t ref_ret;
|
int64_t ref_ret;
|
||||||
const int msb = bit_depth_ + 8 - 1;
|
|
||||||
for (int i = 0; i < kNumIterations; ++i) {
|
for (int i = 0; i < kNumIterations; ++i) {
|
||||||
int err_count = 0;
|
int err_count = 0;
|
||||||
block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64
|
block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64
|
||||||
for (int j = 0; j < block_size; j++) {
|
for (int j = 0; j < block_size; j++) {
|
||||||
// coeff and dqcoeff will always have at least the same sign, and this
|
coeff[j] = rnd(2 << 20) - (1 << 20);
|
||||||
// can be used for optimization, so generate test input precisely.
|
dqcoeff[j] = rnd(2 << 20) - (1 << 20);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ref_ret = ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz,
|
ref_ret = ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz,
|
||||||
bit_depth_);
|
bit_depth_);
|
||||||
@@ -95,7 +85,7 @@ TEST_P(ErrorBlockTest, OperationCheck) {
|
|||||||
err_count_total += err_count;
|
err_count_total += err_count;
|
||||||
}
|
}
|
||||||
EXPECT_EQ(0, err_count_total)
|
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;
|
<< "First failed at test case " << first_failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,36 +100,23 @@ TEST_P(ErrorBlockTest, ExtremeValues) {
|
|||||||
int64_t ret;
|
int64_t ret;
|
||||||
int64_t ref_ssz;
|
int64_t ref_ssz;
|
||||||
int64_t ref_ret;
|
int64_t ref_ret;
|
||||||
const int msb = bit_depth_ + 8 - 1;
|
int max_val = ((1 << 20) - 1);
|
||||||
int max_val = ((1 << msb) - 1);
|
|
||||||
for (int i = 0; i < kNumIterations; ++i) {
|
for (int i = 0; i < kNumIterations; ++i) {
|
||||||
int err_count = 0;
|
int err_count = 0;
|
||||||
int k = (i / 9) % 9;
|
int k = (i / 9) % 5;
|
||||||
|
|
||||||
// Change the maximum coeff value, to test different bit boundaries
|
// 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;
|
max_val >>= 1;
|
||||||
}
|
}
|
||||||
block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64
|
block_size = 16 << (i % 9); // All block sizes from 4x4, 8x4 ..64x64
|
||||||
for (int j = 0; j < block_size; j++) {
|
for (int j = 0; j < block_size; j++) {
|
||||||
if (k < 4) {
|
if (k < 4) { // Test at maximum values
|
||||||
// Test at positive maximum values
|
coeff[j] = k % 2 ? max_val : -max_val;
|
||||||
coeff[j] = k % 2 ? max_val : 0;
|
dqcoeff[j] = (k >> 1) % 2 ? max_val : -max_val;
|
||||||
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;
|
|
||||||
} else {
|
} else {
|
||||||
if (rnd(2)) {
|
coeff[j] = rnd(2 << 14) - (1 << 14);
|
||||||
// Positive number
|
dqcoeff[j] = rnd(2 << 14) - (1 << 14);
|
||||||
coeff[j] = rnd(1 << 14);
|
|
||||||
dqcoeff[j] = rnd(1 << 14);
|
|
||||||
} else {
|
|
||||||
// Negative number
|
|
||||||
coeff[j] = -rnd(1 << 14);
|
|
||||||
dqcoeff[j] = -rnd(1 << 14);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ref_ret = ref_error_block_op_(coeff, dqcoeff, block_size, &ref_ssz,
|
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;
|
err_count_total += err_count;
|
||||||
}
|
}
|
||||||
EXPECT_EQ(0, err_count_total)
|
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;
|
<< "First failed at test case " << first_failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
using std::tr1::make_tuple;
|
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) {
|
|
||||||
assert(bps == 8);
|
|
||||||
return vp9_highbd_block_error_8bit_c(coeff, dqcoeff, block_size, ssz);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if HAVE_SSE2
|
#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) {
|
|
||||||
assert(bps == 8);
|
|
||||||
return vp9_highbd_block_error_8bit_sse2(coeff, dqcoeff, block_size, ssz);
|
|
||||||
}
|
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, ErrorBlockTest,
|
SSE2, ErrorBlockTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
@@ -185,27 +145,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
make_tuple(&vp9_highbd_block_error_sse2,
|
make_tuple(&vp9_highbd_block_error_sse2,
|
||||||
&vp9_highbd_block_error_c, VPX_BITS_12),
|
&vp9_highbd_block_error_c, VPX_BITS_12),
|
||||||
make_tuple(&vp9_highbd_block_error_sse2,
|
make_tuple(&vp9_highbd_block_error_sse2,
|
||||||
&vp9_highbd_block_error_c, VPX_BITS_8),
|
&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)));
|
|
||||||
#endif // HAVE_SSE2
|
#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) {
|
|
||||||
assert(bps == 8);
|
|
||||||
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
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -18,11 +18,11 @@
|
|||||||
#include "test/y4m_video_source.h"
|
#include "test/y4m_video_source.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class VPxEncoderThreadTest
|
class VP9EncoderThreadTest
|
||||||
: public ::libvpx_test::EncoderTest,
|
: public ::libvpx_test::EncoderTest,
|
||||||
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
|
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
|
||||||
protected:
|
protected:
|
||||||
VPxEncoderThreadTest()
|
VP9EncoderThreadTest()
|
||||||
: EncoderTest(GET_PARAM(0)),
|
: EncoderTest(GET_PARAM(0)),
|
||||||
encoder_initialized_(false),
|
encoder_initialized_(false),
|
||||||
tiles_(2),
|
tiles_(2),
|
||||||
@@ -36,7 +36,7 @@ class VPxEncoderThreadTest
|
|||||||
|
|
||||||
md5_.clear();
|
md5_.clear();
|
||||||
}
|
}
|
||||||
virtual ~VPxEncoderThreadTest() {
|
virtual ~VP9EncoderThreadTest() {
|
||||||
delete decoder_;
|
delete decoder_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ class VPxEncoderThreadTest
|
|||||||
std::vector<std::string> md5_;
|
std::vector<std::string> md5_;
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_P(VPxEncoderThreadTest, EncoderResultTest) {
|
TEST_P(VP9EncoderThreadTest, EncoderResultTest) {
|
||||||
std::vector<std::string> single_thr_md5, multi_thr_md5;
|
std::vector<std::string> single_thr_md5, multi_thr_md5;
|
||||||
|
|
||||||
::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 15, 20);
|
::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 15, 20);
|
||||||
@@ -130,13 +130,8 @@ TEST_P(VPxEncoderThreadTest, EncoderResultTest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VP9_INSTANTIATE_TEST_CASE(
|
VP9_INSTANTIATE_TEST_CASE(
|
||||||
VPxEncoderThreadTest,
|
VP9EncoderThreadTest,
|
||||||
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
|
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
|
||||||
::libvpx_test::kRealTime),
|
::libvpx_test::kRealTime),
|
||||||
::testing::Range(1, 9));
|
::testing::Range(1, 9));
|
||||||
|
|
||||||
VP10_INSTANTIATE_TEST_CASE(
|
|
||||||
VPxEncoderThreadTest,
|
|
||||||
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood),
|
|
||||||
::testing::Range(1, 3));
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -10,17 +10,17 @@
|
|||||||
|
|
||||||
#include <string>
|
#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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.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_blockd.h"
|
||||||
#include "vp9/common/vp9_pred_common.h"
|
#include "vp9/common/vp9_pred_common.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -131,101 +131,168 @@ using std::tr1::make_tuple;
|
|||||||
|
|
||||||
#if HAVE_SSE2
|
#if HAVE_SSE2
|
||||||
#if CONFIG_VP9_HIGHBITDEPTH
|
#if CONFIG_VP9_HIGHBITDEPTH
|
||||||
#if CONFIG_USE_X86INC
|
#if ARCH_X86_64
|
||||||
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_8, VP9IntraPredTest,
|
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_8, VP9IntraPredTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_dc_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_32x32_sse2,
|
||||||
&vpx_highbd_dc_predictor_32x32_c, 32, 8),
|
&vp9_highbd_dc_predictor_32x32_c, 32, 8),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_16x16_sse2,
|
||||||
&vpx_highbd_tm_predictor_16x16_c, 16, 8),
|
&vp9_highbd_tm_predictor_16x16_c, 16, 8),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_32x32_sse2,
|
||||||
&vpx_highbd_tm_predictor_32x32_c, 32, 8),
|
&vp9_highbd_tm_predictor_32x32_c, 32, 8),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||||
&vpx_highbd_dc_predictor_4x4_c, 4, 8),
|
&vp9_highbd_dc_predictor_4x4_c, 4, 8),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||||
&vpx_highbd_dc_predictor_8x8_c, 8, 8),
|
&vp9_highbd_dc_predictor_8x8_c, 8, 8),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||||
&vpx_highbd_dc_predictor_16x16_c, 16, 8),
|
&vp9_highbd_dc_predictor_16x16_c, 16, 8),
|
||||||
make_tuple(&vpx_highbd_v_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||||
&vpx_highbd_v_predictor_4x4_c, 4, 8),
|
&vp9_highbd_v_predictor_4x4_c, 4, 8),
|
||||||
make_tuple(&vpx_highbd_v_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||||
&vpx_highbd_v_predictor_8x8_c, 8, 8),
|
&vp9_highbd_v_predictor_8x8_c, 8, 8),
|
||||||
make_tuple(&vpx_highbd_v_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||||
&vpx_highbd_v_predictor_16x16_c, 16, 8),
|
&vp9_highbd_v_predictor_16x16_c, 16, 8),
|
||||||
make_tuple(&vpx_highbd_v_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||||
&vpx_highbd_v_predictor_32x32_c, 32, 8),
|
&vp9_highbd_v_predictor_32x32_c, 32, 8),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||||
&vpx_highbd_tm_predictor_4x4_c, 4, 8),
|
&vp9_highbd_tm_predictor_4x4_c, 4, 8),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||||
&vpx_highbd_tm_predictor_8x8_c, 8, 8)));
|
&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,
|
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_10, VP9IntraPredTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_dc_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_32x32_sse2,
|
||||||
&vpx_highbd_dc_predictor_32x32_c, 32,
|
&vp9_highbd_dc_predictor_32x32_c, 32,
|
||||||
10),
|
10),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_16x16_sse2,
|
||||||
&vpx_highbd_tm_predictor_16x16_c, 16,
|
&vp9_highbd_tm_predictor_16x16_c, 16,
|
||||||
10),
|
10),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_32x32_sse2,
|
||||||
&vpx_highbd_tm_predictor_32x32_c, 32,
|
&vp9_highbd_tm_predictor_32x32_c, 32,
|
||||||
10),
|
10),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||||
&vpx_highbd_dc_predictor_4x4_c, 4, 10),
|
&vp9_highbd_dc_predictor_4x4_c, 4, 10),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||||
&vpx_highbd_dc_predictor_8x8_c, 8, 10),
|
&vp9_highbd_dc_predictor_8x8_c, 8, 10),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||||
&vpx_highbd_dc_predictor_16x16_c, 16,
|
&vp9_highbd_dc_predictor_16x16_c, 16,
|
||||||
10),
|
10),
|
||||||
make_tuple(&vpx_highbd_v_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||||
&vpx_highbd_v_predictor_4x4_c, 4, 10),
|
&vp9_highbd_v_predictor_4x4_c, 4, 10),
|
||||||
make_tuple(&vpx_highbd_v_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||||
&vpx_highbd_v_predictor_8x8_c, 8, 10),
|
&vp9_highbd_v_predictor_8x8_c, 8, 10),
|
||||||
make_tuple(&vpx_highbd_v_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||||
&vpx_highbd_v_predictor_16x16_c, 16,
|
&vp9_highbd_v_predictor_16x16_c, 16,
|
||||||
10),
|
10),
|
||||||
make_tuple(&vpx_highbd_v_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||||
&vpx_highbd_v_predictor_32x32_c, 32,
|
&vp9_highbd_v_predictor_32x32_c, 32,
|
||||||
10),
|
10),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||||
&vpx_highbd_tm_predictor_4x4_c, 4, 10),
|
&vp9_highbd_tm_predictor_4x4_c, 4, 10),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||||
&vpx_highbd_tm_predictor_8x8_c, 8, 10)));
|
&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,
|
INSTANTIATE_TEST_CASE_P(SSE2_TO_C_12, VP9IntraPredTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_dc_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_32x32_sse2,
|
||||||
&vpx_highbd_dc_predictor_32x32_c, 32,
|
&vp9_highbd_dc_predictor_32x32_c, 32,
|
||||||
12),
|
12),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_16x16_sse2,
|
||||||
&vpx_highbd_tm_predictor_16x16_c, 16,
|
&vp9_highbd_tm_predictor_16x16_c, 16,
|
||||||
12),
|
12),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_32x32_sse2,
|
||||||
&vpx_highbd_tm_predictor_32x32_c, 32,
|
&vp9_highbd_tm_predictor_32x32_c, 32,
|
||||||
12),
|
12),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_4x4_sse,
|
||||||
&vpx_highbd_dc_predictor_4x4_c, 4, 12),
|
&vp9_highbd_dc_predictor_4x4_c, 4, 12),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_8x8_sse2,
|
||||||
&vpx_highbd_dc_predictor_8x8_c, 8, 12),
|
&vp9_highbd_dc_predictor_8x8_c, 8, 12),
|
||||||
make_tuple(&vpx_highbd_dc_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_dc_predictor_16x16_sse2,
|
||||||
&vpx_highbd_dc_predictor_16x16_c, 16,
|
&vp9_highbd_dc_predictor_16x16_c, 16,
|
||||||
12),
|
12),
|
||||||
make_tuple(&vpx_highbd_v_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_v_predictor_4x4_sse,
|
||||||
&vpx_highbd_v_predictor_4x4_c, 4, 12),
|
&vp9_highbd_v_predictor_4x4_c, 4, 12),
|
||||||
make_tuple(&vpx_highbd_v_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_v_predictor_8x8_sse2,
|
||||||
&vpx_highbd_v_predictor_8x8_c, 8, 12),
|
&vp9_highbd_v_predictor_8x8_c, 8, 12),
|
||||||
make_tuple(&vpx_highbd_v_predictor_16x16_sse2,
|
make_tuple(&vp9_highbd_v_predictor_16x16_sse2,
|
||||||
&vpx_highbd_v_predictor_16x16_c, 16,
|
&vp9_highbd_v_predictor_16x16_c, 16,
|
||||||
12),
|
12),
|
||||||
make_tuple(&vpx_highbd_v_predictor_32x32_sse2,
|
make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
|
||||||
&vpx_highbd_v_predictor_32x32_c, 32,
|
&vp9_highbd_v_predictor_32x32_c, 32,
|
||||||
12),
|
12),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_4x4_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_4x4_sse,
|
||||||
&vpx_highbd_tm_predictor_4x4_c, 4, 12),
|
&vp9_highbd_tm_predictor_4x4_c, 4, 12),
|
||||||
make_tuple(&vpx_highbd_tm_predictor_8x8_sse2,
|
make_tuple(&vp9_highbd_tm_predictor_8x8_sse2,
|
||||||
&vpx_highbd_tm_predictor_8x8_c, 8, 12)));
|
&vp9_highbd_tm_predictor_8x8_c, 8, 12)));
|
||||||
|
#else
|
||||||
#endif // CONFIG_USE_X86INC
|
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 // CONFIG_VP9_HIGHBITDEPTH
|
||||||
#endif // HAVE_SSE2
|
#endif // HAVE_SSE2
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -7,10 +7,8 @@
|
|||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* 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_config.h"
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "test/codec_factory.h"
|
#include "test/codec_factory.h"
|
||||||
#include "test/encode_test_driver.h"
|
#include "test/encode_test_driver.h"
|
||||||
#include "test/i420_video_source.h"
|
#include "test/i420_video_source.h"
|
||||||
@@ -127,8 +125,4 @@ VP9_INSTANTIATE_TEST_CASE(LosslessTest,
|
|||||||
::testing::Values(::libvpx_test::kRealTime,
|
::testing::Values(::libvpx_test::kRealTime,
|
||||||
::libvpx_test::kOnePassGood,
|
::libvpx_test::kOnePassGood,
|
||||||
::libvpx_test::kTwoPassGood));
|
::libvpx_test::kTwoPassGood));
|
||||||
|
|
||||||
VP10_INSTANTIATE_TEST_CASE(LosslessTest,
|
|
||||||
::testing::Values(::libvpx_test::kOnePassGood,
|
|
||||||
::libvpx_test::kTwoPassGood));
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "vp9/common/vp9_scan.h"
|
#include "vp9/common/vp9_scan.h"
|
||||||
#include "vpx/vpx_codec.h"
|
#include "vpx/vpx_codec.h"
|
||||||
@@ -331,21 +331,21 @@ using std::tr1::make_tuple;
|
|||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, VP9QuantizeTest,
|
SSE2, VP9QuantizeTest,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_quantize_b_sse2,
|
make_tuple(&vp9_highbd_quantize_b_sse2,
|
||||||
&vpx_highbd_quantize_b_c, VPX_BITS_8),
|
&vp9_highbd_quantize_b_c, VPX_BITS_8),
|
||||||
make_tuple(&vpx_highbd_quantize_b_sse2,
|
make_tuple(&vp9_highbd_quantize_b_sse2,
|
||||||
&vpx_highbd_quantize_b_c, VPX_BITS_10),
|
&vp9_highbd_quantize_b_c, VPX_BITS_10),
|
||||||
make_tuple(&vpx_highbd_quantize_b_sse2,
|
make_tuple(&vp9_highbd_quantize_b_sse2,
|
||||||
&vpx_highbd_quantize_b_c, VPX_BITS_12)));
|
&vp9_highbd_quantize_b_c, VPX_BITS_12)));
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
SSE2, VP9Quantize32Test,
|
SSE2, VP9Quantize32Test,
|
||||||
::testing::Values(
|
::testing::Values(
|
||||||
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
make_tuple(&vp9_highbd_quantize_b_32x32_sse2,
|
||||||
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_8),
|
&vp9_highbd_quantize_b_32x32_c, VPX_BITS_8),
|
||||||
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
make_tuple(&vp9_highbd_quantize_b_32x32_sse2,
|
||||||
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_10),
|
&vp9_highbd_quantize_b_32x32_c, VPX_BITS_10),
|
||||||
make_tuple(&vpx_highbd_quantize_b_32x32_sse2,
|
make_tuple(&vp9_highbd_quantize_b_32x32_sse2,
|
||||||
&vpx_highbd_quantize_b_32x32_c, VPX_BITS_12)));
|
&vp9_highbd_quantize_b_32x32_c, VPX_BITS_12)));
|
||||||
#endif // HAVE_SSE2
|
#endif // HAVE_SSE2
|
||||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -54,7 +54,7 @@ vp9_spatial_svc() {
|
|||||||
if [ "$(vp9_encode_available)" = "yes" ]; then
|
if [ "$(vp9_encode_available)" = "yes" ]; then
|
||||||
local readonly test_name="vp9_spatial_svc"
|
local readonly test_name="vp9_spatial_svc"
|
||||||
for layers in $(seq 1 ${vp9_ssvc_test_layers}); do
|
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
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@@ -9,13 +9,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.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/acm_random.h"
|
||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
#include "vp9/common/vp9_blockd.h"
|
#include "vp9/common/vp9_blockd.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
|
|
||||||
@@ -91,19 +89,15 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(C, VP9SubtractBlockTest,
|
INSTANTIATE_TEST_CASE_P(C, VP9SubtractBlockTest,
|
||||||
::testing::Values(vpx_subtract_block_c));
|
::testing::Values(vp9_subtract_block_c));
|
||||||
|
|
||||||
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
#if HAVE_SSE2 && CONFIG_USE_X86INC
|
||||||
INSTANTIATE_TEST_CASE_P(SSE2, VP9SubtractBlockTest,
|
INSTANTIATE_TEST_CASE_P(SSE2, VP9SubtractBlockTest,
|
||||||
::testing::Values(vpx_subtract_block_sse2));
|
::testing::Values(vp9_subtract_block_sse2));
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_NEON
|
#if HAVE_NEON
|
||||||
INSTANTIATE_TEST_CASE_P(NEON, VP9SubtractBlockTest,
|
INSTANTIATE_TEST_CASE_P(NEON, VP9SubtractBlockTest,
|
||||||
::testing::Values(vpx_subtract_block_neon));
|
::testing::Values(vp9_subtract_block_neon));
|
||||||
#endif
|
|
||||||
#if HAVE_MSA
|
|
||||||
INSTANTIATE_TEST_CASE_P(MSA, VP9SubtractBlockTest,
|
|
||||||
::testing::Values(vpx_subtract_block_msa));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace vp9
|
} // namespace vp9
|
||||||
|
@@ -18,33 +18,33 @@
|
|||||||
#if CONFIG_WEBM_IO
|
#if CONFIG_WEBM_IO
|
||||||
#include "test/webm_video_source.h"
|
#include "test/webm_video_source.h"
|
||||||
#endif
|
#endif
|
||||||
#include "vpx_util/vpx_thread.h"
|
#include "vp9/common/vp9_thread.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
class VPxWorkerThreadTest : public ::testing::TestWithParam<bool> {
|
class VP9WorkerThreadTest : public ::testing::TestWithParam<bool> {
|
||||||
protected:
|
protected:
|
||||||
virtual ~VPxWorkerThreadTest() {}
|
virtual ~VP9WorkerThreadTest() {}
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
vpx_get_worker_interface()->init(&worker_);
|
vp9_get_worker_interface()->init(&worker_);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void TearDown() {
|
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();
|
const bool synchronous = GetParam();
|
||||||
if (synchronous) {
|
if (synchronous) {
|
||||||
vpx_get_worker_interface()->execute(worker);
|
vp9_get_worker_interface()->execute(worker);
|
||||||
} else {
|
} else {
|
||||||
vpx_get_worker_interface()->launch(worker);
|
vp9_get_worker_interface()->launch(worker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VPxWorker worker_;
|
VP9Worker worker_;
|
||||||
};
|
};
|
||||||
|
|
||||||
int ThreadHook(void* data, void* return_value) {
|
int ThreadHook(void* data, void* return_value) {
|
||||||
@@ -53,12 +53,12 @@ int ThreadHook(void* data, void* return_value) {
|
|||||||
return *reinterpret_cast<int*>(return_value);
|
return *reinterpret_cast<int*>(return_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(VPxWorkerThreadTest, HookSuccess) {
|
TEST_P(VP9WorkerThreadTest, HookSuccess) {
|
||||||
// should be a no-op.
|
// 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) {
|
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 hook_data = 0;
|
||||||
int return_value = 1; // return successfully from the hook
|
int return_value = 1; // return successfully from the hook
|
||||||
@@ -67,17 +67,17 @@ TEST_P(VPxWorkerThreadTest, HookSuccess) {
|
|||||||
worker_.data2 = &return_value;
|
worker_.data2 = &return_value;
|
||||||
|
|
||||||
Run(&worker_);
|
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_FALSE(worker_.had_error);
|
||||||
EXPECT_EQ(5, hook_data);
|
EXPECT_EQ(5, hook_data);
|
||||||
|
|
||||||
// should be a no-op.
|
// 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) {
|
TEST_P(VP9WorkerThreadTest, HookFailure) {
|
||||||
EXPECT_NE(vpx_get_worker_interface()->reset(&worker_), 0);
|
EXPECT_NE(vp9_get_worker_interface()->reset(&worker_), 0);
|
||||||
|
|
||||||
int hook_data = 0;
|
int hook_data = 0;
|
||||||
int return_value = 0; // return failure from the hook
|
int return_value = 0; // return failure from the hook
|
||||||
@@ -86,29 +86,29 @@ TEST_P(VPxWorkerThreadTest, HookFailure) {
|
|||||||
worker_.data2 = &return_value;
|
worker_.data2 = &return_value;
|
||||||
|
|
||||||
Run(&worker_);
|
Run(&worker_);
|
||||||
EXPECT_FALSE(vpx_get_worker_interface()->sync(&worker_));
|
EXPECT_FALSE(vp9_get_worker_interface()->sync(&worker_));
|
||||||
EXPECT_EQ(1, worker_.had_error);
|
EXPECT_EQ(1, worker_.had_error);
|
||||||
|
|
||||||
// Ensure _reset() clears the error and _launch() can be called again.
|
// Ensure _reset() clears the error and _launch() can be called again.
|
||||||
return_value = 1;
|
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);
|
EXPECT_FALSE(worker_.had_error);
|
||||||
vpx_get_worker_interface()->launch(&worker_);
|
vp9_get_worker_interface()->launch(&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_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
|
// 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
|
// race. Doing more work in the hook is no guarantee as any race would occur
|
||||||
// post hook execution in the main thread loop driver.
|
// post hook execution in the main thread loop driver.
|
||||||
static const int kNumWorkers = 64;
|
static const int kNumWorkers = 64;
|
||||||
VPxWorker workers[kNumWorkers];
|
VP9Worker workers[kNumWorkers];
|
||||||
int hook_data[kNumWorkers];
|
int hook_data[kNumWorkers];
|
||||||
int return_value[kNumWorkers];
|
int return_value[kNumWorkers];
|
||||||
|
|
||||||
for (int n = 0; n < kNumWorkers; ++n) {
|
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
|
return_value[n] = 1; // return successfully from the hook
|
||||||
workers[n].hook = ThreadHook;
|
workers[n].hook = ThreadHook;
|
||||||
workers[n].data1 = &hook_data[n];
|
workers[n].data1 = &hook_data[n];
|
||||||
@@ -117,7 +117,7 @@ TEST_P(VPxWorkerThreadTest, EndWithoutSync) {
|
|||||||
|
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
for (int n = 0; n < kNumWorkers; ++n) {
|
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;
|
hook_data[n] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,16 +126,16 @@ TEST_P(VPxWorkerThreadTest, EndWithoutSync) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int n = kNumWorkers - 1; n >= 0; --n) {
|
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) {
|
TEST(VP9WorkerThreadTest, TestInterfaceAPI) {
|
||||||
EXPECT_EQ(0, vpx_set_worker_interface(NULL));
|
EXPECT_EQ(0, vp9_set_worker_interface(NULL));
|
||||||
EXPECT_TRUE(vpx_get_worker_interface() != NULL);
|
EXPECT_TRUE(vp9_get_worker_interface() != NULL);
|
||||||
for (int i = 0; i < 6; ++i) {
|
for (int i = 0; i < 6; ++i) {
|
||||||
VPxWorkerInterface winterface = *vpx_get_worker_interface();
|
VP9WorkerInterface winterface = *vp9_get_worker_interface();
|
||||||
switch (i) {
|
switch (i) {
|
||||||
default:
|
default:
|
||||||
case 0: winterface.init = NULL; break;
|
case 0: winterface.init = NULL; break;
|
||||||
@@ -145,7 +145,7 @@ TEST(VPxWorkerThreadTest, TestInterfaceAPI) {
|
|||||||
case 4: winterface.execute = NULL; break;
|
case 4: winterface.execute = NULL; break;
|
||||||
case 5: winterface.end = 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[]) {
|
void DecodeFiles(const FileList files[]) {
|
||||||
for (const FileList *iter = files; iter->name != NULL; ++iter) {
|
for (const FileList *iter = files; iter->name != NULL; ++iter) {
|
||||||
SCOPED_TRACE(iter->name);
|
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))
|
EXPECT_EQ(iter->expected_md5, DecodeFile(iter->name, t))
|
||||||
<< "threads = " << t;
|
<< "threads = " << t;
|
||||||
}
|
}
|
||||||
@@ -202,21 +202,21 @@ void DecodeFiles(const FileList files[]) {
|
|||||||
// hang.
|
// hang.
|
||||||
namespace impl {
|
namespace impl {
|
||||||
|
|
||||||
void Init(VPxWorker *const worker) { memset(worker, 0, sizeof(*worker)); }
|
void Init(VP9Worker *const worker) { memset(worker, 0, sizeof(*worker)); }
|
||||||
int Reset(VPxWorker *const /*worker*/) { return 1; }
|
int Reset(VP9Worker *const /*worker*/) { return 1; }
|
||||||
int Sync(VPxWorker *const worker) { return !worker->had_error; }
|
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);
|
worker->had_error |= !worker->hook(worker->data1, worker->data2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launch(VPxWorker *const worker) { Execute(worker); }
|
void Launch(VP9Worker *const worker) { Execute(worker); }
|
||||||
void End(VPxWorker *const /*worker*/) {}
|
void End(VP9Worker *const /*worker*/) {}
|
||||||
|
|
||||||
} // namespace impl
|
} // namespace impl
|
||||||
|
|
||||||
TEST(VPxWorkerThreadTest, TestSerialInterface) {
|
TEST(VP9WorkerThreadTest, TestSerialInterface) {
|
||||||
static const VPxWorkerInterface serial_interface = {
|
static const VP9WorkerInterface serial_interface = {
|
||||||
impl::Init, impl::Reset, impl::Sync, impl::Launch, impl::Execute, impl::End
|
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
|
// 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.
|
// progress in the row above before proceeding.
|
||||||
static const char expected_md5[] = "b35a1b707b28e82be025d960aba039bc";
|
static const char expected_md5[] = "b35a1b707b28e82be025d960aba039bc";
|
||||||
static const char filename[] = "vp90-2-03-size-226x226.webm";
|
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));
|
EXPECT_EQ(expected_md5, DecodeFile(filename, 2));
|
||||||
|
|
||||||
// Reset the interface.
|
// 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));
|
EXPECT_EQ(expected_md5, DecodeFile(filename, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(VP9DecodeMultiThreadedTest, NoTilesNonFrameParallel) {
|
TEST(VP9DecodeMultiThreadedTest, Decode) {
|
||||||
// no tiles or frame parallel; this exercises loop filter threading.
|
// no tiles or frame parallel; this exercises loop filter threading.
|
||||||
EXPECT_EQ("b35a1b707b28e82be025d960aba039bc",
|
EXPECT_EQ("b35a1b707b28e82be025d960aba039bc",
|
||||||
DecodeFile("vp90-2-03-size-226x226.webm", 2));
|
DecodeFile("vp90-2-03-size-226x226.webm", 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(VP9DecodeMultiThreadedTest, FrameParallel) {
|
TEST(VP9DecodeMultiThreadedTest, Decode2) {
|
||||||
static const FileList files[] = {
|
static const FileList files[] = {
|
||||||
{ "vp90-2-08-tile_1x2_frame_parallel.webm",
|
{ "vp90-2-08-tile_1x2_frame_parallel.webm",
|
||||||
"68ede6abd66bae0a2edf2eb9232241b6" },
|
"68ede6abd66bae0a2edf2eb9232241b6" },
|
||||||
@@ -255,7 +255,8 @@ TEST(VP9DecodeMultiThreadedTest, FrameParallel) {
|
|||||||
DecodeFiles(files);
|
DecodeFiles(files);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(VP9DecodeMultiThreadedTest, FrameParallelResize) {
|
// Test tile quantity changes within one file.
|
||||||
|
TEST(VP9DecodeMultiThreadedTest, Decode3) {
|
||||||
static const FileList files[] = {
|
static const FileList files[] = {
|
||||||
{ "vp90-2-14-resize-fp-tiles-1-16.webm",
|
{ "vp90-2-14-resize-fp-tiles-1-16.webm",
|
||||||
"0cd5e632c326297e975f38949c31ea94" },
|
"0cd5e632c326297e975f38949c31ea94" },
|
||||||
@@ -306,21 +307,8 @@ TEST(VP9DecodeMultiThreadedTest, FrameParallelResize) {
|
|||||||
|
|
||||||
DecodeFiles(files);
|
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
|
#endif // CONFIG_WEBM_IO
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Synchronous, VPxWorkerThreadTest, ::testing::Bool());
|
INSTANTIATE_TEST_CASE_P(Synchronous, VP9WorkerThreadTest, ::testing::Bool());
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -10,10 +10,11 @@
|
|||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#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/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
|
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
#include "./vpx_scale_rtcd.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
#include "vpx_scale/yv12config.h"
|
#include "vpx_scale/yv12config.h"
|
||||||
|
|
||||||
|
@@ -9,14 +9,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#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/md5_helper.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
#include "test/y4m_video_source.h"
|
#include "test/y4m_video_source.h"
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
#include "./y4menc.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef TEST_Y4M_VIDEO_SOURCE_H_
|
#ifndef TEST_Y4M_VIDEO_SOURCE_H_
|
||||||
#define TEST_Y4M_VIDEO_SOURCE_H_
|
#define TEST_Y4M_VIDEO_SOURCE_H_
|
||||||
#include <algorithm>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "test/video_source.h"
|
#include "test/video_source.h"
|
||||||
@@ -92,18 +91,6 @@ class Y4mVideoSource : public VideoSource {
|
|||||||
y4m_input_fetch_frame(&y4m_, input_file_, img_.get());
|
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:
|
protected:
|
||||||
void CloseSource() {
|
void CloseSource() {
|
||||||
y4m_input_close(&y4m_);
|
y4m_input_close(&y4m_);
|
||||||
|
13
third_party/libwebm/Android.mk
vendored
13
third_party/libwebm/Android.mk
vendored
@@ -1,10 +1,11 @@
|
|||||||
LOCAL_PATH:= $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE:= libwebm
|
|
||||||
LOCAL_SRC_FILES:= mkvparser.cpp \
|
LOCAL_CPP_EXTENSION := .cpp
|
||||||
mkvreader.cpp \
|
LOCAL_SRC_FILES := mkvmuxer.cpp \
|
||||||
mkvmuxer.cpp \
|
|
||||||
mkvmuxerutil.cpp \
|
mkvmuxerutil.cpp \
|
||||||
|
mkvparser.cpp \
|
||||||
|
mkvreader.cpp \
|
||||||
mkvwriter.cpp
|
mkvwriter.cpp
|
||||||
|
LOCAL_MODULE := libwebm
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
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
|
enforcement activity against any entity (including a cross-claim or
|
||||||
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
||||||
or any code incorporated within 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
|
patent infringement, then any patent rights granted to you under this License
|
||||||
for these implementations of WebM shall terminate as of the date such
|
for these implementations of WebM shall terminate as of the date such
|
||||||
litigation is filed.
|
litigation is filed.
|
||||||
|
5
third_party/libwebm/README.libvpx
vendored
5
third_party/libwebm/README.libvpx
vendored
@@ -1,10 +1,7 @@
|
|||||||
URL: https://chromium.googlesource.com/webm/libwebm
|
URL: https://chromium.googlesource.com/webm/libwebm
|
||||||
Version: 476366249e1fda7710a389cd41c57db42305e0d4
|
Version: 249629d46c6e9391f25a90cff6d19075f47474cb
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE.txt
|
License File: LICENSE.txt
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
libwebm is used to handle WebM container I/O.
|
libwebm is used to handle WebM container I/O.
|
||||||
|
|
||||||
Local Changes:
|
|
||||||
* <none>
|
|
||||||
|
948
third_party/libwebm/mkvmuxer.cpp
vendored
948
third_party/libwebm/mkvmuxer.cpp
vendored
File diff suppressed because it is too large
Load Diff
300
third_party/libwebm/mkvmuxer.hpp
vendored
300
third_party/libwebm/mkvmuxer.hpp
vendored
@@ -23,8 +23,6 @@ namespace mkvmuxer {
|
|||||||
class MkvWriter;
|
class MkvWriter;
|
||||||
class Segment;
|
class Segment;
|
||||||
|
|
||||||
const uint64 kMaxTrackNumber = 126;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
// Interface used by the mkvmuxer to write out the Mkv data.
|
// Interface used by the mkvmuxer to write out the Mkv data.
|
||||||
class IMkvWriter {
|
class IMkvWriter {
|
||||||
@@ -59,10 +57,6 @@ class IMkvWriter {
|
|||||||
|
|
||||||
// Writes out the EBML header for a WebM file. This function must be called
|
// Writes out the EBML header for a WebM file. This function must be called
|
||||||
// before any other libwebm writing functions are called.
|
// before any other libwebm writing functions are called.
|
||||||
bool WriteEbmlHeader(IMkvWriter* writer, uint64 doc_type_version);
|
|
||||||
|
|
||||||
// Deprecated. Writes out EBML header with doc_type_version as
|
|
||||||
// kDefaultDocTypeVersion. Exists for backward compatibility.
|
|
||||||
bool WriteEbmlHeader(IMkvWriter* writer);
|
bool WriteEbmlHeader(IMkvWriter* writer);
|
||||||
|
|
||||||
// Copies in Chunk from source to destination between the given byte positions
|
// Copies in Chunk from source to destination between the given byte positions
|
||||||
@@ -76,23 +70,12 @@ class Frame {
|
|||||||
Frame();
|
Frame();
|
||||||
~Frame();
|
~Frame();
|
||||||
|
|
||||||
// Sets this frame's contents based on |frame|. Returns true on success. On
|
|
||||||
// failure, this frame's existing contents may be lost.
|
|
||||||
bool CopyFrom(const Frame& frame);
|
|
||||||
|
|
||||||
// Copies |frame| data into |frame_|. Returns true on success.
|
// Copies |frame| data into |frame_|. Returns true on success.
|
||||||
bool Init(const uint8* frame, uint64 length);
|
bool Init(const uint8* frame, uint64 length);
|
||||||
|
|
||||||
// Copies |additional| data into |additional_|. Returns true on success.
|
// Copies |additional| data into |additional_|. Returns true on success.
|
||||||
bool AddAdditionalData(const uint8* additional, uint64 length, uint64 add_id);
|
bool AddAdditionalData(const uint8* additional, uint64 length, uint64 add_id);
|
||||||
|
|
||||||
// Returns true if the frame has valid parameters.
|
|
||||||
bool IsValid() const;
|
|
||||||
|
|
||||||
// Returns true if the frame can be written as a SimpleBlock based on current
|
|
||||||
// parameters.
|
|
||||||
bool CanBeSimpleBlock() const;
|
|
||||||
|
|
||||||
uint64 add_id() const { return add_id_; }
|
uint64 add_id() const { return add_id_; }
|
||||||
const uint8* additional() const { return additional_; }
|
const uint8* additional() const { return additional_; }
|
||||||
uint64 additional_length() const { return additional_length_; }
|
uint64 additional_length() const { return additional_length_; }
|
||||||
@@ -106,15 +89,10 @@ class Frame {
|
|||||||
uint64 track_number() const { return track_number_; }
|
uint64 track_number() const { return track_number_; }
|
||||||
void set_timestamp(uint64 timestamp) { timestamp_ = timestamp; }
|
void set_timestamp(uint64 timestamp) { timestamp_ = timestamp; }
|
||||||
uint64 timestamp() const { return timestamp_; }
|
uint64 timestamp() const { return timestamp_; }
|
||||||
void set_discard_padding(int64 discard_padding) {
|
void set_discard_padding(uint64 discard_padding) {
|
||||||
discard_padding_ = discard_padding;
|
discard_padding_ = discard_padding;
|
||||||
}
|
}
|
||||||
int64 discard_padding() const { return discard_padding_; }
|
uint64 discard_padding() const { return discard_padding_; }
|
||||||
void set_reference_block_timestamp(int64 reference_block_timestamp);
|
|
||||||
int64 reference_block_timestamp() const { return reference_block_timestamp_; }
|
|
||||||
bool reference_block_timestamp_set() const {
|
|
||||||
return reference_block_timestamp_set_;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Id of the Additional data.
|
// Id of the Additional data.
|
||||||
@@ -146,14 +124,6 @@ class Frame {
|
|||||||
|
|
||||||
// Discard padding for the frame.
|
// Discard padding for the frame.
|
||||||
int64 discard_padding_;
|
int64 discard_padding_;
|
||||||
|
|
||||||
// Reference block timestamp.
|
|
||||||
int64 reference_block_timestamp_;
|
|
||||||
|
|
||||||
// Flag indicating if |reference_block_timestamp_| has been set.
|
|
||||||
bool reference_block_timestamp_set_;
|
|
||||||
|
|
||||||
LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Frame);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
@@ -452,16 +422,6 @@ class VideoTrack : public Track {
|
|||||||
uint64 display_height() const { return display_height_; }
|
uint64 display_height() const { return display_height_; }
|
||||||
void set_display_width(uint64 width) { display_width_ = width; }
|
void set_display_width(uint64 width) { display_width_ = width; }
|
||||||
uint64 display_width() const { return display_width_; }
|
uint64 display_width() const { return display_width_; }
|
||||||
|
|
||||||
void set_crop_left(uint64 crop_left) { crop_left_ = crop_left; }
|
|
||||||
uint64 crop_left() const { return crop_left_; }
|
|
||||||
void set_crop_right(uint64 crop_right) { crop_right_ = crop_right; }
|
|
||||||
uint64 crop_right() const { return crop_right_; }
|
|
||||||
void set_crop_top(uint64 crop_top) { crop_top_ = crop_top; }
|
|
||||||
uint64 crop_top() const { return crop_top_; }
|
|
||||||
void set_crop_bottom(uint64 crop_bottom) { crop_bottom_ = crop_bottom; }
|
|
||||||
uint64 crop_bottom() const { return crop_bottom_; }
|
|
||||||
|
|
||||||
void set_frame_rate(double frame_rate) { frame_rate_ = frame_rate; }
|
void set_frame_rate(double frame_rate) { frame_rate_ = frame_rate; }
|
||||||
double frame_rate() const { return frame_rate_; }
|
double frame_rate() const { return frame_rate_; }
|
||||||
void set_height(uint64 height) { height_ = height; }
|
void set_height(uint64 height) { height_ = height; }
|
||||||
@@ -478,10 +438,6 @@ class VideoTrack : public Track {
|
|||||||
// Video track element names.
|
// Video track element names.
|
||||||
uint64 display_height_;
|
uint64 display_height_;
|
||||||
uint64 display_width_;
|
uint64 display_width_;
|
||||||
uint64 crop_left_;
|
|
||||||
uint64 crop_right_;
|
|
||||||
uint64 crop_top_;
|
|
||||||
uint64 crop_bottom_;
|
|
||||||
double frame_rate_;
|
double frame_rate_;
|
||||||
uint64 height_;
|
uint64 height_;
|
||||||
uint64 stereo_mode_;
|
uint64 stereo_mode_;
|
||||||
@@ -528,12 +484,11 @@ class Tracks {
|
|||||||
public:
|
public:
|
||||||
// Audio and video type defined by the Matroska specs.
|
// Audio and video type defined by the Matroska specs.
|
||||||
enum { kVideo = 0x1, kAudio = 0x2 };
|
enum { kVideo = 0x1, kAudio = 0x2 };
|
||||||
|
// Opus, Vorbis, VP8, and VP9 codec ids defined by the Matroska specs.
|
||||||
static const char kOpusCodecId[];
|
static const char kOpusCodecId[];
|
||||||
static const char kVorbisCodecId[];
|
static const char kVorbisCodecId[];
|
||||||
static const char kVp8CodecId[];
|
static const char kVp8CodecId[];
|
||||||
static const char kVp9CodecId[];
|
static const char kVp9CodecId[];
|
||||||
static const char kVp10CodecId[];
|
|
||||||
|
|
||||||
Tracks();
|
Tracks();
|
||||||
~Tracks();
|
~Tracks();
|
||||||
@@ -737,112 +692,6 @@ class Chapters {
|
|||||||
LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Chapters);
|
LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Chapters);
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
|
||||||
// Tag element
|
|
||||||
//
|
|
||||||
class Tag {
|
|
||||||
public:
|
|
||||||
bool add_simple_tag(const char* tag_name, const char* tag_string);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Tags calls Clear and the destructor of Tag
|
|
||||||
friend class Tags;
|
|
||||||
|
|
||||||
// For storage of simple tags
|
|
||||||
class SimpleTag {
|
|
||||||
public:
|
|
||||||
// Establish representation invariant for new SimpleTag object.
|
|
||||||
void Init();
|
|
||||||
|
|
||||||
// Reclaim resources, in anticipation of destruction.
|
|
||||||
void Clear();
|
|
||||||
|
|
||||||
// Copies the title to the |tag_name_| member. Returns false on
|
|
||||||
// error.
|
|
||||||
bool set_tag_name(const char* tag_name);
|
|
||||||
|
|
||||||
// Copies the language to the |tag_string_| member. Returns false
|
|
||||||
// on error.
|
|
||||||
bool set_tag_string(const char* tag_string);
|
|
||||||
|
|
||||||
// If |writer| is non-NULL, serialize the SimpleTag sub-element of
|
|
||||||
// the Atom into the stream. Returns the SimpleTag element size on
|
|
||||||
// success, 0 if error.
|
|
||||||
uint64 Write(IMkvWriter* writer) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
char* tag_name_;
|
|
||||||
char* tag_string_;
|
|
||||||
};
|
|
||||||
|
|
||||||
Tag();
|
|
||||||
~Tag();
|
|
||||||
|
|
||||||
// Copies this Tag object to a different one. This is used when
|
|
||||||
// expanding a plain array of Tag objects (see Tags).
|
|
||||||
void ShallowCopy(Tag* dst) const;
|
|
||||||
|
|
||||||
// Reclaim resources used by this Tag object, pending its
|
|
||||||
// destruction.
|
|
||||||
void Clear();
|
|
||||||
|
|
||||||
// If there is no storage remaining on the |simple_tags_| array for a
|
|
||||||
// new display object, creates a new, longer array and copies the
|
|
||||||
// existing SimpleTag objects to the new array. Returns false if the
|
|
||||||
// array cannot be expanded.
|
|
||||||
bool ExpandSimpleTagsArray();
|
|
||||||
|
|
||||||
// If |writer| is non-NULL, serialize the Tag sub-element into the
|
|
||||||
// stream. Returns the total size of the element on success, 0 if
|
|
||||||
// error.
|
|
||||||
uint64 Write(IMkvWriter* writer) const;
|
|
||||||
|
|
||||||
// The Atom element can contain multiple SimpleTag sub-elements
|
|
||||||
SimpleTag* simple_tags_;
|
|
||||||
|
|
||||||
// The physical length (total size) of the |simple_tags_| array.
|
|
||||||
int simple_tags_size_;
|
|
||||||
|
|
||||||
// The logical length (number of active elements) on the |simple_tags_|
|
|
||||||
// array.
|
|
||||||
int simple_tags_count_;
|
|
||||||
|
|
||||||
LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Tag);
|
|
||||||
};
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
|
||||||
// Tags element
|
|
||||||
//
|
|
||||||
class Tags {
|
|
||||||
public:
|
|
||||||
Tags();
|
|
||||||
~Tags();
|
|
||||||
|
|
||||||
Tag* AddTag();
|
|
||||||
|
|
||||||
// Returns the number of tags that have been added.
|
|
||||||
int Count() const;
|
|
||||||
|
|
||||||
// Output the Tags element to the writer. Returns true on success.
|
|
||||||
bool Write(IMkvWriter* writer) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Expands the tags_ array if there is not enough space to contain
|
|
||||||
// another tag object. Returns true on success.
|
|
||||||
bool ExpandTagsArray();
|
|
||||||
|
|
||||||
// Total length of the tags_ array.
|
|
||||||
int tags_size_;
|
|
||||||
|
|
||||||
// Number of active tags on the tags_ array.
|
|
||||||
int tags_count_;
|
|
||||||
|
|
||||||
// Array for storage of tag objects.
|
|
||||||
Tag* tags_;
|
|
||||||
|
|
||||||
LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Tags);
|
|
||||||
};
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
// Cluster element
|
// Cluster element
|
||||||
//
|
//
|
||||||
@@ -850,36 +699,32 @@ class Tags {
|
|||||||
// |Init| must be called before any other method in this class.
|
// |Init| must be called before any other method in this class.
|
||||||
class Cluster {
|
class Cluster {
|
||||||
public:
|
public:
|
||||||
// |timecode| is the absolute timecode of the cluster. |cues_pos| is the
|
Cluster(uint64 timecode, int64 cues_pos);
|
||||||
// position for the cluster within the segment that should be written in
|
|
||||||
// the cues element. |timecode_scale| is the timecode scale of the segment.
|
|
||||||
Cluster(uint64 timecode, int64 cues_pos, uint64 timecode_scale);
|
|
||||||
~Cluster();
|
~Cluster();
|
||||||
|
|
||||||
|
// |timecode| is the absolute timecode of the cluster. |cues_pos| is the
|
||||||
|
// position for the cluster within the segment that should be written in
|
||||||
|
// the cues element.
|
||||||
bool Init(IMkvWriter* ptr_writer);
|
bool Init(IMkvWriter* ptr_writer);
|
||||||
|
|
||||||
// Adds a frame to be output in the file. The frame is written out through
|
|
||||||
// |writer_| if successful. Returns true on success.
|
|
||||||
bool AddFrame(const Frame* frame);
|
|
||||||
|
|
||||||
// Adds a frame to be output in the file. The frame is written out through
|
// Adds a frame to be output in the file. The frame is written out through
|
||||||
// |writer_| if successful. Returns true on success.
|
// |writer_| if successful. Returns true on success.
|
||||||
// Inputs:
|
// Inputs:
|
||||||
// data: Pointer to the data
|
// frame: Pointer to the data
|
||||||
// length: Length of the data
|
// length: Length of the data
|
||||||
// track_number: Track to add the data to. Value returned by Add track
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
// functions. The range of allowed values is [1, 126].
|
// functions. The range of allowed values is [1, 126].
|
||||||
// timecode: Absolute (not relative to cluster) timestamp of the
|
// timecode: Absolute (not relative to cluster) timestamp of the
|
||||||
// frame, expressed in timecode units.
|
// frame, expressed in timecode units.
|
||||||
// is_key: Flag telling whether or not this frame is a key frame.
|
// is_key: Flag telling whether or not this frame is a key frame.
|
||||||
bool AddFrame(const uint8* data, uint64 length, uint64 track_number,
|
bool AddFrame(const uint8* frame, uint64 length, uint64 track_number,
|
||||||
uint64 timecode, // timecode units (absolute)
|
uint64 timecode, // timecode units (absolute)
|
||||||
bool is_key);
|
bool is_key);
|
||||||
|
|
||||||
// Adds a frame to be output in the file. The frame is written out through
|
// Adds a frame to be output in the file. The frame is written out through
|
||||||
// |writer_| if successful. Returns true on success.
|
// |writer_| if successful. Returns true on success.
|
||||||
// Inputs:
|
// Inputs:
|
||||||
// data: Pointer to the data
|
// frame: Pointer to the data
|
||||||
// length: Length of the data
|
// length: Length of the data
|
||||||
// additional: Pointer to the additional data
|
// additional: Pointer to the additional data
|
||||||
// additional_length: Length of the additional data
|
// additional_length: Length of the additional data
|
||||||
@@ -889,7 +734,7 @@ class Cluster {
|
|||||||
// abs_timecode: Absolute (not relative to cluster) timestamp of the
|
// abs_timecode: Absolute (not relative to cluster) timestamp of the
|
||||||
// frame, expressed in timecode units.
|
// frame, expressed in timecode units.
|
||||||
// is_key: Flag telling whether or not this frame is a key frame.
|
// is_key: Flag telling whether or not this frame is a key frame.
|
||||||
bool AddFrameWithAdditional(const uint8* data, uint64 length,
|
bool AddFrameWithAdditional(const uint8* frame, uint64 length,
|
||||||
const uint8* additional, uint64 additional_length,
|
const uint8* additional, uint64 additional_length,
|
||||||
uint64 add_id, uint64 track_number,
|
uint64 add_id, uint64 track_number,
|
||||||
uint64 abs_timecode, bool is_key);
|
uint64 abs_timecode, bool is_key);
|
||||||
@@ -897,7 +742,7 @@ class Cluster {
|
|||||||
// Adds a frame to be output in the file. The frame is written out through
|
// Adds a frame to be output in the file. The frame is written out through
|
||||||
// |writer_| if successful. Returns true on success.
|
// |writer_| if successful. Returns true on success.
|
||||||
// Inputs:
|
// Inputs:
|
||||||
// data: Pointer to the data.
|
// frame: Pointer to the data.
|
||||||
// length: Length of the data.
|
// length: Length of the data.
|
||||||
// discard_padding: DiscardPadding element value.
|
// discard_padding: DiscardPadding element value.
|
||||||
// track_number: Track to add the data to. Value returned by Add track
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
@@ -905,14 +750,14 @@ class Cluster {
|
|||||||
// abs_timecode: Absolute (not relative to cluster) timestamp of the
|
// abs_timecode: Absolute (not relative to cluster) timestamp of the
|
||||||
// frame, expressed in timecode units.
|
// frame, expressed in timecode units.
|
||||||
// is_key: Flag telling whether or not this frame is a key frame.
|
// is_key: Flag telling whether or not this frame is a key frame.
|
||||||
bool AddFrameWithDiscardPadding(const uint8* data, uint64 length,
|
bool AddFrameWithDiscardPadding(const uint8* frame, uint64 length,
|
||||||
int64 discard_padding, uint64 track_number,
|
int64 discard_padding, uint64 track_number,
|
||||||
uint64 abs_timecode, bool is_key);
|
uint64 abs_timecode, bool is_key);
|
||||||
|
|
||||||
// Writes a frame of metadata to the output medium; returns true on
|
// Writes a frame of metadata to the output medium; returns true on
|
||||||
// success.
|
// success.
|
||||||
// Inputs:
|
// Inputs:
|
||||||
// data: Pointer to the data
|
// frame: Pointer to the data
|
||||||
// length: Length of the data
|
// length: Length of the data
|
||||||
// track_number: Track to add the data to. Value returned by Add track
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
// functions. The range of allowed values is [1, 126].
|
// functions. The range of allowed values is [1, 126].
|
||||||
@@ -923,7 +768,7 @@ class Cluster {
|
|||||||
// The metadata frame is written as a block group, with a duration
|
// The metadata frame is written as a block group, with a duration
|
||||||
// sub-element but no reference time sub-elements (indicating that
|
// sub-element but no reference time sub-elements (indicating that
|
||||||
// it is considered a keyframe, per Matroska semantics).
|
// it is considered a keyframe, per Matroska semantics).
|
||||||
bool AddMetadata(const uint8* data, uint64 length, uint64 track_number,
|
bool AddMetadata(const uint8* frame, uint64 length, uint64 track_number,
|
||||||
uint64 timecode, uint64 duration);
|
uint64 timecode, uint64 duration);
|
||||||
|
|
||||||
// Increments the size of the cluster's data in bytes.
|
// Increments the size of the cluster's data in bytes.
|
||||||
@@ -936,29 +781,75 @@ class Cluster {
|
|||||||
// Returns the size in bytes for the entire Cluster element.
|
// Returns the size in bytes for the entire Cluster element.
|
||||||
uint64 Size() const;
|
uint64 Size() const;
|
||||||
|
|
||||||
// Given |abs_timecode|, calculates timecode relative to most recent timecode.
|
|
||||||
// Returns -1 on failure, or a relative timecode.
|
|
||||||
int64 GetRelativeTimecode(int64 abs_timecode) const;
|
|
||||||
|
|
||||||
int64 size_position() const { return size_position_; }
|
int64 size_position() const { return size_position_; }
|
||||||
int32 blocks_added() const { return blocks_added_; }
|
int32 blocks_added() const { return blocks_added_; }
|
||||||
uint64 payload_size() const { return payload_size_; }
|
uint64 payload_size() const { return payload_size_; }
|
||||||
int64 position_for_cues() const { return position_for_cues_; }
|
int64 position_for_cues() const { return position_for_cues_; }
|
||||||
uint64 timecode() const { return timecode_; }
|
uint64 timecode() const { return timecode_; }
|
||||||
uint64 timecode_scale() const { return timecode_scale_; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Utility method that confirms that blocks can still be added, and that the
|
// Signature that matches either of WriteSimpleBlock or WriteMetadataBlock
|
||||||
// cluster header has been written. Used by |DoWriteFrame*|. Returns true
|
// in the muxer utilities package.
|
||||||
// when successful.
|
typedef uint64 (*WriteBlock)(IMkvWriter* writer, const uint8* data,
|
||||||
bool PreWriteBlock();
|
uint64 length, uint64 track_number,
|
||||||
|
int64 timecode, uint64 generic_arg);
|
||||||
|
|
||||||
// Utility method used by the |DoWriteFrame*| methods that handles the book
|
// Signature that matches WriteBlockWithAdditional
|
||||||
|
// in the muxer utilities package.
|
||||||
|
typedef uint64 (*WriteBlockAdditional)(IMkvWriter* writer, const uint8* data,
|
||||||
|
uint64 length, const uint8* additional,
|
||||||
|
uint64 add_id,
|
||||||
|
uint64 additional_length,
|
||||||
|
uint64 track_number, int64 timecode,
|
||||||
|
uint64 is_key);
|
||||||
|
|
||||||
|
// Signature that matches WriteBlockWithDiscardPadding
|
||||||
|
// in the muxer utilities package.
|
||||||
|
typedef uint64 (*WriteBlockDiscardPadding)(IMkvWriter* writer,
|
||||||
|
const uint8* data, uint64 length,
|
||||||
|
int64 discard_padding,
|
||||||
|
uint64 track_number,
|
||||||
|
int64 timecode, uint64 is_key);
|
||||||
|
|
||||||
|
// Utility method that confirms that blocks can still be added, and that the
|
||||||
|
// cluster header has been written. Used by |DoWriteBlock*|. Returns true
|
||||||
|
// when successful.
|
||||||
|
template <typename Type>
|
||||||
|
bool PreWriteBlock(Type* write_function);
|
||||||
|
|
||||||
|
// Utility method used by the |DoWriteBlock*| methods that handles the book
|
||||||
// keeping required after each block is written.
|
// keeping required after each block is written.
|
||||||
void PostWriteBlock(uint64 element_size);
|
void PostWriteBlock(uint64 element_size);
|
||||||
|
|
||||||
// Does some verification and calls WriteFrame.
|
// To simplify things, we require that there be fewer than 127
|
||||||
bool DoWriteFrame(const Frame* const frame);
|
// tracks -- this allows us to serialize the track number value for
|
||||||
|
// a stream using a single byte, per the Matroska encoding.
|
||||||
|
bool IsValidTrackNumber(uint64 track_number) const;
|
||||||
|
|
||||||
|
// Given |abs_timecode|, calculates timecode relative to most recent timecode.
|
||||||
|
// Returns -1 on failure, or a relative timecode.
|
||||||
|
int64 GetRelativeTimecode(int64 abs_timecode) const;
|
||||||
|
|
||||||
|
// Used to implement AddFrame and AddMetadata.
|
||||||
|
bool DoWriteBlock(const uint8* frame, uint64 length, uint64 track_number,
|
||||||
|
uint64 absolute_timecode, uint64 generic_arg,
|
||||||
|
WriteBlock write_block);
|
||||||
|
|
||||||
|
// Used to implement AddFrameWithAdditional
|
||||||
|
bool DoWriteBlockWithAdditional(const uint8* frame, uint64 length,
|
||||||
|
const uint8* additional,
|
||||||
|
uint64 additional_length, uint64 add_id,
|
||||||
|
uint64 track_number, uint64 absolute_timecode,
|
||||||
|
uint64 generic_arg,
|
||||||
|
WriteBlockAdditional write_block);
|
||||||
|
|
||||||
|
// Used to implement AddFrameWithDiscardPadding
|
||||||
|
bool DoWriteBlockWithDiscardPadding(const uint8* frame, uint64 length,
|
||||||
|
int64 discard_padding,
|
||||||
|
uint64 track_number,
|
||||||
|
uint64 absolute_timecode,
|
||||||
|
uint64 generic_arg,
|
||||||
|
WriteBlockDiscardPadding write_block);
|
||||||
|
|
||||||
// Outputs the Cluster header to |writer_|. Returns true on success.
|
// Outputs the Cluster header to |writer_|. Returns true on success.
|
||||||
bool WriteClusterHeader();
|
bool WriteClusterHeader();
|
||||||
@@ -984,9 +875,6 @@ class Cluster {
|
|||||||
// The absolute timecode of the cluster.
|
// The absolute timecode of the cluster.
|
||||||
const uint64 timecode_;
|
const uint64 timecode_;
|
||||||
|
|
||||||
// The timecode scale of the Segment containing the cluster.
|
|
||||||
const uint64 timecode_scale_;
|
|
||||||
|
|
||||||
// Pointer to the writer object. Not owned by this class.
|
// Pointer to the writer object. Not owned by this class.
|
||||||
IMkvWriter* writer_;
|
IMkvWriter* writer_;
|
||||||
|
|
||||||
@@ -1108,7 +996,6 @@ class Segment {
|
|||||||
kBeforeClusters = 0x1 // Position Cues before Clusters
|
kBeforeClusters = 0x1 // Position Cues before Clusters
|
||||||
};
|
};
|
||||||
|
|
||||||
const static uint32 kDefaultDocTypeVersion = 2;
|
|
||||||
const static uint64 kDefaultMaxClusterDuration = 30000000000ULL;
|
const static uint64 kDefaultMaxClusterDuration = 30000000000ULL;
|
||||||
|
|
||||||
Segment();
|
Segment();
|
||||||
@@ -1136,11 +1023,6 @@ class Segment {
|
|||||||
// populate its fields via the Chapter member functions.
|
// populate its fields via the Chapter member functions.
|
||||||
Chapter* AddChapter();
|
Chapter* AddChapter();
|
||||||
|
|
||||||
// Adds an empty tag to the tags of this segment. Returns
|
|
||||||
// non-NULL on success. After adding the tag, the caller should
|
|
||||||
// populate its fields via the Tag member functions.
|
|
||||||
Tag* AddTag();
|
|
||||||
|
|
||||||
// Adds a cue point to the Cues element. |timestamp| is the time in
|
// Adds a cue point to the Cues element. |timestamp| is the time in
|
||||||
// nanoseconds of the cue's time. |track| is the Track of the Cue. This
|
// nanoseconds of the cue's time. |track| is the Track of the Cue. This
|
||||||
// function must be called after AddFrame to calculate the correct
|
// function must be called after AddFrame to calculate the correct
|
||||||
@@ -1149,19 +1031,19 @@ class Segment {
|
|||||||
|
|
||||||
// Adds a frame to be output in the file. Returns true on success.
|
// Adds a frame to be output in the file. Returns true on success.
|
||||||
// Inputs:
|
// Inputs:
|
||||||
// data: Pointer to the data
|
// frame: Pointer to the data
|
||||||
// length: Length of the data
|
// length: Length of the data
|
||||||
// track_number: Track to add the data to. Value returned by Add track
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
// functions.
|
// functions.
|
||||||
// timestamp: Timestamp of the frame in nanoseconds from 0.
|
// timestamp: Timestamp of the frame in nanoseconds from 0.
|
||||||
// is_key: Flag telling whether or not this frame is a key frame.
|
// is_key: Flag telling whether or not this frame is a key frame.
|
||||||
bool AddFrame(const uint8* data, uint64 length, uint64 track_number,
|
bool AddFrame(const uint8* frame, uint64 length, uint64 track_number,
|
||||||
uint64 timestamp_ns, bool is_key);
|
uint64 timestamp_ns, bool is_key);
|
||||||
|
|
||||||
// Writes a frame of metadata to the output medium; returns true on
|
// Writes a frame of metadata to the output medium; returns true on
|
||||||
// success.
|
// success.
|
||||||
// Inputs:
|
// Inputs:
|
||||||
// data: Pointer to the data
|
// frame: Pointer to the data
|
||||||
// length: Length of the data
|
// length: Length of the data
|
||||||
// track_number: Track to add the data to. Value returned by Add track
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
// functions.
|
// functions.
|
||||||
@@ -1172,13 +1054,13 @@ class Segment {
|
|||||||
// The metadata frame is written as a block group, with a duration
|
// The metadata frame is written as a block group, with a duration
|
||||||
// sub-element but no reference time sub-elements (indicating that
|
// sub-element but no reference time sub-elements (indicating that
|
||||||
// it is considered a keyframe, per Matroska semantics).
|
// it is considered a keyframe, per Matroska semantics).
|
||||||
bool AddMetadata(const uint8* data, uint64 length, uint64 track_number,
|
bool AddMetadata(const uint8* frame, uint64 length, uint64 track_number,
|
||||||
uint64 timestamp_ns, uint64 duration_ns);
|
uint64 timestamp_ns, uint64 duration_ns);
|
||||||
|
|
||||||
// Writes a frame with additional data to the output medium; returns true on
|
// Writes a frame with additional data to the output medium; returns true on
|
||||||
// success.
|
// success.
|
||||||
// Inputs:
|
// Inputs:
|
||||||
// data: Pointer to the data.
|
// frame: Pointer to the data.
|
||||||
// length: Length of the data.
|
// length: Length of the data.
|
||||||
// additional: Pointer to additional data.
|
// additional: Pointer to additional data.
|
||||||
// additional_length: Length of additional data.
|
// additional_length: Length of additional data.
|
||||||
@@ -1188,7 +1070,7 @@ class Segment {
|
|||||||
// timestamp: Absolute timestamp of the frame, expressed in nanosecond
|
// timestamp: Absolute timestamp of the frame, expressed in nanosecond
|
||||||
// units.
|
// units.
|
||||||
// is_key: Flag telling whether or not this frame is a key frame.
|
// is_key: Flag telling whether or not this frame is a key frame.
|
||||||
bool AddFrameWithAdditional(const uint8* data, uint64 length,
|
bool AddFrameWithAdditional(const uint8* frame, uint64 length,
|
||||||
const uint8* additional, uint64 additional_length,
|
const uint8* additional, uint64 additional_length,
|
||||||
uint64 add_id, uint64 track_number,
|
uint64 add_id, uint64 track_number,
|
||||||
uint64 timestamp, bool is_key);
|
uint64 timestamp, bool is_key);
|
||||||
@@ -1196,7 +1078,7 @@ class Segment {
|
|||||||
// Writes a frame with DiscardPadding to the output medium; returns true on
|
// Writes a frame with DiscardPadding to the output medium; returns true on
|
||||||
// success.
|
// success.
|
||||||
// Inputs:
|
// Inputs:
|
||||||
// data: Pointer to the data.
|
// frame: Pointer to the data.
|
||||||
// length: Length of the data.
|
// length: Length of the data.
|
||||||
// discard_padding: DiscardPadding element value.
|
// discard_padding: DiscardPadding element value.
|
||||||
// track_number: Track to add the data to. Value returned by Add track
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
@@ -1204,7 +1086,7 @@ class Segment {
|
|||||||
// timestamp: Absolute timestamp of the frame, expressed in nanosecond
|
// timestamp: Absolute timestamp of the frame, expressed in nanosecond
|
||||||
// units.
|
// units.
|
||||||
// is_key: Flag telling whether or not this frame is a key frame.
|
// is_key: Flag telling whether or not this frame is a key frame.
|
||||||
bool AddFrameWithDiscardPadding(const uint8* data, uint64 length,
|
bool AddFrameWithDiscardPadding(const uint8* frame, uint64 length,
|
||||||
int64 discard_padding, uint64 track_number,
|
int64 discard_padding, uint64 track_number,
|
||||||
uint64 timestamp, bool is_key);
|
uint64 timestamp, bool is_key);
|
||||||
|
|
||||||
@@ -1295,9 +1177,6 @@ class Segment {
|
|||||||
// Cues elements.
|
// Cues elements.
|
||||||
bool CheckHeaderInfo();
|
bool CheckHeaderInfo();
|
||||||
|
|
||||||
// Sets |doc_type_version_| based on the current element requirements.
|
|
||||||
void UpdateDocTypeVersion();
|
|
||||||
|
|
||||||
// Sets |name| according to how many chunks have been written. |ext| is the
|
// Sets |name| according to how many chunks have been written. |ext| is the
|
||||||
// file extension. |name| must be deleted by the calling app. Returns true
|
// file extension. |name| must be deleted by the calling app. Returns true
|
||||||
// on success.
|
// on success.
|
||||||
@@ -1354,7 +1233,7 @@ class Segment {
|
|||||||
// diff - indicates the difference in size of the Cues element that needs to
|
// diff - indicates the difference in size of the Cues element that needs to
|
||||||
// accounted for.
|
// accounted for.
|
||||||
// index - index in the list of Cues which is currently being adjusted.
|
// index - index in the list of Cues which is currently being adjusted.
|
||||||
// cue_size - sum of size of all the CuePoint elements.
|
// cue_size - size of the Cues element.
|
||||||
void MoveCuesBeforeClustersHelper(uint64 diff, int index, uint64* cue_size);
|
void MoveCuesBeforeClustersHelper(uint64 diff, int index, uint64* cue_size);
|
||||||
|
|
||||||
// Seeds the random number generator used to make UIDs.
|
// Seeds the random number generator used to make UIDs.
|
||||||
@@ -1366,7 +1245,6 @@ class Segment {
|
|||||||
SegmentInfo segment_info_;
|
SegmentInfo segment_info_;
|
||||||
Tracks tracks_;
|
Tracks tracks_;
|
||||||
Chapters chapters_;
|
Chapters chapters_;
|
||||||
Tags tags_;
|
|
||||||
|
|
||||||
// Number of chunks written.
|
// Number of chunks written.
|
||||||
int chunk_count_;
|
int chunk_count_;
|
||||||
@@ -1438,9 +1316,6 @@ class Segment {
|
|||||||
// Last timestamp in nanoseconds added to a cluster.
|
// Last timestamp in nanoseconds added to a cluster.
|
||||||
uint64 last_timestamp_;
|
uint64 last_timestamp_;
|
||||||
|
|
||||||
// Last timestamp in nanoseconds by track number added to a cluster.
|
|
||||||
uint64 last_track_timestamp_[kMaxTrackNumber];
|
|
||||||
|
|
||||||
// Maximum time in nanoseconds for a cluster duration. This variable is a
|
// Maximum time in nanoseconds for a cluster duration. This variable is a
|
||||||
// guideline and some clusters may have a longer duration. Default is 30
|
// guideline and some clusters may have a longer duration. Default is 30
|
||||||
// seconds.
|
// seconds.
|
||||||
@@ -1462,23 +1337,12 @@ class Segment {
|
|||||||
// Flag whether or not the muxer should output a Cues element.
|
// Flag whether or not the muxer should output a Cues element.
|
||||||
bool output_cues_;
|
bool output_cues_;
|
||||||
|
|
||||||
// The size of the EBML header, used to validate the header if
|
|
||||||
// WriteEbmlHeader() is called more than once.
|
|
||||||
int32 ebml_header_size_;
|
|
||||||
|
|
||||||
// The file position of the segment's payload.
|
// The file position of the segment's payload.
|
||||||
int64 payload_pos_;
|
int64 payload_pos_;
|
||||||
|
|
||||||
// The file position of the element's size.
|
// The file position of the element's size.
|
||||||
int64 size_position_;
|
int64 size_position_;
|
||||||
|
|
||||||
// Current DocTypeVersion (|doc_type_version_|) and that written in
|
|
||||||
// WriteSegmentHeader().
|
|
||||||
// WriteEbmlHeader() will be called from Finalize() if |doc_type_version_|
|
|
||||||
// differs from |doc_type_version_written_|.
|
|
||||||
uint32 doc_type_version_;
|
|
||||||
uint32 doc_type_version_written_;
|
|
||||||
|
|
||||||
// Pointer to the writer objects. Not owned by this class.
|
// Pointer to the writer objects. Not owned by this class.
|
||||||
IMkvWriter* writer_cluster_;
|
IMkvWriter* writer_cluster_;
|
||||||
IMkvWriter* writer_cues_;
|
IMkvWriter* writer_cues_;
|
||||||
|
483
third_party/libwebm/mkvmuxerutil.cpp
vendored
483
third_party/libwebm/mkvmuxerutil.cpp
vendored
@@ -15,19 +15,18 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define _CRT_RAND_S
|
||||||
|
#endif
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
#include "mkvwriter.hpp"
|
#include "mkvwriter.hpp"
|
||||||
#include "webmids.hpp"
|
#include "webmids.hpp"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
|
||||||
#pragma warning(disable : 4996)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mkvmuxer {
|
namespace mkvmuxer {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -35,144 +34,6 @@ namespace {
|
|||||||
// Date elements are always 8 octets in size.
|
// Date elements are always 8 octets in size.
|
||||||
const int kDateElementSize = 8;
|
const int kDateElementSize = 8;
|
||||||
|
|
||||||
uint64 WriteBlock(IMkvWriter* writer, const Frame* const frame, int64 timecode,
|
|
||||||
uint64 timecode_scale) {
|
|
||||||
uint64 block_additional_elem_size = 0;
|
|
||||||
uint64 block_addid_elem_size = 0;
|
|
||||||
uint64 block_more_payload_size = 0;
|
|
||||||
uint64 block_more_elem_size = 0;
|
|
||||||
uint64 block_additions_payload_size = 0;
|
|
||||||
uint64 block_additions_elem_size = 0;
|
|
||||||
if (frame->additional()) {
|
|
||||||
block_additional_elem_size = EbmlElementSize(
|
|
||||||
kMkvBlockAdditional, frame->additional(), frame->additional_length());
|
|
||||||
block_addid_elem_size = EbmlElementSize(kMkvBlockAddID, frame->add_id());
|
|
||||||
|
|
||||||
block_more_payload_size =
|
|
||||||
block_addid_elem_size + block_additional_elem_size;
|
|
||||||
block_more_elem_size =
|
|
||||||
EbmlMasterElementSize(kMkvBlockMore, block_more_payload_size) +
|
|
||||||
block_more_payload_size;
|
|
||||||
block_additions_payload_size = block_more_elem_size;
|
|
||||||
block_additions_elem_size =
|
|
||||||
EbmlMasterElementSize(kMkvBlockAdditions,
|
|
||||||
block_additions_payload_size) +
|
|
||||||
block_additions_payload_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64 discard_padding_elem_size = 0;
|
|
||||||
if (frame->discard_padding() != 0) {
|
|
||||||
discard_padding_elem_size =
|
|
||||||
EbmlElementSize(kMkvDiscardPadding, frame->discard_padding());
|
|
||||||
}
|
|
||||||
|
|
||||||
const uint64 reference_block_timestamp =
|
|
||||||
frame->reference_block_timestamp() / timecode_scale;
|
|
||||||
uint64 reference_block_elem_size = 0;
|
|
||||||
if (!frame->is_key()) {
|
|
||||||
reference_block_elem_size =
|
|
||||||
EbmlElementSize(kMkvReferenceBlock, reference_block_timestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
const uint64 duration = frame->duration() / timecode_scale;
|
|
||||||
uint64 block_duration_elem_size = 0;
|
|
||||||
if (duration > 0)
|
|
||||||
block_duration_elem_size = EbmlElementSize(kMkvBlockDuration, duration);
|
|
||||||
|
|
||||||
const uint64 block_payload_size = 4 + frame->length();
|
|
||||||
const uint64 block_elem_size =
|
|
||||||
EbmlMasterElementSize(kMkvBlock, block_payload_size) + block_payload_size;
|
|
||||||
|
|
||||||
const uint64 block_group_payload_size =
|
|
||||||
block_elem_size + block_additions_elem_size + block_duration_elem_size +
|
|
||||||
discard_padding_elem_size + reference_block_elem_size;
|
|
||||||
|
|
||||||
if (!WriteEbmlMasterElement(writer, kMkvBlockGroup,
|
|
||||||
block_group_payload_size)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!WriteEbmlMasterElement(writer, kMkvBlock, block_payload_size))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (WriteUInt(writer, frame->track_number()))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (SerializeInt(writer, timecode, 2))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// For a Block, flags is always 0.
|
|
||||||
if (SerializeInt(writer, 0, 1))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (writer->Write(frame->frame(), static_cast<uint32>(frame->length())))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (frame->additional()) {
|
|
||||||
if (!WriteEbmlMasterElement(writer, kMkvBlockAdditions,
|
|
||||||
block_additions_payload_size)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!WriteEbmlMasterElement(writer, kMkvBlockMore, block_more_payload_size))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!WriteEbmlElement(writer, kMkvBlockAddID, frame->add_id()))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!WriteEbmlElement(writer, kMkvBlockAdditional, frame->additional(),
|
|
||||||
frame->additional_length())) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (frame->discard_padding() != 0 &&
|
|
||||||
!WriteEbmlElement(writer, kMkvDiscardPadding, frame->discard_padding())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!frame->is_key() &&
|
|
||||||
!WriteEbmlElement(writer, kMkvReferenceBlock,
|
|
||||||
reference_block_timestamp)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (duration > 0 && !WriteEbmlElement(writer, kMkvBlockDuration, duration)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return EbmlMasterElementSize(kMkvBlockGroup, block_group_payload_size) +
|
|
||||||
block_group_payload_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64 WriteSimpleBlock(IMkvWriter* writer, const Frame* const frame,
|
|
||||||
int64 timecode) {
|
|
||||||
if (WriteID(writer, kMkvSimpleBlock))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
const int32 size = static_cast<int32>(frame->length()) + 4;
|
|
||||||
if (WriteUInt(writer, size))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (WriteUInt(writer, static_cast<uint64>(frame->track_number())))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (SerializeInt(writer, timecode, 2))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
uint64 flags = 0;
|
|
||||||
if (frame->is_key())
|
|
||||||
flags |= 0x80;
|
|
||||||
|
|
||||||
if (SerializeInt(writer, flags, 1))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (writer->Write(frame->frame(), static_cast<uint32>(frame->length())))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return GetUIntSize(kMkvSimpleBlock) + GetCodedUIntSize(size) + 4 +
|
|
||||||
frame->length();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int32 GetCodedUIntSize(uint64 value) {
|
int32 GetCodedUIntSize(uint64 value) {
|
||||||
@@ -211,13 +72,6 @@ int32 GetUIntSize(uint64 value) {
|
|||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 GetIntSize(int64 value) {
|
|
||||||
// Doubling the requested value ensures positive values with their high bit
|
|
||||||
// set are written with 0-padding to avoid flipping the signedness.
|
|
||||||
const uint64 v = (value < 0) ? value ^ -1LL : value;
|
|
||||||
return GetUIntSize(2 * v);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64 EbmlMasterElementSize(uint64 type, uint64 value) {
|
uint64 EbmlMasterElementSize(uint64 type, uint64 value) {
|
||||||
// Size of EBML ID
|
// Size of EBML ID
|
||||||
int32 ebml_size = GetUIntSize(type);
|
int32 ebml_size = GetUIntSize(type);
|
||||||
@@ -229,16 +83,7 @@ uint64 EbmlMasterElementSize(uint64 type, uint64 value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64 EbmlElementSize(uint64 type, int64 value) {
|
uint64 EbmlElementSize(uint64 type, int64 value) {
|
||||||
// Size of EBML ID
|
return EbmlElementSize(type, static_cast<uint64>(value));
|
||||||
int32 ebml_size = GetUIntSize(type);
|
|
||||||
|
|
||||||
// Datasize
|
|
||||||
ebml_size += GetIntSize(value);
|
|
||||||
|
|
||||||
// Size of Datasize
|
|
||||||
ebml_size++;
|
|
||||||
|
|
||||||
return ebml_size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 EbmlElementSize(uint64 type, uint64 value) {
|
uint64 EbmlElementSize(uint64 type, uint64 value) {
|
||||||
@@ -299,7 +144,7 @@ uint64 EbmlElementSize(uint64 type, const uint8* value, uint64 size) {
|
|||||||
return ebml_size;
|
return ebml_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 EbmlDateElementSize(uint64 type) {
|
uint64 EbmlDateElementSize(uint64 type, int64 value) {
|
||||||
// Size of EBML ID
|
// Size of EBML ID
|
||||||
uint64 ebml_size = GetUIntSize(type);
|
uint64 ebml_size = GetUIntSize(type);
|
||||||
|
|
||||||
@@ -444,23 +289,6 @@ bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, int64 value) {
|
|
||||||
if (!writer)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (WriteID(writer, type))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
const uint64 size = GetIntSize(value);
|
|
||||||
if (WriteUInt(writer, size))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (SerializeInt(writer, value, static_cast<int32>(size)))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value) {
|
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value) {
|
||||||
if (!writer)
|
if (!writer)
|
||||||
return false;
|
return false;
|
||||||
@@ -527,25 +355,289 @@ bool WriteEbmlDateElement(IMkvWriter* writer, uint64 type, int64 value) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 WriteFrame(IMkvWriter* writer, const Frame* const frame,
|
uint64 WriteSimpleBlock(IMkvWriter* writer, const uint8* data, uint64 length,
|
||||||
Cluster* cluster) {
|
uint64 track_number, int64 timecode, uint64 is_key) {
|
||||||
if (!writer || !frame || !frame->IsValid() || !cluster ||
|
if (!writer)
|
||||||
!cluster->timecode_scale())
|
return false;
|
||||||
return 0;
|
|
||||||
|
|
||||||
// Technically the timecode for a block can be less than the
|
if (!data || length < 1)
|
||||||
// timecode for the cluster itself (remember that block timecode
|
return false;
|
||||||
|
|
||||||
|
// Here we only permit track number values to be no greater than
|
||||||
|
// 126, which the largest value we can store having a Matroska
|
||||||
|
// integer representation of only 1 byte.
|
||||||
|
|
||||||
|
if (track_number < 1 || track_number > 126)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Technically the timestamp for a block can be less than the
|
||||||
|
// timestamp for the cluster itself (remember that block timestamp
|
||||||
// is a signed, 16-bit integer). However, as a simplification we
|
// is a signed, 16-bit integer). However, as a simplification we
|
||||||
// only permit non-negative cluster-relative timecodes for blocks.
|
// only permit non-negative cluster-relative timestamps for blocks.
|
||||||
const int64 relative_timecode = cluster->GetRelativeTimecode(
|
|
||||||
frame->timestamp() / cluster->timecode_scale());
|
if (timecode < 0 || timecode > kMaxBlockTimecode)
|
||||||
if (relative_timecode < 0 || relative_timecode > kMaxBlockTimecode)
|
return false;
|
||||||
|
|
||||||
|
if (WriteID(writer, kMkvSimpleBlock))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return frame->CanBeSimpleBlock() ?
|
const int32 size = static_cast<int32>(length) + 4;
|
||||||
WriteSimpleBlock(writer, frame, relative_timecode) :
|
if (WriteUInt(writer, size))
|
||||||
WriteBlock(writer, frame, relative_timecode,
|
return 0;
|
||||||
cluster->timecode_scale());
|
|
||||||
|
if (WriteUInt(writer, static_cast<uint64>(track_number)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (SerializeInt(writer, timecode, 2))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
uint64 flags = 0;
|
||||||
|
if (is_key)
|
||||||
|
flags |= 0x80;
|
||||||
|
|
||||||
|
if (SerializeInt(writer, flags, 1))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (writer->Write(data, static_cast<uint32>(length)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
const uint64 element_size =
|
||||||
|
GetUIntSize(kMkvSimpleBlock) + GetCodedUIntSize(size) + 4 + length;
|
||||||
|
|
||||||
|
return element_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We must write the metadata (key)frame as a BlockGroup element,
|
||||||
|
// because we need to specify a duration for the frame. The
|
||||||
|
// BlockGroup element comprises the frame itself and its duration,
|
||||||
|
// and is laid out as follows:
|
||||||
|
//
|
||||||
|
// BlockGroup tag
|
||||||
|
// BlockGroup size
|
||||||
|
// Block tag
|
||||||
|
// Block size
|
||||||
|
// (the frame is the block payload)
|
||||||
|
// Duration tag
|
||||||
|
// Duration size
|
||||||
|
// (duration payload)
|
||||||
|
//
|
||||||
|
uint64 WriteMetadataBlock(IMkvWriter* writer, const uint8* data, uint64 length,
|
||||||
|
uint64 track_number, int64 timecode,
|
||||||
|
uint64 duration) {
|
||||||
|
// We don't backtrack when writing to the stream, so we must
|
||||||
|
// pre-compute the BlockGroup size, by summing the sizes of each
|
||||||
|
// sub-element (the block and the duration).
|
||||||
|
|
||||||
|
// We use a single byte for the track number of the block, which
|
||||||
|
// means the block header is exactly 4 bytes.
|
||||||
|
|
||||||
|
// TODO(matthewjheaney): use EbmlMasterElementSize and WriteEbmlMasterElement
|
||||||
|
|
||||||
|
const uint64 block_payload_size = 4 + length;
|
||||||
|
const int32 block_size = GetCodedUIntSize(block_payload_size);
|
||||||
|
const uint64 block_elem_size = 1 + block_size + block_payload_size;
|
||||||
|
|
||||||
|
const int32 duration_payload_size = GetUIntSize(duration);
|
||||||
|
const int32 duration_size = GetCodedUIntSize(duration_payload_size);
|
||||||
|
const uint64 duration_elem_size = 1 + duration_size + duration_payload_size;
|
||||||
|
|
||||||
|
const uint64 blockg_payload_size = block_elem_size + duration_elem_size;
|
||||||
|
const int32 blockg_size = GetCodedUIntSize(blockg_payload_size);
|
||||||
|
const uint64 blockg_elem_size = 1 + blockg_size + blockg_payload_size;
|
||||||
|
|
||||||
|
if (WriteID(writer, kMkvBlockGroup)) // 1-byte ID size
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (WriteUInt(writer, blockg_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Write Block element
|
||||||
|
|
||||||
|
if (WriteID(writer, kMkvBlock)) // 1-byte ID size
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (WriteUInt(writer, block_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Byte 1 of 4
|
||||||
|
|
||||||
|
if (WriteUInt(writer, track_number))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Bytes 2 & 3 of 4
|
||||||
|
|
||||||
|
if (SerializeInt(writer, timecode, 2))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Byte 4 of 4
|
||||||
|
|
||||||
|
const uint64 flags = 0;
|
||||||
|
|
||||||
|
if (SerializeInt(writer, flags, 1))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Now write the actual frame (of metadata)
|
||||||
|
|
||||||
|
if (writer->Write(data, static_cast<uint32>(length)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Write Duration element
|
||||||
|
|
||||||
|
if (WriteID(writer, kMkvBlockDuration)) // 1-byte ID size
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (WriteUInt(writer, duration_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (SerializeInt(writer, duration, duration_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Note that we don't write a reference time as part of the block
|
||||||
|
// group; no reference time(s) indicates that this block is a
|
||||||
|
// keyframe. (Unlike the case for a SimpleBlock element, the header
|
||||||
|
// bits of the Block sub-element of a BlockGroup element do not
|
||||||
|
// indicate keyframe status. The keyframe status is inferred from
|
||||||
|
// the absence of reference time sub-elements.)
|
||||||
|
|
||||||
|
return blockg_elem_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Writes a WebM BlockGroup with BlockAdditional data. The structure is as
|
||||||
|
// follows:
|
||||||
|
// Indentation shows sub-levels
|
||||||
|
// BlockGroup
|
||||||
|
// Block
|
||||||
|
// Data
|
||||||
|
// BlockAdditions
|
||||||
|
// BlockMore
|
||||||
|
// BlockAddID
|
||||||
|
// 1 (Denotes Alpha)
|
||||||
|
// BlockAdditional
|
||||||
|
// Data
|
||||||
|
uint64 WriteBlockWithAdditional(IMkvWriter* writer, const uint8* data,
|
||||||
|
uint64 length, const uint8* additional,
|
||||||
|
uint64 additional_length, uint64 add_id,
|
||||||
|
uint64 track_number, int64 timecode,
|
||||||
|
uint64 is_key) {
|
||||||
|
if (!data || !additional || length < 1 || additional_length < 1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
const uint64 block_payload_size = 4 + length;
|
||||||
|
const uint64 block_elem_size =
|
||||||
|
EbmlMasterElementSize(kMkvBlock, block_payload_size) + block_payload_size;
|
||||||
|
const uint64 block_additional_elem_size =
|
||||||
|
EbmlElementSize(kMkvBlockAdditional, additional, additional_length);
|
||||||
|
const uint64 block_addid_elem_size = EbmlElementSize(kMkvBlockAddID, add_id);
|
||||||
|
|
||||||
|
const uint64 block_more_payload_size =
|
||||||
|
block_addid_elem_size + block_additional_elem_size;
|
||||||
|
const uint64 block_more_elem_size =
|
||||||
|
EbmlMasterElementSize(kMkvBlockMore, block_more_payload_size) +
|
||||||
|
block_more_payload_size;
|
||||||
|
const uint64 block_additions_payload_size = block_more_elem_size;
|
||||||
|
const uint64 block_additions_elem_size =
|
||||||
|
EbmlMasterElementSize(kMkvBlockAdditions, block_additions_payload_size) +
|
||||||
|
block_additions_payload_size;
|
||||||
|
const uint64 block_group_payload_size =
|
||||||
|
block_elem_size + block_additions_elem_size;
|
||||||
|
const uint64 block_group_elem_size =
|
||||||
|
EbmlMasterElementSize(kMkvBlockGroup, block_group_payload_size) +
|
||||||
|
block_group_payload_size;
|
||||||
|
|
||||||
|
if (!WriteEbmlMasterElement(writer, kMkvBlockGroup, block_group_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!WriteEbmlMasterElement(writer, kMkvBlock, block_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (WriteUInt(writer, track_number))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (SerializeInt(writer, timecode, 2))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
uint64 flags = 0;
|
||||||
|
if (is_key)
|
||||||
|
flags |= 0x80;
|
||||||
|
if (SerializeInt(writer, flags, 1))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (writer->Write(data, static_cast<uint32>(length)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!WriteEbmlMasterElement(writer, kMkvBlockAdditions,
|
||||||
|
block_additions_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!WriteEbmlMasterElement(writer, kMkvBlockMore, block_more_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!WriteEbmlElement(writer, kMkvBlockAddID, add_id))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!WriteEbmlElement(writer, kMkvBlockAdditional, additional,
|
||||||
|
additional_length))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return block_group_elem_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Writes a WebM BlockGroup with DiscardPadding. The structure is as follows:
|
||||||
|
// Indentation shows sub-levels
|
||||||
|
// BlockGroup
|
||||||
|
// Block
|
||||||
|
// Data
|
||||||
|
// DiscardPadding
|
||||||
|
uint64 WriteBlockWithDiscardPadding(IMkvWriter* writer, const uint8* data,
|
||||||
|
uint64 length, int64 discard_padding,
|
||||||
|
uint64 track_number, int64 timecode,
|
||||||
|
uint64 is_key) {
|
||||||
|
if (!data || length < 1 || discard_padding <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
const uint64 block_payload_size = 4 + length;
|
||||||
|
const uint64 block_elem_size =
|
||||||
|
EbmlMasterElementSize(kMkvBlock, block_payload_size) + block_payload_size;
|
||||||
|
const uint64 discard_padding_elem_size =
|
||||||
|
EbmlElementSize(kMkvDiscardPadding, discard_padding);
|
||||||
|
const uint64 block_group_payload_size =
|
||||||
|
block_elem_size + discard_padding_elem_size;
|
||||||
|
const uint64 block_group_elem_size =
|
||||||
|
EbmlMasterElementSize(kMkvBlockGroup, block_group_payload_size) +
|
||||||
|
block_group_payload_size;
|
||||||
|
|
||||||
|
if (!WriteEbmlMasterElement(writer, kMkvBlockGroup, block_group_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!WriteEbmlMasterElement(writer, kMkvBlock, block_payload_size))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (WriteUInt(writer, track_number))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (SerializeInt(writer, timecode, 2))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
uint64 flags = 0;
|
||||||
|
if (is_key)
|
||||||
|
flags |= 0x80;
|
||||||
|
if (SerializeInt(writer, flags, 1))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (writer->Write(data, static_cast<uint32>(length)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (WriteID(writer, kMkvDiscardPadding))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
const uint64 size = GetUIntSize(discard_padding);
|
||||||
|
if (WriteUInt(writer, size))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (SerializeInt(writer, discard_padding, static_cast<int32>(size)))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return block_group_elem_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) {
|
uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) {
|
||||||
@@ -606,7 +698,10 @@ mkvmuxer::uint64 mkvmuxer::MakeUID(unsigned int* seed) {
|
|||||||
// TODO(fgalligan): Move random number generation to platform specific code.
|
// TODO(fgalligan): Move random number generation to platform specific code.
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
(void)seed;
|
(void)seed;
|
||||||
const int32 nn = rand();
|
unsigned int random_value;
|
||||||
|
const errno_t e = rand_s(&random_value);
|
||||||
|
(void)e;
|
||||||
|
const int32 nn = random_value;
|
||||||
#elif __ANDROID__
|
#elif __ANDROID__
|
||||||
int32 temp_num = 1;
|
int32 temp_num = 1;
|
||||||
int fd = open("/dev/urandom", O_RDONLY);
|
int fd = open("/dev/urandom", O_RDONLY);
|
||||||
|
70
third_party/libwebm/mkvmuxerutil.hpp
vendored
70
third_party/libwebm/mkvmuxerutil.hpp
vendored
@@ -9,7 +9,6 @@
|
|||||||
#ifndef MKVMUXERUTIL_HPP
|
#ifndef MKVMUXERUTIL_HPP
|
||||||
#define MKVMUXERUTIL_HPP
|
#define MKVMUXERUTIL_HPP
|
||||||
|
|
||||||
#include "mkvmuxer.hpp"
|
|
||||||
#include "mkvmuxertypes.hpp"
|
#include "mkvmuxertypes.hpp"
|
||||||
|
|
||||||
namespace mkvmuxer {
|
namespace mkvmuxer {
|
||||||
@@ -24,7 +23,6 @@ int32 SerializeInt(IMkvWriter* writer, int64 value, int32 size);
|
|||||||
|
|
||||||
// Returns the size in bytes of the element.
|
// Returns the size in bytes of the element.
|
||||||
int32 GetUIntSize(uint64 value);
|
int32 GetUIntSize(uint64 value);
|
||||||
int32 GetIntSize(int64 value);
|
|
||||||
int32 GetCodedUIntSize(uint64 value);
|
int32 GetCodedUIntSize(uint64 value);
|
||||||
uint64 EbmlMasterElementSize(uint64 type, uint64 value);
|
uint64 EbmlMasterElementSize(uint64 type, uint64 value);
|
||||||
uint64 EbmlElementSize(uint64 type, int64 value);
|
uint64 EbmlElementSize(uint64 type, int64 value);
|
||||||
@@ -32,7 +30,7 @@ uint64 EbmlElementSize(uint64 type, uint64 value);
|
|||||||
uint64 EbmlElementSize(uint64 type, float value);
|
uint64 EbmlElementSize(uint64 type, float value);
|
||||||
uint64 EbmlElementSize(uint64 type, const char* value);
|
uint64 EbmlElementSize(uint64 type, const char* value);
|
||||||
uint64 EbmlElementSize(uint64 type, const uint8* value, uint64 size);
|
uint64 EbmlElementSize(uint64 type, const uint8* value, uint64 size);
|
||||||
uint64 EbmlDateElementSize(uint64 type);
|
uint64 EbmlDateElementSize(uint64 type, int64 value);
|
||||||
|
|
||||||
// Creates an EBML coded number from |value| and writes it out. The size of
|
// Creates an EBML coded number from |value| and writes it out. The size of
|
||||||
// the coded number is determined by the value of |value|. |value| must not
|
// the coded number is determined by the value of |value|. |value| must not
|
||||||
@@ -53,17 +51,73 @@ int32 WriteID(IMkvWriter* writer, uint64 type);
|
|||||||
|
|
||||||
// Output an Mkv non-master element. Returns true if the element was written.
|
// Output an Mkv non-master element. Returns true if the element was written.
|
||||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value);
|
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value);
|
||||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, int64 value);
|
|
||||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value);
|
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value);
|
||||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const char* value);
|
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const char* value);
|
||||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const uint8* value,
|
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const uint8* value,
|
||||||
uint64 size);
|
uint64 size);
|
||||||
bool WriteEbmlDateElement(IMkvWriter* writer, uint64 type, int64 value);
|
bool WriteEbmlDateElement(IMkvWriter* writer, uint64 type, int64 value);
|
||||||
|
|
||||||
// Output a Mkv Frame. It decides the correct element to write (Block vs
|
// Output an Mkv Simple Block.
|
||||||
// SimpleBlock) based on the parameters of the Frame.
|
// Inputs:
|
||||||
uint64 WriteFrame(IMkvWriter* writer, const Frame* const frame,
|
// data: Pointer to the data.
|
||||||
Cluster* cluster);
|
// length: Length of the data.
|
||||||
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
|
// functions. Only values in the range [1, 126] are
|
||||||
|
// permitted.
|
||||||
|
// timecode: Relative timecode of the Block. Only values in the
|
||||||
|
// range [0, 2^15) are permitted.
|
||||||
|
// is_key: Non-zero value specifies that frame is a key frame.
|
||||||
|
uint64 WriteSimpleBlock(IMkvWriter* writer, const uint8* data, uint64 length,
|
||||||
|
uint64 track_number, int64 timecode, uint64 is_key);
|
||||||
|
|
||||||
|
// Output a metadata keyframe, using a Block Group element.
|
||||||
|
// Inputs:
|
||||||
|
// data: Pointer to the (meta)data.
|
||||||
|
// length: Length of the (meta)data.
|
||||||
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
|
// functions. Only values in the range [1, 126] are
|
||||||
|
// permitted.
|
||||||
|
// timecode Timecode of frame, relative to cluster timecode. Only
|
||||||
|
// values in the range [0, 2^15) are permitted.
|
||||||
|
// duration_timecode Duration of frame, using timecode units.
|
||||||
|
uint64 WriteMetadataBlock(IMkvWriter* writer, const uint8* data, uint64 length,
|
||||||
|
uint64 track_number, int64 timecode,
|
||||||
|
uint64 duration_timecode);
|
||||||
|
|
||||||
|
// Output an Mkv Block with BlockAdditional data.
|
||||||
|
// Inputs:
|
||||||
|
// data: Pointer to the data.
|
||||||
|
// length: Length of the data.
|
||||||
|
// additional: Pointer to the additional data
|
||||||
|
// additional_length: Length of the additional data.
|
||||||
|
// add_id: Value of BlockAddID element.
|
||||||
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
|
// functions. Only values in the range [1, 126] are
|
||||||
|
// permitted.
|
||||||
|
// timecode: Relative timecode of the Block. Only values in the
|
||||||
|
// range [0, 2^15) are permitted.
|
||||||
|
// is_key: Non-zero value specifies that frame is a key frame.
|
||||||
|
uint64 WriteBlockWithAdditional(IMkvWriter* writer, const uint8* data,
|
||||||
|
uint64 length, const uint8* additional,
|
||||||
|
uint64 additional_length, uint64 add_id,
|
||||||
|
uint64 track_number, int64 timecode,
|
||||||
|
uint64 is_key);
|
||||||
|
|
||||||
|
// Output an Mkv Block with a DiscardPadding element.
|
||||||
|
// Inputs:
|
||||||
|
// data: Pointer to the data.
|
||||||
|
// length: Length of the data.
|
||||||
|
// discard_padding: DiscardPadding value.
|
||||||
|
// track_number: Track to add the data to. Value returned by Add track
|
||||||
|
// functions. Only values in the range [1, 126] are
|
||||||
|
// permitted.
|
||||||
|
// timecode: Relative timecode of the Block. Only values in the
|
||||||
|
// range [0, 2^15) are permitted.
|
||||||
|
// is_key: Non-zero value specifies that frame is a key frame.
|
||||||
|
uint64 WriteBlockWithDiscardPadding(IMkvWriter* writer, const uint8* data,
|
||||||
|
uint64 length, int64 discard_padding,
|
||||||
|
uint64 track_number, int64 timecode,
|
||||||
|
uint64 is_key);
|
||||||
|
|
||||||
// Output a void element. |size| must be the entire size in bytes that will be
|
// Output a void element. |size| must be the entire size in bytes that will be
|
||||||
// void. The function will calculate the size of the void header and subtract
|
// void. The function will calculate the size of the void header and subtract
|
||||||
|
3164
third_party/libwebm/mkvparser.cpp
vendored
3164
third_party/libwebm/mkvparser.cpp
vendored
File diff suppressed because it is too large
Load Diff
128
third_party/libwebm/mkvparser.hpp
vendored
128
third_party/libwebm/mkvparser.hpp
vendored
@@ -9,13 +9,12 @@
|
|||||||
#ifndef MKVPARSER_HPP
|
#ifndef MKVPARSER_HPP
|
||||||
#define MKVPARSER_HPP
|
#define MKVPARSER_HPP
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
namespace mkvparser {
|
namespace mkvparser {
|
||||||
|
|
||||||
const int E_PARSE_FAILED = -1;
|
|
||||||
const int E_FILE_FORMAT_INVALID = -2;
|
const int E_FILE_FORMAT_INVALID = -2;
|
||||||
const int E_BUFFER_NOT_FULL = -3;
|
const int E_BUFFER_NOT_FULL = -3;
|
||||||
|
|
||||||
@@ -28,16 +27,12 @@ class IMkvReader {
|
|||||||
virtual ~IMkvReader();
|
virtual ~IMkvReader();
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Type> Type* SafeArrayAlloc(unsigned long long num_elements,
|
|
||||||
unsigned long long element_size);
|
|
||||||
long long GetUIntLength(IMkvReader*, long long, long&);
|
long long GetUIntLength(IMkvReader*, long long, long&);
|
||||||
long long ReadUInt(IMkvReader*, long long, long&);
|
long long ReadUInt(IMkvReader*, long long, long&);
|
||||||
long long ReadID(IMkvReader* pReader, long long pos, long& len);
|
|
||||||
long long UnserializeUInt(IMkvReader*, long long pos, long long size);
|
long long UnserializeUInt(IMkvReader*, long long pos, long long size);
|
||||||
|
|
||||||
long UnserializeFloat(IMkvReader*, long long pos, long long size, double&);
|
long UnserializeFloat(IMkvReader*, long long pos, long long size, double&);
|
||||||
long UnserializeInt(IMkvReader*, long long pos, long long size,
|
long UnserializeInt(IMkvReader*, long long pos, long len, long long& result);
|
||||||
long long& result);
|
|
||||||
|
|
||||||
long UnserializeString(IMkvReader*, long long pos, long long size, char*& str);
|
long UnserializeString(IMkvReader*, long long pos, long long size, char*& str);
|
||||||
|
|
||||||
@@ -403,10 +398,6 @@ class VideoTrack : public Track {
|
|||||||
|
|
||||||
long long GetWidth() const;
|
long long GetWidth() const;
|
||||||
long long GetHeight() const;
|
long long GetHeight() const;
|
||||||
long long GetDisplayWidth() const;
|
|
||||||
long long GetDisplayHeight() const;
|
|
||||||
long long GetDisplayUnit() const;
|
|
||||||
long long GetStereoMode() const;
|
|
||||||
double GetFrameRate() const;
|
double GetFrameRate() const;
|
||||||
|
|
||||||
bool VetEntry(const BlockEntry*) const;
|
bool VetEntry(const BlockEntry*) const;
|
||||||
@@ -415,11 +406,6 @@ class VideoTrack : public Track {
|
|||||||
private:
|
private:
|
||||||
long long m_width;
|
long long m_width;
|
||||||
long long m_height;
|
long long m_height;
|
||||||
long long m_display_width;
|
|
||||||
long long m_display_height;
|
|
||||||
long long m_display_unit;
|
|
||||||
long long m_stereo_mode;
|
|
||||||
|
|
||||||
double m_rate;
|
double m_rate;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -596,85 +582,6 @@ class Chapters {
|
|||||||
int m_editions_count;
|
int m_editions_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Tags {
|
|
||||||
Tags(const Tags&);
|
|
||||||
Tags& operator=(const Tags&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
Segment* const m_pSegment;
|
|
||||||
const long long m_start;
|
|
||||||
const long long m_size;
|
|
||||||
const long long m_element_start;
|
|
||||||
const long long m_element_size;
|
|
||||||
|
|
||||||
Tags(Segment*, long long payload_start, long long payload_size,
|
|
||||||
long long element_start, long long element_size);
|
|
||||||
|
|
||||||
~Tags();
|
|
||||||
|
|
||||||
long Parse();
|
|
||||||
|
|
||||||
class Tag;
|
|
||||||
class SimpleTag;
|
|
||||||
|
|
||||||
class SimpleTag {
|
|
||||||
friend class Tag;
|
|
||||||
SimpleTag();
|
|
||||||
SimpleTag(const SimpleTag&);
|
|
||||||
~SimpleTag();
|
|
||||||
SimpleTag& operator=(const SimpleTag&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
const char* GetTagName() const;
|
|
||||||
const char* GetTagString() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void Init();
|
|
||||||
void ShallowCopy(SimpleTag&) const;
|
|
||||||
void Clear();
|
|
||||||
long Parse(IMkvReader*, long long pos, long long size);
|
|
||||||
|
|
||||||
char* m_tag_name;
|
|
||||||
char* m_tag_string;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Tag {
|
|
||||||
friend class Tags;
|
|
||||||
Tag();
|
|
||||||
Tag(const Tag&);
|
|
||||||
~Tag();
|
|
||||||
Tag& operator=(const Tag&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
int GetSimpleTagCount() const;
|
|
||||||
const SimpleTag* GetSimpleTag(int index) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void Init();
|
|
||||||
void ShallowCopy(Tag&) const;
|
|
||||||
void Clear();
|
|
||||||
long Parse(IMkvReader*, long long pos, long long size);
|
|
||||||
|
|
||||||
long ParseSimpleTag(IMkvReader*, long long pos, long long size);
|
|
||||||
bool ExpandSimpleTagsArray();
|
|
||||||
|
|
||||||
SimpleTag* m_simple_tags;
|
|
||||||
int m_simple_tags_size;
|
|
||||||
int m_simple_tags_count;
|
|
||||||
};
|
|
||||||
|
|
||||||
int GetTagCount() const;
|
|
||||||
const Tag* GetTag(int index) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
long ParseTag(long long pos, long long size);
|
|
||||||
bool ExpandTagsArray();
|
|
||||||
|
|
||||||
Tag* m_tags;
|
|
||||||
int m_tags_size;
|
|
||||||
int m_tags_count;
|
|
||||||
};
|
|
||||||
|
|
||||||
class SegmentInfo {
|
class SegmentInfo {
|
||||||
SegmentInfo(const SegmentInfo&);
|
SegmentInfo(const SegmentInfo&);
|
||||||
SegmentInfo& operator=(const SegmentInfo&);
|
SegmentInfo& operator=(const SegmentInfo&);
|
||||||
@@ -777,7 +684,7 @@ class CuePoint {
|
|||||||
long long m_element_start;
|
long long m_element_start;
|
||||||
long long m_element_size;
|
long long m_element_size;
|
||||||
|
|
||||||
bool Load(IMkvReader*);
|
void Load(IMkvReader*);
|
||||||
|
|
||||||
long long GetTimeCode() const; // absolute but unscaled
|
long long GetTimeCode() const; // absolute but unscaled
|
||||||
long long GetTime(const Segment*) const; // absolute and scaled (ns units)
|
long long GetTime(const Segment*) const; // absolute and scaled (ns units)
|
||||||
@@ -790,7 +697,7 @@ class CuePoint {
|
|||||||
// reference = clusters containing req'd referenced blocks
|
// reference = clusters containing req'd referenced blocks
|
||||||
// reftime = timecode of the referenced block
|
// reftime = timecode of the referenced block
|
||||||
|
|
||||||
bool Parse(IMkvReader*, long long, long long);
|
void Parse(IMkvReader*, long long, long long);
|
||||||
};
|
};
|
||||||
|
|
||||||
const TrackPosition* Find(const Track*) const;
|
const TrackPosition* Find(const Track*) const;
|
||||||
@@ -823,6 +730,14 @@ class Cues {
|
|||||||
long long time_ns, const Track*, const CuePoint*&,
|
long long time_ns, const Track*, const CuePoint*&,
|
||||||
const CuePoint::TrackPosition*&) const;
|
const CuePoint::TrackPosition*&) const;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
bool FindNext( //upper_bound of time_ns
|
||||||
|
long long time_ns,
|
||||||
|
const Track*,
|
||||||
|
const CuePoint*&,
|
||||||
|
const CuePoint::TrackPosition*&) const;
|
||||||
|
#endif
|
||||||
|
|
||||||
const CuePoint* GetFirst() const;
|
const CuePoint* GetFirst() const;
|
||||||
const CuePoint* GetLast() const;
|
const CuePoint* GetLast() const;
|
||||||
const CuePoint* GetNext(const CuePoint*) const;
|
const CuePoint* GetNext(const CuePoint*) const;
|
||||||
@@ -836,8 +751,8 @@ class Cues {
|
|||||||
bool DoneParsing() const;
|
bool DoneParsing() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool Init() const;
|
void Init() const;
|
||||||
bool PreloadCuePoint(long&, long long) const;
|
void PreloadCuePoint(long&, long long) const;
|
||||||
|
|
||||||
mutable CuePoint** m_cue_points;
|
mutable CuePoint** m_cue_points;
|
||||||
mutable long m_count;
|
mutable long m_count;
|
||||||
@@ -962,12 +877,18 @@ class Segment {
|
|||||||
long ParseNext(const Cluster* pCurr, const Cluster*& pNext, long long& pos,
|
long ParseNext(const Cluster* pCurr, const Cluster*& pNext, long long& pos,
|
||||||
long& size);
|
long& size);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
//This pair parses one cluster, but only changes the state of the
|
||||||
|
//segment object when the cluster is actually added to the index.
|
||||||
|
long ParseCluster(long long& cluster_pos, long long& new_pos) const;
|
||||||
|
bool AddCluster(long long cluster_pos, long long new_pos);
|
||||||
|
#endif
|
||||||
|
|
||||||
const SeekHead* GetSeekHead() const;
|
const SeekHead* GetSeekHead() const;
|
||||||
const Tracks* GetTracks() const;
|
const Tracks* GetTracks() const;
|
||||||
const SegmentInfo* GetInfo() const;
|
const SegmentInfo* GetInfo() const;
|
||||||
const Cues* GetCues() const;
|
const Cues* GetCues() const;
|
||||||
const Chapters* GetChapters() const;
|
const Chapters* GetChapters() const;
|
||||||
const Tags* GetTags() const;
|
|
||||||
|
|
||||||
long long GetDuration() const;
|
long long GetDuration() const;
|
||||||
|
|
||||||
@@ -993,7 +914,6 @@ class Segment {
|
|||||||
Tracks* m_pTracks;
|
Tracks* m_pTracks;
|
||||||
Cues* m_pCues;
|
Cues* m_pCues;
|
||||||
Chapters* m_pChapters;
|
Chapters* m_pChapters;
|
||||||
Tags* m_pTags;
|
|
||||||
Cluster** m_clusters;
|
Cluster** m_clusters;
|
||||||
long m_clusterCount; // number of entries for which m_index >= 0
|
long m_clusterCount; // number of entries for which m_index >= 0
|
||||||
long m_clusterPreloadCount; // number of entries for which m_index < 0
|
long m_clusterPreloadCount; // number of entries for which m_index < 0
|
||||||
@@ -1003,8 +923,8 @@ class Segment {
|
|||||||
long DoLoadClusterUnknownSize(long long&, long&);
|
long DoLoadClusterUnknownSize(long long&, long&);
|
||||||
long DoParseNext(const Cluster*&, long long&, long&);
|
long DoParseNext(const Cluster*&, long long&, long&);
|
||||||
|
|
||||||
bool AppendCluster(Cluster*);
|
void AppendCluster(Cluster*);
|
||||||
bool PreloadCluster(Cluster*, ptrdiff_t);
|
void PreloadCluster(Cluster*, ptrdiff_t);
|
||||||
|
|
||||||
// void ParseSeekHead(long long pos, long long size);
|
// void ParseSeekHead(long long pos, long long size);
|
||||||
// void ParseSeekEntry(long long pos, long long size);
|
// void ParseSeekEntry(long long pos, long long size);
|
||||||
|
16
third_party/libwebm/webmids.hpp
vendored
16
third_party/libwebm/webmids.hpp
vendored
@@ -41,7 +41,6 @@ enum MkvId {
|
|||||||
kMkvTimecodeScale = 0x2AD7B1,
|
kMkvTimecodeScale = 0x2AD7B1,
|
||||||
kMkvDuration = 0x4489,
|
kMkvDuration = 0x4489,
|
||||||
kMkvDateUTC = 0x4461,
|
kMkvDateUTC = 0x4461,
|
||||||
kMkvTitle = 0x7BA9,
|
|
||||||
kMkvMuxingApp = 0x4D80,
|
kMkvMuxingApp = 0x4D80,
|
||||||
kMkvWritingApp = 0x5741,
|
kMkvWritingApp = 0x5741,
|
||||||
// Cluster
|
// Cluster
|
||||||
@@ -108,16 +107,9 @@ enum MkvId {
|
|||||||
kMkvContentEncodingOrder = 0x5031,
|
kMkvContentEncodingOrder = 0x5031,
|
||||||
kMkvContentEncodingScope = 0x5032,
|
kMkvContentEncodingScope = 0x5032,
|
||||||
kMkvContentEncodingType = 0x5033,
|
kMkvContentEncodingType = 0x5033,
|
||||||
kMkvContentCompression = 0x5034,
|
|
||||||
kMkvContentCompAlgo = 0x4254,
|
|
||||||
kMkvContentCompSettings = 0x4255,
|
|
||||||
kMkvContentEncryption = 0x5035,
|
kMkvContentEncryption = 0x5035,
|
||||||
kMkvContentEncAlgo = 0x47E1,
|
kMkvContentEncAlgo = 0x47E1,
|
||||||
kMkvContentEncKeyID = 0x47E2,
|
kMkvContentEncKeyID = 0x47E2,
|
||||||
kMkvContentSignature = 0x47E3,
|
|
||||||
kMkvContentSigKeyID = 0x47E4,
|
|
||||||
kMkvContentSigAlgo = 0x47E5,
|
|
||||||
kMkvContentSigHashAlgo = 0x47E6,
|
|
||||||
kMkvContentEncAESSettings = 0x47E7,
|
kMkvContentEncAESSettings = 0x47E7,
|
||||||
kMkvAESSettingsCipherMode = 0x47E8,
|
kMkvAESSettingsCipherMode = 0x47E8,
|
||||||
kMkvAESSettingsCipherInitData = 0x47E9,
|
kMkvAESSettingsCipherInitData = 0x47E9,
|
||||||
@@ -141,13 +133,7 @@ enum MkvId {
|
|||||||
kMkvChapterDisplay = 0x80,
|
kMkvChapterDisplay = 0x80,
|
||||||
kMkvChapString = 0x85,
|
kMkvChapString = 0x85,
|
||||||
kMkvChapLanguage = 0x437C,
|
kMkvChapLanguage = 0x437C,
|
||||||
kMkvChapCountry = 0x437E,
|
kMkvChapCountry = 0x437E
|
||||||
// Tags
|
|
||||||
kMkvTags = 0x1254C367,
|
|
||||||
kMkvTag = 0x7373,
|
|
||||||
kMkvSimpleTag = 0x67C8,
|
|
||||||
kMkvTagName = 0x45A3,
|
|
||||||
kMkvTagString = 0x4487
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace mkvmuxer
|
} // end namespace mkvmuxer
|
||||||
|
3
third_party/libyuv/README.libvpx
vendored
3
third_party/libyuv/README.libvpx
vendored
@@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 1456
|
Version: 1305
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
@@ -13,3 +13,4 @@ which down-samples the original input video (f.g. 1280x720) a number of times
|
|||||||
in order to encode multiple resolution bit streams.
|
in order to encode multiple resolution bit streams.
|
||||||
|
|
||||||
Local Modifications:
|
Local Modifications:
|
||||||
|
cherry pick r1311 'disable nv12 avx2 for vs9/10 that dont support avx2 instructions.'
|
||||||
|
2
third_party/libyuv/include/libyuv/convert.h
vendored
2
third_party/libyuv/include/libyuv/convert.h
vendored
@@ -71,8 +71,6 @@ int I400ToI420(const uint8* src_y, int src_stride_y,
|
|||||||
uint8* dst_v, int dst_stride_v,
|
uint8* dst_v, int dst_stride_v,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
#define J400ToJ420 I400ToI420
|
|
||||||
|
|
||||||
// Convert NV12 to I420.
|
// Convert NV12 to I420.
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
int NV12ToI420(const uint8* src_y, int src_stride_y,
|
int NV12ToI420(const uint8* src_y, int src_stride_y,
|
||||||
|
12
third_party/libyuv/include/libyuv/convert_argb.h
vendored
12
third_party/libyuv/include/libyuv/convert_argb.h
vendored
@@ -68,21 +68,21 @@ int I411ToARGB(const uint8* src_y, int src_stride_y,
|
|||||||
uint8* dst_argb, int dst_stride_argb,
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// Convert I400 (grey) to ARGB. Reverse of ARGBToI400.
|
// Convert I400 (grey) to ARGB.
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
int I400ToARGB(const uint8* src_y, int src_stride_y,
|
int I400ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
uint8* dst_argb, int dst_stride_argb,
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// Convert J400 (jpeg grey) to ARGB.
|
// Alias.
|
||||||
|
#define YToARGB I400ToARGB_Reference
|
||||||
|
|
||||||
|
// Convert I400 to ARGB. Reverse of ARGBToI400.
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
int J400ToARGB(const uint8* src_y, int src_stride_y,
|
int I400ToARGB_Reference(const uint8* src_y, int src_stride_y,
|
||||||
uint8* dst_argb, int dst_stride_argb,
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// Alias.
|
|
||||||
#define YToARGB I400ToARGB
|
|
||||||
|
|
||||||
// Convert NV12 to ARGB.
|
// Convert NV12 to ARGB.
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
int NV12ToARGB(const uint8* src_y, int src_stride_y,
|
int NV12ToARGB(const uint8* src_y, int src_stride_y,
|
||||||
|
11
third_party/libyuv/include/libyuv/convert_from.h
vendored
11
third_party/libyuv/include/libyuv/convert_from.h
vendored
@@ -137,17 +137,6 @@ int I420ToRGB565(const uint8* src_y, int src_stride_y,
|
|||||||
uint8* dst_frame, int dst_stride_frame,
|
uint8* dst_frame, int dst_stride_frame,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// Convert I420 To RGB565 with 4x4 dither matrix (16 bytes).
|
|
||||||
// Values in dither matrix from 0 to 7 recommended.
|
|
||||||
// The order of the dither matrix is first byte is upper left.
|
|
||||||
|
|
||||||
LIBYUV_API
|
|
||||||
int I420ToRGB565Dither(const uint8* src_y, int src_stride_y,
|
|
||||||
const uint8* src_u, int src_stride_u,
|
|
||||||
const uint8* src_v, int src_stride_v,
|
|
||||||
uint8* dst_frame, int dst_stride_frame,
|
|
||||||
const uint8* dither4x4, int width, int height);
|
|
||||||
|
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
int I420ToARGB1555(const uint8* src_y, int src_stride_y,
|
int I420ToARGB1555(const uint8* src_y, int src_stride_y,
|
||||||
const uint8* src_u, int src_stride_u,
|
const uint8* src_u, int src_stride_u,
|
||||||
|
@@ -61,15 +61,12 @@ int ARGBToRGB565(const uint8* src_argb, int src_stride_argb,
|
|||||||
uint8* dst_rgb565, int dst_stride_rgb565,
|
uint8* dst_rgb565, int dst_stride_rgb565,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// Convert ARGB To RGB565 with 4x4 dither matrix (16 bytes).
|
// Convert ARGB To RGB565 with 8x8 dither matrix (64 bytes).
|
||||||
// Values in dither matrix from 0 to 7 recommended.
|
// Values in dither matrix from 0 to 255. 128 is best for no dither.
|
||||||
// The order of the dither matrix is first byte is upper left.
|
|
||||||
// TODO(fbarchard): Consider pointer to 2d array for dither4x4.
|
|
||||||
// const uint8(*dither)[4][4];
|
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb,
|
int ARGBToRGB565Dither(const uint8* src_argb, int src_stride_argb,
|
||||||
uint8* dst_rgb565, int dst_stride_rgb565,
|
uint8* dst_rgb565, int dst_stride_rgb565,
|
||||||
const uint8* dither4x4, int width, int height);
|
const uint8* dither8x8, int width, int height);
|
||||||
|
|
||||||
// Convert ARGB To ARGB1555.
|
// Convert ARGB To ARGB1555.
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
@@ -143,12 +140,6 @@ int ARGBToI400(const uint8* src_argb, int src_stride_argb,
|
|||||||
uint8* dst_y, int dst_stride_y,
|
uint8* dst_y, int dst_stride_y,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// Convert ARGB to G. (Reverse of J400toARGB, which replicates G back to ARGB)
|
|
||||||
LIBYUV_API
|
|
||||||
int ARGBToG(const uint8* src_argb, int src_stride_argb,
|
|
||||||
uint8* dst_g, int dst_stride_g,
|
|
||||||
int width, int height);
|
|
||||||
|
|
||||||
// Convert ARGB To NV12.
|
// Convert ARGB To NV12.
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
int ARGBToNV12(const uint8* src_argb, int src_stride_argb,
|
int ARGBToNV12(const uint8* src_argb, int src_stride_argb,
|
||||||
|
@@ -45,7 +45,6 @@ int I400ToI400(const uint8* src_y, int src_stride_y,
|
|||||||
uint8* dst_y, int dst_stride_y,
|
uint8* dst_y, int dst_stride_y,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
#define J400ToJ400 I400ToI400
|
|
||||||
|
|
||||||
// Copy I422 to I422.
|
// Copy I422 to I422.
|
||||||
#define I422ToI422 I422Copy
|
#define I422ToI422 I422Copy
|
||||||
@@ -85,18 +84,6 @@ int UYVYToI422(const uint8* src_uyvy, int src_stride_uyvy,
|
|||||||
uint8* dst_v, int dst_stride_v,
|
uint8* dst_v, int dst_stride_v,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
LIBYUV_API
|
|
||||||
int YUY2ToNV12(const uint8* src_yuy2, int src_stride_yuy2,
|
|
||||||
uint8* dst_y, int dst_stride_y,
|
|
||||||
uint8* dst_uv, int dst_stride_uv,
|
|
||||||
int width, int height);
|
|
||||||
|
|
||||||
LIBYUV_API
|
|
||||||
int UYVYToNV12(const uint8* src_uyvy, int src_stride_uyvy,
|
|
||||||
uint8* dst_y, int dst_stride_y,
|
|
||||||
uint8* dst_uv, int dst_stride_uv,
|
|
||||||
int width, int height);
|
|
||||||
|
|
||||||
// Convert I420 to I400. (calls CopyPlane ignoring u/v).
|
// Convert I420 to I400. (calls CopyPlane ignoring u/v).
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
int I420ToI400(const uint8* src_y, int src_stride_y,
|
int I420ToI400(const uint8* src_y, int src_stride_y,
|
||||||
@@ -106,7 +93,6 @@ int I420ToI400(const uint8* src_y, int src_stride_y,
|
|||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
// Alias
|
// Alias
|
||||||
#define J420ToJ400 I420ToI400
|
|
||||||
#define I420ToI420Mirror I420Mirror
|
#define I420ToI420Mirror I420Mirror
|
||||||
|
|
||||||
// I420 mirror.
|
// I420 mirror.
|
||||||
@@ -401,24 +387,24 @@ int ARGBInterpolate(const uint8* src_argb0, int src_stride_argb0,
|
|||||||
uint8* dst_argb, int dst_stride_argb,
|
uint8* dst_argb, int dst_stride_argb,
|
||||||
int width, int height, int interpolation);
|
int width, int height, int interpolation);
|
||||||
|
|
||||||
#if defined(__pnacl__) || defined(__CLR_VER) || \
|
#if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \
|
||||||
(defined(__i386__) && !defined(__SSE2__))
|
defined(TARGET_IPHONE_SIMULATOR)
|
||||||
#define LIBYUV_DISABLE_X86
|
#define LIBYUV_DISABLE_X86
|
||||||
#endif
|
#endif
|
||||||
// The following are available on all x86 platforms:
|
|
||||||
#if !defined(LIBYUV_DISABLE_X86) && \
|
|
||||||
(defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
|
|
||||||
#define HAS_ARGBAFFINEROW_SSE2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Row function for copying pixels from a source with a slope to a row
|
// Row functions for copying a pixels from a source with a slope to a row
|
||||||
// of destination. Useful for scaling, rotation, mirror, texture mapping.
|
// of destination. Useful for scaling, rotation, mirror, texture mapping.
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
|
void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride,
|
||||||
uint8* dst_argb, const float* uv_dudv, int width);
|
uint8* dst_argb, const float* uv_dudv, int width);
|
||||||
|
// The following are available on all x86 platforms:
|
||||||
|
#if !defined(LIBYUV_DISABLE_X86) && \
|
||||||
|
(defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
|
||||||
LIBYUV_API
|
LIBYUV_API
|
||||||
void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride,
|
void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride,
|
||||||
uint8* dst_argb, const float* uv_dudv, int width);
|
uint8* dst_argb, const float* uv_dudv, int width);
|
||||||
|
#define HAS_ARGBAFFINEROW_SSE2
|
||||||
|
#endif // LIBYUV_DISABLE_X86
|
||||||
|
|
||||||
// Shuffle ARGB channel order. e.g. BGRA to ARGB.
|
// Shuffle ARGB channel order. e.g. BGRA to ARGB.
|
||||||
// shuffler is 16 bytes and must be aligned.
|
// shuffler is 16 bytes and must be aligned.
|
||||||
|
138
third_party/libyuv/include/libyuv/rotate_row.h
vendored
138
third_party/libyuv/include/libyuv/rotate_row.h
vendored
@@ -1,138 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 The LibYuv 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INCLUDE_LIBYUV_ROTATE_ROW_H_ // NOLINT
|
|
||||||
#define INCLUDE_LIBYUV_ROTATE_ROW_H_
|
|
||||||
|
|
||||||
#include "libyuv/basic_types.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
namespace libyuv {
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__pnacl__) || defined(__CLR_VER) || \
|
|
||||||
(defined(__i386__) && !defined(__SSE2__))
|
|
||||||
#define LIBYUV_DISABLE_X86
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Visual C 2012 required for AVX2.
|
|
||||||
#if defined(_M_IX86) && !defined(__clang__) && \
|
|
||||||
defined(_MSC_VER) && _MSC_VER >= 1700
|
|
||||||
#define VISUALC_HAS_AVX2 1
|
|
||||||
#endif // VisualStudio >= 2012
|
|
||||||
|
|
||||||
// TODO(fbarchard): switch to standard form of inline; fails on clangcl.
|
|
||||||
#if !defined(LIBYUV_DISABLE_X86) && \
|
|
||||||
(defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
|
|
||||||
#if defined(__APPLE__) && defined(__i386__)
|
|
||||||
#define DECLARE_FUNCTION(name) \
|
|
||||||
".text \n" \
|
|
||||||
".private_extern _" #name " \n" \
|
|
||||||
".align 4,0x90 \n" \
|
|
||||||
"_" #name ": \n"
|
|
||||||
#elif defined(__MINGW32__) || defined(__CYGWIN__) && defined(__i386__)
|
|
||||||
#define DECLARE_FUNCTION(name) \
|
|
||||||
".text \n" \
|
|
||||||
".align 4,0x90 \n" \
|
|
||||||
"_" #name ": \n"
|
|
||||||
#else
|
|
||||||
#define DECLARE_FUNCTION(name) \
|
|
||||||
".text \n" \
|
|
||||||
".align 4,0x90 \n" \
|
|
||||||
#name ": \n"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The following are available for Visual C:
|
|
||||||
#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
|
|
||||||
defined(_MSC_VER) && !defined(__clang__)
|
|
||||||
#define HAS_TRANSPOSEWX8_SSSE3
|
|
||||||
#define HAS_TRANSPOSEUVWX8_SSE2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The following are available for GCC but not NaCL:
|
|
||||||
#if !defined(LIBYUV_DISABLE_X86) && \
|
|
||||||
(defined(__i386__) || (defined(__x86_64__) && !defined(__native_client__)))
|
|
||||||
#define HAS_TRANSPOSEWX8_SSSE3
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The following are available for 32 bit GCC:
|
|
||||||
#if !defined(LIBYUV_DISABLE_X86) && defined(__i386__) && !defined(__clang__)
|
|
||||||
#define HAS_TRANSPOSEUVWX8_SSE2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The following are available for 64 bit GCC but not NaCL:
|
|
||||||
#if !defined(LIBYUV_DISABLE_X86) && !defined(__native_client__) && \
|
|
||||||
defined(__x86_64__)
|
|
||||||
#define HAS_TRANSPOSEWX8_FAST_SSSE3
|
|
||||||
#define HAS_TRANSPOSEUVWX8_SSE2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \
|
|
||||||
(defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
|
|
||||||
#define HAS_TRANSPOSEWX8_NEON
|
|
||||||
#define HAS_TRANSPOSEUVWX8_NEON
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \
|
|
||||||
defined(__mips__) && \
|
|
||||||
defined(__mips_dsp) && (__mips_dsp_rev >= 2)
|
|
||||||
#define HAS_TRANSPOSEWX8_MIPS_DSPR2
|
|
||||||
#define HAS_TRANSPOSEUVWx8_MIPS_DSPR2
|
|
||||||
#endif // defined(__mips__)
|
|
||||||
|
|
||||||
void TransposeWxH_C(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width, int height);
|
|
||||||
|
|
||||||
void TransposeWx8_C(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
void TransposeWx8_NEON(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
void TransposeWx8_SSSE3(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
void TransposeWx8_Fast_SSSE3(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
void TransposeWx8_MIPS_DSPR2(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
|
|
||||||
void TransposeWx8_Any_NEON(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
void TransposeWx8_Any_SSSE3(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
void TransposeWx8_Fast_Any_SSSE3(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
void TransposeWx8_Any_MIPS_DSPR2(const uint8* src, int src_stride,
|
|
||||||
uint8* dst, int dst_stride, int width);
|
|
||||||
|
|
||||||
void TransposeUVWxH_C(const uint8* src, int src_stride,
|
|
||||||
uint8* dst_a, int dst_stride_a,
|
|
||||||
uint8* dst_b, int dst_stride_b,
|
|
||||||
int width, int height);
|
|
||||||
|
|
||||||
void TransposeUVWx8_C(const uint8* src, int src_stride,
|
|
||||||
uint8* dst_a, int dst_stride_a,
|
|
||||||
uint8* dst_b, int dst_stride_b, int width);
|
|
||||||
void TransposeUVWx8_SSE2(const uint8* src, int src_stride,
|
|
||||||
uint8* dst_a, int dst_stride_a,
|
|
||||||
uint8* dst_b, int dst_stride_b, int width);
|
|
||||||
void TransposeUVWx8_NEON(const uint8* src, int src_stride,
|
|
||||||
uint8* dst_a, int dst_stride_a,
|
|
||||||
uint8* dst_b, int dst_stride_b, int width);
|
|
||||||
void TransposeUVWx8_MIPS_DSPR2(const uint8* src, int src_stride,
|
|
||||||
uint8* dst_a, int dst_stride_a,
|
|
||||||
uint8* dst_b, int dst_stride_b, int width);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} // extern "C"
|
|
||||||
} // namespace libyuv
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_ROTATE_ROW_H_ NOLINT
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user