Commit Graph

86 Commits

Author SHA1 Message Date
Ronald S. Bultje
c456b35fdf 32x32 transform for superblocks.
This adds Debargha's DCT/DWT hybrid and a regular 32x32 DCT, and adds
code all over the place to wrap that in the bitstream/encoder/decoder/RD.

Some implementation notes (these probably need careful review):
- token range is extended by 1 bit, since the value range out of this
  transform is [-16384,16383].
- the coefficients coming out of the FDCT are manually scaled back by
  1 bit, or else they won't fit in int16_t (they are 17 bits). Because
  of this, the RD error scoring does not right-shift the MSE score by
  two (unlike for 4x4/8x8/16x16).
- to compensate for this loss in precision, the quantizer is halved
  also. This is currently a little hacky.
- FDCT and IDCT is double-only right now. Needs a fixed-point impl.
- There are no default probabilities for the 32x32 transform yet; I'm
  simply using the 16x16 luma ones. A future commit will add newly
  generated probabilities for all transforms.
- No ADST version. I don't think we'll add one for this level; if an
  ADST is desired, transform-size selection can scale back to 16x16
  or lower, and use an ADST at that level.

Additional notes specific to Debargha's DWT/DCT hybrid:
- coefficient scale is different for the top/left 16x16 (DCT-over-DWT)
  block than for the rest (DWT pixel differences) of the block. Therefore,
  RD error scoring isn't easily scalable between coefficient and pixel
  domain. Thus, unfortunately, we need to compute the RD distortion in
  the pixel domain until we figure out how to scale these appropriately.

Change-Id: I00386f20f35d7fabb19aba94c8162f8aee64ef2b
2012-12-07 14:45:05 -08:00
Yaowu Xu
c202100fe4 Enable unit tests to build with MSVC
Change-Id: Ie80597221bee494679ae2ba50cca22dea2609cba
2012-12-04 12:29:26 -08:00
John Koleszar
1760c39bce Revert "make: flatten object file directories"
This reverts commit b72373de79.

Change-Id: Ic1601160e11df1a018ef12da25967cfb5eebd5ba
2012-11-27 16:36:39 -08:00
John Koleszar
fcccbcbb39 Add vp9_ prefix to all vp9 files
Support for gyp which doesn't support multiple objects in the same
static library having the same basename.

Change-Id: Ib947eefbaf68f8b177a796d23f875ccdfa6bc9dc
2012-11-27 14:12:30 -08:00
Yaowu Xu
89d62e3b04 remove the dependency on idct.h
Change-Id: Idcf827d8ae6429ee5b673c3398f838dbeacb4e74
2012-11-26 09:12:04 -08:00
Jim Bankoski
510557e2eb removed the idct rtcd idct calls
More cleanup to do after this,  but this is a good chunk of removing rtcd.

Change-Id: I551db75e341a0a85c3ad650df1e9a60dc305681a
2012-11-24 19:33:58 -08:00
John Koleszar
a9c7597adc support building vp8 and vp9 into a single lib
Change-Id: Ib8f8a66c9fd31e508cdc9caa662192f38433aa3d
2012-11-15 10:46:17 -08:00
John Koleszar
b72373de79 make: flatten object file directories
Rather than building an object file directory heirarchy matching the
source tree's layout, rename the object files so that the object
file name contains the path in the source file tree. The intent here
is to allow two files in different parts of the source tree to have
the same name and still not collide when put into an ar archive.

Change-Id: Id627737dc95ffc65b738501215f34a995148c5a2
2012-11-15 10:44:58 -08:00
John Koleszar
8959c8b11d Merge with upstream experimental changes (2)
Include upstream changes (variance fixes) into the merged code base.

Change-Id: I4182654c1411c1b15cd23235d3822702613abce1
2012-11-07 14:32:26 -08:00
John Koleszar
2c08c28191 Merge with upstream experimental changes
Include upstream changes (unit test fixes, in particular) into the
merged code base.

Change-Id: I096f8a9d09e2532fbec0c95d7a995ab22fa54b29
2012-11-07 11:46:23 -08:00
John Koleszar
7b8dfcb5a2 Rough merge of master into experimental
Creates a merge between the master and experimental branches. Fixes a
number of conflicts in the build system to allow *either* VP8 or VP9
to be built. Specifically either:

  $ configure --disable-vp9 $ configure --disable-vp8
  --disable-unit-tests

VP9 still exports its symbols and files as VP8, so that will be
resolved in the next commit.

Unit tests are broken in VP9, but this isn't a new issue. They are
fixed upstream on origin/experimental as of this writing, but rebasing
this merge proved difficult, so will tackle that in a second merge
commit.

Change-Id: I2b7d852c18efd58d1ebc621b8041fe0260442c21
2012-11-07 11:30:16 -08:00
James Zern
984734436d Fix variance (signed integer) overflow
In the variance calculations the difference is summed and later squared.
When the sum exceeds sqrt(2^31) the value is treated as a negative when
it is shifted which gives incorrect results.

To fix this we force the multiplication to be unsigned.

The alternative fix is to shift sum down by 4 before multiplying.
However that will reduce precision.

For 16x16 blocks the maximum sum is 65280 and sqrt(2^31) is 46340 (and
change).

This change is based on:
1698234 Missed some variance casts
fea3556 Fix variance overflow

Change-Id: I2c61856cca9db54b9b81de83b4505ea81a050a0f
2012-11-06 23:06:44 -08:00
James Zern
2e3e685799 fix test builds
s/([vV][pP])8/$19/
additionally dct.h was removed; declare the _c functions that are used
in the tests. the TODO for conversion to parameterized tests still
remains.

Change-Id: I73db9425a57075bbb78a92693ba6b320578981cd
2012-11-06 12:12:58 -08:00
Ronald S. Bultje
4b2c2b9aa4 Rename vp8/ codec directory to vp9/.
Change-Id: Ic084c475844b24092a433ab88138cf58af3abbe4
2012-11-01 16:31:22 -07:00
Jim Bankoski
533470c998 add unit test for datarate control
Adds some basic datarate control tests..

Change-Id: I6eff18aa58ef7cfd14886c6b1e048247cd1ad247
2012-10-29 19:54:06 -07:00
Jim Bankoski
65d73881f7 Minor tweaks to video source frameworks
Fix the video source to close if file is open already and add a limit.

Change-Id: I36ada4c609d027b6eaa9b447fe9ad4115532edc1
2012-10-26 19:49:44 -07:00
Yunqing Wang
15dffcfefa Add unit test for decoder test_vector_test
Got 61 test vectors from vp8-test-vectors.git
(http://git.chromium.org/gitweb/?p=webm/vp8-test-vectors.git)

Added decoder test vectors downloading in unit tests. Uploaded
the test vectors and their md5 files to WebM website.
  $ gsutil cp *.* gs://downloads.webmproject.org/test_data/libvpx

Added their sha1sum to the test/test-data.sha1 file.

In unit tests, download the test vectors to LIBVPX_TEST_DATA_PATH.

Test_vector_test goes through the test vectors, decodes them, and
compute the md5 checksums. The checksums are compared with the
expected md5 checksums to tell if the decoder decodes correctly.

Change-Id: Ia1e84f9347ddf1d4a02e056c0fee7d28dccfae15
2012-10-22 13:46:11 -07:00
Deb Mukherjee
a7333b0a5b Merge of the TX_16X16 experiment
Change-Id: I22aa803ffff330622cdb77277e7b196a9766f882
2012-10-10 17:05:54 -07:00
Yunqing Wang
8b698e8cb1 Merge "post-proc: deblock filter optimization" 2012-10-09 09:26:36 -07:00
Yunqing Wang
4c53bacce4 post-proc: deblock filter optimization
1. Algorithm modification:
Instead of having same filter threshold for a whole frame, now we
allow the thresholds to be adjusted for each macroblock. In current
implementation, to avoid excessive blur on background as reported
in issue480(http://code.google.com/p/webm/issues/detail?id=480), we
reduce the thresholds for skipped macroblocks.

2. SSE2 optimization:
As started in issue479(http://code.google.com/p/webm/issues/detail?id=479),
the filter calculation was adjusted for better performance. The c
code was also modified accordingly. This made the deblock filter
2x faster, and the decoder was 1.2x faster overall.

Next, the demacroblock filter will be modified similarly.

Change-Id: I05e54c3f580ccd427487d085096b3174f2ab7e86
2012-10-08 12:06:44 -07:00
Adrian Grange
55cff377dd Merge "Unit Test for Error Resilience Mode" 2012-10-04 17:33:55 -07:00
Ronald S. Bultje
1a89bc04e8 Add a unit test for CQ mode.
Change-Id: I66c391987eabc5ea0159bf4a2a4fd8e8e163872f
2012-10-04 16:38:21 -07:00
Adrian Grange
eb8e9f80c4 Merge "Added handler for PSNR packets to EncoderTest class" 2012-10-04 10:38:35 -07:00
Adrian Grange
85b27a1271 Merge "Add initialization and per frame flag members" 2012-10-04 10:37:38 -07:00
Adrian Grange
cc017ca8df Unit Test for Error Resilience Mode
This unit test compares the difference in quality with
error resilience enabled and disabled. The test runs
for all of the one-pass encoding modes.

The test ensures that the effect of turning on error
resilience makes less than a 10% difference in PSNR.

Further cases should be added to do a more comprehensive
test.

Change-Id: I1fc747fc78c9459bc6c74494f4b38308dbed0c32
2012-10-03 14:58:26 -07:00
Adrian Grange
e6109dbd41 Added handler for PSNR packets to EncoderTest class
Added a virtual function to handle PSNR packets.

Change-Id: Id2a6372c691a14f19bbeed217a93a9df03e81e75
2012-10-03 14:23:47 -07:00
Adrian Grange
4206c6dd01 Add initialization and per frame flag members
Modified EncoderTest class to have separate member variables
for initialization time and per-frame.

Change-Id: I08a1901f8f3ec16e45f96297e08e7f6df0f4aa0b
2012-10-03 14:13:15 -07:00
Adrian Grange
f199bab7ab Merge "Added Reset method to TwopassStatsStore" 2012-10-03 13:45:46 -07:00
Adrian Grange
30f58b526d Added Reset method to TwopassStatsStore
The stats buffer needs to be reset between runs of the
encoder. I added a Reset() function to TwopassStatsStore
and called it at the beginning of each encode.

This enables us to run multiple encodes which was
previously not possible since there was no way to reset
the stats between runs.

Change-Id: Iebb18dab83ba9331f009f764cc858609738a27f9
2012-10-03 11:50:54 -07:00
John Koleszar
ea90cee2a9 Merge "Added unit test for subtract functions" 2012-10-03 08:17:16 -07:00
Jim Bankoski
6f35b1958e Disable keyframe in real time that's placed one frame after a cut.
The codec as it stood placed a keyframe one frame after a
real cut scene - and ignored datarate and other considerations.

TODO: Its possible that we should detect a keyframe and recode
the frame ( in certain circumstances) to improve quality.

Change-Id: Ia1fd6d90103f4da4d21ca5ab62897d22e0b888a8
2012-10-01 14:17:43 -07:00
Scott LaVarnway
96f706655e Added unit test for subtract functions
Patch Set 1: gain familiarity with unit tests... added simple
4x4 subtract test
Patch Set 2: fixed mistakes, parameterized as suggested
Patch Set 3: randomized the source/predictor data


Change-Id: I33432bdf7c9f2a9b8c2533a37106382c2a8209ee
Signed-off-by: Scott LaVarnway <slavarnway@google.com>
2012-09-26 13:45:53 -07:00
Yaowu Xu
c953aeacd4 added encode/decode matching validation to tests
This commit adds the ability of validating matched encoder and
decoder to unit tests.

Change-Id: Ie00d69a42477b6a69b324a6bd134939684f7300b
2012-08-31 13:43:51 -07:00
James Zern
10f8b36146 msvs/tests: fix data alignment for asm tests
Replace DECLARE_ALIGNED_ with vpx_memalign()

DECLARE_ALIGNED (__declspec(align())) does not work as intended when
used on class data members:

Data in classes or structures is aligned within the class or structure
at the minimum of its natural alignment and the current packing setting
(from #pragma pack or the /Zp compiler option)

Change-Id: I304aaa6c3716fbfae24675ecf192f4b40787e83e
2012-08-31 10:23:32 -07:00
Yaowu Xu
95ee7f1131 change to properly account for coef scaling in unit tests
The transform functions in experimental branch absorbed a scaling
factor of 4 to allow quantization steps closer to unit quantizer.
This commit added scaling code in between forward and inverse
transform to properly account for the scaling factor.

Change-Id: I9a573ddc1ffa74973b34800a5da1a56dbabe0949
2012-08-24 10:11:15 -07:00
James Zern
8bec177dc4 Merge "sad_test: fix msvc build" 2012-08-21 13:33:46 -07:00
James Zern
12ddb75a9a sad_test: fix msvc build
pass a variable to make_tuple() rather than a function, fixes type
errors

Change-Id: Ic0cbd25d0ca35ad08c672040b4141b3b81695752
2012-08-21 08:32:00 -07:00
James Zern
e57394aa1d sixtap_predict_test: fix msvc build
pass a variable to make_tuple() rather than a function, fixes type
errors

Change-Id: I5e04b61b5ab58cc0090ef21119486ca04853af61
2012-08-21 08:30:26 -07:00
James Zern
429743c56b fix timestamp calculation rollover w/altref
using large values for the timebase, e.g., {33333, 1000000} could
rollover the timestamp calculation in vp8e_encode as it was not using
64-bit math.

originally reported on ffmpeg's trac:
  https://ffmpeg.org/trac/ffmpeg/ticket/1014

BUG=468

Change-Id: Iedb4e11de086a3dda75097bfaf08f2488e2088d8
2012-08-08 14:30:49 -07:00
James Zern
51ebb9a396 EncoderTest: check that timestamps are monotonic
Change-Id: I813fa94c83df6282f382b24bbaccb1fe2fa94276
2012-08-08 14:16:08 -07:00
John Koleszar
3c37e7d2fa Merge "tests: fix Continue() signatures" 2012-08-08 11:24:42 -07:00
John Koleszar
336ca9a43a Merge "keyframe_test: use a fixed speed step for realtime" 2012-08-08 11:23:49 -07:00
James Zern
a9a1eac6c7 tests: fix Continue() signatures
they're const member functions, they need to match the base class to be
called

Change-Id: Id0580c5078b5876ead6731d95d8b86fef4029c40
2012-08-07 17:44:33 -07:00
Yaowu Xu
0b17ea6f68 A bit of temporary relief on encoder slowness
The commit replaces run-time initialization of cosine constants with
static constant values, which provides ~30% relief on slow speed. The
real solution, however will be to implement integer versions of those
functions that current use float/double.

Change-Id: Ie3ff1793509653d78dd1aeaf88cc6737da1bc55f
2012-08-07 14:06:11 -07:00
Daniel Kang
fed8a1837f 16x16 DCT blocks.
Set on all 16x16 intra/inter modes

Features:
- Butterfly fDCT/iDCT
- Loop filter does not filter internal edges with 16x16
- Optimize coefficient function
- Update coefficient probability function
- RD
- Entropy stats
- 16x16 is a config option

Have not tested with experiments.

hd:     2.60%
std-hd: 2.43%
yt:     1.32%
derf:   0.60%

Change-Id: I96fb090517c30c5da84bad4fae602c3ec0c58b1c
2012-08-02 17:33:10 -07:00
Johann
1161055129 Be consistent with SAD values
SAD returns unsigned values. Make all the declarations the same.

Remove bestsad initialization and check. It is always set to the
result of a SAD call so it will never remain UINT_MAX

Use ja instead of jg to test unsigned comparison instead of signed.

Update test.

Change-Id: I46336ab45f4e60fc37caf20bd36bc5782079c7a5
2012-07-27 16:15:31 -07:00
Johann
fbea897d85 Add tests for SAD functions
Change-Id: I018335a08cbb1eca55896c21e36918ed45a4b2a8
2012-07-25 17:11:16 -07:00
Johann
fce8f063e3 Use vpx_integer.h instead of stdint.h
vpx_integer accounts for win32, which does not have stdint.h

Change-Id: I0ecf243ba56ed2e920e1293a6876c2e1ef1af99e
2012-07-24 10:19:44 -07:00
Johann
5215c8f066 Merge "Use ACMRandom for all tests" 2012-07-24 09:35:50 -07:00
Johann
310666b1cd Merge "Allow specifying the seed" 2012-07-24 09:35:37 -07:00