summaryrefslogtreecommitdiff
path: root/vp8/encoder/mcomp.c
AgeCommit message (Collapse)Author
2022-08-23.clang-format: update to clang-format-11clang-format
only store the deltas from --style Google in the file and reapply using Debian clang-format version 11.1.0-6+build1 Bug: b/229626362 Change-Id: I3e18a2e7c17a90a48405b3cf1b37ebc652aba0db
2022-05-17vp8[loongarch]: Optimize fdct8x4/diamond_search_sadyuanhecai
1. vp8_short_fdct8x4_lsx 2. vp8_diamond_search_sad_lsx 3. vpx_sad8x8_lsx Bug: webm:1755 Change-Id: Ic9df84ead2d4fc07ec58e9730d6a12ac2b2d31c1
2022-03-29remove sad x3,x8 specializationsJohann
These would compute the sum of absolute differences (sad) for a group of 3 or 8 references. This was used as part of an exhaustive search. vp8 only uses these functions in speed 0 and best quality. For vp9 this is only used with the --enable-non-greedy-mv experiment. This removes the 3- and 8-at-a-time optimized functions and uses the fall back code which will process 1 or 4 (vpx_sadMxNx4d) at a time. For configure --target=x86_64-linux-gcc --enable-realtime-only: libvpx.a before: 3002424 after: 2937622 delta: 64802 after 'strip libvpx.a' before: 2116998 after: 2073090 delta: 43908 Change-Id: I566d06e027c327b3bede68649dd551bba81a848e
2021-12-02clear -Wextra-semi/-Wextra-semi-stmt warningsJames Zern
Bug: chromium:1257449 Change-Id: Ia9aafccc09b611521d4a7aedfe3723393a840c62
2019-11-07remove unused vp8_hex_search parameterJohann
BUG=webm:1612 Change-Id: I80765f4ed05fb5d588249e56a018bf8b9828a197
2019-09-30namespace ARCH_* definesJames Zern
this prevents redefinition warnings if a toolchain sets one BUG=b/117240165 Change-Id: Ib5d8c303cd05b4dbcc8d42c71ecfcba8f6d7b90c
2019-03-28Revert "Wrap macro definition in do-while(0)"Jerome Jiang
This reverts commit aa04b6f9a7475e9d9457dfc5bf441faf15efc466. It caused big regression on webrtc VP8 tests. Change-Id: I937e769d133abeca62ba063e59a58b5c461f5b5e
2019-03-19Wrap macro definition in do-while(0)Jerome Jiang
Change-Id: Id654a48d2fa40355552d7267e58461e6cc1c6998
2019-01-07vp8 multi dimensional search: resolve missing declarationsJohann
BUG=webm:1584 Change-Id: I5c3fb5ab00bff66a8e8f4b8d27cbcea4946eced0
2018-11-01vp8: remove VP8_ENTROPY_STATS codeJohann
Does not compile. Noticed while cleaning up un-namespaced functions Change-Id: I4a9048e66d051397f652e7b5412606a5e234f61f
2018-03-17VP8: Fix out of range index for mvcost.Jerome Jiang
Clamp index between 0 and MVvals. Bit exact for speed -8, -6 and -4 on RTC set. BUG=b/72510002 Change-Id: I61bdb02a0924e157b3c1980f74fbbfe5ce51bc44
2016-09-15apply clang-formatclang-format
Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487
2016-08-23Remove halfpix specializationJohann
This function only exists as a shortcut to subpixel variance with predefined offsets. xoffset = 4 for horizontal, yoffset = 4 for vertical and both for "hv" Removing this allows the existing optimizations for the variance functions to be called. Instead of having only sse2 optimizations, this gives sse2, ssse3, msa and neon. BUG=webm:1273 Change-Id: Ieb407b423b91b87d33c4263c6a1ad5e673b0efd6
2016-07-19vp8: remove extra semicolonsJames Zern
Change-Id: I84e1a293ee033865f82c244e8aaaadfb2fb27e63
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-18prepend ++ instead of post in for loops.Jim Bankoski
Applied the following regex : search for: (for.*\(.*;.*;) ([a-zA-Z_]*)\+\+\) replace with: \1 ++\2) This misses some for loops: ie : for (mb_col = 0; mb_col < oci->mb_cols; mb_col++, mi++) Change-Id: Icf5f6fb93cced0992e0bb71d2241780f7fb1f0a8
2016-07-15vp8: apply clang-formatclang-format
Change-Id: I7605b6678014a5426ceb45c27b54885e0c4e06ed
2016-05-09Alignment is required for sad_array8Johann
For at least some of the implementations of sdx8f, such as vpx_sad4x4x8_sse4_1, aligned moves are used to move the results into the array. Change-Id: I83df5a8e657b44e906d0d8b0bc154f1e5660f7f9
2015-08-31Include vpx_dsp_common.h when using VPXMIN/MAXJohann
Change-Id: I2e387a06484a06301f3cd6600c4ba2f4335b61ee
2015-08-27vp8: use VPX(MIN|MAX) from vpx_dsp_common.hJames Zern
remove MIN/MAX defines in vp8/common/common.h Change-Id: I41520f34af175e05b263ebd12198f4de29a967db
2015-05-07replace DECLARE_ALIGNED_ARRAY w/DECLARE_ALIGNEDJames Zern
this macro was used inconsistently and only differs in behavior from DECLARE_ALIGNED when an alignment attribute is unavailable. this macro is used with calls to assembly, while generic c-code doesn't rely on it, so in a c-only build without an alignment attribute the code will function as expected. Change-Id: Ie9d06d4028c0de17c63b3a27e6c1b0491cc4ea79
2015-05-06Move shared SAD code to vpx_dspJohann
Create a new component, vpx_dsp, for code that can be shared between codecs. Move the SAD code into the component. This reduces the size of vpxenc/dec by 36k on x86_64 builds. Change-Id: I73f837ddaecac6b350bf757af0cfe19c4ab9327a
2015-04-28vpx_mem: remove vpx_memsetJames Zern
vestigial. replace instances with memset() which they already were being defined to. Change-Id: Ie030cfaaa3e890dd92cf1a995fcb1927ba175201
2014-12-16Silence -Werror=unused-parameterJohann
Cast away remaining issues so that new ones don't get lost in the noise. Change-Id: Iacd6999b0686ce80f9835730d68db6382690fa92
2014-09-25Fix IOCsYaowu Xu
A left shift of negative value causes IOC runtime warnings, this commit converts two such left shifts to multiply to avoid IOCs. Change-Id: I8811428768d7135e6e16af4b3094d0341589a995
2014-05-15Revert "Remove Wextra warnings from vp9_sad.c"Jim Bankoski
This reverts commit 7ab9a9587b96db4edce6be916c1f02297a9555ff Nightly test http://build.webmproject.org/jenkins/view/libvpx-nightly-tests/job/libvpx%20unit%20tests%20(valgrind-2)/arch=x86_64-linux-gcc,filter=-*VP8*:*Large.*/276/console Failed This patch did not address all the assembly issues some of the vp8 assembly counts on 5 arguments being passed in to this function: one example : vp8_sad8x16_wmt Please address or split this into vp9 and vp8 patches. Change-Id: I78afcc171649894f887bb8ee3c66de24aaddc7ca
2014-05-14Remove Wextra warnings from vp9_sad.cDeb Mukherjee
As a side-effect, the max_sad check is removed from the C-implementation of VP8, for consistency with VP9, and to ensure that the SAD tests common to VP8/VP9 pass. That will make the VP8 C implementation of sad a little slower but given that is rarely used in practice, the impact will be minimal. Change-Id: I7f43089fdea047fbf1862e40c21e4715c30f07ca
2014-04-23Add VPXD_SET_DECRYPTOR support to the VP9 decoder.Joey Parrish
Change-Id: I88f86c8ff9af34e0b6531028b691921b54c2fc48
2013-09-23fix integer overflow in vp8Yaowu Xu
Change-Id: I62550a7a883115f3ce878710cf3bb039bea54390
2013-04-19Merge "Removed shadow warnings : mcomp.c rdopt.c"Scott LaVarnway
2013-03-18ENTROPY_STATS -> VP8_ENTROPY_STATS in vp8/.Ronald S. Bultje
Change-Id: I0027483e47900de84394de47c3273cc8292e6119
2013-03-14Removed shadow warnings : mcomp.c rdopt.cScott LaVarnway
Adding -Wshadow to CFLAGS generated a bunch of warnings. This patch removes these warnings. Change-Id: Ib498de4b8652051d257cf86dcb40d2968a5013ae
2013-02-22vp8/encoder/mcomp.c: remove an unused variableJames Zern
Change-Id: I980da3c70f7cee1b723ede0ed2ae527ac7cd6a51
2012-07-27Be consistent with SAD valuesJohann
SAD returns unsigned values. Make all the declarations the same. Remove bestsad initialization and check. It is always set to the result of a SAD call so it will never remain UINT_MAX Use ja instead of jg to test unsigned comparison instead of signed. Update test. Change-Id: I46336ab45f4e60fc37caf20bd36bc5782079c7a5
2012-07-26SAD cosmetic cleanupJohann
Change-Id: Iae915f2988081697cca6b65943afaca1d8de8df3
2012-06-11Fix pedantic compiler warningsJohn Koleszar
Allows building the library with the gcc -pedantic option, for improved portabilty. In particular, this commit removes usage of C99/C++ style single-line comments and dynamic struct initializers. This is a continuation of the work done in commit 97b766a46, which removed most of these warnings for decode only builds. Change-Id: Id453d9c1d9f44cc0381b10c3869fabb0184d5966
2012-04-27Removed MV costing from ARNR filteringAdrian Grange
The ARNR filter uses a motion compensated temporal filter, but the motion estimation implementation accounts for the cost of the mv in its decision making process. The ARNR filter uses a dummy cost table initialized to 0 as a way to ignore the mv costs (which are irrelevant to the filter). This CL modifies the ARNR filter implementation so that the mv costing is ignored without the requirement for dummy tables. Change-Id: I4196aa5c24da63f858ff54fbaa5fc85ae1f1957f
2012-01-31BLOCKD structure cleanupScott LaVarnway
Removed redundancies. All of the information can be found in the MACROBLOCKD structure. Change-Id: I7556392c6f67b43bef2a5e9932180a737466ef93
2012-01-30RTCD: add motion search functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. Change-Id: Ia5828b7ecc80db55b21916704aa3d54cbb98f625
2011-12-21squash some signed/unsigned comparison warningsJames Zern
Change-Id: Ifc64cf990ae04d77934da3324d0afb3993f061e7
2011-12-05Multiple-resolution encoderYunqing Wang
The example encoder down-samples the input video frames a number of times with a down-sampling factor, and then encodes and outputs bitstreams with different resolutions. Support arbitrary down-sampling factor, and down-sampling factor can be different for each encoding level. For example, the encoder can be tested as follows. 1. Configure with multi-resolution encoding enabled: ../libvpx/configure --target=x86-linux-gcc --disable-codecs --enable-vp8 --enable-runtime_cpu_detect --enable-debug --disable-install-docs --enable-error-concealment --enable-multi-res-encoding 2. Run make 3. Encode: If input video is 1280x720, run: ./vp8_multi_resolution_encoder 1280 720 input.yuv 1.ivf 2.ivf 3.ivf 1 (output: 1.ivf(1280x720); 2.ivf(640x360); 3.ivf(320x180). The last parameter is set to 1/0 to show/not show PSNR.) 4. Decode: ./simple_decoder 1.ivf 1.yuv ./simple_decoder 2.ivf 2.yuv ./simple_decoder 3.ivf 3.yuv 5. View video: mplayer 1.yuv -demuxer rawvideo -rawvideo w=1280:h=720 -loop 0 -fps 30 mplayer 2.yuv -demuxer rawvideo -rawvideo w=640:h=360 -loop 0 -fps 30 mplayer 3.yuv -demuxer rawvideo -rawvideo w=320:h=180 -loop 0 -fps 30 The encoding parameters can be modified in vp8_multi_resolution_encoder.c, for example, target bitrate, frame rate... Modified API. John helped a lot with that. Thanks! Change-Id: I03be9a51167eddf94399f92d269599fb3f3d54f5
2011-09-22Replace vpx_ports/config.h with vpx_config.hAttila Nagy
Just a clean-up. Change-Id: Iea5b6dc925dcfa7db548bc1ab1a13d26ed5a2c9a
2011-08-03Adjust half-pixel only searchYunqing Wang
Changed motion search in vp8_find_best_half_pixel_step() to be the same as in vp8_find_best_sub_pixel_step(), which checks 5 points instead of 8 points. This only affects real-time mode with cpu-used >=9. Tests showed it gives 2% encoding speedup with a quality loss(psnr) of up to 0.5%. Change-Id: I16049cad1535002346d46cfdfad345bfc3dc5146
2011-07-27Preload reference area in sub-pixel motion search (real-time mode)Yunqing Wang
This change implemented same idea in change "Preload reference area to an intermediate buffer in sub-pixel motion search." The changes were made to vp8_find_best_sub_pixel_step() and vp8_find_best_half _pixel_step() functions which are called when speed >= 5. Test result (using tulip clip): 1. On Core2 Quad machine(Linux) rt mode, speed (-5 ~ -8), encoding speed gain: 2% ~ 3% rt mode, speed (-9 ~ -11), encoding speed gain: 1% ~ 2% rt mode, speed (-12 ~ -14), no noticeable encoding speed gain 2. On Xeon machine(Linux) Test on speed (-5 ~ -14) didn't show noticeable speed change. Change-Id: I21bec2d6e7fbe541fcc0f4c0366bbdf3e2076aa2
2011-07-27Fix range checks in motion searchYunqing Wang
There were some situations that the start motion vectors were out of range. This fix adjusted range checks to make sure they are checked and clamped. Change-Id: Ife83b7fed0882bba6d1fa559b6e63c054fd5065d
2011-07-22Preload reference area to an intermediate buffer in sub-pixel motion searchYunqing Wang
In sub-pixel motion search, the search range is small(+/- 3 pixels). Preload whole search area from reference buffer into a 32-byte aligned buffer. Then in search, load reference data from this buffer instead. This keeps data in cache, and reduces the crossing cache- line penalty. For tulip clip, tests on Intel Core2 Quad machine(linux) showed encoder speed improvement: 3.4% at --rt --cpu-used =-4 2.8% at --rt --cpu-used =-3 2.3% at --rt --cpu-used =-2 2.2% at --rt --cpu-used =-1 Test on Atom notebook showed only 1.1% speed improvement(speed=-4). Test on Xeon machine also showed less improvement, since unaligned data access latency is greatly reduced in newer cores. Next, I will apply similar idea to other 2 sub-pixel search functions for encoding speed > 4. Make this change exclusively for x86 platforms. Change-Id: Ia7bb9f56169eac0f01009fe2b2f2ab5b61d2eb2f
2011-07-08Adjust full-pixel clamping and motion vector limit calculationYunqing Wang
Do mvp clamping in full-pixel precision instead of 1/8-pixel precision to avoid error caused by right shifting operation. Also, further fixed the motion vector limit calculation in change: b7480454706a6b15bf091e659cd6227ab373c1a6 Change-Id: Ied88a4f7ddfb0476eb9f7afc6ceeddbf209fffd7
2011-06-30Bug fix in motion vector limit calculationYunqing Wang
Motion vector limits are calculated using right shifts, which could give wrong results for negative numbers. James Berry's test on one clip showed encoder produced some artifacts. This change fixed that. Change-Id: I035fc02280b10455b7f6eb388f7c2e33b796b018
2011-06-17Remove unnecessary bounds checking in motion searchYunqing Wang
The starting points are always within the limits, and bounds checking on these points is not needed. For speed < 5, the encoded result changes a little because different treatment is taken while starting point equals the bounds. Change-Id: I09a402d310f51e305a3519f1601b1d17b05c6152
2011-06-06Remove hex search's variance calculation while in real-time modeYunqing Wang
In real-time mode motion search, there is no need to calculate variance. This change improved encoding speed by 1% ~ 2%(speed=-5). Change-Id: I65b874901eb599ac38fe8cf9cad898c14138d431