📄 ebcot_vpw.h
字号:
/*****************************************************************************/
/* Copyright 1998, Hewlett-Packard Company */
/* All rights reserved */
/* File: "ebcot_vpw.h" */
/* Description: Header file for visually progressive weighting functionality */
/* in the EBCOT compressor (actually only used during */
/* bit-stream formation. */
/* Author: David Taubman */
/* Affiliation: Hewlett-Packard and */
/* The University of New South Wales, Australia */
/* Acknowledgements: Based on the ideas developed by Jin Li and Shawmin Lei */
/* at Sharp Labs, U.S.A. */
/* Version: VM6.0 */
/* Last Revised: 19 January 2000 */
/*****************************************************************************/
/*****************************************************************************/
/* Modified by David Taubman to support interface modifications, arbitrary */
/* changes in coding parameters from component to component and from tile */
/* to tile, packet partitions, rich packet sequencing conventions and 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. */
/*****************************************************************************/
#ifndef EBCOT_VIP_H
#define EBCOT_VIP_H
#include "ebcot_encoder.h"
/* ========================================================================= */
/* ------------------------------ Type Definitions ------------------------- */
/* ========================================================================= */
/*****************************************************************************/
/* ebcot_vpw_rate_info */
/*****************************************************************************/
typedef
struct ebcot_vpw_rate_info {
float max_rate;
int max_cumulative_bytes;
char *filename;
struct ebcot_vpw_rate_info *next;
} ebcot_vpw_rate_info, *ebcot_vpw_rate_info_ptr;
/* This structure is used to build a list of rate points at which
new visual progressive weighting specifications must be loaded.
`max_rate' holds the maximum target bit-rate, in bpp, for which
the new weights are relevant.
`max_cumulative_bytes' is derived from `max_rate' by taking
into account the dimensions of the largest component in the image and
also the size of the global header. This is the maximum value of
the `max_cumulative_bytes' field in an `ebcot_layer_info' structure
for which the new weights should be used to generate the layer.
`filename' is a dynamically allocated string (must be freed)
identifying the name of the file from which the relevant visual weights
may be loaded. */
/*****************************************************************************/
/* ebcot_vpw_info */
/*****************************************************************************/
typedef
struct ebcot_vpw_info {
ebcot_vpw_rate_info_ptr list;
ebcot_vpw_rate_info_ptr loaded_entry;
} ebcot_vpw_info; /* `ebcot_vpw_info_ptr' declared forward */
/* in "ebcot_encoder.h" */
/* Visual progressive weighting functionality is anchored at this
structure.
`list' points to the head of a list of rate-points and assocated
visual weighting files.
`loaded_entry' points to the entry in the list which corresponds
to the weights which are currently loaded. The field holds NULL once
the rate exceeds that of the last entry in the list. */
/* ========================================================================= */
/* ------------------------- External Function Headers --------------------- */
/* ========================================================================= */
extern ebcot_vpw_info_ptr
create_ebcot_vpw(int argc, char *argv[]);
/* Creates the structure and builds a preliminary list of rates
and file names, from the `-Cvpw' argument, if it finds one. */
extern void
ebcot_vpw__complete(ebcot_vpw_info_ptr vpw, int rows, int cols,
int header_bytes);
/* Completes the list of rates/filenames in `vpw' which was first
created using the above function, once the header size is
known. Multiplies the bit-rates by `rows'*`cols' and subtracts
the header size to obtain the `max_cumulative_bytes' thresholds. */
extern void
ebcot_vpw__terminate(ebcot_vpw_info_ptr vpw);
/* Cleans up the internal list and the `vpw' structure itself. */
extern void
ebcot_vpw__set_layer_weights(ebcot_vpw_info_ptr vpw,
ebcot_encoder_ref encoder,
int max_cumulative_bytes);
/* This function should be called from within "ebcot_send_bits.c" whenever
a new layer is about to be built. If necessary, a new set of visual
weights will be loaded. */
#endif /* EBCOT_VIP_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -