ReactOS  0.4.15-dev-492-ga1108f6
jcparam.c File Reference
#include "jinclude.h"
#include "jpeglib.h"
Include dependency graph for jcparam.c:

Go to the source code of this file.

Macros

#define JPEG_INTERNALS
 
#define SET_COMP(index, id, hsamp, vsamp, quant, dctbl, actbl)
 

Functions

 jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline)
 
 jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
 
 jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, boolean force_baseline)
 
 jpeg_quality_scaling (int quality)
 
 jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
 
 std_huff_tables (j_compress_ptr cinfo)
 
 jpeg_set_defaults (j_compress_ptr cinfo)
 
 jpeg_default_colorspace (j_compress_ptr cinfo)
 
 jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
 

Variables

static const unsigned int std_luminance_quant_tbl [DCTSIZE2]
 
static const unsigned int std_chrominance_quant_tbl [DCTSIZE2]
 

Macro Definition Documentation

◆ JPEG_INTERNALS

#define JPEG_INTERNALS

Definition at line 14 of file jcparam.c.

◆ SET_COMP

#define SET_COMP (   index,
  id,
  hsamp,
  vsamp,
  quant,
  dctbl,
  actbl 
)
Value:
(compptr = &cinfo->comp_info[index], \
compptr->component_id = (id), \
compptr->h_samp_factor = (hsamp), \
compptr->v_samp_factor = (vsamp), \
compptr->quant_tbl_no = (quant), \
compptr->dc_tbl_no = (dctbl), \
compptr->ac_tbl_no = (actbl) )
jpeg_component_info * compptr
Definition: jdct.h:238
#define index(s, c)
Definition: various.h:29
GLenum GLuint id
Definition: glext.h:5579

Function Documentation

◆ jpeg_add_quant_table()

jpeg_add_quant_table ( j_compress_ptr  cinfo,
int  which_tbl,
const unsigned int basic_table,
int  scale_factor,
boolean  force_baseline 
)

Definition at line 24 of file jcparam.c.

32 {
33  JQUANT_TBL ** qtblptr;
34  int i;
35  long temp;
36 
37  /* Safety check to ensure start_compress not called yet. */
38  if (cinfo->global_state != CSTATE_START)
39  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
40 
41  if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
42  ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
43 
44  qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];
45 
46  if (*qtblptr == NULL)
47  *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);
48 
49  for (i = 0; i < DCTSIZE2; i++) {
50  temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;
51  /* limit the values to the valid range */
52  if (temp <= 0L) temp = 1L;
53  if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
54  if (force_baseline && temp > 255L)
55  temp = 255L; /* limit to baseline range if requested */
56  (*qtblptr)->quantval[i] = (UINT16) temp;
57  }
58 
59  /* Initialize sent_table FALSE so table will be written to JPEG file. */
60  (*qtblptr)->sent_table = FALSE;
61 }
char boolean force_baseline
Definition: cdjpeg.h:136
#define CSTATE_START
Definition: jpegint.h:26
#define NUM_QUANT_TBLS
Definition: jpeglib.h:52
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int const unsigned int * basic_table
Definition: jpeglib.h:999
smooth NULL
Definition: ftsmooth.c:416
#define DCTSIZE2
Definition: jpeglib.h:51
int which_tbl
Definition: jpeglib.h:999
static const WCHAR L[]
Definition: oid.c:1250
#define ERREXIT1(cinfo, code, p1)
Definition: jerror.h:212
jpeg_alloc_quant_table(j_common_ptr cinfo)
Definition: jcomapi.c:87
JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]
Definition: jpeglib.h:336
static calc_node_t temp
Definition: rpn_ieee.c:38
#define long
Definition: qsort.c:33
unsigned short UINT16
int scale_factor
Definition: jpeglib.h:995

Referenced by jpeg_default_qtables(), jpeg_set_linear_quality(), and read_quant_tables().

◆ jpeg_default_colorspace()

jpeg_default_colorspace ( j_compress_ptr  cinfo)

Definition at line 297 of file jcparam.c.

298 {
299  switch (cinfo->in_color_space) {
300  case JCS_UNKNOWN:
302  break;
303  case JCS_GRAYSCALE:
305  break;
306  case JCS_RGB:
308  break;
309  case JCS_YCbCr:
311  break;
312  case JCS_CMYK:
313  jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
314  break;
315  case JCS_YCCK:
317  break;
318  case JCS_BG_RGB:
319  /* No translation for now -- conversion to BG_YCC not yet supportet */
321  break;
322  case JCS_BG_YCC:
324  break;
325  default:
326  ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
327  }
328 }
#define ERREXIT(msg)
Definition: rdjpgcom.c:72
J_COLOR_SPACE in_color_space
Definition: jpeglib.h:305
jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
Definition: jcparam.c:336

Referenced by jpeg_set_defaults(), and main().

◆ jpeg_default_qtables()

jpeg_default_qtables ( j_compress_ptr  cinfo,
boolean  force_baseline 
)

Definition at line 91 of file jcparam.c.

96 {
97  /* Set up two quantization tables using the specified scaling */
99  cinfo->q_scale_factor[0], force_baseline);
101  cinfo->q_scale_factor[1], force_baseline);
102 }
char boolean force_baseline
Definition: cdjpeg.h:136
jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline)
Definition: jcparam.c:24
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2]
Definition: jcparam.c:78
int q_scale_factor[NUM_QUANT_TBLS]
Definition: jpeglib.h:337
static const unsigned int std_luminance_quant_tbl[DCTSIZE2]
Definition: jcparam.c:68

Referenced by set_quality_ratings().

◆ jpeg_quality_scaling()

jpeg_quality_scaling ( int  quality)

Definition at line 123 of file jcparam.c.

128 {
129  /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */
130  if (quality <= 0) quality = 1;
131  if (quality > 100) quality = 100;
132 
133  /* The basic table is used as-is (scaling 100) for a quality of 50.
134  * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
135  * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
136  * to make all the table entries 1 (hence, minimum quantization loss).
137  * Qualities 1..50 are converted to scaling percentage 5000/Q.
138  */
139  if (quality < 50)
140  quality = 5000 / quality;
141  else
142  quality = 200 - quality*2;
143 
144  return quality;
145 }
int quality
Definition: jpeglib.h:992

Referenced by jpeg_set_quality(), and set_quality_ratings().

◆ jpeg_set_colorspace()

jpeg_set_colorspace ( j_compress_ptr  cinfo,
J_COLOR_SPACE  colorspace 
)

Definition at line 336 of file jcparam.c.

337 {
339  int ci;
340 
341 #define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \
342  (compptr = &cinfo->comp_info[index], \
343  compptr->component_id = (id), \
344  compptr->h_samp_factor = (hsamp), \
345  compptr->v_samp_factor = (vsamp), \
346  compptr->quant_tbl_no = (quant), \
347  compptr->dc_tbl_no = (dctbl), \
348  compptr->ac_tbl_no = (actbl) )
349 
350  /* Safety check to ensure start_compress not called yet. */
351  if (cinfo->global_state != CSTATE_START)
352  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
353 
354  /* For all colorspaces, we use Q and Huff tables 0 for luminance components,
355  * tables 1 for chrominance components.
356  */
357 
358  cinfo->jpeg_color_space = colorspace;
359 
360  cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
361  cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
362 
363  switch (colorspace) {
364  case JCS_UNKNOWN:
365  cinfo->num_components = cinfo->input_components;
366  if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
367  ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
369  for (ci = 0; ci < cinfo->num_components; ci++) {
370  SET_COMP(ci, ci, 1,1, 0, 0,0);
371  }
372  break;
373  case JCS_GRAYSCALE:
374  cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
375  cinfo->num_components = 1;
376  /* JFIF specifies component ID 1 */
377  SET_COMP(0, 0x01, 1,1, 0, 0,0);
378  break;
379  case JCS_RGB:
380  cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
381  cinfo->num_components = 3;
382  SET_COMP(0, 0x52 /* 'R' */, 1,1, 0,
383  cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
384  cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
385  SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
386  SET_COMP(2, 0x42 /* 'B' */, 1,1, 0,
387  cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
388  cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
389  break;
390  case JCS_YCbCr:
391  cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
392  cinfo->num_components = 3;
393  /* JFIF specifies component IDs 1,2,3 */
394  /* We default to 2x2 subsamples of chrominance */
395  SET_COMP(0, 0x01, 2,2, 0, 0,0);
396  SET_COMP(1, 0x02, 1,1, 1, 1,1);
397  SET_COMP(2, 0x03, 1,1, 1, 1,1);
398  break;
399  case JCS_CMYK:
400  cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
401  cinfo->num_components = 4;
402  SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);
403  SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);
404  SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);
405  SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);
406  break;
407  case JCS_YCCK:
408  cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
409  cinfo->num_components = 4;
410  SET_COMP(0, 0x01, 2,2, 0, 0,0);
411  SET_COMP(1, 0x02, 1,1, 1, 1,1);
412  SET_COMP(2, 0x03, 1,1, 1, 1,1);
413  SET_COMP(3, 0x04, 2,2, 0, 0,0);
414  break;
415  case JCS_BG_RGB:
416  cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
417  cinfo->JFIF_major_version = 2; /* Set JFIF major version = 2 */
418  cinfo->num_components = 3;
419  /* Add offset 0x20 to the normal R/G/B component IDs */
420  SET_COMP(0, 0x72 /* 'r' */, 1,1, 0,
421  cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
422  cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
423  SET_COMP(1, 0x67 /* 'g' */, 1,1, 0, 0,0);
424  SET_COMP(2, 0x62 /* 'b' */, 1,1, 0,
425  cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
426  cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
427  break;
428  case JCS_BG_YCC:
429  cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
430  cinfo->JFIF_major_version = 2; /* Set JFIF major version = 2 */
431  cinfo->num_components = 3;
432  /* Add offset 0x20 to the normal Cb/Cr component IDs */
433  /* We default to 2x2 subsamples of chrominance */
434  SET_COMP(0, 0x01, 2,2, 0, 0,0);
435  SET_COMP(1, 0x22, 1,1, 1, 1,1);
436  SET_COMP(2, 0x23, 1,1, 1, 1,1);
437  break;
438  default:
439  ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
440  }
441 }
boolean write_Adobe_marker
Definition: jpeglib.h:385
J_COLOR_TRANSFORM color_transform
Definition: jpeglib.h:387
#define TRUE
Definition: types.h:120
#define CSTATE_START
Definition: jpegint.h:26
#define ERREXIT(msg)
Definition: rdjpgcom.c:72
UINT8 JFIF_major_version
Definition: jpeglib.h:376
J_COLOR_SPACE jpeg_color_space
Definition: jpeglib.h:331
#define MAX_COMPONENTS
Definition: jmorecfg.h:45
boolean write_JFIF_header
Definition: jpeglib.h:375
jpeg_component_info * compptr
Definition: jdct.h:238
#define ERREXIT1(cinfo, code, p1)
Definition: jerror.h:212
J_COLOR_SPACE colorspace
Definition: jpeglib.h:990
#define ERREXIT2(cinfo, code, p1, p2)
Definition: jerror.h:216
#define SET_COMP(index, id, hsamp, vsamp, quant, dctbl, actbl)

Referenced by jpeg_copy_critical_parameters(), jpeg_default_colorspace(), and parse_switches().

◆ jpeg_set_defaults()

jpeg_set_defaults ( j_compress_ptr  cinfo)

Definition at line 196 of file jcparam.c.

197 {
198  int i;
199 
200  /* Safety check to ensure start_compress not called yet. */
201  if (cinfo->global_state != CSTATE_START)
202  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
203 
204  /* Allocate comp_info array large enough for maximum component count.
205  * Array is made permanent in case application wants to compress
206  * multiple images at same param settings.
207  */
208  if (cinfo->comp_info == NULL)
209  cinfo->comp_info = (jpeg_component_info *)
210  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
212 
213  /* Initialize everything not dependent on the color space */
214 
215  cinfo->scale_num = 1; /* 1:1 scaling */
216  cinfo->scale_denom = 1;
218  /* Set up two quantization tables using default quality of 75 */
219  jpeg_set_quality(cinfo, 75, TRUE);
220  /* Reset standard Huffman tables */
221  std_huff_tables(cinfo);
222 
223  /* Initialize default arithmetic coding conditioning */
224  for (i = 0; i < NUM_ARITH_TBLS; i++) {
225  cinfo->arith_dc_L[i] = 0;
226  cinfo->arith_dc_U[i] = 1;
227  cinfo->arith_ac_K[i] = 5;
228  }
229 
230  /* Default is no multiple-scan output */
231  cinfo->scan_info = NULL;
232  cinfo->num_scans = 0;
233 
234  /* Expect normal source image, not raw downsampled data */
235  cinfo->raw_data_in = FALSE;
236 
237  /* The standard Huffman tables are only valid for 8-bit data precision.
238  * If the precision is higher, use arithmetic coding.
239  * (Alternatively, using Huffman coding would be possible with forcing
240  * optimization on so that usable tables will be computed, or by
241  * supplying default tables that are valid for the desired precision.)
242  * Otherwise, use Huffman coding by default.
243  */
244  cinfo->arith_code = cinfo->data_precision > 8 ? TRUE : FALSE;
245 
246  /* By default, don't do extra passes to optimize entropy coding */
247  cinfo->optimize_coding = FALSE;
248 
249  /* By default, use the simpler non-cosited sampling alignment */
250  cinfo->CCIR601_sampling = FALSE;
251 
252  /* By default, apply fancy downsampling */
253  cinfo->do_fancy_downsampling = TRUE;
254 
255  /* No input smoothing */
256  cinfo->smoothing_factor = 0;
257 
258  /* DCT algorithm preference */
259  cinfo->dct_method = JDCT_DEFAULT;
260 
261  /* No restart markers */
262  cinfo->restart_interval = 0;
263  cinfo->restart_in_rows = 0;
264 
265  /* Fill in default JFIF marker parameters. Note that whether the marker
266  * will actually be written is determined by jpeg_set_colorspace.
267  *
268  * By default, the library emits JFIF version code 1.01.
269  * An application that wants to emit JFIF 1.02 extension markers should set
270  * JFIF_minor_version to 2. We could probably get away with just defaulting
271  * to 1.02, but there may still be some decoders in use that will complain
272  * about that; saying 1.01 should minimize compatibility problems.
273  *
274  * For wide gamut colorspaces (BG_RGB and BG_YCC), the major version will be
275  * overridden by jpeg_set_colorspace and set to 2.
276  */
277  cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
278  cinfo->JFIF_minor_version = 1;
279  cinfo->density_unit = 0; /* Pixel size is unknown by default */
280  cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
281  cinfo->Y_density = 1;
282 
283  /* No color transform */
284  cinfo->color_transform = JCT_NONE;
285 
286  /* Choose JPEG colorspace based on input space, set defaults accordingly */
287 
289 }
jpeg_default_colorspace(j_compress_ptr cinfo)
Definition: jcparam.c:297
#define BITS_IN_JSAMPLE
Definition: jmorecfg.h:33
J_COLOR_TRANSFORM color_transform
Definition: jpeglib.h:387
UINT8 arith_ac_K[NUM_ARITH_TBLS]
Definition: jpeglib.h:348
#define TRUE
Definition: types.h:120
#define CSTATE_START
Definition: jpegint.h:26
UINT8 JFIF_major_version
Definition: jpeglib.h:376
struct jpeg_common_struct * j_common_ptr
Definition: jpeglib.h:284
const jpeg_scan_info * scan_info
Definition: jpeglib.h:351
#define MAX_COMPONENTS
Definition: jmorecfg.h:45
#define JDCT_DEFAULT
Definition: jpeglib.h:247
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define SIZEOF(_ar)
Definition: calc.h:97
std_huff_tables(j_compress_ptr cinfo)
Definition: jcparam.c:169
smooth NULL
Definition: ftsmooth.c:416
unsigned int scale_denom
Definition: jpeglib.h:317
UINT8 arith_dc_U[NUM_ARITH_TBLS]
Definition: jpeglib.h:347
UINT8 JFIF_minor_version
Definition: jpeglib.h:377
unsigned int restart_interval
Definition: jpeglib.h:370
#define ERREXIT1(cinfo, code, p1)
Definition: jerror.h:212
boolean arith_code
Definition: jpeglib.h:358
boolean do_fancy_downsampling
Definition: jpeglib.h:361
unsigned int scale_num
Definition: jpeglib.h:317
boolean CCIR601_sampling
Definition: jpeglib.h:360
J_DCT_METHOD dct_method
Definition: jpeglib.h:363
boolean optimize_coding
Definition: jpeglib.h:359
UINT8 arith_dc_L[NUM_ARITH_TBLS]
Definition: jpeglib.h:346
#define NUM_ARITH_TBLS
Definition: jpeglib.h:54
#define JPOOL_PERMANENT
Definition: jpeglib.h:807
boolean raw_data_in
Definition: jpeglib.h:357
jpeg_set_quality(j_compress_ptr cinfo, int quality, boolean force_baseline)
Definition: jcparam.c:149
jpeg_component_info * comp_info
Definition: jpeglib.h:333

Referenced by jpeg_copy_critical_parameters(), main(), and write_JPEG_file().

◆ jpeg_set_linear_quality()

jpeg_set_linear_quality ( j_compress_ptr  cinfo,
int  scale_factor,
boolean  force_baseline 
)

Definition at line 106 of file jcparam.c.

113 {
114  /* Set up two quantization tables using the specified scaling */
119 }
char boolean force_baseline
Definition: cdjpeg.h:136
jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline)
Definition: jcparam.c:24
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2]
Definition: jcparam.c:78
static const unsigned int std_luminance_quant_tbl[DCTSIZE2]
Definition: jcparam.c:68
int scale_factor
Definition: jpeglib.h:995

Referenced by jpeg_set_quality().

◆ jpeg_set_quality()

jpeg_set_quality ( j_compress_ptr  cinfo,
int  quality,
boolean  force_baseline 
)

Definition at line 149 of file jcparam.c.

155 {
156  /* Convert user 0-100 rating to percentage scaling */
158 
159  /* Set up standard quality tables */
161 }
char boolean force_baseline
Definition: cdjpeg.h:136
jpeg_set_linear_quality(j_compress_ptr cinfo, int scale_factor, boolean force_baseline)
Definition: jcparam.c:106
int quality
Definition: jpeglib.h:992
jpeg_quality_scaling(int quality)
Definition: jcparam.c:123

Referenced by jpeg_set_defaults(), and write_JPEG_file().

◆ std_huff_tables()

std_huff_tables ( j_compress_ptr  cinfo)

Definition at line 169 of file jcparam.c.

170 {
171  if (cinfo->dc_huff_tbl_ptrs[0] != NULL)
172  (void) jpeg_std_huff_table((j_common_ptr) cinfo, TRUE, 0);
173 
174  if (cinfo->ac_huff_tbl_ptrs[0] != NULL)
176 
177  if (cinfo->dc_huff_tbl_ptrs[1] != NULL)
178  (void) jpeg_std_huff_table((j_common_ptr) cinfo, TRUE, 1);
179 
180  if (cinfo->ac_huff_tbl_ptrs[1] != NULL)
182 }
#define TRUE
Definition: types.h:120
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]
Definition: jpeglib.h:342
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]
Definition: jpeglib.h:343
smooth NULL
Definition: ftsmooth.c:416
jpeg_std_huff_table(j_common_ptr cinfo, boolean isDC, int tblno)
Definition: jcomapi.c:117

Referenced by jpeg_set_defaults().

Variable Documentation

◆ std_chrominance_quant_tbl

const unsigned int std_chrominance_quant_tbl[DCTSIZE2]
static
Initial value:
= {
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99
}

Definition at line 78 of file jcparam.c.

Referenced by jpeg_default_qtables(), and jpeg_set_linear_quality().

◆ std_luminance_quant_tbl

const unsigned int std_luminance_quant_tbl[DCTSIZE2]
static
Initial value:
= {
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
14, 17, 22, 29, 51, 87, 80, 62,
18, 22, 37, 56, 68, 109, 103, 77,
24, 35, 55, 64, 81, 104, 113, 92,
49, 64, 78, 87, 103, 121, 120, 101,
72, 92, 95, 98, 112, 100, 103, 99
}

Definition at line 68 of file jcparam.c.

Referenced by jpeg_default_qtables(), and jpeg_set_linear_quality().