// Flags used for prediction status of various bit-stream signals
unsigned char seg_id_predicted;
- INTERPOLATION_TYPE interp_filter;
+ INTERP_FILTER interp_filter;
BLOCK_SIZE sb_type;
} MB_MODE_INFO;
static void convolve_horiz(const uint8_t *src, ptrdiff_t src_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 x, y;
src -= SUBPEL_TAPS / 2 - 1;
static void convolve_avg_horiz(const uint8_t *src, ptrdiff_t src_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 x, y;
src -= SUBPEL_TAPS / 2 - 1;
static void convolve_vert(const uint8_t *src, ptrdiff_t src_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 x, y;
src -= src_stride * (SUBPEL_TAPS / 2 - 1);
static void convolve_avg_vert(const uint8_t *src, ptrdiff_t src_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 x, y;
src -= src_stride * (SUBPEL_TAPS / 2 - 1);
static void convolve(const uint8_t *src, ptrdiff_t src_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,
- const subpel_kernel *const y_filters,
+ const interp_kernel *const y_filters,
int y0_q4, int y_step_q4,
int w, int h) {
// Fixed size intermediate buffer places limits on parameters.
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.
// 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) {
- return (const subpel_kernel *)(intptr_t)f - base;
+static int get_filter_offset(const int16_t *f, const interp_kernel *base) {
+ return (const interp_kernel *)(intptr_t)f - base;
}
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_y, int y_step_q4,
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);
convolve_horiz(src, src_stride, dst, dst_stride, filters_x,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
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);
convolve_avg_horiz(src, src_stride, dst, dst_stride, filters_x,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
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);
convolve_vert(src, src_stride, dst, dst_stride, filters_y,
y0_q4, y_step_q4, w, h);
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
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);
convolve_avg_vert(src, src_stride, dst, dst_stride, filters_y,
y0_q4, y_step_q4, w, h);
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
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 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);
convolve(src, src_stride, dst, dst_stride,
adapt_probs(vp9_partition_tree, pre_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++)
adapt_probs(vp9_switchable_interp_tree, pre_fc->switchable_interp_prob[i],
counts->switchable_interp[i], fc->switchable_interp_prob[i]);
#include "vp9/common/vp9_filter.h"
-DECLARE_ALIGNED(256, const subpel_kernel,
+DECLARE_ALIGNED(256, const interp_kernel,
vp9_bilinear_filters[SUBPEL_SHIFTS]) = {
{ 0, 0, 0, 128, 0, 0, 0, 0 },
{ 0, 0, 0, 120, 8, 0, 0, 0 },
};
// Lagrangian interpolation filter
-DECLARE_ALIGNED(256, const subpel_kernel,
+DECLARE_ALIGNED(256, const interp_kernel,
vp9_sub_pel_filters_8[SUBPEL_SHIFTS]) = {
{ 0, 0, 0, 128, 0, 0, 0, 0},
{ 0, 1, -5, 126, 8, -3, 1, 0},
};
// DCT based filter
-DECLARE_ALIGNED(256, const subpel_kernel,
+DECLARE_ALIGNED(256, const interp_kernel,
vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]) = {
{0, 0, 0, 128, 0, 0, 0, 0},
{-1, 3, -7, 127, 8, -3, 1, 0},
};
// freqmultiplier = 0.5
-DECLARE_ALIGNED(256, const subpel_kernel,
+DECLARE_ALIGNED(256, const interp_kernel,
vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]) = {
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-3, -1, 32, 64, 38, 1, -3, 0},
};
-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_8lp,
vp9_sub_pel_filters_8s,
vp9_bilinear_filters
};
-const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type) {
- return vp9_filter_kernels[type];
+const interp_kernel *vp9_get_interp_kernel(INTERP_FILTER filter) {
+ return vp9_filter_kernels[filter];
}
EIGHTTAP_SHARP = 2,
BILINEAR = 3,
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 {
- const subpel_kernel *filter_x;
- const subpel_kernel *filter_y;
+ const interp_kernel *filter_x;
+ 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 subpel_kernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS];
-extern const subpel_kernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS];
-extern const subpel_kernel vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS];
+extern const interp_kernel vp9_bilinear_filters[SUBPEL_SHIFTS];
+extern const interp_kernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS];
+extern const interp_kernel vp9_sub_pel_filters_8s[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
// filter kernel as a 2 tap filter.
// Persistent mb segment id map used in prediction.
unsigned char *last_frame_seg_map;
- INTERPOLATION_TYPE mcomp_filter_type;
+ INTERP_FILTER interp_filter;
loop_filter_info_n lf_info;
set_ref(cm, xd, 1, mi_row, mi_col);
xd->subpix.filter_x = xd->subpix.filter_y =
- vp9_get_filter_kernel(mbmi->interp_filter);
+ vp9_get_interp_kernel(mbmi->interp_filter);
// Prediction
vp9_dec_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
xd->itxm_add = xd->lossless ? vp9_iwht4x4_add : vp9_idct4x4_add;
}
-static INTERPOLATION_TYPE read_interp_filter_type(
- struct vp9_read_bit_buffer *rb) {
- const INTERPOLATION_TYPE literal_to_type[] = { EIGHTTAP_SMOOTH,
- EIGHTTAP,
- EIGHTTAP_SHARP,
- BILINEAR };
+static INTERP_FILTER read_interp_filter(struct vp9_read_bit_buffer *rb) {
+ const INTERP_FILTER literal_to_filter[] = { EIGHTTAP_SMOOTH,
+ EIGHTTAP,
+ EIGHTTAP_SHARP,
+ BILINEAR };
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,
setup_frame_size_with_refs(pbi, 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) {
RefBuffer *const ref_buf = &cm->frame_refs[i];
read_inter_mode_probs(fc, &r);
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
read_switchable_interp_probs(fc, &r);
for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
}
-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) {
const int ctx = vp9_get_pred_context_switchable_interp(xd);
const int type = vp9_read_tree(r, vp9_switchable_interp_tree,
}
}
- mbmi->interp_filter = (cm->mcomp_filter_type == SWITCHABLE)
- ? read_switchable_filter_type(cm, xd, r)
- : cm->mcomp_filter_type;
+ mbmi->interp_filter = (cm->interp_filter == SWITCHABLE)
+ ? read_switchable_interp_filter(cm, xd, r)
+ : cm->interp_filter;
if (bsize < BLOCK_8X8) {
const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2
}
}
- if (cm->mcomp_filter_type == SWITCHABLE) {
+ if (cm->interp_filter == SWITCHABLE) {
const int ctx = vp9_get_pred_context_switchable_interp(xd);
vp9_write_token(bc, vp9_switchable_interp_tree,
cm->fc.switchable_interp_prob[ctx],
&switchable_interp_encodings[mi->interp_filter]);
} else {
- assert(mi->interp_filter == cm->mcomp_filter_type);
+ assert(mi->interp_filter == cm->interp_filter);
}
if (bsize < BLOCK_8X8) {
}
}
-static void write_interp_filter_type(INTERPOLATION_TYPE type,
- struct vp9_write_bit_buffer *wb) {
- const int type_to_literal[] = { 1, 0, 2, 3 };
+static void write_interp_filter(INTERP_FILTER filter,
+ struct vp9_write_bit_buffer *wb) {
+ const int filter_to_literal[] = { 1, 0, 2, 3 };
- vp9_wb_write_bit(wb, type == SWITCHABLE);
- if (type != SWITCHABLE)
- vp9_wb_write_literal(wb, type_to_literal[type], 2);
+ vp9_wb_write_bit(wb, filter == SWITCHABLE);
+ if (filter != SWITCHABLE)
+ vp9_wb_write_literal(wb, filter_to_literal[filter], 2);
}
-static void fix_mcomp_filter_type(VP9_COMMON *cm) {
- if (cm->mcomp_filter_type == SWITCHABLE) {
+static void fix_interp_filter(VP9_COMMON *cm) {
+ if (cm->interp_filter == SWITCHABLE) {
// Check to see if only one of the filters is actually used
int count[SWITCHABLE_FILTERS];
int i, j, c = 0;
// Only one filter is used. So set the filter at frame level
for (i = 0; i < SWITCHABLE_FILTERS; ++i) {
if (count[i]) {
- cm->mcomp_filter_type = i;
+ cm->interp_filter = i;
break;
}
}
vp9_wb_write_bit(wb, cm->allow_high_precision_mv);
- fix_mcomp_filter_type(cm);
- write_interp_filter_type(cm->mcomp_filter_type, wb);
+ fix_interp_filter(cm);
+ write_interp_filter(cm->interp_filter, wb);
}
}
vp9_zero(cm->counts.inter_mode);
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
update_switchable_interp_probs(cpi, &header_bc);
for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
// motion vector cache for adaptive motion search control in partition
// search loop
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.
unsigned int modes_with_high_error;
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);
++cm->counts.switchable_interp[ctx][mbmi->interp_filter];
}
*get_sb_index(x, subsize) = i;
if (cpi->sf.adaptive_motion_search)
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)
- 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;
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);
*get_sb_index(x, subsize) = 0;
if (cpi->sf.adaptive_motion_search)
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)
- 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;
rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
get_block_context(x, subsize), best_rd);
*get_sb_index(x, subsize) = 1;
if (cpi->sf.adaptive_motion_search)
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)
- 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;
rd_pick_sb_modes(cpi, tile, mi_row + ms, mi_col, &this_rate,
&this_dist, subsize, get_block_context(x, subsize),
*get_sb_index(x, subsize) = 0;
if (cpi->sf.adaptive_motion_search)
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)
- 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;
rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
get_block_context(x, subsize), best_rd);
*get_sb_index(x, subsize) = 1;
if (cpi->sf.adaptive_motion_search)
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)
- 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;
rd_pick_sb_modes(cpi, tile, mi_row, mi_col + ms, &this_rate,
&this_dist, subsize, get_block_context(x, subsize),
for (x->sb_index = 0; x->sb_index < 4; ++x->sb_index)
for (x->mb_index = 0; x->mb_index < 4; ++x->mb_index)
for (x->b_index = 0; x->b_index < 16 / num_4x4_blk; ++x->b_index)
- get_block_context(x, i)->pred_filter_type = SWITCHABLE;
+ get_block_context(x, i)->pred_interp_filter = SWITCHABLE;
}
vp9_zero(cpi->mb.pred_mv);
if (cpi->sf.RD) {
int i;
REFERENCE_MODE reference_mode;
- INTERPOLATION_TYPE filter_type;
+ INTERP_FILTER interp_filter;
/*
* This code does a single RD pass over the whole frame assuming
* either compound, single or hybrid prediction as per whatever has
filter_thresh[EIGHTTAP_SMOOTH] > filter_thresh[EIGHTTAP] &&
filter_thresh[EIGHTTAP_SMOOTH] > filter_thresh[EIGHTTAP_SHARP] &&
filter_thresh[EIGHTTAP_SMOOTH] > filter_thresh[SWITCHABLE - 1]) {
- filter_type = EIGHTTAP_SMOOTH;
+ interp_filter = EIGHTTAP_SMOOTH;
} else if (filter_thresh[EIGHTTAP_SHARP] > filter_thresh[EIGHTTAP] &&
filter_thresh[EIGHTTAP_SHARP] > filter_thresh[SWITCHABLE - 1]) {
- filter_type = EIGHTTAP_SHARP;
+ interp_filter = EIGHTTAP_SHARP;
} else if (filter_thresh[EIGHTTAP] > filter_thresh[SWITCHABLE - 1]) {
- filter_type = EIGHTTAP;
+ interp_filter = EIGHTTAP;
} else {
- filter_type = SWITCHABLE;
+ interp_filter = SWITCHABLE;
}
cpi->mb.e_mbd.lossless = cpi->oxcf.lossless;
/* transform size selection (4x4, 8x8, 16x16 or select-per-mb) */
select_tx_mode(cpi);
cm->reference_mode = reference_mode;
- cm->mcomp_filter_type = filter_type;
+ cm->interp_filter = interp_filter;
encode_frame_internal(cpi);
for (i = 0; i < REFERENCE_MODES; ++i) {
#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_tokenize.h"
-void vp9_setup_interp_filters(MACROBLOCKD *xd,
- INTERPOLATION_TYPE mcomp_filter_type,
+void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter,
VP9_COMMON *cm) {
if (xd->mi_8x8 && xd->mi_8x8[0]) {
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
}
xd->subpix.filter_x = xd->subpix.filter_y =
- vp9_get_filter_kernel(mcomp_filter_type == SWITCHABLE ?
- EIGHTTAP : mcomp_filter_type);
+ vp9_get_interp_kernel(filter == SWITCHABLE ? EIGHTTAP : filter);
assert(((intptr_t)xd->subpix.filter_x & 0xff) == 0);
}
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,
- INTERPOLATION_TYPE mcomp_filter_type,
+void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERP_FILTER filter,
VP9_COMMON *cm);
#ifdef __cplusplus
} // extern "C"
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
- sf->adaptive_pred_filter_type = 1;
+ sf->adaptive_pred_interp_filter = 1;
sf->auto_mv_step_size = 1;
sf->adaptive_rd_thresh = 2;
sf->recode_loop = 2;
FLAG_SKIP_INTRA_LOWVAR;
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
- sf->adaptive_pred_filter_type = 2;
+ sf->adaptive_pred_interp_filter = 2;
sf->reference_masking = 1;
sf->auto_mv_step_size = 1;
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
- sf->adaptive_pred_filter_type = 2;
+ sf->adaptive_pred_interp_filter = 2;
sf->reference_masking = 1;
sf->auto_mv_step_size = 1;
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
- sf->adaptive_pred_filter_type = 2;
+ sf->adaptive_pred_interp_filter = 2;
sf->reference_masking = 1;
sf->auto_mv_step_size = 1;
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
- sf->adaptive_pred_filter_type = 1;
+ sf->adaptive_pred_interp_filter = 1;
sf->auto_mv_step_size = 1;
sf->adaptive_rd_thresh = 2;
sf->recode_loop = 2;
sf->use_rd_breakout = 1;
sf->adaptive_motion_search = 1;
- sf->adaptive_pred_filter_type = 2;
+ sf->adaptive_pred_interp_filter = 2;
sf->auto_mv_step_size = 1;
sf->reference_masking = 1;
sf->tx_size_search_method = USE_FULL_RD;
sf->use_lp32x32fdct = 0;
sf->adaptive_motion_search = 0;
- sf->adaptive_pred_filter_type = 0;
+ sf->adaptive_pred_interp_filter = 0;
sf->reference_masking = 0;
sf->use_one_partition_size_always = 0;
sf->less_rectangular_check = 0;
cpi->cq_target_quality = cpi->oxcf.cq_level;
- cm->mcomp_filter_type = DEFAULT_INTERP_FILTER;
+ cm->interp_filter = DEFAULT_INTERP_FILTER;
cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
&top_index);
if (!frame_is_intra_only(cm)) {
- cm->mcomp_filter_type = DEFAULT_INTERP_FILTER;
+ cm->interp_filter = DEFAULT_INTERP_FILTER;
/* TODO: Decide this more intelligently */
set_high_precision_mv(cpi, (q < HIGH_PRECISION_MV_QTHRESH));
}
// best for 8x8 mode. If set to 0 we always re check all the filters for
// sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter
// was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected.
- int adaptive_pred_filter_type;
+ int adaptive_pred_interp_filter;
// Implements various heuristics to skip searching modes
// The heuristics selected are based on flags
int *rate_y, int64_t *distortion_y,
int *rate_uv, int64_t *distortion_uv,
int *mode_excluded, int *disable_skip,
- INTERPOLATION_TYPE *best_filter,
+ INTERP_FILTER *best_filter,
int_mv (*mode_mv)[MAX_REF_FRAMES],
int mi_row, int mi_col,
int_mv single_newmv[MAX_REF_FRAMES],
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
cpi->rd_filter_cache[i] = INT64_MAX;
- if (cm->mcomp_filter_type != BILINEAR) {
+ if (cm->interp_filter != BILINEAR) {
*best_filter = EIGHTTAP;
if (x->source_variance <
cpi->sf.disable_filter_search_var_thresh) {
cpi->rd_filter_cache[i] = rd;
cpi->rd_filter_cache[SWITCHABLE_FILTERS] =
MIN(cpi->rd_filter_cache[SWITCHABLE_FILTERS], rd + rs_rd);
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
rd += rs_rd;
cpi->mask_filter_rd = MAX(cpi->mask_filter_rd, rd);
} else {
int rate_sum = 0;
int64_t dist_sum = 0;
- if ((cm->mcomp_filter_type == SWITCHABLE &&
+ if ((cm->interp_filter == SWITCHABLE &&
(!i || best_needs_copy)) ||
- (cm->mcomp_filter_type != SWITCHABLE &&
- (cm->mcomp_filter_type == mbmi->interp_filter ||
+ (cm->interp_filter != SWITCHABLE &&
+ (cm->interp_filter == mbmi->interp_filter ||
(i == 0 && intpel_mv)))) {
restore_dst_buf(xd, orig_dst, orig_dst_stride);
} else {
cpi->rd_filter_cache[i] = rd;
cpi->rd_filter_cache[SWITCHABLE_FILTERS] =
MIN(cpi->rd_filter_cache[SWITCHABLE_FILTERS], rd + rs_rd);
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
rd += rs_rd;
cpi->mask_filter_rd = MAX(cpi->mask_filter_rd, rd);
if (newbest) {
best_rd = rd;
*best_filter = mbmi->interp_filter;
- if (cm->mcomp_filter_type == SWITCHABLE && i && !intpel_mv)
+ if (cm->interp_filter == SWITCHABLE && i && !intpel_mv)
best_needs_copy = !best_needs_copy;
}
- if ((cm->mcomp_filter_type == SWITCHABLE && newbest) ||
- (cm->mcomp_filter_type != SWITCHABLE &&
- cm->mcomp_filter_type == mbmi->interp_filter)) {
+ if ((cm->interp_filter == SWITCHABLE && newbest) ||
+ (cm->interp_filter != SWITCHABLE &&
+ cm->interp_filter == mbmi->interp_filter)) {
pred_exists = 1;
}
}
}
}
// Set the appropriate filter
- mbmi->interp_filter = cm->mcomp_filter_type != SWITCHABLE ?
- cm->mcomp_filter_type : *best_filter;
+ mbmi->interp_filter = cm->interp_filter != SWITCHABLE ?
+ cm->interp_filter : *best_filter;
vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
- rs = cm->mcomp_filter_type == SWITCHABLE ? get_switchable_rate(x) : 0;
+ rs = cm->interp_filter == SWITCHABLE ? get_switchable_rate(x) : 0;
if (pred_exists) {
if (best_needs_copy) {
}
}
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
*rate2 += get_switchable_rate(x);
if (!is_comp_pred && cpi->enable_encode_breakout) {
int64_t best_inter_rd = INT64_MAX;
MB_PREDICTION_MODE best_intra_mode = DC_PRED;
MV_REFERENCE_FRAME best_inter_ref_frame = LAST_FRAME;
- INTERPOLATION_TYPE tmp_best_filter = SWITCHABLE;
+ INTERP_FILTER tmp_best_filter = SWITCHABLE;
int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES];
int64_t dist_uv[TX_SIZES];
int skip_uv[TX_SIZES];
// Evaluate all sub-pel filters irrespective of whether we can use
// them for this frame.
- mbmi->interp_filter = cm->mcomp_filter_type;
+ mbmi->interp_filter = cm->interp_filter;
vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
if (comp_pred) {
/* keep record of best filter type */
if (!mode_excluded && !disable_skip && ref_frame != INTRA_FRAME &&
- cm->mcomp_filter_type != BILINEAR) {
- int64_t ref = cpi->rd_filter_cache[cm->mcomp_filter_type == SWITCHABLE ?
- SWITCHABLE_FILTERS : cm->mcomp_filter_type];
+ cm->interp_filter != BILINEAR) {
+ int64_t ref = cpi->rd_filter_cache[cm->interp_filter == SWITCHABLE ?
+ SWITCHABLE_FILTERS : cm->interp_filter];
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) {
int64_t adj_rd;
}
}
- assert((cm->mcomp_filter_type == SWITCHABLE) ||
- (cm->mcomp_filter_type == best_mbmode.interp_filter) ||
+ assert((cm->interp_filter == SWITCHABLE) ||
+ (cm->interp_filter == best_mbmode.interp_filter) ||
!is_inter_block(&best_mbmode));
// Updating rd_thresh_freq_fact[] here means that the different
else
best_filter_diff[i] = best_rd - best_filter_rd[i];
}
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
assert(best_filter_diff[SWITCHABLE_FILTERS] == 0);
} else {
vp9_zero(best_filter_diff);
vp9_prob comp_mode_p;
int64_t best_inter_rd = INT64_MAX;
MV_REFERENCE_FRAME best_inter_ref_frame = LAST_FRAME;
- INTERPOLATION_TYPE tmp_best_filter = SWITCHABLE;
+ INTERP_FILTER tmp_best_filter = SWITCHABLE;
int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES];
int64_t dist_uv[TX_SIZES];
int skip_uv[TX_SIZES];
// Evaluate all sub-pel filters irrespective of whether we can use
// them for this frame.
- mbmi->interp_filter = cm->mcomp_filter_type;
+ mbmi->interp_filter = cm->interp_filter;
vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
if (comp_pred) {
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
cpi->rd_filter_cache[i] = INT64_MAX;
- if (cm->mcomp_filter_type != BILINEAR) {
+ if (cm->interp_filter != BILINEAR) {
tmp_best_filter = EIGHTTAP;
if (x->source_variance <
cpi->sf.disable_filter_search_var_thresh) {
tmp_best_filter = EIGHTTAP;
- } else if (cpi->sf.adaptive_pred_filter_type == 1 &&
- ctx->pred_filter_type < SWITCHABLE) {
- tmp_best_filter = ctx->pred_filter_type;
- } else if (cpi->sf.adaptive_pred_filter_type == 2) {
- tmp_best_filter = ctx->pred_filter_type < SWITCHABLE ?
- ctx->pred_filter_type : 0;
+ } else if (cpi->sf.adaptive_pred_interp_filter == 1 &&
+ ctx->pred_interp_filter < SWITCHABLE) {
+ tmp_best_filter = ctx->pred_interp_filter;
+ } else if (cpi->sf.adaptive_pred_interp_filter == 2) {
+ tmp_best_filter = ctx->pred_interp_filter < SWITCHABLE ?
+ ctx->pred_interp_filter : 0;
} else {
for (switchable_filter_index = 0;
switchable_filter_index < SWITCHABLE_FILTERS;
cpi->rd_filter_cache[SWITCHABLE_FILTERS] =
MIN(cpi->rd_filter_cache[SWITCHABLE_FILTERS],
tmp_rd + rs_rd);
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
tmp_rd += rs_rd;
cpi->mask_filter_rd = MAX(cpi->mask_filter_rd, tmp_rd);
tmp_best_filter = mbmi->interp_filter;
tmp_best_rd = tmp_rd;
}
- if ((newbest && cm->mcomp_filter_type == SWITCHABLE) ||
- (mbmi->interp_filter == cm->mcomp_filter_type &&
- cm->mcomp_filter_type != SWITCHABLE)) {
+ if ((newbest && cm->interp_filter == SWITCHABLE) ||
+ (mbmi->interp_filter == cm->interp_filter &&
+ cm->interp_filter != SWITCHABLE)) {
tmp_best_rdu = tmp_rd;
tmp_best_rate = rate;
tmp_best_ratey = rate_y;
if (tmp_best_rdu == INT64_MAX && pred_exists)
continue;
- mbmi->interp_filter = (cm->mcomp_filter_type == SWITCHABLE ?
- tmp_best_filter : cm->mcomp_filter_type);
+ mbmi->interp_filter = (cm->interp_filter == SWITCHABLE ?
+ tmp_best_filter : cm->interp_filter);
vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
if (!pred_exists) {
// Handles the special case when a filter that is not in the
if (tmp_rd == INT64_MAX)
continue;
} else {
- if (cm->mcomp_filter_type == SWITCHABLE) {
+ if (cm->interp_filter == SWITCHABLE) {
int rs = get_switchable_rate(x);
tmp_best_rdu -= RDCOST(x->rdmult, x->rddiv, rs, 0);
}
rate2 += rate;
distortion2 += distortion;
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
rate2 += get_switchable_rate(x);
if (!mode_excluded)
/* keep record of best filter type */
if (!mode_excluded && !disable_skip && ref_frame != INTRA_FRAME &&
- cm->mcomp_filter_type != BILINEAR) {
- int64_t ref = cpi->rd_filter_cache[cm->mcomp_filter_type == SWITCHABLE ?
- SWITCHABLE_FILTERS : cm->mcomp_filter_type];
+ cm->interp_filter != BILINEAR) {
+ int64_t ref = cpi->rd_filter_cache[cm->interp_filter == SWITCHABLE ?
+ SWITCHABLE_FILTERS : cm->interp_filter];
int64_t adj_rd;
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) {
if (ref == INT64_MAX)
return best_rd;
}
- assert((cm->mcomp_filter_type == SWITCHABLE) ||
- (cm->mcomp_filter_type == best_mbmode.interp_filter) ||
+ assert((cm->interp_filter == SWITCHABLE) ||
+ (cm->interp_filter == best_mbmode.interp_filter) ||
!is_inter_block(&best_mbmode));
// Updating rd_thresh_freq_fact[] here means that the different
else
best_filter_diff[i] = best_rd - best_filter_rd[i];
}
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
assert(best_filter_diff[SWITCHABLE_FILTERS] == 0);
} else {
vp9_zero(best_filter_diff);