summaryrefslogtreecommitdiffstats
path: root/libSBRenc/src/sbr_ram.h
diff options
context:
space:
mode:
authorDave Burke <daveburke@google.com>2012-05-12 13:17:25 -0700
committerDave Burke <daveburke@google.com>2012-05-12 13:47:46 -0700
commit698b536f3b34a7cfc41a80e1034cc359456bdd66 (patch)
treefa3dfa75d535b188725f1b84316cb4b06db79771 /libSBRenc/src/sbr_ram.h
parent9bf37cc9712506b2483650c82d3c41152337ef7e (diff)
downloadODR-AudioEnc-698b536f3b34a7cfc41a80e1034cc359456bdd66.tar.gz
ODR-AudioEnc-698b536f3b34a7cfc41a80e1034cc359456bdd66.tar.bz2
ODR-AudioEnc-698b536f3b34a7cfc41a80e1034cc359456bdd66.zip
Update to 2012_05_11 version.
Fixes: - Don't throw error for invalid bitrate but limit to functional value - More robust ASC parsing - More robust handling of corrupt bitstreams - Handle multiple raw access units Change-Id: Ib49fe2545ff4185fe924126da702fe84ac5c2d87
Diffstat (limited to 'libSBRenc/src/sbr_ram.h')
-rw-r--r--libSBRenc/src/sbr_ram.h72
1 files changed, 15 insertions, 57 deletions
diff --git a/libSBRenc/src/sbr_ram.h b/libSBRenc/src/sbr_ram.h
index 23eca20..3377c2a 100644
--- a/libSBRenc/src/sbr_ram.h
+++ b/libSBRenc/src/sbr_ram.h
@@ -26,7 +26,7 @@
/*!
\file
\brief Memory layout
-$Revision: 36847 $
+$Revision: 37142 $
*/
#ifndef __SBR_RAM_H
#define __SBR_RAM_H
@@ -44,10 +44,10 @@ $Revision: 36847 $
#define ENV_TRANSIENTS_BYTE ( (sizeof(FIXP_DBL)*(MAX_NUM_CHANNELS*3*QMF_MAX_TIME_SLOTS)) )
-#define ENV_R_BUFF_BYTE ( (sizeof(FIXP_DBL)*((QMF_MAX_TIME_SLOTS) * QMF_CHANNELS)) )
-#define ENV_I_BUFF_BYTE ( (sizeof(FIXP_DBL)*((QMF_MAX_TIME_SLOTS) * QMF_CHANNELS)) )
+ #define ENV_R_BUFF_BYTE ( (sizeof(FIXP_DBL)*((QMF_MAX_TIME_SLOTS) * MAX_HYBRID_BANDS)) )
+ #define ENV_I_BUFF_BYTE ( (sizeof(FIXP_DBL)*((QMF_MAX_TIME_SLOTS) * MAX_HYBRID_BANDS)) )
+ #define Y_BUF_CH_BYTE ( (2*sizeof(FIXP_DBL)*((QMF_MAX_TIME_SLOTS) * MAX_HYBRID_BANDS)) )
-#define Y_BUF_CH_BYTE ( (sizeof(FIXP_DBL)*QMF_MAX_TIME_SLOTS * QMF_CHANNELS) )
#define ENV_R_BUF_PS_BYTE ( (sizeof(FIXP_DBL)*QMF_MAX_TIME_SLOTS * QMF_CHANNELS / 2) )
#define ENV_I_BUF_PS_BYTE ( (sizeof(FIXP_DBL)*QMF_MAX_TIME_SLOTS * QMF_CHANNELS / 2) )
@@ -60,27 +60,24 @@ $Revision: 36847 $
/* Workbuffer RAM - Allocation */
/*
++++++++++++++++++++++++++++++++++++++++++++++++++++
- | OFFSET_NRG | OFFSET_QMF |
+ | OFFSET_QMF | OFFSET_NRG |
++++++++++++++++++++++++++++++++++++++++++++++++++++
- --------------------------------------------------
- | 0.5 * | |
- | sbr_envYBuffer_size | sbr_envRBuffer |
- | | sbr_envIBuffer |
- --------------------------------------------------
+ ------------------------- -------------------------
+ | | 0.5 * |
+ | sbr_envRBuffer | sbr_envYBuffer_size |
+ | sbr_envIBuffer | |
+ ------------------------- -------------------------
*/
#define BUF_NRG_SIZE ( (MAX_NUM_CHANNELS * Y_2_BUF_BYTE) )
+ #define BUF_QMF_SIZE (ENV_R_BUFF_BYTE + ENV_I_BUFF_BYTE)
- #define OFFSET_NRG ( 0 )
- #define OFFSET_QMF ( OFFSET_NRG + BUF_NRG_SIZE )
+ /* Size of the shareable memory region than can be reused */
+ #define SBR_ENC_DYN_RAM_SIZE ( BUF_QMF_SIZE + BUF_NRG_SIZE )
- /* if common dynamic memory used in AAC-core and SBR, find out maximal size of
- SCR buffer (see XX in figure above) */
- /* Only PS required holding 2 channel QMF data. AAC_WK_BUF_SIZE_0 must fit into this buffer. */
- #define BUF_QMF_SIZE ( 2*(ENV_R_BUFF_BYTE + ENV_I_BUFF_BYTE) )
+ #define OFFSET_QMF ( 0 )
+ #define OFFSET_NRG ( OFFSET_QMF + BUF_QMF_SIZE )
- /* Size of the shareable memory region than can be reused */
- #define SBR_ENC_DYN_RAM_SIZE ( BUF_NRG_SIZE + BUF_QMF_SIZE )
/*
*****************************************************************************************************
@@ -117,53 +114,14 @@ $Revision: 36847 $
H_ALLOC_MEM(Ram_Sbr_guideVectorOrig, FIXP_DBL)
- H_ALLOC_MEM(Ram_PsEnvRBuffer, FIXP_QMF)
- H_ALLOC_MEM(Ram_PsEnvIBuffer, FIXP_QMF)
-
H_ALLOC_MEM(Ram_PsQmfStatesSynthesis, FIXP_DBL)
- H_ALLOC_MEM(Ram_PsQmfNewSamples, FIXP_DBL)
- H_ALLOC_MEM(Ram_PsEncConf, PSENC_CONFIG)
H_ALLOC_MEM(Ram_PsEncode, PS_ENCODE)
- H_ALLOC_MEM(Ram_PsData, PS_DATA)
-
-#define HYBRID_READ_OFFSET ( 10 )
-#define HYBRID_WRITE_OFFSET ( ((32)>>1)-6 )
-#define HYBRID_DATA_READ_OFFSET ( 0 )
-#define QMF_READ_OFFSET ( 0 )
-
- H_ALLOC_MEM(Ram_PsRqmf, FIXP_DBL)
- H_ALLOC_MEM(Ram_PsIqmf, FIXP_DBL)
FIXP_DBL* FDKsbrEnc_SliceRam_PsRqmf (FIXP_DBL* rQmfData, UCHAR* dynamic_RAM, int n, int i, int qmfSlots);
FIXP_DBL* FDKsbrEnc_SliceRam_PsIqmf (FIXP_DBL* iQmfData, UCHAR* dynamic_RAM, int n, int i, int qmfSlots);
- H_ALLOC_MEM(Ram_PsQmfData, PS_QMF_DATA)
- H_ALLOC_MEM(Ram_PsChData, PS_CHANNEL_DATA)
-
H_ALLOC_MEM(Ram_ParamStereo, PARAMETRIC_STEREO)
- H_ALLOC_MEM(Ram_PsOut, PS_OUT)
-
- /* HYBRID */
- H_ALLOC_MEM(Ram_PsHybFFT, FIXP_DBL)
-
- H_ALLOC_MEM(Ram_HybData, PS_HYBRID_DATA)
- H_ALLOC_MEM(Ram_PsRhyb, FIXP_DBL)
- H_ALLOC_MEM(Ram_PsIhyb, FIXP_DBL)
-
- H_ALLOC_MEM(Ram_PsHybConfig, PS_HYBRID_CONFIG)
- H_ALLOC_MEM(Ram_PsHybrid, PS_HYBRID)
-
- FIXP_DBL* psMqmfBufferRealInit (INT ch, INT i);
- FIXP_DBL* psMqmfBufferImagInit (INT ch, INT i);
-
-
- /* working buffer */
- H_ALLOC_MEM(Ram_PsHybWkReal, FIXP_DBL)
- H_ALLOC_MEM(Ram_PsHybWkImag, FIXP_DBL)
-
- H_ALLOC_MEM(Ram_PsMtmpReal, FIXP_DBL)
- H_ALLOC_MEM(Ram_PsMtmpImag, FIXP_DBL)