📄 sw_jpeg_decoder.h
字号:
break;\
}\
inptr+=8;\
quantptr+= 8;\
wsptr+= 8;\
}
#define jpeg_decoder_1st_idct_col_0_3_4_7(inptr,quantptr,wsptr,blk_zero_tbl)\
for (ctr = 0; ctr < 8; ctr++)\
{\
switch(blk_zero_tbl[ctr])\
{\
case 0:\
while(ctr<8){\
wsptr[0]=0;\
wsptr[7]=0;\
wsptr[3]=0;\
wsptr[4]=0;\
wsptr+= 8;\
ctr++;}\
goto _1st_idct_end;\
case 1:\
x1 = (inptr[0] * quantptr[0]);\
wsptr[0]=x1;\
wsptr[7]=x1;\
wsptr[3]=x1;\
wsptr[4]=x1;\
break;\
case 2:\
x1 = (inptr[1] * quantptr[1]);\
c4 = ((x1) * 922)>>10;\
b12 = (x1 * 1537)>>10;\
d12 = b12 - c4;\
x4 = ((x1) * 1204) >> 10;\
c7 = (x4 * 25)>>6;\
x3 = x4 - c7;\
x1 = (inptr[0] * quantptr[0]);\
x2=d12+x3;\
wsptr[0] = (x1 + x2);\
wsptr[7] = (x1 - x2);\
x2 = x4-c4;\
wsptr[3] = (x1 + x2);\
wsptr[4] = (x1 - x2);\
break;\
case 3:\
x1 = (inptr[1] * quantptr[1]);\
c4 = ((x1 ) * 922)>>10;\
b12 = (x1 * 1537)>>10;\
d12 = b12 - c4;\
x4 = ((x1) * 1204) >> 10;\
c7 = (x1 * 25)>>6;\
x3 = x4 - c7;\
b3 = (inptr[0] * quantptr[0]);\
d0 = (inptr[2] * quantptr[2]);\
x5 = (d0 * 784)>>10;\
x1 = ((d0) * 554)>>10;\
d1 = x1 + x5;\
x2=d12+x3;\
x1=b3+d1;\
wsptr[0] = (x1 + x2);\
wsptr[7] = (x1 - x2);\
x1 = b3 - d1;\
wsptr[3] = (x1 + x4);\
wsptr[4] = (x1 - x4);\
break;\
default:\
x1 = (inptr[1] * quantptr[1]);\
x2 = (inptr[3] * quantptr[3]);\
x3 = (inptr[5] * quantptr[5]);\
x4 = (inptr[7] * quantptr[7]);\
b9 = (x4 * 306)>>10;\
c4 = ((x1 + x4) * 922)>>10;\
d4 = b9 - c4;\
b12 = (x1 * 1537)>>10;\
d12 = b12 - c4;\
x4 = x2 + x4;\
x3 = x1 + x3;\
x1 = ((x4+x3) * 1204) >> 10;\
c6 = (x4 * 2009)>>10;\
x4 = x1 - c6;\
c7 = (x3 * 25)>>6;\
x3 = x1 - c7;\
x1 = (inptr[0] * quantptr[0]);\
x2 = (inptr[4] * quantptr[4]);\
b3 = (x1 + x2);\
x1 = (inptr[2] * quantptr[2]);\
x2 = (inptr[6] * quantptr[6]);\
x5 = (x1 * 784)>>10;\
x1 = ((x1 + x2) * 554)>>10;\
d1 = x1 + x5;\
x2=d12+x3;\
x1=b3+d1;\
wsptr[0] = (x1 + x2);\
wsptr[7] = (x1 - x2);\
x1 = b3 - d1;\
x2 = d4 + x4;\
wsptr[3] = (x1 + x2);\
wsptr[4] = (x1 - x2);\
break;\
}\
inptr+=8;\
quantptr+= 8;\
wsptr+= 8;\
}
#define jpeg_decoder_1st_idct_col_1_2_5_6(inptr,quantptr,wsptr,blk_zero_tbl)\
for (ctr = 0; ctr < 8; ctr++)\
{\
switch(blk_zero_tbl[ctr])\
{\
case 0:\
while(ctr<8){\
wsptr[2]=0;\
wsptr[5]=0;\
wsptr[1]=0;\
wsptr[6]=0;\
wsptr+= 8;\
ctr++;}\
goto _1st_idct_end;\
case 1:\
x1 = (inptr[0] * quantptr[0]);\
wsptr[2]=x1;\
wsptr[5]=x1;\
wsptr[1]=x1;\
wsptr[6]=x1;\
break;\
case 2:\
x1 = (inptr[1] * quantptr[1]);\
x1 = ((x1) * 1204) >> 10;\
x4 = x1 ;\
c7 = (x1 * 25)>>6;\
x2 = x1 - c7;\
b4 = (inptr[0] * quantptr[0]);\
d0 = ((x1 ) * 554)>>10;\
x1 = b4 - d0;\
wsptr[2] = (x1 + x2);\
wsptr[5] = (x1 - x2);\
x1 = b4 + d0;\
wsptr[1] = (x1 + x4);\
wsptr[6] = (x1 - x4);\
break;\
case 3:\
x1 = (inptr[1] * quantptr[1]);\
c4 = ((x1 ) * 922)>>10;\
b12 = (x1 * 1537)>>10;\
d12 = b12 - c4;\
x4 = ((x1) * 1204) >> 10;\
c7 = (x1 * 25)>>6;\
x3 = x4 - c7;\
b3 = (inptr[0] * quantptr[0]);\
d0 = (inptr[2] * quantptr[2]);\
x2=d12+x3;\
x1 = b3 - d0;\
wsptr[2] = (x1 + x3);\
wsptr[5] = (x1 - x3);\
x1 = b3 + d0;\
wsptr[1] = (x1 + x2);\
wsptr[6] = (x1 - x2);\
break;\
default:\
x1 = (inptr[1] * quantptr[1]);\
x2 = (inptr[3] * quantptr[3]);\
x3 = (inptr[5] * quantptr[5]);\
x4 = (inptr[7] * quantptr[7]);\
b10 = (x3 * 2102)>>10;\
c5 = ((x2 + x3) * 2624)>>10;\
d5 = b10 - c5;\
b11 = (x2 * 3146)>>10;\
d11 = b11 - c5;\
x4 = x2 + x4;\
x3 = x1 + x3;\
x1 = ((x4+x3) * 1204) >> 10;\
c6 = (x4 * 2009)>>10;\
x4 = x1 - c6;\
c7 = (x3 * 25)>>6;\
x3 = x1 - c7;\
x1 = (inptr[0] * quantptr[0]);\
x2 = (inptr[4] * quantptr[4]);\
b4 = (x1 - x2);\
x1 = (inptr[2] * quantptr[2]);\
x2 = (inptr[6] * quantptr[6]);\
x6 = (x2 * 1892)>>10;\
x1 = ((x1 + x2) * 554)>>10;\
d0 = x1 - x6;\
x1 = b4 - d0;\
x2 = d5 + x3;\
wsptr[2] = (x1 + x2);\
wsptr[5] = (x1 - x2);\
x2 = d11 + x4;\
x1 = b4 + d0;\
wsptr[1] = (x1 + x2);\
wsptr[6] = (x1 - x2);\
break;\
}\
inptr+=8;\
quantptr+= 8;\
wsptr+= 8;\
}
#define jpeg_decoder_1st_idct_col_all(inptr,quantptr,wsptr,blk_zero_tbl)\
for (ctr = 0; ctr < 8; ctr++)\
{\
switch(blk_zero_tbl[ctr])\
{\
case 0:\
while(ctr<8){\
wsptr[0]=0;\
wsptr[1]=0;\
wsptr[2]=0;\
wsptr[3]=0;\
wsptr[4]=0;\
wsptr[5]=0;\
wsptr[6]=0;\
wsptr[7]=0;\
wsptr+= 8;\
ctr++;}\
goto _1st_idct_end;\
case 1:\
x1 = (inptr[0] * quantptr[0]);\
wsptr[0]=x1;\
wsptr[1]=x1;\
wsptr[2]=x1;\
wsptr[3]=x1;\
wsptr[4]=x1;\
wsptr[5]=x1;\
wsptr[6]=x1;\
wsptr[7]=x1;\
break;\
case 2:\
x1 = (inptr[1] * quantptr[1]);\
c4 = ((x1 ) * 922)>>10;\
b12 = (x1 * 1537)>>10;\
d12 = b12 - c4;\
x4 = ((x1) * 1204) >> 10;\
c7 = (x1 * 25)>>6;\
x3 = x4 - c7;\
b3 = (inptr[0] * quantptr[0]);\
x2=d12+x3;\
wsptr[0] = (b3 + x2);\
wsptr[7] = (b3 - x2);\
wsptr[2] = (b3 + x3);\
wsptr[5] = (b3 - x3);\
x2 = x4-c4;\
wsptr[3] = (b3 + x2);\
wsptr[4] = (b3 - x2);\
wsptr[1] = (b3 + x4);\
wsptr[6] = (b3 - x4);\
break;\
case 3:\
x1 = (inptr[1] * quantptr[1]);\
c4 = ((x1 ) * 922)>>10;\
b12 = (x1 * 1537)>>10;\
d12 = b12 - c4;\
x4 = ((x1) * 1204) >> 10;\
c7 = (x1 * 25)>>6;\
x3 = x4 - c7;\
b3 = (inptr[0] * quantptr[0]);\
x1 = (inptr[2] * quantptr[2]);\
x5 = (x1 * 784)>>10;\
d0 = ((x1 ) * 554)>>10;\
d1 = d0 + x5;\
x2=d12+x3;\
x1=b3+d1;\
wsptr[0] = (x1 + x2);\
wsptr[7] = (x1 - x2);\
x1 = b3 - d0;\
wsptr[2] = (x1 + x3);\
wsptr[5] = (x1 - x3);\
x1 = b3 - d1;\
x2 = x4-c4;\
wsptr[3] = (x1 + x2);\
wsptr[4] = (x1 - x2);\
x1 = b3 + d0;\
wsptr[1] = (x1 + x4);\
wsptr[6] = (x1 - x4);\
break;\
default:\
x1 = (inptr[1] * quantptr[1]);\
x2 = (inptr[3] * quantptr[3]);\
x3 = (inptr[5] * quantptr[5]);\
x4 = (inptr[7] * quantptr[7]);\
b9 = (x4 * 306)>>10;\
c4 = ((x1 + x4) * 922)>>10;\
d4 = b9 - c4;\
b10 = (x3 * 2102)>>10;\
c5 = ((x2 + x3) * 2624)>>10;\
d5 = b10 - c5;\
b11 = (x2 * 3146)>>10;\
d11 = b11 - c5;\
b12 = (x1 * 1537)>>10;\
d12 = b12 - c4;\
x4 = x2 + x4;\
x3 = x1 + x3;\
x1 = ((x4+x3) * 1204) >> 10;\
c6 = (x4 * 2009)>>10;\
x4 = x1 - c6;\
c7 = (x3 * 25)>>6;\
x3 = x1 - c7;\
x1 = (inptr[0] * quantptr[0]);\
x2 = (inptr[4] * quantptr[4]);\
b3 = (x1 + x2);\
b4 = (x1 - x2);\
x1 = (inptr[2] * quantptr[2]);\
x2 = (inptr[6] * quantptr[6]);\
x5 = (x1 * 784)>>10;\
x6 = (x2 * 1892)>>10;\
x1 = ((x1 + x2) * 554)>>10;\
d0 = x1 - x6;\
d1 = x1 + x5;\
x2=d12+x3;\
x1=b3+d1;\
wsptr[0] = (x1 + x2);\
wsptr[7] = (x1 - x2);\
x1 = b4 - d0;\
x2 = d5 + x3;\
wsptr[2] = (x1 + x2);\
wsptr[5] = (x1 - x2);\
x1 = b3 - d1;\
x2 = d4 + x4;\
wsptr[3] = (x1 + x2);\
wsptr[4] = (x1 - x2);\
x2 = d11 + x4;\
x1 = b4 + d0;\
wsptr[1] = (x1 + x2);\
wsptr[6] = (x1 - x2);\
break;\
}\
inptr+=8;\
quantptr+= 8;\
wsptr+= 8;\
}
#endif /*__SW_JPEG_DECODER_H__*/
#endif /* __SW_JPEG_CODEC_SUPPORT__ !__MTK_TARGET__*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -