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: #ifndef VP9_COMMON_VP9_MV_H_ michael@0: #define VP9_COMMON_VP9_MV_H_ michael@0: michael@0: #include "vpx/vpx_integer.h" michael@0: michael@0: #include "vp9/common/vp9_common.h" michael@0: michael@0: typedef struct { michael@0: int16_t row; michael@0: int16_t col; michael@0: } MV; michael@0: michael@0: typedef union int_mv { michael@0: uint32_t as_int; michael@0: MV as_mv; michael@0: } int_mv; /* facilitates faster equality tests and copies */ michael@0: michael@0: typedef struct { michael@0: int32_t row; michael@0: int32_t col; michael@0: } MV32; michael@0: michael@0: static void clamp_mv(MV *mv, int min_col, int max_col, michael@0: int min_row, int max_row) { michael@0: mv->col = clamp(mv->col, min_col, max_col); michael@0: mv->row = clamp(mv->row, min_row, max_row); michael@0: } michael@0: michael@0: #endif // VP9_COMMON_VP9_MV_H_