📄 hplx_analysis_local.h
字号:
/*****************************************************************************/
/* Copyright 1998, Hewlett-Packard Company */
/* All rights reserved */
/* File: "hplx_analysis_local.h" */
/* Description: Private definitions for "hplx_analysis.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: VM9.0 */
/* Last Revised: 20 April, 2001 */
/*****************************************************************************/
/*****************************************************************************/
/* Modified to include Lagrangian Rate Allocation */
/* Copyright 1999 Fujifilm Software Colifornia Inc. */
/* Copyright 1999 Science Applications International Corporation (SAIC). */
/* Copyright 1995 University of Arizona, Arizona Board of Regents. */
/* All Rights Reserved for 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 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 HPLX_ANALYSIS_LOCAL_H
#define HPLX_ANALYSIS_LOCAL_H
#include <ifc.h>
#include "hplx_common.h"
/* Christos Chrysafis (HPL) */
extern int symmetric_extension_type(int evenFilter,
int oddSignal,
int Highpass_Not_LowPass,
int right_Not_left);
/* ========================================================================= */
/* -------------------------- Forward Declarations ------------------------- */
/* ========================================================================= */
typedef struct hplx_analysis_obj *hplx_analysis_ref;
typedef struct hplx_analysis_stage_obj *hplx_analysis_stage_ref;
/*****************************************************************************/
/* hplx_analysis_stage_obj */
/*****************************************************************************/
typedef void (*hplx_analysis_stage__initialize__func)
(hplx_analysis_stage_ref self, forward_info_ref info,
canvas_dims_ptr tile_dims, canvas_dims_ptr frame_dims);
/* Initializes the analysis stage object. Within this call, the relevant
kernel coefficients should be installed by calling the appropriate
interface functions on the `info' object. Also, the function is
responsible for invoking the `initialize' functions on all descendant
`hplx_analysis_stage' objects, i.e. those identified by non-NULL
entries in the object's `branches' array.
The dimensions and location of the tile, as well as framing
information refer to the tile-component whose lines are being pushed
into the analysis stage. The `frame_dims' argument points to a
structure which holds the nominal frame dimensions at the input to
the analysis stage object as well as the coordinates of the framing
anchor point. The transform may need to be modified at frame
boundaries, depending on whether or not the SSO-DWT is being used.
At any rate, the frame dimensions and reference point must be
converted as appropriate before recursively passing them to descendant
stages. */
typedef void (*hplx_analysis_stage__push_line_fixed__func)
(hplx_analysis_stage_ref self, ifc_int *line_buf, int width);
/* Pushes a new line of samples into the object. The response
is to apply all possible transform steps, generating as much data
as possible before returning. Note that several lines may need to
be pushed in before anything can be generated and passed on to the
next stage. On the other hand, when the last line is pushed in,
the object will generally be able to generate multiple lines of
output. The `width' argument is provided for consistency checking
only.
It should be noted that there are two `push_line_xxx' functions.
This function accepts fixed-point data, which must be converted
internally into floating point data if the transform is to be
implemented in floating point; however, floating point data need
not be converted back into fixed point data, since the descendant
analysis stages and the quantizer can all accept either fixed or
floating point data.
To simplify the implementation of the analysis system, we INSIST
that the analysis stages' `push_line' functions NOT OVERWRITE the
contents of the buffer with which they are supplied!! */
typedef void (*hplx_analysis_stage__push_line_float__func)
(hplx_analysis_stage_ref self, float *line_buf, int width);
/* Exhibits the same behaviour as the `push_line_fixed' interface
function, except that the data type is floating point. The
implementor can be certain that this function will only be called
if the decomposition is non-reversible.
To simplify the implementation of the analysis system, we INSIST
that the analysis stages' `push_line' functions NOT OVERWRITE the
contents of the buffer with which they are supplied!! */
typedef void (*hplx_analysis_stage__terminate__func)
(hplx_analysis_stage_ref self);
/* Destroys the object and all allocated storage; also recursively
propagates the destruction operation to all descendant
analysis stage objects. */
/* SAIC/Fuji LRA begin */
typedef
struct lra_raw_stats_obj {
unsigned long int N; /* Running total of pixels in this subband */
long double x1; /* Running total of x^1 (1st moment) */
long double x2; /* Running total of x^2 (2nd moment) */
long double x3; /* Running total of x^3 (3rd moment) */
long double x4; /* Running total of x^4 (4th moment) */
} lra_raw_stats_obj, *lra_raw_stats_ref;
/* This structure is used to collect statistics used by the Lagrangian
rate allocator. The particular statistics are identified above and
are collected just before the quantizer push_line calls in the
transform object. When the transform object is terminated, these raw
stats are passed to the individual std_band_info info elements with the
info->set_stats routine. The info object uses these stats to perform
the rate allocation. */
/* SAIC/Fuji LRA end */
typedef
struct hplx_analysis_stage_obj {
hplx_analysis_stage__initialize__func initialize;
hplx_analysis_stage__push_line_fixed__func push_line_fixed;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -