summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_entropy.h
AgeCommit message (Collapse)Author
2013-06-21Remove unused vp9_model_to_full_probs_sb()John Koleszar
This function never referenced. Change-Id: I1c42cd355bfa88e17d169f7335a44be682af58cc
2013-06-14Remove constant vp9_coef_update_prob tableJohn Koleszar
All elements of this table are equal to 252, so replace it with a single constant VP9_COEF_UPDATE_PROB. Change-Id: I1e2d1d284326ce6df9899a740c2fc344b3ec81c9
2013-05-29Balancing coef-tree to reduce bool decodesDeb Mukherjee
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-28Clean up related to coefficient modelingDeb Mukherjee
Uses reduced arrays for probabilities and branch counts in the encoder. No change in bitstream. Change-Id: Iec605446f44db4cd325eb45fa12a3003a6ee29db
2013-05-23Fix bug in 4x4 band definition.Paul Wilkins
Also some unused data structures/references removed. Change-Id: I295809e887173543e794250cb60ddaf1475ffd24
2013-05-23Merge Scatter Scan experiment.Paul Wilkins
Removal from under configure flag. A bit renaming Change-Id: I2213229dfe852001dfec16b149f47c52ce88f3aa
2013-05-22Using 128 entry look up table for coef modelsDeb Mukherjee
Reverts to using 128 bit LUT for the coef models rather than 48 to ease hardware implementation. Also incorporates some cleanups including removing various hooks to support different lookup tables based on block_type and ref_type. Change-Id: I54100c120cca07a2ebd3a7776bc4630fa6a153f6
2013-05-21Merging the model coef prob experimentDeb Mukherjee
Merges the experiment. Change-Id: I4eb19af6de6df6aa3a96a2e82f231d47ed9b3ae9
2013-05-21Refinements on modelcoef expt to reduce storageDeb Mukherjee
Uses more aggrerssive interpolation to reduce storage for the model tables by almost more than half. Only 48 lists of probs are stored (as opposed to 128 before), corresponding to ONE_NODE probabilities of: 1, 3, 7, 11, ..., 115, 119, 127, 135, ..., 247, 255. Besides, only 1 table is used as opposed to 2 before. So the overall memory needed for the tables is just 48 * 8 = 384 bytes. The table currently used is based on a new Pareto distribution with heavier tail than a generalized Gaussian - which improves results on derf by about 0.1% over a single table Generaized Gaussian. Results overall on derfraw300 is -0.14%. Change-Id: I19bd03559cbf5894a9f8594b8023dcc3e546f6bd
2013-05-20Updating the model coef experimentDeb Mukherjee
Cleans up the experiment. Actually uses reduced counts for backward updates, and reduced number of probabilities in the context. No change in bitstream when the experiment is on. Between expt on and off: derfraw300 is down only -0.062% (which is better than when expts were run previously). Change-Id: I55285a049a0c22810bdb42914212ab5a4f8521b5
2013-05-13Change to band calculation.Paul Wilkins
Change band calculation back to simpler model based on the order in which coefficients are coded in scan order not the absolute coefficient positions. With the scatter scan experiment enabled the results were appear broadly neutral on derf (-0.028) but up a little on std-hd +0.134). Without the scatterscan experiment on the results were up derf as well. Change-Id: Ie9ef03ce42a6b24b849a4bebe950d4a5dffa6791
2013-05-08Merge "Removing unused code + little cleanup." into experimentalDmitry Kovalev
2013-05-07Removing unused code + little cleanup.Dmitry Kovalev
Change-Id: I81c19a8f19cfb5c7183609656ade833d72feb500
2013-05-07Deprecate code_zerogroup experiment.Paul Wilkins
Delete code under the CONFIG_CODE_ZEROGROUP flag. Change-Id: I5fe6c7b42a5da9b73118e33594301da4129f320a
2013-04-29Merge "Change above/left_context to use an 8x8 basis." into experimentalRonald S. Bultje
2013-04-29Change above/left_context to use an 8x8 basis.Ronald S. Bultje
Output changes slightly because of a minor bug in (at least) the sb32x16 block2above tx16x16 tables that previously existed in vp9_blockd.c. Change-Id: I624af28ac200a8322d64454cf05c79e9502968cc
2013-04-29Turning model based reverse update on for coefsDeb Mukherjee
Turns model based reverse updates on for coefficients in an effort to reduce the memory requirement for counters. With this patch the counters needed will be reduced by about 75% since only 3 counts are needed instead of 12. The impact in performance is: derf300: -0.252% stdhd250: -0.046% However retraining should alleviate some of the drop in performance. Change-Id: I6f2b3e13f6d5520aa3400b0b228fb5e8b4a43caa
2013-04-26Grow MODE_INFO array to use an 8x8 basis.Ronald S. Bultje
Change-Id: I087e08e7909a406b71715b8525c104208daa6889
2013-04-22Adding get_scan_{4x4, 8x8, 16x16} functions.Dmitry Kovalev
Change-Id: Id4306ef6d65d4a3984aed50b775bdf48d4f6c438
2013-04-22Removes the code_nonzerocount experimentDeb Mukherjee
This patch does not seem to give any benefits. Change-Id: I9d2b4091d6af3dfc0875f24db86c01e2de57f8db
2013-04-22End of orientation zero group experimentDeb Mukherjee
Adds an experiment that codes an end-of-orientation symbol for every eligible zero encountered in scan order. This cleans out various other sub-experiments that were part of the origiinal patch, which will be later included if found useful. Results are slightly positive on all sets (0.1 - 0.2% range). Change-Id: I57765c605fefc7fb9d1b57f1b356843602abefaf
2013-04-19Renaming vp9_extra_bit_struct to vp9_extra_bit.Dmitry Kovalev
Change-Id: Ie4713da125e954c1d30e1d4cbeb38666fce90ccc
2013-04-14Merge "Renaming vp9_token_struct to vp9_token and removing previous ↵Dmitry Kovalev
typedef." into experimental
2013-04-11Turning model-based updates on with modelcoefprobDeb Mukherjee
This patch changes the default with the modecoefprob expt to use mode-based forward updates with one-node pegged modeling. The maximum difference with fully trained tables is now less that 0.1%. Change-Id: I06b44322e10c6703f93f3c1d48d973b1136a0618
2013-04-11Renaming vp9_token_struct to vp9_token and removing previous typedef.Dmitry Kovalev
Change-Id: If69c3d795f87af5cc7bfdfe70ef733c41b4d55c8
2013-04-11Remove vp9_reset_mb_tokens_contextJohn Koleszar
Use sb-common version instead. Change-Id: If2552b5a39fd2e5272f66a41c5667dda85fd3939
2013-04-09Make SB coding size-independent.Ronald S. Bultje
Merge sb32x32 and sb64x64 functions; allow for rectangular sizes. Code gives identical encoder results before and after. There are a few macros for rectangular block sizes under the sbsegment experiment; this experiment is not yet functional and should not yet be used. Change-Id: I71f93b5d2a1596e99a6f01f29c3f0a456694d728
2013-03-26Add col/row-based coefficient scanning patterns for 1D 8x8/16x16 ADSTs.Ronald S. Bultje
These are mostly just for experimental purposes. I saw small gains (in the 0.1% range) when playing with this on derf. Change-Id: Ib21eed477bbb46bddcd73b21c5c708a5b46abedc
2013-03-26Redo banding for all transforms.Ronald S. Bultje
Now that the first AC coefficient in both directions use the same DC as their context, there no longer is a purpose in letting both have their own band. Merging these two bands allows us to split bands for some of the very high-frequency AC bands. In addition, I'm redoing the banding for the 1D-ADST col/row scans. I don't think the old banding made any sense at all (it merged the last coefficient of the first row/col in the same band as the first two of the second row/col), which was clearly an oversight from the band being applied in scan-order (rather than in their actual position). Now, coefficients at the same position will be in the same band, regardless what scan order is used. I think this makes most sense for the purpose of banding, which is basically "predict energy for this coefficient depending on the energy of context coefficients" (i.e. pt). After full re-training, together with previous patch, derf gains about 1.2-1.3%, and hd/stdhd gain about 0.9-1.0%. Change-Id: I7a0cc12ba724e88b278034113cb4adaaebf87e0c
2013-03-26Use above/left (instead of previous in scan-order) as token context.Ronald S. Bultje
Pearson correlation for above or left is significantly higher than for previous-in-scan-order (absolute values depend on position in scan, but in general, we gain about 0.1-0.2 by using either above or left; using both basically just makes this even better). For eob branch skipping, we continue to use the previous token in scan order. This helps about 0.9% on derf after re-training on a limited data set. Full re-training and results on larger-resolution clips are pending. Note that this commit breaks trellis, so we can probably get further gains out of it by fixing trellis at some later point. Change-Id: Iead68e296fc3a105cca746b5e3da9555d6010cfe
2013-03-25Modeling default coef probs with distributionDeb Mukherjee
Replaces the default tables for single coefficient magnitudes with those obtained from an appropriate distribution. The EOB node is left unchanged. The model is represeted as a 256-size codebook where the index corresponds to the probability of the Zero or the One node. Two variations are implemented corresponding to whether the Zero node or the One-node is used as the peg. The main advantage is that the default prob tables will become considerably smaller and manageable. Besides there is substantially less risk of over-fitting for a training set. Various distributions are tried and the one that gives the best results is the family of Generalized Gaussian distributions with shape parameter 0.75. The results are within about 0.2% of fully trained tables for the Zero peg variant, and within 0.1% of the One peg variant. The forward updates are optionally (controlled by a macro) model-based, i.e. restricted to only convey probabilities from the codebook. Backward updates can also be optionally (controlled by another macro) model-based, but is turned off by default. Currently model-based forward updates work about the same as unconstrained updates, but there is a drop in performance with backward-updates being model based. The model based approach also allows the probabilities for the key frames to be adjusted from the defaults based on the base_qindex of the frame. Currently the adjustment function is a placeholder that adjusts the prob of EOB and Zero node from the nominal one at higher quality (lower qindex) or lower quality (higher qindex) ends of the range. The rest of the probabilities are then derived based on the model from the adjusted prob of zero. Change-Id: Iae050f3cbcc6d8b3f204e8dc395ae47b3b2192c9
2013-03-12Merge "Fix typo in comment for number of extra bits for cat6 tokens." into ↵Ronald S. Bultje
experimental
2013-03-12Fix typo in comment for number of extra bits for cat6 tokens.Ronald S. Bultje
Change-Id: I07ddf3be8bc5d6c2eb561d4241879777c315b183
2013-03-08Continued experiment with nonzero countDeb Mukherjee
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-07Coding con-zero count rather than EOB for coeffsDeb Mukherjee
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-04Make superblocks independent of macroblock code and data.Ronald S. Bultje
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-02-23Split coefficient token tables intra vs. inter.Ronald S. Bultje
Change-Id: I5416455f8f129ca0f450d00e48358d2012605072
2013-02-23Further changes to coefficient contexts.Paul Wilkins
This patch alters the balance of context between the coefficient bands (reflecting the position of coefficients within a transform blocks) and the energy of the previous token (or tokens) within a block. In this case the number of coefficient bands is reduced but more previous token energy bands are supported. Some initial rebalancing of the default tables has been by running multiple derf clips at multiple data rates using the ENTOPY_STATS macro. Further balancing needs to be done using larger image formatsd especially in regard to the bigger transform sizes which are not as well represented in encodings of smaller image formats. Change-Id: If9736e95c391e711b04aef6393d26f60f36e1f8a
2013-02-15Remove Y2 and Y-no-DC token types from the bitstream.Ronald S. Bultje
Change-Id: I7a5314daca993d46b8666ba1ec2ff3766c1e5042
2013-02-14Moved vp9_get_coef_band to header fileScott LaVarnway
allowing the compiler to inline. Change-Id: I66e5caf5e7fefa68a223ff0603aa3f9e11e35dbb
2013-02-13Abstract selection of coef band.Paul Wilkins
This patch abstracts the selection of the coefficient band context into a function as a precursor to further experiments with the coefficient context. It also removes the large per TX size coefficient band structures and uses a single matrix for all block sizes within the test function. This may have an impact on quality (results to follow) but is only an intermediate step in the process of redefining the context. Also the quality impact will be larger initially because the default tables will be out of step with the new banding. In particular the 4x4 will in this case only use 7 bands. If needed we can add back block size dependency localized within the function, but this can follow on after the other changes to the definition of the context. Change-Id: Id7009c2f4f9bb1d02b861af85fd8223d4285bde5
2013-02-13Abstract the selection of coefficient context.Paul Wilkins
This is an initial step to facilitate experimentation with changes to the prior token context used to code coefficients to take better account of the energy of preceding tokens. This patch merely abstracts the selection of context into two functions and does not alter the output. Change-Id: I117fff0b49c61da83aed641e36620442f86def86
2013-02-13Remove NEWCOEFCONTEXT experiment.Paul Wilkins
Removal of the NEWCOEFCONTEXT experiment to reduce code clutter and make it easier to experiment with some other changes to the coefficient coding context. Change-Id: Icd17b421384c354df6117cc714747647c5eb7e98
2013-01-10Merge tx32x32 experiment.Ronald S. Bultje
Change-Id: I615651e4c7b09e576a341ad425cf80c393637833
2013-01-08Merge superblocks (32x32) experiment.Ronald S. Bultje
Change-Id: I0df99742029834a85c4933652b0587cf5b6b2587
2012-12-19New previous coef context experimentDeb Mukherjee
Adds an experiment to derive the previous context of a coefficient not just from the previous coefficient in the scan order but from a combination of several neighboring coefficients previously encountered in scan order. A precomputed table of neighbors for each location for each scan type and block size is used. Currently 5 neighbors are used. Results are about 0.2% positive using a strategy where the max coef magnitude from the 5 neigbors is used to derive the context. Change-Id: Ie708b54d8e1898af742846ce2d1e2b0d89fd4ad5
2012-12-18Use standard integer types for pixel values and coefficients.Ronald S. Bultje
For coefficients, use int16_t (instead of short); for pixel values in 16-bit intermediates, use uint16_t (instead of unsigned short); for all others, use uint8_t (instead of unsigned char). Change-Id: I3619cd9abf106c3742eccc2e2f5e89a62774f7da
2012-12-18Give 4x4 scan and coef_band tables a _4x4 suffix.Ronald S. Bultje
This matches the names of tables for all other transform sizes. Change-Id: Ia7681b7f8d34c97c27b0eb0e34d490cd0f8d02c6
2012-12-07experiment with CONTEXT conversionYaowu Xu
This commit changed the ENTROPY_CONTEXT conversion between MBs that have different transform sizes. In additioin, this commit also did a number of cleanup/bug fix: 1. removed duplicate function vp9_fix_contexts() and changed to use vp8_reset_mb_token_contexts() for both encoder and decoder 2. fixed a bug in stuff_mb_16x16 where wrong context was used for the UV. 3. changed reset all context to 0 if a MB is skipped to simplify the logic. Change-Id: I7bc57a5fb6dbf1f85eac1543daaeb3a61633275c
2012-12-07Introduce vp9_coeff_probs/counts/stats/accum types.Ronald S. Bultje
Use these, instead of the 4/5-dimensional arrays, to hold statistics, counts, accumulations and probabilities for coefficient tokens. This commit also re-allows ENTROPY_STATS to compile. Change-Id: If441ffac936f52a3af91d8f2922ea8a0ceabdaa5