Commit Graph

104 Commits

Author SHA1 Message Date
Fritz Koenig
3de8a95831 Merge changes I896fe6f9,I90d8b167
* changes:
  Change the x86 idct functions to do reconstruction at the same time
  Combine idct and reconstruction steps
2010-07-26 06:05:30 -07:00
Fredrik Söderquist
2add72d9bc Don't dereference ctx->priv if it hasn't been setup correctly. 2010-07-23 19:13:50 -04:00
Fredrik Söderquist
eafcf918a0 Only touch ctx->priv if vp8_mmap_alloc succeeded. 2010-07-23 19:13:34 -04:00
Jeff Muizelaar
98fcccfe97 Change the x86 idct functions to do reconstruction at the same time
Change-Id: I896fe6f9664e6849c7cee2cc6bb4e045eb42540f
2010-07-23 15:21:36 -04:00
Jeff Muizelaar
b2fa74ac18 Combine idct and reconstruction steps
This moves the prediction step before the idct and combines the idct and
reconstruction steps into a single step. Combining them seems to give an
overall decoder performance improvement of about 1%.

Change-Id: I90d8b167ec70d79c7ba2ee484106a78b3d16e318
2010-07-23 15:21:36 -04:00
Fritz Koenig
0ce3901282 Swap alt/gold/new/last frame buffer ptrs instead of copying.
At the end of the decode, frame buffers were being copied.
The frames are not updated after the copy, they are just
for reference on later frames.  This change allows multiple
references to the same frame buffer instead of copying it.

Changes needed to be made to the encoder to handle this.  The
encoder is still doing frame buffer copies in similar places
where pointer reference could be done.

Change-Id: I7c38be4d23979cc49b5f17241ca3a78703803e66
2010-07-23 14:53:59 -04:00
Paul Wilkins
68cf24310b Merge commit 'refs/changes/51/351/1' of ssh://review.webmproject.org:29418/libvpx into KfRateBugMerged 2010-07-23 17:45:26 +01:00
Yaowu Xu
f5cf8553a2 Merge "Make the quantizer exact." 2010-07-23 09:26:26 -07:00
Paul Wilkins
9404c7db6d Rate control bug with long key frame interval.
In two pass encodes, the calculation of the number of bits
allocated to a KF group had the potential to overflow for high data
rates if the interval is very long.

We observed the problem in one test clip where there was one
section where there was an 8000 frame gap between key frames.

Change-Id: Ic48eb86271775d7573b4afd166b567b64f25b787
2010-07-23 17:01:12 +01:00
Timothy B. Terriberry
e04e293522 Make the quantizer exact.
This replaces the approximate division-by-multiplication in the
 quantizer with an exact one that costs just one add and one
 shift extra.
The asm versions have not been updated in this patch, and thus
 have been disabled, since the new method requires different
 multipliers which are not compatible with the old method.

Change-Id: I53ac887af0f969d906e464c88b1f4be69c6b1206
2010-07-23 08:48:01 -07:00
Paul Wilkins
d576690ba1 80 character line length on Arnr LUT
Tweaked table to fit to 80 characters.

Change-Id: Ie6ba80e0b31b33e23d2bf78599abe223369fcefb
2010-07-23 16:47:54 +01:00
Fritz Koenig
08eed049d4 Remove CONFIG_NEW_TOKENS files.
These files were out of date and no longer maintained.
Token decoding has implemented the no-crash code which
is incompatible with this arm assembly code.

Change-Id: Ibf729886c56fca48181af60b44bda896c30023fc
2010-07-22 19:00:21 -04:00
Johann
160d671e34 Merge "limit range checking code for L[k] to CONFIG_DEBUG. patch by timeless@gmail.com" 2010-07-21 12:59:39 -07:00
Yaowu Xu
7a89d4c3d4 Merge "Improve the accuracy of forward walsh-hadamard transform" 2010-07-19 07:50:26 -07:00
Paul Wilkins
0ba32632cd ARNR Lookup Table.
Change submitted for Adrian Grange. Convert threshold
calculation in ARNR filter to a lookup table.

Change-Id: I12a4bbb96b9ce6231ce2a6ecc2d295610d49e7ec
2010-07-19 14:46:42 +01:00
Paul Wilkins
02277b8aa3 Parameter limit change.
Change maximum ARNR filter width to 15.

Change-Id: I3b72450ea08e96287445ec18810630ee2292954c
2010-07-19 14:39:43 +01:00
Paul Wilkins
bf18069ceb Rate control fix for ARNR filtered frames.
Previously we had assumed that it was necessary to give a full frame's
bit allocation to the alt ref frame if it has been created through temporal
filtering. This is not the case. The active max quantizer control
insures that sufficient bits are allocated if needed and allocating a
full frame's worth of bits creates an excessive overhead for the ARF.

Change-Id: I83c95ed7bc7ce0e53ccae6ff32db5a97f145937a
2010-07-19 14:10:07 +01:00
Paul Wilkins
7c938f4d3c Fix: Incorrect 'cols' calculation in temporal filter.
Change-Id: I37f10fbe4fbb505c1d34980a59af3e817c287e22
2010-07-16 15:57:17 +01:00
Michael Kohler
80f0e7a7d0 limit range checking code for L[k] to CONFIG_DEBUG. patch by timeless@gmail.com 2010-07-12 18:41:45 +02:00
John Koleszar
16249382cb Merge "Fix misspelled "skiped" in onyxc_int.h to "skipped"." 2010-07-07 16:57:08 -07:00
Yaowu Xu
3d0a1edadd Fix a compiling error on armv6
The issue was caused by a bad merge in Change I5559d1e8

Change-Id: I6563f652bc1500202de361f8f51d11cc6ddf3331
2010-07-07 14:45:13 -04:00
Michael Kohler
1e23f45119 Fix misspelled "skiped" in onyxc_int.h to "skipped".
Signed-off-by: Michael Kohler <michaelkohler@live.com>
2010-07-07 20:06:04 +02:00
Adrian Grange
0618ff14d6 Fix bug in 1st pass motion compensation
In the case where the best reference mv is not (0,0) a secondary
search is carried out centered on (0,0). However, rather than
sending tmp_err into the search function, motion_error was
inadvertently passed.

As a result tmp_err remains set at INT_MAX and the (0,0)-based
search result will never be selected, even if it is better.

Change-Id: I3c82b246c8c82ba887b9d3fb4c9e0a0f2fe5a76c
2010-07-01 14:19:43 +01:00
Paul Wilkins
2e3d8d3263 Merge "Further adjustment of RD behaviour with Q and Zbin." 2010-07-01 01:53:40 -07:00
John Koleszar
b3eb3d2163 Merge "Remove INLINE/FORCEINLINE" 2010-06-30 07:59:39 -07:00
John Koleszar
308e867f91 Update loopfilter frame/filter/sharp info for multithread
Change I9fd1a5a4 updated the multithreaded loopfilter to avoid
reinitializing several parameteres if they haven't changed from the
last frame, but the code to update the last frame's parameters wasn't
invoked in the multithreaded case.

Change-Id: Ia23d937af625c01dd739608e02d110f742b7e1f2
2010-06-30 10:23:53 -04:00
Yunqing Wang
b2f77866aa Merge "Add loopfilter initialization fix in multithreading code" 2010-06-30 06:56:36 -07:00
Yunqing Wang
29d586b462 Add loopfilter initialization fix in multithreading code
Modified loopfilter initialization to avoid unnecessary operations.

Change-Id: I9fd1a5a49edc1cb8116c2a72a6908b1e437459ec
2010-06-30 09:42:39 -04:00
Adrian Grange
cf49034b14 Merge "Fixed buffer selection for UV in AltRef filtering" 2010-06-30 02:43:47 -07:00
Yunqing Wang
bead039d4d Improve SSE2 loopfilter functions
Restructured and rewrote SSE2 loopfilter functions. Combined u and
v into one function to take advantage of SSE2 128-bit registers.
Tests on test clips showed a 4% decoder performance improvement on
Linux desktop.

Change-Id: Iccc6669f09e17f2224da715f7547d6f93b0a4987
2010-06-29 15:23:14 -04:00
Paul Wilkins
1ca39bf26d Further adjustment of RD behaviour with Q and Zbin.
Following conversations with Tim T (Derf) I ran a large number of
tests comparing the existing polynomial expression with a simpler
^2 variant. Though the polynomial was sometimes a little better at
the extremes of Q it was possible to get close for most clips and
even a little better on some.

This code also changes the way the RD multiplier is calculated
when the ZBIN is extended to use a variant of the same ^2
expression.

I hope that this simpler expression will be easier to tune further
as we expand our test set and consider adjustments based on content.

Change-Id: I73b2564346e74d1332c33e2c1964ae093437456c
2010-06-29 12:15:54 +01:00
Yaowu Xu
b62d093efa Improve the accuracy of forward walsh-hadamard transform
Besides the slight improvement in round trip error. This
also fixes a sign bias in the forward transform, so the
round trip errors are evenly distributed between +1s and
-1s. The old bias seemed to work well with the dc sign bias
in old fdct,  which no longer exist in the improved fdct.

Change-Id: I8635e7be16c69e69a8669eca5438550d23089cef
2010-06-28 22:10:48 -07:00
Adrian Grange
aa8fe0d269 Fixed buffer selection for UV in AltRef filtering
Corrected setting of "which_buffer" for U & V cases to match that
used for Y, i.e. to refer to the temporally most recent frame of
those to be filtered.

Change-Id: Idf94b287ef47a05f060da3e61134a0b616adcb6b
2010-06-28 16:45:06 +01:00
Scott LaVarnway
f1a3b1e0d9 Added first-pass sse2 version of Yaowu's new fdct.
Change-Id: Ib479210067510162879c368428b92690591120b2
2010-06-24 16:40:56 -04:00
Yaowu Xu
d0dd01b8ce Redo the forward 4x4 dct
The new fdct lowers the round trip sum squared error for a
4x4 block ~0.12. or ~0.008/pixel. For reference, the old
matrix multiply version has average round trip error 1.46
for a 4x4 block.

Thanks to "derf" for his suggestions and references.

Change-Id: I5559d1e81d333b319404ab16b336b739f87afc79
2010-06-24 13:17:58 -07:00
Fritz Koenig
a5906668a3 vp8cx : bestsad declared and initialized incorrectly.
bestsad needs to be a int and set to INT_MAX because at the end
of the function it is compared to INT_MAX to determine if there
was a match in the function.

Change-Id: Ie80e88e4c4bb4a1ff9446079b794d14d5a219788
2010-06-24 14:30:48 -04:00
Fritz Koenig
cecdd73db7 vp8cx : bestsad declared and initialized incorrectly.
bestsad should be an int initialized to INT_MAX.  The optimized
SAD function expects a signed value for bestsad to use for comparison
and early loop termination.  When no match is made, which is
determined by a comparison of bestsad to INT_MAX, INT_MAX is returned.
2010-06-24 12:18:23 -04:00
John Koleszar
5e34461448 Remove INLINE/FORCEINLINE
These are mostly vestigial, it's up to the compiler to decide what
should be inlined, and this collided with certain Windows platform SDKs.

Change-Id: I80dd35de25eda7773156e355b5aef8f7e44e179b
2010-06-24 09:24:33 -04:00
agrange
a08df4552a Fix breakout thresh computation for golden & AltRef frames
1. Unavailability of each reference frame type should be tested
independently,
2. Also, only the VP8_GOLD_FLAG needs to be tested before setting
golden frame specific thresholds, and only VP8_ALT_FLAG needs
testing before setting thresholds relevant to the AltRef frame.
(Raised by gbvalor, in response to Issue 47)

Change-Id: I6a06fc2a6592841d85422bc1661e33349bb6c3b8
2010-06-21 16:50:59 +01:00
agrange
daa5d0eb3d Changed unary operator from ! to ~
Since the intent is
to reset the appropriate bit in ref_frame_flags not to
test a logic condition. Prior result would always have
been ref_frame_flags being set to 0.
(Issue reported by dgohman, issue 47)

Change-Id: I2c12502ed74c73cf38e98c9680e0249c29e16433
2010-06-21 15:23:51 +01:00
agrange
d4b99b8e3a Moved DOUBLE_DIVIDE_CHECK to denominator (was on numerator)
The DOUBLE_DIVIDE_CHECK macro prevents from divide by 0,
so must be on the denominator to work as intended.

Change-Id: Ie109242d52dbb9a2c4bc1e11890fa51b5f87ffc7
2010-06-21 15:20:52 +01:00
Timothy B. Terriberry
9f81463454 Fix a linker error on x86-64 Linux when not using a version script.
If the version script produced by the libvpx build system is not
 used when linking a shared library on x86-64 Linux, the constant
 data in the subpel filters produces R_X86_64_32 relocation errors
 due to the use of wrt rip addressing instead of
 wrt rip wrt ..gotpcrel.
Instead of adding a new macro for this addressing mode, this patch
 sets the ELF visibility of these symbols to "hidden", which
 allows wrt rip addressing to work without a text relocation.
This allows building a shared library without using the provided
 build system or a separate version script.
Fixes http://code.google.com/p/webm/issues/detail?id=46

Change-Id: Ie108f9d9a4352e5af46938bf4750d2302c1b2dc2
2010-06-21 08:19:12 -04:00
Jim Bankoski
220daa00e0 vp8_block_error_xmm: remove unnecessary instructions
Remove a couple instructions from this function which weren't
necessary for correct execution.

Change-Id: Ib649674f140689f7e5c1530c35686241688a3151
2010-06-18 13:34:43 -04:00
John Koleszar
94c52e4da8 cosmetics: trim trailing whitespace
When the license headers were updated, they accidentally contained
trailing whitespace, so unfortunately we have to touch all the files
again.

Change-Id: I236c05fade06589e417179c0444cb39b09e4200d
2010-06-18 13:06:11 -04:00
John Koleszar
c65e8e8e46 Merge "Change bitreader to use a larger window." 2010-06-17 18:08:36 -07:00
Timothy B. Terriberry
c17b62e1bd Change bitreader to use a larger window.
Change bitreading functions to use a larger window which is refilled less
 often.

This makes it cheap enough to do bounds checking each time the window is
 refilled, which avoids the need to copy the input into a large circular
 buffer.
This uses less memory and speeds up the total decode time by 1.6% on an ARM11,
 2.8% on a Cortex A8, and 2.2% on x86-32, but less than 1% on x86-64.

Inlining vp8dx_bool_decoder_fill() has a big penalty on x86-32, as does moving
 the refill loop to the front of vp8dx_decode_bool().
However, having the refill loop between computation of the split values and
 the branch in vp8_decode_mb_tokens() is a big win on ARM (presumably due to
 memory latency and code size: refilling after normalization duplicates the
 code in the DECODE_AND_BRANCH_IF_ZERO and DECODE_AND_LOOP_IF_ZERO cases.
Unfortunately, refilling at the end of vp8dx_bool_decoder_fill() and at the
 beginning of each decode step in vp8_decode_mb_tokens() means the latter
 requires an extra refill at the end.
Platform-specific versions could avoid the problem, but would require most of
 detokenize.c to be duplicated.

Change-Id: I16c782a63376f2a15b78f8086d899b987204c1c7
2010-06-15 19:55:14 -07:00
Yunqing Wang
9fdfb8e928 Merge "More on "some XMM registers are non-volatile on windows x64 ABI"" 2010-06-15 06:41:54 -07:00
Yunqing Wang
397aad3ec2 More on "some XMM registers are non-volatile on windows x64 ABI"
Add same fix in subpixel_sse2.asm.

Change-Id: Icfda6103cbf74ec43308e96961dd738aa823c14d
2010-06-15 09:11:26 -04:00
John Koleszar
89c8b3dbc6 vp8_cx_iface: set default cpu used to 0
Change-Id: I7b35f4717cdd204224112f72471b551617262417
2010-06-14 17:28:15 -04:00
Guillermo Ballester Valor
5a72620de9 Fix compiler warnings
Change-Id: I2a97f08cc3c7808ce5be39e910cc5147ecf03a1d
2010-06-14 17:23:49 -04:00