Commit 49fad89a authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Sebastien Alaiwan

Replace OD_UNBIASED_RSHIFT32() with OD_RSHIFT1().

Because daala_tx only ever does an unbiased shift by 1, we can replace
 the varible shift macro with a simpler hardcoded implementation.
This patch causes no change in behavior.

subset-1:

daala_tx@2017-11-04T07:20:17.571Z ->
 daala_tx-no_op@2017-11-04T07:21:06.231Z

  PSNR | PSNR Cb | PSNR Cr | PSNR HVS |   SSIM | MS SSIM | CIEDE 2000
0.0000 |  0.0000 |  0.0000 |   0.0000 | 0.0000 |  0.0000 |     0.0000

Change-Id: Ifddfef079320de0df09d9bc39757af9fe81e3c38
parent 683f70e7
......@@ -3,7 +3,7 @@
/* clang-format off */
# define OD_DCT_RSHIFT(_a, _b) OD_UNBIASED_RSHIFT32(_a, _b)
#define OD_RSHIFT1(_a) (((_a) + ((_a) < 0)) >> 1)
/* TODO: Daala DCT overflow checks need to be ported as a later test */
# if defined(OD_DCT_CHECK_OVERFLOW)
......@@ -50,7 +50,7 @@
/* Embedded 2-point asymmetric Type-II iDCT. */ \
do { \
p1 = p0 - p1; \
p1h = OD_DCT_RSHIFT(p1, 1); \
p1h = OD_RSHIFT1(p1); \
p0 -= p1h; \
} \
while (0)
......@@ -115,10 +115,10 @@
int q2h; \
int q3h; \
q3 = q0 - q3; \
q3h = OD_DCT_RSHIFT(q3, 1); \
q3h = OD_RSHIFT1(q3); \
q0 -= q3h; \
q2 += q1; \
q2h = OD_DCT_RSHIFT(q2, 1); \
q2h = OD_RSHIFT1(q2); \
q1 = q2h - q1; \
OD_FDCT_2_ASYM(q0, q2, q2h); \
OD_FDST_2_ASYM(q3, q1); \
......@@ -132,7 +132,7 @@
int q3h; \
OD_IDST_2_ASYM(q3, q2); \
OD_IDCT_2_ASYM(q0, q1, q1h); \
q3h = OD_DCT_RSHIFT(q3, 1); \
q3h = OD_RSHIFT1(q3); \
q0 += q3h; \
q3 = q0 - q3; \
q2 = q1h - q2; \
......@@ -158,10 +158,10 @@
OD_IDST_2(q3, q2); \
OD_IDCT_2(q0, q1); \
q1 = q2 - q1; \
q1h = OD_DCT_RSHIFT(q1, 1); \
q1h = OD_RSHIFT1(q1); \
q2 = q1h - q2; \
q3 = q0 - q3; \
q3h = OD_DCT_RSHIFT(q3, 1); \
q3h = OD_RSHIFT1(q3); \
q0 -= q3h; \
} \
while (0)
......@@ -181,10 +181,10 @@
OD_DCT_OVERFLOW_CHECK(q1, 3393, 4096, 192); \
q2 += (q1*3393 + 4096) >> 13; \
q0 += q2; \
q0h = OD_DCT_RSHIFT(q0, 1); \
q0h = OD_RSHIFT1(q0); \
q2 = q0h - q2; \
q1 += q3; \
q1h = OD_DCT_RSHIFT(q1, 1); \
q1h = OD_RSHIFT1(q1); \
q3 -= q1h; \
/* 537/1024 ~= (1/Sqrt[2] - Cos[3*Pi/16]/2)/Sin[3*Pi/16] ~=
0.524455699240090 */ \
......@@ -232,10 +232,10 @@
/* 537/1024 ~= (1/Sqrt[2] - Cos[3*Pi/16]/2)/Sin[3*Pi/16] ~=
0.524455699240090 */ \
q1 += (q2*537 + 512) >> 10; \
q2h = OD_DCT_RSHIFT(q2, 1); \
q2h = OD_RSHIFT1(q2); \
q3 += q2h; \
q2 -= q3; \
q0h = OD_DCT_RSHIFT(q0, 1); \
q0h = OD_RSHIFT1(q0); \
q1 = q0h - q1; \
q0 -= q1; \
/* 3393/8192 ~= Tan[Pi/8] ~= 0.414213562373095 */ \
......@@ -259,7 +259,7 @@
/* -19195/32768 ~= Tan[Pi/8] - Tan[Pi/4] ~= -0.585786437626905 */ \
OD_DCT_OVERFLOW_CHECK(t1, 19195, 16384, 108); \
t2 += (t1*19195 + 16384) >> 15; \
t3 += OD_DCT_RSHIFT(t2, 1); \
t3 += OD_RSHIFT1(t2); \
t2 -= t3; \
t1 = t0h - t1; \
t0 -= t1; \
......@@ -300,10 +300,10 @@
/* 6723/8192 ~= Tan[7*Pi/32] ~= 0.820678790828660 */ \
t3 -= (t0*6723 + 4096) >> 13; \
t0 += t2; \
t0h = OD_DCT_RSHIFT(t0, 1); \
t0h = OD_RSHIFT1(t0); \
t2 = t0h - t2; \
t1 += t3; \
t3 -= OD_DCT_RSHIFT(t1, 1); \
t3 -= OD_RSHIFT1(t1); \
/* -19195/32768 ~= Tan[Pi/8] - Tan[Pi/4] ~= -0.585786437626905 */ \
t1 -= (t2*19195 + 16384) >> 15; \
/* 11585/16384 ~= Sin[Pi/4] ~= 0.707106781186548 */ \
......@@ -321,16 +321,16 @@
int r6h; \
int r7h; \
r7 = r0 - r7; \
r7h = OD_DCT_RSHIFT(r7, 1); \
r7h = OD_RSHIFT1(r7); \
r0 -= r7h; \
r6 += r1; \
r6h = OD_DCT_RSHIFT(r6, 1); \
r6h = OD_RSHIFT1(r6); \
r1 = r6h - r1; \
r5 = r2 - r5; \
r5h = OD_DCT_RSHIFT(r5, 1); \
r5h = OD_RSHIFT1(r5); \
r2 -= r5h; \
r4 += r3; \
r4h = OD_DCT_RSHIFT(r4, 1); \
r4h = OD_RSHIFT1(r4); \
r3 = r4h - r3; \
OD_FDCT_4_ASYM(r0, r4, r4h, r2, r6, r6h); \
OD_FDST_4_ASYM(r7, r7h, r3, r5, r1); \
......@@ -350,7 +350,7 @@
r7 = r0 - r7; \
r6 = r1h - r6; \
r1 -= r6; \
r5h = OD_DCT_RSHIFT(r5, 1); \
r5h = OD_RSHIFT1(r5); \
r2 += r5h; \
r5 = r2 - r5; \
r4 = r3h - r4; \
......@@ -380,16 +380,16 @@
OD_IDST_4(r7, r5, r6, r4); \
OD_IDCT_4(r0, r2, r1, r3); \
r7 = r0 - r7; \
r7h = OD_DCT_RSHIFT(r7, 1); \
r7h = OD_RSHIFT1(r7); \
r0 -= r7h; \
r1 += r6; \
r1h = OD_DCT_RSHIFT(r1, 1); \
r1h = OD_RSHIFT1(r1); \
r6 = r1h - r6; \
r5 = r2 - r5; \
r5h = OD_DCT_RSHIFT(r5, 1); \
r5h = OD_RSHIFT1(r5); \
r2 -= r5h; \
r3 += r4; \
r3h = OD_DCT_RSHIFT(r3, 1); \
r3h = OD_RSHIFT1(r3); \
r4 = r3h - r4; \
} \
while (0)
......@@ -429,16 +429,16 @@
OD_DCT_OVERFLOW_CHECK(t3, 3259, 8192, 123); \
t4 -= (t3*3259 + 8192) >> 14; \
t7 += t1; \
t7h = OD_DCT_RSHIFT(t7, 1); \
t7h = OD_RSHIFT1(t7); \
t1 -= t7h; \
t2 = t3 - t2; \
t2h = OD_DCT_RSHIFT(t2, 1); \
t2h = OD_RSHIFT1(t2); \
t3 -= t2h; \
t0 -= t6; \
t0h = OD_DCT_RSHIFT(t0, 1); \
t0h = OD_RSHIFT1(t0); \
t6 += t0h; \
t5 = t4 - t5; \
t5h = OD_DCT_RSHIFT(t5, 1); \
t5h = OD_RSHIFT1(t5); \
t4 -= t5h; \
t1 += t5h; \
t5 = t1 - t5; \
......@@ -523,16 +523,16 @@
/* TODO: Can we move this into another operation */ \
t7 = -t7; \
t7 -= t6; \
t7h_ = OD_DCT_RSHIFT(t7, 1); \
t7h_ = OD_RSHIFT1(t7); \
t6 += t7h_; \
t2 -= t3; \
t2h = OD_DCT_RSHIFT(t2, 1); \
t2h = OD_RSHIFT1(t2); \
t3 += t2h; \
t0 += t1; \
t0h = OD_DCT_RSHIFT(t0, 1); \
t0h = OD_RSHIFT1(t0); \
t1 -= t0h; \
t5 = t4 - t5; \
t5h_ = OD_DCT_RSHIFT(t5, 1); \
t5h_ = OD_RSHIFT1(t5); \
t4 -= t5h_; \
t1 += t5h_; \
t5 = t1 - t5; \
......@@ -608,16 +608,16 @@
OD_DCT_OVERFLOW_CHECK(t0, 2507, 2048, 210); \
t7 += (t0*2507 + 2048) >> 12; \
t0 += t1; \
t0h = OD_DCT_RSHIFT(t0, 1); \
t0h = OD_RSHIFT1(t0); \
t1 -= t0h; \
t2 -= t3; \
t2h = OD_DCT_RSHIFT(t2, 1); \
t2h = OD_RSHIFT1(t2); \
t3 += t2h; \
t5 -= t4; \
t5h = OD_DCT_RSHIFT(t5, 1); \
t5h = OD_RSHIFT1(t5); \
t4 += t5h; \
t7 += t6; \
t7h = OD_DCT_RSHIFT(t7, 1); \
t7h = OD_RSHIFT1(t7); \
t6 = t7h - t6; \
t4 = t7h - t4; \
t7 -= t4; \
......@@ -683,16 +683,16 @@
/* 3259/16384 ~= Tan[Pi/16] ~= 0.198912367379658 */ \
t4 -= (t3*3259 + 8192) >> 14; \
t0 -= t6; \
t0h = OD_DCT_RSHIFT(t0, 1); \
t0h = OD_RSHIFT1(t0); \
t6 += t0h; \
t2 = t3 - t2; \
t2h = OD_DCT_RSHIFT(t2, 1); \
t2h = OD_RSHIFT1(t2); \
t3 -= t2h; \
t5 = t4 - t5; \
t5h__ = OD_DCT_RSHIFT(t5, 1); \
t5h__ = OD_RSHIFT1(t5); \
t4 -= t5h__; \
t7 += t1; \
t7h__ = OD_DCT_RSHIFT(t7, 1); \
t7h__ = OD_RSHIFT1(t7); \
t1 = t7h__ - t1; \
t3 = t7h__ - t3; \
t7 -= t3; \
......@@ -739,25 +739,25 @@
int seh; \
int sfh; \
sf = s0 - sf; \
sfh = OD_DCT_RSHIFT(sf, 1); \
sfh = OD_RSHIFT1(sf); \
s0 -= sfh; \
se += s1; \
seh = OD_DCT_RSHIFT(se, 1); \
seh = OD_RSHIFT1(se); \
s1 = seh - s1; \
sd = s2 - sd; \
s2 -= OD_DCT_RSHIFT(sd, 1); \
s2 -= OD_RSHIFT1(sd); \
sc += s3; \
sch = OD_DCT_RSHIFT(sc, 1); \
sch = OD_RSHIFT1(sc); \
s3 = sch - s3; \
sb = s4 - sb; \
s4 -= OD_DCT_RSHIFT(sb, 1); \
s4 -= OD_RSHIFT1(sb); \
sa += s5; \
sah = OD_DCT_RSHIFT(sa, 1); \
sah = OD_RSHIFT1(sa); \
s5 = sah - s5; \
s9 = s6 - s9; \
s6 -= OD_DCT_RSHIFT(s9, 1); \
s6 -= OD_RSHIFT1(s9); \
s8 += s7; \
s8h = OD_DCT_RSHIFT(s8, 1); \
s8h = OD_RSHIFT1(s8); \
s7 = s8h - s7; \
OD_FDCT_8_ASYM(s0, s8, s8h, s4, sc, sch, s2, sa, sah, s6, se, seh); \
OD_FDST_8_ASYM(sf, s7, sb, s3, sd, s5, s9, s1); \
......@@ -775,20 +775,20 @@
int sfh; \
OD_IDST_8_ASYM(sf, sb, sd, s9, se, sa, sc, s8); \
OD_IDCT_8_ASYM(s0, s4, s2, s6, s1, s1h, s5, s5h, s3, s3h, s7, s7h); \
sfh = OD_DCT_RSHIFT(sf, 1); \
sfh = OD_RSHIFT1(sf); \
s0 += sfh; \
sf = s0 - sf; \
se = s1h - se; \
s1 -= se; \
s2 += OD_DCT_RSHIFT(sd, 1); \
s2 += OD_RSHIFT1(sd); \
sd = s2 - sd; \
sc = s3h - sc; \
s3 -= sc; \
s4 += OD_DCT_RSHIFT(sb, 1); \
s4 += OD_RSHIFT1(sb); \
sb = s4 - sb; \
sa = s5h - sa; \
s5 -= sa; \
s6 += OD_DCT_RSHIFT(s9, 1); \
s6 += OD_RSHIFT1(s9); \
s9 = s6 - s9; \
s8 = s7h - s8; \
s7 -= s8; \
......@@ -827,28 +827,28 @@
OD_IDST_8(tf, tb, td, t9, te, ta, tc, t8); \
OD_IDCT_8(t0, t4, t2, t6, t1, t5, t3, t7); \
t1 -= te; \
t1h = OD_DCT_RSHIFT(t1, 1); \
t1h = OD_RSHIFT1(t1); \
te += t1h; \
t9 = t6 - t9; \
t9h = OD_DCT_RSHIFT(t9, 1); \
t9h = OD_RSHIFT1(t9); \
t6 -= t9h; \
t5 -= ta; \
t5h = OD_DCT_RSHIFT(t5, 1); \
t5h = OD_RSHIFT1(t5); \
ta += t5h; \
td = t2 - td; \
tdh = OD_DCT_RSHIFT(td, 1); \
tdh = OD_RSHIFT1(td); \
t2 -= tdh; \
t3 -= tc; \
t3h = OD_DCT_RSHIFT(t3, 1); \
t3h = OD_RSHIFT1(t3); \
tc += t3h; \
tb = t4 - tb; \
tbh = OD_DCT_RSHIFT(tb, 1); \
tbh = OD_RSHIFT1(tb); \
t4 -= tbh; \
t7 -= t8; \
t7h = OD_DCT_RSHIFT(t7, 1); \
t7h = OD_RSHIFT1(t7); \
t8 += t7h; \
tf = t0 - tf; \
tfh = OD_DCT_RSHIFT(tf, 1); \
tfh = OD_RSHIFT1(tf); \
t0 -= tfh; \
} \
while (0)
......@@ -907,25 +907,25 @@
OD_DCT_OVERFLOW_CHECK(s9, 13573, 16384, 234); \
s6 += (s9*13573 + 16384) >> 15; \
sf += se; \
sfh = OD_DCT_RSHIFT(sf, 1); \
sfh = OD_RSHIFT1(sf); \
se = sfh - se; \
s0 += s1; \
s0h = OD_DCT_RSHIFT(s0, 1); \
s0h = OD_RSHIFT1(s0); \
s1 = s0h - s1; \
s2 = s3 - s2; \
s2h = OD_DCT_RSHIFT(s2, 1); \
s2h = OD_RSHIFT1(s2); \
s3 -= s2h; \
sd -= sc; \
sdh = OD_DCT_RSHIFT(sd, 1); \
sdh = OD_RSHIFT1(sd); \
sc += sdh; \
sa = s4 - sa; \
s4 -= OD_DCT_RSHIFT(sa, 1); \
s4 -= OD_RSHIFT1(sa); \
s5 += sb; \
sb = OD_DCT_RSHIFT(s5, 1) - sb; \
sb = OD_RSHIFT1(s5) - sb; \
s8 += s6; \
s6 -= OD_DCT_RSHIFT(s8, 1); \
s6 -= OD_RSHIFT1(s8); \
s7 = s9 - s7; \
s9 -= OD_DCT_RSHIFT(s7, 1); \
s9 -= OD_RSHIFT1(s7); \
/* 6723/8192 ~= Tan[7*Pi/32] ~= 0.820678790828660 */ \
OD_DCT_OVERFLOW_CHECK(sb, 6723, 4096, 235); \
s4 += (sb*6723 + 4096) >> 13; \
......@@ -970,30 +970,30 @@
sf -= s3; \
sc = s0h - sc; \
s0 -= sc; \
sb += OD_DCT_RSHIFT(s8, 1); \
sb += OD_RSHIFT1(s8); \
s8 = sb - s8; \
s4 += OD_DCT_RSHIFT(s7, 1); \
s4 += OD_RSHIFT1(s7); \
s7 -= s4; \
s6 += OD_DCT_RSHIFT(s5, 1); \
s6 += OD_RSHIFT1(s5); \
s5 = s6 - s5; \
s9 -= OD_DCT_RSHIFT(sa, 1); \
s9 -= OD_RSHIFT1(sa); \
sa += s9; \
s8 += s0; \
s0 -= OD_DCT_RSHIFT(s8, 1); \
s0 -= OD_RSHIFT1(s8); \
sf += s7; \
s7 = OD_DCT_RSHIFT(sf, 1) - s7; \
s7 = OD_RSHIFT1(sf) - s7; \
s1 -= s6; \
s6 += OD_DCT_RSHIFT(s1, 1); \
s6 += OD_RSHIFT1(s1); \
s9 += se; \
se = OD_DCT_RSHIFT(s9, 1) - se; \
se = OD_RSHIFT1(s9) - se; \
s2 += sa; \
sa = OD_DCT_RSHIFT(s2, 1) - sa; \
sa = OD_RSHIFT1(s2) - sa; \
s5 += sd; \
sd -= OD_DCT_RSHIFT(s5, 1); \
sd -= OD_RSHIFT1(s5); \
s4 = sc - s4; \
sc -= OD_DCT_RSHIFT(s4, 1); \
sc -= OD_RSHIFT1(s4); \
s3 -= sb; \
sb += OD_DCT_RSHIFT(s3, 1); \
sb += OD_RSHIFT1(s3); \
/* 2799/4096 ~= (1/Sqrt[2] - Cos[31*Pi/64]/2)/Sin[31*Pi/64] */ \
OD_DCT_OVERFLOW_CHECK(sf, 2799, 2048, 247); \
s0 -= (sf*2799 + 2048) >> 12; \
......@@ -1125,41 +1125,41 @@
sf -= (s0*2893 + 1024) >> 11; \
/* 2799/4096 ~= (1/Sqrt[2] - Cos[31*Pi/64]/2)/Sin[31*Pi/64] */ \
s0 += (sf*2799 + 2048) >> 12; \
sd -= OD_DCT_RSHIFT(sc, 1); \
sd -= OD_RSHIFT1(sc); \
sc += sd; \
s3 += OD_DCT_RSHIFT(s2, 1); \
s3 += OD_RSHIFT1(s2); \
s2 = s3 - s2; \
sb += OD_DCT_RSHIFT(sa, 1); \
sb += OD_RSHIFT1(sa); \
sa -= sb; \
s5 = OD_DCT_RSHIFT(s4, 1) - s5; \
s5 = OD_RSHIFT1(s4) - s5; \
s4 -= s5; \
s7 = OD_DCT_RSHIFT(s9, 1) - s7; \
s7 = OD_RSHIFT1(s9) - s7; \
s9 -= s7; \
s6 -= OD_DCT_RSHIFT(s8, 1); \
s6 -= OD_RSHIFT1(s8); \
s8 += s6; \
se = OD_DCT_RSHIFT(sf, 1) - se; \
se = OD_RSHIFT1(sf) - se; \
sf -= se; \
s0 += OD_DCT_RSHIFT(s1, 1); \
s0 += OD_RSHIFT1(s1); \
s1 -= s0; \
s5 -= s9; \
s9 += OD_DCT_RSHIFT(s5, 1); \
s9 += OD_RSHIFT1(s5); \
sa = s6 - sa; \
s6 -= OD_DCT_RSHIFT(sa, 1); \
s6 -= OD_RSHIFT1(sa); \
se += s2; \
s2 -= OD_DCT_RSHIFT(se, 1); \
s2 -= OD_RSHIFT1(se); \
s1 = sd - s1; \
sd -= OD_DCT_RSHIFT(s1, 1); \
sd -= OD_RSHIFT1(s1); \
s0 += s3; \
s0h = OD_DCT_RSHIFT(s0, 1); \
s0h = OD_RSHIFT1(s0); \
s3 = s0h - s3; \
sf += sc; \
sfh = OD_DCT_RSHIFT(sf, 1); \
sfh = OD_RSHIFT1(sf); \
sc -= sfh; \
sb = s7 - sb; \
sbh = OD_DCT_RSHIFT(sb, 1); \
sbh = OD_RSHIFT1(sb); \
s7 -= sbh; \
s4 -= s8; \
s4h = OD_DCT_RSHIFT(s4, 1); \
s4h = OD_RSHIFT1(s4); \
s8 += s4h; \
/* 3227/32768 ~= Tan[Pi/32] ~= 0.09849140335716425 */ \
se -= (s1*3227 + 16384) >> 15; \
......@@ -1185,13 +1185,13 @@
sd += (s2*16069 + 8192) >> 14; \
/* 6723/8192 ~= Tan[7*Pi/32] ~= 0.820678790828660 */ \
s2 -= (sd*6723 + 4096) >> 13; \
s9 += OD_DCT_RSHIFT(se, 1); \
s9 += OD_RSHIFT1(se); \
se = s9 - se; \
s6 += OD_DCT_RSHIFT(s1, 1); \
s6 += OD_RSHIFT1(s1); \
s1 -= s6; \
sd = OD_DCT_RSHIFT(sa, 1) - sd; \
sd = OD_RSHIFT1(sa) - sd; \
sa -= sd; \
s2 += OD_DCT_RSHIFT(s5, 1); \
s2 += OD_RSHIFT1(s5); \
s5 = s2 - s5; \
s3 -= sbh; \
sb += s3; \
......@@ -1281,13 +1281,13 @@
tc -= (t3*4161 + 8192) >> 14; \
te = t0h - te; \
t0 -= te; \
tf = OD_DCT_RSHIFT(t1, 1) - tf; \
tf = OD_RSHIFT1(t1) - tf; \
t1 -= tf; \
/* TODO: Can we move this into another operation */ \
tc = -tc; \
t2 = OD_DCT_RSHIFT(tc, 1) - t2; \
t2 = OD_RSHIFT1(tc) - t2; \
tc -= t2; \
t3 = OD_DCT_RSHIFT(td, 1) - t3; \
t3 = OD_RSHIFT1(td) - t3; \
td = t3 - td; \
/* 7489/8192 ~= Tan[Pi/8] + Tan[Pi/4]/2 ~= 0.914213562373095 */ \
OD_DCT_OVERFLOW_CHECK(t6, 7489, 4096, 145); \
......@@ -1298,7 +1298,7 @@
/* -19195/32768 ~= Tan[Pi/8] - Tan[Pi/4] ~= -0.585786437626905 */ \
OD_DCT_OVERFLOW_CHECK(t6, 19195, 16384, 147); \
t9 += (t6*19195 + 16384) >> 15; \
t8 += OD_DCT_RSHIFT(t9, 1); \
t8 += OD_RSHIFT1(t9); \
t9 -= t8; \
t6 = t7h - t6; \
t7 -= t6; \
......@@ -1329,7 +1329,7 @@
/* 13573/16384 ~= 2*Tan[Pi/8] ~= 0.828427124746190 */ \
OD_DCT_OVERFLOW_CHECK(ta, 13573, 8192, 156); \
t5 += (ta*13573 + 8192) >> 14; \
tb += OD_DCT_RSHIFT(t5, 1); \
tb += OD_RSHIFT1(t5); \
t5 = tb - t5; \
ta += t4h; \
t4 -= ta; \
......@@ -1354,28 +1354,28 @@
/* TODO: Can we move this into another operation */ \
t5 = -t5; \
tc -= tf; \
tch = OD_DCT_RSHIFT(tc, 1); \
tch = OD_RSHIFT1(tc); \
tf += tch; \
t3 += t0; \
t3h = OD_DCT_RSHIFT(t3, 1); \
t3h = OD_RSHIFT1(t3); \
t0 -= t3h; \
td -= t1; \
tdh = OD_DCT_RSHIFT(td, 1); \
tdh = OD_RSHIFT1(td); \
t1 += tdh; \
t2 += te; \
t2h = OD_DCT_RSHIFT(t2, 1); \
t2h = OD_RSHIFT1(t2); \
te -= t2h; \
t8 += t4; \
t8h = OD_DCT_RSHIFT(t8, 1); \
t8h = OD_RSHIFT1(t8); \
t4 = t8h - t4; \
t7 = tb - t7; \
t7h = OD_DCT_RSHIFT(t7, 1); \
t7h = OD_RSHIFT1(t7); \
tb = t7h - tb; \
t6 -= ta; \
t6h = OD_DCT_RSHIFT(t6, 1); \
t6h = OD_RSHIFT1(t6); \
ta += t6h; \
t9 = t5 - t9; \
t9h = OD_DCT_RSHIFT(t9, 1); \
t9h = OD_RSHIFT1(t9); \
t5 -= t9h; \
t0 -= t7h; \
t7 += t0; \
......@@ -1544,28 +1544,28 @@
td = -td; \
tf = -tf; \
t4 += ta; \
t4h = OD_DCT_RSHIFT(t4, 1); \
t4h = OD_RSHIFT1(t4); \
ta = t4h - ta; \
tb -= t5; \
tbh_ = OD_DCT_RSHIFT(tb, 1); \
tbh_ = OD_RSHIFT1(tb); \
t5 += tbh_; \
tc += t2; \
tch = OD_DCT_RSHIFT(tc, 1); \
tch = OD_RSHIFT1(tc); \
t2 -= tch; \
t3 -= td; \
t3h_ = OD_DCT_RSHIFT(t3, 1); \
t3h_ = OD_RSHIFT1(t3); \
td += t3h_; \
t9 += t8; \
t9h_ = OD_DCT_RSHIFT(t9, 1); \
t9h_ = OD_RSHIFT1(t9); \
t8 -= t9h_; \
t6 -= t7; \
t6h = OD_DCT_RSHIFT(t6, 1); \
t6h = OD_RSHIFT1(t6); \
t7 += t6h; \
t1 += tf; \
t1h_ = OD_DCT_RSHIFT(t1, 1); \
t1h_ = OD_RSHIFT1(t1); \
tf -= t1h_; \
te -= t0; \
teh = OD_DCT_RSHIFT(te, 1); \
teh = OD_RSHIFT1(te); \
t0 += teh; \
ta += t9h_; \
t9 = ta - t9; \
......@@ -1598,10 +1598,10 @@
/* 2485/8192 ~= Tan[3*Pi/32] ~= 0.303346683607342 */ \
t5 -= (ta*2485 + 4096) >> 13; \
t2 += t5; \
t2h = OD_DCT_RSHIFT(t2, 1); \
t2h = OD_RSHIFT1(t2); \
t5 -= t2h; \
ta = td - ta; \
td -= OD_DCT_RSHIFT(ta, 1); \
td -= OD_RSHIFT1(ta); \
/* 13573/16384 ~= 2*Tan[Pi/8] ~= 0.828427124746190 */ \
ta -= (t5*13573 + 8192) >> 14; \
/* 11585/32768 ~= Sin[Pi/4]/2 ~= 0.353553390593274 */ \
......@@ -1621,10 +1621,10 @@
/* 6723/8192 ~= Tan[7*Pi/32]) ~= 0.820678790828660 */ \
t1 -= (te*6723 + 4096) >> 13; \
te += t6; \
teh = OD_DCT_RSHIFT(te, 1); \
teh = OD_RSHIFT1(te); \
t6 = teh - t6; \
t9 += t1; \
t1 -= OD_DCT_RSHIFT(t9, 1); \
t1 -= OD_RSHIFT1(t9); \
/* -19195/32768 ~= Tan[Pi/8] - Tan[Pi/4] ~= -0.585786437626905 */ \
t9 -= (t6*19195 + 16384) >> 15; \
/* 11585/16384 ~= Sin[Pi/4] ~= 0.707106781186548 */ \
......@@ -1632,15 +1632,15 @@
/* 7489/8192 ~= Tan[Pi/8] + Tan[Pi/4]/2 ~= 0.914213562373095 */ \
t9 += (t6*7489 + 4096) >> 13; \
tb = tc - tb; \
tc = OD_DCT_RSHIFT(tb, 1) - tc; \
tc = OD_RSHIFT1(tb) - tc; \
t3 += t4; \
t4 = OD_DCT_RSHIFT(t3, 1) - t4; \
t4 = OD_RSHIFT1(t3) - t4; \
/* TODO: Can we move this into another operation */ \
t3 = -t3; \
t8 += tf; \
tf = OD_DCT_RSHIFT(t8, 1) - tf; \
tf = OD_RSHIFT1(t8) - tf; \
t0 += t7; \
t0h = OD_DCT_RSHIFT(t0, 1); \
t0h = OD_RSHIFT1(t0); \
t7 = t0h - t7; \
/* 4161/16384 ~= Tan[3*Pi/16] - Tan[Pi/8] ~= 0.253965075546204 */ \
t3 += (tc*4161 + 8192) >> 14; \
......@@ -1685,47 +1685,47 @@
int tuh; \
int tvh; \
tv = t0 - tv; \
tvh = OD_DCT_RSHIFT(tv, 1); \
tvh = OD_RSHIFT1(tv); \
t0 -= tvh; \
tu += t1; \
tuh = OD_DCT_RSHIFT(tu, 1); \
tuh = OD_RSHIFT1(tu); \
t1 = tuh - t1; \
tt = t2 - tt; \
t2 -= OD_DCT_RSHIFT(tt, 1); \
t2 -= OD_RSHIFT1(tt); \
ts += t3; \
tsh = OD_DCT_RSHIFT(ts, 1); \
tsh = OD_RSHIFT1(ts); \
t3 = tsh - t3; \
tr = t4 - tr; \
t4 -= OD_DCT_RSHIFT(tr, 1); \
t4 -= OD_RSHIFT1(tr); \
tq += t5; \
tqh = OD_DCT_RSHIFT(tq, 1); \
tqh = OD_RSHIFT1(tq); \
t5 = tqh - t5; \
tp = t6 - tp; \
t6 -= OD_DCT_RSHIFT(tp, 1); \
t6 -= OD_RSHIFT1(tp); \
to += t7; \
toh = OD_DCT_RSHIFT(to, 1); \
toh = OD_RSHIFT1(to); \
t7 = toh - t7; \