【VC开源代码栏目提醒】:网学会员在VC开源代码频道为大家收集整理了vopses.cpp提供大家参考,希望对大家有所帮助!
/*************************************************************************
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 Center
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:
vopSes.cpp
Abstract:
Base class for the encoder for one VOP session.
Revision History:
December 20, 1997: Interlaced tools added by NextLevel Systems (GI)
X.Chen (xchen@nlvl.com), B. Eifrig (beifrig@nlvl.com)
May. 9 1998: add boundary by Hyundai Electronics
Cheol-Soo Park (cspark@super5.hyundai.co.kr)
May. 9 1998: add field based unrestricted MC padding by Hyundai Electronics
Cheol-Soo Park (cspark@super5.hyundai.co.kr)
*************************************************************************/
#include <stdio.h>
#include "typeapi.h"
#include "basic.hpp"
#include "header.h"
#include "codehead.h"
#include "mode.hpp"
#include "dct.hpp"
#include "cae.h"
#include "vopses.hpp"
#ifdef __MFC_
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
#define new DEBUG_NEW
#endif // __MFC_
CVideoObject::~CVideoObject ()
{
delete m_pvopcCurrQ;
delete m_pvopcRefQ0;
delete m_pvopcRefQ1; // modified by Shu 12/12/97
// wchen: unmodified 12/16/97
delete m_pvopcCurrMB;
delete m_pvopcPredMB;
delete m_pvopiErrorMB;
delete [] m_rgmbmd;
delete [] m_rgmv;
delete [] m_rgmvBY;
delete [] m_rgmvRef;
delete m_pidct;
Int nBlk = (m_volmd.fAUsage == EIGHT_BIT) ? 10 : 6;
Int iBlk;
for (iBlk = 0; iBlk < nBlk; iBlk++)
delete [] m_rgpiCoefQ [iBlk];
delete [] m_rgpiCoefQ;
// delete m_pvopfCurrFilteredQ;
// delete m_pdrtmdRef1;
delete [] m_rgiQPpred;
if (m_volmd.fAUsage == RECTANGLE) {
Int nBlk = (m_volmd.fAUsage == EIGHT_BIT) ? 10 : 6;
delete [] m_rgblkmCurrMB;
if (m_rgpmbmAbove != NULL)
for (Int iMB = 0; iMB < m_iNumMBX; iMB++) {
for (iBlk = 0; iBlk < nBlk; iBlk++) {
delete [] (m_rgpmbmAbove [iMB]->rgblkm) [iBlk];
delete [] (m_rgpmbmCurr [iMB]->rgblkm) [iBlk];
}
delete [] m_rgpmbmAbove [iMB]->rgblkm;
delete m_rgpmbmAbove [iMB];
delete [] m_rgpmbmCurr [iMB]->rgblkm;
delete m_rgpmbmCurr [iMB];
}
delete [] m_rgpmbmAbove;
delete [] m_rgpmbmCurr;
}
// sprite
if (m_uiSprite == 1) {
delete [] m_rgstSrcQ;
delete [] m_rgstDstQ;
if (m_sptMode == BASIC_SPRITE)
delete m_pvopcSptQ;
}
delete m_pbEmptyRowArray;
/* NBIT: change
m_rgiClipTab -= 400;
*/
m_rgiClipTab -= m_iOffset;
delete [] m_rgiClipTab;
m_rgiClipTab = NULL;
// shape
if(m_rgshpmd!=NULL)
delete m_rgshpmd;
delete m_puciPredBAB;
delete m_parcodec;
delete [] m_ppxlcCurrMBBYDown4;
delete [] m_ppxlcCurrMBBYDown2;
delete [] m_ppxlcReconCurrBAB;
delete [] m_ppxlcPredBABDown2;
delete [] m_ppxlcPredBABDown4;
}
CVideoObject::CVideoObject ()
{
m_t = 0;
m_iBCount = 0;
m_tPastRef = 0;
m_tFutureRef = 0;
m_bCodedFutureRef = TRUE;
m_rgmbmd = NULL;
m_rgmv = NULL;
m_rgmvBackward = NULL;
m_rgmvBY = NULL;
m_rgmbmdRef = NULL;
m_rgmvRef = NULL;
m_tModuloBaseDecd = 0;
m_tModuloBaseDisp = 0;
m_pvopcCurrQ = NULL;
m_pvop