Commit Graph

222 Commits

Author SHA1 Message Date
John Koleszar
1d60b6bcb5 Merge "Replace as_mv struct with array" into experimental 2013-02-12 13:59:04 -08:00
Ronald S. Bultje
f496f601fb Add tile column size limits (256 pixels min, 4096 pixels max).
This is after discussion with the hardware team. Update the unit test
to take these sizes into account. Split out some duplicate code into
a separate file so it can be shared.

Change-Id: I8311d11b0191d8bb37e8eb4ac962beb217e1bff5
2013-02-12 10:33:34 -08:00
Scott LaVarnway
ff024f812b Merge "Bug fix: ssse3 version of subpixel did not match C code" into experimental 2013-02-12 08:45:24 -08:00
Christian Duvivier
094e2572df Faster convolve8_avg.
Implement convolve8_avg using common functions which are already optimized
instead of using more obscure ones which have only C versions. Encoder
overall speed-up of about 12%.

Change-Id: I8c57aa76936c8a48f22b115f19f61d9f2ae1e4b6
2013-02-11 16:53:11 -08:00
Jingning Han
57e995ff9c butterfly inverse 4x4 ADST
fixed format issues.

Implement the inverse 4x4 ADST using 9 multiplications. For this
particular dimension, the original ADST transform can be
factorized into simpler operations, hence is retained.

Change-Id: Ie5d9749942468df299ab74e90d92cd899569e960
2013-02-11 10:42:39 -08:00
Ronald S. Bultje
5f2e8449b7 Merge "Port sadNxNx4d functions to x86inc.asm." into experimental 2013-02-11 08:20:12 -08:00
Scott LaVarnway
eda30b410e Bug fix: ssse3 version of subpixel did not match C code
A 16 bit overflow condition occurs when using the EIGHTTAP_SMOOTH filters.
(vp9_sub_pel_filters_8lp)  Changed the order of the adds to fix this problem.
Also added ssse3 support for 4x4 subpixel filtering.

Change-Id: I475eaadae920794c2de5e01e9735c059a856518e
2013-02-09 15:15:14 -08:00
Paul Wilkins
e4f949b55a Merge "Nearest / Zero Mv default entropy tweak." into experimental 2013-02-09 04:21:08 -08:00
John Koleszar
7ca517f755 Replace as_mv struct with array
Replace as_mv.{first, second} with a two element array, so that they
can easily be processed with an index variable.

Change-Id: I1e429155544d2a94a5b72a5b467c53d8b8728190
2013-02-08 20:23:35 -08:00
John Koleszar
dc836109e4 Merge "Pass macroblock index to pick inter functions" into experimental 2013-02-08 20:20:37 -08:00
Ronald S. Bultje
c0ce2ab349 Port sadNxNx4d functions to x86inc.asm.
Change-Id: Ic639f5742f7a007753d7a3fa5c66235172eb31d8
2013-02-08 17:59:32 -08:00
Ronald S. Bultje
02ff360b33 Add sad64x64 and sad32x32 SSE2 versions.
Also port the 4x4, 16x16, 8x16 and 16x8 versions to x86inc.asm; this
makes them all slightly faster, particularly on x86-64. Remove SSE3
sad16x16 version, since the SSE2 version is now faster.

About 1.5% overall encoding speedup.

Change-Id: Id4011a78cce7839f554b301d0800d5ca021af797
2013-02-08 16:32:25 -08:00
John Koleszar
6125a1ed81 Pass macroblock index to pick inter functions
Pass the current mb row and column around rather than the
recon_yoffset and recon_uvoffset, since those offsets will
change from predictor to predictor, based on the reference
frame selection.

Change-Id: If3f9df059e00f5048ca729d3d083ff428e1859c1
2013-02-08 14:25:40 -08:00
John Koleszar
3de8ee6ba1 Merge changes Ife0d8147,I7d469716,Ic9a5615f into experimental
* changes:
  Restore SSSE3 subpixel filters in new convolve framework
  Convert subpixel filters to use convolve framework
  Add 8-tap generic convolver
2013-02-08 13:19:47 -08:00
John Koleszar
29d47ac80e Restore SSSE3 subpixel filters in new convolve framework
This commit adds the 8 tap SSSE3 subpixel filters back into the code
underneath the convolve API. The C code is still called for 4x4
blocks, as well as compound prediction modes. This restores the
encode performance to be within about 8% of the baseline.

Change-Id: Ife0d81477075ae33c05b53c65003951efdc8b09c
2013-02-08 12:18:14 -08:00
Paul Wilkins
bbede82f24 Nearest / Zero Mv default entropy tweak.
Tweak to default mode context to account for the fact
that when there are no non zero motion candidates
Nearest is now the preferred mode for coding a 0,0
vector.

Also resolve duplicate function name and typos.

Change-Id: I76802788d46c84e3d1c771be216a537ab7b12817
2013-02-08 10:16:13 +00:00
Yaowu Xu
e6ad9ab02c move dct/idct constants to a header file
also removed some un-unsed functions.

Change-Id: Ie363bcc8d94441d054137d2ef7c4fe59f56027e5
2013-02-07 13:51:45 -08:00
Jingning Han
d15e1da494 Butterfly ADST based hybrid transform
Refactor the 8x8 inverse hybrid transform. It is now consistent
with the new inverse DCT. Overall performance loss (due to the
use of this variant ADST, and the rounding errors in the butterfly
implementation) for std-hd is -0.02.

Fixed BUILD warning.

Devise a variant of the original ADST, which allows butterfly
computation structure. This new transform has kernel of the
form: sin((2k+1)*(2n+1) / (4N)). One of its butterfly structures
using floating-point multiplications was reported in Z. Wang,
"Fast algorithms for the discrete W transform and for the discrete
Fourier transform", IEEE Trans. on ASSP, 1984.

This patch includes the butterfly implementation of the inverse
ADST/DCT hybrid transform of dimension 8x8.

Change-Id: I3533cb715f749343a80b9087ce34b3e776d1581d
2013-02-07 10:07:46 -08:00
Ronald S. Bultje
aac73df1a7 Use configure checks for various inline keywords.
Change-Id: I8508f1a3d3430f998bb9295f849e88e626a52a24
2013-02-06 16:12:56 -08:00
Ronald S. Bultje
a788e0fe63 Add sse2 versions of sub_pixel_variance{32x32,64x64}.
7.5% faster overall encoding.

Change-Id: Ie9bb7f9fdf93659eda106404cb342525df1ba02f
2013-02-06 11:20:59 -08:00
Paul Wilkins
8b4e9c5925 Merge "Change definition of NearestMV." into experimental 2013-02-06 04:06:31 -08:00
Ronald S. Bultje
1407bdc243 [WIP] Add column-based tiling.
This patch adds column-based tiling. The idea is to make each tile
independently decodable (after reading the common frame header) and
also independendly encodable (minus within-frame cost adjustments in
the RD loop) to speed-up hardware & software en/decoders if they used
multi-threading. Column-based tiling has the added advantage (over
other tiling methods) that it minimizes realtime use-case latency,
since all threads can start encoding data as soon as the first SB-row
worth of data is available to the encoder.

There is some test code that does random tile ordering in the decoder,
to confirm that each tile is indeed independently decodable from other
tiles in the same frame. At tile edges, all contexts assume default
values (i.e. 0, 0 motion vector, no coefficients, DC intra4x4 mode),
and motion vector search and ordering do not cross tiles in the same
frame.
t log

Tile independence is not maintained between frames ATM, i.e. tile 0 of
frame 1 is free to use motion vectors that point into any tile of frame
0. We support 1 (i.e. no tiling), 2 or 4 column-tiles.

The loopfilter crosses tile boundaries. I discussed this briefly with Aki
and he says that's OK. An in-loop loopfilter would need to do some sync
between tile threads, but that shouldn't be a big issue.

Resuls: with tiling disabled, we go up slightly because of improved edge
use in the intra4x4 prediction. With 2 tiles, we lose about ~1% on derf,
~0.35% on HD and ~0.55% on STD/HD. With 4 tiles, we lose another ~1.5%
on derf ~0.77% on HD and ~0.85% on STD/HD. Most of this loss is
concentrated in the low-bitrate end of clips, and most of it is because
of the loss of edges at tile boundaries and the resulting loss of intra
predictors.

TODO:
- more tiles (perhaps allow row-based tiling also, and max. 8 tiles)?
- maybe optionally (for EC purposes), motion vectors themselves
  should not cross tile edges, or we should emulate such borders as
  if they were off-frame, to limit error propagation to within one
  tile only. This doesn't have to be the default behaviour but could
  be an optional bitstream flag.

Change-Id: I5951c3a0742a767b20bc9fb5af685d9892c2c96f
2013-02-05 15:43:03 -08:00
Ronald S. Bultje
822864131b Merge "Add SSE3 versions for sad{32x32,64x64}x4d functions." into experimental 2013-02-05 15:40:46 -08:00
Yaowu Xu
c9ae73b251 Merge "rewrite 4x4 idct and fdct" into experimental 2013-02-05 15:26:36 -08:00
Ronald S. Bultje
58c983d109 Add SSE3 versions for sad{32x32,64x64}x4d functions.
Overall encoding about 15% faster.

Change-Id: I176a775c704317509e32eee83739721804120ff2
2013-02-05 15:21:47 -08:00
John Koleszar
7a07eea13f Convert subpixel filters to use convolve framework
Update the code to call the new convolution functions to do subpixel
prediction rather than the existing functions. Remove the old C and
assembly code, since it is unused. This causes a 50% performance
reduction on the decoder, but that will be resolved when the asm for
the new functions is available.

There is no consensus for whether 6-tap or 2-tap predictors will be
supported in the final codec, so these filters are implemented in
terms of the 8-tap code, so that quality testing of these modes
can continue. Implementing the lower complexity algorithms is a
simple exercise, should it be necessary.

This code produces slightly better results in the EIGHTTAP_SMOOTH
case, since the filter is now applied in only one direction when
the subpel motion is only in one direction. Like the previous code,
the filtering is skipped entirely on full-pel MVs. This combination
seems to give the best quality gains, but this may be indicative of a
bug in the encoder's filter selection, since the encoder could
achieve the result of skipping the filtering on full-pel by selecting
one of the other filters. This should be revisited.

Quality gains on derf positive on almost all clips. The only clip
that seemed to be hurt at all datarates was football
(-0.115% PSNR average, -0.587% min). Overall averages 0.375% PSNR,
0.347% SSIM.

Change-Id: I7d469716091b1d89b4b08adde5863999319d69ff
2013-02-05 14:23:17 -08:00
John Koleszar
5ca6a3667f Add 8-tap generic convolver
This commit introduces a new convolution function which will be used to
replace the existing subpixel interpolation functions. It is much the
same as the existing functions, but allows for changing the filter
kernel on a per-pixel basis, and doesn't bake in knowledge of the
filter to be applied or the size of the resulting block into the
function name.

Replacing the existing subpel filters will come in a later commit.

Change-Id: Ic9a5615f2f456cb77f96741856fc650d6d78bb91
2013-02-05 14:19:28 -08:00
Yaowu Xu
fa36981ec8 rewrite 4x4 idct and fdct
This commit changes the 4x4 iDCT to use same algorithm & constants as
other iDCTs. The 4x4 fDCT is also changed to be based on the new iDCT.

Change-Id: Ib1a902693228af903862e1f5a08078c36f2089b0
2013-02-05 11:42:49 -08:00
Paul Wilkins
81043e8d62 Change definition of NearestMV.
This commit makes the NearestMV match the chosen
best reference MV. It can be a 0,0 or non zero vector
which means the the compound nearest mv mode can
combine a 0,0 and a non zero vector.

Change-Id: I2213d09996ae2916e53e6458d7d110350dcffd7a
2013-02-05 17:03:25 +00:00
Scott LaVarnway
5780c4cbd5 Added vp9_short_idct1_32x32_c
and called this function in vp9_dequant_idct_add_32x32_c when
eob == 1.  For the test clip used, the decoder performance improved
by 21+%.  Based on Yaowu's 16 point idct work.

Change-Id: Ib579a90fed531d45777980e04bf0c9b23c093c43
2013-02-04 16:49:17 -08:00
Yaowu Xu
1eb79dc1dc re-write 8 point idct
to be consistent with idct16 and idct32.

Change-Id: Ie89dbd32b65c33274b7fecb4b41160fcf1962204
2013-02-04 07:31:25 -08:00
Yaowu Xu
ccaaeb4b5a a couple of minor fixes
fixed a function prototypes to prevent compiler warnings;
removed a function not in use;
un-capitialize "Refstride" to ref_stride

Change-Id: Ib4472b6084f357d96328c6a06e795b6813a9edba
2013-02-04 07:19:32 -08:00
Yaowu Xu
af4c9d2f88 Merge "Changes 16 point idct" into experimental 2013-02-01 08:22:20 -08:00
Yaowu Xu
91e0e80142 Changes 16 point idct
This commit changes the inverse 16 point dct to use the same algorithm
as the one for 32 point idct. In fact, now 16 point dct uses the exact
version of the souce code for even portion of the 32 point idct.

Tests showed current implementation has significant better accuracy
than the previous version. With this implementation and the minor bug
fix on forward 16 point dct, encoding tests showed about 0.2% better
compression of CIF set, test results on std-hd setting pending.

Change-Id: I68224b60c816ba03434e9f08bee147c7e344fb63
2013-01-31 19:52:18 -08:00
Yaowu Xu
c94e55add0 Merge "A fix point implementation of 32x32 idct" into experimental 2013-01-31 10:48:01 -08:00
Yaowu Xu
5149d7f7bd A fix point implementation of 32x32 idct
This commit changes the 32x32 idct to use integer only. The algorithm
was taken directly from "A Fast Computational Algorithm for the
Discrete Cosine Tranform" by W. Chen, et al., which was published in
IEEE Transaction on Communication Vol. Com.-25 No. 9, 1977. The signal
flow graph in the original paper is for a 32 point forward dct, the
current implementation of inverse DCT was done by follow the graph in
reversed direction.

With this implementation, the 32 point inverse dct contains a 16 point
inverse dct in its even portion, similarly the 16 point idct further
contains 8 point and 4 point inverse dcts.

As of patch 4, encoding tests showed there is no compression loss when
compared against the floating point baseline. Numbers even showed very
small postives. (cif: .01%, std-hd: .05%).

Change-Id: I2d2d17a424b0b04b42422ef33ec53f5802b0f378
2013-01-31 09:45:49 -08:00
Deb Mukherjee
a53be60904 Merge "Adding a frame parallel decoding mode" into experimental 2013-01-30 12:03:45 -08:00
Ronald S. Bultje
b499c24c2f Merge "don't code the branch for the predicted seg_id if that flag is false." into experimental 2013-01-30 10:02:51 -08:00
Ronald S. Bultje
3a4b18bc67 don't code the branch for the predicted seg_id if that flag is false.
Change-Id: Icb6e21dc0c2d9918faa33c8bf70943660df7ad88
2013-01-30 09:30:46 -08:00
Deb Mukherjee
d28750537e Merge "Further improvement on compound inter-intra expt" into experimental 2013-01-30 08:38:17 -08:00
Ronald S. Bultje
64401f838f Merge "Fix overread/write reported by valgrind if (mb_cols) & 3 != 0." into experimental 2013-01-29 12:49:22 -08:00
Deb Mukherjee
3b04d467ac Further improvement on compound inter-intra expt
Adds a special combination mode specific to intra prediciton
mode D45.

Current results with the compound inter/intra experiment:
derf: 0.2%
yt: 0.55%
std-hd: 0.75%
hd: 0.74%

Change-Id: I8976bdf3b9b0b66ab8c5c628bbc62c14fc72ca86
2013-01-29 00:21:29 -08:00
Paul Wilkins
0ff9b033b0 Segment Skip Flag
First step in simplifying the segment mode and
segment EOB flags into a simpler segment skip
flag that implies 0,0 mv and EOB at position 0.

Change-Id: Ib750cac31a7a02dc21082580498efd9f7d8d72a5
2013-01-28 17:28:04 +00:00
Ronald S. Bultje
9dc9f07fb8 Fix overread/write reported by valgrind if (mb_cols) & 3 != 0.
We'd backup and restore all cols for a 64x64 SB, but the array wouldn't
be big enough to hold all that data.

Change-Id: Ic68ea721bf07e0b2f3937bd16b0b734bcc743ce1
2013-01-25 17:18:08 -08:00
Deb Mukherjee
dfd89f2eab Adding a frame parallel decoding mode
Adds a flag to disable features that would inhibit frame parallel
decoding. This includes backward adaptation and MV sorting based
on search in ref frame buffer.

Also includes some minor clean-ups.

Change-Id: I434846717a47b7bcb244b37ea670c5cdf776f14d
2013-01-25 17:16:19 -08:00
Paul Wilkins
fcb4a25cd5 Mvref speedup
Quality / decode speed trade off changes.
Simpler insert method without sort. Quality impact small.

Change-Id: Id0c0941bc508d985405abd06a13ffe7489170b62
2013-01-24 17:26:37 +00:00
Scott LaVarnway
70019f6070 Merge "Intrinsic version of loopfilter now matches C code" into experimental 2013-01-24 08:45:22 -08:00
Deb Mukherjee
01cafaab1d Adds an error-resilient mode with test
Adds an error-resilient mode where frames can be continued
to be decoded even when there are errors (due to network losses)
on a prior frame. Specifically, backward updates are turned off
and probabilities of various symbols are reset to defaults at
the beginning of each frame. Further, the last frame's mvs are
not used for the mv reference list, and the sorting of the
initial list based on search on previous frames is turned off
as well.

Also adds a test where an arbitrary set of frames are skipped
from decoding to simulate errors. The test verifies (1) that if
the error frames are droppable - i.e. frame buffer updates have
been turned off - there are no mismatch errors for the remaining
frames after the error frames; and (2) if the error-frames are non
droppable, there are not only no decoding errors but the mismatch
PSNR between the decoder's version of the post-error frames and the
encoder's version is at least 20 dB.

Change-Id: Ie6e2bcd436b1e8643270356d3a930e8989ff52a5
2013-01-23 21:56:15 -08:00
Deb Mukherjee
ebb1157cde Merge "Modifies the comp inter-intra expt" into experimental 2013-01-23 09:43:07 -08:00
Scott LaVarnway
6a997400ff Intrinsic version of loopfilter now matches C code
Updated the instrinsic code to match Yaowu's latest loopfilter change.
(I584393906c4f5f948a581d6590959522572743bb)

The decoder performance improved by ~30% for the test clip used.

Change-Id: I026cfc75d5bcb7d8d58be6f0440ac9e126ef39d2
2013-01-23 09:31:40 -08:00