michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: michael@0: #ifndef __INC_MCOMP_H michael@0: #define __INC_MCOMP_H michael@0: michael@0: #include "block.h" michael@0: #include "vp8/common/variance.h" michael@0: michael@0: #ifdef VP8_ENTROPY_STATS michael@0: extern void init_mv_ref_counts(); michael@0: extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]); michael@0: #endif michael@0: michael@0: michael@0: /* The maximum number of steps in a step search given the largest allowed michael@0: * initial step michael@0: */ michael@0: #define MAX_MVSEARCH_STEPS 8 michael@0: michael@0: /* Max full pel mv specified in 1 pel units */ michael@0: #define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1) michael@0: michael@0: /* Maximum size of the first step in full pel units */ michael@0: #define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1)) michael@0: michael@0: extern void print_mode_context(void); michael@0: extern int vp8_mv_bit_cost(int_mv *mv, int_mv *ref, int *mvcost[2], int Weight); michael@0: extern void vp8_init_dsmotion_compensation(MACROBLOCK *x, int stride); michael@0: extern void vp8_init3smotion_compensation(MACROBLOCK *x, int stride); michael@0: michael@0: michael@0: extern int vp8_hex_search michael@0: ( michael@0: MACROBLOCK *x, michael@0: BLOCK *b, michael@0: BLOCKD *d, michael@0: int_mv *ref_mv, michael@0: int_mv *best_mv, michael@0: int search_param, michael@0: int error_per_bit, michael@0: const vp8_variance_fn_ptr_t *vf, michael@0: int *mvsadcost[2], michael@0: int *mvcost[2], michael@0: int_mv *center_mv michael@0: ); michael@0: michael@0: typedef int (fractional_mv_step_fp) michael@0: (MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *bestmv, int_mv *ref_mv, michael@0: int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2], michael@0: int *distortion, unsigned int *sse); michael@0: michael@0: extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively; michael@0: extern fractional_mv_step_fp vp8_find_best_sub_pixel_step; michael@0: extern fractional_mv_step_fp vp8_find_best_half_pixel_step; michael@0: extern fractional_mv_step_fp vp8_skip_fractional_mv_step; michael@0: michael@0: typedef int (*vp8_full_search_fn_t) michael@0: ( michael@0: MACROBLOCK *x, michael@0: BLOCK *b, michael@0: BLOCKD *d, michael@0: int_mv *ref_mv, michael@0: int sad_per_bit, michael@0: int distance, michael@0: vp8_variance_fn_ptr_t *fn_ptr, michael@0: int *mvcost[2], michael@0: int_mv *center_mv michael@0: ); michael@0: michael@0: typedef int (*vp8_refining_search_fn_t) michael@0: ( michael@0: MACROBLOCK *x, michael@0: BLOCK *b, michael@0: BLOCKD *d, michael@0: int_mv *ref_mv, michael@0: int sad_per_bit, michael@0: int distance, michael@0: vp8_variance_fn_ptr_t *fn_ptr, michael@0: int *mvcost[2], michael@0: int_mv *center_mv michael@0: ); michael@0: michael@0: typedef int (*vp8_diamond_search_fn_t) michael@0: ( michael@0: MACROBLOCK *x, michael@0: BLOCK *b, michael@0: BLOCKD *d, michael@0: int_mv *ref_mv, michael@0: int_mv *best_mv, michael@0: int search_param, michael@0: int sad_per_bit, michael@0: int *num00, michael@0: vp8_variance_fn_ptr_t *fn_ptr, michael@0: int *mvcost[2], michael@0: int_mv *center_mv michael@0: ); michael@0: michael@0: #endif