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

📄 global.h

📁 avs音视频解码程序
💻 H
字号:
/*************************************************************************
 AVS1-P2视频解码器源码
 版权所有:联合信源数字音视频技术(北京)有限公司, (c) 2005-2006 

 AVS1-P2 Video Decoder Source Code
 (c) Copyright, NSCC All Rights Reserved, 2005-2006
 *************************************************************************
 Distributed under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*************************************************************************/
/*************************************************************************
  文件名称:	global.h
  描    述: global.cpp 的申明文件
*************************************************************************/
/*************************************************************************
  Revision History
  data          Modification                                    Author
  2005-2-8      Created                                          jthou
 *************************************************************************/
#ifndef _GLOBAL_H_
#define _GLOBAL_H_

#include <stdio.h> 
#include <MATH.H>
#include "define.h"
// global variables------------------------------------------------
const AVS_FLOAT fPictureRates[] =
   {
     (AVS_FLOAT)0,
     (AVS_FLOAT)23.976,
     (AVS_FLOAT)24,
     (AVS_FLOAT)25,
     (AVS_FLOAT)29.97,
     (AVS_FLOAT)30,
     (AVS_FLOAT)50,
     (AVS_FLOAT)59.94,
     (AVS_FLOAT)60.0
   };

const AVS_BYTE NCBP[64][2]=                                   // jlzheng 7.20
{
  {63, 0},{15, 15},{31, 63},{47, 31},{ 0, 16},{ 14,32},{13,47},{11,13},{7, 14},{5, 11},
  {10,12},{8,5},{12,10},{61,7},{4,48},{55,3},{1, 2},{2,8},{59,4},{3,1},
  {62, 61},{ 9, 55},{ 6,59},{29,62},{45,29},{51,27},{23,23},{39,19},{27,30},{46,28},
  {53,9},{30,6},{43,60},{37,21},{60,44},{16,26},{21,51},{ 28,35},{ 19,18},{ 35,20},
  { 42,24},{ 26,53},{ 44,17},{32,37},{58,39},{24,45},{20,58},{17,43},{18,42},{48,46},
  {22,36},{33,33},{25,34},{49,40},{40,52},{36,49},{34,50},{50,56},{52,25},{54,22},
  {41,54},{56,57},{38,41},{57,38}
};

const AVS_BYTE NCBP422[4][2]=                                   // jthou 
{
  {0, 0},  {1, 1},  {2, 2},  {3, 3}
};


const AVS_DWORD MvNum[53] = 
{
  //Intra Mode
  0,
  // P Mb Mode 
  0, 1, 2, 2, 4,
  // B Mb Mode
  0, 0, 1, 1, 1,
  2, 2, 2, 2, 2,
  2, 2, 2, 2, 2,
  2, 2, 2, 2, 2,
  2, 2, 2, 0, 0,
  1, 1, 1
};

const AVS_INT DequantTable[64] = {
	  32768,36061,38968,42495,46341,50535,55437,60424,
		32932,35734,38968,42495,46177,50535,55109,59933,
		65535,35734,38968,42577,46341,50617,55027,60097,
		32809,35734,38968,42454,46382,50576,55109,60056,
		65535,35734,38968,42495,46320,50515,55109,60076,
		65535,35744,38968,42495,46341,50535,55099,60087,
		65535,35734,38973,42500,46341,50535,55109,60097,
		32771,35734,38965,42497,46341,50535,55109,60099
};

const AVS_INT ShiftTable[64] = {
	15,15,15,15,15,15,15,15,
		14,14,14,14,14,14,14,14,
		14,13,13,13,13,13,13,13,
		12,12,12,12,12,12,12,12,
		12,11,11,11,11,11,11,11,
		11,10,10,10,10,10,10,10,
		10,9,9,9,9,9,9,9,
		8,8,8,8,8,8,8,8
		
};

extern AVS_BYTE ClipTable[CLIPSIZE*2+256];
extern AVS_INT  TabNoBuf[1025];
extern AVS_INT  TabNoBuf2[1025];
extern AVS_SHORT* g_pCoffData;
extern AVS_SHORT* g_pInvCoffData;

__inline
AVS_DWORD DWORD_SWAP(AVS_DWORD x)
{
#if 0
  return
     ((AVS_DWORD)( ((x) << 24) | ((x) >> 24) |
               (((x) & 0xFF00) << 8) | (((x) & 0xFF0000) >> 8)));
#else
  AVS_DWORD tmp = x;
  __asm
  {
    mov   eax, tmp
    bswap eax
    mov   tmp, eax
  }
  return tmp;
#endif
}
// global functions------------------------------------------------
//AVS_DWORD DWORD_SWAP(AVS_DWORD x);
void MakeClipTable();
void MakeTabNoBuf();
AVS_HRESULT GetMem(VIDEODATA** refFrame, AVS_INT refFrameNum);
void ReleaseMem(VIDEODATA* refFrame[], AVS_INT refNum);

#endif

⌨️ 快捷键说明

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