【VC开源代码栏目提醒】:网学会员为广大网友收集整理了,vopseenc.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
Simon Winder (swinder@microsoft.com), Microsoft Corporation
(date: March, 1996)
and edited by
Wei Wu (weiwu@stallion.risc.rockwell.com) Rockwell Science Center
and also edited by
Yoshihiro Kikuchi (TOSHIBA CORPORATION)
Takeshi Nagai (TOSHIBA CORPORATION)
Toshiaki Watanabe (TOSHIBA CORPORATION)
Noboru Yamaguchi (TOSHIBA CORPORATION)
and also edited by
David B. Shu (dbshu@hrl.com), Hughes Electronics/HRL Laboratories
Marc Mongenet (Marc.Mongenet@epfl.ch), Swiss Federal Institute of Technology, Lausanne (EPFL)
and also edited by
Yoshinori Suzuki (Hitachi, Ltd.)
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:
vopSeEnc.hpp
Abstract:
Encoder for one VO.
Revision History:
Sept. 30, 1997: Error resilient tools added by Toshiba
Dec. 11, 1997: Interlaced tools added by NextLevel Systems
X. Chen, xchen@nlvl.com B. Eifrig, beifrig@nlvl.com
Jun. 16, 1998: add Complexity Estimation syntax support
Marc Mongenet (Marc.Mongenet@epfl.ch) - EPFL
Jan. 28, 1999: Rounding control parameters added by Hitachi, Ltd.
May 9, 1999: tm5 rate control by DemoGraFX, duhoff@mediaone.net
*************************************************************************/
#include <stdio.h>
#include <iostream.h>
#include <fstream.h>
#include <math.h>
#include <stdlib.h>
#include "typeapi.h"
#include "codehead.h"
#include "global.hpp"
#include "entropy/bitstrm.hpp"
#include "entropy/entropy.hpp"
#include "entropy/huffman.hpp"
#include "mode.hpp"
#include "dct.hpp"
#include "tps_enhcbuf.hpp" // added by Sharp (98/2/12)
#include "vopses.hpp"
#include "vopseenc.hpp"
#include "enhcbufenc.hpp" // added by Sharp (98/2/12)
#include "cae.h" // Added for error resilient mode by Toshiba(1997-11-14)
#ifdef __MFC_
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
#define new DEBUG_NEW
#endif // __MFC_
CVideoObjectEncoder::~CVideoObjectEncoder ()
{
delete m_pvopcOrig;
delete m_pvopcRefOrig1;
delete m_pvopcRefOrig0;
delete m_puciRefQZoom0;
delete m_puciRefQZoom1;
delete m_pfdct;
delete [] m_rgdSNR;
// bitstream stuff
delete [] m_pchBitsBuffer;
delete m_pbitstrmOut;
delete m_pentrencSet;
delete [] m_pchShapeBitsBuffer;
delete m_pbitstrmShape;
// Added for data partitioning mode By Toshiba(1998-1-16:DP+RVLC)
delete [] *m_pchShapeBitsBuffer_DP;
delete [] *m_pbitstrmShape_DP;
delete m_pchShapeBitsBuffer_DP;
delete m_pbitstrmShape_DP;
// End Toshiba(1998-1-16)
// shape
delete [] m_rgiSubBlkIndx16x16;
delete [] m_rgiSSubBlkIndx16x16;
delete [] m_rgiSubBlkIndx18x18;
delete [] m_rgiSubBlkIndx20x20;
delete [] m_rgiPxlIndx12x12;
delete [] m_rgiPxlIndx8x8;
// B-VOP MB buffer
delete m_puciDirectPredMB;
delete m_puciInterpPredMB;
delete m_piiDirectErrorMB;
delete m_piiInterpErrorMB;
}
CVideoObjectEncoder::CVideoObjectEncoder (
UInt uiVOId,
VOLMode& volmd,
VOPMode& vopmd,
UInt nFirstFrame,
UInt nLastFrame,
Int iSessionWidth,
Int iSessio