};
#if CONFIG_EXT_TX
-const vpx_tree_index vp10_tx_type_tree[TREE_SIZE(TX_TYPES)] = {
- -IDTX, 2,
- -DCT_DCT, 4,
- -DST_DST, 6,
- 8, 18,
- 10, 12,
- -DST_DCT, -DCT_DST,
- 14, 16,
- -ADST_DCT, -DCT_ADST,
- -FLIPADST_DCT, -DCT_FLIPADST,
- 20, 26,
- 22, 24,
- -DST_ADST, -ADST_DST,
- -DST_FLIPADST, -FLIPADST_DST,
- 28, 30,
- -ADST_ADST, -FLIPADST_FLIPADST,
- -ADST_FLIPADST, -FLIPADST_ADST
+const vpx_tree_index vp10_ext_tx_inter_tree[EXT_TX_SETS_INTER]
+ [TREE_SIZE(TX_TYPES)] = {
+ {
+ }, {
+ -IDTX, 2,
+ -DCT_DCT, 4,
+ -DST_DST, 6,
+ 8, 18,
+ 10, 12,
+ -DST_DCT, -DCT_DST,
+ 14, 16,
+ -ADST_DCT, -DCT_ADST,
+ -FLIPADST_DCT, -DCT_FLIPADST,
+ 20, 26,
+ 22, 24,
+ -DST_ADST, -ADST_DST,
+ -DST_FLIPADST, -FLIPADST_DST,
+ 28, 30,
+ -ADST_ADST, -FLIPADST_FLIPADST,
+ -ADST_FLIPADST, -FLIPADST_ADST,
+ }, {
+ -IDTX, 2,
+ -DCT_DCT, 4,
+ 6, 12,
+ 8, 10,
+ -ADST_DCT, -DCT_ADST,
+ -FLIPADST_DCT, -DCT_FLIPADST,
+ 14, 16,
+ -ADST_ADST, -FLIPADST_FLIPADST,
+ -ADST_FLIPADST, -FLIPADST_ADST
+ }, {
+ -IDTX, -DCT_DCT,
+ }
+};
+
+const vpx_tree_index vp10_ext_tx_intra_tree[EXT_TX_SETS_INTRA]
+ [TREE_SIZE(TX_TYPES)] = {
+ {
+ }, {
+ -IDTX, 2,
+ -DCT_DCT, 4,
+ -DST_DST, 6,
+ 8, 18,
+ 10, 12,
+ -DST_DCT, -DCT_DST,
+ 14, 16,
+ -ADST_DCT, -DCT_ADST,
+ -FLIPADST_DCT, -DCT_FLIPADST,
+ 20, 26,
+ 22, 24,
+ -DST_ADST, -ADST_DST,
+ -DST_FLIPADST, -FLIPADST_DST,
+ 28, 30,
+ -ADST_ADST, -FLIPADST_FLIPADST,
+ -ADST_FLIPADST, -FLIPADST_ADST,
+ }
};
static const vpx_prob
-default_inter_tx_type_prob[EXT_TX_SIZES][TX_TYPES - 1] = {
- { 12, 112, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128 },
- { 12, 112, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128 },
- { 12, 112, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
- 128 },
+default_inter_ext_tx_prob[EXT_TX_SETS_INTER][EXT_TX_SIZES][TX_TYPES - 1] = {
+ {
+ // unused
+ }, {
+ { 12, 112, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 12, 112, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+ { 12, 112, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+#if EXT_TX_SIZES == 4
+ { 12, 112, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128 },
+#endif
+ }, {
+ { 12, 112, 128, 128, 128, 128, 128, 128, 128 },
+ { 12, 112, 128, 128, 128, 128, 128, 128, 128 },
+ { 12, 112, 128, 128, 128, 128, 128, 128, 128 },
+#if EXT_TX_SIZES == 4
+ { 12, 112, 128, 128, 128, 128, 128, 128, 128 },
+#endif
+ }, {
+ { 12, },
+ { 12, },
+ { 12, },
+#if EXT_TX_SIZES == 4
+ { 12, },
+#endif
+ }
};
static const vpx_prob
-default_intra_tx_type_prob[EXT_TX_SIZES][INTRA_MODES][TX_TYPES - 1] = {
- {
- { 8, 11, 24, 112, 87, 137, 127, 134,
- 128, 86, 128, 124, 125, 133, 176, 123, },
- { 10, 9, 39, 106, 73, 155, 163, 228,
- 35, 62, 129, 127, 133, 114, 213, 234, },
- { 10, 9, 14, 88, 91, 127, 151, 51,
- 210, 89, 126, 58, 52, 116, 217, 24, },
- { 9, 6, 29, 113, 98, 131, 149, 210,
- 119, 60, 124, 93, 90, 143, 170, 197, },
- { 8, 8, 38, 101, 111, 166, 167, 141,
- 130, 105, 128, 75, 75, 118, 197, 117, },
- { 7, 8, 39, 91, 101, 153, 166, 200,
- 99, 77, 123, 90, 83, 144, 224, 192, },
- { 7, 10, 26, 86, 119, 154, 130, 101,
- 152, 91, 129, 75, 79, 137, 219, 77, },
- { 10, 13, 20, 86, 102, 162, 112, 76,
- 171, 86, 134, 122, 106, 124, 196, 44, },
- { 8, 9, 33, 108, 100, 144, 148, 215,
- 77, 60, 125, 125, 128, 126, 198, 220, },
- { 3, 10, 29, 111, 69, 141, 204, 141,
- 139, 93, 120, 75, 77, 163, 242, 124, },
- },
+default_intra_ext_tx_prob[EXT_TX_SETS_INTRA][EXT_TX_SIZES]
+ [INTRA_MODES][TX_TYPES - 1] = {
+ {
+ // unused
+ }, {
{
- { 2, 53, 18, 147, 96, 98, 136, 133,
- 131, 120, 153, 163, 169, 137, 173, 124, },
- { 4, 18, 34, 133, 54, 130, 179, 228,
- 28, 72, 153, 164, 168, 118, 227, 239, },
- { 4, 18, 13, 125, 72, 110, 176, 36,
- 221, 104, 148, 75, 72, 117, 225, 19, },
- { 8, 33, 24, 162, 113, 99, 147, 226,
- 103, 85, 153, 143, 153, 124, 155, 210, },
- { 2, 15, 35, 107, 127, 158, 192, 128,
- 126, 116, 151, 95, 88, 182, 241, 119, },
- { 3, 15, 36, 112, 100, 146, 194, 189,
- 90, 98, 152, 99, 100, 165, 235, 175, },
- { 3, 16, 29, 109, 103, 140, 182, 76,
- 173, 104, 147, 82, 85, 159, 235, 70, },
- { 9, 24, 14, 120, 86, 156, 161, 34,
- 177, 121, 142, 128, 128, 126, 185, 37, },
- { 5, 24, 29, 152, 98, 99, 174, 228,
- 82, 76, 147, 149, 128, 132, 191, 225, },
- { 2, 15, 29, 111, 77, 126, 200, 135,
- 117, 93, 152, 96, 84, 191, 245, 135, },
- },
- {
- { 2, 69, 13, 173, 111, 69, 137, 159,
- 159, 146, 151, 193, 203, 131, 180, 123, },
- { 1, 12, 33, 164, 32, 98, 204, 242,
- 23, 99, 149, 215, 232, 110, 239, 245, },
- { 1, 17, 9, 136, 82, 83, 171, 28,
- 231, 128, 135, 76, 64, 118, 235, 17, },
- { 4, 41, 17, 195, 131, 58, 161, 237,
- 141, 97, 153, 189, 191, 117, 182, 202, },
- { 2, 17, 36, 104, 149, 137, 217, 139,
- 191, 119, 125, 107, 115, 223, 249, 110, },
- { 2, 14, 24, 127, 91, 135, 219, 198,
- 113, 91, 164, 125, 173, 211, 250, 116, },
- { 3, 19, 24, 120, 102, 130, 209, 81,
- 187, 95, 143, 102, 50, 190, 244, 56, },
- { 4, 27, 10, 128, 91, 157, 181, 33,
- 181, 150, 141, 141, 166, 114, 215, 25, },
- { 2, 34, 27, 187, 102, 77, 210, 245,
- 113, 107, 136, 184, 188, 121, 210, 234, },
- { 1, 15, 22, 141, 59, 94, 208, 133,
- 154, 95, 152, 112, 105, 191, 242, 111, },
+ { 8, 11, 24, 112, 87, 137, 127, 134,
+ 128, 86, 128, 124, 125, 133, 176, 123, },
+ { 10, 9, 39, 106, 73, 155, 163, 228,
+ 35, 62, 129, 127, 133, 114, 213, 234, },
+ { 10, 9, 14, 88, 91, 127, 151, 51,
+ 210, 89, 126, 58, 52, 116, 217, 24, },
+ { 9, 6, 29, 113, 98, 131, 149, 210,
+ 119, 60, 124, 93, 90, 143, 170, 197, },
+ { 8, 8, 38, 101, 111, 166, 167, 141,
+ 130, 105, 128, 75, 75, 118, 197, 117, },
+ { 7, 8, 39, 91, 101, 153, 166, 200,
+ 99, 77, 123, 90, 83, 144, 224, 192, },
+ { 7, 10, 26, 86, 119, 154, 130, 101,
+ 152, 91, 129, 75, 79, 137, 219, 77, },
+ { 10, 13, 20, 86, 102, 162, 112, 76,
+ 171, 86, 134, 122, 106, 124, 196, 44, },
+ { 8, 9, 33, 108, 100, 144, 148, 215,
+ 77, 60, 125, 125, 128, 126, 198, 220, },
+ { 3, 10, 29, 111, 69, 141, 204, 141,
+ 139, 93, 120, 75, 77, 163, 242, 124, },
+ }, {
+ { 2, 53, 18, 147, 96, 98, 136, 133,
+ 131, 120, 153, 163, 169, 137, 173, 124, },
+ { 4, 18, 34, 133, 54, 130, 179, 228,
+ 28, 72, 153, 164, 168, 118, 227, 239, },
+ { 4, 18, 13, 125, 72, 110, 176, 36,
+ 221, 104, 148, 75, 72, 117, 225, 19, },
+ { 8, 33, 24, 162, 113, 99, 147, 226,
+ 103, 85, 153, 143, 153, 124, 155, 210, },
+ { 2, 15, 35, 107, 127, 158, 192, 128,
+ 126, 116, 151, 95, 88, 182, 241, 119, },
+ { 3, 15, 36, 112, 100, 146, 194, 189,
+ 90, 98, 152, 99, 100, 165, 235, 175, },
+ { 3, 16, 29, 109, 103, 140, 182, 76,
+ 173, 104, 147, 82, 85, 159, 235, 70, },
+ { 9, 24, 14, 120, 86, 156, 161, 34,
+ 177, 121, 142, 128, 128, 126, 185, 37, },
+ { 5, 24, 29, 152, 98, 99, 174, 228,
+ 82, 76, 147, 149, 128, 132, 191, 225, },
+ { 2, 15, 29, 111, 77, 126, 200, 135,
+ 117, 93, 152, 96, 84, 191, 245, 135, },
+ }, {
+ { 2, 69, 13, 173, 111, 69, 137, 159,
+ 159, 146, 151, 193, 203, 131, 180, 123, },
+ { 1, 12, 33, 164, 32, 98, 204, 242,
+ 23, 99, 149, 215, 232, 110, 239, 245, },
+ { 1, 17, 9, 136, 82, 83, 171, 28,
+ 231, 128, 135, 76, 64, 118, 235, 17, },
+ { 4, 41, 17, 195, 131, 58, 161, 237,
+ 141, 97, 153, 189, 191, 117, 182, 202, },
+ { 2, 17, 36, 104, 149, 137, 217, 139,
+ 191, 119, 125, 107, 115, 223, 249, 110, },
+ { 2, 14, 24, 127, 91, 135, 219, 198,
+ 113, 91, 164, 125, 173, 211, 250, 116, },
+ { 3, 19, 24, 120, 102, 130, 209, 81,
+ 187, 95, 143, 102, 50, 190, 244, 56, },
+ { 4, 27, 10, 128, 91, 157, 181, 33,
+ 181, 150, 141, 141, 166, 114, 215, 25, },
+ { 2, 34, 27, 187, 102, 77, 210, 245,
+ 113, 107, 136, 184, 188, 121, 210, 234, },
+ { 1, 15, 22, 141, 59, 94, 208, 133,
+ 154, 95, 152, 112, 105, 191, 242, 111, },
+#if EXT_TX_SIZES == 4
+ }, {
+ { 2, 69, 13, 173, 111, 69, 137, 159,
+ 159, 146, 151, 193, 203, 131, 180, 123, },
+ { 1, 12, 33, 164, 32, 98, 204, 242,
+ 23, 99, 149, 215, 232, 110, 239, 245, },
+ { 1, 17, 9, 136, 82, 83, 171, 28,
+ 231, 128, 135, 76, 64, 118, 235, 17, },
+ { 4, 41, 17, 195, 131, 58, 161, 237,
+ 141, 97, 153, 189, 191, 117, 182, 202, },
+ { 2, 17, 36, 104, 149, 137, 217, 139,
+ 191, 119, 125, 107, 115, 223, 249, 110, },
+ { 2, 14, 24, 127, 91, 135, 219, 198,
+ 113, 91, 164, 125, 173, 211, 250, 116, },
+ { 3, 19, 24, 120, 102, 130, 209, 81,
+ 187, 95, 143, 102, 50, 190, 244, 56, },
+ { 4, 27, 10, 128, 91, 157, 181, 33,
+ 181, 150, 141, 141, 166, 114, 215, 25, },
+ { 2, 34, 27, 187, 102, 77, 210, 245,
+ 113, 107, 136, 184, 188, 121, 210, 234, },
+ { 1, 15, 22, 141, 59, 94, 208, 133,
+ 154, 95, 152, 112, 105, 191, 242, 111, },
+#endif
},
+ }
};
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
vp10_copy(fc->skip_probs, default_skip_probs);
vp10_copy(fc->inter_mode_probs, default_inter_mode_probs);
#if CONFIG_EXT_TX
- vp10_copy(fc->inter_tx_type_prob, default_inter_tx_type_prob);
- vp10_copy(fc->intra_tx_type_prob, default_intra_tx_type_prob);
+ vp10_copy(fc->inter_ext_tx_prob, default_inter_ext_tx_prob);
+ vp10_copy(fc->intra_ext_tx_prob, default_intra_ext_tx_prob);
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
vp10_copy(fc->seg.tree_probs, default_seg_probs.tree_probs);
}
const vpx_tree_index vp10_switchable_interp_tree
- [TREE_SIZE(SWITCHABLE_FILTERS)] = {
+[TREE_SIZE(SWITCHABLE_FILTERS)] = {
-EIGHTTAP, 2,
-EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP
};
pre_fc->skip_probs[i], counts->skip[i]);
#if CONFIG_EXT_TX
- for (i = TX_4X4; i <= TX_16X16; ++i) {
- int j;
- vpx_tree_merge_probs(vp10_tx_type_tree, pre_fc->inter_tx_type_prob[i],
- counts->inter_tx_type[i], fc->inter_tx_type_prob[i]);
-
- for (j = 0; j < INTRA_MODES; ++j)
- vpx_tree_merge_probs(vp10_tx_type_tree, pre_fc->intra_tx_type_prob[i][j],
- counts->intra_tx_type[i][j],
- fc->intra_tx_type_prob[i][j]);
+ for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
+ int s;
+ for (s = 1; s < EXT_TX_SETS_INTER; ++s) {
+ if (use_inter_ext_tx_for_tx[s][i]) {
+ vpx_tree_merge_probs(vp10_ext_tx_inter_tree[s],
+ pre_fc->inter_ext_tx_prob[s][i],
+ counts->inter_ext_tx[s][i],
+ fc->inter_ext_tx_prob[s][i]);
+ }
+ }
+ for (s = 1; s < EXT_TX_SETS_INTRA; ++s) {
+ if (use_intra_ext_tx_for_tx[s][i]) {
+ int j;
+ for (j = 0; j < INTRA_MODES; ++j)
+ vpx_tree_merge_probs(vp10_ext_tx_intra_tree[s],
+ pre_fc->intra_ext_tx_prob[s][i][j],
+ counts->intra_ext_tx[s][i][j],
+ fc->intra_ext_tx_prob[s][i][j]);
+ }
+ }
}
#endif // CONFIG_EXT_TX
#if CONFIG_MISC_FIXES
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
#if CONFIG_EXT_TX
- int tx_type, best_tx_type = DCT_DCT;
+ TX_TYPE tx_type, best_tx_type = DCT_DCT;
int r, s;
int64_t d, psse, this_rd, best_rd = INT64_MAX;
vpx_prob skip_prob = vp10_get_skip_prob(cm, xd);
int s0 = vp10_cost_bit(skip_prob, 0);
int s1 = vp10_cost_bit(skip_prob, 1);
+ int ext_tx_set;
+ const int is_inter = is_inter_block(mbmi);
#endif // CONFIG_EXT_TX
mbmi->tx_size = VPXMIN(max_tx_size, largest_tx_size);
+
#if CONFIG_EXT_TX
- if (is_inter_block(mbmi) && bs >= BLOCK_8X8 &&
+ ext_tx_set = get_ext_tx_set(mbmi->tx_size, bs, is_inter);
+
+ if (is_inter &&
+ get_ext_tx_types(mbmi->tx_size, bs, is_inter) > 1 &&
!xd->lossless[mbmi->segment_id]) {
- for (tx_type = DCT_DCT; tx_type < TX_TYPES - 1; ++tx_type) {
- if (mbmi->tx_type >= DST_ADST && mbmi->tx_type < IDTX &&
+ for (tx_type = 0; tx_type < TX_TYPES; ++tx_type) {
+ if (is_inter) {
+ if (!ext_tx_used_inter[ext_tx_set][tx_type])
+ continue;
+ } else {
+ if (!ext_tx_used_intra[ext_tx_set][tx_type])
+ continue;
+ }
+
+ mbmi->tx_type = tx_type;
+ if (ext_tx_set == 1 &&
+ mbmi->tx_type >= DST_ADST && mbmi->tx_type < IDTX &&
best_tx_type == DCT_DCT) {
tx_type = IDTX - 1;
continue;
}
- if (tx_type >= GET_TX_TYPES(mbmi->tx_size))
- continue;
- mbmi->tx_type = tx_type;
txfm_rd_in_plane(x,
#if CONFIG_VAR_TX
cpi,
if (r == INT_MAX)
continue;
- if (mbmi->tx_size <= TX_16X16) {
- if (is_inter_block(mbmi))
- r += cpi->inter_tx_type_costs[mbmi->tx_size][mbmi->tx_type];
- else
- r += cpi->intra_tx_type_costs[mbmi->tx_size]
- [mbmi->mode][mbmi->tx_type];
+ if (get_ext_tx_types(mbmi->tx_size, bs, is_inter) > 1) {
+ if (is_inter) {
+ if (ext_tx_set > 0)
+ r += cpi->inter_tx_type_costs[ext_tx_set]
+ [mbmi->tx_size][mbmi->tx_type];
+ } else {
+ if (ext_tx_set > 0)
+ r += cpi->intra_tx_type_costs[ext_tx_set][mbmi->tx_size]
+ [mbmi->mode][mbmi->tx_type];
+ }
}
if (s)
mbmi->tx_size, cpi->sf.use_fast_coef_costing);
#if CONFIG_EXT_TX
- if (bs >= BLOCK_8X8 && mbmi->tx_size <= TX_16X16 &&
+ if (get_ext_tx_types(mbmi->tx_size, bs, is_inter) > 1 &&
!xd->lossless[mbmi->segment_id] && *rate != INT_MAX) {
- if (is_inter_block(mbmi))
- *rate += cpi->inter_tx_type_costs[mbmi->tx_size][mbmi->tx_type];
+ int ext_tx_set = get_ext_tx_set(mbmi->tx_size, bs, is_inter);
+ if (is_inter)
+ *rate += cpi->inter_tx_type_costs[ext_tx_set][mbmi->tx_size]
+ [mbmi->tx_type];
else
- *rate += cpi->intra_tx_type_costs[mbmi->tx_size]
- [mbmi->mode][mbmi->tx_type];
+ *rate += cpi->intra_tx_type_costs[ext_tx_set][mbmi->tx_size]
+ [mbmi->mode][mbmi->tx_type];
}
#endif // CONFIG_EXT_TX
}
int start_tx, end_tx;
const int tx_select = cm->tx_mode == TX_MODE_SELECT;
#if CONFIG_EXT_TX
- int tx_type, best_tx_type = DCT_DCT;
- int start_tx_type, end_tx_type;
+ TX_TYPE tx_type, best_tx_type = DCT_DCT;
+ int ext_tx_set;
#endif // CONFIG_EXT_TX
+ const int is_inter = is_inter_block(mbmi);
const vpx_prob *tx_probs = get_tx_probs2(max_tx_size, xd, &cm->fc->tx_probs);
assert(skip_prob > 0);
start_tx = max_tx_size;
end_tx = 0;
} else {
- const TX_SIZE chosen_tx_size = VPXMIN(max_tx_size,
- tx_mode_to_biggest_tx_size[cm->tx_mode]);
+ const TX_SIZE chosen_tx_size =
+ VPXMIN(max_tx_size, tx_mode_to_biggest_tx_size[cm->tx_mode]);
start_tx = chosen_tx_size;
end_tx = chosen_tx_size;
}
*psse = INT64_MAX;
#if CONFIG_EXT_TX
- start_tx_type = DCT_DCT;
- if (bs >= BLOCK_8X8 && !xd->lossless[mbmi->segment_id])
- end_tx_type = TX_TYPES - 1;
- else
- end_tx_type = DCT_DCT;
-
- for (tx_type = start_tx_type; tx_type <= end_tx_type; ++tx_type) {
- mbmi->tx_type = tx_type;
- // TODO(huisu): clean up the logic.
- if (mbmi->tx_type >= DST_ADST && mbmi->tx_type < IDTX &&
- best_tx_type == DCT_DCT) {
- tx_type = IDTX - 1;
- continue;
- }
+ for (tx_type = DCT_DCT; tx_type < TX_TYPES; ++tx_type) {
#endif // CONFIG_EXT_TX
+ last_rd = INT64_MAX;
for (n = start_tx; n >= end_tx; --n) {
int r_tx_size = 0;
-
-#if CONFIG_EXT_TX
- if (mbmi->tx_type >= GET_TX_TYPES(n))
- continue;
-#endif // CONFIG_EXT_TX
-
for (m = 0; m <= n - (n == (int) max_tx_size); ++m) {
if (m == n)
r_tx_size += vp10_cost_zero(tx_probs[m]);
r_tx_size += vp10_cost_one(tx_probs[m]);
}
+#if CONFIG_EXT_TX
+ ext_tx_set = get_ext_tx_set(n, bs, is_inter);
+ if (is_inter) {
+ if (!ext_tx_used_inter[ext_tx_set][tx_type])
+ continue;
+ } else {
+ if (!ext_tx_used_intra[ext_tx_set][tx_type])
+ continue;
+ }
+ mbmi->tx_type = tx_type;
+ if (ext_tx_set == 1 &&
+ mbmi->tx_type >= DST_ADST && mbmi->tx_type < IDTX &&
+ best_tx_type == DCT_DCT) {
+ tx_type = IDTX - 1;
+ break;
+ }
txfm_rd_in_plane(x,
#if CONFIG_VAR_TX
cpi,
&r, &d, &s,
&sse, ref_best_rd, 0, bs, n,
cpi->sf.use_fast_coef_costing);
-#if CONFIG_EXT_TX
- if (bs >= BLOCK_8X8 && !xd->lossless[mbmi->segment_id] &&
- r != INT_MAX && n < TX_32X32) {
- if (is_inter_block(mbmi))
- r += cpi->inter_tx_type_costs[n][mbmi->tx_type];
- else
- r += cpi->intra_tx_type_costs[n][mbmi->mode][mbmi->tx_type];
+ if (get_ext_tx_types(n, bs, is_inter) > 1 &&
+ !xd->lossless[xd->mi[0]->mbmi.segment_id] &&
+ r != INT_MAX) {
+ if (is_inter) {
+ if (ext_tx_set > 0)
+ r += cpi->inter_tx_type_costs[ext_tx_set]
+ [mbmi->tx_size][mbmi->tx_type];
+ } else {
+ if (ext_tx_set > 0)
+ r += cpi->intra_tx_type_costs[ext_tx_set][mbmi->tx_size]
+ [mbmi->mode][mbmi->tx_type];
+ }
}
+#else // CONFIG_EXT_TX
+ txfm_rd_in_plane(x,
+#if CONFIG_VAR_TX
+ cpi,
+#endif
+ &r, &d, &s,
+ &sse, ref_best_rd, 0, bs, n,
+ cpi->sf.use_fast_coef_costing);
#endif // CONFIG_EXT_TX
if (r == INT_MAX)
continue;
- if (tx_select)
- r += r_tx_size;
-
if (s) {
- if (is_inter_block(mbmi)) {
+ if (is_inter) {
rd = RDCOST(x->rdmult, x->rddiv, s1, sse);
- if (tx_select)
- r -= r_tx_size;
} else {
rd = RDCOST(x->rdmult, x->rddiv, s1 + r_tx_size * tx_select, sse);
}
} else {
- rd = RDCOST(x->rdmult, x->rddiv, r + s0, d);
+ rd = RDCOST(x->rdmult, x->rddiv, r + s0 + r_tx_size * tx_select, d);
}
- if (is_inter_block(mbmi) && !xd->lossless[mbmi->segment_id] && !s)
+ if (tx_select && !(s && is_inter))
+ r += r_tx_size;
+
+ if (is_inter && !xd->lossless[xd->mi[0]->mbmi.segment_id] && !s)
rd = VPXMIN(rd, RDCOST(x->rdmult, x->rddiv, s1, sse));
// Early termination in transform size search.
- if (0 && cpi->sf.tx_size_search_breakout &&
- (rd== INT64_MAX ||
- (n < (int) max_tx_size && rd > last_rd) ||
- s == 1))
+ if (cpi->sf.tx_size_search_breakout &&
+ (rd == INT64_MAX ||
+#if CONFIG_EXT_TX
+ (s == 1 && tx_type != DCT_DCT) ||
+#else
+ (s == 1) ||
+#endif
+ (n < (int) max_tx_size && rd > last_rd)))
break;
last_rd = rd;
-#if CONFIG_EXT_TX
if (rd <
- (is_inter_block(mbmi) && best_tx_type == DCT_DCT ? ext_tx_th : 1) *
- best_rd) {
-#else
- if (rd < best_rd) {
+#if CONFIG_EXT_TX
+ (is_inter && best_tx_type == DCT_DCT ? ext_tx_th : 1) *
#endif // CONFIG_EXT_TX
+ best_rd) {
best_tx = n;
best_rd = rd;
*distortion = d;
// one of the neighboring directional modes
if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_DIRMISMATCH) {
if (conditional_skipintra(mode, *best_mode))
- continue;
+ continue;
}
memcpy(tempa, ta, sizeof(ta));
const uint8_t *const src = &src_init[idx * 4 + idy * 4 * src_stride];
uint8_t *const dst = &dst_init[idx * 4 + idy * 4 * dst_stride];
int16_t *const src_diff = vp10_raster_block_offset_int16(BLOCK_8X8,
- block,
- p->src_diff);
+ block,
+ p->src_diff);
tran_low_t *const coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
xd->mi[0]->bmi[block].as_mode = mode;
vp10_predict_intra_block(xd, 1, 1, TX_4X4, mode, dst, dst_stride,
num_4x4_blocks_wide * 4 * sizeof(uint16_t));
}
}
- next_highbd:
+next_highbd:
{}
}
if (best_rd >= rd_thresh)
// one of the neighboring directional modes
if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_DIRMISMATCH) {
if (conditional_skipintra(mode, *best_mode))
- continue;
+ continue;
}
memcpy(tempa, ta, sizeof(ta));