📄 vopsedec.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
Dick van Smirren (D.vanSmirren@research.kpn.com), KPN Research
Cor Quist (C.P.Quist@research.kpn.com), KPN Research
(date: July, 1998)
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.
Module Name:
vopSeDec.hpp
Abstract:
Decoder for one Video Object.
Revision History:
09-30-97: merge error resilient changes from Toshiba by wchen@microsoft.com
11-30-97: added Spatial tools by Takefumi Nagumo(nagumo@av.crl.sony.co.jp) SONY corporation
12-20-97: Interlaced tools added by NextLevel Systems
X. Chen (xchen@nlvl.com), B. Eifrig (beifrig@nlvl.com)
*************************************************************************/
#ifndef __VOPSEDEC_HPP_
#define __VOPSEDEC_HPP_
class CVideoObject;
class ifstream;
class strstreambuf;
class CInBitStream;
class CEntropyDecoderSet;
class CEntropyDecoder;
class CVOPU8YUVBA;
class CEnhcBufferDecoder;
Class CVideoObjectDecoder : public CVideoObject
{
friend class CVideoObjectDecoderTPS; ///// 97/12/22
friend class CEnhcBufferDecoder;
public:
// Constructors
~CVideoObjectDecoder ();
CVideoObjectDecoder () {};
CVideoObjectDecoder (
const Char* pchStrFile, // bitstream file
Int iDisplayWidth, Int iDisplayHeight,
Bool *pbSpatialScalability = NULL,
Bool *p_short_video_header=FALSE,
strstreambuf* pistrm = NULL
);
CVideoObjectDecoder ( // for back/forward shape
int iDisplayWidth, int iDisplayHeight
);
// Operations
Int decode (const CVOPU8YUVBA* pvopcBVOPQuant = NULL, strstreambuf* pistrm = NULL);
Int ReadNextVopPredType (); //for Spatial Scalable Coding
Int h263_decode(); // [FDS]
Void decodeInitSprite ();
Void decodeSpritePieces ();
Int decodeOneSpritePiece ();
CRct decodeVOSHead ();
SptXmitMode m_oldSptXmitMode ;
///////////////// implementation /////////////////
///// 97/12/22 start
public:
CVideoObjectDecoder* rgpbfShape [2]; // 0 : backward, 1: forward
///// 97/12/22 end
// Added by KPN for short headers
void video_plane_with_short_header();
void gob_layer();
void decodeShortHeaderIntraMBDC(Int *rgiCoefQ);
//Added by KPN for short headers - END
//protected:
public:
own ifstream* m_pistrm;
own CInBitStream* m_pbitstrmIn; //bitstream
own CEntropyDecoderSet* m_pentrdecSet; //huffman decoder set
//used for video packet header decoding by Toshiba
//they are basically cached values of not update after the header decoding
Time m_tOldModuloBaseDisp; //of the most recently displayed I/Pvop
Time m_tOldModuloBaseDecd; //of the most recently decoded I/Pvop
// buffer data
CVOPU8YUVBA* m_pvopcRightMB;
PixelC *m_ppxlcRightMBBY, *m_ppxlcRightMBBUV;
// buffers for temporal scalability Added by Sharp(1998-02-10)
CEnhcBufferDecoder* m_pBuffP1;
CEnhcBufferDecoder* m_pBuffP2;
CEnhcBufferDecoder* m_pBuffB1;
CEnhcBufferDecoder* m_pBuffB2;
CEnhcBufferDecoder* m_pBuffE;
int m_coded;
// buffers for temporal scalability End Sharp(1998-02-10)
// Added for short headers by KPN (1998-02-07, DS)
Bool short_video_header;
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)
// Added for error resilience mode By Toshiba(1998-1-16:DP+RVLC)
Int* m_piMCBPC;
Int* m_piIntraDC;
// End Toshiba(1998-1-16:DP+RVLC)
// error handling
Void errorInBitstream (Char* rgchErorrMsg);
Int findStartCode();
// VO and VOL routines
Void decodeVOHead ();
Void decodeVOLHead ();
// VOP routines
Bool decodeVOPHead ();
Void decodeVOP ();
Void decodeIVOP ();
Void decodePVOP ();
Void decodeBVOP ();
Void decodeIVOP_WithShape ();
Void decodePVOP_WithShape ();
Void decodeBVOP_WithShape ();
// Void computeMVInfo ();
// Added for error resilience mode By Toshiba(1998-1-16:DP+RVLC)
Void decodeIVOP_DataPartitioning ();
Void decodePVOP_DataPartitioning ();
Void decodeIVOP_WithShape_DataPartitioning ();
Void decodePVOP_WithShape_DataPartitioning ();
// End Toshiba(1998-1-16:DP+RVLC)
// MB routines : texture and overhead
// I-VOP
Void decodeMBTextureHeadOfIVOP (CMBMode* pmbmd, Int& iCurrQP,
Bool &bUseNewQPForVlcThr);
Void decodeTextureIntraMB (CMBMode* pmbmd, CoordI iMBX, CoordI iMBY,
PixelC* ppxlcCurrFrmQY, PixelC* ppxlcCurrFrmQU, PixelC* ppxlcCurrFrmQV);
Void decodeMBAlphaHeadOfIVOP (CMBMode* pmbmd, Int iCurrQP, Int iCurrQPA, Int iVopQP, Int iVopQPA);
Void decodeAlphaIntraMB (CMBMode* pmbmd, Int iMBX, Int iMBY, PixelC* ppxlcRefMBA);
// P-VOP
Void decodeMBTextureHeadOfPVOP (CMBMode* pmbmd, Int& iCurrQP,
Bool &bUseNewQPForVlcThr);
Void decodeMBAlphaHeadOfPVOP (CMBMode* pmbmd, Int iCurrQP, Int iCurrQPA);
Void decodeTextureInterMB (CMBMode* pmbmd);
Void decodeAlphaInterMB (CMBMode* pmbmd, PixelC *ppxlcRefMBA);
// B-VOP
Void decodeMBTextureHeadOfBVOP (CMBMode* pmbmd, Int& iCurrQP);
Void decodeMBAlphaHeadOfBVOP (CMBMode* pmbmd, Int iCurrQP, Int iCurrQPA);
Void setCBPYandC (CMBMode* pmbmd, Int iCBPC, Int iCBPY, Int cNonTrnspBlk);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -