Merge "Extend PS concealment/error treatment" am: 58221178cc
am: 45903f4e5a

Change-Id: I907fa44b6ab124f4b31a04212d06ff3e22cac567
diff --git a/libSBRdec/src/psbitdec.cpp b/libSBRdec/src/psbitdec.cpp
index f40a156..82bb65b 100644
--- a/libSBRdec/src/psbitdec.cpp
+++ b/libSBRdec/src/psbitdec.cpp
@@ -312,6 +312,7 @@
 
     if (pBsData->bEnableIid) {
       pBsData->bFineIidQ = h_ps_d->specificTo.mpeg.bPrevFrameFineIidQ;
+      pBsData->freqResIid = h_ps_d->specificTo.mpeg.prevFreqResIid;
       for (gr = 0; gr < NO_HI_RES_IID_BINS; gr++) {
         pBsData->aaIidIndex[pBsData->noEnv - 1][gr] =
             h_ps_d->specificTo.mpeg.aIidPrevFrameIndex[gr];
@@ -323,6 +324,7 @@
     }
 
     if (pBsData->bEnableIcc) {
+      pBsData->freqResIcc = h_ps_d->specificTo.mpeg.prevFreqResIcc;
       for (gr = 0; gr < NO_HI_RES_ICC_BINS; gr++) {
         pBsData->aaIccIndex[pBsData->noEnv - 1][gr] =
             h_ps_d->specificTo.mpeg.aIccPrevFrameIndex[gr];
@@ -337,6 +339,12 @@
   /* Update previous frame Iid quantization */
   h_ps_d->specificTo.mpeg.bPrevFrameFineIidQ = pBsData->bFineIidQ;
 
+  /* Update previous frequency resolution for IID */
+  h_ps_d->specificTo.mpeg.prevFreqResIid = pBsData->freqResIid;
+
+  /* Update previous frequency resolution for ICC */
+  h_ps_d->specificTo.mpeg.prevFreqResIcc = pBsData->freqResIcc;
+
   /* Update previous frame index buffers */
   for (gr = 0; gr < NO_HI_RES_IID_BINS; gr++) {
     h_ps_d->specificTo.mpeg.aIidPrevFrameIndex[gr] =
diff --git a/libSBRdec/src/psdec.h b/libSBRdec/src/psdec.h
index 6ae1473..029eac4 100644
--- a/libSBRdec/src/psdec.h
+++ b/libSBRdec/src/psdec.h
@@ -275,7 +275,11 @@
       SCHAR aIccPrevFrameIndex[NO_HI_RES_ICC_BINS]; /*!< The ICC index for
                                                        previous frame */
       UCHAR
-      bPrevFrameFineIidQ; /*!< The IID quantization of the previous frame */
+      bPrevFrameFineIidQ;   /*!< The IID quantization of the previous frame */
+      UCHAR prevFreqResIid; /*!< Frequency resolution for IID of the previous
+                               frame            */
+      UCHAR prevFreqResIcc; /*!< Frequency resolution for ICC of the previous
+                               frame            */
       UCHAR lastUsb; /*!< uppermost WMF delay band of last frame          */
 
       FIXP_DBL pHybridAnaStatesLFdmx