#endif // CONFIG_EXT_INTER
#if CONFIG_DUAL_FILTER
- for (ref = 0; ref < 4; ++ref) {
- const int frame_idx = (ref >> 1);
+ for (ref = 0; ref < 2; ++ref) {
mbmi->interp_filter[ref] = (cm->interp_filter == SWITCHABLE) ?
EIGHTTAP_REGULAR : cm->interp_filter;
- if (mbmi->ref_frame[frame_idx] > INTRA_FRAME &&
- has_subpel_mv_component(xd, ref))
+ if (has_subpel_mv_component(xd, ref) ||
+ (mbmi->ref_frame[1] > INTRA_FRAME &&
+ has_subpel_mv_component(xd, ref + 2)))
mbmi->interp_filter[ref] = read_interp_filter(cm, xd, ref, r);
}
+ // The index system worsk as:
+ // (0, 1) -> (vertical, horizontal) filter types for the first ref frame.
+ // (2, 3) -> (vertical, horizontal) filter types for the second ref frame.
+ mbmi->interp_filter[2] = mbmi->interp_filter[0];
+ mbmi->interp_filter[3] = mbmi->interp_filter[1];
#else
#if CONFIG_EXT_INTERP
mbmi->interp_filter = read_interp_filter(cm, xd, r);
#endif // CONFIG_DUAL_FILTER
#endif // CONFIG_EXT_INTERP
#if CONFIG_DUAL_FILTER
- for (dir = 0; dir < 4; ++dir) {
- const int frame_idx = (dir >> 1);
- if (mbmi->ref_frame[frame_idx] > INTRA_FRAME &&
- has_subpel_mv_component(xd, dir)) {
+ for (dir = 0; dir < 2; ++dir) {
+ if (has_subpel_mv_component(xd, dir) ||
+ (mbmi->ref_frame[1] > INTRA_FRAME &&
+ has_subpel_mv_component(xd, dir + 2))) {
const int ctx = vp10_get_pred_context_switchable_interp(xd, dir);
vp10_write_token(w, vp10_switchable_interp_tree,
cm->fc->switchable_interp_prob[ctx],
static void reset_intmv_filter_type(VP10_COMMON *cm,
MACROBLOCKD *xd, MB_MODE_INFO *mbmi) {
int dir;
- for (dir = 0; dir < 4; ++dir) {
- const int frame_idx = (dir >> 1);
- if (mbmi->ref_frame[frame_idx] > INTRA_FRAME &&
- !has_subpel_mv_component(xd, dir))
+ for (dir = 0; dir < 2; ++dir) {
+ if (!has_subpel_mv_component(xd, dir) &&
+ (mbmi->ref_frame[1] == NONE ||
+ !has_subpel_mv_component(xd, dir + 2)))
mbmi->interp_filter[dir] = (cm->interp_filter == SWITCHABLE) ?
EIGHTTAP_REGULAR : cm->interp_filter;
+ mbmi->interp_filter[dir + 2] = mbmi->interp_filter[dir];
}
}
const MACROBLOCKD *xd,
const MB_MODE_INFO *mbmi) {
int dir;
- for (dir = 0; dir < 4; ++dir) {
- const int frame_idx = (dir >> 1);
- if (mbmi->ref_frame[frame_idx] > INTRA_FRAME &&
- has_subpel_mv_component(xd, dir)) {
+ for (dir = 0; dir < 2; ++dir) {
+ if (has_subpel_mv_component(xd, dir) ||
+ (mbmi->ref_frame[1] > INTRA_FRAME &&
+ has_subpel_mv_component(xd, dir + 2))) {
const int ctx = vp10_get_pred_context_switchable_interp(xd, dir);
++counts->switchable_interp[ctx][mbmi->interp_filter[dir]];
}
int inter_filter_cost = 0;
int dir;
- for (dir = 0; dir < 4; ++dir) {
- const int frame_idx = (dir >> 1);
- if (mbmi->ref_frame[frame_idx] > INTRA_FRAME &&
- has_subpel_mv_component(xd, dir)) {
+ for (dir = 0; dir < 2; ++dir) {
+ if (has_subpel_mv_component(xd, dir) ||
+ (mbmi->ref_frame[1] > INTRA_FRAME &&
+ has_subpel_mv_component(xd, dir + 2))) {
const int ctx = vp10_get_pred_context_switchable_interp(xd, dir);
inter_filter_cost +=
cpi->switchable_interp_costs[ctx][mbmi->interp_filter[dir]];
if (cm->interp_filter != BILINEAR) {
#if CONFIG_DUAL_FILTER
tmp_best_filter[0] = EIGHTTAP_REGULAR;
+ tmp_best_filter[1] = EIGHTTAP_REGULAR;
+ tmp_best_filter[2] = EIGHTTAP_REGULAR;
+ tmp_best_filter[3] = EIGHTTAP_REGULAR;
#else
tmp_best_filter = EIGHTTAP_REGULAR;
#endif