On Thu, Feb 21, 2002 at 10:49:10PM -0800, Mark McClelland wrote: > This changeset adds the OV511 decompression module to 2.5.x and updates > the OV511 Config.help. > > I've made sure that it builds, but since 2.5.5 doesn't compile for me it > isn't tested. It's known to work under other kernels, so please apply it > anyway Greg.
I'm sorry to say that, but I find it rather ugly. Can't most of the code be converted into a couple tables or something? > /* j=0 */ > tmp = temp[0]*a+temp[1]*b+temp[2]*c+temp[3]*d; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[0+out_idx] = (unsigned char) tmp; > \ > /* j=1 */ > tmp = temp[0]*a+temp[1]*d+temp[2]*f+temp[3]*(-g); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[1+out_idx] = (unsigned char) tmp; > \ > /* j=2 */ > tmp = temp[0]*a+temp[1]*e+temp[2]*(-f)+temp[3]*(-b); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[2+out_idx] = (unsigned char) tmp; > \ > /* j=3 */ > tmp = temp[0]*a+temp[1]*g+temp[2]*(-c)+temp[3]*(-e); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[3+out_idx] = (unsigned char) tmp; > \ > /* j=4 */ > tmp = temp[0]*a+temp[1]*(-g)+temp[2]*(-c)+temp[3]*e; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[4+out_idx] = (unsigned char) tmp; > \ > /* j=5 */ > tmp = temp[0]*a+temp[1]*(-e)+temp[2]*(-f)+temp[3]*b; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[5+out_idx] = (unsigned char) tmp; > \ > /* j=6 */ > tmp = temp[0]*a+temp[1]*(-d)+temp[2]*f+temp[3]*g; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[6+out_idx] = (unsigned char) tmp; > \ > /* j=7 */ > tmp = temp[0]*a+temp[1]*(-b)+temp[2]*c+temp[3]*(-d); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[7+out_idx] = (unsigned char) tmp; > \ > \ > out_idx += w; > \ > /* i=1 */ > \ > /* j=0 */ > tmp = temp[8]*a+temp[9]*b+temp[10]*c+temp[11]*d; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx] = (unsigned char) tmp; > \ > /* j=1 */ > tmp = temp[8]*a+temp[9]*d+temp[10]*f+temp[11]*(-g); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+1] = (unsigned char) tmp; > \ > /* j=2 */ > tmp = temp[8]*a+temp[9]*e+temp[10]*(-f)+temp[11]*(-b); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+2] = (unsigned char) tmp; > \ > /* j=3 */ > tmp = temp[8]*a+temp[9]*g+temp[10]*(-c)+temp[11]*(-e); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+3] = (unsigned char) tmp; > \ > /* j=4 */ > tmp = temp[8]*a+temp[9]*(-g)+temp[10]*(-c)+temp[11]*e; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+4] = (unsigned char) tmp; > \ > /* j=5 */ > tmp = temp[8]*a+temp[9]*(-e)+temp[10]*(-f)+temp[11]*b; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+5] = (unsigned char) tmp; > \ > /* j=6 */ > tmp = temp[8]*a+temp[9]*(-d)+temp[10]*f+temp[11]*g; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+6] = (unsigned char) tmp; > \ > /* j=7 */ > tmp = temp[8]*a+temp[9]*(-b)+temp[10]*c+temp[11]*(-d); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+7] = (unsigned char) tmp; > \ > \ > out_idx += w; > \ > \ > /* i=2 */ > \ > /* j=0 */ > tmp = temp[16]*a+temp[17]*b+temp[18]*c+temp[19]*d; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx] = (unsigned char) tmp; > \ > /* j=1 */ > tmp = temp[16]*a+temp[17]*d+temp[18]*f+temp[19]*(-g); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+1] = (unsigned char) tmp; > \ > /* j=2 */ > tmp = temp[16]*a+temp[17]*e+temp[18]*(-f)+temp[19]*(-b); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+2] = (unsigned char) tmp; > \ > /* j=3 */ > tmp = temp[16]*a+temp[17]*g+temp[18]*(-c)+temp[19]*(-e); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+3] = (unsigned char) tmp; > \ > /* j=4 */ > tmp = temp[16]*a+temp[17]*(-g)+temp[18]*(-c)+temp[19]*e; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+4] = (unsigned char) tmp; > \ > /* j=5 */ > tmp = temp[16]*a+temp[17]*(-e)+temp[18]*(-f)+temp[19]*b; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+5] = (unsigned char) tmp; > \ > /* j=6 */ > tmp = temp[16]*a+temp[17]*(-d)+temp[18]*f+temp[19]*g; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+6] = (unsigned char) tmp; > \ > /* j=7 */ > tmp = temp[16]*a+temp[17]*(-b)+temp[18]*c+temp[19]*(-d); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+7] = (unsigned char) tmp; > \ > \ > out_idx += w; > \ > /* i=3 */ > \ > /* j=0 */ > tmp = temp[24]*a+temp[25]*b+temp[26]*c+temp[27]*d; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx] = (unsigned char) tmp; > \ > /* j=1 */ > tmp = temp[24]*a+temp[25]*d+temp[26]*f+temp[27]*(-g); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+1] = (unsigned char) tmp; > \ > /* j=2 */ > tmp = temp[24]*a+temp[25]*e+temp[26]*(-f)+temp[27]*(-b); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+2] = (unsigned char) tmp; > \ > /* j=3 */ > tmp = temp[24]*a+temp[25]*g+temp[26]*(-c)+temp[27]*(-e); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+3] = (unsigned char) tmp; > \ > /* j=4 */ > tmp = temp[24]*a+temp[25]*(-g)+temp[26]*(-c)+temp[27]*e; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+4] = (unsigned char) tmp; > \ > /* j=5 */ > tmp = temp[24]*a+temp[25]*(-e)+temp[26]*(-f)+temp[27]*b; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+5] = (unsigned char) tmp; > \ > /* j=6 */ > tmp = temp[24]*a+temp[25]*(-d)+temp[26]*f+temp[27]*g; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+6] = (unsigned char) tmp; > \ > /* j=7 */ > tmp = temp[24]*a+temp[25]*(-b)+temp[26]*c+temp[27]*(-d); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+7] = (unsigned char) tmp; > \ > \ > out_idx += w; > \ > /* i=4 */ > \ > /* j=0 */ > tmp = temp[32]*a+temp[33]*b+temp[34]*c+temp[35]*d; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx] = (unsigned char) tmp; > \ > /* j=1 */ > tmp = temp[32]*a+temp[33]*d+temp[34]*f+temp[35]*(-g); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+1] = (unsigned char) tmp; > \ > /* j=2 */ > tmp = temp[32]*a+temp[33]*e+temp[34]*(-f)+temp[35]*(-b); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+2] = (unsigned char) tmp; > \ > /* j=3 */ > tmp = temp[32]*a+temp[33]*g+temp[34]*(-c)+temp[35]*(-e); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+3] = (unsigned char) tmp; > \ > /* j=4 */ > tmp = temp[32]*a+temp[33]*(-g)+temp[34]*(-c)+temp[35]*e; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+4] = (unsigned char) tmp; > \ > /* j=5 */ > tmp = temp[32]*a+temp[33]*(-e)+temp[34]*(-f)+temp[35]*b; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+5] = (unsigned char) tmp; > \ > /* j=6 */ > tmp = temp[32]*a+temp[33]*(-d)+temp[34]*f+temp[35]*g; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+6] = (unsigned char) tmp; > \ > /* j=7 */ > tmp = temp[32]*a+temp[33]*(-b)+temp[34]*c+temp[35]*(-d); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+7] = (unsigned char) tmp; > \ > \ > out_idx += w; > \ > /* i=5 */ > \ > /* j=0 */ > tmp = temp[40]*a+temp[41]*b+temp[42]*c+temp[43]*d; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx] = (unsigned char) tmp; > \ > /* j=1 */ > tmp = temp[40]*a+temp[41]*d+temp[42]*f+temp[43]*(-g); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+1] = (unsigned char) tmp; > \ > /* j=2 */ > tmp = temp[40]*a+temp[41]*e+temp[42]*(-f)+temp[43]*(-b); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+2] = (unsigned char) tmp; > \ > /* j=3 */ > tmp = temp[40]*a+temp[41]*g+temp[42]*(-c)+temp[43]*(-e); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+3] = (unsigned char) tmp; > \ > /* j=4 */ > tmp = temp[40]*a+temp[41]*(-g)+temp[42]*(-c)+temp[43]*e; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+4] = (unsigned char) tmp; > \ > /* j=5 */ > tmp = temp[40]*a+temp[41]*(-e)+temp[42]*(-f)+temp[43]*b; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+5] = (unsigned char) tmp; > \ > /* j=6 */ > tmp = temp[40]*a+temp[41]*(-d)+temp[42]*f+temp[43]*g; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+6] = (unsigned char) tmp; > \ > /* j=7 */ > tmp = temp[40]*a+temp[41]*(-b)+temp[42]*c+temp[43]*(-d); > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+7] = (unsigned char) tmp; > \ > \ > out_idx += w; > \ > /* i=6 */ > \ > tmp1=temp[48]*a+temp[50]*c; > tmp2=temp[49]*b; > tmp3=temp[51]*d; > /* j=0 */ > tmp=tmp1+tmp2+tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx] = (unsigned char) tmp; > \ > /* j=7 */ > tmp=tmp1-tmp2-tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+7] = (unsigned char) tmp; > \ > tmp1=temp[48]*a+temp[50]*f; > tmp2=temp[49]*d; > tmp3=temp[51]*g; > /* j=1 */ > tmp=tmp1+tmp2-tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+1] = (unsigned char) tmp; > \ > /* j=6 */ > tmp=tmp1-tmp2+tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+6] = (unsigned char) tmp; > > tmp1=temp[48]*a-temp[50]*f; > tmp2=temp[49]*e; > tmp3=temp[51]*b; > /* j=2 */ > tmp=tmp1+tmp2-tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+2] = (unsigned char) tmp; > \ > /* j=5 */ > tmp=tmp1-tmp2+tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+5] = (unsigned char) tmp; > \ > tmp1=temp[48]*a-temp[50]*c; > tmp2=temp[49]*g; > tmp3=temp[51]*e; > /* j=3 */ > tmp=tmp1+tmp2-tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+3] = (unsigned char) tmp; > \ > /* j=4 */ > tmp=tmp1-tmp2+tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+4] = (unsigned char) tmp; > \ > \ > out_idx += w; > \ > /* i=7 */ > \ > tmp1=temp[56]*a+temp[58]*c; > tmp2=temp[57]*b; > tmp3=temp[59]*d; > \ > /* j=0 */ > tmp=tmp1+tmp2+tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx] = (unsigned char) tmp; > \ > /* j=7 */ > tmp=tmp1-tmp2-tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+7] = (unsigned char) tmp; > \ > tmp1=temp[56]*a+temp[58]*f; > tmp2=temp[57]*d; > tmp3=temp[59]*g; > \ > /* j=1 */ > tmp=tmp1+tmp2-tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+1] = (unsigned char) tmp; > \ > /* j=6 */ > tmp=tmp1-tmp2+tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+6] = (unsigned char) tmp; > \ > tmp1=temp[56]*a-temp[58]*f; > tmp2=temp[57]*e; > tmp3=temp[59]*b; > \ > /* j=2 */ > tmp=tmp1+tmp2-tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+2] = (unsigned char) tmp; > \ > /* j=5 */ > tmp=tmp1-tmp2+tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+5] = (unsigned char) tmp; > \ > tmp1=temp[56]*a-temp[58]*c; > tmp2=temp[57]*g; > tmp3=temp[59]*e; > \ > /* j=3 */ > tmp=tmp1+tmp2-tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+3] = (unsigned char) tmp; > \ > /* j=4 */ > tmp=tmp1-tmp2+tmp3; > tmp = tmp>>15; > tmp = tmp + 128; > if (tmp > 255) tmp=255; > if (tmp < 0) tmp=0; > pOut[out_idx+4] = (unsigned char) tmp; > \ > *iIn = in_pos; > *iOut = out_pos + 8; -- Vojtech Pavlik SuSE Labs _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
