xref: /aosp_15_r20/external/libaom/av1/common/scan.h (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
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_scan_orders[TX_SIZES_ALL][TX_TYPES];
38 
39 void av1_deliver_eob_threshold(const AV1_COMMON *cm, MACROBLOCKD *xd);
40 
get_default_scan(TX_SIZE tx_size,TX_TYPE tx_type)41 static inline const SCAN_ORDER *get_default_scan(TX_SIZE tx_size,
42                                                  TX_TYPE tx_type) {
43   return &av1_scan_orders[tx_size][tx_type];
44 }
45 
get_scan(TX_SIZE tx_size,TX_TYPE tx_type)46 static inline const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
47   return get_default_scan(tx_size, tx_type);
48 }
49 
50 #ifdef __cplusplus
51 }  // extern "C"
52 #endif
53 
54 #endif  // AOM_AV1_COMMON_SCAN_H_
55