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

📄 hplx_vert_convolution.h

📁 JPEG2000实现的源码
💻 H
字号:
/*****************************************************************************/
/* Copyright 1998, Hewlett-Packard Company                                   */
/* All rights reserved                                                       */
/* File: "hplx_vert_convolution.h"                                           */
/* Description: Public definitions for "hplx_vert_convolution.c"             */
/* Author: David Taubman                                                     */
/* Affiliation: Hewlett-Packard and                                          */
/*              The University of New South Wales, Australia                 */
/* Acknowledgements: Partly developed in collaboration with                  */
/*                   Christos Chrysafix of HP Labs                           */
/* Version: VM8.5                                                            */
/* Last Revised: 11 September, 2000                                          */
/*****************************************************************************/

/*****************************************************************************/
/* 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 by Brendt Wohlberg (Los Alamos National Laboratory) to support   */
/* use of even length filters on tiles of arbitrary dimension and offset     */
/* (as per proposal WG1N1842 submitted at WG1 Rochester meeting). All        */
/* modifications are Copyright 2000 University of California.                */
/*****************************************************************************/

#ifndef HPLX_VERT_CONVOLUTION_H
#define HPLX_VERT_CONVOLUTION_H
#include "hplx_common.h"

/* ========================================================================= */
/* -------------------------- Structure Definitions ------------------------ */
/* ========================================================================= */

/*****************************************************************************/
/*                             hplx_rolling_buffer                           */
/*****************************************************************************/

typedef
  struct hplx_rolling_buffer {
    int rows, cols;
    int min_row_idx, next_row_idx;
    int window_rows;
    float **buffer;
    int top_extension_odd;

    /* LANL Even Length Begin */
    /* Added to support "special" extensions at top as well as bottom */
    int top_extension_special;
    /* Flag indicating whether the final row has been seen. Required for
       processing at the bottom which can only be performed on analysis
       once the final two lowpass rows have been generated, and on synthesis
       once the final lowpass and final highpass input rows have been
       received */
    int lookahead_final_seen;
    /* LANL Even Length End */

    int bottom_extension_odd;
    int bottom_extension_special;
    int have_zero_row;
    float **receiving_buf;
    float **ps_buf[2];
  } hplx_rolling_buffer, *hplx_rolling_buffer_ptr;
  /* This structure manages a rolling buffer for efficient vertical filtering.
     The rolling buffer maintains a window into an image or subband,
     consisting of at most `window_rows' rows, but initially fewer rows.
     The first actual available row has the zero-based index, `min_row_idx',
     while `next_row_idx' identifies the zero-based index of the row
     immediately passed the last available row.  The `buffer' contains
     `window_rows' fully allocated row buffers.  The `rows' and `cols'
     values identify the dimensions of the relevant image or subband within
     the current tile.  The structure is used to serve requests
     for ranges of input rows which are needed to synthesize some new output
     row.  The requests identify rows which may lie beyond the upper or lower
     bounds of the subband within the current tile, in which case a symmetric
     extension policy must be applied.
         The `top_extension_odd', `bottom_extension_odd' and
     `bottom_extension_special' fields provide the configuration parameters
     for the symmetric extension policy, identifying whether odd or even
     symmetry is to be used in extending beyond each of the boundaries and
     whether odd symmetry at the lower boundary is to be centred about the
     last actual row or about the row beyond the last one, where that
     row is set identically to zero.  This latter case is the extension
     policy required for the high-pass vertical subband of odd height images
     (or tiles) when synthesizing with even length filter kernels.  For more
     information, consult the careful explanations in the "ifc.h" header file.
         The `have_zero_row' field becomes non-zero only once the window
     buffer has advanced all the way to the bottom and has then been advanced
     once more so that the last buffer row becomes available and is filled
     with zeros.  The field exists so that we can avoid performing this
     operation more than once.  The need to fill the row beyond the last
     row in the image arises during boundary extension with even-length
     filters and odd-length images.
         The `receiving_buf' array holds `window_rows' pointers.  It provides
     a temporary scratch space for implementing symmetric extension
     policies.
         The `ps_buf' array holds rows used for point symmetric extension
     (as simply copying rows cannot be used) */


/* ========================================================================= */
/* -------------------- Exported Function Definitions ---------------------- */
/* ========================================================================= */

extern float *
  hplx_rolling_buffer__advance(hplx_rolling_buffer_ptr window);
   /* Advances the moving window to allow a new row to be written into the
      buffer, returning a pointer to this row buffer. */

extern float **
  hplx_rolling_buffer__get_rows(hplx_rolling_buffer_ptr window,
                                int min_row_idx, int num_rows,
                                int sign_flips[], int whichBand,
                                int isAnalysis, int usePsExtension,
                                float* lowEndValues);
   /* This function services requests for `num_rows' new row buffers, starting
      from the buffer with zero-based row index, `min_row_idx'.  If the request
      is successful, a pointer is returned to an internal buffer containing
      pointers to all the relevant rows.  Otherwise, if one or more of the
      required rows does not lie within the window managed by the rolling
      buffer, the function returns NULL.  If one or more of the requested
      rows lies outside the boundary of the image (current tile), the
      appropriate boundary extension policy is applied to satisfy the
      request, if possible.
          The `sign_flips' argument should be NULL, unless the buffer
      is being used to manage a window into a subband which is being
      synthesized, in which case the argument provides a mechanism to
      track sign reversal which must be introduced when symmetrically
      extending the high-pass subband rows, when the filter lengths
      are even.  The array must have `num_rows' entries.  Upon return,
      the array will have zeros at every entry except those for which
      the corresponding row's samples must be sign-reversed during
      synthesis.
          whichBand is 0 for the low pass, and 1 for the high pass.
          isAnalysis is 1 if called during analysis, otherwise it is 0.
          usePsExtension is 1 if point symmetric extension is used. */

#endif /* HPLX_VERT_CONVOLUTION_H */

⌨️ 快捷键说明

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