Mercurial > libavcodec.hg
changeset 2263:258f21820108 libavcodec
porting optimizations from 4x4 dct to 8x8
author | michael |
---|---|
date | Sun, 26 Sep 2004 17:36:53 +0000 |
parents | 7a1c3178d759 |
children | d7fdb7be7df4 |
files | jrevdct.c |
diffstat | 1 files changed, 2 insertions(+), 262 deletions(-) [+] |
line wrap: on
line diff
--- a/jrevdct.c Sun Sep 26 16:33:39 2004 +0000 +++ b/jrevdct.c Sun Sep 26 17:36:53 2004 +0000 @@ -235,9 +235,7 @@ /* The rotator is sqrt(2)*c(-6). */ { if (d6) { - if (d4) { if (d2) { - if (d0) { /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */ z1 = MULTIPLY(d2 + d6, FIX_0_541196100); tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); @@ -250,21 +248,7 @@ tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - } else { - /* d0 == 0, d2 != 0, d4 != 0, d6 != 0 */ - z1 = MULTIPLY(d2 + d6, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); - tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865); - - tmp0 = d4 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp2 - tmp0; - tmp12 = -(tmp0 + tmp2); - } } else { - if (d0) { /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */ tmp2 = MULTIPLY(-d6, FIX_1_306562965); tmp3 = MULTIPLY(d6, FIX_0_541196100); @@ -276,72 +260,9 @@ tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - } else { - /* d0 == 0, d2 == 0, d4 != 0, d6 != 0 */ - tmp2 = MULTIPLY(-d6, FIX_1_306562965); - tmp3 = MULTIPLY(d6, FIX_0_541196100); - - tmp0 = d4 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp2 - tmp0; - tmp12 = -(tmp0 + tmp2); - } } - } else { + } else { if (d2) { - if (d0) { - /* d0 != 0, d2 != 0, d4 == 0, d6 != 0 */ - z1 = MULTIPLY(d2 + d6, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); - tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865); - - tmp0 = d0 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp0 + tmp2; - tmp12 = tmp0 - tmp2; - } else { - /* d0 == 0, d2 != 0, d4 == 0, d6 != 0 */ - z1 = MULTIPLY(d2 + d6, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); - tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865); - - tmp10 = tmp3; - tmp13 = -tmp3; - tmp11 = tmp2; - tmp12 = -tmp2; - } - } else { - if (d0) { - /* d0 != 0, d2 == 0, d4 == 0, d6 != 0 */ - tmp2 = MULTIPLY(-d6, FIX_1_306562965); - tmp3 = MULTIPLY(d6, FIX_0_541196100); - - tmp0 = d0 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp0 + tmp2; - tmp12 = tmp0 - tmp2; - } else { - /* d0 == 0, d2 == 0, d4 == 0, d6 != 0 */ - tmp2 = MULTIPLY(-d6, FIX_1_306562965); - tmp3 = MULTIPLY(d6, FIX_0_541196100); - - tmp10 = tmp3; - tmp13 = -tmp3; - tmp11 = tmp2; - tmp12 = -tmp2; - } - } - } - } else { - if (d4) { - if (d2) { - if (d0) { /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */ tmp2 = MULTIPLY(d2, FIX_0_541196100); tmp3 = MULTIPLY(d2, FIX_1_306562965); @@ -353,62 +274,11 @@ tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - } else { - /* d0 == 0, d2 != 0, d4 != 0, d6 == 0 */ - tmp2 = MULTIPLY(d2, FIX_0_541196100); - tmp3 = MULTIPLY(d2, FIX_1_306562965); - - tmp0 = d4 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp2 - tmp0; - tmp12 = -(tmp0 + tmp2); - } } else { - if (d0) { /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */ tmp10 = tmp13 = (d0 + d4) << CONST_BITS; tmp11 = tmp12 = (d0 - d4) << CONST_BITS; - } else { - /* d0 == 0, d2 == 0, d4 != 0, d6 == 0 */ - tmp10 = tmp13 = d4 << CONST_BITS; - tmp11 = tmp12 = -tmp10; - } } - } else { - if (d2) { - if (d0) { - /* d0 != 0, d2 != 0, d4 == 0, d6 == 0 */ - tmp2 = MULTIPLY(d2, FIX_0_541196100); - tmp3 = MULTIPLY(d2, FIX_1_306562965); - - tmp0 = d0 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp0 + tmp2; - tmp12 = tmp0 - tmp2; - } else { - /* d0 == 0, d2 != 0, d4 == 0, d6 == 0 */ - tmp2 = MULTIPLY(d2, FIX_0_541196100); - tmp3 = MULTIPLY(d2, FIX_1_306562965); - - tmp10 = tmp3; - tmp13 = -tmp3; - tmp11 = tmp2; - tmp12 = -tmp2; - } - } else { - if (d0) { - /* d0 != 0, d2 == 0, d4 == 0, d6 == 0 */ - tmp10 = tmp13 = tmp11 = tmp12 = d0 << CONST_BITS; - } else { - /* d0 == 0, d2 == 0, d4 == 0, d6 == 0 */ - tmp10 = tmp13 = tmp11 = tmp12 = 0; - } - } - } } /* Odd part per figure 8; the matrix is unitary and hence its @@ -711,9 +581,7 @@ /* Even part: reverse the even part of the forward DCT. */ /* The rotator is sqrt(2)*c(-6). */ if (d6) { - if (d4) { if (d2) { - if (d0) { /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */ z1 = MULTIPLY(d2 + d6, FIX_0_541196100); tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); @@ -726,21 +594,7 @@ tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - } else { - /* d0 == 0, d2 != 0, d4 != 0, d6 != 0 */ - z1 = MULTIPLY(d2 + d6, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); - tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865); - - tmp0 = d4 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp2 - tmp0; - tmp12 = -(tmp0 + tmp2); - } } else { - if (d0) { /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */ tmp2 = MULTIPLY(-d6, FIX_1_306562965); tmp3 = MULTIPLY(d6, FIX_0_541196100); @@ -752,72 +606,9 @@ tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - } else { - /* d0 == 0, d2 == 0, d4 != 0, d6 != 0 */ - tmp2 = MULTIPLY(-d6, FIX_1_306562965); - tmp3 = MULTIPLY(d6, FIX_0_541196100); - - tmp0 = d4 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp2 - tmp0; - tmp12 = -(tmp0 + tmp2); - } } - } else { + } else { if (d2) { - if (d0) { - /* d0 != 0, d2 != 0, d4 == 0, d6 != 0 */ - z1 = MULTIPLY(d2 + d6, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); - tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865); - - tmp0 = d0 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp0 + tmp2; - tmp12 = tmp0 - tmp2; - } else { - /* d0 == 0, d2 != 0, d4 == 0, d6 != 0 */ - z1 = MULTIPLY(d2 + d6, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(-d6, FIX_1_847759065); - tmp3 = z1 + MULTIPLY(d2, FIX_0_765366865); - - tmp10 = tmp3; - tmp13 = -tmp3; - tmp11 = tmp2; - tmp12 = -tmp2; - } - } else { - if (d0) { - /* d0 != 0, d2 == 0, d4 == 0, d6 != 0 */ - tmp2 = MULTIPLY(-d6, FIX_1_306562965); - tmp3 = MULTIPLY(d6, FIX_0_541196100); - - tmp0 = d0 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp0 + tmp2; - tmp12 = tmp0 - tmp2; - } else { - /* d0 == 0, d2 == 0, d4 == 0, d6 != 0 */ - tmp2 = MULTIPLY(-d6, FIX_1_306562965); - tmp3 = MULTIPLY(d6, FIX_0_541196100); - - tmp10 = tmp3; - tmp13 = -tmp3; - tmp11 = tmp2; - tmp12 = -tmp2; - } - } - } - } else { - if (d4) { - if (d2) { - if (d0) { /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */ tmp2 = MULTIPLY(d2, FIX_0_541196100); tmp3 = MULTIPLY(d2, FIX_1_306562965); @@ -829,62 +620,11 @@ tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - } else { - /* d0 == 0, d2 != 0, d4 != 0, d6 == 0 */ - tmp2 = MULTIPLY(d2, FIX_0_541196100); - tmp3 = MULTIPLY(d2, FIX_1_306562965); - - tmp0 = d4 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp2 - tmp0; - tmp12 = -(tmp0 + tmp2); - } } else { - if (d0) { /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */ tmp10 = tmp13 = (d0 + d4) << CONST_BITS; tmp11 = tmp12 = (d0 - d4) << CONST_BITS; - } else { - /* d0 == 0, d2 == 0, d4 != 0, d6 == 0 */ - tmp10 = tmp13 = d4 << CONST_BITS; - tmp11 = tmp12 = -tmp10; - } } - } else { - if (d2) { - if (d0) { - /* d0 != 0, d2 != 0, d4 == 0, d6 == 0 */ - tmp2 = MULTIPLY(d2, FIX_0_541196100); - tmp3 = MULTIPLY(d2, FIX_1_306562965); - - tmp0 = d0 << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp0 + tmp2; - tmp12 = tmp0 - tmp2; - } else { - /* d0 == 0, d2 != 0, d4 == 0, d6 == 0 */ - tmp2 = MULTIPLY(d2, FIX_0_541196100); - tmp3 = MULTIPLY(d2, FIX_1_306562965); - - tmp10 = tmp3; - tmp13 = -tmp3; - tmp11 = tmp2; - tmp12 = -tmp2; - } - } else { - if (d0) { - /* d0 != 0, d2 == 0, d4 == 0, d6 == 0 */ - tmp10 = tmp13 = tmp11 = tmp12 = d0 << CONST_BITS; - } else { - /* d0 == 0, d2 == 0, d4 == 0, d6 == 0 */ - tmp10 = tmp13 = tmp11 = tmp12 = 0; - } - } - } } /* Odd part per figure 8; the matrix is unitary and hence its