diff --git a/test/convolve_test.cc b/test/convolve_test.cc index cbb403677d53b999e976d5fe7ab515f58fad0574..a6dcc98759afe36acc0eb5e1dd92059235c2427c 100644 --- a/test/convolve_test.cc +++ b/test/convolve_test.cc @@ -341,6 +341,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)); + const InterpKernel *const eighttap_smooth = + vp9_get_interp_kernel(EIGHTTAP_SMOOTH); + for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) { filter_block2d_8_c(in, kInputStride, @@ -348,7 +351,7 @@ TEST_P(ConvolveTest, MatchesReferenceSubpixelFilter) { ref, kOutputStride, Width(), Height()); - if (filters == vp9_sub_pel_filters_8lp || (filter_x && filter_y)) + if (filters == eighttap_smooth || (filter_x && filter_y)) REGISTER_STATE_CHECK( UUT_->hv8_(in, kInputStride, out, kOutputStride, filters[filter_x], 16, filters[filter_y], 16, @@ -396,6 +399,8 @@ 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)); + const InterpKernel *const eighttap_smooth = + vp9_get_interp_kernel(EIGHTTAP_SMOOTH); for (int filter_x = 0; filter_x < kNumFilters; ++filter_x) { for (int filter_y = 0; filter_y < kNumFilters; ++filter_y) { @@ -404,7 +409,7 @@ TEST_P(ConvolveTest, MatchesReferenceAveragingSubpixelFilter) { ref, kOutputStride, Width(), Height()); - if (filters == vp9_sub_pel_filters_8lp || (filter_x && filter_y)) + if (filters == eighttap_smooth || (filter_x && filter_y)) REGISTER_STATE_CHECK( UUT_->hv8_avg_(in, kInputStride, out, kOutputStride, filters[filter_x], 16, filters[filter_y], 16, @@ -544,6 +549,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); SetConstantInput(127); @@ -551,8 +557,8 @@ TEST_P(ConvolveTest, CheckScalingFiltering) { for (int step = 1; step <= 32; ++step) { /* Test the horizontal and vertical filters in combination. */ REGISTER_STATE_CHECK(UUT_->hv8_(in, kInputStride, out, kOutputStride, - vp9_sub_pel_filters_8[frac], step, - vp9_sub_pel_filters_8[frac], step, + eighttap[frac], step, + eighttap[frac], step, Width(), Height())); CheckGuardBlocks(); diff --git a/vp9/common/vp9_filter.c b/vp9/common/vp9_filter.c index 7474a88bcce1ab71109c647ad93874c6402041ac..afcdf22ec63ed9e76646339e39a20d91c1b1eba2 100644 --- a/vp9/common/vp9_filter.c +++ b/vp9/common/vp9_filter.c @@ -32,7 +32,8 @@ const InterpKernel vp9_bilinear_filters[SUBPEL_SHIFTS] = { }; // Lagrangian interpolation filter -const InterpKernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS] = { +DECLARE_ALIGNED(256, const InterpKernel, + vp9_sub_pel_filters_8[SUBPEL_SHIFTS]) = { { 0, 0, 0, 128, 0, 0, 0, 0}, { 0, 1, -5, 126, 8, -3, 1, 0}, { -1, 3, -10, 122, 18, -6, 2, 0}, @@ -52,7 +53,8 @@ const InterpKernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS] = { }; // DCT based filter -const InterpKernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS] = { +DECLARE_ALIGNED(256, const InterpKernel, + vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]) = { {0, 0, 0, 128, 0, 0, 0, 0}, {-1, 3, -7, 127, 8, -3, 1, 0}, {-2, 5, -13, 125, 17, -6, 3, -1}, @@ -72,7 +74,8 @@ const InterpKernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS] = { }; // freqmultiplier = 0.5 -const InterpKernel vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS] = { +DECLARE_ALIGNED(256, const InterpKernel, + vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]) = { { 0, 0, 0, 128, 0, 0, 0, 0}, {-3, -1, 32, 64, 38, 1, -3, 0}, {-2, -2, 29, 63, 41, 2, -3, 0}, diff --git a/vp9/common/vp9_filter.h b/vp9/common/vp9_filter.h index 29d3867c9310fca8858901cca10dea09d686db9f..8c359c7175c815f18a69f3b57bc4f31c03dba275 100644 --- a/vp9/common/vp9_filter.h +++ b/vp9/common/vp9_filter.h @@ -41,12 +41,6 @@ const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter); DECLARE_ALIGNED(256, extern const InterpKernel, vp9_bilinear_filters[SUBPEL_SHIFTS]); -DECLARE_ALIGNED(256, extern const InterpKernel, - vp9_sub_pel_filters_8[SUBPEL_SHIFTS]); -DECLARE_ALIGNED(256, extern const InterpKernel, - vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]); -DECLARE_ALIGNED(256, extern const InterpKernel, - vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]); // The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear // filter kernel as a 2 tap filter. diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 02536e34f229df44fbd8d33cf101824674758eae..1f68f03c413ad654c72e9aabe0c57b5d3a54340f 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -1414,6 +1414,7 @@ static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src, dst->alpha_buffer}; const int dst_strides[4] = {dst->y_stride, dst->uv_stride, dst->uv_stride, dst->alpha_stride}; + const InterpKernel *const kernel = vp9_get_interp_kernel(EIGHTTAP); int x, y, i; for (y = 0; y < dst_h; y += 16) { @@ -1429,8 +1430,8 @@ static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src, uint8_t *dst_ptr = dsts[i] + (y / factor) * dst_stride + (x / factor); vp9_convolve8(src_ptr, src_stride, dst_ptr, dst_stride, - vp9_sub_pel_filters_8[x_q4 & 0xf], 16 * src_w / dst_w, - vp9_sub_pel_filters_8[y_q4 & 0xf], 16 * src_h / dst_h, + kernel[x_q4 & 0xf], 16 * src_w / dst_w, + kernel[y_q4 & 0xf], 16 * src_h / dst_h, 16 / factor, 16 / factor); } }