vp9_fht_c(be->src_diff, 32, be->coeff, tx_type, 4);
vp9_ht_quantize_b_4x4(be, b, tx_type);
vp9_ihtllm(b->dqcoeff, b->diff, 32, tx_type, 4, b->eob);
+ } else if (!(i & 1) && get_tx_type_4x4(xd, b + 1) == DCT_DCT) {
+ x->vp9_short_fdct8x4(be->src_diff, be->coeff, 32);
+ x->quantize_b_4x4_pair(be, be + 1, b, b + 1);
+ vp9_inverse_transform_b_4x4(xd, ib + iblock[i], 32);
+ vp9_inverse_transform_b_4x4(xd, ib + iblock[i] + 1, 32);
+ i++;
} else {
x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4(be, b);
if (tx_type != DCT_DCT) {
assert(has_2nd_order == 0);
vp9_fht_c(b->src_diff, 32, b->coeff, tx_type, 4);
+ } else if (!(i & 1) && get_tx_type_4x4(xd, &xd->block[i + 1]) == DCT_DCT) {
+ x->vp9_short_fdct8x4(&x->block[i].src_diff[0],
+ &x->block[i].coeff[0], 32);
+ i++;
} else {
x->vp9_short_fdct4x4(&x->block[i].src_diff[0],
&x->block[i].coeff[0], 32);
distortion = 0;
rate_t = 0;
for (i = 0; i < 4; ++i) {
+ int do_two = 0;
b = &xd->block[ib + iblock[i]];
be = &x->block[ib + iblock[i]];
tx_type = get_tx_type_4x4(xd, b);
if (tx_type != DCT_DCT) {
vp9_fht_c(be->src_diff, 32, be->coeff, tx_type, 4);
vp9_ht_quantize_b_4x4(be, b, tx_type);
+ } else if (!(i & 1) && get_tx_type_4x4(xd, b + 1) == DCT_DCT) {
+ x->vp9_short_fdct8x4(be->src_diff, be->coeff, 32);
+ x->quantize_b_4x4_pair(be, be + 1, b, b + 1);
+ do_two = 1;
} else {
x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4(be, b);
}
- distortion += vp9_block_error_c(be->coeff, b->dqcoeff, 16);
+ distortion += vp9_block_error_c(be->coeff, b->dqcoeff, 16 << do_two);
rate_t += cost_coeffs(x, b, PLANE_TYPE_Y_WITH_DC,
// i&1 ? &ta1 : &ta0, i&2 ? &tl1 : &tl0,
&ta0, &tl0,
TX_4X4);
+ if (do_two) {
+ rate_t += cost_coeffs(x, b + 1, PLANE_TYPE_Y_WITH_DC,
+ // i&1 ? &ta1 : &ta0, i&2 ? &tl1 : &tl0,
+ &ta0, &tl0,
+ TX_4X4);
+ i++;
+ }
}
b = &xd->block[ib];
be = &x->block[ib];