Compare commits

..

29 Commits

Author SHA1 Message Date
Jingning Han
ac50b75e50 Use balanced model for intra prediction mode coding
This commit replaces the previous table based intra mode model
coding with a more balanced entropy coding system. It reduces the
decoder lookup table size by 1K bytes. The key frame compression
performance is about even on average. There are a few points where
the compression performance is improved by over 5%. Most test
points are fairly close to the lookup table approach.

Change-Id: I47154276c0a6a22ae87de8845bc2d494681b95f6
2015-06-23 16:42:56 -07:00
Jingning Han
81c389e790 Make tx partition entropy coder account for block size
This commit allows the entropy coder for transform block partition
to account for its relative position with respect to the block size.

Change-Id: I2b5019c378bfb58c11b926fa50c0db1933f35852
2015-06-18 21:56:30 +00:00
Jingning Han
0a42a1efd4 Add max_tx_size to MB_MODE_INFO
Refactor the recursive transform block partition to reduce repeated
computation maximum transform block size per block.

Change-Id: Ib408c78dc6923fe7d337dc937e74f2701ac63859
2015-06-18 14:54:49 -07:00
Jingning Han
2aa2ef4094 Make loop filter support variable transform block size
This commit refactors the loop filter implementation to make it
support recursive transform block partition.

Change-Id: Ica2daa9cb54730cff7770ee2c2d7ffdb240ff418
2015-06-16 18:56:47 -07:00
Jingning Han
85c220b2c4 Turn on loop filter
Temporarily use univariate transform size for loop filter.
As compared to VP9 master branch with loop filter turned on, the
compression gains are:

derf  0.671%
mr    0.749%
stdhd 0.886%
hr    1.394%

The encoding speed currently is about 1.3X that of speed 0.

Change-Id: I64788f894e70fde14c5be3159501bedf836e5998
2015-06-16 08:49:13 -07:00
Jingning Han
7cbea06386 Update transform block partition information for intra blocks
If a block is coded in the intra modes, update the transform block
partition information as maximum block size.

Change-Id: I5ea440c700fc887ff2fe84fabde77a9d896d16f4
2015-06-15 15:53:19 -07:00
Jingning Han
a4fd58a761 Refactor tx_block_rd_b() to compute per block rd cost
This commit makes the tx_block_rd_b() compute the rate and
distortion cost per transform block, instead of accumulating these
costs.

Change-Id: Iff5adc4c27cc54f8e6eb3abd95f8d88ba00f462c
2015-06-15 09:08:00 -07:00
Jingning Han
e272e5b8fb Skip redundant flag reset
If the skip flag is already on, there is no need to further check
the all zero block case. This improves encoding speed at no coding
statistics change.

Change-Id: Icab997ca2977e650351a47ff1314def5ac4ecb1d
2015-06-12 11:44:01 -07:00
Jingning Han
5180368403 Allow encoder to force all zero coefficient block
This commit allows the encoder to force all zero quantized
coefficient block per transform block, if that provides better
rate-distortion trade-off.

Change-Id: I5b57b28cccd257ebfaf7c1749dda7be482abc834
2015-06-12 09:18:10 -07:00
Jingning Han
63c0d8df9f Assign largest transform block size to skip block
If a block has all coefficients quantized to zero, the codec will
assume that it uses largest transform block size.

Change-Id: I1a32527e50026e8e4759ad8de474189cd20e89c8
2015-06-11 11:01:44 -07:00
Jingning Han
9ce132ac37 Refactor transform block partition entropy coding
This commit refactors the transform block partition entropy
coding process to improve the encoding speed. There is no change
in the compression statistics.

Change-Id: I237466fd95c1b888df432babfa36e01f74240eef
2015-06-11 09:41:20 -07:00
Jingning Han
9692042493 Refactor transform block partition update process
Unify transform block partition update process used in rate
distortion optimization and encoding stage.

Change-Id: I4e5f2b6d2482c53ceadb7c8743435158f229a82c
2015-06-10 10:01:31 -07:00
Jingning Han
87a0d5436b Account for context information for partition rate estimate
This commit allows the encoder to account for the boundary block
information to estimate the transform block partitiion rate cost
in the rate-distortion optimization scheme.

Change-Id: Idb79cf936d96cdd15bcba27e47318295413a5f5d
2015-06-09 15:53:55 -07:00
Jingning Han
948c6d882e Enable transform block partition entropy coding
Select the probability model for transform block partition coding
conditioned on the neighbor transform block sizes.

Change-Id: Ib701296e59009bad97dbd21d8dcd58bc5e552f39
2015-06-09 12:30:52 -07:00
Jingning Han
79d6b8fc85 Properly handle boundary block rate distortion computation
This commit makes the encoder to properly compute the rate
distortion cost for blocks that partially cover extend pixels.

Change-Id: I44529af6f76925cdc0f6b24a5d190b51b0813983
2015-06-09 11:14:24 -07:00
Jingning Han
b54dd00f53 Align the intra and inter mode cost measurement
This commit aligns the measurement method used to evaluate both
intra and inter modes.

Change-Id: I8071584ce87fa3c5401800363daa0e670de29af5
2015-06-05 11:37:21 -07:00
Jingning Han
3239e22a42 Conditionally use recursive transform block partition search
If the frame header sets to use fixed transform block size, use
the univariate transform block partition search flow.

Change-Id: Ic422ecb6565642cd8ddb96dc67a37109ef3ce90f
2015-06-03 11:14:26 -07:00
Jingning Han
a96f2ca319 Rework the rate and distortion computation pipeline
This allows the encoder to use more precise rate and distortion
costs for mode decision.

Change-Id: I7cfd676a88531a194b9a509375feea8365e5ef12
2015-06-02 23:15:09 -07:00
Jingning Han
0207dcde4a Fix rate estimate issue in transform block partition coding
This commit fixes the over count issue in the recursive transform
block partition rate cost estimation. It improves the compression
performance by about 0.45%.

Change-Id: I01ccda954ed0e120263977472c1c759c3c67170c
2015-06-02 18:51:03 -07:00
Jingning Han
33f05e90fe Enable rate-distortion optimization for transform partition
This commit enables the rate-distortion optimization for recursive
transform block partition for inter mode blocks based on luma
component. The chroma component infers the transform block size
decision from those of luma component.

Change-Id: I907cc52af888a606b718e087e717b189fa505748
2015-06-01 16:50:36 -07:00
Jingning Han
0451c6b6dd Refactor per block rate distortion estimate
Move the rate-distortion estimate function outside the recursion
as an individual operating module.

Change-Id: I662199223c256664bcd312084b3aebffb8a8034b
2015-06-01 12:41:45 -07:00
Jingning Han
d4b8dd76c4 Make chroma component RD estimate support transform partition
This commit makes the rate-distortion estimation of the chroma
components support the recursive transform block partition
inferred from the luma component mode decisions.

Change-Id: I2e038bebf558da406e966015952ad1058bdf4766
2015-06-01 11:15:15 -07:00
Jingning Han
cd4aca5959 Add decoder support to recursive transform block partition
It allows the decoder to recursively parse and use the transform
block size for inter coded blocks.

Change-Id: I12ceea48ab35501ac1a3447142deb2a334eff3b8
2015-05-22 16:45:34 -07:00
Jingning Han
64f3820f80 Refactor bit-stream syntax support to transform partition
Make the bit-stream syntax elelment coding ready to support
variable transform coding block sizes.

Change-Id: I07ae4ab62d1ecd46c4a5ae45702fc14bd1d4b07d
2015-05-22 12:13:29 -07:00
Jingning Han
6fc13b5cc2 Inter block transform coding partition syntax elements
Allocate memory buffer to store the transform coding partition
information of inter prediction mode blocks.

Change-Id: I428b1dd0b26e8eaf24030a833554ceb4479c5551
2015-05-22 10:57:36 -07:00
Jingning Han
df2042dc1e Synchronize encoding process and tokenization handle
The encoding and tokenization process support the recursive
transform block partition coding scheme.

Change-Id: I47283cc6ee9c383059950623ece60a0fcce82e00
2015-05-21 18:51:27 -07:00
Jingning Han
a15cf9a5b7 Synchronize tokenization and detokenization process
Make the encoder and decoder synchronized for recursive
tokenization coding.

Change-Id: I84c5f3dfc3ee9982ab57e658ffe6cb17a949eda2
2015-05-22 01:45:31 +00:00
Jingning Han
bf99a00340 Arrange tokenization order to support recursive txfm block coding
Make the encoder packetize transform block in a recursive order.
Note that the block index with respect to the coding block remains
identical.

Change-Id: I07c6d2017f4f150274aff46c05388a7fd47cd920
2015-05-21 18:43:37 -07:00
Jingning Han
5f6fe83ac5 Syntax coding support for transform block coding
This commit re-designs the bitstream syntax to support recursive
transform block partition. It disables the decoder vector unit
tests.

Change-Id: I6cac24c4f1e44f29ffcc9b87ba1167eeb32d1b69
2015-05-18 15:43:02 -07:00
885 changed files with 62083 additions and 141489 deletions

5
.gitignore vendored
View File

@@ -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

View File

@@ -1,26 +1,18 @@
Adrian Grange <agrange@google.com> Adrian Grange <agrange@google.com>
Alex 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>
Deb Mukherjee <debargha@google.com>
Erik Niemeyer <erik.a.niemeyer@intel.com> <erik.a.niemeyer@gmail.com>
Guillaume Martres <gmartres@google.com> <smarter3@gmail.com>
Hangyu Kuang <hkuang@google.com> Hangyu Kuang <hkuang@google.com>
Jim Bankoski <jimbankoski@google.com> Jim Bankoski <jimbankoski@google.com>
John Koleszar <jkoleszar@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>
John Koleszar <jkoleszar@google.com> Johann Koenig <johannkoenig@google.com> <johannkoenig@dhcp-172-19-7-52.mtv.corp.google.com>
Joshua Litt <joshualitt@google.com> <joshualitt@chromium.org>
Marco Paniconi <marpan@google.com>
Marco Paniconi <marpan@google.com> <marpan@chromium.org>
Pascal Massimino <pascal.massimino@gmail.com> Pascal Massimino <pascal.massimino@gmail.com>
Paul Wilkins <paulwilkins@google.com>
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
Sami Pietilä <samipietila@google.com> Sami Pietilä <samipietila@google.com>
Tamar Levy <tamar.levy@intel.com>
Tamar Levy <tamar.levy@intel.com> <levytamar82@gmail.com>
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com> 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>
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
Alpha Lam <hclam@google.com> <hclam@chromium.org>
Deb Mukherjee <debargha@google.com>
Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com> Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com>

29
AUTHORS
View File

@@ -3,11 +3,10 @@
Aaron Watry <awatry@gmail.com> Aaron Watry <awatry@gmail.com>
Abo Talib Mahfoodh <ab.mahfoodh@gmail.com> Abo Talib Mahfoodh <ab.mahfoodh@gmail.com>
Adam Xu <adam@xuyaowu.com>
Adrian Grange <agrange@google.com> Adrian Grange <agrange@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> Alex Converse <alex.converse@gmail.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>
@@ -15,58 +14,44 @@ A.Mahfoodh <ab.mahfoodh@gmail.com>
Ami Fischman <fischman@chromium.org> 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>
Aron Rosenberg <arosenberg@logitech.com> Aron Rosenberg <arosenberg@logitech.com>
Attila Nagy <attilanagy@google.com> Attila Nagy <attilanagy@google.com>
changjun.yang <changjun.yang@intel.com> changjun.yang <changjun.yang@intel.com>
Charles 'Buck' Krasic <ckrasic@google.com>
chm <chm@rock-chips.com> chm <chm@rock-chips.com>
Christian Duvivier <cduvivier@google.com> Christian Duvivier <cduvivier@google.com>
Daniel Kang <ddkang@google.com> Daniel Kang <ddkang@google.com>
Deb Mukherjee <debargha@google.com> Deb Mukherjee <debargha@google.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>
Ehsan Akhgari <ehsan.akhgari@gmail.com> Erik Niemeyer <erik.a.niemeyer@gmail.com>
Erik Niemeyer <erik.a.niemeyer@intel.com>
Fabio Pedretti <fabio.ped@libero.it> Fabio Pedretti <fabio.ped@libero.it>
Frank Galligan <fgalligan@google.com> 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>
Giuseppe Scrivano <gscrivano@gnu.org> Giuseppe Scrivano <gscrivano@gnu.org>
Gordana Cmiljanovic <gordana.cmiljanovic@imgtec.com>
Guillaume Martres <gmartres@google.com> Guillaume Martres <gmartres@google.com>
Guillermo Ballester Valor <gbvalor@gmail.com> Guillermo Ballester Valor <gbvalor@gmail.com>
Hangyu Kuang <hkuang@google.com> Hangyu Kuang <hkuang@google.com>
Hanno Böck <hanno@hboeck.de>
Henrik Lundin <hlundin@google.com> 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>
JackyChen <jackychen@google.com>
James Berry <jamesberry@google.com> James Berry <jamesberry@google.com>
James Yu <james.yu@linaro.org>
James Zern <jzern@google.com> James Zern <jzern@google.com>
Jan Gerber <j@mailb.org>
Jan Kratochvil <jan.kratochvil@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com>
Janne Salonen <jsalonen@google.com> Janne Salonen <jsalonen@google.com>
Jeff Faust <jfaust@google.com> Jeff Faust <jfaust@google.com>
Jeff Muizelaar <jmuizelaar@mozilla.com> Jeff Muizelaar <jmuizelaar@mozilla.com>
Jeff Petkau <jpet@chromium.org> Jeff Petkau <jpet@chromium.org>
Jia Jia <jia.jia@linaro.org>
Jim Bankoski <jimbankoski@google.com> Jim Bankoski <jimbankoski@google.com>
Jingning Han <jingning@google.com> Jingning Han <jingning@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>
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>
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>
Lawrence Velázquez <larryv@macports.org>
Lou Quillio <louquillio@google.com> Lou Quillio <louquillio@google.com>
Luca Barbato <lu_zero@gentoo.org> Luca Barbato <lu_zero@gentoo.org>
Makoto Kato <makoto.kt@gmail.com> Makoto Kato <makoto.kt@gmail.com>
@@ -80,7 +65,6 @@ Michael Kohler <michaelkohler@live.com>
Mike Frysinger <vapier@chromium.org> Mike Frysinger <vapier@chromium.org>
Mike Hommey <mhommey@mozilla.com> Mike Hommey <mhommey@mozilla.com>
Mikhal Shemer <mikhal@google.com> Mikhal Shemer <mikhal@google.com>
Minghai Shang <minghai@google.com>
Morton Jonuschat <yabawock@gmail.com> Morton Jonuschat <yabawock@gmail.com>
Parag Salasakar <img.mips1@gmail.com> Parag Salasakar <img.mips1@gmail.com>
Pascal Massimino <pascal.massimino@gmail.com> Pascal Massimino <pascal.massimino@gmail.com>
@@ -88,8 +72,6 @@ Patrik Westin <patrik.westin@gmail.com>
Paul Wilkins <paulwilkins@google.com> Paul Wilkins <paulwilkins@google.com>
Pavol Rusnak <stick@gk2.sk> Pavol Rusnak <stick@gk2.sk>
Paweł Hajdan <phajdan@google.com> Paweł Hajdan <phajdan@google.com>
Pengchong Jin <pengchong@google.com>
Peter de Rivaz <peter.derivaz@gmail.com>
Philip Jägenstedt <philipj@opera.com> Philip Jägenstedt <philipj@opera.com>
Priit Laes <plaes@plaes.org> Priit Laes <plaes@plaes.org>
Rafael Ávila de Espíndola <rafael.espindola@gmail.com> Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
@@ -97,29 +79,22 @@ 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 <rbultje@google.com> Ronald S. Bultje <rbultje@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>
Scott LaVarnway <slavarnway@google.com> Scott LaVarnway <slavarnway@google.com>
Sean McGovern <gseanmcg@gmail.com>
Sergey Ulanov <sergeyu@chromium.org>
Shimon Doodkin <helpmepro1@gmail.com> Shimon Doodkin <helpmepro1@gmail.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>
Takanori MATSUURA <t.matsuu@gmail.com> Takanori MATSUURA <t.matsuu@gmail.com>
Tamar Levy <tamar.levy@intel.com> Tamar Levy <tamar.levy@intel.com>
Tao Bai <michaelbai@chromium.org>
Tero Rintaluoma <teror@google.com> Tero Rintaluoma <teror@google.com>
Thijs Vermeir <thijsvermeir@gmail.com> Thijs Vermeir <thijsvermeir@gmail.com>
Tim Kopp <tkopp@google.com>
Timothy B. Terriberry <tterribe@xiph.org> Timothy B. Terriberry <tterribe@xiph.org>
Tom Finegan <tomfinegan@google.com> Tom Finegan <tomfinegan@google.com>
Vignesh Venkatasubramanian <vigneshv@google.com> Vignesh Venkatasubramanian <vigneshv@google.com>
Yaowu Xu <yaowu@google.com> Yaowu Xu <yaowu@google.com>
Yongzhe Wang <yongzhe@google.com>
Yunqing Wang <yunqingwang@google.com> Yunqing Wang <yunqingwang@google.com>
Zoe Liu <zoeliu@google.com>
Google Inc. Google Inc.
The Mozilla Foundation The Mozilla Foundation
The Xiph.Org Foundation The Xiph.Org Foundation

View File

@@ -1,31 +1,3 @@
xxxx-yy-zz v1.4.0 "Changes for next release"
vpxenc is changed to use VP9 by default.
Encoder controls added for 1 pass SVC.
Decoder control to toggle on/off loopfilter.
2015-04-03 v1.4.0 "Indian Runner Duck"
This release includes significant improvements to the VP9 codec.
- Upgrading:
This release is ABI incompatible with 1.3.0. It drops the compatibility
layer, requiring VPX_IMG_FMT_* instead of IMG_FMT_*, and adds several codec
controls for VP9.
- Enhancements:
Faster VP9 encoding and decoding
Multithreaded VP9 decoding (tile and frame-based)
Multithreaded VP9 encoding - on by default
YUV 4:2:2 and 4:4:4 support in VP9
10 and 12bit support in VP9
64bit ARM support by replacing ARM assembly with intrinsics
- Bug Fixes:
Fixes a VP9 bitstream issue in Profile 1. This only affected non-YUV 4:2:0
files.
- Known Issues:
Frame Parallel decoding fails for segmented and non-420 files.
2013-11-15 v1.3.0 "Forest" 2013-11-15 v1.3.0 "Forest"
This release introduces the VP9 codec in a backward-compatible way. This release introduces the VP9 codec in a backward-compatible way.
All existing users of VP8 can continue to use the library without All existing users of VP8 can continue to use the library without

View File

@@ -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.

20
README
View File

@@ -1,4 +1,4 @@
README - 23 March 2015 README - 30 May 2014
Welcome to the WebM VP8/VP9 Codec SDK! Welcome to the WebM VP8/VP9 Codec SDK!
@@ -59,10 +59,15 @@ 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
ppc32-darwin8-gcc
ppc32-darwin9-gcc
ppc32-linux-gcc
ppc64-darwin8-gcc
ppc64-darwin9-gcc
ppc64-linux-gcc
sparc-solaris-gcc sparc-solaris-gcc
x86-android-gcc x86-android-gcc
x86-darwin8-gcc x86-darwin8-gcc
@@ -73,7 +78,6 @@ COMPILING THE APPLICATIONS/LIBRARIES:
x86-darwin11-gcc x86-darwin11-gcc
x86-darwin12-gcc x86-darwin12-gcc
x86-darwin13-gcc x86-darwin13-gcc
x86-darwin14-gcc
x86-iphonesimulator-gcc x86-iphonesimulator-gcc
x86-linux-gcc x86-linux-gcc
x86-linux-icc x86-linux-icc
@@ -86,14 +90,11 @@ 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
x86_64-darwin12-gcc x86_64-darwin12-gcc
x86_64-darwin13-gcc x86_64-darwin13-gcc
x86_64-darwin14-gcc
x86_64-iphonesimulator-gcc x86_64-iphonesimulator-gcc
x86_64-linux-gcc x86_64-linux-gcc
x86_64-linux-icc x86_64-linux-icc
@@ -104,7 +105,12 @@ 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 universal-darwin8-gcc
universal-darwin9-gcc
universal-darwin10-gcc
universal-darwin11-gcc
universal-darwin12-gcc
universal-darwin13-gcc
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,

4
args.c
View File

@@ -14,7 +14,9 @@
#include <limits.h> #include <limits.h>
#include "args.h" #include "args.h"
#include "vpx_ports/msvc.h" #ifdef _MSC_VER
#define snprintf _snprintf
#endif
#if defined(__GNUC__) && __GNUC__ #if defined(__GNUC__) && __GNUC__
extern void die(const char *fmt, ...) __attribute__((noreturn)); extern void die(const char *fmt, ...) __attribute__((noreturn));

View File

@@ -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
@@ -160,32 +158,24 @@ LOCAL_CFLAGS += \
LOCAL_MODULE := libvpx LOCAL_MODULE := libvpx
LOCAL_LDLIBS := -llog
ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes) ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
LOCAL_STATIC_LIBRARIES := cpufeatures LOCAL_STATIC_LIBRARIES := cpufeatures
endif 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
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
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
$(eval $(call rtcd_dep_template))
.PHONY: clean .PHONY: clean
clean: clean:
@@ -194,11 +184,7 @@ clean:
@$(RM) -r $(ASM_CNV_PATH) @$(RM) -r $(ASM_CNV_PATH)
@$(RM) $(CLEAN-OBJS) @$(RM) $(CLEAN-OBJS)
ifeq ($(ENABLE_SHARED),1) include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
else
include $(BUILD_STATIC_LIBRARY)
endif
ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes) ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
$(call import-module,cpufeatures) $(call import-module,cpufeatures)

View File

@@ -22,10 +22,8 @@ clean:: .DEFAULT
exampletest: .DEFAULT exampletest: .DEFAULT
install:: .DEFAULT install:: .DEFAULT
test:: .DEFAULT test:: .DEFAULT
test-no-data-check:: .DEFAULT
testdata:: .DEFAULT testdata:: .DEFAULT
utiltest: .DEFAULT utiltest: .DEFAULT
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be # Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
@@ -58,10 +56,13 @@ dist:
fi fi
endif endif
# Since we invoke make recursively for multiple targets we need to include the
# .mk file for the correct target, but only when $(target) is non-empty.
ifneq ($(target),) ifneq ($(target),)
include $(target)-$(TOOLCHAIN).mk # Normally, we want to build the filename from the target and the toolchain.
# This disambiguates from the $(target).mk file that exists in the source tree.
# However, the toolchain is part of the target in universal builds, so we
# don't want to include TOOLCHAIN in that case. FAT_ARCHS is used to test
# if we're in the universal case.
include $(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk
endif endif
BUILD_ROOT?=. BUILD_ROOT?=.
VPATH=$(SRC_PATH_BARE) VPATH=$(SRC_PATH_BARE)
@@ -115,9 +116,6 @@ test::
testdata:: testdata::
.PHONY: utiltest .PHONY: utiltest
utiltest: utiltest:
.PHONY: test-no-data-check exampletest-no-data-check utiltest-no-data-check
test-no-data-check::
exampletest-no-data-check utiltest-no-data-check:
# Add compiler flags for intrinsic files # Add compiler flags for intrinsic files
ifeq ($(TOOLCHAIN), x86-os2-gcc) ifeq ($(TOOLCHAIN), x86-os2-gcc)
@@ -140,8 +138,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] $@")
@@ -317,15 +313,18 @@ $(1):
$$(filter %.o,$$^) $$(extralibs) $$(filter %.o,$$^) $$(extralibs)
endef endef
define dll_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible define lipo_lib_template
# for creating them. $(1): $(addsuffix /$(1),$(FAT_ARCHS))
$(1): $(if $(quiet),@echo " [LIPO] $$@")
$(if $(quiet),@echo " [LD] $$@") $(qexec)libtool -static -o $$@ $$?
$(qexec)$$(LD) -Zdll $$(LDFLAGS) \ endef
-o $$@ \
$$(filter %.o,$$^) $$(extralibs) $$(EXPORTS_FILE) define lipo_bin_template
$(1): $(addsuffix /$(1),$(FAT_ARCHS))
$(if $(quiet),@echo " [LIPO] $$@")
$(qexec)lipo -output $$@ -create $$?
endef endef
@@ -384,9 +383,8 @@ LIBS=$(call enabled,LIBS)
.libs: $(LIBS) .libs: $(LIBS)
@touch $@ @touch $@
$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib)))) $(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib)))) $(foreach lib,$(filter %so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib)))) $(foreach lib,$(filter %$(VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))
INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS) INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
ifeq ($(MAKECMDGOALS),dist) ifeq ($(MAKECMDGOALS),dist)

View File

@@ -390,7 +390,7 @@ write_common_config_banner() {
write_common_config_targets() { write_common_config_targets() {
for t in ${all_targets}; do for t in ${all_targets}; do
if enabled ${t}; then if enabled ${t}; then
if enabled child; then if enabled universal || enabled child; then
fwrite config.mk "ALL_TARGETS += ${t}-${toolchain}" fwrite config.mk "ALL_TARGETS += ${t}-${toolchain}"
else else
fwrite config.mk "ALL_TARGETS += ${t}" fwrite config.mk "ALL_TARGETS += ${t}"
@@ -640,6 +640,12 @@ process_common_toolchain() {
*i[3456]86*) *i[3456]86*)
tgt_isa=x86 tgt_isa=x86
;; ;;
*powerpc64*)
tgt_isa=ppc64
;;
*powerpc*)
tgt_isa=ppc32
;;
*sparc*) *sparc*)
tgt_isa=sparc tgt_isa=sparc
;; ;;
@@ -647,6 +653,14 @@ process_common_toolchain() {
# detect tgt_os # detect tgt_os
case "$gcctarget" in case "$gcctarget" in
*darwin8*)
tgt_isa=universal
tgt_os=darwin8
;;
*darwin9*)
tgt_isa=universal
tgt_os=darwin9
;;
*darwin10*) *darwin10*)
tgt_isa=x86_64 tgt_isa=x86_64
tgt_os=darwin10 tgt_os=darwin10
@@ -728,13 +742,6 @@ process_common_toolchain() {
# Handle darwin variants. Newer SDKs allow targeting older # Handle darwin variants. Newer SDKs allow targeting older
# platforms, so use the newest one available. # platforms, so use the newest one available.
case ${toolchain} in case ${toolchain} in
arm*-darwin*)
ios_sdk_dir="$(show_darwin_sdk_path iphoneos)"
if [ -d "${ios_sdk_dir}" ]; then
add_cflags "-isysroot ${ios_sdk_dir}"
add_ldflags "-isysroot ${ios_sdk_dir}"
fi
;;
*-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
@@ -788,6 +795,7 @@ process_common_toolchain() {
case ${toolchain} in case ${toolchain} in
sparc-solaris-*) sparc-solaris-*)
add_extralibs -lposix4 add_extralibs -lposix4
disable_feature fast_unaligned
;; ;;
*-solaris-*) *-solaris-*)
add_extralibs -lposix4 add_extralibs -lposix4
@@ -810,17 +818,12 @@ process_common_toolchain() {
if disabled neon && enabled neon_asm; then if disabled neon && enabled neon_asm; then
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 soft_enable media
*-darwin*) soft_enable fast_unaligned
# Neon is guaranteed on iOS 6+ devices, while old media extensions
# no longer assemble with iOS 9 SDK
;;
*)
soft_enable media
esac
;; ;;
armv6) armv6)
soft_enable media soft_enable media
soft_enable fast_unaligned
;; ;;
esac esac
@@ -1036,32 +1039,30 @@ EOF
tune_cflags="-mtune=" tune_cflags="-mtune="
if enabled dspr2; then if enabled dspr2; then
check_add_cflags -mips32r2 -mdspr2 check_add_cflags -mips32r2 -mdspr2
fi disable_feature fast_unaligned
if enabled runtime_cpu_detect; then
disable_feature runtime_cpu_detect
fi fi
if [ -n "${tune_cpu}" ]; then if [ -n "${tune_cpu}" ]; then
case ${tune_cpu} in case ${tune_cpu} in
p5600) p5600)
check_add_cflags -mips32r5 -funroll-loops -mload-store-pairs add_cflags -mips32r5 -funroll-loops -mload-store-pairs
check_add_cflags -msched-weight -mhard-float -mfp64 add_cflags -msched-weight -mhard-float
check_add_asflags -mips32r5 -mhard-float -mfp64 add_asflags -mips32r5 -mhard-float
check_add_ldflags -mfp64
;; ;;
i6400) i6400)
check_add_cflags -mips64r6 -mabi=64 -funroll-loops -msched-weight add_cflags -mips64r6 -mabi=64 -funroll-loops -mload-store-pairs
check_add_cflags -mload-store-pairs -mhard-float -mfp64 add_cflags -msched-weight -mhard-float
check_add_asflags -mips64r6 -mabi=64 -mhard-float -mfp64 add_asflags -mips64r6 -mabi=64 -mhard-float
check_add_ldflags -mips64r6 -mabi=64 -mfp64 add_ldflags -mips64r6 -mabi=64
;; ;;
esac esac
if enabled msa; then if enabled msa; then
add_cflags -mmsa add_cflags -mmsa -mfp64 -flax-vector-conversions
add_asflags -mmsa add_asflags -mmsa -mfp64 -flax-vector-conversions
add_ldflags -mmsa add_ldflags -mmsa -mfp64 -flax-vector-conversions
disable_feature fast_unaligned
fi fi
fi fi
@@ -1069,6 +1070,29 @@ EOF
check_add_asflags -march=${tgt_isa} check_add_asflags -march=${tgt_isa}
check_add_asflags -KPIC check_add_asflags -KPIC
;; ;;
ppc*)
enable_feature ppc
bits=${tgt_isa##ppc}
link_with_cc=gcc
setup_gnu_toolchain
add_asflags -force_cpusubtype_ALL -I"\$(dir \$<)darwin"
soft_enable altivec
enabled altivec && add_cflags -maltivec
case "$tgt_os" in
linux*)
add_asflags -maltivec -mregnames -I"\$(dir \$<)linux"
;;
darwin*)
darwin_arch="-arch ppc"
enabled ppc64 && darwin_arch="${darwin_arch}64"
add_cflags ${darwin_arch} -m${bits} -fasm-blocks
add_asflags ${darwin_arch} -force_cpusubtype_ALL -I"\$(dir \$<)darwin"
add_ldflags ${darwin_arch} -m${bits}
enabled altivec && add_cflags -faltivec
;;
esac
;;
x86*) x86*)
case ${tgt_os} in case ${tgt_os} in
win*) win*)
@@ -1081,9 +1105,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
@@ -1223,7 +1245,7 @@ EOF
;; ;;
esac esac
;; ;;
*-gcc|generic-gnu) universal*|*-gcc|generic-gnu)
link_with_cc=gcc link_with_cc=gcc
enable_feature gcc enable_feature gcc
setup_gnu_toolchain setup_gnu_toolchain
@@ -1307,15 +1329,11 @@ EOF
# only for MIPS platforms # only for MIPS platforms
case ${toolchain} in case ${toolchain} in
mips*) mips*)
if enabled big_endian; then if enabled dspr2; then
if enabled dspr2; then if enabled big_endian; then
echo "dspr2 optimizations are available only for little endian platforms" echo "dspr2 optimizations are available only for little endian platforms"
disable_feature dspr2 disable_feature dspr2
fi fi
if enabled msa; then
echo "msa optimizations are available only for little endian platforms"
disable_feature msa
fi
fi fi
;; ;;
esac esac
@@ -1325,6 +1343,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() {

View File

@@ -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 \

View File

@@ -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

View File

@@ -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
@@ -263,8 +263,8 @@ case "$target" in
;; ;;
arm*) arm*)
platforms[0]="ARM" platforms[0]="ARM"
asm_Debug_cmdline="armasm -nologo -oldit &quot;%(FullPath)&quot;" asm_Debug_cmdline="armasm -nologo &quot;%(FullPath)&quot;"
asm_Release_cmdline="armasm -nologo -oldit &quot;%(FullPath)&quot;" asm_Release_cmdline="armasm -nologo &quot;%(FullPath)&quot;"
;; ;;
*) die "Unsupported target $target!" *) die "Unsupported target $target!"
;; ;;
@@ -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

View File

@@ -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

View File

@@ -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

134
configure vendored
View File

@@ -31,14 +31,16 @@ Advanced options:
--size-limit=WxH max size to allow in the decoder --size-limit=WxH max size to allow in the decoder
--as={yasm|nasm|auto} use specified assembler [auto, yasm preferred] --as={yasm|nasm|auto} use specified assembler [auto, yasm preferred]
--sdk-path=PATH path to root of sdk (android builds only) --sdk-path=PATH path to root of sdk (android builds only)
${toggle_fast_unaligned} don't use unaligned accesses, even when
supported by hardware [auto]
${toggle_codec_srcs} in/exclude codec library source code ${toggle_codec_srcs} in/exclude codec library source code
${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_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_mem_tracker} track memory usage
${toggle_postproc} postprocessing ${toggle_postproc} postprocessing
${toggle_vp9_postproc} vp9 specific postprocessing ${toggle_vp9_postproc} vp9 specific postprocessing
${toggle_multithread} multithreaded encoding and decoding ${toggle_multithread} multithreaded encoding and decoding
@@ -107,10 +109,15 @@ 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"
all_platforms="${all_platforms} ppc32-darwin8-gcc"
all_platforms="${all_platforms} ppc32-darwin9-gcc"
all_platforms="${all_platforms} ppc32-linux-gcc"
all_platforms="${all_platforms} ppc64-darwin8-gcc"
all_platforms="${all_platforms} ppc64-darwin9-gcc"
all_platforms="${all_platforms} ppc64-linux-gcc"
all_platforms="${all_platforms} sparc-solaris-gcc" all_platforms="${all_platforms} sparc-solaris-gcc"
all_platforms="${all_platforms} x86-android-gcc" all_platforms="${all_platforms} x86-android-gcc"
all_platforms="${all_platforms} x86-darwin8-gcc" all_platforms="${all_platforms} x86-darwin8-gcc"
@@ -134,8 +141,6 @@ 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"
@@ -152,7 +157,13 @@ 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} universal-darwin8-gcc"
all_platforms="${all_platforms} universal-darwin9-gcc"
all_platforms="${all_platforms} universal-darwin10-gcc"
all_platforms="${all_platforms} universal-darwin11-gcc"
all_platforms="${all_platforms} universal-darwin12-gcc"
all_platforms="${all_platforms} universal-darwin13-gcc"
all_platforms="${all_platforms} universal-darwin14-gcc"
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
@@ -189,14 +200,6 @@ if [ ${doxy_major:-0} -ge 1 ]; then
[ $doxy_minor -eq 5 ] && [ $doxy_patch -ge 3 ] && enable_feature doxygen [ $doxy_minor -eq 5 ] && [ $doxy_patch -ge 3 ] && enable_feature doxygen
fi fi
# disable codecs when their source directory does not exist
[ -d "${source_path}/vp8" ] || disable_feature vp8
[ -d "${source_path}/vp9" ] || disable_feature vp9
[ -d "${source_path}/vp10" ] || disable_feature vp10
# disable vp10 codec by default
disable_feature vp10
# install everything except the sources, by default. sources will have # 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
# case. # case.
@@ -207,30 +210,45 @@ enable_feature install_libs
enable_feature static enable_feature static
enable_feature optimizations enable_feature optimizations
enable_feature dependency_tracking enable_feature dependency_tracking
enable_feature fast_unaligned #allow unaligned accesses, if supported by hw
enable_feature spatial_resampling enable_feature spatial_resampling
enable_feature multithread enable_feature multithread
enable_feature os_support enable_feature os_support
enable_feature temporal_denoising enable_feature temporal_denoising
CODECS=" [ -d "${source_path}/../include" ] && enable_feature alt_tree_layout
vp8_encoder for d in vp8 vp9; do
vp8_decoder [ -d "${source_path}/${d}" ] && disable_feature alt_tree_layout;
vp9_encoder done
vp9_decoder
vp10_encoder if ! enabled alt_tree_layout; then
vp10_decoder # development environment
" [ -d "${source_path}/vp8" ] && CODECS="${CODECS} vp8_encoder vp8_decoder"
CODEC_FAMILIES=" [ -d "${source_path}/vp9" ] && CODECS="${CODECS} vp9_encoder vp9_decoder"
vp8 else
vp9 # customer environment
vp10 [ -f "${source_path}/../include/vpx/vp8cx.h" ] && CODECS="${CODECS} vp8_encoder"
" [ -f "${source_path}/../include/vpx/vp8dx.h" ] && CODECS="${CODECS} vp8_decoder"
[ -f "${source_path}/../include/vpx/vp9cx.h" ] && CODECS="${CODECS} vp9_encoder"
[ -f "${source_path}/../include/vpx/vp9dx.h" ] && CODECS="${CODECS} vp9_decoder"
[ -f "${source_path}/../include/vpx/vp8cx.h" ] || disable_feature vp8_encoder
[ -f "${source_path}/../include/vpx/vp8dx.h" ] || disable_feature vp8_decoder
[ -f "${source_path}/../include/vpx/vp9cx.h" ] || disable_feature vp9_encoder
[ -f "${source_path}/../include/vpx/vp9dx.h" ] || disable_feature vp9_decoder
[ -f "${source_path}/../lib/*/*mt.lib" ] && soft_enable static_msvcrt
fi
CODECS="$(echo ${CODECS} | tr ' ' '\n')"
CODEC_FAMILIES="$(for c in ${CODECS}; do echo ${c%_*}; done | sort | uniq)"
ARCH_LIST=" ARCH_LIST="
arm arm
mips mips
x86 x86
x86_64 x86_64
ppc32
ppc64
" "
ARCH_EXT_LIST=" ARCH_EXT_LIST="
edsp edsp
@@ -251,11 +269,14 @@ ARCH_EXT_LIST="
sse4_1 sse4_1
avx avx
avx2 avx2
altivec
" "
HAVE_LIST=" HAVE_LIST="
${ARCH_EXT_LIST} ${ARCH_EXT_LIST}
vpx_ports vpx_ports
stdint_h stdint_h
alt_tree_layout
pthread_h pthread_h
sys_mman_h sys_mman_h
unistd_h unistd_h
@@ -284,6 +305,10 @@ CONFIG_LIST="
codec_srcs codec_srcs
debug_libs debug_libs
fast_unaligned
mem_manager
mem_tracker
mem_checks
dequant_tokens dequant_tokens
dc_recon dc_recon
@@ -345,6 +370,7 @@ CMDLINE_SELECT="
libc libc
as as
size_limit size_limit
fast_unaligned
codec_srcs codec_srcs
debug_libs debug_libs
@@ -357,6 +383,7 @@ CMDLINE_SELECT="
${CODECS} ${CODECS}
${CODEC_FAMILIES} ${CODEC_FAMILIES}
static_msvcrt static_msvcrt
mem_tracker
spatial_resampling spatial_resampling
realtime_only realtime_only
onthefly_bitpacking onthefly_bitpacking
@@ -429,8 +456,22 @@ post_process_cmdline() {
process_targets() { process_targets() {
enabled child || write_common_config_banner enabled child || write_common_config_banner
write_common_target_config_h ${BUILD_PFX}vpx_config.h enabled universal || write_common_target_config_h ${BUILD_PFX}vpx_config.h
# For fat binaries, call configure recursively to configure for each
# binary architecture to be included.
if enabled universal; then
# Call configure (ourselves) for each subarchitecture
for arch in $fat_bin_archs; do
BUILD_PFX=${arch}/ toolchain=${arch} $self --child $cmdline_args || exit $?
done
fi
# The write_common_config (config.mk) logic is deferred until after the
# recursive calls to configure complete, because we want our universal
# targets to be executed last.
write_common_config_targets write_common_config_targets
enabled universal && echo "FAT_ARCHS=${fat_bin_archs}" >> config.mk
# Calculate the default distribution name, based on the enabled features # Calculate the default distribution name, based on the enabled features
cf="" cf=""
@@ -506,11 +547,11 @@ process_detect() {
# Can only build shared libs on a subset of platforms. Doing this check # Can only build shared libs on a subset of platforms. Doing this check
# here rather than at option parse time because the target auto-detect # here rather than at option parse time because the target auto-detect
# magic happens after the command line has been parsed. # magic happens after the command line has been parsed.
if ! enabled linux && ! enabled os2; then if ! enabled linux; then
if enabled gnu; then if enabled gnu; then
echo "--enable-shared is only supported on ELF; assuming this is OK" echo "--enable-shared is only supported on ELF; assuming this is OK"
else else
die "--enable-shared only supported on ELF and OS/2 for now" die "--enable-shared only supported on ELF for now"
fi fi
fi fi
fi fi
@@ -575,6 +616,30 @@ EOF
process_toolchain() { process_toolchain() {
process_common_toolchain process_common_toolchain
# Handle universal binaries for this architecture
case $toolchain in
universal-darwin*)
darwin_ver=${tgt_os##darwin}
# Snow Leopard (10.6/darwin10) dropped support for PPC
# Include PPC support for all prior versions
if [ $darwin_ver -lt 10 ]; then
fat_bin_archs="$fat_bin_archs ppc32-${tgt_os}-gcc"
fi
# Tiger (10.4/darwin8) brought support for x86
if [ $darwin_ver -ge 8 ]; then
fat_bin_archs="$fat_bin_archs x86-${tgt_os}-${tgt_cc}"
fi
# Leopard (10.5/darwin9) brought 64 bit support
if [ $darwin_ver -ge 9 ]; then
fat_bin_archs="$fat_bin_archs x86_64-${tgt_os}-${tgt_cc}"
fi
;;
esac
# Enable some useful compiler flags # Enable some useful compiler flags
if enabled gcc; then if enabled gcc; then
enabled werror && check_add_cflags -Werror enabled werror && check_add_cflags -Werror
@@ -650,7 +715,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"
@@ -662,7 +727,7 @@ process_toolchain() {
esac esac
# Other toolchain specific defaults # Other toolchain specific defaults
case $toolchain in x86*) soft_enable postproc;; esac case $toolchain in x86*|ppc*|universal*) soft_enable postproc;; esac
if enabled postproc_visualizer; then if enabled postproc_visualizer; then
enabled postproc || die "postproc_visualizer requires postproc to be enabled" enabled postproc || die "postproc_visualizer requires postproc to be enabled"
@@ -716,12 +781,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
} }
@@ -732,7 +791,6 @@ CONFIGURE_ARGS="$@"
process "$@" process "$@"
print_webm_license ${BUILD_PFX}vpx_config.c "/*" " */" print_webm_license ${BUILD_PFX}vpx_config.c "/*" " */"
cat <<EOF >> ${BUILD_PFX}vpx_config.c cat <<EOF >> ${BUILD_PFX}vpx_config.c
#include "vpx/vpx_codec.h"
static const char* const cfg = "$CONFIGURE_ARGS"; static const char* const cfg = "$CONFIGURE_ARGS";
const char *vpx_codec_build_config(void) {return cfg;} const char *vpx_codec_build_config(void) {return cfg;}
EOF EOF

View File

@@ -22,18 +22,17 @@ 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_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \ LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \
@@ -57,7 +56,6 @@ UTILS-$(CONFIG_DECODERS) += vpxdec.c
vpxdec.SRCS += md5_utils.c md5_utils.h vpxdec.SRCS += md5_utils.c md5_utils.h
vpxdec.SRCS += vpx_ports/mem_ops.h vpxdec.SRCS += vpx_ports/mem_ops.h
vpxdec.SRCS += vpx_ports/mem_ops_aligned.h vpxdec.SRCS += vpx_ports/mem_ops_aligned.h
vpxdec.SRCS += vpx_ports/msvc.h
vpxdec.SRCS += vpx_ports/vpx_timer.h vpxdec.SRCS += vpx_ports/vpx_timer.h
vpxdec.SRCS += vpx/vpx_integer.h vpxdec.SRCS += vpx/vpx_integer.h
vpxdec.SRCS += args.c args.h vpxdec.SRCS += args.c args.h
@@ -82,7 +80,6 @@ vpxenc.SRCS += tools_common.c tools_common.h
vpxenc.SRCS += warnings.c warnings.h vpxenc.SRCS += warnings.c warnings.h
vpxenc.SRCS += vpx_ports/mem_ops.h vpxenc.SRCS += vpx_ports/mem_ops.h
vpxenc.SRCS += vpx_ports/mem_ops_aligned.h vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
vpxenc.SRCS += vpx_ports/msvc.h
vpxenc.SRCS += vpx_ports/vpx_timer.h vpxenc.SRCS += vpx_ports/vpx_timer.h
vpxenc.SRCS += vpxstats.c vpxstats.h vpxenc.SRCS += vpxstats.c vpxstats.h
ifeq ($(CONFIG_LIBYUV),yes) ifeq ($(CONFIG_LIBYUV),yes)
@@ -101,7 +98,6 @@ ifeq ($(CONFIG_SPATIAL_SVC),yes)
vp9_spatial_svc_encoder.SRCS += tools_common.c tools_common.h vp9_spatial_svc_encoder.SRCS += tools_common.c tools_common.h
vp9_spatial_svc_encoder.SRCS += video_common.h vp9_spatial_svc_encoder.SRCS += video_common.h
vp9_spatial_svc_encoder.SRCS += video_writer.h video_writer.c vp9_spatial_svc_encoder.SRCS += video_writer.h video_writer.c
vp9_spatial_svc_encoder.SRCS += vpx_ports/msvc.h
vp9_spatial_svc_encoder.SRCS += vpxstats.c vpxstats.h vp9_spatial_svc_encoder.SRCS += vpxstats.c vpxstats.h
vp9_spatial_svc_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D vp9_spatial_svc_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D
vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder
@@ -116,7 +112,6 @@ vpx_temporal_svc_encoder.SRCS += ivfenc.c ivfenc.h
vpx_temporal_svc_encoder.SRCS += tools_common.c tools_common.h vpx_temporal_svc_encoder.SRCS += tools_common.c tools_common.h
vpx_temporal_svc_encoder.SRCS += video_common.h vpx_temporal_svc_encoder.SRCS += video_common.h
vpx_temporal_svc_encoder.SRCS += video_writer.h video_writer.c vpx_temporal_svc_encoder.SRCS += video_writer.h video_writer.c
vpx_temporal_svc_encoder.SRCS += vpx_ports/msvc.h
vpx_temporal_svc_encoder.GUID = B18C08F2-A439-4502-A78E-849BE3D60947 vpx_temporal_svc_encoder.GUID = B18C08F2-A439-4502-A78E-849BE3D60947
vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder
EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c
@@ -127,7 +122,6 @@ simple_decoder.SRCS += video_common.h
simple_decoder.SRCS += video_reader.h video_reader.c simple_decoder.SRCS += video_reader.h video_reader.c
simple_decoder.SRCS += vpx_ports/mem_ops.h simple_decoder.SRCS += vpx_ports/mem_ops.h
simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h
simple_decoder.SRCS += vpx_ports/msvc.h
simple_decoder.DESCRIPTION = Simplified decoder loop simple_decoder.DESCRIPTION = Simplified decoder loop
EXAMPLES-$(CONFIG_DECODERS) += postproc.c EXAMPLES-$(CONFIG_DECODERS) += postproc.c
postproc.SRCS += ivfdec.h ivfdec.c postproc.SRCS += ivfdec.h ivfdec.c
@@ -136,7 +130,6 @@ postproc.SRCS += video_common.h
postproc.SRCS += video_reader.h video_reader.c postproc.SRCS += video_reader.h video_reader.c
postproc.SRCS += vpx_ports/mem_ops.h postproc.SRCS += vpx_ports/mem_ops.h
postproc.SRCS += vpx_ports/mem_ops_aligned.h postproc.SRCS += vpx_ports/mem_ops_aligned.h
postproc.SRCS += vpx_ports/msvc.h
postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7 postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7
postproc.DESCRIPTION = Decoder postprocessor control postproc.DESCRIPTION = Decoder postprocessor control
EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c
@@ -147,7 +140,6 @@ decode_to_md5.SRCS += video_common.h
decode_to_md5.SRCS += video_reader.h video_reader.c decode_to_md5.SRCS += video_reader.h video_reader.c
decode_to_md5.SRCS += vpx_ports/mem_ops.h decode_to_md5.SRCS += vpx_ports/mem_ops.h
decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h
decode_to_md5.SRCS += vpx_ports/msvc.h
decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42 decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42
decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum
EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c
@@ -155,7 +147,6 @@ simple_encoder.SRCS += ivfenc.h ivfenc.c
simple_encoder.SRCS += tools_common.h tools_common.c simple_encoder.SRCS += tools_common.h tools_common.c
simple_encoder.SRCS += video_common.h simple_encoder.SRCS += video_common.h
simple_encoder.SRCS += video_writer.h video_writer.c simple_encoder.SRCS += video_writer.h video_writer.c
simple_encoder.SRCS += vpx_ports/msvc.h
simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
simple_encoder.DESCRIPTION = Simplified encoder loop simple_encoder.DESCRIPTION = Simplified encoder loop
EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_lossless_encoder.c EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_lossless_encoder.c
@@ -163,7 +154,6 @@ vp9_lossless_encoder.SRCS += ivfenc.h ivfenc.c
vp9_lossless_encoder.SRCS += tools_common.h tools_common.c vp9_lossless_encoder.SRCS += tools_common.h tools_common.c
vp9_lossless_encoder.SRCS += video_common.h vp9_lossless_encoder.SRCS += video_common.h
vp9_lossless_encoder.SRCS += video_writer.h video_writer.c vp9_lossless_encoder.SRCS += video_writer.h video_writer.c
vp9_lossless_encoder.SRCS += vpx_ports/msvc.h
vp9_lossless_encoder.GUID = B63C7C88-5348-46DC-A5A6-CC151EF93366 vp9_lossless_encoder.GUID = B63C7C88-5348-46DC-A5A6-CC151EF93366
vp9_lossless_encoder.DESCRIPTION = Simplified lossless VP9 encoder vp9_lossless_encoder.DESCRIPTION = Simplified lossless VP9 encoder
EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c
@@ -171,7 +161,6 @@ twopass_encoder.SRCS += ivfenc.h ivfenc.c
twopass_encoder.SRCS += tools_common.h tools_common.c twopass_encoder.SRCS += tools_common.h tools_common.c
twopass_encoder.SRCS += video_common.h twopass_encoder.SRCS += video_common.h
twopass_encoder.SRCS += video_writer.h video_writer.c twopass_encoder.SRCS += video_writer.h video_writer.c
twopass_encoder.SRCS += vpx_ports/msvc.h
twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8 twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8
twopass_encoder.DESCRIPTION = Two-pass encoder loop twopass_encoder.DESCRIPTION = Two-pass encoder loop
EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c
@@ -181,7 +170,6 @@ decode_with_drops.SRCS += video_common.h
decode_with_drops.SRCS += video_reader.h video_reader.c decode_with_drops.SRCS += video_reader.h video_reader.c
decode_with_drops.SRCS += vpx_ports/mem_ops.h decode_with_drops.SRCS += vpx_ports/mem_ops.h
decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h
decode_with_drops.SRCS += vpx_ports/msvc.h
decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26 decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
decode_with_drops.DESCRIPTION = Drops frames while decoding decode_with_drops.DESCRIPTION = Drops frames while decoding
EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c
@@ -189,7 +177,6 @@ set_maps.SRCS += ivfenc.h ivfenc.c
set_maps.SRCS += tools_common.h tools_common.c set_maps.SRCS += tools_common.h tools_common.c
set_maps.SRCS += video_common.h set_maps.SRCS += video_common.h
set_maps.SRCS += video_writer.h video_writer.c set_maps.SRCS += video_writer.h video_writer.c
set_maps.SRCS += vpx_ports/msvc.h
set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
set_maps.DESCRIPTION = Set active and ROI maps set_maps.DESCRIPTION = Set active and ROI maps
EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c
@@ -197,7 +184,6 @@ vp8cx_set_ref.SRCS += ivfenc.h ivfenc.c
vp8cx_set_ref.SRCS += tools_common.h tools_common.c vp8cx_set_ref.SRCS += tools_common.h tools_common.c
vp8cx_set_ref.SRCS += video_common.h vp8cx_set_ref.SRCS += video_common.h
vp8cx_set_ref.SRCS += video_writer.h video_writer.c vp8cx_set_ref.SRCS += video_writer.h video_writer.c
vp8cx_set_ref.SRCS += vpx_ports/msvc.h
vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame
@@ -208,7 +194,6 @@ EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8_multi_resolution_encoder.c
vp8_multi_resolution_encoder.SRCS += ivfenc.h ivfenc.c vp8_multi_resolution_encoder.SRCS += ivfenc.h ivfenc.c
vp8_multi_resolution_encoder.SRCS += tools_common.h tools_common.c vp8_multi_resolution_encoder.SRCS += tools_common.h tools_common.c
vp8_multi_resolution_encoder.SRCS += video_writer.h video_writer.c vp8_multi_resolution_encoder.SRCS += video_writer.h video_writer.c
vp8_multi_resolution_encoder.SRCS += vpx_ports/msvc.h
vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS) vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS)
vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de
vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
@@ -269,6 +254,14 @@ CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS))
$(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk)) $(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
# If this is a universal (fat) binary, then all the subarchitectures have
# already been built and our job is to stitch them together. The
# BUILD_OBJS variable indicates whether we should be building
# (compiling, linking) the library. The LIPO_OBJS variable indicates
# that we're stitching.
$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_OBJS,BUILD_OBJS):=yes)
# Create build/install dependencies for all examples. The common case # Create build/install dependencies for all examples. The common case
# is handled here. The MSVS case is handled below. # is handled here. The MSVS case is handled below.
NOT_MSVS = $(if $(CONFIG_MSVS),,yes) NOT_MSVS = $(if $(CONFIG_MSVS),,yes)
@@ -276,28 +269,24 @@ DIST-BINS-$(NOT_MSVS) += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX)))
INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX))) INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX)))
DIST-SRCS-yes += $(ALL_SRCS) DIST-SRCS-yes += $(ALL_SRCS)
INSTALL-SRCS-yes += $(UTIL_SRCS) INSTALL-SRCS-yes += $(UTIL_SRCS)
OBJS-$(NOT_MSVS) += $(call objs,$(ALL_SRCS)) OBJS-$(NOT_MSVS) += $(if $(BUILD_OBJS),$(call objs,$(ALL_SRCS)))
BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX))) BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX)))
# Instantiate linker template for all examples. # Instantiate linker template for all examples.
CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
ifneq ($(filter darwin%,$(TGT_OS)),) SHARED_LIB_SUF=$(if $(filter darwin%,$(TGT_OS)),.dylib,.so)
SHARED_LIB_SUF=.dylib
else
ifneq ($(filter os2%,$(TGT_OS)),)
SHARED_LIB_SUF=_dll.a
else
SHARED_LIB_SUF=.so
endif
endif
CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a) CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
$(foreach bin,$(BINS-yes),\ $(foreach bin,$(BINS-yes),\
$(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\ $(if $(BUILD_OBJS),$(eval $(bin):\
$(eval $(call linker_template,$(bin),\ $(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF)))\
$(if $(BUILD_OBJS),$(eval $(call linker_template,$(bin),\
$(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \ $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \
-l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\ -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\
))) )))\
$(if $(LIPO_OBJS),$(eval $(call lipo_bin_template,$(bin))))\
)
# The following pairs define a mapping of locations in the distribution # The following pairs define a mapping of locations in the distribution
# tree to locations in the source/build trees. # tree to locations in the source/build trees.
@@ -325,8 +314,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)=)\

View File

@@ -71,7 +71,7 @@ static void print_md5(FILE *stream, unsigned char digest[16]) {
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name); fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@@ -65,7 +65,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "Usage: %s <infile> <outfile> <N-M|N/M>\n", exec_name); fprintf(stderr, "Usage: %s <infile> <outfile> <N-M|N/M>\n", exec_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@@ -52,7 +52,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name); fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@@ -15,7 +15,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "../tools_common.h"
#include "../vp9/encoder/vp9_resize.h" #include "../vp9/encoder/vp9_resize.h"
static const char *exec_name = NULL; static const char *exec_name = NULL;
@@ -27,7 +26,7 @@ static void usage() {
printf("<output_yuv> [<frames>]\n"); printf("<output_yuv> [<frames>]\n");
} }
void usage_exit(void) { void usage_exit() {
usage(); usage();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@@ -55,7 +55,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n", fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
exec_name); exec_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);

View File

@@ -88,7 +88,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name); fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@@ -106,7 +106,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, fprintf(stderr,
"Usage: %s <codec> <width> <height> <infile> <outfile> " "Usage: %s <codec> <width> <height> <infile> <outfile> "
"<keyframe-interval> [<error-resilient>]\nSee comments in " "<keyframe-interval> [<error-resilient>]\nSee comments in "

View File

@@ -58,7 +58,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n", fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
exec_name); exec_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);

View File

@@ -37,14 +37,15 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include "vpx_ports/vpx_timer.h" #include "vpx_ports/vpx_timer.h"
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_encoder.h" #include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h" #include "vpx/vp8cx.h"
#include "vpx_ports/mem_ops.h" #include "vpx_ports/mem_ops.h"
#include "../tools_common.h" #include "./tools_common.h"
#define interface (vpx_codec_vp8_cx()) #define interface (vpx_codec_vp8_cx())
#define fourcc 0x30385056 #define fourcc 0x30385056
void usage_exit(void) { void usage_exit() {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@@ -58,7 +58,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile> <frame>\n", fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile> <frame>\n",
exec_name); exec_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);

View File

@@ -20,7 +20,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "vp9_lossless_encoder: Example demonstrating VP9 lossless " fprintf(stderr, "vp9_lossless_encoder: Example demonstrating VP9 lossless "
"encoding feature. Supports raw input only.\n"); "encoding feature. Supports raw input only.\n");
fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile>\n", exec_name); fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile>\n", exec_name);

View File

@@ -14,34 +14,24 @@
* that benefit from a scalable bitstream. * that benefit from a scalable bitstream.
*/ */
#include <math.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include "../args.h" #include "../args.h"
#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"
#include "../vpxstats.h" #include "../vpxstats.h"
#define OUTPUT_RC_STATS 1
static const arg_def_t skip_frames_arg = static const arg_def_t skip_frames_arg =
ARG_DEF("s", "skip-frames", 1, "input frames to skip"); ARG_DEF("s", "skip-frames", 1, "input frames to skip");
static const arg_def_t frames_arg = static const arg_def_t frames_arg =
ARG_DEF("f", "frames", 1, "number of frames to encode"); ARG_DEF("f", "frames", 1, "number of frames to encode");
static const arg_def_t threads_arg =
ARG_DEF("th", "threads", 1, "number of threads to use");
#if OUTPUT_RC_STATS
static const arg_def_t output_rc_stats_arg =
ARG_DEF("rcstat", "output_rc_stats", 1, "output rc stats");
#endif
static const arg_def_t width_arg = ARG_DEF("w", "width", 1, "source width"); static const arg_def_t width_arg = ARG_DEF("w", "width", 1, "source width");
static const arg_def_t height_arg = ARG_DEF("h", "height", 1, "source height"); static const arg_def_t height_arg = ARG_DEF("h", "height", 1, "source height");
static const arg_def_t timebase_arg = static const arg_def_t timebase_arg =
@@ -52,9 +42,6 @@ static const arg_def_t spatial_layers_arg =
ARG_DEF("sl", "spatial-layers", 1, "number of spatial SVC layers"); ARG_DEF("sl", "spatial-layers", 1, "number of spatial SVC layers");
static const arg_def_t temporal_layers_arg = static const arg_def_t temporal_layers_arg =
ARG_DEF("tl", "temporal-layers", 1, "number of temporal SVC layers"); ARG_DEF("tl", "temporal-layers", 1, "number of temporal SVC layers");
static const arg_def_t temporal_layering_mode_arg =
ARG_DEF("tlm", "temporal-layering-mode", 1, "temporal layering scheme."
"VP9E_TEMPORAL_LAYERING_MODE");
static const arg_def_t kf_dist_arg = static const arg_def_t kf_dist_arg =
ARG_DEF("k", "kf-dist", 1, "number of frames between keyframes"); ARG_DEF("k", "kf-dist", 1, "number of frames between keyframes");
static const arg_def_t scale_factors_arg = static const arg_def_t scale_factors_arg =
@@ -78,8 +65,6 @@ static const arg_def_t lag_in_frame_arg =
"generating any outputs"); "generating any outputs");
static const arg_def_t rc_end_usage_arg = 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 =
ARG_DEF("sp", "speed", 1, "speed configuration");
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
static const struct arg_enum_list bitdepth_enum[] = { static const struct arg_enum_list bitdepth_enum[] = {
@@ -100,16 +85,10 @@ static const arg_def_t *svc_args[] = {
&timebase_arg, &bitrate_arg, &skip_frames_arg, &spatial_layers_arg, &timebase_arg, &bitrate_arg, &skip_frames_arg, &spatial_layers_arg,
&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, &lag_in_frame_arg,
&lag_in_frame_arg, &threads_arg,
#if OUTPUT_RC_STATS
&output_rc_stats_arg,
#endif
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
&bitdepth_arg, &bitdepth_arg,
#endif #endif
&speed_arg,
&rc_end_usage_arg, NULL &rc_end_usage_arg, NULL
}; };
@@ -123,10 +102,6 @@ static const uint32_t default_bitrate = 1000;
static const uint32_t default_spatial_layers = 5; static const uint32_t default_spatial_layers = 5;
static const uint32_t default_temporal_layers = 1; static const uint32_t default_temporal_layers = 1;
static const uint32_t default_kf_dist = 100; static const uint32_t default_kf_dist = 100;
static const uint32_t default_temporal_layering_mode = 0;
static const uint32_t default_output_rc_stats = 0;
static const int32_t default_speed = -1; // -1 means use library default.
static const uint32_t default_threads = 0; // zero means use library default.
typedef struct { typedef struct {
const char *input_filename; const char *input_filename;
@@ -141,7 +116,7 @@ typedef struct {
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
fprintf(stderr, "Usage: %s <options> input_filename output_filename\n", fprintf(stderr, "Usage: %s <options> input_filename output_filename\n",
exec_name); exec_name);
fprintf(stderr, "Options:\n"); fprintf(stderr, "Options:\n");
@@ -168,12 +143,6 @@ static void parse_command_line(int argc, const char **argv_,
svc_ctx->log_level = SVC_LOG_DEBUG; svc_ctx->log_level = SVC_LOG_DEBUG;
svc_ctx->spatial_layers = default_spatial_layers; svc_ctx->spatial_layers = default_spatial_layers;
svc_ctx->temporal_layers = default_temporal_layers; svc_ctx->temporal_layers = default_temporal_layers;
svc_ctx->temporal_layering_mode = default_temporal_layering_mode;
#if OUTPUT_RC_STATS
svc_ctx->output_rc_stat = default_output_rc_stats;
#endif
svc_ctx->speed = default_speed;
svc_ctx->threads = default_threads;
// start with default encoder configuration // start with default encoder configuration
res = vpx_codec_enc_config_default(vpx_codec_vp9_cx(), enc_cfg, 0); res = vpx_codec_enc_config_default(vpx_codec_vp9_cx(), enc_cfg, 0);
@@ -215,20 +184,6 @@ static void parse_command_line(int argc, const char **argv_,
svc_ctx->spatial_layers = arg_parse_uint(&arg); svc_ctx->spatial_layers = arg_parse_uint(&arg);
} else if (arg_match(&arg, &temporal_layers_arg, argi)) { } else if (arg_match(&arg, &temporal_layers_arg, argi)) {
svc_ctx->temporal_layers = arg_parse_uint(&arg); svc_ctx->temporal_layers = arg_parse_uint(&arg);
#if OUTPUT_RC_STATS
} else if (arg_match(&arg, &output_rc_stats_arg, argi)) {
svc_ctx->output_rc_stat = arg_parse_uint(&arg);
#endif
} else if (arg_match(&arg, &speed_arg, argi)) {
svc_ctx->speed = arg_parse_uint(&arg);
} else if (arg_match(&arg, &threads_arg, argi)) {
svc_ctx->threads = arg_parse_uint(&arg);
} else if (arg_match(&arg, &temporal_layering_mode_arg, argi)) {
svc_ctx->temporal_layering_mode =
enc_cfg->temporal_layering_mode = arg_parse_int(&arg);
if (svc_ctx->temporal_layering_mode) {
enc_cfg->g_error_resilient = 1;
}
} else if (arg_match(&arg, &kf_dist_arg, argi)) { } else if (arg_match(&arg, &kf_dist_arg, argi)) {
enc_cfg->kf_min_dist = arg_parse_uint(&arg); enc_cfg->kf_min_dist = arg_parse_uint(&arg);
enc_cfg->kf_max_dist = enc_cfg->kf_min_dist; enc_cfg->kf_max_dist = enc_cfg->kf_min_dist;
@@ -361,185 +316,6 @@ static void parse_command_line(int argc, const char **argv_,
enc_cfg->rc_target_bitrate, enc_cfg->kf_max_dist); enc_cfg->rc_target_bitrate, enc_cfg->kf_max_dist);
} }
#if OUTPUT_RC_STATS
// For rate control encoding stats.
struct RateControlStats {
// Number of input frames per layer.
int layer_input_frames[VPX_MAX_LAYERS];
// Total (cumulative) number of encoded frames per layer.
int layer_tot_enc_frames[VPX_MAX_LAYERS];
// Number of encoded non-key frames per layer.
int layer_enc_frames[VPX_MAX_LAYERS];
// Framerate per layer (cumulative).
double layer_framerate[VPX_MAX_LAYERS];
// Target average frame size per layer (per-frame-bandwidth per layer).
double layer_pfb[VPX_MAX_LAYERS];
// Actual average frame size per layer.
double layer_avg_frame_size[VPX_MAX_LAYERS];
// Average rate mismatch per layer (|target - actual| / target).
double layer_avg_rate_mismatch[VPX_MAX_LAYERS];
// Actual encoding bitrate per layer (cumulative).
double layer_encoding_bitrate[VPX_MAX_LAYERS];
// Average of the short-time encoder actual bitrate.
// TODO(marpan): Should we add these short-time stats for each layer?
double avg_st_encoding_bitrate;
// Variance of the short-time encoder actual bitrate.
double variance_st_encoding_bitrate;
// Window (number of frames) for computing short-time encoding bitrate.
int window_size;
// Number of window measurements.
int window_count;
};
// Note: these rate control stats assume only 1 key frame in the
// sequence (i.e., first frame only).
static void set_rate_control_stats(struct RateControlStats *rc,
vpx_codec_enc_cfg_t *cfg) {
unsigned int sl, tl;
// Set the layer (cumulative) framerate and the target layer (non-cumulative)
// per-frame-bandwidth, for the rate control encoding stats below.
const double framerate = cfg->g_timebase.den / cfg->g_timebase.num;
for (sl = 0; sl < cfg->ss_number_layers; ++sl) {
for (tl = 0; tl < cfg->ts_number_layers; ++tl) {
const int layer = sl * cfg->ts_number_layers + tl;
const int tlayer0 = sl * cfg->ts_number_layers;
rc->layer_framerate[layer] =
framerate / cfg->ts_rate_decimator[tl];
if (tl > 0) {
rc->layer_pfb[layer] = 1000.0 *
(cfg->layer_target_bitrate[layer] -
cfg->layer_target_bitrate[layer - 1]) /
(rc->layer_framerate[layer] -
rc->layer_framerate[layer - 1]);
} else {
rc->layer_pfb[tlayer0] = 1000.0 *
cfg->layer_target_bitrate[tlayer0] /
rc->layer_framerate[tlayer0];
}
rc->layer_input_frames[layer] = 0;
rc->layer_enc_frames[layer] = 0;
rc->layer_tot_enc_frames[layer] = 0;
rc->layer_encoding_bitrate[layer] = 0.0;
rc->layer_avg_frame_size[layer] = 0.0;
rc->layer_avg_rate_mismatch[layer] = 0.0;
}
}
rc->window_count = 0;
rc->window_size = 15;
rc->avg_st_encoding_bitrate = 0.0;
rc->variance_st_encoding_bitrate = 0.0;
}
static void printout_rate_control_summary(struct RateControlStats *rc,
vpx_codec_enc_cfg_t *cfg,
int frame_cnt) {
unsigned int sl, tl;
int tot_num_frames = 0;
double perc_fluctuation = 0.0;
printf("Total number of processed frames: %d\n\n", frame_cnt - 1);
printf("Rate control layer stats for sl%d tl%d layer(s):\n\n",
cfg->ss_number_layers, cfg->ts_number_layers);
for (sl = 0; sl < cfg->ss_number_layers; ++sl) {
for (tl = 0; tl < cfg->ts_number_layers; ++tl) {
const int layer = sl * cfg->ts_number_layers + tl;
const int num_dropped = (tl > 0) ?
(rc->layer_input_frames[layer] - rc->layer_enc_frames[layer]) :
(rc->layer_input_frames[layer] - rc->layer_enc_frames[layer] - 1);
if (!sl)
tot_num_frames += rc->layer_input_frames[layer];
rc->layer_encoding_bitrate[layer] = 0.001 * rc->layer_framerate[layer] *
rc->layer_encoding_bitrate[layer] / tot_num_frames;
rc->layer_avg_frame_size[layer] = rc->layer_avg_frame_size[layer] /
rc->layer_enc_frames[layer];
rc->layer_avg_rate_mismatch[layer] =
100.0 * rc->layer_avg_rate_mismatch[layer] /
rc->layer_enc_frames[layer];
printf("For layer#: sl%d tl%d \n", sl, tl);
printf("Bitrate (target vs actual): %d %f.0 kbps\n",
cfg->layer_target_bitrate[layer],
rc->layer_encoding_bitrate[layer]);
printf("Average frame size (target vs actual): %f %f bits\n",
rc->layer_pfb[layer], rc->layer_avg_frame_size[layer]);
printf("Average rate_mismatch: %f\n",
rc->layer_avg_rate_mismatch[layer]);
printf("Number of input frames, encoded (non-key) frames, "
"and percent dropped frames: %d %d %f.0 \n",
rc->layer_input_frames[layer], rc->layer_enc_frames[layer],
100.0 * num_dropped / rc->layer_input_frames[layer]);
printf("\n");
}
}
rc->avg_st_encoding_bitrate = rc->avg_st_encoding_bitrate / rc->window_count;
rc->variance_st_encoding_bitrate =
rc->variance_st_encoding_bitrate / rc->window_count -
(rc->avg_st_encoding_bitrate * rc->avg_st_encoding_bitrate);
perc_fluctuation = 100.0 * sqrt(rc->variance_st_encoding_bitrate) /
rc->avg_st_encoding_bitrate;
printf("Short-time stats, for window of %d frames: \n", rc->window_size);
printf("Average, rms-variance, and percent-fluct: %f %f %f \n",
rc->avg_st_encoding_bitrate,
sqrt(rc->variance_st_encoding_bitrate),
perc_fluctuation);
if (frame_cnt != tot_num_frames)
die("Error: Number of input frames not equal to output encoded frames != "
"%d tot_num_frames = %d\n", frame_cnt, tot_num_frames);
}
vpx_codec_err_t parse_superframe_index(const uint8_t *data,
size_t data_sz,
uint32_t sizes[8], int *count) {
// A chunk ending with a byte matching 0xc0 is an invalid chunk unless
// it is a super frame index. If the last byte of real video compression
// data is 0xc0 the encoder must add a 0 byte. If we have the marker but
// not the associated matching marker byte at the front of the index we have
// an invalid bitstream and need to return an error.
uint8_t marker;
marker = *(data + data_sz - 1);
*count = 0;
if ((marker & 0xe0) == 0xc0) {
const uint32_t frames = (marker & 0x7) + 1;
const uint32_t mag = ((marker >> 3) & 0x3) + 1;
const size_t index_sz = 2 + mag * frames;
// This chunk is marked as having a superframe index but doesn't have
// enough data for it, thus it's an invalid superframe index.
if (data_sz < index_sz)
return VPX_CODEC_CORRUPT_FRAME;
{
const uint8_t marker2 = *(data + data_sz - index_sz);
// This chunk is marked as having a superframe index but doesn't have
// the matching marker byte at the front of the index therefore it's an
// invalid chunk.
if (marker != marker2)
return VPX_CODEC_CORRUPT_FRAME;
}
{
// Found a valid superframe index.
uint32_t i, j;
const uint8_t *x = &data[data_sz - index_sz + 1];
for (i = 0; i < frames; ++i) {
uint32_t this_sz = 0;
for (j = 0; j < mag; ++j)
this_sz |= (*x++) << (j * 8);
sizes[i] = this_sz;
}
*count = frames;
}
}
return VPX_CODEC_OK;
}
#endif
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;
@@ -556,17 +332,7 @@ int main(int argc, const char **argv) {
FILE *infile = NULL; FILE *infile = NULL;
int end_of_stream = 0; int end_of_stream = 0;
int frames_received = 0; int frames_received = 0;
#if OUTPUT_RC_STATS
VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = {NULL};
struct RateControlStats rc;
vpx_svc_layer_id_t layer_id;
int sl, tl;
double sum_bitrate = 0.0;
double sum_bitrate2 = 0.0;
double framerate = 30.0;
#endif
struct vpx_usec_timer timer;
int64_t cx_time = 0;
memset(&svc_ctx, 0, sizeof(svc_ctx)); 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];
@@ -593,13 +359,6 @@ int main(int argc, const char **argv) {
VPX_CODEC_OK) VPX_CODEC_OK)
die("Failed to initialize encoder\n"); die("Failed to initialize encoder\n");
#if OUTPUT_RC_STATS
if (svc_ctx.output_rc_stat) {
set_rate_control_stats(&rc, &enc_cfg);
framerate = enc_cfg.g_timebase.den / enc_cfg.g_timebase.num;
}
#endif
info.codec_fourcc = VP9_FOURCC; info.codec_fourcc = VP9_FOURCC;
info.time_base.numerator = enc_cfg.g_timebase.num; info.time_base.numerator = enc_cfg.g_timebase.num;
info.time_base.denominator = enc_cfg.g_timebase.den; info.time_base.denominator = enc_cfg.g_timebase.den;
@@ -611,34 +370,11 @@ int main(int argc, const char **argv) {
if (!writer) if (!writer)
die("Failed to open %s for writing\n", app_input.output_filename); die("Failed to open %s for writing\n", app_input.output_filename);
} }
#if OUTPUT_RC_STATS
// For now, just write temporal layer streams.
// TODO(wonkap): do spatial by re-writing superframe.
if (svc_ctx.output_rc_stat) {
for (tl = 0; tl < enc_cfg.ts_number_layers; ++tl) {
char file_name[PATH_MAX];
snprintf(file_name, sizeof(file_name), "%s_t%d.ivf",
app_input.output_filename, tl);
outfile[tl] = vpx_video_writer_open(file_name, kContainerIVF, &info);
if (!outfile[tl])
die("Failed to open %s for writing", file_name);
}
}
#endif
// skip initial frames // skip initial frames
for (i = 0; i < app_input.frames_to_skip; ++i) for (i = 0; i < app_input.frames_to_skip; ++i)
vpx_img_read(&raw, infile); vpx_img_read(&raw, infile);
if (svc_ctx.speed != -1)
vpx_codec_control(&codec, VP8E_SET_CPUUSED, svc_ctx.speed);
if (svc_ctx.threads)
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (svc_ctx.threads >> 1));
if (svc_ctx.speed >= 5)
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
// Encode frames // Encode frames
while (!end_of_stream) { while (!end_of_stream) {
vpx_codec_iter_t iter = NULL; vpx_codec_iter_t iter = NULL;
@@ -649,13 +385,8 @@ int main(int argc, const char **argv) {
end_of_stream = 1; end_of_stream = 1;
} }
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, 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) {
die_codec(&codec, "Failed to encode frame"); die_codec(&codec, "Failed to encode frame");
@@ -664,90 +395,11 @@ int main(int argc, const char **argv) {
while ((cx_pkt = vpx_codec_get_cx_data(&codec, &iter)) != NULL) { while ((cx_pkt = vpx_codec_get_cx_data(&codec, &iter)) != NULL) {
switch (cx_pkt->kind) { switch (cx_pkt->kind) {
case VPX_CODEC_CX_FRAME_PKT: { case VPX_CODEC_CX_FRAME_PKT: {
if (cx_pkt->data.frame.sz > 0) { if (cx_pkt->data.frame.sz > 0)
#if OUTPUT_RC_STATS
uint32_t sizes[8];
int count = 0;
#endif
vpx_video_writer_write_frame(writer, vpx_video_writer_write_frame(writer,
cx_pkt->data.frame.buf, cx_pkt->data.frame.buf,
cx_pkt->data.frame.sz, cx_pkt->data.frame.sz,
cx_pkt->data.frame.pts); cx_pkt->data.frame.pts);
#if OUTPUT_RC_STATS
// TODO(marpan/wonkap): Put this (to line728) in separate function.
if (svc_ctx.output_rc_stat) {
vpx_codec_control(&codec, VP9E_GET_SVC_LAYER_ID, &layer_id);
parse_superframe_index(cx_pkt->data.frame.buf,
cx_pkt->data.frame.sz, sizes, &count);
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
layer_id.temporal_layer_id];
}
for (tl = layer_id.temporal_layer_id;
tl < enc_cfg.ts_number_layers; ++tl) {
vpx_video_writer_write_frame(outfile[tl],
cx_pkt->data.frame.buf,
cx_pkt->data.frame.sz,
cx_pkt->data.frame.pts);
}
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
for (tl = layer_id.temporal_layer_id;
tl < enc_cfg.ts_number_layers; ++tl) {
const int layer = sl * enc_cfg.ts_number_layers + tl;
++rc.layer_tot_enc_frames[layer];
rc.layer_encoding_bitrate[layer] += 8.0 * sizes[sl];
// Keep count of rate control stats per layer, for non-key
// frames.
if (tl == layer_id.temporal_layer_id &&
!(cx_pkt->data.frame.flags & VPX_FRAME_IS_KEY)) {
rc.layer_avg_frame_size[layer] += 8.0 * sizes[sl];
rc.layer_avg_rate_mismatch[layer] +=
fabs(8.0 * sizes[sl] - rc.layer_pfb[layer]) /
rc.layer_pfb[layer];
++rc.layer_enc_frames[layer];
}
}
}
// Update for short-time encoding bitrate states, for moving
// window of size rc->window, shifted by rc->window / 2.
// Ignore first window segment, due to key frame.
if (frame_cnt > rc.window_size) {
tl = layer_id.temporal_layer_id;
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
sum_bitrate += 0.001 * 8.0 * sizes[sl] * framerate;
}
if (frame_cnt % rc.window_size == 0) {
rc.window_count += 1;
rc.avg_st_encoding_bitrate += sum_bitrate / rc.window_size;
rc.variance_st_encoding_bitrate +=
(sum_bitrate / rc.window_size) *
(sum_bitrate / rc.window_size);
sum_bitrate = 0.0;
}
}
// Second shifted window.
if (frame_cnt > rc.window_size + rc.window_size / 2) {
tl = layer_id.temporal_layer_id;
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
sum_bitrate2 += 0.001 * 8.0 * sizes[sl] * framerate;
}
if (frame_cnt > 2 * rc.window_size &&
frame_cnt % rc.window_size == 0) {
rc.window_count += 1;
rc.avg_st_encoding_bitrate += sum_bitrate2 / rc.window_size;
rc.variance_st_encoding_bitrate +=
(sum_bitrate2 / rc.window_size) *
(sum_bitrate2 / rc.window_size);
sum_bitrate2 = 0.0;
}
}
}
#endif
}
printf("SVC frame: %d, kf: %d, size: %d, pts: %d\n", frames_received, printf("SVC frame: %d, kf: %d, size: %d, pts: %d\n", frames_received,
!!(cx_pkt->data.frame.flags & VPX_FRAME_IS_KEY), !!(cx_pkt->data.frame.flags & VPX_FRAME_IS_KEY),
@@ -772,34 +424,25 @@ int main(int argc, const char **argv) {
pts += frame_duration; pts += frame_duration;
} }
} }
printf("Processed %d frames\n", frame_cnt); printf("Processed %d frames\n", frame_cnt);
fclose(infile); fclose(infile);
#if OUTPUT_RC_STATS
if (svc_ctx.output_rc_stat) {
printout_rate_control_summary(&rc, &enc_cfg, frame_cnt);
printf("\n");
}
#endif
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec"); if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec");
if (app_input.passes == 2) if (app_input.passes == 2)
stats_close(&app_input.rc_stats, 1); stats_close(&app_input.rc_stats, 1);
if (writer) { if (writer) {
vpx_video_writer_close(writer); vpx_video_writer_close(writer);
} }
#if OUTPUT_RC_STATS
if (svc_ctx.output_rc_stat) {
for (tl = 0; tl < enc_cfg.ts_number_layers; ++tl) {
vpx_video_writer_close(outfile[tl]);
}
}
#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));
vpx_svc_release(&svc_ctx); vpx_svc_release(&svc_ctx);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@@ -28,7 +28,7 @@
static const char *exec_name; static const char *exec_name;
void usage_exit(void) { void usage_exit() {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -70,7 +70,6 @@ struct RateControlMetrics {
int window_size; int window_size;
// Number of window measurements. // Number of window measurements.
int window_count; int window_count;
int layer_target_bitrate[VPX_MAX_LAYERS];
}; };
// Note: these rate control metrics assume only 1 key frame in the // Note: these rate control metrics assume only 1 key frame in the
@@ -86,13 +85,13 @@ static void set_rate_control_metrics(struct RateControlMetrics *rc,
// per-frame-bandwidth, for the rate control encoding stats below. // per-frame-bandwidth, for the rate control encoding stats below.
const double framerate = cfg->g_timebase.den / cfg->g_timebase.num; const double framerate = cfg->g_timebase.den / cfg->g_timebase.num;
rc->layer_framerate[0] = framerate / cfg->ts_rate_decimator[0]; rc->layer_framerate[0] = framerate / cfg->ts_rate_decimator[0];
rc->layer_pfb[0] = 1000.0 * rc->layer_target_bitrate[0] / rc->layer_pfb[0] = 1000.0 * cfg->ts_target_bitrate[0] /
rc->layer_framerate[0]; rc->layer_framerate[0];
for (i = 0; i < cfg->ts_number_layers; ++i) { for (i = 0; i < cfg->ts_number_layers; ++i) {
if (i > 0) { if (i > 0) {
rc->layer_framerate[i] = framerate / cfg->ts_rate_decimator[i]; rc->layer_framerate[i] = framerate / cfg->ts_rate_decimator[i];
rc->layer_pfb[i] = 1000.0 * rc->layer_pfb[i] = 1000.0 *
(rc->layer_target_bitrate[i] - rc->layer_target_bitrate[i - 1]) / (cfg->ts_target_bitrate[i] - cfg->ts_target_bitrate[i - 1]) /
(rc->layer_framerate[i] - rc->layer_framerate[i - 1]); (rc->layer_framerate[i] - rc->layer_framerate[i - 1]);
} }
rc->layer_input_frames[i] = 0; rc->layer_input_frames[i] = 0;
@@ -129,7 +128,7 @@ static void printout_rate_control_summary(struct RateControlMetrics *rc,
rc->layer_avg_rate_mismatch[i] = 100.0 * rc->layer_avg_rate_mismatch[i] / rc->layer_avg_rate_mismatch[i] = 100.0 * rc->layer_avg_rate_mismatch[i] /
rc->layer_enc_frames[i]; rc->layer_enc_frames[i];
printf("For layer#: %d \n", i); printf("For layer#: %d \n", i);
printf("Bitrate (target vs actual): %d %f \n", rc->layer_target_bitrate[i], printf("Bitrate (target vs actual): %d %f \n", cfg->ts_target_bitrate[i],
rc->layer_encoding_bitrate[i]); rc->layer_encoding_bitrate[i]);
printf("Average frame size (target vs actual): %f %f \n", rc->layer_pfb[i], printf("Average frame size (target vs actual): %f %f \n", rc->layer_pfb[i],
rc->layer_avg_frame_size[i]); rc->layer_avg_frame_size[i]);
@@ -598,16 +597,13 @@ int main(int argc, char **argv) {
for (i = min_args_base; for (i = min_args_base;
(int)i < min_args_base + mode_to_num_layers[layering_mode]; (int)i < min_args_base + mode_to_num_layers[layering_mode];
++i) { ++i) {
rc.layer_target_bitrate[i - 11] = strtol(argv[i], NULL, 0); cfg.ts_target_bitrate[i - 11] = strtol(argv[i], NULL, 0);
if (strncmp(encoder->name, "vp8", 3) == 0)
cfg.ts_target_bitrate[i - 11] = rc.layer_target_bitrate[i - 11];
else if (strncmp(encoder->name, "vp9", 3) == 0)
cfg.layer_target_bitrate[i - 11] = rc.layer_target_bitrate[i - 11];
} }
// Real time parameters. // Real time parameters.
cfg.rc_dropframe_thresh = strtol(argv[9], NULL, 0); cfg.rc_dropframe_thresh = strtol(argv[9], NULL, 0);
cfg.rc_end_usage = VPX_CBR; cfg.rc_end_usage = VPX_CBR;
cfg.rc_resize_allowed = 0;
cfg.rc_min_quantizer = 2; cfg.rc_min_quantizer = 2;
cfg.rc_max_quantizer = 56; cfg.rc_max_quantizer = 56;
if (strncmp(encoder->name, "vp9", 3) == 0) if (strncmp(encoder->name, "vp9", 3) == 0)
@@ -618,9 +614,6 @@ int main(int argc, char **argv) {
cfg.rc_buf_optimal_sz = 600; cfg.rc_buf_optimal_sz = 600;
cfg.rc_buf_sz = 1000; cfg.rc_buf_sz = 1000;
// Disable dynamic resizing by default.
cfg.rc_resize_allowed = 0;
// Use 1 thread as default. // Use 1 thread as default.
cfg.g_threads = 1; cfg.g_threads = 1;
@@ -632,8 +625,6 @@ int main(int argc, char **argv) {
// Disable automatic keyframe placement. // Disable automatic keyframe placement.
cfg.kf_min_dist = cfg.kf_max_dist = 3000; cfg.kf_min_dist = cfg.kf_max_dist = 3000;
cfg.temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS;
set_temporal_layer_pattern(layering_mode, set_temporal_layer_pattern(layering_mode,
&cfg, &cfg,
layer_flags, layer_flags,
@@ -642,8 +633,8 @@ int main(int argc, char **argv) {
set_rate_control_metrics(&rc, &cfg); set_rate_control_metrics(&rc, &cfg);
// Target bandwidth for the whole stream. // Target bandwidth for the whole stream.
// Set to layer_target_bitrate for highest layer (total bitrate). // Set to ts_target_bitrate for highest layer (total bitrate).
cfg.rc_target_bitrate = rc.layer_target_bitrate[cfg.ts_number_layers - 1]; cfg.rc_target_bitrate = cfg.ts_target_bitrate[cfg.ts_number_layers - 1];
// Open input file. // Open input file.
if (!(infile = fopen(argv[1], "rb"))) { if (!(infile = fopen(argv[1], "rb"))) {
@@ -683,26 +674,18 @@ 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, kDenoiserOnYOnly);
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 0); vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
} else if (strncmp(encoder->name, "vp9", 3) == 0) { } else if (strncmp(encoder->name, "vp9", 3) == 0) {
vpx_svc_extra_cfg_t svc_params; vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
vpx_codec_control(&codec, 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_TILE_COLUMNS, (cfg.g_threads >> 1));
vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0); if (vpx_codec_control(&codec, VP9E_SET_SVC, layering_mode > 0 ? 1: 0)) {
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (cfg.g_threads >> 1)); die_codec(&codec, "Failed to set SVC");
if (vpx_codec_control(&codec, VP9E_SET_SVC, layering_mode > 0 ? 1: 0))
die_codec(&codec, "Failed to set SVC");
for (i = 0; i < cfg.ts_number_layers; ++i) {
svc_params.max_quantizers[i] = cfg.rc_max_quantizer;
svc_params.min_quantizers[i] = cfg.rc_min_quantizer;
} }
svc_params.scaling_factor_num[0] = cfg.g_h;
svc_params.scaling_factor_den[0] = cfg.g_h;
vpx_codec_control(&codec, VP9E_SET_SVC_PARAMETERS, &svc_params);
} }
if (strncmp(encoder->name, "vp8", 3) == 0) { if (strncmp(encoder->name, "vp8", 3) == 0) {
vpx_codec_control(&codec, VP8E_SET_SCREEN_CONTENT_MODE, 0); vpx_codec_control(&codec, VP8E_SET_SCREEN_CONTENT_MODE, 0);

223
libs.mk
View File

@@ -25,7 +25,7 @@ $$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2)
@echo " [CREATE] $$@" @echo " [CREATE] $$@"
$$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \ $$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \
--sym=$(1) \ --sym=$(1) \
--config=$$(CONFIG_DIR)$$(target)-$$(TOOLCHAIN).mk \ --config=$$(CONFIG_DIR)$$(target)$$(if $$(FAT_ARCHS),,-$$(TOOLCHAIN)).mk \
$$(RTCD_OPTIONS) $$^ > $$@ $$(RTCD_OPTIONS) $$^ > $$@
CLEAN-OBJS += $$(BUILD_PFX)$(1).h CLEAN-OBJS += $$(BUILD_PFX)$(1).h
RTCD += $$(BUILD_PFX)$(1).h RTCD += $$(BUILD_PFX)$(1).h
@@ -34,6 +34,13 @@ endef
CODEC_SRCS-yes += CHANGELOG CODEC_SRCS-yes += CHANGELOG
CODEC_SRCS-yes += libs.mk CODEC_SRCS-yes += libs.mk
# If this is a universal (fat) binary, then all the subarchitectures have
# already been built and our job is to stitch them together. The
# BUILD_LIBVPX variable indicates whether we should be building
# (compiling, linking) the library. The LIPO_LIBVPX variable indicates
# that we're stitching.
$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
include $(SRC_PATH_BARE)/vpx/vpx_codec.mk include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS)) CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS)) CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS))
@@ -47,13 +54,7 @@ CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk
CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS)) CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
include $(SRC_PATH_BARE)/vpx_dsp/vpx_dsp.mk ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
CODEC_SRCS-yes += $(addprefix vpx_dsp/,$(call enabled,DSP_SRCS))
include $(SRC_PATH_BARE)/vpx_util/vpx_util.mk
CODEC_SRCS-yes += $(addprefix vpx_util/,$(call enabled,UTIL_SRCS))
ifeq ($(CONFIG_VP8),yes)
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 +77,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 +110,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
@@ -170,18 +137,18 @@ INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%)
INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%) INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
endif endif
CODEC_SRCS-yes += build/make/version.sh CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
CODEC_SRCS-yes += build/make/rtcd.pl CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.pl
CODEC_SRCS-yes += vpx_ports/emmintrin_compat.h CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h
CODEC_SRCS-yes += vpx_ports/mem_ops.h CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops.h
CODEC_SRCS-yes += vpx_ports/mem_ops_aligned.h CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops_aligned.h
CODEC_SRCS-yes += vpx_ports/vpx_once.h CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h
CODEC_SRCS-yes += $(BUILD_PFX)vpx_config.c CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
ifeq ($(ARCH_X86)$(ARCH_X86_64),yes) ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm
endif endif
CODEC_EXPORTS-yes += vpx/exports_com CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com
CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
@@ -248,7 +215,7 @@ vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def
$(filter-out $(addprefix %, $(ASM_INCLUDES)), $^) \ $(filter-out $(addprefix %, $(ASM_INCLUDES)), $^) \
--src-path-bare="$(SRC_PATH_BARE)" \ --src-path-bare="$(SRC_PATH_BARE)" \
PROJECTS-yes += vpx.$(VCPROJ_SFX) PROJECTS-$(BUILD_LIBVPX) += vpx.$(VCPROJ_SFX)
vpx.$(VCPROJ_SFX): vpx_config.asm vpx.$(VCPROJ_SFX): vpx_config.asm
vpx.$(VCPROJ_SFX): $(RTCD) vpx.$(VCPROJ_SFX): $(RTCD)
@@ -256,42 +223,32 @@ vpx.$(VCPROJ_SFX): $(RTCD)
endif endif
else else
LIBVPX_OBJS=$(call objs,$(CODEC_SRCS)) LIBVPX_OBJS=$(call objs,$(CODEC_SRCS))
OBJS-yes += $(LIBVPX_OBJS) OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS)
LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a LIBS-$(if $(BUILD_LIBVPX),$(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 := 2
SO_VERSION_MINOR := 0 BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED))
SO_VERSION_PATCH := 0
ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS)) ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
LIBVPX_SO := libvpx.$(SO_VERSION_MAJOR).dylib LIBVPX_SO := libvpx.$(VERSION_MAJOR).dylib
SHARED_LIB_SUF := .dylib
EXPORT_FILE := libvpx.syms EXPORT_FILE := libvpx.syms
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \ LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
libvpx.dylib ) libvpx.dylib )
else else
ifeq ($(filter os2%,$(TGT_OS)),$(TGT_OS)) LIBVPX_SO := libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
LIBVPX_SO := libvpx$(SO_VERSION_MAJOR).dll
SHARED_LIB_SUF := _dll.a
EXPORT_FILE := libvpx.def
LIBVPX_SO_SYMLINKS :=
LIBVPX_SO_IMPLIB := libvpx_dll.a
else
LIBVPX_SO := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH)
SHARED_LIB_SUF := .so
EXPORT_FILE := libvpx.ver EXPORT_FILE := libvpx.ver
SYM_LINK := libvpx.so
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \ LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \ libvpx.so libvpx.so.$(VERSION_MAJOR) \
libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR)) libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR))
endif
endif endif
LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\ LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)\
$(notdir $(LIBVPX_SO_SYMLINKS)) \ $(notdir $(LIBVPX_SO_SYMLINKS))
$(if $(LIBVPX_SO_IMPLIB), $(BUILD_PFX)$(LIBVPX_SO_IMPLIB))
$(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE) $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE)
$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR) $(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(VERSION_MAJOR)
$(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE) $(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)
libvpx.ver: $(call enabled,CODEC_EXPORTS) libvpx.ver: $(call enabled,CODEC_EXPORTS)
@@ -306,19 +263,6 @@ libvpx.syms: $(call enabled,CODEC_EXPORTS)
$(qexec)awk '{print "_"$$2}' $^ >$@ $(qexec)awk '{print "_"$$2}' $^ >$@
CLEAN-OBJS += libvpx.syms CLEAN-OBJS += libvpx.syms
libvpx.def: $(call enabled,CODEC_EXPORTS)
@echo " [CREATE] $@"
$(qexec)echo LIBRARY $(LIBVPX_SO:.dll=) INITINSTANCE TERMINSTANCE > $@
$(qexec)echo "DATA MULTIPLE NONSHARED" >> $@
$(qexec)echo "EXPORTS" >> $@
$(qexec)awk '!/vpx_svc_*/ {print "_"$$2}' $^ >>$@
CLEAN-OBJS += libvpx.def
libvpx_dll.a: $(LIBVPX_SO)
@echo " [IMPLIB] $@"
$(qexec)emximp -o $@ $<
CLEAN-OBJS += libvpx_dll.a
define libvpx_symlink_template define libvpx_symlink_template
$(1): $(2) $(1): $(2)
@echo " [LN] $(2) $$@" @echo " [LN] $(2) $$@"
@@ -334,12 +278,11 @@ $(eval $(call libvpx_symlink_template,\
$(LIBVPX_SO))) $(LIBVPX_SO)))
INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS) INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBVPX_SO_SYMLINKS)
INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO) INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBSUBDIR)/$(LIBVPX_SO)
INSTALL-LIBS-$(CONFIG_SHARED) += $(if $(LIBVPX_SO_IMPLIB),$(LIBSUBDIR)/$(LIBVPX_SO_IMPLIB))
LIBS-yes += vpx.pc LIBS-$(BUILD_LIBVPX) += vpx.pc
vpx.pc: config.mk libs.mk vpx.pc: config.mk libs.mk
@echo " [CREATE] $@" @echo " [CREATE] $@"
$(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@ $(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
@@ -365,6 +308,9 @@ INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
CLEAN-OBJS += vpx.pc CLEAN-OBJS += vpx.pc
endif endif
LIBS-$(LIPO_LIBVPX) += libvpx.a
$(eval $(if $(LIPO_LIBVPX),$(call lipo_lib_template,libvpx.a)))
# #
# Rule to make assembler configuration file from C configuration file # Rule to make assembler configuration file from C configuration file
# #
@@ -403,15 +349,11 @@ LIBVPX_TEST_DATA_PATH ?= .
include $(SRC_PATH_BARE)/test/test.mk include $(SRC_PATH_BARE)/test/test.mk
LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS)) LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS))
LIBVPX_TEST_BIN=./test_libvpx$(EXE_SFX) LIBVPX_TEST_BINS=./test_libvpx$(EXE_SFX)
LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\ LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
$(call enabled,LIBVPX_TEST_DATA)) $(call enabled,LIBVPX_TEST_DATA))
libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1) libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1)
TEST_INTRA_PRED_SPEED_BIN=./test_intra_pred_speed$(EXE_SFX)
TEST_INTRA_PRED_SPEED_SRCS=$(addprefix test/,$(call enabled,TEST_INTRA_PRED_SPEED_SRCS))
TEST_INTRA_PRED_SPEED_OBJS := $(sort $(call objs,$(TEST_INTRA_PRED_SPEED_SRCS)))
libvpx_test_srcs.txt: libvpx_test_srcs.txt:
@echo " [CREATE] $@" @echo " [CREATE] $@"
@echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@ @echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
@@ -475,25 +417,7 @@ test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_
PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX) PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX)
LIBVPX_TEST_BIN := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BIN))) LIBVPX_TEST_BINS := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BINS)))
ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
PROJECTS-$(CONFIG_MSVS) += test_intra_pred_speed.$(VCPROJ_SFX)
test_intra_pred_speed.$(VCPROJ_SFX): $(TEST_INTRA_PRED_SPEED_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
@echo " [CREATE] $@"
$(qexec)$(GEN_VCPROJ) \
--exe \
--target=$(TOOLCHAIN) \
--name=test_intra_pred_speed \
-D_VARIADIC_MAX=10 \
--proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
--ver=$(CONFIG_VS_VERSION) \
--src-path-bare="$(SRC_PATH_BARE)" \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
-L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
endif # TEST_INTRA_PRED_SPEED
endif endif
else else
@@ -504,54 +428,45 @@ ifeq ($(filter win%,$(TGT_OS)),$(TGT_OS))
# Disabling pthreads globally will cause issues on darwin and possibly elsewhere # Disabling pthreads globally will cause issues on darwin and possibly elsewhere
$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -DGTEST_HAS_PTHREAD=0 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -DGTEST_HAS_PTHREAD=0
endif endif
GTEST_INCLUDES := -I$(SRC_PATH_BARE)/third_party/googletest/src $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
GTEST_INCLUDES += -I$(SRC_PATH_BARE)/third_party/googletest/src/include $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES) OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS)
OBJS-yes += $(GTEST_OBJS) LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
LIBS-yes += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
$(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS) $(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS))) LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS)))
$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES) $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
OBJS-yes += $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
BINS-yes += $(LIBVPX_TEST_BIN) OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS)
BINS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_BINS)
CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a) CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a)
TEST_LIBS := lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a $(foreach bin,$(LIBVPX_TEST_BINS),\
$(LIBVPX_TEST_BIN): $(TEST_LIBS) $(if $(BUILD_LIBVPX),$(eval $(bin): \
$(eval $(call linkerxx_template,$(LIBVPX_TEST_BIN), \ lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a ))\
$(LIBVPX_TEST_OBJS) \ $(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\
-L. -lvpx -lgtest $(extralibs) -lm)) $(LIBVPX_TEST_OBJS) \
-L. -lvpx -lgtest $(extralibs) -lm)\
)))\
$(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\
ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),) endif
$(TEST_INTRA_PRED_SPEED_OBJS) $(TEST_INTRA_PRED_SPEED_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
OBJS-yes += $(TEST_INTRA_PRED_SPEED_OBJS)
BINS-yes += $(TEST_INTRA_PRED_SPEED_BIN)
$(TEST_INTRA_PRED_SPEED_BIN): $(TEST_LIBS)
$(eval $(call linkerxx_template,$(TEST_INTRA_PRED_SPEED_BIN), \
$(TEST_INTRA_PRED_SPEED_OBJS) \
-L. -lvpx -lgtest $(extralibs) -lm))
endif # TEST_INTRA_PRED_SPEED
endif # CONFIG_UNIT_TESTS
# Install test sources only if codec source is included # Install test sources only if codec source is included
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\ INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
$(shell find $(SRC_PATH_BARE)/third_party/googletest -type f)) $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS) INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(TEST_INTRA_PRED_SPEED_SRCS)
define test_shard_template define test_shard_template
test:: test_shard.$(1) test:: test_shard.$(1)
test-no-data-check:: test_shard_ndc.$(1) test_shard.$(1): $(LIBVPX_TEST_BINS) testdata
test_shard.$(1) test_shard_ndc.$(1): $(LIBVPX_TEST_BIN)
@set -e; \ @set -e; \
export GTEST_SHARD_INDEX=$(1); \ for t in $(LIBVPX_TEST_BINS); do \
export GTEST_TOTAL_SHARDS=$(2); \ export GTEST_SHARD_INDEX=$(1); \
$(LIBVPX_TEST_BIN) export GTEST_TOTAL_SHARDS=$(2); \
test_shard.$(1): testdata $$$$t; \
done
.PHONY: test_shard.$(1) .PHONY: test_shard.$(1)
endef endef
@@ -596,16 +511,15 @@ ifeq ($(CONFIG_MSVS),yes)
# TODO(tomfinegan): Support running the debug versions of tools? # TODO(tomfinegan): Support running the debug versions of tools?
TEST_BIN_PATH := $(addsuffix /$(TGT_OS:win64=x64)/Release, $(TEST_BIN_PATH)) TEST_BIN_PATH := $(addsuffix /$(TGT_OS:win64=x64)/Release, $(TEST_BIN_PATH))
endif endif
utiltest utiltest-no-data-check: utiltest: testdata
$(qexec)$(SRC_PATH_BARE)/test/vpxdec.sh \ $(qexec)$(SRC_PATH_BARE)/test/vpxdec.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \ --test-data-path $(LIBVPX_TEST_DATA_PATH) \
--bin-path $(TEST_BIN_PATH) --bin-path $(TEST_BIN_PATH)
$(qexec)$(SRC_PATH_BARE)/test/vpxenc.sh \ $(qexec)$(SRC_PATH_BARE)/test/vpxenc.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \ --test-data-path $(LIBVPX_TEST_DATA_PATH) \
--bin-path $(TEST_BIN_PATH) --bin-path $(TEST_BIN_PATH)
utiltest: testdata
else else
utiltest utiltest-no-data-check: utiltest:
@echo Unit tests must be enabled to make the utiltest target. @echo Unit tests must be enabled to make the utiltest target.
endif endif
@@ -623,12 +537,11 @@ ifeq ($(CONFIG_MSVS),yes)
# TODO(tomfinegan): Support running the debug versions of tools? # TODO(tomfinegan): Support running the debug versions of tools?
EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release
endif endif
exampletest exampletest-no-data-check: examples exampletest: examples testdata
$(qexec)$(SRC_PATH_BARE)/test/examples.sh \ $(qexec)$(SRC_PATH_BARE)/test/examples.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \ --test-data-path $(LIBVPX_TEST_DATA_PATH) \
--bin-path $(EXAMPLES_BIN_PATH) --bin-path $(EXAMPLES_BIN_PATH)
exampletest: testdata
else else
exampletest exampletest-no-data-check: exampletest:
@echo Unit tests must be enabled to make the exampletest target. @echo Unit tests must be enabled to make the exampletest target.
endif endif

View File

@@ -24,7 +24,7 @@
#include "md5_utils.h" #include "md5_utils.h"
static void void
byteSwap(UWORD32 *buf, unsigned words) { byteSwap(UWORD32 *buf, unsigned words) {
md5byte *p; md5byte *p;

View File

@@ -88,9 +88,6 @@ void update_rate_histogram(struct rate_hist *hist,
if (now < cfg->rc_buf_initial_sz) if (now < cfg->rc_buf_initial_sz)
return; return;
if (!cfg->rc_target_bitrate)
return;
then = now; then = now;
/* Sum the size over the past rc_buf_sz ms */ /* Sum the size over the past rc_buf_sz ms */

View File

@@ -40,17 +40,9 @@ include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm LOCAL_ARM_MODE := arm
LOCAL_MODULE := libvpx_test LOCAL_MODULE := libvpx_test
LOCAL_STATIC_LIBRARIES := gtest libwebm LOCAL_STATIC_LIBRARIES := gtest libwebm
LOCAL_SHARED_LIBRARIES := vpx
ifeq ($(ENABLE_SHARED),1)
LOCAL_SHARED_LIBRARIES := vpx
else
LOCAL_STATIC_LIBRARIES += vpx
endif
include $(LOCAL_PATH)/test/test.mk include $(LOCAL_PATH)/test/test.mk
LOCAL_C_INCLUDES := $(BINDINGS_DIR) LOCAL_C_INCLUDES := $(BINDINGS_DIR)
FILTERED_SRC := $(sort $(filter %.cc %.c, $(LIBVPX_TEST_SRCS-yes))) FILTERED_SRC := $(sort $(filter %.cc %.c, $(LIBVPX_TEST_SRCS-yes)))
LOCAL_SRC_FILES := $(addprefix ./test/, $(FILTERED_SRC)) LOCAL_SRC_FILES := $(addprefix ./test/, $(FILTERED_SRC))
# some test files depend on *_rtcd.h, ensure they're generated first.
$(eval $(call rtcd_dep_template))
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)

View File

@@ -1,229 +0,0 @@
/*
* 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 <limits.h>
#include <stdio.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP9_ENCODER
#include "./vp9_rtcd.h"
#endif
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx_mem/vpx_mem.h"
extern "C"
double vp9_get_blockiness(const unsigned char *img1, int img1_pitch,
const unsigned char *img2, int img2_pitch,
int width, int height);
using libvpx_test::ACMRandom;
namespace {
class BlockinessTestBase : public ::testing::Test {
public:
BlockinessTestBase(int width, int height) : width_(width), height_(height) {}
static void SetUpTestCase() {
source_data_ = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kDataBufferSize));
reference_data_ = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kDataBufferSize));
}
static void TearDownTestCase() {
vpx_free(source_data_);
source_data_ = NULL;
vpx_free(reference_data_);
reference_data_ = NULL;
}
virtual void TearDown() {
libvpx_test::ClearSystemState();
}
protected:
// Handle frames up to 640x480
static const int kDataAlignment = 16;
static const int kDataBufferSize = 640*480;
virtual void SetUp() {
source_stride_ = (width_ + 31) & ~31;
reference_stride_ = width_ * 2;
rnd_.Reset(ACMRandom::DeterministicSeed());
}
void FillConstant(uint8_t *data, int stride, uint8_t fill_constant,
int width, int height) {
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
data[h * stride + w] = fill_constant;
}
}
}
void FillConstant(uint8_t *data, int stride, uint8_t fill_constant) {
FillConstant(data, stride, fill_constant, width_, height_);
}
void FillRandom(uint8_t *data, int stride, int width, int height) {
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
data[h * stride + w] = rnd_.Rand8();
}
}
}
void FillRandom(uint8_t *data, int stride) {
FillRandom(data, stride, width_, height_);
}
void FillRandomBlocky(uint8_t *data, int stride) {
for (int h = 0; h < height_; h += 4) {
for (int w = 0; w < width_; w += 4) {
FillRandom(data + h * stride + w, stride, 4, 4);
}
}
}
void FillCheckerboard(uint8_t *data, int stride) {
for (int h = 0; h < height_; h += 4) {
for (int w = 0; w < width_; w += 4) {
if (((h/4) ^ (w/4)) & 1)
FillConstant(data + h * stride + w, stride, 255, 4, 4);
else
FillConstant(data + h * stride + w, stride, 0, 4, 4);
}
}
}
void Blur(uint8_t *data, int stride, int taps) {
int sum = 0;
int half_taps = taps / 2;
for (int h = 0; h < height_; ++h) {
for (int w = 0; w < taps; ++w) {
sum += data[w + h * stride];
}
for (int w = taps; w < width_; ++w) {
sum += data[w + h * stride] - data[w - taps + h * stride];
data[w - half_taps + h * stride] = (sum + half_taps) / taps;
}
}
for (int w = 0; w < width_; ++w) {
for (int h = 0; h < taps; ++h) {
sum += data[h + w * stride];
}
for (int h = taps; h < height_; ++h) {
sum += data[w + h * stride] - data[(h - taps) * stride + w];
data[(h - half_taps) * stride + w] = (sum + half_taps) / taps;
}
}
}
int width_, height_;
static uint8_t* source_data_;
int source_stride_;
static uint8_t* reference_data_;
int reference_stride_;
ACMRandom rnd_;
};
#if CONFIG_VP9_ENCODER
typedef std::tr1::tuple<int, int> BlockinessParam;
class BlockinessVP9Test
: public BlockinessTestBase,
public ::testing::WithParamInterface<BlockinessParam> {
public:
BlockinessVP9Test() : BlockinessTestBase(GET_PARAM(0), GET_PARAM(1)) {}
protected:
int CheckBlockiness() {
return vp9_get_blockiness(source_data_, source_stride_,
reference_data_, reference_stride_,
width_, height_);
}
};
#endif // CONFIG_VP9_ENCODER
uint8_t* BlockinessTestBase::source_data_ = NULL;
uint8_t* BlockinessTestBase::reference_data_ = NULL;
#if CONFIG_VP9_ENCODER
TEST_P(BlockinessVP9Test, SourceBlockierThanReference) {
// Source is blockier than reference.
FillRandomBlocky(source_data_, source_stride_);
FillConstant(reference_data_, reference_stride_, 128);
int super_blocky = CheckBlockiness();
EXPECT_EQ(0, super_blocky) << "Blocky source should produce 0 blockiness.";
}
TEST_P(BlockinessVP9Test, ReferenceBlockierThanSource) {
// Source is blockier than reference.
FillConstant(source_data_, source_stride_, 128);
FillRandomBlocky(reference_data_, reference_stride_);
int super_blocky = CheckBlockiness();
EXPECT_GT(super_blocky, 0.0)
<< "Blocky reference should score high for blockiness.";
}
TEST_P(BlockinessVP9Test, BlurringDecreasesBlockiness) {
// Source is blockier than reference.
FillConstant(source_data_, source_stride_, 128);
FillRandomBlocky(reference_data_, reference_stride_);
int super_blocky = CheckBlockiness();
Blur(reference_data_, reference_stride_, 4);
int less_blocky = CheckBlockiness();
EXPECT_GT(super_blocky, less_blocky)
<< "A straight blur should decrease blockiness.";
}
TEST_P(BlockinessVP9Test, WorstCaseBlockiness) {
// Source is blockier than reference.
FillConstant(source_data_, source_stride_, 128);
FillCheckerboard(reference_data_, reference_stride_);
int super_blocky = CheckBlockiness();
Blur(reference_data_, reference_stride_, 4);
int less_blocky = CheckBlockiness();
EXPECT_GT(super_blocky, less_blocky)
<< "A straight blur should decrease blockiness.";
}
#endif // CONFIG_VP9_ENCODER
using std::tr1::make_tuple;
//------------------------------------------------------------------------------
// C functions
#if CONFIG_VP9_ENCODER
const BlockinessParam c_vp9_tests[] = {
make_tuple(320, 240),
make_tuple(318, 242),
make_tuple(318, 238),
};
INSTANTIATE_TEST_CASE_P(C, BlockinessVP9Test, ::testing::ValuesIn(c_vp9_tests));
#endif
} // namespace

View File

@@ -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

View File

@@ -21,13 +21,13 @@
namespace { namespace {
const int kLegacyByteAlignment = 0; //const int kLegacyByteAlignment = 0;
const int kLegacyYPlaneByteAlignment = 32; //const int kLegacyYPlaneByteAlignment = 32;
const int kNumPlanesToCheck = 3; //const int kNumPlanesToCheck = 3;
const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm"; //const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
const char kVP9Md5File[] = "vp90-2-02-size-lf-1920x1080.webm.md5"; //const char kVP9Md5File[] = "vp90-2-02-size-lf-1920x1080.webm.md5";
#if CONFIG_WEBM_IO #if CONFIG_WEBM_IO && 0
struct ByteAlignmentTestParam { struct ByteAlignmentTestParam {
int byte_alignment; int byte_alignment;

View File

@@ -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_

View File

@@ -1,224 +0,0 @@
/*
* 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 <limits.h>
#include <stdio.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP9_ENCODER
#include "./vp9_rtcd.h"
#endif
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx_dsp/ssim.h"
#include "vpx_mem/vpx_mem.h"
extern "C"
double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch,
uint8_t *img2, int img2_pitch,
int width, int height,
Ssimv *sv2, Metrics *m,
int do_inconsistency);
using libvpx_test::ACMRandom;
namespace {
class ConsistencyTestBase : public ::testing::Test {
public:
ConsistencyTestBase(int width, int height) : width_(width), height_(height) {}
static void SetUpTestCase() {
source_data_[0] = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kDataBufferSize));
reference_data_[0] = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kDataBufferSize));
source_data_[1] = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kDataBufferSize));
reference_data_[1] = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kDataBufferSize));
ssim_array_ = new Ssimv[kDataBufferSize / 16];
}
static void ClearSsim() {
memset(ssim_array_, 0, kDataBufferSize / 16);
}
static void TearDownTestCase() {
vpx_free(source_data_[0]);
source_data_[0] = NULL;
vpx_free(reference_data_[0]);
reference_data_[0] = NULL;
vpx_free(source_data_[1]);
source_data_[1] = NULL;
vpx_free(reference_data_[1]);
reference_data_[1] = NULL;
delete[] ssim_array_;
}
virtual void TearDown() {
libvpx_test::ClearSystemState();
}
protected:
// Handle frames up to 640x480
static const int kDataAlignment = 16;
static const int kDataBufferSize = 640*480;
virtual void SetUp() {
source_stride_ = (width_ + 31) & ~31;
reference_stride_ = width_ * 2;
rnd_.Reset(ACMRandom::DeterministicSeed());
}
void FillRandom(uint8_t *data, int stride, int width, int height) {
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
data[h * stride + w] = rnd_.Rand8();
}
}
}
void FillRandom(uint8_t *data, int stride) {
FillRandom(data, stride, width_, height_);
}
void Copy(uint8_t *reference, uint8_t *source) {
memcpy(reference, source, kDataBufferSize);
}
void Blur(uint8_t *data, int stride, int taps) {
int sum = 0;
int half_taps = taps / 2;
for (int h = 0; h < height_; ++h) {
for (int w = 0; w < taps; ++w) {
sum += data[w + h * stride];
}
for (int w = taps; w < width_; ++w) {
sum += data[w + h * stride] - data[w - taps + h * stride];
data[w - half_taps + h * stride] = (sum + half_taps) / taps;
}
}
for (int w = 0; w < width_; ++w) {
for (int h = 0; h < taps; ++h) {
sum += data[h + w * stride];
}
for (int h = taps; h < height_; ++h) {
sum += data[w + h * stride] - data[(h - taps) * stride + w];
data[(h - half_taps) * stride + w] = (sum + half_taps) / taps;
}
}
}
int width_, height_;
static uint8_t* source_data_[2];
int source_stride_;
static uint8_t* reference_data_[2];
int reference_stride_;
static Ssimv *ssim_array_;
Metrics metrics_;
ACMRandom rnd_;
};
#if CONFIG_VP9_ENCODER
typedef std::tr1::tuple<int, int> ConsistencyParam;
class ConsistencyVP9Test
: public ConsistencyTestBase,
public ::testing::WithParamInterface<ConsistencyParam> {
public:
ConsistencyVP9Test() : ConsistencyTestBase(GET_PARAM(0), GET_PARAM(1)) {}
protected:
double CheckConsistency(int frame) {
EXPECT_LT(frame, 2)<< "Frame to check has to be less than 2.";
return
vpx_get_ssim_metrics(source_data_[frame], source_stride_,
reference_data_[frame], reference_stride_,
width_, height_, ssim_array_, &metrics_, 1);
}
};
#endif // CONFIG_VP9_ENCODER
uint8_t* ConsistencyTestBase::source_data_[2] = {NULL, NULL};
uint8_t* ConsistencyTestBase::reference_data_[2] = {NULL, NULL};
Ssimv* ConsistencyTestBase::ssim_array_ = NULL;
#if CONFIG_VP9_ENCODER
TEST_P(ConsistencyVP9Test, ConsistencyIsZero) {
FillRandom(source_data_[0], source_stride_);
Copy(source_data_[1], source_data_[0]);
Copy(reference_data_[0], source_data_[0]);
Blur(reference_data_[0], reference_stride_, 3);
Copy(reference_data_[1], source_data_[0]);
Blur(reference_data_[1], reference_stride_, 3);
double inconsistency = CheckConsistency(1);
inconsistency = CheckConsistency(0);
EXPECT_EQ(inconsistency, 0.0)
<< "Should have 0 inconsistency if they are exactly the same.";
// If sources are not consistent reference frames inconsistency should
// be less than if the source is consistent.
FillRandom(source_data_[0], source_stride_);
FillRandom(source_data_[1], source_stride_);
FillRandom(reference_data_[0], reference_stride_);
FillRandom(reference_data_[1], reference_stride_);
CheckConsistency(0);
inconsistency = CheckConsistency(1);
Copy(source_data_[1], source_data_[0]);
CheckConsistency(0);
double inconsistency2 = CheckConsistency(1);
EXPECT_LT(inconsistency, inconsistency2)
<< "Should have less inconsistency if source itself is inconsistent.";
// Less of a blur should be less inconsistent than more blur coming off a
// a frame with no blur.
ClearSsim();
FillRandom(source_data_[0], source_stride_);
Copy(source_data_[1], source_data_[0]);
Copy(reference_data_[0], source_data_[0]);
Copy(reference_data_[1], source_data_[0]);
Blur(reference_data_[1], reference_stride_, 4);
CheckConsistency(0);
inconsistency = CheckConsistency(1);
ClearSsim();
Copy(reference_data_[1], source_data_[0]);
Blur(reference_data_[1], reference_stride_, 8);
CheckConsistency(0);
inconsistency2 = CheckConsistency(1);
EXPECT_LT(inconsistency, inconsistency2)
<< "Stronger Blur should produce more inconsistency.";
}
#endif // CONFIG_VP9_ENCODER
using std::tr1::make_tuple;
//------------------------------------------------------------------------------
// C functions
#if CONFIG_VP9_ENCODER
const ConsistencyParam c_vp9_tests[] = {
make_tuple(320, 240),
make_tuple(318, 242),
make_tuple(318, 238),
};
INSTANTIATE_TEST_CASE_P(C, ConsistencyVP9Test,
::testing::ValuesIn(c_vp9_tests));
#endif
} // namespace

View File

@@ -9,20 +9,16 @@
*/ */
#include <string.h> #include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.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 "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_common.h" #include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_filter.h" #include "vp9/common/vp9_filter.h"
#include "vpx_dsp/vpx_dsp_common.h"
#include "vpx_dsp/vpx_filter.h"
#include "vpx_mem/vpx_mem.h" #include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h" #include "vpx_ports/mem.h"
@@ -41,14 +37,9 @@ struct ConvolveFunctions {
ConvolveFunc h8, ConvolveFunc h8_avg, ConvolveFunc h8, ConvolveFunc h8_avg,
ConvolveFunc v8, ConvolveFunc v8_avg, ConvolveFunc v8, ConvolveFunc v8_avg,
ConvolveFunc hv8, ConvolveFunc hv8_avg, ConvolveFunc hv8, ConvolveFunc hv8_avg,
ConvolveFunc sh8, ConvolveFunc sh8_avg,
ConvolveFunc sv8, ConvolveFunc sv8_avg,
ConvolveFunc shv8, ConvolveFunc shv8_avg,
int bd) int bd)
: copy_(copy), avg_(avg), h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg), : copy_(copy), avg_(avg), h8_(h8), v8_(v8), hv8_(hv8), h8_avg_(h8_avg),
v8_avg_(v8_avg), hv8_avg_(hv8_avg), sh8_(sh8), sv8_(sv8), shv8_(shv8), v8_avg_(v8_avg), hv8_avg_(hv8_avg), use_highbd_(bd) {}
sh8_avg_(sh8_avg), sv8_avg_(sv8_avg), shv8_avg_(shv8_avg),
use_highbd_(bd) {}
ConvolveFunc copy_; ConvolveFunc copy_;
ConvolveFunc avg_; ConvolveFunc avg_;
@@ -58,12 +49,6 @@ struct ConvolveFunctions {
ConvolveFunc h8_avg_; ConvolveFunc h8_avg_;
ConvolveFunc v8_avg_; ConvolveFunc v8_avg_;
ConvolveFunc hv8_avg_; ConvolveFunc hv8_avg_;
ConvolveFunc sh8_; // scaled horiz
ConvolveFunc sv8_; // scaled vert
ConvolveFunc shv8_; // scaled horiz/vert
ConvolveFunc sh8_avg_; // scaled avg horiz
ConvolveFunc sv8_avg_; // scaled avg vert
ConvolveFunc shv8_avg_; // scaled avg horiz/vert
int use_highbd_; // 0 if high bitdepth not used, else the actual bit depth. int use_highbd_; // 0 if high bitdepth not used, else the actual bit depth.
}; };
@@ -413,9 +398,9 @@ class ConvolveTest : public ::testing::TestWithParam<ConvolveParam> {
} }
void CopyOutputToRef() { void CopyOutputToRef() {
memcpy(output_ref_, output_, kOutputBufferSize); vpx_memcpy(output_ref_, output_, kOutputBufferSize);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
memcpy(output16_ref_, output16_, kOutputBufferSize); vpx_memcpy(output16_ref_, output16_, kOutputBufferSize);
#endif #endif
} }
@@ -608,8 +593,8 @@ TEST_P(ConvolveTest, CopyHoriz) {
DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0}; DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->sh8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16, UUT_->h8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
Width(), Height())); Width(), Height()));
CheckGuardBlocks(); CheckGuardBlocks();
@@ -626,8 +611,8 @@ TEST_P(ConvolveTest, CopyVert) {
DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0}; DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->sv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16, UUT_->v8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
Width(), Height())); Width(), Height()));
CheckGuardBlocks(); CheckGuardBlocks();
@@ -644,8 +629,8 @@ TEST_P(ConvolveTest, Copy2D) {
DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0}; DECLARE_ALIGNED(256, const int16_t, filter8[8]) = {0, 0, 0, 128, 0, 0, 0, 0};
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->shv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, UUT_->hv8_(in, kInputStride, out, kOutputStride, filter8, 16, filter8, 16,
16, Width(), Height())); Width(), Height()));
CheckGuardBlocks(); CheckGuardBlocks();
@@ -662,7 +647,7 @@ const int kNumFilters = 16;
TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) { TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) {
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) { for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters = const InterpKernel *filters =
vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)]; vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
for (int i = 0; i < kNumFilters; i++) { for (int i = 0; i < kNumFilters; i++) {
const int p0 = filters[i][0] + filters[i][1]; const int p0 = filters[i][0] + filters[i][1];
const int p1 = filters[i][2] + filters[i][3]; const int p1 = filters[i][2] + filters[i][3];
@@ -700,7 +685,9 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) { for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters = const InterpKernel *filters =
vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)]; vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
const InterpKernel *const eighttap_smooth =
vp9_get_interp_kernel(EIGHTTAP_SMOOTH);
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) { for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
@@ -709,7 +696,7 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
ref, kOutputStride, ref, kOutputStride,
Width(), Height()); Width(), Height());
if (filter_x && filter_y) if (filters == eighttap_smooth || (filter_x && filter_y))
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->hv8_(in, kInputStride, out, kOutputStride, UUT_->hv8_(in, kInputStride, out, kOutputStride,
filters[filter_x], 16, filters[filter_y], 16, filters[filter_x], 16, filters[filter_y], 16,
@@ -719,16 +706,11 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
UUT_->v8_(in, kInputStride, out, kOutputStride, UUT_->v8_(in, kInputStride, out, kOutputStride,
kInvalidFilter, 16, filters[filter_y], 16, kInvalidFilter, 16, filters[filter_y], 16,
Width(), Height())); Width(), Height()));
else if (filter_x) else
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->h8_(in, kInputStride, out, kOutputStride, UUT_->h8_(in, kInputStride, out, kOutputStride,
filters[filter_x], 16, kInvalidFilter, 16, filters[filter_x], 16, kInvalidFilter, 16,
Width(), Height())); Width(), Height()));
else
ASM_REGISTER_STATE_CHECK(
UUT_->copy_(in, kInputStride, out, kOutputStride,
kInvalidFilter, 0, kInvalidFilter, 0,
Width(), Height()));
CheckGuardBlocks(); CheckGuardBlocks();
@@ -782,7 +764,9 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) { for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters = const InterpKernel *filters =
vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)]; vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
const InterpKernel *const eighttap_smooth =
vp9_get_interp_kernel(EIGHTTAP_SMOOTH);
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) { for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
@@ -791,7 +775,7 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
ref, kOutputStride, ref, kOutputStride,
Width(), Height()); Width(), Height());
if (filter_x && filter_y) if (filters == eighttap_smooth || (filter_x && filter_y))
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->hv8_avg_(in, kInputStride, out, kOutputStride, UUT_->hv8_avg_(in, kInputStride, out, kOutputStride,
filters[filter_x], 16, filters[filter_y], 16, filters[filter_x], 16, filters[filter_y], 16,
@@ -799,18 +783,13 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
else if (filter_y) else if (filter_y)
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->v8_avg_(in, kInputStride, out, kOutputStride, UUT_->v8_avg_(in, kInputStride, out, kOutputStride,
kInvalidFilter, 16, filters[filter_y], 16, filters[filter_x], 16, filters[filter_y], 16,
Width(), Height()));
else if (filter_x)
ASM_REGISTER_STATE_CHECK(
UUT_->h8_avg_(in, kInputStride, out, kOutputStride,
filters[filter_x], 16, kInvalidFilter, 16,
Width(), Height())); Width(), Height()));
else else
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->avg_(in, kInputStride, out, kOutputStride, UUT_->h8_avg_(in, kInputStride, out, kOutputStride,
kInvalidFilter, 0, kInvalidFilter, 0, filters[filter_x], 16, filters[filter_y], 16,
Width(), Height())); Width(), Height()));
CheckGuardBlocks(); CheckGuardBlocks();
@@ -884,14 +863,16 @@ TEST_P(ConvolveTest, FilterExtremes) {
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) { for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
const InterpKernel *filters = const InterpKernel *filters =
vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)]; vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
const InterpKernel *const eighttap_smooth =
vp9_get_interp_kernel(EIGHTTAP_SMOOTH);
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) { for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
wrapper_filter_block2d_8_c(in, kInputStride, wrapper_filter_block2d_8_c(in, kInputStride,
filters[filter_x], filters[filter_y], filters[filter_x], filters[filter_y],
ref, kOutputStride, ref, kOutputStride,
Width(), Height()); Width(), Height());
if (filter_x && filter_y) if (filters == eighttap_smooth || (filter_x && filter_y))
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->hv8_(in, kInputStride, out, kOutputStride, UUT_->hv8_(in, kInputStride, out, kOutputStride,
filters[filter_x], 16, filters[filter_y], 16, filters[filter_x], 16, filters[filter_y], 16,
@@ -901,16 +882,11 @@ TEST_P(ConvolveTest, FilterExtremes) {
UUT_->v8_(in, kInputStride, out, kOutputStride, UUT_->v8_(in, kInputStride, out, kOutputStride,
kInvalidFilter, 16, filters[filter_y], 16, kInvalidFilter, 16, filters[filter_y], 16,
Width(), Height())); Width(), Height()));
else if (filter_x) else
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
UUT_->h8_(in, kInputStride, out, kOutputStride, UUT_->h8_(in, kInputStride, out, kOutputStride,
filters[filter_x], 16, kInvalidFilter, 16, filters[filter_x], 16, kInvalidFilter, 16,
Width(), Height())); Width(), Height()));
else
ASM_REGISTER_STATE_CHECK(
UUT_->copy_(in, kInputStride, out, kOutputStride,
kInvalidFilter, 0, kInvalidFilter, 0,
Width(), Height()));
for (int y = 0; y < Height(); ++y) for (int y = 0; y < Height(); ++y)
for (int x = 0; x < Width(); ++x) for (int x = 0; x < Width(); ++x)
@@ -926,22 +902,132 @@ TEST_P(ConvolveTest, FilterExtremes) {
} }
} }
DECLARE_ALIGNED(256, const int16_t, kChangeFilters[16][8]) = {
{ 0, 0, 0, 0, 0, 0, 0, 128},
{ 0, 0, 0, 0, 0, 0, 128},
{ 0, 0, 0, 0, 0, 128},
{ 0, 0, 0, 0, 128},
{ 0, 0, 0, 128},
{ 0, 0, 128},
{ 0, 128},
{ 128},
{ 0, 0, 0, 0, 0, 0, 0, 128},
{ 0, 0, 0, 0, 0, 0, 128},
{ 0, 0, 0, 0, 0, 128},
{ 0, 0, 0, 0, 128},
{ 0, 0, 0, 128},
{ 0, 0, 128},
{ 0, 128},
{ 128}
};
/* This test exercises the horizontal and vertical filter functions. */
TEST_P(ConvolveTest, ChangeFilterWorks) {
uint8_t* const in = input();
uint8_t* const out = output();
/* Assume that the first input sample is at the 8/16th position. */
const int kInitialSubPelOffset = 8;
/* Filters are 8-tap, so the first filter tap will be applied to the pixel
* at position -3 with respect to the current filtering position. Since
* kInitialSubPelOffset is set to 8, we first select sub-pixel filter 8,
* which is non-zero only in the last tap. So, applying the filter at the
* current input position will result in an output equal to the pixel at
* offset +4 (-3 + 7) with respect to the current filtering position.
*/
const int kPixelSelected = 4;
/* Assume that each output pixel requires us to step on by 17/16th pixels in
* the input.
*/
const int kInputPixelStep = 17;
/* The filters are setup in such a way that the expected output produces
* sets of 8 identical output samples. As the filter position moves to the
* next 1/16th pixel position the only active (=128) filter tap moves one
* position to the left, resulting in the same input pixel being replicated
* in to the output for 8 consecutive samples. After each set of 8 positions
* the filters select a different input pixel. kFilterPeriodAdjust below
* computes which input pixel is written to the output for a specified
* x or y position.
*/
/* Test the horizontal filter. */
ASM_REGISTER_STATE_CHECK(
UUT_->h8_(in, kInputStride, out, kOutputStride,
kChangeFilters[kInitialSubPelOffset],
kInputPixelStep, NULL, 0, Width(), Height()));
for (int x = 0; x < Width(); ++x) {
const int kFilterPeriodAdjust = (x >> 3) << 3;
const int ref_x =
kPixelSelected + ((kInitialSubPelOffset
+ kFilterPeriodAdjust * kInputPixelStep)
>> SUBPEL_BITS);
ASSERT_EQ(lookup(in, ref_x), lookup(out, x))
<< "x == " << x << "width = " << Width();
}
/* Test the vertical filter. */
ASM_REGISTER_STATE_CHECK(
UUT_->v8_(in, kInputStride, out, kOutputStride,
NULL, 0, kChangeFilters[kInitialSubPelOffset],
kInputPixelStep, Width(), Height()));
for (int y = 0; y < Height(); ++y) {
const int kFilterPeriodAdjust = (y >> 3) << 3;
const int ref_y =
kPixelSelected + ((kInitialSubPelOffset
+ kFilterPeriodAdjust * kInputPixelStep)
>> SUBPEL_BITS);
ASSERT_EQ(lookup(in, ref_y * kInputStride), lookup(out, y * kInputStride))
<< "y == " << y;
}
/* Test the horizontal and vertical filters in combination. */
ASM_REGISTER_STATE_CHECK(
UUT_->hv8_(in, kInputStride, out, kOutputStride,
kChangeFilters[kInitialSubPelOffset], kInputPixelStep,
kChangeFilters[kInitialSubPelOffset], kInputPixelStep,
Width(), Height()));
for (int y = 0; y < Height(); ++y) {
const int kFilterPeriodAdjustY = (y >> 3) << 3;
const int ref_y =
kPixelSelected + ((kInitialSubPelOffset
+ kFilterPeriodAdjustY * kInputPixelStep)
>> SUBPEL_BITS);
for (int x = 0; x < Width(); ++x) {
const int kFilterPeriodAdjustX = (x >> 3) << 3;
const int ref_x =
kPixelSelected + ((kInitialSubPelOffset
+ kFilterPeriodAdjustX * kInputPixelStep)
>> SUBPEL_BITS);
ASSERT_EQ(lookup(in, ref_y * kInputStride + ref_x),
lookup(out, y * kOutputStride + x))
<< "x == " << x << ", y == " << y;
}
}
}
/* This test exercises that enough rows and columns are filtered with every /* This test exercises that enough rows and columns are filtered with every
possible initial fractional positions and scaling steps. */ possible initial fractional positions and scaling steps. */
TEST_P(ConvolveTest, CheckScalingFiltering) { TEST_P(ConvolveTest, CheckScalingFiltering) {
uint8_t* const in = input(); uint8_t* const in = input();
uint8_t* const out = output(); uint8_t* const out = output();
const InterpKernel *const eighttap = vp9_filter_kernels[EIGHTTAP]; const InterpKernel *const eighttap = vp9_get_interp_kernel(EIGHTTAP);
SetConstantInput(127); SetConstantInput(127);
for (int frac = 0; frac < 16; ++frac) { for (int frac = 0; frac < 16; ++frac) {
for (int step = 1; step <= 32; ++step) { for (int step = 1; step <= 32; ++step) {
/* Test the horizontal and vertical filters in combination. */ /* Test the horizontal and vertical filters in combination. */
ASM_REGISTER_STATE_CHECK(UUT_->shv8_(in, kInputStride, out, kOutputStride, ASM_REGISTER_STATE_CHECK(UUT_->hv8_(in, kInputStride, out, kOutputStride,
eighttap[frac], step, eighttap[frac], step,
eighttap[frac], step, eighttap[frac], step,
Width(), Height())); Width(), Height()));
CheckGuardBlocks(); CheckGuardBlocks();
@@ -968,7 +1054,7 @@ void wrap_convolve8_horiz_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride, filter_x, vp9_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride, filter_x,
filter_x_stride, filter_y, filter_y_stride, filter_x_stride, filter_y, filter_y_stride,
w, h, 8); w, h, 8);
} }
@@ -980,7 +1066,7 @@ void wrap_convolve8_avg_horiz_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -992,7 +1078,7 @@ void wrap_convolve8_vert_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1004,7 +1090,7 @@ void wrap_convolve8_avg_vert_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1016,7 +1102,7 @@ void wrap_convolve8_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1028,7 +1114,7 @@ void wrap_convolve8_avg_sse2_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1040,7 +1126,7 @@ void wrap_convolve8_horiz_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1052,7 +1138,7 @@ void wrap_convolve8_avg_horiz_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1064,7 +1150,7 @@ void wrap_convolve8_vert_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1076,7 +1162,7 @@ void wrap_convolve8_avg_vert_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1088,7 +1174,7 @@ void wrap_convolve8_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1100,7 +1186,7 @@ void wrap_convolve8_avg_sse2_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1112,7 +1198,7 @@ void wrap_convolve8_horiz_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_horiz_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1124,7 +1210,7 @@ void wrap_convolve8_avg_horiz_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_horiz_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1136,7 +1222,7 @@ void wrap_convolve8_vert_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_vert_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1148,7 +1234,7 @@ void wrap_convolve8_avg_vert_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_vert_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1160,7 +1246,7 @@ void wrap_convolve8_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1172,7 +1258,7 @@ void wrap_convolve8_avg_sse2_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_sse2(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1185,7 +1271,7 @@ void wrap_convolve_copy_c_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1197,7 +1283,7 @@ void wrap_convolve_avg_c_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1209,7 +1295,7 @@ void wrap_convolve8_horiz_c_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1221,7 +1307,7 @@ void wrap_convolve8_avg_horiz_c_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1233,7 +1319,7 @@ void wrap_convolve8_vert_c_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1245,7 +1331,7 @@ void wrap_convolve8_avg_vert_c_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1257,7 +1343,7 @@ void wrap_convolve8_c_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1269,7 +1355,7 @@ void wrap_convolve8_avg_c_8(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 8); filter_y, filter_y_stride, w, h, 8);
} }
@@ -1281,7 +1367,7 @@ void wrap_convolve_copy_c_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1293,7 +1379,7 @@ void wrap_convolve_avg_c_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1305,7 +1391,7 @@ void wrap_convolve8_horiz_c_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1317,7 +1403,7 @@ void wrap_convolve8_avg_horiz_c_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1329,7 +1415,7 @@ void wrap_convolve8_vert_c_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1341,7 +1427,7 @@ void wrap_convolve8_avg_vert_c_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1353,7 +1439,7 @@ void wrap_convolve8_c_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1365,7 +1451,7 @@ void wrap_convolve8_avg_c_10(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 10); filter_y, filter_y_stride, w, h, 10);
} }
@@ -1377,7 +1463,7 @@ void wrap_convolve_copy_c_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve_copy_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve_copy_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1389,7 +1475,7 @@ void wrap_convolve_avg_c_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve_avg_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve_avg_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1401,7 +1487,7 @@ void wrap_convolve8_horiz_c_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_horiz_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1413,7 +1499,7 @@ void wrap_convolve8_avg_horiz_c_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1425,7 +1511,7 @@ void wrap_convolve8_vert_c_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_vert_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1437,7 +1523,7 @@ void wrap_convolve8_avg_vert_c_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1449,7 +1535,7 @@ void wrap_convolve8_c_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1461,7 +1547,7 @@ void wrap_convolve8_avg_c_12(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_y, const int16_t *filter_y,
int filter_y_stride, int filter_y_stride,
int w, int h) { int w, int h) {
vpx_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride, vp9_highbd_convolve8_avg_c(src, src_stride, dst, dst_stride,
filter_x, filter_x_stride, filter_x, filter_x_stride,
filter_y, filter_y_stride, w, h, 12); filter_y, filter_y_stride, w, h, 12);
} }
@@ -1470,9 +1556,6 @@ const ConvolveFunctions convolve8_c(
wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, wrap_convolve_copy_c_8, wrap_convolve_avg_c_8,
wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8, wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8, wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
wrap_convolve8_c_8, wrap_convolve8_avg_c_8,
wrap_convolve8_horiz_c_8, wrap_convolve8_avg_horiz_c_8,
wrap_convolve8_vert_c_8, wrap_convolve8_avg_vert_c_8,
wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8); wrap_convolve8_c_8, wrap_convolve8_avg_c_8, 8);
INSTANTIATE_TEST_CASE_P(C_8, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(C_8, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve8_c), make_tuple(4, 4, &convolve8_c),
@@ -1492,9 +1575,6 @@ const ConvolveFunctions convolve10_c(
wrap_convolve_copy_c_10, wrap_convolve_avg_c_10, wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10, wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10, wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
wrap_convolve8_c_10, wrap_convolve8_avg_c_10,
wrap_convolve8_horiz_c_10, wrap_convolve8_avg_horiz_c_10,
wrap_convolve8_vert_c_10, wrap_convolve8_avg_vert_c_10,
wrap_convolve8_c_10, wrap_convolve8_avg_c_10, 10); wrap_convolve8_c_10, wrap_convolve8_avg_c_10, 10);
INSTANTIATE_TEST_CASE_P(C_10, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(C_10, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve10_c), make_tuple(4, 4, &convolve10_c),
@@ -1514,9 +1594,6 @@ const ConvolveFunctions convolve12_c(
wrap_convolve_copy_c_12, wrap_convolve_avg_c_12, wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12, wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12, wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
wrap_convolve8_c_12, wrap_convolve8_avg_c_12,
wrap_convolve8_horiz_c_12, wrap_convolve8_avg_horiz_c_12,
wrap_convolve8_vert_c_12, wrap_convolve8_avg_vert_c_12,
wrap_convolve8_c_12, wrap_convolve8_avg_c_12, 12); wrap_convolve8_c_12, wrap_convolve8_avg_c_12, 12);
INSTANTIATE_TEST_CASE_P(C_12, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(C_12, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve12_c), make_tuple(4, 4, &convolve12_c),
@@ -1536,13 +1613,10 @@ INSTANTIATE_TEST_CASE_P(C_12, ConvolveTest, ::testing::Values(
#else #else
const ConvolveFunctions convolve8_c( const ConvolveFunctions convolve8_c(
vpx_convolve_copy_c, vpx_convolve_avg_c, vp9_convolve_copy_c, vp9_convolve_avg_c,
vpx_convolve8_horiz_c, vpx_convolve8_avg_horiz_c, vp9_convolve8_horiz_c, vp9_convolve8_avg_horiz_c,
vpx_convolve8_vert_c, vpx_convolve8_avg_vert_c, vp9_convolve8_vert_c, vp9_convolve8_avg_vert_c,
vpx_convolve8_c, vpx_convolve8_avg_c, vp9_convolve8_c, vp9_convolve8_avg_c, 0);
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve8_c), make_tuple(4, 4, &convolve8_c),
@@ -1566,25 +1640,16 @@ const ConvolveFunctions convolve8_sse2(
wrap_convolve_copy_c_8, wrap_convolve_avg_c_8, wrap_convolve_copy_c_8, wrap_convolve_avg_c_8,
wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8, wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8,
wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8, wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8,
wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8,
wrap_convolve8_horiz_sse2_8, wrap_convolve8_avg_horiz_sse2_8,
wrap_convolve8_vert_sse2_8, wrap_convolve8_avg_vert_sse2_8,
wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8, 8); wrap_convolve8_sse2_8, wrap_convolve8_avg_sse2_8, 8);
const ConvolveFunctions convolve10_sse2( const ConvolveFunctions convolve10_sse2(
wrap_convolve_copy_c_10, wrap_convolve_avg_c_10, wrap_convolve_copy_c_10, wrap_convolve_avg_c_10,
wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10, wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10,
wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10, wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10,
wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10,
wrap_convolve8_horiz_sse2_10, wrap_convolve8_avg_horiz_sse2_10,
wrap_convolve8_vert_sse2_10, wrap_convolve8_avg_vert_sse2_10,
wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10, 10); wrap_convolve8_sse2_10, wrap_convolve8_avg_sse2_10, 10);
const ConvolveFunctions convolve12_sse2( const ConvolveFunctions convolve12_sse2(
wrap_convolve_copy_c_12, wrap_convolve_avg_c_12, wrap_convolve_copy_c_12, wrap_convolve_avg_c_12,
wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12, wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12,
wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12, wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12,
wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12,
wrap_convolve8_horiz_sse2_12, wrap_convolve8_avg_horiz_sse2_12,
wrap_convolve8_vert_sse2_12, wrap_convolve8_avg_vert_sse2_12,
wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12, 12); wrap_convolve8_sse2_12, wrap_convolve8_avg_sse2_12, 12);
INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve8_sse2), make_tuple(4, 4, &convolve8_sse2),
@@ -1628,17 +1693,10 @@ INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
make_tuple(64, 64, &convolve12_sse2))); make_tuple(64, 64, &convolve12_sse2)));
#else #else
const ConvolveFunctions convolve8_sse2( const ConvolveFunctions convolve8_sse2(
#if CONFIG_USE_X86INC vp9_convolve_copy_sse2, vp9_convolve_avg_sse2,
vpx_convolve_copy_sse2, vpx_convolve_avg_sse2, vp9_convolve8_horiz_sse2, vp9_convolve8_avg_horiz_sse2,
#else vp9_convolve8_vert_sse2, vp9_convolve8_avg_vert_sse2,
vpx_convolve_copy_c, vpx_convolve_avg_c, vp9_convolve8_sse2, vp9_convolve8_avg_sse2, 0);
#endif // CONFIG_USE_X86INC
vpx_convolve8_horiz_sse2, vpx_convolve8_avg_horiz_sse2,
vpx_convolve8_vert_sse2, vpx_convolve8_avg_vert_sse2,
vpx_convolve8_sse2, vpx_convolve8_avg_sse2,
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve8_sse2), make_tuple(4, 4, &convolve8_sse2),
@@ -1659,13 +1717,10 @@ INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
#if HAVE_SSSE3 #if HAVE_SSSE3
const ConvolveFunctions convolve8_ssse3( const ConvolveFunctions convolve8_ssse3(
vpx_convolve_copy_c, vpx_convolve_avg_c, vp9_convolve_copy_c, vp9_convolve_avg_c,
vpx_convolve8_horiz_ssse3, vpx_convolve8_avg_horiz_ssse3, vp9_convolve8_horiz_ssse3, vp9_convolve8_avg_horiz_ssse3,
vpx_convolve8_vert_ssse3, vpx_convolve8_avg_vert_ssse3, vp9_convolve8_vert_ssse3, vp9_convolve8_avg_vert_ssse3,
vpx_convolve8_ssse3, vpx_convolve8_avg_ssse3, vp9_convolve8_ssse3, vp9_convolve8_avg_ssse3, 0);
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve8_ssse3), make_tuple(4, 4, &convolve8_ssse3),
@@ -1685,13 +1740,10 @@ INSTANTIATE_TEST_CASE_P(SSSE3, ConvolveTest, ::testing::Values(
#if HAVE_AVX2 && HAVE_SSSE3 #if HAVE_AVX2 && HAVE_SSSE3
const ConvolveFunctions convolve8_avx2( const ConvolveFunctions convolve8_avx2(
vpx_convolve_copy_c, vpx_convolve_avg_c, vp9_convolve_copy_c, vp9_convolve_avg_c,
vpx_convolve8_horiz_avx2, vpx_convolve8_avg_horiz_ssse3, vp9_convolve8_horiz_avx2, vp9_convolve8_avg_horiz_ssse3,
vpx_convolve8_vert_avx2, vpx_convolve8_avg_vert_ssse3, vp9_convolve8_vert_avx2, vp9_convolve8_avg_vert_ssse3,
vpx_convolve8_avx2, vpx_convolve8_avg_ssse3, vp9_convolve8_avx2, vp9_convolve8_avg_ssse3, 0);
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve8_avx2), make_tuple(4, 4, &convolve8_avx2),
@@ -1712,22 +1764,16 @@ INSTANTIATE_TEST_CASE_P(AVX2, ConvolveTest, ::testing::Values(
#if HAVE_NEON #if HAVE_NEON
#if HAVE_NEON_ASM #if HAVE_NEON_ASM
const ConvolveFunctions convolve8_neon( const ConvolveFunctions convolve8_neon(
vpx_convolve_copy_neon, vpx_convolve_avg_neon, vp9_convolve_copy_neon, vp9_convolve_avg_neon,
vpx_convolve8_horiz_neon, vpx_convolve8_avg_horiz_neon, vp9_convolve8_horiz_neon, vp9_convolve8_avg_horiz_neon,
vpx_convolve8_vert_neon, vpx_convolve8_avg_vert_neon, vp9_convolve8_vert_neon, vp9_convolve8_avg_vert_neon,
vpx_convolve8_neon, vpx_convolve8_avg_neon, vp9_convolve8_neon, vp9_convolve8_avg_neon, 0);
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
#else // HAVE_NEON #else // HAVE_NEON
const ConvolveFunctions convolve8_neon( const ConvolveFunctions convolve8_neon(
vpx_convolve_copy_neon, vpx_convolve_avg_neon, vp9_convolve_copy_neon, vp9_convolve_avg_neon,
vpx_convolve8_horiz_neon, vpx_convolve8_avg_horiz_neon, vp9_convolve8_horiz_neon, vp9_convolve8_avg_horiz_neon,
vpx_convolve8_vert_neon, vpx_convolve8_avg_vert_neon, vp9_convolve8_vert_neon, vp9_convolve8_avg_vert_neon,
vpx_convolve8_neon, vpx_convolve8_avg_neon, vp9_convolve8_neon, vp9_convolve8_avg_neon, 0);
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
#endif // HAVE_NEON_ASM #endif // HAVE_NEON_ASM
INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values(
@@ -1748,13 +1794,10 @@ INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values(
#if HAVE_DSPR2 #if HAVE_DSPR2
const ConvolveFunctions convolve8_dspr2( const ConvolveFunctions convolve8_dspr2(
vpx_convolve_copy_dspr2, vpx_convolve_avg_dspr2, vp9_convolve_copy_dspr2, vp9_convolve_avg_dspr2,
vpx_convolve8_horiz_dspr2, vpx_convolve8_avg_horiz_dspr2, vp9_convolve8_horiz_dspr2, vp9_convolve8_avg_horiz_dspr2,
vpx_convolve8_vert_dspr2, vpx_convolve8_avg_vert_dspr2, vp9_convolve8_vert_dspr2, vp9_convolve8_avg_vert_dspr2,
vpx_convolve8_dspr2, vpx_convolve8_avg_dspr2, vp9_convolve8_dspr2, vp9_convolve8_avg_dspr2, 0);
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, ::testing::Values( INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve8_dspr2), make_tuple(4, 4, &convolve8_dspr2),
@@ -1771,30 +1814,4 @@ INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, ::testing::Values(
make_tuple(32, 64, &convolve8_dspr2), make_tuple(32, 64, &convolve8_dspr2),
make_tuple(64, 64, &convolve8_dspr2))); make_tuple(64, 64, &convolve8_dspr2)));
#endif #endif
#if HAVE_MSA
const ConvolveFunctions convolve8_msa(
vpx_convolve_copy_msa, vpx_convolve_avg_msa,
vpx_convolve8_horiz_msa, vpx_convolve8_avg_horiz_msa,
vpx_convolve8_vert_msa, vpx_convolve8_avg_vert_msa,
vpx_convolve8_msa, vpx_convolve8_avg_msa,
vpx_scaled_horiz_c, vpx_scaled_avg_horiz_c,
vpx_scaled_vert_c, vpx_scaled_avg_vert_c,
vpx_scaled_2d_c, vpx_scaled_avg_2d_c, 0);
INSTANTIATE_TEST_CASE_P(MSA, ConvolveTest, ::testing::Values(
make_tuple(4, 4, &convolve8_msa),
make_tuple(8, 4, &convolve8_msa),
make_tuple(4, 8, &convolve8_msa),
make_tuple(8, 8, &convolve8_msa),
make_tuple(16, 8, &convolve8_msa),
make_tuple(8, 16, &convolve8_msa),
make_tuple(16, 16, &convolve8_msa),
make_tuple(32, 16, &convolve8_msa),
make_tuple(16, 32, &convolve8_msa),
make_tuple(32, 32, &convolve8_msa),
make_tuple(64, 32, &convolve8_msa),
make_tuple(32, 64, &convolve8_msa),
make_tuple(64, 64, &convolve8_msa)));
#endif // HAVE_MSA
} // namespace } // namespace

View File

@@ -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

View File

@@ -14,7 +14,6 @@
#include "test/i420_video_source.h" #include "test/i420_video_source.h"
#include "test/util.h" #include "test/util.h"
#include "test/y4m_video_source.h" #include "test/y4m_video_source.h"
#include "vpx/vpx_codec.h"
namespace { namespace {
@@ -372,7 +371,9 @@ class DatarateTestVP9Large : public ::libvpx_test::EncoderTest,
encoder->Control(VP9E_SET_SVC, 1); encoder->Control(VP9E_SET_SVC, 1);
} }
vpx_svc_layer_id_t layer_id; vpx_svc_layer_id_t layer_id;
#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
layer_id.spatial_layer_id = 0; layer_id.spatial_layer_id = 0;
#endif
frame_flags_ = SetFrameFlags(video->frame(), cfg_.ts_number_layers); frame_flags_ = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
layer_id.temporal_layer_id = SetLayerId(video->frame(), layer_id.temporal_layer_id = SetLayerId(video->frame(),
cfg_.ts_number_layers); cfg_.ts_number_layers);
@@ -564,8 +565,6 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting2TemporalLayers) {
cfg_.ts_rate_decimator[0] = 2; cfg_.ts_rate_decimator[0] = 2;
cfg_.ts_rate_decimator[1] = 1; cfg_.ts_rate_decimator[1] = 1;
cfg_.temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS;
if (deadline_ == VPX_DL_REALTIME) if (deadline_ == VPX_DL_REALTIME)
cfg_.g_error_resilient = 1; cfg_.g_error_resilient = 1;
@@ -575,14 +574,14 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting2TemporalLayers) {
cfg_.rc_target_bitrate = i; cfg_.rc_target_bitrate = i;
ResetModel(); ResetModel();
// 60-40 bitrate allocation for 2 temporal layers. // 60-40 bitrate allocation for 2 temporal layers.
cfg_.layer_target_bitrate[0] = 60 * cfg_.rc_target_bitrate / 100; cfg_.ts_target_bitrate[0] = 60 * cfg_.rc_target_bitrate / 100;
cfg_.layer_target_bitrate[1] = cfg_.rc_target_bitrate; cfg_.ts_target_bitrate[1] = cfg_.rc_target_bitrate;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) { for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.85) ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.85)
<< " The datarate for the file is lower than target by too much, " << " The datarate for the file is lower than target by too much, "
"for layer: " << j; "for layer: " << j;
ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.15) ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.15)
<< " The datarate for the file is greater than target by too much, " << " The datarate for the file is greater than target by too much, "
"for layer: " << j; "for layer: " << j;
} }
@@ -607,27 +606,25 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayers) {
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_.temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 200); 30, 1, 0, 200);
for (int i = 200; i <= 800; i += 200) { for (int i = 200; i <= 800; i += 200) {
cfg_.rc_target_bitrate = i; cfg_.rc_target_bitrate = i;
ResetModel(); ResetModel();
// 40-20-40 bitrate allocation for 3 temporal layers. // 40-20-40 bitrate allocation for 3 temporal layers.
cfg_.layer_target_bitrate[0] = 40 * cfg_.rc_target_bitrate / 100; cfg_.ts_target_bitrate[0] = 40 * cfg_.rc_target_bitrate / 100;
cfg_.layer_target_bitrate[1] = 60 * cfg_.rc_target_bitrate / 100; cfg_.ts_target_bitrate[1] = 60 * cfg_.rc_target_bitrate / 100;
cfg_.layer_target_bitrate[2] = cfg_.rc_target_bitrate; cfg_.ts_target_bitrate[2] = cfg_.rc_target_bitrate;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) { for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
// TODO(yaowu): Work out more stable rc control strategy and // TODO(yaowu): Work out more stable rc control strategy and
// Adjust the thresholds to be tighter than .75. // Adjust the thresholds to be tighter than .75.
ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.75) ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.75)
<< " The datarate for the file is lower than target by too much, " << " The datarate for the file is lower than target by too much, "
"for layer: " << j; "for layer: " << j;
// TODO(yaowu): Work out more stable rc control strategy and // TODO(yaowu): Work out more stable rc control strategy and
// Adjust the thresholds to be tighter than 1.25. // Adjust the thresholds to be tighter than 1.25.
ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.25) ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.25)
<< " The datarate for the file is greater than target by too much, " << " The datarate for the file is greater than target by too much, "
"for layer: " << j; "for layer: " << j;
} }
@@ -655,22 +652,20 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayersFrameDropping) {
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_.temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 200); 30, 1, 0, 200);
cfg_.rc_target_bitrate = 200; cfg_.rc_target_bitrate = 200;
ResetModel(); ResetModel();
// 40-20-40 bitrate allocation for 3 temporal layers. // 40-20-40 bitrate allocation for 3 temporal layers.
cfg_.layer_target_bitrate[0] = 40 * cfg_.rc_target_bitrate / 100; cfg_.ts_target_bitrate[0] = 40 * cfg_.rc_target_bitrate / 100;
cfg_.layer_target_bitrate[1] = 60 * cfg_.rc_target_bitrate / 100; cfg_.ts_target_bitrate[1] = 60 * cfg_.rc_target_bitrate / 100;
cfg_.layer_target_bitrate[2] = cfg_.rc_target_bitrate; cfg_.ts_target_bitrate[2] = cfg_.rc_target_bitrate;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) { for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
ASSERT_GE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 0.85) ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.85)
<< " The datarate for the file is lower than target by too much, " << " The datarate for the file is lower than target by too much, "
"for layer: " << j; "for layer: " << j;
ASSERT_LE(effective_datarate_[j], cfg_.layer_target_bitrate[j] * 1.15) ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.15)
<< " The datarate for the file is greater than target by too much, " << " The datarate for the file is greater than target by too much, "
"for layer: " << j; "for layer: " << j;
// Expect some frame drops in this test: for this 200 frames test, // Expect some frame drops in this test: for this 200 frames test,
@@ -742,237 +737,9 @@ TEST_P(DatarateTestVP9Large, DenoiserOffOn) {
} }
#endif // CONFIG_VP9_TEMPORAL_DENOISING #endif // CONFIG_VP9_TEMPORAL_DENOISING
class DatarateOnePassCbrSvc : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
public:
DatarateOnePassCbrSvc() : EncoderTest(GET_PARAM(0)) {}
virtual ~DatarateOnePassCbrSvc() {}
protected:
virtual void SetUp() {
InitializeConfig();
SetMode(GET_PARAM(1));
speed_setting_ = GET_PARAM(2);
ResetModel();
}
virtual void ResetModel() {
last_pts_ = 0;
bits_in_buffer_model_ = cfg_.rc_target_bitrate * cfg_.rc_buf_initial_sz;
frame_number_ = 0;
first_drop_ = 0;
bits_total_ = 0;
duration_ = 0.0;
mismatch_psnr_ = 0.0;
mismatch_nframes_ = 0;
}
virtual void BeginPassHook(unsigned int /*pass*/) {
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
if (video->frame() == 0) {
int i;
for (i = 0; i < 2; ++i) {
svc_params_.max_quantizers[i] = 63;
svc_params_.min_quantizers[i] = 0;
}
svc_params_.scaling_factor_num[0] = 144;
svc_params_.scaling_factor_den[0] = 288;
svc_params_.scaling_factor_num[1] = 288;
svc_params_.scaling_factor_den[1] = 288;
encoder->Control(VP9E_SET_SVC, 1);
encoder->Control(VP9E_SET_SVC_PARAMETERS, &svc_params_);
encoder->Control(VP8E_SET_CPUUSED, speed_setting_);
encoder->Control(VP9E_SET_TILE_COLUMNS, 0);
encoder->Control(VP8E_SET_MAX_INTRA_BITRATE_PCT, 300);
encoder->Control(VP9E_SET_TILE_COLUMNS, (cfg_.g_threads >> 1));
}
const vpx_rational_t tb = video->timebase();
timebase_ = static_cast<double>(tb.num) / tb.den;
duration_ = 0;
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
if (last_pts_ == 0)
duration = 1;
bits_in_buffer_model_ += static_cast<int64_t>(
duration * timebase_ * cfg_.rc_target_bitrate * 1000);
const bool key_frame = (pkt->data.frame.flags & VPX_FRAME_IS_KEY)
? true: false;
if (!key_frame) {
ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
<< pkt->data.frame.pts;
}
const size_t frame_size_in_bits = pkt->data.frame.sz * 8;
bits_in_buffer_model_ -= frame_size_in_bits;
bits_total_ += frame_size_in_bits;
if (!first_drop_ && duration > 1)
first_drop_ = last_pts_ + 1;
last_pts_ = pkt->data.frame.pts;
bits_in_last_frame_ = frame_size_in_bits;
++frame_number_;
}
virtual void EndPassHook(void) {
if (bits_total_) {
const double file_size_in_kb = bits_total_ / 1000.; // bits per kilobit
duration_ = (last_pts_ + 1) * timebase_;
effective_datarate_ = (bits_total_ - bits_in_last_frame_) / 1000.0
/ (cfg_.rc_buf_initial_sz / 1000.0 + duration_);
file_datarate_ = file_size_in_kb / duration_;
}
}
virtual void MismatchHook(const vpx_image_t *img1,
const vpx_image_t *img2) {
double mismatch_psnr = compute_psnr(img1, img2);
mismatch_psnr_ += mismatch_psnr;
++mismatch_nframes_;
}
unsigned int GetMismatchFrames() {
return mismatch_nframes_;
}
vpx_codec_pts_t last_pts_;
int64_t bits_in_buffer_model_;
double timebase_;
int frame_number_;
vpx_codec_pts_t first_drop_;
int64_t bits_total_;
double duration_;
double file_datarate_;
double effective_datarate_;
size_t bits_in_last_frame_;
vpx_svc_extra_cfg_t svc_params_;
int speed_setting_;
double mismatch_psnr_;
int mismatch_nframes_;
};
static void assign_layer_bitrates(vpx_codec_enc_cfg_t *const enc_cfg,
const vpx_svc_extra_cfg_t *svc_params,
int spatial_layers,
int temporal_layers,
int temporal_layering_mode,
unsigned int total_rate) {
int sl, spatial_layer_target;
float total = 0;
float alloc_ratio[VPX_MAX_LAYERS] = {0};
for (sl = 0; sl < spatial_layers; ++sl) {
if (svc_params->scaling_factor_den[sl] > 0) {
alloc_ratio[sl] = (float)(svc_params->scaling_factor_num[sl] *
1.0 / svc_params->scaling_factor_den[sl]);
total += alloc_ratio[sl];
}
}
for (sl = 0; sl < spatial_layers; ++sl) {
enc_cfg->ss_target_bitrate[sl] = spatial_layer_target =
(unsigned int)(enc_cfg->rc_target_bitrate *
alloc_ratio[sl] / total);
const int index = sl * temporal_layers;
if (temporal_layering_mode == 3) {
enc_cfg->layer_target_bitrate[index] =
spatial_layer_target >> 1;
enc_cfg->layer_target_bitrate[index + 1] =
(spatial_layer_target >> 1) + (spatial_layer_target >> 2);
enc_cfg->layer_target_bitrate[index + 2] =
spatial_layer_target;
} else if (temporal_layering_mode == 2) {
enc_cfg->layer_target_bitrate[index] =
spatial_layer_target * 2 / 3;
enc_cfg->layer_target_bitrate[index + 1] =
spatial_layer_target;
}
}
}
// Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and
// 3 temporal layers. Run CIF clip with 1 thread.
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 63;
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
cfg_.ss_number_layers = 2;
cfg_.ts_number_layers = 3;
cfg_.ts_rate_decimator[0] = 4;
cfg_.ts_rate_decimator[1] = 2;
cfg_.ts_rate_decimator[2] = 1;
cfg_.g_error_resilient = 1;
cfg_.g_threads = 1;
cfg_.temporal_layering_mode = 3;
svc_params_.scaling_factor_num[0] = 144;
svc_params_.scaling_factor_den[0] = 288;
svc_params_.scaling_factor_num[1] = 288;
svc_params_.scaling_factor_den[1] = 288;
// TODO(wonkap/marpan): No frame drop for now, we need to implement correct
// frame dropping for SVC.
cfg_.rc_dropframe_thresh = 0;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 200);
// TODO(wonkap/marpan): Check that effective_datarate for each layer hits the
// layer target_bitrate. Also check if test can pass at lower bitrate (~200k).
for (int i = 400; i <= 800; i += 200) {
cfg_.rc_target_bitrate = i;
ResetModel();
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
cfg_.ts_number_layers, cfg_.temporal_layering_mode,
cfg_.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);
}
}
// 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,
::libvpx_test::kRealTime), ::libvpx_test::kRealTime),
::testing::Range(2, 7)); ::testing::Range(2, 7));
VP9_INSTANTIATE_TEST_CASE(DatarateOnePassCbrSvc,
::testing::Values(::libvpx_test::kRealTime),
::testing::Range(5, 8));
} // namespace } // namespace

View File

@@ -13,18 +13,15 @@
#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 "vpx/vpx_codec.h" #include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h" #include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
using libvpx_test::ACMRandom; using libvpx_test::ACMRandom;
@@ -40,6 +37,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 +269,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 +289,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 +315,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
@@ -335,13 +356,13 @@ class Trans16x16TestBase {
int64_t total_error = 0; int64_t total_error = 0;
const int count_test_block = 10000; const int count_test_block = 10000;
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif #endif
// Initialize a test block with input range [-mask_, mask_]. // Initialize a test block with input range [-mask_, mask_].
@@ -395,9 +416,9 @@ class Trans16x16TestBase {
void RunCoeffCheck() { void RunCoeffCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000; const int count_test_block = 1000;
DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_]. // Initialize a test block with input range [-mask_, mask_].
@@ -416,13 +437,15 @@ class Trans16x16TestBase {
void RunMemCheck() { void RunMemCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000; const int count_test_block = 1000;
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_]. // Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) { for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
} }
if (i == 0) { if (i == 0) {
@@ -449,19 +472,24 @@ class Trans16x16TestBase {
void RunQuantCheck(int dc_thred, int ac_thred) { void RunQuantCheck(int dc_thred, int ac_thred) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 100000; const int count_test_block = 100000;
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs);
#endif #endif
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_]. // Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) { for (int j = 0; j < kNumCoeffs; ++j) {
if (bit_depth_ == VPX_BITS_8)
input_block[j] = rnd.Rand8() - rnd.Rand8();
else
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
} }
if (i == 0) if (i == 0)
@@ -474,11 +502,11 @@ class Trans16x16TestBase {
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_); fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
// clear reconstructed pixel buffers // clear reconstructed pixel buffers
memset(dst, 0, kNumCoeffs * sizeof(uint8_t)); vpx_memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
memset(ref, 0, kNumCoeffs * sizeof(uint8_t)); vpx_memset(ref, 0, kNumCoeffs * sizeof(uint8_t));
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
memset(dst16, 0, kNumCoeffs * sizeof(uint16_t)); vpx_memset(dst16, 0, kNumCoeffs * sizeof(uint16_t));
memset(ref16, 0, kNumCoeffs * sizeof(uint16_t)); vpx_memset(ref16, 0, kNumCoeffs * sizeof(uint16_t));
#endif #endif
// quantization with maximum allowed step sizes // quantization with maximum allowed step sizes
@@ -511,13 +539,13 @@ class Trans16x16TestBase {
void RunInvAccuracyCheck() { void RunInvAccuracyCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000; const int count_test_block = 1000;
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -571,12 +599,12 @@ class Trans16x16TestBase {
const int count_test_block = 10000; const int count_test_block = 10000;
const int eob = 10; const int eob = 10;
const int16_t *scan = vp9_default_scan_orders[TX_16X16].scan; const int16_t *scan = vp9_default_scan_orders[TX_16X16].scan;
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs);
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -798,14 +826,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 +866,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 +893,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),
@@ -898,19 +934,11 @@ INSTANTIATE_TEST_CASE_P(
&idct16x16_256_add_12_sse2, 3167, VPX_BITS_12))); &idct16x16_256_add_12_sse2, 3167, VPX_BITS_12)));
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE #if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
MSA, Trans16x16DCT, SSSE3, Trans16x16DCT,
::testing::Values( ::testing::Values(
make_tuple(&vpx_fdct16x16_msa, make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_ssse3, 0,
&vpx_idct16x16_256_add_msa, 0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
MSA, Trans16x16HT,
::testing::Values(
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 0, VPX_BITS_8),
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 1, VPX_BITS_8),
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 2, VPX_BITS_8),
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 3,
VPX_BITS_8))); VPX_BITS_8)));
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE #endif // HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace } // namespace

View File

@@ -13,18 +13,16 @@
#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"
#include "vpx_ports/mem.h"
using libvpx_test::ACMRandom; using libvpx_test::ACMRandom;
@@ -82,15 +80,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
@@ -121,13 +119,13 @@ TEST_P(Trans32x32Test, AccuracyCheck) {
uint32_t max_error = 0; uint32_t max_error = 0;
int64_t total_error = 0; int64_t total_error = 0;
const int count_test_block = 10000; const int count_test_block = 10000;
DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif #endif
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -186,16 +184,16 @@ TEST_P(Trans32x32Test, CoeffCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000; const int count_test_block = 1000;
DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
for (int j = 0; j < kNumCoeffs; ++j) for (int j = 0; j < kNumCoeffs; ++j)
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) {
@@ -214,13 +212,15 @@ TEST_P(Trans32x32Test, MemCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 2000; const int count_test_block = 2000;
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_]. // Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) { for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
input_extreme_block[j] = rnd.Rand8() & 1 ? mask_ : -mask_; input_extreme_block[j] = rnd.Rand8() & 1 ? mask_ : -mask_;
} }
if (i == 0) { if (i == 0) {
@@ -232,7 +232,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));
@@ -257,13 +257,13 @@ TEST_P(Trans32x32Test, MemCheck) {
TEST_P(Trans32x32Test, InverseAccuracy) { TEST_P(Trans32x32Test, InverseAccuracy) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000; const int count_test_block = 1000;
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif #endif
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -315,61 +315,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 +377,9 @@ 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
INSTANTIATE_TEST_CASE_P(
MSA, Trans32x32Test,
::testing::Values(
make_tuple(&vpx_fdct32x32_msa,
&vpx_idct32x32_1024_add_msa, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_msa,
&vpx_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace } // namespace

View File

@@ -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));

View File

@@ -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"

View File

@@ -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) {
@@ -30,6 +29,8 @@ void Encoder::InitEncoder(VideoSource *video) {
cfg_.g_timebase = video->timebase(); cfg_.g_timebase = video->timebase();
cfg_.rc_twopass_stats_in = stats_->buf(); cfg_.rc_twopass_stats_in = stats_->buf();
// Default to 1 thread.
cfg_.g_threads = 1;
res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_, res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_,
init_flags_); init_flags_);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
@@ -42,15 +43,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 +187,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.

View File

@@ -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 {
@@ -134,11 +133,7 @@ class Encoder {
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
} }
void Control(int ctrl_id, struct vpx_svc_parameters *arg) { #if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER || CONFIG_VP10_ENCODER
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();
@@ -188,10 +183,7 @@ class EncoderTest {
protected: protected:
explicit EncoderTest(const CodecFactory *codec) explicit EncoderTest(const CodecFactory *codec)
: codec_(codec), abort_(false), init_flags_(0), frame_flags_(0), : codec_(codec), abort_(false), init_flags_(0), frame_flags_(0),
last_pts_(0) { last_pts_(0) {}
// Default to 1 thread.
cfg_.g_threads = 1;
}
virtual ~EncoderTest() {} virtual ~EncoderTest() {}

View File

@@ -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

View File

@@ -398,7 +398,7 @@ TEST_P(ExternalFrameBufferMD5Test, ExtFBMD5Match) {
delete video; delete video;
} }
#if CONFIG_WEBM_IO #if CONFIG_WEBM_IO && 0
TEST_F(ExternalFrameBufferTest, MinFrameBuffers) { TEST_F(ExternalFrameBufferTest, MinFrameBuffers) {
// Minimum number of external frame buffers for VP9 is // Minimum number of external frame buffers for VP9 is
// #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS. // #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS.
@@ -481,8 +481,8 @@ TEST_F(ExternalFrameBufferTest, SetAfterDecode) {
} }
#endif // CONFIG_WEBM_IO #endif // CONFIG_WEBM_IO
VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test, //VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test,
::testing::ValuesIn(libvpx_test::kVP9TestVectors, // ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
libvpx_test::kVP9TestVectors + // libvpx_test::kVP9TestVectors +
libvpx_test::kNumVP9TestVectors)); // libvpx_test::kNumVP9TestVectors));
} // namespace } // namespace

View File

@@ -13,17 +13,15 @@
#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"
#include "vpx_ports/mem.h"
using libvpx_test::ACMRandom; using libvpx_test::ACMRandom;
@@ -41,7 +39,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 +53,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 +69,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
@@ -104,13 +102,13 @@ class Trans4x4TestBase {
int64_t total_error = 0; int64_t total_error = 0;
const int count_test_block = 10000; const int count_test_block = 10000;
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif #endif
// Initialize a test block with input range [-255, 255]. // Initialize a test block with input range [-255, 255].
@@ -144,7 +142,6 @@ class Trans4x4TestBase {
const uint32_t diff = const uint32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j]; bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else #else
ASSERT_EQ(VPX_BITS_8, bit_depth_);
const uint32_t diff = dst[j] - src[j]; const uint32_t diff = dst[j] - src[j];
#endif #endif
const uint32_t error = diff * diff; const uint32_t error = diff * diff;
@@ -166,9 +163,9 @@ class Trans4x4TestBase {
void RunCoeffCheck() { void RunCoeffCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 5000; const int count_test_block = 5000;
DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_]. // Initialize a test block with input range [-mask_, mask_].
@@ -187,13 +184,15 @@ class Trans4x4TestBase {
void RunMemCheck() { void RunMemCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 5000; const int count_test_block = 5000;
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_]. // Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) { for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_; input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
} }
if (i == 0) { if (i == 0) {
@@ -220,13 +219,13 @@ class Trans4x4TestBase {
void RunInvAccuracyCheck(int limit) { void RunInvAccuracyCheck(int limit) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000; const int count_test_block = 1000;
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif #endif
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -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,33 +513,27 @@ 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),
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8))); make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8)));
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
MSA, Trans4x4DCT,
::testing::Values(
make_tuple(&vpx_fdct4x4_msa, &vpx_idct4x4_16_add_msa, 0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
MSA, Trans4x4HT,
::testing::Values(
make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 0, VPX_BITS_8),
make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 1, VPX_BITS_8),
make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 2, VPX_BITS_8),
make_tuple(&vp9_fht4x4_msa, &vp9_iht4x4_16_add_msa, 3, VPX_BITS_8)));
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace } // namespace

View File

@@ -13,40 +13,18 @@
#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 "vpx/vpx_codec.h" #include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h" #include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
using libvpx_test::ACMRandom;
namespace {
const int kNumCoeffs = 64; const int kNumCoeffs = 64;
const double kPi = 3.141592653589793238462643383279502884; const double kPi = 3.141592653589793238462643383279502884;
const int kSignBiasMaxDiff255 = 1500;
const int kSignBiasMaxDiff15 = 10000;
typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
int tx_type);
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
int tx_type);
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct8x8Param;
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht8x8Param;
typedef std::tr1::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t> Idct8x8Param;
void reference_8x8_dct_1d(const double in[8], double out[8], int stride) { void reference_8x8_dct_1d(const double in[8], double out[8], int stride) {
const double kInvSqrt2 = 0.707106781186547524400844362104; const double kInvSqrt2 = 0.707106781186547524400844362104;
for (int k = 0; k < 8; k++) { for (int k = 0; k < 8; k++) {
@@ -81,9 +59,26 @@ void reference_8x8_dct_2d(const int16_t input[kNumCoeffs],
} }
} }
using libvpx_test::ACMRandom;
namespace {
const int kSignBiasMaxDiff255 = 1500;
const int kSignBiasMaxDiff15 = 10000;
typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
int tx_type);
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
int tx_type);
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct8x8Param;
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht8x8Param;
typedef std::tr1::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t> Idct8x8Param;
void 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 +87,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 +103,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
@@ -144,8 +139,8 @@ class FwdTrans8x8TestBase {
void RunSignBiasCheck() { void RunSignBiasCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
DECLARE_ALIGNED(16, int16_t, test_input_block[64]); DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
DECLARE_ALIGNED(16, tran_low_t, test_output_block[64]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_output_block, 64);
int count_sign_block[64][2]; int count_sign_block[64][2];
const int count_test_block = 100000; const int count_test_block = 100000;
@@ -215,13 +210,13 @@ class FwdTrans8x8TestBase {
int max_error = 0; int max_error = 0;
int total_error = 0; int total_error = 0;
const int count_test_block = 100000; const int count_test_block = 100000;
DECLARE_ALIGNED(16, int16_t, test_input_block[64]); DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, 64);
DECLARE_ALIGNED(16, uint8_t, dst[64]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64);
DECLARE_ALIGNED(16, uint8_t, src[64]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[64]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, 64);
DECLARE_ALIGNED(16, uint16_t, src16[64]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, 64);
#endif #endif
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -292,14 +287,14 @@ class FwdTrans8x8TestBase {
int total_error = 0; int total_error = 0;
int total_coeff_error = 0; int total_coeff_error = 0;
const int count_test_block = 100000; const int count_test_block = 100000;
DECLARE_ALIGNED(16, int16_t, test_input_block[64]); DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, 64);
DECLARE_ALIGNED(16, tran_low_t, ref_temp_block[64]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_temp_block, 64);
DECLARE_ALIGNED(16, uint8_t, dst[64]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64);
DECLARE_ALIGNED(16, uint8_t, src[64]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[64]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, 64);
DECLARE_ALIGNED(16, uint16_t, src16[64]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, 64);
#endif #endif
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -381,13 +376,13 @@ class FwdTrans8x8TestBase {
void RunInvAccuracyCheck() { void RunInvAccuracyCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000; const int count_test_block = 1000;
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
#endif #endif
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -439,9 +434,9 @@ class FwdTrans8x8TestBase {
void RunFwdAccuracyCheck() { void RunFwdAccuracyCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000; const int count_test_block = 1000;
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, coeff_r[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_r, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
double out_r[kNumCoeffs]; double out_r[kNumCoeffs];
@@ -469,12 +464,12 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 10000; const int count_test_block = 10000;
const int eob = 12; const int eob = 12;
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs);
#endif #endif
const int16_t *scan = vp9_default_scan_orders[TX_8X8].scan; const int16_t *scan = vp9_default_scan_orders[TX_8X8].scan;
@@ -658,14 +653,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 +680,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 +692,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 +712,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 +732,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,26 +767,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
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
MSA, FwdTrans8x8DCT,
::testing::Values(
make_tuple(&vpx_fdct8x8_msa, &vpx_idct8x8_64_add_msa, 0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
MSA, FwdTrans8x8HT,
::testing::Values(
make_tuple(&vp9_fht8x8_msa, &vp9_iht8x8_64_add_msa, 0, VPX_BITS_8),
make_tuple(&vp9_fht8x8_msa, &vp9_iht8x8_64_add_msa, 1, VPX_BITS_8),
make_tuple(&vp9_fht8x8_msa, &vp9_iht8x8_64_add_msa, 2, VPX_BITS_8),
make_tuple(&vp9_fht8x8_msa, &vp9_iht8x8_64_add_msa, 3, VPX_BITS_8)));
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace } // namespace

View File

@@ -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);

View File

@@ -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;

View File

@@ -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
} }

View File

@@ -8,15 +8,15 @@
* 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 <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 "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h" #include "./vpx_config.h"
#include "./vp8_rtcd.h" #include "./vp8_rtcd.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "vp8/common/blockd.h" #include "vp8/common/blockd.h"
#include "vpx_mem/vpx_mem.h" #include "vpx_mem/vpx_mem.h"
@@ -299,11 +299,6 @@ INSTANTIATE_TEST_CASE_P(NEON, IntraPredYTest,
::testing::Values( ::testing::Values(
vp8_build_intra_predictors_mby_s_neon)); vp8_build_intra_predictors_mby_s_neon));
#endif #endif
#if HAVE_MSA
INSTANTIATE_TEST_CASE_P(MSA, IntraPredYTest,
::testing::Values(
vp8_build_intra_predictors_mby_s_msa));
#endif
typedef void (*IntraPredUvFunc)(MACROBLOCKD *x, typedef void (*IntraPredUvFunc)(MACROBLOCKD *x,
uint8_t *uabove_row, uint8_t *uabove_row,
@@ -397,10 +392,5 @@ INSTANTIATE_TEST_CASE_P(NEON, IntraPredUVTest,
::testing::Values( ::testing::Values(
vp8_build_intra_predictors_mbuv_s_neon)); vp8_build_intra_predictors_mbuv_s_neon));
#endif #endif
#if HAVE_MSA
INSTANTIATE_TEST_CASE_P(MSA, IntraPredUVTest,
::testing::Values(
vp8_build_intra_predictors_mbuv_s_msa));
#endif
} // namespace } // namespace

View File

@@ -110,25 +110,23 @@ TEST_P(InvalidFileTest, ReturnCode) {
RunTest(); RunTest();
} }
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"}, // {1, "invalid-vp90-03-v3.webm"},
#endif // {1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"},
{1, "invalid-vp90-03-v3.webm"}, // {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-.ivf"}, // {1, "invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"}, // {1, "invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf"}, // {1, "invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.v2.ivf"},
{1, "invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf"}, // {1, "invalid-vp91-2-mixedrefcsp-444to420.ivf"},
{1, "invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.v2.ivf"}, // {1, "invalid-vp90-2-12-droppable_1.ivf.s73804_r01-05_b6-.ivf"},
{1, "invalid-vp91-2-mixedrefcsp-444to420.ivf"}, // {1, "invalid-vp90-2-03-size-224x196.webm.ivf.s44156_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-12-droppable_1.ivf.s73804_r01-05_b6-.ivf"}, // {1, "invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-03-size-224x196.webm.ivf.s44156_r01-05_b6-.ivf"}, //};
{1, "invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf"},
};
VP9_INSTANTIATE_TEST_CASE(InvalidFileTest, //VP9_INSTANTIATE_TEST_CASE(InvalidFileTest,
::testing::ValuesIn(kVP9InvalidFileTests)); // ::testing::ValuesIn(kVP9InvalidFileTests));
// This class will include test vectors that are expected to fail // This class will include test vectors that are expected to fail
// peek. However they are still expected to have no fatal failures. // peek. However they are still expected to have no fatal failures.
@@ -144,26 +142,26 @@ TEST_P(InvalidFileInvalidPeekTest, ReturnCode) {
RunTest(); RunTest();
} }
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,
::testing::ValuesIn(kVP9InvalidFileInvalidPeekTests)); // ::testing::ValuesIn(kVP9InvalidFileInvalidPeekTests));
const DecodeParam kMultiThreadedVP9InvalidFileTests[] = { //const DecodeParam kMultiThreadedVP9InvalidFileTests[] = {
{4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"}, // {4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"},
{4, "invalid-" // {4, "invalid-"
"vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf"}, // "vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf"},
{4, "invalid-vp90-2-08-tile_1x8_frame_parallel.webm.ivf.s288_r01-05_b6-.ivf"}, // {4, "invalid-vp90-2-08-tile_1x8_frame_parallel.webm.ivf.s288_r01-05_b6-.ivf"},
{2, "invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.v2.ivf"}, // {2, "invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.v2.ivf"},
{4, "invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.v2.ivf"}, // {4, "invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.v2.ivf"},
}; //};
INSTANTIATE_TEST_CASE_P( //INSTANTIATE_TEST_CASE_P(
VP9MultiThreaded, InvalidFileTest, // VP9MultiThreaded, InvalidFileTest,
::testing::Combine( // ::testing::Combine(
::testing::Values( // ::testing::Values(
static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)), // static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)),
::testing::ValuesIn(kMultiThreadedVP9InvalidFileTests))); // ::testing::ValuesIn(kMultiThreadedVP9InvalidFileTests)));
} // namespace } // namespace

View File

@@ -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"
@@ -52,7 +52,7 @@ typedef void (*dual_loop_op_t)(uint8_t *s, int p, const uint8_t *blimit0,
const uint8_t *thresh1); const uint8_t *thresh1);
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
typedef std::tr1::tuple<loop_op_t, loop_op_t, int, int> loop8_param_t; typedef std::tr1::tuple<loop_op_t, loop_op_t, int> loop8_param_t;
typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t; typedef std::tr1::tuple<dual_loop_op_t, dual_loop_op_t, int> dualloop8_param_t;
#if HAVE_SSE2 #if HAVE_SSE2
@@ -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,43 +114,29 @@ 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
#if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
void wrapper_vertical_16_msa(uint8_t *s, int p, const uint8_t *blimit,
const uint8_t *limit, const uint8_t *thresh,
int count) {
vpx_lpf_vertical_16_msa(s, p, blimit, limit, thresh);
}
void wrapper_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
const uint8_t *limit, const uint8_t *thresh,
int count) {
vpx_lpf_vertical_16_c(s, p, blimit, limit, thresh);
}
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> { class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
public: public:
virtual ~Loop8Test6Param() {} virtual ~Loop8Test6Param() {}
@@ -158,7 +144,6 @@ class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
loopfilter_op_ = GET_PARAM(0); loopfilter_op_ = GET_PARAM(0);
ref_loopfilter_op_ = GET_PARAM(1); ref_loopfilter_op_ = GET_PARAM(1);
bit_depth_ = GET_PARAM(2); bit_depth_ = GET_PARAM(2);
count_ = GET_PARAM(3);
mask_ = (1 << bit_depth_) - 1; mask_ = (1 << bit_depth_) - 1;
} }
@@ -166,7 +151,6 @@ class Loop8Test6Param : public ::testing::TestWithParam<loop8_param_t> {
protected: protected:
int bit_depth_; int bit_depth_;
int count_;
int mask_; int mask_;
loop_op_t loopfilter_op_; loop_op_t loopfilter_op_;
loop_op_t ref_loopfilter_op_; loop_op_t ref_loopfilter_op_;
@@ -196,11 +180,11 @@ TEST_P(Loop8Test6Param, OperationCheck) {
const int count_test_block = number_of_iterations; const int count_test_block = number_of_iterations;
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
int32_t bd = bit_depth_; int32_t bd = bit_depth_;
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, s, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_s, kNumCoeffs);
#else #else
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(8, uint8_t, s, kNumCoeffs);
DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(8, uint8_t, ref_s, kNumCoeffs);
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
@@ -222,6 +206,7 @@ TEST_P(Loop8Test6Param, OperationCheck) {
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
}; };
int32_t p = kNumCoeffs/32; int32_t p = kNumCoeffs/32;
int count = 1;
uint16_t tmp_s[kNumCoeffs]; uint16_t tmp_s[kNumCoeffs];
int j = 0; int j = 0;
@@ -253,13 +238,13 @@ TEST_P(Loop8Test6Param, OperationCheck) {
ref_s[j] = s[j]; ref_s[j] = s[j];
} }
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, count_, bd); ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, count, bd);
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_, bd)); loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count, bd));
#else #else
ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh, count_); ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh, count);
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_)); loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count));
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
for (int j = 0; j < kNumCoeffs; ++j) { for (int j = 0; j < kNumCoeffs; ++j) {
@@ -281,11 +266,11 @@ TEST_P(Loop8Test6Param, ValueCheck) {
const int count_test_block = number_of_iterations; const int count_test_block = number_of_iterations;
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
const int32_t bd = bit_depth_; const int32_t bd = bit_depth_;
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, s, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_s, kNumCoeffs);
#else #else
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(8, uint8_t, s, kNumCoeffs);
DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(8, uint8_t, ref_s, kNumCoeffs);
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
@@ -294,8 +279,8 @@ TEST_P(Loop8Test6Param, ValueCheck) {
// function of sharpness_lvl and the loopfilter lvl as: // function of sharpness_lvl and the loopfilter lvl as:
// block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4)); // block_inside_limit = lvl >> ((sharpness_lvl > 0) + (sharpness_lvl > 4));
// ... // ...
// memset(lfi->lfthr[lvl].mblim, (2 * (lvl + 2) + block_inside_limit), // vpx_memset(lfi->lfthr[lvl].mblim, (2 * (lvl + 2) + block_inside_limit),
// SIMD_WIDTH); // SIMD_WIDTH);
// This means that the largest value for mblim will occur when sharpness_lvl // This means that the largest value for mblim will occur when sharpness_lvl
// is equal to 0, and lvl is equal to its greatest value (MAX_LOOP_FILTER). // is equal to 0, and lvl is equal to its greatest value (MAX_LOOP_FILTER).
// In this case block_inside_limit will be equal to MAX_LOOP_FILTER and // In this case block_inside_limit will be equal to MAX_LOOP_FILTER and
@@ -320,18 +305,19 @@ TEST_P(Loop8Test6Param, ValueCheck) {
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp
}; };
int32_t p = kNumCoeffs / 32; int32_t p = kNumCoeffs / 32;
int count = 1;
for (int j = 0; j < kNumCoeffs; ++j) { for (int j = 0; j < kNumCoeffs; ++j) {
s[j] = rnd.Rand16() & mask_; s[j] = rnd.Rand16() & mask_;
ref_s[j] = s[j]; ref_s[j] = s[j];
} }
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, count_, bd); ref_loopfilter_op_(ref_s + 8 + p * 8, p, blimit, limit, thresh, count, bd);
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_, bd)); loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count, bd));
#else #else
ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh, count_); ref_loopfilter_op_(ref_s+8+p*8, p, blimit, limit, thresh, count);
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count_)); loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh, count));
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
for (int j = 0; j < kNumCoeffs; ++j) { for (int j = 0; j < kNumCoeffs; ++j) {
err_count += ref_s[j] != s[j]; err_count += ref_s[j] != s[j];
@@ -352,11 +338,11 @@ TEST_P(Loop8Test9Param, OperationCheck) {
const int count_test_block = number_of_iterations; const int count_test_block = number_of_iterations;
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
const int32_t bd = bit_depth_; const int32_t bd = bit_depth_;
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, s, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_s, kNumCoeffs);
#else #else
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(8, uint8_t, s, kNumCoeffs);
DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(8, uint8_t, ref_s, kNumCoeffs);
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
@@ -454,11 +440,11 @@ TEST_P(Loop8Test9Param, ValueCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = number_of_iterations; const int count_test_block = number_of_iterations;
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, s, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_s, kNumCoeffs);
#else #else
DECLARE_ALIGNED(8, uint8_t, s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(8, uint8_t, s, kNumCoeffs);
DECLARE_ALIGNED(8, uint8_t, ref_s[kNumCoeffs]); DECLARE_ALIGNED_ARRAY(8, uint8_t, ref_s, kNumCoeffs);
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
@@ -534,65 +520,56 @@ 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),
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),
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),
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),
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2, make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
&vpx_highbd_lpf_horizontal_16_c, 8, 2), &vp9_highbd_lpf_vertical_8_c, 8),
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
&vpx_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),
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),
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),
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),
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),
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2, make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
&vpx_highbd_lpf_horizontal_16_c, 10, 2), &vp9_highbd_lpf_vertical_8_c, 10),
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
&vpx_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),
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),
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),
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),
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),
make_tuple(&vpx_highbd_lpf_horizontal_16_sse2, make_tuple(&vp9_highbd_lpf_vertical_8_sse2,
&vpx_highbd_lpf_horizontal_16_c, 12, 2), &vp9_highbd_lpf_vertical_8_c, 12),
make_tuple(&vpx_highbd_lpf_vertical_8_sse2,
&vpx_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),
make_tuple(&wrapper_vertical_16_dual_sse2, make_tuple(&wrapper_vertical_16_dual_sse2,
&wrapper_vertical_16_dual_c, 8, 1), &wrapper_vertical_16_dual_c, 8),
make_tuple(&wrapper_vertical_16_dual_sse2, make_tuple(&wrapper_vertical_16_dual_sse2,
&wrapper_vertical_16_dual_c, 10, 1), &wrapper_vertical_16_dual_c, 10),
make_tuple(&wrapper_vertical_16_dual_sse2, make_tuple(&wrapper_vertical_16_dual_sse2,
&wrapper_vertical_16_dual_c, 12, 1))); &wrapper_vertical_16_dual_c, 12)));
#else #else
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),
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),
make_tuple(&vpx_lpf_horizontal_16_sse2, &vpx_lpf_horizontal_16_c, 8, 2), make_tuple(&vp9_lpf_vertical_8_sse2, &vp9_lpf_vertical_8_c, 8),
make_tuple(&vpx_lpf_vertical_8_sse2, &vpx_lpf_vertical_8_c, 8, 1), make_tuple(&wrapper_vertical_16_sse2, &wrapper_vertical_16_c, 8)));
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,9 +577,7 @@ 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)));
make_tuple(&vpx_lpf_horizontal_16_avx2, &vpx_lpf_horizontal_16_c, 8,
2)));
#endif #endif
#if HAVE_SSE2 #if HAVE_SSE2
@@ -610,42 +585,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,60 +634,35 @@ 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),
make_tuple(&vpx_lpf_horizontal_16_neon,
&vpx_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),
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),
make_tuple(&vp9_lpf_horizontal_8_neon,
&vp9_lpf_horizontal_8_c, 8),
make_tuple(&vp9_lpf_vertical_8_neon,
&vp9_lpf_vertical_8_c, 8),
#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),
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)));
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
#if HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
INSTANTIATE_TEST_CASE_P(
MSA, Loop8Test6Param,
::testing::Values(
make_tuple(&vpx_lpf_horizontal_8_msa, &vpx_lpf_horizontal_8_c, 8, 1),
make_tuple(&vpx_lpf_horizontal_16_msa, &vpx_lpf_horizontal_16_c, 8, 1),
make_tuple(&vpx_lpf_horizontal_16_msa, &vpx_lpf_horizontal_16_c, 8, 2),
make_tuple(&vpx_lpf_vertical_8_msa, &vpx_lpf_vertical_8_c, 8, 1),
make_tuple(&wrapper_vertical_16_msa, &wrapper_vertical_16_c, 8, 1)));
INSTANTIATE_TEST_CASE_P(
MSA, Loop8Test9Param,
::testing::Values(
make_tuple(&vpx_lpf_horizontal_4_dual_msa,
&vpx_lpf_horizontal_4_dual_c, 8),
make_tuple(&vpx_lpf_horizontal_8_dual_msa,
&vpx_lpf_horizontal_8_dual_c, 8),
make_tuple(&vpx_lpf_vertical_4_dual_msa,
&vpx_lpf_vertical_4_dual_c, 8),
make_tuple(&vpx_lpf_vertical_8_dual_msa,
&vpx_lpf_vertical_8_dual_c, 8)));
#endif // HAVE_MSA && (!CONFIG_VP9_HIGHBITDEPTH)
} // namespace } // namespace

View File

@@ -42,10 +42,6 @@ class MD5 {
} }
} }
void Add(const uint8_t *data, size_t size) {
MD5Update(&md5_, data, static_cast<uint32_t>(size));
}
const char *Get(void) { const char *Get(void) {
static const char hex[16] = { static const char hex[16] = {
'0', '1', '2', '3', '4', '5', '6', '7', '0', '1', '2', '3', '4', '5', '6', '7',

View File

@@ -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"
@@ -75,16 +74,16 @@ TEST_P(PartialIDctTest, RunQuantCheck) {
FAIL() << "Wrong Size!"; FAIL() << "Wrong Size!";
break; break;
} }
DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_coef_block1, kMaxNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_coef_block2, kMaxNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst1[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst1, kMaxNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst2[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst2, kMaxNumCoeffs);
const int count_test_block = 1000; const int count_test_block = 1000;
const int block_size = size * size; const int block_size = size * size;
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kMaxNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kMaxNumCoeffs);
int max_error = 0; int max_error = 0;
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
@@ -154,10 +153,10 @@ TEST_P(PartialIDctTest, ResultsMatch) {
FAIL() << "Wrong Size!"; FAIL() << "Wrong Size!";
break; break;
} }
DECLARE_ALIGNED(16, tran_low_t, test_coef_block1[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_coef_block1, kMaxNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, test_coef_block2[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_coef_block2, kMaxNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst1[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst1, kMaxNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst2[kMaxNumCoeffs]); DECLARE_ALIGNED_ARRAY(16, uint8_t, dst2, kMaxNumCoeffs);
const int count_test_block = 1000; const int count_test_block = 1000;
const int max_coeff = 32766 / 4; const int max_coeff = 32766 / 4;
const int block_size = size * size; const int block_size = size * size;
@@ -202,142 +201,117 @@ 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
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
#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, 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
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE #if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
MSA, PartialIDctTest, SSSE3, PartialIDctTest,
::testing::Values( ::testing::Values(
make_tuple(&vpx_fdct32x32_c, make_tuple(&vp9_fdct16x16_c,
&vpx_idct32x32_1024_add_c, &vp9_idct16x16_256_add_c,
&vpx_idct32x32_34_add_msa, &vp9_idct16x16_10_add_ssse3,
TX_32X32, 34), TX_16X16, 10)));
make_tuple(&vpx_fdct32x32_c, #endif
&vpx_idct32x32_1024_add_c,
&vpx_idct32x32_1_add_msa,
TX_32X32, 1),
make_tuple(&vpx_fdct16x16_c,
&vpx_idct16x16_256_add_c,
&vpx_idct16x16_10_add_msa,
TX_16X16, 10),
make_tuple(&vpx_fdct16x16_c,
&vpx_idct16x16_256_add_c,
&vpx_idct16x16_1_add_msa,
TX_16X16, 1),
make_tuple(&vpx_fdct8x8_c,
&vpx_idct8x8_64_add_c,
&vpx_idct8x8_12_add_msa,
TX_8X8, 10),
make_tuple(&vpx_fdct8x8_c,
&vpx_idct8x8_64_add_c,
&vpx_idct8x8_1_add_msa,
TX_8X8, 1),
make_tuple(&vpx_fdct4x4_c,
&vpx_idct4x4_16_add_c,
&vpx_idct4x4_1_add_msa,
TX_4X4, 1)));
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace } // namespace

View File

@@ -63,12 +63,12 @@ TEST_P(VP8PostProcessingFilterTest, FilterOutputCheck) {
uint8_t *const dst_image_ptr = dst_image + 8; uint8_t *const dst_image_ptr = dst_image + 8;
uint8_t *const flimits = uint8_t *const flimits =
reinterpret_cast<uint8_t *>(vpx_memalign(16, block_width)); reinterpret_cast<uint8_t *>(vpx_memalign(16, block_width));
(void)memset(flimits, 255, block_width); (void)vpx_memset(flimits, 255, block_width);
// Initialize pixels in the input: // Initialize pixels in the input:
// block pixels to value 1, // block pixels to value 1,
// border pixels to value 10. // border pixels to value 10.
(void)memset(src_image, 10, input_size); (void)vpx_memset(src_image, 10, input_size);
uint8_t *pixel_ptr = src_image_ptr; uint8_t *pixel_ptr = src_image_ptr;
for (int i = 0; i < block_height; ++i) { for (int i = 0; i < block_height; ++i) {
for (int j = 0; j < block_width; ++j) { for (int j = 0; j < block_width; ++j) {
@@ -78,7 +78,7 @@ TEST_P(VP8PostProcessingFilterTest, FilterOutputCheck) {
} }
// Initialize pixels in the output to 99. // Initialize pixels in the output to 99.
(void)memset(dst_image, 99, output_size); (void)vpx_memset(dst_image, 99, output_size);
ASM_REGISTER_STATE_CHECK( ASM_REGISTER_STATE_CHECK(
GetParam()(src_image_ptr, dst_image_ptr, input_stride, GetParam()(src_image_ptr, dst_image_ptr, input_stride,
@@ -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

View File

@@ -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"
@@ -56,7 +56,7 @@ class QuantizeTestBase {
// The full configuration is necessary to generate the quantization tables. // The full configuration is necessary to generate the quantization tables.
VP8_CONFIG vp8_config; VP8_CONFIG vp8_config;
memset(&vp8_config, 0, sizeof(vp8_config)); vpx_memset(&vp8_config, 0, sizeof(vp8_config));
vp8_comp_ = vp8_create_compressor(&vp8_config); vp8_comp_ = vp8_create_compressor(&vp8_config);
@@ -69,7 +69,8 @@ class QuantizeTestBase {
// Copy macroblockd from the reference to get pre-set-up dequant values. // Copy macroblockd from the reference to get pre-set-up dequant values.
macroblockd_dst_ = reinterpret_cast<MACROBLOCKD *>( macroblockd_dst_ = reinterpret_cast<MACROBLOCKD *>(
vpx_memalign(32, sizeof(*macroblockd_dst_))); vpx_memalign(32, sizeof(*macroblockd_dst_)));
memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, sizeof(*macroblockd_dst_)); vpx_memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd,
sizeof(*macroblockd_dst_));
// Fix block pointers - currently they point to the blocks in the reference // Fix block pointers - currently they point to the blocks in the reference
// structure. // structure.
vp8_setup_block_dptrs(macroblockd_dst_); vp8_setup_block_dptrs(macroblockd_dst_);
@@ -78,7 +79,8 @@ class QuantizeTestBase {
void UpdateQuantizer(int q) { void UpdateQuantizer(int q) {
vp8_set_quantizer(vp8_comp_, q); vp8_set_quantizer(vp8_comp_, q);
memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd, sizeof(*macroblockd_dst_)); vpx_memcpy(macroblockd_dst_, &vp8_comp_->mb.e_mbd,
sizeof(*macroblockd_dst_));
vp8_setup_block_dptrs(macroblockd_dst_); vp8_setup_block_dptrs(macroblockd_dst_);
} }
@@ -192,12 +194,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

View File

@@ -96,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 {
@@ -111,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;
} }
@@ -119,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";

File diff suppressed because it is too large Load Diff

View File

@@ -53,7 +53,7 @@ TEST(VP8RoiMapTest, ParameterCheck) {
cpi.common.mb_rows = 240 >> 4; cpi.common.mb_rows = 240 >> 4;
cpi.common.mb_cols = 320 >> 4; cpi.common.mb_cols = 320 >> 4;
const int mbs = (cpi.common.mb_rows * cpi.common.mb_cols); const int mbs = (cpi.common.mb_rows * cpi.common.mb_cols);
memset(cpi.segment_feature_data, 0, sizeof(cpi.segment_feature_data)); vpx_memset(cpi.segment_feature_data, 0, sizeof(cpi.segment_feature_data));
// Segment map // Segment map
cpi.segmentation_map = reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1)); cpi.segmentation_map = reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1));
@@ -61,9 +61,9 @@ TEST(VP8RoiMapTest, ParameterCheck) {
// Allocate memory for the source memory map. // Allocate memory for the source memory map.
unsigned char *roi_map = unsigned char *roi_map =
reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1)); reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1));
memset(&roi_map[mbs >> 2], 1, (mbs >> 2)); vpx_memset(&roi_map[mbs >> 2], 1, (mbs >> 2));
memset(&roi_map[mbs >> 1], 2, (mbs >> 2)); vpx_memset(&roi_map[mbs >> 1], 2, (mbs >> 2));
memset(&roi_map[mbs -(mbs >> 2)], 3, (mbs >> 2)); vpx_memset(&roi_map[mbs -(mbs >> 2)], 3, (mbs >> 2));
// Do a test call with valid parameters. // Do a test call with valid parameters.
int roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows, int roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,

View File

@@ -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"
@@ -240,16 +238,4 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(8, 4, sixtap_8x4_ssse3), make_tuple(8, 4, sixtap_8x4_ssse3),
make_tuple(4, 4, sixtap_4x4_ssse3))); make_tuple(4, 4, sixtap_4x4_ssse3)));
#endif #endif
#if HAVE_MSA
const SixtapPredictFunc sixtap_16x16_msa = vp8_sixtap_predict16x16_msa;
const SixtapPredictFunc sixtap_8x8_msa = vp8_sixtap_predict8x8_msa;
const SixtapPredictFunc sixtap_8x4_msa = vp8_sixtap_predict8x4_msa;
const SixtapPredictFunc sixtap_4x4_msa = vp8_sixtap_predict4x4_msa;
INSTANTIATE_TEST_CASE_P(
MSA, SixtapPredictTest, ::testing::Values(
make_tuple(16, 16, sixtap_16x16_msa),
make_tuple(8, 8, sixtap_8x8_msa),
make_tuple(8, 4, sixtap_8x4_msa),
make_tuple(4, 4, sixtap_4x4_msa)));
#endif
} // namespace } // namespace

123
test/subtract_test.cc Normal file
View 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

View File

@@ -94,7 +94,4 @@ TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) {
VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values( VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(
::libvpx_test::kTwoPassGood)); ::libvpx_test::kTwoPassGood));
VP10_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(
::libvpx_test::kTwoPassGood));
} // namespace } // namespace

View File

@@ -63,9 +63,6 @@ class SvcTest : public ::testing::Test {
vpx_codec_dec_cfg_t dec_cfg = vpx_codec_dec_cfg_t(); vpx_codec_dec_cfg_t dec_cfg = vpx_codec_dec_cfg_t();
VP9CodecFactory codec_factory; VP9CodecFactory codec_factory;
decoder_ = codec_factory.CreateDecoder(dec_cfg, 0); decoder_ = codec_factory.CreateDecoder(dec_cfg, 0);
tile_columns_ = 0;
tile_rows_ = 0;
} }
virtual void TearDown() { virtual void TearDown() {
@@ -78,8 +75,6 @@ class SvcTest : public ::testing::Test {
vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_); vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
EXPECT_EQ(VPX_CODEC_OK, res); EXPECT_EQ(VPX_CODEC_OK, res);
vpx_codec_control(&codec_, VP8E_SET_CPUUSED, 4); // Make the test faster vpx_codec_control(&codec_, VP8E_SET_CPUUSED, 4); // Make the test faster
vpx_codec_control(&codec_, VP9E_SET_TILE_COLUMNS, tile_columns_);
vpx_codec_control(&codec_, VP9E_SET_TILE_ROWS, tile_rows_);
codec_initialized_ = true; codec_initialized_ = true;
} }
@@ -113,8 +108,7 @@ class SvcTest : public ::testing::Test {
codec_enc_.g_pass = VPX_RC_FIRST_PASS; codec_enc_.g_pass = VPX_RC_FIRST_PASS;
InitializeEncoder(); InitializeEncoder();
libvpx_test::I420VideoSource video(test_file_name_, libvpx_test::I420VideoSource video(test_file_name_, kWidth, kHeight,
codec_enc_.g_w, codec_enc_.g_h,
codec_enc_.g_timebase.den, codec_enc_.g_timebase.den,
codec_enc_.g_timebase.num, 0, 30); codec_enc_.g_timebase.num, 0, 30);
video.Begin(); video.Begin();
@@ -182,8 +176,7 @@ class SvcTest : public ::testing::Test {
} }
InitializeEncoder(); InitializeEncoder();
libvpx_test::I420VideoSource video(test_file_name_, libvpx_test::I420VideoSource video(test_file_name_, kWidth, kHeight,
codec_enc_.g_w, codec_enc_.g_h,
codec_enc_.g_timebase.den, codec_enc_.g_timebase.den,
codec_enc_.g_timebase.num, 0, 30); codec_enc_.g_timebase.num, 0, 30);
video.Begin(); video.Begin();
@@ -317,8 +310,6 @@ class SvcTest : public ::testing::Test {
std::string test_file_name_; std::string test_file_name_;
bool codec_initialized_; bool codec_initialized_;
Decoder *decoder_; Decoder *decoder_;
int tile_columns_;
int tile_rows_;
}; };
TEST_F(SvcTest, SvcInit) { TEST_F(SvcTest, SvcInit) {
@@ -453,7 +444,6 @@ TEST_F(SvcTest, OnePassEncodeOneFrame) {
TEST_F(SvcTest, OnePassEncodeThreeFrames) { TEST_F(SvcTest, OnePassEncodeThreeFrames) {
codec_enc_.g_pass = VPX_RC_ONE_PASS; codec_enc_.g_pass = VPX_RC_ONE_PASS;
codec_enc_.g_lag_in_frames = 0;
vpx_fixed_buf outputs[3]; vpx_fixed_buf outputs[3];
memset(&outputs[0], 0, sizeof(outputs)); memset(&outputs[0], 0, sizeof(outputs));
Pass2EncodeNFrames(NULL, 3, 2, &outputs[0]); Pass2EncodeNFrames(NULL, 3, 2, &outputs[0]);
@@ -747,51 +737,4 @@ TEST_F(SvcTest,
FreeBitstreamBuffers(&outputs[0], 10); FreeBitstreamBuffers(&outputs[0], 10);
} }
TEST_F(SvcTest, TwoPassEncode2TemporalLayersWithTiles) {
// First pass encode
std::string stats_buf;
vpx_svc_set_options(&svc_, "scale-factors=1/1");
svc_.temporal_layers = 2;
Pass1EncodeNFrames(10, 1, &stats_buf);
// Second pass encode
codec_enc_.g_pass = VPX_RC_LAST_PASS;
svc_.temporal_layers = 2;
vpx_svc_set_options(&svc_, "auto-alt-refs=1 scale-factors=1/1");
codec_enc_.g_w = 704;
codec_enc_.g_h = 144;
tile_columns_ = 1;
tile_rows_ = 1;
vpx_fixed_buf outputs[10];
memset(&outputs[0], 0, sizeof(outputs));
Pass2EncodeNFrames(&stats_buf, 10, 1, &outputs[0]);
DecodeNFrames(&outputs[0], 10);
FreeBitstreamBuffers(&outputs[0], 10);
}
TEST_F(SvcTest,
TwoPassEncode2TemporalLayersWithMultipleFrameContextsAndTiles) {
// First pass encode
std::string stats_buf;
vpx_svc_set_options(&svc_, "scale-factors=1/1");
svc_.temporal_layers = 2;
Pass1EncodeNFrames(10, 1, &stats_buf);
// Second pass encode
codec_enc_.g_pass = VPX_RC_LAST_PASS;
svc_.temporal_layers = 2;
codec_enc_.g_error_resilient = 0;
codec_enc_.g_w = 704;
codec_enc_.g_h = 144;
tile_columns_ = 1;
tile_rows_ = 1;
vpx_svc_set_options(&svc_, "auto-alt-refs=1 scale-factors=1/1 "
"multi-frame-contexts=1");
vpx_fixed_buf outputs[10];
memset(&outputs[0], 0, sizeof(outputs));
Pass2EncodeNFrames(&stats_buf, 10, 1, &outputs[0]);
DecodeNFrames(&outputs[0], 10);
FreeBitstreamBuffers(&outputs[0], 10);
}
} // namespace } // namespace

View File

@@ -12,7 +12,6 @@ LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_420.y4m
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_422.y4m LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_422.y4m
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_444.y4m LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_444.y4m
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_440.yuv LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_12_440.yuv
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_420_a10-1.y4m
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_420.y4m LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_420.y4m
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_8_422.y4m 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
@@ -687,8 +686,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

File diff suppressed because it is too large Load Diff

View File

@@ -66,7 +66,6 @@ LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../tools_common.h
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.cc LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.cc
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.h LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../webmdec.h
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += webm_video_source.h LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += webm_video_source.h
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_skip_loopfilter_test.cc
endif endif
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += decode_api_test.cc LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += decode_api_test.cc
@@ -91,7 +90,6 @@ endif
## shared library builds don't make these functions accessible. ## shared library builds don't make these functions accessible.
## ##
ifeq ($(CONFIG_SHARED),) ifeq ($(CONFIG_SHARED),)
LIBVPX_TEST_SRCS-$(CONFIG_VP9) += lpf_8_test.cc
## VP8 ## VP8
ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),) ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
@@ -105,6 +103,7 @@ 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) += 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-$(CONFIG_VP8_ENCODER) += quantize_test.cc
@@ -143,6 +142,7 @@ 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) += 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_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
@@ -150,23 +150,16 @@ 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) += consistency_test.cc
endif endif
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_TEMPORAL_DENOISING),yesyes) ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_TEMPORAL_DENOISING),yesyes)
LIBVPX_TEST_SRCS-$(HAVE_SSE2) += vp9_denoiser_sse2_test.cc LIBVPX_TEST_SRCS-$(HAVE_SSE2) += vp9_denoiser_sse2_test.cc
endif endif
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_arf_freq_test.cc
endif # VP9 endif # VP9
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc
TEST_INTRA_PRED_SPEED_SRCS-$(CONFIG_VP9) := test_intra_pred_speed.cc
TEST_INTRA_PRED_SPEED_SRCS-$(CONFIG_VP9) += ../md5_utils.h ../md5_utils.c
endif # CONFIG_SHARED endif # CONFIG_SHARED
include $(SRC_PATH_BARE)/test/test-data.mk include $(SRC_PATH_BARE)/test/test-data.mk

View File

@@ -1,384 +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.
*/
// Test and time VPX intra-predictor functions
#include <stdio.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/md5_helper.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/vpx_timer.h"
// -----------------------------------------------------------------------------
namespace {
typedef void (*VpxPredFunc)(uint8_t *dst, ptrdiff_t y_stride,
const uint8_t *above, const uint8_t *left);
const int kNumVp9IntraPredFuncs = 13;
const char *kVp9IntraPredNames[kNumVp9IntraPredFuncs] = {
"DC_PRED", "DC_LEFT_PRED", "DC_TOP_PRED", "DC_128_PRED", "V_PRED", "H_PRED",
"D45_PRED", "D135_PRED", "D117_PRED", "D153_PRED", "D207_PRED", "D63_PRED",
"TM_PRED"
};
void TestIntraPred(const char name[], VpxPredFunc const *pred_funcs,
const char *const pred_func_names[], int num_funcs,
const char *const signatures[], int block_size,
int num_pixels_per_test) {
libvpx_test::ACMRandom rnd(libvpx_test::ACMRandom::DeterministicSeed());
const int kBPS = 32;
const int kTotalPixels = 32 * kBPS;
DECLARE_ALIGNED(16, uint8_t, src[kTotalPixels]);
DECLARE_ALIGNED(16, uint8_t, ref_src[kTotalPixels]);
DECLARE_ALIGNED(16, uint8_t, left[kBPS]);
DECLARE_ALIGNED(16, uint8_t, above_mem[2 * kBPS + 16]);
uint8_t *const above = above_mem + 16;
for (int i = 0; i < kTotalPixels; ++i) ref_src[i] = rnd.Rand8();
for (int i = 0; i < kBPS; ++i) left[i] = rnd.Rand8();
for (int i = -1; i < kBPS; ++i) above[i] = rnd.Rand8();
const int kNumTests = static_cast<int>(2.e10 / num_pixels_per_test);
// some code assumes the top row has been extended:
// d45/d63 C-code, for instance, but not the assembly.
// TODO(jzern): this style of extension isn't strictly necessary.
ASSERT_LE(block_size, kBPS);
memset(above + block_size, above[block_size - 1], 2 * kBPS - block_size);
for (int k = 0; k < num_funcs; ++k) {
if (pred_funcs[k] == NULL) continue;
memcpy(src, ref_src, sizeof(src));
vpx_usec_timer timer;
vpx_usec_timer_start(&timer);
for (int num_tests = 0; num_tests < kNumTests; ++num_tests) {
pred_funcs[k](src, kBPS, above, left);
}
libvpx_test::ClearSystemState();
vpx_usec_timer_mark(&timer);
const int elapsed_time =
static_cast<int>(vpx_usec_timer_elapsed(&timer) / 1000);
libvpx_test::MD5 md5;
md5.Add(src, sizeof(src));
printf("Mode %s[%12s]: %5d ms MD5: %s\n", name, pred_func_names[k],
elapsed_time, md5.Get());
EXPECT_STREQ(signatures[k], md5.Get());
}
}
void TestIntraPred4(VpxPredFunc const *pred_funcs) {
static const int kNumVp9IntraFuncs = 13;
static const char *const kSignatures[kNumVp9IntraFuncs] = {
"4334156168b34ab599d9b5b30f522fe9",
"bc4649d5ba47c7ff178d92e475960fb0",
"8d316e5933326dcac24e1064794b5d12",
"a27270fed024eafd762c95de85f4da51",
"c33dff000d4256c2b8f3bf9e9bab14d2",
"44d8cddc2ad8f79b8ed3306051722b4f",
"eb54839b2bad6699d8946f01ec041cd0",
"ecb0d56ae5f677ea45127ce9d5c058e4",
"0b7936841f6813da818275944895b574",
"9117972ef64f91a58ff73e1731c81db2",
"c56d5e8c729e46825f46dd5d3b5d508a",
"c0889e2039bcf7bcb5d2f33cdca69adc",
"309a618577b27c648f9c5ee45252bc8f",
};
TestIntraPred("Intra4", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs,
kSignatures, 4, 4 * 4 * kNumVp9IntraFuncs);
}
void TestIntraPred8(VpxPredFunc const *pred_funcs) {
static const int kNumVp9IntraFuncs = 13;
static const char *const kSignatures[kNumVp9IntraFuncs] = {
"7694ddeeefed887faf9d339d18850928",
"7d726b1213591b99f736be6dec65065b",
"19c5711281357a485591aaf9c96c0a67",
"ba6b66877a089e71cd938e3b8c40caac",
"802440c93317e0f8ba93fab02ef74265",
"9e09a47a15deb0b9d8372824f9805080",
"b7c2d8c662268c0c427da412d7b0311d",
"78339c1c60bb1d67d248ab8c4da08b7f",
"5c97d70f7d47de1882a6cd86c165c8a9",
"8182bf60688b42205acd95e59e967157",
"08323400005a297f16d7e57e7fe1eaac",
"95f7bfc262329a5849eda66d8f7c68ce",
"815b75c8e0d91cc1ae766dc5d3e445a3",
};
TestIntraPred("Intra8", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs,
kSignatures, 8, 8 * 8 * kNumVp9IntraFuncs);
}
void TestIntraPred16(VpxPredFunc const *pred_funcs) {
static const int kNumVp9IntraFuncs = 13;
static const char *const kSignatures[kNumVp9IntraFuncs] = {
"b40dbb555d5d16a043dc361e6694fe53",
"fb08118cee3b6405d64c1fd68be878c6",
"6c190f341475c837cc38c2e566b64875",
"db5c34ccbe2c7f595d9b08b0dc2c698c",
"a62cbfd153a1f0b9fed13e62b8408a7a",
"143df5b4c89335e281103f610f5052e4",
"d87feb124107cdf2cfb147655aa0bb3c",
"7841fae7d4d47b519322e6a03eeed9dc",
"f6ebed3f71cbcf8d6d0516ce87e11093",
"3cc480297dbfeed01a1c2d78dd03d0c5",
"b9f69fa6532b372c545397dcb78ef311",
"a8fe1c70432f09d0c20c67bdb6432c4d",
"b8a41aa968ec108af447af4217cba91b",
};
TestIntraPred("Intra16", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs,
kSignatures, 16, 16 * 16 * kNumVp9IntraFuncs);
}
void TestIntraPred32(VpxPredFunc const *pred_funcs) {
static const int kNumVp9IntraFuncs = 13;
static const char *const kSignatures[kNumVp9IntraFuncs] = {
"558541656d84f9ae7896db655826febe",
"b3587a1f9a01495fa38c8cd3c8e2a1bf",
"4c6501e64f25aacc55a2a16c7e8f0255",
"b3b01379ba08916ef6b1b35f7d9ad51c",
"0f1eb38b6cbddb3d496199ef9f329071",
"911c06efb9ed1c3b4c104b232b55812f",
"9225beb0ddfa7a1d24eaa1be430a6654",
"0a6d584a44f8db9aa7ade2e2fdb9fc9e",
"b01c9076525216925f3456f034fb6eee",
"d267e20ad9e5cd2915d1a47254d3d149",
"ed012a4a5da71f36c2393023184a0e59",
"f162b51ed618d28b936974cff4391da5",
"9e1370c6d42e08d357d9612c93a71cfc",
};
TestIntraPred("Intra32", pred_funcs, kVp9IntraPredNames, kNumVp9IntraFuncs,
kSignatures, 32, 32 * 32 * kNumVp9IntraFuncs);
}
} // namespace
// Defines a test case for |arch| (e.g., C, SSE2, ...) passing the predictors
// to |test_func|. The test name is 'arch.test_func', e.g., C.TestIntraPred4.
#define INTRA_PRED_TEST(arch, test_func, dc, dc_left, dc_top, dc_128, v, h, \
d45, d135, d117, d153, d207, d63, tm) \
TEST(arch, test_func) { \
static const VpxPredFunc vpx_intra_pred[] = { \
dc, dc_left, dc_top, dc_128, v, h, d45, \
d135, d117, d153, d207, d63, tm}; \
test_func(vpx_intra_pred); \
}
// -----------------------------------------------------------------------------
// 4x4
INTRA_PRED_TEST(C, TestIntraPred4, vpx_dc_predictor_4x4_c,
vpx_dc_left_predictor_4x4_c, vpx_dc_top_predictor_4x4_c,
vpx_dc_128_predictor_4x4_c, vpx_v_predictor_4x4_c,
vpx_h_predictor_4x4_c, vpx_d45_predictor_4x4_c,
vpx_d135_predictor_4x4_c, vpx_d117_predictor_4x4_c,
vpx_d153_predictor_4x4_c, vpx_d207_predictor_4x4_c,
vpx_d63_predictor_4x4_c, vpx_tm_predictor_4x4_c)
#if HAVE_SSE && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSE, TestIntraPred4, vpx_dc_predictor_4x4_sse,
vpx_dc_left_predictor_4x4_sse, vpx_dc_top_predictor_4x4_sse,
vpx_dc_128_predictor_4x4_sse, vpx_v_predictor_4x4_sse, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, vpx_tm_predictor_4x4_sse)
#endif // HAVE_SSE && CONFIG_USE_X86INC
#if HAVE_SSSE3 && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSSE3, TestIntraPred4, NULL, NULL, NULL, NULL, NULL,
vpx_h_predictor_4x4_ssse3, vpx_d45_predictor_4x4_ssse3, NULL,
NULL, vpx_d153_predictor_4x4_ssse3,
vpx_d207_predictor_4x4_ssse3, vpx_d63_predictor_4x4_ssse3, NULL)
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
#if HAVE_DSPR2
INTRA_PRED_TEST(DSPR2, TestIntraPred4, vpx_dc_predictor_4x4_dspr2, NULL, NULL,
NULL, NULL, vpx_h_predictor_4x4_dspr2, NULL, NULL, NULL, NULL,
NULL, NULL, vpx_tm_predictor_4x4_dspr2)
#endif // HAVE_DSPR2
#if HAVE_NEON
INTRA_PRED_TEST(NEON, TestIntraPred4, vpx_dc_predictor_4x4_neon,
vpx_dc_left_predictor_4x4_neon, vpx_dc_top_predictor_4x4_neon,
vpx_dc_128_predictor_4x4_neon, vpx_v_predictor_4x4_neon,
vpx_h_predictor_4x4_neon, vpx_d45_predictor_4x4_neon,
vpx_d135_predictor_4x4_neon, NULL, NULL, NULL, NULL,
vpx_tm_predictor_4x4_neon)
#endif // HAVE_NEON
#if HAVE_MSA
INTRA_PRED_TEST(MSA, TestIntraPred4, vpx_dc_predictor_4x4_msa,
vpx_dc_left_predictor_4x4_msa, vpx_dc_top_predictor_4x4_msa,
vpx_dc_128_predictor_4x4_msa, vpx_v_predictor_4x4_msa,
vpx_h_predictor_4x4_msa, NULL, NULL, NULL, NULL, NULL,
NULL, vpx_tm_predictor_4x4_msa)
#endif // HAVE_MSA
// -----------------------------------------------------------------------------
// 8x8
INTRA_PRED_TEST(C, TestIntraPred8, vpx_dc_predictor_8x8_c,
vpx_dc_left_predictor_8x8_c, vpx_dc_top_predictor_8x8_c,
vpx_dc_128_predictor_8x8_c, vpx_v_predictor_8x8_c,
vpx_h_predictor_8x8_c, vpx_d45_predictor_8x8_c,
vpx_d135_predictor_8x8_c, vpx_d117_predictor_8x8_c,
vpx_d153_predictor_8x8_c, vpx_d207_predictor_8x8_c,
vpx_d63_predictor_8x8_c, vpx_tm_predictor_8x8_c)
#if HAVE_SSE && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSE, TestIntraPred8, vpx_dc_predictor_8x8_sse,
vpx_dc_left_predictor_8x8_sse, vpx_dc_top_predictor_8x8_sse,
vpx_dc_128_predictor_8x8_sse, vpx_v_predictor_8x8_sse, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#endif // HAVE_SSE && CONFIG_USE_X86INC
#if HAVE_SSE2 && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSE2, TestIntraPred8, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, vpx_tm_predictor_8x8_sse2)
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
#if HAVE_SSSE3 && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSSE3, TestIntraPred8, NULL, NULL, NULL, NULL, NULL,
vpx_h_predictor_8x8_ssse3, vpx_d45_predictor_8x8_ssse3, NULL,
NULL, vpx_d153_predictor_8x8_ssse3,
vpx_d207_predictor_8x8_ssse3, vpx_d63_predictor_8x8_ssse3, NULL)
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
#if HAVE_DSPR2
INTRA_PRED_TEST(DSPR2, TestIntraPred8, vpx_dc_predictor_8x8_dspr2, NULL, NULL,
NULL, NULL, vpx_h_predictor_8x8_dspr2, NULL, NULL, NULL, NULL,
NULL, NULL, vpx_tm_predictor_8x8_c)
#endif // HAVE_DSPR2
#if HAVE_NEON
INTRA_PRED_TEST(NEON, TestIntraPred8, vpx_dc_predictor_8x8_neon,
vpx_dc_left_predictor_8x8_neon, vpx_dc_top_predictor_8x8_neon,
vpx_dc_128_predictor_8x8_neon, vpx_v_predictor_8x8_neon,
vpx_h_predictor_8x8_neon, vpx_d45_predictor_8x8_neon, NULL,
NULL, NULL, NULL, NULL, vpx_tm_predictor_8x8_neon)
#endif // HAVE_NEON
#if HAVE_MSA
INTRA_PRED_TEST(MSA, TestIntraPred8, vpx_dc_predictor_8x8_msa,
vpx_dc_left_predictor_8x8_msa, vpx_dc_top_predictor_8x8_msa,
vpx_dc_128_predictor_8x8_msa, vpx_v_predictor_8x8_msa,
vpx_h_predictor_8x8_msa, NULL, NULL, NULL, NULL, NULL,
NULL, vpx_tm_predictor_8x8_msa)
#endif // HAVE_MSA
// -----------------------------------------------------------------------------
// 16x16
INTRA_PRED_TEST(C, TestIntraPred16, vpx_dc_predictor_16x16_c,
vpx_dc_left_predictor_16x16_c, vpx_dc_top_predictor_16x16_c,
vpx_dc_128_predictor_16x16_c, vpx_v_predictor_16x16_c,
vpx_h_predictor_16x16_c, vpx_d45_predictor_16x16_c,
vpx_d135_predictor_16x16_c, vpx_d117_predictor_16x16_c,
vpx_d153_predictor_16x16_c, vpx_d207_predictor_16x16_c,
vpx_d63_predictor_16x16_c, vpx_tm_predictor_16x16_c)
#if HAVE_SSE2 && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSE2, TestIntraPred16, vpx_dc_predictor_16x16_sse2,
vpx_dc_left_predictor_16x16_sse2,
vpx_dc_top_predictor_16x16_sse2,
vpx_dc_128_predictor_16x16_sse2, vpx_v_predictor_16x16_sse2,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
vpx_tm_predictor_16x16_sse2)
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
#if HAVE_SSSE3 && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSSE3, TestIntraPred16, NULL, NULL, NULL, NULL, NULL,
vpx_h_predictor_16x16_ssse3, vpx_d45_predictor_16x16_ssse3,
NULL, NULL, vpx_d153_predictor_16x16_ssse3,
vpx_d207_predictor_16x16_ssse3, vpx_d63_predictor_16x16_ssse3,
NULL)
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
#if HAVE_DSPR2
INTRA_PRED_TEST(DSPR2, TestIntraPred16, vpx_dc_predictor_16x16_dspr2, NULL,
NULL, NULL, NULL, vpx_h_predictor_16x16_dspr2, NULL, NULL, NULL,
NULL, NULL, NULL, NULL)
#endif // HAVE_DSPR2
#if HAVE_NEON
INTRA_PRED_TEST(NEON, TestIntraPred16, vpx_dc_predictor_16x16_neon,
vpx_dc_left_predictor_16x16_neon,
vpx_dc_top_predictor_16x16_neon,
vpx_dc_128_predictor_16x16_neon, vpx_v_predictor_16x16_neon,
vpx_h_predictor_16x16_neon, vpx_d45_predictor_16x16_neon, NULL,
NULL, NULL, NULL, NULL, vpx_tm_predictor_16x16_neon)
#endif // HAVE_NEON
#if HAVE_MSA
INTRA_PRED_TEST(MSA, TestIntraPred16, vpx_dc_predictor_16x16_msa,
vpx_dc_left_predictor_16x16_msa, vpx_dc_top_predictor_16x16_msa,
vpx_dc_128_predictor_16x16_msa, vpx_v_predictor_16x16_msa,
vpx_h_predictor_16x16_msa, NULL, NULL, NULL, NULL, NULL,
NULL, vpx_tm_predictor_16x16_msa)
#endif // HAVE_MSA
// -----------------------------------------------------------------------------
// 32x32
INTRA_PRED_TEST(C, TestIntraPred32, vpx_dc_predictor_32x32_c,
vpx_dc_left_predictor_32x32_c, vpx_dc_top_predictor_32x32_c,
vpx_dc_128_predictor_32x32_c, vpx_v_predictor_32x32_c,
vpx_h_predictor_32x32_c, vpx_d45_predictor_32x32_c,
vpx_d135_predictor_32x32_c, vpx_d117_predictor_32x32_c,
vpx_d153_predictor_32x32_c, vpx_d207_predictor_32x32_c,
vpx_d63_predictor_32x32_c, vpx_tm_predictor_32x32_c)
#if HAVE_SSE2 && CONFIG_USE_X86INC
#if ARCH_X86_64
INTRA_PRED_TEST(SSE2, TestIntraPred32, vpx_dc_predictor_32x32_sse2,
vpx_dc_left_predictor_32x32_sse2,
vpx_dc_top_predictor_32x32_sse2,
vpx_dc_128_predictor_32x32_sse2, vpx_v_predictor_32x32_sse2,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
vpx_tm_predictor_32x32_sse2)
#else
INTRA_PRED_TEST(SSE2, TestIntraPred32, vpx_dc_predictor_32x32_sse2,
vpx_dc_left_predictor_32x32_sse2,
vpx_dc_top_predictor_32x32_sse2,
vpx_dc_128_predictor_32x32_sse2, vpx_v_predictor_32x32_sse2,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
#endif // ARCH_X86_64
#endif // HAVE_SSE2 && CONFIG_USE_X86INC
#if HAVE_SSSE3 && CONFIG_USE_X86INC
INTRA_PRED_TEST(SSSE3, TestIntraPred32, NULL, NULL, NULL, NULL, NULL,
vpx_h_predictor_32x32_ssse3, vpx_d45_predictor_32x32_ssse3,
NULL, NULL, vpx_d153_predictor_32x32_ssse3,
vpx_d207_predictor_32x32_ssse3, vpx_d63_predictor_32x32_ssse3,
NULL)
#endif // HAVE_SSSE3 && CONFIG_USE_X86INC
#if HAVE_NEON
INTRA_PRED_TEST(NEON, TestIntraPred32, vpx_dc_predictor_32x32_neon,
vpx_dc_left_predictor_32x32_neon,
vpx_dc_top_predictor_32x32_neon,
vpx_dc_128_predictor_32x32_neon, vpx_v_predictor_32x32_neon,
vpx_h_predictor_32x32_neon, NULL, NULL, NULL, NULL, NULL, NULL,
vpx_tm_predictor_32x32_neon)
#endif // HAVE_NEON
#if HAVE_MSA
INTRA_PRED_TEST(MSA, TestIntraPred32, vpx_dc_predictor_32x32_msa,
vpx_dc_left_predictor_32x32_msa, vpx_dc_top_predictor_32x32_msa,
vpx_dc_128_predictor_32x32_msa, vpx_v_predictor_32x32_msa,
vpx_h_predictor_32x32_msa, NULL, NULL, NULL, NULL, NULL,
NULL, vpx_tm_predictor_32x32_msa)
#endif // HAVE_MSA
#include "test/test_libvpx.cc"

View File

@@ -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"
@@ -18,15 +15,13 @@
extern "C" { extern "C" {
#if CONFIG_VP8 #if CONFIG_VP8
extern void vp8_rtcd(); extern void vp8_rtcd();
#endif // CONFIG_VP8 #endif
#if CONFIG_VP9 #if CONFIG_VP9
extern void vp9_rtcd(); extern void vp9_rtcd();
#endif // CONFIG_VP9 #endif
extern void vpx_dsp_rtcd();
extern void vpx_scale_rtcd();
} }
#include "third_party/googletest/src/include/gtest/gtest.h"
#if ARCH_X86 || ARCH_X86_64
static void append_negative_gtest_filter(const char *str) { 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 +29,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);
@@ -42,22 +36,22 @@ int main(int argc, char **argv) {
#if ARCH_X86 || ARCH_X86_64 #if ARCH_X86 || ARCH_X86_64
const int simd_caps = x86_simd_caps(); const int simd_caps = x86_simd_caps();
if (!(simd_caps & HAS_MMX)) if (!(simd_caps & HAS_MMX))
append_negative_gtest_filter(":MMX.*:MMX/*"); append_negative_gtest_filter(":MMX/*");
if (!(simd_caps & HAS_SSE)) if (!(simd_caps & HAS_SSE))
append_negative_gtest_filter(":SSE.*:SSE/*"); append_negative_gtest_filter(":SSE/*");
if (!(simd_caps & HAS_SSE2)) if (!(simd_caps & HAS_SSE2))
append_negative_gtest_filter(":SSE2.*:SSE2/*"); append_negative_gtest_filter(":SSE2/*");
if (!(simd_caps & HAS_SSE3)) if (!(simd_caps & HAS_SSE3))
append_negative_gtest_filter(":SSE3.*:SSE3/*"); append_negative_gtest_filter(":SSE3/*");
if (!(simd_caps & HAS_SSSE3)) if (!(simd_caps & HAS_SSSE3))
append_negative_gtest_filter(":SSSE3.*:SSSE3/*"); append_negative_gtest_filter(":SSSE3/*");
if (!(simd_caps & HAS_SSE4_1)) if (!(simd_caps & HAS_SSE4_1))
append_negative_gtest_filter(":SSE4_1.*:SSE4_1/*"); append_negative_gtest_filter(":SSE4_1/*");
if (!(simd_caps & HAS_AVX)) if (!(simd_caps & HAS_AVX))
append_negative_gtest_filter(":AVX.*:AVX/*"); append_negative_gtest_filter(":AVX/*");
if (!(simd_caps & HAS_AVX2)) if (!(simd_caps & HAS_AVX2))
append_negative_gtest_filter(":AVX2.*:AVX2/*"); append_negative_gtest_filter(":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
@@ -65,13 +59,11 @@ int main(int argc, char **argv) {
#if CONFIG_VP8 #if CONFIG_VP8
vp8_rtcd(); vp8_rtcd();
#endif // CONFIG_VP8 #endif
#if CONFIG_VP9 #if CONFIG_VP9
vp9_rtcd(); vp9_rtcd();
#endif // CONFIG_VP9 #endif
vpx_dsp_rtcd(); #endif
vpx_scale_rtcd();
#endif // !CONFIG_SHARED
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }

View File

@@ -135,7 +135,6 @@ TEST_P(TestVectorTest, MD5Match) {
// Test VP8 decode in serial mode with single thread. // Test VP8 decode in serial mode with single thread.
// NOTE: VP8 only support serial mode. // NOTE: VP8 only support serial mode.
#if CONFIG_VP8_DECODER
VP8_INSTANTIATE_TEST_CASE( VP8_INSTANTIATE_TEST_CASE(
TestVectorTest, TestVectorTest,
::testing::Combine( ::testing::Combine(
@@ -144,30 +143,30 @@ 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
// Test VP9 decode in serial mode with single thread. // Test VP9 decode in serial mode with single thread.
#if CONFIG_VP9_DECODER //VP9_INSTANTIATE_TEST_CASE(
VP9_INSTANTIATE_TEST_CASE( // TestVectorTest,
TestVectorTest, // ::testing::Combine(
::testing::Combine( // ::testing::Values(0), // Serial Mode.
::testing::Values(0), // Serial Mode. // ::testing::Values(1), // Single thread.
::testing::Values(1), // Single thread. // ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
::testing::ValuesIn(libvpx_test::kVP9TestVectors, // libvpx_test::kVP9TestVectors +
libvpx_test::kVP9TestVectors + // libvpx_test::kNumVP9TestVectors)));
libvpx_test::kNumVP9TestVectors)));
// Test VP9 decode in frame parallel mode with different number of threads.
INSTANTIATE_TEST_CASE_P( //#if CONFIG_VP9_DECODER
VP9MultiThreadedFrameParallel, TestVectorTest, //// Test VP9 decode in frame parallel mode with different number of threads.
::testing::Combine( //INSTANTIATE_TEST_CASE_P(
::testing::Values( // VP9MultiThreadedFrameParallel, TestVectorTest,
static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)), // ::testing::Combine(
::testing::Combine( // ::testing::Values(
::testing::Values(1), // Frame Parallel mode. // static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)),
::testing::Range(2, 9), // With 2 ~ 8 threads. // ::testing::Combine(
::testing::ValuesIn(libvpx_test::kVP9TestVectors, // ::testing::Values(1), // Frame Parallel mode.
libvpx_test::kVP9TestVectors + // ::testing::Range(2, 9), // With 2 ~ 8 threads.
libvpx_test::kNumVP9TestVectors)))); // ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
#endif // libvpx_test::kVP9TestVectors +
// libvpx_test::kNumVP9TestVectors))));
//#endif
} // namespace } // namespace

View File

@@ -165,10 +165,7 @@ const char *const kVP9TestVectors[] = {
"vp90-2-11-size-351x287.webm", "vp90-2-11-size-351x288.webm", "vp90-2-11-size-351x287.webm", "vp90-2-11-size-351x288.webm",
"vp90-2-11-size-352x287.webm", "vp90-2-12-droppable_1.ivf", "vp90-2-11-size-352x287.webm", "vp90-2-12-droppable_1.ivf",
"vp90-2-12-droppable_2.ivf", "vp90-2-12-droppable_3.ivf", "vp90-2-12-droppable_2.ivf", "vp90-2-12-droppable_3.ivf",
#if !CONFIG_SIZE_LIMIT || \
(DECODE_WIDTH_LIMIT >= 20400 && DECODE_HEIGHT_LIMIT >= 120)
"vp90-2-13-largescaling.webm", "vp90-2-13-largescaling.webm",
#endif
"vp90-2-14-resize-fp-tiles-1-16.webm", "vp90-2-14-resize-fp-tiles-1-16.webm",
"vp90-2-14-resize-fp-tiles-1-2-4-8-16.webm", "vp90-2-14-resize-fp-tiles-1-2-4-8-16.webm",
"vp90-2-14-resize-fp-tiles-1-2.webm", "vp90-2-14-resize-fp-tiles-1-4.webm", "vp90-2-14-resize-fp-tiles-1-2.webm", "vp90-2-14-resize-fp-tiles-1-4.webm",

View File

@@ -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

View File

@@ -402,15 +402,11 @@ VP9_IVF_FILE="${LIBVPX_TEST_DATA_PATH}/vp90-2-09-subpixel-00.ivf"
VP9_WEBM_FILE="${LIBVPX_TEST_DATA_PATH}/vp90-2-00-quantizer-00.webm" VP9_WEBM_FILE="${LIBVPX_TEST_DATA_PATH}/vp90-2-00-quantizer-00.webm"
VP9_FPM_WEBM_FILE="${LIBVPX_TEST_DATA_PATH}/vp90-2-07-frame_parallel-1.webm" VP9_FPM_WEBM_FILE="${LIBVPX_TEST_DATA_PATH}/vp90-2-07-frame_parallel-1.webm"
VP9_LT_50_FRAMES_WEBM_FILE="${LIBVPX_TEST_DATA_PATH}/vp90-2-02-size-32x08.webm"
YUV_RAW_INPUT="${LIBVPX_TEST_DATA_PATH}/hantro_collage_w352h288.yuv" YUV_RAW_INPUT="${LIBVPX_TEST_DATA_PATH}/hantro_collage_w352h288.yuv"
YUV_RAW_INPUT_WIDTH=352 YUV_RAW_INPUT_WIDTH=352
YUV_RAW_INPUT_HEIGHT=288 YUV_RAW_INPUT_HEIGHT=288
Y4M_NOSQ_PAR_INPUT="${LIBVPX_TEST_DATA_PATH}/park_joy_90p_8_420_a10-1.y4m"
Y4M_720P_INPUT="${LIBVPX_TEST_DATA_PATH}/niklas_1280_720_30.y4m"
# Setup a trap function to clean up after tests complete. # Setup a trap function to clean up after tests complete.
trap cleanup EXIT trap cleanup EXIT
@@ -432,7 +428,6 @@ vlog "$(basename "${0%.*}") test configuration:
VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT} VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT}
YUV_RAW_INPUT=${YUV_RAW_INPUT} YUV_RAW_INPUT=${YUV_RAW_INPUT}
YUV_RAW_INPUT_WIDTH=${YUV_RAW_INPUT_WIDTH} YUV_RAW_INPUT_WIDTH=${YUV_RAW_INPUT_WIDTH}
YUV_RAW_INPUT_HEIGHT=${YUV_RAW_INPUT_HEIGHT} YUV_RAW_INPUT_HEIGHT=${YUV_RAW_INPUT_HEIGHT}"
Y4M_NOSQ_PAR_INPUT=${Y4M_NOSQ_PAR_INPUT}"
fi # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard. fi # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard.

View File

@@ -30,7 +30,7 @@ namespace {
using std::string; using std::string;
using libvpx_test::ACMRandom; using libvpx_test::ACMRandom;
#if CONFIG_WEBM_IO #if CONFIG_WEBM_IO && 0
void CheckUserPrivateData(void *user_priv, int *target) { void CheckUserPrivateData(void *user_priv, int *target) {
// actual pointer value should be the same as expected. // actual pointer value should be the same as expected.

View File

@@ -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

View File

@@ -48,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");
} }

View File

@@ -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;

View File

@@ -52,13 +52,13 @@ TEST_P(VP8DenoiserTest, BitexactCheck) {
// mc_avg_block is the denoised reference block, // mc_avg_block is the denoised reference block,
// avg_block_c is the denoised result from C code, // avg_block_c is the denoised result from C code,
// avg_block_sse2 is the denoised result from SSE2 code. // avg_block_sse2 is the denoised result from SSE2 code.
DECLARE_ALIGNED(16, uint8_t, sig_block_c[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, sig_block_c, kNumPixels);
// Since in VP8 denoiser, the source signal will be changed, // Since in VP8 denoiser, the source signal will be changed,
// we need another copy of the source signal as the input of sse2 code. // we need another copy of the source signal as the input of sse2 code.
DECLARE_ALIGNED(16, uint8_t, sig_block_sse2[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, sig_block_sse2, kNumPixels);
DECLARE_ALIGNED(16, uint8_t, mc_avg_block[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, mc_avg_block, kNumPixels);
DECLARE_ALIGNED(16, uint8_t, avg_block_c[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, avg_block_c, kNumPixels);
DECLARE_ALIGNED(16, uint8_t, avg_block_sse2[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, avg_block_sse2, kNumPixels);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
// Generate random motion magnitude, 20% of which exceed the threshold. // Generate random motion magnitude, 20% of which exceed the threshold.

View File

@@ -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 {

View File

@@ -1,238 +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 "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/util.h"
#include "test/y4m_video_source.h"
#include "test/yuv_video_source.h"
#include "vp9/encoder/vp9_ratectrl.h"
namespace {
const unsigned int kFrames = 100;
const int kBitrate = 500;
#define ARF_NOT_SEEN 1000001
#define ARF_SEEN_ONCE 1000000
typedef struct {
const char *filename;
unsigned int width;
unsigned int height;
unsigned int framerate_num;
unsigned int framerate_den;
unsigned int input_bit_depth;
vpx_img_fmt fmt;
vpx_bit_depth_t bit_depth;
unsigned int profile;
} TestVideoParam;
typedef struct {
libvpx_test::TestMode mode;
int cpu_used;
} TestEncodeParam;
const TestVideoParam kTestVectors[] = {
// artificially increase framerate to trigger default check
{"hantro_collage_w352h288.yuv", 352, 288, 5000, 1,
8, VPX_IMG_FMT_I420, VPX_BITS_8, 0},
{"hantro_collage_w352h288.yuv", 352, 288, 30, 1,
8, VPX_IMG_FMT_I420, VPX_BITS_8, 0},
{"rush_hour_444.y4m", 352, 288, 30, 1,
8, VPX_IMG_FMT_I444, VPX_BITS_8, 1},
#if CONFIG_VP9_HIGHBITDEPTH
// Add list of profile 2/3 test videos here ...
#endif // CONFIG_VP9_HIGHBITDEPTH
};
const TestEncodeParam kEncodeVectors[] = {
{::libvpx_test::kOnePassGood, 2},
{::libvpx_test::kOnePassGood, 5},
{::libvpx_test::kTwoPassGood, 1},
{::libvpx_test::kTwoPassGood, 2},
{::libvpx_test::kTwoPassGood, 5},
{::libvpx_test::kRealTime, 5},
};
const int kMinArfVectors[] = {
// NOTE: 0 refers to the default built-in logic in:
// vp9_rc_get_default_min_gf_interval(...)
0, 4, 8, 12, 15
};
int is_extension_y4m(const char *filename) {
const char *dot = strrchr(filename, '.');
if (!dot || dot == filename)
return 0;
else
return !strcmp(dot, ".y4m");
}
class ArfFreqTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith3Params<TestVideoParam, \
TestEncodeParam, int> {
protected:
ArfFreqTest()
: EncoderTest(GET_PARAM(0)),
test_video_param_(GET_PARAM(1)),
test_encode_param_(GET_PARAM(2)),
min_arf_requested_(GET_PARAM(3)) {
}
virtual ~ArfFreqTest() {}
virtual void SetUp() {
InitializeConfig();
SetMode(test_encode_param_.mode);
if (test_encode_param_.mode != ::libvpx_test::kRealTime) {
cfg_.g_lag_in_frames = 25;
cfg_.rc_end_usage = VPX_VBR;
} else {
cfg_.g_lag_in_frames = 0;
cfg_.rc_end_usage = VPX_CBR;
cfg_.rc_buf_sz = 1000;
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 600;
}
dec_cfg_.threads = 4;
}
virtual void BeginPassHook(unsigned int) {
min_run_ = ARF_NOT_SEEN;
run_of_visible_frames_ = 0;
}
int GetNumFramesInPkt(const vpx_codec_cx_pkt_t *pkt) {
const uint8_t *buffer = reinterpret_cast<uint8_t*>(pkt->data.frame.buf);
const uint8_t marker = buffer[pkt->data.frame.sz - 1];
const int mag = ((marker >> 3) & 3) + 1;
int frames = (marker & 0x7) + 1;
const unsigned int index_sz = 2 + mag * frames;
// Check for superframe or not.
// Assume superframe has only one visible frame, the rest being
// invisible. If superframe index is not found, then there is only
// one frame.
if (!((marker & 0xe0) == 0xc0 &&
pkt->data.frame.sz >= index_sz &&
buffer[pkt->data.frame.sz - index_sz] == marker)) {
frames = 1;
}
return frames;
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
return;
const int frames = GetNumFramesInPkt(pkt);
if (frames == 1) {
run_of_visible_frames_++;
} else if (frames == 2) {
if (min_run_ == ARF_NOT_SEEN) {
min_run_ = ARF_SEEN_ONCE;
} else if (min_run_ == ARF_SEEN_ONCE ||
run_of_visible_frames_ < min_run_) {
min_run_ = run_of_visible_frames_;
}
run_of_visible_frames_ = 1;
} else {
min_run_ = 0;
run_of_visible_frames_ = 1;
}
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
if (video->frame() == 0) {
encoder->Control(VP9E_SET_FRAME_PARALLEL_DECODING, 1);
encoder->Control(VP9E_SET_TILE_COLUMNS, 4);
encoder->Control(VP8E_SET_CPUUSED, test_encode_param_.cpu_used);
encoder->Control(VP9E_SET_MIN_GF_INTERVAL, min_arf_requested_);
if (test_encode_param_.mode != ::libvpx_test::kRealTime) {
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
encoder->Control(VP8E_SET_ARNR_TYPE, 3);
}
}
}
int GetMinVisibleRun() const {
return min_run_;
}
int GetMinArfDistanceRequested() const {
if (min_arf_requested_)
return min_arf_requested_;
else
return vp9_rc_get_default_min_gf_interval(
test_video_param_.width, test_video_param_.height,
(double)test_video_param_.framerate_num /
test_video_param_.framerate_den);
}
TestVideoParam test_video_param_;
TestEncodeParam test_encode_param_;
private:
int min_arf_requested_;
int min_run_;
int run_of_visible_frames_;
};
TEST_P(ArfFreqTest, MinArfFreqTest) {
cfg_.rc_target_bitrate = kBitrate;
cfg_.g_error_resilient = 0;
cfg_.g_profile = test_video_param_.profile;
cfg_.g_input_bit_depth = test_video_param_.input_bit_depth;
cfg_.g_bit_depth = test_video_param_.bit_depth;
init_flags_ = VPX_CODEC_USE_PSNR;
if (cfg_.g_bit_depth > 8)
init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
libvpx_test::VideoSource *video;
if (is_extension_y4m(test_video_param_.filename)) {
video = new libvpx_test::Y4mVideoSource(test_video_param_.filename,
0, kFrames);
} else {
video = new libvpx_test::YUVVideoSource(test_video_param_.filename,
test_video_param_.fmt,
test_video_param_.width,
test_video_param_.height,
test_video_param_.framerate_num,
test_video_param_.framerate_den,
0, kFrames);
}
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
const int min_run = GetMinVisibleRun();
const int min_arf_dist_requested = GetMinArfDistanceRequested();
if (min_run != ARF_NOT_SEEN && min_run != ARF_SEEN_ONCE) {
const int min_arf_dist = min_run + 1;
EXPECT_GE(min_arf_dist, min_arf_dist_requested);
}
delete(video);
}
VP9_INSTANTIATE_TEST_CASE(
ArfFreqTest,
::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors));
VP10_INSTANTIATE_TEST_CASE(
ArfFreqTest,
::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors));
} // namespace

View File

@@ -8,22 +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"
#if CONFIG_VP9_ENCODER #if CONFIG_VP9_ENCODER
#include "./vp9_rtcd.h" #include "./vp9_rtcd.h"
#endif #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;
@@ -121,79 +121,6 @@ class AverageTest
} }
}; };
typedef void (*IntProRowFunc)(int16_t hbuf[16], uint8_t const *ref,
const int ref_stride, const int height);
typedef std::tr1::tuple<int, IntProRowFunc, IntProRowFunc> IntProRowParam;
class IntProRowTest
: public AverageTestBase,
public ::testing::WithParamInterface<IntProRowParam> {
public:
IntProRowTest()
: AverageTestBase(16, GET_PARAM(0)),
hbuf_asm_(NULL),
hbuf_c_(NULL) {
asm_func_ = GET_PARAM(1);
c_func_ = GET_PARAM(2);
}
protected:
virtual void SetUp() {
hbuf_asm_ = reinterpret_cast<int16_t*>(
vpx_memalign(kDataAlignment, sizeof(*hbuf_asm_) * 16));
hbuf_c_ = reinterpret_cast<int16_t*>(
vpx_memalign(kDataAlignment, sizeof(*hbuf_c_) * 16));
}
virtual void TearDown() {
vpx_free(hbuf_c_);
hbuf_c_ = NULL;
vpx_free(hbuf_asm_);
hbuf_asm_ = NULL;
}
void RunComparison() {
ASM_REGISTER_STATE_CHECK(c_func_(hbuf_c_, source_data_, 0, height_));
ASM_REGISTER_STATE_CHECK(asm_func_(hbuf_asm_, source_data_, 0, height_));
EXPECT_EQ(0, memcmp(hbuf_c_, hbuf_asm_, sizeof(*hbuf_c_) * 16))
<< "Output mismatch";
}
private:
IntProRowFunc asm_func_;
IntProRowFunc c_func_;
int16_t *hbuf_asm_;
int16_t *hbuf_c_;
};
typedef int16_t (*IntProColFunc)(uint8_t const *ref, const int width);
typedef std::tr1::tuple<int, IntProColFunc, IntProColFunc> IntProColParam;
class IntProColTest
: public AverageTestBase,
public ::testing::WithParamInterface<IntProColParam> {
public:
IntProColTest() : AverageTestBase(GET_PARAM(0), 1), sum_asm_(0), sum_c_(0) {
asm_func_ = GET_PARAM(1);
c_func_ = GET_PARAM(2);
}
protected:
void RunComparison() {
ASM_REGISTER_STATE_CHECK(sum_c_ = c_func_(source_data_, width_));
ASM_REGISTER_STATE_CHECK(sum_asm_ = asm_func_(source_data_, width_));
EXPECT_EQ(sum_c_, sum_asm_) << "Output mismatch";
}
private:
IntProColFunc asm_func_;
IntProColFunc c_func_;
int16_t sum_asm_;
int16_t sum_c_;
};
uint8_t* AverageTestBase::source_data_ = NULL; uint8_t* AverageTestBase::source_data_ = NULL;
@@ -216,36 +143,6 @@ TEST_P(AverageTest, Random) {
} }
} }
TEST_P(IntProRowTest, MinValue) {
FillConstant(0);
RunComparison();
}
TEST_P(IntProRowTest, MaxValue) {
FillConstant(255);
RunComparison();
}
TEST_P(IntProRowTest, Random) {
FillRandom();
RunComparison();
}
TEST_P(IntProColTest, MinValue) {
FillConstant(0);
RunComparison();
}
TEST_P(IntProColTest, MaxValue) {
FillConstant(255);
RunComparison();
}
TEST_P(IntProColTest, Random) {
FillRandom();
RunComparison();
}
using std::tr1::make_tuple; using std::tr1::make_tuple;
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
@@ -254,6 +151,7 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(16, 16, 1, 8, &vp9_avg_8x8_c), make_tuple(16, 16, 1, 8, &vp9_avg_8x8_c),
make_tuple(16, 16, 1, 4, &vp9_avg_4x4_c))); make_tuple(16, 16, 1, 4, &vp9_avg_4x4_c)));
#if HAVE_SSE2 #if HAVE_SSE2
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
SSE2, AverageTest, SSE2, AverageTest,
@@ -265,17 +163,6 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(16, 16, 5, 4, &vp9_avg_4x4_sse2), make_tuple(16, 16, 5, 4, &vp9_avg_4x4_sse2),
make_tuple(32, 32, 15, 4, &vp9_avg_4x4_sse2))); make_tuple(32, 32, 15, 4, &vp9_avg_4x4_sse2)));
INSTANTIATE_TEST_CASE_P(
SSE2, IntProRowTest, ::testing::Values(
make_tuple(16, &vp9_int_pro_row_sse2, &vp9_int_pro_row_c),
make_tuple(32, &vp9_int_pro_row_sse2, &vp9_int_pro_row_c),
make_tuple(64, &vp9_int_pro_row_sse2, &vp9_int_pro_row_c)));
INSTANTIATE_TEST_CASE_P(
SSE2, IntProColTest, ::testing::Values(
make_tuple(16, &vp9_int_pro_col_sse2, &vp9_int_pro_col_c),
make_tuple(32, &vp9_int_pro_col_sse2, &vp9_int_pro_col_c),
make_tuple(64, &vp9_int_pro_col_sse2, &vp9_int_pro_col_c)));
#endif #endif
#if HAVE_NEON #if HAVE_NEON
@@ -286,29 +173,6 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(16, 16, 5, 8, &vp9_avg_8x8_neon), make_tuple(16, 16, 5, 8, &vp9_avg_8x8_neon),
make_tuple(32, 32, 15, 8, &vp9_avg_8x8_neon))); make_tuple(32, 32, 15, 8, &vp9_avg_8x8_neon)));
INSTANTIATE_TEST_CASE_P(
NEON, IntProRowTest, ::testing::Values(
make_tuple(16, &vp9_int_pro_row_neon, &vp9_int_pro_row_c),
make_tuple(32, &vp9_int_pro_row_neon, &vp9_int_pro_row_c),
make_tuple(64, &vp9_int_pro_row_neon, &vp9_int_pro_row_c)));
INSTANTIATE_TEST_CASE_P(
NEON, IntProColTest, ::testing::Values(
make_tuple(16, &vp9_int_pro_col_neon, &vp9_int_pro_col_c),
make_tuple(32, &vp9_int_pro_col_neon, &vp9_int_pro_col_c),
make_tuple(64, &vp9_int_pro_col_neon, &vp9_int_pro_col_c)));
#endif
#if HAVE_MSA
INSTANTIATE_TEST_CASE_P(
MSA, AverageTest,
::testing::Values(
make_tuple(16, 16, 0, 8, &vp9_avg_8x8_msa),
make_tuple(16, 16, 5, 8, &vp9_avg_8x8_msa),
make_tuple(32, 32, 15, 8, &vp9_avg_8x8_msa),
make_tuple(16, 16, 0, 4, &vp9_avg_4x4_msa),
make_tuple(16, 16, 5, 4, &vp9_avg_4x4_msa),
make_tuple(32, 32, 15, 4, &vp9_avg_4x4_msa)));
#endif #endif
} // namespace } // namespace

View File

@@ -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;

View File

@@ -43,29 +43,29 @@ void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
namespace libvpx_test { namespace libvpx_test {
TEST(TestDecrypt, DecryptWorksVp9) { //TEST(TestDecrypt, DecryptWorksVp9) {
libvpx_test::IVFVideoSource video("vp90-2-05-resize.ivf"); // libvpx_test::IVFVideoSource video("vp90-2-05-resize.ivf");
video.Init(); // video.Init();
//
vpx_codec_dec_cfg_t dec_cfg = vpx_codec_dec_cfg_t(); // vpx_codec_dec_cfg_t dec_cfg = vpx_codec_dec_cfg_t();
VP9Decoder decoder(dec_cfg, 0); // VP9Decoder decoder(dec_cfg, 0);
//
video.Begin(); // video.Begin();
//
// no decryption // // no decryption
vpx_codec_err_t res = decoder.DecodeFrame(video.cxdata(), video.frame_size()); // vpx_codec_err_t res = decoder.DecodeFrame(video.cxdata(), video.frame_size());
ASSERT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError(); // ASSERT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError();
//
// decrypt frame // // decrypt frame
video.Next(); // video.Next();
//
std::vector<uint8_t> encrypted(video.frame_size()); // std::vector<uint8_t> encrypted(video.frame_size());
encrypt_buffer(video.cxdata(), &encrypted[0], video.frame_size(), 0); // encrypt_buffer(video.cxdata(), &encrypted[0], video.frame_size(), 0);
vpx_decrypt_init di = { test_decrypt_cb, &encrypted[0] }; // vpx_decrypt_init di = { test_decrypt_cb, &encrypted[0] };
decoder.Control(VPXD_SET_DECRYPTOR, &di); // decoder.Control(VPXD_SET_DECRYPTOR, &di);
//
res = decoder.DecodeFrame(&encrypted[0], encrypted.size()); // res = decoder.DecodeFrame(&encrypted[0], encrypted.size());
ASSERT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError(); // ASSERT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError();
} //}
} // namespace libvpx_test } // namespace libvpx_test

View File

@@ -52,10 +52,10 @@ TEST_P(VP9DenoiserTest, BitexactCheck) {
// mc_avg_block is the denoised reference block, // mc_avg_block is the denoised reference block,
// avg_block_c is the denoised result from C code, // avg_block_c is the denoised result from C code,
// avg_block_sse2 is the denoised result from SSE2 code. // avg_block_sse2 is the denoised result from SSE2 code.
DECLARE_ALIGNED(16, uint8_t, sig_block[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, sig_block, kNumPixels);
DECLARE_ALIGNED(16, uint8_t, mc_avg_block[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, mc_avg_block, kNumPixels);
DECLARE_ALIGNED(16, uint8_t, avg_block_c[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, avg_block_c, kNumPixels);
DECLARE_ALIGNED(16, uint8_t, avg_block_sse2[kNumPixels]); DECLARE_ALIGNED_ARRAY(16, uint8_t, avg_block_sse2, kNumPixels);
for (int i = 0; i < count_test_block; ++i) { for (int i = 0; i < count_test_block; ++i) {
// Generate random motion magnitude, 20% of which exceed the threshold. // Generate random motion magnitude, 20% of which exceed the threshold.

View File

@@ -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/decoder/vp9_decoder.h" #include "vp9/decoder/vp9_decoder.h"
typedef vpx_codec_stream_info_t vp9_stream_info_t; typedef vpx_codec_stream_info_t vp9_stream_info_t;
@@ -86,17 +85,17 @@ int is_extension_y4m(const char *filename) {
return !strcmp(dot, ".y4m"); return !strcmp(dot, ".y4m");
} }
class VpxEncoderParmsGetToDecoder 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)), : EncoderTest(GET_PARAM(0)),
encode_parms(GET_PARAM(1)) { encode_parms(GET_PARAM(1)) {
} }
virtual ~VpxEncoderParmsGetToDecoder() {} virtual ~Vp9EncoderParmsGetToDecoder() {}
virtual void SetUp() { virtual void SetUp() {
InitializeConfig(); InitializeConfig();
@@ -166,7 +165,7 @@ class VpxEncoderParmsGetToDecoder
// TODO(hkuang): This test conflicts with frame parallel decode. So disable it // TODO(hkuang): This test conflicts with frame parallel decode. So disable it
// for now until fix. // for now until fix.
TEST_P(VpxEncoderParmsGetToDecoder, DISABLED_BitstreamParms) { TEST_P(Vp9EncoderParmsGetToDecoder, DISABLED_BitstreamParms) {
init_flags_ = VPX_CODEC_USE_PSNR; init_flags_ = VPX_CODEC_USE_PSNR;
libvpx_test::VideoSource *video; libvpx_test::VideoSource *video;
@@ -187,12 +186,8 @@ TEST_P(VpxEncoderParmsGetToDecoder, DISABLED_BitstreamParms) {
} }
VP9_INSTANTIATE_TEST_CASE( VP9_INSTANTIATE_TEST_CASE(
VpxEncoderParmsGetToDecoder, Vp9EncoderParmsGetToDecoder,
::testing::ValuesIn(kVP9EncodeParameterSet), ::testing::ValuesIn(kVP9EncodeParameterSet),
::testing::ValuesIn(kVP9EncodePerfTestVectors)); ::testing::ValuesIn(kVP9EncodePerfTestVectors));
VP10_INSTANTIATE_TEST_CASE(
VpxEncoderParmsGetToDecoder,
::testing::ValuesIn(kVP9EncodeParameterSet),
::testing::ValuesIn(kVP9EncodePerfTestVectors));
} // namespace } // namespace

View File

@@ -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,9 +186,4 @@ VP9_INSTANTIATE_TEST_CASE(
::testing::ValuesIn(kTestVectors), ::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kCpuUsedVectors)); ::testing::ValuesIn(kCpuUsedVectors));
VP10_INSTANTIATE_TEST_CASE(
EndToEndTestLarge,
::testing::ValuesIn(kEncodingModeVectors),
::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kCpuUsedVectors));
} // namespace } // namespace

View File

@@ -14,14 +14,13 @@
#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_integer.h" #include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom; using libvpx_test::ACMRandom;
@@ -58,8 +57,8 @@ class ErrorBlockTest
TEST_P(ErrorBlockTest, OperationCheck) { TEST_P(ErrorBlockTest, OperationCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
DECLARE_ALIGNED(16, tran_low_t, coeff[4096]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, 4096);
DECLARE_ALIGNED(16, tran_low_t, dqcoeff[4096]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff, 4096);
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
intptr_t block_size; intptr_t block_size;
@@ -91,8 +90,8 @@ TEST_P(ErrorBlockTest, OperationCheck) {
TEST_P(ErrorBlockTest, ExtremeValues) { TEST_P(ErrorBlockTest, ExtremeValues) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
DECLARE_ALIGNED(16, tran_low_t, coeff[4096]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, 4096);
DECLARE_ALIGNED(16, tran_low_t, dqcoeff[4096]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff, 4096);
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
intptr_t block_size; intptr_t block_size;

View File

@@ -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

View File

@@ -27,9 +27,9 @@ namespace {
using std::string; using std::string;
#if CONFIG_WEBM_IO #if CONFIG_WEBM_IO && 0
struct PauseFileList { struct FileList {
const char *name; const char *name;
// md5 sum for decoded frames which does not include skipped frames. // md5 sum for decoded frames which does not include skipped frames.
const char *expected_md5; const char *expected_md5;
@@ -39,8 +39,7 @@ struct PauseFileList {
// Decodes |filename| with |num_threads|. Pause at the specified frame_num, // Decodes |filename| with |num_threads|. Pause at the specified frame_num,
// seek to next key frame and then continue decoding until the end. Return // seek to next key frame and then continue decoding until the end. Return
// the md5 of the decoded frames which does not include skipped frames. // the md5 of the decoded frames which does not include skipped frames.
string DecodeFileWithPause(const string &filename, int num_threads, string DecodeFile(const string &filename, int num_threads, int pause_num) {
int pause_num) {
libvpx_test::WebMVideoSource video(filename); libvpx_test::WebMVideoSource video(filename);
video.Init(); video.Init();
int in_frames = 0; int in_frames = 0;
@@ -93,12 +92,12 @@ string DecodeFileWithPause(const string &filename, int num_threads,
return string(md5.Get()); return string(md5.Get());
} }
void DecodeFilesWithPause(const PauseFileList files[]) { void DecodeFiles(const FileList files[]) {
for (const PauseFileList *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 = 2; t <= 8; ++t) { for (int t = 2; t <= 8; ++t) {
EXPECT_EQ(iter->expected_md5, EXPECT_EQ(iter->expected_md5,
DecodeFileWithPause(iter->name, t, iter->pause_frame_num)) DecodeFile(iter->name, t, iter->pause_frame_num))
<< "threads = " << t; << "threads = " << t;
} }
} }
@@ -107,19 +106,19 @@ void DecodeFilesWithPause(const PauseFileList files[]) {
TEST(VP9MultiThreadedFrameParallel, PauseSeekResume) { TEST(VP9MultiThreadedFrameParallel, PauseSeekResume) {
// vp90-2-07-frame_parallel-1.webm is a 40 frame video file with // vp90-2-07-frame_parallel-1.webm is a 40 frame video file with
// one key frame for every ten frames. // one key frame for every ten frames.
static const PauseFileList files[] = { static const FileList files[] = {
{ "vp90-2-07-frame_parallel-1.webm", { "vp90-2-07-frame_parallel-1.webm",
"6ea7c3875d67252e7caf2bc6e75b36b1", 6 }, "6ea7c3875d67252e7caf2bc6e75b36b1", 6},
{ "vp90-2-07-frame_parallel-1.webm", { "vp90-2-07-frame_parallel-1.webm",
"4bb634160c7356a8d7d4299b6dc83a45", 12 }, "4bb634160c7356a8d7d4299b6dc83a45", 12},
{ "vp90-2-07-frame_parallel-1.webm", { "vp90-2-07-frame_parallel-1.webm",
"89772591e6ef461f9fa754f916c78ed8", 26 }, "89772591e6ef461f9fa754f916c78ed8", 26},
{ NULL, NULL, 0 }, { NULL, NULL, 0},
}; };
DecodeFilesWithPause(files); DecodeFiles(files);
} }
struct FileList { struct InvalidFileList {
const char *name; const char *name;
// md5 sum for decoded frames which does not include corrupted frames. // md5 sum for decoded frames which does not include corrupted frames.
const char *expected_md5; const char *expected_md5;
@@ -129,8 +128,8 @@ struct FileList {
// Decodes |filename| with |num_threads|. Return the md5 of the decoded // Decodes |filename| with |num_threads|. Return the md5 of the decoded
// frames which does not include corrupted frames. // frames which does not include corrupted frames.
string DecodeFile(const string &filename, int num_threads, string DecodeInvalidFile(const string &filename, int num_threads,
int expected_frame_count) { int expected_frame_count) {
libvpx_test::WebMVideoSource video(filename); libvpx_test::WebMVideoSource video(filename);
video.Init(); video.Init();
@@ -174,47 +173,37 @@ string DecodeFile(const string &filename, int num_threads,
return string(md5.Get()); return string(md5.Get());
} }
void DecodeFiles(const FileList files[]) { void DecodeInvalidFiles(const InvalidFileList files[]) {
for (const FileList *iter = files; iter->name != NULL; ++iter) { for (const InvalidFileList *iter = files; iter->name != NULL; ++iter) {
SCOPED_TRACE(iter->name); SCOPED_TRACE(iter->name);
for (int t = 2; t <= 8; ++t) { for (int t = 2; t <= 8; ++t) {
EXPECT_EQ(iter->expected_md5, EXPECT_EQ(iter->expected_md5,
DecodeFile(iter->name, t, iter->expected_frame_count)) DecodeInvalidFile(iter->name, t, iter->expected_frame_count))
<< "threads = " << t; << "threads = " << t;
} }
} }
} }
TEST(VP9MultiThreadedFrameParallel, InvalidFileTest) { TEST(VP9MultiThreadedFrameParallel, InvalidFileTest) {
static const FileList files[] = { static const InvalidFileList files[] = {
// invalid-vp90-2-07-frame_parallel-1.webm is a 40 frame video file with // invalid-vp90-2-07-frame_parallel-1.webm is a 40 frame video file with
// one key frame for every ten frames. The 11th frame has corrupted data. // one key frame for every ten frames. The 11th frame has corrupted data.
{ "invalid-vp90-2-07-frame_parallel-1.webm", { "invalid-vp90-2-07-frame_parallel-1.webm",
"0549d0f45f60deaef8eb708e6c0eb6cb", 30 }, "0549d0f45f60deaef8eb708e6c0eb6cb", 30},
// invalid-vp90-2-07-frame_parallel-2.webm is a 40 frame video file with // invalid-vp90-2-07-frame_parallel-2.webm is a 40 frame video file with
// one key frame for every ten frames. The 1st and 31st frames have // one key frame for every ten frames. The 1st and 31st frames have
// corrupted data. // corrupted data.
{ "invalid-vp90-2-07-frame_parallel-2.webm", { "invalid-vp90-2-07-frame_parallel-2.webm",
"6a1f3cf6f9e7a364212fadb9580d525e", 20 }, "6a1f3cf6f9e7a364212fadb9580d525e", 20},
// invalid-vp90-2-07-frame_parallel-3.webm is a 40 frame video file with // invalid-vp90-2-07-frame_parallel-3.webm is a 40 frame video file with
// one key frame for every ten frames. The 5th and 13th frames have // one key frame for every ten frames. The 5th and 13th frames have
// corrupted data. // corrupted data.
{ "invalid-vp90-2-07-frame_parallel-3.webm", { "invalid-vp90-2-07-frame_parallel-3.webm",
"8256544308de926b0681e04685b98677", 27 }, "8256544308de926b0681e04685b98677", 27},
{ NULL, NULL, 0 }, { NULL, NULL, 0},
}; };
DecodeFiles(files); DecodeInvalidFiles(files);
} }
TEST(VP9MultiThreadedFrameParallel, ValidFileTest) {
static const FileList files[] = {
#if CONFIG_VP9_HIGHBITDEPTH
{ "vp92-2-20-10bit-yuv420.webm",
"a16b99df180c584e8db2ffeda987d293", 10 },
#endif
{ NULL, NULL, 0 },
};
DecodeFiles(files);
}
#endif // CONFIG_WEBM_IO #endif // CONFIG_WEBM_IO
} // namespace } // namespace

View File

@@ -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 {
@@ -120,10 +120,10 @@ class VP9IntraPredTest
TEST_P(VP9IntraPredTest, IntraPredTests) { TEST_P(VP9IntraPredTest, IntraPredTests) {
// max block size is 32 // max block size is 32
DECLARE_ALIGNED(16, uint16_t, left_col[2*32]); DECLARE_ALIGNED_ARRAY(16, uint16_t, left_col, 2*32);
DECLARE_ALIGNED(16, uint16_t, above_data[2*32+32]); DECLARE_ALIGNED_ARRAY(16, uint16_t, above_data, 2*32+32);
DECLARE_ALIGNED(16, uint16_t, dst[3 * 32 * 32]); DECLARE_ALIGNED_ARRAY(16, uint16_t, dst, 3 * 32 * 32);
DECLARE_ALIGNED(16, uint16_t, ref_dst[3 * 32 * 32]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_dst, 3 * 32 * 32);
RunTest(left_col, above_data, dst, ref_dst); RunTest(left_col, above_data, dst, ref_dst);
} }
@@ -131,171 +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 #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_sse, 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_sse, 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_sse, 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 #else
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_4x4_sse, 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_sse, 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_sse, 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)));
#endif // !ARCH_X86_64 #endif
#if ARCH_X86_64 #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_sse, 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_sse, 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_sse, 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 #else
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_4x4_sse, 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_sse, 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, 10), &vp9_highbd_v_predictor_16x16_c, 16, 10),
make_tuple(&vpx_highbd_v_predictor_32x32_sse2, make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
&vpx_highbd_v_predictor_32x32_c, 32, 10), &vp9_highbd_v_predictor_32x32_c, 32, 10),
make_tuple(&vpx_highbd_tm_predictor_4x4_sse, 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)));
#endif // !ARCH_X86_64 #endif
#if ARCH_X86_64 #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_sse, 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_sse, 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_sse, 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 #else
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_4x4_sse, 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_sse, 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, 12), &vp9_highbd_v_predictor_16x16_c, 16, 12),
make_tuple(&vpx_highbd_v_predictor_32x32_sse2, make_tuple(&vp9_highbd_v_predictor_32x32_sse2,
&vpx_highbd_v_predictor_32x32_c, 32, 12), &vp9_highbd_v_predictor_32x32_c, 32, 12),
make_tuple(&vpx_highbd_tm_predictor_4x4_sse, 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)));
#endif // !ARCH_X86_64 #endif
#endif // CONFIG_USE_X86INC
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_SSE2 #endif // HAVE_SSE2
} // namespace } // namespace

View File

@@ -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

View File

@@ -14,15 +14,13 @@
#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 "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h" #include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom; using libvpx_test::ACMRandom;
@@ -82,18 +80,18 @@ class VP9Quantize32Test : public ::testing::TestWithParam<QuantizeParam> {
TEST_P(VP9QuantizeTest, OperationCheck) { TEST_P(VP9QuantizeTest, OperationCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
DECLARE_ALIGNED(16, tran_low_t, coeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_ptr, 256);
DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, zbin_ptr, 2);
DECLARE_ALIGNED(16, int16_t, round_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, round_ptr, 2);
DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, quant_ptr, 2);
DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, quant_shift_ptr, 2);
DECLARE_ALIGNED(16, tran_low_t, qcoeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, qcoeff_ptr, 256);
DECLARE_ALIGNED(16, tran_low_t, dqcoeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff_ptr, 256);
DECLARE_ALIGNED(16, tran_low_t, ref_qcoeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_qcoeff_ptr, 256);
DECLARE_ALIGNED(16, tran_low_t, ref_dqcoeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_dqcoeff_ptr, 256);
DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, dequant_ptr, 2);
DECLARE_ALIGNED(16, uint16_t, eob_ptr[1]); DECLARE_ALIGNED_ARRAY(16, uint16_t, eob_ptr, 1);
DECLARE_ALIGNED(16, uint16_t, ref_eob_ptr[1]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_eob_ptr, 1);
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
for (int i = 0; i < number_of_iterations; ++i) { for (int i = 0; i < number_of_iterations; ++i) {
@@ -141,18 +139,18 @@ TEST_P(VP9QuantizeTest, OperationCheck) {
TEST_P(VP9Quantize32Test, OperationCheck) { TEST_P(VP9Quantize32Test, OperationCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
DECLARE_ALIGNED(16, tran_low_t, coeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_ptr, 1024);
DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, zbin_ptr, 2);
DECLARE_ALIGNED(16, int16_t, round_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, round_ptr, 2);
DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, quant_ptr, 2);
DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, quant_shift_ptr, 2);
DECLARE_ALIGNED(16, tran_low_t, qcoeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, qcoeff_ptr, 1024);
DECLARE_ALIGNED(16, tran_low_t, dqcoeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff_ptr, 1024);
DECLARE_ALIGNED(16, tran_low_t, ref_qcoeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_qcoeff_ptr, 1024);
DECLARE_ALIGNED(16, tran_low_t, ref_dqcoeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_dqcoeff_ptr, 1024);
DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, dequant_ptr, 2);
DECLARE_ALIGNED(16, uint16_t, eob_ptr[1]); DECLARE_ALIGNED_ARRAY(16, uint16_t, eob_ptr, 1);
DECLARE_ALIGNED(16, uint16_t, ref_eob_ptr[1]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_eob_ptr, 1);
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
for (int i = 0; i < number_of_iterations; ++i) { for (int i = 0; i < number_of_iterations; ++i) {
@@ -200,18 +198,18 @@ TEST_P(VP9Quantize32Test, OperationCheck) {
TEST_P(VP9QuantizeTest, EOBCheck) { TEST_P(VP9QuantizeTest, EOBCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
DECLARE_ALIGNED(16, tran_low_t, coeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_ptr, 256);
DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, zbin_ptr, 2);
DECLARE_ALIGNED(16, int16_t, round_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, round_ptr, 2);
DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, quant_ptr, 2);
DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, quant_shift_ptr, 2);
DECLARE_ALIGNED(16, tran_low_t, qcoeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, qcoeff_ptr, 256);
DECLARE_ALIGNED(16, tran_low_t, dqcoeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff_ptr, 256);
DECLARE_ALIGNED(16, tran_low_t, ref_qcoeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_qcoeff_ptr, 256);
DECLARE_ALIGNED(16, tran_low_t, ref_dqcoeff_ptr[256]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_dqcoeff_ptr, 256);
DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, dequant_ptr, 2);
DECLARE_ALIGNED(16, uint16_t, eob_ptr[1]); DECLARE_ALIGNED_ARRAY(16, uint16_t, eob_ptr, 1);
DECLARE_ALIGNED(16, uint16_t, ref_eob_ptr[1]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_eob_ptr, 1);
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
for (int i = 0; i < number_of_iterations; ++i) { for (int i = 0; i < number_of_iterations; ++i) {
@@ -264,18 +262,18 @@ TEST_P(VP9QuantizeTest, EOBCheck) {
TEST_P(VP9Quantize32Test, EOBCheck) { TEST_P(VP9Quantize32Test, EOBCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
DECLARE_ALIGNED(16, tran_low_t, coeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_ptr, 1024);
DECLARE_ALIGNED(16, int16_t, zbin_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, zbin_ptr, 2);
DECLARE_ALIGNED(16, int16_t, round_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, round_ptr, 2);
DECLARE_ALIGNED(16, int16_t, quant_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, quant_ptr, 2);
DECLARE_ALIGNED(16, int16_t, quant_shift_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, quant_shift_ptr, 2);
DECLARE_ALIGNED(16, tran_low_t, qcoeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, qcoeff_ptr, 1024);
DECLARE_ALIGNED(16, tran_low_t, dqcoeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, dqcoeff_ptr, 1024);
DECLARE_ALIGNED(16, tran_low_t, ref_qcoeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_qcoeff_ptr, 1024);
DECLARE_ALIGNED(16, tran_low_t, ref_dqcoeff_ptr[1024]); DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_dqcoeff_ptr, 1024);
DECLARE_ALIGNED(16, int16_t, dequant_ptr[2]); DECLARE_ALIGNED_ARRAY(16, int16_t, dequant_ptr, 2);
DECLARE_ALIGNED(16, uint16_t, eob_ptr[1]); DECLARE_ALIGNED_ARRAY(16, uint16_t, eob_ptr, 1);
DECLARE_ALIGNED(16, uint16_t, ref_eob_ptr[1]); DECLARE_ALIGNED_ARRAY(16, uint16_t, ref_eob_ptr, 1);
int err_count_total = 0; int err_count_total = 0;
int first_failure = -1; int first_failure = -1;
for (int i = 0; i < number_of_iterations; ++i) { for (int i = 0; i < number_of_iterations; ++i) {
@@ -331,21 +329,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

View File

@@ -1,180 +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 <string>
#include "test/codec_factory.h"
#include "test/decode_test_driver.h"
#include "test/md5_helper.h"
#include "test/util.h"
#include "test/webm_video_source.h"
namespace {
const char kVp9TestFile[] = "vp90-2-08-tile_1x8_frame_parallel.webm";
const char kVp9Md5File[] = "vp90-2-08-tile_1x8_frame_parallel.webm.md5";
// Class for testing shutting off the loop filter.
class SkipLoopFilterTest {
public:
SkipLoopFilterTest()
: video_(NULL),
decoder_(NULL),
md5_file_(NULL) {}
~SkipLoopFilterTest() {
if (md5_file_ != NULL)
fclose(md5_file_);
delete decoder_;
delete video_;
}
// If |threads| > 0 then set the decoder with that number of threads.
void Init(int num_threads) {
expected_md5_[0] = '\0';
junk_[0] = '\0';
video_ = new libvpx_test::WebMVideoSource(kVp9TestFile);
ASSERT_TRUE(video_ != NULL);
video_->Init();
video_->Begin();
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
if (num_threads > 0)
cfg.threads = num_threads;
decoder_ = new libvpx_test::VP9Decoder(cfg, 0);
ASSERT_TRUE(decoder_ != NULL);
OpenMd5File(kVp9Md5File);
}
// Set the VP9 skipLoopFilter control value.
void SetSkipLoopFilter(int value, vpx_codec_err_t expected_value) {
decoder_->Control(VP9_SET_SKIP_LOOP_FILTER, value, expected_value);
}
vpx_codec_err_t DecodeOneFrame() {
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
if (res == VPX_CODEC_OK) {
ReadMd5();
video_->Next();
}
return res;
}
vpx_codec_err_t DecodeRemainingFrames() {
for (; video_->cxdata() != NULL; video_->Next()) {
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
if (res != VPX_CODEC_OK)
return res;
ReadMd5();
}
return VPX_CODEC_OK;
}
// Checks if MD5 matches or doesn't.
void CheckMd5(bool matches) {
libvpx_test::DxDataIterator dec_iter = decoder_->GetDxData();
const vpx_image_t *img = dec_iter.Next();
CheckMd5Vpx(*img, matches);
}
private:
// TODO(fgalligan): Move the MD5 testing code into another class.
void OpenMd5File(const std::string &md5_file_name) {
md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name);
ASSERT_TRUE(md5_file_ != NULL) << "MD5 file open failed. Filename: "
<< md5_file_name;
}
// Reads the next line of the MD5 file.
void ReadMd5() {
ASSERT_TRUE(md5_file_ != NULL);
const int res = fscanf(md5_file_, "%s %s", expected_md5_, junk_);
ASSERT_NE(EOF, res) << "Read md5 data failed";
expected_md5_[32] = '\0';
}
// Checks if the last read MD5 matches |img| or doesn't.
void CheckMd5Vpx(const vpx_image_t &img, bool matches) {
::libvpx_test::MD5 md5_res;
md5_res.Add(&img);
const char *const actual_md5 = md5_res.Get();
// Check MD5.
if (matches)
ASSERT_STREQ(expected_md5_, actual_md5) << "MD5 checksums don't match";
else
ASSERT_STRNE(expected_md5_, actual_md5) << "MD5 checksums match";
}
libvpx_test::WebMVideoSource *video_;
libvpx_test::VP9Decoder *decoder_;
FILE *md5_file_;
char expected_md5_[33];
char junk_[128];
};
TEST(SkipLoopFilterTest, ShutOffLoopFilter) {
const int non_zero_value = 1;
const int num_threads = 0;
SkipLoopFilterTest skip_loop_filter;
skip_loop_filter.Init(num_threads);
skip_loop_filter.SetSkipLoopFilter(non_zero_value, VPX_CODEC_OK);
ASSERT_EQ(VPX_CODEC_OK, skip_loop_filter.DecodeRemainingFrames());
skip_loop_filter.CheckMd5(false);
}
TEST(SkipLoopFilterTest, ShutOffLoopFilterSingleThread) {
const int non_zero_value = 1;
const int num_threads = 1;
SkipLoopFilterTest skip_loop_filter;
skip_loop_filter.Init(num_threads);
skip_loop_filter.SetSkipLoopFilter(non_zero_value, VPX_CODEC_OK);
ASSERT_EQ(VPX_CODEC_OK, skip_loop_filter.DecodeRemainingFrames());
skip_loop_filter.CheckMd5(false);
}
TEST(SkipLoopFilterTest, ShutOffLoopFilter8Threads) {
const int non_zero_value = 1;
const int num_threads = 8;
SkipLoopFilterTest skip_loop_filter;
skip_loop_filter.Init(num_threads);
skip_loop_filter.SetSkipLoopFilter(non_zero_value, VPX_CODEC_OK);
ASSERT_EQ(VPX_CODEC_OK, skip_loop_filter.DecodeRemainingFrames());
skip_loop_filter.CheckMd5(false);
}
TEST(SkipLoopFilterTest, WithLoopFilter) {
const int non_zero_value = 1;
const int num_threads = 0;
SkipLoopFilterTest skip_loop_filter;
skip_loop_filter.Init(num_threads);
skip_loop_filter.SetSkipLoopFilter(non_zero_value, VPX_CODEC_OK);
skip_loop_filter.SetSkipLoopFilter(0, VPX_CODEC_OK);
ASSERT_EQ(VPX_CODEC_OK, skip_loop_filter.DecodeRemainingFrames());
skip_loop_filter.CheckMd5(true);
}
TEST(SkipLoopFilterTest, ToggleLoopFilter) {
const int num_threads = 0;
SkipLoopFilterTest skip_loop_filter;
skip_loop_filter.Init(num_threads);
for (int i = 0; i < 10; ++i) {
skip_loop_filter.SetSkipLoopFilter(i % 2, VPX_CODEC_OK);
ASSERT_EQ(VPX_CODEC_OK, skip_loop_filter.DecodeOneFrame());
}
ASSERT_EQ(VPX_CODEC_OK, skip_loop_filter.DecodeRemainingFrames());
skip_loop_filter.CheckMd5(false);
}
} // namespace

View File

@@ -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

Some files were not shown because too many files have changed in this diff Show More