/* Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/ All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef _ASP_DECOP_CB_COMMON_H_ #define _ASP_DECOP_CB_COMMON_H_ #include #include "paftyp.h" #define ASP_DECOP_CB_SOK ( 0 ) // ok #define ASP_DECOP_CB_MAX_NUM_AF ( 4 ) // decoder output circular buffer maximum number audio frames #define ASP_DECOP_CB_MAX_NUM_PCM_CH ( 16 ) // decoder output circular buffer maximum number audio PCM channels #define ASP_DECOP_CB_MAX_NUM_PCM_FRAMES ( 2 ) // decoder output circular buffer maximum number PCM frames //Qin - Increased to prevent cb overflow for ddp. #define ASP_DECOP_CB_MAX_PCM_FRAME_LEN ( 6*256 ) // decoder output circular buffer maximum PCM frame length #define ASP_DECOP_CB_PCM_BUF_SZ ( ASP_DECOP_CB_MAX_NUM_PCM_CH * ASP_DECOP_CB_MAX_NUM_PCM_FRAMES * ASP_DECOP_CB_MAX_PCM_FRAME_LEN ) // Decoder output circular buffer typedef struct PAF_AST_DecOpCircBuf { PAF_AudioFrame *afCb; // audio frame CB PAF_AudioData *pcmBuf; // PCM buffer, contains PCM data associated with audio frames UInt8 *metaBuf; // metafdata buffer, contains metadata associated with audio frames //QIN Int8 afRdIdx; // audio frame CB read index Int8 afWrtIdx; // audio frame CB write index Int16 pcmRdIdx; // pcm buffer read index Int8 numAfCb; // current number frames in CB Int8 maxNumAfCb; // maximum number of audio frames in CB Int16 decOpFrameLen; // selected decoder output frame length (input transaction size) Int16 strFrameLen; // stream frame length (output transaction size) Int8 writerActiveFlag; // flag indicates whether CB writer is active Int8 readerActiveFlag; // flag indicates whether CB reader is active Int8 emptyFlag; // flag indicates whether reader should empty (drain) remaining frames in CB Int8 errUndCnt; // underflow count Int8 errOvrCnt; // overflow count } PAF_AST_DecOpCircBuf; // Output log of circular buffer control variables (debug) Int cbLog( PAF_AST_DecOpCircBuf *pCb, Int8 fullLog, char *locInfo ); #endif /* _ASP_DECOP_CB_COMMON_H_ */