Select Git revision
configuration.h
jdcoefct.c 11.91 KiB
/*
* jdcoefct.c
*
* Copyright (C) 1994, 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.
*
* This file contains the coefficient buffer controller for decompression.
* This controller is the top level of the JPEG decompressor proper.
* The coefficient buffer lies between entropy decoding and inverse-DCT steps.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* Private buffer controller object */
typedef struct {
struct jpeg_d_coef_controller pub; /* public fields */
JDIMENSION MCU_col_num; /* saves next MCU column to process */
JDIMENSION MCU_row_num; /* keep track of MCU row # within image */
/* In single-pass modes without block smoothing, it's sufficient to buffer
* just one MCU (although this may prove a bit slow in practice).
* We allocate a workspace of MAX_BLOCKS_IN_MCU coefficient blocks,
* and let the entropy decoder write into that workspace each time.
* (On 80x86, the workspace is FAR even though it's not really very big;
* this is to keep the module interfaces unchanged when a large coefficient
* buffer is necessary.)
* In multi-pass modes, this array points to the current MCU's blocks
* within the virtual arrays.
*/
JBLOCKROW MCU_buffer[MAX_BLOCKS_IN_MCU];
/* In multi-pass modes, we need a virtual block array for each component. */
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
} my_coef_controller;
typedef my_coef_controller * my_coef_ptr;
/* Forward declarations */
METHODDEF boolean decompress_data
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#ifdef D_MULTISCAN_FILES_SUPPORTED
METHODDEF boolean decompress_read
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
METHODDEF boolean decompress_output
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#endif
/*
* Initialize for a processing pass.
*/
METHODDEF void
start_pass_coef (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
coef->MCU_col_num = 0;
coef->MCU_row_num = 0;
switch (pass_mode) {
case JBUF_PASS_THRU:
if (coef->whole_image[0] != NULL)