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

📄 omxacaac_decodeprgcfgelt.c

📁 The OpenMAX DL (Development Layer) APIs contain a comprehensive set of audio, video, signal processi
💻 C
字号:
/** *  * File Name:  omxACAAC_DecodePrgCfgElt.c * OpenMAX DL: v1.0.2 * Revision:   10586 * Date:       Wednesday, March 5, 2008 *  * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. *  *  * * Description: * This file contains module for parsing ADIF header information from AAC bitstream * */#include "omxtypes.h"#include "armOMX.h"#include "omxAC.h"#include "armCOMM.h"#include "armCOMM_Bitstream.h"/** * Function:  omxACAAC_DecodePrgCfgElt   (3.2.3.1.3) * * Description: * Unpacks one program configuration element (PCE) from the input bit stream  * and copies the contents into a PCE data structure.  * * Reference [ISO14496-3], sub-clause 4.5.1.2  * * Input Arguments: *    *   ppBitStream - double pointer to the current byte  *   pOffset - pointer to the bit position in the byte pointed by  *            *ppBitStream..  Valid within the range 0 to 7; 0: MS bit, 7: LS  *            bit.  *   pPrgCfgElt - pointer an uninitialized OMXACCPrgCfgElt structure  * * Output Arguments: *    *   ppBitStream - updated double pointer to the current byte after decoding  *            the PCE.  *   pOffset - pointer to the bit position in the byte pointed by  *            *ppBitStream. Valid within the range 0 to 7. 0: MS bit, 7: LS  *            bit.  *   pPrgCfgElt - pointer to updated OMXAACPrgCfgElt structure.  All  *            structures members are updated by the function to reflect the  *            contents of the program configuration element in the input  *            stream, with the following limitations:  i) the member  *            monoMixdownEltNum is updated only if monoMixdownPres==1,  *            otherwise it is set equal to 0; ii) the member  *            stereoMixdownEltNum is updated only if stereoMixdownPres==1,  *            otherwise it is set equal to 0; iii) the members  *            matrixMixdownIdx and pseudoSourroundEnable are updated only if  *            matrixMixdownIdxPres==1; iv) Only elements 0, 1,  ,  *            numFrontElt-1 of the pFrontIsCpe and pFrontTagSel arrays are  *            updated; v) Only elements 0, 1,  , numSideElt-1 of the  *            pSideIsCpe and pSideTagSel arrays are updated; vi) Only elements  *            0, 1,  , numBackElt-1 of the pBackIsCpe and pBackTagSel arrays  *            are updated; vii) Only elements 0, 1,  , numLfeElt-1 of the  *            pLfeTagSel array are updated; viii) Only elements 0, 1,  ,  *            numDataElt-1 of the pDataTagSel array are updated; ix) Only  *            elements 0, 1,  , numValidCcElt-1 of the pCceIsIndSw and  *            pCceTagSel arrays are updated; x) Only elements 0, 1,  ,  *            numComBytes-1 of the pComFieldData array are updated  * * Return Value: *     *    OMX_Sts_NoErr - no error  *    OMX_Sts_BadArgErr - Bad arguments  *    -    At least one of the following pointers is NULL: ppBitStream, pOffset,  *              pPrgCfgElt, *ppBitStream   *    -   *pOffset exceeds [0, 7]  * */OMXResult omxACAAC_DecodePrgCfgElt(     const OMX_U8 **ppBitStream,     OMX_INT *pOffset,     OMXAACPrgCfgElt *pPrgCfgElt ){    OMX_INT i;         /* Argument Check */            armRetArgErrIf( ppBitStream == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf(*ppBitStream == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( pOffset     == NULL, OMX_Sts_BadArgErr);    armRetArgErrIf( pPrgCfgElt  == NULL, OMX_Sts_BadArgErr);        armRetArgErrIf( (*pOffset > 7) || (*pOffset < 0), OMX_Sts_BadArgErr);    /* Processing */    pPrgCfgElt->eltInsTag           = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    pPrgCfgElt->profile             = (OMX_INT)armGetBits(ppBitStream,pOffset,2);    pPrgCfgElt->samplingRateIndex   = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    pPrgCfgElt->numFrontElt         = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    pPrgCfgElt->numSideElt          = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    pPrgCfgElt->numBackElt          = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    pPrgCfgElt->numLfeElt           = (OMX_INT)armGetBits(ppBitStream,pOffset,2);    pPrgCfgElt->numDataElt          = (OMX_INT)armGetBits(ppBitStream,pOffset,3);    pPrgCfgElt->numValidCcElt       = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    pPrgCfgElt->monoMixdownPres     = (OMX_INT)armGetBits(ppBitStream,pOffset,1);    if(pPrgCfgElt->monoMixdownPres == 1)    {        pPrgCfgElt->monoMixdownEltNum = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    }    pPrgCfgElt->stereoMixdownPres = (OMX_INT)armGetBits(ppBitStream,pOffset,1);    if(pPrgCfgElt->stereoMixdownPres == 1)    {        pPrgCfgElt->stereoMixdownEltNum = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    }    pPrgCfgElt->matrixMixdownIdxPres = (OMX_INT)armGetBits(ppBitStream,pOffset,1);    if(pPrgCfgElt->matrixMixdownIdxPres == 1)    {        pPrgCfgElt->matrixMixdownIdx = (OMX_INT)armGetBits(ppBitStream,pOffset,2);        pPrgCfgElt->pseudoSurroundEnable = (OMX_INT)armGetBits(ppBitStream,pOffset,1);    }    for (i = 0; i < pPrgCfgElt->numFrontElt ; i++ )     {        pPrgCfgElt->pFrontIsCpe[i]  = (OMX_INT)armGetBits(ppBitStream,pOffset,1);        pPrgCfgElt->pFrontTagSel[i] = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    }    for (i = 0; i < pPrgCfgElt->numSideElt ; i++ )    {        pPrgCfgElt->pSideIsCpe[i]  = (OMX_INT)armGetBits(ppBitStream,pOffset,1);        pPrgCfgElt->pSideTagSel[i] = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    }    for (i = 0; i < pPrgCfgElt->numBackElt ; i++ )    {        pPrgCfgElt->pBackIsCpe[i]  = (OMX_INT)armGetBits(ppBitStream,pOffset,1);        pPrgCfgElt->pBackTagSel[i] = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    }    for (i = 0; i < pPrgCfgElt->numLfeElt ; i++ )    {        pPrgCfgElt->pLfeTagSel[i] = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    }       for (i = 0; i < pPrgCfgElt->numDataElt ; i++ )    {        pPrgCfgElt->pDataTagSel[i] = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    }       for (i = 0; i < pPrgCfgElt->numValidCcElt ; i++ )    {        pPrgCfgElt->pCceIsIndSw[i]  = (OMX_INT)armGetBits(ppBitStream,pOffset,1);        pPrgCfgElt->pCceTagSel[i]   = (OMX_INT)armGetBits(ppBitStream,pOffset,4);    }        armByteAlign(ppBitStream,pOffset);        pPrgCfgElt->numComBytes = (OMX_INT)armGetBits(ppBitStream,pOffset,8);        for (i = 0; i < pPrgCfgElt->numComBytes ; i++ )    {        pPrgCfgElt->pComFieldData[i] = (OMX_INT)armGetBits(ppBitStream,pOffset,8);    }    return OMX_Sts_NoErr;}/* End of File */

⌨️ 快捷键说明

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