ref: 5cfd82bcaf666c1b9cacd8a4899fc703598aa5b0
parent: aac73df1a7b2e84e1930fa63ac6d7983cfdba543
author: Ronald S. Bultje <rbultje@google.com>
date: Wed Feb 6 09:13:05 EST 2013
Use fdct8x4 instead of fdct4x4 where the block size allows it. This allows for faster SIMD implementations in the future (currently there is no speed impact). Change-Id: I732647e9148b5dcb44e6bc8728138f0141218329
--- a/vp9/encoder/vp9_encodeintra.c
+++ b/vp9/encoder/vp9_encodeintra.c
@@ -168,6 +168,12 @@
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);
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -187,6 +187,10 @@
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);
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1459,6 +1459,7 @@
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);
@@ -1465,15 +1466,26 @@
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];
--
⑨