📄 ijl.pas
字号:
////////////////////////////////////////////////////////////////////////////
// Name: FRAME_COMPONENT
//
// Purpose: One frame-component structure is allocated per component
// in a frame.
//
// Context: Used by Huffman decoder to manage components.
//
// Fields:
// ident Component identifier. The tables use this ident to
// determine the correct table for each component.
// hsampling Horizontal subsampling factor for this component,
// 1-4 are legal.
// vsampling Vertical subsampling factor for this component,
// 1-4 are legal.
// quant_sel Quantization table selector. The quantization table
// used by this component is determined via this selector.
//
////////////////////////////////////////////////////////////////////////////
PFRAME_COMPONENT = ^TFRAME_COMPONENT;
TFRAME_COMPONENT = record
ident : Integer;
hsampling : Integer;
vsampling : Integer;
quant_sel : Integer;
end;
////////////////////////////////////////////////////////////////////////////
// Name: FRAME
//
// Purpose: Stores frame-specific data.
//
// Context: One Frame structure per image.
//
// Fields:
// precision Sample precision in bits.
// width Width of the source image in pixels.
// height Height of the source image in pixels.
// MCUheight Height of a frame MCU.
// MCUwidth Width of a frame MCU.
// max_hsampling Max horiz sampling ratio of any component in the frame.
// max_vsampling Max vert sampling ratio of any component in the frame.
// ncomps Number of components/channels in the frame.
// horMCU Number of horizontal MCUs in the frame.
// totalMCU Total number of MCUs in the frame.
// comps Array of 'ncomps' component descriptors.
// restart_interv Indicates number of MCUs after which to restart the
// entropy parameters.
// SeenAllDCScans Used when decoding Multiscan images to determine if
// all channels of an image have been decoded.
// SeenAllACScans (See SeenAllDCScans)
//
////////////////////////////////////////////////////////////////////////////
PFRAME = ^TFRAME;
TFRAME = record
precision : Integer;
width : Integer;
height : Integer;
MCUheight : Integer;
MCUwidth : Integer;
max_hsampling : Integer;
max_vsampling : Integer;
ncomps : Integer;
horMCU : Integer;
totalMCU : Longint;
comps : PFRAME_COMPONENT;
restart_interv : Integer;
SeenAllDCScans : Integer;
SeenAllACScans : Integer;
end;
////////////////////////////////////////////////////////////////////////////
// Name: SCAN_COMPONENT
//
// Purpose: One scan-component structure is allocated per component
// of each scan in a frame.
//
// Context: Used by Huffman decoder to manage components within scans.
//
// Fields:
// comp Component number, index to the comps member of FRAME.
// hsampling Horizontal sampling factor.
// vsampling Vertical sampling factor.
// dc_table DC Huffman table pointer for this scan.
// ac_table AC Huffman table pointer for this scan.
// quant_table Quantization table pointer for this scan.
//
////////////////////////////////////////////////////////////////////////////
PSCAN_COMPONENT = ^TSCAN_COMPONENT;
TSCAN_COMPONENT = record
comp : Integer;
hsampling : Integer;
vsampling : Integer;
dc_table : PHUFFMAN_TABLE;
ac_table : PHUFFMAN_TABLE;
quant_table : PQUANT_TABLE;
end;
////////////////////////////////////////////////////////////////////////////
// Name: SCAN
//
// Purpose: One SCAN structure is allocated per scan in a frame.
//
// Context: Used by Huffman decoder to manage scans.
//
// Fields:
// ncomps Number of image components in a scan, 1-4 legal.
// gray_scale If TRUE, decode only the Y channel.
// start_spec Start coefficient of spectral or predictor selector.
// end_spec End coefficient of spectral selector.
// approx_high High bit position in successive approximation
// Progressive coding.
// approx_low Low bit position in successive approximation
// Progressive coding.
// restart_interv Restart interval, 0 if disabled.
// curxMCU Next horizontal MCU index to be processed after
// an interrupted SCAN.
// curyMCU Next vertical MCU index to be processed after
// an interrupted SCAN.
// dc_diff Array of DC predictor values for DPCM modes.
// comps Array of ncomps SCAN_COMPONENT component identifiers.
//
////////////////////////////////////////////////////////////////////////////
PSCAN = ^TSCAN;
TSCAN = record
ncomps : Integer;
gray_scale : Integer;
start_spec : Integer;
end_spec : Integer;
approx_high : Integer;
approx_low : Integer;
restart_interv : UINT;
curxMCU : DWORD;
curyMCU : DWORD;
dc_diff : array [0..3] of Integer;
comps : PSCAN_COMPONENT;
end;
////////////////////////////////////////////////////////////////////////////
// Name: DCTTYPE
//
// Purpose: Possible algorithms to be used to perform the discrete
// cosine transform (DCT).
//
// Fields:
// IJL_AAN The AAN (Arai, Agui, and Nakajima) algorithm from
// Trans. IEICE, vol. E 71(11), 1095-1097, Nov. 1988.
// IJL_IPP The modified K. R. Rao and P. Yip algorithm from
// Intel Performance Primitives Library
//
////////////////////////////////////////////////////////////////////////////
TDCTTYPE = (
IJL_AAN, // = 0
IJL_IPP // = 1
);
////////////////////////////////////////////////////////////////////////////
// Name: UPSAMPLING_TYPE
//
// Purpose: - Possible algorithms to be used to perform upsampling
//
// Fields:
// IJL_BOX_FILTER - the algorithm is simple replication of the input pixel
// onto the corresponding output pixels (box filter);
// IJL_TRIANGLE_FILTER - 3/4 * nearer pixel + 1/4 * further pixel in each
// dimension
////////////////////////////////////////////////////////////////////////////
TUPSAMPLING_TYPE = (
IJL_BOX_FILTER, // = 0
IJL_TRIANGLE_FILTER // = 1
);
////////////////////////////////////////////////////////////////////////////
// Name: SAMPLING_STATE
//
// Purpose: Stores current conditions of sampling. Only for upsampling
// with triangle filter is used now.
//
// Fields:
// top_row - pointer to buffer with MCUs, that are located above than
// current row of MCUs;
// cur_row - pointer to buffer with current row of MCUs;
// bottom_row - pointer to buffer with MCUs, that are located below than
// current row of MCUs;
// last_row - pointer to bottom boundary of last row of MCUs
// cur_row_number - number of row of MCUs, that is decoding;
// user_interrupt - field to store jprops->interrupt, because of we prohibit
// interrupts while top row of MCUs is upsampling.
////////////////////////////////////////////////////////////////////////////
PSAMPLING_STATE = ^TSAMPLING_STATE;
TSAMPLING_STATE = record
top_row : PShort;
cur_row : PShort;
bottom_row : PShort;
last_row : PShort;
cur_row_number : Integer;
end;
////////////////////////////////////////////////////////////////////////////
// Name: PROCESSOR_TYPE
//
// Purpose: Possible types of processors.
// Note that the enums are defined in ascending order
// depending upon their various IA32 instruction support.
//
// Fields:
//
// IJL_OTHER_PROC
// Does not support the CPUID instruction and
// assumes no Pentium(R) processor instructions.
//
// IJL_PENTIUM_PROC
// Corresponds to an Intel(R) Pentium processor
// (or a 100% compatible) that supports the
// Pentium processor instructions.
//
// IJL_PENTIUM_PRO_PROC
// Corresponds to an Intel Pentium Pro processor
// (or a 100% compatible) that supports the
// Pentium Pro processor instructions.
//
// IJL_PENTIUM_PROC_MMX_TECH
// Corresponds to an Intel Pentium processor
// with MMX(TM) technology (or a 100% compatible)
// that supports the MMX instructions.
//
// IJL_PENTIUM_II_PROC
// Corresponds to an Intel Pentium II processor
// (or a 100% compatible) that supports both the
// Pentium Pro processor instructions and the
// MMX instructions.
//
// IJL_PENTIUM_III_PROC
// Corresponds to an Intel(R) Pentium(R) III processor
//
// IJL_PENTIUM_4_PROC
// Corresponds to an Intel(R) Pentium(R) 4 processor
//
// IJL_NEW_PROCESSOR
// Correponds to new processor
//
// Any additional processor types that support a superset
// of both the Pentium Pro processor instructions and the
// MMX instructions should be given an enum value greater
// than IJL_PENTIUM_4_PROC.
//
////////////////////////////////////////////////////////////////////////////
TPROCESSOR_TYPE = (
IJL_OTHER_PROC, // = 0,
IJL_PENTIUM_PROC, // = 1,
IJL_PENTIUM_PRO_PROC, // = 2,
IJL_PENTIUM_PROC_MMX_TECH, // = 3,
IJL_PENTIUM_II_PROC, // = 4
IJL_PENTIUM_III_PROC, // = 5
IJL_PENTIUM_4_PROC, // = 6
IJL_NEW_PROCESSOR // = 7
);
////////////////////////////////////////////////////////////////////////////
// Name: RAW_DATA_TYPES_STATE
//
// Purpose: Stores data types: raw dct coefficients or raw sampled data.
// Pointer to structure in JPEG_PROPERTIES is NULL, if any raw
// data isn't request (DIBBytes!=NULL).
//
// Fields:
// short* raw_ptrs[4] - pointers to buffers with raw data; one pointer
// corresponds one JPG component;
// data_type - 0 - raw dct coefficients, 1 - raw sampled data.
////////////////////////////////////////////////////////////////////////////
PRAW_DATA_TYPES_STATE = ^TRAW_DATA_TYPES_STATE;
TRAW_DATA_TYPES_STATE = record
data_type : Integer;
raw_ptrs : array [0..3] of PShort;
end;
////////////////////////////////////////////////////////////////////////////
// Name: ENTROPYSTRUCT
//
// Purpose: Stores the decoder state information necessary to "jump"
// to a particular MCU row in a compressed entropy stream.
//
// Context: Used to persist the decoder state within Decode_Scan when
// decoding using ROIs.
//
// Fields:
// offset Offset (in bytes) into the entropy stream
// from the beginning.
// dcval1 DC val at the beginning of the MCU row
// for component 1.
// dcval2 DC val at the beginning of the MCU row
// for component 2.
// dcval3 DC val at the beginning of the MCU row
// for component 3.
// dcval4 DC val at the beginning of the MCU row
// for component 4.
// bit_buffer_64 64-bit Huffman bit buffer. Stores current
// bit buffer at the start of a MCU row.
// Also used as a 32-bit buffer on 32-bit
// architectures.
// bitbuf_bits_valid Number of valid bits in the above bit buffer.
// unread_marker Have any markers been decoded but not
// processed at the beginning of a MCU row?
// This entry holds the unprocessed marker, or
// 0 if none.
//
////////////////////////////////////////////////////////////////////////////
PENTROPYSTRUCT = ^TENTROPYSTRUCT;
TENTROPYSTRUCT = record
offset : DWORD;
dcval1 : Integer;
dcval2 : Integer;
dcval3 : Integer;
dcval4 : Integer;
bit_buffer_64 : IJL_UINT64;
bitbuf_bits_valid : Integer;
unread_marker : Byte;
end;
////////////////////////////////////////////////////////////////////////////
// Name: STATE
//
// Purpose: Stores the active state of the IJL.
//
// Context: Used by all low-level routines to store pseudo-global or
// state variables.
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -