/* Get top-level space for component array pointers.
* We alloc both arrays with one call to save a few cycles.
*/
/* Get top-level space for component array pointers.
* We alloc both arrays with one call to save a few cycles.
*/
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
xbuf += rgroup; /* want one row group at negative offsets */
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
xbuf += rgroup; /* want one row group at negative offsets */
LOCAL(void)
make_funny_pointers (j_decompress_ptr cinfo)
/* Create the funny pointer lists discussed in the comments above.
LOCAL(void)
make_funny_pointers (j_decompress_ptr cinfo)
/* Create the funny pointer lists discussed in the comments above.
* and the space for the pointer lists is allocated too.
* This routine just fills in the curiously ordered lists.
* This will be repeated at the beginning of each pass.
*/
{
* and the space for the pointer lists is allocated too.
* This routine just fills in the curiously ordered lists.
* This will be repeated at the beginning of each pass.
*/
{
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
for (i = 0; i < rgroup; i++) {
xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
for (i = 0; i < rgroup; i++) {
xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
int ci, i, rgroup, iMCUheight, rows_left;
jpeg_component_info *compptr;
JSAMPARRAY xbuf;
int ci, i, rgroup, iMCUheight, rows_left;
jpeg_component_info *compptr;
JSAMPARRAY xbuf;
}
/* Duplicate the last real sample row rgroup*2 times; this pads out the
* last partial rowgroup and ensures at least one full rowgroup of context.
*/
}
/* Duplicate the last real sample row rgroup*2 times; this pads out the
* last partial rowgroup and ensures at least one full rowgroup of context.
*/
- main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
- main->context_state = CTX_PREPARE_FOR_IMCU;
- main->iMCU_row_ctr = 0;
+ mainPtr->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
+ mainPtr->context_state = CTX_PREPARE_FOR_IMCU;
+ mainPtr->iMCU_row_ctr = 0;
break;
#ifdef QUANT_2PASS_SUPPORTED
case JBUF_CRANK_DEST:
/* For last pass of 2-pass quantization, just crank the postprocessor */
break;
#ifdef QUANT_2PASS_SUPPORTED
case JBUF_CRANK_DEST:
/* For last pass of 2-pass quantization, just crank the postprocessor */
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
- if (! main->buffer_full) {
- if (! (*cinfo->codec->decompress_data) (cinfo, main->buffer))
+ if (! mainPtr->buffer_full) {
+ if (! (*cinfo->codec->decompress_data) (cinfo, mainPtr->buffer))
- (*cinfo->post->post_process_data) (cinfo, main->buffer,
- &main->rowgroup_ctr, rowgroups_avail,
+ (*cinfo->post->post_process_data) (cinfo, mainPtr->buffer,
+ &mainPtr->rowgroup_ctr, rowgroups_avail,
output_buf, out_row_ctr, out_rows_avail);
/* Has postprocessor consumed all the data yet? If so, mark buffer empty */
output_buf, out_row_ctr, out_rows_avail);
/* Has postprocessor consumed all the data yet? If so, mark buffer empty */
- if (main->rowgroup_ctr >= rowgroups_avail) {
- main->buffer_full = FALSE;
- main->rowgroup_ctr = 0;
+ if (mainPtr->rowgroup_ctr >= rowgroups_avail) {
+ mainPtr->buffer_full = FALSE;
+ mainPtr->rowgroup_ctr = 0;
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
- main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
- main->iMCU_row_ctr++; /* count rows received */
+ mainPtr->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
+ mainPtr->iMCU_row_ctr++; /* count rows received */
* to exit and restart. This switch lets us keep track of how far we got.
* Note that each case falls through to the next on successful completion.
*/
* to exit and restart. This switch lets us keep track of how far we got.
* Note that each case falls through to the next on successful completion.
*/
- (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
- &main->rowgroup_ctr, main->rowgroups_avail,
+ (*cinfo->post->post_process_data) (cinfo, mainPtr->xbuffer[mainPtr->whichptr],
+ &mainPtr->rowgroup_ctr, mainPtr->rowgroups_avail,
if (*out_row_ctr >= out_rows_avail)
return; /* Postprocessor exactly filled output buf */
/*FALLTHROUGH*/
case CTX_PREPARE_FOR_IMCU:
/* Prepare to process first M-1 row groups of this iMCU row */
if (*out_row_ctr >= out_rows_avail)
return; /* Postprocessor exactly filled output buf */
/*FALLTHROUGH*/
case CTX_PREPARE_FOR_IMCU:
/* Prepare to process first M-1 row groups of this iMCU row */
- main->rowgroup_ctr = 0;
- main->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit - 1);
+ mainPtr->rowgroup_ctr = 0;
+ mainPtr->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit - 1);
/* Check for bottom of image: if so, tweak pointers to "duplicate"
* the last sample row, and adjust rowgroups_avail to ignore padding rows.
*/
/* Check for bottom of image: if so, tweak pointers to "duplicate"
* the last sample row, and adjust rowgroups_avail to ignore padding rows.
*/
- (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
- &main->rowgroup_ctr, main->rowgroups_avail,
+ (*cinfo->post->post_process_data) (cinfo, mainPtr->xbuffer[mainPtr->whichptr],
+ &mainPtr->rowgroup_ctr, mainPtr->rowgroups_avail,
return; /* Need to suspend */
/* After the first iMCU, change wraparound pointers to normal state */
return; /* Need to suspend */
/* After the first iMCU, change wraparound pointers to normal state */
/* Still need to process last row group of this iMCU row, */
/* which is saved at index M+1 of the other xbuffer */
/* Still need to process last row group of this iMCU row, */
/* which is saved at index M+1 of the other xbuffer */
- main->rowgroup_ctr = (JDIMENSION) (cinfo->min_codec_data_unit + 1);
- main->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit + 2);
- main->context_state = CTX_POSTPONED_ROW;
+ mainPtr->rowgroup_ctr = (JDIMENSION) (cinfo->min_codec_data_unit + 1);
+ mainPtr->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit + 2);
+ mainPtr->context_state = CTX_POSTPONED_ROW;
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_main_controller));
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_main_controller));
if (need_full_buffer) /* shouldn't happen */
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
if (need_full_buffer) /* shouldn't happen */
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
ci++, compptr++) {
rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /
cinfo->min_codec_data_unit; /* height of a row group of component */
((j_common_ptr) cinfo, JPOOL_IMAGE,
compptr->width_in_data_units * compptr->codec_data_unit,
(JDIMENSION) (rgroup * ngroups));
((j_common_ptr) cinfo, JPOOL_IMAGE,
compptr->width_in_data_units * compptr->codec_data_unit,
(JDIMENSION) (rgroup * ngroups));