| 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 __INC_MCOMP_H | 12 #ifndef __INC_MCOMP_H |
| 13 #define __INC_MCOMP_H | 13 #define __INC_MCOMP_H |
| 14 | 14 |
| 15 #include "block.h" | 15 #include "block.h" |
| 16 #include "variance.h" | 16 #include "variance.h" |
| 17 | 17 |
| 18 #ifdef ENTROPY_STATS | 18 #ifdef ENTROPY_STATS |
| 19 extern void init_mv_ref_counts(); | 19 extern void init_mv_ref_counts(); |
| 20 extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]); | 20 extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]); |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 | 23 |
| 24 #define MAX_MVSEARCH_STEPS 8 // The maximum n
umber of steps in a step search given the largest allowed initial step | 24 #define MAX_MVSEARCH_STEPS 8 // The maximum n
umber of steps in a step search given the largest allowed initial step |
| 25 #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS+3)) - 8) // Max full pel
mv specified in 1/8 pel units | 25 #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1) // Max full pel
mv specified in 1 pel units |
| 26 #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) // Maximum size
of the first step in full pel units | 26 #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) // Maximum size
of the first step in full pel units |
| 27 | 27 |
| 28 extern void print_mode_context(void); | 28 extern void print_mode_context(void); |
| 29 extern int vp8_mv_bit_cost(MV *mv, MV *ref, int *mvcost[2], int Weight); | 29 extern int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int Weight); |
| 30 extern void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride); | 30 extern void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride); |
| 31 extern void vp8_init3smotion_compensation(MACROBLOCK *x, int stride); | 31 extern void vp8_init3smotion_compensation(MACROBLOCK *x, int stride); |
| 32 | 32 |
| 33 | 33 |
| 34 extern int vp8_hex_search | 34 extern int vp8_hex_search |
| 35 ( | 35 ( |
| 36 MACROBLOCK *x, | 36 MACROBLOCK *x, |
| 37 BLOCK *b, | 37 BLOCK *b, |
| 38 BLOCKD *d, | 38 BLOCKD *d, |
| 39 MV *ref_mv, | 39 int_mv *ref_mv, |
| 40 MV *best_mv, | 40 int_mv *best_mv, |
| 41 int search_param, | 41 int search_param, |
| 42 int error_per_bit, | 42 int error_per_bit, |
| 43 int *num00, | |
| 44 const vp8_variance_fn_ptr_t *vf, | 43 const vp8_variance_fn_ptr_t *vf, |
| 45 int *mvsadcost[2], | 44 int *mvsadcost[2], |
| 46 int *mvcost[2], | 45 int *mvcost[2], |
| 47 MV *center_mv | 46 int_mv *center_mv |
| 48 ); | 47 ); |
| 49 | 48 |
| 50 typedef int (fractional_mv_step_fp) | 49 typedef int (fractional_mv_step_fp) |
| 51 (MACROBLOCK *x, BLOCK *b, BLOCKD *d, MV *bestmv, MV *ref_mv, | 50 (MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *bestmv, int_mv *ref_mv, |
| 52 int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2]); | 51 int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2], |
| 52 int *distortion, unsigned int *sse); |
| 53 extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively; | 53 extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively; |
| 54 extern fractional_mv_step_fp vp8_find_best_sub_pixel_step; | 54 extern fractional_mv_step_fp vp8_find_best_sub_pixel_step; |
| 55 extern fractional_mv_step_fp vp8_find_best_half_pixel_step; | 55 extern fractional_mv_step_fp vp8_find_best_half_pixel_step; |
| 56 extern fractional_mv_step_fp vp8_skip_fractional_mv_step; | 56 extern fractional_mv_step_fp vp8_skip_fractional_mv_step; |
| 57 | 57 |
| 58 #define prototype_full_search_sad(sym)\ | 58 #define prototype_full_search_sad(sym)\ |
| 59 int (sym)\ | 59 int (sym)\ |
| 60 (\ | 60 (\ |
| 61 MACROBLOCK *x, \ | 61 MACROBLOCK *x, \ |
| 62 BLOCK *b, \ | 62 BLOCK *b, \ |
| 63 BLOCKD *d, \ | 63 BLOCKD *d, \ |
| 64 MV *ref_mv, \ | 64 int_mv *ref_mv, \ |
| 65 int error_per_bit, \ | 65 int sad_per_bit, \ |
| 66 int distance, \ | 66 int distance, \ |
| 67 vp8_variance_fn_ptr_t *fn_ptr, \ | 67 vp8_variance_fn_ptr_t *fn_ptr, \ |
| 68 int *mvcost[2], \ | 68 int *mvcost[2], \ |
| 69 int *mvsadcost[2], \ | 69 int_mv *center_mv \ |
| 70 MV *center_mv \ | 70 ) |
| 71 |
| 72 #define prototype_refining_search_sad(sym)\ |
| 73 int (sym)\ |
| 74 (\ |
| 75 MACROBLOCK *x, \ |
| 76 BLOCK *b, \ |
| 77 BLOCKD *d, \ |
| 78 int_mv *ref_mv, \ |
| 79 int sad_per_bit, \ |
| 80 int distance, \ |
| 81 vp8_variance_fn_ptr_t *fn_ptr, \ |
| 82 int *mvcost[2], \ |
| 83 int_mv *center_mv \ |
| 71 ) | 84 ) |
| 72 | 85 |
| 73 #define prototype_diamond_search_sad(sym)\ | 86 #define prototype_diamond_search_sad(sym)\ |
| 74 int (sym)\ | 87 int (sym)\ |
| 75 (\ | 88 (\ |
| 76 MACROBLOCK *x, \ | 89 MACROBLOCK *x, \ |
| 77 BLOCK *b, \ | 90 BLOCK *b, \ |
| 78 BLOCKD *d, \ | 91 BLOCKD *d, \ |
| 79 MV *ref_mv, \ | 92 int_mv *ref_mv, \ |
| 80 MV *best_mv, \ | 93 int_mv *best_mv, \ |
| 81 int search_param, \ | 94 int search_param, \ |
| 82 int error_per_bit, \ | 95 int sad_per_bit, \ |
| 83 int *num00, \ | 96 int *num00, \ |
| 84 vp8_variance_fn_ptr_t *fn_ptr, \ | 97 vp8_variance_fn_ptr_t *fn_ptr, \ |
| 85 int *mvsadcost[2], \ | |
| 86 int *mvcost[2], \ | 98 int *mvcost[2], \ |
| 87 MV *center_mv \ | 99 int_mv *center_mv \ |
| 88 ) | 100 ) |
| 89 | 101 |
| 90 #if ARCH_X86 || ARCH_X86_64 | 102 #if ARCH_X86 || ARCH_X86_64 |
| 91 #include "x86/mcomp_x86.h" | 103 #include "x86/mcomp_x86.h" |
| 92 #endif | 104 #endif |
| 93 | 105 |
| 94 typedef prototype_full_search_sad(*vp8_full_search_fn_t); | 106 typedef prototype_full_search_sad(*vp8_full_search_fn_t); |
| 95 extern prototype_full_search_sad(vp8_full_search_sad); | 107 extern prototype_full_search_sad(vp8_full_search_sad); |
| 96 extern prototype_full_search_sad(vp8_full_search_sadx3); | 108 extern prototype_full_search_sad(vp8_full_search_sadx3); |
| 97 extern prototype_full_search_sad(vp8_full_search_sadx8); | 109 extern prototype_full_search_sad(vp8_full_search_sadx8); |
| 98 | 110 |
| 111 typedef prototype_refining_search_sad(*vp8_refining_search_fn_t); |
| 112 extern prototype_refining_search_sad(vp8_refining_search_sad); |
| 113 extern prototype_refining_search_sad(vp8_refining_search_sadx4); |
| 114 |
| 99 typedef prototype_diamond_search_sad(*vp8_diamond_search_fn_t); | 115 typedef prototype_diamond_search_sad(*vp8_diamond_search_fn_t); |
| 100 extern prototype_diamond_search_sad(vp8_diamond_search_sad); | 116 extern prototype_diamond_search_sad(vp8_diamond_search_sad); |
| 101 extern prototype_diamond_search_sad(vp8_diamond_search_sadx4); | 117 extern prototype_diamond_search_sad(vp8_diamond_search_sadx4); |
| 102 | 118 |
| 103 #ifndef vp8_search_full_search | 119 #ifndef vp8_search_full_search |
| 104 #define vp8_search_full_search vp8_full_search_sad | 120 #define vp8_search_full_search vp8_full_search_sad |
| 105 #endif | 121 #endif |
| 106 extern prototype_full_search_sad(vp8_search_full_search); | 122 extern prototype_full_search_sad(vp8_search_full_search); |
| 107 | 123 |
| 124 #ifndef vp8_search_refining_search |
| 125 #define vp8_search_refining_search vp8_refining_search_sad |
| 126 #endif |
| 127 extern prototype_refining_search_sad(vp8_search_refining_search); |
| 128 |
| 108 #ifndef vp8_search_diamond_search | 129 #ifndef vp8_search_diamond_search |
| 109 #define vp8_search_diamond_search vp8_diamond_search_sad | 130 #define vp8_search_diamond_search vp8_diamond_search_sad |
| 110 #endif | 131 #endif |
| 111 extern prototype_diamond_search_sad(vp8_search_diamond_search); | 132 extern prototype_diamond_search_sad(vp8_search_diamond_search); |
| 112 | 133 |
| 113 typedef struct | 134 typedef struct |
| 114 { | 135 { |
| 115 prototype_full_search_sad(*full_search); | 136 prototype_full_search_sad(*full_search); |
| 137 prototype_refining_search_sad(*refining_search); |
| 116 prototype_diamond_search_sad(*diamond_search); | 138 prototype_diamond_search_sad(*diamond_search); |
| 117 } vp8_search_rtcd_vtable_t; | 139 } vp8_search_rtcd_vtable_t; |
| 118 | 140 |
| 119 #if CONFIG_RUNTIME_CPU_DETECT | 141 #if CONFIG_RUNTIME_CPU_DETECT |
| 120 #define SEARCH_INVOKE(ctx,fn) (ctx)->fn | 142 #define SEARCH_INVOKE(ctx,fn) (ctx)->fn |
| 121 #else | 143 #else |
| 122 #define SEARCH_INVOKE(ctx,fn) vp8_search_##fn | 144 #define SEARCH_INVOKE(ctx,fn) vp8_search_##fn |
| 123 #endif | 145 #endif |
| 124 | 146 |
| 125 #endif | 147 #endif |
| OLD | NEW |