📄 global.hpp
字号:
/*************************************************************************
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 GmbH
and also edited by
Hideaki Kimata (NTT)
and also edited by
Fujitsu Laboratories Ltd. (contact: Eishi Morimatsu)
Sehoon Son (shson@unitel.co.kr) Samsung AIT
in 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;
// ~NEWPRED
UInt 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 block
UInt 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 block
UInt 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 block
UInt 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 block
UInt 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 insertion
UInt 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,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
{5,5,5,5,6,6,6,6,6,6,6,6,5,5,5,5},
{5,5,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0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2},
};
// left block
UInt 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 coding
BlockNum 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 matrix
Int 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 mwi
Int 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,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -