Commit d790c809 authored by Yunqing Wang's avatar Yunqing Wang
Browse files

Set AV1 convolve function pointers

Set function pointers for AV1 convolve functions.

Change-Id: I9241ef31fcd060a6b76e0cac8e2452b0207df929
parent 4e0b43e0
......@@ -721,7 +721,8 @@ void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h,
InterpFilters interp_filters, const int subpel_x_q4,
int x_step_q4, const int subpel_y_q4, int y_step_q4,
int scaled, ConvolveParams *conv_params) {
int scaled, ConvolveParams *conv_params,
const struct scale_factors *sf) {
(void)x_step_q4;
(void)y_step_q4;
(void)dst;
......@@ -737,6 +738,7 @@ void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst,
#endif
#if CONFIG_JNT_COMP
(void)sf;
if (scaled) {
av1_convolve_2d_scale(src, src_stride, conv_params->dst,
conv_params->dst_stride, w, h, &filter_params_x,
......@@ -772,21 +774,9 @@ void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst,
} else {
// Special case convolve functions should produce the same result as
// av1_convolve_2d.
if (subpel_x_q4 == 0 && subpel_y_q4 == 0) {
av1_convolve_2d_copy(src, src_stride, dst, dst_stride, w, h,
&filter_params_x, &filter_params_y, subpel_x_q4,
subpel_y_q4, conv_params);
} else if (subpel_x_q4 == 0) {
av1_convolve_y(src, src_stride, dst, dst_stride, w, h, &filter_params_x,
&filter_params_y, subpel_x_q4, subpel_y_q4, conv_params);
} else if (subpel_y_q4 == 0) {
av1_convolve_x(src, src_stride, dst, dst_stride, w, h, &filter_params_x,
&filter_params_y, subpel_x_q4, subpel_y_q4, conv_params);
} else {
// subpel_x_q4 != 0 && subpel_y_q4 != 0
av1_convolve_2d(src, src_stride, dst, dst_stride, w, h, &filter_params_x,
&filter_params_y, subpel_x_q4, subpel_y_q4, conv_params);
}
sf->convolve[subpel_x_q4 != 0][subpel_y_q4 != 0][1](
src, src_stride, dst, dst_stride, w, h, &filter_params_x,
&filter_params_y, subpel_x_q4, subpel_y_q4, conv_params);
}
#endif // CONFIG_JNT_COMP
}
......
......@@ -43,6 +43,13 @@ typedef struct ConvolveParams {
#endif
} ConvolveParams;
typedef void (*aom_convolve_fn_t)(const uint8_t *src, int src_stride,
const uint8_t *dst, int dst_stride, int w,
int h, InterpFilterParams *filter_params_x,
InterpFilterParams *filter_params_y,
const int subpel_x_q4, const int subpel_y_q4,
ConvolveParams *conv_params);
static INLINE ConvolveParams get_conv_params(int ref, int do_average,
int plane) {
ConvolveParams conv_params;
......@@ -99,12 +106,13 @@ static INLINE void av1_get_convolve_filter_params(InterpFilters interp_filters,
struct AV1Common;
void av1_convolve_init(struct AV1Common *cm);
struct scale_factors;
void av1_convolve_2d_facade(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, int w, int h,
InterpFilters interp_filters, const int subpel_x_q4,
int x_step_q4, const int subpel_y_q4, int y_step_q4,
int scaled, ConvolveParams *conv_params);
int scaled, ConvolveParams *conv_params,
const struct scale_factors *sf);
static INLINE ConvolveParams get_conv_params_no_round(int ref, int do_average,
int plane, int32_t *dst,
......
......@@ -57,7 +57,7 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
if (conv_params->round == CONVOLVE_OPT_NO_ROUND) {
av1_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
interp_filters, subpel_x, xs, subpel_y, ys, 1,
conv_params);
conv_params, sf);
conv_params->do_post_rounding = 1;
} else {
assert(conv_params->round == CONVOLVE_OPT_ROUND);
......@@ -76,7 +76,7 @@ static INLINE void inter_predictor(const uint8_t *src, int src_stride,
if (conv_params->round == CONVOLVE_OPT_NO_ROUND) {
av1_convolve_2d_facade(src, src_stride, dst, dst_stride, w, h,
interp_filters, subpel_x, xs, subpel_y, ys, 0,
conv_params);
conv_params, sf);
conv_params->do_post_rounding = 1;
} else {
assert(conv_params->round == CONVOLVE_OPT_ROUND);
......
......@@ -10,6 +10,7 @@
*/
#include "./aom_dsp_rtcd.h"
#include "./av1_rtcd.h"
#include "av1/common/filter.h"
#include "av1/common/scale.h"
#include "aom_dsp/aom_filter.h"
......@@ -180,4 +181,13 @@ void av1_setup_scale_factors_for_frame(struct scale_factors *sf, int other_w,
sf->highbd_predict[1][1][1] = aom_highbd_convolve8_avg;
}
#endif // CONFIG_HIGHBITDEPTH
// subpel_x_q4 == 0 && subpel_y_q4 == 0
sf->convolve[0][0][1] = av1_convolve_2d_copy;
// subpel_x_q4 == 0
sf->convolve[0][1][1] = av1_convolve_y;
// subpel_y_q4 == 0
sf->convolve[1][0][1] = av1_convolve_x;
// subpel_x_q4 != 0 && subpel_y_q4 != 0
sf->convolve[1][1][1] = av1_convolve_2d;
}
......@@ -12,6 +12,7 @@
#ifndef AV1_COMMON_SCALE_H_
#define AV1_COMMON_SCALE_H_
#include "av1/common/convolve.h"
#include "av1/common/mv.h"
#include "aom_dsp/aom_convolve.h"
......@@ -38,6 +39,9 @@ struct scale_factors {
#if CONFIG_HIGHBITDEPTH
highbd_convolve_fn_t highbd_predict[2][2][2]; // horiz, vert, avg
#endif // CONFIG_HIGHBITDEPTH
// convolve_fn_ptr[subpel_x != 0][subpel_y != 0][is_compound]
aom_convolve_fn_t convolve[2][2][2];
};
MV32 av1_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment