Commit Graph

383 Commits

Author SHA1 Message Date
Christian Duvivier
4418b790a7 Faster vp9_short_fdct16x16.
Scalar path is about 1.5x faster (3.1% overall encoder speedup).
SSE2 path is about 7.2x faster (7.8% overall encoder speedup).

Change-Id: I06da5ad0cdae2488431eabf002b0d898d66d8289
2013-03-15 15:55:31 -07:00
Yaowu Xu
82fe8c9f36 Merge "force lossless coding at very high quality end" into experimental 2013-03-14 19:05:17 -07:00
Yaowu Xu
5d9ba7938e Merge "Remove leftover reference to 2nd order dc/ac quant" into experimental 2013-03-14 19:05:11 -07:00
Yaowu Xu
374a17366e force lossless coding at very high quality end
Change-Id: I75fc4eee10bee9efd419d248827290cce8e6d637
2013-03-14 12:31:27 -07:00
Yaowu Xu
f4d2ad6915 Remove leftover reference to 2nd order dc/ac quant
Change-Id: Ib8dacf1d2797743569771b8f699e40e1aeb085cb
2013-03-14 10:46:15 -07:00
Jingning Han
76c12ab9c9 Support +/-2048 motion vector coding
Enable entropy coding of motion vectors up to +/-2048. Also
extend the motion search range accordingly.

Change-Id: Iac2bb015e8934521cef83a19edbe967d9f097436
2013-03-13 14:08:27 -07:00
Paul Wilkins
a2c6f6e945 Merge "disambiguate superframe index in vp9_stop_encode()" into experimental 2013-03-12 16:00:30 -07:00
John Koleszar
872fc3ded8 disambiguate superframe index in vp9_stop_encode()
If the bool-coded partition naturally ends in a byte that matches the
superframe index marker, it could lead to a parse error. This commit
ensures that if such a marker is seen, it is padded out with an
additional zero byte to disambiguate it.

Change-Id: Id977de05745b6fa9ef08afb71e210a2a3ecca02e
2013-03-12 14:30:23 -07:00
Paul Wilkins
21ba242bfd Merge "Change buffer update rules on ARF overlay." into experimental 2013-03-12 11:07:20 -07:00
Paul Wilkins
49d1425d19 Merge "Changes to maximum gf/arf interval." into experimental 2013-03-12 09:59:43 -07:00
Paul Wilkins
8be3056c45 Change buffer update rules on ARF overlay.
When coding the frame that corresponds to the midpoint frame
defining an ARF, do not update the last reference frame buffer.
Previously this buffer was updated meaning that when coding the next
ARF all the reference buffers were the same (or nearly so).
Turning the update off means that the frame before is still available
as an alternative predictor and for use in compound prediction.

Also fixed inconsistency in test for mismatch (patch from JK).

Net average gains (derf 0.049, yt 0.163, yt-hd 0.207, std-hd 0.286)

Change-Id: Ifee21da21ccbb1648ac2eafe890d3ce60562c7bc
2013-03-12 16:57:39 +00:00
Dmitry Kovalev
ff553ba113 Merge "Code cleanup." into experimental 2013-03-11 17:22:21 -07:00
Dmitry Kovalev
2891d70b23 Code cleanup.
Removing redundant code, introducing new functions for better
decomposition, adding 'clamp' function to vp9_common.h.

Change-Id: Ic3b8ca13bbc38f60f0c9c43910b5802005e31aaf
2013-03-11 17:02:27 -07:00
John Koleszar
a07eb47b25 Merge "Reinitialize motion search tables on frame size change" into experimental 2013-03-11 16:32:03 -07:00
John Koleszar
0a18228274 Merge "Add 'superframe' index" into experimental 2013-03-11 16:31:48 -07:00
Paul Wilkins
08d2c3829a Changes to maximum gf/arf interval.
This patch puts in an adjustment to the maximum gf/arf
interval based on the active q range.  It sets a fixed
baseline maximum of 16 but can drop this down to 12 at
lower q. This required some re-ordering in the first pass
code to insure we have a Q range estimate before defining
the first gf sequence.

The main gains seed are int he STD hd set on 50fps clips
where previously the interval could rise as high as 25.
On the std hd clip the gains are around 2.8% with limit set
to 300 frames.

When combined with the one shot rate control flags we get
combined of:

derf 1.55% (limit300), yt 7.25%, hd 5.17% std-hd 5.84% (limit300)

Change-Id: Ib380d51354511f2ff0f171a8df4e74291c0421f9
2013-03-11 19:25:10 +00:00
John Koleszar
9b4095c537 Fix vp9_tree_probs_from_distribution with CONFIG_CODE_NONZEROCOUNT
The automatic merge result was incomplete.

Change-Id: I8976318bfc346d867660a013a302c80edb25fc29
2013-03-11 11:03:36 -07:00
John Koleszar
e6257342b1 Merge "Optimize vp9_tree_probs_from_distribution" into experimental 2013-03-11 09:32:11 -07:00
John Koleszar
bd84685f78 Optimize vp9_tree_probs_from_distribution
The previous implementation visited each node in the tree multiple times
because it used each symbol's encoding to revisit the branches taken and
increment its count. Instead, we can traverse the tree depth first and
calculate the probabilities and branch counts as we walk back up. The
complexity goes from somewhere between O(nlogn) and O(n^2) (depending on
how balanced the tree is) to O(n).

Only tested one clip (256kbps, CIF), saw 13% decoding perf improvement.

Note that this optimization should port trivially to VP8 as well. In VP8,
the decoder doesn't use this function, but it does routinely show up
on the profile for realtime encoding.

Change-Id: I4f2848e4f41dc9a7694f73f3e75034bce08d1b12
2013-03-10 13:39:30 -07:00
Deb Mukherjee
a28139c849 Continued experiment with nonzero count
Adds probability updates for extra bits for the nzcs, code for
getting nzc stats, plus some minor cleanups and fixes.

Change-Id: If2814e7f04fb52f5025ad9f400f3e6c50a00b543
2013-03-08 16:37:08 -08:00
Ronald S. Bultje
0643c3f133 Merge "Add support for tx_select in i8x8 encoding in keyframes." into experimental 2013-03-08 16:25:27 -08:00
Dmitry Kovalev
3edbc77ae3 Merge "Consistent usage of ROUND_POWER_OF_TWO macro." into experimental 2013-03-08 11:35:22 -08:00
Jingning Han
2a5278bdbd Extend diff MV limit from +/-256 to +/-1024
Increase the motion search range by 4x. Change MV_CLASS tree of the
entropy coding to allow two additional mv classes to cover the
extended motion vector limit. The codec determines the effective
motion search range conditioned on the actual frame dimension.

It provides coding gains:

stdhd 0.39%
yt    0.56%
hd    0.47%

Major coding performance gains are packed in several sequences with
intense motion activities, e.g., ped_1080p gains 7% at high bit-rates,
and on average 3%.

TODO: Need to further tune the rate control and motion search units.

Change-Id: Ib842540a6796fbee5a797809433ef6a477c6d78d
2013-03-08 10:04:36 -08:00
Ronald S. Bultje
b41dee8428 Add support for tx_select in i8x8 encoding in keyframes.
Also enable tx_select for keyframes.

Change-Id: Iadb1231d9fa7af0c8dce3d9b41830b93a302479e
2013-03-08 09:28:46 -08:00
Dmitry Kovalev
3603dfb62c Consistent usage of ROUND_POWER_OF_TWO macro.
Change-Id: I44660975e9985310d8c654c158ee7a61291b5a08
2013-03-07 12:24:35 -08:00
Ronald S. Bultje
d3724abe9f Re-add support for ADST in superblocks.
This also changes the RD search to take account of the correct block
index when searching (this is required for ADST positioning to work
correctly in combination with tx_select).

Change-Id: Ie50d05b3a024a64ecd0b376887aa38ac5f7b6af6
2013-03-07 11:19:10 -08:00
Deb Mukherjee
eb6ef2417f Coding con-zero count rather than EOB for coeffs
This patch revamps the entropy coding of coefficients to code first
a non-zero count per coded block and correspondingly remove the EOB
token from the token set.

STATUS:
Main encode/decode code achieving encode/decode sync - done.
Forward and backward probability updates to the nzcs - done.
Rd costing updates for nzcs - done.
Note: The dynamic progrmaming apporach used in trellis quantization
is not exactly compatible with nzcs. A suboptimal approach has been
used instead where branch costs are updated to account for changes
in the nzcs.

TODO:
Training the default probs/counts for nzcs

Change-Id: I951bc1e22f47885077a7453a09b0493daa77883d
2013-03-07 07:20:30 -08:00
Dmitry Kovalev
a9961fa819 Merge "Code cleanup." into experimental 2013-03-06 16:57:34 -08:00
Paul Wilkins
72a6201050 Merge "Added stricter Q control flag." into experimental 2013-03-06 04:32:22 -08:00
Paul Wilkins
db6ad0138c Added stricter Q control flag.
Added a variant of the one shot maxQ flag
for two pass that forces a fixed Q for the
normal inter frames. Disabled by default.
Also small adjustment to the Bits per MB
estimation.
Change-Id: I87efdfb2d094fe1340ca9ddae37470d7b278c8b8
2013-03-06 12:05:49 +00:00
Dmitry Kovalev
7f99c3c59a Code cleanup.
Removing redundant 'extern' keywords, fixing formatting and #include order,
code simplification.

Change-Id: I0e5fdc8009010f3f885f13b5d76859b9da511758
2013-03-05 14:12:16 -08:00
John Koleszar
522d4bf852 Add 'superframe' index
A 'superframe' is a group of frames that share the same PTS, but have a
defined decoding order. This commit adds the ability to append an index
to such a group of frames, allowing for random access to the constituent
frames. This could be useful for frame-level parallelism or partial
decoding in a multilayer scenario.

Decoding the stream serially without such an index should work as a
fallback, and VP9/TestSuperframeIndexIsOptional verifies that.

Change-Id: Idff83b7560e1a7077d8fb067bfbc45b567e78b1c
2013-03-05 12:45:40 -08:00
Ronald S. Bultje
4209bba462 Merge changes Ifacbf5a0,Ibad7c3dd into experimental
* changes:
  vpxenc: actually report mismatch on stderr.
  Make superblocks independent of macroblock code and data.
2013-03-05 11:17:14 -08:00
Ronald S. Bultje
111ca42133 Make superblocks independent of macroblock code and data.
Split macroblock and superblock tokenization and detokenization
functions and coefficient-related data structs so that the bitstream
layout and related code of superblock coefficients looks less like it's
a hack to fit macroblocks in superblocks.

In addition, unify chroma transform size selection from luma transform
size (i.e. always use the same size, as long as it fits the predictor);
in practice, this means 32x32 and 64x64 superblocks using the 16x16 luma
transform will now use the 16x16 (instead of the 8x8) chroma transform,
and 64x64 superblocks using the 32x32 luma transform will now use the
32x32 (instead of the 16x16) chroma transform.

Lastly, add a trellis optimize function for 32x32 transform blocks.

HD gains about 0.3%, STDHD about 0.15% and derf about 0.1%. There's
a few negative points here and there that I might want to analyze
a little closer.

Change-Id: Ibad7c3ddfe1acfc52771dfc27c03e9783e054430
2013-03-04 16:34:36 -08:00
John Koleszar
daa9b29ea1 Reinitialize motion search tables on frame size change
Make sure the motion search is done with the offsets calculated from
the correct stride.

Change-Id: Ifbcc0f742eda3399c255bfcfa1cdee9a4bb4b4e7
2013-03-04 16:00:01 -08:00
Dmitry Kovalev
49b697d327 Merge "Code cleanup." into experimental 2013-03-04 15:41:15 -08:00
Jingning Han
5957b2b514 Support 16K sequence coding
Fixed a couple of variable/function definitions, as well as header
handling to support 16K sequence coding at high bit-rates.

The width and height are each specified by two bytes in the header.
Use an extra byte to explicitly indicate the scaling factors in
both directions, each ranging from 0 to 15.

Tested coding up to 16400x16400 dimension.

Change-Id: Ibc2225c6036620270f2c0cf5172d1760aaec10ec
2013-03-04 11:08:41 -08:00
John Koleszar
1cfc86ebe0 Add unit test for x4 multi-SAD functions
Update the function prototypes to match between VP9 and VP8.

Change-Id: If58965073989e87df3b62b67a030ec6ce23ca04f
2013-03-01 18:14:02 -08:00
Dmitry Kovalev
135428e954 Code cleanup.
Removing redundant 'extern' keyword, lowercase variable names.

Change-Id: I608e8d8579aba8981f5fac3493f77b4481b13808
2013-03-01 17:39:31 -08:00
John Koleszar
69c67c9531 Merge master branch into experimental
Picks up some build system changes, compiler warning fixes, etc.

Change-Id: I2712f99e653502818a101a72696ad54018152d4e
2013-03-01 11:06:05 -08:00
Yaowu Xu
db4dc6f0c0 Merge "Adjust the max_gf_interval initialization" into experimental 2013-03-01 11:02:23 -08:00
Yaowu Xu
cea8cd08d3 Adjust the max_gf_interval initialization
to be a fixed value of 15.

Test results:
cif:  .124%, .068%, .081%
std-hd: 2.809%, 3.174%, 2.705%

Change-Id: I380c8152c973506094da15eab59e3aa22b75a983
2013-03-01 06:38:35 -08:00
Dmitry Kovalev
852ca19e4b Merge "Code cleanup." into experimental 2013-02-28 17:22:51 -08:00
Dmitry Kovalev
253886413a Merge changes I9be9c990,Ic3b97339 into experimental
* changes:
  Ignoring test video sequences in the source tree.
  Code cleanup.
2013-02-28 16:07:45 -08:00
James Zern
a07bed2b2b firstpass.c: correct casting around gf_group_bits
gf_group_bits is int64_t remove casts to int.

Change-Id: I3b4225905041fac9af9fdfcbcb6f1c357ea4b593
2013-02-28 15:45:29 -08:00
Jim Bankoski
078f5bf439 Merge "mv dct_sse2.c dct_sse2_intrinsics.c to avoid collision" into experimental 2013-02-28 15:16:44 -08:00
Dmitry Kovalev
dcbdda8e15 Code cleanup.
Lower case variable names, converting while loops to for loops.

Change-Id: Ic3b973391eef7472a99d18d02fe79cfef5e04e62
2013-02-28 14:40:20 -08:00
Jim Bankoski
8f270acfb2 mv dct_sse2.c dct_sse2_intrinsics.c to avoid collision
Change-Id: Id786be31da3c91d95d2955aa569ecdc6e66650df
2013-02-28 13:58:15 -08:00
Dmitry Kovalev
0d9cc0a9f0 Code cleanup.
Removing redundant 'extern' keyword, better formatting, code
simplification.

Change-Id: I132fea14f08c706ee9ea147d19464d03f833f25b
2013-02-28 13:18:02 -08:00
John Koleszar
b6a3062d81 Fix incorrect comparison of frame size
The width and height stored in the reference frames are padded out to
a multiple of 16. The Width and Height variables in common are the
displayed size, which may be smaller. The incorrect comparison was
causing scaling related code to be called when it shouldn't have
been. A notable case where this happens is 1080p, since 1088 != 1080.

Change-Id: I55f743eeeeaefbf2e777e193bc9a77ff726e16b5
2013-02-28 11:33:02 -08:00