📄 ebcot_decoder.h
字号:
int tnum, component_idx; canvas_dims dims; int hor_subsampling, vert_subsampling; int num_levels; int max_levels; ebcot_level_info_ptr levels; block_master master; sample_buffer_heap_ref sample_buffer_heap_mgr; int respect_frames; } ebcot_component_info, *ebcot_component_info_ptr; /* This structure encapsulates all state information for a given image component within a particular tile. `tnum' and `component_idx' identify the coordinates of the component. The `dims' structure holds the location and dimensions of the image component within the relevant tile, at its full resolution. The `hor_subsampling' and `vert_subsampling' fields identify the horizontal and vertical sub-sampling factors for this component; these may be used to recover the entries in the `dims' structure from those in the `referernce_dims' structure within the containing `ebcot_tile' structure. `num_levels' holds the number of Wavelet decompostion levels, which is equal to the number of resolution levels minus 1. `max_levels' holds the value of `num_levels' minus the `discard_levels' value maintained by the `ebcot_decoder' object. `levels' points to an array with `num_levels'+1 entries. The first entry manages the state of the LL band at the base of the decomposition. The n'th entry (n=1,2,...) manages stage for all subbands required to recover resolution level n, from the previous resolution. `master' is a common structure which manages the decoding of any given block of subband samples. The block parameters, common storage and a variety of intermediate results are maintained within this structure on behalf of all code-blocks in the tile-component. `sample_buffer_heap_mgr' references an object which manages the dynamic allocation of sample buffers. `respect_frames' is a flag indicating whether or not code-blocks are required to respect frame dimensions. If so, then the code-block dimensions in any given subband will be the lesser of the nominal code-block dimensions as maintained by `master->max_block_rows' and `master->max_block_cols', the frame dimensions as they appear in the relevant subband, and the packet partition dimensions as they appear in the relevant subband. Otherwise, the code-block dimensions will be the lesser of the nominal block dimensions and the packet partition dimensions for the subband. *//*****************************************************************************//* ebcot_order *//*****************************************************************************/typedef struct ebcot_order { int max_layers, max_levels, max_components; int new_progression; struct ebcot_order *next; } ebcot_order, *ebcot_order_ptr; /* Used to record each new change in packet progression order. The `max_layers', `max_levels' and `max_components' fields identify constraints on the last specified progression order, while `new_progression' specifies the new progression order to apply beyond those bounds and within any bounds specified by an ensuing `ebcot_order' structure, referenced by `next'. The information in a list of `ebcot_order' structures, managed from the `ebcot_tile' structure, directly reflects that in the POC marker. *//*****************************************************************************//* ebcot_sequence *//*****************************************************************************/typedef struct ebcot_sequence { int layer_idx; ebcot_packet_info_ptr packet; } ebcot_sequence, *ebcot_sequence_ptr; /* This structure is used to maintain the identity of a particular codestream packet in sequence. A codestream packet consists of a particular quality layer within the region identified by the `packet' pointer; this simply points into the `packets' array managed by the appropriate `ebcot_level_info' structure. *//*****************************************************************************//* ebcot_tile *//*****************************************************************************/typedef struct ebcot_tile { int tnum; canvas_dims reference_dims; int constructed; int num_components; int max_components; ebcot_component_info_ptr components; int num_layers; int total_packets; int available_packets; ebcot_sequence_ptr packet_sequence; int progression; ebcot_order_ptr progression_changes; } ebcot_tile, *ebcot_tile_ptr; /* This structure encapsulates all state information for a single tile. All parameters, with the exception of the number of image components, may change from tile-to-tile. The `tnum' field identifies the coordinate of the tile. The `reference_dims' structure describes the location and dimensions of the tile on the reference grid. The `constructed' flag indicates whether or not the tile's resolution levels and all other structures which may be tile-specific have been constructed. The `num_components' field indicates the number of image components. This is the same in every tile, but it is convenient to keep it here. The `max_components' field holds a replica of its namesake in the `ebcot_decoder' object for convenience when determining what to do with packets once they have been parsed from the codestream. The `components' array manages the state information for each image component within the tile. We call these tile-components. The `num_layers' field holds the number of quality layers for the tile; it can vary from tile-to-tile, although this creates some interpretation dilemmas. The `total_packets' field indicates the total number of packets contained in the tile. This is the sum of the `total_packets' fields from all `ebcot_level_info' structures, all multiplied by the number of quality layers. The `available_packets' field indicates the total number of codestream packets, in sequence, which have been recovered from the codestream up to the current point. Once all packets from the tile have been recovered, this fields should become equal to `total_packets', even if some packets were not actually found in the tile. The `packet_sequence' field points to an array with `total_packets' entries, each of which corresponds to a particular packet, in the sequence in which packets appear in the codestream. The `progression' and `progression_changes' fields are used to derive the packet sequence; they represent the progression style from the COD marker and the additional information from any POC marker, respectively. *//* ========================================================================= *//* ----------------------------- Decoder Object ---------------------------- *//* ========================================================================= *//*****************************************************************************//* ebcot_decoder *//*****************************************************************************/typedef struct ebcot_decoder { decoder_obj base; reverse_info_ref info; stream_in_ref stream; reverse_roi_ref roi; int num_components; int max_components; int discard_levels; int num_tiles; int current_tile_idx; ebcot_tile_ptr tiles; int max_component_rows, max_component_cols; dst_codeword_heap_ref code_heap_mgr; std_int cpu_time; int no_speedup; int er_confidence; int actual_bytes; } ebcot_decoder_obj, *ebcot_decoder_ref; /* This structure represents the decoder object itself. The additional fields have the following interpretations: `stream' holds a reference to the `stream_in' object from which packet data and all markers are recovered in an incremental manner. `roi' holds a reference to the ROI object which may modify the entropy coder's behaviour in particular code-blocks. `num_components' holds the actual number of image components in the codestream which is being decompressed, while `max_components' identifies the maximum number of these components for which we expect accesses via the `decoder__pull_line' interface function; at any rate, accesses outside these components should consistently return 0's. `discard_levels' indicates the number of resolution levels which are to be discarded from each tile. We do not expect requests for information via the `decoder__pull_line' interface function for any of the discarded lines; nevertheless, if such a request is made, the object should consistently return 0's. `num_tiles' indicates the total number of tiles which represent the image. `current_tile_idx' holds the zero-based index of the current tile for which information is being retrieved via the `decoder__pull_line' interface function. `tiles' points to an array with `num_tiles' structures, which manage the state and coding parameters of each tile. Most properties of the coder are derived separately from each `ebcot_tile' structure. Moreover, the tile contents and organization are filled out only as needed. `code_heap_mgr' references an object which manages the dynamic memory allocation for storage of generated code words. `cpu_time' accumulates the CPU time associated with all block coding operations. If CPU time is not required, it should hold a negative value. `no_speedup' is a flag indicating whether or not the default speedup mode for the entropy decoder should be turned off -- useful for benchmarking and debugging. `er_confidence' holds 0 unless error resilient decoding is requested, in which case it holds the number of confidence bits supplied with the `-Cer' argument. `actual_bytes' identifies the total number of bytes retrieved from the codestream which were actually used during decompression; if not identical to the number of bytes actually retrieved from the codestream, this reflects the activities of simulated codestream parsing. *//* ========================================================================= *//* --------------------------- External Functions -------------------------- *//* ========================================================================= */extern void ebcot_set_pass_funcs(ebcot_band_info_ptr band, block_master_ptr master);#endif /* EBCOT_DECODER_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -