📄 vopseenc.hpp
字号:
Int m_iNumSptMB; // bits used by a sprite macroblock
CRct findTightBoundingBox (CVOPU8YUVBA* vopuc);
CRct PieceExpand (const CRct& rctOrg);
Void encodeInitSprite (const CRct& rctOrg) ;
Void initialSpritePiece (Int iSessionWidth, Int iSessionHeight) ;
CRct InitialPieceRect (Time ts);
CRct CornerWarp (const CSiteD* rgstDest, const CSiteD* rgstSrcQ);
Void encodeSpritePiece (Time t) ; // code sprite pieces
Void codeVOSHead () ; // code sprite piece overhead
Void encSptPiece (CRct rctSptQ, UInt uiSptPieceSize);
Void encodeP (Bool bVOPVisible, Time t) ;
CRct PieceSize (Bool rightpiece, UInt uiSptPieceSize);
CRct encPiece (CRct rctpiece);
CRct ZoomOrPan ();
// GMC
Void GlobalMotionEstimation(CSiteD* m_rgstDestQ,
const CVOPU8YUVBA* pvopref, const CVOPU8YUVBA* pvopcurr,
const CRct rctframe, const CRct rctref,const CRct rctcurr,
Int iNumOfPnts);
Void TranslationalGME(const CVOPU8YUVBA* pvopcurr,
const CVOPU8YUVBA* pvopref, const CRct rctframe, const CRct rctcurr,
const CRct rctref, GME_para *pparameter);
Void IsotropicGME(const CVOPU8YUVBA* pvopcurr,
const CVOPU8YUVBA* pvopref, const CRct rctframe, const CRct rctcurr,
const CRct rctref, GME_para *pparameter);
Void AffineGME(const CVOPU8YUVBA* pvopcurr,
const CVOPU8YUVBA* pvopref, const CRct rctframe, const CRct rctcurr,
const CRct rctref, GME_para *pparameter);
Void ModifiedThreeStepSearch(PixelC *pref_work, PixelC *pcurr_work,
Int icurr_width, Int icurr_height, Int iref_width, Int iref_height,
Int icurr_left, Int icurr_top, Int icurr_right, Int icurr_bottom,
Int iref_left, Int iref_top, Int iref_right, Int iref_bottom,
Int *ibest_locationx, Int *ibest_locationy);
Void ModifiedThreeStepSearch_WithShape(PixelC *pref_work,PixelC *pcurr_work,
PixelC *pref_alpha_work, PixelC *pcurr_alpha_work,
Int icurr_width, Int icurr_height, Int iref_width, Int iref_height,
Int icurr_left, Int icurr_top, Int icurr_right, Int icurr_bottom,
Int iref_left, Int iref_top, Int iref_right, Int iref_bottom,
Int *ibest_locationx, Int *ibest_locationy);
Void ThreeTapFilter(PixelC *pLow, PixelC *pHight,
Int iwidth, Int iheight);
Int DeltaMP(Double *dA, Int in, Double *db, Double *dm);
Int CVideoObjectEncoder::globalme(CoordI iXCurr, CoordI iYCurr,
PixelC *pref);
Void CVideoObjectEncoder::StationalWarpME(Int iXCurr, Int iYCurr,
PixelC* pref, Int& iSumofAD);
Void CVideoObjectEncoder::TranslationalWarpME(Int iXCurr, Int iYCurr,
PixelC* pref, Int& iSumofAD);
Void CVideoObjectEncoder::FastAffineWarpME(Int iXCurr, Int iYCurr,
PixelC* pref, Int& iSumofAD);
// ~GMC
// motion estimation
Void motionEstPVOP ();
Void motionEstPVOP_WithShape ();
virtual Void motionEstBVOP ();
virtual Void motionEstBVOP_WithShape ();
//
// MB routines
//
UInt sumAbsCurrMB (); // for Rate Control
Void copyToCurrBuff (
const PixelC* ppxlcCurrY, const PixelC* ppxlcCurrU, const PixelC* ppxlcCurrV,
Int iWidthY, Int iWidthUV
);
Void copyToCurrBuffWithShape (
const PixelC* ppxlcCurrY, const PixelC* ppxlcCurrU, const PixelC* ppxlcCurrV,
const PixelC* ppxlcCurrBY, const PixelC** ppxlcCurrA,
Int iWidthY, Int iWidthUV
);
Void copyToCurrBuffJustShape(const PixelC* ppxlcCurrBY,Int iWidthY);
Void LPEPadding (const CMBMode* pmbmd);
Void LPEPaddingBlk (
PixelC* ppxlcBlk, const PixelC* ppxlcBlkB,
UInt uiSize
);
/*Void encodePVOPMBWithShape (
PixelC* ppxlcRefMBY, PixelC* ppxlcRefMBU, PixelC* ppxlcRefMBV, PixelC* ppxlcRefMBA, PixelC* ppxlcRefBY,
CMBMode* pmbmd, const CMotionVector* pmv, CMotionVector* pmvBY, ShapeMode shpmdColocatedMB,
Int imbX, Int imbY,
CoordI x, CoordI y, Int& iQPPrev
);*/
Void encodePVOPMBTextureWithShape(
PixelC* ppxlcRefMBY, PixelC* ppxlcRefMBU, PixelC* ppxlcRefMBV,
PixelC** ppxlcRefMBA, CMBMode* pmbmd, const CMotionVector* pmv,
Int imbX, Int imbY, CoordI x, CoordI y,
Int& iQPPrev, Int& iQPPrevAlpha, Bool &bUseNewQPForVlcThr,
const PixelC *ppxlcCurrMBBY = NULL, const PixelC *ppxlcCurrMBBUV = NULL // HHI Schueuer
);
Void encodePVOPMBJustShape(
PixelC* ppxlcRefBY, CMBMode* pmbmd, ShapeMode shpmdColocatedMB,
const CMotionVector* pmv, CMotionVector* pmvBY,
CoordI x, CoordI y, Int imbX, Int imbY
);
Void dumpCachedShapeBits();
Int dumpCachedShapeBits_DP(Int iMBnum); // Added for data partitioning mode By Toshiba(1998-1-16:DP+RVLC)
Void encodePVOPMB (
PixelC* ppxlcRefMBY, PixelC* ppxlcRefMBU, PixelC* ppxlcRefMBV,
// RRV modification
CMBMode* pmbmd, const CMotionVector* pmv, const CMotionVector* pmv_RRV,
// ~RRV
Int imbX, Int imbY,
CoordI x, CoordI y
);
// B-VOP MB encoding
Void encodeBVOPMB (
PixelC* ppxlcCurrQMBY, PixelC* ppxlcCurrQMBU, PixelC* ppxlcCurrQMBV,
CMBMode* pmbmd,
const CMotionVector* pmv, const CMotionVector* pmvBackward,
const CMBMode* pmbmdRef, const CMotionVector* pmvRef,
Int imbX, Int imbY,
CoordI x, CoordI y
);
// HHI schueuer: sadct
// const PixelC *ppxlcCurrMBBY = NULL, const PixelC *ppxlcCurrMBBUV = NULL added
Void encodeBVOPMB_WithShape (
PixelC* ppxlcCurrQMBY, PixelC* ppxlcCurrQMBU, PixelC* ppxlcCurrQMBV, PixelC** ppxlcCurrQMBA, PixelC* ppxlcCurrQBY,
CMBMode* pmbmd, const CMotionVector* pmv, const CMotionVector* pmvBackward,
CMotionVector* pmvBY, ShapeMode shpmdColocatedMB,
const CMBMode* pmbmdRef, const CMotionVector* pmvRef,
Int imbX, Int imbY,
CoordI x, CoordI y,
Int &iQPPrev, Int &iQPPrevAlpha,
Int index, //OBSS_SAIT_991015 //OBSS
const PixelC *ppxlcCurrMBBY = NULL, const PixelC *ppxlcCurrMBBUV = NULL
);
// texture coding
// HHI schueuer: sadct
// const PixelC *ppxlcCurrMBBY = NULL, const PixelC *ppxlcCurrMBBUV = NULL added
Void quantizeTextureIntraMB (
Int imbX, Int imbY,
CMBMode* pmbmd,
PixelC* ppxlcCurrQMBY, PixelC* ppxlcCurrQMBU, PixelC* ppxlcCurrQMBV,
PixelC** ppxlcCurrQMBA, const PixelC *ppxlcCurrMBBY = NULL, const PixelC *ppxlcCurrMBBUV = NULL
);
// HHI schueuer: sadct
// const PixelC *ppxlcCurrMBBY = NULL, const PixelC *ppxlcCurrMBBUV = NULL added
Void quantizeTextureInterMB (CMBMode* pmbmd, const CMotionVector* pmv,
PixelC **ppxlcCurrQMBA, Bool bSkipAllowed = TRUE,
const PixelC *ppxlcCurrMBBY = NULL, const PixelC *ppxlcCurrMBBUV = NULL); // decide COD here
// end HHI
Void codeMBTextureHeadOfIVOP (const CMBMode* pmbmd);
Void codeMBTextureHeadOfPVOP (const CMBMode* pmbmd);
// Added for data partitioning mode By Toshiba(1998-1-16:DP+RVLC)
Void codeMBTextureHeadOfIVOP_DP (const CMBMode* pmbmd);
Void codeMBTextureHeadOfPVOP_DP (const CMBMode* pmbmd);
// End Toshiba(1998-1-16:DP+RVLC)
Void codeMBTextureHeadOfBVOP (const CMBMode* pmbmd);
Void sendDCTCoefOfIntraMBTexture (const CMBMode* pmbmd);
Void sendDCTCoefOfInterMBTexture (const CMBMode* pmbmd);
Bool FrameFieldDCTDecideC(PixelC* m_ppxlcCurrMBY);
Void fieldDCTtoFrameC(PixelC* ppxlcCurrQMBY);
Bool FrameFieldDCTDecideI(PixelI* m_ppxliErrorMBY);
Void fieldDCTtoFrameI(PixelI* m_ppxliErrorMBY);
Void averagePredAndComputeErrorY();
Void averagePredAndComputeErrorY_WithShape(); // new chnages
Int interpolateAndDiffYField(
const CMotionVector* pmvFwdTop,
const CMotionVector* pmvFwdBot,
const CMotionVector* pmvBakTop,
const CMotionVector* pmvBakBot,
CoordI x, CoordI y,
CMBMode *pmbmd
);
Int directSAD(
CoordI x, CoordI y,
CMBMode *pmbmd,
const CMBMode *pmbmdRef,
const CMotionVector *pmvRef
);
Int directSADField(
CoordI x, CoordI y,
CMBMode *pmbmd,
const CMBMode *pmbmdRef,
const CMotionVector *pmvRef,
const PixelC* ppxlcRef0MBY,
const PixelC* ppxlcRef1MBY
);
// block level encoding
Int quantizeIntraBlockTexture (
PixelC* ppxlcBlkSrc,
Int iWidthSrc,
PixelC* ppxlcCurrQBlock,
Int iWidthCurrQ,
Int* rgiCoefQ,
Int iQP,
Int iDcScaler,
Int iBlk,
MacroBlockMemory* pmbmLeft,
MacroBlockMemory* pmbmTop,
MacroBlockMemory* pmbmLeftTop,
MacroBlockMemory* pmbmCurr,
CMBMode* pmbmdLeft,
CMBMode* pmbmdTop,
CMBMode* pmbmdLeftTop,
CMBMode* pmbmdCurr,
const PixelC *rgpxlcBlkShape, Int iBlkShapeWidth, // HHI Schueuer:added for sadct
Int iAuxComp
);
Void quantizeTextureInterBlock (
PixelI* ppxliCurrQBlock,
Int iWidthCurrQ,
Int* rgiCoefQ,
Int iQP,
Bool bUseAlphaMatrix,
const PixelC *rgpxlcBlkShape,
Int iBlkShapeWidth,
Int iBlk // HHI Schueuer:added for sadct
);
Void quantizeIntraDCcoef (Int* rgiCoefQ, Float fltDcScaler);
Void quantizeIntraDCTcoefH263 (Int* rgiCoefQ, Int iStart, Int iQP);
Void quantizeInterDCTcoefH263 (Int* rgiCoefQ, Int iStart, Int iQP);
Void quantizeIntraDCTcoefMPEG (Int* rgiCoefQ, Int iStart, Int iQP, Bool bUseAlphaMatrix);
Void quantizeInterDCTcoefMPEG (Int* rgiCoefQ, Int iStart, Int iQP, Bool bUseAlphaMatrix);
Int findVLCtableIndexOfNonLastEvent (Bool bIsLastRun, UInt uiRun, UInt uiLevel);
Int findVLCtableIndexOfLastEvent (Bool bIsLastRun,UInt uiRun, UInt uiLevel);
Int findVLCtableIndexOfIntra (Bool bIsLastRun, UInt uiRun, UInt uiLevel);
UInt sendIntraDC (const Int* rgiCoefQ, Int blkn);
UInt sendTCOEFIntra (const Int* rgiCoefQ, Int iStart, Int* rgiZigzag);
UInt sendTCOEFInter (const Int* rgiCoefQ, Int iStart, Int* rgiZigzag);
UInt putBitsOfTCOEFIntra (UInt uiRun, Int iLevel, Bool bIsLastRun);
UInt putBitsOfTCOEFInter (UInt uiRun, Int iLevel, Bool bIsLastRun);
typedef Int (CVideoObjectEncoder::*FIND_TABLE_INDEX)(Bool bIsLastRun, UInt uiRun, UInt uiLevel); //func ptr code escp. coding
UInt escapeEncode (UInt uiRun, Int iLevel, Bool bIsLastRun, Int* rgiLMAX, Int* rgiRMAX, FIND_TABLE_INDEX findVLCtableIndex);
UInt fixLengthCode (UInt uiRun, Int iLevel, Bool bIsLastRun);
Void intraPred (
Int blkn, const CMBMode* pmbmd,
Int* rgiCoefQ, Int iQPcurr, Int iDcScaler,
const BlockMemory pblkmPred, Int iQPpred
);
// gray-scale alpha coding
Void quantizeAlphaInterMB (CMBMode* pmbmd);
Void codeMBAlphaHeadOfIVOP (const CMBMode* pmbmd, Int iAuxComp);
Void codeMBAlphaHeadOfPVOP (const CMBMode* pmbmd, Int iAuxComp);
Void codeMBAlphaHeadOfBVOP (const CMBMode* pmbmd, Int iAuxComp);
Void sendDCTCoefOfIntraMBAlpha (const CMBMode* pmbmd, Int iAuxComp );
Void sendDCTCoefOfInterMBAlpha (const CMBMode* pmbmd, Int iAuxComp );
// HHI Klaas Schueuer: SADCT
Void deriveSADCTRowLengths(Int **piCoeffWidths, const PixelC* ppxlcMBBY, const PixelC* ppxlcCurrMBBUV,
const TransparentStatus *pTransparentStatus);
// MB shape coding
Int codeIntraShape (PixelC* ppxlcSrcFrm, CMBMode* pmbmd, Int iMBX, Int iMBY);
Int codeInterShape (
PixelC* ppxlcSrc, CVOPU8YUVBA* pvopcRefQ, CMBMode* pmbmd,
const ShapeMode& shpmdColocatedMB,
const CMotionVector* pmv, CMotionVector* pmvBY,
CoordI iX, CoordI iY, Int iMBX, Int IMBY
);
//OBSS_SAIT_991015
Bool quantizeTextureMBBackwardCheck (CMBMode* pmbmd, PixelC *ppxlcCurrMBY, PixelC *ppxlcCurrMBBY, const PixelC *ppxlcRef1MBY); // check backward skip
Int codeSIShapePVOP (
PixelC* ppxlcSrc, CVOPU8YUVBA* pvopcRefQ, CMBMode* pmbmd,
const ShapeMode& shpmdColocatedMB,
const CMotionVector* pmv, CMotionVector* pmvBY,
CoordI iX, CoordI iY, Int iMBX, Int IMBY
);
Int codeSIShapeBVOP (
PixelC* ppxlcSrc, CVOPU8YUVBA* pvopcRefQ0, CVOPU8YUVBA* pvopcRefQ1, CMBMode* pmbmd,
const ShapeMode& shpmdColocatedMB,
const CMotionVector* pmv, CMotionVector* pmvBY, CMotionVector* pmvBaseBY,
CoordI iX, CoordI iY, Int iMBX, Int IMBY
);
Void FullCoding(Int no_match, Int type_id_mis[256][4], SIDirection md_scan);
Void ExclusiveORcoding(Int no_xor, Int type_id_mis[256][4], SIDirection md_scan);
UInt codeShapeModeSSIntra (const ShapeSSMode& shpmd, const ShapeMode& shpmdColocatedMB);
UInt codeShapeModeSSInter (const ShapeSSMode& shpmd, const ShapeMode& shpmdColocatedMB);
UInt encodeSIIntra (ShapeSSMode shpmd, Bool* HorSamplingChk, Bool* VerSamplingChk);
Int motionEstMB_BVOP_WithShape (
CoordI x, CoordI y,
CMotionVector* pmvForward, CMotionVector* pmvBackward,
CMBMode* pmbmd,
const PixelC* ppxlcRef0MBY, const PixelC* ppxlcRef1MBY
);
Int sad16x16At0WithShape (const PixelC* ppxliRefY, const CMBMode* pmbmd, Int *numForePixel) const;
//~OBSS_SAIT_991015
UInt codeShapeModeIntra (ShapeMode shpmd, const CMBMode* pmbmd, Int iMBX, Int iMBY);
UInt codeShapeModeInter (const ShapeMode& shpmd, const ShapeMode& shpmdColocatedMB);
ShapeMode round (PixelC* ppxlcSrcFrm, const CMBMode* pmbmd);
Int downSampleShape (const PixelC* ppxlcSrc, Int* rgiSrcSubBlk,
PixelC* ppxlcDst, Int* piDstPxl, Int iRate, Int iThreshold, Int nSubBlk);
Bool isErrorLarge (const PixelC* rgppxlcSrc, const Int* rgiSubBlkIndx, Int iWidthSrc, PixelC pxlcRecon, const CMBMode* pmbmd);
Bool isErrorLarge (const PixelC* rgppxlcSrc, const Int* rgiSubBlkIndxSrc, const Int iSizeSrc,
const PixelC* rgppxlcDst, const Int* rgiSubBlkIndxDst, const Int iSizeDst, const CMBMode* pmbmd);
UInt encodeCAEIntra (ShapeMode shpmd, CAEScanDirection m_shpdir);
UInt encodeCAEInter (ShapeMode shpmd, CAEScanDirection m_shpdir);
UInt encodeMVDS (CMotionVector mvBYD);
Bool sameBlockTranspStatus (const CMBMode* pmbmd, PixelC pxlcRecon);
Bool sameBlockTranspStatus (const CMBMode* pmbmd, const PixelC* pxlcRecon, Int iSizeRecon);
UInt codeCrAndSt (CAEScanDirection shpdir, Int iInverseCR);
Void copyReconShapeToRef (PixelC* ppxlcRef, PixelC pxlcSrc); //no need to reset MB buffer
Void copyReconShapeToRef (PixelC* ppxlcDstMB, const PixelC* ppxlcSrc, Int iSrcWidth, Int iBorder);
Int sadForShape (const PixelC* ppxlcRefBY) const;
Void blkmatchForShape (CVOPU8YUVBA* pvopcRefQ,CMotionVector* pmv, const CVector& mvPredHalfPel, CoordI iX, CoordI iY);
Bool m_bNoShapeChg;
Int *m_rgiSubBlkIndx16x16, *m_rgiSSubBlkIndx16x16, *m_rgiSubBlkIndx18x18, *m_rgiSubBlkIndx20x20;
Int *m_rgiPxlIndx12x12, *m_rgiPxlIndx8x8;
// motion estimation
Void copyToCurrBuffWithShapeY (
const PixelC* ppxlcCurrY,
const PixelC* ppxlcCurrBY
);
Void copyToCurrBuffY (const PixelC* ppxlcCurrY);
Void motionEstMB_PVOP (CoordI x, CoordI y,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -