Commit 4264c938 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Renaming INTERPOLATION_TYPE to INTERP_FILTER.

Corresponding renames:
  subpel_kernel              => interp_kernel
  vp9_get_filter_kernel()    => vp9_get_interp_kernel()
  pred_filter_type           => pred_interp_filter
  adaptive_pred_filter_type  => adaptive_pred_interp_filter
  mcomp_filter_type          => interp_filter
  read_interp_filter_type()  => read_interp_filter()
  write_interp_filter_type() => write_interp_filter()
  fix_mcomp_filter_type()    => fix_interp_filter()

Change-Id: I1fa61fa1dc81ebbf043457c3ee2d8d4515bee6d3
parent 03eb63c1
...@@ -135,7 +135,7 @@ typedef struct { ...@@ -135,7 +135,7 @@ typedef struct {
// Flags used for prediction status of various bit-stream signals // Flags used for prediction status of various bit-stream signals
unsigned char seg_id_predicted; unsigned char seg_id_predicted;
INTERPOLATION_TYPE interp_filter; INTERP_FILTER interp_filter;
BLOCK_SIZE sb_type; BLOCK_SIZE sb_type;
} MB_MODE_INFO; } MB_MODE_INFO;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
static void convolve_horiz(const uint8_t *src, ptrdiff_t src_stride, static void convolve_horiz(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride, uint8_t *dst, ptrdiff_t dst_stride,
const subpel_kernel *x_filters, const interp_kernel *x_filters,
int x0_q4, int x_step_q4, int w, int h) { int x0_q4, int x_step_q4, int w, int h) {
int x, y; int x, y;
src -= SUBPEL_TAPS / 2 - 1; src -= SUBPEL_TAPS / 2 - 1;
...@@ -42,7 +42,7 @@ static void convolve_horiz(const uint8_t *src, ptrdiff_t src_stride, ...@@ -42,7 +42,7 @@ static void convolve_horiz(const uint8_t *src, ptrdiff_t src_stride,
static void convolve_avg_horiz(const uint8_t *src, ptrdiff_t src_stride, static void convolve_avg_horiz(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride, uint8_t *dst, ptrdiff_t dst_stride,
const subpel_kernel *x_filters, const interp_kernel *x_filters,
int x0_q4, int x_step_q4, int w, int h) { int x0_q4, int x_step_q4, int w, int h) {
int x, y; int x, y;
src -= SUBPEL_TAPS / 2 - 1; src -= SUBPEL_TAPS / 2 - 1;
...@@ -65,7 +65,7 @@ static void convolve_avg_horiz(const uint8_t *src, ptrdiff_t src_stride, ...@@ -65,7 +65,7 @@ static void convolve_avg_horiz(const uint8_t *src, ptrdiff_t src_stride,
static void convolve_vert(const uint8_t *src, ptrdiff_t src_stride, static void convolve_vert(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride, uint8_t *dst, ptrdiff_t dst_stride,
const subpel_kernel *y_filters, const interp_kernel *y_filters,
int y0_q4, int y_step_q4, int w, int h) { int y0_q4, int y_step_q4, int w, int h) {
int x, y; int x, y;
src -= src_stride * (SUBPEL_TAPS / 2 - 1); src -= src_stride * (SUBPEL_TAPS / 2 - 1);
...@@ -88,7 +88,7 @@ static void convolve_vert(const uint8_t *src, ptrdiff_t src_stride, ...@@ -88,7 +88,7 @@ static void convolve_vert(const uint8_t *src, ptrdiff_t src_stride,
static void convolve_avg_vert(const uint8_t *src, ptrdiff_t src_stride, static void convolve_avg_vert(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride, uint8_t *dst, ptrdiff_t dst_stride,
const subpel_kernel *y_filters, const interp_kernel *y_filters,
int y0_q4, int y_step_q4, int w, int h) { int y0_q4, int y_step_q4, int w, int h) {
int x, y; int x, y;
src -= src_stride * (SUBPEL_TAPS / 2 - 1); src -= src_stride * (SUBPEL_TAPS / 2 - 1);
...@@ -112,9 +112,9 @@ static void convolve_avg_vert(const uint8_t *src, ptrdiff_t src_stride, ...@@ -112,9 +112,9 @@ static void convolve_avg_vert(const uint8_t *src, ptrdiff_t src_stride,
static void convolve(const uint8_t *src, ptrdiff_t src_stride, static void convolve(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride, uint8_t *dst, ptrdiff_t dst_stride,
const subpel_kernel *const x_filters, const interp_kernel *const x_filters,
int x0_q4, int x_step_q4, int x0_q4, int x_step_q4,
const subpel_kernel *const y_filters, const interp_kernel *const y_filters,
int y0_q4, int y_step_q4, int y0_q4, int y_step_q4,
int w, int h) { int w, int h) {
// Fixed size intermediate buffer places limits on parameters. // Fixed size intermediate buffer places limits on parameters.
...@@ -138,14 +138,14 @@ static void convolve(const uint8_t *src, ptrdiff_t src_stride, ...@@ -138,14 +138,14 @@ static void convolve(const uint8_t *src, ptrdiff_t src_stride,
y_filters, y0_q4, y_step_q4, w, h); y_filters, y0_q4, y_step_q4, w, h);
} }
static const subpel_kernel *get_filter_base(const int16_t *filter) { static const interp_kernel *get_filter_base(const int16_t *filter) {
// NOTE: This assumes that the filter table is 256-byte aligned. // NOTE: This assumes that the filter table is 256-byte aligned.
// TODO(agrange) Modify to make independent of table alignment. // TODO(agrange) Modify to make independent of table alignment.
return (const subpel_kernel *)(((intptr_t)filter) & ~((intptr_t)0xFF)); return (const interp_kernel *)(((intptr_t)filter) & ~((intptr_t)0xFF));
} }
static int get_filter_offset(const int16_t *f, const subpel_kernel *base) { static int get_filter_offset(const int16_t *f, const interp_kernel *base) {
return (const subpel_kernel *)(intptr_t)f - base; return (const interp_kernel *)(intptr_t)f - base;
} }
void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride, void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
...@@ -153,7 +153,7 @@ void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -153,7 +153,7 @@ void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4, const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4, const int16_t *filter_y, int y_step_q4,
int w, int h) { int w, int h) {
const subpel_kernel *const filters_x = get_filter_base(filter_x); const interp_kernel *const filters_x = get_filter_base(filter_x);
const int x0_q4 = get_filter_offset(filter_x, filters_x); const int x0_q4 = get_filter_offset(filter_x, filters_x);
convolve_horiz(src, src_stride, dst, dst_stride, filters_x, convolve_horiz(src, src_stride, dst, dst_stride, filters_x,
...@@ -165,7 +165,7 @@ void vp9_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -165,7 +165,7 @@ void vp9_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4, const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4, const int16_t *filter_y, int y_step_q4,
int w, int h) { int w, int h) {
const subpel_kernel *const filters_x = get_filter_base(filter_x); const interp_kernel *const filters_x = get_filter_base(filter_x);
const int x0_q4 = get_filter_offset(filter_x, filters_x); const int x0_q4 = get_filter_offset(filter_x, filters_x);
convolve_avg_horiz(src, src_stride, dst, dst_stride, filters_x, convolve_avg_horiz(src, src_stride, dst, dst_stride, filters_x,
...@@ -177,7 +177,7 @@ void vp9_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -177,7 +177,7 @@ void vp9_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4, const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4, const int16_t *filter_y, int y_step_q4,
int w, int h) { int w, int h) {
const subpel_kernel *const filters_y = get_filter_base(filter_y); const interp_kernel *const filters_y = get_filter_base(filter_y);
const int y0_q4 = get_filter_offset(filter_y, filters_y); const int y0_q4 = get_filter_offset(filter_y, filters_y);
convolve_vert(src, src_stride, dst, dst_stride, filters_y, convolve_vert(src, src_stride, dst, dst_stride, filters_y,
y0_q4, y_step_q4, w, h); y0_q4, y_step_q4, w, h);
...@@ -188,7 +188,7 @@ void vp9_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -188,7 +188,7 @@ void vp9_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4, const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4, const int16_t *filter_y, int y_step_q4,
int w, int h) { int w, int h) {
const subpel_kernel *const filters_y = get_filter_base(filter_y); const interp_kernel *const filters_y = get_filter_base(filter_y);
const int y0_q4 = get_filter_offset(filter_y, filters_y); const int y0_q4 = get_filter_offset(filter_y, filters_y);
convolve_avg_vert(src, src_stride, dst, dst_stride, filters_y, convolve_avg_vert(src, src_stride, dst, dst_stride, filters_y,
y0_q4, y_step_q4, w, h); y0_q4, y_step_q4, w, h);
...@@ -199,10 +199,10 @@ void vp9_convolve8_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -199,10 +199,10 @@ void vp9_convolve8_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4, const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4, const int16_t *filter_y, int y_step_q4,
int w, int h) { int w, int h) {
const subpel_kernel *const filters_x = get_filter_base(filter_x); const interp_kernel *const filters_x = get_filter_base(filter_x);
const int x0_q4 = get_filter_offset(filter_x, filters_x); const int x0_q4 = get_filter_offset(filter_x, filters_x);
const subpel_kernel *const filters_y = get_filter_base(filter_y); const interp_kernel *const filters_y = get_filter_base(filter_y);
const int y0_q4 = get_filter_offset(filter_y, filters_y); const int y0_q4 = get_filter_offset(filter_y, filters_y);
convolve(src, src_stride, dst, dst_stride, convolve(src, src_stride, dst, dst_stride,
......
...@@ -385,7 +385,7 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) { ...@@ -385,7 +385,7 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
adapt_probs(vp9_partition_tree, pre_fc->partition_prob[i], adapt_probs(vp9_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]); counts->partition[i], fc->partition_prob[i]);
if (cm->mcomp_filter_type == SWITCHABLE) { if (cm->interp_filter == SWITCHABLE) {
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
adapt_probs(vp9_switchable_interp_tree, pre_fc->switchable_interp_prob[i], adapt_probs(vp9_switchable_interp_tree, pre_fc->switchable_interp_prob[i],
counts->switchable_interp[i], fc->switchable_interp_prob[i]); counts->switchable_interp[i], fc->switchable_interp_prob[i]);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "vp9/common/vp9_filter.h" #include "vp9/common/vp9_filter.h"
DECLARE_ALIGNED(256, const subpel_kernel, DECLARE_ALIGNED(256, const interp_kernel,
vp9_bilinear_filters[SUBPEL_SHIFTS]) = { vp9_bilinear_filters[SUBPEL_SHIFTS]) = {
{ 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, 0, 0, 128, 0, 0, 0, 0 },
{ 0, 0, 0, 120, 8, 0, 0, 0 }, { 0, 0, 0, 120, 8, 0, 0, 0 },
...@@ -35,7 +35,7 @@ DECLARE_ALIGNED(256, const subpel_kernel, ...@@ -35,7 +35,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
}; };
// Lagrangian interpolation filter // Lagrangian interpolation filter
DECLARE_ALIGNED(256, const subpel_kernel, DECLARE_ALIGNED(256, const interp_kernel,
vp9_sub_pel_filters_8[SUBPEL_SHIFTS]) = { vp9_sub_pel_filters_8[SUBPEL_SHIFTS]) = {
{ 0, 0, 0, 128, 0, 0, 0, 0}, { 0, 0, 0, 128, 0, 0, 0, 0},
{ 0, 1, -5, 126, 8, -3, 1, 0}, { 0, 1, -5, 126, 8, -3, 1, 0},
...@@ -56,7 +56,7 @@ DECLARE_ALIGNED(256, const subpel_kernel, ...@@ -56,7 +56,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
}; };
// DCT based filter // DCT based filter
DECLARE_ALIGNED(256, const subpel_kernel, DECLARE_ALIGNED(256, const interp_kernel,
vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]) = { vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]) = {
{0, 0, 0, 128, 0, 0, 0, 0}, {0, 0, 0, 128, 0, 0, 0, 0},
{-1, 3, -7, 127, 8, -3, 1, 0}, {-1, 3, -7, 127, 8, -3, 1, 0},
...@@ -77,7 +77,7 @@ DECLARE_ALIGNED(256, const subpel_kernel, ...@@ -77,7 +77,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
}; };
// freqmultiplier = 0.5 // freqmultiplier = 0.5
DECLARE_ALIGNED(256, const subpel_kernel, DECLARE_ALIGNED(256, const interp_kernel,
vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]) = { vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]) = {
{ 0, 0, 0, 128, 0, 0, 0, 0}, { 0, 0, 0, 128, 0, 0, 0, 0},
{-3, -1, 32, 64, 38, 1, -3, 0}, {-3, -1, 32, 64, 38, 1, -3, 0},
...@@ -98,14 +98,14 @@ DECLARE_ALIGNED(256, const subpel_kernel, ...@@ -98,14 +98,14 @@ DECLARE_ALIGNED(256, const subpel_kernel,
}; };
static const subpel_kernel* vp9_filter_kernels[4] = { static const interp_kernel* vp9_filter_kernels[4] = {
vp9_sub_pel_filters_8, vp9_sub_pel_filters_8,
vp9_sub_pel_filters_8lp, vp9_sub_pel_filters_8lp,
vp9_sub_pel_filters_8s, vp9_sub_pel_filters_8s,
vp9_bilinear_filters vp9_bilinear_filters
}; };
const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type) { const interp_kernel *vp9_get_interp_kernel(INTERP_FILTER filter) {
return vp9_filter_kernels[type]; return vp9_filter_kernels[filter];
} }
...@@ -31,21 +31,21 @@ typedef enum { ...@@ -31,21 +31,21 @@ typedef enum {
EIGHTTAP_SHARP = 2, EIGHTTAP_SHARP = 2,
BILINEAR = 3, BILINEAR = 3,
SWITCHABLE = 4 /* should be the last one */ SWITCHABLE = 4 /* should be the last one */
} INTERPOLATION_TYPE; } INTERP_FILTER;
typedef int16_t subpel_kernel[SUBPEL_TAPS]; typedef int16_t interp_kernel[SUBPEL_TAPS];
struct subpix_fn_table { struct subpix_fn_table {
const subpel_kernel *filter_x; const interp_kernel *filter_x;
const subpel_kernel *filter_y; const interp_kernel *filter_y;
}; };
const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type); const interp_kernel *vp9_get_interp_kernel(INTERP_FILTER filter);
extern const subpel_kernel vp9_bilinear_filters[SUBPEL_SHIFTS]; extern const interp_kernel vp9_bilinear_filters[SUBPEL_SHIFTS];
extern const subpel_kernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS]; extern const interp_kernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS];
extern const subpel_kernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]; extern const interp_kernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS];
extern const subpel_kernel vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]; extern const interp_kernel vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS];
// The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear // The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear
// filter kernel as a 2 tap filter. // filter kernel as a 2 tap filter.
......
...@@ -184,7 +184,7 @@ typedef struct VP9Common { ...@@ -184,7 +184,7 @@ typedef struct VP9Common {
// Persistent mb segment id map used in prediction. // Persistent mb segment id map used in prediction.
unsigned char *last_frame_seg_map; unsigned char *last_frame_seg_map;
INTERPOLATION_TYPE mcomp_filter_type; INTERP_FILTER interp_filter;
loop_filter_info_n lf_info; loop_filter_info_n lf_info;
......
...@@ -422,7 +422,7 @@ static void decode_modes_b(VP9_COMMON *const cm, MACROBLOCKD *const xd, ...@@ -422,7 +422,7 @@ static void decode_modes_b(VP9_COMMON *const cm, MACROBLOCKD *const xd,
set_ref(cm, xd, 1, mi_row, mi_col); set_ref(cm, xd, 1, mi_row, mi_col);
xd->subpix.filter_x = xd->subpix.filter_y = xd->subpix.filter_x = xd->subpix.filter_y =
vp9_get_filter_kernel(mbmi->interp_filter); vp9_get_interp_kernel(mbmi->interp_filter);
// Prediction // Prediction
vp9_dec_build_inter_predictors_sb(xd, mi_row, mi_col, bsize); vp9_dec_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
...@@ -655,14 +655,13 @@ static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd, ...@@ -655,14 +655,13 @@ static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd,
xd->itxm_add = xd->lossless ? vp9_iwht4x4_add : vp9_idct4x4_add; xd->itxm_add = xd->lossless ? vp9_iwht4x4_add : vp9_idct4x4_add;
} }
static INTERPOLATION_TYPE read_interp_filter_type( static INTERP_FILTER read_interp_filter(struct vp9_read_bit_buffer *rb) {
struct vp9_read_bit_buffer *rb) { const INTERP_FILTER literal_to_filter[] = { EIGHTTAP_SMOOTH,
const INTERPOLATION_TYPE literal_to_type[] = { EIGHTTAP_SMOOTH, EIGHTTAP,
EIGHTTAP, EIGHTTAP_SHARP,
EIGHTTAP_SHARP, BILINEAR };
BILINEAR };
return vp9_rb_read_bit(rb) ? SWITCHABLE return vp9_rb_read_bit(rb) ? SWITCHABLE
: literal_to_type[vp9_rb_read_literal(rb, 2)]; : literal_to_filter[vp9_rb_read_literal(rb, 2)];
} }
static void read_frame_size(struct vp9_read_bit_buffer *rb, static void read_frame_size(struct vp9_read_bit_buffer *rb,
...@@ -1186,7 +1185,7 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi, ...@@ -1186,7 +1185,7 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi,
setup_frame_size_with_refs(pbi, rb); setup_frame_size_with_refs(pbi, rb);
cm->allow_high_precision_mv = vp9_rb_read_bit(rb); cm->allow_high_precision_mv = vp9_rb_read_bit(rb);
cm->mcomp_filter_type = read_interp_filter_type(rb); cm->interp_filter = read_interp_filter(rb);
for (i = 0; i < REFS_PER_FRAME; ++i) { for (i = 0; i < REFS_PER_FRAME; ++i) {
RefBuffer *const ref_buf = &cm->frame_refs[i]; RefBuffer *const ref_buf = &cm->frame_refs[i];
...@@ -1256,7 +1255,7 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data, ...@@ -1256,7 +1255,7 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
read_inter_mode_probs(fc, &r); read_inter_mode_probs(fc, &r);
if (cm->mcomp_filter_type == SWITCHABLE) if (cm->interp_filter == SWITCHABLE)
read_switchable_interp_probs(fc, &r); read_switchable_interp_probs(fc, &r);
for (i = 0; i < INTRA_INTER_CONTEXTS; i++) for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
......
...@@ -313,7 +313,7 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd, ...@@ -313,7 +313,7 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd,
} }
static INLINE INTERPOLATION_TYPE read_switchable_filter_type( static INLINE INTERP_FILTER read_switchable_interp_filter(
VP9_COMMON *const cm, MACROBLOCKD *const xd, vp9_reader *r) { VP9_COMMON *const cm, MACROBLOCKD *const xd, vp9_reader *r) {
const int ctx = vp9_get_pred_context_switchable_interp(xd); const int ctx = vp9_get_pred_context_switchable_interp(xd);
const int type = vp9_read_tree(r, vp9_switchable_interp_tree, const int type = vp9_read_tree(r, vp9_switchable_interp_tree,
...@@ -459,9 +459,9 @@ static void read_inter_block_mode_info(VP9_COMMON *const cm, ...@@ -459,9 +459,9 @@ static void read_inter_block_mode_info(VP9_COMMON *const cm,
} }
} }
mbmi->interp_filter = (cm->mcomp_filter_type == SWITCHABLE) mbmi->interp_filter = (cm->interp_filter == SWITCHABLE)
? read_switchable_filter_type(cm, xd, r) ? read_switchable_interp_filter(cm, xd, r)
: cm->mcomp_filter_type; : cm->interp_filter;
if (bsize < BLOCK_8X8) { if (bsize < BLOCK_8X8) {
const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2 const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2
......
...@@ -325,13 +325,13 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) { ...@@ -325,13 +325,13 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
} }
} }
if (cm->mcomp_filter_type == SWITCHABLE) { if (cm->interp_filter == SWITCHABLE) {
const int ctx = vp9_get_pred_context_switchable_interp(xd); const int ctx = vp9_get_pred_context_switchable_interp(xd);
vp9_write_token(bc, vp9_switchable_interp_tree, vp9_write_token(bc, vp9_switchable_interp_tree,
cm->fc.switchable_interp_prob[ctx], cm->fc.switchable_interp_prob[ctx],
&switchable_interp_encodings[mi->interp_filter]); &switchable_interp_encodings[mi->interp_filter]);
} else { } else {
assert(mi->interp_filter == cm->mcomp_filter_type); assert(mi->interp_filter == cm->interp_filter);
} }
if (bsize < BLOCK_8X8) { if (bsize < BLOCK_8X8) {
...@@ -910,17 +910,17 @@ static void encode_txfm_probs(VP9_COMP *cpi, vp9_writer *w) { ...@@ -910,17 +910,17 @@ static void encode_txfm_probs(VP9_COMP *cpi, vp9_writer *w) {
} }
} }
static void write_interp_filter_type(INTERPOLATION_TYPE type, static void write_interp_filter(INTERP_FILTER filter,
struct vp9_write_bit_buffer *wb) { struct vp9_write_bit_buffer *wb) {
const int type_to_literal[] = { 1, 0, 2, 3 }; const int filter_to_literal[] = { 1, 0, 2, 3 };
vp9_wb_write_bit(wb, type == SWITCHABLE); vp9_wb_write_bit(wb, filter == SWITCHABLE);
if (type != SWITCHABLE) if (filter != SWITCHABLE)
vp9_wb_write_literal(wb, type_to_literal[type], 2); vp9_wb_write_literal(wb, filter_to_literal[filter], 2);
} }
static void fix_mcomp_filter_type(VP9_COMMON *cm) { static void fix_interp_filter(VP9_COMMON *cm) {
if (cm->mcomp_filter_type == SWITCHABLE) { if (cm->interp_filter == SWITCHABLE) {
// Check to see if only one of the filters is actually used // Check to see if only one of the filters is actually used
int count[SWITCHABLE_FILTERS]; int count[SWITCHABLE_FILTERS];
int i, j, c = 0; int i, j, c = 0;
...@@ -934,7 +934,7 @@ static void fix_mcomp_filter_type(VP9_COMMON *cm) { ...@@ -934,7 +934,7 @@ static void fix_mcomp_filter_type(VP9_COMMON *cm) {
// Only one filter is used. So set the filter at frame level // Only one filter is used. So set the filter at frame level
for (i = 0; i < SWITCHABLE_FILTERS; ++i) { for (i = 0; i < SWITCHABLE_FILTERS; ++i) {
if (count[i]) { if (count[i]) {
cm->mcomp_filter_type = i; cm->interp_filter = i;
break; break;
} }
} }
...@@ -1162,8 +1162,8 @@ static void write_uncompressed_header(VP9_COMP *cpi, ...@@ -1162,8 +1162,8 @@ static void write_uncompressed_header(VP9_COMP *cpi,
vp9_wb_write_bit(wb, cm->allow_high_precision_mv); vp9_wb_write_bit(wb, cm->allow_high_precision_mv);
fix_mcomp_filter_type(cm); fix_interp_filter(cm);
write_interp_filter_type(cm->mcomp_filter_type, wb); write_interp_filter(cm->interp_filter, wb);
} }
} }
...@@ -1214,7 +1214,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) { ...@@ -1214,7 +1214,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
vp9_zero(cm->counts.inter_mode); vp9_zero(cm->counts.inter_mode);
if (cm->mcomp_filter_type == SWITCHABLE) if (cm->interp_filter == SWITCHABLE)
update_switchable_interp_probs(cpi, &header_bc); update_switchable_interp_probs(cpi, &header_bc);
for (i = 0; i < INTRA_INTER_CONTEXTS; i++) for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
......
...@@ -62,7 +62,7 @@ typedef struct { ...@@ -62,7 +62,7 @@ typedef struct {
// motion vector cache for adaptive motion search control in partition // motion vector cache for adaptive motion search control in partition
// search loop // search loop
int_mv pred_mv[MAX_REF_FRAMES]; int_mv pred_mv[MAX_REF_FRAMES];
int pred_filter_type; INTERP_FILTER pred_interp_filter;
// Bit flag for each mode whether it has high error in comparison to others. // Bit flag for each mode whether it has high error in comparison to others.
unsigned int modes_with_high_error; unsigned int modes_with_high_error;
......
...@@ -505,7 +505,7 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, ...@@ -505,7 +505,7 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
vp9_update_mv_count(cpi, x, best_mv); vp9_update_mv_count(cpi, x, best_mv);
} }
if (cm->mcomp_filter_type == SWITCHABLE && is_inter_mode(mbmi->mode)) { if (cm->interp_filter == SWITCHABLE && is_inter_mode(mbmi->mode)) {
const int ctx = vp9_get_pred_context_switchable_interp(xd); const int ctx = vp9_get_pred_context_switchable_interp(xd);
++cm->counts.switchable_interp[ctx][mbmi->interp_filter]; ++cm->counts.switchable_interp[ctx][mbmi->interp_filter];
} }
...@@ -1788,9 +1788,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile, ...@@ -1788,9 +1788,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
*get_sb_index(x, subsize) = i; *get_sb_index(x, subsize) = i;
if (cpi->sf.adaptive_motion_search) if (cpi->sf.adaptive_motion_search)
load_pred_mv(x, get_block_context(x, bsize)); load_pred_mv(x, get_block_context(x, bsize));
if (cpi->sf.adaptive_pred_filter_type && bsize == BLOCK_8X8 && if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 &&
partition_none_allowed) partition_none_allowed)
get_block_context(x, subsize)->pred_filter_type = get_block_context(x, subsize)->pred_interp_filter =
get_block_context(x, bsize)->mic.mbmi.interp_filter; get_block_context(x, bsize)->mic.mbmi.interp_filter;
rd_pick_partition(cpi, tile, tp, mi_row + y_idx, mi_col + x_idx, subsize, rd_pick_partition(cpi, tile, tp, mi_row + y_idx, mi_col + x_idx, subsize,
&this_rate, &this_dist, i != 3, best_rd - sum_rd); &this_rate, &this_dist, i != 3, best_rd - sum_rd);
...@@ -1839,9 +1839,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile, ...@@ -1839,9 +1839,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
*get_sb_index(x, subsize) = 0; *get_sb_index(x, subsize) = 0;
if (cpi->sf.adaptive_motion_search) if (cpi->sf.adaptive_motion_search)
load_pred_mv(x, get_block_context(x, bsize)); load_pred_mv(x, get_block_context(x, bsize));
if (cpi->sf.adaptive_pred_filter_type && bsize == BLOCK_8X8 && if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 &&
partition_none_allowed) partition_none_allowed)
get_block_context(x, subsize)->pred_filter_type = get_block_context(x, subsize)->pred_interp_filter =
get_block_context(x, bsize)->mic.mbmi.interp_filter; get_block_context(x, bsize)->mic.mbmi.interp_filter;
rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize, rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
get_block_context(x, subsize), best_rd); get_block_context(x, subsize), best_rd);
...@@ -1854,9 +1854,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile, ...@@ -1854,9 +1854,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
*get_sb_index(x, subsize) = 1; *get_sb_index(x, subsize) = 1;