66 #define READ_MARKERS_REP 10 69 { 0xd8, 0xe0, 0xdb, 0xdb, 0xc0, 0xc4, 0xc4, 0xc4, 0xc4, 0xda };
108 #define GET_SOS_REP 3 124 #define GET_DHT_REP 4 138 #define GET_DQT_REP 2 149 17, 24, 32, 25, 18, 11, 4, 5,
150 12, 19, 26, 33, 40, 48, 41, 34,
151 27, 20, 13, 6, 7, 14, 21, 28,
152 35, 42, 49, 56, 57, 50, 43, 36,
153 29, 22, 15, 23, 30, 37, 44, 51,
154 58, 59, 52, 45, 38, 31, 39, 46,
155 53, 60, 61, 54, 47, 55, 62, 63
193 if (c1 != 0xFF || c2 !=
M_SOI)
196 printf (
"Not Jpeg File!\n");
236 char *p_comp_info_index;
237 char *p_comp_info_id;
238 char *p_comp_info_h_samp_factor;
239 char *p_comp_info_v_samp_factor;
240 char *p_comp_info_quant_tbl_no;
248 printf (
"length = %d\n", length);
288 *p_comp_info_index = ci;
291 *p_comp_info_h_samp_factor = (c >> 4) & 15;
292 *p_comp_info_v_samp_factor = (c) & 15;
293 *p_comp_info_quant_tbl_no =
read_byte ();
295 printf (
" index = %d\n", *p_comp_info_index);
296 printf (
" id = %d\n", *p_comp_info_id);
297 printf (
" h_samp_factor = %d\n", *p_comp_info_h_samp_factor);
298 printf (
" v_samp_factor = %d\n", *p_comp_info_v_samp_factor);
299 printf (
" quant_tbl_no = %d\n\n", *p_comp_info_quant_tbl_no);
331 printf (
"\nSampling Factor is 4:1:1\n");
336 printf (
"\nSampling Factor is 1:1:1\n");
344 int length, num_comp;
346 char *p_comp_info_id;
347 char *p_comp_info_dc_tbl_no;
348 char *p_comp_info_ac_tbl_no;
353 printf (
" length = %d\n", length);
354 printf (
" num_comp = %d\n", num_comp);
366 for (i = 0; i < num_comp; i++)
377 if (cc == *p_comp_info_id)
381 printf (
"Bad Component ID!\n");
385 *p_comp_info_dc_tbl_no = (c >> 4) & 15;
386 *p_comp_info_ac_tbl_no = (c) & 15;
388 printf (
" comp_id = %d\n", cc);
389 printf (
" dc_tbl_no = %d\n", *p_comp_info_dc_tbl_no);
390 printf (
" ac_tbl_no = %d\n", *p_comp_info_ac_tbl_no);
432 int *p_xhtbl_huffval;
437 printf (
" length = %d\n", length);
448 printf (
" index = 0x%x\n", index);
471 for (i = 1; i <= 16; i++)
474 count += p_xhtbl_bits[i];
477 printf (
" count = %d\n", count);
487 for (i = 0; i < count; i++)
503 unsigned int *p_quant_tbl;
508 printf (
" length = %d\n", length);
523 printf (
" prec = %d\n", prec);
524 printf (
" num = %d\n", num);
546 length -= DCTSIZE2 + 1;
578 printf (
"\nmarker = 0x%x\n", unread_marker);
586 switch (unread_marker)
const int out_prec_get_dht[GET_DQT_REP]
char p_jinfo_data_precision
int out_p_jinfo_image_height_get_sof
char p_jinfo_comps_info_ac_tbl_no[NUM_COMPONENT]
char p_jinfo_comps_info_id[NUM_COMPONENT]
const int out_id_get_sof[GET_SOF_REP]
char p_jinfo_comps_info_h_samp_factor[NUM_COMPONENT]
const int out_dc_tbl_no_get_sos[GET_SOS_REP]
const int out_count_get_dht[GET_DHT_REP]
int p_jinfo_ac_xhuff_tbl_bits[NUM_HUFF_TBLS][36]
const int out_length_get_dqt[GET_DQT_REP]
const int out_unread_marker[READ_MARKERS_REP]
static unsigned char * ReadBuf
unsigned int p_jinfo_quant_tbl_quantval[NUM_QUANT_TBLS][DCTSIZE2]
short p_jinfo_image_width
char p_jinfo_comps_info_quant_tbl_no[NUM_COMPONENT]
char p_jinfo_comps_info_index[NUM_COMPONENT]
char p_jinfo_num_components
const int out_index_get_dht[GET_DHT_REP]
const int out_index_get_sof[GET_SOF_REP]
unsigned char * p_jinfo_jpeg_data
const int out_h_samp_factor_get_sof[GET_SOF_REP]
const int out_num_get_dht[GET_DQT_REP]
char p_jinfo_comps_info_v_samp_factor[NUM_COMPONENT]
short p_jinfo_image_height
int out_p_jinfo_image_width_get_sof
int p_jinfo_ac_xhuff_tbl_huffval[NUM_HUFF_TBLS][257]
int out_data_precision_get_sof
const int out_comp_id_get_sos[GET_SOS_REP]
int out_p_jinfo_num_components_get_sof
void read_markers(unsigned char *buf)
const int out_ac_tbl_no_get_sos[GET_SOS_REP]
char p_jinfo_comps_info_dc_tbl_no[NUM_COMPONENT]
int p_jinfo_dc_xhuff_tbl_bits[NUM_HUFF_TBLS][36]
const int out_length_get_dht[GET_DHT_REP]
const int izigzag_index[64]
const int out_quant_tbl_no_get_sof[GET_SOF_REP]
int p_jinfo_dc_xhuff_tbl_huffval[NUM_HUFF_TBLS][257]
const int out_v_samp_factor_get_sof[GET_SOF_REP]