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

📄 global.hpp

📁 完整的RTP RTSP代码库
💻 HPP
📖 第 1 页 / 共 2 页
字号:
/*************************************************************************This software module was originally developed by 	Ming-Chieh Lee (mingcl@microsoft.com), Microsoft Corporation	Wei-ge Chen (wchen@microsoft.com), Microsoft Corporation	Bruce Lin (blin@microsoft.com), Microsoft Corporation	Chuang Gu (chuanggu@microsoft.com), Microsoft Corporation	(date: March, 1996)and edited by	Yoshihiro Kikuchi (TOSHIBA CORPORATION)	Takeshi Nagai (TOSHIBA CORPORATION)	Toshiaki Watanabe (TOSHIBA CORPORATION)	Noboru Yamaguchi (TOSHIBA CORPORATION)and also edited by    Mathias Wien (wien@ient.rwth-aachen.de) RWTH Aachen / Robert BOSCH GmbHand also edited by	Hideaki Kimata (NTT)and also edited by    Fujitsu Laboratories Ltd. (contact: Eishi Morimatsu)     Sehoon Son (shson@unitel.co.kr) Samsung AITin the course of development of the MPEG-4 Video (ISO/IEC 14496-2). This software module is an implementation of a part of one or more MPEG-4 Video tools as specified by the MPEG-4 Video. ISO/IEC gives users of the MPEG-4 Video free license to this software module or modifications thereof for use in hardware or software products claiming conformance to the MPEG-4 Video. Those intending to use this software module in hardware or software products are advised that its use may infringe existing patents. The original developer of this software module and his/her company, the subsequent editors and their companies, and ISO/IEC have no liability for use of this software module or modifications thereof in an implementation. Copyright is not released for non MPEG-4 Video conforming products. Microsoft retains full right to use the code for his/her own purpose, assign or donate the code to a third party and to inhibit third parties from using the code for non <MPEG standard> conforming products. This copyright notice must be included in all copies or derivative works. Copyright (c) 1996, 1997.Revision History:	Aug.24, 1999 : NEWPRED added by Hideaki Kimata (NTT) 	Sep.06	1999 : RRV added by Eishi Morimatsu (Fujitsu Laboratories Ltd.) *************************************************************************/#ifndef __GLOBAL_HPP_#define __GLOBAL_HPP_// global tables for overlap motion comp.// central block#ifdef __GLOBAL_VAR_// NEWPRED	class			CNewPredEncoder;	class			CNewPredDecoder;	CNewPredEncoder*	g_pNewPredEnc;	CNewPredDecoder*	g_pNewPredDec;// ~NEWPREDUInt gWghtC[8][8] = {	{4,5,5,5,5,5,5,4},	{5,5,5,5,5,5,5,5},	{5,5,6,6,6,6,5,5},	{5,5,6,6,6,6,5,5},	{5,5,6,6,6,6,5,5},	{5,5,6,6,6,6,5,5},	{5,5,5,5,5,5,5,5},	{4,5,5,5,5,5,5,4},};// top blockUInt gWghtT[8][8] = {	{2,2,2,2,2,2,2,2},	{1,1,2,2,2,2,1,1},	{1,1,1,1,1,1,1,1},	{1,1,1,1,1,1,1,1},	{0,0,0,0,0,0,0,0},	{0,0,0,0,0,0,0,0},	{0,0,0,0,0,0,0,0},	{0,0,0,0,0,0,0,0},};// bottom blockUInt gWghtB[8][8] = {	{0,0,0,0,0,0,0,0},	{0,0,0,0,0,0,0,0},	{0,0,0,0,0,0,0,0},	{0,0,0,0,0,0,0,0},	{1,1,1,1,1,1,1,1},	{1,1,1,1,1,1,1,1},	{1,1,2,2,2,2,1,1},	{2,2,2,2,2,2,2,2},};// right blockUInt gWghtR[8][8] = {	{0,0,0,0,1,1,1,2},	{0,0,0,0,1,1,2,2},	{0,0,0,0,1,1,2,2},	{0,0,0,0,1,1,2,2},	{0,0,0,0,1,1,2,2},	{0,0,0,0,1,1,2,2},	{0,0,0,0,1,1,2,2},	{0,0,0,0,1,1,1,2},};// left blockUInt gWghtL[8][8] = {	{2,1,1,1,0,0,0,0},	{2,2,1,1,0,0,0,0},	{2,2,1,1,0,0,0,0},	{2,2,1,1,0,0,0,0},	{2,2,1,1,0,0,0,0},	{2,2,1,1,0,0,0,0},	{2,2,1,1,0,0,0,0},	{2,1,1,1,0,0,0,0},};// RRV insertionUInt gWghtC_RRV[16][16] = {	{4,4,5,5,5,5,5,5,5,5,5,5,5,5,4,4},	{4,4,5,5,5,5,5,5,5,5,5,5,5,5,4,4},	{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},	{5,5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,0,0,0,0,0,1,1,1,1,2,2,2,2},	{0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2},	{0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2},};// left blockUInt gWghtL_RRV[16][16] = {	{2,2,1,1,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,1,1,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,1,1,1,1,1,1,0,0,0,0,0,0,0,0},	{2,2,1,1,1,1,1,1,0,0,0,0,0,0,0,0},};// ~RRV// rounding table for Chrominace mv; see VM1.1/Table ?Int grgiMvRound16 [16] = {	0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,};Int grgiMvRound12 [12] = {	0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2,};Int grgiMvRound8 [8] = {	0, 0, 1, 1, 1, 1, 1, 2,};Int grgiMvRound4 [4] ={	0, 1, 1, 1,};//index of candidate blocks for diffrential mv codingBlockNum gIndexOfCandBlk[5][3] = {					{Y_BLOCK2, Y_BLOCK3, Y_BLOCK3}, 						{Y_BLOCK2, Y_BLOCK3, Y_BLOCK3}, 					{Y_BLOCK1, Y_BLOCK4, Y_BLOCK3},					{Y_BLOCK4, Y_BLOCK1, Y_BLOCK2},					{Y_BLOCK3, Y_BLOCK1, Y_BLOCK2}};//MPEG quantizer matrixInt rgiDefaultIntraQMatrix [BLOCK_SQUARE_SIZE] = {	8,	17,	18,	19,	21,	23,	25,	27,	17,	18,	19,	21,	23,	25,	27,	28,	20,	21,	22,	23,	24,	26,	28,	30,	21,	22,	23,	24,	26,	28,	30,	32,	22,	23,	24,	26,	28,	30,	32,	35,	23,	24,	26,	28,	30,	32,	35,	38,	25,	26,	28,	30,	32,	35,	38,	41,	27,	28,	30,	32,	35,	38,	41,	45};Int rgiDefaultInterQMatrix [BLOCK_SQUARE_SIZE] = {	16,	17,	18, 19, 20,	21,	22,	23,	17,	18,	19,	20,	21,	22,	23,	24,	18,	19,	20,	21,	22,	23,	24,	25,	19,	20,	21,	22,	23,	24,	26,	27,	20,	21,	22,	23,	25,	26,	27,	28,	21,	22,	23,	24,	26,	27,	28,	30,	22,	23,	24,	26,	27,	28,	30,	31,	23,	24,	25,	27,	28,	30,	31,	33};//added by mwiInt rgiDefaultIntraQMatrixAlpha [BLOCK_SQUARE_SIZE] = {	8,	17,	18,	19,	21,	23,	25,	27,	17,	18,	19,	21,	23,	25,	27,	28,	20,	21,	22,	23,	24,	26,	28,	30,	21,	22,	23,	24,	26,	28,	30,	32,	22,	23,	24,	26,	28,	30,	32,	35,	23,	24,	26,	28,	30,	32,	35,	38,	25,	26,	28,	30,	32,	35,	38,	41,	27,	28,	30,	32,	35,	38,	41,	45};Int rgiDefaultInterQMatrixAlpha [BLOCK_SQUARE_SIZE] = {	16,	17,	18, 19, 20,	21,	22,	23,	17,	18,	19,	20,	21,	22,	23,	24,	18,	19,	20,	21,	22,	23,	24,	25,	19,	20,	21,	22,	23,	24,	26,	27,	20,	21,	22,	23,	25,	26,	27,	28,	21,	22,	23,	24,	26,	27,	28,	30,	22,	23,	24,	26,	27,	28,	30,	31,	23,	24,	25,	27,	28,	30,	31,	33};//~added by mwi/*Int rgiDefaultIntraQMatrix [BLOCK_SQUARE_SIZE] = {	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16};Int rgiDefaultInterQMatrix [BLOCK_SQUARE_SIZE] = {	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16,	16,	16,	16,	16,	16,	16,	16, 16};*/Int grgiStandardZigzag [BLOCK_SQUARE_SIZE] = {	0, 1, 8, 16, 9, 2, 3, 10, 	17, 24, 32, 25, 18, 11, 4, 5, 	12, 19, 26, 33, 40, 48, 41, 34, 	27, 20, 13, 6, 7, 14, 21, 28, 	35, 42, 49, 56, 57, 50, 43, 36, 	29, 22, 15, 23, 30, 37, 44, 51, 	58, 59, 52, 45, 38, 31, 39, 46, 	53, 60, 61, 54, 47, 55, 62, 63};Int grgiHorizontalZigzag [BLOCK_SQUARE_SIZE] = {	0, 1, 2, 3, 8, 9, 16, 17, 	10, 11, 4, 5, 6, 7, 15, 14, 	13, 12, 19, 18, 24, 25, 32, 33, 	26, 27, 20, 21, 22, 23, 28, 29, 	30, 31, 34, 35, 40, 41, 48, 49, 	42, 43, 36, 37, 38, 39, 44, 45, 	46, 47, 50, 51, 56, 57, 58, 59, 	52, 53, 54, 55, 60, 61, 62, 63};Int grgiVerticalZigzag [BLOCK_SQUARE_SIZE] = {	0, 8, 16, 24, 1, 9, 2, 10, 	17, 25, 32, 40, 48, 56, 57, 49, 	41, 33, 26, 18, 3, 11, 4, 12, 	19, 27, 34, 42, 50, 58, 35, 43, 	51, 59, 20, 28, 5, 13, 6, 14, 	21, 29, 36, 44, 52, 60, 37, 45, 	53, 61, 22, 30, 7, 15, 23, 31, 	38, 46, 54, 62, 39, 47, 55, 63};UInt grgIfNotLastNumOfLevelAtRun [27] = {	12, 6, 4, 3, 3, 3, 3, 2, 2, 2, 2, 	 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	 1, 1, 1, 1, 1};UInt grgIfLastNumOfLevelAtRun [41] = {	 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,	 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,	 1, 1, 1, 1, 1, 1, 1, 1};UInt grgiIntraYAVCLHashingTable [102] = {1, 3, 6, 9, 10, 13, 14, 17, 18, 21,22, 23, 2, 34, 11, 19, 24, 25, 33, 12,20, 26, 4, 15, 39, 5, 130, 27, 65, 68,41, 7, 100, 195, 8, 131, 97, 258, 129,163, 35, 42, 66, 225, 36, 98, 16, 37,38, 67, 99, 162, 194, 226, 40, 290, 69,227, 1025, 353, 1030, 1057, 1031, 1089, 161, 1026, 1185, 193, 1121, 1153, 1313, 257, 289,321, 1027, 1217, 1249, 1281, 385, 1028, 1058,1345, 1377, 1409, 1441, 1473, 417, 1029, 1059,1090, 1122, 1154, 1505, 1537, 449, 1032, 1186,1218, 1569, 1601, 1633, 1665};Int g_rgiLMAXintra [128] ={27, 10, 5, 4, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 0, 						    0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,							0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,							0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,							8,  3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 							1,  1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,							0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,							0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};Int g_rgiRMAXintra [64]  = {0, 15,10, 8, 4, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 						    1,  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,						    0, 21, 7, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,						    0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};Int g_rgiLMAXinter [128] = {12, 6, 4, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 							 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,							 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,							 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,							 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 							 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 							 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,							 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};Int g_rgiRMAXinter [64]  = {0, 27, 11, 7, 3, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0,							0, 0,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,						    0, 41,  2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,							0, 0,   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};U16 gCAEintraProb [1024] = {65267,16468,65003,17912,64573,8556,64252,5653,40174,3932,29789,277,45152,1140,32768,2043,4499,80,6554,1144,21065,465,32768,799,5482,183,7282,264,5336,99,6554,563,54784,30201,58254,9879,54613,3069,32768,58495,32768,32768,32768,2849,58982,54613,32768,12892,

⌨️ 快捷键说明

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