2
0

mcomp.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_VP8_ENCODER_MCOMP_H_
  11. #define VPX_VP8_ENCODER_MCOMP_H_
  12. #include "block.h"
  13. #include "vpx_dsp/variance.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* The maximum number of steps in a step search given the largest allowed
  18. * initial step
  19. */
  20. #define MAX_MVSEARCH_STEPS 8
  21. /* Max full pel mv specified in 1 pel units */
  22. #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1)
  23. /* Maximum size of the first step in full pel units */
  24. #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS - 1))
  25. int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int Weight);
  26. void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride);
  27. void vp8_init3smotion_compensation(MACROBLOCK *x, int stride);
  28. int vp8_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
  29. int_mv *best_mv, int search_param, int sad_per_bit,
  30. const vp8_variance_fn_ptr_t *vfp, int *mvsadcost[2],
  31. int *mvcost[2], int_mv *center_mv);
  32. typedef int(fractional_mv_step_fp)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
  33. int_mv *bestmv, int_mv *ref_mv,
  34. int error_per_bit,
  35. const vp8_variance_fn_ptr_t *vfp,
  36. int *mvcost[2], int *distortion,
  37. unsigned int *sse);
  38. fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively;
  39. fractional_mv_step_fp vp8_find_best_sub_pixel_step;
  40. fractional_mv_step_fp vp8_find_best_half_pixel_step;
  41. fractional_mv_step_fp vp8_skip_fractional_mv_step;
  42. typedef int (*vp8_full_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
  43. int_mv *ref_mv, int sad_per_bit,
  44. int distance, vp8_variance_fn_ptr_t *fn_ptr,
  45. int *mvcost[2], int_mv *center_mv);
  46. typedef int (*vp8_refining_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
  47. int_mv *ref_mv, int sad_per_bit,
  48. int distance,
  49. vp8_variance_fn_ptr_t *fn_ptr,
  50. int *mvcost[2], int_mv *center_mv);
  51. typedef int (*vp8_diamond_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
  52. int_mv *ref_mv, int_mv *best_mv,
  53. int search_param, int sad_per_bit,
  54. int *num00,
  55. vp8_variance_fn_ptr_t *fn_ptr,
  56. int *mvcost[2], int_mv *center_mv);
  57. #ifdef __cplusplus
  58. } // extern "C"
  59. #endif
  60. #endif // VPX_VP8_ENCODER_MCOMP_H_