ref: b00eb5c4640c442a3661ead67e793aae5e763419
parent: 99d39e5b9987f30bf573596a91e94db7019f3643
author: Dmitry Kovalev <[email protected]>
date: Mon Jan 27 09:20:39 EST 2014
Finally removing vp9_setup_interp_filters() function. Change-Id: If446225afbb49f6033c2a4516a37c377de6f70f7
--- a/vp9/common/vp9_filter.c
+++ b/vp9/common/vp9_filter.c
@@ -106,6 +106,7 @@
};
const interp_kernel *vp9_get_interp_kernel(INTERP_FILTER filter) {
+ assert(filter != SWITCHABLE);
return vp9_filter_kernels[filter];
}
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -2684,7 +2684,7 @@
}
} else {
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
// Adjust the zbin based on this MB rate.
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -25,13 +25,6 @@
#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_tokenize.h"
-void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter,
- VP9_COMMON *cm) {
- xd->interp_kernel = vp9_get_interp_kernel(filter == SWITCHABLE ? EIGHTTAP
- : filter);
- assert(((intptr_t)xd->interp_kernel & 0xff) == 0);
-}
-
void vp9_subtract_block_c(int rows, int cols,
int16_t *diff_ptr, ptrdiff_t diff_stride,
const uint8_t *src_ptr, ptrdiff_t src_stride,
--- a/vp9/encoder/vp9_encodemb.h
+++ b/vp9/encoder/vp9_encodemb.h
@@ -48,8 +48,7 @@
void vp9_encode_intra_block_uv(MACROBLOCK *x, BLOCK_SIZE bsize);
int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred);
-void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter,
- VP9_COMMON *cm);
+
#ifdef __cplusplus
} // extern "C"
#endif
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -3582,11 +3582,11 @@
}
set_ref_ptrs(cm, xd, LAST_FRAME, LAST_FRAME);
- vp9_setup_interp_filters(xd, DEFAULT_INTERP_FILTER, cm);
+ xd->interp_kernel = vp9_get_interp_kernel(
+ DEFAULT_INTERP_FILTER == SWITCHABLE ? EIGHTTAP : DEFAULT_INTERP_FILTER);
- if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
- vp9_vaq_init();
- }
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ)
+ vp9_vaq_init();
if (cpi->use_svc) {
SvcEncode(cpi, size, dest, frame_flags);
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2795,7 +2795,7 @@
int j;
int64_t rs_rd;
mbmi->interp_filter = i;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
rs = get_switchable_rate(x);
rs_rd = RDCOST(x->rdmult, x->rddiv, rs, 0);
@@ -2866,7 +2866,7 @@
// Set the appropriate filter
mbmi->interp_filter = cm->interp_filter != SWITCHABLE ?
cm->interp_filter : *best_filter;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
rs = cm->interp_filter == SWITCHABLE ? get_switchable_rate(x) : 0;
if (pred_exists) {
@@ -3294,8 +3294,9 @@
// Evaluate all sub-pel filters irrespective of whether we can use
// them for this frame.
- mbmi->interp_filter = cm->interp_filter;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
+ mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? EIGHTTAP
+ : cm->interp_filter;
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
if (comp_pred) {
if (!(cpi->ref_frame_flags & flag_list[second_ref_frame]))
@@ -3919,8 +3920,9 @@
// Evaluate all sub-pel filters irrespective of whether we can use
// them for this frame.
- mbmi->interp_filter = cm->interp_filter;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
+ mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? EIGHTTAP
+ : cm->interp_filter;
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
if (comp_pred) {
if (!(cpi->ref_frame_flags & flag_list[second_ref_frame]))
@@ -4043,8 +4045,7 @@
int newbest, rs;
int64_t rs_rd;
mbmi->interp_filter = switchable_filter_index;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
-
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
tmp_rd = rd_pick_best_mbsegmentation(cpi, x, tile,
&mbmi->ref_mvs[ref_frame][0],
second_ref,
@@ -4109,7 +4110,7 @@
mbmi->interp_filter = (cm->interp_filter == SWITCHABLE ?
tmp_best_filter : cm->interp_filter);
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
if (!pred_exists) {
// Handles the special case when a filter that is not in the
// switchable list (bilinear, 6-tap) is indicated at the frame level