/src/mozilla-central/third_party/aom/av1/common/reconintra.h
Line | Count | Source (jump to first uncovered line) |
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_RECONINTRA_H_ |
13 | | #define AOM_AV1_COMMON_RECONINTRA_H_ |
14 | | |
15 | | #include <stdlib.h> |
16 | | |
17 | | #include "aom/aom_integer.h" |
18 | | #include "av1/common/blockd.h" |
19 | | #include "av1/common/onyxc_int.h" |
20 | | |
21 | | #ifdef __cplusplus |
22 | | extern "C" { |
23 | | #endif |
24 | | |
25 | | void av1_init_intra_predictors(void); |
26 | | void av1_predict_intra_block_facade(const AV1_COMMON *cm, MACROBLOCKD *xd, |
27 | | int plane, int blk_col, int blk_row, |
28 | | TX_SIZE tx_size); |
29 | | void av1_predict_intra_block(const AV1_COMMON *cm, const MACROBLOCKD *xd, |
30 | | int bw, int bh, TX_SIZE tx_size, |
31 | | PREDICTION_MODE mode, int angle_delta, |
32 | | int use_palette, |
33 | | FILTER_INTRA_MODE filter_intra_mode, |
34 | | const uint8_t *ref, int ref_stride, uint8_t *dst, |
35 | | int dst_stride, int aoff, int loff, int plane); |
36 | | |
37 | | // Mapping of interintra to intra mode for use in the intra component |
38 | | static const PREDICTION_MODE interintra_to_intra_mode[INTERINTRA_MODES] = { |
39 | | DC_PRED, V_PRED, H_PRED, SMOOTH_PRED |
40 | | }; |
41 | | |
42 | | // Mapping of intra mode to the interintra mode |
43 | | static const INTERINTRA_MODE intra_to_interintra_mode[INTRA_MODES] = { |
44 | | II_DC_PRED, II_V_PRED, II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_V_PRED, |
45 | | II_H_PRED, II_H_PRED, II_V_PRED, II_SMOOTH_PRED, II_SMOOTH_PRED |
46 | | }; |
47 | | |
48 | 0 | #define FILTER_INTRA_SCALE_BITS 4 |
49 | | |
50 | 0 | static INLINE int av1_is_directional_mode(PREDICTION_MODE mode) { |
51 | 0 | return mode >= V_PRED && mode <= D67_PRED; |
52 | 0 | } Unexecuted instantiation: pred_common.c:av1_is_directional_mode Unexecuted instantiation: reconinter.c:av1_is_directional_mode Unexecuted instantiation: reconintra.c:av1_is_directional_mode Unexecuted instantiation: filterintra_sse4.c:av1_is_directional_mode Unexecuted instantiation: decodeframe.c:av1_is_directional_mode Unexecuted instantiation: decodemv.c:av1_is_directional_mode Unexecuted instantiation: decoder.c:av1_is_directional_mode |
53 | | |
54 | 0 | static INLINE int av1_use_angle_delta(BLOCK_SIZE bsize) { |
55 | 0 | return bsize >= BLOCK_8X8; |
56 | 0 | } Unexecuted instantiation: pred_common.c:av1_use_angle_delta Unexecuted instantiation: reconinter.c:av1_use_angle_delta Unexecuted instantiation: reconintra.c:av1_use_angle_delta Unexecuted instantiation: filterintra_sse4.c:av1_use_angle_delta Unexecuted instantiation: decodeframe.c:av1_use_angle_delta Unexecuted instantiation: decodemv.c:av1_use_angle_delta Unexecuted instantiation: decoder.c:av1_use_angle_delta |
57 | | |
58 | 0 | static INLINE int av1_allow_intrabc(const AV1_COMMON *const cm) { |
59 | 0 | return frame_is_intra_only(cm) && cm->allow_screen_content_tools && |
60 | 0 | cm->allow_intrabc; |
61 | 0 | } Unexecuted instantiation: pred_common.c:av1_allow_intrabc Unexecuted instantiation: reconinter.c:av1_allow_intrabc Unexecuted instantiation: reconintra.c:av1_allow_intrabc Unexecuted instantiation: filterintra_sse4.c:av1_allow_intrabc Unexecuted instantiation: decodeframe.c:av1_allow_intrabc Unexecuted instantiation: decodemv.c:av1_allow_intrabc Unexecuted instantiation: decoder.c:av1_allow_intrabc |
62 | | |
63 | | static INLINE int av1_filter_intra_allowed_bsize(const AV1_COMMON *const cm, |
64 | 0 | BLOCK_SIZE bs) { |
65 | 0 | if (!cm->seq_params.enable_filter_intra || bs == BLOCK_INVALID) return 0; |
66 | 0 | |
67 | 0 | return block_size_wide[bs] <= 32 && block_size_high[bs] <= 32; |
68 | 0 | } Unexecuted instantiation: pred_common.c:av1_filter_intra_allowed_bsize Unexecuted instantiation: reconinter.c:av1_filter_intra_allowed_bsize Unexecuted instantiation: reconintra.c:av1_filter_intra_allowed_bsize Unexecuted instantiation: filterintra_sse4.c:av1_filter_intra_allowed_bsize Unexecuted instantiation: decodeframe.c:av1_filter_intra_allowed_bsize Unexecuted instantiation: decodemv.c:av1_filter_intra_allowed_bsize Unexecuted instantiation: decoder.c:av1_filter_intra_allowed_bsize |
69 | | |
70 | | static INLINE int av1_filter_intra_allowed(const AV1_COMMON *const cm, |
71 | 0 | const MB_MODE_INFO *mbmi) { |
72 | 0 | return mbmi->mode == DC_PRED && |
73 | 0 | mbmi->palette_mode_info.palette_size[0] == 0 && |
74 | 0 | av1_filter_intra_allowed_bsize(cm, mbmi->sb_type); |
75 | 0 | } Unexecuted instantiation: pred_common.c:av1_filter_intra_allowed Unexecuted instantiation: reconinter.c:av1_filter_intra_allowed Unexecuted instantiation: reconintra.c:av1_filter_intra_allowed Unexecuted instantiation: filterintra_sse4.c:av1_filter_intra_allowed Unexecuted instantiation: decodeframe.c:av1_filter_intra_allowed Unexecuted instantiation: decodemv.c:av1_filter_intra_allowed Unexecuted instantiation: decoder.c:av1_filter_intra_allowed |
76 | | |
77 | | extern const int8_t av1_filter_intra_taps[FILTER_INTRA_MODES][8][8]; |
78 | | |
79 | | // Get the shift (up-scaled by 256) in X w.r.t a unit change in Y. |
80 | | // If angle > 0 && angle < 90, dx = -((int)(256 / t)); |
81 | | // If angle > 90 && angle < 180, dx = (int)(256 / t); |
82 | | // If angle > 180 && angle < 270, dx = 1; |
83 | 0 | static INLINE int av1_get_dx(int angle) { |
84 | 0 | if (angle > 0 && angle < 90) { |
85 | 0 | return dr_intra_derivative[angle]; |
86 | 0 | } else if (angle > 90 && angle < 180) { |
87 | 0 | return dr_intra_derivative[180 - angle]; |
88 | 0 | } else { |
89 | 0 | // In this case, we are not really going to use dx. We may return any value. |
90 | 0 | return 1; |
91 | 0 | } |
92 | 0 | } Unexecuted instantiation: pred_common.c:av1_get_dx Unexecuted instantiation: reconinter.c:av1_get_dx Unexecuted instantiation: reconintra.c:av1_get_dx Unexecuted instantiation: filterintra_sse4.c:av1_get_dx Unexecuted instantiation: decodeframe.c:av1_get_dx Unexecuted instantiation: decodemv.c:av1_get_dx Unexecuted instantiation: decoder.c:av1_get_dx |
93 | | |
94 | | // Get the shift (up-scaled by 256) in Y w.r.t a unit change in X. |
95 | | // If angle > 0 && angle < 90, dy = 1; |
96 | | // If angle > 90 && angle < 180, dy = (int)(256 * t); |
97 | | // If angle > 180 && angle < 270, dy = -((int)(256 * t)); |
98 | 0 | static INLINE int av1_get_dy(int angle) { |
99 | 0 | if (angle > 90 && angle < 180) { |
100 | 0 | return dr_intra_derivative[angle - 90]; |
101 | 0 | } else if (angle > 180 && angle < 270) { |
102 | 0 | return dr_intra_derivative[270 - angle]; |
103 | 0 | } else { |
104 | 0 | // In this case, we are not really going to use dy. We may return any value. |
105 | 0 | return 1; |
106 | 0 | } |
107 | 0 | } Unexecuted instantiation: pred_common.c:av1_get_dy Unexecuted instantiation: reconinter.c:av1_get_dy Unexecuted instantiation: reconintra.c:av1_get_dy Unexecuted instantiation: filterintra_sse4.c:av1_get_dy Unexecuted instantiation: decodeframe.c:av1_get_dy Unexecuted instantiation: decodemv.c:av1_get_dy Unexecuted instantiation: decoder.c:av1_get_dy |
108 | | |
109 | | static INLINE int av1_use_intra_edge_upsample(int bs0, int bs1, int delta, |
110 | 0 | int type) { |
111 | 0 | const int d = abs(delta); |
112 | 0 | const int blk_wh = bs0 + bs1; |
113 | 0 | if (d <= 0 || d >= 40) return 0; |
114 | 0 | return type ? (blk_wh <= 8) : (blk_wh <= 16); |
115 | 0 | } Unexecuted instantiation: pred_common.c:av1_use_intra_edge_upsample Unexecuted instantiation: reconinter.c:av1_use_intra_edge_upsample Unexecuted instantiation: reconintra.c:av1_use_intra_edge_upsample Unexecuted instantiation: filterintra_sse4.c:av1_use_intra_edge_upsample Unexecuted instantiation: decodeframe.c:av1_use_intra_edge_upsample Unexecuted instantiation: decodemv.c:av1_use_intra_edge_upsample Unexecuted instantiation: decoder.c:av1_use_intra_edge_upsample |
116 | | #ifdef __cplusplus |
117 | | } // extern "C" |
118 | | #endif |
119 | | #endif // AOM_AV1_COMMON_RECONINTRA_H_ |