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

📄 line_block_ifc.h

📁 JPEG2000 EBCOT算法源码
💻 H
📖 第 1 页 / 共 5 页
字号:
           `component_idx' is the zero-based index of the component (usually
       colour component) whose decomposition is identified in the call. */

typedef void (*analysis__push_image__func)
  (analysis_ref self, ifc_int **image_buf, int component_idx);
    /* This prototype defines the form of the `push_image' interface function
       associated with the `analysis' object, whose definition appears below.
       The function is provided mainly for testing implementations of the
       wavelet transform which assume random access (anything other than
       a line-by-line access model) into the image.  Of course, the
       `push_line' interface function can also be used with such algorithms,
       since nothing prevents the implementation from buffering lines
       received via the `push_line' interface into an entire image.  However,
       this mode of operation would not properly be able to capture the
       fact that in many applications where the image is available for
       random access, it does not reside in general purpose memory; in
       particular, the image can be accessed randomly for reading, but
       the buffered image data cannot be overwritten with intermediate
       computations for one reason or another (e.g. CD-ROM or other data-base
       sources and CMOS image sensors).  Applications such as these are poorly
       represented by the `push_line' interface since all memory which is
       buffered up internally is implicitly of a general-purpose nature.
       To emphasize this distinction, we insist that the image buffer
       passed in via this interface must not be modified by the function
       call.  Thus, all working storage must be allocated internally.
       The arguments have the following interpretations:
           `self' is a reference (pointer) to the relevant `analysis'
       object (structure), so that private state information can be accessed.
           `image_buf' is a pointer to an array of pointers to image row
       buffers.  Each image row buffer is an array of 16 or 32-bit integers,
       depending upon the value of the IMPLEMENTATION_PRECISION macro, which
       contain a two's-complement representation of the image sample values on
       that row of the image.  Both true two-dimensional arrays and
       one-dimensional arrays for the underlying image storage may be
       accommodated by appropriate pointer assignments.
           `component_idx' is the zero-based index of the component (usually
       colour component) whose decomposition is identified in the call. */

typedef void (*analysis__terminate__func)
  (analysis_ref self);
    /* This prototype defines the form of the `terminate' interface function
       associated with the `analysis' object, whose definition appears
       below.  The function will be called once all image lines (rows) have
       been pushed in via the `analysis__push_line' function.  It should
       push any outstanding subband samples out into the relevant quantizer
       and then deallocate any memory which was allocated, including the
       memory allocated for the structure pointed to by `self'.
           Note that the function may also be called after the object is
       first created, but before the `initialize' function is called.
       Implementors should be aware of this and be careful to avoid attempting
       to deallocate any memory which has not yet been allocated. */

typedef
  struct analysis_obj {
    analysis__initialize__func initialize;
    analysis__print_usage__func print_usage;
    analysis__push_line__func push_line;
    analysis__push_image__func push_image;
    analysis__terminate__func terminate;
  } analysis_obj;
  /* This structure defines all externally visible aspects of the
     `analysis' object.  In practice, when the object is created, the
     relevant implementation will create a larger structure, containing
     this structure as its first entry and including all relevant fields
     required to maintain state information.  The allocation of the
     structure and any auxiliary storage should be completed in the
     `analysis__initialize' call.  As mentioned in the introductory
     comments for this file, the external view of any given object consists
     only in a set of function pointers which define the interface to be
     used by all relevant parties.  The function pointers must be set to
     the addresses of the relevant functions when the structure is first
     created.
         The `analysis' object manages all aspects of the forward discrete
     wavelet transform.  It provides a `push_line' function which allows
     image lines to be pushed in one at a time, generating subband sample
     values in an efficient manner and pushing them into the relevant
     quantizer object as soon as possible.  The sequence of push calls
     ultimately sends the sample values into the encoder and thence to
     produce a bit-stream, but everything is driven from the top level
     simply by calls to the analysis object's `push_line' function. */


/*****************************************************************************/
/*                              quantizer_obj                                */
/*****************************************************************************/

typedef void (*quantizer__initialize__func)
  (quantizer_ref self, int decomposition, int levels, int components,
   int component_rows[], int component_cols[], filter_info_ref info,
   encoder_ref encoder, int argc, char *argv[]);
    /* This prototype defines the form of the `initialize' interface function
       associated with the `quantizer' object, whose definition appears below.
       The arguments have the following interpretations:
           `self' is a reference (pointer) to the relevant `quantizer'
       object (structure), so that private state information can be accessed.
           `decomposition' may be one of DECOMPOSITION__MALLAT or
       DECOMPOSITION__SPACL, but only the former must be supported by
       every implementation.
           `levels' identifies the number of levels of wavelet decomposition.
       A value of 0 means that no wavelet transform should be applied at all,
       in which case all of the push calls can expect a `band_idx' value of
       LL_BAND and a `level_idx' argument equal to 0.  This is a highly
       degenerate case.
           `components' identifies the number of components (typically
       colour components) for which subbands exist.  All components have the
       same number of resolution levels, but not necessarily the same
       dimensions, as described below.
           `component_rows' and `component_cols' point to arrays, each of
       which has one entry for per component, to identify the height and
       width of the relevant component in the image domain.
           `info' provides a reference to the `filter_info' object whose
       `get_quant_info' interface function should be used to retrieve the
       quantization step size which is to be used for each subband.  For
       deadzone quantizers, the quantization interval which includes zero
       should have a step size which is twice as large as the value returned
       by `filter_info__get_quant_info'.  The `info' object must be properly
       initialized (via a call to its `initialize' member function) before
       being passed into this function.
           `encoder' provides a reference to the encoder object into
       which quantized symbol indices should be pushed as soon as they become
       available.
           `argc' and `argv' play the same role as the the arguments passed
       to the `main' function of any "C" program.  They are provided so that
       the initialization function can look for additional special switches
       which customize its behaviour.  If special switches are used here they
       should, as a matter of convention, have the prefix, "-Q", which
       identifies them as being related to quantization.  Moreover,
       the relevant entries in the `argv' array (including those representing
       argument parameters) should be reset to point to an empty character
       string, i.e. ""; this ensures that command-line typos can efficiently
       be caught on behalf of the user. */

typedef void (*quantizer__print_usage__func)
  (quantizer_ref self, FILE *dest);
    /* This prototype defines the form of the `print_usage' interface function
       associated with the `synthesis' object, whose definition appears
       below.  If one or more special command-line arguments are recognized
       by the `synthesis__initialize' function, this function
       is responsible for printing a banner line introducing the object,
       which should be followed by a brief description of the command-line
       arguments which are accepted.  The usage text should be sent to the
       file stream identified by `dest'. */

typedef void (*quantizer__push_line_float__func)
  (quantizer_ref self, float *line_buf,
   int component_idx, int level_idx, int band_idx, int width);
    /* This prototype defines the form of the `push_line_float' interface
       function associated with the `quantizer' object, whose definition
       appears below.  The function is provided for the convenience of
       line-based transform implementations which work with floating point
       data.  Other transform implementations may use one of the other five
       `push' functions provided by the quantizer object's interface.  A
       call to this function should generate a call to the encoder object's
       `push_line' interface function, once all samples have been quantized,
       provided the quantization operator is memory-less.  Quantizers with
       memory might buffer and reorganize lines in order to satisfy all
       relevant dependencies.  The arguments have the following
       interpretations:
           `self' is a reference (pointer) to the relevant `quantizer'
       object (structure), so that private state information can be accessed.
           `line_buf' points to an array of floating point values produced by
       the wavelet analysis engine.  This array contains the next full line of
       sample values from one subband, which is identified by the
       `level_idx' and `band_idx' arguments.  Note that the contents of this
       buffer may be overwritten within the call.
           `component_idx' identifies the component to whose Wavelet
       decomposition the subband belongs.  The index is zero-based, so that
       0 will usually correspond to the luminance component in colour
       image compression applications.
           `level_idx' identifies the resolution level associated with the
       relevant subband.  A value of 0 refers to the lowers resolution
       level, where all four subbands are available (including LL_BAND).
           `band_idx' identifies the particular subband, within the relevant
       resolution level, for which a line of sample values is being provided.
       In the usual Mallat decomposition, this must be one of LL_BAND, LH_BAND,
       HL_BAND or HH_BAND, where LL_BAND is allowed only with a `level_idx'
       of 0.  In the Spacl decomposition, the band index must have the form
       B1+4*B2, where B1 identifies the primary subband as one of LL_BAND,
       LH_BAND, HL_BAND and HH_BAND, and B2 identifies the type of band into
       which the primary band was decomposed (treating it as a new image), as
       one of LL_BAND, LH_BAND, HL_BAND and HH_BAND.  The primary subband,
       B1, may be LL_BAND only in the lowest resolution level, i.e.
       `level_idx'=0.
           `width' identifies the number of samples in the line.  Although
       the quantizer object could compute this directly from the dimensions
       of the relevant component and the `level_idx' and `band_idx' values,
       there is no need to impose this requirement on the quantizer, which
       will often be an extremely simple algorithm. */

typedef void (*quantizer__push_line_fixed__func)
  (quantizer_ref self, ifc_int *line_buf,
   int component_idx, int level_idx, int band_idx, int width);
    /* This prototype defines the form of the `push_line_fixed' interface
       function associated with the `quantizer' object, whose definition
       appears below.  The function and its arguments play identical roles to
       those described above for `push_line_float', except that the subband
       sample values have a 16- or 32-bit fixed-point two's complement
       representation, depending upon the IMPLEMENTATION_PRECISION value,
       instead of a floating point representation.  Also, when this function is
       called, the quant

⌨️ 快捷键说明

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