summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_mcomp.c
AgeCommit message (Collapse)Author
2016-02-09Restore previous motion search bit-error scale.Alex Converse
The bit to error transformation got doubled as a result of going from 8-bit to 9-bit costs (change d13385c). Use defines to derive the scale numbers and comment some of the fields. derf: -0.023 BDRATE hevcmr: +0.067 BDRATE stdhd: +0.098 BDRATE (These are substantially smaller than than the original gains from 8 to 9 bit costing.) Change-Id: I6a2b3b029b2f1415e4f90a05709b2333ec0eea9b
2016-02-02Fix some interger overflow errorshui su
Change-Id: I7e44bd952f28ce9925e8bdf6ee8ca2bb13de1b49
2016-02-01Fix a signed overflow in vp9 motion cost.Alex Converse
Change-Id: I5975e3aede62202d8ee6ced33889350c0a56554a
2016-01-19VP9: Eliminate MB_MODE_INFOScott LaVarnway
Change-Id: Ifa607dd2bb366ce09fa16dfcad3cc45a2440c185
2016-01-13VP9: inline vp9_use_mv_hp()Scott LaVarnway
Change-Id: Ib275bfc4c29c572d6c70e5ec6dbfc241590d3e3e
2015-12-14move vp9_avg to vpx_dspJames Zern
Change-Id: I7bc991abea383db1f86c1bb0f2e849837b54d90f
2015-11-13Changes to exhaustive motion search.paulwilkins
This change alters the nature and use of exhaustive motion search. Firstly any exhaustive search is preceded by a normal step search. The exhaustive search is only carried out if the distortion resulting from the step search is above a threshold value. Secondly the simple +/- 64 exhaustive search is replaced by a multi stage mesh based search where each stage has a range and step/interval size. Subsequent stages use the best position from the previous stage as the center of the search but use a reduced range and interval size. For example: stage 1: Range +/- 64 interval 4 stage 2: Range +/- 32 interval 2 stage 3: Range +/- 15 interval 1 This process, especially when it follows on from a normal step search, has shown itself to be almost as effective as a full range exhaustive search with step 1 but greatly lowers the computational complexity such that it can be used in some cases for speeds 0-2. This patch also removes a double exhaustive search for sub 8x8 blocks which also contained a bug (the two searches used different distortion metrics). For best quality in my test animation sequence this patch has almost no impact on quality but improves encode speed by more than 5X. Restricted use in good quality speeds 0-2 yields significant quality gains on the animation test of 0.2 - 0.5 db with only a small impact on encode speed. On most clips though the quality gain and speed impact are small. Change-Id: Id22967a840e996e1db273f6ac4ff03f4f52d49aa
2015-11-11Add AVX vectorized vp9_diamond_search_sadGeza Lore
This function now has an AVX intrinsics version which is about 80% faster compared to the C implementation. This provides a 2-4% total speed-up for encode, depending on encoding parameters. The function utilizes 3 properties of the cost function lookup table, constructed in 'cal_nmvjointsadcost' and 'cal_nmvsadcosts'. For the joint cost: - mvjointsadcost[1] == mvjointsadcost[2] == mvjointsadcost[3] For the component costs: - For all i: mvsadcost[0][i] == mvsadcost[1][i] (equal per component cost) - For all i: mvsadcost[0][i] == mvsadcost[0][-i] (Cost function is even) These must hold, otherwise the AVX version of the function cannot be used. Change-Id: I6c2791d43022822a9e6ab43cd124a773946d0bdc
2015-11-06Revert "Add AVX vectorized vp9_diamond_search_sad"James Zern
This reverts commit f1342a7b070ef61b9fbdf03e899ac2107cfcb6bd. This breaks 32-bit builds: runtime error: load of misaligned address 0xf72fdd48 for type 'const __m128i' (vector of 2 'long long' values), which requires 16 byte alignment + _mm_set1_epi64x is incompatible with some versions of visual studio Change-Id: I6f6fc3c11403344cef78d1c432cdc9147e5c1673
2015-11-05Add AVX vectorized vp9_diamond_search_sadGeza Lore
This function now has an AVX intrinsics version which is about 80% faster compared to the C implementation. This provides a 2-4% total speed-up for encode, depending on encoding parameters. The function utilizes 3 properties of the cost function lookup table, constructed in 'cal_nmvjointsadcost' and 'cal_nmvsadcosts'. For the joint cost: - mvjointsadcost[1] == mvjointsadcost[2] == mvjointsadcost[3] For the component costs: - For all i: mvsadcost[0][i] == mvsadcost[1][i] (equal per component cost) - For all i: mvsadcost[0][i] == mvsadcost[0][-i] (Cost function is even) These must hold, otherwise the AVX version of the function cannot be used. Change-Id: I184055b864c5a2dc37b2d8c5c9012eb801e9daf6
2015-10-28Convert motion search config from AoS to SoAGeza Lore
This is a prerequisite for vectorizing vp9_diamond_search_sad_c. Change-Id: I49cd9148782410ca8b16e8a468ca9e7c6d088410
2015-08-31Include vpx_dsp_common.h when using VPXMIN/MAXJohann
Change-Id: I2e387a06484a06301f3cd6600c4ba2f4335b61ee
2015-08-28vp9_mcomp: make search functions privateJames Zern
vp9_full_pixel_search() can be used as a replacement as it dispatches to all search methods Change-Id: I57fcb79c1362b569dc95237bdcc8390f54efd440
2015-08-26vpx_dsp_common: add VPX prefix to MIN/MAXJames Zern
prevents redeclaration warnings; vp8 has its own define which will be resolved in a future commit Change-Id: Ic941fef3dd4262fcdce48b73075fe6b375f11c9c
2015-08-07Merge "Improve the second-level sub-pixel motion search"Yunqing Wang
2015-08-06Improve the second-level sub-pixel motion searchYunqing Wang
Re-investigated the second-level sub-pixel motion search. Improved the way of choosing search points. Rewrote the second-level search code. At speed 0, the borg tests showed: 1. for stdhd set, Avg PSNR gain: 0.216%; Overall PSNR gain: 0.196%; SSIM gain: 0.206%. Only 1 out of 15 clips showed PSNR loss. 2. for derf set, Avg PSNR gain: 0.171%; Overall PSNR gain: 0.192%; SSIM gain: 0.207%. Only 3 out of 30 clips showed PSNR losses. Added the condition for third-point checking, namely, less points were checked. Speed tests showed no speed loss(Avg 0.3% speedup at speed 0). Change-Id: I6284ebb3fa7ba63be8528184c49e06757211a7f1
2015-08-06Cosmetic - align format in vp9Jingning Han
Change-Id: I83ed3422f1f4009675ad2f5c4b7236bc7b83b30e
2015-08-04Minor adjustment in diagonal sub-pixel point checkingYunqing Wang
Choose a different diagonal point to check when the two costs are the same, making it consistent with the way we choose the best mv. This slightly changes the encoding result, and the derflr set borg test at speed 0 shows 0.027% Overall PSNR gain, 0.024% Avg PSNR gain, and 0.043% SSIM gain. Change-Id: Ic8ee3a6767394866d159e4f9e1c777604dd73c17
2015-08-04Small improvement in sub-pixel motion searchYunqing Wang
If the current best mv(namely, the search center) is still the best mv after the first level search, the second level checks is skipped. This patch doesn't change the bitstream. At speed 0, it speeds up the encoder by 1% - 2%. Change-Id: I054c91b884d3f7aef157436c061744562bd6506d
2015-06-12vp9_mcomp: make search_step_table staticJames Zern
Change-Id: I2552d8101cf49ed951782ab69adce407579700fc
2015-06-12vp9_mcomp: don't mark setup_center_error() inlineJames Zern
this function is a bit too involved for the hint; avoids a -Winline warning Change-Id: Ib82e424764aa78b37ddb94116e2b009a6de31d35
2015-06-03Make vp9 subpixel match vp8Johann
The only difference between the two was that the vp9 function allowed for every step in the bilinear filter (16 steps) while vp8 only allowed for half of those. Since all the call sites in vp9 (<< 1) the input, it only ever used the same steps as vp8. This will allow moving the subpel variance to vpx_dsp with the rest of the variance functions. Change-Id: I6fa2509350a2dc610c46b3e15bde98a15a084b75
2015-05-26Merge "Move variance functions to vpx_dsp"Johann
2015-05-26Move variance functions to vpx_dspJohann
subpel functions will be moved in another patch. Change-Id: Idb2e049bad0b9b32ac42cc7731cd6903de2826ce
2015-05-22Fix integral projection motion search for frame resizeJingning Han
This commit fixes the integral projection motion search crash when frame resize is used. It fixes issue 994. Change-Id: Ieeb52619121d7444f7d6b3d0cf09415f990d1506
2015-05-13Relocate memory operations for common codeJohann
With the sad functions, and hopefully the variance functions soon, moving to the vpx_dsp location, place the defines used in the reference C code in a common location. Change-Id: I4c8ce7778eb38a0a3ee674d2f1c488eda01cfeca
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-04-21Revert "Remove mi_grid_* structures."Scott LaVarnway
(see I3a05cf1610679fed26e0b2eadd315a9ae91afdd6) For the test clip used, the decoder performance improved by ~2%. This is also an intermediate step towards adding back the mode_info streams. Change-Id: Idddc4a3f46e4180fbebddc156c4bbf177d5c2e0d
2015-04-07vp9_full_search_sadx[38]: align sad arraysJames Zern
the sse4 code expects 16-byte aligned arrays; vp8 already had a similar change applied: b2aa401 Align SAD output array to be 16-byte aligned Change-Id: I5e902035e5a87e23309e151113f3c0d4a8372226
2015-03-16Refactor column integral projection computationJingning Han
Move the scaling factor outside column projection. This avoids repeated calculation of the same scaling factor. Profiling shows that the percentage of vp9_int_pro_col_sse2 of overall cycles goes from 2.29% down to 1.88%. Change-Id: I5ac4e324ab2d7f33ba2de66dd2a12e04e04dfd66
2015-03-14Fix 1-step refinement search tableJingning Han
Change-Id: I32f0bcb40c6e7ba63bfae487739ededd0b6b2dde
2015-03-13Use sdx4df to do 1-step refinementJingning Han
Change-Id: Ie0c3ef3ae3aedf049b1a296de607730b79c12672
2015-03-12Reset src buffer only once in vp9_int_pro_motion_estimationJingning Han
Change-Id: I5c96b6a25f9df60da65b7af7c92a921b611746e3
2015-03-12Reduce the number of full block SAD callsJingning Han
This commit uses a 6-point 1-step refine motion search in the integral projection based full pixel motion estimation, to replace the current 9-point search. It reduces runtime cost of speed -6 on some noisy clips, e.g., dark720p single thread 33314 b/f, 40.076 dB, 18231 ms -> 33307 b/f, 40.067 dB, 17768 ms The compression performance for rtc set remains unchanged. Change-Id: I194ea5a9ce52e5a10baeee36338633adc22f764c
2015-03-11Refactor to remove GLOBAL_MOTIONJingning Han
Make the vp9_int_pro_motion_estimation() function return zero motion vector if high bit depth is turned on, instead of removing it from compiled codes. Change-Id: Ia48f010eb590b2d517d5678c394110b326a1a95e
2015-03-05Move pred_mv assign outside integral projection motion searchJingning Han
Change-Id: I040b066fdce08e2f05115a22ea808715aa147779
2015-03-04Move integral projection motion search to vp9_mcomp.cJingning Han
Make it a general purpose fast motion estimation function, to be used in the mode search process. Change-Id: Ib354cb0e664dc61c30c0b2314297835ee75b157a
2015-02-03Remove unnecessary pointer checkJohann
The original implementation had the following comment: // Ignore mv costing if mvsadcost is NULL However the current implementation does not allow for this. If x exists then nmvsadcost must not be null. This removes the only warning from -Wpointer-bool-conversion https://code.google.com/p/webm/issues/detail?id=894 Change-Id: I1a2cee340d7972d41e1bbbe1ec8dfbe917667085
2014-12-05vp9 asserts: fix compile warningJames Zern
string literal to int within an assert Change-Id: I76a173f96b9add5bf27c3f5ad5d72c6f30e51629
2014-12-02Reinsert macro to fix issue 884.Peter de Rivaz
Change 72056 unfolded some macro definitions, but lost some alternative behaviour required for high bitdepth encodes. This causes the encoder to crash, see issue 884. Change-Id: I8ce4d73c9fe0a3c10ccb86fba210fabc8b2f0ccc
2014-11-17change to call vp9_refining_search_sad() directlyYaowu Xu
The function pointer in compressor instance does not change, so this commit changes to call the function directly. Change-Id: I9c9c460e3475711c384b74c9842f0b4f3d037cc5
2014-11-03Refactor sub-pixel motion search unitJingning Han
This commit unfolds the legacy macro definitions used in the sub-pixel motion search and refactors the operational flow for later optimizations. Change-Id: I3e3f770cad961d03d1a6eb0b2a0186cc77eaf2b8
2014-10-09Merge "Rename highbitdepth functions to use highbd prefix"Deb Mukherjee
2014-10-09Rename highbitdepth functions to use highbd prefixDeb Mukherjee
Uses highbd_ prefix convention consistently. Change-Id: I58f7f799a7ff8e32701bcd71c955bcf1cdd4581e
2014-10-08Subpel search cleanups and enhancementsDeb Mukherjee
- Some fixes to surface fit. - Returns variance function as cost rather than sad in the pattern search and diamond search functions. Only vp9_pattern_search_sad function used in bigdia search uses sad as integer 1-away costs. - Deploys SUBPEL_TREE_PRUNED_MORE for speed 4+. Results: derf [Speed 3]: About +0.036% in coding efficiency without any discernible speed loss. derf [Speed 4]: About 2-3% faster at -0.199% loss in coding efficiency. derf [Speed 5]: About 3-4% faster at -0.149% loss in coding efficiency. Change-Id: I8462f94f6adb46966ca964f2bd0400977357fd63
2014-09-29Adds two new subpel search methodsDeb Mukherjee
One is a more aggressive version of the pruned subpel tree search where only a single halfpel candidate is searched. The search candidate is based on a surface fit result. The other is a method to obtain the subpel position at one shot based on the same surface fit. The methods have not been deployed in any speed setting yet. Change-Id: I34fef3f2e34f11396c9d1ba97f4be8c4ffca62d3
2014-09-25Adds various high bit-depth encode functionsDeb Mukherjee
Change-Id: I6f67b171022bbc8199c6d674190b57f6bab1b62f
2014-09-23Pruned subpel search for speed 3.Deb Mukherjee
Adds code to return an integer cost list for NSTEP search. Then uses it for pruned subpel search in speed 3. derf: -0.06% Speed on mobcal 720p increaes from 10.28 fps to 10.65 fps. [Subject to further testing]. Change-Id: Ib591382d25b2c11bcaba9d3a27a93a9d1ab27a96
2014-09-12Use bigdia search with pruned subpel searchDeb Mukherjee
Improves function to return sad of integer pels by reusing integer pels already visited in the smallest scale. Turns on BIGDIA search for speed 4. Also, turns on the first version of the pruned subpel search at this speed. derf: -0.32% (speed 4) Speed seems to improve by at least 5% but subject to verification. Change-Id: Iaec8eaffd61d6237ac029e6a2a1b0a88b2a35271
2014-08-28Updates vp9_pattern search to return integer sadsDeb Mukherjee
Updates the vp9_pattern_search function to return integer one-away neighbors' sad values, for subsequent use in speeding up the sub-pel search. Also, removes code for the do_refine option which is not being used currently. Updates the integer and subpel functions to pass in a 5-element sad list for output or input. A new pruned sub-pel search algorithm is implemented that uses the sad returned from the integer pel search. But it is not deployed yet. Change-Id: Ifa9f5ad024b5b660570366d2bd900343e1891520