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 AV1_COMMON_RECONINTRA_H_
13 #define AV1_COMMON_RECONINTRA_H_
14
15 #include "aom/aom_integer.h"
16 #include "av1/common/blockd.h"
17 #include "av1/common/onyxc_int.h"
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 void av1_init_intra_predictors(void);
24 void av1_predict_intra_block_facade(const AV1_COMMON *cm, MACROBLOCKD *xd,
25 int plane, int block_idx, int blk_col,
26 int blk_row, TX_SIZE tx_size);
27 void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd,
28 int bw, int bh, BLOCK_SIZE bsize,
29 PREDICTION_MODE mode, const uint8_t *ref,
30 int ref_stride, uint8_t *dst, int dst_stride,
31 int aoff, int loff, int plane);
32
33 #if CONFIG_INTERINTRA
34 // Mapping of interintra to intra mode for use in the intra component
35 static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = {
36 DC_PRED, V_PRED, H_PRED, SMOOTH_PRED
37 };
38
39 // Mapping of intra mode to the interintra mode
40 static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
41 II_DC_PRED, II_V_PRED, II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_V_PRED,
42 II_H_PRED, II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_SMOOTH_PRED
43 };
44 #endif // CONFIG_INTERINTRA
45
46 #if CONFIG_FILTER_INTRA
47 #define FILTER_INTRA_PREC_BITS 10
48 #endif // CONFIG_FILTER_INTRA
49
50 #define CONFIG_INTRA_EDGE_UPSAMPLE CONFIG_INTRA_EDGE
51 #define CONFIG_USE_ANGLE_DELTA_SUB8X8 0
52
53 #if CONFIG_EXT_INTRA
av1_is_directional_mode(PREDICTION_MODE mode,BLOCK_SIZE bsize)54 static INLINE int av1_is_directional_mode(PREDICTION_MODE mode,
55 BLOCK_SIZE bsize) {
56 #if CONFIG_INTRA_EDGE_UPSAMPLE
57 (void)bsize;
58 return mode >= V_PRED && mode <= D63_PRED;
59 #else
60 return mode >= V_PRED && mode <= D63_PRED && bsize >= BLOCK_8X8;
61 #endif
62 }
63
av1_use_angle_delta(BLOCK_SIZE bsize)64 static INLINE int av1_use_angle_delta(BLOCK_SIZE bsize) {
65 (void)bsize;
66 #if CONFIG_USE_ANGLE_DELTA_SUB8X8
67 return 1;
68 #else
69 return bsize >= BLOCK_8X8;
70 #endif
71 }
72 #endif // CONFIG_EXT_INTRA
73
74 #if CONFIG_INTRABC
av1_allow_intrabc(BLOCK_SIZE bsize,const AV1_COMMON * const cm)75 static INLINE int av1_allow_intrabc(BLOCK_SIZE bsize,
76 const AV1_COMMON *const cm) {
77 return (bsize >= BLOCK_8X8 || bsize == BLOCK_4X4) &&
78 cm->allow_screen_content_tools;
79 }
80 #endif // CONFIG_INTRABC
81
82 #ifdef __cplusplus
83 } // extern "C"
84 #endif
85 #endif // AV1_COMMON_RECONINTRA_H_
86