现在这个算法已经有点眉目了,我这是JPEG->BMP转换的代码,现在转换后的BMP已经能能出来大致的轮廓了,但是各种颜色有点混乱,请各位大虾再加把劲帮我把这个弄出来,谢谢! singed short get_svalue(unsigned char k) // k>0 always // Takes k bits out of the BIT stream (wordval), and makes them a signed value { _asm { xor ecx, ecx mov cl,k mov eax,[wordval]//wordval为unsigned int类型 shl eax,cl shr eax, 16 dec cl bt eax,ecx jc end_macro signed_value:inc cl mov ebx,[start_neg_pow2]//start_neg_pow2为signed short*指针 add ax,word ptr [ebx+ecx*2] end_macro: } }
unsigned short WORD_hi_lo(unsigned char byte_high,unsigned char byte_low) { _asm { mov ah,byte_high mov al,byte_low } }
unsigned short lookKbits(unsigned char k) { _asm { mov dl, k mov cl, 16 sub cl, dl mov eax, [wordval]//wordval为unsigned int类型 shr eax, cl } }
|