【VC开源代码栏目提醒】:网学会员VC开源代码为您提供tps_bfshape.cpp参考,解决您在tps_bfshape.cpp学习中工作中的难题,参考学习。
/*************************************************************************
This software module was originally developed 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: August, 1997)
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:
tps_bfshape.cpp
Abstract:
set volmd, vopmd for backward/forward shape coding
(for Object based Temporal Scalability)
Revision History:
*************************************************************************/
#include "typeapi.h"
#include "entropy/entropy.hpp"
#include "entropy/huffman.hpp"
#include "entropy/bitstrm.hpp"
#include "global.hpp"
#include "mode.hpp"
#include "codehead.h"
#include "cae.h"
#include "vopses.hpp"
#include "encoder/vopseenc.hpp"
#include "tps_enhcbuf.hpp"
#ifdef __MFC_
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
#define new DEBUG_NEW
#endif // __MFC_
Int QMatrix [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
};
Void set_modes(VOLMode* volmd, VOPMode* vopmd)
{
///// set VOL modes
volmd->volType = (VOLtype) BASE_LAYER; // should not be used.
volmd->fAUsage = ONE_BIT;
volmd->bShapeOnly = FALSE; // should be changed to TRUE after checked.
// volmd->iBinaryAlphaTH = rgiBinaryAlphaTH [iVO] * 16; //magic no. from the vm
volmd->bNoCrChange = TRUE; // mb level binary alpha size conversion disable
volmd->bOriginalForME = TRUE;
volmd->bAdvPredDisable = TRUE;
// Modified by Toshiba (98-04-07)
// volmd->bErrorResilientDisable = TRUE;
// End Toshiba
volmd->fQuantizer = Q_H263; // should not be used. H.263/MPEG quantizer.
volmd->bNoGrayQuantUpdate = FALSE; // should not be used.
volmd->bLoadIntraMatrix = FALSE; // should not be used.
volmd->bLoadInterMatrix = FALSE; // should not be used.
volmd->bLoadIntraMatrixAlpha = FALSE; // should not be used.
volmd->bLoadInterMatrixAlpha = FALSE; // should not be used.
volmd->bVPBitTh = -1; // added by Sharp (98/4/13)
memcpy (volmd->rgiIntraQuantizerMatrix, QMatrix, BLOCK_SQUARE_SIZE * sizeof (Int));
// memcpy (volmd->rgiInterQuantizerMatrix, rgppiInterQuantizerMatrix [iLayer][iVO], BLOCK_SQUARE_SIZE * sizeof (Int));
// memcpy (volmd->rgiIntraQuantizerMatrixAlpha, rgppiIntraQuantizerMatrixAlpha [iLayer][iVO], BLOCK_SQUARE_SIZE * sizeof (Int));
// memcpy (volmd->rgiInterQuantizerMatrixAlpha, rgppiInterQuantizerMatrixAlpha [iLayer][iVO], BLOCK_SQUARE_SIZE * sizeof (Int));
volmd->bDeblockFilterDisable = FALSE; // should not be used.
volmd->fEntropyType = huffman; // huffman VLC for texture ? ... may not be used
// volmd->iPeriodOfIVOP = (rgiNumOfBbetweenPVOP [iVO] + 1) * (rgiNumOfPbetweenIVOP [iVO] + 1); //in temporally sumsampled domain
// volmd->iPeriodOfPVOP = rgiNumOfBbetweenPVOP [iVO] + 1; //in temporally sumsampled domain
// volmd->iTemporalRate = rgiTemporalRate [iVO];
// volmd->iClockRate = SOURCE_FRAME_RATE / volmd->iTemporalRate; //default to frame per second
volmd->b