1 /* 2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved 3 * 4 * This source code is subject to the terms of the BSD 2 Clause License and 5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 * was not distributed with this source code in the LICENSE file, you can 7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 * Media Patent License 1.0 was not distributed with this source code in the 9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 */ 11 12 #ifndef AOM_AV1_COMMON_MV_H_ 13 #define AOM_AV1_COMMON_MV_H_ 14 15 #include "EbBlockStructures.h" 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #define MARK_MV_INVALID(mv) \ 22 do { ((int_mv *)(mv))->as_int = INVALID_MV; } while (0); 23 #define CHECK_MV_EQUAL(x, y) (((x).row == (y).row) && ((x).col == (y).col)) 24 25 typedef union int_mv { 26 uint32_t as_int; 27 MV as_mv; 28 FULLPEL_MV as_fullmv; 29 } int_mv; /* facilitates faster equality tests and copies */ 30 31 // The mv limit for fullpel mvs 32 typedef struct { 33 int col_min; 34 int col_max; 35 int row_min; 36 int row_max; 37 } FullMvLimits; 38 39 // The mv limit for subpel mvs 40 typedef struct { 41 int col_min; 42 int col_max; 43 int row_min; 44 int row_max; 45 } SubpelMvLimits; 46 47 #endif // AOM_AV1_COMMON_MV_H_ 48