Commit Graph

198 Commits

Author SHA1 Message Date
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
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
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
John Koleszar
bed59eb8de Merge changes Ia82cef79,I7324a75a,I7b66daad,I73344451,I91dc210f,I5945b5ce into experimental
* changes:
  Use alt-ref frame context for keyframes
  Preserve the previous golden frame on golden updates
  Generalize and increase frame coding contexts
  Start to anonymize reference frames
  Update encoder to use fb_idx_ref_cnt
  Remove buffer-to-buffer copy logic
2013-01-22 08:31:55 -08:00
Yaowu Xu
b95ed6883a a minor change to a portion of loop filtering
The loop filtering used for MB edge or internal edge of a MB using 8x8
tranform was reading 5 pixel each side and writting 3 pixel each side.
With suggestion from Aki and Scott on hardware&software performance,
this commit changed to read 4 pixel each side and write 3 pixel each
side.

Change-Id: I584393906c4f5f948a581d6590959522572743bb
2013-01-18 10:44:13 -08:00
John Koleszar
26bd81b955 Preserve the previous golden frame on golden updates
This commit restores the quality lost when the buffer-to-buffer copy
logic was removed. Note that this is specific to the current use of
golden frames and will need rework when RTC functionality is added.

Change-Id: I7324a75acd96eafd9e0f9b8633d782e390d5dc21
2013-01-16 15:57:02 -08:00
John Koleszar
4b65837bc6 Generalize and increase frame coding contexts
Previously there were two frame coding contexts tracked, one for normal
frames and one for alt-ref frames. Generalize this by signalling the
context to use in the bitstream, rather than tieing it to the alt ref
refresh bit. Also increase the number of contexts available to 4, which
may be useful for temporal scalability.

Change-Id: I7b66daaddd55c535c20cd16713541fab182b1662
2013-01-16 14:07:27 -08:00
John Koleszar
da832a80e4 Start to anonymize reference frames
Remove lst_fb_idx, gld_fb_idx, alt_fb_idx, refresh_last_frame,
refresh_golden_frame, refresh_alt_ref_frame from common. Gold/Alt are
encode side conventions. From the decoder's perspective, we want to be
dealing with numbered references.

Updates to active_ref 2 signal mode context switches, vestigial from
refresh_alt_ref_frame. This needs some clean up to make sense with
increased numbers of reference frames, as well as reimplementing the
swapping of alt/golden which was previously done using the
buffer-to-buffer copy mechanism removed in an earlier commit.

Change-Id: I7334445158b7666f9295d2a2dd22aa03f4485f58
2013-01-16 14:06:23 -08:00
John Koleszar
394b0a6a30 Update encoder to use fb_idx_ref_cnt
Do reference counting the same way on the encoder as the decoder does,
rather than maintaining the 'flags' member of YV12_BUFFER_CONFIG.

Change-Id: I91dc210ffca081acaf9d5c09a06e7461b3c3139c
2013-01-15 17:36:39 -08:00
John Koleszar
b8e027989f Remove buffer-to-buffer copy logic
This is the first in a series of commits to add additional reference
frames to the codec. Each frame will be able to update any of the
available references, but copying between references is not
supported.

Change-Id: I5945b5ce6cc3582c495102b4e7eed4f08c44d5a1
2013-01-15 17:36:39 -08:00
Yaowu Xu
9bf73f46f9 fix a number issues that cause failures
During master jenkins verification proces

Change-Id: I3722b8753eaf39f99b45979ce407a8ea0bea0b89
2013-01-14 18:32:32 -08:00
Deb Mukherjee
b34838bea5 Modifies the comp inter-intra expt
Uses a single 1D table to implement the weighting of the predictors
for the compound inter-intra experiment.

Change-Id: I204ffbe4f9fc79d5d43b6c724ad253d800461012
2013-01-14 17:32:26 -08:00
John Koleszar
24bc1a7189 Use INT64_MAX instead of LLONG_MAX
These variables have the type int64_t, not long long. long long could
be a larger type than 64 bits. Emulate INT64_MAX for older versions of
MSVC, and remove the unreferenced vpx_ports/vpxtypes.h

Change-Id: Ideaca71838fcd3849d816d5ab17aa347c97d03b0
2013-01-14 15:57:21 -08:00
Ronald S. Bultje
c9071601a2 Remove compound intra-intra experiment.
This experiment gives little gains and adds relatively much code
complexity (and it hinders other experiments), so let's get rid of
it.

Change-Id: Id25e79a137a1b8a01138aa27a1fa0ba4a2df274a
2013-01-14 15:47:25 -08:00
Yaowu Xu
741fbe9656 Merge experiment "subpelrefmv"
Change-Id: Iac7f3d108863552b850c92c727e00c95571c9e96
2013-01-14 15:18:47 -08:00
Yaowu Xu
f7dab60096 Merge experiment "widerlpf"
Change-Id: I0c94475075e66e13cfe4c20fab7db6474441ae86
2013-01-14 15:17:35 -08:00
Yaowu Xu
d8c5bceee5 Merge "changed UV plane loop filtering for TX_8X8" into experimental 2013-01-14 14:47:31 -08:00
Yaowu Xu
8750414368 Merge "change to evaluate reference mvs using above only" into experimental 2013-01-14 14:40:38 -08:00
Yaowu Xu
ad9a16ed17 changed UV plane loop filtering for TX_8X8
In commit 9a1d73d, loop filtering was added for UV 4x4 boundaries
when TX_8X8 is used by a MB. This commit further refined the decision
to be based on the actual transform used for the UV planes. When
UV planes use 4x4 transform, i.e. when prediction mode used is either
I8X8_PRED or SPLITMV, UV planes are filtered on 4x4 boundaries, and no
filtering is applied on 4x4 block boundaries when UV planes use 8X8
transform.

Change-Id: Ibb404face0a1d129b4b4abaf67c55d82e8df8bec
2013-01-14 14:28:20 -08:00
Yaowu Xu
fdf8654189 change to evaluate reference mvs using above only
Change-Id: Ibcc342efac0a9be7a21d9b2c09984d9e16bbb225
2013-01-14 14:01:40 -08:00
Adrian Grange
7bcaac3e64 Merge prediction filter
Removed the experimental flag from around the prediction filter.

Change-Id: Ic1dd2db8fe8ac17ed5129f83094d4c5cdd5527d2
2013-01-14 12:57:07 -08:00
Deb Mukherjee
516db21c2c Further enhancements/fixes on dct/dwt hybrid txfm
Fixes some scaling issues. Adds an option to only compute the
dct on the low-low subband for 32x32 and 64x64 blocks using
only a single 16x16 dct after 1 and 2 wavelet decomposition
levels respectively. Also adds an option to use a 8x8 dct
as building block.

Currenlty with the 2/6 filter and with a single 16x16 dct on
the low low band, the reuslts compared to full 32x32 dct is
as follows:
derf: -0.15%
yt: -0.29%
std-hd: -0.18%
hd: -0.6%
These are my current recommended settings, since the 2/6 filter
is very simple.

Results with 8x8 dct are about 0.3% worse.

Change-Id: I00100cdc96e32deced591985785ef0d06f325e44
2013-01-12 16:00:53 -08:00
Jim Bankoski
e42b280e11 Merge "WIP: Added sse2 version of vp9_mb_lpf_horizontal_edge_w" into experimental 2013-01-11 17:15:41 -08:00
Scott LaVarnway
b20ce07d76 WIP: Added sse2 version of vp9_mb_lpf_horizontal_edge_w
and vp9_mb_lpf_vertical_edge_w_sse2.  This was quickly done so we can
run some tests over the weekend.  Future commits will optimize/refactor these
functions further.

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

Change-Id: I612687cd5a7670ee840a0cbc3c68dc2b84d4af76
2013-01-11 17:11:04 -08:00
Yaowu Xu
bbe1c9257f Merge "Add loop filtering for UV plane" into experimental 2013-01-11 16:56:39 -08:00
Yaowu Xu
9a1d73d036 Add loop filtering for UV plane
On block boundary within a MB when 8x8 block boundary only is filtered
for Y.

Change-Id: Ie1c804c877d199e78e2fecd8c2d3f1e114ce9ec1
2013-01-11 16:32:06 -08:00
Scott LaVarnway
4987c0f07e Initial sse2 version of the wide loopfilters
Updated the rtcd_defs and used the sse2 uv version
of the loopfilter.  The performance improved by ~8%
for the test clip used.

Change-Id: I5a0bca3b6674198d40ca4a77b8cc722ddde79c36
2013-01-11 14:54:14 -08:00