summaryrefslogtreecommitdiff
path: root/jcparam.c
diff options
context:
space:
mode:
authorThomas G. Lane <tgl@netcom.com>1996-02-07 00:00:00 +0000
committerDRC <information@libjpeg-turbo.org>2015-07-29 15:32:35 -0500
commit489583f5165e05d37302e8eeec58104ea0109127 (patch)
treeaf025016f71386106390afe4db314878cd42c6b5 /jcparam.c
parentbc79e0680a45d1ca330d690dae0340c8e17ab5e3 (diff)
The Independent JPEG Group's JPEG software v6a
Diffstat (limited to 'jcparam.c')
-rw-r--r--jcparam.c63
1 files changed, 31 insertions, 32 deletions
diff --git a/jcparam.c b/jcparam.c
index 29862d3..54871d5 100644
--- a/jcparam.c
+++ b/jcparam.c
@@ -1,7 +1,7 @@
/*
* jcparam.c
*
- * Copyright (C) 1991-1995, Thomas G. Lane.
+ * Copyright (C) 1991-1996, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -19,7 +19,7 @@
* Quantization table setup routines
*/
-GLOBAL void
+GLOBAL(void)
jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
const unsigned int *basic_table,
int scale_factor, boolean force_baseline)
@@ -55,7 +55,7 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
}
-GLOBAL void
+GLOBAL(void)
jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
boolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables
@@ -64,31 +64,30 @@ jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
* applications that insist on a linear percentage scaling.
*/
{
- /* This is the sample quantization table given in the JPEG spec section K.1,
- * but expressed in zigzag order (as are all of our quant. tables).
+ /* These are the sample quantization tables given in JPEG spec section K.1.
* The spec says that the values given produce "good" quality, and
* when divided by 2, "very good" quality.
*/
static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
- 16, 11, 12, 14, 12, 10, 16, 14,
- 13, 14, 18, 17, 16, 19, 24, 40,
- 26, 24, 22, 22, 24, 49, 35, 37,
- 29, 40, 58, 51, 61, 60, 57, 51,
- 56, 55, 64, 72, 92, 78, 64, 68,
- 87, 69, 55, 56, 80, 109, 81, 87,
- 95, 98, 103, 104, 103, 62, 77, 113,
- 121, 112, 100, 120, 92, 101, 103, 99
- };
+ 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
+ };
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
- 17, 18, 18, 24, 21, 24, 47, 26,
- 26, 47, 99, 66, 56, 66, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
+ 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
- };
+ };
/* Set up two quantization tables using the specified scaling */
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
@@ -98,7 +97,7 @@ jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
}
-GLOBAL int
+GLOBAL(int)
jpeg_quality_scaling (int quality)
/* Convert a user-specified quality rating to a percentage scaling factor
* for an underlying quantization table, using our recommended scaling curve.
@@ -111,8 +110,8 @@ jpeg_quality_scaling (int quality)
/* The basic table is used as-is (scaling 100) for a quality of 50.
* Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
- * note that at Q=100 the scaling is 0, which will cause j_add_quant_table
- * to make all the table entries 1 (hence, no quantization loss).
+ * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
+ * to make all the table entries 1 (hence, minimum quantization loss).
* Qualities 1..50 are converted to scaling percentage 5000/Q.
*/
if (quality < 50)
@@ -124,7 +123,7 @@ jpeg_quality_scaling (int quality)
}
-GLOBAL void
+GLOBAL(void)
jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables.
* This is the standard quality-adjusting entry point for typical user
@@ -144,7 +143,7 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
* Huffman table setup routines
*/
-LOCAL void
+LOCAL(void)
add_huff_table (j_compress_ptr cinfo,
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
/* Define a Huffman table */
@@ -160,7 +159,7 @@ add_huff_table (j_compress_ptr cinfo,
}
-LOCAL void
+LOCAL(void)
std_huff_tables (j_compress_ptr cinfo)
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
/* IMPORTANT: these are only valid for 8-bit data precision! */
@@ -246,7 +245,7 @@ std_huff_tables (j_compress_ptr cinfo)
* your code will still work (they'll be set to reasonable defaults).
*/
-GLOBAL void
+GLOBAL(void)
jpeg_set_defaults (j_compress_ptr cinfo)
{
int i;
@@ -329,7 +328,7 @@ jpeg_set_defaults (j_compress_ptr cinfo)
* Select an appropriate JPEG colorspace for in_color_space.
*/
-GLOBAL void
+GLOBAL(void)
jpeg_default_colorspace (j_compress_ptr cinfo)
{
switch (cinfo->in_color_space) {
@@ -361,7 +360,7 @@ jpeg_default_colorspace (j_compress_ptr cinfo)
* Set the JPEG colorspace, and choose colorspace-dependent default values.
*/
-GLOBAL void
+GLOBAL(void)
jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
{
jpeg_component_info * compptr;
@@ -445,7 +444,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
#ifdef C_PROGRESSIVE_SUPPORTED
-LOCAL jpeg_scan_info *
+LOCAL(jpeg_scan_info *)
fill_a_scan (jpeg_scan_info * scanptr, int ci,
int Ss, int Se, int Ah, int Al)
/* Support routine: generate one scan for specified component */
@@ -460,7 +459,7 @@ fill_a_scan (jpeg_scan_info * scanptr, int ci,
return scanptr;
}
-LOCAL jpeg_scan_info *
+LOCAL(jpeg_scan_info *)
fill_scans (jpeg_scan_info * scanptr, int ncomps,
int Ss, int Se, int Ah, int Al)
/* Support routine: generate one scan for each component */
@@ -479,7 +478,7 @@ fill_scans (jpeg_scan_info * scanptr, int ncomps,
return scanptr;
}
-LOCAL jpeg_scan_info *
+LOCAL(jpeg_scan_info *)
fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
/* Support routine: generate interleaved DC scan if possible, else N scans */
{
@@ -507,7 +506,7 @@ fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
* cinfo->num_components and cinfo->jpeg_color_space must be correct.
*/
-GLOBAL void
+GLOBAL(void)
jpeg_simple_progression (j_compress_ptr cinfo)
{
int ncomps = cinfo->num_components;