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

📄 ebcot_encoder.h

📁 JPEG2000实现的源码
💻 H
📖 第 1 页 / 共 5 页
字号:
         `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.

     CRIL Technology/SAIC Scan Buffer begin
         `scan_buffer_lines' is the count of accumulated lines since the
     last flush of entropy coded bytes to the scan-based rate controller.
         `max_scan_buffer_lines' is the number of lines needed for this
     band before this same number of lines are flushed to the scan-based
     rate controller.
     CRIL Technology/SAIC Scan Buffer end

     SAIC/Fuji LRA begin
         `quant_to_zero' allows for subbands to quantized to value zero,
     indicating that bits for such subbands should not be included in the
     output bitstream.
     SAIC/Fuji LRA end 

     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
     `precincts_high'.  There will often only be one precinct in any given
     resolution level, which is the original form proposed for the EBCOT
     algorithm; multiple precincts can be used to improve parsability and/or
     coherence in the codestream to reduce resource consumption in specific
     applications.
         `precincts' points to an array of `total_precincts'
     `ebcot_precinct_info' structures which manage the state of each precinct.
         `next_precinct_idx' holds the index of the next precinct 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                           */
/*****************************************************************************/

typedef
  struct ebcot_component_info {
    int tnum, component_idx;
    canvas_dims dims;
    int hor_subsampling, vert_subsampling;
    int num_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.
         `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 encoding 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 precinct 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 precinct partition
     dimensions for the subband. */

/*****************************************************************************/
/*                                ebcot_order                                */
/*****************************************************************************/
/* Begin DST POC mod */
typedef
  struct ebcot_order {
    int progression;

⌨️ 快捷键说明

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