⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ebcot_encoder.h

📁 关于视频压缩的jpeg2000压缩算法,C编写
💻 H
📖 第 1 页 / 共 4 页
字号:
     together specify the coordinates of the packet within the entire     code-stream.         `xref' and `yref' hold the absolute coordinates of the upper left     hand corner of the packet, mapped into the high-resolution reference     grid; these identify the location of the packet in the same coordinate     system as the containing `ebcot_tile' structure's `reference_dims'     coordinates.  The information is used only when constructing spatially     oriented packet progression sequences.         `min_band', `max_band' and `bands' play identical roles to     their namesakes in the `ebcot_band_info' structure, except that     the `bands' array contains `ebcot_packet_band_info' structures     which manage the state of each subband within the scope of the     packets.         `included_layers' indicates the total number of quality layers     which have been included so far while building the packet progression     sequence managed by the `packet_sequence' array in the containing     `ebcot_tile' structure.         `layer_bytes' is an array with one entry for each quality layer     available in the containing tile.  It is used to store the number of     bytes occupied by each codestream packet (i.e. each quality layer within     the scope of the current packet). *//* ========================================================================= *//* ----------------------------- Line Buffering ---------------------------- *//* ========================================================================= *//*****************************************************************************//*                            ebcot_line_buffering                           *//*****************************************************************************/typedef  struct ebcot_line_buffering {    int num_lines;    ebcot_block_info_ptr info;    ifc_int **buffers;  } ebcot_line_buffering, *ebcot_line_buffering_ptr;  /* This structure manages buffering of subband lines within the current     tile into a row of blocks, since data arrives from the quantizer in lines     rather than blocks.         `num_lines' holds the number of lines which have arrived.  Once     this reaches the height of a block (or the end of the image or tile), the     blocks will all be coded at once.         `info' points to the `ebcot_block_info' entry for the first block in     the row of blocks which is currently being accumulated.         `buffers' points to a row of block buffers.  Each block buffer     conforms to the requirements of the `sample_buffer' array described     under the definition of the `block_master' structure. *//* ========================================================================= *//* ---------------------------- Subband Structure -------------------------- *//* ========================================================================= *//*****************************************************************************//*                               ebcot_band_info                             *//*****************************************************************************/typedef  struct ebcot_band_info {    int tnum, component_idx, level_idx, band_idx;    int orientation_idx;    canvas_dims dims;    frame_info frame;    int block_rows, block_cols;    std_byte *zc_lut;    dst_heap_unit_ptr heap_head, heap_tail;    int next_heap_pos;    float step_wmse;    float vpw_weight;    int extra_lsbs;    int max_passes;    float nominal_range;    float fully_masked_sensitivity_reduction;    int lossless;    ebcot_line_buffering lines;    block_coding_pass_func pass_funcs[PASSES_PER_BITPLANE];    forward_roi_ref roi;    int max_roi_boost;    int roi_implicit;    int blocks_wide, blocks_high, total_blocks;    ebcot_block_info_ptr blocks;  } ebcot_band_info, *ebcot_band_info_ptr;  /* This structure describes a single subband within the wavelet     decomposition for a single tile.         `tnum', `component_idx', `level_idx' and `band_idx' identify     the complete coordinates of the subband.         `orientation_idx' holds one of LL_BAND, HL_BAND, LH_BAND or HH_BAND,     depending upon whether the subband's primary orientation corresponds to     low-pass filtering in both directions, high-pass filtering in the     horizontal direction, high-pass filtering in the vertical direction or     high-pass filtering in both directions, respectively.  For Mallat     decompositions, all subbands will have `band_idx' = `orientation_idx'.     This is not true, however, for more complex decompositions in which     the primary subbands in the relevant resolution level are decomposed     further.  This is carefully explained in the master "ifc.h" header     file.         `dims' holds the location and dimensions of the subband within the     relevant tile.         `frame' holds framing information for the subband.         `block_rows' and `block_cols' identify the dimensions of the     actual code-block partition for the subband within the relevant tile.     These are determined from the nominal code-block dimensions for the     entire tile, the frame dimensions mapped into the subband (if they are     to be respected) and the packet partition dimensions mapped into the     subband.         `zc_lut' points to the lookup table to be used in translating     neighbourhood significance information into a coding context for     coding whether a zero sample becomes non-zero or not in a particular     pass; this is called zero-coding.         `heap_head' and `heap_tail' point to the first and last entries in     the doubly-linked list of heap units which are used to store the     code words for all code-blocks in the subband-tile.         `next_heap_pos' holds the position within the `heap_tail' unit of     the next unused word of storage.  The code words generated by all the     blocks in a subband are concatenated together, but each block starts     on a new whole word boundary.         `step_wmse' and `extra_lsbs' are the values recovered from the     `forward_info' object upon initialization.         `max_passes' holds the maximum number of coding passes in     any code-block in the band, based upon the quantization parameters and     ROI properties.  This summary information is helpful in implementing     various aspects of the coder.         `vpw_weight' holds an additional weighting factor which is     notionally multiplied by `step_wmse' during bit-stream formation     at a given bit-rate.  The `vpw_weight' values are not applied until     bit-stream formation because they may vary as a function of bit-rate.     They are used to implement a visually progressive weighting     strategy.  A negative value may be used as a robust way of signalling     the fact that no factor should be applied (i.e. equivalent to 1.0).         `nominal_range' holds the nominal range of the quantized subband     sample values, as they appear to the coder.  The nominal range of the     samples is obtained by taking the nominal range of the image samples,     multiplying it by the DC gain of each low-pass analysis filter and by     the Nyqyuist gain of each high-pass analysis filter and dividing by     the effective step size associated with the LSB of the integers     passed across the `encoder__push_...' interface functions.  The nominal     range is thus essentially twice the amplitude (dynamic range is     difference between max and min value, all of which are signed) of the     strongest response which can be produced by a maximum strength sinusoidal     image grating of the appropriate spatial frequency.         `fully_masked_sensitivity_reduction' identifies the reduction in     visual sensitivity (i.e. an amount by which the squared error     contribution must be divided) when the local masking     strength achieves its nominal maximum value, relative to the visual     sensitivity when the local masking strength is zero (or relatively     negligible).  The nominal maximum masking strength occurs when all     subband samples have their maximum nominal amplitude, i.e. they all have     an amplitude equal to half the `nominal_range' value.  This is     approximately what happens when the image contains a maximum strength     sinusoidal grating of the appropriate spatial frequency.  If the     `fully_masked_sensitivity_reduction' field holds a value of 1.0 then     visual masking has no effect whatsoever, while values less than 1.0 are     illegal.  Currently, we set this field equal to a constant value for all     subbands; however, it is possible to incorporate the results of     psychovisual experiments here when viewing parameters are known.  Note     that when visual masking is being exploited, the `step_wmse' value     identifies the visual significance of unmasked features, i.e. when the     masking strength is negligible.  For more information on these concepts,     consult the comments appearing with the "compute_visibility_factors"     function in "ebcot_encoder.c".         `lossless' is non-zero if and only if the quantization step size     for this band corresponds to a lossless representation of the subband     samples.  If this is the case then the distortion estimated for the     final coding pass applied to blocks in the subband will be incorrect     and needs to be adjusted.         `lines' holds the state information for the line buffering mechanism     which is activated by calls to the encoder object's `push_line'     interface function.         `pass_funcs' holds pointers to the encoding functions to be used     for each block coding pass in any given bit-plane.         `roi' holds a reference to the ROI object which may modify the     entropy coder's behaviour in particular code-blocks.         `max_roi_boost' holds the maximum boost for any region as returned     by the `forward_roi__get_max_boost' function.         `roi_implicit' is non-zero if the decoder should be able to     determine the ROI partition within any given block, based only on     the magnitudes of the decoded samples.         `blocks_wide' and `blocks_high' identify the number of code-blocks     which span the width and height of the subband, respectively, within     the current tile, while `total_blocks' holds their product.         `blocks' points to an array containing parameters and state     information for all `total_blocks' code-blocks, arranged in scan-line     order. *//*****************************************************************************//*                              ebcot_level_info                             *//*****************************************************************************/typedef  struct ebcot_level_info {    int tnum, component_idx, level_idx;    canvas_dims dims;    frame_info frame;    int hp_descent;    int min_band;    int max_band;    ebcot_band_info_ptr bands;    int ppx, ppy;    int packets_wide, packets_high, total_packets;    ebcot_packet_info_ptr packets;    int next_packet_idx;  } ebcot_level_info, *ebcot_level_info_ptr;  /* This structure describes a single resolution level within the Wavelet     decomposition for a single image component of a single tile.  The     `ebcot_component_info' structure manages an array of these structures,     with `num_levels'+1 entries, as explained in the comments appearing with     the definition of `ebcot_component_info'.         `tnum', `component_idx' and `level_idx' identify the coordinates of     the resolution level.         `dims' holds the location and dimensions of the relevant tile     at this resolution level.         `frame' holds framing information mapped to the current     resolution level.         `hp_descent' is the value returned by its namesake argument     in the  `forward_info__get_level_info' interface function defined in     "ifc.h".         `min_band' and `max_band' hold the minimum and maximum indices of     the subbands which can be accessed within the resolution level.  It     should be noted that the range may be empty, i.e. `min_band' may     exceed `max_band', in some cases.         `bands' holds information for each subband in the resolution level.     The array contains `max_band'+1 entries, which means that the first     `min_band' entries will never be used; however, this simplifies the     application of the `band_idx' argument supplied to the `push_line' and     `push_block' interface functions.         `ppx' and `ppy' identify the width and height of the packet partition     for this resolution level; specifically, the packet partition width is     equal to 2^{ppx} and its height is equal to 2^{ppy}.  If no packet     partition is used, these quantities will both be negative.         `packets_wide' and `packets_high' identify the number of packets     which span the width and height of the tile within this resolution level,     while `total_packets' holds the product of `packets_wide' and     `packets_high'.  There will often only be one packet in any given     resolution level, which is the original form proposed for the EBCOT     algorithm; multiple packets can be used to improve parsability and/or     coherence in the codestream to reduce resource consumption in specific     applications.         `packets' points to an array of `total_packets' `ebcot_packet_info'     structures which manage the state of each packet.         `next_packet_idx' holds the index of the next packet in this     resolution level to be included in a spatially oriented packet     progression sequence.  It is used only to build these sequences and     has no interpretation at any other point. *//*****************************************************************************//*                            ebcot_component_info                           *//*****************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -