msaudec.h
来自「ESS3890+SL原代码(1*16内存)」· C头文件 代码 · 共 208 行
H
208 行
/* Copyright 1997, ESS Technology, Inc. *//* SCCSID @(#)msaudec.h 1.1 01/23/02 *//* Based on DVD code version 1.10 10/23/01 */ #ifndef __MSAUDIODEC_H_#define __MSAUDIODEC_H_#include "msaud.h"#include "strmdec.h"typedef enum {BEGIN_PACKET, BEGIN_FRAME, BEGIN_SUBFRAME, DECODE_SUBFRAME, END_SUBFRAME1, END_SUBFRAME2} DecodeStatus;typedef enum {SUBFRM_HDR, SUBFRM_COEF, SUBFRM_DONE} SubFrmDecodeStatus;typedef enum {HDR_SIZE, HDR_QUANT, HDR_NOISE1, HDR_NOISE2, HDR_MSKUPD, HDR_BARK, HDR_DONE} HdrDecodeStatus; /* and a lot more */typedef enum {VLC, FRAME_END, NORMAL, ESCAPE} RunLevelStatus;typedef struct CAudioObjectDecoder { CAudioObject* pau; /* packetization stuff */ Bool m_fPacketLoss; I16 m_cFrmInPacket; U8* m_pbSrcCurr; /* ptr to src of curr packet, only for non-strm mode */ U16 m_cbSrcCurrLength; /* only for non-strm mode */ DecodeStatus m_decsts; SubFrmDecodeStatus m_subfrmdecsts; HdrDecodeStatus m_hdrdecsts; RunLevelStatus m_rlsts; I16 m_iChannel; /* current channel we are doing */ I16 m_iBand; /* current band we are doing */ Bool m_fNoMoreData; Bool m_fLastSubFrame; CWMAInputBitStream m_ibstrm;#if 0#ifdef ENABLE_EQUALIZER#define MAX_NO_EQBAND 10 Float m_rgfltEqBandWeight[MAX_NO_EQBAND]; U16 m_rgwEqBandBoundary[MAX_NO_EQBAND + 1]; I8 m_cEqBand; Bool m_fNoEq; I8 m_rgbBandPower[MAX_NO_EQBAND]; Bool m_fComputeBandPower; Int m_iEqFrameSize;#endif /* ENABLE_EQUALIZER */ WMARESULT (*m_pfnDecodeSubFrame) (struct CAudioObjectDecoder* paudec, Int* piBitCnt); WMARESULT (*m_pfnDecodeCoefficient) (struct CAudioObjectDecoder* paudec, PerChannelInfo* ppcinfo, Int* piBitCnt); #endif} CAudioObjectDecoder;#if 0 /* GMGM */typedef struct WMARawDecStruct{ CAudioObjectDecoder *pAudDecoder;} WMARawDecStruct;#endif/* public: */void audecNew(CAudioObjectDecoder *paudec);#if 0 /* GMGM */Void audecDelete (CAudioObjectDecoder* paudec);#endifWMARESULT audecInit ( CAudioObjectDecoder* paudec, Int iVersionNumber, Int cSubband, Int iSamplingRate, U16 cChannel, Int cBytePerSec, Int cbPacketLength, U16 wEncodeOpt, U16 wPlayerOpt);#if 0 /* GMGM */WMARESULT audecReset (CAudioObjectDecoder* paudec);WMARESULT audecFlush ( CAudioObjectDecoder* paudec, U8 *pbDst, Int cbDstLength, Int* pcbDstUsed, U8* pbEqu, Int cbEquLength, Int* pcbEquUsed, U32* pcSamplesFromBefore);U32 audecOutputBufferSize(Int iVersion, Int iSamplingRate, Int cChannels, Int cBytePerSec, U16 wEncodeOpt);/* streaming decoding interface */WMARESULT audecDecodeInfo (CAudioObjectDecoder* paudec);WMARESULT audecDecodeData (CAudioObjectDecoder* paudec, U16* pcSampleReady);WMARESULT audecGetPCM (CAudioObjectDecoder* paudec, U16* pcSampleReady, U8* pbDst, U32 cbDstLength);/* This function is optionally implemented by the user, but if the user opts for *//* non-streaming mode, we supply a standard implementation. Streaming-mode callers *//* MUST supply their own version of this function. */WMARESULT prvWMAGetMoreData(U8 **ppBuffer, U32 *pcbBuffer, U32 dwUserData);/* alternative decoding interface */WMARESULT audecDecode (CAudioObjectDecoder* paudec, const U8* pbSrc, Int cbSrcLength, Int* pcbSrcUsed, U8* pbDst, Int cbDstLength, Int* pcbDstUsed, U8* pbEqu, Int cbEqu, Int* pcbEquUsed, I32* pcSamplesFromBefore);#ifdef ENABLE_EQUALIZER WMARESULT audecSetEqualizer (CAudioObjectDecoder* paudec, Int iBand, Int iGainIndB);WMARESULT audecResetEqualizer (CAudioObjectDecoder* paudec); Void audecStartComputeBandPower (CAudioObjectDecoder* paudec);Void audecStopComputeBandPower (CAudioObjectDecoder* paudec);WMARESULT audecGetBandPower (CAudioObjectDecoder* paudec, I8* rgbBandPower);#endif /* ENABLE_EQUALIZER */#ifdef __cplusplus}#endif#endif#if 0 /* GMGM *//* private: */WMARESULT prvDecodePacket (CAudioObjectDecoder* paudec, const U8* pbSrc, Int cbSrcLength, Int* pcbSrcUsed, U8* pbDst, Int cbDstLength, Int* pcbDstUsed, U8* pbEqu, Int cbEquLength, Int* pcbEquUsed, I32* pcSamplesPrevPacket);WMARESULT prvDecodeFrame (CAudioObjectDecoder* paudec, const U8* pbSrc, Int cbSrcLength, Int* pcbSrcUsed, I16* piDst, Int cbDstLength, Int* pcbDstUsed, U8* pbEqu, Int cbEquLength, Int* pcbEquUsed);WMARESULT prvDecodeSubFrame (CAudioObjectDecoder* paudec, Int* piBitCnt);WMARESULT prvDecodeSubFrameHighRate (CAudioObjectDecoder* paudec, Int* piBitCnt);WMARESULT prvDecodeFrameHeader (CAudioObjectDecoder* paudec, Int* piBitCnt);#endifVoid prvSetDetTable (CAudioObjectDecoder* paudec, PerChannelInfo* ppcinfo);#if 0WMARESULT prvDecodeFrameHeaderLpc (CAudioObjectDecoder* paudec, Int* piBitCnt);WMARESULT prvDecodeFrameHeaderNoiseSub (CAudioObjectDecoder* paudec, Int* piBitCnt);WMARESULT prvGetNextRunDEC (Void* pvoid, PerChannelInfo* ppcinfo, Int *piBitCnt);/* Void prvGetBandWeightMidRate (CAudioObjectDecoder* paudec); */Void prvGetBandWeightLowRate (CAudioObjectDecoder* paudec);WMARESULT prvUpdateSubFrameConfig (CAudioObjectDecoder* paudec, Int iSizeNext, Int iSizePrev, Int iSizeCurr);WMARESULT prvDecodeCoefficientMono (CAudioObjectDecoder* paudec, PerChannelInfo* ppcinfo, Int* piBitCnt);WMARESULT prvDecodeCoefficientStereo (CAudioObjectDecoder* paudec, PerChannelInfo* ppcinfo, Int* piBitCnt);WMARESULT prvDecodeRunLevel (CAudioObjectDecoder* paudec, PerChannelInfo* ppcinfo, Int iCoefFirst, Int iCoefLim, Int* piBitCnt);/* equalize */Void prvAdaptEqToSubFrame(CAudioObjectDecoder* paudec);WMARESULT prvEqualize (CAudioObjectDecoder* paudec, PerChannelInfo* ppcinfo);Void prvComputeBandPower (CAudioObjectDecoder* paudec);Int WMA_get_fNoMoreData(U32 hWMA){ return ((CAudioObjectDecoder *)hWMA)->m_fNoMoreData;}Void WMA_set_fNoMoreData(U32 hWMA, Int iVal){ ((CAudioObjectDecoder *)hWMA)->m_fNoMoreData = iVal;}INLINE U8 WMA_get_nHdrBits(U32 hWMA){ const CAudioObject *pau = ((CAudioObjectDecoder *)hWMA)->pau; if (pau->m_fAllowSuperFrame) return (pau->m_cBitPackedFrameSize + NBITS_FRM_CNT + NBITS_PACKET_CNT + 3); else return 0;}#endifvoid Flush_WMA_PCM_output(void);void WMA_PCM_output(int spcmbuf_start,int offset, int output_len);void WMA_PCM_output_second_half_of_current_window(CAudioObject *pau);void WMA_DctIV(CAudioObject *pau);#endif /* __MSAUDIODEC_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?