1 /*
2 * Copyright(c) 2019 Intel Corporation
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 EBMCP_H
13 #define EBMCP_H
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 #define USE_PRE_COMPUTE 0
19 
20 typedef struct MotionCompensationPredictionContext {
21     EbDctor dctor;
22     EbByte  avc_style_mcp_intermediate_result_buf0; // For short filter in MD
23     EbByte  avc_style_mcp_intermediate_result_buf1; // For short filter in MD
24 #if !USE_PRE_COMPUTE
25     EbByte avc_style_mcp_two_d_interpolation_first_pass_filter_result_buf; // For short filter in MD
26 #endif
27 } MotionCompensationPredictionContext;
28 
29 /** InterpolationFilter()
30             is generally defined interpolation filter function.
31             There is a whole group of these functions, each of which corresponds to a particular
32             integer/fractional sample, and the function is indexed in a function pointer array
33             in terms of the frac_pos_x and frac_pos_y.
34 
35         @param *ref_pic (8-bits input)
36             ref_pic is the pointer to the reference picture data that was chosen by
37             the integer pixel precision MV.
38         @param src_stride (input)
39         @param frac_pos_x (input)
40             frac_pos_x is the horizontal fractional position of the predicted sample
41         @param frac_pos_y (input)
42             frac_pos_y is the veritcal fractional position of the predicted sample
43         @param pu_width (input)
44         @param pu_height (input)
45         @param *dst (16-bits output)
46             dst is the pointer to the destination where the prediction result will
47             be stored.
48         @param dst_stride (input)
49         @param *first_pass_if_dst (16-bits input)
50             first_pass_if_dst is the pointer to the buffer where the result of the first
51             pass filtering of the 2D interpolation filter will be stored.
52         @param is_last (input)
53             is_last indicates if there is any further filtering (interpolation filtering)
54             afterwards.
55      */
56 extern void generate_padding(EbByte src_pic, uint32_t src_stride, uint32_t original_src_width,
57                              uint32_t original_src_height, uint32_t padding_width,
58                              uint32_t padding_height);
59 
60 extern void generate_padding16_bit(EbByte src_pic, uint32_t src_stride, uint32_t original_src_width,
61                                    uint32_t original_src_height, uint32_t padding_width,
62                                    uint32_t padding_height);
63 
64 extern void pad_input_picture(EbByte src_pic, uint32_t src_stride, uint32_t original_src_width,
65                               uint32_t original_src_height, uint32_t pad_right,
66                               uint32_t pad_bottom);
67 
68 extern void pad_input_picture_16bit(uint16_t* src_pic, uint32_t src_stride,
69                                     uint32_t original_src_width, uint32_t original_src_height,
70                                     uint32_t pad_right, uint32_t pad_bottom);
71 
72 void generate_padding_l(EbByte src_pic, uint32_t src_stride, uint32_t row_height,
73                         uint32_t padding_width);
74 void generate_padding_r(EbByte src_pic, uint32_t src_stride, uint32_t row_width,
75                         uint32_t row_height, uint32_t padding_width);
76 void generate_padding_t(EbByte src_pic, uint32_t src_stride, uint32_t row_width,
77                         uint32_t padding_height);
78 void generate_padding_b(EbByte src_pic, uint32_t src_stride, uint32_t row_width,
79                         uint32_t row_height, uint32_t padding_height);
80 
81 void generate_padding_l_hbd(EbByte src_pic, uint32_t src_stride, uint32_t row_height,
82                             uint32_t padding_width);
83 void generate_padding_r_hbd(EbByte src_pic, uint32_t src_stride, uint32_t row_width,
84                             uint32_t row_height, uint32_t padding_width);
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 #endif // EBMCP_H
90