/work/svt-av1/Source/Lib/Codec/convolve.h
Line | Count | Source |
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 https://www.aomedia.org/license/software-license. 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 https://www.aomedia.org/license/patent-license. |
10 | | */ |
11 | | |
12 | | #ifndef AV1_COMMON_AV1_CONVOLVE_H_ |
13 | | #define AV1_COMMON_AV1_CONVOLVE_H_ |
14 | | |
15 | | #ifdef __cplusplus |
16 | | extern "C" { |
17 | | #endif |
18 | | |
19 | | #include "definitions.h" |
20 | | #include "filter.h" |
21 | | |
22 | 0 | #define ROUND0_BITS 3 |
23 | 0 | #define COMPOUND_ROUND1_BITS 7 |
24 | | #define WIENER_ROUND0_BITS 3 |
25 | | |
26 | 0 | #define WIENER_CLAMP_LIMIT(r0, bd) (1 << ((bd) + 1 + FILTER_BITS - r0)) |
27 | | |
28 | | typedef void (*AomConvolveFn)(const uint8_t* src, int32_t src_stride, uint8_t* dst, int32_t dst_stride, int32_t w, |
29 | | int32_t h, const InterpFilterParams* filter_params_x, |
30 | | const InterpFilterParams* filter_params_y, const int32_t subpel_x_q4, |
31 | | const int32_t subpel_y_q4, ConvolveParams* conv_params); |
32 | | |
33 | | typedef void (*aom_highbd_convolve_fn_t)(const uint16_t* src, int32_t src_stride, uint16_t* dst, int32_t dst_stride, |
34 | | int32_t w, int32_t h, const InterpFilterParams* filter_params_x, |
35 | | const InterpFilterParams* filter_params_y, const int32_t subpel_x_q4, |
36 | | const int32_t subpel_y_q4, ConvolveParams* conv_params, int32_t bd); |
37 | | |
38 | | struct AV1Common; |
39 | | struct scale_factors; |
40 | | |
41 | | static INLINE ConvolveParams get_conv_params_no_round(int32_t ref, int32_t do_average, int32_t plane, ConvBufType* dst, |
42 | 0 | int32_t dst_stride, int32_t is_compound, int32_t bd) { |
43 | 0 | (void)plane; |
44 | 0 | (void)ref; |
45 | 0 | ConvolveParams conv_params; |
46 | | // conv_params.ref = ref; |
47 | 0 | conv_params.do_average = do_average; |
48 | 0 | assert(IMPLIES(do_average, is_compound)); |
49 | 0 | conv_params.is_compound = is_compound; |
50 | 0 | conv_params.round_0 = ROUND0_BITS; |
51 | 0 | conv_params.round_1 = is_compound ? COMPOUND_ROUND1_BITS : 2 * FILTER_BITS - conv_params.round_0; |
52 | 0 | const int32_t intbufrange = bd + FILTER_BITS - conv_params.round_0 + 2; |
53 | 0 | ASSERT(IMPLIES(bd < 12, intbufrange <= 16)); |
54 | 0 | if (intbufrange > 16) { |
55 | 0 | conv_params.round_0 += intbufrange - 16; |
56 | 0 | if (!is_compound) { |
57 | 0 | conv_params.round_1 -= intbufrange - 16; |
58 | 0 | } |
59 | 0 | } |
60 | 0 | conv_params.dst = dst; |
61 | 0 | conv_params.dst_stride = dst_stride; |
62 | | // conv_params.plane = plane; |
63 | 0 | conv_params.use_jnt_comp_avg = 0; |
64 | |
|
65 | 0 | return conv_params; |
66 | 0 | } Unexecuted instantiation: enc_handle.c:get_conv_params_no_round Unexecuted instantiation: enc_settings.c:get_conv_params_no_round Unexecuted instantiation: av1me.c:get_conv_params_no_round Unexecuted instantiation: cdef_process.c:get_conv_params_no_round Unexecuted instantiation: dlf_process.c:get_conv_params_no_round Unexecuted instantiation: enc_cdef.c:get_conv_params_no_round Unexecuted instantiation: enc_dec_process.c:get_conv_params_no_round Unexecuted instantiation: enc_inter_prediction.c:get_conv_params_no_round Unexecuted instantiation: enc_intra_prediction.c:get_conv_params_no_round Unexecuted instantiation: enc_mode_config.c:get_conv_params_no_round Unexecuted instantiation: entropy_coding.c:get_conv_params_no_round Unexecuted instantiation: ec_process.c:get_conv_params_no_round Unexecuted instantiation: full_loop.c:get_conv_params_no_round Unexecuted instantiation: initial_rc_process.c:get_conv_params_no_round Unexecuted instantiation: inter_prediction.c:get_conv_params_no_round Unexecuted instantiation: intra_prediction.c:get_conv_params_no_round Unexecuted instantiation: md_rate_estimation.c:get_conv_params_no_round Unexecuted instantiation: mode_decision.c:get_conv_params_no_round Unexecuted instantiation: md_config_process.c:get_conv_params_no_round Unexecuted instantiation: md_process.c:get_conv_params_no_round Unexecuted instantiation: motion_estimation.c:get_conv_params_no_round Unexecuted instantiation: me_process.c:get_conv_params_no_round Unexecuted instantiation: packetization_process.c:get_conv_params_no_round Unexecuted instantiation: pic_analysis_process.c:get_conv_params_no_round Unexecuted instantiation: pcs.c:get_conv_params_no_round Unexecuted instantiation: pd_process.c:get_conv_params_no_round Unexecuted instantiation: pic_manager_process.c:get_conv_params_no_round Unexecuted instantiation: product_coding_loop.c:get_conv_params_no_round Unexecuted instantiation: rc_aq.c:get_conv_params_no_round Unexecuted instantiation: rc_process.c:get_conv_params_no_round Unexecuted instantiation: rc_rtc_cbr.c:get_conv_params_no_round Unexecuted instantiation: rc_vbr_cbr.c:get_conv_params_no_round Unexecuted instantiation: rd_cost.c:get_conv_params_no_round Unexecuted instantiation: reference_object.c:get_conv_params_no_round Unexecuted instantiation: resource_coordination_process.c:get_conv_params_no_round Unexecuted instantiation: rest_process.c:get_conv_params_no_round Unexecuted instantiation: restoration_pick.c:get_conv_params_no_round Unexecuted instantiation: src_ops_process.c:get_conv_params_no_round Unexecuted instantiation: super_res.c:get_conv_params_no_round Unexecuted instantiation: temporal_filtering.c:get_conv_params_no_round Unexecuted instantiation: transforms.c:get_conv_params_no_round Unexecuted instantiation: encode_txb_ref_c.c:get_conv_params_no_round Unexecuted instantiation: adaptive_mv_pred.c:get_conv_params_no_round Unexecuted instantiation: coding_loop.c:get_conv_params_no_round Unexecuted instantiation: coding_unit.c:get_conv_params_no_round Unexecuted instantiation: deblocking_filter.c:get_conv_params_no_round Unexecuted instantiation: global_me_cost.c:get_conv_params_no_round Unexecuted instantiation: rc_crf_cqp.c:get_conv_params_no_round Unexecuted instantiation: enc_warped_motion.c:get_conv_params_no_round |
67 | | |
68 | 0 | static INLINE ConvolveParams get_conv_params(int32_t ref, int32_t do_average, int32_t plane, int32_t bd) { |
69 | 0 | return get_conv_params_no_round(ref, do_average, plane, NULL, 0, 0, bd); |
70 | 0 | } Unexecuted instantiation: enc_handle.c:get_conv_params Unexecuted instantiation: enc_settings.c:get_conv_params Unexecuted instantiation: av1me.c:get_conv_params Unexecuted instantiation: cdef_process.c:get_conv_params Unexecuted instantiation: dlf_process.c:get_conv_params Unexecuted instantiation: enc_cdef.c:get_conv_params Unexecuted instantiation: enc_dec_process.c:get_conv_params Unexecuted instantiation: enc_inter_prediction.c:get_conv_params Unexecuted instantiation: enc_intra_prediction.c:get_conv_params Unexecuted instantiation: enc_mode_config.c:get_conv_params Unexecuted instantiation: entropy_coding.c:get_conv_params Unexecuted instantiation: ec_process.c:get_conv_params Unexecuted instantiation: full_loop.c:get_conv_params Unexecuted instantiation: initial_rc_process.c:get_conv_params Unexecuted instantiation: inter_prediction.c:get_conv_params Unexecuted instantiation: intra_prediction.c:get_conv_params Unexecuted instantiation: md_rate_estimation.c:get_conv_params Unexecuted instantiation: mode_decision.c:get_conv_params Unexecuted instantiation: md_config_process.c:get_conv_params Unexecuted instantiation: md_process.c:get_conv_params Unexecuted instantiation: motion_estimation.c:get_conv_params Unexecuted instantiation: me_process.c:get_conv_params Unexecuted instantiation: packetization_process.c:get_conv_params Unexecuted instantiation: pic_analysis_process.c:get_conv_params Unexecuted instantiation: pcs.c:get_conv_params Unexecuted instantiation: pd_process.c:get_conv_params Unexecuted instantiation: pic_manager_process.c:get_conv_params Unexecuted instantiation: product_coding_loop.c:get_conv_params Unexecuted instantiation: rc_aq.c:get_conv_params Unexecuted instantiation: rc_process.c:get_conv_params Unexecuted instantiation: rc_rtc_cbr.c:get_conv_params Unexecuted instantiation: rc_vbr_cbr.c:get_conv_params Unexecuted instantiation: rd_cost.c:get_conv_params Unexecuted instantiation: reference_object.c:get_conv_params Unexecuted instantiation: resource_coordination_process.c:get_conv_params Unexecuted instantiation: rest_process.c:get_conv_params Unexecuted instantiation: restoration_pick.c:get_conv_params Unexecuted instantiation: src_ops_process.c:get_conv_params Unexecuted instantiation: super_res.c:get_conv_params Unexecuted instantiation: temporal_filtering.c:get_conv_params Unexecuted instantiation: transforms.c:get_conv_params Unexecuted instantiation: encode_txb_ref_c.c:get_conv_params Unexecuted instantiation: adaptive_mv_pred.c:get_conv_params Unexecuted instantiation: coding_loop.c:get_conv_params Unexecuted instantiation: coding_unit.c:get_conv_params Unexecuted instantiation: deblocking_filter.c:get_conv_params Unexecuted instantiation: global_me_cost.c:get_conv_params Unexecuted instantiation: rc_crf_cqp.c:get_conv_params Unexecuted instantiation: enc_warped_motion.c:get_conv_params |
71 | | |
72 | 0 | static INLINE ConvolveParams get_conv_params_wiener(int32_t bd) { |
73 | 0 | ConvolveParams conv_params; |
74 | 0 | (void)bd; |
75 | 0 | conv_params.ref = 0; |
76 | 0 | conv_params.do_average = 0; |
77 | 0 | conv_params.is_compound = 0; |
78 | 0 | conv_params.round_0 = WIENER_ROUND0_BITS; |
79 | 0 | conv_params.round_1 = 2 * FILTER_BITS - conv_params.round_0; |
80 | 0 | const int32_t intbufrange = bd + FILTER_BITS - conv_params.round_0 + 2; |
81 | 0 | ASSERT(IMPLIES(bd < 12, intbufrange <= 16)); |
82 | 0 | if (intbufrange > 16) { |
83 | 0 | conv_params.round_0 += intbufrange - 16; |
84 | 0 | conv_params.round_1 -= intbufrange - 16; |
85 | 0 | } |
86 | 0 | conv_params.dst = NULL; |
87 | 0 | conv_params.dst_stride = 0; |
88 | 0 | conv_params.plane = 0; |
89 | 0 | // Initialization |
90 | 0 | conv_params.fwd_offset = 0; |
91 | 0 | conv_params.bck_offset = 0; |
92 | 0 | conv_params.use_jnt_comp_avg = 0; |
93 | 0 | conv_params.use_dist_wtd_comp_avg = 0; |
94 | 0 | return conv_params; |
95 | 0 | } Unexecuted instantiation: enc_handle.c:get_conv_params_wiener Unexecuted instantiation: enc_settings.c:get_conv_params_wiener Unexecuted instantiation: av1me.c:get_conv_params_wiener Unexecuted instantiation: cdef_process.c:get_conv_params_wiener Unexecuted instantiation: dlf_process.c:get_conv_params_wiener Unexecuted instantiation: enc_cdef.c:get_conv_params_wiener Unexecuted instantiation: enc_dec_process.c:get_conv_params_wiener Unexecuted instantiation: enc_inter_prediction.c:get_conv_params_wiener Unexecuted instantiation: enc_intra_prediction.c:get_conv_params_wiener Unexecuted instantiation: enc_mode_config.c:get_conv_params_wiener Unexecuted instantiation: entropy_coding.c:get_conv_params_wiener Unexecuted instantiation: ec_process.c:get_conv_params_wiener Unexecuted instantiation: full_loop.c:get_conv_params_wiener Unexecuted instantiation: initial_rc_process.c:get_conv_params_wiener Unexecuted instantiation: inter_prediction.c:get_conv_params_wiener Unexecuted instantiation: intra_prediction.c:get_conv_params_wiener Unexecuted instantiation: md_rate_estimation.c:get_conv_params_wiener Unexecuted instantiation: mode_decision.c:get_conv_params_wiener Unexecuted instantiation: md_config_process.c:get_conv_params_wiener Unexecuted instantiation: md_process.c:get_conv_params_wiener Unexecuted instantiation: motion_estimation.c:get_conv_params_wiener Unexecuted instantiation: me_process.c:get_conv_params_wiener Unexecuted instantiation: packetization_process.c:get_conv_params_wiener Unexecuted instantiation: pic_analysis_process.c:get_conv_params_wiener Unexecuted instantiation: pcs.c:get_conv_params_wiener Unexecuted instantiation: pd_process.c:get_conv_params_wiener Unexecuted instantiation: pic_manager_process.c:get_conv_params_wiener Unexecuted instantiation: product_coding_loop.c:get_conv_params_wiener Unexecuted instantiation: rc_aq.c:get_conv_params_wiener Unexecuted instantiation: rc_process.c:get_conv_params_wiener Unexecuted instantiation: rc_rtc_cbr.c:get_conv_params_wiener Unexecuted instantiation: rc_vbr_cbr.c:get_conv_params_wiener Unexecuted instantiation: rd_cost.c:get_conv_params_wiener Unexecuted instantiation: reference_object.c:get_conv_params_wiener Unexecuted instantiation: resource_coordination_process.c:get_conv_params_wiener Unexecuted instantiation: rest_process.c:get_conv_params_wiener Unexecuted instantiation: restoration_pick.c:get_conv_params_wiener Unexecuted instantiation: src_ops_process.c:get_conv_params_wiener Unexecuted instantiation: super_res.c:get_conv_params_wiener Unexecuted instantiation: temporal_filtering.c:get_conv_params_wiener Unexecuted instantiation: transforms.c:get_conv_params_wiener Unexecuted instantiation: encode_txb_ref_c.c:get_conv_params_wiener Unexecuted instantiation: adaptive_mv_pred.c:get_conv_params_wiener Unexecuted instantiation: coding_loop.c:get_conv_params_wiener Unexecuted instantiation: coding_unit.c:get_conv_params_wiener Unexecuted instantiation: deblocking_filter.c:get_conv_params_wiener Unexecuted instantiation: global_me_cost.c:get_conv_params_wiener Unexecuted instantiation: rc_crf_cqp.c:get_conv_params_wiener Unexecuted instantiation: enc_warped_motion.c:get_conv_params_wiener |
96 | | |
97 | | void av1_highbd_convolve_2d_facade(const uint8_t* src8, int32_t src_stride, uint8_t* dst, int32_t dst_stride, int32_t w, |
98 | | int32_t h, InterpFilters interp_filters, const int32_t subpel_x_q4, |
99 | | int32_t x_step_q4, const int32_t subpel_y_q4, int32_t y_step_q4, int32_t scaled, |
100 | | ConvolveParams* conv_params, const struct scale_factors* sf, int32_t bd); |
101 | | |
102 | | #ifdef __cplusplus |
103 | | } // extern "C" |
104 | | #endif |
105 | | |
106 | | #endif // AV1_COMMON_AV1_CONVOLVE_H_ |