⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jpeg.h

📁 jpeg压缩C代码,包括库的源代码和一个测试程序的源代码
💻 H
字号:

#ifndef _JPEG_H_
#define _JPEG_H_

/*
* First we include the configuration files that record how this
* installation of the JPEG library is set up.  jconfig.h can be
* generated automatically for many systems.  jmorecfg.h contains
* manual configuration options that most people need not worry about.
*/

#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <assert.h>

#include "jpeglib.h"

typedef unsigned char    BYTE; 
typedef unsigned char *  PBYTE; 
typedef unsigned short   WORD; 
typedef unsigned short * PWORD;

#define SCALEBITS	16
#define IFIX(X)		((1L << SCALEBITS) / (X) + 1)

#define CENTERJSAMPLE	128
#define CENTERJSAMPLE2	0x00800080
/* Version ID for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
*/
#define JPEG_LIB_VERSION  62	// Version 6b

#define DCTSIZE		    8		// The basic DCT block is 8x8 samples */
#define DCTSIZE2	    64		// DCTSIZE squared; # of elements in a block 

#define j_compress_ptr PJPEG_COMPRESS_PARAM

// Data destination object for compression
typedef struct 
{
    int			   cnt;			// current bitcounter;
    unsigned int   byte_buf;	// current buffer for last written BYTE;
	unsigned char* ptr;			// next byte to write in buffer
	unsigned char* buffer;		// start of buffer
	int		       size;		// buffer size
}Bitstream;

extern const int jpeg_natural_order[DCTSIZE2+16];

extern void write_file_trailer (Bitstream *bs);
extern int  write_file_header (j_compress_ptr cinfo, Bitstream *bs, int width, int height);
extern void finish_pass_huff (Bitstream *bs);
extern void encode_mcu_huff (j_compress_ptr cinfo, Bitstream *bs, short MCU_data[6][64], int last_dc_val[3]);
extern void jpeg_fdct_islow(short * block);
extern void jpeg_fdct_islow_ti(short * block);

extern void StartTimer();
extern void StopTimer();

#endif // _JPEG_H_

⌨️ 快捷键说明

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