Commit Graph

103 Commits

Author SHA1 Message Date
Dmitry Kovalev
4ac6a2552b Moving vp9_tree_probs_from_distribution() to encoder.
Writing custom coeff branch count calculation (which is much clearer) in
adapt_coef_probs() function. Removing vp9_treecoder.c file.

Change-Id: I8880fb7a39996c8bcf6cd0acf9898a8c712ba91f
2013-12-05 18:13:26 -08:00
Dmitry Kovalev
377fa8aff8 Renaming PREV_COEF_CONTEXTS to COEFF_CONTEXTS.
Also adding BAND_COEFF_CONTEXTS macro to simplify for loop logic.

Change-Id: I12a78a49cf1addf81e6b3fe2a3736ec2b79bd79e
2013-12-05 17:08:06 -08:00
Dmitry Kovalev
4afd141a05 Removing vp9_default_coef_probs.h file.
Moving all probability tables from removed file to vp9_entropy.c.

Change-Id: I12846f1da778c3016d96b82e53384d4634883430
2013-12-04 17:04:35 -08:00
Dmitry Kovalev
3712b58c2f Merge "Cleaning up vp9_entropy.h file." 2013-12-04 16:46:41 -08:00
Dmitry Kovalev
ff6d6a9f07 Formatting vp9_pareto8_full array.
Change-Id: Ic7f47a8d233daf5e61e82092865837ea4eda4095
2013-12-03 18:49:19 -08:00
Dmitry Kovalev
8e89e2f2e0 Cleaning up vp9_entropy.h file.
Renaming constants for consistency:
  DCT_VAL_CATEGORY1 => CATEGORY1_TOKEN
  DCT_VAL_CATEGORY2 => CATEGORY2_TOKEN
  DCT_VAL_CATEGORY3 => CATEGORY3_TOKEN
  DCT_VAL_CATEGORY4 => CATEGORY4_TOKEN
  DCT_VAL_CATEGORY5 => CATEGORY5_TOKEN
  DCT_VAL_CATEGORY6 => CATEGORY6_TOKEN
  DCT_EOB_TOKEN     => EOB_TOKEN
  DCT_EOB_MODEL_TOKEN => EOB_MODEL_TOKEN
  MAX_ENTROPY_TOKENS => ENTROPY_TOKENS

Moving constants:
  INTER_MODE_CONTEXTS from vp9_entropy.h to vp9_blockd.h.
  EOSB_TOKEN from vp9_entropy.h to vp9_tokenize.h

Change-Id: I5fcbf081318e1d365792b6d290a930c6cb0f3fc2
2013-12-03 17:23:03 -08:00
Dmitry Kovalev
f9da823216 Moving token-encoding related stuff from common to encoder.
Change-Id: I0e59d320407b3bed0ba3622a7b29975f6fad7ebf
2013-11-27 11:27:57 -08:00
Jim Bankoski
5bbb0c6295 Clean up removal of vp9_pareto8 table.
Change-Id: I5556e8d1fc150be8a3e93af21900829b59a500dc
2013-11-20 11:17:26 -08:00
Jim Bankoski
03276bf6e6 remove the model and copy in pack_mb_tokens
Change-Id: I00a5203c8ed76c184d936fccf93d76e7c06773d3
2013-11-20 10:06:04 -08:00
Jim Bankoski
8cf352abac entropy code speedup
Change-Id: Ic316d3374ff9a2b43897272260947d56765a0fdd
2013-11-19 14:31:38 -08:00
Dmitry Kovalev
d8c06d23da Cleaning up vp9_entropy.c file.
Change-Id: I568f5e2d4ef2f2affe013ba1691ffb546f1fe8c6
2013-11-18 17:18:14 -08:00
Deb Mukherjee
cfcd5c4f61 Simplifies band-getting with a static array
Simplifies the code by implementing band mapping with static arrays.
A lot of the code complexity introduced in a previous patch
disappears.

Change-Id: Ia3fac36e594fb5ad2d55ae141c58bba4c55c2d28
2013-11-13 22:15:16 -08:00
Dmitry Kovalev
815189613b Localizing NEARESTMV special cases in the code.
Removing special case handling from vp9_tree_probs_from_distribution(),
tree_merge_probs(), and vp9_tokens_from_tree_offset() functions. Replacing
inter_mode_offset() function with macro INTER_OFFSET which is used now for
vp9_inter_mode_tree definition.

Change-Id: Iff75a1499d460beb949ece543389c8754deaf178
2013-11-05 11:58:57 -08:00
Dmitry Kovalev
df19c6b64c Removing 'new' probability calculation from convert_distribution().
We don't have to calculate 'new' probability in convert_distribution()
because it is enough to calculate only 'new' counters which could be used
to calculate probability if necessary. That's why removing a lot of unused
temporary probability arrays and reducing number of get_binary_prob()
calls.

Change-Id: I4e14eb7203d1ace61bbddefd6b9b6326be83ba63
2013-11-01 15:09:43 -07:00
Dmitry Kovalev
9e66515886 Merge "Using constants instead of plain numbers." 2013-10-16 13:13:04 -07:00
Alexander Voronov
d6a59fb12c Updated encoder to handle intra-only frames
Updated the encoder to handle frames that are coded
intra-only. Intra-only frames must be non-showable,
that is, the "show frame" flag must be set to 0 in
the frame header.

Tested by forcing the ARF frames to be coded intra-
only.

Note: The rate control code will need to be modified
to account for intra-only frames better than they
are currently handled.

Change-Id: I6a9dd5337deddcecc599d3a44a7431909ed21079
2013-10-15 16:44:02 -07:00
Dmitry Kovalev
a97fe89538 Using constants instead of plain numbers.
Replacing
  22 with TREE_SIZE(MAX_ENTROPY_TOKENS)
  12 with MAX_ENTROPY_TOKENS

Change-Id: If24919336e8ace9cf64991bd5ae33fa6656f7b93
2013-10-14 20:33:37 -07:00
Dmitry Kovalev
9a1250e3e0 Merge "Moving all scan/iscan code into separate vp9_scan.{h, c} files." 2013-10-10 10:45:07 -07:00
Dmitry Kovalev
d9d7040e98 Adding const to several pointers.
Change-Id: I7231589bda71d0d23c730283febd5bb58585a0da
2013-10-09 19:46:30 -07:00
Dmitry Kovalev
e3597c6af7 Moving all scan/iscan code into separate vp9_scan.{h, c} files.
Now we have entropy code separate from scan/iscan code. The next step
in future is to move iscan code from common part to the encoder.

Change-Id: Id9732f7d80aec00af35c1d58d1137c4c96c91451
2013-10-07 13:55:56 -07:00
Jim Bankoski
777460329b vp9_entropy.c lint issues
Change-Id: I4e163cc4ce9ec2f3a5a8b9da478049c71b08d71f
2013-09-29 20:29:43 -07:00
Dmitry Kovalev
209c6cbf8f Removing vp9_get_coef_neighbors_handle function.
Change-Id: I6be72c8b048d1ccc7ef43764cf84c32360098970
2013-09-27 14:11:13 -07:00
James Zern
924d74516a consistently name VP9_COMMON variables #1
pc -> cm

Change-Id: If3e83404f574316fdd3b9aace2487b64efdb66f3
2013-08-29 13:25:57 -07:00
Dmitry Kovalev
6a8ec3eac2 General code cleanup.
Removing redundant parenthesis and curly braces. Combining declarations
with initializations. Adding useful intermediate variables instead of
recalculating expressions every time.

Change-Id: I00106f404afd60bfc189905b0fded881684f941a
2013-08-08 21:12:34 -07:00
Dmitry Kovalev
ac008f0030 Removing unneeded intermediate entropy_nodes_adapt var.
Change-Id: I541a178d997b4541e0e2d4d5b854e2ed6b113c3a
2013-08-08 11:52:02 -07:00
Dmitry Kovalev
5b65246a71 Adding missing const to vp9_extra_bits array.
Change-Id: Icd128ab58719e0b9066bdfa66a5d0d427a84d6df
2013-07-31 18:51:18 -07:00
John Koleszar
9c6fafb25b Merge "Remove unnecessary 64 byte alignment" 2013-07-29 15:09:15 -07:00
Dmitry Kovalev
828119d6ab Renaming txfm to tx for consistency in some places.
Change-Id: I2a6a646570e2af66315e7c658d00d99f80c4b127
2013-07-29 14:35:55 -07:00
John Koleszar
a31effca75 Remove unnecessary 64 byte alignment
Fixes a warning on MSVS 2012 where the alignment of vp9_default_iscan_8x8
didn't match between its declaration and definition.

Change-Id: I1466a15635f4b22594d705d570b7e399bfb6cf21
2013-07-29 14:02:02 -07:00
Dmitry Kovalev
7131cb0e3d General cleanups.
Removing unused constants, macros, and function declarations. Using
ROUND_POWER_OF_TWO macro, vp9_zero, vp9_copy where possible. Moving
#include from *.h to *.c. Merging for loops for motion vectors.

Change-Id: Ic3bf841764a2bb177128bb3a6d7aa8f68229cd13
2013-07-25 14:13:48 -07:00
Dmitry Kovalev
40358dc406 Removing duplicated code for merging two probabilities.
Adding common merge_probs and merge_probs2 functions. Changing ints to
usigned ints in some places.

Change-Id: Icf088ffdea7cf5b95284a128916409bdd53506b0
2013-07-24 17:44:04 -07:00
Dmitry Kovalev
fcc34796d2 Removing CONFIG_BALANCED_COEFTREE experiment.
Change-Id: I61a8b0101eac3ee2e0621d56151b90c269fd4db4
2013-07-24 15:53:42 -07:00
Dmitry Kovalev
1099a436d3 Moving counts from FRAME_CONTEXT to new struct FRAME_COUNTS.
Counts are separate from frame context. We have several frame contexts but
need only one copy of all counts.

Change-Id: I5279b0321cb450bbea7049adaa9275306a7cef7d
2013-07-23 17:02:08 -07:00
Dmitry Kovalev
7e703de729 Removing pre probabilities from FRAME_CONTEXT.
Using cm->frame_contexts[cm->frame_context_idx] as source of previous
probabilities.

Change-Id: Ie03778acf0e7bebdc3a1f6a51854d4a0712f24a1
2013-07-19 17:33:10 -07:00
Dmitry Kovalev
ca75f1255f Removing and moving around constant definitions.
Removing unused and duplicated constants, moving them from *.h to *.c
if possible.

Change-Id: Ief4d6b984a3ca2e9b38504f0d855ed072cf7133f
2013-07-15 19:26:30 -07:00
Ronald S. Bultje
26b6318de8 Make get_coef_context() branchless.
This should significantly speedup cost_coeffs(). Basically what the
patch does is to make the neighbour arrays padded by one item to
prevent an eob check in get_coef_context(), then it populates each
col/row scan and left/top edge coefficient with two times the same
neighbour - this prevents a single/double context branch in
get_coef_context(). Lastly, it populates neighbour arrays in pixel
order (rather than scan order), so we don't have to dereference the
scantable to get the correct neighbours.

Total encoding time of first 50 frames of bus (speed 0) at 1500kbps
goes from 2min10.1 to 2min5.3, i.e. a 2.6% overall speed increase.

Change-Id: I42bcd2210fd7bec03767ef0e2945a665b851df56
2013-07-01 16:34:10 -07:00
Ronald S. Bultje
7353ceab9d Quantize (64-bit only, for now) SSSE3 SIMD.
Total encoding time for first 50 frames of bus (speed 0) @ 1500kbps
goes 2min34.8 to 2min14.4, i.e. a 10.4% overall speedup. The code is
x86-64 only, it needs some minor modifications to be 32bit compatible,
because it uses 15 xmm registers, whereas 32bit only has 8.

Change-Id: I2df53770c2e850813ffa713e1a91b45b0082b904
2013-07-01 11:36:07 -07:00
Ronald S. Bultje
d00b8e5f82 Inline vp9_get_coef_context() (and remove vp9_ prefix).
Makes cost_coeffs() a lot faster:
4x4: 236 -> 181 cycles
8x8: 888 -> 588 cycles
16x16: 3550 -> 2483 cycles
32x32: 17392 -> 12010 cycles

Total encode time of first 50 frames of bus (speed 0) @ 1500kbps goes
from 2min51.6 to 2min43.9, i.e. 4.7% overall speedup.

Change-Id: I16b8d595946393c8dc661599550b3f37f5718896
2013-06-28 10:40:21 -07:00
John Koleszar
08b1798ae7 Move vp9_full_to_model_counts to encoder
This function is not called from the decoder, so it doesn't need to be
in common/.

Change-Id: I6977dd462a25b4ff39c9c7e1b0b5b16aa58ee733
2013-06-24 15:46:15 -07:00
John Koleszar
5c32215e27 Remove unused vp9_model_to_full_probs_sb()
This function never referenced.

Change-Id: I1c42cd355bfa88e17d169f7335a44be682af58cc
2013-06-21 15:38:55 -07:00
John Koleszar
0f7a66e962 Remove constant vp9_coef_update_prob table
All elements of this table are equal to 252, so replace it with a
single constant VP9_COEF_UPDATE_PROB.

Change-Id: I1e2d1d284326ce6df9899a740c2fc344b3ec81c9
2013-06-14 15:12:31 -07:00
Adrian Grange
eac344ef10 Implement intra-coded frames
Implements ability to signal and decode frames that are
encoded using only intra coding modes. Only the decode
side has been implemented here.

Change-Id: I53ac6a8d90422cd08ba389e5236e15b45f9e93de
2013-06-10 11:43:16 -07:00
Paul Wilkins
6dd3a6320e Merge "Replace scatter scan 32x32 with HW friendly scan." into experimental 2013-06-03 02:42:37 -07:00
Ronald S. Bultje
e9d68a5e36 Merge all various transform size data trackers into single variables.
Change-Id: I2dfc569106b29fbe4da20585a0e85e5e9ea6a4db
2013-05-31 09:18:59 -07:00
Sami Pietila
5700b4ea42 Replace scatter scan 32x32 with HW friendly scan.
The first 240 coeff positions (15 top-left blocks) are scanned in the
same order as in scatter scan, after that the coeffs are scanned in
"block bands", each band at a time, all coeffs in one band before
moving on to the next band. This brings down the amount of 4x4 coeff
blocks that need to be buffered while scanning, from 15 blocks to 8 blocks.

Change-Id: I478a991d63c48bd5e64d36e59fed7a00c9a651ba
2013-05-30 15:32:46 +03:00
Deb Mukherjee
b8b3f1a46d Balancing coef-tree to reduce bool decodes
This patch changes the coefficient tree to move the EOB to below
the ZERO node in order to save number of bool decodes.

The advantages of moving EOB one step down as opposed to two steps down
in the other parallel patch are: 1. The coef modeling based on
the One-node becomes independent of the tree structure above it, and
2. Fewer conext/counter increases are needed.

The drawback is that the potential savings in bool decodes will be
less, but assuming that 0s are much more predominant than 1's the
potential savings is still likely to be substantial.

Results on derf300: -0.237%

Change-Id: Ie784be13dc98291306b338e8228703a4c2ea2242
2013-05-29 16:25:52 -07:00
Sami Pietila
88a4d4c510 Residual coding to cache energy class of tokens.
Proposal for tuning the residual coding by changing how the context
from previous tokens is calculated. Storing the energy class of previous
tokens instead of the token itself eases the critical path of
HW implementations.

Change-Id: I6d71d856b84518f6c88de771ddd818436f794bab
2013-05-29 15:21:01 +01:00
Deb Mukherjee
d8c0989d56 Clean up related to coefficient modeling
Uses reduced arrays for probabilities and branch counts in the
encoder. No change in bitstream.

Change-Id: Iec605446f44db4cd325eb45fa12a3003a6ee29db
2013-05-28 16:32:03 -07:00
Paul Wilkins
e41fd6e3e2 Fix bug in 4x4 band definition.
Also some unused data structures/references removed.

Change-Id: I295809e887173543e794250cb60ddaf1475ffd24
2013-05-23 17:51:02 -07:00
Paul Wilkins
33ecd6ad54 Merge Scatter Scan experiment.
Removal from under configure flag.
A bit  renaming

Change-Id: I2213229dfe852001dfec16b149f47c52ce88f3aa
2013-05-23 13:09:27 +01:00