2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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.
12 #ifndef __INC_FINDNEARMV_H
13 #define __INC_FINDNEARMV_H
18 #include "treecoder.h"
24 } int_mv
; /* facilitates rapid equality tests */
26 static void mv_bias(int refmb_ref_frame_sign_bias
, int refframe
, int_mv
*mvp
, const int *ref_frame_sign_bias
)
31 if (refmb_ref_frame_sign_bias
!= ref_frame_sign_bias
[refframe
])
40 #define LEFT_TOP_MARGIN (16 << 3)
41 #define RIGHT_BOTTOM_MARGIN (16 << 3)
42 static void vp8_clamp_mv(MV
*mv
, const MACROBLOCKD
*xd
)
44 if (mv
->col
< (xd
->mb_to_left_edge
- LEFT_TOP_MARGIN
))
45 mv
->col
= xd
->mb_to_left_edge
- LEFT_TOP_MARGIN
;
46 else if (mv
->col
> xd
->mb_to_right_edge
+ RIGHT_BOTTOM_MARGIN
)
47 mv
->col
= xd
->mb_to_right_edge
+ RIGHT_BOTTOM_MARGIN
;
49 if (mv
->row
< (xd
->mb_to_top_edge
- LEFT_TOP_MARGIN
))
50 mv
->row
= xd
->mb_to_top_edge
- LEFT_TOP_MARGIN
;
51 else if (mv
->row
> xd
->mb_to_bottom_edge
+ RIGHT_BOTTOM_MARGIN
)
52 mv
->row
= xd
->mb_to_bottom_edge
+ RIGHT_BOTTOM_MARGIN
;
55 void vp8_find_near_mvs
58 const MODE_INFO
*here
,
59 MV
*nearest
, MV
*nearby
, MV
*best
,
60 int near_mv_ref_cts
[4],
62 int *ref_frame_sign_bias
65 vp8_prob
*vp8_mv_ref_probs(
66 vp8_prob p
[VP8_MVREFS
-1], const int near_mv_ref_ct
[4]
69 const B_MODE_INFO
*vp8_left_bmi(const MODE_INFO
*cur_mb
, int b
);
71 const B_MODE_INFO
*vp8_above_bmi(const MODE_INFO
*cur_mb
, int b
, int mi_stride
);