|
|
|
@ -29,11 +29,6 @@ |
|
|
|
|
#include "faandct.h" |
|
|
|
|
|
|
|
|
|
#define FLOAT float |
|
|
|
|
#ifdef FAAN_POSTSCALE |
|
|
|
|
# define SCALE(x) postscale[x] |
|
|
|
|
#else |
|
|
|
|
# define SCALE(x) 1 |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
//numbers generated by simple c code (not as accurate as they could be)
|
|
|
|
|
/*
|
|
|
|
@ -150,13 +145,13 @@ void ff_faandct(DCTELEM * data) |
|
|
|
|
tmp11= tmp1 + tmp2; |
|
|
|
|
tmp12= tmp1 - tmp2; |
|
|
|
|
|
|
|
|
|
data[8*0 + i]= lrintf(SCALE(8*0 + i) * (tmp10 + tmp11)); |
|
|
|
|
data[8*4 + i]= lrintf(SCALE(8*4 + i) * (tmp10 - tmp11)); |
|
|
|
|
data[8*0 + i]= lrintf(postscale[8*0 + i] * (tmp10 + tmp11)); |
|
|
|
|
data[8*4 + i]= lrintf(postscale[8*4 + i] * (tmp10 - tmp11)); |
|
|
|
|
|
|
|
|
|
tmp12 += tmp13; |
|
|
|
|
tmp12 *= A1; |
|
|
|
|
data[8*2 + i]= lrintf(SCALE(8*2 + i) * (tmp13 + tmp12)); |
|
|
|
|
data[8*6 + i]= lrintf(SCALE(8*6 + i) * (tmp13 - tmp12)); |
|
|
|
|
data[8*2 + i]= lrintf(postscale[8*2 + i] * (tmp13 + tmp12)); |
|
|
|
|
data[8*6 + i]= lrintf(postscale[8*6 + i] * (tmp13 - tmp12)); |
|
|
|
|
|
|
|
|
|
tmp4 += tmp5; |
|
|
|
|
tmp5 += tmp6; |
|
|
|
@ -175,10 +170,10 @@ void ff_faandct(DCTELEM * data) |
|
|
|
|
z11= tmp7 + tmp5; |
|
|
|
|
z13= tmp7 - tmp5; |
|
|
|
|
|
|
|
|
|
data[8*5 + i]= lrintf(SCALE(8*5 + i) * (z13 + z2)); |
|
|
|
|
data[8*3 + i]= lrintf(SCALE(8*3 + i) * (z13 - z2)); |
|
|
|
|
data[8*1 + i]= lrintf(SCALE(8*1 + i) * (z11 + z4)); |
|
|
|
|
data[8*7 + i]= lrintf(SCALE(8*7 + i) * (z11 - z4)); |
|
|
|
|
data[8*5 + i]= lrintf(postscale[8*5 + i] * (z13 + z2)); |
|
|
|
|
data[8*3 + i]= lrintf(postscale[8*3 + i] * (z13 - z2)); |
|
|
|
|
data[8*1 + i]= lrintf(postscale[8*1 + i] * (z11 + z4)); |
|
|
|
|
data[8*7 + i]= lrintf(postscale[8*7 + i] * (z11 - z4)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -208,25 +203,25 @@ void ff_faandct248(DCTELEM * data) |
|
|
|
|
tmp12 = tmp1 - tmp2; |
|
|
|
|
tmp13 = tmp0 - tmp3; |
|
|
|
|
|
|
|
|
|
data[8*0 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11)); |
|
|
|
|
data[8*4 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11)); |
|
|
|
|
data[8*0 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11)); |
|
|
|
|
data[8*4 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11)); |
|
|
|
|
|
|
|
|
|
tmp12 += tmp13; |
|
|
|
|
tmp12 *= A1; |
|
|
|
|
data[8*2 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + tmp12)); |
|
|
|
|
data[8*6 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - tmp12)); |
|
|
|
|
data[8*2 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12)); |
|
|
|
|
data[8*6 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12)); |
|
|
|
|
|
|
|
|
|
tmp10 = tmp4 + tmp7; |
|
|
|
|
tmp11 = tmp5 + tmp6; |
|
|
|
|
tmp12 = tmp5 - tmp6; |
|
|
|
|
tmp13 = tmp4 - tmp7; |
|
|
|
|
|
|
|
|
|
data[8*1 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11)); |
|
|
|
|
data[8*5 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11)); |
|
|
|
|
data[8*1 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11)); |
|
|
|
|
data[8*5 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11)); |
|
|
|
|
|
|
|
|
|
tmp12 += tmp13; |
|
|
|
|
tmp12 *= A1; |
|
|
|
|
data[8*3 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + tmp12)); |
|
|
|
|
data[8*7 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - tmp12)); |
|
|
|
|
data[8*3 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12)); |
|
|
|
|
data[8*7 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|