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

📄 libqccpackspiht.h

📁 该源码是SPIHT即分层树集合划分算法的c代码,希望对搞压缩编码的朋友们有用.
💻 H
字号:
/*
 *
 * QccPack: Quantization, compression, and coding utilities
 * Copyright (C) 1997-2001  James E. Fowler
 * 
 */

/*
 * ----------------------------------------------------------------------------
 * 
 * Public License for the SPIHT Algorithm
 * Version 1.0, September 22, 1999
 * 
 * ----------------------------------------------------------------------------
 * 
 * The Set Partitioning In Hierarchical Trees (SPIHT) algorithm is protected
 * by US Patent #5,764,807 (issued June 9, 1998) and other international
 * patents and patents pending. An implementation of the SPIHT algorithm is
 * included herein with the permission of PrimaComp, Inc., exclusive holder
 * of patent rights. PrimaComp has graciously granted the following license
 * governing the terms and conditions for use, copying, distribution, and
 * modification of the SPIHT algorithm implementation contained herein
 * (hereafter referred to as "the SPIHT source code").
 * 
 * 0. Use of the SPIHT source code, including any executable-program or
 *    linkable-library form resulting from its compilation, is restricted to
 *    solely academic or non-commercial research activities.
 * 
 * 1. Any other use, including, but not limited to, use in the development
 *    of a commercial product, use in a commercial application, or commercial
 *    distribution, is prohibited by this license. Such acts require a separate
 *    license directly from PrimaComp, Inc.
 * 
 * 2. For academic and non-commercial purposes, this license does not restrict
 *    use; copying, distribution, and modification are permitted under the
 *    terms of the GNU General Public License as published by the Free Software
 *    Foundation, with the further restriction that the terms of the present
 *    license shall also apply to all subsequent copies, distributions,
 *    or modifications of the SPIHT source code.
 * 
 * NO WARRANTY
 * 
 * 3. PrimaComp dislaims all warranties, expressed or implied, including
 *    without limitation any warranty whatsoever as to the fitness for a
 *    particular use or the merchantability of the SPIHT source code.
 * 
 * 4. In no event shall PrimaComp be liable for any loss of profits, loss of 
 *    business, loss of use or loss of data, nor for indirect, special,
 *    incidental or consequential damages of any kind related to use of the
 *    SPIHT source code.
 * 
 * 
 * END OF TERMS AND CONDITIONS
 * 
 * 
 * Persons desiring to license the SPIHT algorithm for commercial purposes or
 * for uses otherwise prohibited by this license may wish to contact
 * PrimaComp, Inc., regarding the possibility of negotiating such licenses:
 * 
 *   PrimaComp, Inc.
 *   1223 Peoples Ave.
 *   Troy, New York  12180
 *   USA
 *   +1 (518) 276-8276
 *   inquire@primacomp.com
 *   http://www.primacomp.com
 * 
 * ----------------------------------------------------------------------------
 */


#ifndef LIBQCCPACKSPIHT_H
#define LIBQCCPACKSPIHT_H


/*  spiht.c  */
#define QCCSPIHT_LICENSE "\n******************************************************************************\n  The Set Partitioning In Hierarchical Trees (SPIHT) algorithm is protected\n  by US Patent #5,764,807 (issued June 9, 1998) and other international\n  patents and patents pending. An implementation of the SPIHT algorithm is\n  included herein (utility programs spihtencode and spihtdecode, and spiht.c\n  in the QccPackSPIHT module of the QccPack library) with the permission of\n  PrimaComp, Inc., exclusive holder of patent rights. PrimaComp has graciously\n  granted a license with certain restrictions governing the terms and\n  conditions for use, copying, distribution, and modification of the SPIHT\n  algorithm implementation contained herein. Specifically, only use in\n  academic and non-commercial research is permitted, while all commercial\n  use is prohibited.  Refer to the file LICENSE-SPIHT for more details.\n******************************************************************************"

#define QCCSPIHT_MAJORVERSION 0
#define QCCSPIHT_MINORVERSION 34
#define QCCSPIHT_COPYRIGHT "Copyright (C) 1997-2001 James E. Fowler"
#define QCCSPIHT_DATE "06-jul-2001"

#define QCCSPIHT_TYPE_A 0
#define QCCSPIHT_TYPE_B 1
#define QCCSPIHT_ENCODE 0
#define QCCSPIHT_DECODE 1

typedef struct
{
  int row;
  int col;
  unsigned char type;
  unsigned char state;
} QccSPIHTCoefficientBlock;
void QccSPIHTHeader(void);
int QccSPIHTEncode(const QccIMGImageComponent *image,
		   const QccIMGImageComponent *mask,
		   QccBitBuffer *buffer,
		   int num_levels,
		   const QccWAVWavelet *wavelet,
		   const QccWAVPerceptualWeights *perceptual_weights,
		   int target_bit_cnt,
		   int arithmetic_coded);
int QccSPIHTDecodeHeader(QccBitBuffer *buffer, 
			 int *num_levels, 
			 int *num_rows, int *num_cols,
			 double *image_mean,
			 int *max_coefficient_bits,
			 int *arithmetic_coded);
int QccSPIHTDecode(QccBitBuffer *buffer,
		   QccIMGImageComponent *image,
		   const QccIMGImageComponent *mask,
		   int num_levels,
		   const QccWAVWavelet *wavelet,
		   const QccWAVPerceptualWeights *perceptual_weights,
		   double image_mean,
		   int max_coefficient_bits,
		   int arithmetic_coded);


#endif /* LIBQCCPACKSPIHT_H */

⌨️ 快捷键说明

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