summaryrefslogtreecommitdiff
path: root/vp8/encoder/onyx_int.h
AgeCommit message (Collapse)Author
2012-10-15Add a new token stuffing function vp8_stuff_mb().Ronald S. Bultje
This way a caller doesn't need to implement the logic for which (and how many) tokens to write out to stuff one macroblock worth of EOBs. Make the actual function implementations static, since they are now only used in tokenize.c; also do some minor stylistic changes so it follows the style guide a little more closely; use PLANE_TYPE where appropriate, remove old (stale) frame_type function arguments; hardcode plane type where only a single one is possible (2nd order DC or U/V EOB stuffing); support stuffing 8x8/4x4 transform EOBs with no 2nd order DC. Change-Id: Ia448e251d19a4e3182eddeb9edd034bd7dc16fa3
2012-10-11Use transform-size selection for i8x8_pred also.Ronald S. Bultje
Change-Id: Iecb282fc89f9b5145ef31c5eda294ad42bc32a5d
2012-10-10Merge of the TX_16X16 experimentDeb Mukherjee
Change-Id: I22aa803ffff330622cdb77277e7b196a9766f882
2012-10-09Selectable transform size try 2.Ronald S. Bultje
Results: derf (vanilla or +hybridtx) +0.2% and (+hybrid16x16 or +tx16x16) +0.7%-0.8%; HD (vanilla or +hybridtx) +0.1-0.2% and (+hybrid16x16 or +tx16x16) +1.4%, STD/HD (vanilla or +hybridtx) about even, and (+hybrid16x16 or +tx16x16) +0.8-1.0%. Change-Id: I03899e2f7a64e725a863f32e55366035ba77aa62
2012-09-27Entropy coding for hybrid transformDeb Mukherjee
Separates the entropy coding context models for 4x4, 8x8 and 16x16 ADST variants. There is a small improvement for HD (hd/std-hd) by about 0.1-0.2%. Results on derf/yt are about the same, probably because there is not enough statistics. Results may improve somewhat once the initial probability tables are updated for the hybrid transforms which is coming soon. Change-Id: Ic7c0c62dacc68ef551054fdb575be8b8507d32a8
2012-09-07Partial merge of NEWBESTREFMV and NEW_MVREF.Paul Wilkins
This commit merges those parts of the CONFIG_NEW_MVREF that specifically relate to choosing a better set of candidate MV references into the NEWBESTREFMV experiment. CONFIG_NEW_MVREF will then be used for changes relating to the explicit coding of a cost optimized MV reference in the bitstream as part of MV coding. Change-Id: Ied982c0ad72093eab29e38b8cd74d5c3d7458b10
2012-09-06New motion vector entropy codingDeb Mukherjee
Adds a new experiment with redesigned/refactored motion vector entropy coding. The patch also takes a first step towards separating the integer and fractional pel components of a MV. However the fractional pel encoding still depends on the integer pel part and so they are not fully independent. Further experiments are in progress to see how much they can be decoupled without affecting performance. All components including entropy coding/decoding, costing for MV search, forward updates and backward updates to probability tables, have been implemented. Results so far: derf: +0.19% std-hd: +0.28% yt: +0.80% hd: +1.15% Patch: Simplifies the fractional pel models: derf: +0.284% std-hd: +0.289% yt: +0.849% hd: +1.254% Patch: Some changes in the models, rebased. derf: +0.330% std-hd: +0.306% yt: +0.816% hd: +1.225% Change-Id: I646b3c48f3587f4cc909639b78c3798da6402678
2012-08-30hybrid transform of 16x16 dimensionJingning Han
Enable ADST/DCT of dimension 16x16 for I16X16 modes. This change provides benefits mostly for hd sequences. Set up the framework for selectable transform dimension. Also allowing quantization parameter threshold to control the use of hybrid transform (This is currently disabled by setting threshold always above the quantization parameter. Adaptive thresholding can be built upon this, which will further improve the coding performance.) The coding performance gains (with respect to the codec that has all other configuration settings turned on) are derf: 0.013 yt: 0.086 hd: 0.198 std-hd: 0.501 Change-Id: Ibb4263a61fc74e0b3c345f54d73e8c73552bf926
2012-08-24New Motion Reference SearchPaul Wilkins
Alternative strategy for finding a list of candidate motion vectors to use as reference values in mv coding and as nearest and near. Sort by sad in vp8_find_best_ref_mvs() rather than just pick the best. Allow 0,0 as a best ref option but not a nearest or near unless there are no alternatives. Encode/Decode verified on at least some clips. Some commented out experimental and stats code still in place. Gain over existing code averages about 1% on derf (alll metrics) with improvement on all clips. Other test results pending. The entropy coding of the mode (nearest/near etc) still depends upon and requires the old "findnear" code so this needs looking at and may provide room for further gains. Change-Id: I871d7cba1d1c379c4bad9bcccce1fb19c46b8247
2012-08-20Superblock coding.Ronald S. Bultje
This commit adds a pick_sb_mode() function which selects the best 32x32 superblock coding mode. Then it selects the best per-MB modes, compares the two and encodes that in the bitstream. The bitstream coding is rather simplistic right now. At the SB level, we code a bit to indicate whether this block uses SB-coding (32x32 prediction) or MB-coding (anything else), and then we follow with the actual modes. This could and should be modified in the future, but is omitted from this commit because it will likely involve reorganizing much more code rather than just adding SB coding, so it's better to let that be judged on its own merits. Gains on derf: about even, YT/HD: +0.75%, STD/HD: +1.5%. Change-Id: Iae313a7cbd8f75b3c66d04a68b991cb096eaaba6
2012-08-10extend the range of encoding timeYaowu Xu
The commit also corrects unit of encoding from microsecond to milisecond. Change-Id: I030108e90f89f33dfad2d092dc8991db81979715
2012-08-10Refactor to remove some arguments from vp8_rd_pick_inter_modeDaniel Kang
Change-Id: I8e72279cc68f34d269705f06cdaf8f3d06eed635
2012-08-07a new way of determining reference motion vectorYaowu Xu
Using surrounding reconstructed pixels from left and above to select best matching mv to use as reference motion vector for mv encoding. Test results: AVGPSNR GLBPSNR VPXSSIM Derf: 1.107% 1.062% 0.992% Std-hd:1.209% 1.176% 1.029% Change-Id: I8f10e09ee6538c05df2fb9f069abcaf1edb3fca6
2012-08-03Merging in high_precision_mv experimentDeb Mukherjee
Merged in the high_precision_mv experiment to make it easier to work on new mv encoding strategies. Also removed coef_update_probs3(). Change-Id: I82d3b0bb642419fe05dba82528bc9ba010e90924
2012-08-03Merge "16x16 DCT blocks." into experimentalDaniel Kang
2012-08-0216x16 DCT blocks.Daniel Kang
Set on all 16x16 intra/inter modes Features: - Butterfly fDCT/iDCT - Loop filter does not filter internal edges with 16x16 - Optimize coefficient function - Update coefficient probability function - RD - Entropy stats - 16x16 is a config option Have not tested with experiments. hd: 2.60% std-hd: 2.43% yt: 1.32% derf: 0.60% Change-Id: I96fb090517c30c5da84bad4fae602c3ec0c58b1c
2012-07-31Merging and bug-fix in enhanced_interp experimentDeb Mukherjee
Merged the enhanced_interp experiment. Found and fixed a bug in the include files framework, whereby certain encoder files were still using the old INTERP_EXTEND value of 3 instead of 4. The thresholds for mv range mcomp.c need a small adjustment to prevent crashes. The results are more or less unchanged. Change-Id: Iac5008390f1efc97ce1102fbb5f8989c847fb579
2012-07-30Adds support for switchable interpolation filters.Deb Mukherjee
Allows for swtiching/setting interpolation filters at the MB level. A frame level flag indicates whether to use a specifc filter for the entire frame or to signal the interpolation filter for each MB. When switchable filters are used, the encoder chooses between 8-tap and 8-tap sharp filters. The code currently has options to explore other variations as well, which will be cleaned up subsequently. One issue with the framework is that encoding is slow. I tried to do some tricks to speed things up but it is still slow. Decoding speed should not be affected since the number of filter taps remain unchanged. With the current version, we are up 0.5% on derf on average but some videos city/mobile improve by close to 4 and 2% respectively. If we did a full-search by turning the SEARCH_BEST_FILTER flag on, the results are somewhat better. The framework can be combined with filtered prediction, and I seek feedback regarding that. Rebased. Change-Id: I8f632cb2c111e76284140a2bd480945d6d42b77a
2012-07-27Merges several experimentsDeb Mukherjee
The following five experiments are merged: newentropy newupdate adaptive_entropy (also includes a couple of parameter changes that improves results a little in common/entropymode.c and encoder/modecosts.c that were not merged from the internal branch) newintramodes expanded_coef_context Change-Id: I8a142a831786ee9dc936f22be1d42a8bced7d270
2012-07-17Restyle codeJohn Koleszar
Approximate the Google style guide[1] so that that there's a written document to follow and tools to check compliance[2]. [1]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml [2]: http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py Change-Id: Idf40e3d8dddcc72150f6af127b13e5dab838685f
2012-06-27Added Prediction Filter to Mode SelectionAdrian Grange
Added the ability to optionally filter the prediction data when inter modes are selected (excludes SPLITMV, for now). The mode selection loop considers both the filtered and non-filtered prediction data when choosing mode. The filter can be turned on/off at the frame-level, or signaled for each MB. Change-Id: I1b783c71d95a361ab36c761b07e8a6b06bc36822
2012-06-25Continued adaptive entropy codingDeb Mukherjee
Incorporates mv_ref, mbsplit and second_mv into the adaptive entropy framework. The mv_ref framework has been modified from before. Adds some clean-ups and fixes. Results with the adaptive entropy experiment are currently up by +1.93% on derf; +2.33% std-hd and +1.87% yt-hd. Fixed a nasty intermittent bug. Change-Id: I4b1ac9f9483b48432597595195bfec05f31d1e39
2012-06-15Adaptive entropy coding of coefficients, modes, mv.Deb Mukherjee
This patch incorporates adaptive entropy coding of coefficient tokens, and mode/mv information based on distributions encountered in a frame. Specifically, there is an initial forward update to the probabilities in the bitstream as before for coding the symbols in the frame, however at the end of decoding each frame, the forward update to the probabilities is reverted and instead the probabilities are updated towards the actual distributions encountered within the frame. The amount of update is weighted by the number of hits within each context. Results on derf/hd/std-hd are all up by 1.6%. On derf, the most of the gains come from coefficients, however for the hd and std-hd sets, the most of the gains come from the mode/mv information updates. Change-Id: I708c0e11fdacafee04940fe7ae159ba6844005fd
2012-06-08Key frame and GF sizing changes.Paul Wilkins
Changes to the equations for kf and gf minQ and to the boost calculations for kg and gf Change-Id: I312031c910e6a575334f49075c32f49a8dfff239
2012-05-30Rate control fix.Paul Wilkins
This fix addresses some problems with very complex clips like handling of flashes on clips like crew (which was made worse by an earlier patch (derf and std-hd)). Most clips a small effect but some between 1 & 2% Derf +0.039, +0.211% YT +0.042, +0.083% Change-Id: I65fc7c13afc31482040068544dd65b8808f5cb4a
2012-05-29Remove "est_max_qcorrection_factor"Paul Wilkins
Removed the local scaling factor est_max_qcorrection_factor and related code to simplify estimateq calculation (little effect anyway) Cap range of total correction factor. Slight change to break out case to turn off arf. Change-Id: I748187737ba93cfadf016f3dfdf8d2741934067f
2012-05-15Rewrite reference frame costing in the RD loop.Ronald S. Bultje
I now see I didn't write a very long description, so let's do it here then. We took a pretty big quality hit (0.1-0.2%) from my recent fix of the inversion of arguments to vp8_cost_bit() in the RD reference frame costing. I looked into it and basically the costing prevented us from switching reference frames. This is of course silly, since each frame codes its own prob_intra_coded, so using last frame cost indications as a limiting factor can never be right. Here, I've rewritten that code to estimate costings based partially on statistics from progress on current frame encoding. Overall, this gives us a ~0.2%-0.3% improvement over what we had previously before my argument-inversion-fix, and thus about ~0.4% over current git (on derf-set), and a little more (0.5-1.0%) on HD/STD-HD/YT. Change-Id: I79ebd4ccec4d6edbf0e152d9590d103ba2747775
2012-05-15Adds new Directional Intra prediction modes.Deb Mukherjee
Adds 6 directional intra predictiom modes for 16x16 and 8x8 blocks. Change-Id: I25eccc0836f28d8d74922e4e9231568a648b47d1
2012-05-11First pass overhaul preparatory change.Paul Wilkins
This is the first patch in a series of changes to the first pass code. (Broken down for ease of testing/merging/review). This patch introduces a new stats element "sr_coded_error". This is the coded error recorded vs the second reference frame (which is updated such that it lags by at least one frame). No use is made of the new structure in this change so this patch should have no material effect. Removed some ifdefs and deprecated code (#if NEW_BOOST). Removed twopass.gf_decay_rate (not used any more) Change-Id: I1be672a73017f7c13fd50fb4f99236aa2ed30916
2012-05-08a number of fixes to entropy stats collectionYaowu Xu
1. block types There are only three types of blocks for 8x8 transformed MBs, i.e. Y block with DC does not exist for 8x8 transformed MBs as all MB using 8x8 transform have 2nd order haar transform. This commit introduced a new macro BLOCK_TYPES_8X8 to reflect such fact. 2. context counters This commit also fixed the mixed of context_counters between 4x4 and 8x8 transformed MBs. The mixed use of the counters leads me to think the existing the context probabilities were not properly generated from 8x8 transformed MBs. 3. redundant collecting in recoding The commit also corrected the code that accumulates entropy stats by making sure stats only collected for final packing, not during the recode loop Change-Id: I029f09f8f60bd0c3240cc392ff5c6d05435e322c
2012-04-25Adds search option for best interpolation filter.Deb Mukherjee
Adds a speed feature to conduct a brute force search among a set of available interpolation filters for the best one in an RD sense. There is a gain of 0.4% on derf, 1.0% on Std-HD. Patch 2: A macro added to determine if the encoder state is reset for each new filter tried. Patch 3: rebase, also fixes a bug (decodframe.c) introduced by a couple of missing function pointer assignements. Patch 4: rebase. Change-Id: Ic9ccca9d8c35c6af557449ae867391a2f996cc29
2012-04-25Merge UVINTRA experimentYaowu Xu
The commit merges the UVINTRA experiment and removed the related macros. The overall effect of the experiment is a small gain (.1% on derf) Change-Id: Ia34b3312fb9b5b34c9ba111bf0fa78c6f78ac80b
2012-04-18Compound prediction for splitmv macroblocks.Ronald S. Bultje
Change-Id: I0af3395500b1cb0ed629249eb6636a0c9322cb18
2012-04-17Added intra mode probabilites into coding_contextYaowu Xu
These contexts need to be saved and restored for recode, otherwise encoder/decoder mismatch happens for some clips (eg._mobcal 720p) Change-Id: Ic65cfa0bf56ed0472ecab962ce31394d59d344bf
2012-04-11Refactoring of encode loop and bitstream packingPaul Wilkins
Some code re-factored / moved to allow the main pack operation inside the recode loop so that the size estimate is accurate. Deletion of some redundant code relating to one pass. Aproximate improvement over March 27 code base: Derf 0.0%, YT 0.5%, YThd 0.3% Std_hd 0.25% Change-Id: Id2d071794ab44f0b52935f6fcdb5733d09a6bb86
2012-04-11T8x8 zbin and rate control changes.Paul Wilkins
Some adjustments to zbin for t8x8. Changes to rules for sizing forced key frames. Some extra stats output in tmp.stt. Approximate gain on YT-hd set 0.5% There are still issues in sizing key frames and gf/arf frames when the image is largely static. These in part relate to problems with cost estimates in the recode loop. Change-Id: I6f0159dc8a8faeab4115a19c668d442491619a68
2012-04-11Superblock encoding orderAdrian Grange
This is the first patch to add superblock (32x32) coding order capabilities. It does not yet do any mode selection at the SB level, that will follow in a further patch. This patch encodes rows of SBs rather than MBs, each SB contains 2x2 MBs. Two intra prediction modes have been disabled since they require reconstructed data for the above-right MB which may not have been encoded yet (e.g. for the bottom right MB in each SB). Results on the one test clip I have tried (720p GIPS clip) suggest that it is somewhere around 0.2dB worse than the baseline version, so there may be bugs. It has been tested with no experiments enabled and with the following 3 experiments enabled: --enable-enhanced_interp --enable-high_precision_mv --enable-sixteenth_subpel_uv in each case the decode buffer matches the recon buffer (using "cmp" to compare the dumped/decoded frames). Note: Testing these experiments individually created errors. Some problems were found with other experiments but it is unclear what state these experiments are in: --enable-comp_intra_pred --enable-newentropy --enable-uvintra This code has not been extensively tested yet, so there is every likelihood that further bugs remain. I also intend to do some code cleanup & refactoring in tandem with the next patch that adds the 32x32 modes. Change-Id: I1eba7f740a70b3510df58db53464535ef881b4d9
2012-03-21Only support improved quantPaul Wilkins
Deprecate fast quant and strict_quant code. Small effect on quality as fast was used in first pass but the effect is basically neutral across the derf set. The rationale here is to reduce the number of code paths for now to make experimentation easier. Optimized and fast code options can be re-introduced later along with other encode speed options. Change-Id: Ia30c5daf3dbc52e72c83b277a1d281e3c934cdad
2012-03-21Adding contextual coding of mb_skip_coeff flag.Deb Mukherjee
Using contextual coding of the mkb_skip_coeff flag using the values of this flag from the left and above. There is a small improvement of about 0.15% on Derf: http://www.corp.google.com/~debargha/vp8_results/mbskipcontext.html Refactored to use pred_common.c by adding a new context type. Results on HD set (about 0.66% improvement): http://www.corp.google.com/~debargha/vp8_results/mbskipcontext_hd.html Incliding missing refactoring to use the pred_common utilities. Change-Id: I95373382d429b5a59610d77f69a0fea2be628278
2012-03-01Merge t8x8 experimentsYaowu Xu
Change-Id: I8e9b6b154e1a0d0cb42d596366380d69c00ac15f
2012-02-28Rename "dual" prediction to "compound" prediction.Ronald S. Bultje
Change-Id: Ibcd2b9b247ff9f83331dac47f91ec285e8955ff1
2012-02-28Initial refactoring of high_precision mv code.Deb Mukherjee
This is the first patch for refactoring of the code related to high-precision mv, so that 1/4 and 1/8 pel motion vectors can co-exist in the same bit-stream by use of a frame level flag. The current patch works fine for only use of 1/4th and only use of 1/8th pel mv, but there are some issues with the mode switching in between. Subsequent patches on this change Id will fix the remaining issues. Patch 2: Adds fixes to make sure that multiple mv precisions can co-exist in the bit-stream. Frame level switching has been tested to work correctly. Patch 3: Fixes lines exceeding 80 char Patch 4: http://www.corp.google.com/~debargha/vp8_results/enhinterp.html Results on derf after ssse3 bugfix, compared to everything enabled but the 8-tap, 1/8-subpel and 1/16-subpel uv. Overall the gains are about 3% now. Hopefully there are no more bugs lingering. Apparently the sse3 bug affected the quartel subpel results more than the eighth pel ones (which is understandabale because one bad predictor due to the bug, matters less if there are a lot more subpel options available as in the 1/8 subpel case). The results in the 4th column correspond to the current settings. The first two columns correspond to two settings of adaptive switching of the 1/4 or 1/8 subpel mode based on initial Q estimate. These do not work as good as just using 1/8 all the time yet. Change-Id: I3ef392ad338329f4d68a85257a49f2b14f3af472
2012-02-28Experimental branch code clean up.Paul Wilkins
Removal of some further code relating to partitions and error resilience. Spelling correction. Change-Id: I36067aae67a4a23bec359541dda3400b0bbf26d0
2012-02-25Removal of temporal re sampling code.Paul Wilkins
For now the interface elements have been left in place to make sure existing parameter files work but parameters relating to drop frame wont do anything. Change-Id: I579ee614726387381c546845dac4bc03c74c6a07
2012-02-24Further code simplification and clean up.Paul Wilkins
Change-Id: Ifdb17b56090a317b2aa82cf125d57934902c5298
2012-02-17Code base simplification.Paul Wilkins
Removal of most code to do with 1 pass. Removal of cyclic refresh code. Change-Id: I74971082bc19dd76e795d4d2e781a0424cec5c8c
2012-02-15Fix overflows in dual prediction mode selection.Ronald S. Bultje
Change-Id: I265ad46e01a307bca21e6223725e4055f5e08648
2012-02-14Simplification of experimental code base.Paul Wilkins
Removed ~CONFIG_REALTIME_ONLY code. Change-Id: I5fafff29a08acd8928699f9ddce8744787024d8c
2012-02-10Removal of threading code.Paul Wilkins
For the experimental branch we are trying to slim the codebase down removing features such as threading for now which complicate the process of development and testing. Change-Id: I657c0246aef4d1fa8c8ffc6a1adfeee45bce8e24
2012-02-09Merge dualpred (compound prediction) experiment.Ronald S. Bultje
Change-Id: Ieaaa07c50eae41118596197f6a4d848135946e41