📄 omxacaac_decodefillelt.c
字号:
/** * * File Name: omxACAAC_DecodeFillElt.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 FILL Element information from AAC bitstream * */ #include "omxtypes.h"#include "omxAC.h"#include "armOMX.h"#include "armCOMM.h"#include "armCOMM_Bitstream.h"/** * Function: omxACAAC_DecodeFillElt (3.2.3.1.6) * * Description: * Gets the fill element from the input bit stream. * * Reference: [ISO14496-3], Table 4.11 * * Input Arguments: * * ppBitStream - pointer to the pointer to the current byte * pOffset - pointer to the bit position in the byte pointed by * *ppBitStream. Valid within 0 to 7. 0: MSB of the byte, 7: LSB of * the byte * * Output Arguments: * * ppBitStream - pointer to the pointer to the current byte after the * decode fill element * pOffset - pointer to the bit position in the byte pointed by * *ppBitStream. Valid within 0 to 7. 0: MSB of the byte, 7: LSB of * the byte. * pFillCnt - pointer to the value of the length of total fill data in * bytes * pDstFillElt- pointer to the fill data buffer of length 270 * * Return Value: * * OMX_Sts_NoErr - no error * OMX_Sts_BadArgErr - bad arguments * - At least one of the following pointers is NULL: * - ppBitStream, * - pOffset, * - *ppBitStream, * - pFillCnt, * - pDstFillElt. * - *pOffset exceeds [0, 7] * */OMXResult omxACAAC_DecodeFillElt( const OMX_U8 **ppBitStream, OMX_INT *pOffset, OMX_INT *pFillCnt, OMX_U8 *pDstFillElt ){ OMX_INT FillCnt,extType; OMX_INT nDyn,nExc,drcNumBands; OMX_INT TempVar,i; /* Argument Check */ armRetArgErrIf( ppBitStream == NULL , OMX_Sts_BadArgErr); armRetArgErrIf(*ppBitStream == NULL , OMX_Sts_BadArgErr); armRetArgErrIf( pOffset == NULL , OMX_Sts_BadArgErr); armRetArgErrIf( pFillCnt == NULL , OMX_Sts_BadArgErr); armRetArgErrIf( pDstFillElt == NULL , OMX_Sts_BadArgErr); armRetArgErrIf( (*pOffset > 7) || (*pOffset < 0) , OMX_Sts_BadArgErr); FillCnt = (OMX_INT)armGetBits(ppBitStream,pOffset,4); if(FillCnt == 15) { FillCnt += ( (OMX_INT)armGetBits(ppBitStream,pOffset,8) - 1 ); } *pFillCnt = FillCnt; while(FillCnt > 0) { /*Extension Payload */ extType = (OMX_INT)armGetBits(ppBitStream,pOffset,4); switch(extType) { case 11: /* 0b1011 */ /* EXT_DYNAMIC_RANGE */ /* Dynamic Range info */ nDyn = 1; drcNumBands = 1; TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,1);/*pce_tag_present*/ if(TempVar == 1) { armSkipBits(ppBitStream,pOffset,8); nDyn++; } TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,1);/*excluded_chns_present*/ if (TempVar == 1) { /* Excluded_channels */ nExc = 1; armSkipBits(ppBitStream,pOffset,7);/*exclude_mask*/ TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,1);/* additional_excluded_chns */ while(TempVar == 1) { armSkipBits(ppBitStream,pOffset,7);/*exclude_mask*/ nExc++; TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,1);/* additional_excluded_chns */ } nDyn = nDyn + nExc; } TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,1);/* drc_bands_present */ if(TempVar == 1) { TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,4);/* drc_band_incr */ armSkipBits(ppBitStream,pOffset,4);/*drc_bands_reserved_bits*/ drcNumBands += TempVar; nDyn += drcNumBands + 1; TempVar = ( drcNumBands << 3); armSkipBits(ppBitStream,pOffset,TempVar); } TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,1);/* prog_ref_level_present */ if(TempVar == 1) { armSkipBits(ppBitStream,pOffset,8); nDyn++; } TempVar = (drcNumBands << 3); armSkipBits(ppBitStream,pOffset,TempVar); nDyn += drcNumBands; FillCnt -= nDyn; break; case 1: /* 0b0001: */ /* EXT_FILL_DATA */ TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,4);/*fill_nibble*/ TempVar = ( (extType << 4) | TempVar ); pDstFillElt[0] = TempVar ; for (i = 0 ; i < (FillCnt - 1) ; i++) { pDstFillElt[i+1] = (OMX_U8)armGetBits(ppBitStream,pOffset,8); } FillCnt -= FillCnt; break; default: TempVar = (OMX_INT)armGetBits(ppBitStream,pOffset,4); TempVar = (extType << 4) | TempVar; pDstFillElt[0] = TempVar ; for (i = 0 ; i < (FillCnt - 1) ; i++) { pDstFillElt[i+1] = (OMX_U8)armGetBits(ppBitStream,pOffset,8); } FillCnt -= FillCnt; break; } /*End switch - case*/ }/*End while()*/ return OMX_Sts_NoErr;}/* End of File */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -