Atmel Software Framework

jquant1.c File Reference
#include "jinclude.h"
#include "jpeglib.h"

Data Structures

struct  my_cquantizer
 

Macros

#define JPEG_INTERNALS
 
#define MAX_Q_COMPS   4 /* max components I can handle */
 
#define ODITHER_CELLS   (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */
 
#define ODITHER_MASK   (ODITHER_SIZE-1) /* mask for wrapping around counters */
 
#define ODITHER_SIZE   16 /* dimension of dither matrix */
 

Typedefs

typedef INT16 FSERROR
 
typedef FSERROR FARFSERRPTR
 
typedef int LOCFSERROR
 
typedef my_cquantizermy_cquantize_ptr
 
typedef int ODITHER_MATRIX [ODITHER_SIZE][ODITHER_SIZE]
 
typedef int(* ODITHER_MATRIX_PTR )[ODITHER_SIZE]
 

Functions

 alloc_fs_workspace (j_decompress_ptr cinfo)
 
 color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 create_colorindex (j_decompress_ptr cinfo)
 
 create_colormap (j_decompress_ptr cinfo)
 
 create_odither_tables (j_decompress_ptr cinfo)
 
 ERREXIT1 (cinfo, JERR_QUANT_FEW_COLORS,(int) temp)
 
 finish_pass_1_quant (j_decompress_ptr cinfo)
 
 for (i=0;i< nc;i++)
 
 jinit_1pass_quantizer (j_decompress_ptr cinfo)
 
 make_odither_array (j_decompress_ptr cinfo, int ncolors)
 
 new_color_map_1_quant (j_decompress_ptr cinfo)
 
 quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
 
tempwhile (temp<=(long) max_colors)
 
 while (changed)
 

Variables

static const UINT8 base_dither_matrix [ODITHER_SIZE][ODITHER_SIZE]
 
boolean changed
 
 do
 
int i
 
int iroot = 1
 
int j
 
int max_colors = cinfo->desired_number_of_colors
 
static const int RGB_order [3] = { RGB_GREEN, RGB_RED, RGB_BLUE }
 
long temp = iroot
 
int total_colors = 1
 

#define JPEG_INTERNALS
#define MAX_Q_COMPS   4 /* max components I can handle */

Referenced by jinit_1pass_quantizer().

#define ODITHER_CELLS   (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */

Referenced by make_odither_array().

#define ODITHER_MASK   (ODITHER_SIZE-1) /* mask for wrapping around counters */
#define ODITHER_SIZE   16 /* dimension of dither matrix */

Referenced by make_odither_array().

typedef INT16 FSERROR
typedef FSERROR FAR* FSERRPTR
typedef int LOCFSERROR
typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]
typedef int(* ODITHER_MATRIX_PTR)[ODITHER_SIZE]

alloc_fs_workspace ( j_decompress_ptr  cinfo)
color_quantize ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)
color_quantize3 ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)
create_odither_tables ( j_decompress_ptr  cinfo)
ERREXIT1 ( cinfo  ,
JERR_QUANT_FEW_COLORS  ,
(int)  temp 
)
finish_pass_1_quant ( j_decompress_ptr  cinfo)

Referenced by jinit_1pass_quantizer().

for ( )

References i, and iroot.

make_odither_array ( j_decompress_ptr  cinfo,
int  ncolors 
)
new_color_map_1_quant ( j_decompress_ptr  cinfo)

References ERREXIT.

Referenced by jinit_1pass_quantizer().

quantize3_ord_dither ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)
quantize_ord_dither ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)
temp* while ( temp<=(long)  max_colors)
while ( changed  )

const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE]
static
Initial value:
= {
{ 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 },
{ 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },
{ 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },
{ 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },
{ 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 },
{ 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },
{ 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },
{ 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },
{ 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 },
{ 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },
{ 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },
{ 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },
{ 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 },
{ 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },
{ 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },
{ 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }
}

Referenced by make_odither_array().

boolean changed
do
Initial value:
{
int iroot
Definition: jquant1.c:193
int i
iroot = 1

Referenced by for().

int max_colors = cinfo->desired_number_of_colors
const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE }
static
temp = iroot
return total_colors = 1

Referenced by create_colormap().