summaryrefslogtreecommitdiff
path: root/vp8/decoder/decodemv.c
AgeCommit message (Collapse)Author
2016-08-31Remove CONFIG_DEBUG guards from assert()Johann
When 'NDEBUG' is set, assert() generates no code. Change-Id: Icf61cfc1a8f6e5f0770b3626d8c73ae968df1108
2016-07-19vp8: apply clang-tidy google-readability-braces-around-statementsclang-tidy
applied against an x86_64 configure clang-tidy-3.7.1 \ -checks='-*,google-readability-braces-around-statements' \ -header-filter='.*' -fix + clang-format afterward Change-Id: I6694edeaee89b58b8b3082187e6756561136b459
2016-07-15vp8: apply clang-formatclang-format
Change-Id: I7605b6678014a5426ceb45c27b54885e0c4e06ed
2014-12-16Silence -Werror=unused-parameterJohann
Cast away remaining issues so that new ones don't get lost in the noise. Change-Id: Iacd6999b0686ce80f9835730d68db6382690fa92
2013-10-29changed to comply with strict aliasing ruleYaowu Xu
The clamp operation may not affect the values of the final assigned mv where compiler may make use of strict aliasing rule to optimize out the clamp operation. This change made the code segments to better comply the strict aliasing rule. Change-Id: I24502ff18bd4f9e62507a879cc8760a91a0fd07e
2013-09-23fix integer overflow in vp8Yaowu Xu
Change-Id: I62550a7a883115f3ce878710cf3bb039bea54390
2012-09-21Removed bc and bc2 vp8_readers from VP8D_COMPScott LaVarnway
Used mbc instead. Change-Id: If22136b4fee89b68ca2246265f3c27853701136c
2012-09-13Moved mb_no_coeff_skip flag readScott LaVarnway
from vp8_decode_frame() to mb_mode_mv_init() Change-Id: I267fd764a4c826d62e6799dceb1b8fb5f97fde6d
2012-09-11valgrind found motion vectors which exceeded frame boundariesScott LaVarnway
Bug introduced in I02d034c70cd97b65025d59dd67c695e1db529f0b Change-Id: Ifb74ab659f3b3cf5f5b95046bacffb202d5b4d64
2012-08-28silent one more compiler warningYaowu Xu
Change-Id: I621a2bbd5f07691fa76dac36b65f406ad4fed792
2012-04-23Removes duplication of key frame mode probabilitiesAttila Nagy
Key frame macrobock and block mode probabilities are constant. Remove the allocation of tables for each codec instance and use instead the default const prob tables. Change-Id: I8361798ac491f9b3889e86925a494c58647c753f
2012-04-12Merge "MB_MODE_INFO size reduction"Scott LaVarnway
2012-04-10Fixes to disable MFQE when there is motion.Deb Mukherjee
This patch includes: 1. fixes to disable block based termporal mixing when motion is detected (because this version of mfqe only handles zero motion). 2. The criterion used for determining whether to mix or not are changed to use squared differences rather than absolute differences. 3. Additional checks on color mismatch and excessive block flatness added. If the block as decoded has very low activity it is unlikely to yield benefits for mixing. Change-Id: I07331e5ab5ba64844c56e84b1a4b7de823eac6cb
2012-03-29MB_MODE_INFO size reductionScott LaVarnway
Reduced the size of the struct by 8 bytes, which would be a memory savings of 64800 bytes for 1080 resolutions. Had an extra byte, so created an is_4x4 for B_PRED or SPLITMV modes. This simplified the mode checks in vp8_reset_mb_tokens_context and vp8_decode_mb_tokens. Change-Id: Ibec27784139abdc34d4d01f73c09f43e9e10e0f5
2012-02-16Simplify mb_to_x_edge calculation during mode decodingScott LaVarnway
Change-Id: Ibcb35c32bf24c1d241090e24c5e2320e4d3ba901
2012-02-16decodemv cleanup/improvementsScott LaVarnway
Removed unnecessary variables, unrolled functions, eliminated unnecessary mv bounds checks and branches. Change-Id: I02d034c70cd97b65025d59dd67c695e1db529f0b
2011-10-31Correct SPLITMV clampingJohn Koleszar
Prior to this fix, the clamping state of the last subblock partition dominated, whereas the correct behavior is to clamp if any partition needs clamping. This bug was introduced by v0.9.6-232-g6b25501 See also: [1]: http://code.google.com/p/webm/issues/detail?id=371 [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=696390 Change-Id: I444db492b4c4f05f039c7da6f4216da8207dc138
2011-10-27Improved decode_split_mv()Scott LaVarnway
Tests showed ~1.2% performance boost on the HD clip used. Performance will vary based on material. Change-Id: Icbcf1a828750d5b4ae5252bf596b3ef594042e8a
2011-10-26Improved read_mb_modes_mv()Scott LaVarnway
Interleaved vp8_find_near_mvs and vp8_mv_ref_probs. 2.5% to 4% performance improvement for the HD clips used. Change-Id: Id888b667cf5ae2f0e19da18743140f055ff7de8d
2011-10-24Removed read_mv_refScott LaVarnway
Decode the mv mode with if-then-elses instead of traversing the vp8_mv_ref_tree data structure. This will make it easier to interleave vp8_find_near_mvs and vp8_mv_ref_probs. Change-Id: I1e798d6ec40fcaeeff06ccc82f81201978d12f74
2011-10-24Moved the split motion vector decodeScott LaVarnway
into a function. Change-Id: Ia023a0587100a52cb084f5d9d5512efa6198dad3
2011-10-24Removed redundant mv clamps for nearmv and nearestmvScott LaVarnway
Did some cleanup as well. Patchset 2: Fixed bug. Will revisit the segmentation logic. Change-Id: Idf9fbcff9aaf467bdace9fbd58ef2cea6c602049
2011-08-12Propagate macroblock MV to subblocks for error concealmentJohn Koleszar
EC expects the subblock MVs to be populated, but f1d6cc79e43f0066632f19c1854ca365086b712b removed this code. This commit restores it, protected by CONFIG_ERROR_CONCEALMENT. May move this to the EC code more directly in the future. Change-Id: I44f8f985720cb9a1bf222e59143f9e69abf56ad2
2011-07-13Fix unnecessary casting of B_PREDICTION_MODE (issue 349)Yunqing Wang
Minor fix. Change-Id: Iaf93f6e47e882a33c479e57c7a0d0bf321e291c0
2011-06-13Populate bmi for B_PRED onlyScott LaVarnway
Small decode performance gain (~1%) on keyframes. No noticeable gains on encode. Also changed pick_intra4x4mby_modes() to read the above and left block modes for keyframes only. Change-Id: I1f4885252f5b3e9caf04d4e01e643960f910aba5
2011-06-03Removed unnecessary bmi motion vector stores.Scott LaVarnway
left_block_mv and above_block_mv will return the MB motion vector for non SPLITMV macro blocks. Change-Id: I58dbd7833b4fdcd44b6b72e98ec732c93c2ce4f4
2011-06-02Removed B_MODE_INFOScott LaVarnway
Declared the bmi in BLOCKD as a union instead of B_MODE_INFO. Then removed B_MODE_INFO completely. Change-Id: Ieb7469899e265892c66f7aeac87b7f2bf38e7a67
2011-05-24Use int_mv instead of MV in vp8_mv_contScott LaVarnway
Less operations. Change-Id: Ibb9cd5ae66b8c7c681c9a654d551c8729c31c3ae
2011-05-24Removed unused variable warningsScott LaVarnway
Change-Id: I6e5e921f03dc15a72da89a457848d519647677a3
2011-05-24MODE_INFO size reductionScott LaVarnway
Declared the bmi in MODE_INFO as a union instead of B_MODE_INFO. This reduced the memory footprint by 518,400 bytes for 1080 resolutions. The decoder performance improved by ~4% for the clip used and the encoder showed very small improvements. (0.5%) This reduction was first mentioned to me by John K. and in a later discussion by Yaowu. This is WIP. Change-Id: I8e175fdbc46d28c35277302a04bee4540efc8d29
2011-05-19Adding error-concealment to the decoder.Stefan Holmer
The error-concealer is plugged in after any motion vectors have been decoded. It tries to estimate any missing motion vectors from the motion vectors of the previous frame. Intra blocks with missing residual are replaced with inter blocks with estimated motion vectors. This feature was developed in a separate sandbox (sandbox/holmer/error-concealment). Change-Id: I5c8917b031078d79dbafd90f6006680e84a23412
2011-05-12Using int_mv instead of MVScott LaVarnway
The compiler produces better assembly when using int_mv for assignments. The compiler shifts and ors the two 16bit values when assigning MV. Change-Id: I52ce4bc2bfbfaf3f1151204b2f21e1e0654f960f
2011-03-17Increase static linkage, remove unused functionsJohn Koleszar
A large number of functions were defined with external linkage, even though they were only used from within one file. This patch changes their linkage to static and removes the vp8_ prefix from their names, which should make it more obvious to the reader that the function is contained within the current translation unit. Functions that were not referenced were removed. These symbols were identified by: $ nm -A libvpx.a | sort -k3 | uniq -c -f2 | grep ' [A-Z] ' \ | sort | grep '^ *1 ' Change-Id: I59609f58ab65312012c047036ae1e0634f795779
2011-02-10Fix relative include pathsJohn Koleszar
Allow compiling without adding vp8/{common,encoder,decoder} to the include paths. Change-Id: Ifeb5dac351cdfadcd659736f5158b315a0030b6c
2010-10-27Eliminate more warnings.Timothy B. Terriberry
This eliminates a large set of warnings exposed by the Mozilla build system (Use of C++ comments in ISO C90 source, commas at the end of enum lists, a couple incomplete initializers, and signed/unsigned comparisons). It also eliminates many (but not all) of the warnings expose by newer GCC versions and _FORTIFY_SOURCE (e.g., calling fread and fwrite without checking the return values). There are a few spurious warnings left on my system: ../vp8/encoder/encodemb.c:274:9: warning: 'sz' may be used uninitialized in this function gcc seems to be unable to figure out that the value shortcut doesn't change between the two if blocks that test it here. ../vp8/encoder/onyx_if.c:5314:5: warning: comparison of unsigned expression >= 0 is always true ../vp8/encoder/onyx_if.c:5319:5: warning: comparison of unsigned expression >= 0 is always true This is true, so far as it goes, but it's comparing against an enum, and the C standard does not mandate that enums be unsigned, so the checks can't be removed. Change-Id: Iaf689ae3e3d0ddc5ade00faa474debe73b8d3395
2010-09-21unset execute bit on c sourceJohn Koleszar
Change-Id: I6625ee41f8872908cb015ce0729e1c7a105b5217
2010-09-21Don't reset mb clamping state during splitmv decodingJohn Koleszar
The MV decoding changes in c5fb0eb introduced a bug where the macroblock clamping state was reset for each partition, so if an earlier partition needed clamping but a subsequent one didn't, the MB wouldn't receive clamping. Instead, the state is only set during splitmv decoding, never cleared. Change-Id: I224fe258493405ee0f6a04596acdb622c475e845
2010-09-09Improved subset block searchScott LaVarnway
Improved the subset block search and fill. (about 3% improvement for 32 bit) Modified/merged the code in order to create vp8_read_mb_modes_mv which can decode the modes/mvs on a macroblock level. This will allow the decode loop (in the future) to decode modes/mvs on a frame, row, or mb level. Change-Id: If637d994b508792f846d39b5d44a7bf9aa5cddf3
2010-09-09Use WebM in copyright notice for consistencyJohn Koleszar
Changes 'The VP8 project' to 'The WebM project', for consistency with other webmproject.org repositories. Fixes issue #97. Change-Id: I37c13ed5fbdb9d334ceef71c6350e9febed9bbba
2010-09-03Reduced the size of MB_MODE_INFOScott LaVarnway
Moved partition_bmi and partition_count out of MB_MODE_INFO and placed into MACROBLOCK. Also reduced the size of other members of the MB_MODE_INFO struct. For 1080p, the memory was reduced by 1,209,516 bytes. The decoder performance appeared to improve by 3% for the clip used. Note: The main goal for this change is to improve the decoder performance. The encoder will be revisited at a later date for further structure cleanup. Change-Id: I4733621292ee9cc3fffa4046cb3fd4d99bd14613
2010-07-12limit range checking code for L[k] to CONFIG_DEBUG. patch by timeless@gmail.comMichael Kohler
2010-06-18cosmetics: trim trailing whitespaceJohn Koleszar
When the license headers were updated, they accidentally contained trailing whitespace, so unfortunately we have to touch all the files again. Change-Id: I236c05fade06589e417179c0444cb39b09e4200d
2010-06-15Change bitreader to use a larger window.Timothy B. Terriberry
Change bitreading functions to use a larger window which is refilled less often. This makes it cheap enough to do bounds checking each time the window is refilled, which avoids the need to copy the input into a large circular buffer. This uses less memory and speeds up the total decode time by 1.6% on an ARM11, 2.8% on a Cortex A8, and 2.2% on x86-32, but less than 1% on x86-64. Inlining vp8dx_bool_decoder_fill() has a big penalty on x86-32, as does moving the refill loop to the front of vp8dx_decode_bool(). However, having the refill loop between computation of the split values and the branch in vp8_decode_mb_tokens() is a big win on ARM (presumably due to memory latency and code size: refilling after normalization duplicates the code in the DECODE_AND_BRANCH_IF_ZERO and DECODE_AND_LOOP_IF_ZERO cases. Unfortunately, refilling at the end of vp8dx_bool_decoder_fill() and at the beginning of each decode step in vp8_decode_mb_tokens() means the latter requires an extra refill at the end. Platform-specific versions could avoid the problem, but would require most of detokenize.c to be duplicated. Change-Id: I16c782a63376f2a15b78f8086d899b987204c1c7
2010-06-09Remove secondary mv clamping from decode stageJohn Koleszar
This patch removes the secondary MV clamping from the MV decoder. This behavior was consistent with limits placed on non-split MVs by the reference encoder, but was inconsistent with the MVs generated in the split case. The purpose of this secondary clamping was only to prevent crashes on invalid data. It was not intended to be a behaviour an encoder could or should rely on. Instead of doing additional clamping in a way that changes the entropy context, the secondary clamp is removed and the border handling is made implmentation specific. With respect to the spec, the border is treated as essentially infinite, limited only by the clamping performed on the near/nearest reference and the maximum encodable magnitude of the residual MV. This does not affect any currently produced streams. Change-Id: I68d35a2fbb51570d6569eab4ad233961405230a3
2010-06-04LICENSE: update with latest textJohn Koleszar
Change-Id: Ieebea089095d9073b3a94932791099f614ce120c
2010-05-18Initial WebM releaseJohn Koleszar