Commit Graph

1248 Commits

Author SHA1 Message Date
Jim Bankoski
f42e41f2ef Merge "removed the idct rtcd idct calls" into experimental 2012-11-24 21:38:36 -08:00
Ronald S. Bultje
25b609b62b Move switch(tx_size) around txsize to detokenize.c.
Add a new function vp9_decode_mb_tokens() that handles the switch
between different per-tx-size detokenize functions. Make actual
implementations (vp9_decode_mb_tokens_NxN()) static.

Change-Id: I9e0c4ef410bfa90128a02b472c079a955776816d
2012-11-24 21:22:42 -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
Ronald S. Bultje
9970d8b662 Restructure vp9_decode_mb_tokens_8x8() a bit.
Don't declare variables if they only ever have a single value and are
used only as argument to another function call; instead, just hardcode
the value in the function call directly. Split out UV and Y coefficient
loops for clarity. Use xd->block[].qcoeff instead of xd->qcoeff + magic
to remove use of magic offset variables.

Change-Id: I5b17eda1bb666c69c2b7ea957d5525cd78192e33
2012-11-23 09:43:13 -08:00
Ronald S. Bultje
f090b6b47b Restructure vp9_decode_mb_tokens_16x16() a bit.
Don't declare variables if they only ever have a single value and are
used only as argument to another function call; instead, just hardcode
the value in the function call directly. Also remove unneeded brackets
around a code block, and remove the magic offsets 64 and 256 for chroma
values in the coefficient memory block.

Change-Id: I14fc14120a81ea1d6fb862674e8bf8cf6ba3d114
2012-11-23 09:11:12 -08:00
Ronald S. Bultje
0312c3d6d9 Make get_eob() function static.
Change-Id: Idde3ab97960eda7022367c1f91a873a479bc9d7b
2012-11-23 08:17:06 -08:00
Ronald S. Bultje
4422847143 Rename "block_type" function argument to "txfm_size".
Also fix the type (TX_SIZE instead of int).

Change-Id: Ib9b3f33835e58a6e758ed5f37bb64543e62b6a86
2012-11-23 08:15:00 -08:00
Ronald S. Bultje
a5e542e74b Fix enc/dec mismatch with b_context_pred experiment enabled.
Change-Id: I1272ae3f0fdfb7ed8eb364ef0c6dd1818d3179d7
2012-11-21 12:39:55 -08:00
John Koleszar
414f68d266 Merge "Pack invisible frames without lengths" into experimental 2012-11-20 17:22:50 -08:00
Ronald S. Bultje
5d7cb59035 Assign above/left context in decode_coefs() instead of in caller.
this prevents duplicating the same line of code in each caller of
decode_coefs().

Change-Id: Id7996ad394828bf77ef3d5e03002f577c9f79609
2012-11-17 11:22:38 -08:00
Ronald S. Bultje
3bdf302ce7 Remove unused argument from decode_coefs() function prototype.
Change-Id: I8d2539ba1046012c948520ac23a1f1978be921c5
2012-11-17 11:11:06 -08:00
Ronald S. Bultje
a253b3791b Remove coef_bands_x[] array and related machinery in decode_coefs().
Change-Id: I0a36d1efb3bb81a54005b10316550ec67100559e
2012-11-17 11:07:23 -08:00
Ronald S. Bultje
511ef2072c Inline count_tokens() in decode_coefs().
This prevents the relatively expensive token-from-coefficient lookup
function get_token(), plus a duplicate loop..

Change-Id: Ibecd407b2a91d3593d439ec4646e43fa26d2ff91
2012-11-17 10:35:47 -08:00
Ronald S. Bultje
56352f189d Merge various count_token() functions into a single one.
Change-Id: I1970f43e2cb5f7d9744c7249099eed226f16f162
2012-11-17 10:18:41 -08:00
Ronald S. Bultje
166d24d07e Remove unused function count_tokens() in detokenize.c.
Change-Id: I178f250b1a4d41d5a9c1619091f5ae51cebffb10
2012-11-17 07:45:46 -08:00
Ronald S. Bultje
f19a1cafed Remove special-case inline detokenization in b_pred reconstruction.
Just like for all other block modes, b_pred tokens can be read together
before starting macroblock reconstruction. This removes special cases
for b_pred in decode_macroblock() and allows to make decode_coefs_4x4()
static in detokenize.c.

While at it, remove the redundant handling and checking of plane_type
and block_index (i) in decode_coefs_4x4(). Since the function is static,
and is called only from decode_mb_tokens_4x4(), we don't need to worry
that the arguments ever go out of sync.

Change-Id: I2d415da0b51b89d0490a6b9e24cc86363c2090f7
2012-11-16 22:26:12 -08:00
Yunqing Wang
0eb5590425 Merge "Add const before the dequant(dq)" into experimental 2012-11-16 12:35:17 -08:00
Yunqing Wang
4c7c15ee69 Merge "Optimize 8x8 dequant and idct" into experimental 2012-11-16 12:23:06 -08:00
Yunqing Wang
47d9d48fa4 Add const before the dequant(dq)
Modified code to use const before dq.

Change-Id: I6fa59c2ed9743ded33ad08df70e15c2fe1ae7b99
2012-11-16 12:13:13 -08:00
Ronald S. Bultje
5b11052ac1 Support 32x32 intra modes in non-keyframe superblocks.
Change-Id: Icf8ad313c543462e523bff89690e5daa8d49bcc0
2012-11-16 09:54:43 -08:00
Paul Wilkins
a57dbd957b Further experimentation with the mode context
Experiments with a larger set of contexts and some
clean up to replace magic numbers regarding the
number of contexts.

The starting values and rate of backwards adaption
are still suspect and based on a small set of tests.
Added forwards adjustment of probabilities.

The net result of adding the new context and forward
update is small compared to the old context from the
legacy find_near function.  (down a little on derf but
up by a similar amount for HD)

HOWEVER.... with the new context and forward update
the impact of disabling the reverse update (which may be
necessary in some use cases to facilitate parallel decoding)
is hugely reduced.

For the old context without forward update, the impact of
turning off reverse update (Experiment was with SB off) was
Derf - 0.9, Yt -1.89, ythd -2.75 and sthd -8.35. The impact was
mainly at low data rates.

With the new context and forward update enabled the impact
for all the test sets was no more than 0.5-1% (again most at
the low end).

Change-Id: Ic751b414c8ce7f7f3ebc6f19a741d774d2b4b556
2012-11-16 16:58:00 +00:00
John Koleszar
6bca6decbf Merge "Don't write recon.yuv by default" into experimental 2012-11-16 08:41:40 -08:00
Deb Mukherjee
cb2d06ceac Merge "Compound inter-intra experiment" into experimental 2012-11-16 08:30:34 -08:00
Deb Mukherjee
0c917fc975 Compound inter-intra experiment
A patch on compound inter-intra prediction.

In compound inter-intra prediction, a new predictor for
16x16 inter coded MBs are obtained by combining a single
inter predictor with a 16x16 intra predictor, in a manner
that the weight varies with distance from the top/left
boundary. The current search strategy is to combine the best
inter mode with the best intra mode obtained independently.

Results so far:

derf +0.31%
yt +0.32%
std-hd +0.35%
hd +0.42%

It is conceivable that the results would improve somewhat
with a more thorough search strategy where all intra modes
are searched given the best mv, or even a joint search for
the best mv and the best intra mode.

Change-Id: I7951f1ed0d6eb31ca32ac24d120f1585bcd8d79b
2012-11-16 06:56:29 -08:00
John Koleszar
64bcffc1ec Pack invisible frames without lengths
Modify the decoder to return the ending position of the bool decoder and
use that as the starting position for the next frame.

The constant-space algorithm for parsing the appended frame lengths is
O(n^2), which is a potential DoS concern if n is unbounded. Revisit
the appended lengths for use as partition lengths when multipartition
support is added.

In addition, this allows decoding of raw streams outside of a container
without additional framing information, though it's insufficient to
be able to remux said stream into a container.

Change-Id: I71e801a9c3e37abe559a56a597635b0cbae1934b
2012-11-15 15:48:07 -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
6becad426c detokenize: use SEG_LVL_EOB feature consistently
Update decode_coefs() to break when c >= eob, since it's possible that
c starts the loop from 1 and eob is 0. The loop won't terminate in that
case.

Add new get_eob() function to consistently clamp the eob based on the
segment level EOB and the block size. It's possible to code a segment
level EOB that's greater than the block size, and that leads to an
out of bounds access.

Change-Id: I859563b30414615cf1b30dcc2aef8a1de358c42d
2012-11-15 11:44:29 +00:00
pascal massimino
5a955973d9 Merge changes I63348ae3,I658ea409 into experimental
* changes:
  Segment mode coding bug.
  Silenced a few warnings.
2012-11-15 00:24:57 -08:00
Paul Wilkins
19a1ba1e91 Silenced a few warnings.
Silenced a few VS compiler warnings.

Change-Id: I658ea409c36c05cd11042675e2e42ccde0ef2420
2012-11-14 14:27:37 +00:00
John Koleszar
854e41f057 Don't write recon.yuv by default
CONFIG_DEBUG was turning on some code to dump the reconstructed frame
to a buffer from within the decoder. Move this code to a more specific
debugging define.

Change-Id: I3ca9ea634bdbd186f2470bd644d3695ee0ab3037
2012-11-13 15:22:35 -08:00
John Koleszar
6d482706ef SEG_LVL_MODE: don't code ref_frame if it's implicit
If the SEG_LVL_MODE is an intra mode, then the reference frame must be
INTRA_FRAME.

Change-Id: I2cdeeac3780c077c74b39ce89a528bc280674231
2012-11-13 15:22:09 -08:00
Yunqing Wang
e60478d46d Optimize 8x8 dequant and idct
Similar to 16x16 dequant and idct, based on the value of eobs, the
8x8 dequant and idct calculation was simplified to improve decorder
performance.

Combined vp9_dequant_idct_add_8x8 and vp9_dequant_dc_idct_add_8x8
to eliminate duplicate code.

Change-Id: Ia58e50ab27f7012b7379c495837c9c0b5ba9cf7f
2012-11-12 17:41:53 -08:00
Ronald S. Bultje
722972454c Fix edge MV handling in SBs.
Change-Id: Ia1eddb108ec463835e9de8769572d698e21bca49
2012-11-12 17:06:52 -08:00
Paul Wilkins
5d65614fdd Merge "New inter mode context" into experimental 2012-11-12 09:24:14 -08:00
Paul Wilkins
2669f42b0d New inter mode context
This change is a fix / extension of the newbestrefmv
experiment. As such it is presented without IFDEF.

The change creates a new context for coding inter modes
in vp9_find_mv_refs(). This replaces the context that
was previously calculated in vp9_find_near_mvs().
The new context is unoptimized and not necessarily
any better at this stage (results pending), but eliminates
the need for a legacy call to vp9_find_near_mvs().
Based on numbers from Scott, this could help decode
speed by several %.

In a later patch I will add support for forward update of
context (assuming this helps) and refine the context as
necessary.

Change-Id: I1cd991b82c8df86cc02237a34185e6d67510698a
2012-11-12 15:50:02 +00:00
Ronald S. Bultje
dd9d4f9e1a Fix data type for eobs[] array in SB 4x4 IDCT code.
This fixes encoder/decoder mismatches with the superblock experiment
turned on whenever a superblock is encoded using the 4x4 transform.

Change-Id: Iefec7055e8d25f8efdbba66c4261bbd322d335a3
2012-11-10 12:08:27 -08:00
Deb Mukherjee
d01357bbad New b-intra mode where direction is contextual
Preliminary patch on a new 4x4 intra mode B_CONTEXT_PRED where the
dominant direction from the context is used to encode. Various decoder
changes are needed to support decoding of B_CONTEXT_PRED in conjunction
with hybrid transforms since the scan order and tokenization depends on
the actual direction of prediction obtained from the context. Currently
the traditional directional modes are used in conjunction with the
B_CONTEXT_PRED, which also seems to provide the best results.

The gains are small - in the 0.1% range.

Change-Id: I5a7ea80b5218f42a9c0dfb42d3f79a68c7f0cdc2
2012-11-10 07:12:30 -08:00
Deb Mukherjee
3f7182cb0d Build fix in decoder/decodframe.c
Missing eobs agrument in vp9_dequant_idct_add_16x16_c

Change-Id: I826b1afa0a4ee6398f7373325aa0c75e6a866937
2012-11-09 12:48:35 -08:00
Yunqing Wang
71b1885403 Merge "Optimize 16x16 dequant and idct" into experimental 2012-11-09 08:30:53 -08:00
Ronald S. Bultje
1d4fbeb32a Implement tx_select for superblock encoding.
Also split superblock handling code out of decode_macroblock() into
a new function decode_superblock(), for easier readability.

Derf +0.05%, HD +0.2%, STDHD +0.1%. We can likely get further gains
by allowing to select mb_skip_coeff for a subset of the complete SB
or something along those lines, because although this change allows
coding smaller transforms for bigger predictors, it increases the
overhead of coding EOBs to skip the parts where the residual is
near-zero, and thus the overall gain is not as high as we'd expect.

Change-Id: I552ce1286487267f504e3090b683e15515791efa
2012-11-08 11:03:00 -08:00
Yunqing Wang
6c17c9fae0 Optimize 16x16 dequant and idct
As suggested by Yaowu, simplified 16x16 dequant and idct. In decoder,
after detoken step, we know the number of non-zero dct coefficients
(eobs) in a macroblock. Idct calculation can be skipped or simplified
based on eobs, which improves the decoder performance.

Change-Id: I9ffa1cb134bcb5a7d64fcf90c81871a96d1b4018
2012-11-07 20:04:09 -08:00
Yaowu Xu
0cedaa3631 merge full pixel refmv experiment
Change-Id: Ib39ad47a7d188f3b45416937b7eeb28c3e79b74c
2012-11-07 10:52:45 -08:00
Yaowu Xu
8a336b0d0d silent a lot of MSVC compiler warnings
there are still a couple type of warning left, which are related to
double constants assigned to float type. As those would be addressed
by the conversion of transforms into integer version. This commit
has left those un-dealt with.

Change-Id: I48fd9b489c0c27ad6b543f4177423419f929f2bb
2012-11-06 09:09:25 -08:00
Yunqing Wang
28826a913c Merge "Fix eobs data type" into experimental 2012-11-02 16:00:56 -07:00
Yunqing Wang
d41b0e6498 Fix eobs data type
The block sizes for decoding tokens are up to 16x16, which means
eobs is within [0, 256]. Using (signed) char is not enough. Changed
eobs data type to unsigned short to fix the problem.

Change-Id: I88a7d3098e1f1604c336d6adb88ffec971fb03a6
2012-11-02 13:22:29 -07:00
Ronald S. Bultje
3c4f47e843 Place non-static function prototypes in a header file.
Change-Id: I7cd21b9f1e69f4e0b3338bfe27b3c67e4b47de58
2012-11-02 11:22:57 -07:00
John Koleszar
06f3e51da6 vpx_scale: sync from master
Update vpx_scale from current code in master, run style transform, fix
lint warnings.

Change-Id: I47eadeb5b6881d448ea3728537f9b8a5b5aac78e
2012-11-02 08:44:54 -07:00
Ronald S. Bultje
4b2c2b9aa4 Rename vp8/ codec directory to vp9/.
Change-Id: Ic084c475844b24092a433ab88138cf58af3abbe4
2012-11-01 16:31:22 -07:00