summaryrefslogtreecommitdiff
path: root/vp8/decoder/decodemv.c
AgeCommit message (Collapse)Author
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-15Code clean up.Paul Wilkins
Further cases of inconsistent naming convention. Change-Id: Id3411ecec6f01a4c889268a00f0c9fd5a92ea143
2012-08-14Merge "Changed to use reference mv as nearest mv" into experimentalYaowu Xu
2012-08-14Changed to use reference mv as nearest mvYaowu Xu
The reference motion vector selected by surrounding pixels that has the best matching score is used as nearest motion vector. The change has shown consistent gain on all test sets, compression gains range from .2% to .6%. The variation is largely dependent on various other experiments on or off. Change-Id: I5552e1c2f6fc57c3e8818a5ee41ffda89af05e75
2012-08-13Shut up some compiler warnings on gccDaniel Kang
Change-Id: I8548aebd3c39797b253eef472bfe1c40f2f7ec59
2012-08-13Fix warning/bug introduced in 4d5b81a80faa8333ca3a7aed53684d2167fbebd2.Christian Duvivier
Change-Id: I082d2517022cbf2f472c143fe7772719d8295498
2012-08-10Refactor RD to take same codepath for single and comp predDaniel Kang
Change-Id: Id38baf1b89648ef534e28be72f583137871f920c
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-06Merge "enable interleaved decoding of mode and mv" into experimentalYaowu Xu
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-03enable interleaved decoding of mode and mvYaowu Xu
Previouly, the decoding of mode and motion vector are done a per frame basis followed by residue decoding and reconstuction. The commit added the option to allow decoder to interleave the decoding of mode and mvs with the residue decoding on a per MB basis. Change-Id: Ia5316f4a7af9ba7f155c92b5a6fc97201b653571
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-04-25Merge QIMODE experimentYaowu Xu
This commit merge the QI mode experiment. As the experiment affects the encoding of intra coding modes on key frame only, the overall effect of the experiment on encoding tests is insignificant. Change-Id: I9e4e3933adface88867ad429cee3986e529c511d
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-18Added update of mode context pointers in decoderAdrian Grange
With the NEWENTROPY experiment enabled encoding certain clips produced invlid bitstreams, or files that had a high degree of artefacts. This was the results of pointers in MACROBLOCKD not being setup correctly (mode_info_context and prev_mode_info_context). Change-Id: Ice13e1efa8bd122997d2f8f3f1e761c6c16e0403
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-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-14added clamp for 2nd motion vectorYaowu Xu
The commit added a clamp to the 2nd motion vector used in compound prediction to insure mv within UMV borders. The clamp is similar to that of the first motion vector except that No SPLITMV is ever used for the 2nd motion vector. Change-Id: I26dd63c304bd66b2e03a083749cc98c641667116
2012-03-07Snapshot candidatePaul Wilkins
Pulled out super block code for the snapshot as this is not quite ready and will need an extensive re-merge. Change-Id: I436369b511257447a7b0ea064016cb63f5011849
2012-03-05Use per-MB compound intra prediction.Ronald S. Bultje
This gives a modest gain on derf overall, although at low bitrates the cost is still too high, so this can be improved further. Patch 2. Re-base and fix 80 column issues Change-Id: Ida2f9fa3fe75370669f6a27b37108dc602231c63
2012-03-05Changed how UV r/d estimates are done for Intra ModesYaowu Xu
The commit changed to compute UV intra RD estimates for 4x4 and 8x8 separately to be used in mode decision for MB modes associated with the appropriate transform size respectively. Now finally after many other changes related 8x8 quantizer zbin boost and zbin_mode_boost, this change overall helps the HD(with 8x8) by around ~.13%. (avg .13% glb .13% ssim .17%) The commit also has a few changes for eliminating compiler warnings. Change-Id: Ibab35dad44820c87e6b44799c66f8d519cc37344
2012-02-28Rename "dual" prediction to "compound" prediction.Ronald S. Bultje
Change-Id: Ibcd2b9b247ff9f83331dac47f91ec285e8955ff1
2012-02-28Compound intra prediction (b_pred/4x4 only, for now),Ronald S. Bultje
Also remove duplicate build_intra_predictors_mby/uv(). Change-Id: I78607e7304952a9b962a5b25af9bb9c48692187b
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-23Supporting high precision 1/8-pel motion vectorsDeb Mukherjee
This is the initial patch for supporting 1/8th pel motion. Currently if we configure with enable-high-precision-mv, all motion vectors would default to 1/8 pel. Encode and decode syncs fine with the current code. In the next phase the code will be refactored so that we can choose the 1/8 pel mode adaptively at a frame/segment/mb level. Derf results: http://www.corp.google.com/~debargha/vp8_results/enhinterp_hpmv.html (about 0.83% better than 8-tap interpoaltion) Patch 3: Rebased. Also adding 1/16th pel interpolation for U and V Patch 4: HD results. http://www.corp.google.com/~debargha/vp8_results/enhinterp_hd_hpmv.html Seems impressive (unless I am doing something wrong). Patch 5: Added mmx/sse for bilateral filtering, as well as enforced use of c-versions of subpel filters with 8-taps and 1/16th pel; Also redesigned the 8-tap filters to reduce the cut-off in order to introduce a denoising effect. There is a new configure option sixteenth-subpel-uv which will use 1/16 th pel interpolation for uv, if the motion vectors have 1/8 pel accuracy. With the fixes the results are promising on the derf set. The enhanced interpolation option with 8-taps alone gives 3% improvement over thei derf set: http://www.corp.google.com/~debargha/vp8_results/enhinterpn.html Results on high precision mv and on the hd set are to follow. Patch 6: Adding a missing condition for CONFIG_SIXTEENTH_SUBPEL_UV in vp8/common/x86/x86_systemdependent.c Patch 7: Cleaning up various debug messages. Patch 8: Merge conflict Change-Id: I5b1d844457aefd7414a9e4e0e06c6ed38fd8cc04
2012-02-15Experimental code base simplification.Paul Wilkins
Remove error concealment code. Change-Id: I882705174fbfea212e96f7f684e47a671dbe5c67
2012-02-09Merge dualpred (compound prediction) experiment.Ronald S. Bultje
Change-Id: Ieaaa07c50eae41118596197f6a4d848135946e41
2012-02-09Removal of SEGFEATURES placeholder commentsPaul Wilkins
This commit only involves the removal of placeholder comments //#if CONFIG_SEGFEATURES. Change-Id: I94b350daaf998ee0cfdde5aa25b1d3b0522ab816
2012-02-09Merge COMPREDPaul Wilkins
Merged in most of the current common prediction changes that were under the #if CONFIG_COMPRED option. Change-Id: If4e6f61dbe7b86dd449f6effbe93b5eb7e893885
2012-02-09Dual pred flagPaul Wilkins
Further changes to make experiments with the context used for coding the dual pred flag easier. Current best performing method tested on derf is a two element context based on reference frame. I also tried various combinations of mode and reference frame as shown in commented out case using up to 6 contexts. Derf +0.26 overall psnr +0.15% ssim vs original method. Change-Id: I64c21ddec0abbb27feaaeaa1da2e9f164ebaca03
2012-02-06Merged NEWNEAR experimentPaul Wilkins
This commit merges the NEWNEAR experiment such that it is effectively always on. The fact that there were changes in the threading code again highlights the need to strip out such features during the bitstream development phase as trying to maintain this code (especially as it is not being tested) slows the development cycle. Change-Id: I8b34950a1333231ced9928aa11cd6d6459984b65
2012-02-06Coding the hybrid dual prediction signal.Paul Wilkins
Initial modifications to make limited use of common prediction functions. The only functional change thus far is that updates to the probabilities are no longer "damped". This was a testing convenience but in fact seems to help by a little over 0.1% over the derf set. Change-Id: I8b82907d9d6b6a4a075728b60b31ce93392a5f2e
2012-02-06Moved prob_dualpred to common.Paul Wilkins
Moved the prob_dualpred[] sturcture to common. Created common prediction entry for Dual flag. Change-Id: I9ac3d128bae6114f09e5c18216d4b95cf36453d5
2012-02-06Modified prediction behavior for reference frame.Paul Wilkins
Trial of a modified prediction function that ranks each possible reference frame based on a combination of local usage and frame level probability. The code is a bit cleaner and simpler. In direct comparison with old unpredicted method with segment level coding turned off for mode,ref & EOB the prediction gives a gain on derf of around 0.4%. There is some further gain from bug fixes over earlier code. With segment coding on the prediction method is slightly -ve on some very easy clips (at low rates) due to slightly higher overheads, but better on harder clips. Overall neutral on derf in direct comparison on latest code base, but compared to earlier code without bug fixes about +0.7% overall psnr +0.3% SSIM. Change-Id: I5b8474658b208134d352d24f6517f25795490789
2012-02-03Reference frame prediction:Paul Wilkins
Extended prediction and coding of reference frame where a subset of options are flagged as available at the segment level. Updated copyright notices. Switch to SAD in mbgraph code as SATD problematic for the foreground and background separation as it can ignore large DC shifts. Change-Id: I661dbbb2f94f3ec0f96bb928c1655e5e415a7de1
2012-02-02Added encoding in Superblock OrderAdrian Grange
As a precursor to encoding 32x32 blocks this cl adds the ability to encode the frame superblock (=32x32 block) at a time. Within a SB the 4 indiviual MBs are encoded in raster-order (NW,NE,SW,SE). This functionality is added as an experiment which can be enabled by ispecifying --enable-superblocks in the command line specified to configure (CONFIG_SUPERBLOCKS macro in the code). To make this work I had to disable the two intra prediction modes that use data from the top-right of the MB. On the tests that I have run the results produce almost exactly the same PSNRs & SSIMs with a very slightly higher average data rate (and slightly higher data rate than just disabling the two intra modes in the original code). NOTE: This will also break the multi-threaded code. This replaces the abandoned change: Iebebe0d1a50ce8c15c79862c537b765a2f67e162 Change-Id: I1bc1a00f236abc1a373c7210d756e25f970fcad8
2012-02-01Fixes a decoder bugYaowu Xu
The bug was introduced by the commit that added I8X8 intra prediction mode for inter frames, the decoder was not update to accept the additional probability update from encoder. This causes the decoder typicall to crash when encoder sends intra mode probability update. Change-Id: Ib7dc42dc77a51178aa9ece41e081829818a25016
2012-02-01Import another decoder bug fix from public stable branchAuthor: John Koleszar
Please see the following for details: https://gerrit.chromium.org/gerrit/#change,10925 Change-Id: Ie692261c255c58d7762df22eeca566a7d13adcba
2012-01-31Implementation of new prediction model for reference frame coding.Paul Wilkins
This check in uses the common prediction interface functions to code reference frame. Some updates made regarding the impact of the new code in rd loop but there remain TODOs in this regard. Change-Id: I9da3ed5dfdaa489e0903ab33258b0767a585567f
2012-01-31Use common prediction interface for segment coding.Paul Wilkins
This does not change any functionality just modifies the code to use the common prediction module interface for coding the segment data. Change-Id: Ifd43e9153573365619774a4f5572215e44fb5aa3
2012-01-31Moved some reference frame data structures into common.Paul Wilkins
In this commit only the decoder side was updated. Change-Id: Ia9bd58da07d1a943f028e330f0489344e62b0d02
2012-01-31Moved some segmentation data structures.Paul Wilkins
Moved some segmentation data structures into VP8_COMMON Change-Id: I59c6e2edf7a0176e35319936eea450027aeb3b39
2011-12-16Reset segment_id to 0 when segmentation is disabledAdrian Grange
Whilst the encoder explicitly set the segment_id to 0 when segmentation is diabled, the decoder would allow the segment_id to persist from the previous frame. This fix attempts to make the decoder behave the same as the encoder by explicitly setting the segment_id to 0 in this case. Change-Id: I65c3a05247550edb10706eb5d54d306dfb792309