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

📄 std_reverse_info_local.h

📁 JPEG2000实现的源码
💻 H
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************************/
/* Copyright 1998, Hewlett-Packard Company                                   */
/* All rights reserved                                                       */
/* File: "std_reverse_info_local.h"                                          */
/* Description: Private definitions for "std_reverse_info.c"                 */
/* Author: David Taubman                                                     */
/* Affiliation: Hewlett-Packard and                                          */
/*              The University of New South Wales, Australia                 */
/* Version: VM9.0                                                            */
/* Last Revised: 20 April, 2001                                              */
/*****************************************************************************/

/*****************************************************************************/
/* Modified to include flags for geometric manipulation.  Changes indicated  */
/* by comments including the string "GEOM".  Copyright 1999 by CRF and HP,   */
/* with all rights reserved to the modified parts.                           */
/*****************************************************************************/

/*****************************************************************************/
/* Modified by David Taubman to support arbitrary reference points for the   */
/* transform and the various regular partitions, so as to facilitate         */
/* cropping and geometric transformations in the compressed domain and to    */
/* enable full support for CRF's single-sample overlap Wavelet transform,    */
/* as originally documented in Seoul.  Changes are too numerous to flag      */
/* individually within the code.  Changes copyrighted by HP with all rights  */
/* reserved for the modified parts.                                          */
/*****************************************************************************/

/*****************************************************************************/
/* Modified by David Taubman to support interface modifications, arbitrary   */
/* changes in coding parameters from component to component and from tile    */
/* to tile, to support the full generality of PART-1 of the JPEG2000         */
/* standard, and to support most anticipated generality of PART-2.  Changes  */
/* are too numerous to flag individually within the code, which in some      */
/* places has been completely rewritten.  All changes copyrighted by HP with */
/* all rights reserved for the modified parts.                               */
/*****************************************************************************/

/*****************************************************************************/
/* Modified for general wavelet decompositions.                              */
/* Copyright 2000 Science Applications International Corporation (SAIC).     */
/* Copyright 1995 University of Arizona, Arizona Board of Regents.           */
/* All Rights Reserved for modified parts.                                   */
/*****************************************************************************/

/*****************************************************************************/
/* Modified for general offset and scalar quantization.                      */
/* Copyright 2000 The MITRE Corporation.                                     */
/* All Rights Reserved for modified parts.                                   */
/*****************************************************************************/

/*****************************************************************************/
/* Modified by Jianxin Wei, Australian Defence Force Academy (ADFA)          */
/* to implement the Odd Tile-Size Low-Pass First Convention (OTLPF_CONVENTION)*/
/* Copyright 2000 University of New South Wales, Australia.                  */
/* All rights reserved for modified parts.                                   */
/*****************************************************************************/

#ifndef STD_REVERSE_INFO_LOCAL_H
#define STD_REVERSE_INFO_LOCAL_H
#include <ifc.h>
#include "std_kernel_info_local.h"

#define STEP_EXPONENT_BITS  5 /* These values must be identical in the */
#define STEP_MANTISSA_BITS 11 /* `forward_info' and `reverse_info' objects. */

/*****************************************************************************/
/*                               std_band_info                               */
/*****************************************************************************/

typedef
  struct std_band_info {
    int rel_step_exponent;
    int rel_step_mantissa;

    /* 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 */

    float scale_nz;

  } std_band_info, *std_band_info_ptr;
  /* This structure manages all information for a particular subband.
         `step_exponent' and `step_mantissa' together provide
     all the information required to respond to calls to the
     `reverse_info__get_quant_info' function, whose definition appears
     in "ifc.h".  For non-reversible decompositions, the absolute step
     size is computed by multiplying 2^(P-G), the nominal dynamic range for
     subband sample values, by 2^{-Se}*(1+2^{-Mbits}*Sm), where Se is the
     `rel_step_exponent' value, Sm is the `rel_step_mantissa' value and Mbits
     is the STEP_MANTISSA_BITS value.  Here, P is the IMPLEMENTATION_PRECISION
     value and G is the number of guard bits, maintained in the
     `std_reverse_info' object.  Also, the `extra_lsbs' value, Be, is
     computed as Be = P-G-Se.  Note that all these quantities are expressed
     in terms of integer values which are saved in the bit-stream.
         The situation is somewhat different for reversible decompositions.
     Here, the absolute step size returned by `get_quant_info' is 1.0.  The
     `rel_step_mantissa' field is not used and is set to 0.  The
     `rel_step_exponent' field is given a different interpretation in this
     case in order to ensure that the `extra_lsbs' value may still be
     computed as Be = P-G-Se.  In this case a reasonable value for Se is
     calculated, based upon the dynamic range expansion properties of
     the relevant reversible kernel; the calculation is performed compression
     and the result is sent in the global header of the bit-stream..

     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 */

/*****************************************************************************/
/*                              std_level_info                               */
/*****************************************************************************/

typedef
  struct std_level_info {
    /* SAIC General Decomp Begin */
    int max_hp_descent;
    int *decomp_sequence;
    /* SAIC General Decomp End */

    std_kernel_info hor_kernel;
    std_kernel_info vert_kernel;
    frame_info frame;
    int min_band, max_band;
    std_band_info_ptr bands;
  } std_level_info, *std_level_info_ptr;
  /* This structure holds information for a given resolution level within an
     image component (e.g. within a colour plane).  The structure is maintained
     in the array referenced by `std_component_info'.  Each resolution level
     contains the subbands required to construct the next higher resolution
     from the information available in previous resolution levels.
         `max_hp_descent' identifies the subband structure for this resolution
     level.  Its interpretation is discussed at length in the "ifc.h"
     header file, under the introductory section entitled "Interpretation of
     Level and Band Indices".
         `hor_kernel' and `vert_kernel' hold all information concerning
     the horizontal and vertical Wavelet transform kernels, respectively.
         `frame' holds details of the frame size and transform behaviour at
     frame boundaries for the relevant resolution level.  See the
     definition of the `fame_info' structure in "ifc.h" for more information.
         `min_band' and `max_band' hold the minimum and maximum legitimate
     indices into the `bands' array.  These indices are determined directly
     from the `max_hp_descent' value.  It should be noted that `min_band'
     is always non-negative and will usually be greater than 0, which means
     that the initial entries in the array pointed to by `bands' should
     never be accessed..

     SAIC General Decomp. Begin
         `decomp_sequence' signals the general decomposition used for the
     current wavelet level.
     SAIC General Decomp. End */

/*****************************************************************************/
/*                             std_component_info                            */
/*****************************************************************************/

typedef
  struct std_component_info {
    int component_idx;
    int hor_subsampling, vert_subsampling;
    int bitdepth;
    int is_signed;
    int num_levels;

⌨️ 快捷键说明

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