Merge "Renaming INTERPOLATION_TYPE to INTERP_FILTER."
This commit is contained in:
Коммит
f9f936b82f
|
@ -135,7 +135,7 @@ typedef struct {
|
|||
// 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;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
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;
|
||||
|
@ -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,
|
||||
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;
|
||||
|
@ -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,
|
||||
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);
|
||||
|
@ -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,
|
||||
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);
|
||||
|
@ -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,
|
||||
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.
|
||||
|
@ -138,14 +138,14 @@ static void convolve(const uint8_t *src, ptrdiff_t src_stride,
|
|||
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,
|
||||
|
@ -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_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,
|
||||
|
@ -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_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,
|
||||
|
@ -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_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);
|
||||
|
@ -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_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);
|
||||
|
@ -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_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,
|
||||
|
|
|
@ -385,7 +385,7 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
|
|||
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]);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#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 },
|
||||
|
@ -35,7 +35,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
|
|||
};
|
||||
|
||||
// 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},
|
||||
|
@ -56,7 +56,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
|
|||
};
|
||||
|
||||
// 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},
|
||||
|
@ -77,7 +77,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
|
|||
};
|
||||
|
||||
// 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},
|
||||
|
@ -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_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];
|
||||
}
|
||||
|
||||
|
|
|
@ -31,21 +31,21 @@ typedef enum {
|
|||
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.
|
||||
|
|
|
@ -184,7 +184,7 @@ typedef struct VP9Common {
|
|||
// 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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
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,
|
||||
|
@ -1186,7 +1185,7 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi,
|
|||
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];
|
||||
|
@ -1256,7 +1255,7 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
|
|||
|
||||
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++)
|
||||
|
|
|
@ -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) {
|
||||
const int ctx = vp9_get_pred_context_switchable_interp(xd);
|
||||
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,
|
|||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
@ -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);
|
||||
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) {
|
||||
|
@ -910,17 +910,17 @@ static void encode_txfm_probs(VP9_COMP *cpi, vp9_writer *w) {
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -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
|
||||
for (i = 0; i < SWITCHABLE_FILTERS; ++i) {
|
||||
if (count[i]) {
|
||||
cm->mcomp_filter_type = i;
|
||||
cm->interp_filter = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1162,8 +1162,8 @@ static void write_uncompressed_header(VP9_COMP *cpi,
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
|
|||
|
||||
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++)
|
||||
|
|
|
@ -62,7 +62,7 @@ typedef struct {
|
|||
// 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;
|
||||
|
|
|
@ -505,7 +505,7 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
|||
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];
|
||||
}
|
||||
|
@ -1788,9 +1788,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
|||
*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);
|
||||
|
@ -1839,9 +1839,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
|||
*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);
|
||||
|
@ -1854,9 +1854,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
|||
*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),
|
||||
|
@ -1892,9 +1892,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
|||
*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);
|
||||
|
@ -1906,9 +1906,9 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
|
|||
*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),
|
||||
|
@ -2048,7 +2048,7 @@ static void encode_sb_row(VP9_COMP *cpi, const TileInfo *const tile,
|
|||
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);
|
||||
|
@ -2460,7 +2460,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
|
|||
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
|
||||
|
@ -2496,14 +2496,14 @@ void vp9_encode_frame(VP9_COMP *cpi) {
|
|||
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;
|
||||
|
@ -2511,7 +2511,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
|
|||
/* 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) {
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
#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;
|
||||
|
@ -39,8 +38,7 @@ void vp9_setup_interp_filters(MACROBLOCKD *xd,
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -48,8 +48,7 @@ void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE bsize);
|
|||
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"
|
||||
|
|
|
@ -593,7 +593,7 @@ static void set_good_speed_feature(VP9_COMMON *cm,
|
|||
|
||||
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;
|
||||
|
@ -619,7 +619,7 @@ static void set_good_speed_feature(VP9_COMMON *cm,
|
|||
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;
|
||||
|
||||
|
@ -656,7 +656,7 @@ static void set_good_speed_feature(VP9_COMMON *cm,
|
|||
|
||||
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;
|
||||
|
||||
|
@ -691,7 +691,7 @@ static void set_good_speed_feature(VP9_COMMON *cm,
|
|||
|
||||
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;
|
||||
|
||||
|
@ -764,7 +764,7 @@ static void set_rt_speed_feature(VP9_COMMON *cm,
|
|||
|
||||
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;
|
||||
|
@ -790,7 +790,7 @@ static void set_rt_speed_feature(VP9_COMMON *cm,
|
|||
|
||||
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;
|
||||
|
||||
|
@ -877,7 +877,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
|
|||
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;
|
||||
|
@ -1332,7 +1332,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
|
|||
|
||||
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;
|
||||
|
||||
|
@ -3094,7 +3094,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
|
|||
&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));
|
||||
}
|
||||
|
|
|
@ -379,7 +379,7 @@ typedef struct {
|
|||
// 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
|
||||
|
|
|
@ -2626,7 +2626,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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],
|
||||
|
@ -2769,7 +2769,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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) {
|
||||
|
@ -2792,16 +2792,16 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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 {
|
||||
|
@ -2817,7 +2817,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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);
|
||||
|
||||
|
@ -2838,13 +2838,13 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -2852,10 +2852,10 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
}
|
||||
}
|
||||
// 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) {
|
||||
|
@ -2884,7 +2884,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
}
|
||||
}
|
||||
|
||||
if (cm->mcomp_filter_type == SWITCHABLE)
|
||||
if (cm->interp_filter == SWITCHABLE)
|
||||
*rate2 += get_switchable_rate(x);
|
||||
|
||||
if (!is_comp_pred && cpi->enable_encode_breakout) {
|
||||
|
@ -3129,7 +3129,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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];
|
||||
|
@ -3282,7 +3282,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
|
||||
// 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) {
|
||||
|
@ -3573,9 +3573,9 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
|
||||
/* 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;
|
||||
|
@ -3649,8 +3649,8 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -3692,7 +3692,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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);
|
||||
|
@ -3754,7 +3754,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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];
|
||||
|
@ -3907,7 +3907,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
|
||||
// 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) {
|
||||
|
@ -4013,17 +4013,17 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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;
|
||||
|
@ -4051,7 +4051,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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);
|
||||
|
@ -4061,9 +4061,9 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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;
|
||||
|
@ -4095,8 +4095,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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
|
||||
|
@ -4113,7 +4113,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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);
|
||||
}
|
||||
|
@ -4131,7 +4131,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
rate2 += rate;
|
||||
distortion2 += distortion;
|
||||
|
||||
if (cm->mcomp_filter_type == SWITCHABLE)
|
||||
if (cm->interp_filter == SWITCHABLE)
|
||||
rate2 += get_switchable_rate(x);
|
||||
|
||||
if (!mode_excluded)
|
||||
|
@ -4299,9 +4299,9 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
|
||||
/* 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)
|
||||
|
@ -4372,8 +4372,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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
|
||||
|
@ -4425,7 +4425,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
|
|||
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче