📄 vopses.h
字号:
/*************************************************************************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 Wei Wu (weiwu@stallion.risc.rockwell.com) Rockwell Science Centerand also edited by Yoshihiro Kikuchi (TOSHIBA CORPORATION) Takeshi Nagai (TOSHIBA CORPORATION) Toshiaki Watanabe (TOSHIBA CORPORATION) Noboru Yamaguchi (TOSHIBA CORPORATION)and edited by Xuemin Chen (General Instrument Corp.) Mathias Wien (wien@ient.rwth-aachen.de), RWTH Aachen / Robert BOSCH GmbH and also edited by Yoshinori Suzuki (Hitachi, Ltd.)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.Module Name: vopses.hAbstract: Base structure for the encoder for one Video Object.Revision History: December 20, 1997 Interlaced tools added by General Instrument Corp.(GI) X. Chen (xchen@gi.com), B. Eifrig (beifrig@gi.com) May. 9 1998: add boundary by Hyundai Electronics Cheol-Soo Park (cspark@super5.hyundai.co.kr) May. 9 1998: add field based MC padding by Hyundai Electronics Cheol-Soo Park (cspark@super5.hyundai.co.kr) Feb 16 1999: add Quarter Sample Mathias Wien (wien@ient.rwth-aachen.de) Feb 23 1999: GMC add by Yoshinori Suzuki (Hitachi, Ltd.) Sep.06 1999 : RRV added by Eishi Morimatsu (Fujitsu Laboratories Ltd.) *************************************************************************/#ifndef __VOPSES_HPP_ #define __VOPSES_HPP_#include "mae_pass_thru.h"#ifdef UNDER_CE#define __attribute__(x) /*NOTHING*/#endif// Changes for gmc_motion.cextern CRct m_rctCurrVOPY;extern own CSiteD* m_rgstDstQ; // quantized dst sts for sprite warpingextern UInt m_uiWarpingAccuracy; // accuracy for sprite warpingextern Int m_iNumOfPnts; // for sprite warping// ~Changes for gmc_motion.ctypedef enum {NOT_DONE, PIECE_DONE, UPDATE_DONE} SptMBstatus;typedef struct _tag_CVideoObjectDecoder{ Time m_tOldModuloBaseDisp; //of the most recently displayed I/Pvop Time m_tOldModuloBaseDecd; //of the most recently decoded I/Pvop // Added for short headers by KPN (1998-02-07, DS) UInt uiPei; // [FDS] UInt uiGobNumber; UInt uiNumGobsInVop; UInt uiNumMacroblocksInGob; UInt uiGobHeaderEmpty; // Added for short headers by KPN - END int m_iClockRateScale; // added by Sharp (98/6/26)}CVideoObjectDecoder __attribute__ ((aligned (32)));// should be typedef but some bad const usage prevents this#define BlockMemory Int*typedef struct MacroBlockMemory { BlockMemory* rgblkm;} MacroBlockMemory __attribute__ ((aligned (32)));typedef struct _tag_CVideoObject{ CVideoObjectDecoder MP4_VideoObjectDecoder; Time m_t; // current time Time m_tPastRef; // time of reference frame in past (for P/B) Time m_tFutureRef; // time of reference frame in future (for B) Int m_iBCount; // counts 1,2,3 with B frames, used to pad ref vop once. Bool m_bCodedFutureRef; Bool m_bCodedBaseRef; //OBSS_SAIT_991015 CRct m_rctDisplayWindow; //display windoew position Int m_iNumBitsTimeIncr; Time m_tDistanceBetwIPVOP; //no. of frms betw. I/PVOP = PeriodOfPVOP except for at irregular period (end of sequence) Time m_tPrevIorPVOPCounter; //frm. no of previous encoded I/PVOP Time m_tModuloBaseDisp; //of the most recently displayed I/Pvop Time m_tModuloBaseDecd; //of the most recently decoded I/Pvop/*Added by SONY (98/03/30)*/ Bool m_bUseGOV ; Bool m_bLinkisBroken;/*Added by SONY (98/03/30)*/ // MB shape data Int m_iWidthCurrBAB; Int m_iRefShpNumMBX; Int m_iRefShpNumMBY; // for MC-padding Bool* m_pbEmptyColArray; // VOP mode VOLMode m_volmd; // vol mode VOPMode m_vopmd; // vop mode UInt m_uiVOId; // VOP ID // sprite info UInt m_uiSprite; // whether this is a sprite VOP: 1 - yes; other - no CRct m_rctSpt; // rct of m_pvopcSptQ CRct m_rctSptDisp; //rct to display sprite (decoder side) SptMode m_sptMode; // sprite reconstruction mode : 0 -- basic sprite , 1 -- Object piece only, 2 -- Update piece only, 3 -- intermingled own MBSptMode* m_rgsptmd; // sprite mode 0: untransmitted; 1: transmitted; 2: updated; 3: done // internal data Int m_iStartInRefToCurrRctY, m_iStartInRefToCurrRctUV; // motion data CVector m_vctForwardMvPredBVOP[2]; // motion vector predictors for B-VOP CVector m_vctBackwardMvPredBVOP[2]; // [2] added for interlace (top & bottom fields) // some fixed variables (VOL) CRct m_rctRefFrameY, m_rctRefFrameUV; Int m_iFrameWidthYxMBSize, m_iFrameWidthYxBlkSize, m_iFrameWidthUVxBlkSize; Int m_iFrameWidthY, m_iFrameWidthUV; Int m_ivolWidth, m_ivolHeight; // VOP variables CRct m_rctCurrVOPUV; Int m_iOffsetForPadY, m_iOffsetForPadUV; CRct m_rctPrevNoExpandY, m_rctPrevNoExpandUV;////// 97/12/22 start CRct m_rctBVOPRefVOPY1, m_rctBVOPRefVOPUV1; Int m_iBVOPOffsetForPadY, m_iBVOPOffsetForPadUV; CRct m_rctBVOPPrevNoExpandY, m_rctBVOPPrevNoExpandUV;///// 97/12/22 end Int m_iVOPWidthY, m_iVOPWidthUV; Int m_iNumMB, m_iNumMBX, m_iNumMBY; Int m_iNumOfTotalMVPerRow; Int m_iSessNumMB; CMBMode *m_rgmbmd; // VOP size. need to renew every VOP CMotionVector* m_rgmv; // VOP size. need to renew every VOP CMotionVector* m_rgmvBackward; // VOP size. need to renew every VOP CMotionVector* m_rgmvBY; //Motion vectors for BY plane//OBSS_SAIT_991015 CMBMode* m_rgmbmdEnhRef; CRct m_rctBase; Int m_iNumMBBaseXRef, m_iNumMBBaseYRef; Bool m_bVPNoRight; Bool m_bVPNoBottom;//~OBSS_SAIT_991015 CMBMode *m_rgmbmdRef; CMotionVector* m_rgmvRef; // VOP size. need to renew every VOP Int m_iNumMBRef, m_iNumMBXRef, m_iNumMBYRef; PixelC* m_rgiClipTab; // clapping the reconstructed pixels Int m_iOffset; // NBIT// Added for error resilient mode by Toshiba(1997-11-14) Bool m_bVPNoLeft; Bool m_bVPNoRightTop; Bool m_bVPNoTop; Bool m_bVPNoLeftTop; Int m_iVPMBnum; // start MB in a VP// End Toshiba(1997-11-14) // MB data Int** m_rgpiCoefQ; MacroBlockMemory** m_rgpmbmAbove; MacroBlockMemory** m_rgpmbmCurr; Int* m_rgiQPpred; //QP from previous block for intra ac prediction // block data Int m_rgiDCTcoef [BLOCK_SQUARE_SIZE]; // tentative solution for indicating the first Sprite VOP Int tentativeFirstSpriteVop; // Low-latency sprite info Bool m_bFirstSpriteVop ;// flag for indicating the first Sprite VOP MacroBlockMemory*** m_rgpmbmCurr_Spt; // save MB data to be used as holes SptMBstatus** m_ppPieceMBstatus; // MB transmission status (done or not-done) SptMBstatus** m_ppUpdateMBstatus; CMBMode* m_rgmbmdSprite; // dshu: [v071] added to store mbmd array for sprite // ~GMC CMBMode** m_rgmbmdSpt; // Sprite size. Bool m_bSptMB_NOT_HOLE; // Current MB is not a hole own CSiteD* m_rgstSrcQP; // for sprite piece warping Time m_tPiece; // current sprite piece encode time Time m_tUpdate; // current sprite update encode time CRct m_rctSptQ; // rct of m_pvopcSptQ CRct m_rctOrg; // Frame size CRct m_rctPieceQ; // Region of pieces which have been encoded CRct m_rctUpdateQ; // Region of updates which have been encoded CRct m_rctSptPieceY; // piece of sprite which is currently been encoded CRct m_rctSptPieceUV; // piece of sprite which is currently been encoded Int m_iStepI; Int m_iStep; Int m_iStep_VOP; Int m_iPieceXoffset; Int m_iPieceYoffset; Int m_iPieceWidth; Int m_iPieceHeight; Bool m_bSptZoom; // the type of sprite warping(zoom/pan) Bool m_bSptHvPan; // the type of sprite warping(Horizontal or vertical panning) Bool m_bSptRightPiece; //direction (up/down or right/left) for encoding sprite piece Int *m_pSptmbBits; // bits used by a sprite macroblock CRct m_rctSptExp; // Extend the sprite size to multiples of MBSize// RRV insertion Int m_iRRVScale;// ~RRV }CVideoObject __attribute__ ((aligned (32)));// motion compensation#ifdef ENABLE_INTERLACING PixelC *m_OOFFlipQ0_Y, *m_OOFFlipQ0_U, *m_OOFFlipQ0_V; PixelC *m_IFFlipQ0_Y, *m_IFFlipQ0_U, *m_IFFlipQ0_V; CRct m_FlipRctVOPY0; PixelC *m_OOFFlipQ1_Y, *m_OOFFlipQ1_U, *m_OOFFlipQ1_V; PixelC *m_IFFlipQ1_Y, *m_IFFlipQ1_U, *m_IFFlipQ1_V; CRct m_FlipRctVOPY1; int m_ActiveRef; // QuarterSample, mwi Void motionCompQuarterSample ( PixelC* ppxlcPred, // can be either Y or A const PixelC* ppxlcRefLeftTop, // point to left-top of the frame Int iSize, // either MB or BLOCK size CoordI xRef, CoordI yRef, // x + mvX in quarter pel unit Int iRoundingControl, CRct *prctMVLimit, // extended bounding box int nMBType=0, int nBlockNum=0, const CMotionVector* pmv=NULL, int nSkip=0); // ~QuarterSample, mwi Void motionCompFieldUV (PixelC* ppxlcPredMBU, PixelC* ppxlcPredMBV, const CVOPU8YUVBA* pvopcRef,CoordI x, CoordI y, CoordI xRefUV, CoordI yRefUV, Int iRefFieldSelect, CRct *prctMVLimit, // added by Y.Suzuki for the extended bounding box support int nUVMVConfigSelect=MAEMB_CONFIG_MV_UV, int nDumpRef=0); Void Get_PVOP_UVILMVs (PixelC* ppxlcPredMBU, PixelC* ppxlcPredMBV, const CVOPU8YUVBA* pvopcRef, Int imbX, Int imbY, CoordI x, CoordI y, CoordI xRefUV, CoordI yRefUV, Int iRefFieldSelect, CRct *prctMVLimit, // added by Y.Suzuki for the extended bounding box support int nUVMVConfigSelect=MAEMB_CONFIG_MV_UV, int nDumpRef=0); Void CVideoObject::Get_PVOP_YILMVs ( PixelC* ppxlcPredMB, const PixelC* ppxlcRefLeftTop, const CMotionVector* pmv, const CMBMode* pmbmd, Int imbX, Int imbY, CoordI x, CoordI y, Bool bSkipNonOBMC, Bool bAlphaMB, CRct *prctMVLimit); Void motionCompYField ( PixelC* ppxlcPred, const PixelC* ppxlcRefLeftTop, CoordI xRef, CoordI yRef, CRct *prctMVLimit, // added by Y.Suzuki for the extended bounding box support int nMBType=0, int nBlockNum=0, const CMotionVector* pmv=NULL, int nSkip=0); Void motionCompDirectMode(CoordI x, CoordI y, CMBMode *pmbmd, const CMotionVector *pmvRef, CRct *prctMVLimitFwd, CRct *prctMVLimitBak, Int plane);#endif// ~INTERLACE#endif // __VOPSES_HPP_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -