【VC开源代码栏目提醒】:网学会员为广大网友收集整理了,encoder.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
Hiroyuki Katata (katata@imgsl.mkhar.sharp.co.jp), Sharp Corporation
Norio Ito (norio@imgsl.mkhar.sharp.co.jp), Sharp Corporation
Shuichi Watanabe (watanabe@imgsl.mkhar.sharp.co.jp), Sharp Corporation
(date: October, 1997)
and also edited by
Xuemin Chen (xchen@nlvl.com). Next Level Systems, Inc.
Bob Eifrig (beifrig@nlvl.com) Next Level Systems, Inc.
and also 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)
Marc Mongenet (Marc.Mongenet@epfl.ch), Swiss Federal Institute of Technology, Lausanne (EPFL)
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.
Sharp 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) 1997.
Module Name:
encoder.cpp
Abstract:
caller for encoder
Revision History:
May 9, 1999: tm5 rate control by DemoGraFX, duhoff@mediaone.net
*************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#ifdef __PC_COMPILER_
#include <windows.h>
#include <mmsystem.h>
#endif // __PC_COMPILER_
#include "typeapi.h"
#include "codehead.h"
#include "paramset.h"
#include "mode.hpp"
#include "tm5rc.hpp"
#include "fstream.h"
#include "sesenc.hpp"
// #include "encoder/tps_sesenc.hpp" // deleted by Sharp (98/2/12)
///// WAVELET VTC: begin ////////////////////////////////
#include "dataStruct.hpp" // hjlee
///// WAVELET VTC: end ////////////////////////////////
#ifndef __GLOBAL_VAR_
#define __GLOBAL_VAR_
#endif
#include "global.hpp"
#ifdef __MFC_
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
#define new DEBUG_NEW
#endif // __MFC_
#define _FOR_GSSP_
#ifdef _FOR_GSSP_
Int rgiDefaultIntraQMatrixAlpha [BLOCK_SQUARE_SIZE] = {
8, 17, 18, 19, 21, 23, 25, 27,
17, 18, 19, 21, 23, 25, 27, 28,
20, 21, 22, 23, 24, 26, 28, 30,
21, 22, 23, 24, 26, 28, 30, 32,
22, 23, 24, 26, 28, 30, 32, 35,
23, 24, 26, 28, 30, 32, 35, 38,
25, 26, 28, 30, 32, 35, 38, 41,
27, 28, 30, 32, 35, 38, 41, 45
};
Int rgiDefaultInterQMatrixAlpha [BLOCK_SQUARE_SIZE] = {
16, 17, 18, 19, 20, 21, 22, 23,
17, 18, 19, 20, 21, 22, 23, 24,
18, 19, 20, 21, 22, 23, 24, 25,
19, 20, 21, 22, 23, 24, 26, 27,
20, 21, 22, 23, 25, 26, 27, 28,
21, 22, 23, 24, 26, 27, 28, 30,
22, 23, 24, 26, 27, 28, 30, 31,
23, 24, 25, 27, 28, 30, 31, 33
};
#else
Int rgiDefaultIntraQMatrixAlpha [BLOCK_SQUARE_SIZE] = {
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16
};
Int rgiDefaultInterQMatrixAlpha [BLOCK_SQUARE_SIZE] = {
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16
};
#endif
Void nextValidLine (FILE *pfPara, UInt* pnLine);
///// WAVELET VTC: begin ////////////////////////////////
Void readVTCParam(CVTCEncoder *pvtcenc, FILE *pfPara, UInt* pnLine);
///// WAVELET VTC: end ////////////////////////////////
Void readBoolVOLFlag (Bool * rgbTable [2], UInt nVO, FILE * pfCfg, UInt * pnLine, Bool bAnyScalability);
Void readItem(UInt *rguiTable [2], UInt nVO, FILE * pfCfg, UInt * pnLine, Bool bAnyScalability);
Void RunVTCCodec(char *VTCCtlFile);
Void GetIVal(CxParamSet *pPar, char *pchName, Int iInd, Int *piRtn);
Void GetDVal(CxParamSet *pPar, char *pchName, Int iInd, Double *pdRtn);
Void GetSVal(CxParamSet *pPar, char *pchName, Int iInd, char **ppchRtn);
Void GetAVal(CxParamSet *pPar, char *pchName, Int iInd, Double **ppdRtn, Int *piCount);
Void readBoolParam(CxParamSet *pPar, char *pchName, Int iInd, Bool *pbVal);
Int bPrint = 0;
#define VERSION_STRING "FDIS 1.02 (990812)"
// please update version number when you
// make changes in the following
#define BASE_LAYER 0
#define ENHN_LAYER 1
#define NO_SCALABILITY 0
#define TEMPORAL_SCALABILITY 1
#define SPATIAL_SCALABILITY 2
int main (int argc, Char* argv[])
{
UInt nLine = 1;
UInt* pnLine = &nLine;
FILE *pfPara;
if (argc != 2) {
printf ("Usage: %s parameter_file\n %s -version", argv [0], argv[0]);
exit (1);
}
if(argv[1][0]=='-' && argv[1][1]=='v')
{
printf("Microsoft MPEG-4 Visual CODEC %s\n",VERSION_STRING);
exit(0);
}
if ((pfPara = fopen (argv[1], "r")) == NULL ){
printf ("Parameter File Not Found\n");
exit (1);
}
// all the parameters to the encoder
Int iVersion;
Int iVTCFlag;
UInt uiFrmWidth, uiFrmHeight;
UInt firstFrm, lastFrm;
Bool bNot8Bit;
UInt uiQuantPrecision;
UInt nBits;
UInt firstVO, lastVO;
UInt nVO = 0;
UInt uiFrmWidth_SS,uiFrmHeight_SS;
UInt uiHor_sampling_m,uiHor_sampling_n;
UInt uiVer_sampling_m,uiVer_sampling_n;
Bool bAnyScalability = FALSE;
Int iSpatialOption;
char *pchPrefix;
char *pchBmpDir;
char *pchOutBmpDir;
char *pchOutStrFile;
char *pchSptDir;
char *pchSptPntDir;
Int *rgiTemporalScalabilityType;
Bool *rgbSpatialScalability;
Bool *rgbScalability;
Int *rgiEnhancementType;
AlphaUsage *rgfAlphaUsage;
Bool *rgbShapeOnly;
Int *rgiBinaryAlphaTH;
Int
上一篇:
EncapsidateADODlg.cpp
下一篇:
jQuery产品分类信息导航特效代码