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_SCAN_H_
13 #define AOM_AV1_COMMON_SCAN_H_
14
15 #include "aom/aom_integer.h"
16 #include "aom_ports/mem.h"
17
18 #include "av1/common/av1_common_int.h"
19 #include "av1/common/blockd.h"
20 #include "av1/common/enums.h"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #define MAX_NEIGHBORS 2
27
28 enum {
29 SCAN_MODE_ZIG_ZAG,
30 SCAN_MODE_COL_DIAG,
31 SCAN_MODE_ROW_DIAG,
32 SCAN_MODE_COL_1D,
33 SCAN_MODE_ROW_1D,
34 SCAN_MODES
35 } UENUM1BYTE(SCAN_MODE);
36
37 extern const SCAN_ORDER av1_default_scan_orders[TX_SIZES];
38 extern const SCAN_ORDER av1_scan_orders[TX_SIZES_ALL][TX_TYPES];
39
40 void av1_deliver_eob_threshold(const AV1_COMMON *cm, MACROBLOCKD *xd);
41
get_default_scan(TX_SIZE tx_size,TX_TYPE tx_type)42 static INLINE const SCAN_ORDER *get_default_scan(TX_SIZE tx_size,
43 TX_TYPE tx_type) {
44 return &av1_scan_orders[tx_size][tx_type];
45 }
46
get_scan(TX_SIZE tx_size,TX_TYPE tx_type)47 static INLINE const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
48 return get_default_scan(tx_size, tx_type);
49 }
50
51 #ifdef __cplusplus
52 } // extern "C"
53 #endif
54
55 #endif // AOM_AV1_COMMON_SCAN_H_
56