jglobals.h

来自「一个自己编的将bmp压缩成jpeg格式图片并由串口与MD卡存取的程序。」· C头文件 代码 · 共 41 行

H
41
字号
/*#define BYTE unsigned char
#define SBYTE signed char
#define SWORD signed short int
#define WORD unsigned short int
#define DWORD unsigned long int
#define SDWORD signed long int
*/
static U8 bytenew=0; // The byte that will be written in the JPG file
static S8 bytepos=7; //bit position in the byte we write (bytenew)
			//should be<=7 and >=0
static U16 mask[16]={1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768};
// The Huffman tables we'll use:
static bitstring YDC_HT[12];
static bitstring CbDC_HT[12];
static bitstring YAC_HT[256];
static bitstring CbAC_HT[256];

static U8 *category_alloc;
static U8 *category; //Here we'll keep the category of the numbers in range: -32767..32767
static bitstring *bitcode_alloc;
static bitstring *bitcode; // their bitcoded representation

//Precalculated tables for a faster YCbCr->RGB transformation
// We use a SDWORD table because we'll scale values by 2^16 and work with integers
static S32 YRtab[256],YGtab[256],YBtab[256];
static S32 CbRtab[256],CbGtab[256],CbBtab[256];
static S32 CrRtab[256],CrGtab[256],CrBtab[256];
static float fdtbl_Y[64];
static float fdtbl_Cb[64]; //the same with the fdtbl_Cr[64]

colorRGB *RGB_buffer; //image to be encoded
U16 Ximage,Yimage;// image dimensions divisible by 8
static S8 YDU[64]; // This is the Data Unit of Y after YCbCr->RGB transformation
static S8 CbDU[64];
static S8 CrDU[64];
static S16 DU_DCT[64]; // Current DU (after DCT and quantization) which we'll zigzag
static S16 DU[64]; //zigzag reordered DU which will be Huffman coded

//FILE *fp_jpeg_stream;
static unsigned char jpeg[921600];
//static int unmber=0; 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?