OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 | 11 |
12 #ifndef VP9_ENCODER_VP9_MCOMP_H_ | 12 #ifndef VP9_ENCODER_VP9_MCOMP_H_ |
13 #define VP9_ENCODER_VP9_MCOMP_H_ | 13 #define VP9_ENCODER_VP9_MCOMP_H_ |
14 | 14 |
15 #include "vp9/encoder/vp9_block.h" | 15 #include "vp9/encoder/vp9_block.h" |
16 #include "vp9/encoder/vp9_variance.h" | 16 #include "vp9/encoder/vp9_variance.h" |
17 | 17 |
18 // The maximum number of steps in a step search given the largest | 18 // The maximum number of steps in a step search given the largest |
19 // allowed initial step | 19 // allowed initial step |
20 #define MAX_MVSEARCH_STEPS 11 | 20 #define MAX_MVSEARCH_STEPS 11 |
21 // Max full pel mv specified in 1 pel units | 21 // Max full pel mv specified in the unit of full pixel |
22 #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1) | 22 // Enable the use of motion vector in range [-1023, 1023]. |
| 23 #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS - 1)) - 1) |
23 // Maximum size of the first step in full pel units | 24 // Maximum size of the first step in full pel units |
24 #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) | 25 #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) |
25 // Allowed motion vector pixel distance outside image border | 26 // Allowed motion vector pixel distance outside image border |
26 // for Block_16x16 | 27 // for Block_16x16 |
27 #define BORDER_MV_PIXELS_B16 (16 + VP9_INTERP_EXTEND) | 28 #define BORDER_MV_PIXELS_B16 (16 + VP9_INTERP_EXTEND) |
28 | 29 |
29 | 30 |
30 void vp9_clamp_mv_min_max(MACROBLOCK *x, MV *mv); | 31 void vp9_set_mv_search_range(MACROBLOCK *x, MV *mv); |
31 int vp9_mv_bit_cost(const MV *mv, const MV *ref, | 32 int vp9_mv_bit_cost(const MV *mv, const MV *ref, |
32 const int *mvjcost, int *mvcost[2], int weight); | 33 const int *mvjcost, int *mvcost[2], int weight); |
33 void vp9_init_dsmotion_compensation(MACROBLOCK *x, int stride); | 34 void vp9_init_dsmotion_compensation(MACROBLOCK *x, int stride); |
34 void vp9_init3smotion_compensation(MACROBLOCK *x, int stride); | 35 void vp9_init3smotion_compensation(MACROBLOCK *x, int stride); |
35 | 36 |
36 struct VP9_COMP; | 37 struct VP9_COMP; |
37 int vp9_init_search_range(struct VP9_COMP *cpi, int size); | 38 int vp9_init_search_range(struct VP9_COMP *cpi, int size); |
38 | 39 |
39 // Runs sequence of diamond searches in smaller steps for RD | 40 // Runs sequence of diamond searches in smaller steps for RD |
40 int vp9_full_pixel_diamond(struct VP9_COMP *cpi, MACROBLOCK *x, | 41 int vp9_full_pixel_diamond(struct VP9_COMP *cpi, MACROBLOCK *x, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 int forced_stop, // 0 - full, 1 - qtr only, 2 - half only | 96 int forced_stop, // 0 - full, 1 - qtr only, 2 - half only |
96 int iters_per_step, | 97 int iters_per_step, |
97 int *mvjcost, int *mvcost[2], | 98 int *mvjcost, int *mvcost[2], |
98 int *distortion, unsigned int *sse1, | 99 int *distortion, unsigned int *sse1, |
99 const uint8_t *second_pred, | 100 const uint8_t *second_pred, |
100 int w, int h); | 101 int w, int h); |
101 extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_iterative; | 102 extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_iterative; |
102 extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_tree; | 103 extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_tree; |
103 | 104 |
104 typedef int (*vp9_full_search_fn_t)(MACROBLOCK *x, | 105 typedef int (*vp9_full_search_fn_t)(MACROBLOCK *x, |
105 int_mv *ref_mv, int sad_per_bit, | 106 MV *ref_mv, int sad_per_bit, |
106 int distance, vp9_variance_fn_ptr_t *fn_ptr, | 107 int distance, vp9_variance_fn_ptr_t *fn_ptr, |
107 int *mvjcost, int *mvcost[2], | 108 int *mvjcost, int *mvcost[2], |
108 int_mv *center_mv, int n); | 109 const MV *center_mv, int n); |
109 | 110 |
110 typedef int (*vp9_refining_search_fn_t)(MACROBLOCK *x, | 111 typedef int (*vp9_refining_search_fn_t)(MACROBLOCK *x, |
111 int_mv *ref_mv, int sad_per_bit, | 112 MV *ref_mv, int sad_per_bit, |
112 int distance, | 113 int distance, |
113 vp9_variance_fn_ptr_t *fn_ptr, | 114 vp9_variance_fn_ptr_t *fn_ptr, |
114 int *mvjcost, int *mvcost[2], | 115 int *mvjcost, int *mvcost[2], |
115 int_mv *center_mv); | 116 const MV *center_mv); |
116 | 117 |
117 typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x, | 118 typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x, |
118 int_mv *ref_mv, int_mv *best_mv, | 119 MV *ref_mv, MV *best_mv, |
119 int search_param, int sad_per_bit, | 120 int search_param, int sad_per_bit, |
120 int *num00, | 121 int *num00, |
121 vp9_variance_fn_ptr_t *fn_ptr, | 122 vp9_variance_fn_ptr_t *fn_ptr, |
122 int *mvjcost, int *mvcost[2], | 123 int *mvjcost, int *mvcost[2], |
123 int_mv *center_mv); | 124 const MV *center_mv); |
124 | 125 |
125 int vp9_refining_search_8p_c(MACROBLOCK *x, | 126 int vp9_refining_search_8p_c(MACROBLOCK *x, |
126 int_mv *ref_mv, int error_per_bit, | 127 int_mv *ref_mv, int error_per_bit, |
127 int search_range, vp9_variance_fn_ptr_t *fn_ptr, | 128 int search_range, vp9_variance_fn_ptr_t *fn_ptr, |
128 int *mvjcost, int *mvcost[2], | 129 int *mvjcost, int *mvcost[2], |
129 int_mv *center_mv, const uint8_t *second_pred, | 130 int_mv *center_mv, const uint8_t *second_pred, |
130 int w, int h); | 131 int w, int h); |
131 #endif // VP9_ENCODER_VP9_MCOMP_H_ | 132 #endif // VP9_ENCODER_VP9_MCOMP_H_ |
OLD | NEW |