reconintra.h 2.88 KB
Newer Older
Jingning Han's avatar
Jingning Han committed
1
/*
Yaowu Xu's avatar
Yaowu Xu committed
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Jingning Han's avatar
Jingning Han committed
3
 *
Yaowu Xu's avatar
Yaowu Xu committed
4
5
6
7
8
9
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Jingning Han's avatar
Jingning Han committed
10
11
 */

Yaowu Xu's avatar
Yaowu Xu committed
12
13
#ifndef AV1_COMMON_RECONINTRA_H_
#define AV1_COMMON_RECONINTRA_H_
Jingning Han's avatar
Jingning Han committed
14

Yaowu Xu's avatar
Yaowu Xu committed
15
#include "aom/aom_integer.h"
16
#include "av1/common/blockd.h"
17
#include "av1/common/onyxc_int.h"
Jingning Han's avatar
Jingning Han committed
18
19
20
21
22

#ifdef __cplusplus
extern "C" {
#endif

Yaowu Xu's avatar
Yaowu Xu committed
23
void av1_init_intra_predictors(void);
24
void av1_predict_intra_block_facade(const AV1_COMMON *cm, MACROBLOCKD *xd,
Luc Trudeau's avatar
Luc Trudeau committed
25
26
                                    int plane, int blk_col, int blk_row,
                                    TX_SIZE tx_size);
27
28
29
30
31
void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd,
                             int bw, int bh, BLOCK_SIZE bsize,
                             PREDICTION_MODE mode, const uint8_t *ref,
                             int ref_stride, uint8_t *dst, int dst_stride,
                             int aoff, int loff, int plane);
32
33

// Mapping of interintra to intra mode for use in the intra component
34
static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = {
Urvang Joshi's avatar
Urvang Joshi committed
35
  DC_PRED, V_PRED, H_PRED, SMOOTH_PRED
36
37
38
39
};

// Mapping of intra mode to the interintra mode
static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
Urvang Joshi's avatar
Urvang Joshi committed
40
41
  II_DC_PRED, II_V_PRED, II_H_PRED, II_V_PRED,      II_SMOOTH_PRED, II_V_PRED,
  II_H_PRED,  II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_SMOOTH_PRED
42
};
Jingning Han's avatar
Jingning Han committed
43

hui su's avatar
hui su committed
44
#if CONFIG_FILTER_INTRA
Yue Chen's avatar
Yue Chen committed
45
#define FILTER_INTRA_SCALE_BITS 4
hui su's avatar
hui su committed
46
47
#endif  // CONFIG_FILTER_INTRA

48
49
50
#define CONFIG_INTRA_EDGE_UPSAMPLE CONFIG_INTRA_EDGE
#define CONFIG_USE_ANGLE_DELTA_SUB8X8 0

hui su's avatar
hui su committed
51
52
53
#if CONFIG_EXT_INTRA
static INLINE int av1_is_directional_mode(PREDICTION_MODE mode,
                                          BLOCK_SIZE bsize) {
54
55
56
57
#if CONFIG_INTRA_EDGE_UPSAMPLE
  (void)bsize;
  return mode >= V_PRED && mode <= D63_PRED;
#else
58
  return mode >= V_PRED && mode <= D63_PRED && bsize >= BLOCK_8X8;
59
60
61
62
63
64
65
66
67
68
#endif
}

static INLINE int av1_use_angle_delta(BLOCK_SIZE bsize) {
  (void)bsize;
#if CONFIG_USE_ANGLE_DELTA_SUB8X8
  return 1;
#else
  return bsize >= BLOCK_8X8;
#endif
hui su's avatar
hui su committed
69
70
71
}
#endif  // CONFIG_EXT_INTRA

RogerZhou's avatar
RogerZhou committed
72
73
74
#if CONFIG_INTRABC
static INLINE int av1_allow_intrabc(BLOCK_SIZE bsize,
                                    const AV1_COMMON *const cm) {
75
76
77
  // TODO(huisu@google.com): intrabc is disabled for BLOCK_4X16 and
  // BLOCK_16X4 because of onflict between cfl.
  return bsize != BLOCK_4X16 && bsize != BLOCK_16X4 &&
78
         cm->allow_screen_content_tools && cm->allow_intrabc;
RogerZhou's avatar
RogerZhou committed
79
80
81
}
#endif  // CONFIG_INTRABC

82
83
84
#ifdef __cplusplus
}  // extern "C"
#endif
Yaowu Xu's avatar
Yaowu Xu committed
85
#endif  // AV1_COMMON_RECONINTRA_H_