Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 1 | /* |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 3 | * |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 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. |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 12 | #ifndef AV1_COMMON_RECONINTRA_H_ |
| 13 | #define AV1_COMMON_RECONINTRA_H_ |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 14 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 15 | #include "aom/aom_integer.h" |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 16 | #include "av1/common/blockd.h" |
| 17 | |
| 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
hui su | b8a6fd6 | 2017-05-10 10:57:57 -0700 | [diff] [blame] | 22 | #if CONFIG_DPCM_INTRA |
| 23 | static INLINE int av1_use_dpcm_intra(int plane, PREDICTION_MODE mode, |
| 24 | TX_TYPE tx_type, |
| 25 | const MB_MODE_INFO *const mbmi) { |
| 26 | (void)mbmi; |
| 27 | (void)plane; |
| 28 | #if CONFIG_EXT_INTRA |
| 29 | if (mbmi->sb_type >= BLOCK_8X8 && mbmi->angle_delta[plane != 0]) return 0; |
| 30 | #endif // CONFIG_EXT_INTRA |
| 31 | return (mode == V_PRED && (tx_type == IDTX || tx_type == H_DCT)) || |
| 32 | (mode == H_PRED && (tx_type == IDTX || tx_type == V_DCT)); |
| 33 | } |
| 34 | #endif // CONFIG_DPCM_INTRA |
| 35 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 36 | void av1_init_intra_predictors(void); |
Angie Chiang | 752ccce | 2017-04-09 13:41:13 -0700 | [diff] [blame] | 37 | void av1_predict_intra_block_facade(MACROBLOCKD *xd, int plane, int block_idx, |
| 38 | int blk_col, int blk_row, TX_SIZE tx_size); |
Jingning Han | c4c99da | 2016-10-24 10:27:28 -0700 | [diff] [blame] | 39 | void av1_predict_intra_block(const MACROBLOCKD *xd, int bw, int bh, |
David Barker | 839467f | 2017-01-19 11:06:15 +0000 | [diff] [blame] | 40 | BLOCK_SIZE bsize, PREDICTION_MODE mode, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 41 | const uint8_t *ref, int ref_stride, uint8_t *dst, |
| 42 | int dst_stride, int aoff, int loff, int plane); |
Debargha Mukherjee | cb60379 | 2016-10-04 13:10:23 -0700 | [diff] [blame] | 43 | |
Yue Chen | 4d26acb | 2017-05-01 12:28:34 -0700 | [diff] [blame] | 44 | #if CONFIG_EXT_INTER && CONFIG_INTERINTRA |
Debargha Mukherjee | cb60379 | 2016-10-04 13:10:23 -0700 | [diff] [blame] | 45 | // Mapping of interintra to intra mode for use in the intra component |
Yue Chen | 4d26acb | 2017-05-01 12:28:34 -0700 | [diff] [blame] | 46 | static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = { |
| 47 | DC_PRED, V_PRED, H_PRED, |
| 48 | #if CONFIG_ALT_INTRA |
| 49 | SMOOTH_PRED |
| 50 | #else |
| 51 | TM_PRED |
| 52 | #endif |
| 53 | }; |
| 54 | |
| 55 | // Mapping of intra mode to the interintra mode |
| 56 | static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = { |
| 57 | II_DC_PRED, II_V_PRED, II_H_PRED, II_V_PRED, |
| 58 | #if CONFIG_ALT_INTRA |
| 59 | II_SMOOTH_PRED, |
| 60 | #else |
| 61 | II_TM_PRED, |
| 62 | #endif |
| 63 | II_V_PRED, II_H_PRED, II_H_PRED, II_V_PRED, |
| 64 | #if CONFIG_ALT_INTRA |
| 65 | II_SMOOTH_PRED, II_SMOOTH_PRED |
| 66 | #else |
| 67 | II_TM_PRED |
| 68 | #endif |
| 69 | }; |
Yue Chen | 4d26acb | 2017-05-01 12:28:34 -0700 | [diff] [blame] | 70 | #endif // CONFIG_EXT_INTER && CONFIG_INTERINTRA |
Yaowu Xu | c27fc14 | 2016-08-22 16:08:15 -0700 | [diff] [blame] | 71 | |
hui su | 344b643 | 2016-10-18 16:07:04 -0700 | [diff] [blame] | 72 | #if CONFIG_FILTER_INTRA |
| 73 | #define FILTER_INTRA_PREC_BITS 10 |
hui su | 344b643 | 2016-10-18 16:07:04 -0700 | [diff] [blame] | 74 | #endif // CONFIG_FILTER_INTRA |
| 75 | |
Joe Young | 830d4ce | 2017-05-30 17:48:13 -0700 | [diff] [blame] | 76 | #define CONFIG_INTRA_EDGE_UPSAMPLE CONFIG_INTRA_EDGE |
| 77 | #define CONFIG_USE_ANGLE_DELTA_SUB8X8 0 |
| 78 | |
hui su | 0c628e6 | 2016-11-30 15:20:48 -0800 | [diff] [blame] | 79 | #if CONFIG_EXT_INTRA |
| 80 | static INLINE int av1_is_directional_mode(PREDICTION_MODE mode, |
| 81 | BLOCK_SIZE bsize) { |
Joe Young | 830d4ce | 2017-05-30 17:48:13 -0700 | [diff] [blame] | 82 | #if CONFIG_INTRA_EDGE_UPSAMPLE |
| 83 | (void)bsize; |
| 84 | return mode >= V_PRED && mode <= D63_PRED; |
| 85 | #else |
Urvang Joshi | 875a667 | 2017-06-05 11:59:35 -0700 | [diff] [blame] | 86 | return mode >= V_PRED && mode <= D63_PRED && bsize >= BLOCK_8X8; |
Joe Young | 830d4ce | 2017-05-30 17:48:13 -0700 | [diff] [blame] | 87 | #endif |
| 88 | } |
| 89 | |
| 90 | static INLINE int av1_use_angle_delta(BLOCK_SIZE bsize) { |
| 91 | (void)bsize; |
| 92 | #if CONFIG_USE_ANGLE_DELTA_SUB8X8 |
| 93 | return 1; |
| 94 | #else |
| 95 | return bsize >= BLOCK_8X8; |
| 96 | #endif |
hui su | 0c628e6 | 2016-11-30 15:20:48 -0800 | [diff] [blame] | 97 | } |
| 98 | #endif // CONFIG_EXT_INTRA |
| 99 | |
Yue Chen | 94d8446 | 2017-05-18 12:02:47 -0700 | [diff] [blame] | 100 | #ifdef __cplusplus |
| 101 | } // extern "C" |
| 102 | #endif |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 103 | #endif // AV1_COMMON_RECONINTRA_H_ |