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

📄 ebcot_decoder.h

📁 JPEG2000实现的源码
💻 H
📖 第 1 页 / 共 4 页
字号:
    int min_band, max_band;
    ebcot_precinct_band_info_ptr bands;
    int sequenced_layers; /* DST POC mod */
    int recovered_layers; /* DST POC mod */
    int max_recoverable_layers; /* DST POC mod */
    int *layer_bytes;
    int packet_loss_encountered;
  } ebcot_precinct_info, *ebcot_precinct_info_ptr;
  /* Holds information specific to a given precinct.
         `tnum', `component_idx', `level_idx' and `precinct_idx'
     together specify the coordinates of the precinct within the entire
     code-stream.
         `xref' and `yref' hold the absolute coordinates of the upper left
     hand corner of the precinct, mapped into the high-resolution reference
     grid; these identify the location of the precinct 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_precinct_band_info' structures
     which manage the state of each subband within the scope of the
     precinct.
         `sequenced_layers' indicates the total number of quality layers
     which have been sequenced so far while building the packet progression
     sequence managed by the `packet_sequence' array in the containing
     `ebcot_tile' structure.
         `recovered_layers' indicates the total number of layers which
     have been recovered for this precinct from the codestream so far.
         `max_recoverable_layers' indicates the maximum number of layers
     which can be sequenced and recovered for this precinct (this is also
     the number of packets which can be recovered, since there is one layer
     for each packet in each precinct).  The value is initially set to the
     number of layers for the relevant tile; however, if the end of tile is
     encountered, the value is reduced to match the number of recovered
     layers, indicating that there is no point in waiting for any further
     packets for the precinct.
         `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 precinct).
         `packet_loss_encountered' is a flag which identifies whether or
     not a corrupted codestream packet has been found, i.e. whether or
     not this precinct scope has been found corrupted in any quality layer
     encountered so far.  The significance of corrupted packets is that
     the information from later packets (higher quality layer indices)
     within the same precinct should simply be discarded. */


/* ========================================================================= */
/* ----------------------------- 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 a row of blocks when data is
     requested by the quantizer in lines rather than blocks.
         `num_lines' holds the number of lines which have been requested
     so far.  Once this reaches the height of a block, the next request for
     a line will force the decoding of a new row of blocks and the `num_lines'
     counter will be reset.
         `info' points to the `ebcot_block_info' entry for the first block in
     the row of blocks from which lines are being requested.
         `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.  The buffers
     are only allocated in the event that the `pull_line' interface
     function is used. */


/* ========================================================================= */
/* ---------------------------- 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;
    int extra_lsbs;
    ebcot_line_buffering lines;
    block_coding_pass_func pass_funcs[PASSES_PER_BITPLANE];
    reverse_roi_ref roi;
    int max_roi_boost;
    int roi_implicit;
    int blocks_wide, blocks_high, total_blocks;
    ebcot_block_info_ptr blocks;

    /* SAIC General Decomp. Begin */
    int vert_hp_descent;
    int horiz_hp_descent;
    int vert_hp_descent_chg[4];
    int horiz_hp_descent_chg[4];
    int valid_band;
    /* SAIC General Decomp. End */

  } 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 precinct 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.
         `extra_lsbs' is the value recovered from the `reverse_info'
     object upon initialization.
         `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 `reverse_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. 

     SAIC General Decomp. Begin 
         `vert_hp_descent' indicates the level of wavelet tree descent in 
     the vertical direction for the current sub-band.
         `horiz_hp_descent' indicates the level of wavelet tree descent in the
     horizontal direction for the current sub-band.
         `vert_hp_descent_chg' indicates the change in vert_hp_descent which is 
     used to determine the path through the wavelet tree for the current
     sub-band.
         `horiz_hp_descent_chg' indicates the change in vert_hp_descent which is 
     used to determine the path through the wavelet tree for the current
     sub-band.
         `valid_band' indicates which bands in the range [min_band, max_band]
     are valid for a general decomposition.
     SAIC General Decomp. End */

/*****************************************************************************/
/*                              ebcot_level_info                             */
/*****************************************************************************/

typedef
  struct ebcot_level_info {
    int tnum, component_idx, level_idx;
    canvas_dims dims;
    frame_info frame;

    /* SAIC General Decomp. Begin */
    int max_hp_descent;
    int decomp_sequence[16];
    /* SAIC General Decomp. End */

    int min_band;
    int max_band;
    ebcot_band_info_ptr bands;
    int ppx, ppy;
    int precincts_wide, precincts_high, total_precincts;
    ebcot_precinct_info_ptr precincts;
    int next_precinct_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.
         `max_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 precinct
     partition for this resolution level; specifically, the precinct partition
     width is equal to 2^{ppx} and its height is equal to 2^{ppy}.
         `precincts_wide' and `precincts_high' identify the number of precincts
     which span the width and height of the tile within this resolution level,
     while `total_precincts' holds the product of `precincts_wide' and

⌨️ 快捷键说明

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