Reconcile indentation, whitespace, and other code formatting with libjpeg-turbo.
For whatever reason, some of these files didn't get fully merged from libjpeg-turbo 1.4. They still contained tab characters and other formatting conventions from libjpeg-turbo 1.3. This patch also fixes some obvious indentation errors in the mozjpeg-specific code. There is more formatting work that needs to be done to the mozjpeg-specific code, to fix line overruns, incorrect operator whitespace, and other issues that make it not consistent with the libjpeg/libjpeg-turbo code.
This commit is contained in:
3
cjpeg.c
3
cjpeg.c
@@ -753,7 +753,8 @@ main (int argc, char **argv)
|
||||
GETJOCTET(marker->data[3]) == 0x62 &&
|
||||
GETJOCTET(marker->data[4]) == 0x65)
|
||||
continue; /* reject duplicate Adobe */
|
||||
jpeg_write_marker(&cinfo, marker->marker, marker->data, marker->data_length);
|
||||
jpeg_write_marker(&cinfo, marker->marker, marker->data,
|
||||
marker->data_length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "jpeglib.h"
|
||||
#include "jchuff.h"
|
||||
|
||||
|
||||
/* We use a full-image coefficient buffer when doing Huffman optimization,
|
||||
* and also for writing multiple-scan JPEG files. In all cases, the DCT
|
||||
* step is run during the first pass, and subsequent passes need only read
|
||||
@@ -190,7 +191,8 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
|
||||
input_buf[compptr->component_index],
|
||||
coef->MCU_buffer[blkn],
|
||||
ypos, xpos, (JDIMENSION) blockcnt, NULL);
|
||||
ypos, xpos, (JDIMENSION) blockcnt,
|
||||
NULL);
|
||||
if (blockcnt < compptr->MCU_width) {
|
||||
/* Create some dummy blocks at the right edge of the image. */
|
||||
jzero_far((void *) coef->MCU_buffer[blkn + blockcnt],
|
||||
@@ -302,7 +304,8 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
|
||||
input_buf[ci], thisblockrow,
|
||||
(JDIMENSION) (block_row * DCTSIZE),
|
||||
(JDIMENSION) 0, blocks_across, buffer_dst[block_row]);
|
||||
(JDIMENSION) 0, blocks_across,
|
||||
buffer_dst[block_row]);
|
||||
if (ndummy > 0) {
|
||||
/* Create dummy blocks at the right edge of the image. */
|
||||
thisblockrow += blocks_across; /* => first dummy block */
|
||||
@@ -503,7 +506,6 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to write the MCU. */
|
||||
if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
/* Private subobject for this module */
|
||||
|
||||
typedef void (*forward_DCT_method_ptr) (DCTELEM * data);
|
||||
|
||||
@@ -121,7 +121,7 @@ jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
|
||||
cinfo->q_scale_factor[0], force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
|
||||
cinfo->q_scale_factor[1], force_baseline);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -146,7 +146,7 @@ jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
|
||||
scale_factor, force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
|
||||
scale_factor, force_baseline);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -806,8 +806,7 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
|
||||
scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* C_PROGRESSIVE_SUPPORTED */
|
||||
|
||||
@@ -177,7 +177,7 @@ start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
|
||||
int i, j;
|
||||
for (i = 0; i < 16; i++)
|
||||
for (j = 0; j < 12; j++)
|
||||
entropy->count_ptrs[tbl][16*i+j] = 1;
|
||||
entropy->count_ptrs[tbl][16 * i + j] = 1;
|
||||
}
|
||||
} else {
|
||||
/* Compute derived values for Huffman table */
|
||||
|
||||
@@ -25,7 +25,6 @@ typedef enum { /* Operating modes for buffer controllers */
|
||||
JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
|
||||
JBUF_SAVE_AND_PASS, /* Run both subobjects, save output */
|
||||
JBUF_REQUANT /* Requantize */
|
||||
|
||||
} J_BUF_MODE;
|
||||
|
||||
/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
|
||||
|
||||
Reference in New Issue
Block a user