0N/A * reserved comment block 0N/A * DO NOT REMOVE OR ALTER! 0N/A * Copyright (C) 1995-1997, Thomas G. Lane. 0N/A * This file is part of the Independent JPEG Group's software. 0N/A * For conditions of distribution and use, see the accompanying README file. 0N/A * This file contains library routines for transcoding decompression, 0N/A * that is, reading raw DCT coefficient arrays from an input JPEG file. 0N/A * The routines in jdapimin.c will also be needed by a transcoder. 0N/A/* Forward declarations */ 0N/A * Read the coefficient arrays from a JPEG file. 0N/A * jpeg_read_header must be completed before calling this. 0N/A * The entire image is read into a set of virtual coefficient-block arrays, 0N/A * one per component. The return value is a pointer to the array of 0N/A * virtual-array descriptors. These can be manipulated directly via the 0N/A * JPEG memory manager, or handed off to jpeg_write_coefficients(). 0N/A * To release the memory occupied by the virtual arrays, call 0N/A * jpeg_finish_decompress() when done with the data. 0N/A * An alternative usage is to simply obtain access to the coefficient arrays 0N/A * during a buffered-image-mode decompression operation. This is allowed 0N/A * after any jpeg_finish_output() call. The arrays can be accessed until 0N/A * jpeg_finish_decompress() is called. (Note that any call to the library 0N/A * may reposition the arrays, so don't rely on access_virt_barray() results 0N/A * to stay valid across library calls.) 0N/A * Returns NULL if suspended. This case need be checked only if 0N/A * a suspending data source is used. 0N/A /* First call: initialize active modules */ 0N/A /* Absorb whole file into the coef buffer */ 0N/A /* Call progress monitor hook if present */ 0N/A /* Absorb some more input */ 0N/A /* Advance progress counter if appropriate */ 0N/A /* startup underestimated number of scans; ratchet up one scan */ 0N/A /* Set state so that jpeg_finish_decompress does the right thing */ 0N/A /* At this point we should be in state DSTATE_STOPPING if being used 0N/A * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access 0N/A * to the coefficients during a full buffered-image-mode decompression. 0N/A /* Oops, improper usage */ 0N/A return NULL;
/* keep compiler happy */ 0N/A * Master selection of decompression modules for transcoding. 0N/A * This substitutes for jdmaster.c's initialization of the full decompressor. 0N/A /* This is effectively a buffered-image operation. */ 0N/A /* Entropy decoding: either Huffman or arithmetic coding. */ 0N/A /* Always get a full-image coefficient buffer. */ 0N/A /* We can now tell the memory manager to allocate virtual arrays. */ 0N/A /* Initialize input side of decompressor to consume first scan. */ 0N/A /* Initialize progress monitoring. */ 0N/A /* Estimate number of scans to set pass_limit. */ 0N/A /* For a nonprogressive multiscan file, estimate 1 scan per component. */