remove vp9_get_interp_kernel()
expose filter_kernels[] and do the table lookup directly Change-Id: I0b10bff0327c3e01a723736141a9ffd377cd3d20
This commit is contained in:
Родитель
e757808429
Коммит
017253b7a3
|
@ -647,7 +647,7 @@ const int kNumFilters = 16;
|
|||
TEST(ConvolveTest, FiltersWontSaturateWhenAddedPairwise) {
|
||||
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
|
||||
const InterpKernel *filters =
|
||||
vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
|
||||
vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
|
||||
for (int i = 0; i < kNumFilters; i++) {
|
||||
const int p0 = filters[i][0] + filters[i][1];
|
||||
const int p1 = filters[i][2] + filters[i][3];
|
||||
|
@ -685,9 +685,9 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) {
|
|||
|
||||
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
|
||||
const InterpKernel *filters =
|
||||
vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
|
||||
vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
|
||||
const InterpKernel *const eighttap_smooth =
|
||||
vp9_get_interp_kernel(EIGHTTAP_SMOOTH);
|
||||
vp9_filter_kernels[EIGHTTAP_SMOOTH];
|
||||
|
||||
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
|
||||
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
|
||||
|
@ -764,9 +764,9 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) {
|
|||
|
||||
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
|
||||
const InterpKernel *filters =
|
||||
vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
|
||||
vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
|
||||
const InterpKernel *const eighttap_smooth =
|
||||
vp9_get_interp_kernel(EIGHTTAP_SMOOTH);
|
||||
vp9_filter_kernels[EIGHTTAP_SMOOTH];
|
||||
|
||||
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
|
||||
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
|
||||
|
@ -863,9 +863,9 @@ TEST_P(ConvolveTest, FilterExtremes) {
|
|||
|
||||
for (int filter_bank = 0; filter_bank < kNumFilterBanks; ++filter_bank) {
|
||||
const InterpKernel *filters =
|
||||
vp9_get_interp_kernel(static_cast<INTERP_FILTER>(filter_bank));
|
||||
vp9_filter_kernels[static_cast<INTERP_FILTER>(filter_bank)];
|
||||
const InterpKernel *const eighttap_smooth =
|
||||
vp9_get_interp_kernel(EIGHTTAP_SMOOTH);
|
||||
vp9_filter_kernels[EIGHTTAP_SMOOTH];
|
||||
for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) {
|
||||
for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) {
|
||||
wrapper_filter_block2d_8_c(in, kInputStride,
|
||||
|
@ -1017,7 +1017,7 @@ TEST_P(ConvolveTest, ChangeFilterWorks) {
|
|||
TEST_P(ConvolveTest, CheckScalingFiltering) {
|
||||
uint8_t* const in = input();
|
||||
uint8_t* const out = output();
|
||||
const InterpKernel *const eighttap = vp9_get_interp_kernel(EIGHTTAP);
|
||||
const InterpKernel *const eighttap = vp9_filter_kernels[EIGHTTAP];
|
||||
|
||||
SetConstantInput(127);
|
||||
|
||||
|
|
|
@ -96,15 +96,9 @@ DECLARE_ALIGNED(256, static const InterpKernel,
|
|||
};
|
||||
|
||||
|
||||
static const InterpKernel* filter_kernels[4] = {
|
||||
const InterpKernel *vp9_filter_kernels[4] = {
|
||||
sub_pel_filters_8,
|
||||
sub_pel_filters_8lp,
|
||||
sub_pel_filters_8s,
|
||||
bilinear_filters
|
||||
};
|
||||
|
||||
const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter) {
|
||||
assert(filter != SWITCHABLE);
|
||||
return filter_kernels[filter];
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ typedef uint8_t INTERP_FILTER;
|
|||
|
||||
typedef int16_t InterpKernel[SUBPEL_TAPS];
|
||||
|
||||
const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter);
|
||||
extern const InterpKernel *vp9_filter_kernels[4];
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
|
@ -161,7 +161,7 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
|
|||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||
const MODE_INFO *mi = xd->mi[0];
|
||||
const int is_compound = has_second_ref(&mi->mbmi);
|
||||
const InterpKernel *kernel = vp9_get_interp_kernel(mi->mbmi.interp_filter);
|
||||
const InterpKernel *kernel = vp9_filter_kernels[mi->mbmi.interp_filter];
|
||||
int ref;
|
||||
|
||||
for (ref = 0; ref < 1 + is_compound; ++ref) {
|
||||
|
|
|
@ -650,7 +650,7 @@ static void dec_build_inter_predictors_sb(VP9Decoder *const pbi,
|
|||
const int mi_x = mi_col * MI_SIZE;
|
||||
const int mi_y = mi_row * MI_SIZE;
|
||||
const MODE_INFO *mi = xd->mi[0];
|
||||
const InterpKernel *kernel = vp9_get_interp_kernel(mi->mbmi.interp_filter);
|
||||
const InterpKernel *kernel = vp9_filter_kernels[mi->mbmi.interp_filter];
|
||||
const BLOCK_SIZE sb_type = mi->mbmi.sb_type;
|
||||
const int is_compound = has_second_ref(&mi->mbmi);
|
||||
|
||||
|
|
|
@ -2562,7 +2562,7 @@ static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src,
|
|||
const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
|
||||
uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer};
|
||||
const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride};
|
||||
const InterpKernel *const kernel = vp9_get_interp_kernel(EIGHTTAP);
|
||||
const InterpKernel *const kernel = vp9_filter_kernels[EIGHTTAP];
|
||||
int x, y, i;
|
||||
|
||||
for (y = 0; y < dst_h; y += 16) {
|
||||
|
|
|
@ -1813,7 +1813,7 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
&xd->block_refs[0]->sf,
|
||||
4 * num_4x4_blocks_wide,
|
||||
4 * num_4x4_blocks_high, 0,
|
||||
vp9_get_interp_kernel(mbmi->interp_filter),
|
||||
vp9_filter_kernels[mbmi->interp_filter],
|
||||
MV_PRECISION_Q3,
|
||||
mi_col * MI_SIZE + 4 * (i & 0x01),
|
||||
mi_row * MI_SIZE + 4 * (i >> 1), xd->bd);
|
||||
|
@ -1825,7 +1825,7 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
&xd->block_refs[0]->sf,
|
||||
4 * num_4x4_blocks_wide,
|
||||
4 * num_4x4_blocks_high, 0,
|
||||
vp9_get_interp_kernel(mbmi->interp_filter),
|
||||
vp9_filter_kernels[mbmi->interp_filter],
|
||||
MV_PRECISION_Q3,
|
||||
mi_col * MI_SIZE + 4 * (i & 0x01),
|
||||
mi_row * MI_SIZE + 4 * (i >> 1));
|
||||
|
|
|
@ -1358,7 +1358,7 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
|
|||
int thisrate = 0, ref;
|
||||
const scan_order *so = &vp9_default_scan_orders[TX_4X4];
|
||||
const int is_compound = has_second_ref(&mi->mbmi);
|
||||
const InterpKernel *kernel = vp9_get_interp_kernel(mi->mbmi.interp_filter);
|
||||
const InterpKernel *kernel = vp9_filter_kernels[mi->mbmi.interp_filter];
|
||||
|
||||
for (ref = 0; ref < 1 + is_compound; ++ref) {
|
||||
const uint8_t *pre = &pd->pre[ref].buf[vp9_raster_block_offset(BLOCK_8X8, i,
|
||||
|
@ -1564,7 +1564,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1]};
|
||||
int_mv ref_mv[2];
|
||||
int ite, ref;
|
||||
const InterpKernel *kernel = vp9_get_interp_kernel(mbmi->interp_filter);
|
||||
const InterpKernel *kernel = vp9_filter_kernels[mbmi->interp_filter];
|
||||
struct scale_factors sf;
|
||||
|
||||
// Do joint motion search in compound mode to get more accurate mv.
|
||||
|
|
|
@ -46,7 +46,7 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
|
|||
const int which_mv = 0;
|
||||
const MV mv = { mv_row, mv_col };
|
||||
const InterpKernel *const kernel =
|
||||
vp9_get_interp_kernel(xd->mi[0]->mbmi.interp_filter);
|
||||
vp9_filter_kernels[xd->mi[0]->mbmi.interp_filter];
|
||||
|
||||
enum mv_precision mv_precision_uv;
|
||||
int uv_stride;
|
||||
|
|
Загрузка…
Ссылка в новой задаче