⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 omxacmp3_requantize_s32_i.c

📁 The OpenMAX DL (Development Layer) APIs contain a comprehensive set of audio, video, signal processi
💻 C
字号:
/** *  * File Name:  omxACMP3_ReQuantize_S32_I.c * OpenMAX DL: v1.0.2 * Revision:   10586 * Date:       Wednesday, March 5, 2008 *  * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. *  *  * Description: * This function is used to Requantizes the decoded Huffman symbols */#include "omxtypes.h"#include "armOMX.h"#include "omxAC.h"#include "armCOMM_Bitstream.h"#include "armACMP3_CommonTables.h"/** * Function:  omxACMP3_ReQuantize_S32_I   (3.1.3.3.2) * * Description: * Requantizes the decoded Huffman symbols.  Spectral samples for the  * synthesis filter bank are derived from the decoded symbols using the  * requantization equations given in the ISO standard.  Stereophonic mid/side  * (M/S) and/or intensity decoding is applied if necessary.  Requantized  * spectral samples are returned in the vector pSrcDstIsXr. The reordering  * operation is applied for short blocks.  Users must preallocate a workspace  * buffer pointed to by pBuffer prior to calling the requantization function.  * The value pointed by pNonZeroBound will be recalculated according to the  * output data sequence.  Special scalefactor values on the right channel of  * intensity-coded scalefactor bands are used to indicate illegal intensity  * positions. References 1. [ISO11172-3], Table B.8 ( MPEG-1 ) 2.  * [ISO13818-3], sub-clause 2.5.3.2.2 and Table B.2 ( MPEG-2 ) 3.  * [ISO14496-3], sub-part 9,  MPEG-1/2 Audio in MPEG-4   * * Input Arguments: *    *   pSrcDstIsXr - pointer to the vector of decoded Huffman symbols; for  *            stereo and dual-channel modes, right channel data begins at the  *            address &(pSrcDstIsXr[576]). This pointer must be aligned on an  *            8-byte boundary.  *   pNonZeroBound - (Inout/output argument) pointer to the spectral bound  *            above which all coefficients are set to zero; for stereo and  *            dual-channel modes, the left channel bound is pNonZeroBound [0],  *            and the right channel bound is pNonZeroBound [1]  *   pScaleFactor - pointer to the scalefactor buffer; for stereo and  *            dual-channel modes, the right channel scalefactors begin at  *            &(pScaleFactor[OMX_MP3_SF_BUF_LEN]). Special scalefactor values  *            on the right channel of intensity-coded scalefactor bands shall  *            be used to indicate an illegal intensity position as follows: i)  *            for MPEG-1 streams (pFrameHeader->id==1), the value 7  *            [ISO11172-3, section 2.4.3.4.9.3], and ii) for MPEG-2 streams  *            (pFrameHeader->id==0), a negative value.  *   pSideInfo - pointer to the side information for the current granule  *   pFrameHeader - pointer to the frame header for the current frame  *   pBuffer - pointer to a workspace buffer. The buffer length must be 576  *            samples, and the pointer must be 8-byte aligned.  *   pSfbTableLong - pointer to the long block scalefactor band table,  *            formatted as described in section 3.1.2.3.  Table entries  *            optionally may follow the MPEG-1, MPEG-2, or MPEG-4 audio  *            standards as shown in Example 3-1. Alternatively the table  *            entries may be defined to suit a special purpose. References:   *            [ISO11172-3], Table B.8, [ISO13818-3], Table B.2, [ISO14496-3],  *            sub-part 9.  *   pSfbTableShort - pointer to the short block scalefactor band table,  *            formatted as described in section 3.1.2.4.  Table entries  *            optionally may follow the MPEG-1, MPEG-2, or MPEG-4 audio  *            standards as shown in Example 3-2.  Alternatively the table  *            entries may be defined to suit a special purpose.  References:  *            [ISO11172-3], Table B.8, [ISO13818-3], Table B.2, [ISO14496-3],  *            sub-part 9.  * * Output Arguments: *    *   pSrcDstIsXr - pointer to the vector of requantized spectral samples for  *            the synthesis filter bank, in Q5.26 format (Qm.n defined in  *             Introduction ).  Only the first (pNonZeroBound[ch]+17)/18  *            18 point blocks are updated by the function.  This pointer must  *            be aligned on an 8-byte boundary.  *   pNonZeroBound - (Inputinput/output argumentparameter) pointer to the  *            spectral bound above which all coefficients are set to zero; for  *            stereo and dual-channel modes, the left channel bound is  *            pNonZeroBound[0], and the right channel bound is  *            pNonZeroBound[1].  * * Return Value: *     *    OMX_Sts_NoErr - no errors  *    OMX_Sts_BadArgErr - bad arguments detected; either pSrcDstIsXr or  *              pBuffer are not 8-byte aligned, or one or more of the  *              following pointers is NULL:  *            - pSrcDstIsXr  *            - pNonZeroBound *            - pScaleFactor *            - pSideInfo *            - pFrameHeader *            - pBuffer,  *        Or one or more of the following input error conditions is  *              detected: *            - pNonZeroBound[ch] outside the range [0,576]  *            - pFrameHeader->id outside the range [0,1]  *            - pFrameHeader->samplingFreq outside the range [0,2]  *            - pFrameHeader->mode outside the range [0,3]  *            - pSideInfo[ch].blockType outside the range [0,3]  *            - pFrameHeader->modeExt outside the range [0,3]  *            - pSideInfo[ch].mixedBlock outside the range [0,1]  *            - pSideInfo[ch].globGain outside the range [0,255]  *            - pSideInfo[ch].sfScale outside the range [0,1]  *            - pSideInfo [ch].preFlag outside the range [0,1]  *            - pSideInfo [ch].pSubBlkGain[w] outside the range [0,7]  *            - |pSrcDstIsXr[i]| > 8206  *            - pScaleFactor[sfb] > 7 when pScaleFactor[sfb] is the  *              intensity position for an MPEG-1 stream  *            - pSideInfo[0].blockType != pSideInfo[1].blockType and  *              the bit stream is encoded in joint stereo mode  *            - pSideInfo[0].mixedBlock != pSideInfo[1].mixedBlock  *              and the bit stream is encoded in joint stereo mode. * *        Note: In the above list of error conditions the range of  *              the parameter <ch> is from 0 to chNum-1, and the range on the  *              parameter <w> is from 0 to 2, where chNum is the number of  *              channels associated with value of the pFrameHeader ->mode.  *              If pFrameHeader->mode == 3 then chNum==1, otherwise chNum==2.  * */OMXResult omxACMP3_ReQuantize_S32_I(     OMX_S32 *pSrcDstIsXr,     OMX_INT *pNonZeroBound,     OMX_S8 *pScaleFactor,     OMXMP3SideInfo *pSideInfo,     OMXMP3FrameHeader *pFrameHeader,     OMX_S32 *pBuffer){    /* Call requantize function with Standard scale factor tables */    return omxACMP3_ReQuantizeSfb_S32_I(pSrcDstIsXr,                                        pNonZeroBound,                                        pScaleFactor,                                        pSideInfo,                                        pFrameHeader,                                        pBuffer,                                        armACMP3_SFBTableLong,                                        armACMP3_SFBTableShort);}/***************************************************************************** *                              END OF FILE *****************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -