Fix multi-resolution threaded encoding
[profile/ivi/libvpx.git] / vp8 / encoder / mcomp.h
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
11
12 #ifndef __INC_MCOMP_H
13 #define __INC_MCOMP_H
14
15 #include "block.h"
16 #include "vp8/common/variance.h"
17
18 #ifdef ENTROPY_STATS
19 extern void init_mv_ref_counts();
20 extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]);
21 #endif
22
23
24 #define MAX_MVSEARCH_STEPS 8                                    // The maximum number of steps in a step search given the largest allowed initial step
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
27
28 extern void print_mode_context(void);
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);
31 extern void vp8_init3smotion_compensation(MACROBLOCK *x,  int stride);
32
33
34 extern int vp8_hex_search
35 (
36     MACROBLOCK *x,
37     BLOCK *b,
38     BLOCKD *d,
39     int_mv *ref_mv,
40     int_mv *best_mv,
41     int search_param,
42     int error_per_bit,
43     const vp8_variance_fn_ptr_t *vf,
44     int *mvsadcost[2],
45     int *mvcost[2],
46     int_mv *center_mv
47 );
48
49 typedef int (fractional_mv_step_fp)
50     (MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *bestmv, int_mv *ref_mv,
51      int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2],
52      int *distortion, unsigned int *sse);
53
54 extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively;
55 extern fractional_mv_step_fp vp8_find_best_sub_pixel_step;
56 extern fractional_mv_step_fp vp8_find_best_half_pixel_step;
57 extern fractional_mv_step_fp vp8_skip_fractional_mv_step;
58
59 typedef int (*vp8_full_search_fn_t)
60     (
61      MACROBLOCK *x,
62      BLOCK *b,
63      BLOCKD *d,
64      int_mv *ref_mv,
65      int sad_per_bit,
66      int distance,
67      vp8_variance_fn_ptr_t *fn_ptr,
68      int *mvcost[2],
69      int_mv *center_mv
70     );
71
72 typedef int (*vp8_refining_search_fn_t)
73     (
74      MACROBLOCK *x,
75      BLOCK *b,
76      BLOCKD *d,
77      int_mv *ref_mv,
78      int sad_per_bit,
79      int distance,
80      vp8_variance_fn_ptr_t *fn_ptr,
81      int *mvcost[2],
82      int_mv *center_mv
83     );
84
85 typedef int (*vp8_diamond_search_fn_t)
86     (
87      MACROBLOCK *x,
88      BLOCK *b,
89      BLOCKD *d,
90      int_mv *ref_mv,
91      int_mv *best_mv,
92      int search_param,
93      int sad_per_bit,
94      int *num00,
95      vp8_variance_fn_ptr_t *fn_ptr,
96      int *mvcost[2],
97      int_mv *center_mv
98     );
99
100 #endif