summaryrefslogtreecommitdiffstats
path: root/libSBRdec/src
diff options
context:
space:
mode:
Diffstat (limited to 'libSBRdec/src')
-rw-r--r--libSBRdec/src/env_dec.cpp4
-rw-r--r--libSBRdec/src/lpp_tran.cpp18
-rw-r--r--libSBRdec/src/sbrdecoder.cpp10
3 files changed, 12 insertions, 20 deletions
diff --git a/libSBRdec/src/env_dec.cpp b/libSBRdec/src/env_dec.cpp
index 5aa5ba7..24b2d3b 100644
--- a/libSBRdec/src/env_dec.cpp
+++ b/libSBRdec/src/env_dec.cpp
@@ -624,8 +624,8 @@ timeCompensateFirstEnvelope (HANDLE_SBR_HEADER_DATA hHeaderData, /*!< Static con
deltaExp = FDK_getNumOctavesDiv8(newLen, refLen);
- /* Shift by -3 to rescale ld-table, 1-ampRes to enable coarser steps */
- shift = (FRACT_BITS - 1 - ENV_EXP_FRACT + 1 - h_sbr_data->ampResolutionCurrentFrame - 3);
+ /* Shift by -3 to rescale ld-table, ampRes-1 to enable coarser steps */
+ shift = (FRACT_BITS - 1 - ENV_EXP_FRACT - 1 + h_sbr_data->ampResolutionCurrentFrame - 3);
deltaExp = deltaExp >> shift;
pFrameInfo->borders[0] = estimatedStartPos;
pFrameInfo->bordersNoise[0] = estimatedStartPos;
diff --git a/libSBRdec/src/lpp_tran.cpp b/libSBRdec/src/lpp_tran.cpp
index 2e59205..117e739 100644
--- a/libSBRdec/src/lpp_tran.cpp
+++ b/libSBRdec/src/lpp_tran.cpp
@@ -875,22 +875,8 @@ resetLppTransposer (HANDLE_SBR_LPP_TRANS hLppTrans, /*!< Handle of lpp transpos
/*
* Initialize the patching parameter
*/
- desiredBorder = 21;
- if (fs < 92017) {
- desiredBorder = 23;
- }
- if (fs < 75132) {
- desiredBorder = 32;
- }
- if (fs < 55426) {
- desiredBorder = 43;
- }
- if (fs < 46009) {
- desiredBorder = 46;
- }
- if (fs < 35777) {
- desiredBorder = 64;
- }
+ /* ISO/IEC 14496-3 (Figure 4.48): goalSb = round( 2.048e6 / fs ) */
+ desiredBorder = (((2048000*2) / fs) + 1) >> 1;
desiredBorder = findClosestEntry(desiredBorder, v_k_master, numMaster, 1); /* Adapt region to master-table */
diff --git a/libSBRdec/src/sbrdecoder.cpp b/libSBRdec/src/sbrdecoder.cpp
index ecddec3..26b2ea2 100644
--- a/libSBRdec/src/sbrdecoder.cpp
+++ b/libSBRdec/src/sbrdecoder.cpp
@@ -137,7 +137,7 @@ amm-info@iis.fraunhofer.de
/* Decoder library info */
#define SBRDECODER_LIB_VL0 2
#define SBRDECODER_LIB_VL1 2
-#define SBRDECODER_LIB_VL2 2
+#define SBRDECODER_LIB_VL2 3
#define SBRDECODER_LIB_TITLE "SBR Decoder"
#define SBRDECODER_LIB_BUILD_DATE __DATE__
#define SBRDECODER_LIB_BUILD_TIME __TIME__
@@ -552,7 +552,7 @@ bail:
sbrDecoder_DestroyElement( self, elementIndex );
} else if (self->pSbrElement[elementIndex] != NULL) {
/* Set error flag to trigger concealment */
- self->pSbrElement[elementIndex]->frameErrorFlag[self->pSbrElement[elementIndex]->useFrameSlot] = 1;;
+ self->pSbrElement[elementIndex]->frameErrorFlag[self->pSbrElement[elementIndex]->useFrameSlot] = 1;
}
}
@@ -731,6 +731,12 @@ SBR_ERROR sbrDecoder_SetParam (HANDLE_SBRDECODER self,
case SBR_BS_INTERRUPTION:
{
int elementIndex;
+
+ if (self == NULL) {
+ errorStatus = SBRDEC_NOT_INITIALIZED;
+ break;
+ }
+
/* Loop over SBR elements */
for (elementIndex = 0; elementIndex < self->numSbrElements; elementIndex++)
{