ref: 91c412b6dbf8610742c30e6ecbe7fcacbb65d457
parent: 39f03bf9c672b8e7c4b483d4e919a695707c90dd
parent: 017253b7a31c2e248f4741399e24f62142348637
author: James Zern <[email protected]>
date: Mon Jul 6 17:36:36 EDT 2015
Merge "remove vp9_get_interp_kernel()"
--- a/test/convolve_test.cc
+++ b/test/convolve_test.cc
@@ -647,7 +647,7 @@
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 @@
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 @@
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 @@
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, 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);
--- a/vp9/common/vp9_filter.c
+++ b/vp9/common/vp9_filter.c
@@ -96,15 +96,9 @@
};
-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];
-}
-
--- a/vp9/common/vp9_filter.h
+++ b/vp9/common/vp9_filter.h
@@ -40,7 +40,7 @@
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"
--- a/vp9/common/vp9_reconinter.c
+++ b/vp9/common/vp9_reconinter.c
@@ -161,7 +161,7 @@
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) {
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -650,7 +650,7 @@
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);
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -2562,7 +2562,7 @@
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) {
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1813,7 +1813,7 @@
&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 @@
&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));
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1358,7 +1358,7 @@
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 @@
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.
--- a/vp9/encoder/vp9_temporal_filter.c
+++ b/vp9/encoder/vp9_temporal_filter.c
@@ -46,7 +46,7 @@
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;