John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | /* |
John Koleszar | c2140b8 | 2010-09-09 08:16:39 -0400 | [diff] [blame] | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | * |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 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 |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 7 | * in the file PATENTS. All contributing project authors may |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 8 | * be found in the AUTHORS file in the root of the source tree. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | |
James Zern | bb28520 | 2013-12-15 18:25:05 -0800 | [diff] [blame] | 12 | #ifndef VP8_ENCODER_MCOMP_H_ |
| 13 | #define VP8_ENCODER_MCOMP_H_ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 14 | |
| 15 | #include "block.h" |
Johann | 6a82f0d | 2015-06-05 09:54:19 -0700 | [diff] [blame] | 16 | #include "vpx_dsp/variance.h" |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 17 | |
James Zern | 513fae3 | 2014-01-18 12:16:11 -0800 | [diff] [blame] | 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
Ronald S. Bultje | 65d2282 | 2013-03-18 15:28:51 -0700 | [diff] [blame] | 22 | #ifdef VP8_ENTROPY_STATS |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 23 | extern void init_mv_ref_counts(); |
| 24 | extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]); |
| 25 | #endif |
| 26 | |
| 27 | |
John Koleszar | 0164a1c | 2012-05-21 14:30:56 -0700 | [diff] [blame] | 28 | /* The maximum number of steps in a step search given the largest allowed |
| 29 | * initial step |
| 30 | */ |
| 31 | #define MAX_MVSEARCH_STEPS 8 |
| 32 | |
| 33 | /* Max full pel mv specified in 1 pel units */ |
| 34 | #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1) |
| 35 | |
| 36 | /* Maximum size of the first step in full pel units */ |
| 37 | #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 38 | |
| 39 | extern void print_mode_context(void); |
Scott LaVarnway | 6b25501 | 2011-05-12 10:50:16 -0400 | [diff] [blame] | 40 | extern int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int Weight); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 41 | extern void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride); |
| 42 | extern void vp8_init3smotion_compensation(MACROBLOCK *x, int stride); |
| 43 | |
| 44 | |
| 45 | extern int vp8_hex_search |
| 46 | ( |
| 47 | MACROBLOCK *x, |
| 48 | BLOCK *b, |
| 49 | BLOCKD *d, |
Scott LaVarnway | 6b25501 | 2011-05-12 10:50:16 -0400 | [diff] [blame] | 50 | int_mv *ref_mv, |
| 51 | int_mv *best_mv, |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 52 | int search_param, |
| 53 | int error_per_bit, |
John Koleszar | 209d82a | 2010-10-26 15:34:16 -0400 | [diff] [blame] | 54 | const vp8_variance_fn_ptr_t *vf, |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 55 | int *mvsadcost[2], |
Yunqing Wang | 41e6ece | 2011-02-07 19:16:15 -0500 | [diff] [blame] | 56 | int *mvcost[2], |
Scott LaVarnway | 6b25501 | 2011-05-12 10:50:16 -0400 | [diff] [blame] | 57 | int_mv *center_mv |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 58 | ); |
| 59 | |
John Koleszar | 209d82a | 2010-10-26 15:34:16 -0400 | [diff] [blame] | 60 | typedef int (fractional_mv_step_fp) |
Scott LaVarnway | 6b25501 | 2011-05-12 10:50:16 -0400 | [diff] [blame] | 61 | (MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *bestmv, int_mv *ref_mv, |
| 62 | int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2], |
| 63 | int *distortion, unsigned int *sse); |
John Koleszar | 0b0bc8d | 2012-01-12 16:55:44 -0800 | [diff] [blame] | 64 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 65 | extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively; |
| 66 | extern fractional_mv_step_fp vp8_find_best_sub_pixel_step; |
| 67 | extern fractional_mv_step_fp vp8_find_best_half_pixel_step; |
| 68 | extern fractional_mv_step_fp vp8_skip_fractional_mv_step; |
| 69 | |
John Koleszar | 0b0bc8d | 2012-01-12 16:55:44 -0800 | [diff] [blame] | 70 | typedef int (*vp8_full_search_fn_t) |
| 71 | ( |
| 72 | MACROBLOCK *x, |
| 73 | BLOCK *b, |
| 74 | BLOCKD *d, |
| 75 | int_mv *ref_mv, |
| 76 | int sad_per_bit, |
| 77 | int distance, |
| 78 | vp8_variance_fn_ptr_t *fn_ptr, |
| 79 | int *mvcost[2], |
| 80 | int_mv *center_mv |
| 81 | ); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 82 | |
John Koleszar | 0b0bc8d | 2012-01-12 16:55:44 -0800 | [diff] [blame] | 83 | typedef int (*vp8_refining_search_fn_t) |
| 84 | ( |
| 85 | MACROBLOCK *x, |
| 86 | BLOCK *b, |
| 87 | BLOCKD *d, |
| 88 | int_mv *ref_mv, |
| 89 | int sad_per_bit, |
| 90 | int distance, |
| 91 | vp8_variance_fn_ptr_t *fn_ptr, |
| 92 | int *mvcost[2], |
| 93 | int_mv *center_mv |
| 94 | ); |
Yunqing Wang | cb7b1fb | 2011-05-06 12:51:31 -0400 | [diff] [blame] | 95 | |
John Koleszar | 0b0bc8d | 2012-01-12 16:55:44 -0800 | [diff] [blame] | 96 | typedef int (*vp8_diamond_search_fn_t) |
| 97 | ( |
| 98 | MACROBLOCK *x, |
| 99 | BLOCK *b, |
| 100 | BLOCKD *d, |
| 101 | int_mv *ref_mv, |
| 102 | int_mv *best_mv, |
| 103 | int search_param, |
| 104 | int sad_per_bit, |
| 105 | int *num00, |
| 106 | vp8_variance_fn_ptr_t *fn_ptr, |
| 107 | int *mvcost[2], |
| 108 | int_mv *center_mv |
| 109 | ); |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 110 | |
James Zern | 513fae3 | 2014-01-18 12:16:11 -0800 | [diff] [blame] | 111 | #ifdef __cplusplus |
| 112 | } // extern "C" |
| 113 | #endif |
| 114 | |
James Zern | bb28520 | 2013-12-15 18:25:05 -0800 | [diff] [blame] | 115 | #endif // VP8_ENCODER_MCOMP_H_ |