【VC开源代码栏目提醒】:网学会员VC开源代码为您提供ztscan_dec.cpp参考,解决您在ztscan_dec.cpp学习中工作中的难题,参考学习。
/* $Id: ztscan_dec.cpp,v 1.3 2001/04/30 20:51:45 dmackie Exp $ */
/****************************************************************************/
/* MPEG4 Visual Texture Coding (VTC) Mode Software */
/* */
/* This software was jointly developed by the following participants: */
/* */
/* Single-quant, multi-quant and flow control */
/* are provided by Sarnoff Corporation */
/* Iraj Sodagar (iraj@sarnoff.com) */
/* Hung-Ju Lee (hjlee@sarnoff.com) */
/* Paul Hatrack (hatrack@sarnoff.com) */
/* Shipeng Li (shipeng@sarnoff.com) */
/* Bing-Bing Chai (bchai@sarnoff.com) */
/* B.S. Srinivas (bsrinivas@sarnoff.com) */
/* */
/* Bi-level is provided by Texas Instruments */
/* Jie Liang (liang@ti.com) */
/* */
/* Shape Coding is provided by OKI Electric Industry Co., Ltd. */
/* Zhixiong Wu (sgo@hlabs.oki.co.jp) */
/* Yoshihiro Ueda (yueda@hlabs.oki.co.jp) */
/* Toshifumi Kanamaru (kanamaru@hlabs.oki.co.jp) */
/* */
/* OKI, Sharp, Sarnoff, TI and Microsoft contributed to bitstream */
/* exchange and bug fixing. */
/* */
/* */
/* In the course of development of the MPEG-4 standard, this software */
/* module is an implementation of a part of one or more MPEG-4 tools as */
/* specified by the MPEG-4 standard. */
/* */
/* The copyright of this software belongs to ISO/IEC. ISO/IEC gives use */
/* of the MPEG-4 standard free license to use this software module or */
/* modifications thereof for hardware or software products claiming */
/* conformance to the MPEG-4 standard. */
/* */
/* Those intending to use this software module in hardware or software */
/* products are advised that use may infringe existing patents. The */
/* original developers of this software module and their companies, the */
/* subsequent editors and their companies, and ISO/IEC have no liability */
/* and ISO/IEC have no liability for use of this software module or */
/* modification thereof in an implementation. */
/* */
/* Per
mission is granted to MPEG members to use, copy, modify, */
/* and distribute the software modules ( or portions thereof ) */
/* for standardization activity within ISO/IEC JTC1/SC29/WG11. */
/* */
/* Copyright 1995, 1996, 1997, 1998 ISO/IEC */
/****************************************************************************/
/************************************************************/
/* Sarnoff Very Low Bit Rate Still Image Coder */
/* Copyright 1995, 1996, 1997, 1998 Sarnoff Corporation */
/************************************************************/
/************************************************************/
/* Filename: ztscan_dec.c */
/* Author: Bing-Bing CHai */
/* Date: Dec. 17, 1997 */
/* */
/* Descriptions: */
/* This file contains the routines that performs */
/* zero tree scanning and entropy decoding. */
/* */
/************************************************************/
#include <stdio.h>
#include <stdlib.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include <ctype.h>
#include <string.h>
#include <math.h>
#include "basic.hpp"
#include "Utils.hpp"
#include "startcode.hpp"
#include "dataStruct.hpp"
#include "states.hpp"
#include "globals.hpp"
#include "errorHandler.hpp"
#include "ac.hpp"
#include "bitpack.hpp"
//#include "context.hpp"
#include "ztscan_common.hpp"
#include "ztscanUtil.hpp"
static ac_decoder acd;
/******************************************************************/
/**************************** DC ********************************/
/******************************************************************/
/*******************************************************/
/************** Inverse DC Prediction ****************/
/*******************************************************/
/********************************************************
Function Name
-------------
static DATA iDC_pred_pix(Int i, Int j)
Arguments
---------
Int i, Int j: Index of wavelet coefficient (row, col)
Description
-----------
Inverse DPCM prediction for a DC coefficient, refer
to syntax for algorithm.
Functions Called
----------------
None.
Return Value
------------
inverse prediction for coeffinfo[i][j].quantized_value
********************************************************/
Short CVTCDecoder::iDC_pred_pix(Int i, Int j)
{
/* modified by Z. Wu @ OKI */
Int pred_i, pred_j, pred_d;
if ( i==0 || coeffinfo[i-1][j].mask == 0 )
pred_i = 0;
else
pred_i = coeffinfo[i-1][j].quantized_value;
if ( j==0 || coef