jpeg_hdr_new
This function allocates a new JpegHdr and returns a handle to it.
jpeg_hdr_free hdr
Deallocates the JpegHdr pointed to by hdr.
jpeg_scan_hdr_new
Allocates a new JpegScanHdr, and return a pointer to it.
jpeg_scan_hdr_free scanHdr
Deallocates the JpegScanHdr pointed to by scanHdr.
jpeg_hdr_parse bp hdr
Parses off a JPEG header and fills hdr from where BitParser bp is pointing. Return the number of bytes parsed from the bitstream.
jpeg_scan_hdr_parse bp hdr scanHdr
Parses off a JPEG scan header from where the BitParser bp is pointing to, and initialize the scan header. Return the number of bytes parsed from the bitstream. an error is encoutered.
jpeg_scan_parse bp hdr scanHdr sc1 sc2 .. scN
Parse a scan from the bitstream the bitparser is pointing to. ScImages sc1, sc2, .. are initialized with data from the scan. Each ScImage will contain unscaled coefficients, so the function sc_i_to_byte can be called directly on these ScImages.
jpeg_scan_selective_parse bp hdr scanHdr sc1 .. scN
Parse selective planes from the BitStream the BitParser is pointing to. Some ScImages can be "null", which instructs the routine not to decode the plane corresponding to that ScImage.
jpeg_scan_inc_parse_start bp hdr scanHdr sc1 .. scN
Begins an incremental scan parse. This routine does not actually read anything off the bitstream, but sets up some state variables. It returns the total number of MCUs in the scan.
jpeg_scan_inc_parse bp hdr scanHdr howMany sc1 .. scN
Continues incremental scan parse. howmany is the number of MCUs we want to parse. It returns the total number of MCUs parsed off since the incremental parse began.
jpeg_scan_inc_parse_end bp hdr scanHdr sc1 .. scN
Ends an incremental scan parse.
jpeg_hdr_ht_encode hdr bp
Encodes the huffman table embedded in the JPEG header structure hdr into BitStream using BitParser bp. This should be done before the JPEG header or scan header is encoded. Returns the number of bytes encoded.
jpeg_hdr_qt_encode hdr bp
Encodes the quantization table embedded in the JPEG header hdr into BitStream using BitParser bp. This should be done before the JPEG header or scan header is encoded. Returns the number of bytes encoded.
jpeg_hdr_encode hdr baseline bp
Encodes the JPEG header hdr into BitStream using BitParser bp. baseline specifies if the parameters conform to the baseline JPEG specification or not. Returns the number of bytes encoded.
jpeg_scan_hdr_encode hdr scanHdr bp
Encodes the JPEG scan header scanHdr into the BitStreams attached to the BitParser bp. Returns the number of bytes encoded into the bitstream.
jpeg_scan_encode hdr scanHdr huffTable sc1 .. scN bp
Encodes a complete scan into the bitstream. This routine does not put a marker to end the image, so multiple calls to this routine are possible. Returns the number of bytes encoded into the bitstream.
jpeg_scan_encode_420 hdr scanHdr huffTable scY scU scV bp
Encodes a complete scan into the bitstream. This scan consists of three components, each corresponding to a plane in YUV color space based on 4:2:0 subsampling. Does not put a marker to end the image, so multiple calls to this routine are possible.
jpeg_scan_encode_422 hdr scanHdr huffTable scY scU scV bp
Encodes a complete scan into the bitstream. This scan consists of three components, each corresponding to a plane in YUV color space based on 4:2:2 subsampling. Does not put a marker to end the image, so multiple calls to this routine are possible.
jpeg_scan_inc_encode_420 hdr scanHdr huffTable scY scU scV bp
Incremental version of scan encoding. The first call and last call to this primitives should pass NULL as an argument for scY. First call this function with NULL as scY to initilize the encoding. The last call will clean up the BitParser. For all calls in between, this function will encode the ScImages passed in.
jpeg_scan_inc_encode_422 hdr scanHdr huffTable scY scU scV bp
Incremental version of scan encoding. The first call and last call to this primitives should pass NULL as an argument for scY. First call this function with NULL as scY to initilize the encoding. The last call will clean up the BitParser. For all calls in between, this function will encode the ScImages passed in.
jpeg_start_code_encode bp
Outputs the SOI (start of image) marker into the bitstream, to signify the beginning of an image. This should be called before the encoding all headers and scans. Returns the number of bytes encoded, which should always be 2.
jpeg_end_code_encode bp
Outputs the EOI (end of image) marker onto the bitstream, to signify the image end. This should be called after all headers and scanned are encoded. Returns the number of bytes encoded (which should always be 2)
jpeg_huff_table_new numOfComponents
Creates a new Huffman table of numOfComponents components. A handle to an empty Huffman table is returned. jpeg_huff_table_init should be called to initialize the huffman table.
jpeg_huff_table_init jpegHdr scanHdr huffTable
Initialize the Huffman table huffTable based on specification in the headers jpegHdr and scanHdr.
jpeg_huff_table_free huffTable
Deallocates the memory allocated for the Huffman table huffTable.
jpeg_hdr_get_width hdr
jpeg_hdr_get_height hdr
jpeg_hdr_get_restart_interval hdr
jpeg_hdr_get_num_of_components hdr
jpeg_hdr_get_precision hdr
jpeg_hdr_get_max_block_height hdr
jpeg_hdr_get_max_block_width hdr
These functions retrieve the following information about the JpegHdr hdr :
- width of the image in pixels
- height of the image in pixels
- number of MCU is restart interval
- number of components in the image
- number of bits in each samples
- maximum block height among the components
- maximum block width among the components
jpeg_hdr_get_component_id hdr i
jpeg_hdr_get_qt_id hdr i
jpeg_hdr_get_block_width hdr i
jpeg_hdr_get_block_height hdr i
Returns the following information about the i-th components :
- the ID of this component
- the quantization table ID of this component
- block width of this component
- block height of this component
jpeg_hdr_get_qt hdr
Returns the quantization table of the JPEG hdr as a list of 64 elements.
jpeg_scan_hdr_get_num_of_components hdr
jpeg_scan_hdr_get_scan_id hdr i
jpeg_scan_hdr_get_dc_id hdr i
jpeg_scan_hdr_get_ac_id hdr i
Returns the following information contained in the scan header hdr :
- the number of components in this scan
- the scan id for component i
- ID for DC huffman table for component i
- ID for AC huffman table for component i
jpeg_hdr_set_width hdr width
jpeg_hdr_set_height hdr height
jpeg_hdr_set_num_of_components hdr n
jpeg_hdr_set_precision hdr precision
jpeg_hdr_set_restart_interval hdr ri
These functions set the following information about the JpegHdr hdr :
- width of the image in pixels
- height of the image in pixels
- number of components in the image
- number of bits in each samples
- number of MCU is restart interval
jpeg_hdr_std_qt_init hdr
Initialized the quantization table in the header to the standard quantization table.
jpeg_hdr_std_ht_init hdr
Initialized the huffman table in the header to the standard huffman table.
jpeg_hdr_set_qt hdr id precision qList
Set the values and precision in the quantization table id of header hdr. id have to be either 0, 1, 2, or 3. precision specifies the number of bits in each quantization value and must be either 8 or 16. The values of the quantization table is given in the list qList. If qList has more than 64 elements, only the first 64 elements will be considered. If qList has less than 64 elements, it will be padded with quantization value 1.
jpeg_hdr_set_qt_ids hdr qtIdList
Initialize each component's quantization table ids in header hdr. The ids are specified by an list qtIdList. The number of elements in the list should be the same as the number of components in the image.
jpeg_hdr_set_component_id hdr i id
jpeg_hdr_set_qt_id hdr i id
Sets the following information about the i-th components :
- the ID of this component
- the quantization table ID of this component
jpeg_hdr_set_block_width hdr i width
jpeg_hdr_set_block_height hdr i height
Sets the block width and block height of the i-th components in a JPEG header hdr.
jpeg_hdr_set_max_block_height hdr height
jpeg_hdr_set_max_block_width hdr width
Sets the maximum block width and maximum block height among the components in JPEG header hdr.
jpeg_hdr_set_block_widths hdr widthList
Set the block width for all components in JPEG header hdr. The maximum block width will be updated by this functions. The widths are specified by widthList, which is a list with n elements, where n is the number of components in the image.
This is an alternative to calling JpegHdrSetBlockHeight and JpegHdrSetMaxBlockHeight.
jpeg_hdr_set_block_heights hdr heightList
Set the block height for all components in JPEG header hdr. The maximum block height will be updated by this functions. The heights are specified by heightList, which is a list with n elements, where n is the number of components in the image.
jpeg_scan_hdr_set_num_of_components hdr n
jpeg_scan_hdr_set_scan_id hdr i id
jpeg_scan_hdr_set_dc_id hdr i id
jpeg_scan_hdr_set_ac_id hdr i id
Set the following information contained in the scan header hdr :
- the number of components in this scan
- the scan id for component i
- ID for DC huffman table for component i
- ID for AC huffman table for component i
jpeg_scan_hdr_set_scan_ids scanHdr scanIdList
Set the scan ids for all component in this scan. The scan ids are specified by scanIdList, which is a list with n elements, where n is the number of components in the image.
jpeg_scan_hdr_set_dc_ids scanHdr dcIdList
Set the dc ids for all component in this scan. The dc ids are specified by dcIdList, which is a list with n elements, where n is the number of components in the image.
jpeg_scan_hdr_set_ac_ids scanHdr acIdList
Set the ac ids for all component in this scan. The ac ids are specified by acIdList, which is a list with n elements, where n is the number of components in the image.
Last updated : Saturday, November 14, 1998, 07:50 PM