summaryrefslogtreecommitdiff
path: root/vp8/encoder/pickinter.c
AgeCommit message (Collapse)Author
2011-06-15Use SSE as BPRED distortion metric consistentlyJohn Koleszar
The BPRED mode selection uses SSE as a distortion metric, but the early breakout threshold being used was a variance value. Change-Id: I42d4602fb9b548bf681a36445701fada5e73aff1
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-13Calc ref_frame_cost once per frameScott LaVarnway
instead of every macro block. Change-Id: I2604e94c6b89e3a8457777e21c8c38406d55b165
2011-06-09remove one set of 16x16 variance funcationsYaowu Xu
call to this set of functions are replaced by var16x16. Change-Id: I5ff1effc6c1358ea06cda1517b88ec28ef551b0d
2011-06-08vp8_pick_inter_mode: remove best_bmodesJohn Koleszar
Since BPRED will be tested at most once, and SPLITMV is not enabled, there's nothing to clobber the subblock modes, so there's no need to save and restore them. Change-Id: I7c3615b69190c10bd068a44df5488d6e8b85a364
2011-06-08vp8_pick_intra_mode: correct returned rateJohn Koleszar
The returned rate was always the 4x4 rate, instead of the rate matching the selected mode. Change-Id: I51da31f80884f5e37f3bcc77d1047d31e612ded4
2011-06-08Move RD intra block mode selection to rdopt.cJohn Koleszar
This change is analogous to I0b67dae1f8a74902378da7bdf565e39ab832dda7, which made the move for the non-RD path. Change-Id: If63fc1b0cd1eb7f932e710f83ff24d91454f8ed1
2011-06-08Move intra block mode selection to pickinter.cJohn Koleszar
This commit moves the intra block mode selection from encodeframe.c to pickinter.c (in the non-RD case). This allowed pick_intra_mbuv_mode and pick_intra4x4mby_modes to be made static, and is a step towards refactoring intra mode selection in the main pickinter loop. Gave a small perf increase (~0.5%). Change-Id: I0b67dae1f8a74902378da7bdf565e39ab832dda7
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
2011-06-03Merge "Removed B_MODE_INFO"Scott LaVarnway
2011-06-03Adjust bounds checking for hex search in real-time modeYunqing Wang
Currently, hex search couldn't guarantee the motion vector(MV) found is within the limit of maximum MV. Therefore, very large motion vectors resulted from big motion in the video could cause encoding artifacts. This change adjusted hex search bounds checking to make sure the resulted motion vector won't go out of the range. James Berry, thank you for finding the bug. Change-Id: If2c55edd9019e72444ad9b4b8688969eef610c55
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-06-01further clean up of errorperbit and sadperbitYaowu Xu
this commit makes the usage errorperbit and sadperbit consistent for encoding modes and passes. Removed all different magic weight factors associated with errorperbit. Now 1/2 is used for both sadperbit16 and sadperbit4, the /2 operation is merged into initializations of the 2 variables. Tests on cif set show .23%, 0.18% and 0.19% gain by avg psnr, overall psnr and ssim respectively. Change-Id: Ifa285c3e065ce0a5a77addfc9f95aabf54ee270d
2011-06-01remove some magic weights associated with sad_per_bitYaowu Xu
sad_per_bit has been used for a number of motion vector search routines with different magic weights: 1, 1/2 and 1/4. This commit remove these magic numbers and use 1/2 for all motion search routines, also reformat a number of source code lines to within 80 column limit. Test on cif set shows overall effect is neutral on all metrics. <=0.01% Change-Id: I8a382821fa4cffc9c0acf8e8431435a03df74885
2011-05-31vp8_pick_inter_mode code cleanupScott LaVarnway
Small code cleanups before attempting to reduce the size of bmi found in BLOCKD. Change-Id: Ie9c14adb53afd847716a75bcce067d0e6c04f225
2011-05-25Return sse value in vp8_variance SSE2 functionsYunqing Wang
Minor modification. Change-Id: I09511d38fd1451d5c4106a48acdb3f766ce59cb7
2011-05-24Fix a bug happening while encoding at profile=3Yunqing Wang
While profile=3, there is no sub-pixel search. Distortion and SSE have to calculated using get_inter_mbpred_error(). Change-Id: Ifb36e17eef7750af93efa7d0e2870142ef540184
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-20Merge "revise two function definitions with less parameters"Yaowu Xu
2011-05-20Merge "Remove unused members of VP8_COMP"John Koleszar
2011-05-19revise two function definitions with less parametersYaowu Xu
Change-Id: Ia96e5bf915e4d3c0ac9c1795114bd9e5dd07327a
2011-05-19Remove unused members of VP8_COMPJohn Koleszar
Various members that were either completely unreferenced or written and not read. Change-Id: Ie41ebac0ff0364a76f287586e4fe09a68907806e
2011-05-19Using partition_info instead of blockd info for splitmvScott LaVarnway
The partition_info struct contains info just for SPLITMV, so it should be used instead of BLOCKD. Eventually, I want to reduce the size of B_MODE_INFO struct found in BLOCKD, so this is the first step toward that goal. Also, since SPLITMV is not supported in vp8_pick_inter_mode(), the unnecessary mem copies and checks were removed. For rt encodes, this gave a slight performance improvement. Change-Id: I5585c98fa9d5acbde1c7e0f452a01d9ecc080574
2011-05-18Merge "Modify MVcount in pick_inter_mode to eliminate calling of ↵Yunqing Wang
vp8_find_near_mvs"
2011-05-18Fix a bug in vp8_clamp_mv functionYunqing Wang
Scott fixed the bug in MV clamping function in encoder, which could cause artifacts. Change-Id: Id05f2794c43c31cdd45e66179c8811f3ee452cb9
2011-05-17Modify MVcount in pick_inter_mode to eliminate calling of vp8_find_near_mvsYunqing Wang
Moved MVcount modification in pick_inter_mode, and eliminated calling of vp8_find_near_mvs. Change-Id: Icd47448a1dfc8fdf526f86757d0e5a7f218cb5e8
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-04-27SSE2/SSSE3 optimizations for build_predictors_mbuv{,_s}().Ronald S. Bultje
decoding before 10.425 10.432 10.423 =10.426 after: 10.405 10.416 10.398 =10.406, 0.2% faster encoding before 14.252 14.331 14.250 14.223 14.241 14.220 14.221 =14.248 after 14.095 14.090 14.085 14.095 14.064 14.081 14.089 =14.086, 1.1% faster Change-Id: I483d3d8f0deda8ad434cea76e16028380722aee2
2011-04-21Removed dc_diff from MB_MODE_INFOScott LaVarnway
The dc_diff flag is used to skip loopfiltering. Instead of setting this flag in the decoder/encoder, we now check for this condition in the loopfilter. Change-Id: Ie2b9cdf9e0f4e8b932bbd36e0878c05bffd28931
2011-04-18Merge "Use sub-pixel search's SSE in mode selection"Yunqing Wang
2011-04-18Use sub-pixel search's SSE in mode selectionYunqing Wang
Passed SSE from sub-pixel search back to pick_inter_mode function, which is compared with the encode_breakout to see if we could skip evaluating the remaining modes. Change-Id: I4a86442834f0d1b880a19e21ea52d17d505f941d
2011-04-15Merge "Fix usage of value returned by vp8_pick_intra4x4mby_modes"Adrian Grange
2011-04-15Merge "Reduce unnecessary distortion computation"Yunqing Wang
2011-04-14Reduce unnecessary distortion computationYunqing Wang
In vp8_pick_inter_mode(), for NEWMV mode, use the error result got from motion search as distortion. This helps performance in real- time mode. Change-Id: I398c4e46cc5381f7d874e748cf78827ef0e0860c
2011-04-14Fix usage of value returned by vp8_pick_intra4x4mby_modesAdrian Grange
The value of distortion2 returned by vp8_pick_intra4x4mby_modes was being overwritten by the value returned by get16x16prederror before it was tested. Change-Id: If00e80332b272c5545c3a7e381c8041e8319b41a
2011-04-13Fixed use of early breakout in vp8_pick_intra4x4mby_modesAdrian Grange
Index i is used to detect early breakout from the first loop, but its value is lost due to reuse in the second for loop. I moved the position of the second loop and did some format cleanup. Change-Id: I02780eae1bd89df4b6c000fb8a018b0837aac2e5
2011-04-12Merge "Bugfix for error accumulator stats"John Koleszar
2011-04-12Bugfix for error accumulator statsJohn Koleszar
Previous to commit de4e9e3, there was an early return in the alt-ref case that was inadvertantly removed when the function was refactored to return void. This patch restores the prior behavior. Change-Id: I783ffd594a4690297e2742f99526fd7ad67698b2
2011-04-11Define RDCOST only onceYunqing Wang
Clean up the code. Change-Id: I7db048efa4d972b528d553a7921bc45979621129
2011-04-08Error accumulator stats bug.Paul Wilkins
The error accumulator stats values cpi->prediction_error and cpi->intra_error were being populated with rd values not distortion values. These are only "currently" used in a limited way for RT compress key frame detection. Change-Id: I2702ba1cab6e49ab8dc096ba75b6b34ab3573021
2011-04-01Use full-pixel MV in mvsadcost calculationYunqing Wang
MV sad cost error is only used in full-pixel motion search, which only need full-pixel resolution instead of quarter-pixel resolution. This change reduced mvsadcost table size, and removed unneccessary pamameter passing since this table is constant once it is generated. Change-Id: I9f931e55f6abc3c99011321f1dfb2f3562e6f6b0
2011-03-11Move build_intra_predictors_mby to RTCD frameworkJohn Koleszar
The vp8_build_intra_predictors_mby and vp8_build_intra_predictors_mby_s functions had global function pointers rather than using the RTCD framework. This can show up as a potential data race with tools such as helgrind. See https://bugzilla.mozilla.org/show_bug.cgi?id=640935 for an example. Change-Id: I29c407f828ac2bddfc039f852f138de5de888534
2011-02-17Merge "Fix relative include paths"John Koleszar
2011-02-11Add improved_mv_pred flag in real-time modeYunqing Wang
As mentioned in check-in "Improve motion search in real-time mode", MV prediction calculation causes speed loss for speed 7 and above. This change added a flag to turn off this calculation for speed>6 in real-time mode. Change-Id: I9f4ae5a8bf449222d1784b54e7d315fc8347b2d1
2011-02-10Fix relative include pathsJohn Koleszar
Allow compiling without adding vp8/{common,encoder,decoder} to the include paths. Change-Id: Ifeb5dac351cdfadcd659736f5158b315a0030b6c
2011-02-10Improve motion search in real-time modeYunqing Wang
Applied better MV prediction in real-time mode, which improves the encoding quality. Used quarter-pixel search instead of iterative sub-pixel search for speed >=5 to improve encoding performance. Tests on the test set showed: 1. For speed=-5, quality improvement: 1.7% on AvgPSNR and 2.1% on SSIM, performance improvement: 3.6% (This counts in the performance lose caused by MV prediction calculation in "Improve MV prediction in vp8_pick_inter_mode() for speed>3"). 2. For speed=-8, quality improvement: 2.1% on AvgPSNR and 2.5% on SSIM. but, 6.9% performance decrease because of MV prediction calculation. This should be improved later. Change-Id: I349a96c452bd691081d8c8e3e54419e7f477bebd
2011-02-04Merge "Improve MV prediction in vp8_pick_inter_mode() for speed>3"Yunqing Wang
2011-02-01Moved rd calculation into vp8_pick_intra4x4mby_modesScott LaVarnway
Then removed unnecessary code. Change-Id: I142658815d843c9396b07881dbdd8d387c43c90e
2011-01-28Improve MV prediction in vp8_pick_inter_mode() for speed>3Yunqing Wang
Applied same method used in vp8_rd_pick_inter_mode() to improve the accuracy of MV prediction. Change-Id: Ia50ae26208b18482695601f32febd99fe89fbc17
2011-01-14Testing of modes with Alt Ref framePaul Wilkins
Previously when a frame was being overlaid on a previously coded alt ref frame we only checked the alt ref 0,0 mode. Where there is a possibility that the alt ref buffer is a filtered frame we should allow the other prediction modes as normal or at the least allow use of the last frame buffer. Change-Id: I4d6227223d125c96b4f3066ec6ec9484fee7768c