openshot-audio  0.1.6
Classes | Macros | Typedefs | Functions
jquant2.c File Reference
#include "jinclude.h"
#include "jpeglib.h"

Classes

struct  my_cquantizer2
 
struct  box
 

Macros

#define JPEG_INTERNALS
 
#define R_SCALE   2 /* scale R distances by this much */
 
#define G_SCALE   3 /* scale G distances by this much */
 
#define B_SCALE   1 /* and B by this much */
 
#define C0_SCALE   R_SCALE
 
#define C1_SCALE   G_SCALE
 
#define C2_SCALE   B_SCALE
 
#define MAXNUMCOLORS   (MAXJSAMPLE+1) /* maximum size of colormap */
 
#define HIST_C0_BITS   5 /* bits of precision in R/B histogram */
 
#define HIST_C1_BITS   6 /* bits of precision in G histogram */
 
#define HIST_C2_BITS   5 /* bits of precision in B/R histogram */
 
#define HIST_C0_ELEMS   (1<<HIST_C0_BITS)
 
#define HIST_C1_ELEMS   (1<<HIST_C1_BITS)
 
#define HIST_C2_ELEMS   (1<<HIST_C2_BITS)
 
#define C0_SHIFT   (BITS_IN_JSAMPLE-HIST_C0_BITS)
 
#define C1_SHIFT   (BITS_IN_JSAMPLE-HIST_C1_BITS)
 
#define C2_SHIFT   (BITS_IN_JSAMPLE-HIST_C2_BITS)
 
#define BOX_C0_LOG   (HIST_C0_BITS-3)
 
#define BOX_C1_LOG   (HIST_C1_BITS-3)
 
#define BOX_C2_LOG   (HIST_C2_BITS-3)
 
#define BOX_C0_ELEMS   (1<<BOX_C0_LOG) /* # of hist cells in update box */
 
#define BOX_C1_ELEMS   (1<<BOX_C1_LOG)
 
#define BOX_C2_ELEMS   (1<<BOX_C2_LOG)
 
#define BOX_C0_SHIFT   (C0_SHIFT + BOX_C0_LOG)
 
#define BOX_C1_SHIFT   (C1_SHIFT + BOX_C1_LOG)
 
#define BOX_C2_SHIFT   (C2_SHIFT + BOX_C2_LOG)
 
#define STEP_C0   ((1 << C0_SHIFT) * C0_SCALE)
 
#define STEP_C1   ((1 << C1_SHIFT) * C1_SCALE)
 
#define STEP_C2   ((1 << C2_SHIFT) * C2_SCALE)
 
#define STEPSIZE   ((MAXJSAMPLE+1)/16)
 
#define JPEG_INTERNALS
 
#define R_SCALE   2 /* scale R distances by this much */
 
#define G_SCALE   3 /* scale G distances by this much */
 
#define B_SCALE   1 /* and B by this much */
 
#define C0_SCALE   R_SCALE
 
#define C1_SCALE   G_SCALE
 
#define C2_SCALE   B_SCALE
 
#define MAXNUMCOLORS   (MAXJSAMPLE+1) /* maximum size of colormap */
 
#define HIST_C0_BITS   5 /* bits of precision in R/B histogram */
 
#define HIST_C1_BITS   6 /* bits of precision in G histogram */
 
#define HIST_C2_BITS   5 /* bits of precision in B/R histogram */
 
#define HIST_C0_ELEMS   (1<<HIST_C0_BITS)
 
#define HIST_C1_ELEMS   (1<<HIST_C1_BITS)
 
#define HIST_C2_ELEMS   (1<<HIST_C2_BITS)
 
#define C0_SHIFT   (BITS_IN_JSAMPLE-HIST_C0_BITS)
 
#define C1_SHIFT   (BITS_IN_JSAMPLE-HIST_C1_BITS)
 
#define C2_SHIFT   (BITS_IN_JSAMPLE-HIST_C2_BITS)
 
#define BOX_C0_LOG   (HIST_C0_BITS-3)
 
#define BOX_C1_LOG   (HIST_C1_BITS-3)
 
#define BOX_C2_LOG   (HIST_C2_BITS-3)
 
#define BOX_C0_ELEMS   (1<<BOX_C0_LOG) /* # of hist cells in update box */
 
#define BOX_C1_ELEMS   (1<<BOX_C1_LOG)
 
#define BOX_C2_ELEMS   (1<<BOX_C2_LOG)
 
#define BOX_C0_SHIFT   (C0_SHIFT + BOX_C0_LOG)
 
#define BOX_C1_SHIFT   (C1_SHIFT + BOX_C1_LOG)
 
#define BOX_C2_SHIFT   (C2_SHIFT + BOX_C2_LOG)
 
#define STEP_C0   ((1 << C0_SHIFT) * C0_SCALE)
 
#define STEP_C1   ((1 << C1_SHIFT) * C1_SCALE)
 
#define STEP_C2   ((1 << C2_SHIFT) * C2_SCALE)
 
#define STEPSIZE   ((MAXJSAMPLE+1)/16)
 
#define JPEG_INTERNALS
 
#define R_SCALE   2 /* scale R distances by this much */
 
#define G_SCALE   3 /* scale G distances by this much */
 
#define B_SCALE   1 /* and B by this much */
 
#define C0_SCALE   R_SCALE
 
#define C1_SCALE   G_SCALE
 
#define C2_SCALE   B_SCALE
 
#define MAXNUMCOLORS   (MAXJSAMPLE+1) /* maximum size of colormap */
 
#define HIST_C0_BITS   5 /* bits of precision in R/B histogram */
 
#define HIST_C1_BITS   6 /* bits of precision in G histogram */
 
#define HIST_C2_BITS   5 /* bits of precision in B/R histogram */
 
#define HIST_C0_ELEMS   (1<<HIST_C0_BITS)
 
#define HIST_C1_ELEMS   (1<<HIST_C1_BITS)
 
#define HIST_C2_ELEMS   (1<<HIST_C2_BITS)
 
#define C0_SHIFT   (BITS_IN_JSAMPLE-HIST_C0_BITS)
 
#define C1_SHIFT   (BITS_IN_JSAMPLE-HIST_C1_BITS)
 
#define C2_SHIFT   (BITS_IN_JSAMPLE-HIST_C2_BITS)
 
#define BOX_C0_LOG   (HIST_C0_BITS-3)
 
#define BOX_C1_LOG   (HIST_C1_BITS-3)
 
#define BOX_C2_LOG   (HIST_C2_BITS-3)
 
#define BOX_C0_ELEMS   (1<<BOX_C0_LOG) /* # of hist cells in update box */
 
#define BOX_C1_ELEMS   (1<<BOX_C1_LOG)
 
#define BOX_C2_ELEMS   (1<<BOX_C2_LOG)
 
#define BOX_C0_SHIFT   (C0_SHIFT + BOX_C0_LOG)
 
#define BOX_C1_SHIFT   (C1_SHIFT + BOX_C1_LOG)
 
#define BOX_C2_SHIFT   (C2_SHIFT + BOX_C2_LOG)
 
#define STEP_C0   ((1 << C0_SHIFT) * C0_SCALE)
 
#define STEP_C1   ((1 << C1_SHIFT) * C1_SCALE)
 
#define STEP_C2   ((1 << C2_SHIFT) * C2_SCALE)
 
#define STEPSIZE   ((MAXJSAMPLE+1)/16)
 

Typedefs

typedef UINT16 histcell
 
typedef histcell FARhistptr
 
typedef histcell hist1d[HIST_C2_ELEMS]
 
typedef hist1d FARhist2d
 
typedef hist2dhist3d
 
typedef INT16 FSERROR
 
typedef int LOCFSERROR
 
typedef FSERROR FARFSERRPTR
 
typedef my_cquantizer2my_cquantize_ptr2
 
typedef boxboxptr
 

Functions

 prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY, int num_rows)
 
 find_biggest_color_pop (boxptr boxlist, int numboxes)
 
 find_biggest_volume (boxptr boxlist, int numboxes)
 
 update_box (j_decompress_ptr cinfo, boxptr boxp)
 
 median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, int desired_colors)
 
 compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
 
 select_colors (j_decompress_ptr cinfo, int desired_colors)
 
 find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, JSAMPLE colorlist[])
 
 find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
 
 fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
 
 pass2_no_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 pass2_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 init_error_limit (j_decompress_ptr cinfo)
 
 finish_pass1 (j_decompress_ptr cinfo)
 
 finish_pass2 (j_decompress_ptr)
 
 start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
 
 new_color_map_2_quant (j_decompress_ptr cinfo)
 
 jinit_2pass_quantizer (j_decompress_ptr cinfo)
 

Macro Definition Documentation

◆ B_SCALE [1/3]

#define B_SCALE   1 /* and B by this much */

◆ B_SCALE [2/3]

#define B_SCALE   1 /* and B by this much */

◆ B_SCALE [3/3]

#define B_SCALE   1 /* and B by this much */

◆ BOX_C0_ELEMS [1/3]

#define BOX_C0_ELEMS   (1<<BOX_C0_LOG) /* # of hist cells in update box */

◆ BOX_C0_ELEMS [2/3]

#define BOX_C0_ELEMS   (1<<BOX_C0_LOG) /* # of hist cells in update box */

◆ BOX_C0_ELEMS [3/3]

#define BOX_C0_ELEMS   (1<<BOX_C0_LOG) /* # of hist cells in update box */

◆ BOX_C0_LOG [1/3]

#define BOX_C0_LOG   (HIST_C0_BITS-3)

◆ BOX_C0_LOG [2/3]

#define BOX_C0_LOG   (HIST_C0_BITS-3)

◆ BOX_C0_LOG [3/3]

#define BOX_C0_LOG   (HIST_C0_BITS-3)

◆ BOX_C0_SHIFT [1/3]

#define BOX_C0_SHIFT   (C0_SHIFT + BOX_C0_LOG)

◆ BOX_C0_SHIFT [2/3]

#define BOX_C0_SHIFT   (C0_SHIFT + BOX_C0_LOG)

◆ BOX_C0_SHIFT [3/3]

#define BOX_C0_SHIFT   (C0_SHIFT + BOX_C0_LOG)

◆ BOX_C1_ELEMS [1/3]

#define BOX_C1_ELEMS   (1<<BOX_C1_LOG)

◆ BOX_C1_ELEMS [2/3]

#define BOX_C1_ELEMS   (1<<BOX_C1_LOG)

◆ BOX_C1_ELEMS [3/3]

#define BOX_C1_ELEMS   (1<<BOX_C1_LOG)

◆ BOX_C1_LOG [1/3]

#define BOX_C1_LOG   (HIST_C1_BITS-3)

◆ BOX_C1_LOG [2/3]

#define BOX_C1_LOG   (HIST_C1_BITS-3)

◆ BOX_C1_LOG [3/3]

#define BOX_C1_LOG   (HIST_C1_BITS-3)

◆ BOX_C1_SHIFT [1/3]

#define BOX_C1_SHIFT   (C1_SHIFT + BOX_C1_LOG)

◆ BOX_C1_SHIFT [2/3]

#define BOX_C1_SHIFT   (C1_SHIFT + BOX_C1_LOG)

◆ BOX_C1_SHIFT [3/3]

#define BOX_C1_SHIFT   (C1_SHIFT + BOX_C1_LOG)

◆ BOX_C2_ELEMS [1/3]

#define BOX_C2_ELEMS   (1<<BOX_C2_LOG)

◆ BOX_C2_ELEMS [2/3]

#define BOX_C2_ELEMS   (1<<BOX_C2_LOG)

◆ BOX_C2_ELEMS [3/3]

#define BOX_C2_ELEMS   (1<<BOX_C2_LOG)

◆ BOX_C2_LOG [1/3]

#define BOX_C2_LOG   (HIST_C2_BITS-3)

◆ BOX_C2_LOG [2/3]

#define BOX_C2_LOG   (HIST_C2_BITS-3)

◆ BOX_C2_LOG [3/3]

#define BOX_C2_LOG   (HIST_C2_BITS-3)

◆ BOX_C2_SHIFT [1/3]

#define BOX_C2_SHIFT   (C2_SHIFT + BOX_C2_LOG)

◆ BOX_C2_SHIFT [2/3]

#define BOX_C2_SHIFT   (C2_SHIFT + BOX_C2_LOG)

◆ BOX_C2_SHIFT [3/3]

#define BOX_C2_SHIFT   (C2_SHIFT + BOX_C2_LOG)

◆ C0_SCALE [1/3]

#define C0_SCALE   R_SCALE

◆ C0_SCALE [2/3]

#define C0_SCALE   R_SCALE

◆ C0_SCALE [3/3]

#define C0_SCALE   R_SCALE

◆ C0_SHIFT [1/3]

#define C0_SHIFT   (BITS_IN_JSAMPLE-HIST_C0_BITS)

◆ C0_SHIFT [2/3]

#define C0_SHIFT   (BITS_IN_JSAMPLE-HIST_C0_BITS)

◆ C0_SHIFT [3/3]

#define C0_SHIFT   (BITS_IN_JSAMPLE-HIST_C0_BITS)

◆ C1_SCALE [1/3]

#define C1_SCALE   G_SCALE

◆ C1_SCALE [2/3]

#define C1_SCALE   G_SCALE

◆ C1_SCALE [3/3]

#define C1_SCALE   G_SCALE

◆ C1_SHIFT [1/3]

#define C1_SHIFT   (BITS_IN_JSAMPLE-HIST_C1_BITS)

◆ C1_SHIFT [2/3]

#define C1_SHIFT   (BITS_IN_JSAMPLE-HIST_C1_BITS)

◆ C1_SHIFT [3/3]

#define C1_SHIFT   (BITS_IN_JSAMPLE-HIST_C1_BITS)

◆ C2_SCALE [1/3]

#define C2_SCALE   B_SCALE

◆ C2_SCALE [2/3]

#define C2_SCALE   B_SCALE

◆ C2_SCALE [3/3]

#define C2_SCALE   B_SCALE

◆ C2_SHIFT [1/3]

#define C2_SHIFT   (BITS_IN_JSAMPLE-HIST_C2_BITS)

◆ C2_SHIFT [2/3]

#define C2_SHIFT   (BITS_IN_JSAMPLE-HIST_C2_BITS)

◆ C2_SHIFT [3/3]

#define C2_SHIFT   (BITS_IN_JSAMPLE-HIST_C2_BITS)

◆ G_SCALE [1/3]

#define G_SCALE   3 /* scale G distances by this much */

◆ G_SCALE [2/3]

#define G_SCALE   3 /* scale G distances by this much */

◆ G_SCALE [3/3]

#define G_SCALE   3 /* scale G distances by this much */

◆ HIST_C0_BITS [1/3]

#define HIST_C0_BITS   5 /* bits of precision in R/B histogram */

◆ HIST_C0_BITS [2/3]

#define HIST_C0_BITS   5 /* bits of precision in R/B histogram */

◆ HIST_C0_BITS [3/3]

#define HIST_C0_BITS   5 /* bits of precision in R/B histogram */

◆ HIST_C0_ELEMS [1/3]

#define HIST_C0_ELEMS   (1<<HIST_C0_BITS)

◆ HIST_C0_ELEMS [2/3]

#define HIST_C0_ELEMS   (1<<HIST_C0_BITS)

◆ HIST_C0_ELEMS [3/3]

#define HIST_C0_ELEMS   (1<<HIST_C0_BITS)

◆ HIST_C1_BITS [1/3]

#define HIST_C1_BITS   6 /* bits of precision in G histogram */

◆ HIST_C1_BITS [2/3]

#define HIST_C1_BITS   6 /* bits of precision in G histogram */

◆ HIST_C1_BITS [3/3]

#define HIST_C1_BITS   6 /* bits of precision in G histogram */

◆ HIST_C1_ELEMS [1/3]

#define HIST_C1_ELEMS   (1<<HIST_C1_BITS)

◆ HIST_C1_ELEMS [2/3]

#define HIST_C1_ELEMS   (1<<HIST_C1_BITS)

◆ HIST_C1_ELEMS [3/3]

#define HIST_C1_ELEMS   (1<<HIST_C1_BITS)

◆ HIST_C2_BITS [1/3]

#define HIST_C2_BITS   5 /* bits of precision in B/R histogram */

◆ HIST_C2_BITS [2/3]

#define HIST_C2_BITS   5 /* bits of precision in B/R histogram */

◆ HIST_C2_BITS [3/3]

#define HIST_C2_BITS   5 /* bits of precision in B/R histogram */

◆ HIST_C2_ELEMS [1/3]

#define HIST_C2_ELEMS   (1<<HIST_C2_BITS)

◆ HIST_C2_ELEMS [2/3]

#define HIST_C2_ELEMS   (1<<HIST_C2_BITS)

◆ HIST_C2_ELEMS [3/3]

#define HIST_C2_ELEMS   (1<<HIST_C2_BITS)

◆ JPEG_INTERNALS [1/3]

#define JPEG_INTERNALS

◆ JPEG_INTERNALS [2/3]

#define JPEG_INTERNALS

◆ JPEG_INTERNALS [3/3]

#define JPEG_INTERNALS

◆ MAXNUMCOLORS [1/3]

#define MAXNUMCOLORS   (MAXJSAMPLE+1) /* maximum size of colormap */

◆ MAXNUMCOLORS [2/3]

#define MAXNUMCOLORS   (MAXJSAMPLE+1) /* maximum size of colormap */

◆ MAXNUMCOLORS [3/3]

#define MAXNUMCOLORS   (MAXJSAMPLE+1) /* maximum size of colormap */

◆ R_SCALE [1/3]

#define R_SCALE   2 /* scale R distances by this much */

◆ R_SCALE [2/3]

#define R_SCALE   2 /* scale R distances by this much */

◆ R_SCALE [3/3]

#define R_SCALE   2 /* scale R distances by this much */

◆ STEP_C0 [1/3]

#define STEP_C0   ((1 << C0_SHIFT) * C0_SCALE)

◆ STEP_C0 [2/3]

#define STEP_C0   ((1 << C0_SHIFT) * C0_SCALE)

◆ STEP_C0 [3/3]

#define STEP_C0   ((1 << C0_SHIFT) * C0_SCALE)

◆ STEP_C1 [1/3]

#define STEP_C1   ((1 << C1_SHIFT) * C1_SCALE)

◆ STEP_C1 [2/3]

#define STEP_C1   ((1 << C1_SHIFT) * C1_SCALE)

◆ STEP_C1 [3/3]

#define STEP_C1   ((1 << C1_SHIFT) * C1_SCALE)

◆ STEP_C2 [1/3]

#define STEP_C2   ((1 << C2_SHIFT) * C2_SCALE)

◆ STEP_C2 [2/3]

#define STEP_C2   ((1 << C2_SHIFT) * C2_SCALE)

◆ STEP_C2 [3/3]

#define STEP_C2   ((1 << C2_SHIFT) * C2_SCALE)

◆ STEPSIZE [1/3]

#define STEPSIZE   ((MAXJSAMPLE+1)/16)

◆ STEPSIZE [2/3]

#define STEPSIZE   ((MAXJSAMPLE+1)/16)

◆ STEPSIZE [3/3]

#define STEPSIZE   ((MAXJSAMPLE+1)/16)

Typedef Documentation

◆ boxptr

typedef box* boxptr

◆ FSERROR

typedef INT16 FSERROR

◆ FSERRPTR

typedef FSERROR FAR* FSERRPTR

◆ hist1d

typedef histcell hist1d[HIST_C2_ELEMS]

◆ hist2d

typedef hist1d FAR* hist2d

◆ hist3d

typedef hist2d* hist3d

◆ histcell

typedef UINT16 histcell

◆ histptr

typedef histcell FAR* histptr

◆ LOCFSERROR

typedef int LOCFSERROR

◆ my_cquantize_ptr2

Function Documentation

◆ compute_color()

compute_color ( j_decompress_ptr  cinfo,
boxptr  boxp,
int  icolor 
)

◆ fill_inverse_cmap()

fill_inverse_cmap ( j_decompress_ptr  cinfo,
int  c0,
int  c1,
int  c2 
)

◆ find_best_colors()

find_best_colors ( j_decompress_ptr  cinfo,
int  minc0,
int  minc1,
int  minc2,
int  numcolors,
JSAMPLE  colorlist[],
JSAMPLE  bestcolor[] 
)

◆ find_biggest_color_pop()

find_biggest_color_pop ( boxptr  boxlist,
int  numboxes 
)

◆ find_biggest_volume()

find_biggest_volume ( boxptr  boxlist,
int  numboxes 
)

◆ find_nearby_colors()

find_nearby_colors ( j_decompress_ptr  cinfo,
int  minc0,
int  minc1,
int  minc2,
JSAMPLE  colorlist[] 
)

◆ finish_pass1()

finish_pass1 ( j_decompress_ptr  cinfo)

◆ finish_pass2()

finish_pass2 ( j_decompress_ptr  )

◆ init_error_limit()

init_error_limit ( j_decompress_ptr  cinfo)

◆ jinit_2pass_quantizer()

jinit_2pass_quantizer ( j_decompress_ptr  cinfo)

◆ median_cut()

median_cut ( j_decompress_ptr  cinfo,
boxptr  boxlist,
int  numboxes,
int  desired_colors 
)

◆ new_color_map_2_quant()

new_color_map_2_quant ( j_decompress_ptr  cinfo)

◆ pass2_fs_dither()

pass2_fs_dither ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)

◆ pass2_no_dither()

pass2_no_dither ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)

◆ prescan_quantize()

prescan_quantize ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  ,
int  num_rows 
)

◆ select_colors()

select_colors ( j_decompress_ptr  cinfo,
int  desired_colors 
)

◆ start_pass_2_quant()

start_pass_2_quant ( j_decompress_ptr  cinfo,
boolean  is_pre_scan 
)

◆ update_box()

update_box ( j_decompress_ptr  cinfo,
boxptr  boxp 
)