reconintra.h 2.78 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"
Jingning Han's avatar
Jingning Han committed
17
18
19
20
21

#ifdef __cplusplus
extern "C" {
#endif

hui su's avatar
hui su committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#if CONFIG_DPCM_INTRA
static INLINE int av1_use_dpcm_intra(int plane, PREDICTION_MODE mode,
                                     TX_TYPE tx_type,
                                     const MB_MODE_INFO *const mbmi) {
  (void)mbmi;
  (void)plane;
#if CONFIG_EXT_INTRA
  if (mbmi->sb_type >= BLOCK_8X8 && mbmi->angle_delta[plane != 0]) return 0;
#endif  // CONFIG_EXT_INTRA
  return (mode == V_PRED && (tx_type == IDTX || tx_type == H_DCT)) ||
         (mode == H_PRED && (tx_type == IDTX || tx_type == V_DCT));
}
#endif  // CONFIG_DPCM_INTRA

Yaowu Xu's avatar
Yaowu Xu committed
36
void av1_init_intra_predictors(void);
37
38
void av1_predict_intra_block_facade(MACROBLOCKD *xd, int plane, int block_idx,
                                    int blk_col, int blk_row, TX_SIZE tx_size);
39
void av1_predict_intra_block(const MACROBLOCKD *xd, int bw, int bh,
40
                             BLOCK_SIZE bsize, PREDICTION_MODE mode,
Yaowu Xu's avatar
Yaowu Xu committed
41
42
                             const uint8_t *ref, int ref_stride, uint8_t *dst,
                             int dst_stride, int aoff, int loff, int plane);
43

44
#if CONFIG_EXT_INTER && CONFIG_INTERINTRA
45
// Mapping of interintra to intra mode for use in the intra component
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = {
  DC_PRED, V_PRED, H_PRED,
#if CONFIG_ALT_INTRA
  SMOOTH_PRED
#else
  TM_PRED
#endif
};

// Mapping of intra mode to the interintra mode
static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = {
  II_DC_PRED,     II_V_PRED,     II_H_PRED, II_V_PRED,
#if CONFIG_ALT_INTRA
  II_SMOOTH_PRED,
#else
  II_TM_PRED,
#endif
  II_V_PRED,      II_H_PRED,     II_H_PRED, II_V_PRED,
#if CONFIG_ALT_INTRA
  II_SMOOTH_PRED, II_SMOOTH_PRED
#else
  II_TM_PRED
#endif
};
#endif  // CONFIG_EXT_INTER && CONFIG_INTERINTRA
Jingning Han's avatar
Jingning Han committed
71

hui su's avatar
hui su committed
72
73
74
75
#if CONFIG_FILTER_INTRA
#define FILTER_INTRA_PREC_BITS 10
#endif  // CONFIG_FILTER_INTRA

hui su's avatar
hui su committed
76
77
78
#if CONFIG_EXT_INTRA
static INLINE int av1_is_directional_mode(PREDICTION_MODE mode,
                                          BLOCK_SIZE bsize) {
79
  return mode >= V_PRED && mode <= D63_PRED && bsize >= BLOCK_8X8;
hui su's avatar
hui su committed
80
81
82
}
#endif  // CONFIG_EXT_INTRA

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