index 7d3decca8034ec7d611209414f4fd5d92e023c26..e78111684fc9be9115c9cf863f8b39d30ed9dd6e 100644 (file)
#include <ti/ipc/GateMP.h>
#include "paftyp.h"
#include "pafdec.h"
-
#define ASP_DECOP_CB_SOK ( 0 ) // ok
#define ASP_DECOP_CB_CTL_INIT_INV_GATE ( ASP_DECOP_CB_SOK-1 ) // error: invalid gate handle
#define ASP_DECOP_CB_ERR_START ( ASP_DECOP_CB_CTL_INIT_INV_GATE )
-
-#define ASP_DECOP_CB_MAX_NUM_AF ( 4 ) // decoder output circular buffer maximum number audio frames
+#define ASP_DECOP_CB_MAX_NUM_AF ( 15 ) // 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_NUM_PCM_FRAMES ( 15 ) // 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_MAX_NUM_PCM_CH_DDP ( 16 ) // decoder output circular buffer maximum number audio PCM channels for DDP
+#define ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kDDP ( 6*256 ) // decoder output circular buffer maximum PCM frame length at 48kHz sampling rate
+
+#define ASP_DECOP_CB_MAX_NUM_PCM_CH_MAT ( 32 ) // decoder output circular buffer maximum number audio PCM channels for MAT
+#define ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kMAT ( 4*256 ) // decoder output circular buffer maximum PCM frame length at 48kHz sampling rate
+
#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 )
+#define ASP_DECOP_CB_PCM_BUF_SZ_32CH48kMAT ( ASP_DECOP_CB_MAX_NUM_PCM_CH_MAT * ASP_DECOP_CB_MAX_NUM_PCM_FRAMES * ASP_DECOP_CB_MAX_PCM_FRAME_LEN_48kMAT )
#define ASP_DECOP_CB_MAX_NUM_AF_PCM ( 4 )
#define ASP_DECOP_CB_INIT_LAG_PCM ( 2 ) // 1...3
-#define ASP_DECOP_CB_INIT_WRTIDX_PCM ( ASP_DECOP_CB_INIT_LAG_PCM )
+#define ASP_DECOP_CB_INIT_WRTIDX_PCM ( 0 )
#define ASP_DECOP_CB_INIT_RDIDX_PCM ( 0 )
#define ASP_DECOP_CB_MAX_NUM_AF_DDP ( 2 )
-#define ASP_DECOP_CB_INIT_LAG_DDP ( 4 ) // 0...5
-#define ASP_DECOP_CB_INIT_WRTIDX_DDP ( 1 )
+#define ASP_DECOP_CB_INIT_LAG_DDP ( 1 ) // 0...5
+#define ASP_DECOP_CB_INIT_WRTIDX_DDP ( 0 )
#define ASP_DECOP_CB_INIT_RDIDX_DDP ( 0 )
+#define ASP_DECOP_CB_MAX_NUM_AF_THD ( 15 )
+#define ASP_DECOP_CB_INIT_LAG_THD ( 5 ) // 5*20ms = 100 ms, For the worst case of 100 ms
+#define ASP_DECOP_CB_INIT_WRTIDX_THD ( 0 ) //ASP_DECOP_CB_INIT_LAG_THD )
+#define ASP_DECOP_CB_INIT_RDIDX_THD ( 0 )
#define ASP_DECODE_CB_GATE_NAME ( "AspDecOpCbGate" )
#define ASP_DECODE_CB_GATE_REGION_ID ( 0 )
Int8 sourceSel; // selected source
Int8 afRdIdx; // audio frame CB read index
Int8 afWrtIdx; // audio frame CB write index
+ Int8 afLagIdx; // audio frame CB Lag idx,
+ Int8 afInitialLag; // Initial delay/lag between CB write and read
Int16 pcmRdIdx; // pcm buffer read index
Int8 numAfCb; // current number frames in CB
Int8 maxNumAfCb; // maximum number of audio frames in CB
Int8 emptyFlag; // flag indicates whether reader should empty (drain) remaining frames in CB
Int8 errUndCnt; // underflow count
Int8 errOvrCnt; // overflow count
+ PAF_AudioData *pcmBufEnd; // PCM buffer, contains PCM data associated with audio frames end
+ UInt8 *metaBufEnd; // metadata buffer, contains metadata associated with audio frames end
+ Int8 maxAFChanNum; // maximum number of audio data channels in audio frame
+ Int16 maxAFSampCount; // maximum number of sample counts in audio frame
+ PAF_AudioFrame lastAf; // used to store the last valid read out audio frame info to generate mute frame
} PAF_AST_DecOpCircBuf;
// Decoder output circular buffer control