mcomp.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 VP8_ENCODER_MCOMP_H_
  11. #define VP8_ENCODER_MCOMP_H_
  12. #include "block.h"
  13. #include "vpx_dsp/variance.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #ifdef VP8_ENTROPY_STATS
  18. extern void init_mv_ref_counts();
  19. extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]);
  20. #endif
  21. /* The maximum number of steps in a step search given the largest allowed
  22. * initial step
  23. */
  24. #define MAX_MVSEARCH_STEPS 8
  25. /* Max full pel mv specified in 1 pel units */
  26. #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1)
  27. /* Maximum size of the first step in full pel units */
  28. #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS - 1))
  29. extern void print_mode_context(void);
  30. extern int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int Weight);
  31. extern void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride);
  32. extern void vp8_init3smotion_compensation(MACROBLOCK *x, int stride);
  33. extern int vp8_hex_search(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
  34. int_mv *best_mv, int search_param, int error_per_bit,
  35. const vp8_variance_fn_ptr_t *vf, int *mvsadcost[2],
  36. int *mvcost[2], int_mv *center_mv);
  37. typedef int(fractional_mv_step_fp)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
  38. int_mv *bestmv, int_mv *ref_mv,
  39. int error_per_bit,
  40. const vp8_variance_fn_ptr_t *vfp,
  41. int *mvcost[2], int *distortion,
  42. unsigned int *sse);
  43. extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively;
  44. extern fractional_mv_step_fp vp8_find_best_sub_pixel_step;
  45. extern fractional_mv_step_fp vp8_find_best_half_pixel_step;
  46. extern fractional_mv_step_fp vp8_skip_fractional_mv_step;
  47. typedef int (*vp8_full_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
  48. int_mv *ref_mv, int sad_per_bit,
  49. int distance, vp8_variance_fn_ptr_t *fn_ptr,
  50. int *mvcost[2], int_mv *center_mv);
  51. typedef int (*vp8_refining_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
  52. int_mv *ref_mv, int sad_per_bit,
  53. int distance,
  54. vp8_variance_fn_ptr_t *fn_ptr,
  55. int *mvcost[2], int_mv *center_mv);
  56. typedef int (*vp8_diamond_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
  57. int_mv *ref_mv, int_mv *best_mv,
  58. int search_param, int sad_per_bit,
  59. int *num00,
  60. vp8_variance_fn_ptr_t *fn_ptr,
  61. int *mvcost[2], int_mv *center_mv);
  62. #ifdef __cplusplus
  63. } // extern "C"
  64. #endif
  65. #endif // VP8_ENCODER_MCOMP_H_