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

📄 dst_arith_coder_common.h

📁 JPEG2000实现的源码
💻 H
字号:
/*****************************************************************************/
/* Copyright 1998, Hewlett-Packard Company                                   */
/* All rights reserved                                                       */
/* File: "dst_arith_coder_common.h"                                          */
/* Description: Header file for "dst_arith_coder_common.c"                   */
/* Author: David Taubman                                                     */
/* Affiliation: Hewlett-Packard and                                          */
/*              The University of New South Wales, Australia                 */
/* Version: VM5.1                                                            */
/* Last Revised: 15 August, 1999                                             */
/*****************************************************************************/
#ifndef DST_ARITH_CODER_COMMON_H
#define DST_ARITH_CODER_COMMON_H
#include <ifc.h>

/* #define DST_LOG_SYMBOLS */ /* Uncomment this if you want to log symbols
                                 for debugging purposes. */

#define DST_ARITH_MEM_KEY "ARITHMETIC CODING IMPLEMENTATION MEMORY"
#define DST_ARITH_MAX_CTXTS 20
#define DST_ARITH_MPS_POS 18 /* Index of MPS bit in 1'st context state word */

/* ========================================================================= */
/* ----------------------------- Type Definitions -------------------------- */
/* ========================================================================= */

/*****************************************************************************/
/*                              dst_context_state                            */
/*****************************************************************************/

typedef std_int dst_context_state, *dst_context_state_ptr;
  /* Each context model is represented by two 32-bit words in the current
     implementation.  The organization is designed to maximize execution
     speed for highly skewed distributions at the expense of less skewed
     distributions.  The two context words are separated by
     DST_ARITH_MAX_CTXTS entries in the array of context words.
         The first word holds the state index and the MPS bit.  Specifically,
     the MPS is identified by the least significant bit of this word, while
     the remaining bits hold the appropriate index into the state transition
     table.
         The second word holds the `delta' value, i.e. the quantized
     representation of the probability of the MPS (Most Probable Symbol).
     Bit position DST_ARITH_MPS_POS of this word also holds a replica of the
     MPS -- a value of 1 means that MPS=1, which is assumed to occur much
     less frequently than MPS=0.  This organization allows the MQ coder
     implementation to get away with only a single derference and
     comparison operation most of the time, provided the distribution is
     sufficiently skewed.  To understand this, the reader is referred to
     the decoding macros appearing in "dst_arith_decoder.h". */

/* ========================================================================= */
/* ----------------------------------- LUT's ------------------------------- */
/* ========================================================================= */

extern dst_context_state dst_arith_state_to_delta[2*47];
          /* Maps the first word of a context (including the MPS bit) into
             the second (see definition above). */
extern dst_context_state dst_arith_trans_mps[2*47];
          /* Applies an MPS state transition to the first word of a context
             (including the MPS bit).  To complete the transition, the second
             context word must be recovered by applying the
             `dst_arith_state_to_delta' mapping to the result. */
extern dst_context_state dst_arith_trans_lps[2*47];
          /* Applies an MPS state transition to the first word of a context
             (including the MPS bit).  To complete the transition, the second
             context word must be recovered by applying the
             `dst_arith_state_to_delta' mapping to the result. */

/* ========================================================================= */
/* ----------------------------- External Functions ------------------------ */
/* ========================================================================= */

extern void
  dst_arith_coder__initialize_global_luts(void);

#endif /* DST_ARITH_CODER_COMMON_H */

⌨️ 快捷键说明

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