r609: Make it compile with xorg
[cinelerra_cv/mob.git] / quicktime / fastjpg.h
blob70a7e612c691476f0d02cb474a39bbbed6dfd530
1 #ifndef FASTJPG_H
2 #define FASTJPG_H
4 #include "sizes.h"
6 #define TOTAL_HUFF_TBLS 4
7 #define TOTAL_QUANT_TBLS 4
8 #define MAXJSAMPLE 255
9 #define CENTERJSAMPLE 128
10 #define MAX_COMPS 4
11 #define DUMMY_COMP 5
12 #define DCTSIZE1 8
13 #define DCTSIZE2 64
14 #define HUFF_LOOKAHEAD 8
15 #define JPEG_APP1_MJPA 0x6D6A7067
16 #define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
18 typedef struct
20 unsigned long long hvsample;
21 unsigned long ac_htbl_num;
22 unsigned long dc_htbl_num;
23 unsigned long qtbl_num;
24 unsigned char id;
25 long dc;
26 } quicktime_jpeg_comp_header;
29 typedef struct
31 int valid;
32 int field_sz;
33 int pad_field_sz;
34 int next_off;
35 int quant_off;
36 int huff_off;
37 int image_off;
38 int scan_off;
39 int data_off;
40 } quicktime_mjpa_info;
42 typedef struct
44 long mincode[17];
45 long maxcode[18];
46 long valptr[17];
47 unsigned QUICKTIME_INT16 cache[256];
48 unsigned char vals[256];
49 unsigned char bits[17];
50 } quicktime_jpeg_huffman;
52 typedef struct
54 int allocated; /* If these buffers were allocated by fastjpg */
55 unsigned char *ybuf;
56 unsigned char *ubuf;
57 unsigned char *vbuf;
58 } quicktime_mjpa_buffs;
60 typedef struct
62 unsigned long Uskip_mask;
63 long *YUV_Y_tab;
64 long *YUV_UB_tab;
65 long *YUV_VR_tab;
66 long *YUV_UG_tab;
67 long *YUV_VG_tab;
68 } quicktime_mjpa_yuvtabs;
70 typedef struct
72 unsigned char *chunk;
73 long chunk_size;
74 long *quant_tables[TOTAL_QUANT_TBLS];
75 unsigned char *jpg_samp_limit;
76 unsigned char *byte_limit;
77 long jpg_num_comps;
78 long jpg_comps_in_scan;
79 long jpg_rst_interval;
80 quicktime_jpeg_comp_header jpg_comps[MAX_COMPS + 1];
81 char IJPG_Tab1[64];
82 char IJPG_Tab2[64];
83 quicktime_jpeg_huffman jpg_ac_huff[TOTAL_HUFF_TBLS];
84 quicktime_jpeg_huffman jpg_dc_huff[TOTAL_HUFF_TBLS];
85 QUICKTIME_INT16 jpg_dct_buf[DCTSIZE2];
86 long jpg_h_bnum; /* this must be signed */
87 unsigned long jpg_h_bbuf;
88 long jpg_nxt_rst_num;
89 int jpg_dprec;
90 int jpg_height;
91 int jpg_width;
92 int jpg_std_DHT_flag;
93 quicktime_mjpa_info mjpa_info;
94 int marker;
95 quicktime_mjpa_buffs yuvbufs;
96 quicktime_mjpa_yuvtabs yuvtabs;
98 /* Marker status */
99 int jpg_saw_SOI;
100 int jpg_saw_SOF;
101 int jpg_saw_SOS;
102 int jpg_saw_EOI;
103 int jpg_saw_DHT;
104 int jpg_saw_DQT;
105 int mjpg_kludge;
106 } quicktime_jpeg_t;
108 #endif