diff --git a/camera/CameraParameters.cpp b/camera/CameraParameters.cpp
index 059a8a5..872512a 100644
--- a/camera/CameraParameters.cpp
+++ b/camera/CameraParameters.cpp
@@ -155,6 +155,7 @@
 const char CameraParameters::PIXEL_FORMAT_RGBA8888[] = "rgba8888";
 const char CameraParameters::PIXEL_FORMAT_JPEG[] = "jpeg";
 const char CameraParameters::PIXEL_FORMAT_BAYER_RGGB[] = "bayer-rggb";
+const char CameraParameters::PIXEL_FORMAT_ANDROID_OPAQUE[] = "android-opaque";
 
 // Values for focus mode settings.
 const char CameraParameters::FOCUS_MODE_AUTO[] = "auto";
diff --git a/cmds/stagefright/Android.mk b/cmds/stagefright/Android.mk
index 8687fab..1247588 100644
--- a/cmds/stagefright/Android.mk
+++ b/cmds/stagefright/Android.mk
@@ -104,7 +104,7 @@
 
 LOCAL_SHARED_LIBRARIES := \
 	libstagefright liblog libutils libbinder libgui \
-        libstagefright_foundation libmedia libmedia_native
+        libstagefright_foundation libmedia libmedia_native libcutils
 
 LOCAL_C_INCLUDES:= \
 	frameworks/av/media/libstagefright \
diff --git a/cmds/stagefright/codec.cpp b/cmds/stagefright/codec.cpp
index f3370a5..723a6e5 100644
--- a/cmds/stagefright/codec.cpp
+++ b/cmds/stagefright/codec.cpp
@@ -34,7 +34,9 @@
 #include <media/stagefright/MediaCodecList.h>
 #include <media/stagefright/MediaDefs.h>
 #include <media/stagefright/NuMediaExtractor.h>
+#include <gui/ISurfaceComposer.h>
 #include <gui/SurfaceComposerClient.h>
+#include <ui/DisplayInfo.h>
 
 static void usage(const char *me) {
     fprintf(stderr, "usage: %s [-a] use audio\n"
@@ -378,14 +380,17 @@
         composerClient = new SurfaceComposerClient;
         CHECK_EQ(composerClient->initCheck(), (status_t)OK);
 
-        ssize_t displayWidth = composerClient->getDisplayWidth(0);
-        ssize_t displayHeight = composerClient->getDisplayHeight(0);
+        sp<IBinder> display(SurfaceComposerClient::getBuiltInDisplay(
+                ISurfaceComposer::eDisplayIdMain));
+        DisplayInfo info;
+        SurfaceComposerClient::getDisplayInfo(display, &info);
+        ssize_t displayWidth = info.w;
+        ssize_t displayHeight = info.h;
 
         ALOGV("display is %ld x %ld\n", displayWidth, displayHeight);
 
         control = composerClient->createSurface(
                 String8("A Surface"),
-                0,
                 displayWidth,
                 displayHeight,
                 PIXEL_FORMAT_RGB_565,
diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp
index 3bbfbdc..c817443 100644
--- a/cmds/stagefright/sf2.cpp
+++ b/cmds/stagefright/sf2.cpp
@@ -612,7 +612,6 @@
 
         control = composerClient->createSurface(
                 String8("A Surface"),
-                0,
                 1280,
                 800,
                 PIXEL_FORMAT_RGB_565,
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 0362f39..b92a8a0 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -922,7 +922,6 @@
 
             control = composerClient->createSurface(
                     String8("A Surface"),
-                    0,
                     1280,
                     800,
                     PIXEL_FORMAT_RGB_565,
diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp
index efa1445..7329dcc 100644
--- a/cmds/stagefright/stream.cpp
+++ b/cmds/stagefright/stream.cpp
@@ -19,6 +19,7 @@
 #include "utils/Log.h"
 
 #include <binder/ProcessState.h>
+#include <cutils/properties.h> // for property_get
 
 #include <media/IStreamSource.h>
 #include <media/mediaplayer.h>
@@ -32,9 +33,11 @@
 
 #include <binder/IServiceManager.h>
 #include <media/IMediaPlayerService.h>
+#include <gui/ISurfaceComposer.h>
 #include <gui/SurfaceComposerClient.h>
 
 #include <fcntl.h>
+#include <ui/DisplayInfo.h>
 
 using namespace android;
 
@@ -304,15 +307,18 @@
     sp<SurfaceComposerClient> composerClient = new SurfaceComposerClient;
     CHECK_EQ(composerClient->initCheck(), (status_t)OK);
 
-    ssize_t displayWidth = composerClient->getDisplayWidth(0);
-    ssize_t displayHeight = composerClient->getDisplayHeight(0);
+    sp<IBinder> display(SurfaceComposerClient::getBuiltInDisplay(
+            ISurfaceComposer::eDisplayIdMain));
+    DisplayInfo info;
+    SurfaceComposerClient::getDisplayInfo(display, &info);
+    ssize_t displayWidth = info.w;
+    ssize_t displayHeight = info.h;
 
     ALOGV("display is %d x %d\n", displayWidth, displayHeight);
 
     sp<SurfaceControl> control =
         composerClient->createSurface(
                 String8("A Surface"),
-                0,
                 displayWidth,
                 displayHeight,
                 PIXEL_FORMAT_RGB_565,
@@ -339,8 +345,16 @@
 
     sp<IStreamSource> source;
 
+    char prop[PROPERTY_VALUE_MAX];
+    bool usemp4 = property_get("media.stagefright.use-mp4source", prop, NULL) &&
+            (!strcmp(prop, "1") || !strcasecmp(prop, "true"));
+
     size_t len = strlen(argv[1]);
-    if (len >= 3 && !strcasecmp(".ts", &argv[1][len - 3])) {
+    if ((!usemp4 && len >= 3 && !strcasecmp(".ts", &argv[1][len - 3])) ||
+        (usemp4 && len >= 4 &&
+         (!strcasecmp(".mp4", &argv[1][len - 4])
+            || !strcasecmp(".3gp", &argv[1][len- 4])
+            || !strcasecmp(".3g2", &argv[1][len- 4])))) {
         int fd = open(argv[1], O_RDONLY);
 
         if (fd < 0) {
diff --git a/drm/common/DrmEngineBase.cpp b/drm/common/DrmEngineBase.cpp
index a060f38..f734905 100644
--- a/drm/common/DrmEngineBase.cpp
+++ b/drm/common/DrmEngineBase.cpp
@@ -66,8 +66,8 @@
     return onAcquireDrmInfo(uniqueId, drmInfoRequest);
 }
 
-String8 DrmEngineBase::getOriginalMimeType(int uniqueId, const String8& path) {
-    return onGetOriginalMimeType(uniqueId, path);
+String8 DrmEngineBase::getOriginalMimeType(int uniqueId, const String8& path, int fd) {
+    return onGetOriginalMimeType(uniqueId, path, fd);
 }
 
 int DrmEngineBase::getDrmObjectType(int uniqueId, const String8& path, const String8& mimeType) {
diff --git a/drm/common/IDrmManagerService.cpp b/drm/common/IDrmManagerService.cpp
index ccff257..b76572c 100644
--- a/drm/common/IDrmManagerService.cpp
+++ b/drm/common/IDrmManagerService.cpp
@@ -368,13 +368,18 @@
     return reply.readInt32();
 }
 
-String8 BpDrmManagerService::getOriginalMimeType(int uniqueId, const String8& path) {
+String8 BpDrmManagerService::getOriginalMimeType(int uniqueId, const String8& path, int fd) {
     ALOGV("Get Original MimeType");
     Parcel data, reply;
 
     data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor());
     data.writeInt32(uniqueId);
     data.writeString8(path);
+    int32_t isFdValid = (fd >= 0);
+    data.writeInt32(isFdValid);
+    if (isFdValid) {
+        data.writeFileDescriptor(fd);
+    }
 
     remote()->transact(GET_ORIGINAL_MIMETYPE, data, &reply);
     return reply.readString8();
@@ -1067,7 +1072,12 @@
 
         const int uniqueId = data.readInt32();
         const String8 path = data.readString8();
-        const String8 originalMimeType = getOriginalMimeType(uniqueId, path);
+        const int32_t isFdValid = data.readInt32();
+        int fd = -1;
+        if (isFdValid) {
+            fd = data.readFileDescriptor();
+        }
+        const String8 originalMimeType = getOriginalMimeType(uniqueId, path, fd);
 
         reply->writeString8(originalMimeType);
         return DRM_NO_ERROR;
diff --git a/drm/drmserver/DrmManager.cpp b/drm/drmserver/DrmManager.cpp
index 737edab..e7b0e90 100644
--- a/drm/drmserver/DrmManager.cpp
+++ b/drm/drmserver/DrmManager.cpp
@@ -266,12 +266,12 @@
     return result;
 }
 
-String8 DrmManager::getOriginalMimeType(int uniqueId, const String8& path) {
+String8 DrmManager::getOriginalMimeType(int uniqueId, const String8& path, int fd) {
     Mutex::Autolock _l(mLock);
     const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
     if (EMPTY_STRING != plugInId) {
         IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
-        return rDrmEngine.getOriginalMimeType(uniqueId, path);
+        return rDrmEngine.getOriginalMimeType(uniqueId, path, fd);
     }
     return EMPTY_STRING;
 }
diff --git a/drm/drmserver/DrmManagerService.cpp b/drm/drmserver/DrmManagerService.cpp
index 25a4e7b..bbd3b7f 100644
--- a/drm/drmserver/DrmManagerService.cpp
+++ b/drm/drmserver/DrmManagerService.cpp
@@ -125,9 +125,9 @@
     return mDrmManager->saveRights(uniqueId, drmRights, rightsPath, contentPath);
 }
 
-String8 DrmManagerService::getOriginalMimeType(int uniqueId, const String8& path) {
+String8 DrmManagerService::getOriginalMimeType(int uniqueId, const String8& path, int fd) {
     ALOGV("Entering getOriginalMimeType");
-    return mDrmManager->getOriginalMimeType(uniqueId, path);
+    return mDrmManager->getOriginalMimeType(uniqueId, path, fd);
 }
 
 int DrmManagerService::getDrmObjectType(
diff --git a/drm/libdrmframework/DrmManagerClient.cpp b/drm/libdrmframework/DrmManagerClient.cpp
index d4db461..ea30d01 100644
--- a/drm/libdrmframework/DrmManagerClient.cpp
+++ b/drm/libdrmframework/DrmManagerClient.cpp
@@ -64,8 +64,8 @@
     return mDrmManagerClientImpl->saveRights(mUniqueId, drmRights, rightsPath, contentPath);
 }
 
-String8 DrmManagerClient::getOriginalMimeType(const String8& path) {
-    return mDrmManagerClientImpl->getOriginalMimeType(mUniqueId, path);
+String8 DrmManagerClient::getOriginalMimeType(const String8& path, int fd) {
+    return mDrmManagerClientImpl->getOriginalMimeType(mUniqueId, path, fd);
 }
 
 int DrmManagerClient::getDrmObjectType(const String8& path, const String8& mimeType) {
diff --git a/drm/libdrmframework/DrmManagerClientImpl.cpp b/drm/libdrmframework/DrmManagerClientImpl.cpp
index b1228d4..a970035 100644
--- a/drm/libdrmframework/DrmManagerClientImpl.cpp
+++ b/drm/libdrmframework/DrmManagerClientImpl.cpp
@@ -147,10 +147,10 @@
 }
 
 String8 DrmManagerClientImpl::getOriginalMimeType(
-        int uniqueId, const String8& path) {
+        int uniqueId, const String8& path, int fd) {
     String8 mimeType = EMPTY_STRING;
     if (EMPTY_STRING != path) {
-        mimeType = getDrmManagerService()->getOriginalMimeType(uniqueId, path);
+        mimeType = getDrmManagerService()->getOriginalMimeType(uniqueId, path, fd);
     }
     return mimeType;
 }
diff --git a/drm/libdrmframework/include/DrmManager.h b/drm/libdrmframework/include/DrmManager.h
index 3942efe..491e8f7 100644
--- a/drm/libdrmframework/include/DrmManager.h
+++ b/drm/libdrmframework/include/DrmManager.h
@@ -85,7 +85,7 @@
     status_t saveRights(int uniqueId, const DrmRights& drmRights,
             const String8& rightsPath, const String8& contentPath);
 
-    String8 getOriginalMimeType(int uniqueId, const String8& path);
+    String8 getOriginalMimeType(int uniqueId, const String8& path, int fd);
 
     int getDrmObjectType(int uniqueId, const String8& path, const String8& mimeType);
 
diff --git a/drm/libdrmframework/include/DrmManagerClientImpl.h b/drm/libdrmframework/include/DrmManagerClientImpl.h
index f3d9315..9b4c9ae 100644
--- a/drm/libdrmframework/include/DrmManagerClientImpl.h
+++ b/drm/libdrmframework/include/DrmManagerClientImpl.h
@@ -148,10 +148,11 @@
      *
      * @param[in] uniqueId Unique identifier for a session
      * @param[in] path the path of the protected content
+     * @param[in] fd the file descriptor of the protected content
      * @return String8
      *     Returns mime-type of the original content, such as "video/mpeg"
      */
-    String8 getOriginalMimeType(int uniqueId, const String8& path);
+    String8 getOriginalMimeType(int uniqueId, const String8& path, int fd);
 
     /**
      * Retrieves the type of the protected object (content, rights, etc..)
diff --git a/drm/libdrmframework/include/DrmManagerService.h b/drm/libdrmframework/include/DrmManagerService.h
index 066fe4a..0dfdca6 100644
--- a/drm/libdrmframework/include/DrmManagerService.h
+++ b/drm/libdrmframework/include/DrmManagerService.h
@@ -72,7 +72,7 @@
     status_t saveRights(int uniqueId, const DrmRights& drmRights,
             const String8& rightsPath, const String8& contentPath);
 
-    String8 getOriginalMimeType(int uniqueId, const String8& path);
+    String8 getOriginalMimeType(int uniqueId, const String8& path, int fd);
 
     int getDrmObjectType(int uniqueId, const String8& path, const String8& mimeType);
 
diff --git a/drm/libdrmframework/include/IDrmManagerService.h b/drm/libdrmframework/include/IDrmManagerService.h
index 5b89c91..5a4d70a 100644
--- a/drm/libdrmframework/include/IDrmManagerService.h
+++ b/drm/libdrmframework/include/IDrmManagerService.h
@@ -109,7 +109,7 @@
     virtual status_t saveRights(int uniqueId, const DrmRights& drmRights,
             const String8& rightsPath, const String8& contentPath) = 0;
 
-    virtual String8 getOriginalMimeType(int uniqueId, const String8& path) = 0;
+    virtual String8 getOriginalMimeType(int uniqueId, const String8& path, int fd) = 0;
 
     virtual int getDrmObjectType(
             int uniqueId, const String8& path, const String8& mimeType) = 0;
@@ -200,7 +200,7 @@
     virtual status_t saveRights(int uniqueId, const DrmRights& drmRights,
             const String8& rightsPath, const String8& contentPath);
 
-    virtual String8 getOriginalMimeType(int uniqueId, const String8& path);
+    virtual String8 getOriginalMimeType(int uniqueId, const String8& path, int fd);
 
     virtual int getDrmObjectType(int uniqueId, const String8& path, const String8& mimeType);
 
diff --git a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h b/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
index 6cebb97..fa51c13 100644
--- a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
+++ b/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
@@ -53,7 +53,7 @@
 
     DrmInfo* acquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest);
 
-    String8 getOriginalMimeType(int uniqueId, const String8& path);
+    String8 getOriginalMimeType(int uniqueId, const String8& path, int fd);
 
     int getDrmObjectType(int uniqueId, const String8& path, const String8& mimeType);
 
@@ -222,10 +222,11 @@
      *
      * @param[in] uniqueId Unique identifier for a session
      * @param[in] path Path of the protected content
+     * @param[in] fd descriptor of the protected content as a file source
      * @return String8
      *     Returns mime-type of the original content, such as "video/mpeg"
      */
-    virtual String8 onGetOriginalMimeType(int uniqueId, const String8& path) = 0;
+    virtual String8 onGetOriginalMimeType(int uniqueId, const String8& path, int fd) = 0;
 
     /**
      * Retrieves the type of the protected object (content, rights, etc..)
diff --git a/drm/libdrmframework/plugins/common/include/IDrmEngine.h b/drm/libdrmframework/plugins/common/include/IDrmEngine.h
index 60f4c1b..acc8ed9 100644
--- a/drm/libdrmframework/plugins/common/include/IDrmEngine.h
+++ b/drm/libdrmframework/plugins/common/include/IDrmEngine.h
@@ -165,11 +165,12 @@
      * Retrieves the mime type embedded inside the original content
      *
      * @param[in] uniqueId Unique identifier for a session
-     * @param[in] path Path of the protected content
+     * @param[in] path Path of the content or null.
+     * @param[in] fd File descriptor of the protected content
      * @return String8
      *     Returns mime-type of the original content, such as "video/mpeg"
      */
-    virtual String8 getOriginalMimeType(int uniqueId, const String8& path) = 0;
+    virtual String8 getOriginalMimeType(int uniqueId, const String8& path, int fd) = 0;
 
     /**
      * Retrieves the type of the protected object (content, rights, etc..)
diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h
index c0e408e..a31b951 100644
--- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h
+++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/include/FwdLockEngine.h
@@ -150,11 +150,12 @@
  * Retrieves the mime type embedded inside the original content.
  *
  * @param uniqueId Unique identifier for a session
- * @param path Path of the protected content
+ * @param path Path of the conent or null.
+ * @param fd descriptor of the protected content as a file source
  * @return String8
  *       Returns mime-type of the original content, such as "video/mpeg"
  */
-String8 onGetOriginalMimeType(int uniqueId, const String8& path);
+String8 onGetOriginalMimeType(int uniqueId, const String8& path, int fd);
 
 /**
  * Retrieves the type of the protected object (content, rights, etc..)
diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
index 4b1b40e..234aef2 100644
--- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
+++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
@@ -309,12 +309,15 @@
     return (onCheckRightsStatus(uniqueId, path, action) == RightsStatus::RIGHTS_VALID);
 }
 
-String8 FwdLockEngine::onGetOriginalMimeType(int uniqueId, const String8& path) {
+String8 FwdLockEngine::onGetOriginalMimeType(int uniqueId, const String8& path, int fd) {
     LOG_VERBOSE("FwdLockEngine::onGetOriginalMimeType");
     String8 mimeString = String8("");
-    int fileDesc = FwdLockFile_open(path.string());
+    int fileDesc = dup(fd);
 
     if (-1 < fileDesc) {
+        if (FwdLockFile_attach(fileDesc) < 0) {
+            return mimeString;
+        }
         const char* pMimeType = FwdLockFile_GetContentType(fileDesc);
 
         if (NULL != pMimeType) {
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/FwdLockConv.c b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/FwdLockConv.c
index 299116d..bb97abc 100644
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/FwdLockConv.c
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/FwdLockConv.c
@@ -1314,34 +1314,3 @@
     }
     return status;
 }
-
-FwdLockConv_Status_t FwdLockConv_ConvertFile(const char *pInputFilename,
-                                             const char *pOutputFilename,
-                                             off64_t *pErrorPos) {
-    FwdLockConv_Status_t status;
-    if (pErrorPos != NULL) {
-        *pErrorPos = INVALID_OFFSET;
-    }
-    if (pInputFilename == NULL || pOutputFilename == NULL) {
-        status = FwdLockConv_Status_InvalidArgument;
-    } else {
-        int inputFileDesc = open(pInputFilename, O_RDONLY);
-        if (inputFileDesc < 0) {
-            status = FwdLockConv_Status_FileNotFound;
-        } else {
-            int outputFileDesc = open(pOutputFilename, O_CREAT | O_TRUNC | O_WRONLY,
-                                      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-            if (outputFileDesc < 0) {
-                status = FwdLockConv_Status_FileCreationFailed;
-            } else {
-                status = FwdLockConv_ConvertOpenFile(inputFileDesc, read, outputFileDesc, write,
-                                                     lseek64, pErrorPos);
-                if (close(outputFileDesc) == 0 && status != FwdLockConv_Status_OK) {
-                    remove(pOutputFilename);
-                }
-            }
-            (void)close(inputFileDesc);
-        }
-    }
-    return status;
-}
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/FwdLockConv.h b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/FwdLockConv.h
index e20c0c3..6449d89 100644
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/converter/FwdLockConv.h
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/converter/FwdLockConv.h
@@ -245,36 +245,6 @@
                                                  FwdLockConv_LSeekFunc_t *fpLSeekFunc,
                                                  off64_t *pErrorPos);
 
-/**
- * Converts an OMA DRM v1 Forward Lock file to the internal Forward Lock file format in pull mode.
- *
- * @param[in] pInputFilename A reference to the input filename.
- * @param[in] pOutputFilename A reference to the output filename.
- * @param[out] pErrorPos
- *   The file position where the error occurred, in the case of a syntax error. May be NULL.
- *
- * @return A status code.
- * @retval FwdLockConv_Status_OK
- * @retval FwdLockConv_Status_InvalidArgument
- * @retval FwdLockConv_Status_OutOfMemory
- * @retval FwdLockConv_Status_FileNotFound
- * @retval FwdLockConv_Status_FileCreationFailed
- * @retval FwdLockConv_Status_FileReadError
- * @retval FwdLockConv_Status_FileWriteError
- * @retval FwdLockConv_Status_FileSeekError
- * @retval FwdLockConv_Status_SyntaxError
- * @retval FwdLockConv_Status_UnsupportedFileFormat
- * @retval FwdLockConv_Status_UnsupportedContentTransferEncoding
- * @retval FwdLockConv_Status_RandomNumberGenerationFailed
- * @retval FwdLockConv_Status_KeyEncryptionFailed
- * @retval FwdLockConv_Status_DataEncryptionFailed
- * @retval FwdLockConv_Status_IntegrityProtectionFailed
- * @retval FwdLockConv_Status_TooManySessions
- */
-FwdLockConv_Status_t FwdLockConv_ConvertFile(const char *pInputFilename,
-                                             const char *pOutputFilename,
-                                             off64_t *pErrorPos);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
index 365bdec..7ff3c00 100644
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.c
@@ -293,20 +293,6 @@
     return (sessionId >= 0) ? 0 : -1;
 }
 
-int FwdLockFile_open(const char *pFilename) {
-    int fileDesc = open(pFilename, O_RDONLY);
-    if (fileDesc < 0) {
-        ALOGE("failed to open file '%s': %s", pFilename, strerror(errno));
-        return fileDesc;
-    }
-
-    if (FwdLockFile_attach(fileDesc) < 0) {
-        (void)close(fileDesc);
-        fileDesc = -1;
-    }
-    return fileDesc;
-}
-
 ssize_t FwdLockFile_read(int fileDesc, void *pBuffer, size_t numBytes) {
     ssize_t numBytesRead;
     int sessionId = FwdLockFile_FindSession(fileDesc);
diff --git a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.h b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.h
index fc64050..187505b 100644
--- a/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.h
+++ b/drm/libdrmframework/plugins/forward-lock/internal-format/decoder/FwdLockFile.h
@@ -36,16 +36,6 @@
 int FwdLockFile_attach(int fileDesc);
 
 /**
- * Opens a Forward Lock file for reading.
- *
- * @param[in] pFilename A reference to a filename.
- *
- * @return A file descriptor.
- * @retval -1 Failure.
- */
-int FwdLockFile_open(const char *pFilename);
-
-/**
  * Reads the specified number of bytes from an open Forward Lock file.
  *
  * @param[in] fileDesc The file descriptor of an open Forward Lock file.
diff --git a/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h b/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
index f941f70..7b66dc7 100644
--- a/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
+++ b/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
@@ -47,7 +47,7 @@
 
     DrmInfo* onAcquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest);
 
-    String8 onGetOriginalMimeType(int uniqueId, const String8& path);
+    String8 onGetOriginalMimeType(int uniqueId, const String8& path, int fd);
 
     int onGetDrmObjectType(int uniqueId, const String8& path, const String8& mimeType);
 
diff --git a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
index a3eac3e..fa659fd 100644
--- a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
+++ b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
@@ -163,7 +163,7 @@
     return (String8(".passthru") == extension);
 }
 
-String8 DrmPassthruPlugIn::onGetOriginalMimeType(int uniqueId, const String8& path) {
+String8 DrmPassthruPlugIn::onGetOriginalMimeType(int uniqueId, const String8& path, int fd) {
     ALOGV("DrmPassthruPlugIn::onGetOriginalMimeType() : %d", uniqueId);
     return String8("video/passthru");
 }
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index 36248a0..4d5aa36 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -606,6 +606,8 @@
     // Raw bayer format used for images, which is 10 bit precision samples
     // stored in 16 bit words. The filter pattern is RGGB.
     static const char PIXEL_FORMAT_BAYER_RGGB[];
+    // Pixel format is not known to the framework
+    static const char PIXEL_FORMAT_ANDROID_OPAQUE[];
 
     // Values for focus mode settings.
     // Auto-focus mode. Applications should call
diff --git a/include/drm/DrmManagerClient.h b/include/drm/DrmManagerClient.h
index a5c6992..866edac 100644
--- a/include/drm/DrmManagerClient.h
+++ b/include/drm/DrmManagerClient.h
@@ -279,10 +279,11 @@
      * Retrieves the mime type embedded inside the original content
      *
      * @param[in] path the path of the protected content
+     * @param[in] fd the file descriptor of the protected content
      * @return String8
      *     Returns mime-type of the original content, such as "video/mpeg"
      */
-    String8 getOriginalMimeType(const String8& path);
+    String8 getOriginalMimeType(const String8& path, int fd);
 
     /**
      * Retrieves the type of the protected object (content, rights, etc..)
diff --git a/services/audioflinger/AudioBufferProvider.h b/include/media/AudioBufferProvider.h
similarity index 100%
rename from services/audioflinger/AudioBufferProvider.h
rename to include/media/AudioBufferProvider.h
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index ef77692..156c592 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -17,21 +17,14 @@
 #ifndef AUDIORECORD_H_
 #define AUDIORECORD_H_
 
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <media/IAudioFlinger.h>
-#include <media/IAudioRecord.h>
-
-#include <utils/RefBase.h>
-#include <utils/Errors.h>
-#include <binder/IInterface.h>
 #include <binder/IMemory.h>
 #include <cutils/sched_policy.h>
-#include <utils/threads.h>
-
-#include <system/audio.h>
 #include <media/AudioSystem.h>
+#include <media/IAudioRecord.h>
+#include <system/audio.h>
+#include <utils/RefBase.h>
+#include <utils/Errors.h>
+#include <utils/threads.h>
 
 namespace android {
 
@@ -46,11 +39,10 @@
     static const int DEFAULT_SAMPLE_RATE = 8000;
 
     /* Events used by AudioRecord callback function (callback_t).
-     *
-     * to keep in sync with frameworks/base/media/java/android/media/AudioRecord.java
+     * Keep in sync with frameworks/base/media/java/android/media/AudioRecord.java NATIVE_EVENT_*.
      */
     enum event_type {
-        EVENT_MORE_DATA = 0,        // Request to reqd more data from PCM buffer.
+        EVENT_MORE_DATA = 0,        // Request to read more data from PCM buffer.
         EVENT_OVERRUN = 1,          // PCM buffer overrun occured.
         EVENT_MARKER = 2,           // Record head is at the specified marker position
                                     // (See setMarkerPosition()).
@@ -72,7 +64,7 @@
         int         channelCount;
         audio_format_t format;
         size_t      frameCount;
-        size_t      size;
+        size_t      size;           // total size in bytes == frameCount * frameSize
         union {
             void*       raw;
             short*      i16;
@@ -80,12 +72,6 @@
         };
     };
 
-    /* These are static methods to control the system-wide AudioFlinger
-     * only privileged processes can have access to them
-     */
-
-//    static status_t setMasterMute(bool mute);
-
     /* As a convenience, if a callback is supplied, a handler thread
      * is automatically created with the appropriate priority. This thread
      * invokes the callback when a new buffer becomes ready or an overrun condition occurs.
@@ -98,8 +84,8 @@
      *          more bytes than indicated by 'size' field and update 'size' if less bytes are
      *          read.
      *          - EVENT_OVERRUN: unused.
-     *          - EVENT_MARKER: pointer to an uin32_t containing the marker position in frames.
-     *          - EVENT_NEW_POS: pointer to an uin32_t containing the new position in frames.
+     *          - EVENT_MARKER: pointer to const uint32_t containing the marker position in frames.
+     *          - EVENT_NEW_POS: pointer to const uint32_t containing the new position in frames.
      */
 
     typedef void (*callback_t)(int event, void* user, void *info);
@@ -115,7 +101,7 @@
      static status_t getMinFrameCount(int* frameCount,
                                       uint32_t sampleRate,
                                       audio_format_t format,
-                                      int channelCount);
+                                      audio_channel_mask_t channelMask);
 
     /* Constructs an uninitialized AudioRecord. No connection with
      * AudioFlinger takes place.
@@ -133,32 +119,22 @@
      * sampleRate:         Track sampling rate in Hz.
      * format:             Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed
      *                     16 bits per sample).
-     * channelMask:        Channel mask: see audio_channels_t.
+     * channelMask:        Channel mask.
      * frameCount:         Total size of track PCM buffer in frames. This defines the
      *                     latency of the track.
-     * flags:              A bitmask of acoustic values from enum record_flags.  It enables
-     *                     AGC, NS, and IIR.
      * cbf:                Callback function. If not null, this function is called periodically
      *                     to provide new PCM data.
+     * user:               Context for use by the callback receiver.
      * notificationFrames: The callback function is called each time notificationFrames PCM
      *                     frames are ready in record track output buffer.
-     * user                Context for use by the callback receiver.
+     * sessionId:          Not yet supported.
      */
 
-     // FIXME consider removing this alias and replacing it by audio_in_acoustics_t
-     //       or removing the parameter entirely if it is unused
-     enum record_flags {
-         RECORD_AGC_ENABLE = AUDIO_IN_ACOUSTICS_AGC_ENABLE,
-         RECORD_NS_ENABLE  = AUDIO_IN_ACOUSTICS_NS_ENABLE,
-         RECORD_IIR_ENABLE = AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE,
-     };
-
                         AudioRecord(audio_source_t inputSource,
                                     uint32_t sampleRate = 0,
                                     audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                    uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
+                                    audio_channel_mask_t channelMask = AUDIO_CHANNEL_IN_MONO,
                                     int frameCount      = 0,
-                                    record_flags flags  = (record_flags) 0,
                                     callback_t cbf = NULL,
                                     void* user = NULL,
                                     int notificationFrames = 0,
@@ -166,7 +142,7 @@
 
 
     /* Terminates the AudioRecord and unregisters it from AudioFlinger.
-     * Also destroys all resources assotiated with the AudioRecord.
+     * Also destroys all resources associated with the AudioRecord.
      */
                         ~AudioRecord();
 
@@ -182,9 +158,8 @@
             status_t    set(audio_source_t inputSource = AUDIO_SOURCE_DEFAULT,
                             uint32_t sampleRate = 0,
                             audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                            uint32_t channelMask = AUDIO_CHANNEL_IN_MONO,
+                            audio_channel_mask_t channelMask = AUDIO_CHANNEL_IN_MONO,
                             int frameCount      = 0,
-                            record_flags flags  = (record_flags) 0,
                             callback_t cbf = NULL,
                             void* user = NULL,
                             int notificationFrames = 0,
@@ -205,11 +180,10 @@
      */
             uint32_t     latency() const;
 
-   /* getters, see constructor */
+   /* getters, see constructor and set() */
 
             audio_format_t format() const;
             int         channelCount() const;
-            int         channels() const;
             uint32_t    frameCount() const;
             size_t      frameSize() const;
             audio_source_t inputSource() const;
@@ -227,7 +201,7 @@
      * obtainBuffer returns STOPPED. Note that obtainBuffer() still works
      * and will fill up buffers until the pool is exhausted.
      */
-            status_t    stop();
+            void        stop();
             bool        stopped() const;
 
     /* get sample rate for this record track
@@ -271,7 +245,7 @@
             status_t    getPositionUpdatePeriod(uint32_t *updatePeriod) const;
 
 
-    /* Gets record head position. The position is the  total number of frames
+    /* Gets record head position. The position is the total number of frames
      * recorded since record start.
      *
      * Parameters:
@@ -294,7 +268,7 @@
      */
             audio_io_handle_t    getInput() const;
 
-    /* returns the audio session ID associated to this AudioRecord.
+    /* returns the audio session ID associated with this AudioRecord.
      *
      * Parameters:
      *  none.
@@ -342,57 +316,72 @@
             AudioRecord& operator = (const AudioRecord& other);
 
     /* a small internal class to handle the callback */
-    class ClientRecordThread : public Thread
+    class AudioRecordThread : public Thread
     {
     public:
-        ClientRecordThread(AudioRecord& receiver, bool bCanCallJava = false);
+        AudioRecordThread(AudioRecord& receiver, bool bCanCallJava = false);
+
+        // Do not call Thread::requestExitAndWait() without first calling requestExit().
+        // Thread::requestExitAndWait() is not virtual, and the implementation doesn't do enough.
+        virtual void        requestExit();
+
+                void        pause();    // suspend thread from execution at next loop boundary
+                void        resume();   // allow thread to execute, if not requested to exit
+
     private:
         friend class AudioRecord;
         virtual bool        threadLoop();
-        virtual status_t    readyToRun();
-        virtual void        onFirstRef() {}
         AudioRecord& mReceiver;
+        virtual ~AudioRecordThread();
+        Mutex               mMyLock;    // Thread::mLock is private
+        Condition           mMyCond;    // Thread::mThreadExitedCondition is private
+        bool                mPaused;    // whether thread is currently paused
     };
 
-            bool processAudioBuffer(const sp<ClientRecordThread>& thread);
+            // body of AudioRecordThread::threadLoop()
+            bool processAudioBuffer(const sp<AudioRecordThread>& thread);
+
             status_t openRecord_l(uint32_t sampleRate,
                                 audio_format_t format,
-                                uint32_t channelMask,
+                                audio_channel_mask_t channelMask,
                                 int frameCount,
                                 audio_io_handle_t input);
             audio_io_handle_t getInput_l();
             status_t restoreRecord_l(audio_track_cblk_t*& cblk);
 
-    sp<IAudioRecord>        mAudioRecord;
-    sp<IMemory>             mCblkMemory;
-    sp<ClientRecordThread>  mClientRecordThread;
-    status_t                mReadyToRun;
+    sp<AudioRecordThread>   mAudioRecordThread;
     mutable Mutex           mLock;
-    Condition               mCondition;
 
+    bool                    mActive;            // protected by mLock
+
+    // for client callback handler
+    callback_t              mCbf;
+    void*                   mUserData;
+
+    // for notification APIs
+    uint32_t                mNotificationFrames;
+    uint32_t                mRemainingFrames;
+    uint32_t                mMarkerPosition;    // in frames
+    bool                    mMarkerReached;
+    uint32_t                mNewPosition;       // in frames
+    uint32_t                mUpdatePeriod;      // in ms
+
+    // constant after constructor or set()
     uint32_t                mFrameCount;
-
-    audio_track_cblk_t*     mCblk;
     audio_format_t          mFormat;
     uint8_t                 mChannelCount;
     audio_source_t          mInputSource;
     status_t                mStatus;
     uint32_t                mLatency;
-
-    volatile int32_t        mActive;
-
-    callback_t              mCbf;
-    void*                   mUserData;
-    uint32_t                mNotificationFrames;
-    uint32_t                mRemainingFrames;
-    uint32_t                mMarkerPosition;
-    bool                    mMarkerReached;
-    uint32_t                mNewPosition;
-    uint32_t                mUpdatePeriod;
-    record_flags            mFlags;
-    uint32_t                mChannelMask;
-    audio_io_handle_t       mInput;
+    audio_channel_mask_t    mChannelMask;
+    audio_io_handle_t       mInput;                     // returned by AudioSystem::getInput()
     int                     mSessionId;
+
+    // may be changed if IAudioRecord object is re-created
+    sp<IAudioRecord>        mAudioRecord;
+    sp<IMemory>             mCblkMemory;
+    audio_track_cblk_t*     mCblk;
+
     int                     mPreviousPriority;          // before start()
     SchedPolicy             mPreviousSchedulingGroup;
 };
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index e2662f2..932482b 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -110,8 +110,8 @@
 
     static bool routedToA2dpOutput(audio_stream_type_t streamType);
 
-    static status_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount,
-        size_t* buffSize);
+    static status_t getInputBufferSize(uint32_t sampleRate, audio_format_t format,
+        audio_channel_mask_t channelMask, size_t* buffSize);
 
     static status_t setVoiceVolume(float volume);
 
@@ -126,6 +126,7 @@
     // necessary to check returned status before using the returned values.
     static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
 
+    // return the number of input frames lost by HAL implementation, or 0 if the handle is invalid
     static unsigned int  getInputFramesLost(audio_io_handle_t ioHandle);
 
     static int newAudioSessionId();
@@ -188,7 +189,7 @@
     static audio_io_handle_t getOutput(audio_stream_type_t stream,
                                         uint32_t samplingRate = 0,
                                         audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                        uint32_t channels = AUDIO_CHANNEL_OUT_STEREO,
+                                        audio_channel_mask_t channelMask = AUDIO_CHANNEL_OUT_STEREO,
                                         audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE);
     static status_t startOutput(audio_io_handle_t output,
                                 audio_stream_type_t stream,
@@ -200,8 +201,7 @@
     static audio_io_handle_t getInput(audio_source_t inputSource,
                                     uint32_t samplingRate = 0,
                                     audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                    uint32_t channels = AUDIO_CHANNEL_IN_MONO,
-                                    audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0,
+                                    audio_channel_mask_t channelMask = AUDIO_CHANNEL_IN_MONO,
                                     int sessionId = 0);
     static status_t startInput(audio_io_handle_t input);
     static status_t stopInput(audio_io_handle_t input);
@@ -219,8 +219,8 @@
     static uint32_t getStrategyForStream(audio_stream_type_t stream);
     static audio_devices_t getDevicesForStream(audio_stream_type_t stream);
 
-    static audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc);
-    static status_t registerEffect(effect_descriptor_t *desc,
+    static audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc);
+    static status_t registerEffect(const effect_descriptor_t *desc,
                                     audio_io_handle_t io,
                                     uint32_t strategy,
                                     int session,
@@ -277,7 +277,7 @@
     // previous parameters for recording buffer size queries
     static uint32_t gPrevInSamplingRate;
     static audio_format_t gPrevInFormat;
-    static int gPrevInChannelCount;
+    static audio_channel_mask_t gPrevInChannelMask;
 
     static sp<IAudioPolicyService> gAudioPolicyService;
 
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 639d6d2..34108b3 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -135,7 +135,7 @@
      * sampleRate:         Track sampling rate in Hz.
      * format:             Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed
      *                     16 bits per sample).
-     * channelMask:        Channel mask: see audio_channels_t.
+     * channelMask:        Channel mask.
      * frameCount:         Minimum size of track PCM buffer in frames. This defines the
      *                     latency of the track. The actual size selected by the AudioTrack could be
      *                     larger if the requested size is not compatible with current audio HAL
@@ -154,7 +154,7 @@
                         AudioTrack( audio_stream_type_t streamType,
                                     uint32_t sampleRate  = 0,
                                     audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                    int channelMask      = 0,
+                                    audio_channel_mask_t channelMask = 0,
                                     int frameCount       = 0,
                                     audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
                                     callback_t cbf       = NULL,
@@ -186,7 +186,7 @@
                         AudioTrack( audio_stream_type_t streamType,
                                     uint32_t sampleRate = 0,
                                     audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                    int channelMask     = 0,
+                                    audio_channel_mask_t channelMask = 0,
                                     const sp<IMemory>& sharedBuffer = 0,
                                     audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
                                     callback_t cbf      = NULL,
@@ -204,13 +204,13 @@
      * Returned status (from utils/Errors.h) can be:
      *  - NO_ERROR: successful initialization
      *  - INVALID_OPERATION: AudioTrack is already initialized
-     *  - BAD_VALUE: invalid parameter (channels, format, sampleRate...)
+     *  - BAD_VALUE: invalid parameter (channelMask, format, sampleRate...)
      *  - NO_INIT: audio server or audio hardware not initialized
      * */
             status_t    set(audio_stream_type_t streamType = AUDIO_STREAM_DEFAULT,
                             uint32_t sampleRate = 0,
                             audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                            int channelMask     = 0,
+                            audio_channel_mask_t channelMask = 0,
                             int frameCount      = 0,
                             audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
                             callback_t cbf      = NULL,
@@ -472,8 +472,6 @@
     private:
         friend class AudioTrack;
         virtual bool        threadLoop();
-        virtual status_t    readyToRun();
-        virtual void        onFirstRef();
         AudioTrack& mReceiver;
         ~AudioTrackThread();
         Mutex               mMyLock;    // Thread::mLock is private
@@ -487,7 +485,7 @@
             status_t createTrack_l(audio_stream_type_t streamType,
                                  uint32_t sampleRate,
                                  audio_format_t format,
-                                 uint32_t channelMask,
+                                 audio_channel_mask_t channelMask,
                                  int frameCount,
                                  audio_output_flags_t flags,
                                  const sp<IMemory>& sharedBuffer,
@@ -512,7 +510,7 @@
     uint8_t                 mChannelCount;
     uint8_t                 mMuted;
     uint8_t                 mReserved;
-    uint32_t                mChannelMask;
+    audio_channel_mask_t    mChannelMask;
     status_t                mStatus;
     uint32_t                mLatency;
 
@@ -549,7 +547,7 @@
     status_t allocateTimedBuffer(size_t size, sp<IMemory>* buffer);
 
     /* queue a buffer obtained via allocateTimedBuffer for playback at the
-       given timestamp.  PTS units a microseconds on the media time timeline.
+       given timestamp.  PTS units are microseconds on the media time timeline.
        The media time transform (set with setMediaTimeTransform) set by the
        audio producer will handle converting from media time to local time
        (perhaps going through the common time timeline in the case of
diff --git a/services/audioflinger/ExtendedAudioBufferProvider.h b/include/media/ExtendedAudioBufferProvider.h
similarity index 95%
rename from services/audioflinger/ExtendedAudioBufferProvider.h
rename to include/media/ExtendedAudioBufferProvider.h
index 88279b4..00c4444 100644
--- a/services/audioflinger/ExtendedAudioBufferProvider.h
+++ b/include/media/ExtendedAudioBufferProvider.h
@@ -17,7 +17,7 @@
 #ifndef ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H
 #define ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H
 
-#include "AudioBufferProvider.h"
+#include <media/AudioBufferProvider.h>
 
 namespace android {
 
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index 86e228b..bdd0142 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -48,7 +48,7 @@
     enum {
         TRACK_DEFAULT = 0,  // client requests a default AudioTrack
         TRACK_TIMED   = 1,  // client requests a TimedAudioTrack
-        TRACK_FAST    = 2,  // client requests a fast AudioTrack
+        TRACK_FAST    = 2,  // client requests a fast AudioTrack or AudioRecord
     };
     typedef uint32_t track_flags_t;
 
@@ -60,7 +60,7 @@
                                 audio_stream_type_t streamType,
                                 uint32_t sampleRate,
                                 audio_format_t format,
-                                uint32_t channelMask,
+                                audio_channel_mask_t channelMask,
                                 int frameCount,
                                 track_flags_t flags,
                                 const sp<IMemory>& sharedBuffer,
@@ -74,9 +74,10 @@
                                 audio_io_handle_t input,
                                 uint32_t sampleRate,
                                 audio_format_t format,
-                                uint32_t channelMask,
+                                audio_channel_mask_t channelMask,
                                 int frameCount,
                                 track_flags_t flags,
+                                pid_t tid,  // -1 means unused, otherwise must be valid non-0
                                 int *sessionId,
                                 status_t *status) = 0;
 
@@ -84,7 +85,9 @@
      * and therefore can be cached.
      */
     virtual     uint32_t    sampleRate(audio_io_handle_t output) const = 0;
+#if 0
     virtual     int         channelCount(audio_io_handle_t output) const = 0;
+#endif
     virtual     audio_format_t format(audio_io_handle_t output) const = 0;
     virtual     size_t      frameCount(audio_io_handle_t output) const = 0;
 
@@ -126,7 +129,8 @@
     virtual void registerClient(const sp<IAudioFlingerClient>& client) = 0;
 
     // retrieve the audio recording buffer size
-    virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const = 0;
+    virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format,
+            audio_channel_mask_t channelMask) const = 0;
 
     virtual audio_io_handle_t openOutput(audio_module_handle_t module,
                                          audio_devices_t *pDevices,
diff --git a/include/media/IAudioPolicyService.h b/include/media/IAudioPolicyService.h
index e160d70..fb556af 100644
--- a/include/media/IAudioPolicyService.h
+++ b/include/media/IAudioPolicyService.h
@@ -51,7 +51,7 @@
     virtual audio_io_handle_t getOutput(audio_stream_type_t stream,
                                         uint32_t samplingRate = 0,
                                         audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                        uint32_t channels = 0,
+                                        audio_channel_mask_t channelMask = 0,
                                         audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE) = 0;
     virtual status_t startOutput(audio_io_handle_t output,
                                  audio_stream_type_t stream,
@@ -63,8 +63,7 @@
     virtual audio_io_handle_t getInput(audio_source_t inputSource,
                                     uint32_t samplingRate = 0,
                                     audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                    uint32_t channels = 0,
-                                    audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0,
+                                    audio_channel_mask_t channelMask = 0,
                                     int audioSession = 0) = 0;
     virtual status_t startInput(audio_io_handle_t input) = 0;
     virtual status_t stopInput(audio_io_handle_t input) = 0;
@@ -80,8 +79,8 @@
                                           audio_devices_t device) = 0;
     virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0;
     virtual audio_devices_t getDevicesForStream(audio_stream_type_t stream) = 0;
-    virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0;
-    virtual status_t registerEffect(effect_descriptor_t *desc,
+    virtual audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc) = 0;
+    virtual status_t registerEffect(const effect_descriptor_t *desc,
                                     audio_io_handle_t io,
                                     uint32_t strategy,
                                     int session,
diff --git a/include/media/IAudioRecord.h b/include/media/IAudioRecord.h
index ebc03ea..d6e3141 100644
--- a/include/media/IAudioRecord.h
+++ b/include/media/IAudioRecord.h
@@ -37,7 +37,7 @@
     /* After it's created the track is not active. Call start() to
      * make it active.
      */
-    virtual status_t    start(int event, int triggerSession) = 0;
+    virtual status_t    start(int /*AudioSystem::sync_event_t*/ event, int triggerSession) = 0;
 
     /* Stop a track. If set, the callback will cease being called and
      * obtainBuffer will return an error. Buffers that are already released
diff --git a/include/media/IHDCP.h b/include/media/IHDCP.h
new file mode 100644
index 0000000..a0613c7
--- /dev/null
+++ b/include/media/IHDCP.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <binder/IInterface.h>
+#include <media/hardware/HDCPAPI.h>
+#include <media/stagefright/foundation/ABase.h>
+
+namespace android {
+
+struct IHDCPObserver : public IInterface {
+    DECLARE_META_INTERFACE(HDCPObserver);
+
+    virtual void notify(
+            int msg, int ext1, int ext2, const Parcel *obj) = 0;
+
+private:
+    DISALLOW_EVIL_CONSTRUCTORS(IHDCPObserver);
+};
+
+struct IHDCP : public IInterface {
+    DECLARE_META_INTERFACE(HDCP);
+
+    // Called to specify the observer that receives asynchronous notifications
+    // from the HDCP implementation to signal completion/failure of asynchronous
+    // operations (such as initialization) or out of band events.
+    virtual status_t setObserver(const sp<IHDCPObserver> &observer) = 0;
+
+    // Request to setup an HDCP session with the specified host listening
+    // on the specified port.
+    virtual status_t initAsync(const char *host, unsigned port) = 0;
+
+    // Request to shutdown the active HDCP session.
+    virtual status_t shutdownAsync() = 0;
+
+    // Encrypt a data according to the HDCP spec. The data is to be
+    // encrypted in-place, only size bytes of data should be read/write,
+    // even if the size is not a multiple of 128 bit (16 bytes).
+    // This operation is to be synchronous, i.e. this call does not return
+    // until outData contains size bytes of encrypted data.
+    // streamCTR will be assigned by the caller (to 0 for the first PES stream,
+    // 1 for the second and so on)
+    // inputCTR will be maintained by the callee for each PES stream.
+    virtual status_t encrypt(
+            const void *inData, size_t size, uint32_t streamCTR,
+            uint64_t *outInputCTR, void *outData) = 0;
+
+private:
+    DISALLOW_EVIL_CONSTRUCTORS(IHDCP);
+};
+
+struct BnHDCPObserver : public BnInterface<IHDCPObserver> {
+    virtual status_t onTransact(
+            uint32_t code, const Parcel &data, Parcel *reply,
+            uint32_t flags = 0);
+};
+
+struct BnHDCP : public BnInterface<IHDCP> {
+    virtual status_t onTransact(
+            uint32_t code, const Parcel &data, Parcel *reply,
+            uint32_t flags = 0);
+};
+
+}  // namespace android
+
+
diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h
index 00facc5..4ed1863 100644
--- a/include/media/IMediaPlayer.h
+++ b/include/media/IMediaPlayer.h
@@ -64,6 +64,7 @@
     virtual status_t        setParameter(int key, const Parcel& request) = 0;
     virtual status_t        getParameter(int key, Parcel* reply) = 0;
     virtual status_t        setRetransmitEndpoint(const struct sockaddr_in* endpoint) = 0;
+    virtual status_t        getRetransmitEndpoint(struct sockaddr_in* endpoint) = 0;
     virtual status_t        setNextPlayer(const sp<IMediaPlayer>& next) = 0;
 
     // Invoke a generic method on the player by using opaque parcels
diff --git a/include/media/IMediaPlayerService.h b/include/media/IMediaPlayerService.h
index 76c45a0..172975c 100644
--- a/include/media/IMediaPlayerService.h
+++ b/include/media/IMediaPlayerService.h
@@ -50,6 +50,12 @@
     virtual sp<IOMX>            getOMX() = 0;
     virtual sp<ICrypto>         makeCrypto() = 0;
 
+    // If iface == NULL, disable remote display, otherwise
+    // iface should be of the form "x.x.x.x:y", i.e. ip address
+    // of the local interface to bind to and the port number
+    // to listen on.
+    virtual status_t enableRemoteDisplay(const char *iface) = 0;
+
     // codecs and audio devices usage tracking for the battery app
     enum BatteryDataBits {
         // tracking audio codec
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index a70fe8c..518948c 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -50,9 +50,6 @@
     // The shared library with the test player is passed passed as an
     // argument to the 'test:' url in the setDataSource call.
     TEST_PLAYER = 5,
-
-    AAH_RX_PLAYER = 100,
-    AAH_TX_PLAYER = 101,
 };
 
 
@@ -154,12 +151,15 @@
     virtual status_t    getParameter(int key, Parcel *reply) = 0;
 
     // Right now, only the AAX TX player supports this functionality.  For now,
-    // provide a default implementation which indicates a lack of support for
-    // this functionality to make life easier for all of the other media player
+    // provide default implementations which indicate a lack of support for this
+    // functionality to make life easier for all of the other media player
     // maintainers out there.
     virtual status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) {
         return INVALID_OPERATION;
     }
+    virtual status_t getRetransmitEndpoint(struct sockaddr_in* endpoint) {
+        return INVALID_OPERATION;
+    }
 
     // Invoke a generic method on the player by using opaque parcels
     // for the request and reply.
diff --git a/include/media/Visualizer.h b/include/media/Visualizer.h
index fdec5ee..aa58905 100644
--- a/include/media/Visualizer.h
+++ b/include/media/Visualizer.h
@@ -142,8 +142,6 @@
     private:
         friend class Visualizer;
         virtual bool        threadLoop();
-        virtual status_t    readyToRun();
-        virtual void        onFirstRef();
         Visualizer& mReceiver;
         Mutex       mLock;
         uint32_t mSleepTimeUs;
diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h
index 534afce..0df77c1 100644
--- a/include/media/mediametadataretriever.h
+++ b/include/media/mediametadataretriever.h
@@ -55,6 +55,7 @@
     METADATA_KEY_TIMED_TEXT_LANGUAGES      = 21,
     METADATA_KEY_IS_DRM          = 22,
     METADATA_KEY_LOCATION        = 23,
+    METADATA_KEY_VIDEO_ROTATION  = 24,
 
     // Add more here...
 };
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index 1fad383..f7cebc5 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -99,6 +99,8 @@
     // The player was started because it was used as the next player for another
     // player, which just completed playback
     MEDIA_INFO_STARTED_AS_NEXT = 2,
+    // The player just pushed the very first video frame for rendering
+    MEDIA_INFO_RENDERING_START = 3,
     // 7xx
     // The video is too complex for the decoder: it can't decode frames fast
     // enough. Possibly only the audio plays fine at this stage.
diff --git a/services/audioflinger/AudioBufferProviderSource.h b/include/media/nbaio/AudioBufferProviderSource.h
similarity index 90%
rename from services/audioflinger/AudioBufferProviderSource.h
rename to include/media/nbaio/AudioBufferProviderSource.h
index 2b39937..2c4aaff 100644
--- a/services/audioflinger/AudioBufferProviderSource.h
+++ b/include/media/nbaio/AudioBufferProviderSource.h
@@ -20,7 +20,7 @@
 #define ANDROID_AUDIO_BUFFER_PROVIDER_SOURCE_H
 
 #include "NBAIO.h"
-#include "AudioBufferProvider.h"
+#include <media/AudioBufferProvider.h>
 
 namespace android {
 
@@ -42,8 +42,9 @@
     //virtual size_t framesOverrun();
     //virtual size_t overruns();
     virtual ssize_t availableToRead();
-    virtual ssize_t read(void *buffer, size_t count);
-    virtual ssize_t readVia(readVia_t via, size_t total, void *user, size_t block);
+    virtual ssize_t read(void *buffer, size_t count, int64_t readPTS);
+    virtual ssize_t readVia(readVia_t via, size_t total, void *user,
+                            int64_t readPTS, size_t block);
 
 private:
     AudioBufferProvider * const mProvider;
diff --git a/services/audioflinger/AudioStreamInSource.h b/include/media/nbaio/AudioStreamInSource.h
similarity index 100%
rename from services/audioflinger/AudioStreamInSource.h
rename to include/media/nbaio/AudioStreamInSource.h
diff --git a/services/audioflinger/AudioStreamOutSink.h b/include/media/nbaio/AudioStreamOutSink.h
similarity index 88%
rename from services/audioflinger/AudioStreamOutSink.h
rename to include/media/nbaio/AudioStreamOutSink.h
index 1eff3f6..5976b18 100644
--- a/services/audioflinger/AudioStreamOutSink.h
+++ b/include/media/nbaio/AudioStreamOutSink.h
@@ -47,6 +47,11 @@
 
     virtual ssize_t write(const void *buffer, size_t count);
 
+    // AudioStreamOutSink wraps a HAL's output stream.  Its
+    // getNextWriteTimestamp method is simply a passthru to the HAL's underlying
+    // implementation of GNWT (if any)
+    virtual status_t getNextWriteTimestamp(int64_t *timestamp);
+
     // NBAIO_Sink end
 
 #if 0   // until necessary
diff --git a/services/audioflinger/LibsndfileSink.h b/include/media/nbaio/LibsndfileSink.h
similarity index 100%
rename from services/audioflinger/LibsndfileSink.h
rename to include/media/nbaio/LibsndfileSink.h
diff --git a/services/audioflinger/LibsndfileSource.h b/include/media/nbaio/LibsndfileSource.h
similarity index 100%
rename from services/audioflinger/LibsndfileSource.h
rename to include/media/nbaio/LibsndfileSource.h
diff --git a/include/media/nbaio/MonoPipe.h b/include/media/nbaio/MonoPipe.h
new file mode 100644
index 0000000..c47bf6c
--- /dev/null
+++ b/include/media/nbaio/MonoPipe.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_AUDIO_MONO_PIPE_H
+#define ANDROID_AUDIO_MONO_PIPE_H
+
+#include <time.h>
+#include <utils/LinearTransform.h>
+#include "NBAIO.h"
+
+namespace android {
+
+// MonoPipe is similar to Pipe except:
+//  - supports only a single reader, called MonoPipeReader
+//  - write() cannot overrun; instead it will return a short actual count if insufficient space
+//  - write() can optionally block if the pipe is full
+// Like Pipe, it is not multi-thread safe for either writer or reader
+// but writer and reader can be different threads.
+class MonoPipe : public NBAIO_Sink {
+
+    friend class MonoPipeReader;
+
+public:
+    // reqFrames will be rounded up to a power of 2, and all slots are available. Must be >= 2.
+    // Note: whatever shares this object with another thread needs to do so in an SMP-safe way (like
+    // creating it the object before creating the other thread, or storing the object with a
+    // release_store). Otherwise the other thread could see a partially-constructed object.
+    MonoPipe(size_t reqFrames, NBAIO_Format format, bool writeCanBlock = false);
+    virtual ~MonoPipe();
+
+    // NBAIO_Port interface
+
+    //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers,
+    //                          NBAIO_Format counterOffers[], size_t& numCounterOffers);
+    //virtual NBAIO_Format format() const;
+
+    // NBAIO_Sink interface
+
+    //virtual size_t framesWritten() const;
+    //virtual size_t framesUnderrun() const;
+    //virtual size_t underruns() const;
+
+    virtual ssize_t availableToWrite() const;
+    virtual ssize_t write(const void *buffer, size_t count);
+    //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block);
+
+    // MonoPipe's implementation of getNextWriteTimestamp works in conjunction
+    // with MonoPipeReader.  Every time a MonoPipeReader reads from the pipe, it
+    // receives a "readPTS" indicating the point in time for which the reader
+    // would like to read data.  This "last read PTS" is offset by the amt of
+    // data the reader is currently mixing and then cached cached along with the
+    // updated read pointer.  This cached value is the local time for which the
+    // reader is going to request data next time it reads data (assuming we are
+    // in steady state and operating with no underflows).  Writers to the
+    // MonoPipe who would like to know when their next write operation will hit
+    // the speakers can call getNextWriteTimestamp which will return the value
+    // of the last read PTS plus the duration of the amt of data waiting to be
+    // read in the MonoPipe.
+    virtual status_t getNextWriteTimestamp(int64_t *timestamp);
+
+            // average number of frames present in the pipe under normal conditions.
+            // See throttling mechanism in MonoPipe::write()
+            size_t  getAvgFrames() const { return mSetpoint; }
+            void    setAvgFrames(size_t setpoint);
+            size_t  maxFrames() const { return mMaxFrames; }
+
+private:
+    // A pair of methods and a helper variable which allows the reader and the
+    // writer to update and observe the values of mFront and mNextRdPTS in an
+    // atomic lock-less fashion.
+    //
+    // :: Important ::
+    // Two assumptions must be true in order for this lock-less approach to
+    // function properly on all systems.  First, there may only be one updater
+    // thread in the system.  Second, the updater thread must be running at a
+    // strictly higher priority than the observer threads.  Currently, both of
+    // these assumptions are true.  The only updater is always a single
+    // FastMixer thread (which runs with SCHED_FIFO/RT priority while the only
+    // observer is always an AudioFlinger::PlaybackThread running with
+    // traditional (non-RT) audio priority.
+    void updateFrontAndNRPTS(int32_t newFront, int64_t newNextRdPTS);
+    void observeFrontAndNRPTS(int32_t *outFront, int64_t *outNextRdPTS);
+    volatile int32_t mUpdateSeq;
+
+    const size_t    mReqFrames;     // as requested in constructor, unrounded
+    const size_t    mMaxFrames;     // always a power of 2
+    void * const    mBuffer;
+    // mFront and mRear will never be separated by more than mMaxFrames.
+    // 32-bit overflow is possible if the pipe is active for a long time, but if that happens it's
+    // safe because we "&" with (mMaxFrames-1) at end of computations to calculate a buffer index.
+    volatile int32_t mFront;        // written by the reader with updateFrontAndNRPTS, observed by
+                                    // the writer with observeFrontAndNRPTS
+    volatile int32_t mRear;         // written by writer with android_atomic_release_store,
+                                    // read by reader with android_atomic_acquire_load
+    volatile int64_t mNextRdPTS;    // written by the reader with updateFrontAndNRPTS, observed by
+                                    // the writer with observeFrontAndNRPTS
+    bool            mWriteTsValid;  // whether mWriteTs is valid
+    struct timespec mWriteTs;       // time that the previous write() completed
+    size_t          mSetpoint;      // target value for pipe fill depth
+    const bool      mWriteCanBlock; // whether write() should block if the pipe is full
+
+    int64_t offsetTimestampByAudioFrames(int64_t ts, size_t audFrames);
+    LinearTransform mSamplesToLocalTime;
+};
+
+}   // namespace android
+
+#endif  // ANDROID_AUDIO_MONO_PIPE_H
diff --git a/services/audioflinger/MonoPipeReader.h b/include/media/nbaio/MonoPipeReader.h
similarity index 95%
rename from services/audioflinger/MonoPipeReader.h
rename to include/media/nbaio/MonoPipeReader.h
index 9bb0a94..0e1c992 100644
--- a/services/audioflinger/MonoPipeReader.h
+++ b/include/media/nbaio/MonoPipeReader.h
@@ -47,7 +47,7 @@
 
     virtual ssize_t availableToRead();
 
-    virtual ssize_t read(void *buffer, size_t count);
+    virtual ssize_t read(void *buffer, size_t count, int64_t readPTS);
 
     // NBAIO_Source end
 
diff --git a/services/audioflinger/NBAIO.h b/include/media/nbaio/NBAIO.h
similarity index 89%
rename from services/audioflinger/NBAIO.h
rename to include/media/nbaio/NBAIO.h
index b5ae0f1..81f42ed 100644
--- a/services/audioflinger/NBAIO.h
+++ b/include/media/nbaio/NBAIO.h
@@ -26,6 +26,7 @@
 
 #include <limits.h>
 #include <stdlib.h>
+#include <utils/Errors.h>
 #include <utils/RefBase.h>
 
 namespace android {
@@ -74,7 +75,8 @@
 
 // Callbacks used by NBAIO_Sink::writeVia() and NBAIO_Source::readVia() below.
 typedef ssize_t (*writeVia_t)(void *user, void *buffer, size_t count);
-typedef ssize_t (*readVia_t)(void *user, const void *buffer, size_t count);
+typedef ssize_t (*readVia_t)(void *user, const void *buffer,
+                             size_t count, int64_t readPTS);
 
 // Abstract class (interface) representing a data port.
 class NBAIO_Port : public RefBase {
@@ -198,6 +200,21 @@
     //  < 0     status_t error occurred prior to the first frame transfer during this callback.
     virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block = 0);
 
+    // Get the time (on the LocalTime timeline) at which the first frame of audio of the next write
+    // operation to this sink will be eventually rendered by the HAL.
+    // Inputs:
+    //  ts      A pointer pointing to the int64_t which will hold the result.
+    // Return value:
+    //  OK      Everything went well, *ts holds the time at which the first audio frame of the next
+    //          write operation will be rendered, or AudioBufferProvider::kInvalidPTS if this sink
+    //          does not know the answer for some reason.  Sinks which eventually lead to a HAL
+    //          which implements get_next_write_timestamp may return Invalid temporarily if the DMA
+    //          output of the audio driver has not started yet.  Sinks which lead to a HAL which
+    //          does not implement get_next_write_timestamp, or which don't lead to a HAL at all,
+    //          will always return kInvalidPTS.
+    //  <other> Something unexpected happened internally.  Check the logs and start debugging.
+    virtual status_t getNextWriteTimestamp(int64_t *ts) { return INVALID_OPERATION; }
+
 protected:
     NBAIO_Sink(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesWritten(0) { }
     virtual ~NBAIO_Sink() { }
@@ -238,6 +255,8 @@
     // Inputs:
     //  buffer  Non-NULL destination buffer owned by consumer.
     //  count   Maximum number of frames to transfer.
+    //  readPTS The presentation time (on the LocalTime timeline) for which data
+    //          is being requested, or kInvalidPTS if not known.
     // Return value:
     //  > 0     Number of frames successfully transferred prior to first error.
     //  = 0     Count was zero.
@@ -247,7 +266,7 @@
     //  WOULD_BLOCK No frames can be transferred without blocking.
     //  OVERRUN     read() has not been called frequently enough, or with enough frames to keep up.
     //              One or more frames were lost due to overrun, try again to read more recent data.
-    virtual ssize_t read(void *buffer, size_t count) = 0;
+    virtual ssize_t read(void *buffer, size_t count, int64_t readPTS) = 0;
 
     // Transfer data from source using a series of callbacks.  More suitable for zero-fill,
     // synthesis, and non-contiguous transfers (e.g. circular buffer or readv).
@@ -256,6 +275,8 @@
     //  total   Estimate of the number of frames the consumer desires.  This is an estimate,
     //          and it can consume a different number of frames during the series of callbacks.
     //  user    Arbitrary void * reserved for data consumer.
+    //  readPTS The presentation time (on the LocalTime timeline) for which data
+    //          is being requested, or kInvalidPTS if not known.
     //  block   Number of frames per block, that is a suggested value for 'count' in each callback.
     //          Zero means no preference.  This parameter is a hint only, and may be ignored.
     // Return value:
@@ -278,7 +299,8 @@
     //  > 0     Number of frames successfully transferred during this callback prior to first error.
     //  = 0     Count was zero.
     //  < 0     status_t error occurred prior to the first frame transfer during this callback.
-    virtual ssize_t readVia(readVia_t via, size_t total, void *user, size_t block = 0);
+    virtual ssize_t readVia(readVia_t via, size_t total, void *user,
+                            int64_t readPTS, size_t block = 0);
 
 protected:
     NBAIO_Source(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesRead(0) { }
diff --git a/services/audioflinger/Pipe.h b/include/media/nbaio/Pipe.h
similarity index 100%
rename from services/audioflinger/Pipe.h
rename to include/media/nbaio/Pipe.h
diff --git a/services/audioflinger/PipeReader.h b/include/media/nbaio/PipeReader.h
similarity index 95%
rename from services/audioflinger/PipeReader.h
rename to include/media/nbaio/PipeReader.h
index 398353b..350e6ab 100644
--- a/services/audioflinger/PipeReader.h
+++ b/include/media/nbaio/PipeReader.h
@@ -45,7 +45,7 @@
 
     virtual ssize_t availableToRead();
 
-    virtual ssize_t read(void *buffer, size_t count);
+    virtual ssize_t read(void *buffer, size_t count, int64_t readPTS);
 
     // NBAIO_Source end
 
diff --git a/services/audioflinger/SourceAudioBufferProvider.h b/include/media/nbaio/SourceAudioBufferProvider.h
similarity index 97%
rename from services/audioflinger/SourceAudioBufferProvider.h
rename to include/media/nbaio/SourceAudioBufferProvider.h
index 85ccbb2..c08331b 100644
--- a/services/audioflinger/SourceAudioBufferProvider.h
+++ b/include/media/nbaio/SourceAudioBufferProvider.h
@@ -20,7 +20,7 @@
 #define ANDROID_SOURCE_AUDIO_BUFFER_PROVIDER_H
 
 #include "NBAIO.h"
-#include "ExtendedAudioBufferProvider.h"
+#include <media/ExtendedAudioBufferProvider.h>
 
 namespace android {
 
diff --git a/services/audioflinger/roundup.h b/include/media/nbaio/roundup.h
similarity index 100%
rename from services/audioflinger/roundup.h
rename to include/media/nbaio/roundup.h
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index 2371619..500dde6 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -25,6 +25,8 @@
 #include <media/stagefright/SkipCutBuffer.h>
 #include <OMX_Audio.h>
 
+#define TRACK_BUFFER_TIMING     0
+
 namespace android {
 
 struct ABuffer;
@@ -127,6 +129,15 @@
         sp<GraphicBuffer> mGraphicBuffer;
     };
 
+#if TRACK_BUFFER_TIMING
+    struct BufferStats {
+        int64_t mEmptyBufferTimeUs;
+        int64_t mFillBufferDoneTimeUs;
+    };
+
+    KeyedVector<int64_t, BufferStats> mBufferStats;
+#endif
+
     sp<AMessage> mNotify;
 
     sp<UninitializedState> mUninitializedState;
diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h
index f5466e8..de7edf3 100644
--- a/include/media/stagefright/AudioSource.h
+++ b/include/media/stagefright/AudioSource.h
@@ -31,11 +31,12 @@
 class AudioRecord;
 
 struct AudioSource : public MediaSource, public MediaBufferObserver {
-    // Note that the "channels" parameter is _not_ the number of channels,
-    // but a bitmask of audio_channels_t constants.
+    // Note that the "channels" parameter _is_ the number of channels,
+    // _not_ a bitmask of audio_channels_t constants.
     AudioSource(
-            audio_source_t inputSource, uint32_t sampleRate,
-            uint32_t channels = AUDIO_CHANNEL_IN_MONO);
+            audio_source_t inputSource,
+            uint32_t sampleRate,
+            uint32_t channels = 1);
 
     status_t initCheck() const;
 
@@ -49,9 +50,15 @@
     virtual status_t read(
             MediaBuffer **buffer, const ReadOptions *options = NULL);
 
-    status_t dataCallbackTimestamp(const AudioRecord::Buffer& buffer, int64_t timeUs);
+    status_t dataCallback(const AudioRecord::Buffer& buffer);
     virtual void signalBufferReturned(MediaBuffer *buffer);
 
+    // If useLooperTime == true, buffers will carry absolute timestamps
+    // as returned by ALooper::GetNowUs(), otherwise systemTime() is used
+    // and buffers contain timestamps relative to start time.
+    // The default is to _not_ use looper time.
+    void setUseLooperTime(bool useLooperTime);
+
 protected:
     virtual ~AudioSource();
 
@@ -87,6 +94,8 @@
 
     List<MediaBuffer * > mBuffersReceived;
 
+    bool mUseLooperTime;
+
     void trackMaxAmplitude(int16_t *data, int nSamples);
 
     // This is used to raise the volume from mute to the
diff --git a/include/media/stagefright/CameraSource.h b/include/media/stagefright/CameraSource.h
index 5a35358..6d6b8a9 100644
--- a/include/media/stagefright/CameraSource.h
+++ b/include/media/stagefright/CameraSource.h
@@ -137,6 +137,7 @@
 
     int32_t  mCameraFlags;
     Size     mVideoSize;
+    int32_t  mNumInputBuffers;
     int32_t  mVideoFrameRate;
     int32_t  mColorFormat;
     status_t mInitCheck;
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h
index 3c25a14..e91904c 100644
--- a/include/media/stagefright/MetaData.h
+++ b/include/media/stagefright/MetaData.h
@@ -111,6 +111,7 @@
     kKeyTrackTimeStatus   = 'tktm',  // int64_t
 
     kKeyNotRealTime       = 'ntrt',  // bool (int32_t)
+    kKeyNumBuffers        = 'nbbf',  // int32_t
 
     // Ogg files can be tagged to be automatically looping...
     kKeyAutoLoop          = 'autL',  // bool (int32_t)
diff --git a/include/media/stagefright/NuMediaExtractor.h b/include/media/stagefright/NuMediaExtractor.h
index c9c709c..0833110 100644
--- a/include/media/stagefright/NuMediaExtractor.h
+++ b/include/media/stagefright/NuMediaExtractor.h
@@ -50,6 +50,8 @@
 
     status_t setDataSource(int fd, off64_t offset, off64_t size);
 
+    status_t setDataSource(const sp<DataSource> &datasource);
+
     size_t countTracks() const;
     status_t getTrackFormat(size_t index, sp<AMessage> *format) const;
 
diff --git a/include/media/stagefright/OMXCodec.h b/include/media/stagefright/OMXCodec.h
index 81350ca..e6739ae 100644
--- a/include/media/stagefright/OMXCodec.h
+++ b/include/media/stagefright/OMXCodec.h
@@ -98,9 +98,13 @@
         kDecoderLiesAboutNumberOfChannels     = 256,
         kInputBufferSizesAreBogus             = 512,
         kSupportsMultipleFramesPerInputBuffer = 1024,
-        kAvoidMemcopyInputRecordingFrames     = 2048,
-        kRequiresLargerEncoderOutputBuffer    = 4096,
-        kOutputBuffersAreUnreadable           = 8192,
+        kRequiresLargerEncoderOutputBuffer    = 2048,
+        kOutputBuffersAreUnreadable           = 4096,
+    };
+
+    struct CodecNameAndQuirks {
+        String8 mName;
+        uint32_t mQuirks;
     };
 
     // for use by ACodec
@@ -108,8 +112,7 @@
             const char *mime,
             bool createEncoder, const char *matchComponentName,
             uint32_t flags,
-            Vector<String8> *matchingCodecs,
-            Vector<uint32_t> *matchingCodecQuirks = NULL);
+            Vector<CodecNameAndQuirks> *matchingCodecNamesAndQuirks);
 
     static uint32_t getComponentQuirks(
             const MediaCodecList *list, size_t index);
@@ -342,8 +345,6 @@
 
     status_t configureCodec(const sp<MetaData> &meta);
 
-    void restorePatchedDataPointer(BufferInfo *info);
-
     status_t applyRotation();
     status_t waitForBufferFilled_l();
 
@@ -353,6 +354,8 @@
             const void *data, size_t size,
             unsigned *profile, unsigned *level);
 
+    status_t stopOmxComponent_l();
+
     OMXCodec(const OMXCodec &);
     OMXCodec &operator=(const OMXCodec &);
 };
diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h
index 4a8e221..724c68d 100644
--- a/include/media/stagefright/SurfaceMediaSource.h
+++ b/include/media/stagefright/SurfaceMediaSource.h
@@ -73,10 +73,9 @@
 
     // For the MediaSource interface for use by StageFrightRecorder:
     virtual status_t start(MetaData *params = NULL);
-
-    virtual status_t stop() { return reset(); }
-    virtual status_t read(
-            MediaBuffer **buffer, const ReadOptions *options = NULL);
+    virtual status_t stop();
+    virtual status_t read(MediaBuffer **buffer,
+            const ReadOptions *options = NULL);
     virtual sp<MetaData> getFormat();
 
     // Get / Set the frame rate used for encoding. Default fps = 30
@@ -204,8 +203,6 @@
     // is a frame available for dequeuing
     Condition mFrameAvailableCondition;
 
-    status_t reset();
-
     // Avoid copying and equating and default constructor
     DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource);
 };
diff --git a/include/media/stagefright/foundation/hexdump.h b/include/media/stagefright/foundation/hexdump.h
index f6083a9..8360c5a 100644
--- a/include/media/stagefright/foundation/hexdump.h
+++ b/include/media/stagefright/foundation/hexdump.h
@@ -22,7 +22,11 @@
 
 namespace android {
 
-void hexdump(const void *_data, size_t size);
+struct AString;
+
+void hexdump(
+        const void *_data, size_t size,
+        size_t indent = 0, AString *appendTo = NULL);
 
 }  // namespace android
 
diff --git a/include/media/stagefright/timedtext/TimedTextDriver.h b/include/media/stagefright/timedtext/TimedTextDriver.h
index cde551b..f23c337 100644
--- a/include/media/stagefright/timedtext/TimedTextDriver.h
+++ b/include/media/stagefright/timedtext/TimedTextDriver.h
@@ -64,6 +64,7 @@
 
     enum State {
         UNINITIALIZED,
+        PREPARED,
         PLAYING,
         PAUSED,
     };
diff --git a/libvideoeditor/lvpp/Android.mk b/libvideoeditor/lvpp/Android.mk
index c018d74..0ed7e6c 100755
--- a/libvideoeditor/lvpp/Android.mk
+++ b/libvideoeditor/lvpp/Android.mk
@@ -59,6 +59,7 @@
     libstagefright            \
     libstagefright_foundation \
     libstagefright_omx        \
+    libsync                   \
     libui                     \
     libutils                  \
     libvideoeditor_osal       \
diff --git a/libvideoeditor/lvpp/NativeWindowRenderer.cpp b/libvideoeditor/lvpp/NativeWindowRenderer.cpp
index b2c2675..2e15ff9 100755
--- a/libvideoeditor/lvpp/NativeWindowRenderer.cpp
+++ b/libvideoeditor/lvpp/NativeWindowRenderer.cpp
@@ -22,9 +22,9 @@
 #include <cutils/log.h>
 #include <gui/SurfaceTexture.h>
 #include <gui/SurfaceTextureClient.h>
-#include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/MediaBuffer.h>
 #include <media/stagefright/MetaData.h>
+#include <media/stagefright/foundation/ADebug.h>
 #include "VideoEditorTools.h"
 
 #define CHECK_EGL_ERROR CHECK(EGL_SUCCESS == eglGetError())
@@ -382,7 +382,7 @@
     int64_t timeUs;
     CHECK(buffer->meta_data()->findInt64(kKeyTime, &timeUs));
     native_window_set_buffers_timestamp(anw, timeUs * 1000);
-    status_t err = anw->queueBuffer(anw, buffer->graphicBuffer().get());
+    status_t err = anw->queueBuffer(anw, buffer->graphicBuffer().get(), -1);
     if (err != 0) {
         ALOGE("queueBuffer failed with error %s (%d)", strerror(-err), -err);
         return;
@@ -399,18 +399,16 @@
     native_window_set_usage(anw, GRALLOC_USAGE_SW_WRITE_OFTEN);
 
     ANativeWindowBuffer* anb;
-    anw->dequeueBuffer(anw, &anb);
+    CHECK(NO_ERROR == native_window_dequeue_buffer_and_wait(anw, &anb));
     CHECK(anb != NULL);
 
-    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
-    CHECK(NO_ERROR == anw->lockBuffer(anw, buf->getNativeBuffer()));
-
     // Copy the buffer
     uint8_t* img = NULL;
+    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
     buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
     copyI420Buffer(buffer, img, width, height, buf->getStride());
     buf->unlock();
-    CHECK(NO_ERROR == anw->queueBuffer(anw, buf->getNativeBuffer()));
+    CHECK(NO_ERROR == anw->queueBuffer(anw, buf->getNativeBuffer(), -1));
 }
 
 void NativeWindowRenderer::copyI420Buffer(MediaBuffer* src, uint8_t* dst,
diff --git a/libvideoeditor/lvpp/PreviewRenderer.cpp b/libvideoeditor/lvpp/PreviewRenderer.cpp
index 4aa4eb3..b1cfc8e 100755
--- a/libvideoeditor/lvpp/PreviewRenderer.cpp
+++ b/libvideoeditor/lvpp/PreviewRenderer.cpp
@@ -97,13 +97,12 @@
 void PreviewRenderer::getBufferYV12(uint8_t **data, size_t *stride) {
     int err = OK;
 
-    if ((err = mSurface->ANativeWindow::dequeueBuffer(mSurface.get(), &mBuf)) != 0) {
-        ALOGW("Surface::dequeueBuffer returned error %d", err);
+    if ((err = native_window_dequeue_buffer_and_wait(mSurface.get(),
+            &mBuf)) != 0) {
+        ALOGW("native_window_dequeue_buffer_and_wait returned error %d", err);
         return;
     }
 
-    CHECK_EQ(0, mSurface->ANativeWindow::lockBuffer(mSurface.get(), mBuf));
-
     GraphicBufferMapper &mapper = GraphicBufferMapper::get();
 
     Rect bounds(mWidth, mHeight);
@@ -131,7 +130,7 @@
     if (mBuf!= NULL) {
         CHECK_EQ(0, mapper.unlock(mBuf->handle));
 
-        if ((err = mSurface->ANativeWindow::queueBuffer(mSurface.get(), mBuf)) != 0) {
+        if ((err = mSurface->ANativeWindow::queueBuffer(mSurface.get(), mBuf, -1)) != 0) {
             ALOGW("Surface::queueBuffer returned error %d", err);
         }
     }
diff --git a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
index 797686c..c111ba8 100755
--- a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
+++ b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
@@ -534,9 +534,7 @@
     } else {
         mAudioTrack = new AudioTrack(
                 AUDIO_STREAM_MUSIC, mSampleRate, AUDIO_FORMAT_PCM_16_BIT,
-                (numChannels == 2)
-                    ? AUDIO_CHANNEL_OUT_STEREO
-                    : AUDIO_CHANNEL_OUT_MONO,
+                audio_channel_out_mask_from_count(numChannels),
                 0, AUDIO_OUTPUT_FLAG_NONE, &AudioCallback, this, 0);
 
         if ((err = mAudioTrack->initCheck()) != OK) {
diff --git a/libvideoeditor/lvpp/VideoEditorSRC.h b/libvideoeditor/lvpp/VideoEditorSRC.h
index 2b7e9b6..1707d4d 100755
--- a/libvideoeditor/lvpp/VideoEditorSRC.h
+++ b/libvideoeditor/lvpp/VideoEditorSRC.h
@@ -17,7 +17,7 @@
 
 #include <stdint.h>
 #include <media/stagefright/MediaSource.h>
-#include "AudioBufferProvider.h"
+#include <media/AudioBufferProvider.h>
 #include "AudioResampler.h"
 
 namespace android {
diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
index 5026073..f735c0b 100755
--- a/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
+++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
@@ -1483,11 +1483,15 @@
                     (int32_t*)&(pVideoStreamHandler->m_videoHeight));
 
                 (*pStreamHandler)  = (M4_StreamHandler*)(pVideoStreamHandler);
-                meta->findInt64(kKeyDuration,
-                    (int64_t*)&(Duration));
-                ((*pStreamHandler)->m_duration) =
-                    (int32_t)((Duration)/1000); // conversion to mS
+                meta->findInt64(kKeyDuration, (int64_t*)&(Duration));
+                ((*pStreamHandler)->m_duration) = (int32_t)((Duration)/1000); // conversion to mS
                 pC->mMaxDuration = ((*pStreamHandler)->m_duration);
+                if (pC->mMaxDuration == 0) {
+                    ALOGE("Video is too short: %lld Us", Duration);
+                    delete pVideoStreamHandler;
+                    pVideoStreamHandler = NULL;
+                    return M4ERR_PARAMETER;
+                }
                 ALOGV("VideoEditor3gpReader_getNextStreamHandler m_duration %d",
                     (*pStreamHandler)->m_duration);
 
diff --git a/media/libaah_rtp/Android.mk b/media/libaah_rtp/Android.mk
deleted file mode 100644
index df533ec..0000000
--- a/media/libaah_rtp/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-#
-# libaah_rtp
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libaah_rtp
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
-    aah_decoder_pump.cpp \
-    aah_rx_player.cpp \
-    aah_rx_player_core.cpp \
-    aah_rx_player_ring_buffer.cpp \
-    aah_rx_player_substream.cpp \
-    aah_tx_packet.cpp \
-    aah_tx_player.cpp \
-    aah_tx_sender.cpp \
-    pipe_event.cpp
-
-LOCAL_C_INCLUDES := \
-    frameworks/av/include \
-    frameworks/av/media \
-    frameworks/av/media/libstagefright \
-    frameworks/native/include/media/openmax
-
-LOCAL_SHARED_LIBRARIES := \
-    libcommon_time_client \
-    libbinder \
-    libmedia \
-    libmedia_native \
-    libstagefright \
-    libstagefright_foundation \
-    libutils
-
-LOCAL_LDLIBS := \
-    -lpthread
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libaah_rtp/MODULE_LICENSE_APACHE2 b/media/libaah_rtp/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/media/libaah_rtp/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/media/libaah_rtp/NOTICE b/media/libaah_rtp/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/media/libaah_rtp/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, The Android Open Source Project
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/media/libaah_rtp/aah_decoder_pump.cpp b/media/libaah_rtp/aah_decoder_pump.cpp
deleted file mode 100644
index bebba54..0000000
--- a/media/libaah_rtp/aah_decoder_pump.cpp
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-//#define LOG_NDEBUG 0
-#include <utils/Log.h>
-
-#include <poll.h>
-#include <pthread.h>
-
-#include <common_time/cc_helper.h>
-#include <media/AudioSystem.h>
-#include <media/AudioTrack.h>
-#include <media/stagefright/foundation/ADebug.h>
-#include <media/stagefright/MetaData.h>
-#include <media/stagefright/OMXClient.h>
-#include <media/stagefright/OMXCodec.h>
-#include <media/stagefright/Utils.h>
-#include <utils/Timers.h>
-#include <utils/threads.h>
-
-#include "aah_decoder_pump.h"
-
-namespace android {
-
-static const long long kLongDecodeErrorThreshold = 1000000ll;
-static const uint32_t kMaxLongErrorsBeforeFatal = 3;
-static const uint32_t kMaxErrorsBeforeFatal = 60;
-
-AAH_DecoderPump::AAH_DecoderPump(OMXClient& omx)
-    : omx_(omx)
-    , thread_status_(OK)
-    , renderer_(NULL)
-    , last_queued_pts_valid_(false)
-    , last_queued_pts_(0)
-    , last_ts_transform_valid_(false)
-    , last_volume_(0xFF) {
-    thread_ = new ThreadWrapper(this);
-}
-
-AAH_DecoderPump::~AAH_DecoderPump() {
-    shutdown();
-}
-
-status_t AAH_DecoderPump::initCheck() {
-    if (thread_ == NULL) {
-        ALOGE("Failed to allocate thread");
-        return NO_MEMORY;
-    }
-
-    return OK;
-}
-
-status_t AAH_DecoderPump::queueForDecode(MediaBuffer* buf) {
-    if (NULL == buf) {
-        return BAD_VALUE;
-    }
-
-    if (OK != thread_status_) {
-        return thread_status_;
-    }
-
-    {   // Explicit scope for AutoMutex pattern.
-        AutoMutex lock(&thread_lock_);
-        in_queue_.push_back(buf);
-    }
-
-    thread_cond_.signal();
-
-    return OK;
-}
-
-void AAH_DecoderPump::queueToRenderer(MediaBuffer* decoded_sample) {
-    Mutex::Autolock lock(&render_lock_);
-    sp<MetaData> meta;
-    int64_t ts;
-    status_t res;
-
-    // Fetch the metadata and make sure the sample has a timestamp.  We
-    // cannot render samples which are missing PTSs.
-    meta = decoded_sample->meta_data();
-    if ((meta == NULL) || (!meta->findInt64(kKeyTime, &ts))) {
-        ALOGV("Decoded sample missing timestamp, cannot render.");
-        CHECK(false);
-    } else {
-        // If we currently are not holding on to a renderer, go ahead and
-        // make one now.
-        if (NULL == renderer_) {
-            renderer_ = new TimedAudioTrack();
-            if (NULL != renderer_) {
-                int frameCount;
-                AudioTrack::getMinFrameCount(&frameCount,
-                        AUDIO_STREAM_DEFAULT,
-                        static_cast<int>(format_sample_rate_));
-                audio_channel_mask_t ch_format =
-                        audio_channel_out_mask_from_count(format_channels_);
-
-                res = renderer_->set(AUDIO_STREAM_DEFAULT,
-                        format_sample_rate_,
-                        AUDIO_FORMAT_PCM_16_BIT,
-                        ch_format,
-                        frameCount);
-                if (res != OK) {
-                    ALOGE("Failed to setup audio renderer. (res = %d)", res);
-                    delete renderer_;
-                    renderer_ = NULL;
-                } else {
-                    CHECK(last_ts_transform_valid_);
-
-                    res = renderer_->setMediaTimeTransform(
-                            last_ts_transform_, TimedAudioTrack::COMMON_TIME);
-                    if (res != NO_ERROR) {
-                        ALOGE("Failed to set media time transform on AudioTrack"
-                              " (res = %d)", res);
-                        delete renderer_;
-                        renderer_ = NULL;
-                    } else {
-                        float volume = static_cast<float>(last_volume_)
-                                     / 255.0f;
-                        if (renderer_->setVolume(volume, volume) != OK) {
-                            ALOGW("%s: setVolume failed", __FUNCTION__);
-                        }
-
-                        renderer_->start();
-                    }
-                }
-            } else {
-                ALOGE("Failed to allocate AudioTrack to use as a renderer.");
-            }
-        }
-
-        if (NULL != renderer_) {
-            uint8_t* decoded_data =
-                reinterpret_cast<uint8_t*>(decoded_sample->data());
-            uint32_t decoded_amt  = decoded_sample->range_length();
-            decoded_data += decoded_sample->range_offset();
-
-            sp<IMemory> pcm_payload;
-            res = renderer_->allocateTimedBuffer(decoded_amt, &pcm_payload);
-            if (res != OK) {
-                ALOGE("Failed to allocate %d byte audio track buffer."
-                      " (res = %d)", decoded_amt, res);
-            } else {
-                memcpy(pcm_payload->pointer(), decoded_data, decoded_amt);
-
-                res = renderer_->queueTimedBuffer(pcm_payload, ts);
-                if (res != OK) {
-                    ALOGE("Failed to queue %d byte audio track buffer with"
-                          " media PTS %lld. (res = %d)", decoded_amt, ts, res);
-                } else {
-                    last_queued_pts_valid_ = true;
-                    last_queued_pts_ = ts;
-                }
-            }
-
-        } else {
-            ALOGE("No renderer, dropping audio payload.");
-        }
-    }
-}
-
-void AAH_DecoderPump::stopAndCleanupRenderer() {
-    if (NULL == renderer_) {
-        return;
-    }
-
-    renderer_->stop();
-    delete renderer_;
-    renderer_ = NULL;
-}
-
-void AAH_DecoderPump::setRenderTSTransform(const LinearTransform& trans) {
-    Mutex::Autolock lock(&render_lock_);
-
-    if (last_ts_transform_valid_ && !memcmp(&trans,
-                                            &last_ts_transform_,
-                                            sizeof(trans))) {
-        return;
-    }
-
-    last_ts_transform_       = trans;
-    last_ts_transform_valid_ = true;
-
-    if (NULL != renderer_) {
-        status_t res = renderer_->setMediaTimeTransform(
-                last_ts_transform_, TimedAudioTrack::COMMON_TIME);
-        if (res != NO_ERROR) {
-            ALOGE("Failed to set media time transform on AudioTrack"
-                  " (res = %d)", res);
-        }
-    }
-}
-
-void AAH_DecoderPump::setRenderVolume(uint8_t volume) {
-    Mutex::Autolock lock(&render_lock_);
-
-    if (volume == last_volume_) {
-        return;
-    }
-
-    last_volume_ = volume;
-    if (renderer_ != NULL) {
-        float volume = static_cast<float>(last_volume_) / 255.0f;
-        if (renderer_->setVolume(volume, volume) != OK) {
-            ALOGW("%s: setVolume failed", __FUNCTION__);
-        }
-    }
-}
-
-// isAboutToUnderflow is something of a hack used to figure out when it might be
-// time to give up on trying to fill in a gap in the RTP sequence and simply
-// move on with a discontinuity.  If we had perfect knowledge of when we were
-// going to underflow, it would not be a hack, but unfortunately we do not.
-// Right now, we just take the PTS of the last sample queued, and check to see
-// if its presentation time is within kAboutToUnderflowThreshold from now.  If
-// it is, then we say that we are about to underflow.  This decision is based on
-// two (possibly invalid) assumptions.
-//
-// 1) The transmitter is leading the clock by more than
-//    kAboutToUnderflowThreshold.
-// 2) The delta between the PTS of the last sample queued and the next sample
-//    is less than the transmitter's clock lead amount.
-//
-// Right now, the default transmitter lead time is 1 second, which is a pretty
-// large number and greater than the 50mSec that kAboutToUnderflowThreshold is
-// currently set to.  This should satisfy assumption #1 for now, but changes to
-// the transmitter clock lead time could effect this.
-//
-// For non-sparse streams with a homogeneous sample rate (the vast majority of
-// streams in the world), the delta between any two adjacent PTSs will always be
-// the homogeneous sample period.  It is very uncommon to see a sample period
-// greater than the 1 second clock lead we are currently using, and you
-// certainly will not see it in an MP3 file which should satisfy assumption #2.
-// Sparse audio streams (where no audio is transmitted for long periods of
-// silence) and extremely low framerate video stream (like an MPEG-2 slideshow
-// or the video stream for a pay TV audio channel) are examples of streams which
-// might violate assumption #2.
-bool AAH_DecoderPump::isAboutToUnderflow(int64_t threshold) {
-    Mutex::Autolock lock(&render_lock_);
-
-    // If we have never queued anything to the decoder, we really don't know if
-    // we are going to underflow or not.
-    if (!last_queued_pts_valid_ || !last_ts_transform_valid_) {
-        return false;
-    }
-
-    // Don't have access to Common Time?  If so, then things are Very Bad
-    // elsewhere in the system; it pretty much does not matter what we do here.
-    // Since we cannot really tell if we are about to underflow or not, its
-    // probably best to assume that we are not and proceed accordingly.
-    int64_t tt_now;
-    if (OK != cc_helper_.getCommonTime(&tt_now)) {
-        return false;
-    }
-
-    // Transform from media time to common time.
-    int64_t last_queued_pts_tt;
-    if (!last_ts_transform_.doForwardTransform(last_queued_pts_,
-                &last_queued_pts_tt)) {
-        return false;
-    }
-
-    // Check to see if we are underflowing.
-    return ((tt_now + threshold - last_queued_pts_tt) > 0);
-}
-
-void* AAH_DecoderPump::workThread() {
-    // No need to lock when accessing decoder_ from the thread.  The
-    // implementation of init and shutdown ensure that other threads never touch
-    // decoder_ while the work thread is running.
-    CHECK(decoder_ != NULL);
-    CHECK(format_  != NULL);
-
-    // Start the decoder and note its result code.  If something goes horribly
-    // wrong, callers of queueForDecode and getOutput will be able to detect
-    // that the thread encountered a fatal error and shut down by examining
-    // thread_status_.
-    thread_status_ = decoder_->start(format_.get());
-    if (OK != thread_status_) {
-        ALOGE("AAH_DecoderPump's work thread failed to start decoder"
-              " (res = %d)", thread_status_);
-        return NULL;
-    }
-
-    DurationTimer decode_timer;
-    uint32_t consecutive_long_errors = 0;
-    uint32_t consecutive_errors = 0;
-
-    while (!thread_->exitPending()) {
-        status_t res;
-        MediaBuffer* bufOut = NULL;
-
-        decode_timer.start();
-        res = decoder_->read(&bufOut);
-        decode_timer.stop();
-
-        if (res == INFO_FORMAT_CHANGED) {
-            // Format has changed.  Destroy our current renderer so that a new
-            // one can be created during queueToRenderer with the proper format.
-            //
-            // TODO : In order to transition seamlessly, we should change this
-            // to put the old renderer in a queue to play out completely before
-            // we destroy it.  We can still create a new renderer, the timed
-            // nature of the renderer should ensure a seamless splice.
-            stopAndCleanupRenderer();
-            res = OK;
-        }
-
-        // Try to be a little nuanced in our handling of actual decode errors.
-        // Errors could happen because of minor stream corruption or because of
-        // transient resource limitations.  In these cases, we would rather drop
-        // a little bit of output and ride out the unpleasantness then throw up
-        // our hands and abort everything.
-        //
-        // OTOH - When things are really bad (like we have a non-transient
-        // resource or bookkeeping issue, or the stream being fed to us is just
-        // complete and total garbage) we really want to terminate playback and
-        // raise an error condition all the way up to the application level so
-        // they can deal with it.
-        //
-        // Unfortunately, the error codes returned by the decoder can be a
-        // little non-specific.  For example, if an OMXCodec times out
-        // attempting to obtain an output buffer, the error we get back is a
-        // generic -1.  Try to distinguish between this resource timeout error
-        // and ES corruption error by timing how long the decode operation
-        // takes.  Maintain accounting for both errors and "long errors".  If we
-        // get more than a certain number consecutive errors of either type,
-        // consider it fatal and shutdown (which will cause the error to
-        // propagate all of the way up to the application level).  The threshold
-        // for "long errors" is deliberately much lower than that of normal
-        // decode errors, both because of how long they take to happen and
-        // because they generally indicate resource limitation errors which are
-        // unlikely to go away in pathologically bad cases (in contrast to
-        // stream corruption errors which might happen 20 times in a row and
-        // then be suddenly OK again)
-        if (res != OK) {
-            consecutive_errors++;
-            if (decode_timer.durationUsecs() >= kLongDecodeErrorThreshold)
-                consecutive_long_errors++;
-
-            CHECK(NULL == bufOut);
-
-            ALOGW("%s: Failed to decode data (res = %d)",
-                    __PRETTY_FUNCTION__, res);
-
-            if ((consecutive_errors      >= kMaxErrorsBeforeFatal) ||
-                (consecutive_long_errors >= kMaxLongErrorsBeforeFatal)) {
-                ALOGE("%s: Maximum decode error threshold has been reached."
-                      " There have been %d consecutive decode errors, and %d"
-                      " consecutive decode operations which resulted in errors"
-                      " and took more than %lld uSec to process.  The last"
-                      " decode operation took %lld uSec.",
-                      __PRETTY_FUNCTION__,
-                      consecutive_errors, consecutive_long_errors,
-                      kLongDecodeErrorThreshold, decode_timer.durationUsecs());
-                thread_status_ = res;
-                break;
-            }
-
-            continue;
-        }
-
-        if (NULL == bufOut) {
-            ALOGW("%s: Successful decode, but no buffer produced",
-                    __PRETTY_FUNCTION__);
-            continue;
-        }
-
-        // Successful decode (with actual output produced).  Clear the error
-        // counters.
-        consecutive_errors = 0;
-        consecutive_long_errors = 0;
-
-        queueToRenderer(bufOut);
-        bufOut->release();
-    }
-
-    decoder_->stop();
-    stopAndCleanupRenderer();
-
-    return NULL;
-}
-
-status_t AAH_DecoderPump::init(const sp<MetaData>& params) {
-    Mutex::Autolock lock(&init_lock_);
-
-    if (decoder_ != NULL) {
-        // already inited
-        return OK;
-    }
-
-    if (params == NULL) {
-        return BAD_VALUE;
-    }
-
-    if (!params->findInt32(kKeyChannelCount, &format_channels_)) {
-        return BAD_VALUE;
-    }
-
-    if (!params->findInt32(kKeySampleRate, &format_sample_rate_)) {
-        return BAD_VALUE;
-    }
-
-    CHECK(OK == thread_status_);
-    CHECK(decoder_ == NULL);
-
-    status_t ret_val = UNKNOWN_ERROR;
-
-    // Cache the format and attempt to create the decoder.
-    format_  = params;
-    decoder_ = OMXCodec::Create(
-            omx_.interface(),       // IOMX Handle
-            format_,                // Metadata for substream (indicates codec)
-            false,                  // Make a decoder, not an encoder
-            sp<MediaSource>(this)); // We will be the source for this codec.
-
-    if (decoder_ == NULL) {
-      ALOGE("Failed to allocate decoder in %s", __PRETTY_FUNCTION__);
-      goto bailout;
-    }
-
-    // Fire up the pump thread.  It will take care of starting and stopping the
-    // decoder.
-    ret_val = thread_->run("aah_decode_pump", ANDROID_PRIORITY_AUDIO);
-    if (OK != ret_val) {
-        ALOGE("Failed to start work thread in %s (res = %d)",
-                __PRETTY_FUNCTION__, ret_val);
-        goto bailout;
-    }
-
-bailout:
-    if (OK != ret_val) {
-        decoder_ = NULL;
-        format_  = NULL;
-    }
-
-    return OK;
-}
-
-status_t AAH_DecoderPump::shutdown() {
-    Mutex::Autolock lock(&init_lock_);
-    return shutdown_l();
-}
-
-status_t AAH_DecoderPump::shutdown_l() {
-    thread_->requestExit();
-    thread_cond_.signal();
-    thread_->requestExitAndWait();
-
-    for (MBQueue::iterator iter = in_queue_.begin();
-         iter != in_queue_.end();
-         ++iter) {
-        (*iter)->release();
-    }
-    in_queue_.clear();
-
-    last_queued_pts_valid_   = false;
-    last_ts_transform_valid_ = false;
-    last_volume_             = 0xFF;
-    thread_status_           = OK;
-
-    decoder_ = NULL;
-    format_  = NULL;
-
-    return OK;
-}
-
-status_t AAH_DecoderPump::read(MediaBuffer **buffer,
-                               const ReadOptions *options) {
-    if (!buffer) {
-        return BAD_VALUE;
-    }
-
-    *buffer = NULL;
-
-    // While its not time to shut down, and we have no data to process, wait.
-    AutoMutex lock(&thread_lock_);
-    while (!thread_->exitPending() && in_queue_.empty())
-        thread_cond_.wait(thread_lock_);
-
-    // At this point, if its not time to shutdown then we must have something to
-    // process.  Go ahead and pop the front of the queue for processing.
-    if (!thread_->exitPending()) {
-        CHECK(!in_queue_.empty());
-
-        *buffer = *(in_queue_.begin());
-        in_queue_.erase(in_queue_.begin());
-    }
-
-    // If we managed to get a buffer, then everything must be OK.  If not, then
-    // we must be shutting down.
-    return (NULL == *buffer) ? INVALID_OPERATION : OK;
-}
-
-AAH_DecoderPump::ThreadWrapper::ThreadWrapper(AAH_DecoderPump* owner)
-    : Thread(false /* canCallJava*/ )
-    , owner_(owner) {
-}
-
-bool AAH_DecoderPump::ThreadWrapper::threadLoop() {
-    CHECK(NULL != owner_);
-    owner_->workThread();
-    return false;
-}
-
-}  // namespace android
diff --git a/media/libaah_rtp/aah_decoder_pump.h b/media/libaah_rtp/aah_decoder_pump.h
deleted file mode 100644
index 4d57e49..0000000
--- a/media/libaah_rtp/aah_decoder_pump.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __DECODER_PUMP_H__
-#define __DECODER_PUMP_H__
-
-#include <pthread.h>
-
-#include <common_time/cc_helper.h>
-#include <media/stagefright/MediaSource.h>
-#include <utils/LinearTransform.h>
-#include <utils/List.h>
-#include <utils/threads.h>
-
-namespace android {
-
-class MetaData;
-class OMXClient;
-class TimedAudioTrack;
-
-class AAH_DecoderPump : public MediaSource {
-  public:
-    explicit AAH_DecoderPump(OMXClient& omx);
-    status_t initCheck();
-
-    status_t queueForDecode(MediaBuffer* buf);
-
-    status_t init(const sp<MetaData>& params);
-    status_t shutdown();
-
-    void setRenderTSTransform(const LinearTransform& trans);
-    void setRenderVolume(uint8_t volume);
-    bool isAboutToUnderflow(int64_t threshold);
-    bool getStatus() const { return thread_status_; }
-
-    // MediaSource methods
-    virtual status_t     start(MetaData *params) { return OK; }
-    virtual sp<MetaData> getFormat() { return format_; }
-    virtual status_t     stop() { return OK; }
-    virtual status_t     read(MediaBuffer **buffer,
-                              const ReadOptions *options);
-
-  protected:
-    virtual ~AAH_DecoderPump();
-
-  private:
-    class ThreadWrapper : public Thread {
-      public:
-        friend class AAH_DecoderPump;
-        explicit ThreadWrapper(AAH_DecoderPump* owner);
-
-      private:
-        virtual bool threadLoop();
-        AAH_DecoderPump* owner_;
-
-        DISALLOW_EVIL_CONSTRUCTORS(ThreadWrapper);
-    };
-
-    void* workThread();
-    virtual status_t shutdown_l();
-    void queueToRenderer(MediaBuffer* decoded_sample);
-    void stopAndCleanupRenderer();
-
-    sp<MetaData>        format_;
-    int32_t             format_channels_;   // channel count, not channel mask
-    int32_t             format_sample_rate_;
-
-    sp<MediaSource>     decoder_;
-    OMXClient&          omx_;
-    Mutex               init_lock_;
-
-    sp<ThreadWrapper>   thread_;
-    Condition           thread_cond_;
-    Mutex               thread_lock_;
-    status_t            thread_status_;
-
-    Mutex               render_lock_;
-    TimedAudioTrack*    renderer_;
-    bool                last_queued_pts_valid_;
-    int64_t             last_queued_pts_;
-    bool                last_ts_transform_valid_;
-    LinearTransform     last_ts_transform_;
-    uint8_t             last_volume_;
-    CCHelper            cc_helper_;
-
-    // protected by the thread_lock_
-    typedef List<MediaBuffer*> MBQueue;
-    MBQueue in_queue_;
-
-    DISALLOW_EVIL_CONSTRUCTORS(AAH_DecoderPump);
-};
-
-}  // namespace android
-#endif  // __DECODER_PUMP_H__
diff --git a/media/libaah_rtp/aah_rx_player.cpp b/media/libaah_rtp/aah_rx_player.cpp
deleted file mode 100644
index 9dd79fd..0000000
--- a/media/libaah_rtp/aah_rx_player.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-//#define LOG_NDEBUG 0
-
-#include <binder/IServiceManager.h>
-#include <media/MediaPlayerInterface.h>
-#include <utils/Log.h>
-
-#include "aah_rx_player.h"
-
-namespace android {
-
-const uint32_t AAH_RXPlayer::kRTPRingBufferSize = 1 << 10;
-
-sp<MediaPlayerBase> createAAH_RXPlayer() {
-    sp<MediaPlayerBase> ret = new AAH_RXPlayer();
-    return ret;
-}
-
-AAH_RXPlayer::AAH_RXPlayer()
-        : ring_buffer_(kRTPRingBufferSize)
-        , substreams_(NULL) {
-    thread_wrapper_ = new ThreadWrapper(*this);
-
-    is_playing_          = false;
-    multicast_joined_    = false;
-    transmitter_known_   = false;
-    current_epoch_known_ = false;
-    data_source_set_     = false;
-    sock_fd_             = -1;
-
-    substreams_.setCapacity(4);
-
-    memset(&listen_addr_,      0, sizeof(listen_addr_));
-    memset(&transmitter_addr_, 0, sizeof(transmitter_addr_));
-
-    fetchAudioFlinger();
-}
-
-AAH_RXPlayer::~AAH_RXPlayer() {
-    reset_l();
-    CHECK(substreams_.size() == 0);
-    omx_.disconnect();
-}
-
-status_t AAH_RXPlayer::initCheck() {
-    if (thread_wrapper_ == NULL) {
-        ALOGE("Failed to allocate thread wrapper!");
-        return NO_MEMORY;
-    }
-
-    if (!ring_buffer_.initCheck()) {
-        ALOGE("Failed to allocate reassembly ring buffer!");
-        return NO_MEMORY;
-    }
-
-    // Check for the presense of the common time service by attempting to query
-    // for CommonTime's frequency.  If we get an error back, we cannot talk to
-    // the service at all and should abort now.
-    status_t res;
-    uint64_t freq;
-    res = cc_helper_.getCommonFreq(&freq);
-    if (OK != res) {
-        ALOGE("Failed to connect to common time service!");
-        return res;
-    }
-
-    return omx_.connect();
-}
-
-status_t AAH_RXPlayer::setDataSource(
-        const char *url,
-        const KeyedVector<String8, String8> *headers) {
-    AutoMutex api_lock(&api_lock_);
-    uint32_t a, b, c, d;
-    uint16_t port;
-
-    if (data_source_set_) {
-        return INVALID_OPERATION;
-    }
-
-    if (NULL == url) {
-        return BAD_VALUE;
-    }
-
-    if (5 != sscanf(url, "%*[^:/]://%u.%u.%u.%u:%hu", &a, &b, &c, &d, &port)) {
-        ALOGE("Failed to parse URL \"%s\"", url);
-        return BAD_VALUE;
-    }
-
-    if ((a > 255) || (b > 255) || (c > 255) || (d > 255) || (port == 0)) {
-        ALOGE("Bad multicast address \"%s\"", url);
-        return BAD_VALUE;
-    }
-
-    ALOGI("setDataSource :: %u.%u.%u.%u:%hu", a, b, c, d, port);
-
-    a = (a << 24) | (b << 16) | (c <<  8) | d;
-
-    memset(&listen_addr_, 0, sizeof(listen_addr_));
-    listen_addr_.sin_family      = AF_INET;
-    listen_addr_.sin_port        = htons(port);
-    listen_addr_.sin_addr.s_addr = htonl(a);
-    data_source_set_ = true;
-
-    return OK;
-}
-
-status_t AAH_RXPlayer::setDataSource(int fd, int64_t offset, int64_t length) {
-    return INVALID_OPERATION;
-}
-
-status_t AAH_RXPlayer::setVideoSurface(const sp<Surface>& surface) {
-    return OK;
-}
-
-status_t AAH_RXPlayer::setVideoSurfaceTexture(
-        const sp<ISurfaceTexture>& surfaceTexture) {
-    return OK;
-}
-
-status_t AAH_RXPlayer::prepare() {
-    return OK;
-}
-
-status_t AAH_RXPlayer::prepareAsync() {
-    sendEvent(MEDIA_PREPARED);
-    return OK;
-}
-
-status_t AAH_RXPlayer::start() {
-    AutoMutex api_lock(&api_lock_);
-
-    if (is_playing_) {
-        return OK;
-    }
-
-    status_t res = startWorkThread();
-    is_playing_ = (res == OK);
-    return res;
-}
-
-status_t AAH_RXPlayer::stop() {
-    return pause();
-}
-
-status_t AAH_RXPlayer::pause() {
-    AutoMutex api_lock(&api_lock_);
-    stopWorkThread();
-    CHECK(sock_fd_ < 0);
-    is_playing_ = false;
-    return OK;
-}
-
-bool AAH_RXPlayer::isPlaying() {
-    AutoMutex api_lock(&api_lock_);
-    return is_playing_;
-}
-
-status_t AAH_RXPlayer::seekTo(int msec) {
-    sendEvent(MEDIA_SEEK_COMPLETE);
-    return OK;
-}
-
-status_t AAH_RXPlayer::getCurrentPosition(int *msec) {
-    if (NULL != msec) {
-        *msec = 0;
-    }
-    return OK;
-}
-
-status_t AAH_RXPlayer::getDuration(int *msec) {
-    if (NULL != msec) {
-        *msec = 1;
-    }
-    return OK;
-}
-
-status_t AAH_RXPlayer::reset() {
-    AutoMutex api_lock(&api_lock_);
-    reset_l();
-    return OK;
-}
-
-void AAH_RXPlayer::reset_l() {
-    stopWorkThread();
-    CHECK(sock_fd_ < 0);
-    CHECK(!multicast_joined_);
-    is_playing_ = false;
-    data_source_set_ = false;
-    transmitter_known_ = false;
-    memset(&listen_addr_, 0, sizeof(listen_addr_));
-}
-
-status_t AAH_RXPlayer::setLooping(int loop) {
-    return OK;
-}
-
-player_type AAH_RXPlayer::playerType() {
-    return AAH_RX_PLAYER;
-}
-
-status_t AAH_RXPlayer::setParameter(int key, const Parcel &request) {
-    return ERROR_UNSUPPORTED;
-}
-
-status_t AAH_RXPlayer::getParameter(int key, Parcel *reply) {
-    return ERROR_UNSUPPORTED;
-}
-
-status_t AAH_RXPlayer::invoke(const Parcel& request, Parcel *reply) {
-    if (!reply) {
-        return BAD_VALUE;
-    }
-
-    int32_t magic;
-    status_t err = request.readInt32(&magic);
-    if (err != OK) {
-        reply->writeInt32(err);
-        return OK;
-    }
-
-    if (magic != 0x12345) {
-        reply->writeInt32(BAD_VALUE);
-        return OK;
-    }
-
-    int32_t methodID;
-    err = request.readInt32(&methodID);
-    if (err != OK) {
-        reply->writeInt32(err);
-        return OK;
-    }
-
-    switch (methodID) {
-        // Get Volume
-        case INVOKE_GET_MASTER_VOLUME: {
-            if (audio_flinger_ != NULL) {
-                reply->writeInt32(OK);
-                reply->writeFloat(audio_flinger_->masterVolume());
-            } else {
-                reply->writeInt32(UNKNOWN_ERROR);
-            }
-        } break;
-
-        // Set Volume
-        case INVOKE_SET_MASTER_VOLUME: {
-            float targetVol = request.readFloat();
-            reply->writeInt32(audio_flinger_->setMasterVolume(targetVol));
-        } break;
-
-        default: return BAD_VALUE;
-    }
-
-    return OK;
-}
-
-void AAH_RXPlayer::fetchAudioFlinger() {
-    if (audio_flinger_ == NULL) {
-        sp<IServiceManager> sm = defaultServiceManager();
-        sp<IBinder> binder;
-        binder = sm->getService(String16("media.audio_flinger"));
-
-        if (binder == NULL) {
-            ALOGW("AAH_RXPlayer failed to fetch handle to audio flinger."
-                  " Master volume control will not be possible.");
-        }
-
-        audio_flinger_ = interface_cast<IAudioFlinger>(binder);
-    }
-}
-
-}  // namespace android
diff --git a/media/libaah_rtp/aah_rx_player.h b/media/libaah_rtp/aah_rx_player.h
deleted file mode 100644
index ba5617e..0000000
--- a/media/libaah_rtp/aah_rx_player.h
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __AAH_RX_PLAYER_H__
-#define __AAH_RX_PLAYER_H__
-
-#include <common_time/cc_helper.h>
-#include <media/MediaPlayerInterface.h>
-#include <media/stagefright/foundation/ADebug.h>
-#include <media/stagefright/MediaBuffer.h>
-#include <media/stagefright/MediaSource.h>
-#include <media/stagefright/MetaData.h>
-#include <media/stagefright/OMXClient.h>
-#include <netinet/in.h>
-#include <utils/KeyedVector.h>
-#include <utils/LinearTransform.h>
-#include <utils/threads.h>
-
-#include "aah_decoder_pump.h"
-#include "pipe_event.h"
-
-namespace android {
-
-class AAH_RXPlayer : public MediaPlayerInterface {
-  public:
-    AAH_RXPlayer();
-
-    virtual status_t    initCheck();
-    virtual status_t    setDataSource(const char *url,
-                                      const KeyedVector<String8, String8>*
-                                      headers);
-    virtual status_t    setDataSource(int fd, int64_t offset, int64_t length);
-    virtual status_t    setVideoSurface(const sp<Surface>& surface);
-    virtual status_t    setVideoSurfaceTexture(const sp<ISurfaceTexture>&
-                                               surfaceTexture);
-    virtual status_t    prepare();
-    virtual status_t    prepareAsync();
-    virtual status_t    start();
-    virtual status_t    stop();
-    virtual status_t    pause();
-    virtual bool        isPlaying();
-    virtual status_t    seekTo(int msec);
-    virtual status_t    getCurrentPosition(int *msec);
-    virtual status_t    getDuration(int *msec);
-    virtual status_t    reset();
-    virtual status_t    setLooping(int loop);
-    virtual player_type playerType();
-    virtual status_t    setParameter(int key, const Parcel &request);
-    virtual status_t    getParameter(int key, Parcel *reply);
-    virtual status_t    invoke(const Parcel& request, Parcel *reply);
-
-  protected:
-    virtual ~AAH_RXPlayer();
-
-  private:
-    class ThreadWrapper : public Thread {
-      public:
-        friend class AAH_RXPlayer;
-        explicit ThreadWrapper(AAH_RXPlayer& player)
-            : Thread(false /* canCallJava */ )
-            , player_(player) { }
-
-        virtual bool threadLoop() { return player_.threadLoop(); }
-
-      private:
-        AAH_RXPlayer& player_;
-
-        DISALLOW_EVIL_CONSTRUCTORS(ThreadWrapper);
-    };
-
-#pragma pack(push, 1)
-    // PacketBuffers are structures used by the RX ring buffer.  The ring buffer
-    // is a ring of pointers to PacketBuffer structures which act as variable
-    // length byte arrays and hold the contents of received UDP packets.  Rather
-    // than make this a structure which hold a length and a pointer to another
-    // allocated structure (which would require two allocations), this struct
-    // uses a structure overlay pattern where allocation for the byte array
-    // consists of allocating (arrayLen + sizeof(ssize_t)) bytes of data from
-    // whatever pool/heap the packet buffer pulls from, and then overlaying the
-    // packed PacketBuffer structure on top of the allocation.  The one-byte
-    // array at the end of the structure serves as an offset to the the data
-    // portion of the allocation; packet buffers are never allocated on the
-    // stack or using the new operator.  Instead, the static allocate-byte-array
-    // and destroy methods handle the allocate and overlay pattern.  They also
-    // allow for a potential future optimization where instead of just
-    // allocating blocks from the process global heap and overlaying, the
-    // allocator is replaced with a different implementation (private heap,
-    // free-list, circular buffer, etc) which reduces potential heap
-    // fragmentation issues which might arise from the frequent allocation and
-    // destruction of the received UDP traffic.
-    struct PacketBuffer {
-        ssize_t length_;
-        uint8_t data_[1];
-
-        // TODO : consider changing this to be some form of ring buffer or free
-        // pool system instead of just using the heap in order to avoid heap
-        // fragmentation.
-        static PacketBuffer* allocate(ssize_t length);
-        static void destroy(PacketBuffer* pb);
-
-      private:
-        // Force people to use allocate/destroy instead of new/delete.
-        PacketBuffer() { }
-        ~PacketBuffer() { }
-    };
-
-    struct RetransRequest {
-        uint32_t magic_;
-        uint32_t mcast_ip_;
-        uint16_t mcast_port_;
-        uint16_t start_seq_;
-        uint16_t end_seq_;
-    };
-#pragma pack(pop)
-
-    enum GapStatus {
-        kGS_NoGap = 0,
-        kGS_NormalGap,
-        kGS_FastStartGap,
-    };
-
-    struct SeqNoGap {
-        uint16_t start_seq_;
-        uint16_t end_seq_;
-    };
-
-    class RXRingBuffer {
-      public:
-        explicit RXRingBuffer(uint32_t capacity);
-        ~RXRingBuffer();
-
-        bool initCheck() const { return (ring_ != NULL); }
-        void reset();
-
-        // Push a packet buffer with a given sequence number into the ring
-        // buffer.  pushBuffer will always consume the buffer pushed to it,
-        // either destroying it because it was a duplicate or overflow, or
-        // holding on to it in the ring.  Callers should not hold any references
-        // to PacketBuffers after they have been pushed to the ring.  Returns
-        // false in the case of a serious error (such as ring overflow).
-        // Callers should consider resetting the pipeline entirely in the event
-        // of a serious error.
-        bool pushBuffer(PacketBuffer* buf, uint16_t seq);
-
-        // Fetch the next buffer in the RTP sequence.  Returns NULL if there is
-        // no buffer to fetch.  If a non-NULL PacketBuffer is returned,
-        // is_discon will be set to indicate whether or not this PacketBuffer is
-        // discontiuous with any previously returned packet buffers.  Packet
-        // buffers returned by fetchBuffer are the caller's responsibility; they
-        // must be certain to destroy the buffers when they are done.
-        PacketBuffer* fetchBuffer(bool* is_discon);
-
-        // Returns true and fills out the gap structure if the read pointer of
-        // the ring buffer is currently pointing to a gap which would stall a
-        // fetchBuffer operation.  Returns false if the read pointer is not
-        // pointing to a gap in the sequence currently.
-        GapStatus fetchCurrentGap(SeqNoGap* gap);
-
-        // Causes the read pointer to skip over any portion of a gap indicated
-        // by nak.  If nak is NULL, any gap currently blocking the read pointer
-        // will be completely skipped.  If any portion of a gap is skipped, the
-        // next successful read from fetch buffer will indicate a discontinuity.
-        void processNAK(const SeqNoGap* nak = NULL);
-
-        // Compute the number of milliseconds until the inactivity timer for
-        // this RTP stream.  Returns -1 if there is no active timeout, or 0 if
-        // the system has already timed out.
-        int computeInactivityTimeout();
-
-      private:
-        Mutex          lock_;
-        PacketBuffer** ring_;
-        uint32_t       capacity_;
-        uint32_t       rd_;
-        uint32_t       wr_;
-
-        uint16_t       rd_seq_;
-        bool           rd_seq_known_;
-        bool           waiting_for_fast_start_;
-        bool           fetched_first_packet_;
-
-        uint64_t       rtp_activity_timeout_;
-        bool           rtp_activity_timeout_valid_;
-
-        DISALLOW_EVIL_CONSTRUCTORS(RXRingBuffer);
-    };
-
-    class Substream : public virtual RefBase {
-      public:
-        Substream(uint32_t ssrc, OMXClient& omx);
-
-        void cleanupBufferInProgress();
-        void shutdown();
-        void processPayloadStart(uint8_t* buf,
-                                 uint32_t amt,
-                                 int32_t ts_lower);
-        void processPayloadCont (uint8_t* buf,
-                                 uint32_t amt);
-        void processTSTransform(const LinearTransform& trans);
-
-        bool     isAboutToUnderflow();
-        uint32_t getSSRC()      const { return ssrc_; }
-        uint16_t getProgramID() const { return (ssrc_ >> 5) & 0x1F; }
-        status_t getStatus() const { return status_; }
-
-      protected:
-        virtual ~Substream();
-
-      private:
-        void                cleanupDecoder();
-        bool                shouldAbort(const char* log_tag);
-        void                processCompletedBuffer();
-        bool                setupSubstreamMeta();
-        bool                setupMP3SubstreamMeta();
-        bool                setupAACSubstreamMeta();
-        bool                setupSubstreamType(uint8_t substream_type,
-                                               uint8_t codec_type);
-
-        uint32_t            ssrc_;
-        bool                waiting_for_rap_;
-        status_t            status_;
-
-        bool                substream_details_known_;
-        uint8_t             substream_type_;
-        uint8_t             codec_type_;
-        const char*         codec_mime_type_;
-        sp<MetaData>        substream_meta_;
-
-        MediaBuffer*        buffer_in_progress_;
-        uint32_t            expected_buffer_size_;
-        uint32_t            buffer_filled_;
-
-        Vector<uint8_t>     aux_data_in_progress_;
-        uint32_t            aux_data_expected_size_;
-
-        sp<AAH_DecoderPump> decoder_;
-
-        static int64_t      kAboutToUnderflowThreshold;
-
-        DISALLOW_EVIL_CONSTRUCTORS(Substream);
-    };
-
-    typedef DefaultKeyedVector< uint32_t, sp<Substream> > SubstreamVec;
-
-    status_t            startWorkThread();
-    void                stopWorkThread();
-    virtual bool        threadLoop();
-    bool                setupSocket();
-    void                cleanupSocket();
-    void                resetPipeline();
-    void                reset_l();
-    bool                processRX(PacketBuffer* pb);
-    void                processRingBuffer();
-    void                processCommandPacket(PacketBuffer* pb);
-    bool                processGaps();
-    int                 computeNextGapRetransmitTimeout();
-    void                fetchAudioFlinger();
-
-    PipeEvent           wakeup_work_thread_evt_;
-    sp<ThreadWrapper>   thread_wrapper_;
-    Mutex               api_lock_;
-    bool                is_playing_;
-    bool                data_source_set_;
-
-    struct sockaddr_in  listen_addr_;
-    int                 sock_fd_;
-    bool                multicast_joined_;
-
-    struct sockaddr_in  transmitter_addr_;
-    bool                transmitter_known_;
-
-    uint32_t            current_epoch_;
-    bool                current_epoch_known_;
-
-    SeqNoGap            current_gap_;
-    GapStatus           current_gap_status_;
-    uint64_t            next_retrans_req_time_;
-
-    RXRingBuffer        ring_buffer_;
-    SubstreamVec        substreams_;
-    OMXClient           omx_;
-    CCHelper            cc_helper_;
-
-    // Connection to audio flinger used to hack a path to setMasterVolume.
-    sp<IAudioFlinger>   audio_flinger_;
-
-    static const uint32_t kRTPRingBufferSize;
-    static const uint32_t kRetransRequestMagic;
-    static const uint32_t kFastStartRequestMagic;
-    static const uint32_t kRetransNAKMagic;
-    static const uint32_t kGapRerequestTimeoutUSec;
-    static const uint32_t kFastStartTimeoutUSec;
-    static const uint32_t kRTPActivityTimeoutUSec;
-
-    static const uint32_t INVOKE_GET_MASTER_VOLUME = 3;
-    static const uint32_t INVOKE_SET_MASTER_VOLUME = 4;
-
-    static uint64_t monotonicUSecNow();
-
-    DISALLOW_EVIL_CONSTRUCTORS(AAH_RXPlayer);
-};
-
-}  // namespace android
-
-#endif  // __AAH_RX_PLAYER_H__
diff --git a/media/libaah_rtp/aah_rx_player_core.cpp b/media/libaah_rtp/aah_rx_player_core.cpp
deleted file mode 100644
index d6b31fd..0000000
--- a/media/libaah_rtp/aah_rx_player_core.cpp
+++ /dev/null
@@ -1,809 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-//#define LOG_NDEBUG 0
-#include <utils/Log.h>
-
-#include <fcntl.h>
-#include <poll.h>
-#include <sys/socket.h>
-#include <time.h>
-#include <utils/misc.h>
-
-#include <media/stagefright/Utils.h>
-
-#include "aah_rx_player.h"
-#include "aah_tx_packet.h"
-
-namespace android {
-
-const uint32_t AAH_RXPlayer::kRetransRequestMagic =
-    FOURCC('T','r','e','q');
-const uint32_t AAH_RXPlayer::kRetransNAKMagic =
-    FOURCC('T','n','a','k');
-const uint32_t AAH_RXPlayer::kFastStartRequestMagic =
-    FOURCC('T','f','s','t');
-const uint32_t AAH_RXPlayer::kGapRerequestTimeoutUSec = 75000;
-const uint32_t AAH_RXPlayer::kFastStartTimeoutUSec = 800000;
-const uint32_t AAH_RXPlayer::kRTPActivityTimeoutUSec = 10000000;
-
-static inline int16_t fetchInt16(uint8_t* data) {
-    return static_cast<int16_t>(U16_AT(data));
-}
-
-static inline int32_t fetchInt32(uint8_t* data) {
-    return static_cast<int32_t>(U32_AT(data));
-}
-
-static inline int64_t fetchInt64(uint8_t* data) {
-    return static_cast<int64_t>(U64_AT(data));
-}
-
-uint64_t AAH_RXPlayer::monotonicUSecNow() {
-    struct timespec now;
-    int res = clock_gettime(CLOCK_MONOTONIC, &now);
-    CHECK(res >= 0);
-
-    uint64_t ret = static_cast<uint64_t>(now.tv_sec) * 1000000;
-    ret += now.tv_nsec / 1000;
-
-    return ret;
-}
-
-status_t AAH_RXPlayer::startWorkThread() {
-    status_t res;
-    stopWorkThread();
-    res = thread_wrapper_->run("TRX_Player", PRIORITY_AUDIO);
-
-    if (res != OK) {
-        ALOGE("Failed to start work thread (res = %d)", res);
-    }
-
-    return res;
-}
-
-void AAH_RXPlayer::stopWorkThread() {
-    thread_wrapper_->requestExit();  // set the exit pending flag
-    wakeup_work_thread_evt_.setEvent();
-
-    status_t res;
-    res = thread_wrapper_->requestExitAndWait(); // block until thread exit.
-    if (res != OK) {
-        ALOGE("Failed to stop work thread (res = %d)", res);
-    }
-
-    wakeup_work_thread_evt_.clearPendingEvents();
-}
-
-void AAH_RXPlayer::cleanupSocket() {
-    if (sock_fd_ >= 0) {
-        if (multicast_joined_) {
-            int res;
-            struct ip_mreq mreq;
-            mreq.imr_multiaddr = listen_addr_.sin_addr;
-            mreq.imr_interface.s_addr = htonl(INADDR_ANY);
-            res = setsockopt(sock_fd_,
-                             IPPROTO_IP,
-                             IP_DROP_MEMBERSHIP,
-                             &mreq, sizeof(mreq));
-            if (res < 0) {
-                ALOGW("Failed to leave multicast group. (%d, %d)", res, errno);
-            }
-            multicast_joined_ = false;
-        }
-
-        close(sock_fd_);
-        sock_fd_ = -1;
-    }
-
-    resetPipeline();
-}
-
-void AAH_RXPlayer::resetPipeline() {
-    ring_buffer_.reset();
-
-    // Explicitly shudown all of the active substreams, then call clear out the
-    // collection.  Failure to clear out a substream can result in its decoder
-    // holding a reference to itself and therefor not going away when the
-    // collection is cleared.
-    for (size_t i = 0; i < substreams_.size(); ++i)
-        substreams_.valueAt(i)->shutdown();
-
-    substreams_.clear();
-
-    current_gap_status_ = kGS_NoGap;
-}
-
-bool AAH_RXPlayer::setupSocket() {
-    long flags;
-    int  res, buf_size;
-    socklen_t opt_size;
-
-    cleanupSocket();
-    CHECK(sock_fd_ < 0);
-
-    // Make the socket
-    sock_fd_ = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
-    if (sock_fd_ < 0) {
-        ALOGE("Failed to create listen socket (errno %d)", errno);
-        goto bailout;
-    }
-
-    // Set non-blocking operation
-    flags = fcntl(sock_fd_, F_GETFL);
-    res   = fcntl(sock_fd_, F_SETFL, flags | O_NONBLOCK);
-    if (res < 0) {
-        ALOGE("Failed to set socket (%d) to non-blocking mode (errno %d)",
-              sock_fd_, errno);
-        goto bailout;
-    }
-
-    // Bind to our port
-    struct sockaddr_in bind_addr;
-    memset(&bind_addr, 0, sizeof(bind_addr));
-    bind_addr.sin_family = AF_INET;
-    bind_addr.sin_addr.s_addr = INADDR_ANY;
-    bind_addr.sin_port = listen_addr_.sin_port;
-    res = bind(sock_fd_,
-               reinterpret_cast<const sockaddr*>(&bind_addr),
-               sizeof(bind_addr));
-    if (res < 0) {
-        uint32_t a = ntohl(bind_addr.sin_addr.s_addr);
-        uint16_t p = ntohs(bind_addr.sin_port);
-        ALOGE("Failed to bind socket (%d) to %d.%d.%d.%d:%hd. (errno %d)",
-              sock_fd_,
-              (a >> 24) & 0xFF,
-              (a >> 16) & 0xFF,
-              (a >>  8) & 0xFF,
-              (a      ) & 0xFF,
-              p,
-              errno);
-
-        goto bailout;
-    }
-
-    buf_size = 1 << 16;   // 64k
-    res = setsockopt(sock_fd_,
-                     SOL_SOCKET, SO_RCVBUF,
-                     &buf_size, sizeof(buf_size));
-    if (res < 0) {
-        ALOGW("Failed to increase socket buffer size to %d.  (errno %d)",
-              buf_size, errno);
-    }
-
-    buf_size = 0;
-    opt_size = sizeof(buf_size);
-    res = getsockopt(sock_fd_,
-                     SOL_SOCKET, SO_RCVBUF,
-                     &buf_size, &opt_size);
-    if (res < 0) {
-        ALOGW("Failed to fetch socket buffer size.  (errno %d)", errno);
-    } else {
-        ALOGI("RX socket buffer size is now %d bytes",  buf_size);
-    }
-
-    if (listen_addr_.sin_addr.s_addr) {
-        // Join the multicast group and we should be good to go.
-        struct ip_mreq mreq;
-        mreq.imr_multiaddr = listen_addr_.sin_addr;
-        mreq.imr_interface.s_addr = htonl(INADDR_ANY);
-        res = setsockopt(sock_fd_,
-                         IPPROTO_IP,
-                         IP_ADD_MEMBERSHIP,
-                         &mreq, sizeof(mreq));
-        if (res < 0) {
-            ALOGE("Failed to join multicast group. (errno %d)", errno);
-            goto bailout;
-        }
-        multicast_joined_ = true;
-    }
-
-    return true;
-
-bailout:
-    cleanupSocket();
-    return false;
-}
-
-bool AAH_RXPlayer::threadLoop() {
-    struct pollfd poll_fds[2];
-    bool process_more_right_now = false;
-
-    if (!setupSocket()) {
-        sendEvent(MEDIA_ERROR);
-        goto bailout;
-    }
-
-    while (!thread_wrapper_->exitPending()) {
-        // Step 1: Wait until there is something to do.
-        int gap_timeout = computeNextGapRetransmitTimeout();
-        int ring_timeout = ring_buffer_.computeInactivityTimeout();
-        int timeout = -1;
-
-        if (!ring_timeout) {
-            ALOGW("RTP inactivity timeout reached, resetting pipeline.");
-            resetPipeline();
-            timeout = gap_timeout;
-        } else {
-            if (gap_timeout < 0) {
-                timeout = ring_timeout;
-            } else if (ring_timeout < 0) {
-                timeout = gap_timeout;
-            } else {
-                timeout = (gap_timeout < ring_timeout) ? gap_timeout
-                                                       : ring_timeout;
-            }
-        }
-
-        if ((0 != timeout) && (!process_more_right_now)) {
-            // Set up the events to wait on.  Start with the wakeup pipe.
-            memset(&poll_fds, 0, sizeof(poll_fds));
-            poll_fds[0].fd     = wakeup_work_thread_evt_.getWakeupHandle();
-            poll_fds[0].events = POLLIN;
-
-            // Add the RX socket.
-            poll_fds[1].fd     = sock_fd_;
-            poll_fds[1].events = POLLIN;
-
-            // Wait for something interesing to happen.
-            int poll_res = poll(poll_fds, NELEM(poll_fds), timeout);
-            if (poll_res < 0) {
-                ALOGE("Fatal error (%d,%d) while waiting on events",
-                      poll_res, errno);
-                sendEvent(MEDIA_ERROR);
-                goto bailout;
-            }
-        }
-
-        if (thread_wrapper_->exitPending()) {
-            break;
-        }
-
-        wakeup_work_thread_evt_.clearPendingEvents();
-        process_more_right_now = false;
-
-        // Step 2: Do we have data waiting in the socket?  If so, drain the
-        // socket moving valid RTP information into the ring buffer to be
-        // processed.
-        if (poll_fds[1].revents) {
-            struct sockaddr_in from;
-            socklen_t from_len;
-
-            ssize_t res = 0;
-            while (!thread_wrapper_->exitPending()) {
-                // Check the size of any pending packet.
-                res = recv(sock_fd_, NULL, 0, MSG_PEEK | MSG_TRUNC);
-
-                // Error?
-                if (res < 0) {
-                    // If the error is anything other than would block,
-                    // something has gone very wrong.
-                    if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) {
-                        ALOGE("Fatal socket error during recvfrom (%d, %d)",
-                              (int)res, errno);
-                        goto bailout;
-                    }
-
-                    // Socket is out of data, just break out of processing and
-                    // wait for more.
-                    break;
-                }
-
-                // Allocate a payload.
-                PacketBuffer* pb = PacketBuffer::allocate(res);
-                if (NULL == pb) {
-                    ALOGE("Fatal error, failed to allocate packet buffer of"
-                          " length %u", static_cast<uint32_t>(res));
-                    goto bailout;
-                }
-
-                // Fetch the data.
-                from_len = sizeof(from);
-                res = recvfrom(sock_fd_, pb->data_, pb->length_, 0,
-                               reinterpret_cast<struct sockaddr*>(&from),
-                               &from_len);
-                if (res != pb->length_) {
-                    ALOGE("Fatal error, fetched packet length (%d) does not"
-                          " match peeked packet length (%u).  This should never"
-                          " happen.  (errno = %d)",
-                          static_cast<int>(res),
-                          static_cast<uint32_t>(pb->length_),
-                          errno);
-                }
-
-                bool drop_packet = false;
-                if (transmitter_known_) {
-                    if (from.sin_addr.s_addr !=
-                        transmitter_addr_.sin_addr.s_addr) {
-                        uint32_t a = ntohl(from.sin_addr.s_addr);
-                        uint16_t p = ntohs(from.sin_port);
-                        ALOGV("Dropping packet from unknown transmitter"
-                              " %u.%u.%u.%u:%hu",
-                              ((a >> 24) & 0xFF),
-                              ((a >> 16) & 0xFF),
-                              ((a >>  8) & 0xFF),
-                              ( a        & 0xFF),
-                              p);
-
-                        drop_packet = true;
-                    } else {
-                        transmitter_addr_.sin_port = from.sin_port;
-                    }
-                } else {
-                    memcpy(&transmitter_addr_, &from, sizeof(from));
-                    transmitter_known_ = true;
-                }
-
-                if (!drop_packet) {
-                    bool serious_error = !processRX(pb);
-
-                    if (serious_error) {
-                        // Something went "seriously wrong".  Currently, the
-                        // only trigger for this should be a ring buffer
-                        // overflow.  The current failsafe behavior for when
-                        // something goes seriously wrong is to just reset the
-                        // pipeline.  The system should behave as if this
-                        // AAH_RXPlayer was just set up for the first time.
-                        ALOGE("Something just went seriously wrong with the"
-                              " pipeline.  Resetting.");
-                        resetPipeline();
-                    }
-                } else {
-                    PacketBuffer::destroy(pb);
-                }
-            }
-        }
-
-        // Step 3: Process any data we mave have accumulated in the ring buffer
-        // so far.
-        if (!thread_wrapper_->exitPending()) {
-            processRingBuffer();
-        }
-
-        // Step 4: At this point in time, the ring buffer should either be
-        // empty, or stalled in front of a gap caused by some dropped packets.
-        // Check on the current gap situation and deal with it in an appropriate
-        // fashion.  If processGaps returns true, it means that it has given up
-        // on a gap and that we should try to process some more data
-        // immediately.
-        if (!thread_wrapper_->exitPending()) {
-            process_more_right_now = processGaps();
-        }
-
-        // Step 5: Check for fatal errors.  If any of our substreams has
-        // encountered a fatal, unrecoverable, error, then propagate the error
-        // up to user level and shut down.
-        for (size_t i = 0; i < substreams_.size(); ++i) {
-            status_t status;
-            CHECK(substreams_.valueAt(i) != NULL);
-
-            status = substreams_.valueAt(i)->getStatus();
-            if (OK != status) {
-                ALOGE("Substream index %d has encountered an unrecoverable"
-                      " error (%d).  Signalling application level and shutting"
-                      " down.", i, status);
-                sendEvent(MEDIA_ERROR);
-                goto bailout;
-            }
-        }
-    }
-
-bailout:
-    cleanupSocket();
-    return false;
-}
-
-bool AAH_RXPlayer::processRX(PacketBuffer* pb) {
-    CHECK(NULL != pb);
-
-    uint8_t* data = pb->data_;
-    ssize_t  amt  = pb->length_;
-    uint32_t nak_magic;
-    uint16_t seq_no;
-    uint32_t epoch;
-
-    // Every packet either starts with an RTP header which is at least 12 bytes
-    // long or is a retry NAK which is 14 bytes long.  If there are fewer than
-    // 12 bytes here, this cannot be a proper RTP packet.
-    if (amt < 12) {
-        ALOGV("Dropping packet, too short to contain RTP header (%u bytes)",
-              static_cast<uint32_t>(amt));
-        goto drop_packet;
-    }
-
-    // Check to see if this is the special case of a NAK packet.
-    nak_magic = ntohl(*(reinterpret_cast<uint32_t*>(data)));
-    if (nak_magic == kRetransNAKMagic) {
-        // Looks like a NAK packet; make sure its long enough.
-
-        if (amt < static_cast<ssize_t>(sizeof(RetransRequest))) {
-            ALOGV("Dropping packet, too short to contain NAK payload"
-                  " (%u bytes)", static_cast<uint32_t>(amt));
-            goto drop_packet;
-        }
-
-        SeqNoGap gap;
-        RetransRequest* rtr = reinterpret_cast<RetransRequest*>(data);
-        gap.start_seq_ = ntohs(rtr->start_seq_);
-        gap.end_seq_   = ntohs(rtr->end_seq_);
-
-        ALOGV("Process NAK for gap at [%hu, %hu]",
-                gap.start_seq_, gap.end_seq_);
-        ring_buffer_.processNAK(&gap);
-
-        return true;
-    }
-
-    // According to the TRTP spec, version should be 2, padding should be 0,
-    // extension should be 0 and CSRCCnt should be 0.  If any of these tests
-    // fail, we chuck the packet.
-    if (data[0] != 0x80) {
-        ALOGV("Dropping packet, bad V/P/X/CSRCCnt field (0x%02x)",
-              data[0]);
-        goto drop_packet;
-    }
-
-    // Check the payload type.  For TRTP, it should always be 100.
-    if ((data[1] & 0x7F) != 100) {
-        ALOGV("Dropping packet, bad payload type. (%u)",
-              data[1] & 0x7F);
-        goto drop_packet;
-    }
-
-    // Check whether the transmitter has begun a new epoch.
-    epoch = (U32_AT(data + 8) >> 10) & 0x3FFFFF;
-    if (current_epoch_known_) {
-        if (epoch != current_epoch_) {
-            ALOGV("%s: new epoch %u", __PRETTY_FUNCTION__, epoch);
-            current_epoch_ = epoch;
-            resetPipeline();
-        }
-    } else {
-        current_epoch_ = epoch;
-        current_epoch_known_ = true;
-    }
-
-    // Extract the sequence number and hand the packet off to the ring buffer
-    // for dropped packet detection and later processing.
-    seq_no = U16_AT(data + 2);
-    return ring_buffer_.pushBuffer(pb, seq_no);
-
-drop_packet:
-    PacketBuffer::destroy(pb);
-    return true;
-}
-
-void AAH_RXPlayer::processRingBuffer() {
-    PacketBuffer* pb;
-    bool is_discon;
-    sp<Substream> substream;
-    LinearTransform trans;
-    bool foundTrans = false;
-
-    while (NULL != (pb = ring_buffer_.fetchBuffer(&is_discon))) {
-        if (is_discon) {
-            // Abort all partially assembled payloads.
-            for (size_t i = 0; i < substreams_.size(); ++i) {
-                CHECK(substreams_.valueAt(i) != NULL);
-                substreams_.valueAt(i)->cleanupBufferInProgress();
-            }
-        }
-
-        uint8_t* data = pb->data_;
-        ssize_t  amt  = pb->length_;
-
-        // Should not have any non-RTP packets in the ring buffer.  RTP packets
-        // must be at least 12 bytes long.
-        CHECK(amt >= 12);
-
-        // Extract the marker bit and the SSRC field.
-        bool     marker = (data[1] & 0x80) != 0;
-        uint32_t ssrc   = U32_AT(data + 8);
-
-        // Is this the start of a new TRTP payload?  If so, the marker bit
-        // should be set and there are some things we should be checking for.
-        if (marker) {
-            // TRTP headers need to have at least a byte for version, a byte for
-            // payload type and flags, and 4 bytes for length.
-            if (amt < 18) {
-                ALOGV("Dropping packet, too short to contain TRTP header"
-                      " (%u bytes)", static_cast<uint32_t>(amt));
-                goto process_next_packet;
-            }
-
-            // Check the TRTP version and extract the payload type/flags.
-            uint8_t trtp_version =  data[12];
-            uint8_t payload_type = (data[13] >> 4) & 0xF;
-            uint8_t trtp_flags   =  data[13]       & 0xF;
-
-            if (1 != trtp_version) {
-                ALOGV("Dropping packet, bad trtp version %hhu", trtp_version);
-                goto process_next_packet;
-            }
-
-            // Is there a timestamp transformation present on this packet?  If
-            // so, extract it and pass it to the appropriate substreams.
-            if (trtp_flags & 0x02) {
-                ssize_t offset = 18 + ((trtp_flags & 0x01) ? 4 : 0);
-                if (amt < (offset + 24)) {
-                    ALOGV("Dropping packet, too short to contain TRTP Timestamp"
-                          " Transformation (%u bytes)",
-                          static_cast<uint32_t>(amt));
-                    goto process_next_packet;
-                }
-
-                trans.a_zero = fetchInt64(data + offset);
-                trans.b_zero = fetchInt64(data + offset + 16);
-                trans.a_to_b_numer = static_cast<int32_t>(
-                        fetchInt32 (data + offset + 8));
-                trans.a_to_b_denom = U32_AT(data + offset + 12);
-                foundTrans = true;
-
-                uint32_t program_id = (ssrc >> 5) & 0x1F;
-                for (size_t i = 0; i < substreams_.size(); ++i) {
-                    sp<Substream> iter = substreams_.valueAt(i);
-                    CHECK(iter != NULL);
-
-                    if (iter->getProgramID() == program_id) {
-                        iter->processTSTransform(trans);
-                    }
-                }
-            }
-
-            // Is this a command packet?  If so, its not necessarily associate
-            // with one particular substream.  Just give it to the command
-            // packet handler and then move on.
-            if (4 == payload_type) {
-                processCommandPacket(pb);
-                goto process_next_packet;
-            }
-        }
-
-        // If we got to here, then we are a normal packet.  Find (or allocate)
-        // the substream we belong to and send the packet off to be processed.
-        substream = substreams_.valueFor(ssrc);
-        if (substream == NULL) {
-            substream = new Substream(ssrc, omx_);
-            if (substream == NULL) {
-                ALOGE("Failed to allocate substream for SSRC 0x%08x", ssrc);
-                goto process_next_packet;
-            }
-            substreams_.add(ssrc, substream);
-
-            if (foundTrans) {
-                substream->processTSTransform(trans);
-            }
-        }
-
-        CHECK(substream != NULL);
-
-        if (marker) {
-            // Start of a new TRTP payload for this substream.  Extract the
-            // lower 32 bits of the timestamp and hand the buffer to the
-            // substream for processing.
-            uint32_t ts_lower = U32_AT(data + 4);
-            substream->processPayloadStart(data + 12, amt - 12, ts_lower);
-        } else {
-            // Continuation of an existing TRTP payload.  Just hand it off to
-            // the substream for processing.
-            substream->processPayloadCont(data + 12, amt - 12);
-        }
-
-process_next_packet:
-        PacketBuffer::destroy(pb);
-    }  // end of main processing while loop.
-}
-
-void AAH_RXPlayer::processCommandPacket(PacketBuffer* pb) {
-    CHECK(NULL != pb);
-
-    uint8_t* data = pb->data_;
-    ssize_t  amt  = pb->length_;
-
-    // verify that this packet meets the minimum length of a command packet
-    if (amt < 20) {
-        return;
-    }
-
-    uint8_t trtp_version =  data[12];
-    uint8_t trtp_flags   =  data[13]       & 0xF;
-
-    if (1 != trtp_version) {
-        ALOGV("Dropping packet, bad trtp version %hhu", trtp_version);
-        return;
-    }
-
-    // calculate the start of the command payload
-    ssize_t offset = 18;
-    if (trtp_flags & 0x01) {
-        // timestamp is present (4 bytes)
-        offset += 4;
-    }
-    if (trtp_flags & 0x02) {
-        // transform is present (24 bytes)
-        offset += 24;
-    }
-
-    // the packet must contain 2 bytes of command payload beyond the TRTP header
-    if (amt < offset + 2) {
-        return;
-    }
-
-    uint16_t command_id = U16_AT(data + offset);
-
-    switch (command_id) {
-        case TRTPControlPacket::kCommandNop:
-            break;
-
-        case TRTPControlPacket::kCommandEOS:
-        case TRTPControlPacket::kCommandFlush: {
-            uint16_t program_id = (U32_AT(data + 8) >> 5) & 0x1F;
-            ALOGI("*** %s flushing program_id=%d",
-                  __PRETTY_FUNCTION__, program_id);
-
-            Vector<uint32_t> substreams_to_remove;
-            for (size_t i = 0; i < substreams_.size(); ++i) {
-                sp<Substream> iter = substreams_.valueAt(i);
-                if (iter->getProgramID() == program_id) {
-                    iter->shutdown();
-                    substreams_to_remove.add(iter->getSSRC());
-                }
-            }
-
-            for (size_t i = 0; i < substreams_to_remove.size(); ++i) {
-                substreams_.removeItem(substreams_to_remove[i]);
-            }
-        } break;
-    }
-}
-
-bool AAH_RXPlayer::processGaps() {
-    // Deal with the current gap situation.  Specifically...
-    //
-    // 1) If a new gap has shown up, send a retransmit request to the
-    //    transmitter.
-    // 2) If a gap we were working on has had a packet in the middle or at
-    //    the end filled in, send another retransmit request for the begining
-    //    portion of the gap.  TRTP was designed for LANs where packet
-    //    re-ordering is very unlikely; so see the middle or end of a gap
-    //    filled in before the begining is an almost certain indication that
-    //    a retransmission packet was also dropped.
-    // 3) If we have been working on a gap for a while and it still has not
-    //    been filled in, send another retransmit request.
-    // 4) If the are no more gaps in the ring, clear the current_gap_status_
-    //    flag to indicate that all is well again.
-
-    // Start by fetching the active gap status.
-    SeqNoGap gap;
-    bool send_retransmit_request = false;
-    bool ret_val = false;
-    GapStatus gap_status;
-    if (kGS_NoGap != (gap_status = ring_buffer_.fetchCurrentGap(&gap))) {
-        // Note: checking for a change in the end sequence number should cover
-        // moving on to an entirely new gap for case #1 as well as resending the
-        // begining of a gap range for case #2.
-        send_retransmit_request = (kGS_NoGap == current_gap_status_) ||
-                                  (current_gap_.end_seq_ != gap.end_seq_);
-
-        // If this is the same gap we have been working on, and it has timed
-        // out, then check to see if our substreams are about to underflow.  If
-        // so, instead of sending another retransmit request, just give up on
-        // this gap and move on.
-        if (!send_retransmit_request &&
-           (kGS_NoGap != current_gap_status_) &&
-           (0 == computeNextGapRetransmitTimeout())) {
-
-            // If out current gap is the fast-start gap, don't bother to skip it
-            // because substreams look like the are about to underflow.
-            if ((kGS_FastStartGap != gap_status) ||
-                (current_gap_.end_seq_ != gap.end_seq_)) {
-                for (size_t i = 0; i < substreams_.size(); ++i) {
-                    if (substreams_.valueAt(i)->isAboutToUnderflow()) {
-                        ALOGV("About to underflow, giving up on gap [%hu, %hu]",
-                              gap.start_seq_, gap.end_seq_);
-                        ring_buffer_.processNAK();
-                        current_gap_status_ = kGS_NoGap;
-                        return true;
-                    }
-                }
-            }
-
-            // Looks like no one is about to underflow.  Just go ahead and send
-            // the request.
-            send_retransmit_request = true;
-        }
-    } else {
-        current_gap_status_ = kGS_NoGap;
-    }
-
-    if (send_retransmit_request) {
-        // If we have been working on a fast start, and it is still not filled
-        // in, even after the extended retransmit time out, give up and skip it.
-        // The system should fall back into its normal slow-start behavior.
-        if ((kGS_FastStartGap == current_gap_status_) &&
-            (current_gap_.end_seq_ == gap.end_seq_)) {
-            ALOGV("Fast start is taking forever; giving up.");
-            ring_buffer_.processNAK();
-            current_gap_status_ = kGS_NoGap;
-            return true;
-        }
-
-        // Send the request.
-        RetransRequest req;
-        uint32_t magic  = (kGS_FastStartGap == gap_status)
-                        ? kFastStartRequestMagic
-                        : kRetransRequestMagic;
-        req.magic_      = htonl(magic);
-        req.mcast_ip_   = listen_addr_.sin_addr.s_addr;
-        req.mcast_port_ = listen_addr_.sin_port;
-        req.start_seq_  = htons(gap.start_seq_);
-        req.end_seq_    = htons(gap.end_seq_);
-
-        {
-            uint32_t a = ntohl(transmitter_addr_.sin_addr.s_addr);
-            uint16_t p = ntohs(transmitter_addr_.sin_port);
-            ALOGV("Sending to transmitter %u.%u.%u.%u:%hu",
-                    ((a >> 24) & 0xFF),
-                    ((a >> 16) & 0xFF),
-                    ((a >>  8) & 0xFF),
-                    ( a        & 0xFF),
-                    p);
-        }
-
-        int res = sendto(sock_fd_, &req, sizeof(req), 0,
-                         reinterpret_cast<struct sockaddr*>(&transmitter_addr_),
-                         sizeof(transmitter_addr_));
-        if (res < 0) {
-            ALOGE("Error when sending retransmit request (%d)", errno);
-        } else {
-            ALOGV("%s request for range [%hu, %hu] sent",
-                  (kGS_FastStartGap == gap_status) ? "Fast Start"
-                                                   : "Retransmit",
-                  gap.start_seq_, gap.end_seq_);
-        }
-
-        // Update the current gap info.
-        current_gap_ = gap;
-        current_gap_status_ = gap_status;
-        next_retrans_req_time_ = monotonicUSecNow() +
-                               ((kGS_FastStartGap == current_gap_status_)
-                                ? kFastStartTimeoutUSec
-                                : kGapRerequestTimeoutUSec);
-    }
-
-    return false;
-}
-
-// Compute when its time to send the next gap retransmission in milliseconds.
-// Returns < 0 for an infinite timeout (no gap) and 0 if its time to retransmit
-// right now.
-int AAH_RXPlayer::computeNextGapRetransmitTimeout() {
-    if (kGS_NoGap == current_gap_status_) {
-        return -1;
-    }
-
-    int64_t timeout_delta = next_retrans_req_time_ - monotonicUSecNow();
-
-    timeout_delta /= 1000;
-    if (timeout_delta <= 0) {
-        return 0;
-    }
-
-    return static_cast<uint32_t>(timeout_delta);
-}
-
-}  // namespace android
diff --git a/media/libaah_rtp/aah_rx_player_ring_buffer.cpp b/media/libaah_rtp/aah_rx_player_ring_buffer.cpp
deleted file mode 100644
index 779405e..0000000
--- a/media/libaah_rtp/aah_rx_player_ring_buffer.cpp
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-//#define LOG_NDEBUG 0
-#include <utils/Log.h>
-
-#include "aah_rx_player.h"
-
-namespace android {
-
-AAH_RXPlayer::RXRingBuffer::RXRingBuffer(uint32_t capacity) {
-    capacity_ = capacity;
-    rd_ = wr_ = 0;
-    ring_ = new PacketBuffer*[capacity];
-    memset(ring_, 0, sizeof(PacketBuffer*) * capacity);
-    reset();
-}
-
-AAH_RXPlayer::RXRingBuffer::~RXRingBuffer() {
-    reset();
-    delete[] ring_;
-}
-
-void AAH_RXPlayer::RXRingBuffer::reset() {
-    AutoMutex lock(&lock_);
-
-    if (NULL != ring_) {
-        while (rd_ != wr_) {
-            CHECK(rd_ < capacity_);
-            if (NULL != ring_[rd_]) {
-                PacketBuffer::destroy(ring_[rd_]);
-                ring_[rd_] = NULL;
-            }
-            rd_ = (rd_ + 1) % capacity_;
-        }
-    }
-
-    rd_ = wr_ = 0;
-    rd_seq_known_ = false;
-    waiting_for_fast_start_ = true;
-    fetched_first_packet_ = false;
-    rtp_activity_timeout_valid_ = false;
-}
-
-bool AAH_RXPlayer::RXRingBuffer::pushBuffer(PacketBuffer* buf,
-                                                uint16_t seq) {
-    AutoMutex lock(&lock_);
-    CHECK(NULL != ring_);
-    CHECK(NULL != buf);
-
-    rtp_activity_timeout_valid_ = true;
-    rtp_activity_timeout_ = monotonicUSecNow() + kRTPActivityTimeoutUSec;
-
-    // If the ring buffer is totally reset (we have never received a single
-    // payload) then we don't know the rd sequence number and this should be
-    // simple.  We just store the payload, advance the wr pointer and record the
-    // initial sequence number.
-    if (!rd_seq_known_) {
-        CHECK(rd_ == wr_);
-        CHECK(NULL == ring_[wr_]);
-        CHECK(wr_ < capacity_);
-
-        ring_[wr_] = buf;
-        wr_ = (wr_ + 1) % capacity_;
-        rd_seq_ = seq;
-        rd_seq_known_ = true;
-        return true;
-    }
-
-    // Compute the seqence number of this payload and of the write pointer,
-    // normalized around the read pointer.  IOW - transform the payload seq no
-    // and the wr pointer seq no into a space where the rd pointer seq no is
-    // zero.  This will define 4 cases we can consider...
-    //
-    // 1) norm_seq == norm_wr_seq
-    //    This payload is contiguous with the last.  All is good.
-    //
-    // 2)  ((norm_seq <  norm_wr_seq) && (norm_seq >= norm_rd_seq)
-    // aka ((norm_seq <  norm_wr_seq) && (norm_seq >= 0)
-    //    This payload is in the past, in the unprocessed region of the ring
-    //    buffer.  It is probably a retransmit intended to fill in a dropped
-    //    payload; it may be a duplicate.
-    //
-    // 3) ((norm_seq - norm_wr_seq) & 0x8000) != 0
-    //    This payload is in the past compared to the write pointer (or so very
-    //    far in the future that it has wrapped the seq no space), but not in
-    //    the unprocessed region of the ring buffer.  This could be a duplicate
-    //    retransmit; we just drop these payloads unless we are waiting for our
-    //    first fast start packet.  If we are waiting for fast start, than this
-    //    packet is probably the first packet of the fast start retransmission.
-    //    If it will fit in the buffer, back up the read pointer to its position
-    //    and clear the fast start flag, otherwise just drop it.
-    //
-    // 4) ((norm_seq - norm_wr_seq) & 0x8000) == 0
-    //    This payload which is ahead of the next write pointer.  This indicates
-    //    that we have missed some payloads and need to request a retransmit.
-    //    If norm_seq >= (capacity - 1), then the gap is so large that it would
-    //    overflow the ring buffer and we should probably start to panic.
-
-    uint16_t norm_wr_seq = ((wr_ + capacity_ - rd_) % capacity_);
-    uint16_t norm_seq    = seq - rd_seq_;
-
-    // Check for overflow first.
-    if ((!(norm_seq & 0x8000)) && (norm_seq >= (capacity_ - 1))) {
-        ALOGW("Ring buffer overflow; cap = %u, [rd, wr] = [%hu, %hu],"
-              " seq = %hu", capacity_, rd_seq_, norm_wr_seq + rd_seq_, seq);
-        PacketBuffer::destroy(buf);
-        return false;
-    }
-
-    // Check for case #1
-    if (norm_seq == norm_wr_seq) {
-        CHECK(wr_ < capacity_);
-        CHECK(NULL == ring_[wr_]);
-
-        ring_[wr_] = buf;
-        wr_ = (wr_ + 1) % capacity_;
-
-        CHECK(wr_ != rd_);
-        return true;
-    }
-
-    // Check case #2
-    uint32_t ring_pos = (rd_ + norm_seq) % capacity_;
-    if ((norm_seq < norm_wr_seq) && (!(norm_seq & 0x8000))) {
-        // Do we already have a payload for this slot?  If so, then this looks
-        // like a duplicate retransmit.  Just ignore it.
-        if (NULL != ring_[ring_pos]) {
-            ALOGD("RXed duplicate retransmit, seq = %hu", seq);
-            PacketBuffer::destroy(buf);
-        } else {
-            // Looks like we were missing this payload.  Go ahead and store it.
-            ring_[ring_pos] = buf;
-        }
-
-        return true;
-    }
-
-    // Check case #3
-    if ((norm_seq - norm_wr_seq) & 0x8000) {
-        if (!waiting_for_fast_start_) {
-            ALOGD("RXed duplicate retransmit from before rd pointer, seq = %hu",
-                  seq);
-            PacketBuffer::destroy(buf);
-        } else {
-            // Looks like a fast start fill-in.  Go ahead and store it, assuming
-            // that we can fit it in the buffer.
-            uint32_t implied_ring_size = static_cast<uint32_t>(norm_wr_seq)
-                                       + (rd_seq_ - seq);
-
-            if (implied_ring_size >= (capacity_ - 1)) {
-                ALOGD("RXed what looks like a fast start packet (seq = %hu),"
-                      " but packet is too far in the past to fit into the ring"
-                      "  buffer.  Dropping.", seq);
-                PacketBuffer::destroy(buf);
-            } else {
-                ring_pos = (rd_ + capacity_ + seq - rd_seq_) % capacity_;
-                rd_seq_ = seq;
-                rd_ = ring_pos;
-                waiting_for_fast_start_ = false;
-
-                CHECK(ring_pos < capacity_);
-                CHECK(NULL == ring_[ring_pos]);
-                ring_[ring_pos] = buf;
-            }
-
-        }
-        return true;
-    }
-
-    // Must be in case #4 with no overflow.  This packet fits in the current
-    // ring buffer, but is discontiuguous.  Advance the write pointer leaving a
-    // gap behind.
-    uint32_t gap_len = (ring_pos + capacity_ - wr_) % capacity_;
-    ALOGD("Drop detected; %u packets, seq_range [%hu, %hu]",
-          gap_len,
-          rd_seq_ + norm_wr_seq,
-          rd_seq_ + norm_wr_seq + gap_len - 1);
-
-    CHECK(NULL == ring_[ring_pos]);
-    ring_[ring_pos] = buf;
-    wr_ = (ring_pos + 1) % capacity_;
-    CHECK(wr_ != rd_);
-
-    return true;
-}
-
-AAH_RXPlayer::PacketBuffer*
-AAH_RXPlayer::RXRingBuffer::fetchBuffer(bool* is_discon) {
-    AutoMutex lock(&lock_);
-    CHECK(NULL != ring_);
-    CHECK(NULL != is_discon);
-
-    // If the read seqence number is not known, then this ring buffer has not
-    // received a packet since being reset and there cannot be any packets to
-    // return.  If we are still waiting for the first fast start packet to show
-    // up, we don't want to let any buffer be consumed yet because we expect to
-    // see a packet before the initial read sequence number show up shortly.
-    if (!rd_seq_known_ || waiting_for_fast_start_) {
-        *is_discon = false;
-        return NULL;
-    }
-
-    PacketBuffer* ret = NULL;
-    *is_discon = !fetched_first_packet_;
-
-    while ((rd_ != wr_) && (NULL == ret)) {
-        CHECK(rd_ < capacity_);
-
-        // If we hit a gap, stall and do not advance the read pointer.  Let the
-        // higher level code deal with requesting retries and/or deciding to
-        // skip the current gap.
-        ret = ring_[rd_];
-        if (NULL == ret) {
-            break;
-        }
-
-        ring_[rd_] = NULL;
-        rd_ = (rd_ + 1) % capacity_;
-        ++rd_seq_;
-    }
-
-    if (NULL != ret) {
-        fetched_first_packet_ = true;
-    }
-
-    return ret;
-}
-
-AAH_RXPlayer::GapStatus
-AAH_RXPlayer::RXRingBuffer::fetchCurrentGap(SeqNoGap* gap) {
-    AutoMutex lock(&lock_);
-    CHECK(NULL != ring_);
-    CHECK(NULL != gap);
-
-    // If the read seqence number is not known, then this ring buffer has not
-    // received a packet since being reset and there cannot be any gaps.
-    if (!rd_seq_known_) {
-        return kGS_NoGap;
-    }
-
-    // If we are waiting for fast start, then the current gap is a fast start
-    // gap and it includes all packets before the read sequence number.
-    if (waiting_for_fast_start_) {
-        gap->start_seq_ =
-        gap->end_seq_   = rd_seq_ - 1;
-        return kGS_FastStartGap;
-    }
-
-    // If rd == wr, then the buffer is empty and there cannot be any gaps.
-    if (rd_ == wr_) {
-        return kGS_NoGap;
-    }
-
-    // If rd_ is currently pointing at an unprocessed packet, then there is no
-    // current gap.
-    CHECK(rd_ < capacity_);
-    if (NULL != ring_[rd_]) {
-        return kGS_NoGap;
-    }
-
-    // Looks like there must be a gap here.  The start of the gap is the current
-    // rd sequence number, all we need to do now is determine its length in
-    // order to compute the end sequence number.
-    gap->start_seq_ = rd_seq_;
-    uint16_t end = rd_seq_;
-    uint32_t tmp = (rd_ + 1) % capacity_;
-    while ((tmp != wr_) && (NULL == ring_[tmp])) {
-        ++end;
-        tmp = (tmp + 1) % capacity_;
-    }
-    gap->end_seq_ = end;
-
-    return kGS_NormalGap;
-}
-
-void AAH_RXPlayer::RXRingBuffer::processNAK(const SeqNoGap* nak) {
-    AutoMutex lock(&lock_);
-    CHECK(NULL != ring_);
-
-    // If we were waiting for our first fast start fill-in packet, and we
-    // received a NAK, then apparantly we are not getting our fast start.  Just
-    // clear the waiting flag and go back to normal behavior.
-    if (waiting_for_fast_start_) {
-        waiting_for_fast_start_ = false;
-    }
-
-    // If we have not received a packet since last reset, or there is no data in
-    // the ring, then there is nothing to skip.
-    if ((!rd_seq_known_) || (rd_ == wr_)) {
-        return;
-    }
-
-    // If rd_ is currently pointing at an unprocessed packet, then there is no
-    // gap to skip.
-    CHECK(rd_ < capacity_);
-    if (NULL != ring_[rd_]) {
-        return;
-    }
-
-    // Looks like there must be a gap here.  Advance rd until we have passed
-    // over the portion of it indicated by nak (or all of the gap if nak is
-    // NULL).  Then reset fetched_first_packet_ so that the next read will show
-    // up as being discontiguous.
-    uint16_t seq_after_gap = (NULL == nak) ? 0 : nak->end_seq_ + 1;
-    while ((rd_ != wr_) &&
-           (NULL == ring_[rd_]) &&
-          ((NULL == nak) || (seq_after_gap != rd_seq_))) {
-        rd_ = (rd_ + 1) % capacity_;
-        ++rd_seq_;
-    }
-    fetched_first_packet_ = false;
-}
-
-int AAH_RXPlayer::RXRingBuffer::computeInactivityTimeout() {
-    AutoMutex lock(&lock_);
-
-    if (!rtp_activity_timeout_valid_) {
-        return -1;
-    }
-
-    uint64_t now = monotonicUSecNow();
-    if (rtp_activity_timeout_ <= now) {
-        return 0;
-    }
-
-    return (rtp_activity_timeout_ - now) / 1000;
-}
-
-AAH_RXPlayer::PacketBuffer*
-AAH_RXPlayer::PacketBuffer::allocate(ssize_t length) {
-    if (length <= 0) {
-        return NULL;
-    }
-
-    uint32_t alloc_len = sizeof(PacketBuffer) + length;
-    PacketBuffer* ret = reinterpret_cast<PacketBuffer*>(
-                        new uint8_t[alloc_len]);
-
-    if (NULL != ret) {
-        ret->length_ = length;
-    }
-
-    return ret;
-}
-
-void AAH_RXPlayer::PacketBuffer::destroy(PacketBuffer* pb) {
-    uint8_t* kill_me = reinterpret_cast<uint8_t*>(pb);
-    delete[] kill_me;
-}
-
-}  // namespace android
diff --git a/media/libaah_rtp/aah_rx_player_substream.cpp b/media/libaah_rtp/aah_rx_player_substream.cpp
deleted file mode 100644
index 18b0e2b..0000000
--- a/media/libaah_rtp/aah_rx_player_substream.cpp
+++ /dev/null
@@ -1,677 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-//#define LOG_NDEBUG 0
-
-#include <utils/Log.h>
-
-#include <include/avc_utils.h>
-#include <media/stagefright/MediaBuffer.h>
-#include <media/stagefright/MediaDefs.h>
-#include <media/stagefright/MetaData.h>
-#include <media/stagefright/OMXCodec.h>
-#include <media/stagefright/Utils.h>
-
-#include "aah_rx_player.h"
-#include "aah_tx_packet.h"
-
-inline uint32_t min(uint32_t a, uint32_t b) {
-    return (a < b ? a : b);
-}
-
-namespace android {
-
-int64_t AAH_RXPlayer::Substream::kAboutToUnderflowThreshold =
-    50ull * 1000;
-
-AAH_RXPlayer::Substream::Substream(uint32_t ssrc, OMXClient& omx) {
-    ssrc_ = ssrc;
-    substream_details_known_ = false;
-    buffer_in_progress_ = NULL;
-    status_ = OK;
-    codec_mime_type_ = "";
-
-    decoder_ = new AAH_DecoderPump(omx);
-    if (decoder_ == NULL) {
-        ALOGE("%s failed to allocate decoder pump!", __PRETTY_FUNCTION__);
-    }
-    if (OK != decoder_->initCheck()) {
-        ALOGE("%s failed to initialize decoder pump!", __PRETTY_FUNCTION__);
-    }
-
-    // cleanupBufferInProgress will reset most of the internal state variables.
-    // Just need to make sure that buffer_in_progress_ is NULL before calling.
-    cleanupBufferInProgress();
-}
-
-AAH_RXPlayer::Substream::~Substream() {
-    shutdown();
-}
-
-void AAH_RXPlayer::Substream::shutdown() {
-    substream_meta_ = NULL;
-    status_ = OK;
-    cleanupBufferInProgress();
-    cleanupDecoder();
-}
-
-void AAH_RXPlayer::Substream::cleanupBufferInProgress() {
-    if (NULL != buffer_in_progress_) {
-        buffer_in_progress_->release();
-        buffer_in_progress_ = NULL;
-    }
-
-    expected_buffer_size_ = 0;
-    buffer_filled_ = 0;
-    waiting_for_rap_ = true;
-
-    aux_data_in_progress_.clear();
-    aux_data_expected_size_ = 0;
-}
-
-void AAH_RXPlayer::Substream::cleanupDecoder() {
-    if (decoder_ != NULL) {
-        decoder_->shutdown();
-    }
-}
-
-bool AAH_RXPlayer::Substream::shouldAbort(const char* log_tag) {
-    // If we have already encountered a fatal error, do nothing.  We are just
-    // waiting for our owner to shut us down now.
-    if (OK != status_) {
-        ALOGV("Skipping %s, substream has encountered fatal error (%d).",
-                log_tag, status_);
-        return true;
-    }
-
-    return false;
-}
-
-void AAH_RXPlayer::Substream::processPayloadStart(uint8_t* buf,
-                                                  uint32_t amt,
-                                                  int32_t ts_lower) {
-    uint32_t min_length = 6;
-
-    if (shouldAbort(__PRETTY_FUNCTION__)) {
-        return;
-    }
-
-    // Do we have a buffer in progress already?  If so, abort the buffer.  In
-    // theory, this should never happen.  If there were a discontinutity in the
-    // stream, the discon in the seq_nos at the RTP level should have already
-    // triggered a cleanup of the buffer in progress.  To see a problem at this
-    // level is an indication either of a bug in the transmitter, or some form
-    // of terrible corruption/tampering on the wire.
-    if (NULL != buffer_in_progress_) {
-        ALOGE("processPayloadStart is aborting payload already in progress.");
-        cleanupBufferInProgress();
-    }
-
-    // Parse enough of the header to know where we stand.  Since this is a
-    // payload start, it should begin with a TRTP header which has to be at
-    // least 6 bytes long.
-    if (amt < min_length) {
-        ALOGV("Discarding payload too short to contain TRTP header (len = %u)",
-                amt);
-        return;
-    }
-
-    // Check the TRTP version number.
-    if (0x01 != buf[0]) {
-        ALOGV("Unexpected TRTP version (%u) in header.  Expected %u.",
-                buf[0], 1);
-        return;
-    }
-
-    // Extract the substream type field and make sure its one we understand (and
-    // one that does not conflict with any previously received substream type.
-    uint8_t header_type = (buf[1] >> 4) & 0xF;
-    switch (header_type) {
-        case TRTPPacket::kHeaderTypeAudio:
-            // Audio, yay!  Just break.  We understand audio payloads.
-            break;
-        case TRTPPacket::kHeaderTypeVideo:
-            ALOGV("RXed packet with unhandled TRTP header type (Video).");
-            return;
-        case TRTPPacket::kHeaderTypeSubpicture:
-            ALOGV("RXed packet with unhandled TRTP header type (Subpicture).");
-            return;
-        case TRTPPacket::kHeaderTypeControl:
-            ALOGV("RXed packet with unhandled TRTP header type (Control).");
-            return;
-        default:
-            ALOGV("RXed packet with unhandled TRTP header type (%u).",
-                    header_type);
-            return;
-    }
-
-    if (substream_details_known_ && (header_type != substream_type_)) {
-        ALOGV("RXed TRTP Payload for SSRC=0x%08x where header type (%u) does"
-              " not match previously received header type (%u)",
-              ssrc_, header_type, substream_type_);
-        return;
-    }
-
-    // Check the flags to see if there is another 32 bits of timestamp present.
-    uint32_t trtp_header_len = 6;
-    bool ts_valid = buf[1] & TRTPPacket::kFlag_TSValid;
-    if (ts_valid) {
-        min_length += 4;
-        trtp_header_len += 4;
-        if (amt < min_length) {
-            ALOGV("Discarding payload too short to contain TRTP timestamp"
-                  " (len = %u)", amt);
-            return;
-        }
-    }
-
-    // Extract the TRTP length field and sanity check it.
-    uint32_t trtp_len = U32_AT(buf + 2);
-    if (trtp_len < min_length) {
-        ALOGV("TRTP length (%u) is too short to be valid.  Must be at least %u"
-              " bytes.", trtp_len, min_length);
-        return;
-    }
-
-    // Extract the rest of the timestamp field if valid.
-    int64_t ts = 0;
-    uint32_t parse_offset = 6;
-    if (ts_valid) {
-        uint32_t ts_upper = U32_AT(buf + parse_offset);
-        parse_offset += 4;
-        ts = (static_cast<int64_t>(ts_upper) << 32) | ts_lower;
-    }
-
-    // Check the flags to see if there is another 24 bytes of timestamp
-    // transformation present.
-    if (buf[1] & TRTPPacket::kFlag_TSTransformPresent) {
-        min_length += 24;
-        parse_offset += 24;
-        trtp_header_len += 24;
-        if (amt < min_length) {
-            ALOGV("Discarding payload too short to contain TRTP timestamp"
-                  " transformation (len = %u)", amt);
-            return;
-        }
-    }
-
-    // TODO : break the parsing into individual parsers for the different
-    // payload types (audio, video, etc).
-    //
-    // At this point in time, we know that this is audio.  Go ahead and parse
-    // the basic header, check the codec type, and find the payload portion of
-    // the packet.
-    min_length += 3;
-    if (trtp_len < min_length) {
-        ALOGV("TRTP length (%u) is too short to be a valid audio payload.  Must"
-              " be at least %u bytes.", trtp_len, min_length);
-        return;
-    }
-
-    if (amt < min_length) {
-        ALOGV("TRTP porttion of RTP payload (%u bytes) too small to contain"
-              " entire TRTP header.  TRTP does not currently support"
-              " fragmenting TRTP headers across RTP payloads", amt);
-        return;
-    }
-
-    uint8_t codec_type = buf[parse_offset    ];
-    uint8_t flags      = buf[parse_offset + 1];
-    uint8_t volume     = buf[parse_offset + 2];
-    parse_offset += 3;
-    trtp_header_len += 3;
-
-    if (!setupSubstreamType(header_type, codec_type)) {
-        return;
-    }
-
-    if (decoder_ != NULL) {
-        decoder_->setRenderVolume(volume);
-    }
-
-    if (waiting_for_rap_ && !(flags & TRTPAudioPacket::kFlag_RandomAccessPoint)) {
-        ALOGV("Dropping non-RAP TRTP Audio Payload while waiting for RAP.");
-        return;
-    }
-
-    // Check for the presence of codec aux data.
-    if (flags & TRTPAudioPacket::kFlag_AuxLengthPresent) {
-        min_length += 4;
-        trtp_header_len += 4;
-
-        if (trtp_len < min_length) {
-            ALOGV("TRTP length (%u) is too short to be a valid audio payload.  "
-                  "Must be at least %u bytes.", trtp_len, min_length);
-            return;
-        }
-
-        if (amt < min_length) {
-            ALOGV("TRTP porttion of RTP payload (%u bytes) too small to contain"
-                  " entire TRTP header.  TRTP does not currently support"
-                  " fragmenting TRTP headers across RTP payloads", amt);
-            return;
-        }
-
-        aux_data_expected_size_ = U32_AT(buf + parse_offset);
-        aux_data_in_progress_.clear();
-        if (aux_data_in_progress_.capacity() < aux_data_expected_size_) {
-            aux_data_in_progress_.setCapacity(aux_data_expected_size_);
-        }
-    } else {
-        aux_data_expected_size_ = 0;
-    }
-
-    if ((aux_data_expected_size_ + trtp_header_len) > trtp_len) {
-        ALOGV("Expected codec aux data length (%u) and TRTP header overhead"
-              " (%u) too large for total TRTP payload length (%u).",
-             aux_data_expected_size_, trtp_header_len, trtp_len);
-        return;
-    }
-
-    // OK - everything left is just payload.  Compute the payload size, start
-    // the buffer in progress and pack as much payload as we can into it.  If
-    // the payload is finished once we are done, go ahead and send the payload
-    // to the decoder.
-    expected_buffer_size_ = trtp_len
-                          - trtp_header_len
-                          - aux_data_expected_size_;
-    if (!expected_buffer_size_) {
-        ALOGV("Dropping TRTP Audio Payload with 0 Access Unit length");
-        return;
-    }
-
-    CHECK(amt >= trtp_header_len);
-    uint32_t todo = amt - trtp_header_len;
-    if ((expected_buffer_size_ + aux_data_expected_size_) < todo) {
-        ALOGV("Extra data (%u > %u) present in initial TRTP Audio Payload;"
-              " dropping payload.", todo,
-              expected_buffer_size_ + aux_data_expected_size_);
-        return;
-    }
-
-    buffer_filled_ = 0;
-    buffer_in_progress_ = new MediaBuffer(expected_buffer_size_);
-    if ((NULL == buffer_in_progress_) ||
-            (NULL == buffer_in_progress_->data())) {
-        ALOGV("Failed to allocate MediaBuffer of length %u",
-                expected_buffer_size_);
-        cleanupBufferInProgress();
-        return;
-    }
-
-    sp<MetaData> meta = buffer_in_progress_->meta_data();
-    if (meta == NULL) {
-        ALOGV("Missing metadata structure in allocated MediaBuffer; dropping"
-              " payload");
-        cleanupBufferInProgress();
-        return;
-    }
-
-    meta->setCString(kKeyMIMEType, codec_mime_type_);
-    if (ts_valid) {
-        meta->setInt64(kKeyTime, ts);
-    }
-
-    // Skip over the header we have already extracted.
-    amt -= trtp_header_len;
-    buf += trtp_header_len;
-
-    // Extract as much of the expected aux data as we can.
-    todo = min(aux_data_expected_size_, amt);
-    if (todo) {
-        aux_data_in_progress_.appendArray(buf, todo);
-        buf += todo;
-        amt -= todo;
-    }
-
-    // Extract as much of the expected payload as we can.
-    todo = min(expected_buffer_size_, amt);
-    if (todo > 0) {
-        uint8_t* tgt =
-            reinterpret_cast<uint8_t*>(buffer_in_progress_->data());
-        memcpy(tgt, buf, todo);
-        buffer_filled_ = amt;
-        buf += todo;
-        amt -= todo;
-    }
-
-    if (buffer_filled_ >= expected_buffer_size_) {
-        processCompletedBuffer();
-    }
-}
-
-void AAH_RXPlayer::Substream::processPayloadCont(uint8_t* buf,
-                                                 uint32_t amt) {
-    if (shouldAbort(__PRETTY_FUNCTION__)) {
-        return;
-    }
-
-    if (NULL == buffer_in_progress_) {
-        ALOGV("TRTP Receiver skipping payload continuation; no buffer currently"
-              " in progress.");
-        return;
-    }
-
-    CHECK(aux_data_in_progress_.size() <= aux_data_expected_size_);
-    uint32_t aux_left = aux_data_expected_size_ - aux_data_in_progress_.size();
-    if (aux_left) {
-        uint32_t todo = min(aux_left, amt);
-        aux_data_in_progress_.appendArray(buf, todo);
-        amt -= todo;
-        buf += todo;
-
-        if (!amt)
-            return;
-    }
-
-    CHECK(buffer_filled_ < expected_buffer_size_);
-    uint32_t buffer_left = expected_buffer_size_ - buffer_filled_;
-    if (amt > buffer_left) {
-        ALOGV("Extra data (%u > %u) present in continued TRTP Audio Payload;"
-              " dropping payload.", amt, buffer_left);
-        cleanupBufferInProgress();
-        return;
-    }
-
-    if (amt > 0) {
-        uint8_t* tgt =
-            reinterpret_cast<uint8_t*>(buffer_in_progress_->data());
-        memcpy(tgt + buffer_filled_, buf, amt);
-        buffer_filled_ += amt;
-    }
-
-    if (buffer_filled_ >= expected_buffer_size_) {
-        processCompletedBuffer();
-    }
-}
-
-void AAH_RXPlayer::Substream::processCompletedBuffer() {
-    status_t res;
-
-    CHECK(NULL != buffer_in_progress_);
-
-    if (decoder_ == NULL) {
-        ALOGV("Dropping complete buffer, no decoder pump allocated");
-        goto bailout;
-    }
-
-    // Make sure our metadata used to initialize the decoder has been properly
-    // set up.
-    if (!setupSubstreamMeta())
-        goto bailout;
-
-    // If our decoder has not be set up, do so now.
-    res = decoder_->init(substream_meta_);
-    if (OK != res) {
-        ALOGE("Failed to init decoder (res = %d)", res);
-        cleanupDecoder();
-        substream_meta_ = NULL;
-        goto bailout;
-    }
-
-    // Queue the payload for decode.
-    res = decoder_->queueForDecode(buffer_in_progress_);
-
-    if (res != OK) {
-        ALOGD("Failed to queue payload for decode, resetting decoder pump!"
-             " (res = %d)", res);
-        status_ = res;
-        cleanupDecoder();
-        cleanupBufferInProgress();
-    }
-
-    // NULL out buffer_in_progress before calling the cleanup helper.
-    //
-    // MediaBuffers use something of a hybrid ref-counting pattern which prevent
-    // the AAH_DecoderPump's input queue from adding their own reference to the
-    // MediaBuffer.  MediaBuffers start life with a reference count of 0, as
-    // well as an observer which starts as NULL.  Before being given an
-    // observer, the ref count cannot be allowed to become non-zero as it will
-    // cause calls to release() to assert.  Basically, before a MediaBuffer has
-    // an observer, they behave like non-ref counted obects where release()
-    // serves the roll of delete.  After a MediaBuffer has an observer, they
-    // become more like ref counted objects where add ref and release can be
-    // used, and when the ref count hits zero, the MediaBuffer is handed off to
-    // the observer.
-    //
-    // Given all of this, when we give the buffer to the decoder pump to wait in
-    // the to-be-processed queue, the decoder cannot add a ref to the buffer as
-    // it would in a traditional ref counting system.  Instead it needs to
-    // "steal" the non-existent ref.  In the case of queue failure, we need to
-    // make certain to release this non-existent reference so that the buffer is
-    // cleaned up during the cleanupBufferInProgress helper.  In the case of a
-    // successful queue operation, we need to make certain that the
-    // cleanupBufferInProgress helper does not release the buffer since it needs
-    // to remain alive in the queue.  We acomplish this by NULLing out the
-    // buffer pointer before calling the cleanup helper.
-    buffer_in_progress_ = NULL;
-
-bailout:
-    cleanupBufferInProgress();
-}
-
-bool AAH_RXPlayer::Substream::setupSubstreamMeta() {
-    switch (codec_type_) {
-        case TRTPAudioPacket::kCodecMPEG1Audio:
-            codec_mime_type_ = MEDIA_MIMETYPE_AUDIO_MPEG;
-            return setupMP3SubstreamMeta();
-
-        case TRTPAudioPacket::kCodecAACAudio:
-            codec_mime_type_ = MEDIA_MIMETYPE_AUDIO_AAC;
-            return setupAACSubstreamMeta();
-
-        default:
-            ALOGV("Failed to setup substream metadata for unsupported codec"
-                  " type (%u)", codec_type_);
-            break;
-    }
-
-    return false;
-}
-
-bool AAH_RXPlayer::Substream::setupMP3SubstreamMeta() {
-    const uint8_t* buffer_data = NULL;
-    int sample_rate;
-    int channel_count;
-    size_t frame_size;
-    status_t res;
-
-    buffer_data = reinterpret_cast<const uint8_t*>(buffer_in_progress_->data());
-    if (buffer_in_progress_->size() < 4) {
-        ALOGV("MP3 payload too short to contain header, dropping payload.");
-        return false;
-    }
-
-    // Extract the channel count and the sample rate from the MP3 header.  The
-    // stagefright MP3 requires that these be delivered before decoing can
-    // begin.
-    if (!GetMPEGAudioFrameSize(U32_AT(buffer_data),
-                               &frame_size,
-                               &sample_rate,
-                               &channel_count,
-                               NULL,
-                               NULL)) {
-        ALOGV("Failed to parse MP3 header in payload, droping payload.");
-        return false;
-    }
-
-
-    // Make sure that our substream metadata is set up properly.  If there has
-    // been a format change, be sure to reset the underlying decoder.  In
-    // stagefright, it seems like the only way to do this is to destroy and
-    // recreate the decoder.
-    if (substream_meta_ == NULL) {
-        substream_meta_ = new MetaData();
-
-        if (substream_meta_ == NULL) {
-            ALOGE("Failed to allocate MetaData structure for MP3 substream");
-            return false;
-        }
-
-        substream_meta_->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_MPEG);
-        substream_meta_->setInt32  (kKeyChannelCount, channel_count);
-        substream_meta_->setInt32  (kKeySampleRate,   sample_rate);
-    } else {
-        int32_t prev_sample_rate;
-        int32_t prev_channel_count;
-        substream_meta_->findInt32(kKeySampleRate,   &prev_sample_rate);
-        substream_meta_->findInt32(kKeyChannelCount, &prev_channel_count);
-
-        if ((prev_channel_count != channel_count) ||
-            (prev_sample_rate   != sample_rate)) {
-            ALOGW("MP3 format change detected, forcing decoder reset.");
-            cleanupDecoder();
-
-            substream_meta_->setInt32(kKeyChannelCount, channel_count);
-            substream_meta_->setInt32(kKeySampleRate,   sample_rate);
-        }
-    }
-
-    return true;
-}
-
-bool AAH_RXPlayer::Substream::setupAACSubstreamMeta() {
-    int32_t sample_rate, channel_cnt;
-    static const size_t overhead = sizeof(sample_rate)
-                                 + sizeof(channel_cnt);
-
-    if (aux_data_in_progress_.size() < overhead) {
-        ALOGE("Not enough aux data (%u) to initialize AAC substream decoder",
-                aux_data_in_progress_.size());
-        return false;
-    }
-
-    const uint8_t* aux_data = aux_data_in_progress_.array();
-    size_t aux_data_size = aux_data_in_progress_.size();
-    sample_rate = U32_AT(aux_data);
-    channel_cnt = U32_AT(aux_data + sizeof(sample_rate));
-
-    const uint8_t* esds_data = NULL;
-    size_t esds_data_size = 0;
-    if (aux_data_size > overhead) {
-        esds_data = aux_data + overhead;
-        esds_data_size = aux_data_size - overhead;
-    }
-
-    // Do we already have metadata?  If so, has it changed at all?  If not, then
-    // there should be nothing else to do.  Otherwise, release our old stream
-    // metadata and make new metadata.
-    if (substream_meta_ != NULL) {
-        uint32_t type;
-        const void* data;
-        size_t size;
-        int32_t prev_sample_rate;
-        int32_t prev_channel_count;
-        bool res;
-
-        res = substream_meta_->findInt32(kKeySampleRate,   &prev_sample_rate);
-        CHECK(res);
-        res = substream_meta_->findInt32(kKeyChannelCount, &prev_channel_count);
-        CHECK(res);
-
-        // If nothing has changed about the codec aux data (esds, sample rate,
-        // channel count), then we can just do nothing and get out.  Otherwise,
-        // we will need to reset the decoder and make a new metadata object to
-        // deal with the format change.
-        bool hasData = (esds_data != NULL);
-        bool hadData = substream_meta_->findData(kKeyESDS, &type, &data, &size);
-        bool esds_change = (hadData != hasData);
-
-        if (!esds_change && hasData)
-            esds_change = ((size != esds_data_size) ||
-                           memcmp(data, esds_data, size));
-
-        if (!esds_change &&
-            (prev_sample_rate   == sample_rate) &&
-            (prev_channel_count == channel_cnt)) {
-            return true;  // no change, just get out.
-        }
-
-        ALOGW("AAC format change detected, forcing decoder reset.");
-        cleanupDecoder();
-        substream_meta_ = NULL;
-    }
-
-    CHECK(substream_meta_ == NULL);
-
-    substream_meta_ = new MetaData();
-    if (substream_meta_ == NULL) {
-        ALOGE("Failed to allocate MetaData structure for AAC substream");
-        return false;
-    }
-
-    substream_meta_->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_AAC);
-    substream_meta_->setInt32  (kKeySampleRate,   sample_rate);
-    substream_meta_->setInt32  (kKeyChannelCount, channel_cnt);
-
-    if (esds_data) {
-        substream_meta_->setData(kKeyESDS, kTypeESDS,
-                                 esds_data, esds_data_size);
-    }
-
-    return true;
-}
-
-void AAH_RXPlayer::Substream::processTSTransform(const LinearTransform& trans) {
-    if (decoder_ != NULL) {
-        decoder_->setRenderTSTransform(trans);
-    }
-}
-
-bool AAH_RXPlayer::Substream::isAboutToUnderflow() {
-    if (decoder_ == NULL) {
-        return false;
-    }
-
-    return decoder_->isAboutToUnderflow(kAboutToUnderflowThreshold);
-}
-
-bool AAH_RXPlayer::Substream::setupSubstreamType(uint8_t substream_type,
-                                                 uint8_t codec_type) {
-    // Sanity check the codec type.  Right now we only support MP3 and AAC.
-    // Also check for conflicts with previously delivered codec types.
-    if (substream_details_known_) {
-        if (codec_type != codec_type_) {
-            ALOGV("RXed TRTP Payload for SSRC=0x%08x where codec type (%u) does"
-                  " not match previously received codec type (%u)",
-                 ssrc_, codec_type, codec_type_);
-            return false;
-        }
-
-        return true;
-    }
-
-    switch (codec_type) {
-        // MP3 and AAC are all we support right now.
-        case TRTPAudioPacket::kCodecMPEG1Audio:
-        case TRTPAudioPacket::kCodecAACAudio:
-            break;
-
-        default:
-            ALOGV("RXed TRTP Audio Payload for SSRC=0x%08x with unsupported"
-                  " codec type (%u)", ssrc_, codec_type);
-            return false;
-    }
-
-    substream_type_ = substream_type;
-    codec_type_ = codec_type;
-    substream_details_known_ = true;
-
-    return true;
-}
-
-}  // namespace android
diff --git a/media/libaah_rtp/aah_tx_packet.cpp b/media/libaah_rtp/aah_tx_packet.cpp
deleted file mode 100644
index 4cd6e47..0000000
--- a/media/libaah_rtp/aah_tx_packet.cpp
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-#include <utils/Log.h>
-
-#include <arpa/inet.h>
-#include <string.h>
-
-#include <media/stagefright/foundation/ADebug.h>
-
-#include "aah_tx_packet.h"
-
-namespace android {
-
-const int TRTPPacket::kRTPHeaderLen;
-const uint32_t TRTPPacket::kTRTPEpochMask;
-
-TRTPPacket::~TRTPPacket() {
-    delete mPacket;
-}
-
-/*** TRTP packet properties ***/
-
-void TRTPPacket::setSeqNumber(uint16_t val) {
-    mSeqNumber = val;
-
-    if (mIsPacked) {
-        const int kTRTPSeqNumberOffset = 2;
-        uint16_t* buf = reinterpret_cast<uint16_t*>(
-            mPacket + kTRTPSeqNumberOffset);
-        *buf = htons(mSeqNumber);
-    }
-}
-
-uint16_t TRTPPacket::getSeqNumber() const {
-    return mSeqNumber;
-}
-
-void TRTPPacket::setPTS(int64_t val) {
-    CHECK(!mIsPacked);
-    mPTS = val;
-    mPTSValid = true;
-}
-
-int64_t TRTPPacket::getPTS() const {
-    return mPTS;
-}
-
-void TRTPPacket::setEpoch(uint32_t val) {
-    mEpoch = val;
-
-    if (mIsPacked) {
-        const int kTRTPEpochOffset = 8;
-        uint32_t* buf = reinterpret_cast<uint32_t*>(
-            mPacket + kTRTPEpochOffset);
-        uint32_t val = ntohl(*buf);
-        val &= ~(kTRTPEpochMask << kTRTPEpochShift);
-        val |= (mEpoch & kTRTPEpochMask) << kTRTPEpochShift;
-        *buf = htonl(val);
-    }
-}
-
-void TRTPPacket::setProgramID(uint16_t val) {
-    CHECK(!mIsPacked);
-    mProgramID = val;
-}
-
-void TRTPPacket::setSubstreamID(uint16_t val) {
-    CHECK(!mIsPacked);
-    mSubstreamID = val;
-}
-
-
-void TRTPPacket::setClockTransform(const LinearTransform& trans) {
-    CHECK(!mIsPacked);
-    mClockTranform = trans;
-    mClockTranformValid = true;
-}
-
-uint8_t* TRTPPacket::getPacket() const {
-    CHECK(mIsPacked);
-    return mPacket;
-}
-
-int TRTPPacket::getPacketLen() const {
-    CHECK(mIsPacked);
-    return mPacketLen;
-}
-
-void TRTPPacket::setExpireTime(nsecs_t val) {
-    CHECK(!mIsPacked);
-    mExpireTime = val;
-}
-
-nsecs_t TRTPPacket::getExpireTime() const {
-    return mExpireTime;
-}
-
-/*** TRTP audio packet properties ***/
-
-void TRTPAudioPacket::setCodecType(TRTPAudioCodecType val) {
-    CHECK(!mIsPacked);
-    mCodecType = val;
-}
-
-void TRTPAudioPacket::setRandomAccessPoint(bool val) {
-    CHECK(!mIsPacked);
-    mRandomAccessPoint = val;
-}
-
-void TRTPAudioPacket::setDropable(bool val) {
-    CHECK(!mIsPacked);
-    mDropable = val;
-}
-
-void TRTPAudioPacket::setDiscontinuity(bool val) {
-    CHECK(!mIsPacked);
-    mDiscontinuity = val;
-}
-
-void TRTPAudioPacket::setEndOfStream(bool val) {
-    CHECK(!mIsPacked);
-    mEndOfStream = val;
-}
-
-void TRTPAudioPacket::setVolume(uint8_t val) {
-    CHECK(!mIsPacked);
-    mVolume = val;
-}
-
-void TRTPAudioPacket::setAccessUnitData(const void* data, size_t len) {
-    CHECK(!mIsPacked);
-    mAccessUnitData = data;
-    mAccessUnitLen = len;
-}
-
-void TRTPAudioPacket::setAuxData(const void* data, size_t len) {
-    CHECK(!mIsPacked);
-    mAuxData = data;
-    mAuxDataLen = len;
-}
-
-/*** TRTP control packet properties ***/
-
-void TRTPControlPacket::setCommandID(TRTPCommandID val) {
-    CHECK(!mIsPacked);
-    mCommandID = val;
-}
-
-/*** TRTP packet serializers ***/
-
-void TRTPPacket::writeU8(uint8_t*& buf, uint8_t val) {
-    *buf = val;
-    buf++;
-}
-
-void TRTPPacket::writeU16(uint8_t*& buf, uint16_t val) {
-    *reinterpret_cast<uint16_t*>(buf) = htons(val);
-    buf += 2;
-}
-
-void TRTPPacket::writeU32(uint8_t*& buf, uint32_t val) {
-    *reinterpret_cast<uint32_t*>(buf) = htonl(val);
-    buf += 4;
-}
-
-void TRTPPacket::writeU64(uint8_t*& buf, uint64_t val) {
-    buf[0] = static_cast<uint8_t>(val >> 56);
-    buf[1] = static_cast<uint8_t>(val >> 48);
-    buf[2] = static_cast<uint8_t>(val >> 40);
-    buf[3] = static_cast<uint8_t>(val >> 32);
-    buf[4] = static_cast<uint8_t>(val >> 24);
-    buf[5] = static_cast<uint8_t>(val >> 16);
-    buf[6] = static_cast<uint8_t>(val >>  8);
-    buf[7] = static_cast<uint8_t>(val);
-    buf += 8;
-}
-
-void TRTPPacket::writeTRTPHeader(uint8_t*& buf,
-                                 bool isFirstFragment,
-                                 int totalPacketLen) {
-    // RTP header
-    writeU8(buf,
-            ((mVersion & 0x03) << 6) |
-            (static_cast<int>(mPadding) << 5) |
-            (static_cast<int>(mExtension) << 4) |
-            (mCsrcCount & 0x0F));
-    writeU8(buf,
-            (static_cast<int>(isFirstFragment) << 7) |
-            (mPayloadType & 0x7F));
-    writeU16(buf, mSeqNumber);
-    if (isFirstFragment && mPTSValid) {
-        writeU32(buf, mPTS & 0xFFFFFFFF);
-    } else {
-        writeU32(buf, 0);
-    }
-    writeU32(buf,
-            ((mEpoch & kTRTPEpochMask) << kTRTPEpochShift) |
-            ((mProgramID & 0x1F) << 5) |
-            (mSubstreamID & 0x1F));
-
-    // TRTP header
-    writeU8(buf, mTRTPVersion);
-    writeU8(buf,
-            ((mTRTPHeaderType & 0x0F) << 4) |
-            (mClockTranformValid ? 0x02 : 0x00) |
-            (mPTSValid ? 0x01 : 0x00));
-    writeU32(buf, totalPacketLen - kRTPHeaderLen);
-    if (mPTSValid) {
-        writeU32(buf, mPTS >> 32);
-    }
-
-    if (mClockTranformValid) {
-        writeU64(buf, mClockTranform.a_zero);
-        writeU32(buf, mClockTranform.a_to_b_numer);
-        writeU32(buf, mClockTranform.a_to_b_denom);
-        writeU64(buf, mClockTranform.b_zero);
-    }
-}
-
-bool TRTPAudioPacket::pack() {
-    if (mIsPacked) {
-        return false;
-    }
-
-    int packetLen = kRTPHeaderLen +
-                    mAuxDataLen +
-                    mAccessUnitLen +
-                    TRTPHeaderLen();
-
-    // TODO : support multiple fragments
-    const int kMaxUDPPayloadLen = 65507;
-    if (packetLen > kMaxUDPPayloadLen) {
-        return false;
-    }
-
-    mPacket = new uint8_t[packetLen];
-    if (!mPacket) {
-        return false;
-    }
-
-    mPacketLen = packetLen;
-
-    uint8_t* cur = mPacket;
-    bool hasAux = mAuxData && mAuxDataLen;
-    uint8_t flags = (static_cast<int>(hasAux) << 4) |
-                    (static_cast<int>(mRandomAccessPoint) << 3) |
-                    (static_cast<int>(mDropable) << 2) |
-                    (static_cast<int>(mDiscontinuity) << 1) |
-                    (static_cast<int>(mEndOfStream));
-
-    writeTRTPHeader(cur, true, packetLen);
-    writeU8(cur, mCodecType);
-    writeU8(cur, flags);
-    writeU8(cur, mVolume);
-
-    if (hasAux) {
-        writeU32(cur, mAuxDataLen);
-        memcpy(cur, mAuxData, mAuxDataLen);
-        cur += mAuxDataLen;
-    }
-
-    memcpy(cur, mAccessUnitData, mAccessUnitLen);
-
-    mIsPacked = true;
-    return true;
-}
-
-int TRTPPacket::TRTPHeaderLen() const {
-    // 6 bytes for version, payload type, flags and length.  An additional 4 if
-    // there are upper timestamp bits present and another 24 if there is a clock
-    // transformation present.
-    return 6 +
-           (mClockTranformValid ? 24 : 0) +
-           (mPTSValid ? 4 : 0);
-}
-
-int TRTPAudioPacket::TRTPHeaderLen() const {
-    // TRTPPacket::TRTPHeaderLen() for the base TRTPHeader.  3 bytes for audio's
-    // codec type, flags and volume field.  Another 5 bytes if the codec type is
-    // PCM and we are sending sample rate/channel count. as well as however long
-    // the aux data (if present) is.
-
-    int pcmParamLength;
-    switch(mCodecType) {
-        case kCodecPCMBigEndian:
-        case kCodecPCMLittleEndian:
-            pcmParamLength = 5;
-            break;
-
-        default:
-            pcmParamLength = 0;
-            break;
-    }
-
-
-    int auxDataLenField = (NULL != mAuxData) ? sizeof(uint32_t) : 0;
-    return TRTPPacket::TRTPHeaderLen() +
-           3 +
-           auxDataLenField +
-           pcmParamLength;
-}
-
-bool TRTPControlPacket::pack() {
-    if (mIsPacked) {
-        return false;
-    }
-
-    // command packets contain a 2-byte command ID
-    int packetLen = kRTPHeaderLen +
-                    TRTPHeaderLen() +
-                    2;
-
-    mPacket = new uint8_t[packetLen];
-    if (!mPacket) {
-        return false;
-    }
-
-    mPacketLen = packetLen;
-
-    uint8_t* cur = mPacket;
-
-    writeTRTPHeader(cur, true, packetLen);
-    writeU16(cur, mCommandID);
-
-    mIsPacked = true;
-    return true;
-}
-
-}  // namespace android
diff --git a/media/libaah_rtp/aah_tx_packet.h b/media/libaah_rtp/aah_tx_packet.h
deleted file mode 100644
index 7f78ea0..0000000
--- a/media/libaah_rtp/aah_tx_packet.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __AAH_TX_PACKET_H__
-#define __AAH_TX_PACKET_H__
-
-#include <media/stagefright/foundation/ABase.h>
-#include <utils/LinearTransform.h>
-#include <utils/RefBase.h>
-#include <utils/Timers.h>
-
-namespace android {
-
-class TRTPPacket : public RefBase {
-  public:
-    enum TRTPHeaderType {
-        kHeaderTypeAudio = 1,
-        kHeaderTypeVideo = 2,
-        kHeaderTypeSubpicture = 3,
-        kHeaderTypeControl = 4,
-    };
-
-    enum TRTPPayloadFlags {
-        kFlag_TSTransformPresent = 0x02,
-        kFlag_TSValid = 0x01,
-    };
-
-  protected:
-    TRTPPacket(TRTPHeaderType headerType)
-        : mIsPacked(false)
-        , mVersion(2)
-        , mPadding(false)
-        , mExtension(false)
-        , mCsrcCount(0)
-        , mPayloadType(100)
-        , mSeqNumber(0)
-        , mPTSValid(false)
-        , mPTS(0)
-        , mEpoch(0)
-        , mProgramID(0)
-        , mSubstreamID(0)
-        , mClockTranformValid(false)
-        , mTRTPVersion(1)
-        , mTRTPLength(0)
-        , mTRTPHeaderType(headerType)
-        , mPacket(NULL)
-        , mPacketLen(0) { }
-
-  public:
-    virtual ~TRTPPacket();
-
-    void setSeqNumber(uint16_t val);
-    uint16_t getSeqNumber() const;
-
-    void setPTS(int64_t val);
-    int64_t getPTS() const;
-
-    void setEpoch(uint32_t val);
-    void setProgramID(uint16_t val);
-    void setSubstreamID(uint16_t val);
-    void setClockTransform(const LinearTransform& trans);
-
-    uint8_t* getPacket() const;
-    int getPacketLen() const;
-
-    void setExpireTime(nsecs_t val);
-    nsecs_t getExpireTime() const;
-
-    virtual bool pack() = 0;
-
-    // mask for the number of bits in a TRTP epoch
-    static const uint32_t kTRTPEpochMask = (1 << 22) - 1;
-    static const int kTRTPEpochShift = 10;
-
-  protected:
-    static const int kRTPHeaderLen = 12;
-    virtual int TRTPHeaderLen() const;
-
-    void writeTRTPHeader(uint8_t*& buf,
-                         bool isFirstFragment,
-                         int totalPacketLen);
-
-    void writeU8(uint8_t*& buf, uint8_t val);
-    void writeU16(uint8_t*& buf, uint16_t val);
-    void writeU32(uint8_t*& buf, uint32_t val);
-    void writeU64(uint8_t*& buf, uint64_t val);
-
-    bool mIsPacked;
-
-    uint8_t mVersion;
-    bool mPadding;
-    bool mExtension;
-    uint8_t mCsrcCount;
-    uint8_t mPayloadType;
-    uint16_t mSeqNumber;
-    bool mPTSValid;
-    int64_t  mPTS;
-    uint32_t mEpoch;
-    uint16_t mProgramID;
-    uint16_t mSubstreamID;
-    LinearTransform mClockTranform;
-    bool mClockTranformValid;
-    uint8_t mTRTPVersion;
-    uint32_t mTRTPLength;
-    TRTPHeaderType mTRTPHeaderType;
-
-    uint8_t* mPacket;
-    int mPacketLen;
-
-    nsecs_t mExpireTime;
-
-    DISALLOW_EVIL_CONSTRUCTORS(TRTPPacket);
-};
-
-class TRTPAudioPacket : public TRTPPacket {
-  public:
-    enum AudioPayloadFlags {
-        kFlag_AuxLengthPresent = 0x10,
-        kFlag_RandomAccessPoint = 0x08,
-        kFlag_Dropable = 0x04,
-        kFlag_Discontinuity = 0x02,
-        kFlag_EndOfStream = 0x01,
-    };
-
-    TRTPAudioPacket()
-        : TRTPPacket(kHeaderTypeAudio)
-        , mCodecType(kCodecInvalid)
-        , mRandomAccessPoint(false)
-        , mDropable(false)
-        , mDiscontinuity(false)
-        , mEndOfStream(false)
-        , mVolume(0)
-        , mAccessUnitData(NULL)
-        , mAccessUnitLen(0)
-        , mAuxData(NULL)
-        , mAuxDataLen(0) { }
-
-    enum TRTPAudioCodecType {
-        kCodecInvalid = 0,
-        kCodecPCMBigEndian = 1,
-        kCodecPCMLittleEndian = 2,
-        kCodecMPEG1Audio = 3,
-        kCodecAACAudio = 4,
-    };
-
-    void setCodecType(TRTPAudioCodecType val);
-    void setRandomAccessPoint(bool val);
-    void setDropable(bool val);
-    void setDiscontinuity(bool val);
-    void setEndOfStream(bool val);
-    void setVolume(uint8_t val);
-    void setAccessUnitData(const void* data, size_t len);
-    void setAuxData(const void* data, size_t len);
-
-    virtual bool pack();
-
-  protected:
-    virtual int TRTPHeaderLen() const;
-
-  private:
-    TRTPAudioCodecType mCodecType;
-    bool mRandomAccessPoint;
-    bool mDropable;
-    bool mDiscontinuity;
-    bool mEndOfStream;
-    uint8_t mVolume;
-
-    const void* mAccessUnitData;
-    size_t mAccessUnitLen;
-    const void* mAuxData;
-    size_t mAuxDataLen;
-
-    DISALLOW_EVIL_CONSTRUCTORS(TRTPAudioPacket);
-};
-
-class TRTPControlPacket : public TRTPPacket {
-  public:
-    TRTPControlPacket()
-        : TRTPPacket(kHeaderTypeControl)
-        , mCommandID(kCommandNop) {}
-
-    enum TRTPCommandID {
-        kCommandNop   = 1,
-        kCommandFlush = 2,
-        kCommandEOS   = 3,
-    };
-
-    void setCommandID(TRTPCommandID val);
-
-    virtual bool pack();
-
-  private:
-    TRTPCommandID mCommandID;
-
-    DISALLOW_EVIL_CONSTRUCTORS(TRTPControlPacket);
-};
-
-}  // namespace android
-
-#endif  // __AAH_TX_PLAYER_H__
diff --git a/media/libaah_rtp/aah_tx_player.cpp b/media/libaah_rtp/aah_tx_player.cpp
deleted file mode 100644
index 974805b..0000000
--- a/media/libaah_rtp/aah_tx_player.cpp
+++ /dev/null
@@ -1,1177 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-#include <utils/Log.h>
-
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-#include <netdb.h>
-#include <netinet/ip.h>
-
-#include <common_time/cc_helper.h>
-#include <media/IMediaPlayer.h>
-#include <media/stagefright/foundation/ADebug.h>
-#include <media/stagefright/foundation/AMessage.h>
-#include <media/stagefright/FileSource.h>
-#include <media/stagefright/MediaBuffer.h>
-#include <media/stagefright/MediaDefs.h>
-#include <media/stagefright/MetaData.h>
-#include <utils/Timers.h>
-
-#include "aah_tx_packet.h"
-#include "aah_tx_player.h"
-
-namespace android {
-
-static int64_t kLowWaterMarkUs = 2000000ll;  // 2secs
-static int64_t kHighWaterMarkUs = 10000000ll;  // 10secs
-static const size_t kLowWaterMarkBytes = 40000;
-static const size_t kHighWaterMarkBytes = 200000;
-
-// When we start up, how much lead time should we put on the first access unit?
-static const int64_t kAAHStartupLeadTimeUs = 300000LL;
-
-// How much time do we attempt to lead the clock by in steady state?
-static const int64_t kAAHBufferTimeUs = 1000000LL;
-
-// how long do we keep data in our retransmit buffer after sending it.
-const int64_t AAH_TXPlayer::kAAHRetryKeepAroundTimeNs =
-    kAAHBufferTimeUs * 1100;
-
-sp<MediaPlayerBase> createAAH_TXPlayer() {
-    sp<MediaPlayerBase> ret = new AAH_TXPlayer();
-    return ret;
-}
-
-template <typename T> static T clamp(T val, T min, T max) {
-    if (val < min) {
-        return min;
-    } else if (val > max) {
-        return max;
-    } else {
-        return val;
-    }
-}
-
-struct AAH_TXEvent : public TimedEventQueue::Event {
-    AAH_TXEvent(AAH_TXPlayer *player,
-                void (AAH_TXPlayer::*method)()) : mPlayer(player)
-                                                , mMethod(method) {}
-
-  protected:
-    virtual ~AAH_TXEvent() {}
-
-    virtual void fire(TimedEventQueue *queue, int64_t /* now_us */) {
-        (mPlayer->*mMethod)();
-    }
-
-  private:
-    AAH_TXPlayer *mPlayer;
-    void (AAH_TXPlayer::*mMethod)();
-
-    AAH_TXEvent(const AAH_TXEvent &);
-    AAH_TXEvent& operator=(const AAH_TXEvent &);
-};
-
-AAH_TXPlayer::AAH_TXPlayer()
-        : mQueueStarted(false)
-        , mFlags(0)
-        , mExtractorFlags(0) {
-    DataSource::RegisterDefaultSniffers();
-
-    mBufferingEvent = new AAH_TXEvent(this, &AAH_TXPlayer::onBufferingUpdate);
-    mBufferingEventPending = false;
-
-    mPumpAudioEvent = new AAH_TXEvent(this, &AAH_TXPlayer::onPumpAudio);
-    mPumpAudioEventPending = false;
-
-    mAudioCodecData = NULL;
-
-    reset_l();
-}
-
-AAH_TXPlayer::~AAH_TXPlayer() {
-    if (mQueueStarted) {
-        mQueue.stop();
-    }
-
-    reset_l();
-}
-
-void AAH_TXPlayer::cancelPlayerEvents(bool keepBufferingGoing) {
-    if (!keepBufferingGoing) {
-        mQueue.cancelEvent(mBufferingEvent->eventID());
-        mBufferingEventPending = false;
-
-        mQueue.cancelEvent(mPumpAudioEvent->eventID());
-        mPumpAudioEventPending = false;
-    }
-}
-
-status_t AAH_TXPlayer::initCheck() {
-    // Check for the presense of the common time service by attempting to query
-    // for CommonTime's frequency.  If we get an error back, we cannot talk to
-    // the service at all and should abort now.
-    status_t res;
-    uint64_t freq;
-    res = mCCHelper.getCommonFreq(&freq);
-    if (OK != res) {
-        ALOGE("Failed to connect to common time service! (res %d)", res);
-        return res;
-    }
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::setDataSource(
-        const char *url,
-        const KeyedVector<String8, String8> *headers) {
-    Mutex::Autolock autoLock(mLock);
-    return setDataSource_l(url, headers);
-}
-
-status_t AAH_TXPlayer::setDataSource_l(
-        const char *url,
-        const KeyedVector<String8, String8> *headers) {
-    reset_l();
-
-    mUri.setTo(url);
-
-    if (headers) {
-        mUriHeaders = *headers;
-
-        ssize_t index = mUriHeaders.indexOfKey(String8("x-hide-urls-from-log"));
-        if (index >= 0) {
-            // Browser is in "incognito" mode, suppress logging URLs.
-
-            // This isn't something that should be passed to the server.
-            mUriHeaders.removeItemsAt(index);
-
-            mFlags |= INCOGNITO;
-        }
-    }
-
-    // The URL may optionally contain a "#" character followed by a Skyjam
-    // cookie.  Ideally the cookie header should just be passed in the headers
-    // argument, but the Java API for supplying headers is apparently not yet
-    // exposed in the SDK used by application developers.
-    const char kSkyjamCookieDelimiter = '#';
-    char* skyjamCookie = strrchr(mUri.string(), kSkyjamCookieDelimiter);
-    if (skyjamCookie) {
-        skyjamCookie++;
-        mUriHeaders.add(String8("Cookie"), String8(skyjamCookie));
-        mUri = String8(mUri.string(), skyjamCookie - mUri.string());
-    }
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::setDataSource(int fd, int64_t offset, int64_t length) {
-    Mutex::Autolock autoLock(mLock);
-
-    reset_l();
-
-    sp<DataSource> dataSource = new FileSource(dup(fd), offset, length);
-
-    status_t err = dataSource->initCheck();
-
-    if (err != OK) {
-        return err;
-    }
-
-    mFileSource = dataSource;
-
-    sp<MediaExtractor> extractor = MediaExtractor::Create(dataSource);
-
-    if (extractor == NULL) {
-        return UNKNOWN_ERROR;
-    }
-
-    return setDataSource_l(extractor);
-}
-
-status_t AAH_TXPlayer::setVideoSurface(const sp<Surface>& surface) {
-    return OK;
-}
-
-status_t AAH_TXPlayer::setVideoSurfaceTexture(
-        const sp<ISurfaceTexture>& surfaceTexture) {
-    return OK;
-}
-
-status_t AAH_TXPlayer::prepare() {
-    return INVALID_OPERATION;
-}
-
-status_t AAH_TXPlayer::prepareAsync() {
-    Mutex::Autolock autoLock(mLock);
-
-    return prepareAsync_l();
-}
-
-status_t AAH_TXPlayer::prepareAsync_l() {
-    if (mFlags & PREPARING) {
-        return UNKNOWN_ERROR;  // async prepare already pending
-    }
-
-    mAAH_Sender = AAH_TXSender::GetInstance();
-    if (mAAH_Sender == NULL) {
-        return NO_MEMORY;
-    }
-
-    if (!mQueueStarted) {
-        mQueue.start();
-        mQueueStarted = true;
-    }
-
-    mFlags |= PREPARING;
-    mAsyncPrepareEvent = new AAH_TXEvent(
-            this, &AAH_TXPlayer::onPrepareAsyncEvent);
-
-    mQueue.postEvent(mAsyncPrepareEvent);
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::finishSetDataSource_l() {
-    sp<DataSource> dataSource;
-
-    if (!strncasecmp("http://",  mUri.string(), 7) ||
-        !strncasecmp("https://", mUri.string(), 8)) {
-
-        mConnectingDataSource = HTTPBase::Create(
-                (mFlags & INCOGNITO)
-                    ? HTTPBase::kFlagIncognito
-                    : 0);
-
-        mLock.unlock();
-        status_t err = mConnectingDataSource->connect(mUri, &mUriHeaders);
-        mLock.lock();
-
-        if (err != OK) {
-            mConnectingDataSource.clear();
-
-            ALOGI("mConnectingDataSource->connect() returned %d", err);
-            return err;
-        }
-
-        mCachedSource = new NuCachedSource2(mConnectingDataSource);
-        mConnectingDataSource.clear();
-
-        dataSource = mCachedSource;
-
-        // We're going to prefill the cache before trying to instantiate
-        // the extractor below, as the latter is an operation that otherwise
-        // could block on the datasource for a significant amount of time.
-        // During that time we'd be unable to abort the preparation phase
-        // without this prefill.
-
-        mLock.unlock();
-
-        for (;;) {
-            status_t finalStatus;
-            size_t cachedDataRemaining =
-                mCachedSource->approxDataRemaining(&finalStatus);
-
-            if (finalStatus != OK ||
-                cachedDataRemaining >= kHighWaterMarkBytes ||
-                (mFlags & PREPARE_CANCELLED)) {
-                break;
-            }
-
-            usleep(200000);
-        }
-
-        mLock.lock();
-
-        if (mFlags & PREPARE_CANCELLED) {
-            ALOGI("Prepare cancelled while waiting for initial cache fill.");
-            return UNKNOWN_ERROR;
-        }
-    } else {
-        dataSource = DataSource::CreateFromURI(mUri.string(), &mUriHeaders);
-    }
-
-    if (dataSource == NULL) {
-        return UNKNOWN_ERROR;
-    }
-
-    sp<MediaExtractor> extractor = MediaExtractor::Create(dataSource);
-
-    if (extractor == NULL) {
-        return UNKNOWN_ERROR;
-    }
-
-    return setDataSource_l(extractor);
-}
-
-status_t AAH_TXPlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
-    // Attempt to approximate overall stream bitrate by summing all
-    // tracks' individual bitrates, if not all of them advertise bitrate,
-    // we have to fail.
-
-    int64_t totalBitRate = 0;
-
-    for (size_t i = 0; i < extractor->countTracks(); ++i) {
-        sp<MetaData> meta = extractor->getTrackMetaData(i);
-
-        int32_t bitrate;
-        if (!meta->findInt32(kKeyBitRate, &bitrate)) {
-            totalBitRate = -1;
-            break;
-        }
-
-        totalBitRate += bitrate;
-    }
-
-    mBitrate = totalBitRate;
-
-    ALOGV("mBitrate = %lld bits/sec", mBitrate);
-
-    bool haveAudio = false;
-    for (size_t i = 0; i < extractor->countTracks(); ++i) {
-        sp<MetaData> meta = extractor->getTrackMetaData(i);
-
-        const char *mime;
-        CHECK(meta->findCString(kKeyMIMEType, &mime));
-
-        if (!strncasecmp(mime, "audio/", 6)) {
-            mAudioSource = extractor->getTrack(i);
-            CHECK(mAudioSource != NULL);
-            haveAudio = true;
-            break;
-        }
-    }
-
-    if (!haveAudio) {
-        return UNKNOWN_ERROR;
-    }
-
-    mExtractorFlags = extractor->flags();
-
-    return OK;
-}
-
-void AAH_TXPlayer::abortPrepare(status_t err) {
-    CHECK(err != OK);
-
-    notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, err);
-
-    mPrepareResult = err;
-    mFlags &= ~(PREPARING|PREPARE_CANCELLED|PREPARING_CONNECTED);
-    mPreparedCondition.broadcast();
-}
-
-void AAH_TXPlayer::onPrepareAsyncEvent() {
-    Mutex::Autolock autoLock(mLock);
-
-    if (mFlags & PREPARE_CANCELLED) {
-        ALOGI("prepare was cancelled before doing anything");
-        abortPrepare(UNKNOWN_ERROR);
-        return;
-    }
-
-    if (mUri.size() > 0) {
-        status_t err = finishSetDataSource_l();
-
-        if (err != OK) {
-            abortPrepare(err);
-            return;
-        }
-    }
-
-    mAudioFormat = mAudioSource->getFormat();
-    if (!mAudioFormat->findInt64(kKeyDuration, &mDurationUs))
-        mDurationUs = 1;
-
-    const char* mime_type = NULL;
-    if (!mAudioFormat->findCString(kKeyMIMEType, &mime_type)) {
-        ALOGE("Failed to find audio substream MIME type during prepare.");
-        abortPrepare(BAD_VALUE);
-        return;
-    }
-
-    if (!strcmp(mime_type, MEDIA_MIMETYPE_AUDIO_MPEG)) {
-        mAudioCodec = TRTPAudioPacket::kCodecMPEG1Audio;
-    } else
-    if (!strcmp(mime_type, MEDIA_MIMETYPE_AUDIO_AAC)) {
-        mAudioCodec = TRTPAudioPacket::kCodecAACAudio;
-
-        uint32_t type;
-        int32_t  sample_rate;
-        int32_t  channel_count;
-        const void* esds_data;
-        size_t esds_len;
-
-        if (!mAudioFormat->findInt32(kKeySampleRate, &sample_rate)) {
-            ALOGE("Failed to find sample rate for AAC substream.");
-            abortPrepare(BAD_VALUE);
-            return;
-        }
-
-        if (!mAudioFormat->findInt32(kKeyChannelCount, &channel_count)) {
-            ALOGE("Failed to find channel count for AAC substream.");
-            abortPrepare(BAD_VALUE);
-            return;
-        }
-
-        if (!mAudioFormat->findData(kKeyESDS, &type, &esds_data, &esds_len)) {
-            ALOGE("Failed to find codec init data for AAC substream.");
-            abortPrepare(BAD_VALUE);
-            return;
-        }
-
-        CHECK(NULL == mAudioCodecData);
-        mAudioCodecDataSize = esds_len
-                            + sizeof(sample_rate)
-                            + sizeof(channel_count);
-        mAudioCodecData = new uint8_t[mAudioCodecDataSize];
-        if (NULL == mAudioCodecData) {
-            ALOGE("Failed to allocate %u bytes for AAC substream codec aux"
-                  " data.", mAudioCodecDataSize);
-            mAudioCodecDataSize = 0;
-            abortPrepare(BAD_VALUE);
-            return;
-        }
-
-        uint8_t* tmp = mAudioCodecData;
-        tmp[0] = static_cast<uint8_t>((sample_rate   >> 24) & 0xFF);
-        tmp[1] = static_cast<uint8_t>((sample_rate   >> 16) & 0xFF);
-        tmp[2] = static_cast<uint8_t>((sample_rate   >>  8) & 0xFF);
-        tmp[3] = static_cast<uint8_t>((sample_rate        ) & 0xFF);
-        tmp[4] = static_cast<uint8_t>((channel_count >> 24) & 0xFF);
-        tmp[5] = static_cast<uint8_t>((channel_count >> 16) & 0xFF);
-        tmp[6] = static_cast<uint8_t>((channel_count >>  8) & 0xFF);
-        tmp[7] = static_cast<uint8_t>((channel_count      ) & 0xFF);
-
-        memcpy(tmp + 8, esds_data, esds_len);
-    } else {
-        ALOGE("Unsupported MIME type \"%s\" in audio substream", mime_type);
-        abortPrepare(BAD_VALUE);
-        return;
-    }
-
-    status_t err = mAudioSource->start();
-    if (err != OK) {
-        ALOGI("failed to start audio source, err=%d", err);
-        abortPrepare(err);
-        return;
-    }
-
-    mFlags |= PREPARING_CONNECTED;
-
-    if (mCachedSource != NULL) {
-        postBufferingEvent_l();
-    } else {
-        finishAsyncPrepare_l();
-    }
-}
-
-void AAH_TXPlayer::finishAsyncPrepare_l() {
-    notifyListener_l(MEDIA_PREPARED);
-
-    mPrepareResult = OK;
-    mFlags &= ~(PREPARING|PREPARE_CANCELLED|PREPARING_CONNECTED);
-    mFlags |= PREPARED;
-    mPreparedCondition.broadcast();
-}
-
-status_t AAH_TXPlayer::start() {
-    Mutex::Autolock autoLock(mLock);
-
-    mFlags &= ~CACHE_UNDERRUN;
-
-    return play_l();
-}
-
-status_t AAH_TXPlayer::play_l() {
-    if (mFlags & PLAYING) {
-        return OK;
-    }
-
-    if (!(mFlags & PREPARED)) {
-        return INVALID_OPERATION;
-    }
-
-    {
-        Mutex::Autolock lock(mEndpointLock);
-        if (!mEndpointValid) {
-            return INVALID_OPERATION;
-        }
-        if (!mEndpointRegistered) {
-            mProgramID = mAAH_Sender->registerEndpoint(mEndpoint);
-            mEndpointRegistered = true;
-        }
-    }
-
-    mFlags |= PLAYING;
-
-    updateClockTransform_l(false);
-
-    postPumpAudioEvent_l(-1);
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::stop() {
-    status_t ret = pause();
-    sendEOS_l();
-    return ret;
-}
-
-status_t AAH_TXPlayer::pause() {
-    Mutex::Autolock autoLock(mLock);
-
-    mFlags &= ~CACHE_UNDERRUN;
-
-    return pause_l();
-}
-
-status_t AAH_TXPlayer::pause_l(bool doClockUpdate) {
-    if (!(mFlags & PLAYING)) {
-        return OK;
-    }
-
-    cancelPlayerEvents(true /* keepBufferingGoing */);
-
-    mFlags &= ~PLAYING;
-
-    if (doClockUpdate) {
-        updateClockTransform_l(true);
-    }
-
-    return OK;
-}
-
-void AAH_TXPlayer::updateClockTransform_l(bool pause) {
-    // record the new pause status so that onPumpAudio knows what rate to apply
-    // when it initializes the transform
-    mPlayRateIsPaused = pause;
-
-    // if we haven't yet established a valid clock transform, then we can't
-    // do anything here
-    if (!mCurrentClockTransformValid) {
-        return;
-    }
-
-    // sample the current common time
-    int64_t commonTimeNow;
-    if (OK != mCCHelper.getCommonTime(&commonTimeNow)) {
-        ALOGE("updateClockTransform_l get common time failed");
-        mCurrentClockTransformValid = false;
-        return;
-    }
-
-    // convert the current common time to media time using the old
-    // transform
-    int64_t mediaTimeNow;
-    if (!mCurrentClockTransform.doReverseTransform(
-            commonTimeNow, &mediaTimeNow)) {
-        ALOGE("updateClockTransform_l reverse transform failed");
-        mCurrentClockTransformValid = false;
-        return;
-    }
-
-    // calculate a new transform that preserves the old transform's
-    // result for the current time
-    mCurrentClockTransform.a_zero = mediaTimeNow;
-    mCurrentClockTransform.b_zero = commonTimeNow;
-    mCurrentClockTransform.a_to_b_numer = 1;
-    mCurrentClockTransform.a_to_b_denom = pause ? 0 : 1;
-
-    // send a packet announcing the new transform
-    sp<TRTPControlPacket> packet = new TRTPControlPacket();
-    packet->setClockTransform(mCurrentClockTransform);
-    packet->setCommandID(TRTPControlPacket::kCommandNop);
-    queuePacketToSender_l(packet);
-}
-
-void AAH_TXPlayer::sendEOS_l() {
-    sp<TRTPControlPacket> packet = new TRTPControlPacket();
-    packet->setCommandID(TRTPControlPacket::kCommandEOS);
-    queuePacketToSender_l(packet);
-}
-
-bool AAH_TXPlayer::isPlaying() {
-    return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN);
-}
-
-status_t AAH_TXPlayer::seekTo(int msec) {
-    if (mExtractorFlags & MediaExtractor::CAN_SEEK) {
-        Mutex::Autolock autoLock(mLock);
-        return seekTo_l(static_cast<int64_t>(msec) * 1000);
-    }
-
-    notifyListener_l(MEDIA_SEEK_COMPLETE);
-    return OK;
-}
-
-status_t AAH_TXPlayer::seekTo_l(int64_t timeUs) {
-    mIsSeeking = true;
-    mSeekTimeUs = timeUs;
-
-    mCurrentClockTransformValid = false;
-    mLastQueuedMediaTimePTSValid = false;
-
-    // send a flush command packet
-    sp<TRTPControlPacket> packet = new TRTPControlPacket();
-    packet->setCommandID(TRTPControlPacket::kCommandFlush);
-    queuePacketToSender_l(packet);
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::getCurrentPosition(int *msec) {
-    if (!msec) {
-        return BAD_VALUE;
-    }
-
-    Mutex::Autolock lock(mLock);
-
-    int position;
-
-    if (mIsSeeking) {
-        position = mSeekTimeUs / 1000;
-    } else if (mCurrentClockTransformValid) {
-        // sample the current common time
-        int64_t commonTimeNow;
-        if (OK != mCCHelper.getCommonTime(&commonTimeNow)) {
-            ALOGE("getCurrentPosition get common time failed");
-            return INVALID_OPERATION;
-        }
-
-        int64_t mediaTimeNow;
-        if (!mCurrentClockTransform.doReverseTransform(commonTimeNow,
-                    &mediaTimeNow)) {
-            ALOGE("getCurrentPosition reverse transform failed");
-            return INVALID_OPERATION;
-        }
-
-        position = static_cast<int>(mediaTimeNow / 1000);
-    } else {
-        position = 0;
-    }
-
-    int duration;
-    if (getDuration_l(&duration) == OK) {
-        *msec = clamp(position, 0, duration);
-    } else {
-        *msec = (position >= 0) ? position : 0;
-    }
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::getDuration(int* msec) {
-    if (!msec) {
-        return BAD_VALUE;
-    }
-
-    Mutex::Autolock lock(mLock);
-
-    return getDuration_l(msec);
-}
-
-status_t AAH_TXPlayer::getDuration_l(int* msec) {
-    if (mDurationUs < 0) {
-        return UNKNOWN_ERROR;
-    }
-
-    *msec = (mDurationUs + 500) / 1000;
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::reset() {
-    Mutex::Autolock autoLock(mLock);
-    reset_l();
-    return OK;
-}
-
-void AAH_TXPlayer::reset_l() {
-    if (mFlags & PREPARING) {
-        mFlags |= PREPARE_CANCELLED;
-        if (mConnectingDataSource != NULL) {
-            ALOGI("interrupting the connection process");
-            mConnectingDataSource->disconnect();
-        }
-
-        if (mFlags & PREPARING_CONNECTED) {
-            // We are basically done preparing, we're just buffering
-            // enough data to start playback, we can safely interrupt that.
-            finishAsyncPrepare_l();
-        }
-    }
-
-    while (mFlags & PREPARING) {
-        mPreparedCondition.wait(mLock);
-    }
-
-    cancelPlayerEvents();
-
-    sendEOS_l();
-
-    mCachedSource.clear();
-
-    if (mAudioSource != NULL) {
-        mAudioSource->stop();
-    }
-    mAudioSource.clear();
-    mAudioCodec = TRTPAudioPacket::kCodecInvalid;
-    mAudioFormat = NULL;
-    delete[] mAudioCodecData;
-    mAudioCodecData = NULL;
-    mAudioCodecDataSize = 0;
-
-    mFlags = 0;
-    mExtractorFlags = 0;
-
-    mDurationUs = -1;
-    mIsSeeking = false;
-    mSeekTimeUs = 0;
-
-    mUri.setTo("");
-    mUriHeaders.clear();
-
-    mFileSource.clear();
-
-    mBitrate = -1;
-
-    {
-        Mutex::Autolock lock(mEndpointLock);
-        if (mAAH_Sender != NULL && mEndpointRegistered) {
-            mAAH_Sender->unregisterEndpoint(mEndpoint);
-        }
-        mEndpointRegistered = false;
-        mEndpointValid = false;
-    }
-
-    mProgramID = 0;
-
-    mAAH_Sender.clear();
-    mLastQueuedMediaTimePTSValid = false;
-    mCurrentClockTransformValid = false;
-    mPlayRateIsPaused = false;
-
-    mTRTPVolume = 255;
-}
-
-status_t AAH_TXPlayer::setLooping(int loop) {
-    return OK;
-}
-
-player_type AAH_TXPlayer::playerType() {
-    return AAH_TX_PLAYER;
-}
-
-status_t AAH_TXPlayer::setParameter(int key, const Parcel &request) {
-    return ERROR_UNSUPPORTED;
-}
-
-status_t AAH_TXPlayer::getParameter(int key, Parcel *reply) {
-    return ERROR_UNSUPPORTED;
-}
-
-status_t AAH_TXPlayer::invoke(const Parcel& request, Parcel *reply) {
-    return INVALID_OPERATION;
-}
-
-status_t AAH_TXPlayer::getMetadata(const media::Metadata::Filter& ids,
-                                   Parcel* records) {
-    using media::Metadata;
-
-    Metadata metadata(records);
-
-    metadata.appendBool(Metadata::kPauseAvailable, true);
-    metadata.appendBool(Metadata::kSeekBackwardAvailable, false);
-    metadata.appendBool(Metadata::kSeekForwardAvailable, false);
-    metadata.appendBool(Metadata::kSeekAvailable, false);
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::setVolume(float leftVolume, float rightVolume) {
-    if (leftVolume != rightVolume) {
-        ALOGE("%s does not support per channel volume: %f, %f",
-              __PRETTY_FUNCTION__, leftVolume, rightVolume);
-    }
-
-    float volume = clamp(leftVolume, 0.0f, 1.0f);
-
-    Mutex::Autolock lock(mLock);
-    mTRTPVolume = static_cast<uint8_t>((leftVolume * 255.0) + 0.5);
-
-    return OK;
-}
-
-status_t AAH_TXPlayer::setAudioStreamType(audio_stream_type_t streamType) {
-    return OK;
-}
-
-status_t AAH_TXPlayer::setRetransmitEndpoint(
-        const struct sockaddr_in* endpoint) {
-    Mutex::Autolock lock(mLock);
-
-    if (NULL == endpoint)
-        return BAD_VALUE;
-
-    // Once the endpoint has been registered, it may not be changed.
-    if (mEndpointRegistered)
-        return INVALID_OPERATION;
-
-    mEndpoint.addr = endpoint->sin_addr.s_addr;
-    mEndpoint.port = endpoint->sin_port;
-    mEndpointValid = true;
-
-    return OK;
-}
-
-void AAH_TXPlayer::notifyListener_l(int msg, int ext1, int ext2) {
-    sendEvent(msg, ext1, ext2);
-}
-
-bool AAH_TXPlayer::getBitrate_l(int64_t *bitrate) {
-    off64_t size;
-    if (mDurationUs >= 0 &&
-        mCachedSource != NULL &&
-        mCachedSource->getSize(&size) == OK) {
-        *bitrate = size * 8000000ll / mDurationUs;  // in bits/sec
-        return true;
-    }
-
-    if (mBitrate >= 0) {
-        *bitrate = mBitrate;
-        return true;
-    }
-
-    *bitrate = 0;
-
-    return false;
-}
-
-// Returns true iff cached duration is available/applicable.
-bool AAH_TXPlayer::getCachedDuration_l(int64_t *durationUs, bool *eos) {
-    int64_t bitrate;
-
-    if (mCachedSource != NULL && getBitrate_l(&bitrate)) {
-        status_t finalStatus;
-        size_t cachedDataRemaining = mCachedSource->approxDataRemaining(
-                                        &finalStatus);
-        *durationUs = cachedDataRemaining * 8000000ll / bitrate;
-        *eos = (finalStatus != OK);
-        return true;
-    }
-
-    return false;
-}
-
-void AAH_TXPlayer::ensureCacheIsFetching_l() {
-    if (mCachedSource != NULL) {
-        mCachedSource->resumeFetchingIfNecessary();
-    }
-}
-
-void AAH_TXPlayer::postBufferingEvent_l() {
-    if (mBufferingEventPending) {
-        return;
-    }
-    mBufferingEventPending = true;
-    mQueue.postEventWithDelay(mBufferingEvent, 1000000ll);
-}
-
-void AAH_TXPlayer::postPumpAudioEvent_l(int64_t delayUs) {
-    if (mPumpAudioEventPending) {
-        return;
-    }
-    mPumpAudioEventPending = true;
-    mQueue.postEventWithDelay(mPumpAudioEvent, delayUs < 0 ? 10000 : delayUs);
-}
-
-void AAH_TXPlayer::onBufferingUpdate() {
-    Mutex::Autolock autoLock(mLock);
-    if (!mBufferingEventPending) {
-        return;
-    }
-    mBufferingEventPending = false;
-
-    if (mCachedSource != NULL) {
-        status_t finalStatus;
-        size_t cachedDataRemaining = mCachedSource->approxDataRemaining(
-                                        &finalStatus);
-        bool eos = (finalStatus != OK);
-
-        if (eos) {
-            if (finalStatus == ERROR_END_OF_STREAM) {
-                notifyListener_l(MEDIA_BUFFERING_UPDATE, 100);
-            }
-            if (mFlags & PREPARING) {
-                ALOGV("cache has reached EOS, prepare is done.");
-                finishAsyncPrepare_l();
-            }
-        } else {
-            int64_t bitrate;
-            if (getBitrate_l(&bitrate)) {
-                size_t cachedSize = mCachedSource->cachedSize();
-                int64_t cachedDurationUs = cachedSize * 8000000ll / bitrate;
-
-                int percentage = (100.0 * (double) cachedDurationUs)
-                               / mDurationUs;
-                if (percentage > 100) {
-                    percentage = 100;
-                }
-
-                notifyListener_l(MEDIA_BUFFERING_UPDATE, percentage);
-            } else {
-                // We don't know the bitrate of the stream, use absolute size
-                // limits to maintain the cache.
-
-                if ((mFlags & PLAYING) &&
-                    !eos &&
-                    (cachedDataRemaining < kLowWaterMarkBytes)) {
-                    ALOGI("cache is running low (< %d) , pausing.",
-                          kLowWaterMarkBytes);
-                    mFlags |= CACHE_UNDERRUN;
-                    pause_l();
-                    ensureCacheIsFetching_l();
-                    notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
-                } else if (eos || cachedDataRemaining > kHighWaterMarkBytes) {
-                    if (mFlags & CACHE_UNDERRUN) {
-                        ALOGI("cache has filled up (> %d), resuming.",
-                              kHighWaterMarkBytes);
-                        mFlags &= ~CACHE_UNDERRUN;
-                        play_l();
-                        notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_END);
-                    } else if (mFlags & PREPARING) {
-                        ALOGV("cache has filled up (> %d), prepare is done",
-                              kHighWaterMarkBytes);
-                        finishAsyncPrepare_l();
-                    }
-                }
-            }
-        }
-    }
-
-    int64_t cachedDurationUs;
-    bool eos;
-    if (getCachedDuration_l(&cachedDurationUs, &eos)) {
-        ALOGV("cachedDurationUs = %.2f secs, eos=%d",
-              cachedDurationUs / 1E6, eos);
-
-        if ((mFlags & PLAYING) &&
-            !eos &&
-            (cachedDurationUs < kLowWaterMarkUs)) {
-            ALOGI("cache is running low (%.2f secs) , pausing.",
-                  cachedDurationUs / 1E6);
-            mFlags |= CACHE_UNDERRUN;
-            pause_l();
-            ensureCacheIsFetching_l();
-            notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
-        } else if (eos || cachedDurationUs > kHighWaterMarkUs) {
-            if (mFlags & CACHE_UNDERRUN) {
-                ALOGI("cache has filled up (%.2f secs), resuming.",
-                      cachedDurationUs / 1E6);
-                mFlags &= ~CACHE_UNDERRUN;
-                play_l();
-                notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_END);
-            } else if (mFlags & PREPARING) {
-                ALOGV("cache has filled up (%.2f secs), prepare is done",
-                        cachedDurationUs / 1E6);
-                finishAsyncPrepare_l();
-            }
-        }
-    }
-
-    postBufferingEvent_l();
-}
-
-void AAH_TXPlayer::onPumpAudio() {
-    while (true) {
-        Mutex::Autolock autoLock(mLock);
-        // If this flag is clear, its because someone has externally canceled
-        // this pump operation (probably because we a resetting/shutting down).
-        // Get out immediately, do not reschedule ourselves.
-        if (!mPumpAudioEventPending) {
-            return;
-        }
-
-        // Start by checking if there is still work to be doing.  If we have
-        // never queued a payload (so we don't know what the last queued PTS is)
-        // or we have never established a MediaTime->CommonTime transformation,
-        // then we have work to do (one time through this loop should establish
-        // both).  Otherwise, we want to keep a fixed amt of presentation time
-        // worth of data buffered.  If we cannot get common time (service is
-        // unavailable, or common time is undefined)) then we don't have a lot
-        // of good options here.  For now, signal an error up to the app level
-        // and shut down the transmission pump.
-        int64_t commonTimeNow;
-        if (OK != mCCHelper.getCommonTime(&commonTimeNow)) {
-            // Failed to get common time; either the service is down or common
-            // time is not synced.  Raise an error and shutdown the player.
-            ALOGE("*** Cannot pump audio, unable to fetch common time."
-                  "  Shutting down.");
-            notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, UNKNOWN_ERROR);
-            mPumpAudioEventPending = false;
-            break;
-        }
-
-        if (mCurrentClockTransformValid && mLastQueuedMediaTimePTSValid) {
-            int64_t mediaTimeNow;
-            bool conversionResult = mCurrentClockTransform.doReverseTransform(
-                                        commonTimeNow,
-                                        &mediaTimeNow);
-            CHECK(conversionResult);
-
-            if ((mediaTimeNow +
-                 kAAHBufferTimeUs -
-                 mLastQueuedMediaTimePTS) <= 0) {
-                break;
-            }
-        }
-
-        MediaSource::ReadOptions options;
-        if (mIsSeeking) {
-            options.setSeekTo(mSeekTimeUs);
-        }
-
-        MediaBuffer* mediaBuffer;
-        status_t err = mAudioSource->read(&mediaBuffer, &options);
-        if (err != NO_ERROR) {
-            if (err == ERROR_END_OF_STREAM) {
-                ALOGI("*** %s reached end of stream", __PRETTY_FUNCTION__);
-                notifyListener_l(MEDIA_BUFFERING_UPDATE, 100);
-                notifyListener_l(MEDIA_PLAYBACK_COMPLETE);
-                pause_l(false);
-                sendEOS_l();
-            } else {
-                ALOGE("*** %s read failed err=%d", __PRETTY_FUNCTION__, err);
-            }
-            return;
-        }
-
-        if (mIsSeeking) {
-            mIsSeeking = false;
-            notifyListener_l(MEDIA_SEEK_COMPLETE);
-        }
-
-        uint8_t* data = (static_cast<uint8_t*>(mediaBuffer->data()) +
-                mediaBuffer->range_offset());
-        ALOGV("*** %s got media buffer data=[%02hhx %02hhx %02hhx %02hhx]"
-              " offset=%d length=%d", __PRETTY_FUNCTION__,
-              data[0], data[1], data[2], data[3],
-              mediaBuffer->range_offset(), mediaBuffer->range_length());
-
-        int64_t mediaTimeUs;
-        CHECK(mediaBuffer->meta_data()->findInt64(kKeyTime, &mediaTimeUs));
-        ALOGV("*** timeUs=%lld", mediaTimeUs);
-
-        if (!mCurrentClockTransformValid) {
-            if (OK == mCCHelper.getCommonTime(&commonTimeNow)) {
-                mCurrentClockTransform.a_zero = mediaTimeUs;
-                mCurrentClockTransform.b_zero = commonTimeNow +
-                                                kAAHStartupLeadTimeUs;
-                mCurrentClockTransform.a_to_b_numer = 1;
-                mCurrentClockTransform.a_to_b_denom = mPlayRateIsPaused ? 0 : 1;
-                mCurrentClockTransformValid = true;
-            } else {
-                // Failed to get common time; either the service is down or
-                // common time is not synced.  Raise an error and shutdown the
-                // player.
-                ALOGE("*** Cannot begin transmission, unable to fetch common"
-                      " time. Dropping sample with pts=%lld", mediaTimeUs);
-                notifyListener_l(MEDIA_ERROR,
-                                 MEDIA_ERROR_UNKNOWN,
-                                 UNKNOWN_ERROR);
-                mPumpAudioEventPending = false;
-                break;
-            }
-        }
-
-        ALOGV("*** transmitting packet with pts=%lld", mediaTimeUs);
-
-        sp<TRTPAudioPacket> packet = new TRTPAudioPacket();
-        packet->setPTS(mediaTimeUs);
-        packet->setSubstreamID(1);
-
-        packet->setCodecType(mAudioCodec);
-        packet->setVolume(mTRTPVolume);
-        // TODO : introduce a throttle for this so we can control the
-        // frequency with which transforms get sent.
-        packet->setClockTransform(mCurrentClockTransform);
-        packet->setAccessUnitData(data, mediaBuffer->range_length());
-
-        // TODO : while its pretty much universally true that audio ES payloads
-        // are all RAPs across all codecs, it might be a good idea to throttle
-        // the frequency with which we send codec out of band data to the RXers.
-        // If/when we do, we need to flag only those payloads which have
-        // required out of band data attached to them as RAPs.
-        packet->setRandomAccessPoint(true);
-
-        if (mAudioCodecData && mAudioCodecDataSize) {
-            packet->setAuxData(mAudioCodecData, mAudioCodecDataSize);
-        }
-
-        queuePacketToSender_l(packet);
-        mediaBuffer->release();
-
-        mLastQueuedMediaTimePTSValid = true;
-        mLastQueuedMediaTimePTS = mediaTimeUs;
-    }
-
-    { // Explicit scope for the autolock pattern.
-        Mutex::Autolock autoLock(mLock);
-
-        // If someone externally has cleared this flag, its because we should be
-        // shutting down.  Do not reschedule ourselves.
-        if (!mPumpAudioEventPending) {
-            return;
-        }
-
-        // Looks like no one canceled us explicitly.  Clear our flag and post a
-        // new event to ourselves.
-        mPumpAudioEventPending = false;
-        postPumpAudioEvent_l(10000);
-    }
-}
-
-void AAH_TXPlayer::queuePacketToSender_l(const sp<TRTPPacket>& packet) {
-    if (mAAH_Sender == NULL) {
-        return;
-    }
-
-    sp<AMessage> message = new AMessage(AAH_TXSender::kWhatSendPacket,
-                                        mAAH_Sender->handlerID());
-
-    {
-        Mutex::Autolock lock(mEndpointLock);
-        if (!mEndpointValid) {
-            return;
-        }
-
-        message->setInt32(AAH_TXSender::kSendPacketIPAddr, mEndpoint.addr);
-        message->setInt32(AAH_TXSender::kSendPacketPort, mEndpoint.port);
-    }
-
-    packet->setProgramID(mProgramID);
-    packet->setExpireTime(systemTime() + kAAHRetryKeepAroundTimeNs);
-    packet->pack();
-
-    message->setObject(AAH_TXSender::kSendPacketTRTPPacket, packet);
-
-    message->post();
-}
-
-}  // namespace android
diff --git a/media/libaah_rtp/aah_tx_player.h b/media/libaah_rtp/aah_tx_player.h
deleted file mode 100644
index 2e4b1f7..0000000
--- a/media/libaah_rtp/aah_tx_player.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __AAH_TX_PLAYER_H__
-#define __AAH_TX_PLAYER_H__
-
-#include <common_time/cc_helper.h>
-#include <libstagefright/include/HTTPBase.h>
-#include <libstagefright/include/NuCachedSource2.h>
-#include <libstagefright/include/TimedEventQueue.h>
-#include <media/MediaPlayerInterface.h>
-#include <media/stagefright/MediaExtractor.h>
-#include <media/stagefright/MediaSource.h>
-#include <utils/LinearTransform.h>
-#include <utils/String8.h>
-#include <utils/threads.h>
-
-#include "aah_tx_sender.h"
-
-namespace android {
-
-class AAH_TXPlayer : public MediaPlayerHWInterface {
-  public:
-    AAH_TXPlayer();
-
-    virtual status_t    initCheck();
-    virtual status_t    setDataSource(const char *url,
-                                      const KeyedVector<String8, String8>*
-                                      headers);
-    virtual status_t    setDataSource(int fd, int64_t offset, int64_t length);
-    virtual status_t    setVideoSurface(const sp<Surface>& surface);
-    virtual status_t    setVideoSurfaceTexture(const sp<ISurfaceTexture>&
-                                               surfaceTexture);
-    virtual status_t    prepare();
-    virtual status_t    prepareAsync();
-    virtual status_t    start();
-    virtual status_t    stop();
-    virtual status_t    pause();
-    virtual bool        isPlaying();
-    virtual status_t    seekTo(int msec);
-    virtual status_t    getCurrentPosition(int *msec);
-    virtual status_t    getDuration(int *msec);
-    virtual status_t    reset();
-    virtual status_t    setLooping(int loop);
-    virtual player_type playerType();
-    virtual status_t    setParameter(int key, const Parcel &request);
-    virtual status_t    getParameter(int key, Parcel *reply);
-    virtual status_t    invoke(const Parcel& request, Parcel *reply);
-    virtual status_t    getMetadata(const media::Metadata::Filter& ids,
-                                    Parcel* records);
-    virtual status_t    setVolume(float leftVolume, float rightVolume);
-    virtual status_t    setAudioStreamType(audio_stream_type_t streamType);
-    virtual status_t    setRetransmitEndpoint(
-                            const struct sockaddr_in* endpoint);
-
-    static const int64_t kAAHRetryKeepAroundTimeNs;
-
-  protected:
-    virtual ~AAH_TXPlayer();
-
-  private:
-    friend struct AwesomeEvent;
-
-    enum {
-        PLAYING             = 1,
-        PREPARING           = 8,
-        PREPARED            = 16,
-        PREPARE_CANCELLED   = 64,
-        CACHE_UNDERRUN      = 128,
-
-        // We are basically done preparing but are currently buffering
-        // sufficient data to begin playback and finish the preparation
-        // phase for good.
-        PREPARING_CONNECTED = 2048,
-
-        INCOGNITO           = 32768,
-    };
-
-    status_t setDataSource_l(const char *url,
-                             const KeyedVector<String8, String8> *headers);
-    status_t setDataSource_l(const sp<MediaExtractor>& extractor);
-    status_t finishSetDataSource_l();
-    status_t prepareAsync_l();
-    void onPrepareAsyncEvent();
-    void finishAsyncPrepare_l();
-    void abortPrepare(status_t err);
-    status_t play_l();
-    status_t pause_l(bool doClockUpdate = true);
-    status_t seekTo_l(int64_t timeUs);
-    void updateClockTransform_l(bool pause);
-    void sendEOS_l();
-    void cancelPlayerEvents(bool keepBufferingGoing = false);
-    void reset_l();
-    void notifyListener_l(int msg, int ext1 = 0, int ext2 = 0);
-    bool getBitrate_l(int64_t* bitrate);
-    status_t getDuration_l(int* msec);
-    bool getCachedDuration_l(int64_t* durationUs, bool* eos);
-    void ensureCacheIsFetching_l();
-    void postBufferingEvent_l();
-    void postPumpAudioEvent_l(int64_t delayUs);
-    void onBufferingUpdate();
-    void onPumpAudio();
-    void queuePacketToSender_l(const sp<TRTPPacket>& packet);
-
-    Mutex mLock;
-
-    TimedEventQueue mQueue;
-    bool mQueueStarted;
-
-    sp<TimedEventQueue::Event> mBufferingEvent;
-    bool mBufferingEventPending;
-
-    uint32_t mFlags;
-    uint32_t mExtractorFlags;
-
-    String8 mUri;
-    KeyedVector<String8, String8> mUriHeaders;
-
-    sp<DataSource> mFileSource;
-
-    sp<TimedEventQueue::Event> mAsyncPrepareEvent;
-    Condition mPreparedCondition;
-    status_t mPrepareResult;
-
-    bool mIsSeeking;
-    int64_t mSeekTimeUs;
-
-    sp<TimedEventQueue::Event> mPumpAudioEvent;
-    bool mPumpAudioEventPending;
-
-    sp<HTTPBase> mConnectingDataSource;
-    sp<NuCachedSource2> mCachedSource;
-
-    sp<MediaSource> mAudioSource;
-    TRTPAudioPacket::TRTPAudioCodecType mAudioCodec;
-    sp<MetaData> mAudioFormat;
-    uint8_t* mAudioCodecData;
-    size_t mAudioCodecDataSize;
-
-    int64_t mDurationUs;
-    int64_t mBitrate;
-
-    sp<AAH_TXSender> mAAH_Sender;
-    LinearTransform  mCurrentClockTransform;
-    bool             mCurrentClockTransformValid;
-    int64_t          mLastQueuedMediaTimePTS;
-    bool             mLastQueuedMediaTimePTSValid;
-    bool             mPlayRateIsPaused;
-    CCHelper         mCCHelper;
-
-    Mutex mEndpointLock;
-    AAH_TXSender::Endpoint mEndpoint;
-    bool mEndpointValid;
-    bool mEndpointRegistered;
-    uint16_t mProgramID;
-    uint8_t mTRTPVolume;
-
-    DISALLOW_EVIL_CONSTRUCTORS(AAH_TXPlayer);
-};
-
-}  // namespace android
-
-#endif  // __AAH_TX_PLAYER_H__
diff --git a/media/libaah_rtp/aah_tx_sender.cpp b/media/libaah_rtp/aah_tx_sender.cpp
deleted file mode 100644
index 08e32d2..0000000
--- a/media/libaah_rtp/aah_tx_sender.cpp
+++ /dev/null
@@ -1,603 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-#include <media/stagefright/foundation/ADebug.h>
-
-#include <netinet/in.h>
-#include <poll.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-#include <media/stagefright/foundation/AMessage.h>
-#include <utils/misc.h>
-
-#include "aah_tx_player.h"
-#include "aah_tx_sender.h"
-
-namespace android {
-
-const char* AAH_TXSender::kSendPacketIPAddr = "ipaddr";
-const char* AAH_TXSender::kSendPacketPort = "port";
-const char* AAH_TXSender::kSendPacketTRTPPacket = "trtp";
-
-const int AAH_TXSender::kRetryTrimIntervalUs = 100000;
-const int AAH_TXSender::kHeartbeatIntervalUs = 1000000;
-const int AAH_TXSender::kRetryBufferCapacity = 100;
-const nsecs_t AAH_TXSender::kHeartbeatTimeout = 600ull * 1000000000ull;
-
-Mutex AAH_TXSender::sLock;
-wp<AAH_TXSender> AAH_TXSender::sInstance;
-uint32_t AAH_TXSender::sNextEpoch;
-bool AAH_TXSender::sNextEpochValid = false;
-
-AAH_TXSender::AAH_TXSender() : mSocket(-1) {
-    mLastSentPacketTime = systemTime();
-}
-
-sp<AAH_TXSender> AAH_TXSender::GetInstance() {
-    Mutex::Autolock autoLock(sLock);
-
-    sp<AAH_TXSender> sender = sInstance.promote();
-
-    if (sender == NULL) {
-        sender = new AAH_TXSender();
-        if (sender == NULL) {
-            return NULL;
-        }
-
-        sender->mLooper = new ALooper();
-        if (sender->mLooper == NULL) {
-            return NULL;
-        }
-
-        sender->mReflector = new AHandlerReflector<AAH_TXSender>(sender.get());
-        if (sender->mReflector == NULL) {
-            return NULL;
-        }
-
-        sender->mSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
-        if (sender->mSocket == -1) {
-            ALOGW("%s unable to create socket", __PRETTY_FUNCTION__);
-            return NULL;
-        }
-
-        struct sockaddr_in bind_addr;
-        memset(&bind_addr, 0, sizeof(bind_addr));
-        bind_addr.sin_family = AF_INET;
-        if (bind(sender->mSocket,
-                 reinterpret_cast<const sockaddr*>(&bind_addr),
-                 sizeof(bind_addr)) < 0) {
-            ALOGW("%s unable to bind socket (errno %d)",
-                  __PRETTY_FUNCTION__, errno);
-            return NULL;
-        }
-
-        sender->mRetryReceiver = new RetryReceiver(sender.get());
-        if (sender->mRetryReceiver == NULL) {
-            return NULL;
-        }
-
-        sender->mLooper->setName("AAH_TXSender");
-        sender->mLooper->registerHandler(sender->mReflector);
-        sender->mLooper->start(false, false, PRIORITY_AUDIO);
-
-        if (sender->mRetryReceiver->run("AAH_TXSenderRetry", PRIORITY_AUDIO)
-                != OK) {
-            ALOGW("%s unable to start retry thread", __PRETTY_FUNCTION__);
-            return NULL;
-        }
-
-        sInstance = sender;
-    }
-
-    return sender;
-}
-
-AAH_TXSender::~AAH_TXSender() {
-    mLooper->stop();
-    mLooper->unregisterHandler(mReflector->id());
-
-    if (mRetryReceiver != NULL) {
-        mRetryReceiver->requestExit();
-        mRetryReceiver->mWakeupEvent.setEvent();
-        if (mRetryReceiver->requestExitAndWait() != OK) {
-            ALOGW("%s shutdown of retry receiver failed", __PRETTY_FUNCTION__);
-        }
-        mRetryReceiver->mSender = NULL;
-        mRetryReceiver.clear();
-    }
-
-    if (mSocket != -1) {
-        close(mSocket);
-    }
-}
-
-// Return the next epoch number usable for a newly instantiated endpoint.
-uint32_t AAH_TXSender::getNextEpoch() {
-    Mutex::Autolock autoLock(sLock);
-
-    if (sNextEpochValid) {
-        sNextEpoch = (sNextEpoch + 1) & TRTPPacket::kTRTPEpochMask;
-    } else {
-        sNextEpoch = ns2ms(systemTime()) & TRTPPacket::kTRTPEpochMask;
-        sNextEpochValid = true;
-    }
-
-    return sNextEpoch;
-}
-
-// Notify the sender that a player has started sending to this endpoint.
-// Returns a program ID for use by the calling player.
-uint16_t AAH_TXSender::registerEndpoint(const Endpoint& endpoint) {
-    Mutex::Autolock lock(mEndpointLock);
-
-    EndpointState* eps = mEndpointMap.valueFor(endpoint);
-    if (eps) {
-        eps->playerRefCount++;
-    } else {
-        eps = new EndpointState(getNextEpoch());
-        mEndpointMap.add(endpoint, eps);
-    }
-
-    // if this is the first registered endpoint, then send a message to start
-    // trimming retry buffers and a message to start sending heartbeats.
-    if (mEndpointMap.size() == 1) {
-        sp<AMessage> trimMessage = new AMessage(kWhatTrimRetryBuffers,
-                                                handlerID());
-        trimMessage->post(kRetryTrimIntervalUs);
-
-        sp<AMessage> heartbeatMessage = new AMessage(kWhatSendHeartbeats,
-                                                     handlerID());
-        heartbeatMessage->post(kHeartbeatIntervalUs);
-    }
-
-    eps->nextProgramID++;
-    return eps->nextProgramID;
-}
-
-// Notify the sender that a player has ceased sending to this endpoint.
-// An endpoint's state can not be deleted until all of the endpoint's
-// registered players have called unregisterEndpoint.
-void AAH_TXSender::unregisterEndpoint(const Endpoint& endpoint) {
-    Mutex::Autolock lock(mEndpointLock);
-
-    EndpointState* eps = mEndpointMap.valueFor(endpoint);
-    if (eps) {
-        eps->playerRefCount--;
-        CHECK(eps->playerRefCount >= 0);
-    }
-}
-
-void AAH_TXSender::onMessageReceived(const sp<AMessage>& msg) {
-    switch (msg->what()) {
-        case kWhatSendPacket:
-            onSendPacket(msg);
-            break;
-
-        case kWhatTrimRetryBuffers:
-            trimRetryBuffers();
-            break;
-
-        case kWhatSendHeartbeats:
-            sendHeartbeats();
-            break;
-
-        default:
-            TRESPASS();
-            break;
-    }
-}
-
-void AAH_TXSender::onSendPacket(const sp<AMessage>& msg) {
-    sp<RefBase> obj;
-    CHECK(msg->findObject(kSendPacketTRTPPacket, &obj));
-    sp<TRTPPacket> packet = static_cast<TRTPPacket*>(obj.get());
-
-    uint32_t ipAddr;
-    CHECK(msg->findInt32(kSendPacketIPAddr,
-                         reinterpret_cast<int32_t*>(&ipAddr)));
-
-    int32_t port32;
-    CHECK(msg->findInt32(kSendPacketPort, &port32));
-    uint16_t port = port32;
-
-    Mutex::Autolock lock(mEndpointLock);
-    doSendPacket_l(packet, Endpoint(ipAddr, port));
-    mLastSentPacketTime = systemTime();
-}
-
-void AAH_TXSender::doSendPacket_l(const sp<TRTPPacket>& packet,
-                                  const Endpoint& endpoint) {
-    EndpointState* eps = mEndpointMap.valueFor(endpoint);
-    if (!eps) {
-        // the endpoint state has disappeared, so the player that sent this
-        // packet must be dead.
-        return;
-    }
-
-    // assign the packet's sequence number
-    packet->setEpoch(eps->epoch);
-    packet->setSeqNumber(eps->trtpSeqNumber++);
-
-    // add the packet to the retry buffer
-    RetryBuffer& retry = eps->retry;
-    retry.push_back(packet);
-
-    // send the packet
-    struct sockaddr_in addr;
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_family = AF_INET;
-    addr.sin_addr.s_addr = endpoint.addr;
-    addr.sin_port = endpoint.port;
-
-    ssize_t result = sendto(mSocket,
-                            packet->getPacket(),
-                            packet->getPacketLen(),
-                            0,
-                            (const struct sockaddr *) &addr,
-                            sizeof(addr));
-    if (result == -1) {
-        ALOGW("%s sendto failed", __PRETTY_FUNCTION__);
-    }
-}
-
-void AAH_TXSender::trimRetryBuffers() {
-    Mutex::Autolock lock(mEndpointLock);
-
-    nsecs_t localTimeNow = systemTime();
-
-    Vector<Endpoint> endpointsToRemove;
-
-    for (size_t i = 0; i < mEndpointMap.size(); i++) {
-        EndpointState* eps = mEndpointMap.editValueAt(i);
-        RetryBuffer& retry = eps->retry;
-
-        while (!retry.isEmpty()) {
-            if (retry[0]->getExpireTime() < localTimeNow) {
-                retry.pop_front();
-            } else {
-                break;
-            }
-        }
-
-        if (retry.isEmpty() && eps->playerRefCount == 0) {
-            endpointsToRemove.add(mEndpointMap.keyAt(i));
-        }
-    }
-
-    // remove the state for any endpoints that are no longer in use
-    for (size_t i = 0; i < endpointsToRemove.size(); i++) {
-        Endpoint& e = endpointsToRemove.editItemAt(i);
-        ALOGD("*** %s removing endpoint addr=%08x",
-                __PRETTY_FUNCTION__, e.addr);
-        size_t index = mEndpointMap.indexOfKey(e);
-        delete mEndpointMap.valueAt(index);
-        mEndpointMap.removeItemsAt(index);
-    }
-
-    // schedule the next trim
-    if (mEndpointMap.size()) {
-        sp<AMessage> trimMessage = new AMessage(kWhatTrimRetryBuffers,
-                                                handlerID());
-        trimMessage->post(kRetryTrimIntervalUs);
-    }
-}
-
-void AAH_TXSender::sendHeartbeats() {
-    Mutex::Autolock lock(mEndpointLock);
-
-    if (shouldSendHeartbeats_l()) {
-        for (size_t i = 0; i < mEndpointMap.size(); i++) {
-            EndpointState* eps = mEndpointMap.editValueAt(i);
-            const Endpoint& ep = mEndpointMap.keyAt(i);
-
-            sp<TRTPControlPacket> packet = new TRTPControlPacket();
-            packet->setCommandID(TRTPControlPacket::kCommandNop);
-
-            packet->setExpireTime(systemTime() +
-                                  AAH_TXPlayer::kAAHRetryKeepAroundTimeNs);
-            packet->pack();
-
-            doSendPacket_l(packet, ep);
-        }
-    }
-
-    // schedule the next heartbeat
-    if (mEndpointMap.size()) {
-        sp<AMessage> heartbeatMessage = new AMessage(kWhatSendHeartbeats,
-                                                     handlerID());
-        heartbeatMessage->post(kHeartbeatIntervalUs);
-    }
-}
-
-bool AAH_TXSender::shouldSendHeartbeats_l() {
-    // assert(holding endpoint lock)
-    return (systemTime() < (mLastSentPacketTime + kHeartbeatTimeout));
-}
-
-// Receiver
-
-// initial 4-byte ID of a retry request packet
-const uint32_t AAH_TXSender::RetryReceiver::kRetryRequestID = 'Treq';
-
-// initial 4-byte ID of a retry NAK packet
-const uint32_t AAH_TXSender::RetryReceiver::kRetryNakID = 'Tnak';
-
-// initial 4-byte ID of a fast start request packet
-const uint32_t AAH_TXSender::RetryReceiver::kFastStartRequestID = 'Tfst';
-
-AAH_TXSender::RetryReceiver::RetryReceiver(AAH_TXSender* sender)
-        : Thread(false),
-    mSender(sender) {}
-
-    AAH_TXSender::RetryReceiver::~RetryReceiver() {
-        mWakeupEvent.clearPendingEvents();
-    }
-
-// Returns true if val is within the interval bounded inclusively by
-// start and end.  Also handles the case where there is a rollover of the
-// range between start and end.
-template <typename T>
-static inline bool withinIntervalWithRollover(T val, T start, T end) {
-    return ((start <= end && val >= start && val <= end) ||
-            (start > end && (val >= start || val <= end)));
-}
-
-bool AAH_TXSender::RetryReceiver::threadLoop() {
-    struct pollfd pollFds[2];
-    pollFds[0].fd = mSender->mSocket;
-    pollFds[0].events = POLLIN;
-    pollFds[0].revents = 0;
-    pollFds[1].fd = mWakeupEvent.getWakeupHandle();
-    pollFds[1].events = POLLIN;
-    pollFds[1].revents = 0;
-
-    int pollResult = poll(pollFds, NELEM(pollFds), -1);
-    if (pollResult == -1) {
-        ALOGE("%s poll failed", __PRETTY_FUNCTION__);
-        return false;
-    }
-
-    if (exitPending()) {
-        ALOGI("*** %s exiting", __PRETTY_FUNCTION__);
-        return false;
-    }
-
-    if (pollFds[0].revents) {
-        handleRetryRequest();
-    }
-
-    return true;
-}
-
-void AAH_TXSender::RetryReceiver::handleRetryRequest() {
-    ALOGV("*** RX %s start", __PRETTY_FUNCTION__);
-
-    RetryPacket request;
-    struct sockaddr requestSrcAddr;
-    socklen_t requestSrcAddrLen = sizeof(requestSrcAddr);
-
-    ssize_t result = recvfrom(mSender->mSocket, &request, sizeof(request), 0,
-                              &requestSrcAddr, &requestSrcAddrLen);
-    if (result == -1) {
-        ALOGE("%s recvfrom failed, errno=%d", __PRETTY_FUNCTION__, errno);
-        return;
-    }
-
-    if (static_cast<size_t>(result) < sizeof(RetryPacket)) {
-        ALOGW("%s short packet received", __PRETTY_FUNCTION__);
-        return;
-    }
-
-    uint32_t host_request_id = ntohl(request.id);
-    if ((host_request_id != kRetryRequestID) &&
-        (host_request_id != kFastStartRequestID)) {
-        ALOGW("%s received retry request with bogus ID (%08x)",
-                __PRETTY_FUNCTION__, host_request_id);
-        return;
-    }
-
-    Endpoint endpoint(request.endpointIP, request.endpointPort);
-
-    Mutex::Autolock lock(mSender->mEndpointLock);
-
-    EndpointState* eps = mSender->mEndpointMap.valueFor(endpoint);
-
-    if (eps == NULL || eps->retry.isEmpty()) {
-        // we have no retry buffer or an empty retry buffer for this endpoint,
-        // so NAK the entire request
-        RetryPacket nak = request;
-        nak.id = htonl(kRetryNakID);
-        result = sendto(mSender->mSocket, &nak, sizeof(nak), 0,
-                        &requestSrcAddr, requestSrcAddrLen);
-        if (result == -1) {
-            ALOGW("%s sendto failed", __PRETTY_FUNCTION__);
-        }
-        return;
-    }
-
-    RetryBuffer& retry = eps->retry;
-
-    uint16_t startSeq = ntohs(request.seqStart);
-    uint16_t endSeq = ntohs(request.seqEnd);
-
-    uint16_t retryFirstSeq = retry[0]->getSeqNumber();
-    uint16_t retryLastSeq = retry[retry.size() - 1]->getSeqNumber();
-
-    // If this is a fast start, then force the start of the retry to match the
-    // start of the retransmit ring buffer (unless the end of the retransmit
-    // ring buffer is already past the point of fast start)
-    if ((host_request_id == kFastStartRequestID) &&
-        !((startSeq - retryFirstSeq) & 0x8000)) {
-        startSeq = retryFirstSeq;
-    }
-
-    int startIndex;
-    if (withinIntervalWithRollover(startSeq, retryFirstSeq, retryLastSeq)) {
-        startIndex = static_cast<uint16_t>(startSeq - retryFirstSeq);
-    } else {
-        startIndex = -1;
-    }
-
-    int endIndex;
-    if (withinIntervalWithRollover(endSeq, retryFirstSeq, retryLastSeq)) {
-        endIndex = static_cast<uint16_t>(endSeq - retryFirstSeq);
-    } else {
-        endIndex = -1;
-    }
-
-    if (startIndex == -1 && endIndex == -1) {
-        // no part of the request range is found in the retry buffer
-        RetryPacket nak = request;
-        nak.id = htonl(kRetryNakID);
-        result = sendto(mSender->mSocket, &nak, sizeof(nak), 0,
-                        &requestSrcAddr, requestSrcAddrLen);
-        if (result == -1) {
-            ALOGW("%s sendto failed", __PRETTY_FUNCTION__);
-        }
-        return;
-    }
-
-    if (startIndex == -1) {
-        // NAK a subrange at the front of the request range
-        RetryPacket nak = request;
-        nak.id = htonl(kRetryNakID);
-        nak.seqEnd = htons(retryFirstSeq - 1);
-        result = sendto(mSender->mSocket, &nak, sizeof(nak), 0,
-                        &requestSrcAddr, requestSrcAddrLen);
-        if (result == -1) {
-            ALOGW("%s sendto failed", __PRETTY_FUNCTION__);
-        }
-
-        startIndex = 0;
-    } else if (endIndex == -1) {
-        // NAK a subrange at the back of the request range
-        RetryPacket nak = request;
-        nak.id = htonl(kRetryNakID);
-        nak.seqStart = htons(retryLastSeq + 1);
-        result = sendto(mSender->mSocket, &nak, sizeof(nak), 0,
-                        &requestSrcAddr, requestSrcAddrLen);
-        if (result == -1) {
-            ALOGW("%s sendto failed", __PRETTY_FUNCTION__);
-        }
-
-        endIndex = retry.size() - 1;
-    }
-
-    // send the retry packets
-    for (int i = startIndex; i <= endIndex; i++) {
-        const sp<TRTPPacket>& replyPacket = retry[i];
-
-        result = sendto(mSender->mSocket,
-                        replyPacket->getPacket(),
-                        replyPacket->getPacketLen(),
-                        0,
-                        &requestSrcAddr,
-                        requestSrcAddrLen);
-
-        if (result == -1) {
-            ALOGW("%s sendto failed", __PRETTY_FUNCTION__);
-        }
-    }
-}
-
-// Endpoint
-
-AAH_TXSender::Endpoint::Endpoint()
-        : addr(0)
-        , port(0) { }
-
-AAH_TXSender::Endpoint::Endpoint(uint32_t a, uint16_t p)
-        : addr(a)
-        , port(p) {}
-
-bool AAH_TXSender::Endpoint::operator<(const Endpoint& other) const {
-    return ((addr < other.addr) ||
-            (addr == other.addr && port < other.port));
-}
-
-// EndpointState
-
-AAH_TXSender::EndpointState::EndpointState(uint32_t _epoch)
-    : retry(kRetryBufferCapacity)
-    , playerRefCount(1)
-    , trtpSeqNumber(0)
-    , nextProgramID(0)
-    , epoch(_epoch) { }
-
-// CircularBuffer
-
-template <typename T>
-CircularBuffer<T>::CircularBuffer(size_t capacity)
-        : mCapacity(capacity)
-        , mHead(0)
-        , mTail(0)
-        , mFillCount(0) {
-    mBuffer = new T[capacity];
-}
-
-template <typename T>
-CircularBuffer<T>::~CircularBuffer() {
-    delete [] mBuffer;
-}
-
-template <typename T>
-void CircularBuffer<T>::push_back(const T& item) {
-    if (this->isFull()) {
-        this->pop_front();
-    }
-    mBuffer[mHead] = item;
-    mHead = (mHead + 1) % mCapacity;
-    mFillCount++;
-}
-
-template <typename T>
-void CircularBuffer<T>::pop_front() {
-    CHECK(!isEmpty());
-    mBuffer[mTail] = T();
-    mTail = (mTail + 1) % mCapacity;
-    mFillCount--;
-}
-
-template <typename T>
-size_t CircularBuffer<T>::size() const {
-    return mFillCount;
-}
-
-template <typename T>
-bool CircularBuffer<T>::isFull() const {
-    return (mFillCount == mCapacity);
-}
-
-template <typename T>
-bool CircularBuffer<T>::isEmpty() const {
-    return (mFillCount == 0);
-}
-
-template <typename T>
-const T& CircularBuffer<T>::itemAt(size_t index) const {
-    CHECK(index < mFillCount);
-    return mBuffer[(mTail + index) % mCapacity];
-}
-
-template <typename T>
-const T& CircularBuffer<T>::operator[](size_t index) const {
-    return itemAt(index);
-}
-
-}  // namespace android
diff --git a/media/libaah_rtp/aah_tx_sender.h b/media/libaah_rtp/aah_tx_sender.h
deleted file mode 100644
index 74206c4..0000000
--- a/media/libaah_rtp/aah_tx_sender.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __AAH_TX_SENDER_H__
-#define __AAH_TX_SENDER_H__
-
-#include <media/stagefright/foundation/ALooper.h>
-#include <media/stagefright/foundation/AHandlerReflector.h>
-#include <utils/RefBase.h>
-#include <utils/threads.h>
-
-#include "aah_tx_packet.h"
-#include "pipe_event.h"
-
-namespace android {
-
-template <typename T> class CircularBuffer {
-  public:
-    CircularBuffer(size_t capacity);
-    ~CircularBuffer();
-    void push_back(const T& item);;
-    void pop_front();
-    size_t size() const;
-    bool isFull() const;
-    bool isEmpty() const;
-    const T& itemAt(size_t index) const;
-    const T& operator[](size_t index) const;
-
-  private:
-    T* mBuffer;
-    size_t mCapacity;
-    size_t mHead;
-    size_t mTail;
-    size_t mFillCount;
-
-    DISALLOW_EVIL_CONSTRUCTORS(CircularBuffer);
-};
-
-class AAH_TXSender : public virtual RefBase {
-  public:
-    ~AAH_TXSender();
-
-    static sp<AAH_TXSender> GetInstance();
-
-    ALooper::handler_id handlerID() { return mReflector->id(); }
-
-    // an IP address and port
-    struct Endpoint {
-        Endpoint();
-        Endpoint(uint32_t a, uint16_t p);
-        bool operator<(const Endpoint& other) const;
-
-        uint32_t addr;
-        uint16_t port;
-    };
-
-    uint16_t registerEndpoint(const Endpoint& endpoint);
-    void unregisterEndpoint(const Endpoint& endpoint);
-
-    enum {
-        kWhatSendPacket,
-        kWhatTrimRetryBuffers,
-        kWhatSendHeartbeats,
-    };
-
-    // fields for SendPacket messages
-    static const char* kSendPacketIPAddr;
-    static const char* kSendPacketPort;
-    static const char* kSendPacketTRTPPacket;
-
-  private:
-    AAH_TXSender();
-
-    static Mutex sLock;
-    static wp<AAH_TXSender> sInstance;
-    static uint32_t sNextEpoch;
-    static bool sNextEpochValid;
-
-    static uint32_t getNextEpoch();
-
-    typedef CircularBuffer<sp<TRTPPacket> > RetryBuffer;
-
-    // state maintained on a per-endpoint basis
-    struct EndpointState {
-        EndpointState(uint32_t epoch);
-        RetryBuffer retry;
-        int playerRefCount;
-        uint16_t trtpSeqNumber;
-        uint16_t nextProgramID;
-        uint32_t epoch;
-    };
-
-    friend class AHandlerReflector<AAH_TXSender>;
-    void onMessageReceived(const sp<AMessage>& msg);
-    void onSendPacket(const sp<AMessage>& msg);
-    void doSendPacket_l(const sp<TRTPPacket>& packet,
-                        const Endpoint& endpoint);
-    void trimRetryBuffers();
-    void sendHeartbeats();
-    bool shouldSendHeartbeats_l();
-
-    sp<ALooper> mLooper;
-    sp<AHandlerReflector<AAH_TXSender> > mReflector;
-
-    int mSocket;
-    nsecs_t mLastSentPacketTime;
-
-    DefaultKeyedVector<Endpoint, EndpointState*> mEndpointMap;
-    Mutex mEndpointLock;
-
-    static const int kRetryTrimIntervalUs;
-    static const int kHeartbeatIntervalUs;
-    static const int kRetryBufferCapacity;
-    static const nsecs_t kHeartbeatTimeout;
-
-    class RetryReceiver : public Thread {
-      private:
-        friend class AAH_TXSender;
-
-        RetryReceiver(AAH_TXSender* sender);
-        virtual ~RetryReceiver();
-        virtual bool threadLoop();
-        void handleRetryRequest();
-
-        static const int kMaxReceiverPacketLen;
-        static const uint32_t kRetryRequestID;
-        static const uint32_t kFastStartRequestID;
-        static const uint32_t kRetryNakID;
-
-        AAH_TXSender* mSender;
-        PipeEvent mWakeupEvent;
-    };
-
-    sp<RetryReceiver> mRetryReceiver;
-
-    DISALLOW_EVIL_CONSTRUCTORS(AAH_TXSender);
-};
-
-struct RetryPacket {
-    uint32_t id;
-    uint32_t endpointIP;
-    uint16_t endpointPort;
-    uint16_t seqStart;
-    uint16_t seqEnd;
-} __attribute__((packed));
-
-}  // namespace android
-
-#endif  // __AAH_TX_SENDER_H__
diff --git a/media/libaah_rtp/pipe_event.cpp b/media/libaah_rtp/pipe_event.cpp
deleted file mode 100644
index b8e6960..0000000
--- a/media/libaah_rtp/pipe_event.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "LibAAH_RTP"
-#include <utils/Log.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <poll.h>
-#include <unistd.h>
-
-#include "pipe_event.h"
-
-namespace android {
-
-PipeEvent::PipeEvent() {
-    pipe_[0] = -1;
-    pipe_[1] = -1;
-
-    // Create the pipe.
-    if (pipe(pipe_) >= 0) {
-        // Set non-blocking mode on the read side of the pipe so we can
-        // easily drain it whenever we wakeup.
-        fcntl(pipe_[0], F_SETFL, O_NONBLOCK);
-    } else {
-        ALOGE("Failed to create pipe event %d %d %d",
-              pipe_[0], pipe_[1], errno);
-        pipe_[0] = -1;
-        pipe_[1] = -1;
-    }
-}
-
-PipeEvent::~PipeEvent() {
-    if (pipe_[0] >= 0) {
-        close(pipe_[0]);
-    }
-
-    if (pipe_[1] >= 0) {
-        close(pipe_[1]);
-    }
-}
-
-void PipeEvent::clearPendingEvents() {
-    char drain_buffer[16];
-    while (read(pipe_[0], drain_buffer, sizeof(drain_buffer)) > 0) {
-        // No body.
-    }
-}
-
-bool PipeEvent::wait(int timeout) {
-    struct pollfd wait_fd;
-
-    wait_fd.fd = getWakeupHandle();
-    wait_fd.events = POLLIN;
-    wait_fd.revents = 0;
-
-    int res = poll(&wait_fd, 1, timeout);
-
-    if (res < 0) {
-        ALOGE("Wait error in PipeEvent; sleeping to prevent overload!");
-        usleep(1000);
-    }
-
-    return (res > 0);
-}
-
-void PipeEvent::setEvent() {
-    char foo = 'q';
-    write(pipe_[1], &foo, 1);
-}
-
-}  // namespace android
-
diff --git a/media/libaah_rtp/pipe_event.h b/media/libaah_rtp/pipe_event.h
deleted file mode 100644
index e53b0fd..0000000
--- a/media/libaah_rtp/pipe_event.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __PIPE_EVENT_H__
-#define __PIPE_EVENT_H__
-
-#include <media/stagefright/foundation/ABase.h>
-
-namespace android {
-
-class PipeEvent {
-  public:
-    PipeEvent();
-   ~PipeEvent();
-
-    bool initCheck() const {
-        return ((pipe_[0] >= 0) && (pipe_[1] >= 0));
-    }
-
-    int getWakeupHandle() const { return pipe_[0]; }
-
-    // block until the event fires; returns true if the event fired and false if
-    // the wait timed out.  Timeout is expressed in milliseconds; negative
-    // values mean wait forever.
-    bool wait(int timeout = -1);
-
-    void clearPendingEvents();
-    void setEvent();
-
-  private:
-    int pipe_[2];
-
-    DISALLOW_EVIL_CONSTRUCTORS(PipeEvent);
-};
-
-}  // namespace android
-
-#endif  // __PIPE_EVENT_H__
diff --git a/media/libeffects/factory/EffectsFactory.c b/media/libeffects/factory/EffectsFactory.c
index 59cd9e3..f158929 100644
--- a/media/libeffects/factory/EffectsFactory.c
+++ b/media/libeffects/factory/EffectsFactory.c
@@ -214,7 +214,7 @@
     while (gCurLib) {
         if (gCurEffect) {
             if (index == gCurEffectIdx) {
-                memcpy(pDescriptor, gCurEffect->object, sizeof(effect_descriptor_t));
+                *pDescriptor = *(effect_descriptor_t *)gCurEffect->object;
                 ret = 0;
                 break;
             } else {
@@ -251,7 +251,7 @@
     pthread_mutex_lock(&gLibLock);
     ret = findEffect(NULL, uuid, &l, &d);
     if (ret == 0) {
-        memcpy(pDescriptor, d, sizeof(effect_descriptor_t));
+        *pDescriptor = *d;
     }
     pthread_mutex_unlock(&gLibLock);
     return ret;
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Init.c b/media/libeffects/lvm/lib/Bundle/src/LVM_Init.c
index 20370b7..dd34fb5 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Init.c
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Init.c
@@ -557,7 +557,9 @@
      */
     pInstance->Params.OperatingMode    = LVM_MODE_OFF;
     pInstance->Params.SampleRate       = LVM_FS_8000;
-    pInstance->Params.SourceFormat     = LVM_MONO;
+//  FIXME: Workaround to avoid reset of headroom parameters on first call to LVM_Process.
+//    pInstance->Params.SourceFormat     = LVM_MONO;
+    pInstance->Params.SourceFormat     = LVM_STEREO;
     pInstance->Params.SpeakerType      = LVM_HEADPHONES;
     pInstance->Params.VC_EffectLevel   = 0;
     pInstance->Params.VC_Balance       = 0;
diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
index 40dffd4..d4be9fa 100644
--- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
@@ -180,16 +180,16 @@
     }
     if(index == LVM_BASS_BOOST){
         ALOGV("\tEffectQueryEffect processing LVM_BASS_BOOST");
-        memcpy(pDescriptor, &gBassBoostDescriptor,   sizeof(effect_descriptor_t));
+        *pDescriptor = gBassBoostDescriptor;
     }else if(index == LVM_VIRTUALIZER){
         ALOGV("\tEffectQueryEffect processing LVM_VIRTUALIZER");
-        memcpy(pDescriptor, &gVirtualizerDescriptor, sizeof(effect_descriptor_t));
+        *pDescriptor = gVirtualizerDescriptor;
     } else if(index == LVM_EQUALIZER){
         ALOGV("\tEffectQueryEffect processing LVM_EQUALIZER");
-        memcpy(pDescriptor, &gEqualizerDescriptor,   sizeof(effect_descriptor_t));
+        *pDescriptor = gEqualizerDescriptor;
     } else if(index == LVM_VOLUME){
         ALOGV("\tEffectQueryEffect processing LVM_VOLUME");
-        memcpy(pDescriptor, &gVolumeDescriptor, sizeof(effect_descriptor_t));
+        *pDescriptor = gVolumeDescriptor;
     }
     ALOGV("\tEffectQueryEffect end\n");
     return 0;
@@ -494,7 +494,7 @@
         return  -EINVAL;
     }
 
-    memcpy(pDescriptor, desc, sizeof(effect_descriptor_t));
+    *pDescriptor = *desc;
 
     return 0;
 } /* end EffectGetDescriptor */
@@ -698,10 +698,10 @@
     /* Set the headroom parameters */
     HeadroomBandDef[0].Limit_Low          = 20;
     HeadroomBandDef[0].Limit_High         = 4999;
-    HeadroomBandDef[0].Headroom_Offset    = 3;
+    HeadroomBandDef[0].Headroom_Offset    = 0;
     HeadroomBandDef[1].Limit_Low          = 5000;
     HeadroomBandDef[1].Limit_High         = 24000;
-    HeadroomBandDef[1].Headroom_Offset    = 4;
+    HeadroomBandDef[1].Headroom_Offset    = 0;
     HeadroomParams.pHeadroomDefinition    = &HeadroomBandDef[0];
     HeadroomParams.Headroom_OperatingMode = LVM_HEADROOM_ON;
     HeadroomParams.NHeadroomBands         = 2;
@@ -965,7 +965,7 @@
               || pConfig->outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE);
     CHECK_ARG(pConfig->inputCfg.format == AUDIO_FORMAT_PCM_16_BIT);
 
-    memcpy(&pContext->config, pConfig, sizeof(effect_config_t));
+    pContext->config = *pConfig;
 
     switch (pConfig->inputCfg.samplingRate) {
     case 8000:
@@ -1011,6 +1011,8 @@
         LVM_ERROR_CHECK(LvmStatus, "LVM_GetControlParameters", "Effect_setConfig")
         if(LvmStatus != LVM_SUCCESS) return -EINVAL;
 
+        ActiveParams.SampleRate = SampleRate;
+
         LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);
 
         LVM_ERROR_CHECK(LvmStatus, "LVM_SetControlParameters", "Effect_setConfig")
@@ -1041,7 +1043,7 @@
 
 void Effect_getConfig(EffectContext *pContext, effect_config_t *pConfig)
 {
-    memcpy(pConfig, &pContext->config, sizeof(effect_config_t));
+    *pConfig = pContext->config;
 }   /* end Effect_getConfig */
 
 //----------------------------------------------------------------------------
@@ -3272,7 +3274,7 @@
             return -EINVAL;
     }
 
-    memcpy(pDescriptor, desc, sizeof(effect_descriptor_t));
+    *pDescriptor = *desc;
 
     return 0;
 }   /* end Effect_getDescriptor */
diff --git a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
index 9599dcc..941d651 100755
--- a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
+++ b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
@@ -206,7 +206,7 @@
         ALOGV("\tLVM_ERROR : EffectQueryEffect index out of range %d", index);
         return -ENOENT;
     }
-    memcpy(pDescriptor, gDescriptors[index], sizeof(effect_descriptor_t));
+    *pDescriptor = *gDescriptors[index];
     ALOGV("\tEffectQueryEffect end\n");
     return 0;
 }     /* end EffectQueryEffect */
@@ -330,7 +330,7 @@
 
     for (i = 0; i < length; i++) {
         if (memcmp(uuid, &gDescriptors[i]->uuid, sizeof(effect_uuid_t)) == 0) {
-            memcpy(pDescriptor, gDescriptors[i], sizeof(effect_descriptor_t));
+            *pDescriptor = *gDescriptors[i];
             ALOGV("EffectGetDescriptor - UUID matched Reverb type %d, UUID = %x",
                  i, gDescriptors[i]->uuid.timeLow);
             return 0;
@@ -645,7 +645,7 @@
     }
 
     //ALOGV("\tReverb_setConfig calling memcpy");
-    memcpy(&pContext->config, pConfig, sizeof(effect_config_t));
+    pContext->config = *pConfig;
 
 
     switch (pConfig->inputCfg.samplingRate) {
@@ -715,7 +715,7 @@
 
 void Reverb_getConfig(ReverbContext *pContext, effect_config_t *pConfig)
 {
-    memcpy(pConfig, &pContext->config, sizeof(effect_config_t));
+    *pConfig = pContext->config;
 }   /* end Reverb_getConfig */
 
 //----------------------------------------------------------------------------
@@ -2157,7 +2157,7 @@
         }
     }
 
-    memcpy(pDescriptor, desc, sizeof(effect_descriptor_t));
+    *pDescriptor = *desc;
 
     return 0;
 }   /* end Reverb_getDescriptor */
diff --git a/media/libeffects/preprocessing/PreProcessing.cpp b/media/libeffects/preprocessing/PreProcessing.cpp
index cfa7f51..5709837 100755
--- a/media/libeffects/preprocessing/PreProcessing.cpp
+++ b/media/libeffects/preprocessing/PreProcessing.cpp
@@ -1700,7 +1700,7 @@
         return -EINVAL;
     }
 
-    memcpy(pDescriptor, sDescriptors[effect->procId], sizeof(effect_descriptor_t));
+    *pDescriptor = *sDescriptors[effect->procId];
 
     return 0;
 }
@@ -1834,7 +1834,7 @@
     if (index >= PREPROC_NUM_EFFECTS) {
         return -EINVAL;
     }
-    memcpy(pDescriptor, sDescriptors[index], sizeof(effect_descriptor_t));
+    *pDescriptor = *sDescriptors[index];
     return 0;
 }
 
@@ -1905,7 +1905,7 @@
 
     ALOGV("PreProcessingLib_GetDescriptor() got fx %s", desc->name);
 
-    memcpy(pDescriptor, desc, sizeof(effect_descriptor_t));
+    *pDescriptor = *desc;
     return 0;
 }
 
diff --git a/media/libeffects/testlibs/EffectEqualizer.cpp b/media/libeffects/testlibs/EffectEqualizer.cpp
index 35a4a61..90ebe1f 100644
--- a/media/libeffects/testlibs/EffectEqualizer.cpp
+++ b/media/libeffects/testlibs/EffectEqualizer.cpp
@@ -136,7 +136,7 @@
     if (index > 0) {
         return -EINVAL;
     }
-    memcpy(pDescriptor, &gEqualizerDescriptor, sizeof(effect_descriptor_t));
+    *pDescriptor = gEqualizerDescriptor;
     return 0;
 } /* end EffectQueryNext */
 
@@ -204,7 +204,7 @@
     }
 
     if (memcmp(uuid, &gEqualizerDescriptor.uuid, sizeof(effect_uuid_t)) == 0) {
-        memcpy(pDescriptor, &gEqualizerDescriptor, sizeof(effect_descriptor_t));
+        *pDescriptor = gEqualizerDescriptor;
         return 0;
     }
 
@@ -262,7 +262,7 @@
     }
     CHECK_ARG(channelCount <= AudioBiquadFilter::MAX_CHANNELS);
 
-    memcpy(&pContext->config, pConfig, sizeof(effect_config_t));
+    pContext->config = *pConfig;
 
     pContext->pEqualizer->configure(channelCount,
                           pConfig->inputCfg.samplingRate);
@@ -290,7 +290,7 @@
 
 void Equalizer_getConfig(EqualizerContext *pContext, effect_config_t *pConfig)
 {
-    memcpy(pConfig, &pContext->config, sizeof(effect_config_t));
+    *pConfig = pContext->config;
 }   // end Equalizer_getConfig
 
 
@@ -752,7 +752,7 @@
         return -EINVAL;
     }
 
-    memcpy(pDescriptor, &android::gEqualizerDescriptor, sizeof(effect_descriptor_t));
+    *pDescriptor = android::gEqualizerDescriptor;
 
     return 0;
 }
diff --git a/media/libeffects/testlibs/EffectReverb.c b/media/libeffects/testlibs/EffectReverb.c
index 8351712..a87a834 100644
--- a/media/libeffects/testlibs/EffectReverb.c
+++ b/media/libeffects/testlibs/EffectReverb.c
@@ -194,7 +194,7 @@
 
     for (i = 0; i < length; i++) {
         if (memcmp(uuid, &gDescriptors[i]->uuid, sizeof(effect_uuid_t)) == 0) {
-            memcpy(pDescriptor, gDescriptors[i], sizeof(effect_descriptor_t));
+            *pDescriptor = *gDescriptors[i];
             ALOGV("EffectGetDescriptor - UUID matched Reverb type %d, UUID = %x",
                  i, gDescriptors[i]->uuid.timeLow);
             return 0;
@@ -440,7 +440,7 @@
         }
     }
 
-    memcpy(pDescriptor, desc, sizeof(effect_descriptor_t));
+    *pDescriptor = *desc;
 
     return 0;
 }   /* end Reverb_getDescriptor */
@@ -546,7 +546,7 @@
         return -EINVAL;
     }
 
-    memcpy(&pRvbModule->config, pConfig, sizeof(effect_config_t));
+    pRvbModule->config = *pConfig;
 
     pReverb->m_nSamplingRate = pRvbModule->config.outputCfg.samplingRate;
 
@@ -644,7 +644,7 @@
 
 void Reverb_getConfig(reverb_module_t *pRvbModule, effect_config_t *pConfig)
 {
-    memcpy(pConfig, &pRvbModule->config, sizeof(effect_config_t));
+    *pConfig = pRvbModule->config;
 }
 
 /*----------------------------------------------------------------------------
diff --git a/media/libeffects/visualizer/EffectVisualizer.cpp b/media/libeffects/visualizer/EffectVisualizer.cpp
index d3c69f4..44baf93 100644
--- a/media/libeffects/visualizer/EffectVisualizer.cpp
+++ b/media/libeffects/visualizer/EffectVisualizer.cpp
@@ -106,7 +106,7 @@
             pConfig->outputCfg.accessMode != EFFECT_BUFFER_ACCESS_ACCUMULATE) return -EINVAL;
     if (pConfig->inputCfg.format != AUDIO_FORMAT_PCM_16_BIT) return -EINVAL;
 
-    memcpy(&pContext->mConfig, pConfig, sizeof(effect_config_t));
+    pContext->mConfig = *pConfig;
 
     Visualizer_reset(pContext);
 
@@ -130,7 +130,7 @@
 
 void Visualizer_getConfig(VisualizerContext *pContext, effect_config_t *pConfig)
 {
-    memcpy(pConfig, &pContext->mConfig, sizeof(effect_config_t));
+    *pConfig = pContext->mConfig;
 }
 
 
@@ -190,7 +190,7 @@
     if (index > 0) {
         return -EINVAL;
     }
-    memcpy(pDescriptor, &gVisualizerDescriptor, sizeof(effect_descriptor_t));
+    *pDescriptor = gVisualizerDescriptor;
     return 0;
 }
 
@@ -253,7 +253,7 @@
     }
 
     if (memcmp(uuid, &gVisualizerDescriptor.uuid, sizeof(effect_uuid_t)) == 0) {
-        memcpy(pDescriptor, &gVisualizerDescriptor, sizeof(effect_descriptor_t));
+        *pDescriptor = gVisualizerDescriptor;
         return 0;
     }
 
@@ -561,7 +561,7 @@
         return -EINVAL;
     }
 
-    memcpy(pDescriptor, &gVisualizerDescriptor, sizeof(effect_descriptor_t));
+    *pDescriptor = gVisualizerDescriptor;
 
     return 0;
 }   /* end Visualizer_getDescriptor */
diff --git a/media/libmedia/Android.mk b/media/libmedia/Android.mk
index c8e1dc7..bcce063 100644
--- a/media/libmedia/Android.mk
+++ b/media/libmedia/Android.mk
@@ -18,6 +18,7 @@
     IAudioTrack.cpp \
     IAudioRecord.cpp \
     ICrypto.cpp \
+    IHDCP.cpp \
     AudioRecord.cpp \
     AudioSystem.cpp \
     mediaplayer.cpp \
diff --git a/media/libmedia/AudioEffect.cpp b/media/libmedia/AudioEffect.cpp
index 34451ca..680604b 100644
--- a/media/libmedia/AudioEffect.cpp
+++ b/media/libmedia/AudioEffect.cpp
@@ -122,19 +122,12 @@
     mSessionId = sessionId;
 
     memset(&mDescriptor, 0, sizeof(effect_descriptor_t));
-    memcpy(&mDescriptor.type, EFFECT_UUID_NULL, sizeof(effect_uuid_t));
-    memcpy(&mDescriptor.uuid, EFFECT_UUID_NULL, sizeof(effect_uuid_t));
-
-    if (type != NULL) {
-        memcpy(&mDescriptor.type, type, sizeof(effect_uuid_t));
-    }
-    if (uuid != NULL) {
-        memcpy(&mDescriptor.uuid, uuid, sizeof(effect_uuid_t));
-    }
+    mDescriptor.type = *(type != NULL ? type : EFFECT_UUID_NULL);
+    mDescriptor.uuid = *(uuid != NULL ? uuid : EFFECT_UUID_NULL);
 
     mIEffectClient = new EffectClient(this);
 
-    iEffect = audioFlinger->createEffect(getpid(), (effect_descriptor_t *)&mDescriptor,
+    iEffect = audioFlinger->createEffect(getpid(), &mDescriptor,
             mIEffectClient, priority, io, mSessionId, &mStatus, &mId, &enabled);
 
     if (iEffect == 0 || (mStatus != NO_ERROR && mStatus != ALREADY_EXISTS)) {
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 0562f8e..5060525 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -18,29 +18,19 @@
 //#define LOG_NDEBUG 0
 #define LOG_TAG "AudioRecord"
 
-#include <stdint.h>
+#include <sys/resource.h>
 #include <sys/types.h>
 
-#include <sched.h>
-#include <sys/resource.h>
+#include <binder/IPCThreadState.h>
+#include <cutils/atomic.h>
+#include <cutils/compiler.h>
+#include <media/AudioRecord.h>
+#include <media/AudioSystem.h>
+#include <system/audio.h>
+#include <utils/Log.h>
 
 #include <private/media/AudioTrackShared.h>
 
-#include <media/AudioSystem.h>
-#include <media/AudioRecord.h>
-#include <media/mediarecorder.h>
-
-#include <binder/IServiceManager.h>
-#include <utils/Log.h>
-#include <binder/Parcel.h>
-#include <binder/IPCThreadState.h>
-#include <utils/Timers.h>
-#include <utils/Atomic.h>
-
-#include <system/audio.h>
-#include <cutils/bitops.h>
-#include <cutils/compiler.h>
-
 namespace android {
 // ---------------------------------------------------------------------------
 
@@ -49,18 +39,23 @@
         int* frameCount,
         uint32_t sampleRate,
         audio_format_t format,
-        int channelCount)
+        audio_channel_mask_t channelMask)
 {
+    if (frameCount == NULL) return BAD_VALUE;
+
+    // default to 0 in case of error
+    *frameCount = 0;
+
     size_t size = 0;
-    if (AudioSystem::getInputBufferSize(sampleRate, format, channelCount, &size)
+    if (AudioSystem::getInputBufferSize(sampleRate, format, channelMask, &size)
             != NO_ERROR) {
         ALOGE("AudioSystem could not query the input buffer size.");
         return NO_INIT;
     }
 
     if (size == 0) {
-        ALOGE("Unsupported configuration: sampleRate %d, format %d, channelCount %d",
-            sampleRate, format, channelCount);
+        ALOGE("Unsupported configuration: sampleRate %d, format %d, channelMask %#x",
+            sampleRate, format, channelMask);
         return BAD_VALUE;
     }
 
@@ -68,6 +63,7 @@
     size <<= 1;
 
     if (audio_is_linear_pcm(format)) {
+        int channelCount = popcount(channelMask);
         size /= channelCount * audio_bytes_per_sample(format);
     }
 
@@ -87,9 +83,8 @@
         audio_source_t inputSource,
         uint32_t sampleRate,
         audio_format_t format,
-        uint32_t channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
-        record_flags flags,
         callback_t cbf,
         void* user,
         int notificationFrames,
@@ -98,7 +93,7 @@
       mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(SP_DEFAULT)
 {
     mStatus = set(inputSource, sampleRate, format, channelMask,
-            frameCount, flags, cbf, user, notificationFrames, sessionId);
+            frameCount, cbf, user, notificationFrames, sessionId);
 }
 
 AudioRecord::~AudioRecord()
@@ -108,9 +103,10 @@
         // it is looping on buffer empty condition in obtainBuffer().
         // Otherwise the callback thread will never exit.
         stop();
-        if (mClientRecordThread != 0) {
-            mClientRecordThread->requestExitAndWait();
-            mClientRecordThread.clear();
+        if (mAudioRecordThread != 0) {
+            mAudioRecordThread->requestExit();  // see comment in AudioRecord.h
+            mAudioRecordThread->requestExitAndWait();
+            mAudioRecordThread.clear();
         }
         mAudioRecord.clear();
         IPCThreadState::self()->flushCommands();
@@ -122,9 +118,8 @@
         audio_source_t inputSource,
         uint32_t sampleRate,
         audio_format_t format,
-        uint32_t channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
-        record_flags flags,
         callback_t cbf,
         void* user,
         int notificationFrames,
@@ -132,7 +127,7 @@
         int sessionId)
 {
 
-    ALOGV("set(): sampleRate %d, channelMask %d, frameCount %d",sampleRate, channelMask, frameCount);
+    ALOGV("set(): sampleRate %d, channelMask %#x, frameCount %d",sampleRate, channelMask, frameCount);
 
     AutoMutex lock(mLock);
 
@@ -174,7 +169,6 @@
                                                     sampleRate,
                                                     format,
                                                     channelMask,
-                                                    (audio_in_acoustics_t)flags,
                                                     mSessionId);
     if (input == 0) {
         ALOGE("Could not get audio input for record source %d", inputSource);
@@ -207,7 +201,8 @@
     }
 
     if (cbf != NULL) {
-        mClientRecordThread = new ClientRecordThread(*this, threadCanCallJava);
+        mAudioRecordThread = new AudioRecordThread(*this, threadCanCallJava);
+        mAudioRecordThread->run("AudioRecord", ANDROID_PRIORITY_AUDIO);
     }
 
     mStatus = NO_ERROR;
@@ -217,7 +212,7 @@
     mFrameCount = mCblk->frameCount;
     mChannelCount = (uint8_t)channelCount;
     mChannelMask = channelMask;
-    mActive = 0;
+    mActive = false;
     mCbf = cbf;
     mNotificationFrames = notificationFrames;
     mRemainingFrames = notificationFrames;
@@ -229,7 +224,6 @@
     mNewPosition = 0;
     mUpdatePeriod = 0;
     mInputSource = inputSource;
-    mFlags = flags;
     mInput = input;
     AudioSystem::acquireAudioSessionId(mSessionId);
 
@@ -282,41 +276,19 @@
 status_t AudioRecord::start(AudioSystem::sync_event_t event, int triggerSession)
 {
     status_t ret = NO_ERROR;
-    sp<ClientRecordThread> t = mClientRecordThread;
+    sp<AudioRecordThread> t = mAudioRecordThread;
 
     ALOGV("start, sync event %d trigger session %d", event, triggerSession);
 
-    if (t != 0) {
-        if (t->exitPending()) {
-            if (t->requestExitAndWait() == WOULD_BLOCK) {
-                ALOGE("AudioRecord::start called from thread");
-                return WOULD_BLOCK;
-            }
-        }
-    }
-
     AutoMutex lock(mLock);
     // acquire a strong reference on the IAudioRecord and IMemory so that they cannot be destroyed
     // while we are accessing the cblk
     sp<IAudioRecord> audioRecord = mAudioRecord;
     sp<IMemory> iMem = mCblkMemory;
     audio_track_cblk_t* cblk = mCblk;
-    if (mActive == 0) {
-        mActive = 1;
 
-        pid_t tid;
-        if (t != 0) {
-            mReadyToRun = WOULD_BLOCK;
-            t->run("AudioRecord", ANDROID_PRIORITY_AUDIO);
-            tid = t->getTid();  // pid_t is unknown until run()
-            ALOGV("getTid=%d", tid);
-            if (tid == -1) {
-                tid = 0;
-            }
-            // thread blocks in readyToRun()
-        } else {
-            tid = 0;    // not gettid()
-        }
+    if (!mActive) {
+        mActive = true;
 
         cblk->lock.lock();
         if (!(cblk->flags & CBLK_INVALID_MSK)) {
@@ -338,58 +310,51 @@
                                             AudioSystem::kSyncRecordStartTimeOutMs;
             cblk->waitTimeMs = 0;
             if (t != 0) {
-                // thread unblocks in readyToRun() and returns NO_ERROR
-                mReadyToRun = NO_ERROR;
-                mCondition.signal();
+                t->resume();
             } else {
                 mPreviousPriority = getpriority(PRIO_PROCESS, 0);
                 get_sched_policy(0, &mPreviousSchedulingGroup);
                 androidSetThreadPriority(0, ANDROID_PRIORITY_AUDIO);
             }
         } else {
-            mActive = 0;
-            // thread unblocks in readyToRun() and returns NO_INIT
-            mReadyToRun = NO_INIT;
-            mCondition.signal();
+            mActive = false;
         }
     }
 
     return ret;
 }
 
-status_t AudioRecord::stop()
+void AudioRecord::stop()
 {
-    sp<ClientRecordThread> t = mClientRecordThread;
+    sp<AudioRecordThread> t = mAudioRecordThread;
 
     ALOGV("stop");
 
     AutoMutex lock(mLock);
-    if (mActive == 1) {
-        mActive = 0;
+    if (mActive) {
+        mActive = false;
         mCblk->cv.signal();
         mAudioRecord->stop();
         // the record head position will reset to 0, so if a marker is set, we need
         // to activate it again
         mMarkerReached = false;
         if (t != 0) {
-            t->requestExit();
+            t->pause();
         } else {
             setpriority(PRIO_PROCESS, 0, mPreviousPriority);
             set_sched_policy(0, mPreviousSchedulingGroup);
         }
     }
-
-    return NO_ERROR;
 }
 
 bool AudioRecord::stopped() const
 {
+    AutoMutex lock(mLock);
     return !mActive;
 }
 
 uint32_t AudioRecord::getSampleRate() const
 {
-    AutoMutex lock(mLock);
     return mCblk->sampleRate;
 }
 
@@ -397,6 +362,7 @@
 {
     if (mCbf == NULL) return INVALID_OPERATION;
 
+    AutoMutex lock(mLock);
     mMarkerPosition = marker;
     mMarkerReached = false;
 
@@ -407,6 +373,7 @@
 {
     if (marker == NULL) return BAD_VALUE;
 
+    AutoMutex lock(mLock);
     *marker = mMarkerPosition;
 
     return NO_ERROR;
@@ -418,6 +385,8 @@
 
     uint32_t curPosition;
     getPosition(&curPosition);
+
+    AutoMutex lock(mLock);
     mNewPosition = curPosition + updatePeriod;
     mUpdatePeriod = updatePeriod;
 
@@ -428,6 +397,7 @@
 {
     if (updatePeriod == NULL) return BAD_VALUE;
 
+    AutoMutex lock(mLock);
     *updatePeriod = mUpdatePeriod;
 
     return NO_ERROR;
@@ -445,10 +415,8 @@
 
 unsigned int AudioRecord::getInputFramesLost() const
 {
-    if (mActive)
-        return AudioSystem::getInputFramesLost(mInput);
-    else
-        return 0;
+    // no need to check mActive, because if inactive this will return 0, which is what we want
+    return AudioSystem::getInputFramesLost(mInput);
 }
 
 // -------------------------------------------------------------------------
@@ -457,7 +425,7 @@
 status_t AudioRecord::openRecord_l(
         uint32_t sampleRate,
         audio_format_t format,
-        uint32_t channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
         audio_io_handle_t input)
 {
@@ -467,13 +435,20 @@
         return NO_INIT;
     }
 
+    pid_t tid = -1;
+    // FIXME see similar logic at AudioTrack
+
+    int originalSessionId = mSessionId;
     sp<IAudioRecord> record = audioFlinger->openRecord(getpid(), input,
                                                        sampleRate, format,
                                                        channelMask,
                                                        frameCount,
                                                        IAudioFlinger::TRACK_DEFAULT,
+                                                       tid,
                                                        &mSessionId,
                                                        &status);
+    ALOGE_IF(originalSessionId != 0 && mSessionId != originalSessionId,
+            "session ID changed from %d to %d", originalSessionId, mSessionId);
 
     if (record == 0) {
         ALOGE("AudioFlinger could not create record track, status: %d", status);
@@ -499,7 +474,7 @@
 status_t AudioRecord::obtainBuffer(Buffer* audioBuffer, int32_t waitCount)
 {
     AutoMutex lock(mLock);
-    int active;
+    bool active;
     status_t result = NO_ERROR;
     audio_track_cblk_t* cblk = mCblk;
     uint32_t framesReq = audioBuffer->frameCount;
@@ -528,7 +503,7 @@
                 result = cblk->cv.waitRelative(cblk->lock, milliseconds(waitTimeMs));
                 cblk->lock.unlock();
                 mLock.lock();
-                if (mActive == 0) {
+                if (!mActive) {
                     return status_t(STOPPED);
                 }
                 cblk->lock.lock();
@@ -613,13 +588,13 @@
                                 mCblk->sampleRate,
                                 mFormat,
                                 mChannelMask,
-                                (audio_in_acoustics_t)mFlags,
                                 mSessionId);
     return mInput;
 }
 
 int AudioRecord::getSessionId() const
 {
+    // no lock needed because session ID doesn't change after first set()
     return mSessionId;
 }
 
@@ -678,7 +653,7 @@
 
 // -------------------------------------------------------------------------
 
-bool AudioRecord::processAudioBuffer(const sp<ClientRecordThread>& thread)
+bool AudioRecord::processAudioBuffer(const sp<AudioRecordThread>& thread)
 {
     Buffer audioBuffer;
     uint32_t frames = mRemainingFrames;
@@ -690,22 +665,32 @@
     sp<IAudioRecord> audioRecord = mAudioRecord;
     sp<IMemory> iMem = mCblkMemory;
     audio_track_cblk_t* cblk = mCblk;
+    bool active = mActive;
+    uint32_t markerPosition = mMarkerPosition;
+    uint32_t newPosition = mNewPosition;
+    uint32_t user = cblk->user;
+    // determine whether a marker callback will be needed, while locked
+    bool needMarker = !mMarkerReached && (mMarkerPosition > 0) && (user >= mMarkerPosition);
+    if (needMarker) {
+        mMarkerReached = true;
+    }
+    // determine the number of new position callback(s) that will be needed, while locked
+    uint32_t updatePeriod = mUpdatePeriod;
+    uint32_t needNewPos = updatePeriod > 0 && user >= newPosition ?
+            ((user - newPosition) / updatePeriod) + 1 : 0;
+    mNewPosition = newPosition + updatePeriod * needNewPos;
     mLock.unlock();
 
-    // Manage marker callback
-    if (!mMarkerReached && (mMarkerPosition > 0)) {
-        if (cblk->user >= mMarkerPosition) {
-            mCbf(EVENT_MARKER, mUserData, (void *)&mMarkerPosition);
-            mMarkerReached = true;
-        }
+    // perform marker callback, while unlocked
+    if (needMarker) {
+        mCbf(EVENT_MARKER, mUserData, &markerPosition);
     }
 
-    // Manage new position callback
-    if (mUpdatePeriod > 0) {
-        while (cblk->user >= mNewPosition) {
-            mCbf(EVENT_NEW_POS, mUserData, (void *)&mNewPosition);
-            mNewPosition += mUpdatePeriod;
-        }
+    // perform new position callback(s), while unlocked
+    for (; needNewPos > 0; --needNewPos) {
+        uint32_t temp = newPosition;
+        mCbf(EVENT_NEW_POS, mUserData, &temp);
+        newPosition += updatePeriod;
     }
 
     do {
@@ -748,10 +733,12 @@
 
 
     // Manage overrun callback
-    if (mActive && (cblk->framesAvailable() == 0)) {
+    if (active && (cblk->framesAvailable() == 0)) {
+        // The value of active is stale, but we are almost sure to be active here because
+        // otherwise we would have exited when obtainBuffer returned STOPPED earlier.
         ALOGV("Overrun user: %x, server: %x, flags %04x", cblk->user, cblk->server, cblk->flags);
         if (!(android_atomic_or(CBLK_UNDERRUN_ON, &cblk->flags) & CBLK_UNDERRUN_MSK)) {
-            mCbf(EVENT_OVERRUN, mUserData, 0);
+            mCbf(EVENT_OVERRUN, mUserData, NULL);
         }
     }
 
@@ -805,7 +792,7 @@
             result = NO_ERROR;
             cblk->lock.unlock();
         }
-        if (result != NO_ERROR || mActive == 0) {
+        if (result != NO_ERROR || !mActive) {
             result = status_t(STOPPED);
         }
     }
@@ -825,23 +812,51 @@
 
 // =========================================================================
 
-AudioRecord::ClientRecordThread::ClientRecordThread(AudioRecord& receiver, bool bCanCallJava)
-    : Thread(bCanCallJava), mReceiver(receiver)
+AudioRecord::AudioRecordThread::AudioRecordThread(AudioRecord& receiver, bool bCanCallJava)
+    : Thread(bCanCallJava), mReceiver(receiver), mPaused(true)
 {
 }
 
-bool AudioRecord::ClientRecordThread::threadLoop()
+AudioRecord::AudioRecordThread::~AudioRecordThread()
 {
-    return mReceiver.processAudioBuffer(this);
 }
 
-status_t AudioRecord::ClientRecordThread::readyToRun()
+bool AudioRecord::AudioRecordThread::threadLoop()
 {
-    AutoMutex(mReceiver.mLock);
-    while (mReceiver.mReadyToRun == WOULD_BLOCK) {
-        mReceiver.mCondition.wait(mReceiver.mLock);
+    {
+        AutoMutex _l(mMyLock);
+        if (mPaused) {
+            mMyCond.wait(mMyLock);
+            // caller will check for exitPending()
+            return true;
+        }
     }
-    return mReceiver.mReadyToRun;
+    if (!mReceiver.processAudioBuffer(this)) {
+        pause();
+    }
+    return true;
+}
+
+void AudioRecord::AudioRecordThread::requestExit()
+{
+    // must be in this order to avoid a race condition
+    Thread::requestExit();
+    resume();
+}
+
+void AudioRecord::AudioRecordThread::pause()
+{
+    AutoMutex _l(mMyLock);
+    mPaused = true;
+}
+
+void AudioRecord::AudioRecordThread::resume()
+{
+    AutoMutex _l(mMyLock);
+    if (mPaused) {
+        mPaused = false;
+        mMyCond.signal();
+    }
 }
 
 // -------------------------------------------------------------------------
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 4c41ba5..6e0c620 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -41,7 +41,7 @@
 // Cached values for recording queries, all protected by gLock
 uint32_t AudioSystem::gPrevInSamplingRate = 16000;
 audio_format_t AudioSystem::gPrevInFormat = AUDIO_FORMAT_PCM_16_BIT;
-int AudioSystem::gPrevInChannelCount = 1;
+audio_channel_mask_t AudioSystem::gPrevInChannelMask = AUDIO_CHANNEL_IN_MONO;
 size_t AudioSystem::gInBuffSize = 0;
 
 
@@ -334,25 +334,25 @@
     return NO_ERROR;
 }
 
-status_t AudioSystem::getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount,
-    size_t* buffSize)
+status_t AudioSystem::getInputBufferSize(uint32_t sampleRate, audio_format_t format,
+        audio_channel_mask_t channelMask, size_t* buffSize)
 {
     gLock.lock();
     // Do we have a stale gInBufferSize or are we requesting the input buffer size for new values
     size_t inBuffSize = gInBuffSize;
     if ((inBuffSize == 0) || (sampleRate != gPrevInSamplingRate) || (format != gPrevInFormat)
-        || (channelCount != gPrevInChannelCount)) {
+        || (channelMask != gPrevInChannelMask)) {
         gLock.unlock();
         const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
         if (af == 0) {
             return PERMISSION_DENIED;
         }
-        inBuffSize = af->getInputBufferSize(sampleRate, format, channelCount);
+        inBuffSize = af->getInputBufferSize(sampleRate, format, channelMask);
         gLock.lock();
         // save the request params
         gPrevInSamplingRate = sampleRate;
         gPrevInFormat = format;
-        gPrevInChannelCount = channelCount;
+        gPrevInChannelMask = channelMask;
 
         gInBuffSize = inBuffSize;
     }
@@ -449,7 +449,7 @@
 
         OutputDescriptor *outputDesc =  new OutputDescriptor(*desc);
         gOutputs.add(ioHandle, outputDesc);
-        ALOGV("ioConfigChanged() new output samplingRate %d, format %d channels %d frameCount %d latency %d",
+        ALOGV("ioConfigChanged() new output samplingRate %d, format %d channels %#x frameCount %d latency %d",
                 outputDesc->samplingRate, outputDesc->format, outputDesc->channels, outputDesc->frameCount, outputDesc->latency);
         } break;
     case OUTPUT_CLOSED: {
@@ -471,7 +471,7 @@
         if (param2 == NULL) break;
         desc = (const OutputDescriptor *)param2;
 
-        ALOGV("ioConfigChanged() new config for output %d samplingRate %d, format %d channels %d frameCount %d latency %d",
+        ALOGV("ioConfigChanged() new config for output %d samplingRate %d, format %d channels %#x frameCount %d latency %d",
                 ioHandle, desc->samplingRate, desc->format,
                 desc->channels, desc->frameCount, desc->latency);
         OutputDescriptor *outputDesc = gOutputs.valueAt(index);
@@ -588,12 +588,12 @@
 audio_io_handle_t AudioSystem::getOutput(audio_stream_type_t stream,
                                     uint32_t samplingRate,
                                     audio_format_t format,
-                                    uint32_t channels,
+                                    audio_channel_mask_t channelMask,
                                     audio_output_flags_t flags)
 {
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
     if (aps == 0) return 0;
-    return aps->getOutput(stream, samplingRate, format, channels, flags);
+    return aps->getOutput(stream, samplingRate, format, channelMask, flags);
 }
 
 status_t AudioSystem::startOutput(audio_io_handle_t output,
@@ -624,13 +624,12 @@
 audio_io_handle_t AudioSystem::getInput(audio_source_t inputSource,
                                     uint32_t samplingRate,
                                     audio_format_t format,
-                                    uint32_t channels,
-                                    audio_in_acoustics_t acoustics,
+                                    audio_channel_mask_t channelMask,
                                     int sessionId)
 {
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
     if (aps == 0) return 0;
-    return aps->getInput(inputSource, samplingRate, format, channels, acoustics, sessionId);
+    return aps->getInput(inputSource, samplingRate, format, channelMask, sessionId);
 }
 
 status_t AudioSystem::startInput(audio_io_handle_t input)
@@ -695,14 +694,14 @@
     return aps->getDevicesForStream(stream);
 }
 
-audio_io_handle_t AudioSystem::getOutputForEffect(effect_descriptor_t *desc)
+audio_io_handle_t AudioSystem::getOutputForEffect(const effect_descriptor_t *desc)
 {
     const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
     if (aps == 0) return PERMISSION_DENIED;
     return aps->getOutputForEffect(desc);
 }
 
-status_t AudioSystem::registerEffect(effect_descriptor_t *desc,
+status_t AudioSystem::registerEffect(const effect_descriptor_t *desc,
                                 audio_io_handle_t io,
                                 uint32_t strategy,
                                 int session,
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index e5a60f5..362d022 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -54,6 +54,11 @@
         audio_stream_type_t streamType,
         uint32_t sampleRate)
 {
+    if (frameCount == NULL) return BAD_VALUE;
+
+    // default to 0 in case of error
+    *frameCount = 0;
+
     // FIXME merge with similar code in createTrack_l(), except we're missing
     //       some information here that is available in createTrack_l():
     //          audio_io_handle_t output
@@ -98,7 +103,7 @@
         audio_stream_type_t streamType,
         uint32_t sampleRate,
         audio_format_t format,
-        int channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
         audio_output_flags_t flags,
         callback_t cbf,
@@ -131,7 +136,8 @@
       mIsTimed(false),
       mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(SP_DEFAULT)
 {
-    mStatus = set((audio_stream_type_t)streamType, sampleRate, (audio_format_t)format, channelMask,
+    mStatus = set((audio_stream_type_t)streamType, sampleRate, (audio_format_t)format,
+            (audio_channel_mask_t) channelMask,
             frameCount, (audio_output_flags_t)flags, cbf, user, notificationFrames,
             0 /*sharedBuffer*/, false /*threadCanCallJava*/, sessionId);
 }
@@ -140,7 +146,7 @@
         audio_stream_type_t streamType,
         uint32_t sampleRate,
         audio_format_t format,
-        int channelMask,
+        audio_channel_mask_t channelMask,
         const sp<IMemory>& sharedBuffer,
         audio_output_flags_t flags,
         callback_t cbf,
@@ -181,7 +187,7 @@
         audio_stream_type_t streamType,
         uint32_t sampleRate,
         audio_format_t format,
-        int channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
         audio_output_flags_t flags,
         callback_t cbf,
@@ -247,7 +253,7 @@
     }
 
     if (!audio_is_output_channel(channelMask)) {
-        ALOGE("Invalid channel mask");
+        ALOGE("Invalid channel mask %#x", channelMask);
         return BAD_VALUE;
     }
     uint32_t channelCount = popcount(channelMask);
@@ -281,7 +287,7 @@
     status_t status = createTrack_l(streamType,
                                   sampleRate,
                                   format,
-                                  (uint32_t)channelMask,
+                                  channelMask,
                                   frameCount,
                                   flags,
                                   sharedBuffer,
@@ -299,7 +305,7 @@
 
     mStreamType = streamType;
     mFormat = format;
-    mChannelMask = (uint32_t)channelMask;
+    mChannelMask = channelMask;
     mChannelCount = channelCount;
     mSharedBuffer = sharedBuffer;
     mMuted = false;
@@ -367,7 +373,6 @@
 void AudioTrack::start()
 {
     sp<AudioTrackThread> t = mAudioTrackThread;
-    status_t status = NO_ERROR;
 
     ALOGV("start %p", this);
 
@@ -395,6 +400,7 @@
         }
 
         ALOGV("start %p before lock cblk %p", this, mCblk);
+        status_t status = NO_ERROR;
         if (!(cblk->flags & CBLK_INVALID_MSK)) {
             cblk->lock.unlock();
             ALOGV("mAudioTrack->start()");
@@ -744,7 +750,7 @@
         audio_stream_type_t streamType,
         uint32_t sampleRate,
         audio_format_t format,
-        uint32_t channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
         audio_output_flags_t flags,
         const sp<IMemory>& sharedBuffer,
@@ -1138,7 +1144,7 @@
 
     // If the track is not invalid already, try to allocate a buffer.  alloc
     // fails indicating that the server is dead, flag the track as invalid so
-    // we can attempt to restore in in just a bit.
+    // we can attempt to restore in just a bit.
     if (!(mCblk->flags & CBLK_INVALID_MSK)) {
         result = mAudioTrack->allocateTimedBuffer(size, buffer);
         if (result == DEAD_OBJECT) {
@@ -1472,15 +1478,6 @@
     return true;
 }
 
-status_t AudioTrack::AudioTrackThread::readyToRun()
-{
-    return NO_ERROR;
-}
-
-void AudioTrack::AudioTrackThread::onFirstRef()
-{
-}
-
 void AudioTrack::AudioTrackThread::requestExit()
 {
     // must be in this order to avoid a race condition
diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp
index e8dd438..71e7c31 100644
--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -32,7 +32,7 @@
     CREATE_TRACK = IBinder::FIRST_CALL_TRANSACTION,
     OPEN_RECORD,
     SAMPLE_RATE,
-    CHANNEL_COUNT,
+    CHANNEL_COUNT,  // obsolete
     FORMAT,
     FRAME_COUNT,
     LATENCY,
@@ -86,7 +86,7 @@
                                 audio_stream_type_t streamType,
                                 uint32_t sampleRate,
                                 audio_format_t format,
-                                uint32_t channelMask,
+                                audio_channel_mask_t channelMask,
                                 int frameCount,
                                 track_flags_t flags,
                                 const sp<IMemory>& sharedBuffer,
@@ -135,9 +135,10 @@
                                 audio_io_handle_t input,
                                 uint32_t sampleRate,
                                 audio_format_t format,
-                                uint32_t channelMask,
+                                audio_channel_mask_t channelMask,
                                 int frameCount,
                                 track_flags_t flags,
+                                pid_t tid,
                                 int *sessionId,
                                 status_t *status)
     {
@@ -151,6 +152,7 @@
         data.writeInt32(channelMask);
         data.writeInt32(frameCount);
         data.writeInt32(flags);
+        data.writeInt32((int32_t) tid);
         int lSessionId = 0;
         if (sessionId != NULL) {
             lSessionId = *sessionId;
@@ -182,6 +184,7 @@
         return reply.readInt32();
     }
 
+#if 0
     virtual int channelCount(audio_io_handle_t output) const
     {
         Parcel data, reply;
@@ -190,6 +193,7 @@
         remote()->transact(CHANNEL_COUNT, data, &reply);
         return reply.readInt32();
     }
+#endif
 
     virtual audio_format_t format(audio_io_handle_t output) const
     {
@@ -347,13 +351,14 @@
         remote()->transact(REGISTER_CLIENT, data, &reply);
     }
 
-    virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const
+    virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format,
+            audio_channel_mask_t channelMask) const
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor());
         data.writeInt32(sampleRate);
         data.writeInt32(format);
-        data.writeInt32(channelCount);
+        data.writeInt32(channelMask);
         remote()->transact(GET_INPUTBUFFERSIZE, data, &reply);
         return reply.readInt32();
     }
@@ -698,7 +703,7 @@
             int streamType = data.readInt32();
             uint32_t sampleRate = data.readInt32();
             audio_format_t format = (audio_format_t) data.readInt32();
-            int channelCount = data.readInt32();
+            audio_channel_mask_t channelMask = data.readInt32();
             size_t bufferCount = data.readInt32();
             track_flags_t flags = (track_flags_t) data.readInt32();
             sp<IMemory> buffer = interface_cast<IMemory>(data.readStrongBinder());
@@ -708,7 +713,7 @@
             status_t status;
             sp<IAudioTrack> track = createTrack(pid,
                     (audio_stream_type_t) streamType, sampleRate, format,
-                    channelCount, bufferCount, flags, buffer, output, tid, &sessionId, &status);
+                    channelMask, bufferCount, flags, buffer, output, tid, &sessionId, &status);
             reply->writeInt32(sessionId);
             reply->writeInt32(status);
             reply->writeStrongBinder(track->asBinder());
@@ -720,13 +725,14 @@
             audio_io_handle_t input = (audio_io_handle_t) data.readInt32();
             uint32_t sampleRate = data.readInt32();
             audio_format_t format = (audio_format_t) data.readInt32();
-            int channelCount = data.readInt32();
+            audio_channel_mask_t channelMask = data.readInt32();
             size_t bufferCount = data.readInt32();
             track_flags_t flags = (track_flags_t) data.readInt32();
+            pid_t tid = (pid_t) data.readInt32();
             int sessionId = data.readInt32();
             status_t status;
             sp<IAudioRecord> record = openRecord(pid, input,
-                    sampleRate, format, channelCount, bufferCount, flags, &sessionId, &status);
+                    sampleRate, format, channelMask, bufferCount, flags, tid, &sessionId, &status);
             reply->writeInt32(sessionId);
             reply->writeInt32(status);
             reply->writeStrongBinder(record->asBinder());
@@ -737,11 +743,13 @@
             reply->writeInt32( sampleRate((audio_io_handle_t) data.readInt32()) );
             return NO_ERROR;
         } break;
+#if 0
         case CHANNEL_COUNT: {
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             reply->writeInt32( channelCount((audio_io_handle_t) data.readInt32()) );
             return NO_ERROR;
         } break;
+#endif
         case FORMAT: {
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             reply->writeInt32( format((audio_io_handle_t) data.readInt32()) );
@@ -846,8 +854,8 @@
             CHECK_INTERFACE(IAudioFlinger, data, reply);
             uint32_t sampleRate = data.readInt32();
             audio_format_t format = (audio_format_t) data.readInt32();
-            int channelCount = data.readInt32();
-            reply->writeInt32( getInputBufferSize(sampleRate, format, channelCount) );
+            audio_channel_mask_t channelMask = data.readInt32();
+            reply->writeInt32( getInputBufferSize(sampleRate, format, channelMask) );
             return NO_ERROR;
         } break;
         case OPEN_OUTPUT: {
diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp
index 7aab8d6..31c5d27 100644
--- a/media/libmedia/IAudioPolicyService.cpp
+++ b/media/libmedia/IAudioPolicyService.cpp
@@ -123,7 +123,7 @@
                                         audio_stream_type_t stream,
                                         uint32_t samplingRate,
                                         audio_format_t format,
-                                        uint32_t channels,
+                                        audio_channel_mask_t channelMask,
                                         audio_output_flags_t flags)
     {
         Parcel data, reply;
@@ -131,7 +131,7 @@
         data.writeInt32(static_cast <uint32_t>(stream));
         data.writeInt32(samplingRate);
         data.writeInt32(static_cast <uint32_t>(format));
-        data.writeInt32(channels);
+        data.writeInt32(channelMask);
         data.writeInt32(static_cast <uint32_t>(flags));
         remote()->transact(GET_OUTPUT, data, &reply);
         return static_cast <audio_io_handle_t> (reply.readInt32());
@@ -175,8 +175,7 @@
                                     audio_source_t inputSource,
                                     uint32_t samplingRate,
                                     audio_format_t format,
-                                    uint32_t channels,
-                                    audio_in_acoustics_t acoustics,
+                                    audio_channel_mask_t channelMask,
                                     int audioSession)
     {
         Parcel data, reply;
@@ -184,8 +183,7 @@
         data.writeInt32((int32_t) inputSource);
         data.writeInt32(samplingRate);
         data.writeInt32(static_cast <uint32_t>(format));
-        data.writeInt32(channels);
-        data.writeInt32(static_cast <uint32_t>(acoustics));
+        data.writeInt32(channelMask);
         data.writeInt32(audioSession);
         remote()->transact(GET_INPUT, data, &reply);
         return static_cast <audio_io_handle_t> (reply.readInt32());
@@ -276,7 +274,7 @@
         return (audio_devices_t) reply.readInt32();
     }
 
-    virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc)
+    virtual audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor());
@@ -285,7 +283,7 @@
         return static_cast <audio_io_handle_t> (reply.readInt32());
     }
 
-    virtual status_t registerEffect(effect_descriptor_t *desc,
+    virtual status_t registerEffect(const effect_descriptor_t *desc,
                                         audio_io_handle_t io,
                                         uint32_t strategy,
                                         int session,
@@ -417,14 +415,14 @@
                     static_cast <audio_stream_type_t>(data.readInt32());
             uint32_t samplingRate = data.readInt32();
             audio_format_t format = (audio_format_t) data.readInt32();
-            uint32_t channels = data.readInt32();
+            audio_channel_mask_t channelMask = data.readInt32();
             audio_output_flags_t flags =
                     static_cast <audio_output_flags_t>(data.readInt32());
 
             audio_io_handle_t output = getOutput(stream,
                                                  samplingRate,
                                                  format,
-                                                 channels,
+                                                 channelMask,
                                                  flags);
             reply->writeInt32(static_cast <int>(output));
             return NO_ERROR;
@@ -464,15 +462,12 @@
             audio_source_t inputSource = (audio_source_t) data.readInt32();
             uint32_t samplingRate = data.readInt32();
             audio_format_t format = (audio_format_t) data.readInt32();
-            uint32_t channels = data.readInt32();
-            audio_in_acoustics_t acoustics =
-                    static_cast <audio_in_acoustics_t>(data.readInt32());
+            audio_channel_mask_t channelMask = data.readInt32();
             int audioSession = data.readInt32();
             audio_io_handle_t input = getInput(inputSource,
                                                samplingRate,
                                                format,
-                                               channels,
-                                               acoustics,
+                                               channelMask,
                                                audioSession);
             reply->writeInt32(static_cast <int>(input));
             return NO_ERROR;
diff --git a/media/libmedia/IAudioRecord.cpp b/media/libmedia/IAudioRecord.cpp
index 57a80a9..0d06e98 100644
--- a/media/libmedia/IAudioRecord.cpp
+++ b/media/libmedia/IAudioRecord.cpp
@@ -42,7 +42,7 @@
     {
     }
 
-    virtual status_t start(int event, int triggerSession)
+    virtual status_t start(int /*AudioSystem::sync_event_t*/ event, int triggerSession)
     {
         Parcel data, reply;
         data.writeInterfaceToken(IAudioRecord::getInterfaceDescriptor());
@@ -92,7 +92,7 @@
         } break;
         case START: {
             CHECK_INTERFACE(IAudioRecord, data, reply);
-            int event = data.readInt32();
+            int /*AudioSystem::sync_event_t*/ event = data.readInt32();
             int triggerSession = data.readInt32();
             reply->writeInt32(start(event, triggerSession));
             return NO_ERROR;
diff --git a/media/libmedia/IHDCP.cpp b/media/libmedia/IHDCP.cpp
new file mode 100644
index 0000000..493f5a4
--- /dev/null
+++ b/media/libmedia/IHDCP.cpp
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "IHDCP"
+#include <utils/Log.h>
+
+#include <binder/Parcel.h>
+#include <media/IHDCP.h>
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/foundation/ADebug.h>
+
+namespace android {
+
+enum {
+    OBSERVER_NOTIFY = IBinder::FIRST_CALL_TRANSACTION,
+    HDCP_SET_OBSERVER,
+    HDCP_INIT_ASYNC,
+    HDCP_SHUTDOWN_ASYNC,
+    HDCP_ENCRYPT,
+};
+
+struct BpHDCPObserver : public BpInterface<IHDCPObserver> {
+    BpHDCPObserver(const sp<IBinder> &impl)
+        : BpInterface<IHDCPObserver>(impl) {
+    }
+
+    virtual void notify(
+            int msg, int ext1, int ext2, const Parcel *obj) {
+        Parcel data, reply;
+        data.writeInterfaceToken(IHDCPObserver::getInterfaceDescriptor());
+        data.writeInt32(msg);
+        data.writeInt32(ext1);
+        data.writeInt32(ext2);
+        if (obj && obj->dataSize() > 0) {
+            data.appendFrom(const_cast<Parcel *>(obj), 0, obj->dataSize());
+        }
+        remote()->transact(OBSERVER_NOTIFY, data, &reply, IBinder::FLAG_ONEWAY);
+    }
+};
+
+IMPLEMENT_META_INTERFACE(HDCPObserver, "android.hardware.IHDCPObserver");
+
+struct BpHDCP : public BpInterface<IHDCP> {
+    BpHDCP(const sp<IBinder> &impl)
+        : BpInterface<IHDCP>(impl) {
+    }
+
+    virtual status_t setObserver(const sp<IHDCPObserver> &observer) {
+        Parcel data, reply;
+        data.writeInterfaceToken(IHDCP::getInterfaceDescriptor());
+        data.writeStrongBinder(observer->asBinder());
+        remote()->transact(HDCP_SET_OBSERVER, data, &reply);
+        return reply.readInt32();
+    }
+
+    virtual status_t initAsync(const char *host, unsigned port) {
+        Parcel data, reply;
+        data.writeInterfaceToken(IHDCP::getInterfaceDescriptor());
+        data.writeCString(host);
+        data.writeInt32(port);
+        remote()->transact(HDCP_INIT_ASYNC, data, &reply);
+        return reply.readInt32();
+    }
+
+    virtual status_t shutdownAsync() {
+        Parcel data, reply;
+        data.writeInterfaceToken(IHDCP::getInterfaceDescriptor());
+        remote()->transact(HDCP_SHUTDOWN_ASYNC, data, &reply);
+        return reply.readInt32();
+    }
+
+    virtual status_t encrypt(
+            const void *inData, size_t size, uint32_t streamCTR,
+            uint64_t *outInputCTR, void *outData) {
+        Parcel data, reply;
+        data.writeInterfaceToken(IHDCP::getInterfaceDescriptor());
+        data.writeInt32(size);
+        data.write(inData, size);
+        data.writeInt32(streamCTR);
+        remote()->transact(HDCP_ENCRYPT, data, &reply);
+
+        status_t err = reply.readInt32();
+
+        if (err != OK) {
+            *outInputCTR = 0;
+
+            return err;
+        }
+
+        *outInputCTR = reply.readInt64();
+        reply.read(outData, size);
+
+        return err;
+    }
+};
+
+IMPLEMENT_META_INTERFACE(HDCP, "android.hardware.IHDCP");
+
+status_t BnHDCPObserver::onTransact(
+        uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) {
+    switch (code) {
+        case OBSERVER_NOTIFY:
+        {
+            CHECK_INTERFACE(IHDCPObserver, data, reply);
+
+            int msg = data.readInt32();
+            int ext1 = data.readInt32();
+            int ext2 = data.readInt32();
+
+            Parcel obj;
+            if (data.dataAvail() > 0) {
+                obj.appendFrom(
+                        const_cast<Parcel *>(&data),
+                        data.dataPosition(),
+                        data.dataAvail());
+            }
+
+            notify(msg, ext1, ext2, &obj);
+
+            return OK;
+        }
+
+        default:
+            return BBinder::onTransact(code, data, reply, flags);
+    }
+}
+
+status_t BnHDCP::onTransact(
+        uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) {
+    switch (code) {
+        case HDCP_SET_OBSERVER:
+        {
+            CHECK_INTERFACE(IHDCP, data, reply);
+
+            sp<IHDCPObserver> observer =
+                interface_cast<IHDCPObserver>(data.readStrongBinder());
+
+            reply->writeInt32(setObserver(observer));
+            return OK;
+        }
+
+        case HDCP_INIT_ASYNC:
+        {
+            CHECK_INTERFACE(IHDCP, data, reply);
+
+            const char *host = data.readCString();
+            unsigned port = data.readInt32();
+
+            reply->writeInt32(initAsync(host, port));
+            return OK;
+        }
+
+        case HDCP_SHUTDOWN_ASYNC:
+        {
+            CHECK_INTERFACE(IHDCP, data, reply);
+
+            reply->writeInt32(shutdownAsync());
+            return OK;
+        }
+
+        case HDCP_ENCRYPT:
+        {
+            size_t size = data.readInt32();
+
+            void *inData = malloc(2 * size);
+            void *outData = (uint8_t *)inData + size;
+
+            data.read(inData, size);
+
+            uint32_t streamCTR = data.readInt32();
+            uint64_t inputCTR;
+            status_t err = encrypt(inData, size, streamCTR, &inputCTR, outData);
+
+            reply->writeInt32(err);
+
+            if (err == OK) {
+                reply->writeInt64(inputCTR);
+                reply->write(outData, size);
+            }
+
+            free(inData);
+            inData = outData = NULL;
+
+            return OK;
+        }
+
+        default:
+            return BBinder::onTransact(code, data, reply, flags);
+    }
+}
+
+}  // namespace android
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp
index 0bb237d..cb07766 100644
--- a/media/libmedia/IMediaPlayer.cpp
+++ b/media/libmedia/IMediaPlayer.cpp
@@ -55,6 +55,7 @@
     SET_PARAMETER,
     GET_PARAMETER,
     SET_RETRANSMIT_ENDPOINT,
+    GET_RETRANSMIT_ENDPOINT,
     SET_NEXT_PLAYER,
 };
 
@@ -292,7 +293,8 @@
         return remote()->transact(GET_PARAMETER, data, reply);
     }
 
-    status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) {
+    status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint)
+    {
         Parcel data, reply;
         status_t err;
 
@@ -319,6 +321,23 @@
         remote()->transact(SET_NEXT_PLAYER, data, &reply);
         return reply.readInt32();
     }
+
+    status_t getRetransmitEndpoint(struct sockaddr_in* endpoint)
+    {
+        Parcel data, reply;
+        status_t err;
+
+        data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
+        err = remote()->transact(GET_RETRANSMIT_ENDPOINT, data, &reply);
+
+        if ((OK != err) || (OK != (err = reply.readInt32()))) {
+            return err;
+        }
+
+        data.read(endpoint, sizeof(*endpoint));
+
+        return err;
+    }
 };
 
 IMPLEMENT_META_INTERFACE(MediaPlayer, "android.media.IMediaPlayer");
@@ -498,11 +517,24 @@
             } else {
                 reply->writeInt32(setRetransmitEndpoint(NULL));
             }
+
+            return NO_ERROR;
+        } break;
+        case GET_RETRANSMIT_ENDPOINT: {
+            CHECK_INTERFACE(IMediaPlayer, data, reply);
+
+            struct sockaddr_in endpoint;
+            status_t res = getRetransmitEndpoint(&endpoint);
+
+            reply->writeInt32(res);
+            reply->write(&endpoint, sizeof(endpoint));
+
             return NO_ERROR;
         } break;
         case SET_NEXT_PLAYER: {
             CHECK_INTERFACE(IMediaPlayer, data, reply);
             reply->writeInt32(setNextPlayer(interface_cast<IMediaPlayer>(data.readStrongBinder())));
+
             return NO_ERROR;
         } break;
         default:
diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp
index 9120617..d3e2e19 100644
--- a/media/libmedia/IMediaPlayerService.cpp
+++ b/media/libmedia/IMediaPlayerService.cpp
@@ -38,6 +38,7 @@
     CREATE_METADATA_RETRIEVER,
     GET_OMX,
     MAKE_CRYPTO,
+    ENABLE_REMOTE_DISPLAY,
     ADD_BATTERY_DATA,
     PULL_BATTERY_DATA
 };
@@ -120,6 +121,21 @@
         return interface_cast<ICrypto>(reply.readStrongBinder());
     }
 
+    virtual status_t enableRemoteDisplay(const char *iface) {
+        Parcel data, reply;
+        data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor());
+
+        if (iface != NULL) {
+            data.writeInt32(1);
+            data.writeCString(iface);
+        } else {
+            data.writeInt32(0);
+        }
+
+        remote()->transact(ENABLE_REMOTE_DISPLAY, data, &reply);
+        return reply.readInt32();
+    }
+
     virtual void addBatteryData(uint32_t params) {
         Parcel data, reply;
         data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor());
@@ -206,6 +222,15 @@
             reply->writeStrongBinder(crypto->asBinder());
             return NO_ERROR;
         } break;
+        case ENABLE_REMOTE_DISPLAY: {
+            CHECK_INTERFACE(IMediaPlayerService, data, reply);
+            const char *iface = NULL;
+            if (data.readInt32()) {
+                iface = data.readCString();
+            }
+            reply->writeInt32(enableRemoteDisplay(iface));
+            return NO_ERROR;
+        } break;
         case ADD_BATTERY_DATA: {
             CHECK_INTERFACE(IMediaPlayerService, data, reply);
             uint32_t params = data.readInt32();
diff --git a/media/libmedia/Visualizer.cpp b/media/libmedia/Visualizer.cpp
index de0bf7d..8196e10 100644
--- a/media/libmedia/Visualizer.cpp
+++ b/media/libmedia/Visualizer.cpp
@@ -353,13 +353,4 @@
     return false;
 }
 
-status_t Visualizer::CaptureThread::readyToRun()
-{
-    return NO_ERROR;
-}
-
-void Visualizer::CaptureThread::onFirstRef()
-{
-}
-
 }; // namespace android
diff --git a/media/libmediaplayerservice/Android.mk b/media/libmediaplayerservice/Android.mk
index f173e2e..c7227b0 100644
--- a/media/libmediaplayerservice/Android.mk
+++ b/media/libmediaplayerservice/Android.mk
@@ -9,45 +9,47 @@
 LOCAL_SRC_FILES:=               \
     ActivityManager.cpp         \
     Crypto.cpp                  \
-    MediaRecorderClient.cpp     \
+    MediaPlayerFactory.cpp      \
     MediaPlayerService.cpp      \
+    MediaRecorderClient.cpp     \
     MetadataRetrieverClient.cpp \
-    TestPlayerStub.cpp          \
-    MidiMetadataRetriever.cpp   \
     MidiFile.cpp                \
+    MidiMetadataRetriever.cpp   \
+    RemoteDisplay.cpp           \
     StagefrightPlayer.cpp       \
-    StagefrightRecorder.cpp
+    StagefrightRecorder.cpp     \
+    TestPlayerStub.cpp          \
 
-LOCAL_SHARED_LIBRARIES :=     		\
-	libcutils             			\
-	libutils              			\
-	libbinder             			\
-	libvorbisidec         			\
-	libsonivox            			\
-	libmedia              			\
-	libmedia_native       			\
-	libcamera_client      			\
-	libstagefright        			\
-	libstagefright_omx    			\
-	libstagefright_foundation       \
-	libgui                          \
-	libdl                           \
-	libaah_rtp
+LOCAL_SHARED_LIBRARIES :=       \
+    libbinder                   \
+    libcamera_client            \
+    libcutils                   \
+    libdl                       \
+    libgui                      \
+    libmedia                    \
+    libmedia_native             \
+    libsonivox                  \
+    libstagefright              \
+    libstagefright_foundation   \
+    libstagefright_omx          \
+    libstagefright_wfd          \
+    libutils                    \
+    libvorbisidec               \
 
-LOCAL_STATIC_LIBRARIES := \
-        libstagefright_nuplayer                 \
-        libstagefright_rtsp                     \
+LOCAL_STATIC_LIBRARIES :=       \
+    libstagefright_nuplayer     \
+    libstagefright_rtsp         \
 
-LOCAL_C_INCLUDES :=                                               \
-	$(call include-path-for, graphics corecg)                       \
-	$(TOP)/frameworks/av/media/libstagefright/include               \
-	$(TOP)/frameworks/av/media/libstagefright/rtsp                  \
-	$(TOP)/frameworks/native/include/media/openmax                  \
-	$(TOP)/external/tremolo/Tremolo                                 \
+LOCAL_C_INCLUDES :=                                                 \
+    $(call include-path-for, graphics corecg)                       \
+    $(TOP)/frameworks/av/media/libstagefright/include               \
+    $(TOP)/frameworks/av/media/libstagefright/rtsp                  \
+    $(TOP)/frameworks/av/media/libstagefright/wifi-display          \
+    $(TOP)/frameworks/native/include/media/openmax                  \
+    $(TOP)/external/tremolo/Tremolo                                 \
 
 LOCAL_MODULE:= libmediaplayerservice
 
 include $(BUILD_SHARED_LIBRARY)
 
 include $(call all-makefiles-under,$(LOCAL_PATH))
-
diff --git a/media/libmediaplayerservice/HDCP.cpp b/media/libmediaplayerservice/HDCP.cpp
new file mode 100644
index 0000000..6f8a465
--- /dev/null
+++ b/media/libmediaplayerservice/HDCP.cpp
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "HDCP"
+#include <utils/Log.h>
+
+#include "HDCP.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+
+#include <dlfcn.h>
+
+namespace android {
+
+HDCP::HDCP()
+    : mLibHandle(NULL),
+      mHDCPModule(NULL) {
+    mLibHandle = dlopen("libstagefright_hdcp.so", RTLD_NOW);
+
+    if (mLibHandle == NULL) {
+        ALOGE("Unable to locate libstagefright_hdcp.so");
+        return;
+    }
+
+    typedef HDCPModule *(*CreateHDCPModuleFunc)();
+    CreateHDCPModuleFunc createHDCPModule =
+        (CreateHDCPModuleFunc)dlsym(mLibHandle, "createHDCPModule");
+
+    if (createHDCPModule == NULL) {
+        ALOGE("Unable to find symbol 'createHDCPModule'.");
+    } else if ((mHDCPModule = createHDCPModule()) == NULL) {
+        ALOGE("createHDCPModule failed.");
+    }
+}
+
+HDCP::~HDCP() {
+    if (mHDCPModule != NULL) {
+        delete mHDCPModule;
+        mHDCPModule = NULL;
+    }
+
+    if (mLibHandle != NULL) {
+        dlclose(mLibHandle);
+        mLibHandle = NULL;
+    }
+}
+
+status_t HDCP::setObserver(const sp<IHDCPObserver> &observer) {
+    if (mHDCPModule == NULL) {
+        return NO_INIT;
+    }
+
+    mObserver = observer;
+
+    return OK;
+}
+
+status_t HDCP::initAsync(const char *host, unsigned port) {
+    if (mHDCPModule == NULL) {
+        return NO_INIT;
+    }
+
+    return mHDCPModule->initAsync(host, port);
+}
+
+status_t HDCP::shutdownAsync() {
+    if (mHDCPModule == NULL) {
+        return NO_INIT;
+    }
+
+    return mHDCPModule->shutdownAsync();
+}
+
+status_t HDCP::encrypt(
+        const void *inData, size_t size, uint32_t streamCTR,
+        uint64_t *outInputCTR, void *outData) {
+    if (mHDCPModule == NULL) {
+        *outInputCTR = 0;
+
+        return NO_INIT;
+    }
+
+    return mHDCPModule->encrypt(inData, size, streamCTR, outInputCTR, outData);
+}
+
+}  // namespace android
+
diff --git a/media/libmediaplayerservice/HDCP.h b/media/libmediaplayerservice/HDCP.h
new file mode 100644
index 0000000..2e27689
--- /dev/null
+++ b/media/libmediaplayerservice/HDCP.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HDCP_H_
+
+#define HDCP_H_
+
+#include <media/IHDCP.h>
+
+namespace android {
+
+struct HDCP : public BnHDCP {
+    HDCP();
+    virtual ~HDCP();
+
+    virtual status_t setObserver(const sp<IHDCPObserver> &observer);
+    virtual status_t initAsync(const char *host, unsigned port);
+    virtual status_t shutdownAsync();
+
+    virtual status_t encrypt(
+            const void *inData, size_t size, uint32_t streamCTR,
+            uint64_t *outInputCTR, void *outData);
+
+private:
+    void *mLibHandle;
+    HDCPModule *mHDCPModule;
+    sp<IHDCPObserver> mObserver;
+
+    DISALLOW_EVIL_CONSTRUCTORS(HDCP);
+};
+
+}  // namespace android
+
+#endif  // HDCP_H_
+
diff --git a/media/libmediaplayerservice/MediaPlayerFactory.cpp b/media/libmediaplayerservice/MediaPlayerFactory.cpp
new file mode 100644
index 0000000..f821cc3
--- /dev/null
+++ b/media/libmediaplayerservice/MediaPlayerFactory.cpp
@@ -0,0 +1,339 @@
+/*
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#define LOG_TAG "MediaPlayerFactory"
+#include <utils/Log.h>
+
+#include <cutils/properties.h>
+#include <media/IMediaPlayer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <utils/Errors.h>
+#include <utils/misc.h>
+
+#include "MediaPlayerFactory.h"
+
+#include "MidiFile.h"
+#include "TestPlayerStub.h"
+#include "StagefrightPlayer.h"
+#include "nuplayer/NuPlayerDriver.h"
+
+namespace android {
+
+Mutex MediaPlayerFactory::sLock;
+MediaPlayerFactory::tFactoryMap MediaPlayerFactory::sFactoryMap;
+bool MediaPlayerFactory::sInitComplete = false;
+
+status_t MediaPlayerFactory::registerFactory_l(IFactory* factory,
+                                               player_type type) {
+    if (NULL == factory) {
+        ALOGE("Failed to register MediaPlayerFactory of type %d, factory is"
+              " NULL.", type);
+        return BAD_VALUE;
+    }
+
+    if (sFactoryMap.indexOfKey(type) >= 0) {
+        ALOGE("Failed to register MediaPlayerFactory of type %d, type is"
+              " already registered.", type);
+        return ALREADY_EXISTS;
+    }
+
+    if (sFactoryMap.add(type, factory) < 0) {
+        ALOGE("Failed to register MediaPlayerFactory of type %d, failed to add"
+              " to map.", type);
+        return UNKNOWN_ERROR;
+    }
+
+    return OK;
+}
+
+player_type MediaPlayerFactory::getDefaultPlayerType() {
+    char value[PROPERTY_VALUE_MAX];
+    if (property_get("media.stagefright.use-nuplayer", value, NULL)
+            && (!strcmp("1", value) || !strcasecmp("true", value))) {
+        return NU_PLAYER;
+    }
+
+    return STAGEFRIGHT_PLAYER;
+}
+
+status_t MediaPlayerFactory::registerFactory(IFactory* factory,
+                                             player_type type) {
+    Mutex::Autolock lock_(&sLock);
+    return registerFactory_l(factory, type);
+}
+
+void MediaPlayerFactory::unregisterFactory(player_type type) {
+    Mutex::Autolock lock_(&sLock);
+    sFactoryMap.removeItem(type);
+}
+
+#define GET_PLAYER_TYPE_IMPL(a...)                      \
+    Mutex::Autolock lock_(&sLock);                      \
+                                                        \
+    player_type ret = STAGEFRIGHT_PLAYER;               \
+    float bestScore = 0.0;                              \
+                                                        \
+    for (size_t i = 0; i < sFactoryMap.size(); ++i) {   \
+                                                        \
+        IFactory* v = sFactoryMap.valueAt(i);           \
+        float thisScore;                                \
+        CHECK(v != NULL);                               \
+        thisScore = v->scoreFactory(a, bestScore);      \
+        if (thisScore > bestScore) {                    \
+            ret = sFactoryMap.keyAt(i);                 \
+            bestScore = thisScore;                      \
+        }                                               \
+    }                                                   \
+                                                        \
+    if (0.0 == bestScore) {                             \
+        bestScore = getDefaultPlayerType();             \
+    }                                                   \
+                                                        \
+    return ret;
+
+player_type MediaPlayerFactory::getPlayerType(const sp<IMediaPlayer>& client,
+                                              const char* url) {
+    GET_PLAYER_TYPE_IMPL(client, url);
+}
+
+player_type MediaPlayerFactory::getPlayerType(const sp<IMediaPlayer>& client,
+                                              int fd,
+                                              int64_t offset,
+                                              int64_t length) {
+    GET_PLAYER_TYPE_IMPL(client, fd, offset, length);
+}
+
+player_type MediaPlayerFactory::getPlayerType(const sp<IMediaPlayer>& client,
+                                              const sp<IStreamSource> &source) {
+    GET_PLAYER_TYPE_IMPL(client, source);
+}
+
+#undef GET_PLAYER_TYPE_IMPL
+
+sp<MediaPlayerBase> MediaPlayerFactory::createPlayer(
+        player_type playerType,
+        void* cookie,
+        notify_callback_f notifyFunc) {
+    sp<MediaPlayerBase> p;
+    IFactory* factory;
+    status_t init_result;
+    Mutex::Autolock lock_(&sLock);
+
+    if (sFactoryMap.indexOfKey(playerType) < 0) {
+        ALOGE("Failed to create player object of type %d, no registered"
+              " factory", playerType);
+        return p;
+    }
+
+    factory = sFactoryMap.valueFor(playerType);
+    CHECK(NULL != factory);
+    p = factory->createPlayer();
+
+    if (p == NULL) {
+        ALOGE("Failed to create player object of type %d, create failed",
+               playerType);
+        return p;
+    }
+
+    init_result = p->initCheck();
+    if (init_result == NO_ERROR) {
+        p->setNotifyCallback(cookie, notifyFunc);
+    } else {
+        ALOGE("Failed to create player object of type %d, initCheck failed"
+              " (res = %d)", playerType, init_result);
+        p.clear();
+    }
+
+    return p;
+}
+
+/*****************************************************************************
+ *                                                                           *
+ *                     Built-In Factory Implementations                      *
+ *                                                                           *
+ *****************************************************************************/
+
+class StagefrightPlayerFactory :
+    public MediaPlayerFactory::IFactory {
+  public:
+    virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                               int fd,
+                               int64_t offset,
+                               int64_t length,
+                               float curScore) {
+        char buf[20];
+        lseek(fd, offset, SEEK_SET);
+        read(fd, buf, sizeof(buf));
+        lseek(fd, offset, SEEK_SET);
+
+        long ident = *((long*)buf);
+
+        // Ogg vorbis?
+        if (ident == 0x5367674f) // 'OggS'
+            return 1.0;
+
+        return 0.0;
+    }
+
+    virtual sp<MediaPlayerBase> createPlayer() {
+        ALOGV(" create StagefrightPlayer");
+        return new StagefrightPlayer();
+    }
+};
+
+class NuPlayerFactory : public MediaPlayerFactory::IFactory {
+  public:
+    virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                               const char* url,
+                               float curScore) {
+        static const float kOurScore = 0.8;
+
+        if (kOurScore <= curScore)
+            return 0.0;
+
+        if (!strncasecmp("http://", url, 7)
+                || !strncasecmp("https://", url, 8)) {
+            size_t len = strlen(url);
+            if (len >= 5 && !strcasecmp(".m3u8", &url[len - 5])) {
+                return kOurScore;
+            }
+
+            if (strstr(url,"m3u8")) {
+                return kOurScore;
+            }
+        }
+
+        if (!strncasecmp("rtsp://", url, 7)) {
+            return kOurScore;
+        }
+
+        return 0.0;
+    }
+
+    virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                               const sp<IStreamSource> &source,
+                               float curScore) {
+        return 1.0;
+    }
+
+    virtual sp<MediaPlayerBase> createPlayer() {
+        ALOGV(" create NuPlayer");
+        return new NuPlayerDriver;
+    }
+};
+
+class SonivoxPlayerFactory : public MediaPlayerFactory::IFactory {
+  public:
+    virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                               const char* url,
+                               float curScore) {
+        static const float kOurScore = 0.4;
+        static const char* const FILE_EXTS[] = { ".mid",
+                                                 ".midi",
+                                                 ".smf",
+                                                 ".xmf",
+                                                 ".imy",
+                                                 ".rtttl",
+                                                 ".rtx",
+                                                 ".ota" };
+        if (kOurScore <= curScore)
+            return 0.0;
+
+        // use MidiFile for MIDI extensions
+        int lenURL = strlen(url);
+        for (int i = 0; i < NELEM(FILE_EXTS); ++i) {
+            int len = strlen(FILE_EXTS[i]);
+            int start = lenURL - len;
+            if (start > 0) {
+                if (!strncasecmp(url + start, FILE_EXTS[i], len)) {
+                    return kOurScore;
+                }
+            }
+        }
+
+        return 0.0;
+    }
+
+    virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                               int fd,
+                               int64_t offset,
+                               int64_t length,
+                               float curScore) {
+        static const float kOurScore = 0.8;
+
+        if (kOurScore <= curScore)
+            return 0.0;
+
+        // Some kind of MIDI?
+        EAS_DATA_HANDLE easdata;
+        if (EAS_Init(&easdata) == EAS_SUCCESS) {
+            EAS_FILE locator;
+            locator.path = NULL;
+            locator.fd = fd;
+            locator.offset = offset;
+            locator.length = length;
+            EAS_HANDLE  eashandle;
+            if (EAS_OpenFile(easdata, &locator, &eashandle) == EAS_SUCCESS) {
+                EAS_CloseFile(easdata, eashandle);
+                EAS_Shutdown(easdata);
+                return kOurScore;
+            }
+            EAS_Shutdown(easdata);
+        }
+
+        return 0.0;
+    }
+
+    virtual sp<MediaPlayerBase> createPlayer() {
+        ALOGV(" create MidiFile");
+        return new MidiFile();
+    }
+};
+
+class TestPlayerFactory : public MediaPlayerFactory::IFactory {
+  public:
+    virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                               const char* url,
+                               float curScore) {
+        if (TestPlayerStub::canBeUsed(url)) {
+            return 1.0;
+        }
+
+        return 0.0;
+    }
+
+    virtual sp<MediaPlayerBase> createPlayer() {
+        ALOGV("Create Test Player stub");
+        return new TestPlayerStub();
+    }
+};
+
+void MediaPlayerFactory::registerBuiltinFactories() {
+    Mutex::Autolock lock_(&sLock);
+
+    if (sInitComplete)
+        return;
+
+    registerFactory_l(new StagefrightPlayerFactory(), STAGEFRIGHT_PLAYER);
+    registerFactory_l(new NuPlayerFactory(), NU_PLAYER);
+    registerFactory_l(new SonivoxPlayerFactory(), SONIVOX_PLAYER);
+    registerFactory_l(new TestPlayerFactory(), TEST_PLAYER);
+
+    sInitComplete = true;
+}
+
+}  // namespace android
diff --git a/media/libmediaplayerservice/MediaPlayerFactory.h b/media/libmediaplayerservice/MediaPlayerFactory.h
new file mode 100644
index 0000000..fe8972b
--- /dev/null
+++ b/media/libmediaplayerservice/MediaPlayerFactory.h
@@ -0,0 +1,84 @@
+/*
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#ifndef ANDROID_MEDIAPLAYERFACTORY_H
+#define ANDROID_MEDIAPLAYERFACTORY_H
+
+#include <media/MediaPlayerInterface.h>
+#include <media/stagefright/foundation/ABase.h>
+
+namespace android {
+
+class MediaPlayerFactory {
+  public:
+    class IFactory {
+      public:
+        virtual ~IFactory() { }
+
+        virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                                   const char* url,
+                                   float curScore) { return 0.0; }
+
+        virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                                   int fd,
+                                   int64_t offset,
+                                   int64_t length,
+                                   float curScore) { return 0.0; }
+
+        virtual float scoreFactory(const sp<IMediaPlayer>& client,
+                                   const sp<IStreamSource> &source,
+                                   float curScore) { return 0.0; }
+
+        virtual sp<MediaPlayerBase> createPlayer() = 0;
+    };
+
+    static status_t registerFactory(IFactory* factory,
+                                    player_type type);
+    static void unregisterFactory(player_type type);
+    static player_type getPlayerType(const sp<IMediaPlayer>& client,
+                                     const char* url);
+    static player_type getPlayerType(const sp<IMediaPlayer>& client,
+                                     int fd,
+                                     int64_t offset,
+                                     int64_t length);
+    static player_type getPlayerType(const sp<IMediaPlayer>& client,
+                                     const sp<IStreamSource> &source);
+
+    static sp<MediaPlayerBase> createPlayer(player_type playerType,
+                                            void* cookie,
+                                            notify_callback_f notifyFunc);
+
+    static void registerBuiltinFactories();
+
+  private:
+    typedef KeyedVector<player_type, IFactory*> tFactoryMap;
+
+    MediaPlayerFactory() { }
+
+    static status_t registerFactory_l(IFactory* factory,
+                                      player_type type);
+    static player_type getDefaultPlayerType();
+
+    static Mutex       sLock;
+    static tFactoryMap sFactoryMap;
+    static bool        sInitComplete;
+
+    DISALLOW_EVIL_CONSTRUCTORS(MediaPlayerFactory);
+};
+
+}  // namespace android
+#endif  // ANDROID_MEDIAPLAYERFACTORY_H
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index c47fbd6..166bae9 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -43,7 +43,6 @@
 #include <utils/String8.h>
 #include <utils/SystemClock.h>
 #include <utils/Vector.h>
-#include <cutils/properties.h>
 
 #include <media/MediaPlayerInterface.h>
 #include <media/mediarecorder.h>
@@ -61,6 +60,7 @@
 #include "MediaRecorderClient.h"
 #include "MediaPlayerService.h"
 #include "MetadataRetrieverClient.h"
+#include "MediaPlayerFactory.h"
 
 #include "MidiFile.h"
 #include "TestPlayerStub.h"
@@ -70,11 +70,7 @@
 #include <OMX.h>
 
 #include "Crypto.h"
-
-namespace android {
-sp<MediaPlayerBase> createAAH_TXPlayer();
-sp<MediaPlayerBase> createAAH_RXPlayer();
-}
+#include "RemoteDisplay.h"
 
 namespace {
 using android::media::Metadata;
@@ -194,22 +190,6 @@
     return ok;
 }
 
-// TODO: Temp hack until we can register players
-typedef struct {
-    const char *extension;
-    const player_type playertype;
-} extmap;
-extmap FILE_EXTS [] =  {
-        {".mid", SONIVOX_PLAYER},
-        {".midi", SONIVOX_PLAYER},
-        {".smf", SONIVOX_PLAYER},
-        {".xmf", SONIVOX_PLAYER},
-        {".imy", SONIVOX_PLAYER},
-        {".rtttl", SONIVOX_PLAYER},
-        {".rtx", SONIVOX_PLAYER},
-        {".ota", SONIVOX_PLAYER},
-};
-
 // TODO: Find real cause of Audio/Video delay in PV framework and remove this workaround
 /* static */ int MediaPlayerService::AudioOutput::mMinBufferCount = 4;
 /* static */ bool MediaPlayerService::AudioOutput::mIsOnEmulator = false;
@@ -232,6 +212,8 @@
     }
     // speaker is on by default
     mBatteryAudio.deviceOn[SPEAKER] = 1;
+
+    MediaPlayerFactory::registerBuiltinFactories();
 }
 
 MediaPlayerService::~MediaPlayerService()
@@ -297,6 +279,34 @@
     return new Crypto;
 }
 
+status_t MediaPlayerService::enableRemoteDisplay(const char *iface) {
+    Mutex::Autolock autoLock(mLock);
+
+    if (iface != NULL) {
+        if (mRemoteDisplay != NULL) {
+            return INVALID_OPERATION;
+        }
+
+        mRemoteDisplay = new RemoteDisplay;
+
+        status_t err = mRemoteDisplay->start(iface);
+
+        if (err != OK) {
+            mRemoteDisplay.clear();
+            return err;
+        }
+
+        return OK;
+    }
+
+    if (mRemoteDisplay != NULL) {
+        mRemoteDisplay->stop();
+        mRemoteDisplay.clear();
+    }
+
+    return OK;
+}
+
 status_t MediaPlayerService::AudioCache::dump(int fd, const Vector<String16>& args) const
 {
     const size_t SIZE = 256;
@@ -545,174 +555,6 @@
     IPCThreadState::self()->flushCommands();
 }
 
-static player_type getDefaultPlayerType() {
-    char value[PROPERTY_VALUE_MAX];
-    if (property_get("media.stagefright.use-nuplayer", value, NULL)
-            && (!strcmp("1", value) || !strcasecmp("true", value))) {
-        return NU_PLAYER;
-    }
-
-    return STAGEFRIGHT_PLAYER;
-}
-
-player_type getPlayerType(int fd, int64_t offset, int64_t length)
-{
-    char buf[20];
-    lseek(fd, offset, SEEK_SET);
-    read(fd, buf, sizeof(buf));
-    lseek(fd, offset, SEEK_SET);
-
-    long ident = *((long*)buf);
-
-    // Ogg vorbis?
-    if (ident == 0x5367674f) // 'OggS'
-        return STAGEFRIGHT_PLAYER;
-
-    // Some kind of MIDI?
-    EAS_DATA_HANDLE easdata;
-    if (EAS_Init(&easdata) == EAS_SUCCESS) {
-        EAS_FILE locator;
-        locator.path = NULL;
-        locator.fd = fd;
-        locator.offset = offset;
-        locator.length = length;
-        EAS_HANDLE  eashandle;
-        if (EAS_OpenFile(easdata, &locator, &eashandle) == EAS_SUCCESS) {
-            EAS_CloseFile(easdata, eashandle);
-            EAS_Shutdown(easdata);
-            return SONIVOX_PLAYER;
-        }
-        EAS_Shutdown(easdata);
-    }
-
-    return getDefaultPlayerType();
-}
-
-player_type getPlayerType(const char* url)
-{
-    if (TestPlayerStub::canBeUsed(url)) {
-        return TEST_PLAYER;
-    }
-
-    if (!strncasecmp("http://", url, 7)
-            || !strncasecmp("https://", url, 8)) {
-        size_t len = strlen(url);
-        if (len >= 5 && !strcasecmp(".m3u8", &url[len - 5])) {
-            return NU_PLAYER;
-        }
-
-        if (strstr(url,"m3u8")) {
-            return NU_PLAYER;
-        }
-    }
-
-    if (!strncasecmp("rtsp://", url, 7)) {
-        return NU_PLAYER;
-    }
-
-    if (!strncasecmp("aahRX://", url, 8)) {
-        return AAH_RX_PLAYER;
-    }
-
-    // use MidiFile for MIDI extensions
-    int lenURL = strlen(url);
-    for (int i = 0; i < NELEM(FILE_EXTS); ++i) {
-        int len = strlen(FILE_EXTS[i].extension);
-        int start = lenURL - len;
-        if (start > 0) {
-            if (!strncasecmp(url + start, FILE_EXTS[i].extension, len)) {
-                return FILE_EXTS[i].playertype;
-            }
-        }
-    }
-
-    return getDefaultPlayerType();
-}
-
-player_type MediaPlayerService::Client::getPlayerType(int fd,
-                                                      int64_t offset,
-                                                      int64_t length)
-{
-    // Until re-transmit functionality is added to the existing core android
-    // players, we use the special AAH TX player whenever we were configured
-    // for retransmission.
-    if (mRetransmitEndpointValid) {
-        return AAH_TX_PLAYER;
-    }
-
-    return android::getPlayerType(fd, offset, length);
-}
-
-player_type MediaPlayerService::Client::getPlayerType(const char* url)
-{
-    // Until re-transmit functionality is added to the existing core android
-    // players, we use the special AAH TX player whenever we were configured
-    // for retransmission.
-    if (mRetransmitEndpointValid) {
-        return AAH_TX_PLAYER;
-    }
-
-    return android::getPlayerType(url);
-}
-
-player_type MediaPlayerService::Client::getPlayerType(
-        const sp<IStreamSource> &source) {
-    // Until re-transmit functionality is added to the existing core android
-    // players, we use the special AAH TX player whenever we were configured
-    // for retransmission.
-    if (mRetransmitEndpointValid) {
-        return AAH_TX_PLAYER;
-    }
-
-    return NU_PLAYER;
-}
-
-static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie,
-        notify_callback_f notifyFunc)
-{
-    sp<MediaPlayerBase> p;
-    switch (playerType) {
-        case SONIVOX_PLAYER:
-            ALOGV(" create MidiFile");
-            p = new MidiFile();
-            break;
-        case STAGEFRIGHT_PLAYER:
-            ALOGV(" create StagefrightPlayer");
-            p = new StagefrightPlayer;
-            break;
-        case NU_PLAYER:
-            ALOGV(" create NuPlayer");
-            p = new NuPlayerDriver;
-            break;
-        case TEST_PLAYER:
-            ALOGV("Create Test Player stub");
-            p = new TestPlayerStub();
-            break;
-        case AAH_RX_PLAYER:
-            ALOGV(" create A@H RX Player");
-            p = createAAH_RXPlayer();
-            break;
-        case AAH_TX_PLAYER:
-            ALOGV(" create A@H TX Player");
-            p = createAAH_TXPlayer();
-            break;
-        default:
-            ALOGE("Unknown player type: %d", playerType);
-            return NULL;
-    }
-    if (p != NULL) {
-        if (p->initCheck() == NO_ERROR) {
-            p->setNotifyCallback(cookie, notifyFunc);
-        } else {
-            p.clear();
-        }
-    }
-    if (p == NULL) {
-        ALOGE("Failed to create player object");
-    }
-    return p;
-}
-
 sp<MediaPlayerBase> MediaPlayerService::Client::createPlayer(player_type playerType)
 {
     // determine if we have the right player type
@@ -722,7 +564,7 @@
         p.clear();
     }
     if (p == NULL) {
-        p = android::createPlayer(playerType, this, notify);
+        p = MediaPlayerFactory::createPlayer(playerType, this, notify);
     }
 
     if (p != NULL) {
@@ -805,7 +647,7 @@
         close(fd);
         return mStatus;
     } else {
-        player_type playerType = getPlayerType(url);
+        player_type playerType = MediaPlayerFactory::getPlayerType(this, url);
         sp<MediaPlayerBase> p = setDataSource_pre(playerType);
         if (p == NULL) {
             return NO_INIT;
@@ -842,10 +684,10 @@
         ALOGV("calculated length = %lld", length);
     }
 
-    // Until re-transmit functionality is added to the existing core android
-    // players, we use the special AAH TX player whenever we were configured for
-    // retransmission.
-    player_type playerType = getPlayerType(fd, offset, length);
+    player_type playerType = MediaPlayerFactory::getPlayerType(this,
+                                                               fd,
+                                                               offset,
+                                                               length);
     sp<MediaPlayerBase> p = setDataSource_pre(playerType);
     if (p == NULL) {
         return NO_INIT;
@@ -859,10 +701,7 @@
 status_t MediaPlayerService::Client::setDataSource(
         const sp<IStreamSource> &source) {
     // create the right type of player
-    // Until re-transmit functionality is added to the existing core android
-    // players, we use the special AAH TX player whenever we were configured for
-    // retransmission.
-    player_type playerType = getPlayerType(source);
+    player_type playerType = MediaPlayerFactory::getPlayerType(this, source);
     sp<MediaPlayerBase> p = setDataSource_pre(playerType);
     if (p == NULL) {
         return NO_INIT;
@@ -1209,15 +1048,40 @@
     return NO_ERROR;
 }
 
+status_t MediaPlayerService::Client::getRetransmitEndpoint(
+        struct sockaddr_in* endpoint)
+{
+    if (NULL == endpoint)
+        return BAD_VALUE;
+
+    sp<MediaPlayerBase> p = getPlayer();
+
+    if (p != NULL)
+        return p->getRetransmitEndpoint(endpoint);
+
+    if (!mRetransmitEndpointValid)
+        return NO_INIT;
+
+    *endpoint = mRetransmitEndpoint;
+
+    return NO_ERROR;
+}
+
 void MediaPlayerService::Client::notify(
         void* cookie, int msg, int ext1, int ext2, const Parcel *obj)
 {
     Client* client = static_cast<Client*>(cookie);
+    if (client == NULL) {
+        return;
+    }
 
+    sp<IMediaPlayerClient> c;
     {
         Mutex::Autolock l(client->mLock);
+        c = client->mClient;
         if (msg == MEDIA_PLAYBACK_COMPLETE && client->mNextClient != NULL) {
-            client->mAudioOutput->switchToNextOutput();
+            if (client->mAudioOutput != NULL)
+                client->mAudioOutput->switchToNextOutput();
             client->mNextClient->start();
             client->mNextClient->mClient->notify(MEDIA_INFO, MEDIA_INFO_STARTED_AS_NEXT, 0, obj);
         }
@@ -1235,8 +1099,11 @@
         // also access mMetadataUpdated and clears it.
         client->addNewMetadataUpdate(metadata_type);
     }
-    ALOGV("[%d] notify (%p, %d, %d, %d)", client->mConnId, cookie, msg, ext1, ext2);
-    client->mClient->notify(msg, ext1, ext2, obj);
+
+    if (c != NULL) {
+        ALOGV("[%d] notify (%p, %d, %d, %d)", client->mConnId, cookie, msg, ext1, ext2);
+        c->notify(msg, ext1, ext2, obj);
+    }
 }
 
 
@@ -1315,12 +1182,13 @@
         return mem;
     }
 
-    player_type playerType = getPlayerType(url);
+    player_type playerType =
+        MediaPlayerFactory::getPlayerType(NULL /* client */, url);
     ALOGV("player type = %d", playerType);
 
     // create the right type of player
     sp<AudioCache> cache = new AudioCache(url);
-    player = android::createPlayer(playerType, cache.get(), cache->notify);
+    player = MediaPlayerFactory::createPlayer(playerType, cache.get(), cache->notify);
     if (player == NULL) goto Exit;
     if (player->hardwareOutput()) goto Exit;
 
@@ -1362,12 +1230,15 @@
     sp<MemoryBase> mem;
     sp<MediaPlayerBase> player;
 
-    player_type playerType = getPlayerType(fd, offset, length);
+    player_type playerType = MediaPlayerFactory::getPlayerType(NULL /* client */,
+                                                               fd,
+                                                               offset,
+                                                               length);
     ALOGV("player type = %d", playerType);
 
     // create the right type of player
     sp<AudioCache> cache = new AudioCache("decode_fd");
-    player = android::createPlayer(playerType, cache.get(), cache->notify);
+    player = MediaPlayerFactory::createPlayer(playerType, cache.get(), cache->notify);
     if (player == NULL) goto Exit;
     if (player->hardwareOutput()) goto Exit;
 
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h
index 95b1b05..2577c58 100644
--- a/media/libmediaplayerservice/MediaPlayerService.h
+++ b/media/libmediaplayerservice/MediaPlayerService.h
@@ -42,6 +42,7 @@
 class IMediaMetadataRetriever;
 class IOMX;
 class MediaRecorderClient;
+struct RemoteDisplay;
 
 #define CALLBACK_ANTAGONIZER 0
 #if CALLBACK_ANTAGONIZER
@@ -247,6 +248,7 @@
     virtual sp<IMemory>         decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat);
     virtual sp<IOMX>            getOMX();
     virtual sp<ICrypto>         makeCrypto();
+    virtual status_t            enableRemoteDisplay(const char *iface);
 
     virtual status_t            dump(int fd, const Vector<String16>& args);
 
@@ -299,7 +301,6 @@
 private:
 
     class Client : public BnMediaPlayer {
-
         // IMediaPlayer interface
         virtual void            disconnect();
         virtual status_t        setVideoSurfaceTexture(
@@ -326,6 +327,7 @@
         virtual status_t        setParameter(int key, const Parcel &request);
         virtual status_t        getParameter(int key, Parcel *reply);
         virtual status_t        setRetransmitEndpoint(const struct sockaddr_in* endpoint);
+        virtual status_t        getRetransmitEndpoint(struct sockaddr_in* endpoint);
         virtual status_t        setNextPlayer(const sp<IMediaPlayer>& player);
 
         sp<MediaPlayerBase>     createPlayer(player_type playerType);
@@ -342,10 +344,6 @@
         void                    setDataSource_post(const sp<MediaPlayerBase>& p,
                                                    status_t status);
 
-        player_type             getPlayerType(int fd, int64_t offset, int64_t length);
-        player_type             getPlayerType(const char* url);
-        player_type             getPlayerType(const sp<IStreamSource> &source);
-
         static  void            notify(void* cookie, int msg,
                                        int ext1, int ext2, const Parcel *obj);
 
@@ -427,6 +425,7 @@
                 int32_t                     mNextConnId;
                 sp<IOMX>                    mOMX;
                 sp<ICrypto>                 mCrypto;
+                sp<RemoteDisplay>           mRemoteDisplay;
 };
 
 // ----------------------------------------------------------------------------
diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
index e44031e..348957f 100644
--- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp
+++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
@@ -37,12 +37,10 @@
 #include "MidiMetadataRetriever.h"
 #include "MetadataRetrieverClient.h"
 #include "StagefrightMetadataRetriever.h"
+#include "MediaPlayerFactory.h"
 
 namespace android {
 
-extern player_type getPlayerType(const char* url);
-extern player_type getPlayerType(int fd, int64_t offset, int64_t length);
-
 MetadataRetrieverClient::MetadataRetrieverClient(pid_t pid)
 {
     ALOGV("MetadataRetrieverClient constructor pid(%d)", pid);
@@ -115,7 +113,17 @@
     if (url == NULL) {
         return UNKNOWN_ERROR;
     }
-    player_type playerType = getPlayerType(url);
+
+    // When asking the MediaPlayerFactory subsystem to choose a media player for
+    // a given URL, a pointer to an outer IMediaPlayer can be passed to the
+    // factory system to be taken into consideration along with the URL.  In the
+    // case of choosing an instance of a MediaPlayerBase for a
+    // MetadataRetrieverClient, there is no outer IMediaPlayer which will
+    // eventually encapsulate the result of this selection.  In this case, just
+    // pass NULL to getPlayerType to indicate that there is no outer
+    // IMediaPlayer to consider during selection.
+    player_type playerType =
+        MediaPlayerFactory::getPlayerType(NULL /* client */, url);
     ALOGV("player type = %d", playerType);
     sp<MediaMetadataRetrieverBase> p = createRetriever(playerType);
     if (p == NULL) return NO_INIT;
@@ -150,7 +158,11 @@
         ALOGV("calculated length = %lld", length);
     }
 
-    player_type playerType = getPlayerType(fd, offset, length);
+    player_type playerType =
+        MediaPlayerFactory::getPlayerType(NULL /* client */,
+                                          fd,
+                                          offset,
+                                          length);
     ALOGV("player type = %d", playerType);
     sp<MediaMetadataRetrieverBase> p = createRetriever(playerType);
     if (p == NULL) {
diff --git a/media/libmediaplayerservice/RemoteDisplay.cpp b/media/libmediaplayerservice/RemoteDisplay.cpp
new file mode 100644
index 0000000..49f7278
--- /dev/null
+++ b/media/libmediaplayerservice/RemoteDisplay.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "RemoteDisplay.h"
+
+#include "ANetworkSession.h"
+#include "source/WifiDisplaySource.h"
+
+namespace android {
+
+RemoteDisplay::RemoteDisplay()
+    : mInitCheck(NO_INIT),
+      mLooper(new ALooper),
+      mNetSession(new ANetworkSession),
+      mSource(new WifiDisplaySource(mNetSession)) {
+    mLooper->registerHandler(mSource);
+}
+
+RemoteDisplay::~RemoteDisplay() {
+}
+
+status_t RemoteDisplay::start(const char *iface) {
+    mNetSession->start();
+    mLooper->start();
+
+    mSource->start(iface);
+
+    return OK;
+}
+
+status_t RemoteDisplay::stop() {
+    mSource->stop();
+
+    mLooper->stop();
+    mNetSession->stop();
+
+    return OK;
+}
+
+}  // namespace android
+
diff --git a/media/libmediaplayerservice/RemoteDisplay.h b/media/libmediaplayerservice/RemoteDisplay.h
new file mode 100644
index 0000000..3607d06
--- /dev/null
+++ b/media/libmediaplayerservice/RemoteDisplay.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef REMOTE_DISPLAY_H_
+
+#define REMOTE_DISPLAY_H_
+
+#include <media/stagefright/foundation/ABase.h>
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+
+namespace android {
+
+struct ALooper;
+struct ANetworkSession;
+struct WifiDisplaySource;
+
+struct RemoteDisplay : public RefBase {
+    RemoteDisplay();
+
+    status_t start(const char *iface);
+    status_t stop();
+
+protected:
+    virtual ~RemoteDisplay();
+
+private:
+    status_t mInitCheck;
+
+    sp<ALooper> mNetLooper;
+    sp<ALooper> mLooper;
+    sp<ANetworkSession> mNetSession;
+    sp<WifiDisplaySource> mSource;
+
+    DISALLOW_EVIL_CONSTRUCTORS(RemoteDisplay);
+};
+
+}  // namespace android
+
+#endif  // REMOTE_DISPLAY_H_
+
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 727fd0d..e49c218 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -1410,7 +1410,6 @@
 
     uint32_t encoder_flags = 0;
     if (mIsMetaDataStoredInVideoBuffers) {
-        encoder_flags |= OMXCodec::kHardwareCodecsOnly;
         encoder_flags |= OMXCodec::kStoreMetaDataInVideoBuffers;
     }
 
diff --git a/media/libmediaplayerservice/nuplayer/Android.mk b/media/libmediaplayerservice/nuplayer/Android.mk
index f97ba57..f469054 100644
--- a/media/libmediaplayerservice/nuplayer/Android.mk
+++ b/media/libmediaplayerservice/nuplayer/Android.mk
@@ -11,6 +11,9 @@
         NuPlayerStreamListener.cpp      \
         RTSPSource.cpp                  \
         StreamingSource.cpp             \
+        mp4/MP4Source.cpp               \
+        mp4/Parser.cpp                  \
+        mp4/TrackFragment.cpp           \
 
 LOCAL_C_INCLUDES := \
 	$(TOP)/frameworks/av/media/libstagefright/httplive            \
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
index 99569c9..f0c3240 100644
--- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
@@ -128,7 +128,7 @@
     return OK;
 }
 
-sp<MetaData> NuPlayer::GenericSource::getFormat(bool audio) {
+sp<MetaData> NuPlayer::GenericSource::getFormatMeta(bool audio) {
     sp<MediaSource> source = audio ? mAudioTrack.mSource : mVideoTrack.mSource;
 
     if (source == NULL) {
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.h b/media/libmediaplayerservice/nuplayer/GenericSource.h
index aaa5876..e50b855 100644
--- a/media/libmediaplayerservice/nuplayer/GenericSource.h
+++ b/media/libmediaplayerservice/nuplayer/GenericSource.h
@@ -43,7 +43,6 @@
 
     virtual status_t feedMoreTSData();
 
-    virtual sp<MetaData> getFormat(bool audio);
     virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
 
     virtual status_t getDuration(int64_t *durationUs);
@@ -53,6 +52,8 @@
 protected:
     virtual ~GenericSource();
 
+    virtual sp<MetaData> getFormatMeta(bool audio);
+
 private:
     struct Track {
         sp<MediaSource> mSource;
diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
index 22b8847..1e98f35 100644
--- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
@@ -81,7 +81,7 @@
     mTSParser = new ATSParser;
 }
 
-sp<MetaData> NuPlayer::HTTPLiveSource::getFormat(bool audio) {
+sp<MetaData> NuPlayer::HTTPLiveSource::getFormatMeta(bool audio) {
     ATSParser::SourceType type =
         audio ? ATSParser::AUDIO : ATSParser::VIDEO;
 
diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h
index f22af5b..9950a9e 100644
--- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h
+++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h
@@ -37,7 +37,6 @@
 
     virtual status_t feedMoreTSData();
 
-    virtual sp<MetaData> getFormat(bool audio);
     virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
 
     virtual status_t getDuration(int64_t *durationUs);
@@ -47,6 +46,8 @@
 protected:
     virtual ~HTTPLiveSource();
 
+    virtual sp<MetaData> getFormatMeta(bool audio);
+
 private:
     enum Flags {
         // Don't log any URLs.
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 86e122f..a02732b 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -28,9 +28,11 @@
 #include "RTSPSource.h"
 #include "StreamingSource.h"
 #include "GenericSource.h"
+#include "mp4/MP4Source.h"
 
 #include "ATSParser.h"
 
+#include <cutils/properties.h> // for property_get
 #include <media/stagefright/foundation/hexdump.h>
 #include <media/stagefright/foundation/ABuffer.h>
 #include <media/stagefright/foundation/ADebug.h>
@@ -43,6 +45,9 @@
 
 #include "avc_utils.h"
 
+#include "ESDS.h"
+#include <media/stagefright/Utils.h>
+
 namespace android {
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -81,7 +86,14 @@
 void NuPlayer::setDataSource(const sp<IStreamSource> &source) {
     sp<AMessage> msg = new AMessage(kWhatSetDataSource, id());
 
-    msg->setObject("source", new StreamingSource(source));
+    char prop[PROPERTY_VALUE_MAX];
+    if (property_get("media.stagefright.use-mp4source", prop, NULL)
+            && (!strcmp(prop, "1") || !strcasecmp(prop, "true"))) {
+        msg->setObject("source", new MP4Source(source));
+    } else {
+        msg->setObject("source", new StreamingSource(source));
+    }
+
     msg->post();
 }
 
@@ -258,7 +270,9 @@
             ALOGV("scanning sources haveAudio=%d, haveVideo=%d",
                  mAudioDecoder != NULL, mVideoDecoder != NULL);
 
-            instantiateDecoder(false, &mVideoDecoder);
+            if (mNativeWindow != NULL) {
+                instantiateDecoder(false, &mVideoDecoder);
+            }
 
             if (mAudioSink != NULL) {
                 instantiateDecoder(true, &mAudioDecoder);
@@ -279,7 +293,8 @@
                 break;
             }
 
-            if (mAudioDecoder == NULL || mVideoDecoder == NULL) {
+            if (mAudioDecoder == NULL && mAudioSink != NULL ||
+                mVideoDecoder == NULL && mNativeWindow != NULL) {
                 msg->post(100000ll);
                 mScanSourcesPending = true;
             }
@@ -500,6 +515,8 @@
                 CHECK(msg->findInt32("audio", &audio));
 
                 ALOGV("renderer %s flush completed.", audio ? "audio" : "video");
+            } else if (what == Renderer::kWhatVideoRenderingStart) {
+                notifyListener(MEDIA_INFO, MEDIA_INFO_RENDERING_START, 0);
             }
             break;
         }
@@ -674,16 +691,16 @@
         return OK;
     }
 
-    sp<MetaData> meta = mSource->getFormat(audio);
+    sp<AMessage> format = mSource->getFormat(audio);
 
-    if (meta == NULL) {
+    if (format == NULL) {
         return -EWOULDBLOCK;
     }
 
     if (!audio) {
-        const char *mime;
-        CHECK(meta->findCString(kKeyMIMEType, &mime));
-        mVideoIsAVC = !strcasecmp(MEDIA_MIMETYPE_VIDEO_AVC, mime);
+        AString mime;
+        CHECK(format->findString("mime", &mime));
+        mVideoIsAVC = !strcasecmp(MEDIA_MIMETYPE_VIDEO_AVC, mime.c_str());
     }
 
     sp<AMessage> notify =
@@ -694,7 +711,7 @@
                        new Decoder(notify, mNativeWindow);
     looper()->registerHandler(*decoder);
 
-    (*decoder)->configure(meta);
+    (*decoder)->configure(format);
 
     int64_t durationUs;
     if (mDriver != NULL && mSource->getDuration(&durationUs) == OK) {
@@ -925,4 +942,19 @@
     }
 }
 
+sp<AMessage> NuPlayer::Source::getFormat(bool audio) {
+    sp<MetaData> meta = getFormatMeta(audio);
+
+    if (meta == NULL) {
+        return NULL;
+    }
+
+    sp<AMessage> msg = new AMessage;
+
+    if(convertMetaDataToMessage(meta, &msg) == OK) {
+        return msg;
+    }
+    return NULL;
+}
+
 }  // namespace android
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h
index 25766e0..996806e 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h
@@ -60,14 +60,16 @@
 
     virtual void onMessageReceived(const sp<AMessage> &msg);
 
+public:
+    struct NuPlayerStreamListener;
+    struct Source;
+
 private:
     struct Decoder;
     struct GenericSource;
     struct HTTPLiveSource;
-    struct NuPlayerStreamListener;
     struct Renderer;
     struct RTSPSource;
-    struct Source;
     struct StreamingSource;
 
     enum {
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
index 0e53662..22f699e 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
@@ -20,15 +20,11 @@
 
 #include "NuPlayerDecoder.h"
 
-#include "ESDS.h"
-
 #include <media/stagefright/foundation/ABuffer.h>
 #include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/foundation/AMessage.h>
 #include <media/stagefright/ACodec.h>
 #include <media/stagefright/MediaDefs.h>
-#include <media/stagefright/MetaData.h>
-#include <media/stagefright/Utils.h>
 
 namespace android {
 
@@ -42,16 +38,24 @@
 NuPlayer::Decoder::~Decoder() {
 }
 
-void NuPlayer::Decoder::configure(const sp<MetaData> &meta) {
+void NuPlayer::Decoder::configure(const sp<AMessage> &format) {
     CHECK(mCodec == NULL);
 
-    const char *mime;
-    CHECK(meta->findCString(kKeyMIMEType, &mime));
+    AString mime;
+    CHECK(format->findString("mime", &mime));
 
     sp<AMessage> notifyMsg =
         new AMessage(kWhatCodecNotify, id());
 
-    sp<AMessage> format = makeFormat(meta);
+    mCSDIndex = 0;
+    for (size_t i = 0;; ++i) {
+        sp<ABuffer> csd;
+        if (!format->findBuffer(StringPrintf("csd-%d", i).c_str(), &csd)) {
+            break;
+        }
+
+        mCSD.push(csd);
+    }
 
     if (mNativeWindow != NULL) {
         format->setObject("native-window", mNativeWindow);
@@ -61,7 +65,7 @@
     // quickly, violating the OpenMAX specs, until that is remedied
     // we need to invest in an extra looper to free the main event
     // queue.
-    bool needDedicatedLooper = !strncasecmp(mime, "video/", 6);
+    bool needDedicatedLooper = !strncasecmp(mime.c_str(), "video/", 6);
 
     mCodec = new ACodec;
 
@@ -100,25 +104,6 @@
     }
 }
 
-sp<AMessage> NuPlayer::Decoder::makeFormat(const sp<MetaData> &meta) {
-    CHECK(mCSD.isEmpty());
-
-    sp<AMessage> msg;
-    CHECK_EQ(convertMetaDataToMessage(meta, &msg), (status_t)OK);
-
-    mCSDIndex = 0;
-    for (size_t i = 0;; ++i) {
-        sp<ABuffer> csd;
-        if (!msg->findBuffer(StringPrintf("csd-%d", i).c_str(), &csd)) {
-            break;
-        }
-
-        mCSD.push(csd);
-    }
-
-    return msg;
-}
-
 void NuPlayer::Decoder::onFillThisBuffer(const sp<AMessage> &msg) {
     sp<AMessage> reply;
     CHECK(msg->findMessage("reply", &reply));
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h
index 3ab1fcf..a876148 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h
@@ -30,7 +30,7 @@
     Decoder(const sp<AMessage> &notify,
             const sp<NativeWindowWrapper> &nativeWindow = NULL);
 
-    void configure(const sp<MetaData> &meta);
+    void configure(const sp<AMessage> &format);
 
     void signalFlush();
     void signalResume();
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index 1f13955..8a75f83 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -47,6 +47,7 @@
       mHasVideo(false),
       mSyncQueues(false),
       mPaused(false),
+      mVideoRenderingStarted(false),
       mLastPositionUpdateUs(-1ll),
       mVideoLateByUs(0ll) {
 }
@@ -387,9 +388,20 @@
     mVideoQueue.erase(mVideoQueue.begin());
     entry = NULL;
 
+    if (!mVideoRenderingStarted) {
+        mVideoRenderingStarted = true;
+        notifyVideoRenderingStart();
+    }
+
     notifyPosition();
 }
 
+void NuPlayer::Renderer::notifyVideoRenderingStart() {
+    sp<AMessage> notify = mNotify->dup();
+    notify->setInt32("what", kWhatVideoRenderingStart);
+    notify->post();
+}
+
 void NuPlayer::Renderer::notifyEOS(bool audio, status_t finalResult) {
     sp<AMessage> notify = mNotify->dup();
     notify->setInt32("what", kWhatEOS);
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
index 268628b..e4368c7 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
@@ -45,9 +45,10 @@
     void resume();
 
     enum {
-        kWhatEOS                = 'eos ',
-        kWhatFlushComplete      = 'fluC',
-        kWhatPosition           = 'posi',
+        kWhatEOS                 = 'eos ',
+        kWhatFlushComplete       = 'fluC',
+        kWhatPosition            = 'posi',
+        kWhatVideoRenderingStart = 'vdrd',
     };
 
 protected:
@@ -99,6 +100,7 @@
     bool mSyncQueues;
 
     bool mPaused;
+    bool mVideoRenderingStarted;
 
     int64_t mLastPositionUpdateUs;
     int64_t mVideoLateByUs;
@@ -120,6 +122,7 @@
     void notifyFlushComplete(bool audio);
     void notifyPosition();
     void notifyVideoLateBy(int64_t lateByUs);
+    void notifyVideoRenderingStart();
 
     void flushQueue(List<QueueEntry> *queue);
     bool dropBufferWhileFlushing(bool audio, const sp<AMessage> &msg);
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
index 531b29f..66aeff3 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h
@@ -34,7 +34,7 @@
     // an error or ERROR_END_OF_STREAM if not.
     virtual status_t feedMoreTSData() = 0;
 
-    virtual sp<MetaData> getFormat(bool audio) = 0;
+    virtual sp<AMessage> getFormat(bool audio);
 
     virtual status_t dequeueAccessUnit(
             bool audio, sp<ABuffer> *accessUnit) = 0;
@@ -54,6 +54,8 @@
 protected:
     virtual ~Source() {}
 
+    virtual sp<MetaData> getFormatMeta(bool audio) { return NULL; }
+
 private:
     DISALLOW_EVIL_CONSTRUCTORS(Source);
 };
diff --git a/media/libmediaplayerservice/nuplayer/RTSPSource.cpp b/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
index c910488..4a704e3 100644
--- a/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
@@ -95,7 +95,7 @@
     return mFinalResult;
 }
 
-sp<MetaData> NuPlayer::RTSPSource::getFormat(bool audio) {
+sp<MetaData> NuPlayer::RTSPSource::getFormatMeta(bool audio) {
     sp<AnotherPacketSource> source = getSource(audio);
 
     if (source == NULL) {
diff --git a/media/libmediaplayerservice/nuplayer/RTSPSource.h b/media/libmediaplayerservice/nuplayer/RTSPSource.h
index e11e304..c8409e5 100644
--- a/media/libmediaplayerservice/nuplayer/RTSPSource.h
+++ b/media/libmediaplayerservice/nuplayer/RTSPSource.h
@@ -40,7 +40,6 @@
 
     virtual status_t feedMoreTSData();
 
-    virtual sp<MetaData> getFormat(bool audio);
     virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
 
     virtual status_t getDuration(int64_t *durationUs);
@@ -52,6 +51,8 @@
 protected:
     virtual ~RTSPSource();
 
+    virtual sp<MetaData> getFormatMeta(bool audio);
+
 private:
     enum {
         kWhatNotify          = 'noti',
diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
index 7c9bc5e..b696aa4 100644
--- a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
@@ -107,7 +107,7 @@
     return OK;
 }
 
-sp<MetaData> NuPlayer::StreamingSource::getFormat(bool audio) {
+sp<MetaData> NuPlayer::StreamingSource::getFormatMeta(bool audio) {
     ATSParser::SourceType type =
         audio ? ATSParser::AUDIO : ATSParser::VIDEO;
 
diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.h b/media/libmediaplayerservice/nuplayer/StreamingSource.h
index ca00ef9..3971e2a 100644
--- a/media/libmediaplayerservice/nuplayer/StreamingSource.h
+++ b/media/libmediaplayerservice/nuplayer/StreamingSource.h
@@ -33,12 +33,13 @@
 
     virtual status_t feedMoreTSData();
 
-    virtual sp<MetaData> getFormat(bool audio);
     virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
 
 protected:
     virtual ~StreamingSource();
 
+    virtual sp<MetaData> getFormatMeta(bool audio);
+
 private:
     sp<IStreamSource> mSource;
     status_t mFinalResult;
diff --git a/media/libmediaplayerservice/nuplayer/mp4/MP4Source.cpp b/media/libmediaplayerservice/nuplayer/mp4/MP4Source.cpp
new file mode 100644
index 0000000..25c91e9
--- /dev/null
+++ b/media/libmediaplayerservice/nuplayer/mp4/MP4Source.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "MP4Source.h"
+
+#include "Parser.h"
+#include "../NuPlayerStreamListener.h"
+
+#include <media/IStreamSource.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MetaData.h>
+
+namespace android {
+
+struct StreamSource : public Parser::Source {
+    StreamSource(const sp<IStreamSource> &source)
+        : mListener(new NuPlayer::NuPlayerStreamListener(source, 0)),
+          mPosition(0) {
+        mListener->start();
+    }
+
+    virtual ssize_t readAt(off64_t offset, void *data, size_t size) {
+        if (offset < mPosition) {
+            return -EPIPE;
+        }
+
+        while (offset > mPosition) {
+            char buffer[1024];
+            off64_t skipBytes = offset - mPosition;
+            if (skipBytes > sizeof(buffer)) {
+                skipBytes = sizeof(buffer);
+            }
+
+            sp<AMessage> extra;
+            ssize_t n;
+            for (;;) {
+                n = mListener->read(buffer, skipBytes, &extra);
+
+                if (n == -EWOULDBLOCK) {
+                    usleep(10000);
+                    continue;
+                }
+
+                break;
+            }
+
+            ALOGV("skipped %ld bytes at offset %lld", n, mPosition);
+
+            if (n < 0) {
+                return n;
+            }
+
+            mPosition += n;
+        }
+
+        sp<AMessage> extra;
+        size_t total = 0;
+        while (total < size) {
+            ssize_t n = mListener->read(
+                    (uint8_t *)data + total, size - total, &extra);
+
+            if (n == -EWOULDBLOCK) {
+                usleep(10000);
+                continue;
+            } else if (n == 0) {
+                break;
+            } else if (n < 0) {
+                mPosition += total;
+                return n;
+            }
+
+            total += n;
+        }
+
+        ALOGV("read %ld bytes at offset %lld", n, mPosition);
+
+        mPosition += total;
+
+        return total;
+    }
+
+private:
+    sp<NuPlayer::NuPlayerStreamListener> mListener;
+    off64_t mPosition;
+
+    DISALLOW_EVIL_CONSTRUCTORS(StreamSource);
+};
+
+MP4Source::MP4Source(const sp<IStreamSource> &source)
+    : mSource(source),
+      mLooper(new ALooper),
+      mParser(new Parser),
+      mEOS(false) {
+    mLooper->registerHandler(mParser);
+}
+
+MP4Source::~MP4Source() {
+}
+
+void MP4Source::start() {
+    mLooper->start(false /* runOnCallingThread */);
+    mParser->start(new StreamSource(mSource));
+}
+
+status_t MP4Source::feedMoreTSData() {
+    return mEOS ? ERROR_END_OF_STREAM : (status_t)OK;
+}
+
+sp<AMessage> MP4Source::getFormat(bool audio) {
+    return mParser->getFormat(audio);
+}
+
+status_t MP4Source::dequeueAccessUnit(
+        bool audio, sp<ABuffer> *accessUnit) {
+    return mParser->dequeueAccessUnit(audio, accessUnit);
+}
+
+}  // namespace android
diff --git a/media/libmediaplayerservice/nuplayer/mp4/MP4Source.h b/media/libmediaplayerservice/nuplayer/mp4/MP4Source.h
new file mode 100644
index 0000000..57430aa
--- /dev/null
+++ b/media/libmediaplayerservice/nuplayer/mp4/MP4Source.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef MP4_SOURCE_H
+#define MP4_SOURCE_H
+
+#include "NuPlayerSource.h"
+
+namespace android {
+
+struct Parser;
+
+struct MP4Source : public NuPlayer::Source {
+    MP4Source(const sp<IStreamSource> &source);
+
+    virtual void start();
+
+    virtual status_t feedMoreTSData();
+
+    virtual sp<AMessage> getFormat(bool audio);
+
+    virtual status_t dequeueAccessUnit(
+            bool audio, sp<ABuffer> *accessUnit);
+
+protected:
+    virtual ~MP4Source();
+
+private:
+    sp<IStreamSource> mSource;
+    sp<ALooper> mLooper;
+    sp<Parser> mParser;
+    bool mEOS;
+
+    DISALLOW_EVIL_CONSTRUCTORS(MP4Source);
+};
+
+}  // namespace android
+
+#endif // MP4_SOURCE_H
diff --git a/media/libmediaplayerservice/nuplayer/mp4/Parser.cpp b/media/libmediaplayerservice/nuplayer/mp4/Parser.cpp
new file mode 100644
index 0000000..f664e92
--- /dev/null
+++ b/media/libmediaplayerservice/nuplayer/mp4/Parser.cpp
@@ -0,0 +1,1681 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "Parser"
+#include <utils/Log.h>
+
+#include "Parser.h"
+#include "TrackFragment.h"
+
+#include "ESDS.h"
+
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/foundation/hexdump.h>
+#include <media/stagefright/MediaDefs.h>
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/Utils.h>
+
+#include "../NuPlayerStreamListener.h"
+
+namespace android {
+
+static const char *Fourcc2String(uint32_t fourcc) {
+    static char buffer[5];
+    buffer[4] = '\0';
+    buffer[0] = fourcc >> 24;
+    buffer[1] = (fourcc >> 16) & 0xff;
+    buffer[2] = (fourcc >> 8) & 0xff;
+    buffer[3] = fourcc & 0xff;
+
+    return buffer;
+}
+
+static const char *IndentString(size_t n) {
+    static const char kSpace[] = "                              ";
+    return kSpace + sizeof(kSpace) - 2 * n - 1;
+}
+
+// static
+const Parser::DispatchEntry Parser::kDispatchTable[] = {
+    { FOURCC('m', 'o', 'o', 'v'), 0, NULL },
+    { FOURCC('t', 'r', 'a', 'k'), FOURCC('m', 'o', 'o', 'v'), NULL },
+    { FOURCC('u', 'd', 't', 'a'), FOURCC('t', 'r', 'a', 'k'), NULL },
+    { FOURCC('u', 'd', 't', 'a'), FOURCC('m', 'o', 'o', 'v'), NULL },
+    { FOURCC('m', 'e', 't', 'a'), FOURCC('u', 'd', 't', 'a'), NULL },
+    { FOURCC('i', 'l', 's', 't'), FOURCC('m', 'e', 't', 'a'), NULL },
+
+    { FOURCC('t', 'k', 'h', 'd'), FOURCC('t', 'r', 'a', 'k'),
+        &Parser::parseTrackHeader
+    },
+
+    { FOURCC('m', 'v', 'e', 'x'), FOURCC('m', 'o', 'o', 'v'), NULL },
+
+    { FOURCC('t', 'r', 'e', 'x'), FOURCC('m', 'v', 'e', 'x'),
+        &Parser::parseTrackExtends
+    },
+
+    { FOURCC('e', 'd', 't', 's'), FOURCC('t', 'r', 'a', 'k'), NULL },
+    { FOURCC('m', 'd', 'i', 'a'), FOURCC('t', 'r', 'a', 'k'), NULL },
+
+    { FOURCC('m', 'd', 'h', 'd'), FOURCC('m', 'd', 'i', 'a'),
+        &Parser::parseMediaHeader
+    },
+
+    { FOURCC('h', 'd', 'l', 'r'), FOURCC('m', 'd', 'i', 'a'),
+        &Parser::parseMediaHandler
+    },
+
+    { FOURCC('m', 'i', 'n', 'f'), FOURCC('m', 'd', 'i', 'a'), NULL },
+    { FOURCC('d', 'i', 'n', 'f'), FOURCC('m', 'i', 'n', 'f'), NULL },
+    { FOURCC('s', 't', 'b', 'l'), FOURCC('m', 'i', 'n', 'f'), NULL },
+    { FOURCC('s', 't', 's', 'd'), FOURCC('s', 't', 'b', 'l'), NULL },
+
+    { FOURCC('s', 't', 's', 'z'), FOURCC('s', 't', 'b', 'l'),
+        &Parser::parseSampleSizes },
+
+    { FOURCC('s', 't', 'z', '2'), FOURCC('s', 't', 'b', 'l'),
+        &Parser::parseCompactSampleSizes },
+
+    { FOURCC('s', 't', 's', 'c'), FOURCC('s', 't', 'b', 'l'),
+        &Parser::parseSampleToChunk },
+
+    { FOURCC('s', 't', 'c', 'o'), FOURCC('s', 't', 'b', 'l'),
+        &Parser::parseChunkOffsets },
+
+    { FOURCC('c', 'o', '6', '4'), FOURCC('s', 't', 'b', 'l'),
+        &Parser::parseChunkOffsets64 },
+
+    { FOURCC('a', 'v', 'c', 'C'), FOURCC('a', 'v', 'c', '1'),
+        &Parser::parseAVCCodecSpecificData },
+
+    { FOURCC('e', 's', 'd', 's'), FOURCC('m', 'p', '4', 'a'),
+        &Parser::parseESDSCodecSpecificData },
+
+    { FOURCC('e', 's', 'd', 's'), FOURCC('m', 'p', '4', 'v'),
+        &Parser::parseESDSCodecSpecificData },
+
+    { FOURCC('m', 'd', 'a', 't'), 0, &Parser::parseMediaData },
+
+    { FOURCC('m', 'o', 'o', 'f'), 0, NULL },
+    { FOURCC('t', 'r', 'a', 'f'), FOURCC('m', 'o', 'o', 'f'), NULL },
+
+    { FOURCC('t', 'f', 'h', 'd'), FOURCC('t', 'r', 'a', 'f'),
+        &Parser::parseTrackFragmentHeader
+    },
+    { FOURCC('t', 'r', 'u', 'n'), FOURCC('t', 'r', 'a', 'f'),
+        &Parser::parseTrackFragmentRun
+    },
+
+    { FOURCC('m', 'f', 'r', 'a'), 0, NULL },
+};
+
+struct FileSource : public Parser::Source {
+    FileSource(const char *filename)
+        : mFile(fopen(filename, "rb")) {
+            CHECK(mFile != NULL);
+        }
+
+    virtual ssize_t readAt(off64_t offset, void *data, size_t size) {
+        fseek(mFile, offset, SEEK_SET);
+        return fread(data, 1, size, mFile);
+    }
+
+    private:
+    FILE *mFile;
+
+    DISALLOW_EVIL_CONSTRUCTORS(FileSource);
+};
+
+Parser::Parser()
+    : mBufferPos(0),
+      mSuspended(false),
+      mFinalResult(OK) {
+}
+
+Parser::~Parser() {
+}
+
+void Parser::start(const char *filename) {
+    sp<AMessage> msg = new AMessage(kWhatStart, id());
+    msg->setObject("source", new FileSource(filename));
+    msg->post();
+}
+
+void Parser::start(const sp<Source> &source) {
+    sp<AMessage> msg = new AMessage(kWhatStart, id());
+    msg->setObject("source", source);
+    msg->post();
+}
+
+sp<AMessage> Parser::getFormat(bool audio) {
+    sp<AMessage> msg = new AMessage(kWhatGetFormat, id());
+    msg->setInt32("audio", audio);
+
+    sp<AMessage> response;
+    status_t err = msg->postAndAwaitResponse(&response);
+
+    if (err != OK) {
+        return NULL;
+    }
+
+    if (response->findInt32("err", &err) && err != OK) {
+        return NULL;
+    }
+
+    sp<AMessage> format;
+    CHECK(response->findMessage("format", &format));
+
+    ALOGV("returning format %s", format->debugString().c_str());
+    return format;
+}
+
+status_t Parser::dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit) {
+    sp<AMessage> msg = new AMessage(kWhatDequeueAccessUnit, id());
+    msg->setInt32("audio", audio);
+
+    sp<AMessage> response;
+    status_t err = msg->postAndAwaitResponse(&response);
+
+    if (err != OK) {
+        return err;
+    }
+
+    if (response->findInt32("err", &err) && err != OK) {
+        return err;
+    }
+
+    CHECK(response->findBuffer("accessUnit", accessUnit));
+
+    return OK;
+}
+
+ssize_t Parser::findTrack(bool wantAudio) const {
+    for (size_t i = 0; i < mTracks.size(); ++i) {
+        const TrackInfo *info = &mTracks.valueAt(i);
+
+        bool isAudio =
+            info->mMediaHandlerType == FOURCC('s', 'o', 'u', 'n');
+
+        bool isVideo =
+            info->mMediaHandlerType == FOURCC('v', 'i', 'd', 'e');
+
+        if ((wantAudio && isAudio) || (!wantAudio && !isAudio)) {
+            if (info->mSampleDescs.empty()) {
+                break;
+            }
+
+            return i;
+        }
+    }
+
+    return -EWOULDBLOCK;
+}
+
+void Parser::onMessageReceived(const sp<AMessage> &msg) {
+    switch (msg->what()) {
+        case kWhatStart:
+        {
+            sp<RefBase> obj;
+            CHECK(msg->findObject("source", &obj));
+
+            mSource = static_cast<Source *>(obj.get());
+
+            mBuffer = new ABuffer(512 * 1024);
+            mBuffer->setRange(0, 0);
+
+            enter(0ll, 0, 0);
+
+            (new AMessage(kWhatProceed, id()))->post();
+            break;
+        }
+
+        case kWhatProceed:
+        {
+            CHECK(!mSuspended);
+
+            status_t err = onProceed();
+
+            if (err == OK) {
+                if (!mSuspended) {
+                    msg->post();
+                }
+            } else if (err != -EAGAIN) {
+                ALOGE("onProceed returned error %d", err);
+            }
+
+            break;
+        }
+
+        case kWhatReadMore:
+        {
+            size_t needed;
+            CHECK(msg->findSize("needed", &needed));
+
+            memmove(mBuffer->base(), mBuffer->data(), mBuffer->size());
+            mBufferPos += mBuffer->offset();
+            mBuffer->setRange(0, mBuffer->size());
+
+            size_t maxBytesToRead = mBuffer->capacity() - mBuffer->size();
+
+            if (maxBytesToRead < needed) {
+                ALOGI("resizing buffer.");
+
+                sp<ABuffer> newBuffer =
+                    new ABuffer((mBuffer->size() + needed + 1023) & ~1023);
+                memcpy(newBuffer->data(), mBuffer->data(), mBuffer->size());
+                newBuffer->setRange(0, mBuffer->size());
+
+                mBuffer = newBuffer;
+                maxBytesToRead = mBuffer->capacity() - mBuffer->size();
+            }
+
+            CHECK_GE(maxBytesToRead, needed);
+
+            ssize_t n = mSource->readAt(
+                    mBufferPos + mBuffer->size(),
+                    mBuffer->data() + mBuffer->size(), needed);
+
+            if (n < (ssize_t)needed) {
+                ALOGI("%s", "Reached EOF");
+                if (n < 0) {
+                    mFinalResult = n;
+                } else if (n == 0) {
+                    mFinalResult = ERROR_END_OF_STREAM;
+                } else {
+                    mFinalResult = ERROR_IO;
+                }
+            } else {
+                mBuffer->setRange(0, mBuffer->size() + n);
+                (new AMessage(kWhatProceed, id()))->post();
+            }
+
+            break;
+        }
+
+        case kWhatGetFormat:
+        {
+            int32_t wantAudio;
+            CHECK(msg->findInt32("audio", &wantAudio));
+
+            status_t err = -EWOULDBLOCK;
+            sp<AMessage> response = new AMessage;
+
+            ssize_t trackIndex = findTrack(wantAudio);
+
+            if (trackIndex < 0) {
+                err = trackIndex;
+            } else {
+                TrackInfo *info = &mTracks.editValueAt(trackIndex);
+
+                response->setMessage(
+                        "format", info->mSampleDescs.itemAt(0).mFormat);
+
+                err = OK;
+            }
+
+            response->setInt32("err", err);
+
+            uint32_t replyID;
+            CHECK(msg->senderAwaitsResponse(&replyID));
+
+            response->postReply(replyID);
+            break;
+        }
+
+        case kWhatDequeueAccessUnit:
+        {
+            int32_t wantAudio;
+            CHECK(msg->findInt32("audio", &wantAudio));
+
+            status_t err = -EWOULDBLOCK;
+            sp<AMessage> response = new AMessage;
+
+            ssize_t trackIndex = findTrack(wantAudio);
+
+            if (trackIndex < 0) {
+                err = trackIndex;
+            } else {
+                sp<ABuffer> accessUnit;
+                err = onDequeueAccessUnit(trackIndex, &accessUnit);
+
+                if (err == OK) {
+                    response->setBuffer("accessUnit", accessUnit);
+                }
+            }
+
+            response->setInt32("err", err);
+
+            uint32_t replyID;
+            CHECK(msg->senderAwaitsResponse(&replyID));
+
+            response->postReply(replyID);
+            break;
+        }
+
+        default:
+            TRESPASS();
+    }
+}
+
+status_t Parser::onProceed() {
+    status_t err;
+
+    if ((err = need(8)) != OK) {
+        return err;
+    }
+
+    uint64_t size = readU32(0);
+    uint32_t type = readU32(4);
+
+    size_t offset = 8;
+
+    if (size == 1) {
+        if ((err = need(16)) != OK) {
+            return err;
+        }
+
+        size = readU64(offset);
+        offset += 8;
+    }
+
+    uint8_t userType[16];
+
+    if (type == FOURCC('u', 'u', 'i', 'd')) {
+        if ((err = need(offset + 16)) != OK) {
+            return err;
+        }
+
+        memcpy(userType, mBuffer->data() + offset, 16);
+        offset += 16;
+    }
+
+    CHECK(!mStack.isEmpty());
+    uint32_t ptype = mStack.itemAt(mStack.size() - 1).mType;
+
+    static const size_t kNumDispatchers =
+        sizeof(kDispatchTable) / sizeof(kDispatchTable[0]);
+
+    size_t i;
+    for (i = 0; i < kNumDispatchers; ++i) {
+        if (kDispatchTable[i].mType == type
+                && kDispatchTable[i].mParentType == ptype) {
+            break;
+        }
+    }
+
+    // SampleEntry boxes are container boxes that start with a variable
+    // amount of data depending on the media handler type.
+    // We don't look inside 'hint' type SampleEntry boxes.
+
+    bool isSampleEntryBox =
+        (ptype == FOURCC('s', 't', 's', 'd'))
+        && editTrack(mCurrentTrackID)->mMediaHandlerType
+        != FOURCC('h', 'i', 'n', 't');
+
+    if ((i < kNumDispatchers && kDispatchTable[i].mHandler == 0)
+            || isSampleEntryBox || ptype == FOURCC('i', 'l', 's', 't')) {
+        // This is a container box.
+        if (type == FOURCC('m', 'e', 't', 'a')) {
+            if ((err = need(offset + 4)) < OK) {
+                return err;
+            }
+
+            if (readU32(offset) != 0) {
+                return -EINVAL;
+            }
+
+            offset += 4;
+        } else if (type == FOURCC('s', 't', 's', 'd')) {
+            if ((err = need(offset + 8)) < OK) {
+                return err;
+            }
+
+            if (readU32(offset) != 0) {
+                return -EINVAL;
+            }
+
+            if (readU32(offset + 4) == 0) {
+                // We need at least some entries.
+                return -EINVAL;
+            }
+
+            offset += 8;
+        } else if (isSampleEntryBox) {
+            size_t headerSize;
+
+            switch (editTrack(mCurrentTrackID)->mMediaHandlerType) {
+                case FOURCC('v', 'i', 'd', 'e'):
+                {
+                    // 8 bytes SampleEntry + 70 bytes VisualSampleEntry
+                    headerSize = 78;
+                    break;
+                }
+
+                case FOURCC('s', 'o', 'u', 'n'):
+                {
+                    // 8 bytes SampleEntry + 20 bytes AudioSampleEntry
+                    headerSize = 28;
+                    break;
+                }
+
+                case FOURCC('m', 'e', 't', 'a'):
+                {
+                    headerSize = 8;  // 8 bytes SampleEntry
+                    break;
+                }
+
+                default:
+                    TRESPASS();
+            }
+
+            if (offset + headerSize > size) {
+                return -EINVAL;
+            }
+
+            if ((err = need(offset + headerSize)) != OK) {
+                return err;
+            }
+
+            switch (editTrack(mCurrentTrackID)->mMediaHandlerType) {
+                case FOURCC('v', 'i', 'd', 'e'):
+                {
+                    err = parseVisualSampleEntry(
+                            type, offset, offset + headerSize);
+                    break;
+                }
+
+                case FOURCC('s', 'o', 'u', 'n'):
+                {
+                    err = parseAudioSampleEntry(
+                            type, offset, offset + headerSize);
+                    break;
+                }
+
+                case FOURCC('m', 'e', 't', 'a'):
+                {
+                    err = OK;
+                    break;
+                }
+
+                default:
+                    TRESPASS();
+            }
+
+            if (err != OK) {
+                return err;
+            }
+
+            offset += headerSize;
+        }
+
+        skip(offset);
+
+        ALOGV("%sentering box of type '%s'",
+                IndentString(mStack.size()), Fourcc2String(type));
+
+        enter(mBufferPos - offset, type, size - offset);
+    } else {
+        if (!fitsContainer(size)) {
+            return -EINVAL;
+        }
+
+        if (i < kNumDispatchers && kDispatchTable[i].mHandler != 0) {
+            // We have a handler for this box type.
+
+            if ((err = need(size)) != OK) {
+                return err;
+            }
+
+            ALOGV("%sparsing box of type '%s'",
+                    IndentString(mStack.size()), Fourcc2String(type));
+
+            if ((err = (this->*kDispatchTable[i].mHandler)(
+                            type, offset, size)) != OK) {
+                return err;
+            }
+        } else {
+            // Unknown box type
+
+            ALOGV("%sskipping box of type '%s', size %llu",
+                    IndentString(mStack.size()),
+                    Fourcc2String(type), size);
+
+        }
+
+        skip(size);
+    }
+
+    return OK;
+}
+
+// static
+int Parser::CompareSampleLocation(
+        const SampleInfo &sample, const MediaDataInfo &mdatInfo) {
+    if (sample.mOffset + sample.mSize < mdatInfo.mOffset) {
+        return -1;
+    }
+
+    if (sample.mOffset >= mdatInfo.mOffset + mdatInfo.mBuffer->size()) {
+        return 1;
+    }
+
+    // Otherwise make sure the sample is completely contained within this
+    // media data block.
+
+    CHECK_GE(sample.mOffset, mdatInfo.mOffset);
+
+    CHECK_LE(sample.mOffset + sample.mSize,
+             mdatInfo.mOffset + mdatInfo.mBuffer->size());
+
+    return 0;
+}
+
+void Parser::resumeIfNecessary() {
+    if (!mSuspended) {
+        return;
+    }
+
+    ALOGI("resuming.");
+
+    mSuspended = false;
+    (new AMessage(kWhatProceed, id()))->post();
+}
+
+status_t Parser::getSample(
+        TrackInfo *info, sp<TrackFragment> *fragment, SampleInfo *sampleInfo) {
+    for (;;) {
+        if (info->mFragments.empty()) {
+            if (mFinalResult != OK) {
+                return mFinalResult;
+            }
+
+            resumeIfNecessary();
+            return -EWOULDBLOCK;
+        }
+
+        *fragment = *info->mFragments.begin();
+
+        status_t err = (*fragment)->getSample(sampleInfo);
+
+        if (err == OK) {
+            return OK;
+        } else if (err != ERROR_END_OF_STREAM) {
+            return err;
+        }
+
+        // Really, end of this fragment...
+
+        info->mFragments.erase(info->mFragments.begin());
+    }
+}
+
+status_t Parser::onDequeueAccessUnit(
+        size_t trackIndex, sp<ABuffer> *accessUnit) {
+    TrackInfo *info = &mTracks.editValueAt(trackIndex);
+
+    sp<TrackFragment> fragment;
+    SampleInfo sampleInfo;
+    status_t err = getSample(info, &fragment, &sampleInfo);
+
+    if (err == -EWOULDBLOCK) {
+        resumeIfNecessary();
+        return err;
+    } else if (err != OK) {
+        return err;
+    }
+
+    err = -EWOULDBLOCK;
+
+    bool checkDroppable = false;
+
+    for (size_t i = 0; i < mMediaData.size(); ++i) {
+        const MediaDataInfo &mdatInfo = mMediaData.itemAt(i);
+
+        int cmp = CompareSampleLocation(sampleInfo, mdatInfo);
+
+        if (cmp < 0) {
+            return -EPIPE;
+        } else if (cmp == 0) {
+            if (i > 0) {
+                checkDroppable = true;
+            }
+
+            err = makeAccessUnit(info, sampleInfo, mdatInfo, accessUnit);
+            break;
+        }
+    }
+
+    if (err != OK) {
+        return err;
+    }
+
+    fragment->advance();
+
+    if (!mMediaData.empty() && checkDroppable) {
+        size_t numDroppable = 0;
+        bool done = false;
+
+        for (size_t i = 0; !done && i < mMediaData.size(); ++i) {
+            const MediaDataInfo &mdatInfo = mMediaData.itemAt(i);
+
+            for (size_t j = 0; j < mTracks.size(); ++j) {
+                TrackInfo *info = &mTracks.editValueAt(j);
+
+                sp<TrackFragment> fragment;
+                SampleInfo sampleInfo;
+                err = getSample(info, &fragment, &sampleInfo);
+
+                if (err != OK) {
+                    done = true;
+                    break;
+                }
+
+                int cmp = CompareSampleLocation(sampleInfo, mdatInfo);
+
+                if (cmp <= 0) {
+                    done = true;
+                    break;
+                }
+            }
+
+            if (!done) {
+                ++numDroppable;
+            }
+        }
+
+        if (numDroppable > 0) {
+            mMediaData.removeItemsAt(0, numDroppable);
+
+            if (mMediaData.size() < 5) {
+                resumeIfNecessary();
+            }
+        }
+    }
+
+    return err;
+}
+
+static size_t parseNALSize(size_t nalLengthSize, const uint8_t *data) {
+    switch (nalLengthSize) {
+        case 1:
+            return *data;
+        case 2:
+            return U16_AT(data);
+        case 3:
+            return ((size_t)data[0] << 16) | U16_AT(&data[1]);
+        case 4:
+            return U32_AT(data);
+    }
+
+    // This cannot happen, mNALLengthSize springs to life by adding 1 to
+    // a 2-bit integer.
+    TRESPASS();
+
+    return 0;
+}
+
+status_t Parser::makeAccessUnit(
+        TrackInfo *info,
+        const SampleInfo &sample,
+        const MediaDataInfo &mdatInfo,
+        sp<ABuffer> *accessUnit) {
+    if (sample.mSampleDescIndex < 1
+            || sample.mSampleDescIndex > info->mSampleDescs.size()) {
+        return ERROR_MALFORMED;
+    }
+
+    int64_t presentationTimeUs =
+        1000000ll * sample.mPresentationTime / info->mMediaTimeScale;
+
+    const SampleDescription &sampleDesc =
+        info->mSampleDescs.itemAt(sample.mSampleDescIndex - 1);
+
+    size_t nalLengthSize;
+    if (!sampleDesc.mFormat->findSize("nal-length-size", &nalLengthSize)) {
+        *accessUnit = new ABuffer(sample.mSize);
+
+        memcpy((*accessUnit)->data(),
+               mdatInfo.mBuffer->data() + (sample.mOffset - mdatInfo.mOffset),
+               sample.mSize);
+
+        (*accessUnit)->meta()->setInt64("timeUs", presentationTimeUs);
+        return OK;
+    }
+
+    const uint8_t *srcPtr =
+        mdatInfo.mBuffer->data() + (sample.mOffset - mdatInfo.mOffset);
+
+    for (int i = 0; i < 2 ; ++i) {
+        size_t srcOffset = 0;
+        size_t dstOffset = 0;
+
+        while (srcOffset < sample.mSize) {
+            if (srcOffset + nalLengthSize > sample.mSize) {
+                return ERROR_MALFORMED;
+            }
+
+            size_t nalSize = parseNALSize(nalLengthSize, &srcPtr[srcOffset]);
+            srcOffset += nalLengthSize;
+
+            if (srcOffset + nalSize > sample.mSize) {
+                return ERROR_MALFORMED;
+            }
+
+            if (i == 1) {
+                memcpy((*accessUnit)->data() + dstOffset,
+                       "\x00\x00\x00\x01",
+                       4);
+
+                memcpy((*accessUnit)->data() + dstOffset + 4,
+                       srcPtr + srcOffset,
+                       nalSize);
+            }
+
+            srcOffset += nalSize;
+            dstOffset += nalSize + 4;
+        }
+
+        if (i == 0) {
+            (*accessUnit) = new ABuffer(dstOffset);
+            (*accessUnit)->meta()->setInt64(
+                    "timeUs", presentationTimeUs);
+        }
+    }
+
+    return OK;
+}
+
+status_t Parser::need(size_t size) {
+    if (!fitsContainer(size)) {
+        return -EINVAL;
+    }
+
+    if (size <= mBuffer->size()) {
+        return OK;
+    }
+
+    sp<AMessage> msg = new AMessage(kWhatReadMore, id());
+    msg->setSize("needed", size - mBuffer->size());
+    msg->post();
+
+    // ALOGV("need(%d) returning -EAGAIN, only have %d", size, mBuffer->size());
+
+    return -EAGAIN;
+}
+
+void Parser::enter(off64_t offset, uint32_t type, uint64_t size) {
+    Container container;
+    container.mOffset = offset;
+    container.mType = type;
+    container.mExtendsToEOF = (size == 0);
+    container.mBytesRemaining = size;
+
+    mStack.push(container);
+}
+
+bool Parser::fitsContainer(uint64_t size) const {
+    CHECK(!mStack.isEmpty());
+    const Container &container = mStack.itemAt(mStack.size() - 1);
+
+    return container.mExtendsToEOF || size <= container.mBytesRemaining;
+}
+
+uint16_t Parser::readU16(size_t offset) {
+    CHECK_LE(offset + 2, mBuffer->size());
+
+    const uint8_t *ptr = mBuffer->data() + offset;
+    return (ptr[0] << 8) | ptr[1];
+}
+
+uint32_t Parser::readU32(size_t offset) {
+    CHECK_LE(offset + 4, mBuffer->size());
+
+    const uint8_t *ptr = mBuffer->data() + offset;
+    return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3];
+}
+
+uint64_t Parser::readU64(size_t offset) {
+    return (((uint64_t)readU32(offset)) << 32) | readU32(offset + 4);
+}
+
+void Parser::skip(off_t distance) {
+    CHECK(!mStack.isEmpty());
+    for (size_t i = mStack.size(); i-- > 0;) {
+        Container *container = &mStack.editItemAt(i);
+        if (!container->mExtendsToEOF) {
+            CHECK_LE(distance, (off_t)container->mBytesRemaining);
+
+            container->mBytesRemaining -= distance;
+
+            if (container->mBytesRemaining == 0) {
+                ALOGV("%sleaving box of type '%s'",
+                        IndentString(mStack.size() - 1),
+                        Fourcc2String(container->mType));
+
+#if 0
+                if (container->mType == FOURCC('s', 't', 's', 'd')) {
+                    TrackInfo *trackInfo = editTrack(mCurrentTrackID);
+                    for (size_t i = 0;
+                            i < trackInfo->mSampleDescs.size(); ++i) {
+                        ALOGI("format #%d: %s",
+                              i,
+                              trackInfo->mSampleDescs.itemAt(i)
+                                .mFormat->debugString().c_str());
+                    }
+                }
+#endif
+
+                if (container->mType == FOURCC('s', 't', 'b', 'l')) {
+                    TrackInfo *trackInfo = editTrack(mCurrentTrackID);
+
+                    trackInfo->mStaticFragment->signalCompletion();
+
+                    CHECK(trackInfo->mFragments.empty());
+                    trackInfo->mFragments.push_back(trackInfo->mStaticFragment);
+                    trackInfo->mStaticFragment.clear();
+                } else if (container->mType == FOURCC('t', 'r', 'a', 'f')) {
+                    TrackInfo *trackInfo =
+                        editTrack(mTrackFragmentHeaderInfo.mTrackID);
+
+                    const sp<TrackFragment> &fragment =
+                        *--trackInfo->mFragments.end();
+
+                    static_cast<DynamicTrackFragment *>(
+                            fragment.get())->signalCompletion();
+                }
+
+                container = NULL;
+                mStack.removeItemsAt(i);
+            }
+        }
+    }
+
+    if (distance < (off_t)mBuffer->size()) {
+        mBuffer->setRange(mBuffer->offset() + distance, mBuffer->size() - distance);
+        mBufferPos += distance;
+        return;
+    }
+
+    mBuffer->setRange(0, 0);
+    mBufferPos += distance;
+}
+
+status_t Parser::parseTrackHeader(
+        uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 4 > size) {
+        return -EINVAL;
+    }
+
+    uint32_t flags = readU32(offset);
+
+    uint32_t version = flags >> 24;
+    flags &= 0xffffff;
+
+    uint32_t trackID;
+    uint64_t duration;
+
+    if (version == 1) {
+        if (offset + 36 > size) {
+            return -EINVAL;
+        }
+
+        trackID = readU32(offset + 20);
+        duration = readU64(offset + 28);
+
+        offset += 36;
+    } else if (version == 0) {
+        if (offset + 24 > size) {
+            return -EINVAL;
+        }
+
+        trackID = readU32(offset + 12);
+        duration = readU32(offset + 20);
+
+        offset += 24;
+    } else {
+        return -EINVAL;
+    }
+
+    TrackInfo *info = editTrack(trackID, true /* createIfNecessary */);
+    info->mFlags = flags;
+    info->mDuration = duration;
+
+    info->mStaticFragment = new StaticTrackFragment;
+
+    mCurrentTrackID = trackID;
+
+    return OK;
+}
+
+status_t Parser::parseMediaHeader(
+        uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 4 > size) {
+        return -EINVAL;
+    }
+
+    uint32_t versionAndFlags = readU32(offset);
+
+    if (versionAndFlags & 0xffffff) {
+        return ERROR_MALFORMED;
+    }
+
+    uint32_t version = versionAndFlags >> 24;
+
+    TrackInfo *info = editTrack(mCurrentTrackID);
+
+    if (version == 1) {
+        if (offset + 4 + 32 > size) {
+            return -EINVAL;
+        }
+        info->mMediaTimeScale = U32_AT(mBuffer->data() + offset + 20);
+    } else if (version == 0) {
+        if (offset + 4 + 20 > size) {
+            return -EINVAL;
+        }
+        info->mMediaTimeScale = U32_AT(mBuffer->data() + offset + 12);
+    } else {
+        return ERROR_MALFORMED;
+    }
+
+    return OK;
+}
+
+status_t Parser::parseMediaHandler(
+        uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 12 > size) {
+        return -EINVAL;
+    }
+
+    if (readU32(offset) != 0) {
+        return -EINVAL;
+    }
+
+    uint32_t handlerType = readU32(offset + 8);
+
+    switch (handlerType) {
+        case FOURCC('v', 'i', 'd', 'e'):
+        case FOURCC('s', 'o', 'u', 'n'):
+        case FOURCC('h', 'i', 'n', 't'):
+        case FOURCC('m', 'e', 't', 'a'):
+            break;
+
+        default:
+            return -EINVAL;
+    }
+
+    editTrack(mCurrentTrackID)->mMediaHandlerType = handlerType;
+
+    return OK;
+}
+
+status_t Parser::parseVisualSampleEntry(
+        uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 78 > size) {
+        return -EINVAL;
+    }
+
+    TrackInfo *trackInfo = editTrack(mCurrentTrackID);
+
+    trackInfo->mSampleDescs.push();
+    SampleDescription *sampleDesc =
+        &trackInfo->mSampleDescs.editItemAt(
+                trackInfo->mSampleDescs.size() - 1);
+
+    sampleDesc->mType = type;
+    sampleDesc->mDataRefIndex = readU16(offset + 6);
+
+    sp<AMessage> format = new AMessage;
+
+    switch (type) {
+        case FOURCC('a', 'v', 'c', '1'):
+            format->setString("mime", MEDIA_MIMETYPE_VIDEO_AVC);
+            break;
+        case FOURCC('m', 'p', '4', 'v'):
+            format->setString("mime", MEDIA_MIMETYPE_VIDEO_MPEG4);
+            break;
+        case FOURCC('s', '2', '6', '3'):
+        case FOURCC('h', '2', '6', '3'):
+        case FOURCC('H', '2', '6', '3'):
+            format->setString("mime", MEDIA_MIMETYPE_VIDEO_H263);
+            break;
+        default:
+            format->setString("mime", "application/octet-stream");
+            break;
+    }
+
+    format->setInt32("width", readU16(offset + 8 + 16));
+    format->setInt32("height", readU16(offset + 8 + 18));
+
+    sampleDesc->mFormat = format;
+
+    return OK;
+}
+
+status_t Parser::parseAudioSampleEntry(
+        uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 28 > size) {
+        return -EINVAL;
+    }
+
+    TrackInfo *trackInfo = editTrack(mCurrentTrackID);
+
+    trackInfo->mSampleDescs.push();
+    SampleDescription *sampleDesc =
+        &trackInfo->mSampleDescs.editItemAt(
+                trackInfo->mSampleDescs.size() - 1);
+
+    sampleDesc->mType = type;
+    sampleDesc->mDataRefIndex = readU16(offset + 6);
+
+    sp<AMessage> format = new AMessage;
+
+    format->setInt32("channel-count", readU16(offset + 8 + 8));
+    format->setInt32("sample-size", readU16(offset + 8 + 10));
+    format->setInt32("sample-rate", readU32(offset + 8 + 16) / 65536.0f);
+
+    switch (type) {
+        case FOURCC('m', 'p', '4', 'a'):
+            format->setString("mime", MEDIA_MIMETYPE_AUDIO_AAC);
+            break;
+
+        case FOURCC('s', 'a', 'm', 'r'):
+            format->setString("mime", MEDIA_MIMETYPE_AUDIO_AMR_NB);
+            format->setInt32("channel-count", 1);
+            format->setInt32("sample-rate", 8000);
+            break;
+
+        case FOURCC('s', 'a', 'w', 'b'):
+            format->setString("mime", MEDIA_MIMETYPE_AUDIO_AMR_WB);
+            format->setInt32("channel-count", 1);
+            format->setInt32("sample-rate", 16000);
+            break;
+        default:
+            format->setString("mime", "application/octet-stream");
+            break;
+    }
+
+    sampleDesc->mFormat = format;
+
+    return OK;
+}
+
+static void addCodecSpecificData(
+        const sp<AMessage> &format, int32_t index,
+        const void *data, size_t size,
+        bool insertStartCode = false) {
+    sp<ABuffer> csd = new ABuffer(insertStartCode ? size + 4 : size);
+
+    memcpy(csd->data() + (insertStartCode ? 4 : 0), data, size);
+
+    if (insertStartCode) {
+        memcpy(csd->data(), "\x00\x00\x00\x01", 4);
+    }
+
+    csd->meta()->setInt32("csd", true);
+    csd->meta()->setInt64("timeUs", 0ll);
+
+    format->setBuffer(StringPrintf("csd-%d", index).c_str(), csd);
+}
+
+status_t Parser::parseSampleSizes(
+        uint32_t type, size_t offset, uint64_t size) {
+    return editTrack(mCurrentTrackID)->mStaticFragment->parseSampleSizes(
+            this, type, offset, size);
+}
+
+status_t Parser::parseCompactSampleSizes(
+        uint32_t type, size_t offset, uint64_t size) {
+    return editTrack(mCurrentTrackID)->mStaticFragment->parseCompactSampleSizes(
+            this, type, offset, size);
+}
+
+status_t Parser::parseSampleToChunk(
+        uint32_t type, size_t offset, uint64_t size) {
+    return editTrack(mCurrentTrackID)->mStaticFragment->parseSampleToChunk(
+            this, type, offset, size);
+}
+
+status_t Parser::parseChunkOffsets(
+        uint32_t type, size_t offset, uint64_t size) {
+    return editTrack(mCurrentTrackID)->mStaticFragment->parseChunkOffsets(
+            this, type, offset, size);
+}
+
+status_t Parser::parseChunkOffsets64(
+        uint32_t type, size_t offset, uint64_t size) {
+    return editTrack(mCurrentTrackID)->mStaticFragment->parseChunkOffsets64(
+            this, type, offset, size);
+}
+
+status_t Parser::parseAVCCodecSpecificData(
+        uint32_t type, size_t offset, uint64_t size) {
+    TrackInfo *trackInfo = editTrack(mCurrentTrackID);
+
+    SampleDescription *sampleDesc =
+        &trackInfo->mSampleDescs.editItemAt(
+                trackInfo->mSampleDescs.size() - 1);
+
+    if (sampleDesc->mType != FOURCC('a', 'v', 'c', '1')) {
+        return -EINVAL;
+    }
+
+    const uint8_t *ptr = mBuffer->data() + offset;
+
+    size -= offset;
+    offset = 0;
+
+    if (size < 7 || ptr[0] != 0x01) {
+        return ERROR_MALFORMED;
+    }
+
+    sampleDesc->mFormat->setSize("nal-length-size", 1 + (ptr[4] & 3));
+
+    size_t numSPS = ptr[5] & 31;
+
+    ptr += 6;
+    size -= 6;
+
+    for (size_t i = 0; i < numSPS; ++i) {
+        if (size < 2) {
+            return ERROR_MALFORMED;
+        }
+
+        size_t length = U16_AT(ptr);
+
+        ptr += 2;
+        size -= 2;
+
+        if (size < length) {
+            return ERROR_MALFORMED;
+        }
+
+        addCodecSpecificData(
+                sampleDesc->mFormat, i, ptr, length,
+                true /* insertStartCode */);
+
+        ptr += length;
+        size -= length;
+    }
+
+    if (size < 1) {
+        return ERROR_MALFORMED;
+    }
+
+    size_t numPPS = *ptr;
+    ++ptr;
+    --size;
+
+    for (size_t i = 0; i < numPPS; ++i) {
+        if (size < 2) {
+            return ERROR_MALFORMED;
+        }
+
+        size_t length = U16_AT(ptr);
+
+        ptr += 2;
+        size -= 2;
+
+        if (size < length) {
+            return ERROR_MALFORMED;
+        }
+
+        addCodecSpecificData(
+                sampleDesc->mFormat, numSPS + i, ptr, length,
+                true /* insertStartCode */);
+
+        ptr += length;
+        size -= length;
+    }
+
+    return OK;
+}
+
+status_t Parser::parseESDSCodecSpecificData(
+        uint32_t type, size_t offset, uint64_t size) {
+    TrackInfo *trackInfo = editTrack(mCurrentTrackID);
+
+    SampleDescription *sampleDesc =
+        &trackInfo->mSampleDescs.editItemAt(
+                trackInfo->mSampleDescs.size() - 1);
+
+    if (sampleDesc->mType != FOURCC('m', 'p', '4', 'a')
+            && sampleDesc->mType != FOURCC('m', 'p', '4', 'v')) {
+        return -EINVAL;
+    }
+
+    const uint8_t *ptr = mBuffer->data() + offset;
+
+    size -= offset;
+    offset = 0;
+
+    if (size < 4) {
+        return -EINVAL;
+    }
+
+    if (U32_AT(ptr) != 0) {
+        return -EINVAL;
+    }
+
+    ptr += 4;
+    size -=4;
+
+    ESDS esds(ptr, size);
+
+    uint8_t objectTypeIndication;
+    if (esds.getObjectTypeIndication(&objectTypeIndication) != OK) {
+        return ERROR_MALFORMED;
+    }
+
+    const uint8_t *csd;
+    size_t csd_size;
+    if (esds.getCodecSpecificInfo(
+                (const void **)&csd, &csd_size) != OK) {
+        return ERROR_MALFORMED;
+    }
+
+    addCodecSpecificData(sampleDesc->mFormat, 0, csd, csd_size);
+
+    if (sampleDesc->mType != FOURCC('m', 'p', '4', 'a')) {
+        return OK;
+    }
+
+    if (csd_size == 0) {
+        // There's no further information, i.e. no codec specific data
+        // Let's assume that the information provided in the mpeg4 headers
+        // is accurate and hope for the best.
+
+        return OK;
+    }
+
+    if (csd_size < 2) {
+        return ERROR_MALFORMED;
+    }
+
+    uint32_t objectType = csd[0] >> 3;
+
+    if (objectType == 31) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    uint32_t freqIndex = (csd[0] & 7) << 1 | (csd[1] >> 7);
+    int32_t sampleRate = 0;
+    int32_t numChannels = 0;
+    if (freqIndex == 15) {
+        if (csd_size < 5) {
+            return ERROR_MALFORMED;
+        }
+
+        sampleRate = (csd[1] & 0x7f) << 17
+                        | csd[2] << 9
+                        | csd[3] << 1
+                        | (csd[4] >> 7);
+
+        numChannels = (csd[4] >> 3) & 15;
+    } else {
+        static uint32_t kSamplingRate[] = {
+            96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
+            16000, 12000, 11025, 8000, 7350
+        };
+
+        if (freqIndex == 13 || freqIndex == 14) {
+            return ERROR_MALFORMED;
+        }
+
+        sampleRate = kSamplingRate[freqIndex];
+        numChannels = (csd[1] >> 3) & 15;
+    }
+
+    if (numChannels == 0) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    sampleDesc->mFormat->setInt32("sample-rate", sampleRate);
+    sampleDesc->mFormat->setInt32("channel-count", numChannels);
+
+    return OK;
+}
+
+status_t Parser::parseMediaData(
+        uint32_t type, size_t offset, uint64_t size) {
+    ALOGV("skipping 'mdat' chunk at offsets 0x%08lx-0x%08llx.",
+          mBufferPos + offset, mBufferPos + size);
+
+    sp<ABuffer> buffer = new ABuffer(size - offset);
+    memcpy(buffer->data(), mBuffer->data() + offset, size - offset);
+
+    mMediaData.push();
+    MediaDataInfo *info = &mMediaData.editItemAt(mMediaData.size() - 1);
+    info->mBuffer = buffer;
+    info->mOffset = mBufferPos + offset;
+
+    if (mMediaData.size() > 10) {
+        ALOGI("suspending for now.");
+        mSuspended = true;
+    }
+
+    return OK;
+}
+
+status_t Parser::parseTrackExtends(
+        uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 24 > size) {
+        return -EINVAL;
+    }
+
+    if (readU32(offset) != 0) {
+        return -EINVAL;
+    }
+
+    uint32_t trackID = readU32(offset + 4);
+
+    TrackInfo *info = editTrack(trackID, true /* createIfNecessary */);
+    info->mDefaultSampleDescriptionIndex = readU32(offset + 8);
+    info->mDefaultSampleDuration = readU32(offset + 12);
+    info->mDefaultSampleSize = readU32(offset + 16);
+    info->mDefaultSampleFlags = readU32(offset + 20);
+
+    return OK;
+}
+
+Parser::TrackInfo *Parser::editTrack(
+        uint32_t trackID, bool createIfNecessary) {
+    ssize_t i = mTracks.indexOfKey(trackID);
+
+    if (i >= 0) {
+        return &mTracks.editValueAt(i);
+    }
+
+    if (!createIfNecessary) {
+        return NULL;
+    }
+
+    TrackInfo info;
+    info.mTrackID = trackID;
+    info.mFlags = 0;
+    info.mDuration = 0xffffffff;
+    info.mMediaTimeScale = 0;
+    info.mMediaHandlerType = 0;
+    info.mDefaultSampleDescriptionIndex = 0;
+    info.mDefaultSampleDuration = 0;
+    info.mDefaultSampleSize = 0;
+    info.mDefaultSampleFlags = 0;
+
+    info.mDecodingTime = 0;
+
+    mTracks.add(trackID, info);
+    return &mTracks.editValueAt(mTracks.indexOfKey(trackID));
+}
+
+status_t Parser::parseTrackFragmentHeader(
+        uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 8 > size) {
+        return -EINVAL;
+    }
+
+    uint32_t flags = readU32(offset);
+
+    if (flags & 0xff000000) {
+        return -EINVAL;
+    }
+
+    mTrackFragmentHeaderInfo.mFlags = flags;
+
+    mTrackFragmentHeaderInfo.mTrackID = readU32(offset + 4);
+    offset += 8;
+
+    if (flags & TrackFragmentHeaderInfo::kBaseDataOffsetPresent) {
+        if (offset + 8 > size) {
+            return -EINVAL;
+        }
+
+        mTrackFragmentHeaderInfo.mBaseDataOffset = readU64(offset);
+        offset += 8;
+    }
+
+    if (flags & TrackFragmentHeaderInfo::kSampleDescriptionIndexPresent) {
+        if (offset + 4 > size) {
+            return -EINVAL;
+        }
+
+        mTrackFragmentHeaderInfo.mSampleDescriptionIndex = readU32(offset);
+        offset += 4;
+    }
+
+    if (flags & TrackFragmentHeaderInfo::kDefaultSampleDurationPresent) {
+        if (offset + 4 > size) {
+            return -EINVAL;
+        }
+
+        mTrackFragmentHeaderInfo.mDefaultSampleDuration = readU32(offset);
+        offset += 4;
+    }
+
+    if (flags & TrackFragmentHeaderInfo::kDefaultSampleSizePresent) {
+        if (offset + 4 > size) {
+            return -EINVAL;
+        }
+
+        mTrackFragmentHeaderInfo.mDefaultSampleSize = readU32(offset);
+        offset += 4;
+    }
+
+    if (flags & TrackFragmentHeaderInfo::kDefaultSampleFlagsPresent) {
+        if (offset + 4 > size) {
+            return -EINVAL;
+        }
+
+        mTrackFragmentHeaderInfo.mDefaultSampleFlags = readU32(offset);
+        offset += 4;
+    }
+
+    if (!(flags & TrackFragmentHeaderInfo::kBaseDataOffsetPresent)) {
+        // This should point to the position of the first byte of the
+        // enclosing 'moof' container for the first track and
+        // the end of the data of the preceding fragment for subsequent
+        // tracks.
+
+        CHECK_GE(mStack.size(), 2u);
+
+        mTrackFragmentHeaderInfo.mBaseDataOffset =
+            mStack.itemAt(mStack.size() - 2).mOffset;
+
+        // XXX TODO: This does not do the right thing for the 2nd and
+        // subsequent tracks yet.
+    }
+
+    mTrackFragmentHeaderInfo.mDataOffset =
+        mTrackFragmentHeaderInfo.mBaseDataOffset;
+
+    TrackInfo *trackInfo = editTrack(mTrackFragmentHeaderInfo.mTrackID);
+
+    if (trackInfo->mFragments.empty()
+            || (*trackInfo->mFragments.begin())->complete()) {
+        trackInfo->mFragments.push_back(new DynamicTrackFragment);
+    }
+
+    return OK;
+}
+
+status_t Parser::parseTrackFragmentRun(
+        uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 8 > size) {
+        return -EINVAL;
+    }
+
+    enum {
+        kDataOffsetPresent                  = 0x01,
+        kFirstSampleFlagsPresent            = 0x04,
+        kSampleDurationPresent              = 0x100,
+        kSampleSizePresent                  = 0x200,
+        kSampleFlagsPresent                 = 0x400,
+        kSampleCompositionTimeOffsetPresent = 0x800,
+    };
+
+    uint32_t flags = readU32(offset);
+
+    if (flags & 0xff000000) {
+        return -EINVAL;
+    }
+
+    if ((flags & kFirstSampleFlagsPresent) && (flags & kSampleFlagsPresent)) {
+        // These two shall not be used together.
+        return -EINVAL;
+    }
+
+    uint32_t sampleCount = readU32(offset + 4);
+    offset += 8;
+
+    uint64_t dataOffset = mTrackFragmentHeaderInfo.mDataOffset;
+
+    uint32_t firstSampleFlags = 0;
+
+    if (flags & kDataOffsetPresent) {
+        if (offset + 4 > size) {
+            return -EINVAL;
+        }
+
+        int32_t dataOffsetDelta = (int32_t)readU32(offset);
+
+        dataOffset = mTrackFragmentHeaderInfo.mBaseDataOffset + dataOffsetDelta;
+
+        offset += 4;
+    }
+
+    if (flags & kFirstSampleFlagsPresent) {
+        if (offset + 4 > size) {
+            return -EINVAL;
+        }
+
+        firstSampleFlags = readU32(offset);
+        offset += 4;
+    }
+
+    TrackInfo *info = editTrack(mTrackFragmentHeaderInfo.mTrackID);
+
+    if (info == NULL) {
+        return -EINVAL;
+    }
+
+    uint32_t sampleDuration = 0, sampleSize = 0, sampleFlags = 0,
+             sampleCtsOffset = 0;
+
+    size_t bytesPerSample = 0;
+    if (flags & kSampleDurationPresent) {
+        bytesPerSample += 4;
+    } else if (mTrackFragmentHeaderInfo.mFlags
+            & TrackFragmentHeaderInfo::kDefaultSampleDurationPresent) {
+        sampleDuration = mTrackFragmentHeaderInfo.mDefaultSampleDuration;
+    } else {
+        sampleDuration = info->mDefaultSampleDuration;
+    }
+
+    if (flags & kSampleSizePresent) {
+        bytesPerSample += 4;
+    } else if (mTrackFragmentHeaderInfo.mFlags
+            & TrackFragmentHeaderInfo::kDefaultSampleSizePresent) {
+        sampleSize = mTrackFragmentHeaderInfo.mDefaultSampleSize;
+    } else {
+        sampleSize = info->mDefaultSampleSize;
+    }
+
+    if (flags & kSampleFlagsPresent) {
+        bytesPerSample += 4;
+    } else if (mTrackFragmentHeaderInfo.mFlags
+            & TrackFragmentHeaderInfo::kDefaultSampleFlagsPresent) {
+        sampleFlags = mTrackFragmentHeaderInfo.mDefaultSampleFlags;
+    } else {
+        sampleFlags = info->mDefaultSampleFlags;
+    }
+
+    if (flags & kSampleCompositionTimeOffsetPresent) {
+        bytesPerSample += 4;
+    } else {
+        sampleCtsOffset = 0;
+    }
+
+    if (offset + sampleCount * bytesPerSample > size) {
+        return -EINVAL;
+    }
+
+    uint32_t sampleDescIndex =
+        (mTrackFragmentHeaderInfo.mFlags
+            & TrackFragmentHeaderInfo::kSampleDescriptionIndexPresent)
+            ? mTrackFragmentHeaderInfo.mSampleDescriptionIndex
+            : info->mDefaultSampleDescriptionIndex;
+
+    for (uint32_t i = 0; i < sampleCount; ++i) {
+        if (flags & kSampleDurationPresent) {
+            sampleDuration = readU32(offset);
+            offset += 4;
+        }
+
+        if (flags & kSampleSizePresent) {
+            sampleSize = readU32(offset);
+            offset += 4;
+        }
+
+        if (flags & kSampleFlagsPresent) {
+            sampleFlags = readU32(offset);
+            offset += 4;
+        }
+
+        if (flags & kSampleCompositionTimeOffsetPresent) {
+            sampleCtsOffset = readU32(offset);
+            offset += 4;
+        }
+
+        ALOGV("adding sample at offset 0x%08llx, size %u, duration %u, "
+              "sampleDescIndex=%u, flags 0x%08x",
+                dataOffset, sampleSize, sampleDuration,
+                sampleDescIndex,
+                (flags & kFirstSampleFlagsPresent) && i == 0
+                    ? firstSampleFlags : sampleFlags);
+
+        const sp<TrackFragment> &fragment = *--info->mFragments.end();
+
+        uint32_t decodingTime = info->mDecodingTime;
+        info->mDecodingTime += sampleDuration;
+        uint32_t presentationTime = decodingTime + sampleCtsOffset;
+
+        static_cast<DynamicTrackFragment *>(
+                fragment.get())->addSample(
+                    dataOffset,
+                    sampleSize,
+                    presentationTime,
+                    sampleDescIndex,
+                    ((flags & kFirstSampleFlagsPresent) && i == 0)
+                        ? firstSampleFlags : sampleFlags);
+
+        dataOffset += sampleSize;
+    }
+
+    mTrackFragmentHeaderInfo.mDataOffset = dataOffset;
+
+    return OK;
+}
+
+void Parser::copyBuffer(
+        sp<ABuffer> *dst, size_t offset, uint64_t size, size_t extra) const {
+    sp<ABuffer> buf = new ABuffer(size + extra);
+    memcpy(buf->data(), mBuffer->data() + offset, size);
+
+    *dst = buf;
+}
+
+}  // namespace android
diff --git a/media/libmediaplayerservice/nuplayer/mp4/Parser.h b/media/libmediaplayerservice/nuplayer/mp4/Parser.h
new file mode 100644
index 0000000..0d8d0f5
--- /dev/null
+++ b/media/libmediaplayerservice/nuplayer/mp4/Parser.h
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef PARSER_H_
+
+#define PARSER_H_
+
+#include <media/stagefright/foundation/AHandler.h>
+#include <utils/Vector.h>
+
+namespace android {
+
+struct ABuffer;
+
+struct Parser : public AHandler {
+    struct Source : public RefBase {
+        Source() {}
+
+        virtual ssize_t readAt(off64_t offset, void *data, size_t size) = 0;
+
+        protected:
+        virtual ~Source() {}
+
+        private:
+        DISALLOW_EVIL_CONSTRUCTORS(Source);
+    };
+
+    Parser();
+
+    void start(const char *filename);
+    void start(const sp<Source> &source);
+
+    sp<AMessage> getFormat(bool audio);
+    status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit);
+
+    virtual void onMessageReceived(const sp<AMessage> &msg);
+
+protected:
+    virtual ~Parser();
+
+private:
+    enum {
+        kWhatStart,
+        kWhatProceed,
+        kWhatReadMore,
+        kWhatGetFormat,
+        kWhatDequeueAccessUnit,
+    };
+
+    struct TrackFragment;
+    struct DynamicTrackFragment;
+    struct StaticTrackFragment;
+
+    struct DispatchEntry {
+        uint32_t mType;
+        uint32_t mParentType;
+        status_t (Parser::*mHandler)(uint32_t, size_t, uint64_t);
+    };
+
+    struct Container {
+        uint64_t mOffset;
+        uint64_t mBytesRemaining;
+        uint32_t mType;
+        bool mExtendsToEOF;
+    };
+
+    struct SampleDescription {
+        uint32_t mType;
+        uint16_t mDataRefIndex;
+
+        sp<AMessage> mFormat;
+    };
+
+    struct SampleInfo {
+        off64_t mOffset;
+        size_t mSize;
+        uint32_t mPresentationTime;
+        size_t mSampleDescIndex;
+        uint32_t mFlags;
+    };
+
+    struct MediaDataInfo {
+        sp<ABuffer> mBuffer;
+        off64_t mOffset;
+    };
+
+    struct TrackInfo {
+        enum Flags {
+            kTrackEnabled     = 0x01,
+            kTrackInMovie     = 0x02,
+            kTrackInPreview   = 0x04,
+        };
+
+        uint32_t mTrackID;
+        uint32_t mFlags;
+        uint32_t mDuration;  // This is the duration in terms of movie timescale!
+
+        uint32_t mMediaTimeScale;
+
+        uint32_t mMediaHandlerType;
+        Vector<SampleDescription> mSampleDescs;
+
+        // from track extends:
+        uint32_t mDefaultSampleDescriptionIndex;
+        uint32_t mDefaultSampleDuration;
+        uint32_t mDefaultSampleSize;
+        uint32_t mDefaultSampleFlags;
+
+        uint32_t mDecodingTime;
+
+        sp<StaticTrackFragment> mStaticFragment;
+        List<sp<TrackFragment> > mFragments;
+    };
+
+    struct TrackFragmentHeaderInfo {
+        enum Flags {
+            kBaseDataOffsetPresent         = 0x01,
+            kSampleDescriptionIndexPresent = 0x02,
+            kDefaultSampleDurationPresent  = 0x08,
+            kDefaultSampleSizePresent      = 0x10,
+            kDefaultSampleFlagsPresent     = 0x20,
+            kDurationIsEmpty               = 0x10000,
+        };
+
+        uint32_t mTrackID;
+        uint32_t mFlags;
+        uint64_t mBaseDataOffset;
+        uint32_t mSampleDescriptionIndex;
+        uint32_t mDefaultSampleDuration;
+        uint32_t mDefaultSampleSize;
+        uint32_t mDefaultSampleFlags;
+
+        uint64_t mDataOffset;
+    };
+
+    static const DispatchEntry kDispatchTable[];
+
+    sp<Source> mSource;
+    off_t mBufferPos;
+    bool mSuspended;
+    sp<ABuffer> mBuffer;
+    Vector<Container> mStack;
+    KeyedVector<uint32_t, TrackInfo> mTracks;  // TrackInfo by trackID
+    Vector<MediaDataInfo> mMediaData;
+
+    uint32_t mCurrentTrackID;
+
+    status_t mFinalResult;
+
+    TrackFragmentHeaderInfo mTrackFragmentHeaderInfo;
+
+    status_t onProceed();
+    status_t onDequeueAccessUnit(size_t trackIndex, sp<ABuffer> *accessUnit);
+
+    void enter(off64_t offset, uint32_t type, uint64_t size);
+
+    uint16_t readU16(size_t offset);
+    uint32_t readU32(size_t offset);
+    uint64_t readU64(size_t offset);
+    void skip(off_t distance);
+    status_t need(size_t size);
+    bool fitsContainer(uint64_t size) const;
+
+    status_t parseTrackHeader(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseMediaHeader(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseMediaHandler(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseTrackExtends(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseTrackFragmentHeader(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseTrackFragmentRun(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseVisualSampleEntry(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseAudioSampleEntry(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseSampleSizes(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseCompactSampleSizes(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseSampleToChunk(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseChunkOffsets(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseChunkOffsets64(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseAVCCodecSpecificData(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseESDSCodecSpecificData(
+            uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseMediaData(
+            uint32_t type, size_t offset, uint64_t size);
+
+    TrackInfo *editTrack(uint32_t trackID, bool createIfNecessary = false);
+
+    ssize_t findTrack(bool wantAudio) const;
+
+    status_t makeAccessUnit(
+            TrackInfo *info,
+            const SampleInfo &sample,
+            const MediaDataInfo &mdatInfo,
+            sp<ABuffer> *accessUnit);
+
+    status_t getSample(
+            TrackInfo *info,
+            sp<TrackFragment> *fragment,
+            SampleInfo *sampleInfo);
+
+    static int CompareSampleLocation(
+        const SampleInfo &sample, const MediaDataInfo &mdatInfo);
+
+    void resumeIfNecessary();
+
+    void copyBuffer(
+            sp<ABuffer> *dst,
+            size_t offset, uint64_t size, size_t extra = 0) const;
+
+    DISALLOW_EVIL_CONSTRUCTORS(Parser);
+};
+
+}  // namespace android
+
+#endif  // PARSER_H_
+
diff --git a/media/libmediaplayerservice/nuplayer/mp4/TrackFragment.cpp b/media/libmediaplayerservice/nuplayer/mp4/TrackFragment.cpp
new file mode 100644
index 0000000..a4c31ea
--- /dev/null
+++ b/media/libmediaplayerservice/nuplayer/mp4/TrackFragment.cpp
@@ -0,0 +1,364 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "TrackFragment"
+#include <utils/Log.h>
+
+#include "TrackFragment.h"
+
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/Utils.h>
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/hexdump.h>
+
+namespace android {
+
+Parser::DynamicTrackFragment::DynamicTrackFragment()
+    : mComplete(false),
+      mSampleIndex(0) {
+}
+
+Parser::DynamicTrackFragment::~DynamicTrackFragment() {
+}
+
+status_t Parser::DynamicTrackFragment::getSample(SampleInfo *info) {
+    if (mSampleIndex >= mSamples.size()) {
+        return mComplete ? ERROR_END_OF_STREAM : -EWOULDBLOCK;
+    }
+
+    *info = mSamples.itemAt(mSampleIndex);
+
+    return OK;
+}
+
+void Parser::DynamicTrackFragment::advance() {
+    ++mSampleIndex;
+}
+
+void Parser::DynamicTrackFragment::addSample(
+        off64_t dataOffset, size_t sampleSize,
+        uint32_t presentationTime,
+        size_t sampleDescIndex,
+        uint32_t flags) {
+    mSamples.push();
+    SampleInfo *sampleInfo = &mSamples.editItemAt(mSamples.size() - 1);
+
+    sampleInfo->mOffset = dataOffset;
+    sampleInfo->mSize = sampleSize;
+    sampleInfo->mPresentationTime = presentationTime;
+    sampleInfo->mSampleDescIndex = sampleDescIndex;
+    sampleInfo->mFlags = flags;
+}
+
+status_t Parser::DynamicTrackFragment::signalCompletion() {
+    mComplete = true;
+
+    return OK;
+}
+
+bool Parser::DynamicTrackFragment::complete() const {
+    return mComplete;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+Parser::StaticTrackFragment::StaticTrackFragment()
+    : mSampleIndex(0),
+      mSampleCount(0),
+      mChunkIndex(0),
+      mSampleToChunkIndex(-1),
+      mSampleToChunkRemaining(0),
+      mPrevChunkIndex(0xffffffff),
+      mNextSampleOffset(0) {
+}
+
+Parser::StaticTrackFragment::~StaticTrackFragment() {
+}
+
+status_t Parser::StaticTrackFragment::getSample(SampleInfo *info) {
+    if (mSampleIndex >= mSampleCount) {
+        return ERROR_END_OF_STREAM;
+    }
+
+    *info = mSampleInfo;
+
+    ALOGV("returning sample %d at [0x%08llx, 0x%08llx)",
+          mSampleIndex,
+          info->mOffset, info->mOffset + info->mSize);
+
+    return OK;
+}
+
+void Parser::StaticTrackFragment::updateSampleInfo() {
+    if (mSampleIndex >= mSampleCount) {
+        return;
+    }
+
+    if (mSampleSizes != NULL) {
+        uint32_t defaultSampleSize = U32_AT(mSampleSizes->data() + 4);
+        if (defaultSampleSize > 0) {
+            mSampleInfo.mSize = defaultSampleSize;
+        } else {
+            mSampleInfo.mSize= U32_AT(mSampleSizes->data() + 12 + 4 * mSampleIndex);
+        }
+    } else {
+        CHECK(mCompactSampleSizes != NULL);
+
+        uint32_t fieldSize = U32_AT(mCompactSampleSizes->data() + 4);
+
+        switch (fieldSize) {
+            case 4:
+            {
+                unsigned byte = mCompactSampleSizes->data()[12 + mSampleIndex / 2];
+                mSampleInfo.mSize = (mSampleIndex & 1) ? byte & 0x0f : byte >> 4;
+                break;
+            }
+
+            case 8:
+            {
+                mSampleInfo.mSize = mCompactSampleSizes->data()[12 + mSampleIndex];
+                break;
+            }
+
+            default:
+            {
+                CHECK_EQ(fieldSize, 16);
+                mSampleInfo.mSize =
+                    U16_AT(mCompactSampleSizes->data() + 12 + mSampleIndex * 2);
+                break;
+            }
+        }
+    }
+
+    CHECK_GT(mSampleToChunkRemaining, 0);
+
+    // The sample desc index is 1-based... XXX
+    mSampleInfo.mSampleDescIndex =
+        U32_AT(mSampleToChunk->data() + 8 + 12 * mSampleToChunkIndex + 8);
+
+    if (mChunkIndex != mPrevChunkIndex) {
+        mPrevChunkIndex = mChunkIndex;
+
+        if (mChunkOffsets != NULL) {
+            uint32_t entryCount = U32_AT(mChunkOffsets->data() + 4);
+
+            if (mChunkIndex >= entryCount) {
+                mSampleIndex = mSampleCount;
+                return;
+            }
+
+            mNextSampleOffset =
+                U32_AT(mChunkOffsets->data() + 8 + 4 * mChunkIndex);
+        } else {
+            CHECK(mChunkOffsets64 != NULL);
+
+            uint32_t entryCount = U32_AT(mChunkOffsets64->data() + 4);
+
+            if (mChunkIndex >= entryCount) {
+                mSampleIndex = mSampleCount;
+                return;
+            }
+
+            mNextSampleOffset =
+                U64_AT(mChunkOffsets64->data() + 8 + 8 * mChunkIndex);
+        }
+    }
+
+    mSampleInfo.mOffset = mNextSampleOffset;
+
+    mSampleInfo.mPresentationTime = 0;
+    mSampleInfo.mFlags = 0;
+}
+
+void Parser::StaticTrackFragment::advance() {
+    mNextSampleOffset += mSampleInfo.mSize;
+
+    ++mSampleIndex;
+    if (--mSampleToChunkRemaining == 0) {
+        ++mChunkIndex;
+
+        uint32_t entryCount = U32_AT(mSampleToChunk->data() + 4);
+
+        // If this is the last entry in the sample to chunk table, we will
+        // stay on this entry.
+        if ((uint32_t)(mSampleToChunkIndex + 1) < entryCount) {
+            uint32_t nextChunkIndex =
+                U32_AT(mSampleToChunk->data() + 8 + 12 * (mSampleToChunkIndex + 1));
+
+            CHECK_GE(nextChunkIndex, 1u);
+            --nextChunkIndex;
+
+            if (mChunkIndex >= nextChunkIndex) {
+                CHECK_EQ(mChunkIndex, nextChunkIndex);
+                ++mSampleToChunkIndex;
+            }
+        }
+
+        mSampleToChunkRemaining =
+            U32_AT(mSampleToChunk->data() + 8 + 12 * mSampleToChunkIndex + 4);
+    }
+
+    updateSampleInfo();
+}
+
+static void setU32At(uint8_t *ptr, uint32_t x) {
+    ptr[0] = x >> 24;
+    ptr[1] = (x >> 16) & 0xff;
+    ptr[2] = (x >> 8) & 0xff;
+    ptr[3] = x & 0xff;
+}
+
+status_t Parser::StaticTrackFragment::signalCompletion() {
+    mSampleToChunkIndex = 0;
+
+    mSampleToChunkRemaining =
+        (mSampleToChunk == NULL)
+            ? 0
+            : U32_AT(mSampleToChunk->data() + 8 + 12 * mSampleToChunkIndex + 4);
+
+    updateSampleInfo();
+
+    return OK;
+}
+
+bool Parser::StaticTrackFragment::complete() const {
+    return true;
+}
+
+status_t Parser::StaticTrackFragment::parseSampleSizes(
+        Parser *parser, uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 12 > size) {
+        return ERROR_MALFORMED;
+    }
+
+    if (parser->readU32(offset) != 0) {
+        return ERROR_MALFORMED;
+    }
+
+    uint32_t sampleSize = parser->readU32(offset + 4);
+    uint32_t sampleCount = parser->readU32(offset + 8);
+
+    if (sampleSize == 0 && offset + 12 + sampleCount * 4 != size) {
+        return ERROR_MALFORMED;
+    }
+
+    parser->copyBuffer(&mSampleSizes, offset, size);
+
+    mSampleCount = sampleCount;
+
+    return OK;
+}
+
+status_t Parser::StaticTrackFragment::parseCompactSampleSizes(
+        Parser *parser, uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 12 > size) {
+        return ERROR_MALFORMED;
+    }
+
+    if (parser->readU32(offset) != 0) {
+        return ERROR_MALFORMED;
+    }
+
+    uint32_t fieldSize = parser->readU32(offset + 4);
+
+    if (fieldSize != 4 && fieldSize != 8 && fieldSize != 16) {
+        return ERROR_MALFORMED;
+    }
+
+    uint32_t sampleCount = parser->readU32(offset + 8);
+
+    if (offset + 12 + (sampleCount * fieldSize + 4) / 8 != size) {
+        return ERROR_MALFORMED;
+    }
+
+    parser->copyBuffer(&mCompactSampleSizes, offset, size);
+
+    mSampleCount = sampleCount;
+
+    return OK;
+}
+
+status_t Parser::StaticTrackFragment::parseSampleToChunk(
+        Parser *parser, uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 8 > size) {
+        return ERROR_MALFORMED;
+    }
+
+    if (parser->readU32(offset) != 0) {
+        return ERROR_MALFORMED;
+    }
+
+    uint32_t entryCount = parser->readU32(offset + 4);
+
+    if (entryCount == 0) {
+        return OK;
+    }
+
+    if (offset + 8 + entryCount * 12 != size) {
+        return ERROR_MALFORMED;
+    }
+
+    parser->copyBuffer(&mSampleToChunk, offset, size);
+
+    return OK;
+}
+
+status_t Parser::StaticTrackFragment::parseChunkOffsets(
+        Parser *parser, uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 8 > size) {
+        return ERROR_MALFORMED;
+    }
+
+    if (parser->readU32(offset) != 0) {
+        return ERROR_MALFORMED;
+    }
+
+    uint32_t entryCount = parser->readU32(offset + 4);
+
+    if (offset + 8 + entryCount * 4 != size) {
+        return ERROR_MALFORMED;
+    }
+
+    parser->copyBuffer(&mChunkOffsets, offset, size);
+
+    return OK;
+}
+
+status_t Parser::StaticTrackFragment::parseChunkOffsets64(
+        Parser *parser, uint32_t type, size_t offset, uint64_t size) {
+    if (offset + 8 > size) {
+        return ERROR_MALFORMED;
+    }
+
+    if (parser->readU32(offset) != 0) {
+        return ERROR_MALFORMED;
+    }
+
+    uint32_t entryCount = parser->readU32(offset + 4);
+
+    if (offset + 8 + entryCount * 8 != size) {
+        return ERROR_MALFORMED;
+    }
+
+    parser->copyBuffer(&mChunkOffsets64, offset, size);
+
+    return OK;
+}
+
+}  // namespace android
+
diff --git a/media/libmediaplayerservice/nuplayer/mp4/TrackFragment.h b/media/libmediaplayerservice/nuplayer/mp4/TrackFragment.h
new file mode 100644
index 0000000..1498aad
--- /dev/null
+++ b/media/libmediaplayerservice/nuplayer/mp4/TrackFragment.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TRACK_FRAGMENT_H_
+
+#define TRACK_FRAGMENT_H_
+
+#include "Parser.h"
+
+namespace android {
+
+struct Parser::TrackFragment : public RefBase {
+    TrackFragment() {}
+
+    virtual status_t getSample(SampleInfo *info) = 0;
+    virtual void advance() = 0;
+
+    virtual status_t signalCompletion() = 0;
+    virtual bool complete() const = 0;
+
+protected:
+    virtual ~TrackFragment() {}
+
+private:
+    DISALLOW_EVIL_CONSTRUCTORS(TrackFragment);
+};
+
+struct Parser::DynamicTrackFragment : public Parser::TrackFragment {
+    DynamicTrackFragment();
+
+    virtual status_t getSample(SampleInfo *info);
+    virtual void advance();
+
+    void addSample(
+            off64_t dataOffset, size_t sampleSize,
+            uint32_t presentationTime,
+            size_t sampleDescIndex,
+            uint32_t flags);
+
+    // No more samples will be added to this fragment.
+    virtual status_t signalCompletion();
+
+    virtual bool complete() const;
+
+protected:
+    virtual ~DynamicTrackFragment();
+
+private:
+    bool mComplete;
+    size_t mSampleIndex;
+    Vector<SampleInfo> mSamples;
+
+    DISALLOW_EVIL_CONSTRUCTORS(DynamicTrackFragment);
+};
+
+struct Parser::StaticTrackFragment : public Parser::TrackFragment {
+    StaticTrackFragment();
+
+    virtual status_t getSample(SampleInfo *info);
+    virtual void advance();
+
+    virtual status_t signalCompletion();
+    virtual bool complete() const;
+
+    status_t parseSampleSizes(
+            Parser *parser, uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseCompactSampleSizes(
+            Parser *parser, uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseSampleToChunk(
+            Parser *parser, uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseChunkOffsets(
+            Parser *parser, uint32_t type, size_t offset, uint64_t size);
+
+    status_t parseChunkOffsets64(
+            Parser *parser, uint32_t type, size_t offset, uint64_t size);
+
+protected:
+    virtual ~StaticTrackFragment();
+
+private:
+    size_t mSampleIndex;
+    size_t mSampleCount;
+    uint32_t mChunkIndex;
+
+    SampleInfo mSampleInfo;
+
+    sp<ABuffer> mSampleSizes;
+    sp<ABuffer> mCompactSampleSizes;
+
+    sp<ABuffer> mSampleToChunk;
+    ssize_t mSampleToChunkIndex;
+    size_t mSampleToChunkRemaining;
+
+    sp<ABuffer> mChunkOffsets;
+    sp<ABuffer> mChunkOffsets64;
+    uint32_t mPrevChunkIndex;
+    uint64_t mNextSampleOffset;
+
+    void updateSampleInfo();
+
+    DISALLOW_EVIL_CONSTRUCTORS(StaticTrackFragment);
+};
+
+}  // namespace android
+
+#endif  // TRACK_FRAGMENT_H_
diff --git a/media/libnbaio/Android.mk b/media/libnbaio/Android.mk
new file mode 100644
index 0000000..757272f
--- /dev/null
+++ b/media/libnbaio/Android.mk
@@ -0,0 +1,32 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+    AudioBufferProviderSource.cpp   \
+    AudioStreamOutSink.cpp          \
+    AudioStreamInSource.cpp         \
+    NBAIO.cpp                       \
+    MonoPipe.cpp                    \
+    MonoPipeReader.cpp              \
+    Pipe.cpp                        \
+    PipeReader.cpp                  \
+    roundup.c                       \
+    SourceAudioBufferProvider.cpp
+
+# libsndfile license is incompatible; uncomment to use for local debug only
+#LOCAL_SRC_FILES += LibsndfileSink.cpp LibsndfileSource.cpp
+#LOCAL_C_INCLUDES += path/to/libsndfile/src
+#LOCAL_STATIC_LIBRARIES += libsndfile
+
+# uncomment for systrace
+# LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_AUDIO
+
+LOCAL_MODULE := libnbaio
+
+LOCAL_SHARED_LIBRARIES := \
+    libcommon_time_client \
+    libcutils \
+    libutils
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/services/audioflinger/AudioBufferProviderSource.cpp b/media/libnbaio/AudioBufferProviderSource.cpp
similarity index 89%
rename from services/audioflinger/AudioBufferProviderSource.cpp
rename to media/libnbaio/AudioBufferProviderSource.cpp
index 4342171..74a6fdb 100644
--- a/services/audioflinger/AudioBufferProviderSource.cpp
+++ b/media/libnbaio/AudioBufferProviderSource.cpp
@@ -19,7 +19,7 @@
 
 #include <cutils/compiler.h>
 #include <utils/Log.h>
-#include "AudioBufferProviderSource.h"
+#include <media/nbaio/AudioBufferProviderSource.h>
 
 namespace android {
 
@@ -46,14 +46,16 @@
     return mBuffer.raw != NULL ? mBuffer.frameCount - mConsumed : 0;
 }
 
-ssize_t AudioBufferProviderSource::read(void *buffer, size_t count)
+ssize_t AudioBufferProviderSource::read(void *buffer,
+                                        size_t count,
+                                        int64_t readPTS)
 {
     if (CC_UNLIKELY(!mNegotiated)) {
         return NEGOTIATE;
     }
     if (CC_UNLIKELY(mBuffer.raw == NULL)) {
         mBuffer.frameCount = count;
-        status_t status = mProvider->getNextBuffer(&mBuffer, AudioBufferProvider::kInvalidPTS);
+        status_t status = mProvider->getNextBuffer(&mBuffer, readPTS);
         if (status != OK) {
             return status == NOT_ENOUGH_DATA ? (ssize_t) WOULD_BLOCK : (ssize_t) status;
         }
@@ -79,7 +81,8 @@
     return count;
 }
 
-ssize_t AudioBufferProviderSource::readVia(readVia_t via, size_t total, void *user, size_t block)
+ssize_t AudioBufferProviderSource::readVia(readVia_t via, size_t total, void *user,
+                                           int64_t readPTS, size_t block)
 {
     if (CC_UNLIKELY(!mNegotiated)) {
         return NEGOTIATE;
@@ -99,7 +102,7 @@
         // 1 <= count <= block
         if (CC_UNLIKELY(mBuffer.raw == NULL)) {
             mBuffer.frameCount = count;
-            status_t status = mProvider->getNextBuffer(&mBuffer, AudioBufferProvider::kInvalidPTS);
+            status_t status = mProvider->getNextBuffer(&mBuffer, readPTS);
             if (CC_LIKELY(status == OK)) {
                 ALOG_ASSERT(mBuffer.raw != NULL && mBuffer.frameCount <= count);
                 // mConsumed is 0 either from constructor or after releaseBuffer()
@@ -117,7 +120,8 @@
             count = available;
         }
         if (CC_LIKELY(count > 0)) {
-            ssize_t ret = via(user, (char *) mBuffer.raw + (mConsumed << mBitShift), count);
+            char* readTgt = (char *) mBuffer.raw + (mConsumed << mBitShift);
+            ssize_t ret = via(user, readTgt, count, readPTS);
             if (CC_UNLIKELY(ret <= 0)) {
                 if (CC_LIKELY(accumulator > 0)) {
                     return accumulator;
diff --git a/services/audioflinger/AudioStreamInSource.cpp b/media/libnbaio/AudioStreamInSource.cpp
similarity index 97%
rename from services/audioflinger/AudioStreamInSource.cpp
rename to media/libnbaio/AudioStreamInSource.cpp
index 8b4bebf..05273f6 100644
--- a/services/audioflinger/AudioStreamInSource.cpp
+++ b/media/libnbaio/AudioStreamInSource.cpp
@@ -19,7 +19,7 @@
 
 #include <cutils/compiler.h>
 #include <utils/Log.h>
-#include "AudioStreamInSource.h"
+#include <media/nbaio/AudioStreamInSource.h>
 
 namespace android {
 
diff --git a/services/audioflinger/AudioStreamOutSink.cpp b/media/libnbaio/AudioStreamOutSink.cpp
similarity index 86%
rename from services/audioflinger/AudioStreamOutSink.cpp
rename to media/libnbaio/AudioStreamOutSink.cpp
index 8a5aa0c..6f525e5 100644
--- a/services/audioflinger/AudioStreamOutSink.cpp
+++ b/media/libnbaio/AudioStreamOutSink.cpp
@@ -18,7 +18,7 @@
 //#define LOG_NDEBUG 0
 
 #include <utils/Log.h>
-#include "AudioStreamOutSink.h"
+#include <media/nbaio/AudioStreamOutSink.h>
 
 namespace android {
 
@@ -67,4 +67,16 @@
     return ret;
 }
 
+status_t AudioStreamOutSink::getNextWriteTimestamp(int64_t *timestamp) {
+    ALOG_ASSERT(timestamp != NULL);
+
+    if (NULL == mStream)
+        return INVALID_OPERATION;
+
+    if (NULL == mStream->get_next_write_timestamp)
+        return INVALID_OPERATION;
+
+    return mStream->get_next_write_timestamp(mStream, timestamp);
+}
+
 }   // namespace android
diff --git a/services/audioflinger/LibsndfileSink.cpp b/media/libnbaio/LibsndfileSink.cpp
similarity index 96%
rename from services/audioflinger/LibsndfileSink.cpp
rename to media/libnbaio/LibsndfileSink.cpp
index efc1c8f..77debc0 100644
--- a/services/audioflinger/LibsndfileSink.cpp
+++ b/media/libnbaio/LibsndfileSink.cpp
@@ -19,7 +19,7 @@
 
 #include <utils/Errors.h>
 #include <utils/Log.h>
-#include "LibsndfileSink.h"
+#include <media/nbaio/LibsndfileSink.h>
 
 namespace android {
 
diff --git a/services/audioflinger/LibsndfileSource.cpp b/media/libnbaio/LibsndfileSource.cpp
similarity index 97%
rename from services/audioflinger/LibsndfileSource.cpp
rename to media/libnbaio/LibsndfileSource.cpp
index 28317d6..98610e0 100644
--- a/services/audioflinger/LibsndfileSource.cpp
+++ b/media/libnbaio/LibsndfileSource.cpp
@@ -19,7 +19,7 @@
 
 #include <utils/Errors.h>
 #include <utils/Log.h>
-#include "LibsndfileSource.h"
+#include <media/nbaio/LibsndfileSource.h>
 
 namespace android {
 
diff --git a/media/libnbaio/MonoPipe.cpp b/media/libnbaio/MonoPipe.cpp
new file mode 100644
index 0000000..c426efb
--- /dev/null
+++ b/media/libnbaio/MonoPipe.cpp
@@ -0,0 +1,299 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "MonoPipe"
+//#define LOG_NDEBUG 0
+
+#include <common_time/cc_helper.h>
+#include <cutils/atomic.h>
+#include <cutils/compiler.h>
+#include <utils/LinearTransform.h>
+#include <utils/Log.h>
+#include <utils/Trace.h>
+#include <media/AudioBufferProvider.h>
+#include <media/nbaio/MonoPipe.h>
+#include <media/nbaio/roundup.h>
+
+
+namespace android {
+
+MonoPipe::MonoPipe(size_t reqFrames, NBAIO_Format format, bool writeCanBlock) :
+        NBAIO_Sink(format),
+        mUpdateSeq(0),
+        mReqFrames(reqFrames),
+        mMaxFrames(roundup(reqFrames)),
+        mBuffer(malloc(mMaxFrames * Format_frameSize(format))),
+        mFront(0),
+        mRear(0),
+        mWriteTsValid(false),
+        // mWriteTs
+        mSetpoint((reqFrames * 11) / 16),
+        mWriteCanBlock(writeCanBlock)
+{
+    CCHelper tmpHelper;
+    status_t res;
+    uint64_t N, D;
+
+    mNextRdPTS = AudioBufferProvider::kInvalidPTS;
+
+    mSamplesToLocalTime.a_zero = 0;
+    mSamplesToLocalTime.b_zero = 0;
+    mSamplesToLocalTime.a_to_b_numer = 0;
+    mSamplesToLocalTime.a_to_b_denom = 0;
+
+    D = Format_sampleRate(format);
+    if (OK != (res = tmpHelper.getLocalFreq(&N))) {
+        ALOGE("Failed to fetch local time frequency when constructing a"
+              " MonoPipe (res = %d).  getNextWriteTimestamp calls will be"
+              " non-functional", res);
+        return;
+    }
+
+    LinearTransform::reduce(&N, &D);
+    static const uint64_t kSignedHiBitsMask   = ~(0x7FFFFFFFull);
+    static const uint64_t kUnsignedHiBitsMask = ~(0xFFFFFFFFull);
+    if ((N & kSignedHiBitsMask) || (D & kUnsignedHiBitsMask)) {
+        ALOGE("Cannot reduce sample rate to local clock frequency ratio to fit"
+              " in a 32/32 bit rational.  (max reduction is 0x%016llx/0x%016llx"
+              ").  getNextWriteTimestamp calls will be non-functional", N, D);
+        return;
+    }
+
+    mSamplesToLocalTime.a_to_b_numer = static_cast<int32_t>(N);
+    mSamplesToLocalTime.a_to_b_denom = static_cast<uint32_t>(D);
+}
+
+MonoPipe::~MonoPipe()
+{
+    free(mBuffer);
+}
+
+ssize_t MonoPipe::availableToWrite() const
+{
+    if (CC_UNLIKELY(!mNegotiated)) {
+        return NEGOTIATE;
+    }
+    // uses mMaxFrames not mReqFrames, so allows "over-filling" the pipe beyond requested limit
+    ssize_t ret = mMaxFrames - (mRear - android_atomic_acquire_load(&mFront));
+    ALOG_ASSERT((0 <= ret) && (ret <= mMaxFrames));
+    return ret;
+}
+
+ssize_t MonoPipe::write(const void *buffer, size_t count)
+{
+    if (CC_UNLIKELY(!mNegotiated)) {
+        return NEGOTIATE;
+    }
+    size_t totalFramesWritten = 0;
+    while (count > 0) {
+        // can't return a negative value, as we already checked for !mNegotiated
+        size_t avail = availableToWrite();
+        size_t written = avail;
+        if (CC_LIKELY(written > count)) {
+            written = count;
+        }
+        size_t rear = mRear & (mMaxFrames - 1);
+        size_t part1 = mMaxFrames - rear;
+        if (part1 > written) {
+            part1 = written;
+        }
+        if (CC_LIKELY(part1 > 0)) {
+            memcpy((char *) mBuffer + (rear << mBitShift), buffer, part1 << mBitShift);
+            if (CC_UNLIKELY(rear + part1 == mMaxFrames)) {
+                size_t part2 = written - part1;
+                if (CC_LIKELY(part2 > 0)) {
+                    memcpy(mBuffer, (char *) buffer + (part1 << mBitShift), part2 << mBitShift);
+                }
+            }
+            android_atomic_release_store(written + mRear, &mRear);
+            totalFramesWritten += written;
+        }
+        if (!mWriteCanBlock) {
+            break;
+        }
+        count -= written;
+        buffer = (char *) buffer + (written << mBitShift);
+        // Simulate blocking I/O by sleeping at different rates, depending on a throttle.
+        // The throttle tries to keep the mean pipe depth near the setpoint, with a slight jitter.
+        uint32_t ns;
+        if (written > 0) {
+            size_t filled = (mMaxFrames - avail) + written;
+            // FIXME cache these values to avoid re-computation
+            if (filled <= mSetpoint / 2) {
+                // pipe is (nearly) empty, fill quickly
+                ns = written * ( 500000000 / Format_sampleRate(mFormat));
+            } else if (filled <= (mSetpoint * 3) / 4) {
+                // pipe is below setpoint, fill at slightly faster rate
+                ns = written * ( 750000000 / Format_sampleRate(mFormat));
+            } else if (filled <= (mSetpoint * 5) / 4) {
+                // pipe is at setpoint, fill at nominal rate
+                ns = written * (1000000000 / Format_sampleRate(mFormat));
+            } else if (filled <= (mSetpoint * 3) / 2) {
+                // pipe is above setpoint, fill at slightly slower rate
+                ns = written * (1150000000 / Format_sampleRate(mFormat));
+            } else if (filled <= (mSetpoint * 7) / 4) {
+                // pipe is overflowing, fill slowly
+                ns = written * (1350000000 / Format_sampleRate(mFormat));
+            } else {
+                // pipe is severely overflowing
+                ns = written * (1750000000 / Format_sampleRate(mFormat));
+            }
+        } else {
+            ns = count * (1350000000 / Format_sampleRate(mFormat));
+        }
+        if (ns > 999999999) {
+            ns = 999999999;
+        }
+        struct timespec nowTs;
+        bool nowTsValid = !clock_gettime(CLOCK_MONOTONIC, &nowTs);
+        // deduct the elapsed time since previous write() completed
+        if (nowTsValid && mWriteTsValid) {
+            time_t sec = nowTs.tv_sec - mWriteTs.tv_sec;
+            long nsec = nowTs.tv_nsec - mWriteTs.tv_nsec;
+            if (nsec < 0) {
+                --sec;
+                nsec += 1000000000;
+            }
+            if (sec == 0) {
+                if ((long) ns > nsec) {
+                    ns -= nsec;
+                } else {
+                    ns = 0;
+                }
+            }
+        }
+        if (ns > 0) {
+            const struct timespec req = {0, ns};
+            nanosleep(&req, NULL);
+        }
+        // record the time that this write() completed
+        if (nowTsValid) {
+            mWriteTs = nowTs;
+            if ((mWriteTs.tv_nsec += ns) >= 1000000000) {
+                mWriteTs.tv_nsec -= 1000000000;
+                ++mWriteTs.tv_sec;
+            }
+        }
+        mWriteTsValid = nowTsValid;
+    }
+    mFramesWritten += totalFramesWritten;
+    return totalFramesWritten;
+}
+
+void MonoPipe::setAvgFrames(size_t setpoint)
+{
+    mSetpoint = setpoint;
+}
+
+status_t MonoPipe::getNextWriteTimestamp(int64_t *timestamp)
+{
+    int32_t front;
+
+    ALOG_ASSERT(NULL != timestamp);
+
+    if (0 == mSamplesToLocalTime.a_to_b_denom)
+        return UNKNOWN_ERROR;
+
+    observeFrontAndNRPTS(&front, timestamp);
+
+    if (AudioBufferProvider::kInvalidPTS != *timestamp) {
+        // If we have a valid read-pointer and next read timestamp pair, then
+        // use the current value of the write pointer to figure out how many
+        // frames are in the buffer, and offset the timestamp by that amt.  Then
+        // next time we write to the MonoPipe, the data will hit the speakers at
+        // the next read timestamp plus the current amount of data in the
+        // MonoPipe.
+        size_t pendingFrames = (mRear - front) & (mMaxFrames - 1);
+        *timestamp = offsetTimestampByAudioFrames(*timestamp, pendingFrames);
+    }
+
+    return OK;
+}
+
+void MonoPipe::updateFrontAndNRPTS(int32_t newFront, int64_t newNextRdPTS)
+{
+    // Set the MSB of the update sequence number to indicate that there is a
+    // multi-variable update in progress.  Use an atomic store with an "acquire"
+    // barrier to make sure that the next operations cannot be re-ordered and
+    // take place before the change to mUpdateSeq is commited..
+    int32_t tmp = mUpdateSeq | 0x80000000;
+    android_atomic_acquire_store(tmp, &mUpdateSeq);
+
+    // Update mFront and mNextRdPTS
+    mFront = newFront;
+    mNextRdPTS = newNextRdPTS;
+
+    // We are finished with the update.  Compute the next sequnce number (which
+    // should be the old sequence number, plus one, and with the MSB cleared)
+    // and then store it in mUpdateSeq using an atomic store with a "release"
+    // barrier so our update operations cannot be re-ordered past the update of
+    // the sequence number.
+    tmp = (tmp + 1) & 0x7FFFFFFF;
+    android_atomic_release_store(tmp, &mUpdateSeq);
+}
+
+void MonoPipe::observeFrontAndNRPTS(int32_t *outFront, int64_t *outNextRdPTS)
+{
+    // Perform an atomic observation of mFront and mNextRdPTS.  Basically,
+    // atomically observe the sequence number, then observer the variables, then
+    // atomically observe the sequence number again.  If the two observations of
+    // the sequence number match, and the update-in-progress bit was not set,
+    // then we know we have a successful atomic observation.  Otherwise, we loop
+    // around and try again.
+    //
+    // Note, it is very important that the observer be a lower priority thread
+    // than the updater.  If the updater is lower than the observer, or they are
+    // the same priority and running with SCHED_FIFO (implying that quantum
+    // based premption is disabled) then we run the risk of deadlock.
+    int32_t seqOne, seqTwo;
+
+    do {
+        seqOne        = android_atomic_acquire_load(&mUpdateSeq);
+        *outFront     = mFront;
+        *outNextRdPTS = mNextRdPTS;
+        seqTwo        = android_atomic_release_load(&mUpdateSeq);
+    } while ((seqOne != seqTwo) || (seqOne & 0x80000000));
+}
+
+int64_t MonoPipe::offsetTimestampByAudioFrames(int64_t ts, size_t audFrames)
+{
+    if (0 == mSamplesToLocalTime.a_to_b_denom)
+        return AudioBufferProvider::kInvalidPTS;
+
+    if (ts == AudioBufferProvider::kInvalidPTS)
+        return AudioBufferProvider::kInvalidPTS;
+
+    int64_t frame_lt_duration;
+    if (!mSamplesToLocalTime.doForwardTransform(audFrames,
+                                                &frame_lt_duration)) {
+        // This should never fail, but if there is a bug which is causing it
+        // to fail, this message would probably end up flooding the logs
+        // because the conversion would probably fail forever.  Log the
+        // error, but then zero out the ratio in the linear transform so
+        // that we don't try to do any conversions from now on.  This
+        // MonoPipe's getNextWriteTimestamp is now broken for good.
+        ALOGE("Overflow when attempting to convert %d audio frames to"
+              " duration in local time.  getNextWriteTimestamp will fail from"
+              " now on.", audFrames);
+        mSamplesToLocalTime.a_to_b_numer = 0;
+        mSamplesToLocalTime.a_to_b_denom = 0;
+        return AudioBufferProvider::kInvalidPTS;
+    }
+
+    return ts + frame_lt_duration;
+}
+
+}   // namespace android
diff --git a/services/audioflinger/MonoPipeReader.cpp b/media/libnbaio/MonoPipeReader.cpp
similarity index 66%
rename from services/audioflinger/MonoPipeReader.cpp
rename to media/libnbaio/MonoPipeReader.cpp
index b80d0c0..394f6ac 100644
--- a/services/audioflinger/MonoPipeReader.cpp
+++ b/media/libnbaio/MonoPipeReader.cpp
@@ -19,7 +19,7 @@
 
 #include <cutils/compiler.h>
 #include <utils/Log.h>
-#include "MonoPipeReader.h"
+#include <media/nbaio/MonoPipeReader.h>
 
 namespace android {
 
@@ -43,11 +43,25 @@
     return ret;
 }
 
-ssize_t MonoPipeReader::read(void *buffer, size_t count)
+ssize_t MonoPipeReader::read(void *buffer, size_t count, int64_t readPTS)
 {
+    // Compute the "next read PTS" and cache it.  Callers of read pass a read
+    // PTS indicating the local time for which they are requesting data along
+    // with a count (which is the number of audio frames they are going to
+    // ultimately pass to the next stage of the pipeline).  Offsetting readPTS
+    // by the duration of count will give us the readPTS which will be passed to
+    // us next time, assuming they system continues to operate in steady state
+    // with no discontinuities.  We stash this value so it can be used by the
+    // MonoPipe writer to imlement getNextWriteTimestamp.
+    int64_t nextReadPTS;
+    nextReadPTS = mPipe->offsetTimestampByAudioFrames(readPTS, count);
+
     // count == 0 is unlikely and not worth checking for explicitly; will be handled automatically
     ssize_t red = availableToRead();
     if (CC_UNLIKELY(red <= 0)) {
+        // Uh-oh, looks like we are underflowing.  Update the next read PTS and
+        // get out.
+        mPipe->updateFrontAndNRPTS(mPipe->mFront, nextReadPTS);
         return red;
     }
     if (CC_LIKELY((size_t) red > count)) {
@@ -66,7 +80,7 @@
                 memcpy((char *) buffer + (part1 << mBitShift), mPipe->mBuffer, part2 << mBitShift);
             }
         }
-        android_atomic_release_store(red + mPipe->mFront, &mPipe->mFront);
+        mPipe->updateFrontAndNRPTS(red + mPipe->mFront, nextReadPTS);
         mFramesRead += red;
     }
     return red;
diff --git a/services/audioflinger/NBAIO.cpp b/media/libnbaio/NBAIO.cpp
similarity index 95%
rename from services/audioflinger/NBAIO.cpp
rename to media/libnbaio/NBAIO.cpp
index 9d71eae..00d2017 100644
--- a/services/audioflinger/NBAIO.cpp
+++ b/media/libnbaio/NBAIO.cpp
@@ -18,7 +18,7 @@
 //#define LOG_NDEBUG 0
 
 #include <utils/Log.h>
-#include "NBAIO.h"
+#include <media/nbaio/NBAIO.h>
 
 namespace android {
 
@@ -128,7 +128,8 @@
 }
 
 // This is a default implementation; it is expected that subclasses will optimize this.
-ssize_t NBAIO_Source::readVia(readVia_t via, size_t total, void *user, size_t block)
+ssize_t NBAIO_Source::readVia(readVia_t via, size_t total, void *user,
+                              int64_t readPTS, size_t block)
 {
     if (!mNegotiated) {
         return (ssize_t) NEGOTIATE;
@@ -147,11 +148,11 @@
         if (count > block) {
             count = block;
         }
-        ssize_t ret = read(buffer, count);
+        ssize_t ret = read(buffer, count, readPTS);
         if (ret > 0) {
             ALOG_ASSERT((size_t) ret <= count);
             size_t maxRet = ret;
-            ret = via(user, buffer, maxRet);
+            ret = via(user, buffer, maxRet, readPTS);
             if (ret > 0) {
                 ALOG_ASSERT((size_t) ret <= maxRet);
                 accumulator += ret;
diff --git a/services/audioflinger/Pipe.cpp b/media/libnbaio/Pipe.cpp
similarity index 96%
rename from services/audioflinger/Pipe.cpp
rename to media/libnbaio/Pipe.cpp
index e5b3561..1c21f9c 100644
--- a/services/audioflinger/Pipe.cpp
+++ b/media/libnbaio/Pipe.cpp
@@ -20,8 +20,8 @@
 #include <cutils/atomic.h>
 #include <cutils/compiler.h>
 #include <utils/Log.h>
-#include "Pipe.h"
-#include "roundup.h"
+#include <media/nbaio/Pipe.h>
+#include <media/nbaio/roundup.h>
 
 namespace android {
 
diff --git a/services/audioflinger/PipeReader.cpp b/media/libnbaio/PipeReader.cpp
similarity index 96%
rename from services/audioflinger/PipeReader.cpp
rename to media/libnbaio/PipeReader.cpp
index df3ee04..d786b84 100644
--- a/services/audioflinger/PipeReader.cpp
+++ b/media/libnbaio/PipeReader.cpp
@@ -19,7 +19,7 @@
 
 #include <cutils/compiler.h>
 #include <utils/Log.h>
-#include "PipeReader.h"
+#include <media/nbaio/PipeReader.h>
 
 namespace android {
 
@@ -59,7 +59,7 @@
     return avail;
 }
 
-ssize_t PipeReader::read(void *buffer, size_t count)
+ssize_t PipeReader::read(void *buffer, size_t count, int64_t readPTS)
 {
     ssize_t avail = availableToRead();
     if (CC_UNLIKELY(avail <= 0)) {
diff --git a/media/libnbaio/README.txt b/media/libnbaio/README.txt
new file mode 100644
index 0000000..8d74ab2
--- /dev/null
+++ b/media/libnbaio/README.txt
@@ -0,0 +1,40 @@
+libnbaio (for "Non-Blocking Audio I/O") was originally intended to
+be a purely non-blocking API.  It has evolved to now include
+a few blocking implementations of the interface.
+
+Note: as used here, "short transfer count" means the return value for
+read() or write() that indicates the actual number of successfully
+transferred frames is less than the requested number of frames.
+
+Pipe
+----
+supports 1 writer and N readers
+
+no mutexes, so safe to use between SCHED_NORMAL and SCHED_FIFO threads
+
+writes:
+  non-blocking
+  never return a short transfer count
+  overwrite data if not consumed quickly enough
+
+reads:
+  non-blocking
+  return a short transfer count if not enough data
+  will lose data if reader doesn't keep up
+
+MonoPipe
+--------
+supports 1 writer and 1 reader
+
+no mutexes, so safe to use between SCHED_NORMAL and SCHED_FIFO threads
+
+write are optionally blocking:
+  if configured to block, then will wait until space available before returning
+  if configured to not block, then will return a short transfer count
+    and will never overwrite data
+
+reads:
+  non-blocking
+  return a short transfer count if not enough data
+  never lose data
+
diff --git a/services/audioflinger/SourceAudioBufferProvider.cpp b/media/libnbaio/SourceAudioBufferProvider.cpp
similarity index 97%
rename from services/audioflinger/SourceAudioBufferProvider.cpp
rename to media/libnbaio/SourceAudioBufferProvider.cpp
index e9d6d2c..d11a86c 100644
--- a/services/audioflinger/SourceAudioBufferProvider.cpp
+++ b/media/libnbaio/SourceAudioBufferProvider.cpp
@@ -18,7 +18,7 @@
 //#define LOG_NDEBUG 0
 
 #include <utils/Log.h>
-#include "SourceAudioBufferProvider.h"
+#include <media/nbaio/SourceAudioBufferProvider.h>
 
 namespace android {
 
@@ -65,7 +65,7 @@
         mSize = buffer->frameCount;
     }
     // read from source
-    ssize_t actual = mSource->read(mAllocated, buffer->frameCount);
+    ssize_t actual = mSource->read(mAllocated, buffer->frameCount, pts);
     if (actual > 0) {
         ALOG_ASSERT((size_t) actual <= buffer->frameCount);
         mOffset = 0;
diff --git a/services/audioflinger/roundup.c b/media/libnbaio/roundup.c
similarity index 96%
rename from services/audioflinger/roundup.c
rename to media/libnbaio/roundup.c
index 4f9af6a..1d552d1 100644
--- a/services/audioflinger/roundup.c
+++ b/media/libnbaio/roundup.c
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "roundup.h"
+#include <media/nbaio/roundup.h>
 
 unsigned roundup(unsigned v)
 {
diff --git a/media/libstagefright/AACWriter.cpp b/media/libstagefright/AACWriter.cpp
index 284ba01..a6f7cfb 100644
--- a/media/libstagefright/AACWriter.cpp
+++ b/media/libstagefright/AACWriter.cpp
@@ -28,6 +28,8 @@
 #include <media/stagefright/MetaData.h>
 #include <media/mediarecorder.h>
 #include <sys/prctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <fcntl.h>
 
 namespace android {
@@ -44,7 +46,7 @@
 
     ALOGV("AACWriter Constructor");
 
-    mFd = open(filename, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR);
+    mFd = open(filename, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
     if (mFd >= 0) {
         mInitCheck = OK;
     }
@@ -302,6 +304,7 @@
     int64_t previousPausedDurationUs = 0;
     int64_t maxTimestampUs = 0;
     status_t err = OK;
+    bool stoppedPrematurely = true;
 
     prctl(PR_SET_NAME, (unsigned long)"AACWriterThread", 0, 0, 0);
 
@@ -370,6 +373,18 @@
 
         buffer->release();
         buffer = NULL;
+
+        if (err != OK) {
+            break;
+        }
+
+        if (stoppedPrematurely) {
+            stoppedPrematurely = false;
+        }
+    }
+
+    if ((err == OK || err == ERROR_END_OF_STREAM) && stoppedPrematurely) {
+        err = ERROR_MALFORMED;
     }
 
     close(mFd);
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index c4743a1..3dd5d60 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -595,7 +595,7 @@
     // Dequeue buffers and send them to OMX
     for (OMX_U32 i = 0; i < def.nBufferCountActual; i++) {
         ANativeWindowBuffer *buf;
-        err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
+        err = native_window_dequeue_buffer_and_wait(mNativeWindow.get(), &buf);
         if (err != 0) {
             ALOGE("dequeueBuffer failed: %s (%d)", strerror(-err), -err);
             break;
@@ -653,7 +653,7 @@
          mComponentName.c_str(), info->mBufferID);
 
     int err = mNativeWindow->cancelBuffer(
-        mNativeWindow.get(), info->mGraphicBuffer.get());
+        mNativeWindow.get(), info->mGraphicBuffer.get(), -1);
 
     CHECK_EQ(err, 0);
 
@@ -664,7 +664,8 @@
 
 ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() {
     ANativeWindowBuffer *buf;
-    if (mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf) != 0) {
+    int fenceFd = -1;
+    if (native_window_dequeue_buffer_and_wait(mNativeWindow.get(), &buf) != 0) {
         ALOGE("dequeueBuffer failed.");
         return NULL;
     }
@@ -860,6 +861,20 @@
         return INVALID_OPERATION;
     }
 
+    int32_t storeMeta;
+    if (encoder
+            && msg->findInt32("store-metadata-in-buffers", &storeMeta)
+            && storeMeta != 0) {
+        err = mOMX->storeMetaDataInBuffers(mNode, kPortIndexInput, OMX_TRUE);
+
+        if (err != OK) {
+            ALOGE("[%s] storeMetaDataInBuffers failed w/ err %d",
+                  mComponentName.c_str(), err);
+
+            return err;
+        }
+    }
+
     if (!strncasecmp(mime, "video/", 6)) {
         if (encoder) {
             err = setupVideoEncoder(mime, msg);
@@ -1357,7 +1372,8 @@
            || format.eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar
            || format.eColorFormat == OMX_COLOR_FormatCbYCrY
            || format.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar
-           || format.eColorFormat == OMX_QCOM_COLOR_FormatYVU420SemiPlanar);
+           || format.eColorFormat == OMX_QCOM_COLOR_FormatYVU420SemiPlanar
+           || format.eColorFormat == OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka);
 
     return mOMX->setParameter(
             mNode, OMX_IndexParamVideoPortFormat,
@@ -2188,7 +2204,8 @@
     // on the screen and then been replaced, so an previous video frames are
     // guaranteed NOT to be currently displayed.
     for (int i = 0; i < numBufs + 1; i++) {
-        err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &anb);
+        int fenceFd = -1;
+        err = native_window_dequeue_buffer_and_wait(mNativeWindow.get(), &anb);
         if (err != NO_ERROR) {
             ALOGE("error pushing blank frames: dequeueBuffer failed: %s (%d)",
                     strerror(-err), -err);
@@ -2196,13 +2213,6 @@
         }
 
         sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
-        err = mNativeWindow->lockBuffer(mNativeWindow.get(),
-                buf->getNativeBuffer());
-        if (err != NO_ERROR) {
-            ALOGE("error pushing blank frames: lockBuffer failed: %s (%d)",
-                    strerror(-err), -err);
-            goto error;
-        }
 
         // Fill the buffer with the a 1x1 checkerboard pattern ;)
         uint32_t* img = NULL;
@@ -2223,7 +2233,7 @@
         }
 
         err = mNativeWindow->queueBuffer(mNativeWindow.get(),
-                buf->getNativeBuffer());
+                buf->getNativeBuffer(), -1);
         if (err != NO_ERROR) {
             ALOGE("error pushing blank frames: queueBuffer failed: %s (%d)",
                     strerror(-err), -err);
@@ -2238,7 +2248,7 @@
     if (err != NO_ERROR) {
         // Clean up after an error.
         if (anb != NULL) {
-            mNativeWindow->cancelBuffer(mNativeWindow.get(), anb);
+            mNativeWindow->cancelBuffer(mNativeWindow.get(), anb, -1);
         }
 
         native_window_api_disconnect(mNativeWindow.get(),
@@ -2428,6 +2438,21 @@
     CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_COMPONENT);
     info->mStatus = BufferInfo::OWNED_BY_US;
 
+    const sp<AMessage> &bufferMeta = info->mData->meta();
+    void *mediaBuffer;
+    if (bufferMeta->findPointer("mediaBuffer", &mediaBuffer)
+            && mediaBuffer != NULL) {
+        // We're in "store-metadata-in-buffers" mode, the underlying
+        // OMX component had access to data that's implicitly refcounted
+        // by this "mediaBuffer" object. Now that the OMX component has
+        // told us that it's done with the input buffer, we can decrement
+        // the mediaBuffer's reference count.
+        ((MediaBuffer *)mediaBuffer)->release();
+        mediaBuffer = NULL;
+
+        bufferMeta->setPointer("mediaBuffer", NULL);
+    }
+
     PortMode mode = getPortMode(kPortIndexInput);
 
     switch (mode) {
@@ -2535,10 +2560,10 @@
                 }
 
                 if (buffer != info->mData) {
-                    if (0 && !(flags & OMX_BUFFERFLAG_CODECCONFIG)) {
-                        ALOGV("[%s] Needs to copy input data.",
-                             mCodec->mComponentName.c_str());
-                    }
+                    ALOGV("[%s] Needs to copy input data for buffer %p. (%p != %p)",
+                         mCodec->mComponentName.c_str(),
+                         bufferID,
+                         buffer.get(), info->mData.get());
 
                     CHECK_LE(buffer->size(), info->mData->capacity());
                     memcpy(info->mData->data(), buffer->data(), buffer->size());
@@ -2551,10 +2576,22 @@
                     ALOGV("[%s] calling emptyBuffer %p w/ EOS",
                          mCodec->mComponentName.c_str(), bufferID);
                 } else {
+#if TRACK_BUFFER_TIMING
+                    ALOGI("[%s] calling emptyBuffer %p w/ time %lld us",
+                         mCodec->mComponentName.c_str(), bufferID, timeUs);
+#else
                     ALOGV("[%s] calling emptyBuffer %p w/ time %lld us",
                          mCodec->mComponentName.c_str(), bufferID, timeUs);
+#endif
                 }
 
+#if TRACK_BUFFER_TIMING
+                ACodec::BufferStats stats;
+                stats.mEmptyBufferTimeUs = ALooper::GetNowUs();
+                stats.mFillBufferDoneTimeUs = -1ll;
+                mCodec->mBufferStats.add(timeUs, stats);
+#endif
+
                 CHECK_EQ(mCodec->mOMX->emptyBuffer(
                             mCodec->mNode,
                             bufferID,
@@ -2651,6 +2688,22 @@
          mCodec->mComponentName.c_str(), bufferID, timeUs, flags);
 
     ssize_t index;
+
+#if TRACK_BUFFER_TIMING
+    index = mCodec->mBufferStats.indexOfKey(timeUs);
+    if (index >= 0) {
+        ACodec::BufferStats *stats = &mCodec->mBufferStats.editValueAt(index);
+        stats->mFillBufferDoneTimeUs = ALooper::GetNowUs();
+
+        ALOGI("frame PTS %lld: %lld",
+                timeUs,
+                stats->mFillBufferDoneTimeUs - stats->mEmptyBufferTimeUs);
+
+        mCodec->mBufferStats.removeItemsAt(index);
+        stats = NULL;
+    }
+#endif
+
     BufferInfo *info =
         mCodec->findBufferByID(kPortIndexOutput, bufferID, &index);
 
@@ -2751,7 +2804,7 @@
         status_t err;
         if ((err = mCodec->mNativeWindow->queueBuffer(
                     mCodec->mNativeWindow.get(),
-                    info->mGraphicBuffer.get())) == OK) {
+                    info->mGraphicBuffer.get(), -1)) == OK) {
             info->mStatus = BufferInfo::OWNED_BY_NATIVE_WINDOW;
         } else {
             mCodec->signalError(OMX_ErrorUndefined, err);
@@ -2890,20 +2943,21 @@
 
     sp<IOMX> omx = client.interface();
 
-    Vector<String8> matchingCodecs;
-    Vector<uint32_t> matchingCodecQuirks;
+    Vector<OMXCodec::CodecNameAndQuirks> matchingCodecs;
 
     AString mime;
 
     AString componentName;
-    uint32_t quirks;
+    uint32_t quirks = 0;
     if (msg->findString("componentName", &componentName)) {
-        matchingCodecs.push_back(String8(componentName.c_str()));
+        ssize_t index = matchingCodecs.add();
+        OMXCodec::CodecNameAndQuirks *entry = &matchingCodecs.editItemAt(index);
+        entry->mName = String8(componentName.c_str());
 
-        if (!OMXCodec::findCodecQuirks(componentName.c_str(), &quirks)) {
-            quirks = 0;
+        if (!OMXCodec::findCodecQuirks(
+                    componentName.c_str(), &entry->mQuirks)) {
+            entry->mQuirks = 0;
         }
-        matchingCodecQuirks.push_back(quirks);
     } else {
         CHECK(msg->findString("mime", &mime));
 
@@ -2917,8 +2971,7 @@
                 encoder, // createEncoder
                 NULL,  // matchComponentName
                 0,     // flags
-                &matchingCodecs,
-                &matchingCodecQuirks);
+                &matchingCodecs);
     }
 
     sp<CodecObserver> observer = new CodecObserver;
@@ -2926,8 +2979,8 @@
 
     for (size_t matchIndex = 0; matchIndex < matchingCodecs.size();
             ++matchIndex) {
-        componentName = matchingCodecs.itemAt(matchIndex).string();
-        quirks = matchingCodecQuirks.itemAt(matchIndex);
+        componentName = matchingCodecs.itemAt(matchIndex).mName.string();
+        quirks = matchingCodecs.itemAt(matchIndex).mQuirks;
 
         pid_t tid = androidGetTid();
         int prevPriority = androidGetThreadPriority(tid);
@@ -3253,11 +3306,6 @@
             if (info->mStatus == BufferInfo::OWNED_BY_NATIVE_WINDOW) {
                 continue;
             }
-
-            status_t err = mCodec->mNativeWindow->lockBuffer(
-                    mCodec->mNativeWindow.get(),
-                    info->mGraphicBuffer.get());
-            CHECK_EQ(err, (status_t)OK);
         } else {
             CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_US);
         }
diff --git a/media/libstagefright/AMRWriter.cpp b/media/libstagefright/AMRWriter.cpp
index ca85640..8d5eec8 100644
--- a/media/libstagefright/AMRWriter.cpp
+++ b/media/libstagefright/AMRWriter.cpp
@@ -36,7 +36,7 @@
       mPaused(false),
       mResumed(false) {
 
-    mFd = open(filename, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR);
+    mFd = open(filename, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
     if (mFd >= 0) {
         mInitCheck = OK;
     }
@@ -254,11 +254,14 @@
         if (n < (ssize_t)buffer->range_length()) {
             buffer->release();
             buffer = NULL;
-
+            err = ERROR_IO;
             break;
         }
 
-        // XXX: How to tell it is stopped prematurely?
+        if (err != OK) {
+            break;
+        }
+
         if (stoppedPrematurely) {
             stoppedPrematurely = false;
         }
@@ -267,8 +270,8 @@
         buffer = NULL;
     }
 
-    if (stoppedPrematurely) {
-        notify(MEDIA_RECORDER_EVENT_INFO, MEDIA_RECORDER_TRACK_INFO_COMPLETION_STATUS, UNKNOWN_ERROR);
+    if ((err == OK || err == ERROR_END_OF_STREAM) && stoppedPrematurely) {
+        err = ERROR_MALFORMED;
     }
 
     close(mFd);
diff --git a/media/libstagefright/Android.mk b/media/libstagefright/Android.mk
index 8ad1cb9..3fd0f85 100644
--- a/media/libstagefright/Android.mk
+++ b/media/libstagefright/Android.mk
@@ -81,6 +81,7 @@
         libssl \
         libstagefright_omx \
         libstagefright_yuv \
+        libsync \
         libui \
         libutils \
         libvorbisidec \
@@ -97,13 +98,9 @@
         libstagefright_id3 \
         libFLAC \
 
-ifneq ($(TARGET_BUILD_PDK), true)
-LOCAL_STATIC_LIBRARIES += \
-	libstagefright_chromium_http
-LOCAL_SHARED_LIBRARIES += \
-        libchromium_net
+LOCAL_SRC_FILES += \
+        chromium_http_stub.cpp
 LOCAL_CPPFLAGS += -DCHROMIUM_AVAILABLE=1
-endif
 
 LOCAL_SHARED_LIBRARIES += libstlport
 include external/stlport/libstlport.mk
@@ -118,6 +115,8 @@
 
 LOCAL_MODULE:= libstagefright
 
+LOCAL_MODULE_TAGS := optional
+
 include $(BUILD_SHARED_LIBRARY)
 
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp
index 72d797e..3248dbc 100644
--- a/media/libstagefright/AudioSource.cpp
+++ b/media/libstagefright/AudioSource.cpp
@@ -24,6 +24,7 @@
 #include <media/stagefright/MediaDefs.h>
 #include <media/stagefright/MetaData.h>
 #include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/ALooper.h>
 #include <cutils/properties.h>
 #include <stdlib.h>
 
@@ -33,7 +34,7 @@
     AudioSource *source = (AudioSource *) user;
     switch (event) {
         case AudioRecord::EVENT_MORE_DATA: {
-            source->dataCallbackTimestamp(*((AudioRecord::Buffer *) info), systemTime() / 1000);
+            source->dataCallback(*((AudioRecord::Buffer *) info));
             break;
         }
         case AudioRecord::EVENT_OVERRUN: {
@@ -48,11 +49,13 @@
 
 AudioSource::AudioSource(
         audio_source_t inputSource, uint32_t sampleRate, uint32_t channelCount)
-    : mStarted(false),
+    : mRecord(NULL),
+      mStarted(false),
       mSampleRate(sampleRate),
       mPrevSampleTimeUs(0),
       mNumFramesReceived(0),
-      mNumClientOwnedBuffers(0) {
+      mNumClientOwnedBuffers(0),
+      mUseLooperTime(false) {
 
     ALOGV("sampleRate: %d, channelCount: %d", sampleRate, channelCount);
     CHECK(channelCount == 1 || channelCount == 2);
@@ -61,7 +64,7 @@
     status_t status = AudioRecord::getMinFrameCount(&minFrameCount,
                                            sampleRate,
                                            AUDIO_FORMAT_PCM_16_BIT,
-                                           channelCount);
+                                           audio_channel_in_mask_from_count(channelCount));
     if (status == OK) {
         // make sure that the AudioRecord callback never returns more than the maximum
         // buffer size
@@ -73,15 +76,10 @@
             bufCount++;
         }
 
-        AudioRecord::record_flags flags = (AudioRecord::record_flags)
-                        (AudioRecord::RECORD_AGC_ENABLE |
-                         AudioRecord::RECORD_NS_ENABLE  |
-                         AudioRecord::RECORD_IIR_ENABLE);
         mRecord = new AudioRecord(
                     inputSource, sampleRate, AUDIO_FORMAT_PCM_16_BIT,
                     audio_channel_in_mask_from_count(channelCount),
                     bufCount * frameCount,
-                    flags,
                     AudioRecordCallbackFunction,
                     this,
                     frameCount);
@@ -104,6 +102,12 @@
     return mInitCheck;
 }
 
+void AudioSource::setUseLooperTime(bool useLooperTime) {
+    CHECK(!mStarted);
+
+    mUseLooperTime = useLooperTime;
+}
+
 status_t AudioSource::start(MetaData *params) {
     Mutex::Autolock autoLock(mLock);
     if (mStarted) {
@@ -275,8 +279,10 @@
     return;
 }
 
-status_t AudioSource::dataCallbackTimestamp(
-        const AudioRecord::Buffer& audioBuffer, int64_t timeUs) {
+status_t AudioSource::dataCallback(const AudioRecord::Buffer& audioBuffer) {
+    int64_t timeUs =
+        mUseLooperTime ? ALooper::GetNowUs() : (systemTime() / 1000ll);
+
     ALOGV("dataCallbackTimestamp: %lld us", timeUs);
     Mutex::Autolock autoLock(mLock);
     if (!mStarted) {
@@ -294,12 +300,15 @@
     if (mNumFramesReceived == 0 && mPrevSampleTimeUs == 0) {
         mInitialReadTimeUs = timeUs;
         // Initial delay
-        if (mStartTimeUs > 0) {
+        if (mUseLooperTime) {
+            mStartTimeUs = timeUs;
+        } else if (mStartTimeUs > 0) {
             mStartTimeUs = timeUs - mStartTimeUs;
         } else {
             // Assume latency is constant.
             mStartTimeUs += mRecord->latency() * 1000;
         }
+
         mPrevSampleTimeUs = mStartTimeUs;
     }
 
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 0f346d8..04f78eb 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -130,7 +130,7 @@
         CHECK(buffer->meta_data()->findInt64(kKeyTime, &timeUs));
         native_window_set_buffers_timestamp(mNativeWindow.get(), timeUs * 1000);
         status_t err = mNativeWindow->queueBuffer(
-                mNativeWindow.get(), buffer->graphicBuffer().get());
+                mNativeWindow.get(), buffer->graphicBuffer().get(), -1);
         if (err != 0) {
             ALOGE("queueBuffer failed with error %s (%d)", strerror(-err),
                     -err);
@@ -183,6 +183,7 @@
     : mQueueStarted(false),
       mUIDValid(false),
       mTimeSource(NULL),
+      mVideoRenderingStarted(false),
       mVideoRendererIsPreview(false),
       mAudioPlayer(NULL),
       mDisplayWidth(0),
@@ -280,11 +281,7 @@
         }
     }
 
-    if (!(mFlags & INCOGNITO)) {
-        ALOGI("setDataSource_l('%s')", mUri.string());
-    } else {
-        ALOGI("setDataSource_l(URL suppressed)");
-    }
+    ALOGI("setDataSource_l(URL suppressed)");
 
     // The actual work will be done during preparation in the call to
     // ::finishSetDataSource_l to avoid blocking the calling thread in
@@ -468,6 +465,7 @@
 }
 
 void AwesomePlayer::reset_l() {
+    mVideoRenderingStarted = false;
     mActiveAudioTrackIndex = -1;
     mDisplayWidth = 0;
     mDisplayHeight = 0;
@@ -710,7 +708,6 @@
                              kHighWaterMarkBytes);
                         modifyFlags(CACHE_UNDERRUN, CLEAR);
                         play_l();
-                        notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_END);
                     } else if (mFlags & PREPARING) {
                         ALOGV("cache has filled up (> %d), prepare is done",
                              kHighWaterMarkBytes);
@@ -759,8 +756,8 @@
                       cachedDurationUs / 1E6);
                 pause_l();
                 ensureCacheIsFetching_l();
-                sendCacheStats();
             }
+            sendCacheStats();
             notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
         } else if (eos || cachedDurationUs > kHighWaterMarkUs) {
             if (mFlags & CACHE_UNDERRUN) {
@@ -770,7 +767,6 @@
                           cachedDurationUs / 1E6);
                     play_l();
                 }
-                notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_END);
             } else if (mFlags & PREPARING) {
                 ALOGV("cache has filled up (%.2f secs), prepare is done",
                      cachedDurationUs / 1E6);
@@ -784,9 +780,14 @@
 
 void AwesomePlayer::sendCacheStats() {
     sp<MediaPlayerBase> listener = mListener.promote();
-    if (listener != NULL && mCachedSource != NULL) {
+    if (listener != NULL) {
         int32_t kbps = 0;
-        status_t err = mCachedSource->getEstimatedBandwidthKbps(&kbps);
+        status_t err = UNKNOWN_ERROR;
+        if (mCachedSource != NULL) {
+            err = mCachedSource->getEstimatedBandwidthKbps(&kbps);
+        } else if (mWVMExtractor != NULL) {
+            err = mWVMExtractor->getEstimatedBandwidthKbps(&kbps);
+        }
         if (err == OK) {
             listener->sendEvent(
                 MEDIA_INFO, MEDIA_INFO_NETWORK_BANDWIDTH, kbps);
@@ -1807,6 +1808,11 @@
     if (mVideoRenderer != NULL) {
         mSinceLastDropped++;
         mVideoRenderer->render(mVideoBuffer);
+        if (!mVideoRenderingStarted) {
+            mVideoRenderingStarted = true;
+            notifyListener_l(MEDIA_INFO, MEDIA_INFO_RENDERING_START);
+        }
+
     }
 
     mVideoBuffer->release();
@@ -2577,7 +2583,7 @@
 
     fprintf(out, " AwesomePlayer\n");
     if (mStats.mFd < 0) {
-        fprintf(out, "  URI(%s)", mStats.mURI.string());
+        fprintf(out, "  URI(suppressed)");
     } else {
         fprintf(out, "  fd(%d)", mStats.mFd);
     }
@@ -2626,6 +2632,9 @@
             mFlags |= value;
             break;
         case CLEAR:
+            if ((value & CACHE_UNDERRUN) && (mFlags & CACHE_UNDERRUN)) {
+                notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_END);
+            }
             mFlags &= ~value;
             break;
         case ASSIGN:
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index 3ddad93..efd7af7 100755
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -111,6 +111,10 @@
        return OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
     }
 
+    if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_ANDROID_OPAQUE)) {
+        return OMX_COLOR_FormatAndroidOpaque;
+    }
+
     ALOGE("Uknown color format (%s), please add it to "
          "CameraSource::getColorFormat", colorFormat);
 
@@ -151,6 +155,7 @@
     const sp<Surface>& surface,
     bool storeMetaDataInVideoBuffers)
     : mCameraFlags(0),
+      mNumInputBuffers(0),
       mVideoFrameRate(-1),
       mCamera(0),
       mSurface(surface),
@@ -567,6 +572,18 @@
     // camera and recording is started by the applications. The applications
     // will connect to the camera in ICameraRecordingProxy::startRecording.
     int64_t token = IPCThreadState::self()->clearCallingIdentity();
+    if (mNumInputBuffers > 0) {
+        status_t err = mCamera->sendCommand(
+            CAMERA_CMD_SET_VIDEO_BUFFER_COUNT, mNumInputBuffers, 0);
+
+        // This could happen for CameraHAL1 clients; thus the failure is
+        // not a fatal error
+        if (err != OK) {
+            ALOGW("Failed to set video buffer count to %d due to %d",
+                mNumInputBuffers, err);
+        }
+    }
+
     if (mCameraFlags & FLAGS_HOT_CAMERA) {
         mCamera->unlock();
         mCamera.clear();
@@ -595,9 +612,18 @@
     }
 
     mStartTimeUs = 0;
-    int64_t startTimeUs;
-    if (meta && meta->findInt64(kKeyTime, &startTimeUs)) {
-        mStartTimeUs = startTimeUs;
+    mNumInputBuffers = 0;
+    if (meta) {
+        int64_t startTimeUs;
+        if (meta->findInt64(kKeyTime, &startTimeUs)) {
+            mStartTimeUs = startTimeUs;
+        }
+
+        int32_t nBuffers;
+        if (meta->findInt32(kKeyNumBuffers, &nBuffers)) {
+            CHECK_GT(nBuffers, 0);
+            mNumInputBuffers = nBuffers;
+        }
     }
 
     startCameraRecording();
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp
index c75f100..1de808e 100644
--- a/media/libstagefright/DataSource.cpp
+++ b/media/libstagefright/DataSource.cpp
@@ -17,7 +17,7 @@
 #include "include/AMRExtractor.h"
 
 #if CHROMIUM_AVAILABLE
-#include "include/DataUriSource.h"
+#include "include/chromium_http_stub.h"
 #endif
 
 #include "include/MP3Extractor.h"
@@ -173,7 +173,7 @@
 
 # if CHROMIUM_AVAILABLE
     } else if (!strncasecmp("data:", uri, 5)) {
-        source = new DataUriSource(uri);
+        source = createDataUriSource(uri);
 #endif
     } else {
         // Assume it's a filename.
diff --git a/media/libstagefright/FLACExtractor.cpp b/media/libstagefright/FLACExtractor.cpp
index 668d7f7..29bb056 100644
--- a/media/libstagefright/FLACExtractor.cpp
+++ b/media/libstagefright/FLACExtractor.cpp
@@ -350,7 +350,7 @@
         for (FLAC__uint32 i = 0; i < vc->num_comments; ++i) {
             FLAC__StreamMetadata_VorbisComment_Entry *vce;
             vce = &vc->comments[i];
-            if (mFileMetadata != 0) {
+            if (mFileMetadata != 0 && vce->entry != NULL) {
                 parseVorbisComment(mFileMetadata, (const char *) vce->entry,
                         vce->length);
             }
diff --git a/media/libstagefright/HTTPBase.cpp b/media/libstagefright/HTTPBase.cpp
index d7eea3f..40bfc55 100644
--- a/media/libstagefright/HTTPBase.cpp
+++ b/media/libstagefright/HTTPBase.cpp
@@ -21,7 +21,7 @@
 #include "include/HTTPBase.h"
 
 #if CHROMIUM_AVAILABLE
-#include "include/ChromiumHTTPDataSource.h"
+#include "include/chromium_http_stub.h"
 #endif
 
 #include <media/stagefright/foundation/ADebug.h>
@@ -46,7 +46,10 @@
 // static
 sp<HTTPBase> HTTPBase::Create(uint32_t flags) {
 #if CHROMIUM_AVAILABLE
-        return new ChromiumHTTPDataSource(flags);
+        HTTPBase *dataSource = createChromiumHTTPDataSource(flags);
+        if (dataSource) {
+           return dataSource;
+        }
 #endif
     {
         TRESPASS();
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 6108298..8b52e15 100755
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -42,6 +42,7 @@
 
 namespace android {
 
+static const int64_t kMinStreamableFileSizeInBytes = 5 * 1024 * 1024;
 static const int64_t kMax32BitFileSize = 0x007fffffffLL;
 static const uint8_t kNalUnitTypeSeqParamSet = 0x07;
 static const uint8_t kNalUnitTypePicParamSet = 0x08;
@@ -75,6 +76,128 @@
         kSampleArraySize = 1000,
     };
 
+    // A helper class to handle faster write box with table entries
+    template<class TYPE>
+    struct ListTableEntries {
+        ListTableEntries(uint32_t elementCapacity, uint32_t entryCapacity)
+            : mElementCapacity(elementCapacity),
+            mEntryCapacity(entryCapacity),
+            mTotalNumTableEntries(0),
+            mNumValuesInCurrEntry(0),
+            mCurrTableEntriesElement(NULL) {
+            CHECK_GT(mElementCapacity, 0);
+            CHECK_GT(mEntryCapacity, 0);
+        }
+
+        // Free the allocated memory.
+        ~ListTableEntries() {
+            while (!mTableEntryList.empty()) {
+                typename List<TYPE *>::iterator it = mTableEntryList.begin();
+                delete[] (*it);
+                mTableEntryList.erase(it);
+            }
+        }
+
+        // Replace the value at the given position by the given value.
+        // There must be an existing value at the given position.
+        // @arg value must be in network byte order
+        // @arg pos location the value must be in.
+        void set(const TYPE& value, uint32_t pos) {
+            CHECK_LT(pos, mTotalNumTableEntries * mEntryCapacity);
+
+            typename List<TYPE *>::iterator it = mTableEntryList.begin();
+            uint32_t iterations = (pos / (mElementCapacity * mEntryCapacity));
+            while (it != mTableEntryList.end() && iterations > 0) {
+                ++it;
+                --iterations;
+            }
+            CHECK(it != mTableEntryList.end());
+            CHECK_EQ(iterations, 0);
+
+            (*it)[(pos % (mElementCapacity * mEntryCapacity))] = value;
+        }
+
+        // Get the value at the given position by the given value.
+        // @arg value the retrieved value at the position in network byte order.
+        // @arg pos location the value must be in.
+        // @return true if a value is found.
+        bool get(TYPE& value, uint32_t pos) const {
+            if (pos >= mTotalNumTableEntries * mEntryCapacity) {
+                return false;
+            }
+
+            typename List<TYPE *>::iterator it = mTableEntryList.begin();
+            uint32_t iterations = (pos / (mElementCapacity * mEntryCapacity));
+            while (it != mTableEntryList.end() && iterations > 0) {
+                ++it;
+                --iterations;
+            }
+            CHECK(it != mTableEntryList.end());
+            CHECK_EQ(iterations, 0);
+
+            value = (*it)[(pos % (mElementCapacity * mEntryCapacity))];
+            return true;
+        }
+
+        // Store a single value.
+        // @arg value must be in network byte order.
+        void add(const TYPE& value) {
+            CHECK_LT(mNumValuesInCurrEntry, mElementCapacity);
+            uint32_t nEntries = mTotalNumTableEntries % mElementCapacity;
+            uint32_t nValues  = mNumValuesInCurrEntry % mEntryCapacity;
+            if (nEntries == 0 && nValues == 0) {
+                mCurrTableEntriesElement = new TYPE[mEntryCapacity * mElementCapacity];
+                CHECK(mCurrTableEntriesElement != NULL);
+                mTableEntryList.push_back(mCurrTableEntriesElement);
+            }
+
+            uint32_t pos = nEntries * mEntryCapacity + nValues;
+            mCurrTableEntriesElement[pos] = value;
+
+            ++mNumValuesInCurrEntry;
+            if ((mNumValuesInCurrEntry % mEntryCapacity) == 0) {
+                ++mTotalNumTableEntries;
+                mNumValuesInCurrEntry = 0;
+            }
+        }
+
+        // Write out the table entries:
+        // 1. the number of entries goes first
+        // 2. followed by the values in the table enties in order
+        // @arg writer the writer to actual write to the storage
+        void write(MPEG4Writer *writer) const {
+            CHECK_EQ(mNumValuesInCurrEntry % mEntryCapacity, 0);
+            uint32_t nEntries = mTotalNumTableEntries;
+            writer->writeInt32(nEntries);
+            for (typename List<TYPE *>::iterator it = mTableEntryList.begin();
+                it != mTableEntryList.end(); ++it) {
+                CHECK_GT(nEntries, 0);
+                if (nEntries >= mElementCapacity) {
+                    writer->write(*it, sizeof(TYPE) * mEntryCapacity, mElementCapacity);
+                    nEntries -= mElementCapacity;
+                } else {
+                    writer->write(*it, sizeof(TYPE) * mEntryCapacity, nEntries);
+                    break;
+                }
+            }
+        }
+
+        // Return the number of entries in the table.
+        uint32_t count() const { return mTotalNumTableEntries; }
+
+    private:
+        uint32_t         mElementCapacity;  // # entries in an element
+        uint32_t         mEntryCapacity;    // # of values in each entry
+        uint32_t         mTotalNumTableEntries;
+        uint32_t         mNumValuesInCurrEntry;  // up to mEntryCapacity
+        TYPE             *mCurrTableEntriesElement;
+        mutable List<TYPE *>     mTableEntryList;
+
+        DISALLOW_EVIL_CONSTRUCTORS(ListTableEntries);
+    };
+
+
+
     MPEG4Writer *mOwner;
     sp<MetaData> mMeta;
     sp<MediaSource> mSource;
@@ -90,67 +213,25 @@
     int64_t mMaxChunkDurationUs;
 
     bool mIsRealTimeRecording;
-    int64_t mMaxTimeStampUs;
     int64_t mEstimatedTrackSizeBytes;
     int64_t mMdatSizeBytes;
     int32_t mTimeScale;
 
     pthread_t mThread;
 
-    /*
-     * mNumSamples is used to track the total number of samples in
-     * mSampleSizes List.
-     *
-     * A linked list of fixed sized array is used here to reduce the time
-     * to write out stsz box.
-     */
-    uint32_t            mNumSamples;
-    uint32_t*           mCurrentSampleSizeArr;
-    List<uint32_t *>    mSampleSizes;
-    bool                mSamplesHaveSameSize;
 
     List<MediaBuffer *> mChunkSamples;
 
-    size_t              mNumStcoTableEntries;
-    List<off64_t>         mChunkOffsets;
+    bool                mSamplesHaveSameSize;
+    ListTableEntries<uint32_t> *mStszTableEntries;
 
-    size_t              mNumStscTableEntries;
-    struct StscTableEntry {
+    ListTableEntries<uint32_t> *mStcoTableEntries;
+    ListTableEntries<off64_t> *mCo64TableEntries;
+    ListTableEntries<uint32_t> *mStscTableEntries;
+    ListTableEntries<uint32_t> *mStssTableEntries;
+    ListTableEntries<uint32_t> *mSttsTableEntries;
+    ListTableEntries<uint32_t> *mCttsTableEntries;
 
-        StscTableEntry(uint32_t chunk, uint32_t samples, uint32_t id)
-            : firstChunk(chunk),
-              samplesPerChunk(samples),
-              sampleDescriptionId(id) {}
-
-        uint32_t firstChunk;
-        uint32_t samplesPerChunk;
-        uint32_t sampleDescriptionId;
-    };
-    List<StscTableEntry> mStscTableEntries;
-
-    size_t        mNumStssTableEntries;
-    List<int32_t> mStssTableEntries;
-
-    struct SttsTableEntry {
-
-        SttsTableEntry(uint32_t count, uint32_t duration)
-            : sampleCount(count), sampleDuration(duration) {}
-
-        uint32_t sampleCount;
-        uint32_t sampleDuration;  // time scale based
-    };
-    size_t        mNumSttsTableEntries;
-    List<SttsTableEntry> mSttsTableEntries;
-
-    struct CttsTableEntry {
-        CttsTableEntry(uint32_t count, int32_t timescaledDur)
-            : sampleCount(count), sampleDuration(timescaledDur) {}
-
-        uint32_t sampleCount;
-        uint32_t sampleDuration;  // time scale based
-    };
-    size_t        mNumCttsTableEntries;
-    List<CttsTableEntry> mCttsTableEntries;
     int64_t mMinCttsOffsetTimeUs;
     int64_t mMaxCttsOffsetTimeUs;
 
@@ -269,7 +350,7 @@
       mAreGeoTagsAvailable(false),
       mStartTimeOffsetMs(-1) {
 
-    mFd = open(filename, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR);
+    mFd = open(filename, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
     if (mFd >= 0) {
         mInitCheck = OK;
     }
@@ -333,6 +414,10 @@
     snprintf(buffer, SIZE, "       reached EOS: %s\n",
             mReachedEOS? "true": "false");
     result.append(buffer);
+    snprintf(buffer, SIZE, "       frames encoded : %d\n", mStszTableEntries->count());
+    result.append(buffer);
+    snprintf(buffer, SIZE, "       duration encoded : %lld us\n", mTrackDurationUs);
+    result.append(buffer);
     ::write(fd, result.string(), result.size());
     return OK;
 }
@@ -343,7 +428,7 @@
         ALOGE("Attempt to add source AFTER recording is started");
         return UNKNOWN_ERROR;
     }
-    Track *track = new Track(this, source, mTracks.size());
+    Track *track = new Track(this, source, 1 + mTracks.size());
     mTracks.push_back(track);
 
     return OK;
@@ -487,8 +572,16 @@
     CHECK_GT(mTimeScale, 0);
     ALOGV("movie time scale: %d", mTimeScale);
 
-    mStreamableFile = true;
-    mWriteMoovBoxToMemory = false;
+    /*
+     * When the requested file size limit is small, the priority
+     * is to meet the file size limit requirement, rather than
+     * to make the file streamable.
+     */
+    mStreamableFile =
+        (mMaxFileSizeLimitBytes != 0 &&
+         mMaxFileSizeLimitBytes >= kMinStreamableFileSizeInBytes);
+
+    mWriteMoovBoxToMemory = mStreamableFile;
     mMoovBoxBuffer = NULL;
     mMoovBoxBufferOffset = 0;
 
@@ -504,11 +597,16 @@
         mEstimatedMoovBoxSize = estimateMoovBoxSize(bitRate);
     }
     CHECK_GE(mEstimatedMoovBoxSize, 8);
-    lseek64(mFd, mFreeBoxOffset, SEEK_SET);
-    writeInt32(mEstimatedMoovBoxSize);
-    write("free", 4);
+    if (mStreamableFile) {
+        // Reserve a 'free' box only for streamable file
+        lseek64(mFd, mFreeBoxOffset, SEEK_SET);
+        writeInt32(mEstimatedMoovBoxSize);
+        write("free", 4);
+        mMdatOffset = mFreeBoxOffset + mEstimatedMoovBoxSize;
+    } else {
+        mMdatOffset = mOffset;
+    }
 
-    mMdatOffset = mFreeBoxOffset + mEstimatedMoovBoxSize;
     mOffset = mMdatOffset;
     lseek64(mFd, mMdatOffset, SEEK_SET);
     if (mUse32BitOffset) {
@@ -689,7 +787,7 @@
     lseek64(mFd, mOffset, SEEK_SET);
 
     const off64_t moovOffset = mOffset;
-    mWriteMoovBoxToMemory = true;
+    mWriteMoovBoxToMemory = mStreamableFile;
     mMoovBoxBuffer = (uint8_t *) malloc(mEstimatedMoovBoxSize);
     mMoovBoxBufferOffset = 0;
     CHECK(mMoovBoxBuffer != NULL);
@@ -1071,6 +1169,10 @@
         nTotalBytesEstimate += (*it)->getEstimatedTrackSizeBytes();
     }
 
+    if (!mStreamableFile) {
+        // Add 1024 bytes as error tolerance
+        return nTotalBytesEstimate + 1024 >= mMaxFileSizeLimitBytes;
+    }
     // Be conservative in the estimate: do not exceed 95% of
     // the target file limit. For small target file size limit, though,
     // this will not help.
@@ -1140,6 +1242,13 @@
       mTrackDurationUs(0),
       mEstimatedTrackSizeBytes(0),
       mSamplesHaveSameSize(true),
+      mStszTableEntries(new ListTableEntries<uint32_t>(1000, 1)),
+      mStcoTableEntries(new ListTableEntries<uint32_t>(1000, 1)),
+      mCo64TableEntries(new ListTableEntries<off64_t>(1000, 1)),
+      mStscTableEntries(new ListTableEntries<uint32_t>(1000, 3)),
+      mStssTableEntries(new ListTableEntries<uint32_t>(1000, 1)),
+      mSttsTableEntries(new ListTableEntries<uint32_t>(1000, 2)),
+      mCttsTableEntries(new ListTableEntries<uint32_t>(1000, 2)),
       mCodecSpecificData(NULL),
       mCodecSpecificDataSize(0),
       mGotAllCodecSpecificData(false),
@@ -1159,20 +1268,20 @@
 
 void MPEG4Writer::Track::updateTrackSizeEstimate() {
 
-    int64_t stcoBoxSizeBytes = mOwner->use32BitFileOffset()
-                                ? mNumStcoTableEntries * 4
-                                : mNumStcoTableEntries * 8;
-
-    int64_t stszBoxSizeBytes = mSamplesHaveSameSize? 4: (mNumSamples * 4);
+    uint32_t stcoBoxCount = (mOwner->use32BitFileOffset()
+                            ? mStcoTableEntries->count()
+                            : mCo64TableEntries->count());
+    int64_t stcoBoxSizeBytes = stcoBoxCount * 4;
+    int64_t stszBoxSizeBytes = mSamplesHaveSameSize? 4: (mStszTableEntries->count() * 4);
 
     mEstimatedTrackSizeBytes = mMdatSizeBytes;  // media data size
     if (!mOwner->isFileStreamable()) {
         // Reserved free space is not large enough to hold
         // all meta data and thus wasted.
-        mEstimatedTrackSizeBytes += mNumStscTableEntries * 12 +  // stsc box size
-                                    mNumStssTableEntries * 4 +   // stss box size
-                                    mNumSttsTableEntries * 8 +   // stts box size
-                                    mNumCttsTableEntries * 8 +   // ctts box size
+        mEstimatedTrackSizeBytes += mStscTableEntries->count() * 12 +  // stsc box size
+                                    mStssTableEntries->count() * 4 +   // stss box size
+                                    mSttsTableEntries->count() * 8 +   // stts box size
+                                    mCttsTableEntries->count() * 8 +   // ctts box size
                                     stcoBoxSizeBytes +           // stco box size
                                     stszBoxSizeBytes;            // stsz box size
     }
@@ -1181,14 +1290,13 @@
 void MPEG4Writer::Track::addOneStscTableEntry(
         size_t chunkId, size_t sampleId) {
 
-        StscTableEntry stscEntry(chunkId, sampleId, 1);
-        mStscTableEntries.push_back(stscEntry);
-        ++mNumStscTableEntries;
+        mStscTableEntries->add(htonl(chunkId));
+        mStscTableEntries->add(htonl(sampleId));
+        mStscTableEntries->add(htonl(1));
 }
 
 void MPEG4Writer::Track::addOneStssTableEntry(size_t sampleId) {
-    mStssTableEntries.push_back(sampleId);
-    ++mNumStssTableEntries;
+    mStssTableEntries->add(htonl(sampleId));
 }
 
 void MPEG4Writer::Track::addOneSttsTableEntry(
@@ -1197,9 +1305,8 @@
     if (duration == 0) {
         ALOGW("0-duration samples found: %d", sampleCount);
     }
-    SttsTableEntry sttsEntry(sampleCount, duration);
-    mSttsTableEntries.push_back(sttsEntry);
-    ++mNumSttsTableEntries;
+    mSttsTableEntries->add(htonl(sampleCount));
+    mSttsTableEntries->add(htonl(duration));
 }
 
 void MPEG4Writer::Track::addOneCttsTableEntry(
@@ -1208,14 +1315,17 @@
     if (mIsAudio) {
         return;
     }
-    CttsTableEntry cttsEntry(sampleCount, duration);
-    mCttsTableEntries.push_back(cttsEntry);
-    ++mNumCttsTableEntries;
+    mCttsTableEntries->add(htonl(sampleCount));
+    mCttsTableEntries->add(htonl(duration));
 }
 
 void MPEG4Writer::Track::addChunkOffset(off64_t offset) {
-    ++mNumStcoTableEntries;
-    mChunkOffsets.push_back(offset);
+    if (mOwner->use32BitFileOffset()) {
+        uint32_t value = offset;
+        mStcoTableEntries->add(htonl(value));
+    } else {
+        mCo64TableEntries->add(hton64(offset));
+    }
 }
 
 void MPEG4Writer::Track::setTimeScale() {
@@ -1274,16 +1384,26 @@
 MPEG4Writer::Track::~Track() {
     stop();
 
+    delete mStszTableEntries;
+    delete mStcoTableEntries;
+    delete mCo64TableEntries;
+    delete mStscTableEntries;
+    delete mSttsTableEntries;
+    delete mStssTableEntries;
+    delete mCttsTableEntries;
+
+    mStszTableEntries = NULL;
+    mStcoTableEntries = NULL;
+    mCo64TableEntries = NULL;
+    mStscTableEntries = NULL;
+    mSttsTableEntries = NULL;
+    mStssTableEntries = NULL;
+    mCttsTableEntries = NULL;
+
     if (mCodecSpecificData != NULL) {
         free(mCodecSpecificData);
         mCodecSpecificData = NULL;
     }
-
-    while (!mSampleSizes.empty()) {
-        List<uint32_t *>::iterator it = mSampleSizes.begin();
-        delete[] (*it);
-        mSampleSizes.erase(it);
-    }
 }
 
 void MPEG4Writer::Track::initTrackingProgressStatus(MetaData *params) {
@@ -1526,13 +1646,7 @@
     mTrackDurationUs = 0;
     mReachedEOS = false;
     mEstimatedTrackSizeBytes = 0;
-    mNumStcoTableEntries = 0;
-    mNumStssTableEntries = 0;
-    mNumStscTableEntries = 0;
-    mNumSttsTableEntries = 0;
-    mNumCttsTableEntries = 0;
     mMdatSizeBytes = 0;
-
     mMaxChunkDurationUs = 0;
 
     pthread_create(&mThread, &attr, ThreadWrapper, this);
@@ -1868,6 +1982,7 @@
     int64_t currCttsOffsetTimeTicks = 0;   // Timescale based ticks
     int64_t lastCttsOffsetTimeTicks = -1;  // Timescale based ticks
     int32_t cttsSampleCount = 0;           // Sample count in the current ctts table entry
+    uint32_t lastSamplesPerChunk = 0;
 
     if (mIsAudio) {
         prctl(PR_SET_NAME, (unsigned long)"AudioTrackEncoding", 0, 0, 0);
@@ -1878,7 +1993,6 @@
 
     sp<MetaData> meta_data;
 
-    mNumSamples = 0;
     status_t err = OK;
     MediaBuffer *buffer;
     while (!mDone && (err = mSource->read(&buffer)) == OK) {
@@ -1967,7 +2081,7 @@
         CHECK(meta_data->findInt64(kKeyTime, &timestampUs));
 
 ////////////////////////////////////////////////////////////////////////////////
-        if (mNumSamples == 0) {
+        if (mStszTableEntries->count() == 0) {
             mFirstSampleTimeRealUs = systemTime() / 1000;
             mStartTimestampUs = timestampUs;
             mOwner->setStartTimestampUs(mStartTimestampUs);
@@ -2005,7 +2119,7 @@
             currCttsOffsetTimeTicks =
                     (cttsOffsetTimeUs * mTimeScale + 500000LL) / 1000000LL;
             CHECK_LE(currCttsOffsetTimeTicks, 0x0FFFFFFFFLL);
-            if (mNumSamples == 0) {
+            if (mStszTableEntries->count() == 0) {
                 // Force the first ctts table entry to have one single entry
                 // so that we can do adjustment for the initial track start
                 // time offset easily in writeCttsBox().
@@ -2023,7 +2137,7 @@
             }
 
             // Update ctts time offset range
-            if (mNumSamples == 0) {
+            if (mStszTableEntries->count() == 0) {
                 mMinCttsOffsetTimeUs = currCttsOffsetTimeTicks;
                 mMaxCttsOffsetTimeUs = currCttsOffsetTimeTicks;
             } else {
@@ -2057,22 +2171,18 @@
         currDurationTicks =
             ((timestampUs * mTimeScale + 500000LL) / 1000000LL -
                 (lastTimestampUs * mTimeScale + 500000LL) / 1000000LL);
-        CHECK_GE(currDurationTicks, 0ll);
-
-        if ((mNumSamples % kSampleArraySize) == 0) {
-            uint32_t *arr = new uint32_t[kSampleArraySize];
-            CHECK(arr != NULL);
-            mSampleSizes.push_back(arr);
-            mCurrentSampleSizeArr = arr;
+        if (currDurationTicks < 0ll) {
+            ALOGE("timestampUs %lld < lastTimestampUs %lld for %s track",
+                timestampUs, lastTimestampUs, mIsAudio? "Audio": "Video");
+            return UNKNOWN_ERROR;
         }
 
-        mCurrentSampleSizeArr[mNumSamples % kSampleArraySize] = htonl(sampleSize);
-        ++mNumSamples;
-        if (mNumSamples > 2) {
+        mStszTableEntries->add(htonl(sampleSize));
+        if (mStszTableEntries->count() > 2) {
 
             // Force the first sample to have its own stts entry so that
             // we can adjust its value later to maintain the A/V sync.
-            if (mNumSamples == 3 || currDurationTicks != lastDurationTicks) {
+            if (mStszTableEntries->count() == 3 || currDurationTicks != lastDurationTicks) {
                 addOneSttsTableEntry(sampleCount, lastDurationTicks);
                 sampleCount = 1;
             } else {
@@ -2081,7 +2191,7 @@
 
         }
         if (mSamplesHaveSameSize) {
-            if (mNumSamples >= 2 && previousSampleSize != sampleSize) {
+            if (mStszTableEntries->count() >= 2 && previousSampleSize != sampleSize) {
                 mSamplesHaveSameSize = false;
             }
             previousSampleSize = sampleSize;
@@ -2093,7 +2203,7 @@
         lastTimestampUs = timestampUs;
 
         if (isSync != 0) {
-            addOneStssTableEntry(mNumSamples);
+            addOneStssTableEntry(mStszTableEntries->count());
         }
 
         if (mTrackingProgressStatus) {
@@ -2105,7 +2215,12 @@
         if (!hasMultipleTracks) {
             off64_t offset = mIsAvc? mOwner->addLengthPrefixedSample_l(copy)
                                  : mOwner->addSample_l(copy);
-            if (mChunkOffsets.empty()) {
+
+            uint32_t count = (mOwner->use32BitFileOffset()
+                        ? mStcoTableEntries->count()
+                        : mCo64TableEntries->count());
+
+            if (count == 0) {
                 addChunkOffset(offset);
             }
             copy->release();
@@ -2128,9 +2243,9 @@
                     }
                     ++nChunks;
                     if (nChunks == 1 ||  // First chunk
-                        (--(mStscTableEntries.end()))->samplesPerChunk !=
-                         mChunkSamples.size()) {
-                        addOneStscTableEntry(nChunks, mChunkSamples.size());
+                        lastSamplesPerChunk != mChunkSamples.size()) {
+                        lastSamplesPerChunk = mChunkSamples.size();
+                        addOneStscTableEntry(nChunks, lastSamplesPerChunk);
                     }
                     bufferChunk(timestampUs);
                     chunkTimestampUs = timestampUs;
@@ -2148,7 +2263,7 @@
 
     // Last chunk
     if (!hasMultipleTracks) {
-        addOneStscTableEntry(1, mNumSamples);
+        addOneStscTableEntry(1, mStszTableEntries->count());
     } else if (!mChunkSamples.empty()) {
         addOneStscTableEntry(++nChunks, mChunkSamples.size());
         bufferChunk(timestampUs);
@@ -2157,14 +2272,14 @@
     // We don't really know how long the last frame lasts, since
     // there is no frame time after it, just repeat the previous
     // frame's duration.
-    if (mNumSamples == 1) {
+    if (mStszTableEntries->count() == 1) {
         lastDurationUs = 0;  // A single sample's duration
         lastDurationTicks = 0;
     } else {
         ++sampleCount;  // Count for the last sample
     }
 
-    if (mNumSamples <= 2) {
+    if (mStszTableEntries->count() <= 2) {
         addOneSttsTableEntry(1, lastDurationTicks);
         if (sampleCount - 1 > 0) {
             addOneSttsTableEntry(sampleCount - 1, lastDurationTicks);
@@ -2187,7 +2302,7 @@
     sendTrackSummary(hasMultipleTracks);
 
     ALOGI("Received total/0-length (%d/%d) buffers and encoded %d frames. - %s",
-            count, nZeroLengthFrames, mNumSamples, mIsAudio? "audio": "video");
+            count, nZeroLengthFrames, mStszTableEntries->count(), mIsAudio? "audio": "video");
     if (mIsAudio) {
         ALOGI("Audio track drift time: %lld us", mOwner->getDriftTimeUs());
     }
@@ -2199,12 +2314,12 @@
 }
 
 bool MPEG4Writer::Track::isTrackMalFormed() const {
-    if (mSampleSizes.empty()) {                      // no samples written
+    if (mStszTableEntries->count() == 0) {                      // no samples written
         ALOGE("The number of recorded samples is 0");
         return true;
     }
 
-    if (!mIsAudio && mNumStssTableEntries == 0) {  // no sync frames for video
+    if (!mIsAudio && mStssTableEntries->count() == 0) {  // no sync frames for video
         ALOGE("There are no sync frames for video track");
         return true;
     }
@@ -2235,7 +2350,7 @@
 
     mOwner->notify(MEDIA_RECORDER_TRACK_EVENT_INFO,
                     trackNum | MEDIA_RECORDER_TRACK_INFO_ENCODED_FRAMES,
-                    mNumSamples);
+                    mStszTableEntries->count());
 
     {
         // The system delay time excluding the requested initial delay that
@@ -2273,6 +2388,7 @@
 
 void MPEG4Writer::Track::trackProgressStatus(int64_t timeUs, status_t err) {
     ALOGV("trackProgressStatus: %lld us", timeUs);
+
     if (mTrackEveryTimeDurationUs > 0 &&
         timeUs - mPreviousTrackTimeUs >= mTrackEveryTimeDurationUs) {
         ALOGV("Fire time tracking progress status at %lld us", timeUs);
@@ -2586,7 +2702,7 @@
     mOwner->writeInt32(0x07);          // version=0, flags=7
     mOwner->writeInt32(now);           // creation time
     mOwner->writeInt32(now);           // modification time
-    mOwner->writeInt32(mTrackId + 1);  // track id starts with 1
+    mOwner->writeInt32(mTrackId);      // track id starts with 1
     mOwner->writeInt32(0);             // reserved
     int64_t trakDurationUs = getDurationUs();
     int32_t mvhdTimeScale = mOwner->getTimeScale();
@@ -2743,21 +2859,11 @@
 void MPEG4Writer::Track::writeSttsBox() {
     mOwner->beginBox("stts");
     mOwner->writeInt32(0);  // version=0, flags=0
-    mOwner->writeInt32(mNumSttsTableEntries);
-
-    // Compensate for small start time difference from different media tracks
-    List<SttsTableEntry>::iterator it = mSttsTableEntries.begin();
-    CHECK(it != mSttsTableEntries.end() && it->sampleCount == 1);
-    mOwner->writeInt32(it->sampleCount);
-    mOwner->writeInt32(getStartTimeOffsetScaledTime() + it->sampleDuration);
-
-    int64_t totalCount = 1;
-    while (++it != mSttsTableEntries.end()) {
-        mOwner->writeInt32(it->sampleCount);
-        mOwner->writeInt32(it->sampleDuration);
-        totalCount += it->sampleCount;
-    }
-    CHECK_EQ(totalCount, mNumSamples);
+    uint32_t duration;
+    CHECK(mSttsTableEntries->get(duration, 1));
+    duration = htonl(duration);  // Back to host byte order
+    mSttsTableEntries->set(htonl(duration + getStartTimeOffsetScaledTime()), 1);
+    mSttsTableEntries->write(mOwner);
     mOwner->endBox();  // stts
 }
 
@@ -2772,101 +2878,52 @@
     }
 
     // Do not write ctts box when there is no need to have it.
-    if ((mNumCttsTableEntries == 1 &&
-        mCttsTableEntries.begin()->sampleDuration == 0) ||
-        mNumCttsTableEntries == 0) {
+    if (mCttsTableEntries->count() == 0) {
         return;
     }
 
-    ALOGD("ctts box has %d entries with range [%lld, %lld]",
-            mNumCttsTableEntries, mMinCttsOffsetTimeUs, mMaxCttsOffsetTimeUs);
+    ALOGV("ctts box has %d entries with range [%lld, %lld]",
+            mCttsTableEntries->count(), mMinCttsOffsetTimeUs, mMaxCttsOffsetTimeUs);
 
     mOwner->beginBox("ctts");
-    // Version 1 allows to use negative offset time value, but
-    // we are sticking to version 0 for now.
     mOwner->writeInt32(0);  // version=0, flags=0
-    mOwner->writeInt32(mNumCttsTableEntries);
-
-    // Compensate for small start time difference from different media tracks
-    List<CttsTableEntry>::iterator it = mCttsTableEntries.begin();
-    CHECK(it != mCttsTableEntries.end() && it->sampleCount == 1);
-    mOwner->writeInt32(it->sampleCount);
-    mOwner->writeInt32(getStartTimeOffsetScaledTime() +
-            it->sampleDuration - mMinCttsOffsetTimeUs);
-
-    int64_t totalCount = 1;
-    while (++it != mCttsTableEntries.end()) {
-        mOwner->writeInt32(it->sampleCount);
-        mOwner->writeInt32(it->sampleDuration - mMinCttsOffsetTimeUs);
-        totalCount += it->sampleCount;
-    }
-    CHECK_EQ(totalCount, mNumSamples);
+    uint32_t duration;
+    CHECK(mCttsTableEntries->get(duration, 1));
+    duration = htonl(duration);  // Back host byte order
+    mCttsTableEntries->set(htonl(duration + getStartTimeOffsetScaledTime() - mMinCttsOffsetTimeUs), 1);
+    mCttsTableEntries->write(mOwner);
     mOwner->endBox();  // ctts
 }
 
 void MPEG4Writer::Track::writeStssBox() {
     mOwner->beginBox("stss");
     mOwner->writeInt32(0);  // version=0, flags=0
-    mOwner->writeInt32(mNumStssTableEntries);  // number of sync frames
-    for (List<int32_t>::iterator it = mStssTableEntries.begin();
-        it != mStssTableEntries.end(); ++it) {
-        mOwner->writeInt32(*it);
-    }
+    mStssTableEntries->write(mOwner);
     mOwner->endBox();  // stss
 }
 
 void MPEG4Writer::Track::writeStszBox() {
-    ALOGD("writeStszBox for %s track", isAudio()? "Audio": "Video");
     mOwner->beginBox("stsz");
     mOwner->writeInt32(0);  // version=0, flags=0
-    if (mSamplesHaveSameSize) {
-        CHECK(mCurrentSampleSizeArr != 0);
-        mOwner->write(mCurrentSampleSizeArr, 4, 1);  // default sample size
-    } else {
-        mOwner->writeInt32(0);
-    }
-    mOwner->writeInt32(mNumSamples);
-    uint32_t nSamples = mNumSamples;
-    if (!mSamplesHaveSameSize) {
-        for (List<uint32_t *>::iterator it = mSampleSizes.begin();
-            it != mSampleSizes.end(); ++it) {
-            if (nSamples >= kSampleArraySize) {
-                mOwner->write(*it, 4, kSampleArraySize);
-                nSamples -= kSampleArraySize;
-            } else {
-                mOwner->write(*it, 4, nSamples);
-                break;
-            }
-        }
-    }
+    mOwner->writeInt32(0);
+    mStszTableEntries->write(mOwner);
     mOwner->endBox();  // stsz
-    ALOGD("writeStszBox: X");
 }
 
 void MPEG4Writer::Track::writeStscBox() {
     mOwner->beginBox("stsc");
     mOwner->writeInt32(0);  // version=0, flags=0
-    mOwner->writeInt32(mNumStscTableEntries);
-    for (List<StscTableEntry>::iterator it = mStscTableEntries.begin();
-        it != mStscTableEntries.end(); ++it) {
-        mOwner->writeInt32(it->firstChunk);
-        mOwner->writeInt32(it->samplesPerChunk);
-        mOwner->writeInt32(it->sampleDescriptionId);
-    }
+    mStscTableEntries->write(mOwner);
     mOwner->endBox();  // stsc
 }
 
 void MPEG4Writer::Track::writeStcoBox(bool use32BitOffset) {
     mOwner->beginBox(use32BitOffset? "stco": "co64");
     mOwner->writeInt32(0);  // version=0, flags=0
-    mOwner->writeInt32(mNumStcoTableEntries);
-    for (List<off64_t>::iterator it = mChunkOffsets.begin();
-        it != mChunkOffsets.end(); ++it) {
-        if (use32BitOffset) {
-            mOwner->writeInt32(static_cast<int32_t>(*it));
-        } else {
-            mOwner->writeInt64((*it));
-        }
+    if (use32BitOffset) {
+        mStcoTableEntries->write(mOwner);
+    } else {
+        mCo64TableEntries->write(mOwner);
     }
     mOwner->endBox();  // stco or co64
 }
diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp
index f1075b1..05e599b 100644
--- a/media/libstagefright/NuCachedSource2.cpp
+++ b/media/libstagefright/NuCachedSource2.cpp
@@ -298,7 +298,9 @@
 
         Mutex::Autolock autoLock(mLock);
 
-        if (err == ERROR_UNSUPPORTED) {
+        if (err == ERROR_UNSUPPORTED || err == -EPIPE) {
+            // These are errors that are not likely to go away even if we
+            // retry, i.e. the server doesn't support range requests or similar.
             mNumRetriesLeft = 0;
             return;
         } else if (err != OK) {
@@ -317,8 +319,14 @@
     Mutex::Autolock autoLock(mLock);
 
     if (n < 0) {
-        ALOGE("source returned error %ld, %d retries left", n, mNumRetriesLeft);
         mFinalStatus = n;
+        if (n == ERROR_UNSUPPORTED || n == -EPIPE) {
+            // These are errors that are not likely to go away even if we
+            // retry, i.e. the server doesn't support range requests or similar.
+            mNumRetriesLeft = 0;
+        }
+
+        ALOGE("source returned error %ld, %d retries left", n, mNumRetriesLeft);
         mCache->releasePage(page);
     } else if (n == 0) {
         ALOGI("ERROR_END_OF_STREAM");
diff --git a/media/libstagefright/NuMediaExtractor.cpp b/media/libstagefright/NuMediaExtractor.cpp
index 29e1d21..404fa94 100644
--- a/media/libstagefright/NuMediaExtractor.cpp
+++ b/media/libstagefright/NuMediaExtractor.cpp
@@ -110,6 +110,12 @@
         // give us data in a call to MediaSource::read(), unlike its
         // default mode that we use from AwesomePlayer.
         static_cast<WVMExtractor *>(mImpl.get())->setCryptoPluginMode(true);
+    } else if (mImpl->getDrmFlag()) {
+        // For all other drm content, we don't want to expose decrypted
+        // content to Java application.
+        mImpl.clear();
+        mImpl = NULL;
+        return ERROR_UNSUPPORTED;
     }
 
     mDataSource = dataSource;
@@ -120,6 +126,7 @@
 }
 
 status_t NuMediaExtractor::setDataSource(int fd, off64_t offset, off64_t size) {
+
     Mutex::Autolock autoLock(mLock);
 
     if (mImpl != NULL) {
@@ -146,6 +153,31 @@
     return OK;
 }
 
+status_t NuMediaExtractor::setDataSource(const sp<DataSource> &source) {
+    Mutex::Autolock autoLock(mLock);
+
+    if (mImpl != NULL) {
+        return -EINVAL;
+    }
+
+    status_t err = source->initCheck();
+    if (err != OK) {
+        return err;
+    }
+
+    mImpl = MediaExtractor::Create(source);
+
+    if (mImpl == NULL) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    mDataSource = source;
+
+    updateDurationAndBitrate();
+
+    return OK;
+}
+
 void NuMediaExtractor::updateDurationAndBitrate() {
     mTotalBitrate = 0ll;
     mDurationUs = -1ll;
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index a6636a1..d0e306c 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -147,12 +147,13 @@
 // A sort order in which OMX software codecs are first, followed
 // by other (non-OMX) software codecs, followed by everything else.
 static int CompareSoftwareCodecsFirst(
-        const String8 *elem1, const String8 *elem2) {
-    bool isOMX1 = !strncmp(elem1->string(), "OMX.", 4);
-    bool isOMX2 = !strncmp(elem2->string(), "OMX.", 4);
+        const OMXCodec::CodecNameAndQuirks *elem1,
+        const OMXCodec::CodecNameAndQuirks *elem2) {
+    bool isOMX1 = !strncmp(elem1->mName.string(), "OMX.", 4);
+    bool isOMX2 = !strncmp(elem2->mName.string(), "OMX.", 4);
 
-    bool isSoftwareCodec1 = IsSoftwareCodec(elem1->string());
-    bool isSoftwareCodec2 = IsSoftwareCodec(elem2->string());
+    bool isSoftwareCodec1 = IsSoftwareCodec(elem1->mName.string());
+    bool isSoftwareCodec2 = IsSoftwareCodec(elem2->mName.string());
 
     if (isSoftwareCodec1) {
         if (!isSoftwareCodec2) { return -1; }
@@ -182,14 +183,9 @@
         const char *mime,
         bool createEncoder, const char *matchComponentName,
         uint32_t flags,
-        Vector<String8> *matchingCodecs,
-        Vector<uint32_t> *matchingCodecQuirks) {
+        Vector<CodecNameAndQuirks> *matchingCodecs) {
     matchingCodecs->clear();
 
-    if (matchingCodecQuirks) {
-        matchingCodecQuirks->clear();
-    }
-
     const MediaCodecList *list = MediaCodecList::getInstance();
     if (list == NULL) {
         return;
@@ -221,11 +217,13 @@
             ((flags & kHardwareCodecsOnly) &&  !IsSoftwareCodec(componentName)) ||
             (!(flags & (kSoftwareCodecsOnly | kHardwareCodecsOnly)))) {
 
-            matchingCodecs->push(String8(componentName));
+            ssize_t index = matchingCodecs->add();
+            CodecNameAndQuirks *entry = &matchingCodecs->editItemAt(index);
+            entry->mName = String8(componentName);
+            entry->mQuirks = getComponentQuirks(list, matchIndex);
 
-            if (matchingCodecQuirks) {
-                matchingCodecQuirks->push(getComponentQuirks(list, matchIndex));
-            }
+            ALOGV("matching '%s' quirks 0x%08x",
+                  entry->mName.string(), entry->mQuirks);
         }
     }
 
@@ -294,13 +292,14 @@
     bool success = meta->findCString(kKeyMIMEType, &mime);
     CHECK(success);
 
-    Vector<String8> matchingCodecs;
-    Vector<uint32_t> matchingCodecQuirks;
+    Vector<CodecNameAndQuirks> matchingCodecs;
     findMatchingCodecs(
-            mime, createEncoder, matchComponentName, flags,
-            &matchingCodecs, &matchingCodecQuirks);
+            mime, createEncoder, matchComponentName, flags, &matchingCodecs);
 
     if (matchingCodecs.isEmpty()) {
+        ALOGV("No matching codecs! (mime: %s, createEncoder: %s, "
+                "matchComponentName: %s, flags: 0x%x)",
+                mime, createEncoder ? "true" : "false", matchComponentName, flags);
         return NULL;
     }
 
@@ -308,8 +307,8 @@
     IOMX::node_id node = 0;
 
     for (size_t i = 0; i < matchingCodecs.size(); ++i) {
-        const char *componentNameBase = matchingCodecs[i].string();
-        uint32_t quirks = matchingCodecQuirks[i];
+        const char *componentNameBase = matchingCodecs[i].mName.string();
+        uint32_t quirks = matchingCodecs[i].mQuirks;
         const char *componentName = componentNameBase;
 
         AString tmp;
@@ -569,6 +568,8 @@
 
     if ((mFlags & kClientNeedsFramebuffer)
             && !strncmp(mComponentName, "OMX.SEC.", 8)) {
+        // This appears to no longer be needed???
+
         OMX_INDEXTYPE index;
 
         status_t err =
@@ -1214,7 +1215,8 @@
                || format.eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar
                || format.eColorFormat == OMX_COLOR_FormatCbYCrY
                || format.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar
-               || format.eColorFormat == OMX_QCOM_COLOR_FormatYVU420SemiPlanar);
+               || format.eColorFormat == OMX_QCOM_COLOR_FormatYVU420SemiPlanar
+               || format.eColorFormat == OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka);
 
         err = mOMX->setParameter(
                 mNode, OMX_IndexParamVideoPortFormat,
@@ -1776,7 +1778,7 @@
     // Dequeue buffers and send them to OMX
     for (OMX_U32 i = 0; i < def.nBufferCountActual; i++) {
         ANativeWindowBuffer* buf;
-        err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
+        err = native_window_dequeue_buffer_and_wait(mNativeWindow.get(), &buf);
         if (err != 0) {
             ALOGE("dequeueBuffer failed: %s (%d)", strerror(-err), -err);
             break;
@@ -1832,7 +1834,7 @@
     CHECK_EQ((int)info->mStatus, (int)OWNED_BY_US);
     CODEC_LOGV("Calling cancelBuffer on buffer %p", info->mBuffer);
     int err = mNativeWindow->cancelBuffer(
-        mNativeWindow.get(), info->mMediaBuffer->graphicBuffer().get());
+        mNativeWindow.get(), info->mMediaBuffer->graphicBuffer().get(), -1);
     if (err != 0) {
       CODEC_LOGE("cancelBuffer failed w/ error 0x%08x", err);
 
@@ -1846,7 +1848,8 @@
 OMXCodec::BufferInfo* OMXCodec::dequeueBufferFromNativeWindow() {
     // Dequeue the next buffer from the native window.
     ANativeWindowBuffer* buf;
-    int err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
+    int fenceFd = -1;
+    int err = native_window_dequeue_buffer_and_wait(mNativeWindow.get(), &buf);
     if (err != 0) {
       CODEC_LOGE("dequeueBuffer failed w/ error 0x%08x", err);
 
@@ -1950,7 +1953,8 @@
     // on the screen and then been replaced, so an previous video frames are
     // guaranteed NOT to be currently displayed.
     for (int i = 0; i < numBufs + 1; i++) {
-        err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &anb);
+        int fenceFd = -1;
+        err = native_window_dequeue_buffer_and_wait(mNativeWindow.get(), &anb);
         if (err != NO_ERROR) {
             ALOGE("error pushing blank frames: dequeueBuffer failed: %s (%d)",
                     strerror(-err), -err);
@@ -1958,13 +1962,6 @@
         }
 
         sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
-        err = mNativeWindow->lockBuffer(mNativeWindow.get(),
-                buf->getNativeBuffer());
-        if (err != NO_ERROR) {
-            ALOGE("error pushing blank frames: lockBuffer failed: %s (%d)",
-                    strerror(-err), -err);
-            goto error;
-        }
 
         // Fill the buffer with the a 1x1 checkerboard pattern ;)
         uint32_t* img = NULL;
@@ -1985,7 +1982,7 @@
         }
 
         err = mNativeWindow->queueBuffer(mNativeWindow.get(),
-                buf->getNativeBuffer());
+                buf->getNativeBuffer(), -1);
         if (err != NO_ERROR) {
             ALOGE("error pushing blank frames: queueBuffer failed: %s (%d)",
                     strerror(-err), -err);
@@ -2000,7 +1997,7 @@
     if (err != NO_ERROR) {
         // Clean up after an error.
         if (anb != NULL) {
-            mNativeWindow->cancelBuffer(mNativeWindow.get(), anb);
+            mNativeWindow->cancelBuffer(mNativeWindow.get(), anb, -1);
         }
 
         native_window_api_disconnect(mNativeWindow.get(),
@@ -2048,11 +2045,13 @@
 }
 
 void OMXCodec::on_message(const omx_message &msg) {
-    // even in error state, we still need to process EMPTY_BUFFER_DONE
-    // and FILL_BUFFER_DONE event, or we will run into mediaserver crash issue
     if (mState == ERROR) {
+        /*
+         * only drop EVENT messages, EBD and FBD are still
+         * processed for bookkeeping purposes
+         */
         if (msg.type == omx_message::EVENT) {
-            ALOGW("Dropping OMX message - we're in ERROR state.");
+            ALOGW("Dropping OMX EVENT message - we're in ERROR state.");
             return;
         }
     }
@@ -2090,13 +2089,6 @@
 
             // Buffer could not be released until empty buffer done is called.
             if (info->mMediaBuffer != NULL) {
-                if (mIsEncoder &&
-                    (mQuirks & kAvoidMemcopyInputRecordingFrames)) {
-                    // If zero-copy mode is enabled this will send the
-                    // input buffer back to the upstream source.
-                    restorePatchedDataPointer(info);
-                }
-
                 info->mMediaBuffer->release();
                 info->mMediaBuffer = NULL;
             }
@@ -3069,39 +3061,24 @@
         }
 
         bool releaseBuffer = true;
-        if (mIsEncoder && (mQuirks & kAvoidMemcopyInputRecordingFrames)) {
-            CHECK(mOMXLivesLocally && offset == 0);
-
-            OMX_BUFFERHEADERTYPE *header =
-                (OMX_BUFFERHEADERTYPE *)info->mBuffer;
-
-            CHECK(header->pBuffer == info->mData);
-
-            header->pBuffer =
-                (OMX_U8 *)srcBuffer->data() + srcBuffer->range_offset();
-
-            releaseBuffer = false;
-            info->mMediaBuffer = srcBuffer;
-        } else {
-            if (mFlags & kStoreMetaDataInVideoBuffers) {
+        if (mFlags & kStoreMetaDataInVideoBuffers) {
                 releaseBuffer = false;
                 info->mMediaBuffer = srcBuffer;
-            }
+        }
 
-            if (mFlags & kUseSecureInputBuffers) {
+        if (mFlags & kUseSecureInputBuffers) {
                 // Data in "info" is already provided at this time.
 
                 releaseBuffer = false;
 
                 CHECK(info->mMediaBuffer == NULL);
                 info->mMediaBuffer = srcBuffer;
-            } else {
-                CHECK(srcBuffer->data() != NULL) ;
-                memcpy((uint8_t *)info->mData + offset,
-                        (const uint8_t *)srcBuffer->data()
-                            + srcBuffer->range_offset(),
-                        srcBuffer->range_length());
-            }
+        } else {
+            CHECK(srcBuffer->data() != NULL) ;
+            memcpy((uint8_t *)info->mData + offset,
+                    (const uint8_t *)srcBuffer->data()
+                        + srcBuffer->range_offset(),
+                    srcBuffer->range_length());
         }
 
         int64_t lastBufferTimeUs;
@@ -3203,23 +3180,6 @@
         return;
     }
 
-    if (info->mMediaBuffer != NULL) {
-        sp<GraphicBuffer> graphicBuffer = info->mMediaBuffer->graphicBuffer();
-        if (graphicBuffer != 0) {
-            // When using a native buffer we need to lock the buffer before
-            // giving it to OMX.
-            CODEC_LOGV("Calling lockBuffer on %p", info->mBuffer);
-            int err = mNativeWindow->lockBuffer(mNativeWindow.get(),
-                    graphicBuffer.get());
-            if (err != 0) {
-                CODEC_LOGE("lockBuffer failed w/ error 0x%08x", err);
-
-                setState(ERROR);
-                return;
-            }
-        }
-    }
-
     CODEC_LOGV("Calling fillBuffer on buffer %p", info->mBuffer);
     status_t err = mOMX->fillBuffer(mNode, info->mBuffer);
 
@@ -3639,11 +3599,6 @@
         }
         params->setInt64(kKeyTime, startTimeUs);
     }
-    status_t err = mSource->start(params.get());
-
-    if (err != OK) {
-        return err;
-    }
 
     mCodecSpecificDataIndex = 0;
     mInitialBufferSubmit = true;
@@ -3656,13 +3611,42 @@
     mFilledBuffers.clear();
     mPaused = false;
 
+    status_t err;
+    if (mIsEncoder) {
+        // Calling init() before starting its source so that we can configure,
+        // if supported, the source to use exactly the same number of input
+        // buffers as requested by the encoder.
+        if ((err = init()) != OK) {
+            return err;
+        }
+
+        params->setInt32(kKeyNumBuffers, mPortBuffers[kPortIndexInput].size());
+        err = mSource->start(params.get());
+        if (err != OK) {
+            stopOmxComponent_l();
+        }
+        return err;
+    }
+
+    // Decoder case
+    if ((err = mSource->start(params.get())) != OK) {
+        return err;
+    }
     return init();
 }
 
 status_t OMXCodec::stop() {
     CODEC_LOGV("stop mState=%d", mState);
-
     Mutex::Autolock autoLock(mLock);
+    status_t err = stopOmxComponent_l();
+    mSource->stop();
+
+    CODEC_LOGV("stopped in state %d", mState);
+    return err;
+}
+
+status_t OMXCodec::stopOmxComponent_l() {
+    CODEC_LOGV("stopOmxComponent_l mState=%d", mState);
 
     while (isIntermediateState(mState)) {
         mAsyncCompletion.wait(mLock);
@@ -3760,10 +3744,6 @@
         mLeftOverBuffer = NULL;
     }
 
-    mSource->stop();
-
-    CODEC_LOGV("stopped in state %d", mState);
-
     return OK;
 }
 
@@ -4515,7 +4495,7 @@
         const sp<IOMX> &omx,
         const char *mime, bool queryDecoders, bool hwCodecOnly,
         Vector<CodecCapabilities> *results) {
-    Vector<String8> matchingCodecs;
+    Vector<OMXCodec::CodecNameAndQuirks> matchingCodecs;
     results->clear();
 
     OMXCodec::findMatchingCodecs(mime,
@@ -4525,7 +4505,7 @@
             &matchingCodecs);
 
     for (size_t c = 0; c < matchingCodecs.size(); c++) {
-        const char *componentName = matchingCodecs.itemAt(c).string();
+        const char *componentName = matchingCodecs.itemAt(c).mName.string();
 
         results->push();
         CodecCapabilities *caps = &results->editItemAt(results->size() - 1);
@@ -4612,14 +4592,6 @@
     return QueryCodecs(omx, mimeType, queryDecoders, false /*hwCodecOnly*/, results);
 }
 
-void OMXCodec::restorePatchedDataPointer(BufferInfo *info) {
-    CHECK(mIsEncoder && (mQuirks & kAvoidMemcopyInputRecordingFrames));
-    CHECK(mOMXLivesLocally);
-
-    OMX_BUFFERHEADERTYPE *header = (OMX_BUFFERHEADERTYPE *)info->mBuffer;
-    header->pBuffer = (OMX_U8 *)info->mData;
-}
-
 // These are supposed be equivalent to the logic in
 // "audio_channel_out_mask_from_count".
 status_t getOMXChannelMapping(size_t numChannels, OMX_AUDIO_CHANNELTYPE map[]) {
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp
index 7951496..c9ef4d9 100644
--- a/media/libstagefright/StagefrightMetadataRetriever.cpp
+++ b/media/libstagefright/StagefrightMetadataRetriever.cpp
@@ -462,6 +462,7 @@
     int32_t videoWidth = -1;
     int32_t videoHeight = -1;
     int32_t audioBitrate = -1;
+    int32_t rotationAngle = -1;
 
     // The overall duration is the duration of the longest track.
     int64_t maxDurationUs = 0;
@@ -489,6 +490,9 @@
 
                 CHECK(trackMeta->findInt32(kKeyWidth, &videoWidth));
                 CHECK(trackMeta->findInt32(kKeyHeight, &videoHeight));
+                if (!trackMeta->findInt32(kKeyRotation, &rotationAngle)) {
+                    rotationAngle = 0;
+                }
             } else if (!strcasecmp(mime, MEDIA_MIMETYPE_TEXT_3GPP)) {
                 const char *lang;
                 trackMeta->findCString(kKeyMediaLanguage, &lang);
@@ -521,6 +525,9 @@
 
         sprintf(tmp, "%d", videoHeight);
         mMetaData.add(METADATA_KEY_VIDEO_HEIGHT, String8(tmp));
+
+        sprintf(tmp, "%d", rotationAngle);
+        mMetaData.add(METADATA_KEY_VIDEO_ROTATION, String8(tmp));
     }
 
     if (numTracks == 1 && hasAudio && audioBitrate >= 0) {
diff --git a/media/libstagefright/SurfaceMediaSource.cpp b/media/libstagefright/SurfaceMediaSource.cpp
index 300d2fc..c478b28 100644
--- a/media/libstagefright/SurfaceMediaSource.cpp
+++ b/media/libstagefright/SurfaceMediaSource.cpp
@@ -46,13 +46,13 @@
     mNumFramesEncoded(0),
     mFirstFrameTimestamp(0)
 {
-    ALOGV("SurfaceMediaSource::SurfaceMediaSource");
+    ALOGV("SurfaceMediaSource");
 
     if (bufferWidth == 0 || bufferHeight == 0) {
         ALOGE("Invalid dimensions %dx%d", bufferWidth, bufferHeight);
     }
 
-    mBufferQueue = new BufferQueue(true, MIN_UNDEQUEUED_BUFFERS);
+    mBufferQueue = new BufferQueue(true);
     mBufferQueue->setDefaultBufferSize(bufferWidth, bufferHeight);
     mBufferQueue->setSynchronousMode(true);
     mBufferQueue->setConsumerUsageBits(GRALLOC_USAGE_HW_VIDEO_ENCODER |
@@ -77,21 +77,19 @@
 }
 
 SurfaceMediaSource::~SurfaceMediaSource() {
-    ALOGV("SurfaceMediaSource::~SurfaceMediaSource");
-    if (!mStopped) {
-        reset();
-    }
+    ALOGV("~SurfaceMediaSource");
+    CHECK(mStopped == true);
 }
 
 nsecs_t SurfaceMediaSource::getTimestamp() {
-    ALOGV("SurfaceMediaSource::getTimestamp");
+    ALOGV("getTimestamp");
     Mutex::Autolock lock(mMutex);
     return mCurrentTimestamp;
 }
 
 void SurfaceMediaSource::setFrameAvailableListener(
         const sp<FrameAvailableListener>& listener) {
-    ALOGV("SurfaceMediaSource::setFrameAvailableListener");
+    ALOGV("setFrameAvailableListener");
     Mutex::Autolock lock(mMutex);
     mFrameAvailableListener = listener;
 }
@@ -113,6 +111,7 @@
 
 status_t SurfaceMediaSource::setFrameRate(int32_t fps)
 {
+    ALOGV("setFrameRate");
     Mutex::Autolock lock(mMutex);
     const int MAX_FRAME_RATE = 60;
     if (fps < 0 || fps > MAX_FRAME_RATE) {
@@ -128,36 +127,56 @@
 }
 
 int32_t SurfaceMediaSource::getFrameRate( ) const {
+    ALOGV("getFrameRate");
     Mutex::Autolock lock(mMutex);
     return mFrameRate;
 }
 
 status_t SurfaceMediaSource::start(MetaData *params)
 {
-    ALOGV("started!");
+    ALOGV("start");
+
+    Mutex::Autolock lock(mMutex);
 
     mStartTimeNs = 0;
     int64_t startTimeUs;
-    if (params && params->findInt64(kKeyTime, &startTimeUs)) {
-        mStartTimeNs = startTimeUs * 1000;
+    int32_t bufferCount = 0;
+    if (params) {
+        if (params->findInt64(kKeyTime, &startTimeUs)) {
+            mStartTimeNs = startTimeUs * 1000;
+        }
+
+        if (!params->findInt32(kKeyNumBuffers, &bufferCount)) {
+            ALOGE("Failed to find the advertised buffer count");
+            return UNKNOWN_ERROR;
+        }
+
+        if (bufferCount <= 1) {
+            ALOGE("bufferCount %d is too small", bufferCount);
+            return BAD_VALUE;
+        }
+    }
+
+    if (bufferCount != 0) {
+        status_t err = mBufferQueue->setMaxAcquiredBufferCount(bufferCount);
+        if (err != OK) {
+            return err;
+        }
     }
 
     return OK;
 }
 
 
-status_t SurfaceMediaSource::reset()
+status_t SurfaceMediaSource::stop()
 {
-    ALOGV("Reset");
-
+    ALOGV("stop");
     Mutex::Autolock lock(mMutex);
-    // TODO: Add waiting on mFrameCompletedCondition here?
+
     mStopped = true;
-
     mFrameAvailableCondition.signal();
-    mBufferQueue->consumerDisconnect();
 
-    return OK;
+    return mBufferQueue->consumerDisconnect();
 }
 
 sp<MetaData> SurfaceMediaSource::getFormat()
@@ -244,7 +263,8 @@
                 if (mStartTimeNs > 0) {
                     if (item.mTimestamp < mStartTimeNs) {
                         // This frame predates start of record, discard
-                        mBufferQueue->releaseBuffer(item.mBuf, EGL_NO_DISPLAY, EGL_NO_SYNC_KHR);
+                        mBufferQueue->releaseBuffer(item.mBuf, EGL_NO_DISPLAY,
+                                EGL_NO_SYNC_KHR, Fence::NO_FENCE);
                         continue;
                     }
                     mStartTimeNs = item.mTimestamp - mStartTimeNs;
@@ -333,7 +353,8 @@
             ALOGV("Slot %d returned, matches handle = %p", id,
                     mBufferSlot[id]->handle);
 
-            mBufferQueue->releaseBuffer(id, EGL_NO_DISPLAY, EGL_NO_SYNC_KHR);
+            mBufferQueue->releaseBuffer(id, EGL_NO_DISPLAY, EGL_NO_SYNC_KHR,
+                    Fence::NO_FENCE);
 
             buffer->setObserver(0);
             buffer->release();
@@ -374,7 +395,6 @@
     Mutex::Autolock lock(mMutex);
 
     mFrameAvailableCondition.signal();
-    mStopped = true;
 
     for (int i = 0; i < BufferQueue::NUM_BUFFER_SLOTS; i++) {
        mBufferSlot[i] = 0;
diff --git a/media/libstagefright/WVMExtractor.cpp b/media/libstagefright/WVMExtractor.cpp
index 08d2ae2..d94fc65 100644
--- a/media/libstagefright/WVMExtractor.cpp
+++ b/media/libstagefright/WVMExtractor.cpp
@@ -121,6 +121,15 @@
     return mImpl->getCachedDurationUs(finalStatus);
 }
 
+status_t WVMExtractor::getEstimatedBandwidthKbps(int32_t *kbps) {
+    if (mImpl == NULL) {
+        return UNKNOWN_ERROR;
+    }
+
+    return mImpl->getEstimatedBandwidthKbps(kbps);
+}
+
+
 void WVMExtractor::setAdaptiveStreamingMode(bool adaptive) {
     if (mImpl != NULL) {
         mImpl->setAdaptiveStreamingMode(adaptive);
diff --git a/media/libstagefright/chromium_http/Android.mk b/media/libstagefright/chromium_http/Android.mk
index 6ab2a00..2c6d84c 100644
--- a/media/libstagefright/chromium_http/Android.mk
+++ b/media/libstagefright/chromium_http/Android.mk
@@ -6,7 +6,8 @@
 LOCAL_SRC_FILES:=       \
         DataUriSource.cpp \
         ChromiumHTTPDataSource.cpp \
-        support.cpp
+        support.cpp \
+        chromium_http_stub.cpp
 
 LOCAL_C_INCLUDES:= \
         $(TOP)/frameworks/av/media/libstagefright \
@@ -16,10 +17,20 @@
 
 LOCAL_CFLAGS += -Wno-multichar
 
-LOCAL_SHARED_LIBRARIES += libstlport
+LOCAL_SHARED_LIBRARIES += \
+        libstlport \
+        libchromium_net \
+        libutils \
+        libcutils \
+        libstagefright_foundation \
+        libstagefright \
+        libdrmframework
+
 include external/stlport/libstlport.mk
 
 LOCAL_MODULE:= libstagefright_chromium_http
 
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
 endif
diff --git a/media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp b/media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp
index 3f0b2c2..32a0ec8 100644
--- a/media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp
+++ b/media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp
@@ -78,12 +78,8 @@
         disconnect_l();
     }
 
-    if (!(mFlags & kFlagIncognito)) {
-        LOG_PRI(ANDROID_LOG_INFO, LOG_TAG, "connect to %s @%lld", uri, offset);
-    } else {
-        LOG_PRI(ANDROID_LOG_INFO, LOG_TAG,
+    LOG_PRI(ANDROID_LOG_INFO, LOG_TAG,
                 "connect to <URL suppressed> @%lld", offset);
-    }
 
     mURI = uri;
     mContentType = String8("application/octet-stream");
diff --git a/services/audioflinger/ExtendedAudioBufferProvider.h b/media/libstagefright/chromium_http/chromium_http_stub.cpp
similarity index 63%
copy from services/audioflinger/ExtendedAudioBufferProvider.h
copy to media/libstagefright/chromium_http/chromium_http_stub.cpp
index 88279b4..560a61f 100644
--- a/services/audioflinger/ExtendedAudioBufferProvider.h
+++ b/media/libstagefright/chromium_http/chromium_http_stub.cpp
@@ -14,18 +14,20 @@
  * limitations under the License.
  */
 
-#ifndef ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H
-#define ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H
+#include <dlfcn.h>
 
-#include "AudioBufferProvider.h"
+#include <include/chromium_http_stub.h>
+#include <include/ChromiumHTTPDataSource.h>
+#include <include/DataUriSource.h>
 
 namespace android {
 
-class ExtendedAudioBufferProvider : public AudioBufferProvider {
-public:
-    virtual size_t  framesReady() const = 0;  // see description at AudioFlinger.h
-};
+HTTPBase *createChromiumHTTPDataSource(uint32_t flags) {
+    return new ChromiumHTTPDataSource(flags);
+}
 
-}   // namespace android
+DataSource *createDataUriSource(const char *uri) {
+    return new DataUriSource(uri);
+}
 
-#endif  // ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H
+}
diff --git a/media/libstagefright/chromium_http_stub.cpp b/media/libstagefright/chromium_http_stub.cpp
new file mode 100644
index 0000000..cbd8796
--- /dev/null
+++ b/media/libstagefright/chromium_http_stub.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dlfcn.h>
+
+#include <media/stagefright/DataSource.h>
+
+#include "include/chromium_http_stub.h"
+#include "include/HTTPBase.h"
+
+namespace android {
+
+static bool gFirst = true;
+static void *gHandle;
+static Mutex gLibMutex;
+
+HTTPBase *(*gLib_createChromiumHTTPDataSource)(uint32_t flags);
+DataSource *(*gLib_createDataUriSource)(const char *uri);
+
+static bool load_libstagefright_chromium_http() {
+    Mutex::Autolock autoLock(gLibMutex);
+    void *sym;
+
+    if (!gFirst) {
+        return (gHandle != NULL);
+    }
+
+    gFirst = false;
+
+    gHandle = dlopen("libstagefright_chromium_http.so", RTLD_NOW);
+    if (gHandle == NULL) {
+        return false;
+    }
+
+    sym = dlsym(gHandle, "createChromiumHTTPDataSource");
+    if (sym == NULL) {
+        gHandle = NULL;
+        return false;
+    }
+    gLib_createChromiumHTTPDataSource = (HTTPBase *(*)(uint32_t))sym;
+
+    sym = dlsym(gHandle, "createDataUriSource");
+    if (sym == NULL) {
+        gHandle = NULL;
+        return false;
+    }
+    gLib_createDataUriSource = (DataSource *(*)(const char *))sym;
+
+    return true;
+}
+
+HTTPBase *createChromiumHTTPDataSource(uint32_t flags) {
+    if (!load_libstagefright_chromium_http()) {
+        return NULL;
+    }
+
+    return gLib_createChromiumHTTPDataSource(flags);
+}
+
+DataSource *createDataUriSource(const char *uri) {
+    if (!load_libstagefright_chromium_http()) {
+        return NULL;
+    }
+
+    return gLib_createDataUriSource(uri);
+}
+
+}
diff --git a/media/libstagefright/codecs/aacdec/Android.mk b/media/libstagefright/codecs/aacdec/Android.mk
index 91457c5..4dc38a8 100644
--- a/media/libstagefright/codecs/aacdec/Android.mk
+++ b/media/libstagefright/codecs/aacdec/Android.mk
@@ -1,213 +1,28 @@
 LOCAL_PATH:= $(call my-dir)
 
-AAC_LIBRARY = fraunhofer
+include $(CLEAR_VARS)
 
-ifeq ($(AAC_LIBRARY), fraunhofer)
-  include $(CLEAR_VARS)
+LOCAL_SRC_FILES := \
+      SoftAAC2.cpp
 
-  LOCAL_SRC_FILES := \
-          SoftAAC2.cpp
+LOCAL_C_INCLUDES := \
+      frameworks/av/media/libstagefright/include \
+      frameworks/native/include/media/openmax \
+      external/aac/libAACdec/include \
+      external/aac/libPCMutils/include \
+      external/aac/libFDK/include \
+      external/aac/libMpegTPDec/include \
+      external/aac/libSBRdec/include \
+      external/aac/libSYS/include
 
-  LOCAL_C_INCLUDES := \
-          frameworks/av/media/libstagefright/include \
-          frameworks/native/include/media/openmax \
-          external/aac/libAACdec/include \
-          external/aac/libPCMutils/include \
-          external/aac/libFDK/include \
-          external/aac/libMpegTPDec/include \
-          external/aac/libSBRdec/include \
-          external/aac/libSYS/include
+LOCAL_CFLAGS :=
 
-  LOCAL_CFLAGS :=
+LOCAL_STATIC_LIBRARIES := libFraunhoferAAC
 
-  LOCAL_STATIC_LIBRARIES := libFraunhoferAAC
+LOCAL_SHARED_LIBRARIES := \
+      libstagefright_omx libstagefright_foundation libutils libcutils
 
-  LOCAL_SHARED_LIBRARIES := \
-          libstagefright_omx libstagefright_foundation libutils libcutils
+LOCAL_MODULE := libstagefright_soft_aacdec
+LOCAL_MODULE_TAGS := optional
 
-  LOCAL_MODULE := libstagefright_soft_aacdec
-  LOCAL_MODULE_TAGS := optional
-
-  include $(BUILD_SHARED_LIBRARY)
-
-else # pv
-
-  LOCAL_SRC_FILES := \
-          analysis_sub_band.cpp \
-          apply_ms_synt.cpp \
-          apply_tns.cpp \
-          buf_getbits.cpp \
-          byte_align.cpp \
-          calc_auto_corr.cpp \
-          calc_gsfb_table.cpp \
-          calc_sbr_anafilterbank.cpp \
-          calc_sbr_envelope.cpp \
-          calc_sbr_synfilterbank.cpp \
-          check_crc.cpp \
-          dct16.cpp \
-          dct64.cpp \
-          decode_huff_cw_binary.cpp \
-          decode_noise_floorlevels.cpp \
-          deinterleave.cpp \
-          digit_reversal_tables.cpp \
-          dst16.cpp \
-          dst32.cpp \
-          dst8.cpp \
-          esc_iquant_scaling.cpp \
-          extractframeinfo.cpp \
-          fft_rx4_long.cpp \
-          fft_rx4_short.cpp \
-          fft_rx4_tables_fxp.cpp \
-          find_adts_syncword.cpp \
-          fwd_long_complex_rot.cpp \
-          fwd_short_complex_rot.cpp \
-          gen_rand_vector.cpp \
-          get_adif_header.cpp \
-          get_adts_header.cpp \
-          get_audio_specific_config.cpp \
-          get_dse.cpp \
-          get_ele_list.cpp \
-          get_ga_specific_config.cpp \
-          get_ics_info.cpp \
-          get_prog_config.cpp \
-          get_pulse_data.cpp \
-          get_sbr_bitstream.cpp \
-          get_sbr_startfreq.cpp \
-          get_sbr_stopfreq.cpp \
-          get_tns.cpp \
-          getfill.cpp \
-          getgroup.cpp \
-          getics.cpp \
-          getmask.cpp \
-          hcbtables_binary.cpp \
-          huffcb.cpp \
-          huffdecode.cpp \
-          hufffac.cpp \
-          huffspec_fxp.cpp \
-          idct16.cpp \
-          idct32.cpp \
-          idct8.cpp \
-          imdct_fxp.cpp \
-          infoinit.cpp \
-          init_sbr_dec.cpp \
-          intensity_right.cpp \
-          inv_long_complex_rot.cpp \
-          inv_short_complex_rot.cpp \
-          iquant_table.cpp \
-          long_term_prediction.cpp \
-          long_term_synthesis.cpp \
-          lt_decode.cpp \
-          mdct_fxp.cpp \
-          mdct_tables_fxp.cpp \
-          mdst.cpp \
-          mix_radix_fft.cpp \
-          ms_synt.cpp \
-          pns_corr.cpp \
-          pns_intensity_right.cpp \
-          pns_left.cpp \
-          ps_all_pass_filter_coeff.cpp \
-          ps_all_pass_fract_delay_filter.cpp \
-          ps_allocate_decoder.cpp \
-          ps_applied.cpp \
-          ps_bstr_decoding.cpp \
-          ps_channel_filtering.cpp \
-          ps_decode_bs_utils.cpp \
-          ps_decorrelate.cpp \
-          ps_fft_rx8.cpp \
-          ps_hybrid_analysis.cpp \
-          ps_hybrid_filter_bank_allocation.cpp \
-          ps_hybrid_synthesis.cpp \
-          ps_init_stereo_mixing.cpp \
-          ps_pwr_transient_detection.cpp \
-          ps_read_data.cpp \
-          ps_stereo_processing.cpp \
-          pulse_nc.cpp \
-          pv_div.cpp \
-          pv_log2.cpp \
-          pv_normalize.cpp \
-          pv_pow2.cpp \
-          pv_sine.cpp \
-          pv_sqrt.cpp \
-          pvmp4audiodecoderconfig.cpp \
-          pvmp4audiodecoderframe.cpp \
-          pvmp4audiodecodergetmemrequirements.cpp \
-          pvmp4audiodecoderinitlibrary.cpp \
-          pvmp4audiodecoderresetbuffer.cpp \
-          q_normalize.cpp \
-          qmf_filterbank_coeff.cpp \
-          sbr_aliasing_reduction.cpp \
-          sbr_applied.cpp \
-          sbr_code_book_envlevel.cpp \
-          sbr_crc_check.cpp \
-          sbr_create_limiter_bands.cpp \
-          sbr_dec.cpp \
-          sbr_decode_envelope.cpp \
-          sbr_decode_huff_cw.cpp \
-          sbr_downsample_lo_res.cpp \
-          sbr_envelope_calc_tbl.cpp \
-          sbr_envelope_unmapping.cpp \
-          sbr_extract_extended_data.cpp \
-          sbr_find_start_andstop_band.cpp \
-          sbr_generate_high_freq.cpp \
-          sbr_get_additional_data.cpp \
-          sbr_get_cpe.cpp \
-          sbr_get_dir_control_data.cpp \
-          sbr_get_envelope.cpp \
-          sbr_get_header_data.cpp \
-          sbr_get_noise_floor_data.cpp \
-          sbr_get_sce.cpp \
-          sbr_inv_filt_levelemphasis.cpp \
-          sbr_open.cpp \
-          sbr_read_data.cpp \
-          sbr_requantize_envelope_data.cpp \
-          sbr_reset_dec.cpp \
-          sbr_update_freq_scale.cpp \
-          set_mc_info.cpp \
-          sfb.cpp \
-          shellsort.cpp \
-          synthesis_sub_band.cpp \
-          tns_ar_filter.cpp \
-          tns_decode_coef.cpp \
-          tns_inv_filter.cpp \
-          trans4m_freq_2_time_fxp.cpp \
-          trans4m_time_2_freq_fxp.cpp \
-          unpack_idx.cpp \
-          window_tables_fxp.cpp \
-          pvmp4setaudioconfig.cpp \
-
-  LOCAL_CFLAGS := -DAAC_PLUS -DHQ_SBR -DPARAMETRICSTEREO -DOSCL_IMPORT_REF= -DOSCL_EXPORT_REF= -DOSCL_UNUSED_ARG=
-
-  LOCAL_C_INCLUDES := \
-          frameworks/av/media/libstagefright/include \
-
-  LOCAL_ARM_MODE := arm
-
-  LOCAL_MODULE := libstagefright_aacdec
-
-  include $(BUILD_STATIC_LIBRARY)
-
-  ################################################################################
-
-  include $(CLEAR_VARS)
-
-  LOCAL_SRC_FILES := \
-        SoftAAC.cpp
-
-  LOCAL_C_INCLUDES := \
-          frameworks/av/media/libstagefright/include \
-          frameworks/native/include/media/openmax
-
-  LOCAL_CFLAGS := -DOSCL_IMPORT_REF=
-
-  LOCAL_STATIC_LIBRARIES := \
-          libstagefright_aacdec
-
-  LOCAL_SHARED_LIBRARIES := \
-          libstagefright_omx libstagefright_foundation libutils
-
-  LOCAL_MODULE := libstagefright_soft_aacdec
-  LOCAL_MODULE_TAGS := optional
-
-  include $(BUILD_SHARED_LIBRARY)
-
-endif # $(AAC_LIBRARY)
+include $(BUILD_SHARED_LIBRARY)
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC.cpp b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
deleted file mode 100644
index 7c82484..0000000
--- a/media/libstagefright/codecs/aacdec/SoftAAC.cpp
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-//#define LOG_NDEBUG 0
-#define LOG_TAG "SoftAAC"
-#include <utils/Log.h>
-
-#include "SoftAAC.h"
-
-#include "pvmp4audiodecoder_api.h"
-
-#include <media/stagefright/foundation/ADebug.h>
-#include <media/stagefright/foundation/hexdump.h>
-#include <media/stagefright/MediaErrors.h>
-
-namespace android {
-
-template<class T>
-static void InitOMXParams(T *params) {
-    params->nSize = sizeof(T);
-    params->nVersion.s.nVersionMajor = 1;
-    params->nVersion.s.nVersionMinor = 0;
-    params->nVersion.s.nRevision = 0;
-    params->nVersion.s.nStep = 0;
-}
-
-SoftAAC::SoftAAC(
-        const char *name,
-        const OMX_CALLBACKTYPE *callbacks,
-        OMX_PTR appData,
-        OMX_COMPONENTTYPE **component)
-    : SimpleSoftOMXComponent(name, callbacks, appData, component),
-      mConfig(new tPVMP4AudioDecoderExternal),
-      mIsADTS(false),
-      mDecoderBuf(NULL),
-      mInputBufferCount(0),
-      mUpsamplingFactor(2),
-      mAnchorTimeUs(0),
-      mNumSamplesOutput(0),
-      mSignalledError(false),
-      mOutputPortSettingsChange(NONE) {
-    initPorts();
-    CHECK_EQ(initDecoder(), (status_t)OK);
-}
-
-SoftAAC::~SoftAAC() {
-    free(mDecoderBuf);
-    mDecoderBuf = NULL;
-
-    delete mConfig;
-    mConfig = NULL;
-}
-
-void SoftAAC::initPorts() {
-    OMX_PARAM_PORTDEFINITIONTYPE def;
-    InitOMXParams(&def);
-
-    def.nPortIndex = 0;
-    def.eDir = OMX_DirInput;
-    def.nBufferCountMin = kNumInputBuffers;
-    def.nBufferCountActual = def.nBufferCountMin;
-    def.nBufferSize = 8192;
-    def.bEnabled = OMX_TRUE;
-    def.bPopulated = OMX_FALSE;
-    def.eDomain = OMX_PortDomainAudio;
-    def.bBuffersContiguous = OMX_FALSE;
-    def.nBufferAlignment = 1;
-
-    def.format.audio.cMIMEType = const_cast<char *>("audio/aac");
-    def.format.audio.pNativeRender = NULL;
-    def.format.audio.bFlagErrorConcealment = OMX_FALSE;
-    def.format.audio.eEncoding = OMX_AUDIO_CodingAAC;
-
-    addPort(def);
-
-    def.nPortIndex = 1;
-    def.eDir = OMX_DirOutput;
-    def.nBufferCountMin = kNumOutputBuffers;
-    def.nBufferCountActual = def.nBufferCountMin;
-    def.nBufferSize = 8192;
-    def.bEnabled = OMX_TRUE;
-    def.bPopulated = OMX_FALSE;
-    def.eDomain = OMX_PortDomainAudio;
-    def.bBuffersContiguous = OMX_FALSE;
-    def.nBufferAlignment = 2;
-
-    def.format.audio.cMIMEType = const_cast<char *>("audio/raw");
-    def.format.audio.pNativeRender = NULL;
-    def.format.audio.bFlagErrorConcealment = OMX_FALSE;
-    def.format.audio.eEncoding = OMX_AUDIO_CodingPCM;
-
-    addPort(def);
-}
-
-status_t SoftAAC::initDecoder() {
-    memset(mConfig, 0, sizeof(tPVMP4AudioDecoderExternal));
-    mConfig->outputFormat = OUTPUTFORMAT_16PCM_INTERLEAVED;
-    mConfig->aacPlusEnabled = 1;
-
-    // The software decoder doesn't properly support mono output on
-    // AACplus files. Always output stereo.
-    mConfig->desiredChannels = 2;
-
-    UInt32 memRequirements = PVMP4AudioDecoderGetMemRequirements();
-    mDecoderBuf = malloc(memRequirements);
-
-    Int err = PVMP4AudioDecoderInitLibrary(mConfig, mDecoderBuf);
-    if (err != MP4AUDEC_SUCCESS) {
-        ALOGE("Failed to initialize MP4 audio decoder");
-        return UNKNOWN_ERROR;
-    }
-
-    return OK;
-}
-
-OMX_ERRORTYPE SoftAAC::internalGetParameter(
-        OMX_INDEXTYPE index, OMX_PTR params) {
-    switch (index) {
-        case OMX_IndexParamAudioAac:
-        {
-            OMX_AUDIO_PARAM_AACPROFILETYPE *aacParams =
-                (OMX_AUDIO_PARAM_AACPROFILETYPE *)params;
-
-            if (aacParams->nPortIndex != 0) {
-                return OMX_ErrorUndefined;
-            }
-
-            aacParams->nBitRate = 0;
-            aacParams->nAudioBandWidth = 0;
-            aacParams->nAACtools = 0;
-            aacParams->nAACERtools = 0;
-            aacParams->eAACProfile = OMX_AUDIO_AACObjectMain;
-
-            aacParams->eAACStreamFormat =
-                mIsADTS
-                    ? OMX_AUDIO_AACStreamFormatMP4ADTS
-                    : OMX_AUDIO_AACStreamFormatMP4FF;
-
-            aacParams->eChannelMode = OMX_AUDIO_ChannelModeStereo;
-
-            if (!isConfigured()) {
-                aacParams->nChannels = 1;
-                aacParams->nSampleRate = 44100;
-                aacParams->nFrameLength = 0;
-            } else {
-                aacParams->nChannels = mConfig->encodedChannels;
-                aacParams->nSampleRate = mConfig->samplingRate;
-                aacParams->nFrameLength = mConfig->frameLength;
-            }
-
-            return OMX_ErrorNone;
-        }
-
-        case OMX_IndexParamAudioPcm:
-        {
-            OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
-                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
-
-            if (pcmParams->nPortIndex != 1) {
-                return OMX_ErrorUndefined;
-            }
-
-            pcmParams->eNumData = OMX_NumericalDataSigned;
-            pcmParams->eEndian = OMX_EndianBig;
-            pcmParams->bInterleaved = OMX_TRUE;
-            pcmParams->nBitPerSample = 16;
-            pcmParams->ePCMMode = OMX_AUDIO_PCMModeLinear;
-            pcmParams->eChannelMapping[0] = OMX_AUDIO_ChannelLF;
-            pcmParams->eChannelMapping[1] = OMX_AUDIO_ChannelRF;
-
-            if (!isConfigured()) {
-                pcmParams->nChannels = 1;
-                pcmParams->nSamplingRate = 44100;
-            } else {
-                pcmParams->nChannels = mConfig->desiredChannels;
-                pcmParams->nSamplingRate = mConfig->samplingRate;
-            }
-
-            return OMX_ErrorNone;
-        }
-
-        default:
-            return SimpleSoftOMXComponent::internalGetParameter(index, params);
-    }
-}
-
-OMX_ERRORTYPE SoftAAC::internalSetParameter(
-        OMX_INDEXTYPE index, const OMX_PTR params) {
-    switch (index) {
-        case OMX_IndexParamStandardComponentRole:
-        {
-            const OMX_PARAM_COMPONENTROLETYPE *roleParams =
-                (const OMX_PARAM_COMPONENTROLETYPE *)params;
-
-            if (strncmp((const char *)roleParams->cRole,
-                        "audio_decoder.aac",
-                        OMX_MAX_STRINGNAME_SIZE - 1)) {
-                return OMX_ErrorUndefined;
-            }
-
-            return OMX_ErrorNone;
-        }
-
-        case OMX_IndexParamAudioAac:
-        {
-            const OMX_AUDIO_PARAM_AACPROFILETYPE *aacParams =
-                (const OMX_AUDIO_PARAM_AACPROFILETYPE *)params;
-
-            if (aacParams->nPortIndex != 0) {
-                return OMX_ErrorUndefined;
-            }
-
-            if (aacParams->eAACStreamFormat == OMX_AUDIO_AACStreamFormatMP4FF) {
-                mIsADTS = false;
-            } else if (aacParams->eAACStreamFormat
-                        == OMX_AUDIO_AACStreamFormatMP4ADTS) {
-                mIsADTS = true;
-            } else {
-                return OMX_ErrorUndefined;
-            }
-
-            return OMX_ErrorNone;
-        }
-
-        case OMX_IndexParamAudioPcm:
-        {
-            const OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams =
-                (OMX_AUDIO_PARAM_PCMMODETYPE *)params;
-
-            if (pcmParams->nPortIndex != 1) {
-                return OMX_ErrorUndefined;
-            }
-
-            return OMX_ErrorNone;
-        }
-
-        default:
-            return SimpleSoftOMXComponent::internalSetParameter(index, params);
-    }
-}
-
-bool SoftAAC::isConfigured() const {
-    return mInputBufferCount > 0;
-}
-
-void SoftAAC::onQueueFilled(OMX_U32 portIndex) {
-    if (mSignalledError || mOutputPortSettingsChange != NONE) {
-        return;
-    }
-
-    List<BufferInfo *> &inQueue = getPortQueue(0);
-    List<BufferInfo *> &outQueue = getPortQueue(1);
-
-    if (portIndex == 0 && mInputBufferCount == 0) {
-        ++mInputBufferCount;
-
-        BufferInfo *info = *inQueue.begin();
-        OMX_BUFFERHEADERTYPE *header = info->mHeader;
-
-        mConfig->pInputBuffer = header->pBuffer + header->nOffset;
-        mConfig->inputBufferCurrentLength = header->nFilledLen;
-        mConfig->inputBufferMaxLength = 0;
-
-        Int err = PVMP4AudioDecoderConfig(mConfig, mDecoderBuf);
-        if (err != MP4AUDEC_SUCCESS) {
-            mSignalledError = true;
-            notify(OMX_EventError, OMX_ErrorUndefined, err, NULL);
-            return;
-        }
-
-        inQueue.erase(inQueue.begin());
-        info->mOwnedByUs = false;
-        notifyEmptyBufferDone(header);
-
-        notify(OMX_EventPortSettingsChanged, 1, 0, NULL);
-        mOutputPortSettingsChange = AWAITING_DISABLED;
-        return;
-    }
-
-    while (!inQueue.empty() && !outQueue.empty()) {
-        BufferInfo *inInfo = *inQueue.begin();
-        OMX_BUFFERHEADERTYPE *inHeader = inInfo->mHeader;
-
-        BufferInfo *outInfo = *outQueue.begin();
-        OMX_BUFFERHEADERTYPE *outHeader = outInfo->mHeader;
-
-        if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) {
-            inQueue.erase(inQueue.begin());
-            inInfo->mOwnedByUs = false;
-            notifyEmptyBufferDone(inHeader);
-
-            outHeader->nFilledLen = 0;
-            outHeader->nFlags = OMX_BUFFERFLAG_EOS;
-
-            outQueue.erase(outQueue.begin());
-            outInfo->mOwnedByUs = false;
-            notifyFillBufferDone(outHeader);
-            return;
-        }
-
-        if (inHeader->nOffset == 0) {
-            mAnchorTimeUs = inHeader->nTimeStamp;
-            mNumSamplesOutput = 0;
-        }
-
-        size_t adtsHeaderSize = 0;
-        if (mIsADTS) {
-            // skip 30 bits, aac_frame_length follows.
-            // ssssssss ssssiiip ppffffPc ccohCCll llllllll lll?????
-
-            const uint8_t *adtsHeader = inHeader->pBuffer + inHeader->nOffset;
-
-            bool signalError = false;
-            if (inHeader->nFilledLen < 7) {
-                ALOGE("Audio data too short to contain even the ADTS header. "
-                      "Got %ld bytes.", inHeader->nFilledLen);
-                hexdump(adtsHeader, inHeader->nFilledLen);
-                signalError = true;
-            } else {
-                bool protectionAbsent = (adtsHeader[1] & 1);
-
-                unsigned aac_frame_length =
-                    ((adtsHeader[3] & 3) << 11)
-                    | (adtsHeader[4] << 3)
-                    | (adtsHeader[5] >> 5);
-
-                if (inHeader->nFilledLen < aac_frame_length) {
-                    ALOGE("Not enough audio data for the complete frame. "
-                          "Got %ld bytes, frame size according to the ADTS "
-                          "header is %u bytes.",
-                          inHeader->nFilledLen, aac_frame_length);
-                    hexdump(adtsHeader, inHeader->nFilledLen);
-                    signalError = true;
-                } else {
-                    adtsHeaderSize = (protectionAbsent ? 7 : 9);
-
-                    mConfig->pInputBuffer =
-                        (UChar *)adtsHeader + adtsHeaderSize;
-
-                    mConfig->inputBufferCurrentLength =
-                        aac_frame_length - adtsHeaderSize;
-
-                    inHeader->nOffset += adtsHeaderSize;
-                    inHeader->nFilledLen -= adtsHeaderSize;
-                }
-            }
-
-            if (signalError) {
-                mSignalledError = true;
-
-                notify(OMX_EventError, OMX_ErrorStreamCorrupt,
-                       ERROR_MALFORMED, NULL);
-
-                return;
-            }
-        } else {
-            mConfig->pInputBuffer = inHeader->pBuffer + inHeader->nOffset;
-            mConfig->inputBufferCurrentLength = inHeader->nFilledLen;
-        }
-
-        mConfig->inputBufferMaxLength = 0;
-        mConfig->inputBufferUsedLength = 0;
-        mConfig->remainderBits = 0;
-
-        mConfig->pOutputBuffer =
-            reinterpret_cast<Int16 *>(outHeader->pBuffer + outHeader->nOffset);
-
-        mConfig->pOutputBuffer_plus = &mConfig->pOutputBuffer[2048];
-        mConfig->repositionFlag = false;
-
-        Int32 prevSamplingRate = mConfig->samplingRate;
-        Int decoderErr = PVMP4AudioDecodeFrame(mConfig, mDecoderBuf);
-
-        /*
-         * AAC+/eAAC+ streams can be signalled in two ways: either explicitly
-         * or implicitly, according to MPEG4 spec. AAC+/eAAC+ is a dual
-         * rate system and the sampling rate in the final output is actually
-         * doubled compared with the core AAC decoder sampling rate.
-         *
-         * Explicit signalling is done by explicitly defining SBR audio object
-         * type in the bitstream. Implicit signalling is done by embedding
-         * SBR content in AAC extension payload specific to SBR, and hence
-         * requires an AAC decoder to perform pre-checks on actual audio frames.
-         *
-         * Thus, we could not say for sure whether a stream is
-         * AAC+/eAAC+ until the first data frame is decoded.
-         */
-        if (decoderErr == MP4AUDEC_SUCCESS && mInputBufferCount <= 2) {
-            ALOGV("audio/extended audio object type: %d + %d",
-                mConfig->audioObjectType, mConfig->extendedAudioObjectType);
-            ALOGV("aac+ upsampling factor: %d desired channels: %d",
-                mConfig->aacPlusUpsamplingFactor, mConfig->desiredChannels);
-
-            if (mInputBufferCount == 1) {
-                mUpsamplingFactor = mConfig->aacPlusUpsamplingFactor;
-                // Check on the sampling rate to see whether it is changed.
-                if (mConfig->samplingRate != prevSamplingRate) {
-                    ALOGW("Sample rate was %d Hz, but now is %d Hz",
-                            prevSamplingRate, mConfig->samplingRate);
-
-                    // We'll hold onto the input buffer and will decode
-                    // it again once the output port has been reconfigured.
-
-                    // We're going to want to revisit this input buffer, but
-                    // may have already advanced the offset. Undo that if
-                    // necessary.
-                    inHeader->nOffset -= adtsHeaderSize;
-                    inHeader->nFilledLen += adtsHeaderSize;
-
-                    notify(OMX_EventPortSettingsChanged, 1, 0, NULL);
-                    mOutputPortSettingsChange = AWAITING_DISABLED;
-                    return;
-                }
-            } else {  // mInputBufferCount == 2
-                if (mConfig->extendedAudioObjectType == MP4AUDIO_AAC_LC ||
-                    mConfig->extendedAudioObjectType == MP4AUDIO_LTP) {
-                    if (mUpsamplingFactor == 2) {
-                        // The stream turns out to be not aacPlus mode anyway
-                        ALOGW("Disable AAC+/eAAC+ since extended audio object "
-                             "type is %d",
-                             mConfig->extendedAudioObjectType);
-                        mConfig->aacPlusEnabled = 0;
-                    }
-                } else {
-                    if (mUpsamplingFactor == 1) {
-                        // aacPlus mode does not buy us anything, but to cause
-                        // 1. CPU load to increase, and
-                        // 2. a half speed of decoding
-                        ALOGW("Disable AAC+/eAAC+ since upsampling factor is 1");
-                        mConfig->aacPlusEnabled = 0;
-                    }
-                }
-            }
-        }
-
-        size_t numOutBytes =
-            mConfig->frameLength * sizeof(int16_t) * mConfig->desiredChannels;
-
-        if (decoderErr == MP4AUDEC_SUCCESS) {
-            CHECK_LE(mConfig->inputBufferUsedLength, inHeader->nFilledLen);
-
-            inHeader->nFilledLen -= mConfig->inputBufferUsedLength;
-            inHeader->nOffset += mConfig->inputBufferUsedLength;
-        } else {
-            ALOGW("AAC decoder returned error %d, substituting silence",
-                 decoderErr);
-
-            memset(outHeader->pBuffer + outHeader->nOffset, 0, numOutBytes);
-
-            // Discard input buffer.
-            inHeader->nFilledLen = 0;
-
-            // fall through
-        }
-
-        if (decoderErr == MP4AUDEC_SUCCESS || mNumSamplesOutput > 0) {
-            // We'll only output data if we successfully decoded it or
-            // we've previously decoded valid data, in the latter case
-            // (decode failed) we'll output a silent frame.
-
-            if (mUpsamplingFactor == 2) {
-                if (mConfig->desiredChannels == 1) {
-                    memcpy(&mConfig->pOutputBuffer[1024],
-                           &mConfig->pOutputBuffer[2048],
-                           numOutBytes * 2);
-                }
-                numOutBytes *= 2;
-            }
-
-            outHeader->nFilledLen = numOutBytes;
-            outHeader->nFlags = 0;
-
-            outHeader->nTimeStamp =
-                mAnchorTimeUs
-                    + (mNumSamplesOutput * 1000000ll) / mConfig->samplingRate;
-
-            mNumSamplesOutput += mConfig->frameLength * mUpsamplingFactor;
-
-            outInfo->mOwnedByUs = false;
-            outQueue.erase(outQueue.begin());
-            outInfo = NULL;
-            notifyFillBufferDone(outHeader);
-            outHeader = NULL;
-        }
-
-        if (inHeader->nFilledLen == 0) {
-            inInfo->mOwnedByUs = false;
-            inQueue.erase(inQueue.begin());
-            inInfo = NULL;
-            notifyEmptyBufferDone(inHeader);
-            inHeader = NULL;
-        }
-
-        if (decoderErr == MP4AUDEC_SUCCESS) {
-            ++mInputBufferCount;
-        }
-    }
-}
-
-void SoftAAC::onPortFlushCompleted(OMX_U32 portIndex) {
-    if (portIndex == 0) {
-        // Make sure that the next buffer output does not still
-        // depend on fragments from the last one decoded.
-        PVMP4AudioDecoderResetBuffer(mDecoderBuf);
-    }
-}
-
-void SoftAAC::onPortEnableCompleted(OMX_U32 portIndex, bool enabled) {
-    if (portIndex != 1) {
-        return;
-    }
-
-    switch (mOutputPortSettingsChange) {
-        case NONE:
-            break;
-
-        case AWAITING_DISABLED:
-        {
-            CHECK(!enabled);
-            mOutputPortSettingsChange = AWAITING_ENABLED;
-            break;
-        }
-
-        default:
-        {
-            CHECK_EQ((int)mOutputPortSettingsChange, (int)AWAITING_ENABLED);
-            CHECK(enabled);
-            mOutputPortSettingsChange = NONE;
-            break;
-        }
-    }
-}
-
-}  // namespace android
-
-android::SoftOMXComponent *createSoftOMXComponent(
-        const char *name, const OMX_CALLBACKTYPE *callbacks,
-        OMX_PTR appData, OMX_COMPONENTTYPE **component) {
-    return new android::SoftAAC(name, callbacks, appData, component);
-}
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC.h b/media/libstagefright/codecs/aacdec/SoftAAC.h
deleted file mode 100644
index 2e75005..0000000
--- a/media/libstagefright/codecs/aacdec/SoftAAC.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SOFT_AAC_H_
-
-#define SOFT_AAC_H_
-
-#include "SimpleSoftOMXComponent.h"
-
-struct tPVMP4AudioDecoderExternal;
-
-namespace android {
-
-struct SoftAAC : public SimpleSoftOMXComponent {
-    SoftAAC(const char *name,
-            const OMX_CALLBACKTYPE *callbacks,
-            OMX_PTR appData,
-            OMX_COMPONENTTYPE **component);
-
-protected:
-    virtual ~SoftAAC();
-
-    virtual OMX_ERRORTYPE internalGetParameter(
-            OMX_INDEXTYPE index, OMX_PTR params);
-
-    virtual OMX_ERRORTYPE internalSetParameter(
-            OMX_INDEXTYPE index, const OMX_PTR params);
-
-    virtual void onQueueFilled(OMX_U32 portIndex);
-    virtual void onPortFlushCompleted(OMX_U32 portIndex);
-    virtual void onPortEnableCompleted(OMX_U32 portIndex, bool enabled);
-
-private:
-    enum {
-        kNumInputBuffers        = 4,
-        kNumOutputBuffers       = 4,
-    };
-
-    tPVMP4AudioDecoderExternal *mConfig;
-    bool mIsADTS;
-    void *mDecoderBuf;
-
-    size_t mInputBufferCount;
-    size_t mUpsamplingFactor;
-    int64_t mAnchorTimeUs;
-    int64_t mNumSamplesOutput;
-
-    bool mSignalledError;
-
-    enum {
-        NONE,
-        AWAITING_DISABLED,
-        AWAITING_ENABLED
-    } mOutputPortSettingsChange;
-
-    void initPorts();
-    status_t initDecoder();
-    bool isConfigured() const;
-
-    DISALLOW_EVIL_CONSTRUCTORS(SoftAAC);
-};
-
-}  // namespace android
-
-#endif  // SOFT_AAC_H_
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
index ff95f9f..040a7be 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC2.cpp
@@ -26,6 +26,8 @@
 
 #define FILEREAD_MAX_LAYERS 2
 
+#define DRC_DEFAULT_REF_LEVEL 108   /* 108*0.25dB = -27 dB below full scale (typical for movies) */
+
 namespace android {
 
 template<class T>
@@ -110,6 +112,9 @@
         }
     }
     mIsFirst = true;
+    // the decoder will bypass all DRC processing during decode unless any of the DRC parameters
+    //  is set, so here we just reset the DRC reference level to its default value.
+    aacDecoder_SetParam(mAACDecoder, AAC_DRC_REFERENCE_LEVEL, DRC_DEFAULT_REF_LEVEL);
     return status;
 }
 
@@ -320,22 +325,39 @@
             inInfo->mOwnedByUs = false;
             notifyEmptyBufferDone(inHeader);
 
-            // flush out the decoder's delayed data by calling DecodeFrame one more time, with
-            // the AACDEC_FLUSH flag set
-            INT_PCM *outBuffer =
-                    reinterpret_cast<INT_PCM *>(outHeader->pBuffer + outHeader->nOffset);
-            AAC_DECODER_ERROR decoderErr = aacDecoder_DecodeFrame(mAACDecoder,
-                                                                  outBuffer,
-                                                                  outHeader->nAllocLen,
-                                                                  AACDEC_FLUSH);
-            if (decoderErr != AAC_DEC_OK) {
-                mSignalledError = true;
-                notify(OMX_EventError, OMX_ErrorUndefined, decoderErr, NULL);
-                return;
+            if (!mIsFirst) {
+                // flush out the decoder's delayed data by calling DecodeFrame
+                // one more time, with the AACDEC_FLUSH flag set
+                INT_PCM *outBuffer =
+                        reinterpret_cast<INT_PCM *>(
+                                outHeader->pBuffer + outHeader->nOffset);
+
+                AAC_DECODER_ERROR decoderErr =
+                    aacDecoder_DecodeFrame(mAACDecoder,
+                                           outBuffer,
+                                           outHeader->nAllocLen,
+                                           AACDEC_FLUSH);
+
+                if (decoderErr != AAC_DEC_OK) {
+                    mSignalledError = true;
+
+                    notify(OMX_EventError, OMX_ErrorUndefined, decoderErr,
+                           NULL);
+
+                    return;
+                }
+
+                outHeader->nFilledLen =
+                        mStreamInfo->frameSize
+                            * sizeof(int16_t)
+                            * mStreamInfo->numChannels;
+            } else {
+                // Since we never discarded frames from the start, we won't have
+                // to add any padding at the end either.
+
+                outHeader->nFilledLen = 0;
             }
 
-            outHeader->nFilledLen =
-                    mStreamInfo->frameSize * sizeof(int16_t) * mStreamInfo->numChannels;
             outHeader->nFlags = OMX_BUFFERFLAG_EOS;
 
             outQueue.erase(outQueue.begin());
@@ -404,7 +426,9 @@
         }
 
         // Fill and decode
-        INT_PCM *outBuffer = reinterpret_cast<INT_PCM *>(outHeader->pBuffer + outHeader->nOffset);
+        INT_PCM *outBuffer = reinterpret_cast<INT_PCM *>(
+                outHeader->pBuffer + outHeader->nOffset);
+
         bytesValid[0] = inBufferLength[0];
 
         int prevSampleRate = mStreamInfo->sampleRate;
@@ -493,7 +517,8 @@
             // (decode failed) we'll output a silent frame.
             if (mIsFirst) {
                 mIsFirst = false;
-                // the first decoded frame should be discarded to account for decoder delay
+                // the first decoded frame should be discarded to account
+                // for decoder delay
                 numOutBytes = 0;
             }
 
diff --git a/media/libstagefright/codecs/aacdec/aac_mem_funcs.h b/media/libstagefright/codecs/aacdec/aac_mem_funcs.h
deleted file mode 100644
index ce7cb12..0000000
--- a/media/libstagefright/codecs/aacdec/aac_mem_funcs.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Filename: aac_mem_funcs.h
- Funtions:
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-
-#include <string.h>
-
-#ifndef AAC_MEM_FUNCS_H
-#define AAC_MEM_FUNCS_H
-
-#define pv_memset(to, c, n)         memset(to, c, n)
-
-
-#define pv_memcpy(to, from, n)      memcpy(to, from, n)
-#define pv_memmove(to, from, n)     memmove(to, from, n)
-#define pv_memcmp(p, q, n)          memcmp(p, q, n)
-
-
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/analysis_sub_band.cpp b/media/libstagefright/codecs/aacdec/analysis_sub_band.cpp
deleted file mode 100644
index 2786dcc..0000000
--- a/media/libstagefright/codecs/aacdec/analysis_sub_band.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: analysis_sub_band.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 vec[],            Input vector, 32-bit
-    const Int32 *cosTerms,  Cosine Terms
-    Int   maxbands          number of bands used
-    Int32 *scratch_mem      Scratch memory
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement root squared of a number
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "analysis_sub_band.h"
-#include "dst32.h"
-#include "idct32.h"
-#include "mdst.h"
-
-#include "aac_mem_funcs.h"
-#include "pv_audio_type_defs.h"
-#include "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-#ifdef HQ_SBR
-
-
-const Int32 exp_1_5_phi[32] =
-{
-
-    0x7FEA04B6,  0x7F380E1C, 0x7DD6176E, 0x7BC6209F,
-    0x790A29A4,  0x75A6326E, 0x719E3AF3, 0x6CF94326,
-    0x67BD4AFB,  0x61F15269, 0x5B9D5964, 0x54CA5FE4,
-    0x4D8165DE,  0x45CD6B4B, 0x3DB87023, 0x354E7460,
-    0x2C9977FB,  0x23A77AEF, 0x1A837D3A, 0x113A7ED6,
-    0x07D97FC2,  0xFE6E7FFE, 0xF5057F87, 0xEBAB7E60,
-    0xE26D7C89,  0xD9587A06, 0xD07976D9, 0xC7DB7308,
-    0xBF8C6E97,  0xB796698C, 0xB00563EF, 0xA8E25DC8,
-
-};
-
-#endif
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void analysis_sub_band_LC(Int32 vec[64],
-                          Int32 cosine_total[],
-                          Int32 maxBand,
-                          Int32 scratch_mem[][64])
-{
-    Int32 i;
-    Int32 *cosine_term = &scratch_mem[0][0];
-    Int32 *sine_term   = &scratch_mem[0][32];
-
-    Int32 *pt_cos_t;
-
-
-    Int32 *pt_vec    =  &vec[0];
-    Int32 *pt_vec_32 =  &vec[32];
-
-    Int32 *pt_cos = cosine_term;
-    Int32 *pt_sin = sine_term;
-
-    for (i = 8; i != 0; i--)
-    {
-        Int32 tmp1 = *(pt_vec_32++);
-        Int32 tmp3 = *(pt_vec_32++);
-        Int32 tmp2 = *(pt_vec++);
-        Int32 tmp4 = *(pt_vec++);
-        *(pt_cos++) = (tmp1 - tmp2) >> 1;
-        *(pt_cos++) = (tmp3 - tmp4) >> 1;
-        *(pt_sin++) = (tmp1 + tmp2);
-        *(pt_sin++) = (tmp3 + tmp4);
-        tmp1 = *(pt_vec_32++);
-        tmp3 = *(pt_vec_32++);
-        tmp2 = *(pt_vec++);
-        tmp4 = *(pt_vec++);
-        *(pt_cos++) = (tmp1 - tmp2) >> 1;
-        *(pt_cos++) = (tmp3 - tmp4) >> 1;
-        *(pt_sin++) = (tmp1 + tmp2);
-        *(pt_sin++) = (tmp3 + tmp4);
-    }
-
-
-    idct_32(cosine_term, scratch_mem[1]);
-
-    dst_32(sine_term, scratch_mem[1]);
-
-    pt_cos  = cosine_term;
-    pt_sin  = sine_term;
-
-    pt_cos_t  = cosine_total;
-
-    for (i = 0; i < maxBand; i += 4)
-    {
-        *(pt_cos_t++) = (*(pt_cos++) + *(pt_sin++));
-        *(pt_cos_t++) = (-*(pt_cos++) + *(pt_sin++));
-        *(pt_cos_t++) = (-*(pt_cos++) - *(pt_sin++));
-        *(pt_cos_t++) = (*(pt_cos++) - *(pt_sin++));
-    }
-
-    pt_cos_t  = &cosine_total[maxBand];
-
-    for (i = (32 - maxBand); i != 0; i--)
-    {
-        *(pt_cos_t++) =   0;
-    }
-}
-
-
-#ifdef HQ_SBR
-
-
-void analysis_sub_band(Int32 vec[64],
-                       Int32 cosine_total[],
-                       Int32 sine_total[],
-                       Int32 maxBand,
-                       Int32 scratch_mem[][64])
-{
-    Int32 i;
-    Int32 *sine_term1   = &scratch_mem[0][0];
-    Int32 *sine_term2   = &scratch_mem[0][32];
-
-    Int32 temp1;
-    Int32 temp2;
-    Int32 temp3;
-    Int32 temp4;
-
-    const Int32 *pt_exp;
-    Int32 exp_1_5;
-
-    Int32 *pt_vec    =  &vec[0];
-    Int32 *pt_vec_32 =  &vec[32];
-
-    Int32 *pt_cos1 = pt_vec;
-    Int32 *pt_sin1 = sine_term1;
-    Int32 *pt_cos2 = pt_vec_32;
-    Int32 *pt_sin2 = sine_term2;
-
-
-    pv_memcpy(sine_term1, vec, 64*sizeof(*vec));
-
-    mdst_32(sine_term1, scratch_mem[1]);
-    mdst_32(sine_term2, scratch_mem[1]);
-
-    mdct_32(&vec[ 0]);
-    mdct_32(&vec[32]);
-
-    pt_cos1 = &vec[ 0];
-    pt_cos2 = &vec[32];
-
-
-    pt_sin1 = sine_term1;
-    pt_sin2 = sine_term2;
-
-    pt_vec     = cosine_total;
-    pt_vec_32  =   sine_total;
-    pt_exp  = exp_1_5_phi;
-
-    temp3 = (*(pt_cos1++) - *(pt_sin2++));
-    temp4 = (*(pt_sin1++) + *(pt_cos2++));
-
-    for (i = 0; i < maxBand; i += 2)
-    {
-
-        exp_1_5 = *(pt_exp++);
-        temp1    =  cmplx_mul32_by_16(temp3,  temp4, exp_1_5);
-        temp2    =  cmplx_mul32_by_16(temp4, -temp3, exp_1_5);
-
-        *(pt_vec++)    =  shft_lft_1(temp1);
-        *(pt_vec_32++) =  shft_lft_1(temp2);
-
-        temp3 = (*(pt_cos1++) + *(pt_sin2++));
-        temp4 = (*(pt_sin1++) - *(pt_cos2++));
-
-        exp_1_5 = *(pt_exp++);
-        temp1    =  cmplx_mul32_by_16(temp3,  temp4, exp_1_5);
-        temp2    =  cmplx_mul32_by_16(temp4, -temp3, exp_1_5);
-
-        *(pt_vec++)    =  shft_lft_1(temp1);
-        *(pt_vec_32++) =  shft_lft_1(temp2);
-
-        temp3 = (*(pt_cos1++) - *(pt_sin2++));
-        temp4 = (*(pt_sin1++) + *(pt_cos2++));
-    }
-
-
-    pt_cos1  = &cosine_total[maxBand];  /* in the chance that maxband is not even */
-    pt_sin1  = &sine_total[maxBand];
-
-    for (i = (32 - maxBand); i != 0; i--)
-    {
-        *(pt_cos1++) =  0;
-        *(pt_sin1++) =  0;
-    }
-
-}
-
-
-#endif
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/analysis_sub_band.h b/media/libstagefright/codecs/aacdec/analysis_sub_band.h
deleted file mode 100644
index 815456c..0000000
--- a/media/libstagefright/codecs/aacdec/analysis_sub_band.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/analysis_sub_band.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef ANALYSIS_SUB_BAND_H
-#define ANALYSIS_SUB_BAND_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    void analysis_sub_band_LC(Int32 vec[64],
-    Int32 cosine_total[],
-    Int32 maxBand,
-    Int32 scratch_mem[][64]);
-
-#ifdef HQ_SBR
-
-
-    void analysis_sub_band(Int32 vec[64],
-                           Int32 cosine_total[],
-                           Int32 sine_total[],
-                           Int32 maxBand,
-                           Int32 scratch_mem[][64]);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* ANALYSIS_SUB_BAND_H */
diff --git a/media/libstagefright/codecs/aacdec/apply_ms_synt.cpp b/media/libstagefright/codecs/aacdec/apply_ms_synt.cpp
deleted file mode 100644
index ab36c6a..0000000
--- a/media/libstagefright/codecs/aacdec/apply_ms_synt.cpp
+++ /dev/null
@@ -1,454 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/apply_ms_synt.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Updated pseudocode to correct capitalized format for the IF
- FOR and WHILE statements.
-
- Description: Delete local variable start_indx, since it is never used.
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    pFrameInfo = Pointer to structure that holds information about each group.
-                 (long block flag, number of windows, scalefactor bands
-                  per group, etc.)
-                 [const pFrameInfo * const]
-
-    group      = Array that contains indexes of the
-                 first window in the next group.
-                 [const Int *, length 8]
-
-    mask_map   = Array that denotes whether M/S stereo is turned on for
-                 each grouped scalefactor band.
-                 [const Int *, length MAX_SFB]
-
-    codebook_map = Array that denotes which Huffman codebook was used for
-                   the encoding of each grouped scalefactor band.
-                   [const Int *, length MAX_SFB]
-
-    coefLeft = Array containing the fixed-point spectral coefficients
-                       for the left channel.
-                       [Int32 *, length 1024]
-
-    coefRight = Array containing the fixed-point spectral coefficients
-                        for the right channel.
-                        [Int32 *, length 1024]
-
-    q_formatLeft = The Q-format for the left channel's fixed-point spectral
-                   coefficients, on a per-scalefactor band, non-grouped basis.
-                   [Int *, length MAX_SFB]
-
-    q_formatRight = The Q-format for the right channel's fixed-point spectral
-                    coefficients, on a per-scalefactor band, non-grouped basis.
-                    [Int *, length MAX_SFB]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    coefLeft  = Contains the new spectral information.
-
-    coefRight = Contains the new spectral information.
-
-    q_formatLeft      = Q-format may be updated with changed to fixed-point
-                        data in coefLeft.
-
-    q_formatRight     = Q-format may be updated with changed to fixed-point
-                        data in coefRight.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function steps through all of the tools that are applied on a
- scalefactor band basis.
-
- The use of M/S stereo is checked for.  For M/S decoding to take
- place, ms_mask_map must be TRUE for that particular SFB, AND the Huffman
- codebook used must be < NOISE_HCB.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.7.1   M/S stereo
-        Subpart 4.6.2     ScaleFactors
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pCoefRight = coefRight;
-    pCoefLeft = coefLeft;
-
-    window_start = 0;
-    tot_sfb = 0;
-
-    coef_per_win = pFrameInfo->coef_per_win[0];
-
-    sfb_per_win = pFrameInfo->sfb_per_win[0];
-
-    DO
-
-        pBand     = pFrameInfo->win_sfb_top[window_start];
-
-        partition = *(pGroup);
-
-        pGroup = pGroup + 1;
-
-        band_start = 0;
-
-        wins_in_group = (partition - window_start);
-
-        FOR (sfb = sfb_per_win; sfb > 0; sfb--)
-
-            band_stop = *(pBand);
-
-            pBand = pBand + 1;
-
-            codebook = *(pCodebookMap);
-
-            pCodebookMap = pCodebookMap + 1;
-
-            mask_enabled = *(pMaskMap);
-
-            pMaskMap = pMaskMap + 1;
-
-            IF (codebook < NOISE_HCB)
-            THEN
-                IF (mask_enabled != FALSE)
-                THEN
-                    band_length = band_stop - band_start;
-
-                    CALL
-                        ms_synt(
-                            wins_in_group,
-                            coef_per_win,
-                            sfb_per_win,
-                            band_length,
-                           &(pCoefLeft[band_start]),
-                           &(pCoefRight[band_start]),
-                           &(q_formatLeft[tot_sfb]),
-                           &(q_formatRight[tot_sfb]) );
-
-                    MODIFYING
-                        &(pCoefLeft[band_start]),
-                        &(pCoefRight[band_start]),
-                        &(q_formatLeft[tot_sfb]),
-                        &(q_formatRight[tot_sfb])
-
-                    RETURNING
-                        None
-                ENDIF
-            ENDIF
-            band_start = band_stop;
-
-            tot_sfb = tot_sfb + 1;
-
-        ENDFOR
-
-        pCoefRight = pCoefRight + coef_per_win * wins_in_group;
-        pCoefLeft  = pCoefLeft  + coef_per_win * wins_in_group;
-
-        wins_in_group = wins_in_group - 1;
-
-        tot_sfb = tot_sfb + sfb_per_win * wins_in_group;
-
-        window_start = partition;
-
-    WHILE (partition < pFrameInfo->num_win);
-
-    return;
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "apply_ms_synt.h"
-#include "e_huffmanconst.h"
-#include "ms_synt.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void apply_ms_synt(
-    const FrameInfo * const pFrameInfo,
-    const Int        group[],
-    const Bool       mask_map[],
-    const Int        codebook_map[],
-    Int32      coefLeft[],
-    Int32      coefRight[],
-    Int        q_formatLeft[MAXBANDS],
-    Int        q_formatRight[MAXBANDS])
-
-{
-
-    Int32   *pCoefRight;
-
-    Int32   *pCoefLeft;
-
-    Int     tot_sfb;
-    Int     sfb;
-
-    Int     band_length;
-    Int     band_start;
-    Int     band_stop;
-    Int     coef_per_win;
-
-    Int     codebook;
-    Int     partition;
-    Int     window_start;
-
-    Int     sfb_per_win;
-    Int     wins_in_group;
-
-    const Int16 *pBand;
-    const Int   *pCodebookMap  = codebook_map;
-    const Int   *pGroup        = group;
-    const Bool  *pMaskMap      = mask_map;
-
-    Bool mask_enabled;
-
-    pCoefRight = coefRight;
-    pCoefLeft = coefLeft;
-
-    window_start = 0;
-    tot_sfb = 0;
-
-    /*
-     * Each window in the frame should have the same number of coef's,
-     * so coef_per_win is constant in all the loops
-     */
-    coef_per_win = pFrameInfo->coef_per_win[0];
-
-    /*
-     * Because the number of scalefactor bands per window should be
-     * constant for each frame, sfb_per_win can be determined outside
-     * of the loop.
-     *
-     * For 44.1 kHz sampling rate   sfb_per_win = 14 for short windows
-     *                              sfb_per_win = 49 for long  windows
-     */
-
-    sfb_per_win = pFrameInfo->sfb_per_win[0];
-
-    do
-    {
-        pBand     = pFrameInfo->win_sfb_top[window_start];
-
-        /*
-         * Partition is equal to the first window in the next group
-         *
-         * { Group 0    }{      Group 1      }{    Group 2 }{Group 3}
-         * [win 0][win 1][win 2][win 3][win 4][win 5][win 6][win 7]
-         *
-         * pGroup[0] = 2
-         * pGroup[1] = 5
-         * pGroup[2] = 7
-         * pGroup[3] = 8
-         */
-
-        partition = *(pGroup++);
-
-        band_start = 0;
-
-        wins_in_group = (partition - window_start);
-
-        for (sfb = sfb_per_win; sfb > 0; sfb--)
-        {
-            /* band is offset table, band_stop is last coef in band */
-            band_stop = *(pBand++);
-
-            codebook = *(pCodebookMap++);
-
-            mask_enabled = *(pMaskMap++);
-
-            /*
-             * When a codebook < NOISE_HCB is found, apply M/S to that
-             * scalefactorband.
-             *
-             * Example...  sfb[3] == NOISE_HCB
-             *
-             * [ Group 1                                      ]
-             * [win 0                 ][win 1                 ]
-             * [0][1][2][X][4][5][6][7][0][1][2][X][4][5][6][7]
-             *
-             * The for(sfb) steps through the sfb's 0-7 in win 0.
-             *
-             * Finding sfb[3]'s codebook == NOISE_HCB, the code
-             * steps through all the windows in the group (they share
-             * the same scalefactors) and replaces that sfb with noise.
-             */
-
-            if (codebook < NOISE_HCB)
-            {
-                if (mask_enabled != FALSE)
-                {
-                    band_length = band_stop - band_start;
-
-                    ms_synt(
-                        wins_in_group,
-                        coef_per_win,
-                        sfb_per_win,
-                        band_length,
-                        &(pCoefLeft[band_start]),
-                        &(pCoefRight[band_start]),
-                        &(q_formatLeft[tot_sfb]),
-                        &(q_formatRight[tot_sfb]));
-                }
-            }
-            band_start = band_stop;
-
-            tot_sfb++;
-
-        } /* for (sfb) */
-
-        /*
-         * Increment pCoefRight and pCoefLeft by
-         * coef_per_win * the number of windows
-         */
-
-        pCoefRight += coef_per_win * wins_in_group;
-        pCoefLeft  += coef_per_win * wins_in_group--;
-
-        /*
-         * Increase tot_sfb by sfb_per_win times the number of windows minus 1.
-         * The minus 1 comes from the fact that tot_sfb is already pointing
-         * to the first sfb in the 2nd window of the group.
-         */
-        tot_sfb += sfb_per_win * wins_in_group;
-
-        window_start = partition;
-
-    }
-    while (partition < pFrameInfo->num_win);
-
-    /* pFrameInfo->num_win = 1 for long windows, 8 for short_windows */
-
-    return;
-
-} /* apply_ms_synt() */
-
-
diff --git a/media/libstagefright/codecs/aacdec/apply_ms_synt.h b/media/libstagefright/codecs/aacdec/apply_ms_synt.h
deleted file mode 100644
index ed7fb7a..0000000
--- a/media/libstagefright/codecs/aacdec/apply_ms_synt.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/apply_ms_synt.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file includes the function declaration for apply_ms_synt().
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef APPLY_MS_SYNT_H
-#define APPLY_MS_SYNT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_frameinfo.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void apply_ms_synt(
-    const FrameInfo * const pFrameInfo,
-    const Int        group[],
-    const Bool       mask_map[],
-    const Int        codebook_map[],
-    Int32      coefLeft[],
-    Int32      coefRight[],
-    Int        q_formatLeft[MAXBANDS],
-    Int        q_formatRight[MAXBANDS]);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/apply_tns.cpp b/media/libstagefright/codecs/aacdec/apply_tns.cpp
deleted file mode 100644
index 96ecd27..0000000
--- a/media/libstagefright/codecs/aacdec/apply_tns.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: apply_tns.c
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    coef =       Array of input coefficients.
-                 [Int32 *, length 1024]
-
-    q_format   = Array of q-formats, one per scalefactor band, for the
-                 entire frame.  In the case of tns_inv_filter, only the
-                 first element is used, since the input to tns_inv_filter
-                 is all of the same q-format.
-                 [Int * const, length MAX_SFB]
-
-    pFrameInfo = Pointer to structure that holds information about each group.
-                 (long block flag, number of windows, scalefactor bands
-                  per group, etc.)
-                 [const FrameInfo * const]
-
-    pTNS_frame_info = pointer to structure containing the details on each
-                      TNS filter (order, filter coefficients,
-                      coefficient res., etc.)
-                      [TNS_frame_info * const]
-
-    inverse_flag   = TRUE  if inverse filter is to be applied.
-                     FALSE if forward filter is to be applied.
-                     [Bool]
-
-    scratch_Int_buffer = Pointer to scratch memory to store the
-                           filter's state memory.  Used by both
-                           tns_inv_filter.
-                           [Int *, length TNS_MAX_ORDER]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    coef[]   = TNS altered data.
-    q_format = q-formats in TNS scalefactor bands may be modified.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    This function applies either the TNS forward or TNS inverse filter, based
-    on inverse_flag being FALSE or TRUE, respectively.
-
-    For the TNS forward filter, the data fed into tns_ar_filter is normalized
-    all to the same q-format.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    The input, coef, should use all 32-bits, else the scaling by tns_ar_filter
-    may eliminate the data.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.8 (Temporal Noise Shaping)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    NO PSEUDO-CODE
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_tns_frame_info.h"
-#include "s_tnsfilt.h"
-#include "s_frameinfo.h"
-#include "tns_inv_filter.h"
-#include "tns_ar_filter.h"
-#include "apply_tns.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void apply_tns(
-    Int32                  coef[],
-    Int                    q_format[],
-    const FrameInfo      * const pFrameInfo,
-    TNS_frame_info * const pTNS_frame_info,
-    const Bool                   inverse_flag,
-    Int32                  scratch_Int_buffer[])
-{
-    Int num_tns_bands;
-    Int num_TNS_coef;
-
-    Int f;
-
-    Int tempInt;
-    Int tempInt2;
-
-    Int sfb_per_win;
-    Int sfbWidth;
-
-    Int coef_per_win;
-    Int min_q;
-    Int win;
-
-    Int32 *pCoef = coef;
-    Int32 *pTempCoef;
-
-    Int   *pStartQformat = q_format;
-
-    Int   *pQformat;
-    Int32 *pLpcCoef;
-
-    Int sfb_offset;
-
-    const Int16 *pWinSfbTop;
-
-    TNSfilt *pFilt;
-
-    coef_per_win = pFrameInfo->coef_per_win[0];
-    sfb_per_win  = pFrameInfo->sfb_per_win[0];
-
-    win = 0;
-
-    pLpcCoef = pTNS_frame_info->lpc_coef;
-
-    pFilt = pTNS_frame_info->filt;
-
-    do
-    {
-        for (f = pTNS_frame_info->n_filt[win]; f > 0; f--)
-        {
-            /* Skip to the next filter if the order is 0 */
-            tempInt = pFilt->order;
-
-            if (tempInt > 0)
-            {
-                /*
-                 * Do not call tns_ar_filter or tns_inv_filter
-                 * if the difference
-                 * between start_coef and stop_stop is <= 0.
-                 *
-                 */
-                num_TNS_coef = (pFilt->stop_coef - pFilt->start_coef);
-
-                if (num_TNS_coef > 0)
-                {
-                    if (inverse_flag != FALSE)
-                    {
-                        tns_inv_filter(
-                            &(pCoef[pFilt->start_coef]),
-                            num_TNS_coef,
-                            pFilt->direction,
-                            pLpcCoef,
-                            pFilt->q_lpc,
-                            pFilt->order,
-                            scratch_Int_buffer);
-                    }
-                    else
-                    {
-                        num_tns_bands = (pFilt->stop_band - pFilt->start_band);
-
-                        /*
-                         * pQformat is initialized only once.
-                         *
-                         * Here is how TNS is applied on scalefactor bands
-                         *
-                         * [0][1][2][3][4][5][6][7][8]
-                         *  |                        \
-                         * start_band               stop_band
-                         *
-                         * In this example, TNS would be applied to 8
-                         * scalefactor bands, 0-7.
-                         *
-                         * pQformat is initially set to &(pStartQformat[8])
-                         *
-                         * 1st LOOP
-                         *      Entry: pQformat = &(pStartQformat[8])
-                         *
-                         *      pQformat is pre-decremented 8 times in the
-                         *      search for min_q
-                         *
-                         *      Exit:  pQformat = &(pStartQformat[0])
-                         *
-                         * 2nd LOOP
-                         *      Entry: pQformat = &(pStartQformat[0])
-                         *
-                         *      pQformat is post-incremented 8 times in the
-                         *      normalization of the data loop.
-                         *
-                         *      Exit:  pQformat = &(pStartQformat[8]
-                         *
-                         *
-                         * shift_amt = tns_ar_filter(...)
-                         *
-                         * 3rd LOOP
-                         *      Entry: pQformat = &(pStartQformat[8])
-                         *
-                         *      pQformat is pre-decremented 8 times in the
-                         *      adjustment of the q-format to min_q - shift_amt
-                         *
-                         *      Exit:  pQformat = &(pStartQformat[0])
-                         *
-                         */
-
-                        pQformat =
-                            &(pStartQformat[pFilt->stop_band]);
-
-                        /*
-                         * Scan the array of q-formats and find the minimum over
-                         * the range where the filter is to be applied.
-                         *
-                         * At the end of this scan,
-                         * pQformat = &(q-format[pFilt->start_band]);
-                         *
-                         */
-
-                        min_q = INT16_MAX;
-
-                        for (tempInt = num_tns_bands; tempInt > 0; tempInt--)
-                        {
-                            tempInt2 = *(--pQformat);
-
-                            if (tempInt2 < min_q)
-                            {
-                                min_q = tempInt2;
-                            }
-                        } /* for(tempInt = num_bands; tempInt > 0; tempInt--)*/
-
-                        /*
-                         * Set up the pointers so we can index into coef[]
-                         * on a scalefactor band basis.
-                         */
-                        tempInt = pFilt->start_band;
-
-                        tempInt--;
-
-                        /* Initialize sfb_offset and pWinSfbTop */
-                        if (tempInt >= 0)
-                        {
-                            pWinSfbTop =
-                                &(pFrameInfo->win_sfb_top[win][tempInt]);
-
-                            sfb_offset = *(pWinSfbTop++);
-                        }
-                        else
-                        {
-                            pWinSfbTop = pFrameInfo->win_sfb_top[win];
-                            sfb_offset = 0;
-                        }
-
-                        pTempCoef = pCoef + pFilt->start_coef;
-
-                        /* Scale the data in the TNS bands to min_q q-format */
-                        for (tempInt = num_tns_bands; tempInt > 0; tempInt--)
-                        {
-                            sfbWidth  = *(pWinSfbTop++) - sfb_offset;
-
-                            sfb_offset += sfbWidth;
-
-                            tempInt2 = *(pQformat++) - min_q;
-
-                            /*
-                             * This should zero out the data in one scalefactor
-                             * band if it is so much less than the neighboring
-                             * scalefactor bands.
-                             *
-                             * The only way this "should" happen is if one
-                             * scalefactor band contains zero data.
-                             *
-                             * Zero data can be of any q-format, but we always
-                             * set it very high to avoid the zero-data band being
-                             * picked as the one to normalize to in the scan for
-                             * min_q.
-                             *
-                             */
-                            if (tempInt2 > 31)
-                            {
-                                tempInt2 = 31;
-                            }
-
-                            for (sfbWidth >>= 2; sfbWidth > 0; sfbWidth--)
-                            {
-                                *(pTempCoef++) >>= tempInt2;
-                                *(pTempCoef++) >>= tempInt2;
-                                *(pTempCoef++) >>= tempInt2;
-                                *(pTempCoef++) >>= tempInt2;
-                            }
-
-                        } /* for(tempInt = num_bands; tempInt > 0; tempInt--)*/
-
-                        tempInt2 =
-                            tns_ar_filter(
-                                &(pCoef[pFilt->start_coef]),
-                                num_TNS_coef,
-                                pFilt->direction,
-                                pLpcCoef,
-                                pFilt->q_lpc,
-                                pFilt->order);
-
-                        /*
-                         * Update the q-format for all the scalefactor bands
-                         * taking into account the adjustment caused by
-                         * tns_ar_filter
-                         */
-
-                        min_q -= tempInt2;
-
-                        for (tempInt = num_tns_bands; tempInt > 0; tempInt--)
-                        {
-                            *(--pQformat) = min_q;
-                        }
-
-                    } /* if (inverse_flag != FALSE) */
-
-                } /* if (num_TNS_coef > 0) */
-
-                pLpcCoef += pFilt->order;
-
-            } /* if (tempInt > 0) */
-
-            pFilt++;
-
-        } /* for (f = pTNSinfo->n_filt; f > 0; f--) */
-
-        pCoef += coef_per_win;
-        pStartQformat += sfb_per_win;
-
-        win++;
-
-    }
-    while (win < pFrameInfo->num_win);
-
-    return;
-
-} /* apply_tns() */
diff --git a/media/libstagefright/codecs/aacdec/apply_tns.h b/media/libstagefright/codecs/aacdec/apply_tns.h
deleted file mode 100644
index 85fb851..0000000
--- a/media/libstagefright/codecs/aacdec/apply_tns.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/apply_tns.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Updated per review comments.
-
- Description: Changed function prototype to mirror changes made in apply_tns.c
-
- Description: The scratch memory was mistakenly declared here as type "Int32"
- It should have been "Int"
-
- Who:                       Date:
- Description:
-
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file contains the function declaration for
- apply_tns.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef APPLY_TNS_H
-#define APPLY_TNS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_tns_frame_info.h"
-#include "s_frameinfo.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void apply_tns(
-        Int32                  coef[],
-        Int                    q_format[],
-        const FrameInfo      * const pFrameInfo,
-        TNS_frame_info * const pTNS_frame_info,
-        const Bool                   inverse_flag,
-        Int32                  scratch_Int_buffer[]);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/bit_reversal_swap.h b/media/libstagefright/codecs/aacdec/bit_reversal_swap.h
deleted file mode 100644
index 2669f87..0000000
--- a/media/libstagefright/codecs/aacdec/bit_reversal_swap.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Pathname: ./include/bit_reversal_swap.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Changed definitions from Int to Int32 for Data[]
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function bit_reversal_swap()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef BIT_REVERSAL_SWAP_H
-#define BIT_REVERSAL_SWAP_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-extern const Int Index_64_a[];
-extern const Int Index_64_b[];
-
-extern const Int Index_512_a[];
-extern const Int Index_512_b[];
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void bit_reversal_swap(
-    Int32        Data[],
-    const Int *pIndex_a,
-    const Int *pIndex_b);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* BIT_REVERSAL_SWAP_H */
diff --git a/media/libstagefright/codecs/aacdec/buf_getbits.cpp b/media/libstagefright/codecs/aacdec/buf_getbits.cpp
deleted file mode 100644
index 34f4f60..0000000
--- a/media/libstagefright/codecs/aacdec/buf_getbits.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: buf_getbits.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Arguments:   hBitBuf Handle to Bitbuffer
-              n       Number of bits to read
-
- Return:      bits
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-            Reads n bits from Bitbuffer
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#include    "buf_getbits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-UInt32 buf_getbits(BIT_BUFFER * hBitBuf, Int32 n)
-{
-
-    /* read bits from MSB side */
-    if (hBitBuf->buffered_bits <= 16)
-    {
-        hBitBuf->buffer_word    = (hBitBuf->buffer_word << 16) | (*(hBitBuf->char_ptr++) << 8);
-        hBitBuf->buffer_word   |= *(hBitBuf->char_ptr++);
-        hBitBuf->buffered_bits += 16;
-    }
-
-    hBitBuf->buffered_bits -= n;
-    hBitBuf->nrBitsRead    += n;
-
-    return ((hBitBuf->buffer_word >> hBitBuf->buffered_bits) & ((1 << n) - 1));
-
-}
-
-
-UInt32 buf_get_1bit(BIT_BUFFER * hBitBuf)
-{
-
-    /* read bits from MSB side */
-    if (hBitBuf->buffered_bits <= 16)
-    {
-        hBitBuf->buffer_word    = (hBitBuf->buffer_word << 16) | (*(hBitBuf->char_ptr++) << 8);
-        hBitBuf->buffer_word   |= *(hBitBuf->char_ptr++);
-        hBitBuf->buffered_bits += 16;
-    }
-
-    hBitBuf->buffered_bits--;
-    hBitBuf->nrBitsRead++;
-
-    return ((hBitBuf->buffer_word >> hBitBuf->buffered_bits) & 1);
-
-}
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/buf_getbits.h b/media/libstagefright/codecs/aacdec/buf_getbits.h
deleted file mode 100644
index 1b5d252..0000000
--- a/media/libstagefright/codecs/aacdec/buf_getbits.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Filename: buf_getbits.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef BUF_GETBITS_H
-#define BUF_GETBITS_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "s_bit_buffer.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    UInt32 buf_getbits(BIT_BUFFER * hBitBuf, Int32 n);
-
-    UInt32 buf_get_1bit(BIT_BUFFER * hBitBuf);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/buffer_normalization.h b/media/libstagefright/codecs/aacdec/buffer_normalization.h
deleted file mode 100644
index 031216a..0000000
--- a/media/libstagefright/codecs/aacdec/buffer_normalization.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/buffer_normalization.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Changed definitions from Int to Int32 for IO_buffer[]
-
- Description:  Added copyrigth notice, added 'const' definitions to function
-
- Who:                          Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function buffer_normalization()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef BUFFER_NORMALIZATION_H
-#define BUFFER_NORMALIZATION_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define     ALL_ZEROS_BUFFER     -100
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void buffer_normalization(
-    Int     q_format,
-    Int32   IO_buffer[],
-    const Int     buffer_size,
-    Int   * const pExp);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* BUFFER_NORMALIZATION_H */
diff --git a/media/libstagefright/codecs/aacdec/byte_align.cpp b/media/libstagefright/codecs/aacdec/byte_align.cpp
deleted file mode 100644
index e75c79e..0000000
--- a/media/libstagefright/codecs/aacdec/byte_align.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pInputStream = pointer to a BITS structure that holds information
-                   regarding the input stream.
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    pInputStream->usedBits is rounded up to a number that represents the next
-    byte boundary.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- Makes the input stream structure pointed to align to the next byte boundary.
- If it is already at a byte boundary it is left alone.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-  This function shall not use global or static variables.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-void byte_align(
-    BITS  *pInputStream)
-
-    MODIFYING(pInputStream->usedBits = pInputStream->usedBits +
-                (pInputStream->usedBits + 7) % 8)
-
-    RETURN(nothing)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-
- STACK USAGE:
-
-     where:
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES:
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-
-
-#include "pv_audio_type_defs.h"
-#include "s_bits.h"
-#include "ibstream.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*
- * A negative number was used for this mask so that it works on both
- * 16-bit or 32-bit machines. The mask must be cast to unsigned int to
- * work with TI compiler, ver 1.80.
- */
-#define BYTE_ALIGN_MASK    ((UInt)(-8))
-
-#define BYTE_ALIGN_ROUNDUP  7
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void byte_align(
-    BITS  *pInputStream)
-{
-    /*
-     * Round up to the next byte by adding 7 and masking off with
-     * FFF8 or FFFFFFF8. The masking operation is a faster way to
-     * perform modulo arithmetic if the number is a power of 2.
-     *
-     * This code is the same as
-     * pInputStream->usedBits += (pInputStream->usedBits + 7) % 8
-     */
-    pInputStream->usedBits += BYTE_ALIGN_ROUNDUP;
-    pInputStream->usedBits &= BYTE_ALIGN_MASK;
-
-    return;
-}
-
diff --git a/media/libstagefright/codecs/aacdec/calc_auto_corr.cpp b/media/libstagefright/codecs/aacdec/calc_auto_corr.cpp
deleted file mode 100644
index ee32398..0000000
--- a/media/libstagefright/codecs/aacdec/calc_auto_corr.cpp
+++ /dev/null
@@ -1,416 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: calc_auto_corr.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#ifdef AAC_PLUS
-
-
-#include    "calc_auto_corr.h"
-#include    "aac_mem_funcs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#include    "fxp_mul32.h"
-#include    "pv_normalize.h"
-
-#define N   2
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-
-void calc_auto_corr_LC(struct ACORR_COEFS *ac,
-                       Int32  realBuf[][32],
-                       Int32  bd,
-                       Int32  len)
-{
-    Int32 j;
-    Int32 temp1;
-    Int32 temp3;
-    Int32 temp5;
-
-    int64_t temp_r01r;
-    int64_t temp_r02r;
-    int64_t temp_r11r;
-    int64_t temp_r12r;
-    int64_t temp_r22r;
-    int64_t max = 0;
-
-
-    temp1 = (realBuf[ 0][bd]) >> N;
-    temp3 = (realBuf[-1][bd]) >> N;
-    temp5 = (realBuf[-2][bd]) >> N;
-
-
-    temp_r11r = fxp_mac64_Q31(0, temp3, temp3);   /* [j-1]*[j-1]  */
-    temp_r12r = fxp_mac64_Q31(0, temp3, temp5);   /* [j-1]*[j-2]  */
-    temp_r22r = fxp_mac64_Q31(0, temp5, temp5);   /* [j-2]*[j-2]  */
-
-    temp_r01r = 0;
-    temp_r02r = 0;
-
-    for (j = 1; j < len; j++)
-    {
-        temp_r01r = fxp_mac64_Q31(temp_r01r, temp1, temp3);    /* [j  ]*[j-1]  */
-        temp_r02r = fxp_mac64_Q31(temp_r02r, temp1, temp5);    /* [j  ]*[j-2]  */
-        temp_r11r = fxp_mac64_Q31(temp_r11r, temp1, temp1);    /* [j-1]*[j-1]  */
-
-        temp5 = temp3;
-        temp3 = temp1;
-        temp1 = (realBuf[j][bd]) >> N;
-    }
-
-
-    temp_r22r += temp_r11r;
-    temp_r12r += temp_r01r;          /* [j-1]*[j-2]  */
-
-    temp_r22r  = fxp_mac64_Q31(temp_r22r, -temp3, temp3);
-
-    temp_r01r = fxp_mac64_Q31(temp_r01r, temp1, temp3);
-    temp_r02r = fxp_mac64_Q31(temp_r02r, temp1, temp5);
-
-    max  |= temp_r01r ^(temp_r01r >> 63);
-    max  |= temp_r02r ^(temp_r02r >> 63);
-    max  |= temp_r11r;
-    max  |= temp_r12r ^(temp_r12r >> 63);
-    max  |= temp_r22r;
-
-    if (max)
-    {
-        temp1 = (UInt32)(max >> 32);
-        if (temp1)
-        {
-            temp3 = 33 - pv_normalize(temp1);
-            ac->r01r = (Int32)(temp_r01r >> temp3);
-            ac->r02r = (Int32)(temp_r02r >> temp3);
-            ac->r11r = (Int32)(temp_r11r >> temp3);
-            ac->r12r = (Int32)(temp_r12r >> temp3);
-            ac->r22r = (Int32)(temp_r22r >> temp3);
-
-        }
-        else
-        {
-            temp3 = pv_normalize(((UInt32)max) >> 1) - 2;
-
-            if (temp3 > 0)
-            {
-                ac->r01r = (Int32)(temp_r01r << temp3);
-                ac->r02r = (Int32)(temp_r02r << temp3);
-                ac->r11r = (Int32)(temp_r11r << temp3);
-                ac->r12r = (Int32)(temp_r12r << temp3);
-                ac->r22r = (Int32)(temp_r22r << temp3);
-            }
-            else
-            {
-                temp3 = -temp3;
-                ac->r01r = (Int32)(temp_r01r >> temp3);
-                ac->r02r = (Int32)(temp_r02r >> temp3);
-                ac->r11r = (Int32)(temp_r11r >> temp3);
-                ac->r12r = (Int32)(temp_r12r >> temp3);
-                ac->r22r = (Int32)(temp_r22r >> temp3);
-            }
-
-        }
-
-        /*
-         *  ac->det = ac->r11r*ac->r22r - rel*(ac->r12r*ac->r12r);
-         */
-        /* 1/(1 + 1e-6) == 1 - 1e-6 */
-        /* 2^-20 == 1e-6 */
-        ac->det  = fxp_mul32_Q30(ac->r12r, ac->r12r);
-
-        ac->det -= ac->det >> 20;
-
-        ac->det  = fxp_mul32_Q30(ac->r11r, ac->r22r) - ac->det;
-    }
-    else
-    {
-        pv_memset((void *)ac, 0, sizeof(struct ACORR_COEFS));
-    }
-
-
-}
-
-
-#ifdef HQ_SBR
-
-
-void calc_auto_corr(struct ACORR_COEFS *ac,
-                    Int32  realBuf[][32],
-                    Int32  imagBuf[][32],
-                    Int32  bd,
-                    Int32  len)
-{
-
-
-    Int32 j;
-    Int32 temp1;
-    Int32 temp2;
-    Int32 temp3;
-    Int32 temp4;
-    Int32 temp5;
-    Int32 temp6;
-
-    int64_t accu1 = 0;
-    int64_t accu2 = 0;
-    int64_t accu3 = 0;
-    int64_t accu4 = 0;
-    int64_t accu5 = 0;
-
-
-    int64_t temp_r12r;
-    int64_t temp_r12i;
-    int64_t temp_r22r;
-    int64_t max = 0;
-
-
-    temp1 = realBuf[0  ][bd] >> N;
-    temp2 = imagBuf[0  ][bd] >> N;
-    temp3 = realBuf[0-1][bd] >> N;
-    temp4 = imagBuf[0-1][bd] >> N;
-    temp5 = realBuf[0-2][bd] >> N;
-    temp6 = imagBuf[0-2][bd] >> N;
-
-    temp_r22r =  fxp_mac64_Q31(0, temp5, temp5);
-    temp_r22r =  fxp_mac64_Q31(temp_r22r, temp6, temp6);
-    temp_r12r =  fxp_mac64_Q31(0, temp3, temp5);
-    temp_r12r =  fxp_mac64_Q31(temp_r12r, temp4, temp6);
-    temp_r12i = -fxp_mac64_Q31(0, temp3, temp6);
-    temp_r12i =  fxp_mac64_Q31(temp_r12i, temp4, temp5);
-
-    for (j = 1; j < len; j++)
-    {
-        accu1  = fxp_mac64_Q31(accu1, temp3, temp3);
-        accu1  = fxp_mac64_Q31(accu1, temp4, temp4);
-        accu2  = fxp_mac64_Q31(accu2, temp1, temp3);
-        accu2  = fxp_mac64_Q31(accu2, temp2, temp4);
-        accu3  = fxp_mac64_Q31(accu3, temp2, temp3);
-        accu3  = fxp_mac64_Q31(accu3, -temp1, temp4);
-        accu4  = fxp_mac64_Q31(accu4, temp1, temp5);
-        accu4  = fxp_mac64_Q31(accu4, temp2, temp6);
-        accu5  = fxp_mac64_Q31(accu5, temp2, temp5);
-        accu5  = fxp_mac64_Q31(accu5, -temp1, temp6);
-
-        temp5 = temp3;
-        temp6 = temp4;
-        temp3 = temp1;
-        temp4 = temp2;
-        temp1 = realBuf[j][bd] >> N;
-        temp2 = imagBuf[j][bd] >> N;
-    }
-
-
-    temp_r22r += accu1;
-    temp_r12r += accu2;
-    temp_r12i += accu3;
-
-
-    accu1  = fxp_mac64_Q31(accu1, temp3, temp3);
-    accu1  = fxp_mac64_Q31(accu1, temp4, temp4);
-    accu2  = fxp_mac64_Q31(accu2, temp1, temp3);
-    accu2  = fxp_mac64_Q31(accu2, temp2, temp4);
-    accu3  = fxp_mac64_Q31(accu3, temp2, temp3);
-    accu3  = fxp_mac64_Q31(accu3, -temp1, temp4);
-    accu4  = fxp_mac64_Q31(accu4, temp1, temp5);
-    accu4  = fxp_mac64_Q31(accu4, temp2, temp6);
-    accu5  = fxp_mac64_Q31(accu5, temp2, temp5);
-    accu5  = fxp_mac64_Q31(accu5, -temp1, temp6);
-
-
-    max  |= accu5 ^(accu5 >> 63);
-    max  |= accu4 ^(accu4 >> 63);
-    max  |= accu3 ^(accu3 >> 63);
-    max  |= accu2 ^(accu2 >> 63);
-    max  |= accu1;
-    max  |= temp_r12r ^(temp_r12r >> 63);
-    max  |= temp_r12i ^(temp_r12i >> 63);
-    max  |= temp_r22r;
-
-    if (max)
-    {
-
-        temp1 = (UInt32)(max >> 32);
-        if (temp1)
-        {
-            temp1 = 34 - pv_normalize(temp1);
-            ac->r11r = (Int32)(accu1 >> temp1);
-            ac->r01r = (Int32)(accu2 >> temp1);
-            ac->r01i = (Int32)(accu3 >> temp1);
-            ac->r02r = (Int32)(accu4 >> temp1);
-            ac->r02i = (Int32)(accu5 >> temp1);
-            ac->r12r = (Int32)(temp_r12r >> temp1);
-            ac->r12i = (Int32)(temp_r12i >> temp1);
-            ac->r22r = (Int32)(temp_r22r >> temp1);
-        }
-        else
-        {
-            temp1 = pv_normalize(((UInt32)max) >> 1) - 3;
-
-            if (temp1 > 0)
-            {
-                ac->r11r = (Int32)(accu1 << temp1);
-                ac->r01r = (Int32)(accu2 << temp1);
-                ac->r01i = (Int32)(accu3 << temp1);
-                ac->r02r = (Int32)(accu4 << temp1);
-                ac->r02i = (Int32)(accu5 << temp1);
-                ac->r12r = (Int32)(temp_r12r << temp1);
-                ac->r12i = (Int32)(temp_r12i << temp1);
-                ac->r22r = (Int32)(temp_r22r << temp1);
-            }
-            else
-            {
-                temp1 = -temp1;
-                ac->r11r = (Int32)(accu1 >> temp1);
-                ac->r01r = (Int32)(accu2 >> temp1);
-                ac->r01i = (Int32)(accu3 >> temp1);
-                ac->r02r = (Int32)(accu4 >> temp1);
-                ac->r02i = (Int32)(accu5 >> temp1);
-                ac->r12r = (Int32)(temp_r12r >> temp1);
-                ac->r12i = (Int32)(temp_r12i >> temp1);
-                ac->r22r = (Int32)(temp_r22r >> temp1);
-            }
-
-        }
-
-        /*
-         *  ac->det = ac->r11r*ac->r22r - rel*(ac->r12r*ac->r12r);
-         */
-        /* 1/(1 + 1e-6) == 1 - 1e-6 */
-        /* 2^-20 == 1e-6 */
-
-        ac->det =   fxp_mul32_Q29(ac->r12i, ac->r12i);
-        ac->det =   fxp_mac32_Q29(ac->r12r, ac->r12r, ac->det);
-
-        ac->det -= ac->det >> 20;
-
-        ac->det =  -fxp_msu32_Q29(ac->r11r, ac->r22r, ac->det);
-
-    }
-    else
-    {
-        pv_memset((void *)ac, 0, sizeof(struct ACORR_COEFS));
-    }
-
-}
-
-#endif
-
-
-
-
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/calc_auto_corr.h b/media/libstagefright/codecs/aacdec/calc_auto_corr.h
deleted file mode 100644
index 0f0dae2..0000000
--- a/media/libstagefright/codecs/aacdec/calc_auto_corr.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: calc_auto_corr.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
- ----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef CALC_AUTO_CORR_H
-#define CALC_AUTO_CORR_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-struct ACORR_COEFS
-{
-    Int32  r11r;
-    Int32  r01r;
-    Int32  r02r;
-    Int32  r12r;
-    Int32  r22r;
-#ifdef HQ_SBR
-    Int32  r01i;
-    Int32  r02i;
-    Int32  r12i;
-#endif
-    Int32  det;
-};
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void calc_auto_corr_LC(struct ACORR_COEFS *ac,
-    Int32  realBuf[][32],
-    Int32  bd,
-    Int32  len);
-
-
-#ifdef HQ_SBR
-
-    void calc_auto_corr(struct ACORR_COEFS *ac,
-                        Int32  realBuf[][32],
-                        Int32  imagBuf[][32],
-                        Int32  bd,
-                        Int32  len);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/calc_gsfb_table.cpp b/media/libstagefright/codecs/aacdec/calc_gsfb_table.cpp
deleted file mode 100644
index 4047502..0000000
--- a/media/libstagefright/codecs/aacdec/calc_gsfb_table.cpp
+++ /dev/null
@@ -1,267 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/calc_gsfb_table.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description: (1) Modified to bring in-line with PV standards
-              (2) Removed if(pFrameInfo->islong), only short windows will
-                  call this routine from getics.c
-
- Description: Modified per review comments
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pFrameInfo  = pointer to structure that holds information for current
-                  frame. Data type FrameInfo
-
-    group[]     = array that contains the grouping information of short
-                  windows (stop index of windows in each group).
-                  Data type Int
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    pFrameInfo -> frame_sfb_top   contains the cumulative bandwidth of
-                                    scalefactor bands in each group
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function is only invoked when short windows are present. It calculates
- the number of groups in one frame, and the scalefactor bandwidth of each
- scalefactor band in each group.
- All windows within one group share the same scalefactors and are interleaved
- on a scalefactor band basis. Within each group, the actual length of one
- scalefactor band equals to the number of windows times the number of
- coefficients in a regular scalefactor band.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall replace the contents of pFrameInfo->frame_sfb_top
- with the cumulative bandwidth of each scalefactor band in each group
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-    Subpart 4       p54.    4.5.2.3.2   decoding process
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    offset      = 0;
-    group_idx   = 0;
-
-    DO
-        pFrameInfo->group_len[group_idx] = group[group_idx] - offset;
-        offset = group[group_idx];
-        group_idx++;
-
-    WHILE (offset < NUM_SHORT_WINDOWS);
-
-
-    pFrameInfo->num_groups = group_idx;
-
-    pFrameSfbTop = pFrameInfo->frame_sfb_top;
-    offset = 0;
-
-    FOR (group_idx = 0; group_idx < pFrameInfo->num_groups; group_idx++)
-
-        len = pFrameInfo->group_len[group_idx];
-
-        FOR (sfb = 0; sfb < pFrameInfo->sfb_per_win[group_idx]; sfb++)
-
-            offset += pFrameInfo->sfb_width_128[sfb] * len;
-            *pFrameSfbTop++ = offset;
-
-        ENDFOR
-
-    ENDFOR
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "huffman.h"
-#include    "aac_mem_funcs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void  calc_gsfb_table(
-    FrameInfo   *pFrameInfo,
-    Int         group[])
-{
-
-    Int      group_idx;
-    Int      offset;
-    Int     *pFrameSfbTop;
-    Int     *pSfbWidth128;
-    Int      sfb;
-    Int      nsfb;
-    Int      len;
-    Int      ngroups;
-
-    /* clear out the default values set by infoinit */
-    /* */
-    pv_memset(pFrameInfo->frame_sfb_top,
-              0,
-              MAXBANDS*sizeof(pFrameInfo->frame_sfb_top[0]));
-    /* */
-    /* first calculate the group length*/
-    offset      = 0;
-    ngroups     = 0;
-    do
-    {
-        pFrameInfo->group_len[ngroups] = group[ngroups] - offset;
-        offset = group[ngroups];
-        ngroups++;
-
-    }
-    while (offset < NUM_SHORT_WINDOWS);
-
-
-    /* calculate the cumulative scalefactor bandwidth for one frame */
-    pFrameInfo->num_groups = ngroups;
-
-    pFrameSfbTop = pFrameInfo->frame_sfb_top;
-    offset = 0;
-
-
-    for (group_idx = 0; group_idx < ngroups; group_idx++)
-    {
-        len  = pFrameInfo->group_len[  group_idx];
-        nsfb = pFrameInfo->sfb_per_win[group_idx];
-
-        pSfbWidth128 = pFrameInfo->sfb_width_128;
-
-        for (sfb = nsfb; sfb > 0; sfb--)
-        {
-            offset += *pSfbWidth128++ * len;
-            *pFrameSfbTop++ = offset;
-        }
-    }
-
-
-} /* calc_gsfb_table */
-
diff --git a/media/libstagefright/codecs/aacdec/calc_sbr_anafilterbank.cpp b/media/libstagefright/codecs/aacdec/calc_sbr_anafilterbank.cpp
deleted file mode 100644
index 5ec3f69..0000000
--- a/media/libstagefright/codecs/aacdec/calc_sbr_anafilterbank.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: calc_sbr_anafilterbank.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "calc_sbr_anafilterbank.h"
-#include    "qmf_filterbank_coeff.h"
-#include    "analysis_sub_band.h"
-
-#include    "aac_mem_funcs.h"
-#include    "fxp_mul32.h"
-
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void calc_sbr_anafilterbank_LC(Int32 * Sr,
-                               Int16 * X,
-                               Int32 scratch_mem[][64],
-                               Int32 maxBand)
-{
-
-    Int i;
-    Int32   *p_Y_1;
-    Int32   *p_Y_2;
-
-    Int16 * pt_X_1;
-    Int16 * pt_X_2;
-    Int32 realAccu1;
-    Int32 realAccu2;
-
-    Int32 tmp1;
-    Int32 tmp2;
-
-
-    const Int32 * pt_C;
-
-    p_Y_1 = scratch_mem[0];
-
-
-    p_Y_2 = p_Y_1 + 63;
-    pt_C   = &sbrDecoderFilterbankCoefficients_an_filt_LC[0];
-
-    pt_X_1 = X;
-
-
-    realAccu1  =  fxp_mul32_by_16(Qfmt27(-0.51075594183097F),   pt_X_1[-192]);
-
-    realAccu1  =  fxp_mac32_by_16(Qfmt27(-0.51075594183097F), -pt_X_1[-128], realAccu1);
-    realAccu1  =  fxp_mac32_by_16(Qfmt27(-0.01876919066980F),  pt_X_1[-256], realAccu1);
-    *(p_Y_1++) =  fxp_mac32_by_16(Qfmt27(-0.01876919066980F), -pt_X_1[ -64], realAccu1);
-
-
-    /* create array Y */
-
-    pt_X_1 = &X[-1];
-    pt_X_2 = &X[-319];
-
-
-    for (i = 15; i != 0; i--)
-    {
-        tmp1 = *(pt_X_1--);
-        tmp2 = *(pt_X_2++);
-
-        realAccu1  = fxp_mul32_by_16(*(pt_C), tmp1);
-        realAccu2  = fxp_mul32_by_16(*(pt_C++), tmp2);
-        tmp1 = pt_X_1[ -63];
-        tmp2 = pt_X_2[ +63];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -127];
-        tmp2 = pt_X_2[ +127];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -191];
-        tmp2 = pt_X_2[ +191];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -255];
-        tmp2 = pt_X_2[ +255];
-        *(p_Y_1++) = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        *(p_Y_2--) = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-
-        tmp1 = *(pt_X_1--);
-        tmp2 = *(pt_X_2++);
-        realAccu1  = fxp_mul32_by_16(*(pt_C), tmp1);
-        realAccu2  = fxp_mul32_by_16(*(pt_C++), tmp2);
-
-        tmp1 = pt_X_1[ -63];
-        tmp2 = pt_X_2[ +63];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -127];
-        tmp2 = pt_X_2[ +127];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -191];
-        tmp2 = pt_X_2[ +191];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -255];
-        tmp2 = pt_X_2[ +255];
-        *(p_Y_1++) = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        *(p_Y_2--) = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-
-    }
-
-
-    tmp1 = *(pt_X_1--);
-    tmp2 = *(pt_X_2++);
-    realAccu1  = fxp_mul32_by_16(*(pt_C), tmp1);
-    realAccu2  = fxp_mul32_by_16(*(pt_C++), tmp2);
-
-    tmp1 = pt_X_1[ -63];
-    tmp2 = pt_X_2[ +63];
-    realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-    realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-    tmp1 = pt_X_1[ -127];
-    tmp2 = pt_X_2[ +127];
-    realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-    realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-    tmp1 = pt_X_1[ -191];
-    tmp2 = pt_X_2[ +191];
-    realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-    realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-    tmp1 = pt_X_1[ -255];
-    tmp2 = pt_X_2[ +255];
-    *(p_Y_1++) = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-    *(p_Y_2--) = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-
-
-    pt_X_1 = X;
-
-    realAccu2  = fxp_mul32_by_16(Qfmt27(0.00370548843500F), X[ -32]);
-
-    realAccu2  = fxp_mac32_by_16(Qfmt27(0.00370548843500F), pt_X_1[-288], realAccu2);
-    realAccu2  = fxp_mac32_by_16(Qfmt27(0.09949460091720F), pt_X_1[ -96], realAccu2);
-    realAccu2  = fxp_mac32_by_16(Qfmt27(0.09949460091720F), pt_X_1[-224], realAccu2);
-    *(p_Y_1++) = fxp_mac32_by_16(Qfmt27(1.20736865027288F), pt_X_1[-160], realAccu2);
-
-
-    analysis_sub_band_LC(scratch_mem[0],
-                         Sr,
-                         maxBand,
-                         (Int32(*)[64])scratch_mem[1]);
-
-}
-
-
-
-#ifdef HQ_SBR
-
-void calc_sbr_anafilterbank(Int32 * Sr,
-                            Int32 * Si,
-                            Int16 * X,
-                            Int32 scratch_mem[][64],
-                            Int32   maxBand)
-{
-    Int i;
-    Int32   *p_Y_1;
-    Int32   *p_Y_2;
-
-
-
-
-    const Int32 * pt_C;
-    Int16 * pt_X_1;
-    Int16 * pt_X_2;
-    Int32 realAccu1;
-    Int32 realAccu2;
-
-    Int32 tmp1;
-    Int32 tmp2;
-
-
-    p_Y_1 = scratch_mem[0];
-
-
-    p_Y_2 = p_Y_1 + 63;
-    pt_C   = &sbrDecoderFilterbankCoefficients_an_filt[0];
-
-    realAccu1  =  fxp_mul32_by_16(Qfmt27(-0.36115899F),   X[-192]);
-
-
-    realAccu1  =  fxp_mac32_by_16(Qfmt27(-0.36115899F),  -X[-128], realAccu1);
-    realAccu1  =  fxp_mac32_by_16(Qfmt27(-0.013271822F),  X[-256], realAccu1);
-    *(p_Y_1++) =  fxp_mac32_by_16(Qfmt27(-0.013271822F), -X[ -64], realAccu1);
-
-    /* create array Y */
-
-    pt_X_1 = &X[-1];
-    pt_X_2 = &X[-319];
-
-
-    for (i = 31; i != 0; i--)
-    {
-        tmp1 = *(pt_X_1--);
-        tmp2 = *(pt_X_2++);
-        realAccu1  = fxp_mul32_by_16(*(pt_C), tmp1);
-        realAccu2  = fxp_mul32_by_16(*(pt_C++), tmp2);
-        tmp1 = pt_X_1[ -63];
-        tmp2 = pt_X_2[  63];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -127];
-        tmp2 = pt_X_2[  127];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -191];
-        tmp2 = pt_X_2[  191];
-        realAccu1  = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        realAccu2  = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-        tmp1 = pt_X_1[ -255];
-        tmp2 = pt_X_2[  255];
-        *(p_Y_1++) = fxp_mac32_by_16(*(pt_C), tmp1, realAccu1);
-        *(p_Y_2--) = fxp_mac32_by_16(*(pt_C++), tmp2, realAccu2);
-    }
-
-
-    realAccu2  = fxp_mul32_by_16(Qfmt27(0.002620176F), X[ -32]);
-    realAccu2  = fxp_mac32_by_16(Qfmt27(0.002620176F), X[-288], realAccu2);
-    realAccu2  = fxp_mac32_by_16(Qfmt27(0.070353307F), X[ -96], realAccu2);
-    realAccu2  = fxp_mac32_by_16(Qfmt27(0.070353307F), X[-224], realAccu2);
-
-
-    *(p_Y_1++) = fxp_mac32_by_16(Qfmt27(0.85373856F), (X[-160]), realAccu2);
-
-
-    analysis_sub_band(scratch_mem[0],
-                      Sr,
-                      Si,
-                      maxBand,
-                      (Int32(*)[64])scratch_mem[1]);
-
-}
-
-
-#endif
-
-
-
-#endif   /*  AAC_PLUS */
-
diff --git a/media/libstagefright/codecs/aacdec/calc_sbr_anafilterbank.h b/media/libstagefright/codecs/aacdec/calc_sbr_anafilterbank.h
deleted file mode 100644
index c93848e..0000000
--- a/media/libstagefright/codecs/aacdec/calc_sbr_anafilterbank.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: calc_sbr_anafilterbank.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef CALC_SBR_ANAFILTERBANK_H
-#define CALC_SBR_ANAFILTERBANK_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-#define ROUND_ANAFIL     0
-//#define ROUND_ANAFIL     0
-#define ROUND_ANAFIL_LC  (0)
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-
-    void calc_sbr_anafilterbank_LC(Int32 * Sr,
-    Int16 * X,
-    Int32 scratch_mem[][64],
-    Int32 maxBand);
-
-
-#ifdef HQ_SBR
-
-    void calc_sbr_anafilterbank(Int32 * Sr,
-                                Int32 * Si,
-                                Int16 * X,
-                                Int32 scratch_mem[][64],
-                                Int32 maxBand);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /*  CALC_SBR_ANAFILTERBANK_H */
diff --git a/media/libstagefright/codecs/aacdec/calc_sbr_envelope.cpp b/media/libstagefright/codecs/aacdec/calc_sbr_envelope.cpp
deleted file mode 100644
index 4fb3535..0000000
--- a/media/libstagefright/codecs/aacdec/calc_sbr_envelope.cpp
+++ /dev/null
@@ -1,2203 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Filename: calc_sbr_envelope.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "calc_sbr_envelope.h"
-#include    "sbr_envelope_calc_tbl.h"
-#include    "sbr_create_limiter_bands.h"
-#include    "aac_mem_funcs.h"
-
-#include    "fxp_mul32.h"
-#include    "pv_normalize.h"
-
-#include    "sbr_aliasing_reduction.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#include    "pv_sqrt.h"
-
-#include    "pv_div.h"
-#include    "fxp_mul32.h"
-#include    "pv_normalize.h"
-
-#define Q30fmt(x)   (Int32)(x*((Int32)1<<30) + (x>=0?0.5F:-0.5F))
-#define Q28fmt(x)   (Int32)(x*((Int32)1<<28) + (x>=0?0.5F:-0.5F))
-#define Q15fmt(x)   (Int32)(x*((Int32)1<<15) + (x>=0?0.5F:-0.5F))
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void envelope_application_LC(Int32  *aBufR,
-    Int32  *nrg_gain_man,
-    Int32  *nrg_gain_exp,
-    Int32  *noise_level_man,
-    Int32  *noise_level_exp,
-    Int32  *nrg_tone_man,
-    Int32  *nrg_tone_exp,
-    Int32  band_nrg_tone_detector,
-    const Int32 *frame_info,
-    Int32  *harm_index,
-    Int32  *phase_index,
-    Int32  i,
-    Int32  lowSubband,
-    Int32  noSubbands,
-    Int32  noNoiseFlag);
-
-
-    void energy_estimation_LC(Int32 *aBufR,
-                              Int32 *nrg_est_man,
-                              Int32 *nrg_est_exp,
-                              const Int32 *frame_info,
-                              Int32 i,
-                              Int32 k,
-                              Int32 c,
-                              Int32 ui2);
-
-#ifdef HQ_SBR
-
-
-    void envelope_application(Int32  *aBufR,
-                              Int32  *aBufI,
-                              Int32  *nrg_gain_man,
-                              Int32  *nrg_gain_exp,
-                              Int32  *noise_level_man,
-                              Int32  *noise_level_exp,
-                              Int32  *nrg_tone_man,
-                              Int32  *nrg_tone_exp,
-                              Int32 *fBuf_man[64],
-                              Int32 *fBuf_exp[64],
-                              Int32 *fBufN_man[64],
-                              Int32 *fBufN_exp[64],
-                              const Int32 *frame_info,
-                              Int32  *harm_index,
-                              Int32  *phase_index,
-                              Int32  i,
-                              Int32  lowSubband,
-                              Int32  noSubbands,
-                              Int32  noNoiseFlag,
-                              Int32  band_nrg_tone_detector,
-                              Int32  maxSmoothLength,
-                              Int32  smooth_length);
-
-
-    void energy_estimation(Int32 *aBufR,
-                           Int32 *aBufI,
-                           Int32 *nrg_est_man,
-                           Int32 *nrg_est_exp,
-                           const Int32 *frame_info,
-                           Int32 i,
-                           Int32 k,
-                           Int32 c,
-                           Int32 ui2);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void calc_sbr_envelope(SBR_FRAME_DATA *frameData,
-                       Int32 *aBufR,
-                       Int32 *aBufI,
-                       Int freqBandTable1[2][MAX_FREQ_COEFFS + 1],
-                       const Int32 *nSfb,
-                       Int32 freqBandTable2[MAX_NOISE_COEFFS + 1],
-                       Int32 nNBands,
-                       Int32 reset,
-                       Int32 *degreeAlias,
-                       Int32 *harm_index,
-                       Int32 *phase_index,
-                       Int32 hFp[64],
-                       Int32 *sUp,
-                       Int32 limSbc[][13],
-                       Int32 *gateMode,
-#ifdef HQ_SBR
-                       Int32 *fBuf_man[64],
-                       Int32 *fBuf_exp[64],
-                       Int32 *fBufN_man[64],
-                       Int32 *fBufN_exp[64],
-#endif
-                       Int32 scratch_mem[][64],
-                       struct PATCH Patch,
-                       Int32  sqrt_cache[][4],
-                       Int32  LC_flag)
-{
-
-    Int32 c;
-    Int32 li;
-    Int32 ui;
-    Int32 i;
-    Int32 j;
-    Int32 k = 0;
-    Int32 l;
-    Int m = 0;
-    Int kk = 0;
-    Int o;
-    Int next = -1;
-    Int32 ui2;
-    Int flag;
-    Int noNoiseFlag;
-    Int *ptr;
-
-
-    UInt32 nrg = 0;
-    Int32 nrg_exp = 0;
-    struct intg_div   quotient;
-    struct intg_sqrt  root_sq;
-
-    Int32 aux1;
-
-    Int32 *nL_man       = frameData->sbrNoiseFloorLevel_man;
-    Int32 *nL_exp       = frameData->sbrNoiseFloorLevel_exp;
-
-    Int32 *sfb_nrg_man  = frameData->iEnvelope_man;
-    Int32 *sfb_nrg_exp  = frameData->iEnvelope_exp;
-
-    Int32 tmp_q1;
-    Int32 tmp_q2;
-
-    Int32 g_max_man;
-    Int32 g_max_exp;
-
-    Int32 p_ref_man;
-    Int32 p_ref_exp;
-
-    Int32 p_est_man;
-    Int32 p_est_exp;
-
-    Int32 p_adj_man;
-    Int32 p_adj_exp;
-    Int32 avg_gain;
-
-    Int32 boost_gain_q;
-
-    Int32 band_nrg_tone_detector;
-
-    Int32 *nrg_est_man     = scratch_mem[0];
-    Int32 *nrg_est_exp     = scratch_mem[1];
-    Int32 *nrg_ref_man     = scratch_mem[2];
-    Int32 *nrg_ref_exp     = scratch_mem[3];
-    Int32 *nrg_gain_man    = scratch_mem[4];
-    Int32 *nrg_gain_exp    = scratch_mem[5];
-    Int32 *noise_level_man = scratch_mem[6];
-    Int32 *noise_level_exp = scratch_mem[7];
-    Int32 *nrg_tone_man    = scratch_mem[8];
-    Int32 *nrg_tone_exp    = scratch_mem[9];
-    Int32 *hF              = scratch_mem[10];
-
-
-
-    const Int32 *frame_info = frameData->frameInfo;
-    Int32 int_mode          = frameData->sbr_header.interpolFreq;
-
-
-
-
-
-    Int32 dontUseTheseGainValues[64];
-
-#ifdef HQ_SBR
-
-    Int32 n;
-    Int32 smooth_length;
-    Int32 smoothingLength   = frameData->sbr_header.smoothingLength;
-    Int32 maxSmoothLength   = smoothLengths[0];
-
-#endif
-
-    Int32 limiterBand       = frameData->sbr_header.limiterBands;
-    Int32 limiterGains      = frameData->sbr_header.limiterGains;
-    Int32 *addHarmonics     = frameData->addHarmonics;
-
-    Int32 lowSubband        = freqBandTable1[LOW_RES][0];
-    Int32 noSubbands        = freqBandTable1[LOW_RES][nSfb[LOW_RES]] - lowSubband;
-    Int32 nEnv              = frame_info[0];
-    Int32 sEnv              = frame_info[(nEnv + 1)<<1];
-
-    /* ensure that noSubbands in the range [0,64] */
-    noSubbands = (noSubbands >> 31) ^ noSubbands;
-    if (noSubbands > 64)
-    {
-        noSubbands = 64;
-    }
-
-    if (reset)
-    {
-        *sUp = 1;
-        *phase_index = 0;
-        sbr_create_limiter_bands(limSbc,
-                                 gateMode,
-                                 freqBandTable1[LOW_RES],
-                                 Patch,
-                                 nSfb[LOW_RES]);
-    }
-
-    /* Mapping. */
-    pv_memset((void*)hF, 0, (sizeof(*hF) << 6));
-
-    ptr  = freqBandTable1[HI];
-    l = *(ptr++);
-
-    for (i = nSfb[HI]; i != 0; i--)
-    {
-        k     = *(ptr++);
-        j     = ((k + l) >> 1) - lowSubband;
-        l   = k;
-        hF[j] = *(addHarmonics++);
-    }
-
-
-    /* Envelope adjustment. */
-
-    for (i = 0; i < nEnv; i++)
-    {
-
-        if (frame_info[1+i] == frame_info[(nEnv<<1)+4+kk])
-        {
-            kk++, next++;
-        }
-
-        noNoiseFlag = (i == sEnv || i == frameData->prevEnvIsShort) ? 1 : 0;
-
-#ifdef HQ_SBR
-        smooth_length = (noNoiseFlag ? 0 : smoothLengths[smoothingLength]);
-#endif
-
-
-        /* Estimate levels. */
-        c = 0;
-        o = 0;
-
-        band_nrg_tone_detector = 0;
-
-        Int kkkk = freqBandTable1[ frame_info[nEnv+2+i] ][0];
-
-        for (j = 0; j <  nSfb[frame_info[nEnv+2+i]]; j++)
-        {
-            li = freqBandTable1[ frame_info[nEnv+2+i] ][j    ];
-            ui = freqBandTable1[ frame_info[nEnv+2+i] ][j + 1];
-            flag = 0;
-
-            for (k = li; k < ui; k++)
-            {                               /* Calculate the average energy over the current envelope, */
-                ui2   = (frame_info[1+i] << 1);
-
-                if (LC_flag == ON)
-                {
-                    energy_estimation_LC((Int32 *)aBufR,
-                                         nrg_est_man,
-                                         nrg_est_exp,
-                                         frame_info,
-                                         i,
-                                         k - kkkk,
-                                         c,
-                                         ui2);
-                }
-#ifdef HQ_SBR
-                else
-                {
-
-                    energy_estimation((Int32 *)aBufR,
-                                      (Int32 *)aBufI,
-                                      nrg_est_man,
-                                      nrg_est_exp,
-                                      frame_info,
-                                      i,
-                                      k - kkkk,
-                                      c,
-                                      ui2);
-                }
-#endif
-
-                flag = (hF[c] && (i >= sEnv || hFp[c+lowSubband])) ? 1 : flag;
-                c++;
-            }
-
-
-            ui2 = freqBandTable2[o+1];
-
-            if (!int_mode)
-            {                                /* If no interpolation is used,   */
-
-                tmp_q1 = -100;
-
-                for (k = c - (ui - li); k < c; k++)
-                {
-                    if (tmp_q1 < nrg_est_exp[k])
-                    {
-                        tmp_q1 = nrg_est_exp[k];
-                    }
-                }
-
-                nrg = 0;
-                for (k = c - (ui - li); k < c; k++)
-                {    /* average the energy in all the QMF bands, */
-                    nrg += nrg_est_man[k] >> (tmp_q1 - nrg_est_exp[k]); /* for the whole scalefactor band.  */
-                }
-                nrg /= (ui - li);
-                nrg_exp = tmp_q1;
-
-            }
-
-            c -= (ui - li);
-
-            for (k = 0; k < ui - li; k++)
-            {
-                o = (k + li >= ui2) ? o + 1 : o;
-                ui2 = freqBandTable2[o+1];
-                /*
-                 *  If no interpolation is used, use the averaged energy from above,
-                 *  otherwise do nothing.
-                 */
-
-
-                if (!int_mode)
-                {
-                    nrg_est_man[c] = nrg;
-                    nrg_est_exp[c] = nrg_exp;
-                }
-
-                if (LC_flag == ON)
-                {
-                    nrg_est_exp[c] += 1;
-
-                    if (flag)
-                    {
-                        dontUseTheseGainValues[k + li - lowSubband] = 1;
-                    }
-                    else
-                    {
-                        dontUseTheseGainValues[k + li - lowSubband] = 0;
-                    }
-                }
-
-                nrg_ref_man[c] = sfb_nrg_man[m];
-                nrg_ref_exp[c] = sfb_nrg_exp[m];
-
-                /*
-                 *  compute nL/(1 + nL);   where nL = nL_man*2^nL_exp
-                 */
-                aux1 = next * nNBands + o;
-
-                tmp_q1 = nL_exp[aux1];
-
-                if (tmp_q1 >= 0)
-                {
-                    pv_div(nL_man[aux1], nL_man[aux1] + (0x3FFFFFFF >> tmp_q1), &quotient);
-                }
-                else
-                {
-                    tmp_q1 = nL_man[aux1] >> (-tmp_q1);
-                    pv_div(tmp_q1, tmp_q1 + 0x3FFFFFFF, &quotient);
-                }
-
-                /*
-                 *  tmp_q1 = nL/(1 + nL)*nrg_ref[c];
-                 */
-
-                tmp_q1 = fxp_mul32_Q30(quotient.quotient >> quotient.shift_factor,  nrg_ref_man[c]);
-
-                if (flag)
-                {
-                    /*
-                     *  Calculate levels and gain, dependent on whether a synthetic, a sine is present or not.
-                     *
-                     *  nrg_gain[c]=(float)pv_sqrt( tmp/(nrg_est[c] + 1), sqrt_cache[1] );
-                     */
-
-
-                    pv_div(tmp_q1, nrg_est_man[c] + 1, &quotient);
-                    /*
-                     *  nrg_est_man[c] is an integer number, while tmp_q1 and quotient.quotient
-                     *  are fractions in Q30
-                     */
-
-                    tmp_q2 = nrg_ref_exp[c] - nrg_est_exp[c] - quotient.shift_factor - 30;
-
-                    pv_sqrt(quotient.quotient, tmp_q2, &root_sq, sqrt_cache[1]);
-                    nrg_gain_man[c] = root_sq.root;     /*  in Q28 format */
-                    nrg_gain_exp[c] = root_sq.shift_factor;
-
-
-                    /*
-                     *  nrg_tone[c]=(float)( (hF[c] && (i >= sEnv || hFp[c+lowSubband])) ?
-                     *                          pv_sqrt(nrg_ref[c]/(1+tmp_nL), sqrt_cache[2]) : 0);
-                     */
-                    if (hF[c] && (i >= sEnv || hFp[c+lowSubband]))
-                    {
-                        /*
-                         *  nrg_ref[c] and  nL, as well as quotient.quotient
-                         *  are fractions in Q30
-                         */
-
-                        /*  aux1 == next*nNBands + o */
-
-                        tmp_q2 = nL_exp[aux1];
-                        /*
-                         *  nrg_ref[c]/(1+tmp_nL)
-                         */
-
-                        if (tmp_q2 >= 0)
-                        {
-                            pv_div(nrg_ref_man[c], nL_man[aux1] + (0x3FFFFFFF >> tmp_q2), &quotient);
-                        }
-                        else
-                        {
-                            tmp_q2 = nL_man[aux1] >> (-tmp_q2);
-                            pv_div(nrg_ref_man[c], tmp_q2 + 0x3FFFFFFF, &quotient);
-                            tmp_q2 = 0;     /* exponent has been applied to the sum ((man>>exp) + 1)  */
-                        }
-
-                        tmp_q2 = nrg_ref_exp[c] - tmp_q2 - quotient.shift_factor;
-
-                        pv_sqrt(quotient.quotient, tmp_q2, &root_sq, sqrt_cache[2]);
-                        nrg_tone_man[c]    = root_sq.root;
-                        nrg_tone_exp[c]    = root_sq.shift_factor;
-
-                    }
-                    else
-                    {
-                        nrg_tone_man[c]    = 0;
-                        nrg_tone_exp[c]    = 0;
-                    }
-
-                }
-                else
-                {
-                    if (noNoiseFlag)
-                    {
-                        /*
-                         * nrg_gain[c] = (float) pv_sqrt(nrg_ref[c] /(nrg_est[c] + 1), sqrt_cache[3]);
-                         */
-
-                        pv_div(nrg_ref_man[c], nrg_est_man[c] + 1, &quotient);
-
-                        /*
-                         *  nrg_est_man[c] is an integer number, while nrg_ref_man[c] and
-                         *  quotient.quotient are fractions in Q30
-                         */
-
-                        tmp_q2 = nrg_ref_exp[c] - nrg_est_exp[c] - quotient.shift_factor - 30;
-
-                        pv_sqrt(quotient.quotient, tmp_q2, &root_sq, sqrt_cache[3]);
-                        nrg_gain_man[c] = root_sq.root;
-                        nrg_gain_exp[c] = root_sq.shift_factor;
-
-                    }
-                    else
-                    {
-                        /*
-                         *  nrg_gain[c] = (float) pv_sqrt(nrg_ref[c]/((nrg_est[c] + 1)*(1+tmp_nL)), sqrt_cache[4]);
-                         */
-                        /*  aux1 == next*nNBands + o */
-
-                        tmp_q2 = nL_exp[aux1];
-                        /*
-                         *  nrg_ref[c]/((nrg_est[c] + 1)*(1+tmp_nL))
-                         */
-
-                        if (nrg_est_man[c] == 0)
-                        {
-                            tmp_q2 = 0;     /*  avoid division by 0 in next if-else, this could be due to
-                                                rounding noise */
-                        }
-
-
-                        if (tmp_q2 >= 0)
-                        {
-
-                            tmp_q2 = fxp_mul32_Q30(nrg_est_man[c] + 1, nL_man[aux1] + (0x3FFFFFFF >> tmp_q2));
-                            pv_div(nrg_ref_man[c], tmp_q2, &quotient);
-                            /*
-                             *  nrg_est_man[c] is an integer number, while nrg_ref_man[c] and
-                             *  quotient.quotient are fractions in Q30
-                             */
-                            tmp_q2 = nrg_ref_exp[c] - quotient.shift_factor - 30 - nL_exp[aux1];
-                            if (nrg_est_man[c])
-                            {
-                                tmp_q2 -=  nrg_est_exp[c];
-                            }
-
-                            tmp_q2 = nrg_ref_exp[c] - nrg_est_exp[c] - quotient.shift_factor - 30 - nL_exp[aux1];
-                        }
-                        else
-                        {
-                            if (tmp_q2 > - 10)
-                            {
-                                tmp_q2 = nL_man[aux1] >> (-tmp_q2);
-
-                                tmp_q2 = fxp_mul32_Q30(nrg_est_man[c] + 1, tmp_q2 + 0x3FFFFFFF);
-                            }
-                            else
-                            {
-                                tmp_q2 = nrg_est_man[c] + 1;
-                            }
-
-
-                            pv_div(nrg_ref_man[c], tmp_q2, &quotient);
-                            /*
-                             *  nrg_est_man[c] is an integer number, while nrg_ref_man[c] and
-                             *  quotient.quotient are fractions in Q30
-                             */
-
-                            tmp_q2 = nrg_ref_exp[c] - quotient.shift_factor - 30;
-                            if (nrg_est_man[c])
-                            {
-                                tmp_q2 -=  nrg_est_exp[c];
-                            }
-
-                        }
-
-                        pv_sqrt(quotient.quotient, tmp_q2, &root_sq, sqrt_cache[4]);
-                        nrg_gain_man[c] = root_sq.root;
-                        nrg_gain_exp[c] = root_sq.shift_factor;
-
-                    }
-
-                    nrg_tone_man[c]    = 0;
-                    nrg_tone_exp[c]    = -100;
-
-                }
-
-                band_nrg_tone_detector |= nrg_tone_man[c];   /*  detect any tone activity  */
-
-                pv_sqrt(tmp_q1, nrg_ref_exp[c], &root_sq, sqrt_cache[5]);
-                noise_level_man[c] = root_sq.root;
-                noise_level_exp[c] = root_sq.shift_factor;
-
-                c++;
-
-            }   /* ---- end-for-loop (k) ------ */
-            m++;
-
-        }   /* -------- Estimate levels end-for-loop (j) ----- */
-
-
-
-        /*
-         *      Limiter
-         */
-
-
-        for (c = 0; c < gateMode[limiterBand]; c++)
-        {
-
-            p_ref_man = 0;
-            p_est_man = 0;
-
-            /*
-             *  get max exponent for the reference and estimated energy
-             */
-            p_ref_exp = -100;
-            p_est_exp = -100;
-
-            for (k = limSbc[limiterBand][c]; k < limSbc[limiterBand][c + 1]; k++)
-            {
-                if (p_ref_exp < nrg_ref_exp[k])
-                {
-                    p_ref_exp = nrg_ref_exp[k];    /* max */
-                }
-                if (p_est_exp < nrg_est_exp[k])
-                {
-                    p_est_exp = nrg_est_exp[k];    /* max */
-                }
-            }
-
-            k -= limSbc[limiterBand][c];     /*  number of element used in the addition */
-
-            while (k != 0)      /*  bit guard protection depends on log2(k)  */
-            {
-                k >>= 1;
-                p_ref_exp++;       /*  add extra bit-overflow-guard, nrg_ref_exp is in Q30 format */
-            }
-
-
-            for (k = limSbc[limiterBand][c]; k < limSbc[limiterBand][c + 1]; k++)
-            {   /*Calculate the average gain for the current limiter band.*/
-                p_ref_man += (nrg_ref_man[k] >> (p_ref_exp - nrg_ref_exp[k]));
-                p_est_man += (nrg_est_man[k] >> (p_est_exp - nrg_est_exp[k]));
-
-            }
-
-            if (p_est_man)
-            {
-                /*
-                 *  "average gain" (not equal to average of nrg_gain)
-                 */
-                pv_div(p_ref_man, p_est_man, &quotient);
-
-                tmp_q2 = p_ref_exp - 30 - p_est_exp - quotient.shift_factor;
-
-                /*
-                 *  avg_gain = sqrt(p_ref/p_est)
-                 */
-                pv_sqrt(quotient.quotient, tmp_q2, &root_sq, sqrt_cache[6]);
-                avg_gain  = root_sq.root;
-                g_max_exp = root_sq.shift_factor;
-
-                /*
-                 *  maximum gain allowed is calculated from table.
-                 */
-
-                /*
-                 *  g_max = avg_gain * limGains[limiterGains];
-                 */
-
-                g_max_man = fxp_mul32_Q30(avg_gain, limGains[limiterGains]);   /*  table is in Q30 */
-
-                if (limiterGains == 3)
-                {
-                    g_max_exp = limGains[4];
-                }
-
-                tmp_q1 = g_max_exp >= 16 ? g_max_exp : 16;
-
-                tmp_q2 = g_max_man >> (tmp_q1 - g_max_exp);
-                tmp_q1 = Q28fmt(1.52587890625F) >> (tmp_q1 - 16);
-
-                if (tmp_q2 > tmp_q1)
-                {
-                    /* upper limit, +100 dB */
-                    g_max_man = Q28fmt(1.52587890625F);
-                    g_max_exp = 16;
-                }
-            }
-            else
-            {
-                /*  Qfmt(1.52587890625F)    exp = 16 */
-                g_max_man = Q28fmt(1.52587890625F);
-                g_max_exp = 16;
-            }
-
-            /*
-             *  Compute Adjusted power p_adj
-             */
-            for (k = limSbc[limiterBand][c]; k < limSbc[limiterBand][c + 1]; k++)
-            {
-
-                tmp_q1 = g_max_exp >= nrg_gain_exp[k] ? g_max_exp : nrg_gain_exp[k];
-
-                tmp_q2 = g_max_man >> (tmp_q1 - g_max_exp);
-                tmp_q1 = nrg_gain_man[k] >> (tmp_q1 - nrg_gain_exp[k]);
-                /*
-                 *  if(g_max <= nrg_gain[k])
-                 */
-                if (tmp_q2 <= tmp_q1)
-                {
-                    tmp_q1 = fxp_mul32_Q28(noise_level_man[k], g_max_man);
-                    pv_div(tmp_q1, nrg_gain_man[k], &quotient);
-                    noise_level_man[k] = quotient.quotient >> 2;   /* in Q28 */
-                    noise_level_exp[k] = noise_level_exp[k] + g_max_exp - quotient.shift_factor - nrg_gain_exp[k];
-
-                    nrg_gain_man[k] =  g_max_man;       /* gains with noise supression */
-                    nrg_gain_exp[k] =  g_max_exp;
-                }
-            }
-
-            p_adj_exp = -100;
-
-            for (k = limSbc[limiterBand][c]; k < limSbc[limiterBand][c + 1]; k++)
-            {
-                tmp_q1 = nrg_est_exp[k] + (nrg_gain_exp[k] << 1) + 28;  /* 28 to match shift down by mult32_Q28  */
-
-                if (p_adj_exp < tmp_q1)
-                {
-                    p_adj_exp = tmp_q1;
-                }
-                if (nrg_tone_man[k])
-                {
-                    tmp_q1 = (nrg_tone_exp[k] << 1);
-                    if (p_adj_exp < tmp_q1)
-                    {
-                        p_adj_exp = tmp_q1;
-                    }
-                }
-                else if (!noNoiseFlag)
-                {
-                    tmp_q1 = (noise_level_exp[k] << 1);
-
-                    if (p_adj_exp < tmp_q1)
-                    {
-                        p_adj_exp = tmp_q1;
-                    }
-                }
-            }
-
-            p_adj_exp += 1; /* overflow bit-guard*/
-
-            p_adj_man = 0;
-
-            for (k = limSbc[limiterBand][c]; k < limSbc[limiterBand][c + 1]; k++)
-            {
-                /*
-                 *  p_adj += nrg_gain[k]*nrg_gain[k]*nrg_est[k];
-                 */
-
-                if (p_adj_exp - (nrg_est_exp[k] + (nrg_gain_exp[k] << 1)) < 59)
-                {
-                    tmp_q1 = fxp_mul32_Q28(nrg_gain_man[k], nrg_gain_man[k]);
-                    tmp_q1 = fxp_mul32_Q28(tmp_q1, nrg_est_man[k]);
-                    p_adj_man += (tmp_q1 >> (p_adj_exp - (nrg_est_exp[k] + (nrg_gain_exp[k] << 1) + 28)));
-                }
-
-                if (nrg_tone_man[k])
-                {
-                    /*
-                     *  p_adj += nrg_tone[k]*nrg_tone[k];
-                     */
-                    if (p_adj_exp - (nrg_tone_exp[k] << 1) < 31)
-                    {
-                        tmp_q1 = fxp_mul32_Q28(nrg_tone_man[k], nrg_tone_man[k]);
-                        p_adj_man += (tmp_q1 >> (p_adj_exp - (nrg_tone_exp[k] << 1)));
-                    }
-                }
-                else if (!noNoiseFlag)
-                {
-                    /*
-                     *  p_adj += noise_level[k]*noise_level[k];
-                     */
-
-                    if (p_adj_exp - (noise_level_exp[k] << 1) < 31)
-                    {
-                        tmp_q1 = fxp_mul32_Q28(noise_level_man[k], noise_level_man[k]);
-                        p_adj_man += (tmp_q1 >> (p_adj_exp - (noise_level_exp[k] << 1)));
-                    }
-
-                }
-            }
-
-
-            if (p_adj_man)
-            {
-                pv_div(p_ref_man, p_adj_man, &quotient);
-                tmp_q2 = p_ref_exp - p_adj_exp - 58 - quotient.shift_factor;   /*  58 <> Q30 + Q28 */
-
-                pv_sqrt(quotient.quotient, tmp_q2, &root_sq, sqrt_cache[7]);
-
-                if (root_sq.shift_factor > -28)
-                {
-                    boost_gain_q = root_sq.root << (root_sq.shift_factor + 28);
-                }
-                else
-                {
-                    boost_gain_q = root_sq.root >> (-28 - root_sq.shift_factor);
-                }
-
-                tmp_q1 = root_sq.shift_factor >= -28 ? root_sq.shift_factor : -28;
-
-                tmp_q2 = root_sq.root >> (tmp_q1 - root_sq.shift_factor);
-                tmp_q1 = Q28fmt(1.584893192f) >> (tmp_q1 + 28);
-
-
-                if (tmp_q2 > tmp_q1)
-                {
-                    boost_gain_q = Q28fmt(1.584893192f);
-                }
-            }
-            else
-            {
-                boost_gain_q = Q28fmt(1.584893192f);
-            }
-
-            if (band_nrg_tone_detector)
-            {
-                for (k = limSbc[limiterBand][c]; k < limSbc[limiterBand][c + 1]; k++)
-                {
-                    nrg_gain_man[k]    = fxp_mul32_Q28(nrg_gain_man[k], boost_gain_q);
-                    noise_level_man[k] = fxp_mul32_Q28(noise_level_man[k], boost_gain_q);
-                    nrg_tone_man[k]    = fxp_mul32_Q28(nrg_tone_man[k], boost_gain_q);
-                }
-            }
-            else
-            {
-
-                for (k = limSbc[limiterBand][c]; k < limSbc[limiterBand][c + 1]; k++)
-                {
-                    nrg_gain_man[k]    = fxp_mul32_Q28(nrg_gain_man[k], boost_gain_q);
-                    noise_level_man[k] = fxp_mul32_Q28(noise_level_man[k], boost_gain_q);
-                }
-
-
-            }
-
-        }   /* Limiter  End for loop (c) */
-
-
-        if (LC_flag == ON)
-        {
-
-            /*
-             *          Aliasing correction
-             */
-
-            sbr_aliasing_reduction(degreeAlias,
-                                   nrg_gain_man,
-                                   nrg_gain_exp,
-                                   nrg_est_man,
-                                   nrg_est_exp,
-                                   dontUseTheseGainValues,
-                                   noSubbands,
-                                   lowSubband,
-                                   sqrt_cache,
-                                   scratch_mem[3]);
-
-            if (*sUp)     /* Init only done once upon reset */
-            {
-                *sUp = 0;
-            }
-
-            envelope_application_LC((Int32 *)aBufR,
-                                    nrg_gain_man,
-                                    nrg_gain_exp,
-                                    noise_level_man,
-                                    noise_level_exp,
-                                    nrg_tone_man,
-                                    nrg_tone_exp,
-                                    band_nrg_tone_detector,
-                                    frame_info,
-                                    harm_index,
-                                    phase_index,
-                                    i,
-                                    lowSubband,
-                                    noSubbands,
-                                    noNoiseFlag);
-        }
-#ifdef HQ_SBR
-        else
-        {
-
-            if (*sUp)     /* Init only done once upon reset */
-            {
-                for (n = 0; n < maxSmoothLength; n++)
-                {
-                    pv_memcpy(fBuf_man[n],     nrg_gain_man, noSubbands*sizeof(*fBuf_man[n]));
-                    pv_memcpy(fBufN_man[n], noise_level_man, noSubbands*sizeof(*fBufN_man[n]));
-                    pv_memcpy(fBuf_exp[n],     nrg_gain_exp, noSubbands*sizeof(*fBuf_exp[n]));
-                    pv_memcpy(fBufN_exp[n], noise_level_exp, noSubbands*sizeof(*fBufN_exp[n]));
-                }
-                *sUp = 0;
-            }
-
-
-            envelope_application((Int32 *)aBufR,
-                                 (Int32 *)aBufI,
-                                 nrg_gain_man,
-                                 nrg_gain_exp,
-                                 noise_level_man,
-                                 noise_level_exp,
-                                 nrg_tone_man,
-                                 nrg_tone_exp,
-                                 fBuf_man,
-                                 fBuf_exp,
-                                 fBufN_man,
-                                 fBufN_exp,
-                                 frame_info,
-                                 harm_index,
-                                 phase_index,
-                                 i,
-                                 lowSubband,
-                                 noSubbands,
-                                 noNoiseFlag,
-                                 band_nrg_tone_detector,
-                                 maxSmoothLength,
-                                 smooth_length);
-
-        }
-#endif
-
-    }   /* -----  Envelope adjustment end for-loop (i) ---- */
-
-
-    pv_memcpy(&hFp[0] + lowSubband,
-              hF,
-              (64 - lowSubband)*sizeof(*hF));
-
-    if (sEnv == nEnv)
-    {
-        frameData->prevEnvIsShort = 0;
-    }
-    else
-    {
-        frameData->prevEnvIsShort = -1;
-    }
-
-
-}
-
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void envelope_application_LC(Int32  *aBufR,
-                             Int32  *nrg_gain_man,
-                             Int32  *nrg_gain_exp,
-                             Int32  *noise_level_man,
-                             Int32  *noise_level_exp,
-                             Int32  *nrg_tone_man,
-                             Int32  *nrg_tone_exp,
-                             Int32  band_nrg_tone_detector,
-                             const Int32 *frame_info,
-                             Int32  *harm_index,
-                             Int32  *phase_index,
-                             Int32  i,
-                             Int32  lowSubband,
-                             Int32  noSubbands,
-                             Int32  noNoiseFlag)
-{
-
-    Int32 *ptrReal;
-    Int32 sb_gain_man;
-    Int32 sb_noise_man;
-    Int32 sb_noise_exp;
-    Int32 l;
-    Int32 k;
-    Int32 tmp_q1;
-    Int32 tmp_q2;
-    Int32 tone_count;
-    Int16 tmp_16;
-    Int32 indexMinus1;
-    Int32 indexPlus1;
-
-
-    /*
-     *          Application
-     */
-
-    if (band_nrg_tone_detector)     /* Add tone energy only if energy is detected  */
-    {
-
-        /*
-         *  pre-calculate tone application
-         */
-        for (k = 0; k < noSubbands; k++)
-        {
-            tmp_q2 = (-nrg_tone_exp[k]);
-            tmp_q1 = nrg_tone_man[k];
-            tmp_q2 = tmp_q1 >> tmp_q2;
-            tmp_q1 = fxp_mul32_by_16(tmp_q2, Q15fmt(0.0163f));
-            nrg_tone_man[k] = tmp_q2;
-            nrg_tone_exp[k] = tmp_q1;
-            noise_level_exp[k] += 1;
-            nrg_gain_exp[k] += 28;
-        }
-
-        for (l = (frame_info[1+i] << 1); l < (frame_info[2+i] << 1); l++)
-        {
-            ptrReal = (aBufR + l * SBR_NUM_BANDS);
-
-            tone_count = 0;
-
-            indexPlus1  = (*harm_index + 1) & 3;
-
-            if (indexPlus1 & 1)    /*  if indexPlus1 is odd */
-            {
-                for (k = 0; k < noSubbands; k++)
-                {
-
-                    sb_gain_man = nrg_gain_man[k];
-                    tmp_q1 = *ptrReal;
-                    tmp_q2 = nrg_gain_exp[k];
-                    tmp_q1 = fxp_mul32_Q28(tmp_q1, sb_gain_man);
-
-                    if (tmp_q2 < 0)
-                    {
-                        if (tmp_q2 > -32)
-                        {
-                            *ptrReal = tmp_q1 >> (-tmp_q2);
-                        }
-                    }
-                    else
-                    {
-                        *ptrReal = tmp_q1 << tmp_q2;
-                    }
-
-                    *phase_index = (*phase_index + 1) & 511;
-
-                    if (!nrg_tone_man[k] && !noNoiseFlag)
-
-                    {
-                        tmp_16 = rP_LCx[*phase_index];
-                        sb_noise_man = noise_level_man[k];
-                        sb_noise_exp = noise_level_exp[k];
-
-                        tmp_q1 = fxp_mul32_by_16(sb_noise_man, tmp_16);
-
-                        if (sb_noise_exp < 0)
-                        {
-                            if (sb_noise_exp > -32)
-                            {
-                                *ptrReal += tmp_q1 >> (-sb_noise_exp);
-                            }
-                        }
-                        else
-                        {
-                            *ptrReal += tmp_q1 << sb_noise_exp;
-                        }
-                    }
-
-                    tmp_q1 = nrg_tone_man[k];
-
-                    if (*harm_index)
-                    {
-                        *ptrReal -= tmp_q1;
-                    }
-                    else
-                    {
-                        *ptrReal += tmp_q1;
-                    }
-
-                    if (tmp_q1)
-                    {
-                        tone_count++;
-                    }
-
-                    ptrReal++;
-
-                }   /*  for-loop (k) */
-
-            }
-            else        /*  if indexPlus1 is even */
-            {
-                indexMinus1 = (*harm_index - 1) & 3;
-
-                /*  ---  k = 0  ----- */
-
-                sb_gain_man = nrg_gain_man[0];
-                tmp_q1 = *ptrReal;
-                tmp_q2 = nrg_gain_exp[0];
-                tmp_q1 = fxp_mul32_Q28(tmp_q1, sb_gain_man);
-
-                if (tmp_q2 < 0)
-                {
-                    if (tmp_q2 > -32)
-                    {
-                        *ptrReal = tmp_q1 >> (-tmp_q2);
-                    }
-                }
-                else
-                {
-                    *ptrReal = tmp_q1 << tmp_q2;
-                }
-
-                *phase_index = (*phase_index + 1) & 511;
-
-                tmp_q1 = nrg_tone_exp[0];
-                tmp_q2 = nrg_tone_exp[1];
-
-                if ((indexPlus1 != 0) ^((lowSubband & 1) != 0))
-                {
-                    *(ptrReal - 1) -= tmp_q1;
-                    *(ptrReal)   += tmp_q2;
-                }
-                else
-                {
-                    *(ptrReal - 1) += tmp_q1;
-                    *(ptrReal)   -= tmp_q2;
-                }
-
-                if (!nrg_tone_man[0] && !noNoiseFlag)
-                {
-                    tmp_16 = rP_LCx[*phase_index];
-                    sb_noise_man = noise_level_man[0];
-                    sb_noise_exp = noise_level_exp[0];
-
-                    tmp_q1 = fxp_mul32_by_16(sb_noise_man, tmp_16);
-
-                    if (sb_noise_exp < 0)
-                    {
-                        if (sb_noise_exp > -32)
-                        {
-                            *ptrReal += tmp_q1 >> (-sb_noise_exp);
-                        }
-                    }
-                    else
-                    {
-                        *ptrReal += tmp_q1 << sb_noise_exp;
-                    }
-                }
-                else
-                {
-                    tone_count++;
-                }
-
-                ptrReal++;
-
-                /* ----  */
-
-                for (k = 1; k < noSubbands - 1; k++)
-                {
-
-                    sb_gain_man = nrg_gain_man[k];
-                    tmp_q1 = *ptrReal;
-                    tmp_q2 = nrg_gain_exp[k];
-                    tmp_q1 = fxp_mul32_Q28(tmp_q1, sb_gain_man);
-
-                    if (tmp_q2 < 0)
-                    {
-                        if (tmp_q2 > -32)
-                        {
-                            *ptrReal = tmp_q1 >> (-tmp_q2);
-                        }
-                    }
-                    else
-                    {
-                        *ptrReal = tmp_q1 << tmp_q2;
-                    }
-
-                    *phase_index = (*phase_index + 1) & 511;
-
-
-                    if (tone_count < 16)
-                    {
-                        tmp_q1 = nrg_tone_exp[k - 1];
-                        tmp_q2 = nrg_tone_exp[k + 1];
-
-                        tmp_q1 -= tmp_q2;
-
-
-                        if ((indexPlus1 != 0) ^(((k + lowSubband) & 1) != 0))
-                        {
-                            *(ptrReal) -= tmp_q1;
-                        }
-                        else
-                        {
-                            *(ptrReal) += tmp_q1;
-                        }
-                    }   /*   if (tone_count < 16)  */
-
-
-                    if (!nrg_tone_man[k] && !noNoiseFlag)
-                    {
-                        tmp_16 = rP_LCx[*phase_index];
-                        sb_noise_man = noise_level_man[k];
-                        sb_noise_exp = noise_level_exp[k];
-
-                        tmp_q1 = fxp_mul32_by_16(sb_noise_man, tmp_16);
-
-                        if (sb_noise_exp < 0)
-                        {
-                            if (sb_noise_exp > -32)
-                            {
-                                *ptrReal += tmp_q1 >> (-sb_noise_exp);
-                            }
-                        }
-                        else
-                        {
-                            *ptrReal += tmp_q1 << sb_noise_exp;
-                        }
-                    }
-                    else
-                    {
-                        tone_count++;
-                    }
-
-                    ptrReal++;
-
-                }   /*  for-loop (k) */
-
-                sb_gain_man = nrg_gain_man[k];
-                tmp_q1 = *ptrReal;
-                tmp_q2 = nrg_gain_exp[k];
-                tmp_q1 = fxp_mul32_Q28(tmp_q1, sb_gain_man);
-
-                if (tmp_q2 < 0)
-                {
-                    if (tmp_q2 > -31)
-                    {
-                        *ptrReal = tmp_q1 >> (-tmp_q2);
-                    }
-                }
-                else
-                {
-                    *ptrReal = tmp_q1 << tmp_q2;
-                }
-
-                *phase_index = (*phase_index + 1) & 511;
-
-
-                if ((tone_count < 16) && !(indexMinus1 &1))
-                {
-                    tmp_q1 = nrg_tone_exp[k - 1];
-                    tmp_q2 = nrg_tone_exp[k    ];
-
-                    if ((indexMinus1 != 0) ^(((k + lowSubband) & 1) != 0))
-                    {
-                        *(ptrReal)   += tmp_q1;
-
-                        if (k + lowSubband < 62)
-                        {
-                            *(ptrReal + 1) -= tmp_q2;
-                        }
-                    }
-                    else
-                    {
-                        *(ptrReal)   -= tmp_q1;
-
-                        if (k + lowSubband < 62)
-                        {
-                            *(ptrReal + 1) += tmp_q2;
-                        }
-                    }
-                }   /*   if (tone_count < 16)  */
-
-
-                if (!nrg_tone_man[k] && !noNoiseFlag)
-                {
-                    tmp_16 = rP_LCx[*phase_index];
-                    sb_noise_man = noise_level_man[k];
-                    sb_noise_exp = noise_level_exp[k];
-
-                    tmp_q1 = fxp_mul32_by_16(sb_noise_man, tmp_16);
-
-                    if (sb_noise_exp < 0)
-                    {
-                        if (sb_noise_exp > -31)
-                        {
-                            *ptrReal += tmp_q1 >> (-sb_noise_exp);
-                        }
-                    }
-                    else
-                    {
-                        *ptrReal += tmp_q1 << sb_noise_exp;
-                    }
-                }
-
-            }   /*  if indexPlus1 is odd */
-
-            *harm_index = indexPlus1;
-
-
-        }        /*  for-loop (l) */
-
-    }
-    else        /*   if ( band_nrg_tone_detector)   */
-    {
-
-        for (k = 0; k < noSubbands; k++)
-        {
-            tmp_q1 = noise_level_exp[k];
-            tmp_q2 = nrg_gain_exp[k];
-            noise_level_exp[k] =  tmp_q1 + 1;
-            nrg_gain_exp[k] = tmp_q2 + 28;
-        }
-
-        for (l = (frame_info[1+i] << 1); l < (frame_info[2+i] << 1); l++)
-        {
-            ptrReal = (aBufR + l * SBR_NUM_BANDS);
-
-            for (k = 0; k < noSubbands; k++)
-            {
-
-                tmp_q1 = *ptrReal;
-                sb_gain_man = nrg_gain_man[k];
-
-                tmp_q2 = nrg_gain_exp[k];
-
-                tmp_q1 = fxp_mul32_Q28(tmp_q1, sb_gain_man);
-
-                if (tmp_q2 < 0)
-                {
-                    if (tmp_q2 > -31)
-                    {
-                        *ptrReal = tmp_q1 >> (-tmp_q2);
-                    }
-                }
-                else
-                {
-                    *ptrReal = tmp_q1 << tmp_q2;
-                }
-
-                *phase_index = (*phase_index + 1) & 511;
-
-                if (! noNoiseFlag)
-                {
-                    tmp_16 = rP_LCx[*phase_index];
-                    sb_noise_man = noise_level_man[k];
-                    sb_noise_exp = noise_level_exp[k];
-
-                    tmp_q1 = fxp_mul32_by_16(sb_noise_man, tmp_16);
-
-                    if (sb_noise_exp < 0)
-                    {
-                        if (sb_noise_exp > -31)
-                        {
-                            *ptrReal += tmp_q1 >> (-sb_noise_exp);
-                        }
-                    }
-                    else
-                    {
-                        *ptrReal += tmp_q1 << sb_noise_exp;
-                    }
-                }
-
-                ptrReal++;
-
-            }   /*  for-loop (k) */
-
-            *harm_index  = (*harm_index + 1) & 3;
-
-
-        }   /*  for-loop (l) */
-
-    }
-
-}
-
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-#define Qfmt15(a)   (Int32)(a*((Int32)1<<15) + (a>=0?0.5F:-0.5F))
-
-
-const Int16 pow2[39] = { 0, 0, 1, 0, 2,
-                         0, Qfmt15(2 / 6.0f), 0, 3, 0, Qfmt15(2 / 10.0f), 0, Qfmt15(2 / 12.0f), 0, Qfmt15(2 / 14.0f), 0, 4,
-                         0, Qfmt15(2 / 18.0f),    0, Qfmt15(2 / 20.0f), 0, Qfmt15(2 / 22.0f), 0, Qfmt15(2 / 24.0f),
-                         0, Qfmt15(2 / 26.0f), 0, Qfmt15(2 / 28.0f), 0, Qfmt15(2 / 30.0f), 0, 5, 0, Qfmt15(2 / 34.0f),
-                         0, Qfmt15(2 / 36.0f), 0, Qfmt15(2 / 38.0f)
-                       };
-
-void energy_estimation_LC(Int32 *aBufR,
-                          Int32 *nrg_est_man,
-                          Int32 *nrg_est_exp,
-                          const Int32 *frame_info,
-                          Int32 i,
-                          Int32 k,
-                          Int32 c,
-                          Int32 ui2)
-{
-
-
-    Int32  aux1;
-    Int32  aux2;
-    Int32  l;
-
-
-    int64_t nrg_h = 0;
-    Int32 tmp1;
-    UInt32 tmp2;
-
-    for (l = ui2; l < (frame_info[2+i] << 1); l++)
-    {
-
-        aux1 = aBufR[l++*SBR_NUM_BANDS + k ];
-        aux2 = aBufR[l  *SBR_NUM_BANDS + k ];
-
-        nrg_h = fxp_mac64_Q31(nrg_h, aux1, aux1);
-        nrg_h = fxp_mac64_Q31(nrg_h, aux2, aux2);
-    }
-
-    /*
-     *  Check for overflow and saturate if needed
-     */
-    if (nrg_h < 0)
-    {
-        nrg_h = 0x7fffffff;
-    }
-
-
-    if (nrg_h)
-    {
-        tmp2 = (UInt32)(nrg_h >> 32);
-        if (tmp2)
-        {
-            aux2 = pv_normalize(tmp2);
-            aux2 -= 1;                  /*  ensure Q30 */
-            nrg_h = (nrg_h << aux2) >> 33;
-            tmp2 = (UInt32)(nrg_h);
-            nrg_est_exp[c] = 33 - aux2;
-        }
-        else
-        {
-            tmp2 = (UInt32)(nrg_h >> 2);
-            aux2 = pv_normalize(tmp2);
-            aux2 -= 1;                  /*  ensure Q30 */
-
-            tmp2 = (tmp2 << aux2);
-            nrg_est_exp[c] =  -aux2 + 2;
-        }
-
-        tmp1 = (l - ui2);
-
-        aux2 = pow2[tmp1];
-        if (tmp1 == (tmp1 & (-tmp1)))
-        {
-            nrg_est_man[c] = tmp2 >> aux2;
-        }
-        else
-        {
-            nrg_est_man[c] = fxp_mul32_by_16(tmp2, aux2);
-        }
-
-    }
-    else
-    {
-        nrg_est_man[c] = 0;
-        nrg_est_exp[c] = -100;
-    }
-
-
-
-
-
-}
-
-
-
-
-
-
-#if HQ_SBR
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void envelope_application(Int32  *aBufR,
-                          Int32  *aBufI,
-                          Int32  *nrg_gain_man,
-                          Int32  *nrg_gain_exp,
-                          Int32  *noise_level_man,
-                          Int32  *noise_level_exp,
-                          Int32  *nrg_tone_man,
-                          Int32  *nrg_tone_exp,
-                          Int32  *fBuf_man[64],
-                          Int32  *fBuf_exp[64],
-                          Int32  *fBufN_man[64],
-                          Int32  *fBufN_exp[64],
-                          const  Int32 *frame_info,
-                          Int32  *harm_index,
-                          Int32  *phase_index,
-                          Int32  i,
-                          Int32  lowSubband,
-                          Int32  noSubbands,
-                          Int32  noNoiseFlag,
-                          Int32  band_nrg_tone_detector,
-                          Int32  maxSmoothLength,
-                          Int32  smooth_length)
-{
-
-    Int32 *ptrReal;
-    Int32 *ptrImag;
-    Int32 sb_gain_man;
-    Int32 sb_gain_exp;
-    Int32 sb_noise_man;
-    Int32 sb_noise_exp;
-    Int32 l;
-    Int32 k;
-    Int32 n;
-    Int32 tmp_q1;
-    Int32 tmp_q2;
-    Int32  aux1;
-    Int32  aux2;
-    Int32  filter_history = 0;
-
-
-    if (band_nrg_tone_detector)     /* Add tone energy only if energy is detected  */
-    {
-
-        /*
-         *  pre-calculate tone application
-         */
-
-        ptrReal = nrg_tone_exp;
-        ptrImag = nrg_tone_man;
-        tmp_q1 = - *(ptrReal++);
-        aux1   =   *(ptrImag);
-        for (k = 0; k < noSubbands; k++)
-        {
-            *(ptrImag++) = aux1 >> tmp_q1;
-            tmp_q1 = - *(ptrReal++);
-            aux1   =   *(ptrImag);
-        }
-
-        /*
-         *          Application
-         */
-
-        for (l = (frame_info[1+i] << 1); l < (frame_info[2+i] << 1); l++)
-        {
-            ptrReal = (aBufR + l * SBR_NUM_BANDS);
-            ptrImag = (aBufI + l * SBR_NUM_BANDS);
-
-            if (filter_history <= maxSmoothLength)     /* no more update is needed as buffer will have same info */
-            {
-                pv_memmove(fBuf_man[maxSmoothLength], nrg_gain_man, noSubbands*sizeof(*nrg_gain_man));
-                pv_memmove(fBuf_exp[maxSmoothLength], nrg_gain_exp, noSubbands*sizeof(*nrg_gain_exp));
-                pv_memmove(fBufN_man[maxSmoothLength], noise_level_man, noSubbands*sizeof(*noise_level_man));
-                pv_memmove(fBufN_exp[maxSmoothLength], noise_level_exp, noSubbands*sizeof(*noise_level_exp));
-            }
-
-            /*
-             *  nrg_gain_max bounded to 1.584893192*1e5, which requires (32-bit) Q14 notation
-             */
-            for (k = 0; k < noSubbands; k++)
-            {
-                if (smooth_length == 0)     /* no filter-smooth needed */
-                {
-                    sb_gain_man = nrg_gain_man[k];
-                    sb_gain_exp = nrg_gain_exp[k];
-
-                    sb_noise_man = noise_level_man[k];
-                    sb_noise_exp = noise_level_exp[k];
-
-                }
-                else
-                {   /* else  smooth_length == 4  and fir_4 filter is being used */
-
-                    sb_gain_exp = fBuf_exp[maxSmoothLength][k];
-
-                    sb_noise_exp = fBufN_exp[maxSmoothLength][k];
-
-                    for (n = maxSmoothLength - smooth_length; n < maxSmoothLength; n++)
-                    {
-                        if (sb_gain_exp  < fBuf_exp[n][k])
-                        {
-                            sb_gain_exp = fBuf_exp[n][k];
-                        }
-
-                        if (sb_noise_exp  < fBufN_exp[n][k])
-                        {
-                            sb_noise_exp = fBufN_exp[n][k];
-                        }
-                    }
-
-                    sb_gain_man = fxp_mul32_Q30(fBuf_man[maxSmoothLength][k], Q30fmt(0.33333333333333f));
-                    sb_gain_man  = sb_gain_man >> (sb_gain_exp - fBuf_exp[maxSmoothLength][k]);
-
-                    sb_noise_man = fxp_mul32_Q30(fBufN_man[maxSmoothLength][k], Q30fmt(0.33333333333333f));
-                    sb_noise_man = sb_noise_man >> (sb_noise_exp - fBufN_exp[maxSmoothLength][k]);
-
-                    n = maxSmoothLength - smooth_length;
-
-                    tmp_q1 = fxp_mul32_Q30(fBuf_man[n][k], Q30fmt(0.03183050093751f));
-                    sb_gain_man  += tmp_q1 >> (sb_gain_exp - fBuf_exp[n][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBufN_man[n][k], Q30fmt(0.03183050093751f));
-                    sb_noise_man += tmp_q1 >> (sb_noise_exp - fBufN_exp[n++][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBuf_man[n][k], Q30fmt(0.11516383427084f));
-                    sb_gain_man  += tmp_q1 >> (sb_gain_exp - fBuf_exp[n][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBufN_man[n][k], Q30fmt(0.11516383427084f));
-                    sb_noise_man += tmp_q1 >> (sb_noise_exp - fBufN_exp[n++][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBuf_man[n][k], Q30fmt(0.21816949906249f));
-                    sb_gain_man  += tmp_q1 >> (sb_gain_exp - fBuf_exp[n][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBufN_man[n][k], Q30fmt(0.21816949906249f));
-                    sb_noise_man += tmp_q1 >> (sb_noise_exp - fBufN_exp[n++][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBuf_man[n][k], Q30fmt(0.30150283239582f));
-                    sb_gain_man  += tmp_q1 >> (sb_gain_exp - fBuf_exp[n][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBufN_man[n][k], Q30fmt(0.30150283239582f));
-                    sb_noise_man += tmp_q1 >> (sb_noise_exp - fBufN_exp[n][k]);
-
-                }
-
-
-
-                /*
-                 *    *ptrReal  = *ptrReal * sb_gain ;
-                 *    *ptrImag  = *ptrImag * sb_gain;
-                 */
-                aux1 = *ptrReal;
-                aux2 = *ptrImag;
-                sb_gain_exp += 32;
-                aux1 = fxp_mul32_Q31(aux1, sb_gain_man);
-                aux2 = fxp_mul32_Q31(aux2, sb_gain_man);
-
-
-                if (sb_gain_exp < 0)
-                {
-                    sb_gain_exp = -sb_gain_exp;
-                    if (sb_gain_exp < 32)
-                    {
-                        *ptrReal = (aux1 >> sb_gain_exp);
-                        *ptrImag = (aux2 >> sb_gain_exp);
-                    }
-                }
-                else
-                {
-                    *ptrReal = (aux1 << sb_gain_exp);
-                    *ptrImag = (aux2 << sb_gain_exp);
-                }
-
-
-
-                /*
-                 *     if ( sb_noise != 0)
-                 *     {
-                 *         *ptrReal += sb_noise * rP[*phase_index][0];
-                 *         *ptrImag += sb_noise * rP[*phase_index][1];
-                 *     }
-                 */
-                *phase_index = (*phase_index + 1) & 511;
-
-                if (nrg_tone_man[k] || noNoiseFlag)
-                {
-                    sb_noise_man = 0;
-                    sb_noise_exp = 0;
-                }
-                else
-                {
-
-                    Int32 tmp = rPxx[*phase_index];
-                    sb_noise_exp += 1;
-                    tmp_q1 = fxp_mul32_by_16t(sb_noise_man, tmp);
-                    tmp_q2 = fxp_mul32_by_16b(sb_noise_man, tmp);
-
-
-                    if (sb_noise_exp < 0)
-                    {
-                        if (sb_noise_exp > -32)
-                        {
-                            *ptrReal += tmp_q1 >> (-sb_noise_exp);
-                            *ptrImag += tmp_q2 >> (-sb_noise_exp);
-                        }
-                    }
-                    else
-                    {
-                        *ptrReal += tmp_q1 << sb_noise_exp;
-                        *ptrImag += tmp_q2 << sb_noise_exp;
-                    }
-                }
-
-                /*
-                 *      tmp_q1 = nrg_tone[k]
-                 */
-
-                tmp_q1 = nrg_tone_man[k];
-
-                if (*harm_index & 1)
-                {
-                    if ((((k + lowSubband) & 1) != 0) ^(*harm_index != 1))
-                    {
-                        *ptrImag  -=  tmp_q1;
-                    }
-                    else
-                    {
-                        *ptrImag  +=  tmp_q1;
-                    }
-                }
-                else
-                {
-                    *ptrReal += (*harm_index) ? -tmp_q1 : tmp_q1;
-                }
-
-                *ptrReal++ <<= 10;
-                *ptrImag++ <<= 10;
-
-
-            }    /*  for-loop (k) */
-
-
-            *harm_index = (*harm_index + 1) & 3;
-
-            /*
-             *  Update smoothing filter history
-             */
-
-            if (filter_history++ < maxSmoothLength)     /* no more update is needed as buffer will have same info */
-            {
-                /*
-                 *  mantissas
-                 */
-
-                ptrReal = (Int32 *)fBuf_man[0];
-                ptrImag = (Int32 *)fBufN_man[0];
-
-                for (n = 0; n < maxSmoothLength; n++)
-                {
-                    fBuf_man[n]  = fBuf_man[n+1];
-                    fBufN_man[n] = fBufN_man[n+1];
-                }
-
-                fBuf_man[maxSmoothLength]  = ptrReal;
-                fBufN_man[maxSmoothLength] = ptrImag;
-
-                /*
-                 *  exponents
-                 */
-                ptrReal = (Int32 *)fBuf_exp[0];
-                ptrImag = (Int32 *)fBufN_exp[0];
-
-                for (n = 0; n < maxSmoothLength; n++)
-                {
-                    fBuf_exp[n]  = fBuf_exp[n+1];
-                    fBufN_exp[n] = fBufN_exp[n+1];
-                }
-
-                fBuf_exp[maxSmoothLength]  = ptrReal;
-                fBufN_exp[maxSmoothLength] = ptrImag;
-            }
-
-        }   /*  for-loop (l) */
-
-
-    }
-    else        /*   ----  if ( band_nrg_tone_detector) ---- */
-    {
-
-        /*
-         *          Application
-         */
-
-        for (l = (frame_info[1+i] << 1); l < (frame_info[2+i] << 1); l++)
-        {
-            ptrReal = (aBufR + l * SBR_NUM_BANDS);
-            ptrImag = (aBufI + l * SBR_NUM_BANDS);
-
-            if (filter_history <= maxSmoothLength)     /* no more update is needed as buffer will have same info */
-            {
-                pv_memmove(fBuf_man[maxSmoothLength], nrg_gain_man, noSubbands*sizeof(*nrg_gain_man));
-                pv_memmove(fBuf_exp[maxSmoothLength], nrg_gain_exp, noSubbands*sizeof(*nrg_gain_exp));
-                pv_memmove(fBufN_man[maxSmoothLength], noise_level_man, noSubbands*sizeof(*noise_level_man));
-                pv_memmove(fBufN_exp[maxSmoothLength], noise_level_exp, noSubbands*sizeof(*noise_level_exp));
-            }
-
-            /*
-             *  nrg_gain_max bounded to 1.584893192*1e5, which requires (32-bit) Q14 notation
-             */
-            for (k = 0; k < noSubbands; k++)
-            {
-                if (smooth_length == 0)     /* no filter-smooth needed */
-                {
-                    sb_gain_man = nrg_gain_man[k];
-                    sb_gain_exp = nrg_gain_exp[k];
-
-                    sb_noise_man = noise_level_man[k];
-                    sb_noise_exp = noise_level_exp[k];
-
-                }
-                else
-                {   /* else  smooth_length == 4  and fir_4 filter is being used */
-
-                    sb_gain_exp = fBuf_exp[maxSmoothLength][k];
-
-                    sb_noise_exp = fBufN_exp[maxSmoothLength][k];
-
-                    for (n = maxSmoothLength - smooth_length; n < maxSmoothLength; n++)
-                    {
-                        if (sb_gain_exp  < fBuf_exp[n][k])
-                        {
-                            sb_gain_exp = fBuf_exp[n][k];
-                        }
-
-                        if (sb_noise_exp  < fBufN_exp[n][k])
-                        {
-                            sb_noise_exp = fBufN_exp[n][k];
-                        }
-                    }
-
-                    sb_gain_man = fxp_mul32_Q30(fBuf_man[maxSmoothLength][k], Q30fmt(0.33333333333333f));
-                    sb_gain_man  = sb_gain_man >> (sb_gain_exp - fBuf_exp[maxSmoothLength][k]);
-
-                    sb_noise_man = fxp_mul32_Q30(fBufN_man[maxSmoothLength][k], Q30fmt(0.33333333333333f));
-                    sb_noise_man = sb_noise_man >> (sb_noise_exp - fBufN_exp[maxSmoothLength][k]);
-
-                    n = maxSmoothLength - smooth_length;
-
-                    tmp_q1 = fxp_mul32_Q30(fBuf_man[n][k], Q30fmt(0.03183050093751f));
-                    sb_gain_man  += tmp_q1 >> (sb_gain_exp - fBuf_exp[n][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBufN_man[n][k], Q30fmt(0.03183050093751f));
-                    sb_noise_man += tmp_q1 >> (sb_noise_exp - fBufN_exp[n++][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBuf_man[n][k], Q30fmt(0.11516383427084f));
-                    sb_gain_man  += tmp_q1 >> (sb_gain_exp - fBuf_exp[n][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBufN_man[n][k], Q30fmt(0.11516383427084f));
-                    sb_noise_man += tmp_q1 >> (sb_noise_exp - fBufN_exp[n++][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBuf_man[n][k], Q30fmt(0.21816949906249f));
-                    sb_gain_man  += tmp_q1 >> (sb_gain_exp - fBuf_exp[n][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBufN_man[n][k], Q30fmt(0.21816949906249f));
-                    sb_noise_man += tmp_q1 >> (sb_noise_exp - fBufN_exp[n++][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBuf_man[n][k], Q30fmt(0.30150283239582f));
-                    sb_gain_man  += tmp_q1 >> (sb_gain_exp - fBuf_exp[n][k]);
-
-                    tmp_q1 = fxp_mul32_Q30(fBufN_man[n][k], Q30fmt(0.30150283239582f));
-                    sb_noise_man += tmp_q1 >> (sb_noise_exp - fBufN_exp[n][k]);
-
-                }
-
-
-
-                /*
-                 *    *ptrReal  = *ptrReal * sb_gain ;
-                 *    *ptrImag  = *ptrImag * sb_gain;
-                 */
-                aux1 = *ptrReal;
-                aux2 = *ptrImag;
-                sb_gain_exp += 32;
-                aux1 = fxp_mul32_Q31(aux1, sb_gain_man);
-                aux2 = fxp_mul32_Q31(aux2, sb_gain_man);
-
-
-
-                /*
-                 *     if ( sb_noise != 0)
-                 *     {
-                 *         *ptrReal += sb_noise * rP[*phase_index][0];
-                 *         *ptrImag += sb_noise * rP[*phase_index][1];
-                 *     }
-                 */
-
-
-                if (sb_gain_exp < 0)
-                {
-                    if (sb_gain_exp > -32)
-                    {
-                        if (sb_gain_exp > -10)
-                        {
-                            *ptrReal = aux1 << (10 + sb_gain_exp);
-                            *ptrImag = aux2 << (10 + sb_gain_exp);
-                        }
-                        else
-                        {
-                            *ptrReal = aux1 >> (-sb_gain_exp - 10);
-                            *ptrImag = aux2 >> (-sb_gain_exp - 10);
-                        }
-                    }
-                }
-                else
-                {
-                    *ptrReal = aux1 << (sb_gain_exp + 10);
-                    *ptrImag = aux2 << (sb_gain_exp + 10);
-                }
-
-
-
-
-                /*
-                 *     if ( sb_noise != 0)
-                 *     {
-                 *         *ptrReal += sb_noise * rP[*phase_index][0];
-                 *         *ptrImag += sb_noise * rP[*phase_index][1];
-                 *     }
-                 */
-                *phase_index = (*phase_index + 1) & 511;
-
-                if (!noNoiseFlag)
-                {
-
-                    Int32 tmp = rPxx[*phase_index];
-                    sb_noise_exp += 1;
-                    tmp_q1 = fxp_mul32_by_16t(sb_noise_man, tmp);
-                    tmp_q2 = fxp_mul32_by_16b(sb_noise_man, tmp);
-
-                    if (sb_noise_exp < 0)
-                    {
-                        if (sb_noise_exp > -32)
-                        {
-                            if (sb_noise_exp > -10)
-                            {
-                                *ptrReal += tmp_q1 << (10 + sb_noise_exp);
-                                *ptrImag += tmp_q2 << (10 + sb_noise_exp);
-                            }
-                            else
-                            {
-                                *ptrReal += tmp_q1 >> (-sb_noise_exp - 10);
-                                *ptrImag += tmp_q2 >> (-sb_noise_exp - 10);
-                            }
-                        }
-                    }
-                    else
-                    {
-                        *ptrReal += tmp_q1 << (sb_noise_exp + 10);
-                        *ptrImag += tmp_q2 << (sb_noise_exp + 10);
-                    }
-                }
-
-                ptrReal++;
-                ptrImag++;
-
-
-            }    /*  for-loop (k) */
-
-
-            *harm_index = (*harm_index + 1) & 3;
-
-            /*
-             *  Update smoothing filter history
-             */
-
-            if (filter_history++ < maxSmoothLength)     /* no more update is needed as buffer will have same info */
-            {
-                /*
-                 *  mantissas
-                 */
-
-                ptrReal = (Int32 *)fBuf_man[0];
-                ptrImag = (Int32 *)fBufN_man[0];
-
-                for (n = 0; n < maxSmoothLength; n++)
-                {
-                    fBuf_man[n]  = fBuf_man[n+1];
-                    fBufN_man[n] = fBufN_man[n+1];
-                }
-
-                fBuf_man[maxSmoothLength]  = ptrReal;
-                fBufN_man[maxSmoothLength] = ptrImag;
-
-                /*
-                 *  exponents
-                 */
-                ptrReal = (Int32 *)fBuf_exp[0];
-                ptrImag = (Int32 *)fBufN_exp[0];
-
-                for (n = 0; n < maxSmoothLength; n++)
-                {
-                    fBuf_exp[n]  = fBuf_exp[n+1];
-                    fBufN_exp[n] = fBufN_exp[n+1];
-                }
-
-                fBuf_exp[maxSmoothLength]  = ptrReal;
-                fBufN_exp[maxSmoothLength] = ptrImag;
-            }
-
-        }   /*  for-loop (l) */
-
-    }       /*  if ( band_nrg_tone_detector) */
-
-}
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void energy_estimation(Int32 *aBufR,
-                       Int32 *aBufI,
-                       Int32 *nrg_est_man,
-                       Int32 *nrg_est_exp,
-                       const Int32 *frame_info,
-                       Int32 i,
-                       Int32 k,
-                       Int32 c,
-                       Int32 ui2)
-{
-
-    Int32  aux1;
-    Int32  aux2;
-    Int32  l;
-
-
-
-    int64_t nrg_h = 0;
-    Int32 tmp1;
-    Int32 tmp2;
-
-    aux1 = aBufR[ui2*SBR_NUM_BANDS + k];
-    aux2 = aBufI[ui2*SBR_NUM_BANDS + k];
-    for (l = ui2 + 1; l < (frame_info[2+i] << 1);  l++)
-    {
-        nrg_h = fxp_mac64_Q31(nrg_h, aux1, aux1);
-        nrg_h = fxp_mac64_Q31(nrg_h, aux2, aux2);
-        aux1 = aBufR[l*SBR_NUM_BANDS + k];
-        aux2 = aBufI[l*SBR_NUM_BANDS + k];
-    }
-    nrg_h = fxp_mac64_Q31(nrg_h, aux1, aux1);
-    nrg_h = fxp_mac64_Q31(nrg_h, aux2, aux2);
-
-
-    /*
-     *  Check for overflow and saturate if needed
-     */
-    if (nrg_h < 0)
-    {
-        nrg_h = 0x7fffffff;
-    }
-
-    if (nrg_h)
-    {
-
-        aux1 = (UInt32)(nrg_h >> 32);
-        if (aux1)
-        {
-            aux2 = pv_normalize(aux1);
-            if (aux2)
-            {
-                aux2 -= 1;                  /*  ensure Q30 */
-                nrg_h = (nrg_h << aux2) >> 33;
-                tmp2 = (UInt32)(nrg_h);
-                nrg_est_exp[c] = 33 - aux2;
-            }
-            else
-            {
-                tmp2 = (UInt32)(aux1 >> 1);
-                nrg_est_exp[c] = 33 ;
-
-
-            }
-        }
-        else
-        {
-            aux1 = (UInt32)(nrg_h >> 1);
-            aux2 = pv_normalize(aux1);
-
-            tmp2 = (aux1 << aux2);
-            nrg_est_exp[c] =  -aux2 + 1;
-
-
-        }
-
-
-
-        tmp1 = (l - ui2);
-        aux2 = pow2[tmp1];
-        if (tmp1 == (tmp1 & (-tmp1)))
-        {
-            nrg_est_man[c] = tmp2 >> aux2;
-        }
-        else
-        {
-            nrg_est_man[c] = fxp_mul32_by_16(tmp2, aux2);
-        }
-    }
-    else
-    {
-        nrg_est_man[c] = 0;
-        nrg_est_exp[c] = -100;
-    }
-
-
-}
-
-
-
-
-
-#endif
-
-
-#endif
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/calc_sbr_envelope.h b/media/libstagefright/codecs/aacdec/calc_sbr_envelope.h
deleted file mode 100644
index 2a6ae57..0000000
--- a/media/libstagefright/codecs/aacdec/calc_sbr_envelope.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: calc_sbr_envelope.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef CALCULATE_SBR_ENVELOPE_H
-#define CALCULATE_SBR_ENVELOPE_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "s_sbr_frame_data.h"
-#include    "sbr_generate_high_freq.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    void calc_sbr_envelope(SBR_FRAME_DATA *frameData,
-    Int32 *aBufR,
-    Int32 *aBufI,
-    Int    freqBandTable1[2][MAX_FREQ_COEFFS + 1],
-    const Int32 *nSfb,
-    Int32   freqBandTable2[MAX_NOISE_COEFFS + 1],
-    Int32   nNBands,
-    Int32   reset,
-    Int32 *degreeAlias,
-    Int32 *harm_index,
-    Int32 *phase_index,
-    Int32 hFp[64],
-    Int32 *sUp,
-    Int32 limSbc[][13],
-    Int32 *gateMode,
-#ifdef HQ_SBR
-    Int32 *fBuf_man[64],
-    Int32 *fBuf_exp[64],
-    Int32 *fBufN_man[64],
-    Int32 *fBufN_exp[64],
-#endif
-    Int32 scratch_mem[][64],
-    struct PATCH Patch,
-    Int32  sqrt_cache[][4],
-    Int32  LC_flag);
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif   /*  CALCULATE_SBR_ENVELOPE_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/calc_sbr_synfilterbank.cpp b/media/libstagefright/codecs/aacdec/calc_sbr_synfilterbank.cpp
deleted file mode 100644
index e557aa1..0000000
--- a/media/libstagefright/codecs/aacdec/calc_sbr_synfilterbank.cpp
+++ /dev/null
@@ -1,639 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Filename: calc_sbr_synfilterbank.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-#ifdef AAC_PLUS
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "calc_sbr_synfilterbank.h"
-#include    "qmf_filterbank_coeff.h"
-#include    "synthesis_sub_band.h"
-#include    "fxp_mul32.h"
-#include    "aac_mem_funcs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-#if defined (PV_ARM_V5)
-
-
-__inline Int16 sat(Int32 y)
-{
-    Int32 x;
-    __asm
-    {
-        qdadd y, y, y
-        mov y, y, asr #16
-    }
-
-    return((Int16)y);
-}
-
-#define saturate2( a, b, c, d)      *c = sat( a);   \
-                                    *d = sat( b);   \
-                                    c += 2;         \
-                                    d -= 2;
-
-
-#elif defined (PV_ARM_V4)
-
-
-__inline Int16 sat(Int32 y)
-{
-    Int32 x;
-    Int32 z = 31; /* rvct compiler problem */
-    __asm
-    {
-        sub y, y, y, asr 2
-        mov y, y, asr N
-        mov x, y, asr #15
-        teq x, y, asr z
-        eorne  y, INT16_MAX, y, asr #31
-    }
-
-    return((Int16)y);
-}
-
-#define saturate2( a, b, c, d)      *c = sat( a);   \
-                                    *d = sat( b);   \
-                                    c += 2;         \
-                                    d -= 2;
-
-#elif defined(PV_ARM_GCC_V5)
-
-__inline Int16 sat(Int32 y)
-{
-    register Int32 x;
-    register Int32 ra = y;
-
-
-    asm volatile(
-        "qdadd %0, %1, %1\n\t"
-        "mov %0, %0, asr #16"
-    : "=&r*i"(x)
-                : "r"(ra));
-
-    return ((Int16)x);
-}
-
-
-#define saturate2( a, b, c, d)      *c = sat( a);   \
-                                    *d = sat( b);   \
-                                    c += 2;         \
-                                    d -= 2;
-
-
-#elif defined(PV_ARM_MSC_EVC_V5)
-
-#include "armintr.h"
-
-#define saturate2( a, b, c, d)      *c = _DAddSatInt( a, a)>>16;   \
-                                    *d = _DAddSatInt( b, b)>>16;   \
-                                    c += 2;         \
-                                    d -= 2;
-
-#else
-
-
-#define   saturate2( a, b, c, d)    a -= (a>>2);                             \
-                                    a  = (a>>N);                     \
-                                    if((a>>15) != (a>>31))                   \
-                                    {                                        \
-                                        a = ((a >> 31) ^ INT16_MAX); \
-                                    }                                        \
-                                    *c = (Int16)a;                           \
-                                    c += 2;                                  \
-                                    b -= (b>>2);                             \
-                                    b =  (b>>N);                      \
-                                    if((b>>15) != (b>>31))                   \
-                                    {                                        \
-                                        b = ((b >> 31) ^ INT16_MAX); \
-                                    }                                        \
-                                    *d = (Int16)b;                           \
-                                    d -= 2;
-
-
-#endif
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void calc_sbr_synfilterbank_LC(Int32 * Sr,
-                               Int16 * timeSig,
-                               Int16   V[1280],
-                               bool bDownSampleSBR)
-{
-    Int32 i;
-
-    Int32   realAccu1;
-    Int32   realAccu2;
-    const Int32 *pt_C2;
-
-    Int16 *pt_V1;
-    Int16 *pt_V2;
-
-
-    Int16 *pt_timeSig;
-
-    Int16 *pt_timeSig_2;
-    Int32  test1;
-    Int16  tmp1;
-    Int16  tmp2;
-
-    /* shift filterstates */
-
-    Int32 * pt_Sr = Sr;
-
-
-    if (bDownSampleSBR == false)
-    {
-
-        synthesis_sub_band_LC(pt_Sr, V);
-
-        /* content of V[] is at most 16 bits */
-
-        pt_timeSig   = &timeSig[0];
-        pt_timeSig_2 = &timeSig[64];
-
-
-        tmp1 = V[ 704];
-        tmp2 = V[ 768];
-        realAccu1 =  fxp_mac_16_by_16(tmp1, Qfmt(0.853738560F), ROUND_SYNFIL);
-        realAccu1 =  fxp_mac_16_by_16(tmp2, Qfmt(-0.361158990F), realAccu1);
-        tmp1 = -V[ 512];
-        tmp2 =  V[ 960];
-        realAccu1 =  fxp_mac_16_by_16(tmp1, Qfmt(-0.361158990F), realAccu1);
-        realAccu1 =  fxp_mac_16_by_16(tmp2, Qfmt(0.070353307F), realAccu1);
-        tmp1 =  V[ 448];
-        tmp2 =  V[1024];
-        realAccu1 =  fxp_mac_16_by_16(tmp1, Qfmt(0.070353307F), realAccu1);
-        realAccu1 =  fxp_mac_16_by_16(tmp2, Qfmt(-0.013271822F), realAccu1);
-        tmp1 =  -V[ 256];
-        tmp2 =   V[ 192];
-        realAccu1 =  fxp_mac_16_by_16(tmp1, Qfmt(-0.013271822F), realAccu1);
-        realAccu1 =  fxp_mac_16_by_16(tmp2, Qfmt(0.002620176F), realAccu1);
-        realAccu1 =  fxp_mac_16_by_16(V[1216], Qfmt(0.002620176F), realAccu1);
-
-        tmp1 = V[  32];
-        tmp2 = V[1248];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(-0.000665042F), ROUND_SYNFIL);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(-0.000665042F), realAccu2);
-        tmp1 = V[ 224];
-        tmp2 = V[1056];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(0.005271576F), realAccu2);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(0.005271576F), realAccu2);
-        tmp1 = V[ 992];
-        tmp2 = V[ 288];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(0.058591568F), realAccu2);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(0.058591568F), realAccu2);
-        tmp1 = V[ 480];
-        tmp2 = V[ 800];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(-0.058370533F), realAccu2);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(-0.058370533F), realAccu2);
-        tmp1 = V[ 736];
-        tmp2 = V[ 544];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(0.702238872F), realAccu2);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(0.702238872F), realAccu2);
-
-
-
-        saturate2(realAccu1, realAccu2, pt_timeSig, pt_timeSig_2);
-
-        pt_timeSig_2 = &timeSig[126];
-
-        pt_V1 = &V[1];
-        pt_V2 = &V[1279];
-
-        pt_C2 = &sbrDecoderFilterbankCoefficients[0];
-
-        for (i = 31; i != 0; i--)
-        {
-            test1 = *(pt_C2++);
-            tmp1 = *(pt_V1++);
-            tmp2 = *(pt_V2--);
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, ROUND_SYNFIL);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, ROUND_SYNFIL);
-            tmp1 = pt_V1[  191];
-            tmp2 = pt_V2[ -191];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            test1 = *(pt_C2++);
-            tmp1 = pt_V1[  255];
-            tmp2 = pt_V2[ -255];
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, realAccu2);
-            tmp1 = pt_V1[  447];
-            tmp2 = pt_V2[ -447];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            test1 = *(pt_C2++);
-            tmp1 = pt_V1[  511];
-            tmp2 = pt_V2[ -511];
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, realAccu2);
-            tmp1 = pt_V1[  703];
-            tmp2 = pt_V2[ -703];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            test1 = *(pt_C2++);
-            tmp1 = pt_V1[  767];
-            tmp2 = pt_V2[ -767];
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, realAccu2);
-            tmp1 = pt_V1[  959];
-            tmp2 = pt_V2[ -959];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            test1 = *(pt_C2++);
-            tmp1 = pt_V1[  1023];
-            tmp2 = pt_V2[ -1023];
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, realAccu2);
-            tmp1 = pt_V1[  1215];
-            tmp2 = pt_V2[ -1215];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            saturate2(realAccu1, realAccu2, pt_timeSig, pt_timeSig_2);
-
-        }
-    }
-    else
-    {
-
-        synthesis_sub_band_LC_down_sampled(Sr, V);
-
-        /*
-         *    window signal
-         *    calculate output samples
-         */
-
-
-        pt_V1 = &V[0];
-        pt_V2 = &V[96];
-
-
-        Int32 * pt_out = Sr;
-
-        for (i = 0; i < 8; i++)
-        {
-            *(pt_out++) = 0;
-            *(pt_out++) = 0;
-            *(pt_out++) = 0;
-            *(pt_out++) = 0;
-        }
-
-        const Int32* pt_C1 = &sbrDecoderFilterbankCoefficients_down_smpl[0];
-        pt_C2 = &sbrDecoderFilterbankCoefficients_down_smpl[16];
-
-        for (int k = 0; k < 5; k++)
-        {
-            pt_out -= 32;
-            for (i = 0; i < 16; i++)
-            {
-                realAccu1   = fxp_mul_16_by_16bt(*(pt_V1++), *(pt_C1));
-                realAccu2   = fxp_mul_16_by_16bb(*(pt_V1++), *(pt_C1++));
-                realAccu1   = fxp_mac_16_by_16_bt(*(pt_V2++), *(pt_C2), realAccu1);
-                realAccu2   = fxp_mac_16_by_16_bb(*(pt_V2++), *(pt_C2++), realAccu2);
-                *(pt_out++) += realAccu1 >> 5;
-                *(pt_out++) += realAccu2 >> 5;
-
-            }
-            pt_V1 += 96;
-            pt_V2 += 96;
-            pt_C1 += 16;
-            pt_C2 += 16;
-        }
-        pt_out -= 32;
-
-        for (i = 0; i < 32; i++)
-        {
-            timeSig[2*i] = (Int16)((*(pt_out++) + 512) >> 10);
-        }
-
-    }
-
-}
-
-
-
-#ifdef HQ_SBR
-
-void calc_sbr_synfilterbank(Int32 * Sr,
-                            Int32 * Si,
-                            Int16 * timeSig,
-                            Int16   V[1280],
-                            bool bDownSampleSBR)
-{
-    Int32 i;
-
-    const Int32 *pt_C2;
-
-    Int32   realAccu1;
-    Int32   realAccu2;
-
-    Int16 *pt_V1;
-    Int16 *pt_V2;
-
-    Int16 *pt_timeSig;
-
-    Int16 *pt_timeSig_2;
-    Int32  test1;
-    Int16  tmp1;
-    Int16  tmp2;
-
-
-    if (bDownSampleSBR == false)
-    {
-        synthesis_sub_band(Sr, Si, V);
-
-        /* content of V[] is at most 16 bits */
-        pt_timeSig   = &timeSig[0];
-        pt_timeSig_2 = &timeSig[64];
-
-        tmp1 = V[ 704];
-        tmp2 = V[ 768];
-        realAccu1 =  fxp_mac_16_by_16(tmp1, Qfmt(0.853738560F), ROUND_SYNFIL);
-        realAccu1 =  fxp_mac_16_by_16(tmp2, Qfmt(-0.361158990F), realAccu1);
-        tmp1 = -V[ 512];
-        tmp2 =  V[ 960];
-        realAccu1 =  fxp_mac_16_by_16(tmp1, Qfmt(-0.361158990F), realAccu1);
-        realAccu1 =  fxp_mac_16_by_16(tmp2, Qfmt(0.070353307F), realAccu1);
-        tmp1 =  V[ 448];
-        tmp2 =  V[1024];
-        realAccu1 =  fxp_mac_16_by_16(tmp1, Qfmt(0.070353307F), realAccu1);
-        realAccu1 =  fxp_mac_16_by_16(tmp2, Qfmt(-0.013271822F), realAccu1);
-        tmp1 =  -V[ 256];
-        tmp2 =   V[ 192];
-        realAccu1 =  fxp_mac_16_by_16(tmp1, Qfmt(-0.013271822F), realAccu1);
-        realAccu1 =  fxp_mac_16_by_16(tmp2, Qfmt(0.002620176F), realAccu1);
-        realAccu1 =  fxp_mac_16_by_16(V[1216], Qfmt(0.002620176F), realAccu1);
-
-        tmp1 = V[  32];
-        tmp2 = V[1248];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(-0.000665042F), ROUND_SYNFIL);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(-0.000665042F), realAccu2);
-        tmp1 = V[ 224];
-        tmp2 = V[1056];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(0.005271576F), realAccu2);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(0.005271576F), realAccu2);
-        tmp1 = V[ 992];
-        tmp2 = V[ 288];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(0.058591568F), realAccu2);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(0.058591568F), realAccu2);
-        tmp1 = V[ 480];
-        tmp2 = V[ 800];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(-0.058370533F), realAccu2);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(-0.058370533F), realAccu2);
-        tmp1 = V[ 736];
-        tmp2 = V[ 544];
-        realAccu2 =  fxp_mac_16_by_16(tmp1, Qfmt(0.702238872F), realAccu2);
-        realAccu2 =  fxp_mac_16_by_16(tmp2, Qfmt(0.702238872F), realAccu2);
-
-
-        saturate2(realAccu1, realAccu2, pt_timeSig, pt_timeSig_2);
-
-        pt_timeSig_2 = &timeSig[126];
-
-        pt_V1 = &V[1];
-        pt_V2 = &V[1279];
-
-        pt_C2 = &sbrDecoderFilterbankCoefficients[0];
-
-        for (i = 31; i != 0; i--)
-        {
-            test1 = *(pt_C2++);
-            tmp1 = *(pt_V1++);
-            tmp2 = *(pt_V2--);
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, ROUND_SYNFIL);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, ROUND_SYNFIL);
-            tmp1 = pt_V1[  191];
-            tmp2 = pt_V2[ -191];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            test1 = *(pt_C2++);
-            tmp1 = pt_V1[  255];
-            tmp2 = pt_V2[ -255];
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, realAccu2);
-            tmp1 = pt_V1[  447];
-            tmp2 = pt_V2[ -447];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            test1 = *(pt_C2++);
-            tmp1 = pt_V1[  511];
-            tmp2 = pt_V2[ -511];
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, realAccu2);
-            tmp1 = pt_V1[  703];
-            tmp2 = pt_V2[ -703];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            test1 = *(pt_C2++);
-            tmp1 = pt_V1[  767];
-            tmp2 = pt_V2[ -767];
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, realAccu2);
-            tmp1 = pt_V1[  959];
-            tmp2 = pt_V2[ -959];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            test1 = *(pt_C2++);
-            tmp1 = pt_V1[  1023];
-            tmp2 = pt_V2[ -1023];
-            realAccu1 =  fxp_mac_16_by_16_bt(tmp1 , test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bt(tmp2 , test1, realAccu2);
-            tmp1 = pt_V1[  1215];
-            tmp2 = pt_V2[ -1215];
-            realAccu1 =  fxp_mac_16_by_16_bb(tmp1, test1, realAccu1);
-            realAccu2 =  fxp_mac_16_by_16_bb(tmp2, test1, realAccu2);
-
-            saturate2(realAccu1, realAccu2, pt_timeSig, pt_timeSig_2);
-        }
-
-    }
-    else
-    {
-
-        synthesis_sub_band_down_sampled(Sr,  Si,  V);
-
-
-        Int32 * pt_out = Sr;
-
-        for (i = 0; i < 8; i++)
-        {
-            *(pt_out++) = 0;
-            *(pt_out++) = 0;
-            *(pt_out++) = 0;
-            *(pt_out++) = 0;
-        }
-
-
-        /*
-         *    window signal
-         *    calculate output samples
-         */
-
-        pt_V1 = &V[0];
-        pt_V2 = &V[96];
-
-
-        const Int32* pt_C1 = &sbrDecoderFilterbankCoefficients_down_smpl[0];
-        pt_C2 = &sbrDecoderFilterbankCoefficients_down_smpl[16];
-
-        for (Int k = 0; k < 5; k++)
-        {
-            pt_out -= 32;
-            for (i = 0; i < 16; i++)
-            {
-                realAccu1   = fxp_mul_16_by_16bt(*(pt_V1++), *(pt_C1));
-                realAccu2   = fxp_mul_16_by_16bb(*(pt_V1++), *(pt_C1++));
-                realAccu1   = fxp_mac_16_by_16_bt(*(pt_V2++), *(pt_C2), realAccu1);
-                realAccu2   = fxp_mac_16_by_16_bb(*(pt_V2++), *(pt_C2++), realAccu2);
-                *(pt_out++) += realAccu1 >> 5;
-                *(pt_out++) += realAccu2 >> 5;
-            }
-            pt_V1 += 96;
-            pt_V2 += 96;
-            pt_C1 += 16;
-            pt_C2 += 16;
-        }
-        pt_out -= 32;
-
-        for (i = 0; i < 32; i++)
-        {
-            timeSig[2*i] = (Int16)((*(pt_out++) + 512) >> 10);
-        }
-
-    }
-}
-
-
-#endif      /* --- HQ_SBR --- */
-
-
-#endif      /* --- AAC_PLUS --- */
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/calc_sbr_synfilterbank.h b/media/libstagefright/codecs/aacdec/calc_sbr_synfilterbank.h
deleted file mode 100644
index 28bd6de..0000000
--- a/media/libstagefright/codecs/aacdec/calc_sbr_synfilterbank.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef CALC_SBR_SYNFILTERBANK_H
-#define CALC_SBR_SYNFILTERBANK_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-#define N  14
-
-#define ROUND_SYNFIL  (32768 + 4096)
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-
-    void calc_sbr_synfilterbank_LC(Int32 * Sr,
-    Int16 * timeSig,
-    Int16   V[1280],
-    bool bDownSampleSBR);
-
-#ifdef HQ_SBR
-
-
-    void calc_sbr_synfilterbank(Int32 * Sr,
-                                Int32 * Si,
-                                Int16 * timeSig,
-                                Int16   V[1280],
-                                bool bDownSampleSBR);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/chans.h b/media/libstagefright/codecs/aacdec/chans.h
deleted file mode 100644
index 325b5cd..0000000
--- a/media/libstagefright/codecs/aacdec/chans.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname:   chans.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Placed file in the correct template format.
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef CHANS_H
-#define CHANS_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-    /* #define is required in order to use these args in #if () directive */
-#define ICChans 0
-#define DCChans 0
-#define XCChans 0
-#define CChans  0
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-    enum
-    {
-        /*
-         * channels for 5.1 main profile configuration
-         * (modify for any desired decoder configuration)
-         */
-        FChans  = 2,    /* front channels: left, center, right */
-        FCenter = 0,    /* 1 if decoder has front center channel */
-        SChans  = 0,    /* side channels: */
-        BChans  = 0,    /* back channels: left surround, right surround */
-        BCenter = 0,    /* 1 if decoder has back center channel */
-        LChans  = 0,    /* LFE channels */
-        XChans  = 0,    /* scratch space for parsing unused channels */
-
-        Chans   = FChans + SChans + BChans + LChans + XChans
-    };
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* CHANS_H */
-
diff --git a/media/libstagefright/codecs/aacdec/check_crc.cpp b/media/libstagefright/codecs/aacdec/check_crc.cpp
deleted file mode 100644
index 17f3b87..0000000
--- a/media/libstagefright/codecs/aacdec/check_crc.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: check_crc.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    INPUT
-
-
-    OUTPUT
-
-    errorCode, noError if successful
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "check_crc.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void check_crc(HANDLE_CRC hCrcBuf, UInt32 bValue, Int32 nBits)
-{
-    Int32 i;
-    UInt32 bMask = (1UL << (nBits - 1));
-
-    for (i = 0; i < nBits; i++, bMask >>= 1)
-    {
-        UInt16 flag  = (UInt16)((hCrcBuf->crcState & hCrcBuf->crcMask) ? 1 : 0);
-        UInt16 flag1 = (UInt16)((bMask & bValue) ? 1 : 0);
-
-        flag ^= flag1;
-        hCrcBuf->crcState <<= 1;
-        if (flag)
-            hCrcBuf->crcState ^= hCrcBuf->crcPoly;
-    }
-
-}
-
diff --git a/media/libstagefright/codecs/aacdec/check_crc.h b/media/libstagefright/codecs/aacdec/check_crc.h
deleted file mode 100644
index 9293d47..0000000
--- a/media/libstagefright/codecs/aacdec/check_crc.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Filename: check_crc.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef CHECK_CRC_H
-#define CHECK_CRC_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_crc_buffer.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    void check_crc(HANDLE_CRC hCrcBuf,
-    UInt32 bValue,
-    Int32 nBits);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/dct16.cpp b/media/libstagefright/codecs/aacdec/dct16.cpp
deleted file mode 100644
index 75bd4ba..0000000
--- a/media/libstagefright/codecs/aacdec/dct16.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Filename: dct16.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 16
-
-    Int32 flag           1  forward dct16, 0 modified dct-16
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement dct of lenght 16
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#include "dct16.h"
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define Qfmt_31(a)   (Int32)(a*0x7FFFFFFF + (a>=0?0.5F:-0.5F))
-
-#define Qfmt15(x)   (Int16)(x*((Int32)1<<15) + (x>=0?0.5F:-0.5F))
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void dct_16(Int32 vec[], Int flag)
-{
-    Int32 tmp0;
-    Int32 tmp1;
-    Int32 tmp2;
-    Int32 tmp3;
-    Int32 tmp4;
-    Int32 tmp5;
-    Int32 tmp6;
-    Int32 tmp7;
-    Int32 tmp_o0;
-    Int32 tmp_o1;
-    Int32 tmp_o2;
-    Int32 tmp_o3;
-    Int32 tmp_o4;
-    Int32 tmp_o5;
-    Int32 tmp_o6;
-    Int32 tmp_o7;
-    Int32 itmp_e0;
-    Int32 itmp_e1;
-    Int32 itmp_e2;
-
-    /*  split input vector */
-
-
-    tmp_o0 = fxp_mul32_by_16((vec[ 0] - vec[15]), Qfmt15(0.50241928618816F));
-    tmp0   =  vec[ 0] + vec[15];
-
-    tmp_o7 = fxp_mul32_Q31((vec[ 7] - vec[ 8]) << 3, Qfmt_31(0.63764357733614F));
-    tmp7   =  vec[ 7] + vec[ 8];
-
-    itmp_e0 = (tmp0 + tmp7);
-    tmp7    = fxp_mul32_by_16((tmp0 - tmp7), Qfmt15(0.50979557910416F));
-
-    tmp_o1 = fxp_mul32_by_16((vec[ 1] - vec[14]), Qfmt15(0.52249861493969F));
-    tmp1   =  vec[ 1] + vec[14];
-    tmp_o6 = fxp_mul32_by_16((vec[ 6] - vec[ 9]) << 1, Qfmt15(0.86122354911916F));
-    tmp6   =  vec[ 6] + vec[ 9];
-
-    itmp_e1 = (tmp1 + tmp6);
-    tmp6    = fxp_mul32_by_16((tmp1 - tmp6), Qfmt15(0.60134488693505F));
-
-    tmp_o2 = fxp_mul32_by_16((vec[ 2] - vec[13]), Qfmt15(0.56694403481636F));
-    tmp2   =  vec[ 2] + vec[13];
-    tmp_o5 = fxp_mul32_by_16((vec[ 5] - vec[10]) << 1, Qfmt15(0.53033884299517F));
-    tmp5   =  vec[ 5] + vec[10];
-
-    itmp_e2 = (tmp2 + tmp5);
-    tmp5    = fxp_mul32_by_16((tmp2 - tmp5), Qfmt15(0.89997622313642F));
-
-    tmp_o3 = fxp_mul32_by_16((vec[ 3] - vec[12]), Qfmt15(0.64682178335999F));
-    tmp3   =  vec[ 3] + vec[12];
-    tmp_o4 = fxp_mul32_by_16((vec[ 4] - vec[11]), Qfmt15(0.78815462345125F));
-    tmp4   =  vec[ 4] + vec[11];
-
-    tmp1   = (tmp3 + tmp4);
-    tmp4   =  fxp_mul32_Q31((tmp3 - tmp4) << 2, Qfmt_31(0.64072886193538F));
-
-    /*  split even part of tmp_e */
-
-    tmp0 = (itmp_e0 + tmp1);
-    tmp1 = fxp_mul32_by_16((itmp_e0 - tmp1), Qfmt15(0.54119610014620F));
-
-
-    tmp3 = fxp_mul32_by_16((itmp_e1 - itmp_e2) << 1, Qfmt15(0.65328148243819F));
-    tmp2 = (itmp_e1 + itmp_e2);
-
-    vec[ 0]  = (tmp0 + tmp2) >> 1;
-    vec[ 8]  = fxp_mul32_by_16((tmp0 - tmp2), Qfmt15(0.70710678118655F));
-    vec[12]  = fxp_mul32_by_16((tmp1 - tmp3) << 1, Qfmt15(0.70710678118655F));
-    vec[ 4]  =  tmp1 + tmp3;
-    vec[ 4] +=  vec[12];
-
-    /*  split odd part of tmp_e */
-
-    tmp1 = fxp_mul32_by_16((tmp7 - tmp4) << 1, Qfmt15(0.54119610014620F));
-    tmp7 += tmp4;
-    tmp3 = fxp_mul32_Q31((tmp6 - tmp5) << 2, Qfmt_31(0.65328148243819F));
-
-    tmp6 += tmp5;
-
-    vec[10]  = fxp_mul32_by_16((tmp7 - tmp6) << 1, Qfmt15(0.70710678118655F));
-    vec[ 2]  =  tmp7 + tmp6;
-    vec[14]  = fxp_mul32_by_16((tmp1 - tmp3) << 1, Qfmt15(0.70710678118655F));
-
-    tmp1    +=  tmp3 + vec[14];
-    vec[ 2] +=  tmp1;
-    vec[ 6]  =  tmp1 + vec[10];
-
-    vec[10] += vec[14];
-
-
-    // dct8;
-
-    tmp7 = tmp_o0 + tmp_o7;
-    tmp_o7 = fxp_mul32_by_16((tmp_o0 - tmp_o7) << 1, Qfmt15(0.50979557910416F));
-
-    tmp6 = tmp_o1 + tmp_o6;
-    tmp_o1 = fxp_mul32_by_16((tmp_o1 - tmp_o6) << 1, Qfmt15(0.60134488693505F));
-
-    tmp5 = tmp_o2 + tmp_o5;
-    tmp_o5 = fxp_mul32_by_16((tmp_o2 - tmp_o5) << 1, Qfmt15(0.89997622313642F));
-
-    tmp4 = tmp_o3 + tmp_o4;
-
-    tmp_o3 = fxp_mul32_Q31((tmp_o3 - tmp_o4) << 3, Qfmt_31(0.6407288619354F));
-
-    if (!flag)
-    {
-        tmp7   = -tmp7;
-        tmp_o7 = -tmp_o7;
-        tmp6   = -tmp6;
-        tmp_o1 = -tmp_o1;
-        tmp5   = -tmp5;
-        tmp_o5 = -tmp_o5;
-        tmp4   = -tmp4;
-        tmp_o3 = -tmp_o3;
-    }
-
-    // even part
-
-    tmp1 = fxp_mul32_by_16((tmp7 - tmp4) << 1, Qfmt15(0.54119610014620F));
-    tmp0 =  tmp7 + tmp4;
-    tmp3 = fxp_mul32_Q31((tmp6 - tmp5) << 2, Qfmt_31(0.65328148243819F));
-    tmp2 =  tmp6 + tmp5;
-
-    vec[ 9]  = fxp_mul32_Q31((tmp0 - tmp2) << 1, Qfmt_31(0.70710678118655F));
-    vec[ 1]  =  tmp0 + tmp2;
-    vec[13]  = fxp_mul32_Q31((tmp1 - tmp3) << 1, Qfmt_31(0.70710678118655F));
-
-    vec[ 5]  =  tmp1 + tmp3 + vec[13];
-
-    // odd part
-
-    tmp0 =  tmp_o7 + tmp_o3;
-    tmp1 = fxp_mul32_by_16((tmp_o7 - tmp_o3) << 1, Qfmt15(0.54119610014620F));
-    tmp2 =  tmp_o1 + tmp_o5;
-    tmp3 = fxp_mul32_Q31((tmp_o1 - tmp_o5) << 2, Qfmt_31(0.65328148243819F));
-
-    vec[11]  = fxp_mul32_Q31((tmp0 - tmp2) << 1, Qfmt_31(0.70710678118655F));
-    vec[ 3]  =  tmp0 + tmp2;
-    vec[15]  = fxp_mul32_Q31((tmp1 - tmp3) << 1, Qfmt_31(0.70710678118655F));
-    vec[ 7]  =  tmp1 + tmp3 + vec[15];
-
-
-    vec[ 3] += vec[ 7];
-    vec[ 7] += vec[11];
-    vec[11] += vec[15];
-
-    vec[ 1] += vec[ 3];
-    vec[ 3] += vec[ 5];
-    vec[ 5] += vec[ 7];
-    vec[ 7] += vec[ 9];
-    vec[ 9] += vec[11];
-    vec[11] += vec[13];
-    vec[13] += vec[15];
-
-
-}
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/dct16.h b/media/libstagefright/codecs/aacdec/dct16.h
deleted file mode 100644
index 6f8fcb2..0000000
--- a/media/libstagefright/codecs/aacdec/dct16.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/dct16.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef DCT16_H
-#define DCT16_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    void dct_16(Int32 vec[], Int flag);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* DCT16_H */
diff --git a/media/libstagefright/codecs/aacdec/dct64.cpp b/media/libstagefright/codecs/aacdec/dct64.cpp
deleted file mode 100644
index a21a814..0000000
--- a/media/libstagefright/codecs/aacdec/dct64.cpp
+++ /dev/null
@@ -1,569 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: dct64.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 64
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement dct of lenght 64
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "dct16.h"
-#include "dct64.h"
-
-#include "pv_audio_type_defs.h"
-#include "synthesis_sub_band.h"
-
-#include "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define Qfmt(a)   (Int32)(a*((Int32)1<<26) + (a>=0?0.5F:-0.5F))
-#define Qfmt31(a)   (Int32)(a*0x7FFFFFFF)
-
-const Int32 CosTable_48[48] =
-{
-    Qfmt31(0.50015063602065F) ,  Qfmt31(0.50135845244641F) ,
-    Qfmt31(0.50378872568104F) ,  Qfmt31(0.50747117207256F) ,
-    Qfmt31(0.51245147940822F) ,  Qfmt31(0.51879271310533F) ,
-    Qfmt31(0.52657731515427F) ,  Qfmt31(0.53590981690799F) ,
-    Qfmt31(0.54692043798551F) ,  Qfmt31(0.55976981294708F) ,
-    Qfmt31(0.57465518403266F) ,  Qfmt31(0.59181853585742F) ,
-    Qfmt31(0.61155734788251F) ,  Qfmt31(0.63423893668840F) ,
-    Qfmt31(0.66031980781371F) ,  Qfmt31(0.69037212820021F) ,
-    Qfmt31(0.72512052237720F) ,  Qfmt31(0.76549416497309F) ,
-    Qfmt31(0.81270209081449F) ,  Qfmt31(0.86834471522335F) ,
-    Qfmt(0.93458359703641F) ,  Qfmt(1.01440826499705F) ,
-    Qfmt(1.11207162057972F) ,  Qfmt(1.23383273797657F) ,
-    Qfmt(1.38929395863283F) ,  Qfmt(1.59397228338563F) ,
-    Qfmt(1.87467598000841F) ,  Qfmt(2.28205006800516F) ,
-    Qfmt(2.92462842815822F) ,  Qfmt(4.08461107812925F) ,
-    Qfmt(6.79675071167363F) ,  Qfmt(20.37387816723145F) , /* 32 */
-    Qfmt(0.50060299823520F) ,  Qfmt(0.50547095989754F) ,
-    Qfmt(0.51544730992262F) ,  Qfmt(0.53104259108978F) ,
-    Qfmt(0.55310389603444F) ,  Qfmt(0.58293496820613F) ,
-    Qfmt(0.62250412303566F) ,  Qfmt(0.67480834145501F) ,
-    Qfmt(0.74453627100230F) ,  Qfmt(0.83934964541553F) ,
-    Qfmt(0.97256823786196F) ,  Qfmt(1.16943993343288F) ,
-    Qfmt(1.48416461631417F) ,  Qfmt(2.05778100995341F) ,
-    Qfmt(3.40760841846872F) ,  Qfmt(10.19000812354803F)
-};
-
-
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; dct_64
-----------------------------------------------------------------------------*/
-
-void pv_split_LC(Int32 *vector,
-                 Int32 *temp_o)
-{
-
-    Int32 i;
-    Int32 *pt_vector     = &vector[0];
-    Int32 *pt_vector_N_1 = &vector[31];
-    const Int32 *pt_cosTerms = &CosTable_48[32];
-    Int32 *pt_temp_o = temp_o;
-    Int32 tmp1;
-    Int32 tmp2;
-    Int32 tmp3;
-
-
-    tmp1 = *(pt_vector);
-    tmp2 = *(pt_vector_N_1--);
-    for (i = 16; i != 0; i--)
-    {
-        tmp3 = *(pt_cosTerms++);
-        *(pt_vector++) =   tmp1  + tmp2;
-        *(pt_temp_o++) = fxp_mul32_Q26((tmp1 - tmp2), tmp3);
-        tmp1 = *(pt_vector);
-        tmp2 = *(pt_vector_N_1--);
-    }
-
-}
-
-
-#ifdef HQ_SBR
-
-
-void dct_64(Int32 vec[], Int32 *scratch_mem)
-{
-    Int32 *temp_e1;
-    Int32 *temp_o1;
-
-    Int32 *pt_vec;
-
-    Int   i;
-
-    Int32 aux1;
-    Int32 aux2;
-    Int32 aux3;
-    Int32 aux4;
-
-    const Int32 *cosTerms = &CosTable_48[31];
-
-    temp_o1 = &vec[32];
-    temp_e1 = temp_o1 - 1;
-
-
-    for (i = 6; i != 0; i--)
-    {
-        aux1 = *(temp_e1);
-        aux2 = *(temp_o1);
-        aux3 = *(cosTerms--);
-        *(temp_e1--) =   aux1  + aux2;
-        *(temp_o1++) = fxp_mul32_Q26((aux1 - aux2), aux3);
-        aux1 = *(temp_e1);
-        aux2 = *(temp_o1);
-        aux3 = *(cosTerms--);
-        *(temp_e1--) =   aux1  + aux2;
-        *(temp_o1++) = fxp_mul32_Q26((aux1 - aux2), aux3);
-    }
-
-
-    for (i = 10; i != 0; i--)
-    {
-        aux1 = *(temp_e1);
-        aux2 = *(temp_o1);
-        aux3 = *(cosTerms--);
-        *(temp_e1--) =   aux1  + aux2;
-        *(temp_o1++) = fxp_mul32_Q31((aux1 - aux2), aux3) << 1;
-        aux1 = *(temp_e1);
-        aux2 = *(temp_o1);
-        aux3 = *(cosTerms--);
-        *(temp_e1--) =   aux1  + aux2;
-        *(temp_o1++) = fxp_mul32_Q31((aux1 - aux2), aux3) << 1;
-    }
-
-
-    pv_split(&vec[16]);
-
-    dct_16(&vec[16], 0);
-    dct_16(vec,     1);      // Even terms
-
-    pv_merge_in_place_N32(vec);
-
-    pv_split_z(&vec[32]);
-
-    dct_16(&vec[32], 1);     // Even terms
-    dct_16(&vec[48], 0);
-
-    pv_merge_in_place_N32(&vec[32]);
-
-
-
-    aux1   = vec[32];
-    aux3   = vec[33];
-    aux4   = vec[ 1];  /* vec[ 1] */
-
-    /* -----------------------------------*/
-    aux1     = vec[32] + vec[33];
-    vec[ 0] +=  aux1;
-    vec[ 1] +=  aux1;
-
-    aux1        = vec[34];
-    aux2        = vec[ 2];   /* vec[ 2] */
-    aux3        += aux1;
-    vec[ 2] = aux4 + aux3;
-    aux4        = vec[ 3];  /* vec[ 3] */
-    vec[ 3] = aux2 + aux3;
-
-    aux3        = vec[35];
-
-    /* -----------------------------------*/
-    aux1        += aux3;
-    vec[32] = vec[ 4];
-    vec[33] = vec[ 5];
-    vec[ 4] = aux2 + aux1;
-    vec[ 5] = aux4 + aux1;
-
-    aux1        = vec[36];
-    aux2        = vec[32];  /* vec[ 4] */
-    aux3        += aux1;
-    vec[34] = vec[ 6];
-    vec[35] = vec[ 7];
-    vec[ 6] = aux4 + aux3;
-    vec[ 7] = aux2 + aux3;
-
-    aux3        = vec[37];
-    aux4        = vec[33];  /* vec[ 5] */
-
-    /* -----------------------------------*/
-    aux1        += aux3;
-    vec[32] = vec[ 8];
-    vec[33] = vec[ 9];
-    vec[ 8] = aux2 + aux1;
-    vec[ 9] = aux4 + aux1;
-
-    aux1        = vec[38];
-    aux2        = vec[34];  /* vec[ 6] */
-    aux3        += aux1;
-    vec[34] = vec[10];
-    vec[10] = aux4 + aux3;
-    aux4        = vec[35];  /* vec[ 7] */
-    vec[35] = vec[11];
-    vec[11] = aux2 + aux3;
-
-    aux3        = vec[39];
-
-    /* -----------------------------------*/
-    aux1        += aux3;
-    vec[36] = vec[12];
-    vec[37] = vec[13];
-    vec[12] = aux2 + aux1;
-    vec[13] = aux4 + aux1;
-
-    aux1        = vec[40];
-    aux2        = vec[32];  /* vec[ 8] */
-    aux3        += aux1;
-    vec[32] = vec[14];
-    vec[14] = aux4 + aux3;
-    aux4        = vec[33];  /* vec[ 9] */
-    vec[33] = vec[15];
-    vec[15] = aux2 + aux3;
-
-    aux3        = vec[41];
-
-    /* -----------------------------------*/
-    aux1        += aux3;
-    vec[38] = vec[16];
-    vec[39] = vec[17];
-    vec[16] = aux2 + aux1;
-    vec[17] = aux4 + aux1;
-
-    aux1        = vec[42];
-    aux2        = vec[34];  /* vec[10] */
-    aux3        += aux1;
-    vec[34] = vec[18];
-    vec[18] = aux4 + aux3;
-    aux4        = vec[35];  /* vec[11] */
-    vec[35] = vec[19];
-    vec[19] = aux2 + aux3;
-
-    aux3        = vec[43];
-
-    /* -----------------------------------*/
-    aux1        += aux3;
-    vec[40] = vec[20];
-    vec[41] = vec[21];
-    vec[20] = aux2 + aux1;
-    vec[21] = aux4 + aux1;
-
-    aux1        = vec[44];
-    aux2        = vec[36];  /* vec[12] */
-    aux3        += aux1;
-    vec[42] = vec[22];
-    vec[43] = vec[23];
-    vec[22] = aux4 + aux3;
-    vec[23] = aux2 + aux3;
-
-    aux3        = vec[45];
-    aux4        = vec[37];  /* vec[13] */
-
-    /* -----------------------------------*/
-
-
-    scratch_mem[0] = vec[24];
-    scratch_mem[1] = vec[25];
-    aux1        += aux3;
-    vec[24] = aux2 + aux1;
-    vec[25] = aux4 + aux1;
-
-    aux1        = vec[46];
-    aux2        = vec[32];  /* vec[14] */
-    scratch_mem[2] = vec[26];
-    scratch_mem[3] = vec[27];
-    aux3        += aux1;
-    vec[26] = aux4 + aux3;
-    vec[27] = aux2 + aux3;
-
-    aux3        = vec[47];
-    aux4        = vec[33];  /* vec[15] */
-
-    /* -----------------------------------*/
-    scratch_mem[4] = vec[28];
-    scratch_mem[5] = vec[29];
-    aux1        += aux3;
-    vec[28] = aux2 + aux1;
-    vec[29] = aux4 + aux1;
-
-    aux1        = vec[48];
-    aux2        = vec[38];  /* vec[16] */
-    scratch_mem[6] = vec[30];
-    scratch_mem[7] = vec[31];
-    aux3        += aux1;
-    vec[30] = aux4 + aux3;
-    vec[31] = aux2 + aux3;
-
-    aux3        = vec[49];
-    aux4        = vec[39];  /* vec[17] */
-
-    /* -----------------------------------*/
-    aux1        += aux3;
-    vec[32] = aux2 + aux1;
-    vec[33] = aux4 + aux1;
-
-    aux1        = vec[50];
-    aux2        = vec[34];  /* vec[18] */
-    aux3        += aux1;
-    vec[34] = aux4 + aux3;
-    aux4        = vec[35];  /* vec[19] */
-    vec[35] = aux2 + aux3;
-
-    aux3        = vec[51];
-
-
-    /* -----------------------------------*/
-    aux1        += aux3;
-    vec[36] = aux2 + aux1;
-    vec[37] = aux4 + aux1;
-
-    aux1        = vec[52];
-    aux2        = vec[40];  /* vec[20] */
-    aux3        += aux1;
-    vec[38] = aux4 + aux3;
-    vec[39] = aux2 + aux3;
-
-    aux3        = vec[53];
-    aux4        = vec[41];  /* vec[21] */
-
-    /* -----------------------------------*/
-    aux1        += aux3;
-    vec[40] = aux2 + aux1;
-    vec[41] = aux4 + aux1;
-
-    aux1        = vec[54];
-    aux2        = vec[42];  /* vec[22] */
-    aux3        += aux1;
-    vec[42] = aux4 + aux3;
-    aux4        = vec[43];  /* vec[23] */
-    vec[43] = aux2 + aux3;
-
-    aux3        = vec[55];
-
-    /* -----------------------------------*/
-
-    pt_vec = &vec[44];
-    temp_o1 = &vec[56];
-    temp_e1 = &scratch_mem[0];
-
-    for (i = 4; i != 0; i--)
-    {
-        aux1        += aux3;
-        *(pt_vec++) = aux2 + aux1;
-        *(pt_vec++) = aux4 + aux1;
-
-        aux1        = *(temp_o1++);
-        aux3        += aux1;
-        aux2        = *(temp_e1++);
-        *(pt_vec++) = aux4 + aux3;
-        *(pt_vec++) = aux2 + aux3;
-
-        aux3        = *(temp_o1++);
-        aux4        = *(temp_e1++);
-    }
-
-    aux1       += aux3;
-    vec[60] = aux2 + aux1;
-    vec[61] = aux4 + aux1;
-    vec[62] = aux4 + aux3;
-
-}
-
-
-#endif
-
-/*----------------------------------------------------------------------------
-; pv_split
-----------------------------------------------------------------------------*/
-
-
-void pv_split(Int32 *temp_o)
-{
-
-    Int32 i;
-    const Int32 *pt_cosTerms = &CosTable_48[47];
-    Int32 *pt_temp_o = temp_o;
-    Int32 *pt_temp_e = pt_temp_o - 1;
-    Int32 tmp1;
-    Int32 tmp2;
-    Int32 cosx;
-
-    for (i = 8; i != 0; i--)
-    {
-        tmp2 = *(pt_temp_o);
-        tmp1 = *(pt_temp_e);
-        cosx = *(pt_cosTerms--);
-        *(pt_temp_e--) =   tmp1  + tmp2;
-        *(pt_temp_o++) = fxp_mul32_Q26((tmp1 - tmp2), cosx);
-        tmp1 = *(pt_temp_e);
-        tmp2 = *(pt_temp_o);
-        cosx = *(pt_cosTerms--);
-        *(pt_temp_e--) =   tmp1  + tmp2;
-        *(pt_temp_o++) = fxp_mul32_Q26((tmp1 - tmp2), cosx);
-    }
-}
-
-
-
-void pv_split_z(Int32 *vector)
-{
-    Int32 i;
-    Int32 *pt_vector     = &vector[31];
-    const Int32 *pt_cosTerms = &CosTable_48[32];
-    Int32 *pt_temp_e = vector;
-    Int32 tmp1;
-    Int32 tmp2;
-    Int32 cosx;
-
-    for (i = 8; i != 0; i--)
-    {
-        tmp1 = *(pt_vector);
-        tmp2 = *(pt_temp_e);
-        cosx = *(pt_cosTerms++);
-        *(pt_temp_e++) =   tmp1  + tmp2;
-        *(pt_vector--) = fxp_mul32_Q26((tmp1 - tmp2), cosx);
-        tmp2 = *(pt_temp_e);
-        tmp1 = *(pt_vector);
-        cosx = *(pt_cosTerms++);
-        *(pt_temp_e++) =   tmp1  + tmp2;
-        *(pt_vector--) = fxp_mul32_Q26((tmp1 - tmp2), cosx);
-    }
-}
-
-
-void pv_merge_in_place_N32(Int32 vec[])
-{
-
-    Int32 temp[4];
-
-    temp[0] = vec[14];
-    vec[14] = vec[ 7];
-    temp[1] = vec[12];
-    vec[12] = vec[ 6];
-    temp[2] = vec[10];
-    vec[10] = vec[ 5];
-    temp[3] = vec[ 8];
-    vec[ 8] = vec[ 4];
-    vec[ 6] = vec[ 3];
-    vec[ 4] = vec[ 2];
-    vec[ 2] = vec[ 1];
-
-    vec[ 1] = vec[16] + vec[17];
-    vec[16] = temp[3];
-    vec[ 3] = vec[18] + vec[17];
-    vec[ 5] = vec[19] + vec[18];
-    vec[18] = vec[9];
-    temp[3] = vec[11];
-
-    vec[ 7] = vec[20] + vec[19];
-    vec[ 9] = vec[21] + vec[20];
-    vec[20] = temp[2];
-    temp[2] = vec[13];
-    vec[11] = vec[22] + vec[21];
-    vec[13] = vec[23] + vec[22];
-    vec[22] = temp[3];
-    temp[3] = vec[15];
-    vec[15] = vec[24] + vec[23];
-    vec[17] = vec[25] + vec[24];
-    vec[19] = vec[26] + vec[25];
-    vec[21] = vec[27] + vec[26];
-    vec[23] = vec[28] + vec[27];
-    vec[25] = vec[29] + vec[28];
-    vec[27] = vec[30] + vec[29];
-    vec[29] = vec[30] + vec[31];
-    vec[24] = temp[1];
-    vec[26] = temp[2];
-    vec[28] = temp[0];
-    vec[30] = temp[3];
-}
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/dct64.h b/media/libstagefright/codecs/aacdec/dct64.h
deleted file mode 100644
index 3d5e82b..0000000
--- a/media/libstagefright/codecs/aacdec/dct64.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/dct64.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef DCT64_H
-#define DCT64_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-    extern const Int32 CosTable_48[48];
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    void pv_split_LC(Int32 *vector,
-                     Int32 *temp_o);
-
-
-#ifdef HQ_SBR
-
-    void dct_64(Int32 vec[], Int32 *scratch_mem);
-
-#endif
-
-    void pv_split(Int32 *temp_o);
-
-    void pv_split_z(Int32 *vector);
-
-    void pv_merge_in_place_N32(Int32 vec[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* DCT64_H */
diff --git a/media/libstagefright/codecs/aacdec/decode_huff_cw_binary.cpp b/media/libstagefright/codecs/aacdec/decode_huff_cw_binary.cpp
deleted file mode 100644
index 0d1561b..0000000
--- a/media/libstagefright/codecs/aacdec/decode_huff_cw_binary.cpp
+++ /dev/null
@@ -1,708 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/decode_huff_cw_binary.c
- Funtions:
-    decode_huff_cw_tab1
-    decode_huff_cw_tab2
-    decode_huff_cw_tab3
-    decode_huff_cw_tab4
-    decode_huff_cw_tab5
-    decode_huff_cw_tab6
-    decode_huff_cw_tab7
-    decode_huff_cw_tab8
-    decode_huff_cw_tab9
-    decode_huff_cw_tab10
-    decode_huff_cw_tab11
-    decode_huff_cw_scl
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Updated per review comments
-              (1) make cw sgined and change "if(cw&0x80000000)" to if(cw<0)
-              (2)
-
- Description: Create specific functions for different huffman tables.
-
-
- Description: Added ( Int16) castings to eliminate several compiler warnings
-
-
- Description: Modified huffman tables to allocate int32 variables instead of
-              int16, which lead to data missaligned for some compiler.
-              Eliminated casting and unused variables
-
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    BITS          *pInputStream = pointer to input bit stream
-
- Local Stores/Buffers/Pointers Needed:
-
-
- Global Stores/Buffers/Pointers Needed:
-
-
- Outputs:
-    idx = bit field extracted from a leaf entry of packed Huffman Tables
-
- Pointers and Buffers Modified:
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-   These functions are used to decode huffman codewords from the input
-   bitstream using combined binary search and look-up table approach.
-
-   First the codewords are grouped and the input symbol is determined
-   which group it belongs. Then within that group, a look-up table is
-   used to determine which codeword the symbol is.
-   The table is created by ordering the codeword in the table according to their
-   normalized shifted binary value, i.e., all the codewords are left
-   shifted to meet the maximum codelength. Example, max codelength is
-   10, the codeword with lenth 3 will left shift by 7.
-   The binary values of after the shift are sorted.
-   Then the sorted table is divided into several partition.
-   At the VLC decoding period, input is read in at max codelenght.
-   The partition is decided using if-else logic.
-   Inside each partition, a look-up table is used to map the input value
-   to a correct symbol. Table entries can appear to be repeated according
-   to the humming distance between adjacent codewords.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) Introduction to Algorithms,
-     Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest.
-     The MIT press, 1990
-
- (3) "Selecting an Optimal Huffman Decoder for AAC",
-     Vladimir Z. Mesarovic, et al.
-     AES 111th Convention, September 21-24, 2001, New York, USA
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE:
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES:
-
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "huffman.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define    MAX_CW_LEN  (19)
-#define    MASK_IDX    (0x1FF)
-#define    MASK_RIGHT  (0xFE00)
-
-#define    UPPER16      (16)
-#define    MASK_LOW16   (0xFFFF)
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int decode_huff_cw_tab1(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              11,
-              pInputStream);
-    if ((cw >> 10) == 0)
-    {
-        pInputStream->usedBits -= (11 - 1);
-        return 40; /* idx is 40 */
-    }
-    else if ((cw >> 6) <= 23)
-    {
-        tab = (cw >> 6) - 16;
-    }
-    else if ((cw >> 4) <= 119)
-    {
-        tab = (cw >> 4) - 96 + 8;
-    }
-    else if ((cw >> 2) <= 503)
-    {
-        tab = (cw >> 2) - 480 + 32;
-    }
-    else
-    {
-        tab = cw - 2016 + 56;
-    }
-
-    tab = *(huff_tab1 + tab);
-
-    pInputStream->usedBits -= (11 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-Int decode_huff_cw_tab2(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get9_n_lessbits(
-              9,
-              pInputStream);
-    if ((cw >> 6) == 0)
-    {
-        pInputStream->usedBits -= (9 - 3); /* used 3 bits */
-        return 40; /* idx is 40 */
-    }
-    else if ((cw >> 3) <= 49)
-    {
-        tab = (cw >> 3) - 8;
-    }
-    else if ((cw >> 2) <= 114)
-    {
-        tab = (cw >> 2) - 100 + 42;
-    }
-    else if ((cw >> 1) <= 248)
-    {
-        tab = (cw >> 1) - 230 + 57;
-    }
-    else
-    {
-        tab = cw - 498 + 76;
-    }
-
-    tab = *(huff_tab2 + tab);
-
-    pInputStream->usedBits -= (9 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-Int decode_huff_cw_tab3(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              16,
-              pInputStream);
-    if ((cw >> 15) == 0)
-    {
-        pInputStream->usedBits -= (16 - 1); /* used 1 bits */
-        return 0; /* idx is 0 */
-    }
-    else if ((cw >> 10) <= 57)
-    {
-        tab = (cw >> 10) - 32;
-    }
-    else if ((cw >> 7) <= 500)
-    {
-        tab = (cw >> 7) - 464 + 26;
-    }
-    else if ((cw >> 6) <= 1016)
-    {
-        tab = (cw >> 6) - 1002 + 63;
-    }
-    else if ((cw >> 4) <= 4092)
-    {
-        tab = (cw >> 4) - 4068 + 78;
-    }
-    else
-    {
-        tab = cw - 65488 + 103;
-    }
-
-    tab = *(huff_tab3 + tab);
-
-    pInputStream->usedBits -= (16 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-Int decode_huff_cw_tab4(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              12,
-              pInputStream);
-
-    if ((cw >> 7) <= 25)
-    {
-        tab = (cw >> 7);
-    }
-    else if ((cw >> 4) <= 246)
-    {
-        tab = (cw >> 4) - 208 + 26;
-    }
-    else if ((cw >> 2) <= 1017)
-    {
-        tab = (cw >> 2) - 988 + 65;
-    }
-    else
-    {
-        tab = cw - 4072 + 95;
-    }
-
-    tab = *(huff_tab4 + tab);
-
-    pInputStream->usedBits -= (12 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-
-Int decode_huff_cw_tab5(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              13,
-              pInputStream);
-
-    if ((cw >> 12) == 0)
-    {
-        pInputStream->usedBits -= (13 - 1); /* used 1 bits */
-        return 40; /* idx is 40 */
-    }
-    else if ((cw >> 8) <= 27)
-    {
-        tab = (cw >> 8) - 16;
-    }
-    else if ((cw >> 5) <= 243)
-    {
-        tab = (cw >> 5) - 224 + 12;
-    }
-    else if ((cw >> 3) <= 1011)
-    {
-        tab = (cw >> 3) - 976 + 32;
-    }
-    else if ((cw >> 2) <= 2041)
-    {
-        tab = (cw >> 2) - 2024 + 68;
-    }
-    else
-    {
-        tab = cw - 8168 + 86;
-    }
-
-    tab = *(huff_tab5 + tab);
-
-    pInputStream->usedBits -= (13 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-
-Int decode_huff_cw_tab6(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              11,
-              pInputStream);
-
-    if ((cw >> 7) <= 8)
-    {
-        tab = (cw >> 7);
-    }
-    else if ((cw >> 4) <= 116)
-    {
-        tab = (cw >> 4) - 72 + 9;
-    }
-    else if ((cw >> 2) <= 506)
-    {
-        tab = (cw >> 2) - 468 + 54;
-    }
-    else
-    {
-        tab = cw - 2028 + 93;
-    }
-
-    tab = *(huff_tab6 + tab);
-
-    pInputStream->usedBits -= (11 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-
-Int decode_huff_cw_tab7(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              12,
-              pInputStream);
-
-    if ((cw >> 11) == 0)
-    {
-        pInputStream->usedBits -= (12 - 1); /* used 1 bits */
-        return 0; /* idx is 0 */
-    }
-    else if ((cw >> 6) <= 55)
-    {
-        tab = (cw >> 6) - 32;
-    }
-    else if ((cw >> 4) <= 243)
-    {
-        tab = (cw >> 4) - 224 + 24;
-    }
-    else if ((cw >> 2) <= 1018)
-    {
-        tab = (cw >> 2) - 976 + 44;
-    }
-    else
-    {
-        tab = cw - 4076 + 87;
-    }
-
-    tab = *(huff_tab7 + tab);
-
-    pInputStream->usedBits -= (12 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-
-Int decode_huff_cw_tab8(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              10,
-              pInputStream);
-
-    if ((cw >> 5) <= 20)
-    {
-        tab = (cw >> 5);
-    }
-    else if ((cw >> 3) <= 117)
-    {
-        tab = (cw >> 3) - 84 + 21;
-    }
-    else if ((cw >> 2) <= 250)
-    {
-        tab = (cw >> 2) - 236 + 55;
-    }
-    else
-    {
-        tab = cw - 1004 + 70;
-    }
-
-    tab = *(huff_tab8 + tab);
-
-    pInputStream->usedBits -= (10 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-Int decode_huff_cw_tab9(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              15,
-              pInputStream);
-
-    if ((cw >> 11) <= 12)
-    {
-        tab = (cw >> 11);
-    }
-    else if ((cw >> 8) <= 114)
-    {
-        tab = (cw >> 8) - 104 + 13;
-    }
-    else if ((cw >> 6) <= 486)
-    {
-        tab = (cw >> 6) - 460 + 24;
-    }
-    else if ((cw >> 5) <= 993)
-    {
-        tab = (cw >> 5) - 974 + 51;
-    }
-    else if ((cw >> 4) <= 2018)
-    {
-        tab = (cw >> 4) - 1988 + 71;
-    }
-    else if ((cw >> 3) <= 4075)
-    {
-        tab = (cw >> 3) - 4038 + 102;
-    }
-    else if ((cw >> 2) <= 8183)
-    {
-        tab = (cw >> 2) - 8152 + 140;
-    }
-    else
-    {
-        tab = cw - 32736 + 172;
-    }
-
-    tab = *(huff_tab9 + tab);
-
-    pInputStream->usedBits -= (15 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-Int decode_huff_cw_tab10(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              12,
-              pInputStream);
-
-    if ((cw >> 6) <= 41)
-    {
-        tab = (cw >> 6);
-    }
-    else if ((cw >> 5) <= 100)
-    {
-        tab = (cw >> 5) - 84 + 42;
-    }
-    else if ((cw >> 4) <= 226)
-    {
-        tab = (cw >> 4) - 202 + 59;
-    }
-    else if ((cw >> 3) <= 484)
-    {
-        tab = (cw >> 3) - 454 + 84;
-    }
-    else if ((cw >> 2) <= 1010)
-    {
-        tab = (cw >> 2) - 970 + 115;
-    }
-    else if ((cw >> 1) <= 2043)
-    {
-        tab = (cw >> 1) - 2022 + 156;
-    }
-    else
-    {
-        tab = cw - 4088 + 178;
-    }
-
-    tab = *(huff_tab10 + tab);
-
-    pInputStream->usedBits -= (12 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-Int decode_huff_cw_tab11(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = get17_n_lessbits(
-              12,
-              pInputStream);
-
-    if ((cw >> 6) <= 26)
-    {
-        tab = (cw >> 6);
-    }
-    else if ((cw >> 5) <= 69)
-    {
-        tab = (cw >> 5) - 54 + 27;
-    }
-    else if ((cw >> 4) <= 198)
-    {
-        tab = (cw >> 4) - 140 + 43;
-    }
-    else if ((cw >> 3) <= 452)
-    {
-        tab = (cw >> 3) - 398 + 102;
-    }
-    else if ((cw >> 2) <= 1000)
-    {
-        tab = (cw >> 2) - 906 + 157;
-    }
-    else if ((cw >> 1) <= 2044)
-    {
-        tab = (cw >> 1) - 2002 + 252;
-    }
-    else
-    {
-        tab = cw - 4090 + 295;
-    }
-
-    tab = *(huff_tab11 + tab);
-
-    pInputStream->usedBits -= (12 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
-
-Int decode_huff_scl(
-    BITS          *pInputStream)
-{
-    Int32  tab;
-    Int32  cw;
-
-    cw  = getbits(
-              19,
-              pInputStream);
-
-    if ((cw >> 18) == 0)
-    {
-        pInputStream->usedBits -= (19 - 1); /* used 1 bits */
-        return 60; /* idx is 60 */
-    }
-    else if ((cw >> 13) <= 59)
-    {
-        tab = (cw >> 13) - 32;
-    }
-    else if ((cw >> 10) <= 505)
-    {
-        tab = (cw >> 10) - 480 + 28;
-    }
-    else if ((cw >> 7) <= 4089)
-    {
-        tab = (cw >> 7) - 4048 + 54;
-    }
-    else if ((cw >> 5) <= 16377)
-    {
-        tab = (cw >> 5) - 16360 + 96;
-    }
-    else if ((cw >> 3) <= 65526)
-    {
-        tab = (cw >> 3) - 65512 + 114;
-    }
-    else if ((cw >> 1) <= 262120)
-    {
-        tab = (cw >> 1) - 262108 + 129;
-    }
-    else
-    {
-        tab = cw - 524242 + 142;
-    }
-
-    tab = *(huff_tab_scl + tab);
-
-    pInputStream->usedBits -= (19 - (tab & MASK_LOW16));
-    return ((Int)(tab >> UPPER16));
-}
-
diff --git a/media/libstagefright/codecs/aacdec/decode_noise_floorlevels.cpp b/media/libstagefright/codecs/aacdec/decode_noise_floorlevels.cpp
deleted file mode 100644
index 41cd187..0000000
--- a/media/libstagefright/codecs/aacdec/decode_noise_floorlevels.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: decode_noise_floorlevels.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-#ifdef AAC_PLUS
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "decode_noise_floorlevels.h"
-#include    "sbr_constants.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void decode_noise_floorlevels(SBR_FRAME_DATA * hFrameData)
-
-{
-    Int32 env;
-    Int32 i;
-
-    Int32 * frameInfo           = hFrameData->frameInfo;
-    Int32   nNfb                = hFrameData->nNfb;
-    Int32 * domain_vec          = hFrameData->domain_vec2;
-
-    Int32 * sbrNoiseFloorLevel_man = hFrameData->sbrNoiseFloorLevel_man;
-    Int32 * prevNoiseLevel_man     = hFrameData->prevNoiseLevel_man;
-
-    Int32 nEnv = frameInfo[(frameInfo[0] << 1) + 3];
-
-    for (env = 0; env < nEnv; env++)
-    {
-        if (domain_vec[env] == 0)
-        {
-            prevNoiseLevel_man[0] = *(sbrNoiseFloorLevel_man++);
-
-            for (i = 1; i < nNfb; i++)
-            {
-                *sbrNoiseFloorLevel_man += *(sbrNoiseFloorLevel_man - 1);
-                prevNoiseLevel_man[i] = *(sbrNoiseFloorLevel_man++);
-            }
-        }
-        else
-        {
-            for (i = 0; i < nNfb; i++)
-            {
-                *sbrNoiseFloorLevel_man += prevNoiseLevel_man[i];
-                prevNoiseLevel_man[i] = *(sbrNoiseFloorLevel_man++);
-            }
-        }
-
-    }
-}
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/decode_noise_floorlevels.h b/media/libstagefright/codecs/aacdec/decode_noise_floorlevels.h
deleted file mode 100644
index a9c3551..0000000
--- a/media/libstagefright/codecs/aacdec/decode_noise_floorlevels.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: decode_noise_floorlevels.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef DECODENOISEFLOORLEVELS_H
-#define DECODENOISEFLOORLEVELS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_sbr_frame_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void decode_noise_floorlevels(SBR_FRAME_DATA * hFrameData);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/deinterleave.cpp b/media/libstagefright/codecs/aacdec/deinterleave.cpp
deleted file mode 100644
index 5298b19..0000000
--- a/media/libstagefright/codecs/aacdec/deinterleave.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/deinterleave.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description: (1) Modified with new template, rename variables
-              (2) Removed for-loop to calculate win_inc, win_inc = SN2 (128)
-              (3) Replaced for-loop with memcpy
-              (4) Converted Int16 -> Int
-
- Description: Modified per review comments
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    interleaved   = input array that contains interleaved coefficients
-                    Data Type Int
-
-    deinterleaved = output array that will be updated with de-interleaved
-                    coefficients of input array. Data Type Int
-
-    pFrameInfo = pointer to structure that holds information of current
-                 frame. Data Type FrameInfo
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    deinterleaved  contents updated with de-interleaved coefficients from
-                   the input array: interleaved
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function performs the deinterleaving across all short windows in
- each group
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function should replace the contents of pDeinterleaved with the
- de-interleaved 1024 coefficients of one frame
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-    Subpart 4           p78     quant_to_spec
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pInterleaved   = interleaved;
-    pDeinterleaved = deinterleaved;
-
-    pSfbPerWin  = pFrameInfo->sfb_per_win;
-    ngroups     = pFrameInfo->num_groups;
-    pGroupLen   = pFrameInfo->group_len;
-
-    pGroup = pDeinterleaved;
-
-    FOR (group = ngroups; group > 0; group--)
-
-        pSfbWidth   = pFrameInfo->sfb_width_128;
-        sfb_inc = 0;
-        pStart = pInterleaved;
-
-        FOR (sfb = pSfbPerWin[ngroups-group]; sfb > 0; sfb--)
-
-            pWin = pGroup;
-
-            FOR (win = pGroupLen[ngroups-group]; win > 0; win--)
-
-                pDeinterleaved = pWin + sfb_inc;
-
-                pv_memcpy(
-                     pDeinterleaved,
-                     pInterleaved,
-                    *pSfbWidth*sizeof(*pInterleaved));
-
-                pInterleaved += *pSfbWidth;
-
-                pWin += SN2;
-
-            ENDFOR (win)
-
-            sfb_inc += *pSfbWidth++;
-
-        ENDFOR (sfb)
-
-    pGroup += (pInterleaved - pStart);
-
-    ENDFOR (group)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "huffman.h"
-#include    "aac_mem_funcs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void deinterleave(
-    Int16        interleaved[],
-    Int16        deinterleaved[],
-    FrameInfo   *pFrameInfo)
-{
-
-    Int      group;  /* group index */
-    Int      sfb;    /* scalefactor band index */
-    Int      win;    /* window index */
-    Int16    *pGroup;
-    Int16    *pWin;
-    Int16    *pStart;
-    Int16    *pInterleaved;
-    Int16    *pDeinterleaved;
-    Int      sfb_inc;
-
-    Int      ngroups;
-    Int     *pGroupLen;
-    Int     *pSfbPerWin;
-    Int     *pSfbWidth;
-
-    pInterleaved   = interleaved;
-    pDeinterleaved = deinterleaved;
-
-    pSfbPerWin  = pFrameInfo->sfb_per_win;
-    ngroups     = pFrameInfo->num_groups;
-    pGroupLen   = pFrameInfo->group_len;
-
-    pGroup = pDeinterleaved;
-
-    for (group = ngroups; group > 0; group--)
-    {
-        pSfbWidth   = pFrameInfo->sfb_width_128;
-        sfb_inc = 0;
-        pStart = pInterleaved;
-
-        /* Perform the deinterleaving across all windows in a group */
-
-        for (sfb = pSfbPerWin[ngroups-group]; sfb > 0; sfb--)
-        {
-            pWin = pGroup;
-
-            for (win = pGroupLen[ngroups-group]; win > 0; win--)
-            {
-                pDeinterleaved = pWin + sfb_inc;
-
-                pv_memcpy(
-                    pDeinterleaved,
-                    pInterleaved,
-                    *pSfbWidth*sizeof(*pInterleaved));
-
-                pInterleaved += *pSfbWidth;
-
-                pWin += SN2;
-
-            } /* for (win) */
-
-            sfb_inc += *pSfbWidth++;
-
-        } /* for (sfb) */
-
-        pGroup += (pInterleaved - pStart);
-
-    } /* for (group) */
-
-} /* deinterleave */
diff --git a/media/libstagefright/codecs/aacdec/digit_reversal_tables.cpp b/media/libstagefright/codecs/aacdec/digit_reversal_tables.cpp
deleted file mode 100644
index ffa980d..0000000
--- a/media/libstagefright/codecs/aacdec/digit_reversal_tables.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/digit_reversal_tables.c
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-  ------------------------------------------------------------------------------
- MODULE DESCRIPTION
-
-  Tables for digit reverse operation
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "digit_reversal_tables.h"
-#include "imdct_fxp.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*
-------------------------------------------------------------------------------
- Digit Reverse tables
-------------------------------------------------------------------------------
-*/
-
-const Int16 digit_reverse_64[ 64] =
-{
-    + 0,  + 32,  + 64,  + 96,
-    + 8,  + 40,  + 72, + 104,
-    + 16,  + 48,  + 80, + 112,
-    + 24,  + 56,  + 88, + 120,
-    + 2,  + 34,  + 66,  + 98,
-    + 10,  + 42,  + 74, + 106,
-    + 18,  + 50,  + 82, + 114,
-    + 26,  + 58,  + 90, + 122,
-    + 4,  + 36,  + 68, + 100,
-    + 12,  + 44,  + 76, + 108,
-    + 20,  + 52,  + 84, + 116,
-    + 28,  + 60,  + 92, + 124,
-    + 6,  + 38,  + 70, + 102,
-    + 14,  + 46,  + 78, + 110,
-    + 22,  + 54,  + 86, + 118,
-    + 30,  + 62,  + 94, + 126
-};
-
-
-const Int16 digit_reverse_256[ 256] =
-{
-    + 0, + 128, + 256, + 384,
-    + 32, + 160, + 288, + 416,
-    + 64, + 192, + 320, + 448,
-    + 96, + 224, + 352, + 480,
-    + 8, + 136, + 264, + 392,
-    + 40, + 168, + 296, + 424,
-    + 72, + 200, + 328, + 456,
-    + 104, + 232, + 360, + 488,
-    + 16, + 144, + 272, + 400,
-    + 48, + 176, + 304, + 432,
-    + 80, + 208, + 336, + 464,
-    + 112, + 240, + 368, + 496,
-    + 24, + 152, + 280, + 408,
-    + 56, + 184, + 312, + 440,
-    + 88, + 216, + 344, + 472,
-    + 120, + 248, + 376, + 504,
-    + 2, + 130, + 258, + 386,
-    + 34, + 162, + 290, + 418,
-    + 66, + 194, + 322, + 450,
-    + 98, + 226, + 354, + 482,
-    + 10, + 138, + 266, + 394,
-    + 42, + 170, + 298, + 426,
-    + 74, + 202, + 330, + 458,
-    + 106, + 234, + 362, + 490,
-    + 18, + 146, + 274, + 402,
-    + 50, + 178, + 306, + 434,
-    + 82, + 210, + 338, + 466,
-    + 114, + 242, + 370, + 498,
-    + 26, + 154, + 282, + 410,
-    + 58, + 186, + 314, + 442,
-    + 90, + 218, + 346, + 474,
-    + 122, + 250, + 378, + 506,
-    + 4, + 132, + 260, + 388,
-    + 36, + 164, + 292, + 420,
-    + 68, + 196, + 324, + 452,
-    + 100, + 228, + 356, + 484,
-    + 12, + 140, + 268, + 396,
-    + 44, + 172, + 300, + 428,
-    + 76, + 204, + 332, + 460,
-    + 108, + 236, + 364, + 492,
-    + 20, + 148, + 276, + 404,
-    + 52, + 180, + 308, + 436,
-    + 84, + 212, + 340, + 468,
-    + 116, + 244, + 372, + 500,
-    + 28, + 156, + 284, + 412,
-    + 60, + 188, + 316, + 444,
-    + 92, + 220, + 348, + 476,
-    + 124, + 252, + 380, + 508,
-    + 6, + 134, + 262, + 390,
-    + 38, + 166, + 294, + 422,
-    + 70, + 198, + 326, + 454,
-    + 102, + 230, + 358, + 486,
-    + 14, + 142, + 270, + 398,
-    + 46, + 174, + 302, + 430,
-    + 78, + 206, + 334, + 462,
-    + 110, + 238, + 366, + 494,
-    + 22, + 150, + 278, + 406,
-    + 54, + 182, + 310, + 438,
-    + 86, + 214, + 342, + 470,
-    + 118, + 246, + 374, + 502,
-    + 30, + 158, + 286, + 414,
-    + 62, + 190, + 318, + 446,
-    + 94, + 222, + 350, + 478,
-    + 126, + 254, + 382, + 510
-};
-
-
-
-
-const Int16 digit_reverse_swap_256[ 241] =
-{
-    + 2, + 128,   + 4, + 256,
-    + 6, + 384,   + 8,  + 32,
-    + 10, + 160,  + 12, + 288,
-    + 14, + 416,  + 16,  + 64,
-    + 18, + 192,  + 20, + 320,
-    + 22, + 448,  + 24,  + 96,
-    + 26, + 224,  + 28, + 352,
-    + 30, + 480,  + 34, + 136,
-    + 36, + 264,  + 38, + 392,
-    + 42, + 168,  + 44, + 296,
-    + 46, + 424,  + 48,  + 72,
-    + 50, + 200,  + 52, + 328,
-    + 54, + 456,  + 56, + 104,
-    + 58, + 232,  + 60, + 360,
-    + 62, + 488,  + 66, + 144,
-    + 68, + 272,  + 70, + 400,
-    + 74, + 176,  + 76, + 304,
-    + 78, + 432,  + 82, + 208,
-    + 84, + 336,  + 86, + 464,
-    + 88, + 112,  + 90, + 240,
-    + 92, + 368,  + 94, + 496,
-    + 98, + 152, + 100, + 280,
-    + 102, + 408, + 106, + 184,
-    + 108, + 312, + 110, + 440,
-    + 114, + 216, + 116, + 344,
-    + 118, + 472, + 122, + 248,
-    + 124, + 376, + 126, + 504,
-    + 132, + 258, + 134, + 386,
-    + 138, + 162, + 140, + 290,
-    + 142, + 418, + 146, + 194,
-    + 148, + 322, + 150, + 450,
-    + 154, + 226, + 156, + 354,
-    + 158, + 482, + 164, + 266,
-    + 166, + 394, + 172, + 298,
-    + 174, + 426, + 178, + 202,
-    + 180, + 330, + 182, + 458,
-    + 186, + 234, + 188, + 362,
-    + 190, + 490, + 196, + 274,
-    + 198, + 402, + 204, + 306,
-    + 206, + 434, + 212, + 338,
-    + 214, + 466, + 218, + 242,
-    + 220, + 370, + 222, + 498,
-    + 228, + 282, + 230, + 410,
-    + 236, + 314, + 238, + 442,
-    + 244, + 346, + 246, + 474,
-    + 252, + 378, + 254, + 506,
-    + 262, + 388, + 268, + 292,
-    + 270, + 420, + 276, + 324,
-    + 278, + 452, + 284, + 356,
-    + 286, + 484, + 294, + 396,
-    + 302, + 428, + 308, + 332,
-    + 310, + 460, + 316, + 364,
-    + 318, + 492, + 326, + 404,
-    + 334, + 436, + 342, + 468,
-    + 348, + 372, + 350, + 500,
-    + 358, + 412, + 366, + 444,
-    + 374, + 476, + 382, + 508,
-    + 398, + 422, + 406, + 454,
-    + 414, + 486, + 438, + 462,
-    + 446, + 494, + 478, + 502
-};
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void digit_reversal_swapping(Int32 *y, Int32 *x);
-
-#ifdef __cplusplus
-}
-#endif
-
-void digit_reversal_swapping(Int32 *y, Int32 *x)
-{
-    Int16 i, j;
-    Int32 tmp[2];
-    const Int16 *pTable;
-
-    pTable = digit_reverse_swap_256;
-
-    for (Int k = 120; k != 0; k--)
-    {
-        i = *pTable++;
-        j = *pTable++;
-        tmp[0] = y[i];
-        tmp[1] = y[i+1];
-        y[i]   = y[j];
-        y[i+1] = y[j+1];
-        y[j]   = tmp[0];
-        y[j+1] = tmp[1];
-
-        tmp[0] = x[j];
-        tmp[1] = x[j+1];
-        x[j]   = x[i];
-        x[j+1] = x[i+1];
-        x[i]   = tmp[0];
-        x[i+1] = tmp[1];
-
-    }
-
-}
diff --git a/media/libstagefright/codecs/aacdec/digit_reversal_tables.h b/media/libstagefright/codecs/aacdec/digit_reversal_tables.h
deleted file mode 100644
index 7fdaaf7..0000000
--- a/media/libstagefright/codecs/aacdec/digit_reversal_tables.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/DIGIT_REVERSAL_TABLES.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions digit_reversal_tables
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef DIGIT_REVERSAL_TABLES_H
-#define DIGIT_REVERSAL_TABLES_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-extern const Int16 digit_reverse_64[];
-extern const Int16 digit_reverse_256[];
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* DIGIT_REVERSAL_TABLES_H */
diff --git a/media/libstagefright/codecs/aacdec/dst16.cpp b/media/libstagefright/codecs/aacdec/dst16.cpp
deleted file mode 100644
index 41c9259..0000000
--- a/media/libstagefright/codecs/aacdec/dst16.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: dst16.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 16
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement discrete sine transform of lenght 16
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#include "dst16.h"
-#include "dst8.h"
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-#define R_SHIFT     28
-#define Qfmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-const Int32 CosTable_8[8] =
-{
-    Qfmt(0.50241928618816F),   Qfmt(0.52249861493969F),
-    Qfmt(0.56694403481636F),   Qfmt(0.64682178335999F),
-    Qfmt(0.78815462345125F),   Qfmt(1.06067768599035F),
-    Qfmt(1.72244709823833F),   Qfmt(5.10114861868916F)
-};
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void dst_16(Int32 vec[], Int32 scratch_mem[])     /* scratch_mem size 8 */
-{
-    Int32 *temp_even = scratch_mem;
-
-    Int i;
-    const Int32 *pt_cos = &CosTable_8[7];
-    Int32 tmp0 = vec[15] >> 1;
-    Int32 tmp1, tmp2;
-    Int32 *pt_even = temp_even;
-    Int32 *pt_odd  = vec;
-    Int32 *pt_vec  = vec;
-    Int32 *pt_vecN_1;
-    Int32 tmp3;
-
-
-    *(pt_even++) = *(pt_vec++);
-    tmp1         = *(pt_vec++);
-    *(pt_odd++) = tmp1;
-
-    for (i = 3; i != 0; i--)
-    {
-        *(pt_even++) = *(pt_vec++);
-        tmp2         = *(pt_vec++);
-        *(pt_even++) = *(pt_vec++);
-        tmp3         = *(pt_vec++);
-        *(pt_odd++) = tmp2 + tmp1;
-        *(pt_odd++) = tmp3 + tmp2;
-        tmp1         = tmp3;
-
-    }
-
-    *(pt_even)   = *(pt_vec++);
-    *(pt_odd++) = *(pt_vec) + tmp1;
-
-
-    dst_8(temp_even);
-    dst_8(vec);
-
-    pt_vec  = &vec[7];
-
-    pt_even = &temp_even[7];
-    pt_vecN_1  = &vec[8];
-
-    tmp1 = *(pt_even--);
-
-    for (i = 4; i != 0; i--)
-    {
-        tmp3  = fxp_mul32_Q28((*(pt_vec) - tmp0), *(pt_cos--));
-        tmp2 = *(pt_even--);
-        *(pt_vec--)     = tmp3 + tmp1;
-        *(pt_vecN_1++)  = tmp3 - tmp1;
-        tmp3  = fxp_mul32_Q28((*(pt_vec) + tmp0), *(pt_cos--));
-        tmp1 = *(pt_even--);
-        *(pt_vecN_1++)  = tmp3 - tmp2;
-        *(pt_vec--)     = tmp3 + tmp2;
-    }
-
-}
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/dst16.h b/media/libstagefright/codecs/aacdec/dst16.h
deleted file mode 100644
index bce73ba..0000000
--- a/media/libstagefright/codecs/aacdec/dst16.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/dst16.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef DST16_H
-#define DST16_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    void dst_16(Int32 vec[], Int32 scratch_mem[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* DST16_H */
diff --git a/media/libstagefright/codecs/aacdec/dst32.cpp b/media/libstagefright/codecs/aacdec/dst32.cpp
deleted file mode 100644
index 5edecf1..0000000
--- a/media/libstagefright/codecs/aacdec/dst32.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: dst32.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 32
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement discrete sine transform of lenght 32
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "dst32.h"
-#include "dst16.h"
-
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-#define R_SHIFT1     29
-#define Qfmt29(x)   (Int32)(x*((Int32)1<<R_SHIFT1) + (x>=0?0.5F:-0.5F))
-#define Qfmt31(a)   (Int32)(a*0x7FFFFFFF + (a>=0?0.5F:-0.5F))
-
-const Int32 CosTable_16[14] =
-{
-    Qfmt31(0.50060299823520F),   Qfmt31(0.50547095989754F),
-    Qfmt31(0.51544730992262F),   Qfmt31(0.53104259108978F),
-    Qfmt31(0.55310389603444F),   Qfmt31(0.58293496820613F),
-    Qfmt31(0.62250412303566F),   Qfmt31(0.67480834145501F),
-    Qfmt31(0.74453627100230F),   Qfmt31(0.83934964541553F),
-    Qfmt29(0.97256823786196F),   Qfmt29(1.16943993343288F),
-    Qfmt29(1.48416461631417F),   Qfmt29(2.05778100995341F)
-};
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void dst_32(Int32 vec[], Int32 scratch_mem[])   /* scratch_mem size 32 */
-{
-    Int32 *temp_even = scratch_mem;
-
-    Int32 i;
-    const Int32 *pt_cos = &CosTable_16[13];
-    Int32 tmp0 = vec[31] >> 1;
-    Int32 tmp1, tmp2;
-    Int32 *pt_even = temp_even;
-    Int32 *pt_odd  = vec;
-    Int32 *pt_vec  = vec;
-    Int32 *pt_vecN_1  = vec;
-    Int32 tmp3;
-
-
-    tmp1 = 0;
-
-    for (i = 5; i != 0; i--)
-    {
-        *(pt_even++) = *(pt_vec++);
-        tmp2         = *(pt_vec++);
-        *(pt_even++) = *(pt_vec++);
-        tmp3         = *(pt_vec++);
-        *(pt_even++) = *(pt_vec++);
-        *(pt_odd++) = tmp2 + tmp1;
-        *(pt_odd++) = tmp3 + tmp2;
-        tmp1         = *(pt_vec++);
-        *(pt_odd++) = tmp1 + tmp3;
-    }
-
-    *(pt_even) = *(pt_vec++);
-    *(pt_odd)  = *(pt_vec) + tmp1;
-
-
-    dst_16(temp_even, &scratch_mem[16]);
-    dst_16(vec, &scratch_mem[24]);
-
-
-    pt_vecN_1  = &vec[16];
-
-    tmp1 = temp_even[15];
-
-    tmp3  = fxp_mul32_Q31((vec[15] - tmp0) << 3, Qfmt31(0.63687550772175F)) << 2;
-    tmp2  = temp_even[14];
-    *(pt_vecN_1++)  = tmp3 - tmp1;
-    vec[15]         = tmp3 + tmp1;
-    tmp1  = temp_even[13];
-    tmp3  = fxp_mul32_Q31((vec[14] + tmp0) << 3, Qfmt31(0.85190210461718F));
-    *(pt_vecN_1++)  = tmp3 - tmp2;
-    vec[14]         = tmp3 + tmp2;
-
-    pt_even = &temp_even[12];
-    pt_vec  = &vec[13];
-
-    for (i = 2; i != 0; i--)
-    {
-        tmp3  = fxp_mul32_Q29((*(pt_vec) - tmp0), *(pt_cos--));
-        tmp2 = *(pt_even--);
-        *(pt_vec--)     = tmp3 + tmp1;
-        *(pt_vecN_1++)  = tmp3 - tmp1;
-        tmp3  = fxp_mul32_Q29((*(pt_vec) + tmp0), *(pt_cos--));
-        tmp1 = *(pt_even--);
-        *(pt_vec--)     = tmp3 + tmp2;
-        *(pt_vecN_1++)  = tmp3 - tmp2;
-    }
-
-    for (i = 5; i != 0; i--)
-    {
-        tmp3  = fxp_mul32_Q31((*(pt_vec) - tmp0) << 1, *(pt_cos--));
-        tmp2 = *(pt_even--);
-        *(pt_vec--)     = tmp3 + tmp1;
-        *(pt_vecN_1++)  = tmp3 - tmp1;
-        tmp3  = fxp_mul32_Q31((*(pt_vec) + tmp0) << 1, *(pt_cos--));
-        tmp1 = *(pt_even--);
-        *(pt_vec--)     = tmp3 + tmp2;
-        *(pt_vecN_1++)  = tmp3 - tmp2;
-    }
-
-
-}
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/dst32.h b/media/libstagefright/codecs/aacdec/dst32.h
deleted file mode 100644
index c2bf1d2..0000000
--- a/media/libstagefright/codecs/aacdec/dst32.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/dst32.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef DST32_H
-#define DST32_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-    extern const Int32 CosTable_16[];
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    void dst_32(Int32 vec[], Int32 scratch_mem[]);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* DST32_H */
diff --git a/media/libstagefright/codecs/aacdec/dst8.cpp b/media/libstagefright/codecs/aacdec/dst8.cpp
deleted file mode 100644
index eaf8280..0000000
--- a/media/libstagefright/codecs/aacdec/dst8.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: dst8.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 8
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement discrete sine transform of lenght 8
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "dst8.h"
-
-#include "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define Qfmt15(x)   (Int16)(x*((Int32)1<<15) + (x>=0?0.5F:-0.5F))
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-#define R_SHIFT     29
-#define Qfmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-#define Qfmt31(x)   (Int32)(x*0x7FFFFFFF + (x>=0?0.5F:-0.5F))
-
-
-void dst_8(Int32 vec[])
-{
-
-    Int32 temp1;
-    Int32 temp2;
-    Int32 temp3;
-    Int32 temp4;
-    Int32 temp5;
-    Int32 temp6;
-    Int32 temp7;
-    Int32 tmp_a;
-    Int32 tmp_aa;
-    Int32 tmp_b;
-    Int32 tmp_bb;
-    Int32 tmp_c;
-    Int32 tmp_cc;
-    Int32 tmp_d;
-    Int32 tmp_dd;
-
-    temp1 = fxp_mul32_by_16(vec[1], Qfmt15(0.50979557910416F));         /* (1/(2*cos(  phi)));*/
-    temp2 = fxp_mul32_by_16(vec[2], Qfmt15(0.54119610014620F));         /* (1/(2*cos(2*phi)));*/
-    temp3 = fxp_mul32_by_16(vec[3], Qfmt15(0.60134488693505F));         /* (1/(2*cos(3*phi)));*/
-    temp5 = fxp_mul32_by_16(vec[5], Qfmt15(0.89997622313642F));         /* (1/(2*cos(5*phi)));*/
-    temp6 = fxp_mul32_by_16(vec[6] << 1, Qfmt15(0.65328148243819F));        /* (1/(2*cos(6*phi)));*/
-    temp7 = vec[7] + fxp_mul32_Q31(vec[7], Qfmt31(0.56291544774152F));          /* (1/(2*cos(7*phi)));*/
-
-    /*  even  */
-    tmp_a = fxp_mul32_Q31((temp2 + temp6) << 1, Qfmt31(0.70710678118655F));
-    tmp_b = (temp2 - temp6) + tmp_a;
-
-    temp4 = fxp_mul32_by_16(vec[4], Qfmt15(0.70710678118655F));
-    vec[0] =   tmp_a + temp4;
-    vec[1] =   tmp_b + temp4;
-    vec[2] =   tmp_b - temp4;
-    vec[3] =   tmp_a - temp4;
-
-
-    /* odd */
-
-    tmp_a  = fxp_mul32_by_16((temp1 + temp7) << 1, Qfmt15(0.54119610014620F));  /* (1/(2*cos(2*phi)));  */
-    tmp_aa = (temp1 - temp7);
-    tmp_bb = (temp5 - temp3);
-    temp5  = fxp_mul32_Q29((temp5 + temp3), Qfmt(1.30656296487638F));   /* (1/(2*cos(6*phi)));  */
-
-
-    tmp_c  = fxp_mul32_by_16((tmp_a + temp5) << 1, Qfmt15(0.70710678118655F));
-    tmp_cc =  tmp_a - temp5;
-
-    tmp_d  = fxp_mac32_by_16((tmp_aa - tmp_bb) << 1, Qfmt15(0.70710678118655F), tmp_c);
-    tmp_dd = (tmp_aa + tmp_bb);
-
-    tmp_dd +=  tmp_c;
-    tmp_a   =  tmp_d  + tmp_cc;
-    vec[5]  =  tmp_a  - vec[2];
-    vec[2] +=  tmp_a;
-
-    temp5   =  tmp_dd + tmp_cc;
-
-    vec[4]  =  temp5  - vec[3];
-    vec[3] +=  temp5;
-    vec[7]  =  tmp_c  - vec[0];
-    vec[0] +=  tmp_c;
-    vec[6]  =  tmp_d  - vec[1];
-    vec[1] +=  tmp_d;
-
-}
-
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/dst8.h b/media/libstagefright/codecs/aacdec/dst8.h
deleted file mode 100644
index 2738e80..0000000
--- a/media/libstagefright/codecs/aacdec/dst8.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/dst8.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef DST8_H
-#define DST8_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    void dst_8(Int32 vec[]);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* DST8_H */
diff --git a/media/libstagefright/codecs/aacdec/e_adif_const.h b/media/libstagefright/codecs/aacdec/e_adif_const.h
deleted file mode 100644
index 08b5415..0000000
--- a/media/libstagefright/codecs/aacdec/e_adif_const.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/e_ADIF_Const.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for ADIF header related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_ADIF_CONST_H
-#define E_ADIF_CONST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    /*
-     * audio data interchange format header
-     */
-    LEN_ADIF_ID     = (32 / 8),
-    LEN_COPYRT_PRES = 1,
-    LEN_COPYRT_ID   = (72 / 8),
-    LEN_ORIG        = 1,
-    LEN_HOME        = 1,
-    LEN_BS_TYPE     = 1,
-    LEN_BIT_RATE    = 23,
-    LEN_NUM_PCE     = 4,
-    LEN_ADIF_BF     = 20
-
-} eADIF_Const;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/e_blockswitching.h b/media/libstagefright/codecs/aacdec/e_blockswitching.h
deleted file mode 100644
index bf6ad15..0000000
--- a/media/libstagefright/codecs/aacdec/e_blockswitching.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/e_BlockSwitching.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for BlockSwitching related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_BLOCK_SWITCHING_H
-#define E_BLOCK_SWITCHING_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    /*
-     * block switching
-     */
-    LN          = 2048,
-    SN          = 256,
-    LN2         = LN / 2,
-    SN2         = SN / 2,
-    LN4         = LN / 4,
-    SN4         = SN / 4,
-    NSHORT      = LN / SN,
-    MAX_SBK     = NSHORT,
-    MAX_WIN     = MAX_SBK,
-
-    ONLY_LONG_WINDOW    = 0,
-    LONG_START_WINDOW,
-    EIGHT_SHORT_WINDOW,
-    LONG_STOP_WINDOW,
-    NUM_WIN_SEQ,
-
-    WLONG       = ONLY_LONG_WINDOW,
-    WSTART,
-    WSHORT,
-    WSTOP,
-
-    MAXBANDS        = 16 * NSHORT,  /* max number of scale factor bands */
-    MAXFAC      = 121,      /* maximum scale factor */
-    MIDFAC      = (MAXFAC - 1) / 2,
-    SF_OFFSET       = 100       /* global gain must be positive */
-} eBlockSwitching;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/e_coupling_mode.h b/media/libstagefright/codecs/aacdec/e_coupling_mode.h
deleted file mode 100644
index 68244bb..0000000
--- a/media/libstagefright/codecs/aacdec/e_coupling_mode.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: e_coupling_mode.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_COUPLING_MODE_H
-#define E_COUPLING_MODE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    COUPLING_OFF,
-    COUPLING_LEVEL,
-    COUPLING_BAL
-}
-COUPLING_MODE;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_elementid.h b/media/libstagefright/codecs/aacdec/e_elementid.h
deleted file mode 100644
index 5f84643..0000000
--- a/media/libstagefright/codecs/aacdec/e_elementid.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Pathname: ./include/e_BLOCKTYPE.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for BlockType related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_ELEMENTID_H
-#define E_ELEMENTID_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    /* sfb 40, coef 672, pred bw of 15.75 kHz at 48 kHz
-     * this is also the highest number of bins used
-     * by predictor for any sampling rate
-     */
-    MAX_PRED_SFB    = 40,   /* 48 kHz only, now obsolete */
-    MAX_PRED_BINS   = 672,
-
-    ID_SCE      = 0,
-    ID_CPE,
-    ID_CCE,
-    ID_LFE,
-    ID_DSE,
-    ID_PCE,
-    ID_FIL,
-    ID_END
-}
-ElementId;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/e_huffmanconst.h b/media/libstagefright/codecs/aacdec/e_huffmanconst.h
deleted file mode 100644
index 5d0e628..0000000
--- a/media/libstagefright/codecs/aacdec/e_huffmanconst.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/e_HuffmanConst.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for Huffman related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_HUFFMAN_CONST_H
-#define E_HUFFMAN_CONST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    /*
-     * specify huffman tables as signed (1) or unsigned (0)
-     */
-    HUF1SGN     = 1,
-    HUF2SGN     = 1,
-    HUF3SGN     = 0,
-    HUF4SGN     = 0,
-    HUF5SGN     = 1,
-    HUF6SGN     = 1,
-    HUF7SGN     = 0,
-    HUF8SGN     = 0,
-    HUF9SGN     = 0,
-    HUF10SGN        = 0,
-    HUF11SGN        = 0,
-
-    ZERO_HCB        = 0,
-    BY4BOOKS        = 4,
-    ESCBOOK     = 11,
-    NSPECBOOKS      = ESCBOOK + 1,
-    BOOKSCL     = NSPECBOOKS,
-    NBOOKS      = NSPECBOOKS + 1,
-    INTENSITY_HCB2  = 14,
-    INTENSITY_HCB   = 15,
-    NOISE_HCB       = 13,
-    NOISE_HCB2      = 113,
-
-    NOISE_PCM_BITS      = 9,
-    NOISE_PCM_OFFSET    = (1 << (NOISE_PCM_BITS - 1)),
-
-    NOISE_OFFSET        = 90,
-
-    LONG_SECT_BITS  = 5,
-    SHORT_SECT_BITS = 3
-} eHuffmanConst;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_infoinitconst.h b/media/libstagefright/codecs/aacdec/e_infoinitconst.h
deleted file mode 100644
index 788b5e9..0000000
--- a/media/libstagefright/codecs/aacdec/e_infoinitconst.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/e_infoinitConst.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for Infoinit related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_INFOINIT_CONST_H
-#define E_INFOINIT_CONST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "chans.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    /* block switch windows for single channels or channel pairs */
-    Winds   = Chans,
-
-    /* average channel block length, bytes */
-    Avjframe    = 341,
-
-    TEXP    = 128,      /* size of exp cache table */
-    MAX_IQ_TBL  = 128,      /* size of inv quant table */
-    MAXFFT  = LN4
-
-} infoinitConst;
-
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/e_invf_mode.h b/media/libstagefright/codecs/aacdec/e_invf_mode.h
deleted file mode 100644
index 57b3281..0000000
--- a/media/libstagefright/codecs/aacdec/e_invf_mode.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: e_invf_mode.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_INVF_MODE_H
-#define E_INVF_MODE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    INVF_OFF,
-    INVF_LOW_LEVEL,
-    INVF_MID_LEVEL,
-    INVF_HIGH_LEVEL,
-
-    INVF_NO_OVERRIDE
-}
-INVF_MODE;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_maskstatus.h b/media/libstagefright/codecs/aacdec/e_maskstatus.h
deleted file mode 100644
index 010b6f8..0000000
--- a/media/libstagefright/codecs/aacdec/e_maskstatus.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-   Pathname: ./include/e_MaskStatus.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file gives the enum of mask_present value used in getmask.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_MASKSTATUS_H
-#define E_MASKSTATUS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-enum
-{
-    MASK_NOT_PRESENT,
-    MASK_FROM_BITSTREAM,
-    MASK_ALL_FRAME,
-    MASK_ERROR
-};
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_mp4ff_const.h b/media/libstagefright/codecs/aacdec/e_mp4ff_const.h
deleted file mode 100644
index 1006406..0000000
--- a/media/libstagefright/codecs/aacdec/e_mp4ff_const.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: e_MP4FF_const.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file enums the constants used by MP4FF header
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_MP4FF_CONST_H
-#define E_MP4FF_CONST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    LEN_OBJ_TYPE = 5,
-    LEN_SAMP_RATE_IDX = 4,
-    LEN_SAMP_RATE   = 24,
-    LEN_CHAN_CONFIG = 4,
-    LEN_SYNC_EXTENSION_TYPE = 11,
-    LEN_FRAME_LEN_FLAG = 1,
-    LEN_DEPEND_ON_CORE = 1,
-    LEN_CORE_DELAY = 14,
-    LEN_EXT_FLAG = 1,
-    LEN_EP_CONFIG = 2,
-    LEN_LAYER_NUM = 3,
-    LEN_SUB_FRAME = 5,
-    LEN_LAYER_LEN = 11,
-    LEN_SECT_RES_FLAG = 1,
-    LEN_SCF_RES_FLAG = 1,
-    LEN_SPEC_RES_FLAG = 1,
-    LEN_EXT_FLAG3 = 1
-} eMP4FF_const;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_progconfigconst.h b/media/libstagefright/codecs/aacdec/e_progconfigconst.h
deleted file mode 100644
index b5fdc08..0000000
--- a/media/libstagefright/codecs/aacdec/e_progconfigconst.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: e_ProgConfigConst.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for ProgConfig related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_PROG_CONFIG_CONST_H
-#define E_PROG_CONFIG_CONST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    /*
-     * Program Configuration
-     */
-    Main_Profile    = 0,
-    LC_Profile      = 1,
-
-    Fs_48       = 3,
-    Fs_44       = 4,
-    Fs_32       = 5,
-
-    LEN_PROFILE     = 2,
-    LEN_SAMP_IDX    = 4,
-    LEN_NUM_ELE     = 4,
-    LEN_NUM_LFE     = 2,
-    LEN_NUM_DAT     = 3,
-    LEN_NUM_CCE     = 4,
-    LEN_MIX_PRES    = 1,
-    LEN_MMIX_IDX    = 2,
-    LEN_PSUR_ENAB   = 1,
-    LEN_ELE_IS_CPE  = 1,
-    LEN_IND_SW_CCE  = 1,
-    LEN_COMMENT_BYTES   = 8
-
-} eProgConfigConst;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_rawbitstreamconst.h b/media/libstagefright/codecs/aacdec/e_rawbitstreamconst.h
deleted file mode 100644
index a460d13..0000000
--- a/media/libstagefright/codecs/aacdec/e_rawbitstreamconst.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-   Pathname: e_RawBitstreamConst.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for the Raw Bitstream related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_RAW_BITSTREAM_CONST_H
-#define E_RAW_BITSTREAM_CONST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    LEN_SE_ID       = 3,
-    LEN_TAG     = 4,
-    LEN_COM_WIN     = 1,
-    LEN_ICS_RESERV  = 1,
-    LEN_WIN_SEQ     = 2,
-    LEN_WIN_SH      = 1,
-    LEN_MAX_SFBL    = 6,
-    LEN_MAX_SFBS    = 4,
-    LEN_CB          = 4,
-    LEN_SCL_PCM     = 8,
-    LEN_PRED_PRES   = 1,
-    LEN_PRED_RST    = 1,
-    LEN_PRED_RSTGRP = 5,
-    LEN_PRED_ENAB   = 1,
-    LEN_MASK_PRES   = 2,
-    LEN_MASK        = 1,
-    LEN_PULSE_PRES  = 1,
-    LEN_TNS_PRES    = 1,
-    LEN_GAIN_PRES   = 1,
-
-    LEN_PULSE_NPULSE    = 2,
-    LEN_PULSE_ST_SFB    = 6,
-    LEN_PULSE_POFF      = 5,
-    LEN_PULSE_PAMP      = 4,
-    NUM_PULSE_LINES     = 4,
-    PULSE_OFFSET_AMP    = 4,
-
-    LEN_IND_CCE_FLG = 1,
-    LEN_NCC         = 3,
-    LEN_IS_CPE      = 1,
-    LEN_CC_LR       = 1,
-    LEN_CC_DOM      = 1,
-    LEN_CC_SGN      = 1,
-    LEN_CCH_GES     = 2,
-    LEN_CCH_CGP     = 1,
-
-    LEN_D_ALIGN     = 1,
-    LEN_D_CNT       = 8,
-    LEN_D_ESC       = 8,
-    LEN_F_CNT       = 4,
-    LEN_F_ESC       = 8,
-    LEN_BYTE        = 8,
-    LEN_PAD_DATA    = 8,
-
-    LEN_PC_COMM     = 9
-
-} eRawBitstreamConst;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/e_sbr_element_id.h b/media/libstagefright/codecs/aacdec/e_sbr_element_id.h
deleted file mode 100644
index 1b021ff..0000000
--- a/media/libstagefright/codecs/aacdec/e_sbr_element_id.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: e_sbr_element_id.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_SBR_ELEMENT_ID_H
-#define E_SBR_ELEMENT_ID_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    SBR_ID_SCE = 0,
-    SBR_ID_CPE
-}
-SBR_ELEMENT_ID;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_sbr_error.h b/media/libstagefright/codecs/aacdec/e_sbr_error.h
deleted file mode 100644
index b6c8a90..0000000
--- a/media/libstagefright/codecs/aacdec/e_sbr_error.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: e_sbr_error.h
- Funtions:
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_SBR_ERROR_H
-#define E_SBR_ERROR_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define HANDLE_ERROR_INFO Int32
-#define noError 0
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-typedef enum
-{
-    SBRDEC_OK = 0,
-    SBRDEC_NOSYNCH,
-    SBRDEC_ILLEGAL_PROGRAM,
-    SBRDEC_ILLEGAL_TAG,
-    SBRDEC_ILLEGAL_CHN_CONFIG,
-    SBRDEC_ILLEGAL_SECTION,
-    SBRDEC_ILLEGAL_SCFACTORS,
-    SBRDEC_ILLEGAL_PULSE_DATA,
-    SBRDEC_MAIN_PROFILE_NOT_IMPLEMENTED,
-    SBRDEC_GC_NOT_IMPLEMENTED,
-    SBRDEC_ILLEGAL_PLUS_ELE_ID,
-    SBRDEC_CREATE_ERROR,
-    SBRDEC_NOT_INITIALIZED,
-    SBRDEC_TOO_MANY_SBR_ENVELOPES,
-    SBRDEC_INVALID_BITSTREAM
-}
-SBR_ERROR;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_sbr_header_status.h b/media/libstagefright/codecs/aacdec/e_sbr_header_status.h
deleted file mode 100644
index 5b2a43f..0000000
--- a/media/libstagefright/codecs/aacdec/e_sbr_header_status.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: e_sbr_header_status.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_SBR_HEADER_STATUS_H
-#define E_SBR_HEADER_STATUS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    HEADER_OK,
-    HEADER_RESET,
-    HEADER_NOT_INITIALIZED
-}
-SBR_HEADER_STATUS;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_sbr_master_status.h b/media/libstagefright/codecs/aacdec/e_sbr_master_status.h
deleted file mode 100644
index 16e43a4..0000000
--- a/media/libstagefright/codecs/aacdec/e_sbr_master_status.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: e_sbr_master_status.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_SBR_MASTER_STATUS_H
-#define E_SBR_MASTER_STATUS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    MASTER_OK,
-    MASTER_RESET
-}
-SBR_MASTER_STATUS;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_sbr_sync_state.h b/media/libstagefright/codecs/aacdec/e_sbr_sync_state.h
deleted file mode 100644
index d9f8669..0000000
--- a/media/libstagefright/codecs/aacdec/e_sbr_sync_state.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: e_sbr_sync_state.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_SBR_SYNC_STATE_H
-#define E_SBR_SYNC_STATE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    SBR_NOT_INITIALIZED,
-    UPSAMPLING,
-    SBR_ACTIVE
-}
-SBR_SYNC_STATE;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_sr_mode.h b/media/libstagefright/codecs/aacdec/e_sr_mode.h
deleted file mode 100644
index eff00dd..0000000
--- a/media/libstagefright/codecs/aacdec/e_sr_mode.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: e_sr_mode.h
- Funtions:
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_SR_MODE_H
-#define E_SR_MODE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    SINGLE_RATE = 1,
-    UP_BY_2
-}
-SR_MODE;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_tmp4audioobjecttype.h b/media/libstagefright/codecs/aacdec/e_tmp4audioobjecttype.h
deleted file mode 100644
index 83cccce..0000000
--- a/media/libstagefright/codecs/aacdec/e_tmp4audioobjecttype.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/e_tMP4AudioObjectType.h
-
- This file contains enumerated types for MP4 Audio Object Types, as defined
- in ISO/IEC 14496-3, AMMENDMENT 1 Dated 2000-09-15
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_TMP4AUDIOOBJECTTYPE_H
-#define E_TMP4AUDIOOBJECTTYPE_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    typedef enum eMP4AudioObjectType
-    {
-        MP4AUDIO_NULL            =  0, /*                                       */
-        MP4AUDIO_AAC_MAIN        =  1, /*                                       */
-        MP4AUDIO_AAC_LC          =  2, /* LC = Low Complexity                   */
-        MP4AUDIO_AAC_SSR         =  3, /* SSR = Scalable Sampling Rate          */
-        MP4AUDIO_LTP             =  4, /* LTP = Long Term Prediction            */
-        MP4AUDIO_SBR             =  5, /* SBR = Spectral Band Replication       */
-        MP4AUDIO_AAC_SCALABLE    =  6, /* scales both bitrate and sampling rate */
-        MP4AUDIO_TWINVQ          =  7, /* low bit rate                          */
-        MP4AUDIO_CELP            =  8,
-        MP4AUDIO_HVXC            =  9,
-        /* 10 is reserved                        */
-        /* 11 is reserved                        */
-        MP4AUDIO_TTSI            = 12,
-        /* 13-16 are synthesis and MIDI types    */
-        MP4AUDIO_ER_AAC_LC       = 17, /*                                       */
-        /* 18 is reserved                        */
-        MP4AUDIO_ER_AAC_LTP      = 19, /*                                       */
-        MP4AUDIO_ER_AAC_SCALABLE = 20, /*                                       */
-        MP4AUDIO_ER_TWINVQ       = 21, /*                                       */
-        MP4AUDIO_ER_BSAC         = 22, /*                                       */
-        MP4AUDIO_ER_AAC_LD       = 23, /*                                       */
-        MP4AUDIO_ER_CELP         = 24, /*                                       */
-        MP4AUDIO_ER_HVXC         = 25, /*                                       */
-        MP4AUDIO_ER_HILN         = 26, /*                                       */
-        MP4AUDIO_PARAMETRIC      = 27, /*                                       */
-        MP4AUDIO_PS              = 29  /*  Explicit Parametric Stereo           */
-
-    } tMP4AudioObjectType;
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    /* Should not be any function declarations in this file */
-
-    /*----------------------------------------------------------------------------
-    ; END
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* E_TMP4AUDIOOBJECTTYPE_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/e_tns_const.h b/media/libstagefright/codecs/aacdec/e_tns_const.h
deleted file mode 100644
index 157d471..0000000
--- a/media/libstagefright/codecs/aacdec/e_tns_const.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Pathname: ./include/e_TNS_Const.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for TNS related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_TNS_CONST_H
-#define E_TNS_CONST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    TNS_MAX_BANDS = 49,
-    TNS_MAX_ORDER = 20,
-    TNS_MAX_WIN   =  8,
-    TNS_MAX_FILT  =  3,
-    Q_SPEC        = 11,
-    Q_LPC         = 19
-
-} eTNS_Const;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/e_window_sequence.h b/media/libstagefright/codecs/aacdec/e_window_sequence.h
deleted file mode 100644
index c4b933e..0000000
--- a/media/libstagefright/codecs/aacdec/e_window_sequence.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/e_WINDOW_SEQUENCE.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for Window Sequence related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_WINDOW_SEQUENCE_H
-#define E_WINDOW_SEQUENCE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    ONLY_LONG_SEQUENCE,
-    LONG_START_SEQUENCE,
-    EIGHT_SHORT_SEQUENCE,
-    LONG_STOP_SEQUENCE,
-    NUM_WINDOW_SEQUENCE,
-    ENSURE_WINDOW_SEQUENCE_INT_SIZE = 0x7FFFFF
-}
-WINDOW_SEQUENCE;
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/e_window_shape.h b/media/libstagefright/codecs/aacdec/e_window_shape.h
deleted file mode 100644
index 3eca438..0000000
--- a/media/libstagefright/codecs/aacdec/e_window_shape.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: e_Window_shape.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- enum for Window Sequence related constants
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef E_WINDOW_SHAPE_H
-#define E_WINDOW_SHAPE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-    SINE_WINDOW = 0,
-    KAISER_BESSEL_WINDOW,
-    NUM_WINDOW_SHAPES,
-    ENSURE_WINDOW_SHAPE_INT_SIZE = 0x7FFFFF
-}
-WINDOW_SHAPE;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/esc_iquant_scaling.cpp b/media/libstagefright/codecs/aacdec/esc_iquant_scaling.cpp
deleted file mode 100644
index 778c88c..0000000
--- a/media/libstagefright/codecs/aacdec/esc_iquant_scaling.cpp
+++ /dev/null
@@ -1,789 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/esc_iquant_scaling.c
- Funtions:  esc_iquant_scaling
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from esc_iquant_fxp.c code
-
- Description:  Eliminated unused variables to avoid warnings, changed header
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    quantSpec[] = array of quantized compressed spectral coefficients, of
-                  data type Int and length sfbWidth.
-
-    sfbWidth    = number of array elements in quantSpec and the output array
-                  coef, data type Int.
-
-    coef[]      = output array of uncompressed coefficients, stored in a
-                  variable Q format, depending on the maximum value found
-                  for the group, array of Int32, length sfbWdith to be
-                  overwritten.
-
-    QFormat     = the output Q format for the array coef[].
-
-
-    scale       = scaling factor after separating power of 2 factor out from
-                  0.25*(sfb_scale - 100), i.e., 0.25*sfb_scale.
-
-    maxInput    = maximum absolute value of quantSpec.
-
- Local Stores/Buffers/Pointers Needed: None.
-
- Global Stores/Buffers/Pointers Needed:
-    inverseQuantTable = lookup table of const integer values to the one third
-                power stored in Q27 format, in file iquant_table.c, const
-                array of UInt32, of size 1025.
-
- Outputs: None
-
- Pointers and Buffers Modified:
-    coef[] contents are overwritten with the uncompressed values from
-    quantSpec[]
-
-
-
-
- Local Stores Modified: None.
-
- Global Stores Modified: None.
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function performs the inverse quantization of the spectral coeficients
- read from huffman decoding. It takes each input array value to the four
- thirds power, then scales it according to the scaling factor input argument
- ,and stores the result in the output array in a variable Q format
- depending upon the maximum input value found.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall not have static or global variables.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 13818-7:1997 Titled "Information technology - Generic coding
-   of moving pictures and associated audio information - Part 7: Advanced
-   Audio Coding (AAC)", Section 10.3, "Decoding process", page 43.
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    maxInput = 0;
-
-    FOR (i = sfbWidth - 1; i >= 0; i--)
-        x = quantSpec[i];
-
-        IF ( x >= 0)
-            absX = x;
-        ELSE
-            absX = -x;
-        ENDIF
-
-        coef[i] = absX;
-
-        IF (absX > maxInput)
-            maxInput = absX;
-        ENDIF
-    ENDFOR
-
-    IF (maxInput == 0)
-        *pQFormat = QTABLE;
-    ELSE
-        temp = inverseQuantTable[(maxInput >> ORDER) + 1];
-
-        temp += ((1 << (QTABLE))-1);
-
-        temp >>= (QTABLE-1);
-
-        temp *= maxInput;
-
-        binaryDigits = 0;
-        WHILE( temp != 0)
-            temp >>= 1;
-            binaryDigits++;
-        WEND
-
-        IF (binaryDigits < (SIGNED32BITS - QTABLE))
-            binaryDigits = SIGNED32BITS - QTABLE;
-        ENDIF
-
-        *pQFormat = SIGNED32BITS - binaryDigits;
-        shift = QTABLE - *pQFormat;
-
-        IF (maxInput < TABLESIZE)
-            FOR (i = sfbWidth - 1; i >= 0; i--)
-                x = quantSpec[i];
-
-                absX = coef[i];
-
-                tmp_coef = x * (inverseQuantTable[absX] >> shift);
-
-                b_low  = (tmp_coef & 0xFFFF);
-                b_high = (tmp_coef >> 16);
-
-                mult_low  = ( (UInt32) b_low * scale );
-                mult_high = ( (Int32) b_high * scale );
-
-                mult_low >>= 16;
-
-                coef[i]  = (Int32) (mult_high + mult_low);
-
-            ENDFOR
-        ELSE
-            FOR (i = sfbWidth; i >= 0 ; i--)
-                x    = quantSpec[i];
-                absX = coef[i];
-
-                IF (absX < TABLESIZE)
-                    tmp_coef = x * (inverseQuantTable[absX] >> shift);
-                ELSE
-                    index = absX >> ORDER;
-                    w1 = inverseQuantTable[index];
-
-                    approxOneThird = (w1 * FACTOR) >> shift;
-
-
-                    x1 = index * SPACING;
-                    w2 = inverseQuantTable[index+1];
-
-                    deltaOneThird = (w2 - w1) * (absX - x1);
-
-                    deltaOneThird >>= (shift + ORDER - 1);
-
-                    tmp_coef = x * (approxOneThird + deltaOneThird);
-
-                ENDIF
-
-                b_low  = (mult_high & 0xFFFF);
-                b_high = (mult_high >> 16);
-
-                mult_low  = ( (UInt32) b_low * scale );
-                mult_high = ( (Int32) b_high * scale );
-
-                mult_low >>= 16;
-
-                coef[i]  = (Int32) (mult_high + mult_low);
-
-            ENDFOR
-        ENDIF
-    ENDIF
-
-    RETURN
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "iquant_table.h"
-#include "esc_iquant_scaling.h"
-#include "aac_mem_funcs.h"         /* For pv_memset                         */
-
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-/*
- * Read further on what order is.
- * Note: If ORDER is not a multiple of 3, FACTOR is not an integer.
- * Note: Portions of this function assume ORDER is 3, and so does the table
- *       in iquant_table.c
- */
-#define ORDER        (3)
-/*
- * For input values > TABLESIZE, multiply by FACTOR to get x ^ (1/3)
- * FACTOR = 2 ^ (ORDER/3)
- */
-#define FACTOR       (2)
-
-/*
- * This is one more than the range of expected inputs.
- */
-#define INPUTRANGE   (8192)
-
-/*
- * SPACING is 2 ^ ORDER, and is the spacing between points when in the
- * interpolation range.
- */
-#define SPACING      (1<<ORDER)
-
-/*
- * The actual table size is one more than TABLESIZE, to allow for
- * interpolation for numbers near 8191
- */
-#define TABLESIZE    (INPUTRANGE/SPACING)
-
-/*
- * Format the table is stored in.
- */
-#define QTABLE       (27)
-
-/*
- * Number of bits for data in a signed 32 bit integer.
- */
-#define SIGNED32BITS  (31)
-
-/*
- * Round up value for intermediate values obtained from the table
- */
-#define ROUND_UP (( ((UInt32) 1) << (QTABLE) )-1)
-
-#define     MASK_LOW16  0xffff
-#define     UPPER16     16
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*
- * Processing in this function is performed in these steps:
- *
- * 1) Find the overall Q format for the entire group of inputs. This consists
- *    of:
- *    a) Finding the maximum input
- *    b) estimate the maximum output
- *    c) Using the table, get max ^ (4/3), taking into account the table is
- *       in q format.
- * 2) For each array element, see if the value is directly inside the table.
- *    a) If yes, just multiply by table value by itself, then shift as
- *       appropriate.
- *    b) If no, get an approximation (described below) for x ^ (1/3) by linearly
- *       interpolating using lower values in the table, then multiply by a
- *       correction factor, then multiply by x (see below).
- *
- * It more accurate to interpolate x ^ (1/3) then x ^ (4/3), so that is stored
- * in the lookup table. For values not in the table, interpolation is used:
- *
- *  We want y = x ^ (4/3) = x * (x ^ (1/3))
- *
- *  Let     x = w * (2 ^ m)  where m is a constant, = ORDER
- *
- *  then     x ^ (1/3) = w ^ (1/3) * (2 ^ (m/3))
- *
- *  w is most likely not an integer, so an interpolation with floor(w) and
- *  ceil(w) can be performed to approximate w ^ (1/3) by getting values out of
- *  the table. Then to get x ^ (1/3), multiply by FACTOR. If m = 0, 3, 6,
- *  then FACTOR is a simple power of 2, so a shift can do the job.
- *
- *  The actual code employs some more tricks to speed things up, and because
- *  the table is stored in Q format.
- *
- *  Rather than saving the sign of each input, the unsigned value of
- *  abs(x) ^ (1/3) is multiplied by the signed input value.
- */
-
-
-
-#if ( defined(_ARM) || defined(_ARM_V4))
-
-/*
- *  Absolute value for 16 bit-numbers
- */
-__inline Int32 abs2(Int32 x)
-{
-    Int32 z;
-    /*
-        z = x - (x<0);
-        x = z ^ sign(z)
-     */
-    __asm
-    {
-        sub  z, x, x, lsr #31
-        eor  x, z, z, asr #31
-    }
-    return (x);
-}
-
-
-#define pv_abs(x)   abs2(x)
-
-
-#elif (defined(PV_ARM_GCC_V5)||defined(PV_ARM_GCC_V4))
-
-/*
- *  Absolute value for 16 bit-numbers
- */
-__inline Int32 abs2(Int32 x)
-{
-    register Int32 z;
-    register Int32 y;
-    register Int32 ra = x;
-    asm volatile(
-        "sub  %0, %2, %2, lsr #31\n\t"
-        "eor  %1, %0, %0, asr #31"
-    : "=&r*i"(z),
-        "=&r*i"(y)
-                : "r"(ra));
-
-    return (y);
-}
-
-#define pv_abs(x)   abs2(x)
-
-
-#else
-
-#define pv_abs(x)   ((x) > 0)? (x) : (-x)
-
-#endif
-
-
-
-
-
-void esc_iquant_scaling(
-    const Int16     quantSpec[],
-    Int32         coef[],
-    const Int     sfbWidth,
-    Int const      QFormat,
-    UInt16        scale,
-    Int           maxInput)
-{
-    Int    i;
-    Int    x;
-    Int    y;
-    Int    index;
-    Int    shift;
-    UInt   absX;
-    UInt32 w1, w2;
-    UInt32 deltaOneThird;
-    UInt32 x1;
-    UInt32 approxOneThird;
-    Int32   mult_high;
-
-
-#if ( defined(_ARM) || defined(_ARM_V4))
-
-    {
-        Int32   *temp;
-        Int32   R12, R11, R10, R9;
-
-        deltaOneThird = sizeof(Int32) * sfbWidth;
-        temp = coef;
-
-        // from standard library call for __rt_memset
-        __asm
-        {
-            MOV     R12, #0x0
-            MOV     R11, #0x0
-            MOV     R10, #0x0
-            MOV     R9, #0x0
-            SUBS    deltaOneThird, deltaOneThird, #0x20
-loop:
-            STMCSIA temp!, {R12, R11, R10, R9}
-            STMCSIA temp!, {R12, R11, R10, R9}
-            SUBCSS  deltaOneThird, deltaOneThird, #0x20
-            BCS     loop
-
-            MOVS    deltaOneThird, deltaOneThird, LSL #28
-            STMCSIA temp!, {R12, R11, R10, R9}
-            STMMIIA temp!, {R12, R11}
-        }
-    }
-
-#else
-    pv_memset(coef, 0, sizeof(Int32) * sfbWidth);
-#endif
-
-    if (maxInput > 0)
-    {
-
-        shift = QTABLE - QFormat;
-
-        if (scale != 0)
-        {
-            if (maxInput < TABLESIZE)
-            {
-
-                for (i = sfbWidth - 1; i >= 0; i -= 4)
-                {
-                    x = quantSpec[i];
-                    y = quantSpec[i-1];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        mult_high = (x * (inverseQuantTable[absX] >> shift));
-                        coef[i] = fxp_mul32_by_16(mult_high, scale) << 1;
-                    }
-
-                    if (y)
-                    {
-                        absX = pv_abs(y);
-                        mult_high = y * (inverseQuantTable[absX] >> shift);
-                        coef[i-1] = fxp_mul32_by_16(mult_high, scale) << 1;
-                    }
-
-                    x = quantSpec[i-2];
-                    y = quantSpec[i-3];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        mult_high = x * (inverseQuantTable[absX] >> shift);
-                        coef[i-2] = fxp_mul32_by_16(mult_high, scale) << 1;
-                    }
-
-                    if (y)
-                    {
-                        absX = pv_abs(y);
-                        mult_high = y * (inverseQuantTable[absX] >> shift);
-                        coef[i-3] = fxp_mul32_by_16(mult_high, scale) << 1;
-                    }
-                } /* end for (i = sfbWidth - 1; i >= 0; i--) */
-
-            } /* end if (maxInput < TABLESIZE)*/
-
-            else /* maxInput >= TABLESIZE) */
-            {
-                for (i = sfbWidth - 1; i >= 0; i -= 4)
-                {
-                    x    = quantSpec[i];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        if (absX < TABLESIZE)
-                        {
-                            mult_high = x * (inverseQuantTable[absX] >> shift);
-                            coef[i] = fxp_mul32_by_16(mult_high, scale) << 1;
-
-                        }
-                        else
-                        {
-                            index = absX >> ORDER;
-                            w1 = inverseQuantTable[index];
-                            w2 = inverseQuantTable[index+1];
-                            approxOneThird = (w1 * FACTOR) >> shift;
-                            x1 = index << ORDER;
-                            deltaOneThird = (w2 - w1) * (absX - x1);
-                            deltaOneThird >>= (shift + 2);
-                            mult_high = x * (approxOneThird + deltaOneThird);
-                            coef[i] = fxp_mul32_by_16(mult_high, scale) << 1;
-
-                        }
-                    } /* if(x) */
-
-
-                    x    = quantSpec[i-1];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        if (absX < TABLESIZE)
-                        {
-                            mult_high = (x * (inverseQuantTable[absX] >> shift));
-                            coef[i-1] = fxp_mul32_by_16(mult_high, scale) << 1;
-
-                        }
-                        else
-                        {
-                            index = absX >> ORDER;
-                            w1 = inverseQuantTable[index];
-                            w2 = inverseQuantTable[index+1];
-                            approxOneThird = (w1 * FACTOR) >> shift;
-                            x1 = index << ORDER;
-                            deltaOneThird = (w2 - w1) * (absX - x1);
-                            deltaOneThird >>= (shift + 2);
-                            mult_high = x * (approxOneThird + deltaOneThird);
-                            coef[i-1] = fxp_mul32_by_16(mult_high, scale) << 1;
-                        }
-                    } /* if(x) */
-
-                    x    = quantSpec[i-2];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        if (absX < TABLESIZE)
-                        {
-                            mult_high = x * (inverseQuantTable[absX] >> shift);
-                            coef[i-2] = fxp_mul32_by_16(mult_high, scale) << 1;
-                        }
-                        else
-                        {
-                            index = absX >> ORDER;
-                            w1 = inverseQuantTable[index];
-                            w2 = inverseQuantTable[index+1];
-                            approxOneThird = (w1 * FACTOR) >> shift;
-                            x1 = index << ORDER;
-                            deltaOneThird = (w2 - w1) * (absX - x1);
-                            deltaOneThird >>= (shift + 2);
-                            mult_high = x * (approxOneThird + deltaOneThird);
-                            coef[i-2] = fxp_mul32_by_16(mult_high, scale) << 1;
-                        }
-                    } /* if(x) */
-
-                    x    = quantSpec[i-3];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        if (absX < TABLESIZE)
-                        {
-                            mult_high = x * (inverseQuantTable[absX] >> shift);
-                            coef[i-3] = fxp_mul32_by_16(mult_high, scale) << 1;
-
-                        }
-                        else
-                        {
-                            index = absX >> ORDER;
-                            w1 = inverseQuantTable[index];
-                            w2 = inverseQuantTable[index+1];
-                            approxOneThird = (w1 * FACTOR) >> shift;
-                            x1 = index << ORDER;
-                            deltaOneThird = (w2 - w1) * (absX - x1);
-                            deltaOneThird >>= (shift + 2);
-                            mult_high = x * (approxOneThird + deltaOneThird);
-                            coef[i-3] = fxp_mul32_by_16(mult_high, scale) << 1;
-
-                        }
-                    } /* if(x) */
-
-                }  /* end for (i = sfbWidth - 1; i >= 0; i--) */
-            } /* end else for if (maxInput < TABLESIZE)*/
-        }
-        else /* scale == 0 */
-        {
-            if (maxInput < TABLESIZE)
-            {
-                for (i = sfbWidth - 1; i >= 0; i -= 4)
-                {
-                    x = quantSpec[i];
-                    y = quantSpec[i-1];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        mult_high = x * (inverseQuantTable[absX] >> shift);
-                        coef[i] = mult_high >> 1;
-                    }
-
-                    if (y)
-                    {
-                        absX = pv_abs(y);
-                        mult_high = y * (inverseQuantTable[absX] >> shift);
-                        coef[i-1] = mult_high >> 1;
-                    }
-
-                    x = quantSpec[i-2];
-                    y = quantSpec[i-3];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        mult_high = x * (inverseQuantTable[absX] >> shift);
-                        coef[i-2] = mult_high >> 1;
-                    }
-
-                    if (y)
-                    {
-                        absX = pv_abs(y);
-                        mult_high = y * (inverseQuantTable[absX] >> shift);
-                        coef[i-3] = mult_high >> 1;
-                    }
-                }
-
-            } /* end if (maxInput < TABLESIZE)*/
-
-            else /* maxInput >= TABLESIZE) */
-            {
-                for (i = sfbWidth - 1; i >= 0; i -= 4)
-                {
-                    x    = quantSpec[i];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        if (absX < TABLESIZE)
-                        {
-                            mult_high = x * (inverseQuantTable[absX] >> shift);
-                            coef[i] = (mult_high >> 1);
-                        } /* end if (absX < TABLESIZE) */
-                        else
-                        {
-                            index = absX >> ORDER;
-                            w1 = inverseQuantTable[index];
-                            w2 = inverseQuantTable[index+1];
-                            approxOneThird = (w1 * FACTOR) >> shift;
-                            x1 = index << ORDER;
-                            deltaOneThird = (w2 - w1) * (absX - x1);
-                            deltaOneThird >>= (shift + 2);
-                            mult_high = x * (approxOneThird + deltaOneThird);
-                            coef[i] = (mult_high >> 1);
-                        }
-                    } /* if(x) */
-
-                    x    = quantSpec[i-1];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        if (absX < TABLESIZE)
-                        {
-                            mult_high = x * (inverseQuantTable[absX] >> shift);
-                            coef[i-1] = (mult_high >> 1);
-                        } /* end if (absX < TABLESIZE) */
-                        else
-                        {
-                            index = absX >> ORDER;
-                            w1 = inverseQuantTable[index];
-                            w2 = inverseQuantTable[index+1];
-                            approxOneThird = (w1 * FACTOR) >> shift;
-                            x1 = index << ORDER;
-                            deltaOneThird = (w2 - w1) * (absX - x1);
-                            deltaOneThird >>= (shift + 2);
-                            mult_high = x * (approxOneThird + deltaOneThird);
-                            coef[i-1] = (mult_high >> 1);
-                        }
-                    } /* if(x) */
-
-                    x    = quantSpec[i-2];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        if (absX < TABLESIZE)
-                        {
-                            mult_high = x * (inverseQuantTable[absX] >> shift);
-                            coef[i-2] = (mult_high >> 1);
-                        } /* end if (absX < TABLESIZE) */
-                        else
-                        {
-                            index = absX >> ORDER;
-                            w1 = inverseQuantTable[index];
-                            w2 = inverseQuantTable[index+1];
-                            approxOneThird = (w1 * FACTOR) >> shift;
-                            x1 = index << ORDER;
-                            deltaOneThird = (w2 - w1) * (absX - x1);
-                            deltaOneThird >>= (shift + 2);
-                            mult_high = x * (approxOneThird + deltaOneThird);
-                            coef[i-2] = (mult_high >> 1);
-                        }
-                    } /* if(x) */
-
-                    x    = quantSpec[i-3];
-                    if (x)
-                    {
-                        absX = pv_abs(x);
-                        if (absX < TABLESIZE)
-                        {
-                            mult_high = x * (inverseQuantTable[absX] >> shift);
-                            coef[i-3] = (mult_high >> 1);
-                        } /* end if (absX < TABLESIZE) */
-                        else
-                        {
-                            index = absX >> ORDER;
-                            w1 = inverseQuantTable[index];
-                            w2 = inverseQuantTable[index+1];
-                            approxOneThird = (w1 * FACTOR) >> shift;
-                            x1 = index << ORDER;
-                            deltaOneThird = (w2 - w1) * (absX - x1);
-                            deltaOneThird >>= (shift + 2);
-                            mult_high = x * (approxOneThird + deltaOneThird);
-                            coef[i-3] = (mult_high >> 1);
-                        }
-
-                    } /* if(x) */
-
-                }  /* end for (i = sfbWidth - 1; i >= 0; i--) */
-
-            } /* end else for if (maxInput < TABLESIZE)*/
-
-        } /* end else for if(scale!=0) */
-
-    }  /* end else for if(maxInput == 0) */
-
-} /* end esc_iquant_fxp */
-
-
diff --git a/media/libstagefright/codecs/aacdec/esc_iquant_scaling.h b/media/libstagefright/codecs/aacdec/esc_iquant_scaling.h
deleted file mode 100644
index a846b9f..0000000
--- a/media/libstagefright/codecs/aacdec/esc_iquant_scaling.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/esc_iquant_scaling.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for esc_iquant_scaling.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef ESC_IQUANT_SCALING_H
-#define ESC_IQUANT_SCALING_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-    void esc_iquant_scaling(
-        const Int16   quantSpec[],
-        Int32       coef[],
-        const Int   sfbWidth,
-        Int  const pQFormat,
-        UInt16      scale,
-        Int           maxInput);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif /* ESC_IQUANT_SCALING_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/extractframeinfo.cpp b/media/libstagefright/codecs/aacdec/extractframeinfo.cpp
deleted file mode 100644
index 571cc98..0000000
--- a/media/libstagefright/codecs/aacdec/extractframeinfo.cpp
+++ /dev/null
@@ -1,487 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Filename: extractframeInfo.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Arguments:   hBitBuf      - bitbuffer handle
-              v_frame_info - pointer to memorylocation where the frame-info will
-                             be stored.
-
- Return:     none.
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-Extracts a frame_info vector from control data read from the bitstream.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "extractframeinfo.h"
-#include    "buf_getbits.h"
-#include    "aac_mem_funcs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*
- *  (int) ceil (log (bs_num_env + 1) / log (2))
- *  ceil(log([0:5]+1)/log(2))
- */
-
-const Int32 bs_pointer_bits_tbl[MAX_ENVELOPES + 1] = { 0, 1, 2, 2, 3, 3};
-
-/*
- *  (int)((float)numTimeSlots/bs_num_env + 0.5f)
- *  floor(16./[0:5] + 0.5)
- */
-
-const Int32 T_16_ov_bs_num_env_tbl[MAX_ENVELOPES + 1] = { 2147483647, 16, 8,
-        5,  4, 3
-                                                        };
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-SBR_ERROR extractFrameInfo(BIT_BUFFER     * hBitBuf,
-                           SBR_FRAME_DATA * h_frame_data)
-{
-
-    Int32 absBordLead = 0;
-    Int32 nRelLead = 0;
-    Int32 nRelTrail = 0;
-    Int32 bs_num_env = 0;
-    Int32 bs_num_rel = 0;
-    Int32 bs_var_bord = 0;
-    Int32 bs_var_bord_0 = 0;
-    Int32 bs_var_bord_1 = 0;
-    Int32 bs_pointer = 0;
-    Int32 bs_pointer_bits;
-    Int32 frameClass;
-    Int32 temp;
-    Int32 env;
-    Int32 k;
-    Int32 bs_num_rel_0 = 0;
-    Int32 bs_num_rel_1 = 0;
-    Int32 absBordTrail = 0;
-    Int32 middleBorder = 0;
-    Int32 bs_num_noise;
-    Int32 lA = 0;
-
-    Int32 tE[MAX_ENVELOPES + 1];
-    Int32 tQ[2 + 1];
-    Int32 f[MAX_ENVELOPES + 1];
-    Int32 bs_rel_bord[3];
-    Int32 bs_rel_bord_0[3];
-    Int32 bs_rel_bord_1[3];
-    Int32 relBordLead[3];
-    Int32 relBordTrail[3];
-
-
-    Int32 *v_frame_info = h_frame_data->frameInfo;
-
-    SBR_ERROR err =  SBRDEC_OK;
-
-
-    /*
-     * First read from the bitstream.
-     */
-
-    /* Read frame class */
-    h_frame_data->frameClass = frameClass = buf_getbits(hBitBuf, SBR_CLA_BITS);
-
-
-    switch (frameClass)
-    {
-
-        case FIXFIX:
-            temp = buf_getbits(hBitBuf, SBR_ENV_BITS);   /* 2 bits */
-
-            bs_num_env = 1 << temp;
-
-
-            f[0] = buf_getbits(hBitBuf, SBR_RES_BITS);   /* 1 bit */
-
-            for (env = 1; env < bs_num_env; env++)
-            {
-                f[env] = f[0];
-            }
-
-            nRelLead     = bs_num_env - 1;
-            absBordTrail  = 16;
-
-
-            break;
-
-        case FIXVAR:
-            bs_var_bord = buf_getbits(hBitBuf, SBR_ABS_BITS);   /* 2 bits */
-            bs_num_rel  = buf_getbits(hBitBuf, SBR_NUM_BITS);   /* 2 bits */
-            bs_num_env  = bs_num_rel + 1;
-
-            for (k = 0; k < bs_num_env - 1; k++)
-            {
-                bs_rel_bord[k] = (buf_getbits(hBitBuf, SBR_REL_BITS) + 1) << 1;
-            }
-
-            bs_pointer_bits = bs_pointer_bits_tbl[bs_num_env];
-
-            bs_pointer = buf_getbits(hBitBuf, bs_pointer_bits);
-
-            for (env = 0; env < bs_num_env; env++)
-            {                                                    /* 1 bit */
-                f[bs_num_env - 1 - env] = buf_getbits(hBitBuf, SBR_RES_BITS);
-            }
-
-            absBordTrail  = 16 + bs_var_bord;
-            nRelTrail     = bs_num_rel;
-
-            break;
-
-        case VARFIX:
-            bs_var_bord = buf_getbits(hBitBuf, SBR_ABS_BITS);   /* 2 bits */
-            bs_num_rel  = buf_getbits(hBitBuf, SBR_NUM_BITS);   /* 2 bits */
-            bs_num_env  = bs_num_rel + 1;
-
-            for (k = 0; k < bs_num_env - 1; k++)
-            {
-                bs_rel_bord[k] = (buf_getbits(hBitBuf, SBR_REL_BITS) + 1) << 1;
-            }
-
-            bs_pointer_bits = bs_pointer_bits_tbl[bs_num_env];
-
-            bs_pointer = buf_getbits(hBitBuf, bs_pointer_bits);
-
-            for (env = 0; env < bs_num_env; env++)
-            {                                  /* 1 bit */
-                f[env] = buf_getbits(hBitBuf, SBR_RES_BITS);
-            }
-
-            absBordTrail = 16;
-            absBordLead  = bs_var_bord;
-            nRelLead     = bs_num_rel;
-
-            break;
-
-        case VARVAR:
-            bs_var_bord_0 = buf_getbits(hBitBuf, SBR_ABS_BITS);   /* 2 bits */
-            bs_var_bord_1 = buf_getbits(hBitBuf, SBR_ABS_BITS);
-            bs_num_rel_0  = buf_getbits(hBitBuf, SBR_NUM_BITS);   /* 2 bits */
-            bs_num_rel_1  = buf_getbits(hBitBuf, SBR_NUM_BITS);
-
-            bs_num_env = bs_num_rel_0 + bs_num_rel_1 + 1;
-
-            for (k = 0; k < bs_num_rel_0; k++)
-            {                                                 /* 2 bits */
-                bs_rel_bord_0[k] = (buf_getbits(hBitBuf, SBR_REL_BITS) + 1) << 1;
-            }
-
-            for (k = 0; k < bs_num_rel_1; k++)
-            {                                                 /* 2 bits */
-                bs_rel_bord_1[k] = (buf_getbits(hBitBuf, SBR_REL_BITS) + 1) << 1;
-            }
-
-
-            bs_pointer_bits = bs_pointer_bits_tbl[bs_num_env];
-
-            bs_pointer = buf_getbits(hBitBuf, bs_pointer_bits);
-
-            for (env = 0; env < bs_num_env; env++)
-            {                                  /* 1 bit */
-                f[env] = buf_getbits(hBitBuf, SBR_RES_BITS);
-            }
-
-            absBordLead   = bs_var_bord_0;
-            absBordTrail  = 16 + bs_var_bord_1;
-            nRelLead      = bs_num_rel_0;
-            nRelTrail     = bs_num_rel_1;
-
-            break;
-
-    };
-
-
-    /*
-     * Calculate the framing.
-     */
-
-
-    switch (frameClass)
-    {
-        case FIXFIX:
-            for (k = 0; k < nRelLead; k++)
-            {
-                relBordLead[k] = T_16_ov_bs_num_env_tbl[bs_num_env];
-            }
-            break;
-        case VARFIX:
-            for (k = 0; k < nRelLead; k++)
-            {
-                relBordLead[k] = bs_rel_bord[k];
-            }
-            break;
-        case VARVAR:
-            for (k = 0; k < nRelLead; k++)
-            {
-                relBordLead[k] = bs_rel_bord_0[k];
-            }
-            for (k = 0; k < nRelTrail; k++)
-            {
-                relBordTrail[k] = bs_rel_bord_1[k];
-            }
-            break;
-        case FIXVAR:
-            for (k = 0; k < nRelTrail; k++)
-            {
-                relBordTrail[k] = bs_rel_bord[k];
-            }
-            break;
-    }
-
-
-    tE[0]          = absBordLead;
-    tE[bs_num_env] = absBordTrail;
-
-    for (env = 1; env <= nRelLead; env++)
-    {
-        tE[env] = absBordLead;
-        for (k = 0; k <= env - 1; k++)
-        {
-            tE[env] += relBordLead[k];
-        }
-    }
-
-    for (env = nRelLead + 1; env < bs_num_env; env++)
-    {
-        tE[env] = absBordTrail;
-        for (k = 0; k <= bs_num_env - env - 1; k++)
-        {
-            tE[env] -= relBordTrail[k];
-        }
-    }
-
-
-
-    switch (frameClass)
-    {
-        case  FIXFIX:
-            middleBorder = bs_num_env >> 1;
-            break;
-        case VARFIX:
-            switch (bs_pointer)
-            {
-                case 0:
-                    middleBorder = 1;
-                    break;
-                case 1:
-                    middleBorder = bs_num_env - 1;
-                    break;
-                default:
-                    middleBorder = bs_pointer - 1;
-                    break;
-            };
-            break;
-        case FIXVAR:
-        case VARVAR:
-            switch (bs_pointer)
-            {
-                case 0:
-                case 1:
-                    middleBorder = bs_num_env - 1;
-                    break;
-                default:
-                    middleBorder = bs_num_env + 1 - bs_pointer;
-                    break;
-            };
-            break;
-    };
-
-
-    tQ[0] = tE[0];
-    if (bs_num_env > 1)
-    {
-        tQ[1] = tE[middleBorder];
-        tQ[2] = tE[bs_num_env];
-        bs_num_noise = 2;
-    }
-    else
-    {
-        tQ[1] = tE[bs_num_env];
-        bs_num_noise = 1;
-    }
-
-    /*
-     *  Check consistency on freq bands
-     */
-
-    if ((tE[bs_num_env] < tE[0]) || (tE[0] < 0))
-    {
-        err = SBRDEC_INVALID_BITSTREAM;
-    }
-
-
-    switch (frameClass)
-    {
-        case  FIXFIX:
-            lA = -1;
-            break;
-        case VARFIX:
-            switch (bs_pointer)
-            {
-                case 0:
-                case 1:
-                    lA = -1;
-                    break;
-                default:
-                    lA = bs_pointer - 1;
-                    break;
-            };
-            break;
-        case FIXVAR:
-        case VARVAR:
-            switch (bs_pointer)
-            {
-                case 0:
-                    lA = - 1;
-                    break;
-                default:
-                    lA = bs_num_env + 1 - bs_pointer;
-                    break;
-            };
-            break;
-    };
-
-    /*
-     * Build the frameInfo vector...
-     */
-
-    v_frame_info[0] = bs_num_env;   /* Number of envelopes*/
-    pv_memcpy(v_frame_info + 1, tE, (bs_num_env + 1)*sizeof(Int32));    /* time borders*/
-    /* frequency resolution */
-    pv_memcpy(v_frame_info + 1 + bs_num_env + 1, f, bs_num_env*sizeof(Int32));
-
-    temp = (1 + bs_num_env) << 1;
-    v_frame_info[temp] = lA;                     /* transient envelope*/
-    v_frame_info[temp + 1] = bs_num_noise;       /* Number of noise envelopes */
-    /* noise borders */
-    pv_memcpy(v_frame_info + temp + 2, tQ, (bs_num_noise + 1)*sizeof(Int32));
-
-
-    return (err);
-
-}
-
-
-
-
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/extractframeinfo.h b/media/libstagefright/codecs/aacdec/extractframeinfo.h
deleted file mode 100644
index 2fcfe37..0000000
--- a/media/libstagefright/codecs/aacdec/extractframeinfo.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: extractFrameInfo.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef EXTRACTFRAMEINFO_H
-#define EXTRACTFRAMEINFO_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_frame_data.h"
-#include    "e_sbr_error.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef Int32 FRAME_INFO[LENGTH_FRAME_INFO];
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    SBR_ERROR extractFrameInfo(BIT_BUFFER     * hBitBuf,
-    SBR_FRAME_DATA * h_frame_data);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/fft_rx4.h b/media/libstagefright/codecs/aacdec/fft_rx4.h
deleted file mode 100644
index 8e7acb3..0000000
--- a/media/libstagefright/codecs/aacdec/fft_rx4.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/fft_rx4.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-        (1) modified definition of w_64rx4 from Int to Int16
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions fft_rx4()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef FFT_RX4_H
-#define FFT_RX4_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define     FFT_RX4_LONG                256
-#define     ONE_FOURTH_FFT_RX4_LONG     ((FFT_RX4_LONG)>>2)
-#define     FFT_RX4_SHORT               64
-#define     ONE_FOURTH_FFT_RX4_SHORT    ((FFT_RX4_SHORT)>>2)
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-extern const Int16 w_64rx4[];
-extern const Int32 W_64rx4[];
-extern const Int32 W_256rx4[];
-extern const Int32 w_512rx2[];
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void fft_rx4_long(
-        Int32      Data[],
-        Int32      *peak_value);
-
-    Int fft_rx4_short(
-        Int32      Data[],
-        Int32      *peak_value);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* FFT_RX4_H */
diff --git a/media/libstagefright/codecs/aacdec/fft_rx4_long.cpp b/media/libstagefright/codecs/aacdec/fft_rx4_long.cpp
deleted file mode 100644
index c517e7e..0000000
--- a/media/libstagefright/codecs/aacdec/fft_rx4_long.cpp
+++ /dev/null
@@ -1,428 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/fft_rx4_long.c
- Funtions: fft_rx4_long
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
-            (1) Eliminated search for max in the main loop.
-            (2) Reduced precision on w_256rx4 from Q15 to Q10
-
- Description:
-            (1) Created function fft_rx4_long_no_max to overcome LTP problem.
-
- Description:
-            (1) Modified shift so the accumulation growths faster than the
-                downshift, so now the input can be as high as 1.0 and saturation
-                will not occurre. The accumulation times the Q10 format will
-                never exceed 31 bits. This increases precision
-            (2) Eliminated unneeded data moves, used before for max search.
-            (3) Eliminated function fft_rx4_long_no_max.
-
- Description:
-            (1) Added comment to explain max search elimination and
-                Q format during multiplications
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    Data       =  Input complex vector, arranged in the following order:
-                  real, imag, real, imag...
-                  This is a complex vector whose elements (real and Imag) are
-                  Int32.
-                  type Int32 *
-
-    peak_value =  Input,  peak value of the input vector
-                  Output,  peak value of the resulting vector
-                  type Int32 *
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    calculation are done in-place and returned in Data
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Fast Fourier Transform, radix 4 with Decimation in Frequency and block
-    floating point arithmetic.
-    The radix-4 FFT  simply divides the FFT into four smaller FFTs. Each of
-    the smaller FFTs is then further divided into smaller ones and so on.
-    It consists of log 4 N stages and each stage consists of N/4 dragonflies.
-
-    An FFT is nothing but a bundle of multiplications and summations which
-    may overflow during calculations.
-
-
-    This routine uses a scheme to test and scale the result output from
-    each FFT stage in order to fix the accumulation overflow.
-
-    The Input Data should be in Q13 format to get the highest precision.
-    At the end of each dragonfly calculation, a test for possible bit growth
-    is made, if bit growth is possible the Data is scale down back to Q13.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This function should provide a fixed point FFT for an input array
-    of size 256.
-
-------------------------------------------------------------------------------
- REFERENCES
-
-    [1] Advance Digital Signal Processing, J. Proakis, C. Rader, F. Ling,
-        C. Nikias, Macmillan Pub. Co.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-   MODIFY( x[] )
-   RETURN( exponent )
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "fft_rx4.h"
-
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void fft_rx4_long(
-    Int32      Data[],
-    Int32      *peak_value)
-
-{
-    Int     n1;
-    Int     n2;
-    Int     j;
-    Int     k;
-    Int     i;
-
-    Int32   t1;
-    Int32   t2;
-    Int32   r1;
-    Int32   r2;
-    Int32   r3;
-    Int32   r4;
-    Int32   s1;
-    Int32   s2;
-    Int32   s3;
-    Int32   *pData1;
-    Int32   *pData2;
-    Int32   *pData3;
-    Int32   *pData4;
-    Int32   temp1;
-    Int32   temp2;
-    Int32   temp3;
-    Int32   temp4;
-    Int32   max;
-
-    Int32   exp_jw1;
-    Int32   exp_jw2;
-    Int32   exp_jw3;
-
-
-
-    const Int32  *pw = W_256rx4;
-
-    n2 = FFT_RX4_LONG;
-
-    for (k = FFT_RX4_LONG; k > 4; k >>= 2)
-    {
-
-        n1 = n2;
-        n2 >>= 2;
-
-        for (i = 0; i < FFT_RX4_LONG; i += n1)
-        {
-            pData1 = &Data[ i<<1];
-            pData2 = pData1 + n1;
-
-            temp1   = *pData1;
-            temp2   = *pData2;
-
-            r1      = temp1 + temp2;
-            r2      = temp1 - temp2;
-
-            pData3 = pData1 + (n1 >> 1);
-            pData4 = pData3 + n1;
-            temp3   = *pData3++;
-            temp4   = *pData4++;
-
-            t1      = temp3 + temp4;
-
-            *(pData1++) = (r1 + t1);
-            t2      = temp3 - temp4;
-            *(pData2++) = (r1 - t1);
-
-            temp1   = *pData1;
-            temp2   = *pData2;
-
-            s1      = temp1 + temp2;
-            temp3   = *pData3;
-            s2      = temp1 - temp2;
-            temp4   = *pData4;
-            *pData3--  = (s2 - t2);
-            *pData4--  = (s2 + t2);
-
-            t1      = temp3 + temp4;
-
-            *pData1    = (s1 + t1);
-            *pData2    = (s1 - t1);
-
-            r1      = temp3 - temp4;
-
-            *pData4    = (r2 - r1);
-            *pData3    = (r2 + r1);
-
-        }  /* i */
-
-
-
-        for (j = 1; j < n2; j++)
-        {
-
-            exp_jw1 = (*pw++);
-            exp_jw2 = (*pw++);
-            exp_jw3 = (*pw++);
-
-
-            for (i = j; i < FFT_RX4_LONG; i += n1)
-            {
-                pData1 = &Data[ i<<1];
-                pData2 = pData1 + n1;
-
-                temp1   = *pData1;
-                temp2   = *pData2++;
-
-                r1      = temp1 + temp2;
-                r2      = temp1 - temp2;
-
-                pData3 = pData1 + (n1 >> 1);
-                pData4 = pData3 + n1;
-                temp3   = *pData3++;
-                temp4   = *pData4++;
-
-                r3      = temp3 + temp4;
-                r4      = temp3 - temp4;
-
-                *(pData1++) = (r1 + r3);
-                r1          = (r1 - r3) << 1;
-
-                temp2   = *pData2;
-                temp1   = *pData1;
-
-                s1      = temp1 + temp2;
-                s2      = temp1 - temp2;
-                s3      = (s2 + r4) << 1;
-                s2      = (s2 - r4) << 1;
-
-                temp3   = *pData3;
-                temp4   = *pData4;
-
-                t1      = temp3 + temp4;
-                t2      = temp3 - temp4;
-
-                *pData1  = (s1 + t1);
-                s1       = (s1 - t1) << 1;
-
-                *pData2--  = cmplx_mul32_by_16(s1, -r1, exp_jw2);
-                r3      = (r2 - t2) << 1;
-                *pData2    = cmplx_mul32_by_16(r1,  s1, exp_jw2);
-
-                r2      = (r2 + t2) << 1;
-
-                *pData3--  = cmplx_mul32_by_16(s2, -r2, exp_jw1);
-                *pData3    = cmplx_mul32_by_16(r2,  s2, exp_jw1);
-
-                *pData4--  = cmplx_mul32_by_16(s3, -r3, exp_jw3);
-                *pData4    = cmplx_mul32_by_16(r3,  s3, exp_jw3);
-
-            }  /* i */
-
-        }  /*  j */
-
-    } /* k */
-
-
-    max = 0;
-
-    pData1 = Data - 7;
-
-
-    for (i = ONE_FOURTH_FFT_RX4_LONG; i != 0 ; i--)
-    {
-        pData1 += 7;
-        pData2 = pData1 + 4;
-
-
-        temp1   = *pData1;
-        temp2   = *pData2++;
-
-        r1      = temp1 + temp2;
-        r2      = temp1 - temp2;
-
-        pData3 = pData1 + 2;
-        pData4 = pData1 + 6;
-        temp1   = *pData3++;
-        temp2   = *pData4++;
-
-        t1      = temp1 + temp2;
-        t2      = temp1 - temp2;
-
-        temp1       = (r1 + t1);
-        r1          = (r1 - t1);
-        *(pData1++) = temp1;
-        max        |= (temp1 >> 31) ^ temp1;
-
-
-
-        temp2   = *pData2;
-        temp1   = *pData1;
-
-        s1      = temp1 + temp2;
-        s2      = temp1 - temp2;
-
-
-        temp1   = *pData3;
-        temp2   = *pData4;
-
-        s3      = (s2 + t2);
-        s2      = (s2 - t2);
-
-        t1      = temp1 + temp2;
-        t2      = temp1 - temp2;
-
-        temp1      = (s1 + t1);
-        *pData1    = temp1;
-        temp2      = (s1 - t1);
-
-        max       |= (temp1 >> 31) ^ temp1;
-        *pData2--  = temp2;
-        max       |= (temp2 >> 31) ^ temp2;
-
-        *pData2    = r1;
-        max       |= (r1 >> 31) ^ r1;
-        *pData3--  = s2;
-        max       |= (s2 >> 31) ^ s2;
-        *pData4--  = s3;
-        max       |= (s3 >> 31) ^ s3;
-
-        temp1      = (r2 - t2);
-        *pData4    = temp1;
-        temp2      = (r2 + t2);
-        *pData3    = temp2;
-        max       |= (temp1 >> 31) ^ temp1;
-        max       |= (temp2 >> 31) ^ temp2;
-
-    }  /* i */
-
-    *peak_value = max;
-
-    return ;
-
-}
-
diff --git a/media/libstagefright/codecs/aacdec/fft_rx4_short.cpp b/media/libstagefright/codecs/aacdec/fft_rx4_short.cpp
deleted file mode 100644
index 4a8a0d6..0000000
--- a/media/libstagefright/codecs/aacdec/fft_rx4_short.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/fft_rx4_short.c
- Funtions: fft_rx4_short
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
-            (1) Eliminated search for max in the main loop.
-            (2) Simplified the function by eliminating different conditions
-                for exp.
-            (3) Reduced precision on w_64rx4 from Q15 to Q12, so now the
-                input can be as high as 1.0 and saturation will not occurre
-                because the accumulation times the new Q12 format will never
-                exceed 31 bits.
-
- Description:
-            (1) Added comment to explain max search elimination and
-                Q format during multiplications
-            (2) Increased down shift from 1 to 2, to ensure that 32-bit
-                numbers will not overflow when 2 consecutive adds are done
-                This was found during code review.
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    Data       =  Input complex vector, arranged in the following order:
-                  real, imag, real, imag...
-                  This is a complex vector whose elements (real and Imag) are
-                  Int32.
-                  type Int32 *
-
-    peak_value =  Input,  peak value of the input vector
-                  Output,  peak value of the resulting vector
-                  type Int32 *
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    exponent returns a shift to compensate the scaling introduced by
-    overflow protection
-
- Pointers and Buffers Modified:
-    calculation are done in-place and returned in Data
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Fast Fourier Transform, radix 4 with Decimation in Frequency and block
-    floating point arithmetic.
-    The radix-4 FFT  simply divides the FFT into four smaller FFTs. Each of
-    the smaller FFTs is then further divided into smaller ones and so on.
-    It consists of log 4 N stages and each stage consists of N/4 dragonflies.
-
-    An FFT is nothing but a bundle of multiplications and summations which
-    may overflow during calculations.
-
-
-    This routine uses a scheme to test and scale the result output from
-    each FFT stage in order to fix the accumulation overflow.
-
-    The Input Data should be in Q13 format to get the highest precision.
-    At the end of each dragonfly calculation, a test for possible bit growth
-    is made, if bit growth is possible the Data is scale down back to Q13.
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This function should provide a fixed point FFT for an input array
-    of size 64.
-
-------------------------------------------------------------------------------
- REFERENCES
-
-    [1] Advance Digital Signal Processing, J. Proakis, C. Rader, F. Ling,
-        C. Nikias, Macmillan Pub. Co.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-   MODIFY( x[] )
-   RETURN( exponent )
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "fft_rx4.h"
-#include "pv_normalize.h"
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int fft_rx4_short(
-    Int32      Data[],
-    Int32      *peak_value)
-
-{
-    Int     n1;
-    Int     n2;
-    Int     n3;
-    Int     j;
-    Int     k;
-    Int     i;
-    Int32   exp_jw1;
-    Int32   exp_jw2;
-    Int32   exp_jw3;
-
-
-    Int32   t1;
-    Int32   t2;
-    Int32   r1;
-    Int32   r2;
-    Int32   r3;
-    Int32   s1;
-    Int32   s2;
-    Int32   s3;
-
-    Int32   *pData1;
-    Int32   *pData2;
-    Int32   *pData3;
-    Int32   *pData4;
-    const Int32  *pw;
-    Int32   temp1;
-    Int32   temp2;
-    Int32   temp3;
-    Int32   temp4;
-    Int32   max;
-    Int     exp;
-    Int     exponent = 0;
-    Int     shift;
-
-
-    max = *peak_value;
-    exp = 0;
-
-    if (max > 0x008000)
-    {
-        exp = 8 - pv_normalize(max);   /* use 24 bits  */
-
-        exponent = exp;        /* keeps track of # of shifts */
-
-    }
-
-    n2 = FFT_RX4_SHORT;
-
-    pw = W_64rx4;
-
-
-    /* shift down to avoid possible overflow in first pass of the loop */
-    shift = 2;
-
-    for (k = FFT_RX4_SHORT; k > 4; k >>= 2)
-    {
-
-        n1 = n2;
-        n2 >>= 2;
-        n3 = n1 >> 1;
-
-        exp -= 2;
-
-        for (i = 0; i < FFT_RX4_SHORT; i += n1)
-        {
-            pData1 = &Data[ i<<1];
-            pData3 = pData1 + n3;
-            pData2 = pData1 + n1;
-            pData4 = pData3 + n1;
-
-            temp1   = *(pData1);
-            temp2   = *(pData2);
-            temp1   >>= shift;
-            temp2   >>= shift;
-
-            r1      = temp1 + temp2;
-            r2      = temp1 - temp2;
-
-            temp3   = *(pData3++);
-            temp4   = *(pData4++);
-            temp3   >>= shift;
-            temp4   >>= shift;
-
-            t1      = temp3 + temp4;
-            t2      = temp3 - temp4;
-
-            *(pData1++) = (r1 + t1) >> exp;
-            *(pData2++) = (r1 - t1) >> exp;
-
-            temp1   = *pData1;
-            temp2   = *pData2;
-            temp1   >>= shift;
-            temp2   >>= shift;
-
-            s1      = temp1 + temp2;
-            s2      = temp1 - temp2;
-
-            temp3   = *pData3;
-            temp4   = *pData4;
-            temp3   >>= shift;
-            temp4   >>= shift;
-
-            t1      = temp3 + temp4;
-            r1      = temp3 - temp4;
-
-            *pData1   = (s1 + t1) >> exp;
-            *pData2   = (s1 - t1) >> exp;
-
-            *pData4--    = (s2 + t2) >> exp;
-            *pData4      = (r2 - r1) >> exp;
-
-            *pData3--    = (s2 - t2) >> exp;
-            *pData3      = (r2 + r1) >> exp;
-
-
-        }  /* i */
-
-        for (j = 1; j < n2; j++)
-        {
-            exp_jw1 = *pw++;
-            exp_jw2 = *pw++;
-            exp_jw3 = *pw++;
-
-
-            for (i = j; i < FFT_RX4_SHORT; i += n1)
-            {
-                pData1 = &Data[ i<<1];
-                pData3 = pData1 + n3;
-                pData2 = pData1 + n1;
-                pData4 = pData3 + n1;
-
-                temp1   = *(pData1);
-                temp2   = *(pData2++);
-                temp1   >>= shift;
-                temp2   >>= shift;
-
-                r1      = temp1 + temp2;
-                r2      = temp1 - temp2;
-                temp3   = *(pData3++);
-                temp4   = *(pData4++);
-                temp3   >>= shift;
-                temp4   >>= shift;
-
-                t1      = temp3 + temp4;
-                t2      = temp3 - temp4;
-
-                *(pData1++) = (r1 + t1) >> exp;
-                r1          = (r1 - t1) >> exp;
-
-                temp1   = *pData1;
-                temp2   = *pData2;
-                temp1   >>= shift;
-                temp2   >>= shift;
-
-                s1      = temp1 + temp2;
-                s2      = temp1 - temp2;
-
-                s3      = (s2 + t2) >> exp;
-                s2      = (s2 - t2) >> exp;
-
-                temp3   = *pData3;
-                temp4   = *pData4 ;
-                temp3   >>= shift;
-                temp4   >>= shift;
-
-                t1      = temp3 + temp4;
-                t2      = temp3 - temp4;
-
-                *pData1  = (s1 + t1) >> exp;
-                s1       = (s1 - t1) >> exp;
-
-
-                *pData2--  = cmplx_mul32_by_16(s1, -r1, exp_jw2) << 1;
-                *pData2    = cmplx_mul32_by_16(r1,  s1, exp_jw2) << 1;
-
-                r3       = ((r2 - t2) >> exp);
-                r2       = ((r2 + t2) >> exp);
-
-                *pData3--  = cmplx_mul32_by_16(s2, -r2, exp_jw1) << 1;
-                *pData3    = cmplx_mul32_by_16(r2,  s2, exp_jw1) << 1;
-
-                *pData4--  = cmplx_mul32_by_16(s3, -r3, exp_jw3) << 1;
-                *pData4    = cmplx_mul32_by_16(r3,  s3, exp_jw3) << 1;
-
-            }  /* i */
-
-        }  /*  j */
-
-        /*
-         *  this will reset exp and shift to zero for the second pass of the
-         *  loop
-         */
-        exp   = 2;
-        shift = 0;
-
-    } /* k */
-
-
-    max = 0;
-
-    pData1 = Data - 7;
-
-    for (i = ONE_FOURTH_FFT_RX4_SHORT; i != 0 ; i--)
-    {
-        pData1 += 7;
-
-        pData3 = pData1 + 2;
-        pData2 = pData1 + 4;
-        pData4 = pData1 + 6;
-
-        temp1   = *pData1;
-        temp2   = *pData2++;
-
-        r1      = temp1 + temp2;
-        r2      = temp1 - temp2;
-
-        temp1   = *pData3++;
-        temp2   = *pData4++;
-
-        t1      = temp1 + temp2;
-        t2      = temp1 - temp2;
-
-        temp1       = (r1 + t1);
-        r1          = (r1 - t1);
-        *(pData1++) = temp1;
-        max        |= (temp1 >> 31) ^ temp1;
-
-
-
-        temp1   = *pData1;
-        temp2   = *pData2;
-
-        s1      = temp1 + temp2;
-        s2      = temp1 - temp2;
-
-        s3      = (s2 + t2);
-        s2      = (s2 - t2);
-
-        temp1   = *pData3;
-        temp2   = *pData4;
-
-        t1      = temp1 + temp2;
-        t2      = temp1 - temp2;
-
-        temp1      = (s1 + t1);
-        temp2      = (s1 - t1);
-        *pData1    = temp1;
-        *pData2--  = temp2;
-        max       |= (temp1 >> 31) ^ temp1;
-        max       |= (temp2 >> 31) ^ temp2;
-
-        *pData2    = r1;
-        *pData3--  = s2;
-        *pData4--  = s3;
-        max       |= (r1 >> 31) ^ r1;
-        max       |= (s2 >> 31) ^ s2;
-        max       |= (s3 >> 31) ^ s3;
-
-        temp1      = (r2 - t2);
-        temp2      = (r2 + t2);
-        *pData4    = temp1;
-        *pData3    = temp2;
-        max       |= (temp1 >> 31) ^ temp1;
-        max       |= (temp2 >> 31) ^ temp2;
-
-    }  /* i */
-
-    *peak_value = max;
-
-
-    return (exponent);
-
-}
diff --git a/media/libstagefright/codecs/aacdec/fft_rx4_tables_fxp.cpp b/media/libstagefright/codecs/aacdec/fft_rx4_tables_fxp.cpp
deleted file mode 100644
index 2476b87..0000000
--- a/media/libstagefright/codecs/aacdec/fft_rx4_tables_fxp.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/fft_rx4_tables_fxp.c
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Reduce the accuracy of w_256rx4 and w_512rx2 to Q10 format.
-            Try to to pack sin and cos into one 32-bit number to reduce the
-            memory access, but doesn't help in speed, so commented out for now.
-
- Description:
-        (1) Reduced precision of w_64rx4 from Q15 to Q12.
-        (2) Increased precision of w_512rx2 from Q10 to Q13, Both changes
-            increase overall decoder precision
-
- Description:
-        (1) per code review comment, added description for table generation
-        (2) modified definition of w_64rx4 from Int to Int16
-
-
- Who:                           Date:
- Description:
-
-  ----------------------------------------------------------------------------
- MODULE DESCRIPTION
-
-  Table generation
-
- n = 256  or  64;
- M = precision; 2^10, 2^12, 2^13
-
- for j=1; j<log4(n); j *= 4
-
-    for i=0; i<n/4; i +=j
-
-        phi_1 = 2*pi*i/n;
-        phi_2 = 4*pi*i/n;
-        phi_3 = 6*pi*i/n;
-        M*[cos(phi_1) sin(phi_1) cos(phi_2) sin(phi_2) cos(phi_3) sin(phi_4)];
-
-    end
-
- end
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "fft_rx4.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*
-------------------------------------------------------------------------------
- Forward FFT radix-4 tables
-------------------------------------------------------------------------------
-*/
-
-
-const Int32 W_64rx4[60] =            /* 2 Q15  */
-{
-
-    0x7F610C8C,  0x7D8918F9,  0x7A7C2528,
-    0x7D8918F9,  0x764130FB,  0x6A6D471C,
-    0x7A7C2528,  0x6A6D471C,  0x513362F1,
-    0x764130FB,  0x5A825A82,  0x30FB7641,
-    0x70E23C56,  0x471C6A6D,  0x0C8C7F61,
-    0x6A6D471C,  0x30FB7641,  0xE7057D89,
-    0x62F15133,  0x18F97D89,  0xC3A870E2,
-    0x5A825A82,  0x00007FFF,  0xA57C5A82,
-    0x513362F1,  0xE7057D89,  0x8F1C3C56,
-    0x471C6A6D,  0xCF037641,  0x827518F9,
-    0x3C5670E2,  0xB8E26A6D,  0x809DF372,
-    0x30FB7641,  0xA57C5A82,  0x89BDCF03,
-    0x25287A7C,  0x9591471C,  0x9D0DAECB,
-    0x18F97D89,  0x89BD30FB,  0xB8E29591,
-    0x0C8C7F61,  0x827518F9,  0xDAD68582,
-    0x764130FB,  0x5A825A82,  0x30FB7641,
-    0x5A825A82,  0x00007FFF,  0xA57C5A82,
-    0x30FB7641,  0xA57C5A82,  0x89BDCF03,
-};
-
-
-
-const Int32 W_256rx4[495] =            /* 2 Q15  */
-{
-
-    0x7FF50324,  0x7FD80648,  0x7FA6096A,
-    0x7FD80648,  0x7F610C8C,  0x7E9C12C8,
-    0x7FA6096A,  0x7E9C12C8,  0x7CE31C0B,
-    0x7F610C8C,  0x7D8918F9,  0x7A7C2528,
-    0x7F090FAB,  0x7C291F1A,  0x776B2E11,
-    0x7E9C12C8,  0x7A7C2528,  0x73B536BA,
-    0x7E1D15E2,  0x78842B1F,  0x6F5E3F17,
-    0x7D8918F9,  0x764130FB,  0x6A6D471C,
-    0x7CE31C0B,  0x73B536BA,  0x64E84EBF,
-    0x7C291F1A,  0x70E23C56,  0x5ED755F5,
-    0x7B5C2223,  0x6DC941CE,  0x58425CB3,
-    0x7A7C2528,  0x6A6D471C,  0x513362F1,
-    0x79892826,  0x66CF4C3F,  0x49B468A6,
-    0x78842B1F,  0x62F15133,  0x41CE6DC9,
-    0x776B2E11,  0x5ED755F5,  0x398C7254,
-    0x764130FB,  0x5A825A82,  0x30FB7641,
-    0x750433DF,  0x55F55ED7,  0x28267989,
-    0x73B536BA,  0x513362F1,  0x1F1A7C29,
-    0x7254398C,  0x4C3F66CF,  0x15E27E1D,
-    0x70E23C56,  0x471C6A6D,  0x0C8C7F61,
-    0x6F5E3F17,  0x41CE6DC9,  0x03247FF5,
-    0x6DC941CE,  0x3C5670E2,  0xF9B67FD8,
-    0x6C23447A,  0x36BA73B5,  0xF0537F09,
-    0x6A6D471C,  0x30FB7641,  0xE7057D89,
-    0x68A649B4,  0x2B1F7884,  0xDDDB7B5C,
-    0x66CF4C3F,  0x25287A7C,  0xD4DF7884,
-    0x64E84EBF,  0x1F1A7C29,  0xCC1F7504,
-    0x62F15133,  0x18F97D89,  0xC3A870E2,
-    0x60EB539B,  0x12C87E9C,  0xBB846C23,
-    0x5ED755F5,  0x0C8C7F61,  0xB3BF66CF,
-    0x5CB35842,  0x06487FD8,  0xAC6360EB,
-    0x5A825A82,  0x00007FFF,  0xA57C5A82,
-    0x58425CB3,  0xF9B67FD8,  0x9F13539B,
-    0x55F55ED7,  0xF3727F61,  0x992F4C3F,
-    0x539B60EB,  0xED367E9C,  0x93DB447A,
-    0x513362F1,  0xE7057D89,  0x8F1C3C56,
-    0x4EBF64E8,  0xE0E47C29,  0x8AFA33DF,
-    0x4C3F66CF,  0xDAD67A7C,  0x877A2B1F,
-    0x49B468A6,  0xD4DF7884,  0x84A22223,
-    0x471C6A6D,  0xCF037641,  0x827518F9,
-    0x447A6C23,  0xC94473B5,  0x80F50FAB,
-    0x41CE6DC9,  0xC3A870E2,  0x80260648,
-    0x3F176F5E,  0xBE306DC9,  0x8009FCDA,
-    0x3C5670E2,  0xB8E26A6D,  0x809DF372,
-    0x398C7254,  0xB3BF66CF,  0x81E1EA1C,
-    0x36BA73B5,  0xAECB62F1,  0x83D5E0E4,
-    0x33DF7504,  0xAA095ED7,  0x8675D7D8,
-    0x30FB7641,  0xA57C5A82,  0x89BDCF03,
-    0x2E11776B,  0xA12755F5,  0x8DAAC672,
-    0x2B1F7884,  0x9D0D5133,  0x9235BE30,
-    0x28267989,  0x992F4C3F,  0x9758B64A,
-    0x25287A7C,  0x9591471C,  0x9D0DAECB,
-    0x22237B5C,  0x923541CE,  0xA34BA7BC,
-    0x1F1A7C29,  0x8F1C3C56,  0xAA09A127,
-    0x1C0B7CE3,  0x8C4936BA,  0xB13F9B16,
-    0x18F97D89,  0x89BD30FB,  0xB8E29591,
-    0x15E27E1D,  0x877A2B1F,  0xC0E790A0,
-    0x12C87E9C,  0x85822528,  0xC9448C49,
-    0x0FAB7F09,  0x83D51F1A,  0xD1ED8893,
-    0x0C8C7F61,  0x827518F9,  0xDAD68582,
-    0x096A7FA6,  0x816212C8,  0xE3F3831B,
-    0x06487FD8,  0x809D0C8C,  0xED368162,
-    0x03247FF5,  0x80260648,  0xF6948058,
-    0x7F610C8C,  0x7D8918F9,  0x7A7C2528,
-    0x7D8918F9,  0x764130FB,  0x6A6D471C,
-    0x7A7C2528,  0x6A6D471C,  0x513362F1,
-    0x764130FB,  0x5A825A82,  0x30FB7641,
-    0x70E23C56,  0x471C6A6D,  0x0C8C7F61,
-    0x6A6D471C,  0x30FB7641,  0xE7057D89,
-    0x62F15133,  0x18F97D89,  0xC3A870E2,
-    0x5A825A82,  0x00007FFF,  0xA57C5A82,
-    0x513362F1,  0xE7057D89,  0x8F1C3C56,
-    0x471C6A6D,  0xCF037641,  0x827518F9,
-    0x3C5670E2,  0xB8E26A6D,  0x809DF372,
-    0x30FB7641,  0xA57C5A82,  0x89BDCF03,
-    0x25287A7C,  0x9591471C,  0x9D0DAECB,
-    0x18F97D89,  0x89BD30FB,  0xB8E29591,
-    0x0C8C7F61,  0x827518F9,  0xDAD68582,
-    0x764130FB,  0x5A825A82,  0x30FB7641,
-    0x5A825A82,  0x00007FFF,  0xA57C5A82,
-    0x30FB7641,  0xA57C5A82,  0x89BDCF03
-};
-
-
-
-/*
-------------------------------------------------------------------------------
- Forward FFT radix-2 table
-------------------------------------------------------------------------------
-*/
-
-
-const Int32 w_512rx2[127] =
-{
-    /* Q15  */
-    0x7FFE0192, 0x7FF60324, 0x7FEA04B6,
-    0x7FD90648,  0x7FC207D9, 0x7FA7096B, 0x7F870AFB,
-    0x7F620C8C,  0x7F380E1C, 0x7F0A0FAB, 0x7ED6113A,
-    0x7E9D12C8,  0x7E601455, 0x7E1E15E2, 0x7DD6176E,
-    0x7D8A18F9,  0x7D3A1A83, 0x7CE41C0C, 0x7C891D93,
-    0x7C2A1F1A,  0x7BC6209F, 0x7B5D2224, 0x7AEF23A7,
-    0x7A7D2528,  0x7A0626A8, 0x798A2827, 0x790A29A4,
-    0x78852B1F,  0x77FB2C99, 0x776C2E11, 0x76D92F87,
-    0x764230FC,  0x75A6326E, 0x750533DF, 0x7460354E,
-    0x73B636BA,  0x73083825, 0x7255398D, 0x719E3AF3,
-    0x70E33C57,  0x70233DB8, 0x6F5F3F17, 0x6E974074,
-    0x6DCA41CE,  0x6CF94326, 0x6C24447B, 0x6B4B45CD,
-    0x6A6E471D,  0x698C486A, 0x68A749B4, 0x67BD4AFB,
-    0x66D04C40,  0x65DE4D81, 0x64E94EC0, 0x63EF4FFB,
-    0x62F25134,  0x61F15269, 0x60EC539B, 0x5FE454CA,
-    0x5ED755F6,  0x5DC8571E, 0x5CB45843, 0x5B9D5964,
-    0x5A825A82,  0x59645B9D, 0x58435CB4, 0x571E5DC8,
-    0x55F65ED7,  0x54CA5FE4, 0x539B60EC, 0x526961F1,
-    0x513462F2,  0x4FFB63EF, 0x4EC064E9, 0x4D8165DE,
-    0x4C4066D0,  0x4AFB67BD, 0x49B468A7, 0x486A698C,
-    0x471D6A6E,  0x45CD6B4B, 0x447B6C24, 0x43266CF9,
-    0x41CE6DCA,  0x40746E97, 0x3F176F5F, 0x3DB87023,
-    0x3C5770E3,  0x3AF3719E, 0x398D7255, 0x38257308,
-    0x36BA73B6,  0x354E7460, 0x33DF7505, 0x326E75A6,
-    0x30FC7642,  0x2F8776D9, 0x2E11776C, 0x2C9977FB,
-    0x2B1F7885,  0x29A4790A, 0x2827798A, 0x26A87A06,
-    0x25287A7D,  0x23A77AEF, 0x22247B5D, 0x209F7BC6,
-    0x1F1A7C2A,  0x1D937C89, 0x1C0C7CE4, 0x1A837D3A,
-    0x18F97D8A,  0x176E7DD6, 0x15E27E1E, 0x14557E60,
-    0x12C87E9D,  0x113A7ED6, 0x0FAB7F0A, 0x0E1C7F38,
-    0x0C8C7F62,  0x0AFB7F87, 0x096B7FA7, 0x07D97FC2,
-    0x06487FD9,  0x04B67FEA, 0x03247FF6, 0x01927FFE
-};
-
diff --git a/media/libstagefright/codecs/aacdec/find_adts_syncword.cpp b/media/libstagefright/codecs/aacdec/find_adts_syncword.cpp
deleted file mode 100644
index 535f177..0000000
--- a/media/libstagefright/codecs/aacdec/find_adts_syncword.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/find_adts_syncword.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Fixed error in logic that determines whether there are enough
- bits available to conduct a search for the syncword.  The plus sign in
- the following condition should be a minus.
-
-    if (pInputStream->usedBits <
-            (pInputStream->availableBits + syncword_length)
-
- The length of the syncword should subtract from the number of available
- bits, not add.
-
- Description:  Fixed condition when the end of file was found, unsigned
-   comparison produced a undesired search. Fixed by casting comparison
-     if ((Int)pInputStream->usedBits <
-            ((Int)pInputStream->availableBits - syncword_length) )
-
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pSyncword     = Pointer to variable containing the syncword that the
-                    function should be scanning for in the buffer. [ UInt32 * ]
-
-    pInputStream  = Pointer to a BITS structure, used by the function getbits
-                    to retrieve data from the bitstream.  [ BITS * ]
-
-    syncword_length = The length of the syncword. [ Int ]
-
-    syncword_mask   = A mask to be applied to the bitstream before comparison
-                      with the value pointed to by pSyncword. [ UInt32 ]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    None
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This module scans the bitstream for a syncword of any length between 1 and 32.
- If certain bits in the syncword are to be ignored, that bit position should
- be set to 0 in both parameters *(pSyncword) and syncword_mask.  This allows
- for a syncword to be constructed out of non-contiguous bits.
-
- Upon finding the syncword's position in the bitstream, a value denoting the
- syncword's degree of deviance from being byte-aligned (byte_align_offset)
- is set in the structure pointed to by pInputStream.
- This is a value between 0 and 7.
-
- If no syncword is found, the function returns status == ERROR.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- "Don't care" bits must be set to '0' in both *(pSyncword) and syncword_mask.
-
- This function should not be called if there are less than
- (8 + syncword_length) bits in the buffer.
-
-------------------------------------------------------------------------------
- REFERENCES
- (1) ISO/IEC 13818-7:1997(E)
-     Part 7
-        Subpart 6.2 (Audio_Data_Transport_Stream frame, ADTS)
-
- (2) ISO/IEC 11172-3:1993(E)
-     Part 3
-        Subpart 2.4.3 The audio decoding process
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    IF (pInputStream->usedBits <
-            (pInputStream->availableBits + syncword_length) )
-
-        max_search_length = (pInputStream->availableBits - pInputStream->usedBits);
-
-        max_search_length = max_search_length - syncword_length;
-
-        search_length = 0;
-
-        adts_header =
-        CALL getbits(syncword_length, pInputStream);
-            MODIFYING pInputStream->usedBits
-            RETURNING bits from bitstream of length (syncword_length)
-
-        test_for_syncword = adts_header AND syncword_mask;
-        test_for_syncword = test_for_syncword XOR syncword;
-
-        WHILE ( (test_for_syncword != 0) && (search_length > 0) )
-
-            search_length = search_length - 1;
-
-            adts_header = adts_header << 1;
-            adts_header = adts_header OR ...
-
-            CALL getbits(syncword_length, pInputStream);
-                MODIFYING pInputStream->usedBits
-                RETURNING 1 bit from the bitstream
-
-            test_for_syncword = adts_header AND syncword_mask;
-            test_for_syncword = test_for_syncword XOR syncword;
-
-        ENDWHILE
-
-        IF (search_length == 0)
-            status = ERROR;
-        ENDIF
-
-        *(pSyncword) = adts_header;
-
-         pInputStream->byteAlignOffset =
-             (pInputStream->usedBits - syncwordlength) AND 0x7;
-
-    ELSE
-        status = ERROR;
-    ENDIF
-
-    return (status);
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_bits.h"
-#include "ibstream.h"
-#include "find_adts_syncword.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define FIND_ADTS_ERROR -1
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int find_adts_syncword(
-    UInt32 *pSyncword,
-    BITS   *pInputStream,
-    Int     syncword_length,
-    UInt32  syncword_mask)
-{
-
-    Int    status = SUCCESS;
-    UInt   search_length;
-    UInt32 adts_header = 0;
-    UInt32 test_for_syncword;
-    UInt32 syncword = *(pSyncword);
-
-    /*
-     * Determine the maximum number of bits available to this function for
-     * the syncword search.
-     */
-    if ((Int)pInputStream->usedBits <
-            ((Int)pInputStream->availableBits - syncword_length))
-    {
-        search_length = (pInputStream->availableBits - pInputStream->usedBits);
-
-        search_length -= syncword_length;
-
-        adts_header  = getbits(syncword_length, pInputStream);
-
-        /*
-         * Mask the result in adts_header with the syncword_mask, so only the
-         * bits relevant to syncword detection are compared to *(pSyncword).
-         */
-        test_for_syncword  = adts_header & syncword_mask;
-        test_for_syncword ^= syncword;
-
-        /*
-         * Scan bit-by-bit through the bitstream, until the function either
-         * runs out of bits, or finds the syncword.
-         */
-
-        while ((test_for_syncword != 0) && (search_length > 0))
-        {
-            search_length--;
-
-            adts_header <<= 1;
-            adts_header |= getbits(1, pInputStream);
-
-            test_for_syncword  = adts_header & syncword_mask;
-            test_for_syncword ^= syncword;
-        }
-
-        if (search_length == 0)
-        {
-            status = FIND_ADTS_ERROR;
-        }
-
-        /*
-         * Return the syncword's position in the bitstream.  Correct placement
-         * of the syncword will result in byte_align_offset == 0.
-         * If the syncword is found not to be byte-aligned, then return
-         * the degree of disalignment, so further decoding can
-         * be shifted as necessary.
-         *
-         */
-        pInputStream->byteAlignOffset =
-            (pInputStream->usedBits - syncword_length) & 0x7;
-
-    } /* END if (pInputStream->usedBits < ...) */
-
-    else
-    {
-        status = FIND_ADTS_ERROR;
-    }
-
-    *(pSyncword) = adts_header;
-
-    return (status);
-
-} /* find_adts_syncword() */
diff --git a/media/libstagefright/codecs/aacdec/find_adts_syncword.h b/media/libstagefright/codecs/aacdec/find_adts_syncword.h
deleted file mode 100644
index d147bc5..0000000
--- a/media/libstagefright/codecs/aacdec/find_adts_syncword.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/find_adts_syncword.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This function includes the function declaration for find_adts_syncword()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef FIND_ADTS_SYNCWORD_H
-#define FIND_ADTS_SYNCWORD_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "s_bits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-Int find_adts_syncword(
-    UInt32 *pSyncword,
-    BITS   *pInputStream,
-    Int     syncword_length,
-    UInt32  syncword_mask);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/fwd_long_complex_rot.cpp b/media/libstagefright/codecs/aacdec/fwd_long_complex_rot.cpp
deleted file mode 100644
index b85c7df..0000000
--- a/media/libstagefright/codecs/aacdec/fwd_long_complex_rot.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/fwd_long_complex_rot.c
- Funtions: fwd_long_complex_rot
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Date: 10/18/2002
- Description:
-            (1) Change the input arguments, no shifts information from
-                long_fft_rx4 is passed, only a single max is passed.
-            (2) Eliminate search for max, a fixed shift has replaced the
-                search for max with minimal loss of precision.
-            (3) Eliminated unused variables
-
- Date: 10/28/2002
- Description:
-            (1) Added comments per code review
-            (2) Eliminated hardly used condition on if-else (exp==0)
-
- Description:
-
- ------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    Data_in   = Input vector (sized for long windows
-                TWICE_FWD_LONG_CX_ROT_LENGTH), with time domain samples
-                type Int32 *
-
-    Data_out  = Output vector with a post-rotation by exp(-j(2pi/N)(k+1/8)),
-                (sized for long windows TWICE_FWD_LONG_CX_ROT_LENGTH)
-                type Int32 *
-
-    max       = Input, carries the maximum value of the input vector
-                "Data_in"
-                type Int32
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    exp = shift factor to reflect signal scaling
-
- Pointers and Buffers Modified:
-    Results are return in "Data_out"
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    fwd_long_complex_rot() performs the pre complex rotation for the MDCT
-    for the case of long windows. It also performs digit reverse ordering of
-    the first and second halves of the input vector "Data_in", as well as
-    reordering of the two half vectors (following radix-2 decomposition)
-    Word normalization is also done to ensure 16 by 16 bit multiplications.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    fwd_long_complex_rot() should execute a pre-rotation by
-    exp(-j(2pi/N)(k+1/8)), digit reverse ordering and normalization
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "fwd_long_complex_rot.h"
-#include "digit_reversal_tables.h"
-#include "imdct_fxp.h"
-#include "pv_normalize.h"
-
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-Int fwd_long_complex_rot(
-    Int32 *Data_in,
-    Int32 *Data_out,
-    Int32  max)
-{
-    Int     i;
-    const   Int32 *p_rotate;
-    Int32   temp_re;
-    Int32   temp_im;
-    Int32   *pData_in_ref1;
-    Int32   *pData_in_ref2;
-    Int32   exp_jw;
-    Int32   temp_re_32;
-    Int32   temp_im_32;
-
-    Int32   *pData_out_1;
-    Int32   *pData_out_2;
-    Int32   *pData_out_3;
-    Int32   *pData_out_4;
-
-    Int32 *pData_in_1;
-    Int32 *pData_in_2;
-
-    Int     exp;
-
-    p_rotate       =  exp_rotation_N_2048;
-
-    pData_in_ref1  =  Data_in;
-    pData_in_ref2  = &Data_in[TWICE_FWD_LONG_CX_ROT_LENGTH];
-
-    pData_out_1 = Data_out;
-    pData_out_2 = &Data_out[LONG_WINDOW_LENGTH_m_1];
-    pData_out_3 = &Data_out[LONG_WINDOW_LENGTH];
-    pData_out_4 = &Data_out[TWICE_LONG_WINDOW_LENGTH_m_1];
-
-    /*
-     *  Data_out
-     *                                   >>>>                   <<<<
-     *                                pData_out_3             pData_out_4
-     *      |             |             |             |             |
-     * pData_out_1               pData_out_2
-     *      >>>>                     <<<<
-     */
-
-
-    exp = 16 - pv_normalize(max);
-
-    if (exp < 0)
-    {
-        exp = 0;
-    }
-
-    /*
-     *  Apply  A/2^(diff) + B
-     */
-
-
-    pData_in_1 = pData_in_ref1;
-    pData_in_2 = pData_in_ref2;
-
-    for (i = FWD_LONG_CX_ROT_LENGTH; i != 0; i--)
-    {
-
-        /*
-         * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-         */
-
-        exp_jw = *p_rotate++;
-
-        /*
-         *  Use auxiliary variables to avoid double accesses to memory.
-         *  Data in is scaled to use only lower 16 bits.
-         */
-
-        temp_re =  *(pData_in_1++) >> exp;
-        temp_im =  *(pData_in_1++) >> exp;
-
-        /*
-         *   Pre-rotation
-         */
-
-        temp_re_32  = (cmplx_mul32_by_16(temp_re,   temp_im,  exp_jw));
-        temp_im_32  = (cmplx_mul32_by_16(temp_im,  -temp_re,  exp_jw));
-
-        *(pData_out_1++) = - temp_re_32;
-        *(pData_out_2--) =   temp_im_32;
-        *(pData_out_3++) = - temp_im_32;
-        *(pData_out_4--) =   temp_re_32;
-
-        /*
-         *   Pointer increment to jump over imag (1 & 4) or real parts
-         *   (2 & 3)
-         */
-        pData_out_1++;
-        pData_out_2--;
-        pData_out_3++;
-        pData_out_4--;
-
-        /*
-         *   Repeat procedure for odd index at the output
-         */
-
-        exp_jw = *p_rotate++;
-
-        temp_re =  *(pData_in_2++) >> exp;
-        temp_im =  *(pData_in_2++) >> exp;
-
-        temp_re_32  = (cmplx_mul32_by_16(temp_re,   temp_im,  exp_jw));
-        temp_im_32  = (cmplx_mul32_by_16(temp_im,  -temp_re,  exp_jw));
-
-        *(pData_out_1++) = - temp_re_32;
-        *(pData_out_2--) =   temp_im_32;
-        *(pData_out_3++) = - temp_im_32;
-        *(pData_out_4--) =   temp_re_32;
-
-        pData_out_1++;
-        pData_out_2--;
-        pData_out_3++;
-        pData_out_4--;
-
-    }
-
-    return (exp + 1);
-}
diff --git a/media/libstagefright/codecs/aacdec/fwd_long_complex_rot.h b/media/libstagefright/codecs/aacdec/fwd_long_complex_rot.h
deleted file mode 100644
index 5978906..0000000
--- a/media/libstagefright/codecs/aacdec/fwd_long_complex_rot.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/fwd_long_complex_rot.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions fwd_long_complex_rot
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef FWD_LONG_COMPLEX_ROT_H
-#define FWD_LONG_COMPLEX_ROT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define FWD_LONG_CX_ROT_LENGTH              256
-#define TWICE_FWD_LONG_CX_ROT_LENGTH        (FWD_LONG_CX_ROT_LENGTH<<1)
-#define LONG_WINDOW_LENGTH                  1024
-#define LONG_WINDOW_LENGTH_m_1              (LONG_WINDOW_LENGTH - 1)
-#define TWICE_LONG_WINDOW_LENGTH_m_1        ((LONG_WINDOW_LENGTH<<1) - 1)
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-
-Int fwd_long_complex_rot(
-    Int32 *Data_in,
-    Int32 *Data_out,
-    Int32  max);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* FWD_LONG_COMPLEX_ROT_H */
diff --git a/media/libstagefright/codecs/aacdec/fwd_short_complex_rot.cpp b/media/libstagefright/codecs/aacdec/fwd_short_complex_rot.cpp
deleted file mode 100644
index 964f766..0000000
--- a/media/libstagefright/codecs/aacdec/fwd_short_complex_rot.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Pathname: ./src/fwd_short_complex_rot.c
- Funtions:  fwd_short_complex_rot
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Date: 10/18/2002
- Description:
-            (1) Change the input argument, only a single max is passed.
-            (2) Eliminate search for max, a fixed shift has replaced the
-                search for max with minimal loss of precision.
-            (3) Eliminated unused variables
-
- Date: 10/28/2002
- Description:
-            (1) Added comments per code review
-            (2) Eliminated hardly used condition on if-else (exp==0)
-
- Description:
-
- ------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    Data_in   = Input vector (sized for short windows
-                2*FWD_SHORT_CX_ROT_LENGTH elements), with freq. domain samples
-                type Int32 *
-
-    Data_out  = Output vector with a post-rotation by exp(-j(2pi/N)(k+1/8)),
-                (sized for short windows 2*FWD_SHORT_CX_ROT_LENGTH)
-                type Int32 *
-
-    max       = Input, carries the maximum value of the input vector
-                "Data_in"
-                type Int32
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    exp = shift factor to reflect signal scaling
-
- Pointers and Buffers Modified:
-    Results are return in "Data_out"
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    fwd_short_complex_rot() performs the complex rotation for the MDCT
-    for the case of short windows. It performs digit reverse ordering as well
-    word normalization to ensure 16 by 16 bit multiplications.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    fwd_short_complex_rot() should execute a pre-rotation by
-    exp(-j(2pi/N)(k+1/8)), digit reverse ordering and word normalization
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "fwd_short_complex_rot.h"
-#include "digit_reversal_tables.h"
-#include "imdct_fxp.h"
-#include "pv_normalize.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-Int fwd_short_complex_rot(
-    Int32 *Data_in,
-    Int32 *Data_out,
-    Int32  max)
-
-{
-    Int     i;
-    Int16     I;
-    const   Int16 *pTable;
-    const   Int32 *p_rotate;
-
-    Int32   *pData_in_1;
-    Int     exp;
-    Int32   temp_re;
-    Int32   temp_im;
-
-    Int32   cos_n;
-    Int32   sin_n;
-    Int32   temp_re_32;
-    Int32   temp_im_32;
-
-    Int32   *pData_in_ref;
-
-    Int32   *pData_out_1;
-    Int32   *pData_out_2;
-    Int32   *pData_out_3;
-    Int32   *pData_out_4;
-
-    pTable    =  digit_reverse_64;
-    p_rotate  =  exp_rotation_N_256;
-
-    pData_in_ref  =  Data_in;
-
-    exp = 16 - pv_normalize(max);
-
-    if (exp < 0)
-    {
-        exp = 0;
-    }
-
-    pData_out_1 = Data_out;
-    pData_out_2 = &Data_out[TWICE_FWD_SHORT_CX_ROT_LENGTH_m_1];
-    pData_out_3 = &Data_out[TWICE_FWD_SHORT_CX_ROT_LENGTH];
-    pData_out_4 = &Data_out[FOUR_FWD_SHORT_CX_ROT_LENGTH_m_1];
-
-    /*
-     *  Data_out
-     *                                   >>>>                   <<<<
-     *                                pData_out_3             pData_out_4
-     *      |             |             |             |             |
-     * pData_out_1               pData_out_2
-     *      >>>>                     <<<<
-     */
-
-
-    for (i = FWD_SHORT_CX_ROT_LENGTH; i != 0; i--)
-    {
-        /*
-         *   Perform digit reversal by accessing index I from table
-         */
-
-        I = *pTable++;
-        pData_in_1 = pData_in_ref + I;
-
-        /*
-         * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-         */
-
-        sin_n = *p_rotate++;
-        cos_n = sin_n >> 16;
-        sin_n = sin_n & 0xFFFF;
-
-        /*
-         *  Use auxiliary variables to avoid double accesses to memory.
-         *  Data in is scaled to use only lower 16 bits.
-         */
-
-        temp_re =  *(pData_in_1++) >> exp;
-        temp_im =  *(pData_in_1) >> exp;
-
-        /*
-         *   Pre-rotation
-         */
-
-        temp_re_32 = (temp_re * cos_n + temp_im * sin_n) >> 16;
-        temp_im_32 = (temp_im * cos_n - temp_re * sin_n) >> 16;
-
-        *(pData_out_1++) = - temp_re_32;
-        *(pData_out_2--) =   temp_im_32;
-        *(pData_out_3++) = - temp_im_32;
-        *(pData_out_4--) =   temp_re_32;
-
-        /*
-         *   Pointer increment to jump over imag (1 & 4) or real parts
-         *   (2 & 3)
-         */
-
-        pData_out_1++;
-        pData_out_2--;
-        pData_out_3++;
-        pData_out_4--;
-
-    } /* for(i) */
-
-    return (exp);
-}
diff --git a/media/libstagefright/codecs/aacdec/fwd_short_complex_rot.h b/media/libstagefright/codecs/aacdec/fwd_short_complex_rot.h
deleted file mode 100644
index 3d1e1f1..0000000
--- a/media/libstagefright/codecs/aacdec/fwd_short_complex_rot.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: .fwd_short_complex_rot.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions fwd_short_complex_rot
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef FWD_SHORT_COMPLEX_ROT_H
-#define FWD_SHORT_COMPLEX_ROT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define FWD_SHORT_CX_ROT_LENGTH             64
-#define TWICE_FWD_SHORT_CX_ROT_LENGTH       (FWD_SHORT_CX_ROT_LENGTH<<1)
-#define TWICE_FWD_SHORT_CX_ROT_LENGTH_m_1   ((FWD_SHORT_CX_ROT_LENGTH<<1) - 1)
-#define FOUR_FWD_SHORT_CX_ROT_LENGTH_m_1    ((FWD_SHORT_CX_ROT_LENGTH<<2) - 1)
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-Int fwd_short_complex_rot(
-    Int32 *Data_in,
-    Int32 *Data_out,
-    Int32  max);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* FWD_SHORT_COMPLEX_ROT_H */
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32.h b/media/libstagefright/codecs/aacdec/fxp_mul32.h
deleted file mode 100644
index 230cef5..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/fxp_mul32.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef FXP_MUL32
-#define FXP_MUL32
-
-#if   defined(PV_ARM_V5)
-
-#include "fxp_mul32_arm_v5.h"
-
-#elif defined(PV_ARM_V4)
-
-#include "fxp_mul32_arm_v4.h"
-
-#elif defined(PV_ARM_MSC_EVC_V4)
-
-#include "fxp_mul32_c_msc_evc.h"
-
-#elif defined(PV_ARM_MSC_EVC_V5)
-
-#include "fxp_mul32_c_msc_evc_armv5.h"
-
-#elif defined(PV_ARM_GCC_V5)
-
-#include "fxp_mul32_arm_gcc.h"
-
-#elif defined(PV_ARM_GCC_V4)
-
-#include "fxp_mul32_arm_v4_gcc.h"
-
-#else
-
-#ifndef C_EQUIVALENT
-#define C_EQUIVALENT
-#endif
-
-#include "fxp_mul32_c_equivalent.h"
-
-#endif
-
-
-#endif   /*  FXP_MUL32  */
-
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32_arm_gcc.h b/media/libstagefright/codecs/aacdec/fxp_mul32_arm_gcc.h
deleted file mode 100644
index dc58976..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32_arm_gcc.h
+++ /dev/null
@@ -1,547 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/fxp_mul32_arm_gcc.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef FXP_MUL32_ARM_GCC
-#define FXP_MUL32_ARM_GCC
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#include "pv_audio_type_defs.h"
-
-
-#if (defined (PV_ARM_GCC_V4) || defined(PV_ARM_GCC_V5)) /* ARM GNU COMPILER  */
-
-
-
-#define preload_cache( a)
-
-
-    static inline Int32 shft_lft_1(Int32 y)
-    {
-        register Int32 x;
-        register Int32 ra = y;
-
-
-        asm volatile(
-            "qadd %0, %1, %1\n\t"
-    : "=&r*i"(x)
-                    : "r"(ra));
-
-        return (x);
-    }
-
-    static inline Int32 fxp_mul_16_by_16bb(Int32 L_var1, const Int32 L_var2)
-    {
-
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "smulbb %0, %1, %2"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp);
-    }
-
-
-#define fxp_mul_16_by_16(a, b)  fxp_mul_16_by_16bb(  a, b)
-
-
-    static inline Int32 fxp_mul_16_by_16tb(Int32 L_var1, const Int32 L_var2)
-{
-
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "smultb %0, %1, %2"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp);
-    }
-
-    static inline Int32 fxp_mul_16_by_16bt(Int32 L_var1, const Int32 L_var2)
-{
-
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "smulbt %0, %1, %2"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp);
-    }
-
-    static inline Int32 fxp_mul_16_by_16tt(Int32 L_var1, const Int32 L_var2)
-{
-
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "smultt %0, %1, %2"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp);
-    }
-
-    static inline Int32 fxp_mac_16_by_16(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-{
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile(
-            "smlabb %0, %1, %2, %3"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (tmp);
-    }
-
-
-
-    static inline Int32 fxp_mac_16_by_16_bb(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-{
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile(
-            "smlabb %0, %1, %2, %3"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (tmp);
-    }
-
-
-    static inline Int32 fxp_mac_16_by_16_bt(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-{
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile(
-            "smlabt %0, %1, %2, %3"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (tmp);
-    }
-
-
-
-    static inline Int32 cmplx_mul32_by_16(Int32 x, const Int32 y, Int32 exp_jw)
-{
-        register Int32 cx_sum;
-        register Int32 rx = (Int32)x;
-        register Int32 ry = (Int32)y;
-        register Int32 rexp = (Int32)exp_jw;
-        asm volatile(
-            "smulwt %0, %1, %3\n\t"
-            "smlawb %0, %2, %3, %0"
-    : "=&r*i"(cx_sum)
-                    : "r"(rx),
-                    "r"(ry),
-                    "r"(rexp));
-
-        return (cx_sum);
-    }
-
-
-    static inline Int32 fxp_mul32_by_16(Int32 L_var1, const Int32 L_var2)
-{
-
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "smulwb %0, %1, %2"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp);
-    }
-
-#define fxp_mul32_by_16b( a, b)   fxp_mul32_by_16( a, b)
-
-
-    static inline Int32 fxp_mul32_by_16t(Int32 L_var1, const Int32 L_var2)
-{
-
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "smulwt %0, %1, %2"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp);
-    }
-
-
-
-    static inline Int32 fxp_mac32_by_16(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-{
-
-        register Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile(
-            "smlawb %0, %1, %2, %3"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (tmp);
-    }
-
-
-    __inline  int64 fxp_mac64_Q31(int64 sum, const Int32 L_var1, const Int32 L_var2)
-{
-        sum += (int64)L_var1 * L_var2;
-        return (sum);
-    }
-
-
-
-
-    static inline Int32 fxp_mac32_Q30(const Int32 a, const Int32 b, Int32 L_add)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "add %4, %4, %0, asl #2\n\t"
-                     "add %0, %4, %1, lsr #30"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mac32_Q31(Int32 L_add, const Int32 a, const Int32 b)
-{
-
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "add %0, %0, %4"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-        return (result64_hi);
-    }
-
-
-
-    static inline Int32 fxp_msu32_Q31(Int32 L_sub, const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_sub;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "sub %0, %4, %0"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q31(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile(
-            "smull %1, %0, %2, %3"
-    : "=&r*i"(result64_hi),
-            "=&r*i"(result64_lo)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q30(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #2\n\t"
-                     "orr   %0, %0, %1, lsr #30"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-        return (result64_hi);
-    }
-
-
-
-    static inline Int32 fxp_mac32_Q29(const Int32 a, const Int32 b, Int32 L_add)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "add   %4, %4, %0, lsl #3\n\t"
-                     "add   %0, %4, %1, lsr #29"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_msu32_Q29(const Int32 a, const Int32 b, Int32 L_sub)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_sub;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "sub   %4, %4, %0, lsl #3\n\t"
-                     "sub   %0, %4, %1, lsr #29"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-        return (result64_hi);
-    }
-
-    static inline Int32 fxp_mul32_Q29(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #3\n\t"
-                     "orr   %0, %0, %1, lsr #29"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-        return (result64_hi);
-    }
-
-
-
-    static inline Int32 fxp_mul32_Q28(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #4\n\t"
-                     "orr   %0, %0, %1, lsr #28"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-        return (result64_hi);
-    }
-
-    static inline Int32 fxp_mul32_Q27(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #5\n\t"
-                     "orr   %0, %0, %1, lsr #27"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q26(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #6\n\t"
-                     "orr   %0, %0, %1, lsr #26"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q20(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #12\n\t"
-                     "orr   %0, %0, %1, lsr #20"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q15(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #17\n\t"
-                     "orr   %0, %0, %1, lsr #15"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-
-    static inline Int32 fxp_mul32_Q14(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2,  %3\n\t"
-                     "mov   %0, %0, lsl #18\n\t"
-                     "orr   %0, %0, %1, lsr #14"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif   /*  FXP_MUL32  */
-
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v4.h b/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v4.h
deleted file mode 100644
index 6869c54..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v4.h
+++ /dev/null
@@ -1,429 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: fxp_mul32_c_equivalent.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef FXP_MUL32_ARM_V4
-#define FXP_MUL32_ARM_V4
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#include "pv_audio_type_defs.h"
-
-
-#if defined(PV_ARM_V4)
-
-#define preload_cache( a)
-
-
-    __inline  Int32 shft_lft_1(Int32 L_var1)
-    {
-        Int32 x;
-        Int32 z = 1; /* rvct compiler problem */
-        __asm
-        {
-            mov x, L_var1, asl 1
-            teq L_var1, x, asr z
-            eorne  x, INT32_MAX, L_var1, asr #31
-        }
-
-        return(x);
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16bb(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-
-            mov L_var2, L_var2, asl #16
-            mov L_var2, L_var2, asr #16
-            mov L_var1, L_var1, asl #16
-            mov L_var1, L_var1, asr #16
-
-
-            mul L_var1, L_var2, L_var1
-        }
-
-        return L_var1;
-
-    }
-
-
-#define fxp_mul_16_by_16(a, b)  fxp_mul_16_by_16bb(  a, b)
-
-
-    __inline  Int32 fxp_mul_16_by_16tb(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-            mov L_var2, L_var2, asl #16
-            mov L_var2, L_var2, asr #16
-            mov L_var1, L_var1, asr #16
-
-            mul L_var1, L_var2, L_var1
-        }
-        return L_var1;
-    }
-
-    __inline  Int32 fxp_mul_16_by_16bt(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-            mov L_var2, L_var2, asr #16
-            mov L_var1, L_var1, asl #16
-            mov L_var1, L_var1, asr #16
-
-            mul L_var1, L_var2, L_var1
-        }
-
-        return L_var1;
-
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16tt(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-            mov L_var2, L_var2, asr #16
-            mov L_var1, L_var1, asr #16
-
-            mul L_var1, L_var2, L_var1
-        }
-
-        return L_var1;
-
-    }
-
-    __inline  Int32 fxp_mac_16_by_16(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            mla L_add, L_var1, L_var2, L_add
-        }
-        return (L_add);
-    }
-
-
-    __inline  Int32 fxp_mac_16_by_16_bb(const Int32 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            mov L_var2, L_var2, asl #16
-            mov L_var2, L_var2, asr #16
-            mla L_add, L_var1, L_var2, L_add
-        }
-        return L_add;
-    }
-
-    __inline  Int32 fxp_mac_16_by_16_bt(Int16 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            mov L_var2, L_var2, asr #16
-            mla L_add, L_var1, L_var2, L_add
-        }
-        return L_add;
-    }
-
-
-    __inline  Int32 cmplx_mul32_by_16(Int32 x, const Int32 y, Int32 exp_jw)
-    {
-
-        Int32 result64_hi;
-        Int32 rTmp0;
-        Int32 iTmp0;
-        __asm
-        {
-            mov rTmp0, exp_jw, asr #16
-            mov rTmp0, rTmp0, asl #16
-            mov iTmp0, exp_jw, asl #16
-            smull rTmp0, result64_hi, x, rTmp0
-            smlal iTmp0, result64_hi, y, iTmp0
-        }
-
-        return (result64_hi);
-    }
-
-
-    __inline  Int32 fxp_mul32_by_16(Int32 L_var1, Int32 L_var2)
-    {
-        Int32 result64_hi;
-        __asm
-        {
-            mov L_var2, L_var2, asl #16
-            smull L_var1, result64_hi, L_var2, L_var1
-        }
-        return (result64_hi);
-    }
-
-
-
-#define fxp_mul32_by_16b( a, b)   fxp_mul32_by_16( a, b)
-
-
-
-    __inline  Int32 fxp_mul32_by_16t(Int32 L_var1, Int32 L_var2)
-    {
-
-        Int32 result64_hi;
-        __asm
-        {
-            mov L_var2, L_var2, asr #16
-            mov L_var2, L_var2, asl #16
-            smull L_var1, result64_hi, L_var2, L_var1
-        }
-        return (result64_hi);
-
-    }
-
-    __inline  Int32 fxp_mac32_by_16(Int32 L_var1, Int32 L_var2, Int32 L_add)
-    {
-
-        __asm
-        {
-            mov L_var2, L_var2, asl #16
-            smlal L_var1, L_add, L_var2, L_var1
-        }
-
-        return (L_add);
-    }
-
-
-    __inline  int64 fxp_mac64_Q31(int64 sum, const Int32 L_var1, const Int32 L_var2)
-    {
-        uint32 b = (UInt32)(sum);
-        int32 c = Int32(sum >> 32);
-        __asm
-        {
-            smlal b, c, L_var1, L_var2
-        }
-        return (((int64(c)) << 32) | b);
-    }
-
-
-    __inline  Int32 fxp_mul32_Q31(Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        __asm
-        {
-            smull L_var1, result64_hi, L_var2, L_var1
-        }
-        return (result64_hi);
-    }
-
-
-    __inline  Int32 fxp_mac32_Q31(Int32 L_add,  Int32 L_var1, const Int32 L_var2)
-    {
-        __asm
-        {
-            smlal L_var1, L_add, L_var2, L_var1
-        }
-        return L_add;
-    }
-
-    __inline  Int32 fxp_msu32_Q31(Int32 L_sub,  Int32 L_var1, const Int32 L_var2)
-    {
-        __asm
-        {
-            rsb   L_var1, L_var1, #0
-            smlal L_var1, L_sub, L_var2, L_var1
-        }
-        return L_sub;
-    }
-
-
-    __inline  Int32 fxp_mul32_Q30(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #2
-            orr  result64_hi, result64_hi, result64_lo, lsr #30
-        }
-        return (result64_hi);
-    }
-
-
-    __inline  Int32 fxp_mac32_Q30(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            add L_add, L_add, result64_hi, asl  #2
-            add L_add, L_add, result64_lo, lsr  #30
-        }
-        return (L_add);
-    }
-
-
-    __inline  Int32 fxp_mul32_Q29(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #3
-            orr  result64_hi, result64_hi, result64_lo, lsr #29
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mac32_Q29(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            add L_add, L_add, result64_hi, asl  #3
-            add L_add, L_add, result64_lo, lsr  #29
-        }
-        return (L_add);
-    }
-
-    __inline  Int32 fxp_msu32_Q29(const Int32 L_var1, const Int32 L_var2, Int32 L_sub)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            sub L_sub, L_sub, result64_hi, asl  #3
-            sub L_sub, L_sub, result64_lo, lsr  #29
-        }
-        return (L_sub);
-    }
-
-    __inline  Int32 fxp_mul32_Q28(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #4
-            orr  result64_hi, result64_hi, result64_lo, lsr #28
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q27(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #5
-            orr  result64_hi, result64_hi, result64_lo, lsr #27
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q26(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #6
-            orr  result64_hi, result64_hi, result64_lo, lsr #26
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q20(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #12
-            orr  result64_hi, result64_hi, result64_lo, lsr #20
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q15(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #17
-            orr  result64_hi, result64_hi, result64_lo, lsr #15
-        }
-        return (result64_hi);
-    }
-
-
-
-
-    __inline  Int32 fxp_mul32_Q14(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #18
-            orr  result64_hi, result64_hi, result64_lo, lsr #14
-        }
-        return (result64_hi);
-    }
-
-
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif   /*  FXP_MUL32  */
-
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v4_gcc.h b/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v4_gcc.h
deleted file mode 100755
index f4ab2f7..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v4_gcc.h
+++ /dev/null
@@ -1,630 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: fxp_mul32_arm_v4_gcc.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-
-
-#ifndef FXP_MUL32_V4_ARM_GCC
-#define FXP_MUL32_V4_ARM_GCC
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#include "pv_audio_type_defs.h"
-
-
-#if defined (_ARM_V4_GCC) /* ARM_V4 GNU COMPILER  */
-
-
-#define preload_cache( a)
-
-
-    static inline  Int32 shft_lft_1(Int32 L_var1)
-    {
-        Int32 x;
-        register Int32 ra = L_var1;
-        Int32 z = INT32_MAX;
-
-        asm volatile(
-            "mov %0, %1, asl #1\n\t"
-            "teq %1, %0, asr #1\n\t"
-            "eorne   %0, %2, %1, asr #31"
-    : "=&r*i"(x)
-                    : "r"(ra),
-                    "r"(z));
-
-        return(x);
-    }
-
-    static inline Int32 fxp_mul_16_by_16bb(Int32 L_var1, Int32 L_var2)
-{
-
-        Int32 tmp1;
-        Int32 tmp2;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "mov %0, %3, asl #16\n\t"
-            "mov %0, %0, asr #16\n\t"
-            "mov %1, %2, asl #16\n\t"
-            "mov %1, %1, asr #16\n\t"
-            "mul %0, %1, %0"
-    : "=&r*i"(tmp1),
-            "=&r*i"(tmp2)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp1);
-
-    }
-
-#define fxp_mul_16_by_16(a, b)  fxp_mul_16_by_16bb(  a, b)
-
-
-    static inline Int32 fxp_mul_16_by_16tb(Int32 L_var1, Int32 L_var2)
-{
-
-        Int32 tmp1;
-        Int32 tmp2;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "mov %0, %3, asl #16\n\t"
-            "mov %0, %0, asr #16\n\t"
-            "mov %1, %2, asr #16\n\t"
-            "mul %0, %1, %0"
-    : "=&r*i"(tmp1),
-            "=&r*i"(tmp2)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp1);
-
-    }
-
-
-    static inline Int32 fxp_mul_16_by_16bt(Int32 L_var1, Int32 L_var2)
-{
-
-        Int32 tmp1;
-        Int32 tmp2;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "mov %0, %3, asr #16\n\t"
-            "mov %1, %2, asl #16\n\t"
-            "mov %1, %1, asr #16\n\t"
-            "mul %0, %1, %0"
-    : "=&r*i"(tmp1),
-            "=&r*i"(tmp2)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp1);
-
-    }
-
-
-    static inline Int32 fxp_mul_16_by_16tt(Int32 L_var1, Int32 L_var2)
-{
-
-        Int32 tmp1;
-        Int32 tmp2;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "mov %0, %3, asr #16\n\t"
-            "mov %1, %2, asr #16\n\t"
-            "mul %0, %1, %0"
-    : "=&r*i"(tmp1),
-            "=&r*i"(tmp2)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (tmp1);
-
-    }
-
-
-
-    static inline  Int32 fxp_mac_16_by_16(Int16 L_var1,  Int16 L_var2, Int32 L_add)
-{
-
-        Int32 tmp;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile(
-            "mla %0, %1, %2, %3"
-    : "=&r*i"(tmp)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (tmp);
-    }
-
-
-
-    static inline Int32 fxp_mac_16_by_16_bb(Int16 L_var1,  Int32 L_var2, Int32 L_add)
-{
-
-        Int32 tmp1;
-        Int32 tmp2;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile(
-            "mov %0, %3, asl #16\n\t"
-            "mov %0, %0, asr #16\n\t"
-            "mla %1, %0, %2, %4"
-    : "=&r*i"(tmp1),
-            "=&r*i"(tmp2)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (tmp2);
-    }
-
-
-
-    static inline  Int32 fxp_mac_16_by_16_bt(Int16 L_var1,  Int32 L_var2, Int32 L_add)
-{
-
-        Int32 tmp1;
-        Int32 tmp2;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile(
-            "mov %0, %3, asr #16\n\t"
-            "mla %1, %0, %2, %4"
-    : "=&r*i"(tmp1),
-            "=&r*i"(tmp2)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (tmp2);
-
-    }
-
-
-
-    static inline  Int32 cmplx_mul32_by_16(Int32 x, Int32 y, Int32 exp_jw)
-{
-
-        Int32 rTmp0;
-        Int32 iTmp0;
-        Int32 result64_hi;
-        register Int32 ra = (Int32)x;
-        register Int32 rb = (Int32)y;
-        register Int32 rc = (Int32)exp_jw;
-
-
-
-        asm volatile(
-            "mov %0, %5, asr #16\n\t"
-            "mov %1, %5, asl #16\n\t"
-            "mov %0, %0, asl #16\n\t"
-    : "=&r*i"(rTmp0),
-            "=&r*i"(iTmp0),
-            "=&r*i"(result64_hi)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-
-        asm volatile(
-            "smull %0, %2, %3, %0\n\t"
-            "smlal %1, %2, %4, %1"
-    : "=&r*i"(rTmp0),
-            "=&r*i"(iTmp0),
-            "=&r*i"(result64_hi)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (result64_hi);
-
-
-    }
-
-
-    static inline  Int32 fxp_mul32_by_16(Int32 L_var1, Int32 L_var2)
-{
-
-        Int32 rTmp0;
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "mov %0, %4, asl #16\n\t"
-            "smull %2, %1, %0, %3"
-    : "=&r*i"(rTmp0),
-            "=&r*i"(result64_hi),
-            "=&r*i"(result64_lo)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-#define fxp_mul32_by_16b( a, b)   fxp_mul32_by_16( a, b)
-
-
-
-    static inline  Int32 fxp_mul32_by_16t(Int32 L_var1, Int32 L_var2)
-{
-
-        Int32 rTmp0;
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-
-        asm volatile(
-            "mov %0, %4, asr #16\n\t"
-            "mov %0, %0, asl #16\n\t"
-            "smull %2, %1, %0, %3"
-    : "=&r*i"(rTmp0),
-            "=&r*i"(result64_hi),
-            "=&r*i"(result64_lo)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-
-    static inline  Int32 fxp_mac32_by_16(Int32 L_var1, Int32 L_var2, Int32 L_add)
-{
-
-        Int32 rTmp0;
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)L_var1;
-        register Int32 rb = (Int32)L_var2;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile(
-            "mov %0, %4, asl #16\n\t"
-            "mov %1, %5\n\t"
-            "smlal %2, %1, %0, %3"
-    : "=&r*i"(rTmp0),
-            "=&r*i"(result64_hi),
-            "=&r*i"(result64_lo)
-                    : "r"(ra),
-                    "r"(rb),
-                    "r"(rc));
-
-        return (result64_hi);
-    }
-
-
-    static inline int64 fxp_mac64_Q31(int64 sum, const Int32 L_var1, const Int32 L_var2)
-{
-        sum += (int64)L_var1 * L_var2;
-        return (sum);
-    }
-
-
-    static inline Int32 fxp_mac32_Q30(const Int32 a, const Int32 b, Int32 L_add)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "add %4, %4, %0, asl #2\n\t"
-                     "add %0, %4, %1, lsr #30"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mac32_Q31(Int32 L_add, const Int32 a, const Int32 b)
-{
-
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "add %0, %0, %4"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-        return (result64_hi);
-    }
-
-
-
-    static inline Int32 fxp_msu32_Q31(Int32 L_sub, const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_sub;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "sub %0, %4, %0"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q31(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile(
-            "smull %1, %0, %2, %3"
-    : "=&r*i"(result64_hi),
-            "=&r*i"(result64_lo)
-                    : "r"(ra),
-                    "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q30(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #2\n\t"
-                     "orr   %0, %0, %1, lsr #30"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-        return (result64_hi);
-    }
-
-
-
-    static inline Int32 fxp_mac32_Q29(const Int32 a, const Int32 b, Int32 L_add)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_add;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "add   %4, %4, %0, lsl #3\n\t"
-                     "add   %0, %4, %1, lsr #29"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_msu32_Q29(const Int32 a, const Int32 b, Int32 L_sub)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        register Int32 rc = (Int32)L_sub;
-
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "sub   %4, %4, %0, lsl #3\n\t"
-                     "sub   %0, %4, %1, lsr #29"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb),
-                             "r"(rc));
-
-        return (result64_hi);
-    }
-
-    static inline Int32 fxp_mul32_Q29(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #3\n\t"
-                     "orr   %0, %0, %1, lsr #29"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-        return (result64_hi);
-    }
-
-
-
-    static inline Int32 fxp_mul32_Q28(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #4\n\t"
-                     "orr   %0, %0, %1, lsr #28"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-        return (result64_hi);
-    }
-
-    static inline Int32 fxp_mul32_Q27(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #5\n\t"
-                     "orr   %0, %0, %1, lsr #27"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q26(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #6\n\t"
-                     "orr   %0, %0, %1, lsr #26"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q20(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #12\n\t"
-                     "orr   %0, %0, %1, lsr #20"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-    static inline Int32 fxp_mul32_Q15(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2, %3\n\t"
-                     "mov %0, %0, lsl #17\n\t"
-                     "orr   %0, %0, %1, lsr #15"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-
-
-    static inline Int32 fxp_mul32_Q14(const Int32 a, const Int32 b)
-{
-        Int32 result64_hi;
-        Int32 result64_lo;
-        register Int32 ra = (Int32)a;
-        register Int32 rb = (Int32)b;
-        asm volatile("smull %1, %0, %2,  %3\n\t"
-                     "mov   %0, %0, lsl #18\n\t"
-                     "orr   %0, %0, %1, lsr #14"
-             : "=&r*i"(result64_hi),
-                     "=&r*i"(result64_lo)
-                             : "r"(ra),
-                             "r"(rb));
-
-        return (result64_hi);
-    }
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif   /*  FXP_MUL32_V4_ARM_GCC  */
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v5.h b/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v5.h
deleted file mode 100644
index 8ab108f..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32_arm_v5.h
+++ /dev/null
@@ -1,450 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/fxp_mul32_arm_v5.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef FXP_MUL32_ARM_V5
-#define FXP_MUL32_ARM_V5
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include "pv_audio_type_defs.h"
-
-
-#if defined(PV_ARM_V5)
-
-//#undef EXTENDED_ASM
-#define EXTENDED_ASM
-#define _ARM_V5_
-
-
-    __inline  Int32 shft_lft_1(Int32 L_var1)
-    {
-        __asm
-        {
-            qadd L_var1, L_var1, L_var1
-        }
-
-        return L_var1;
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-            smulbb L_var1, L_var1, L_var2
-        }
-        return L_var1;
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16bb(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-            smulbb L_var1, L_var1, L_var2
-        }
-        return L_var1;
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16tb(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-            smultb L_var1, L_var1, L_var2
-        }
-        return L_var1;
-    }
-
-    __inline  Int32 fxp_mul_16_by_16tt(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-            smultt L_var1, L_var1, L_var2
-        }
-        return L_var1;
-    }
-
-    __inline  Int32 fxp_mul_16_by_16bt(Int32 L_var1,  Int32 L_var2)
-    {
-        __asm
-        {
-            smulbt L_var1, L_var1, L_var2
-        }
-        return L_var1;
-    }
-
-
-
-    __inline  Int32 fxp_mac_16_by_16(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            smlabb L_add, L_var1, L_var2, L_add
-        }
-        return (L_add);
-    }
-
-    __inline  Int32 fxp_mac_16_by_16_bb(const Int32 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            smlabb L_add, L_var1, L_var2, L_add
-        }
-        return L_add;
-    }
-
-    __inline  Int32 fxp_mac_16_by_16_bt(const Int32 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            smlabt L_add, L_var1, L_var2, L_add
-        }
-        return L_add;
-    }
-
-
-    __inline  Int32 fxp_mac_16_by_16_tb(const Int32 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            smlatb L_add, L_var1, L_var2, L_add
-        }
-        return L_add;
-    }
-
-    __inline  Int32 fxp_mac_16_by_16_tt(const Int32 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            smlatt L_add, L_var1, L_var2, L_add
-        }
-        return L_add;
-    }
-
-    __inline  Int32 fxp_mac32_by_16(Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-        __asm
-        {
-            smlawb L_add, L_var1, L_var2, L_add
-        }
-        return (L_add);
-    }
-
-
-    __inline  int64 fxp_mac64_Q31(int64 sum, const Int32 L_var1, const Int32 L_var2)
-    {
-        uint32 b = (UInt32)(sum);
-        int32 c = Int32(sum >> 32);
-        __asm
-        {
-            smlal b, c, L_var1, L_var2
-        }
-        return (((int64(c)) << 32) | b);
-    }
-
-
-    __inline  Int32 fxp_mac32_Q31(Int32 L_add,  Int32 L_var1, const Int32 L_var2)
-    {
-        __asm
-        {
-            smlal L_var1, L_add, L_var2, L_var1
-        }
-        return L_add;
-    }
-
-    __inline  Int32 fxp_msu32_Q31(Int32 L_sub,  Int32 L_var1, const Int32 L_var2)
-    {
-        __asm
-        {
-            rsb   L_var1, L_var1, #0
-            smlal L_var1, L_sub, L_var2, L_var1
-        }
-        return L_sub;
-    }
-
-    __inline  Int32 fxp_mul32_Q31(Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        __asm
-        {
-            smull L_var1, result64_hi, L_var2, L_var1
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q30(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #2
-#ifdef EXTENDED_ASM
-            mov result64_lo, result64_lo, lsr  #30
-            orr  result64_hi, result64_lo, result64_hi
-#else
-            orr  result64_hi, result64_hi, result64_lo, lsr #30
-#endif
-        }
-        return (result64_hi);
-    }
-
-
-    __inline  Int32 fxp_mac32_Q30(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            add L_add, L_add, result64_hi, asl  #2
-            add L_add, L_add, result64_lo, lsr  #30
-        }
-        return (L_add);
-    }
-
-
-    __inline  Int32 fxp_mul32_Q29(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #3
-#ifdef EXTENDED_ASM
-            mov result64_lo, result64_lo, lsr  #29
-            orr  result64_hi, result64_lo, result64_hi
-#else
-            orr  result64_hi, result64_hi, result64_lo, lsr #29
-#endif
-        }
-        return (result64_hi);
-    }
-
-
-
-    __inline  Int32 fxp_mac32_Q29(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            add L_add, L_add, result64_hi, asl  #3
-            add L_add, L_add, result64_lo, lsr  #29
-        }
-        return (L_add);
-    }
-
-
-    __inline  Int32 fxp_msu32_Q29(const Int32 L_var1, const Int32 L_var2, Int32 L_sub)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            sub L_sub, L_sub, result64_hi, asl  #3
-            sub L_sub, L_sub, result64_lo, lsr  #29
-        }
-        return (L_sub);
-    }
-
-
-    __inline  Int32 fxp_mul32_Q28(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #4
-#ifdef EXTENDED_ASM
-            mov result64_lo, result64_lo, lsr  #28
-            orr  result64_hi, result64_lo, result64_hi
-#else
-            orr  result64_hi, result64_hi, result64_lo, lsr #28
-#endif
-
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q27(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #5
-#ifdef EXTENDED_ASM
-            mov result64_lo, result64_lo, lsr  #27
-            orr  result64_hi, result64_lo, result64_hi
-#else
-            orr  result64_hi, result64_hi, result64_lo, lsr #27
-#endif
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q26(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #6
-#ifdef EXTENDED_ASM
-            mov result64_lo, result64_lo, lsr  #26
-            orr  result64_hi, result64_lo, result64_hi
-#else
-            orr  result64_hi, result64_hi, result64_lo, lsr #26
-#endif
-
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q20(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #12
-#ifdef EXTENDED_ASM
-            mov result64_lo, result64_lo, lsr  #20
-            orr  result64_hi, result64_lo, result64_hi
-#else
-            orr  result64_hi, result64_hi, result64_lo, lsr #20
-#endif
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_by_16(Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        __asm
-        {
-            smulwb result64_hi, L_var1, L_var2
-        }
-        return (result64_hi);
-    }
-
-#define fxp_mul32_by_16b( a, b)         fxp_mul32_by_16(a, b)
-
-    __inline  Int32 fxp_mul32_by_16t(Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        __asm
-        {
-            smulwt result64_hi, L_var1, L_var2
-        }
-        return (result64_hi);
-    }
-
-    __inline  Int32 fxp_mul32_Q15(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #17
-#ifdef EXTENDED_ASM
-            mov result64_lo, result64_lo, lsr  #15
-            orr  result64_hi, result64_lo, result64_hi
-#else
-            orr  result64_hi, result64_hi, result64_lo, lsr #15
-#endif
-        }
-        return (result64_hi);
-    }
-
-
-    __inline  Int32 cmplx_mul32_by_16(Int32 L_var1, const Int32 L_var2, const Int32 cmplx)
-    {
-        Int32 result64_hi;
-
-        __asm
-        {
-            smulwt result64_hi, L_var1, cmplx
-            smlawb result64_hi, L_var2, cmplx, result64_hi
-        }
-        return (result64_hi);
-
-    }
-
-    __inline  Int32 fxp_mul32_Q14(const Int32 L_var1, const Int32 L_var2)
-    {
-        Int32 result64_hi;
-        Int32 result64_lo;
-        __asm
-        {
-            smull result64_lo, result64_hi, L_var2, L_var1
-            mov result64_hi, result64_hi, asl  #18
-#ifdef EXTENDED_ASM
-            mov result64_lo, result64_lo, lsr  #14
-            orr  result64_hi, result64_lo, result64_hi
-#else
-            orr  result64_hi, result64_hi, result64_lo, lsr #14
-#endif
-        }
-        return (result64_hi);
-    }
-
-
-#define preload_cache( a)
-
-
-
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif   /*  FXP_MUL32  */
-
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32_c_equivalent.h b/media/libstagefright/codecs/aacdec/fxp_mul32_c_equivalent.h
deleted file mode 100644
index 5bcbe53..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32_c_equivalent.h
+++ /dev/null
@@ -1,285 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./c/include/fxp_mul32_c_equivalent.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef FXP_MUL32_C_EQUIVALENT
-#define FXP_MUL32_C_EQUIVALENT
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#include "pv_audio_type_defs.h"
-
-
-#if defined(C_EQUIVALENT)
-
-#define preload_cache( a)
-
-    __inline  Int32 shft_lft_1(Int32 L_var1)
-    {
-        if (((L_var1 << 1) >> 1) == L_var1)
-            L_var1 <<= 1;
-        else
-            L_var1 = ((L_var1 >> 31) ^ INT32_MAX);
-
-        return (L_var1);
-
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16bb(Int32 L_var1,  Int32 L_var2)
-    {
-        L_var2 = (L_var2 << 16) >> 16;
-        L_var1 = (L_var1 << 16) >> 16;
-
-        L_var1 *= L_var2;
-
-        return L_var1;
-
-    }
-
-
-#define fxp_mul_16_by_16(a, b)  fxp_mul_16_by_16bb(  a, b)
-
-
-    __inline  Int32 fxp_mul_16_by_16tb(Int32 L_var1,  Int32 L_var2)
-    {
-        L_var2 = (L_var2 << 16) >> 16;
-        L_var1 =  L_var1 >> 16;
-
-        L_var1 *= L_var2;
-
-        return L_var1;
-
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16bt(Int32 L_var1,  Int32 L_var2)
-    {
-        L_var2 = L_var2 >> 16;
-        L_var1 = (L_var1 << 16) >> 16;
-
-        L_var1 *= L_var2;
-
-        return L_var1;
-
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16tt(Int32 L_var1,  Int32 L_var2)
-    {
-        L_var2 = L_var2 >> 16;
-        L_var1 = L_var1 >> 16;
-
-        L_var1 *= L_var2;
-
-        return L_var1;
-
-    }
-
-    __inline  Int32 fxp_mac_16_by_16(Int16 L_var1,  Int16 L_var2, Int32 L_add)
-    {
-
-        L_add += L_var1 * L_var2;
-
-        return L_add;
-
-    }
-
-
-
-
-
-    __inline  Int32 fxp_mac_16_by_16_bb(Int16 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        L_var2 = (L_var2 << 16) >> 16;
-
-        L_add += L_var1 * L_var2;
-
-        return L_add;
-
-    }
-
-
-    __inline  Int32 fxp_mac_16_by_16_bt(Int16 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        L_var2 = L_var2 >> 16;
-
-        L_add += L_var1 * L_var2;
-
-        return L_add;
-
-    }
-
-
-
-
-
-    __inline  Int32 cmplx_mul32_by_16(Int32 x, const Int32 y, Int32 exp_jw)
-    {
-        Int32  rTmp0 = (Int16)(exp_jw >> 16);
-        Int32  iTmp0 = exp_jw;
-        Int32  z;
-
-        z  = (Int32)(((int64_t)x * (rTmp0 << 16)) >> 32);
-        z += (Int32)(((int64_t)y * (iTmp0 << 16)) >> 32);
-
-        return (z);
-    }
-
-
-    __inline  Int32 fxp_mul32_by_16(Int32 L_var1, const Int32 L_var2)
-    {
-        Int32  z;
-
-        z = (Int32)(((int64_t) L_var1 * (L_var2 << 16)) >> 32);
-        return(z);
-    }
-
-
-#define fxp_mul32_by_16b( a, b)   fxp_mul32_by_16( a, b)
-
-
-    __inline  Int32 fxp_mul32_by_16t(Int32 L_var1, const Int32 L_var2)
-    {
-        Int32  rTmp0 = (Int16)(L_var2 >> 16);
-        Int32  z;
-
-        z = (Int32)(((int64_t) L_var1 * (rTmp0 << 16)) >> 32);
-
-        return(z);
-    }
-
-
-    __inline  Int32 fxp_mac32_by_16(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-        Int32  rTmp0 = L_var2 << 16;
-
-        L_add += (Int32)(((int64_t) L_var1 * rTmp0) >> 32);
-
-        return(L_add);
-    }
-
-    __inline  int64_t fxp_mac64_Q31(int64_t sum, const Int32 L_var1, const Int32 L_var2)
-    {
-        sum += (int64_t)L_var1 * L_var2;
-        return (sum);
-    }
-
-    __inline Int32 fxp_mul32_Q31(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 32);
-    }
-
-    __inline Int32 fxp_mac32_Q31(Int32 L_add, const Int32 a, const Int32 b)
-    {
-        return (L_add + (Int32)(((int64_t)(a) * b) >> 32));
-    }
-
-    __inline Int32 fxp_msu32_Q31(Int32 L_sub, const Int32 a, const Int32 b)
-    {
-        return (L_sub - (Int32)(((int64_t)(a) * b) >> 32));
-    }
-
-
-    __inline Int32 fxp_mul32_Q30(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 30);
-    }
-
-    __inline Int32 fxp_mac32_Q30(const Int32 a, const Int32 b, Int32 L_add)
-    {
-        return (L_add + (Int32)(((int64_t)(a) * b) >> 30));
-    }
-
-
-    __inline Int32 fxp_mul32_Q29(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 29);
-    }
-
-    __inline Int32 fxp_mac32_Q29(const Int32 a, const Int32 b, Int32 L_add)
-    {
-        return (L_add + (Int32)(((int64_t)(a) * b) >> 29));
-    }
-
-    __inline Int32 fxp_msu32_Q29(const Int32 a, const Int32 b, Int32 L_sub)
-    {
-        return (L_sub - (Int32)(((int64_t)(a) * b) >> 29));
-    }
-
-
-    __inline Int32 fxp_mul32_Q28(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 28);
-    }
-
-    __inline Int32 fxp_mul32_Q27(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 27);
-    }
-
-    __inline Int32 fxp_mul32_Q26(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 26);
-    }
-
-    __inline Int32 fxp_mul32_Q20(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 20);
-    }
-
-    __inline Int32 fxp_mul32_Q15(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 15);
-    }
-
-    __inline Int32 fxp_mul32_Q14(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64_t)(a) * b) >> 14);
-    }
-
-
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif   /*  FXP_MUL32  */
-
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32_c_msc_evc.h b/media/libstagefright/codecs/aacdec/fxp_mul32_c_msc_evc.h
deleted file mode 100644
index 64397cf..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32_c_msc_evc.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: fxp_mul32_msc_evc.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-
-#ifndef FXP_MUL32_MSC_EVC
-#define FXP_MUL32_MSC_EVC
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#include "pv_audio_type_defs.h"
-
-#if defined(PV_ARM_MSC_EVC_V4)
-
-#include "cmnintrin.h"
-
-#define preload_cache( a)
-
-    __inline  Int32 shft_lft_1(Int32 L_var1)
-    {
-        if (((L_var1 << 1) >> 1) == L_var1)
-            L_var1 <<= 1;
-        else
-            L_var1 = ((L_var1 >> 31) ^ INT32_MAX);
-
-        return L_var1;
-
-    }
-
-    __inline  Int32 fxp_mul_16_by_16bb(Int32 L_var1,  Int32 L_var2)
-    {
-        L_var2 = (L_var2 << 16) >> 16;
-        L_var1 = (L_var1 << 16) >> 16;
-
-        return (L_var1*L_var2);
-
-    }
-
-#define fxp_mul_16_by_16(a, b)  fxp_mul_16_by_16bb(  a, b)
-
-    __inline  Int32 fxp_mul_16_by_16tb(Int32 L_var1,  Int32 L_var2)
-    {
-        L_var2 = (L_var2 << 16) >> 16;
-        L_var1 =  L_var1 >> 16;
-
-        return (L_var1*L_var2);
-
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16bt(Int32 L_var1,  Int32 L_var2)
-    {
-        L_var2 = L_var2 >> 16;
-        L_var1 = (L_var1 << 16) >> 16;
-
-        return (L_var1*L_var2);
-
-    }
-
-
-    __inline  Int32 fxp_mul_16_by_16tt(Int32 L_var1,  Int32 L_var2)
-    {
-        L_var2 = L_var2 >> 16;
-        L_var1 = L_var1 >> 16;
-
-        return (L_var1*L_var2);
-
-    }
-
-    __inline  Int32 fxp_mac_16_by_16(Int16 L_var1,  Int16 L_var2, Int32 L_add)
-    {
-        return (L_add + (L_var1*L_var2));
-    }
-
-
-
-    __inline  Int32 fxp_mac_16_by_16_bb(Int16 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        L_var2 = (L_var2 << 16) >> 16;
-
-        return (L_add + (L_var1*L_var2));
-
-    }
-
-
-    __inline  Int32 fxp_mac_16_by_16_bt(Int16 L_var1,  Int32 L_var2, Int32 L_add)
-    {
-        L_var2 = L_var2 >> 16;
-
-        return (L_add + (L_var1*L_var2));
-
-    }
-
-
-    __inline  Int32 cmplx_mul32_by_16(Int32 x, const Int32 y, Int32 exp_jw)
-    {
-        Int32  rTmp0 = (exp_jw >> 16) << 16;
-        Int32  iTmp0 = exp_jw << 16;
-        Int32  z;
-
-
-        z  = _MulHigh(rTmp0, x);
-        z += _MulHigh(iTmp0, y);
-
-        return (z);
-    }
-
-
-    __inline  Int32 fxp_mul32_by_16(Int32 L_var1, const Int32 L_var2)
-    {
-        Int32  rTmp0 = L_var2 << 16;
-
-        return(_MulHigh(rTmp0, L_var1));
-    }
-
-#define fxp_mul32_by_16b( a, b)   fxp_mul32_by_16( a, b)
-
-
-    __inline  Int32 fxp_mul32_by_16t(Int32 L_var1, const Int32 L_var2)
-    {
-        Int32  rTmp0 = (Int16)(L_var2 >> 16);
-
-        return(_MulHigh((rTmp0 << 16), L_var1));
-    }
-
-
-    __inline  Int32 fxp_mac32_by_16(const Int32 L_var1, const Int32 L_var2, Int32 L_add)
-    {
-
-        Int32  rTmp0 = (L_var2 << 16);
-
-        return(L_add + _MulHigh(rTmp0, L_var1));
-    }
-
-    __inline  int64 fxp_mac64_Q31(int64 sum, const Int32 L_var1, const Int32 L_var2)
-    {
-        sum += (int64)L_var1 * L_var2;
-        return (sum);
-    }
-
-#define fxp_mul32_Q31( a,  b)   _MulHigh( b, a)
-
-    __inline Int32 fxp_mac32_Q31(Int32 L_add, const Int32 a, const Int32 b)
-    {
-        return (L_add + _MulHigh(b, a));
-    }
-
-    __inline Int32 fxp_msu32_Q31(Int32 L_sub, const Int32 a, const Int32 b)
-    {
-        return (L_sub - _MulHigh(b, a));
-    }
-
-
-    __inline Int32 fxp_mul32_Q30(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 30);
-    }
-
-    __inline Int32 fxp_mac32_Q30(const Int32 a, const Int32 b, Int32 L_add)
-    {
-        return (L_add + (Int32)(((int64)(a) * b) >> 30));
-    }
-
-
-    __inline Int32 fxp_mul32_Q29(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 29);
-    }
-
-    __inline Int32 fxp_mac32_Q29(const Int32 a, const Int32 b, Int32 L_add)
-    {
-        return (L_add + (Int32)(((int64)(a) * b) >> 29));
-    }
-
-    __inline Int32 fxp_msu32_Q29(const Int32 a, const Int32 b, Int32 L_sub)
-    {
-        return (L_sub - (Int32)(((int64)(a) * b) >> 29));
-    }
-
-
-    __inline Int32 fxp_mul32_Q28(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 28);
-    }
-
-    __inline Int32 fxp_mul32_Q27(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 27);
-    }
-
-    __inline Int32 fxp_mul32_Q26(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 26);
-    }
-
-    __inline Int32 fxp_mul32_Q20(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 20);
-    }
-
-    __inline Int32 fxp_mul32_Q15(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 15);
-    }
-
-    __inline Int32 fxp_mul32_Q14(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 14);
-    }
-
-
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif   /*  FXP_MUL32  */
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32_c_msc_evc_armv5.h b/media/libstagefright/codecs/aacdec/fxp_mul32_c_msc_evc_armv5.h
deleted file mode 100644
index 04cbf49..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32_c_msc_evc_armv5.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: .fxp_mul32_msc_evc_armv5.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef FXP_MUL32_MSC_EVC_ARMV5
-#define FXP_MUL32_MSC_EVC_ARMV5
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#include "pv_audio_type_defs.h"
-
-#if defined(PV_ARM_MSC_EVC_V5)
-
-#include "armintr.h"
-#include "cmnintrin.h"
-
-#define preload_cache( a)
-
-#define shft_lft_1( L_var1)  _AddSatInt( L_var1, L_var1)
-
-#define fxp_mul_16_by_16bb( L_var1, L_var2)  _SmulLo_SW_SL( L_var1, L_var2)
-
-#define fxp_mul_16_by_16(a, b)  fxp_mul_16_by_16bb(  a, b)
-
-#define fxp_mul_16_by_16tb( L_var1, L_var2)  _SmulHiLo_SW_SL( L_var1, L_var2)
-
-#define fxp_mul_16_by_16bt( L_var1, L_var2)  _SmulLoHi_SW_SL( L_var1, L_var2)
-
-#define fxp_mul_16_by_16tt( L_var1, L_var2)  _SmulHi_SW_SL( L_var1, L_var2)
-
-#define fxp_mac_16_by_16( L_var1, L_var2, L_add)  _SmulAddLo_SW_SL( L_add, L_var1, L_var2)
-
-#define fxp_mac_16_by_16_bb(a, b, c)  fxp_mac_16_by_16(  a, b, c)
-
-#define fxp_mac_16_by_16_bt( L_var1, L_var2, L_add)  _SmulAddLoHi_SW_SL( L_add, L_var1, L_var2)
-
-
-    __inline  Int32 cmplx_mul32_by_16(Int32 L_var1, const Int32 L_var2, const Int32 cmplx)
-    {
-        Int32 result64_hi;
-
-        result64_hi = _SmulWHi_SW_SL(L_var1, cmplx);
-        result64_hi = _SmulAddWLo_SW_SL(result64_hi, L_var2, cmplx);
-
-        return (result64_hi);
-    }
-
-#define fxp_mul32_by_16( L_var1, L_var2)  _SmulWLo_SW_SL( L_var1, L_var2)
-
-#define fxp_mul32_by_16b( a, b)   fxp_mul32_by_16( a, b)
-
-#define fxp_mul32_by_16t( L_var1, L_var2)  _SmulWHi_SW_SL( L_var1, L_var2)
-
-#define fxp_mac32_by_16( L_var1, L_var2, L_add)  _SmulAddWLo_SW_SL( L_add, L_var1, L_var2)
-
-
-    __inline  int64 fxp_mac64_Q31(int64 sum, const Int32 L_var1, const Int32 L_var2)
-    {
-        sum += (int64)L_var1 * L_var2;
-        return (sum);
-    }
-
-#define fxp_mul32_Q31( a,  b)   _MulHigh( b, a)
-
-
-    __inline Int32 fxp_mac32_Q31(Int32 L_add, const Int32 a, const Int32 b)
-    {
-        return (L_add + _MulHigh(b, a));
-    }
-
-
-    __inline Int32 fxp_msu32_Q31(Int32 L_sub, const Int32 a, const Int32 b)
-    {
-        return (L_sub - _MulHigh(b, a));
-    }
-
-
-    __inline Int32 fxp_mul32_Q30(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 30);
-    }
-
-    __inline Int32 fxp_mac32_Q30(const Int32 a, const Int32 b, Int32 L_add)
-    {
-        return (L_add + (Int32)(((int64)(a) * b) >> 30));
-    }
-
-
-    __inline Int32 fxp_mul32_Q29(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 29);
-    }
-
-    __inline Int32 fxp_mac32_Q29(const Int32 a, const Int32 b, Int32 L_add)
-    {
-        return (L_add + (Int32)(((int64)(a) * b) >> 29));
-    }
-
-    __inline Int32 fxp_msu32_Q29(const Int32 a, const Int32 b, Int32 L_sub)
-    {
-        return (L_sub - (Int32)(((int64)(a) * b) >> 29));
-    }
-
-
-    __inline Int32 fxp_mul32_Q28(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 28);
-    }
-
-    __inline Int32 fxp_mul32_Q27(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 27);
-    }
-
-    __inline Int32 fxp_mul32_Q26(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 26);
-    }
-
-    __inline Int32 fxp_mul32_Q20(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 20);
-    }
-
-    __inline Int32 fxp_mul32_Q15(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 15);
-    }
-
-    __inline Int32 fxp_mul32_Q14(const Int32 a, const Int32 b)
-    {
-        return (Int32)(((int64)(a) * b) >> 14);
-    }
-
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif   /*  FXP_MUL32  */
-
diff --git a/media/libstagefright/codecs/aacdec/fxp_mul32_pentium.h b/media/libstagefright/codecs/aacdec/fxp_mul32_pentium.h
deleted file mode 100644
index 72862e7..0000000
--- a/media/libstagefright/codecs/aacdec/fxp_mul32_pentium.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: .fxp_mul32_pentium.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef FXP_MUL32_PENTIUM
-#define FXP_MUL32_PENTIUM
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-#include "pv_audio_type_defs.h"
-
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif   /*  FXP_MUL32  */
-
diff --git a/media/libstagefright/codecs/aacdec/gen_rand_vector.cpp b/media/libstagefright/codecs/aacdec/gen_rand_vector.cpp
deleted file mode 100644
index 08ccc4a..0000000
--- a/media/libstagefright/codecs/aacdec/gen_rand_vector.cpp
+++ /dev/null
@@ -1,512 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to remove instances of pow() and sqrt(), and
- optimized for inclusion in fixed-point version of decoder.
-
- Description:  Modified to include comments/optimizations from code review.
- Also, declared appropriate variables as type "const"
-
- Description:  Adopted strategy of "one q-format per sfb" strategy, which
- eliminated the array q-format from this function.  The q-format the
- random vector is stored in is now returned from the function.
-
- Description:  Completely redesigned the routine to allow a simplified
-        calculation of the adjusted noise, by eliminating the dependency
-        on the band_length. Added polynomial approximation for the
-        function 1/sqrt(power). Updated comments and pseudo-code
-
- Description:  Modified function description, pseudocode, etc.
-
- Description:
-    Modified casting to ensure proper operations for different platforms
-
- Description:
-    Eliminiated access to memory for noise seed. Now a local variable is
-    used. Also unrolled loops to speed up code.
-
- Description:
-    Modified pointer decrement to a pointer increment, to ensure proper
-    compiler behavior
-
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:    random_array[] = Array for storage of the power-scaled
-                             random values of length "band_length"
-            Int32
-
-            band_length    = Length of random_array[]
-            const Int
-
-            pSeed          = seed for random number generator
-            Int32*
-
-            power_scale    = scale factor for this particular band
-            const Int
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:   Function returns the q-format the random vector is stored in.
-
- Pointers and Buffers Modified:
-            random_array[] = filled with random numbers scaled
-            to the correct power as defined by the input value power_scale.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function generates a vector of uniformly distributed random numbers for
- the PNS block.  The random numbers are each scaled by a scale_factor,
- defined in Ref(2) as
-
- 2^(scale_factor/4)
- ------------------
-  sqrt(N*MEAN_NRG)
-
- where N == band_length, and MEAN_NRG is defined as...
-
-         N-1
-         ___
-     1   \
-    ---   >    x(i)^2
-     N   /__
-         i=0
-
- And x is the unscaled vector from the random number generator.
-
- This function takes advantage of the fact that the portion of the
- scale_factor that is divisible by 4 can be simply accounted for by varying
- the q-format.
-
- The scaling of the random numbers is thus broken into the
- equivalent equation below.
-
- 2^(scale_factor%4)   2^(floor(scale_factor/4))
- ------------------ *
-  sqrt(N*MEAN_NRG)
-
-
- 2^(scale_factor%4) is stored in a simple 4-element table.
- 2^(floor(scale_factor/4) is accounted for by adjusting the q-format.
- sqrt(N*MEAN_NRG) is calculated and implemented via a polynomial approximation.
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall produce uniformly distributed random 32-bit integers,
- with signed random values of average energy equal to the results of the ISO
- code's multiplying factor discussed in the FUNCTION DESCRIPTION section.
-
- Please see Ref (2) for a detailed description of the requirements.
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) Numerical Recipes in C     Second Edition
-        William H. Press        Saul A. Teukolsky
-        William T. Vetterling   Brian P. Flannery
-        Page 284
-
- (2) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.12 (Perceptual Noise Substitution)
-
- (3) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    power_adj = scale_mod_4[power_scale & 3];
-
-    power = 0;
-
-    FOR (k=band_length; k > 0; k--)
-
-        *(pSeed) = *(pSeed) * 1664525L;
-        *(pSeed) = *(pSeed) + 1013904223L;
-
-        temp = (Int)(*(pSeed) >> 16);
-
-        power = power + ((temp*temp) >> 6);
-
-        *(pArray) = (Int32)temp;
-
-        pArray = pArray + 1;
-
-    ENDFOR
-
-    k = 0;
-    q_adjust = 30;
-
-    IF (power)
-    THEN
-
-        WHILE ( power > 32767)
-
-            power = power >> 1;
-            k = k + 1;
-
-        ENDWHILE
-
-        k = k - 13;
-
-        IF (k < 0)
-        THEN
-            k = -k;
-            IF ( k & 1 )
-            THEN
-                power_adj = (power_adj*SQRT_OF_2)>>14;
-            ENDIF
-            q_adjust = q_adjust - ( k >> 1);
-
-        ELSE IF (k > 0)
-        THEN
-            IF ( k & 1  )
-            THEN
-                power_adj = (power_adj*INV_SQRT_OF_2)>>14;
-            ENDIF
-            q_adjust = q_adjust + ( k >> 1);
-        ENDIF
-
-        pInvSqrtCoeff = inv_sqrt_coeff;
-
-        inv_sqrt_power  = (*(pInvSqrtCoeff)* power) >>15;
-
-        pInvSqrtCoeff = pInvSqrtCoeff + 1;
-
-        inv_sqrt_power = inv_sqrt_power + *(pInvSqrtCoeff);
-
-        pInvSqrtCoeff = pInvSqrtCoeff + 1;
-
-        FOR ( k=INV_SQRT_POLY_ORDER - 1; k>0; k--)
-
-            inv_sqrt_power  =  ( inv_sqrt_power * power)>>15;
-
-            inv_sqrt_power = inv_sqrt_power + *(pInvSqrtCoeff);
-
-            pInvSqrtCoeff = pInvSqrtCoeff + 1;
-
-        ENDFOR
-
-        inv_sqrt_power = (inv_sqrt_power*power_adj)>>13;
-
-        FOR (k=band_length; k > 0; k--)
-
-            pArray = pArray - 1;
-
-            *(pArray) = *(pArray)*inv_sqrt_power;
-
-        ENDFOR
-
-    ENDIF
-
-    q_adjust = q_adjust - (power_scale >> 2);
-
-    return q_adjust;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "gen_rand_vector.h"
-#include    "window_block_fxp.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define     SQRT_OF_2       23170       /*    sqrt(2) in Q14  */
-#define     INV_SQRT_OF_2   11585       /*  1/sqrt(2) in Q14  */
-#define     INV_SQRT_POLY_ORDER     4
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-
-/*
- *  2^([0:3]/4) = 1.0000    1.1892    1.4142    1.6818
- */
-const UInt scale_mod_4[4] = { 16384, 19484, 23170, 27554};
-
-/*
- *  polynomial approx. in Q12 (type Int)
- */
-
-const Int  inv_sqrt_coeff[INV_SQRT_POLY_ORDER+1] =
-    { 4680, -17935, 27697, -22326, 11980};
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int gen_rand_vector(
-    Int32     random_array[],
-    const Int band_length,
-    Int32*   pSeed,
-    const Int power_scale)
-{
-
-    Int      k;
-    UInt     power_adj;
-    Int      q_adjust = 30;
-
-    Int32    temp;
-    Int32    seed;
-    Int32    power;
-
-    Int32*   pArray = &random_array[0];
-
-    Int32    inv_sqrt_power;
-    const Int  *pInvSqrtCoeff;
-
-    /*
-     *  The out of the random number generator is scaled is such a way
-     *  that is independent of the band length.
-     *  The output is computed as:
-     *
-     *                  x(i)
-     *  output = ------------------ * 2^(power_scale%4) 2^(floor(power_scale/4))
-     *                   bl
-     *           sqrt(  SUM x(i)^2 )
-     *                   0
-     *
-     *  bl == band length
-     */
-
-
-    /*
-     *  get 2^(power_scale%4)
-     */
-
-
-    power = 0;
-
-    seed = *pSeed;
-
-    /*
-     *  band_length is always an even number (check tables in pg.66 IS0 14496-3)
-     */
-    if (band_length < 0 || band_length > LONG_WINDOW)
-    {
-        return  q_adjust;     /*  avoid any processing on error condition */
-    }
-
-    for (k = (band_length >> 1); k != 0; k--)
-    {
-        /*------------------------------------------------
-           Numerical Recipes in C
-                    Page 284
-        ------------------------------------------------*/
-        seed *= 1664525L;
-        seed += 1013904223L;
-
-        temp =  seed >> 16;
-
-        seed *= 1664525L;
-        seed += 1013904223L;
-
-        /* shift by 6 make room for band length accumulation  */
-        power  += ((temp * temp) >> 6);
-        *pArray++ = temp;
-
-        temp    = seed >> 16;
-        power  += ((temp * temp) >> 6);
-        *pArray++ = temp;
-
-    } /* END for (k=half_band_length; k > 0; k--) */
-
-
-    *pSeed = seed;
-
-    /*
-     *  If the distribution is uniform, the power is expected to use between
-     *  28 and 27 bits, by shifting down by 13 bits the power will be a
-     *  Q15 number.
-     *  For different band lengths, the power uses between 20 and 29 bits
-     */
-
-
-    k = 0;
-
-    if (power)
-    {
-        /*
-         *    approximation requires power  between 0.5 < power < 1 in Q15.
-         */
-
-        while (power > 32767)
-        {
-            power >>= 1;
-            k++;
-        }
-
-        /*
-         *  expected power bit usage == 27 bits
-         */
-
-        k -= 13;
-
-        power_adj = scale_mod_4[power_scale & 3];
-
-        if (k < 0)
-        {
-            k = -k;
-            if (k & 1)
-            {                               /* multiply by sqrt(2)  */
-                power_adj = (UInt)(((UInt32) power_adj * SQRT_OF_2) >> 14);
-            }
-            q_adjust -= (k >> 1);    /* adjust Q instead of shifting up */
-        }
-        else if (k > 0)
-        {
-            if (k & 1)
-            {                               /* multiply by 1/sqrt(2)  */
-                power_adj = (UInt)(((UInt32) power_adj * INV_SQRT_OF_2) >> 14);
-            }
-            q_adjust += (k >> 1);   /* adjust Q instead of shifting down */
-        }
-
-        /*
-         *    Compute 1/sqrt(power), where 0.5 < power < 1.0 is approximated
-         *    using a polynomial order INV_SQRT_POLY_ORDER
-         */
-
-        pInvSqrtCoeff = inv_sqrt_coeff;
-
-        inv_sqrt_power  = (*(pInvSqrtCoeff++) * power) >> 15;
-        inv_sqrt_power += *(pInvSqrtCoeff++);
-        inv_sqrt_power  = (inv_sqrt_power * power) >> 15;
-        inv_sqrt_power += *(pInvSqrtCoeff++);
-        inv_sqrt_power  = (inv_sqrt_power * power) >> 15;
-        inv_sqrt_power += *(pInvSqrtCoeff++);
-        inv_sqrt_power  = (inv_sqrt_power * power) >> 15;
-        inv_sqrt_power += *(pInvSqrtCoeff);
-
-        inv_sqrt_power  = (inv_sqrt_power * power_adj) >> 13;
-
-        pArray = &random_array[0];
-
-        for (k = (band_length >> 1); k != 0; k--)
-        {
-            temp        = *(pArray) * inv_sqrt_power;
-            *(pArray++) = temp;
-            temp        = *(pArray) * inv_sqrt_power;
-            *(pArray++) = temp;
-        } /* END for (k=half_band_length; k > 0; k--) */
-
-    }   /* if(power) */
-
-    /*
-     *      Adjust Q with the value corresponding to 2^(floor(power_scale/4))
-     */
-
-    q_adjust  -= (power_scale >> 2);
-
-    return (q_adjust);
-
-} /* gen_rand_vector */
diff --git a/media/libstagefright/codecs/aacdec/gen_rand_vector.h b/media/libstagefright/codecs/aacdec/gen_rand_vector.h
deleted file mode 100644
index 17b5490..0000000
--- a/media/libstagefright/codecs/aacdec/gen_rand_vector.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: gen_rand_vector.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Added include of pv_audio_type_defs.h
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file contains the function declaration for gen_rand_vector.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef gen_rand_vector_H
-#define gen_rand_vector_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-Int gen_rand_vector(
-    Int32  random_array[],
-    const Int    band_length,
-    Int32 *pSeed,
-    const Int    power_scale);
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/get_adif_header.cpp b/media/libstagefright/codecs/aacdec/get_adif_header.cpp
deleted file mode 100644
index 8a1e74b..0000000
--- a/media/libstagefright/codecs/aacdec/get_adif_header.cpp
+++ /dev/null
@@ -1,443 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_adif_header.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  Change to PV template, remove default config parameter,
-               move some functionality into get_prog_config().
-
- Description: Update per code review
-              1) Add parameter pScratchPCE
-              2) Change way ADIF_ID is read in.
-              3) Fix comments
-              4) ADD a test for status != SUCCESS in loop.
-
- Description: The ADIF_Header has now been delegated to the "scratch memory"
- union.  This change inside s_tDec_Int_File.h had to be reflected here also.
-
- Description: Updated the SW template to include the full pathname to the
- source file and a slightly modified copyright header.
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pVars        = pointer to the structure that contains the current state
-                   of this instance of the library, of data type pointer to
-                   tDec_Int_File
-
-    pScratchPCE  = pointer to a ProgConfig structure used as scratch in the
-                   the function get_prog_config. of data type pointer to
-                   ProgConfig
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-    The function returns 0 if no error occurred, non-zero otherwise.
-
- Pointers and Buffers Modified:
-    pVars->adif_header contents are updated with the some of the ADIF header
-           contents
-    pVars->tempProgConfig contents are overwritten with last PCE found,
-           which is most likely the first one found.
-    pVars->prog_config contents are updated with the first PCE found.
-    pVars->inputStream contents are modify in such a way that the
-           stream is moved further along in the buffer.
-    pVars->SFBWidth128 contents may be updated.
-    pVars->winSeqInfo  contents may be updated.
-    pScratchPCE        contents may be updated.
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function reads in the ADIF Header found at the front of ADIF streams.
- If the header is not found an error is returned. An ADIF header can contain
- from zero to sixteen program configuration elements (PCE). This function, and
- the rest of the library, saves and uses the first PCE found.
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- Function shall not use static or global variables.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 13818-7:1997 Titled "Information technology - Generic coding
-   of moving pictures and associated audio information - Part 7: Advanced
-   Audio Coding (AAC)", Table 6.21 - Syntax of program_config_element(),
-   page 16, and section 8.5 "Program Config Element (PCE)", page 30.
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-     CALL getbits(
-        neededBits = 2 * LEN_BYTE,
-        pInputStream = pInputStream)
-     MODIFYING( pInputStream )
-     RETURNING( theIDFromFile )
-
-     CALL getbits(
-        neededBits = 2 * LEN_BYTE,
-        pInputStream = pInputStream)
-     MODIFYING( pInputStream )
-     RETURNING( temp )
-
-    theIDFromFile = (theIDFromFile << (2*LEN_BYTE)) | temp;
-
-    IF (theIDFromFile != ADIF_ID)
-    THEN
-
-        pInputStream->usedBits -= (4 * LEN_BYTE);
-
-        status = -1;
-    ELSE
-        CALL getbits(
-            neededBits = LEN_COPYRT_PRES,
-            pInputStream = pInputStream)
-        MODIFYING( pInputStream )
-        RETURNING( temp )
-
-        IF (temp != FALSE) THEN
-            FOR (i = LEN_COPYRT_ID; i > 0; i--)
-               CALL getbits(
-                   neededBits = LEN_BYTE,
-                   pInputStream = pInputStream)
-               MODIFYING( pInputStream )
-
-            END FOR
-        END IF
-
-        CALL getbits(
-            neededBits = LEN_ORIG + LEN_HOME,
-            pInputStream = pInputStream)
-        MODIFYING( pInputStream )
-
-        CALL getbits(
-            neededBits = LEN_BS_TYPE,
-            pInputStream = pInputStream)
-        MODIFYING( pInputStream )
-        RETURNING( bitStreamType )
-
-        CALL getbits(
-            neededBits = LEN_BIT_RATE,
-            pInputStream = pInputStream)
-        MODIFYING( pInputStream )
-        RETURNING( pHeader->bitrate )
-
-        CALL getbits(
-            neededBits = LEN_NUM_PCE,
-            pInputStream = pInputStream)
-        MODIFYING( pInputStream )
-        RETURNING( numConfigElementsMinus1 )
-
-        FOR (  i = numConfigElementsMinus1;
-              (i >= 0) && (status == SUCCESS);
-               i--)
-
-            IF (bitStreamType == CONSTANT_RATE_BITSTREAM) THEN
-               CALL getbits(
-                   neededBits = LEN_ADIF_BF,
-                   pInputStream = pInputStream)
-               MODIFYING( pInputStream )
-            END IF
-
-            CALL get_prog_config(
-                pVars = pVars)
-            MODIFYING( pVars->prog_config )
-            RETURNING( status )
-
-        END FOR
-    END IF
-
-    RETURN (status)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_adif_const.h"
-
-#include "s_progconfig.h"
-#include "s_adif_header.h"
-#include "s_bits.h"
-#include "s_mc_info.h"
-#include "s_frameinfo.h"
-#include "s_tdec_int_file.h"
-
-#include "get_prog_config.h"
-#include "ibstream.h"
-
-#include "get_adif_header.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*
- * This constant is simply the characters 'A' 'D' 'I' 'F' compressed into
- * a UInt32. Any possible endian problems that exist must be solved by
- * the function that fills the buffer and getbits(), or this constant and
- * the rest of the bit stream will not work.
- */
-#define ADIF_ID (0x41444946)
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-Int get_adif_header(
-    tDec_Int_File *pVars,
-    ProgConfig    *pScratchPCE)
-{
-    Int          i;
-    UInt32       temp;
-    Int          numConfigElementsMinus1;
-    Int          bitStreamType;
-    UInt32       theIDFromFile;
-
-    BITS        *pInputStream = &pVars->inputStream;
-    ADIF_Header *pHeader = &pVars->scratch.adif_header;
-    Int          status  = SUCCESS;
-
-    /*
-     * The ADIF_ID field is 32 bits long, one more than what getbits() can
-     * do, so read the field in two parts. There is no point in saving the
-     * string - it either matches or it does not. If it matches, it must
-     * have been 'ADIF'
-     */
-
-    theIDFromFile = get17_n_lessbits((2 * LEN_BYTE), pInputStream);
-
-    temp          = get17_n_lessbits((2 * LEN_BYTE), pInputStream);
-
-    theIDFromFile = (theIDFromFile << (2 * LEN_BYTE)) | temp;
-
-
-    if (theIDFromFile != ADIF_ID)
-    {
-        /*
-         * Rewind the bit stream pointer so a search for ADTS header
-         * can start at the beginning.
-         */
-
-        pInputStream->usedBits -= (4 * LEN_BYTE);
-
-        /*
-         * The constant in the next line needs to be updated when
-         * error handling method is determined.
-         */
-        status = -1;
-    }
-    else
-    {
-        /*
-         * To save space, the unused fields are read in, but not saved.
-         */
-
-        /* copyright string */
-        temp =
-            get1bits(/*                LEN_COPYRT_PRES,*/
-                pInputStream);
-
-        if (temp != FALSE)
-        {
-            /*
-             * Read in and ignore the copyright string. If restoring
-             * watch out for count down loop.
-             */
-
-            for (i = LEN_COPYRT_ID; i > 0; i--)
-            {
-                get9_n_lessbits(LEN_BYTE,
-                                pInputStream);
-            } /* end for */
-
-            /*
-             * Make sure to terminate the string with '\0' if restoring
-             * the the copyright string.
-             */
-
-        } /* end if */
-
-        /* Combine the original/copy and fields into one call */
-        get9_n_lessbits(
-            LEN_ORIG + LEN_HOME,
-            pInputStream);
-
-        bitStreamType =
-            get1bits(/*                LEN_BS_TYPE,*/
-                pInputStream);
-
-        pHeader->bitrate =
-            getbits(
-                LEN_BIT_RATE,
-                pInputStream);
-
-        /*
-         * Read in all the Program Configuration Elements.
-         * For this library, only one of the up to 16 possible PCE's will be
-         * saved. Since each PCE must be read, a temporary PCE structure is
-         * used, and if that PCE is the one to use, it is copied into the
-         * single PCE. This is done inside of get_prog_config()
-         */
-
-        numConfigElementsMinus1 =  get9_n_lessbits(LEN_NUM_PCE,
-                                   pInputStream);
-
-        for (i = numConfigElementsMinus1;
-                (i >= 0) && (status == SUCCESS);
-                i--)
-        {
-            /*
-             * For ADIF contant bit rate streams, the _encoder_ buffer
-             * fullness is transmitted. This version of an AAC decoder has
-             * no use for this variable; yet it must be read in to move
-             * the bitstream pointers.
-             */
-
-            if (bitStreamType == CONSTANT_RATE_BITSTREAM)
-            {
-                getbits(
-                    LEN_ADIF_BF,
-                    pInputStream);
-            } /* end if */
-
-            pVars->adif_test = 1;
-            /* Get one program configuration element */
-            status =
-                get_prog_config(
-                    pVars,
-                    pScratchPCE);
-
-#ifdef AAC_PLUS
-
-            /*
-             *  For implicit signalling, no hint that sbr or ps is used, so we need to
-             *  check the sampling frequency of the aac content, if lesser or equal to
-             *  24 KHz, by defualt upsample, otherwise, do nothing
-             */
-            if ((pVars->prog_config.sampling_rate_idx >= 6) && (pVars->aacPlusEnabled == true) &&
-                    pVars->mc_info.audioObjectType == MP4AUDIO_AAC_LC)
-            {
-                pVars->mc_info.upsamplingFactor = 2;
-                pVars->prog_config.sampling_rate_idx -= 3;
-                pVars->mc_info.sbrPresentFlag = 1;
-                pVars->sbrDecoderData.SbrChannel[0].syncState = UPSAMPLING;
-                pVars->sbrDecoderData.SbrChannel[1].syncState = UPSAMPLING;
-            }
-#endif
-
-
-
-        } /* end for */
-
-
-    } /* end 'else' of --> if (theIDFromFile != ADIF_ID) */
-
-    return status;
-
-} /* end get_adif_header */
diff --git a/media/libstagefright/codecs/aacdec/get_adif_header.h b/media/libstagefright/codecs/aacdec/get_adif_header.h
deleted file mode 100644
index 8bc3411..0000000
--- a/media/libstagefright/codecs/aacdec/get_adif_header.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_adif_header.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Add parameter to get_adif_header() function.
-
- Who:                                      Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for get_adif_header.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_ADIF_HEADER_H
-#define GET_ADIF_HEADER_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_tdec_int_file.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define CONSTANT_RATE_BITSTREAM  (0)
-#define VARIABLE_RATE_BITSTREAM  (1)
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-Int get_adif_header(
-    tDec_Int_File *pVars,
-    ProgConfig    *pScratchPCE);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_adts_header.cpp b/media/libstagefright/codecs/aacdec/get_adts_header.cpp
deleted file mode 100644
index 3ac2756..0000000
--- a/media/libstagefright/codecs/aacdec/get_adts_header.cpp
+++ /dev/null
@@ -1,672 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_adts_header.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Remove default_config variable
-
- Description: change enter_mc_info to set_mc_info
-
- Description: (1) add error checking for channel_config > 2
-              (2) eliminated call to check_mc_info
-              (3) use (profile + 1) when calling set_mc_info
-              (4) use winmap when calling set_mc_info
-
- Who:                                          Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pVars           =   Pointer to structure that holds file-scope variables.
-                        [ tDec_Int_File * ]
-
-    pSyncword       =   Pointer to variable that holds the 28-bit fixed
-                        header upon the exit of this function. [ UInt32 * ]
-
-    pInvoke         =   Pointer to variable that keeps track of how many
-                        "short" (14 bit) headers have been successfully
-                        parsed from the bitstream. [ Int * ]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    Status = SUCCESS or ERROR CODE
-
- Pointers and Buffers Modified:
-    pVars->prog_config   Updated with program information data as read from
-                         the ADTS header.
-
-    pSyncword            Value pointed to is updated with the contents of
-                         the 28-bit fixed header.
-
-    pInvoke              Value pointed to is updated to reflect the number
-                         of successful "short" (14 bit) headers that have
-                         been successfully parsed from the bitstream.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- Acronym Definitions
- ADTS  Audio Data Transport Stream
- CRC   Cyclic Redundancy Code
-
- This function calls find_adts_syncword to find the next ADTS header.  Until
- three consistent headers have been read, the syncword used for detection
- consists of the 12-bit syncword and the 2-bit Layer.  After three consistent
- headers are read, the entire fixed header is used for a robust 28-bit
- syncword.
-
- Configuration information is then extracted from the bitstream.
-
- The bitstream information is packed as follows.
- Comments about the correct interpretation of these bits are contained within
- the code.
-
-                                      CRC_absent    sampling_rate_idx
-                                           \               / \
-                                            \             /   \
-                                             \  Profile  /     \  UNUSED
-                                              \   / \   /       \   /
-|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|
- \         _______________         / |   \  /                         \      /
-  \-------|0xFFF syncword |-------/  |   Layer == '00' for AAC         \    /
-           \-------------/           |                                  \  /
-                                     |                                   \/
-                                     ID == '1' for MPEG-2 AAC    channel_config
-       copyright_id_bit                 == '0' for MPEG-4 AAC
-          /
-    home /
-     /  /
-|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|
-  |        \  \          _____________           /
-  |         \  \--------|frame length |---------/
-  orig_copy  \           \-----------/
-              \                                  ______________________________
-        copyright_id_start                      | TOTAL HEADER LENGTH: 56 bits|
-                                                |-----------------------------|
-|43|44|45|46|47|48|49|50|51|52|53|54|55|        | FIXED    HEADER BITS 00-27  |
-  \       _______________      /  |   |         | VARIABLE HEADER BITS 28-55  |
-   \-----|buffer_fullness|----/    \ /          |_____________________________|
-          \-------------/           |
-                              headerless_frames
-
- In addition to the bits displayed above, if the value CRC_absent is '0' an
- additional 16 bits corresponding to a CRC word are read from the bitstream,
- following the header.
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- After the ADTS syncword is detected, this function shall parse the
- information residing behind the syncword in the bitstream.
-------------------------------------------------------------------------------
- REFERENCES
- (1) ISO/IEC 13818-7:1997(E)
-     Part 7
-        Subpart 6.2 (Audio_Data_Transport_Stream frame, ADTS)
-
- (2) ISO/IEC 11172-3:1993(E)
-     Part 3
-        Subpart 2.4.3 The audio decoding process
-
- (3) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those UIntending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    IF (*(pInvoke) > 3)
-
-         CALL find_adts_syncword(
-                    pSyncword,
-                   &(pVars->inputStream),
-                    LENGTH_FIXED_HEADER,
-                    MASK_28BITS);
-           RETURNING  status
-    ELSE
-
-        *(pSyncword) = SYNCWORD_15BITS;
-
-        CALL find_adts_syncword(
-                   pSyncword,
-                  &(pVars->inputStream),
-                   LENGTH_SYNCWORD,
-                   ID_BIT_FILTER);
-
-          MODIFYING  *(pSyncword) = 28-bit fixed header (long syncword)
-          RETURNING  status
-
-        CALL getbits(
-                (LENGTH_FIXED_HEADER - LENGTH_SYNCWORD),
-               &(pVars->inputStream));
-
-          MODIFYING pVars->inputStream
-          RETURNING adts_header = remaining bits in the fixed header
-
-        *(pSyncword) <<= 13;
-        *(pSyncword) = *(pSyncword) OR adts_header;
-
-        pVars->prog_config.CRC_absent  = ((UInt)(adts_header >> 12)) AND 0x0001;
-
-        lower_16 = (UInt)adts_header;
-
-        pVars->prog_config.profile = (lower_16 >> 10) AND 0x3;
-
-        pVars->prog_config.sampling_rate_idx = (lower_16 >> 6) AND 0xF;
-
-        channel_configuration = (lower_16 >> 2) AND 0x7;
-
-        channel_configuration = channel_configuration - 1;
-        pVars->prog_config.front.ele_is_cpe[0] = channel_configuration;
-
-        pVars->prog_config.front.num_ele    = 1;
-
-        pVars->prog_config.front.ele_tag[0] = 0;
-
-        pVars->prog_config.mono_mix.present = 0;
-        pVars->prog_config.stereo_mix.present = 0;
-        pVars->prog_config.matrix_mix.present = 0;
-
-        CALL set_mc_info(
-                &(pVars->mc_info),
-                &(pVars->savedMCInfo),
-                &(pVars->prog_config),
-                  pVars->pWinSeqInfo,
-                  pVars->SFBWidth128);
-          MODIFYING pVars->mc_info = multi-channel configuration information
-          RETURNING status         = SUCCESS/FAILURE
-
-        IF ( (*pInvoke) != 0)
-            CALL check_mc_info(
-                    &(pVars->mc_info),
-                    &(pVars->savedMCInfo),
-                     FALSE);
-              RETURNING status = SUCCESS/FAILURE
-        ELSE
-            CALL check_mc_info(
-                    &(pVars->mc_info),
-                    &(pVars->savedMCInfo),
-                     TRUE);
-              MODIFYING pVars->savedMCInfo = pVars->mc_info
-              RETURNING status = SUCCESS/FAILURE
-        ENDIF
-
-        IF (status == SUCCESS)
-            (*pInvoke) = (*pInvoke) + 1;
-        ELSE
-            (*pInvoke) = 0;
-        ENDIF
-
-    ENDIF
-
-    CALL getbits(
-            LENGTH_VARIABLE_HEADER,
-           &(pVars->inputStream));
-      RETURNING adts_header = 28-bits (the contents of the variable header.)
-
-    pVars->prog_config.frame_length  = ((UInt)(adts_header >> 13)) AND 0x1FFF;
-
-    lower_16 = (UInt)adts_header;
-
-    pVars->prog_config.buffer_fullness = (lower_16 >> 2) AND 0x7FF;
-
-    pVars->prog_config.headerless_frames = (lower_16 AND 0x0003);
-
-    IF (pVars->prog_config.CRC_absent == 0)
-
-        CALL getbits(
-                LENGTH_CRC,
-               &(pVars->inputStream) );
-          RETURNING pVars->prog_config.CRC_check = 16-bit CRC
-
-    ENDIF
-
-    pVars->default_config = 0;
-
-    IF (byte_align_offset > 7)
-        status = 1;
-    ENDIF
-
-    return (status);
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_bits.h"
-#include "s_tdec_int_file.h"
-#include "ibstream.h"
-#include "set_mc_info.h"
-#include "find_adts_syncword.h"
-#include "get_adts_header.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define LENGTH_VARIABLE_HEADER  28
-#define LENGTH_FIXED_HEADER     28
-#define LENGTH_SYNCWORD         15
-#define LENGTH_CRC              16
-
-#define ID_BIT_FILTER           0x7FFB
-#define SYNCWORD_15BITS         0x7FF8
-#define MASK_28BITS             0x0FFFFFFFL
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int get_adts_header(
-    tDec_Int_File *pVars,
-    UInt32        *pSyncword,
-    Int           *pInvoke,
-    Int            CorrectlyReadFramesCount)
-{
-    UInt32 adts_header;
-    UInt   lower_16;
-    Int    status = SUCCESS;
-    UInt   channel_configuration;
-
-    /*
-     * Search for the LONG ADTS syncword (comprised of the entire fixed header)
-     * if the number of CorrectlyReadFrames is > CorrectlyReadFramesCount
-     *
-     * Otherwise, search for just the short syncword.
-     */
-    if (*(pInvoke) > CorrectlyReadFramesCount)
-    {
-        /*
-         * Find the long ADTS syncword
-         * (comprised of the entire ADTS fixed header)
-         */
-
-        status = find_adts_syncword(pSyncword,
-                                    &(pVars->inputStream),
-                                    LENGTH_FIXED_HEADER,
-                                    MASK_28BITS);
-    }
-    else
-    {
-
-        *(pSyncword) = SYNCWORD_15BITS;
-
-        status = find_adts_syncword(pSyncword,
-                                    &(pVars->inputStream),
-                                    LENGTH_SYNCWORD,
-                                    ID_BIT_FILTER);
-
-        /*
-         *  Extract the data from the header following the syncword
-         */
-        adts_header = getbits((LENGTH_FIXED_HEADER - LENGTH_SYNCWORD),
-                              &(pVars->inputStream));
-
-        *(pSyncword) <<= (LENGTH_FIXED_HEADER - LENGTH_SYNCWORD);
-        *(pSyncword)  |= adts_header;
-
-        /* Denotes whether a CRC check should be performed */
-        pVars->prog_config.CRC_absent  = ((UInt)(adts_header >> 12)) & 0x0001;
-
-        /*
-         * All the unread bits in adts_header reside in the lower
-         * 16-bits at this point.  Perform a typecast for faster
-         * execution on 16-bit processors.
-         */
-        lower_16 = (UInt)adts_header;
-
-        /*
-         * Profile consists of 2 bits, which indicate
-         * the profile used.
-         *
-         * '00' AAC_MAIN profile
-         * '01' AAC_LC (Low Complexity) profile
-         * '10' AAC_SSR (Scaleable Sampling Rate) profile
-         * '11' AAC_LTP (Long Term Prediction) profile
-         */
-        pVars->prog_config.profile = (lower_16 >> 10) & 0x3;
-
-        if (pVars->prog_config.profile == MP4AUDIO_AAC_SSR)
-        {
-            status = 1;     /* Not supported */
-        }
-
-        /*
-         * Sampling_rate_idx consists of 4 bits
-         * see Ref #1 for their interpretation.
-         */
-        pVars->prog_config.sampling_rate_idx = (lower_16 >> 6) & 0xF;
-
-        /*
-         * private_bit is a bit for private use.  ISO/IEC will not make
-         * use of this bit in the future.
-         *
-         * We currently make no use of it, but parsing the information
-         * from the bitstream could be easily implemented with the
-         * following instruction...
-         *
-         * private_bit = (lower_16 & 0x0400) >> 10;
-         */
-
-        /*
-         * These 3 bits indicate the channel configuration used.
-         *
-         * If '0' then the channel configuration is unspecified here,
-         * and must be given by a program configuration element in
-         * the raw data block.
-         *
-         * If '1' then the channel configuration is MONO.
-         * If '2' then the channel configuration is STEREO
-         *
-         * 3-7 represent channel configurations which this library
-         * will not support in the forseeable future.
-         */
-        channel_configuration = (lower_16 >> 2) & 0x7;
-        /* do not support more than 2 channels */
-        if (channel_configuration > 2)
-        {
-            status = 1;
-        }
-
-        /*
-         * The following 2 bits encode copyright information.
-         * original_copy is '0' if there is no copyright in the bitstream.
-         *                  '1' if the bitstream is copyright protected.
-         *
-         * home is '0' for a copy, '1' for an original.
-         *
-         * PacketVideo currently does nothing with this information,
-         * however, parsing the data from the bitstream could be easily
-         * implemented with the following instructions...
-         *
-         * original_copy = (lower_16 >> 1) & 0x1;
-         *
-         * home = (lower_16 & 0x1);
-         *
-         */
-
-        /* Set up based on information extracted from the ADTS FIXED header */
-
-        /* This equals 1 for STEREO, 0 for MONO */
-        if (channel_configuration)
-        {
-            channel_configuration--;
-        }
-        pVars->prog_config.front.ele_is_cpe[0] = channel_configuration;
-
-        /* This value is constant for both MONO and STEREO */
-        pVars->prog_config.front.num_ele    = 1;
-
-        /* ADTS does not specify this tag value - do we even use it? */
-        pVars->prog_config.front.ele_tag[0] = 0;
-
-        /* Disable all mix related variables */
-        pVars->prog_config.mono_mix.present = 0;
-        pVars->prog_config.stereo_mix.present = 0;
-        pVars->prog_config.matrix_mix.present = 0;
-
-        /* enter configuration into MC_Info structure */
-        if (status == SUCCESS)
-        {
-            /* profile + 1 == audioObjectType */
-            status =
-                set_mc_info(
-                    &(pVars->mc_info),
-                    (tMP4AudioObjectType)(pVars->prog_config.profile + 1),
-                    pVars->prog_config.sampling_rate_idx,
-                    pVars->prog_config.front.ele_tag[0],
-                    pVars->prog_config.front.ele_is_cpe[0],
-                    pVars->winmap, /* changed from pVars->pWinSeqInfo, */
-                    pVars->SFBWidth128);
-
-        } /* if (status == SUCCESS) */
-
-
-#ifdef AAC_PLUS
-
-        /*
-         *  For implicit signalling, no hint that sbr or ps is used, so we need to
-         *  check the sampling frequency of the aac content, if lesser or equal to
-         *  24 KHz, by defualt upsample, otherwise, do nothing
-         */
-        if ((pVars->prog_config.sampling_rate_idx >= 6) && (pVars->aacPlusEnabled == TRUE))
-        {
-            pVars->mc_info.upsamplingFactor = 2;
-            pVars->prog_config.sampling_rate_idx -= 3;
-            pVars->mc_info.sbrPresentFlag = 1;
-            pVars->sbrDecoderData.SbrChannel[0].syncState = SBR_ACTIVE;
-            pVars->sbrDecoderData.SbrChannel[1].syncState = SBR_ACTIVE;
-        }
-#endif
-
-
-        /*
-         * The tag and is_cpe will be checked in huffdecode,
-         * remove this check routine.
-         */
-        /*if (status == SUCCESS)
-         *{
-         *   if ( (*pInvoke) != 0)
-         *   {
-         *       status =
-         *           check_mc_info(
-         *               &(pVars->mc_info),
-         *               &(pVars->savedMCInfo),
-         *               FALSE);
-         *   }
-         *   else
-         *   {
-         *       status =
-         *           check_mc_info(
-         *               &(pVars->mc_info),
-         *               &(pVars->savedMCInfo),
-         *               TRUE);
-         *   }
-         *
-         *}*/ /* if (status == SUCCESS) */
-
-        /*
-         * This keeps track of how many headers have been read in the file.
-         * After the three successful headers with the same configuration
-         * are read in, the entire ADTS fixed header is used as the syncword
-         * for a more robust 28-bit long syncword
-         */
-
-        if (status == SUCCESS)
-        {
-            (*pInvoke)++;
-        }
-        else
-        {
-            (*pInvoke) = 0;
-        }
-
-    } /* END if (*(pInvoke) > 3) */
-
-    /* Grab the bits in the ADTS variable header */
-    adts_header = getbits(
-                      LENGTH_VARIABLE_HEADER,
-                      &(pVars->inputStream));
-    /*
-     * copyright_identification bit is a single bit of the 72-bit
-     * copyright_id field.  This consists of a 8-bit copyright identifier
-     * and a 64-bit copyright_number.  72 headers must be decoded
-     * to reconstruct the entire copyright_id field.
-     *
-     * copyright_identification_start is a single bit flagging
-     * the beginning bit of the copyright_id field.  '1' for start of
-     * copyright_id, '0' otherwise.
-     *
-     *
-     * PacketVideo currently does nothing with this information,
-     * however, parsing the data from the bitstream could be easily
-     * implemented with the following instructions...
-     *
-     * copyright_id_bit = ((UInt)(adts_header >> 27)) & 0x1;
-     *
-     * copyright_id_start = ((UInt)(adts_header >> 26)) & 0x1;
-     */
-
-    /*
-     * frame_length is a 13-bit field which indicates the length,
-     * in bytes, of the frame including error_check and headers.
-     * This information can theoretically be used to help verify syncwords.
-     */
-    pVars->prog_config.frame_length  = ((UInt)(adts_header >> 13)) & 0x1FFF;
-
-    /*
-     * All the unread bits in adts_header reside in the lower
-     * 16-bits at this point.  Perform a typecast for faster
-     * execution on 16-bit processors.
-     */
-    lower_16 = (UInt)adts_header;
-
-    /*
-     * Indicates the number of 32-bit words remaining in the
-     * encoder buffer after the encoding of the first raw
-     * data block.  This value is 0x7ff for variable bit
-     * rate encoders, since buffer fullness does not apply
-     * to Variable Bit Rate (VBR) encoders.
-     */
-    pVars->prog_config.buffer_fullness = (lower_16 >> 2) & 0x7FF;
-
-    /*
-     * headerless_frames indicates the number of
-     * frames with no headers to be processed before the reading
-     * in of the next header.
-     *
-     * In ADTS, up to 4 "no header frames" can exist between
-     * syncwords.
-     *
-     * EXAMPLES:
-     *
-     * Legend: (Sync words denoted by X, frames
-     * deonted by FRAME_#)
-     *
-     * Example(1): The ADTS sequence below packs 5
-     * frames per header.
-     * Here, headerless_frames would always be read in as "4"
-     *
-     * |X||FRAME_0||FRAME_1||FRAME_2||FRAME_3||FRAME_4||X||FRAME_0|
-     *
-     * Example(2): The ADTS sequence below packs 1 frame per header.
-     * Here, headerless_frames would always be read in as "0"
-     *
-     * |X||FRAME_0||X||FRAME_1||X||FRAME_2|
-     *
-     */
-    pVars->prog_config.headerless_frames = (lower_16 & 0x0003);
-
-    if (pVars->prog_config.CRC_absent == 0)
-    {
-        pVars->prog_config.CRC_check = (UInt)getbits(
-                                           LENGTH_CRC,
-                                           &(pVars->inputStream));
-    }
-
-    /* pVars->current_program = 0; */ /* shall be set after PCE is read */
-
-    return (status);
-
-} /* END get_adts_header */
diff --git a/media/libstagefright/codecs/aacdec/get_adts_header.h b/media/libstagefright/codecs/aacdec/get_adts_header.h
deleted file mode 100644
index 13afa05..0000000
--- a/media/libstagefright/codecs/aacdec/get_adts_header.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/get_adts_header.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file has the function declaration for get_adts_header().
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_ADTS_HEADER_H
-#define GET_ADTS_HEADER_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_tdec_int_file.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-Int get_adts_header(
-    tDec_Int_File *pVars,
-    UInt32        *pSyncword,
-    Int           *pInvoke,
-    Int            CorrectlyReadFramesCount);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_audio_specific_config.cpp b/media/libstagefright/codecs/aacdec/get_audio_specific_config.cpp
deleted file mode 100644
index 092f397..0000000
--- a/media/libstagefright/codecs/aacdec/get_audio_specific_config.cpp
+++ /dev/null
@@ -1,691 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/get_audio_specific_config.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modified per review comments
-
- Description: Modified per second review comments
-              (1) change audioObjectType to Int
-              (2) do not set pVars->prog_config.profile
-              (3) clean up status flag, default to SUCCESS
-              (4) fix multiple lines comments
-
- Description: Change getbits.h to ibstream.h
-
- Description: Modified per review comments
-              (1) updated revision history
-              (2) declare audioObjectType as enum type
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less.
-
- Description: Added support for backward and non-backward (explicit)
-              mode for Parametric Stereo (PS) used in enhanced AAC+
-
- Who:                              Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pVars = pointer to the structure that holds all information for
-            this instance of the library. pVars->prog_config is directly
-            used, and pVars->mc_info, pVars->prog_config,
-            pVars->pWinSeqInfo, pVars->SFBWidth128 are needed indirectly
-            for calling set_mc_info. Data type pointer to tDec_Int_File
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    status = 0 if successfully decoded AudioSpecificConfig
-             1 if un-supported config is used for this release
-
- Pointers and Buffers Modified:
-    pVars->prog_config contents are updated with the information read in.
-    pVars->mc_info contents are updated with channel information.
-    pVars->pWinSeqInfo contents are updated with window information.
-    pVars->SFBWidth128 contents are updated with scale factor band width data.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function reads the bitstream for the structure "AudioSpecificConfig",
- and sets the decoder configuration that is needed by the decoder to be able
- to decode the media properly.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall not use global variables
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3: 1999(E)
- Part 3
- Subpart 1  p18     1.6   Interface to MPEG-4 Systems
- Subpart 4  p13     4.4.1 GA Specific Configuration
- Amendment  p10     6.2.1 AudioSpecificInfo
- Amendment  p78     8.2   Decoder configuration (GASpecificConfig)
-
- (2) AAC DecoderSpecificInfo Information
-   PacketVideo descriptions - San Diego
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    status = SUCCESS;
-
-    pInputStream = &(pVars->inputStream);
-
-    temp = CALL getbits(
-                    neededBits = LEN_OBJ_TYPE + LEN_SAMP_RATE_IDX,
-                    pInputStream = pInputStream)
-           MODIFYING (pInputStream)
-           RETURNING (temp)
-
-    audioObjectType = (temp & 0x1f0) >> 4;
-
-    pVars->prog_config.profile = audioObjectType;
-
-    pVars->prog_config.sampling_rate_idx = temp & 0xf;
-
-    IF (pVars->prog_config.sampling_rate_idx == 0xf)
-    THEN
-        sampling_rate = CALL getbits(
-                            neededBits = LEN_SAMP_RATE,
-                            pInputStream = pInputStream);
-                        MODIFYING (pInputStream)
-                        RETURNING (sampling_rate)
-    ENDIF
-
-    channel_config = CALL getbits(
-                            neededBits = LEN_CHAN_CONFIG,
-                            pInputStream = pInputStream);
-                        MODIFYING (pInputStream)
-                        RETURNING (channel_config)
-
-    IF (channel_config > 2)
-    THEN
-        status = 1;
-    ENDIF
-
-    IF (((audioObjectType == MP4AUDIO_AAC_MAIN)     OR
-        (audioObjectType == MP4AUDIO_AAC_LC)        OR
-        (audioObjectType == MP4AUDIO_AAC_SSR)       OR
-        (audioObjectType == MP4AUDIO_LTP)           OR
-        (audioObjectType == MP4AUDIO_AAC_SCALABLE)  OR
-        (audioObjectType == MP4AUDIO_TWINVQ)) AND (status == -1))
-    THEN
-        status = CALL get_GA_specific_config(
-                            pVars = pVars,
-                            channel_config = channel_config,
-                            audioObjectType = audioObjectType,
-                            pInputStream = pInputStream);
-                      MODIFYING (pVars->mc_info,channel_config,pInputStream)
-                      RETURNING (status)
-
-    ENDIF
-
-    IF (audioObjectType == MP4AUDIO_CELP)
-    THEN
-        status = 1;
-    ENDIF
-
-    IF (audioObjectType == MP4AUDIO_HVXC)
-    THEN
-        status = 1;
-    ENDIF
-
-    IF (audioObjectType == MP4AUDIO_TTSI)
-    THEN
-        status = 1;
-    ENDIF
-
-    IF ((audioObjectType == 13) OR (audioObjectType == 14) OR
-        (audioObjectType == 15) OR (audioObjectType == 16))
-    THEN
-        status = 1;
-    ENDIF
-
-    IF (((audioObjectType == MP4AUDIO_ER_AAC_LC)       OR
-         (audioObjectType == MP4AUDIO_ER_AAC_LTP)      OR
-         (audioObjectType == MP4AUDIO_ER_AAC_SCALABLE) OR
-         (audioObjectType == MP4AUDIO_ER_TWINVQ)       OR
-         (audioObjectType == MP4AUDIO_ER_BSAC)         OR
-         (audioObjectType == MP4AUDIO_ER_AAC_LD)) AND (status == -1))
-    THEN
-        status = 1;
-    ENDIF
-
-    IF (audioObjectType == MP4AUDIO_ER_CELP)
-    THEN
-        status = 1;
-    ENDIF
-
-    IF (audioObjectType == MP4AUDIO_ER_HVXC)
-    THEN
-        status = 1;
-    ENDIF
-
-    IF ((audioObjectType == MP4AUDIO_ER_HILN) OR
-        (audioObjectType == MP4AUDIO_PARAMETRIC))
-    THEN
-        status = 1;
-    ENDIF
-
-    IF ((audioObjectType == MP4AUDIO_ER_AAC_LC)       OR
-        (audioObjectType == MP4AUDIO_ER_AAC_LTP)      OR
-        (audioObjectType == MP4AUDIO_ER_AAC_SCALABLE) OR
-        (audioObjectType == MP4AUDIO_ER_TWINVQ)       OR
-        (audioObjectType == MP4AUDIO_ER_BSAC)         OR
-        (audioObjectType == MP4AUDIO_ER_AAC_LD)       OR
-        (audioObjectType == MP4AUDIO_ER_CELP)         OR
-        (audioObjectType == MP4AUDIO_ER_HVXC)         OR
-        (audioObjectType == MP4AUDIO_ER_HILN)         OR
-        (audioObjectType == MP4AUDIO_PARAMETRIC))
-    THEN
-        epConfig = CALL getbits(
-                            neededBits = LEN_EP_CONFIG,
-                            pInputStream = pInputStream);
-                      MODIFYING (pInputStream)
-                      RETURNING (epConfig)
-
-        IF (epConfig == 2)
-        THEN
-            status = 1;
-        ENDIF
-
-    ENDIF
-
-    RETURN status;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "e_mp4ff_const.h"
-#include    "e_tmp4audioobjecttype.h"
-#include    "get_audio_specific_config.h"
-#include    "get_ga_specific_config.h"
-#include    "ibstream.h"
-#include    "sfb.h"                   /* Where samp_rate_info[] is declared */
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int get_audio_specific_config(tDec_Int_File   * const pVars)
-{
-
-    UInt    temp;
-    tMP4AudioObjectType     audioObjectType;
-    //UInt32  sampling_rate;
-    UInt    channel_config;
-    UInt    syncExtensionType;
-    UInt    extensionAudioObjectType = 0;
-    UInt    extensionSamplingFrequencyIndex = 0;
-    BITS   *pInputStream;
-    Int     status;
-
-    status = SUCCESS;
-
-    pInputStream = &(pVars->inputStream);
-
-    pVars->mc_info.upsamplingFactor = 1;   /*  default to regular AAC */
-
-    temp =  get9_n_lessbits(LEN_OBJ_TYPE + LEN_SAMP_RATE_IDX,
-                            pInputStream);
-
-    /*
-     * The following code can directly set the values of elements in
-     * MC_Info, rather than first setting the values in pVars->prog_config
-     * and then copy these values to MC_Info by calling set_mc_info.
-     * In order to keep consistent with get_prog_config (ADIF) and
-     * get_adts_header (ADTS), the code here is still copying
-     * the info, and set the pVars->current_program = 0
-     */
-
-    /* AudioObjectType */
-    audioObjectType = (tMP4AudioObjectType)((temp & 0x1f0) >> 4);
-
-    pVars->mc_info.ExtendedAudioObjectType =  audioObjectType;   /* default */
-    /* saving an audioObjectType into a profile field */
-    /* pVars->prog_config.profile = audioObjectType; */
-
-    /* sampling rate index */
-    pVars->prog_config.sampling_rate_idx = temp & 0xf;
-
-    if (pVars->prog_config.sampling_rate_idx > 0xb)
-    {
-        /*
-         *  Only support 12 sampling frequencies from array samp_rate_info ( see sfb.cpp)
-         *  7350 Hz (index 0xc) is not supported, the other indexes are reserved or escape
-         */
-        if (pVars->prog_config.sampling_rate_idx == 0xf) /* escape sequence */
-        {
-            /*
-             * sampling rate not listed in Table 1.6.2,
-             * this release does not support this
-             */
-            /*sampling_rate =  getbits( LEN_SAMP_RATE,
-                                      pInputStream);*/
-            getbits(LEN_SAMP_RATE, pInputStream); /* future use */
-        }
-
-        status = 1;
-    }
-
-    channel_config =  get9_n_lessbits(LEN_CHAN_CONFIG,
-                                      pInputStream);
-
-    if ((channel_config > 2) && (!pVars->aacConfigUtilityEnabled))
-    {
-        /*
-         * AAC lib does not support more than two channels
-         * signal error when in decoder mode
-         * do not test when in utility mode
-         */
-        status = 1;
-
-    }
-
-    if (audioObjectType == MP4AUDIO_SBR || audioObjectType == MP4AUDIO_PS)
-    {
-        /* to disable explicit backward compatiblity check */
-        pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR;
-        pVars->mc_info.sbrPresentFlag = 1;
-
-        if (audioObjectType == MP4AUDIO_PS)
-        {
-            pVars->mc_info.psPresentFlag = 1;
-            pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_PS;
-        }
-
-        extensionSamplingFrequencyIndex = /* extensionSamplingFrequencyIndex */
-            get9_n_lessbits(LEN_SAMP_RATE_IDX,
-                            pInputStream);
-        if (extensionSamplingFrequencyIndex == 0x0f)
-        {
-            /*
-             * sampling rate not listed in Table 1.6.2,
-             * this release does not support this
-                */
-            /*sampling_rate = getbits( LEN_SAMP_RATE,
-                                     pInputStream);*/
-            getbits(LEN_SAMP_RATE, pInputStream);
-        }
-
-        audioObjectType = (tMP4AudioObjectType) get9_n_lessbits(LEN_OBJ_TYPE ,
-                          pInputStream);
-    }
-
-
-    if ((/*(audioObjectType == MP4AUDIO_AAC_MAIN)     ||*/
-                (audioObjectType == MP4AUDIO_AAC_LC)        ||
-                /*(audioObjectType == MP4AUDIO_AAC_SSR)       ||*/
-                (audioObjectType == MP4AUDIO_LTP)           /*||*/
-                /*(audioObjectType == MP4AUDIO_AAC_SCALABLE)  ||*/
-                /*(audioObjectType == MP4AUDIO_TWINVQ)*/) && (status == SUCCESS))
-    {
-        status = get_GA_specific_config(pVars,
-                                        pInputStream,
-                                        channel_config,
-                                        audioObjectType);
-
-        /*
-         *  verify that Program config returned a supported audio object type
-         */
-
-        if ((pVars->mc_info.audioObjectType != MP4AUDIO_AAC_LC) &&
-                (pVars->mc_info.audioObjectType != MP4AUDIO_LTP))
-        {
-            return 1;   /* status != SUCCESS invalid aot */
-        }
-    }
-    else
-    {
-        return 1;   /* status != SUCCESS invalid aot or invalid parameter */
-    }
-
-    /*
-     *  SBR tool explicit signaling ( backward compatible )
-     */
-    if (extensionAudioObjectType != MP4AUDIO_SBR)
-    {
-        syncExtensionType = (UInt)get17_n_lessbits(LEN_SYNC_EXTENSION_TYPE,
-                            pInputStream);
-
-        if (syncExtensionType == 0x2b7)
-        {
-            extensionAudioObjectType = get9_n_lessbits( /* extensionAudioObjectType */
-                                           LEN_OBJ_TYPE,
-                                           pInputStream);
-
-            if (extensionAudioObjectType == MP4AUDIO_SBR)
-            {
-                pVars->mc_info.sbrPresentFlag = get1bits(pInputStream);  /* sbrPresentFlag */
-                if (pVars->mc_info.sbrPresentFlag == 1)
-                {
-                    extensionSamplingFrequencyIndex =
-                        get9_n_lessbits( /* extensionSamplingFrequencyIndex */
-                            LEN_SAMP_RATE_IDX,
-                            pInputStream);
-                    if (pVars->aacPlusEnabled == true)
-                    {
-#ifdef AAC_PLUS
-                        pVars->mc_info.upsamplingFactor = (samp_rate_info[extensionSamplingFrequencyIndex].samp_rate >> 1) ==
-                                                          samp_rate_info[pVars->prog_config.sampling_rate_idx].samp_rate ? 2 : 1;
-
-                        if ((Int)extensionSamplingFrequencyIndex == pVars->prog_config.sampling_rate_idx)
-                        {
-                            /*
-                             *  Disable SBR decoding for any sbr-downsampled file whose SF is >= 24 KHz
-                             */
-                            if (pVars->prog_config.sampling_rate_idx < 6)
-                            {
-                                pVars->aacPlusEnabled = false;
-                            }
-
-                            pVars->mc_info.bDownSampledSbr = true;
-                        }
-                        pVars->prog_config.sampling_rate_idx = extensionSamplingFrequencyIndex;
-
-#endif
-                    }
-
-                    if (extensionSamplingFrequencyIndex == 0x0f)
-                    {
-                        /*
-                         * sampling rate not listed in Table 1.6.2,
-                         * this release does not support this
-                         */
-                        /*sampling_rate = getbits( LEN_SAMP_RATE,
-                                                 pInputStream);*/
-                        getbits(LEN_SAMP_RATE, pInputStream);
-                    }
-                    /* syncExtensionType */
-                    syncExtensionType = (UInt)get17_n_lessbits(LEN_SYNC_EXTENSION_TYPE,
-                                        pInputStream);
-                    if (syncExtensionType == 0x548)
-                    {
-                        pVars->mc_info.psPresentFlag = get1bits(pInputStream);  /* psPresentFlag */
-                        if (pVars->mc_info.psPresentFlag)
-                        {
-                            extensionAudioObjectType = MP4AUDIO_PS;
-                        }
-                    }
-                    else
-                    {
-                        /*
-                        * Rewind bitstream pointer so that the syncExtensionType reading has no
-                        * effect when decoding raw bitstream
-                            */
-                        pVars->inputStream.usedBits -= LEN_SYNC_EXTENSION_TYPE;
-                    }
-
-                    pVars->mc_info.ExtendedAudioObjectType = (eMP4AudioObjectType)extensionAudioObjectType;
-                }
-            }
-        }
-        else if (!status)
-        {
-            /*
-             * Rewind bitstream pointer so that the syncExtensionType reading has no
-             * effect when decoding raw bitstream
-             */
-            pVars->inputStream.usedBits -= LEN_SYNC_EXTENSION_TYPE;
-
-#ifdef AAC_PLUS
-
-            /*
-             *  For implicit signalling, no hint that sbr or ps is used, so we need to
-             *  check the sampling frequency of the aac content, if lesser or equal to
-             *  24 KHz, by defualt upsample, otherwise, do nothing
-             */
-            if ((pVars->prog_config.sampling_rate_idx >= 6) && (pVars->aacPlusEnabled == true) &&
-                    audioObjectType == MP4AUDIO_AAC_LC)
-            {
-                pVars->mc_info.upsamplingFactor = 2;
-                pVars->prog_config.sampling_rate_idx -= 3;
-                pVars->mc_info.sbrPresentFlag = 1;
-                pVars->sbrDecoderData.SbrChannel[0].syncState = SBR_NOT_INITIALIZED;
-                pVars->sbrDecoderData.SbrChannel[1].syncState = SBR_NOT_INITIALIZED;
-
-            }
-#endif
-
-        }
-    }
-    else    /*  MP4AUDIO_SBR was detected  */
-    {
-        /*
-         *  Set the real output frequency use by the SBR tool, define tentative upsample ratio
-         */
-        if (pVars->aacPlusEnabled == true)
-        {
-#ifdef AAC_PLUS
-            pVars->mc_info.upsamplingFactor = (samp_rate_info[extensionSamplingFrequencyIndex].samp_rate >> 1) ==
-                                              samp_rate_info[pVars->prog_config.sampling_rate_idx].samp_rate ? 2 : 1;
-
-            if ((Int)extensionSamplingFrequencyIndex == pVars->prog_config.sampling_rate_idx)
-            {
-                /*
-                 *  Disable SBR decoding for any sbr-downsampled file whose SF is >= 24 KHz
-                 */
-                if (pVars->prog_config.sampling_rate_idx < 6)
-                {
-                    pVars->aacPlusEnabled = false;
-                }
-                pVars->mc_info.bDownSampledSbr = true;
-            }
-            pVars->prog_config.sampling_rate_idx = extensionSamplingFrequencyIndex;
-
-
-
-#endif
-
-
-
-
-        }
-
-    }  /*  if ( extensionAudioObjectType != MP4AUDIO_SBR ) */
-
-    /*
-     * The following object types are not supported in this release,
-     * however, keep these interfaces for future implementation
-     */
-
-    /*
-     *if (audioObjectType == MP4AUDIO_CELP)
-     *{
-     *    status = 1;
-     *}
-     */
-
-    /*
-     *if (audioObjectType == MP4AUDIO_HVXC)
-     *{
-     *    status = 1;
-     *}
-     */
-
-    /*
-     *if (audioObjectType == MP4AUDIO_TTSI)
-     *{
-     *    status = 1;
-     *}
-     */
-
-    /*
-     *if ((audioObjectType == 13) || (audioObjectType == 14) ||
-     *   (audioObjectType == 15) || (audioObjectType == 16))
-     *{
-     *    status = 1;
-     *}
-     */
-
-    /* The following objects are Amendment 1 objects */
-    /*
-     *if (((audioObjectType == MP4AUDIO_ER_AAC_LC)       ||
-     *    (audioObjectType == MP4AUDIO_ER_AAC_LTP)      ||
-     *    (audioObjectType == MP4AUDIO_ER_AAC_SCALABLE) ||
-     *    (audioObjectType == MP4AUDIO_ER_TWINVQ)       ||
-     *    (audioObjectType == MP4AUDIO_ER_BSAC)         ||
-     *    (audioObjectType == MP4AUDIO_ER_AAC_LD)) && (status == -1))
-     *{
-     */
-    /*
-     * should call get_GA_specific_config
-     * for this release, do not support Error Resilience
-     * temporary solution is set status flag and exit decoding
-     */
-    /*    status = 1;
-    *}
-    */
-
-    /*
-     *if (audioObjectType == MP4AUDIO_ER_CELP)
-     * {
-     *    status = 1;
-     *}
-     */
-
-    /*
-     *if (audioObjectType == MP4AUDIO_ER_HVXC)
-     *{
-     *    status = 1;
-     *}
-     */
-
-    /*
-     *if ((audioObjectType == MP4AUDIO_ER_HILN) ||
-     *    (audioObjectType == MP4AUDIO_PARAMETRIC))
-     *{
-     *    status = 1;
-     *}
-     */
-
-    /*
-     *if ((audioObjectType == MP4AUDIO_ER_AAC_LC)       ||
-     *    (audioObjectType == MP4AUDIO_ER_AAC_LTP)      ||
-     *    (audioObjectType == MP4AUDIO_ER_AAC_SCALABLE) ||
-     *    (audioObjectType == MP4AUDIO_ER_TWINVQ)       ||
-     *    (audioObjectType == MP4AUDIO_ER_BSAC)         ||
-     *    (audioObjectType == MP4AUDIO_ER_AAC_LD)       ||
-     *    (audioObjectType == MP4AUDIO_ER_CELP)         ||
-     *    (audioObjectType == MP4AUDIO_ER_HVXC)         ||
-     *    (audioObjectType == MP4AUDIO_ER_HILN)         ||
-     *    (audioObjectType == MP4AUDIO_PARAMETRIC))
-     *{
-     */
-    /* error protection config */
-    /*
-     *     epConfig =
-     *       getbits(
-     *           LEN_EP_CONFIG,
-     *           pInputStream);
-     *
-     *   if (epConfig == 2)
-     *   {
-     */
-    /* should call ErrorProtectionSpecificConfig() */
-    /*
-     *       status = 1;
-     *   }
-     *
-     *}
-     */
-
-    return status;
-
-}
diff --git a/media/libstagefright/codecs/aacdec/get_audio_specific_config.h b/media/libstagefright/codecs/aacdec/get_audio_specific_config.h
deleted file mode 100644
index b7cfcf5..0000000
--- a/media/libstagefright/codecs/aacdec/get_audio_specific_config.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/get_audio_specific_config.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                              Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file includes function declaration for get_audio_specific_config
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_AUDIO_SPECIFIC_CONFIG_H
-#define GET_AUDIO_SPECIFIC_CONFIG_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_tdec_int_file.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-Int get_audio_specific_config(
-    tDec_Int_File   * const pVars
-);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/get_dse.cpp b/media/libstagefright/codecs/aacdec/get_dse.cpp
deleted file mode 100644
index d64087f..0000000
--- a/media/libstagefright/codecs/aacdec/get_dse.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pInputStream = pointer to a BITS structure that holds information
-                   regarding the input stream.
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    pInputStream->usedBits is rounded up to a number that represents the next
-    byte boundary.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Adquire Data Stream element (DSE) from raw bitstream
-    At this time this function just drops the information.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-  This function shall not use global or static variables.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-void byte_align(
-    BITS  *pInputStream)
-
-    MODIFYING(pInputStream->usedBits = pInputStream->usedBits +
-                (pInputStream->usedBits + 7) % 8)
-
-    RETURN(nothing)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-
- STACK USAGE:
-
-     where:
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES:
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "get_dse.h"
-#include "ibstream.h"
-#include "getbits.h"
-#include "s_bits.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void get_dse(
-    Char    *DataStreamBytes,
-    BITS    *pInputStream)
-{
-    Int i;
-    Int data_byte_align_flag;
-    UInt count;
-    Int esc_count;
-    Char    *pDataStreamBytes;
-
-    pDataStreamBytes = DataStreamBytes;
-
-    /*
-     *  Get element instance tag  ( 4 bits)
-     *  ( max of 16 per raw data block)
-     */
-    get9_n_lessbits(LEN_TAG, pInputStream);
-
-    /*
-     *  get data_byte_align_flag ( 1 bit0 to see if byte alignment is
-     *  performed within the DSE
-     */
-    data_byte_align_flag = get1bits(pInputStream);
-
-    /*
-     *  get count ( 8 bits)
-     */
-    count =  get9_n_lessbits(LEN_D_CNT, pInputStream);
-
-    /*
-     *  if count == 255, its value it is incremented  by a
-     *  second 8 bit value, esc_count. This final value represents
-     *  the number of bytes in the DSE
-     */
-    if (count == (1 << LEN_D_CNT) - 1)
-    {
-        esc_count = (Int)get9_n_lessbits(LEN_D_ESC, pInputStream);  /* 8 bits */
-        count +=  esc_count;
-    }
-
-    /*
-     *  Align if flag is set
-     */
-    if (data_byte_align_flag)
-    {
-        byte_align(pInputStream);
-    }
-
-    for (i = count; i != 0; i--)
-    {
-        *(pDataStreamBytes++) = (Char) get9_n_lessbits(
-                                    LEN_BYTE,
-                                    pInputStream);
-    }
-
-    return;
-
-} /* end get_dse */
-
diff --git a/media/libstagefright/codecs/aacdec/get_dse.h b/media/libstagefright/codecs/aacdec/get_dse.h
deleted file mode 100644
index 3563f71..0000000
--- a/media/libstagefright/codecs/aacdec/get_dse.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_dse.h
- Funtions:
-    get_dse
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_DSE_H
-#define GET_DSE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_elelist.h"
-#include "s_bits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void get_dse(
-    Char    *DataStreamBytes,
-    BITS    *pInputStream);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/get_ele_list.cpp b/media/libstagefright/codecs/aacdec/get_ele_list.cpp
deleted file mode 100644
index 0534c13..0000000
--- a/media/libstagefright/codecs/aacdec/get_ele_list.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_ele_list.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description: Change to PacketVideo standard, rename variables.
-
- Description: Add own header file, make pInputStream second param for speed.
-
- Description: Changes per code review:
-              1) Include header file
-              2) Convert to count down
-              3) Add return (not in review)
-
- Description:
- (1) Updated copyright header
- (2) Replaced include of "interface.h" with "e_ProgConfig.h"
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less and get1bits
-              when only 1 bit is read.
-
- Who:                                 Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pElementList = pointer to an EleList structure - only the field num_ele
-                   needs to be set. Data type pointer to EleList.
-
-   pInputStream = pointer to a BITS structure, used by the function getbits
-                   to provide data. Data type pointer to BITS
-
-    enableCPE = boolean value indicating the area to be read contains
-                a channel pair element field. Data type Bool
-
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs: None
-
- Pointers and Buffers Modified:
-    pElementList contents are updated with information pertaining to channel
-        configuration.
-
-    pInputBuffer contents are updated to the next location to be read from
-        the input stream.
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function is called several times by get_prog_config() to read in part of
- the program configuration data related to channel setup.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall not have static or global variables.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 13818-7:1997 Titled "Information technology - Generic coding
-   of moving pictures and associated audio information - Part 7: Advanced
-   Audio Coding (AAC)", Table 6.21 - Syntax of program_config_element(),
-   page 16, and section 8.5 "Program Config Element (PCE)", page 30.
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    elementCount = pElementList->num_ele;
-
-    FOR (index = 0; index < elementCount; index++)
-        IF (enableCPE != FALSE) THEN
-            pElementList->ele_is_cpe[index] =
-                getbits(LEN_ELE_IS_CPE, pInputStream);
-        ELSE
-            pElementList->ele_is_cpe[index] = 0;
-        END IF
-
-        pElementList->ele_tag[index] = getbits(LEN_TAG, pInputStream);
-
-    END FOR
-
-    RETURNS nothing
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_elelist.h"
-#include "s_bits.h"
-#include "e_progconfigconst.h"
-#include "ibstream.h"
-#include "get_ele_list.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void get_ele_list(
-    EleList     *pElementList,
-    BITS        *pInputStream,
-    const Bool   enableCPE)
-{
-    Int index;
-    Int *pEleIsCPE;
-    Int *pEleTag;
-
-    pEleIsCPE = &pElementList->ele_is_cpe[0];
-    pEleTag   = &pElementList->ele_tag[0];
-
-    for (index = pElementList->num_ele; index > 0; index--)
-    {
-        if (enableCPE != FALSE)
-        {
-            *pEleIsCPE++ = get1bits(/*LEN_ELE_IS_CPE, */pInputStream);
-        }
-        else
-        {
-            *pEleIsCPE++ = FALSE;
-        }
-
-        *pEleTag++ = get9_n_lessbits(LEN_TAG, pInputStream);
-
-    } /* end for (index) */
-
-    return;
-
-} /* end get_ele_list */
-
diff --git a/media/libstagefright/codecs/aacdec/get_ele_list.h b/media/libstagefright/codecs/aacdec/get_ele_list.h
deleted file mode 100644
index 82f140b..0000000
--- a/media/libstagefright/codecs/aacdec/get_ele_list.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/get_ele_list.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for get_ele_list.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_ELE_LIST_H
-#define GET_ELE_LIST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_elelist.h"
-#include "s_bits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void get_ele_list(
-    EleList     *pElementList,
-    BITS        *pInputStream,
-    const Bool   enableCPE);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_ga_specific_config.cpp b/media/libstagefright/codecs/aacdec/get_ga_specific_config.cpp
deleted file mode 100644
index 65c00ea..0000000
--- a/media/libstagefright/codecs/aacdec/get_ga_specific_config.cpp
+++ /dev/null
@@ -1,473 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_GA_specific_config.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modified per review comments
-
- Description: Change getbits.h to ibstream.h
-
- Description: (1) use enum type for audioObjectType (2) update revision history
-
- Description: Updated the SW template to include the full pathname to the
- source file and a slightly modified copyright header.
-
- Description: Updated to use scratch memory for the temporary prog config.
-
- Description: Replace some instances of getbits to get1bits
-              when only 1 bit is read.
-
- Who:                               Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-        pVars   = pointer to the structure that holds all information for
-                  this instance of the library. pVars->prog_config
-                  pVars->mc_info, pVars->pWinSeqInfo, pVars->SFBWidth128
-                  are needed for calling set_mc_info.
-                  Data type pointer to tDec_Int_File
-
-        channel_config = variable that indicates the channel configuration
-                         information, in this decoder library, only values
-                         0, 1, and 2 are allowed.
-                         Data type UInt
-
-        audioObjectType = variable that indicates the Audio Object Type.
-                          Data type UInt.
-
-        pInputStream = pointer to a BITS structure that holds information
-                       regarding the input stream.
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    status = 0 if success
-             1 otherwise
-
- Pointers and Buffers Modified:
-    pVars->mc_info contents are updated with channel information.
-    if infoinit is called within set_mc_info, then
-    pVars->pWinSeqInfo contents are updated with window information.
-    pVars->SFBWidth128 contents are updated with scale factor band width data.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function takes the sampling_rate_idx, channel_config, and
- audioObjectType from AudioSpecificConfig() and set the decoder configuration
- necessary for the decoder to decode properly.
- It also reads the bitstream for frame length, scalable bitstream information
- and extension information to General Audio defined in MPEG-4 phase 1
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-  This function shall not use global variables
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3: 1999(E)
- Part 3
- Subpart 1  p18     1.6 Interface to MPEG-4 Systems
- Subpart 4  p13     4.4.1 GA Specific Configuration
- Amendment  p10     6.2.1 AudioSpecificInfo
- Amendment  p78     8.2 Decoder configuration (GASpecificConfig)
-
- (2) AAC DecoderSpecificInfo Information
-   PacketVideo descriptions - San Diego
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    frameLenFlag = CALL getbits(
-                            neededBits = LEN_FRAME_LEN_FLAG,
-                            pInputStream = pInputStream);
-                        MODIFYING (pInputStream)
-                        RETURNING (frameLenFlag)
-
-    dependsOnCoreCoder = CALL getbits(
-                               neededBits = LEN_DEPEND_ON_CORE,
-                               pInputStream = pInputStream);
-                        MODIFYING (pInputStream)
-                        RETURNING (dependsOnCoreCoder)
-
-    IF (dependsOnCoreCoder != FALSE)
-    THEN
-        coreCoderDelay = CALL getbits(
-                                neededBits = LEN_CORE_DELAY,
-                                pInputStream = pInputStream);
-                            MODIFYING (pInputStream)
-                            RETURNING (coreCoderDelay)
-    ENDIF
-
-    extFlag = CALL getbits(
-                      neededBits = LEN_EXT_FLAG,
-                      pInputStream = pInputStream);
-                   MODIFYING (pInputStream)
-                   RETURNING (extFlag)
-
-    IF (channel_config == 0)
-    THEN
-        status = CALL get_prog_config(
-                        pVars = pVars,
-                        pScratchPCE = &pVars->scratch_prog_config);
-                   MODIFYING (pVars, pScratchPCE)
-                   RETURNING (status)
-
-    ELSE
-        channel_config--;
-        pVars->prog_config.front.ele_is_cpe[0] = channel_config;
-        pVars->prog_config.front.ele_tag[0] = 0;
-
-        status = CALL set_mc_info(
-                        pMC_Info =  &(pVars->mc_info),
-                        audioObjectType = audioObjectType,
-                        sampling_rate_idx = pVars->prog_config.sampling_rate_idx,
-                        tag = pVars->prog_config.front.ele_tag[0],
-                        is_cpe = pVars->prog_config.front.ele_is_cpe[0],
-                        pWinSeqInfo = pVars->pWinSeqInfo,
-                        sfbwidth128 = pVars->SFBWidth128);
-                    MODIFYING (pMC_Info, pWinSeqInfo, sfbwidth128)
-                    RETURNING (SUCCESS)
-    ENDIF
-
-    IF ((audioObjectType == MP4AUDIO_AAC_SCALABLE) OR
-        (audioObjectType == MP4AUDIO_ER_AAC_SCALABLE))
-    THEN
-        layer_num = CALL getbits(
-                            neededBits = LEN_LAYER_NUM,
-                            pInputStream = pInputStream);
-                        MODIFYING (pInputStream)
-                        RETURNING (layer_num)
-
-        status = 1;
-    ENDIF
-
-    IF (extFlag != FALSE)
-    THEN
-         IF (audioObjectType == MP4AUDIO_ER_BSAC)
-         THEN
-              numOfSubFrame = CALL getbits(
-                                     neededBits = LEN_SUB_FRAME,
-                                     pInputStream = pInputStream);
-                                MODIFYING (pInputStream)
-                                RETURNING (numOfSubFrame)
-
-              layer_len = CALL getbits(
-                                neededBits = LEN_LAYER_LEN,
-                                pInputStream = pInputStream);
-                               MODIFYING (pInputStream)
-                               RETURNING (layer_len)
-
-         ENDIF
-
-         IF (((audioObjectType > 16) AND (audioObjectType < 22)) OR
-             (audioObjectType == 23))
-         THEN
-             aacSectionDataResilienceFlag =
-                            CALL getbits(
-                                    neededBits = LEN_SECT_RES_FLAG,
-                                    pInputStream = pInputStream);
-                                MODIFYING (pInputStream)
-                                RETURNING (aacSectionDataResilienceFlag)
-
-             aacScalefactorDataResilienceFlag =
-                            CALL getbits(
-                                    neededBits = LEN_SFB_RES_FLAG,
-                                    pInputStream = pInputStream);
-                                MODIFYING (pInputStream)
-                                RETURNING (aacScalefactorDataResilienceFlag)
-
-             aacSpectralDataResilienceFlag =
-                            CALL getbits(
-                                    neededBits = LEN_SPEC_RES_FLAG,
-                                    pInputStream = pInputStream);
-                                MODIFYING (pInputStream)
-                                RETURNING (aacSpectralDataResilienceFlag)
-         ENDIF
-
-        status = 1;
-
-    ENDIF
-
-    RETURN status;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "e_mp4ff_const.h"
-#include    "e_tmp4audioobjecttype.h"
-#include    "s_tdec_int_file.h"
-#include    "get_ga_specific_config.h"
-#include    "set_mc_info.h"
-#include    "get_prog_config.h"
-#include    "ibstream.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int get_GA_specific_config(
-    tDec_Int_File * const pVars,
-    BITS    *pInputStream,
-    UInt     channel_config,
-    const tMP4AudioObjectType audioObjectType
-)
-{
-
-    Int status = SUCCESS;
-    UInt dependsOnCoreCoder;
-    /* Int coreCoderDelay; */
-    UInt extFlag;
-
-    /* These variables are left for future implementation */
-    /* UInt layer_num; */
-    /* UInt numOfSubFrame; */
-    /* UInt layer_len; */
-    /* UInt aacSectionDataResilienceFlag; */
-    /* UInt aacScalefactorDataResilienceFlag; */
-    /* UInt aacSpectralDataResilienceFlag; */
-    Int  extFlag3;
-
-    /*
-     * frame length flag == 0, 1024 samples/frame
-     * frame length flag == 1,  960 samples/frame
-     */
-    get1bits(/*            LEN_FRAME_LEN_FLAG,*/
-        pInputStream);
-
-    /*
-     * dependsOnCoreCoder == 1, core coder has different sampling rate
-     * in a scalable bitstream
-     */
-    dependsOnCoreCoder =
-        get1bits(/*            LEN_DEPEND_ON_CORE,*/
-            pInputStream);
-
-    if (dependsOnCoreCoder != FALSE)
-    {
-        /*coreCoderDelay =
-         *    getbits(
-         *        LEN_CORE_DELAY,
-         *        pInputStream);
-         */
-
-        status = 1; /* do not support scalable coding in this release */
-    }
-
-    /*
-     * extension flag indicates if Amendment 1 objects are used or not
-     * extension flag == 0 objects = 1, 2, 3, 4, 6, 7
-     * extension flag == 1 objects = 17, 19, 20, 21, 22, 23
-     */
-    extFlag = get1bits(pInputStream);       /*  LEN_EXT_FLAG,*/
-
-
-    /* Force checks for implicit channel configuration */
-    pVars->mc_info.implicit_channeling = 1;
-
-    if (status == SUCCESS)
-    {
-
-        if (channel_config == 0)
-        {
-            status = get_prog_config(pVars,
-                                     &pVars->scratch.scratch_prog_config);
-
-            if (status != SUCCESS)
-            {
-                pVars->prog_config.front.ele_is_cpe[0] = 0; /* default to mono  */
-                pVars->mc_info.nch = 1;
-                pVars->prog_config.front.ele_tag[0] = 0;
-
-                status = SUCCESS;
-            }
-        }
-        else
-        {
-            /*
-             * dummy tag = 0 and
-             * set up decoding configurations
-             */
-            channel_config--;
-            pVars->prog_config.front.ele_is_cpe[0] = channel_config;
-            pVars->prog_config.front.ele_tag[0] = 0;
-
-            status =
-                set_mc_info(
-                    &(pVars->mc_info),
-                    audioObjectType, /* previously profile */
-                    pVars->prog_config.sampling_rate_idx,
-                    pVars->prog_config.front.ele_tag[0],
-                    pVars->prog_config.front.ele_is_cpe[0],
-                    pVars->winmap, /*pVars->pWinSeqInfo,*/
-                    pVars->SFBWidth128);
-
-        } /* if (channel_config) */
-
-    } /* if(status) */
-
-    /*
-     * This layer_num is not found in ISO/IEC specs,
-     * but it is defined in San Diego spec for scalable bitstream
-     */
-    if ((audioObjectType == MP4AUDIO_AAC_SCALABLE) ||
-            (audioObjectType == MP4AUDIO_ER_AAC_SCALABLE))
-    {
-        /*layer_num =
-         *    getbits(
-         *        LEN_LAYER_NUM,
-         *        pInputStream);
-         */
-
-        status = 1; /* for this release only */
-    }
-
-    if (extFlag)
-    {
-        /*
-         * currently do not implement these functionalities
-         * defined in Amendment 1
-         * keep it here for future release
-         */
-        if (audioObjectType == MP4AUDIO_ER_BSAC)
-        {
-            status = 1;     /* NOT SUPPORTED */
-            /*
-            numOfSubFrame = getbits( LEN_SUB_FRAME, pInputStream);
-
-            layer_len = getbits( LEN_LAYER_LEN, pInputStream);
-            */
-        }
-
-        /*
-         * The following code is equivalent to
-         * if ((audioObjectType == 17) || (audioObjectType == 18) ||
-         *     (audioObjectType == 19) || (audioObjectType == 20) ||
-         *     (audioObjectType == 21) || (audioObjectType == 23))
-         */
-
-        if (((audioObjectType > 16) && (audioObjectType < 22)) ||
-                (audioObjectType == 23))
-        {
-            status = 1;     /* NOT SUPPORTED */
-            /*
-            aacSectionDataResilienceFlag = getbits( LEN_SECT_RES_FLAG,
-                                                    pInputStream);
-
-            aacScalefactorDataResilienceFlag = getbits( LEN_SCF_RES_FLAG,
-                                                        pInputStream);
-
-            aacSpectralDataResilienceFlag = getbits( LEN_SPEC_RES_FLAG,
-                                                     pInputStream);
-            */
-        }
-        /*
-         * this flag is tbd in version 3 of ISO/IEC spec
-         * if the encoder generates this bit, then it has to be read
-         * current adif2mp4ff does not write this bit. If this bit is to
-         * be read, it can be done by the following code:
-         */
-
-        extFlag3 = get1bits(pInputStream);       /*  LEN_EXT_FLAG3 */
-
-        if (extFlag3)
-        {
-            status = 1;     /* NOT SUPPORTED */
-        }
-
-    }
-
-    return status;
-}
diff --git a/media/libstagefright/codecs/aacdec/get_ga_specific_config.h b/media/libstagefright/codecs/aacdec/get_ga_specific_config.h
deleted file mode 100644
index 7c77da5..0000000
--- a/media/libstagefright/codecs/aacdec/get_ga_specific_config.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_GA_specific_config.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: (1) use enum type for audioObjectType
-              (2) update revision history
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file includes the function declaration for get_GA_specific_config.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_GA_SPECIFIC_CONFIG_H
-#define GET_GA_SPECIFIC_CONFIG_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_tdec_int_file.h"
-#include    "s_bits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-Int get_GA_specific_config(
-    tDec_Int_File * const pVars,
-    BITS    *pInputStream,
-    UInt     channel_config,
-    const tMP4AudioObjectType audioObjectType
-);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_ics_info.cpp b/media/libstagefright/codecs/aacdec/get_ics_info.cpp
deleted file mode 100644
index 17204cc..0000000
--- a/media/libstagefright/codecs/aacdec/get_ics_info.cpp
+++ /dev/null
@@ -1,608 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/get_ics_info.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  Clean up code.
-
- Description:  Fix comments before review, remove lpflag[]
-
- Description:  Update per review comments, and match ISO/IEC 14496-3
-
- Description:  Update per peer review comments.
-
- Description:  Remove "rollback" of used bits, since lt_decode is to change.
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less and get1bits
-              when only 1 bit is read.
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    audioObjectType = MP4 Audio Object Type for the current song. Only if
-                    this is set to LTP (MP4AUDIO_LTP) will long term
-                    prediction bits be retrieved. Data type
-                    tMP4AudioObjectType, which is an enumeration, which in
-                    turn is an Int.
-
-    pInputStream  = pointer to a BITS structure, used by the function getbits
-                    to provide data. This is the second parameter to this
-                    function to match its position in getbits().
-                    Data type pointer to BITS structure
-
-    common_window = field read in huffdecode, which tells whether information
-                    is shared between the left and right channel. Long term
-                    prediction (LTP) data is NOT shared even if its a common
-                    window, so this flag is needed to see if another set of
-                    LTP possibly needs to be read. If this flag is false,
-                    pSecondLTPStatus is not touched, it could be NULL if
-                    need be. Data type Bool, which is Int.
-
-    pWindowSequence = pointer to where the the window type of the current
-                    frame and channel should be placed, of data type
-                    WINDOW_SEQUENCE, which is Int. It can take on one
-                    of four values: ONLY_LONG_SEQUENCE, LONG_START_SEQUENCE,
-                    EIGHT_SHORT_SEQUENCE, LONG_STOP_SEQUENCE,
-
-    pWindowShape =  pointer to where the window shape for the current frame
-                    and channel should be placed, of data type WINDOW_SHAPE,
-                    which is Int. It can take on the one of these two values:
-                    SINE_WINDOW, KAISER_BESSEL_WINDOW. It is used in the
-                    "filterbank" section of decoding.
-
-    group         = array that holds the index of the first window in each
-                    group. Data type array of Int, eight elements.
-
-    p_max_sfb     = pointer to where the maximum number of scale factor bands
-                    for the current frame and channel will be placed. Data
-                    type of pointer to Int.
-
-    p_winmap      = array of pointers to all of the possible four window
-                    configurations. This parameter did not need to be pointers,
-                    and could be changed in the future. Data type array of pointers
-                    to FrameInfo structures, length 4.
-
-    pFirstLTPStatus = pointer to a structure where the first LTP
-                    information will be stored. It would be confusing and wrong
-                    to call this left LTP status since if common_window = FALSE,
-                    this function will be called twice - once for the left, once
-                    for the right. It could be done, but extra conditional code
-                    would need to be done.
-                    Data type pointer to LT_PRED_STATUS structure.
-
-    pSecondLTPStatus = pointer to where the right channel of LTP
-                    information will be stored only if common_window is non-zero.
-                    Data type pointer to LT_PRED_STATUS structure.
-
- Local Stores/Buffers/Pointers Needed: None.
-
- Global Stores/Buffers/Pointers Needed: None.
-
- Outputs:
-    status  = 0 implies no error occurred, non-zero otherwise.
-
- Pointers and Buffers Modified:
-    pInputStream contents are modified in such a way that the number of bits
-        read increases.
-    pWindowSequence contents are updated with the current window for this
-        frame and channel
-    group[] contents will be modified to grouping information. See getgroup
-        source code for a better description of what this is.
-    p_max_sfb contents will be updated with the maximum scale factor bands
-        for this frame and channel.
-    pFirstLTPStatus contents may be updated if the stream has long term
-        prediction information.
-    pSecondLTPStatus contents may be updated if common_window != 0 and LTP data
-        is present.
-
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function retrieves the individual channel stream (ICS) information
- from the bitstream. The information read for the current
- frame and channel is:
- - window sequence
- - window shape for use in the filter bank
- - number of scale factor bands
- - long term predication (LTP) information
- - grouping information
-
- This function does NOT support MPEG2 style AAC Frequency Domain Predictor,
- not to be confused with LTP (Long Term Prediction). If such data is found
- to be on the file an error is generated.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function is not to use static or global data.
-
-------------------------------------------------------------------------------
- REFERENCES
-
-  (1) ISO/IEC 14496-3:1999(E) Titled "Information technology - Coding
-      of audio-visual objects Part 3: Audio Subpart 4:"
-      Table 4.4.6 - Syntax of ics_info(), page 16.
-
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    status = 0;
-    first_ltp_data_present = FALSE;
-    second_ltp_data_present = FALSE;
-
-
-    CALL getbits(
-        neededBits = LEN_ICS_RESERV + LEN_WIN_SEQ + LEN_WIN_SH,
-        pInputStream = pInputStream)
-    MODIFYING( pInputStream )
-    RETURNING( temp = returnValue )
-
-    windowSequence = (temp >> LEN_WIN_SH) & ((0x1<<LEN_WIN_SEQ)-1);
-
-    *pWindowShape = (temp) & ((0x1<<LEN_WIN_SH)-1);
-
-    IF (windowSequence == EIGHT_SHORT_SEQUENCE)
-    THEN
-        CALL getbits(
-            neededBits = LEN_MAX_SFBS,
-            pInputStream = pInputStream)
-        MODIFYING(pInputStream)
-        RETURNING(local_max_sfb = returnValue)
-
-        CALL getgroup(
-            group = group,
-            pInputStream = pInputStream)
-        MODIFYING(group)
-        MODIFYING(pInputStream)
-        RETURNING(nothing)
-
-
-    ELSE
-
-        group[0] = 1;
-
-        CALL getbits(
-            neededBits = LEN_MAX_SFBL + LEN_PREDICTOR_DATA_PRESENT,
-            pInputStream = pInputStream)
-        MODIFYING(pInputStream)
-        RETURNING(temp = returnValue)
-
-        predictor_data_present =
-            (Bool) getbits(
-                LEN_BOOLEAN,
-                pInputStream);
-
-        local_max_sfb = (Int)(temp >> LEN_PREDICTOR_DATA_PRESENT);
-
-        predictor_data_present =
-            (Bool) (temp & ((0x1 << LEN_PREDICTOR_DATA_PRESENT)-1));
-
-        IF (local_max_sfb > allowed_max_sfb)
-        THEN
-            status = 1
-        ELSEIF (audioObjectType == MP4AUDIO_LTP)
-        THEN
-            IF (predictor_data_present != FALSE)
-            THEN
-                CALL getbits(
-                    neededBits = LEN_LTP_DATA_PRESENT,
-                    pInputStream = pInputStream)
-                MODIFYING(pInputStream)
-                RETURNING(first_ltp_data_present = returnValue)
-
-                IF (ltp_data_present != FALSE)
-                THEN
-
-                    CALL lt_decode(
-                        win_type = windowSequence,
-                        pInputStream  = pInputStream,
-                        max_sfb = local_max_sfb,
-                        pLt_pred = pFirstLTPStatus)
-                    MODIFYING(pInputStream)
-                    MODIFYING(pFirstLTPStatus)
-                    RETURNING(nothing)
-
-                ENDIF
-
-                IF (common_window != FALSE)
-                THEN
-                    CALL getbits(
-                        neededBits = LEN_LTP_DATA_PRESENT,
-                        pInputStream = pInputStream)
-                    MODIFYING(pInputStream)
-                    RETURNING(second_ltp_data_present = returnValue)
-
-                    IF (second_ltp_data_present != FALSE)
-                    THEN
-
-                        CALL lt_decode(
-                            win_type = windowSequence,
-                            pInputStream  = pInputStream,
-                            max_sfb = local_max_sfb,
-                            pLt_pred = pSecondLTPStatus)
-                        MODIFYING(pInputStream)
-                        MODIFYING(pSecondLTPStatus)
-                        RETURNING(nothing)
-                    ENDIF
-                ENDIF
-            ENDIF
-        ELSE
-            IF  (predictor_data_present != FALSE)
-            THEN
-                status = 1
-            ENDIF
-        END IF
-    ENDIF
-
-    pFirstLTPStatus->ltp_data_present = first_ltp_data_present;
-
-    IF (common_window != FALSE)
-    THEN
-        pSecondLTPStatus->ltp_data_present = second_ltp_data_present;
-    ENDIF
-
-    pFrameInfo = p_winmap[*p_wnd];
-    IF (local_max_sfb > pFrameInfo->sfb_per_frame)
-    THEN
-        status = 1;
-    ENDIF
-
-    *(p_max_sfb) = local_max_sfb;
-
-    MODIFY(*(pWindowSequence))
-    MODIFY(*(pWinShape))
-    MODIFY(*(p_max_sfb))
-    MODIFY(group[])
-    MODIFY(*pInputStream)
-    MODIFY(*pFirstLTPStatus)
-    MODIFY(*pSecondLTPStatus)
-    RETURN (status);
-
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-#include "e_rawbitstreamconst.h"
-#include "e_tmp4audioobjecttype.h"
-
-#include "s_bits.h"
-#include "s_frameinfo.h"
-#include "s_lt_pred_status.h"
-
-#include "ibstream.h"
-#include "lt_decode.h"
-#include "ltp_common_internal.h" /* For LEN_LTP_DATA_PRESENT constant */
-
-#include "get_ics_info.h"
-#include "huffman.h"        /* For the declaration of getgroup */
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define LEN_PREDICTOR_DATA_PRESENT (1)
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int get_ics_info(
-    const tMP4AudioObjectType  audioObjectType,
-    BITS                      *pInputStream,
-    const Bool                 common_window,
-    WINDOW_SEQUENCE           *pWindowSequence,
-    WINDOW_SHAPE              *pWindowShape,
-    Int                        group[],
-    Int                       *p_max_sfb,
-    FrameInfo                 *p_winmap[],
-    LT_PRED_STATUS            *pFirstLTPStatus,
-    LT_PRED_STATUS            *pSecondLTPStatus)
-{
-    WINDOW_SEQUENCE       windowSequence;
-    UInt                  temp;
-    Bool                  predictor_data_present;
-    UInt                   local_max_sfb;
-    UInt                   allowed_max_sfb;
-    Int                   status = SUCCESS;
-    Bool                  first_ltp_data_present = FALSE;
-    Bool                  second_ltp_data_present = FALSE;
-
-    /*
-     * The following three calls to getbits have been replaced with one
-     * call for speed:
-     *
-     *                  getbits(LEN_ICS_RESERV, pInputStream);
-     * windowSequence = getbits(LEN_WIN_SEQ, pInputStream);
-     * *pWindowShape  = getbits(LEN_WIN_SH, pInputStream);
-     *
-     */
-
-    temp =
-        get9_n_lessbits(
-            LEN_ICS_RESERV + LEN_WIN_SEQ + LEN_WIN_SH,
-            pInputStream);
-
-
-    windowSequence = (WINDOW_SEQUENCE)((temp >> LEN_WIN_SH) & ((0x1 << LEN_WIN_SEQ) - 1));
-
-    *pWindowShape = (WINDOW_SHAPE)((temp) & ((0x1 << LEN_WIN_SH) - 1));
-
-    /*
-     * This pointer should not be NULL as long as the initialization code
-     * has been run, so the test for NULL has been removed.
-     */
-    allowed_max_sfb = p_winmap[windowSequence]->sfb_per_win[0];
-
-    if (windowSequence == EIGHT_SHORT_SEQUENCE)
-    {
-        local_max_sfb =  get9_n_lessbits(LEN_MAX_SFBS,
-                                         pInputStream);
-
-        getgroup(
-            group,
-            pInputStream);
-
-        if (local_max_sfb > allowed_max_sfb)
-        {
-            status = 1;  /* ERROR CODE - needs to be updated */
-        }
-
-    } /* end of TRUE of if (windowSequence == EIGHT_SHORT_SEQUENCE) */
-    else
-    {
-        /* There is only one group for long windows. */
-        group[0] = 1;
-
-        /*
-         * The window is long, get the maximum scale factor bands,
-         * and get long term prediction info.
-         *
-         * Reference [1] states that the audioObjectType is first tested,
-         * then the predictor_data_present is read on either branch of the
-         * if (audioObjectType == MP4AUDIO_LTP). Instead, this code combines
-         * the two calls on both branches into one before the
-         * if, and then in turn combines with another call to getbits, all
-         * in the name of speed.
-         *
-         * This would be the individual calls, without checking the number
-         * of scale factor bands:
-         *
-         *   local_max_sfb =
-         *      (Int) getbits(
-         *          LEN_MAX_SFBL,
-         *           pInputStream);
-         *
-         *  if (audioObjectType == MP4AUDIO_LTP)
-         *  {
-         *        predictor_data_present =
-         *           (Bool) getbits(
-         *              LEN_PREDICTOR_DATA_PRESENT,
-         *              pInputStream);
-         *
-         *     .....   (read LTP data)
-         *
-         *    }
-         *    else
-         *    {
-         *
-         *        predictor_data_present =
-         *           (Bool) getbits(
-         *              LEN_PREDICTOR_DATA_PRESENT,
-         *              pInputStream);
-         *
-         *     .....   (its an error for this library)
-         *     }
-         */
-        temp =
-            get9_n_lessbits(
-                LEN_MAX_SFBL + LEN_PREDICTOR_DATA_PRESENT,
-                pInputStream);
-
-        local_max_sfb = (Int)(temp >> LEN_PREDICTOR_DATA_PRESENT);
-
-        predictor_data_present =
-            (Bool)(temp & ((0x1 << LEN_PREDICTOR_DATA_PRESENT) - 1));
-
-        if (local_max_sfb > allowed_max_sfb)
-        {
-            status = 1;  /* ERROR CODE - needs to be updated */
-        }
-        else if (audioObjectType == MP4AUDIO_LTP)
-        {
-            /*
-             * Note that the predictor data bit has already been
-             * read.
-             */
-
-            /*
-             * If the object type is LTP, the predictor data is
-             * LTP. If the object type is not LTP, the predictor data
-             * is so called "frequency predictor data", which is not
-             * supported by this implementation. Refer to (1)
-             */
-            if (predictor_data_present != FALSE)
-            {
-                first_ltp_data_present =
-                    (Bool) get1bits(/*                        LEN_LTP_DATA_PRESENT,*/
-                        pInputStream);
-
-                if (first_ltp_data_present != FALSE)
-                {
-                    lt_decode(
-                        windowSequence,
-                        pInputStream,
-                        local_max_sfb,
-                        pFirstLTPStatus);
-                }
-                if (common_window != FALSE)
-                {
-                    second_ltp_data_present =
-                        (Bool) get1bits(/*                            LEN_LTP_DATA_PRESENT,*/
-                            pInputStream);
-
-                    if (second_ltp_data_present != FALSE)
-                    {
-                        lt_decode(
-                            windowSequence,
-                            pInputStream,
-                            local_max_sfb,
-                            pSecondLTPStatus);
-                    }
-                } /* if (common_window != FALSE) */
-
-            } /* if (predictor_data_present != FALSE) */
-
-        } /* else if (audioObjectType == MP4AUDIO_LTP) */
-        else
-        {
-            /*
-             * Note that the predictor data bit has already been
-             * read.
-             */
-
-            /*
-             * The object type is not LTP. If there is data, its
-             * frequency predictor data, not supported by this
-             * implementation.
-             */
-            if (predictor_data_present != FALSE)
-            {
-                status = 1; /* ERROR CODE UPDATE LATER */
-            } /* if (predictor_data_present != FALSE) */
-
-        } /* end of "else" clause of if (audioObjectType == MP4AUDIO_LTP) */
-
-    } /*  if (windowSequence == EIGHT_SHORT_SEQUENCE) [FALSE branch] */
-
-
-    /*
-     * Save all local copies.
-     */
-    pFirstLTPStatus->ltp_data_present = first_ltp_data_present;
-    if (common_window != FALSE)
-    {
-        pSecondLTPStatus->ltp_data_present = second_ltp_data_present;
-    }
-
-    *p_max_sfb = local_max_sfb;
-
-    *pWindowSequence = windowSequence;
-
-    return (status);
-
-}  /* get_ics_info */
-
diff --git a/media/libstagefright/codecs/aacdec/get_ics_info.h b/media/libstagefright/codecs/aacdec/get_ics_info.h
deleted file mode 100644
index b94ef8e..0000000
--- a/media/libstagefright/codecs/aacdec/get_ics_info.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/get_ics_info.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Contains the declaration for the function get_ics_info()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_ICS_INFO_H
-#define GET_ICS_INFO_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_tmp4audioobjecttype.h"
-#include "s_bits.h"
-#include "e_window_sequence.h"
-#include "e_window_shape.h"
-#include "s_frameinfo.h"
-#include "s_lt_pred_status.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-    Int get_ics_info(
-        const tMP4AudioObjectType  audioObjectType,
-        BITS                      *pInputStream,
-        const Bool                 common_window,
-        WINDOW_SEQUENCE           *p_wnd,
-        WINDOW_SHAPE              *pWindowShape,
-        Int                        group[],
-        Int                       *p_max_sfb,
-        FrameInfo                 *p_winmap[],
-        LT_PRED_STATUS            *pFirstLTPStatus,
-        LT_PRED_STATUS            *pSecondLTPStatus);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif /* GET_ICS_INFO_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_prog_config.cpp b/media/libstagefright/codecs/aacdec/get_prog_config.cpp
deleted file mode 100644
index 6bddd57..0000000
--- a/media/libstagefright/codecs/aacdec/get_prog_config.cpp
+++ /dev/null
@@ -1,739 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_prog_config.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  Move functionality from get_adif_header for when to change
-               the current program configuration, add a temporary config
-               to read into, clean up code, change function prototype.
-
- Description:  Clean up
-
- Description:  Update per review comments
-
- Description:  Fix double 'could'
-
- Description:  change enter_mc_info to set_mc_info
-
- Description:  update comments
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less and get1bits
-              when only 1 bit is read.
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pVars      = pointer to the structure that holds all information for
-                 this instance of the library. pVars->prog_config is directly
-                 used, and pVars->mc_info, pVars->prog_config, pVars->winmap,
-                 pVars->SFBWidth128 are needed indirectly for calling
-                 set_mc_info. Data type  pointer to tDec_Int_File structure.
-
-    pScratchPCE = pointer to a temporary ProgConfig structure to be used
-                  to read in the program configuration element.
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-    status     = zero if no error was found, non-zero otherwise.
-
- Pointers and Buffers Modified:
-    pVars->prog_config contents are updated with the PCE read in.
-    pVars->mc_info contents are updated with channel information.
-    pVars->winmap contents are updated with window information.
-    pVars->SFBWidth128 contents are updated with scale factor band width data.
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function reads from the input stream to memory for a temporary
- program configuration element (PCE). If the PCE read is the first
- encountered it is saved. Or, if the tag of the PCE read matches the tag of
- the first PCE encounted, it is saved as well. This is a mechanism for
- changing the sampling rate.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall not use static or global variables.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 13818-7:1997 Titled "Information technology - Generic coding
-   of moving pictures and associated audio information - Part 7: Advanced
-   Audio Coding (AAC)", Table 6.21 - Syntax of program_config_element(),
-   page 16, and section 8.5 "Program Config Element (PCE)", page 30.
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    status          = SUCCESS;
-    pInputStream   = &(pVars->inputStream);
-
-
-    CALL getbits(
-        neededBits = LEN_TAG,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( tag = returnValue )
-
-    CALL getbits(
-        neededBits = LEN_PROFILE,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( pScratchPCE->profile = returnValue )
-
-    CALL getbits(
-        neededBits = LEN_PROFILE,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( pScratchPCE->sampling_rate_idx = returnValue )
-
-    CALL getbits(
-        neededBits = LEN_NUM_ELE,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( temp = returnValue )
-
-    pScratchPCE->front.num_ele = temp;
-
-    CALL getbits(
-        neededBits = LEN_NUM_ELE,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( temp = returnValue )
-
-    pScratchPCE->side.num_ele = temp;
-
-    CALL getbits(
-        neededBits = LEN_NUM_ELE,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( temp = returnValue )
-
-    pScratchPCE->back.num_ele = temp;
-
-    CALL getbits(
-        neededBits = LEN_NUM_LFE,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( temp = returnValue )
-
-    pScratchPCE->lfe.num_ele = temp;
-
-    CALL getbits(
-        neededBits = LEN_NUM_DAT,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( temp = returnValue )
-
-    pScratchPCE->data.num_ele = temp;
-
-    CALL getbits(
-        neededBits = LEN_NUM_CCE,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( temp = returnValue )
-
-    pScratchPCE->coupling.num_ele = temp;
-
-    CALL getbits(
-        neededBits = LEN_MIX_PRES,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( flag = returnValue )
-
-    pScratchPCE->mono_mix.present = flag;
-
-    IF (flag != FALSE)
-    THEN
-        CALL getbits(
-            neededBits = LEN_TAG,
-            pInputStream = pInputStream )
-        MODIFYING( pInputStream )
-        RETURNING( temp = returnValue )
-
-        pScratchPCE->mono_mix.ele_tag = temp;
-
-    ENDIF
-
-    CALL getbits(
-        neededBits = LEN_MIX_PRES,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( flag = returnValue )
-
-    pScratchPCE->stereo_mix.present = flag;
-
-    IF (flag != FALSE)
-    THEN
-
-        CALL getbits(
-            neededBits = LEN_TAG,
-            pInputStream = pInputStream )
-        MODIFYING( pInputStream )
-        RETURNING( temp = returnValue )
-
-        pScratchPCE->stereo_mix.ele_tag = temp;
-
-    ENDIF
-
-    CALL getbits(
-        neededBits = LEN_MIX_PRES,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( flag = returnValue )
-
-    flag =
-        getbits(
-            LEN_MIX_PRES,
-            pInputStream);
-
-    pScratchPCE->matrix_mix.present = flag;
-
-    IF (flag != FALSE)
-    THEN
-        CALL getbits(
-            neededBits = LEN_MMIX_IDX,
-            pInputStream = pInputStream )
-        MODIFYING( pInputStream )
-        RETURNING( temp = returnValue )
-
-        pScratchPCE->matrix_mix.ele_tag = temp;
-
-        CALL getbits(
-            neededBits = LEN_PSUR_ENAB,
-            pInputStream = pInputStream )
-        MODIFYING( pInputStream )
-        RETURNING( temp = returnValue )
-
-        pScratchPCE->matrix_mix.pseudo_enab = temp;
-
-    ENDIF
-
-
-    CALL get_ele_list(
-        pElementList = &pScratchPCE->front,
-        pInputStream = pInputStream,
-        enableCPE    = TRUE )
-    MODIFYING( pInputStream )
-    MODIFYING( pScratchPCE->front )
-    RETURNING( nothing )
-
-    CALL get_ele_list(
-        pElementList = &pScratchPCE->side,
-        pInputStream = pInputStream,
-        enableCPE    = TRUE )
-    MODIFYING( pInputStream )
-    MODIFYING( pScratchPCE->side )
-    RETURNING( nothing )
-
-    CALL get_ele_list(
-        pElementList = &pScratchPCE->back,
-        pInputStream = pInputStream,
-        enableCPE    = TRUE )
-    MODIFYING( pInputStream )
-    MODIFYING( pScratchPCE->back )
-    RETURNING( nothing )
-
-    CALL get_ele_list(
-        pElementList = &pScratchPCE->lfe,
-        pInputStream = pInputStream,
-        enableCPE    = FALSE )
-    MODIFYING( pInputStream )
-    MODIFYING( pScratchPCE->lfe )
-    RETURNING( nothing )
-
-    CALL get_ele_list(
-        pElementList = &pScratchPCE->data,
-        pInputStream = pInputStream,
-        enableCPE    = FALSE )
-    MODIFYING( pInputStream )
-    MODIFYING( pScratchPCE->data )
-    RETURNING( nothing )
-
-    CALL get_ele_list(
-        pElementList = &pScratchPCE->coupling,
-        pInputStream = pInputStream,
-        enableCPE    = TRUE )
-    MODIFYING( pInputStream )
-    MODIFYING( pScratchPCE->coupling )
-    RETURNING( nothing )
-
-
-    CALL byte_align(
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( nothing )
-
-    CALL getbits(
-        neededBits = LEN_COMMENT_BYTES,
-        pInputStream = pInputStream )
-    MODIFYING( pInputStream )
-    RETURNING( numChars = returnValue )
-
-    FOR (i = numChars; i > 0; i--)
-
-        CALL getbits(
-            neededBits = LEN_COMMENT_BYTES,
-            pInputStream = pInputStream )
-        MODIFYING( pInputStream )
-        RETURNING( nothing )
-
-    ENDFOR
-
-    IF (pVars->current_program < 0)
-    THEN
-        pVars->current_program = tag;
-    ENDIF
-
-
-    IF (tag == pVars->current_program)
-    THEN
-
-        CALL pv_memcpy(
-            to = &pVars->prog_config,
-            from = pScratchPCE,
-            n = sizeof(ProgConfig))
-        MODIFYING( pVars->prog_config )
-        RETURNING( nothing )
-
-        CALL set_mc_info(
-            pMC_Info = &pVars->mc_info,
-            objectType = pVars->prog_config.profile + 1,
-            samplin_rate_idx = pVars->prog_config.sampling_rate_idx,
-            tag = pVars->prog_config.front.ele_tag[0],
-            is_cpe = pVars->prog_config.front.ele_is_cpe[0],
-            pWinSeqInfo = pVars->winmap,
-            pSfbwidth128 = pVars->SFBWidth128)
-        MODIFYING( pVars->mc_info )
-        MODIFYING( pVars->winmap )
-        MODIFYING( pVars->SFBWidth128 )
-        RETURN( status = return_value )
-
-    ENDIF
-
-    MODIFY( pVars->mc_info )
-    MODIFY( pVars->winmap )
-    MODIFY( pVars->SFBWidth128 )
-    RETURN (status)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_bits.h"
-#include "s_elelist.h"
-#include "s_tdec_int_file.h"
-#include "s_tdec_int_chan.h"
-#include "e_progconfigconst.h"
-#include "ibstream.h"
-#include "get_ele_list.h"
-#include "aac_mem_funcs.h"
-#include "set_mc_info.h"
-#include "get_prog_config.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-Int get_prog_config(
-    tDec_Int_File *pVars,
-    ProgConfig    *pScratchPCE)
-{
-    Int    i;
-    UInt    tag;
-    Int    numChars;
-    UInt    temp;
-    Bool   flag;
-    Int    status          = SUCCESS;
-    BITS  *pInputStream   = &(pVars->inputStream);
-
-
-    /*
-     * The tag is used at the very end to see if this PCE is
-     * the one to be used. Otherwise it does not need to be saved for the
-     * the simple configurations to be used in this version of an AAC
-     * decoder.
-     *
-     * All of the bits of this PCE must be read even if this PCE will not
-     * be used. They are read into a temporary PCE, then later it is decided
-     * whether to keep this PCE.
-     *
-     * To allow quick removal of the fields from the ProgConfig structure
-     * that will probably not be used at a later date,
-     * while still advancing the bitstream pointer,the return value of
-     * getbits is saved into a temporary variable, then transfered to
-     * the structure item.
-     */
-    tag =
-        get9_n_lessbits(
-            LEN_TAG,
-            pInputStream);
-
-    pScratchPCE->profile =
-        get9_n_lessbits(
-            LEN_PROFILE,
-            pInputStream);
-
-    pScratchPCE->sampling_rate_idx =
-        get9_n_lessbits(
-            LEN_SAMP_IDX,
-            pInputStream);
-
-    if (!pVars->adif_test && pScratchPCE->sampling_rate_idx != pVars->prog_config.sampling_rate_idx)
-    {
-        /* rewind the pointer as implicit channel configuration maybe the case */
-        pInputStream->usedBits -= (LEN_TAG + LEN_PROFILE + LEN_SAMP_IDX);
-
-        return (1); /*  mismatch cannot happen */
-    }
-
-
-    /*
-     * Retrieve the number of element lists for each of
-     * front, side, back, lfe, data, and coupling.
-     *
-     * For two-channel stereo or mono, only the data in the front needs
-     * to be saved. However, ALL fields need to be skipped over in some
-     * fashion. Also, the number of elements needs to be temporarily saved
-     * to call get_ele_list(). If that function was changed to pass in
-     * the number of points to be read, the memory set aside inside the
-     * ProgConfig structure could be removed.
-     */
-
-    /*
-     * The next six function calls could be combined into one, then use
-     * shifts and masks to retrieve the individual fields.
-     */
-    temp =
-        get9_n_lessbits(
-            LEN_NUM_ELE,
-            pInputStream);
-
-    pScratchPCE->front.num_ele = temp;
-
-    /* Needed only to read in the element list. */
-    temp =
-        get9_n_lessbits(
-            LEN_NUM_ELE,
-            pInputStream);
-
-    pScratchPCE->side.num_ele = temp;
-
-    /* Needed only to read in the element list. */
-    temp =
-        get9_n_lessbits(
-            LEN_NUM_ELE,
-            pInputStream);
-
-    pScratchPCE->back.num_ele = temp;
-
-    /* Needed only to read in the element list. */
-    temp =
-        get9_n_lessbits(
-            LEN_NUM_LFE,
-            pInputStream);
-
-    pScratchPCE->lfe.num_ele = temp;
-
-    /* Needed only to read in the element list. */
-    temp =
-        get9_n_lessbits(
-            LEN_NUM_DAT,
-            pInputStream);
-    pScratchPCE->data.num_ele = temp;
-
-    /* Needed only to read in the element list. */
-    temp =
-        get9_n_lessbits(
-            LEN_NUM_CCE,
-            pInputStream);
-
-    pScratchPCE->coupling.num_ele = temp;
-
-    /*
-     * Read in mix down data.
-     *
-     * Whether these fields can be removed and have proper operation
-     * will be determined at a later date.
-     */
-
-    /* Read presence of mono_mix */
-    flag =
-        get1bits(/*            LEN_MIX_PRES,*/
-            pInputStream);
-
-    pScratchPCE->mono_mix.present = flag;
-
-    if (flag != FALSE)
-    {
-        temp =
-            get9_n_lessbits(
-                LEN_TAG,
-                pInputStream);
-
-        pScratchPCE->mono_mix.ele_tag = temp;
-
-    } /* end if (flag != FALSE) */
-
-    /* Read presence of stereo mix */
-    flag =
-        get1bits(/*            LEN_MIX_PRES,*/
-            pInputStream);
-
-    pScratchPCE->stereo_mix.present = flag;
-
-    if (flag != FALSE)
-    {
-        temp =
-            get9_n_lessbits(
-                LEN_TAG,
-                pInputStream);
-
-        pScratchPCE->stereo_mix.ele_tag = temp;
-
-    } /* end if (flag != FALSE) */
-
-    /* Read presence of matrix mix */
-    flag =
-        get1bits(/*            LEN_MIX_PRES,*/
-            pInputStream);
-
-    pScratchPCE->matrix_mix.present = flag;
-
-    if (flag != FALSE)
-    {
-        temp =
-            get9_n_lessbits(
-                LEN_MMIX_IDX,
-                pInputStream);
-
-        pScratchPCE->matrix_mix.ele_tag = temp;
-
-        temp =
-            get1bits(/*                LEN_PSUR_ENAB,*/
-                pInputStream);
-
-        pScratchPCE->matrix_mix.pseudo_enab = temp;
-
-    } /* end if (flag != FALSE) */
-
-    /*
-     * Get each of the element lists. Only the front information will be
-     * used for the PV decoder, but the usedBits field of pInputStream must
-     * be advanced appropriately.
-     *
-     * This could be optimized by advancing the bit stream for the
-     * elements that do not need to be read.
-     */
-    get_ele_list(
-        &pScratchPCE->front,
-        pInputStream,
-        TRUE);
-
-    get_ele_list(
-        &pScratchPCE->side,
-        pInputStream,
-        TRUE);
-
-    get_ele_list(
-        &pScratchPCE->back,
-        pInputStream,
-        TRUE);
-
-    get_ele_list(
-        &pScratchPCE->lfe,
-        pInputStream,
-        FALSE);
-
-    get_ele_list(
-        &pScratchPCE->data,
-        pInputStream,
-        FALSE);
-
-    get_ele_list(
-        &pScratchPCE->coupling,
-        pInputStream,
-        TRUE);
-
-    /*
-     * The standard requests a byte alignment before reading in the
-     * comment. This can be done because LEN_COMMENT_BYTES == 8.
-     */
-    byte_align(pInputStream);
-
-    numChars =
-        get9_n_lessbits(
-            LEN_COMMENT_BYTES, pInputStream);
-
-    /*
-     * Ignore the comment - it requires 65 bytes to store (or worse on DSP).
-     * If this field is restored, make sure to append a trailing '\0'
-     */
-    for (i = numChars; i > 0; i--)
-    {
-        pScratchPCE->comments[i] = (Char) get9_n_lessbits(LEN_BYTE,
-                                   pInputStream);
-
-    } /* end for */
-
-    if (pVars->current_program < 0)
-    {
-        /*
-         * If this is the first PCE, it becomes the current, regardless of
-         * its tag number.
-         */
-        pVars->current_program = tag;
-
-    } /* end if (pVars->current_program < 0) */
-
-
-    if (tag == (UInt)pVars->current_program)
-    {
-        /*
-         * This branch is reached under two conditions:
-         * 1) This is the first PCE found, it was selected in the above if
-         *    block. In all encoders found thus far, the tag value has been
-         *    zero.
-         * 2) A PCE has been sent by the encoder with a tag that matches the
-         *    the first one sent. It will then be re-read. No encoder found
-         *    thus far re-sends a PCE, when looking at ADIF files.
-         *
-         * Regardless, the temporary PCE will now be copied into the
-         * the one official program configuration.
-         */
-        pv_memcpy(
-            &pVars->prog_config,
-            pScratchPCE,
-            sizeof(ProgConfig));
-
-        /* enter configuration into MC_Info structure */
-        status =
-            set_mc_info(
-                &pVars->mc_info,
-                (tMP4AudioObjectType)(pVars->prog_config.profile + 1),
-                pVars->prog_config.sampling_rate_idx,
-                pVars->prog_config.front.ele_tag[0],
-                pVars->prog_config.front.ele_is_cpe[0],
-                pVars->winmap,
-                pVars->SFBWidth128);
-
-    } /* end if (tag == pVars->current_program) */
-
-    return (status);
-}
-
diff --git a/media/libstagefright/codecs/aacdec/get_prog_config.h b/media/libstagefright/codecs/aacdec/get_prog_config.h
deleted file mode 100644
index 646ba46..0000000
--- a/media/libstagefright/codecs/aacdec/get_prog_config.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_prog_config.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                      Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for get_prog_config.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_PROG_CONFIG_H
-#define GET_PROG_CONFIG_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_progconfig.h"
-#include "s_tdec_int_file.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-Int get_prog_config(
-    tDec_Int_File *pVars,
-    ProgConfig    *pTempPCE);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_pulse_data.cpp b/media/libstagefright/codecs/aacdec/get_pulse_data.cpp
deleted file mode 100644
index f9c24f4..0000000
--- a/media/libstagefright/codecs/aacdec/get_pulse_data.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_pulse_data.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description: Put into PV format
-
- Description: 1) Change loop to use pointers.
-              2) Rename to from get_nec_nc to get_pulse_data
-
- Description: Changes per code review
-              1) Fix pathname
-              2) Read in two fields to save call to getbits
-              3) Change how pPulseInfo->number_pulse is stored.
-
- Description: Placed typecast to Int in places where UInt->Int
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9.
-
- Who:                                  Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-     pInputStream = pointer to a BITS structure, used by the function getbits
-                   to provide data. Data type pointer to BITS structure
-
-     pPulseInfo   = pointer to pulse data structure to be filled with data
-                    concerning pulses in the frequency domain.
-                    Data type pointer to PulseInfo
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-     status       = return value, zero signifies success, non-zero otherwise.
-                    Presently this function only returns a success, error
-                    checking may be added later.
-                    Data type Int.
-
- Pointers and Buffers Modified:
-
-    pPulseInfo contents are updated with pulse information. Specifically,
-    pPulseInfo->number_pulse with the number of pulses found, and
-    pPulseInfo->pulse_start_sfb is set to the first scale factor band.
-    Then pPulseInfo->pulse_offset and pPulseInfo->pulse_amp are filled
-    with data. For these array, only the number of pulses defined will be
-    set, those values beyond the number of pulses will retain their previous
-    value and should not be read from.
-    Note: The value in pPulseInfo->number_pulse is different by a value of
-          one from the original ISO code.
-
-    pInputBuffer contents are updated to the next location to be read from
-        the input stream.
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function fills in the pulse data structure with information to be used
- later for restoring pulses in the spectrum.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall not use global or static variables.
-
-------------------------------------------------------------------------------
- REFERENCES
-
-  (1) ISO/IEC 13818-7:1997 Titled "Information technology - Generic coding
-      of moving pictures and associated audio information - Part 7: Advanced
-      Audio Coding (AAC)", Table 6.17 - Syntax of pulse_data(),
-      page 15, and section 9.3 "Decoding process", starting on page 41.
-
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    status = SUCCESS;
-
-    CALL getbits(neededBits = LEN_PULSE_NPULSE + LEN_PULSE_ST_SFB,
-                 pInputStream = pInputStream)
-    MODIFYING(*pInputStream)
-    RETURNING(temp)
-
-    pPulseInfo->number_pulse = 1 + (temp >> LEN_PULSE_ST_SFB);
-    pPulseInfo->pulse_start_sfb = temp & ((1 << LEN_PULSE_ST_SFB) - 1);
-
-    pPulseOffset = &pPulseInfo->pulse_offset[0];
-    pPulseAmp    = &pPulseInfo->pulse_amp[0];
-
-    FOR (i = PulseInfo->number_pulse; i > 0; i--)
-        CALL getbits(neededBits = LEN_PULSE_POFF + LEN_PULSE_PAMP,
-                     pInputStream = pInputStream)
-        MODIFYING(*pInputStream)
-        RETURNING(temp)
-
-        *pPulseOffset++ = temp >> LEN_PULSE_PAMP;
-        *pPulseAmp++    = temp & ((1 << LEN_PULSE_PAMP) - 1);
-    END FOR
-
-    MODIFYING (*pInputStream)
-    MODIFYING (*pPulseInfo)
-
-    RETURN status
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "ibstream.h"
-#include "s_pulseinfo.h"
-#include "s_bits.h"
-#include "e_rawbitstreamconst.h"
-#include "get_pulse_data.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int get_pulse_data(
-    PulseInfo   *pPulseInfo,
-    BITS        *pInputStream)
-{
-    Int   i;
-    Int  *pPulseOffset;
-    Int  *pPulseAmp;
-    Int   status = SUCCESS;
-    UInt  temp;
-
-    /*
-     * Read in both field fields at once to save cycles. These are the
-     * original lines of code:
-     * pPulseInfo->number_pulse = getbits(LEN_PULSE_NPULSE, pInputStream);
-     * pPulseInfo->pulse_start_sfb = getbits(LEN_PULSE_ST_SFB, pInputStream);
-     */
-
-    temp =
-        get9_n_lessbits(
-            LEN_PULSE_NPULSE + LEN_PULSE_ST_SFB,
-            pInputStream);
-
-    pPulseInfo->number_pulse = (Int)(1 + (temp >> LEN_PULSE_ST_SFB));
-    pPulseInfo->pulse_start_sfb = (Int)(temp & ((1 << LEN_PULSE_ST_SFB) - 1));
-
-    pPulseOffset = &pPulseInfo->pulse_offset[0];
-    pPulseAmp    = &pPulseInfo->pulse_amp[0];
-
-    /*
-     * This loop needs to count one more than the number read in from
-     * the bitstream - look at reference [1].
-     */
-
-    for (i = pPulseInfo->number_pulse; i > 0; i--)
-    {
-        /*
-         * Read in both fields. Original lines:
-         *  *pPulseOffset++ = getbits(LEN_PULSE_POFF, pInputStream);
-         *  *pPulseAmp++    = getbits(LEN_PULSE_PAMP, pInputStream);
-         */
-
-        temp =
-            get9_n_lessbits(
-                LEN_PULSE_POFF + LEN_PULSE_PAMP,
-                pInputStream);
-
-        *pPulseOffset++ = (Int)(temp >> LEN_PULSE_PAMP);
-
-        *pPulseAmp++    = (Int)(temp & ((1 << LEN_PULSE_PAMP) - 1));
-    }
-
-    return (status);
-}
-
diff --git a/media/libstagefright/codecs/aacdec/get_pulse_data.h b/media/libstagefright/codecs/aacdec/get_pulse_data.h
deleted file mode 100644
index 267f534..0000000
--- a/media/libstagefright/codecs/aacdec/get_pulse_data.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_pulse_data.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Change structure name.
-
- Who:                                      Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for get_pulse_data.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_PULSE_DATA_H
-#define GET_PULSE_DATA_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_pulseinfo.h"
-#include "s_bits.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-    Int get_pulse_data(
-        PulseInfo   *pPulseInfo,
-        BITS        *pInputStream);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /*  GET_PULSE_DATA_H  */
-
diff --git a/media/libstagefright/codecs/aacdec/get_sbr_bitstream.cpp b/media/libstagefright/codecs/aacdec/get_sbr_bitstream.cpp
deleted file mode 100644
index b6ec365..0000000
--- a/media/libstagefright/codecs/aacdec/get_sbr_bitstream.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: get_sbr_bitstream.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    INPUT
-
-    SBRDECODER self,
-    SBRBITSTREAM * stream,
-    float *timeData,
-    int numChannels
-
-    OUTPUT
-
-    errorCode, noError if successful
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        sbr decoder processing, set up SBR decoder phase 2 in case of
-        different cotrol data
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#ifdef AAC_PLUS
-
-#include "get_sbr_bitstream.h"
-#include "pv_audio_type_defs.h"
-#include    "sbr_crc_check.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void get_sbr_bitstream(SBRBITSTREAM *sbrBitStream, BITS *pInputStream)
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-
-    Int32 count;
-    Int32 esc_count;
-    Int32 Extention_Type;
-    Int32 i;
-
-    count = get9_n_lessbits(LEN_F_CNT, pInputStream);
-    if (count == 15)
-    {
-        esc_count = get9_n_lessbits(LEN_F_ESC, pInputStream);
-        count = esc_count + 14;
-    }
-
-
-
-    Extention_Type = get9_n_lessbits(LEN_F_CNT, pInputStream);
-
-
-    if (((Extention_Type == SBR_EXTENSION) || (Extention_Type == SBR_EXTENSION_CRC))
-            && (count < MAXSBRBYTES) && (count) && (sbrBitStream->NrElements < MAXNRELEMENTS))
-    {
-
-        sbrBitStream->sbrElement[sbrBitStream->NrElements].ExtensionType = Extention_Type;
-        sbrBitStream->sbrElement[sbrBitStream->NrElements].Payload       = count;
-        sbrBitStream->sbrElement[sbrBitStream->NrElements].Data[0]       = (UChar) get9_n_lessbits(LEN_F_CNT, pInputStream);
-        for (i = 1 ; i < count ; i++)
-        {
-            sbrBitStream->sbrElement[sbrBitStream->NrElements].Data[i] = (UChar) get9_n_lessbits(8, pInputStream);
-        }
-
-        sbrBitStream->NrElements += 1;
-
-    }
-    else
-    {
-        pInputStream->usedBits += (count - 1) * LEN_BYTE;
-        pInputStream->usedBits += 4;        /* compenste for LEN_F_CNT (=4) bits read for Extention_Type */
-
-    }
-}
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/get_sbr_bitstream.h b/media/libstagefright/codecs/aacdec/get_sbr_bitstream.h
deleted file mode 100644
index 8094b1a..0000000
--- a/media/libstagefright/codecs/aacdec/get_sbr_bitstream.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: get_sbr_bitstream.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_SBR_BITSTREAM_H
-#define GET_SBR_BITSTREAM_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "s_bits.h"
-#include "ibstream.h"
-#include "e_rawbitstreamconst.h"
-#include "s_sbrbitstream.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void get_sbr_bitstream(SBRBITSTREAM *sbrBitStream,
-    BITS *pInputStream);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_sbr_startfreq.cpp b/media/libstagefright/codecs/aacdec/get_sbr_startfreq.cpp
deleted file mode 100644
index 38ddc0b..0000000
--- a/media/libstagefright/codecs/aacdec/get_sbr_startfreq.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: get_sbr_startfreq.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "get_sbr_startfreq.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-const Int v_offset[7][16] =
-{
-    { -8, -7, -6, -5, -4, -3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7},
-    { -5, -4, -3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13},
-    { -5, -3, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16},
-    { -6, -4, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16},
-    { -4, -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16, 20},
-    { -2, -1,  0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16, 20, 24},
-    { 0,  1,  2,  3,  4,  5,  6,  7,  9, 11, 13, 16, 20, 24, 28, 33}
-};
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int get_sbr_startfreq(const Int32 fs,
-                      const Int32 start_freq)
-{
-    Int k0_min = 0;
-    Int32 index;
-
-
-    switch (fs)
-    {
-        case 16000:
-            index = 0;
-            k0_min = 24;
-            break;
-        case 22050:
-            index = 1;
-            k0_min = 17;
-            break;
-        case 24000:
-            index = 2;
-            k0_min = 16;
-            break;
-        case 32000:
-            index = 3;
-            k0_min = 16;
-            break;
-        case 44100:
-            index = 4;
-            k0_min = 12;
-            break;
-        case 48000:
-            index = 4;
-            k0_min = 11;
-            break;
-        case 64000:
-            index = 4;
-            k0_min = 10;
-            break;
-        case 88200:
-        case 96000:
-            index = 5;
-            k0_min = 7;
-            break;
-
-        default:
-            index = 6;
-    }
-    return (k0_min + v_offset[index][start_freq]);
-
-}
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_sbr_startfreq.h b/media/libstagefright/codecs/aacdec/get_sbr_startfreq.h
deleted file mode 100644
index 10fa160..0000000
--- a/media/libstagefright/codecs/aacdec/get_sbr_startfreq.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: get_sbr_startfreq.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_SBR_STARTFREQ_H
-#define GET_SBR_STARTFREQ_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-Int get_sbr_startfreq(const Int32 fs,
-                      const Int32 start_freq);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_sbr_stopfreq.cpp b/media/libstagefright/codecs/aacdec/get_sbr_stopfreq.cpp
deleted file mode 100644
index e32c61d..0000000
--- a/media/libstagefright/codecs/aacdec/get_sbr_stopfreq.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: get_sbr_stopfreq.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-     if(fs < 32000)
-     {
-         k1_min = (Int) ( ( (float) (6000 * 2 * 64) / fs ) + 0.5 );
-     }
-     else
-     {
-         if (fs < 64000)
-         {
-             k1_min = (Int) ( ( (float) (8000 * 2 * 64) / fs ) + 0.5 );
-         }
-         else
-         {
-             k1_min = (Int) ( ((float) (10000 * 2 * 64) / fs ) + 0.5);
-         }
-     }
-
-     return((Int)( k1_min * pow( 64.0 / k1_min,(stop_freq)/13.0) + 0.5));
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#include    "get_sbr_stopfreq.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-const UChar sbr_stopfreq_tbl[6][13] =
-{
-
-    { 21, 23, 25, 27, 29, 32, 35, 38, 41, 45, 49, 54, 59},  /* 48000  */
-    { 23, 25, 27, 29, 31, 34, 37, 40, 43, 47, 51, 55, 59},  /* 44100  */
-    { 32, 34, 36, 38, 40, 42, 44, 46, 49, 52, 55, 58, 61},  /* 32000  and 24000 */
-    { 35, 36, 38, 40, 42, 44, 46, 48, 50, 52, 55, 58, 61},  /* 22050  */
-    { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62}   /* 16000  */
-
-};
-
-Int get_sbr_stopfreq(const Int32 fs,
-                     const Int32 stop_freq)
-{
-
-    Int i;
-
-    switch (fs)
-    {
-        case 48000:
-            i = 0;
-            break;
-
-        case 32000:
-        case 24000:
-            i = 2;
-            break;
-
-        case 22050:
-            i = 3;
-            break;
-
-        case 16000:
-            i = 4;
-            break;
-
-        case 44100:
-        default:
-            i = 1;
-            break;
-    }
-
-    return((Int)sbr_stopfreq_tbl[i][stop_freq]);
-
-}
-
-
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/get_sbr_stopfreq.h b/media/libstagefright/codecs/aacdec/get_sbr_stopfreq.h
deleted file mode 100644
index 341a3d4..0000000
--- a/media/libstagefright/codecs/aacdec/get_sbr_stopfreq.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: get_sbr_stopfreq.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
- ----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_SBR_STOPFREQ_H
-#define GET_SBR_STOPFREQ_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-Int get_sbr_stopfreq(const Int32 fs,
-                     const Int32 stop_freq);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_sign_bits.h b/media/libstagefright/codecs/aacdec/get_sign_bits.h
deleted file mode 100644
index 445d2f2..0000000
--- a/media/libstagefright/codecs/aacdec/get_sign_bits.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_sign_bits.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Update comments for the structure
-
- Description: Change include file. Above description probably from another
-              header file.
-
- Description: Fix pathname above
-
- Who:                                               Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for the function get_sign_bits()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_SIGN_BITS_H
-#define GET_SIGN_BITS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "ibstream.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void get_sign_bits(
-    Int          q[],
-    BITS        *pInputStream,
-    const Int    q_len
-);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif /* GET_SIGN_BITS_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/get_tns.cpp b/media/libstagefright/codecs/aacdec/get_tns.cpp
deleted file mode 100644
index e0b021b..0000000
--- a/media/libstagefright/codecs/aacdec/get_tns.cpp
+++ /dev/null
@@ -1,573 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_tns.c
-
-     Date: 10/25/2000
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  Brought code in-line with PV standards.  Some minor
-               optimizations (count-down for loops, etc.) were made.
-
- Description:  Made cosmetic changes as suggested during review.  Also,
- changed calculation of s_mask and n_mask from table-based to being
- calculated based on res_index.  Also, the flag coef_res was changed
- from having a range of [3,4] to having a range of [0,1], which corresponds
- exactly with the true value that is passed via the bitstream.
-
- Description:  Modified to use more efficient TNS memory structure.
-
- Description: Updated to reflect more efficient usage of memory by the TNS
- filters.
-
- Description: Updated the SW template to include the full pathname to the
- source file and a slightly modified copyright header.
-
- Description: Moved pInputStream to be the 2nd parameter, for a slight
- optimization on some platforms.
-
- Description: Moved pSfbTop outside of the loops, since its value does
- not change.
-
- Description: Replace some instances of getbits to get1bits
-              when only 1 bit is read.
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    FrameInfo *pFrameInfo
-        Pointer to structure that holds information about each block.
-        (long block flag,
-         number of subblocks,
-         scalefactor bands per subblock, etc.)
-
-    BITS *pInputStream
-        Pointer to a BITS structure that is
-        passed on to function getbits to pull information from the bitstream.
-
-    TNS_Frame_info *pTnsFrameInfo
-        Pointer to filter data structure - to be populated by this function.
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    TNS_frame_info *pTnsFrameInfo
-
-    pTnsFrameInfo->n_filt = Number of tns filters to be applied to the data.
-
-    pTnsFrameInfo->filt[]->order = The order of each individual TNS filter.
-
-    pTnsFrameInfo->filt[]->coef_res = The resolution of the filter coefficients
-
-    pTnsFrameInfo->filt[]->start_band = start of spectral band
-
-    pTnsFrameInfo->filt[]->stop_band = end of spectral band
-
-    pTnsFrameInfo->filt[]->coef[] = Each filter's coefficients are filled with
-    data read from the input bitstream.
-
-    pTnsFrameInfo->filt[]->direction = A flag is set for each TNS filter.
-
-    If the direction flag (on the bitstream) = 0, then the filter
-    is applied to the block of spectral data in normal (upward) fashion.
-
-    If the direction flag (on the bitstream) = 1, then the filter
-    is applied in a reverse (downward) fashion.
-    (Starting with the last element in the block of data.)
-
-    The value stored in filt[]->direction maps the values [0,1] to [1,-1] for
-    a more intuitive storage of this flag's meaning.
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function reads the TNS filter information from the bitstream, and stores
- the filter order, LPC coefficients, and the number of TNS filters to
- be applied in the structure TNS_frame_info.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This code should match the ISO code in functionality, with the exception
- that coef_res has range of [0,1] (PV code) instead of [3,4] (ISO code)
-
- coef_res is only used by tns_decode_coef.
-
-------------------------------------------------------------------------------
- REFERENCES
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.8 (Temporal Noise Shaping)
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "get_tns.h"
-#include "s_mc_info.h"
-#include "s_frameinfo.h"
-#include "s_tnsfilt.h"
-#include "s_tns_frame_info.h"
-#include "s_bits.h"
-#include "ibstream.h"
-#include "e_window_sequence.h"
-#include "e_progconfigconst.h"
-
-#include "tns_decode_coef.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#define SCALE_FACTOR_BAND_OFFSET(x) ( ((x) > 0) ? pSFB_top[(x)-1] : 0 )
-#define MINIMUM(x,y) ( ((x) < (y)) ? (x) : (y) )
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-/*
- * The entries in the ensuing tables provide the maximum permissable
- * number of scalefactor bands for each TNS filter.  This value is effected
- * by the sampling rate, and window type.
- */
-
-const Int tns_max_bands_tbl_long_wndw[(1<<LEN_SAMP_IDX)] =
-    {31,       /* 96000 Hz */
-     31,       /* 88200 Hz */
-     34,       /* 64000 Hz */
-     40,       /* 48000 Hz */
-     42,       /* 44100 Hz */
-     51,       /* 32000 Hz */
-     46,       /* 24000 Hz */
-     46,       /* 22050 Hz */
-     42,       /* 16000 Hz */
-     42,       /* 12000 Hz */
-     42,       /* 11025 Hz */
-     39,       /* 8000  Hz */
-     0,
-     0,
-     0,
-     0
-    };
-
-const Int tns_max_bands_tbl_short_wndw[(1<<LEN_SAMP_IDX)] =
-    {9,       /* 96000 Hz */
-     9,       /* 88200 Hz */
-     10,       /* 64000 Hz */
-     14,       /* 48000 Hz */
-     14,       /* 44100 Hz */
-     14,       /* 32000 Hz */
-     14,       /* 24000 Hz */
-     14,       /* 22050 Hz */
-     14,       /* 16000 Hz */
-     14,       /* 12000 Hz */
-     14,       /* 11025 Hz */
-     14,       /* 8000  Hz */
-     0,
-     0,
-     0,
-     0
-    };
-
-/*
- * For completeness, here are the table entries for object types that make
- * use of PQF filter bank.  We do not currently support this; these are
- * given here only to ease future implementation.
- *
- *  const Int tns_max_bands_tbl_long_wndw_PQF[(1<<LEN_SAMP_IDX)] =
- *         {28,       ; 96000
- *          28,       ; 88200
- *          27,       ; 64000
- *          26,       ; 48000
- *          26,       ; 44100
- *          26,       ; 32000
- *          29,       ; 24000
- *          29,       ; 22050
- *          23,       ; 16000
- *          23,       ; 12000
- *          23,       ; 11025
- *          19,       ; 8000
- *           0,
- *           0,
- *           0,
- *           0};
- *
- *  const Int tns_max_bands_tbl_short_wndw_PQF[(1<<LEN_SAMP_IDX)] =
- *         {7,       ; 96000
- *          7,       ; 88200
- *          7,       ; 64000
- *          6,       ; 48000
- *          6,       ; 44100
- *          6,       ; 32000
- *          7,       ; 24000
- *          7,       ; 22050
- *          8,       ; 16000
- *          8,       ; 12000
- *          8,       ; 11025
- *          7,       ; 8000
- *          0,
- *          0,
- *          0,
- *          0};
- */
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void get_tns(
-    const Int               max_bands,
-    BITS            * const pInputStream,
-    const WINDOW_SEQUENCE   wnd_seq,
-    const FrameInfo * const pFrameInfo,
-    const MC_Info   * const pMC_Info,
-    TNS_frame_info  * const pTnsFrameInfo,
-    Int32                   scratchTnsDecCoefMem[])
-{
-
-    const Int16 * const pSFB_top = pFrameInfo->win_sfb_top[0];
-
-    Int f;
-    Int t;
-    Int win;
-    UInt tempInt;
-
-    Int num_filt_bits;
-    Int num_order_bits;
-    Int num_start_band_bits;
-
-    Int top;
-    Int res;
-    Int res_index;
-    Int compress;
-
-    Int sfb_per_win;
-
-    Int32 *pLpcCoef;
-    Int32 *pStartLpcCoef;
-    Int s_mask;
-    Int n_mask;
-
-    Int tns_bands;
-    UInt max_order;
-    Int coef_res;
-
-
-    TNSfilt *pFilt;
-
-    if (wnd_seq != EIGHT_SHORT_SEQUENCE)
-    {
-        num_filt_bits  = 2;
-        num_order_bits = 5;
-        num_start_band_bits = 6;
-
-        tns_bands = tns_max_bands_tbl_long_wndw[pMC_Info->sampling_rate_idx];
-
-        /*
-         *  Definition from 14496-3:1999 doc. Our first encoder follows this rule,
-         *  later encoders don't
-         */
-
-        if (pMC_Info->sampling_rate_idx > 4)  /* if (sampling_rate <= 32000 */
-        {
-            max_order = 20;
-        }
-        else
-        {
-            max_order = 12;
-        }
-    }
-    else
-    {
-        num_filt_bits  = 1;
-        num_order_bits = 3;
-        num_start_band_bits = 4;
-
-        tns_bands = tns_max_bands_tbl_short_wndw[pMC_Info->sampling_rate_idx];
-
-        max_order = 7;
-    }
-
-    /*
-     * After this branch, tns_bands will be equal to the minimum of
-     * the passed in variable, nbands, and the result from the
-     * tns_max_bands_tbl
-     */
-
-    if (max_bands < tns_bands)
-    {
-        tns_bands = max_bands;
-    }
-
-    sfb_per_win = pFrameInfo->sfb_per_win[0];
-
-    win = 0;
-
-    pLpcCoef = pTnsFrameInfo->lpc_coef;
-
-    pFilt = pTnsFrameInfo->filt;
-
-    do
-    {
-        tempInt = get9_n_lessbits(num_filt_bits,
-                                  pInputStream);
-
-        pTnsFrameInfo->n_filt[win] = tempInt;
-
-        if (tempInt != 0)
-        {
-            /*
-             * coef_res = [0, 1]
-             * Switch between a resolution of 3 and 4 bits respectively
-             *
-             * if coef_res = 0, the coefficients have a range of
-             *
-             *                 -4  -3  -2  -1  0   1   2   3
-             *
-             * if coef_res = 1, the coefficients have a range of
-             *
-             * -8  -7  -6  -5  -4  -3  -2  -1  0   1   2   3   4   5   6   7
-             *
-             * The arrays in ./src/tns_tab.c are completely based on
-             * the value of coef_res.
-             */
-            res = get1bits(
-                      pInputStream);
-
-            /* res is post-incremented for correct calculation of res_index */
-            coef_res = res++;
-
-            top = sfb_per_win;
-
-            for (f = pTnsFrameInfo->n_filt[win]; f > 0; f--)
-            {
-                tempInt = MINIMUM(top, tns_bands);
-
-                pFilt->stop_coef = SCALE_FACTOR_BAND_OFFSET(tempInt);
-
-                pFilt->stop_band = tempInt;
-
-                top -= get9_n_lessbits(num_start_band_bits,
-                                       pInputStream);
-
-                tempInt = MINIMUM(top, tns_bands);
-
-                pFilt->start_coef = SCALE_FACTOR_BAND_OFFSET(tempInt);
-
-                pFilt->start_band = tempInt;
-
-                tempInt = get9_n_lessbits(num_order_bits,
-                                          pInputStream);
-
-                pFilt->order = tempInt;
-
-                if (tempInt != 0)
-                {
-                    if (tempInt > max_order)
-                    {
-                        pFilt->order = max_order;
-                    }
-
-                    /*
-                     * This maps the bitstream's [0,1] to
-                     * pFilt->direction = [1,-1]
-                     */
-
-                    tempInt = get1bits(pInputStream);
-
-                    pFilt->direction = (-(Int)tempInt) | 0x1;
-
-                    /*
-                     * compress = [0,1]
-                     * If compress is true, the MSB has
-                     * been omitted from transmission (Ref. 1)
-                     *
-                     * For coef_res = 0, this limits the range of
-                     * transmitted coefficients to...
-                     *
-                     *         -2  -1  0   1
-                     *
-                     * For coef_res = 1, the coefficients have
-                     * a range of...
-                     *
-                     * -4  -3  -2  -1  0   1   2   3
-                     */
-                    compress = get1bits(pInputStream);
-
-                    /*
-                     * res has a range of [1,2]
-                     * compress has a range of [0,1]
-                     * So (res - compress) has range [0,2];
-                     */
-                    res_index = res - compress;
-
-                    s_mask =  2 << res_index;
-
-                    /*
-                     * If res_index = 0, grab 2 bits of data
-                     * If res_index = 1, grab 3 bits of data
-                     * If res_index = 2, grab 4 bits of data
-                     */
-                    res_index += 2;
-
-                    pStartLpcCoef = pLpcCoef;
-
-                    for (t = pFilt->order; t > 0; t--)
-                    {
-                        /*
-                         * These are the encoded coefficients, which will
-                         * later be decoded into LPC coefficients by
-                         * the function tns_decode_coef()
-                         */
-                        tempInt = get9_n_lessbits(res_index,
-                                                  pInputStream);
-
-                        n_mask  = -((Int)tempInt & s_mask);
-
-                        /*
-                         * n_mask is used to sign_extend the
-                         * value, if it is negative.
-                         *
-                         */
-                        *(pLpcCoef++) = tempInt | n_mask;
-                    }
-
-                    /* Decode the TNS coefficients */
-
-                    tempInt = pFilt->stop_coef - pFilt->start_coef;
-
-                    if (tempInt > 0)
-                    {
-                        pFilt->q_lpc =
-                            tns_decode_coef(
-                                pFilt->order,
-                                coef_res,
-                                pStartLpcCoef,
-                                scratchTnsDecCoefMem);
-                    }
-
-                } /* if (pTnsFilt->order != 0) */
-
-                pFilt++;
-
-            } /* END for (f=pTnsInfo->n_filt; f>0; f--, pTnsFilt++) */
-
-        } /* if (pTnsInfo->n_filt != 0) */
-
-        win++;
-
-    }
-    while (win < pFrameInfo->num_win);
-
-    return;
-
-} /* get_tns */
diff --git a/media/libstagefright/codecs/aacdec/get_tns.h b/media/libstagefright/codecs/aacdec/get_tns.h
deleted file mode 100644
index 731484f..0000000
--- a/media/libstagefright/codecs/aacdec/get_tns.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: get_tns.h
-
-   Author:
-     Date: 03/08/2001
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Description: Modified to include updated function declaration, which reflects
- the combination of the get_tns and tns_setup_filter routines.  Also, moved
- pInputStream to be the 2nd parameter, for a slight optimization.
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-  This file includes the function definition for get_tns.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GET_TNS_H
-#define GET_TNS_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_frameinfo.h"
-#include "s_mc_info.h"
-#include "s_tns_frame_info.h"
-#include "s_bits.h"
-#include "e_window_sequence.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-    void get_tns(
-        const Int               max_bands,
-        BITS            * const pInputStream,
-        const WINDOW_SEQUENCE   wnd_seq,
-        const FrameInfo * const pFrameInfo,
-        const MC_Info   * const pMC_Info,
-        TNS_frame_info  * const pTnsFrameInfo,
-        Int32                   scratchTnsDecCoefMem[]);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GET_TNS_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/getbits.h b/media/libstagefright/codecs/aacdec/getbits.h
deleted file mode 100644
index e854be5..0000000
--- a/media/libstagefright/codecs/aacdec/getbits.h
+++ /dev/null
@@ -1,346 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: getbits.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Update comments for the structure
-
- Description: Move structur to another file
-
- Who:                                            Date: MM/DD/YYYY
- Description:
-
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for the function getbits().
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GETBITS_H
-#define GETBITS_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "ibstream.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#define INBUF_ARRAY_INDEX_SHIFT  (3)
-#define INBUF_BIT_WIDTH         (1<<(INBUF_ARRAY_INDEX_SHIFT))
-#define INBUF_BIT_MODULO_MASK   ((INBUF_BIT_WIDTH)-1)
-
-#define MAX_GETBITS             (25)
-
-#define  CHECK_INPUT_BUFFER_LIMITS  1
-
-    __inline UInt32 getbits(
-        const UInt  neededBits,
-        BITS       *pInputStream)
-    {
-        UInt32   returnValue = 0;
-        UInt     offset;
-        UInt     bitIndex;
-        UChar    *pElem;        /* Needs to be same type as pInput->pBuffer */
-
-        offset = (pInputStream->usedBits) >> INBUF_ARRAY_INDEX_SHIFT;
-
-        pElem = pInputStream->pBuffer + offset;
-
-#if CHECK_INPUT_BUFFER_LIMITS
-
-        offset =  pInputStream->inputBufferCurrentLength - offset;
-        /*  check if access to input buffer does not go beyond boundaries */
-        if (offset > 3)
-        {
-            returnValue = (((UInt32) * (pElem)) << 24) |
-                          (((UInt32) * (pElem + 1)) << 16) |
-                          (((UInt32) * (pElem + 2)) << 8) |
-                          ((UInt32) * (pElem + 3));
-        }
-        else  /*  then access only available bytes  */
-        {
-            /*  Access to the bitstream beyond frame boundaries are not allowed,
-             *  Here, only what was available before the end of the frame will
-             *  be processed. Non-accessible bytes will be filled in with zeros.
-             *  Zero values guarantees that the data structures are filled in with values
-             *  that eventually will signal an error (like invalid parameters) or that allow
-             *  completion of the parsing routine.
-             *  Overrun is detected on file pvmp4audiodecodeframe.cpp.
-             */
-            switch (offset)
-            {
-                case 3:
-                    returnValue  = (((UInt32) * (pElem + 2)) << 8);
-                case 2:
-                    returnValue |= (((UInt32) * (pElem + 1)) << 16);
-                case 1:
-                    returnValue |= (((UInt32) * (pElem)) << 24);
-                default:
-                    break;
-            }
-        }
-
-
-#else
-
-        returnValue = (((UInt32) * (pElem)) << 24) |
-                      (((UInt32) * (pElem + 1)) << 16) |
-                      (((UInt32) * (pElem + 2)) << 8) |
-                      ((UInt32) * (pElem + 3));
-#endif
-
-        /* Remove extra high bits by shifting up */
-        bitIndex = (UInt)((pInputStream->usedBits) & INBUF_BIT_MODULO_MASK);
-
-        /* This line is faster way to mask off the high bits. */
-        returnValue = returnValue << (bitIndex);
-
-        /* Move the field down. */
-        returnValue = returnValue >> (32 - neededBits);
-
-        pInputStream->usedBits += neededBits;
-
-        return (returnValue);
-
-    }
-
-
-
-    __inline UInt get1bits(
-        BITS       *pInputStream)
-    {
-        UInt     returnValue;
-        UInt     offset;
-        UInt     bitIndex;
-        UChar    *pElem;        /* Needs to be same type as pInput->pBuffer */
-
-        offset = (pInputStream->usedBits) >> INBUF_ARRAY_INDEX_SHIFT;
-
-        pElem = pInputStream->pBuffer + offset;
-
-#if CHECK_INPUT_BUFFER_LIMITS
-        returnValue = (offset < pInputStream->inputBufferCurrentLength) ? ((UInt) * (pElem)) : 0;
-#else
-        returnValue = ((UInt32) * (pElem));
-#endif
-
-
-        /* Remove extra high bits by shifting up */
-        bitIndex = (UInt)((pInputStream->usedBits++) & INBUF_BIT_MODULO_MASK);
-
-        /* This line is faster way to mask off the high bits. */
-        returnValue = 0xFF & (returnValue << (bitIndex));
-
-        /* Move the field down. */
-
-        return ((UInt)(returnValue >> 7));
-
-    }
-
-
-
-    __inline UInt get9_n_lessbits(
-        const UInt  neededBits,
-        BITS       *pInputStream)
-
-    {
-        UInt     returnValue;
-        UInt     offset;
-        UInt     bitIndex;
-        UChar    *pElem;        /* Needs to be same type as pInput->pBuffer */
-
-        offset = (pInputStream->usedBits) >> INBUF_ARRAY_INDEX_SHIFT;
-
-        pElem = pInputStream->pBuffer + offset;
-
-#if CHECK_INPUT_BUFFER_LIMITS
-
-
-        offset =  pInputStream->inputBufferCurrentLength - offset;
-        /*  check if access to input buffer does not go beyond boundaries */
-        if (offset > 1)
-        {
-            returnValue = (((UInt32) * (pElem)) << 8) |
-                          ((UInt32) * (pElem + 1));
-        }
-        else  /*  then access only available bytes  */
-        {
-            /*  Access to the bitstream beyond frame boundaries are not allowed,
-             *  Here, only what was available before the end of the frame will
-             *  be processed. Non-accessible bytes will be filled in with zeros.
-             *  Zero values guarantees that the data structures are filled in with values
-             *  that eventually will signal an error (like invalid parameters) or that allow
-             *  completion of the parsing routine.
-             *  Overrun is detected on file pvmp4audiodecodeframe.cpp
-             */
-            switch (offset)
-            {
-                case 1:
-                    returnValue  = (((UInt32) * (pElem)) << 8);
-                    break;
-                default:
-                    returnValue = 0;
-                    break;
-            }
-        }
-
-
-#else
-        returnValue = (((UInt32) * (pElem)) << 8) |
-                      ((UInt32) * (pElem + 1)) ;
-#endif
-
-        /* Remove extra high bits by shifting up */
-        bitIndex = (UInt)((pInputStream->usedBits) & INBUF_BIT_MODULO_MASK);
-
-        pInputStream->usedBits += neededBits;
-
-        /* This line is faster way to mask off the high bits. */
-        returnValue = 0xFFFF & (returnValue << (bitIndex));
-
-        /* Move the field down. */
-
-        return (UInt)(returnValue >> (16 - neededBits));
-
-    }
-
-    __inline UInt32 get17_n_lessbits(
-        const UInt  neededBits,
-        BITS       *pInputStream)
-    {
-        UInt32   returnValue;
-        UInt     offset;
-        UInt     bitIndex;
-        UChar    *pElem;        /* Needs to be same type as pInput->pBuffer */
-
-        offset = (pInputStream->usedBits) >> INBUF_ARRAY_INDEX_SHIFT;
-
-        pElem = pInputStream->pBuffer + offset;
-
-#if CHECK_INPUT_BUFFER_LIMITS
-
-        offset =  pInputStream->inputBufferCurrentLength - offset;
-        /*  check if access to input buffer does not go beyond boundaries */
-
-        if (offset > 2)
-        {
-            returnValue = (((UInt32) * (pElem)) << 16) |
-                          (((UInt32) * (pElem + 1)) << 8) |
-                          ((UInt32)  * (pElem + 2));
-        }
-        else   /*  then access only available bytes  */
-        {
-            /*  Access to the bitstream beyond frame boundaries are not allowed,
-             *  Here, only what was available before the end of the frame will
-             *  be processed. Non-accessible bytes will be filled in with zeros.
-             *  Zero values guarantees that the data structures are filled in with values
-             *  that eventually will signal an error (like invalid parameters) or that allow
-             *  completion of the parsing routine.
-             *  Overrun is detected on file pvmp4audiodecodeframe.cpp
-             */
-            returnValue = 0;
-            switch (offset)
-            {
-                case 2:
-                    returnValue  = (((UInt32) * (pElem + 1)) << 8);
-                case 1:
-                    returnValue |= (((UInt32) * (pElem)) << 16);
-                default:
-                    break;
-            }
-        }
-
-#else
-
-        returnValue = (((UInt32) * (pElem)) << 16) |
-                      (((UInt32) * (pElem + 1)) << 8) |
-                      ((UInt32)  * (pElem + 2));
-#endif
-
-        /* Remove extra high bits by shifting up */
-        bitIndex = (UInt)((pInputStream->usedBits) & INBUF_BIT_MODULO_MASK);
-
-        /* This line is faster way to mask off the high bits. */
-        returnValue = 0xFFFFFF & (returnValue << (bitIndex));
-
-        /* Move the field down. */
-        returnValue = returnValue >> (24 - neededBits);
-
-        pInputStream->usedBits += neededBits;
-
-        return (returnValue);
-
-    }
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif /* GETBITS_H*/
-
-
diff --git a/media/libstagefright/codecs/aacdec/getfill.cpp b/media/libstagefright/codecs/aacdec/getfill.cpp
deleted file mode 100644
index 3c4fc4c..0000000
--- a/media/libstagefright/codecs/aacdec/getfill.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: getfill.c
- Funtions: getfill
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  1. Used template to re-organize function and filled out
-                  Input/Output and Function definition section.
-               2. Optimized code.
-
- Description:  Made the following changes based on review comments.
-               1. Exchanging MODIFYING and RETURNING on line 87, 88.
-               2. Added MPEG reference.
-               3. Changed "fill" to "pass over", "bitstreams are" to
-                  "bitstream is" in FUNCTION DESCRIPTION section.
-               4. Fixed tabs.
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less.
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pInputStream = pointer to structure BITS containing input stream
-                   information.
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    pInputStream->usedBits is updated to the newly calculated value.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function passes over fill bits in the raw data block to adjust the
- instantaneous bit rate when the bitstream is to be transmitted over a
- constant rate channel.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- None
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-     Subpart 4      p15     (Table 4.4.11)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    CALL getbits(
-            LEN_F_CNT,
-            pInputStream);
-    MODIFYING (pInputStream)
-    RETURNING (cnt)
-
-    IF ( cnt == (1<<LEN_F_CNT)-1 )
-
-        CALL getbits(
-                LEN_F_ESC,
-                pInputStream);
-        MODIFYING (pInputStream)
-        RETURNING (esc_cnt)
-
-        cnt +=  esc_cnt - 1;
-
-    ENDIF
-
-    pInputStream->usedBits += cnt * LEN_BYTE;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-        stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-        name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_bits.h"
-#include "ibstream.h"
-#include "e_rawbitstreamconst.h"
-#include "getfill.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void getfill(BITS *pInputStream)
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-    Int cnt;
-    Int esc_cnt;
-
-    /*----------------------------------------------------------------------------
-    ; Function body here
-    ----------------------------------------------------------------------------*/
-
-    cnt = get9_n_lessbits(
-              LEN_F_CNT,
-              pInputStream);
-
-    if (cnt == (1 << LEN_F_CNT) - 1)  /* if (cnt == 15) */
-    {
-        esc_cnt = get9_n_lessbits(
-                      LEN_F_ESC,
-                      pInputStream);
-
-        cnt +=  esc_cnt - 1;
-    }
-
-    /*
-     * The following codes are replaced by directly updating usedBits
-     * in BITS structure. This will save one call for getbits().
-     *
-     * for (i=0; i<cnt; i++)
-     * { getbits(LEN_BYTE, pInputStream); }
-     */
-
-    pInputStream->usedBits += cnt * LEN_BYTE;
-
-    /*----------------------------------------------------------------------------
-    ; Return nothing or data or data pointer
-    ----------------------------------------------------------------------------*/
-
-} /* getfill */
-
diff --git a/media/libstagefright/codecs/aacdec/getfill.h b/media/libstagefright/codecs/aacdec/getfill.h
deleted file mode 100644
index 3ba976a..0000000
--- a/media/libstagefright/codecs/aacdec/getfill.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: getfill.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Changed "definition" to "declaration" on line 28 per
-              review comments.
-
- Who:                           Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file contains prototype declaration for getfill function.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef GETFILL_H
-#define GETFILL_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "s_bits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void getfill(BITS    *pInputStream);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/getgroup.cpp b/media/libstagefright/codecs/aacdec/getgroup.cpp
deleted file mode 100644
index 0f909cd..0000000
--- a/media/libstagefright/codecs/aacdec/getgroup.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: getgroup.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description: (1) Modified to bring code in-line with PV standards
-              (2) Eliminated if(first_short) statement, move for-loop
-                  inside if statement
-              (3) Modified UChar -> Int on data types of group
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less.
-
- Who:                       Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pInputStream = pointer to structure that holds input bitstream
-                   information. Type BITS
-
-    group[]     = array that holds the index of the first window in each
-                  group. Type Int
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    group   contains the index of first windows in each group
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function reads the window grouping information associated with an
- Individual Channel Stream (ICS). If the window sequence is
- EIGHT_SHORT_SEQUENCE, scalefactor grouping information is transmitted. If a
- set of short windows form a group then they share scalefactors, intensity
- positions and PNS information. The first short window is always a new group
- so no grouping bit is transmitted. Subsequent short windows are in the same
- group if the associated grouping bit is 1. A new group is started if the
- associated grouping bit is 0.
- The pointer pGroup points to an array that stores the first window index
- of next group. For example, if the window grouping is:
-
- window index:    |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
- grouping    :    |<-   0   ->|  1  |<-    2        ->|<-   3   ->|
-
- Then:
-
-    group[]  :    |     2     |  3  |        6        |     8     |
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function should replace the contents of the array pointed to by pGroup
- with the first window indexes of groups starting from the second group.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-    Subpart 4
-                    p16 (Table 4.4.6)
-                    p55 (Recovering ics_info)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    IF (pFrameInfo->coef_per_win[0] > SN2)
-
-        *pGroup++ = 1;
-        *pGroup   = 1;
-
-    ELSE
-
-        FOR (win = 1; win < pFrameInfo->num_win; win++)
-
-            IF (getbits(1,pInputStream) == 0)
-
-                *pGroup++ = win;
-
-            ENDIF
-
-        ENDFOR (win)
-
-        *pGroup = win;
-
-    ENDIF(pFrameInfo)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "huffman.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define     SEVEN   7
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void getgroup(
-    Int         group[],
-    BITS        *pInputStream)
-{
-    Int      win;
-    Int     *pGroup;
-    UInt     mask;
-    UInt     groupBits;
-
-    pGroup      = group;
-
-    mask        = 0x40;
-
-    /* only short-window sequences are grouped!
-     * first short window is always a new group,
-     * start reading bitstream from the second
-     * window, a new group is indicated by an
-     * "0" bit in the input stream
-     */
-    groupBits =
-        get9_n_lessbits(
-            SEVEN,
-            pInputStream);
-
-    for (win = 1; win < NUM_SHORT_WINDOWS; win++)
-    {
-        if ((groupBits & mask) == 0)
-        {
-            *pGroup++ = win;
-
-        } /* if (groupBits) */
-
-        mask >>= 1;
-
-    } /* for (win) */
-
-    *pGroup = win;
-
-} /* getgroup */
diff --git a/media/libstagefright/codecs/aacdec/getics.cpp b/media/libstagefright/codecs/aacdec/getics.cpp
deleted file mode 100644
index 8d76744..0000000
--- a/media/libstagefright/codecs/aacdec/getics.cpp
+++ /dev/null
@@ -1,674 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: getics.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables
-
- Description: Remove pass-in parameter global_gain, define it on stack.
-
- Description: (1) Modified to bring in-line with PV standards
-              (2) Modified pass in parameters
-              (3) Removed multiple returns, removed some if branch
-              (4) Replace for loop with pv_memset
-
- Description: Remove prstflag, fix copyright.
-
- Description: Fix pseudo-code
-
- Description: Remove lpflag from get_ics_info
-
- Description: (1) Removed widx, therefore, pChVarsWin is eliminated from
-                  pass in parameter
-
- Description: merged the above changes from Michael and Wen
-
- Description: Removed initialization of "pTnsFrameInfo->num_subblocks" since
- this element was removed from that structure, as a part of
- rearchitecting the TNS routines to use memory more efficiently.
-
- Description:
- (1) Added #include of "e_HuffmanConst.h"
-     Previously, this function was relying on another include file
-     to include "e_HuffmanConst.h"
-
- (2) Updated the copyright header.
-
- (3) Added #include of <stdlib.h> for NULL macro definition.
-
- Description:
- (1) Removed the first parameter to getics.c  This extra
-     FrameInfo was not needed, the contents of winmap can be used.
- (2) Removed the memcpy of the data from winmap to the temporary
-     FrameInfo.
-
- Description: Replace some instances of getbits to get1bits
-              when only 1 bit is read.
-
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pInputStream    =   pointer to structure that holds input stream,
-                        Type BITS
-
-    common_window   =   flag that indicates whether left and right channel
-                        share the same window sequence & shape, Type Int
-
-    pVars           =   pointer to structure that holds decoder information
-                        Type tDec_Int_File
-
-    pChVarsCh       =   pointer to structure that holds channel related
-                        decoding information, Type tDec_Int_Chan
-
-    group[]         =   pointer to array that contains window grouping
-                        information of current frame, Type UChar
-
-    pMax_sfb        =   pointer to variable that stores maximum active
-                        scalefactor bands of current frame, Type UChar
-
-    pCodebookMap    =   pointer to array that holds the indexes of all
-                        Huffman codebooks used for current frame, ordered
-                        from section 0 to last section. Type UChar
-
-    pTnsFrameInfo   =   pointer to structure that holds TNS information.
-                        Type TNS_frame_info
-
-    pWinMap         =   array of pointers which points to structures that
-                        hold information of long and short window sequences
-                        Type FrameInfo
-
-    pPulseInfo       =   pointer to structure that holds pulse data decoding
-                        information, Type Nec_info
-
-    sect[]          =   array of structures that hold section codebook and
-                        section length in current frame, Type SectInfo
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    status = 0  if success
-             1  otherwise
-
- Pointers and Buffers Modified:
-    pCodebookMap    contents are replaced by the indexes of all the huffman
-                    codebooks used for current frame
-
-    pWinMap         For short windows, the contents of frame_sfb_top are
-                    modified by calc_gsfb_table, with the top coefficient
-                    index of each scalefactor band.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function decodes individual channel stream by calling other Huffman
- decoding functions.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function replaces the contents of pCodebookMap with the decoded
- codebook indexes. By calling hufffac, it decodes scale factor data. Call
- huffspec_fxp to decode spectral coefficients of current frame.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-    Subpart 4           p24 (Table 4.4.24)
-                        p54 (4.5.2.3.2)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pGroup = group;
-
-    global_gain = CALL getbits(
-                            neededBits   = LEN_SCL_PCM,
-                            pInputStream = pInputStream)
-                        MODIFYING(pInputStream)
-                        ReTURNING(global_gain)
-
-    IF (common_window == FALSE)
-    THEN
-        status = CALL get_ics_info(
-                        pVars->mc_info.audioObjectType,
-                        pInputStream,
-                        common_window,
-                       &pChVars->wnd,
-                       &pChVars->wnd_shape_this_bk,
-                        group,
-                        pMax_sfb,
-                        pWinMap,
-                        &pChVars->lt_status,
-                        NULL)
-                    MODIFYING(pInputStream,pChVars,group,max_sfb,lt_status)
-                    RETURNING(status)
-    ENDIF
-
-    memcpy(pFrameInfo, pWinMap[pChVars->wnd], sizeof(FrameInfo))
-
-    IF (*pMax_sfb > 0)
-    THEN
-
-        i      = 0;
-        totSfb = 0;
-
-        DO
-
-            totSfb++;
-
-        WHILE( *pGroup++ < pFrameInfo->num_win);
-
-        totSfb  *=  pFrameInfo->sfb_per_win[0];
-
-        nsect = CALL huffcb(
-                        sect,
-                        pInputStream,
-                        pFrameInfo->sectbits,
-                        totSfb,
-                        pFrameInfo->sfb_per_win[0],
-                       *pMax_sfb)
-                    MODIFYING(sect,pInputStream,sectbits)
-                    RETURNING(nsect)
-
-        IF (nsect == 0)
-        THEN
-            status = 1
-
-        ENDIF
-
-        sectStart = 0;
-        FOR (i = 0; i < nsect; i++)
-
-            cb  = sect[i].sect_cb;
-            sectWidth =  sect[i].sect_end - sectStart;
-            sectStart += sectWidth;
-
-            WHILE (sectWidth > 0)
-
-                *pCodebookMap++ = cb
-                 sectWidth--
-            ENDWHILE
-
-        ENDFOR (i)
-
-    ELSE
-
-        memset(pCodebookMap,ZERO_HCB,MAXBANDS*sizeof(*pCodebookMap));
-
-    ENDIF (*pMax_sfb)
-
-    IF (pFrameInfo->islong == FALSE)
-    THEN
-        CALL calc_gsfb_table(
-                pFramInfo = pFrameInfo,
-                group[]   = group)
-              MODIFYING(pFrameInfo->frame_sfb_top)
-              RETURNING(void)
-    ENDIF
-
-    IF (status == SUCCESS)
-    THEN
-        status = CALL hufffac(
-                        pFrameInfo,
-                        pInputStream,
-                        group,
-                        nsect,
-                        sect,
-                        global_gain,
-                        pChVars->factors,
-                        pVars->huffBookUsed)
-                    MODIFYING(pInputStream,factors)
-                    RETURNING(status)
-
-    ENDIF (status)
-
-    IF (status == SUCCESS)
-    THEN
-        present = CALL getbits(
-                        neededBits   = LEN_PULSE_PRES,
-                        pInputStream = pInputStream)
-                    MODIFYING(pInputStream)
-                    RETURNING(present)
-
-        pPulseInfo->pulse_data_present = present;
-
-        IF (present != FALSE)
-        THEN
-            IF (pFrameInfo->islong == 1)
-            THEN
-                CALL get_pulse_data(
-                          pPulseInfo = pPulseInfo,
-                          pInputStream = pInputStream)
-                    MODIFYING(pInputStream,pPulseInfo)
-                    RETURNING(void)
-
-            ELSE
-
-                status = 1;
-
-            ENDIF (pFrameInfo)
-        ENDIF (present)
-
-    ENDIF (status)
-
-    IF (status == SUCCESS)
-    THEN
-        present = CALL getbits(
-                        neededBits = LEN_TNS_PRES,
-                        pInputStream = pInputStream)
-                    MODIFYING(pInputStream)
-                    RETURNING(present)
-
-        pTnsFrameInfo->tns_data_present = present;
-
-        IF (present != FALSE)
-        THEN
-            CALL get_tns(
-                    pFrameInfo = pFrameInfo,
-                    pTnsFrameInfo = pTnsFrameInfo,
-                    pInputStream = pInputStream)
-                MODIFYING(pInputStream, pTnsFrameInfo)
-                RETURNING(void)
-        ELSE
-
-            FOR (i = pTnsFrameInfo->n_subblocks - 1; i >= 0 ; i--)
-
-                pTnsFrameInfo->info[i].n_filt = 0;
-            ENDFOR
-
-        ENDIF(present)
-
-    ENDIF (status)
-
-    IF (status == SUCCESS)
-    THEN
-        present = CALL getbits(
-                        neededBits = LEN_GAIN_PRES,
-                        pInputStream = pInputStream)
-                MODIFYING(pInputStream)
-                RETURNING(present)
-
-        IF (present != FALSE)
-        THEN
-            status = 1;
-        ENDIF
-    ENDIF (status)
-
-    IF (status == SUCCESS)
-    THEN
-        status = CALL huffspec_fxp(
-                        pFrameInfo,
-                        pInputStream,
-                        nsect,
-                        sect,
-                        pChVars->factors,
-                        pChVars->fxpCoef,
-                        pVars->quantSpec,
-                        pVars->tmp_spec,
-                        pWinMap[ONLY_LONG_WINDOW],
-                        pPulseInfo,
-                        pChVars->qFormat)
-                MODIFYING(pInputStream,fxpCoef,quantSpec,tmp_spec,qFormat)
-                RETURNING(status)
-    ENDIF
-
-    RETURN status
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "e_huffmanconst.h"
-#include    "huffman.h"
-#include    "aac_mem_funcs.h"
-#include    "get_tns.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int getics(
-    BITS            *pInputStream,
-    Int             common_window,
-    tDec_Int_File   *pVars,
-    tDec_Int_Chan   *pChVars,
-    Int             group[],
-    Int             *pMax_sfb,
-    Int             *pCodebookMap,
-    TNS_frame_info  *pTnsFrameInfo,
-    FrameInfo       **pWinMap,
-    PulseInfo       *pPulseInfo,
-    SectInfo        sect[])
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-    Int     status = SUCCESS;
-
-    Int     nsect = 0;
-    Int     i;
-    Int     cb;
-    Int     sectWidth;
-    Int     sectStart;
-    Int     totSfb;
-    Int     *pGroup;
-
-    FrameInfo *pFrameInfo;
-
-    Int     global_gain; /* originally passed in from huffdecode */
-    Bool    present;
-
-    /*----------------------------------------------------------------------------
-    ; Function body here
-    ----------------------------------------------------------------------------*/
-    pGroup = group;
-
-    /* read global gain from Input bitstream */
-    global_gain =
-        get9_n_lessbits(
-            LEN_SCL_PCM,
-            pInputStream);
-
-    if (common_window == FALSE)
-    {
-        status = get_ics_info(
-                     pVars->mc_info.audioObjectType,
-                     pInputStream,
-                     common_window,
-                     &pChVars->wnd,
-                     &pChVars->wnd_shape_this_bk,
-                     group,
-                     pMax_sfb,
-                     pWinMap,
-                     &pChVars->pShareWfxpCoef->lt_status,
-                     NULL);
-    }
-
-    pFrameInfo = pWinMap[pChVars->wnd];
-
-    /* First, calculate total number of scalefactor bands
-     * for this grouping. Then, decode section data
-     */
-    if (*pMax_sfb > 0)
-    {
-
-        /* calculate total number of sfb */
-        i      = 0;
-        totSfb = 0;
-
-        do
-        {
-            totSfb++;
-
-        }
-        while (*pGroup++ < pFrameInfo->num_win);
-
-        totSfb  *=  pFrameInfo->sfb_per_win[0];
-
-        /* decode section data */
-        nsect =
-            huffcb(
-                sect,
-                pInputStream,
-                pFrameInfo->sectbits,
-                totSfb,
-                pFrameInfo->sfb_per_win[0],
-                *pMax_sfb);
-
-        if (nsect == 0)
-        {
-            status = 1;     /* decode section data error */
-
-        }/* if (nsect) */
-
-        /* generate "linear" description from section info
-         * stored as codebook for each scalefactor band and group
-         * when nsect == 0, for-loop does not execute
-         */
-        sectStart = 0;
-        for (i = 0; i < nsect; i++)
-        {
-            cb  = sect[i].sect_cb;
-            sectWidth =  sect[i].sect_end - sectStart;
-            sectStart += sectWidth;
-
-            while (sectWidth > 0)
-            {
-                *pCodebookMap++ = cb;   /* cannot use memset for Int */
-                sectWidth--;
-            }
-
-        } /* for (i) */
-
-    }
-    else
-    {
-        /* set all sections with ZERO_HCB */
-        pv_memset(
-            pCodebookMap,
-            ZERO_HCB,
-            MAXBANDS*sizeof(*pCodebookMap));
-        /*
-                for (i=MAXBANDS; i>0; i--)
-                {
-                    *(pCodebookMap++) = ZERO_HCB;
-                }
-        */
-
-    } /* if (*pMax_sfb) */
-
-    /* calculate band offsets
-     * (because of grouping and interleaving this cannot be
-     * a constant: store it in pFrameInfo->frame_sfb_top)
-     */
-    if (pFrameInfo->islong == FALSE)
-    {
-        calc_gsfb_table(
-            pFrameInfo,
-            group);
-    }
-
-    /* decode scale factor data */
-    if (status == SUCCESS)
-    {
-        status =
-            hufffac(
-                pFrameInfo,
-                pInputStream,
-                group,
-                nsect,
-                sect,
-                global_gain,
-                pChVars->pShareWfxpCoef->factors,
-                pVars->scratch.huffbook_used);
-
-    } /* if (status) */
-
-    /* noiseless coding */
-    if (status == SUCCESS)
-    {
-        present =
-            get1bits(pInputStream);
-
-        pPulseInfo->pulse_data_present = present;
-
-        if (present != FALSE)
-        {
-            if (pFrameInfo->islong == 1)
-            {
-                status = get_pulse_data(
-                             pPulseInfo,
-                             pInputStream);
-            }
-            else
-            {
-                /* CommonExit(1,"Pulse data not allowed for short blocks"); */
-                status = 1;
-
-            } /* if (pFrameInfo) */
-        } /* if (present) */
-
-    } /* if (status) */
-
-
-    /* decode tns data */
-    if (status == SUCCESS)
-    {
-        present =
-            get1bits(pInputStream);
-
-        pTnsFrameInfo->tns_data_present = present;
-
-        if (present != FALSE)
-        {
-            get_tns(
-                pChVars->pShareWfxpCoef->max_sfb,
-                pInputStream,
-                pChVars->wnd,
-                pFrameInfo,
-                &pVars->mc_info,
-                pTnsFrameInfo,
-                pVars->scratch.tns_decode_coef);
-        }
-        else
-        {
-            for (i = pFrameInfo->num_win - 1; i >= 0 ; i--)
-            {
-                pTnsFrameInfo->n_filt[i] = 0;
-            }
-
-        } /* if(present) */
-
-    } /* if (status) */
-
-    /* gain control */
-    if (status == SUCCESS)
-    {
-        present =
-            get1bits(pInputStream);
-
-        if (present != FALSE)
-        {
-            /* CommonExit(1, "Gain control not implemented"); */
-            status = 1;
-        }
-    } /* if (status) */
-
-    if (status == SUCCESS)
-    {
-        status =
-            huffspec_fxp(
-                pFrameInfo,
-                pInputStream,
-                nsect,
-                sect,
-                pChVars->pShareWfxpCoef->factors,
-                pChVars->fxpCoef,
-                pVars->share.a.quantSpec,
-                pVars->scratch.tmp_spec,
-                pWinMap[ONLY_LONG_WINDOW],
-                pPulseInfo,
-                pChVars->pShareWfxpCoef->qFormat);
-    }
-
-    /*----------------------------------------------------------------------------
-    ; Return status
-    ----------------------------------------------------------------------------*/
-
-    return status;
-
-} /* getics */
diff --git a/media/libstagefright/codecs/aacdec/getmask.cpp b/media/libstagefright/codecs/aacdec/getmask.cpp
deleted file mode 100644
index 2fd34f1..0000000
--- a/media/libstagefright/codecs/aacdec/getmask.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: getmask.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-               Replaced for-loop style memory initialization with memset()
-
- Description: (1) Modified to bring code in-line with PV standard
-              (2) Removed multiple returns, Replaced multiple 'if's with
-                  switch
-
- Description: (1) Modified per review comments
-              (2) increment pointer pMask after memset
-
- Description: Make the maximum number of bits requested from getbits
-              become a constant.
-
- Description: Typecast 1 to UInt32 for bitmask to avoid masking on a 16-bit
-              platform
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less.
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-        pFrameInfo  = pointer to structure that holds information for current
-                      frame, Type FrameInfo
-
-        pInputStream= pointer to structure that holds input stream information
-                      Type BITS
-
-        pGroup      = pointer to array that holds the stop window index for
-                      each group in current frame, Type Int
-
-        max_sfb     = number of active sfbs for each window, Type Int
-
-        mask[]      = array that holds the MS_mask information
-                      Type Int
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    mask_present = 0    (no Mid/Side mixed)
-                   2    (Mid/Side mixed present for entire frame)
-                   1    (Mid/Side mixed information read from bitstream)
-                   -1   (invalid mask_present read from bitstream)
-
- Pointers and Buffers Modified:
-    pMask   contents replaced by MS information of each scalefactor band
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function reads the Mid/Side(MS) mask information from the input
- bitstream. If the mask_present field is equal to 2, the mask bits is set to
- 1 for the entire frame. If mask_present has a value of 0, the function
- returns 0, If mask_present is set to 1, the Mid/Side(MS) information is
- read from the input stream. When mask_present is 3, an error code (-1) is
- generated.
- The Mid/Side(MS) information is later used for mixing the left and right
- channel sounds. Each scalefactor band has its own MS information.
-
- (ISO comments: read a synthesis mask,  read a synthesis mask uses
-                EXTENDED_MS_MASK and grouped mask )
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall replace the contents of pMask with the MS information
- of each scalefactor band
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-    Subpart 4
-                    p15     (Table 4.4.5    getmask)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    CALL getbits(LEN_MASK_PRES, pInputStream)
-    MODIFYING (pInputStream)
-    RETURNING (mask present information)
-    mask_present = mask present information
-
-    SWITCH (mask_present)
-
-        CASE (0):
-            BREAK;
-
-        CASE (2):
-            nwin = pFrameInfo->num_win;
-            FOR(win = 0; win < nwin; win = *(pGroup++))
-
-                FOR(sfb = pFrameInfo->sfb_per_win[win]; sfb > 0; sfb--)
-                    *(pMask++) = 1;
-                ENDFOR
-
-            ENDFOR
-
-            BREAK;
-
-        CASE(1):
-
-            nwin = pFrameInfo->num_win;
-
-                nToDo = max_sfb;
-
-                WHILE (nToDo > 0)
-                    nCall = nToDo;
-
-                    IF (nCall > MAX_GETBITS)
-                    THEN
-                        nCall = MAX_GETBITS;
-                    ENDIF
-
-                    tempMask =
-                        getbits(
-                            nCall,
-                            pInputStream);
-
-                    bitmask = 1 << (nCall - 1);
-                    FOR (sfb = nCall; sfb > 0; sfb--)
-                       *(pMask++) = (tempMask & bitmask) >> (sfb - 1);
-                        bitmask >>= 1;
-                    ENDFOR
-
-                    nToDo -= nCall;
-                END WHILE
-
-                pv_memset(
-                    pMask,
-                    0,
-                    (pFrameInfo->sfb_per_win[win]-max_sfb)*sizeof(*pMask));
-
-            ENDFOR (win)
-
-            BREAK
-
-        DEFAULT:
-            mask_present = -1
-
-    ENDSWITCH
-
-    RETURN  mask_present
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "huffman.h"
-#include    "aac_mem_funcs.h"
-#include    "e_maskstatus.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int getmask(
-    FrameInfo   *pFrameInfo,
-    BITS        *pInputStream,
-    Int         group[],
-    Int         max_sfb,
-    Int         mask[])
-{
-
-    Int     win; /* window index */
-    Int     sfb;
-    Int     mask_present;
-    Int    *pMask;
-    Int    *pGroup;
-    Int     nwin;
-    Int     nCall;
-    Int     nToDo;
-    UInt32  tempMask;
-    UInt32  bitmask;
-
-    pMask  = mask;
-    pGroup = group;
-
-    mask_present =
-        get9_n_lessbits(
-            LEN_MASK_PRES,
-            pInputStream);
-
-    switch (mask_present)
-    {
-        case(MASK_NOT_PRESENT):
-            /* special EXTENDED_MS_MASK cases */
-            /* no ms at all */
-            break;
-
-        case(MASK_ALL_FRAME):
-            /* MS for whole spectrum on, mask bits set to 1 */
-            nwin = pFrameInfo->num_win;
-            for (win = 0; win < nwin; win = *(pGroup++))
-            {
-                for (sfb = pFrameInfo->sfb_per_win[win]; sfb > 0; sfb--)
-                {
-                    *(pMask++) = 1; /* cannot use memset for Int type */
-                }
-
-            }
-
-            break;
-
-        case(MASK_FROM_BITSTREAM):
-            /* MS_mask_present==1, get mask information*/
-            nwin = pFrameInfo->num_win;
-            for (win = 0; win < nwin; win = *(pGroup++))
-            {
-                /*
-                 * the following code is equivalent to
-                 *
-                 * for(sfb = max_sfb; sfb > 0; sfb--)
-                 * {
-                 *   *(pMask++) =
-                 *       getbits(
-                 *           LEN_MASK,
-                 *           pInputStream);
-                 * }
-                 *
-                 * in order to save the calls to getbits, the above
-                 * for-loop is broken into two parts
-                 */
-
-                nToDo = max_sfb;
-
-                while (nToDo > 0)
-                {
-                    nCall = nToDo;
-
-                    if (nCall > MAX_GETBITS)
-                    {
-                        nCall = MAX_GETBITS;
-                    }
-
-                    tempMask =
-                        getbits(
-                            nCall,
-                            pInputStream);
-
-                    bitmask = (UInt32) 1 << (nCall - 1);
-                    for (sfb = nCall; sfb > 0; sfb--)
-                    {
-                        *(pMask++) = (Int)((tempMask & bitmask) >> (sfb - 1));
-                        bitmask >>= 1;
-                    }
-
-                    nToDo -= nCall;
-                }
-
-                /*
-                 * set remaining sfbs to zero
-                 * re-use nCall to save one variable on stack
-                 */
-
-                nCall = pFrameInfo->sfb_per_win[win] - max_sfb;
-
-
-                if (nCall >= 0)
-                {
-                    pv_memset(pMask,
-                              0,
-                              nCall*sizeof(*pMask));
-
-                    pMask += nCall;
-                }
-                else
-                {
-                    mask_present = MASK_ERROR;
-                    break;
-                }
-
-
-            } /* for (win) */
-
-            break;
-
-        default:
-            /* error */
-            break;
-
-    } /* switch (mask_present) */
-
-    return mask_present;
-
-} /* getmask */
diff --git a/media/libstagefright/codecs/aacdec/hcbtables.h b/media/libstagefright/codecs/aacdec/hcbtables.h
deleted file mode 100644
index a35fed0..0000000
--- a/media/libstagefright/codecs/aacdec/hcbtables.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: hcbtables.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: (1) Add declaration of binary tree tables
-              (2) #if optimized Linear Search Huffman decoding
-
- Description: Modified per review comments
-              (1) delete #if optimized Linear Search Huffman decoding
-              (2) modified copyright header
-
- Description: (1) Add declaration different huffman tables
-
- Who:                              Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Declare the structure array for Huffman Codebooks information.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef _HCBTABLES_H
-#define _HCBTABLES_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include    "s_hcb.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /* ISO: Hcb book[NSPECBOOKS + 2]; */
-
-    extern const Hcb hcbbook_binary[13];
-    extern const Int32 huff_tab1[88];
-    extern const Int32 huff_tab2[90];
-    extern const Int32 huff_tab3[151];
-    extern const Int32 huff_tab4[119];
-    extern const Int32 huff_tab5[110];
-    extern const Int32 huff_tab6[113];
-    extern const Int32 huff_tab7[107];
-    extern const Int32 huff_tab8[90];
-    extern const Int32 huff_tab9[204];
-    extern const Int32 huff_tab10[186];
-    extern const Int32 huff_tab11[301];
-    extern const UInt32 huff_tab_scl[188];
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; END
-    ----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/hcbtables_binary.cpp b/media/libstagefright/codecs/aacdec/hcbtables_binary.cpp
deleted file mode 100644
index d097af1..0000000
--- a/media/libstagefright/codecs/aacdec/hcbtables_binary.cpp
+++ /dev/null
@@ -1,1938 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: hcbtables.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modifiy per review comments
-    (1) delete the following comments:
-        The LAV field has been deleted, since it is never used.
-
- Description: Remove old structure of huffman table and add new table structure.
-
- Description: Modified structure to avoid assigning addresses to constant
-              tables. This solve linking problem when using the
-              /ropi option (Read-only position independent) for some
-              compilers
-              - Eliminated references to contant vector addresses in
-                hcbbook_binary
-
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs: None
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs: None
-
- Pointers and Buffers Modified: None
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This file defines the 12 packed Huffman Tables and a structure that reference
- to these tables.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- ISO/IEC 14496-3: 1999(E)
- Subpart 4          p78 (Table 4.6.1 and Table 4.6.2)
-                    p77 (pseudo code)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-#include    "s_hcb.h"
-#include    "hcbtables.h"
-
-/* This file store packed Huffman tables for binary tree search */
-
-/*
- * all tables are packed in the following way:
- * right pointer (7 bits) idx (9 bits)
- */
-
-
-const Hcb hcbbook_binary[13] =
-{
-
-    { 0, -1,  -1, -1, -1 },   /* ZERO_HCB */
-    { 1,  4,   3,  1,  1 },   /* codebook 1 */
-    { 2,  4,   3,  1,  1 },   /* codebook 2 */
-    { 3,  4,   3,  0,  0 },   /* codebook 3 */
-    { 4,  4,   3,  0,  0 },   /* codebook 4 */
-    { 5,  2,   9,  4,  1 },
-    { 6,  2,   9,  4,  1 },
-    { 7,  2,   8,  0,  0 },
-    { 8,  2,   8,  0,  0 },
-    { 9,  2,  13,  0,  0 },
-    {10,  2,  13,  0,  0 },
-    {11,  2,  17,  0,  0 },  /* codebook 11 ESC book */
-    {12, -1,  -1, -1, -1 }   /* scalefactor codebook */
-
-
-};
-
-
-/* New look-up table for huffman decoding
-   Created by ordering the codeword in the table according to their
-   normalized shifted binary value, i.e., all the codewords are left
-   shifted to meet the maximum codelength. Example, max codelength is
-   10, the codeword with lenth 3 will left shift by 7.
-   The binary values of after the shift are sorted.
-   Then the sorted table is divided into several partition.
-   At the VLC decoding period, input is read in at max codelenght.
-   The partition is decided using if-else logic.
-   Inside each partition, a look-up table is used to map the input value
-   to a correct symbol. Table entries can appear to be repeated according
-   to the humming distance between adjacent codewords.
-*/
-
-const Int32 huff_tab1[88] =
-{
-    0x430005,
-    0xd0005,
-    0x270005,
-    0x310005,
-    0x290005,
-    0x250005,
-    0x2b0005,
-    0x1f0005,
-    0x3a0007,
-    0x160007,
-    0x260007,
-    0x2e0007,
-    0x220007,
-    0x2a0007,
-    0x4c0007,
-    0x240007,
-    0x40007,
-    0x1c0007,
-    0x400007,
-    0x300007,
-    0x100007,
-    0x2c0007,
-    0x460007,
-    0x200007,
-    0x340007,
-    0x320007,
-    0xa0007,
-    0x440007,
-    0xc0007,
-    0x420007,
-    0xe0007,
-    0x1e0007,
-    0x490009,
-    0x130009,
-    0x3d0009,
-    0x330009,
-    0x2f0009,
-    0x230009,
-    0x210009,
-    0x370009,
-    0x410009,
-    0x2d0009,
-    0x190009,
-    0xf0009,
-    0x70009,
-    0x1d0009,
-    0x3b0009,
-    0x390009,
-    0x150009,
-    0x10009,
-    0x1b0009,
-    0x350009,
-    0x450009,
-    0x4d0009,
-    0x170009,
-    0x4f0009,
-    0x5000a,
-    0x5000a,
-    0x9000a,
-    0x9000a,
-    0x4b000a,
-    0x4b000a,
-    0x3f000a,
-    0x3f000a,
-    0xb000a,
-    0xb000a,
-    0x3000a,
-    0x3000a,
-    0x11000a,
-    0x11000a,
-    0x47000a,
-    0x47000a,
-    0x3c000b,
-    0x14000b,
-    0x18000b,
-    0x38000b,
-    0x50000b,
-    0x8000b,
-    0x48000b,
-    0x6000b,
-    0xb,
-    0x4a000b,
-    0x3e000b,
-    0x1a000b,
-    0x12000b,
-    0x2000b,
-    0x36000b,
-    0x4e000b
-};
-
-const Int32 huff_tab2[90] =
-{
-    0x430004,
-    0x430004,
-    0x430004,
-    0x430004,
-    0xd0005,
-    0xd0005,
-    0x290005,
-    0x290005,
-    0x250005,
-    0x250005,
-    0x270005,
-    0x270005,
-    0x1f0005,
-    0x1f0005,
-    0x2b0005,
-    0x2b0005,
-    0x310005,
-    0x310005,
-    0x220006,
-    0x160006,
-    0x2e0006,
-    0x2a0006,
-    0x300006,
-    0x260006,
-    0xc0006,
-    0x3a0006,
-    0x400006,
-    0x40006,
-    0x240006,
-    0x460006,
-    0x440006,
-    0x200006,
-    0x100006,
-    0x320006,
-    0x1c0006,
-    0xe0006,
-    0x1e0006,
-    0xa0006,
-    0x4c0006,
-    0x340006,
-    0x2c0006,
-    0x420006,
-    0x2f0007,
-    0x410007,
-    0x130007,
-    0x210007,
-    0x3d0007,
-    0x4b0007,
-    0x470007,
-    0x190007,
-    0x1d0007,
-    0x4f0007,
-    0xf0007,
-    0x10007,
-    0xb0007,
-    0x370007,
-    0x490007,
-    0x3b0008,
-    0x150008,
-    0x70008,
-    0x110008,
-    0x50008,
-    0x30008,
-    0x1b0008,
-    0x450008,
-    0x3f0008,
-    0x2d0008,
-    0x350008,
-    0x170008,
-    0x90008,
-    0x330008,
-    0x390008,
-    0x230008,
-    0x4d0008,
-    0x3c0008,
-    0x140008,
-    0x380009,
-    0x9,
-    0x180009,
-    0x1a0009,
-    0x500009,
-    0x60009,
-    0x3e0009,
-    0x120009,
-    0x80009,
-    0x480009,
-    0x360009,
-    0x20009,
-    0x4a0009,
-    0x4e0009
-};
-
-const Int32 huff_tab3[151] =
-{
-    0x1b0004,
-    0x1b0004,
-    0x1b0004,
-    0x1b0004,
-    0x10004,
-    0x10004,
-    0x10004,
-    0x10004,
-    0x90004,
-    0x90004,
-    0x90004,
-    0x90004,
-    0x30004,
-    0x30004,
-    0x30004,
-    0x30004,
-    0x240005,
-    0x240005,
-    0x40005,
-    0x40005,
-    0xc0006,
-    0xa0006,
-    0x1e0006,
-    0xd0006,
-    0x1c0006,
-    0x270006,
-    0x280007,
-    0x280007,
-    0x280007,
-    0x280007,
-    0x1f0007,
-    0x1f0007,
-    0x1f0007,
-    0x1f0007,
-    0x250007,
-    0x250007,
-    0x250007,
-    0x250007,
-    0x360008,
-    0x360008,
-    0x20008,
-    0x20008,
-    0x50008,
-    0x50008,
-    0x3f0008,
-    0x3f0008,
-    0x300008,
-    0x300008,
-    0x70009,
-    0x100009,
-    0x2d0009,
-    0xe0009,
-    0x420009,
-    0x60009,
-    0x150009,
-    0xf0009,
-    0x120009,
-    0xb0009,
-    0x390009,
-    0x310009,
-    0x160009,
-    0x2a0009,
-    0x2b0009,
-    0x2e000a,
-    0x21000a,
-    0x22000a,
-    0x13000a,
-    0x43000a,
-    0x29000a,
-    0x40000a,
-    0x20000a,
-    0x8000a,
-    0x11000a,
-    0x4b000a,
-    0x33000a,
-    0x1d000a,
-    0x37000a,
-    0x19000a,
-    0x48000b,
-    0x48000b,
-    0x34000b,
-    0x34000b,
-    0x26000b,
-    0x26000b,
-    0x3a000b,
-    0x3a000b,
-    0x2c000b,
-    0x2c000b,
-    0x4c000b,
-    0x4c000b,
-    0x18000b,
-    0x18000b,
-    0x17000b,
-    0x17000b,
-    0x23000c,
-    0x49000c,
-    0x45000c,
-    0x4e000c,
-    0x1a000c,
-    0x4f000c,
-    0x46000c,
-    0x32000c,
-    0x35000c,
-    0x14000d,
-    0x14000d,
-    0x14000d,
-    0x14000d,
-    0x14000d,
-    0x14000d,
-    0x14000d,
-    0x14000d,
-    0x3c000d,
-    0x3c000d,
-    0x3c000d,
-    0x3c000d,
-    0x3c000d,
-    0x3c000d,
-    0x3c000d,
-    0x3c000d,
-    0x2f000d,
-    0x2f000d,
-    0x2f000d,
-    0x2f000d,
-    0x2f000d,
-    0x2f000d,
-    0x2f000d,
-    0x2f000d,
-    0x3d000e,
-    0x3d000e,
-    0x3d000e,
-    0x3d000e,
-    0x44000e,
-    0x44000e,
-    0x44000e,
-    0x44000e,
-    0x41000e,
-    0x41000e,
-    0x41000e,
-    0x41000e,
-    0x50000f,
-    0x50000f,
-    0x4d000f,
-    0x4d000f,
-    0x47000f,
-    0x47000f,
-    0x3b000f,
-    0x3b000f,
-    0x38000f,
-    0x38000f,
-    0x4a0010,
-    0x3e0010
-};
-
-const Int32 huff_tab4[119] =
-{
-    0x280004,
-    0x280004,
-    0xd0004,
-    0xd0004,
-    0x250004,
-    0x250004,
-    0x270004,
-    0x270004,
-    0x1f0004,
-    0x1f0004,
-    0x1b0004,
-    0x1b0004,
-    0x240004,
-    0x240004,
-    0x4,
-    0x4,
-    0x40004,
-    0x40004,
-    0x1e0004,
-    0x1e0004,
-    0x1c0005,
-    0xc0005,
-    0x10005,
-    0xa0005,
-    0x30005,
-    0x90005,
-    0x430007,
-    0x430007,
-    0x2b0007,
-    0x2b0007,
-    0x310007,
-    0x310007,
-    0x290007,
-    0x290007,
-    0x420007,
-    0x420007,
-    0x400007,
-    0x400007,
-    0x300007,
-    0x300007,
-    0x3a0007,
-    0x3a0007,
-    0x100007,
-    0x100007,
-    0xe0008,
-    0x2a0008,
-    0x160008,
-    0x200008,
-    0x2e0008,
-    0x260008,
-    0x220008,
-    0x3f0008,
-    0x390008,
-    0x2d0008,
-    0x370008,
-    0xb0008,
-    0x150008,
-    0x50008,
-    0xf0008,
-    0x130008,
-    0x1d0008,
-    0x70008,
-    0x210008,
-    0x360008,
-    0x20008,
-    0x120009,
-    0x120009,
-    0x60009,
-    0x60009,
-    0x340009,
-    0x340009,
-    0x4c0009,
-    0x4c0009,
-    0x460009,
-    0x460009,
-    0x2c0009,
-    0x2c0009,
-    0x320009,
-    0x320009,
-    0x440009,
-    0x440009,
-    0x33000a,
-    0x4b000a,
-    0x45000a,
-    0x19000a,
-    0x11000a,
-    0x49000a,
-    0x17000a,
-    0x3d000a,
-    0x23000a,
-    0x4f000a,
-    0x2f000a,
-    0x3b000a,
-    0x41000a,
-    0x35000a,
-    0x47000b,
-    0x47000b,
-    0x4d000b,
-    0x4d000b,
-    0x18000b,
-    0x18000b,
-    0x48000b,
-    0x48000b,
-    0x8000b,
-    0x8000b,
-    0x3c000b,
-    0x3c000b,
-    0x14000b,
-    0x14000b,
-    0x38000b,
-    0x38000b,
-    0x50000b,
-    0x50000b,
-    0x1a000b,
-    0x1a000b,
-    0x4e000b,
-    0x4e000b,
-    0x4a000c,
-    0x3e000c
-};
-
-const Int32 huff_tab5[110] =
-{
-    0x1f0004,
-    0x1f0004,
-    0x310004,
-    0x310004,
-    0x290004,
-    0x290004,
-    0x270004,
-    0x270004,
-    0x300005,
-    0x200005,
-    0x1e0005,
-    0x320005,
-    0x160007,
-    0x160007,
-    0x2a0007,
-    0x2a0007,
-    0x3a0007,
-    0x3a0007,
-    0x260007,
-    0x260007,
-    0x150008,
-    0x3b0008,
-    0x1d0008,
-    0x330008,
-    0x170008,
-    0x390008,
-    0x210008,
-    0x2f0008,
-    0xd0008,
-    0x430008,
-    0x250008,
-    0x2b0008,
-    0xc0009,
-    0xc0009,
-    0x340009,
-    0x340009,
-    0x440009,
-    0x440009,
-    0x1c0009,
-    0x1c0009,
-    0xe0009,
-    0xe0009,
-    0x420009,
-    0x420009,
-    0x2e0009,
-    0x2e0009,
-    0x220009,
-    0x220009,
-    0x180009,
-    0x180009,
-    0x3c0009,
-    0x3c0009,
-    0x140009,
-    0x140009,
-    0x380009,
-    0x380009,
-    0xb000a,
-    0x41000a,
-    0x19000a,
-    0x37000a,
-    0x45000a,
-    0x3d000a,
-    0xf000a,
-    0x13000a,
-    0x24000a,
-    0x4000a,
-    0x4d000a,
-    0x4c000a,
-    0x3000b,
-    0x2c000b,
-    0x4b000b,
-    0x1b000b,
-    0x35000b,
-    0x23000b,
-    0x5000b,
-    0x2d000b,
-    0x40000b,
-    0xa000b,
-    0x10000b,
-    0x1a000b,
-    0x2000b,
-    0x4e000b,
-    0x36000b,
-    0x3e000b,
-    0x46000b,
-    0x6000b,
-    0x12000c,
-    0x12000c,
-    0x4a000c,
-    0x4a000c,
-    0x3f000c,
-    0x3f000c,
-    0x1000c,
-    0x1000c,
-    0x7000c,
-    0x7000c,
-    0x47000c,
-    0x47000c,
-    0x11000c,
-    0x11000c,
-    0x4f000c,
-    0x4f000c,
-    0x49000c,
-    0x49000c,
-    0x9000c,
-    0x9000c,
-    0x48000d,
-    0x8000d,
-    0x50000d,
-    0xd
-};
-const Int32 huff_tab6[113] =
-{
-    0x280004,
-    0x310004,
-    0x270004,
-    0x290004,
-    0x1f0004,
-    0x320004,
-    0x200004,
-    0x300004,
-    0x1e0004,
-    0x390006,
-    0x390006,
-    0x3b0006,
-    0x3b0006,
-    0x170006,
-    0x170006,
-    0x150006,
-    0x150006,
-    0x160006,
-    0x160006,
-    0x210006,
-    0x210006,
-    0x3a0006,
-    0x3a0006,
-    0x2f0006,
-    0x2f0006,
-    0x330006,
-    0x330006,
-    0x260006,
-    0x260006,
-    0x1d0006,
-    0x1d0006,
-    0x2a0006,
-    0x2a0006,
-    0x380006,
-    0x380006,
-    0x180006,
-    0x180006,
-    0x140006,
-    0x140006,
-    0x3c0006,
-    0x3c0006,
-    0xe0007,
-    0x440007,
-    0x420007,
-    0x220007,
-    0xc0007,
-    0x340007,
-    0x2e0007,
-    0x1c0007,
-    0x430007,
-    0xd0007,
-    0x250007,
-    0x2b0007,
-    0x450007,
-    0xb0008,
-    0xb0008,
-    0x190008,
-    0x190008,
-    0x3d0008,
-    0x3d0008,
-    0x410008,
-    0x410008,
-    0x370008,
-    0x370008,
-    0x130008,
-    0x130008,
-    0xf0008,
-    0xf0008,
-    0x460008,
-    0x460008,
-    0x400009,
-    0xa0009,
-    0x100009,
-    0x2d0009,
-    0x1b0009,
-    0x4d0009,
-    0x50009,
-    0x30009,
-    0x350009,
-    0x4b0009,
-    0x230009,
-    0x240009,
-    0x60009,
-    0x20009,
-    0x3e0009,
-    0x120009,
-    0x40009,
-    0x4e0009,
-    0x4a0009,
-    0x1a0009,
-    0x4c0009,
-    0x360009,
-    0x2c0009,
-    0x9000a,
-    0x9000a,
-    0x11000a,
-    0x11000a,
-    0x3f000a,
-    0x3f000a,
-    0x49000a,
-    0x49000a,
-    0x47000a,
-    0x47000a,
-    0x4f000a,
-    0x4f000a,
-    0x7000a,
-    0x7000a,
-    0x1000a,
-    0x1000a,
-    0x50000b,
-    0x8000b,
-    0xb,
-    0x48000b
-};
-
-const Int32 huff_tab7[107] =
-{
-    0x80003,
-    0x80003,
-    0x80003,
-    0x80003,
-    0x80003,
-    0x80003,
-    0x80003,
-    0x80003,
-    0x10003,
-    0x10003,
-    0x10003,
-    0x10003,
-    0x10003,
-    0x10003,
-    0x10003,
-    0x10003,
-    0x90004,
-    0x90004,
-    0x90004,
-    0x90004,
-    0x110006,
-    0xa0006,
-    0x100006,
-    0x20006,
-    0x190007,
-    0x190007,
-    0xb0007,
-    0xb0007,
-    0x120007,
-    0x120007,
-    0x180007,
-    0x180007,
-    0x30007,
-    0x30007,
-    0x130008,
-    0x1a0008,
-    0xc0008,
-    0x210008,
-    0xd0008,
-    0x290008,
-    0x1b0008,
-    0x140008,
-    0x40008,
-    0x200008,
-    0x220009,
-    0x220009,
-    0x150009,
-    0x150009,
-    0x2a0009,
-    0x2a0009,
-    0x50009,
-    0x50009,
-    0x310009,
-    0x310009,
-    0x280009,
-    0x280009,
-    0xe0009,
-    0xe0009,
-    0x230009,
-    0x230009,
-    0x1d0009,
-    0x1d0009,
-    0x1c0009,
-    0x1c0009,
-    0x2b0009,
-    0x2b0009,
-    0x160009,
-    0x160009,
-    0x320009,
-    0x320009,
-    0xf0009,
-    0xf0009,
-    0x1e000a,
-    0x6000a,
-    0x30000a,
-    0x24000a,
-    0x39000a,
-    0x25000a,
-    0x3a000a,
-    0x2c000a,
-    0x33000a,
-    0x17000a,
-    0x3b000a,
-    0x34000a,
-    0x2d000a,
-    0x26000a,
-    0x1f000a,
-    0x38000b,
-    0x38000b,
-    0x7000b,
-    0x7000b,
-    0x35000b,
-    0x35000b,
-    0x2e000b,
-    0x2e000b,
-    0x3c000b,
-    0x3c000b,
-    0x27000b,
-    0x27000b,
-    0x2f000b,
-    0x2f000b,
-    0x3d000b,
-    0x3d000b,
-    0x3e000c,
-    0x36000c,
-    0x37000c,
-    0x3f000c
-};
-const Int32 huff_tab8[90] =
-{
-    0x90003,
-    0x90003,
-    0x90003,
-    0x90003,
-    0x110004,
-    0x110004,
-    0x80004,
-    0x80004,
-    0xa0004,
-    0xa0004,
-    0x10004,
-    0x10004,
-    0x120004,
-    0x120004,
-    0x5,
-    0x100005,
-    0x20005,
-    0x190005,
-    0xb0005,
-    0x1a0005,
-    0x130005,
-    0x1b0006,
-    0x1b0006,
-    0x210006,
-    0x210006,
-    0xc0006,
-    0xc0006,
-    0x220006,
-    0x220006,
-    0x140006,
-    0x140006,
-    0x180006,
-    0x180006,
-    0x30006,
-    0x30006,
-    0x230006,
-    0x230006,
-    0x1c0006,
-    0x1c0006,
-    0x2a0006,
-    0x2a0006,
-    0x290007,
-    0x150007,
-    0xd0007,
-    0x2b0007,
-    0x1d0007,
-    0x240007,
-    0x2c0007,
-    0x40007,
-    0x250007,
-    0x200007,
-    0x160007,
-    0x320007,
-    0x310007,
-    0xe0007,
-    0x1e0008,
-    0x330008,
-    0x2d0008,
-    0x280008,
-    0x340008,
-    0x50008,
-    0x260008,
-    0x390008,
-    0x3a0008,
-    0x170008,
-    0x350008,
-    0x3b0008,
-    0xf0008,
-    0x2e0008,
-    0x1f0008,
-    0x360009,
-    0x360009,
-    0x3c0009,
-    0x3c0009,
-    0x300009,
-    0x300009,
-    0x270009,
-    0x270009,
-    0x60009,
-    0x60009,
-    0x3d0009,
-    0x3d0009,
-    0x3e0009,
-    0x3e0009,
-    0x370009,
-    0x370009,
-    0x2f000a,
-    0x38000a,
-    0x7000a,
-    0x3f000a
-};
-const Int32 huff_tab9[204] =
-{
-    0x1,
-    0x1,
-    0x1,
-    0x1,
-    0x1,
-    0x1,
-    0x1,
-    0x1,
-    0xd0003,
-    0xd0003,
-    0x10003,
-    0x10003,
-    0xe0004,
-    0x1b0006,
-    0x1b0006,
-    0xf0006,
-    0xf0006,
-    0x1a0006,
-    0x1a0006,
-    0x20006,
-    0x20006,
-    0x280007,
-    0x1c0007,
-    0x100007,
-    0x270008,
-    0x270008,
-    0x30008,
-    0x30008,
-    0x1d0008,
-    0x1d0008,
-    0x290008,
-    0x290008,
-    0x110008,
-    0x110008,
-    0x350008,
-    0x350008,
-    0x1e0008,
-    0x1e0008,
-    0x120008,
-    0x120008,
-    0x360009,
-    0x2a0009,
-    0x40009,
-    0x340009,
-    0x420009,
-    0x1f0009,
-    0x130009,
-    0x2b0009,
-    0x430009,
-    0x4f0009,
-    0x370009,
-    0x5000a,
-    0x20000a,
-    0x41000a,
-    0x14000a,
-    0x2c000a,
-    0x15000a,
-    0x69000a,
-    0x38000a,
-    0x44000a,
-    0x50000a,
-    0x5c000a,
-    0x6000a,
-    0x6a000a,
-    0x22000a,
-    0x2d000a,
-    0x21000a,
-    0x39000a,
-    0x76000a,
-    0x16000a,
-    0x5d000a,
-    0x4e000b,
-    0x45000b,
-    0x51000b,
-    0x6b000b,
-    0x7000b,
-    0x77000b,
-    0x2f000b,
-    0x3a000b,
-    0x2e000b,
-    0x8000b,
-    0x83000b,
-    0x52000b,
-    0x23000b,
-    0x46000b,
-    0x68000b,
-    0x5b000b,
-    0x5e000b,
-    0x84000b,
-    0x78000b,
-    0x6c000b,
-    0x17000b,
-    0x5f000b,
-    0x53000b,
-    0x47000b,
-    0x3c000b,
-    0x3b000b,
-    0x30000b,
-    0x90000b,
-    0x49000b,
-    0x75000b,
-    0x6d000b,
-    0x85000c,
-    0x24000c,
-    0x9000c,
-    0x91000c,
-    0x79000c,
-    0x54000c,
-    0x9d000c,
-    0x3d000c,
-    0x6e000c,
-    0x18000c,
-    0x7a000c,
-    0x86000c,
-    0x48000c,
-    0x60000c,
-    0x25000c,
-    0x19000c,
-    0x9e000c,
-    0x92000c,
-    0x31000c,
-    0x4a000c,
-    0x55000c,
-    0x6f000c,
-    0x93000c,
-    0xa000c,
-    0x61000c,
-    0x9f000c,
-    0x82000c,
-    0x87000c,
-    0x3e000c,
-    0x56000c,
-    0x26000c,
-    0x7b000c,
-    0x7c000c,
-    0x3f000c,
-    0x8f000c,
-    0x57000c,
-    0x32000c,
-    0x4b000c,
-    0x70000d,
-    0x63000d,
-    0xa1000d,
-    0x33000d,
-    0x94000d,
-    0x62000d,
-    0xa0000d,
-    0x95000d,
-    0x88000d,
-    0x40000d,
-    0x64000d,
-    0x4c000d,
-    0xb000d,
-    0xa2000d,
-    0x58000d,
-    0x9c000d,
-    0x89000d,
-    0x4d000d,
-    0x65000d,
-    0x7d000d,
-    0xc000d,
-    0x96000d,
-    0x71000d,
-    0x7e000d,
-    0x8a000d,
-    0x66000d,
-    0xa3000d,
-    0x59000d,
-    0x73000d,
-    0x97000d,
-    0x67000d,
-    0x5a000d,
-    0x72000e,
-    0x72000e,
-    0x8b000e,
-    0x8b000e,
-    0x74000e,
-    0x74000e,
-    0x7f000e,
-    0x7f000e,
-    0x80000e,
-    0x80000e,
-    0x81000e,
-    0x81000e,
-    0x8d000e,
-    0x8d000e,
-    0xa5000e,
-    0xa5000e,
-    0x8c000e,
-    0x8c000e,
-    0x98000e,
-    0x98000e,
-    0xa4000e,
-    0xa4000e,
-    0x99000e,
-    0x99000e,
-    0xa6000e,
-    0xa6000e,
-    0xa7000e,
-    0xa7000e,
-    0x8e000f,
-    0x9a000f,
-    0x9b000f,
-    0xa8000f
-};
-const Int32 huff_tab10[186] =
-{
-    0xe0004,
-    0xe0004,
-    0xe0004,
-    0xe0004,
-    0xf0004,
-    0xf0004,
-    0xf0004,
-    0xf0004,
-    0x1b0004,
-    0x1b0004,
-    0x1b0004,
-    0x1b0004,
-    0x1c0005,
-    0x1c0005,
-    0xd0005,
-    0xd0005,
-    0x10005,
-    0x10005,
-    0x100005,
-    0x100005,
-    0x290005,
-    0x290005,
-    0x280005,
-    0x280005,
-    0x1d0005,
-    0x1d0005,
-    0x2a0005,
-    0x2a0005,
-    0x1a0006,
-    0x20006,
-    0x1e0006,
-    0x360006,
-    0x110006,
-    0x350006,
-    0x6,
-    0x370006,
-    0x2b0006,
-    0x270006,
-    0x30006,
-    0x380006,
-    0x1f0006,
-    0x430006,
-    0x120007,
-    0x420007,
-    0x440007,
-    0x2c0007,
-    0x450007,
-    0x390007,
-    0x500007,
-    0x200007,
-    0x510007,
-    0x340007,
-    0x4f0007,
-    0x40007,
-    0x130007,
-    0x2d0007,
-    0x460007,
-    0x520007,
-    0x3a0007,
-    0x530008,
-    0x5d0008,
-    0x2e0008,
-    0x210008,
-    0x470008,
-    0x6a0008,
-    0x5e0008,
-    0x410008,
-    0x5c0008,
-    0x50008,
-    0x690008,
-    0x140008,
-    0x6b0008,
-    0x5f0008,
-    0x3b0008,
-    0x220008,
-    0x540008,
-    0x600008,
-    0x150008,
-    0x2f0008,
-    0x6c0008,
-    0x3c0008,
-    0x480008,
-    0x6d0008,
-    0x490008,
-    0x610009,
-    0x550009,
-    0x770009,
-    0x4e0009,
-    0x560009,
-    0x780009,
-    0x300009,
-    0x760009,
-    0x230009,
-    0x60009,
-    0x6e0009,
-    0x790009,
-    0x3d0009,
-    0x840009,
-    0x160009,
-    0x620009,
-    0x6f0009,
-    0x7a0009,
-    0x630009,
-    0x850009,
-    0x4a0009,
-    0x860009,
-    0x240009,
-    0x830009,
-    0x310009,
-    0x7b0009,
-    0x570009,
-    0x680009,
-    0x3e0009,
-    0x5b0009,
-    0x910009,
-    0x64000a,
-    0x92000a,
-    0x88000a,
-    0x17000a,
-    0x90000a,
-    0x7c000a,
-    0x7000a,
-    0x70000a,
-    0x87000a,
-    0x32000a,
-    0x4b000a,
-    0x71000a,
-    0x94000a,
-    0x8000a,
-    0x93000a,
-    0x25000a,
-    0x65000a,
-    0x58000a,
-    0x89000a,
-    0x3f000a,
-    0x18000a,
-    0x9e000a,
-    0x7d000a,
-    0x9f000a,
-    0x95000a,
-    0x4c000a,
-    0xa0000a,
-    0x96000a,
-    0xa1000a,
-    0x33000a,
-    0x59000a,
-    0x75000a,
-    0x8a000a,
-    0x82000a,
-    0x9d000a,
-    0x9000a,
-    0x40000a,
-    0x7e000a,
-    0xa2000a,
-    0x26000a,
-    0x72000a,
-    0x7f000b,
-    0x19000b,
-    0x97000b,
-    0xa3000b,
-    0x66000b,
-    0x4d000b,
-    0x5a000b,
-    0x8b000b,
-    0x73000b,
-    0xa4000b,
-    0xa000b,
-    0x67000b,
-    0x8f000b,
-    0x8c000b,
-    0x98000b,
-    0x99000b,
-    0xb000b,
-    0x9a000b,
-    0x80000b,
-    0x8d000b,
-    0x9c000b,
-    0x74000b,
-    0xa5000c,
-    0x8e000c,
-    0x81000c,
-    0x9b000c,
-    0xa7000c,
-    0xc000c,
-    0xa6000c,
-    0xa8000c
-};
-const Int32 huff_tab11[301] =
-{
-    0x4,
-    0x4,
-    0x4,
-    0x4,
-    0x120004,
-    0x120004,
-    0x120004,
-    0x120004,
-    0x1200005,
-    0x1200005,
-    0x110005,
-    0x110005,
-    0x10005,
-    0x10005,
-    0x230005,
-    0x230005,
-    0x130005,
-    0x130005,
-    0x240005,
-    0x240005,
-    0x140006,
-    0x340006,
-    0x350006,
-    0x220006,
-    0x250006,
-    0x20006,
-    0x360006,
-    0x450007,
-    0x150007,
-    0x460007,
-    0x260007,
-    0x470007,
-    0x370007,
-    0x330007,
-    0x30007,
-    0x560007,
-    0x570007,
-    0x270007,
-    0x480007,
-    0x160007,
-    0x580007,
-    0x380007,
-    0x590007,
-    0x490008,
-    0x680008,
-    0x280008,
-    0x670008,
-    0x690008,
-    0x390008,
-    0x170008,
-    0x540008,
-    0x430008,
-    0x1150008,
-    0x1130008,
-    0x1140008,
-    0x6a0008,
-    0x1160008,
-    0x440008,
-    0x4a0008,
-    0x40008,
-    0x320008,
-    0x5a0008,
-    0x650008,
-    0x1170008,
-    0x1120008,
-    0x1180008,
-    0x290008,
-    0x790008,
-    0x3a0008,
-    0x6b0008,
-    0x5b0008,
-    0x760008,
-    0x11a0008,
-    0x7a0008,
-    0x780008,
-    0x1190008,
-    0x870008,
-    0x210008,
-    0x180008,
-    0x4b0008,
-    0x11b0008,
-    0x7b0008,
-    0x11c0008,
-    0x980008,
-    0x1110008,
-    0x6c0008,
-    0xa90008,
-    0x2a0008,
-    0x5c0008,
-    0xba0008,
-    0x11d0008,
-    0x8b0008,
-    0x8a0008,
-    0x3b0008,
-    0x550008,
-    0x11e0008,
-    0xcb0008,
-    0x7c0008,
-    0x4c0008,
-    0x6d0008,
-    0x7d0008,
-    0x50008,
-    0x8c0009,
-    0x11f0009,
-    0xdc0009,
-    0x190009,
-    0x890009,
-    0xfe0009,
-    0x5d0009,
-    0xed0009,
-    0x3c0009,
-    0x8d0009,
-    0x7e0009,
-    0x2b0009,
-    0x8e0009,
-    0x9b0009,
-    0x9c0009,
-    0x10f0009,
-    0x4d0009,
-    0x6e0009,
-    0x660009,
-    0x9d0009,
-    0x5e0009,
-    0x8f0009,
-    0x7f0009,
-    0x1a0009,
-    0xad0009,
-    0x60009,
-    0xac0009,
-    0x9a0009,
-    0x9e0009,
-    0x4e0009,
-    0x2c0009,
-    0x9f0009,
-    0x3d0009,
-    0x6f0009,
-    0xae0009,
-    0x900009,
-    0xaf0009,
-    0xa00009,
-    0xbe0009,
-    0x1b0009,
-    0x770009,
-    0xb00009,
-    0x800009,
-    0x3e0009,
-    0x5f0009,
-    0xab0009,
-    0x4f0009,
-    0xbd0009,
-    0xdf0009,
-    0x700009,
-    0xe00009,
-    0x2d0009,
-    0x1100009,
-    0x600009,
-    0xc00009,
-    0xbf000a,
-    0xa1000a,
-    0x81000a,
-    0x91000a,
-    0x10000a,
-    0x51000a,
-    0x7000a,
-    0x40000a,
-    0xc1000a,
-    0xde000a,
-    0xe1000a,
-    0xcf000a,
-    0x2f000a,
-    0xe2000a,
-    0x92000a,
-    0x71000a,
-    0xb2000a,
-    0xb1000a,
-    0xf0000a,
-    0xd0000a,
-    0x1c000a,
-    0x50000a,
-    0xbc000a,
-    0x3f000a,
-    0x1e000a,
-    0xce000a,
-    0x82000a,
-    0x41000a,
-    0x61000a,
-    0x62000a,
-    0xf2000a,
-    0x52000a,
-    0xc2000a,
-    0xf1000a,
-    0xd1000a,
-    0xe3000a,
-    0xd2000a,
-    0x88000a,
-    0xc3000a,
-    0x2e000a,
-    0xa2000a,
-    0xf3000a,
-    0x73000a,
-    0xb4000a,
-    0x101000a,
-    0x93000a,
-    0xa3000a,
-    0xf4000a,
-    0xb3000a,
-    0x63000a,
-    0xc4000a,
-    0xef000a,
-    0x30000a,
-    0x72000a,
-    0x1d000a,
-    0xe5000a,
-    0x8000a,
-    0xe4000a,
-    0x83000a,
-    0xd3000a,
-    0x84000a,
-    0x102000a,
-    0xcd000a,
-    0x74000a,
-    0x31000a,
-    0x104000a,
-    0x103000a,
-    0x1f000a,
-    0xa4000a,
-    0x53000a,
-    0xf5000a,
-    0x95000a,
-    0xe6000a,
-    0x94000a,
-    0x64000a,
-    0x42000a,
-    0xb5000a,
-    0xc5000a,
-    0xd4000a,
-    0x105000a,
-    0x106000a,
-    0x96000a,
-    0x100000a,
-    0x85000a,
-    0x99000a,
-    0x9000a,
-    0xa6000a,
-    0xa5000a,
-    0xd5000a,
-    0xf6000a,
-    0xb7000a,
-    0xf7000a,
-    0xd6000a,
-    0x75000a,
-    0x86000a,
-    0xa7000b,
-    0x107000b,
-    0xc6000b,
-    0xc9000b,
-    0x20000b,
-    0xb6000b,
-    0xb8000b,
-    0xe8000b,
-    0xe7000b,
-    0xc8000b,
-    0xc7000b,
-    0x97000b,
-    0xf9000b,
-    0xe9000b,
-    0xd9000b,
-    0x108000b,
-    0xf8000b,
-    0xaa000b,
-    0xd7000b,
-    0xa8000b,
-    0xa000b,
-    0xd8000b,
-    0xbb000b,
-    0xda000b,
-    0xb9000b,
-    0xea000b,
-    0xd000b,
-    0xfa000b,
-    0x109000b,
-    0x10a000b,
-    0xca000b,
-    0xfb000b,
-    0xdd000b,
-    0xb000b,
-    0xeb000b,
-    0x10b000b,
-    0x10c000b,
-    0xdb000b,
-    0xee000b,
-    0xfc000b,
-    0xec000b,
-    0xcc000b,
-    0xfd000b,
-    0xe000c,
-    0xc000c,
-    0x10d000c,
-    0xff000c,
-    0xf000c,
-    0x10e000c
-};
-
-const UInt32 huff_tab_scl[188] =
-{
-    0x3b0003,
-    0x3b0003,
-    0x3b0003,
-    0x3b0003,
-    0x3b0003,
-    0x3b0003,
-    0x3b0003,
-    0x3b0003,
-    0x3d0004,
-    0x3d0004,
-    0x3d0004,
-    0x3d0004,
-    0x3a0004,
-    0x3a0004,
-    0x3a0004,
-    0x3a0004,
-    0x3e0004,
-    0x3e0004,
-    0x3e0004,
-    0x3e0004,
-    0x390005,
-    0x390005,
-    0x3f0005,
-    0x3f0005,
-    0x380006,
-    0x400006,
-    0x370006,
-    0x410006,
-    0x420007,
-    0x420007,
-    0x420007,
-    0x420007,
-    0x360007,
-    0x360007,
-    0x360007,
-    0x360007,
-    0x430007,
-    0x430007,
-    0x430007,
-    0x430007,
-    0x350008,
-    0x350008,
-    0x440008,
-    0x440008,
-    0x340008,
-    0x340008,
-    0x450008,
-    0x450008,
-    0x330008,
-    0x330008,
-    0x460009,
-    0x320009,
-    0x310009,
-    0x470009,
-    0x48000a,
-    0x48000a,
-    0x48000a,
-    0x48000a,
-    0x30000a,
-    0x30000a,
-    0x30000a,
-    0x30000a,
-    0x49000a,
-    0x49000a,
-    0x49000a,
-    0x49000a,
-    0x2f000a,
-    0x2f000a,
-    0x2f000a,
-    0x2f000a,
-    0x4a000a,
-    0x4a000a,
-    0x4a000a,
-    0x4a000a,
-    0x2e000a,
-    0x2e000a,
-    0x2e000a,
-    0x2e000a,
-    0x4c000b,
-    0x4c000b,
-    0x4b000b,
-    0x4b000b,
-    0x4d000b,
-    0x4d000b,
-    0x4e000b,
-    0x4e000b,
-    0x2d000b,
-    0x2d000b,
-    0x2b000b,
-    0x2b000b,
-    0x2c000c,
-    0x4f000c,
-    0x2a000c,
-    0x29000c,
-    0x50000c,
-    0x28000c,
-    0x51000d,
-    0x51000d,
-    0x27000d,
-    0x27000d,
-    0x52000d,
-    0x52000d,
-    0x26000d,
-    0x26000d,
-    0x53000d,
-    0x53000d,
-    0x25000e,
-    0x23000e,
-    0x55000e,
-    0x21000e,
-    0x24000e,
-    0x22000e,
-    0x54000e,
-    0x20000e,
-    0x57000f,
-    0x57000f,
-    0x59000f,
-    0x59000f,
-    0x1e000f,
-    0x1e000f,
-    0x1f000f,
-    0x1f000f,
-    0x560010,
-    0x1d0010,
-    0x1a0010,
-    0x1b0010,
-    0x1c0010,
-    0x180010,
-    0x580010,
-    0x190011,
-    0x190011,
-    0x160011,
-    0x160011,
-    0x170011,
-    0x170011,
-    0x5a0012,
-    0x150012,
-    0x130012,
-    0x30012,
-    0x10012,
-    0x20012,
-    0x12,
-    0x620013,
-    0x630013,
-    0x640013,
-    0x650013,
-    0x660013,
-    0x750013,
-    0x610013,
-    0x5b0013,
-    0x5c0013,
-    0x5d0013,
-    0x5e0013,
-    0x5f0013,
-    0x600013,
-    0x680013,
-    0x6f0013,
-    0x700013,
-    0x710013,
-    0x720013,
-    0x730013,
-    0x740013,
-    0x6e0013,
-    0x690013,
-    0x6a0013,
-    0x6b0013,
-    0x6c0013,
-    0x6d0013,
-    0x760013,
-    0x60013,
-    0x80013,
-    0x90013,
-    0xa0013,
-    0x50013,
-    0x670013,
-    0x780013,
-    0x770013,
-    0x40013,
-    0x70013,
-    0xf0013,
-    0x100013,
-    0x120013,
-    0x140013,
-    0x110013,
-    0xb0013,
-    0xc0013,
-    0xe0013,
-    0xd0013
-};
diff --git a/media/libstagefright/codecs/aacdec/huffcb.cpp b/media/libstagefright/codecs/aacdec/huffcb.cpp
deleted file mode 100644
index 30f38fa..0000000
--- a/media/libstagefright/codecs/aacdec/huffcb.cpp
+++ /dev/null
@@ -1,381 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/huffcb.c
- Funtions:
-    huffcb
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  Change variable names for clarity,
-               change variables 'base', 'sect_len_inc', and 'esc_val' to
-               UChar type.
-
- Description:  Add "if ((pSect[-1] % sfb_per_win) > max_sfb)" statement to
-               detect the error condition.
-               add more white space.
-
- Description: eliminated "pSect[-1]%sfb_per_win" operation
-
- Description: eliminated "pSect[-1]%sfb_per_win" operation
-
- Description: (1) Pass in SectInfo pSect
-              (2) put BITS *pInputStream as second parameter
-
- Description:  Fix a failure for thrid party AAC encoding.
-               The problem came when the total and the
-               maximun number of active scale factor bands do not coincide.
-               This is a rare situation but produces a problem when decoding
-               encoders that tolerate this.
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less and get1bits
-              when only 1 bit is read.
-
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    UChar   *pSect  = pointer to array that contains the interleaved
-                      information of huffman codebook index and section
-                      length. Array contains:
-                      [codebook index]
-                      [section boundary]
-                      [codebook index]
-                      [section boundary]
-                      ...
-
-    Int     sectbits  =   array that defines the number of bits
-                          used for expressing the escape value of
-                          section length
-
-    Int     tot_sfb     = total number of sfb in one Frame
-
-    Int     sfb_per_win = number of sfb in each sub-block (window)
-
-    UChar   max_sfb     = 1 + number of active sfbs - see reference (2) p56
-
-    BITS    *pInputStream = pointer to input stream
-
-
- Local Stores/Buffers/Pointers Needed:
-
-    UChar    base     = number of sfb in already detected sections
-
-    UChar    sect_len_inc = section length increment in number of sfbs'
-
-    UChar    esc_val  = escape value for section length
-
-    Int     bits     = number of bits needed for expressing section length
-
-
- Global Stores/Buffers/Pointers Needed:
-
-
- Outputs:
-
-    num_sect = total number of sections in one frame
-
-
- Pointers and Buffers Modified:
-
-    UChar    *pSect = pointer to array where huffman codebook index and
-                     section length are stored
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- Background knowledge: 1024(960) coef's are separated into several sections,
- each section is encoded with one single Huffman codebook, and each section
- has a length of multiples of sfb.
-
- max_sfb <= sfb_per_win <= tot_sfb
- tot_sfb = total number of scalefactor bands in one frame (1024 coefs)
-
- This function reads the codebook index and section boundaries (expressed
- in number of sfb) from the input bitstream, store these information in
- *pSect, and return the number of sections been detected. Returns 0 if there
- is an error.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function should fill the array *pSect with section Huffman codebook
- indexes and section boundaries
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3 1999(E)
-   Subpart 4    p55     (Recovering section_data())
-                p24-25  (Syntax of section_data())
-
- (3) M. Bosi, K. Brandenburg, etc., "ISO/IEC MPEG-2 Advanced Audio Coding,"
-     J. Audio Eng. Soc., Vol.45, No.10, 1997 October
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
- bits_needed_for_ESC  = sectbits[0];
- ESC_value            = (1<<bits_needed_for_ESC) - 1;
- num_of_section       = 0;
-
-
- FOR (base = 0; base<total_sfb AND num_of_section<total_sfb)
- {
-    *pSect++     = getbits(LEN_CB, pInputStream);   (read huffman_codebook_num)
-    sect_length_incr  = getbits(bits_needed_for_ESC, pInputStream);
-
-    WHILE (sect_length_incr == ESC_value AND base < total_sfb)
-    {
-        base              += ESC_value;
-        sect_length_incr  =  getbits(bits_needed_for_ESC, ebits);
-    }
-    ENDWHILE
-
-    base      += sect_length_incr;
-    *pSect++   =  base;
-    num_of_section++;
-
-   IF (num_of_sfb_for_this_group==max_sfb)
-   {
-        *pSect++    = 0; (use huffman codebook 0)
-        base       += sfb_per_win - max_sfb;
-        *pSect++    = base;
-        num_of_section++;
-   }
-   ENDIF
-
-   IF (num_of_sfb_for_this_group > max_sfb)
-        break;
-   ENDIF
-
- }
- ENDFOR
-
- IF (base != total_sfb OR num_of_section>total_sfb)
-      return 0;
- ENDIF
-
- return num_sect;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "huffman.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int huffcb(
-    SectInfo    *pSect,
-    BITS        *pInputStream,
-    Int         sectbits[],
-    Int         tot_sfb,
-    Int         sfb_per_win,
-    Int         max_sfb)
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-
-    Int   base;        /* section boundary */
-    Int   sect_len_incr;
-    Int   esc_val;     /* ESC of section length = 31(long), =7 (short) */
-    Int     bits;        /* # of bits used to express esc_val */
-    Int     num_sect;
-    Int     active_sfb;
-    Int   group_base;
-
-
-    /*----------------------------------------------------------------------------
-    ; Function body here
-    ----------------------------------------------------------------------------*/
-
-    bits       =  sectbits[0];     /* 3 for SHORT_WIN, 5 for LONG_WIN */
-    esc_val    = (1 << bits) - 1;   /* ESC_value for section length */
-    num_sect   =  0;
-    base       =  0;
-    group_base =  0;
-
-    /* read until the end of one frame */
-    while ((base < tot_sfb) && (num_sect < tot_sfb))
-    {
-
-        pSect->sect_cb  = get9_n_lessbits(
-                              LEN_CB,
-                              pInputStream); /* section codebook */
-
-        sect_len_incr   = get9_n_lessbits(
-                              bits,
-                              pInputStream); /* length_incr */
-
-
-        /* read until non-ESC value, see p55 reference 2 */
-        while ((sect_len_incr == esc_val) && (base < tot_sfb))
-        {
-            base            +=  esc_val;
-
-            sect_len_incr   = get9_n_lessbits(
-                                  bits,
-                                  pInputStream);
-        }
-
-        base      += sect_len_incr;
-        pSect->sect_end  =  base; /* total # of sfb until current section */
-        pSect++;
-        num_sect++;
-
-        /* active_sfb = base % sfb_per_win; */
-        active_sfb = base - group_base;
-
-        /*
-         *  insert a zero section for regions above max_sfb for each group
-         *  Make sure that active_sfb is also lesser than tot_sfb
-         */
-
-        if ((active_sfb == max_sfb) && (active_sfb < tot_sfb))
-        {
-            base      += (sfb_per_win - max_sfb);
-            pSect->sect_cb   =   0; /* huffman codebook 0 */
-            pSect->sect_end  =   base;
-            num_sect++;
-            pSect++;
-            group_base = base;
-        }
-        else if (active_sfb > max_sfb)
-        {
-            /* within each group, the sections must delineate the sfb
-             * from zero to max_sfb so that the 1st section within each
-             * group starts at sfb0 and the last section ends at max_sfb
-             * see p55 reference 2
-             */
-            break;
-        }
-
-    } /* while (base=0) */
-
-
-    if (base != tot_sfb || num_sect > tot_sfb)
-    {
-        num_sect = 0;   /* error */
-    }
-
-    return num_sect;
-
-} /* huffcb */
-
-
diff --git a/media/libstagefright/codecs/aacdec/huffdecode.cpp b/media/libstagefright/codecs/aacdec/huffdecode.cpp
deleted file mode 100644
index 890a6fb..0000000
--- a/media/libstagefright/codecs/aacdec/huffdecode.cpp
+++ /dev/null
@@ -1,528 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: huffdecode.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  Change variable types.
-
- Description:  (1) Modified to bring in-line with PV standards.
-               (2) Eliminated global_gain on stack,
-                   getics() has to define this parameter on its stack.
-               (3) Eliminated multiple returns
-               (4) Altered return logic of getics()
-               (5) Convert Real coef -> Int32 coef
-               (6) Move BITS *pInputStream to 2nd parameter of huffdecode.c
-                   and getics.c
-               (7) Pass pFrameInfo per channel, because two channels can have
-                   different windows
-
- Description: (1) Eliminated function call to chn_config
-              (2) Eliminate widx calculation
-              (3) copy channel info from left to right when common_window
-                  is enabled
-              (4) add error checking of getmask return value
-
- Description:  Change default_position to current_program
-
- Description:  Remove prstflag
-
- Description:  Modify call to get_ics_info
-
- Description:  Modified so getmask is NOT called if the status returned
- from get_ics_info indicates an error.
-
- Description:
- (1) Added include of "e_ElementId.h"
-     Previously, this function was relying on another include file
-     to include e_ElementId.h
-
- (2) Updated the copyright header.
-
- Description:  Modified to include usage of the new "shared memory" structures
- defined in s_tDec_Int_File.h and s_tDec_Int_Chan.h
-
- Description:
- (1) Updated to reflect the fact that the temporary FrameInfo used by getics.c
- was moved into the region of memory shared with fxpCoef.
-
- Description:
- (1) Removed first parameter to getics.  The temporary FrameInfo was
-     unnecessary.
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less and get1bits
-              when only 1 bit is read.
-
- Description: Relaxed tag verification. Some encoder do not match the tag
-              to the channel ID (as the standard request to differentiate
-              different channel), in our wireless work, with only mono
-              or stereo channel, this become restrictive to some encoders
-
-
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    id_syn_ele  = identification flag for channel syntactic element, Int
-
-    pInputStream= pointer to input bitstream, BITS.
-
-    pVars       = pointer to structure that holds information for decoding,
-                  tDec_Int_File
-
-    pChVars[]   = pointer to structure that holds channel information,
-                  tDec_Int_Chan
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    status = 0  if success
-             non-zero  otherwise
-
- Pointers and Buffers Modified:
-    pChVars->sect   contents updated by newly decoded section information
-                    of current frame
-
-    pChVars->factors contents updated by newly decoded scalefactors
-
-    pChVars->ch_coef contents updated by newly decoded spectral coefficients
-
-    PChVars->tns    contents updated by newly decoded TNS information
-
-    pVars->hasmask  contents updated by newly decoded Mid/Side mask
-                    information
-
-    pVars->pulseInfo contents updated by newly decoded pulse data information
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  This function offers a framework for decoding the data of the next 1024
-  samples. It maps the channel configuration according to the id_syn_ele flag,
-  configures the channel information, and calls getics to do huffman decoding
-  The function returns 1 if there was an error
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function should set up the channel configuration for huffman decoding
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-    Subpart 4       p15     (single_channel_element, channel_pair_element)
-                    p15     (Table 4.4.5    getmask)
-                    p16     (Table 4.4.6    get_ics_info)
-                    p24     (Table 4.4.24   getics)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    tag = CALL getbits(LEN_TAG,pInputStream)
-                MODIFYING(pInputStream)
-                RETURNING(tag)
-
-    common_window = 0;
-
-    IF (id_syn_ele == ID_CPE)
-    THEN
-        common_window = CALL getbits(LEN_COM_WIN,pInputStream);
-                                MODIFYING(pInputStream)
-                                RETURNING(common_window)
-    ENDIF
-
-    pMcInfo = &pVars->mc_info;
-
-    IF ( (pMcInfo->ch_info[0].cpe != id_syn_ele) OR
-         (pMcInfo->ch_info[0].tag != tag) )
-    THEN
-        status = 1;
-    ENDIF
-
-
-    IF (status == SUCCESS)
-    THEN
-        IF (id_syn_ele == ID_SCE)
-        THEN
-
-            leftCh  = 0;
-            RIGHT = 0;
-            pChVars[leftCh]->hasmask = 0;
-        ELSEIF (id_syn_ele == ID_CPE)
-
-            leftCh = 0;
-            rightCh  = 1;
-
-            IF (common_window != FALSE)
-            THEN
-
-                CALL get_ics_info(
-                        audioObjectType = pVars->mc_info.audioObjectType,
-                        pInputStream = pInputStream,
-                        common_window = common_window,
-                        pWindowSequence = &pChVars[leftCh]->wnd,
-                        &pChVars[leftCh]->wnd_shape_this_bk,
-                        pChVars[leftCh]->group,
-                        &pChVars[leftCh]->max_sfb,
-                        pVars->winmap,
-                        &pChVars[leftCh]->lt_status,
-                        &pChVars[rightCh]->lt_status);
-                     MODIFYING(pInputStream, wnd, wnd_shape_this_bk,group,
-                               max_sfb, lt_status)
-                     RETURNING(status)
-
-                IF (status == SUCCESS)
-                THEN
-
-                    pChVars[rightCh]->wnd = pChVars[leftCh]->wnd;
-                    pChVars[rightCh]->wnd_shape_this_bk =
-                        pChVars[leftCh]->wnd_shape_this_bk;
-                    pChVars[rightCh]->max_sfb = pChVars[leftCh]->max_sfb;
-                    pv_memcpy(
-                        pChVars[rightCh]->group,
-                        pChVars[leftCh]->group,
-                        NSHORT*sizeof(pChVars[leftCh]->group[0]));
-
-                    hasmask = CALL getmask(
-                                    pVars->winmap[pChVars[leftCh]->wnd],
-                                    pInputStream,
-                                    pChVars[leftCh]->group,
-                                    pChVars[leftCh]->max_sfb,
-                                    pChVars[leftCh]->mask);
-                                MODIFYING(pInputStream, mask)
-                                RETURNING(hasmask)
-
-                    IF (hasmask == MASK_ERROR)
-                    THEN
-                        status = 1;
-                    ENDIF
-                    pChVars[leftCh]->hasmask  = hasmask;
-                    pChVars[rightCh]->hasmask = hasmask;
-
-                ENDIF
-
-            ELSE
-
-                 pChVars[leftCh]->hasmask  = 0;
-                 pChVars[rightCh]->hasmask = 0;
-            ENDIF(common_window)
-
-        ENDIF(id_syn_ele)
-
-    ENDIF (status)
-
-    ch = leftCh;
-
-    WHILE((ch <= rightCh) AND (status == SUCCESS))
-
-        status = CALL getics(
-                        pInputStream,
-                        common_window,
-                        pVars,
-                        pChVars[ch],
-                        pChVars[ch]->group,
-                        &pChVars[ch]->max_sfb,
-                        pChVars[ch]->cb_map,
-                        &pChVars[ch]->tns,
-                        pVars->winmap,
-                        &pVars->pulseInfo,
-                        pChVars[ch]->sect);
-                    MODIFYING(pInputStream,pVarsp,ChVars[ch],group,
-                              max_sfb,tns,pulseInfo,sect)
-                    RETURNING(status)
-
-        ch++;
-
-    ENDWHILE
-
-    RETURN status;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "aac_mem_funcs.h"
-#include    "huffman.h"
-#include    "e_maskstatus.h"
-#include    "e_elementid.h"
-#include    "get_ics_info.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define LEFT  (0)
-#define RIGHT (1)
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int huffdecode(
-    Int           id_syn_ele,
-    BITS          *pInputStream,
-    tDec_Int_File *pVars,
-    tDec_Int_Chan *pChVars[])
-
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-    Int      ch;
-    Int      common_window;
-    Int      hasmask;
-    Int      status   = SUCCESS;
-    Int      num_channels = 0;
-    MC_Info  *pMcInfo;
-
-    per_chan_share_w_fxpCoef *pChLeftShare;  /* Helper pointer */
-    per_chan_share_w_fxpCoef *pChRightShare; /* Helper pointer */
-    /*----------------------------------------------------------------------------
-    ; Function body here
-    ----------------------------------------------------------------------------*/
-
-    get9_n_lessbits(
-        LEN_TAG,
-        pInputStream);
-
-    /* suppose an un-supported id_syn_ele will never be passed */
-
-    common_window = 0;
-
-    if (id_syn_ele == ID_CPE)
-    {
-        common_window =
-            get1bits(pInputStream);
-    }
-
-    pMcInfo = &pVars->mc_info;
-
-    /*
-     *  check if provided info (num of channels) on audio config,
-     *  matches read bitstream data, if not, allow update only once.
-     *  In almost all cases it should match.
-     */
-    if ((pMcInfo->ch_info[0].cpe != id_syn_ele))
-    {
-        if (pVars->mc_info.implicit_channeling)     /* check done only once */
-        {
-            pMcInfo->ch_info[0].cpe = id_syn_ele & 1; /*  collect info from bitstream
-                                                     *  implicit_channeling flag is locked
-                                                     *  after 1st frame, to avoid toggling
-                                                     *  parameter in the middle of the clip
-                                                     */
-            pMcInfo->nch = (id_syn_ele & 1) + 1;     /* update number of channels */
-        }
-        else
-        {
-            status = 1; /* ERROR break if syntax error persist  */
-        }
-    }
-
-    if (status == SUCCESS)
-    {
-        if (id_syn_ele == ID_SCE)
-        {
-
-            num_channels = 1;
-            pVars->hasmask = 0;
-        }
-        else if (id_syn_ele == ID_CPE)
-        {
-            pChLeftShare = pChVars[LEFT]->pShareWfxpCoef;
-            pChRightShare = pChVars[RIGHT]->pShareWfxpCoef;
-            num_channels = 2;
-
-            if (common_window != FALSE)
-            {
-
-                status = get_ics_info(
-                             (tMP4AudioObjectType) pVars->mc_info.audioObjectType,
-                             pInputStream,
-                             (Bool)common_window,
-                             (WINDOW_SEQUENCE *) & pChVars[LEFT]->wnd,
-                             (WINDOW_SHAPE *) & pChVars[LEFT]->wnd_shape_this_bk,
-                             pChLeftShare->group,
-                             (Int *) & pChLeftShare->max_sfb,
-                             pVars->winmap,
-                             (LT_PRED_STATUS *) & pChLeftShare->lt_status,
-                             (LT_PRED_STATUS *) & pChRightShare->lt_status);
-
-                if (status == SUCCESS)
-                {
-                    /* copy left channel info to right channel */
-                    pChVars[RIGHT]->wnd = pChVars[LEFT]->wnd;
-                    pChVars[RIGHT]->wnd_shape_this_bk =
-                        pChVars[LEFT]->wnd_shape_this_bk;
-                    pChRightShare->max_sfb = pChLeftShare->max_sfb;
-                    pv_memcpy(
-                        pChRightShare->group,
-                        pChLeftShare->group,
-                        NSHORT*sizeof(pChLeftShare->group[0]));
-
-                    hasmask = getmask(
-                                  pVars->winmap[pChVars[LEFT]->wnd],
-                                  pInputStream,
-                                  pChLeftShare->group,
-                                  pChLeftShare->max_sfb,
-                                  pVars->mask);
-
-                    if (hasmask == MASK_ERROR)
-                    {
-                        status = 1; /* ERROR code */
-                    }
-                    pVars->hasmask  = hasmask;
-
-                } /* if (status == 0) */
-            }
-            else
-            {
-                pVars->hasmask  = 0;
-            } /* if (common_window) */
-
-        } /* if (id_syn_ele) */
-
-    } /* if (status) */
-
-    ch = 0;
-    while ((ch < num_channels) && (status == SUCCESS))
-    {
-        pChLeftShare = pChVars[ch]->pShareWfxpCoef;
-
-        status = getics(
-                     pInputStream,
-                     common_window,
-                     pVars,
-                     pChVars[ch],
-                     pChLeftShare->group,
-                     &pChLeftShare->max_sfb,
-                     pChLeftShare->cb_map,
-                     &pChLeftShare->tns,
-                     pVars->winmap,
-                     &pVars->share.a.pulseInfo,
-                     pVars->share.a.sect);
-
-        ch++;
-
-    } /* while (ch) */
-
-    /*----------------------------------------------------------------------------
-    ; Return status
-    ----------------------------------------------------------------------------*/
-
-    return status;
-
-} /* huffdecode */
-
diff --git a/media/libstagefright/codecs/aacdec/hufffac.cpp b/media/libstagefright/codecs/aacdec/hufffac.cpp
deleted file mode 100644
index e5a9c59..0000000
--- a/media/libstagefright/codecs/aacdec/hufffac.cpp
+++ /dev/null
@@ -1,550 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/hufffac.c
- Funtions:
-    hufffac
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description: (1) Modified with new templates,
-              (2) Modified variable names for clarity
-              (3) adjusted variables of "for loop"
-              (4) eliminated multiple returns, use return valid
-
- Description: (1) Change return logic: 0 if success, 1 if error
-              (2) Define SectInfo structure to store section codebook index
-                  and section boundary
-              (3) Substitute "switch" with "if- else if"
-              (4) move BITS *pInputStream to second pass-in parameter
-              (5) pass in huffBookUsed[] to save stack size
-
- Description: (1) Remove pass in parameter Hcb pBook
-
- Description: Use binary tree search in decode_huff_cw_binary
-
- Description: Use decode_huff_scl function.
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    *pFrameInfo     = pointer to structure that holds information
-                      of each Frame. type FrameInfo
-
-    *pInputStream   = pointer to input bitstream. type BITS
-
-    *pGroup         = pointer to array that contains the index of the first
-                      window in each group, type UChar
-
-    nsect           = number of sections to be decoded. type Int
-
-    *pSect          = pointer to structure array that contains the huffman
-                      codebook index and section boundary for each section,
-                      type SectInfo
-
-    global_gain     = initial value for "DPCM encoded" scalefactors and noise
-                      energy, type Int
-
-    *pFactors       = pointer to array that stores the decoded scalefactors,
-                      intensity position or noise energy, type Int
-
-    huffBookUsed    = array that will hold the huffman codebook index for
-                      each sfb, type Int
-
-    *pBook          = pointer to structure that contains the huffman codebook
-                      information, such as dimension, Largest Absolute Value
-                      (LAV) of each huffman codebook, etc. type Hcb
-
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-         0 if success
-         1 if error
-
- Pointers and Buffers Modified:
-
-        Int   *pFactors    contains the newly decoded scalefactors and/or
-                             intensity position and/or noise energy level
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function first reads the Huffman codebook index of all sections within
- one Frame. Then, depending on the huffman codebook index of each section,
- the function decodes the scalefactors, and/or intensity positions
- (INTENSITY_HCB, INTENSITY_HCB2), and/or noise energy (NOISE_HCB)
- for every scalefactor band in each section.
- The function returns 0 upon successful decoding, returns 1 if error.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function should replace the content of the array pFactors with the
- decoded scalefactors and/or intensity positions and/or noise energy
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-     Subpart 4      p72-73  (scalefactors)
-                    p76     (decoding)
-                    p78     (Table 4.6.1, Table 4.6.2)
-                    p93-94  (INTENSITY_HCB)
-                    p123    (NOISE_HCB)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
- status = SUCCESS;
-
- CALL pv_memset(pHuffBookUsed, ZERO_HCB, MAXBANDS*sizeof(*pHuffBookUsed));
-
- CALL pv_memset(pFactors, ZERO_HCB, MAXBANDS*sizeof(*pFactors));
-
- sect_start       = 0;
-
- FOR(sect_idx = nsect; sect_idx > 0; sect_idx--)
- {
-     sect_cb  = pSect->sect_cb;
-     sect_end = pSect->sect_end;
-     pSect++;
-
-     CALL pv_memset(
-        &pHuffBookUsed[sect_start],
-        sect_cb,
-        (sect_end - sect_start));
-
- }
- ENDFOR
-
-    fac       = global_gain;
-    is_pos    = 0;
-    noise_nrg = global_gain - NOISE_OFFSET;
-
-    pTable    = pBook[BOOKSCL].pTable;
-    group_win  = 0;
-    group_end  = 0;
-
-    WHILE((group_end < pFrameInfo->num_win)&&(status == SUCCESS))
-    {
-        nsfb_win  = pFrameInfo->sfb_per_win[group_end];
-        group_end = *pGroup++;
-
-        FOR(sfb = 0; sfb < nsfb_win; sfb++)
-        {
-            IF ((pHuffBookUsed[sfb] > 0)&&(pHuffBookUsed[sfb] < BOOKSCL))
-            {
-                cw_index = CALL decode_huff_cw_binary(pTable, pInputStream);
-
-                fac      += cw_index - MIDFAC;
-
-                IF((fac >= 2*TEXP) || (fac < 0))
-                {
-                    status = 1;
-                }
-                ELSE
-                {
-                    pFactors[sfb] = fac;
-                }
-                ENDIF (fac)
-
-            }
-            ELSE IF (pHuffBookUsed[sfb] == ZERO_HCB)
-            {
-                do nothing;
-            }
-
-            ELSE IF ((pHuffBookUsed[sfb] == INTENSITY_HCB)||
-                     (pHuffBookUsed[sfb] == INTENSITY_HCB2))
-            {
-                cw_index = CALL decode_huff_cw_binary(pTable, pInputStream);
-
-                is_pos        += cw_index - MIDFAC;
-                pFactors[sfb] =  is_pos;
-            }
-
-            ELSE IF (pHuffBookUsed[sfb] == NOISE_HCB)
-            {
-                IF (noise_pcm_flag == TRUE)
-                {
-                    noise_pcm_flag = FALSE;
-                    dpcm_noise_nrg = CALL getbits(
-                                              NOISE_PCM_BITS,
-                                              pInputStream);
-
-                    dpcm_noise_nrg -= NOISE_PCM_OFFSET;
-                }
-                ELSE
-                {
-                    dpcm_noise_nrg = CALL decode_huff_cw_binary(
-                                              pTable,
-                                              pInputStream);
-
-                    dpcm_noise_nrg -= MIDFAC;
-                }
-                ENDIF (noise_pcm_flag)
-
-                noise_nrg       += dpcm_noise_nrg;
-                pFactors[sfb]   =  noise_nrg;
-            }
-
-            ELSE IF (pHuffBookUsed[sfb] == BOOKSCL)
-            {
-                status = 1;
-            }
-            ENDIF (pHuffBookUsed[sfb])
-
-        }
-        ENDFOR (sfb)
-
-        IF (pFrameInfo->islong == FALSE)
-        {
-
-            FOR(group_win++; group_win < group_end; group_win++)
-            {
-                FOR (sfb=0; sfb < nsfb_win; sfb++)
-                {
-                    pFactors[sfb + nsfb_win]  =  pFactors[sfb];
-                }
-                ENDFOR
-
-                pFactors  +=  nsfb_win;
-            }
-            ENDFOR
-
-        }
-        ENDIF (pFrameInfo)
-
-        pHuffBookUsed   += nsfb_win;
-        pFactors        += nsfb_win;
-
-    }
-    ENDWHILE (group_end)
-
-    return status;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "aac_mem_funcs.h"       /* pv_memset */
-#include    "s_frameinfo.h"
-#include    "s_bits.h"
-#include    "s_sectinfo.h"
-#include    "s_huffman.h"
-#include    "ibstream.h"
-
-#include    "hcbtables.h"
-#include    "e_huffmanconst.h"
-#include    "e_infoinitconst.h"
-#include    "huffman.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int hufffac(
-    FrameInfo   *pFrameInfo,
-    BITS        *pInputStream,
-    Int         *pGroup,    /* may be changed to Int */
-    Int         nsect,
-    SectInfo    *pSect,     /* may be changed to Int */
-    Int         global_gain,
-    Int         *pFactors,
-    Int         huffBookUsed[])
-{
-    Int     sect_idx;
-    Int     group_end;  /* index of 1st window in next group */
-    Int     group_win;  /* window index within group */
-    Int     cw_index;   /* huff codeword index */
-    Int     nsfb_win;   /* # of scfbands per window */
-    Int     sfb;        /* scalefactor band index */
-    Int     sect_cb;    /* huff codebook # for each section */
-    Int     fac;        /* decoded scf */
-    Int     is_pos;     /* intensity stereo position */
-    Int     noise_pcm_flag = TRUE;  /* first PNS sfb */
-    Int     dpcm_noise_nrg;     /* dpcm noise energy */
-    Int     noise_nrg;      /* noise energy */
-    Int     status = SUCCESS;  /* status of decoding */
-    Int     *pHuffBookUsed = &huffBookUsed[0];
-
-
-    pv_memset(pFactors,
-              ZERO_HCB,
-              MAXBANDS*sizeof(*pFactors));
-
-
-    if (nsect)
-    {
-        /* read section length and codebook */
-
-        if (nsect == 1) /* long window */
-        {
-            sect_cb  = pSect->sect_cb;  /* codebook for this section */
-
-            /* all sfbs in one section share the same codebook */
-
-            for (sfb = pSect->sect_end >> 2; sfb != 0; sfb--)
-            {
-                *(pHuffBookUsed++) = sect_cb;
-                *(pHuffBookUsed++) = sect_cb;
-                *(pHuffBookUsed++) = sect_cb;
-                *(pHuffBookUsed++) = sect_cb;
-            }
-            for (sfb = pSect->sect_end & 3; sfb != 0; sfb--)
-            {
-                *(pHuffBookUsed++) = sect_cb;
-            }
-
-        }
-        else            /* short */
-        {
-            Int sect_start = 0; /* start index of sfb for each section */
-            for (sect_idx = nsect; sect_idx > 0; sect_idx--)
-            {
-                sect_cb  = pSect->sect_cb;  /* codebook for this section */
-
-                /* all sfbs in one section share the same codebook */
-                for (sfb = sect_start; sfb < pSect->sect_end; sfb++)
-                {
-                    pHuffBookUsed[sfb] = sect_cb;
-                }
-
-                pSect++;
-                sect_start = sfb;
-
-            } /* for (sect_idx) */
-        }
-    }
-    else
-    {
-        /* clear array for the case of max_sfb == 0 */
-        pv_memset(pHuffBookUsed,
-                  ZERO_HCB,
-                  MAXBANDS*sizeof(*pHuffBookUsed));
-    }
-
-    pHuffBookUsed = &huffBookUsed[0];
-
-    /* scale factors and noise energy are dpcm relative to global gain
-     * intensity positions are dpcm relative to zero
-     */
-    fac       = global_gain;
-    is_pos    = 0;
-    noise_nrg = global_gain - NOISE_OFFSET;
-
-    /* get scale factors,
-     * use reserved Table entry = 12, see reference (2) p78 Table 4.6.2
-     */
-    group_win  = 0;
-    group_end  = 0;
-
-
-    /* group by group decoding scalefactors and/or noise energy
-     * and/or intensity position
-     */
-    while ((group_end < pFrameInfo->num_win) && (status == SUCCESS))
-    {
-        nsfb_win  = pFrameInfo->sfb_per_win[group_end];
-        group_end = *pGroup++;  /* index of 1st window in next group */
-
-        /* decode scf in first window of each group */
-
-        for (sfb = 0; sfb < nsfb_win; sfb++)
-        {
-
-            switch (pHuffBookUsed[sfb])
-            {
-                case ZERO_HCB:
-                    break;
-                case INTENSITY_HCB:
-                case INTENSITY_HCB2:
-                    /* intensity books */
-                    /* decode intensity position */
-                    cw_index = decode_huff_scl(pInputStream);
-
-                    is_pos        += cw_index - MIDFAC;
-                    pFactors[sfb] =  is_pos;
-                    break;
-                case NOISE_HCB:
-                    /* noise books */
-                    /* decode noise energy */
-                    if (noise_pcm_flag == TRUE)
-                    {
-                        noise_pcm_flag = FALSE;
-                        dpcm_noise_nrg = get9_n_lessbits(NOISE_PCM_BITS,
-                                                         pInputStream);
-
-                        dpcm_noise_nrg -= NOISE_PCM_OFFSET;
-                    }
-                    else
-                    {
-                        dpcm_noise_nrg = decode_huff_scl(pInputStream);
-
-                        dpcm_noise_nrg -= MIDFAC;
-                    } /* if (noise_pcm_flag) */
-
-                    noise_nrg       += dpcm_noise_nrg;
-                    pFactors[sfb]   =  noise_nrg;
-                    break;
-                case BOOKSCL:
-                    status = 1; /* invalid books */
-                    sfb = nsfb_win;  /* force out */
-                    break;
-                default:
-                    /* spectral books */
-                    /* decode scale factors */
-                    cw_index = decode_huff_scl(pInputStream);
-
-                    fac      += cw_index - MIDFAC;   /* 1.5 dB */
-                    if ((fac >= 2*TEXP) || (fac < 0))
-                    {
-                        status = 1;   /* error, MUST 0<=scf<256, Ref. p73 */
-                    }
-                    else
-                    {
-                        pFactors[sfb] = fac;  /* store scf */
-                    } /* if (fac) */
-            }
-
-        } /* for (sfb=0), first window decode ends */
-
-        /* expand scf to other windows in the same group */
-        if (pFrameInfo->islong == FALSE)
-        {
-
-            for (group_win++; group_win < group_end; group_win++)
-            {
-                for (sfb = 0; sfb < nsfb_win; sfb++)
-                {
-                    pFactors[sfb + nsfb_win]  =  pFactors[sfb];
-                }
-                pFactors  +=  nsfb_win;
-            }
-
-        } /* if (pFrameInfo->islong), one group decode ends */
-
-
-        /* points to next group */
-        pHuffBookUsed   += nsfb_win;
-        pFactors        += nsfb_win;
-
-    } /* while (group_end), all groups decode end */
-
-    return status;
-
-} /* hufffac */
-
diff --git a/media/libstagefright/codecs/aacdec/huffman.h b/media/libstagefright/codecs/aacdec/huffman.h
deleted file mode 100644
index 030ae23..0000000
--- a/media/libstagefright/codecs/aacdec/huffman.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: .huffman.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Put declaration of getfill in this file.
-
- Description: Remove prstflag from get_ics_info declaration.
-
- Description: Trivial change of the data type of one of the parameters to
-              get_ics_info.
-
- Description: Change where get_ics_info is declared.
-
- Description: Clean up comments
-
- Description: (1) Add declaration of binary tree search function for Huffman
-                  decoding
-              (2) #if the traditional and optimized linear seach methods.
-
- Description: Modified per review comments
-              (1) delete #if traditional and optimized linear seach methods
-
- Description: Merged Ken's change on getics: delete pFrameInfo from argument
-              list
-
- Description: Added function definition for table specific huffman decoding
-              functions.
-
- Who:                                         Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- include function prototype definitions for Huffman decoding module
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef HUFFMAN_H
-#define HUFFMAN_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_frameinfo.h"
-#include    "s_sectinfo.h"
-#include    "s_pulseinfo.h"
-#include    "s_tdec_int_file.h"
-#include    "s_tdec_int_chan.h"
-#include    "ibstream.h"
-
-#include    "s_hcb.h"
-#include    "hcbtables.h"
-
-#include    "get_pulse_data.h"
-#include    "get_ics_info.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-#define DIMENSION_4     4
-#define DIMENSION_2     2
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-    Int decode_huff_cw_tab1(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab2(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab3(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab4(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab5(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab6(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab7(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab8(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab9(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab10(
-        BITS *pInputStream);
-
-    Int decode_huff_cw_tab11(
-        BITS *pInputStream);
-
-    Int decode_huff_scl(
-        BITS          *pInputStream);
-
-    Int infoinit(
-        const  Int sampling_rate_idx,
-        FrameInfo   **ppWin_seq_info,
-        Int    *pSfbwidth128);
-
-    Int huffcb(
-        SectInfo *pSect,
-        BITS     *pInputStream,
-        Int      *pSectbits,
-        Int       tot_sfb,
-        Int       sfb_per_sbk,
-        Int       max_sfb);
-
-    Int hufffac(
-        FrameInfo   *pFrameInfo,
-        BITS        *pInputStream,
-        Int         *pGroup,
-        Int          nsect,
-        SectInfo    *pSect,
-        Int          global_gain,
-        Int         *pFactors,
-        Int          huffBookUsed[]);
-
-    Int huffspec_fxp(
-        FrameInfo *pFrameInfo,
-        BITS      *pInputStream,
-        Int       nsect,
-        SectInfo  *pSectInfo,
-        Int       factors[],
-        Int32     coef[],
-        Int16     quantSpec[],
-        Int16     tmp_spec[],
-        const FrameInfo  *pLongFrameInfo,
-        PulseInfo  *pPulseInfo,
-        Int         qFormat[]);
-
-    Int huffdecode(
-        Int           id_syn_ele,
-        BITS          *pInputStream,
-        tDec_Int_File *pVars,
-        tDec_Int_Chan *pChVars[]);
-
-    void deinterleave(
-        Int16          interleaved[],
-        Int16        deinterleaved[],
-        FrameInfo   *pFrameInfo);
-
-    Int getics(
-
-        BITS            *pInputStream,
-        Int             common_window,
-        tDec_Int_File   *pVars,
-        tDec_Int_Chan   *pChVars,
-        Int             group[],
-        Int             *pMax_sfb,
-        Int             *pCodebookMap,
-        TNS_frame_info  *pTnsInfo,
-        FrameInfo       **pWinMap,
-        PulseInfo       *pPulseInfo,
-        SectInfo        sect[]);
-
-    void  calc_gsfb_table(
-        FrameInfo   *pFrameInfo,
-        Int         group[]);
-
-    Int getmask(
-        FrameInfo   *pFrameInfo,
-        BITS        *pInputStream,
-        Int         *pGroup,
-        Int         max_sfb,
-        Int         *pMask);
-
-    void getgroup(
-        Int         group[],
-        BITS        *pInputStream);
-
-
-    /*----------------------------------------------------------------------------
-    ; END
-    ----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/huffspec_fxp.cpp b/media/libstagefright/codecs/aacdec/huffspec_fxp.cpp
deleted file mode 100644
index b18c12d..0000000
--- a/media/libstagefright/codecs/aacdec/huffspec_fxp.cpp
+++ /dev/null
@@ -1,671 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname:  huffspec_fxp.c
- Funtions:
-    huffspec_fxp
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description: (1) Modified to keep in-line with PV standards
-              (2) Eliminated "continue" in if(sect_cb==ZERO_HCB||...)
-
- Description: (1) Use SectInfo *pSect
-              (2) Convert 'Real' to 'Int32', float -> fixed-point
-              (3) move BITS *pInputStream to second parameter
-              (4) pass in quantSpec and tmp_spec, scratch shared with hufffac
-              (5) pass in FrameInfo *pLongFrameInfo, eliminate only_long_info
-
- Description: (1) Eliminate parameter Hcb *book, because of eliminating
-                  function 'hufftab.c', Hcb hcbbook defined as a
-                  const structure in 'hcbtables.h'.
-              (2) Replace three nested 'for' loops with a for-while loop in
-                  the rescaling part.
-              (3) Change esc_iquant-> esc_iquant_fxp, call esc_iquant_fxp()
-                  by sfb
-
- Description: Cleaned up include files.
-
- Description:  Correct definition of stack variable "scale".
-        It was defined as Int, but it receives an UInt value,
-        this present a problem when Int is 16 bits and
-        the sign bit is not interpreted correctly. This does not
-        shows for 32-bit implementations. This problem manifest itself
-        as a flipping sign on some spectral coefficients (the ones
-        multiplied by 0x8000).
-
- Description: Typecast b_low and b_high to 32-bits before multiplication, this
-              assures propoer compilation on a 16-bit platform (TI-C55x)
-
- Description: Modified to speed up decode_huff_cw
-
- Description: pass codebook index to decode_huff_cw, delete pointer to Huffman
-              structure
-
- Description: keep memset to quantSpec, remove memset to temp_spec
-
- Description: Modified per review comments
-
- Description: Use Binary tree search in decode_huff_cw_binary
-
- Description: Modified per review comments
-              (1) delete unused codes
-
- Description: (1) Change the interface to decode huffman codeword.
-              (2) Move the scaling inside the inverse quantization.
-              (3) Change scaling factor accuracy to 10 bits.
-
- Description:
-              (1) delete unused variable max_fac
-
- Description: Addresses of huffman tables are now found by means of a
-              switch statement, this solve linking problem when using the
-              /ropi option (Read-only position independent) for some
-              compilers
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pFrameInfo  = ptr to structure that holds Information of current Frame,
-                  type FrameInfo
-
-    pInputStream = ptr to structure of bitstream, type BITS
-
-    nsect       = number of sections in current Frame, at fs = 44.1 kHz,
-                  range [0, 49] long block, [0,112] short blocks. type Int
-
-    pSect       = ptr to structure that holds section codebook and boundary
-                  type SectInfo
-
-    factors[]   = array that contains scalefactors for each sfb, type Int16
-
-    coef[]      = array that holds inverse quantized coefs, Int32 QFormat.
-
-    quantSpec[] = array that holds quantized spectral coefs, type Int
-
-    tmp_spec[]  = temporary buffer to hold the de-interleaved coefs.
-
-    pLongFrameInfo = ptr to structure that holds long frame info
-
- Local Stores/Buffers/Pointers Needed:
-    exptable = array contains the Q15 format data for 2^0, 2^0.25, 2^0.5,
-               and 2^0.75, type const Int.
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-
-    return 0 if decoding properly.
-
- Pointers and Buffers Modified:
-
-    pInputStream    read codeword index and/or sign bits and/or ESC value
-
-    coef            contains the newly inverse quantized 1024 spec coefs,
-                    type Int32 Q-format from esc_iquant()
-
-    quantSpec       contains decoded quantized 1024 spec coefs, type Int
-
-    tmp_spec        contains the de-interleaved version of quantSpec
-
-    qFormat         contains Q-Format for each scalefactor band
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function first reads the section info (codebook and boundary), then
- decode the spectral coefficients if a spectral codebook is used.
- If necessary, get the sign bits, ESC value or the NEC_pulse data. In case of
- short window sequences, the decoded data is de-interleaved before
- multiplied by scalefactors.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function should set the content of the array 'coef' with the inverse
- quantized and rescaled value of spectral coefficients.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-    Subpart (4)         p56 (spectral_data() parsing and decoding)
-                        p26 (Syntax of spectral_data())
-                        p74-78 (decoding: unpack_idx, get_sign_bits,
-                                getescape, pulse_nc, deinterleave)
-                        p72 (inverse quantization: esc_iquant)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "aac_mem_funcs.h"
-#include    "esc_iquant_scaling.h"
-#include    "huffman.h"
-#include    "unpack_idx.h"
-#include    "pulse_nc.h"
-#include    "iquant_table.h"
-#include    "e_huffmanconst.h"
-
-
-#include "pv_normalize.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define ORDER        (3)
-
-/*
- * Format the table is stored in.
- */
-#define QTABLE       (27)
-
-/*
- * Number of bits for data in a signed 32 bit integer.
- */
-#define SIGNED32BITS  (31)
-
-/*
- * Round up value for intermediate values obtained from the table
- */
-#define ROUND_UP (( ((UInt32) 1) << (QTABLE) )-1)
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-const UInt16 exptable[4] =
-{
-    0,  /* (2^0.00)<<15 (Q10), use zero to signal no scaling required! */
-    19485,  /* (2^0.25)<<15 */
-    23171,  /* (2^0.50)<<15 */
-    27555   /* (2^0.75)<<15 */
-
-};
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int huffspec_fxp(
-    FrameInfo *pFrameInfo,
-    BITS      *pInputStream,
-    Int       nsect,
-    SectInfo  *pSectInfo,
-    Int       factors[],
-    Int32     coef[],
-    Int16     quantSpec[],
-    Int16     tmp_spec[],
-    const FrameInfo  *pLongFrameInfo,
-    PulseInfo  *pPulseInfo,
-    Int         qFormat[])
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-    const Hcb       *pHcb;
-    Int     i;
-    Int     sfb;
-    Int     idx_count;
-    Int     sect_cb;    /* section codebook */
-    Int     dim;
-    Int     idx;
-    Int     stop_idx;     /* index of 1st coef in next sfb */
-    Int     sect_start;   /* start index of sfb in one section*/
-    Int     sect_end;     /* index of 1st sfb in next section */
-    Int     *pSfbStart;
-    Int     *pSfb;
-    Int16     *pQuantSpec;        /* probably could be short */
-    Int     max = 0;
-    /* rescaling parameters */
-    Int     nsfb;
-    Int     tot_sfb;
-    Int     fac;
-
-    Int32   *pCoef; /* ptr to coef[], inverse quantized coefs */
-    UInt16     scale;
-
-    Int     power_scale_div_4;
-    Int     sfbWidth;
-
-    void (*pUnpack_idx)(
-        Int16  quant_spec[],
-        Int  codeword_indx,
-        const Hcb *pHuffCodebook,
-        BITS  *pInputStream,
-        Int *max);
-
-    Int(*pDec_huff_tab)(BITS *) = NULL;
-
-    UInt32 temp;
-    Int    binaryDigits, QFormat;
-
-    /*----------------------------------------------------------------------------
-    ; Function body here
-    ----------------------------------------------------------------------------*/
-
-    sect_start = 0;
-    stop_idx   = 0;
-
-    /* pSfb: ptr to array that holds stop index of each sfb */
-    pSfbStart = pFrameInfo->frame_sfb_top;
-
-    if (pSfbStart == NULL)
-    {
-        return (-1);   /*  error condition */
-    }
-
-    pSfb      = pSfbStart;
-
-    /* decoding spectral values section by section */
-    for (i = nsect; i > 0; i--)
-    {
-        /* read the codebook and section length */
-        sect_cb  =  pSectInfo->sect_cb;     /* codebook */
-        if ((sect_cb > 15) || (sect_cb < 0))
-        {
-            return (-1);   /*  error condition */
-        }
-        sect_end =  pSectInfo->sect_end;    /* # of sfbs */
-
-        if (sect_end < 0)
-        {
-            return (-1);   /*  error condition */
-        }
-
-        pSectInfo++;
-
-        /*  sect_cb       sect_cb - 1
-         *  ZERO_HCB        1111b
-         *    1             0000b
-         *    2             0001b
-         *    3             0010b
-         *    4             0011b
-         *    5             0100b
-         *    6             0101b
-         *    7             0110b
-         *    8             0111b
-         *    9             1000b
-         *    10            1001b
-         *    11            1010b
-         *    12            1011b
-         * NOISE_HCB        1100b
-         * INTENSITY_HCB2   1101b
-         * INTENSITY_HCB    1110b
-         * if ( ((sect_cb - 1) & 0xC) == 0xC ) is identical to
-         * if !((sect_cb == ZERO_HCB) || (sect_cb == NOISE_HCB) ||
-         *      (sec_cb == INTENSITY_HCB) || (sect_cb==INTENSITY_HCB2) )
-         * use this compare scheme to speed up the execution
-         */
-
-        if (((sect_cb - 1) & 0xC) != 0xC)
-        {
-            /* decode spec in one section */
-            if (sect_cb > BY4BOOKS)
-            {
-                dim = DIMENSION_2; /* set codebook dimension */
-            }
-            else
-            {
-                dim = DIMENSION_4;
-            }
-
-            pHcb        = &hcbbook_binary[sect_cb];
-
-            if (sect_cb == ESCBOOK)
-            {
-                pUnpack_idx = &unpack_idx_esc;
-            }
-            else if (pHcb->signed_cb == FALSE)
-            {
-                pUnpack_idx = &unpack_idx_sgn;
-            }
-            else
-            {
-                pUnpack_idx = &unpack_idx;
-            }
-
-
-            switch (sect_cb)
-            {
-                case 1:
-                    pDec_huff_tab = decode_huff_cw_tab1;
-                    break;
-                case 2:
-                    pDec_huff_tab = decode_huff_cw_tab2;
-                    break;
-                case 3:
-                    pDec_huff_tab = decode_huff_cw_tab3;
-                    break;
-                case 4:
-                    pDec_huff_tab = decode_huff_cw_tab4;
-                    break;
-                case 5:
-                    pDec_huff_tab = decode_huff_cw_tab5;
-                    break;
-                case 6:
-                    pDec_huff_tab = decode_huff_cw_tab6;
-                    break;
-                case 7:
-                    pDec_huff_tab = decode_huff_cw_tab7;
-                    break;
-                case 8:
-                    pDec_huff_tab = decode_huff_cw_tab8;
-                    break;
-                case 9:
-                    pDec_huff_tab = decode_huff_cw_tab9;
-                    break;
-                case 10:
-                    pDec_huff_tab = decode_huff_cw_tab10;
-                    break;
-                case 11:
-                    pDec_huff_tab = decode_huff_cw_tab11;
-                    break;
-                default:
-                    return (-1); /* error condition */
-            }
-
-            /* move ptr to first sfb of current section */
-            pQuantSpec  = quantSpec + stop_idx;
-
-            /* step through all sfbs in current section */
-            for (sfb = sect_start; sfb < sect_end; sfb++)
-            {
-                idx_count = *pSfb - stop_idx;
-                stop_idx  = *pSfb++;
-
-                /* decode all coefs for one sfb */
-                while ((idx_count > 0) && (idx_count < 1024))
-                {
-
-                    idx = (*pDec_huff_tab)(pInputStream);
-
-                    (*pUnpack_idx)(pQuantSpec,
-                                   idx,
-                                   pHcb,
-                                   pInputStream,
-                                   &max);      /* unpack idx -> coefs */
-
-                    pQuantSpec += dim;
-                    idx_count  -= dim;
-
-                } /* while(idx_count) */
-
-            } /* for (sfb=sect_start) */
-        }
-        else
-        {
-
-            /* current section uses ZERO_HCB, NOISE_HCB, etc */
-
-            /* move sfb pointer to the start sfb of next section */
-            pSfb        = pSfbStart + sect_end;
-            /* number of coefs in current section */
-            idx_count   = *(pSfb - 1) - stop_idx;
-
-            if ((idx_count > 1024) || (idx_count < 0))
-            {
-                return (-1);   /*  error condition */
-            }
-
-            /*
-             * This memset is necessary in terms of (1) net savings in total
-             * MIPS and (2) accurate Q-Formats for fft_rx2
-             * In case a scalefactor band uses ZERO_HCB, all coefficients of
-             * that sfb should be zeros. Without this call to memset, the
-             * coefficients for a ZERO_HCB sfb are the "leftovers" of the
-             * previous frame, which may not have all zero values. This leads
-             * to a drastical increase in the cycles consumed by esc_iquant_fxp
-             * and fft_rx2, which is the most "expensive" function of the
-             * library.
-             * This memset also guarantees the Q_Format for sfbs with all zero
-             * coefficients will be set properly.
-             * Profiling data on ARM and TMS320C55x proves that there is a net
-             * gain in total MIPS if a memset is called here.
-             */
-            pv_memset(&quantSpec[stop_idx],
-                      0,
-                      idx_count * sizeof(quantSpec[0]));
-
-            /*
-             * This memset is called because pQuantSpec points to tmp_spec
-             * after deinterleaving
-             */
-
-            pv_memset(&tmp_spec[stop_idx],
-                      0,
-                      idx_count * sizeof(tmp_spec[0]));
-
-
-            /* stop_idx is the index of the 1st coef of next section */
-            stop_idx    = *(pSfb - 1);
-
-        }/* if (sect_cb) */
-
-        sect_start = sect_end;
-
-    } /* for (i=nsect) */
-
-    /* noisless coding reconstruction */
-    if (pFrameInfo->islong != FALSE)
-    {
-        if (pPulseInfo->pulse_data_present == 1)
-        {
-            pulse_nc(quantSpec,
-                     pPulseInfo,
-                     pLongFrameInfo,
-                     &max);    /* add pulse data */
-        }
-
-        pQuantSpec = quantSpec;
-
-    }
-    else
-    {
-        deinterleave(quantSpec,
-                     tmp_spec,
-                     pFrameInfo);
-
-        pQuantSpec = tmp_spec;
-    }
-
-
-    /* inverse quantization, Q_format: Int32 */
-    /* rescaling */
-
-    /* what we can do here is assuming that we already know maxInput for each band, we have to go
-    though each one of them for re-quant and scaling, and pick the right qFormat to apply to
-    all spectral coeffs.*/
-
-    if ((max < 0) || (max > 8192))    /* (8192>>ORDER) == 1024 is the inverseQuantTable size */
-    {
-        return (-1);   /*  error condition */
-    }
-    else
-    {
-        /* Get  (max/SPACING) ^ (1/3), in Q Format  */
-        temp = inverseQuantTable[(max >> ORDER) + 1];
-    }
-
-
-    /* Round up before shifting down to Q0 */
-    temp += ROUND_UP;
-
-    /* shift down to Q0 and multiply by 2 (FACTOR) in one step */
-    temp >>= (QTABLE - 1);
-
-    /* Now get max ^ (4/3) in Q0 */
-    temp *= max;
-
-
-    binaryDigits = 31 - pv_normalize(temp);
-
-
-    /* Prevent negative shifts caused by low maximums. */
-    if (binaryDigits < (SIGNED32BITS - QTABLE))
-    {
-        binaryDigits = SIGNED32BITS - QTABLE;
-    }
-
-    QFormat = SIGNED32BITS - binaryDigits;
-
-    /********************/
-    tot_sfb = 0;
-    nsfb = pFrameInfo->sfb_per_win[0];
-    pCoef = coef;
-
-    for (i = pFrameInfo->num_win; i > 0; i--)
-    {
-        stop_idx  = 0;
-
-        for (sfb = 0; sfb < nsfb; sfb++)
-        {
-            sfbWidth   =  pFrameInfo->win_sfb_top[0][sfb] - stop_idx;
-
-            if ((sfbWidth < 0) || (sfbWidth > 1024))
-            {
-                return (-1);   /*  error condition */
-            }
-
-            stop_idx  += sfbWidth;
-
-            fac   = factors[tot_sfb] - SF_OFFSET;
-            scale = exptable[fac & 0x3];
-
-            power_scale_div_4 = fac >> 2;
-
-            power_scale_div_4++;
-
-            qFormat[tot_sfb] = QFormat;
-
-            esc_iquant_scaling(pQuantSpec,
-                               pCoef,
-                               sfbWidth,
-                               QFormat,
-                               scale,
-                               max);
-
-            pQuantSpec += sfbWidth;
-            qFormat[tot_sfb] -= power_scale_div_4;
-            pCoef += sfbWidth;
-
-            tot_sfb++;
-
-        } /* for (sfb) */
-    } /* for (i) */
-
-
-    /*----------------------------------------------------------------------------
-    ; Return status
-    ----------------------------------------------------------------------------*/
-    return SUCCESS;
-
-} /* huffspec_fxp */
diff --git a/media/libstagefright/codecs/aacdec/ibstream.h b/media/libstagefright/codecs/aacdec/ibstream.h
deleted file mode 100644
index 8b644dc..0000000
--- a/media/libstagefright/codecs/aacdec/ibstream.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ibstream.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Change names of constants.
-
- Description: Change the buffer from UInt to UInt32
-
- Description: Remove declaration of getbits and include header file
-
- Description: Change input buffer to UChar
-              Add constant
-
- Who:                                              Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Contains defines, structures, and function definitions for the
- input bit stream used in the AAC Decoder.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef IBSTREAM_H
-#define IBSTREAM_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_bits.h"
-#include    "getbits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-#define INBUF_ARRAY_INDEX_SHIFT  (3)
-#define INBUF_BIT_WIDTH         (1<<(INBUF_ARRAY_INDEX_SHIFT))
-#define INBUF_BIT_MODULO_MASK   ((INBUF_BIT_WIDTH)-1)
-
-#define MAX_GETBITS             (25)
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void byte_align(
-        BITS  *pInputStream);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif /* IBSTREAM_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/idct16.cpp b/media/libstagefright/codecs/aacdec/idct16.cpp
deleted file mode 100644
index 324fe9e..0000000
--- a/media/libstagefright/codecs/aacdec/idct16.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: idct16.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 16
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement inverse discrete cosine transform of lenght 16
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "idct16.h"
-#include "idct8.h"
-
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-#define R_SHIFT     28
-#define Qfmt(x)     (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-#define Qfmt31(x)   (Int32)(x*(0x7FFFFFFF) + (x>=0?0.5F:-0.5F))
-
-const Int32 CosTable_8i[8] =
-{
-    Qfmt31(0.50241928618816F),   Qfmt31(0.52249861493969F),
-    Qfmt31(0.56694403481636F),   Qfmt31(0.64682178335999F),
-    Qfmt(0.78815462345125F),   Qfmt(1.06067768599035F),
-    Qfmt(1.72244709823833F),   Qfmt(5.10114861868916F)
-};
-
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void idct_16(Int32 vec[], Int32 scratch_mem[])    /* scratch_mem size 8 */
-{
-    Int32 *temp_even = scratch_mem;
-
-    Int32 i;
-    const Int32 *pt_cos = CosTable_8i;
-    Int32 tmp1, tmp2;
-    Int32 *pt_even = temp_even;
-    Int32 *pt_odd  = vec;
-    Int32 *pt_vec  = vec;
-
-    Int32 tmp3;
-    Int32 *pt_vecN_1;
-
-
-    *(pt_even++) = *(pt_vec++);
-    tmp1         = *(pt_vec++);
-    *(pt_odd++) = tmp1;
-
-    for (i = 2; i != 0; i--)
-    {
-        *(pt_even++) = *(pt_vec++);
-        tmp2         = *(pt_vec++);
-        *(pt_even++) = *(pt_vec++);
-        tmp3         = *(pt_vec++);
-        *(pt_odd++) = tmp2 + tmp1;
-        *(pt_odd++) = tmp3 + tmp2;
-        tmp1         = tmp3;
-    }
-
-    *(pt_even++) = *(pt_vec++);
-    tmp2         = *(pt_vec++);
-    *(pt_even++) = *(pt_vec++);
-    tmp3         = *(pt_vec++);
-    *(pt_odd++) = tmp2 + tmp1;
-    *(pt_odd++) = tmp3 + tmp2;
-
-
-    *(pt_even)   = *(pt_vec++);
-    *(pt_odd++) = *(pt_vec) + tmp3;
-
-
-    idct_8(temp_even);
-    idct_8(vec);
-
-
-    pt_cos = &CosTable_8i[7];
-
-    pt_vec  = &vec[7];
-
-    pt_even = &temp_even[7];
-    pt_vecN_1  = &vec[8];
-
-    tmp1 = *(pt_even--);
-
-    for (i = 2; i != 0; i--)
-    {
-        tmp3  = fxp_mul32_Q28(*(pt_vec), *(pt_cos--));
-        tmp2 = *(pt_even--);
-        *(pt_vecN_1++)  = tmp1 - tmp3;
-        *(pt_vec--)     = tmp1 + tmp3;
-        tmp3  = fxp_mul32_Q28(*(pt_vec), *(pt_cos--));
-        tmp1 = *(pt_even--);
-        *(pt_vecN_1++)  = tmp2 - tmp3;
-        *(pt_vec--)     = tmp2 + tmp3;
-    }
-
-    tmp3  = fxp_mul32_Q31(*(pt_vec), *(pt_cos--)) << 1;
-    tmp2 = *(pt_even--);
-    *(pt_vecN_1++)  = tmp1 - tmp3;
-    *(pt_vec--)     = tmp1 + tmp3;
-    tmp3  = fxp_mul32_Q31(*(pt_vec), *(pt_cos--)) << 1;
-    tmp1 = *(pt_even--);
-    *(pt_vecN_1++)  = tmp2 - tmp3;
-    *(pt_vec--)     = tmp2 + tmp3;
-    tmp3  = fxp_mul32_Q31(*(pt_vec), *(pt_cos--)) << 1;
-    tmp2 = *(pt_even--);
-    *(pt_vecN_1++)  = tmp1 - tmp3;
-    *(pt_vec--)     = tmp1 + tmp3;
-    tmp3  = fxp_mul32_Q31(*(pt_vec), *(pt_cos)) << 1;
-    *(pt_vecN_1)  = tmp2 - tmp3;
-    *(pt_vec)     = tmp2 + tmp3;
-
-}
-
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/idct16.h b/media/libstagefright/codecs/aacdec/idct16.h
deleted file mode 100644
index afade07..0000000
--- a/media/libstagefright/codecs/aacdec/idct16.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Pathname: idct16.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef IDCT16_H
-#define IDCT16_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    void idct_16(Int32 vec[], Int32 scratch_mem[]);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* IDCT16_H */
diff --git a/media/libstagefright/codecs/aacdec/idct32.cpp b/media/libstagefright/codecs/aacdec/idct32.cpp
deleted file mode 100644
index ac9773b..0000000
--- a/media/libstagefright/codecs/aacdec/idct32.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Filename: idct32.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 32
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement inverse discrete cosine transform of lenght 32
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#include "idct32.h"
-#include "dst32.h"
-#include "idct16.h"
-
-#include "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-
-#define R_SHIFT1     29
-#define Qfmt1(x)   (Int32)(x*((Int32)1<<R_SHIFT1) + (x>=0?0.5F:-0.5F))
-
-#define Qfmt3(a)   (Int32)(a*0x7FFFFFFF + (a>=0?0.5F:-0.5F))
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void idct_32(Int32 vec[], Int32 scratch_mem[])   /* scratch_mem size 32 */
-{
-    Int32 *temp_even = scratch_mem;
-
-    Int32 i;
-    const Int32 *pt_cos = CosTable_16;
-    Int32 tmp1, tmp2;
-    Int32 *pt_even = temp_even;
-    Int32 *pt_odd  = vec;
-    Int32 *pt_vec  = vec;
-    Int32 *pt_vecN_1;
-    Int32 tmp3;
-
-
-    *(pt_even++) = *(pt_vec++);
-    tmp1         = *(pt_vec++);
-    tmp2 = 0;
-
-    for (i = 7; i != 0; i--)
-    {
-        *(pt_odd++) = tmp2 + tmp1;
-        *(pt_even++) = *(pt_vec++);
-        tmp2         = *(pt_vec++);
-        *(pt_even++) = *(pt_vec++);
-        *(pt_odd++) = tmp2 + tmp1;
-        tmp1         = *(pt_vec++);
-    }
-
-    *(pt_odd++) = tmp2 + tmp1;
-    *(pt_even++) = *(pt_vec++);
-    tmp2         = *(pt_vec++);
-    *(pt_odd++) = tmp2 + tmp1;
-
-
-    idct_16(temp_even, &scratch_mem[16]);
-    idct_16(vec, &scratch_mem[24]);
-
-
-    pt_cos = &CosTable_16[13];
-
-    pt_vec  = &vec[15];
-
-    pt_even = &temp_even[15];
-    pt_vecN_1  = &vec[16];
-
-    tmp1 = *(pt_even--);
-
-
-    tmp3  = fxp_mul32_Q31(*(pt_vec) << 3, Qfmt3(0.63687550772175F)) << 2;
-    tmp2 = *(pt_even--);
-    *(pt_vecN_1++)  = tmp1 - tmp3;
-    *(pt_vec--)     = tmp1 + tmp3;
-    tmp3  = fxp_mul32_Q31(*(pt_vec) << 3, Qfmt3(0.85190210461718F));
-
-    tmp1 = *(pt_even--);
-    *(pt_vecN_1++)  = tmp2 - tmp3;
-    *(pt_vec--)     = tmp2 + tmp3;
-
-    for (i = 2; i != 0; i--)
-    {
-        tmp3  = fxp_mul32_Q29(*(pt_vec), *(pt_cos--));
-        tmp2 = *(pt_even--);
-        *(pt_vecN_1++)  = tmp1 - tmp3;
-        *(pt_vec--)     = tmp1 + tmp3;
-        tmp3  = fxp_mul32_Q29(*(pt_vec), *(pt_cos--));
-        tmp1 = *(pt_even--);
-        *(pt_vecN_1++)  = tmp2 - tmp3;
-        *(pt_vec--)     = tmp2 + tmp3;
-    }
-
-    for (i = 5; i != 0; i--)
-    {
-        tmp3  = fxp_mul32_Q31(*(pt_vec) << 1, *(pt_cos--));
-        tmp2 = *(pt_even--);
-        *(pt_vecN_1++)  = tmp1 - tmp3;
-        *(pt_vec--)     = tmp1 + tmp3;
-        tmp3  = fxp_mul32_Q31(*(pt_vec) << 1, *(pt_cos--));
-        tmp1 = *(pt_even--);
-        *(pt_vecN_1++)  = tmp2 - tmp3;
-        *(pt_vec--)     = tmp2 + tmp3;
-    }
-}
-
-
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/idct32.h b/media/libstagefright/codecs/aacdec/idct32.h
deleted file mode 100644
index 12c685a..0000000
--- a/media/libstagefright/codecs/aacdec/idct32.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: idct32.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef IDCT32_H
-#define IDCT32_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    void idct_32(Int32 vec[], Int32 scratch_mem[]);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* IDCT32_H */
diff --git a/media/libstagefright/codecs/aacdec/idct8.cpp b/media/libstagefright/codecs/aacdec/idct8.cpp
deleted file mode 100644
index 8f040ce..0000000
--- a/media/libstagefright/codecs/aacdec/idct8.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: idct8.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 8
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement inverse discrete cosine transform of lenght 8
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-#ifdef AAC_PLUS
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "idct8.h"
-
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-#define R_SHIFT     29
-#define Qfmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-#define Qfmt15(x)   (Int16)(x*((Int32)1<<15) + (x>=0?0.5F:-0.5F))
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void idct_8(Int32 vec[])
-{
-
-    Int32 tmp0;
-    Int32 tmp1;
-    Int32 tmp2;
-    Int32 tmp3;
-    Int32 tmp4;
-    Int32 tmp5;
-    Int32 tmp6;
-    Int32 tmp7;
-    Int32 tmp8;
-
-
-    tmp5 = fxp_mul32_by_16(vec[4] << 1, Qfmt15(0.70710678118655F));
-
-    tmp1 =  vec[0] + tmp5;
-    tmp5 =  vec[0] - tmp5;
-
-    tmp3 = fxp_mul32_by_16(vec[2] << 1, Qfmt15(0.54119610014620F));     /* (1/(2*cos(2*phi)));*/
-    tmp7 = fxp_mul32_Q29(vec[6], Qfmt(1.30656296487638F));      /* (1/(2*cos(6*phi)));*/
-
-    tmp0  = fxp_mul32_by_16((tmp3 - tmp7) << 1, Qfmt15(0.70710678118655F)); /* (1/(2*cos(2*phi)));  */
-    tmp7 = (tmp3 + tmp7) + tmp0;
-
-    vec[0] = tmp1 + tmp7;
-    tmp2 = fxp_mul32_by_16(vec[1] << 1, Qfmt15(0.50979557910416F));     /* (1/(2*cos(  phi)));*/
-    vec[1] = tmp5 + tmp0;
-    vec[2] = tmp5 - tmp0;
-    tmp4 = fxp_mul32_by_16(vec[3] << 1, Qfmt15(0.60134488693505F));     /* (1/(2*cos(3*phi)));*/
-    vec[3] = tmp1 - tmp7;
-
-    tmp6 = fxp_mul32_by_16(vec[5] << 1, Qfmt15(0.89997622313642F));     /* (1/(2*cos(5*phi)));*/
-    tmp8 = fxp_mul32_Q29(vec[7], Qfmt(2.56291544774151F));      /* (1/(2*cos(7*phi)));*/
-
-    tmp7  =  tmp2 + tmp8;
-    tmp5  = fxp_mul32_by_16((tmp2 - tmp8) << 1, Qfmt15(0.54119610014620F));
-    tmp8  =  tmp4 + tmp6;
-    tmp6  = fxp_mul32_Q29((tmp4 - tmp6), Qfmt(1.30656296487638F));
-
-    tmp0 =  tmp7 + tmp8;
-    tmp2 = fxp_mul32_by_16((tmp7 - tmp8) << 1, Qfmt15(0.70710678118655F));
-
-    tmp3 = fxp_mul32_by_16((tmp5 - tmp6) << 1, Qfmt15(0.70710678118655F));
-    tmp1 = (tmp5 + tmp6) + tmp3;
-
-    tmp5 = tmp0 + tmp1;
-    tmp6 = tmp1 + tmp2;
-    tmp7 = tmp2 + tmp3;
-
-    vec[7]  = vec[0] - tmp5;
-    vec[0] +=          tmp5;
-    vec[6]  = vec[1] - tmp6;
-    vec[1] +=          tmp6;
-    vec[5]  = vec[2] - tmp7;
-    vec[2] +=          tmp7;
-    vec[4]  = vec[3] - tmp3;
-    vec[3] +=          tmp3;
-
-}
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/idct8.h b/media/libstagefright/codecs/aacdec/idct8.h
deleted file mode 100644
index ad7eaae..0000000
--- a/media/libstagefright/codecs/aacdec/idct8.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: idct8.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef IDCT8_H
-#define IDCT8_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    void idct_8(Int32 vec[]);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* IDCT8_H */
diff --git a/media/libstagefright/codecs/aacdec/imdct_fxp.cpp b/media/libstagefright/codecs/aacdec/imdct_fxp.cpp
deleted file mode 100644
index ad67f20..0000000
--- a/media/libstagefright/codecs/aacdec/imdct_fxp.cpp
+++ /dev/null
@@ -1,476 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: imdct_fxp.c
- Funtions: imdct_fxp
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    data_quant    = Input vector, with quantized spectral lines:
-                    type Int32
-
-    freq_2_time_buffer =  Scratch memory used for in-place FFT calculation,
-                    min size required 1024,
-                    type Int32
-
-    n            =  Length of input vector "data_quant". Currently 256 or 2048
-                    type const Int
-
-    Q_format     =  Q_format of the input vector "data_quant"
-                    type Int
-
-    max          =  Maximum value inside input vector "data_quant"
-                    type Int32
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    shift = shift factor to reflect scaling introduced by IFFT and imdct_fxp,
-
- Pointers and Buffers Modified:
-    Results are return in "Data_Int_precision"
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    The IMDCT is a linear orthogonal lapped transform, based on the idea of
-    time domain aliasing cancellation (TDAC).
-    IMDCT is critically sampled, which means that though it is 50% overlapped,
-    a sequence data after IMDCT has the same number of coefficients as samples
-    before the transform (after overlap-and-add). This means, that a single
-    block of IMDCT data does not correspond to the original block on which the
-    IMDCT was performed. When subsequent blocks of inverse transformed data
-    are added (still using 50% overlap), the errors introduced by the
-    transform cancels out.Thanks to the overlapping feature, the IMDCT is very
-    useful for quantization. It effectively removes the otherwise easily
-    detectable blocking artifact between transform blocks.
-
-    N = twice the length of input vector X
-    y = vector of length N, will hold fixed point IDCT
-    p = 0:1:N-1
-
-                    2   N/2-1
-            y(p) = ---   SUM   X(m)*cos(pi/(2*N)*(2*p+1+N/2)*(2*m+1))
-                    N    m=0
-
-    The window that completes the TDAC is applied before calling this function.
-    The IMDCT can be calculated using an IFFT, for this, the IMDCT need be
-    rewritten as an odd-time odd-frequency discrete Fourier transform. Thus,
-    the IMDCT can be calculated using only one n/4 point FFT and some pre and
-    post-rotation of the sample points.
-
-
-    where X(k) is the input with N frequency lines
-
-    X(k) ----------------------------
-                                     |
-                                     |
-                    Pre-rotation by exp(j(2pi/N)(k+1/8))
-                                     |
-                                     |
-                              N/4- point IFFT
-                                     |
-                                     |
-                    Post-rotation by exp(j(2pi/N)(n+1/8))
-                                     |
-                                     |
-                                      ------------- x(n)  In the time domain
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This function should provide a fixed point IMDCT with an average
-    quantization error less than 1 % (variance and mean).
-
-------------------------------------------------------------------------------
- REFERENCES
-
-    [1] Analysis/Synthesis Filter Bank design based on time domain
-        aliasing cancellation
-        Jhon Princen, et. al.
-        IEEE Transactions on ASSP, vol ASSP-34, No. 5 October 1986
-        Pg 1153 - 1161
-
-    [2] Regular FFT-related transform kernels for DCT/DST based
-        polyphase filterbanks
-        Rolf Gluth
-        Proc. ICASSP 1991, pg. 2205 - 2208
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-  Cx, Cy are complex number
-
-
-    exp = log2(n)-1
-
-    FOR ( k=0; k< n/2; k +=2)
-
-        Cx = - data_quant[k] + j data_quant[n/2-1 - k]
-
-        freq_2_time_buffer = Cx * exp(j(2pi/n)(k+1/8))
-
-    ENDFOR
-
-    CALL IFFT( freq_2_time_buffer, n/4)
-
-    MODIFYING( freq_2_time_buffer )
-
-    RETURNING( shift )
-
-    FOR ( k=0; k< n/4; k +=2)
-
-        Cx = freq_2_time_buffer[ k] + j freq_2_time_buffer[ k+1]
-
-        Cy = Cx * exp(j(2pi/n)(k+1/8))
-
-        data_quant[3n/4-1 - k ] =   Real(Cy)
-        data_quant[ n/4-1 - k ] = - Imag(Cy)
-        data_quant[3n/4   + k ] =   Real(Cy)
-        data_quant[ n/4   + k ] =   Imag(Cy)
-
-    ENDFOR
-
-    FOR ( k=n/4; k< n/2; k +=2)
-
-        Cx = freq_2_time_buffer[ k] + j freq_2_time_buffer[ k+1]
-
-        Cy = Cx * exp(j(2pi/n)(k+1/8))
-
-        data_quant[3n/4-1 - k ] =   Real(Cy)
-        data_quant[ n/4   + k ] = - Real(Cy)
-        data_quant[5n/4   - k ] =   Imag(Cy)
-        data_quant[ n/4   + k ] =   Imag(Cy)
-
-    ENDFOR
-
-    MODIFIED    data_quant[]
-
-    RETURN      (exp - shift)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "imdct_fxp.h"
-
-
-#include "mix_radix_fft.h"
-#include "digit_reversal_tables.h"
-#include "fft_rx4.h"
-#include "inv_short_complex_rot.h"
-#include "inv_long_complex_rot.h"
-#include "pv_normalize.h"
-#include "fxp_mul32.h"
-#include "aac_mem_funcs.h"
-
-#include "window_block_fxp.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define ERROR_IN_FRAME_SIZE 10
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-Int imdct_fxp(Int32   data_quant[],
-              Int32   freq_2_time_buffer[],
-              const   Int     n,
-              Int     Q_format,
-              Int32   max)
-{
-
-    Int32     exp_jw;
-    Int     shift = 0;
-
-    const   Int32 *p_rotate;
-    const   Int32 *p_rotate_2;
-
-    Int32   *p_data_1;
-    Int32   *p_data_2;
-
-    Int32   temp_re32;
-    Int32   temp_im32;
-
-    Int     shift1 = 0;
-    Int32   temp1;
-    Int32   temp2;
-
-    Int     k;
-    Int     n_2   = n >> 1;
-    Int     n_4   = n >> 2;
-
-
-
-    if (max != 0)
-    {
-
-        switch (n)
-        {
-            case SHORT_WINDOW_TYPE:
-                p_rotate = exp_rotation_N_256;
-                shift = 21;           /* log2(n)-1 + 14 acomodates 2/N factor */
-                break;
-
-            case LONG_WINDOW_TYPE:
-                p_rotate = exp_rotation_N_2048;
-                shift = 24;           /* log2(n)-1 +14 acomodates 2/N factor */
-                break;
-
-            default:
-                /*
-                 * There is no defined behavior for a non supported frame
-                 * size. By returning a fixed scaling factor, the input will
-                 * scaled down and the will be heard as a low level noise
-                 */
-                return(ERROR_IN_FRAME_SIZE);
-
-        }
-
-        /*
-         *   p_data_1                                        p_data_2
-         *       |                                            |
-         *       RIRIRIRIRIRIRIRIRIRIRIRIRIRIRI....RIRIRIRIRIRI
-         *        |                                          |
-         *
-         */
-
-        p_data_1 =  data_quant;             /* uses first  half of buffer */
-        p_data_2 = &data_quant[n_2 - 1];    /* uses second half of buffer */
-
-        p_rotate_2 = &p_rotate[n_4-1];
-
-        shift1 = pv_normalize(max) - 1;     /* -1 to leave room for addition */
-        Q_format -= (16 - shift1);
-        max = 0;
-
-
-        if (shift1 >= 0)
-        {
-            temp_re32 =   *(p_data_1++) << shift1;
-            temp_im32 =   *(p_data_2--) << shift1;
-
-            for (k = n_4 >> 1; k != 0; k--)
-            {
-                /*
-                 *  Real and Imag parts have been swaped to use FFT as IFFT
-                 */
-                /*
-                 * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-                 */
-                exp_jw = *p_rotate++;
-
-                temp1      =  cmplx_mul32_by_16(temp_im32, -temp_re32, exp_jw);
-                temp2      = -cmplx_mul32_by_16(temp_re32,  temp_im32, exp_jw);
-
-                temp_im32 =   *(p_data_1--) << shift1;
-                temp_re32 =   *(p_data_2--) << shift1;
-                *(p_data_1++) = temp1;
-                *(p_data_1++) = temp2;
-                max         |= (temp1 >> 31) ^ temp1;
-                max         |= (temp2 >> 31) ^ temp2;
-
-
-                /*
-                 *  Real and Imag parts have been swaped to use FFT as IFFT
-                 */
-
-                /*
-                 * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-                 */
-
-                exp_jw = *p_rotate_2--;
-
-                temp1      =  cmplx_mul32_by_16(temp_im32, -temp_re32, exp_jw);
-                temp2      = -cmplx_mul32_by_16(temp_re32,  temp_im32, exp_jw);
-
-
-                temp_re32 =   *(p_data_1++) << shift1;
-                temp_im32 =   *(p_data_2--) << shift1;
-
-                *(p_data_2 + 2) = temp1;
-                *(p_data_2 + 3) = temp2;
-                max         |= (temp1 >> 31) ^ temp1;
-                max         |= (temp2 >> 31) ^ temp2;
-
-            }
-        }
-        else
-        {
-            temp_re32 =   *(p_data_1++) >> 1;
-            temp_im32 =   *(p_data_2--) >> 1;
-
-            for (k = n_4 >> 1; k != 0; k--)
-            {
-                /*
-                 *  Real and Imag parts have been swaped to use FFT as IFFT
-                 */
-                /*
-                 * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-                 */
-                exp_jw = *p_rotate++;
-
-                temp1      =  cmplx_mul32_by_16(temp_im32, -temp_re32, exp_jw);
-                temp2      = -cmplx_mul32_by_16(temp_re32,  temp_im32, exp_jw);
-
-                temp_im32 =   *(p_data_1--) >> 1;
-                temp_re32 =   *(p_data_2--) >> 1;
-                *(p_data_1++) = temp1;
-                *(p_data_1++) = temp2;
-
-                max         |= (temp1 >> 31) ^ temp1;
-                max         |= (temp2 >> 31) ^ temp2;
-
-
-                /*
-                 *  Real and Imag parts have been swaped to use FFT as IFFT
-                 */
-
-                /*
-                 * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-                 */
-                exp_jw = *p_rotate_2--;
-
-                temp1      =  cmplx_mul32_by_16(temp_im32, -temp_re32, exp_jw);
-                temp2      = -cmplx_mul32_by_16(temp_re32,  temp_im32, exp_jw);
-
-                temp_re32 =   *(p_data_1++) >> 1;
-                temp_im32 =   *(p_data_2--) >> 1;
-
-                *(p_data_2 + 3) = temp2;
-                *(p_data_2 + 2) = temp1;
-
-                max         |= (temp1 >> 31) ^ temp1;
-                max         |= (temp2 >> 31) ^ temp2;
-
-            }
-        }
-
-
-        if (n != SHORT_WINDOW_TYPE)
-        {
-
-            shift -= mix_radix_fft(data_quant,
-                                   &max);
-
-            shift -= inv_long_complex_rot(data_quant,
-                                          max);
-
-        }
-        else        /*  n_4 is 64 */
-        {
-
-            shift -= fft_rx4_short(data_quant,   &max);
-
-
-            shift -= inv_short_complex_rot(data_quant,
-                                           freq_2_time_buffer,
-                                           max);
-
-            pv_memcpy(data_quant,
-                      freq_2_time_buffer,
-                      SHORT_WINDOW*sizeof(*data_quant));
-        }
-
-    }
-    else
-    {
-        Q_format = ALL_ZEROS_BUFFER;
-    }
-
-    return(shift + Q_format);
-
-} /* imdct_fxp */
diff --git a/media/libstagefright/codecs/aacdec/imdct_fxp.h b/media/libstagefright/codecs/aacdec/imdct_fxp.h
deleted file mode 100644
index 5837750..0000000
--- a/media/libstagefright/codecs/aacdec/imdct_fxp.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: imdct_fxp.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: This extern had the incorrect length of the arrays.  The true
- lengths are 128 and 1024, not 64 and 512.
-
- Description:  Modified interface so a vector with extended precision is
-               returned, this is a 32 bit vector whose MSB 16 bits will be
-               extracted later.  Added copyright notice.
-
- Description:   Modified function interface to accomodate the normalization
-                that now is done in this function.
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function imdct_fxp()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef IMDCT_FXP_H
-#define IMDCT_FXP_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-#define     LONG_WINDOW_TYPE  2048
-#define     SHORT_WINDOW_TYPE  256
-
-#define     ALL_ZEROS_BUFFER       31
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    extern const Int32 exp_rotation_N_256[64];
-    extern const Int32 exp_rotation_N_2048[512];
-    /*
-    extern const Int exp_rotation_N_256[128];
-    extern const Int exp_rotation_N_2048[1024];
-    */
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-    Int imdct_fxp(
-        Int32   data_quant[],
-        Int32   freq_2_time_buffer[],
-        const   Int     n,
-        Int     Q_format,
-        Int32   max
-    );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* IMDCT_FXP_H */
diff --git a/media/libstagefright/codecs/aacdec/infoinit.cpp b/media/libstagefright/codecs/aacdec/infoinit.cpp
deleted file mode 100644
index 7bdcdcd..0000000
--- a/media/libstagefright/codecs/aacdec/infoinit.cpp
+++ /dev/null
@@ -1,355 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: infoinit.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  Pass eight_short_info and the array 'sfbwidth128'.
-               Change function arguments' names for clarity
-
- Description:  move sfb definitions to "sfb.h", and "sfb.c", eliminated
-               the function "huffbookinit.c"
-
- Description:  Remove initialization of the never used array,
-               pFrameInfo->group_offs
-
- Description:
- (1) Changed "stdinc.h" to <stdlib.h> - this avoids linking in the math
- library and stdio.h.  (All for just defining the NULL pointer macro)
-
- (2) Updated copyright header.
-
- Description: Updated the SW template to include the full pathname to the
- source file and a slightly modified copyright header.
-
- Description: Addresses of constant vectors are now found by means of a
-              switch statement, this solve linking problem when using the
-              /ropi option (Read-only position independent) for some
-              compilers
-
- Who:                               Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pSi              = pointer to sampling rate info
-    ppWin_seq_info   = pointer array to window sequence Info struct
-    pSfbwidth128     = pointer to sfb bandwidth array of short window
-
- Local Stores/Buffers/Pointers Needed:
-
- Global Stores/Buffers/Pointers Needed:
-
- Outputs:
-
- Pointers and Buffers Modified:
-
-    ppWin_seq_info[ONLY_LONG_WINDOW]{all structure members} = setup values
-    ppWin_seq_info[EIGHT_SHORT_WINDOW]{all structure members} = setup values
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function sets the values of 'Info' structure for blocks containing long
- and short window sequences, the following structures are being set:
-
- win_seq_info[ONLY_LONG_WINDOW], win_seq_info[EIGHT_SHORT_WINDOW],
- only_long_info and eight_short_info
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
- (2) ISO/IEC 14496-3: 1999(E)
-    Subpart 4       p66     (sfb tables)
-                    p111    (4.6.10)
-                    p200    (Annex 4.B.5)
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pFrameInfo  =   pointer to only_long_info;
-    win_seq_info[ONLY_LONG_WINDOW]  =   pFrameInfo;
-    pFrameInfo{all structure members} = setup values;
-
-
-    pFrameInfo  =   pointer to eight_short_info;
-    win_seq_info[EIGHT_SHORT_WINDOW]  =   pFrameInfo;
-    pFrameInfo{all structure.members} =   setup values;
-
-
-    FOR (window_seq = 0; window_seq < NUM_WIN_SEQ; win_seq++)
-
-        win_seq_info[window_seq].members = setup values;
-
-    ENDFOR
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE:
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES:
-
-------------------------------------------------------------------------------
-*/
-
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_sr_info.h"
-#include    "s_frameinfo.h"
-#include    "e_blockswitching.h"
-#include    "e_huffmanconst.h"
-#include    "sfb.h"
-#include    "huffman.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int infoinit(
-    const Int samp_rate_idx,
-    FrameInfo   **ppWin_seq_info,
-    Int    *pSfbwidth128)
-
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-
-    Int     i;
-    Int     sfb_idx, sfb_sbk;
-    Int     bins_sbk;
-    Int     win_seq;
-    Int     start_idx, end_idx;
-    Int     nsfb_short;
-    Int16   *sfbands;
-    FrameInfo    *pFrameInfo;
-
-    const SR_Info *pSi = &(samp_rate_info[samp_rate_idx]);
-
-    const Int16 * pt_SFbands1024 = NULL;
-    const Int16 * pt_SFbands128  = NULL;
-
-    /*----------------------------------------------------------------------------
-    ; Function body here
-    ----------------------------------------------------------------------------*/
-
-    switch (pSi->samp_rate)
-    {
-        case 96000:
-        case 88200:
-            pt_SFbands1024  = sfb_96_1024;
-            pt_SFbands128   = sfb_64_128;  /* equal to table sfb_96_128, (eliminated) */
-            break;
-        case 64000:
-            pt_SFbands1024  = sfb_64_1024;
-            pt_SFbands128   = sfb_64_128;
-            break;
-        case 48000:
-        case 44100:
-            pt_SFbands1024  = sfb_48_1024;
-            pt_SFbands128   = sfb_48_128;
-            break;
-        case 32000:
-            pt_SFbands1024  = sfb_32_1024;
-            pt_SFbands128   = sfb_48_128;
-            break;
-        case 24000:
-        case 22050:
-            pt_SFbands1024  = sfb_24_1024;
-            pt_SFbands128   = sfb_24_128;
-            break;
-        case 16000:
-        case 12000:
-        case 11025:
-            pt_SFbands1024  = sfb_16_1024;
-            pt_SFbands128   = sfb_16_128;
-            break;
-        case 8000:
-            pt_SFbands1024  = sfb_8_1024;
-            pt_SFbands128   = sfb_8_128;
-            break;
-        default:
-            // sampling rate not supported
-            return -1;
-    }
-
-    /* long block info */
-
-    pFrameInfo = ppWin_seq_info[ONLY_LONG_WINDOW];
-    pFrameInfo->islong               = 1;
-    pFrameInfo->num_win              = 1;
-    pFrameInfo->coef_per_frame       = LN2; /* = 1024 */
-
-    pFrameInfo->sfb_per_win[0]  = pSi->nsfb1024;
-    pFrameInfo->sectbits[0]     = LONG_SECT_BITS;
-    pFrameInfo->win_sfb_top[0]  = (Int16 *)pt_SFbands1024;
-
-    pFrameInfo->sfb_width_128 = NULL; /* no short block sfb */
-    pFrameInfo->num_groups    = 1; /* long block, one group */
-    pFrameInfo->group_len[0]  = 1; /* only one window */
-
-    /* short block info */
-    pFrameInfo = ppWin_seq_info[EIGHT_SHORT_WINDOW];
-    pFrameInfo->islong                  = 0;
-    pFrameInfo->num_win                 = NSHORT;
-    pFrameInfo->coef_per_frame          = LN2;
-
-    for (i = 0; i < pFrameInfo->num_win; i++)
-    {
-        pFrameInfo->sfb_per_win[i] = pSi->nsfb128;
-        pFrameInfo->sectbits[i]    = SHORT_SECT_BITS;
-        pFrameInfo->win_sfb_top[i] = (Int16 *)pt_SFbands128;
-    }
-
-    /* construct sfb width table */
-    pFrameInfo->sfb_width_128 = pSfbwidth128;
-    for (i = 0, start_idx = 0, nsfb_short = pSi->nsfb128; i < nsfb_short; i++)
-    {
-        end_idx = pt_SFbands128[i];
-        pSfbwidth128[i] = end_idx - start_idx;
-        start_idx = end_idx;
-    }
-
-
-    /* common to long and short */
-    for (win_seq = 0; win_seq < NUM_WIN_SEQ; win_seq++)
-    {
-
-        if (ppWin_seq_info[win_seq] != NULL)
-        {
-            pFrameInfo                 = ppWin_seq_info[win_seq];
-            pFrameInfo->sfb_per_frame  = 0;
-            sfb_sbk                    = 0;
-            bins_sbk                   = 0;
-
-            for (i = 0; i < pFrameInfo->num_win; i++)
-            {
-
-                /* compute coef_per_win */
-                pFrameInfo->coef_per_win[i] =
-                    pFrameInfo->coef_per_frame / pFrameInfo->num_win;
-
-                /* compute sfb_per_frame */
-                pFrameInfo->sfb_per_frame += pFrameInfo->sfb_per_win[i];
-
-                /* construct default (non-interleaved) bk_sfb_top[] */
-                sfbands = pFrameInfo->win_sfb_top[i];
-                for (sfb_idx = 0; sfb_idx < pFrameInfo->sfb_per_win[i];
-                        sfb_idx++)
-                {
-                    pFrameInfo->frame_sfb_top[sfb_idx+sfb_sbk] =
-                        sfbands[sfb_idx] + bins_sbk;
-                }
-
-                bins_sbk += pFrameInfo->coef_per_win[i];
-                sfb_sbk  += pFrameInfo->sfb_per_win[i];
-            } /* for i = sbk ends */
-        }
-
-    } /* for win_seq ends */
-
-    return SUCCESS;
-
-} /* infoinit */
diff --git a/media/libstagefright/codecs/aacdec/init_sbr_dec.cpp b/media/libstagefright/codecs/aacdec/init_sbr_dec.cpp
deleted file mode 100644
index fc47dd3..0000000
--- a/media/libstagefright/codecs/aacdec/init_sbr_dec.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: init_sbr_dec.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        initializes sbr decoder structure
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "init_sbr_dec.h"
-#include    "aac_mem_funcs.h"
-#include    "extractframeinfo.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int32 init_sbr_dec(Int32 codecSampleRate,
-                   Int   upsampleFac,
-                   SBR_DEC *sbrDec,
-                   SBR_FRAME_DATA *hFrameData)
-{
-    Int32 outFrameSize;
-    Int32 coreCodecFrameSize = 1024;
-#ifdef HQ_SBR
-    Int32 i;
-#endif
-
-
-    sbrDec->sbStopCodec    =  upsampleFac << 5;
-    sbrDec->prevLowSubband =  upsampleFac << 5;
-
-
-    /* set sbr sampling frequency */
-    sbrDec->outSampleRate = 2 * codecSampleRate;
-    outFrameSize = upsampleFac * coreCodecFrameSize;
-
-    hFrameData->nSfb[LO] = 0;    /* number of scale factor bands for high resp.low frequency resolution */
-    hFrameData->nSfb[HI] = 0;
-    hFrameData->offset   = 0;
-
-    hFrameData->nNfb = hFrameData->sbr_header.noNoiseBands;
-    hFrameData->prevEnvIsShort = -1;
-
-    /* Initializes pointers */
-#ifdef HQ_SBR
-    for (i = 0; i < 5; i++)
-    {
-        hFrameData->fBuf_man[i]  = hFrameData->fBuffer_man[i];
-        hFrameData->fBufN_man[i] = hFrameData->fBufferN_man[i];
-        hFrameData->fBuf_exp[i]  = hFrameData->fBuffer_exp[i];
-        hFrameData->fBufN_exp[i] = hFrameData->fBufferN_exp[i];
-    }
-#endif
-
-
-    pv_memset((void *)hFrameData->sbr_invf_mode_prev,
-              0,
-              MAX_NUM_NOISE_VALUES*sizeof(INVF_MODE));
-
-    /* Direct assignments */
-
-    sbrDec->noCols = 32;
-
-    sbrDec->bufWriteOffs = 6 + 2;
-    sbrDec->bufReadOffs  = 2;
-    sbrDec->qmfBufLen = sbrDec->noCols + sbrDec->bufWriteOffs;
-
-    sbrDec->lowBandAddSamples = 288;
-
-    sbrDec->startIndexCodecQmf = 0;
-
-    sbrDec->lowSubband =  32;
-
-
-    return outFrameSize;
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/init_sbr_dec.h b/media/libstagefright/codecs/aacdec/init_sbr_dec.h
deleted file mode 100644
index 844fa0e..0000000
--- a/media/libstagefright/codecs/aacdec/init_sbr_dec.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: init_sbr_dec.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef INIT_SBR_DEC_H
-#define INIT_SBR_DEC_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "sbr_dec.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-Int32 init_sbr_dec(Int32 codecSampleRate,
-                   Int  upsampleFac,
-                   SBR_DEC *sbrDec,
-                   SBR_FRAME_DATA *hFrameData);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/intensity_right.cpp b/media/libstagefright/codecs/aacdec/intensity_right.cpp
deleted file mode 100644
index 106298a..0000000
--- a/media/libstagefright/codecs/aacdec/intensity_right.cpp
+++ /dev/null
@@ -1,457 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: intensity_right.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modified per review comments.
-
- Description: Noticed that the code could be more efficient by
- using some other method for storing the sign.  The code was changed to
- use a signed Int to store the table, and an adjustment of the q-format to
- reflect the difference between the data being shifted by 16 and the table
- being stored in q-15 format.
-
- Description: Updated pseudocode
-
- Description: When the multiplication of two 16-bits variables is stored in
-              an 32-bits variable, the result should be typecasted explicitly
-              to Int32 before it is stored.
-              *(pCoefRight++) = (Int32) tempInt2 * multiplier;
-
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    scalefactor  =  Multiplier used to scale the data extracted from the left
-                    channel for use on the right.
-                    [const Int]
-
-    coef_per_win =  Number of coefficients per window.
-                    (128 for short, 1024 for long)
-                    [const Int]
-
-    sfb_per_win  =  Number of scalefactor bands per window.  This should be
-                    a number divisible by four.
-                    [const Int]
-
-    wins_in_group = The number of windows in the group being decoded.
-                    This number falls within the range 1-8.
-                    [const Int]
-
-    band_length  =  The length of the scalefactor band being decoded.
-                    This value is divisible by 4.
-                    [const Int]
-
-    codebook     =  Value that denotes which Huffman codebook was used for
-                    the encoding of this grouped scalefactor band.
-                    [const Int]
-
-    ms_used      =  Flag that denotes whether M/S is active for this band.
-                    [const Bool]
-
-    q_formatLeft = The Q-format for the left channel's fixed-point spectral
-                   coefficients, on a per-scalefactor band, non-grouped basis.
-                   [const Int *, length MAXBANDS]
-
-    q_formatRight = The Q-format for the right channel's fixed-point spectral
-                    coefficients, on a per-scalefactor band, non-grouped basis.
-                    [Int *, length MAXBANDS]
-
-    coefLeft =  Array containing the fixed-point spectral coefficients
-                for the left channel.
-                [const Int32 *, length 1024]
-
-    coefRight = Array containing the fixed-point spectral coefficients
-                for the right channel.
-                [Int32 *, length 1024]
-
- Local Stores/Buffers/Pointers Needed:
-    intensity_factor =  Table which stores the values of
-                        0.5^(0), 0.5^(1/4), 0.5^(2/4) and 0.5^(3/4)
-                        [UInt, length 4]
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    coefRight[]         Contains the new spectral information
-
-    q_formatRight[]     Q-format may be updated with changed fixed-point
-                        data in coefRight.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function applies Intensity Stereo, generating data on the right channel
- that is derived from data on the Left.  A scalefactor is applied using the
- following formula...
-
- RightCh = LeftCh*0.5^(scalefactor/4)
-
- This function works for one scalefactor band, which may belong to a group.
- (i.e. the same scalefactor band repeated across multiple windows belonging
-  to one group.)
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- codebook must be either INTENSITY_HCB or INTENSITY_HCB2 when this function
- is called.
-
- ms_used must be 1 when TRUE, 0 when FALSE.
-
- wins_in_group falls within the range [1-8]
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.7.2.3 Decoding Process (Intensity Stereo)
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-    multiplier = codebook AND 0x1;
-
-    multiplier = multiplier XOR ms_used;
-
-    multiplier = multiplier << 1;
-
-    multiplier = multiplier - 1;
-
-    multiplier = multiplier * intensity_factor[scalefactor & 0x3];
-
-    scf_div_4 = (scalefactor >> 2);
-
-    nextWinPtrUpdate = (coef_per_win - band_length);
-
-    FOR (win_indx = wins_in_group; win_indx > 0; win_indx--)
-
-        *(pQformatRight) = scf_div_4 + *(pQformatLeft) - 1;
-
-        FOR (tempInt = band_length; tempInt > 0; tempInt--)
-           tempInt2 = (Int)(*(pCoefLeft) >> 16);
-
-           *(pCoefRight) = tempInt2 * multiplier;
-
-           pCoefRight = pCoefRight + 1;
-           pCoefLeft  = pCoefLeft  + 1;
-
-        ENDFOR
-
-        pCoefRight = pCoefRight + nextWinPtrUpdate;
-        pCoefLeft  = pCoefLeft + nextWinPtrUpdate;
-
-        pQformatRight = pQformatRight + sfb_per_win;
-        pQformatLeft  = pQformatLeft  + sfb_per_win;
-    ENDFOR
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-   resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "intensity_right.h"
-#include "e_huffmanconst.h"
-
-#include "fxp_mul32.h"
-#include "aac_mem_funcs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-const Int16 intensity_factor[4] =
-{
-    32767,  /* (0.5^0.00)*2^15 - 1 (minus 1 for storage as type Int) */
-    27554,  /* (0.5^0.25)*2^15 */
-    23170,  /* (0.5^0.50)*2^15 */
-    19484
-}; /* (0.5^0.75)*2^15 */
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void intensity_right(
-    const Int   scalefactor,
-    const Int   coef_per_win,
-    const Int   sfb_per_win,
-    const Int   wins_in_group,
-    const Int   band_length,
-    const Int   codebook,
-    const Bool  ms_used,
-    const Int   q_formatLeft[],
-    Int   q_formatRight[],
-    const Int32 coefLeft[],
-    Int32 coefRight[])
-
-{
-    const Int32 *pCoefLeft  = coefLeft;
-    Int32 *pCoefRight = coefRight;
-
-    const Int *pQformatLeft  = q_formatLeft;
-    Int *pQformatRight = q_formatRight;
-
-    Int   multiplier;
-    Int   scf_div_4;
-    Int   nextWinPtrUpdate;
-
-    /*
-     * The sign of the intensity multiplier obeys the following table...
-     *
-     * codebook       | ms_used | multiplier
-     * --------------------------------------
-     * INTENSITY_HCB  | TRUE    |    -1
-     * INTENSITY_HCB  | FALSE   |    +1
-     * INTENSITY_HCB2 | TRUE    |    +1
-     * INTENSITY_HCB2 | FALSE   |    -1
-     *
-     * In binary, the above table is represented as...
-     *
-     * codebook       | ms_used | multiplier
-     * --------------------------------------
-     * 1111b          | 1       |    -1
-     * 1111b          | 0       |    +1
-     * 1110b          | 1       |    +1
-     * 1110b          | 0       |    -1
-     *
-     */
-
-    /*
-     * Deriving the correct value for "multiplier" is illustrated
-     * below for all 4 possible combinations of codebook and ms_used
-     */
-
-    /*
-     * 1111b AND 0x1 = 1b
-     * 1111b AND 0x1 = 1b
-     * 1110b AND 0x1 = 0b
-     * 1110b AND 0x1 = 0b
-     */
-    multiplier  = (codebook & 0x1);
-
-    /*
-     * 1b XOR 1 = 0b
-     * 1b XOR 0 = 1b
-     * 0b XOR 1 = 1b
-     * 0b XOR 0 = 0b
-     */
-    multiplier ^= ms_used;
-
-    /*
-     * 0b << 1 = 0
-     * 1b << 1 = 2
-     * 1b << 1 = 2
-     * 0b << 1 = 0
-     */
-    multiplier <<= 1;
-
-    /*
-     * 0 - 1 = -1
-     * 2 - 1 = +1
-     * 2 - 1 = +1
-     * 0 - 1 = -1
-     */
-    multiplier--;
-
-    multiplier *= intensity_factor[scalefactor & 0x3];
-
-    scf_div_4 = (scalefactor >> 2);
-
-    /*
-     * Step through all the windows in this group, replacing this
-     * band in each window's spectrum with
-     * left-channel correlated data
-     */
-
-    nextWinPtrUpdate = (coef_per_win - band_length);
-
-    for (Int win_indx = wins_in_group; win_indx > 0; win_indx--)
-    {
-
-        /*
-         * Calculate q_formatRight
-         *
-         * q_formatLeft must be included, since the values
-         * on the right-channel are derived from the values
-         * on the left-channel.
-         *
-         * scalefactor/4 is included, since the intensity
-         * formula is RightCh = LeftCh*0.5^(scalefactor/4)
-         *
-         * powers of 0.5 increase the q_format by 1.
-         * (Another way to multiply something by 0.5^(x)
-         *  is to increase its q-format by x.)
-         *
-         * Finally the q-format must be decreased by 1.
-         * The reason for this is because the table is stored
-         * in q-15 format, but we are shifting by 16 to do
-         * a 16 x 16 multiply.
-         */
-
-        *(pQformatRight) = scf_div_4 + *(pQformatLeft);
-
-        /*
-         * reconstruct right intensity values
-         *
-         * to make things faster, this for loop
-         * can be partially unrolled, since band_length is a multiple
-         * of four.
-         */
-
-
-        if (multiplier == 32767)
-        {
-            Int32 tempInt2 = *(pCoefLeft++);
-            Int32 tempInt22 = *(pCoefLeft++);
-
-            for (Int tempInt = band_length >> 1; tempInt > 0; tempInt--)
-            {
-                *(pCoefRight++) = tempInt2;
-                *(pCoefRight++) = tempInt22;
-                tempInt2 = *(pCoefLeft++);
-                tempInt22 = *(pCoefLeft++);
-            }
-
-        }
-        else
-        {
-
-            Int32 tempInt2 = *(pCoefLeft++);
-            Int32 tempInt22 = *(pCoefLeft++);
-            for (Int tempInt = band_length >> 1; tempInt > 0; tempInt--)
-            {
-                *(pCoefRight++) = fxp_mul32_by_16(tempInt2, multiplier) << 1;
-                *(pCoefRight++) = fxp_mul32_by_16(tempInt22, multiplier) << 1;
-                tempInt2 = *(pCoefLeft++);
-                tempInt22 = *(pCoefLeft++);
-            }
-        }
-
-        /*
-         * Set pCoefRight and pCoefLeft to the beginning of
-         * this sfb in the next window in the group.
-         */
-
-        pCoefRight += nextWinPtrUpdate;
-        pCoefLeft  += (nextWinPtrUpdate - 2);
-
-        /*
-         * Update pQformatRight and pQformatLeft to this sfb in
-         * in the next window in the group.
-         */
-
-        pQformatRight += sfb_per_win;
-        pQformatLeft  += sfb_per_win;
-
-    } /* for (win_indx) */
-
-
-} /* void intensity_right */
diff --git a/media/libstagefright/codecs/aacdec/intensity_right.h b/media/libstagefright/codecs/aacdec/intensity_right.h
deleted file mode 100644
index 823da07..0000000
--- a/media/libstagefright/codecs/aacdec/intensity_right.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: intensity_right.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Change ms_used from Int to Bool
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Contains the function definitions for intensity_right
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef INTENSITY_RIGHT_H
-#define INTENSITY_RIGHT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void intensity_right(
-    const Int   scalefactor,
-    const Int   coef_per_win,
-    const Int   sfb_per_win,
-    const Int   wins_in_group,
-    const Int   band_length,
-    const Int   codebook,
-    const Bool  ms_used,
-    const Int   q_formatLeft[],
-    Int   q_formatRight[],
-    const Int32 coefLeft[],
-    Int32 coefRight[]);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/inv_long_complex_rot.cpp b/media/libstagefright/codecs/aacdec/inv_long_complex_rot.cpp
deleted file mode 100644
index 84a7ec8..0000000
--- a/media/libstagefright/codecs/aacdec/inv_long_complex_rot.cpp
+++ /dev/null
@@ -1,408 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: .inv_long_complex_rot.c
- Funtions:  inv_long_complex_rot
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Change the input argument, no shifts information from long fft_rx4
-               , do not have to check for shifts.
-
- Date: 10/18/2002
- Description:
-            (1) Change the input argument, only a single max is passed.
-            (2) Eliminate search for max, a fixed shift has replaced the
-                search for max with minimal loss of precision.
-            (3) Eliminated unused variables
-
- Date: 10/28/2002
- Description:
-            (1) Added comments per code review
-
- Description:
-
- ------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    Data_in   = Input vector (sized for long windows
-                TWICE_INV_LONG_CX_ROT_LENGTH), with time domain samples
-                type Int32 *
-
-    Data_out  = Output vector with a post-rotation by exp(j(2pi/N)(k+1/8)),
-                (sized for long windows TWICE_INV_LONG_CX_ROT_LENGTH)
-                type Int32 *
-
-    max       = Input, carries the maximum value of the input vector
-                "Data_in"
-                type Int32
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    exp = shift factor to reflect signal scaling
-
- Pointers and Buffers Modified:
-    Results are return in "Data_out"
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    inv_long_complex_rot() performs the complex rotation for the inverse MDCT
-    for the case of long windows. It also performs digit reverse ordering of
-    the first and second halves of the input vector "Data_in", as well as
-    reordering of the two half vectors (following radix-2 decomposition)
-    Word normalization is also done to ensure 16 by 16 bit multiplications.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    inv_long_complex_rot() should execute a post-rotation by
-    exp(-j(2pi/N)(k+1/8)), digit reverse ordering and word normalization
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "digit_reversal_tables.h"
-#include "inv_long_complex_rot.h"
-#include "imdct_fxp.h"
-#include "inv_long_complex_rot.h"
-#include "pv_normalize.h"
-
-#include "fxp_mul32.h"
-#include "aac_mem_funcs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-
-Int inv_long_complex_rot(
-    Int32 *Data,
-    Int32  max)
-{
-    Int     i;
-    Int16     I;
-    const   Int32 *p_rotate;
-    Int32   temp_re;
-    Int32   temp_im;
-
-    Int32    exp_jw;
-    Int32   *pData_in_1;
-    Int32   *pData_in_2;
-    Int     exp;
-    Int32   *pData_in_ref1;
-    Int32   *pData_in_ref2;
-
-
-    Int16   temp_re_0;
-    Int16   temp_im_0;
-    Int16   temp_re_1;
-    Int16   temp_im_1;
-    Int16   *p_Data_Int_precision;
-    Int     n     = 2048;
-    Int     n_2   = n >> 1;
-    Int     n_4   = n >> 2;
-    Int     n_3_4 = n_2 + n_4;
-
-    Int16   *px_1;
-    Int16   *px_2;
-    Int16   *px_3;
-    Int16   *px_4;
-
-    Int16     J;
-    const   Int32 *p_rotate2;
-
-
-
-
-    p_rotate    =  &exp_rotation_N_2048[255];
-    p_rotate2   =  &exp_rotation_N_2048[256];
-
-    pData_in_ref1  =  Data;
-    pData_in_ref2  = &Data[TWICE_INV_LONG_CX_ROT_LENGTH];
-
-
-    /*
-     *  Apply  A/2^(diff) + B
-     */
-
-    p_Data_Int_precision = (Int16 *)Data;
-
-    exp = 16 - pv_normalize(max);
-
-
-    /*
-     *        px2-->               <--px1 px4-->               <--px3
-     *
-     *                     |                           |             |
-     *       |+++++++++++++|+++++++++++++|+++++++++++++|+++++++++++++|
-     *                     |             |             |             |
-     *                    n/4           n/2          3n/4
-     */
-
-    I = 255;
-    J = 256;
-
-    pData_in_1 = pData_in_ref2 + I;
-
-    px_1 = (Int16 *)pData_in_1;
-    px_1++;
-
-    pData_in_2 = pData_in_ref2 + J;
-
-    px_4 = (Int16 *)pData_in_2;
-
-
-
-    exp -= 1;
-
-
-    for (i = INV_LONG_CX_ROT_LENGTH >> 1; i != 0; i--)
-    {
-
-        pData_in_2 = pData_in_ref1 + J;
-
-        temp_im =  *(pData_in_2++);
-        temp_re =  *(pData_in_2);
-
-
-        /*
-         * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-         */
-        exp_jw = *p_rotate2++;
-
-        /*
-         *   Post-rotation
-         */
-
-
-
-        temp_re_0  = (Int16)(cmplx_mul32_by_16(temp_re,  -temp_im,  exp_jw) >> exp);
-        temp_im_0  = (Int16)(cmplx_mul32_by_16(temp_im,   temp_re,  exp_jw) >> exp);
-
-
-        pData_in_1 = pData_in_ref2 + I;
-
-        /*
-         *  Use auxiliary variables to avoid double accesses to memory.
-         *  Data in is scaled to use only lower 16 bits.
-         */
-
-        temp_re =  *(pData_in_1--);
-        temp_im =  *(pData_in_1);
-
-        /*
-         * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-         */
-        exp_jw = *p_rotate--;
-
-
-        /*
-         *   Post-rotation
-         */
-
-        temp_re_1  = (Int16)(cmplx_mul32_by_16(temp_re,  -temp_im,  exp_jw) >> exp);
-        temp_im_1  = (Int16)(cmplx_mul32_by_16(temp_im,   temp_re,  exp_jw) >> exp);
-
-
-        /*
-         *   Repeat procedure for odd index at the output
-         */
-
-        pData_in_2 = pData_in_ref2 + J;
-        J += 2;
-
-        temp_im =  *(pData_in_2++);
-        temp_re =  *(pData_in_2);
-
-
-        *(px_1--) =  temp_re_0;
-        *(px_1--) =  temp_im_1;
-        *(px_4++) =  temp_im_0;
-        *(px_4++) =  temp_re_1;
-
-
-        exp_jw = *p_rotate2++;
-
-
-        *(px_1--)  = (Int16)(cmplx_mul32_by_16(temp_re,  -temp_im,  exp_jw) >> exp);
-        *(px_4++)  = (Int16)(cmplx_mul32_by_16(temp_im,   temp_re,  exp_jw) >> exp);
-
-
-
-        /*
-         *   Repeat procedure for odd index at the output
-         */
-
-        pData_in_1 = pData_in_ref1 + I;
-        I -= 2;
-
-        temp_re =  *(pData_in_1--);
-        temp_im =  *(pData_in_1);
-
-
-        exp_jw = *p_rotate--;
-
-
-        *(px_4++)  = (Int16)(cmplx_mul32_by_16(temp_re,  -temp_im,  exp_jw) >> exp);
-        *(px_1--)  = (Int16)(cmplx_mul32_by_16(temp_im,   temp_re,  exp_jw) >> exp);
-
-    }
-
-    /*
-     *                                           <--px1 px4-->
-     *
-     *                     |                           |             |
-     *       |-------------|-------------|/////////////|\\\\\\\\\\\\\|
-     *                     |             |             |             |
-     *                    n/4           n/2          3n/4
-     */
-
-
-    px_1 = p_Data_Int_precision + n_2 - 1;
-    px_2 = p_Data_Int_precision;
-
-    px_4 = p_Data_Int_precision + n_3_4 - 1;
-
-    for (i = 0; i<INV_LONG_CX_ROT_LENGTH >> 1; i++)
-    {
-
-        Int16 temp_re_0 = *(px_4--);
-        Int16 temp_im_1 = *(px_4--);
-        Int16 temp_re_2 = *(px_4--);
-        Int16 temp_im_3 = *(px_4--);
-        *(px_1--) = temp_re_0;
-        *(px_1--) = temp_im_1;
-        *(px_1--) = temp_re_2;
-        *(px_1--) = temp_im_3;
-
-        *(px_2++) = (-temp_re_0);
-        *(px_2++) = (-temp_im_1);
-        *(px_2++) = (-temp_re_2);
-        *(px_2++) = (-temp_im_3);
-
-    }
-
-
-    px_4 = p_Data_Int_precision + n_2;
-
-
-    pv_memcpy(px_4, pData_in_ref2 + 256, TWICE_INV_LONG_CX_ROT_LENGTH*sizeof(*px_4));
-
-
-
-    /*
-     *        px2-->               <--px1 px4-->               <--px3
-     *
-     *                     |                           |             |
-     *       |+++++++++++++|+++++++++++++|+++++++++++++|+++++++++++++|
-     *                     |             |             |             |
-     *                    n/4           n/2          3n/4
-     */
-    px_3 = p_Data_Int_precision + n - 1;
-
-
-    for (i = 0; i<INV_LONG_CX_ROT_LENGTH >> 1; i++)
-    {
-
-        Int16 temp_im_0 = *(px_4++);
-        Int16 temp_re_1 = *(px_4++);
-        Int16 temp_im_2 = *(px_4++);
-        Int16 temp_re_3 = *(px_4++);
-        *(px_3--) =  temp_im_0;
-        *(px_3--) =  temp_re_1;
-        *(px_3--) =  temp_im_2;
-        *(px_3--) =  temp_re_3;
-
-    }
-
-
-    return (exp + 1);
-}
-
diff --git a/media/libstagefright/codecs/aacdec/inv_long_complex_rot.h b/media/libstagefright/codecs/aacdec/inv_long_complex_rot.h
deleted file mode 100644
index 8b95867..0000000
--- a/media/libstagefright/codecs/aacdec/inv_long_complex_rot.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: inv_long_complex_rot.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function inv_long_complex_rot()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef INV_LONG_COMPLEX_ROT_H
-#define INV_LONG_COMPLEX_ROT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define INV_LONG_CX_ROT_LENGTH          256
-#define TWICE_INV_LONG_CX_ROT_LENGTH (INV_LONG_CX_ROT_LENGTH<<1)
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int inv_long_complex_rot(
-        Int32 *Data,
-        Int32  max);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* INV_LONG_COMPLEX_ROT_H */
diff --git a/media/libstagefright/codecs/aacdec/inv_short_complex_rot.cpp b/media/libstagefright/codecs/aacdec/inv_short_complex_rot.cpp
deleted file mode 100644
index 5b4f1c5..0000000
--- a/media/libstagefright/codecs/aacdec/inv_short_complex_rot.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: inv_short_complex_rot.c
- Funtions:  inv_short_complex_rot
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Date: 10/18/2002
- Description:
-            (1) Change the input argument, only a single max is passed.
-            (2) Eliminate search for max, a fixed shift has replaced the
-                search for max with minimal loss of precision.
-            (3) Eliminated unused variables
-
- Date: 10/28/2002
- Description:
-            (1) Added comments per code review
-            (2) Eliminated hardly used condition on if-else (exp==0)
-
- Description:
-
- ------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    Data_in   = Input vector (sized for short windows
-                2*INV_SHORT_CX_ROT_LENGTH elements), with time domain samples
-                type Int32 *
-
-    Data_out  = Output vector with a post-rotation by exp(j(2pi/N)(k+1/8)),
-                (sized for short windows 2*INV_SHORT_CX_ROT_LENGTH)
-                type Int32 *
-
-    max       = Input, carries the maximum value of the input vector
-                "Data_in"
-                type Int32
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    exp = shift factor to reflect signal scaling
-
- Pointers and Buffers Modified:
-    Results are return in "Data_out"
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    inv_short_complex_rot() performs the complex rotation for the inverse MDCT
-    for the case of short windows. It performs digit reverse ordering as well
-    word normalization to ensure 16 by 16 bit multiplications.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    inv_short_complex_rot() should execute a post-rotation by
-    exp( j(2pi/N)(k+1/8)), digit reverse ordering and word normalization
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "digit_reversal_tables.h"
-#include "imdct_fxp.h"
-#include "inv_short_complex_rot.h"
-#include "pv_normalize.h"
-#include "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-Int inv_short_complex_rot(
-    Int32 *Data_in,
-    Int32 *Data_out,
-    Int32  max)
-
-{
-    Int     i;
-    Int16     I;
-    const   Int16 *pTable;
-    const   Int32 *p_rotate;
-
-    Int32   *pData_in_1;
-    Int     exp;
-    Int32   temp_re;
-    Int32   temp_im;
-
-    Int32   exp_jw;
-    Int16   *pData_re;
-    Int16   *pData_im;
-    Int32   *pData_in_ref;
-
-    Int16   temp_re_0;
-    Int16   temp_im_0;
-    Int16   temp_re_1;
-    Int16   temp_im_1;
-    Int16   *p_data_1;
-    Int16   *p_data_2;
-    Int16   *p_Data_Int_precision;
-    Int16   *p_Data_Int_precision_1;
-    Int16   *p_Data_Int_precision_2;
-
-    Int     n     = 256;
-    Int     n_2   = n >> 1;
-    Int     n_4   = n >> 2;
-    Int     n_8   = n >> 3;
-    Int     n_3_4 = n_2 + n_4;
-
-
-    p_data_1 = (Int16 *)Data_out;
-    p_data_1 += n;
-    pData_re  = p_data_1;
-    pData_im  = p_data_1 + n_4;
-
-
-    p_rotate  =  exp_rotation_N_256;
-    pTable    =  digit_reverse_64;
-
-    pData_in_ref  =  Data_in;
-
-    exp = 16 - pv_normalize(max);
-
-
-    if (exp < 0)
-    {
-        exp = 0;
-    }
-
-    exp -= 1;
-
-    for (i = INV_SHORT_CX_ROT_LENGTH; i != 0; i--)
-    {
-
-        /*
-         * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-         */
-
-        /*
-         *   Perform digit reversal by accessing index I from table
-         */
-
-        I = *pTable++;
-        pData_in_1 = pData_in_ref + I;
-        /*
-         *  Use auxiliary variables to avoid double accesses to memory.
-         *  Data in is scaled to use only lower 16 bits.
-         */
-
-        temp_im =  *(pData_in_1++);
-        temp_re =  *(pData_in_1);
-
-        exp_jw = *p_rotate++;
-
-        /*
-         *   Post-rotation
-         */
-
-        *(pData_re++)  = (Int16)(cmplx_mul32_by_16(temp_re, -temp_im, exp_jw) >> exp);
-        *(pData_im++)  = (Int16)(cmplx_mul32_by_16(temp_im,  temp_re, exp_jw) >> exp);
-    }
-
-
-    p_data_2 = pData_im -  1;
-
-
-    p_Data_Int_precision = (Int16 *)Data_out;
-    p_Data_Int_precision_1 = p_Data_Int_precision + n_3_4 - 1;
-    p_Data_Int_precision_2 = p_Data_Int_precision + n_3_4;
-
-    for (i = n_8 >> 1; i != 0; i--)
-    {
-        temp_re_0 = (*(p_data_1++));
-        temp_re_1 = (*(p_data_1++));
-        temp_im_0 = (*(p_data_2--));
-        temp_im_1 = (*(p_data_2--));
-
-        *(p_Data_Int_precision_1--) =  temp_re_0;
-        *(p_Data_Int_precision_1--) =  temp_im_0;
-        *(p_Data_Int_precision_1--) =  temp_re_1;
-        *(p_Data_Int_precision_1--) =  temp_im_1;
-
-        *(p_Data_Int_precision_2++) =  temp_re_0;
-        *(p_Data_Int_precision_2++) =  temp_im_0;
-        *(p_Data_Int_precision_2++) =  temp_re_1;
-        *(p_Data_Int_precision_2++) =  temp_im_1;
-
-    }
-
-
-    /*
-     *  loop is split to avoid conditional testing inside loop
-     */
-
-    p_Data_Int_precision_2 = p_Data_Int_precision;
-
-    for (i = n_8 >> 1; i != 0; i--)
-    {
-
-        temp_re_0 = (*(p_data_1++));
-        temp_re_1 = (*(p_data_1++));
-        temp_im_0 = (*(p_data_2--));
-        temp_im_1 = (*(p_data_2--));
-
-        *(p_Data_Int_precision_1--) =   temp_re_0;
-        *(p_Data_Int_precision_1--) =   temp_im_0;
-        *(p_Data_Int_precision_1--) =   temp_re_1;
-        *(p_Data_Int_precision_1--) =   temp_im_1;
-
-        *(p_Data_Int_precision_2++) = (Int16)(-temp_re_0);
-        *(p_Data_Int_precision_2++) = (Int16)(-temp_im_0);
-        *(p_Data_Int_precision_2++) = (Int16)(-temp_re_1);
-        *(p_Data_Int_precision_2++) = (Int16)(-temp_im_1);
-
-    }
-
-    return (exp + 1);
-}
diff --git a/media/libstagefright/codecs/aacdec/inv_short_complex_rot.h b/media/libstagefright/codecs/aacdec/inv_short_complex_rot.h
deleted file mode 100644
index 97ed730..0000000
--- a/media/libstagefright/codecs/aacdec/inv_short_complex_rot.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: inv_short_complex_rot.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions inv_short_complex_rot()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef INV_SHORT_COMPLEX_ROT_H
-#define INV_SHORT_COMPLEX_ROT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define INV_SHORT_CX_ROT_LENGTH 64
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-Int inv_short_complex_rot(
-    Int32 *Data_in,
-    Int32 *Data_out,
-    Int32  max);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* INV_SHORT_COMPLEX_ROT_H */
diff --git a/media/libstagefright/codecs/aacdec/iquant_table.cpp b/media/libstagefright/codecs/aacdec/iquant_table.cpp
deleted file mode 100644
index aee47d6..0000000
--- a/media/libstagefright/codecs/aacdec/iquant_table.cpp
+++ /dev/null
@@ -1,1131 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: iquant_table.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- None, just contains tables.
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- Holds a table used for esc_iquant, containing the values of x^1/3 in
- Q format.
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 13818-7:1997 Titled "Information technology - Generic coding
-   of moving pictures and associated audio information - Part 7: Advanced
-   Audio Coding (AAC)", Section 10.3, "Decoding process", page 43.
-
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
- None.
-
-------------------------------------------------------------------------------
- RESOURCES USED
- None.
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "iquant_table.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*
-   This table contains the value of x ^ (1/3) where x is in the range of
-   [0..1024], in Q27 format.
-   Note that the length of the table is 1025, and not 1024 - this is because
-   the function esc_iquant may need to do an interpolation for numbers near
-   8191, which in that case it needs to get 8192 ^(1/3).
- */
-const UInt32 inverseQuantTable[] =
-{
-    0x00000000, /*    0 */
-    0x08000000, /*    1 */
-    0x0a14517d, /*    2 */
-    0x0b89ba25, /*    3 */
-    0x0cb2ff53, /*    4 */
-    0x0dae07de, /*    5 */
-    0x0e897685, /*    6 */
-    0x0f4daedd, /*    7 */
-    0x10000000, /*    8 */
-    0x10a402fd, /*    9 */
-    0x113c4841, /*   10 */
-    0x11cab613, /*   11 */
-    0x1250bfe2, /*   12 */
-    0x12cf8890, /*   13 */
-    0x1347f8ab, /*   14 */
-    0x13bacd65, /*   15 */
-    0x1428a2fa, /*   16 */
-    0x1491fc15, /*   17 */
-    0x14f74744, /*   18 */
-    0x1558e2f7, /*   19 */
-    0x15b72095, /*   20 */
-    0x161246d7, /*   21 */
-    0x166a9399, /*   22 */
-    0x16c03d55, /*   23 */
-    0x17137449, /*   24 */
-    0x17646369, /*   25 */
-    0x17b33124, /*   26 */
-    0x18000000, /*   27 */
-    0x184aef29, /*   28 */
-    0x18941ad8, /*   29 */
-    0x18db9cb7, /*   30 */
-    0x19218c2e, /*   31 */
-    0x1965fea5, /*   32 */
-    0x19a907c2, /*   33 */
-    0x19eab998, /*   34 */
-    0x1a2b24d0, /*   35 */
-    0x1a6a58d5, /*   36 */
-    0x1aa863ee, /*   37 */
-    0x1ae5535d, /*   38 */
-    0x1b213377, /*   39 */
-    0x1b5c0fbd, /*   40 */
-    0x1b95f2ec, /*   41 */
-    0x1bcee70f, /*   42 */
-    0x1c06f590, /*   43 */
-    0x1c3e2745, /*   44 */
-    0x1c74847a, /*   45 */
-    0x1caa1501, /*   46 */
-    0x1cdee035, /*   47 */
-    0x1d12ed0b, /*   48 */
-    0x1d464212, /*   49 */
-    0x1d78e582, /*   50 */
-    0x1daadd3a, /*   51 */
-    0x1ddc2ecf, /*   52 */
-    0x1e0cdf8c, /*   53 */
-    0x1e3cf476, /*   54 */
-    0x1e6c7257, /*   55 */
-    0x1e9b5dba, /*   56 */
-    0x1ec9baf6, /*   57 */
-    0x1ef78e2c, /*   58 */
-    0x1f24db4e, /*   59 */
-    0x1f51a620, /*   60 */
-    0x1f7df23c, /*   61 */
-    0x1fa9c314, /*   62 */
-    0x1fd51bf2, /*   63 */
-    0x20000000, /*   64 */
-    0x202a7244, /*   65 */
-    0x205475a6, /*   66 */
-    0x207e0cee, /*   67 */
-    0x20a73aca, /*   68 */
-    0x20d001cc, /*   69 */
-    0x20f8646d, /*   70 */
-    0x2120650e, /*   71 */
-    0x214805fa, /*   72 */
-    0x216f4963, /*   73 */
-    0x2196316c, /*   74 */
-    0x21bcc020, /*   75 */
-    0x21e2f77a, /*   76 */
-    0x2208d961, /*   77 */
-    0x222e67ad, /*   78 */
-    0x2253a425, /*   79 */
-    0x22789082, /*   80 */
-    0x229d2e6e, /*   81 */
-    0x22c17f82, /*   82 */
-    0x22e5854f, /*   83 */
-    0x23094155, /*   84 */
-    0x232cb509, /*   85 */
-    0x234fe1d5, /*   86 */
-    0x2372c918, /*   87 */
-    0x23956c26, /*   88 */
-    0x23b7cc47, /*   89 */
-    0x23d9eabb, /*   90 */
-    0x23fbc8b9, /*   91 */
-    0x241d676e, /*   92 */
-    0x243ec7ff, /*   93 */
-    0x245feb86, /*   94 */
-    0x2480d319, /*   95 */
-    0x24a17fc3, /*   96 */
-    0x24c1f28b, /*   97 */
-    0x24e22c6c, /*   98 */
-    0x25022e5f, /*   99 */
-    0x2521f954, /*  100 */
-    0x25418e33, /*  101 */
-    0x2560ede2, /*  102 */
-    0x2580193e, /*  103 */
-    0x259f111f, /*  104 */
-    0x25bdd657, /*  105 */
-    0x25dc69b4, /*  106 */
-    0x25facbfe, /*  107 */
-    0x2618fdf8, /*  108 */
-    0x26370060, /*  109 */
-    0x2654d3ef, /*  110 */
-    0x2672795c, /*  111 */
-    0x268ff156, /*  112 */
-    0x26ad3c8a, /*  113 */
-    0x26ca5ba2, /*  114 */
-    0x26e74f41, /*  115 */
-    0x27041808, /*  116 */
-    0x2720b695, /*  117 */
-    0x273d2b81, /*  118 */
-    0x27597762, /*  119 */
-    0x27759acb, /*  120 */
-    0x2791964b, /*  121 */
-    0x27ad6a6f, /*  122 */
-    0x27c917c0, /*  123 */
-    0x27e49ec5, /*  124 */
-    0x28000000, /*  125 */
-    0x281b3bf3, /*  126 */
-    0x2836531b, /*  127 */
-    0x285145f3, /*  128 */
-    0x286c14f5, /*  129 */
-    0x2886c096, /*  130 */
-    0x28a1494b, /*  131 */
-    0x28bbaf85, /*  132 */
-    0x28d5f3b3, /*  133 */
-    0x28f01641, /*  134 */
-    0x290a179b, /*  135 */
-    0x2923f82a, /*  136 */
-    0x293db854, /*  137 */
-    0x2957587e, /*  138 */
-    0x2970d90a, /*  139 */
-    0x298a3a59, /*  140 */
-    0x29a37cca, /*  141 */
-    0x29bca0bb, /*  142 */
-    0x29d5a687, /*  143 */
-    0x29ee8e87, /*  144 */
-    0x2a075914, /*  145 */
-    0x2a200684, /*  146 */
-    0x2a38972c, /*  147 */
-    0x2a510b5f, /*  148 */
-    0x2a696370, /*  149 */
-    0x2a819fae, /*  150 */
-    0x2a99c069, /*  151 */
-    0x2ab1c5ed, /*  152 */
-    0x2ac9b088, /*  153 */
-    0x2ae18085, /*  154 */
-    0x2af9362c, /*  155 */
-    0x2b10d1c6, /*  156 */
-    0x2b28539b, /*  157 */
-    0x2b3fbbef, /*  158 */
-    0x2b570b09, /*  159 */
-    0x2b6e412b, /*  160 */
-    0x2b855e97, /*  161 */
-    0x2b9c6390, /*  162 */
-    0x2bb35056, /*  163 */
-    0x2bca2527, /*  164 */
-    0x2be0e242, /*  165 */
-    0x2bf787e4, /*  166 */
-    0x2c0e1649, /*  167 */
-    0x2c248dad, /*  168 */
-    0x2c3aee4a, /*  169 */
-    0x2c513859, /*  170 */
-    0x2c676c13, /*  171 */
-    0x2c7d89af, /*  172 */
-    0x2c939164, /*  173 */
-    0x2ca98368, /*  174 */
-    0x2cbf5ff1, /*  175 */
-    0x2cd52731, /*  176 */
-    0x2cead95e, /*  177 */
-    0x2d0076a9, /*  178 */
-    0x2d15ff45, /*  179 */
-    0x2d2b7363, /*  180 */
-    0x2d40d332, /*  181 */
-    0x2d561ee4, /*  182 */
-    0x2d6b56a7, /*  183 */
-    0x2d807aaa, /*  184 */
-    0x2d958b19, /*  185 */
-    0x2daa8823, /*  186 */
-    0x2dbf71f4, /*  187 */
-    0x2dd448b7, /*  188 */
-    0x2de90c98, /*  189 */
-    0x2dfdbdc0, /*  190 */
-    0x2e125c5c, /*  191 */
-    0x2e26e892, /*  192 */
-    0x2e3b628d, /*  193 */
-    0x2e4fca75, /*  194 */
-    0x2e642070, /*  195 */
-    0x2e7864a8, /*  196 */
-    0x2e8c9741, /*  197 */
-    0x2ea0b862, /*  198 */
-    0x2eb4c831, /*  199 */
-    0x2ec8c6d3, /*  200 */
-    0x2edcb46c, /*  201 */
-    0x2ef09121, /*  202 */
-    0x2f045d14, /*  203 */
-    0x2f18186a, /*  204 */
-    0x2f2bc345, /*  205 */
-    0x2f3f5dc7, /*  206 */
-    0x2f52e812, /*  207 */
-    0x2f666247, /*  208 */
-    0x2f79cc88, /*  209 */
-    0x2f8d26f4, /*  210 */
-    0x2fa071ac, /*  211 */
-    0x2fb3acd0, /*  212 */
-    0x2fc6d87f, /*  213 */
-    0x2fd9f4d7, /*  214 */
-    0x2fed01f8, /*  215 */
-    0x30000000, /*  216 */
-    0x3012ef0c, /*  217 */
-    0x3025cf39, /*  218 */
-    0x3038a0a6, /*  219 */
-    0x304b636d, /*  220 */
-    0x305e17ad, /*  221 */
-    0x3070bd81, /*  222 */
-    0x30835504, /*  223 */
-    0x3095de51, /*  224 */
-    0x30a85985, /*  225 */
-    0x30bac6b9, /*  226 */
-    0x30cd2609, /*  227 */
-    0x30df778d, /*  228 */
-    0x30f1bb60, /*  229 */
-    0x3103f19c, /*  230 */
-    0x31161a59, /*  231 */
-    0x312835b0, /*  232 */
-    0x313a43ba, /*  233 */
-    0x314c4490, /*  234 */
-    0x315e3849, /*  235 */
-    0x31701efd, /*  236 */
-    0x3181f8c4, /*  237 */
-    0x3193c5b4, /*  238 */
-    0x31a585e6, /*  239 */
-    0x31b7396f, /*  240 */
-    0x31c8e066, /*  241 */
-    0x31da7ae1, /*  242 */
-    0x31ec08f6, /*  243 */
-    0x31fd8abc, /*  244 */
-    0x320f0047, /*  245 */
-    0x322069ac, /*  246 */
-    0x3231c702, /*  247 */
-    0x3243185c, /*  248 */
-    0x32545dcf, /*  249 */
-    0x32659770, /*  250 */
-    0x3276c552, /*  251 */
-    0x3287e78a, /*  252 */
-    0x3298fe2c, /*  253 */
-    0x32aa094a, /*  254 */
-    0x32bb08f9, /*  255 */
-    0x32cbfd4a, /*  256 */
-    0x32dce652, /*  257 */
-    0x32edc423, /*  258 */
-    0x32fe96d0, /*  259 */
-    0x330f5e6a, /*  260 */
-    0x33201b04, /*  261 */
-    0x3330ccb0, /*  262 */
-    0x33417380, /*  263 */
-    0x33520f85, /*  264 */
-    0x3362a0d0, /*  265 */
-    0x33732774, /*  266 */
-    0x3383a380, /*  267 */
-    0x33941506, /*  268 */
-    0x33a47c17, /*  269 */
-    0x33b4d8c4, /*  270 */
-    0x33c52b1b, /*  271 */
-    0x33d5732f, /*  272 */
-    0x33e5b10f, /*  273 */
-    0x33f5e4ca, /*  274 */
-    0x34060e71, /*  275 */
-    0x34162e14, /*  276 */
-    0x342643c1, /*  277 */
-    0x34364f88, /*  278 */
-    0x34465178, /*  279 */
-    0x345649a1, /*  280 */
-    0x34663810, /*  281 */
-    0x34761cd6, /*  282 */
-    0x3485f800, /*  283 */
-    0x3495c99d, /*  284 */
-    0x34a591bb, /*  285 */
-    0x34b55069, /*  286 */
-    0x34c505b4, /*  287 */
-    0x34d4b1ab, /*  288 */
-    0x34e4545b, /*  289 */
-    0x34f3edd2, /*  290 */
-    0x35037e1d, /*  291 */
-    0x3513054b, /*  292 */
-    0x35228367, /*  293 */
-    0x3531f881, /*  294 */
-    0x354164a3, /*  295 */
-    0x3550c7dc, /*  296 */
-    0x35602239, /*  297 */
-    0x356f73c5, /*  298 */
-    0x357ebc8e, /*  299 */
-    0x358dfca0, /*  300 */
-    0x359d3408, /*  301 */
-    0x35ac62d1, /*  302 */
-    0x35bb8908, /*  303 */
-    0x35caa6b9, /*  304 */
-    0x35d9bbf0, /*  305 */
-    0x35e8c8b9, /*  306 */
-    0x35f7cd20, /*  307 */
-    0x3606c92f, /*  308 */
-    0x3615bcf3, /*  309 */
-    0x3624a878, /*  310 */
-    0x36338bc8, /*  311 */
-    0x364266ee, /*  312 */
-    0x365139f6, /*  313 */
-    0x366004ec, /*  314 */
-    0x366ec7d9, /*  315 */
-    0x367d82c9, /*  316 */
-    0x368c35c6, /*  317 */
-    0x369ae0dc, /*  318 */
-    0x36a98414, /*  319 */
-    0x36b81f7a, /*  320 */
-    0x36c6b317, /*  321 */
-    0x36d53ef7, /*  322 */
-    0x36e3c323, /*  323 */
-    0x36f23fa5, /*  324 */
-    0x3700b488, /*  325 */
-    0x370f21d5, /*  326 */
-    0x371d8797, /*  327 */
-    0x372be5d7, /*  328 */
-    0x373a3ca0, /*  329 */
-    0x37488bf9, /*  330 */
-    0x3756d3ef, /*  331 */
-    0x37651489, /*  332 */
-    0x37734dd1, /*  333 */
-    0x37817fd1, /*  334 */
-    0x378faa92, /*  335 */
-    0x379dce1d, /*  336 */
-    0x37abea7c, /*  337 */
-    0x37b9ffb7, /*  338 */
-    0x37c80dd7, /*  339 */
-    0x37d614e6, /*  340 */
-    0x37e414ec, /*  341 */
-    0x37f20df1, /*  342 */
-    0x38000000, /*  343 */
-    0x380deb20, /*  344 */
-    0x381bcf5a, /*  345 */
-    0x3829acb6, /*  346 */
-    0x3837833d, /*  347 */
-    0x384552f8, /*  348 */
-    0x38531bee, /*  349 */
-    0x3860de28, /*  350 */
-    0x386e99af, /*  351 */
-    0x387c4e89, /*  352 */
-    0x3889fcc0, /*  353 */
-    0x3897a45b, /*  354 */
-    0x38a54563, /*  355 */
-    0x38b2dfdf, /*  356 */
-    0x38c073d7, /*  357 */
-    0x38ce0152, /*  358 */
-    0x38db885a, /*  359 */
-    0x38e908f4, /*  360 */
-    0x38f68329, /*  361 */
-    0x3903f701, /*  362 */
-    0x39116483, /*  363 */
-    0x391ecbb6, /*  364 */
-    0x392c2ca1, /*  365 */
-    0x3939874d, /*  366 */
-    0x3946dbc0, /*  367 */
-    0x39542a01, /*  368 */
-    0x39617218, /*  369 */
-    0x396eb40c, /*  370 */
-    0x397befe4, /*  371 */
-    0x398925a7, /*  372 */
-    0x3996555c, /*  373 */
-    0x39a37f09, /*  374 */
-    0x39b0a2b7, /*  375 */
-    0x39bdc06a, /*  376 */
-    0x39cad82b, /*  377 */
-    0x39d7ea01, /*  378 */
-    0x39e4f5f0, /*  379 */
-    0x39f1fc01, /*  380 */
-    0x39fefc3a, /*  381 */
-    0x3a0bf6a2, /*  382 */
-    0x3a18eb3e, /*  383 */
-    0x3a25da16, /*  384 */
-    0x3a32c32f, /*  385 */
-    0x3a3fa691, /*  386 */
-    0x3a4c8441, /*  387 */
-    0x3a595c46, /*  388 */
-    0x3a662ea6, /*  389 */
-    0x3a72fb67, /*  390 */
-    0x3a7fc28f, /*  391 */
-    0x3a8c8425, /*  392 */
-    0x3a99402e, /*  393 */
-    0x3aa5f6b1, /*  394 */
-    0x3ab2a7b3, /*  395 */
-    0x3abf533a, /*  396 */
-    0x3acbf94d, /*  397 */
-    0x3ad899f1, /*  398 */
-    0x3ae5352c, /*  399 */
-    0x3af1cb03, /*  400 */
-    0x3afe5b7d, /*  401 */
-    0x3b0ae6a0, /*  402 */
-    0x3b176c70, /*  403 */
-    0x3b23ecf3, /*  404 */
-    0x3b306830, /*  405 */
-    0x3b3cde2c, /*  406 */
-    0x3b494eeb, /*  407 */
-    0x3b55ba74, /*  408 */
-    0x3b6220cc, /*  409 */
-    0x3b6e81f9, /*  410 */
-    0x3b7ade00, /*  411 */
-    0x3b8734e5, /*  412 */
-    0x3b9386b0, /*  413 */
-    0x3b9fd364, /*  414 */
-    0x3bac1b07, /*  415 */
-    0x3bb85d9e, /*  416 */
-    0x3bc49b2f, /*  417 */
-    0x3bd0d3be, /*  418 */
-    0x3bdd0751, /*  419 */
-    0x3be935ed, /*  420 */
-    0x3bf55f97, /*  421 */
-    0x3c018453, /*  422 */
-    0x3c0da427, /*  423 */
-    0x3c19bf17, /*  424 */
-    0x3c25d52a, /*  425 */
-    0x3c31e662, /*  426 */
-    0x3c3df2c6, /*  427 */
-    0x3c49fa5b, /*  428 */
-    0x3c55fd24, /*  429 */
-    0x3c61fb27, /*  430 */
-    0x3c6df468, /*  431 */
-    0x3c79e8ed, /*  432 */
-    0x3c85d8b9, /*  433 */
-    0x3c91c3d2, /*  434 */
-    0x3c9daa3c, /*  435 */
-    0x3ca98bfc, /*  436 */
-    0x3cb56915, /*  437 */
-    0x3cc1418e, /*  438 */
-    0x3ccd156a, /*  439 */
-    0x3cd8e4ae, /*  440 */
-    0x3ce4af5e, /*  441 */
-    0x3cf0757f, /*  442 */
-    0x3cfc3714, /*  443 */
-    0x3d07f423, /*  444 */
-    0x3d13acb0, /*  445 */
-    0x3d1f60bf, /*  446 */
-    0x3d2b1055, /*  447 */
-    0x3d36bb75, /*  448 */
-    0x3d426224, /*  449 */
-    0x3d4e0466, /*  450 */
-    0x3d59a23f, /*  451 */
-    0x3d653bb4, /*  452 */
-    0x3d70d0c8, /*  453 */
-    0x3d7c6180, /*  454 */
-    0x3d87ede0, /*  455 */
-    0x3d9375ec, /*  456 */
-    0x3d9ef9a8, /*  457 */
-    0x3daa7918, /*  458 */
-    0x3db5f43f, /*  459 */
-    0x3dc16b23, /*  460 */
-    0x3dccddc7, /*  461 */
-    0x3dd84c2e, /*  462 */
-    0x3de3b65d, /*  463 */
-    0x3def1c58, /*  464 */
-    0x3dfa7e22, /*  465 */
-    0x3e05dbc0, /*  466 */
-    0x3e113535, /*  467 */
-    0x3e1c8a85, /*  468 */
-    0x3e27dbb3, /*  469 */
-    0x3e3328c4, /*  470 */
-    0x3e3e71bb, /*  471 */
-    0x3e49b69c, /*  472 */
-    0x3e54f76b, /*  473 */
-    0x3e60342b, /*  474 */
-    0x3e6b6ce0, /*  475 */
-    0x3e76a18d, /*  476 */
-    0x3e81d237, /*  477 */
-    0x3e8cfee0, /*  478 */
-    0x3e98278d, /*  479 */
-    0x3ea34c40, /*  480 */
-    0x3eae6cfe, /*  481 */
-    0x3eb989ca, /*  482 */
-    0x3ec4a2a8, /*  483 */
-    0x3ecfb79a, /*  484 */
-    0x3edac8a5, /*  485 */
-    0x3ee5d5cb, /*  486 */
-    0x3ef0df10, /*  487 */
-    0x3efbe478, /*  488 */
-    0x3f06e606, /*  489 */
-    0x3f11e3be, /*  490 */
-    0x3f1cdda2, /*  491 */
-    0x3f27d3b6, /*  492 */
-    0x3f32c5fd, /*  493 */
-    0x3f3db47b, /*  494 */
-    0x3f489f32, /*  495 */
-    0x3f538627, /*  496 */
-    0x3f5e695c, /*  497 */
-    0x3f6948d5, /*  498 */
-    0x3f742494, /*  499 */
-    0x3f7efc9d, /*  500 */
-    0x3f89d0f3, /*  501 */
-    0x3f94a19a, /*  502 */
-    0x3f9f6e94, /*  503 */
-    0x3faa37e4, /*  504 */
-    0x3fb4fd8e, /*  505 */
-    0x3fbfbf94, /*  506 */
-    0x3fca7dfb, /*  507 */
-    0x3fd538c4, /*  508 */
-    0x3fdfeff3, /*  509 */
-    0x3feaa38a, /*  510 */
-    0x3ff5538e, /*  511 */
-    0x40000000, /*  512 */
-    0x400aa8e4, /*  513 */
-    0x40154e3d, /*  514 */
-    0x401ff00d, /*  515 */
-    0x402a8e58, /*  516 */
-    0x40352921, /*  517 */
-    0x403fc06a, /*  518 */
-    0x404a5436, /*  519 */
-    0x4054e488, /*  520 */
-    0x405f7164, /*  521 */
-    0x4069facb, /*  522 */
-    0x407480c1, /*  523 */
-    0x407f0348, /*  524 */
-    0x40898264, /*  525 */
-    0x4093fe16, /*  526 */
-    0x409e7663, /*  527 */
-    0x40a8eb4c, /*  528 */
-    0x40b35cd4, /*  529 */
-    0x40bdcafe, /*  530 */
-    0x40c835cd, /*  531 */
-    0x40d29d43, /*  532 */
-    0x40dd0164, /*  533 */
-    0x40e76231, /*  534 */
-    0x40f1bfae, /*  535 */
-    0x40fc19dc, /*  536 */
-    0x410670c0, /*  537 */
-    0x4110c45a, /*  538 */
-    0x411b14af, /*  539 */
-    0x412561c0, /*  540 */
-    0x412fab90, /*  541 */
-    0x4139f222, /*  542 */
-    0x41443578, /*  543 */
-    0x414e7595, /*  544 */
-    0x4158b27a, /*  545 */
-    0x4162ec2c, /*  546 */
-    0x416d22ac, /*  547 */
-    0x417755fd, /*  548 */
-    0x41818621, /*  549 */
-    0x418bb31a, /*  550 */
-    0x4195dcec, /*  551 */
-    0x41a00399, /*  552 */
-    0x41aa2722, /*  553 */
-    0x41b4478b, /*  554 */
-    0x41be64d6, /*  555 */
-    0x41c87f05, /*  556 */
-    0x41d2961a, /*  557 */
-    0x41dcaa19, /*  558 */
-    0x41e6bb03, /*  559 */
-    0x41f0c8db, /*  560 */
-    0x41fad3a3, /*  561 */
-    0x4204db5d, /*  562 */
-    0x420ee00c, /*  563 */
-    0x4218e1b1, /*  564 */
-    0x4222e051, /*  565 */
-    0x422cdbeb, /*  566 */
-    0x4236d484, /*  567 */
-    0x4240ca1d, /*  568 */
-    0x424abcb8, /*  569 */
-    0x4254ac58, /*  570 */
-    0x425e98fe, /*  571 */
-    0x426882ae, /*  572 */
-    0x42726969, /*  573 */
-    0x427c4d31, /*  574 */
-    0x42862e09, /*  575 */
-    0x42900bf3, /*  576 */
-    0x4299e6f1, /*  577 */
-    0x42a3bf05, /*  578 */
-    0x42ad9432, /*  579 */
-    0x42b76678, /*  580 */
-    0x42c135dc, /*  581 */
-    0x42cb025e, /*  582 */
-    0x42d4cc01, /*  583 */
-    0x42de92c7, /*  584 */
-    0x42e856b2, /*  585 */
-    0x42f217c4, /*  586 */
-    0x42fbd5ff, /*  587 */
-    0x43059166, /*  588 */
-    0x430f49f9, /*  589 */
-    0x4318ffbc, /*  590 */
-    0x4322b2b1, /*  591 */
-    0x432c62d8, /*  592 */
-    0x43361036, /*  593 */
-    0x433fbaca, /*  594 */
-    0x43496298, /*  595 */
-    0x435307a2, /*  596 */
-    0x435ca9e8, /*  597 */
-    0x4366496e, /*  598 */
-    0x436fe636, /*  599 */
-    0x43798041, /*  600 */
-    0x43831790, /*  601 */
-    0x438cac28, /*  602 */
-    0x43963e08, /*  603 */
-    0x439fcd33, /*  604 */
-    0x43a959ab, /*  605 */
-    0x43b2e372, /*  606 */
-    0x43bc6a89, /*  607 */
-    0x43c5eef3, /*  608 */
-    0x43cf70b2, /*  609 */
-    0x43d8efc7, /*  610 */
-    0x43e26c34, /*  611 */
-    0x43ebe5fb, /*  612 */
-    0x43f55d1e, /*  613 */
-    0x43fed19f, /*  614 */
-    0x44084380, /*  615 */
-    0x4411b2c1, /*  616 */
-    0x441b1f66, /*  617 */
-    0x44248970, /*  618 */
-    0x442df0e1, /*  619 */
-    0x443755bb, /*  620 */
-    0x4440b7fe, /*  621 */
-    0x444a17ae, /*  622 */
-    0x445374cc, /*  623 */
-    0x445ccf5a, /*  624 */
-    0x44662758, /*  625 */
-    0x446f7ccb, /*  626 */
-    0x4478cfb2, /*  627 */
-    0x4482200f, /*  628 */
-    0x448b6de5, /*  629 */
-    0x4494b935, /*  630 */
-    0x449e0201, /*  631 */
-    0x44a7484b, /*  632 */
-    0x44b08c13, /*  633 */
-    0x44b9cd5d, /*  634 */
-    0x44c30c29, /*  635 */
-    0x44cc4879, /*  636 */
-    0x44d5824f, /*  637 */
-    0x44deb9ac, /*  638 */
-    0x44e7ee93, /*  639 */
-    0x44f12105, /*  640 */
-    0x44fa5103, /*  641 */
-    0x45037e8f, /*  642 */
-    0x450ca9ab, /*  643 */
-    0x4515d258, /*  644 */
-    0x451ef899, /*  645 */
-    0x45281c6e, /*  646 */
-    0x45313dd8, /*  647 */
-    0x453a5cdb, /*  648 */
-    0x45437977, /*  649 */
-    0x454c93ae, /*  650 */
-    0x4555ab82, /*  651 */
-    0x455ec0f3, /*  652 */
-    0x4567d404, /*  653 */
-    0x4570e4b7, /*  654 */
-    0x4579f30c, /*  655 */
-    0x4582ff05, /*  656 */
-    0x458c08a4, /*  657 */
-    0x45950fea, /*  658 */
-    0x459e14d9, /*  659 */
-    0x45a71773, /*  660 */
-    0x45b017b8, /*  661 */
-    0x45b915aa, /*  662 */
-    0x45c2114c, /*  663 */
-    0x45cb0a9e, /*  664 */
-    0x45d401a1, /*  665 */
-    0x45dcf658, /*  666 */
-    0x45e5e8c4, /*  667 */
-    0x45eed8e6, /*  668 */
-    0x45f7c6c0, /*  669 */
-    0x4600b253, /*  670 */
-    0x46099ba0, /*  671 */
-    0x461282a9, /*  672 */
-    0x461b6770, /*  673 */
-    0x462449f6, /*  674 */
-    0x462d2a3c, /*  675 */
-    0x46360844, /*  676 */
-    0x463ee40f, /*  677 */
-    0x4647bd9f, /*  678 */
-    0x465094f5, /*  679 */
-    0x46596a12, /*  680 */
-    0x46623cf8, /*  681 */
-    0x466b0da8, /*  682 */
-    0x4673dc24, /*  683 */
-    0x467ca86c, /*  684 */
-    0x46857283, /*  685 */
-    0x468e3a69, /*  686 */
-    0x46970021, /*  687 */
-    0x469fc3ab, /*  688 */
-    0x46a88509, /*  689 */
-    0x46b1443b, /*  690 */
-    0x46ba0144, /*  691 */
-    0x46c2bc25, /*  692 */
-    0x46cb74df, /*  693 */
-    0x46d42b74, /*  694 */
-    0x46dcdfe4, /*  695 */
-    0x46e59231, /*  696 */
-    0x46ee425c, /*  697 */
-    0x46f6f068, /*  698 */
-    0x46ff9c54, /*  699 */
-    0x47084622, /*  700 */
-    0x4710edd4, /*  701 */
-    0x4719936b, /*  702 */
-    0x472236e7, /*  703 */
-    0x472ad84b, /*  704 */
-    0x47337798, /*  705 */
-    0x473c14cf, /*  706 */
-    0x4744aff1, /*  707 */
-    0x474d48ff, /*  708 */
-    0x4755dffb, /*  709 */
-    0x475e74e6, /*  710 */
-    0x476707c1, /*  711 */
-    0x476f988e, /*  712 */
-    0x4778274d, /*  713 */
-    0x4780b400, /*  714 */
-    0x47893ea8, /*  715 */
-    0x4791c746, /*  716 */
-    0x479a4ddc, /*  717 */
-    0x47a2d26b, /*  718 */
-    0x47ab54f3, /*  719 */
-    0x47b3d577, /*  720 */
-    0x47bc53f7, /*  721 */
-    0x47c4d074, /*  722 */
-    0x47cd4af0, /*  723 */
-    0x47d5c36c, /*  724 */
-    0x47de39e9, /*  725 */
-    0x47e6ae69, /*  726 */
-    0x47ef20ec, /*  727 */
-    0x47f79173, /*  728 */
-    0x48000000, /*  729 */
-    0x48086c94, /*  730 */
-    0x4810d730, /*  731 */
-    0x48193fd5, /*  732 */
-    0x4821a685, /*  733 */
-    0x482a0b40, /*  734 */
-    0x48326e07, /*  735 */
-    0x483acedd, /*  736 */
-    0x48432dc1, /*  737 */
-    0x484b8ab5, /*  738 */
-    0x4853e5bb, /*  739 */
-    0x485c3ed2, /*  740 */
-    0x486495fd, /*  741 */
-    0x486ceb3c, /*  742 */
-    0x48753e91, /*  743 */
-    0x487d8ffd, /*  744 */
-    0x4885df80, /*  745 */
-    0x488e2d1d, /*  746 */
-    0x489678d3, /*  747 */
-    0x489ec2a4, /*  748 */
-    0x48a70a91, /*  749 */
-    0x48af509b, /*  750 */
-    0x48b794c4, /*  751 */
-    0x48bfd70c, /*  752 */
-    0x48c81774, /*  753 */
-    0x48d055fe, /*  754 */
-    0x48d892aa, /*  755 */
-    0x48e0cd7a, /*  756 */
-    0x48e9066e, /*  757 */
-    0x48f13d88, /*  758 */
-    0x48f972c9, /*  759 */
-    0x4901a632, /*  760 */
-    0x4909d7c3, /*  761 */
-    0x4912077e, /*  762 */
-    0x491a3564, /*  763 */
-    0x49226175, /*  764 */
-    0x492a8bb4, /*  765 */
-    0x4932b420, /*  766 */
-    0x493adabc, /*  767 */
-    0x4942ff87, /*  768 */
-    0x494b2283, /*  769 */
-    0x495343b1, /*  770 */
-    0x495b6312, /*  771 */
-    0x496380a7, /*  772 */
-    0x496b9c71, /*  773 */
-    0x4973b670, /*  774 */
-    0x497bcea7, /*  775 */
-    0x4983e515, /*  776 */
-    0x498bf9bc, /*  777 */
-    0x49940c9e, /*  778 */
-    0x499c1db9, /*  779 */
-    0x49a42d11, /*  780 */
-    0x49ac3aa5, /*  781 */
-    0x49b44677, /*  782 */
-    0x49bc5088, /*  783 */
-    0x49c458d8, /*  784 */
-    0x49cc5f69, /*  785 */
-    0x49d4643c, /*  786 */
-    0x49dc6750, /*  787 */
-    0x49e468a9, /*  788 */
-    0x49ec6845, /*  789 */
-    0x49f46627, /*  790 */
-    0x49fc624f, /*  791 */
-    0x4a045cbe, /*  792 */
-    0x4a0c5575, /*  793 */
-    0x4a144c76, /*  794 */
-    0x4a1c41c0, /*  795 */
-    0x4a243555, /*  796 */
-    0x4a2c2735, /*  797 */
-    0x4a341763, /*  798 */
-    0x4a3c05de, /*  799 */
-    0x4a43f2a7, /*  800 */
-    0x4a4bddc0, /*  801 */
-    0x4a53c729, /*  802 */
-    0x4a5baee3, /*  803 */
-    0x4a6394ef, /*  804 */
-    0x4a6b794f, /*  805 */
-    0x4a735c02, /*  806 */
-    0x4a7b3d09, /*  807 */
-    0x4a831c67, /*  808 */
-    0x4a8afa1b, /*  809 */
-    0x4a92d626, /*  810 */
-    0x4a9ab089, /*  811 */
-    0x4aa28946, /*  812 */
-    0x4aaa605d, /*  813 */
-    0x4ab235ce, /*  814 */
-    0x4aba099b, /*  815 */
-    0x4ac1dbc5, /*  816 */
-    0x4ac9ac4c, /*  817 */
-    0x4ad17b31, /*  818 */
-    0x4ad94876, /*  819 */
-    0x4ae1141a, /*  820 */
-    0x4ae8de1f, /*  821 */
-    0x4af0a686, /*  822 */
-    0x4af86d50, /*  823 */
-    0x4b00327d, /*  824 */
-    0x4b07f60d, /*  825 */
-    0x4b0fb803, /*  826 */
-    0x4b17785f, /*  827 */
-    0x4b1f3722, /*  828 */
-    0x4b26f44b, /*  829 */
-    0x4b2eafde, /*  830 */
-    0x4b3669d9, /*  831 */
-    0x4b3e223e, /*  832 */
-    0x4b45d90e, /*  833 */
-    0x4b4d8e4a, /*  834 */
-    0x4b5541f2, /*  835 */
-    0x4b5cf407, /*  836 */
-    0x4b64a48a, /*  837 */
-    0x4b6c537c, /*  838 */
-    0x4b7400dd, /*  839 */
-    0x4b7bacaf, /*  840 */
-    0x4b8356f2, /*  841 */
-    0x4b8affa7, /*  842 */
-    0x4b92a6ce, /*  843 */
-    0x4b9a4c69, /*  844 */
-    0x4ba1f079, /*  845 */
-    0x4ba992fd, /*  846 */
-    0x4bb133f8, /*  847 */
-    0x4bb8d369, /*  848 */
-    0x4bc07151, /*  849 */
-    0x4bc80db2, /*  850 */
-    0x4bcfa88c, /*  851 */
-    0x4bd741df, /*  852 */
-    0x4bded9ad, /*  853 */
-    0x4be66ff6, /*  854 */
-    0x4bee04bb, /*  855 */
-    0x4bf597fc, /*  856 */
-    0x4bfd29bc, /*  857 */
-    0x4c04b9f9, /*  858 */
-    0x4c0c48b6, /*  859 */
-    0x4c13d5f2, /*  860 */
-    0x4c1b61af, /*  861 */
-    0x4c22ebed, /*  862 */
-    0x4c2a74ad, /*  863 */
-    0x4c31fbf0, /*  864 */
-    0x4c3981b6, /*  865 */
-    0x4c410600, /*  866 */
-    0x4c4888d0, /*  867 */
-    0x4c500a25, /*  868 */
-    0x4c578a00, /*  869 */
-    0x4c5f0862, /*  870 */
-    0x4c66854c, /*  871 */
-    0x4c6e00bf, /*  872 */
-    0x4c757abb, /*  873 */
-    0x4c7cf341, /*  874 */
-    0x4c846a52, /*  875 */
-    0x4c8bdfee, /*  876 */
-    0x4c935416, /*  877 */
-    0x4c9ac6cb, /*  878 */
-    0x4ca2380e, /*  879 */
-    0x4ca9a7de, /*  880 */
-    0x4cb1163e, /*  881 */
-    0x4cb8832d, /*  882 */
-    0x4cbfeead, /*  883 */
-    0x4cc758bd, /*  884 */
-    0x4ccec15f, /*  885 */
-    0x4cd62894, /*  886 */
-    0x4cdd8e5c, /*  887 */
-    0x4ce4f2b7, /*  888 */
-    0x4cec55a7, /*  889 */
-    0x4cf3b72c, /*  890 */
-    0x4cfb1747, /*  891 */
-    0x4d0275f8, /*  892 */
-    0x4d09d340, /*  893 */
-    0x4d112f21, /*  894 */
-    0x4d188999, /*  895 */
-    0x4d1fe2ab, /*  896 */
-    0x4d273a57, /*  897 */
-    0x4d2e909d, /*  898 */
-    0x4d35e57f, /*  899 */
-    0x4d3d38fc, /*  900 */
-    0x4d448b16, /*  901 */
-    0x4d4bdbcd, /*  902 */
-    0x4d532b21, /*  903 */
-    0x4d5a7914, /*  904 */
-    0x4d61c5a7, /*  905 */
-    0x4d6910d9, /*  906 */
-    0x4d705aab, /*  907 */
-    0x4d77a31e, /*  908 */
-    0x4d7eea34, /*  909 */
-    0x4d862feb, /*  910 */
-    0x4d8d7445, /*  911 */
-    0x4d94b743, /*  912 */
-    0x4d9bf8e6, /*  913 */
-    0x4da3392d, /*  914 */
-    0x4daa7819, /*  915 */
-    0x4db1b5ac, /*  916 */
-    0x4db8f1e6, /*  917 */
-    0x4dc02cc7, /*  918 */
-    0x4dc76650, /*  919 */
-    0x4dce9e81, /*  920 */
-    0x4dd5d55c, /*  921 */
-    0x4ddd0ae1, /*  922 */
-    0x4de43f10, /*  923 */
-    0x4deb71eb, /*  924 */
-    0x4df2a371, /*  925 */
-    0x4df9d3a3, /*  926 */
-    0x4e010283, /*  927 */
-    0x4e083010, /*  928 */
-    0x4e0f5c4b, /*  929 */
-    0x4e168735, /*  930 */
-    0x4e1db0cf, /*  931 */
-    0x4e24d918, /*  932 */
-    0x4e2c0012, /*  933 */
-    0x4e3325bd, /*  934 */
-    0x4e3a4a1a, /*  935 */
-    0x4e416d2a, /*  936 */
-    0x4e488eec, /*  937 */
-    0x4e4faf62, /*  938 */
-    0x4e56ce8c, /*  939 */
-    0x4e5dec6b, /*  940 */
-    0x4e6508ff, /*  941 */
-    0x4e6c2449, /*  942 */
-    0x4e733e4a, /*  943 */
-    0x4e7a5702, /*  944 */
-    0x4e816e71, /*  945 */
-    0x4e888498, /*  946 */
-    0x4e8f9979, /*  947 */
-    0x4e96ad13, /*  948 */
-    0x4e9dbf67, /*  949 */
-    0x4ea4d075, /*  950 */
-    0x4eabe03e, /*  951 */
-    0x4eb2eec4, /*  952 */
-    0x4eb9fc05, /*  953 */
-    0x4ec10803, /*  954 */
-    0x4ec812bf, /*  955 */
-    0x4ecf1c39, /*  956 */
-    0x4ed62471, /*  957 */
-    0x4edd2b68, /*  958 */
-    0x4ee4311f, /*  959 */
-    0x4eeb3596, /*  960 */
-    0x4ef238cd, /*  961 */
-    0x4ef93ac6, /*  962 */
-    0x4f003b81, /*  963 */
-    0x4f073afe, /*  964 */
-    0x4f0e393f, /*  965 */
-    0x4f153642, /*  966 */
-    0x4f1c320a, /*  967 */
-    0x4f232c96, /*  968 */
-    0x4f2a25e8, /*  969 */
-    0x4f311dff, /*  970 */
-    0x4f3814dc, /*  971 */
-    0x4f3f0a80, /*  972 */
-    0x4f45feeb, /*  973 */
-    0x4f4cf21f, /*  974 */
-    0x4f53e41a, /*  975 */
-    0x4f5ad4de, /*  976 */
-    0x4f61c46c, /*  977 */
-    0x4f68b2c4, /*  978 */
-    0x4f6f9fe6, /*  979 */
-    0x4f768bd3, /*  980 */
-    0x4f7d768c, /*  981 */
-    0x4f846011, /*  982 */
-    0x4f8b4862, /*  983 */
-    0x4f922f81, /*  984 */
-    0x4f99156d, /*  985 */
-    0x4f9ffa27, /*  986 */
-    0x4fa6ddb0, /*  987 */
-    0x4fadc008, /*  988 */
-    0x4fb4a12f, /*  989 */
-    0x4fbb8127, /*  990 */
-    0x4fc25ff0, /*  991 */
-    0x4fc93d8a, /*  992 */
-    0x4fd019f5, /*  993 */
-    0x4fd6f533, /*  994 */
-    0x4fddcf43, /*  995 */
-    0x4fe4a827, /*  996 */
-    0x4feb7fde, /*  997 */
-    0x4ff2566a, /*  998 */
-    0x4ff92bca, /*  999 */
-    0x50000000, /* 1000 */
-    0x5006d30b, /* 1001 */
-    0x500da4ed, /* 1002 */
-    0x501475a5, /* 1003 */
-    0x501b4535, /* 1004 */
-    0x5022139c, /* 1005 */
-    0x5028e0dc, /* 1006 */
-    0x502facf4, /* 1007 */
-    0x503677e5, /* 1008 */
-    0x503d41b0, /* 1009 */
-    0x50440a55, /* 1010 */
-    0x504ad1d5, /* 1011 */
-    0x50519830, /* 1012 */
-    0x50585d67, /* 1013 */
-    0x505f217a, /* 1014 */
-    0x5065e469, /* 1015 */
-    0x506ca635, /* 1016 */
-    0x507366df, /* 1017 */
-    0x507a2667, /* 1018 */
-    0x5080e4cd, /* 1019 */
-    0x5087a212, /* 1020 */
-    0x508e5e37, /* 1021 */
-    0x5095193c, /* 1022 */
-    0x509bd320, /* 1023 */
-    0x50a28be6, /* 1024 */
-};
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
diff --git a/media/libstagefright/codecs/aacdec/iquant_table.h b/media/libstagefright/codecs/aacdec/iquant_table.h
deleted file mode 100644
index dadc3d0..0000000
--- a/media/libstagefright/codecs/aacdec/iquant_table.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: iquant_table.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for iquant_table.c, which contains a table used with
- esc_iquant.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef IQUANT_TABLE_H
-#define IQUANT_TABLE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-extern const UInt32 inverseQuantTable[];
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/long_term_prediction.cpp b/media/libstagefright/codecs/aacdec/long_term_prediction.cpp
deleted file mode 100644
index 69e4c46..0000000
--- a/media/libstagefright/codecs/aacdec/long_term_prediction.cpp
+++ /dev/null
@@ -1,648 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: long_term_prediction.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Made changes based on comments and experiment results.
-
- Description: Passed in buffer sizes based on review comments and prototype
-              agreements.
-
- Description: 1. Passed in "weight_index" instead of "weight".
-              2. Added weight table.
-
- Description: 1. Removed some passed in buffer size variables since they are
-                 not used for long window.
-              2. Modified comments format.
-
- Description:
-    Modified casting to ensure proper operations for different platforms
-
- Description:
-    Implemented circular buffer techniques, which save 4096 memmoves per
-    frame.
-
- Description:
-    Implemented some optimizations found during the code review of this
-    module.  The optimizations related to the rules on the range of
-    ltp_buffer_index and num_samples, which allows for a simpler
-    code construct to be used in the processing of the predicted samples.
-
- Description:
-    Add max calculation on the filter implementation, this to eliminate
-    function buffer_adaptation() on the time to frequency transformation.
-    Function interface changed. It now return the amount of shifting needed
-    to garb only the top 16 MSB.
-
- Description:
-     Replace clearing memory with for-loop with pvmemset function
-
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    win_seq = type of window sequence (WINDOW_SEQUENCE).
-
-    weight_index = index (Int) of LTP coefficient table for all windows in
-                   current frame.
-
-    delay = buffer (Int) containing delays for each window.
-
-    buffer = history buffer (Int16) containing the reconstructed time domain
-             signals of previous frames.
-
-    buffer_offset = value (Int) that indicates the location of the first
-                    element in the LTP circular buffer.  (Either 0 or 1024)
-
-    time_quant    = filterbank buffer (Int32) This buffer is used by the
-                    filterbank, but it's first 1024 elements are equivalent
-                    to the last 1024 elements in the conventionally
-                    implemented LTP buffer.  Using this buffer directly avoids
-                    costly duplication of memory.
-
-    predicted_samples = buffer (Int32) with length of 2048 to hold
-                        predicted time domain signals.
-
-    buffer_index = index into buffer where the first sample of data from
-                   the frame (t-2) (two frames ago) resides.  (Int)
-
-    frame_length = length of one frame, type of Int.
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    Amount of shifting needed to grab the top 16 MSB from teh predicted buffer
-
- Pointers and Buffers Modified:
-    predicted_samples contents are the newly calculated predicted time
-    domain signals
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- Long term prediction (LTP) is used to reduce the redundancy of a signal
- between successive coding frames. This function performs prediction by
- applying 1-tap IIR filtering to calculate the predicted time domain
- signals of current frame from previous reconstructed frames stored in
- time domain history buffer.
-
- The equation used for IIR filter is as following.
-
-            y(n) = weight * x(n - delay)
-
-    where   y(n) ----- predicted time domain signals
-            x(n) ----- reconstructed time domain signals
-            weight ----- LTP coefficient
-            delay ----- optimal delay from 0 to 2047
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- None
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3: Audio
-        Subpart 4.6.6   Long Term Prediction (LTP)
-
- (2) MPEG-2 NBC Audio Decoder
-     "This software module was originally developed by Nokia in the course
-     of development of the MPEG-2 AAC/MPEG-4 Audio standard ISO/IEC13818-7,
-     14496-1, 2 and 3. This software module is an implementation of a part
-     of one or more MPEG-2 AAC/MPEG-4 Audio tools as specified by the MPEG-2
-     aac/MPEG-4 Audio standard. ISO/IEC  gives users of the MPEG-2aac/MPEG-4
-     Audio standards free license to this software module or modifications
-     thereof for use in hardware or software products claiming conformance
-     to the MPEG-2 aac/MPEG-4 Audio  standards. Those intending to use this
-     software module in hardware or software products are advised that this
-     use may infringe existing patents. The original developer of this
-     software module, the subsequent editors and their companies, and ISO/IEC
-     have no liability for use of this software module or modifications
-     thereof in an implementation. Copyright is not released for non MPEG-2
-     aac/MPEG-4 Audio conforming products. The original developer retains
-     full right to use the code for the developer's own purpose, assign or
-     donate the code to a third party and to inhibit third party from using
-     the code for non MPEG-2 aac/MPEG-4 Audio conforming products. This
-     copyright notice must be included in all copies or derivative works.
-     Copyright (c)1997.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pPredicted_samples = &predicted_samples[0];
-
-    weight = codebook[weight_index];
-
-    IF (win_seq != EIGHT_SHORT_SEQUENCE)
-    THEN
-
-        block_length = frame_length << 1;
-
-        lag = delay[0];
-
-        j = block_length - lag;
-
-        IF (lag < frame_length)
-        THEN
-
-            num_samples = frame_length + lag;
-
-        ELSE
-
-            num_samples = block_length;
-
-        ENDIF
-
-        pBuffer = &buffer[j];
-
-        FOR (i = num_samples; i>0; i--)
-
-            *pPredicted_samples = weight * (*pBuffer);
-            pPredicted_samples = pPredicted_samples + 1;
-            pBuffer = pBuffer + 1;
-
-        ENDFOR
-
-        FOR (i = block_length - num_samples; i>0; i--)
-
-            *pPredicted_samples = 0;
-            pPredicted_samples = pPredicted_samples + 1;
-
-        ENDFOR
-
-    ELSE
-
-        FOR (wnd = 0; wnd < short_window_num; wnd++)
-
-            IF (win_prediction_used[wnd] != FALSE)
-            THEN
-
-                delay[wnd] = delay[0] + ltp_short_lag[wnd];
-
-                lag = delay[wnd];
-
-                j = wnd*short_block_length - lag;
-
-                IF (lag < short_frame_length)
-                THEN
-
-                    num_samples = short_frame_length + lag;
-
-                ELSE
-
-                    num_samples = short_block_length;
-
-                ENDIF
-
-                pBuffer = &buffer[j];
-
-                FOR (i = num_samples; i>0; i--)
-
-                    *pPredicted_samples = weight * (*pBuffer);
-                    pPredicted_samples = pPredicted_samples + 1;
-                    pBuffer = pBuffer + 1;
-
-                ENDFOR
-
-                FOR (i = short_block_length - num_samples; i>0; i--)
-
-                    *pPredicted_samples = 0;
-                    pPredicted_samples = pPredicted_samples + 1;
-
-                ENDFOR
-
-            ELSE
-
-                CALL pv_memset(
-                        pPredicted_samples,
-                        0,
-                        sizeof(*pPredicted_samples)*short_block_length);
-                MODIFYING (predicted_samples[]);
-
-                pPredicted_samples = pPredicted_samples + short_block_length;
-
-            ENDIF [ IF (win_prediction_used[wnd] != FALSE) ]
-
-        ENDFOR [ FOR (wnd=0; wnd<short_window_num; wnd++) ]
-
-    ENDIF [ IF (win_seq != EIGHT_SHORT_SEQUENCE) ]
-
-    RETURN
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_window_sequence.h"
-#include "ltp_common_internal.h"
-#include "long_term_prediction.h"
-#include "aac_mem_funcs.h"
-#include "pv_normalize.h"
-#include "window_block_fxp.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-/* Purpose: Codebook for LTP weight coefficients. Stored in Q15 format */
-const UInt codebook[CODESIZE] =
-{
-    18705,  /* 0 */
-    22827,  /* 1 */
-    26641,  /* 2 */
-    29862,  /* 3 */
-    32273,  /* 4 */
-    34993,  /* 5 */
-    39145,  /* 6 */
-    44877   /* 7 */
-};
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int long_term_prediction(
-    WINDOW_SEQUENCE     win_seq,
-    const Int           weight_index,
-    const Int           delay[],
-    const Int16         buffer[],
-    const Int           buffer_offset,
-    const Int32         time_quant[],
-    Int32         predicted_samples[],    /* Q15 */
-    const Int           frame_length)
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-    /*
-     * Window index
-     *
-     * Int wnd;
-     *
-     * will be enabled when short window information is available.
-     */
-
-    /* Pointer to time domain history buffer */
-
-    const Int16 *pBuffer;
-
-    const Int32 *pTimeQuant = time_quant;
-
-    /* Pointer to array containing predicted samples */
-    Int32 *pPredicted_samples;
-
-    Int32   test;
-    Int32   datum;
-
-    /* IIR coefficient with Q15 format */
-    UInt    weight;
-
-    /* Length of one block (two frames) */
-    Int     block_length;
-
-    Int     shift;
-    Int     k;
-    Int     ltp_buffer_index;
-    Int     jump_point;
-    Int     lag;
-    Int     num_samples;
-
-    Int32   max = 0;
-
-    /*----------------------------------------------------------------------------
-    ; Function body here
-    ----------------------------------------------------------------------------*/
-    /* Initialize pointers */
-    pPredicted_samples = &predicted_samples[0];
-
-    weight = codebook[weight_index];
-
-    /****************************************/
-    /* LTP decoding process for long window */
-    /****************************************/
-
-    if (win_seq != EIGHT_SHORT_SEQUENCE)
-    {
-        /****************************************************/
-        /* Prediction based on previous time domain signals */
-        /****************************************************/
-        block_length = frame_length << 1;
-
-        /* Calculate time lag for 1-tap IIR filter */
-        lag = delay[0];
-
-        ltp_buffer_index = block_length - lag;
-
-        /* Calculate number of samples used in IIR filter */
-        if (lag < frame_length)
-        {
-            num_samples = frame_length + lag;
-        }
-        else
-        {
-            num_samples = block_length;
-        }
-
-
-        /*
-         * Calculate the predicted time domain signals from the
-         * reconstructed time domain signals of previous frames.
-         */
-
-        /* The data is stored in TWO buffers, either as...
-         *
-         *                                       [   t ==  0  ]
-         *
-         * [   t == -1   ][   t == -2   ]
-         *
-         * OR...
-         *                                       [   t ==  0  ]
-         *
-         * [   t == -2   ][   t == -1   ]
-         *
-         *
-         *
-         * In the first case, all of the buffers are non-contiguous,
-         * and each must be handled separately.  Code for this first case
-         * will function correctly for both cases.
-         *
-         * In the second case, the buffers storing t == -2, and t == -1
-         * data are contiguous, and an optimization could take advantage
-         * of this, at the cost of an increase in code size for this function.
-         */
-
-        /* Decrement block_length by num_samples.  This is important
-         * for the loop at the end of the "ACCESS DATA IN THE LTP BUFFERS"
-         * section that sets all remaining samples in the block to zero.
-         */
-
-        block_length -= num_samples;
-
-
-
-
-
-
-        /*
-         ************************************ ACCESS DATA IN THE LTP BUFFERS
-         */
-
-        /*
-         * This section of the code handles the t == -2
-         * buffer, which corresponds to 0 <= ltp_buffer_index < 1024
-         *
-         * BUFFER t == -2
-         *
-         * [0][][][][][][][][][][][...][][][][][][][][][][][][1023]
-         *
-         */
-
-        jump_point = (frame_length - ltp_buffer_index);
-
-        if (jump_point > 0)
-        {
-            pBuffer = &(buffer[ltp_buffer_index + buffer_offset]);
-
-            for (k = jump_point; k > 0; k--)
-            {
-                /* Q15 = Q15 * Q0 */
-                test = (Int32) weight * (*(pBuffer++));
-                *(pPredicted_samples++) =  test;
-                max                   |= (test >> 31) ^ test;
-            }
-
-            num_samples -= jump_point;
-
-            ltp_buffer_index += jump_point;
-        }
-
-        /*
-         * This section of the code handles the t == -1
-         * buffer, which corresponds to 1024 <= ltp_buffer_index < 2048
-         *
-         * BUFFER t == -1
-         *
-         * [1024][][][][][][][][][][][...][][][][][][][][][][][][2047]
-         *
-         */
-
-        jump_point = 2 * frame_length - ltp_buffer_index;
-
-        pBuffer = &(buffer[ltp_buffer_index - buffer_offset]);
-
-        if (num_samples < jump_point)
-        {
-            jump_point = num_samples;
-        }
-
-        for (k = jump_point; k > 0; k--)
-        {
-            /* Q15 = Q15 * Q0 */
-            test = (Int32) weight * (*(pBuffer++));
-            *(pPredicted_samples++) =  test;
-            max                   |= (test >> 31) ^ test;
-        }
-
-        num_samples -= jump_point;
-
-        ltp_buffer_index += jump_point;
-
-        /*
-         * This section of the code handles the t == 0
-         * buffer, which corresponds to 2048 <= ltp_buffer_index < 3072
-         *
-         * BUFFER t == 0
-         *
-         * [2048][][][][][][][][][][][...][][][][][][][][][][][][3071]
-         *
-         */
-        for (k = num_samples; k > 0; k--)
-        {
-
-            datum = *(pTimeQuant++) >> SCALING;
-
-            /*
-             * Limit the values in the 32-bit filterbank's buffer to
-             * 16-bit resolution.
-             *
-             * Value's greater than 32767 or less than -32768 are saturated
-             * to 32767 and -32768, respectively.
-             */
-
-            test                    = (Int32)datum * weight;
-            *(pPredicted_samples++) =  test;
-            max                    |= (test >> 31) ^ test;
-
-        }
-
-        /* Set any remaining samples in the block to 0. */
-
-        pv_memset(
-            pPredicted_samples,
-            0,
-            block_length*sizeof(*pPredicted_samples));
-
-    } /* if (win_seq != EIGHT_SHORT_SEQUENCE) */
-
-
-    /*****************************************/
-    /* LTP decoding process for short window */
-    /*****************************************/
-
-    /*
-     * For short window LTP, since there is no "ltp_short_lag"
-     * information being passed, the following code for short
-     * window LTP will be applied in the future when those
-     * information are available.
-     */
-
-    /*
-     *----------------------------------------------------------------------------
-     *  else
-     *  {
-     *      for (wnd = 0; wnd < short_window_num; wnd++)
-     *      {
-     *          if (win_prediction_used[wnd] != FALSE)
-     *          {
-     *              delay[wnd] = delay[0] + ltp_short_lag[wnd];
-     *
-     *              lag = delay[wnd];
-     *
-     *              j = wnd*short_block_length - lag;
-     *
-     *              if (lag < short_frame_length)
-     *              {
-     *                  num_samples = short_frame_length + lag;
-     *              }
-     *              else
-     *              {
-     *                  num_samples = short_block_length;
-     *              }
-     *
-     *              pBuffer = &buffer[j];
-     *
-     *              for(i = num_samples; i>0; i--)
-     *              {
-     *                  *(pPredicted_samples++) = weight * (*(pBuffer++));
-     *              }
-     *
-     *              for(i = short_block_length - num_samples; i>0; i--)
-     *              {
-     *                  *(pPredicted_samples++) = 0;
-     *              }
-     *          }
-     *          else
-     *          {
-     *              pv_memset(
-     *                  pPredicted_samples,
-     *                  0,
-     *                  sizeof(*pPredicted_samples)*short_block_length);
-     *
-     *              pPredicted_samples += short_block_length;
-     *          }
-     *      }
-     *  }
-     *----------------------------------------------------------------------------
-     */
-
-    shift = 16 - pv_normalize(max);
-
-    if (shift < 0)
-    {
-        shift = 0;
-    }
-
-    /*----------------------------------------------------------------------------
-    ; Return nothing or data or data pointer
-    ----------------------------------------------------------------------------*/
-    return (shift);
-} /* long_term_prediction */
-
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/long_term_prediction.h b/media/libstagefright/codecs/aacdec/long_term_prediction.h
deleted file mode 100644
index 014934b..0000000
--- a/media/libstagefright/codecs/aacdec/long_term_prediction.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: long_term_prediction.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modified prototype with array size passed in per review
-              comments.
-
- Description: Changed prototype with "weight_index" instead of "weight".
-
- Description: Removed some passed in buffer size variables since they are
-              not being used for long window.
-
- Description: Temporarily define LTP_Q_FORMAT for current release.
-              Need to change function prototype and pass out Q_format
-              information later.
-
- Description: Updated function prototype to reflect the usage of a
- circular buffer by LTP.
-
- Description:  Updated function interface with new return type
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file includes function prototype declaration for long_term_prediction().
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef LONG_TERM_PREDICTION_H
-#define LONG_TERM_PREDICTION_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_window_sequence.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define LTP_Q_FORMAT    (15)
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-    Int long_term_prediction(
-        WINDOW_SEQUENCE     win_seq,
-        const Int           weight_index,
-        const Int           delay[],
-        const Int16         buffer[],
-        const Int           buffer_offset,
-        const Int32         time_quant[],
-        Int32               predicted_samples[],    /* Q15 */
-        const Int           frame_length);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/long_term_synthesis.cpp b/media/libstagefright/codecs/aacdec/long_term_synthesis.cpp
deleted file mode 100644
index c361db1..0000000
--- a/media/libstagefright/codecs/aacdec/long_term_synthesis.cpp
+++ /dev/null
@@ -1,1158 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: long_term_synthesis.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Made the following changes based on the review comments.
-              1. Separated "shift_factor>=0" on line 395 to "shift_factor>0"
-                 and "shift_factor=0" two cases.
-              2. Added comments on line 393 to explain why factor 2 is being
-                 used to calculate shift_factor.
-              3. Added comments for short window implementation.
-              4. Changed "*(pPredicted_spectral++) = *pPredicted_spectral>>2"
-                 to "*(pPredicted++)>>=2" although they are the same.
-              5. Changed pseudo code "X+=Y" to "X=X+Y".
-              6. Fixed ending comment of "for" loop.
-              7. Passed in the size of the array and deleted some of the
-                 include files.
-
- Description: Unroll the loops.
-
- Description: Changed index "wnd" in previous line 584 with "wnd_offset"
-              and made other correspondent changes to the code.
-
-
- Description: Based on Ken's suggestion, modified the function with the
-              passing-in Q format as scalefactor band basis in order to
-              simplify TNS block functions.
-
- Description: Optimization.
-
- Description: Made changes based on review comments.
-              1. Changed misspellings.
-              2. Changed win_sfb_top[] from two dimensional array to one
-              dimensional array and correspondently changed the code.
-              3. Changed function prototype to remove some redundant
-              informations.
-              4. Fixed the adjusting Q format part code.
-              5. Fixed lines 825, 826 with correct updating pointers.
-
- Description: Due to TNS and LTP Q format issue, added code to adjust
-              predicted_spectral() to maximum resolution before perform
-              long term synthesis.
-
- Description: Modified based on review comments.
-
- Description: Changed "max" data type from UInt to UInt32.
-
- Description: Changed so that nothing is done for the case of "all zero"
- data coming from the output of Trans4m_time_2_freq. Also, included more
- efficient calculation of the abs(x).  And, I updated the pseudocode.
-
- Description: Use an auxiliary variable temp, to avoid using the same
-    pointer and a post-increment pointer in the same line. This may not
-    work with all compilers.
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    win_seq = type of window sequence (WINDOW_SEQUENCE).
-    sfb_per_win = number of scalefactor bands for each window, 1024 for
-                  long window, 128 for short window, type of Int.
-    win_sfb_top = buffer (Int16) containing the top coefficient per
-                  scalefactor band for each window.
-    win_prediction_used = buffer (Int) containing the prediction flag
-                          information for short windows. Each item in the
-                          buffer toggles prediction on(1)/off(0) for each
-                          window separately.
-    sfb_prediction_used = buffer (Int) containing the prediction flag
-                          information for scalefactor band(sfb). Each item
-                          toggle prediction on(1)/off(0) on each scalefactor
-                          band of every window.
-    current_frame = channel buffer (Int32) containing the dequantized
-                    spectral coefficients or errors of current frame.
-    q_format = buffer (Int) containing Q format for each scalefactor band of
-               input current_frame.
-    predicted_spectral = buffer (Int32) containing predicted spectral
-                         components of current frame.
-    pred_q_format = Q format (Int) for predicted spectral components of
-                    current frame.
-    coef_per_win = number of coefficients per window for short windows.
-                   type of Int.
-    short_window_num = number of short windows, type of Int.
-    reconstruct_sfb_num = number of scalefactor bands used for reconstruction
-                          for short windows, type of Int.
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    current_frame contents are the dequantized spectrum with a prediction
-    vector added when prediction is turned on.
-
-    q_format contents are updated with the new Q format (Int) for each
-    scalefactor band of output current_frame buffer.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function performs long term synthesis using transmitted spectral
- coeffients or errors and predicted spectral components.
-
- Long term synthesis is part of long term prediction (LTP) which is used to
- reduce the redundancy of a signal between successive coding frames. The
- functionality of long term synthesis is to reconstruct the frequency domain
- spectral by adding the predicted spectral components and the transmitted
- spectral error when prediction is turned on.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- None
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3: Audio
-        Subpart 4.6.6   Long Term Prediction (LTP)
-
- (2) MPEG-2 NBC Audio Decoder
-     "This software module was originally developed by Nokia in the course
-     of development of the MPEG-2 AAC/MPEG-4 Audio standard ISO/IEC13818-7,
-     14496-1, 2 and 3. This software module is an implementation of a part
-     of one or more MPEG-2 AAC/MPEG-4 Audio tools as specified by the MPEG-2
-     aac/MPEG-4 Audio standard. ISO/IEC  gives users of the MPEG-2aac/MPEG-4
-     Audio standards free license to this software module or modifications
-     thereof for use in hardware or software products claiming conformance
-     to the MPEG-2 aac/MPEG-4 Audio  standards. Those intending to use this
-     software module in hardware or software products are advised that this
-     use may infringe existing patents. The original developer of this
-     software module, the subsequent editors and their companies, and ISO/IEC
-     have no liability for use of this software module or modifications
-     thereof in an implementation. Copyright is not released for non MPEG-2
-     aac/MPEG-4 Audio conforming products. The original developer retains
-     full right to use the code for the developer's own purpose, assign or
-     donate the code to a third party and to inhibit third party from using
-     the code for non MPEG-2 aac/MPEG-4 Audio conforming products. This
-     copyright notice must be included in all copies or derivative works.
-     Copyright (c)1997.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pPredicted_spectral = &predicted_spectral[0];
-    pPredicted_spectral_start = pPredicted_spectral;
-    pSfb_prediction_used = &sfb_prediction_used[0];
-
-    IF (win_seq != EIGHT_SHORT_SEQUENCE)
-    THEN
-
-        sfb_offset = 0;
-
-        pWinSfbTop = &pWin_sfb_top[0];
-
-        pQ_format = &q_format[0];
-
-        FOR (i = sfb_per_frame; i>0; i--)
-
-            IF (*(pSfb_prediction_used++) != FALSE)
-            THEN
-
-                pPredicted_offset = pPredicted_spectral_start +
-                                                            sfb_offset;
-                pCurrent_frame = &current_frame[sfb_offset];
-
-                quarter_sfb_width = (*pWinSfbTop - sfb_offset) >> 2;
-
-                max = 0;
-
-                pPredicted_spectral = pPredicted_offset;
-
-                FOR (j = (*pWinSfbTop - sfb_offset); j>0 ; j--)
-
-                    tmpInt32 = *(pPredicted_spectral++);
-
-                    IF (tmpInt32 < 0)
-                    THEN
-
-                        tmpInt32 = -tmpInt32;
-
-                    ENDIF
-
-                    max |= tmpInt32;
-
-                ENDFOR
-
-                tmpInt = 0;
-
-                IF (max != 0)
-                THEN
-
-                    WHILE (max < 0x40000000L)
-
-                        max <<= 1;
-                        tmpInt++;
-
-                    ENDWHILE
-
-                    pPredicted_spectral = pPredicted_offset;
-
-                    FOR (j = quarter_sfb_width; j>0 ; j--)
-
-                        *(pPredicted_spectral++) <<= tmpInt;
-                        *(pPredicted_spectral++) <<= tmpInt;
-                        *(pPredicted_spectral++) <<= tmpInt;
-                        *(pPredicted_spectral++) <<= tmpInt;
-
-                    ENDFOR
-
-                    adjusted_pred_q = pred_q_format + tmpInt;
-
-                    pPredicted_spectral = pPredicted_offset;
-
-                    shift_factor = *(pQ_format) - adjusted_pred_q;
-
-                    IF ((shift_factor >= 0) && (shift_factor < 31))
-                    THEN
-
-                        shift_factor = shift_factor + 1;
-
-                        FOR (j = quarter_sfb_width; j>0 ; j--)
-
-                            *(pCurrent_frame++) =
-                                (*pCurrent_frame>>shift_factor)
-                              + (*(pPredicted_spectral++)>>1);
-                            *(pCurrent_frame++) =
-                                (*pCurrent_frame>>shift_factor)
-                              + (*(pPredicted_spectral++)>>1);
-                            *(pCurrent_frame++) =
-                                (*pCurrent_frame>>shift_factor)
-                              + (*(pPredicted_spectral++)>>1);
-                            *(pCurrent_frame++) =
-                                (*pCurrent_frame>>shift_factor)
-                              + (*(pPredicted_spectral++)>>1);
-
-                        ENDFOR
-
-                        *(pQ_format) = adjusted_pred_q - 1;
-
-                    ELSEIF (shift_factor >= 31)
-                    THEN
-
-                        FOR (j = quarter_sfb_width; j>0 ; j--)
-
-                            *(pCurrent_frame++) = *(pPredicted_spectral++);
-                            *(pCurrent_frame++) = *(pPredicted_spectral++);
-                            *(pCurrent_frame++) = *(pPredicted_spectral++);
-                            *(pCurrent_frame++) = *(pPredicted_spectral++);
-
-                        ENDFOR
-
-                        *(pQ_format) = adjusted_pred_q;
-
-                    ELSEIF ((shift_factor < 0) && (shift_factor > -31))
-                    THEN
-
-                        shift_factor = 1 - shift_factor;
-
-                        FOR (j = quarter_sfb_width; j>0 ; j--)
-
-                            *(pCurrent_frame++) = (*pCurrent_frame>>1) +
-                                (*(pPredicted_spectral++)>>shift_factor);
-                            *(pCurrent_frame++) = (*pCurrent_frame>>1) +
-                                (*(pPredicted_spectral++)>>shift_factor);
-                            *(pCurrent_frame++) = (*pCurrent_frame>>1) +
-                                (*(pPredicted_spectral++)>>shift_factor);
-                            *(pCurrent_frame++) = (*pCurrent_frame>>1) +
-                                (*(pPredicted_spectral++)>>shift_factor);
-
-                        ENDFOR
-
-                        *(pQ_format) = *(pQ_format) - 1;
-
-                    ENDIF
-
-                ENDIF
-
-            ENDIF [ IF (*(pSfb_prediction_used++) != FALSE) ]
-
-            sfb_offset = *pWinSfbTop;
-            pWinSfbTop = pWinSfbTop + 1;
-            pQ_format = pQ_format + 1;
-
-        ENDFOR [ FOR (i = sfb_per_frame; i>0; i--) ]
-
-    ELSE
-
-        pCurrent_frame_start = &current_frame[0];
-
-        pQ_format_start = &q_format[0];
-
-        num_sfb = sfb_per_win[0];
-
-        FOR (wnd=0; wnd<short_window_num; wnd++)
-
-            pWinSfbTop = &pWin_sfb_top[0];
-
-            pQ_format = pQ_format_start;
-
-            IF (win_prediction_used[wnd] != FALSE)
-            THEN
-
-                sfb_offset = 0;
-
-                FOR (i = reconstruct_sfb_num; i > 0; i--)
-
-                    pPredicted_offset = pPredicted_spectral_start +
-                                                                sfb_offset;
-                    pCurrent_frame = pCurrent_frame_start + sfb_offset;
-
-                    quarter_sfb_width = (*pWinSfbTop - sfb_offset) >> 2;
-
-                    max = 0;
-
-                    pPredicted_spectral = pPredicted_offset;
-
-                    FOR (j = (*pWinSfbTop - sfb_offset); j>0 ; j--)
-
-                        tmpInt32 = *(pPredicted_spectral++);
-
-                        IF (tmpInt32 < 0)
-                        THEN
-
-                            tmpInt32 = -tmpInt32;
-
-                        ENDIF
-
-                        max |= tmpInt32;
-
-                    ENDFOR
-
-                    tmpInt = 0;
-
-                    IF (max != 0)
-                    THEN
-
-                        WHILE (max < 0x40000000L)
-
-                            max <<= 1;
-                            tmpInt++;
-
-                        ENDWHILE
-
-
-                        pPredicted_spectral = pPredicted_offset;
-
-                        FOR (j = quarter_sfb_width; j>0 ; j--)
-
-                            *(pPredicted_spectral++) <<= tmpInt;
-                            *(pPredicted_spectral++) <<= tmpInt;
-                            *(pPredicted_spectral++) <<= tmpInt;
-                            *(pPredicted_spectral++) <<= tmpInt;
-
-                        ENDFOR
-
-                        adjusted_pred_q = pred_q_format + tmpInt;
-
-                        pPredicted_spectral = pPredicted_offset;
-
-                        shift_factor = *(pQ_format) - adjusted_pred_q;
-
-                        IF ((shift_factor >= 0) && (shift_factor < 31))
-                        THEN
-
-                            shift_factor = shift_factor + 1;
-
-                            FOR (j = quarter_sfb_width; j>0 ; j--)
-
-                                *(pCurrent_frame++) =
-                                    (*pCurrent_frame>>shift_factor) +
-                                                (*(pPredicted_spectral++)>>1);
-                                *(pCurrent_frame++) =
-                                    (*pCurrent_frame>>shift_factor) +
-                                                (*(pPredicted_spectral++)>>1);
-                                *(pCurrent_frame++) =
-                                    (*pCurrent_frame>>shift_factor) +
-                                                (*(pPredicted_spectral++)>>1);
-                                *(pCurrent_frame++) =
-                                    (*pCurrent_frame>>shift_factor) +
-                                                (*(pPredicted_spectral++)>>1);
-
-                            ENDFOR
-
-                            *(pQ_format) = adjusted_pred_q - 1;
-
-                        ELSEIF (shift_factor >= 31)
-                        THEN
-
-                            FOR (j = quarter_sfb_width; j>0 ; j--)
-
-                                *(pCurrent_frame++) = *(pPredicted_spectral++);
-                                *(pCurrent_frame++) = *(pPredicted_spectral++);
-                                *(pCurrent_frame++) = *(pPredicted_spectral++);
-                                *(pCurrent_frame++) = *(pPredicted_spectral++);
-
-                            ENDFOR
-
-                            *(pQ_format) = adjusted_pred_q;
-
-                        ELSEIF ((shift_factor < 0) && (shift_factor > -31))
-                        THEN
-
-                            shift_factor = 1 - shift_factor;
-
-                            FOR (j = quarter_sfb_width; j>0 ; j--)
-
-                                *(pCurrent_frame++) = (*pCurrent_frame>>1) +
-                                    (*(pPredicted_spectral++)>>shift_factor);
-                                *(pCurrent_frame++) = (*pCurrent_frame>>1) +
-                                    (*(pPredicted_spectral++)>>shift_factor);
-                                *(pCurrent_frame++) = (*pCurrent_frame>>1) +
-                                    (*(pPredicted_spectral++)>>shift_factor);
-                                *(pCurrent_frame++) = (*pCurrent_frame>>1) +
-                                    (*(pPredicted_spectral++)>>shift_factor);
-
-                            ENDFOR
-
-                            *(pQ_format) = *(pQ_format) - 1;
-
-                        ENDIF
-
-                    ENDIF
-
-                    sfb_offset = *pWinSfbTop;
-                    pWinSfbTop = pWinSfbTop + 1;
-                    pQ_format = pQ_format + 1;
-
-                ENDFOR [ FOR (i = reconstruct_sfb_num; i > 0; i--) ]
-
-            ENDIF [ IF (win_prediction_used[wnd] != FALSE) ]
-
-            pPredicted_spectral_start = pPredicted_spectral_start + num_sfb;
-            pCurrent_frame_start = pCurrent_frame_start + num_sfb;
-            wnd_offset = wnd_offset + num_sfb;
-            pQ_format_start = pQ_format_start + num_sfb;
-
-        ENDFOR [ FOR (wnd=0; wnd<short_window_num; wnd++) ]
-
-    ENDIF [ IF (win_seq != EIGHT_SHORT_SEQUENCE) ]
-
-    RETURN
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_window_sequence.h"
-#include "long_term_synthesis.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void long_term_synthesis(
-    WINDOW_SEQUENCE     win_seq,
-    Int                 sfb_per_win,
-    Int16               win_sfb_top[],
-    Int                 win_prediction_used[],
-    Int                 sfb_prediction_used[],
-    Int32               current_frame[],
-    Int                 q_format[],         /* for each sfb */
-    Int32               predicted_spectral[],
-    Int                 pred_q_format,      /* for predicted_spectral[] */
-    Int                 coef_per_win,
-    Int                 short_window_num,
-    Int                 reconstruct_sfb_num)
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-    /* Scalefactor band offset */
-    Int sfb_offset;
-
-    /* Window index */
-    Int wnd;
-
-    /* Pointer to array containing predicted samples */
-    Int32 *pPredicted_spectral;
-
-    /* Pointer to the beginning of array containing predicted samples */
-    Int32 *pPredicted_spectral_start;
-
-    Int32 *pPredicted_offset;
-
-    /* Pointer to array containing current spectral components for a channel*/
-    Int32 *pCurrent_frame;
-
-    /* Another pointer to array containing current spectral components */
-    Int32 *pCurrent_frame_start;
-
-    /* Pointer to prediction flag for each scalefactor band */
-    Int *pSfb_prediction_used;
-
-    /* Pointer to top coef per scalefactor band */
-    Int16 *pWinSfbTop;
-
-    /* Pointer to q_format array */
-    Int *pQ_format;
-    Int *pQ_format_start;
-    Int32   temp;
-
-    Int i;
-    Int j;
-
-    Int quarter_sfb_width;
-    Int num_sfb;
-    Int shift_factor;
-
-    UInt32  max;
-    Int32   tmpInt32;
-
-    Int tmpInt;
-    Int adjusted_pred_q;
-    Int pred_shift;
-
-    /*----------------------------------------------------------------------------
-    ; Function body here
-    ----------------------------------------------------------------------------*/
-    /* Initialize pointers */
-    pPredicted_spectral = &predicted_spectral[0];
-    pPredicted_spectral_start = pPredicted_spectral;
-
-    /*
-     * NOTE:
-     * sfb_prediction_used[] start from 0 or 1 depending on nok_lt_decode.c;
-     * currently we agree to make it start from 0;
-     */
-    pSfb_prediction_used = &sfb_prediction_used[0];
-
-    /*********************************/
-    /* LTP synthesis for long window */
-    /*********************************/
-    if (win_seq != EIGHT_SHORT_SEQUENCE)
-    {
-
-        /*******************************************************/
-        /* Reconstruction of current frequency domain spectrum */
-        /*******************************************************/
-
-        /* Initialize scalefactor band offset */
-        sfb_offset = 0;
-
-        /*
-         * Reconstruction is processed on scalefactor band basis.
-         * 1. When prediction is turned on, all the predicted spectral
-         * components will be used for reconstruction.
-         * 2. When prediction is turned off, reconstruction is not
-         * needed. Spectral components of current frame will directly
-         * come from the transmitted data.
-         */
-        pWinSfbTop = &win_sfb_top[0];
-
-        pQ_format = &q_format[0];
-
-        for (i = sfb_per_win; i > 0; i--)
-        {
-            /* Check prediction flag for each scalefactor band. */
-            if (*(pSfb_prediction_used++) != FALSE)
-            {
-                /*
-                 * Prediction is on. Do reconstruction routine.
-                 * Reconstruct spectral component of current
-                 * frame by adding the predicted spectral
-                 * components and the quantized prediction
-                 * errors that reconstructed from transmitted
-                 * data when prediction is turned on.
-                 */
-
-                /* Set pointers to the offset of scalefactor bands */
-                pPredicted_offset = pPredicted_spectral_start +
-                                    sfb_offset;
-                pCurrent_frame = &current_frame[sfb_offset];
-
-                /*
-                 * (*pWinSfbTop - sfb_offset) is number of coefficients
-                 * of the scalefactor band.
-                 * ">>2" is used to set up for later unrolling the loop.
-                 */
-                quarter_sfb_width = (*pWinSfbTop - sfb_offset) >> 2;
-
-                /*
-                 * Adjust pred_q_format and predicted_spectral() to
-                 * maximum resolution.
-                 */
-                max = 0;
-
-                pPredicted_spectral = pPredicted_offset;
-
-                /* Find the maximum absolute value */
-                for (j = (*pWinSfbTop - sfb_offset); j > 0 ; j--)
-                {
-                    tmpInt32 = *(pPredicted_spectral++);
-
-                    /*
-                     * Note: overflow is protected here even though
-                     * tmpInt32 = 0x80000000 is very rare case.
-                     *
-                     *  if (tmpInt32 == LONG_MIN)
-                     *  {
-                     *      tmpInt32 = LONG_MAX;
-                     *  }
-                     *  if (tmpInt32 < 0)
-                     *  {
-                     *      tmpInt32 = -tmpInt32;
-                     *  }
-                     */
-
-                    max |= tmpInt32 ^(tmpInt32 >> 31);
-                }
-
-                /*
-                 * IF the LTP data is all zeros
-                 * (max == 0) - do nothing for this sfb.
-                 */
-
-                if (max != 0)
-                {
-                    /* Find the number of bits to reach the max resolution */
-                    tmpInt = 0;
-
-                    while (max < 0x40000000L)
-                    {
-                        max <<= 1;
-                        tmpInt++;
-                    }
-
-                    /*
-                     * The following codes are combinded into shift factor
-                     * adjusting and reconstruction section.
-                     *
-                     * pPredicted_spectral = pPredicted_offset;
-                     * for(j = quarter_sfb_width; j>0 ; j--)
-                     * {
-                     *      *(pPredicted_spectral++) <<= tmpInt;
-                     *      *(pPredicted_spectral++) <<= tmpInt;
-                     *      *(pPredicted_spectral++) <<= tmpInt;
-                     *      *(pPredicted_spectral++) <<= tmpInt;
-                     * }
-                     *
-                     */
-
-                    /* Adjust Q format for predicted_spectral() */
-                    adjusted_pred_q = pred_q_format + tmpInt;
-
-                    /*
-                     * Adjust Q format to prevent overflow that may occur during
-                     * frequency domain reconstruction.
-                     *
-                     */
-                    pPredicted_spectral = pPredicted_offset;
-
-                    shift_factor = *(pQ_format) - adjusted_pred_q;
-
-                    if ((shift_factor >= 0) && (shift_factor < 31))
-                    {
-                        shift_factor = shift_factor + 1;
-                        pred_shift = tmpInt - 1;
-
-                        if (pred_shift >= 0)
-                        {
-                            for (j = quarter_sfb_width; j > 0 ; j--)
-                            {
-                                temp = *pCurrent_frame >> shift_factor;
-                                *(pCurrent_frame++) = temp
-                                                      + (*(pPredicted_spectral++) << pred_shift);
-                                temp = *pCurrent_frame >> shift_factor;
-                                *(pCurrent_frame++) = temp
-                                                      + (*(pPredicted_spectral++) << pred_shift);
-                                temp = *pCurrent_frame >> shift_factor;
-                                *(pCurrent_frame++) = temp
-                                                      + (*(pPredicted_spectral++) << pred_shift);
-                                temp = *pCurrent_frame >> shift_factor;
-                                *(pCurrent_frame++) = temp
-                                                      + (*(pPredicted_spectral++) << pred_shift);
-                            }
-                        }
-                        else
-                        {
-                            for (j = quarter_sfb_width; j > 0 ; j--)
-                            {
-                                temp = *pCurrent_frame >> shift_factor;
-                                *(pCurrent_frame++) = temp
-                                                      + (*(pPredicted_spectral++) >> 1);
-                                temp = *pCurrent_frame >> shift_factor;
-                                *(pCurrent_frame++) = temp
-                                                      + (*(pPredicted_spectral++) >> 1);
-                                temp = *pCurrent_frame >> shift_factor;
-                                *(pCurrent_frame++) = temp
-                                                      + (*(pPredicted_spectral++) >> 1);
-                                temp = *pCurrent_frame >> shift_factor;
-                                *(pCurrent_frame++) = temp
-                                                      + (*(pPredicted_spectral++) >> 1);
-                            }
-                        }
-
-                        /* Updated new Q format for current scalefactor band */
-                        *(pQ_format) = adjusted_pred_q  - 1;
-                    }
-                    else if (shift_factor >= 31)
-                    {
-                        for (j = quarter_sfb_width; j > 0 ; j--)
-                        {
-                            *(pCurrent_frame++) =
-                                *(pPredicted_spectral++) << tmpInt;
-                            *(pCurrent_frame++) =
-                                *(pPredicted_spectral++) << tmpInt;
-                            *(pCurrent_frame++) =
-                                *(pPredicted_spectral++) << tmpInt;
-                            *(pCurrent_frame++) =
-                                *(pPredicted_spectral++) << tmpInt;
-                        }
-
-                        /* Updated new Q format for current scalefactor band */
-                        *(pQ_format) = adjusted_pred_q ;
-                    }
-                    else if ((shift_factor < 0) && (shift_factor > -31))
-                    {
-                        shift_factor = 1 - shift_factor;
-                        pred_shift = tmpInt - shift_factor;
-
-                        if (pred_shift >= 0)
-                        {
-                            for (j = quarter_sfb_width; j > 0 ; j--)
-                            {
-                                temp = *pCurrent_frame >> 1;
-                                *(pCurrent_frame++) =  temp +
-                                                       (*(pPredicted_spectral++) << pred_shift);
-                                temp = *pCurrent_frame >> 1;
-                                *(pCurrent_frame++) =  temp +
-                                                       (*(pPredicted_spectral++) << pred_shift);
-                                temp = *pCurrent_frame >> 1;
-                                *(pCurrent_frame++) =  temp +
-                                                       (*(pPredicted_spectral++) << pred_shift);
-                                temp = *pCurrent_frame >> 1;
-                                *(pCurrent_frame++) =  temp +
-                                                       (*(pPredicted_spectral++) << pred_shift);
-                            }
-                        }
-                        else
-                        {
-                            pred_shift = -pred_shift;
-
-                            for (j = quarter_sfb_width; j > 0 ; j--)
-                            {
-                                temp = *pCurrent_frame >> 1;
-                                *(pCurrent_frame++) =  temp +
-                                                       (*(pPredicted_spectral++) >> pred_shift);
-                                temp = *pCurrent_frame >> 1;
-                                *(pCurrent_frame++) =  temp +
-                                                       (*(pPredicted_spectral++) >> pred_shift);
-                                temp = *pCurrent_frame >> 1;
-                                *(pCurrent_frame++) =  temp +
-                                                       (*(pPredicted_spectral++) >> pred_shift);
-                                temp = *pCurrent_frame >> 1;
-                                *(pCurrent_frame++) =  temp +
-                                                       (*(pPredicted_spectral++) >> pred_shift);
-                            }
-                        }
-
-                        /*
-                         * Updated new Q format for current scalefactor band
-                         *
-                         * This is NOT a pointer decrement
-                         */
-                        (*pQ_format)--;
-                    }
-
-                } /* if (max != 0) */
-
-                /*
-                 * For case (shift_factor <= -31), *pCurrent_frame and
-                 * *pQ_format do not need to be updated.
-                 */
-
-            } /* if (*(pSfb_prediction_used++) != FALSE) */
-
-            /* Updated to next scalefactor band. */
-            sfb_offset = *(pWinSfbTop++);
-
-            /* Updated pointer to next scalefactor band's Q-format */
-            pQ_format++;
-
-        } /* for (i = sfb_per_frame; i>0; i--) */
-
-    } /* if (win_seq!=EIGHT_SHORT_SEQUENCE) */
-
-    /**********************************/
-    /* LTP synthesis for short window */
-    /**********************************/
-    else
-    {
-        /******************************************************/
-        /*Reconstruction of current frequency domain spectrum */
-        /******************************************************/
-        pCurrent_frame_start = &current_frame[0];
-
-        pQ_format_start = &q_format[0];
-
-        num_sfb = sfb_per_win;
-
-        /* Reconstruction is processed on window basis */
-        for (wnd = 0; wnd < short_window_num; wnd++)
-        {
-            pWinSfbTop = &win_sfb_top[0];
-
-            pQ_format = pQ_format_start;
-
-            /* Check if prediction flag is on for each window */
-            if (win_prediction_used[wnd] != FALSE)
-            {
-                /* Initialize scalefactor band offset */
-                sfb_offset = 0;
-
-                /*
-                 * Reconstruction is processed on scalefactor band basis.
-                 * 1. When prediction is turned on, all the predicted
-                 * spectral components will be used for reconstruction.
-                 * 2. When prediction is turned off, reconstruction is
-                 * not needed. Spectral components of current frame
-                 * will directly come from the transmitted data.
-                 */
-
-                /*
-                 * According to ISO/IEC 14496-3 pg.91
-                 * Only the spectral components in first eight scalefactor
-                 * bands are added to the quantized prediction error.
-                 */
-                for (i = reconstruct_sfb_num; i > 0; i--)
-                {
-                    /* Set pointer to the offset of scalefactor bands */
-                    pPredicted_offset = pPredicted_spectral_start +
-                                        sfb_offset;
-                    pCurrent_frame = pCurrent_frame_start + sfb_offset;
-
-                    /*
-                     * Prediction is on. Do reconstruction routine.
-                     * Reconstruct spectral component of
-                     * current frame by adding the predicted
-                     * spectral components and the quantized
-                     * prediction errors that reconstructed
-                     * from transmitted data when prediction
-                     * is turned on.
-                     */
-
-                    /*
-                     * (*pWinSfbTop - sfb_offset) is number of coefficients
-                     * of the scalefactor band.
-                     * ">>2" is used to set up for later unrolling the loop.
-                     */
-                    quarter_sfb_width = (*pWinSfbTop - sfb_offset) >> 2;
-
-                    /*
-                     * Adjust pred_q_format and predicted_spectral() to
-                     * maximum resolution.
-                     */
-                    max = 0;
-                    pPredicted_spectral = pPredicted_offset;
-
-                    /* Find the maximum absolute value */
-                    for (j = (*pWinSfbTop - sfb_offset); j > 0 ; j--)
-                    {
-                        tmpInt32 = *(pPredicted_spectral++);
-
-
-                        /*
-                         * Note: overflow is protected here even though
-                         * tmpInt32 = 0x80000000 is very rare case.
-                         *
-                         *  if (tmpInt32 == LONG_MIN)
-                         *  {
-                         *      tmpInt32 = LONG_MAX;
-                         *  }
-                         *  if (tmpInt32 < 0)
-                         *  {
-                         *      tmpInt32 = -tmpInt32;
-                         *  }
-                         */
-
-                        max |= tmpInt32 ^(tmpInt32 >> 31);
-                    }
-
-                    if (max != 0)
-                    {
-                        /* Find the number of bits to reach
-                         * the max resolution
-                         */
-                        tmpInt = 0;
-
-                        while (max < 0x40000000L)
-                        {
-                            max <<= 1;
-                            tmpInt++;
-                        }
-                        /*
-                         * The following codes are combined into shift factor
-                         * adjusting and reconstruction section.
-                         *
-                         * pPredicted_spectral = pPredicted_offset;
-                         * for(j = quarter_sfb_width; j>0 ; j--)
-                         * {
-                         *      *(pPredicted_spectral++) <<= tmpInt;
-                         *      *(pPredicted_spectral++) <<= tmpInt;
-                         *      *(pPredicted_spectral++) <<= tmpInt;
-                         *      *(pPredicted_spectral++) <<= tmpInt;
-                         * }
-                         *
-                         */
-
-                        /* Adjust Q format for predicted_spectral() */
-                        adjusted_pred_q = pred_q_format + tmpInt;
-
-                        /*
-                         * Adjust Q format to prevent overflow that may occur
-                         * during frequency domain reconstruction.
-                         */
-                        pPredicted_spectral = pPredicted_offset;
-
-                        shift_factor = *(pQ_format) - adjusted_pred_q;
-
-                        if ((shift_factor >= 0) && (shift_factor < 31))
-                        {
-                            shift_factor = shift_factor + 1;
-
-                            pred_shift = tmpInt - 1;
-
-                            if (pred_shift >= 0)
-                            {
-                                for (j = quarter_sfb_width; j > 0 ; j--)
-                                {
-                                    temp = *pCurrent_frame >> shift_factor;
-                                    *(pCurrent_frame++) = temp
-                                                          + (*(pPredicted_spectral++) << pred_shift);
-                                    temp = *pCurrent_frame >> shift_factor;
-                                    *(pCurrent_frame++) = temp
-                                                          + (*(pPredicted_spectral++) << pred_shift);
-                                    temp = *pCurrent_frame >> shift_factor;
-                                    *(pCurrent_frame++) = temp
-                                                          + (*(pPredicted_spectral++) << pred_shift);
-                                    temp = *pCurrent_frame >> shift_factor;
-                                    *(pCurrent_frame++) = temp
-                                                          + (*(pPredicted_spectral++) << pred_shift);
-
-                                }
-                            }
-                            else
-                            {
-                                for (j = quarter_sfb_width; j > 0 ; j--)
-                                {
-                                    temp = *pCurrent_frame >> shift_factor;
-                                    *(pCurrent_frame++) = temp
-                                                          + (*(pPredicted_spectral++) >> 1);
-                                    temp = *pCurrent_frame >> shift_factor;
-                                    *(pCurrent_frame++) = temp
-                                                          + (*(pPredicted_spectral++) >> 1);
-                                    temp = *pCurrent_frame >> shift_factor;
-                                    *(pCurrent_frame++) = temp
-                                                          + (*(pPredicted_spectral++) >> 1);
-                                    temp = *pCurrent_frame >> shift_factor;
-                                    *(pCurrent_frame++) = temp
-                                                          + (*(pPredicted_spectral++) >> 1);
-                                }
-                            }
-
-                            /* Updated new Q format for current scalefactor band*/
-                            *(pQ_format) = adjusted_pred_q - 1;
-                        }
-                        else if (shift_factor >= 31)
-                        {
-                            for (j = quarter_sfb_width; j > 0 ; j--)
-                            {
-                                *(pCurrent_frame++) =
-                                    *(pPredicted_spectral++) << tmpInt;
-                                *(pCurrent_frame++) =
-                                    *(pPredicted_spectral++) << tmpInt;
-                                *(pCurrent_frame++) =
-                                    *(pPredicted_spectral++) << tmpInt;
-                                *(pCurrent_frame++) =
-                                    *(pPredicted_spectral++) << tmpInt;
-                            }
-
-                            /* Updated new Q format for current scalefactor band*/
-                            *(pQ_format) = adjusted_pred_q;
-                        }
-                        else if ((shift_factor < 0) && (shift_factor > -31))
-                        {
-                            shift_factor = 1 - shift_factor;
-
-                            pred_shift = tmpInt - shift_factor;
-
-                            if (pred_shift >= 0)
-                            {
-                                for (j = quarter_sfb_width; j > 0 ; j--)
-                                {
-                                    temp = *pCurrent_frame >> 1;
-                                    *(pCurrent_frame++) =  temp +
-                                                           (*(pPredicted_spectral++) << pred_shift);
-                                    temp = *pCurrent_frame >> 1;
-                                    *(pCurrent_frame++) =  temp +
-                                                           (*(pPredicted_spectral++) << pred_shift);
-                                    temp = *pCurrent_frame >> 1;
-                                    *(pCurrent_frame++) =  temp +
-                                                           (*(pPredicted_spectral++) << pred_shift);
-                                    temp = *pCurrent_frame >> 1;
-                                    *(pCurrent_frame++) =  temp +
-                                                           (*(pPredicted_spectral++) << pred_shift);
-
-                                }
-                            }
-                            else
-                            {
-                                pred_shift = -pred_shift;
-
-                                for (j = quarter_sfb_width; j > 0 ; j--)
-                                {
-                                    temp = *pCurrent_frame >> 1;
-                                    *(pCurrent_frame++) =  temp +
-                                                           (*(pPredicted_spectral++) >> pred_shift);
-                                    temp = *pCurrent_frame >> 1;
-                                    *(pCurrent_frame++) =  temp +
-                                                           (*(pPredicted_spectral++) >> pred_shift);
-                                    temp = *pCurrent_frame >> 1;
-                                    *(pCurrent_frame++) =  temp +
-                                                           (*(pPredicted_spectral++) >> pred_shift);
-                                    temp = *pCurrent_frame >> 1;
-                                    *(pCurrent_frame++) =  temp +
-                                                           (*(pPredicted_spectral++) >> pred_shift);
-                                }
-                            }
-
-                            /* Updated new Q format for current scalefactor band*/
-                            *(pQ_format) = *(pQ_format) - 1;
-                        }
-
-                        /*
-                         * For case (shift_factor <= -31), *pCurrent_frame and
-                         * *pQ_format do not need to be updated.
-                         */
-
-                    } /* if (max != 0) */
-
-                    /* Updated to next scalefactor band. */
-                    sfb_offset = *(pWinSfbTop++);
-
-                    /* Updated pointer to next scalefactor band's Q-format */
-                    pQ_format++;
-
-                } /* for (i = reconstruct_sfb_num; i > 0; i--) */
-
-            } /* if (win_prediction_used[wnd] != FALSE) */
-
-            /* Updated to next window */
-            pPredicted_spectral_start += coef_per_win;
-            pCurrent_frame_start += coef_per_win;
-            pQ_format_start += num_sfb;
-
-        } /* for (wnd=0; wnd<short_window_num; wnd++) */
-
-    } /* else */
-
-    /*----------------------------------------------------------------------------
-    ; Return nothing or data or data pointer
-    ----------------------------------------------------------------------------*/
-    return;
-} /* long_term_synthesis */
-
-
diff --git a/media/libstagefright/codecs/aacdec/long_term_synthesis.h b/media/libstagefright/codecs/aacdec/long_term_synthesis.h
deleted file mode 100644
index 1195709..0000000
--- a/media/libstagefright/codecs/aacdec/long_term_synthesis.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: long_term_synthesis.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: 1. Changed protoype with array size passed in per review
-                 comments.
-              2. Moved #define NUM_RECONSTRUCTED_SFB to ltp_common_internal.h
-
- Description: Modified prototype based on review comments for new version
-          long_term_synthesis.c.
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file includes function prototype declaration for long_term_synthesis().
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef LONG_TERM_SYNTHESIS_H
-#define LONG_TERM_SYNTHESIS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_window_sequence.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void long_term_synthesis(
-    WINDOW_SEQUENCE     win_seq,
-    Int                 sfb_per_win,
-    Int16               win_sfb_top[],
-    Int                 win_prediction_used[],
-    Int                 sfb_prediction_used[],
-    Int32               current_frame[],
-    Int                 q_format[],
-    Int32               predicted_spectral[],
-    Int                 pred_q_format,
-    Int                 coef_per_win,
-    Int                 short_window_num,
-    Int                 reconstruct_sfb_num);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/lt_decode.cpp b/media/libstagefright/codecs/aacdec/lt_decode.cpp
deleted file mode 100644
index e5f5f91..0000000
--- a/media/libstagefright/codecs/aacdec/lt_decode.cpp
+++ /dev/null
@@ -1,507 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: lt_decode.c
-
-
-------------------------------------------------------------------------------
-
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  First round of optimizations.
-
- Description:  pInputStream is now the 2nd parameter to this function.
-
- Description:  Changed to work with MT's new get_ics_info.c function, which
- only calls lt_decode if LTP is enabled.  This removes one grab from the
- bitstream and one "if" from this code.  Also, changed setting of weight.
- Now, rather than setting the actual weight, I only set the index into
- a table in this function.
-
- Description: Replace some instances of getbits to get9_n_lessbits
-              when the number of bits read is 9 or less and get1bits
-              when only 1 bit is read.
-
- Who:                                   Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    win_type        Type of window (SHORT or LONG)
-                    [WINDOW_TYPE]
-
-    max_sfb         Maximum number of active scalefactor bands
-                    [Int]
-
-    pLt_pred        Pointer to structure containing information for
-                    long-term prediction.
-                    [LT_PRED_STATUS *]
-
-    pInputStream    Pointer to structure containing bitstream
-                    information.
-                    [BITS *]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    pLt_pred->weight_index - updated with index into weight table for LTP.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function decodes the bitstream elements for long term prediction
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by Nokia
-   in the course of development of the MPEG-2 AAC/MPEG-4 Audio standard
-   ISO/IEC13818-7, 14496-1, 2 and 3.  This software module is an implementation
-   of a part of one or more MPEG-2 AAC/MPEG-4 Audio tools as specified by the
-   MPEG-2 aac/MPEG-4 Audio standard. ISO/IEC  gives users of the
-   MPEG-2aac/MPEG-4 Audio standards free license to this software module or
-   modifications thereof for use in hardware or software products claiming
-   conformance to the MPEG-2 aac/MPEG-4 Audio  standards. Those intending to
-   use this software module in hardware or software products are advised that
-   this use may infringe existing patents. The original developer of this
-   software module, the subsequent editors and their companies, and ISO/IEC
-   have no liability for use of this software module or modifications thereof
-   in an implementation. Copyright is not released for non MPEG-2 aac/MPEG-4
-   Audio conforming products. The original developer retains full right to use
-   the code for the developer's own purpose, assign or donate the code to a
-   third party and to inhibit third party from using the code for non
-   MPEG-2 aac/MPEG-4 Audio conforming products. This copyright notice
-   must be included in all copies or derivative works."
-   Copyright (c)1997.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pDelay[0] = (Int) getbits(
-                        LEN_LTP_LAG,
-                        pInputStream);
-
-    temp_reg  = (Int) getbits(
-                        LEN_LTP_COEF,
-                        pInputStream);
-
-    pLt_pred->weight = codebook[temp_reg];
-
-    last_band = max_sfb;
-
-    IF (win_type != EIGHT_SHORT_SEQUENCE)
-
-        IF (last_band > MAX_LT_PRED_LONG_SFB)
-
-            last_band = MAX_LT_PRED_LONG_SFB;
-
-        ENDIF
-
-        FOR (m = last_band; m > 0; m--)
-
-            *(pSfbPredictionUsed++) = (Int) getbits(
-                                               LEN_LTP_LONG_USED,
-                                               pInputStream);
-        ENDFOR
-
-        FOR (m = (max_sfb - last_band); m > 0; m--)
-
-            *(pSfbPredictionUsed++) = 0;
-
-        ENDFOR
-
-    ELSE
-
-        IF (last_band > MAX_LT_PRED_SHORT_SFB)
-
-            last_band = MAX_LT_PRED_SHORT_SFB;
-
-        ENDIF
-
-        prev_subblock = pDelay[0];
-
-        pWinPredictionUsed++;
-
-        pTempPtr = &pSfbPredictionUsed[0];
-
-        FOR (m = NUM_SHORT_WINDOWS; m > 0;)
-
-            m--;
-            temp_reg = (Int) getbits(
-                                LEN_LTP_SHORT_USED,
-                                pInputStream);
-
-            *(pWinPredictionUsed++) = temp_reg;
-
-            IF (temp_reg != FALSE)
-            {
-                *(pDelay++) = prev_subblock;
-
-                FOR (k = last_band; k > 0; k--)
-                {
-                    *(pTempPtr++) = 1;
-                }
-                break;
-            ELSE
-            {
-                pDelay++;
-                pTempPtr += last_band;
-            }
-
-        ENDFOR (m = NUM_SHORT_WINDOWS; m > 0;)
-
-        prev_subblock += LTP_LAG_OFFSET;
-
-        FOR (; m > 0; m--)
-
-            temp_reg = (Int) getbits (
-                                LEN_LTP_SHORT_USED,
-                                pInputStream);
-
-            *(pWinPredictionUsed++) = temp_reg;
-
-            IF (temp_reg != FALSE)
-
-                temp_reg = (Int) getbits(
-                                    LEN_LTP_SHORT_LAG_PRESENT,
-                                    pInputStream);
-                IF (temp_reg != 0)
-
-                    temp_reg  = (Int) getbits(
-                                         LEN_LTP_SHORT_LAG,
-                                         pInputStream);
-
-                    *(pDelay++) = prev_subblock - temp_reg;
-
-                ELSE
-
-                    *(pDelay++) = prev_subblock - LTP_LAG_OFFSET;
-
-                ENDIF
-
-                FOR (k = last_band; k > 0; k--)
-                    *(pTempPtr++) = 1;
-                ENDFOR
-
-            ELSE
-
-                pDelay++;
-                pTempPtr += last_band;
-
-            ENDIF
-
-        ENDFOR (; m > 0; m--)
-
-    ENDIF (win_type != EIGHT_SHORT_SEQUENCE)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "lt_decode.h"
-#include "ltp_common_internal.h"
-#include "window_block_fxp.h"
-#include "e_window_sequence.h"
-#include "s_lt_pred_status.h"
-#include "s_bits.h"
-#include "ibstream.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void lt_decode(
-    const WINDOW_SEQUENCE  win_type,
-    BITS            *pInputStream,
-    const Int              max_sfb,
-    LT_PRED_STATUS  *pLt_pred)
-{
-    Int wnd_num;
-    Int k;
-    Int last_band;
-    Int prev_subblock;
-    Int prev_subblock_nonzero;
-    Int temp_reg;
-
-    Bool *pWinPredictionUsed = pLt_pred->win_prediction_used;
-    Bool *pSfbPredictionUsed = pLt_pred->sfb_prediction_used;
-    Int  *pTempPtr;
-    Int  *pDelay = pLt_pred->delay;
-
-    pDelay[0] = (Int) get17_n_lessbits(
-                    LEN_LTP_LAG,  /* 11 bits */
-                    pInputStream);
-
-    pLt_pred->weight_index  = (Int) get9_n_lessbits(
-                                  LEN_LTP_COEF, /*  3 bits */
-                                  pInputStream);
-
-    last_band = max_sfb;
-
-    if (win_type != EIGHT_SHORT_SEQUENCE)
-    {
-
-        /* last_band = min(MAX_LT_PRED_LONG_SFB, max_sfb) MAX_SCFAC_BANDS */
-        if (last_band > MAX_LT_PRED_LONG_SFB)
-        {
-            last_band = MAX_LT_PRED_LONG_SFB;
-        }
-
-        for (k = last_band; k > 0; k--)
-        {
-            *(pSfbPredictionUsed++) = (Int) get1bits(pInputStream);
-        }
-
-        /*
-         * This is not a call to memset, because
-         * (max_sfb - last_band) should typically be a small value.
-         */
-        for (k = (max_sfb - last_band); k > 0; k--)
-        {
-            *(pSfbPredictionUsed++) = FALSE;
-        }
-    }
-    else /* (win_type == EIGHT_SHORT_SEQUENCE) */
-    {
-        /* last_band = min(MAX_LT_PRED_SHORT_SFB, max_sfb) */
-
-        if (last_band > MAX_LT_PRED_SHORT_SFB)
-        {
-            last_band = MAX_LT_PRED_SHORT_SFB;
-        }
-
-        /*
-         * The following two coding constructs are equivalent...
-         *
-         *  first_time == 1
-         *  for (wnd_num=NUM_SHORT_WINDOWS; wnd_num > 0; wnd_num--)
-         *  {
-         *     if (condition)
-         *     {
-         *       if (first_time == 1)
-         *       {
-         *           CODE SECTION A
-         *           first_time = 0;
-         *       }
-         *       else
-         *       {
-         *           CODE SECTION B
-         *       }
-         *     }
-         *  }
-         *
-         * -----------------------------------EQUIVALENT TO------------
-         *
-         *  wnd_num=NUM_SHORT_WINDOWS;
-         *
-         *  do
-         *  {
-         *     wnd_num--;
-         *     if (condition)
-         *     {
-         *         CODE SECTION A
-         *         break;
-         *     }
-         *  } while( wnd_num > 0)
-         *
-         *  while (wnd_num > 0)
-         *  {
-         *     if (condition)
-         *     {
-         *         CODE SECTION B
-         *     }
-         *     wnd_num--;
-         *  }
-         *
-         */
-
-        prev_subblock = pDelay[0];
-
-        pTempPtr = &pSfbPredictionUsed[0];
-
-        wnd_num = NUM_SHORT_WINDOWS;
-
-        prev_subblock_nonzero = prev_subblock;
-        prev_subblock += LTP_LAG_OFFSET;
-
-        do
-        {
-            /*
-             * Place decrement of wnd_num here, to insure
-             * that the decrement occurs before the
-             * break out of the do-while loop.
-             */
-            wnd_num--;
-
-            temp_reg = (Int) get1bits(pInputStream);
-
-            *(pWinPredictionUsed++) = temp_reg;
-
-            if (temp_reg != FALSE)
-            {
-                *(pDelay++) = prev_subblock_nonzero;
-
-                for (k = last_band; k > 0; k--)
-                {
-                    *(pTempPtr++) = TRUE;
-                }
-                for (k = (max_sfb - last_band); k > 0; k--)
-                {
-                    *(pTempPtr++) = FALSE;
-                }
-                break;
-
-            } /* if(pWinPredictionUsed) */
-            else
-            {
-                pDelay++;
-                pTempPtr += max_sfb;
-            }
-
-        }
-        while (wnd_num > 0);
-
-        /*
-         * This while loop picks up where the previous one left off.
-         * Notice that the code functions differently inside the loop
-         */
-
-        while (wnd_num > 0)
-        {
-            temp_reg = (Int) get1bits(pInputStream);
-
-            *(pWinPredictionUsed++) = temp_reg;
-
-            if (temp_reg != FALSE)
-            {
-                temp_reg = (Int) get1bits(pInputStream);
-                if (temp_reg != 0)
-                {
-                    temp_reg  = (Int) get9_n_lessbits(
-                                    LEN_LTP_SHORT_LAG,
-                                    pInputStream);
-
-                    *(pDelay++) = prev_subblock - temp_reg;
-                }
-                else
-                {
-                    *(pDelay++) = prev_subblock_nonzero;
-                }
-                for (k = last_band; k > 0; k--)
-                {
-                    *(pTempPtr++) = TRUE;
-                }
-                for (k = (max_sfb - last_band); k > 0; k--)
-                {
-                    *(pTempPtr++) = FALSE;
-                }
-
-            } /* if (temp_reg) */
-            else
-            {
-                pDelay++;
-                pTempPtr += max_sfb;
-            }
-
-            wnd_num--;
-
-        } /* while(wnd_num) */
-
-    } /* else (win_type == EIGHT_SHORT_SEQUENCE) */
-
-} /* lt_decode */
diff --git a/media/libstagefright/codecs/aacdec/lt_decode.h b/media/libstagefright/codecs/aacdec/lt_decode.h
deleted file mode 100644
index c655270..0000000
--- a/media/libstagefright/codecs/aacdec/lt_decode.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: lt_decode.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Changing to move pInputStream to 2nd parameter.
-
- Description: Replaced "e_WINDOW_TYPE.h" with "e_WINDOW_SEQUENCE.h"
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file contains the global function declaration for lt_decode
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef LT_DECODE_H
-#define LT_DECODE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_window_sequence.h"
-#include "s_lt_pred_status.h"
-#include "s_bits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void lt_decode(
-    const WINDOW_SEQUENCE win_type,
-    BITS           *pInputStream,
-    const Int             max_sfb,
-    LT_PRED_STATUS *pLt_pred);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/lt_prediction.h b/media/libstagefright/codecs/aacdec/lt_prediction.h
deleted file mode 100644
index e52a1e8..0000000
--- a/media/libstagefright/codecs/aacdec/lt_prediction.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/**************************************************************************
-
-This software module was originally developed by
-Nokia in the course of development of the MPEG-2 AAC/MPEG-4
-Audio standard ISO/IEC13818-7, 14496-1, 2 and 3.
-This software module is an implementation of a part
-of one or more MPEG-2 AAC/MPEG-4 Audio tools as specified by the
-MPEG-2 aac/MPEG-4 Audio standard. ISO/IEC  gives users of the
-MPEG-2aac/MPEG-4 Audio standards free license to this software module
-or modifications thereof for use in hardware or software products
-claiming conformance to the MPEG-2 aac/MPEG-4 Audio  standards. Those
-intending to use this software module in hardware or software products
-are advised that this use may infringe existing patents. The original
-developer of this software module, the subsequent
-editors and their companies, and ISO/IEC have no liability for use of
-this software module or modifications thereof in an
-implementation. Copyright is not released for non MPEG-2 aac/MPEG-4
-Audio conforming products. The original developer retains full right to
-use the code for the developer's own purpose, assign or donate the code to a
-third party and to inhibit third party from using the code for non
-MPEG-2 aac/MPEG-4 Audio conforming products. This copyright notice
-must be included in all copies or derivative works.
-Copyright (c)1997.
-
-***************************************************************************/
-
-#ifndef _LT_PREDICTION_H
-#define _LT_PREDICTION_H
-
-#include "block.h"
-#include "ltp_common.h"
-#include "ibstream.h"
-#include "lt_decode.h"
-#include "s_frameinfo.h"
-#include "window_block.h"
-
-void init_lt_pred(LT_PRED_STATUS * lt_status);
-
-void lt_predict(
-    Int                  object,
-    FrameInfo           *pFrameInfo,
-    WINDOW_SEQUENCE      win_seq,
-    Wnd_Shape           *pWin_shape,
-    LT_PRED_STATUS  *pLt_status,
-    Real                *pPredicted_samples,
-    Real                *pOverlap_buffer,
-    Real                *pCurrent_frame_copy,
-    Real                 current_frame[]);
-
-short double_to_int(double sig_in);
-
-#endif /* not defined _LT_PREDICTION_H */
diff --git a/media/libstagefright/codecs/aacdec/ltp_common_internal.h b/media/libstagefright/codecs/aacdec/ltp_common_internal.h
deleted file mode 100644
index d76ac75..0000000
--- a/media/libstagefright/codecs/aacdec/ltp_common_internal.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/**************************************************************************
-
-This software module was originally developed by
-
-Mikko Suonio (Nokia)
-
-in the course of development of the MPEG-2 NBC/MPEG-4 Audio standard
-ISO/IEC 13818-7, 14496-1,2 and 3. This software module is an
-implementation of a part of one or more MPEG-2 NBC/MPEG-4 Audio tools
-as specified by the MPEG-2 NBC/MPEG-4 Audio standard. ISO/IEC gives
-users of the MPEG-2 NBC/MPEG-4 Audio standards free license to this
-software module or modifications thereof for use in hardware or
-software products claiming conformance to the MPEG-2 NBC/ MPEG-4 Audio
-standards. Those intending to use this software module in hardware or
-software products are advised that this use may infringe existing
-patents. The original developer of this software module and his/her
-company, the subsequent editors and their companies, and ISO/IEC have
-no liability for use of this software module or modifications thereof
-in an implementation. Copyright is not released for non MPEG-2
-NBC/MPEG-4 Audio conforming products. The original developer retains
-full right to use the code for his/her own purpose, assign or donate
-the code to a third party and to inhibit third party from using the
-code for non MPEG-2 NBC/MPEG-4 Audio conforming products. This
-copyright notice must be included in all copies or derivative works.
-
-Copyright (c) 1997.
-
-***************************************************************************/
-
-#ifndef _LTP_COMMON_INTERNAL_H
-#define _LTP_COMMON_INTERNAL_H
-
-
-/*
-  Purpose:      Number of LTP coefficients. */
-#define LPC 1
-
-/*
-  Purpose:      Maximum LTP lag.  */
-#define DELAY 2048
-
-/*
-  Purpose:  Length of the bitstream element ltp_data_present.  */
-#define LEN_LTP_DATA_PRESENT 1
-
-/*
-  Purpose:  Length of the bitstream element ltp_lag.  */
-#define LEN_LTP_LAG 11
-
-/*
-  Purpose:  Length of the bitstream element ltp_coef.  */
-#define LEN_LTP_COEF 3
-
-/*
-  Purpose:  Length of the bitstream element ltp_short_used.  */
-#define LEN_LTP_SHORT_USED 1
-
-/*
-  Purpose:  Length of the bitstream element ltp_short_lag_present.  */
-#define LEN_LTP_SHORT_LAG_PRESENT 1
-
-/*
-  Purpose:  Length of the bitstream element ltp_short_lag.  */
-#define LEN_LTP_SHORT_LAG 5
-
-/*
-  Purpose:  Offset of the lags written in the bitstream.  */
-#define LTP_LAG_OFFSET 16
-
-/*
-  Purpose:  Length of the bitstream element ltp_long_used.  */
-#define LEN_LTP_LONG_USED 1
-
-/*
-  Purpose:  Upper limit for the number of scalefactor bands
-        which can use lt prediction with long windows.
-  Explanation:  Bands 0..MAX_LT_PRED_SFB-1 can use lt prediction.  */
-#define MAX_LT_PRED_LONG_SFB 40
-
-/*
-  Purpose:  Upper limit for the number of scalefactor bands
-        which can use lt prediction with short windows.
-  Explanation:  Bands 0..MAX_LT_PRED_SFB-1 can use lt prediction.  */
-#define MAX_LT_PRED_SHORT_SFB 13
-
-/*
-   Purpose:      Buffer offset to maintain block alignment.
-   Explanation:  This is only used for a short window sequence.  */
-#define SHORT_SQ_OFFSET (BLOCK_LEN_LONG-(BLOCK_LEN_SHORT*4+BLOCK_LEN_SHORT/2))
-
-/*
-  Purpose:  Number of codes for LTP weight. */
-#define CODESIZE 8
-
-/* number of scalefactor bands used for reconstruction for short windows */
-#define NUM_RECONSTRUCTED_SFB (8)
-
-#endif /* _LTP_COMMON_INTERNAL_H */
diff --git a/media/libstagefright/codecs/aacdec/mdct_fxp.cpp b/media/libstagefright/codecs/aacdec/mdct_fxp.cpp
deleted file mode 100644
index df371e8..0000000
--- a/media/libstagefright/codecs/aacdec/mdct_fxp.cpp
+++ /dev/null
@@ -1,450 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: mdct_fxp.c
- Funtions: fft_rx2
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    data_quant  = Input vector, with quantized Q15 spectral lines:
-                  type Int32
-
-    Q_FFTarray  = Scratch memory used for in-place IFFT calculation,
-                  min size required 1024, type Int32
-
-    n           = Length of input vector "data_quant". Currently 256 or 2048.
-                  type const Int
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    shift = shift factor to reflect scaling introduced by FFT and mdct_fxp,
-
- Pointers and Buffers Modified:
-    calculation are done in-place and returned in "data_quant"
-
- Local Stores Modified:
-     None
-
- Global Stores Modified:
-     None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    The MDCT is a linear orthogonal lapped transform, based on the idea of
-    time domain aliasing cancellation (TDAC).
-    MDCT is critically sampled, which means that though it is 50% overlapped,
-    a sequence data after MDCT has the same number of coefficients as samples
-    before the transform (after overlap-and-add). This means, that a single
-    block of MDCT data does not correspond to the original block on which the
-    MDCT was performed. When subsequent blocks of data are added (still using
-    50% overlap), the errors introduced by the transform cancels out.
-    Thanks to the overlapping feature, the MDCT is very useful for
-    quantization. It effectively removes the otherwise easily detectable
-    blocking artifact between transform blocks.
-    N = length of input vector X
-    X = vector of length N/2, will hold fixed point DCT
-    k = 0:1:N-1
-
-                        N-1
-            X(m) =  2   SUM   x(k)*cos(pi/(2*N)*(2*k+1+N/2)*(2*m+1))
-                        k=0
-
-
-    The window that completes the TDAC is applied before calling this function.
-    The MDCT can be calculated using an FFT, for this, the MDCT needs to be
-    rewritten as an odd-time odd-frequency discrete Fourier transform. Thus,
-    the MDCT can be calculated using only one n/4 point FFT and some pre and
-    post-rotation of the sample points.
-
-    Computation of the MDCT implies computing
-
-        x  = ( y   - y        ) + j( y       +  y       )
-         n      2n    N/2-1-2n        N-1-2n     N/2+2n
-
-    using the Fast discrete cosine transform as described in [2]
-
-    where x(n) is an input with N points
-
-    x(n) ----------------------------
-                                     |
-                                     |
-                    Pre-rotation by exp(j(2pi/N)(n+1/8))
-                                     |
-                                     |
-                              N/4- point FFT
-                                     |
-                                     |
-                    Post-rotation by exp(j(2pi/N)(k+1/8))
-                                     |
-                                     |
-                                      ------------- DCT
-
-    By considering the N/2 overlap, a relation between successive input blocks
-    is found:
-
-        x   (2n) = x (N/2 + 2n)
-         m+1        m
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This function should provide a fixed point MDCT with an average
-    quantization error less than 1 %.
-
-------------------------------------------------------------------------------
- REFERENCES
-
-    [1] Analysis/Synthesis Filter Bank design based on time domain
-        aliasing cancellation
-        Jhon Princen, et. al.
-        IEEE Transactions on ASSP, vol ASSP-34, No. 5 October 1986
-        Pg 1153 - 1161
-
-    [2] Regular FFT-related transform kernels for DCT/DST based
-        polyphase filterbanks
-        Rolf Gluth
-        Proc. ICASSP 1991, pg. 2205 - 2208
-
-------------------------------------------------------------------------------
-  PSEUDO-CODE
-
-  Cx, Cy are complex number
-
-
-    exp = log2(n)-1
-
-    FOR ( k=0; k< n/4; k +=2)
-
-        Cx =   (data_quant[3n/4 + k] + data_quant[3n/4 - 1 - k]) +
-             j (data_quant[ n/4 + k] - data_quant[ n/4 - 1 - k])
-
-        Q_FFTarray = Cx * exp(-j(2pi/n)(k+1/8))
-
-    ENDFOR
-
-    FOR ( k=n/4; k< n/2; k +=2)
-
-        Cx =   (data_quant[3n/4 - 1 - k] + data_quant[ - n/4 + k]) +
-             j (data_quant[5n/4 - 1 - k] - data_quant[   n/4 + k])
-
-        Q_FFTarray = Cx * exp(-j(2pi/n)(k+1/8))
-
-    ENDFOR
-
-    CALL FFT( Q_FFTarray, n/4)
-
-    MODIFYING( Q_FFTarray )
-
-    RETURNING( shift )
-
-    FOR ( k=0; k< n/2; k +=2)
-
-        Cx = Q_FFTarray[ k] + j Q_FFTarray[ k+1]
-
-        Cy = 2 * Cx * exp(-j(2pi/n)(k+1/8))
-
-        data_quant[           k ] = - Real(Cy)
-        data_quant[ n/2 - 1 - k ] =   Imag(Cy)
-        data_quant[ n/2     + k ] = - Imag(Cy)
-        data_quant[ n       - k ] =   Real(Cy)
-
-    ENDFOR
-
-    MODIFIED    data_quant[]
-
-    RETURN      (-shift-1)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "mdct_fxp.h"
-#include "fft_rx4.h"
-#include "mix_radix_fft.h"
-#include "fwd_long_complex_rot.h"
-#include "fwd_short_complex_rot.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define ERROR_IN_FRAME_SIZE 10
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-Int mdct_fxp(
-    Int32   data_quant[],
-    Int32   Q_FFTarray[],
-    Int     n)
-{
-
-    Int32   temp_re;
-    Int32   temp_im;
-
-    Int32   temp_re_32;
-    Int32   temp_im_32;
-
-    Int16     cos_n;
-    Int16     sin_n;
-    Int32     exp_jw;
-    Int     shift;
-
-
-    const Int32 *p_rotate;
-
-
-    Int32   *p_data_1;
-    Int32   *p_data_2;
-    Int32   *p_data_3;
-    Int32   *p_data_4;
-
-    Int32 *p_Q_FFTarray;
-
-    Int32   max1;
-
-    Int k;
-    Int n_2   = n >> 1;
-    Int n_4   = n >> 2;
-    Int n_8   = n >> 3;
-    Int n_3_4 = 3 * n_4;
-
-    switch (n)
-    {
-        case SHORT_WINDOW_TYPE:
-            p_rotate = (Int32 *)exp_rotation_N_256;
-            break;
-
-        case LONG_WINDOW_TYPE:
-            p_rotate = (Int32 *)exp_rotation_N_2048;
-            break;
-
-        default:
-            /*
-             *  There is no defined behavior for a non supported frame
-             *  size. By returning a fixed scaling factor, the input will
-             *  scaled down and this will be heard as a low level noise
-             */
-            return(ERROR_IN_FRAME_SIZE);
-
-    }
-
-    /*--- Reordering and Pre-rotation by exp(-j(2pi/N)(r+1/8))   */
-    p_data_1 = &data_quant[n_3_4];
-    p_data_2 = &data_quant[n_3_4 - 1];
-    p_data_3 = &data_quant[n_4];
-    p_data_4 = &data_quant[n_4 - 1];
-
-    p_Q_FFTarray = Q_FFTarray;
-
-    max1 = 0;
-
-    for (k = n_8; k > 0; k--)
-    {
-        /*
-         *  scale down to ensure numbers are Q15
-         *  temp_re and temp_im are 32-bit but
-         *  only the lower 16 bits are used
-         */
-
-        temp_re = (*(p_data_1++) + *(p_data_2--)) >> 1;
-        temp_im = (*(p_data_3++) - *(p_data_4--)) >> 1;
-
-
-        /*
-         * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-         */
-
-        exp_jw = *p_rotate++;
-
-        cos_n = (Int16)(exp_jw >> 16);
-        sin_n = (Int16)(exp_jw & 0xFFFF);
-
-        temp_re_32 = temp_re * cos_n + temp_im * sin_n;
-        temp_im_32 = temp_im * cos_n - temp_re * sin_n;
-        *(p_Q_FFTarray++) = temp_re_32;
-        *(p_Q_FFTarray++) = temp_im_32;
-        max1         |= (temp_re_32 >> 31) ^ temp_re_32;
-        max1         |= (temp_im_32 >> 31) ^ temp_im_32;
-
-
-        p_data_1++;
-        p_data_2--;
-        p_data_4--;
-        p_data_3++;
-    }
-
-
-    p_data_1 = &data_quant[n - 1];
-    p_data_2 = &data_quant[n_2 - 1];
-    p_data_3 = &data_quant[n_2];
-    p_data_4 =  data_quant;
-
-    for (k = n_8; k > 0; k--)
-    {
-        /*
-         *  scale down to ensure numbers are Q15
-         */
-        temp_re = (*(p_data_2--) - *(p_data_4++)) >> 1;
-        temp_im = (*(p_data_1--) + *(p_data_3++)) >> 1;
-
-        p_data_2--;
-        p_data_1--;
-        p_data_4++;
-        p_data_3++;
-
-        /*
-         * cos_n + j*sin_n == exp(j(2pi/N)(k+1/8))
-         */
-
-        exp_jw = *p_rotate++;
-
-        cos_n = (Int16)(exp_jw >> 16);
-        sin_n = (Int16)(exp_jw & 0xFFFF);
-
-        temp_re_32 = temp_re * cos_n + temp_im * sin_n;
-        temp_im_32 = temp_im * cos_n - temp_re * sin_n;
-
-        *(p_Q_FFTarray++) = temp_re_32;
-        *(p_Q_FFTarray++) = temp_im_32;
-        max1         |= (temp_re_32 >> 31) ^ temp_re_32;
-        max1         |= (temp_im_32 >> 31) ^ temp_im_32;
-
-
-    } /* for(k) */
-
-
-
-    p_Q_FFTarray = Q_FFTarray;
-
-    if (max1)
-    {
-
-        if (n != SHORT_WINDOW_TYPE)
-        {
-
-            shift = mix_radix_fft(
-                        Q_FFTarray,
-                        &max1);
-
-            shift += fwd_long_complex_rot(
-                         Q_FFTarray,
-                         data_quant,
-                         max1);
-
-        }
-        else        /*  n_4 is 64 */
-        {
-
-            shift = fft_rx4_short(
-                        Q_FFTarray,
-                        &max1);
-
-            shift += fwd_short_complex_rot(
-                         Q_FFTarray,
-                         data_quant,
-                         max1);
-        }
-
-    }
-    else
-    {
-        shift = -31;
-    }
-
-    /*
-     *  returns shift introduced by FFT and mdct_fxp, 12 accounts for
-     *  regular downshift (14) and MDCT scale factor (-2)
-     *  number are returned as 16 bits
-     */
-    return (12 - shift);
-
-} /* mdct_fxp */
-
diff --git a/media/libstagefright/codecs/aacdec/mdct_fxp.h b/media/libstagefright/codecs/aacdec/mdct_fxp.h
deleted file mode 100644
index b8d5a80..0000000
--- a/media/libstagefright/codecs/aacdec/mdct_fxp.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: mdct_fxp.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: This extern had the incorrect length of the arrays.  The true
- lengths are 128 and 1024, not 64 and 512.
-
- Description:  Modified interface so a vector with extended precision is
-               returned. Added copyright notice.
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function mdct_fxp()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef MDCT_FXP_H
-#define MDCT_FXP_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-#define     LONG_WINDOW_TYPE  2048
-#define     SHORT_WINDOW_TYPE  256
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    extern const Int exp_rotation_N_256[128];
-    extern const Int exp_rotation_N_2048[1024];
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-    Int mdct_fxp(
-        Int32   data_quant[],
-        Int32   Q_FFTarray[],
-        Int     n);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* MDCT_FXP_H */
diff --git a/media/libstagefright/codecs/aacdec/mdct_tables_fxp.cpp b/media/libstagefright/codecs/aacdec/mdct_tables_fxp.cpp
deleted file mode 100644
index 709cbf2..0000000
--- a/media/libstagefright/codecs/aacdec/mdct_tables_fxp.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: mdct_tables_fxp.c
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Created from fft_rx2.c
-
- Description:  Modified to include forward and inverse tables
-
- Who:                       Date:
- Description:
-
-  ------------------------------------------------------------------------------
- MODULE DESCRIPTION
-
-    MDCT rotation tables fixpoint tables
-
-    For a table with N complex points:
-
-    cos_n + j*sin_n == exp(j(2pi/N)(n+1/8))
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here. Include conditional
-    ; compile variables also.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; LOCAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; LOCAL VARIABLE DEFINITIONS
-    ; Variable declaration - defined here and used outside this module
-    ----------------------------------------------------------------------------*/
-
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL FUNCTION REFERENCES
-    ; Declare functions defined elsewhere and referenced in this module
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-
-
-
-    extern const Int32 exp_rotation_N_256[64] =
-    {
-
-        0x5A820047,  0x5A7A0280, 0x5A6304B8, 0x5A3E06EF,
-        0x5A0C0926,  0x59CB0B5B, 0x597D0D8E, 0x59210FBF,
-        0x58B711EE,  0x5840141A, 0x57BB1643, 0x57281868,
-        0x56881A8A,  0x55DB1CA8, 0x55201EC1, 0x545820D5,
-        0x538322E5,  0x52A224EF, 0x51B326F3, 0x50B828F1,
-        0x4FB12AE9,  0x4E9D2CDA, 0x4D7D2EC5, 0x4C5230A8,
-        0x4B1A3284,  0x49D73458, 0x48883624, 0x472F37E7,
-        0x45CA39A2,  0x445A3B54, 0x42E03CFD, 0x415C3E9C,
-        0x3FCE4032,  0x3E3541BE, 0x3C944340, 0x3AE844B7,
-        0x39344624,  0x37774786, 0x35B148DD, 0x33E44A29,
-        0x320E4B69,  0x30304C9E, 0x2E4B4DC6, 0x2C5F4EE3,
-        0x2A6C4FF4,  0x287250F8, 0x267251F0, 0x246D52DB,
-        0x226153BA,  0x2051548B, 0x1E3B5550, 0x1C215607,
-        0x1A0256B1,  0x17DF574E, 0x15B957DD, 0x138F585F,
-        0x116358D3,  0x0F335939, 0x0D015992, 0x0ACE59DD,
-        0x08985A1A,  0x06625A49, 0x042A5A6A, 0x01F25A7D
-    };
-
-
-
-
-
-
-    extern const Int32 exp_rotation_N_2048[512] =
-    {
-
-        0x5A820009,  0x5A820050, 0x5A820097, 0x5A8100DE,
-        0x5A810125,  0x5A80016C, 0x5A7E01B3, 0x5A7D01FA,
-        0x5A7B0242,  0x5A790289, 0x5A7702D0, 0x5A750317,
-        0x5A72035E,  0x5A7003A5, 0x5A6D03EC, 0x5A6A0433,
-        0x5A66047A,  0x5A6304C1, 0x5A5F0508, 0x5A5B054F,
-        0x5A560596,  0x5A5205DD, 0x5A4D0624, 0x5A48066A,
-        0x5A4306B1,  0x5A3E06F8, 0x5A38073F, 0x5A320786,
-        0x5A2C07CD,  0x5A260814, 0x5A20085A, 0x5A1908A1,
-        0x5A1208E8,  0x5A0B092F, 0x5A040975, 0x59FC09BC,
-        0x59F40A03,  0x59EC0A49, 0x59E40A90, 0x59DC0AD7,
-        0x59D30B1D,  0x59CA0B64, 0x59C10BAA, 0x59B80BF1,
-        0x59AE0C37,  0x59A50C7E, 0x599B0CC4, 0x59910D0A,
-        0x59860D51,  0x597C0D97, 0x59710DDD, 0x59660E23,
-        0x595B0E6A,  0x594F0EB0, 0x59440EF6, 0x59380F3C,
-        0x592C0F82,  0x59200FC8, 0x5913100E, 0x59061054,
-        0x58F9109A,  0x58EC10E0, 0x58DF1126, 0x58D1116B,
-        0x58C411B1,  0x58B611F7, 0x58A7123C, 0x58991282,
-        0x588A12C8,  0x587B130D, 0x586C1353, 0x585D1398,
-        0x584E13DD,  0x583E1423, 0x582E1468, 0x581E14AD,
-        0x580D14F2,  0x57FD1538, 0x57EC157D, 0x57DB15C2,
-        0x57CA1607,  0x57B9164C, 0x57A71690, 0x579516D5,
-        0x5783171A,  0x5771175F, 0x575E17A3, 0x574C17E8,
-        0x5739182C,  0x57261871, 0x571218B5, 0x56FF18FA,
-        0x56EB193E,  0x56D71982, 0x56C319C6, 0x56AF1A0A,
-        0x569A1A4F,  0x56851A93, 0x56701AD6, 0x565B1B1A,
-        0x56461B5E,  0x56301BA2, 0x561A1BE5, 0x56041C29,
-        0x55EE1C6D,  0x55D81CB0, 0x55C11CF3, 0x55AA1D37,
-        0x55931D7A,  0x557C1DBD, 0x55651E00, 0x554D1E43,
-        0x55351E86,  0x551D1EC9, 0x55051F0C, 0x54EC1F4F,
-        0x54D31F91,  0x54BB1FD4, 0x54A12016, 0x54882059,
-        0x546F209B,  0x545520DE, 0x543B2120, 0x54212162,
-        0x540721A4,  0x53EC21E6, 0x53D12228, 0x53B62269,
-        0x539B22AB,  0x538022ED, 0x5364232E, 0x53492370,
-        0x532D23B1,  0x531123F2, 0x52F42434, 0x52D82475,
-        0x52BB24B6,  0x529E24F7, 0x52812538, 0x52642578,
-        0x524625B9,  0x522825FA, 0x520B263A, 0x51EC267A,
-        0x51CE26BB,  0x51B026FB, 0x5191273B, 0x5172277B,
-        0x515327BB,  0x513427FB, 0x5114283A, 0x50F4287A,
-        0x50D428BA,  0x50B428F9, 0x50942938, 0x50742978,
-        0x505329B7,  0x503229F6, 0x50112A35, 0x4FF02A74,
-        0x4FCE2AB2,  0x4FAD2AF1, 0x4F8B2B2F, 0x4F692B6E,
-        0x4F472BAC,  0x4F242BEA, 0x4F022C29, 0x4EDF2C67,
-        0x4EBC2CA4,  0x4E992CE2, 0x4E752D20, 0x4E522D5D,
-        0x4E2E2D9B,  0x4E0A2DD8, 0x4DE62E15, 0x4DC22E53,
-        0x4D9D2E90,  0x4D792ECD, 0x4D542F09, 0x4D2F2F46,
-        0x4D0A2F83,  0x4CE42FBF, 0x4CBF2FFB, 0x4C993038,
-        0x4C733074,  0x4C4D30B0, 0x4C2630EC, 0x4C003127,
-        0x4BD93163,  0x4BB2319E, 0x4B8B31DA, 0x4B643215,
-        0x4B3D3250,  0x4B15328B, 0x4AED32C6, 0x4AC53301,
-        0x4A9D333C,  0x4A753376, 0x4A4C33B1, 0x4A2433EB,
-        0x49FB3425,  0x49D2345F, 0x49A83499, 0x497F34D3,
-        0x4955350C,  0x492C3546, 0x4902357F, 0x48D835B9,
-        0x48AD35F2,  0x4883362B, 0x48583664, 0x482E369C,
-        0x480336D5,  0x47D7370E, 0x47AC3746, 0x4781377E,
-        0x475537B6,  0x472937EE, 0x46FD3826, 0x46D1385E,
-        0x46A43895,  0x467838CD, 0x464B3904, 0x461E393B,
-        0x45F13972,  0x45C439A9, 0x459739E0, 0x45693A16,
-        0x453C3A4D,  0x450E3A83, 0x44E03AB9, 0x44B13AEF,
-        0x44833B25,  0x44553B5B, 0x44263B90, 0x43F73BC6,
-        0x43C83BFB,  0x43993C30, 0x43693C65, 0x433A3C9A,
-        0x430A3CCF,  0x42DA3D04, 0x42AA3D38, 0x427A3D6C,
-        0x424A3DA0,  0x42193DD4, 0x41E93E08, 0x41B83E3C,
-        0x41873E6F,  0x41563EA3, 0x41253ED6, 0x40F33F09,
-        0x40C23F3C,  0x40903F6F, 0x405E3FA1, 0x402C3FD4,
-        0x3FFA4006,  0x3FC74038, 0x3F95406A, 0x3F62409C,
-        0x3F2F40CE,  0x3EFC4100, 0x3EC94131, 0x3E964162,
-        0x3E634193,  0x3E2F41C4, 0x3DFB41F5, 0x3DC74226,
-        0x3D934256,  0x3D5F4286, 0x3D2B42B6, 0x3CF642E6,
-        0x3CC24316,  0x3C8D4346, 0x3C584375, 0x3C2343A5,
-        0x3BEE43D4,  0x3BB84403, 0x3B834432, 0x3B4D4460,
-        0x3B18448F,  0x3AE244BD, 0x3AAC44EB, 0x3A754519,
-        0x3A3F4547,  0x3A094575, 0x39D245A2, 0x399B45CF,
-        0x396445FD,  0x392D462A, 0x38F64656, 0x38BF4683,
-        0x388746B0,  0x385046DC, 0x38184708, 0x37E04734,
-        0x37A84760,  0x3770478B, 0x373847B7, 0x36FF47E2,
-        0x36C7480D,  0x368E4838, 0x36554863, 0x361D488E,
-        0x35E348B8,  0x35AA48E2, 0x3571490C, 0x35384936,
-        0x34FE4960,  0x34C44989, 0x348B49B3, 0x345149DC,
-        0x34164A05,  0x33DC4A2E, 0x33A24A56, 0x33684A7F,
-        0x332D4AA7,  0x32F24ACF, 0x32B74AF7, 0x327C4B1F,
-        0x32414B46,  0x32064B6E, 0x31CB4B95, 0x31904BBC,
-        0x31544BE3,  0x31184C0A, 0x30DD4C30, 0x30A14C56,
-        0x30654C7C,  0x30294CA2, 0x2FEC4CC8, 0x2FB04CEE,
-        0x2F734D13,  0x2F374D38, 0x2EFA4D5D, 0x2EBD4D82,
-        0x2E804DA7,  0x2E434DCB, 0x2E064DEF, 0x2DC94E13,
-        0x2D8C4E37,  0x2D4E4E5B, 0x2D104E7E, 0x2CD34EA2,
-        0x2C954EC5,  0x2C574EE8, 0x2C194F0A, 0x2BDB4F2D,
-        0x2B9D4F4F,  0x2B5E4F71, 0x2B204F93, 0x2AE14FB5,
-        0x2AA34FD7,  0x2A644FF8, 0x2A255019, 0x29E6503A,
-        0x29A7505B,  0x2968507C, 0x2929509C, 0x28E950BC,
-        0x28AA50DC,  0x286A50FC, 0x282B511C, 0x27EB513B,
-        0x27AB515B,  0x276B517A, 0x272B5199, 0x26EB51B7,
-        0x26AB51D6,  0x266A51F4, 0x262A5212, 0x25E95230,
-        0x25A9524E,  0x2568526B, 0x25275288, 0x24E652A5,
-        0x24A652C2,  0x246452DF, 0x242352FB, 0x23E25318,
-        0x23A15334,  0x235F5350, 0x231E536B, 0x22DC5387,
-        0x229B53A2,  0x225953BD, 0x221753D8, 0x21D553F3,
-        0x2193540D,  0x21515427, 0x210F5442, 0x20CD545B,
-        0x208B5475,  0x2048548F, 0x200654A8, 0x1FC354C1,
-        0x1F8154DA,  0x1F3E54F2, 0x1EFB550B, 0x1EB85523,
-        0x1E76553B,  0x1E335553, 0x1DF0556A, 0x1DAC5582,
-        0x1D695599,  0x1D2655B0, 0x1CE355C7, 0x1C9F55DD,
-        0x1C5C55F4,  0x1C18560A, 0x1BD55620, 0x1B915636,
-        0x1B4D564B,  0x1B095661, 0x1AC55676, 0x1A82568B,
-        0x1A3E569F,  0x19F956B4, 0x19B556C8, 0x197156DC,
-        0x192D56F0,  0x18E95704, 0x18A45717, 0x1860572A,
-        0x181B573E,  0x17D75750, 0x17925763, 0x174D5775,
-        0x17095788,  0x16C4579A, 0x167F57AB, 0x163A57BD,
-        0x15F557CE,  0x15B057DF, 0x156B57F0, 0x15265801,
-        0x14E15812,  0x149C5822, 0x14575832, 0x14115842,
-        0x13CC5851,  0x13875861, 0x13415870, 0x12FC587F,
-        0x12B6588E,  0x1271589D, 0x122B58AB, 0x11E558B9,
-        0x11A058C7,  0x115A58D5, 0x111458E2, 0x10CE58F0,
-        0x108858FD,  0x1042590A, 0x0FFD5916, 0x0FB75923,
-        0x0F71592F,  0x0F2A593B, 0x0EE45947, 0x0E9E5952,
-        0x0E58595E,  0x0E125969, 0x0DCC5974, 0x0D85597E,
-        0x0D3F5989,  0x0CF95993, 0x0CB2599D, 0x0C6C59A7,
-        0x0C2559B1,  0x0BDF59BA, 0x0B9959C4, 0x0B5259CD,
-        0x0B0B59D5,  0x0AC559DE, 0x0A7E59E6, 0x0A3859EE,
-        0x09F159F6,  0x09AA59FE, 0x09645A05, 0x091D5A0D,
-        0x08D65A14,  0x08905A1B, 0x08495A21, 0x08025A28,
-        0x07BB5A2E,  0x07745A34, 0x072D5A3A, 0x06E75A3F,
-        0x06A05A44,  0x06595A49, 0x06125A4E, 0x05CB5A53,
-        0x05845A57,  0x053D5A5C, 0x04F65A60, 0x04AF5A63,
-        0x04685A67,  0x04215A6A, 0x03DA5A6D, 0x03935A70,
-        0x034C5A73,  0x03055A76, 0x02BE5A78, 0x02775A7A,
-        0x02305A7C,  0x01E95A7D, 0x01A25A7F, 0x015B5A80,
-        0x01135A81,  0x00CC5A82, 0x00855A82, 0x003E5A82
-    };
-
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/media/libstagefright/codecs/aacdec/mdst.cpp b/media/libstagefright/codecs/aacdec/mdst.cpp
deleted file mode 100644
index 19f82e3..0000000
--- a/media/libstagefright/codecs/aacdec/mdst.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: mdst.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input length 64
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    mdst
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#include "pv_audio_type_defs.h"
-#include "synthesis_sub_band.h"
-#include "dct16.h"
-#include "dct64.h"
-#include "mdst.h"
-
-#ifdef HQ_SBR
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#include "fxp_mul32.h"
-#include "dst32.h"
-
-
-#define Qfmt1(a)   (Int32)(a*0x7FFFFFFF + (a>=0?0.5F:-0.5F))
-#define Qfmt(a)   (Int32)(a*((Int32)1<<27) + (a>=0?0.5F:-0.5F))
-
-const Int32 CosTable_32[32] =
-{
-    Qfmt1(0.50015063602065F),  Qfmt1(0.50135845244641F),
-    Qfmt1(0.50378872568104F),  Qfmt1(0.50747117207256F),
-    Qfmt1(0.51245147940822F),  Qfmt1(0.51879271310533F),
-    Qfmt1(0.52657731515427F),  Qfmt1(0.53590981690799F),
-    Qfmt1(0.54692043798551F),  Qfmt1(0.55976981294708F),
-    Qfmt1(0.57465518403266F),  Qfmt1(0.59181853585742F),
-    Qfmt1(0.61155734788251F),  Qfmt1(0.63423893668840F),
-    Qfmt1(0.66031980781371F),  Qfmt1(0.69037212820021F),
-    Qfmt1(0.72512052237720F),  Qfmt1(0.76549416497309F),
-    Qfmt1(0.81270209081449F),  Qfmt1(0.86834471522335F),
-    Qfmt(0.93458359703641F),  Qfmt(1.01440826499705F),
-    Qfmt(1.11207162057972F),  Qfmt(1.23383273797657F),
-    Qfmt(1.38929395863283F),  Qfmt(1.59397228338563F),
-    Qfmt(1.87467598000841F),  Qfmt(2.28205006800516F),
-    Qfmt(2.92462842815822F),  Qfmt(4.08461107812925F),
-    Qfmt(6.79675071167363F),  Qfmt(10.18693908361573F)
-};
-
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; mdst_32
-----------------------------------------------------------------------------*/
-
-void mdst_32(Int32 vec[], Int32 scratch_mem[])
-{
-
-    Int i;
-    const Int32 *pt_cos = CosTable_32;
-    Int32 *pt_vec = vec;
-    Int32 tmp1;
-    Int32 tmp2;
-
-
-
-    Int32 tmp3;
-
-    tmp3 = *(pt_vec++);
-    tmp2 = *(pt_vec);
-
-    for (i = 5; i != 0; i--)
-    {
-        *(pt_vec++)  += tmp3;
-        tmp1 = *(pt_vec);
-        *(pt_vec++)  += tmp2;
-        tmp3 = *(pt_vec);
-        *(pt_vec++)  += tmp1;
-        tmp2 = *(pt_vec);
-        *(pt_vec++)  += tmp3;
-        tmp1 = *(pt_vec);
-        *(pt_vec++)  += tmp2;
-        tmp3 = *(pt_vec);
-        *(pt_vec++)  += tmp1;
-        tmp2 = *(pt_vec);
-    }
-
-    *(pt_vec)  += tmp3;
-
-    dst_32(vec, scratch_mem);
-
-    pt_vec = vec;
-
-    for (i = 5; i != 0; i--)
-    {
-        *(pt_vec)   = fxp_mul32_Q31((*(pt_vec) << 1) + tmp2, *(pt_cos++));
-        pt_vec++;
-        *(pt_vec)   = fxp_mul32_Q31((*(pt_vec) << 1) - tmp2, *(pt_cos++));
-        pt_vec++;
-        *(pt_vec)   = fxp_mul32_Q31((*(pt_vec) << 1) + tmp2, *(pt_cos++));
-        pt_vec++;
-        *(pt_vec)   = fxp_mul32_Q31((*(pt_vec) << 1) - tmp2, *(pt_cos++));
-        pt_vec++;
-    }
-
-    tmp2 >>= 1;
-    for (i = 3; i != 0; i--)
-    {
-        *(pt_vec)   = fxp_mul32_Q27((*(pt_vec) + tmp2), *(pt_cos++));
-        pt_vec++;
-        *(pt_vec)   = fxp_mul32_Q27((*(pt_vec) - tmp2), *(pt_cos++));
-        pt_vec++;
-        *(pt_vec)   = fxp_mul32_Q27((*(pt_vec) + tmp2), *(pt_cos++));
-        pt_vec++;
-        *(pt_vec)   = fxp_mul32_Q27((*(pt_vec) - tmp2), *(pt_cos++));
-        pt_vec++;
-    }
-
-    *(pt_vec - 1)   <<= 1;
-
-}
-
-
-
-/*----------------------------------------------------------------------------
-; mdct_32
-----------------------------------------------------------------------------*/
-
-void mdct_32(Int32 vec[])
-{
-    Int i;
-    Int32 *pt_vec  = vec;
-    Int32 tmp1, tmp2;
-
-
-    const Int32 *pt_CosTable = CosTable_32;
-
-
-    for (i = 5; i != 0; i--)
-    {
-        *(pt_vec) = fxp_mul32_Q31(*(pt_vec) << 1, *(pt_CosTable++));
-        pt_vec++;
-        *(pt_vec) = fxp_mul32_Q31(*(pt_vec) << 1, *(pt_CosTable++));
-        pt_vec++;
-        *(pt_vec) = fxp_mul32_Q31(*(pt_vec) << 1, *(pt_CosTable++));
-        pt_vec++;
-        *(pt_vec) = fxp_mul32_Q31(*(pt_vec) << 1, *(pt_CosTable++));
-        pt_vec++;
-    }
-    for (i = 3; i != 0; i--)
-    {
-        *(pt_vec) = fxp_mul32_Q27(*(pt_vec), *(pt_CosTable++));
-        pt_vec++;
-        *(pt_vec) = fxp_mul32_Q27(*(pt_vec), *(pt_CosTable++));
-        pt_vec++;
-        *(pt_vec) = fxp_mul32_Q27(*(pt_vec), *(pt_CosTable++));
-        pt_vec++;
-        *(pt_vec) = fxp_mul32_Q27(*(pt_vec), *(pt_CosTable++));
-        pt_vec++;
-    }
-    *(pt_vec - 1)   <<= 1;
-
-
-    dct_32(vec);
-
-
-    pt_vec  = &vec[31];
-
-    tmp1 = *(pt_vec--);
-
-    for (i = 5; i != 0; i--)
-    {
-        tmp2 = *(pt_vec);
-        *(pt_vec--)  += tmp1;
-        tmp1 = *(pt_vec);
-        *(pt_vec--)  += tmp2;
-        tmp2 = *(pt_vec);
-        *(pt_vec--)  += tmp1;
-        tmp1 = *(pt_vec);
-        *(pt_vec--)  += tmp2;
-        tmp2 = *(pt_vec);
-        *(pt_vec--)  += tmp1;
-        tmp1 = *(pt_vec);
-        *(pt_vec--)  += tmp2;
-    }
-
-    *(pt_vec)  += tmp1;
-
-}
-
-#endif /*  HQ_SBR  */
-
-
-/*----------------------------------------------------------------------------
-; dct_32
-----------------------------------------------------------------------------*/
-
-
-void dct_32(Int32 vec[])
-{
-
-    pv_split(&vec[16]);
-
-    dct_16(&vec[16], 0);
-    dct_16(vec, 1);     // Even terms
-
-    pv_merge_in_place_N32(vec);
-}
-
-#endif  /* AAC_PLUS */
-
-
diff --git a/media/libstagefright/codecs/aacdec/mdst.h b/media/libstagefright/codecs/aacdec/mdst.h
deleted file mode 100644
index 5b3e1c9..0000000
--- a/media/libstagefright/codecs/aacdec/mdst.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: mdst.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef MDST_H
-#define MDST_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    void mdst_32(Int32 vec[], Int32 scratch_mem[]);
-
-    void  dct_32(Int32 vec[]);
-
-    void mdct_32(Int32 vec[]);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* MDST_H */
diff --git a/media/libstagefright/codecs/aacdec/mix_radix_fft.cpp b/media/libstagefright/codecs/aacdec/mix_radix_fft.cpp
deleted file mode 100644
index 6081c46..0000000
--- a/media/libstagefright/codecs/aacdec/mix_radix_fft.cpp
+++ /dev/null
@@ -1,319 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: mix_radix_fft.c
- Funtions: mix_radix_fft
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Eliminated pointer dependency ( pData_1) on Buffer address.
-               Modified for-loop to countdown loops.
-
- Description:  No shift information going in/out from fft_rx4_long.
-
- Description:
-            (1) Increased precision on the radix 2 fft coeff. (from Q10 to Q12)
-            (2) Increased precision on the input (from 0.5 to 1.0).
-            (3) Eliminated hardly used condition (exp = 0).
-            (4) Change interface to fft_rx4_long, so now the same function is
-                used for forward and inverse calculations.
-
- Description:  per code review comments, eliminated unnecessary headers
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    Data         = Input vector, with quantized spectral with a pre-rotation
-                   by exp(j(2pi/N)(k+1/8))
-                   type Int32 *
-
-    peak_value   = Input, carries the maximum value in input vector "Data"
-                   Output, maximum value computed in the first FFT, used
-                   to set precision on next stages
-                   type Int32 *
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    exponent = shift factor to reflect signal scaling
-
- Pointers and Buffers Modified:
-    Results are return in "Data"
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    mix_radix_fft() mixes radix-2 and radix-4 FFT. This is needed to be able
-    to use power of 4 length when the input length sequence is a power of 2.
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    mix_radix_fft() should support only the FFT for the long window case of
-    the inverse modified cosine transform (IMDCT)
-------------------------------------------------------------------------------
- REFERENCES
-
-  ------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-   MODIFY( x[] )
-   RETURN( exponent )
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "fft_rx4.h"
-#include "mix_radix_fft.h"
-#include "pv_normalize.h"
-
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void digit_reversal_swapping(Int32 *y, Int32 *x);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int mix_radix_fft(
-    Int32   *Data,
-    Int32   *peak_value
-)
-
-{
-
-    const Int32     *p_w;
-    Int32   *pData_1;
-    Int32   *pData_2;
-
-    Int32   *pData_3;
-    Int32   *pData_4;
-
-    Int32   exp_jw;
-    Int32   max1;
-    Int32   max2;
-    Int32   temp1;
-    Int32   temp2;
-    Int32   temp3;
-    Int32   temp4;
-    Int32   diff1;
-    Int32   diff2;
-    Int     i;
-    Int   exp;
-
-    max1 = *peak_value;
-    p_w  = w_512rx2;
-
-    pData_1 = Data;
-    pData_3 = Data + HALF_FFT_RX4_LENGTH_FOR_LONG;
-
-
-    /*
-     * normalization to 0.9999 (0x7FFF) guarantees proper operation
-     */
-
-    exp = 8 - pv_normalize(max1);   /* use 24 bits for mix radix fft */
-
-    if (exp < 4)
-    {
-        exp = 4;
-    }
-
-
-    temp1      = (*pData_3);
-    pData_4    = pData_3 + FFT_RX4_LENGTH_FOR_LONG;
-    temp2      = (*pData_4++);
-
-
-
-    diff1      = (temp1  - temp2) >> exp;
-    *pData_3++ = (temp1  + temp2) >> exp;
-
-    temp3      = (*pData_3);
-    temp4      = (*pData_4);
-
-    *pData_4-- = -diff1;
-    *pData_3++ = (temp3  + temp4) >> exp;
-    *pData_4   = (temp3  - temp4) >> exp;
-
-    temp1      = (*pData_1);
-    pData_2    = pData_1 + FFT_RX4_LENGTH_FOR_LONG;
-    temp2      = (*pData_2++);
-    temp4      = (*pData_2);
-
-    *pData_1++ = (temp1  + temp2) >> exp;
-
-    temp3      = (*pData_1);
-    diff1      = (temp1  - temp2) >> exp ;
-
-    *pData_1++ = (temp3  + temp4) >> exp;
-    *pData_2-- = (temp3  - temp4) >> exp;
-    *pData_2   =  diff1;
-
-    temp1      = (*pData_3);
-    pData_4    = pData_3 + FFT_RX4_LENGTH_FOR_LONG;
-    temp2      = (*pData_4++);
-
-
-    for (i = ONE_FOURTH_FFT_RX4_LENGTH_FOR_LONG - 1; i != 0; i--)
-    {
-        /*
-         * radix 2 Butterfly
-         */
-
-        diff1      = (temp1  - temp2) >> (exp - 4);
-        *pData_3++ = (temp1  + temp2) >> exp;
-
-        temp3      = (*pData_3);
-        temp4      = (*pData_4);
-
-        exp_jw     = *p_w++;
-
-
-        diff2      = (temp3  - temp4) >> (exp - 4);
-        *pData_3++ = (temp3  + temp4) >> exp;
-
-        *pData_4-- = -cmplx_mul32_by_16(diff1,  diff2, exp_jw) >> 3;
-        *pData_4   =  cmplx_mul32_by_16(diff2, -diff1, exp_jw) >> 3;
-
-
-        temp1      = (*pData_1);
-        pData_2    = pData_1 + FFT_RX4_LENGTH_FOR_LONG;
-        temp2      = (*pData_2++);
-        temp4      = (*pData_2);
-
-        *pData_1++ = (temp1  + temp2) >> exp;
-
-        temp3      = (*pData_1);
-        diff1      = (temp1  - temp2) >> (exp - 4);
-
-        diff2      = (temp3  - temp4) >> (exp - 4);
-        *pData_1++ = (temp3  + temp4) >> exp;
-
-        *pData_2-- =  cmplx_mul32_by_16(diff2, -diff1, exp_jw) >> 3;
-        *pData_2   =  cmplx_mul32_by_16(diff1,  diff2, exp_jw) >> 3;
-
-        temp1      = (*pData_3);
-        pData_4    = pData_3 + FFT_RX4_LENGTH_FOR_LONG;
-        temp2      = (*pData_4++);
-
-    }/* for i  */
-
-
-    fft_rx4_long(
-        Data,
-        &max1);
-
-
-    fft_rx4_long(
-        &Data[FFT_RX4_LENGTH_FOR_LONG],
-        &max2);
-
-    digit_reversal_swapping(Data, &Data[FFT_RX4_LENGTH_FOR_LONG]);
-
-    *peak_value = max1 | max2;
-
-    return(exp);
-}
-
diff --git a/media/libstagefright/codecs/aacdec/mix_radix_fft.h b/media/libstagefright/codecs/aacdec/mix_radix_fft.h
deleted file mode 100644
index 563c280..0000000
--- a/media/libstagefright/codecs/aacdec/mix_radix_fft.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: mix_radix_fft.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions mix_radix_fft
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef MIX_RADIX_FFT_H
-#define MIX_RADIX_FFT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define     FFT_RX4_LENGTH_FOR_LONG         512
-#define     HALF_FFT_RX4_LENGTH_FOR_LONG    (FFT_RX4_LENGTH_FOR_LONG>>1)
-#define     ONE_FOURTH_FFT_RX4_LENGTH_FOR_LONG   (FFT_RX4_LENGTH_FOR_LONG>>2)
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int mix_radix_fft(
-        Int32   *Data,
-        Int32   *peak_value);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* MIX_RADIX_FFT_H */
diff --git a/media/libstagefright/codecs/aacdec/ms_map_mask.h b/media/libstagefright/codecs/aacdec/ms_map_mask.h
deleted file mode 100644
index fbbec78..0000000
--- a/media/libstagefright/codecs/aacdec/ms_map_mask.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- [Describe the contents of the include file.]
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef MS_MAP_MASK_H
-#define MS_MAP_MASK_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void MS_map_mask(
-    FrameInfo  *info,
-    Int        *group,
-    Int        *mask,
-    Int        *cb_map);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/ms_synt.cpp b/media/libstagefright/codecs/aacdec/ms_synt.cpp
deleted file mode 100644
index 1f25516..0000000
--- a/media/libstagefright/codecs/aacdec/ms_synt.cpp
+++ /dev/null
@@ -1,403 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ms_synt.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Cleaned up a bit, not finished.
-
- Description:
- Copied in code from pns_intensity_right.c, which has the same structure as
- this file.  Also, merged in code from ms_map_mask.c
-
- Description:
- (1) Various optimizations (eliminated extra variables by making use of a
- single temporary register throughout the code, etc.)
- (2) Wrote pseudocode, pasted in correct function template, etc.
-
- Description:  Unrolled loops to get speed up code
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    wins_in_group        = Number of windows in the current group.
-                           [const Int]
-
-    coef_per_win         = Number of coefficients per window.
-                           [const Int]
-
-    num_bands            = Number of scalefactor bands.
-                           [const Int]
-
-    band_length          = Number of coefficients per scalefactor band.
-                           [const Int]
-
-    pFirst_Window_CoefsL = Array containing the spectral coefficients for
-                           the left channel.
-                           [Int32 *, length LN]
-    pFirst_Window_CoefsR = Array containing the spectral coefficients for
-                           the right channel.
-                           [Int32 *, length LN]
-    q_formatLeft         = Array containing the q-format used to encode each
-                           scalefactor band's data on the left channel.
-                           [Int *, length MAXBANDS]
-    q_formatRight        = Array containing the q-format used to encode each
-                           scalefactor band's data on the right channel.
-                           [Int *, length MAXBANDS]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-   pFirst_Window_CoefsL  The coefficients in the group will be modified per the
-                         formula for M/S stereo on each scalefactor band where
-                         M/S stereo is active.
-
-   pFirst_Window_CoefsR  The coefficients in the group will be modified per the
-                         formula for M/S stereo on each scalefactor band where
-                         M/S stereo is active.
-
-   q_formatLeft          The q_format may be modified on scalefactor bands
-                         where M/S stereo is active.
-
-   q_formatRight         The q_format may be modified on scalefactor bands
-                         where M/S stereo is active.
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This module applies the formula for M/S coding to one grouped scalefactor
- band.  The ISO code has a similar function which applies M/S coding to an
- entire frame.
-
- It is the calling function's responsibility to check the map_mask array, which
- is filled by the function getmask.  If a scalefactor band is identified as
- using M/S stereo, the coefficients in that array are calculated using
- the following formula...
-
- TempLeft = LeftCoefficient;
-
- LeftCoefficient  = LeftCoefficient  + RightCoefficient;
- RightCoefficient = TempLeft         - RightCoefficient;
-
- This function should be inlined if the compiler supports C99 inlining,
- as this short function is only called by sfb_tools_ms().
- Therefore, inlining will not increase the code size.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.7.1   M/S stereo
-        Subpart 4.6.2     ScaleFactors
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    start_indx = 0;
-
-    pCoefR = coefLeft;
-    pCoefL = coefRight;
-
-    FOR (win_indx = wins_in_group; win_indx > 0; win_indx--)
-
-
-        tempInt = q_formatLeft[start_indx] - q_formatRight[start_indx];
-
-        IF (tempInt > 0)
-        THEN
-
-            shift_left_chan  = 1 + tempInt;
-            shift_right_chan = 1;
-
-            q_formatLeft[start_indx]  = (q_formatRight[start_indx] - 1);
-            q_formatRight[start_indx] = (q_formatRight[start_indx] - 1);
-
-        ELSE
-            shift_left_chan  = 1;
-            shift_right_chan = 1 - tempInt;
-
-            q_formatRight[start_indx] = (q_formatLeft[start_indx] - 1);
-            q_formatLeft[start_indx]  = (q_formatLeft[start_indx] - 1);
-
-        ENDIF
-
-        FOR (tempInt = band_length; tempInt > 0; tempInt--)
-
-            temp_left  = *(pCoefL) >> shift_left_chan;
-            temp_right = *(pCoefR) >> shift_right_chan;
-
-            *(pCoefL++) = temp_left + temp_right;
-            *(pCoefR++) = temp_left - temp_right;
-
-        ENDFOR
-
-        tempInt = (coef_per_win - band_length);
-
-        pCoefR = pCoefR + tempInt;
-        pCoefL = pCoefL + tempInt;
-
-        start_indx = start_indx + num_bands;
-
-    ENDFOR
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-   resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "ms_synt.h"
-#include "fxp_mul32.h"
-#include "aac_mem_funcs.h"
-#include "window_block_fxp.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void ms_synt(
-    const Int   wins_in_group,
-    const Int   coef_per_win,
-    const Int   num_bands,
-    const Int   band_length,
-    Int32 coefLeft[],
-    Int32 coefRight[],
-    Int q_formatLeft[],
-    Int q_formatRight[])
-{
-
-    Int32 *pCoefL = coefLeft;
-    Int32 *pCoefR = coefRight;
-    Int start_indx = 0;
-
-
-    if (band_length < 0 || band_length > LONG_WINDOW)
-    {
-        return;     /*  avoid any processing on error condition */
-    }
-
-
-    Int nextWinPtrUpdate = (coef_per_win - band_length);
-
-    for (Int win_indx = wins_in_group; win_indx > 0; win_indx--)
-    {
-
-        if (q_formatRight[start_indx] < 31)
-        {
-            Int tempInt = q_formatLeft[start_indx] - q_formatRight[start_indx];
-
-            /* Normalize the left and right channel to the same q-format */
-            if (tempInt > 0)
-            {
-                /*
-                 * shift_left_chan and shift_right_chan each have an offset
-                 * of 1.  Even if the left and right channel share the same
-                 * q-format, we must shift each by 1 to guard against
-                 * overflow.
-                 */
-                Int shift_left_chan  = 1 + tempInt;
-
-                /*
-                 * Following code line is equivalent to...
-                 * q_formatLeft  = q_formatRight - 1;
-                 * q_formatRight = q_formatRight - 1;
-                 */
-                q_formatLeft[start_indx] = --(q_formatRight[start_indx]);
-
-
-                /*
-                 *  band_length is always an even number (check tables in pg.66 IS0 14496-3)
-                 */
-
-                Int32 temp_left  = *(pCoefL) >> shift_left_chan;
-                Int32 temp_right = *(pCoefR) >> 1;
-
-
-
-                for (Int i = band_length; i != 0; i--)
-                {
-                    *(pCoefL++) = temp_left + temp_right;
-                    *(pCoefR++) = temp_left - temp_right;
-                    temp_left  = *(pCoefL) >> shift_left_chan;
-                    temp_right = *(pCoefR) >> 1;
-
-                }
-
-            }
-            else
-            {
-                /*
-                 * shift_left_chan and shift_right_chan each have an offset
-                 * of 1.  Even if the left and right channel share the same
-                 * q-format, we must shift each by 1 to guard against
-                 * overflow.
-                 */
-                Int shift_right_chan = 1 - tempInt;
-
-                /*
-                 * Following code line is equivalent to...
-                 * q_formatRight = q_formatLeft - 1;
-                 * q_formatLeft  = q_formatLeft - 1;
-                 */
-                q_formatRight[start_indx] = --(q_formatLeft[start_indx]);
-
-                /*
-                 *  band_length is always an even number (check tables in pg.66 IS0 14496-3)
-                 */
-
-                Int32 temp_left  = *(pCoefL) >> 1;
-                Int32 temp_right = *(pCoefR) >> shift_right_chan;
-
-                for (Int i = band_length; i != 0; i--)
-                {
-                    *(pCoefL++) = temp_left + temp_right;
-                    *(pCoefR++) = temp_left - temp_right;
-
-                    temp_left  = *(pCoefL) >> 1;
-                    temp_right = *(pCoefR) >> shift_right_chan;
-
-                }
-            }
-
-        }
-        else
-        {
-            /*
-             *  Nothing on right channel, just copy left into right
-             */
-            q_formatRight[start_indx] = (q_formatLeft[start_indx]);
-
-            pv_memcpy(pCoefR, pCoefL, band_length*sizeof(*pCoefR));
-            pCoefR += band_length;
-            pCoefL += band_length;
-        }
-
-        /*
-         * Increment the window pointers so they point
-         * to the next window in the group
-         */
-        pCoefL += nextWinPtrUpdate;
-        pCoefR += nextWinPtrUpdate;
-
-        start_indx += num_bands;
-
-    } /* for (win_indx) */
-
-    return;
-
-} /* MS_synt */
diff --git a/media/libstagefright/codecs/aacdec/ms_synt.h b/media/libstagefright/codecs/aacdec/ms_synt.h
deleted file mode 100644
index a00e6e2..0000000
--- a/media/libstagefright/codecs/aacdec/ms_synt.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ms_synt.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Updated to reflect new functionality of ms_synt() routine.
- (ms_synt now only decodes one grouped scalefactor band at a time.)
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file includes the function declaration for ms_synt().
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef MS_SYNT_H
-#define MS_SYNT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void ms_synt(
-    const Int   wins_in_group,
-    const Int   coef_per_win,
-    const Int   num_bands,
-    const Int   band_length,
-    Int32 spectralCoefLeft[],
-    Int32 spectralCoefRight[],
-    Int   q_formatLeft[],
-    Int   q_formatRight[]);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/pns_corr.cpp b/media/libstagefright/codecs/aacdec/pns_corr.cpp
deleted file mode 100644
index 4cfe720..0000000
--- a/media/libstagefright/codecs/aacdec/pns_corr.cpp
+++ /dev/null
@@ -1,342 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pns_corr.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Made changes per review comments, the most major of which
- being the change of the scaling into a 16 x 16 multiply.
-
- Description: When the multiplication of two 16-bits variables is stored in
-              an 32-bits variable, the result should be typecasted explicitly
-              to Int32 before it is stored.
-              *(pCoefRight++) = (Int32) tempInt2 * multiplier;
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    scale        =  Multiplier used to scale the noise extracted from the left
-                    channel for use on the right.
-                    [const Int]
-
-    coef_per_win =  Number of coefficients per window.
-                    (128 for short, 1024 for long)
-                    [const Int]
-
-    sfb_per_win  =  Number of scalefactors per window.
-                    [const Int]
-
-    wins_in_group = The number of windows in the group being decoded.
-                    [const Int]
-
-    band_length  =  The length of the scalefactor band being decoded.
-                    [const Int]
-
-    sfb_prediction_used =  Flag that denotes the activation of long term
-                           prediction on a per-scalefactor band,
-                           non-grouped basis.
-                           [const Int *, length MAX_SFB]
-
-    q_formatLeft = The Q-format for the left channel's fixed-point spectral
-                   coefficients, on a per-scalefactor band, non-grouped basis.
-                   [const Int]
-
-    q_formatRight = The Q-format for the right channel's fixed-point spectral
-                    coefficients, on a per-scalefactor band, non-grouped basis.
-                    [Int *, length MAX_SFB]
-
-    coefLeft = Array containing the fixed-point spectral coefficients
-               for the left channel.
-               [const Int32 *, length 1024]
-
-    coefRight = Array containing the fixed-point spectral coefficients
-                for the right channel.
-                [Int32 *, length 1024]
-
- Local Stores/Buffers/Pointers Needed:
-
- Global Stores/Buffers/Pointers Needed:
-
- Outputs:
-
- Pointers and Buffers Modified:
-    pcoefRight  Contains the new spectral information
-
-    q_formatRight       Q-format may be updated with changed to fixed-point
-                        data in coefRight.
-
-    sfb_prediction_used              LTP may be disabled by presence of PNS tool on the
-                        same scalefactor band.
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function derives noise from the left channel.  The PNS tool is assumed
- to have been used on the same scalefactor band on the left channel.  The
- noise on the left/right channels are not necessarily of the same amplitude,
- and therefore have separate scalefactors.  The noise is thus scaled by the
- difference between the two transmitted scalefactors.  This scaling is done
- in fixed-point using a constant 4-element table.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.7.1   M/S stereo
-        Subpart 4.6.12.3  Decoding Process (PNS)
-        Subpart 4.6.2     ScaleFactors
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    q_format = q_formatLeft - (scale >> 2);
-    q_format = q_format - 1;
-    q_formatRight = q_format;
-
-    multiplier = hcb2_scale_mod_4[scale & 0x3];
-
-    pCoefLeft = coefLeft;
-    pCoefRight = coefRight;
-
-    start_indx = 0;
-
-    FOR (win_indx = wins_in_group; win_indx > 0; win_indx--)
-
-        q_formatRight[start_indx] = q_format;
-
-        sfb_prediction_used[start_indx] = FALSE;
-
-        start_indx = start_indx + sfb_per_win;
-
-        FOR (tempInt = band_length; tempInt > 0; tempInt--)
-
-            *(pCoefRight) = (*(pCoefLeft) >> 9) * multiplier;
-            pCoefRight = pCoefRight + 1;
-            pCoefLeft = pCoefLeft + 1;
-
-        ENDFOR
-
-        tempInt = (coef_per_win - band_length);
-        pCoefRight = pCoefRight + tempInt;
-        pCoefLeft = pCoefLeft + tempInt;
-
-    ENDFOR
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "pns_corr.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-const UInt hcb2_scale_mod_4[4] =
-{
-    32768,  /* (2.0^0.00)*2^15 */
-    38968,  /* (2.0^0.25)*2^15 */
-    46341,  /* (2.0^0.50)*2^15 */
-    55109
-}; /* (2.0^0.75)*2^15 */
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void pns_corr(
-    const Int scale,
-    const Int coef_per_win,
-    const Int sfb_per_win,
-    const Int wins_in_group,
-    const Int band_length,
-    const Int q_formatLeft,
-    Int q_formatRight[],
-    const Int32 coefLeft[],
-    Int32 coefRight[])
-{
-    Int tempInt;
-    Int nextWinPtrUpdate;
-
-    Int q_format;
-
-    Int start_indx;
-    Int win_indx;
-
-    const Int32   *pCoefLeft;
-    Int32   *pCoefRight;
-
-    UInt multiplier;
-
-    /*
-     * Generate noise correlated with the noise on the left channel
-     *
-     */
-
-    /*
-     * scale is interpreted as 2^(scale/4)
-     * Therefore, we can adjust the q-format by floor(scale/4)
-     * and save some complexity in the multiplier.
-     */
-    q_format = q_formatLeft - (scale >> 2);
-
-    /*
-     * Reduce the q-format by 1 to guard against overflow.
-     * This must be done because the hcb2_scale_mod_4 table
-     * must be stored in a common q-format, and we must shift
-     * by 16 to get *pCoefLeft into a 16-bit value, but we
-     * cannot store 2^0*2^16 and 2^0.75*2^16 in a table.
-     */
-    q_format--;
-
-    multiplier = hcb2_scale_mod_4[scale & 0x3];
-
-    pCoefLeft  = coefLeft;
-    pCoefRight = coefRight;
-
-    nextWinPtrUpdate = (coef_per_win - band_length);
-
-    /*
-     * Step through all the windows in this group, replacing this
-     * band in each window's spectrum with correlated random noise
-     */
-
-    start_indx = 0;
-
-    for (win_indx = wins_in_group; win_indx > 0; win_indx--)
-    {
-        /*
-         * Set the q-format for all scalefactor bands in the group.
-         * Normally, we could not assume that grouped scalefactors
-         * share the same q-format.
-         * However, here we can make this assumption.  The reason
-         * being -- if this function is called, it is assumed
-         * PNS was used on the left channel.  When PNS is used,
-         * all scalefactors in a group share the same q-format.
-         *
-         */
-        q_formatRight[start_indx] = q_format;
-
-        start_indx += sfb_per_win;
-
-        /* reconstruct right noise values */
-        for (tempInt = band_length; tempInt > 0; tempInt--)
-        {
-            *(pCoefRight++) = (Int32)(*(pCoefLeft++) >> 16) * multiplier;
-        }
-
-        pCoefRight += nextWinPtrUpdate;
-        pCoefLeft  += nextWinPtrUpdate;
-
-    } /* for (win_indx) */
-
-    return;
-
-} /* void pns_corr */
diff --git a/media/libstagefright/codecs/aacdec/pns_corr.h b/media/libstagefright/codecs/aacdec/pns_corr.h
deleted file mode 100644
index c892a8c..0000000
--- a/media/libstagefright/codecs/aacdec/pns_corr.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pns_corr.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Made changes per review comments.
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Contains the function declaration for pns_corr.c
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PNS_CORR_H
-#define PNS_CORR_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void pns_corr(
-    const Int scale,
-    const Int coef_per_win,
-    const Int sfb_per_win,
-    const Int wins_in_group,
-    const Int band_length,
-    const Int q_formatLeft,
-    Int q_formatRight[],
-    const Int32 coefLeft[],
-    Int32 coefRight[]);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/pns_intensity_right.cpp b/media/libstagefright/codecs/aacdec/pns_intensity_right.cpp
deleted file mode 100644
index f2d50c1..0000000
--- a/media/libstagefright/codecs/aacdec/pns_intensity_right.cpp
+++ /dev/null
@@ -1,653 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pns_intensity_right.c
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    hasmask    = mask status for the frame. Enumerated.
-
-    pFrameInfo = Pointer to structure that holds information about each group.
-                 (long block flag, number of windows, scalefactor bands
-                  per group, etc.)
-                 [const pFrameInfo * const]
-
-    group      = Array that contains indexes of the
-                 first window in the next group.
-                 [const Int *, length num_win]
-
-    mask_map   = Array that denotes whether M/S stereo is turned on for
-                 each grouped scalefactor band.
-                 [const Int *, length MAX_SFB]
-
-    codebook_map = Array that denotes which Huffman codebook was used for
-                   the encoding of each grouped scalefactor band.
-                   [const Int *, length MAX_SFB]
-
-    factorsL     =  Array of grouped scalefactors for left chan.
-                    [const Int *, length MAX_SFB]
-
-    factorsR     =  Array of scalefactors for right chan.
-                    [const Int *, length MAX_SFB]
-
-    sfb_prediction_used =  Flag that denotes the activation of long term prediction
-                           on a per-scalefactor band, non-grouped basis.
-                           [const Int *, length MAX_SFB]
-
-    ltp_data_present = Flag that indicates whether LTP is enbaled for this frame.
-                       [const Bool]
-
-    coefLeft = Array containing the fixed-point spectral coefficients
-                       for the left channel.
-                       [Int32 *, length 1024]
-
-    coefRight = Array containing the fixed-point spectral coefficients
-                        for the right channel.
-                        [Int32 *, length 1024]
-
-    q_formatLeft = The Q-format for the left channel's fixed-point spectral
-                   coefficients, on a per-scalefactor band, non-grouped basis.
-                   [Int *, length MAX_SFB]
-
-    q_formatRight = The Q-format for the right channel's fixed-point spectral
-                    coefficients, on a per-scalefactor band, non-grouped basis.
-                    [Int *, length MAX_SFB]
-
-    pCurrentSeed  = Pointer to the current seed for the random number
-                    generator in the function gen_rand_vector().
-                    [Int32 * const]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    coefLeft  = Contains the new spectral information.
-
-    coefRight = Contains the new spectral information.
-
-    q_formatLeft      = Q-format may be updated with changed to fixed-point
-                        data in coefLeft.
-
-    q_formatRight     = Q-format may be updated with changed to fixed-point
-                        data in coefRight.
-
-    pCurrentSeed      = Value pointed to by pCurrentSeed updated by calls
-                        to gen_rand_vector().
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function steps through all of the scalefactor bands, looking for
- either PNS or IS to be enabled on the right channel.
-
- If the codebook used is >= NOISE_HCB, the code then checks for the use
- of Huffman codebooks NOISE_HCB, INTENSITY_HCB, or INTENSITY_HCB2.
-
- When a SFB utilizing the codebook NOISE_HCB is detected, a check is made to
- see if M/S has also been enabled for that SFB.
-
- If M/S is not enabled, the band's spectral information is filled with
- scaled random data.   The scaled random data is generated by the function
- gen_rand_vector.  This is done across all windows in the group.
-
- If M/S is enabled, the band's spectral information is derived from the data
- residing in the same band on the left channel.  The information on the right
- channel has independent scaling, so this is a bit more involved than a
- direct copy of the information on the left channel.  This is done by calling
- the inline function pns_corr().
-
- When a SFB utilizing an intensity codebook is detected, the band's spectral
- information is generated from the information on the left channel.
- This is done across all windows in the group.  M/S being enabled has the
- effect of reversing the sign of the data on the right channel.  This code
- resides in the inline function intensity_right().
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.7.1   M/S stereo
-        Subpart 4.6.7.2.3 Decoding Process (Intensity Stereo)
-        Subpart 4.6.12.3  Decoding Process (PNS)
-        Subpart 4.6.2     ScaleFactors
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-    pCoefRight = coefRight;
-    pCoefLeft = coefLeft;
-
-    window_start = 0;
-    tot_sfb = 0;
-    start_indx = 0;
-
-    coef_per_win = pFrameInfo->coef_per_win[0];
-
-    sfb_per_win = pFrameInfo->sfb_per_win[0];
-
-    DO
-        pBand     = pFrameInfo->win_sfb_top[window_start];
-
-        partition = *pGroup;
-        pGroup = pGroup + 1;
-
-        band_start = 0;
-
-        wins_in_group = (partition - window_start);
-
-        FOR (sfb = sfb_per_win; sfb > 0; sfb--)
-
-            band_stop = *(pBand);
-            pBand = pBand + 1;
-
-            codebook = *(pCodebookMap);
-            pCodebookMap = pCodebookMap + 1;
-
-            mask_enabled = *(pMaskMap);
-            pMaskMap = pMaskMap + 1;
-
-            band_length = band_stop - band_start;
-
-            IF (codebook == NOISE_HCB)
-
-                sfb_prediction_used[tot_sfb] &= ltp_data_present;
-
-                IF (sfb_prediction_used[tot_sfb] == FALSE)
-
-                    mask_enabled = mask_enabled AND hasmask;
-
-                    IF (mask_enabled == FALSE)
-
-                        pWindow_CoefR = &(pCoefRight[band_start]);
-
-                        start_indx = tot_sfb;
-
-                        FOR (win_indx = wins_in_group;
-                             win_indx > 0;
-                             win_indx--)
-
-                            CALL
-                            q_formatRight[start_indx] =
-                                 gen_rand_vector(
-                                     pWindow_CoefR,
-                                     band_length,
-                                     pCurrentSeed,
-                                     *(pFactorsRight));
-                            MODIFYING
-                                pCoefRight[band_start]
-                            RETURNING
-                                q_formatRight[start_indx]
-
-                            pWindow_CoefR += coef_per_win;
-
-                            start_indx = start_indx + sfb_per_win;
-
-                        ENDFOR
-
-                    ELSE
-                        CALL
-                        pns_corr(
-                             (*(pFactorsRight) -
-                              *(pFactorsLeft) ),
-                             coef_per_win,
-                             sfb_per_win,
-                             wins_in_group,
-                             band_length,
-                             q_formatLeft[tot_sfb],
-                            &(q_formatRight[tot_sfb]),
-                            &(pCoefLeft[band_start]),
-                            &(pCoefRight[band_start]));
-
-                        MODIFYING
-                            pCoefRightt[band_start]
-                            q_formatRight[tot_sfb]
-                        RETURNING
-                NONE
-                    ENDIF
-
-                ENDIF
-
-            ELSE IF (codebook >= INTENSITY_HCB2)
-
-                mask_enabled = mask_enabled AND hasmask;
-
-                CALL
-                    intensity_right(
-                        *(pFactorsRight),
-                        coef_per_win,
-                        sfb_per_win,
-                        wins_in_group,
-                        band_length,
-                        codebook,
-                        mask_enabled,
-                       &(q_formatLeft[tot_sfb]),
-                       &(q_formatRight[tot_sfb]),
-                       &(pCoefLeft[band_start]),
-                       &(pCoefRight[band_start]));
-
-                MODIFYING
-                    pCoefRightt[band_start]
-                    q_formatRight[tot_sfb]
-                RETURNING
-                    NONE
-
-            ENDIF
-
-            band_start = band_stop;
-
-            tot_sfb = tot_sfb + 1;
-
-        ENDFOR
-
-        coef_per_win = coef_per_win * (wins_in_group);
-
-        wins_in_group = wins_in_group - 1;
-
-        tot_sfb = tot_sfb + sfb_per_win * wins_in_group;
-        pFactorsRight = pFactorsRight + sfb_per_win * wins_in_group;
-        pFactorsLeft  = pFactorsLeft + sfb_per_win * wins_in_group;
-
-        pCoefRight = pCoefRight + coef_per_win;
-        pCoefLeft  = pCoefLeft + coef_per_win;
-
-        window_start = partition;
-
-    WHILE (partition < pFrameInfo->num_win);
-
-    return;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "pns_intensity_right.h"
-#include "e_huffmanconst.h"
-#include "gen_rand_vector.h"
-#include "intensity_right.h"
-#include "pns_corr.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void pns_intensity_right(
-    const Int        hasmask,
-    const FrameInfo * const pFrameInfo,
-    const Int        group[],
-    const Bool       mask_map[],
-    const Int        codebook_map[],
-    const Int        factorsL[],
-    const Int        factorsR[],
-    Int        sfb_prediction_used[],
-    const Bool       ltp_data_present,
-    Int32      coefLeft[],
-    Int32      coefRight[],
-    Int        q_formatLeft[MAXBANDS],
-    Int        q_formatRight[MAXBANDS],
-    Int32 * const pCurrentSeed)
-{
-
-    Int32   *pCoefRight;
-    Int32   *pWindow_CoefR;
-
-    Int32   *pCoefLeft;
-
-    Int     tot_sfb;
-    Int     start_indx;
-    Int     sfb;
-
-    Int     band_length;
-    Int     band_start;
-    Int     band_stop;
-    Int     coef_per_win;
-
-    Int     codebook;
-    Int     partition;
-    Int     window_start;
-
-    Int     sfb_per_win;
-    Int     wins_in_group;
-    Int     win_indx;
-
-    const Int16 *pBand;
-    const Int   *pFactorsLeft  = factorsL;
-    const Int   *pFactorsRight = factorsR;
-    const Int   *pCodebookMap  = codebook_map;
-    const Int   *pGroup        = group;
-    const Bool  *pMaskMap      = mask_map;
-
-    Bool mask_enabled;
-
-    pCoefRight = coefRight;
-    pCoefLeft = coefLeft;
-
-    window_start = 0;
-    tot_sfb = 0;
-    start_indx = 0;
-
-    /*
-     * Each window in the frame should have the same number of coef's,
-     * so coef_per_win is constant in all the loops
-     */
-    coef_per_win = pFrameInfo->coef_per_win[0];
-
-    /*
-     * Because the number of scalefactor bands per window should be
-     * constant for each frame, sfb_per_win can be determined outside
-     * of the loop.
-     *
-     * For 44.1 kHz sampling rate   sfb_per_win = 14 for short windows
-     *                              sfb_per_win = 49 for long  windows
-     */
-
-    sfb_per_win = pFrameInfo->sfb_per_win[0];
-
-    do
-    {
-        pBand     = pFrameInfo->win_sfb_top[window_start];
-
-        /*----------------------------------------------------------
-        Partition is equal to the first window in the next group
-
-        { Group 0    }{      Group 1      }{    Group 2 }{Group 3}
-        [win 0][win 1][win 2][win 3][win 4][win 5][win 6][win 7]
-
-        pGroup[0] = 2
-        pGroup[1] = 5
-        pGroup[2] = 7
-        pGroup[3] = 8
-        -----------------------------------------------------------*/
-        partition = *(pGroup++);
-
-        band_start = 0;
-
-        wins_in_group = (partition - window_start);
-
-        for (sfb = sfb_per_win; sfb > 0; sfb--)
-        {
-            /* band is offset table, band_stop is last coef in band */
-            band_stop = *(pBand++);
-
-            codebook = *(pCodebookMap++);
-
-            mask_enabled = *(pMaskMap++);
-
-            /*
-             * When a tool utilizing sfb is found, apply the correct tool
-             * to that sfb in each window in the group
-             *
-             * Example...  sfb[3] == NOISE_HCB
-             *
-             * [ Group 1                                      ]
-             * [win 0                 ][win 1                 ]
-             * [0][1][2][X][4][5][6][7][0][1][2][X][4][5][6][7]
-             *
-             * The for(sfb) steps through the sfb's 0-7 in win 0.
-             *
-             * Finding sfb[3]'s codebook == NOISE_HCB, the code
-             * steps through all the windows in the group (they share
-             * the same scalefactors) and replaces that sfb with noise.
-             */
-
-            /*
-             * Experimental results suggest that ms_synt is the most
-             * commonly used tool, so check for it first.
-             *
-             */
-
-            band_length = band_stop - band_start;
-
-            if (codebook == NOISE_HCB)
-            {
-                sfb_prediction_used[tot_sfb] &= ltp_data_present;
-
-                if (sfb_prediction_used[tot_sfb] == FALSE)
-                {
-                    /*
-                     * The branch and the logical AND interact in the
-                     * following manner...
-                     *
-                     * mask_enabled == 0 hasmask == X -- gen_rand_vector
-                     * mask_enabled == 1 hasmask == 1 -- pns_corr
-                     * mask_enabled == 0 hasmask == 1 -- gen_rand_vector
-                     * mask_enabled == 1 hasmask == 2 -- gen_rand_vector
-                     * mask_enabled == 0 hasmask == 2 -- gen_rand_vector
-                     */
-
-                    mask_enabled &= hasmask;
-
-                    if (mask_enabled == FALSE)
-                    {
-                        pWindow_CoefR = &(pCoefRight[band_start]);
-
-                        /*
-                         * Step through all the windows in this group,
-                         * replacing this band in each window's
-                         * spectrum with random noise
-                         */
-                        start_indx = tot_sfb;
-
-                        for (win_indx = wins_in_group;
-                                win_indx > 0;
-                                win_indx--)
-                        {
-
-                            /* generate random noise */
-                            q_formatRight[start_indx] =
-                                gen_rand_vector(
-                                    pWindow_CoefR,
-                                    band_length,
-                                    pCurrentSeed,
-                                    *(pFactorsRight));
-
-                            pWindow_CoefR += coef_per_win;
-
-                            start_indx += sfb_per_win;
-                        }
-
-                    }
-                    else
-                    {
-                        pns_corr(
-                            (*(pFactorsRight) -
-                             *(pFactorsLeft)),
-                            coef_per_win,
-                            sfb_per_win,
-                            wins_in_group,
-                            band_length,
-                            q_formatLeft[tot_sfb],
-                            &(q_formatRight[tot_sfb]),
-                            &(pCoefLeft[band_start]),
-                            &(pCoefRight[band_start]));
-
-                    } /* if (mask_map == FALSE) */
-
-                } /* if (sfb_prediction_used[tot_sfb] == FALSE) */
-
-            } /* if (codebook == 0) */
-            else if (codebook >= INTENSITY_HCB2)
-            {
-                /*
-                 * The logical AND flags the inversion of intensity
-                 * in the following manner.
-                 *
-                 * mask_enabled == X hasmask == 0 -- DO NOT INVERT
-                 * mask_enabled == 0 hasmask == X -- DO NOT INVERT
-                 * mask_enabled == 1 hasmask == 1 -- DO     INVERT
-                 * mask_enabled == 0 hasmask == 1 -- DO NOT INVERT
-                 * mask_enabled == 1 hasmask == 2 -- DO NOT INVERT
-                 * mask_enabled == 0 hasmask == 2 -- DO NOT INVERT
-                 */
-
-                mask_enabled &= hasmask;
-
-                intensity_right(
-                    *(pFactorsRight),
-                    coef_per_win,
-                    sfb_per_win,
-                    wins_in_group,
-                    band_length,
-                    codebook,
-                    mask_enabled,
-                    &(q_formatLeft[tot_sfb]),
-                    &(q_formatRight[tot_sfb]),
-                    &(pCoefLeft[band_start]),
-                    &(pCoefRight[band_start]));
-
-            } /* END else codebook must be INTENSITY_HCB or ... */
-
-            band_start = band_stop;
-
-            tot_sfb++;
-
-            pFactorsLeft++;
-            pFactorsRight++;
-
-        } /* for (sfb) */
-
-        /*
-         * Increment pCoefRight and pCoefLeft by
-         * coef_per_win * the number of windows
-         */
-
-        pCoefRight += coef_per_win * wins_in_group;
-        pCoefLeft  += coef_per_win * wins_in_group--;
-
-        /*
-         * Increase tot_sfb by sfb_per_win times the number of windows minus 1.
-         * The minus 1 comes from the fact that tot_sfb is already pointing
-         * to the first sfb in the 2nd window of the group.
-         */
-        tot_sfb += sfb_per_win * wins_in_group;
-
-        pFactorsRight += sfb_per_win * wins_in_group;
-        pFactorsLeft  += sfb_per_win * wins_in_group;
-
-        window_start = partition;
-
-    }
-    while (partition < pFrameInfo->num_win);
-
-    /* pFrameInfo->num_win = 1 for long windows, 8 for short_windows */
-
-    return;
-
-} /* pns_intensity_right() */
-
-
diff --git a/media/libstagefright/codecs/aacdec/pns_intensity_right.h b/media/libstagefright/codecs/aacdec/pns_intensity_right.h
deleted file mode 100644
index 7b6f79f..0000000
--- a/media/libstagefright/codecs/aacdec/pns_intensity_right.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pns_intensity_right.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Add hasmask parameter
-
- Description: Changed name to from right_ch_sfb_tools_ms to intensity_right
- to more correct reflect the purpose of the function.
-
- Who:                                  Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file contains the function declaration for
- pns_intensity_right.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PNS_INTENSITY_RIGHT_H
-#define PNS_INTENSITY_RIGHT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_frameinfo.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void pns_intensity_right(
-    const Int        hasmask,
-    const FrameInfo * const pFrameInfo,
-    const Int        group[],
-    const Bool       mask_map[],
-    const Int        codebook_map[],
-    const Int        factorsL[],
-    const Int        factorsR[],
-    Int        sfb_prediction_used[],
-    const Bool       ltp_data_present,
-    Int32      spectralCoefLeft[],
-    Int32      spectralCoefRight[],
-    Int        q_formatLeft[MAXBANDS],
-    Int        q_formatRight[MAXBANDS],
-    Int32     * const pCurrentSeed);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/pns_left.cpp b/media/libstagefright/codecs/aacdec/pns_left.cpp
deleted file mode 100644
index 2446de2..0000000
--- a/media/libstagefright/codecs/aacdec/pns_left.cpp
+++ /dev/null
@@ -1,431 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Pathname: pns_left.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Brought code in-line with PV standards.
-               Merged PNS and Intensity blocks into one function.
-               Modified routine to interface with a fixed-point implementation.
-               Modified variable names for clarity.
-               Improved for-loop structure that was previously checking
-               the codebook used in each scale factor band multiple times.
-
- Description:  Added some comments for clarity.
-
- Description:  Changed strategy for q-format.  Q-format for SFBs should not
- be grouped.
-
- Description: Function had to be modified to obey new interpretation of the
- sfb_prediction_used flag.  LTP takes precedence, and PNS should not be
- executed when a collision occurs between these two tools.
-
- Description:
- (1) Added flag "ltp_data_present"
- (2) Where feasible, I updated the code to resemble right_ch_sfb_tools_ms.c
-     Just for conformance, readability.
-
- Description: Added include file - "e_huffmanconst.h"
-
- Description: The same "Factors" pointer indexing problem that existed in
- right_ch_sfb_tools_ms also existed here in pns_left.c
-
- Description:  Modified how groups and windows are handled, as the multigroup
- case was not correct
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    const FrameInfo *pFrameInfo         = Pointer to structure that holds
-                                          information about each group.
-                                          (long block flag,
-                                           number of windows,
-                                           scalefactor bands per group, etc.)
-
-    const Int        group[]            = Array that contains indexes of the
-                                          the first window in the next group.
-
-    const Int        codebook_map[]     = Array that denotes which Huffman
-                                          codebook was used for the encoding
-                                          of each scalefactor band.
-
-    const Int        factors[]          = Array of scalefactors
-
-    Int              sfb_prediction_used[] = Flag that denotes the activation
-                                             of long term prediction on a sfb
-                                             basis.
-
-    Bool             ltp_data_present   = Flag that denotes whether LTP
-                                          is active for the entire frame.  If
-                                          this flag is FALSE,
-                                          sfb_prediction_used is garbage.
-
-    Int32            spectral_coef[]    = Array of pointers pointing to the
-                                          spectral coef's for the LEFT channel.
-
-    Int              q_format[]           = Q-format for the information
-                                            pointed to by spectral_coef.
-                                            Indexed by scalefactor band.
-
-    Int32           *pCurrentSeed         = Pointer to the current seed for the
-                                            random number generator.
-                                            (gen_rand_vector)
-
- Local Stores/Buffers/Pointers Needed:
-
- Global Stores/Buffers/Pointers Needed:
-
- Outputs:
-
- Pointers and Buffers Modified:
-    Int32  spectral_coef[]    =   Contains the new spectral information
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- The function steps through each scalefactor band in the group, and
- checks for the use of Huffman codebook NOISE_HCB.
-
- When a SFB utilizing NOISE_HCB is detected, the band in every window in the
- group has its spectral information filled with scaled random data.
-
- The scaled random data is generated by the function gen_rand_vector.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This module shall replace bands that were encoded with the Huffman codebook
- NOISE_HCB with random noise as returned from gen_rand_vector().  The result
- shall be perceptually indistinguishable from the result obtained by the
- ISO decoder.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.5.5   Figures
-        Subpart 4.6.2   ScaleFactors
-        Subpart 4.6.12  Perceptual Noise Substituion (PNS)
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pFirst_Window_Coefs = spectral_coef;
-
-    window_start = 0;
-
-    tot_sfb = 0;
-
-    DO
-
-        num_bands = pFrameInfo->sfb_per_win[window_start];
-        pBand     = pFrameInfo->win_sfb_top[window_start];
-
-        partition = *(pGroup);
-        pGroup = pGroup + 1;
-
-        band_start = 0;
-
-        coef_per_win = pFrameInfo->coef_per_win[window_start];
-
-        wins_in_group = (partition - window_start);
-
-        FOR (sfb = num_bands; sfb > 0; sfb--)
-
-            band_stop = *pBand;
-            pBand = pBand + 1;
-
-            IF (*(pCodebookMap++) == NOISE_HCB )
-
-                tempInt = sfb_prediction_used[tot_sfb] AND ltp_data_present;
-
-                IF (tempInt == FALSE)
-
-                    pWindow_Coef = pFirst_Window_Coefs + band_start;
-
-                    band_length = (band_stop - band_start);
-
-                    start_indx = tot_sfb;
-
-                    tempInt = *(pFactors);
-
-                    FOR (win_indx = wins_in_group; win_indx > 0; win_indx--)
-
-                        CALL gen_rand_vector( pWindow_CoefR,
-                                              band_length,
-                                              pCurrentSeed,
-                                              tempInt);
-
-                        MODIFYING pWindow_CoefR = scaled random noise
-                                  pCurrentSeed  = current state of the random
-                                                  noise generator.
-
-                        RETURNING q_format[start_indx] = q-format for this sfb.
-
-                        pWindow_Coef = pWindow_Coef + coef_per_win;
-
-                        start_indx = start_indx +
-                                     pFrameInfo->sfb_per_win[win_indx];
-
-                    ENDFOR
-
-                ENDIF
-
-            ENDIF
-
-            band_start = band_stop;
-
-            tot_sfb = tot_sfb + 1;
-
-            pFactors = pFactors + 1;
-
-        ENDFOR
-
-        coef_per_win = coef_per_win * wins_in_group;
-        wins_in_group = wins_in_group - 1;
-
-        tot_sfb = tot_sfb + num_bands * wins_in_group;
-        pFactors = pFactors + num_bands * wins_in_group;
-
-        pFirst_Window_Coefs = pFirst_Window_Coefs + coef_per_win;
-
-        window_start = partition;
-
-    WHILE (partition < pFrameInfo->num_win);
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "pns_left.h"
-#include "e_huffmanconst.h"
-#include "gen_rand_vector.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void pns_left(
-    const FrameInfo *pFrameInfo,
-    const Int        group[],
-    const Int        codebook_map[],
-    const Int        factors[],
-    const Int        sfb_prediction_used[],
-    const Bool       ltp_data_present,
-    Int32      spectral_coef[],
-    Int        q_format[],
-    Int32     *pCurrentSeed)
-{
-
-    Int     tot_sfb;
-    Int     start_indx;
-
-    Int     sfb;
-    Int     band_stop;
-
-    const Int16  *pBand;
-
-    const Int *pCodebookMap = &(codebook_map[0]);
-    const Int *pGroup   = &(group[0]);
-    const Int *pFactors = &(factors[0]);
-
-    Int     tempInt;
-    Int32  *pWindow_Coef;
-
-
-    Int32   *spec;
-
-    Int partition;
-    Int win_indx;
-
-    tot_sfb = 0;
-
-    spec = spectral_coef;
-
-    /* PNS goes by group */
-    win_indx = 0;
-    partition = 0;
-    do
-    {
-        Int num_bands = pFrameInfo->sfb_per_win[partition];
-        pBand = pFrameInfo->win_sfb_top[partition];
-
-        /*----------------------------------------------------------
-        Partition is equal to the first window in the next group
-
-        { Group 0    }{      Group 1      }{    Group 2 }{Group 3}
-        [win 0][win 1][win 2][win 3][win 4][win 5][win 6][win 7]
-
-        pGroup[0] = 2
-        pGroup[1] = 5
-        pGroup[2] = 7
-        pGroup[3] = 8
-        -----------------------------------------------------------*/
-
-        partition = *pGroup++;      /* partition = index of last sbk in group */
-
-        do
-        {
-            Int band_start = 0;
-            for (sfb = 0; sfb < num_bands; sfb++)
-            {
-                band_stop = pBand[sfb]; /* band is offset table, band_stop is last coef in band */
-
-                Int band_length =  band_stop - band_start;
-                if (pCodebookMap[sfb] == NOISE_HCB)
-                {
-
-                    tempInt = sfb_prediction_used[tot_sfb] & ltp_data_present;
-
-                    if (tempInt == FALSE)
-                    {
-                        /* generate random noise */
-                        pWindow_Coef = spec + band_start;
-
-                        tempInt = pFactors[sfb];
-
-                        start_indx = tot_sfb++;
-
-                        /* reconstruct noise substituted values */
-                        /* generate random noise */
-
-                        q_format[start_indx] = gen_rand_vector(pWindow_Coef,
-                                                               band_length,
-                                                               pCurrentSeed,
-                                                               tempInt);
-
-                    }   /* if (sfb_prediction_used[tot_sfb] == FALSE) */
-
-                }   /* if (*(pCodebookMap++) == NOISE_HCB) */
-                else
-                {
-                    tot_sfb ++;     /*  update absolute sfb counter  */
-                }
-
-                band_start = band_stop;
-
-            }   /* for (sfb) */
-
-            spec += pFrameInfo->coef_per_win[win_indx++];
-            pFactors += num_bands;
-
-        }
-        while (win_indx < partition);
-
-        pCodebookMap += pFrameInfo->sfb_per_win[win_indx-1];
-
-    }
-    while (partition < pFrameInfo->num_win);
-
-
-    return;
-
-} /* pns */
diff --git a/media/libstagefright/codecs/aacdec/pns_left.h b/media/libstagefright/codecs/aacdec/pns_left.h
deleted file mode 100644
index c44b13c..0000000
--- a/media/libstagefright/codecs/aacdec/pns_left.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pns_left.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Removed #defines of LEFT and RIGHT, and the extra include
- file "e_huffmanconst.h"
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Contains the function definition for pns_left.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PNS_LEFT_H
-#define PNS_LEFT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_frameinfo.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void pns_left(
-        const FrameInfo *pFrameInfo,
-        const Int        group[],
-        const Int        codebook_map[],
-        const Int        factors[],
-        const Int        sfb_prediction_used[],
-        const Bool       ltp_data_present,
-        Int32      spectral_coef[],
-        Int        q_format[],
-        Int32     *pCurrentSeed);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
-
-
-
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/ps_all_pass_filter_coeff.cpp b/media/libstagefright/codecs/aacdec/ps_all_pass_filter_coeff.cpp
deleted file mode 100644
index 48432f8..0000000
--- a/media/libstagefright/codecs/aacdec/ps_all_pass_filter_coeff.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_all_pass_filter_coeff.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  Decorrelation is achieved by means of all-pass filtering
-
-
-     _______                                              ________
-    |       |                                  _______   |        |
-  ->|Hybrid | LF ----                         |       |->| Hybrid |-->
-    | Anal. |        |                        |       |  | Synth  |   QMF -> L
-     -------         o----------------------->|       |   --------    Synth
-QMF                  |                s_k(n)  |Stereo |-------------->
-Anal.              -------------------------->|       |
-     _______       | |                        |       |   ________
-    |       | HF --o |   -----------          |Process|  |        |
-  ->| Delay |      |  ->|           |-------->|       |->| Hybrid |-->
-     -------       |    |decorrelate| d_k(n)  |       |  | Synth  |   QMF -> R
-                   ---->|           |-------->|       |   --------    Synth
-                         -----------          |_______|-------------->
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include    "pv_audio_type_defs.h"
-#include    "s_ps_dec.h"
-#include    "ps_all_pass_filter_coeff.h"
-#include    "ps_all_pass_fract_delay_filter.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-const Int16 aRevLinkDecaySerCoeff[NO_ALLPASS_CHANNELS][NO_SERIAL_ALLPASS_LINKS] =
-{
-
-
-    { Qfmt15(0.74915491616071f),  Qfmt15(0.64942584030892f),  Qfmt15(0.56297290849050f) },
-    { Qfmt15(0.71658296328416f),  Qfmt15(0.62118993420853f),  Qfmt15(0.53849582551265f) },
-    { Qfmt15(0.68401101040761f),  Qfmt15(0.59295402810815f),  Qfmt15(0.51401874253480f) },
-    { Qfmt15(0.65143905753106f),  Qfmt15(0.56471812200776f),  Qfmt15(0.97908331911390f) },      /*  3  */
-    { Qfmt15(0.61886710465450f),  Qfmt15(0.53648221590737f),  Qfmt15(0.93012915315822f) },
-    { Qfmt15(0.58629515177795f),  Qfmt15(0.50824630980698f),  Qfmt15(0.88117498720252f) },
-    { Qfmt15(0.55372319890140f),  Qfmt15(0.48001040370660f),  Qfmt15(0.83222082124682f) },
-    { Qfmt15(0.52115124602484f),  Qfmt15(0.45177449760621f),  Qfmt15(0.78326665529112f) },
-    { Qfmt15(0.48857929314829f),  Qfmt15(0.42353859150582f),  Qfmt15(0.73431248933542f) },
-    { Qfmt15(0.45600734027174f),  Qfmt15(0.39530268540543f),  Qfmt15(0.68535832337974f) },
-    { Qfmt15(0.42343538739519f),  Qfmt15(0.36706677930504f),  Qfmt15(0.63640415742404f) },
-    { Qfmt15(0.39086343451863f),  Qfmt15(0.33883087320466f),  Qfmt15(0.58744999146834f) },
-    { Qfmt15(0.35829148164208f),  Qfmt15(0.31059496710427f),  Qfmt15(0.53849582551265f) },
-    { Qfmt15(0.32571952876553f),  Qfmt15(0.28235906100388f),  Qfmt15(0.48954165955695f) },
-    { Qfmt15(0.29314757588898f),  Qfmt15(0.25412315490349f),  Qfmt15(0.44058749360126f) },
-    { Qfmt15(0.26057562301242f),  Qfmt15(0.22588724880310f),  Qfmt15(0.39163332764556f) },
-    { Qfmt15(0.22800367013587f),  Qfmt15(0.19765134270272f),  Qfmt15(0.34267916168986f) },
-    { Qfmt15(0.19543171725932f),  Qfmt15(0.16941543660233f),  Qfmt15(0.29372499573418f) },
-    { Qfmt15(0.16285976438276f),  Qfmt15(0.14117953050194f),  Qfmt15(0.24477082977848f) },
-    { Qfmt15(0.13028781150621f),  Qfmt15(0.11294362440155f),  Qfmt15(0.19581666382278f) },
-    { Qfmt15(0.09771585862966f),  Qfmt15(0.08470771830116f),  Qfmt15(0.14686249786708f) },
-    { Qfmt15(0.06514390575311f),  Qfmt15(0.05647181220078f),  Qfmt15(0.09790833191140f) },
-    { Qfmt15(0.03257195287655f),  Qfmt15(0.02823590610039f),  Qfmt15(0.04895416595570f) }
-
-};
-
-
-
-
-
-const Char groupBorders[NO_IID_GROUPS + 1] =
-{
-    4,  5,  0,  1,  2,  3,  7,  6,   8,  9,  3,  4,
-    5,  6,  7,  8,  9,  11, 14, 18, 23, 35, 64
-};
-
-const Char bins2groupMap[NO_IID_GROUPS] =
-{
-    1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
-};
-
-
-
-
-/*
- *  q_phi = 0.39
- *
- *  cos(pi*([3:22]+0.5)*q_phi)
- */
-
-
-/*
- *  sin(-pi*([3:22]+0.5)*q_phi)
- */
-
-
-const Int32 aFractDelayPhaseFactor[NO_QMF_ALLPASS_CHANNELS] =
-{
-    0xCB5474A9,  0x5BEC5914, 0x72F3C7B0, 0xF1F480C6, 0x8389E21E,
-    0xB9BA6AFC,  0x4CDB665C, 0x7A57DA5D, 0x06088024, 0x89BECF04,
-    0xA9DB5EAC,  0x3BE5711F, 0x7EB9EDF7, 0x19F582A9, 0x92DDBD1F,
-    0x9C1B5008,  0x29767919, 0x7FFC0203, 0x2D3F8843, 0x9EABACDF
-};
-
-/*
- *  q(m) = { 0.43, 0.75, 0.347 }
- *
- *  cos(pi*([3:22]+0.5)*q(m))        cos(pi*([3:22]+0.5)'*q)
- *
- *  sin(-pi*([3:22]+0.5)*q(m))
- *
- */
-
-
-const Int32 aaFractDelayPhaseFactorSerQmf[NO_QMF_ALLPASS_CHANNELS][3] =
-{
-    { 0x02037FFC,  0xCF0489BE, 0x9BFB4FE0 },
-    { 0x7D5719F5,  0xCF047642, 0x18947D9E },
-    { 0x34AD8B57,  0x7642CF04, 0x7ABF244A },
-    { 0x99A4B325,  0x89BECF04, 0x58EFA3F1 },
-    { 0x9EAB5321,  0x30FC7642, 0xD77E8694 },
-    { 0x3BE5711F,  0x30FC89BE, 0x819CEBC7 },
-    { 0x7B77DE39,  0x89BE30FC, 0xB3A166B8 },
-    { 0xF9F88024,  0x764230FC, 0x37C57336 },
-    { 0x81E8E9FE,  0xCF0489BE, 0x7FF103D2 },
-    { 0xCF047642,  0xCF047642, 0x3E8B9052 },
-    { 0x68B9499A,  0x7642CF04, 0xB9E594E8 },
-    { 0x5EACA9DB,  0x89BECF04, 0x80A00CA5 },
-    { 0xC09590D1,  0x30FC7642, 0xD05276CA },
-    { 0x85A925A3,  0x30FC89BE, 0x53486134 },
-    { 0x0A0B7F9B,  0x89BE30FC, 0x7CB2E319 },
-    { 0x7EB91209,  0x764230FC, 0x20078412 },
-    { 0x2D3F8843,  0xCF0489BE, 0xA0ECAA4D },
-    { 0x9504B9BA,  0xCF047642, 0x880D2CAE },
-    { 0xA4145914,  0x7642CF04, 0xF0287F04 },
-    { 0x42E16D23,  0x89BECF04, 0x694C48C7 }
-};
-
-/*
- *  Fractional delay vector
- *
- *  phi_fract(k) = exp(-j*pi*q_phi*f_center(k))       0<= k <= SUBQMF_GROUPS
- *
- *  q_phi = 0.39
- *  f_center(k) frequency vector
- *
- *
- *  f_center(k) = {0.5/4,  1.5/4,  2.5/4,  3.5/4,
- *                -1.5/4, -0.5/4,
- *                 3.5/2,  2.5/2,  4.5/2,  5.5/2};
- */
-
-
-
-const Int32 aFractDelayPhaseFactorSubQmf[SUBQMF_GROUPS] =
-{
-    0x7E80EC79,  0x72BAC73D, 0x5C45A749, 0x3D398F97, 0x72BA38C3,
-    0x7E801387,  0xBA919478, 0x05068019, 0x895DCFF2, 0x834E1CE7,
-};
-
-
-
-
-
-/*
- *  Fractional delay length matrix
- *
- *  Q_fract(k,m) = exp(-j*pi*q(m)*f_center(k))
- *
- *  q(m) = { 0.43, 0.75, 0.347 }
- *  f_center(k) frequency vector
- *
- *
- *  f_center(k) = { 0.5/4,  1.5/4,  2.5/4,  3.5/4,
- *                 -1.5/4, -0.5/4,
- *                  3.5/2,  2.5/2,  4.5/2,  5.5/2};
- */
-
-const Int32 aaFractDelayPhaseFactorSerSubQmf[SUBQMF_GROUPS][3] =
-{
-
-    { 0x7E2EEA7D,  0x7A7DDAD8, 0x7ED0EE9D },
-    { 0x6FEDC1E5,  0x51349D0E, 0x7574CD1E },
-    { 0x5506A052,  0x0C8C809E, 0x636CAF62 },
-    { 0x3085898D,  0xC3A98F1D, 0x4A0D9799 },
-    { 0x6FED3E1B,  0x513462F2, 0x757432E2 },
-    { 0x7E2E1583,  0x7A7D2528, 0x7ED01163 },
-    { 0xA4C8A634,  0xB8E36A6E, 0xD5AF8732 },
-    { 0xF0F580E3,  0x8276E707, 0x1A7382C3 },
-    { 0x80ABF2F4,  0x471D6A6E, 0x9D2FAEA4 },
-    { 0x9478456F,  0x7D8AE707, 0x8152EDAB }
-};
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_all_pass_filter_coeff.h b/media/libstagefright/codecs/aacdec/ps_all_pass_filter_coeff.h
deleted file mode 100644
index 0358acb..0000000
--- a/media/libstagefright/codecs/aacdec/ps_all_pass_filter_coeff.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_all_pass_filter_coeff.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for all pass filter coefficients
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_ALL_PASS_FILTER_COEFF_H
-#define PS_ALL_PASS_FILTER_COEFF_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-extern const Char groupBorders[NO_IID_GROUPS + 1];
-extern const Int16 aRevLinkDecaySerCoeff[NO_ALLPASS_CHANNELS][NO_SERIAL_ALLPASS_LINKS];
-extern const Int32  aRevLinkDelaySer[];
-extern const Int16 aFractDelayPhaseFactorReQmf[NO_QMF_ALLPASS_CHANNELS];
-extern const Int16 aFractDelayPhaseFactorImQmf[NO_QMF_ALLPASS_CHANNELS];
-/* the old center frequencies (found in "else") were too small (factor 1/2) */
-extern const Int16 aFractDelayPhaseFactorReSubQmf[SUBQMF_GROUPS];
-extern const Int16 aFractDelayPhaseFactorImSubQmf[SUBQMF_GROUPS];
-extern const Int32 aFractDelayPhaseFactorSubQmf[SUBQMF_GROUPS];
-extern const Int32 aFractDelayPhaseFactor[NO_QMF_ALLPASS_CHANNELS];
-extern const Int32 aaFractDelayPhaseFactorSerQmf[NO_QMF_ALLPASS_CHANNELS][3];
-extern const Int32 aaFractDelayPhaseFactorSerSubQmf[SUBQMF_GROUPS][3];
-extern const Char bins2groupMap[NO_IID_GROUPS];
-extern const Int32 aaFractDelayPhaseFactorSerReQmf[NO_QMF_ALLPASS_CHANNELS][3];
-extern const Int32 aaFractDelayPhaseFactorSerImQmf[NO_QMF_ALLPASS_CHANNELS][3];
-extern const Int32 aaFractDelayPhaseFactorSerReSubQmf[SUBQMF_GROUPS][3];
-extern const Int32 aaFractDelayPhaseFactorSerImSubQmf[SUBQMF_GROUPS][3];
-
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_ALL_PASS_FILTER_COEFF_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_all_pass_fract_delay_filter.cpp b/media/libstagefright/codecs/aacdec/ps_all_pass_fract_delay_filter.cpp
deleted file mode 100644
index 81761a6..0000000
--- a/media/libstagefright/codecs/aacdec/ps_all_pass_fract_delay_filter.cpp
+++ /dev/null
@@ -1,391 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_all_pass_fract_delay_filter.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  Decorrelation
-  Decorrelation is achieved by means of all-pass filtering and delaying
-  Sub-band samples s_k(n) are converted into de-correlated sub-bands samples
-  d_k(n). k index for frequency, n time index
-
-
-     _______                                              ________
-    |       |                                  _______   |        |
-  ->|Hybrid | LF ----                         |       |->| Hybrid |-->
-    | Anal. |        |                        |       |  | Synth  |   QMF -> L
-     -------         o----------------------->|       |   --------    Synth
-QMF                  |                s_k(n)  |Stereo |-------------->
-Anal.              -------------------------->|       |
-     _______       | |                        |       |   ________
-    |       | HF --o |   -----------          |Process|  |        |
-  ->| Delay |      |  ->|           |-------->|       |->| Hybrid |-->
-     -------       |    |decorrelate| d_k(n)  |       |  | Synth  |   QMF -> R
-                   ---->|           |-------->|       |   --------    Synth
-                         -----------          |_______|-------------->
-
-
-  Delay is introduced to compensate QMF bands not passed through Hybrid
-  Analysis
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include    "pv_audio_type_defs.h"
-#include    "ps_decorrelate.h"
-#include    "aac_mem_funcs.h"
-#include    "ps_all_pass_filter_coeff.h"
-#include    "ps_pwr_transient_detection.h"
-#include    "ps_all_pass_fract_delay_filter.h"
-#include    "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-/*
- *  For lower subbands
- *  Apply all-pass filtering
- *
- */
-
-
-void ps_all_pass_fract_delay_filter_type_I(UInt32 *delayBufIndex,
-        Int32 sb_delay,
-        const Int32 *ppFractDelayPhaseFactorSer,
-        Int32 ***pppRealDelayRBufferSer,
-        Int32 ***pppImagDelayRBufferSer,
-        Int32 *rIn,
-        Int32 *iIn)
-{
-
-    Int32 cmplx;
-    Int16 rTmp0;
-    Int32 rTmp;
-    Int32 iTmp;
-    Int32 *pt_rTmp;
-    Int32 *pt_iTmp;
-
-
-
-    /*
-     *  All pass filters
-     *                         2
-     *                        ___  Q_fract(k,m)*z^(-d(m))  -  a(m)*g_decay_slope(k)
-     *   z^(-2)*phi_fract(k)* | |  ------------------------------------------------
-     *                        m=0  1  - a(m)*g_decay_slope(k)*Q_fract(k,m)*z^(-d(m))
-     *
-     *
-     *    Fractional delay matrix:
-     *
-     *    Q_fract(k,m) = exp(-j*pi*q(m)*f_center(k))       0<= k <= SUBQMF_GROUPS
-     *
-     *    Vectors: a(m), q(m), d(m) are constants
-     *
-     *    m                              m     0       1       2
-     *                                 -------------------------------
-     *    delay length                 d(m) == 3       4       5      (Fs > 32 KHz)
-     *    fractional delay length      q(m) == 0.43    0.75    0.347
-     *    filter coefficient           a(m) == 0.65144 0.56472 0.48954
-     *
-     *             g_decay_slope(k) is given
-     */
-
-
-    Int32 tmp_r;
-    Int32 tmp_i;
-
-    pt_rTmp = &pppRealDelayRBufferSer[0][*(delayBufIndex)][sb_delay];
-    pt_iTmp = &pppImagDelayRBufferSer[0][*(delayBufIndex++)][sb_delay];
-
-    cmplx  = *(ppFractDelayPhaseFactorSer++);        /* Q_fract(k,m)  */
-    tmp_r = *pt_rTmp << 1;
-    tmp_i = *pt_iTmp << 1;
-
-    rTmp = cmplx_mul32_by_16(tmp_r, -tmp_i,  cmplx);
-    rTmp0  = Qfmt15(0.65143905753106f);
-    iTmp = cmplx_mul32_by_16(tmp_i,  tmp_r,  cmplx);
-
-
-    iTmp     =  fxp_mac32_by_16(-*iIn << 1, rTmp0, iTmp);  /* Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n) */
-    *pt_iTmp =  fxp_mac32_by_16(iTmp << 1, rTmp0, *iIn);   /* y(n) = x(n) + a(m)*g_decay_slope(k)*( Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n)) */
-    *iIn = iTmp;
-
-    rTmp     =  fxp_mac32_by_16(-*rIn << 1, rTmp0, rTmp);
-    *pt_rTmp =  fxp_mac32_by_16(rTmp << 1, rTmp0, *rIn);
-
-    *rIn = rTmp;
-
-    pt_rTmp = &pppRealDelayRBufferSer[1][*(delayBufIndex)][sb_delay];
-    pt_iTmp = &pppImagDelayRBufferSer[1][*(delayBufIndex++)][sb_delay];
-
-
-
-    cmplx  = *(ppFractDelayPhaseFactorSer++);        /* Q_fract(k,m)  */
-    tmp_r = *pt_rTmp << 1;
-    tmp_i = *pt_iTmp << 1;
-
-    rTmp = cmplx_mul32_by_16(tmp_r, -tmp_i,  cmplx);
-    rTmp0  = Qfmt15(0.56471812200776f);
-    iTmp = cmplx_mul32_by_16(tmp_i,  tmp_r,  cmplx);
-
-
-    iTmp     =  fxp_mac32_by_16(-*iIn << 1, rTmp0, iTmp);  /* Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n) */
-    *pt_iTmp =  fxp_mac32_by_16(iTmp << 1, rTmp0, *iIn);   /* y(n) = x(n) + a(m)*g_decay_slope(k)*( Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n)) */
-    *iIn = iTmp;
-
-    rTmp     =  fxp_mac32_by_16(-*rIn << 1, rTmp0, rTmp);
-    *pt_rTmp =  fxp_mac32_by_16(rTmp << 1, rTmp0, *rIn);
-    *rIn = rTmp;
-
-    pt_rTmp = &pppRealDelayRBufferSer[2][*(delayBufIndex)][sb_delay];
-    pt_iTmp = &pppImagDelayRBufferSer[2][*(delayBufIndex)][sb_delay];
-
-
-    cmplx  = *(ppFractDelayPhaseFactorSer);        /* Q_fract(k,m)  */
-    tmp_r = *pt_rTmp << 1;
-    tmp_i = *pt_iTmp << 1;
-
-    rTmp = cmplx_mul32_by_16(tmp_r, -tmp_i,  cmplx);
-    rTmp0  = Qfmt15(0.97908331911390f);
-    iTmp = cmplx_mul32_by_16(tmp_i,  tmp_r,  cmplx);
-
-
-    iTmp     =  fxp_mac32_by_16(-*iIn, rTmp0, iTmp);    /* Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n) */
-    *pt_iTmp =  fxp_mac32_by_16(iTmp, rTmp0, *iIn);     /* y(n) = x(n) + a(m)*g_decay_slope(k)*( Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n)) */
-    *iIn = iTmp << 2;
-
-    rTmp     =  fxp_mac32_by_16(-*rIn, rTmp0, rTmp);
-    *pt_rTmp =  fxp_mac32_by_16(rTmp, rTmp0, *rIn);
-    *rIn = rTmp << 2;
-}
-
-
-void ps_all_pass_fract_delay_filter_type_II(UInt32 *delayBufIndex,
-        Int32 sb_delay,
-        const Int32 *ppFractDelayPhaseFactorSer,
-        Int32 ***pppRealDelayRBufferSer,
-        Int32 ***pppImagDelayRBufferSer,
-        Int32 *rIn,
-        Int32 *iIn,
-        Int32 decayScaleFactor)
-{
-
-    Int32 cmplx;
-    Int16 rTmp0;
-    Int32 rTmp;
-    Int32 iTmp;
-    Int32 *pt_rTmp;
-    Int32 *pt_iTmp;
-    const Int16 *pt_delay;
-
-
-
-    /*
-     *  All pass filters
-     *                         2
-     *                        ___  Q_fract(k,m)*z^(-d(m))  -  a(m)*g_decay_slope(k)
-     *   z^(-2)*phi_fract(k)* | |  ------------------------------------------------
-     *                        m=0  1  - a(m)*g_decay_slope(k)*Q_fract(k,m)*z^(-d(m))
-     *
-     *
-     *    Fractional delay matrix:
-     *
-     *    Q_fract(k,m) = exp(-j*pi*q(m)*f_center(k))       0<= k <= SUBQMF_GROUPS
-     *
-     *    Vectors: a(m), q(m), d(m) are constants
-     *
-     *    m                              m     0       1       2
-     *                                 -------------------------------
-     *    delay length                 d(m) == 3       4       5      (Fs > 32 KHz)
-     *    fractional delay length      q(m) == 0.43    0.75    0.347
-     *    filter coefficient           a(m) == 0.65144 0.56472 0.48954
-     *
-     *             g_decay_slope(k) is given
-     */
-
-
-    Int32 tmp_r;
-    Int32 tmp_i;
-
-    pt_rTmp = &pppRealDelayRBufferSer[0][*(delayBufIndex)][sb_delay];
-    pt_iTmp = &pppImagDelayRBufferSer[0][*(delayBufIndex++)][sb_delay];
-
-    cmplx  = *(ppFractDelayPhaseFactorSer++);        /* Q_fract(k,m)  */
-    pt_delay = aRevLinkDecaySerCoeff[decayScaleFactor];
-    tmp_r = *pt_rTmp << 1;
-    tmp_i = *pt_iTmp << 1;
-
-    rTmp = cmplx_mul32_by_16(tmp_r, -tmp_i,  cmplx);
-    rTmp0  = *(pt_delay++);
-    iTmp = cmplx_mul32_by_16(tmp_i,  tmp_r,  cmplx);
-
-
-    iTmp     =  fxp_mac32_by_16(-*iIn << 1, rTmp0, iTmp);  /* Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n) */
-    *pt_iTmp =  fxp_mac32_by_16(iTmp << 1, rTmp0, *iIn);   /* y(n) = x(n) + a(m)*g_decay_slope(k)*( Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n)) */
-    *iIn = iTmp;
-
-    rTmp     =  fxp_mac32_by_16(-*rIn << 1, rTmp0, rTmp);
-    *pt_rTmp =  fxp_mac32_by_16(rTmp << 1, rTmp0, *rIn);
-    *rIn = rTmp;
-
-    pt_rTmp = &pppRealDelayRBufferSer[1][*(delayBufIndex)][sb_delay];
-    pt_iTmp = &pppImagDelayRBufferSer[1][*(delayBufIndex++)][sb_delay];
-
-
-    cmplx  = *(ppFractDelayPhaseFactorSer++);        /* Q_fract(k,m)  */
-    tmp_r = *pt_rTmp << 1;
-    tmp_i = *pt_iTmp << 1;
-
-    rTmp = cmplx_mul32_by_16(tmp_r, -tmp_i,  cmplx);
-    rTmp0  = *(pt_delay++);
-    iTmp = cmplx_mul32_by_16(tmp_i,  tmp_r,  cmplx);
-    iTmp     =  fxp_mac32_by_16(-*iIn << 1, rTmp0, iTmp);  /* Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n) */
-    *pt_iTmp =  fxp_mac32_by_16(iTmp << 1, rTmp0, *iIn);   /* y(n) = x(n) + a(m)*g_decay_slope(k)*( Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n)) */
-    *iIn = iTmp;
-
-    rTmp     =  fxp_mac32_by_16(-*rIn << 1, rTmp0, rTmp);
-    *pt_rTmp =  fxp_mac32_by_16(rTmp << 1, rTmp0, *rIn);
-    *rIn = rTmp;
-
-    pt_rTmp = &pppRealDelayRBufferSer[2][*(delayBufIndex)][sb_delay];
-    pt_iTmp = &pppImagDelayRBufferSer[2][*(delayBufIndex)][sb_delay];
-
-
-    cmplx  = *(ppFractDelayPhaseFactorSer);        /* Q_fract(k,m)  */
-    tmp_r = *pt_rTmp << 1;
-    tmp_i = *pt_iTmp << 1;
-
-    rTmp = cmplx_mul32_by_16(tmp_r, -tmp_i,  cmplx);
-    rTmp0  = *(pt_delay);
-    iTmp = cmplx_mul32_by_16(tmp_i,  tmp_r,  cmplx);
-
-
-    iTmp     =  fxp_mac32_by_16(-*iIn, rTmp0, iTmp);    /* Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n) */
-    *pt_iTmp =  fxp_mac32_by_16(iTmp, rTmp0, *iIn);     /* y(n) = x(n) + a(m)*g_decay_slope(k)*( Q_fract(k,m)*y(n-1) - a(m)*g_decay_slope(k)*x(n)) */
-    *iIn = iTmp << 2;
-
-    rTmp     =  fxp_mac32_by_16(-*rIn, rTmp0, rTmp);
-    *pt_rTmp =  fxp_mac32_by_16(rTmp, rTmp0, *rIn);
-    *rIn = rTmp << 2;
-
-}
-
-
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_all_pass_fract_delay_filter.h b/media/libstagefright/codecs/aacdec/ps_all_pass_fract_delay_filter.h
deleted file mode 100644
index b4e9876..0000000
--- a/media/libstagefright/codecs/aacdec/ps_all_pass_fract_delay_filter.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_all_pass_fract_delay_filter.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function ps_all_pass_fract_delay_filter()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_ALL_PASS_FRACT_DELAY_FILTER_H
-#define PS_ALL_PASS_FRACT_DELAY_FILTER_H
-
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define R_SHIFT     29
-#define Q29_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-#define Qfmt15(x)   (Int16)(x*((Int32)1<<15) + (x>=0?0.5F:-0.5F))
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-    void ps_all_pass_fract_delay_filter_type_I(UInt32 *delayBufIndex,
-    Int32 sb_delay,
-    const Int32 *ppFractDelayPhaseFactorSer,
-    Int32 ***pppRealDelayRBufferSer,
-    Int32 ***pppImagDelayRBufferSer,
-    Int32 *rIn,
-    Int32 *iIn);
-
-
-    void ps_all_pass_fract_delay_filter_type_II(UInt32 *delayBufIndex,
-            Int32 sb_delay,
-            const Int32 *ppFractDelayPhaseFactorSer,
-            Int32 ***pppRealDelayRBufferSer,
-            Int32 ***pppImagDelayRBufferSer,
-            Int32 *rIn,
-            Int32 *iIn,
-            Int32 decayScaleFactor);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_ALL_PASS_FRACT_DELAY_FILTER_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_allocate_decoder.cpp b/media/libstagefright/codecs/aacdec/ps_allocate_decoder.cpp
deleted file mode 100644
index ab15651..0000000
--- a/media/libstagefright/codecs/aacdec/ps_allocate_decoder.cpp
+++ /dev/null
@@ -1,341 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_allocate_decoder.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Reuses AAC+ HQ right channel, which is not used when PS is enabled
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef HQ_SBR
-
-#ifdef PARAMETRICSTEREO
-
-#include    "s_sbr_channel.h"
-#include    "aac_mem_funcs.h"
-#include    "ps_hybrid_filter_bank_allocation.h"
-#include    "s_ps_dec.h"
-#include    "ps_all_pass_filter_coeff.h"
-#include    "ps_allocate_decoder.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define R_SHIFT     30
-#define Q30_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-const Int32  aRevLinkDelaySer[] = {3,  4,  5};
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int32 ps_allocate_decoder(SBRDECODER_DATA *self,
-                          UInt32  noSubSamples)
-{
-    Int32 i, j;
-    Int32 status;
-
-    Int32 *ptr1;
-    Int32 *ptr2;
-    Int32 *ptr3;
-    Int32 *ptr4;
-    Int32 *ptr5;
-    Int32 *ptr6;
-    Int32 *ptr7;
-
-    const Int32 pHybridResolution[] = { HYBRID_8_CPLX,
-                                        HYBRID_2_REAL,
-                                        HYBRID_2_REAL
-                                      };
-
-    STRUCT_PS_DEC *h_ps_dec = self->hParametricStereoDec;
-
-    /* initialisation */
-    h_ps_dec->noSubSamples = noSubSamples;
-
-    h_ps_dec->invNoSubSamples = Q30_fmt(1.0f) / noSubSamples;
-
-    /*
-     *  Reuse AAC+ HQ right channel, which is not used when PS is enabled
-     */
-    ptr1 = (Int32 *)(self->SbrChannel[1].frameData.codecQmfBufferReal[0]);   /*  reuse un-used right channel QMF_FILTER Synthesis buffer */
-
-    ptr2 = (&ptr1[658]);  /*  reuse un-used right channel QMF_FILTER Synthesis buffer */
-    /* 1162 - 658 = 504
-     *            = NO_QMF_ALLPASS_CHANNELS*2 (Re&Im)*( 3 + 4 + 5) + ( 3 + 4 + 5)*2 (Re&Im)
-     */
-
-    ptr3 = (&ptr1[1162]);  /*  reuse un-used right channel QMF_FILTER Synthesis buffer */
-    /* 1426 - 1162 = 264
-     *            = SUBQMF_GROUPS*2 (Re&Im)*( 3 + 4 + 5) + ( 3 + 4 + 5)*2 (Re&Im)
-     */
-
-    ptr4 = (&ptr1[1426]);  /*  high freq generation buffers */
-
-    ptr5 = (&ptr1[1490]);  /*  high freq generation buffers */
-
-    ptr6 = (&ptr1[1618]);  /*  high freq generation buffers */
-
-    ptr7 = (&ptr1[1810]);  /*  high freq generation buffers */
-
-    /*  whole allocation requires 1871 words, sbrQmfBufferImag has 1920 words */
-
-
-    h_ps_dec->aPeakDecayFast =  ptr1;
-    ptr1 += NO_BINS;
-
-    h_ps_dec->aPrevNrg =  ptr1;
-    ptr1 += NO_BINS;
-
-    h_ps_dec->aPrevPeakDiff = ptr1;
-    ptr1 += NO_BINS;
-
-
-
-    status = ps_hybrid_filter_bank_allocation(&h_ps_dec->hHybrid,
-             NO_QMF_CHANNELS_IN_HYBRID,
-             pHybridResolution,
-             &ptr1);
-    h_ps_dec->mHybridRealLeft = ptr1;
-    ptr1 += SUBQMF_GROUPS;
-
-    h_ps_dec->mHybridImagLeft = ptr1;
-    ptr1 += SUBQMF_GROUPS;
-
-    h_ps_dec->mHybridRealRight = ptr1;
-    ptr1 += SUBQMF_GROUPS;
-
-    h_ps_dec->mHybridImagRight = ptr1;
-    ptr1 += SUBQMF_GROUPS;
-
-
-    h_ps_dec->delayBufIndex   = 0;
-
-
-
-    for (i = 0 ; i < NO_DELAY_CHANNELS ; i++)   /* 41  */
-    {
-        if (i < SHORT_DELAY_START)              /* 12  */
-        {
-            h_ps_dec->aNoSampleDelay[i] = LONG_DELAY;
-        }
-        else
-        {
-            h_ps_dec->aNoSampleDelay[i] = SHORT_DELAY;
-        }
-    }
-
-
-    h_ps_dec->aaRealDelayBufferQmf = (Int32 **)ptr6;
-    ptr6 += NO_QMF_ICC_CHANNELS * sizeof(Int32 *) / sizeof(Int32);
-
-    h_ps_dec->aaImagDelayBufferQmf = (Int32 **)ptr7;
-    ptr7 += NO_QMF_ICC_CHANNELS * sizeof(Int32 *) / sizeof(Int32);
-
-    h_ps_dec->aaRealDelayBufferSubQmf = (Int32 **)ptr1;
-    ptr1 += SUBQMF_GROUPS * sizeof(Int32 *) / sizeof(Int32);
-
-    h_ps_dec->aaImagDelayBufferSubQmf = (Int32 **)ptr1;
-    ptr1 += SUBQMF_GROUPS * sizeof(Int32 *) / sizeof(Int32);
-
-    for (i = 0; i < NO_QMF_ICC_CHANNELS; i++)   /* 61 */
-    {
-        int delay;
-
-        if (i < NO_QMF_ALLPASS_CHANNELS)    /* 20 */
-        {
-            delay = 2;
-            h_ps_dec->aaRealDelayBufferQmf[i] = (Int32 *)ptr4;
-            ptr4 += delay;
-
-            h_ps_dec->aaImagDelayBufferQmf[i] = (Int32 *)ptr5;
-            ptr5 += delay;
-        }
-        else
-        {
-
-            if (i >= (NO_QMF_ALLPASS_CHANNELS + SHORT_DELAY_START))
-            {
-                delay = SHORT_DELAY;
-            }
-            else
-            {
-                delay = LONG_DELAY;
-            }
-
-            h_ps_dec->aaRealDelayBufferQmf[i] = (Int32 *)ptr1;
-            ptr1 += delay;
-
-            h_ps_dec->aaImagDelayBufferQmf[i] = (Int32 *)ptr1;
-            ptr1 += delay;
-        }
-    }
-
-    for (i = 0; i < SUBQMF_GROUPS; i++)
-    {
-        h_ps_dec->aaRealDelayBufferSubQmf[i] = (Int32 *)ptr1;
-        ptr1 += DELAY_ALLPASS;
-
-        h_ps_dec->aaImagDelayBufferSubQmf[i] = (Int32 *)ptr1;
-        ptr1 += DELAY_ALLPASS;
-
-    }
-
-    for (i = 0 ; i < NO_SERIAL_ALLPASS_LINKS ; i++) /*  NO_SERIAL_ALLPASS_LINKS == 3 */
-    {
-
-        h_ps_dec->aDelayRBufIndexSer[i] = 0;
-
-        h_ps_dec->aaaRealDelayRBufferSerQmf[i] = (Int32 **)ptr2;
-        ptr2 += aRevLinkDelaySer[i];
-
-        h_ps_dec->aaaImagDelayRBufferSerQmf[i] = (Int32 **)ptr2;
-        ptr2 += aRevLinkDelaySer[i];
-
-        h_ps_dec->aaaRealDelayRBufferSerSubQmf[i] = (Int32 **)ptr3;
-        ptr3 += aRevLinkDelaySer[i];
-
-        h_ps_dec->aaaImagDelayRBufferSerSubQmf[i] = (Int32 **)ptr3;
-        ptr3 += aRevLinkDelaySer[i];
-
-        for (j = 0; j < aRevLinkDelaySer[i]; j++)
-        {
-            h_ps_dec->aaaRealDelayRBufferSerQmf[i][j] = ptr2;
-            ptr2 += NO_QMF_ALLPASS_CHANNELS;    /* NO_QMF_ALLPASS_CHANNELS == 20 */
-
-            h_ps_dec->aaaImagDelayRBufferSerQmf[i][j] = ptr2;
-            ptr2 += NO_QMF_ALLPASS_CHANNELS;
-
-            h_ps_dec->aaaRealDelayRBufferSerSubQmf[i][j] = ptr3;
-            ptr3 += SUBQMF_GROUPS;
-
-            h_ps_dec->aaaImagDelayRBufferSerSubQmf[i][j] = ptr3;
-            ptr3 += SUBQMF_GROUPS;
-
-        }
-    }
-
-
-    for (i = 0; i < NO_IID_GROUPS; i++)         /*  NO_IID_GROUPS == 22   */
-    {
-        h_ps_dec->h11Prev[i] = Q30_fmt(1.0f);
-        h_ps_dec->h12Prev[i] = Q30_fmt(1.0f);
-    }
-
-
-
-    return status;
-} /*END CreatePsDec*/
-#endif
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_allocate_decoder.h b/media/libstagefright/codecs/aacdec/ps_allocate_decoder.h
deleted file mode 100644
index d5f152f..0000000
--- a/media/libstagefright/codecs/aacdec/ps_allocate_decoder.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_allocate_decoder.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function ps_allocate_decoder()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_ALLOCATE_DECODER_H
-#define PS_ALLOCATE_DECODER_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int32 ps_allocate_decoder(SBRDECODER_DATA *self,
-    UInt32  noSubSamples);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_ALLOCATE_DECODER_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_applied.cpp b/media/libstagefright/codecs/aacdec/ps_applied.cpp
deleted file mode 100644
index 77fd8a7..0000000
--- a/media/libstagefright/codecs/aacdec/ps_applied.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_applied.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Applies Parametric Stereo Tool to a QMF-analized mono signal
-        providing a stereo image as output
-
-
-     _______                                              ________
-    |       |                                  _______   |        |
-  ->|Hybrid | LF ----                         |       |->| Hybrid |-->
-    | Anal. |        |                        |       |  | Synth  |   QMF -> L
-     -------         o----------------------->|       |   --------    Synth
-QMF                  |                s_k(n)  |Stereo |-------------->
-Anal.              -------------------------->|       |
-     _______       | |                        |       |   ________
-    |       | HF --o |   -----------          |Process|  |        |
-  ->| Delay |      |  ->|           |-------->|       |->| Hybrid |-->
-     -------       |    |decorrelate| d_k(n)  |       |  | Synth  |   QMF -> R
-                   ---->|           |-------->|       |   --------    Synth
-                         -----------          |_______|-------------->
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-#include    "aac_mem_funcs.h"
-#include    "ps_stereo_processing.h"
-#include    "ps_decorrelate.h"
-#include    "ps_hybrid_synthesis.h"
-#include    "ps_hybrid_analysis.h"
-#include    "ps_applied.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void ps_applied(STRUCT_PS_DEC *h_ps_dec,
-                Int32 rIntBufferLeft[][64],
-                Int32 iIntBufferLeft[][64],
-                Int32 *rIntBufferRight,
-                Int32 *iIntBufferRight,
-                Int32 scratch_mem[],
-                Int32 band)
-
-{
-
-    /*
-     *  Get higher frequency resolution in the lower QMF subbands
-     *  creating sub-subbands
-     */
-    ps_hybrid_analysis(rIntBufferLeft,
-                       iIntBufferLeft,
-                       h_ps_dec->mHybridRealLeft,
-                       h_ps_dec->mHybridImagLeft,
-                       h_ps_dec->hHybrid,
-                       scratch_mem,
-                       band);
-
-    /*
-     *  By means of delaying and all-pass filtering, sub-subbands of
-     *  left ch. are decorrelate to creates right ch. sub-subbands
-     */
-
-    ps_decorrelate(h_ps_dec,
-                   *rIntBufferLeft,
-                   *iIntBufferLeft,
-                   rIntBufferRight,
-                   iIntBufferRight,
-                   scratch_mem);
-
-    /*
-     *  sub-subbands of left and right ch. are processed according to
-     *  stereo clues.
-     */
-
-    ps_stereo_processing(h_ps_dec,
-                         *rIntBufferLeft,
-                         *iIntBufferLeft,
-                         rIntBufferRight,
-                         iIntBufferRight);
-
-    /*
-     *  Reconstruct stereo signals
-     */
-
-    ps_hybrid_synthesis((const Int32*)h_ps_dec->mHybridRealLeft,
-                        (const Int32*)h_ps_dec->mHybridImagLeft,
-                        *rIntBufferLeft,
-                        *iIntBufferLeft,
-                        h_ps_dec->hHybrid);
-
-    ps_hybrid_synthesis((const Int32*)h_ps_dec->mHybridRealRight,
-                        (const Int32*)h_ps_dec->mHybridImagRight,
-                        rIntBufferRight,
-                        iIntBufferRight,
-                        h_ps_dec->hHybrid);
-
-}/* END ps_applied */
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_applied.h b/media/libstagefright/codecs/aacdec/ps_applied.h
deleted file mode 100644
index 231d9c3..0000000
--- a/media/libstagefright/codecs/aacdec/ps_applied.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_applied.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions ps_applied()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_APPLIED_H
-#define PS_APPLIED_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void ps_applied(STRUCT_PS_DEC *h_ps_dec,
-    Int32 rIntBufferLeft[][64],
-    Int32 iIntBufferLeft[][64],
-    Int32 *rIntBufferRight,
-    Int32 *iIntBufferRight,
-    Int32 scratch_mem[],
-    Int32 band);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_APPLIED_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_bstr_decoding.cpp b/media/libstagefright/codecs/aacdec/ps_bstr_decoding.cpp
deleted file mode 100644
index c7ed60b..0000000
--- a/media/libstagefright/codecs/aacdec/ps_bstr_decoding.cpp
+++ /dev/null
@@ -1,304 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_bstr_decoding.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Decodes parametric stereo
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include "pv_audio_type_defs.h"
-#include "aac_mem_funcs.h"
-#include "ps_bstr_decoding.h"
-#include "ps_decode_bs_utils.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-const Int32 aNoIidBins[3] = {NO_LOW_RES_IID_BINS, NO_IID_BINS, NO_HI_RES_BINS};
-const Int32 aNoIccBins[3] = {NO_LOW_RES_ICC_BINS, NO_ICC_BINS, NO_HI_RES_BINS};
-const Int32 aFixNoEnvDecode[4] = {0, 1, 2, 4};
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void ps_bstr_decoding(STRUCT_PS_DEC *ps_dec)
-{
-    UInt32 env;
-    Int32 noIidSteps;
-
-    if (!ps_dec->bPsDataAvail)
-    {
-        ps_dec->noEnv = 0;
-    }
-
-    noIidSteps = ps_dec->bFineIidQ ? NO_IID_STEPS_FINE : NO_IID_STEPS;
-
-    for (env = 0; env < ps_dec->noEnv; env++)
-    {
-        Int32 *aPrevIidIndex;
-        Int32 *aPrevIccIndex;
-        if (env == 0)
-        {
-            aPrevIidIndex = ps_dec->aIidPrevFrameIndex;
-            aPrevIccIndex = ps_dec->aIccPrevFrameIndex;
-        }
-        else
-        {
-            aPrevIidIndex = ps_dec->aaIidIndex[env-1];
-            aPrevIccIndex = ps_dec->aaIccIndex[env-1];
-        }
-
-        /*
-         * Differential Decoding of IID parameters over time/frequency
-         */
-        differential_Decoding(ps_dec->bEnableIid,
-                              ps_dec->aaIidIndex[env],
-                              aPrevIidIndex,
-                              ps_dec->abIidDtFlag[env],
-                              aNoIidBins[ps_dec->freqResIid],
-                              (ps_dec->freqResIid) ? 1 : 2,
-                              -noIidSteps,
-                              noIidSteps);
-
-        /*
-         * Differential Decoding of ICC parameters over time/frequency
-         */
-        differential_Decoding(ps_dec->bEnableIcc,
-                              ps_dec->aaIccIndex[env],
-                              aPrevIccIndex,
-                              ps_dec->abIccDtFlag[env],
-                              aNoIccBins[ps_dec->freqResIcc],
-                              (ps_dec->freqResIcc) ? 1 : 2,
-                              0,
-                              NO_ICC_STEPS - 1);
-
-
-    }   /* for (env=0; env<ps_dec->noEnv; env++) */
-
-    if (ps_dec->noEnv == 0)
-    {
-        ps_dec->noEnv = 1;
-
-        if (ps_dec->bEnableIid)
-        {   /*  NO_HI_RES_BINS == 34 */
-            pv_memmove(ps_dec->aaIidIndex[ps_dec->noEnv-1],
-                       ps_dec->aIidPrevFrameIndex,
-                       NO_HI_RES_BINS*sizeof(*ps_dec->aIidPrevFrameIndex));
-
-        }
-        else
-        {
-            pv_memset((void *)ps_dec->aaIidIndex[ps_dec->noEnv-1],
-                      0,
-                      NO_HI_RES_BINS*sizeof(**ps_dec->aaIidIndex));
-        }
-        if (ps_dec->bEnableIcc)
-        {
-            pv_memmove(ps_dec->aaIccIndex[ps_dec->noEnv-1],
-                       ps_dec->aIccPrevFrameIndex,
-                       NO_HI_RES_BINS*sizeof(*ps_dec->aIccPrevFrameIndex));
-        }
-        else
-        {
-            pv_memset((void *)ps_dec->aaIccIndex[ps_dec->noEnv-1],
-                      0,
-                      NO_HI_RES_BINS*sizeof(**ps_dec->aaIccIndex));
-        }
-    }
-
-    pv_memmove(ps_dec->aIidPrevFrameIndex,
-               ps_dec->aaIidIndex[ps_dec->noEnv-1],
-               NO_HI_RES_BINS*sizeof(*ps_dec->aIidPrevFrameIndex));
-
-    pv_memmove(ps_dec->aIccPrevFrameIndex,
-               ps_dec->aaIccIndex[ps_dec->noEnv-1],
-               NO_HI_RES_BINS*sizeof(*ps_dec->aIccPrevFrameIndex));
-
-    ps_dec->bPsDataAvail = 0;
-
-    if (ps_dec->bFrameClass == 0)
-    {
-        Int32 shift;
-
-        shift = ps_dec->noEnv >> 1;
-
-        ps_dec->aEnvStartStop[0] = 0;
-
-        for (env = 1; env < ps_dec->noEnv; env++)
-        {
-            ps_dec->aEnvStartStop[env] =
-                (env * ps_dec->noSubSamples) >> shift;
-        }
-
-        ps_dec->aEnvStartStop[ps_dec->noEnv] = ps_dec->noSubSamples;
-    }
-    else
-    {   /* if (ps_dec->bFrameClass != 0) */
-        ps_dec->aEnvStartStop[0] = 0;
-
-        if (ps_dec->aEnvStartStop[ps_dec->noEnv] < ps_dec->noSubSamples)
-        {
-            ps_dec->noEnv++;
-            ps_dec->aEnvStartStop[ps_dec->noEnv] = ps_dec->noSubSamples;
-
-            pv_memmove(ps_dec->aaIidIndex[ps_dec->noEnv],
-                       ps_dec->aaIidIndex[ps_dec->noEnv-1],
-                       NO_HI_RES_BINS*sizeof(**ps_dec->aaIidIndex));
-
-            pv_memmove(ps_dec->aaIccIndex[ps_dec->noEnv],
-                       ps_dec->aaIccIndex[ps_dec->noEnv-1],
-                       NO_HI_RES_BINS*sizeof(**ps_dec->aaIccIndex));
-        }
-
-        for (env = 1; env < ps_dec->noEnv; env++)
-        {
-            UInt32 thr;
-            thr = ps_dec->noSubSamples - ps_dec->noEnv + env;
-
-            if (ps_dec->aEnvStartStop[env] > thr)
-            {
-                ps_dec->aEnvStartStop[env] = thr;
-            }
-            else
-            {
-                thr = ps_dec->aEnvStartStop[env-1] + 1;
-
-                if (ps_dec->aEnvStartStop[env] < thr)
-                {
-                    ps_dec->aEnvStartStop[env] = thr;
-                }
-            }
-        }
-    }   /* if (ps_dec->bFrameClass == 0) ... else */
-
-    for (env = 0; env < ps_dec->noEnv; env++)
-    {
-        if (ps_dec->freqResIid == 2)
-        {
-            map34IndexTo20(ps_dec->aaIidIndex[env]);
-        }
-        if (ps_dec->freqResIcc == 2)
-        {
-            map34IndexTo20(ps_dec->aaIccIndex[env]);
-        }
-    }
-
-
-}
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_bstr_decoding.h b/media/libstagefright/codecs/aacdec/ps_bstr_decoding.h
deleted file mode 100644
index 5212bf8..0000000
--- a/media/libstagefright/codecs/aacdec/ps_bstr_decoding.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_bstr_decoding.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions ps_bstr_decoding()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_BSTR_DECODING_H
-#define PS_BSTR_DECODING_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-extern const Int32 aNoIidBins[3];
-extern const Int32 aNoIccBins[3];
-
-extern const Int32 aFixNoEnvDecode[4];
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void ps_bstr_decoding(STRUCT_PS_DEC *h_ps_dec);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_BSTR_DECODING_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_channel_filtering.cpp b/media/libstagefright/codecs/aacdec/ps_channel_filtering.cpp
deleted file mode 100644
index 03a53df..0000000
--- a/media/libstagefright/codecs/aacdec/ps_channel_filtering.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_hybrid_analysis.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Does Hybrid analysis
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include    "s_hybrid.h"
-#include    "aac_mem_funcs.h"
-#include    "ps_fft_rx8.h"
-#include    "ps_channel_filtering.h"
-#include    "pv_audio_type_defs.h"
-#include    "fxp_mul32.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define R_SHIFT     29
-#define Q29_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-#define Qfmt31(a)   (Int32)(-a*((Int32)1<<31)  + (a>=0?0.5F:-0.5F))
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void two_ch_filtering(const Int32 *pQmf_r,
-                      const Int32 *pQmf_i,
-                      Int32 *mHybrid_r,
-                      Int32 *mHybrid_i)
-{
-
-    Int32 cum0;
-    Int32 cum1;
-    Int32 cum2;
-    Int32 tmp1;
-    Int32 tmp2;
-
-    tmp1 = pQmf_r[ 1] + pQmf_r[11];
-    tmp2 = pQmf_i[ 1] + pQmf_i[11];
-    cum1 =   fxp_mul32_Q31(Qfmt31(0.03798975052098f), tmp1);
-    cum2 =   fxp_mul32_Q31(Qfmt31(0.03798975052098f), tmp2);
-    tmp1 = pQmf_r[ 3] + pQmf_r[ 9];
-    tmp2 = pQmf_i[ 3] + pQmf_i[ 9];
-    cum1 =   fxp_msu32_Q31(cum1, Qfmt31(0.14586278335076f), tmp1);
-    cum2 =   fxp_msu32_Q31(cum2, Qfmt31(0.14586278335076f), tmp2);
-    tmp1 = pQmf_r[ 5] + pQmf_r[ 7];
-    tmp2 = pQmf_i[ 5] + pQmf_i[ 7];
-    cum1 =   fxp_mac32_Q31(cum1, Qfmt31(0.61193261090336f), tmp1);
-    cum2 =   fxp_mac32_Q31(cum2, Qfmt31(0.61193261090336f), tmp2);
-
-    cum0 = pQmf_r[HYBRID_FILTER_DELAY] >> 1;  /* HYBRID_FILTER_DELAY == 6 */
-
-    mHybrid_r[0] = (cum0 + cum1);
-    mHybrid_r[1] = (cum0 - cum1);
-
-    cum0 = pQmf_i[HYBRID_FILTER_DELAY] >> 1;  /* HYBRID_FILTER_DELAY == 6 */
-
-    mHybrid_i[0] = (cum0 + cum2);
-    mHybrid_i[1] = (cum0 - cum2);
-
-}
-
-
-
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void eight_ch_filtering(const Int32 *pQmfReal,
-                        const Int32 *pQmfImag,
-                        Int32 *mHybridReal,
-                        Int32 *mHybridImag,
-                        Int32 scratch_mem[])
-
-{
-
-    Int32 real;
-    Int32 imag;
-    Int32 tmp1;
-    Int32 tmp2;
-
-    real  = fxp_mul32_Q29(Q29_fmt(-0.06989827306334f), pQmfReal[ 4]);
-
-    real  = fxp_mac32_Q31(real, Qfmt31(0.01055120626280f), pQmfReal[12]);
-    imag  = fxp_mul32_Q29(Q29_fmt(-0.06989827306334f), pQmfImag[ 4]);
-
-    imag  = fxp_mac32_Q31(imag, Qfmt31(0.01055120626280f), pQmfImag[12]);
-
-    mHybridReal[2] = (imag - real);
-    mHybridImag[2] = -(imag + real);
-
-    real  = fxp_mul32_Q29(Q29_fmt(-0.07266113929591f), pQmfReal[ 3]);
-
-    real  = fxp_mac32_Q31(real, Qfmt31(0.04540841899650f), pQmfReal[11]);
-    imag  = fxp_mul32_Q29(Q29_fmt(-0.07266113929591f), pQmfImag[ 3]);
-
-    imag  = fxp_mac32_Q31(imag, Qfmt31(0.04540841899650f), pQmfImag[11]);
-
-    tmp1           =  fxp_mul32_Q29(Q29_fmt(-0.38268343236509f), real);
-    mHybridReal[3] =  fxp_mac32_Q29(Q29_fmt(0.92387953251129f), imag, tmp1);
-    tmp2           =  fxp_mul32_Q29(Q29_fmt(-0.92387953251129f), real);
-    mHybridImag[3] =  fxp_mac32_Q29(Q29_fmt(-0.38268343236509f), imag, tmp2);
-
-
-    mHybridImag[4] = fxp_mul32_Q31(Qfmt31(0.09093731860946f), (pQmfReal[ 2] - pQmfReal[10]));
-    mHybridReal[4] = fxp_mul32_Q31(Qfmt31(0.09093731860946f), (pQmfImag[10] - pQmfImag[ 2]));
-
-
-    real  = fxp_mul32_Q29(Q29_fmt(-0.02270420949825f), pQmfReal[ 1]);
-
-    real  = fxp_mac32_Q31(real, Qfmt31(0.14532227859182f), pQmfReal[ 9]);
-    imag  = fxp_mul32_Q29(Q29_fmt(-0.02270420949825f), pQmfImag[ 1]);
-
-    imag  = fxp_mac32_Q31(imag, Qfmt31(0.14532227859182f), pQmfImag[ 9]);
-
-    tmp1           =  fxp_mul32_Q29(Q29_fmt(0.92387953251129f), imag);
-
-    mHybridReal[5] =  fxp_mac32_Q31(tmp1, Qfmt31(0.76536686473018f), real);
-    tmp2           =  fxp_mul32_Q29(Q29_fmt(-0.92387953251129f), real);
-
-    mHybridImag[5] =  fxp_mac32_Q31(tmp2, Qfmt31(0.76536686473018f), imag);
-
-    real  = fxp_mul32_Q29(Q29_fmt(-0.00527560313140f), pQmfReal[ 0]);
-
-    real  = fxp_mac32_Q31(real, Qfmt31(0.13979654612668f), pQmfReal[ 8]);
-    imag  = fxp_mul32_Q29(Q29_fmt(-0.00527560313140f), pQmfImag[ 0]);
-
-    imag  = fxp_mac32_Q31(imag, Qfmt31(0.13979654612668f), pQmfImag[ 8]);
-
-    mHybridReal[6] = (imag + real);
-    mHybridImag[6] = (imag - real);
-
-
-    tmp1            =  fxp_mul32_Q31(Qfmt31(0.21791935610828f), pQmfReal[ 7]);
-    mHybridReal[7]  =  fxp_mac32_Q31(tmp1, Qfmt31(0.09026515280366f), pQmfImag[ 7]);
-
-    tmp2            =  fxp_mul32_Q29(Q29_fmt(-0.04513257640183f), pQmfReal[ 7]);
-
-    mHybridImag[7]  =  fxp_mac32_Q31(tmp2, Qfmt31(0.21791935610828f), pQmfImag[ 7]);
-
-    mHybridReal[0] = pQmfReal[HYBRID_FILTER_DELAY] >> 3;
-    mHybridImag[0] = pQmfImag[HYBRID_FILTER_DELAY] >> 3;
-
-    tmp1           =  fxp_mul32_Q29(Q29_fmt(-0.04513257640183f), pQmfImag[ 5]);
-
-    mHybridReal[1] =  fxp_mac32_Q31(tmp1, Qfmt31(0.21791935610828f), pQmfReal[ 5]);
-
-
-    tmp2            =  fxp_mul32_Q31(Qfmt31(0.21791935610828f), pQmfImag[ 5]);
-    mHybridImag[1]  =  fxp_mac32_Q31(tmp2, Qfmt31(0.09026515280366f), pQmfReal[ 5]);
-
-    /*
-     *  8*ifft
-     */
-
-    ps_fft_rx8(mHybridReal, mHybridImag, scratch_mem);
-
-}
-
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_channel_filtering.h b/media/libstagefright/codecs/aacdec/ps_channel_filtering.h
deleted file mode 100644
index 19cda79..0000000
--- a/media/libstagefright/codecs/aacdec/ps_channel_filtering.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_channel_filtering.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions two_ch_filtering()
- and  eight_ch_filtering()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_CHANNEL_FILTERING_H
-#define PS_CHANNEL_FILTERING_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void two_ch_filtering(const Int32 *pQmf_r,
-    const Int32 *pQmf_i,
-    Int32 *mHybrid_r,
-    Int32 *mHybrid_i);
-
-
-    void eight_ch_filtering(const Int32 *pQmfReal,
-                            const Int32 *pQmfImag,
-                            Int32 *mHybridReal,
-                            Int32 *mHybridImag,
-                            Int32 scratch_mem[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_CHANNEL_FILTERING_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_constants.h b/media/libstagefright/codecs/aacdec/ps_constants.h
deleted file mode 100644
index d5b2ad4..0000000
--- a/media/libstagefright/codecs/aacdec/ps_constants.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/****************************************************************************
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-*******************************************************************************/
-/*
-*/
-#ifndef PS_CONSTANTS_H
-#define PS_CONSTANTS_H
-
-
-#define NO_SUB_QMF_CHANNELS         12
-#define NO_QMF_CHANNELS_IN_HYBRID   3
-#define NO_QMF_CHANNELS             64
-#define NO_ALLPASS_CHANNELS         23
-#define NO_DELAY_CHANNELS           (NO_QMF_CHANNELS-NO_ALLPASS_CHANNELS)
-#define DELAY_ALLPASS               2
-#define SHORT_DELAY_START           12
-#define SHORT_DELAY                 1
-#define LONG_DELAY                  14
-#define NO_QMF_ALLPASS_CHANNELS    (NO_ALLPASS_CHANNELS-NO_QMF_CHANNELS_IN_HYBRID)
-#define NO_QMF_ICC_CHANNELS        (NO_QMF_ALLPASS_CHANNELS+NO_DELAY_CHANNELS)
-#define HYBRIDGROUPS                8
-#define DECAY_CUTOFF                3
-#define NO_SERIAL_ALLPASS_LINKS     3
-#define MAX_NO_PS_ENV               5
-#define NEGATE_IPD_MASK                 ( 0x00001000 )
-#define NO_BINS                         ( 20 )
-#define NO_HI_RES_BINS                  ( 34 )
-#define NO_LOW_RES_BINS                 ( NO_IID_BINS / 2 )
-#define NO_IID_BINS                     ( NO_BINS )
-#define NO_ICC_BINS                     ( NO_BINS )
-#define NO_LOW_RES_IID_BINS             ( NO_LOW_RES_BINS )
-#define NO_LOW_RES_ICC_BINS             ( NO_LOW_RES_BINS )
-#define SUBQMF_GROUPS                   ( 10 )
-#define QMF_GROUPS                      ( 12 )
-#define NO_IID_GROUPS                   ( SUBQMF_GROUPS + QMF_GROUPS )
-#define NO_IID_STEPS                    ( 7 )
-#define NO_IID_STEPS_FINE               ( 15 )
-#define NO_ICC_STEPS                    ( 8 )
-#define NO_IID_LEVELS                   ( 2 * NO_IID_STEPS + 1 )
-#define NO_IID_LEVELS_FINE              ( 2 * NO_IID_STEPS_FINE + 1 )
-#define NO_ICC_LEVELS                   ( NO_ICC_STEPS )
-
-
-
-#endif      /*  PS_CONSTANTS_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_decode_bs_utils.cpp b/media/libstagefright/codecs/aacdec/ps_decode_bs_utils.cpp
deleted file mode 100644
index 241da34..0000000
--- a/media/libstagefright/codecs/aacdec/ps_decode_bs_utils.cpp
+++ /dev/null
@@ -1,274 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_decode_bs_utils.c
-
-  Functions:
-        GetNrBitsAvailable
-        differential_Decoding
-        map34IndexTo20
-        limitMinMax
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Decode bitstream parametric stereo's utilities
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include "aac_mem_funcs.h"
-#include "s_ps_dec.h"
-#include "ps_decode_bs_utils.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int32 GetNrBitsAvailable(HANDLE_BIT_BUFFER hBitBuf)
-{
-
-    return (hBitBuf->bufferLen - hBitBuf->nrBitsRead);
-}
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-;
-;   Differential Decoding of parameters over time/frequency
-----------------------------------------------------------------------------*/
-
-void differential_Decoding(Int32 enable,
-                           Int32 *aIndex,
-                           Int32 *aPrevFrameIndex,
-                           Int32 DtDf,
-                           Int32 nrElements,
-                           Int32 stride,
-                           Int32 minIdx,
-                           Int32 maxIdx)
-{
-    Int32 i;
-    Int32 *ptr_aIndex;
-
-    if (enable == 1)
-    {
-        ptr_aIndex = aIndex;
-
-        if (DtDf == 0)
-        {
-            *(ptr_aIndex) = limitMinMax(*ptr_aIndex, minIdx, maxIdx);
-            ptr_aIndex++;
-
-            for (i = 1; i < nrElements; i++)
-            {
-                *(ptr_aIndex) = limitMinMax(aIndex[i-1] + *ptr_aIndex, minIdx, maxIdx);
-                ptr_aIndex++;
-            }
-        }
-        else
-        {
-            if (stride == 1)
-            {
-                for (i = 0; i < nrElements; i++)
-                {
-                    *(ptr_aIndex) = limitMinMax(aPrevFrameIndex[i] + *ptr_aIndex, minIdx, maxIdx);
-                    ptr_aIndex++;
-                }
-            }
-            else
-            {
-                for (i = 0; i < nrElements; i++)
-                {
-                    *(ptr_aIndex) = limitMinMax(aPrevFrameIndex[(i<<1)] + *ptr_aIndex, minIdx, maxIdx);
-                    ptr_aIndex++;
-                }
-            }
-        }
-    }
-    else
-    {
-        pv_memset((void *)aIndex, 0, nrElements*sizeof(*aIndex));
-    }
-    if (stride == 2)
-    {
-        for (i = (nrElements << 1) - 1; i > 0; i--)
-        {
-            aIndex[i] = aIndex[(i>>1)];
-        }
-    }
-}
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-        map34IndexTo20
-----------------------------------------------------------------------------*/
-
-void map34IndexTo20(Int32 *aIndex)
-{
-
-    aIndex[ 0] = ((aIndex[0] << 1) +  aIndex[1]) / 3;
-    aIndex[ 1] = (aIndex[1] + (aIndex[2] << 1)) / 3;
-    aIndex[ 2] = ((aIndex[3] << 1) +  aIndex[4]) / 3;
-    aIndex[ 3] = (aIndex[4] + (aIndex[5] << 1)) / 3;
-    aIndex[ 4] = (aIndex[ 6] +  aIndex[7]) >> 1;
-    aIndex[ 5] = (aIndex[ 8] +  aIndex[9]) >> 1;
-    aIndex[ 6] =   aIndex[10];
-    aIndex[ 7] =   aIndex[11];
-    aIndex[ 8] = (aIndex[12] +  aIndex[13]) >> 1;
-    aIndex[ 9] = (aIndex[14] +  aIndex[15]) >> 1;
-    aIndex[10] =   aIndex[16];
-    aIndex[11] =   aIndex[17];
-    aIndex[12] =   aIndex[18];
-    aIndex[13] =   aIndex[19];
-    aIndex[14] = (aIndex[20] +  aIndex[21]) >> 1;
-    aIndex[15] = (aIndex[22] +  aIndex[23]) >> 1;
-    aIndex[16] = (aIndex[24] +  aIndex[25]) >> 1;
-    aIndex[17] = (aIndex[26] +  aIndex[27]) >> 1;
-    aIndex[18] = (aIndex[28] +  aIndex[29] + aIndex[30] + aIndex[31]) >> 2;
-    aIndex[19] = (aIndex[32] +  aIndex[33]) >> 1;
-}
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-        limitMinMax
-----------------------------------------------------------------------------*/
-
-
-Int32 limitMinMax(Int32 i,
-                  Int32 min,
-                  Int32 max)
-{
-    if (i < max)
-    {
-        if (i > min)
-        {
-            return i;
-        }
-        else
-        {
-            return min;
-        }
-    }
-    else
-    {
-        return max;
-    }
-}
-
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_decode_bs_utils.h b/media/libstagefright/codecs/aacdec/ps_decode_bs_utils.h
deleted file mode 100644
index a672d94..0000000
--- a/media/libstagefright/codecs/aacdec/ps_decode_bs_utils.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_decode_bs_utils.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions differential_Decoding(), limitMinMax(),
-                           GetNrBitsAvailable(), map34IndexTo20()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_DECODE_BS_UTILS_H
-#define PS_DECODE_BS_UTILS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-#include "s_bit_buffer.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void differential_Decoding(Int32 enable,
-    Int32 *aIndex,
-    Int32 *aPrevFrameIndex,
-    Int32 DtDf,
-    Int32 nrElements,
-    Int32 stride,
-    Int32 minIdx,
-    Int32 maxIdx);
-
-    Int32 limitMinMax(Int32 i,
-                      Int32 min,
-                      Int32 max);
-
-    Int32 GetNrBitsAvailable(HANDLE_BIT_BUFFER hBitBuf);
-
-    void map34IndexTo20(Int32 *aIndex);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_DECODE_BS_UTILS_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_decorrelate.cpp b/media/libstagefright/codecs/aacdec/ps_decorrelate.cpp
deleted file mode 100644
index 6776d6e..0000000
--- a/media/libstagefright/codecs/aacdec/ps_decorrelate.cpp
+++ /dev/null
@@ -1,499 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_decorrelate.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  Decorrelation
-  Decorrelation is achieved by means of all-pass filtering and delaying
-  Sub-band samples s_k(n) are converted into de-correlated sub-bands samples
-  d_k(n). k index for frequency, n time index
-
-
-     _______                                              ________
-    |       |                                  _______   |        |
-  ->|Hybrid | LF ----                         |       |->| Hybrid |-->
-    | Anal. |        |                        |       |  | Synth  |   QMF -> L
-     -------         o----------------------->|       |   --------    Synth
-QMF                  |                s_k(n)  |Stereo |-------------->
-Anal.              -------------------------->|       |
-     _______       | |                        |       |   ________
-    |       | HF --o |   -----------          |Process|  |        |
-  ->| Delay |      |  ->|           |-------->|       |->| Hybrid |-->
-     -------       |    |decorrelate| d_k(n)  |       |  | Synth  |   QMF -> R
-                   ---->|           |-------->|       |   --------    Synth
-                         -----------          |_______|-------------->
-
-
-  Delay is introduced to compensate QMF bands not passed through Hybrid
-  Analysis
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-#include    "pv_audio_type_defs.h"
-#include    "ps_decorrelate.h"
-#include    "aac_mem_funcs.h"
-#include    "ps_all_pass_filter_coeff.h"
-#include    "ps_pwr_transient_detection.h"
-#include    "ps_all_pass_fract_delay_filter.h"
-#include    "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void ps_decorrelate(STRUCT_PS_DEC *h_ps_dec,
-                    Int32 *rIntBufferLeft,
-                    Int32 *iIntBufferLeft,
-                    Int32 *rIntBufferRight,
-                    Int32 *iIntBufferRight,
-                    Int32 scratch_mem[])
-{
-    Int32 sb;
-    Int32 maxsb;
-    Int32 gr;
-    Int32 sb_delay;
-    Int32 bin;
-
-
-
-
-    Int32 *aLeftReal;
-    Int32 *aLeftImag;
-    Int32 *aRightReal;
-    Int32 *aRightImag;
-
-    Int32 *aTransRatio = scratch_mem;   /* use  NO_BINS == 20 */
-
-
-    Int32 ***pppRealDelayRBufferSer;
-    Int32 ***pppImagDelayRBufferSer;
-
-    Int32 **ppRealDelayBuffer;
-    Int32 **ppImagDelayBuffer;
-
-    const Int32(*ppFractDelayPhaseFactorSer)[3];
-    /*
-     *  Power transient estimation and detection
-     */
-
-
-    ps_pwr_transient_detection(h_ps_dec,
-                               rIntBufferLeft,
-                               iIntBufferLeft,
-                               aTransRatio);
-
-
-    aLeftReal = h_ps_dec->mHybridRealLeft;
-    aLeftImag = h_ps_dec->mHybridImagLeft;
-    aRightReal = h_ps_dec->mHybridRealRight;
-    aRightImag = h_ps_dec->mHybridImagRight;
-
-    pppRealDelayRBufferSer = h_ps_dec->aaaRealDelayRBufferSerSubQmf;
-    pppImagDelayRBufferSer = h_ps_dec->aaaImagDelayRBufferSerSubQmf;
-
-    ppRealDelayBuffer = h_ps_dec->aaRealDelayBufferSubQmf;
-    ppImagDelayBuffer = h_ps_dec->aaImagDelayBufferSubQmf;
-
-
-
-    ppFractDelayPhaseFactorSer = aaFractDelayPhaseFactorSerSubQmf;
-
-
-    /*
-     *   NO_IID_GROUPS (SUBQMF_GROUPS (12) + QMF_GROUPS (10)) == 22
-     */
-
-    for (gr = 0; gr < SUBQMF_GROUPS; gr++)      /*  0 to 9 */
-    {
-        Int32 rIn;
-        Int32 iIn;
-        Int32 *pt_rTmp;
-        Int32 *pt_iTmp;
-        Int32 rTmp;
-        Int32 cmplx;
-        Int32 tmp1, tmp2;
-
-        /* sb = subQMF/QMF subband */
-
-        sb = groupBorders[gr];
-
-        /*
-         *  For lower subbands
-         *  Apply all-pass filtering
-         *
-         */
-        pt_rTmp = &ppRealDelayBuffer[sb][h_ps_dec->delayBufIndex];
-        pt_iTmp = &ppImagDelayBuffer[sb][h_ps_dec->delayBufIndex];
-
-        tmp1 = aLeftReal[sb];
-        tmp2 = aLeftImag[sb];
-        rIn = *pt_rTmp >> 1;
-        iIn = *pt_iTmp >> 1;
-
-
-        *pt_rTmp = tmp1;
-        *pt_iTmp = tmp2;
-
-        /*
-         *  Fractional delay vector
-         *
-         *  phi_fract(k) = exp(-j*pi*q_phi*f_center(k))       0<= k <= SUBQMF_GROUPS
-         *
-         *  q_phi = 0.39
-         *  f_center(k) frequency vector
-         */
-
-        cmplx =  aFractDelayPhaseFactorSubQmf[sb];
-
-        aRightReal[sb]  = cmplx_mul32_by_16(rIn, -iIn, cmplx);
-        aRightImag[sb]  = cmplx_mul32_by_16(iIn,  rIn, cmplx);
-
-        ps_all_pass_fract_delay_filter_type_I(h_ps_dec->aDelayRBufIndexSer,
-                                              sb,
-                                              ppFractDelayPhaseFactorSer[sb],
-                                              pppRealDelayRBufferSer,
-                                              pppImagDelayRBufferSer,
-                                              &aRightReal[sb],
-                                              &aRightImag[sb]);
-
-        bin = bins2groupMap[gr];
-        rTmp = aTransRatio[bin];
-
-        if (rTmp != 0x7FFFFFFF)
-        {
-            aRightReal[sb] = fxp_mul32_Q31(rTmp, aRightReal[sb]) << 1;
-            aRightImag[sb] = fxp_mul32_Q31(rTmp, aRightImag[sb]) << 1;
-        }
-
-
-    } /* gr */
-
-    aLeftReal = rIntBufferLeft;
-    aLeftImag = iIntBufferLeft;
-    aRightReal = rIntBufferRight;
-    aRightImag = iIntBufferRight;
-
-    pppRealDelayRBufferSer = h_ps_dec->aaaRealDelayRBufferSerQmf;
-    pppImagDelayRBufferSer = h_ps_dec->aaaImagDelayRBufferSerQmf;
-
-    ppRealDelayBuffer = h_ps_dec->aaRealDelayBufferQmf;
-    ppImagDelayBuffer = h_ps_dec->aaImagDelayBufferQmf;
-
-
-
-    ppFractDelayPhaseFactorSer = aaFractDelayPhaseFactorSerQmf;
-
-
-    for (gr = SUBQMF_GROUPS; gr < NO_BINS; gr++)     /* 10 to 20 */
-    {
-
-        maxsb = min(h_ps_dec->usb, groupBorders[gr+1]);
-
-        /* sb = subQMF/QMF subband */
-
-        for (sb = groupBorders[gr]; sb < maxsb; sb++)
-        {
-
-            Int32 rIn, iIn;
-            Int32 *pt_rTmp, *pt_iTmp;
-            Int32 cmplx;
-            Int32 tmp1, tmp2;
-            Int32 rTmp;
-
-
-            sb_delay = sb - NO_QMF_CHANNELS_IN_HYBRID;  /* NO_QMF_CHANNELS_IN_HYBRID == 3 */
-
-            /*
-             *  For lower subbands
-             *  Apply all-pass filtering
-             *
-             */
-            pt_rTmp = &ppRealDelayBuffer[sb_delay][h_ps_dec->delayBufIndex];
-            pt_iTmp = &ppImagDelayBuffer[sb_delay][h_ps_dec->delayBufIndex];
-
-            rIn = *pt_rTmp >> 1;
-            iIn = *pt_iTmp >> 1;
-
-            tmp1 = aLeftReal[sb];
-            tmp2 = aLeftImag[sb];
-            *pt_rTmp = tmp1;
-            *pt_iTmp = tmp2;
-
-            /*
-             *  Fractional delay vector
-             *
-             *  phi_fract(k) = exp(-j*pi*q_phi*f_center(k))       0<= k <= SUBQMF_GROUPS
-             *
-             *  q_phi = 0.39
-             *  f_center(k) frequency vector
-             */
-
-            cmplx =  aFractDelayPhaseFactor[sb_delay];
-            aRightReal[sb] = cmplx_mul32_by_16(rIn, -iIn, cmplx);
-            aRightImag[sb] = cmplx_mul32_by_16(iIn,  rIn, cmplx);
-
-            ps_all_pass_fract_delay_filter_type_II(h_ps_dec->aDelayRBufIndexSer,
-                                                   sb_delay,
-                                                   ppFractDelayPhaseFactorSer[sb_delay],
-                                                   pppRealDelayRBufferSer,
-                                                   pppImagDelayRBufferSer,
-                                                   &aRightReal[sb],
-                                                   &aRightImag[sb],
-                                                   sb);
-
-            rTmp = aTransRatio[gr-2];
-            if (rTmp != 0x7FFFFFFF)
-            {
-                aRightReal[sb] = fxp_mul32_Q31(rTmp, aRightReal[sb]) << 1;
-                aRightImag[sb] = fxp_mul32_Q31(rTmp, aRightImag[sb]) << 1;
-            }
-
-
-        } /* sb */
-
-    }
-
-
-    maxsb = min(h_ps_dec->usb, 35);  /*  35 == groupBorders[NO_BINS + 1] */
-
-    /* sb = subQMF/QMF subband */
-    {
-        Int32 factor = aTransRatio[NO_BINS-2];
-
-        for (sb = 23; sb < maxsb; sb++)    /*  23 == groupBorders[NO_BINS] */
-        {
-
-            Int32  tmp, tmp2;
-            Int32 *pt_rTmp, *pt_iTmp;
-
-            sb_delay = sb - NO_QMF_CHANNELS_IN_HYBRID;  /*  == 3 */
-
-            /*
-             *  For the Upper Bands apply delay only
-             *                          -D(k)
-             *  Apply Delay   H_k(z) = z         , D(k) == 1 or 14
-             *
-             */
-            Int32 k = sb - NO_ALLPASS_CHANNELS;  /* == 23 */
-
-
-            pt_rTmp = &ppRealDelayBuffer[sb_delay][h_ps_dec->aDelayBufIndex[ k]];
-            pt_iTmp = &ppImagDelayBuffer[sb_delay][h_ps_dec->aDelayBufIndex[ k]];
-
-            if (++h_ps_dec->aDelayBufIndex[ k] >= LONG_DELAY)     /* == 14 */
-            {
-                h_ps_dec->aDelayBufIndex[ k] = 0;
-            }
-
-
-            tmp  = *pt_rTmp;
-            tmp2 = *pt_iTmp;
-
-            if (aTransRatio[NO_BINS-2] < 0x7FFFFFFF)
-            {
-                aRightReal[sb] = fxp_mul32_Q31(factor, tmp) << 1;
-                aRightImag[sb] = fxp_mul32_Q31(factor, tmp2) << 1;
-            }
-            else
-            {
-                aRightReal[sb] = tmp;
-                aRightImag[sb] = tmp2;
-            }
-
-
-            tmp  = aLeftReal[sb];
-            tmp2 = aLeftImag[sb];
-            *pt_rTmp = tmp;
-            *pt_iTmp = tmp2;
-
-
-        } /* sb */
-    }
-
-
-    maxsb = min(h_ps_dec->usb, 64);     /*  64 == groupBorders[NO_BINS+2] */
-
-    /* sb = subQMF/QMF subband */
-
-    {
-
-        for (sb = 35; sb < maxsb; sb++)    /*  35 == groupBorders[NO_BINS+1] */
-        {
-
-            Int32 *pt_rTmp, *pt_iTmp;
-
-            sb_delay = sb - NO_QMF_CHANNELS_IN_HYBRID;  /*  == 3 */
-
-            /*
-             *  For the Upper Bands apply delay only
-             *                          -D(k)
-             *  Apply Delay   H_k(z) = z         , D(k) == 1 or 14
-             *
-             */
-
-            pt_rTmp = &ppRealDelayBuffer[sb_delay][0];
-            pt_iTmp = &ppImagDelayBuffer[sb_delay][0];
-
-            aRightReal[sb] = *pt_rTmp;
-            aRightImag[sb] = *pt_iTmp;
-
-
-            if (aTransRatio[NO_BINS-1] < 0x7FFFFFFF)
-            {
-                aRightReal[sb] = fxp_mul32_Q31(aTransRatio[NO_BINS-1], aRightReal[sb]) << 1;
-                aRightImag[sb] = fxp_mul32_Q31(aTransRatio[NO_BINS-1], aRightImag[sb]) << 1;
-            }
-
-            *pt_rTmp = aLeftReal[sb];
-            *pt_iTmp = aLeftImag[sb];
-
-
-        } /* sb */
-    }
-
-
-    if (++h_ps_dec->delayBufIndex >= DELAY_ALLPASS)
-    {
-        h_ps_dec->delayBufIndex = 0;
-    }
-
-    if (++h_ps_dec->aDelayRBufIndexSer[0] >= 3)
-    {
-        h_ps_dec->aDelayRBufIndexSer[0] = 0;
-    }
-    if (++h_ps_dec->aDelayRBufIndexSer[1] >= 4)
-    {
-        h_ps_dec->aDelayRBufIndexSer[1] = 0;
-    }
-    if (++h_ps_dec->aDelayRBufIndexSer[2] >= 5)
-    {
-        h_ps_dec->aDelayRBufIndexSer[2] = 0;
-    }
-
-
-} /* END deCorrelate */
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_decorrelate.h b/media/libstagefright/codecs/aacdec/ps_decorrelate.h
deleted file mode 100644
index c2a025a..0000000
--- a/media/libstagefright/codecs/aacdec/ps_decorrelate.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_decorrelate.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function ps_decorrelate()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_DECORRELATE_H
-#define PS_DECORRELATE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void ps_decorrelate(STRUCT_PS_DEC *h_ps_dec,
-    Int32 *rIntBufferLeft,
-    Int32 *iIntBufferLeft,
-    Int32 *rIntBufferRight,
-    Int32 *iIntBufferRight,
-    Int32 scratch_mem[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_DECORRELATE_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_fft_rx8.cpp b/media/libstagefright/codecs/aacdec/ps_fft_rx8.cpp
deleted file mode 100644
index 7669be3..0000000
--- a/media/libstagefright/codecs/aacdec/ps_fft_rx8.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: fft_rx8.c
- Funtions: ps_fft_rx8
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    Real     Vector of Real components size 8
-
-    Imag     Vector of Imag components size 8
-             type Int32
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-     scratch_mem size 32
-
- Outputs:
-    In-place calculation of a 8-point FFT (radix-8)
-
- Pointers and Buffers Modified:
-    calculation are done in-place and returned in Data
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    8-point DFT, radix 8 with Decimation in Frequency
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This function should provide a fixed point FFT for any input array
-    of size power of 8.
-
-------------------------------------------------------------------------------
- REFERENCES
-
-    [1] Advance Digital Signal Processing, J. Proakis, C. Rader, F. Ling,
-        C. Nikias, Macmillan Pub. Co.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-   MODIFY( x[] )
-   RETURN( exponent )
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#ifdef PARAMETRICSTEREO
-
-
-#include "pv_audio_type_defs.h"
-#include "ps_fft_rx8.h"
-
-#include    "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define R_SHIFT     29
-#define Q29_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void ps_fft_rx8(Int32 Re[], Int32 Im[], Int32 scratch_mem[])
-
-/* scratch_mem size 32 */
-{
-
-    Int     i;
-    Int32   *Q = &scratch_mem[0];
-    Int32   *Z = &scratch_mem[16];
-    Int32   temp1;
-    Int32   temp2;
-    Int32   temp3;
-    Int32   temp4;
-    Int32   aux_r[2];
-    Int32   aux_i[2];
-    Int32   *pt_r1 = &Re[0];
-    Int32   *pt_r2 = &Re[4];
-    Int32   *pt_i1 = &Im[0];
-    Int32   *pt_i2 = &Im[4];
-
-    Int32   *pt_Q = Q;
-    Int32   *pt_Z = Z;
-
-
-    temp1 = *(pt_r1++); /*  Real */
-    temp2 = *(pt_r2++); /*  Real */
-    temp3 = *(pt_i1++); /*  Imag */
-    temp4 = *(pt_i2++); /*  Imag */
-    /*
-     *  Vector Q stores data as Real, Imag, Real, Imag,....
-     */
-
-    *(pt_Q++) = temp1 + temp2;  /* Q(0) =  v(0) + v(4) */
-    *(pt_Q++) = temp3 + temp4;
-    *(pt_Q++) = temp1 - temp2;  /* Q(1) =  v(0) - v(4) */
-    *(pt_Q++) = temp3 - temp4;
-
-    temp1 = *(pt_r1++);
-    temp2 = *(pt_r2++);
-    temp3 = *(pt_i1++);
-    temp4 = *(pt_i2++);
-
-    *(pt_Q++) = temp1 + temp2;  /*    Q(2) =  v(1) + v(5) */
-    *(pt_Q++) = temp3 + temp4;
-    aux_r[0]  = temp1 - temp2;  /* aux[0]  =  v(1) - v(5) */
-    aux_i[0]  = temp3 - temp4;
-
-    temp1 = *(pt_r1++);
-    temp2 = *(pt_r2++);
-    temp3 = *(pt_i1++);
-    temp4 = *(pt_i2++);
-
-    *(pt_Q++) = temp1 + temp2;  /*  Q(3) =  v(2) + v(6) */
-    *(pt_Q++) = temp3 + temp4;
-    *(pt_Q++) = temp4 - temp3;  /*  Q(4) = (v(2) - v(6))*j */
-    *(pt_Q++) = temp1 - temp2;
-
-    temp1 = *(pt_r1++);
-    temp2 = *(pt_r2++);
-    temp3 = *(pt_i1++);
-    temp4 = *(pt_i2++);
-
-
-    *(pt_Q++) = temp1 + temp2;  /*  Q(5)   = v(3) + v(7) */
-    *(pt_Q++) = temp3 + temp4;
-    aux_r[1]  = temp1 - temp2;  /*  aux[1] = v(3) - v(7) */
-    aux_i[1]  = temp3 - temp4;
-    /*  Q(6) =  (aux[0] - aux[1])/sqrt(2); */
-    *(pt_Q++) = fxp_mul32_Q29((aux_r[0] - aux_r[1]), Q29_fmt(0.70710678118655f));
-    *(pt_Q++) = fxp_mul32_Q29((aux_i[0] - aux_i[1]), Q29_fmt(0.70710678118655f));
-
-    /*  Q(7) =  (aux[0] + aux[1])*j/sqrt(2); */
-    *(pt_Q++) =  fxp_mul32_Q29((aux_i[0] + aux_i[1]), Q29_fmt(-0.70710678118655f));
-    *(pt_Q) =  fxp_mul32_Q29((aux_r[0] + aux_r[1]), Q29_fmt(0.70710678118655f));
-
-    pt_r1 = &Q[0];        /* reset pointer */
-    pt_r2 = &Q[6];        /* reset pointer */
-
-    temp1 = *(pt_r1++);
-    temp2 = *(pt_r2++);
-    temp3 = *(pt_r1++);
-    temp4 = *(pt_r2++);
-
-    /*
-     *  Vector Z stores data as Real, Imag, Real, Imag,....
-     */
-
-    *(pt_Z++) = temp1 + temp2;  /* Q(0) + Q(3) */
-    *(pt_Z++) = temp3 + temp4;
-    aux_r[0]  = temp1 - temp2;
-    aux_i[0]  = temp3 - temp4;
-
-    temp1 = *(pt_r1++);
-    temp2 = *(pt_r2++);
-    temp3 = *(pt_r1++);
-    temp4 = *(pt_r2++);
-
-    *(pt_Z++) = temp1 + temp2;  /* Q(1) + Q(4) */
-    *(pt_Z++) = temp3 + temp4;
-    *(pt_Z++) = aux_r[0];       /* Q(0) - Q(3) */
-    *(pt_Z++) = aux_i[0];
-    *(pt_Z++) = temp1 - temp2;  /* Q(1) - Q(4) */
-    *(pt_Z++) = temp3 - temp4;
-
-    temp1 = *(pt_r1++);
-    temp2 = *(pt_r2++);
-    temp3 = *(pt_r1);
-    temp4 = *(pt_r2++);
-
-    *(pt_Z++) = temp1 + temp2;  /* Q(2) + Q(5) */
-    *(pt_Z++) = temp3 + temp4;
-    aux_r[0]  = temp1 - temp2;
-    aux_i[0]  = temp3 - temp4;
-
-    temp1 = *(pt_r2++);
-    temp3 = *(pt_r2++);
-    temp2 = *(pt_r2++);
-    temp4 = *(pt_r2);
-
-    *(pt_Z++) = temp1 + temp2;  /* Q(6) + Q(7) */
-    *(pt_Z++) = temp3 + temp4;
-
-    *(pt_Z++) = -aux_i[0];      /* (Q(2) - Q(5))*j */
-    *(pt_Z++) =  aux_r[0];
-
-    *(pt_Z++) =  temp2 - temp1;  /* -Q(6) + Q(7) */
-    *(pt_Z) =  temp4 - temp3;
-
-    pt_Z = &Z[0];        /* reset pointer */
-    pt_Q = &Z[8];        /* reset pointer */
-
-    pt_r1 = &Re[0];
-    pt_r2 = &Re[4];
-    pt_i1 = &Im[0];
-    pt_i2 = &Im[4];
-
-
-    for (i = 4; i != 0; i--)
-    {
-        temp1 = *(pt_Z++);
-        temp2 = *(pt_Q++);
-        temp3 = *(pt_Z++);
-        temp4 = *(pt_Q++);
-
-        *(pt_r1++) = temp1 + temp2;  /* Z(n) + Z(n+4) */
-        *(pt_i1++) = temp3 + temp4;
-        *(pt_r2++) = temp1 - temp2;  /* Z(n) - Z(n+4) */
-        *(pt_i2++) = temp3 - temp4;
-    }
-
-}
-
-#endif  /* PARAMETRICSTEREO */
-
-
-#endif  /* AAC_PLUS */
diff --git a/media/libstagefright/codecs/aacdec/ps_fft_rx8.h b/media/libstagefright/codecs/aacdec/ps_fft_rx8.h
deleted file mode 100644
index 6c3482e..0000000
--- a/media/libstagefright/codecs/aacdec/ps_fft_rx8.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_fft_rx8.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions ps_fft_rx8()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_FFT_RX8_H
-#define PS_FFT_RX8_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void ps_fft_rx8(Int32 Re[], Int32 Im[], Int32 scratch_mem[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_FFT_RX4_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_hybrid_analysis.cpp b/media/libstagefright/codecs/aacdec/ps_hybrid_analysis.cpp
deleted file mode 100644
index 933b07e..0000000
--- a/media/libstagefright/codecs/aacdec/ps_hybrid_analysis.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_hybrid_analysis.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Does Hybrid analysis:
-
-        Get higher frequency resolution in the lower QMF subbands
-        creating sub-subbands. This is done by low frequency filtering.
-        Lower QMF subbands are further split in order to obtain a higher
-        frequency resolution, enabling a proper stereo analysis and synthesis
-        for the lower frequencies.
-        Two hybrid are defined. Both filters have length 13 and a delay of 6.
-        In this implementation, the symmetry of the filters helps to simplify
-        the design.
-
-
-   Increase Freq. Resolution
-     _______                                              ________
-    |       |                                  _______   |        |
-  ->|Hybrid | LF ----                         |       |->| Hybrid |-->
-    | Anal. |        |                        |       |  | Synth  |   QMF -> L
-     -------         o----------------------->|       |   --------    Synth
-QMF                  |                s_k(n)  |Stereo |-------------->
-Anal.              -------------------------->|       |
-     _______       | |                        |       |   ________
-    |       | HF --o |   -----------          |Process|  |        |
-  ->| Delay |      |  ->|           |-------->|       |->| Hybrid |-->
-     -------       |    |decorrelate| d_k(n)  |       |  | Synth  |   QMF -> R
-                   ---->|           |-------->|       |   --------    Synth
-                         -----------          |_______|-------------->
-
-
-
-          subband k             QMF channel
-             0   .................  0      -----------
-             1   .................  0
-             2   .................  0
-             3   .................  0
-             4   .................  0
-             5   .................  0        Sub-QMF  ( Increase Freq. Resolution)
-             6   .................  1
-             7   .................  1
-             8   .................  2
-             9   .................  2
-            10   .................  3      -----------
-            11   .................  4
-            12   .................  5
-            13   .................  6
-            14   .................  7
-            15   .................  8         QMF
-           16-17 .................  9-10
-           18-20 ................. 11-13
-           21-24 ................. 14-17
-           25-29 ................. 18-22
-           30-41 ................. 23-34
-           42-70 ................. 35-63   -----------
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include    "s_hybrid.h"
-#include    "aac_mem_funcs.h"
-#include    "ps_channel_filtering.h"
-#include    "ps_hybrid_analysis.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void ps_hybrid_analysis(const Int32 mQmfReal[][64],
-                        const Int32 mQmfImag[][64],
-                        Int32 *mHybridReal,
-                        Int32 *mHybridImag,
-                        HYBRID *pHybrid,
-                        Int32 scratch_mem[],
-                        Int32 i)
-
-{
-
-    Int32 band;
-    HYBRID_RES hybridRes;
-    Int32  chOffset = 0;
-
-    Int32 *ptr_mHybrid_Re;
-    Int32 *ptr_mHybrid_Im;
-
-    Int32 *pt_mQmfBufferReal;
-    Int32 *pt_mQmfBufferImag;
-
-    pt_mQmfBufferReal = &scratch_mem[32 + i];
-
-    for (band = 0; band < pHybrid->nQmfBands; band++)
-    {
-        pt_mQmfBufferImag = pt_mQmfBufferReal + 44;
-
-
-        pt_mQmfBufferReal[HYBRID_FILTER_LENGTH_m_1] = mQmfReal[HYBRID_FILTER_DELAY][band];
-        pt_mQmfBufferImag[HYBRID_FILTER_LENGTH_m_1] = mQmfImag[HYBRID_FILTER_DELAY][band];
-
-
-        ptr_mHybrid_Re = &mHybridReal[ chOffset];
-        ptr_mHybrid_Im = &mHybridImag[ chOffset];
-
-        hybridRes = (HYBRID_RES)pHybrid->pResolution[band];
-        switch (hybridRes)
-        {
-                /*
-                 *  For QMF band = 1  and  2
-                 */
-
-            case HYBRID_2_REAL:
-
-                two_ch_filtering(pt_mQmfBufferReal,
-                                 pt_mQmfBufferImag,
-                                 ptr_mHybrid_Re,
-                                 ptr_mHybrid_Im);
-                chOffset += 2;
-
-                break;
-
-                /*
-                 *  For QMF band = 0
-                 */
-
-            case HYBRID_8_CPLX:
-
-                eight_ch_filtering(pt_mQmfBufferReal,
-                                   pt_mQmfBufferImag,
-                                   pHybrid->mTempReal,
-                                   pHybrid->mTempImag,
-                                   scratch_mem);
-
-                pv_memmove(ptr_mHybrid_Re, pHybrid->mTempReal, 4*sizeof(*pHybrid->mTempReal));
-
-                ptr_mHybrid_Re += 2;
-
-                *(ptr_mHybrid_Re++) +=  pHybrid->mTempReal[5];
-                *(ptr_mHybrid_Re++) +=  pHybrid->mTempReal[4];
-                *(ptr_mHybrid_Re++)  =  pHybrid->mTempReal[6];
-                *(ptr_mHybrid_Re)  =  pHybrid->mTempReal[7];
-
-                pv_memmove(ptr_mHybrid_Im, pHybrid->mTempImag, 4*sizeof(*pHybrid->mTempImag));
-                ptr_mHybrid_Im += 2;
-
-                *(ptr_mHybrid_Im++) +=  pHybrid->mTempImag[5];
-                *(ptr_mHybrid_Im++) +=  pHybrid->mTempImag[4];
-                *(ptr_mHybrid_Im++)  =  pHybrid->mTempImag[6];
-                *(ptr_mHybrid_Im)  =  pHybrid->mTempImag[7];
-
-                chOffset += 6;
-
-                break;
-
-            default:
-                ;
-        }
-
-        pt_mQmfBufferReal = pt_mQmfBufferImag + 44;
-
-    }
-
-
-}
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_hybrid_analysis.h b/media/libstagefright/codecs/aacdec/ps_hybrid_analysis.h
deleted file mode 100644
index 0140a1f..0000000
--- a/media/libstagefright/codecs/aacdec/ps_hybrid_analysis.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_hybrid_analysis.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function ps_hybrid_analysis()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_HYBRID_ANALYSIS_H
-#define PS_HYBRID_ANALYSIS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_hybrid.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void ps_hybrid_analysis(const Int32 mQmfReal[][64],
-    const Int32 mQmfImag[][64],
-    Int32 *mHybridReal,
-    Int32 *mHybridImag,
-    HYBRID *pHybrid,
-    Int32 scratch_mem[],
-    Int32 band);
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_HYBRID_ANALYSIS_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_hybrid_filter_bank_allocation.cpp b/media/libstagefright/codecs/aacdec/ps_hybrid_filter_bank_allocation.cpp
deleted file mode 100644
index 4ff2385..0000000
--- a/media/libstagefright/codecs/aacdec/ps_hybrid_filter_bank_allocation.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_hybrid_filter_bank_allocation.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Does Hybrid filter bank memory allocation
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-#include    "aac_mem_funcs.h"
-#include    "ps_hybrid_filter_bank_allocation.h"
-#include    "ps_all_pass_filter_coeff.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int32 ps_hybrid_filter_bank_allocation(HYBRID **phHybrid,
-                                       Int32 noBands,
-                                       const Int32 *pResolution,
-                                       Int32 **pPtr)
-{
-    Int32 i;
-    Int32 tmp;
-    Int32 maxNoChannels = 0;
-    HYBRID *hs;
-    Int32 *ptr = *pPtr;
-
-
-    *phHybrid = (HYBRID *)NULL;
-
-    hs = (HYBRID *)ptr;
-
-    ptr += sizeof(HYBRID) / sizeof(*ptr);
-
-    hs->pResolution = (Int32*)ptr;
-
-    ptr += noBands * sizeof(Int32) / sizeof(*ptr);
-
-    for (i = 0; i < noBands; i++)
-    {
-
-        hs->pResolution[i] = pResolution[i];
-
-        if (pResolution[i] != HYBRID_8_CPLX &&
-                pResolution[i] != HYBRID_2_REAL &&
-                pResolution[i] != HYBRID_4_CPLX)
-        {
-            return 1;
-        }
-
-        if (pResolution[i] > maxNoChannels)
-        {
-            maxNoChannels = pResolution[i];
-        }
-    }
-
-    hs->nQmfBands     = noBands;
-    hs->qmfBufferMove = HYBRID_FILTER_LENGTH - 1;
-
-    hs->mQmfBufferReal = (Int32 **)ptr;
-    ptr += noBands * sizeof(ptr) / sizeof(*ptr);
-
-    hs->mQmfBufferImag = (Int32 **)ptr;
-    ptr += noBands * sizeof(ptr) / sizeof(*ptr);
-
-    tmp = hs->qmfBufferMove;        /*  HYBRID_FILTER_LENGTH == 13 */
-
-    for (i = 0; i < noBands; i++)
-    {
-        hs->mQmfBufferReal[i] = ptr;
-        ptr += tmp;
-
-        hs->mQmfBufferImag[i] = ptr;
-        ptr += tmp;
-
-    }
-
-    hs->mTempReal = ptr;
-    ptr += maxNoChannels;
-
-
-    hs->mTempImag = ptr;
-    ptr += maxNoChannels;
-
-
-    *phHybrid = hs;
-    *pPtr = ptr;
-
-    return 0;
-}
-
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_hybrid_filter_bank_allocation.h b/media/libstagefright/codecs/aacdec/ps_hybrid_filter_bank_allocation.h
deleted file mode 100644
index fbc0d80..0000000
--- a/media/libstagefright/codecs/aacdec/ps_hybrid_filter_bank_allocation.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_hybrid_filter_bank_allocation.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for ps_hybrid_filter_bank_allocation
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_HYBRID_FILTER_BANK_ALLOCATION_H
-#define PS_HYBRID_FILTER_BANK_ALLOCATION_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_hybrid.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int32 ps_hybrid_filter_bank_allocation(HYBRID **phHybrid,
-    Int32 noBands,
-    const Int32 *pResolution,
-    Int32 **pPtr);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_HYBRID_FILTER_BANK_ALLOCATION_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_hybrid_synthesis.cpp b/media/libstagefright/codecs/aacdec/ps_hybrid_synthesis.cpp
deleted file mode 100644
index 4fbd016..0000000
--- a/media/libstagefright/codecs/aacdec/ps_hybrid_synthesis.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_hybrid_synthesis.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Hybrid synthesis
-
-     _______                                              ________
-    |       |                                  _______   |        |
-  ->|Hybrid | LF ----                         |       |->| Hybrid |-->
-    | Anal. |        |                        |       |  | Synth  |   QMF -> L
-     -------         o----------------------->|       |   --------    Synth
-QMF                  |                s_k(n)  |Stereo |-------------->
-Anal.              -------------------------->|       |
-     _______       | |                        |       |   ________
-    |       | HF --o |   -----------          |Process|  |        |
-  ->| Delay |      |  ->|           |-------->|       |->| Hybrid |-->
-     -------       |    |decorrelate| d_k(n)  |       |  | Synth  |   QMF -> R
-                   ---->|           |-------->|       |   --------    Synth
-                         -----------          |_______|-------------->
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include "s_hybrid.h"
-#include "ps_hybrid_synthesis.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void ps_hybrid_synthesis(const Int32 *mHybridReal,
-                         const Int32 *mHybridImag,
-                         Int32 *mQmfReal,
-                         Int32 *mQmfImag,
-                         HYBRID *hHybrid)
-{
-    Int32  k;
-    Int32  band;
-    HYBRID_RES hybridRes;
-
-    Int32 real;
-    Int32 imag;
-    Int32 *ptr_mQmfReal = mQmfReal;
-    Int32 *ptr_mQmfImag = mQmfImag;
-    const Int32 *ptr_mHybrid_Re = mHybridReal;
-    const Int32 *ptr_mHybrid_Im = mHybridImag;
-
-    for (band = 0; band < hHybrid->nQmfBands; band++)
-    {
-        hybridRes = (HYBRID_RES)(min(hHybrid->pResolution[band], 6) - 2);
-
-        real  = *(ptr_mHybrid_Re++);
-        real += *(ptr_mHybrid_Re++);
-        imag  = *(ptr_mHybrid_Im++);
-        imag += *(ptr_mHybrid_Im++);
-
-        for (k = (hybridRes >> 1); k != 0; k--)    /*  hybridRes = { 2,4,6 }  */
-        {
-            real += *(ptr_mHybrid_Re++);
-            real += *(ptr_mHybrid_Re++);
-            imag += *(ptr_mHybrid_Im++);
-            imag += *(ptr_mHybrid_Im++);
-        }
-
-        *(ptr_mQmfReal++) = real;
-        *(ptr_mQmfImag++) = imag;
-    }
-}
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_hybrid_synthesis.h b/media/libstagefright/codecs/aacdec/ps_hybrid_synthesis.h
deleted file mode 100644
index d7242dd..0000000
--- a/media/libstagefright/codecs/aacdec/ps_hybrid_synthesis.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_hybrid_synthesis.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function ps_hybrid_synthesis()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_HYBRID_SYNTHESIS_H
-#define PS_HYBRID_SYNTHESIS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_hybrid.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void ps_hybrid_synthesis(const Int32 *mHybridReal,
-    const Int32 *mHybridImag,
-    Int32 *mQmfReal,
-    Int32 *mQmfImag,
-    HYBRID *hHybrid);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_HYBRID_SYNTHESIS_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_init_stereo_mixing.cpp b/media/libstagefright/codecs/aacdec/ps_init_stereo_mixing.cpp
deleted file mode 100644
index 7027b5c..0000000
--- a/media/libstagefright/codecs/aacdec/ps_init_stereo_mixing.cpp
+++ /dev/null
@@ -1,496 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_init_stereo_mixing.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-      initialize mixing procedure  type Ra, type Rb is not supported
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include    "pv_audio_type_defs.h"
-#include    "fxp_mul32.h"
-
-#include    "aac_mem_funcs.h"
-#include    "pv_sine.h"
-#include    "s_ps_dec.h"
-#include    "ps_all_pass_filter_coeff.h"
-#include    "ps_init_stereo_mixing.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*
-;
-;  c(b) = 10^(iid(b)/20)
-;
-;  Intensity differences
-;
-;                  sqrt(2)
-;   c_1(b) = ----------------
-;            sqrt( 1 + c^2(b))
-;
-;               sqrt(2)*c(b)
-;   c_2(b) = ----------------
-;            sqrt( 1 + c^2(b))
-;
-*/
-
-
-
-#define R_SHIFT     30
-#define Q30_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-const Int32 scaleFactors[NO_IID_LEVELS] =
-{
-    Q30_fmt(1.411983f),  Q30_fmt(1.403138f),  Q30_fmt(1.386877f),
-    Q30_fmt(1.348400f),  Q30_fmt(1.291249f),  Q30_fmt(1.196037f),
-    Q30_fmt(1.107372f),  Q30_fmt(1.000000f),  Q30_fmt(0.879617f),
-    Q30_fmt(0.754649f),  Q30_fmt(0.576780f),  Q30_fmt(0.426401f),
-    Q30_fmt(0.276718f),  Q30_fmt(0.176645f),  Q30_fmt(0.079402f)
-};
-
-const Int32 scaleFactorsFine[NO_IID_LEVELS_FINE] =
-{
-    Q30_fmt(1.414207f),  Q30_fmt(1.414191f),  Q30_fmt(1.414143f),
-    Q30_fmt(1.413990f),  Q30_fmt(1.413507f),  Q30_fmt(1.411983f),
-    Q30_fmt(1.409773f),  Q30_fmt(1.405395f),  Q30_fmt(1.396780f),
-    Q30_fmt(1.380053f),  Q30_fmt(1.348400f),  Q30_fmt(1.313920f),
-    Q30_fmt(1.264310f),  Q30_fmt(1.196037f),  Q30_fmt(1.107372f),
-    Q30_fmt(1.000000f),  Q30_fmt(0.879617f),  Q30_fmt(0.754649f),
-    Q30_fmt(0.633656f),  Q30_fmt(0.523081f),  Q30_fmt(0.426401f),
-    Q30_fmt(0.308955f),  Q30_fmt(0.221375f),  Q30_fmt(0.157688f),
-    Q30_fmt(0.111982f),  Q30_fmt(0.079402f),  Q30_fmt(0.044699f),
-    Q30_fmt(0.025145f),  Q30_fmt(0.014141f),  Q30_fmt(0.007953f),
-    Q30_fmt(0.004472f)
-};
-
-
-/*
- *  alphas ranged between 0 and pi/2
- *  alpha(b) = (1/2)*arccos( gamma(b))
- *
- *    b   0    1      2        3        4      5        6     7
- *  gamma 1 0.937  0.84118  0.60092  0.36764   0    -0.589   -1
- *
- */
-
-
-
-const Int32 scaled_alphas[NO_ICC_LEVELS] =
-{
-    Q30_fmt(0.00000000000000f),  Q30_fmt(0.12616764875355f),
-    Q30_fmt(0.20199707286122f),  Q30_fmt(0.32744135137762f),
-    Q30_fmt(0.42225800677370f),  Q30_fmt(0.55536025173035f),
-    Q30_fmt(0.77803595530059f),  Q30_fmt(1.11072050346071f)
-};
-
-const Int32 cos_alphas[NO_ICC_LEVELS] =
-{
-    Q30_fmt(1.00000000000000f),  Q30_fmt(0.98412391153249f),
-    Q30_fmt(0.95947390717984f),  Q30_fmt(0.89468446298319f),
-    Q30_fmt(0.82693418207478f),  Q30_fmt(0.70710689672598f),
-    Q30_fmt(0.45332071670080f),  Q30_fmt(0.00000032679490f)
-};
-
-const Int32 sin_alphas[NO_ICC_LEVELS] =
-{
-    Q30_fmt(0.00000000000000f),  Q30_fmt(0.17748275057029f),
-    Q30_fmt(0.28179748302823f),  Q30_fmt(0.44669868110000f),
-    Q30_fmt(0.56229872711603f),  Q30_fmt(0.70710666564709f),
-    Q30_fmt(0.89134747871404f),  Q30_fmt(1.00000000000000f)
-};
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int32 ps_init_stereo_mixing(STRUCT_PS_DEC *pms,
-                            Int32 env,
-                            Int32 usb)
-{
-    Int32   group;
-    Int32   bin;
-    Int32   noIidSteps;
-    Int32   tmp;
-
-    Int32   invEnvLength;
-    const Int32  *pScaleFactors;
-    Int32   scaleR;
-    Int32   scaleL;
-    Int32   cos_alpha;
-    Int32   sin_alpha;
-    Int32   beta;
-    Int32   cos_beta;
-    Int32   sin_beta;
-    Int32   temp1;
-    Int32   temp2;
-    Int32   *ptr_tmp;
-    Int32   h11;
-    Int32   h12;
-    Int32   h21;
-    Int32   h22;
-
-    if (pms->bFineIidQ)
-    {
-        noIidSteps = NO_IID_STEPS_FINE;     /*  NO_IID_STEPS_FINE == 15  */
-        pScaleFactors = scaleFactorsFine;
-    }
-    else
-    {
-        noIidSteps = NO_IID_STEPS;          /*  NO_IID_STEPS == 7   */
-        pScaleFactors = scaleFactors;
-    }
-
-    if (env == 0)
-    {
-        pms->lastUsb = pms->usb;
-        pms->usb = usb;
-        if (usb != pms->lastUsb && pms->lastUsb != 0)
-        {
-            return(-1);
-
-        }
-    }
-
-    invEnvLength =  pms->aEnvStartStop[env + 1] - pms->aEnvStartStop[env];
-
-    if (invEnvLength == (Int32) pms->noSubSamples)
-    {
-        invEnvLength = pms->invNoSubSamples;
-    }
-    else
-    {
-        invEnvLength = Q30_fmt(1.0f) / invEnvLength;
-    }
-
-    if (invEnvLength == 32)     /*  more likely value  */
-    {
-        for (group = 0; group < NO_IID_GROUPS; group++)      /* == 22 */
-        {
-            bin = bins2groupMap[group];
-
-            /*
-             *  c(b) = 10^(iid(b)/20)
-             */
-
-            tmp = pms->aaIidIndex[env][bin];
-
-            /*
-             *  Intensity differences
-             *
-             *                  sqrt(2)
-             *   c_1(b) = ----------------
-             *            sqrt( 1 + c^2(b))
-             *
-             */
-            scaleR = pScaleFactors[noIidSteps + tmp];
-
-            /*
-             *               sqrt(2)*c(b)
-             *   c_2(b) = ----------------
-             *            sqrt( 1 + c^2(b))
-             *
-             */
-
-            scaleL = pScaleFactors[noIidSteps - tmp];
-
-
-            /*
-             *  alpha(b) = (1/2)*arccos( gamma(b))
-             */
-            tmp = pms->aaIccIndex[env][bin];
-
-            cos_alpha = cos_alphas[ tmp];
-            sin_alpha = sin_alphas[ tmp];
-
-            /*
-             *   beta(b) = alpha(b)/sqrt(2)*( c_1(b) - c_2(b))
-             */
-
-            beta   = fxp_mul32_Q30(scaled_alphas[ tmp], (scaleR - scaleL));
-
-            cos_beta = pv_cosine(beta);
-            sin_beta = pv_sine(beta);
-
-            temp1 = fxp_mul32_Q30(cos_beta, cos_alpha);
-            temp2 = fxp_mul32_Q30(sin_beta, sin_alpha);
-
-
-            /*
-             *  h11(b) = cos( alpha(b) +  beta(b))* c_2(b)
-             *  h12(b) = cos(  beta(b) - alpha(b))* c_1(b)
-             */
-
-            h11 = fxp_mul32_Q30(scaleL, (temp1 - temp2));
-            h12 = fxp_mul32_Q30(scaleR, (temp1 + temp2));
-
-            temp1 = fxp_mul32_Q30(sin_beta, cos_alpha);
-            temp2 = fxp_mul32_Q30(cos_beta, sin_alpha);
-
-            /*
-             *  h21(b) = sin( alpha(b) +  beta(b))* c_2(b)
-             *  h22(b) = sin(  beta(b) - alpha(b))* c_1(b)
-             */
-
-            h21 = fxp_mul32_Q30(scaleL, (temp1 + temp2));
-            h22 = fxp_mul32_Q30(scaleR, (temp1 - temp2));
-
-
-            /*
-             *   Linear interpolation
-             *
-             *                                       Hij(k, n_e+1) - Hij(k, n_e)
-             *    Hij(k,n) = Hij(k, n_e) + (n - n_e)*---------------------------
-             *                                              n_e+1 - n_e
-             */
-
-            ptr_tmp = &pms->h11Prev[group];
-            pms->H11[group]       = *ptr_tmp;
-            pms->deltaH11[group]  = (h11 - *ptr_tmp) >> 5;
-            *ptr_tmp              = h11;
-
-            ptr_tmp = &pms->h12Prev[group];
-            pms->H12[group]       = *ptr_tmp;
-            pms->deltaH12[group]  = (h12 - *ptr_tmp) >> 5;
-            *ptr_tmp              = h12;
-
-            ptr_tmp = &pms->h21Prev[group];
-            pms->H21[group]       = *ptr_tmp;
-            pms->deltaH21[group]  = (h21 - *ptr_tmp) >> 5;
-            *ptr_tmp              = h21;
-
-            ptr_tmp = &pms->h22Prev[group];
-            pms->H22[group]       = *ptr_tmp;
-            pms->deltaH22[group]  = (h22 - *ptr_tmp) >> 5;
-            *ptr_tmp              = h22;
-
-
-        } /* groups loop */
-    }
-    else
-    {
-
-        for (group = 0; group < NO_IID_GROUPS; group++)      /* == 22 */
-        {
-            bin = bins2groupMap[group];
-
-            /*
-             *  c(b) = 10^(iid(b)/20)
-             */
-
-            tmp = pms->aaIidIndex[env][bin];
-
-            /*
-             *  Intensity differences
-             *
-             *                  sqrt(2)
-             *   c_1(b) = ----------------
-             *            sqrt( 1 + c^2(b))
-             *
-             */
-            scaleR = pScaleFactors[noIidSteps + tmp];
-
-            /*
-             *               sqrt(2)*c(b)
-             *   c_2(b) = ----------------
-             *            sqrt( 1 + c^2(b))
-             *
-             */
-
-            scaleL = pScaleFactors[noIidSteps - tmp];
-
-
-            /*
-             *  alpha(b) = (1/2)*arccos( gamma(b))
-             */
-            tmp = pms->aaIccIndex[env][bin];
-
-            cos_alpha = cos_alphas[ tmp];
-            sin_alpha = sin_alphas[ tmp];
-
-            /*
-             *   beta(b) = alpha(b)/sqrt(2)*( c_1(b) - c_2(b))
-             */
-
-            beta   = fxp_mul32_Q30(scaled_alphas[ tmp], (scaleR - scaleL));
-
-            cos_beta = pv_cosine(beta);
-            sin_beta = pv_sine(beta);
-
-            temp1 = fxp_mul32_Q30(cos_beta, cos_alpha);
-            temp2 = fxp_mul32_Q30(sin_beta, sin_alpha);
-
-
-            /*
-             *  h11(b) = cos( alpha(b) +  beta(b))* c_2(b)
-             *  h12(b) = cos(  beta(b) - alpha(b))* c_1(b)
-             */
-
-            h11 = fxp_mul32_Q30(scaleL, (temp1 - temp2));
-            h12 = fxp_mul32_Q30(scaleR, (temp1 + temp2));
-
-            temp1 = fxp_mul32_Q30(sin_beta, cos_alpha);
-            temp2 = fxp_mul32_Q30(cos_beta, sin_alpha);
-
-            /*
-             *  h21(b) = sin( alpha(b) +  beta(b))* c_2(b)
-             *  h22(b) = sin(  beta(b) - alpha(b))* c_1(b)
-             */
-
-            h21 = fxp_mul32_Q30(scaleL, (temp1 + temp2));
-            h22 = fxp_mul32_Q30(scaleR, (temp1 - temp2));
-
-
-            /*
-             *   Linear interpolation
-             *
-             *                                       Hij(k, n_e+1) - Hij(k, n_e)
-             *    Hij(k,n) = Hij(k, n_e) + (n - n_e)*---------------------------
-             *                                              n_e+1 - n_e
-             */
-
-            ptr_tmp = &pms->h11Prev[group];
-            pms->deltaH11[group]  = fxp_mul32_Q30((h11 - *ptr_tmp), invEnvLength);
-            pms->H11[group]       = *ptr_tmp;
-            *ptr_tmp              = h11;
-
-            ptr_tmp = &pms->h12Prev[group];
-            pms->deltaH12[group]  = fxp_mul32_Q30((h12 - *ptr_tmp), invEnvLength);
-            pms->H12[group]       = *ptr_tmp;
-            *ptr_tmp              = h12;
-
-            ptr_tmp = &pms->h21Prev[group];
-            pms->deltaH21[group]  = fxp_mul32_Q30((h21 - *ptr_tmp), invEnvLength);
-            pms->H21[group]       = *ptr_tmp;
-            *ptr_tmp              = h21;
-
-            ptr_tmp = &pms->h22Prev[group];
-            pms->deltaH22[group]  = fxp_mul32_Q30((h22 - *ptr_tmp), invEnvLength);
-            pms->H22[group]       = *ptr_tmp;
-            *ptr_tmp              = h22;
-
-
-        } /* groups loop */
-    }
-
-
-    return (0);
-
-} /* END ps_init_stereo_mixing */
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_init_stereo_mixing.h b/media/libstagefright/codecs/aacdec/ps_init_stereo_mixing.h
deleted file mode 100644
index 6c30781..0000000
--- a/media/libstagefright/codecs/aacdec/ps_init_stereo_mixing.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_init_stereo_mixing.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions ps_init_stereo_mixing()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_INIT_STEREO_MIXING_H
-#define PS_INIT_STEREO_MIXING_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int32 ps_init_stereo_mixing(STRUCT_PS_DEC *pms,
-    Int32 env,
-    Int32 usb);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_INIT_STEREO_MIXING_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_pwr_transient_detection.cpp b/media/libstagefright/codecs/aacdec/ps_pwr_transient_detection.cpp
deleted file mode 100644
index a0e8c38..0000000
--- a/media/libstagefright/codecs/aacdec/ps_pwr_transient_detection.cpp
+++ /dev/null
@@ -1,340 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_pwr_transient_detection.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  Decorrelation
-  Decorrelation is achieved by means of all-pass filtering and delaying
-  Sub-band samples s_k(n) are converted into de-correlated sub-bands samples
-  d_k(n). k index for frequency, n time index
-
-
-     _______                                              ________
-    |       |                                  _______   |        |
-  ->|Hybrid | LF ----                         |       |->| Hybrid |-->
-    | Anal. |        |                        |       |  | Synth  |   QMF -> L
-     -------         o----------------------->|       |   --------    Synth
-QMF                  |                s_k(n)  |Stereo |-------------->
-Anal.              -------------------------->|       |
-     _______       | |                        |       |   ________
-    |       | HF --o |   -----------          |Process|  |        |
-  ->| Delay |      |  ->|           |-------->|       |->| Hybrid |-->
-     -------       |    |decorrelate| d_k(n)  |       |  | Synth  |   QMF -> R
-                   ---->|           |-------->|       |   --------    Synth
-                         -----------          |_______|-------------->
-
-
-  To handle transients and other fast time-envelopes, the output of the all
-  pass filters has to be attenuated at those signals.
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include    "pv_audio_type_defs.h"
-#include    "s_ps_dec.h"
-#include    "aac_mem_funcs.h"
-#include    "ps_all_pass_filter_coeff.h"
-#include    "ps_pwr_transient_detection.h"
-
-#include    "fxp_mul32.h"
-#include    "pv_div.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define R_SHIFT     29
-#define Q29_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-#define Qfmt31(a)   (Int32)(-a*((Int32)1<<31) - 1 + (a>=0?0.5F:-0.5F))
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void ps_pwr_transient_detection(STRUCT_PS_DEC *h_ps_dec,
-                                Int32 *rIntBufferLeft,
-                                Int32 *iIntBufferLeft,
-                                Int32 aTransRatio[])
-{
-
-    Int32 sb;
-    Int32 maxsb;
-    Int32 gr;
-    Int32 bin;
-
-
-
-    Int32 *aLeftReal;
-    Int32 *aLeftImag;
-    Int32   temp_r;
-    Int32   temp_i;
-    Int32   accu;
-    Int32 *aPower = aTransRatio;
-    Quotient result;
-
-    Int32 nrg;
-    Int32 *ptr_aPrevNrg;
-    Int32 peakDiff;
-    Int32 *ptr_PrevPeakDiff;
-
-
-    aLeftReal = rIntBufferLeft;
-    aLeftImag = iIntBufferLeft;
-
-    /*
-     *  Input Power Matrix
-     *                            2
-     *  Power(i,n) = SUM | s_k(n)|
-     *                i
-     */
-
-    for (gr = SUBQMF_GROUPS; gr < NO_IID_GROUPS; gr++) /* 10 to 22  */
-    {
-        maxsb = min(h_ps_dec->usb, groupBorders[ gr+1]);
-
-        accu = 0;
-
-        for (sb = groupBorders[gr]; sb < maxsb; sb++)
-        {
-
-            temp_r = aLeftReal[sb];
-            temp_i = aLeftImag[sb];
-            accu =  fxp_mac32_Q31(accu, temp_r, temp_r);
-            accu =  fxp_mac32_Q31(accu, temp_i, temp_i);
-
-        } /* sb */
-        aPower[gr - 2] = accu >> 1;
-    } /* gr */
-
-    aLeftReal = h_ps_dec->mHybridRealLeft;
-    aLeftImag = h_ps_dec->mHybridImagLeft;
-
-
-    temp_r = aLeftReal[0];
-    temp_i = aLeftImag[0];
-    accu   = fxp_mul32_Q31(temp_r, temp_r);
-    accu  = fxp_mac32_Q31(accu, temp_i, temp_i);
-    temp_r = aLeftReal[5];
-    temp_i = aLeftImag[5];
-    accu   = fxp_mac32_Q31(accu, temp_r, temp_r);
-    aPower[0]  = fxp_mac32_Q31(accu, temp_i, temp_i) >> 1;
-
-    temp_r = aLeftReal[1];
-    temp_i = aLeftImag[1];
-    accu   = fxp_mul32_Q31(temp_r, temp_r);
-    accu  = fxp_mac32_Q31(accu, temp_i, temp_i);
-    temp_r = aLeftReal[4];
-    temp_i = aLeftImag[4];
-    accu   = fxp_mac32_Q31(accu, temp_r, temp_r);
-    aPower[1]  = fxp_mac32_Q31(accu, temp_i, temp_i) >> 1;
-
-    temp_r = aLeftReal[2];
-    temp_i = aLeftImag[2];
-    accu   = fxp_mul32_Q31(temp_r, temp_r);
-    aPower[2]  = fxp_mac32_Q31(accu, temp_i, temp_i) >> 1;
-
-    temp_r = aLeftReal[3];
-    temp_i = aLeftImag[3];
-    accu   = fxp_mul32_Q31(temp_r, temp_r);
-    aPower[3]  = fxp_mac32_Q31(accu, temp_i, temp_i) >> 1;
-
-
-
-    temp_r = aLeftReal[6];
-    temp_i = aLeftImag[6];
-    accu   = fxp_mul32_Q31(temp_r, temp_r);
-    aPower[5]  = fxp_mac32_Q31(accu, temp_i, temp_i) >> 1;
-
-    temp_r = aLeftReal[7];
-    temp_i = aLeftImag[7];
-    accu   = fxp_mul32_Q31(temp_r, temp_r);
-    aPower[4]  = fxp_mac32_Q31(accu, temp_i, temp_i) >> 1;
-
-    temp_r = aLeftReal[8];
-    temp_i = aLeftImag[8];
-    accu   = fxp_mul32_Q31(temp_r, temp_r);
-    aPower[6]  = fxp_mac32_Q31(accu, temp_i, temp_i) >> 1;
-
-    temp_r = aLeftReal[9];
-    temp_i = aLeftImag[9];
-    accu   = fxp_mul32_Q31(temp_r, temp_r);
-    aPower[7]  = fxp_mac32_Q31(accu, temp_i, temp_i) >> 1;
-
-
-    /*
-     *  Power transient detection
-     */
-
-    ptr_aPrevNrg = h_ps_dec->aPrevNrg;
-
-    ptr_PrevPeakDiff = h_ps_dec->aPrevPeakDiff;
-
-    for (bin = 0; bin < NO_BINS; bin++) /* NO_BINS = 20  */
-    {
-
-        peakDiff  = *ptr_PrevPeakDiff;
-
-
-        /* PEAK_DECAY_FACTOR  0.765928338364649f @ 48 KHz  for Fs > 32 Khz */
-        accu = h_ps_dec->aPeakDecayFast[bin];
-        peakDiff -= peakDiff >> 2;
-
-        accu  = fxp_mul32_Q31(accu, Qfmt31(0.765928338364649f)) << 1;
-
-        if (accu < *aPower)
-        {
-            accu = *aPower;
-        }
-        else
-        {
-            peakDiff += ((accu - *aPower) >> 2);
-        }
-
-        h_ps_dec->aPeakDecayFast[bin] = accu;
-
-        *(ptr_PrevPeakDiff++) = peakDiff;
-
-        nrg =   *ptr_aPrevNrg + ((*aPower - *ptr_aPrevNrg) >> 2);
-
-        *(ptr_aPrevNrg++) = nrg;
-
-        peakDiff += peakDiff >> 1;         /* transient impact factor == 1.5 */
-
-        if (peakDiff <= nrg)
-        {
-            *(aPower++) = 0x7FFFFFFF;    /* in Q31  */
-        }
-        else
-        {
-            pv_div(nrg, peakDiff, &result);
-            *(aPower++) = (result.quotient >> (result.shift_factor)) << 1;    /* in Q31  */
-        }
-
-    } /* bin */
-
-}
-
-
-#endif
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/ps_pwr_transient_detection.h b/media/libstagefright/codecs/aacdec/ps_pwr_transient_detection.h
deleted file mode 100644
index 80a73a8..0000000
--- a/media/libstagefright/codecs/aacdec/ps_pwr_transient_detection.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_pwr_transient_detection.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function ps_pwr_transient_detection()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_PWR_TRANSIENT_DETECTION_H
-#define PS_PWR_TRANSIENT_DETECTION_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void ps_pwr_transient_detection(STRUCT_PS_DEC *h_ps_dec,
-    Int32 *rIntBufferLeft,
-    Int32 *iIntBufferLeft,
-    Int32 aTransRatio[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_PWR_TRANSIENT_DETECTION_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_read_data.cpp b/media/libstagefright/codecs/aacdec/ps_read_data.cpp
deleted file mode 100644
index c49eb3d..0000000
--- a/media/libstagefright/codecs/aacdec/ps_read_data.cpp
+++ /dev/null
@@ -1,388 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_read_data.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Decodes parametric stereo
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include    "pv_audio_type_defs.h"
-#include    "buf_getbits.h"
-#include    "s_bit_buffer.h"
-#include    "s_huffman.h"
-#include    "aac_mem_funcs.h"
-#include    "s_ps_dec.h"
-#include    "sbr_decode_huff_cw.h"
-#include    "ps_decode_bs_utils.h"
-#include    "ps_bstr_decoding.h"
-#include    "ps_read_data.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/* IID & ICC Huffman codebooks */
-const Char aBookPsIidTimeDecode[28][2] =
-{
-    { -64,   1 },    { -65,   2 },    { -63,   3 },    { -66,   4 },
-    { -62,   5 },    { -67,   6 },    { -61,   7 },    { -68,   8 },
-    { -60,   9 },    { -69,  10 },    { -59,  11 },    { -70,  12 },
-    { -58,  13 },    { -57,  14 },    { -71,  15 },    {  16,  17 },
-    { -56, -72 },    {  18,  21 },    {  19,  20 },    { -55, -78 },
-    { -77, -76 },    {  22,  25 },    {  23,  24 },    { -75, -74 },
-    { -73, -54 },    {  26,  27 },    { -53, -52 },    { -51, -50 }
-};
-
-const Char aBookPsIidFreqDecode[28][2] =
-{
-    { -64,   1 },    {   2,   3 },    { -63, -65 },    {   4,   5 },
-    { -62, -66 },    {   6,   7 },    { -61, -67 },    {   8,   9 },
-    { -68, -60 },    { -59,  10 },    { -69,  11 },    { -58,  12 },
-    { -70,  13 },    { -71,  14 },    { -57,  15 },    {  16,  17 },
-    { -56, -72 },    {  18,  19 },    { -55, -54 },    {  20,  21 },
-    { -73, -53 },    {  22,  24 },    { -74,  23 },    { -75, -78 },
-    {  25,  26 },    { -77, -76 },    { -52,  27 },    { -51, -50 }
-};
-
-const Char aBookPsIccTimeDecode[14][2] =
-{
-    { -64,   1 },    { -63,   2 },    { -65,   3 },    { -62,   4 },
-    { -66,   5 },    { -61,   6 },    { -67,   7 },    { -60,   8 },
-    { -68,   9 },    { -59,  10 },    { -69,  11 },    { -58,  12 },
-    { -70,  13 },    { -71, -57 }
-};
-
-const Char aBookPsIccFreqDecode[14][2] =
-{
-    { -64,   1 },    { -63,   2 },    { -65,   3 },    { -62,   4 },
-    { -66,   5 },    { -61,   6 },    { -67,   7 },    { -60,   8 },
-    { -59,   9 },    { -68,  10 },    { -58,  11 },    { -69,  12 },
-    { -57,  13 },    { -70, -71 }
-};
-
-const Char aBookPsIidFineTimeDecode[60][2] =
-{
-    {   1, -64 },    { -63,   2 },    {   3, -65 },    {   4,  59 },
-    {   5,   7 },    {   6, -67 },    { -68, -60 },    { -61,   8 },
-    {   9,  11 },    { -59,  10 },    { -70, -58 },    {  12,  41 },
-    {  13,  20 },    {  14, -71 },    { -55,  15 },    { -53,  16 },
-    {  17, -77 },    {  18,  19 },    { -85, -84 },    { -46, -45 },
-    { -57,  21 },    {  22,  40 },    {  23,  29 },    { -51,  24 },
-    {  25,  26 },    { -83, -82 },    {  27,  28 },    { -90, -38 },
-    { -92, -91 },    {  30,  37 },    {  31,  34 },    {  32,  33 },
-    { -35, -34 },    { -37, -36 },    {  35,  36 },    { -94, -93 },
-    { -89, -39 },    {  38, -79 },    {  39, -81 },    { -88, -40 },
-    { -74, -54 },    {  42, -69 },    {  43,  44 },    { -72, -56 },
-    {  45,  52 },    {  46,  50 },    {  47, -76 },    { -49,  48 },
-    { -47,  49 },    { -87, -41 },    { -52,  51 },    { -78, -50 },
-    {  53, -73 },    {  54, -75 },    {  55,  57 },    {  56, -80 },
-    { -86, -42 },    { -48,  58 },    { -44, -43 },    { -66, -62 }
-};
-
-const Char aBookPsIidFineFreqDecode[60][2] =
-{
-    {   1, -64 },    {   2,   4 },    {   3, -65 },    { -66, -62 },
-    { -63,   5 },    {   6,   7 },    { -67, -61 },    {   8,   9 },
-    { -68, -60 },    {  10,  11 },    { -69, -59 },    {  12,  13 },
-    { -70, -58 },    {  14,  18 },    { -57,  15 },    {  16, -72 },
-    { -54,  17 },    { -75, -53 },    {  19,  37 },    { -56,  20 },
-    {  21, -73 },    {  22,  29 },    {  23, -76 },    {  24, -78 },
-    {  25,  28 },    {  26,  27 },    { -85, -43 },    { -83, -45 },
-    { -81, -47 },    { -52,  30 },    { -50,  31 },    {  32, -79 },
-    {  33,  34 },    { -82, -46 },    {  35,  36 },    { -90, -89 },
-    { -92, -91 },    {  38, -71 },    { -55,  39 },    {  40, -74 },
-    {  41,  50 },    {  42, -77 },    { -49,  43 },    {  44,  47 },
-    {  45,  46 },    { -86, -42 },    { -88, -87 },    {  48,  49 },
-    { -39, -38 },    { -41, -40 },    { -51,  51 },    {  52,  59 },
-    {  53,  56 },    {  54,  55 },    { -35, -34 },    { -37, -36 },
-    {  57,  58 },    { -94, -93 },    { -84, -44 },    { -80, -48 }
-};
-
-
-
-
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int32 ps_read_data(STRUCT_PS_DEC *ps_dec,
-                   BIT_BUFFER * hBitBuf,
-                   Int32 nBitsLeft)
-
-{
-    Int     gr;
-    UInt32     env;
-    UInt32     dtFlag;
-    Int32     startbits;
-    SbrHuffman CurrentTable;
-
-    if (!ps_dec)
-    {
-        return 0;
-    }
-
-    startbits = GetNrBitsAvailable(hBitBuf);
-
-    if (buf_get_1bit(hBitBuf))  /*  Enable Header */
-    {
-        ps_dec->bEnableIid = buf_get_1bit(hBitBuf);
-
-        if (ps_dec->bEnableIid)
-        {
-            ps_dec->freqResIid = buf_getbits(hBitBuf, 3);
-
-            if (ps_dec->freqResIid > 2)
-            {
-                ps_dec->bFineIidQ = 1;
-                ps_dec->freqResIid -= 3;
-            }
-            else
-            {
-                ps_dec->bFineIidQ = 0;
-            }
-        }
-
-        ps_dec->bEnableIcc = buf_get_1bit(hBitBuf);
-        if (ps_dec->bEnableIcc)
-        {
-            ps_dec->freqResIcc = buf_getbits(hBitBuf, 3);
-
-            if (ps_dec->freqResIcc > 2)
-            {
-                ps_dec->freqResIcc -= 3;
-            }
-        }
-        ps_dec->bEnableExt = buf_get_1bit(hBitBuf);
-    }
-
-    ps_dec->bFrameClass = buf_get_1bit(hBitBuf);
-    if (ps_dec->bFrameClass == 0)
-    {
-        ps_dec->noEnv = aFixNoEnvDecode[ buf_getbits(hBitBuf, 2)];
-    }
-    else
-    {
-        ps_dec->noEnv = 1 + buf_getbits(hBitBuf, 2);
-        for (env = 1; env < ps_dec->noEnv + 1; env++)
-        {
-            ps_dec->aEnvStartStop[env] = (buf_getbits(hBitBuf, 5)) + 1;
-        }
-    }
-
-    if ((ps_dec->freqResIid > 2) || (ps_dec->freqResIcc > 2))
-    {
-
-        ps_dec->bPsDataAvail = 0;
-
-        nBitsLeft -= startbits - GetNrBitsAvailable(hBitBuf);
-        while (nBitsLeft)
-        {
-            int i = nBitsLeft;
-            if (i > 8)
-            {
-                i = 8;
-            }
-            buf_getbits(hBitBuf, i);
-            nBitsLeft -= i;
-        }
-        return (startbits - GetNrBitsAvailable(hBitBuf));
-    }
-
-    if (ps_dec->bEnableIid)
-    {
-        for (env = 0; env < ps_dec->noEnv; env++)
-        {
-            dtFlag = buf_get_1bit(hBitBuf);
-
-            if (!dtFlag)
-            {
-                if (ps_dec->bFineIidQ)
-                {
-                    CurrentTable = aBookPsIidFineFreqDecode;
-                }
-                else
-                {
-                    CurrentTable = aBookPsIidFreqDecode;
-                }
-            }
-            else
-            {
-                if (ps_dec->bFineIidQ)
-                {
-                    CurrentTable = aBookPsIidFineTimeDecode;
-                }
-                else
-                {
-                    CurrentTable = aBookPsIidTimeDecode;
-                }
-            }
-
-            for (gr = 0; gr < aNoIidBins[ps_dec->freqResIid]; gr++)
-            {
-                ps_dec->aaIidIndex[env][gr] = sbr_decode_huff_cw(CurrentTable, hBitBuf);
-            }
-
-            ps_dec->abIidDtFlag[env] = dtFlag;
-        }
-    }
-
-    if (ps_dec->bEnableIcc)
-    {
-        for (env = 0; env < ps_dec->noEnv; env++)
-        {
-            dtFlag = buf_get_1bit(hBitBuf);
-            if (!dtFlag)
-            {
-                CurrentTable = aBookPsIccFreqDecode;
-            }
-            else
-            {
-                CurrentTable = aBookPsIccTimeDecode;
-            }
-            for (gr = 0; gr < aNoIccBins[ps_dec->freqResIcc]; gr++)
-            {
-                ps_dec->aaIccIndex[env][gr] = sbr_decode_huff_cw(CurrentTable, hBitBuf);
-            }
-
-            ps_dec->abIccDtFlag[env] = dtFlag;
-        }
-    }
-
-    if (ps_dec->bEnableExt)
-    {
-
-        int cnt;
-
-        cnt = (int)buf_getbits(hBitBuf, 4);
-
-        if (cnt == 15)
-        {
-            cnt += (int)buf_getbits(hBitBuf, 8);
-        }
-
-        hBitBuf->nrBitsRead += (cnt << 3);
-    }
-
-    ps_dec->bPsDataAvail = 1;
-
-    return (startbits - GetNrBitsAvailable(hBitBuf));
-}
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_read_data.h b/media/libstagefright/codecs/aacdec/ps_read_data.h
deleted file mode 100644
index e2fec53..0000000
--- a/media/libstagefright/codecs/aacdec/ps_read_data.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_read_data.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for functions ps_read_data()
-
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_READ_DATA_H
-#define PS_READ_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-#define EXTENSION_ID_PS_CODING   2
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int32 ps_read_data(STRUCT_PS_DEC *ps_dec,
-    BIT_BUFFER * hBitBuf,
-    Int32 nBitsLeft);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_READ_DATA_H */
diff --git a/media/libstagefright/codecs/aacdec/ps_stereo_processing.cpp b/media/libstagefright/codecs/aacdec/ps_stereo_processing.cpp
deleted file mode 100644
index 813b55d..0000000
--- a/media/libstagefright/codecs/aacdec/ps_stereo_processing.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: ps_stereo_processing.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Stereo Process or reconstruction
-
-           l_k(n) = H11(k,n)*s_k(n) + H21(k,n)*d_k(n)
-
-           r_k(n) = H12(k,n)*s_k(n) + H22(k,n)*d_k(n)
-
-     _______                                              ________
-    |       |                                  _______   |        |
-  ->|Hybrid | LF ----                         |       |->| Hybrid |-->
-    | Anal. |        |                        |       |  | Synth  |   QMF -> L
-     -------         o----------------------->|       |   --------    Synth
-QMF                  |                s_k(n)  |Stereo |-------------->
-Anal.              -------------------------->|       |
-     _______       | |                        |       |   ________
-    |       | HF --o |   -----------          |Process|  |        |
-  ->| Delay |      |  ->|           |-------->|       |->| Hybrid |-->
-     -------       |    |decorrelate| d_k(n)  |       |  | Synth  |   QMF -> R
-                   ---->|           |-------->|       |   --------    Synth
-                         -----------          |_______|-------------->
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-#include    "pv_audio_type_defs.h"
-#include    "ps_stereo_processing.h"
-#include    "fxp_mul32.h"
-#include    "ps_all_pass_filter_coeff.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void ps_stereo_processing(STRUCT_PS_DEC  *pms,
-                          Int32          *qmfLeftReal,
-                          Int32          *qmfLeftImag,
-                          Int32          *qmfRightReal,
-                          Int32          *qmfRightImag)
-{
-    Int32     group;
-    Int32     subband;
-    Int32     maxSubband;
-    Int32     usb;
-    Char     index;
-
-
-    Int32  *hybrLeftReal;
-    Int32  *hybrLeftImag;
-    Int32  *hybrRightReal;
-    Int32  *hybrRightImag;
-    Int32  *ptr_hybrLeftReal;
-    Int32  *ptr_hybrLeftImag;
-    Int32  *ptr_hybrRightReal;
-    Int32  *ptr_hybrRightImag;
-
-
-    Int16   h11;
-    Int16   h12;
-    Int16   h21;
-    Int16   h22;
-
-    Int32   temp1;
-    Int32   temp2;
-    Int32   temp3;
-
-    usb = pms->usb;
-
-    /*
-     *   Complete Linear interpolation
-     */
-
-    hybrLeftReal  = pms->mHybridRealLeft;
-    hybrLeftImag  = pms->mHybridImagLeft;
-    hybrRightReal = pms->mHybridRealRight;
-    hybrRightImag = pms->mHybridImagRight;
-
-    for (group = 0; group < SUBQMF_GROUPS; group++)     /* SUBQMF_GROUPS == 10 */
-    {
-
-        temp1 = pms->deltaH11[group];
-        temp2 = pms->deltaH12[group];
-
-        pms->H11[group]  += temp1;
-        h11  = (Int16)(pms->H11[group] >> 16);
-        pms->H12[group]  += temp2;
-        h12  = (Int16)(pms->H12[group] >> 16);
-
-        temp1 = pms->deltaH21[group];
-        temp2 = pms->deltaH22[group];
-
-        pms->H21[group]  += temp1;
-        h21  = (Int16)(pms->H21[group] >> 16);
-        pms->H22[group]  += temp2;
-        h22  = (Int16)(pms->H22[group] >> 16);
-
-        index = groupBorders[group];
-
-        /*
-         *  Reconstruction of Stereo sub-band signal
-         *
-         *  l_k(n) = H11(k,n)*s_k(n) + H21(k,n)*d_k(n)
-         *
-         *  r_k(n) = H12(k,n)*s_k(n) + H22(k,n)*d_k(n)
-         */
-        ptr_hybrLeftReal  = &hybrLeftReal[  index];
-        ptr_hybrRightReal = &hybrRightReal[ index];
-
-        temp1 = *(ptr_hybrLeftReal) << 1;
-        temp2 = *(ptr_hybrRightReal) << 1;
-
-        temp3 = fxp_mul32_by_16(temp1, h11);
-        *(ptr_hybrLeftReal)  = fxp_mac32_by_16(temp2, h21, temp3) << 1;
-
-        temp3 = fxp_mul32_by_16(temp1, h12);
-        *(ptr_hybrRightReal) = fxp_mac32_by_16(temp2, h22, temp3) << 1;
-
-
-        ptr_hybrLeftImag  = &hybrLeftImag[  index];
-        ptr_hybrRightImag = &hybrRightImag[ index];
-
-        temp1 = *(ptr_hybrLeftImag) << 1;
-        temp2 = *(ptr_hybrRightImag) << 1;
-
-        temp3 = fxp_mul32_by_16(temp1, h11);
-        *(ptr_hybrLeftImag)  = fxp_mac32_by_16(temp2, h21, temp3) << 1;
-
-        temp3 = fxp_mul32_by_16(temp1, h12);
-        *(ptr_hybrRightImag) = fxp_mac32_by_16(temp2, h22, temp3) << 1;
-
-
-    } /* groups loop */
-
-    temp1 = pms->deltaH11[SUBQMF_GROUPS];
-    temp2 = pms->deltaH12[SUBQMF_GROUPS];
-
-    pms->H11[SUBQMF_GROUPS]  += temp1;
-    h11  = (Int16)(pms->H11[SUBQMF_GROUPS] >> 16);
-    pms->H12[SUBQMF_GROUPS]  += temp2;
-    h12  = (Int16)(pms->H12[SUBQMF_GROUPS] >> 16);
-
-    temp1 = pms->deltaH21[SUBQMF_GROUPS];
-    temp2 = pms->deltaH22[SUBQMF_GROUPS];
-
-    pms->H21[SUBQMF_GROUPS]  += temp1;
-    h21  = (Int16)(pms->H21[SUBQMF_GROUPS] >> 16);
-    pms->H22[SUBQMF_GROUPS]  += temp2;
-    h22  = (Int16)(pms->H22[SUBQMF_GROUPS] >> 16);
-
-
-    ptr_hybrLeftReal  = &qmfLeftReal[  3];
-    ptr_hybrRightReal = &qmfRightReal[ 3];
-
-    /*
-     *  Reconstruction of Stereo sub-band signal
-     *
-     *  l_k(n) = H11(k,n)*s_k(n) + H21(k,n)*d_k(n)
-     *
-     *  r_k(n) = H12(k,n)*s_k(n) + H22(k,n)*d_k(n)
-     */
-    temp1 = *(ptr_hybrLeftReal) << 1;
-    temp2 = *(ptr_hybrRightReal) << 1;
-
-
-    temp3 = fxp_mul32_by_16(temp1, h11);
-    *(ptr_hybrLeftReal)  = fxp_mac32_by_16(temp2, h21, temp3) << 1;
-
-    temp3 = fxp_mul32_by_16(temp1, h12);
-    *(ptr_hybrRightReal)  = fxp_mac32_by_16(temp2, h22, temp3) << 1;
-
-    ptr_hybrLeftImag  = &qmfLeftImag[  3];
-    ptr_hybrRightImag = &qmfRightImag[ 3];
-
-
-    temp1 = *(ptr_hybrLeftImag) << 1;
-    temp2 = *(ptr_hybrRightImag) << 1;
-
-    temp3 = fxp_mul32_by_16(temp1, h11);
-    *(ptr_hybrLeftImag)  = fxp_mac32_by_16(temp2, h21, temp3) << 1;
-
-    temp3 = fxp_mul32_by_16(temp1, h12);
-    *(ptr_hybrRightImag)  = fxp_mac32_by_16(temp2, h22, temp3) << 1;
-
-
-    for (group = SUBQMF_GROUPS + 1; group < NO_IID_GROUPS; group++)   /* 11 to NO_IID_GROUPS == 22 */
-    {
-        temp1 = pms->deltaH11[group];
-        temp2 = pms->deltaH12[group];
-
-        pms->H11[group]  += temp1;
-        h11  = (Int16)(pms->H11[group] >> 16);
-        pms->H12[group]  += temp2;
-        h12  = (Int16)(pms->H12[group] >> 16);
-
-        temp1 = pms->deltaH21[group];
-        temp2 = pms->deltaH22[group];
-
-        pms->H21[group]  += temp1;
-        h21  = (Int16)(pms->H21[group] >> 16);
-        pms->H22[group]  += temp2;
-        h22  = (Int16)(pms->H22[group] >> 16);
-
-        index = groupBorders[group];
-        maxSubband = groupBorders[group + 1];
-        maxSubband = min(usb, maxSubband);
-
-        /*
-         *  Reconstruction of Stereo sub-band signal
-         *
-         *  l_k(n) = H11(k,n)*s_k(n) + H21(k,n)*d_k(n)
-         *
-         *  r_k(n) = H12(k,n)*s_k(n) + H22(k,n)*d_k(n)
-         */
-
-        ptr_hybrLeftReal  = &qmfLeftReal[  index];
-        ptr_hybrRightReal = &qmfRightReal[ index];
-
-        for (subband = index; subband < maxSubband; subband++)
-        {
-            temp1 = *(ptr_hybrLeftReal) << 1;
-            temp2 = *(ptr_hybrRightReal) << 1;
-            temp3 = fxp_mul32_by_16(temp1, h11);
-            *(ptr_hybrLeftReal++)   = fxp_mac32_by_16(temp2, h21, temp3) << 1;
-
-            temp3 = fxp_mul32_by_16(temp1, h12);
-            *(ptr_hybrRightReal++)  = fxp_mac32_by_16(temp2, h22, temp3) << 1;
-        }
-
-        ptr_hybrLeftImag  = &qmfLeftImag[  index];
-        ptr_hybrRightImag = &qmfRightImag[ index];
-
-        for (subband = index; subband < maxSubband; subband++)
-        {
-            temp1 = *(ptr_hybrLeftImag) << 1;
-            temp2 = *(ptr_hybrRightImag) << 1;
-            temp3 = fxp_mul32_by_16(temp1, h11);
-            *(ptr_hybrLeftImag++)   = fxp_mac32_by_16(temp2, h21, temp3) << 1;
-
-            temp3 = fxp_mul32_by_16(temp1, h12);
-            *(ptr_hybrRightImag++)  = fxp_mac32_by_16(temp2, h22, temp3) << 1;
-
-        } /* subband loop */
-
-    } /* groups loop */
-
-} /* END ps_stereo_processing */
-
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/ps_stereo_processing.h b/media/libstagefright/codecs/aacdec/ps_stereo_processing.h
deleted file mode 100644
index 58b025a..0000000
--- a/media/libstagefright/codecs/aacdec/ps_stereo_processing.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ps_stereo_processing.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for function ps_stereo_processing()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PS_STEREO_PROCESSING_H
-#define PS_STEREO_PROCESSING_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_ps_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void ps_stereo_processing(STRUCT_PS_DEC  *pms,
-    Int32          *qmfLeftReal,
-    Int32          *qmfLeftImag,
-    Int32          *qmfRightReal,
-    Int32          *qmfRightImag);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif  /* PS_STEREO_PROCESSING_H */
diff --git a/media/libstagefright/codecs/aacdec/pulse_nc.cpp b/media/libstagefright/codecs/aacdec/pulse_nc.cpp
deleted file mode 100644
index 87b264d..0000000
--- a/media/libstagefright/codecs/aacdec/pulse_nc.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pulse_nc.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Modified to pass variables by reference to eliminate use
-               of global variables.
-
- Description:  Modified to bring code in-line with PV standards.
-
- Description: Pass in max as input argument.
-
- Description: Went back to the if-statement to check for max.
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    coef[]         =  Array of quantized spectral coefficents.
-                      (Int [])
-
-    pPulseInfo     =  Pointer to structure which contains noiseless
-                      encoding info, includes information about the pulse data,
-                      pulse amplitude, etc.
-                      (const PulseInfo *)
-
-    pLongFrameInfo =  Pointer to structure that holds information about
-                      each group. (long block flag, number of windows,
-                      scalefactor bands per group, etc.)
-
-                      Variable is named (pLongFrameInfo) because this function
-                      is only used for LONG windows.
-                      (FrameInfo *)
-    max             = Pointer to the maximum value of coef[]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    coef[]  =  coefficient contents are modified by the encoded pulse
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function adds pulses to defined ranges of coefficients in the window,
- for the case of LONG windows.  The pulses are unsigned, so
- negative coefficients subtract the pulse, and positive coefficients add it.
- (The ampltiude of the coefficient is always increased by the pulse)
-
- A maximum of 4 coefficients may be modified by a pulse, and these
- coefficients must all occur in the same scalefactor band.
-
- The number of pulse-encoded coefficients to be processed by this function
- is communicated to this function via pPulseInfo->number_pulse
-
- This value is equal to the actual number of pulses - 1.
- (e.g if pPulseInfo->number_pulse == 0, one pulse is assumed)
- This function must not be called if no pulse encoded data exists.
- The function assumes that at least one pulse exists.
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This module shall correctly add transmitted pulse(s) to the correct
- coefficients in a LONG window.
-
-------------------------------------------------------------------------------
- REFERENCES
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.3.3 Decoding Process
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    index = pLongFrameInfo->win_sfb_top[0][pPulseInfo->pulse_start_sfb];
-
-    pPulseOffset = &(pPulseInfo->pulse_offset[0]);
-
-    pPulseAmp    = &(pPulseInfo->pulse_amp[0]);
-
-    pCoef        = &(Coef[index]);
-
-    FOR (index = pPulseInfo->number_pulse; index >= 0; index--)
-
-        pCoef   = pCoef + *(pPulseOffset);
-        pPulseOffset = pPulseOffset + 1;
-
-        IF (*pCoef > 0)
-            *(pCoef) = *(pCoef) + *(pPulseAmp);
-            pPulseAmp     = pPulseAmp + 1;
-        ELSE
-            *(pCoef) = *(pCoef) - *(pPulseAmp);
-            pPulseAmp     = pPulseAmp + 1;
-        ENDIF
-
-    ENDFOR
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_frameinfo.h"
-#include "s_pulseinfo.h"
-#include "pulse_nc.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*---------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void pulse_nc(
-    Int16      coef[],
-    const PulseInfo  *pPulseInfo,
-    const FrameInfo  *pLongFrameInfo,
-    Int      *max)
-{
-    Int index;
-
-    Int16 *pCoef;
-    Int temp;
-
-    const Int *pPulseOffset;
-    const Int *pPulseAmp;
-
-    /*--- Find the scalefactor band where pulse-encoded data starts ---*/
-
-    if (pPulseInfo->pulse_start_sfb > 0)
-    {
-        index = pLongFrameInfo->win_sfb_top[0][pPulseInfo->pulse_start_sfb - 1];
-    }
-    else
-    {
-        index = 0;
-    }
-
-    /*-------------------------------------------------------------------------
-      Each pulse index is stored as an offset from the previous pulse
-
-      Example - here we have a sfb that is 20 coefficients in length:
-
-      [0][1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19]
-      [ ][ ][ ][ ][ ][P][P][ ][ ][ ][  ][  ][  ][  ][  ][ P][  ][  ][  ][ P]
-
-      The array pointed to by pPulseOffset == [5][1][9][4]
-
-      pPulseAmp is of the same length as pPulseOffset, and contains
-      an individual pulse amplitude for each coefficient.
-    --------------------------------------------------------------------------*/
-
-    pCoef        = &(coef[index]);
-
-    pPulseOffset = &(pPulseInfo->pulse_offset[0]);
-
-    pPulseAmp    = &(pPulseInfo->pulse_amp[0]);
-
-    for (index = pPulseInfo->number_pulse; index > 0; index--)
-    {
-        pCoef  += *pPulseOffset++;
-
-        temp = *pCoef;
-
-        if (temp > 0)
-        {
-            temp += *(pPulseAmp++);
-            *pCoef = (Int16)temp;
-            if (temp > *max)
-            {
-                *max = temp;
-            }
-        }
-        else
-        {
-            temp -= *(pPulseAmp++);
-            *pCoef = (Int16)temp;
-            if (-temp > *max)
-            {
-                *max = -temp;
-            }
-        }
-
-    } /* for() */
-
-    return;
-
-} /* pulse_nc */
diff --git a/media/libstagefright/codecs/aacdec/pulse_nc.h b/media/libstagefright/codecs/aacdec/pulse_nc.h
deleted file mode 100644
index 8181dd0..0000000
--- a/media/libstagefright/codecs/aacdec/pulse_nc.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pulse_nc.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Pass in max as input argument.
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file contains the global function declaration for pulse_nc
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PULSE_NC_H
-#define PULSE_NC_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_frameinfo.h"
-#include "s_pulseinfo.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void pulse_nc(
-        Int16        coef[],
-        const PulseInfo  *pPulseInfo,
-        const FrameInfo  *pLongFrameInfo,
-        Int      *max);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/pv_audio_type_defs.h b/media/libstagefright/codecs/aacdec/pv_audio_type_defs.h
deleted file mode 100644
index dee66bc..0000000
--- a/media/libstagefright/codecs/aacdec/pv_audio_type_defs.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-------------------------------------------------------------------------------
- Pathname: ./c/include/pv_audio_type_defs.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Removed errant semicolons from #define statements
-
- Description:
-        1. Modified ifndef STD_TYPE_DEFS_H with
-           #ifndef PV_AUDIO_TYPE_DEFS_H to avoid double definition
-               if file was already included
-        2. Merged cai if-def structures and C++ definition
-            3. Updated copyright notice
-
- Description:  Added dependency on OSCL libraries
-
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file was derived from a number of standards bodies. The type
- definitions below were created from some of the best practices observed
- in the standards bodies.
-
- This file is dependent on limits.h for defining the bit widths. In an
- ANSI C environment limits.h is expected to always be present and contain
- the following definitions:
-
-     SCHAR_MIN
-     SCHAR_MAX
-     UCHAR_MAX
-
-     INT_MAX
-     INT_MIN
-     UINT_MAX
-
-     SHRT_MIN
-     SHRT_MAX
-     USHRT_MAX
-
-     LONG_MIN
-     LONG_MAX
-     ULONG_MAX
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef PV_AUDIO_TYPE_DEFS_H
-#define PV_AUDIO_TYPE_DEFS_H
-
-#include <stdint.h>
-
-typedef int8_t        Char;
-
-typedef uint8_t       UChar;
-
-
-
-/*----------------------------------------------------------------------------
-; Define generic signed and unsigned int
-----------------------------------------------------------------------------*/
-#ifndef Int
-typedef signed int  Int;
-#endif
-
-#ifndef UInt
-typedef unsigned int    UInt;
-#endif
-
-
-/*----------------------------------------------------------------------------
-; Define 16 bit signed and unsigned words
-----------------------------------------------------------------------------*/
-
-
-#ifndef Int16
-typedef int16_t       Int16;
-#endif
-
-#ifndef INT16_MIN
-#define INT16_MIN   (-32768)
-#endif
-
-#ifndef INT16_MAX
-#define INT16_MAX   32767
-#endif
-
-#ifndef UInt16
-typedef uint16_t      UInt16;
-
-#endif
-
-
-/*----------------------------------------------------------------------------
-; Define 32 bit signed and unsigned words
-----------------------------------------------------------------------------*/
-
-
-#ifndef Int32
-typedef int32_t       Int32;
-#endif
-
-#ifndef INT32_MIN
-#define INT32_MIN   (-2147483647 - 1)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX   2147483647
-#endif
-
-#ifndef UInt32
-typedef uint32_t      UInt32;
-#endif
-
-#ifndef UINT32_MIN
-#define UINT32_MIN  0
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX  0xffffffff
-#endif
-
-
-/*----------------------------------------------------------------------------
-; Define 64 bit signed and unsigned words
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; Define boolean type
-----------------------------------------------------------------------------*/
-#ifndef Bool
-typedef Int     Bool;
-#endif
-#ifndef FALSE
-#define FALSE       0
-#endif
-
-#ifndef TRUE
-#define TRUE        1
-#endif
-
-#ifndef OFF
-#define OFF     0
-#endif
-#ifndef ON
-#define ON      1
-#endif
-
-#ifndef NO
-#define NO      0
-#endif
-#ifndef YES
-#define YES     1
-#endif
-
-#ifndef SUCCESS
-#define SUCCESS     0
-#endif
-
-#ifndef  NULL
-#define  NULL       0
-#endif
-
-
-#endif  /* PV_AUDIO_TYPE_DEFS_H */
diff --git a/media/libstagefright/codecs/aacdec/pv_div.cpp b/media/libstagefright/codecs/aacdec/pv_div.cpp
deleted file mode 100644
index 86d2487..0000000
--- a/media/libstagefright/codecs/aacdec/pv_div.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: pv_div.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer numerator
-    Int32 y             32-bit integer denominator
-    Quotient *result    structure that hold result and shift factor
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement division of two Int32 numbers, provides back quotient and a
-    shift factor
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#ifdef AAC_PLUS
-
-
-#include "pv_audio_type_defs.h"
-#include "fxp_mul32.h"
-#include "pv_div.h"
-#include "pv_normalize.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void pv_div(Int32 x, Int32 y, Quotient *result)
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-    Int32 quotient;
-    Int32 i;
-    Int32 j;
-    Int32 y_ov_y_hi;
-    Int32 flag = 0;     /* carries negative sign, if any  */
-
-
-    result->shift_factor = 0;   /* default  */
-
-    if (y == 0)
-    {
-        x = 0;   /* this will return 0 for any div/0 */
-    }
-    /*
-     *  make sure x and y are both positive
-     */
-
-    if (y < 0)
-    {
-        y = -y;
-        flag ^= 1;
-    }
-
-
-    if (x < 0)
-    {
-        x = -x;
-        flag ^= 1;
-    }
-
-    if (x != 0)
-    {
-        /*----------------------------------------------------------------------------
-        ; Scale the input to get maximum precision for x
-        ----------------------------------------------------------------------------*/
-
-        i = pv_normalize(x);
-
-        x <<= i;
-
-
-        /*----------------------------------------------------------------------------
-        ; Scale the input to get maximum precision for y
-        ----------------------------------------------------------------------------*/
-
-        j = pv_normalize(y);
-
-        y <<= j;
-
-        result->shift_factor = i - j;
-
-        /*----------------------------------------------------------------------------
-        ; Function body here
-        ----------------------------------------------------------------------------*/
-        /*---------------------------------------------------------------
-         ; take the inverse of the 16 MSB of y
-         ---------------------------------------------------------------*/
-
-        quotient = (0x40000000 / (y >> 15));
-
-        y_ov_y_hi = fxp_mul32_Q15(y, quotient);            /*  y*(1/y_hi)     */
-
-        y_ov_y_hi = 0x7FFFFFFF - y_ov_y_hi;                 /*  2 - y*(1/y_hi) */
-        y_ov_y_hi = fxp_mul32_Q14(quotient,  y_ov_y_hi);
-        i  = fxp_mul32_Q31(y_ov_y_hi,  x) << 1;
-
-        result->quotient = flag ? -i : i;
-    }
-    else
-    {
-        result->quotient = 0;
-    }
-
-
-
-}
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/pv_div.h b/media/libstagefright/codecs/aacdec/pv_div.h
deleted file mode 100644
index 2dfa8a0..0000000
--- a/media/libstagefright/codecs/aacdec/pv_div.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pv_div.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef PV_DIV_H
-#define PV_DIV_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    struct intg_div
-    {
-        Int32 quotient;
-        Int32 shift_factor;
-    };
-    typedef struct intg_div Quotient;
-
-
-    void pv_div(Int32 x, Int32 y, Quotient *quotient);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* PV_DIV_H */
diff --git a/media/libstagefright/codecs/aacdec/pv_log2.cpp b/media/libstagefright/codecs/aacdec/pv_log2.cpp
deleted file mode 100644
index 69cbe91..0000000
--- a/media/libstagefright/codecs/aacdec/pv_log2.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: pv_log2.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer input
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement the logarithm base 2 of a number
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "pv_log2.h"
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-#define R_SHIFT     20
-#define Q_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-const Int32 log_table[9] =
-{
-    Q_fmt(-0.00879832091331F),  Q_fmt(0.12022974263833F),
-    Q_fmt(-0.72883958314294F),  Q_fmt(2.57909824242332F),
-    Q_fmt(-5.90041216630330F),  Q_fmt(9.15023342527264F),
-    Q_fmt(-9.90616619500413F),  Q_fmt(8.11228968755409F),
-    Q_fmt(-3.41763474309898F)
-};
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-
-Int32 pv_log2(Int32 z)
-{
-    const Int32 *pt_table = log_table;
-    Int32 y;
-    Int32 i;
-
-    Int32 int_log2 = 0;
-
-    if (z > Q_fmt(2.0f))
-    {
-        while (z > Q_fmt(2.0f))
-        {
-            z >>= 1;
-            int_log2++;
-        }
-    }
-    else if (z < Q_fmt(1.0f))
-    {
-        {
-            while (z < Q_fmt(1.0f))
-            {
-                z <<= 1;
-                int_log2--;
-            }
-        }
-    }
-
-    /*
-     *  at this point, input limited to 1<x<2
-     */
-
-    if (z != Q_fmt(1.0f))
-    {
-        y  = fxp_mul32_Q20(*(pt_table++), z);
-
-        for (i = 7; i != 0; i--)
-        {
-            y += *(pt_table++);
-            y  = fxp_mul32_Q20(y, z);
-        }
-
-        y += *(pt_table++);
-    }
-    else
-    {
-        y = 0;
-    }
-
-
-    return (y + (int_log2 << 20));         /* Q20 */
-}
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/pv_log2.h b/media/libstagefright/codecs/aacdec/pv_log2.h
deleted file mode 100644
index 4834e82..0000000
--- a/media/libstagefright/codecs/aacdec/pv_log2.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pv_log2.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef PV_LOG2_H
-#define PV_LOG2_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    Int32 pv_log2(Int32 z);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* PV_LOG2_H */
diff --git a/media/libstagefright/codecs/aacdec/pv_normalize.cpp b/media/libstagefright/codecs/aacdec/pv_normalize.cpp
deleted file mode 100644
index 365b5ad..0000000
--- a/media/libstagefright/codecs/aacdec/pv_normalize.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: pv_normalize.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-Input
-    Int32 x             32-bit integer non-zero input
-Returns
-    Int32 i             number of leading zeros on x
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Returns number of leading zeros on the non-zero input
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "pv_normalize.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-#if defined(_ARM)
-#elif (defined(PV_ARM_GCC_V5)||defined(PV_ARM_GCC_V4))
-/* function is inlined in header file */
-
-
-#else
-
-Int pv_normalize(Int32 x)
-{
-    /*----------------------------------------------------------------------------
-    ; Define all local variables
-    ----------------------------------------------------------------------------*/
-    Int i;
-
-
-    if (x > 0x0FFFFFFF)
-    {
-        i = 0;  /* most likely case */
-    }
-    else if (x > 0x00FFFFFF)
-    {
-        i = 3;  /* second most likely case */
-    }
-    else if (x > 0x0000FFFF)
-    {
-        i  = x > 0x000FFFFF ?  7 :  11;
-    }
-    else
-    {
-        if (x > 0x000000FF)
-        {
-            i  = x > 0x00000FFF ?  15 :  19;
-        }
-        else
-        {
-            i  = x > 0x0000000F ?  23 :  27;
-        }
-    }
-
-
-    x <<= i;
-
-    switch (x & 0x78000000)
-    {
-        case 0x08000000:
-            i += 3;
-            break;
-
-        case 0x18000000:
-        case 0x10000000:
-            i += 2;
-            break;
-        case 0x28000000:
-        case 0x20000000:
-        case 0x38000000:
-        case 0x30000000:
-            i++;
-
-        default:
-            ;
-    }
-
-    return i;
-
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/pv_normalize.h b/media/libstagefright/codecs/aacdec/pv_normalize.h
deleted file mode 100644
index dce080e..0000000
--- a/media/libstagefright/codecs/aacdec/pv_normalize.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Pathname: pv_normalize.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef PV_NORMALIZE_H
-#define PV_NORMALIZE_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES AND SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-#if defined(_ARM)
-
-__inline Int pv_normalize(Int32 x)
-{
-    Int32 y;
-    __asm
-    {
-        clz y, x;
-        sub y, y, #1
-    }
-    return (y);
-}
-
-
-#elif (defined(PV_ARM_GCC_V5)||defined(PV_ARM_GCC_V4))
-
-__inline Int pv_normalize(Int32 x)
-{
-    register Int32 y;
-    register Int32 ra = x;
-
-
-    asm volatile(
-        "clz %0, %1\n\t"
-        "sub %0, %0, #1"
-    : "=&r*i"(y)
-                : "r"(ra));
-    return (y);
-
-}
-
-#else
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int pv_normalize(Int32 x);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
-
-#endif  /* PV_NORMALIZE_H */
diff --git a/media/libstagefright/codecs/aacdec/pv_pow2.cpp b/media/libstagefright/codecs/aacdec/pv_pow2.cpp
deleted file mode 100644
index 8dfca23..0000000
--- a/media/libstagefright/codecs/aacdec/pv_pow2.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: pv_pow2.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-Input
-    Int32 x             32-bit integer input  Q27
-
-Output
-    Int32               32-bit integer in Q25
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement the power base 2 for positive numbers lesser than 5.999999
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-#ifdef AAC_PLUS
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_pow2.h"
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#define POW_2_TABLE_LENGTH          6
-#define POW_2_TABLE_LENGTH_m_2      (POW_2_TABLE_LENGTH - 2)
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-#define R_SHIFT     29
-#define Q_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-#define Q27fmt(x)   (Int32)(x*((Int32)1<<27) + (x>=0?0.5F:-0.5F))
-
-const Int32 pow2_table[6] =
-{
-    Q_fmt(0.00224510927441F),   Q_fmt(0.00777943379416F),
-    Q_fmt(0.05737929218747F),   Q_fmt(0.23918017179889F),
-    Q_fmt(0.69345251849351F),   Q_fmt(0.99996347120248F)
-};
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-/*
- *      z in Q27 format
- */
-
-Int32 pv_pow2(Int32 z)
-{
-    const Int32 *pt_table = pow2_table;
-    Int32 multiplier = 0;
-    Int32 shift_factor;
-    Int32 i;
-    Int32 v_q;
-    Int32 y;
-
-
-    if (z > Q27fmt(1.0f))
-    {
-        v_q = z - (z & 0xF8000000);
-        shift_factor =   z >> 27;
-    }
-    else
-    {
-        v_q = z;
-        shift_factor = 0;
-    }
-
-    if (v_q < Q27fmt(0.5f))
-    {
-        v_q += Q27fmt(0.5f);
-        multiplier = Q_fmt(0.70710678118655F);
-    }
-
-    v_q = v_q << 2;
-
-    y  = fxp_mul32_Q29(*(pt_table++), v_q);
-
-    for (i = POW_2_TABLE_LENGTH_m_2; i != 0; i--)
-    {
-        y += *(pt_table++);
-        y  = fxp_mul32_Q29(y, v_q);
-    }
-    y += *(pt_table++);
-
-    if (multiplier)
-    {
-        y = fxp_mul32_Q29(y, multiplier);
-    }
-
-    /*
-     *  returns number on Q25
-     */
-    return (y >> (4 - shift_factor));
-
-}
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/pv_pow2.h b/media/libstagefright/codecs/aacdec/pv_pow2.h
deleted file mode 100644
index 04bfe93..0000000
--- a/media/libstagefright/codecs/aacdec/pv_pow2.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pv_pow2.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef PV_POW2_H
-#define PV_POW2_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    Int32 pv_pow2(Int32 z);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* PV_POW2_H */
diff --git a/media/libstagefright/codecs/aacdec/pv_sine.cpp b/media/libstagefright/codecs/aacdec/pv_sine.cpp
deleted file mode 100644
index 54319b1..0000000
--- a/media/libstagefright/codecs/aacdec/pv_sine.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: pv_sine.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer angle (in Q30) between 0 and pi/2
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Find the sine of a number between 0 and pi/2
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-#ifdef PARAMETRICSTEREO
-
-#include "pv_audio_type_defs.h"
-#include "fxp_mul32.h"
-#include "pv_sine.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-#define R_SHIFT     30
-
-#define Q_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-const Int32 sin_table[9] =
-{
-    Q_fmt(0.00001724684028), Q_fmt(-0.00024606242846),
-    Q_fmt(0.00007297328923), Q_fmt(0.00826706596417),
-    Q_fmt(0.00003585160465), Q_fmt(-0.16667772526248),
-    Q_fmt(0.00000174197440), Q_fmt(0.99999989138797),
-    Q_fmt(0.00000000110513)
-};
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-Int32 pv_sine(Int32 z)
-{
-    Int32 sine;
-    Int32 i;
-    const Int32 *pt_table = sin_table;
-    Int32 sign = 0;
-
-    if (z < 0)
-    {
-        z = -z;
-        sign = 1;
-    }
-
-    if (z > Q_fmt(0.0015))
-    {
-        sine  = fxp_mul32_Q30(*(pt_table++), z);
-
-        for (i = 7; i != 0; i--)
-        {
-            sine += *(pt_table++);
-            sine  = fxp_mul32_Q30(sine, z);
-        }
-
-    }
-    else
-    {
-        sine = z;  /*  better approximation in this range */
-    }
-
-    if (sign)
-    {
-        sine = -sine;
-    }
-
-    return sine;
-}
-
-
-
-Int32 pv_cosine(Int32 z)
-{
-    Int32 cosine;
-
-    if (z < 0)
-    {
-        z = -z;     /* sign does not play a role in cosine */
-    }
-
-    if (z > Q_fmt(0.0015))
-    {
-        z = Q_fmt(1.57079632679490) - z;   /* pi/2 - z */
-
-        cosine  = pv_sine(z);
-    }
-    else
-    {   /*  better approximation in this range  */
-        cosine = Q_fmt(0.99999999906868) - (fxp_mul32_Q30(z, z) >> 1);
-    }
-
-    return cosine;
-}
-
-#endif
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/pv_sine.h b/media/libstagefright/codecs/aacdec/pv_sine.h
deleted file mode 100644
index 145013a..0000000
--- a/media/libstagefright/codecs/aacdec/pv_sine.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pv_sine.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef PV_SINE_H
-#define PV_SINE_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    Int32 pv_sine(Int32 x);
-    Int32 pv_cosine(Int32 x);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* PV_SINE_H */
diff --git a/media/libstagefright/codecs/aacdec/pv_sqrt.cpp b/media/libstagefright/codecs/aacdec/pv_sqrt.cpp
deleted file mode 100644
index 065fa38..0000000
--- a/media/libstagefright/codecs/aacdec/pv_sqrt.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: pv_sqrt.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 x             32-bit integer
-
-    Int32 y             32-bit integer
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement root squared of a number
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "pv_audio_type_defs.h"
-
-#include "fxp_mul32.h"
-#include "pv_sqrt.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#define R_SHIFT     28
-#define Q_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-
-const Int32 sqrt_table[9] =
-{
-    Q_fmt(-0.13829740941110F),  Q_fmt(0.95383399963991F),
-    Q_fmt(-2.92784603873353F),  Q_fmt(5.27429191920042F),
-    Q_fmt(-6.20272445821478F),  Q_fmt(5.04717433019620F),
-    Q_fmt(-3.03362807640415F),  Q_fmt(1.86178814410910F),
-    Q_fmt(0.16540758699193F)
-};
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void pv_sqrt(Int32 man, Int32 exp, Root_sq *result, Int32 *sqrt_cache)
-{
-
-    Int32   y;
-    Int32   xx;
-    Int32   nn;
-    Int32   i;
-    const Int32 *pt_table = sqrt_table;
-
-
-    if (sqrt_cache[0] == man && sqrt_cache[1] == exp)
-    {
-        result->root         =        sqrt_cache[2];
-        result->shift_factor = (Int16)sqrt_cache[3];
-    }
-    else
-    {
-
-        sqrt_cache[0] = man;
-        sqrt_cache[1] = exp;
-
-
-        if (man > 0)
-        {
-            xx =  man;
-            if (man >= Q_fmt(1.0f))
-            {
-                nn = exp + 1;
-                while ((xx >>= 1) > Q_fmt(1.0f))
-                {
-                    nn++;
-                }
-            }
-            else if (man < Q_fmt(0.5f))
-            {
-                nn = exp - 1;
-                while ((xx <<= 1) < Q_fmt(0.5f))
-                {
-                    nn--;
-                }
-            }
-            else
-            {
-                nn = exp;
-            }
-
-
-            y  = fxp_mul32_Q28(*(pt_table++), xx);
-
-            for (i = 3; i != 0; i--)
-            {
-                y += *(pt_table++);
-                y  = fxp_mul32_Q28(y, xx);
-                y += *(pt_table++);
-                y  = fxp_mul32_Q28(y, xx);
-            }
-            y += *(pt_table++);
-            y  = fxp_mul32_Q28(y, xx) + *(pt_table++);
-
-            if (nn >= 0)
-            {
-                if (nn&1)
-                {
-                    y = fxp_mul32_Q29(y, Q_fmt(1.41421356237310F));
-                    result->shift_factor = (nn >> 1) - 28;
-                }
-                else
-                {
-                    result->shift_factor = (nn >> 1) - 29;
-                }
-            }
-            else
-            {
-                if (nn&1)
-                {
-                    y = fxp_mul32_Q28(y, Q_fmt(0.70710678118655F));
-                }
-
-                result->shift_factor = -((-nn) >> 1) - 29;
-            }
-
-            result->root = y;
-
-        }
-        else
-        {
-            result->root = 0;
-            result->shift_factor = 0;
-        }
-
-    }
-
-    sqrt_cache[2] = result->root;
-    sqrt_cache[3] = result->shift_factor;
-
-}
-
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/pv_sqrt.h b/media/libstagefright/codecs/aacdec/pv_sqrt.h
deleted file mode 100644
index 45d6f52..0000000
--- a/media/libstagefright/codecs/aacdec/pv_sqrt.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pv_sqrt.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef PV_SQRT_H
-#define PV_SQRT_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    struct intg_sqrt
-    {
-        Int32 root;
-        Int32 shift_factor;
-    };
-    typedef struct intg_sqrt Root_sq;
-
-    void pv_sqrt(Int32 man, Int32 exp, Root_sq *result, Int32 *sqrt_cache);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* PV_SQRT_H */
diff --git a/media/libstagefright/codecs/aacdec/pvmp4audiodecoder_api.h b/media/libstagefright/codecs/aacdec/pvmp4audiodecoder_api.h
deleted file mode 100644
index 7806f88..0000000
--- a/media/libstagefright/codecs/aacdec/pvmp4audiodecoder_api.h
+++ /dev/null
@@ -1,376 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Name: PVMP4AudioDecoder_API.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Change buffer type to UChar
-
- Description: Update comments
-
- Description: Updated a comment that MT did not get around to
- before the end of his contract.
-
- Description: add a new API to decode audioSpecificConfig separately, the same
-              change has been made on 32-bits version (element \main\2)
-
- Description: add a new API to reset history buffer, the same change has been
-              made on a 32-bits version(element \nd.e0352.wjin\1)
-
- Who:                                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Main header file for the Packet Video MP4/AAC audio decoder library. The
- constants, structures, and functions defined within this file, along with
- a basic data types header file, is all that is needed to use and communicate
- with the library. The internal data structures within the library are
- purposely hidden.
-
- ---* Need description of the input buffering. *-------
-
- ---* Need an example of calling the library here *----
-
-------------------------------------------------------------------------------
- REFERENCES
-
-  (Normally header files do not have a reference section)
-
-  ISO/EIC 14496-3:(1999) Document titled
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef PVMP4AUDIODECODER_API_H
-#define PVMP4AUDIODECODER_API_H
-
-#include "pv_audio_type_defs.h"  /* Basic data types used within the lib */
-
-#include "e_tmp4audioobjecttype.h"
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*
-     * This constant is the guaranteed-to-work buffer size, specified in bytes,
-     * for the input buffer for 2 audio channels to decode one frame of data,
-     * as specified by the MPEG-2 or MPEG-4 standard.
-     * The standard, and this constant, do not take into account that lower
-     * bitrates will use less data per frame. Note that the number of bits
-     * used per frame is variable, and only that the average value will be the
-     * bit rate specified during encoding. The standard does not specify
-     * over how many frames the average must be maintained.
-     *
-     * The constant value is 6144 * 2 channels / 8 bits per byte
-     */
-
-
-#define PVMP4AUDIODECODER_INBUFSIZE  1536
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-    /*
-     * This enumeration is used for the structure element outputFormat. It
-     * specifies how the output data is to be formatted. Presently only 16-bit
-     * PCM data is supported, and this enum informs how the single output
-     * buffer should be for two-channel stereo data.
-     * Grouped format stores all the left channel values, then right:
-     * "LLLL...LLRRRR...RR"
-     * Interleave format store left, then right audio samples:
-     * "LRLRLRLR...."
-     */
-    typedef enum ePVMP4AudioDecoderOutputFormat
-    {
-        OUTPUTFORMAT_16PCM_GROUPED = 0,
-        OUTPUTFORMAT_16PCM_INTERLEAVED = 1
-
-    } tPVMP4AudioDecoderOutputFormat;
-
-    /*
-     * This enumeration holds the possible return values for the main decoder
-     * function, PVMP4AudioDecodeFrame. The plan was to easily distinguish
-     * whether an error was recoverable (streaming mode) or not. Presently no
-     * errors are recoverable, which is a result of not supporting ADTS in
-     * this release.
-     */
-    typedef enum ePVMP4AudioDecoderErrorCode
-    {
-        MP4AUDEC_SUCCESS           =  0,
-        MP4AUDEC_INVALID_FRAME     = 10,
-        MP4AUDEC_INCOMPLETE_FRAME  = 20,
-        MP4AUDEC_LOST_FRAME_SYNC   = 30     /* Cannot happen since no ADTS */
-    } tPVMP4AudioDecoderErrorCode;
-
-
-    /*
-     * This enumeration holds the possible return values for stream type
-     * being decoded
-     */
-    typedef enum
-    {
-        AAC = 0,
-        AACPLUS,
-        ENH_AACPLUS
-    } STREAMTYPE;
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-    /*
-     * This structure is used to communicate information in to and out of the
-     * AAC decoder.
-     */
-
-    typedef struct
-#ifdef __cplusplus
-                tPVMP4AudioDecoderExternal  // To allow forward declaration of this struct in C++
-#endif
-    {
-        /*
-         * INPUT:
-         * Pointer to the input buffer that contains the encoded bistream data.
-         * The data is filled in such that the first bit transmitted is
-         * the most-significant bit (MSB) of the first array element.
-         * The buffer is accessed in a linear fashion for speed, and the number of
-         * bytes consumed varies frame to frame.
-         * The calling environment can change what is pointed to between calls to
-         * the decode function, library, as long as the inputBufferCurrentLength,
-         * and inputBufferUsedLength are updated too. Also, any remaining bits in
-         * the old buffer must be put at the beginning of the new buffer.
-         */
-        UChar  *pInputBuffer;
-
-        /*
-         * INPUT:
-         * Number of valid bytes in the input buffer, set by the calling
-         * function. After decoding the bitstream the library checks to
-         * see if it when past this value; it would be to prohibitive to
-         * check after every read operation. This value is not modified by
-         * the AAC library.
-         */
-        Int     inputBufferCurrentLength;
-
-        /*
-         * INPUT:
-         * The actual size of the buffer.
-         * This variable is not used by the library, but is used by the
-         * console test application. This parameter could be deleted
-         * if this value was passed into these function. The helper functions are
-         * not part of the library and are not used by the Common Audio Decoder
-         * Interface.
-         */
-        Int     inputBufferMaxLength;
-
-        /*
-         * INPUT:
-         * Enumerated value the output is to be interleaved left-right-left-right.
-         * For further information look at the comments for the enumeration.
-         */
-        tPVMP4AudioDecoderOutputFormat  outputFormat;
-
-        /*
-         * INPUT: (but what is pointed to is an output)
-         * Pointer to the output buffer to hold the 16-bit PCM audio samples.
-         * If the output is stereo, both left and right channels will be stored
-         * in this one buffer. Presently it must be of length of 2048 points.
-         * The format of the buffer is set by the parameter outputFormat.
-         */
-        Int16  *pOutputBuffer;
-
-        /*
-         * INPUT: (but what is pointed to is an output)
-         * Pointer to the output buffer to hold the 16-bit PCM AAC-plus audio samples.
-         * If the output is stereo, both left and right channels will be stored
-         * in this one buffer. Presently it must be of length of 2048 points.
-         * The format of the buffer is set by the parameter outputFormat.
-         */
-        Int16  *pOutputBuffer_plus;     /* Used in AAC+ and enhanced AAC+  */
-
-        /*
-         * INPUT:
-         * AAC Plus Upsampling Factor. Normally set to 2 when Spectrum Band
-         * Replication (SBR) is used
-         */
-        Int32  aacPlusUpsamplingFactor; /* Used in AAC+ and enhanced AAC+  */
-
-        /*
-         * INPUT:
-         * AAC Plus enabler. Deafaults to be ON, unless run time conditions
-         * require the SBR and PS tools disabled
-         */
-        bool    aacPlusEnabled;
-        /*
-         * INPUT:
-         * (Currently not being used inside the AAC library.)
-         * This flag is set to TRUE when the playback position has been changed,
-         * for example, rewind or fast forward. This informs the AAC library to
-         * take an appropriate action, which has yet to be determined.
-         */
-        Bool    repositionFlag;
-
-        /*
-         * INPUT:
-         * Number of requested output audio channels. This relieves the calling
-         * environment from having to perform stereo-to-mono or mono-to-stereo
-         * conversions.
-         */
-        Int     desiredChannels;
-
-        /*
-         * INPUT/OUTPUT:
-         * Number of elements used by the library, initially set to zero by
-         * the function PVMP4AudioDecoderInitLibrary, and modified by each
-         * call to PVMP4AudioDecodeFrame.
-         */
-        Int     inputBufferUsedLength;
-
-        /*
-         * INPUT/OUTPUT:
-         * Number of bits left over in the next buffer element,
-         * This value will always be zero, unless support for ADTS is added.
-         */
-        Int32    remainderBits;
-
-        /*
-         * OUTPUT:
-         * The sampling rate decoded from the bitstream, in units of
-         * samples/second. For this release of the library this value does
-         * not change from frame to frame, but future versions will.
-         */
-        Int32   samplingRate;
-
-        /*
-         * OUTPUT:
-         * This value is the bitrate in units of bits/second. IT
-         * is calculated using the number of bits consumed for the current frame,
-         * and then multiplying by the sampling_rate, divided by points in a frame.
-         * This value can changes frame to frame.
-         */
-        Int32   bitRate;
-
-        /*
-         * OUTPUT:
-         * The number of channels decoded from the bitstream. The output data
-         * will have be the amount specified in the variable desiredChannels,
-         * this output is informative only, and can be ignored.
-         */
-        Int     encodedChannels;
-
-        /*
-         * OUTPUT:
-         * This value is the number of output PCM samples per channel.
-         * It is presently hard-coded to 1024, but may change in the future.
-         * It will not change frame to frame, and would take on
-         * one of these four values: 1024, 960, 512, or 480. If an error occurs
-         * do not rely on this value.
-         */
-        Int     frameLength;
-
-        /*
-        * This value is audio object type as defined in struct tMP4AudioObjectType
-        * in file e_tMP4AudioObjectType.h
-        */
-        Int     audioObjectType;
-
-        /*
-        * This value is extended audio object type as defined in struct tMP4AudioObjectType
-        * in file e_tMP4AudioObjectType.h. It carries the output Audio Object Type
-        */
-        Int     extendedAudioObjectType;
-
-
-    } tPVMP4AudioDecoderExternal;
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    OSCL_IMPORT_REF UInt32 PVMP4AudioDecoderGetMemRequirements(void);
-
-    OSCL_IMPORT_REF Int PVMP4AudioDecoderInitLibrary(
-        tPVMP4AudioDecoderExternal  *pExt,
-        void                        *pMem);
-
-    OSCL_IMPORT_REF Int PVMP4AudioDecodeFrame(
-        tPVMP4AudioDecoderExternal  *pExt,
-        void                        *pMem);
-
-    OSCL_IMPORT_REF Int PVMP4AudioDecoderConfig(
-        tPVMP4AudioDecoderExternal  *pExt,
-        void                        *pMem);
-
-    OSCL_IMPORT_REF void PVMP4AudioDecoderResetBuffer(
-        void                        *pMem);
-
-    OSCL_IMPORT_REF void PVMP4AudioDecoderDisableAacPlus(
-        tPVMP4AudioDecoderExternal  *pExt,
-        void                        *pMem);
-
-    Int PVMP4SetAudioConfig(
-        tPVMP4AudioDecoderExternal  *pExt,
-        void                        *pMem,
-        Int                         upsamplingFactor,
-        Int                         samp_rate,
-        int                         num_ch,
-        tMP4AudioObjectType         audioObjectType);
-
-    /*----------------------------------------------------------------------------
-    ; END
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif  /* PVMP4AUDIODECODER_API_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/pvmp4audiodecoderconfig.cpp b/media/libstagefright/codecs/aacdec/pvmp4audiodecoderconfig.cpp
deleted file mode 100644
index 9208fa8..0000000
--- a/media/libstagefright/codecs/aacdec/pvmp4audiodecoderconfig.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: PVMP4AudioDecoderConfig
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: (1) Modified to decode AudioSpecificConfig for any frame number
-                  pVars->bno
-              (2) Update the input and output descriptions
-
- Description: Eliminated search for ADIF header
-
- Description: Added support for AAC+
-
- Who:                                         Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pExt = pointer to the external interface structure. See the file
-           PVMP4AudioDecoder_API.h for a description of each field.
-           Data type of pointer to a tPVMP4AudioDecoderExternal
-           structure.
-
-           pExt->pInputBuffer: pointer to input buffer containing input
-                               bitstream
-
-           pExt->inputBufferCurrentLength: number of bytes in the input buffer
-
-           pExt->inputBufferUsedLength: number of bytes already consumed in
-                                        input buffer
-
-           pExt->remainderBits: number of bits consumed in addition to
-                                pExt->inputBufferUsedLength
-
-    pMem = void pointer to hide the internal implementation of the library
-           It is cast back to a tDec_Int_File structure. This structure
-           contains information that needs to persist between calls to
-           this function, or is too big to be placed on the stack, even
-           though the data is only needed during execution of this function
-           Data type void pointer, internally pointer to a tDec_Int_File
-           structure.
-
- Local Stores/Buffers/Pointers Needed: None
-           (The memory set aside in pMem performs this task)
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-     status = 0                       if no error occurred
-              MP4AUDEC_NONRECOVERABLE if a non-recoverable error occurred
-              MP4AUDEC_RECOVERABLE    if a recoverable error occurred.
-              Presently a recoverable error does not exist, but this
-              was a requirement.
-
-
- Pointers and Buffers Modified:
-    pMem contents are modified.
-    pExt: (more detail in the file PVMP4AudioDecoder_API.h)
-    inputBufferUsedLength - number of array elements used up by the stream.
-    remainderBits - remaining bits in the next UInt32 buffer
-    samplingRate - sampling rate in samples per sec
-    encodedChannels - channels found on the file (informative)
-    frameLength - length of the frame
-
- Local Stores Modified: None.
-
- Global Stores Modified: None.
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- PacketVideo Document # CCC-AUD-AAC-ERS-0003
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3: 1999(E)
-      subclause 1.6
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_tdec_int_file.h"
-#include "ibstream.h"           /* where #define INBUF_ARRAY_INDEX_SHIFT */
-#include "sfb.h"                   /* Where samp_rate_info[] is declared */
-
-#include "get_audio_specific_config.h"
-#include "pvmp4audiodecoder_api.h"   /* Where this function is declared */
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-OSCL_EXPORT_REF Int PVMP4AudioDecoderConfig(
-    tPVMP4AudioDecoderExternal  *pExt,
-    void                        *pMem)
-{
-
-    UInt           initialUsedBits;  /* Unsigned for C55x */
-    tDec_Int_File *pVars;           /* Helper pointer */
-
-    Int            status = MP4AUDEC_INCOMPLETE_FRAME;
-
-    /*
-     * Initialize "helper" pointers to existing memory.
-     */
-    pVars = (tDec_Int_File *)pMem;
-    /*
-     * Translate input buffer variables.
-     */
-    pVars->inputStream.pBuffer = pExt->pInputBuffer;
-
-    pVars->inputStream.inputBufferCurrentLength =
-        (UInt)pExt->inputBufferCurrentLength;
-
-    pVars->inputStream.availableBits =
-        (UInt)(pExt->inputBufferCurrentLength << INBUF_ARRAY_INDEX_SHIFT);
-
-    initialUsedBits =
-        (UInt)((pExt->inputBufferUsedLength << INBUF_ARRAY_INDEX_SHIFT) +
-               pExt->remainderBits);
-
-    pVars->inputStream.usedBits = initialUsedBits;
-
-    if (initialUsedBits <= pVars->inputStream.availableBits)
-    {
-
-        /*
-         * Buffer is not overrun, then
-         * decode the AudioSpecificConfig() structure
-         */
-
-        pVars->aacConfigUtilityEnabled = false;  /* set aac dec mode */
-
-        status = get_audio_specific_config(pVars);
-
-    }
-
-    byte_align(&pVars->inputStream);
-
-
-    if (status == SUCCESS)
-    {
-
-        pVars->bno++;
-
-        /*
-         * A possible improvement would be to set these values only
-         * when they change.
-         */
-        pExt->samplingRate =
-            samp_rate_info[pVars->prog_config.sampling_rate_idx].samp_rate;
-
-        /*
-         *  we default to 2 channel, even for mono files, (where channels have same content)
-         *  this is done to ensure support for enhanced aac+ with implicit signalling
-         */
-        pExt->aacPlusEnabled = pVars->aacPlusEnabled;
-
-//        pExt->encodedChannels = pVars->mc_info.nch;
-
-        pExt->encodedChannels = 2;
-
-        pExt->frameLength = pVars->frameLength;
-#ifdef AAC_PLUS
-        pExt->aacPlusUpsamplingFactor = pVars->mc_info.upsamplingFactor;
-#endif
-
-    }
-    else
-    {
-        /*
-         *  Default to nonrecoverable error status unless there is a Buffer overrun
-         */
-        status = MP4AUDEC_INVALID_FRAME;
-
-        if (pVars->inputStream.usedBits > pVars->inputStream.availableBits)
-        {
-            /* all bits were used but were not enough to complete parsing */
-            pVars->inputStream.usedBits = pVars->inputStream.availableBits;
-
-            status = MP4AUDEC_INCOMPLETE_FRAME; /* audio config too small */
-        }
-
-    }
-
-    /*
-     * Translate from units of bits back into units of words.
-     */
-
-    pExt->inputBufferUsedLength =
-        pVars->inputStream.usedBits >> INBUF_ARRAY_INDEX_SHIFT;
-
-    pExt->remainderBits = pVars->inputStream.usedBits & INBUF_BIT_MODULO_MASK;
-
-    pVars->status = status;
-
-    return (status);
-
-} /* PVMP4AudioDecoderDecodeFrame */
-
diff --git a/media/libstagefright/codecs/aacdec/pvmp4audiodecoderframe.cpp b/media/libstagefright/codecs/aacdec/pvmp4audiodecoderframe.cpp
deleted file mode 100644
index 7a279dc..0000000
--- a/media/libstagefright/codecs/aacdec/pvmp4audiodecoderframe.cpp
+++ /dev/null
@@ -1,1458 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pvmp4audiodecodeframe
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Pulled in loop structure from console.c, so that this function
-               now decodes all frames in the file.
-
-               Original program used several global variables.  These have been
-               eliminated, except for situations in which the global variables
-               could be converted into const types.  Otherwise, they are passed
-               by reference through the functions.
-
- Description:  Begin mods for file I/O removal
-
- Description:  Merged trans4m_freq_2_time, trans4m_time_2_freq, etc.
-
- Description:  Removing commented out sections of code.  This includes the
-               removal of unneeded functions init_lt_pred, reset_mc_info,
-
- Description: Copied from aac_decode_frame.c and renamed file,
-              Made many changes.
-
- Description: Prepare for code review
-
- Description: Update per review comments:
-              1) Add comment about leaveGetLoop
-              2) Remove inverseTNSCoef array
-              3) fix wnd_shape_this_bk to wnd_shape_prev_bk in F to T
-              4) Clean up comments
-              5) Change call to long_term_synthesis
-
- Description: Remove division for calculation of bitrate.
-
- Description: Remove update of LTP buffers if not LTP audio object type.
-
- Description: Add hasmask to call to right_ch_sfb_tools_ms
-
- Description:
- Modified to call ltp related routines on the left channel
- before intensity is called on the right channel.  The previous version
- was causing a problem when IS was used on the right channel and LTP
- on the left channel for the same scalefactor band.
-
- This fix required creating a new function, apply_ms_synt, deleting another
- function (right_ch_sfb_tools_noms.c), and modifying the calling order of
- the other functions.
-
- Description: Made changes per review comments.
-
- Description: Changed name of right_ch_sfb_tools_ms to pns_intensity_right
-
- Description: Added cast, since pVars->inputStream.usedBits is UInt, and
- pExt->remainderBits is Int.
-
- pExt->remainderBits =
-    (Int)(pVars->inputStream.usedBits & INBUF_BIT_MODULO_MASK);
-
- Description: Modified to pass a pointer to scratch memory into
- tns_setup_filter.c
-
- Description: Removed include of "s_TNSInfo.h"
-
- Description: Removed call to "tns_setup_filter" which has been eliminated
- by merging its functionality into "get_tns"
-
- Description:  Passing in a pointer to a q-format array, rather than
- the address of a single q-format, for the inverse filter case for
- apply_tns.
-
- Description:
- (1) Added #include of "e_ElementId.h"
-     Previously, this function was relying on another include file
-     to include "e_ElementId.h"
-
- (2) Updated the copyright header.
-
- Description:
- Per review comments, declared two temporary variables
-
-    pChLeftShare  = pChVars[LEFT]->pShareWfxpCoef;
-    pChRightShare = pChVars[RIGHT]->pShareWfxpCoef;
-
- Description:
-    long_term_synthesis should have been invoked with max_sfb
-    as the 2nd parameter, rather than pFrameInfo->sfb_per_win[0].
-
-    Old
-                long_term_synthesis(
-                    pChVars[ch]->wnd,
-                    pFrameInfo->sfb_per_win[0] ...
-
-    Correction
-                long_term_synthesis(
-                    pChVars[ch]->wnd,
-                    pChVars[ch]->pShareWfxpCoef->max_sfb ...
-
-    This problem caused long_term_synthesis to read memory which
-    was not initialized in get_ics_info.c
-
- Description:
- (1) Utilize scratch memory for the scratch Prog_Config.
-
- Description: (1) Modified to decode ID_END syntactic element after header
-
- Description:
- (1) Reconfigured LTP buffer as a circular buffer.  This saves
-     2048 Int16->Int16 copies per frame.
-
- Description: Updated so ltp buffers are not used as a wasteful
- intermediate buffer for LC streams.  Data is transferred directly
- from the filterbank to the output stream.
-
- Description: Decode ADIF header if frame count is zero.
-              The AudioSpecificConfig is decoded by a separate API.
-
- Description: Added comments explaining how the ltp_buffer_state
- variable is updated.
-
-
- Description: Modified code to take advantage of new trans4m_freq_2_time_fxp,
- which writes the output directly into a 16-bit output buffer.  This
- improvement allows faster operation by reducing the amount of memory
- transfers.  Speed can be further improved on most platforms via use of a
- DMA transfer in the function write_output.c
-
- Description: perChan[] is an array of structures in tDec_Int_File. Made
-              corresponding changes.
-
- Description: Included changes in interface for q_normalize() and
-              trans4m_freq_2_time_fxp.
-
- Description: Included changes in interface for long_term_prediction.
-
- Description: Added support for DSE (Data Streaming Channel). Added
-              function get_dse() and included file get_dse.h
-
- Description: Added support for the ill-case when a raw data block contains
-              only a terminator <ID_END>. This is illegal but is added
-              for convinience
-
- Description: Added support for empty audio frames, such the one containing
-              only DSE or FILL elements. A trap was added to stop processing
-              when no audio information was sent.
-
- Description: Added support for adts format files. Added saturation to
-              floating point version of aac+ decoding
-
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pExt = pointer to the external interface structure. See the file
-           PVMP4AudioDecoder_API.h for a description of each field.
-           Data type of pointer to a tPVMP4AudioDecoderExternal
-           structure.
-
-    pMem = void pointer to hide the internal implementation of the library
-           It is cast back to a tDec_Int_File structure. This structure
-           contains information that needs to persist between calls to
-           this function, or is too big to be placed on the stack, even
-           though the data is only needed during execution of this function
-           Data type void pointer, internally pointer to a tDec_Int_File
-           structure.
-
- Local Stores/Buffers/Pointers Needed: None
-           (The memory set aside in pMem performs this task)
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-     status = 0                       if no error occurred
-              MP4AUDEC_NONRECOVERABLE if a non-recoverable error occurred
-              MP4AUDEC_RECOVERABLE    if a recoverable error occurred.
-              Presently a recoverable error does not exist, but this
-              was a requirement.
-
-
- Pointers and Buffers Modified:
-    pMem contents are modified.
-    pExt: (more detail in the file PVMP4AudioDecoder_API.h)
-    inputBufferUsedLength - number of array elements used up by the stream.
-    remainderBits - remaining bits in the next UInt32 buffer
-    samplingRate - sampling rate in samples per sec
-    bitRate - bit rate in bits per second, varies frame to frame.
-    encodedChannels - channels found on the file (informative)
-    frameLength - length of the frame
-
- Local Stores Modified: None.
-
- Global Stores Modified: None.
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- Decodes one frame of an MPEG-2/MPEG-4 encoded audio bitstream.
-
- This function calls the various components of the decoder in the proper order.
-
-
-         Left Channel                                    Right Channel
-             |                                                 |
-             |                                                 |
-             |                                                 |
-            \|/                                               \|/
- #1 ____________________                           #2 ____________________
-    |                  |                              |                  |
-    | Huffman Decoding |                              | Huffman Decoding |
-    |__________________|                              |__________________|
-             |                                                 |
-             |                                                 |
-             |                                                 |
-            \|/                                                |
- #3 ____________________                                       |
-    |                  |                                       |
-    |     PNS LEFT     |                                       |
-    |__________________|                                       |
-             |                                                 |
-             |                                                 |
-             |                                                 |
-            \|/                                               \|/
- #4 ______________________________________________________________________
-    |                                                                    |
-    |                          Apply MS_Synt                             |
-    |____________________________________________________________________|
-             |                                                 |
-             |                                                 |
-            \|/                                                |
- #5 ____________________                                       |
-    |                  |                                       W
-    |       LTP        |                                       A
-    |__________________|                                       I
-             |                                                 T
-             |                                                 |
-             |                                                 F
-            \|/                                                O
- #6 ____________________                                       R
-    |                  |                                       |
-    |   Time -> Freq   |                                       L
-    |__________________|                                       E
-             |                                                 F
-             |                                                 T
-             |                                                 |
-            \|/                                                C
- #7 ____________________                                       H
-    |                  |                                       A
-    |    TNS Inverse   |                                       N
-    |__________________|                                       N
-             |                                                 E
-             |                                                 L
-             |                                                 |
-            \|/                                                |
- #8 ____________________                                       |
-    |                  |                                       |
-    | Long Term Synth  |                                       |
-    |__________________|                                       |
-             |                                                 |
-             |                                                \|/
-             |                                     #9 ____________________
-             |                                        |                  |
-             |--DATA ON LEFT CHANNEL MAY BE USED----->| PNS/Intensity Rt |
-             |                                        |__________________|
-             |                                                 |
-             |                                                 |
-             |                                                \|/
-             |                                    #10 ____________________
-             W                                        |                  |
-             A                                        |       LTP        |
-             I                                        |__________________|
-             T                                                 |
-             |                                                 |
-             F                                                 |
-             O                                                \|/
-             R                                    #11 ____________________
-             |                                        |                  |
-             R                                        |   Time -> Freq   |
-             I                                        |__________________|
-             G                                                 |
-             H                                                 |
-             T                                                 |
-             |                                                \|/
-             C                                    #12 ____________________
-             H                                        |                  |
-             A                                        |    TNS Inverse   |
-             N                                        |__________________|
-             N                                                 |
-             E                                                 |
-             L                                                 |
-             |                                                \|/
-             |                                    #13 ____________________
-             |                                        |                  |
-             |                                        | Long Term Synth  |
-             |                                        |__________________|
-             |                                                 |
-             |                                                 |
-             |                                                 |
-            \|/                                               \|/
-#14 ____________________                          #18 ____________________
-    |                  |                              |                  |
-    |       TNS        |                              |       TNS        |
-    |__________________|                              |__________________|
-             |                                                 |
-             |                                                 |
-             |                                                 |
-            \|/                                               \|/
-#15 ____________________                          #19 ____________________
-    |                  |                              |                  |
-    |   qFormatNorm    |                              |   qFormatNorm    |
-    |__________________|                              |__________________|
-             |                                                 |
-             |                                                 |
-             |                                                 |
-            \|/                                               \|/
-#16 ____________________                          #20 ____________________
-    |                  |                              |                  |
-    |   Freq / Time    |                              |   Freq / Time    |
-    |__________________|                              |__________________|
-             |                                                 |
-             |                                                 |
-             |                                                 |
-            \|/                                               \|/
-#17 ____________________                          #21 ____________________
-    |                  |                              |                  |
-    |   Limit Buffer   |                              |   Limit Buffer   |
-    |__________________|                              |__________________|
-             |                                                 |
-             |                                                 |
-             |                                                 |
-            \|/                                               \|/
-#22 ______________________________________________________________________
-    |                                                                    |
-    |                           Write Output                             |
-    |____________________________________________________________________|
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- PacketVideo Document # CCC-AUD-AAC-ERS-0003
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-#include "s_tdec_int_chan.h"
-#include "s_tdec_int_file.h"
-#include "aac_mem_funcs.h"
-#include "sfb.h"                   /* Where samp_rate_info[] is declared */
-#include "e_tmp4audioobjecttype.h"
-#include "e_elementid.h"
-
-
-#include "get_adif_header.h"
-#include "get_adts_header.h"
-#include "get_audio_specific_config.h"
-#include "ibstream.h"           /* where getbits is declared */
-
-#include "huffman.h"            /* where huffdecode is declared */
-#include "get_prog_config.h"
-#include "getfill.h"
-#include "pns_left.h"
-
-#include "apply_ms_synt.h"
-#include "pns_intensity_right.h"
-#include "q_normalize.h"
-#include "long_term_prediction.h"
-#include "long_term_synthesis.h"
-#include "ltp_common_internal.h"
-#include "apply_tns.h"
-
-#include "window_block_fxp.h"
-
-#include "write_output.h"
-
-#include "pvmp4audiodecoder_api.h"   /* Where this function is declared */
-#include "get_dse.h"
-
-#include "sbr_applied.h"
-#include "sbr_open.h"
-#include "get_sbr_bitstream.h"
-#include "e_sbr_element_id.h"
-
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define LEFT (0)
-#define RIGHT (1)
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-void InitSbrSynFilterbank(bool bDownSampleSBR);
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-OSCL_EXPORT_REF Int PVMP4AudioDecodeFrame(
-    tPVMP4AudioDecoderExternal  *pExt,
-    void                        *pMem)
-{
-    Int            frameLength;      /* Helper variable */
-    Int            ch;
-    Int            id_syn_ele;
-    UInt           initialUsedBits;  /* Unsigned for C55x */
-    Int            qFormatNorm;
-    Int            qPredictedSamples;
-    Bool           leaveGetLoop;
-    MC_Info       *pMC_Info;        /* Helper pointer */
-    FrameInfo     *pFrameInfo;      /* Helper pointer */
-    tDec_Int_File *pVars;           /* Helper pointer */
-    tDec_Int_Chan *pChVars[Chans];  /* Helper pointer */
-
-    per_chan_share_w_fxpCoef *pChLeftShare;  /* Helper pointer */
-    per_chan_share_w_fxpCoef *pChRightShare; /* Helper pointer */
-
-    Int            status = MP4AUDEC_SUCCESS;
-
-
-    Bool empty_frame;
-
-#ifdef AAC_PLUS
-
-    SBRDECODER_DATA *sbrDecoderData;
-    SBR_DEC         *sbrDec;
-    SBRBITSTREAM    *sbrBitStream;
-
-#endif
-    /*
-     * Initialize "helper" pointers to existing memory.
-     */
-    pVars = (tDec_Int_File *)pMem;
-
-    pMC_Info = &pVars->mc_info;
-
-    pChVars[LEFT]  = &pVars->perChan[LEFT];
-    pChVars[RIGHT] = &pVars->perChan[RIGHT];
-
-    pChLeftShare = pChVars[LEFT]->pShareWfxpCoef;
-    pChRightShare = pChVars[RIGHT]->pShareWfxpCoef;
-
-
-#ifdef AAC_PLUS
-
-    sbrDecoderData = (SBRDECODER_DATA *) & pVars->sbrDecoderData;
-    sbrDec         = (SBR_DEC *) & pVars->sbrDec;
-    sbrBitStream   = (SBRBITSTREAM *) & pVars->sbrBitStr;
-
-#ifdef PARAMETRICSTEREO
-    sbrDecoderData->hParametricStereoDec = (HANDLE_PS_DEC) & pVars->sbrDecoderData.ParametricStereoDec;
-#endif
-
-#endif
-    /*
-     * Translate input buffer variables.
-     */
-    pVars->inputStream.pBuffer = pExt->pInputBuffer;
-
-    pVars->inputStream.inputBufferCurrentLength = (UInt)pExt->inputBufferCurrentLength;
-
-    pVars->inputStream.availableBits =
-        (UInt)(pExt->inputBufferCurrentLength << INBUF_ARRAY_INDEX_SHIFT);
-
-    initialUsedBits =
-        (UInt)((pExt->inputBufferUsedLength << INBUF_ARRAY_INDEX_SHIFT) +
-               pExt->remainderBits);
-
-    pVars->inputStream.usedBits = initialUsedBits;
-
-    if (initialUsedBits > pVars->inputStream.availableBits)
-    {
-        status = MP4AUDEC_INVALID_FRAME;
-    }
-    else if (pVars->bno == 0)
-    {
-        /*
-         * Attempt to read in ADIF format first because it is easily identified.
-         * If its not an ADIF bitstream, get_adif_header rewinds the "pointer"
-         * (actually usedBits).
-         */
-        status =
-            get_adif_header(
-                pVars,
-                &(pVars->scratch.scratch_prog_config));
-
-        byte_align(&pVars->inputStream);
-
-        if (status == SUCCESS)
-        {
-            pVars->prog_config.file_is_adts = FALSE;
-        }
-        else  /* we've tried simple audio config, adif, then it should be adts */
-        {
-            pVars->prog_config.file_is_adts = TRUE;
-        }
-    }
-    else if ((pVars->bno == 1) && (pVars->prog_config.file_is_adts == FALSE))
-    {
-
-        /*
-         * There might be an ID_END element following immediately after the
-         * AudioSpecificConfig header. This syntactic element should be read
-         * and byte_aligned before proceeds to decode "real" AAC raw data.
-         */
-        id_syn_ele = (Int)getbits(LEN_SE_ID, &pVars->inputStream) ;
-
-        if (id_syn_ele == ID_END)
-        {
-
-            byte_align(&pVars->inputStream);
-
-            pExt->inputBufferUsedLength =
-                pVars->inputStream.usedBits >> INBUF_ARRAY_INDEX_SHIFT;
-
-            pExt->remainderBits = pVars->inputStream.usedBits & INBUF_BIT_MODULO_MASK;
-
-            pVars->bno++;
-
-            return(status);
-        }
-        else
-        {
-            /*
-             * Rewind bitstream pointer so that the syntactic element can be
-             * read when decoding raw bitstream
-             */
-            pVars->inputStream.usedBits -= LEN_SE_ID;
-        }
-
-    }
-
-    if (pVars->prog_config.file_is_adts == TRUE)
-    {
-        /*
-         *  If file is adts format, let the decoder handle only on data raw
-         *  block at the time, once the last (or only) data block has been
-         *  processed, then synch on the next header
-         */
-        if (pVars->prog_config.headerless_frames)
-        {
-            pVars->prog_config.headerless_frames--;  /* raw data block counter  */
-        }
-        else
-        {
-            status =  get_adts_header(pVars,
-                                      &(pVars->syncword),
-                                      &(pVars->invoke),
-                                      3);     /*   CorrectlyReadFramesCount  */
-
-            if (status != SUCCESS)
-            {
-                status = MP4AUDEC_LOST_FRAME_SYNC;    /*  we lost track of header */
-            }
-        }
-    }
-    else
-    {
-        byte_align(&pVars->inputStream);
-    }
-
-#ifdef AAC_PLUS
-    sbrBitStream->NrElements = 0;
-    sbrBitStream->NrElementsCore = 0;
-
-#endif
-
-    /*
-     * The variable leaveGetLoop is used to signal that the following
-     * loop can be left, which retrieves audio syntatic elements until
-     * an ID_END is found, or an error occurs.
-     */
-    leaveGetLoop = FALSE;
-    empty_frame  = TRUE;
-
-    while ((leaveGetLoop == FALSE) && (status == SUCCESS))
-    {
-        /* get audio syntactic element */
-        id_syn_ele = (Int)get9_n_lessbits(LEN_SE_ID, &pVars->inputStream);
-
-        /*
-         *  As fractional frames are a possible input, check that parsing does not
-         *  go beyond the available bits before parsing the syntax.
-         */
-        if (pVars->inputStream.usedBits > pVars->inputStream.availableBits)
-        {
-            status = MP4AUDEC_INCOMPLETE_FRAME; /* possible EOF or fractional frame */
-            id_syn_ele = ID_END;           /* quit while-loop */
-        }
-
-        switch (id_syn_ele)
-        {
-            case ID_END:        /* terminator field */
-                leaveGetLoop = TRUE;
-                break;
-
-            case ID_SCE:        /* single channel */
-            case ID_CPE:        /* channel pair */
-                empty_frame = FALSE;
-                status =
-                    huffdecode(
-                        id_syn_ele,
-                        &(pVars->inputStream),
-                        pVars,
-                        pChVars);
-
-#ifdef AAC_PLUS
-                if (id_syn_ele == ID_SCE)
-                {
-                    sbrBitStream->sbrElement[sbrBitStream->NrElements].ElementID = SBR_ID_SCE;
-                }
-                else if (id_syn_ele == ID_CPE)
-                {
-                    sbrBitStream->sbrElement[sbrBitStream->NrElements].ElementID = SBR_ID_CPE;
-                }
-                sbrBitStream->NrElementsCore++;
-
-
-#endif
-
-                break;
-
-            case ID_PCE:        /* program config element */
-                /*
-                 * PCE are not accepted in the middle of a
-                 * raw_data_block. If found, a possible error may happen
-                 * If a PCE is encountered during the first 2 frames,
-                 * it will be read and accepted
-                 * if its tag matches the first, with no error checking
-                 * (inside of get_prog_config)
-                 */
-
-                if (pVars->bno <= 1)
-                {
-                    status = get_prog_config(pVars,
-                                             &(pVars->scratch.scratch_prog_config));
-                }
-                else
-                {
-                    status = MP4AUDEC_INVALID_FRAME;
-                }
-                break;
-
-            case ID_FIL:        /* fill element */
-#ifdef AAC_PLUS
-                get_sbr_bitstream(sbrBitStream, &pVars->inputStream);
-
-#else
-                getfill(&pVars->inputStream);
-#endif
-
-                break;
-
-            case ID_DSE:       /* Data Streaming element */
-                get_dse(pVars->share.data_stream_bytes,
-                        &pVars->inputStream);
-                break;
-
-            default: /* Unsupported element, including ID_LFE */
-                status = -1;  /* ERROR CODE needs to be updated */
-                break;
-
-        } /* end switch() */
-
-    } /* end while() */
-
-    byte_align(&pVars->inputStream);
-
-    /*
-     *   After parsing the first frame ( bno=0 (adif), bno=1 (raw))
-     *   verify if implicit signalling is forcing to upsample AAC with
-     *   no AAC+/eAAC+ content. If so, disable upsampling
-     */
-
-#ifdef AAC_PLUS
-    if (pVars->bno <= 1)
-    {
-        if ((pVars->mc_info.ExtendedAudioObjectType == MP4AUDIO_AAC_LC) &&
-                (!sbrBitStream->NrElements))
-        {
-            PVMP4AudioDecoderDisableAacPlus(pExt, pMem);
-        }
-    }
-#endif
-
-    /*
-     *   There might be an empty raw data block with only a
-     *   ID_END element or non audio ID_DSE, ID_FIL
-     *   This is an "illegal" condition but this trap
-     *   avoids any further processing
-     */
-
-    if (empty_frame == TRUE)
-    {
-        pExt->inputBufferUsedLength =
-            pVars->inputStream.usedBits >> INBUF_ARRAY_INDEX_SHIFT;
-
-        pExt->remainderBits = pVars->inputStream.usedBits & INBUF_BIT_MODULO_MASK;
-
-        pVars->bno++;
-
-        return(status);
-
-    }
-
-#ifdef AAC_PLUS
-
-    if (sbrBitStream->NrElements)
-    {
-        /* for every core SCE or CPE there must be an SBR element, otherwise sths. wrong */
-        if (sbrBitStream->NrElements != sbrBitStream->NrElementsCore)
-        {
-            status = MP4AUDEC_INVALID_FRAME;
-        }
-
-        if (pExt->aacPlusEnabled == false)
-        {
-            sbrBitStream->NrElements = 0;   /* disable aac processing  */
-        }
-    }
-    else
-    {
-        /*
-         *  This is AAC, but if aac+/eaac+ was declared in the stream, and there is not sbr content
-         *  something is wrong
-         */
-        if (pMC_Info->sbrPresentFlag || pMC_Info->psPresentFlag)
-        {
-            status = MP4AUDEC_INVALID_FRAME;
-        }
-    }
-#endif
-
-
-
-
-    /*
-     * Signal processing section.
-     */
-    frameLength = pVars->frameLength;
-
-    if (status == SUCCESS)
-    {
-        /*
-         *   PNS and INTENSITY STEREO and MS
-         */
-
-        pFrameInfo = pVars->winmap[pChVars[LEFT]->wnd];
-
-        pns_left(
-            pFrameInfo,
-            pChLeftShare->group,
-            pChLeftShare->cb_map,
-            pChLeftShare->factors,
-            pChLeftShare->lt_status.sfb_prediction_used,
-            pChLeftShare->lt_status.ltp_data_present,
-            pChVars[LEFT]->fxpCoef,
-            pChLeftShare->qFormat,
-            &(pVars->pns_cur_noise_state));
-
-        /*
-         * apply_ms_synt can only be ran for common windows.
-         * (where both the left and right channel share the
-         * same grouping, window length, etc.
-         *
-         * pVars->hasmask will be > 0 only if
-         * common windows are enabled for this frame.
-         */
-
-        if (pVars->hasmask > 0)
-        {
-            apply_ms_synt(
-                pFrameInfo,
-                pChLeftShare->group,
-                pVars->mask,
-                pChLeftShare->cb_map,
-                pChVars[LEFT]->fxpCoef,
-                pChVars[RIGHT]->fxpCoef,
-                pChLeftShare->qFormat,
-                pChRightShare->qFormat);
-        }
-
-        for (ch = 0; (ch < pMC_Info->nch); ch++)
-        {
-            pFrameInfo = pVars->winmap[pChVars[ch]->wnd];
-
-            /*
-             * Note: This MP4 library assumes that if there are two channels,
-             * then the second channel is right AND it was a coupled channel,
-             * therefore there is no need to check the "is_cpe" flag.
-             */
-
-            if (ch > 0)
-            {
-                pns_intensity_right(
-                    pVars->hasmask,
-                    pFrameInfo,
-                    pChRightShare->group,
-                    pVars->mask,
-                    pChRightShare->cb_map,
-                    pChLeftShare->factors,
-                    pChRightShare->factors,
-                    pChRightShare->lt_status.sfb_prediction_used,
-                    pChRightShare->lt_status.ltp_data_present,
-                    pChVars[LEFT]->fxpCoef,
-                    pChVars[RIGHT]->fxpCoef,
-                    pChLeftShare->qFormat,
-                    pChRightShare->qFormat,
-                    &(pVars->pns_cur_noise_state));
-            }
-
-            if (pChVars[ch]->pShareWfxpCoef->lt_status.ltp_data_present != FALSE)
-            {
-                /*
-                 * LTP - Long Term Prediction
-                 */
-
-                qPredictedSamples = long_term_prediction(
-                                        pChVars[ch]->wnd,
-                                        pChVars[ch]->pShareWfxpCoef->lt_status.
-                                        weight_index,
-                                        pChVars[ch]->pShareWfxpCoef->lt_status.
-                                        delay,
-                                        pChVars[ch]->ltp_buffer,
-                                        pVars->ltp_buffer_state,
-                                        pChVars[ch]->time_quant,
-                                        pVars->share.predictedSamples,      /* Scratch */
-                                        frameLength);
-
-                trans4m_time_2_freq_fxp(
-                    pVars->share.predictedSamples,
-                    pChVars[ch]->wnd,
-                    pChVars[ch]->wnd_shape_prev_bk,
-                    pChVars[ch]->wnd_shape_this_bk,
-                    &qPredictedSamples,
-                    pVars->scratch.fft);   /* scratch memory for FFT */
-
-
-                /*
-                 * To solve a potential problem where a pointer tied to
-                 * the qFormat was being incremented, a pointer to
-                 * pChVars[ch]->qFormat is passed in here rather than
-                 * the address of qPredictedSamples.
-                 *
-                 * Neither values are actually needed in the case of
-                 * inverse filtering, but the pointer was being
-                 * passed (and incremented) regardless.
-                 *
-                 * So, the solution is to pass a space of memory
-                 * that a pointer can happily point to.
-                 */
-
-                /* This is the inverse filter */
-                apply_tns(
-                    pVars->share.predictedSamples,  /* scratch re-used for each ch */
-                    pChVars[ch]->pShareWfxpCoef->qFormat,     /* Not used by the inv_filter */
-                    pFrameInfo,
-                    &(pChVars[ch]->pShareWfxpCoef->tns),
-                    TRUE,                       /* TRUE is FIR */
-                    pVars->scratch.tns_inv_filter);
-
-                /*
-                 * For the next function long_term_synthesis,
-                 * the third param win_sfb_top[], and
-                 * the tenth param coef_per_win,
-                 * are used differently that in the rest of the project. This
-                 * is because originally the ISO code was going to have
-                 * these parameters change as the "short window" changed.
-                 * These are all now the same value for each of the eight
-                 * windows.  This is why there is a [0] at the
-                 * end of each of theses parameters.
-                 * Note in particular that win_sfb_top was originally an
-                 * array of pointers to arrays, but inside long_term_synthesis
-                 * it is now a simple array.
-                 * When the rest of the project functions are changed, the
-                 * structure FrameInfo changes, and the [0]'s are removed,
-                 * this comment could go away.
-                 */
-                long_term_synthesis(
-                    pChVars[ch]->wnd,
-                    pChVars[ch]->pShareWfxpCoef->max_sfb,
-                    pFrameInfo->win_sfb_top[0], /* Look above */
-                    pChVars[ch]->pShareWfxpCoef->lt_status.win_prediction_used,
-                    pChVars[ch]->pShareWfxpCoef->lt_status.sfb_prediction_used,
-                    pChVars[ch]->fxpCoef,   /* input and output */
-                    pChVars[ch]->pShareWfxpCoef->qFormat,   /* input and output */
-                    pVars->share.predictedSamples,
-                    qPredictedSamples,       /* q format for previous aray */
-                    pFrameInfo->coef_per_win[0], /* Look above */
-                    NUM_SHORT_WINDOWS,
-                    NUM_RECONSTRUCTED_SFB);
-
-            } /* end if (pChVars[ch]->lt_status.ltp_data_present != FALSE) */
-
-        } /* for(ch) */
-
-        for (ch = 0; (ch < pMC_Info->nch); ch++)
-        {
-
-            pFrameInfo = pVars->winmap[pChVars[ch]->wnd];
-
-            /*
-             * TNS - Temporal Noise Shaping
-             */
-
-            /* This is the forward filter
-             *
-             * A special note:  Scratch memory is not used by
-             * the forward filter, but is passed in to maintain
-             * common interface for inverse and forward filter
-             */
-            apply_tns(
-                pChVars[ch]->fxpCoef,
-                pChVars[ch]->pShareWfxpCoef->qFormat,
-                pFrameInfo,
-                &(pChVars[ch]->pShareWfxpCoef->tns),
-                FALSE,                   /* FALSE is IIR */
-                pVars->scratch.tns_inv_filter);
-
-            /*
-             * Normalize the q format across all scale factor bands
-             * to one value.
-             */
-            qFormatNorm =
-                q_normalize(
-                    pChVars[ch]->pShareWfxpCoef->qFormat,
-                    pFrameInfo,
-                    pChVars[ch]->abs_max_per_window,
-                    pChVars[ch]->fxpCoef);
-
-            /*
-             *  filterbank - converts frequency coeficients to time domain.
-             */
-
-#ifdef AAC_PLUS
-            if (sbrBitStream->NrElements == 0 && pMC_Info->upsamplingFactor == 1)
-            {
-                trans4m_freq_2_time_fxp_2(
-                    pChVars[ch]->fxpCoef,
-                    pChVars[ch]->time_quant,
-                    pChVars[ch]->wnd,   /* window sequence */
-                    pChVars[ch]->wnd_shape_prev_bk,
-                    pChVars[ch]->wnd_shape_this_bk,
-                    qFormatNorm,
-                    pChVars[ch]->abs_max_per_window,
-                    pVars->scratch.fft,
-                    &pExt->pOutputBuffer[ch]);
-                /*
-                 *  Update LTP buffers if needed
-                 */
-
-                if (pVars->mc_info.audioObjectType == MP4AUDIO_LTP)
-                {
-                    Int16 * pt = &pExt->pOutputBuffer[ch];
-                    Int16 * ptr = &(pChVars[ch]->ltp_buffer[pVars->ltp_buffer_state]);
-                    Int16  x, y;
-                    for (Int32 i = HALF_LONG_WINDOW; i != 0; i--)
-                    {
-                        x = *pt;
-                        pt += 2;
-                        y = *pt;
-                        pt += 2;
-                        *(ptr++) =  x;
-                        *(ptr++) =  y;
-                    }
-                }
-            }
-            else
-            {
-                trans4m_freq_2_time_fxp_1(
-                    pChVars[ch]->fxpCoef,
-                    pChVars[ch]->time_quant,
-                    &(pChVars[ch]->ltp_buffer[pVars->ltp_buffer_state + 288]),
-                    pChVars[ch]->wnd,   /* window sequence */
-                    pChVars[ch]->wnd_shape_prev_bk,
-                    pChVars[ch]->wnd_shape_this_bk,
-                    qFormatNorm,
-                    pChVars[ch]->abs_max_per_window,
-                    pVars->scratch.fft);
-
-            }
-#else
-
-            trans4m_freq_2_time_fxp_2(
-                pChVars[ch]->fxpCoef,
-                pChVars[ch]->time_quant,
-                pChVars[ch]->wnd,   /* window sequence */
-                pChVars[ch]->wnd_shape_prev_bk,
-                pChVars[ch]->wnd_shape_this_bk,
-                qFormatNorm,
-                pChVars[ch]->abs_max_per_window,
-                pVars->scratch.fft,
-                &pExt->pOutputBuffer[ch]);
-            /*
-             *  Update LTP buffers only if needed
-             */
-
-            if (pVars->mc_info.audioObjectType == MP4AUDIO_LTP)
-            {
-                Int16 * pt = &pExt->pOutputBuffer[ch];
-                Int16 * ptr = &(pChVars[ch]->ltp_buffer[pVars->ltp_buffer_state]);
-                Int16  x, y;
-                for (Int32 i = HALF_LONG_WINDOW; i != 0; i--)
-                {
-                    x = *pt;
-                    pt += 2;
-                    y = *pt;
-                    pt += 2;
-                    *(ptr++) =  x;
-                    *(ptr++) =  y;
-                }
-
-            }
-
-
-#endif
-
-
-            /* Update the window shape */
-            pChVars[ch]->wnd_shape_prev_bk = pChVars[ch]->wnd_shape_this_bk;
-
-        } /* end for() */
-
-
-        /*
-         * Copy to the final output buffer, taking into account the desired
-         * channels from the calling environment, the actual channels, and
-         * whether the data should be interleaved or not.
-         *
-         * If the stream had only one channel, write_output will not use
-         * the right channel data.
-         *
-         */
-
-
-        /* CONSIDER USE OF DMA OPTIMIZATIONS WITHIN THE write_output FUNCTION.
-         *
-         * It is presumed that the ltp_buffer will reside in internal (fast)
-         * memory, while the pExt->pOutputBuffer will reside in external
-         * (slow) memory.
-         *
-         */
-
-
-#ifdef AAC_PLUS
-
-        if (sbrBitStream->NrElements || pMC_Info->upsamplingFactor == 2)
-        {
-
-            if (pVars->bno <= 1)   /* allows console to operate with ADIF and audio config */
-            {
-                if (sbrDec->outSampleRate == 0) /* do it only once (disregarding of signaling type) */
-                {
-                    sbr_open(samp_rate_info[pVars->mc_info.sampling_rate_idx].samp_rate,
-                             sbrDec,
-                             sbrDecoderData,
-                             pVars->mc_info.bDownSampledSbr);
-                }
-
-            }
-            pMC_Info->upsamplingFactor =
-                sbrDecoderData->SbrChannel[0].frameData.sbr_header.sampleRateMode;
-
-
-            /* reuse right aac spectrum channel  */
-            {
-                Int16 *pt_left  =  &(pChVars[LEFT ]->ltp_buffer[pVars->ltp_buffer_state]);
-                Int16 *pt_right =  &(pChVars[RIGHT]->ltp_buffer[pVars->ltp_buffer_state]);
-
-                if (sbr_applied(sbrDecoderData,
-                                sbrBitStream,
-                                pt_left,
-                                pt_right,
-                                pExt->pOutputBuffer,
-                                sbrDec,
-                                pVars,
-                                pMC_Info->nch) != SBRDEC_OK)
-                {
-                    status = MP4AUDEC_INVALID_FRAME;
-                }
-            }
-
-
-        }  /*  if( pExt->aacPlusEnabled == FALSE) */
-#endif
-
-        /*
-         * Copied mono data in both channels or just leave it as mono,
-         * according with desiredChannels (default is 2)
-         */
-
-        if (pExt->desiredChannels == 2)
-        {
-
-#if defined(AAC_PLUS)
-#if defined(PARAMETRICSTEREO)&&defined(HQ_SBR)
-            if (pMC_Info->nch != 2 && pMC_Info->psPresentFlag != 1)
-#else
-            if (pMC_Info->nch != 2)
-#endif
-#else
-            if (pMC_Info->nch != 2)
-#endif
-            {
-                /* mono */
-
-
-                Int16 * pt  = &pExt->pOutputBuffer[0];
-                Int16 * pt2 = &pExt->pOutputBuffer[1];
-                Int i;
-                if (pMC_Info->upsamplingFactor == 2)
-                {
-                    for (i = 0; i < 1024; i++)
-                    {
-                        *pt2 = *pt;
-                        pt += 2;
-                        pt2 += 2;
-                    }
-                    pt  = &pExt->pOutputBuffer_plus[0];
-                    pt2 = &pExt->pOutputBuffer_plus[1];
-
-                    for (i = 0; i < 1024; i++)
-                    {
-                        *pt2 = *pt;
-                        pt += 2;
-                        pt2 += 2;
-                    }
-                }
-                else
-                {
-                    for (i = 0; i < 1024; i++)
-                    {
-                        *pt2 = *pt;
-                        pt += 2;
-                        pt2 += 2;
-                    }
-                }
-
-            }
-
-#if defined(AAC_PLUS)
-#if defined(PARAMETRICSTEREO)&&defined(HQ_SBR)
-
-            else if (pMC_Info->psPresentFlag == 1)
-            {
-                Int32 frameSize = 0;
-                if (pExt->aacPlusEnabled == false)
-                {
-                    /*
-                     *  Decoding eaac+ when only aac is enabled, copy L into R
-                     */
-                    frameSize = 1024;
-                }
-                else if (sbrDecoderData->SbrChannel[0].syncState != SBR_ACTIVE)
-                {
-                    /*
-                     *  Decoding eaac+ when no PS data was found, copy upsampled L into R
-                     */
-                    frameSize = 2048;
-                }
-
-                Int16 * pt  = &pExt->pOutputBuffer[0];
-                Int16 * pt2 = &pExt->pOutputBuffer[1];
-                Int i;
-                for (i = 0; i < frameSize; i++)
-                {
-                    *pt2 = *pt;
-                    pt += 2;
-                    pt2 += 2;
-                }
-            }
-#endif
-#endif
-
-        }
-        else
-        {
-
-#if defined(AAC_PLUS)
-#if defined(PARAMETRICSTEREO)&&defined(HQ_SBR)
-            if (pMC_Info->nch != 2 && pMC_Info->psPresentFlag != 1)
-#else
-            if (pMC_Info->nch != 2)
-#endif
-#else
-            if (pMC_Info->nch != 2)
-#endif
-            {
-                /* mono */
-                Int16 * pt  = &pExt->pOutputBuffer[0];
-                Int16 * pt2 = &pExt->pOutputBuffer[0];
-                Int i;
-
-                if (pMC_Info->upsamplingFactor == 2)
-                {
-                    for (i = 0; i < 1024; i++)
-                    {
-                        *pt2++ = *pt;
-                        pt += 2;
-                    }
-
-                    pt  = &pExt->pOutputBuffer_plus[0];
-                    pt2 = &pExt->pOutputBuffer_plus[0];
-
-                    for (i = 0; i < 1024; i++)
-                    {
-                        *pt2++ = *pt;
-                        pt += 2;
-                    }
-                }
-                else
-                {
-                    for (i = 0; i < 1024; i++)
-                    {
-                        *pt2++ = *pt;
-                        pt += 2;
-                    }
-                }
-
-            }
-
-        }
-
-
-
-
-        /* pVars->ltp_buffer_state cycles between 0 and 1024.  The value
-         * indicates the location of the data corresponding to t == -2.
-         *
-         * | t == -2 | t == -1 |  pVars->ltp_buffer_state == 0
-         *
-         * | t == -1 | t == -2 |  pVars->ltp_buffer_state == 1024
-         *
-         */
-
-#ifdef AAC_PLUS
-        if (sbrBitStream->NrElements == 0 && pMC_Info->upsamplingFactor == 1)
-        {
-            pVars->ltp_buffer_state ^= frameLength;
-        }
-        else
-        {
-            pVars->ltp_buffer_state ^= (frameLength + 288);
-        }
-#else
-        pVars->ltp_buffer_state ^= frameLength;
-#endif
-
-
-        if (pVars->bno <= 1)
-        {
-            /*
-             * to set these values only during the second call
-             * when they change.
-             */
-            pExt->samplingRate =
-                samp_rate_info[pVars->mc_info.sampling_rate_idx].samp_rate;
-
-            pVars->mc_info.implicit_channeling = 0; /* disable flag, as this is allowed
-                                                      * only the first time
-                                                      */
-
-
-#ifdef AAC_PLUS
-
-            if (pMC_Info->upsamplingFactor == 2)
-            {
-                pExt->samplingRate *= pMC_Info->upsamplingFactor;
-                pExt->aacPlusUpsamplingFactor = pMC_Info->upsamplingFactor;
-            }
-
-#endif
-
-            pExt->extendedAudioObjectType = pMC_Info->ExtendedAudioObjectType;
-            pExt->audioObjectType = pMC_Info->audioObjectType;
-
-            pExt->encodedChannels = pMC_Info->nch;
-            pExt->frameLength = pVars->frameLength;
-        }
-
-        pVars->bno++;
-
-
-        /*
-         * Using unit analysis, the bitrate is a function of the sampling rate, bits,
-         * points in a frame
-         *
-         *     bits        samples                frame
-         *     ----  =    --------- *  bits  *   -------
-         *     sec           sec                  sample
-         *
-         * To save a divide, a shift is used. Presently only the value of
-         * 1024 is used by this library, so make it the most accurate for that
-         * value. This may need to be updated later.
-         */
-
-        pExt->bitRate = (pExt->samplingRate *
-                         (pVars->inputStream.usedBits - initialUsedBits)) >> 10;  /*  LONG_WINDOW  1024 */
-
-        pExt->bitRate >>= (pMC_Info->upsamplingFactor - 1);
-
-
-    } /* end if (status == SUCCESS) */
-
-
-    if (status != MP4AUDEC_SUCCESS)
-    {
-        /*
-         *  A non-SUCCESS decoding could be due to an error on the bitstream or
-         *  an incomplete frame. As access to the bitstream beyond frame boundaries
-         *  are not allowed, in those cases the bitstream reading routine return a 0
-         *  Zero values guarantees that the data structures are filled in with values
-         *  that eventually will signal an error (like invalid parameters) or that allow
-         *  completion of the parsing routine. Either way, the partial frame condition
-         *  is verified at this time.
-         */
-        if (pVars->prog_config.file_is_adts == TRUE)
-        {
-            status = MP4AUDEC_LOST_FRAME_SYNC;
-            pVars->prog_config.headerless_frames = 0; /* synchronization forced */
-        }
-        else
-        {
-            /*
-             *  Check if the decoding error was due to buffer overrun, if it was,
-             *  update status
-             */
-            if (pVars->inputStream.usedBits > pVars->inputStream.availableBits)
-            {
-                /* all bits were used but were not enough to complete decoding */
-                pVars->inputStream.usedBits = pVars->inputStream.availableBits;
-
-                status = MP4AUDEC_INCOMPLETE_FRAME; /* possible EOF or fractional frame */
-            }
-        }
-    }
-
-    /*
-     * Translate from units of bits back into units of words.
-     */
-
-    pExt->inputBufferUsedLength =
-        pVars->inputStream.usedBits >> INBUF_ARRAY_INDEX_SHIFT;
-
-    pExt->remainderBits = (Int)(pVars->inputStream.usedBits & INBUF_BIT_MODULO_MASK);
-
-
-
-    return (status);
-
-} /* PVMP4AudioDecoderDecodeFrame */
-
diff --git a/media/libstagefright/codecs/aacdec/pvmp4audiodecodergetmemrequirements.cpp b/media/libstagefright/codecs/aacdec/pvmp4audiodecodergetmemrequirements.cpp
deleted file mode 100644
index 7cdecd0..0000000
--- a/media/libstagefright/codecs/aacdec/pvmp4audiodecodergetmemrequirements.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: PVMP4AudioDecoderGetMemRequirements.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Copied from aac_decode_frame
-
- Description: Cleaned up.
-
- Description: (1) use UInt32 to replace size_t type
-              (2) memory of tDec_Int_File is splitted into 3 pieces,
-                  sizeof(tDec_Int_File) is only part of the total memory
-                  required. The additional memory required to decode per
-                  channel information is allocated by a DPI call outside this
-                  API
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs: None
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-    size = amount of memory needed to be allocated by the calling
-        environment.
-
- Pointers and Buffers Modified: None
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function returns the amount of internal memory needed by the library.
- Presently this is a constant value, but could later be more sophisticated
- by taking into account mono or stereo, and whether LTP is to be used.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    size = sizeof(tDec_Int_File);
-
- RETURN (size)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "s_tdec_int_file.h"
-#include "pvmp4audiodecoder_api.h" /* Where this function is declared */
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-OSCL_EXPORT_REF UInt32 PVMP4AudioDecoderGetMemRequirements(void)
-{
-    UInt32 size;
-
-    size = (UInt32) sizeof(tDec_Int_File);
-
-    return (size);
-
-} /* PVMP4AudioDecoderGetMemRequirements() */
-
diff --git a/media/libstagefright/codecs/aacdec/pvmp4audiodecoderinitlibrary.cpp b/media/libstagefright/codecs/aacdec/pvmp4audiodecoderinitlibrary.cpp
deleted file mode 100644
index 146ba0f..0000000
--- a/media/libstagefright/codecs/aacdec/pvmp4audiodecoderinitlibrary.cpp
+++ /dev/null
@@ -1,418 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: PVMP4AudioDecoderInitLibrary.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Copied from aac_decode_frame
-
- Description:  Clean up.
-
- Description:  Update per review comments
-
- Description:  Add frame_length, fix mistake in pseudo-code.
-               Change frame_length to frameLength, to matcht the API,
-               look more professional, etc.
-
- Description:
- (1) Added #include of "e_ProgConfigConst.h"
-     Previously, this function was relying on another include file
-     to include "e_ProgConfigConst.h"
-
- (2) Updated the copyright header.
-
- Description:
- (1) Modified to initialize pointers for shared memory techniques.
-
- Description: Since memory will be allocated continuously, it is initialized
-              in one spot
-
- Description: Added field aacPlusUpsamplingFactor (default == 1) to have a
-              common interface for all AAC variations
-
- Description: Added PVMP4AudioDecoderDisableAacPlus to disable sbr decoding
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pExt = pointer to the external application-program interface (API)
-           structure that a client program uses to communicate information
-           with this library. Among the items in this structure is a pointer
-           to the input and output buffers, data for handling the input buffer
-           and output information. Look in PVMP4AudioDecoder_API.h for all the
-           fields to this structure. Data type pointer to a
-           tPVMP4AudioDecoderExternal structure.
-
-   pMem =  pointer to allocated memory, of the size returned by the function
-           PVMP4AudioDecoderGetMemRequirements. This is a void pointer for
-           two reasons:
-           1) So the external program does not need all of the header files
-              for all of the fields in the structure tDec_Int_File
-           2) To hide data and the implementation of the program. Even knowing
-              how data is stored can help in reverse engineering software.
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-    status = 0 (SUCCESS). Presently there is no error checking in this
-    function.
-
- Pointers and Buffers Modified: None
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- Initializes the internal memory for the MP4 Audio Decoder library.
- Also sets relevant values for the external interface structure, clears
- the bit rate, channel count, sampling rate, and number of used buffer
- elements.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pVars = pMem;
-
-    CALL pv_memset(
-           to = pVars,
-           c  = 0,
-           n  = sizeof(tDec_Int_File))
-    MODIFYING(*pVars = 0)
-    RETURNING(nothing)
-
-    pVars->current_program = -1
-    pVars->mc_info.sampling_rate_idx = Fs_44
-    pVars->frameLength = LONG_WINDOW
-
-
-    pVars->winmap[ONLY_LONG_SEQUENCE]   = &pVars->longFrameInfo;
-    pVars->winmap[LONG_START_SEQUENCE]  = &pVars->longFrameInfo;
-    pVars->winmap[EIGHT_SHORT_SEQUENCE] = &pVars->shortFrameInfo;
-    pVars->winmap[LONG_STOP_SEQUENCE]   = &pVars->longFrameInfo;
-
-    CALL infoinit(
-        samp_rate_indx = pVars->mc_info.sampling_rate_idx,
-        ppWin_seq_info = pVars->winmap,
-        pSfbwidth128   = pVars->SFBWidth128)
-    MODIFYING(ppWinSeq_info)
-    MODIFYING(pSfbwidth128)
-    RETURNING(nothing)
-
-    pExt->bitRate = 0;
-    pExt->encodedChannels = 0;
-    pExt->samplingRate = 0;
-    pExt->inputBufferUsedLength = 0;
-
-    MODIFY(pExt)
-    MODIFY(pMem)
-    RETURN(SUCCESS)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "s_tdec_int_file.h"
-#include "e_progconfigconst.h"
-
-#include "huffman.h"               /* For the definition of infoinit        */
-#include "aac_mem_funcs.h"         /* For pv_memset                         */
-#include "pvmp4audiodecoder_api.h" /* Where this function is declared       */
-#include "s_tdec_int_chan.h"
-#include "sfb.h"                   /* samp_rate_info[] is declared here     */
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-OSCL_EXPORT_REF Int PVMP4AudioDecoderInitLibrary(
-    tPVMP4AudioDecoderExternal  *pExt,
-    void                        *pMem)
-{
-    tDec_Int_File *pVars;
-
-    pVars = (tDec_Int_File *)pMem;
-
-    /*
-     * Initialize all memory. The pointers to channel memory will be
-     * set to zero also.
-     */
-    pv_memset(
-        pVars,
-        0,
-        sizeof(tDec_Int_File));
-
-    /*
-     * Pick default values for the library.
-     */
-    pVars->perChan[0].fxpCoef = pVars->fxpCoef[0];
-    pVars->perChan[1].fxpCoef = pVars->fxpCoef[1];
-
-    /* Here, the "shared memory" pointer is set to point
-     * at the 1024th element of fxpCoef, because those spaces
-     * in memory are not used until the filterbank is called.
-     *
-     * Therefore, any variables that are only used before
-     * the filterbank can occupy this same space in memory.
-     */
-
-    pVars->perChan[0].pShareWfxpCoef = (per_chan_share_w_fxpCoef *)
-                                       & (pVars->perChan[0].fxpCoef[1024]);
-
-    pVars->perChan[1].pShareWfxpCoef = (per_chan_share_w_fxpCoef *)
-                                       & (pVars->perChan[1].fxpCoef[1024]);
-
-    /*
-     * This next line informs the function get_prog_config that no
-     * configuration has been found thus far, so it is a default
-     * configuration.
-     */
-
-    pVars->current_program = -1;
-    pVars->mc_info.sampling_rate_idx = Fs_44; /* Fs_44 = 4, 44.1kHz */
-
-    /*
-     * In the future, the frame length will change with MP4 file format.
-     * Presently this variable is used to simply the unit test for
-     * the function PVMP4AudioDecodeFrame() .. otherwise the test would
-     * have to pass around 1024 length arrays.
-     */
-    pVars->frameLength = LONG_WINDOW; /* 1024*/
-
-    /*
-     * The window types ONLY_LONG_SEQUENCE, LONG_START_SEQUENCE, and
-     * LONG_STOP_SEQUENCE share the same information. The only difference
-     * between the windows is accounted for in the "filterbank", in
-     * the function trans4m_freq_2_time_fxp()
-     */
-
-    pVars->winmap[ONLY_LONG_SEQUENCE]   /* 0 */ = &pVars->longFrameInfo;
-    pVars->winmap[LONG_START_SEQUENCE]  /* 1 */ = &pVars->longFrameInfo;
-    pVars->winmap[EIGHT_SHORT_SEQUENCE] /* 2 */ = &pVars->shortFrameInfo;
-    pVars->winmap[LONG_STOP_SEQUENCE]   /* 3 */ = &pVars->longFrameInfo;
-
-    infoinit(
-        pVars->mc_info.sampling_rate_idx,
-        (FrameInfo   **)pVars->winmap,
-        pVars->SFBWidth128);
-
-
-    /*
-     * Clear out external output values. These values are set later at the end
-     * of PVMP4AudioDecodeFrames()
-     */
-    pExt->bitRate = 0;
-    pExt->encodedChannels = 0;
-    pExt->samplingRate = 0;
-    pExt->aacPlusUpsamplingFactor = 1;  /*  Default for regular AAC */
-    pVars->aacPlusEnabled = pExt->aacPlusEnabled;
-
-
-#if defined(AAC_PLUS)
-    pVars->sbrDecoderData.setStreamType = 1;        /* Enable Lock for AAC stream type setting  */
-#endif
-
-    /*
-     * Initialize input buffer variable.
-     */
-
-    pExt->inputBufferUsedLength = 0;
-
-    return (MP4AUDEC_SUCCESS);
-
-}  /* PVMP4AudioDecoderInitLibrary */
-
-
-/*
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pExt = pointer to the external application-program interface (API)
-           structure that a client program uses to communicate information
-           with this library. Among the items in this structure is a pointer
-           to the input and output buffers, data for handling the input buffer
-           and output information. Look in PVMP4AudioDecoder_API.h for all the
-           fields to this structure. Data type pointer to a
-           tPVMP4AudioDecoderExternal structure.
-
-   pMem =  pointer to allocated memory, of the size returned by the function
-           PVMP4AudioDecoderGetMemRequirements. This is a void pointer for
-           two reasons:
-           1) So the external program does not need all of the header files
-              for all of the fields in the structure tDec_Int_File
-           2) To hide data and the implementation of the program. Even knowing
-              how data is stored can help in reverse engineering software.
-
- Local Stores/Buffers/Pointers Needed: None
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-    status = 0 (SUCCESS). Presently there is no error checking in this
-    function.
-
- Pointers and Buffers Modified: None
-
- Local Stores Modified: None
-
- Global Stores Modified: None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- Disable SBR decoding functionality and set parameters accordingly
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-OSCL_EXPORT_REF void PVMP4AudioDecoderDisableAacPlus(
-    tPVMP4AudioDecoderExternal  *pExt,
-    void                        *pMem)
-{
-    tDec_Int_File *pVars;
-
-    pVars = (tDec_Int_File *)pMem;
-
-    if ((pVars->aacPlusEnabled == true) && (pExt->aacPlusEnabled == true))
-    {
-        // disable only when makes sense
-        pVars->aacPlusEnabled = false;
-        pExt->aacPlusEnabled = false;
-
-#if defined(AAC_PLUS)
-        pVars->mc_info.upsamplingFactor = 1;
-        pVars->mc_info.psPresentFlag  = 0;
-        pVars->mc_info.sbrPresentFlag = 0;
-        pVars->prog_config.sampling_rate_idx += 3;
-        pVars->sbrDecoderData.SbrChannel[0].syncState = SBR_NOT_INITIALIZED;
-        pVars->sbrDecoderData.SbrChannel[1].syncState = SBR_NOT_INITIALIZED;
-
-
-        pExt->samplingRate = samp_rate_info[pVars->prog_config.sampling_rate_idx].samp_rate;
-        pExt->aacPlusUpsamplingFactor = 1;
-#endif
-    }
-}  /* PVMP4AudioDecoderDisableAacPlus */
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/pvmp4audiodecoderresetbuffer.cpp b/media/libstagefright/codecs/aacdec/pvmp4audiodecoderresetbuffer.cpp
deleted file mode 100644
index c10423b..0000000
--- a/media/libstagefright/codecs/aacdec/pvmp4audiodecoderresetbuffer.cpp
+++ /dev/null
@@ -1,354 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: PVMP4AudioDecoderResetBuffer.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: (1) add more comments (2) set pVars->bno = 1
-
- Description: perChan[] is an array of structures in tDec_Int_File. Made
-              corresponding changes.
-
- Who:                                         Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    pMem = void pointer to hide the internal implementation of the library
-           It is cast back to a tDec_Int_File structure. This structure
-           contains information that needs to persist between calls to
-           PVMP4AudioDecodeFrame
-           Data type void pointer, internally pointer to a tDec_Int_File
-           structure.
-
- Local Stores/Buffers/Pointers Needed: None
-           (The memory set aside in pMem performs this task)
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs: None
-
- Pointers and Buffers Modified:
-    pMem contents are modified.
-    pMem->perChan[0].time_quant[0-1023]: contents are set to zero
-    pMem->perChan[1].time_quant[0-1023]: contents are set to zero
-    pMem->bno = 1
-
- Local Stores Modified: None.
-
- Global Stores Modified: None.
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  This function is called when the same audio clip will be played again from
-  the begining. This situation happens when the "stop" button is pressed or
-  the "loop-mode" is selected on PVPlayer. Since it is the same audio clip to
-  be played again, the decoder does not need to reset the audioSpecificInfo.
-  However, the overlap-and-add buffer of the filterbank output needs to be
-  cleared, so that the decoder can re-start properly from the begining of
-  the audio. The frame number counter, pVars->bno, is set to 1 because the
-  audioSpecificInfo is decoded on pVars->bno==0
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- PacketVideo Document # CCC-AUD-AAC-ERS-0003
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3: 1999(E)
-      subclause 1.6
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_tdec_int_file.h"
-#include "pvmp4audiodecoder_api.h"   /* Where this function is declared */
-#include "aac_mem_funcs.h"
-
-#ifdef AAC_PLUS
-#include    "s_sbr_frame_data.h"
-#endif
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define LEFT  (0)
-#define RIGHT (1)
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-OSCL_EXPORT_REF void PVMP4AudioDecoderResetBuffer(void  *pMem)
-{
-
-    tDec_Int_File *pVars;           /* Helper pointer */
-
-#ifdef AAC_PLUS
-    SBR_FRAME_DATA * hFrameData_1;
-    SBR_FRAME_DATA * hFrameData_2;
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-    SBRDECODER_DATA *sbrDecoderData;
-#endif
-#endif
-
-#endif
-    /*
-     * Initialize "helper" pointers to existing memory.
-     */
-    pVars = (tDec_Int_File *)pMem;
-
-    /*
-     * Clear the overlap-and-add buffer of filterbank output. The audio
-     * clip will be played again from the beginning.
-     */
-    pv_memset(pVars->perChan[LEFT].time_quant,
-              0,
-              LONG_WINDOW*sizeof(pVars->perChan[LEFT].time_quant[0]));
-
-    pv_memset(pVars->perChan[RIGHT].time_quant,
-              0,
-              LONG_WINDOW*sizeof(pVars->perChan[RIGHT].time_quant[0]));
-
-
-#ifdef AAC_PLUS
-
-    if (!pVars->sbrDecoderData.setStreamType)  /* reset only when stream type is defined */
-    {
-        if (pVars->aacPlusEnabled == true)  /* clear buffer only if they were used */
-        {
-
-            hFrameData_1   = (SBR_FRAME_DATA *) & pVars->sbrDecoderData.SbrChannel[LEFT].frameData;
-            hFrameData_2   = (SBR_FRAME_DATA *) & pVars->sbrDecoderData.SbrChannel[RIGHT].frameData;
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-            sbrDecoderData = (SBRDECODER_DATA *) & pVars->sbrDecoderData;
-            sbrDecoderData->hParametricStereoDec = (HANDLE_PS_DEC) & pVars->sbrDecoderData.ParametricStereoDec;
-#endif
-#endif
-
-
-            pv_memset(&pVars->perChan[LEFT].ltp_buffer[0],
-                      0,
-                      288*sizeof(pVars->perChan[LEFT].ltp_buffer[0]));
-            pv_memset(&pVars->perChan[LEFT].ltp_buffer[1024 + 288],
-                      0,
-                      288*sizeof(pVars->perChan[LEFT].ltp_buffer[0]));
-            pv_memset(hFrameData_1->V,
-                      0,
-                      1152*sizeof(hFrameData_1->V[0]));
-            pv_memset(hFrameData_1->prevNoiseLevel_man,
-                      0,
-                      MAX_NUM_NOISE_VALUES*sizeof(hFrameData_1->prevNoiseLevel_man[0]));
-
-
-            pv_memset(&pVars->perChan[RIGHT].ltp_buffer[0],
-                      0,
-                      288*sizeof(pVars->perChan[RIGHT].ltp_buffer[0]));
-            pv_memset(&pVars->perChan[RIGHT].ltp_buffer[1024 + 288],
-                      0,
-                      288*sizeof(pVars->perChan[RIGHT].ltp_buffer[0]));
-            pv_memset(hFrameData_2->V,
-                      0,
-                      1152*sizeof(hFrameData_2->V[0]));
-
-            pv_memset(hFrameData_2->prevNoiseLevel_man,
-                      0,
-                      MAX_NUM_NOISE_VALUES*sizeof(hFrameData_2->prevNoiseLevel_man[0]));
-
-
-            int i;
-            for (i = 0; i < 8; i++)
-            {
-                pv_memset((void *)&hFrameData_1->codecQmfBufferReal[i],
-                          0,
-                          sizeof(**hFrameData_1->codecQmfBufferReal) << 5);
-            }
-
-
-            /* ---- */
-            pv_memset((void *)hFrameData_1->BwVectorOld,
-                      0,
-                      sizeof(*hFrameData_1->BwVectorOld)*MAX_NUM_PATCHES);
-
-#ifdef HQ_SBR
-
-            for (i = 0; i < 5; i++)
-            {
-                pv_memset((void *)&hFrameData_1->fBuffer_man[i],
-                          0,
-                          sizeof(**hFrameData_1->fBuffer_man)*64);
-                pv_memset((void *)&hFrameData_1->fBufferN_man[i],
-                          0,
-                          sizeof(**hFrameData_1->fBufferN_man)*64);
-            }
-#endif
-
-
-            /* ---- */
-
-
-
-            pv_memset((void *)hFrameData_1->HistsbrQmfBufferReal,
-                      0,
-                      sizeof(*hFrameData_1->HistsbrQmfBufferReal)*6*SBR_NUM_BANDS);
-
-#ifdef HQ_SBR
-            pv_memset((void *)hFrameData_1->HistsbrQmfBufferImag,
-                      0,
-                      sizeof(*hFrameData_1->HistsbrQmfBufferImag)*6*SBR_NUM_BANDS);
-#endif
-
-            if (pVars->sbrDec.LC_aacP_DecoderFlag == 1)  /* clear buffer only for LC decoding */
-            {
-
-                for (i = 0; i < 8; i++)
-                {
-                    pv_memset((void *)&hFrameData_2->codecQmfBufferReal[i],
-                              0,
-                              sizeof(**hFrameData_1->codecQmfBufferReal) << 5);
-                }
-
-                pv_memset((void *)hFrameData_2->HistsbrQmfBufferReal,
-                          0,
-                          sizeof(*hFrameData_2->HistsbrQmfBufferReal)*6*SBR_NUM_BANDS);
-
-
-                pv_memset((void *)hFrameData_2->BwVectorOld,
-                          0,
-                          sizeof(*hFrameData_2->BwVectorOld)*MAX_NUM_PATCHES);
-
-#ifdef HQ_SBR
-
-                for (i = 0; i < 5; i++)
-                {
-                    pv_memset((void *)&hFrameData_2->fBuffer_man[i],
-                              0,
-                              sizeof(**hFrameData_2->fBuffer_man)*64);
-                    pv_memset((void *)&hFrameData_2->fBufferN_man[i],
-                              0,
-                              sizeof(**hFrameData_2->fBufferN_man)*64);
-                }
-#endif
-
-            }
-
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-            else if (pVars->mc_info.psPresentFlag == 1)
-            {
-                for (i = 0; i < 3; i++)
-                {
-                    pv_memset(sbrDecoderData->hParametricStereoDec->hHybrid->mQmfBufferReal[i],
-                              0,
-                              HYBRID_FILTER_LENGTH_m_1*sizeof(*sbrDecoderData->hParametricStereoDec->hHybrid->mQmfBufferReal));
-                    pv_memset(sbrDecoderData->hParametricStereoDec->hHybrid->mQmfBufferImag[i],
-                              0,
-                              HYBRID_FILTER_LENGTH_m_1*sizeof(*sbrDecoderData->hParametricStereoDec->hHybrid->mQmfBufferImag));
-                }
-            }
-#endif
-#endif
-
-            /*
-             *  default to UPSAMPLING, as if the file is SBR_ACTIVE, this will be fine and will be
-             *  fixed onced the new sbr header is found
-             *  SBR headers contain SBT freq. range as well as control signals that do not require
-             *  frequent changes.
-             *  For streaming, the SBR header is sent twice per second. Also, an SBR header can be
-             *  inserted at any time, if a change of parameters is needed.
-             */
-
-            pVars->sbrDecoderData.SbrChannel[LEFT].syncState = UPSAMPLING;
-            pVars->sbrDecoderData.SbrChannel[RIGHT].syncState = UPSAMPLING;
-
-        }
-    }
-#endif      /*  #ifdef AAC_PLUS */
-
-    /* reset frame count to 1 */
-    pVars->bno = 1;
-
-    return ;
-
-} /* PVMP4AudioDecoderDecodeFrame */
-
diff --git a/media/libstagefright/codecs/aacdec/pvmp4setaudioconfig.cpp b/media/libstagefright/codecs/aacdec/pvmp4setaudioconfig.cpp
deleted file mode 100644
index d183d84..0000000
--- a/media/libstagefright/codecs/aacdec/pvmp4setaudioconfig.cpp
+++ /dev/null
@@ -1,368 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: pvmp4setaudioconfigg
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                         Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pExt = pointer to the external interface structure. See the file
-           PVMP4AudioDecoder_API.h for a description of each field.
-           Data type of pointer to a tPVMP4AudioDecoderExternal
-           structure.
-
-           pExt->pInputBuffer: pointer to input buffer containing input
-                               bitstream
-
-           pExt->inputBufferCurrentLength: number of bytes in the input buffer
-
-           pExt->inputBufferUsedLength: number of bytes already consumed in
-                                        input buffer
-
-           pExt->remainderBits: number of bits consumed in addition to
-                                pExt->inputBufferUsedLength
-
-    pMem = void pointer to hide the internal implementation of the library
-           It is cast back to a tDec_Int_File structure. This structure
-           contains information that needs to persist between calls to
-           this function, or is too big to be placed on the stack, even
-           though the data is only needed during execution of this function
-           Data type void pointer, internally pointer to a tDec_Int_File
-           structure.
-
- Local Stores/Buffers/Pointers Needed: None
-           (The memory set aside in pMem performs this task)
-
- Global Stores/Buffers/Pointers Needed: None
-
- Outputs:
-     status = 0                       if no error occurred
-              MP4AUDEC_NONRECOVERABLE if a non-recoverable error occurred
-              MP4AUDEC_RECOVERABLE    if a recoverable error occurred.
-              Presently a recoverable error does not exist, but this
-              was a requirement.
-
-
- Pointers and Buffers Modified:
-    pMem contents are modified.
-    pExt: (more detail in the file PVMP4AudioDecoder_API.h)
-    inputBufferUsedLength - number of array elements used up by the stream.
-    remainderBits - remaining bits in the next UInt32 buffer
-    samplingRate - sampling rate in samples per sec
-    encodedChannels - channels found on the file (informative)
-    frameLength - length of the frame
-
- Local Stores Modified: None.
-
- Global Stores Modified: None.
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- PacketVideo Document # CCC-AUD-AAC-ERS-0003
-
-------------------------------------------------------------------------------
- REFERENCES
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "s_tdec_int_file.h"
-#include "ibstream.h"           /* where #define INBUF_ARRAY_INDEX_SHIFT */
-#include "sfb.h"                   /* Where samp_rate_info[] is declared */
-
-#include "get_audio_specific_config.h"
-#include "pvmp4audiodecoder_api.h"   /* Where this function is declared */
-#include "set_mc_info.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int PVMP4SetAudioConfig(
-    tPVMP4AudioDecoderExternal  *pExt,
-    void                        *pMem,
-    Int                         upsamplingFactor,
-    Int                         samp_rate,
-    Int                         num_ch,
-    tMP4AudioObjectType         audioObjectType)
-
-{
-
-    tDec_Int_File *pVars;           /* Helper pointer */
-
-    Int            status = MP4AUDEC_INCOMPLETE_FRAME;
-
-    /*
-     * Initialize "helper" pointers to existing memory.
-     */
-    pVars = (tDec_Int_File *)pMem;
-    /*
-     * Translate input buffer variables.
-     */
-    pVars->inputStream.pBuffer = pExt->pInputBuffer;
-
-    pVars->inputStream.availableBits = 0;
-
-    pVars->inputStream.usedBits = 0;
-
-
-
-    /*
-     *  get sampling rate index
-     */
-
-    switch (samp_rate)
-    {
-        case 96000:
-            pVars->prog_config.sampling_rate_idx = 0;
-            break;
-        case 88200:
-            pVars->prog_config.sampling_rate_idx = 1;
-            break;
-        case 64000:
-            pVars->prog_config.sampling_rate_idx = 2;
-            break;
-        case 48000:
-            pVars->prog_config.sampling_rate_idx = 3;
-            break;
-        case 44100:
-            pVars->prog_config.sampling_rate_idx = 4;
-            break;
-        case 32000:
-            pVars->prog_config.sampling_rate_idx = 5;
-            break;
-        case 24000:
-            pVars->prog_config.sampling_rate_idx = 6;
-            break;
-        case 22050:
-            pVars->prog_config.sampling_rate_idx = 7;
-            break;
-        case 16000:
-            pVars->prog_config.sampling_rate_idx = 8;
-            break;
-        case 12000:
-            pVars->prog_config.sampling_rate_idx = 9;
-            break;
-        case 11025:
-            pVars->prog_config.sampling_rate_idx = 10;
-            break;
-        case 8000:
-            pVars->prog_config.sampling_rate_idx = 11;
-            break;
-        case 7350:
-            pVars->prog_config.sampling_rate_idx = 12;
-            break;
-        default:
-            status = -1;
-
-            break;
-    }
-
-    pVars->mc_info.sbrPresentFlag = 0;
-    pVars->mc_info.psPresentFlag = 0;
-#ifdef AAC_PLUS
-    pVars->mc_info.bDownSampledSbr = 0;
-#endif
-    pVars->mc_info.implicit_channeling = 0;
-    pVars->mc_info.nch = num_ch;
-    pVars->mc_info.upsamplingFactor = upsamplingFactor;
-
-
-    /*
-     *  Set number of channels
-     */
-
-    if (num_ch == 2)
-    {
-        pVars->prog_config.front.ele_is_cpe[0] = 1;
-    }
-    else if (num_ch == 1)
-    {
-        pVars->prog_config.front.ele_is_cpe[0] = 0;
-    }
-    else
-    {
-        status = -1; /* do not support more than two channels */
-        pVars->status = status;
-        return (status);
-    }
-
-
-    /*
-     *  Set AAC bitstream
-     */
-
-    if ((audioObjectType == MP4AUDIO_AAC_LC)        ||
-            (audioObjectType == MP4AUDIO_LTP))
-    {
-        pVars->aacPlusEnabled = false;
-
-        status = set_mc_info(&(pVars->mc_info),
-                             audioObjectType, /* previously profile */
-                             pVars->prog_config.sampling_rate_idx,
-                             pVars->prog_config.front.ele_tag[0],
-                             pVars->prog_config.front.ele_is_cpe[0],
-                             pVars->winmap, /*pVars->pWinSeqInfo,*/
-                             pVars->SFBWidth128);
-    }
-    else if ((audioObjectType == MP4AUDIO_SBR)        ||
-             (audioObjectType == MP4AUDIO_PS))
-    {
-        pVars->aacPlusEnabled = true;
-
-
-        status = set_mc_info(&(pVars->mc_info),
-                             MP4AUDIO_AAC_LC,
-                             pVars->prog_config.sampling_rate_idx,
-                             pVars->prog_config.front.ele_tag[0],
-                             pVars->prog_config.front.ele_is_cpe[0],
-                             pVars->winmap, /*pVars->pWinSeqInfo,*/
-                             pVars->SFBWidth128);
-
-        pVars->mc_info.sbrPresentFlag = 1;
-        if (audioObjectType == MP4AUDIO_PS)
-        {
-            pVars->mc_info.psPresentFlag = 1;
-        }
-
-        if (upsamplingFactor == 1)
-        {
-#ifdef AAC_PLUS
-            pVars->mc_info.bDownSampledSbr = 1;
-#endif
-
-            /*
-             *  Disable SBR decoding for any sbr-downsampled file whose SF is >= 24 KHz
-             */
-            if (pVars->prog_config.sampling_rate_idx < 6)
-            {
-                pVars->aacPlusEnabled = false;
-            }
-        }
-
-    }
-    else
-    {
-        status = -1;
-    }
-
-
-    /*
-     * Translate from units of bits back into units of words.
-     */
-    pExt->inputBufferUsedLength = 0;
-
-    pExt->remainderBits = 0;
-
-    pVars->bno++;
-
-    pExt->samplingRate = samp_rate * upsamplingFactor;
-
-    pExt->aacPlusEnabled = pVars->aacPlusEnabled;
-
-    /*
-     *  we default to 2 channel, even for mono files, (where channels have same content)
-     *  this is done to ensure support for enhanced aac+ with implicit signalling
-     */
-
-    pExt->encodedChannels = 2;
-
-    pExt->frameLength = 1024;
-#ifdef AAC_PLUS
-    pExt->aacPlusUpsamplingFactor = upsamplingFactor;
-#endif
-
-    pVars->status = status;
-
-    return (status);
-
-} /* PVMP4AudioDecoderDecodeFrame */
diff --git a/media/libstagefright/codecs/aacdec/q_normalize.cpp b/media/libstagefright/codecs/aacdec/q_normalize.cpp
deleted file mode 100644
index 5266966..0000000
--- a/media/libstagefright/codecs/aacdec/q_normalize.cpp
+++ /dev/null
@@ -1,388 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: q_normalize.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
- (1) Modify to include search over the scalefactor bands to insure
-     that the data is using all 31 data-bits.
-
- Description:
- (1) Modify to remove search over the scalefactor bands to insure
-     that the data is using all 31 data-bits.
-     (Pushed out into separate function)
- (2) Change variable "k" to more descriptive "shift_amt"
- (3) Update pseudocode to reflect removed code.
- (4) Add PV Copyright notice.
-
- Description:
- (1) Modified to protect q-normalize from shifting by amounts >= 32.
-
- Description:
- (1) Delete local variable idx_count.
-
- Description:
- (1) Included search for max in each frame, modified interface.
-
- Description:
- (1) unrolled loop based on the fact that the size of each scale band
-     is always an even number.
-
- Description:Check shift, if zero, do not shift.
-
- Description: Eliminated warning: non use variable "i" and memset function
-    definition
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    qFormat[] = Array of qFormats, one per scalefactor band. [ Int ]
-
-    pFrameInfo = Pointer to structure that holds information about each group.
-                 (long block flag, number of windows, scalefactor bands, etc.)
-                 [const FrameInfo]
-
-    coef[]    = Array of the spectral coefficients for one channel. [ Int32 ]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    min_q = The common q-format for the entire frame. [Int]
-
- Pointers and Buffers Modified:
-    coef[]    = Array of spectral data, now normalized to one q-format.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This module first scans every scalefactor band for the frame, insuring that
- at least one element in that scalefactor band is using all available bits.
- If not, the elements in the scalefactor band are shifted up to use all 31
- data bits.  The q-format is adjusted accordingly.
-
- This module then scans the q-formats for each scalefactor band.
- Upon finding the minimum q-format in the frame, the coefficients in each
- scalefactor band are normalized to the minimum q-format.
- The minimum q-format is then returned to the calling function, which is now
- the q-format for the entire frame.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    nwin = pFrameInfo->num_win;
-
-    pQformat   = &(qFormat[0]);
-    pSfbPerWin = &(pFrameInfo->sfb_per_win[0]);
-    pCoef      = &(coef[0]);
-
-    FOR (win = nwin; win > 0; win--)
-
-        nsfb = *(pSfbPerWin++);
-
-        FOR (sfb = nsfb; sfb > 0; sfb--)
-
-            IF ( *(pQformat) < min_q)
-                min_q = *(pQformat);
-            ENDIF
-
-            pQformat++;
-
-        ENDFOR
-
-    ENDFOR
-
-    pQformat   = &(qFormat[0]);
-    pSfbPerWin = &(pFrameInfo->sfb_per_win[0]);
-    pCoef      = &(coef[0]);
-
-    FOR (win = 0; win < nwin; win++)
-
-        stop_idx = 0;
-
-        nsfb   = *(pSfbPerWin++);
-
-        pWinSfbTop = &(pFrameInfo->win_sfb_top[win][0]);
-
-        FOR (sfb = nsfb; sfb > 0; sfb--)
-
-            sfbWidth  = *(pWinSfbTop++) - stop_idx;
-
-            stop_idx += sfbWidth;
-
-            k = *(pQformat++) - min_q;
-
-            IF (k < 32)
-            THEN
-                FOR (; sfbWidth > 0; sfbWidth--)
-                    *(pCoef++) >>= k;
-                ENDFOR
-            ELSE
-                FOR (; sfbWidth > 0; sfbWidth--)
-                    *(pCoef++) = 0;
-                ENDFOR
-            ENDIF
-
-        ENDFOR
-
-    ENDFOR
-
-    return min_q;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_frameinfo.h"
-#include "q_normalize.h"
-#include "aac_mem_funcs.h"         /* For pv_memset                         */
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int q_normalize(
-    Int        qFormat[],
-    const FrameInfo *pFrameInfo,
-    Int32      abs_max_per_window[],
-    Int32      coef[])
-{
-    Int    sfb;
-    Int    nsfb;
-    Int    win;
-    Int    nwin;
-    Int    sfbWidth;
-
-    Int    shift_amt;
-
-    /* Initialize min_q to a very large value */
-    Int    min_q = 1000;
-
-    Int stop_idx  = 0;
-
-    const Int   *pSfbPerWin;
-    const Int16 *pWinSfbTop;
-
-    Int   *pQformat;
-    Int32 *pCoef;
-
-    nwin = pFrameInfo->num_win;
-
-    /* Find the minimum q format */
-    pQformat   = &(qFormat[0]);
-    pSfbPerWin = &(pFrameInfo->sfb_per_win[0]);
-
-    for (win = nwin; win != 0; win--)
-    {
-
-        nsfb = *(pSfbPerWin++);
-
-        if (nsfb < 0 || nsfb > MAXBANDS)
-        {
-            break;  /* avoid any processing on error condition */
-        }
-
-        for (sfb = nsfb; sfb != 0; sfb--)
-        {
-            Int qformat = *(pQformat++);
-            if (qformat < min_q)
-            {
-                min_q = qformat;
-            }
-        }
-
-    } /* for(win) */
-
-    /* Normalize the coefs in each scalefactor band to one q-format */
-    pQformat   = &(qFormat[0]);
-    pSfbPerWin = &(pFrameInfo->sfb_per_win[0]);
-    pCoef      = &(coef[0]);
-
-    for (win = 0; win < nwin; win++)
-    {
-
-        Int32 max = 0;
-        stop_idx = 0;
-
-        nsfb   = *(pSfbPerWin++);
-
-        if (nsfb < 0 || nsfb > MAXBANDS)
-        {
-            break;  /* avoid any processing on error condition */
-        }
-
-        pWinSfbTop = &(pFrameInfo->win_sfb_top[win][0]);
-
-        for (sfb = nsfb; sfb != 0; sfb--)
-        {
-            Int tmp1, tmp2;
-            tmp1 = *(pWinSfbTop++);
-            tmp2 = *(pQformat++);
-            sfbWidth  = tmp1 - stop_idx;
-
-            if (sfbWidth < 2)
-            {
-                break;  /* will lead to error condition */
-            }
-
-            stop_idx += sfbWidth;
-
-            shift_amt = tmp2 - min_q;
-
-            if (shift_amt == 0)
-            {
-                Int32 tmp1, tmp2;
-                tmp1 = *(pCoef++);
-                tmp2 = *(pCoef++);
-                /*
-                 *  sfbWidth is always an even number
-                 *  (check tables in pg.66 IS0 14496-3)
-                 */
-                for (Int i = (sfbWidth >> 1) - 1; i != 0; i--)
-                {
-                    max  |= (tmp1 >> 31) ^ tmp1;
-                    max  |= (tmp2 >> 31) ^ tmp2;
-                    tmp1 = *(pCoef++);
-                    tmp2 = *(pCoef++);
-                }
-                max  |= (tmp1 >> 31) ^ tmp1;
-                max  |= (tmp2 >> 31) ^ tmp2;
-
-            }
-            else
-            {
-                if (shift_amt < 31)
-                {
-                    Int32 tmp1, tmp2;
-                    tmp1 = *(pCoef++) >> shift_amt;
-                    tmp2 = *(pCoef--) >> shift_amt;
-                    /*
-                     *  sfbWidth is always an even number
-                     *  (check tables in pg.66 IS0 14496-3)
-                     */
-                    for (Int i = (sfbWidth >> 1) - 1; i != 0; i--)
-                    {
-                        *(pCoef++)   = tmp1;
-                        *(pCoef++)   = tmp2;
-
-                        max  |= (tmp1 >> 31) ^ tmp1;
-                        max  |= (tmp2 >> 31) ^ tmp2;
-                        tmp1 = *(pCoef++) >> shift_amt;
-                        tmp2 = *(pCoef--) >> shift_amt;
-
-                    }
-                    *(pCoef++)   = tmp1;
-                    *(pCoef++)   = tmp2;
-                    max  |= (tmp1 >> 31) ^ tmp1;
-                    max  |= (tmp2 >> 31) ^ tmp2;
-
-                }
-                else
-                {
-                    pv_memset(pCoef, 0, sizeof(Int32)*sfbWidth);
-                    pCoef += sfbWidth;
-                }
-            }
-
-            abs_max_per_window[win] = max;
-
-        }
-
-    } /* for (win) */
-
-    return min_q;
-
-} /* normalize() */
diff --git a/media/libstagefright/codecs/aacdec/q_normalize.h b/media/libstagefright/codecs/aacdec/q_normalize.h
deleted file mode 100644
index 63a9d53..0000000
--- a/media/libstagefright/codecs/aacdec/q_normalize.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: q_normalize.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
- (1) Added PV Copyright notice.
- (2) Removed embedded TABS
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-  This file includes the function definition for q_normalize.h
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef Q_NORMALIZE_H
-#define Q_NORMALIZE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_frameinfo.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int q_normalize(
-        Int        qFormat[],
-        const FrameInfo *pFrameInfo,
-        Int32     abs_max_per_window[],
-        Int32      coef[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/qmf_filterbank_coeff.cpp b/media/libstagefright/codecs/aacdec/qmf_filterbank_coeff.cpp
deleted file mode 100644
index 1164129..0000000
--- a/media/libstagefright/codecs/aacdec/qmf_filterbank_coeff.cpp
+++ /dev/null
@@ -1,319 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: qmf_filterbank_coeff.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                              Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
- Local Stores/Buffers/Pointers Needed:
-
- Global Stores/Buffers/Pointers Needed:
-
- Outputs:
-
- Pointers and Buffers Modified:
-
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function defines the scalefactor bands for all sampling rates
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "qmf_filterbank_coeff.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-
-const Int32 sbrDecoderFilterbankCoefficients[155] =
-{
-    /*  10/9*table */
-
-    0xFFEA0066,  0x020C09CF,  0x34F67965,  0xCE380A2F,  0xFE43005A,
-    0xFFEA006C,  0x02360998,  0x36907954,  0xCFCD0A57,  0xFE690054,
-    0xFFEC0072,  0x0262095B,  0x382B7937,  0xD1600A7A,  0xFE8E004F,
-    0xFFED0078,  0x028E0919,  0x39C6790F,  0xD2F00A98,  0xFEB20049,
-    0xFFED007E,  0x02BB08D0,  0x3B6378DB,  0xD47D0AB1,  0xFED50043,
-    0xFFEC0084,  0x02E90882,  0x3D00789B,  0xD6080AC6,  0xFEF6003E,
-    0xFFEB0089,  0x0318082F,  0x3E9D7851,  0xD78F0AD6,  0xFF160039,
-    0xFFEB008F,  0x034807D5,  0x403A77FB,  0xD9130AE2,  0xFF350033,
-    0xFFEA0095,  0x03790775,  0x41D7779A,  0xDA930AEA,  0xFF53002E,
-    0xFFE9009A,  0x03AB070E,  0x4373772D,  0xDC100AED,  0xFF6F0029,
-    0xFFE800A0,  0x03DE06A2,  0x450D76B6,  0xDD890AED,  0xFF8A0024,
-    0xFFE800A5,  0x0412062F,  0x46A77633,  0xDEFD0AE9,  0xFFA40020,
-    0xFFE700AA,  0x044705B6,  0x483F75A6,  0xE06D0AE2,  0xFFBD001C,
-    0xFFE600AF,  0x047B0537,  0x49D5750E,  0xE1D90AD7,  0xFFD40017,
-    0xFFE500B3,  0x04B104B0,  0x4B69746B,  0xE3400AC8,  0xFFEB0013,
-    0xFFE400B8,  0x04E70423,  0x4CFA73BE,  0xE4A20AB7,  0x0002000F,
-    0xFFE400BC,  0x051E0390,  0x4E897306,  0xE5FF0AA2,  0x0016000B,
-    0xFFE300BF,  0x055502F6,  0x50157244,  0xE7560A8A,  0x00280008,
-    0xFFE300C3,  0x058D0254,  0x519D7178,  0xE8A80A6F,  0x003A0004,
-    0xFFE300C6,  0x05C401AD,  0x532270A2,  0xE9F50A53,  0x004A0001,
-    0xFFE200C8,  0x05FC00FE,  0x54A36FC3,  0xEB3C0A33,  0x005AFFFC,
-    0xFFE200CA,  0x06340048,  0x56206EDA,  0xEC7D0A11,  0x0068FFF9,
-    0xFFE200CC,  0x066CFF8A,  0x57986DE8,  0xEDB809EC,  0x0075FFF7,
-    0xFFE200CD,  0x06A4FEC6,  0x590C6CEC,  0xEEED09C6,  0x0081FFF4,
-    0xFFE200CE,  0x06DCFDFC,  0x5A7B6BE7,  0xF01C099E,  0x008DFFF2,
-    0xFFE200CE,  0x0713FD2B,  0x5BE56ADA,  0xF1450973,  0x0097FFF0,
-    0xFFE300CD,  0x074BFC52,  0x5D4869C4,  0xF2680947,  0x00A0FFEE,
-    0xFFE300CC,  0x0781FB73,  0x5EA668A6,  0xF384091A,  0x00A8FFEC,
-    0xFFE400CA,  0x07B7FA8D,  0x5FFF6780,  0xF49908EB,  0x00B0FFEA,
-    0xFFE400C8,  0x07EDF9A0,  0x61506652,  0xF5A808BA,  0x00B6FFE9,
-    0xFFE500C5,  0x0822F8AC,  0x629B651C,  0xF6B00888,  0x00BCFFE7
-};
-
-
-const Int32 sbrDecoderFilterbankCoefficients_down_smpl[160] =
-{
-    0x0000FFEE,  0xFFF0FFEF, 0xFFEEFFED, 0xFFEBFFEA,
-    0xFFE9FFE8,  0xFFE7FFE6, 0xFFE6FFE7, 0xFFE7FFE8,
-    0xFFEAFFED,  0xFFEFFFF3, 0xFFF7FFFB, 0x00000007,
-    0x000D0014,  0x001C0025, 0x002E0037, 0x0041004B,
-    0x00560061,  0x006B0076, 0x0080008A, 0x0094009D,
-    0x00A500AC,  0x00B200B6, 0x00B800B9, 0x00B700B3,
-    0x00AD00A3,  0x00970087, 0x0074005D, 0x00420024,
-    0x0001FFDA,  0xFFAFFF7F, 0xFF4BFF12, 0xFED5FE93,
-    0x01B301FD,  0x024C029E, 0x02F4034D, 0x03A90408,
-    0x046904CC,  0x05300595, 0x05FA065E, 0x06C10722,
-    0x078007DA,  0x08300881, 0x08CB090F, 0x094A097C,
-    0x09A409C1,  0x09D209D5, 0x09CB09B2, 0x0988094D,
-    0x090108A2,  0x082F07A8, 0x070C0659, 0x059104B1,
-    0x03B902AA,  0x01810041, 0xFEE7FD74, 0xFBE9FA45,
-    0xF887F6B2,  0xF4C4F2BF, 0xF0A4EE72, 0xEC2AE9CF,
-    0xE760E4DE,  0xE24CDFA9, 0xDCF9DA3B, 0xD772D4A0,
-    0x2E3A311B,  0x33FF36E7, 0x39CE3CB4, 0x3F964273,
-    0x45484813,  0x4AD24D84, 0x502552B4, 0x55305795,
-    0x59E35C17,  0x5E2F602B, 0x620863C4, 0x655F66D7,
-    0x682B6959,  0x6A626B43, 0x6BFC6C8C, 0x6CF46D32,
-    0x6D476D32,  0x6CF46C8C, 0x6BFC6B43, 0x6A626959,
-    0x682B66D7,  0x655F63C4, 0x6208602B, 0x5E2F5C17,
-    0x59E35795,  0x553052B4, 0x50254D84, 0x4AD24813,
-    0x45484273,  0x3F963CB4, 0x39CE36E7, 0x33FF311B,
-    0xD1C6D4A0,  0xD772DA3B, 0xDCF9DFA9, 0xE24CE4DE,
-    0xE760E9CF,  0xEC2AEE72, 0xF0A4F2BF, 0xF4C4F6B2,
-    0xF887FA45,  0xFBE9FD74, 0xFEE70041, 0x018102AA,
-    0x03B904B1,  0x05910659, 0x070C07A8, 0x082F08A2,
-    0x0901094D,  0x098809B2, 0x09CB09D5, 0x09D209C1,
-    0x09A4097C,  0x094A090F, 0x08CB0881, 0x083007DA,
-    0x07800722,  0x06C1065E, 0x05FA0595, 0x053004CC,
-    0x04690408,  0x03A9034D, 0x02F4029E, 0x024C01FD,
-    0xFE4DFE93,  0xFED5FF12, 0xFF4BFF7F, 0xFFAFFFDA,
-    0x00010024,  0x0042005D, 0x00740087, 0x009700A3,
-    0x00AD00B3,  0x00B700B9, 0x00B800B6, 0x00B200AC,
-    0x00A5009D,  0x0094008A, 0x00800076, 0x006B0061,
-    0x0056004B,  0x00410037, 0x002E0025, 0x001C0014,
-    0x000D0007,  0x0000FFFB, 0xFFF7FFF3, 0xFFEFFFED,
-    0xFFEAFFE8,  0xFFE7FFE7, 0xFFE6FFE6, 0xFFE7FFE8,
-    0xFFE9FFEA,  0xFFEBFFED, 0xFFEEFFEF, 0xFFF0FFEE
-};
-
-const Int32 sbrDecoderFilterbankCoefficients_an_filt_LC[155] =
-{
-
-    Qfmt27(-0.00079446133872F), Qfmt27(0.02197766364781F), Qfmt27(0.54254182141522F), Qfmt27(-0.47923775873194F),
-    Qfmt27(-0.01574239605130F), Qfmt27(-0.00068946163857F), Qfmt27(0.02537571195384F), Qfmt27(0.57449847577240F),
-    Qfmt27(-0.44806230039026F), Qfmt27(-0.01291535202742F), Qfmt27(-0.00071286404460F), Qfmt27(0.02892516313544F),
-    Qfmt27(0.60657315615086F), Qfmt27(-0.41729436041451F), Qfmt27(-0.01026942774868F), Qfmt27(-0.00077308974337F),
-    Qfmt27(0.03262310249845F), Qfmt27(0.63865835544980F), Qfmt27(-0.38701849746199F), Qfmt27(-0.00782586328859F),
-    Qfmt27(-0.00083027488297F), Qfmt27(0.03646915244785F), Qfmt27(0.67068416485018F), Qfmt27(-0.35729827194706F),
-    Qfmt27(-0.00557215982767F), Qfmt27(-0.00089272089703F), Qfmt27(0.04045671426315F), Qfmt27(0.70254003810627F),
-    Qfmt27(-0.32819525024294F), Qfmt27(-0.00351102841332F), Qfmt27(-0.00095851011196F), Qfmt27(0.04455021764484F),
-    Qfmt27(0.73415149000395F), Qfmt27(-0.29977591877185F), Qfmt27(-0.00163598204794F), Qfmt27(-0.00101225729839F),
-    Qfmt27(0.04873676213679F), Qfmt27(0.76545064960593F), Qfmt27(-0.27208998714049F), Qfmt27(0.00003903936539F),
-    Qfmt27(-0.00105230782648F), Qfmt27(0.05300654158217F), Qfmt27(0.79631383686511F), Qfmt27(-0.24519750285673F),
-    Qfmt27(0.00154182229475F), Qfmt27(-0.00108630976316F), Qfmt27(0.05732502937107F), Qfmt27(0.82666485395476F),
-    Qfmt27(-0.21914753347432F), Qfmt27(0.00286720203220F), Qfmt27(-0.00110794157381F), Qfmt27(0.06167350555855F),
-    Qfmt27(0.85641712130638F), Qfmt27(-0.19396671004887F), Qfmt27(0.00402297937976F), Qfmt27(-0.00110360418081F),
-    Qfmt27(0.06602157445253F), Qfmt27(0.88547343436495F), Qfmt27(-0.16971665552213F), Qfmt27(0.00500649278750F),
-    Qfmt27(-0.00109714405326F), Qfmt27(0.07034096875232F), Qfmt27(0.91376152398903F), Qfmt27(-0.14641770628514F),
-    Qfmt27(0.00583386287581F), Qfmt27(-0.00106490281247F), Qfmt27(0.07461825625751F), Qfmt27(0.94117890777861F),
-    Qfmt27(-0.12410396326951F), Qfmt27(0.00651097277313F), Qfmt27(-0.00102041023958F), Qfmt27(0.07879625324269F),
-    Qfmt27(0.96765488212662F), Qfmt27(-0.10280530739363F), Qfmt27(0.00704839655425F), Qfmt27(-0.00094051141595F),
-    Qfmt27(0.08286099010631F), Qfmt27(0.99311573680798F), Qfmt27(-0.08254839941155F), Qfmt27(0.00745513427428F),
-    Qfmt27(-0.00084090835475F), Qfmt27(0.08675566213219F), Qfmt27(1.01745066253324F), Qfmt27(-0.06332944781672F),
-    Qfmt27(0.00774335382672F), Qfmt27(-0.00072769348801F), Qfmt27(0.09046949018457F), Qfmt27(1.04060828658052F),
-    Qfmt27(-0.04518854556363F), Qfmt27(0.00790787636150F), Qfmt27(-0.00057913742435F), Qfmt27(0.09395575430420F),
-    Qfmt27(1.06251808919053F), Qfmt27(-0.02811939233087F), Qfmt27(0.00797463714114F), Qfmt27(-0.00040969484059F),
-    Qfmt27(0.09716267023308F), Qfmt27(1.08310018709600F), Qfmt27(-0.01212147193047F), Qfmt27(0.00795079915733F),
-    Qfmt27(-0.00020454902123F), Qfmt27(0.10007381188066F), Qfmt27(1.10227871198194F), Qfmt27(0.00279527795884F),
-    Qfmt27(0.00784545014643F), Qfmt27(0.00001908481202F), Qfmt27(0.10262701466139F), Qfmt27(1.12001978353403F),
-    Qfmt27(0.01663452156443F), Qfmt27(0.00766458213130F), Qfmt27(0.00028892665922F), Qfmt27(0.10479373974558F),
-    Qfmt27(1.13624787143434F), Qfmt27(0.02941522773279F), Qfmt27(0.00741912981120F), Qfmt27(0.00056943874774F),
-    Qfmt27(0.10650970405576F), Qfmt27(1.15091404672203F), Qfmt27(0.04112872592057F), Qfmt27(0.00712664923329F),
-    Qfmt27(0.00088238158168F), Qfmt27(0.10776200996423F), Qfmt27(1.16395714324633F), Qfmt27(0.05181934748033F),
-    Qfmt27(0.00677868764313F), Qfmt27(0.00121741725989F), Qfmt27(0.10848340171661F), Qfmt27(1.17535833075364F),
-    Qfmt27(0.06148559051724F), Qfmt27(0.00639363830229F), Qfmt27(0.00159101288509F), Qfmt27(0.10864412991640F),
-    Qfmt27(1.18507099110810F), Qfmt27(0.07014197759039F), Qfmt27(0.00597707038378F), Qfmt27(0.00196610899088F),
-    Qfmt27(0.10819451041273F), Qfmt27(1.19306425909871F), Qfmt27(0.07784680399703F), Qfmt27(0.00554476792518F),
-    Qfmt27(0.00238550675072F), Qfmt27(0.10709920766553F), Qfmt27(1.19929775892826F), Qfmt27(0.08459352758522F),
-    Qfmt27(0.00509233837916F), Qfmt27(0.00280596092809F), Qfmt27(0.10531144797543F), Qfmt27(1.20377455661175F),
-    Qfmt27(0.09043115226911F), Qfmt27(0.00463008004888F), Qfmt27(0.00325513071185F), Qfmt27(0.10278145526768F),
-    Qfmt27(1.20646855283790F), Qfmt27(0.09539224314440F), Qfmt27(0.00416760958657F)
-};
-
-
-
-#ifdef HQ_SBR
-
-
-const Int32 sbrDecoderFilterbankCoefficients_an_filt[155] =
-{
-    Qfmt27(-0.000561769F),   Qfmt27(+ 0.015540555F),   Qfmt27(+ 0.383635001F),   Qfmt27(-0.338872269F),   Qfmt27(-0.011131555F),
-    Qfmt27(-0.000487523F),   Qfmt27(+ 0.017943338F),   Qfmt27(+ 0.406231768F),   Qfmt27(-0.316827891F),   Qfmt27(-0.009132533F),
-    Qfmt27(-0.000504071F),   Qfmt27(+ 0.020453179F),   Qfmt27(+ 0.428911992F),   Qfmt27(-0.295071672F),   Qfmt27(-0.007261582F),
-    Qfmt27(-0.000546657F),   Qfmt27(+ 0.023068017F),   Qfmt27(+ 0.451599654F),   Qfmt27(-0.273663404F),   Qfmt27(-0.005533721F),
-    Qfmt27(-0.000587093F),   Qfmt27(+ 0.025787585F),   Qfmt27(+ 0.474245321F),   Qfmt27(-0.252648031F),   Qfmt27(-0.003940112F),
-    Qfmt27(-0.000631249F),   Qfmt27(+ 0.028607217F),   Qfmt27(+ 0.496770825F),   Qfmt27(-0.232069087F),   Qfmt27(-0.002482672F),
-    Qfmt27(-0.000677769F),   Qfmt27(+ 0.031501761F),   Qfmt27(+ 0.519123497F),   Qfmt27(-0.211973585F),   Qfmt27(-0.001156814F),
-    Qfmt27(-0.000715774F),   Qfmt27(+ 0.034462095F),   Qfmt27(+ 0.541255345F),   Qfmt27(-0.192396675F),   Qfmt27(+ 0.000027605F),
-    Qfmt27(-0.000744094F),   Qfmt27(+ 0.037481285F),   Qfmt27(+ 0.563078914F),   Qfmt27(-0.173380817F),   Qfmt27(+ 0.001090233F),
-    Qfmt27(-0.000768137F),   Qfmt27(+ 0.040534917F),   Qfmt27(+ 0.584540324F),   Qfmt27(-0.154960707F),   Qfmt27(+ 0.002027418F),
-    Qfmt27(-0.000783433F),   Qfmt27(+ 0.043609754F),   Qfmt27(+ 0.605578354F),   Qfmt27(-0.137155176F),   Qfmt27(+ 0.002844676F),
-    Qfmt27(-0.000780366F),   Qfmt27(+ 0.046684303F),   Qfmt27(+ 0.626124270F),   Qfmt27(-0.120007798F),   Qfmt27(+ 0.003540125F),
-    Qfmt27(-0.000775798F),   Qfmt27(+ 0.049738576F),   Qfmt27(+ 0.646126970F),   Qfmt27(-0.103532953F),   Qfmt27(+ 0.004125164F),
-    Qfmt27(-0.000753000F),   Qfmt27(+ 0.052763075F),   Qfmt27(+ 0.665513988F),   Qfmt27(-0.087754754F),   Qfmt27(+ 0.004603953F),
-    Qfmt27(-0.000721539F),   Qfmt27(+ 0.055717365F),   Qfmt27(+ 0.684235329F),   Qfmt27(-0.072694330F),   Qfmt27(+ 0.004983969F),
-    Qfmt27(-0.000665042F),   Qfmt27(+ 0.058591568F),   Qfmt27(+ 0.702238872F),   Qfmt27(-0.058370533F),   Qfmt27(+ 0.005271576F),
-    Qfmt27(-0.000594612F),   Qfmt27(+ 0.061345517F),   Qfmt27(+ 0.719446263F),   Qfmt27(-0.044780682F),   Qfmt27(+ 0.005475378F),
-    Qfmt27(-0.000514557F),   Qfmt27(+ 0.063971590F),   Qfmt27(+ 0.735821176F),   Qfmt27(-0.031953127F),   Qfmt27(+ 0.005591713F),
-    Qfmt27(-0.000409512F),   Qfmt27(+ 0.066436751F),   Qfmt27(+ 0.751313746F),   Qfmt27(-0.019883413F),   Qfmt27(+ 0.005638920F),
-    Qfmt27(-0.000289698F),   Qfmt27(+ 0.068704383F),   Qfmt27(+ 0.765867487F),   Qfmt27(-0.008571175F),   Qfmt27(+ 0.005622064F),
-    Qfmt27(-0.000144638F),   Qfmt27(+ 0.070762871F),   Qfmt27(+ 0.779428752F),   Qfmt27(+ 0.001976560F),   Qfmt27(+ 0.005547571F),
-    Qfmt27(+ 0.000013495F),   Qfmt27(+ 0.072568258F),   Qfmt27(+ 0.791973584F),   Qfmt27(+ 0.011762383F),   Qfmt27(+ 0.005419678F),
-    Qfmt27(+ 0.000204302F),   Qfmt27(+ 0.074100364F),   Qfmt27(+ 0.803448575F),   Qfmt27(+ 0.020799707F),   Qfmt27(+ 0.005246117F),
-    Qfmt27(+ 0.000402654F),   Qfmt27(+ 0.075313734F),   Qfmt27(+ 0.813819127F),   Qfmt27(+ 0.029082401F),   Qfmt27(+ 0.005039302F),
-    Qfmt27(+ 0.000623938F),   Qfmt27(+ 0.076199248F),   Qfmt27(+ 0.823041989F),   Qfmt27(+ 0.036641812F),   Qfmt27(+ 0.004793256F),
-    Qfmt27(+ 0.000860844F),   Qfmt27(+ 0.076709349F),   Qfmt27(+ 0.831103846F),   Qfmt27(+ 0.043476878F),   Qfmt27(+ 0.004520985F),
-    Qfmt27(+ 0.001125016F),   Qfmt27(+ 0.076823001F),   Qfmt27(+ 0.837971734F),   Qfmt27(+ 0.049597868F),   Qfmt27(+ 0.004226427F),
-    Qfmt27(+ 0.001390249F),   Qfmt27(+ 0.076505072F),   Qfmt27(+ 0.843623828F),   Qfmt27(+ 0.055046003F),   Qfmt27(+ 0.003920743F),
-    Qfmt27(+ 0.001686808F),   Qfmt27(+ 0.075730576F),   Qfmt27(+ 0.848031578F),   Qfmt27(+ 0.059816657F),   Qfmt27(+ 0.003600827F),
-    Qfmt27(+ 0.001984114F),   Qfmt27(+ 0.074466439F),   Qfmt27(+ 0.851197152F),   Qfmt27(+ 0.063944481F),   Qfmt27(+ 0.003273961F),
-    Qfmt27(+ 0.002301725F),   Qfmt27(+ 0.072677464F),   Qfmt27(+ 0.853102095F),   Qfmt27(+ 0.067452502F),   Qfmt27(+ 0.002946945F)
-};
-
-
-
-#endif  /* HQ_SBR */
-
-
-#endif  /* AAC_PLUS */
diff --git a/media/libstagefright/codecs/aacdec/qmf_filterbank_coeff.h b/media/libstagefright/codecs/aacdec/qmf_filterbank_coeff.h
deleted file mode 100644
index c8968cb..0000000
--- a/media/libstagefright/codecs/aacdec/qmf_filterbank_coeff.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: qmf_filterbank_coeff.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- this file declares the scalefactor bands for all sampling rates
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef QMF_FILTERBANK_COEFF_H
-#define QMF_FILTERBANK_COEFF_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-#define Qfmt(x)   (Int16)(x*(((Int32)1<<15)*1.11111111111111111F) + (x>=0?0.5F:-0.5F))
-
-
-#define Qfmt30(x)   (Int32)(x*((Int32)1<<30) + (x>=0?0.5F:-0.5F))
-#define Qfmt27(x)   (Int32)(x*(((Int32)1<<27)) + (x>=0?0.5F:-0.5F))
-
-extern const Int32 sbrDecoderFilterbankCoefficients[155];
-
-
-extern const Int32 sbrDecoderFilterbankCoefficients_down_smpl[160];
-extern const Int32 sbrDecoderFilterbankCoefficients_an_filt_LC[155];
-
-#ifdef HQ_SBR
-extern const Int32 sbrDecoderFilterbankCoefficients_an_filt[155];
-#endif
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_adif_header.h b/media/libstagefright/codecs/aacdec/s_adif_header.h
deleted file mode 100644
index 7fd49d3..0000000
--- a/media/libstagefright/codecs/aacdec/s_adif_header.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_ADIF_Header.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, ADIF_Header
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_ADIF_HEADER_H
-#define S_ADIF_HEADER_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_adif_const.h"
-#include "e_rawbitstreamconst.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-typedef struct
-{
-    Char    adif_id[LEN_ADIF_ID+1];
-    Int     copy_id_present;
-    Char    copy_id[LEN_COPYRT_ID+1];
-    Int     original_copy;
-    Int     home;
-    Int     bitstream_type;
-    Int32   bitrate;
-    Int     num_pce;
-    Int     prog_tags[(1<<LEN_TAG)];
-} ADIF_Header;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/s_bit_buffer.h b/media/libstagefright/codecs/aacdec/s_bit_buffer.h
deleted file mode 100644
index 9f0dbda..0000000
--- a/media/libstagefright/codecs/aacdec/s_bit_buffer.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_bit_buffer.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_BIT_BUFFER_H
-#define S_BIT_BUFFER_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    UChar *char_ptr;
-    UInt32 buffered_bits;
-    UInt32 buffer_word;
-    UInt32 nrBitsRead;
-    UInt32 bufferLen;
-}
-BIT_BUFFER;
-
-typedef BIT_BUFFER *HANDLE_BIT_BUFFER;
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_bits.h b/media/libstagefright/codecs/aacdec/s_bits.h
deleted file mode 100644
index cae69ad..0000000
--- a/media/libstagefright/codecs/aacdec/s_bits.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_BITS.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Remove unused field.
-
- Description: Change buffer type from UInt to UInt32, makes API much easier
-              to understand and describe, and getbits is faster on TI C55X
-              if the buffer is 32 bits instead of 16.
-
- Description: Change buffer type from UInt32 to UChar.
-
- Who:                                   Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, BITS
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef  S_BITS_H
-#define  S_BITS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-/*
- * Name: BITS
- * Description: Holds information for processing the input data buffer
- *    as a "stream". The data is in packed format.
- * Fields:
- *    pBuffer - pointer to the beginning of the buffer. If the data type of
- *        this changes, make sure to update the constants in ibstream.h
- *    usedBits - number of bits read thus far from the buffer. Bit 0 is
- *        the LSB of pBuffer[0].
- *    availableBits - number of bits available in the buffer.
- *    byteAlignOffset - used with ADTS in case sync word is not aligned
-                        on a boundary.
- */
-typedef struct
-{
-    UChar    *pBuffer;
-    UInt      usedBits;      /* Keep this unsigned so can go to 65536 */
-    UInt      availableBits; /* Ditto */
-    UInt      inputBufferCurrentLength; /* Ditto */
-    Int      byteAlignOffset; /* Used in ADTS.  See find_adts_syncword() */
-} BITS;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/s_ch_info.h b/media/libstagefright/codecs/aacdec/s_ch_info.h
deleted file mode 100644
index 9fd259c..0000000
--- a/media/libstagefright/codecs/aacdec/s_ch_info.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_Ch_Info.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, Ch_Info
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_CH_INFO_H
-#define S_CH_INFO_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-typedef struct
-{
-//    Int present;    /* channel present */
-    Int tag;        /* element tag */
-    Int cpe;        /* 0 if single channel, 1 if channel pair */
-//    Int common_window;  /* 1 if common window for cpe */
-//    Int ch_is_left; /* 1 if left channel of cpe */
-//    Int paired_ch;  /* index of paired channel in cpe */
-//    Int widx;       /* window element index for this channel */
-    Int is_present; /* intensity stereo is used */
-    Int ncch;       /* number of coupling channels for this ch */
-    /* #if (CChans > 0) */
-    /*    int cch[CChans];*/    /* coupling channel idx */
-    /*    int cc_dom[CChans];*/ /* coupling channel domain */
-    /*    int cc_ind[CChans];*/ /* independently switched coupling channel flag */
-    /* #endif */
-    Char *fext;     /* filename extension */
-
-} Ch_Info;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/s_crc_buffer.h b/media/libstagefright/codecs/aacdec/s_crc_buffer.h
deleted file mode 100644
index 69250e7..0000000
--- a/media/libstagefright/codecs/aacdec/s_crc_buffer.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_crc_buffer.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_CRC_BUFFER_H
-#define S_CRC_BUFFER_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    unsigned short crcState;
-    unsigned short crcMask;
-    unsigned short crcPoly;
-}
-CRC_BUFFER;
-
-typedef CRC_BUFFER *HANDLE_CRC;
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_elelist.h b/media/libstagefright/codecs/aacdec/s_elelist.h
deleted file mode 100644
index 40b2f13..0000000
--- a/media/libstagefright/codecs/aacdec/s_elelist.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_EleList.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, EleList
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_ELELIST_H
-#define S_ELELIST_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_rawbitstreamconst.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-typedef struct
-{
-    Int num_ele;
-    Int ele_is_cpe[(1<<LEN_TAG)];
-    Int ele_tag[(1<<LEN_TAG)];
-} EleList;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/s_frameinfo.h b/media/libstagefright/codecs/aacdec/s_frameinfo.h
deleted file mode 100644
index 871ae83..0000000
--- a/media/libstagefright/codecs/aacdec/s_frameinfo.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_frameinfo.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Changed name of bk_sfb_top to frame_sfb_top.
- Included "interface.h" for defintion of MAX_WIN.  This
- will hopefully be simplified when interface.h is broken up into smaller
- include files.
-
- Description: Eliminated the never used array, group_offs[8]
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, FrameInfo
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_FRAMEINFO_H
-#define S_FRAMEINFO_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_blockswitching.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-    typedef struct
-    {
-        Int     islong;                 /* true if long block */
-        Int     num_win;                /* sub-blocks (SB) per block */
-        Int     coef_per_frame;         /* coef's per block */
-        Int     sfb_per_frame;          /* sfb per block */
-        Int     coef_per_win[MAX_WIN];  /* coef's per SB */
-        Int     sfb_per_win[MAX_WIN];   /* sfb per SB */
-        Int     sectbits[MAX_WIN];
-        Int16   *win_sfb_top[MAX_WIN];  /* top coef per sfb per SB */
-        Int     *sfb_width_128;         /* sfb width for short blocks */
-
-        Int     frame_sfb_top[MAXBANDS];    /* Only used in calc_gsfb_table() -
-                                      it is simply a cum version of
-                                      the above information */
-        Int     num_groups;
-        Int     group_len[8];
-
-    } FrameInfo;
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* S_FRAMEINFO_H */
diff --git a/media/libstagefright/codecs/aacdec/s_hcb.h b/media/libstagefright/codecs/aacdec/s_hcb.h
deleted file mode 100644
index 6a64c27..0000000
--- a/media/libstagefright/codecs/aacdec/s_hcb.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_Hcb.h
-
-     Date: 05/07/2001
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Description:
- (1) LAV removed from structure definition, since it was never used.
-
- Description: Huffman tables are stored as UInt16
-
- Description: Modified the declaration of the structure so no pointers are
-              used in the structure.
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- define the structure Hcb to store Huffman codebook information,
- this structure was originally defined in all.h
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_HCB_H
-#define S_HCB_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_huffman.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-    typedef struct
-    {
-        Int     n;
-        Int     dim;
-        Int     mod;
-        Int     off;
-        Int     signed_cb;
-    } Hcb;
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* S_HCB_H */
-
diff --git a/media/libstagefright/codecs/aacdec/s_huffman.h b/media/libstagefright/codecs/aacdec/s_huffman.h
deleted file mode 100644
index 2db3dd9..0000000
--- a/media/libstagefright/codecs/aacdec/s_huffman.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_Huffman.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:   Changed "ulong" to "UInt32"
-
- Description: add helper structure to speed up decode_huff_cw
-
- Description: Remove the structure definition of Huffman
-
- Description: Added definition for SBR Huffman, used for AAC plus
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, Huffman
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_HUFFMAN_H
-#define S_HUFFMAN_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-typedef const Char(*SbrHuffman)[2];
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/s_hybrid.h b/media/libstagefright/codecs/aacdec/s_hybrid.h
deleted file mode 100644
index 3880d30..0000000
--- a/media/libstagefright/codecs/aacdec/s_hybrid.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_hybrid.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_HYBRID_H
-#define S_HYBRID_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include    "ps_constants.h"
-#include    "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define HYBRID_FILTER_LENGTH        13
-#define HYBRID_FILTER_LENGTH_m_1    12
-#define HYBRID_FILTER_DELAY         6
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef enum
-{
-
-    HYBRID_2_REAL = 2,
-    HYBRID_4_CPLX = 4,
-    HYBRID_8_CPLX = 8
-
-} HYBRID_RES;
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int32   nQmfBands;
-    Int32   *pResolution;
-    Int32   qmfBufferMove;
-
-    Int32 **mQmfBufferReal;
-    Int32 **mQmfBufferImag;
-    Int32 *mTempReal;
-    Int32 *mTempImag;
-
-
-} HYBRID;
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-
-#endif      /*  S_HYBRID_H */
diff --git a/media/libstagefright/codecs/aacdec/s_lt_pred_status.h b/media/libstagefright/codecs/aacdec/s_lt_pred_status.h
deleted file mode 100644
index 4b5b56e..0000000
--- a/media/libstagefright/codecs/aacdec/s_lt_pred_status.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: LT_PRED_STATUS.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
- (1) Merged in #defines from ltp_common.h, thereby eliminating that file.
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Description: Moved large ltp_buffer up to s_tDec_Int_Chan.h, since this
- move allowed for other elements in this structure to be shared with
- the fxpCoef array.
-
- Description: Decreased size of LTP buffers from 4096 to 3072.  The upper 1024
- elements in the LTP buffers were never touched in the code.  This saves
- 4 kilobytes in memory.
-
- Description: Decreased size of LTP buffers again from 3072 to 2048.  This
- time, I realized that 1024 elements were duplicated in the 32-bit array
- pVars->pChVars[]->time_quant.  Rather than copy this data EVERY frame
- from a 32-bit to a 16-bit LTP buffer, the data is accessed only
- when it is needed.  This saves both MIPS and memory.
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- define LT_PRED_STATUS structure for pulse data decoding.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_LT_PRED_STATUS_H
-#define S_LT_PRED_STATUS_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_blockswitching.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-    /*
-      Macro:    MAX_SHORT_WINDOWS
-      Purpose:  Number of short windows in one long window.
-      Explanation:  -  */
-#ifndef MAX_SHORT_WINDOWS
-#define MAX_SHORT_WINDOWS NSHORT
-#endif
-
-    /*
-      Macro:    MAX_SCFAC_BANDS
-      Purpose:  Maximum number of scalefactor bands in one frame.
-      Explanation:  -  */
-#ifndef MAX_SCFAC_BANDS
-#define MAX_SCFAC_BANDS MAXBANDS
-#endif
-
-    /*
-      Macro:    BLOCK_LEN_LONG
-      Purpose:  Length of one long window
-      Explanation:  -  */
-#ifndef BLOCK_LEN_LONG
-#define BLOCK_LEN_LONG LN2
-#endif
-
-
-    /*
-      Macro:    LTP_MAX_BLOCK_LEN_LONG
-      Purpose:  Informs the routine of the maximum block size used.
-      Explanation:  This is needed since the TwinVQ long window
-            is different from the AAC long window.  */
-#define LTP_MAX_BLOCK_LEN_LONG BLOCK_LEN_LONG //(2 * BLOCK_LEN_LONG) 
-
-    /*
-      Macro:    LT_BLEN
-      Purpose:  Length of the history buffer.
-      Explanation:  Has to hold 2 long windows of time domain data.  */
-#ifndef LT_BLEN
-#define LT_BLEN (2 * LTP_MAX_BLOCK_LEN_LONG)
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-    /*
-      Type:     LT_PRED_STATUS
-      Purpose:  Type of the struct holding the LTP encoding parameters.
-      Explanation:  -  */
-    typedef struct
-    {
-        Int weight_index;
-        Int win_prediction_used[MAX_SHORT_WINDOWS];
-        Int sfb_prediction_used[MAX_SCFAC_BANDS];
-        Bool ltp_data_present;
-
-        Int delay[MAX_SHORT_WINDOWS];
-    }
-    LT_PRED_STATUS;
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* S_LT_PRED_STATUS_H */
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_mc_info.h b/media/libstagefright/codecs/aacdec/s_mc_info.h
deleted file mode 100644
index 9006119..0000000
--- a/media/libstagefright/codecs/aacdec/s_mc_info.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_MC_Info.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: (1) use enum type for audioObjectType (2) update revision history
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, MC_Info
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_MC_INFO_H
-#define S_MC_INFO_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_rawbitstreamconst.h"
-#include "s_ch_info.h"
-#include "chans.h"
-#include "e_tmp4audioobjecttype.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-typedef struct
-{
-    Int nch;        /* total number of audio channels */
-    Int nfsce;      /* number of front SCE's pror to first front CPE */
-    Int nfch;       /* number of front channels */
-    Int nsch;       /* number of side channels */
-    Int nbch;       /* number of back channels */
-    Int nlch;       /* number of lfe channels */
-    Int ncch;       /* number of valid coupling channels */
-    tMP4AudioObjectType audioObjectType;    /* Should eventually be called object */
-    Int sampling_rate_idx;
-
-    Int implicit_channeling;
-    Int  upsamplingFactor;
-#ifdef AAC_PLUS
-    bool bDownSampledSbr;
-    Int HE_AAC_level;
-#endif
-    /* All AAC content should be aware of these flag */
-    /*  AAC+ content Flag */
-    Int sbrPresentFlag;
-    /*  Enhanced AAC+ content Flag */
-    Int psPresentFlag;
-    tMP4AudioObjectType ExtendedAudioObjectType;    /* Should eventually be called object */
-
-    Ch_Info ch_info[Chans];
-} MC_Info;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/s_mixdown.h b/media/libstagefright/codecs/aacdec/s_mixdown.h
deleted file mode 100644
index 7f456d5..0000000
--- a/media/libstagefright/codecs/aacdec/s_mixdown.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_MIXdown.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, MIXdown
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_MIXDOWN_H
-#define S_MIXDOWN_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int present;
-    Int ele_tag;
-    Int pseudo_enab;
-} MIXdown;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/s_patch.h b/media/libstagefright/codecs/aacdec/s_patch.h
deleted file mode 100644
index 554fc2d..0000000
--- a/media/libstagefright/codecs/aacdec/s_patch.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_patch.h
- Funtions:
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_PATCH_H
-#define S_PATCH_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define MAX_NUM_PATCHES   6
-
-#define     SBR_NUM_COLUMNS      38
-#define     SBR_NUM_BANDS        48
-#define     SBR_NUM_BANDS_OVR_4 (SBR_NUM_BANDS>>2)
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-struct PATCH
-{
-    Int32 noOfPatches;
-    Int32 targetStartBand[MAX_NUM_PATCHES];
-};
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_progconfig.h b/media/libstagefright/codecs/aacdec/s_progconfig.h
deleted file mode 100644
index e58e5fc..0000000
--- a/media/libstagefright/codecs/aacdec/s_progconfig.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_ProgConfig.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, ProgConfig
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_PROGCONFIG_H
-#define S_PROGCONFIG_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_mixdown.h"
-#include "s_elelist.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int     profile;
-    Int     sampling_rate_idx;
-    EleList front;
-    EleList side;
-    EleList back;
-    EleList lfe;
-    EleList data;
-    EleList coupling;
-    MIXdown mono_mix;
-    MIXdown stereo_mix;
-    MIXdown matrix_mix;
-
-    Char    comments[(1<<LEN_PC_COMM)+1]; /* TO BE DELETED */
-
-    Int32   buffer_fullness;    /* put this transport level info here */
-    Bool    file_is_adts;       /* For ADTS use only */
-    Int32   headerless_frames;  /* For ADTS use only */
-    Int32   frame_length;       /* For use by ADTS only */
-    Int32   CRC_absent;         /* For use by ADTS only */
-    UInt32  CRC_check;          /* For use by ADTS only */
-
-} ProgConfig;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/s_ps_dec.h b/media/libstagefright/codecs/aacdec/s_ps_dec.h
deleted file mode 100644
index 8b4391c..0000000
--- a/media/libstagefright/codecs/aacdec/s_ps_dec.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/****************************************************************************
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2003.
-
-*******************************************************************************/
-
-#ifndef S_PS_DEC_H
-#define S_PS_DEC_H
-
-
-#include "s_hybrid.h"
-#include "s_patch.h"
-
-/****************************************************************
-  Type definitions
- ****************************************************************/
-struct PS_DEC
-{
-
-    Int psDetected;
-    Int32 *R_ch_qmf_filter_history;
-    Int32 invNoSubSamples;
-
-    Int32 bForceMono;
-    UInt32 noSubSamples;
-    Int32 usb;
-    Int32 lastUsb;
-
-    Int32 bPsDataAvail;
-
-    UInt32 bEnableIid;
-    UInt32 bEnableIcc;
-
-    UInt32 bEnableExt;
-    Int32 bFineIidQ;
-
-    Int32 aIidPrevFrameIndex[NO_HI_RES_BINS];
-    Int32 aIccPrevFrameIndex[NO_HI_RES_BINS];
-
-    UInt32 freqResIid;
-    UInt32 freqResIcc;
-
-    UInt32 bFrameClass;
-    UInt32 noEnv;
-    UInt32 aEnvStartStop[MAX_NO_PS_ENV+1];
-
-    UInt32 abIidDtFlag[MAX_NO_PS_ENV];
-    UInt32 abIccDtFlag[MAX_NO_PS_ENV];
-
-    Int32   delayBufIndex;
-
-    UInt32 aDelayRBufIndexSer[NO_SERIAL_ALLPASS_LINKS];
-
-    Int32 **aaaRealDelayRBufferSerQmf[NO_SERIAL_ALLPASS_LINKS];
-    Int32 **aaaImagDelayRBufferSerQmf[NO_SERIAL_ALLPASS_LINKS];
-
-    Int32 **aaaRealDelayRBufferSerSubQmf[NO_SERIAL_ALLPASS_LINKS];
-    Int32 **aaaImagDelayRBufferSerSubQmf[NO_SERIAL_ALLPASS_LINKS];
-
-    Int32 **aaRealDelayBufferQmf;
-    Int32 **aaImagDelayBufferQmf;
-    Int32 **aaRealDelayBufferSubQmf;
-    Int32 **aaImagDelayBufferSubQmf;
-
-    Int32 *aPeakDecayFast;
-    Int32 *aPrevNrg;
-    Int32 *aPrevPeakDiff;
-
-    Int32 *mHybridRealLeft;
-    Int32 *mHybridImagLeft;
-    Int32 *mHybridRealRight;
-    Int32 *mHybridImagRight;
-
-
-    HYBRID *hHybrid;
-
-
-
-    Int32 h11Prev[NO_IID_GROUPS];
-    Int32 h12Prev[NO_IID_GROUPS];
-    Int32 h21Prev[NO_IID_GROUPS];
-    Int32 h22Prev[NO_IID_GROUPS];
-
-    Int32 H11[NO_IID_GROUPS];
-    Int32 H12[NO_IID_GROUPS];
-    Int32 H21[NO_IID_GROUPS];
-    Int32 H22[NO_IID_GROUPS];
-
-    Int32 deltaH11[NO_IID_GROUPS];
-    Int32 deltaH12[NO_IID_GROUPS];
-    Int32 deltaH21[NO_IID_GROUPS];
-    Int32 deltaH22[NO_IID_GROUPS];
-
-    Int32(*qmfBufferReal)[64];
-    Int32(*qmfBufferImag)[64];
-
-    Int32 aDelayBufIndex[NO_DELAY_CHANNELS];
-    Int32 aNoSampleDelay[NO_DELAY_CHANNELS];  /////
-    Int32 aaIidIndex[MAX_NO_PS_ENV+1][NO_HI_RES_BINS];
-    Int32 aaIccIndex[MAX_NO_PS_ENV+1][NO_HI_RES_BINS];
-
-};
-
-typedef struct PS_DEC STRUCT_PS_DEC;
-typedef struct PS_DEC * HANDLE_PS_DEC;
-
-
-
-#endif      /*  E_PS_DEC_H */
-
diff --git a/media/libstagefright/codecs/aacdec/s_pulseinfo.h b/media/libstagefright/codecs/aacdec/s_pulseinfo.h
deleted file mode 100644
index a7ced04..0000000
--- a/media/libstagefright/codecs/aacdec/s_pulseinfo.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_PulseInfo.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Comment out unused field.
-
- Description:  Fix ARM warnings, update copyright.
-
- Who:                                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- define PulseInfo structure for pulse data decoding.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_PULSEINFO_H
-#define S_PULSEINFO_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_rawbitstreamconst.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int pulse_data_present;
-    Int number_pulse;
-    Int pulse_start_sfb;
-    Int pulse_offset[NUM_PULSE_LINES];
-    Int pulse_amp[NUM_PULSE_LINES];
-} PulseInfo;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_sbr_channel.h b/media/libstagefright/codecs/aacdec/s_sbr_channel.h
deleted file mode 100644
index 99e28dd..0000000
--- a/media/libstagefright/codecs/aacdec/s_sbr_channel.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_sbr_channel.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_SBR_CHANNEL_H
-#define S_SBR_CHANNEL_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include    "s_sbr_frame_data.h"
-#include    "e_sbr_sync_state.h"
-
-#ifdef PARAMETRICSTEREO
-#include "s_ps_dec.h"
-
-#endif
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define MAXNRELEMENTS 1
-#define MAXNRSBRCHANNELS (MAXNRELEMENTS*2)
-
-#ifdef PARAMETRICSTEREO
-#define MAXNRQMFCHANNELS MAXNRSBRCHANNELS
-#else
-#define MAXNRQMFCHANNELS MAXNRSBRCHANNELS
-#endif
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int32 outFrameSize;
-    SBR_SYNC_STATE syncState;
-    SBR_FRAME_DATA frameData;
-
-} SBR_CHANNEL;
-
-typedef struct
-{
-    SBR_CHANNEL SbrChannel[MAXNRSBRCHANNELS];
-    Int32 setStreamType;
-#ifdef PARAMETRICSTEREO
-    HANDLE_PS_DEC hParametricStereoDec;
-    STRUCT_PS_DEC ParametricStereoDec;
-#endif
-
-} SBRDECODER_DATA;
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_sbr_dec.h b/media/libstagefright/codecs/aacdec/s_sbr_dec.h
deleted file mode 100644
index 810479c..0000000
--- a/media/libstagefright/codecs/aacdec/s_sbr_dec.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_sbr_dec.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_SBR_DEC_H
-#define S_SBR_DEC_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include    "s_sbr_frame_data.h"
-#include    "pv_audio_type_defs.h"
-#include    "s_patch.h"
-#include    "e_blockswitching.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int32 outSampleRate;
-    Int32 LC_aacP_DecoderFlag;  /* Low Complexity decoder flag  */
-
-    Int32 startIndexCodecQmf;
-    Int32 lowBandAddSamples;
-    Int32 noCols;
-    Int32 qmfBufLen;
-    Int32 bufWriteOffs;
-    Int32 bufReadOffs;
-
-    Int32 sbStopCodec;
-    Int   lowSubband;
-    Int   prevLowSubband;
-    Int32 highSubband;
-    Int32 noSubbands;
-
-    Int   FreqBandTable[2][MAX_FREQ_COEFFS + 1];
-    Int32 FreqBandTableNoise[MAX_NOISE_COEFFS + 1];
-    Int32 V_k_master[MAX_FREQ_COEFFS + 1];         /* Master BandTable which freqBandTable is derived from*/
-    Int32 NSfb[2];
-    Int32 NoNoiseBands;                            /* Number of noisebands */
-    Int32 Num_Master;                              /* Number of bands in V_k_master*/
-
-    struct PATCH Patch;                         /* Used by sbr_generate_high_freq */
-    /* Used by calc_sbr_envelope */
-    Int32 gateMode[4];
-    Int32 limSbc[4][12 + 1];                            /* Limiting bands */
-
-    Int32 sqrt_cache[8][4];                     /* cache memory for repeated sqrt() calculations */
-
-} SBR_DEC;
-
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_sbr_element_stream.h b/media/libstagefright/codecs/aacdec/s_sbr_element_stream.h
deleted file mode 100644
index e9b6780..0000000
--- a/media/libstagefright/codecs/aacdec/s_sbr_element_stream.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_sbr_element_stream.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_SBR_ELEMENT_STREAM_H
-#define S_SBR_ELEMENT_STREAM_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-#define MAXSBRBYTES 1024
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-typedef struct
-{
-    Int32 ElementID;
-    Int32 ExtensionType;
-    Int32 Payload;
-    UChar Data[MAXSBRBYTES];
-}
-SBR_ELEMENT_STREAM;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_sbr_frame_data.h b/media/libstagefright/codecs/aacdec/s_sbr_frame_data.h
deleted file mode 100644
index 89d1bb1..0000000
--- a/media/libstagefright/codecs/aacdec/s_sbr_frame_data.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_sbr_frame_data.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_SBR_FRAME_DATA_H
-#define S_SBR_FRAME_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_sbr_header_data.h"
-#include    "e_invf_mode.h"
-#include    "e_coupling_mode.h"
-#include    "sbr_constants.h"
-#include    "s_patch.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int32 nScaleFactors;            /* total number of scalefactors in frame */
-    Int32 nNoiseFactors;
-    Int32 crcCheckSum;
-    Int32 frameClass;
-    Int32 frameInfo[LENGTH_FRAME_INFO];
-    Int32 nSfb[2];
-    Int32 nNfb;
-    Int32 offset;
-    Int32 ampRes;
-    Int32 nNoiseFloorEnvelopes;
-    Int32 p;
-    Int32 prevEnvIsShort;
-
-    Int32 reset_flag;
-
-
-    SBR_HEADER_DATA sbr_header;
-
-
-    /* dynamic control signals */
-    Int32 domain_vec1[MAX_ENVELOPES];
-    Int32 domain_vec2[MAX_ENVELOPES];
-
-
-    INVF_MODE sbr_invf_mode[MAX_NUM_NOISE_VALUES];
-    INVF_MODE sbr_invf_mode_prev[MAX_NUM_NOISE_VALUES];
-
-    COUPLING_MODE coupling;               /*  3 possibilities: off, level, pan */
-
-
-    Int32 addHarmonics[MAX_NUM_ENVELOPE_VALUES];
-
-    /* Used by calc_sbr_envelope */
-    Int32 hFp[64];
-    Int32 harm_index;
-    Int32 phase_index;
-    Int32 sUp;
-
-    /*
-     *    envelope data
-     */
-
-    Int32 iEnvelope_man[MAX_NUM_ENVELOPE_VALUES]; /* mantissa */
-    Int32 iEnvelope_exp[MAX_NUM_ENVELOPE_VALUES]; /* exponent */
-    Int32 sfb_nrg_prev_man[MAX_FREQ_COEFFS];      /* mantissa */
-
-
-    /*
-     *    noise data
-     */
-
-    Int32 sbrNoiseFloorLevel_man[MAX_NUM_NOISE_VALUES]; /* mantissa */
-    Int32 sbrNoiseFloorLevel_exp[MAX_NUM_NOISE_VALUES]; /* exponent */
-    Int32 prevNoiseLevel_man[MAX_NUM_NOISE_VALUES]; /* mantissa */
-
-    Int32  BwVector[MAX_NUM_PATCHES];
-    Int32  BwVectorOld[MAX_NUM_PATCHES];
-    /* Both implement a pseudo circular buffer  */
-
-    /*
-     * 40 ==  Biggest of  autoCorrLength(38) + sbrDec->bufReadOffs (2)  and
-     *    sbrDec->noCols (32) + sbrDec->bufWriteOffs  (6)
-     */
-    Int32 codecQmfBufferReal[40][32];
-    Int32 *sbrQmfBufferReal;
-    Int32 HistsbrQmfBufferReal[6*SBR_NUM_BANDS];
-#ifdef HQ_SBR
-    Int32 codecQmfBufferImag[40][32];
-    Int32 *sbrQmfBufferImag;
-    Int32 HistsbrQmfBufferImag[6*SBR_NUM_BANDS];
-#endif
-    Int16  V[1152];     /* Used by calc_sbr_synfilterbank as freq. history buffer */
-
-
-    Int32 degreeAlias[64];
-
-
-#ifdef HQ_SBR
-
-    Int32 fBuffer_man[5][64];        /* smoothing history buffers */
-    Int32 fBufferN_man[5][64];
-    Int32 fBuffer_exp[5][64];        /* smoothing history buffers */
-    Int32 fBufferN_exp[5][64];
-
-    Int32 *fBuf_man[64];        /* pointer to smoothing history buffers */
-    Int32 *fBuf_exp[64];        /* pointer to smoothing history buffers */
-    Int32 *fBufN_man[64];
-    Int32 *fBufN_exp[64];
-
-
-#endif
-
-}
-SBR_FRAME_DATA;
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_sbr_header_data.h b/media/libstagefright/codecs/aacdec/s_sbr_header_data.h
deleted file mode 100644
index 7d7d746..0000000
--- a/media/libstagefright/codecs/aacdec/s_sbr_header_data.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_sbr_header_data.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_SBR_HEADER_DATA_H
-#define S_SBR_HEADER_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "e_sbr_header_status.h"
-#include    "e_sbr_master_status.h"
-#include    "e_sr_mode.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    SBR_HEADER_STATUS status;      /* the current status of the header     */
-    SBR_MASTER_STATUS masterStatus;/* status of v_k_master freq table      */
-
-    /* Changes in these variables indicates an error */
-    Int32 crcEnable;
-    SR_MODE sampleRateMode;
-    Int32 ampResolution;
-
-    /* Changes in these variables causes a reset of the decoder */
-    Int32 startFreq;
-    Int32 stopFreq;
-    Int32 xover_band;
-    Int32 freqScale;
-    Int32 alterScale;
-    Int32 noise_bands;               /* noise bands per octave, read from bitstream */
-
-    /* Helper variable*/
-    Int32 noNoiseBands;              /* actual number of noise bands to read from the bitstream */
-
-    Int32 limiterBands;
-    Int32 limiterGains;
-    Int32 interpolFreq;
-    Int32 smoothingLength;
-}
-SBR_HEADER_DATA;
-
-typedef SBR_HEADER_DATA *HANDLE_SBR_HEADER_DATA;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_sbrbitstream.h b/media/libstagefright/codecs/aacdec/s_sbrbitstream.h
deleted file mode 100644
index 609463a..0000000
--- a/media/libstagefright/codecs/aacdec/s_sbrbitstream.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: s_sbrbitstream.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_SBRBITSTREAM_H
-#define S_SBRBITSTREAM_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include    "s_sbr_element_stream.h"
-#include    "s_sbr_channel.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-typedef struct
-{
-    Int32 NrElements;
-    Int32 NrElementsCore;
-    SBR_ELEMENT_STREAM sbrElement[MAXNRELEMENTS];
-}
-SBRBITSTREAM;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_sectinfo.h b/media/libstagefright/codecs/aacdec/s_sectinfo.h
deleted file mode 100644
index 83dcc31..0000000
--- a/media/libstagefright/codecs/aacdec/s_sectinfo.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/s_SectInfo.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- defines a structre that holds the Huffman codebook index and section
- boundary information for each Frame.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_SECTINFO_H
-#define S_SECTINFO_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int   sect_cb;
-    Int   sect_end;
-} SectInfo;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/s_sr_info.h b/media/libstagefright/codecs/aacdec/s_sr_info.h
deleted file mode 100644
index 9b71003..0000000
--- a/media/libstagefright/codecs/aacdec/s_sr_info.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_SR_info.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modified the declaration of the structure so no pointers are
-              used in the structure.
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, SR_Info
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_SR_INFO_H
-#define S_SR_INFO_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int32   samp_rate;
-    Int     nsfb1024;
-    Int     nsfb128;
-} SR_Info;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/s_tdec_int_chan.h b/media/libstagefright/codecs/aacdec/s_tdec_int_chan.h
deleted file mode 100644
index f7a3602..0000000
--- a/media/libstagefright/codecs/aacdec/s_tdec_int_chan.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_tDec_Int_Chan.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Change data types of win
-
- Description: Remove wnd_shape structure.
-
- Description: Remove dependency on window_block.h, Fix header too.
-
- Description:
- Modified to utilize memory in the last 1024 elements in fxpCoef.
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Description:
- (1) Move temporary FrameInfo structure into the shared region with fxpCoef.
- (2) Add more comments detailing the size of the shared structure.
-
- Description:
- (1) Changed time_quant from 2048 Int32 buffer to 1024 Int32 buffer.
-
- Who:                                         Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, tDec_Int_Chan
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_TDEC_INT_CHAN_H
-#define S_TDEC_INT_CHAN_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_rawbitstreamconst.h"
-#include "s_tns_frame_info.h"
-#include "s_wnd_shape.h"
-#include "s_lt_pred_status.h"
-#include "s_sectinfo.h"
-#include "s_frameinfo.h"
-#include "e_window_shape.h"
-#include "e_window_sequence.h"
-#include "window_block_fxp.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /* This structure was created with the specific goal in mind of sharing memory
-     * with the last 1024 data elements in fxpCoef.
-     *
-     * The size of this structure must NOT exceed 4 kilobytes
-     * Also, the size of the fxpCoef array cannot be less than 8 kilobytes
-     *
-     * The fxpCoef array is declared as an Int32, so its size should not vary
-     * from platform to platform.
-     *
-     * The shared structure is 3,640 bytes (3.55 KB), on a 32-bit platform,
-     * which represents the worst case.
-     */
-    typedef struct
-    {
-        TNS_frame_info       tns;
-
-        FrameInfo            frameInfo;
-
-        Int                  factors[MAXBANDS];
-        Int                  cb_map[MAXBANDS];
-        Int                  group[NSHORT];
-        Int                  qFormat[MAXBANDS];
-
-        Int                  max_sfb;
-        LT_PRED_STATUS       lt_status;
-
-    } per_chan_share_w_fxpCoef;
-
-    /*
-     * This structure contains one per channel.
-     */
-    typedef struct
-    {
-#ifdef AAC_PLUS
-        Int16                ltp_buffer[LT_BLEN + 2*288]; /* LT_BLEN  = 2048 + 2*288 */
-#else
-        Int16                ltp_buffer[LT_BLEN]; /* LT_BLEN  = 2048 */
-#endif
-
-
-        Int32                time_quant[LONG_WINDOW]; /*  1024 holds overlap&add */
-
-        Int32                *fxpCoef;         /* Spectrum coeff.*/
-
-        per_chan_share_w_fxpCoef * pShareWfxpCoef;
-
-        Int32                abs_max_per_window[NUM_SHORT_WINDOWS];
-
-        WINDOW_SEQUENCE      wnd;
-
-
-        WINDOW_SHAPE         wnd_shape_prev_bk;
-        WINDOW_SHAPE         wnd_shape_this_bk;
-
-    } tDec_Int_Chan;
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* S_TDEC_INT_CHAN_H */
-
diff --git a/media/libstagefright/codecs/aacdec/s_tdec_int_file.h b/media/libstagefright/codecs/aacdec/s_tdec_int_file.h
deleted file mode 100644
index d0ffb0b..0000000
--- a/media/libstagefright/codecs/aacdec/s_tdec_int_file.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_tDec_Int_File.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Remove unneeded structure elements, clean up.
-
- Description: Remove block.h, not needed, chains in other not needed files.
-
- Description: Added declaration of scratch memory, scratchTnsDecCoefMem,
- which will be utilized by tns_decode_coef().
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Description: Per review comments...
- (1) Removed declaration of unused variable, savedMCInfo
- (2) Commented out ADTS related variables.
- (3) Slight re-wording of comment for clarity.
-
- Description:
- (1) Moved scratch_prog_config into the scratch union.
-
- Description:
- (1) Added ltp state variable.
-
- Description: Make tDec_Int_perChan an array of structures.
-              In the user applications, the malloc command will allocate a
-              continuous chunk of memory.
-
- Description:
-           (1) Added the array data_stream_bytes[] to structure tDec_Int_File.
-               This to support Data Streaming Elements (DSE).
-           (2) Updated the copyright header.
-
-
- Who:                                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, tDec_Int_Chan
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_TDEC_INT_FILE_H
-#define S_TDEC_INT_FILE_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_progconfig.h"
-#include "s_frameinfo.h"
-#include "s_mc_info.h"
-#include "s_adif_header.h"
-#include "s_tdec_int_chan.h"
-#include "s_pulseinfo.h"
-#include "s_bits.h"
-#include "s_hcb.h"
-#include "e_infoinitconst.h"
-
-#include "s_sbr_channel.h"
-#include "s_sbr_dec.h"
-#include "s_sbrbitstream.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-
-
-
-    /*
-     * Note: most of the names of the variables put into this structure were kept
-     * the same because the name is also used in called functions.
-     *
-     * bno - block number
-     *
-     */
-    typedef struct
-    {
-        UInt32         bno;
-        Int            status;  /* save the status */
-
-        bool           aacPlusEnabled;
-        bool           aacConfigUtilityEnabled;
-
-        Int            current_program;
-        Int            frameLength;
-        Int            adif_test;
-
-        BITS           inputStream;
-
-        ProgConfig     prog_config;
-
-        Int            SFBWidth128[(1<<LEN_MAX_SFBS)];
-
-        /*
-         * One of the two arrays should be deleted in the final version.
-         */
-        FrameInfo      longFrameInfo;
-        FrameInfo      shortFrameInfo;
-        FrameInfo     *winmap[NUM_WIN_SEQ];
-
-        /*
-         * Pns variables.
-         */
-        Int32          pns_cur_noise_state;
-
-        /*
-         *
-         */
-        MC_Info        mc_info;
-
-        Int            ltp_buffer_state;
-
-        /*
-         *  For eaac+, a scratch matrix is created with the rigth element ( perChan[1] is not used)
-         *  and the fxpCoef matrix. These  2 matrices are [2][38][64] == 4864 Int32
-         *    2349 coming from the perChan[1] plus 4096 coming from fxpCoef
-         */
-        tDec_Int_Chan  perChan[Chans];
-
-        Int32          fxpCoef[2][LN];         /* LN  = 2048     */
-
-
-
-#ifdef AAC_PLUS
-
-        SBRDECODER_DATA sbrDecoderData;/* allocates 2 SBR_CHANNEL, each has a SBR_FRAME_DATA */
-        SBR_DEC         sbrDec;
-        SBRBITSTREAM    sbrBitStr;
-
-#endif
-
-
-        /*
-         * If ADTS support is needed, the following variables will
-         * be required.
-         */
-        UInt32         syncword;
-        Int            invoke;
-
-        Int         mask[MAXBANDS];
-        Int         hasmask;
-
-
-        /*  SBR usage
-         *  These two unions are used for the SBR tool and used
-         *  as a single 2560 int32 continuous memory for circular
-         *  buffering the synthesis QMF's bank history
-         */
-
-        /* This union specifies memory for arrays which are used
-         * by only one function.  This is the simplest type of scratch
-         * memory to implement, since there are no worries about
-         * function interaction.
-         */
-        union scratch_memory
-        {
-            Int32  fft[LONG_WINDOW];    /* 1024, as needed by the FFT */
-            Int32  tns_inv_filter[TNS_MAX_ORDER];
-            Int32  tns_decode_coef[2*TNS_MAX_ORDER];
-            Int    huffbook_used[248];
-            Int16  tmp_spec[LN2];  /* Used in conjunction with quant_spec */
-
-            ADIF_Header    adif_header;
-
-            ProgConfig     scratch_prog_config;
-
-
-            Int32  scratch_mem[16][64];
-        } scratch;
-
-        /* This union tries to take advantage of the fact that
-         * some variables are only used before LTP, and
-         * the long array, predictedSamples, is only used after LTP.
-         */
-
-        /*
-         *  also used by the circular buffer scheme on aac+ (needs 4096 + 1152)
-         *  from scratch_mem[2] + 5248  (uses most of shared_memory).
-         *  For eaac+, shared memory is used by sbrQmfBufferReal which needs
-         *  1824 bytes
-         */
-        union shared_memory
-        {
-            Int32       predictedSamples[LONG_BLOCK1];  /* 2048 Int32 */
-
-            Char        data_stream_bytes[(1<<LEN_D_CNT)+1];
-
-            struct
-            {
-                Int16         quantSpec[LN2];
-                SectInfo    sect[MAXBANDS + 1];
-                PulseInfo   pulseInfo;
-            } a;
-
-        } share;
-
-
-    } tDec_Int_File;
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* S_TDEC_INT_FILE_H */
diff --git a/media/libstagefright/codecs/aacdec/s_tns_frame_info.h b/media/libstagefright/codecs/aacdec/s_tns_frame_info.h
deleted file mode 100644
index 61af0ac..0000000
--- a/media/libstagefright/codecs/aacdec/s_tns_frame_info.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_TNS_frame_info.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modified to eliminate triple-nested structure, which wasted
- 2 KB of memory.
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Description:
- (1) Changed hard coded size of arrays from "8" to "TNS_MAX_WIN"
- (2) Moved elements from s_TNSinfo.h up to the level of TNS_frame_info
- (3) Added Bool "tns_data_present" for future use.
- (4) Moved lpc_coef up from s_TNSfilt.h (allowed for use of smaller array.)
-
- Description:
- (1) Removed the array "coef_res", which is now a local variable on the
- stack inside get_tns.c
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, s_TNS_frame_info
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_TNS_FRAME_INFO_H
-#define S_TNS_FRAME_INFO_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_tns_const.h"
-#include "s_tnsfilt.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-    typedef struct
-    {
-        Bool tns_data_present;
-
-        /* Information about the number of filters for each window. */
-        Int n_filt[TNS_MAX_WIN];
-
-        /*
-         * Filter Information
-         *
-         * For short windows, there is a maximum of
-         * 1 filter per window (8 total)
-         *
-         * For long windows, there is a maximum of 3 filters
-         *
-         */
-        TNSfilt filt[TNS_MAX_WIN];
-
-        /*
-         * For short windows, there is a maximum of 8 filters,
-         * each of order 7 (requring 56 Ints)
-         *
-         * For long windows, there is a maximum of 3 filters,
-         * each of order 20 (requiring 60 Ints)
-         *
-         * So, 3*TNS_MAX_ORDER declares an array of sufficient
-         * size (60) for both cases.
-         */
-        Int32 lpc_coef[3*TNS_MAX_ORDER];
-
-    } TNS_frame_info;
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* S_TNS_FRAME_INFO_H */
diff --git a/media/libstagefright/codecs/aacdec/s_tnsfilt.h b/media/libstagefright/codecs/aacdec/s_tnsfilt.h
deleted file mode 100644
index c1d78af..0000000
--- a/media/libstagefright/codecs/aacdec/s_tnsfilt.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_TNSfilt.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Added lpc, start, & size, so the data from
- tns_inv_subblock can be shared with tns_decode_subblock.
-
- Description: Removed lpc to save 2KB of memory (on 32-bit machines.)
- This change requires tns_decode_coef.c to perform calculations in place.
-
- Description: Removed start & size.  start_band and stop_band can simply
- take on a new meaning after this function.  (coef index, rather than
- scalefactor band index.)
-
- Description: Had to add "start_coef" and "stop_coef" in order to preserve
- values "start_band" and "stop_band."  This required a change to
- tns_setup_filter.c also.
-
- Description: Had to add element "q_lpc" to store the q-format of the lpc
- coefficients passed via "coef."
-
- Description: Moved lpc_coef array up to the s_TNS_frame_info.h structure.
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, s_TNSfilt
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_TNSFILT_H
-#define S_TNSFILT_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_tns_const.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    typedef struct
-    {
-        Int start_band;
-        Int stop_band;
-        Int start_coef;
-        Int stop_coef;
-        UInt order;
-        Int direction;
-        Int q_lpc;
-
-    } TNSfilt;
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* S_TNSFILT_H */
diff --git a/media/libstagefright/codecs/aacdec/s_wnd_shape.h b/media/libstagefright/codecs/aacdec/s_wnd_shape.h
deleted file mode 100644
index c8a05c8..0000000
--- a/media/libstagefright/codecs/aacdec/s_wnd_shape.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: s_Wnd_Shape.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Change data type to Int
-
- Who:                                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file defines the structure, Wnd_Shape
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef S_WND_SHAPE_H
-#define S_WND_SHAPE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-typedef struct
-{
-    Int    this_bk;
-    Int    prev_bk;
-} Wnd_Shape;
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/sbr_aliasing_reduction.cpp b/media/libstagefright/codecs/aacdec/sbr_aliasing_reduction.cpp
deleted file mode 100644
index efbab7d..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_aliasing_reduction.cpp
+++ /dev/null
@@ -1,366 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_aliasing_reduction.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-
-#include    "sbr_aliasing_reduction.h"
-#include    "pv_sqrt.h"
-
-#include    "aac_mem_funcs.h"
-
-#include    "pv_div.h"
-#include    "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define Q30fmt(x)   (Int32)(x*((Int32)1<<30) + (x>=0?0.5F:-0.5F))
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-#include "pv_normalize.h"
-#include  "sbr_constants.h"
-
-/*******************************************************************************
- Functionname:  sbr_aliasing_reduction
- *******************************************************************************
- Description:
- Arguments:
-
- Return:        none
-*******************************************************************************/
-void sbr_aliasing_reduction(Int32 *degreeAlias,
-                            Int32  * nrg_gain_man,
-                            Int32  * nrg_gain_exp,
-                            Int32  * nrg_est_man,
-                            Int32  * nrg_est_exp,
-                            Int32  * dontUseTheseGainValues,
-                            Int32    noSubbands,
-                            Int32    lowSubband,
-                            Int32  sqrt_cache[][4],
-                            Int32 * groupVector)
-{
-
-    Int32 temp1;
-    Int32 est_total;
-    Int32 ref_total_man;
-    Int32 ref_total_exp;
-    Int32 tmp_q1;
-    Int32 tmp_q2;
-    Int32 tmp_q3;
-    Int32 tmp_q4;
-    Int32 bst_man;
-    Int32 bst_exp;
-    struct intg_div   quotient;
-    struct intg_sqrt  root_sq;
-    Int32 group;
-    Int32 grouping = 0;
-    Int32 index = 0;
-    Int32 noGroups;
-    Int32 k;
-
-
-    /* Calculate grouping*/
-    for (k = 0; k < noSubbands - 1; k++)
-    {
-        if (degreeAlias[k + lowSubband + 1] && dontUseTheseGainValues[k] == 0)
-        {
-            if (grouping == 0)
-            {
-                groupVector[index] = k + lowSubband;
-                grouping = 1;
-                index++;
-            }
-        }
-        else
-        {
-            if (grouping)
-            {
-                groupVector[index] = k + lowSubband;
-
-                if (! dontUseTheseGainValues[k])
-                {
-                    (groupVector[index])++;
-                }
-                grouping = 0;
-                index++;
-            }
-        }
-    }
-
-    if (grouping)
-    {
-        groupVector[index] = noSubbands + lowSubband;
-        index++;
-    }
-    noGroups = (index >> 1);
-
-
-
-    /*Calculate new gain*/
-    for (group = 0; group < noGroups; group ++)
-    {
-
-        int startGroup = groupVector[(group<<1)] - lowSubband;
-        int stopGroup  = groupVector[(group<<1)+1] - lowSubband;
-
-
-        est_total = 0;
-        ref_total_man = 0;
-
-        tmp_q1 = -100;
-        tmp_q2 = -100;
-
-        for (k = startGroup; k < stopGroup; k++)
-        {
-            if (tmp_q1 < nrg_est_exp[k])
-            {
-                tmp_q1 = nrg_est_exp[k];    /* max */
-            }
-            if (tmp_q2 < (nrg_est_exp[k] + (nrg_gain_exp[k] << 1)))
-            {
-                tmp_q2 = (nrg_est_exp[k] + (nrg_gain_exp[k] << 1));  /* max */
-            }
-        }
-
-
-        k -= startGroup;        /*  number of element used in the addition */
-        /* adjust Q format */
-        tmp_q2 += 59 - pv_normalize(k);
-
-        for (k = startGroup; k < stopGroup; k++)
-        {
-            /*
-             *  est_total += nrg_est[k]
-             *  ref_total += nrg_est[k]*nrg_gain[k]*nrg_gain[k
-             */
-            est_total += nrg_est_man[k] >> (tmp_q1 - nrg_est_exp[k]);
-
-            if (tmp_q2 - (nrg_est_exp[k] + (nrg_gain_exp[k] << 1)) < 60)
-            {
-                nrg_gain_man[k] = fxp_mul32_Q28(nrg_gain_man[k], nrg_gain_man[k]);
-                nrg_gain_exp[k] = (nrg_gain_exp[k] << 1) + 28;
-                tmp_q3          = fxp_mul32_Q28(nrg_gain_man[k], nrg_est_man[k]);
-                ref_total_man    += tmp_q3 >> (tmp_q2 - (nrg_est_exp[k] + nrg_gain_exp[k]));
-            }
-        }
-
-        ref_total_exp = tmp_q2 + 28;
-
-        pv_div(ref_total_man, est_total, &quotient);
-
-        tmp_q2 += - tmp_q1 - quotient.shift_factor - 2;
-
-
-
-        for (k = startGroup; k < stopGroup; k++)
-        {
-            Int32 alpha;
-            temp1 = k + lowSubband;
-            if (k < noSubbands - 1)
-            {
-                alpha = degreeAlias[temp1 + 1] > degreeAlias[temp1 ] ?
-                        degreeAlias[temp1 + 1] : degreeAlias[temp1 ];
-            }
-            else
-            {
-                alpha = degreeAlias[temp1];
-            }
-
-            /*
-             *  nrg_gain[k] = alpha*newGain + (1.0f-alpha)*nrg_gain[k]*nrg_gain[k];
-             */
-
-            tmp_q1 = tmp_q2 > nrg_gain_exp[k] ? tmp_q2 : nrg_gain_exp[k];
-            tmp_q1++;
-
-            tmp_q3 = fxp_mul32_Q30(alpha, quotient.quotient);
-            tmp_q4 = fxp_mul32_Q30(Q30fmt(1.0f) - alpha, nrg_gain_man[k]);
-
-            nrg_gain_man[k] = (tmp_q3 >> (tmp_q1 - tmp_q2)) +
-                              (tmp_q4 >> (tmp_q1 - nrg_gain_exp[k]));
-
-            nrg_gain_exp[k] = tmp_q1;
-        }
-
-
-        bst_exp = -100;
-
-        for (k = startGroup; k < stopGroup; k++)
-        {
-            if (bst_exp < nrg_gain_exp[k] + nrg_est_exp[k])
-            {
-                bst_exp = nrg_gain_exp[k] + nrg_est_exp[k];    /* max */
-            }
-        }
-
-        k -= startGroup;        /*  number of element used in the addition */
-
-        while (k != 0)          /*  bit guard protection depends on log2(k)  */
-        {
-            k >>= 1;
-            bst_exp++;           /*  add extra bit-overflow-guard */
-        }
-
-        bst_man = 0;
-
-        for (k = startGroup; k < stopGroup; k++)
-        {
-            tmp_q2 =  fxp_mul32_Q28(nrg_gain_man[k], nrg_est_man[k]);
-            bst_man +=  tmp_q2 >> (bst_exp - nrg_gain_exp[k] - nrg_est_exp[k]);
-        }
-
-        bst_exp += 28;  /* compensate for shift down */
-
-        if (bst_man)
-        {
-            /*
-             *  bst = ref_total / bst
-             */
-
-            pv_div(ref_total_man, bst_man, &quotient);
-            bst_exp = ref_total_exp - bst_exp - quotient.shift_factor - 30;
-            bst_man = quotient.quotient;      /*  Q30 */
-
-            for (k = startGroup; k < stopGroup; k++)
-            {
-                tmp_q1 = fxp_mul32_Q30(bst_man, nrg_gain_man[k]);
-                pv_sqrt(tmp_q1, (bst_exp + nrg_gain_exp[k] + 60), &root_sq, sqrt_cache[0]);
-                nrg_gain_man[k] = root_sq.root;
-                nrg_gain_exp[k] = root_sq.shift_factor;
-            }
-        }
-        else
-        {
-            pv_memset((void *)&nrg_gain_man[startGroup],
-                      0,
-                      (stopGroup - startGroup)*sizeof(nrg_gain_man[0]));
-
-            pv_memset((void *)&nrg_gain_exp[startGroup],
-                      0,
-                      (stopGroup - startGroup)*sizeof(nrg_gain_exp[0]));
-
-        }
-
-    }
-}
-
-#endif
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_aliasing_reduction.h b/media/libstagefright/codecs/aacdec/sbr_aliasing_reduction.h
deleted file mode 100644
index 2ce99ec..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_aliasing_reduction.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_aliasing_reduction.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_ALIASING_REDUCTION_H
-#define SBR_ALIASING_REDUCTION_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void sbr_aliasing_reduction(Int32 *degreeAlias,
-                            Int32  * nrg_gain_man,
-                            Int32  * nrg_gain_exp,
-                            Int32  * nrg_est_man,
-                            Int32  * nrg_est_exp,
-                            Int32  * dontUseTheseGainValues,
-                            Int32    noSubbands,
-                            Int32    lowSubband,
-                            Int32  sqrt_cache[][4],
-                            Int32 * groupVector);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_applied.cpp b/media/libstagefright/codecs/aacdec/sbr_applied.cpp
deleted file mode 100644
index c8b81b2..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_applied.cpp
+++ /dev/null
@@ -1,435 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Filename: sbr_applied.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    INPUT
-
-    SBRDECODER self,
-    SBRBITSTREAM * stream,
-    float *timeData,
-    int numChannels
-
-    OUTPUT
-
-    errorCode, noError if successful
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        sbr decoder processing, set up SBR decoder phase 2 in case of
-        different cotrol data
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#ifdef AAC_PLUS
-
-
-#include    "sbr_applied.h"
-#include    "sbr_read_data.h"
-
-#include    "sbr_decode_envelope.h"
-#include    "decode_noise_floorlevels.h"
-#include    "sbr_requantize_envelope_data.h"
-#include    "sbr_envelope_unmapping.h"
-#include    "sbr_dec.h"
-#include    "e_sbr_element_id.h"
-#include    "aac_mem_funcs.h"
-
-#ifdef PARAMETRICSTEREO
-#include    "ps_bstr_decoding.h"
-#include    "ps_allocate_decoder.h"
-
-#endif
-
-#include    "init_sbr_dec.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define LEFT  (0)
-#define RIGHT (1)
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-SBR_ERROR  sbr_applied(SBRDECODER_DATA * self,
-                       SBRBITSTREAM * stream,
-                       Int16 *ch_left,
-                       Int16 *ch_right,
-                       Int16 *timeData,
-                       SBR_DEC *sbrDec,
-                       tDec_Int_File  *pVars,
-                       Int32 numChannels)
-{
-    SBR_ERROR err = SBRDEC_OK ;
-
-    Int32 eleChannels = 0;
-
-    SBR_CHANNEL *SbrChannel = self->SbrChannel;
-
-    /* Get SBR or PS Data only when available */
-    if (stream->NrElements)
-    {
-        /* read frame data from bitstream */
-
-        err = sbr_read_data(self,
-                            sbrDec,
-                            stream);
-
-        if (err != SBRDEC_OK)
-        {
-            /*
-             * This error condition disables any further SBR processing
-             */
-            self->SbrChannel[LEFT].syncState = UPSAMPLING;
-            if (eleChannels == 2)
-            {
-                self->SbrChannel[RIGHT].syncState = UPSAMPLING;
-            }
-        }
-
-        /*
-         *  Setting bistream and decoding type is only done once,
-         */
-        if (SbrChannel[LEFT].syncState == SBR_ACTIVE && self->setStreamType)
-        {
-            self->setStreamType = 0;  /* Disable Lock for AAC stream type setting  */
-
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-
-            Int sbrEnablePS = self->hParametricStereoDec->psDetected;
-
-            pVars->mc_info.psPresentFlag  = sbrEnablePS;
-
-            if (sbrEnablePS)   /* Initialize PS arrays */
-            {
-                pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_PS;
-                ps_allocate_decoder(self, 32);
-
-                /* Disable LC (or Enable HQ)  if PS is detected */
-                sbrDec->LC_aacP_DecoderFlag = OFF;
-            }
-            else
-            {
-                /*
-                 *  Do not downgrade stream type from eaac+, if it has been explicitly declared
-                 */
-                if (pVars->mc_info.ExtendedAudioObjectType != MP4AUDIO_PS)
-                {
-                    pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR;
-
-                    if (pVars->mc_info.nch > 1)
-                    {
-                        sbrDec->LC_aacP_DecoderFlag = ON;    /* Enable LC for stereo */
-                    }
-                    else
-                    {
-                        sbrDec->LC_aacP_DecoderFlag = OFF;    /* Disable LC, Enable HQ for mono */
-                    }
-                }
-                else
-                {
-                    sbrEnablePS = 1;  /* Force this condition as it was explicititly declared */
-                    pVars->mc_info.psPresentFlag  = sbrEnablePS;
-
-                }
-            }
-#else
-
-            pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR;
-
-            if (pVars->mc_info.nch > 1)
-            {
-                sbrDec->LC_aacP_DecoderFlag = ON;    /* Enable LC for stereo */
-            }
-            else
-            {
-                sbrDec->LC_aacP_DecoderFlag = OFF;    /* Disable LC, Enable HQ for mono */
-            }
-#endif
-
-#else
-            pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR;
-
-            sbrDec->LC_aacP_DecoderFlag = ON;       /* Enable LC for all sbr decoding */
-
-#endif
-
-        }   /*   (SbrChannel[LEFT].syncState == SBR_ACTIVE && lock)  */
-        else
-        {
-            /*
-             *  Default setting for upsampler
-             */
-            if (pVars->mc_info.ExtendedAudioObjectType == MP4AUDIO_AAC_LC)
-            {
-                /*
-                 *  Change only in implicit signalling, otherwise keep original declaration
-                 */
-                pVars->mc_info.ExtendedAudioObjectType = MP4AUDIO_SBR;
-            }
-
-#ifdef HQ_SBR
-            if (pVars->mc_info.nch > 1)
-            {
-                sbrDec->LC_aacP_DecoderFlag = ON;    /* Enable LC for stereo */
-            }
-            else
-            {
-                sbrDec->LC_aacP_DecoderFlag = OFF;    /* Disable LC, Enable HQ for mono */
-            }
-#else
-            sbrDec->LC_aacP_DecoderFlag = ON;       /* Enable LC for all sbr decoding */
-
-#endif
-            /* mask error and let upsampler run */
-            err = SBRDEC_OK;
-
-        }
-
-        /* decoding */
-        eleChannels = (stream->sbrElement [LEFT].ElementID == SBR_ID_CPE) ? 2 : 1;
-
-        if (SbrChannel[LEFT].syncState == SBR_ACTIVE)
-        {
-
-            sbr_decode_envelope(&(SbrChannel[LEFT].frameData));
-
-            decode_noise_floorlevels(&(SbrChannel[LEFT].frameData));
-
-            if (! SbrChannel[LEFT].frameData.coupling)
-            {
-                sbr_requantize_envelope_data(&(SbrChannel[LEFT].frameData));
-            }
-
-            if (eleChannels == 2)
-            {
-
-                sbr_decode_envelope(&(SbrChannel[RIGHT].frameData));
-
-                decode_noise_floorlevels(&(SbrChannel[RIGHT].frameData));
-
-                if (SbrChannel[RIGHT].frameData.coupling)
-                {
-                    sbr_envelope_unmapping(&(SbrChannel[ LEFT].frameData),
-                                           &(SbrChannel[RIGHT].frameData));
-                }
-                else
-                {
-                    sbr_requantize_envelope_data(&(SbrChannel[RIGHT].frameData));
-                }
-            }
-        }
-        else            /* enable upsampling until valid SBR is obtained */
-        {
-            /*
-             *  Incomplete sbr frame, or disabled SBR section
-             *  Set the decoder to act as a regular upsampler
-             */
-
-            init_sbr_dec((sbrDec->outSampleRate >> 1),
-                         pVars->mc_info.upsamplingFactor,
-                         sbrDec,
-                         &(self->SbrChannel[LEFT].frameData));
-
-            if ((eleChannels == 2) && (SbrChannel[RIGHT].syncState != SBR_ACTIVE))
-            {
-                init_sbr_dec((sbrDec->outSampleRate >> 1),
-                             pVars->mc_info.upsamplingFactor,
-                             sbrDec,
-                             &(self->SbrChannel[RIGHT].frameData));
-
-            }
-
-        }
-
-    }
-
-
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-    if (pVars->mc_info.ExtendedAudioObjectType == MP4AUDIO_PS)
-    {
-        ps_bstr_decoding(self->hParametricStereoDec);
-        /* allocate pointer for rigth channel qmf filter history  */
-        Int16 *tempInt16Ptr = (Int16 *)SbrChannel[RIGHT].frameData.V;
-        self->hParametricStereoDec->R_ch_qmf_filter_history = (Int32 *)tempInt16Ptr;
-
-
-        /*
-         * 1824 (48*38) Int32 needed by each matrix sbrQmfBufferReal, sbrQmfBufferImag
-         * pVars->share.predictedSamples  has 2048 available
-         * pVars->fxpCoef[1]  has 2048 available
-         */
-        SbrChannel[LEFT].frameData.sbrQmfBufferReal = pVars->share.predictedSamples;
-        SbrChannel[LEFT].frameData.sbrQmfBufferImag = &pVars->fxpCoef[0][920];
-
-        sbr_dec(ch_left,
-                timeData,
-                &(SbrChannel[LEFT].frameData),
-                (SbrChannel[LEFT].syncState == SBR_ACTIVE),
-                sbrDec,
-                &timeData[RIGHT],
-                self->hParametricStereoDec,
-                pVars);
-    }
-    else
-    {
-#endif
-#endif
-
-        SbrChannel[LEFT].frameData.sbrQmfBufferReal = pVars->fxpCoef[LEFT];
-#ifdef HQ_SBR
-        SbrChannel[LEFT].frameData.sbrQmfBufferImag = pVars->fxpCoef[RIGHT];
-#endif
-
-        sbr_dec(ch_left,
-                timeData,
-                &(SbrChannel[LEFT].frameData),
-                (SbrChannel[LEFT].syncState == SBR_ACTIVE),
-                sbrDec,
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-                NULL,
-                NULL,
-#endif
-#endif
-                pVars);
-
-        if (numChannels == 2)
-        {
-            SbrChannel[RIGHT].frameData.sbrQmfBufferReal = pVars->fxpCoef[LEFT];
-#ifdef HQ_SBR
-            SbrChannel[RIGHT].frameData.sbrQmfBufferImag = pVars->fxpCoef[RIGHT];
-#endif
-
-            sbr_dec(ch_right,
-                    &timeData[RIGHT],
-                    &(SbrChannel[RIGHT].frameData),
-                    (SbrChannel[RIGHT].syncState == SBR_ACTIVE),
-                    sbrDec,
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-                    NULL,
-                    NULL,
-#endif
-#endif
-                    pVars);
-
-        }
-
-
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-    }
-#endif
-#endif
-
-    return err;
-}
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_applied.h b/media/libstagefright/codecs/aacdec/sbr_applied.h
deleted file mode 100644
index 6878537..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_applied.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_applied.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_APPLIED_H
-#define SBR_APPLIED_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "e_sbr_error.h"
-#include "s_sbr_channel.h"
-#include "s_sbrbitstream.h"
-#include "sbr_dec.h"
-#include "pv_audio_type_defs.h"
-#include "s_tdec_int_file.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define MAX_FRAME_SIZE  1024
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-    SBR_ERROR  sbr_applied(SBRDECODER_DATA * self,
-    SBRBITSTREAM * stream,
-    Int16 *ch_left,
-    Int16 *ch_right,
-    Int16 *timeData,
-    SBR_DEC *sbrDec,
-    tDec_Int_File  *pVars,
-    Int32 numChannels);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_code_book_envlevel.cpp b/media/libstagefright/codecs/aacdec/sbr_code_book_envlevel.cpp
deleted file mode 100644
index 9db3221..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_code_book_envlevel.cpp
+++ /dev/null
@@ -1,403 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_code_book_envlevel.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include   "pv_audio_type_defs.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here. Include conditional
-    ; compile variables also.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; LOCAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-    ; Variable declaration - defined here and used outside this module
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL FUNCTION REFERENCES
-    ; Declare functions defined elsewhere and referenced in this module
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-    /*******************************************************************************/
-    /* table       : envelope level, 1.5 dB                                        */
-    /* theor range : [-58,58], CODE_BOOK_SCF_LAV   = 58                            */
-    /* implem range: [-60,60], CODE_BOOK_SCF_LAV10 = 60                            */
-    /* raw stats   : envelopeLevel_00 (yes, wrong suffix in name)  KK 01-03-09     */
-    /*******************************************************************************/
-
-    /* direction: time
-       raw table: HuffCode3C2FIX.m/envelopeLevel_00T_cF.mat/m_hALC_cF
-       built by : FH 01-07-05 */
-
-    extern const Char bookSbrEnvLevel10T[120][2] =
-    {
-        {   1,   2 },    { -64, -65 },    {   3,   4 },    { -63, -66 },
-        {   5,   6 },    { -62, -67 },    {   7,   8 },    { -61, -68 },
-        {   9,  10 },    { -60, -69 },    {  11,  12 },    { -59, -70 },
-        {  13,  14 },    { -58, -71 },    {  15,  16 },    { -57, -72 },
-        {  17,  18 },    { -73, -56 },    {  19,  21 },    { -74,  20 },
-        { -55, -75 },    {  22,  26 },    {  23,  24 },    { -54, -76 },
-        { -77,  25 },    { -53, -78 },    {  27,  34 },    {  28,  29 },
-        { -52, -79 },    {  30,  31 },    { -80, -51 },    {  32,  33 },
-        { -83, -82 },    { -81, -50 },    {  35,  57 },    {  36,  40 },
-        {  37,  38 },    { -88, -84 },    { -48,  39 },    { -90, -85 },
-        {  41,  46 },    {  42,  43 },    { -49, -87 },    {  44,  45 },
-        { -89, -86 },    { -124, -123 },    {  47,  50 },    {  48,  49 },
-        { -122, -121 },    { -120, -119 },    {  51,  54 },    {  52,  53 },
-        { -118, -117 },    { -116, -115 },    {  55,  56 },    { -114, -113 },
-        { -112, -111 },    {  58,  89 },    {  59,  74 },    {  60,  67 },
-        {  61,  64 },    {  62,  63 },    { -110, -109 },    { -108, -107 },
-        {  65,  66 },    { -106, -105 },    { -104, -103 },    {  68,  71 },
-        {  69,  70 },    { -102, -101 },    { -100, -99 },    {  72,  73 },
-        { -98, -97 },    { -96, -95 },    {  75,  82 },    {  76,  79 },
-        {  77,  78 },    { -94, -93 },    { -92, -91 },    {  80,  81 },
-        { -47, -46 },    { -45, -44 },    {  83,  86 },    {  84,  85 },
-        { -43, -42 },    { -41, -40 },    {  87,  88 },    { -39, -38 },
-        { -37, -36 },    {  90, 105 },    {  91,  98 },    {  92,  95 },
-        {  93,  94 },    { -35, -34 },    { -33, -32 },    {  96,  97 },
-        { -31, -30 },    { -29, -28 },    {  99, 102 },    { 100, 101 },
-        { -27, -26 },    { -25, -24 },    { 103, 104 },    { -23, -22 },
-        { -21, -20 },    { 106, 113 },    { 107, 110 },    { 108, 109 },
-        { -19, -18 },    { -17, -16 },    { 111, 112 },    { -15, -14 },
-        { -13, -12 },    { 114, 117 },    { 115, 116 },    { -11, -10 },
-        {  -9,  -8 },    { 118, 119 },    {  -7,  -6 },    {  -5,  -4 }
-    };
-
-    /* direction: freq
-       raw table: HuffCode3C2FIX.m/envelopeLevel_00F_cF.mat/m_hALC_cF
-       built by : FH 01-07-05 */
-
-    extern const Char bookSbrEnvLevel10F[120][2] =
-    {
-        {   1,   2 },    { -64, -65 },    {   3,   4 },    { -63, -66 },
-        {   5,   6 },    { -67, -62 },    {   7,   8 },    { -68, -61 },
-        {   9,  10 },    { -69, -60 },    {  11,  13 },    { -70,  12 },
-        { -59, -71 },    {  14,  16 },    { -58,  15 },    { -72, -57 },
-        {  17,  19 },    { -73,  18 },    { -56, -74 },    {  20,  23 },
-        {  21,  22 },    { -55, -75 },    { -54, -53 },    {  24,  27 },
-        {  25,  26 },    { -76, -52 },    { -77, -51 },    {  28,  31 },
-        {  29,  30 },    { -50, -78 },    { -79, -49 },    {  32,  36 },
-        {  33,  34 },    { -48, -47 },    { -80,  35 },    { -81, -82 },
-        {  37,  47 },    {  38,  41 },    {  39,  40 },    { -83, -46 },
-        { -45, -84 },    {  42,  44 },    { -85,  43 },    { -44, -43 },
-        {  45,  46 },    { -88, -87 },    { -86, -90 },    {  48,  66 },
-        {  49,  56 },    {  50,  53 },    {  51,  52 },    { -92, -42 },
-        { -41, -39 },    {  54,  55 },    { -105, -89 },    { -38, -37 },
-        {  57,  60 },    {  58,  59 },    { -94, -91 },    { -40, -36 },
-        {  61,  63 },    { -20,  62 },    { -115, -110 },    {  64,  65 },
-        { -108, -107 },    { -101, -97 },    {  67,  89 },    {  68,  75 },
-        {  69,  72 },    {  70,  71 },    { -95, -93 },    { -34, -27 },
-        {  73,  74 },    { -22, -17 },    { -16, -124 },    {  76,  82 },
-        {  77,  79 },    { -123,  78 },    { -122, -121 },    {  80,  81 },
-        { -120, -119 },    { -118, -117 },    {  83,  86 },    {  84,  85 },
-        { -116, -114 },    { -113, -112 },    {  87,  88 },    { -111, -109 },
-        { -106, -104 },    {  90, 105 },    {  91,  98 },    {  92,  95 },
-        {  93,  94 },    { -103, -102 },    { -100, -99 },    {  96,  97 },
-        { -98, -96 },    { -35, -33 },    {  99, 102 },    { 100, 101 },
-        { -32, -31 },    { -30, -29 },    { 103, 104 },    { -28, -26 },
-        { -25, -24 },    { 106, 113 },    { 107, 110 },    { 108, 109 },
-        { -23, -21 },    { -19, -18 },    { 111, 112 },    { -15, -14 },
-        { -13, -12 },    { 114, 117 },    { 115, 116 },    { -11, -10 },
-        {  -9,  -8 },    { 118, 119 },    {  -7,  -6 },    {  -5,  -4 }
-    };
-
-    /*******************************************************************************/
-    /* table       : envelope balance, 1.5 dB                                      */
-    /* theor range : [-48,48], CODE_BOOK_SCF_LAV = 48                              */
-    /* implem range: same but mapped to [-24,24], CODE_BOOK_SCF_LAV_BALANCE10 = 24 */
-    /* raw stats   : envelopePan_00 (yes, wrong suffix in name)  KK 01-03-09       */
-    /*******************************************************************************/
-
-    /* direction: time
-       raw table: HuffCode3C.m/envelopePan_00T.mat/v_hALB
-       built by : FH 01-05-15 */
-
-    extern const Char bookSbrEnvBalance10T[48][2] =
-    {
-        { -64,   1 },    { -63,   2 },    { -65,   3 },    { -62,   4 },
-        { -66,   5 },    { -61,   6 },    { -67,   7 },    { -60,   8 },
-        { -68,   9 },    {  10,  11 },    { -69, -59 },    {  12,  13 },
-        { -70, -58 },    {  14,  28 },    {  15,  21 },    {  16,  18 },
-        { -57,  17 },    { -71, -56 },    {  19,  20 },    { -88, -87 },
-        { -86, -85 },    {  22,  25 },    {  23,  24 },    { -84, -83 },
-        { -82, -81 },    {  26,  27 },    { -80, -79 },    { -78, -77 },
-        {  29,  36 },    {  30,  33 },    {  31,  32 },    { -76, -75 },
-        { -74, -73 },    {  34,  35 },    { -72, -55 },    { -54, -53 },
-        {  37,  41 },    {  38,  39 },    { -52, -51 },    { -50,  40 },
-        { -49, -48 },    {  42,  45 },    {  43,  44 },    { -47, -46 },
-        { -45, -44 },    {  46,  47 },    { -43, -42 },    { -41, -40 }
-    };
-
-    /* direction: freq
-       raw table: HuffCode3C.m/envelopePan_00T.mat/v_hALB
-       built by : FH 01-05-15 */
-
-    extern const Char bookSbrEnvBalance10F[48][2] =
-    {
-        { -64,   1 },    { -65,   2 },    { -63,   3 },    { -66,   4 },
-        { -62,   5 },    { -61,   6 },    { -67,   7 },    { -68,   8 },
-        { -60,   9 },    {  10,  11 },    { -69, -59 },    { -70,  12 },
-        { -58,  13 },    {  14,  17 },    { -71,  15 },    { -57,  16 },
-        { -56, -73 },    {  18,  32 },    {  19,  25 },    {  20,  22 },
-        { -72,  21 },    { -88, -87 },    {  23,  24 },    { -86, -85 },
-        { -84, -83 },    {  26,  29 },    {  27,  28 },    { -82, -81 },
-        { -80, -79 },    {  30,  31 },    { -78, -77 },    { -76, -75 },
-        {  33,  40 },    {  34,  37 },    {  35,  36 },    { -74, -55 },
-        { -54, -53 },    {  38,  39 },    { -52, -51 },    { -50, -49 },
-        {  41,  44 },    {  42,  43 },    { -48, -47 },    { -46, -45 },
-        {  45,  46 },    { -44, -43 },    { -42,  47 },    { -41, -40 }
-    };
-
-    /*******************************************************************************/
-    /* table       : envelope level, 3.0 dB                                        */
-    /* theor range : [-29,29], CODE_BOOK_SCF_LAV   = 29                            */
-    /* implem range: [-31,31], CODE_BOOK_SCF_LAV11 = 31                            */
-    /* raw stats   : envelopeLevel_11  KK 00-02-03                                 */
-    /*******************************************************************************/
-
-    /* direction: time
-       raw table: HuffCode2.m
-       built by : FH 00-02-04 */
-
-    extern const Char bookSbrEnvLevel11T[62][2] =
-    {
-        { -64,   1 },    { -65,   2 },    { -63,   3 },    { -66,   4 },
-        { -62,   5 },    { -67,   6 },    { -61,   7 },    { -68,   8 },
-        { -60,   9 },    {  10,  11 },    { -69, -59 },    {  12,  14 },
-        { -70,  13 },    { -71, -58 },    {  15,  18 },    {  16,  17 },
-        { -72, -57 },    { -73, -74 },    {  19,  22 },    { -56,  20 },
-        { -55,  21 },    { -54, -77 },    {  23,  31 },    {  24,  25 },
-        { -75, -76 },    {  26,  27 },    { -78, -53 },    {  28,  29 },
-        { -52, -95 },    { -94,  30 },    { -93, -92 },    {  32,  47 },
-        {  33,  40 },    {  34,  37 },    {  35,  36 },    { -91, -90 },
-        { -89, -88 },    {  38,  39 },    { -87, -86 },    { -85, -84 },
-        {  41,  44 },    {  42,  43 },    { -83, -82 },    { -81, -80 },
-        {  45,  46 },    { -79, -51 },    { -50, -49 },    {  48,  55 },
-        {  49,  52 },    {  50,  51 },    { -48, -47 },    { -46, -45 },
-        {  53,  54 },    { -44, -43 },    { -42, -41 },    {  56,  59 },
-        {  57,  58 },    { -40, -39 },    { -38, -37 },    {  60,  61 },
-        { -36, -35 },    { -34, -33 }
-    };
-
-    /* direction: freq
-       raw table: HuffCode2.m
-       built by : FH 00-02-04 */
-
-    extern const Char bookSbrEnvLevel11F[62][2] =
-    {
-        { -64,   1 },    { -65,   2 },    { -63,   3 },    { -66,   4 },
-        { -62,   5 },    { -67,   6 },    {   7,   8 },    { -61, -68 },
-        {   9,  10 },    { -60, -69 },    {  11,  12 },    { -59, -70 },
-        {  13,  14 },    { -58, -71 },    {  15,  16 },    { -57, -72 },
-        {  17,  19 },    { -56,  18 },    { -55, -73 },    {  20,  24 },
-        {  21,  22 },    { -74, -54 },    { -53,  23 },    { -75, -76 },
-        {  25,  30 },    {  26,  27 },    { -52, -51 },    {  28,  29 },
-        { -77, -79 },    { -50, -49 },    {  31,  39 },    {  32,  35 },
-        {  33,  34 },    { -78, -46 },    { -82, -88 },    {  36,  37 },
-        { -83, -48 },    { -47,  38 },    { -86, -85 },    {  40,  47 },
-        {  41,  44 },    {  42,  43 },    { -80, -44 },    { -43, -42 },
-        {  45,  46 },    { -39, -87 },    { -84, -40 },    {  48,  55 },
-        {  49,  52 },    {  50,  51 },    { -95, -94 },    { -93, -92 },
-        {  53,  54 },    { -91, -90 },    { -89, -81 },    {  56,  59 },
-        {  57,  58 },    { -45, -41 },    { -38, -37 },    {  60,  61 },
-        { -36, -35 },    { -34, -33 }
-    };
-
-    /*******************************************************************************/
-    /* table       : envelope balance, 3.0 dB                                      */
-    /* theor range : [-24,24], CODE_BOOK_SCF_LAV = 24                              */
-    /* implem range: same but mapped to [-12,12], CODE_BOOK_SCF_LAV_BALANCE11 = 12 */
-    /* raw stats   : envelopeBalance_11  KK 00-02-03                               */
-    /*******************************************************************************/
-
-    /* direction: time
-       raw table: HuffCode3C.m/envelopeBalance_11T.mat/v_hALB
-       built by : FH 01-05-15 */
-
-    extern const Char bookSbrEnvBalance11T[24][2] =
-    {
-        { -64,   1 },    { -63,   2 },    { -65,   3 },    { -66,   4 },
-        { -62,   5 },    { -61,   6 },    { -67,   7 },    { -68,   8 },
-        { -60,   9 },    {  10,  16 },    {  11,  13 },    { -69,  12 },
-        { -76, -75 },    {  14,  15 },    { -74, -73 },    { -72, -71 },
-        {  17,  20 },    {  18,  19 },    { -70, -59 },    { -58, -57 },
-        {  21,  22 },    { -56, -55 },    { -54,  23 },    { -53, -52 }
-    };
-
-    /* direction: time (?)
-       raw table: HuffCode3C.m/envelopeBalance_11T.mat/v_hALB
-       built by : FH 01-05-15 */
-
-    extern const Char bookSbrEnvBalance11F[24][2] =
-    {
-        { -64,   1 },    { -65,   2 },    { -63,   3 },    { -66,   4 },
-        { -62,   5 },    { -61,   6 },    { -67,   7 },    { -68,   8 },
-        { -60,   9 },    {  10,  13 },    { -69,  11 },    { -59,  12 },
-        { -58, -76 },    {  14,  17 },    {  15,  16 },    { -75, -74 },
-        { -73, -72 },    {  18,  21 },    {  19,  20 },    { -71, -70 },
-        { -57, -56 },    {  22,  23 },    { -55, -54 },    { -53, -52 }
-    };
-
-    /*******************************************************************************/
-    /* table       : noise level, 3.0 dB                                           */
-    /* theor range : [-29,29], CODE_BOOK_SCF_LAV   = 29                            */
-    /* implem range: [-31,31], CODE_BOOK_SCF_LAV11 = 31                            */
-    /* raw stats   : noiseLevel_11  KK 00-02-03                                    */
-    /*******************************************************************************/
-
-    /* direction: time
-       raw table: HuffCode2.m
-       built by : FH 00-02-04 */
-
-    extern const Char bookSbrNoiseLevel11T[62][2] =
-    {
-        { -64,   1 },    { -63,   2 },    { -65,   3 },    { -66,   4 },
-        { -62,   5 },    { -67,   6 },    {   7,   8 },    { -61, -68 },
-        {   9,  30 },    {  10,  15 },    { -60,  11 },    { -69,  12 },
-        {  13,  14 },    { -59, -53 },    { -95, -94 },    {  16,  23 },
-        {  17,  20 },    {  18,  19 },    { -93, -92 },    { -91, -90 },
-        {  21,  22 },    { -89, -88 },    { -87, -86 },    {  24,  27 },
-        {  25,  26 },    { -85, -84 },    { -83, -82 },    {  28,  29 },
-        { -81, -80 },    { -79, -78 },    {  31,  46 },    {  32,  39 },
-        {  33,  36 },    {  34,  35 },    { -77, -76 },    { -75, -74 },
-        {  37,  38 },    { -73, -72 },    { -71, -70 },    {  40,  43 },
-        {  41,  42 },    { -58, -57 },    { -56, -55 },    {  44,  45 },
-        { -54, -52 },    { -51, -50 },    {  47,  54 },    {  48,  51 },
-        {  49,  50 },    { -49, -48 },    { -47, -46 },    {  52,  53 },
-        { -45, -44 },    { -43, -42 },    {  55,  58 },    {  56,  57 },
-        { -41, -40 },    { -39, -38 },    {  59,  60 },    { -37, -36 },
-        { -35,  61 },    { -34, -33 }
-    };
-
-    /*******************************************************************************/
-    /* table       : noise balance, 3.0 dB                                         */
-    /* theor range : [-24,24], CODE_BOOK_SCF_LAV = 24                              */
-    /* implem range: same but mapped to [-12,12], CODE_BOOK_SCF_LAV_BALANCE11 = 12 */
-    /* raw stats   : noiseBalance_11  KK 00-02-03                                  */
-    /*******************************************************************************/
-
-    /* direction: time
-       raw table: HuffCode3C.m/noiseBalance_11.mat/v_hALB
-       built by : FH 01-05-15 */
-
-    extern const Char bookSbrNoiseBalance11T[24][2] =
-    {
-        { -64,   1 },    { -65,   2 },    { -63,   3 },    {   4,   9 },
-        { -66,   5 },    { -62,   6 },    {   7,   8 },    { -76, -75 },
-        { -74, -73 },    {  10,  17 },    {  11,  14 },    {  12,  13 },
-        { -72, -71 },    { -70, -69 },    {  15,  16 },    { -68, -67 },
-        { -61, -60 },    {  18,  21 },    {  19,  20 },    { -59, -58 },
-        { -57, -56 },    {  22,  23 },    { -55, -54 },    { -53, -52 }
-    };
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_code_book_envlevel.h b/media/libstagefright/codecs/aacdec/sbr_code_book_envlevel.h
deleted file mode 100644
index 3df0531..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_code_book_envlevel.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: sbr_code_book_envlevel.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- this file declares the scalefactor bands for all sampling rates
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_CODE_BOOK_ENVLEVEL_H
-#define SBR_CODE_BOOK_ENVLEVEL_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-    extern const Char bookSbrEnvLevel10T[120][2];
-    extern const Char bookSbrEnvLevel10F[120][2];
-    extern const Char bookSbrEnvBalance10T[48][2];
-    extern const Char bookSbrEnvBalance10F[48][2];
-    extern const Char bookSbrEnvLevel11T[62][2];
-    extern const Char bookSbrEnvLevel11F[62][2];
-    extern const Char bookSbrEnvBalance11T[24][2];
-    extern const Char bookSbrEnvBalance11F[24][2];
-    extern const Char bookSbrNoiseLevel11T[62][2];
-    extern const Char bookSbrNoiseBalance11T[24][2];
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; END
-    ----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_constants.h b/media/libstagefright/codecs/aacdec/sbr_constants.h
deleted file mode 100644
index d54a699..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_constants.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_constants.h
- Funtions:
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_CONSTANTS_H
-#define SBR_CONSTANTS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-
-#define SBR_AMP_RES_1_5         0
-#define SBR_AMP_RES_3_0         1
-
-#define MAX_NOISE_ENVELOPES     2
-#define MAX_NOISE_COEFFS        5
-#define MAX_NUM_NOISE_VALUES     (MAX_NOISE_ENVELOPES * MAX_NOISE_COEFFS)
-
-#define MAX_ENVELOPES           5
-#define MAX_FREQ_COEFFS         58
-#define MAX_NUM_ENVELOPE_VALUES (MAX_ENVELOPES * MAX_FREQ_COEFFS)
-
-#define MAX_NUM_CHANNELS            2
-#define NOISE_FLOOR_OFFSET          6
-#define NOISE_FLOOR_OFFSET_PLUS_1   7
-
-#define LOW_RES                     0
-#define HIGH_RES                    1
-
-#define LO                          0
-#define HI                          1
-
-#define TIME                        1
-#define FREQ                        0
-
-#define LENGTH_FRAME_INFO           35
-
-#define SI_SBR_CRC_BITS             10
-
-#define SBR_FREQ_SCALE_DEFAULT      2
-#define SBR_ALTER_SCALE_DEFAULT     1
-#define SBR_NOISE_BANDS_DEFAULT     2
-
-#define SBR_LIMITER_BANDS_DEFAULT      2
-#define SBR_LIMITER_GAINS_DEFAULT      2
-#define SBR_INTERPOL_FREQ_DEFAULT      1
-#define SBR_SMOOTHING_LENGTH_DEFAULT   1
-
-/* header */
-#define SI_SBR_AMP_RES_BITS            1
-#define SI_SBR_START_FREQ_BITS         4
-#define SI_SBR_STOP_FREQ_BITS          4
-#define SI_SBR_XOVER_BAND_BITS         3
-#define SI_SBR_RESERVED_BITS_HDR       2
-#define SI_SBR_DATA_EXTRA_BITS         1
-#define SI_SBR_HEADER_EXTRA_1_BITS     1
-#define SI_SBR_HEADER_EXTRA_2_BITS     1
-
-#define SI_SBR_FREQ_SCALE_BITS         2
-#define SI_SBR_ALTER_SCALE_BITS        1
-#define SI_SBR_NOISE_BANDS_BITS        2
-
-#define SI_SBR_LIMITER_BANDS_BITS      2
-#define SI_SBR_LIMITER_GAINS_BITS      2
-#define SI_SBR_INTERPOL_FREQ_BITS      1
-#define SI_SBR_SMOOTHING_LENGTH_BITS   1
-
-
-/* data */
-#define SI_SBR_RESERVED_PRESENT        1
-#define SI_SBR_RESERVED_BITS_DATA      4
-
-#define SI_SBR_COUPLING_BITS           1
-
-#define SI_SBR_INVF_MODE_BITS          2
-
-#define SI_SBR_EXTENDED_DATA_BITS      1
-#define SI_SBR_EXTENSION_SIZE_BITS     4
-#define SI_SBR_EXTENSION_ESC_COUNT_BITS   8
-#define SI_SBR_EXTENSION_ID_BITS          2
-
-#define SI_SBR_NOISE_MODE_BITS         1
-#define SI_SBR_DOMAIN_BITS             1
-
-#define SI_SBR_START_ENV_BITS_AMP_RES_3_0           6
-#define SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_3_0   5
-#define SI_SBR_START_NOISE_BITS_AMP_RES_3_0         5
-#define SI_SBR_START_NOISE_BITS_BALANCE_AMP_RES_3_0 5
-
-#define SI_SBR_START_ENV_BITS_AMP_RES_1_5           7
-#define SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_1_5   6
-
-
-#define SBR_CLA_BITS  2
-#define SBR_ABS_BITS  2
-#define SBR_RES_BITS  1
-#define SBR_REL_BITS  2
-#define SBR_ENV_BITS  2
-#define SBR_NUM_BITS  2
-
-
-#define FIXFIX  0
-#define FIXVAR  1
-#define VARFIX  2
-#define VARVAR  3
-
-
-#define    LEN_EX_TYPE  (4)
-#define    LEN_NIBBLE   (4)
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_crc_check.cpp b/media/libstagefright/codecs/aacdec/sbr_crc_check.cpp
deleted file mode 100644
index 3bb4398..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_crc_check.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_crc_check.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "sbr_crc_check.h"
-#include "s_crc_buffer.h"
-#include "buf_getbits.h"
-#include "sbr_constants.h"
-#include "check_crc.h"
-
-
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-const unsigned short MAXCRCSTEP = 16;
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int32 sbr_crc_check(BIT_BUFFER * hBitBuf, UInt32 NrBits)
-{
-    Int32 crcResult = 1;
-    BIT_BUFFER BitBufferCRC;
-    UInt32 NrCrcBits;
-
-    UInt32 crcCheckSum;
-
-    Int32 i;
-    CRC_BUFFER CrcBuf;
-    UInt32 bValue;
-    Int32 CrcStep;
-    Int32 CrcNrBitsRest;
-
-    crcCheckSum = buf_getbits(hBitBuf, SI_SBR_CRC_BITS);
-
-
-    /*
-     *    Copy Bit buffer State
-     */
-
-    BitBufferCRC.char_ptr       = hBitBuf->char_ptr;
-    BitBufferCRC.buffer_word    = hBitBuf->buffer_word;
-    BitBufferCRC.buffered_bits  = hBitBuf->buffered_bits;
-    BitBufferCRC.nrBitsRead     = hBitBuf->nrBitsRead;
-    BitBufferCRC.bufferLen      = hBitBuf->bufferLen;
-
-
-    NrCrcBits = min(NrBits, BitBufferCRC.bufferLen - BitBufferCRC.nrBitsRead);
-
-
-    CrcStep = NrCrcBits / MAXCRCSTEP;
-    CrcNrBitsRest = (NrCrcBits - CrcStep * MAXCRCSTEP);
-
-    CrcBuf.crcState = CRCSTART;
-    CrcBuf.crcMask  = CRCMASK;
-    CrcBuf.crcPoly  = CRCPOLY;
-
-    for (i = 0; i < CrcStep; i++)
-    {
-        bValue = buf_getbits(&BitBufferCRC, MAXCRCSTEP);
-        check_crc(&CrcBuf, bValue, MAXCRCSTEP);
-    }
-
-    bValue = buf_getbits(&BitBufferCRC, CrcNrBitsRest);
-    check_crc(&CrcBuf, bValue, CrcNrBitsRest);
-
-    if ((UInt32)(CrcBuf.crcState & CRCRANGE) != crcCheckSum)
-    {
-        crcResult = 0;
-    }
-
-    return (crcResult);
-}
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_crc_check.h b/media/libstagefright/codecs/aacdec/sbr_crc_check.h
deleted file mode 100644
index 9e6b1be..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_crc_check.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_crc_check.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_CRC_CHECK_H
-#define SBR_CRC_CHECK_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_bit_buffer.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define CRCPOLY  0x0233
-#define CRCMASK  0x0200
-#define CRCSTART 0x0000
-#define CRCRANGE 0x03FF
-
-#define SBR_EXTENSION      13 /* 1101 */
-#define SBR_EXTENSION_CRC  14 /* 1110 */
-
-
-
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-Int32 sbr_crc_check(BIT_BUFFER * hBitBuf,
-                    UInt32 NrBits);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_create_limiter_bands.cpp b/media/libstagefright/codecs/aacdec/sbr_create_limiter_bands.cpp
deleted file mode 100644
index 9472ffc..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_create_limiter_bands.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_create_limiter_bands.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_create_limiter_bands.h"
-#include    "shellsort.h"
-#include    "s_patch.h"
-#include    "pv_log2.h"
-
-#include "fxp_mul32.h"
-
-#define R_SHIFT     29
-#define Q_fmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_create_limiter_bands(Int32 limSbc[][13],
-                              Int32 *gateMode,
-                              Int   *freqTable,
-                              struct PATCH Patch,
-                              const Int32 noBands)
-{
-    Int32 i;
-    Int32 j;
-    Int32 k;
-    Int isPatchBorder[2];
-    Int32 patchBorders[MAX_NUM_PATCHES + 1];
-    Int32 workLimiterBandTable[32 + MAX_NUM_PATCHES + 1];
-
-    Int32 nOctaves;
-    const Int32 limiterBandsPerOctave[4] =
-        {Q_fmt(0.0F), Q_fmt(1.2F),
-         Q_fmt(2.0F), Q_fmt(3.0F)
-        };
-
-    Int32 tmp_q1;
-
-    Int32 noPatches = Patch.noOfPatches;
-    Int32 lowSubband = freqTable[0];
-    Int32 highSubband = freqTable[noBands];
-
-
-    for (i = 0; i < noPatches; i++)
-    {
-        patchBorders[i] = Patch.targetStartBand[i] - lowSubband;
-    }
-    patchBorders[i] = highSubband - lowSubband;
-
-    /* First band: 1 limiter band. */
-    limSbc[0][0] = freqTable[0] - lowSubband;
-    limSbc[0][1] = freqTable[noBands] - lowSubband;
-    gateMode[0] = 1;
-
-    /* Next three bands: 1.2, 2, 3 limiter bands/octave plus bandborders at patchborders. */
-    for (i = 1; i < 4; i++)
-    {
-
-        for (k = 0; k <= noBands; k++)
-        {
-            workLimiterBandTable[k] = freqTable[k] - lowSubband;
-        }
-
-        for (k = 1; k < noPatches; k++)
-        {
-            workLimiterBandTable[noBands+k] = patchBorders[k];
-        }
-
-        gateMode[i] = noBands + noPatches - 1;
-        shellsort(workLimiterBandTable, gateMode[i] + 1);
-
-        for (j = 1; j <= gateMode[i]; j++)
-        {
-            tmp_q1 = ((workLimiterBandTable[j] + lowSubband) << 20) / (workLimiterBandTable[j-1] + lowSubband);
-
-            nOctaves = pv_log2(tmp_q1);
-
-            tmp_q1 = fxp_mul32_Q20(nOctaves, limiterBandsPerOctave[i]);
-            if (tmp_q1 < Q_fmt(0.49))
-            {
-                if (workLimiterBandTable[j] == workLimiterBandTable[j-1])
-                {
-                    workLimiterBandTable[j] = highSubband;
-                    shellsort(workLimiterBandTable, gateMode[i] + 1);
-                    gateMode[i]--;
-                    j--;
-                    continue;
-                }
-
-                isPatchBorder[0] = isPatchBorder[1] = 0;
-
-                for (k = 0; k <= noPatches; k++)
-                {
-                    if (workLimiterBandTable[j-1] == patchBorders[k])
-                    {
-                        isPatchBorder[0] = 1;
-                        break;
-                    }
-                }
-
-                for (k = 0; k <= noPatches; k++)
-                {
-                    if (workLimiterBandTable[j] == patchBorders[k])
-                    {
-                        isPatchBorder[1] = 1;
-                        break;
-                    }
-                }
-
-                if (!isPatchBorder[1])
-                {
-                    workLimiterBandTable[j] = highSubband;
-                    shellsort(workLimiterBandTable, gateMode[i] + 1);
-                    gateMode[i]--;
-                    j--;
-                }
-                else if (!isPatchBorder[0])
-                {
-                    workLimiterBandTable[j-1] = highSubband;
-                    shellsort(workLimiterBandTable, gateMode[i] + 1);
-                    gateMode[i]--;
-                    j--;
-                }
-            }
-        }
-        for (k = 0; k <= gateMode[i]; k++)
-        {
-            limSbc[i][k] = workLimiterBandTable[k];
-        }
-    }
-}
-
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_create_limiter_bands.h b/media/libstagefright/codecs/aacdec/sbr_create_limiter_bands.h
deleted file mode 100644
index 7a53944..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_create_limiter_bands.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_create_limiter_bands.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_CREATE_LIMITER_BANDS_H
-#define SBR_CREATE_LIMITER_BANDS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "sbr_generate_high_freq.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void sbr_create_limiter_bands(Int32 limSbc[4][12 + 1],
-    Int32 gateMode[4],
-    Int   *freqTable,
-    struct PATCH Patch,
-    const Int32 noBands);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_dec.cpp b/media/libstagefright/codecs/aacdec/sbr_dec.cpp
deleted file mode 100644
index 8519b17..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_dec.cpp
+++ /dev/null
@@ -1,960 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2010 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_dec.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    sbr decoder core function
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#ifdef AAC_PLUS
-
-
-#include    "s_sbr_frame_data.h"
-#include    "calc_sbr_synfilterbank.h"
-#include    "calc_sbr_anafilterbank.h"
-#include    "calc_sbr_envelope.h"
-#include    "sbr_generate_high_freq.h"
-#include    "sbr_dec.h"
-#include    "decode_noise_floorlevels.h"
-#include    "aac_mem_funcs.h"
-#include    "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-#ifdef PARAMETRICSTEREO
-
-#include   "ps_applied.h"
-#include   "ps_init_stereo_mixing.h"
-
-#endif
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_dec(Int16 *inPcmData,
-             Int16 *ftimeOutPtr,
-             SBR_FRAME_DATA * hFrameData,
-             int32_t applyProcessing,
-             SBR_DEC *sbrDec,
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-             Int16 * ftimeOutPtrPS,
-             HANDLE_PS_DEC hParametricStereoDec,
-#endif
-#endif
-             tDec_Int_File  *pVars)
-{
-    int32_t   i;
-    int32_t   j;
-    int32_t   m;
-
-    int32_t  *frameInfo = hFrameData->frameInfo;
-    Int  num_qmf_bands;
-
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-
-    int32_t env;
-
-    int32_t *qmf_PS_generated_Real;
-    int32_t *qmf_PS_generated_Imag;
-
-    int32_t *Sr_x;
-    int32_t *Si_x;
-
-
-#endif
-#endif
-
-    int32_t(*scratch_mem)[64];
-    Int16 *circular_buffer_s;
-
-    int32_t   k;
-    int32_t *Sr;
-    int32_t *Si;
-    int32_t *ptr_tmp1;
-    int32_t *ptr_tmp2;
-    scratch_mem = pVars->scratch.scratch_mem;
-
-
-    if (applyProcessing)
-    {
-        num_qmf_bands = sbrDec->lowSubband;
-    }
-    else
-    {
-        num_qmf_bands = 32;     /* becomes a resampler by 2  */
-    }
-
-    /* -------------------------------------------------- */
-    /*
-     *    Re-Load Buffers
-     */
-    pv_memmove(&hFrameData->sbrQmfBufferReal[0],
-               &hFrameData->HistsbrQmfBufferReal[0],
-               6*SBR_NUM_BANDS*sizeof(*hFrameData->sbrQmfBufferReal));
-#ifdef HQ_SBR
-
-
-    if (sbrDec->LC_aacP_DecoderFlag == OFF)
-    {
-        pv_memmove(&hFrameData->sbrQmfBufferImag[0],
-                   &hFrameData->HistsbrQmfBufferImag[0],
-                   6*SBR_NUM_BANDS*sizeof(*hFrameData->sbrQmfBufferImag));
-    }
-#endif
-    /* -------------------------------------------------- */
-
-
-    /*
-     *    low band codec signal subband filtering
-     */
-
-    for (i = 0; i < 32; i++)
-    {
-
-        if (sbrDec->LC_aacP_DecoderFlag == ON)
-        {
-
-            calc_sbr_anafilterbank_LC(hFrameData->codecQmfBufferReal[sbrDec->bufWriteOffs + i],
-                                      &inPcmData[319] + (i << 5),
-                                      scratch_mem,
-                                      num_qmf_bands);
-
-        }
-#ifdef HQ_SBR
-        else
-        {
-
-            calc_sbr_anafilterbank(hFrameData->codecQmfBufferReal[sbrDec->bufWriteOffs + i],
-                                   hFrameData->codecQmfBufferImag[sbrDec->bufWriteOffs + i],
-                                   &inPcmData[319] + (i << 5),
-                                   scratch_mem,
-                                   num_qmf_bands);
-        }
-#endif
-
-    }
-
-    if (pVars->ltp_buffer_state)
-    {
-        pv_memcpy(&inPcmData[-1024-288], &inPcmData[1024], 288*sizeof(*inPcmData));
-    }
-    else
-    {
-        pv_memcpy(&inPcmData[1024 + 288], &inPcmData[1024], 288*sizeof(*inPcmData));
-    }
-
-
-    if (applyProcessing)
-    {
-
-        /*
-         *  Inverse filtering of lowband + HF generation
-         */
-
-        if (sbrDec->LC_aacP_DecoderFlag == ON)
-        {
-
-            sbr_generate_high_freq((int32_t(*)[32])(hFrameData->codecQmfBufferReal + sbrDec->bufReadOffs),
-                                   NULL,
-                                   (int32_t *)(hFrameData->sbrQmfBufferReal),
-                                   NULL,
-                                   hFrameData->sbr_invf_mode,
-                                   hFrameData->sbr_invf_mode_prev,
-                                   &(sbrDec->FreqBandTableNoise[1]),
-                                   sbrDec->NoNoiseBands,
-                                   sbrDec->lowSubband,
-                                   sbrDec->V_k_master,
-                                   sbrDec->Num_Master,
-                                   sbrDec->outSampleRate,
-                                   frameInfo,
-                                   hFrameData->degreeAlias,
-                                   scratch_mem,
-                                   hFrameData->BwVector,/* */
-                                   hFrameData->BwVectorOld,
-                                   &(sbrDec->Patch),
-                                   sbrDec->LC_aacP_DecoderFlag,
-                                   &(sbrDec->highSubband));
-
-
-            /*
-             *      Adjust envelope of current frame.
-             */
-
-            calc_sbr_envelope(hFrameData,
-                              (int32_t *)(hFrameData->sbrQmfBufferReal),
-                              NULL,
-                              sbrDec->FreqBandTable,
-                              sbrDec->NSfb,
-                              sbrDec->FreqBandTableNoise,
-                              sbrDec->NoNoiseBands,
-                              hFrameData->reset_flag,
-                              hFrameData->degreeAlias,
-                              &(hFrameData->harm_index),
-                              &(hFrameData->phase_index),
-                              hFrameData->hFp,
-                              &(hFrameData->sUp),
-                              sbrDec->limSbc,
-                              sbrDec->gateMode,
-#ifdef HQ_SBR
-                              NULL,
-                              NULL,
-                              NULL,
-                              NULL,
-#endif
-                              scratch_mem,
-                              sbrDec->Patch,
-                              sbrDec->sqrt_cache,
-                              sbrDec->LC_aacP_DecoderFlag);
-        }
-#ifdef HQ_SBR
-        else
-        {
-
-            sbr_generate_high_freq((int32_t(*)[32])(hFrameData->codecQmfBufferReal + sbrDec->bufReadOffs),
-                                   (int32_t(*)[32])(hFrameData->codecQmfBufferImag + sbrDec->bufReadOffs),
-                                   (int32_t *)(hFrameData->sbrQmfBufferReal),
-                                   (int32_t *)(hFrameData->sbrQmfBufferImag),
-                                   hFrameData->sbr_invf_mode,
-                                   hFrameData->sbr_invf_mode_prev,
-                                   &(sbrDec->FreqBandTableNoise[1]),
-                                   sbrDec->NoNoiseBands,
-                                   sbrDec->lowSubband,
-                                   sbrDec->V_k_master,
-                                   sbrDec->Num_Master,
-                                   sbrDec->outSampleRate,
-                                   frameInfo,
-                                   NULL,
-                                   scratch_mem,
-                                   hFrameData->BwVector,
-                                   hFrameData->BwVectorOld,
-                                   &(sbrDec->Patch),
-                                   sbrDec->LC_aacP_DecoderFlag,
-                                   &(sbrDec->highSubband));
-
-            /*
-             *      Adjust envelope of current frame.
-             */
-
-            calc_sbr_envelope(hFrameData,
-                              (int32_t *)(hFrameData->sbrQmfBufferReal),
-                              (int32_t *)(hFrameData->sbrQmfBufferImag),
-                              sbrDec->FreqBandTable,
-                              sbrDec->NSfb,
-                              sbrDec->FreqBandTableNoise,
-                              sbrDec->NoNoiseBands,
-                              hFrameData->reset_flag,
-                              NULL,
-                              &(hFrameData->harm_index),
-                              &(hFrameData->phase_index),
-                              hFrameData->hFp,
-                              &(hFrameData->sUp),
-                              sbrDec->limSbc,
-                              sbrDec->gateMode,
-                              hFrameData->fBuf_man,
-                              hFrameData->fBuf_exp,
-                              hFrameData->fBufN_man,
-                              hFrameData->fBufN_exp,
-                              scratch_mem,
-                              sbrDec->Patch,
-                              sbrDec->sqrt_cache,
-                              sbrDec->LC_aacP_DecoderFlag);
-
-        }
-#endif
-
-
-    }
-    else   /*  else for applyProcessing */
-    {
-        /* no sbr, set high band buffers to zero */
-
-        for (i = 0; i < SBR_NUM_COLUMNS; i++)
-        {
-            pv_memset((void *)&hFrameData->sbrQmfBufferReal[i*SBR_NUM_BANDS],
-                      0,
-                      SBR_NUM_BANDS*sizeof(*hFrameData->sbrQmfBufferReal));
-
-#ifdef HQ_SBR
-            pv_memset((void *)&hFrameData->sbrQmfBufferImag[i*SBR_NUM_BANDS],
-                      0,
-                      SBR_NUM_BANDS*sizeof(*hFrameData->sbrQmfBufferImag));
-
-#endif
-        }
-
-    }
-
-
-    /*
-     *  Synthesis subband filtering.
-     */
-
-#ifdef HQ_SBR
-
-#ifdef PARAMETRICSTEREO
-
-
-    /*
-     * psPresentFlag set implies hParametricStereoDec !=NULL, second condition is
-     * is just here to prevent CodeSonar warnings.
-     */
-    if ((pVars->mc_info.psPresentFlag) && (applyProcessing) &&
-            (hParametricStereoDec != NULL))
-    {
-
-        /*
-         *  qmfBufferReal uses the rigth aac channel ( perChan[1] is not used)
-         *  followed by the buffer fxpCoef[2][2048]  which makes a total of
-         *  2349 + 2048*2 = 6445
-         *  These  2 matrices (qmfBufferReal & qmfBufferImag) are
-         *  [2][38][64] == 4864 int32_t
-         */
-
-
-        tDec_Int_Chan *tmpx = &pVars->perChan[1];
-        /*
-         *  dereferencing type-punned pointer avoid
-         *  breaking strict-aliasing rules
-         */
-        int32_t *tmp = (int32_t *)tmpx;
-        hParametricStereoDec->qmfBufferReal = (int32_t(*)[64]) tmp;
-
-        tmp = (int32_t *) & hParametricStereoDec->qmfBufferReal[38][0];
-        hParametricStereoDec->qmfBufferImag = (int32_t(*)[64]) tmp;
-
-        for (i = 0; i < 32; i++)
-        {
-            Int   xoverBand;
-
-            if (i < ((hFrameData->frameInfo[1]) << 1))
-            {
-                xoverBand = sbrDec->prevLowSubband;
-            }
-            else
-            {
-                xoverBand = sbrDec->lowSubband;
-            }
-
-            if (xoverBand > sbrDec->highSubband)
-            {
-                /*
-                 * error condition, default to upsampling mode
-                 * and make sure that the number of bands for xover does
-                 * not exceed the number of high freq bands.
-                 */
-                xoverBand = (sbrDec->highSubband > 32)? 32: sbrDec->highSubband;
-            }
-
-            m = sbrDec->bufReadOffs + i;    /*  2 + i */
-
-            Sr_x = hParametricStereoDec->qmfBufferReal[i];
-            Si_x = hParametricStereoDec->qmfBufferImag[i];
-
-
-
-            for (int32_t j = 0; j < xoverBand; j++)
-            {
-                Sr_x[j] = shft_lft_1(hFrameData->codecQmfBufferReal[m][j]);
-                Si_x[j] = shft_lft_1(hFrameData->codecQmfBufferImag[m][j]);
-            }
-
-
-
-
-            pv_memcpy(&Sr_x[xoverBand],
-                      &hFrameData->sbrQmfBufferReal[i*SBR_NUM_BANDS],
-                      (sbrDec->highSubband - xoverBand)*sizeof(*Sr_x));
-
-            pv_memcpy(&Si_x[xoverBand],
-                      &hFrameData->sbrQmfBufferImag[i*SBR_NUM_BANDS],
-                      (sbrDec->highSubband - xoverBand)*sizeof(*Si_x));
-
-            pv_memset((void *)&Sr_x[sbrDec->highSubband],
-                      0,
-                      (64 - sbrDec->highSubband)*sizeof(*Sr_x));
-
-            pv_memset((void *)&Si_x[sbrDec->highSubband],
-                      0,
-                      (64 - sbrDec->highSubband)*sizeof(*Si_x));
-
-
-        }
-
-        for (i = 32; i < 32 + 6; i++)
-        {
-            m = sbrDec->bufReadOffs + i;     /*  2 + i */
-
-            for (int32_t j = 0; j < 5; j++)
-            {
-                hParametricStereoDec->qmfBufferReal[i][j] = shft_lft_1(hFrameData->codecQmfBufferReal[m][j]);
-                hParametricStereoDec->qmfBufferImag[i][j] = shft_lft_1(hFrameData->codecQmfBufferImag[m][j]);
-            }
-
-        }
-
-
-        /*
-         *    Update Buffers
-         */
-        for (i = 0; i < sbrDec->bufWriteOffs; i++)     /* sbrDec->bufWriteOffs set to 8 and unchanged */
-        {
-            j = sbrDec->noCols + i;                    /* sbrDec->noCols set to 32 and unchanged */
-
-            pv_memmove(hFrameData->codecQmfBufferReal[i],         /* to    */
-                       hFrameData->codecQmfBufferReal[j],        /* from  */
-                       sizeof(*hFrameData->codecQmfBufferReal[i]) << 5);
-
-            pv_memmove(hFrameData->codecQmfBufferImag[i],
-                       hFrameData->codecQmfBufferImag[j],
-                       sizeof(*hFrameData->codecQmfBufferImag[i]) << 5);
-        }
-
-
-        pv_memmove(&hFrameData->HistsbrQmfBufferReal[0],
-                   &hFrameData->sbrQmfBufferReal[32*SBR_NUM_BANDS],
-                   6*SBR_NUM_BANDS*sizeof(*hFrameData->sbrQmfBufferReal));
-
-        pv_memmove(&hFrameData->HistsbrQmfBufferImag[0],
-                   &hFrameData->sbrQmfBufferImag[32*SBR_NUM_BANDS],
-                   6*SBR_NUM_BANDS*sizeof(*hFrameData->sbrQmfBufferImag));
-
-
-        /*
-         *   Needs whole QMF matrix formed before applying
-         *   Parametric stereo processing.
-         */
-
-        qmf_PS_generated_Real = scratch_mem[0];
-        qmf_PS_generated_Imag = scratch_mem[1];
-        env = 0;
-
-        /*
-         *  Set circular buffer for Left channel
-         */
-
-        circular_buffer_s = (Int16 *)scratch_mem[7];
-
-
-        if (pVars->mc_info.bDownSampledSbr)
-        {
-            pv_memmove(&circular_buffer_s[2048],
-                       hFrameData->V,
-                       640*sizeof(*circular_buffer_s));
-        }
-        else
-        {
-            pv_memmove(&circular_buffer_s[4096],
-                       hFrameData->V,
-                       1152*sizeof(*circular_buffer_s));
-
-        }
-
-
-        /*
-         *  Set Circular buffer for PS hybrid analysis
-         */
-
-        int32_t *pt_temp = &scratch_mem[2][32];
-
-        for (i = 0, j = 0; i < 3; i++)
-        {
-
-            pv_memmove(&pt_temp[ j],
-                       hParametricStereoDec->hHybrid->mQmfBufferReal[i],
-                       HYBRID_FILTER_LENGTH_m_1*sizeof(*hParametricStereoDec->hHybrid->mQmfBufferReal));
-            pv_memmove(&pt_temp[ j + 44],
-                       hParametricStereoDec->hHybrid->mQmfBufferImag[i],
-                       HYBRID_FILTER_LENGTH_m_1*sizeof(*hParametricStereoDec->hHybrid->mQmfBufferImag));
-            j += 88;
-        }
-
-
-        pv_memset((void *)&qmf_PS_generated_Real[hParametricStereoDec->usb],
-                  0,
-                  (64 - hParametricStereoDec->usb)*sizeof(*qmf_PS_generated_Real));
-
-        pv_memset((void *)&qmf_PS_generated_Imag[hParametricStereoDec->usb],
-                  0,
-                  (64 - hParametricStereoDec->usb)*sizeof(*qmf_PS_generated_Imag));
-
-
-        for (i = 0; i < 32; i++)
-        {
-            if (i == (Int)hParametricStereoDec-> aEnvStartStop[env])
-            {
-                ps_init_stereo_mixing(hParametricStereoDec, env, sbrDec->highSubband);
-                env++;
-            }
-
-
-            ps_applied(hParametricStereoDec,
-                       &hParametricStereoDec->qmfBufferReal[i],
-                       &hParametricStereoDec->qmfBufferImag[i],
-                       qmf_PS_generated_Real,
-                       qmf_PS_generated_Imag,
-                       scratch_mem[2],
-                       i);
-
-            /* Create time samples for regular mono channel */
-
-            if (pVars->mc_info.bDownSampledSbr)
-            {
-                calc_sbr_synfilterbank(hParametricStereoDec->qmfBufferReal[i],  /* realSamples  */
-                                       hParametricStereoDec->qmfBufferImag[i], /* imagSamples  */
-                                       ftimeOutPtr + (i << 6),
-                                       &circular_buffer_s[1984 - (i<<6)],
-                                       pVars->mc_info.bDownSampledSbr);
-            }
-            else
-            {
-                calc_sbr_synfilterbank(hParametricStereoDec->qmfBufferReal[i],  /* realSamples  */
-                                       hParametricStereoDec->qmfBufferImag[i], /* imagSamples  */
-                                       ftimeOutPtr + (i << 7),
-                                       &circular_buffer_s[3968 - (i<<7)],
-                                       pVars->mc_info.bDownSampledSbr);
-
-            }
-
-            pv_memmove(hParametricStereoDec->qmfBufferReal[i], qmf_PS_generated_Real, 64*sizeof(*qmf_PS_generated_Real));
-            pv_memmove(hParametricStereoDec->qmfBufferImag[i], qmf_PS_generated_Imag, 64*sizeof(*qmf_PS_generated_Real));
-
-        }
-
-
-        /*
-         *  Save Circular buffer history used on PS hybrid analysis
-         */
-
-
-        pt_temp = &scratch_mem[2][64];
-
-        for (i = 0, j = 0; i < 3; i++)
-        {
-            pv_memmove(hParametricStereoDec->hHybrid->mQmfBufferReal[i],
-                       &pt_temp[ j],
-                       HYBRID_FILTER_LENGTH_m_1*sizeof(*hParametricStereoDec->hHybrid->mQmfBufferReal));
-
-            pv_memmove(hParametricStereoDec->hHybrid->mQmfBufferImag[i],
-                       &pt_temp[ j + 44],
-                       HYBRID_FILTER_LENGTH_m_1*sizeof(*hParametricStereoDec->hHybrid->mQmfBufferImag));
-
-            j += 88;
-        }
-
-
-        pv_memmove(hFrameData->V, &circular_buffer_s[0], 1152*sizeof(*circular_buffer_s));
-
-        /*
-         *  Set circular buffer for Right channel
-         */
-
-        circular_buffer_s = (Int16 *)scratch_mem[5];
-
-        if (pVars->mc_info.bDownSampledSbr)
-        {
-            pv_memmove(&circular_buffer_s[2048],
-                       (int32_t *)hParametricStereoDec->R_ch_qmf_filter_history,
-                       640*sizeof(*circular_buffer_s));
-        }
-        else
-        {
-            pv_memmove(&circular_buffer_s[4096],
-                       (int32_t *)hParametricStereoDec->R_ch_qmf_filter_history,
-                       1152*sizeof(*circular_buffer_s));
-
-        }
-
-
-        for (i = 0; i < 32; i++)
-        {
-            if (pVars->mc_info.bDownSampledSbr)
-            {
-
-                calc_sbr_synfilterbank(hParametricStereoDec->qmfBufferReal[i],  /* realSamples  */
-                                       hParametricStereoDec->qmfBufferImag[i], /* imagSamples  */
-                                       ftimeOutPtrPS + (i << 6),
-                                       &circular_buffer_s[1984 - (i<<6)],
-                                       pVars->mc_info.bDownSampledSbr);
-            }
-            else
-            {
-                calc_sbr_synfilterbank(hParametricStereoDec->qmfBufferReal[i],  /* realSamples  */
-                                       hParametricStereoDec->qmfBufferImag[i], /* imagSamples  */
-                                       ftimeOutPtrPS + (i << 7),
-                                       &circular_buffer_s[3968 - (i<<7)],
-                                       pVars->mc_info.bDownSampledSbr);
-            }
-
-        }
-
-        if (pVars->mc_info.bDownSampledSbr)
-        {
-            pv_memmove((int32_t *)hParametricStereoDec->R_ch_qmf_filter_history, &circular_buffer_s[0], 640*sizeof(*circular_buffer_s));
-        }
-        else
-        {
-            pv_memmove((int32_t *)hParametricStereoDec->R_ch_qmf_filter_history, &circular_buffer_s[0], 1152*sizeof(*circular_buffer_s));
-        }
-
-
-
-
-
-    }
-    else    /*  else -- sbrEnablePS  */
-    {
-
-#endif      /*   PARAMETRICSTEREO */
-#endif      /*   HQ_SBR */
-
-        /*
-         *  Use shared aac memory as continuous buffer
-         */
-
-
-        Sr  = scratch_mem[0];
-        Si  = scratch_mem[1];
-
-        circular_buffer_s = (Int16*)scratch_mem[2];
-
-        if (pVars->mc_info.bDownSampledSbr)
-        {
-
-            pv_memmove(&circular_buffer_s[2048],
-                       hFrameData->V,
-                       640*sizeof(*circular_buffer_s));
-        }
-        else
-        {
-            pv_memmove(&circular_buffer_s[4096],
-                       hFrameData->V,
-                       1152*sizeof(*circular_buffer_s));
-        }
-
-        for (i = 0; i < 32; i++)
-        {
-            Int   xoverBand;
-
-            if (applyProcessing)
-            {
-                if (i < ((hFrameData->frameInfo[1]) << 1))
-                {
-                    xoverBand = sbrDec->prevLowSubband;
-
-                }
-                else
-                {
-                    xoverBand = sbrDec->lowSubband;
-                }
-
-                if (xoverBand > sbrDec->highSubband)
-                {
-                    /*
-                     * error condition, default to upsampling mode
-                     * and make sure that the number of bands for xover does
-                     * not exceed the number of high freq bands.
-                     */
-                    xoverBand = (sbrDec->highSubband > 32)? 32: sbrDec->highSubband;
-                }
-            }
-            else
-            {
-                xoverBand = 32;
-                sbrDec->highSubband = 32;
-            }
-
-
-            m = sbrDec->bufReadOffs + i;    /* sbrDec->bufReadOffs == 2 */
-
-
-            ptr_tmp1 = (hFrameData->codecQmfBufferReal[m]);
-            ptr_tmp2 = Sr;
-
-            if (sbrDec->LC_aacP_DecoderFlag == ON)
-            {
-
-                for (k = (xoverBand >> 1); k != 0; k--)
-                {
-                    *(ptr_tmp2++) = (*(ptr_tmp1++)) >> 9;
-                    *(ptr_tmp2++) = (*(ptr_tmp1++)) >> 9;
-                }
-                if (xoverBand & 1)
-                {
-                    *(ptr_tmp2++) = (*(ptr_tmp1)) >> 9;
-                }
-
-                ptr_tmp1 = &hFrameData->sbrQmfBufferReal[i*SBR_NUM_BANDS];
-
-
-                for (k = xoverBand; k < sbrDec->highSubband; k++)
-                {
-                    *(ptr_tmp2++) = (*(ptr_tmp1++)) << 1;
-                }
-
-                pv_memset((void *)ptr_tmp2,
-                          0,
-                          (64 - sbrDec->highSubband)*sizeof(*ptr_tmp2));
-
-
-                if (pVars->mc_info.bDownSampledSbr)
-                {
-                    calc_sbr_synfilterbank_LC(Sr,               /* realSamples  */
-                                              ftimeOutPtr + (i << 6),
-                                              &circular_buffer_s[1984 - (i<<6)],
-                                              pVars->mc_info.bDownSampledSbr);
-                }
-                else
-                {
-                    calc_sbr_synfilterbank_LC(Sr,               /* realSamples  */
-                                              ftimeOutPtr + (i << 7),
-                                              &circular_buffer_s[3968 - (i<<7)],
-                                              pVars->mc_info.bDownSampledSbr);
-                }
-            }
-#ifdef HQ_SBR
-            else
-            {
-
-                for (k = xoverBand; k != 0; k--)
-                {
-                    *(ptr_tmp2++) = shft_lft_1(*(ptr_tmp1++));
-                }
-
-                ptr_tmp1 = &hFrameData->sbrQmfBufferReal[i*SBR_NUM_BANDS];
-                ptr_tmp2 = &Sr[xoverBand];
-
-
-                for (k = xoverBand; k < sbrDec->highSubband; k++)
-                {
-                    *(ptr_tmp2++) = (*(ptr_tmp1++));
-                }
-
-                pv_memset((void *)ptr_tmp2,
-                          0,
-                          (64 - sbrDec->highSubband)*sizeof(*ptr_tmp2));
-
-
-                ptr_tmp1 = (hFrameData->codecQmfBufferImag[m]);
-                ptr_tmp2 = Si;
-
-                for (k = (xoverBand >> 1); k != 0; k--)
-                {
-                    *(ptr_tmp2++) = shft_lft_1(*(ptr_tmp1++));
-                    *(ptr_tmp2++) = shft_lft_1(*(ptr_tmp1++));
-                }
-                if (xoverBand & 1)
-                {
-                    *(ptr_tmp2) = shft_lft_1(*(ptr_tmp1));
-                }
-
-                ptr_tmp1 = &hFrameData->sbrQmfBufferImag[i*SBR_NUM_BANDS];
-                ptr_tmp2 = &Si[xoverBand];
-
-                for (k = xoverBand; k < sbrDec->highSubband; k++)
-                {
-                    *(ptr_tmp2++) = (*(ptr_tmp1++));
-                }
-
-                pv_memset((void *)ptr_tmp2,
-                          0,
-                          (64 - sbrDec->highSubband)*sizeof(*ptr_tmp2));
-
-
-                if (pVars->mc_info.bDownSampledSbr)
-                {
-                    calc_sbr_synfilterbank(Sr,              /* realSamples  */
-                                           Si,             /* imagSamples  */
-                                           ftimeOutPtr + (i << 6),
-                                           &circular_buffer_s[1984 - (i<<6)],
-                                           pVars->mc_info.bDownSampledSbr);
-                }
-                else
-                {
-                    calc_sbr_synfilterbank(Sr,              /* realSamples  */
-                                           Si,             /* imagSamples  */
-                                           ftimeOutPtr + (i << 7),
-                                           &circular_buffer_s[3968 - (i<<7)],
-                                           pVars->mc_info.bDownSampledSbr);
-                }
-            }
-#endif
-
-        }
-
-        if (pVars->mc_info.bDownSampledSbr)
-        {
-            pv_memmove(hFrameData->V, &circular_buffer_s[0], 640*sizeof(*circular_buffer_s));
-        }
-        else
-        {
-            pv_memmove(hFrameData->V, &circular_buffer_s[0], 1152*sizeof(*circular_buffer_s));
-        }
-
-
-
-
-        /*
-         *    Update Buffers
-         */
-        for (i = 0; i < sbrDec->bufWriteOffs; i++)     /* sbrDec->bufWriteOffs set to 8 and unchanged */
-        {
-            j = sbrDec->noCols + i;                    /* sbrDec->noCols set to 32 and unchanged */
-
-            pv_memmove(hFrameData->codecQmfBufferReal[i],         /* to    */
-                       hFrameData->codecQmfBufferReal[j],        /* from  */
-                       sizeof(*hFrameData->codecQmfBufferReal[i]) << 5);
-        }
-
-
-        pv_memmove(&hFrameData->HistsbrQmfBufferReal[0],
-                   &hFrameData->sbrQmfBufferReal[32*SBR_NUM_BANDS],
-                   6*SBR_NUM_BANDS*sizeof(*hFrameData->sbrQmfBufferReal));
-
-#ifdef HQ_SBR
-        if (sbrDec->LC_aacP_DecoderFlag == OFF)
-        {
-            for (i = 0; i < sbrDec->bufWriteOffs; i++)     /* sbrDec->bufWriteOffs set to 6 and unchanged */
-            {
-                j = sbrDec->noCols + i;                    /* sbrDec->noCols set to 32 and unchanged */
-
-
-                pv_memmove(hFrameData->codecQmfBufferImag[i],
-                           hFrameData->codecQmfBufferImag[j],
-                           sizeof(*hFrameData->codecQmfBufferImag[i]) << 5);
-
-            }
-
-            pv_memmove(&hFrameData->HistsbrQmfBufferImag[0],
-                       &hFrameData->sbrQmfBufferImag[32*SBR_NUM_BANDS],
-                       6*SBR_NUM_BANDS*sizeof(*hFrameData->sbrQmfBufferImag));
-        }
-#endif
-
-
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-    }
-#endif
-#endif
-
-
-    hFrameData->reset_flag = 0;
-    if (applyProcessing)
-    {
-        sbrDec->prevLowSubband = sbrDec->lowSubband;
-    }
-
-}
-
-
-#endif      /*  AAC_PLUS */
diff --git a/media/libstagefright/codecs/aacdec/sbr_dec.h b/media/libstagefright/codecs/aacdec/sbr_dec.h
deleted file mode 100644
index ba7c1f3..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_dec.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_dec.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_DEC_H
-#define SBR_DEC_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include    "s_sbr_frame_data.h"
-#include    "pv_audio_type_defs.h"
-#include    "s_patch.h"
-#include    "e_blockswitching.h"
-#include    "s_sbr_dec.h"
-#include    "s_tdec_int_file.h"
-#ifdef PARAMETRICSTEREO
-#include    "s_ps_dec.h"
-#endif
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-
-    void sbr_dec(Int16 *inPcmData,
-    Int16 *ftimeOutPtr,
-    SBR_FRAME_DATA * hFrameData,
-    Int32 applyProcessing,
-    SBR_DEC *sbrDec,
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-    Int16 * ftimeOutPtrPS,
-    HANDLE_PS_DEC hParametricStereoDec,
-#endif
-#endif
-    tDec_Int_File  *pVars);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_decode_envelope.cpp b/media/libstagefright/codecs/aacdec/sbr_decode_envelope.cpp
deleted file mode 100644
index 771bb32..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_decode_envelope.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_decode_envelope.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_decode_envelope.h"
-#include    "sbr_constants.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void mapLowResEnergyVal(
-    Int32  currVal,
-    Int32 *prevData,
-    Int32 offset,
-    Int32 index,
-    Int32 res);
-
-Int32 indexLow2High(Int32 offset,
-                    Int32 index,
-                    Int32 res);
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void sbr_decode_envelope(SBR_FRAME_DATA * hFrameData)
-
-{
-    Int32 i;
-    Int32 no_of_bands;
-    Int32 band;
-    Int32 freqRes;
-    Int32 *iEnvelope    = hFrameData->iEnvelope_man;
-    Int32 *sfb_nrg_prev = hFrameData->sfb_nrg_prev_man;
-
-    Int32  offset       = hFrameData->offset;
-    Int32 *nSfb         = hFrameData->nSfb;
-    Int32 *domain_vec   = hFrameData->domain_vec1;
-    Int32 *frameInfo    = hFrameData->frameInfo;
-
-
-
-    for (i = 0; i < frameInfo[0]; i++)
-    {
-        freqRes = frameInfo[frameInfo[0] + i + 2];
-        no_of_bands = nSfb[freqRes];
-
-        if (domain_vec[i] == 0)
-        {
-            mapLowResEnergyVal(*iEnvelope,
-                               sfb_nrg_prev,
-                               offset,
-                               0,
-                               freqRes);
-            iEnvelope++;
-
-            for (band = 1; band < no_of_bands; band++)
-            {
-                *iEnvelope +=  *(iEnvelope - 1);
-
-                mapLowResEnergyVal(*iEnvelope,
-                                   sfb_nrg_prev,
-                                   offset,
-                                   band,
-                                   freqRes);
-                iEnvelope++;
-            }
-        }
-        else
-        {
-            for (band = 0; band < no_of_bands; band++)
-            {
-                *iEnvelope +=  sfb_nrg_prev[ indexLow2High(offset, band, freqRes)];
-
-                mapLowResEnergyVal(*iEnvelope,
-                                   sfb_nrg_prev,
-                                   offset,
-                                   band,
-                                   freqRes);
-                iEnvelope++;
-            }
-        }
-    }
-}
-
-
-
-void mapLowResEnergyVal(
-    Int32  currVal,
-    Int32 *prevData,
-    Int32  offset,
-    Int32  index,
-    Int32  res)
-{
-    Int32 tmp;
-
-    if (res == LO)
-    {
-        if (offset >= 0)
-        {
-            if (index < offset)
-            {
-                prevData[index] = currVal;
-            }
-            else
-            {
-                tmp = (index << 1) - offset;
-                prevData[tmp    ] = currVal;
-                prevData[tmp +1 ] = currVal;
-            }
-        }
-        else
-        {
-            offset = -offset;
-            if (index < offset)
-            {
-                tmp = (index << 1) + index;
-                prevData[tmp    ] = currVal;
-                prevData[tmp + 1] = currVal;
-                prevData[tmp + 2] = currVal;
-            }
-            else
-            {
-                tmp = (index << 1) + offset;
-                prevData[tmp    ] = currVal;
-                prevData[tmp + 1] = currVal;
-            }
-        }
-    }
-    else
-    {
-        prevData[index] = currVal;
-    }
-}
-
-
-Int32 indexLow2High(Int32 offset,
-                    Int32 index,
-                    Int32 res)
-{
-    if (res == LO)
-    {
-        if (offset >= 0)
-        {
-            if (index < offset)
-            {
-                return(index);
-            }
-            else
-            {
-                return((index << 1) - offset);
-            }
-        }
-        else
-        {
-            offset = -offset;
-            if (index < offset)
-            {
-                return((index << 1) + index);
-            }
-            else
-            {
-                return((index << 1) + offset);
-            }
-        }
-    }
-    else
-    {
-        return(index);
-    }
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_decode_envelope.h b/media/libstagefright/codecs/aacdec/sbr_decode_envelope.h
deleted file mode 100644
index 19c04a9..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_decode_envelope.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_decode_envelope.h
- Funtions:
-    decodeEnvelope
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_DECODE_ENVELOPE_H
-#define SBR_DECODE_ENVELOPE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_sbr_frame_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void sbr_decode_envelope(SBR_FRAME_DATA * hFrameData);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_decode_huff_cw.cpp b/media/libstagefright/codecs/aacdec/sbr_decode_huff_cw.cpp
deleted file mode 100644
index 290fd18..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_decode_huff_cw.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_decode_huff_cw.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-        SbrHuffman          h,     pointer to huffman codebook table
-        BIT_BUFFER    * hBitBuf    pointer  to Bitbuffer
-
-    return    decoded value
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  Decodes one huffman code word
-
-  Reads bits from the bitstream until a valid codeword is found.
-  The table entries are interpreted either as index to the next entry
-  or - if negative - as the codeword.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_decode_huff_cw.h"
-#include    "buf_getbits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int32 sbr_decode_huff_cw(SbrHuffman h,
-                         BIT_BUFFER * hBitBuf)
-{
-    Int32 bits;
-    Char index = 0;
-
-    while (index >= 0)
-    {
-        bits = buf_get_1bit(hBitBuf);
-        index = h[index][bits];
-    }
-
-    return((Int32)index + 64); /* Add offset */
-}
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/sbr_decode_huff_cw.h b/media/libstagefright/codecs/aacdec/sbr_decode_huff_cw.h
deleted file mode 100644
index bfbdb67..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_decode_huff_cw.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_decode_huff_cw.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_DECODE_HUFF_CW_H
-#define SBR_DECODE_HUFF_CW_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_huffman.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int32 sbr_decode_huff_cw(SbrHuffman h,
-    BIT_BUFFER * hBitBuf);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_downsample_lo_res.cpp b/media/libstagefright/codecs/aacdec/sbr_downsample_lo_res.cpp
deleted file mode 100644
index c2b007a..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_downsample_lo_res.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_downsample_lo_res.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_downsample_lo_res.h"
-#include    "sbr_constants.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void  sbr_downsample_lo_res(Int32 v_result[],
-                            Int32 num_result,
-                            Int   freqBandTableRef[],
-                            Int32 num_Ref)
-{
-    Int32 step;
-    Int32 i, j;
-    Int32 org_length;
-    Int32 result_length;
-    Int32 v_index[MAX_FREQ_COEFFS/2];
-
-    /* init */
-    org_length = num_Ref;
-    result_length = num_result;
-
-    v_index[0] = 0; /* Always use left border */
-    i = 0;
-    while (org_length > 0)  /* Create downsample vector */
-    {
-        i++;
-        step = org_length / result_length; /* floor; */
-        org_length = org_length - step;
-        result_length--;
-        v_index[i] = v_index[i-1] + step;
-    }
-
-    for (j = 0; j <= i; j++)   /* Use downsample vector to index LoResolution vector. */
-    {
-        v_result[j] = freqBandTableRef[ v_index[j]];
-    }
-
-}  /* End downSampleLoRes */
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_downsample_lo_res.h b/media/libstagefright/codecs/aacdec/sbr_downsample_lo_res.h
deleted file mode 100644
index 2f49aea..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_downsample_lo_res.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_downsample_lo_res.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
- ----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_DOWNSAMPLE_LO_RES_H
-#define SBR_DOWNSAMPLE_LO_RES_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void  sbr_downsample_lo_res(Int32 v_result[],
-    Int32 num_result,
-    Int   freqBandTableRef[],
-    Int32 num_Ref);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_envelope_calc_tbl.cpp b/media/libstagefright/codecs/aacdec/sbr_envelope_calc_tbl.cpp
deleted file mode 100644
index 2ed76dd..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_envelope_calc_tbl.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_envelope_calc_tbl.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_envelope_calc_tbl.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-#define Q30_fmt(x)   (Int32)(x*((Int32)1<<30) + (x>=0?0.5F:-0.5F))
-#define Qfmt15(x)    (Int16)(x*((Int32)1<<15) + (x>=0?0.5F:-0.5F))
-
-
-const Int32 limGains[5] = { Q30_fmt(0.70795f), Q30_fmt(1.0f),
-                            Q30_fmt(1.41254f), Q30_fmt(1.16415321826935f), 33
-                          };
-
-const Int32 smoothLengths[2] = { 4, 0 };
-
-const Int16 rP_LCx[512] =
-{
-    Qfmt15(-0.99948153278296f), Qfmt15(0.97113454393991f), Qfmt15(0.14130051758487f), Qfmt15(-0.47005496701697f),
-    Qfmt15(0.80705063769351f), Qfmt15(-0.38981478896926f), Qfmt15(-0.01053049862020f), Qfmt15(-0.91266367957293f),
-    Qfmt15(0.54840422910309f), Qfmt15(0.40009252867955f), Qfmt15(-0.99867974711855f), Qfmt15(-0.95531076805040f),
-    Qfmt15(-0.45725933317144f), Qfmt15(-0.72929675029275f), Qfmt15(0.75622801399036f), Qfmt15(0.07069442601050f),
-    Qfmt15(0.74496252926055f), Qfmt15(-0.96440182703856f), Qfmt15(0.30424629369539f), Qfmt15(0.66565033746925f),
-    Qfmt15(0.91697008020594f), Qfmt15(-0.70774918760427f), Qfmt15(-0.70051415345560f), Qfmt15(-0.99496513054797f),
-    Qfmt15(0.98164490790123f), Qfmt15(-0.54671580548181f), Qfmt15(-0.01689629065389f), Qfmt15(-0.86110349531986f),
-    Qfmt15(-0.98892980586032f), Qfmt15(0.51756627678691f), Qfmt15(-0.99635026409640f), Qfmt15(-0.99969370862163f),
-    Qfmt15(0.55266258627194f), Qfmt15(0.34581177741673f), Qfmt15(0.62664209577999f), Qfmt15(-0.77149701404973f),
-    Qfmt15(-0.91592244254432f), Qfmt15(-0.76285492357887f), Qfmt15(0.79788337195331f), Qfmt15(0.54473080610200f),
-    Qfmt15(-0.85639281671058f), Qfmt15(-0.92882402971423f), Qfmt15(-0.11708371046774f), Qfmt15(0.21356749817493f),
-    Qfmt15(-0.76191692573909f), Qfmt15(0.98111043100884f), Qfmt15(-0.85913269895572f), Qfmt15(-0.93307242253692f),
-    Qfmt15(0.30485754879632f), Qfmt15(0.85289650925190f), Qfmt15(0.91328082618125f), Qfmt15(-0.05890199924154f),
-    Qfmt15(0.28398686150148f), Qfmt15(0.95258164539612f), Qfmt15(-0.78566324168507f), Qfmt15(-0.95789495447877f),
-    Qfmt15(0.82411158711197f), Qfmt15(-0.65185446735885f), Qfmt15(-0.93643603134666f), Qfmt15(0.91427159529618f),
-    Qfmt15(-0.70395684036886f), Qfmt15(0.00563771969365f), Qfmt15(0.89065051931895f), Qfmt15(-0.68683707712762f),
-    Qfmt15(0.72165342518718f), Qfmt15(-0.62928247730667f), Qfmt15(0.29938434065514f), Qfmt15(-0.91781958879280f),
-    Qfmt15(0.99298717043688f), Qfmt15(0.82368298622748f), Qfmt15(-0.98512833386833f), Qfmt15(-0.95915368242257f),
-    Qfmt15(-0.21411126572790f), Qfmt15(-0.68821476106884f), Qfmt15(0.91851997982317f), Qfmt15(-0.96062769559127f),
-    Qfmt15(0.51646184922287f), Qfmt15(0.61130721139669f), Qfmt15(0.47336129371299f), Qfmt15(0.90998308703519f),
-    Qfmt15(0.44844799194357f), Qfmt15(0.66614891079092f), Qfmt15(0.74922239129237f), Qfmt15(-0.99571588506485f),
-    Qfmt15(0.97401082477563f), Qfmt15(0.72683747733879f), Qfmt15(0.95432193457128f), Qfmt15(-0.72962208425191f),
-    Qfmt15(-0.85359479233537f), Qfmt15(-0.81412430338535f), Qfmt15(-0.87930772356786f), Qfmt15(-0.71573331064977f),
-    Qfmt15(0.83524300028228f), Qfmt15(-0.48086065601423f), Qfmt15(0.97139128574778f), Qfmt15(0.51992825347895f),
-    Qfmt15(-0.00848591195325f), Qfmt15(-0.70294374303036f), Qfmt15(-0.95894428168140f), Qfmt15(0.97079252950321f),
-    Qfmt15(-0.92404293670797f), Qfmt15(-0.69506469500450f), Qfmt15(0.26559203620024f), Qfmt15(0.28038443336943f),
-    Qfmt15(-0.74138124825523f), Qfmt15(-0.01752795995444f), Qfmt15(-0.55126773094930f), Qfmt15(0.97960898850996f),
-    Qfmt15(-0.99196309146936f), Qfmt15(-0.67684928085260f), Qfmt15(0.09140039465500f), Qfmt15(-0.71658965751996f),
-    Qfmt15(0.81014640078925f), Qfmt15(0.40616991671205f), Qfmt15(-0.67680188682972f), Qfmt15(0.86849774348749f),
-    Qfmt15(-0.99500381284851f), Qfmt15(0.84329189340667f), Qfmt15(-0.09215968531446f), Qfmt15(0.99956173327206f),
-    Qfmt15(-0.79732779473535f), Qfmt15(0.96349973642406f), Qfmt15(-0.79942778496547f), Qfmt15(-0.11566039853896f),
-    Qfmt15(-0.39922954514662f), Qfmt15(0.99089197565987f), Qfmt15(0.28631285179909f), Qfmt15(-0.83302725605608f),
-    Qfmt15(0.95404443402072f), Qfmt15(-0.06449863579434f), Qfmt15(-0.99575054486311f), Qfmt15(-0.65501142790847f),
-    Qfmt15(-0.81254441908887f), Qfmt15(-0.99646369485481f), Qfmt15(0.00287840603348f), Qfmt15(0.70176989408455f),
-    Qfmt15(0.96361882270190f), Qfmt15(-0.68883758192426f), Qfmt15(-0.34875585502238f), Qfmt15(0.91980081243087f),
-    Qfmt15(-0.99009048343881f), Qfmt15(0.68865791458395f), Qfmt15(-0.99484402129368f), Qfmt15(0.94214511408023f),
-    Qfmt15(-0.67414626793544f), Qfmt15(-0.47339353684664f), Qfmt15(0.14323651387360f), Qfmt15(-0.29268293575672f),
-    Qfmt15(0.43793861458754f), Qfmt15(-0.36345126374441f), Qfmt15(-0.08750604656825f), Qfmt15(-0.96495267812511f),
-    Qfmt15(0.55526940659947f), Qfmt15(0.73538215752630f), Qfmt15(-0.30889773919437f), Qfmt15(0.03574995626194f),
-    Qfmt15(0.98720684660488f), Qfmt15(-0.81689296271203f), Qfmt15(0.67866860118215f), Qfmt15(-0.15808569732583f),
-    Qfmt15(0.80723395114371f), Qfmt15(0.47788757329038f), Qfmt15(0.96367554763201f), Qfmt15(-0.99143875716818f),
-    Qfmt15(0.83081876925833f), Qfmt15(-0.58753191905341f), Qfmt15(0.95538108220960f), Qfmt15(-0.96490920476211f),
-    Qfmt15(-0.97327101028521f), Qfmt15(0.91400366022124f), Qfmt15(-0.99925837363824f), Qfmt15(-0.86875903507313f),
-    Qfmt15(-0.26240034795124f), Qfmt15(-0.24664412953388f), Qfmt15(0.02416275806869f), Qfmt15(0.82068619590515f),
-    Qfmt15(0.88547373760759f), Qfmt15(-0.18173078152226f), Qfmt15(0.09355476558534f), Qfmt15(-0.54668414224090f),
-    Qfmt15(0.37050990604091f), Qfmt15(-0.70373594262891f), Qfmt15(-0.34600785879594f), Qfmt15(-0.68774481731008f),
-    Qfmt15(-0.26843291251234f), Qfmt15(0.49072334613242f), Qfmt15(0.38975993093975f), Qfmt15(-0.97757125224150f),
-    Qfmt15(-0.17325552859616f), Qfmt15(0.99948035025744f), Qfmt15(-0.64946246527458f), Qfmt15(-0.12016920576437f),
-    Qfmt15(-0.58947456517751f), Qfmt15(-0.41815140454465f), Qfmt15(0.99885650204884f), Qfmt15(-0.56649614128386f),
-    Qfmt15(0.94138021032330f), Qfmt15(-0.75725076534641f), Qfmt15(0.20541973692630f), Qfmt15(0.99980371023351f),
-    Qfmt15(0.29078277605775f), Qfmt15(-0.62858772103030f), Qfmt15(0.43440904467688f), Qfmt15(-0.98298583762390f),
-    Qfmt15(0.19513029146934f), Qfmt15(-0.95476662400101f), Qfmt15(0.93379635304810f), Qfmt15(-0.85235410573336f),
-    Qfmt15(-0.86425093011245f), Qfmt15(0.38879779059045f), Qfmt15(0.92045124735495f), Qfmt15(0.89162532251878f),
-    Qfmt15(-0.36834336949252f), Qfmt15(0.93891760988045f), Qfmt15(0.99267657565094f), Qfmt15(-0.94063471614176f),
-    Qfmt15(0.99740224117019f), Qfmt15(-0.35899413170555f), Qfmt15(0.05237237274947f), Qfmt15(0.36703583957424f),
-    Qfmt15(0.91653180367913f), Qfmt15(0.69000803499316f), Qfmt15(-0.38658751133527f), Qfmt15(-0.29250814029851f),
-    Qfmt15(-0.60182204677608f), Qfmt15(-0.97418588163217f), Qfmt15(0.88461574003963f), Qfmt15(0.05198933055162f),
-    Qfmt15(-0.53499621979720f), Qfmt15(-0.49429560226497f), Qfmt15(-0.98935142339139f), Qfmt15(-0.98081380091130f),
-    Qfmt15(-0.27338148835532f), Qfmt15(0.06310802338302f), Qfmt15(-0.20461677199539f), Qfmt15(0.66223843141647f),
-    Qfmt15(-0.84764345483665f), Qfmt15(-0.89039863483811f), Qfmt15(0.95903308477986f), Qfmt15(0.73504123909879f),
-    Qfmt15(-0.31744434966056f), Qfmt15(-0.34110827591623f), Qfmt15(0.47803883714199f), Qfmt15(0.98299195879514f),
-    Qfmt15(-0.30963073129751f), Qfmt15(0.99992588229018f), Qfmt15(-0.93149731080767f), Qfmt15(0.99923472302773f),
-    Qfmt15(-0.26024169633417f), Qfmt15(-0.35712514743563f), Qfmt15(-0.99899084509530f), Qfmt15(0.86557171579452f),
-    Qfmt15(0.33408042438752f), Qfmt15(0.99010736374716f), Qfmt15(-0.66694269691195f), Qfmt15(0.64016792079480f),
-    Qfmt15(0.99570534804836f), Qfmt15(-0.63431466947340f), Qfmt15(-0.07706847005931f), Qfmt15(0.98590090577724f),
-    Qfmt15(0.80099335254678f), Qfmt15(0.78368131392666f), Qfmt15(0.08707806671691f), Qfmt15(-0.86811883080712f),
-    Qfmt15(-0.39466529740375f), Qfmt15(0.97875325649683f), Qfmt15(-0.95038560288864f), Qfmt15(0.17005239424212f),
-    Qfmt15(-0.76910792026848f), Qfmt15(0.99743281016846f), Qfmt15(0.95437383549973f), Qfmt15(0.99578905365569f),
-    Qfmt15(0.28058259829990f), Qfmt15(0.85256524470573f), Qfmt15(-0.50608540105128f), Qfmt15(-0.97210735183243f),
-    Qfmt15(0.95424048234441f), Qfmt15(-0.96926570524023f), Qfmt15(0.30872163214726f), Qfmt15(-0.24523839572639f),
-    Qfmt15(-0.33813265086024f), Qfmt15(-0.05826828420146f), Qfmt15(-0.22898461455054f), Qfmt15(-0.18509915019881f),
-    Qfmt15(-0.10488238045009f), Qfmt15(-0.71886586182037f), Qfmt15(0.99793873738654f), Qfmt15(0.57563307626120f),
-    Qfmt15(0.28909646383717f), Qfmt15(0.42188998312520f), Qfmt15(0.93335049681047f), Qfmt15(-0.97087374418267f),
-    Qfmt15(0.36722871286923f), Qfmt15(-0.81093025665696f), Qfmt15(-0.26240603062237f), Qfmt15(0.83996497984604f),
-    Qfmt15(-0.99909615720225f), Qfmt15(0.74649464155061f), Qfmt15(-0.74774595569805f), Qfmt15(0.95781667469567f),
-    Qfmt15(0.95472308713099f), Qfmt15(0.48708332746299f), Qfmt15(0.46332038247497f), Qfmt15(-0.76497004940162f),
-    Qfmt15(0.57397389364339f), Qfmt15(0.75374316974495f), Qfmt15(-0.59174397685714f), Qfmt15(0.75087906691890f),
-    Qfmt15(-0.98607857336230f), Qfmt15(-0.40761056640505f), Qfmt15(0.66929266740477f), Qfmt15(-0.97463695257310f),
-    Qfmt15(0.90145509409859f), Qfmt15(-0.87259289048043f), Qfmt15(-0.91529461447692f), Qfmt15(-0.03305738840705f),
-    Qfmt15(0.07223051368337f), Qfmt15(0.99498012188353f), Qfmt15(-0.74904939500519f), Qfmt15(0.04585228574211f),
-    Qfmt15(-0.89054954257993f), Qfmt15(-0.83782144651251f), Qfmt15(0.33454804933804f), Qfmt15(-0.99707579362824f),
-    Qfmt15(-0.22827527843994f), Qfmt15(0.67248046289143f), Qfmt15(-0.05146538187944f), Qfmt15(0.99947295749905f),
-    Qfmt15(0.66951124390363f), Qfmt15(-0.99602956559179f), Qfmt15(0.82104905483590f), Qfmt15(0.99186510988782f),
-    Qfmt15(-0.65284592392918f), Qfmt15(0.93885443798188f), Qfmt15(0.96735248738388f), Qfmt15(-0.22225968841114f),
-    Qfmt15(-0.44132783753414f), Qfmt15(-0.85694974219574f), Qfmt15(0.91783042091762f), Qfmt15(0.72556974415690f),
-    Qfmt15(-0.99711581834508f), Qfmt15(0.77638976371966f), Qfmt15(0.07717324253925f), Qfmt15(-0.56049829194163f),
-    Qfmt15(0.98398893639988f), Qfmt15(0.47546946844938f), Qfmt15(0.65675089314631f), Qfmt15(0.03273375457980f),
-    Qfmt15(-0.38684144784738f), Qfmt15(-0.97346267944545f), Qfmt15(-0.53282156061942f), Qfmt15(0.99817310731176f),
-    Qfmt15(-0.50254500772635f), Qfmt15(0.01995873238855f), Qfmt15(0.99930381973804f), Qfmt15(0.82907767600783f),
-    Qfmt15(-0.58660709669728f), Qfmt15(-0.17573736667267f), Qfmt15(0.83434292401346f), Qfmt15(0.05946491307025f),
-    Qfmt15(0.81505484574602f), Qfmt15(-0.44976380954860f), Qfmt15(-0.89746474625671f), Qfmt15(0.39677256130792f),
-    Qfmt15(-0.07588948563079f), Qfmt15(0.76343198951445f), Qfmt15(-0.74490104699626f), Qfmt15(0.64880119792759f),
-    Qfmt15(0.62319537462542f), Qfmt15(0.42215817594807f), Qfmt15(0.02704554141885f), Qfmt15(0.80001773566818f),
-    Qfmt15(-0.79351832348816f), Qfmt15(0.63872359151636f), Qfmt15(0.52890520960295f), Qfmt15(0.74238552914587f),
-    Qfmt15(0.99096131449250f), Qfmt15(-0.80412329643109f), Qfmt15(-0.64612616129736f), Qfmt15(0.11657770663191f),
-    Qfmt15(-0.95053182488101f), Qfmt15(-0.62228872928622f), Qfmt15(0.03004475787316f), Qfmt15(-0.97987214341034f),
-    Qfmt15(-0.99986980746200f), Qfmt15(0.89110648599879f), Qfmt15(0.10407960510582f), Qfmt15(0.95964737821728f),
-    Qfmt15(0.50843233159162f), Qfmt15(0.17006334670615f), Qfmt15(0.25872675063360f), Qfmt15(-0.01115998681937f),
-    Qfmt15(-0.79598702973261f), Qfmt15(-0.99264708948101f), Qfmt15(-0.99829663752818f), Qfmt15(-0.70801016548184f),
-    Qfmt15(-0.70467057786826f), Qfmt15(0.99846021905254f), Qfmt15(-0.63364968534650f), Qfmt15(-0.16258217500792f),
-    Qfmt15(-0.43645594360633f), Qfmt15(-0.99848471702976f), Qfmt15(-0.16796458968998f), Qfmt15(-0.87979225745213f),
-    Qfmt15(0.44183099021786f), Qfmt15(0.93310180125532f), Qfmt15(-0.93941931782002f), Qfmt15(-0.88590003188677f),
-    Qfmt15(0.99971463703691f), Qfmt15(-0.75376385639978f), Qfmt15(0.93887685615875f), Qfmt15(0.85126435782309f),
-    Qfmt15(0.39701421446381f), Qfmt15(-0.37024464187437f), Qfmt15(-0.36024828242896f), Qfmt15(-0.93388812549209f),
-    Qfmt15(-0.65298804552119f), Qfmt15(0.11960319006843f), Qfmt15(0.94292565553160f), Qfmt15(0.75081145286948f),
-    Qfmt15(0.56721979748394f), Qfmt15(0.46857766746029f), Qfmt15(0.97312313923635f), Qfmt15(-0.38299976567017f),
-    Qfmt15(0.41025800019463f), Qfmt15(0.09638062008048f), Qfmt15(-0.85283249275397f), Qfmt15(0.88866808958124f),
-    Qfmt15(-0.48202429536989f), Qfmt15(0.27572582416567f), Qfmt15(-0.65889129659168f), Qfmt15(0.98838086953732f),
-    Qfmt15(-0.20651349620689f), Qfmt15(-0.62126416356920f), Qfmt15(0.20320105410437f), Qfmt15(-0.97790548600584f),
-    Qfmt15(0.11112534735126f), Qfmt15(-0.41368337314182f), Qfmt15(0.24133038992960f), Qfmt15(-0.66393410674885f),
-    Qfmt15(-0.53697829178752f), Qfmt15(-0.97224737889348f), Qfmt15(0.87392477144549f), Qfmt15(0.19050361015753f),
-    Qfmt15(-0.46353441212724f), Qfmt15(-0.07064096339021f), Qfmt15(-0.92444085484466f), Qfmt15(-0.83822593578728f),
-    Qfmt15(0.75214681811150f), Qfmt15(-0.42102998829339f), Qfmt15(-0.72094786237696f), Qfmt15(0.78843311019251f),
-    Qfmt15(0.97394027897442f), Qfmt15(0.99206463477946f), Qfmt15(0.76789609461795f), Qfmt15(-0.82002421836409f),
-    Qfmt15(0.81924990025724f), Qfmt15(-0.26719850873357f), Qfmt15(-0.43311260380975f), Qfmt15(0.99194979673836f),
-    Qfmt15(-0.80692001248487f), Qfmt15(0.43080003649976f), Qfmt15(0.67709491937357f), Qfmt15(0.56151770568316f),
-    Qfmt15(0.10831862810749f), Qfmt15(0.91229417540436f), Qfmt15(-0.48972893932274f), Qfmt15(-0.89033658689697f),
-    Qfmt15(0.65269447475094f), Qfmt15(0.67439478141121f), Qfmt15(-0.47770832416973f), Qfmt15(-0.99715979260878f),
-    Qfmt15(-0.90889593602546f), Qfmt15(-0.06618622548177f), Qfmt15(0.99430266919728f), Qfmt15(0.97686402381843f),
-    Qfmt15(0.94813650221268f), Qfmt15(-0.95434497492853f), Qfmt15(-0.49104783137150f), Qfmt15(0.99881175120751f),
-    Qfmt15(0.50449166760303f), Qfmt15(0.47162891065108f), Qfmt15(-0.62081581361840f), Qfmt15(-0.43867015250812f),
-    Qfmt15(0.98630563232075f), Qfmt15(-0.61510362277374f), Qfmt15(-0.03841517601843f), Qfmt15(-0.30102157304644f),
-    Qfmt15(0.41881284182683f), Qfmt15(-0.86135454941237f), Qfmt15(0.67226861393788f), Qfmt15(-0.70737398842068f),
-    Qfmt15(0.94044946687963f), Qfmt15(-0.82386352534327f), Qfmt15(-0.32070666698656f), Qfmt15(0.57593163224487f),
-    Qfmt15(-0.36326018419965f), Qfmt15(0.99979044674350f), Qfmt15(-0.92366023326932f), Qfmt15(-0.44607178518598f),
-    Qfmt15(0.44226800932956f), Qfmt15(0.03671907158312f), Qfmt15(0.52175424682195f), Qfmt15(-0.94701139690956f),
-    Qfmt15(-0.98759606946049f), Qfmt15(0.87434794743625f), Qfmt15(-0.93412041758744f), Qfmt15(0.96063943315511f),
-    Qfmt15(0.97534253457837f), Qfmt15(0.99642466504163f), Qfmt15(-0.94705089665984f), Qfmt15(0.91599807087376f)
-};
-
-
-#ifdef HQ_SBR
-
-
-const Int32 fir_table[5][5] =
-{
-    { Q30_fmt(1.0f)},
-    { Q30_fmt(0.33333333333333f), Q30_fmt(0.66666666666666f)},
-    { Q30_fmt(0.12500000000000f), Q30_fmt(0.37500000000000f),
-      Q30_fmt(0.50000000000000f)},
-    { Q30_fmt(0.05857864376269f), Q30_fmt(0.20000000000000f),
-      Q30_fmt(0.34142135623731f), Q30_fmt(0.40000000000000f)},
-    { Q30_fmt(0.03183050093751f), Q30_fmt(0.11516383427084f),
-      Q30_fmt(0.21816949906249f), Q30_fmt(0.30150283239582f),
-      Q30_fmt(0.33333333333333f)}
-};
-
-
-
-const Int32 rPxx[512] =
-{
-
-    0x8010B3DB,  0x7C4DA98F, 0x12168648, 0xC3D4D033,
-    0x674D25F5,  0xCE1972A6, 0xFEA5AA4A, 0x8B2DF13E,
-    0x46326048,  0x3336815E, 0x802A8F2B, 0x85B7745C,
-    0xC577B766,  0xA2A5828C, 0x60CB1AD1, 0x090C9BD7,
-    0x5F5A8B4D,  0x848D86BB, 0x26F1C0B7, 0x553352C1,
-    0x755E166B,  0xA5674343, 0xA654C5F5, 0x80A48CB4,
-    0x7DA69CD8,  0xBA04FCB4, 0xFDD4005E, 0x91C63676,
-    0x816A8F82,  0x423F55AA, 0x8077B59E, 0x80097DE9,
-    0x46BD4C18,  0x2C437971, 0x5035A0C2, 0x9D3ED49F,
-    0x8AC204B8,  0x9E5A8B0A, 0x662088B9, 0x45B9F0BC,
-    0x9261364F,  0x891B23AD, 0xF1028040, 0x1B568BE1,
-    0x9E787FB3,  0x7D94854D, 0x92077A94, 0x88903F45,
-    0x2705A5B4,  0x6D2B3BDC, 0x74E58034, 0xF8745A8C,
-    0x24592C54,  0x79EDB9BB, 0x9B6E9F44, 0x8563E5DA,
-    0x697C7BB7,  0xAC8F8E6A, 0x88227FD5, 0x7506822F,
-    0xA5E34B42,  0x00B94F10, 0x72004390, 0xA814676E,
-    0x5C5EA758,  0xAF721171, 0x2652C50C, 0x8A84A142,
-    0x7F19343E,  0x696EA13B, 0x81E68008, 0x853980F9,
-    0xE4968869,  0xA7E7DD92, 0x75910BFA, 0x85092E35,
-    0x421BA4A3,  0x4E3F3C18, 0x3C97DD02, 0x74797BCB,
-    0x39667EFD,  0x55447BA2, 0x5FE68CF3, 0x808B4390,
-    0x7CABEA6B,  0x5D08C27A, 0x7A265820, 0xA29A9DF0,
-    0x92BC7195,  0x97CA8338, 0x8F725FAD, 0xA46281D3,
-    0x6AE86B23,  0xC2728178, 0x7C566684, 0x428C66B7,
-    0xFEE89DDB,  0xA60546DC, 0x8540C89D, 0x7C420BF0,
-    0x89B86D72,  0xA7077E3F, 0x21FF5DD7, 0x23E3129C,
-    0xA1197F1D,  0xFDC0963F, 0xB96F8168, 0x7D6387A6,
-    0x810655C8,  0xA95C102B, 0x0BB3E5B4, 0xA44682D4,
-    0x67B244C3,  0x33FDDE1D, 0xA95D78F5, 0x6F2AE887,
-    0x80A3FC9F,  0x6BF00D52, 0xF4325902, 0x7FF1F02C,
-    0x99F08AC5,  0x7B537BB2, 0x99AB5255, 0xF1302497,
-    0xCCE4787B,  0x7ED58A28, 0x24A68B79, 0x955EA9D0,
-    0x7A1D3EED,  0xF7BD0429, 0x808A3642, 0xAC2769A8,
-    0x97FDBDE9,  0x80736C25, 0x005E52E7, 0x59D3E5D0,
-    0x7B57341A,  0xA7D374E9, 0xD35A5B7B, 0x75BB5520,
-    0x81446DE8,  0x5825473E, 0x80A8E653, 0x78978062,
-    0xA9B43F6B,  0xC366920A, 0x1255877D, 0xDA88075F,
-    0x380E9AFF,  0xD1795309, 0xF4CB7D09, 0x847BBAED,
-    0x471364FA,  0x5E207B74, 0xD87498BF, 0x0493836B,
-    0x7E5C3DF6,  0x976F8BBC, 0x56DE680A, 0xEBC26D28,
-    0x6753E05B,  0x3D2BC4B0, 0x7B593143, 0x8118E010,
-    0x6A5786AD,  0xB4CA01A7, 0x7A49927C, 0x847DAE0C,
-    0x836B0FD8,  0x74FD4A34, 0x80175AFC, 0x90CBE605,
-    0xDE68A89E,  0xE06C8FD0, 0x031822CE, 0x690B9315,
-    0x71568D43,  0xE8BBDE85, 0x0BFA4633, 0xBA057ADA,
-    0x2F6CB34F,  0xA5EB74C5, 0xD3B480B6, 0xA7F7D94A,
-    0xDDA26A63,  0x3ED0C5EF, 0x31E37A42, 0x82DE06CB,
-    0xE9D18940,  0x7FEE4A9A, 0xACDD57DD, 0xF09CB6D9,
-    0xB48BD364,  0xCA7814D5, 0x7FDA0E41, 0xB77C8C2A,
-    0x787E2D29,  0x9F1144AC, 0x1A4B871E, 0x7FF96630,
-    0x25382D4D,  0xAF89319E, 0x379A81DB, 0x822D1AE8,
-    0x18FA875E,  0x85C97DE7, 0x7786A544, 0x92E5F550,
-    0x915FC560,  0x31C47C82, 0x75D0B014, 0x72204656,
-    0xD0D87B76,  0x782E8CD6, 0x7F0FFB2F, 0x879834E7,
-    0x7FAAEA73,  0xD20BC44E, 0x06B4DF2C, 0x2EFBCE84,
-    0x7550D8D7,  0x5851746A, 0xCE837F5C, 0xDA8D2FEE,
-    0xB2F66F13,  0x834D7B7A, 0x713A499C, 0x06A81B39,
-    0xBB847C77,  0xC0B97DAC, 0x815CCC7A, 0x8274A2BD,
-    0xDD007FEF,  0x0814BA2F, 0xE5CDEDCE, 0x54C45CD5,
-    0x937F0309,  0x8E0671BF, 0x7AC1623B, 0x5E15FB32,
-    0xD75CD0D9,  0xD4553378, 0x3D30CD88, 0x7DD2028C,
-    0xD85CE8DB,  0x7FFDDE5A, 0x88C48228, 0x7FE6996A,
-    0xDEAF9EB7,  0xD24818B4, 0x80205F8B, 0x6ECA4728,
-    0x2AC36E51,  0x7EBB05E4, 0xAAA08AB1, 0x51F01408,
-    0x7F723AAE,  0xAECD1AFB, 0xF6218D55, 0x7E3170F2,
-    0x6686D0D3,  0x644F3A3F, 0x0B256799, 0x90E0325D,
-    0xCD7AAA7B,  0x7D47A33C, 0x865972A3, 0x15C445FE,
-    0x9D8D84D3,  0x7FAB36A7, 0x7A287C29, 0x7F75BABD,
-    0x23EA92BC,  0x6D20AD59, 0xBF37ABB6, 0x8391E26E,
-    0x7A2480F8,  0x83EE5E6E, 0x27843523, 0xE09A50E7,
-    0xD4B6CE82,  0xF889F71C, 0xE2AF7C3A, 0xE84D3CE2,
-    0xF2918FA6,  0xA3FB63E0, 0x7FBB7340, 0x49AE8B79,
-    0x25017B45,  0x36003DA1, 0x7777C844, 0x83B96EE4,
-    0x2F015392,  0x98320B3C, 0xDE68893F, 0x6B834779,
-    0x801D8516,  0x5F8C0F8C, 0xA049DD90, 0x7A999AD0,
-    0x7A33F500,  0x3E587FFF, 0x3B4E0E09, 0x9E147230,
-    0x49772D2B,  0x607A7BC7, 0xB4408D8F, 0x601CDA17,
-    0x81C7200B,  0xCBD28CBD, 0x55AB7E3E, 0x833EFFC0,
-    0x73627FB7,  0x904E7F04, 0x8AD7EBE6, 0xFBC3D05F,
-    0x093F8E53,  0x7F5B7C47, 0xA01E7FFA, 0x05DE7FC2,
-    0x8E01D74D,  0x94C17CF9, 0x2AD2919F, 0x805F7757,
-    0xE2C61829,  0x5613FB53, 0xF9688978, 0x7FEE77D6,
-    0x55B27E98,  0x8081C6D6, 0x69177F69, 0x7EF45C30,
-    0xAC6E42CC,  0x782BA021, 0x7BD17457, 0xE38B491E,
-    0xC781895B,  0x924E71B8, 0x757BC4A8, 0x5CDF8020,
-    0x805E4A82,  0x636078BA, 0x09E14B0E, 0xB84069A0,
-    0x7DF23284,  0x3CDC57D2, 0x54101777, 0x0431A015,
-    0xCE7A41B6,  0x8365846A, 0xBBCB8AF9, 0x7FC34E40,
-    0xBFAB8E4B,  0x028E6D15, 0x7FE8790F, 0x6A1EF7E6,
-    0xB4E97BF4,  0xE980C257, 0x6ACBEF53, 0x079C1A41,
-    0x685386CC,  0xC66D3458, 0x8D1F7FCD, 0x32C9A02E,
-    0xF6475ED7,  0x61B7356F, 0xA0A6793F, 0x530B34E9,
-    0x4FC488D4,  0x3609F61F, 0x0376F90F, 0x6666752C,
-    0x9A6DD1A5,  0x51C10A67, 0x43B34CDC, 0x5F0605C0,
-    0x7ED7E718,  0x99118EB3, 0xAD4A5C69, 0x0EEC94E8,
-    0x865483EA,  0xB05769F0, 0x03D88055, 0x82932EC1,
-    0x8003D1E3,  0x720F82B1, 0x0D526304, 0x7AD5D2A3,
-    0x41147B04,  0x15C49D9F, 0x211E7FDC, 0xFE907E12,
-    0x9A1C7C55,  0x80F08095, 0x80370267, 0xA55F2B1C,
-    0xA5CC7763,  0x7FCD81A1, 0xAEE3EAE8, 0xEB2F8532,
-    0xC82186A5,  0x80317B31, 0xEA7E814B, 0x8F62A430,
-    0x388D883A,  0x776F801B, 0x87C0B7CA, 0x8E9A3CF5,
-    0x7FF6949E,  0x9F83010B, 0x782CF18C, 0x6CF54301,
-    0x32D168AD,  0xD09A908B, 0xD1E22C5C, 0x887593DE,
-    0xAC6AE864,  0x0F4F7FDE, 0x78B16A72, 0x601AD283,
-    0x489AE12D,  0x3BFAD96A, 0x7C8E8093, 0xCEF87E19,
-    0x348302B6,  0x0C5605A6, 0x92D57516, 0x71BF8056,
-    0xC24C8416,  0x234B4B0D, 0xABA84B4F, 0x7E827FFD,
-    0xE58F45E1,  0xB079B355, 0x1A0290CA, 0x82D37B40,
-    0x0E391B80,  0xCB0B241E, 0x1EE441A8, 0xAB03F56F,
-    0xBB438301,  0x838C1C43, 0x6FDCEF9D, 0x1862020D,
-    0xC4A98614,  0xF6F38710, 0x89ABF29B, 0x94B4FDD3,
-    0x6046800E,  0xCA1A7FA4, 0xA3B7D32F, 0x64EB43A6,
-    0x7CA9DDD3,  0x7EFBB705, 0x624A9E0D, 0x9708A1E0,
-    0x68DC7F9C,  0xDDCB5832, 0xC88E6D35, 0x7EF77599,
-    0x98B6D63B,  0x3724E3F0, 0x56AA85C9, 0x47DFA582,
-    0x0DDDF4F3,  0x74C5AB88, 0xC14F480C, 0x8E08A446,
-    0x538B545F,  0x56529770, 0xC2D9EA81, 0x805C883B,
-    0x8BA84F67,  0xF785E183, 0x7F441814, 0x7D09DB4D,
-    0x795C8330,  0x85D79A19, 0xC1242A1B, 0x7FD871E9,
-    0x409391EC,  0x3C5EE815, 0xB0885FFF, 0xC7D87FFE,
-    0x7E3EBB6A,  0xB1438D6B, 0xFB13A68A, 0xD976F62D,
-    0x359B02CD,  0x91BE7EA6, 0x560CEEB8, 0xA5739E04,
-    0x78600B8E,  0x968A0B6C, 0xD6F1402E, 0x49B88152,
-    0xD17F0986,  0x7FF8EDE8, 0x89C48295, 0xC6E6BA93,
-    0x389C5B4C,  0x04B3516A, 0x42C892B0, 0x86C7FDA8,
-    0x81956954,  0x6FEA726E, 0x886E34F5, 0x7AF57730,
-    0x7CD76E45,  0x7F8A59D7, 0x86C6DA22, 0x753F825E
-};
-
-
-#endif
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_envelope_calc_tbl.h b/media/libstagefright/codecs/aacdec/sbr_envelope_calc_tbl.h
deleted file mode 100644
index 60e806d..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_envelope_calc_tbl.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_envelope_calc_tbl.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_ENVELOPE_CALC_TBL_H
-#define SBR_ENVELOPE_CALC_TBL_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-extern const Int32 limGains[5];
-
-extern const Int32 smoothLengths[2];
-
-extern const Int16 rP_LCx[512];
-
-#ifdef HQ_SBR
-
-
-extern const Int32 fir_table[5][5];
-
-extern const Int32 rPxx[512];
-
-#endif
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_envelope_unmapping.cpp b/media/libstagefright/codecs/aacdec/sbr_envelope_unmapping.cpp
deleted file mode 100644
index 7fce46b..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_envelope_unmapping.cpp
+++ /dev/null
@@ -1,427 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_envelope_unmapping.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_envelope_unmapping.h"
-#include    "sbr_constants.h"
-
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-#define R_SHIFT     30
-#define Qfmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-/*
- *  1./(1+2.^-[0:10])
- */
-const Int32 one_over_one_plus_two_to_n[11] =
-{
-    Qfmt(0.50000000000000F), Qfmt(0.66666666666667F), Qfmt(0.80000000000000F),
-    Qfmt(0.88888888888889F), Qfmt(0.94117647058824F), Qfmt(0.96969696969697F),
-    Qfmt(0.98461538461538F), Qfmt(0.99224806201550F), Qfmt(0.99610894941634F),
-    Qfmt(0.99805068226121F), Qfmt(0.99902439024390F)
-};
-
-/*
- *  1./(1+2.^[0.5:-1:-10.5])
- */
-const Int32 one_over_one_plus_sq_2_by_two_to_n[12] =
-{
-    Qfmt(0.41421356237310F), Qfmt(0.58578643762690F), Qfmt(0.73879612503626F),
-    Qfmt(0.84977889517767F), Qfmt(0.91878969685839F), Qfmt(0.95767628767521F),
-    Qfmt(0.97838063800882F), Qfmt(0.98907219289563F), Qfmt(0.99450607818892F),
-    Qfmt(0.99724547251514F), Qfmt(0.99862083678608F), Qfmt(0.99930994254211F)
-};
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_envelope_unmapping(SBR_FRAME_DATA * hFrameData1,
-                            SBR_FRAME_DATA * hFrameData2)
-
-{
-    Int32 i;
-    Int32 tempLeft;
-    Int32 tempRight;
-
-    Int32 tmp;
-    Int32 *iEnvelopeLeft_man    = hFrameData1->iEnvelope_man;
-    Int32 *iEnvelopeLeft_exp    = hFrameData1->iEnvelope_exp;
-    Int32 *noiseFloorLeft_man   = hFrameData1->sbrNoiseFloorLevel_man;
-    Int32 *noiseFloorLeft_exp   = hFrameData1->sbrNoiseFloorLevel_exp;
-
-    Int32 *iEnvelopeRight_man   = hFrameData2->iEnvelope_man;
-    Int32 *iEnvelopeRight_exp   = hFrameData2->iEnvelope_exp;
-    Int32 *noiseFloorRight_man  = hFrameData2->sbrNoiseFloorLevel_man;
-    Int32 *noiseFloorRight_exp  = hFrameData2->sbrNoiseFloorLevel_exp;
-
-
-    if (hFrameData2->ampRes)
-    {
-        for (i = 0; i < hFrameData1->nScaleFactors; i++)
-        {
-            tempRight = iEnvelopeRight_man[i];
-            tempLeft  = iEnvelopeLeft_man[i];
-            /*  iEnvelope[i] always positive  6 bits max */
-
-            iEnvelopeLeft_exp[i] = tempLeft + 7;
-
-            iEnvelopeRight_exp[i] = tempRight - 12;
-            iEnvelopeRight_man[i] = Qfmt(1.000F);
-
-            /*
-             *  iEnvelopeRight[i] = tempLeft / (1 + tempRight);
-             *  iEnvelopeLeft[i]  = tempRight * iEnvelopeRight[i];
-             *
-             *
-             *   iEnvelopeRight[i] = k*2^n/(1+2^m) =  k*2^(n-m)/(1 + 2^-m);
-             *   where k = 1 or sqrt(2)
-             */
-            if (iEnvelopeRight_exp[i] >= 0)
-            {
-                if (iEnvelopeRight_exp[i] < 11)
-                {
-                    iEnvelopeRight_man[i] = one_over_one_plus_two_to_n[ iEnvelopeRight_exp[i]];
-                }
-                else        /*  1/(1+2^-m) == 1 - 2^-m ;  for m >= 10  */
-                {
-                    iEnvelopeRight_man[i] -= (Qfmt(1.000F) >> iEnvelopeRight_exp[i]);
-                }
-                iEnvelopeRight_exp[i] = iEnvelopeLeft_exp[i] - iEnvelopeRight_exp[i];
-            }
-            else
-            {
-                if (iEnvelopeRight_exp[i] > -11)
-                {
-                    iEnvelopeRight_man[i] -= one_over_one_plus_two_to_n[ -iEnvelopeRight_exp[i]];
-                    iEnvelopeRight_exp[i] = iEnvelopeLeft_exp[i] - iEnvelopeRight_exp[i];
-
-                }
-                else        /*  1/(1+2^m) == 2^-m ;  for m >= 10  */
-                {
-                    iEnvelopeRight_exp[i] = iEnvelopeLeft_exp[i];
-                    iEnvelopeLeft_exp[i] = 0;
-                }
-            }
-
-            iEnvelopeLeft_man[i]  = iEnvelopeRight_man[i];
-        }
-    }
-    else
-    {
-        for (i = 0; i < hFrameData1->nScaleFactors; i++)
-        {
-            /*  iEnvelope[i] always positive  7 bits max */
-            tempRight = iEnvelopeRight_man[i];
-            tempLeft  = iEnvelopeLeft_man[i];
-
-            iEnvelopeLeft_exp[i] = (tempLeft >> 1) + 7;
-            if (tempLeft & 0x1)   /*  odd */
-            {
-                iEnvelopeLeft_man[i] = Qfmt(1.41421356237310F);
-            }
-            else
-            {
-                iEnvelopeLeft_man[i] = Qfmt(1.000F);
-            }
-
-            iEnvelopeRight_exp[i] = (tempRight >> 1) - 12;
-            if (tempRight & 0x1)   /*  odd */
-            {
-                if (iEnvelopeRight_exp[i] > 0)
-                {
-                    iEnvelopeRight_man[i] = Qfmt(1.41421356237310F);
-                }
-                else
-                {
-                    iEnvelopeRight_man[i] = Qfmt(0.7071067811865F);
-                }
-            }
-            else
-            {
-                iEnvelopeRight_man[i] = Qfmt(1.000F);
-            }
-
-            if (iEnvelopeRight_man[i] == Qfmt(1.000F))
-            {
-
-                /*
-                 *  iEnvelopeRight[i] = tempLeft / (1 + tempRight);
-                 *  iEnvelopeLeft[i]  = tempRight * iEnvelopeRight[i];
-                 *
-                 *
-                 *   iEnvelopeRight[i] = k*2^n/(1+2^m) =  k*2^(n-m)/(1 + 2^-m);
-                 *   where k = 1 or sqrt(2)
-                 */
-                if (iEnvelopeRight_exp[i] >= 0)
-                {
-                    if (iEnvelopeRight_exp[i] < 11)
-                    {
-                        iEnvelopeRight_man[i] = one_over_one_plus_two_to_n[ iEnvelopeRight_exp[i]];
-                    }
-                    else        /*  1/(1+2^-m) == 1 - 2^-m ;  for m >= 10  */
-                    {
-                        iEnvelopeRight_man[i] -= (Qfmt(1.000F) >> iEnvelopeRight_exp[i]);
-                    }
-                    iEnvelopeRight_exp[i] = iEnvelopeLeft_exp[i] - iEnvelopeRight_exp[i];
-
-                }
-                else
-                {
-                    if (iEnvelopeRight_exp[i] > -11)
-                    {
-                        iEnvelopeRight_man[i] -= one_over_one_plus_two_to_n[ -iEnvelopeRight_exp[i]];
-                        iEnvelopeRight_exp[i] = iEnvelopeLeft_exp[i] - iEnvelopeRight_exp[i];
-                    }
-                    else        /*  1/(1+2^m) == 2^-m ;  for m >= 10  */
-                    {
-                        iEnvelopeRight_exp[i] = iEnvelopeLeft_exp[i];
-                        iEnvelopeLeft_exp[i]  = 0;
-                    }
-                }
-
-                /*
-                 *  apply "k" factor 1 or sqrt(2)
-                 *
-                 *   (2^m)*2*k*2^n/(1+2^m) =  k*2^(n+1)/(1 + 2^-m);
-                 *
-                 */
-                if (iEnvelopeLeft_man[i] != Qfmt(1.000F))
-                {
-                    iEnvelopeRight_man[i] = fxp_mul32_Q30(iEnvelopeLeft_man[i], iEnvelopeRight_man[i]);
-                }
-
-                iEnvelopeLeft_man[i]  = iEnvelopeRight_man[i];
-
-            }
-            else
-            {
-
-                /*
-                *  iEnvelopeRight[i] = tempLeft / (1 + tempRight);
-                *  iEnvelopeLeft[i]  = tempRight * iEnvelopeRight[i];
-                *
-                *
-                *   iEnvelopeRight[i] = k*2^n/(1+q2^m) =  k*2^(n-m)/(1 + q2^-m);
-                *   where k = 1 or sqrt(2)
-                *   and q = sqrt(2)
-                    */
-                if (iEnvelopeRight_exp[i] >= 0)
-                {
-                    if (iEnvelopeRight_exp[i] < 12)
-                    {
-                        iEnvelopeRight_man[i] = one_over_one_plus_sq_2_by_two_to_n[ iEnvelopeRight_exp[i]];
-                    }
-                    else        /*  1/(1+2^-m) == 1 - 2^-m ;  for m >= 11  */
-                    {
-                        iEnvelopeRight_man[i] = Qfmt(1.000F) - (Qfmt(1.000F) >> iEnvelopeRight_exp[i]);
-                    }
-                }
-                else
-                {
-                    if (iEnvelopeRight_exp[i] > -12)
-                    {
-                        iEnvelopeRight_man[i] = Qfmt(1.000F) - one_over_one_plus_sq_2_by_two_to_n[ -iEnvelopeRight_exp[i]];
-                    }
-                    else        /*  1/(1+2^m) == 2^-m ;  for m >= 11  */
-                    {
-                        iEnvelopeRight_man[i] = Qfmt(1.000F);
-                        iEnvelopeRight_exp[i] = 0;
-                    }
-                }
-
-                iEnvelopeRight_exp[i] = iEnvelopeLeft_exp[i] - iEnvelopeRight_exp[i];
-
-                /*
-                *  apply "k" factor 1 or sqrt(2)
-                *
-                *   Right ==    k*2^(n-m)/(1 + q2^-m)
-                *   Left  == (q2^m)*k*2^n/(1 + q2^m) =  qk*2^n/(1 + q2^-m);
-                */
-                if (iEnvelopeLeft_man[i] != Qfmt(1.000F))
-                {
-                    /*
-                    *   k/(1 + q2^-m);
-                        */
-                    tmp = iEnvelopeRight_man[i];
-                    iEnvelopeRight_man[i] = fxp_mul32_Q30(iEnvelopeLeft_man[i], iEnvelopeRight_man[i]);
-                    iEnvelopeLeft_man[i] = tmp;
-                    iEnvelopeLeft_exp[i] += 1;      /* extra one due to sqrt(2)^2 */
-                }
-                else
-                {
-                    iEnvelopeLeft_man[i]  = fxp_mul32_Q30(iEnvelopeRight_man[i], Qfmt(1.41421356237310F));
-                }
-
-            }       /*  end of     if (iEnvelopeRight_man[i] == Qfmt( 1.000F) )  */
-        }      /* end of for loop */
-    }     /*  end  if (hFrameData2->ampRes) */
-
-
-    for (i = 0; i < hFrameData1->nNoiseFactors; i++)
-    {
-
-        noiseFloorLeft_exp[i]  = NOISE_FLOOR_OFFSET_PLUS_1 - noiseFloorLeft_man[i];
-        noiseFloorRight_exp[i] = noiseFloorRight_man[i] - SBR_ENERGY_PAN_OFFSET_INT;
-
-
-        /*
-         *  noiseFloorRight[i] = tempLeft / (1.0f + tempRight);
-         *  noiseFloorLeft[i]  = tempRight*noiseFloorRight[i];
-         *
-         *
-         *   noiseFloorRight[i] = 2^n/(1+2^m) =  2^(n-m)/(1 + 2^-m);
-         */
-        if (noiseFloorRight_exp[i] >= 0)
-        {
-            if (noiseFloorRight_exp[i] < 11)
-            {
-                noiseFloorRight_man[i] = one_over_one_plus_two_to_n[ noiseFloorRight_exp[i]];
-            }
-            else        /*  1/(1+2^-m) == 1 - 2^-m ;  for m >= 10  */
-            {
-                noiseFloorRight_man[i] = Qfmt(1.000F) - (Qfmt(1.000F) >> noiseFloorRight_exp[i]);
-            }
-        }
-        else
-        {
-            if (noiseFloorRight_exp[i] > -11)
-            {
-                noiseFloorRight_man[i] = Qfmt(1.000F) - one_over_one_plus_two_to_n[ -noiseFloorRight_exp[i]];
-            }
-            else        /*  1/(1+2^m) == 2^-m ;  for m >= 10  */
-            {
-                noiseFloorRight_man[i] = Qfmt(1.000F);
-                noiseFloorRight_exp[i] = 0;
-            }
-        }
-
-        noiseFloorRight_exp[i] = noiseFloorLeft_exp[i] - noiseFloorRight_exp[i];
-
-        /*
-         *   (2^m)*2^n/(1+2^m) =  2^n/(1 + 2^-m);
-         */
-
-        noiseFloorLeft_man[i] = noiseFloorRight_man[i];
-        noiseFloorLeft_exp[i] = noiseFloorLeft_exp[i];
-
-    }
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_envelope_unmapping.h b/media/libstagefright/codecs/aacdec/sbr_envelope_unmapping.h
deleted file mode 100644
index b949830..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_envelope_unmapping.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_envelope_unmapping.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_ENVELOPE_UNMAPPING_H
-#define SBR_ENVELOPE_UNMAPPING_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_sbr_frame_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-#define UNMAPPING_SCALE_INT         (-18)           /*  factor's 2-exponent */
-#define SBR_ENERGY_PAN_OFFSET_INT   12
-
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void sbr_envelope_unmapping(SBR_FRAME_DATA * hFrameData1,
-                            SBR_FRAME_DATA * hFrameData2);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_extract_extended_data.cpp b/media/libstagefright/codecs/aacdec/sbr_extract_extended_data.cpp
deleted file mode 100644
index 92b22f7..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_extract_extended_data.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_extract_extended_data.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    SBR_FRAME_DATA *hFrameData,     Destination for extracted data of left channel
-    SBR_FRAME_DATA *hFrameDataRight Destination for extracted data of right channel
-    BIT_BUFFER hBitBuf              pointer to bit buffer
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  Reads extension data from the bitstream
-
-  The bitstream format allows up to 4 kinds of extended data element.
-  Extended data may contain several elements, each identified by a 2-bit-ID.
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_extract_extended_data.h"
-#include    "buf_getbits.h"
-
-#ifdef PARAMETRICSTEREO
-#include    "ps_read_data.h"
-#endif
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_extract_extended_data(BIT_BUFFER * hBitBuf
-#ifdef PARAMETRICSTEREO         /* Parametric Stereo Decoder */
-                               , HANDLE_PS_DEC hParametricStereoDec
-#endif
-                              )
-{
-    Int32 extended_data;
-    Int32 i;
-    Int32 nBitsLeft;
-    Int32 extension_id;
-
-    extended_data = buf_get_1bit(hBitBuf);    /*  SI_SBR_EXTENDED_DATA_BITS  */
-
-    if (extended_data)
-    {
-        Int32 cnt;
-
-        cnt = buf_getbits(hBitBuf, SI_SBR_EXTENSION_SIZE_BITS);
-        if (cnt == (1 << SI_SBR_EXTENSION_SIZE_BITS) - 1)
-        {
-            cnt += buf_getbits(hBitBuf, SI_SBR_EXTENSION_ESC_COUNT_BITS);
-        }
-
-        nBitsLeft = (cnt << 3);
-        while (nBitsLeft > 7)
-        {
-            extension_id = buf_getbits(hBitBuf, SI_SBR_EXTENSION_ID_BITS);
-            nBitsLeft -= SI_SBR_EXTENSION_ID_BITS;
-
-            switch (extension_id)
-            {
-#ifdef HQ_SBR
-#ifdef PARAMETRICSTEREO
-
-                    /*
-                     *  Parametric Coding supports the Transient, Sinusoidal, Noise, and
-                     *  Parametric Stereo tools (MPEG4).
-                     *  3GPP use aac+ hq along with ps for enhanced aac+
-                     *  The PS tool uses complex-value QMF data, therefore can not be used
-                     *  with low power version of aac+
-                     */
-                case EXTENSION_ID_PS_CODING:
-
-                    if (hParametricStereoDec != NULL)
-                    {
-                        if (!hParametricStereoDec->psDetected)
-                        {
-                            /* parametric stereo detected */
-                            hParametricStereoDec->psDetected = 1;
-                        }
-
-                        nBitsLeft -= ps_read_data(hParametricStereoDec,
-                                                  hBitBuf,
-                                                  nBitsLeft);
-
-                    }
-
-                    break;
-#endif
-#endif
-                case 0:
-
-                default:
-                    /*   An unknown extension id causes the remaining extension data
-                     *   to be skipped
-                     */
-                    cnt = nBitsLeft >> 3; /* number of remaining bytes */
-
-                    for (i = 0; i < cnt; i++)
-                    {
-                        buf_getbits(hBitBuf, 8);
-                    }
-
-                    nBitsLeft -= (cnt << 3);
-            }
-        }
-        /* read fill bits for byte alignment */
-        buf_getbits(hBitBuf, nBitsLeft);
-    }
-}
-
-
-#endif
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_extract_extended_data.h b/media/libstagefright/codecs/aacdec/sbr_extract_extended_data.h
deleted file mode 100644
index bbca3b9..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_extract_extended_data.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_extract_extended_data.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_EXTRACT_EXTENDED_DATA_H
-#define SBR_EXTRACT_EXTENDED_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_frame_data.h"
-
-#ifdef PARAMETRICSTEREO
-#include    "s_ps_dec.h"
-#endif
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void sbr_extract_extended_data(BIT_BUFFER * hBitBuf
-#ifdef PARAMETRICSTEREO         /* Parametric Stereo Decoder */
-                               , HANDLE_PS_DEC hParametricStereoDec
-#endif
-                              );
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_find_start_andstop_band.cpp b/media/libstagefright/codecs/aacdec/sbr_find_start_andstop_band.cpp
deleted file mode 100644
index fc3d38f..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_find_start_andstop_band.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_find_start_andstop_band.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_find_start_andstop_band.h"
-#include    "get_sbr_startfreq.h"
-#include    "get_sbr_stopfreq.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-SBR_ERROR sbr_find_start_andstop_band(const Int32 samplingFreq,
-                                      const Int32 startFreq,
-                                      const Int32 stopFreq,
-                                      Int   *lsbM,
-                                      Int   *usb)
-{
-    /* Update startFreq struct */
-    *lsbM = get_sbr_startfreq(samplingFreq, startFreq);
-
-    if (*lsbM == 0)
-    {
-        return(SBRDEC_ILLEGAL_SCFACTORS);
-    }
-
-    /*Update stopFreq struct */
-    if (stopFreq < 13)
-    {
-        *usb = get_sbr_stopfreq(samplingFreq, stopFreq);
-    }
-    else if (stopFreq == 13)
-    {
-        *usb = 64;
-    }
-    else if (stopFreq == 14)
-    {
-        *usb = (*lsbM) << 1;
-    }
-    else
-    {
-        *usb = 3 * *lsbM;
-    }
-
-    /* limit to Nyqvist */
-    if (*usb > 64)
-    {
-        *usb = 64;
-    }
-
-    /* test for invalid lsb, usb combinations */
-    if ((*usb - *lsbM) > 48)
-    {
-        /*
-         *  invalid SBR bitstream ?
-         */
-        return(SBRDEC_INVALID_BITSTREAM);
-    }
-
-    if ((samplingFreq == 44100) && ((*usb - *lsbM) > 35))
-    {
-        /*
-         *  invalid SBR bitstream ?
-         */
-        return(SBRDEC_INVALID_BITSTREAM);
-    }
-
-    if ((samplingFreq >= 48000) && ((*usb - *lsbM) > 32))
-    {
-        /*
-         *  invalid SBR bitstream ?
-         */
-        return(SBRDEC_INVALID_BITSTREAM);
-    }
-
-    return(SBRDEC_OK);
-
-}
-
-#endif
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_find_start_andstop_band.h b/media/libstagefright/codecs/aacdec/sbr_find_start_andstop_band.h
deleted file mode 100644
index 88283c6..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_find_start_andstop_band.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
- Filename: sbr_find_start_andstop_band.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
- ----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_FIND_START_ANDSTOP_BAND_H
-#define SBR_FIND_START_ANDSTOP_BAND_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_sbr_error.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-SBR_ERROR sbr_find_start_andstop_band(const Int32 samplingFreq,
-                                      const Int32 startFreq,
-                                      const Int32 stopFreq,
-                                      Int *lsbM,
-                                      Int *usb);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_generate_high_freq.cpp b/media/libstagefright/codecs/aacdec/sbr_generate_high_freq.cpp
deleted file mode 100644
index 2126e47..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_generate_high_freq.cpp
+++ /dev/null
@@ -1,1040 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_generate_high_freq.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    HF generator with built-in QMF bank inverse filtering function
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#ifdef AAC_PLUS
-
-
-
-#include    "sbr_generate_high_freq.h"
-#include    "calc_auto_corr.h"
-#include    "sbr_inv_filt_levelemphasis.h"
-#include    "pv_div.h"
-#include    "fxp_mul32.h"
-#include    "aac_mem_funcs.h"
-#include    "sbr_constants.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void high_freq_coeff_LC(Int32 sourceBufferReal[][32],
-    Int32 *alphar[2],
-    Int32 *degreeAlias,
-    Int32 *v_k_master,
-    Int32 *scratch_mem);
-
-
-    void high_freq_generation_LC(Int32 sourceBufferReal[][32],
-                                 Int32 *targetBufferReal,
-                                 Int32 *alphar[2],
-                                 Int32 *degreeAlias,
-                                 Int32 *invFiltBandTable,
-                                 Int32 targetStopBand,
-                                 Int32 patchDistance,
-                                 Int32 numBandsInPatch,
-                                 Int32 startSample,
-                                 Int32 slopeLength,
-                                 Int32 stopSample,
-                                 Int32 *BwVector,
-                                 Int32 sbrStartFreqOffset);
-
-
-#ifdef HQ_SBR
-
-    void high_freq_coeff(Int32 sourceBufferReal[][32],
-                         Int32 sourceBufferImag[][32],
-                         Int32 *alphar[2],
-                         Int32 *alphai[2],
-                         Int32 *v_k_master);
-
-    void high_freq_generation(Int32 sourceBufferReal[][32],
-                              Int32 sourceBufferImag[][32],
-                              Int32 *targetBufferReal,
-                              Int32 *targetBufferImag,
-                              Int32 *alphar[2],
-                              Int32 *alphai[2],
-                              Int32 *invFiltBandTable,
-                              Int32 targetStopBand,
-                              Int32 patchDistance,
-                              Int32 numBandsInPatch,
-                              Int32 startSample,
-                              Int32 slopeLength,
-                              Int32 stopSample,
-                              Int32 *BwVector,
-                              Int32 sbrStartFreqOffset);
-
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_generate_high_freq(Int32 sourceBufferReal[][32],
-                            Int32 sourceBufferImag[][32],
-                            Int32 *targetBufferReal,
-                            Int32 *targetBufferImag,
-                            INVF_MODE *invFiltMode,
-                            INVF_MODE *prevInvFiltMode,
-                            Int32 *invFiltBandTable,
-                            Int32 noInvFiltBands,
-                            Int32 highBandStartSb,
-                            Int32  *v_k_master,
-                            Int32 numMaster,
-                            Int32 fs,
-                            Int32   *frameInfo,
-                            Int32 *degreeAlias,
-                            Int32  scratch_mem[][64],
-                            Int32  BwVector[MAX_NUM_PATCHES],
-                            Int32  BwVectorOld[MAX_NUM_PATCHES],
-                            struct PATCH *Patch,
-                            Int32 LC_flag,
-                            Int32 *highBandStopSb)
-{
-    Int32    i;
-    Int32    patch;
-    Int32    startSample;
-    Int32    stopSample;
-    Int32    goalSb;
-    Int32    targetStopBand;
-    Int32    sourceStartBand;
-    Int32    patchDistance;
-    Int32    numBandsInPatch;
-    Int32    sbrStartFreqOffset;
-
-    Int32  *alphar[2];
-    Int32  *alphai[2];
-
-    Int32    lsb = v_k_master[0];                           /* Lowest subband related to the synthesis filterbank */
-    Int32    usb = v_k_master[numMaster];                   /* Stop subband related to the synthesis filterbank */
-    Int32  xoverOffset = highBandStartSb - v_k_master[0]; /* Calculate distance in subbands between k0 and kx */
-
-
-
-    Int    slopeLength = 0;
-
-    Int32 firstSlotOffs = frameInfo[1];
-    Int32 lastSlotOffs  = frameInfo[frameInfo[0] + 1] - 16;
-
-
-    alphar[0] = scratch_mem[0];
-    alphar[1] = scratch_mem[1];
-    alphai[0] = scratch_mem[2];
-    alphai[1] = scratch_mem[3];
-
-
-    startSample = (firstSlotOffs << 1);
-    stopSample  = (lastSlotOffs << 1) + 32;
-
-
-    sbr_inv_filt_levelemphasis(invFiltMode,
-                               prevInvFiltMode,
-                               noInvFiltBands,
-                               BwVector,
-                               BwVectorOld);
-
-
-    if (LC_flag == ON)
-    {
-        /* Set subbands to zero  */
-
-        pv_memset((void *)&targetBufferReal[startSample*SBR_NUM_BANDS],
-                  0,
-                  (stopSample - startSample)*SBR_NUM_BANDS*sizeof(targetBufferReal[0]));
-
-        high_freq_coeff_LC(sourceBufferReal,
-                           alphar,
-                           degreeAlias,
-                           v_k_master,
-                           scratch_mem[4]);
-    }
-#ifdef HQ_SBR
-    else
-    {
-        /* Set subbands to zero  */
-
-        pv_memset((void *)&targetBufferReal[startSample*SBR_NUM_BANDS],
-                  0,
-                  (stopSample - startSample)*SBR_NUM_BANDS*sizeof(targetBufferReal[0]));
-        pv_memset((void *)&targetBufferImag[startSample*SBR_NUM_BANDS],
-                  0,
-                  (stopSample - startSample)*SBR_NUM_BANDS*sizeof(targetBufferImag[0]));
-
-        high_freq_coeff(sourceBufferReal,
-                        sourceBufferImag,
-                        alphar,
-                        alphai,
-                        v_k_master);
-
-    }
-#endif     /*  #ifdef HQ_SBR */
-
-
-
-
-    /*
-     * Initialize the patching parameter
-     */
-    switch (fs)
-
-    {
-            /*
-             *  goalSb = (int)( 2.048e6f / fs + 0.5f );
-             */
-        case 48000:
-            goalSb = 43;  /* 16 kHz band */
-            break;
-        case 32000:
-            goalSb = 64;  /* 16 kHz band */
-            break;
-        case 24000:
-            goalSb = 85;  /* 16 kHz band */
-            break;
-        case 22050:
-            goalSb = 93;  /* 16 kHz band */
-            break;
-        case 16000:
-            goalSb = 128;  /* 16 kHz band */
-            break;
-        case 44100:
-        default:
-            goalSb = 46;  /* 16 kHz band */
-            break;
-    }
-
-    i = 0;
-
-    if (goalSb > v_k_master[0])
-    {
-        if (goalSb < v_k_master[numMaster])
-        {
-            while (v_k_master[i] < goalSb)
-            {
-                i++;
-            }
-        }
-        else
-        {
-            i = numMaster;
-        }
-    }
-
-    goalSb =  v_k_master[i];
-
-    /* First patch */
-    sourceStartBand = xoverOffset + 1;
-    targetStopBand = lsb + xoverOffset;
-
-    /* even (odd) numbered channel must be patched to even (odd) numbered channel */
-    patch = 0;
-
-
-    sbrStartFreqOffset = targetStopBand;
-
-    while (targetStopBand < usb)
-    {
-        Patch->targetStartBand[patch] = targetStopBand;
-
-        numBandsInPatch = goalSb - targetStopBand;                   /* get the desired range of the patch */
-
-        if (numBandsInPatch >= lsb - sourceStartBand)
-        {
-            /* desired number bands are not available -> patch whole source range */
-            patchDistance   = targetStopBand - sourceStartBand;        /* get the targetOffset */
-            patchDistance   = patchDistance & ~1;                      /* rounding off odd numbers and make all even */
-            numBandsInPatch = lsb - (targetStopBand - patchDistance);
-
-            if (targetStopBand + numBandsInPatch > v_k_master[0])
-            {
-                i = numMaster;
-                if (targetStopBand + numBandsInPatch < v_k_master[numMaster])
-                {
-                    while (v_k_master[i] > targetStopBand + numBandsInPatch)
-                    {
-                        i--;
-                    }
-                }
-            }
-            else
-            {
-                i = 0;
-            }
-            numBandsInPatch =  v_k_master[i] - targetStopBand;
-        }
-
-        /* desired number bands are available -> get the minimal even patching distance */
-        patchDistance   = numBandsInPatch + targetStopBand - lsb;  /* get minimal distance */
-        patchDistance   = (patchDistance + 1) & ~1;                /* rounding up odd numbers and make all even */
-
-        /* All patches but first */
-        sourceStartBand = 1;
-
-        /* Check if we are close to goalSb */
-        if (goalSb - (targetStopBand + numBandsInPatch) < 3)
-        { /* MPEG doc */
-            goalSb = usb;
-        }
-
-
-        if ((numBandsInPatch < 3) && (patch > 0))
-        {
-            if (LC_flag == ON)
-            {
-
-                pv_memset((void *) &degreeAlias[targetStopBand], 0, numBandsInPatch*sizeof(*degreeAlias));
-            }
-            break;
-        }
-
-        if (numBandsInPatch <= 0)
-        {
-            continue;
-        }
-
-
-        /*
-         *  High Frequency generation
-         */
-
-        if (LC_flag == ON)
-        {
-
-            high_freq_generation_LC(sourceBufferReal,
-                                    (Int32 *)targetBufferReal,
-                                    alphar,
-                                    degreeAlias,
-                                    invFiltBandTable,
-                                    targetStopBand,
-                                    patchDistance,
-                                    numBandsInPatch,
-                                    startSample,
-                                    slopeLength,
-                                    stopSample,
-                                    BwVector,
-                                    sbrStartFreqOffset);
-
-        }
-#ifdef HQ_SBR
-        else
-        {
-
-            high_freq_generation(sourceBufferReal,
-                                 sourceBufferImag,
-                                 (Int32 *)targetBufferReal,
-                                 (Int32 *)targetBufferImag,
-                                 alphar,
-                                 alphai,
-                                 invFiltBandTable,
-                                 targetStopBand,
-                                 patchDistance,
-                                 numBandsInPatch,
-                                 startSample,
-                                 slopeLength,
-                                 stopSample,
-                                 BwVector,
-                                 sbrStartFreqOffset);
-
-        }
-#endif
-
-        targetStopBand += numBandsInPatch;
-
-        patch++;
-
-    }  /* targetStopBand */
-
-    Patch->noOfPatches = patch;
-
-    pv_memmove(BwVectorOld, BwVector, noInvFiltBands*sizeof(BwVector[0]));
-
-    *highBandStopSb = goalSb;
-
-
-}
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void high_freq_coeff_LC(Int32 sourceBufferReal[][32],
-                        Int32 *alphar[2],
-                        Int32 *degreeAlias,
-                        Int32 *v_k_master,
-                        Int32 *scratch_mem)
-{
-
-    Int32  fac;
-    Int32 *k1;
-    struct ACORR_COEFS ac;
-    struct intg_div  quotient;
-
-    Int32 temp1;
-    Int32 temp2;
-    Int32 temp3;
-    Int32 autoCorrLength;
-    Int32 loBand;
-
-    k1 = scratch_mem;
-
-
-    autoCorrLength = 38;
-
-    for (loBand = 1; loBand < v_k_master[0]; loBand++)
-    {
-
-        calc_auto_corr_LC(&ac,
-                          sourceBufferReal,
-                          loBand,
-                          autoCorrLength);
-
-        if (ac.r11r && ac.det)
-        {
-
-            pv_div(ac.r01r, ac.r11r, &quotient);
-
-            fac = -(quotient.quotient >> 2);   /*  Q28 */
-
-            if (quotient.shift_factor > 0)
-            {
-                fac >>= quotient.shift_factor;    /* Q28 */
-            }
-            else if (quotient.shift_factor < 0)
-            {
-                if (quotient.shift_factor > -4)     /* |fac| < 8 */
-                {
-                    fac <<= (-quotient.shift_factor); /* Q28 */
-                }
-                else
-                {
-                    fac = 0x80000000;     /* overshoot possible fac = -8 */
-                }
-            }
-
-            /*
-             *  prevent for overflow of reflection coefficients
-             */
-            if (quotient.shift_factor > 0)
-            {
-                k1[loBand] = - quotient.quotient >> quotient.shift_factor;
-            }
-            else if (quotient.shift_factor == 0)
-            {
-                if (quotient.quotient >= 0x40000000)
-                {
-                    k1[loBand] = (Int32)0xC0000000;   /* -1.0 in Q30  */
-                }
-                else if (quotient.quotient <= (Int32)0xC0000000)
-                {
-                    k1[loBand] = 0x40000000;   /*  1.0 in Q30  */
-                }
-                else
-                {
-                    k1[loBand] = -quotient.quotient;
-                }
-            }
-            else
-            {
-                if (quotient.quotient > 0)
-                {
-                    k1[loBand] = (Int32)0xC0000000;   /* -1.0 in Q30  */
-                }
-                else
-                {
-                    k1[loBand] = 0x40000000;   /*  1.0 in Q30  */
-                }
-            }
-            /*
-             *   alphar[1][loBand] = ( ac.r01r * ac.r12r - ac.r02r * ac.r11r ) / ac.det;
-             */
-
-            temp1  = -fxp_mul32_Q30(ac.r02r, ac.r11r);
-            temp1  =  fxp_mac32_Q30(ac.r01r, ac.r12r, temp1);
-
-            temp2 = ac.det;
-            temp3 = temp1 > 0 ? temp1 : -temp1;
-            temp2 = temp2 > 0 ? temp2 : -temp2;
-
-            /* prevent for shootovers */
-            if ((temp3 >> 2) >= temp2 || fac == (Int32)0x80000000)
-            {
-                alphar[0][loBand] = 0;
-                alphar[1][loBand] = 0;
-            }
-            else
-            {
-                pv_div(temp1, ac.det, &quotient);
-                /*
-                 *  alphar[1][loBand] is lesser than 4.0
-                 */
-                alphar[1][loBand] = quotient.quotient;
-                quotient.shift_factor += 2;             /* Q28 */
-
-                if (quotient.shift_factor > 0)
-                {
-                    alphar[1][loBand] >>= quotient.shift_factor;    /* Q28 */
-                }
-                else if (quotient.shift_factor < 0)     /* at this point can only be -1 */
-                {
-                    alphar[1][loBand] <<= (-quotient.shift_factor); /* Q28 */
-                }
-
-                /*
-                 *  alphar[0][loBand] = - ( ac.r01r + alphar[1][loBand] * ac.r12r ) / ac.r11r;
-                 */
-
-                pv_div(ac.r12r, ac.r11r, &quotient);
-
-                temp3 = (quotient.quotient >> 2);       /*  Q28 */
-
-                if (quotient.shift_factor > 0)
-                {
-                    temp3 >>= quotient.shift_factor;    /* Q28 */
-                }
-                else if (quotient.shift_factor < 0)
-                {
-                    temp3 <<= (-quotient.shift_factor); /* Q28 */
-                }
-
-                alphar[0][loBand] = fac - fxp_mul32_Q28(alphar[1][loBand], temp3) ;    /* Q28 */
-
-                if ((alphar[0][loBand] >= 0x40000000) || (alphar[0][loBand] <= (Int32)0xC0000000))
-                {
-                    alphar[0][loBand] = 0;
-                    alphar[1][loBand] = 0;
-                }
-
-            }
-
-        }
-        else
-        {
-            alphar[0][loBand] = 0;
-            alphar[1][loBand] = 0;
-
-            k1[loBand] = 0;
-        }
-
-    }
-
-    k1[0] = 0;
-    degreeAlias[1] = 0;
-    for (loBand = 2; loBand < v_k_master[0]; loBand++)
-    {
-        degreeAlias[loBand] = 0;
-        if ((!(loBand & 1)) && (k1[loBand] < 0))
-        {
-            if (k1[loBand-1] < 0)
-            { // 2-CH Aliasing Detection
-                degreeAlias[loBand]   = 0x40000000;
-                if (k1[loBand-2] > 0)
-                { // 3-CH Aliasing Detection
-                    degreeAlias[loBand-1] = 0x40000000 - fxp_mul32_Q30(k1[loBand-1], k1[loBand-1]);
-
-                }
-            }
-            else if (k1[loBand-2] > 0)
-            { // 3-CH Aliasing Detection
-                degreeAlias[loBand] = 0x40000000 - fxp_mul32_Q30(k1[loBand-1], k1[loBand-1]);
-            }
-        }
-        if ((loBand & 1) && (k1[loBand] > 0))
-        {
-            if (k1[loBand-1] > 0)
-            { // 2-CH Aliasing Detection
-                degreeAlias[loBand]   = 0x40000000;
-                if (k1[loBand-2] < 0)
-                { // 3-CH Aliasing Detection
-                    degreeAlias[loBand-1] = 0x40000000 - fxp_mul32_Q30(k1[loBand-1], k1[loBand-1]);
-                }
-            }
-            else if (k1[loBand-2] < 0)
-            { // 3-CH Aliasing Detection
-                degreeAlias[loBand] = 0x40000000 - fxp_mul32_Q30(k1[loBand-1], k1[loBand-1]);
-            }
-        }
-    }
-
-}
-
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void high_freq_generation_LC(Int32 sourceBufferReal[][32],
-                             Int32 *targetBufferReal,
-                             Int32 *alphar[2],
-                             Int32 *degreeAlias,
-                             Int32 *invFiltBandTable,
-                             Int32 targetStopBand,
-                             Int32 patchDistance,
-                             Int32 numBandsInPatch,
-                             Int32 startSample,
-                             Int32 slopeLength,
-                             Int32 stopSample,
-                             Int32 *BwVector,
-                             Int32 sbrStartFreqOffset)
-{
-
-    Int32  temp1;
-    Int32  temp2;
-    Int32  temp3;
-
-
-    Int32  a0r;
-    Int32  a1r;
-    Int32  i;
-    Int32  bw;
-    Int32  hiBand;
-    Int32  bwIndex;
-    Int32  loBand;
-    Int32  j;
-
-    bwIndex = 0;
-
-    for (hiBand = targetStopBand; hiBand < targetStopBand + numBandsInPatch; hiBand++)
-    {
-        loBand = hiBand - patchDistance;
-
-        if (hiBand != targetStopBand)
-        {
-            degreeAlias[hiBand] = degreeAlias[loBand];
-        }
-        else
-        {
-            degreeAlias[hiBand] = 0;
-        }
-
-        while (hiBand >= invFiltBandTable[bwIndex])
-        {
-            bwIndex++;
-        }
-
-        bw = BwVector[bwIndex];
-
-        /*
-         *  Inverse Filtering
-         */
-
-
-        j = hiBand - sbrStartFreqOffset;
-
-        if (bw > 0 && (alphar[0][loBand] | alphar[1][loBand]))
-        {
-            /* Apply current bandwidth expansion factor */
-            a0r = fxp_mul32_Q29(bw, alphar[0][loBand]);
-
-            bw  = fxp_mul32_Q31(bw, bw) << 2;
-
-            a1r = fxp_mul32_Q28(bw, alphar[1][loBand]);
-
-            i = startSample + slopeLength;
-
-            temp1 = sourceBufferReal[i    ][loBand];
-            temp2 = sourceBufferReal[i - 1][loBand];
-            temp3 = sourceBufferReal[i - 2][loBand];
-
-            for (; i < stopSample + slopeLength - 1; i++)
-            {
-
-
-                targetBufferReal[i*SBR_NUM_BANDS + j] = temp1 + fxp_mul32_Q28(a0r, temp2)  +
-                                                        fxp_mul32_Q28(a1r, temp3);
-
-
-                temp3 = temp2;
-                temp2 = temp1;
-                temp1 = sourceBufferReal[i + 1][loBand];
-            }
-            targetBufferReal[i*SBR_NUM_BANDS + j] = temp1 + fxp_mul32_Q28(a0r, temp2)  +
-                                                    fxp_mul32_Q28(a1r, temp3);
-
-        }
-        else
-        {
-
-            for (i = startSample + slopeLength; i < stopSample + slopeLength; i++)
-            {
-                targetBufferReal[i*SBR_NUM_BANDS + j] = sourceBufferReal[i][loBand];
-            }
-        }
-
-
-    }  /* hiBand */
-
-}
-
-
-#ifdef HQ_SBR
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void high_freq_coeff(Int32 sourceBufferReal[][32],
-                     Int32 sourceBufferImag[][32],
-                     Int32 *alphar[2],
-                     Int32 *alphai[2],
-                     Int32 *v_k_master)
-{
-
-    Int32  overflow_flag;
-
-    Int32  temp1r;
-    Int32  temp1i;
-    Int32  temp0r;
-    Int32  temp0i;
-    Int32  loBand;
-
-    struct ACORR_COEFS ac;
-    struct intg_div  quotient;
-
-    Int32 autoCorrLength;
-
-    autoCorrLength = 38;
-
-    for (loBand = 1; loBand < v_k_master[0]; loBand++)
-    {
-
-        calc_auto_corr(&ac,
-                       sourceBufferReal,
-                       sourceBufferImag,
-                       loBand,
-                       autoCorrLength);
-
-
-        overflow_flag = 0;
-
-        if (ac.det < 1)
-        {
-            /* ---  */
-            temp1r = 0;
-            temp1i = 0;
-            alphar[1][loBand] = 0;
-            alphai[1][loBand] = 0;
-
-        }
-        else
-        {
-
-            temp1r =  fxp_mul32_Q29(ac.r01r, ac.r12r);
-            temp1r =  fxp_msu32_Q29(ac.r01i, ac.r12i, temp1r);
-            temp1r =  fxp_msu32_Q29(ac.r02r, ac.r11r, temp1r);
-
-            temp1i =  fxp_mul32_Q29(ac.r01r, ac.r12i);
-            temp1i =  fxp_msu32_Q29(ac.r02i, ac.r11r, temp1i);
-            temp1i =  fxp_mac32_Q29(ac.r01i, ac.r12r, temp1i);
-
-            pv_div(temp1r, ac.det, &quotient);
-            overflow_flag = (quotient.shift_factor < -2) ? 1 : 0;
-            temp1r = quotient.quotient >> (2 + quotient.shift_factor);   /*  Q28 */
-            pv_div(temp1i, ac.det, &quotient);
-            overflow_flag = (quotient.shift_factor < -2) ? 1 : 0;
-            temp1i = quotient.quotient >> (2 + quotient.shift_factor);   /*  Q28 */
-
-            alphar[1][loBand] = temp1r;
-            alphai[1][loBand] = temp1i;
-
-        }
-
-        if (ac.r11r == 0)
-        {
-            temp0r = 0;
-            temp0i = 0;
-            alphar[0][loBand] = 0;
-            alphai[0][loBand] = 0;
-
-        }
-        else
-        {
-            temp0r = - (ac.r01r + fxp_mul32_Q28(temp1r, ac.r12r) + fxp_mul32_Q28(temp1i, ac.r12i));
-            temp0i = - (ac.r01i + fxp_mul32_Q28(temp1i, ac.r12r) - fxp_mul32_Q28(temp1r, ac.r12i));
-
-            pv_div(temp0r, ac.r11r, &quotient);
-            overflow_flag = (quotient.shift_factor < -2) ? 1 : 0;
-            temp0r = quotient.quotient >> (2 + quotient.shift_factor);   /*  Q28 */
-            pv_div(temp0i, ac.r11r, &quotient);
-            overflow_flag = (quotient.shift_factor < -2) ? 1 : 0;
-            temp0i = quotient.quotient >> (2 + quotient.shift_factor);   /*  Q28 */
-
-            alphar[0][loBand] = temp0r;
-            alphai[0][loBand] = temp0i;
-
-        }
-
-        /* prevent for shootovers */
-
-        if (fxp_mul32_Q28((temp0r >> 2), (temp0r >> 2)) + fxp_mul32_Q28((temp0i >> 2), (temp0i >> 2)) >= 0x10000000 ||
-                fxp_mul32_Q28((temp1r >> 2), (temp1r >> 2)) + fxp_mul32_Q28((temp1i >> 2), (temp1i >> 2)) >= 0x10000000 ||
-                overflow_flag)     /*  0x10000000 == 1 in Q28 */
-
-        {
-            alphar[0][loBand] = 0;
-            alphar[1][loBand] = 0;
-            alphai[0][loBand] = 0;
-            alphai[1][loBand] = 0;
-
-        }
-    }
-}
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-
-void high_freq_generation(Int32 sourceBufferReal[][32],
-                          Int32 sourceBufferImag[][32],
-                          Int32 *targetBufferReal,
-                          Int32 *targetBufferImag,
-                          Int32 *alphar[2],
-                          Int32 *alphai[2],
-                          Int32 *invFiltBandTable,
-                          Int32 targetStopBand,
-                          Int32 patchDistance,
-                          Int32 numBandsInPatch,
-                          Int32 startSample,
-                          Int32 slopeLength,
-                          Int32 stopSample,
-                          Int32 *BwVector,
-                          Int32 sbrStartFreqOffset)
-{
-    Int32  temp1_r;
-    Int32  temp2_r;
-    Int32  temp3_r;
-    Int32  temp1_i;
-    Int32  temp2_i;
-    Int32  temp3_i;
-
-
-    Int32  a0i;
-    Int32  a1i;
-    Int32  a0r;
-    Int32  a1r;
-    Int32  i;
-    Int32  bw;
-    Int32  hiBand;
-    Int32  bwIndex;
-    Int32  loBand;
-    Int32  j;
-
-
-
-    int64_t tmp;
-
-    bwIndex = 0;
-
-    for (hiBand = targetStopBand; hiBand < targetStopBand + numBandsInPatch; hiBand++)
-    {
-
-        loBand = hiBand - patchDistance;
-
-        while (hiBand >= invFiltBandTable[bwIndex])
-        {
-            bwIndex++;
-        }
-
-        bw = BwVector[bwIndex];
-
-        /*
-         *  Inverse Filtering
-         */
-
-
-        j = hiBand - sbrStartFreqOffset;
-
-        if (bw >= 0 && (alphar[0][loBand] | alphar[1][loBand] |
-                        alphai[0][loBand] | alphai[1][loBand]))
-        {
-            /* Apply current bandwidth expansion factor */
-            a0r = fxp_mul32_Q29(bw, alphar[0][loBand]);
-            a0i = fxp_mul32_Q29(bw, alphai[0][loBand]);
-
-
-            bw  = fxp_mul32_Q30(bw, bw);
-
-
-            a1r = fxp_mul32_Q28(bw, alphar[1][loBand]);
-            a1i = fxp_mul32_Q28(bw, alphai[1][loBand]);
-
-
-            i  = startSample + slopeLength;
-            j += i * SBR_NUM_BANDS;
-
-            temp1_r = sourceBufferReal[i    ][loBand];
-            temp2_r = sourceBufferReal[i - 1][loBand];
-            temp3_r = sourceBufferReal[i - 2][loBand];
-
-            temp1_i = sourceBufferImag[i    ][loBand];
-            temp2_i = sourceBufferImag[i - 1][loBand];
-            temp3_i = sourceBufferImag[i - 2][loBand];
-
-            while (i < stopSample + slopeLength)
-            {
-                tmp =  fxp_mac64_Q31(((int64_t)temp1_r << 28),  a0r, temp2_r);
-                tmp =  fxp_mac64_Q31(tmp, -a0i, temp2_i);
-                tmp =  fxp_mac64_Q31(tmp,  a1r, temp3_r);
-                targetBufferReal[j] = (Int32)(fxp_mac64_Q31(tmp, -a1i, temp3_i) >> 28);
-
-                tmp =  fxp_mac64_Q31(((int64_t)temp1_i << 28),  a0i, temp2_r);
-                tmp =  fxp_mac64_Q31(tmp,  a0r, temp2_i);
-                tmp =  fxp_mac64_Q31(tmp,  a1i, temp3_r);
-                targetBufferImag[j] = (Int32)(fxp_mac64_Q31(tmp,  a1r, temp3_i) >> 28);
-
-                i++;
-                j += SBR_NUM_BANDS;
-
-                temp3_r  = temp2_r;
-                temp2_r  = temp1_r;
-                temp1_r  = sourceBufferReal[i ][loBand];
-
-                temp3_i  = temp2_i;
-                temp2_i  = temp1_i;
-                temp1_i  = sourceBufferImag[i ][loBand];
-
-            }
-
-        }
-
-
-
-        else
-        {
-            i = startSample + slopeLength;
-            j += i * SBR_NUM_BANDS;
-
-            for (; i < stopSample + slopeLength; i++)
-            {
-                targetBufferReal[j] = sourceBufferReal[i][loBand];
-                targetBufferImag[j] = sourceBufferImag[i][loBand];
-                j += SBR_NUM_BANDS;
-            }
-        }
-    }
-}
-
-#endif
-
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/sbr_generate_high_freq.h b/media/libstagefright/codecs/aacdec/sbr_generate_high_freq.h
deleted file mode 100644
index 0e9c928..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_generate_high_freq.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_generate_high_freq.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_GENERATE_HIGH_FREQ_H
-#define SBR_GENERATE_HIGH_FREQ_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include    "e_invf_mode.h"
-#include    "s_patch.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-
-
-
-    void sbr_generate_high_freq(
-        Int32 sourceBufferReal[][32],
-        Int32 sourceBufferImag[][32],
-        Int32 *targetBufferReal,
-        Int32 *targetBufferImag,
-        INVF_MODE *invFiltMode,
-        INVF_MODE *prevInvFiltMode,
-        Int32 *invFiltBandTable,
-        Int32 noInvFiltBands,
-        Int32 highBandStartSb,
-        Int32 *v_k_master,
-        Int32 numMaster,
-        Int32 fs,
-        Int32 *frameInfo,
-        Int32 *degreeAlias,
-        Int32 scratch_mem[][64],
-        Int32 BwVector[MAX_NUM_PATCHES],
-        Int32 BwVectorOld[MAX_NUM_PATCHES],
-        struct PATCH * Patch,
-        Int32 LC_flag,
-        Int32 *highBandStopSb);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_additional_data.cpp b/media/libstagefright/codecs/aacdec/sbr_get_additional_data.cpp
deleted file mode 100644
index 60072dd..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_additional_data.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_additional_data.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_get_additional_data.h"
-#include    "buf_getbits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_get_additional_data(SBR_FRAME_DATA * hFrameData,
-                             BIT_BUFFER     * hBitBuf)
-{
-    Int32 i;
-
-    Int32 flag = buf_getbits(hBitBuf, 1);
-
-    if (flag)
-    {
-        for (i = 0; i < hFrameData->nSfb[HI]; i++)
-        {
-            hFrameData->addHarmonics[i] = buf_getbits(hBitBuf, 1);
-        }
-    }
-}
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_additional_data.h b/media/libstagefright/codecs/aacdec/sbr_get_additional_data.h
deleted file mode 100644
index 51285c5..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_additional_data.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_additional_data.h
- Funtions:
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_GET_ADDITIONAL_DATA_H
-#define SBR_GET_ADDITIONAL_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_header_data.h"
-#include    "s_sbr_frame_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void sbr_get_additional_data(SBR_FRAME_DATA * hFrameData,
-                             BIT_BUFFER     * hBitBuf);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_cpe.cpp b/media/libstagefright/codecs/aacdec/sbr_get_cpe.cpp
deleted file mode 100644
index 657d032..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_cpe.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_cpe.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Arguments:     hFrameDataLeft  - handle to struct SBR_FRAME_DATA for first channel
-                hFrameDataRight - handle to struct SBR_FRAME_DATA for first channel
-                hBitBuf         - handle to struct BIT_BUF
-
- Return:        SbrFrameOK
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_get_cpe.h"
-#include    "buf_getbits.h"
-#include    "extractframeinfo.h"
-#include    "sbr_get_dir_control_data.h"
-#include    "sbr_get_envelope.h"
-#include    "sbr_get_noise_floor_data.h"
-#include    "sbr_get_additional_data.h"
-#include    "sbr_extract_extended_data.h"
-#include    "aac_mem_funcs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-SBR_ERROR sbr_get_cpe(SBR_FRAME_DATA * hFrameDataLeft,
-                      SBR_FRAME_DATA * hFrameDataRight,
-                      BIT_BUFFER  * hBitBuf)
-{
-    Int32 i;
-    Int32 bits;
-    SBR_ERROR err =  SBRDEC_OK;
-
-    /* reserved bits */
-    bits = buf_getbits(hBitBuf, SI_SBR_RESERVED_PRESENT);
-
-    if (bits)
-    {
-        buf_getbits(hBitBuf, SI_SBR_RESERVED_BITS_DATA);
-        buf_getbits(hBitBuf, SI_SBR_RESERVED_BITS_DATA);
-    }
-
-    /* Read coupling flag */
-    bits = buf_getbits(hBitBuf, SI_SBR_COUPLING_BITS);
-
-    if (bits)
-    {
-        hFrameDataLeft->coupling = COUPLING_LEVEL;
-        hFrameDataRight->coupling = COUPLING_BAL;
-    }
-    else
-    {
-        hFrameDataLeft->coupling = COUPLING_OFF;
-        hFrameDataRight->coupling = COUPLING_OFF;
-    }
-
-
-    err = extractFrameInfo(hBitBuf, hFrameDataLeft);
-
-    if (err != SBRDEC_OK)
-    {
-        return err;
-    }
-
-    if (hFrameDataLeft->coupling)
-    {
-
-        pv_memcpy(hFrameDataRight->frameInfo,
-                  hFrameDataLeft->frameInfo,
-                  LENGTH_FRAME_INFO * sizeof(Int32));
-
-        hFrameDataRight->nNoiseFloorEnvelopes = hFrameDataLeft->nNoiseFloorEnvelopes;
-        hFrameDataRight->frameClass = hFrameDataLeft->frameClass;
-
-
-        sbr_get_dir_control_data(hFrameDataLeft, hBitBuf);
-        sbr_get_dir_control_data(hFrameDataRight, hBitBuf);
-
-        for (i = 0; i < hFrameDataLeft->nNfb; i++)
-        {
-            hFrameDataLeft->sbr_invf_mode_prev[i]  = hFrameDataLeft->sbr_invf_mode[i];
-            hFrameDataRight->sbr_invf_mode_prev[i] = hFrameDataRight->sbr_invf_mode[i];
-
-            hFrameDataLeft->sbr_invf_mode[i]  = (INVF_MODE) buf_getbits(hBitBuf, SI_SBR_INVF_MODE_BITS);
-            hFrameDataRight->sbr_invf_mode[i] = hFrameDataLeft->sbr_invf_mode[i];
-        }
-
-        sbr_get_envelope(hFrameDataLeft, hBitBuf);
-        sbr_get_noise_floor_data(hFrameDataLeft, hBitBuf);
-        sbr_get_envelope(hFrameDataRight, hBitBuf);
-
-    }
-    else
-    {
-        err = extractFrameInfo(hBitBuf, hFrameDataRight);
-
-        if (err != SBRDEC_OK)
-        {
-            return err;
-        }
-
-
-        sbr_get_dir_control_data(hFrameDataLeft,  hBitBuf);
-        sbr_get_dir_control_data(hFrameDataRight, hBitBuf);
-
-        for (i = 0; i <  hFrameDataLeft->nNfb; i++)
-        {
-            hFrameDataLeft->sbr_invf_mode_prev[i]  = hFrameDataLeft->sbr_invf_mode[i];
-            hFrameDataLeft->sbr_invf_mode[i]  =
-                (INVF_MODE) buf_getbits(hBitBuf, SI_SBR_INVF_MODE_BITS);
-        }
-
-        for (i = 0; i <  hFrameDataRight->nNfb; i++)
-        {
-            hFrameDataRight->sbr_invf_mode_prev[i] = hFrameDataRight->sbr_invf_mode[i];
-
-            hFrameDataRight->sbr_invf_mode[i] =
-                (INVF_MODE) buf_getbits(hBitBuf, SI_SBR_INVF_MODE_BITS);
-        }
-        sbr_get_envelope(hFrameDataLeft,  hBitBuf);
-        sbr_get_envelope(hFrameDataRight, hBitBuf);
-
-        sbr_get_noise_floor_data(hFrameDataLeft,  hBitBuf);
-
-    }
-
-    sbr_get_noise_floor_data(hFrameDataRight, hBitBuf);
-
-    pv_memset((void *)hFrameDataLeft->addHarmonics,
-              0,
-              hFrameDataLeft->nSfb[HI]*sizeof(Int32));
-
-    pv_memset((void *)hFrameDataRight->addHarmonics,
-              0,
-              hFrameDataRight->nSfb[HI]*sizeof(Int32));
-
-    sbr_get_additional_data(hFrameDataLeft, hBitBuf);
-    sbr_get_additional_data(hFrameDataRight, hBitBuf);
-
-    sbr_extract_extended_data(hBitBuf
-#ifdef PARAMETRICSTEREO
-                              , NULL
-#endif
-                             );
-
-    return SBRDEC_OK;
-
-}
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_cpe.h b/media/libstagefright/codecs/aacdec/sbr_get_cpe.h
deleted file mode 100644
index b6f99f8..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_cpe.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_cpe.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_GET_CPE_H
-#define SBR_GET_CPE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_frame_data.h"
-#include    "e_sbr_error.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-SBR_ERROR sbr_get_cpe(SBR_FRAME_DATA * hFrameDataLeft,
-                      SBR_FRAME_DATA * hFrameDataRight,
-                      BIT_BUFFER * hBitBuf);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_dir_control_data.cpp b/media/libstagefright/codecs/aacdec/sbr_get_dir_control_data.cpp
deleted file mode 100644
index 3d7ad8c..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_dir_control_data.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_dir_control_data.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Arguments:     h_frame_data - handle to struct SBR_FRAME_DATA
-                hBitBuf      - handle to struct BIT_BUF
-
- Return:        void
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-  Reads direction control data from bitstream
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_get_dir_control_data.h"
-#include    "buf_getbits.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_get_dir_control_data(SBR_FRAME_DATA * h_frame_data,
-                              BIT_BUFFER     * hBitBuf)
-{
-    Int32 i;
-
-    h_frame_data->nNoiseFloorEnvelopes = h_frame_data->frameInfo[0] > 1 ? 2 : 1;
-
-
-    for (i = 0; i < h_frame_data->frameInfo[0]; i++)
-    {
-        h_frame_data->domain_vec1[i] = buf_getbits(hBitBuf, SI_SBR_DOMAIN_BITS);
-    }
-
-    for (i = 0; i < h_frame_data->nNoiseFloorEnvelopes; i++)
-    {
-        h_frame_data->domain_vec2[i] = buf_getbits(hBitBuf, SI_SBR_DOMAIN_BITS);
-    }
-}
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_dir_control_data.h b/media/libstagefright/codecs/aacdec/sbr_get_dir_control_data.h
deleted file mode 100644
index 3b587dc..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_dir_control_data.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_dir_control_data.h
- Funtions:
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_GET_DIR_CONTROL_DATA_H
-#define SBR_GET_DIR_CONTROL_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_frame_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void sbr_get_dir_control_data(SBR_FRAME_DATA * h_frame_data,
-                              BIT_BUFFER * hBitBuf);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_envelope.cpp b/media/libstagefright/codecs/aacdec/sbr_get_envelope.cpp
deleted file mode 100644
index e92abb1..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_envelope.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_envelope.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Arguments:     h_frame_data - handle to struct SBR_FRAME_DATA
-                hBitBuf      - handle to struct BIT_BUF
-                channel      - channel number
-
- Return:        void
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-          Reads envelope data from bitstream
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_get_envelope.h"
-#include    "s_huffman.h"
-#include    "e_coupling_mode.h"
-#include    "sbr_code_book_envlevel.h"
-#include    "buf_getbits.h"
-#include    "sbr_decode_huff_cw.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_get_envelope(SBR_FRAME_DATA * h_frame_data,
-                      BIT_BUFFER * hBitBuf)
-{
-    Int32   i;
-    Int32   j;
-    Int32   tmp;
-    Int32   no_band[MAX_ENVELOPES];
-    Int32   delta = 0;
-    Int32   offset = 0;
-    Int32   ampRes;
-    Int32   envDataTableCompFactor;
-    Int32   start_bits;
-    Int32   start_bits_balance;
-    SbrHuffman    hcb_t;
-    SbrHuffman    hcb_f;
-    COUPLING_MODE coupling = h_frame_data->coupling;
-
-    h_frame_data->nScaleFactors = 0;
-
-    if ((h_frame_data->frameClass   == FIXFIX) &&
-            (h_frame_data->frameInfo[0] == 1))
-    {
-        h_frame_data->ampRes = SBR_AMP_RES_1_5;
-    }
-    else
-    {
-        h_frame_data->ampRes = h_frame_data->sbr_header.ampResolution;
-    }
-
-    ampRes = h_frame_data->ampRes;
-
-    /*
-     *    Set number of bits for first value depending on amplitude resolution
-     */
-    if (ampRes == SBR_AMP_RES_3_0)
-    {
-        start_bits         = SI_SBR_START_ENV_BITS_AMP_RES_3_0;
-        start_bits_balance = SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_3_0;
-    }
-    else
-    {
-        start_bits         = SI_SBR_START_ENV_BITS_AMP_RES_1_5;
-        start_bits_balance = SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_1_5;
-    }
-
-    /*
-     *    Calculate number of values for each envelope and alltogether
-     */
-    for (i = 0; i < h_frame_data->frameInfo[0]; i++)
-    {
-        no_band[i] =
-            h_frame_data->nSfb[h_frame_data->frameInfo[h_frame_data->frameInfo[0] + 2 + i]];
-        h_frame_data->nScaleFactors += no_band[i];
-    }
-
-
-    /*
-     *    Select huffman codebook depending on coupling mode and amplitude resolution
-     */
-    if (coupling == COUPLING_BAL)
-    {
-        envDataTableCompFactor = 1;
-        if (ampRes == SBR_AMP_RES_1_5)
-        {
-            hcb_t = bookSbrEnvBalance10T;
-            hcb_f = bookSbrEnvBalance10F;
-        }
-        else
-        {
-            hcb_t = bookSbrEnvBalance11T;
-            hcb_f = bookSbrEnvBalance11F;
-        }
-    }
-    else
-    {
-        envDataTableCompFactor = 0;
-        if (ampRes == SBR_AMP_RES_1_5)
-        {
-            hcb_t = bookSbrEnvLevel10T;
-            hcb_f = bookSbrEnvLevel10F;
-        }
-        else
-        {
-            hcb_t = bookSbrEnvLevel11T;
-            hcb_f = bookSbrEnvLevel11F;
-        }
-    }
-
-    /*
-     *    Now read raw envelope data
-     */
-    for (j = 0; j < h_frame_data->frameInfo[0]; j++)
-    {
-        if (h_frame_data->domain_vec1[j] == FREQ)
-        {
-            if (coupling == COUPLING_BAL)
-            {
-                tmp = buf_getbits(hBitBuf, start_bits_balance);
-                h_frame_data->iEnvelope_man[offset] = tmp << envDataTableCompFactor;
-            }
-            else
-            {
-                tmp = buf_getbits(hBitBuf, start_bits);
-                h_frame_data->iEnvelope_man[offset] = tmp;
-            }
-        }
-
-        for (i = (1 - h_frame_data->domain_vec1[j]); i < no_band[j]; i++)
-        {
-
-            if (h_frame_data->domain_vec1[j] == FREQ)
-            {
-                delta = sbr_decode_huff_cw(hcb_f, hBitBuf);
-            }
-            else
-            {
-                delta = sbr_decode_huff_cw(hcb_t, hBitBuf);
-            }
-
-            h_frame_data->iEnvelope_man[offset + i] = delta << envDataTableCompFactor;
-        }
-        offset += no_band[j];
-    }
-
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_envelope.h b/media/libstagefright/codecs/aacdec/sbr_get_envelope.h
deleted file mode 100644
index b7a266a..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_envelope.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_envelope.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_GET_ENVELOPE_H
-#define SBR_GET_ENVELOPE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_frame_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void sbr_get_envelope(SBR_FRAME_DATA * h_frame_data,
-    BIT_BUFFER  * hBitBuf);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_header_data.cpp b/media/libstagefright/codecs/aacdec/sbr_get_header_data.cpp
deleted file mode 100644
index 42789ae..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_header_data.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_header_data.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Arguments:     h_sbr_header - handle to struct SBR_HEADER_DATA
-                hBitBuf      - handle to struct BIT_BUFFER
-                id_sbr       - SBR_ELEMENT_ID
-
- Return:        error status - 0 if ok
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Reads header data from bitstream
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_get_header_data.h"
-#include    "sbr_constants.h"
-#include    "buf_getbits.h"
-#include    "aac_mem_funcs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-SBR_HEADER_STATUS sbr_get_header_data(SBR_HEADER_DATA   * h_sbr_header,
-                                      BIT_BUFFER          * hBitBuf,
-                                      SBR_SYNC_STATE     syncState)
-{
-    SBR_HEADER_DATA lastHeader;
-    Int32 headerExtra1, headerExtra2;
-
-
-    /* Copy header to temporary header */
-    if (syncState == SBR_ACTIVE)
-    {
-        pv_memcpy(&lastHeader, h_sbr_header, sizeof(SBR_HEADER_DATA));
-    }
-    else
-    {
-        pv_memset((void *)&lastHeader, 0, sizeof(SBR_HEADER_DATA));
-    }
-
-
-    /* Read new header from bitstream */
-    h_sbr_header->ampResolution   = buf_getbits(hBitBuf, SI_SBR_AMP_RES_BITS);
-    h_sbr_header->startFreq       = buf_getbits(hBitBuf, SI_SBR_START_FREQ_BITS);
-    h_sbr_header->stopFreq        = buf_getbits(hBitBuf, SI_SBR_STOP_FREQ_BITS);
-    h_sbr_header->xover_band      = buf_getbits(hBitBuf, SI_SBR_XOVER_BAND_BITS);
-
-    buf_getbits(hBitBuf, SI_SBR_RESERVED_BITS_HDR);
-
-    headerExtra1    = buf_getbits(hBitBuf, SI_SBR_HEADER_EXTRA_1_BITS);
-    headerExtra2    = buf_getbits(hBitBuf, SI_SBR_HEADER_EXTRA_2_BITS);
-
-    /* handle extra header information */
-    if (headerExtra1)
-    {
-        h_sbr_header->freqScale   = buf_getbits(hBitBuf, SI_SBR_FREQ_SCALE_BITS);
-        h_sbr_header->alterScale  = buf_getbits(hBitBuf, SI_SBR_ALTER_SCALE_BITS);
-        h_sbr_header->noise_bands = buf_getbits(hBitBuf, SI_SBR_NOISE_BANDS_BITS);
-    }
-    else
-    { /* Set default values.*/
-        h_sbr_header->freqScale   = SBR_FREQ_SCALE_DEFAULT;
-        h_sbr_header->alterScale  = SBR_ALTER_SCALE_DEFAULT;
-        h_sbr_header->noise_bands = SBR_NOISE_BANDS_DEFAULT;
-    }
-
-
-    if (headerExtra2)
-    {
-        h_sbr_header->limiterBands    = buf_getbits(hBitBuf, SI_SBR_LIMITER_BANDS_BITS);
-        h_sbr_header->limiterGains    = buf_getbits(hBitBuf, SI_SBR_LIMITER_GAINS_BITS);
-        h_sbr_header->interpolFreq    = buf_getbits(hBitBuf, SI_SBR_INTERPOL_FREQ_BITS);
-        h_sbr_header->smoothingLength = buf_getbits(hBitBuf, SI_SBR_SMOOTHING_LENGTH_BITS);
-    }
-    else
-    { /* Set default values.*/
-        h_sbr_header->limiterBands    = SBR_LIMITER_BANDS_DEFAULT;
-        h_sbr_header->limiterGains    = SBR_LIMITER_GAINS_DEFAULT;
-        h_sbr_header->interpolFreq    = SBR_INTERPOL_FREQ_DEFAULT;
-        h_sbr_header->smoothingLength = SBR_SMOOTHING_LENGTH_DEFAULT;
-    }
-
-    if (syncState == SBR_ACTIVE)
-    {
-        h_sbr_header->status = HEADER_OK;
-
-        /* look for new settings */
-        if (lastHeader.startFreq   != h_sbr_header->startFreq   ||
-                lastHeader.stopFreq    != h_sbr_header->stopFreq    ||
-                lastHeader.xover_band  != h_sbr_header->xover_band  ||
-                lastHeader.freqScale   != h_sbr_header->freqScale   ||
-                lastHeader.alterScale  != h_sbr_header->alterScale  ||
-                lastHeader.noise_bands != h_sbr_header->noise_bands)
-        {
-            h_sbr_header->status = HEADER_RESET;
-        }
-    }
-    else
-    {
-        h_sbr_header->status = HEADER_RESET;
-    }
-
-    return h_sbr_header->status;
-}
-
-#endif
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_header_data.h b/media/libstagefright/codecs/aacdec/sbr_get_header_data.h
deleted file mode 100644
index 7bfb272..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_header_data.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_header_data.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_GET_HEADER_DATA_H
-#define SBR_GET_HEADER_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_header_data.h"
-#include    "e_sbr_element_id.h"
-#include    "e_sbr_sync_state.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-SBR_HEADER_STATUS sbr_get_header_data(SBR_HEADER_DATA   *h_sbr_header,
-                                      BIT_BUFFER  * hBitBuf,
-                                      SBR_SYNC_STATE     syncState);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_noise_floor_data.cpp b/media/libstagefright/codecs/aacdec/sbr_get_noise_floor_data.cpp
deleted file mode 100644
index 8d86158..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_noise_floor_data.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_noise_floor_data.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Arguments:     h_frame_data - handle to struct SBR_FRAME_DATA
-                hBitBuf      - handle to struct BIT_BUF
-
- Return:        void
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Reads noise-floor-level data from bitstream
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_get_noise_floor_data.h"
-#include    "e_coupling_mode.h"
-#include    "buf_getbits.h"
-#include    "sbr_code_book_envlevel.h"
-#include    "s_huffman.h"
-#include    "sbr_decode_huff_cw.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_get_noise_floor_data(SBR_FRAME_DATA * h_frame_data,
-                              BIT_BUFFER * hBitBuf)
-{
-    Int32 i;
-    Int32 j;
-    Int32 k;
-    Int32 tmp;
-    Int32 delta;
-    Int32 noNoiseBands = h_frame_data->nNfb;
-    Int32 envDataTableCompFactor;
-
-    COUPLING_MODE coupling = h_frame_data->coupling;
-
-    SbrHuffman hcb_noiseF;
-    SbrHuffman hcb_noise;
-
-
-    if (coupling == COUPLING_BAL)
-    {
-        hcb_noise  = bookSbrNoiseBalance11T;
-        hcb_noiseF = bookSbrEnvBalance11F;  /* "bookSbrNoiseBalance11F" */
-        envDataTableCompFactor = 1;
-    }
-    else
-    {
-        hcb_noise  = bookSbrNoiseLevel11T;
-        hcb_noiseF = bookSbrEnvLevel11F;  /* "bookSbrNoiseLevel11F" */
-        envDataTableCompFactor = 0;
-    }
-
-    /*
-     *  Calculate number of values alltogether
-     */
-    h_frame_data->nNoiseFactors = h_frame_data->frameInfo[((h_frame_data->frameInfo[0]) << 1) + 3] * noNoiseBands;
-
-
-    for (i = 0; i < h_frame_data->nNoiseFloorEnvelopes; i++)
-    {
-        k = i * noNoiseBands;
-        if (h_frame_data->domain_vec2[i] == FREQ)
-        {
-            if (coupling == COUPLING_BAL)
-            {
-                tmp = buf_getbits(hBitBuf, SI_SBR_START_NOISE_BITS_BALANCE_AMP_RES_3_0) << 1;  /*  max. 62  */
-                h_frame_data->sbrNoiseFloorLevel_man[k] = tmp;
-                h_frame_data->sbrNoiseFloorLevel_exp[k] =   0;
-            }
-            else
-            {
-                tmp = buf_getbits(hBitBuf, SI_SBR_START_NOISE_BITS_AMP_RES_3_0);  /*  max. 31  */
-                h_frame_data->sbrNoiseFloorLevel_man[k] = tmp;
-                h_frame_data->sbrNoiseFloorLevel_exp[k] =   0;
-            }
-
-            for (j = 1; j < noNoiseBands; j++)
-            {
-                delta = sbr_decode_huff_cw(hcb_noiseF, hBitBuf); /*
-                                                                  *  -31 < delta < 31
-                                                                  *  -24 < delta < 24   COUPLING_BAL (incl. <<1)
-                                                                  */
-                h_frame_data->sbrNoiseFloorLevel_man[k+j] = delta << envDataTableCompFactor;
-                h_frame_data->sbrNoiseFloorLevel_exp[k+j] =   0;
-            }
-        }
-        else
-        {
-            for (j = 0; j < noNoiseBands; j++)
-            {
-                delta = sbr_decode_huff_cw(hcb_noise, hBitBuf);  /*
-                                                                  *  -31 < delta < 31
-                                                                  *  -24 < delta < 24   COUPLING_BAL (incl. <<1)
-                                                                  */
-                h_frame_data->sbrNoiseFloorLevel_man[k+j] = delta << envDataTableCompFactor;
-                h_frame_data->sbrNoiseFloorLevel_exp[k+j] =   0;
-            }
-        }
-    }
-}
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_noise_floor_data.h b/media/libstagefright/codecs/aacdec/sbr_get_noise_floor_data.h
deleted file mode 100644
index e61abda..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_noise_floor_data.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_noise_floor_data.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_GET_NOISE_FLOOR_DATA_H
-#define SBR_GET_NOISE_FLOOR_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_frame_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    void sbr_get_noise_floor_data(SBR_FRAME_DATA * h_frame_data,
-    BIT_BUFFER * hBitBuf);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_sce.cpp b/media/libstagefright/codecs/aacdec/sbr_get_sce.cpp
deleted file mode 100644
index ba514f4..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_sce.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_sce.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Arguments:     hFrameData - handle to struct SBR_FRAME_DATA
-                hBitBuf    - handle to struct BIT_BUF
-
- Return:        SbrFrameOK
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-
-#include    "sbr_get_sce.h"
-#include    "sbr_get_additional_data.h"
-#include    "sbr_extract_extended_data.h"
-#include    "buf_getbits.h"
-#include    "sbr_get_envelope.h"
-#include    "sbr_get_noise_floor_data.h"
-#include    "extractframeinfo.h"
-#include    "sbr_get_dir_control_data.h"
-#include    "e_invf_mode.h"
-#include    "aac_mem_funcs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-SBR_ERROR sbr_get_sce(SBR_FRAME_DATA * hFrameData,
-                      BIT_BUFFER * hBitBuf
-#ifdef PARAMETRICSTEREO
-                      , HANDLE_PS_DEC hParametricStereoDec
-#endif
-                     )
-{
-    Int32 i;
-    Int32 bits;
-    SBR_ERROR err =  SBRDEC_OK;
-
-    /* reserved bits */
-    bits = buf_getbits(hBitBuf, SI_SBR_RESERVED_PRESENT);
-
-    if (bits)
-    {
-        buf_getbits(hBitBuf, SI_SBR_RESERVED_BITS_DATA);
-    }
-
-    /* side info */
-    err = extractFrameInfo(hBitBuf, hFrameData);
-
-    if (err != SBRDEC_OK)
-    {
-        return err;
-    }
-
-
-    sbr_get_dir_control_data(hFrameData, hBitBuf);
-
-    for (i = 0; i < hFrameData->nNfb; i++)
-    {
-        hFrameData->sbr_invf_mode_prev[i] = hFrameData->sbr_invf_mode[i];
-        hFrameData->sbr_invf_mode[i] =
-            (INVF_MODE) buf_getbits(hBitBuf, SI_SBR_INVF_MODE_BITS);
-    }
-
-
-    /* raw data */
-    sbr_get_envelope(hFrameData, hBitBuf);
-
-    sbr_get_noise_floor_data(hFrameData, hBitBuf);
-
-    pv_memset((void *)hFrameData->addHarmonics,
-              0,
-              hFrameData->nSfb[HI]*sizeof(Int32));
-
-    sbr_get_additional_data(hFrameData, hBitBuf);
-
-    sbr_extract_extended_data(hBitBuf
-#ifdef PARAMETRICSTEREO
-                              , hParametricStereoDec
-#endif
-                             );
-
-    hFrameData->coupling = COUPLING_OFF;
-
-    return SBRDEC_OK;
-
-}
-
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/sbr_get_sce.h b/media/libstagefright/codecs/aacdec/sbr_get_sce.h
deleted file mode 100644
index 36adb04..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_get_sce.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_get_sce.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_GET_SCE_H
-#define SBR_GET_SCE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_bit_buffer.h"
-#include    "s_sbr_frame_data.h"
-#include    "e_sbr_error.h"
-
-#ifdef PARAMETRICSTEREO
-#include    "s_ps_dec.h"
-#endif
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    SBR_ERROR sbr_get_sce(SBR_FRAME_DATA * hFrameData,
-    BIT_BUFFER * hBitBuf
-#ifdef PARAMETRICSTEREO
-    , HANDLE_PS_DEC hParametricStereoDec
-#endif
-                         );
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_inv_filt_levelemphasis.cpp b/media/libstagefright/codecs/aacdec/sbr_inv_filt_levelemphasis.cpp
deleted file mode 100644
index 833ace3..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_inv_filt_levelemphasis.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_inv_filt_levelemphasis.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_inv_filt_levelemphasis.h"
-#include    "sbr_generate_high_freq.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-#include "pv_audio_type_defs.h"
-#include "fxp_mul32.h"
-
-#define R_SHIFT     29
-#define Qfmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-
-const Int32 InvFiltFactors[5] = {Qfmt(0.00f),    /* OFF_LEVEL */
-                                 Qfmt(0.60f),     /* TRANSITION_LEVEL */
-                                 Qfmt(0.75f),     /* LOW_LEVEL */
-                                 Qfmt(0.90f),     /* MID_LEVEL */
-                                 Qfmt(0.98f)
-                                };    /* HIGH_LEVEL */
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_inv_filt_levelemphasis(INVF_MODE *invFiltMode,
-                                INVF_MODE *prevInvFiltMode,
-                                Int32 nNfb,
-                                Int32  BwVector[MAX_NUM_PATCHES],
-                                Int32  BwVectorOld[MAX_NUM_PATCHES])
-{
-    Int32 i;
-    Int32 j;
-    Int32 tmp;
-
-    for (i = 0; i < nNfb; i++)
-    {
-        switch (invFiltMode[i])
-        {
-            case INVF_LOW_LEVEL:
-                if (prevInvFiltMode[i] == INVF_OFF)
-                {
-                    j = 1;
-                }
-                else
-                {
-                    j = 2;
-                }
-                break;
-
-            case INVF_MID_LEVEL:
-                j = 3;
-                break;
-
-            case INVF_HIGH_LEVEL:
-                j = 4;
-                break;
-
-            default:
-                if (prevInvFiltMode[i] == INVF_LOW_LEVEL)
-                {
-                    j = 1;
-                }
-                else
-                {
-                    j = 0;
-                }
-        }
-
-        tmp  =  InvFiltFactors[j];
-
-        if (tmp < BwVectorOld[i])
-        {
-            tmp = ((tmp << 1) + tmp + BwVectorOld[i]) >> 2;
-        }
-        else
-        {
-            tmp =  fxp_mul32_Q29(Qfmt(0.90625f), tmp);
-            tmp =  fxp_mac32_Q29(Qfmt(0.09375f), BwVectorOld[i], tmp);
-        }
-
-        if (tmp < Qfmt(0.015625F))
-        {
-            tmp = 0;
-        }
-
-        if (tmp >= Qfmt(0.99609375f))
-        {
-            tmp = Qfmt(0.99609375f);
-        }
-
-        BwVector[i] = tmp;
-    }
-}
-
-
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_inv_filt_levelemphasis.h b/media/libstagefright/codecs/aacdec/sbr_inv_filt_levelemphasis.h
deleted file mode 100644
index 586214c..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_inv_filt_levelemphasis.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_inv_filt_levelemphasis.h
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
- ----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_INV_FILT_LEVELEMPHASIS_H
-#define SBR_INV_FILT_LEVELEMPHASIS_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "e_invf_mode.h"
-#include    "sbr_generate_high_freq.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-void sbr_inv_filt_levelemphasis(INVF_MODE *invFiltMode,
-                                INVF_MODE *prevInvFiltMode,
-                                Int32  nNfb,
-                                Int32  BwVector[MAX_NUM_PATCHES],
-                                Int32  BwVectorOld[MAX_NUM_PATCHES]);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_open.cpp b/media/libstagefright/codecs/aacdec/sbr_open.cpp
deleted file mode 100644
index 868819a..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_open.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_open.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_open.h"
-#include    "s_sbr_header_data.h"
-#include    "init_sbr_dec.h"
-#include    "e_sbr_error.h"
-#include    "aac_mem_funcs.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-const SBR_HEADER_DATA defaultHeader =
-{
-    HEADER_NOT_INITIALIZED,   /* status */
-    MASTER_RESET,             /* masterStatus */
-    0,                        /* crcEnable */
-    UP_BY_2,                  /* sampleRateMode */
-    SBR_AMP_RES_3_0,          /* ampResolution */
-    5,                        /* startFreq */
-    0,                        /* stopFreq */
-    0,                        /* xover_band */
-    SBR_FREQ_SCALE_DEFAULT,   /* freqScale */
-    SBR_ALTER_SCALE_DEFAULT,  /* alterScale */
-    SBR_NOISE_BANDS_DEFAULT,  /* noise_bands */
-    0,                        /* noNoiseBands */
-    SBR_LIMITER_BANDS_DEFAULT,
-    SBR_LIMITER_GAINS_DEFAULT,
-    SBR_INTERPOL_FREQ_DEFAULT,
-    SBR_SMOOTHING_LENGTH_DEFAULT
-};
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_open(Int32 sampleRate,
-              SBR_DEC *sbrDec,
-              SBRDECODER_DATA * self,
-              bool bDownSampledSbr)
-
-{
-    Int16 i ;
-
-    SBR_CHANNEL *SbrChannel;
-
-
-    SbrChannel = self->SbrChannel;
-
-    for (i = 0; i < MAX_NUM_CHANNELS; i++)
-    {
-        pv_memset((void *)&(SbrChannel[i]),
-                  0,
-                  sizeof(SBR_CHANNEL));
-
-        /* init a default header such that we can at least do upsampling later */
-
-        pv_memcpy(&(SbrChannel[i].frameData.sbr_header),
-                  &defaultHeader,
-                  sizeof(SBR_HEADER_DATA));
-
-        /* should be handled by sample rate mode bit */
-        if (sampleRate > 24000 || bDownSampledSbr)
-        {
-            SbrChannel[i].frameData.sbr_header.sampleRateMode = SINGLE_RATE;
-        }
-
-
-        SbrChannel[i].outFrameSize =
-            init_sbr_dec(sampleRate,
-                         self->SbrChannel[0].frameData.sbr_header.sampleRateMode,
-                         sbrDec,
-                         &(SbrChannel[i].frameData));
-
-        SbrChannel[i].syncState     = UPSAMPLING;
-
-        SbrChannel[i].frameData.sUp = 1;        /* reset mode */
-    }
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_open.h b/media/libstagefright/codecs/aacdec/sbr_open.h
deleted file mode 100644
index 8d17ffa..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_open.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_open.h
- Funtions:
-    get_dse
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_OPEN_H
-#define SBR_OPEN_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "s_sbr_channel.h"
-#include "sbr_dec.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void sbr_open(Int32 sampleRate,
-              SBR_DEC *sbrDec,
-              SBRDECODER_DATA * self,
-              bool bDownSampledSbr);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_read_data.cpp b/media/libstagefright/codecs/aacdec/sbr_read_data.cpp
deleted file mode 100644
index 2220fce..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_read_data.cpp
+++ /dev/null
@@ -1,324 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_read_data.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    INPUT
-
-    SBRDECODER self,
-    SBRBITSTREAM * stream,
-    float *timeData,
-    int numChannels
-
-    OUTPUT
-
-    errorCode, noError if successful
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        sbr decoder processing, set up SBR decoder phase 2 in case of
-        different cotrol data
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_read_data.h"
-#include    "s_bit_buffer.h"
-#include    "buf_getbits.h"
-#include    "sbr_get_sce.h"
-#include    "sbr_get_cpe.h"
-#include    "sbr_reset_dec.h"
-#include    "sbr_get_header_data.h"
-#include    "sbr_crc_check.h"
-#include    "aac_mem_funcs.h"
-
-
-#include    "init_sbr_dec.h"  /*  !!! */
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-SBR_ERROR sbr_read_data(SBRDECODER_DATA * self,
-                        SBR_DEC * sbrDec,
-                        SBRBITSTREAM *stream)
-{
-    SBR_ERROR sbr_err =  SBRDEC_OK;
-    int32_t SbrFrameOK = 1;
-    int32_t sbrCRCAlwaysOn = 0;
-
-    UInt32 bs_header_flag = 0;
-
-    SBR_HEADER_STATUS headerStatus = HEADER_OK;
-
-    SBR_CHANNEL *SbrChannel = self->SbrChannel;
-
-    int32_t zeropadding_bits;
-
-    BIT_BUFFER bitBuf ;
-
-    /*
-     *  evaluate Bitstream
-     */
-
-    bitBuf.buffer_word    = 0;
-    bitBuf.buffered_bits  = 0;
-    bitBuf.nrBitsRead     = 0;
-
-    bitBuf.char_ptr  =  stream->sbrElement[0].Data;
-    bitBuf.bufferLen = (stream->sbrElement[0].Payload) << 3;
-
-
-    /*
-     *  we have to skip a nibble because the first element of Data only
-     *  contains a nibble of data !
-     */
-    buf_getbits(&bitBuf, LEN_NIBBLE);
-
-    if ((stream->sbrElement[0].ExtensionType == SBR_EXTENSION_CRC) ||
-            sbrCRCAlwaysOn)
-    {
-        int32_t CRCLen = ((stream->sbrElement[0].Payload - 1) << 3) + 4 - SI_SBR_CRC_BITS;
-        SbrFrameOK = sbr_crc_check(&bitBuf, CRCLen);
-    }
-
-
-    if (SbrFrameOK)
-    {
-        /*
-         *  The sbr data seems ok, if the header flag is set we read the header
-         *  and check if vital parameters have changed since the previous frame.
-         *  If the syncState equals UPSAMPLING, the SBR Tool has not been
-         *  initialised by SBR header data, and can only do upsampling
-         */
-
-        bs_header_flag = buf_getbits(&bitBuf, 1);  /* read Header flag */
-
-        if (bs_header_flag)
-        {
-            /*
-             *  If syncState == SBR_ACTIVE, it means that we've had a SBR header
-             *  before, and we will compare with the previous header to see if a
-             *  reset is required. If the syncState equals UPSAMPLING this means
-             *  that the SBR-Tool so far is only initialised to do upsampling
-             *  and hence we need to do a reset, and initialise the system
-             *  according to the present header.
-             */
-
-            headerStatus = sbr_get_header_data(&(SbrChannel[0].frameData.sbr_header),
-                                               &bitBuf,
-                                               SbrChannel[0].syncState);
-        }     /* if (bs_header_flag) */
-
-
-        switch (stream->sbrElement[0].ElementID)
-        {
-            case SBR_ID_SCE :
-
-                /* change of control data, reset decoder */
-                if (headerStatus == HEADER_RESET)
-                {
-                    sbr_err = sbr_reset_dec(&(SbrChannel[0].frameData),
-                                            sbrDec,
-                                            self->SbrChannel[0].frameData.sbr_header.sampleRateMode);
-
-                    if (sbr_err != SBRDEC_OK)
-                    {
-                        break;
-                    }
-                    /*
-                     * At this point we have a header and the system has been reset,
-                     * hence syncState from now on will be SBR_ACTIVE.
-                     */
-                    SbrChannel[0].syncState     = SBR_ACTIVE;
-                }
-
-                if ((SbrChannel[0].syncState == SBR_ACTIVE))
-                {
-                    sbr_err = sbr_get_sce(&(SbrChannel[0].frameData),
-                                          &bitBuf
-#ifdef PARAMETRICSTEREO
-                                          , self->hParametricStereoDec
-#endif
-                                         );
-
-                    if (sbr_err != SBRDEC_OK)
-                    {
-                        break;
-                    }
-                }
-
-                break;
-
-            case SBR_ID_CPE :
-
-                if (bs_header_flag)
-                {
-                    pv_memcpy(&(SbrChannel[1].frameData.sbr_header),
-                              &(SbrChannel[0].frameData.sbr_header),
-                              sizeof(SBR_HEADER_DATA));
-                }
-
-                /* change of control data, reset decoder */
-                if (headerStatus == HEADER_RESET)
-                {
-                    for (int32_t lr = 0 ; lr < 2 ; lr++)
-                    {
-                        sbr_err = sbr_reset_dec(&(SbrChannel[lr].frameData),
-                                                sbrDec,
-                                                self->SbrChannel[0].frameData.sbr_header.sampleRateMode);
-
-                        if (sbr_err != SBRDEC_OK)
-                        {
-                            break;
-                        }
-
-                        SbrChannel[lr].syncState = SBR_ACTIVE;
-                    }
-                }
-
-                if (SbrChannel[0].syncState == SBR_ACTIVE)
-                {
-                    sbr_err = sbr_get_cpe(&(SbrChannel[0].frameData),
-                                          &(SbrChannel[1].frameData),
-                                          &bitBuf);
-
-                    if (sbr_err != SBRDEC_OK)
-                    {
-                        break;
-                    }
-
-                }
-                break;
-
-            default:
-                sbr_err = SBRDEC_ILLEGAL_PLUS_ELE_ID;
-                break;
-        }
-
-    }           /* if (SbrFrameOK) */
-
-    /*
-     *  Check that the bits read did not go beyond SBR frame boundaries
-     */
-
-    zeropadding_bits = (8 - (bitBuf.nrBitsRead & 0x7)) & 0x7;
-
-    if ((bitBuf.nrBitsRead + zeropadding_bits)  > bitBuf.bufferLen)
-    {
-        sbr_err = SBRDEC_INVALID_BITSTREAM;
-    }
-
-    return sbr_err;
-}
-
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_read_data.h b/media/libstagefright/codecs/aacdec/sbr_read_data.h
deleted file mode 100644
index 74cf5b9..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_read_data.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_read_data.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_READ_DATA
-#define SBR_READ_DATA
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "e_sbr_error.h"
-#include "s_sbr_channel.h"
-#include "s_sbrbitstream.h"
-#include "sbr_dec.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    SBR_ERROR sbr_read_data(SBRDECODER_DATA * self,
-    SBR_DEC * sbrDec,
-    SBRBITSTREAM *stream);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_requantize_envelope_data.cpp b/media/libstagefright/codecs/aacdec/sbr_requantize_envelope_data.cpp
deleted file mode 100644
index 487496f..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_requantize_envelope_data.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_requantize_envelope_data.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_constants.h"
-#include    "sbr_requantize_envelope_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define R_SHIFT     30
-#define Qfmt(x)   (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void sbr_requantize_envelope_data(SBR_FRAME_DATA * hFrameData)
-
-{
-    Int32 i;
-
-
-    Int32  nScaleFactors      =  hFrameData->nScaleFactors;
-    Int32  nNoiseFactors      =  hFrameData->nNoiseFactors;
-    Int32  ampRes             =  hFrameData->ampRes;
-    Int32 *iEnvelope_man      =  hFrameData->iEnvelope_man;
-    Int32 *iEnvelope_exp      =  hFrameData->iEnvelope_exp;
-    Int32 *sbrNoiseFloorLevel_man = hFrameData->sbrNoiseFloorLevel_man;
-    Int32 *sbrNoiseFloorLevel_exp = hFrameData->sbrNoiseFloorLevel_exp;
-
-    /*
-     *  ampRes could be 0 (resolution step = 1.5 dB) or
-     *                  1 (resolution step = 3 dB)
-     */
-    if (ampRes)
-    {
-        /*  iEnvelope[i] always positive  6 bits max */
-        for (i = 0; i < nScaleFactors; i++)
-        {
-
-            iEnvelope_exp[i] = iEnvelope_man[i] + 6;
-            iEnvelope_man[i] = Qfmt(1.000F);
-        }
-    }
-    else
-    {
-        /*  iEnvelope[i] always positive  7 bits max */
-        for (i = 0; i < nScaleFactors; i++)
-        {
-            iEnvelope_exp[i] = (iEnvelope_man[i] >> 1) + 6;
-            if (iEnvelope_man[i] & 0x1)   /*  odd */
-            {
-                iEnvelope_man[i] = Qfmt(1.41421356237310F);
-            }
-            else
-            {
-                iEnvelope_man[i] = Qfmt(1.000F);
-            }
-        }
-
-    }
-    for (i = 0; i < nNoiseFactors; i++)
-    {
-        /*  sbrNoiseFloorLevel[i] varies from -31 to 31 if no coupling is used */
-
-        sbrNoiseFloorLevel_exp[i] = NOISE_FLOOR_OFFSET - sbrNoiseFloorLevel_man[i];
-        sbrNoiseFloorLevel_man[i] = 0x40000000;
-    }
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_requantize_envelope_data.h b/media/libstagefright/codecs/aacdec/sbr_requantize_envelope_data.h
deleted file mode 100644
index 2113586..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_requantize_envelope_data.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_requantize_envelope_data.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
-----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_REQUANTIZE_ENVELOPE_DATA_H
-#define SBR_REQUANTIZE_ENVELOPE_DATA_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_sbr_frame_data.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void sbr_requantize_envelope_data(SBR_FRAME_DATA * hFrameData);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_reset_dec.cpp b/media/libstagefright/codecs/aacdec/sbr_reset_dec.cpp
deleted file mode 100644
index 810a34a..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_reset_dec.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_reset_dec.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    resets sbr decoder structure
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#ifdef AAC_PLUS
-
-#include    "sbr_dec.h"
-
-#include    "pv_log2.h"
-#include    "fxp_mul32.h"
-
-
-#include    "sbr_reset_dec.h"
-#include    "sbr_find_start_andstop_band.h"
-#include    "sbr_update_freq_scale.h"
-#include    "sbr_downsample_lo_res.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-SBR_ERROR sbr_reset_dec(SBR_FRAME_DATA * hFrameData,
-                        SBR_DEC * sbrDec,
-                        Int32 upsampleFac)
-{
-
-    SBR_ERROR err = SBRDEC_OK;
-    Int lsbM;
-    Int lsb;
-    Int usb;
-    Int32 i;
-    Int32 tmp_q1;
-
-    SBR_HEADER_DATA *headerData  = &(hFrameData->sbr_header);
-    Int32           samplingFreq = sbrDec->outSampleRate;
-
-    hFrameData->reset_flag = 1;
-
-    /*Calculate master frequency function */
-    err = sbr_find_start_andstop_band(samplingFreq,
-                                      headerData->startFreq,
-                                      headerData->stopFreq,
-                                      &lsbM,
-                                      &usb);
-
-    if (err != SBRDEC_OK)
-    {
-        return err;
-    }
-
-    /* Calculate new v_k_master if needed */
-    if (headerData->masterStatus == MASTER_RESET)
-    {
-        sbr_update_freq_scale(sbrDec->V_k_master,
-                              &(sbrDec->Num_Master),
-                              lsbM,
-                              usb,
-                              headerData->freqScale,
-                              headerData->alterScale,
-                              0);
-
-    }
-
-    /*Derive Hiresolution from master frequency function*/
-
-    sbrDec->NSfb[HI] = sbrDec->Num_Master - headerData->xover_band;
-
-    for (i = headerData->xover_band; i <= sbrDec->Num_Master; i++)
-    {
-        sbrDec->FreqBandTable[HI][i-headerData->xover_band] = (Int)sbrDec->V_k_master[i];
-    }
-
-
-    if ((sbrDec->NSfb[HI] & 0x01) == 0) /* if even number of hires bands */
-    {
-
-        sbrDec->NSfb[LO] = sbrDec->NSfb[HI] >> 1;
-        /* Use every second lo-res=hi-res[0,2,4...] */
-        for (i = 0; i <= sbrDec->NSfb[LO]; i++)
-        {
-            sbrDec->FreqBandTable[LO][i] = sbrDec->FreqBandTable[HI][(i<<1)];
-        }
-    }
-    else
-    {            /* odd number of hi-res which means xover is odd */
-
-        sbrDec->NSfb[LO] = (sbrDec->NSfb[HI] + 1) >> 1;
-        /* Use lo-res=hi-res[0,1,3,5 ...] */
-        sbrDec->FreqBandTable[LO][0] = sbrDec->FreqBandTable[HI][0];
-        for (i = 1; i <= sbrDec->NSfb[LO]; i++)
-        {
-            sbrDec->FreqBandTable[LO][i] = sbrDec->FreqBandTable[HI][(i<<1)-1];
-        }
-
-    }
-
-    lsb = sbrDec->FreqBandTable[LOW_RES][0];
-    usb = sbrDec->FreqBandTable[LOW_RES][sbrDec->NSfb[LOW_RES]];
-
-    sbrDec->lowSubband  = lsb;
-    sbrDec->highSubband = usb;
-    sbrDec->noSubbands  = usb - lsb;
-
-    if ((lsb > 32) || (sbrDec->noSubbands <= 0))
-    {
-        return SBRDEC_ILLEGAL_SCFACTORS;   /* invalid bands */
-    }
-
-    /* Calculate number of noise bands */
-    if (headerData->noise_bands == 0)
-    {
-        sbrDec->NoNoiseBands = 1;
-    }
-    else /* Calculate number of noise bands 1,2 or 3 bands/octave */
-    {
-
-        if (! lsb)
-        {
-            return SBRDEC_ILLEGAL_SCFACTORS;   /* avoid div by 0 */
-        }
-
-        tmp_q1 = pv_log2((usb << 20) / lsb);
-
-        tmp_q1 = fxp_mul32_Q15(headerData->noise_bands, tmp_q1);
-
-        sbrDec->NoNoiseBands = (tmp_q1 + 16) >> 5;
-
-        if (sbrDec->NoNoiseBands == 0)
-        {
-            sbrDec->NoNoiseBands = 1;
-        }
-    }
-
-    headerData->noNoiseBands = sbrDec->NoNoiseBands;
-
-    /* Get noise bands */
-    sbr_downsample_lo_res(sbrDec->FreqBandTableNoise,
-                          sbrDec->NoNoiseBands,
-                          sbrDec->FreqBandTable[LO],
-                          sbrDec->NSfb[LO]);
-
-    sbrDec->sbStopCodec = sbrDec->lowSubband;
-
-    if (sbrDec->sbStopCodec > (upsampleFac << 5))
-    {
-        sbrDec->sbStopCodec = (upsampleFac << 5);
-    }
-
-    hFrameData->nSfb[LO] = sbrDec->NSfb[LO];
-    hFrameData->nSfb[HI] = sbrDec->NSfb[HI];
-    hFrameData->nNfb     = hFrameData->sbr_header.noNoiseBands;
-    hFrameData->offset   = ((hFrameData->nSfb[LO]) << 1) - hFrameData->nSfb[HI];
-
-    return (SBRDEC_OK);
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_reset_dec.h b/media/libstagefright/codecs/aacdec/sbr_reset_dec.h
deleted file mode 100644
index 0ff94a5..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_reset_dec.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_reset_dec.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
- $Id: ct_envcalc.h,v 1.3 2002/11/29 16:11:49 kaehleof Exp $
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_RESET_DEC_H
-#define SBR_RESET_DEC_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include    "s_sbr_frame_data.h"
-#include    "sbr_dec.h"
-#include    "e_sbr_error.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-SBR_ERROR sbr_reset_dec(SBR_FRAME_DATA * hFrameData,
-                        SBR_DEC * sbrDec,
-                        Int32 upsampleFac);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sbr_update_freq_scale.cpp b/media/libstagefright/codecs/aacdec/sbr_update_freq_scale.cpp
deleted file mode 100644
index 18bd5d9..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_update_freq_scale.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_update_freq_scale.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-SC 29 Software Copyright Licencing Disclaimer:
-
-This software module was originally developed by
-  Coding Technologies
-
-and edited by
-  -
-
-in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
-standards for reference purposes and its performance may not have been
-optimized. This software module is an implementation of one or more tools as
-specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
-ISO/IEC gives users free license to this software module or modifications
-thereof for use in products claiming conformance to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International
-Standards. ISO/IEC gives users the same free license to this software module or
-modifications thereof for research purposes and further ISO/IEC standardisation.
-Those intending to use this software module in products are advised that its
-use may infringe existing patents. ISO/IEC have no liability for use of this
-software module or modifications thereof. Copyright is not released for
-products that do not conform to audiovisual and image-coding related ITU
-Recommendations and/or ISO/IEC International Standards.
-The original developer retains full right to modify and use the code for its
-own purpose, assign or donate the code to a third party and to inhibit third
-parties from using the code for products that do not conform to audiovisual and
-image-coding related ITU Recommendations and/or ISO/IEC International Standards.
-This copyright notice must be included in all copies or derivative works.
-Copyright (c) ISO/IEC 2002.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include    "sbr_update_freq_scale.h"
-#include    "shellsort.h"
-
-#include    "pv_pow2.h"
-#include    "pv_log2.h"
-
-#include "fxp_mul32.h"
-#define R_SHIFT     30
-#define Q_fmt(x)    (Int32)(x*((Int32)1<<R_SHIFT) + (x>=0?0.5F:-0.5F))
-#define Q28fmt(x)   (Int32)(x*((Int32)1<<28) + (x>=0?0.5F:-0.5F))
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-
-void sbr_update_freq_scale(Int32 * v_k_master,
-                           Int32 *h_num_bands,
-                           const Int32 lsbM,
-                           const Int32 usb,
-                           const Int32 freqScale,
-                           const Int32 alterScale,
-                           const Int32 channelOffset)
-{
-    Int32 i;
-    Int32 numBands = 0;
-    Int32 numBands2;
-    Int32 tmp_q1;
-
-    if (freqScale > 0) /*Bark mode*/
-    {
-        Int32 reg;
-        Int32 regions;
-        Int32 b_p_o;
-        Int32 k[3];
-        Int32 d[MAX_SECOND_REGION];
-        Int32 d2[MAX_SECOND_REGION];
-        Int32 w[2] = {Q_fmt(1.0F), Q_fmt(1.0F)};
-
-
-        k[0] = lsbM;
-        k[1] = usb;
-        k[2] = usb;
-
-        b_p_o = (freqScale == 1)  ? 12 : 8;
-        b_p_o = (freqScale == 2)  ? 10 : b_p_o;
-
-        w[1]  = (alterScale == 0) ? Q_fmt(0.5f) : Q_fmt(0.384615384615386f);
-
-        if (usb > fxp_mul32_Q28(lsbM, Q28fmt(2.2449)))
-        {
-            regions = 2;
-            k[1] = (lsbM << 1);
-        }
-        else
-        {
-            regions = 1;
-        }
-
-        *h_num_bands = 0;
-        for (reg = 0; reg < regions; reg++)
-        {
-            if (reg == 0)
-            {
-
-                tmp_q1 = pv_log2((k[1] << 20) / k[0]);
-
-                tmp_q1 = fxp_mul32_Q15(tmp_q1, b_p_o);
-                tmp_q1 = (tmp_q1 + 32) >> 6;
-
-                numBands = tmp_q1 << 1;
-
-
-                CalcBands(d, k[0], k[1], numBands);                                    /* CalcBands => d   */
-                shellsort(d, numBands);                                              /* SortBands sort d */
-                cumSum(k[0] - channelOffset,
-                       d,
-                       numBands,
-                       (v_k_master + *h_num_bands));   /* cumsum */
-
-                *h_num_bands += numBands;                                            /* Output nr of bands */
-            }
-            else
-            {
-                tmp_q1 = pv_log2((k[reg + 1] << 20) / k[reg]);
-
-                tmp_q1 = fxp_mul32_Q30(tmp_q1, w[reg]);
-                tmp_q1 = fxp_mul32_Q15(tmp_q1, b_p_o);
-                tmp_q1 = (tmp_q1 + 16) >> 5;
-
-                numBands2 = tmp_q1 << 1;
-
-                CalcBands(d2, k[reg], k[reg+1], numBands2);                            /* CalcBands => d   */
-                shellsort(d2, numBands2);                                              /* SortBands sort d */
-                if (d[numBands-1] > d2[0])
-                {
-
-                    Int32   change = d[numBands-1] - d2[0];
-                    /* Limit the change so that the last band cannot get narrower than the first one */
-                    if (change > (d2[numBands2-1] - d2[0]) >> 1)
-                    {
-                        change = (d2[numBands2-1] - d2[0]) >> 1;
-                    }
-
-                    d2[0] += change;
-                    d2[numBands2-1] -= change;
-                    shellsort(d2, numBands2);
-
-                }
-                cumSum(k[reg] - channelOffset,
-                       d2,
-                       numBands2,
-                       v_k_master + *h_num_bands);   /* cumsum */
-
-                *h_num_bands += numBands2;                                           /* Output nr of bands */
-            }
-        }
-    }
-    else
-    {                         /* Linear mode */
-        Int32     k2_achived;
-        Int32     k2_diff;
-        Int32     diff_tot[MAX_OCTAVE + MAX_SECOND_REGION];
-        Int32     dk;
-        Int32     incr = 0;
-
-
-        if (alterScale)
-        {
-            numBands = (usb - lsbM) >> 1;
-            dk = 1;
-            k2_achived = lsbM + numBands;
-        }
-        else
-        {
-            numBands = usb - lsbM;
-            if (numBands & 0x1) /* equivalent rounding */
-            {
-                numBands--;
-            }
-            dk = 2;
-            k2_achived = lsbM + (numBands << 1);
-        }
-
-        k2_diff = usb - k2_achived;
-
-        for (i = 0; i < numBands; i++)
-        {
-            diff_tot[i] = dk;
-        }
-
-        if (k2_diff < 0)        /* If linear scale wasn't achived */
-        {
-            incr = 1;           /* and we got too large SBR area */
-            i = 0;
-        }
-
-        if (k2_diff > 0)        /* If linear scale wasn't achived */
-        {
-            incr = -1;            /* and we got too small SBR area */
-            i = numBands - 1;
-        }
-
-        /* Adjust diff vector to get spec. SBR range */
-        while (k2_diff != 0)
-        {
-            diff_tot[i] -=  incr;
-            i += incr;
-            k2_diff += incr;
-        }
-
-        cumSum(lsbM,
-               diff_tot,
-               numBands,
-               v_k_master); /* cumsum */
-
-        *h_num_bands = numBands;                      /* Output nr of bands */
-    }
-}
-
-
-void CalcBands(Int32 * diff,
-               Int32 start,
-               Int32 stop,
-               Int32 num_bands)
-{
-    Int32 i;
-    Int32 previous;
-    Int32 current;
-    Int32 tmp_q1;
-
-
-    previous = start;
-
-    for (i = 1; i <= num_bands; i++)
-    {
-        /*              float temp=(start * pow( (float)stop/start, (float)i/num_bands)); */
-
-        tmp_q1 = pv_log2((stop << 20) / start);
-
-        tmp_q1 = fxp_mul32_Q20(tmp_q1, (i << 27) / num_bands);
-        tmp_q1 = pv_pow2(tmp_q1);
-
-        tmp_q1 = fxp_mul32_Q20(tmp_q1, start);
-
-        current = (tmp_q1 + 16) >> 5;
-
-        diff[i-1] = current - previous;
-        previous  = current;
-    }
-
-}  /* End CalcBands */
-
-
-void cumSum(Int32 start_value,
-            Int32 * diff,
-            Int32 length,
-            Int32 * start_adress)
-{
-    Int32 i;
-    Int32 *pt_start_adress   = start_adress;
-    Int32 *pt_start_adress_1 = start_adress;
-    Int32 *pt_diff           = diff;
-
-    if (length > 0)  /*  avoid possible error on loop */
-    {
-        *(pt_start_adress_1++) = start_value;
-
-        for (i = (length >> 1); i != 0; i--)
-        {
-            *(pt_start_adress_1++) = *(pt_start_adress++) + *(pt_diff++);
-            *(pt_start_adress_1++) = *(pt_start_adress++) + *(pt_diff++);
-        }
-
-        if (length&1)
-        {
-            *(pt_start_adress_1) = *(pt_start_adress) + *(pt_diff);
-        }
-    }
-
-}   /* End cumSum */
-
-
-#endif
diff --git a/media/libstagefright/codecs/aacdec/sbr_update_freq_scale.h b/media/libstagefright/codecs/aacdec/sbr_update_freq_scale.h
deleted file mode 100644
index 4acf3aa..0000000
--- a/media/libstagefright/codecs/aacdec/sbr_update_freq_scale.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: sbr_update_freq_scale.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
- ----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SBR_UPDATE_FREQ_SCALE_H
-#define SBR_UPDATE_FREQ_SCALE_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define MAX_OCTAVE        29
-#define MAX_SECOND_REGION 50
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void sbr_update_freq_scale(Int32 * v_k_master,
-                           Int32 *h_num_bands,
-                           const Int32 lsbM,
-                           const Int32 usb,
-                           const Int32 freqScale,
-                           const Int32 alterScale,
-                           const Int32 channelOffset);
-
-
-void CalcBands(Int32 * diff,
-               Int32 start,
-               Int32 stop,
-               Int32 num_bands);
-
-void cumSum(Int32 start_value,
-            Int32 * diff,
-            Int32 length,
-            Int32 * start_adress);
-
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/set_mc_info.cpp b/media/libstagefright/codecs/aacdec/set_mc_info.cpp
deleted file mode 100644
index 5a11941..0000000
--- a/media/libstagefright/codecs/aacdec/set_mc_info.cpp
+++ /dev/null
@@ -1,309 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/set_mc_info.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modified per review comments
-
- Description: Change audioObjectType from Int to enum types
-
- Who:                               Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    pMC_Info    = pointer to structure MC_Info that holds information of
-                  multiple channels' configurations
-                  Data type pointer to MC_Info
-
-    objectType  = variable that holds the Audio Object Type of current
-                  file/bitstream.
-                  Data type Int
-
-    sampling_rate_idx = variable that indicates the sampling rate of the
-                        source file being encoded
-                        Data Type Int
-
-    tag         = variable that stores the element instance tag of the
-                  first (front) channel element.
-                  Data type Int
-
-    is_cpe      = variable that indicates if a Channel Pair Element (CPE)
-                  or a Single Channel Element (SCE) is used.
-                  Data type Int (maybe Boolean)
-
-    pWinSeqInfo = array of pointers that points to structures holding
-                  frame information of long and short window sequences.
-                  Data type FrameInfo
-
-    pSfbwidth128 = array that will store the scalefactor bandwidth of
-                   short window sequence frame.
-                   Data type Int array
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    return SUCCESS
-
- Pointers and Buffers Modified:
-    pMC_Info->nch           contains the number of channels depending
-                            upon if CPE or SCE is used
-    pMC_Info->objectType    contents updated with the decoded Audio
-                            Object Type
-
-    pMC_Info->ch_info.tag   contents updated with the value of decoded
-                            channel element tag
-
-    PMC_Info->ch_info.cpe   contents updated depending upon if CPE or
-                            SCE is used
-
-    pWinSeqInfo             contents updated by calling infoinit if
-                            sampling_rate_idx is different from
-                            previous value
-
-    pSfbWidth128            contents updated by calling infoinit if
-                            sampling_rate_idx is different from
-                            previous value
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function initializes the channel configuration information. The
- structure MC_Info stores the number of channels, channel element tag.
- If sampling rate index is different from the previous value,
- The frame information will be updated by calling infoinit.c
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall update the relevant information on channel configs
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-  (2) ISO/IEC 14496-3: 1999(E)
-    Subpart 1   p20 Table 1.6.3
-    Subpart 4   p30 5.1.2.1
-    Subpart 4   p31 4.5.2.1.1
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    pMC_Info->nch   = 0;
-
-    pMC_Info->profile = objectType;
-
-    IF (pMC_Info->sampling_rate_idx != sampling_rate_idx)
-    THEN
-        pMC_Info->sampling_rate_idx = sampling_rate_idx;
-
-        CALL infoinit(
-                samp_rate_idx = sampling_rate_idx
-                ppWin_seq_info= pWinSeqInfo
-                pSfbwidth128  = pSfbwidth128)
-        MODIFYING(pWinSeqInfo, pSfbwidth128)
-        RETURNING(None)
-    ENDIF
-
-    pCh_Info = &pMC_Info->ch_info[0];
-    pCh_Info->tag = tag;
-
-    IF (is_cpe == FALSE)
-    THEN
-        pCh_Info->cpe = FALSE;
-
-        pMC_Info->nch = 1;
-
-    ELSE
-        pCh_Info->cpe = TRUE;
-        pCh_Info = &pMC_Info->ch_info[1];
-        pCh_Info->tag = tag;
-        pCh_Info->cpe = TRUE;
-
-        pMC_Info->nch = 2;
-
-    ENDIF
-
-    RETURN(SUCCESS)
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "set_mc_info.h"
-#include    "huffman.h"
-#include    "s_ch_info.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-Int set_mc_info(
-    MC_Info     *pMC_Info,
-    const tMP4AudioObjectType audioObjectType, /* used to be profile */
-    const Int    sampling_rate_idx,
-    const Int    tag,   /* always pass-in last element's value */
-    const Int    is_cpe,
-    FrameInfo   *pWinSeqInfo[],
-    Int          sfbwidth128[]
-)
-{
-    Ch_Info *pCh_Info; /*optional task: eliminate this structure */
-
-    /*
-     *   audioObjectType and sampling rate
-     *   re-configure if new sampling rate
-     *
-     */
-    pMC_Info->audioObjectType = audioObjectType;
-
-    if (pMC_Info->sampling_rate_idx != sampling_rate_idx)
-    {
-        pMC_Info->sampling_rate_idx = sampling_rate_idx;
-
-        Int status;
-        status = infoinit(sampling_rate_idx,
-                          pWinSeqInfo,
-                          sfbwidth128);
-        if (SUCCESS != status)
-        {
-            return 1;
-        }
-    }
-
-    /*
-     * first setup values for mono config, Single Channel Element (SCE)
-     * then if stereo, go inside if(is_cpe != FALSE) branch to setup
-     * values for stereo.
-     * set the channel counts
-     * save tag for left channel
-     */
-    pMC_Info->nch   = 1 + is_cpe;
-
-    pCh_Info = &pMC_Info->ch_info[0];
-    pCh_Info->tag = tag;
-    pCh_Info->cpe = is_cpe;
-
-    /* This if branch maybe deleted in the future */
-    if (is_cpe != FALSE)
-    {
-        /* Channel Pair Element (CPE) */
-        /* right channel*/
-        pCh_Info = &pMC_Info->ch_info[1];
-        pCh_Info->cpe = TRUE;
-
-    }
-
-    return(SUCCESS); /* possible future error checkings */
-}
diff --git a/media/libstagefright/codecs/aacdec/set_mc_info.h b/media/libstagefright/codecs/aacdec/set_mc_info.h
deleted file mode 100644
index 8043b3b..0000000
--- a/media/libstagefright/codecs/aacdec/set_mc_info.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/set_mc_info.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: (1) use enum type for audioObjectType (2) update revision history
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This file includes function declaration for set_mc_info.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SET_MC_INFO_H
-#define SET_MC_INFO_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_mc_info.h"
-#include    "s_frameinfo.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-Int set_mc_info(
-    MC_Info     *pMC_Info,
-    const tMP4AudioObjectType objectType, /* used to be profile */
-    const Int    sampling_rate_idx,
-    const Int    tag,   /* always pass-in last element's value */
-    const Int    is_cpe,
-    FrameInfo   *pWinSeqInfo[],
-    Int          pSfbwidth128[]
-);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/sfb.cpp b/media/libstagefright/codecs/aacdec/sfb.cpp
deleted file mode 100644
index f2d3a3e..0000000
--- a/media/libstagefright/codecs/aacdec/sfb.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/sfb.c
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: created to define the scalefactor bands for all sampling rates
-
- Description: Change short to Int16
-
- Description: Modified structure to avoid assigning addresses to constant
-              tables. This solve linking problem when using the
-              /ropi option (Read-only position independent) for some
-              compilers
-              - Eliminated redundant vector sfb_96_128.
-              - Eliminated references to contant vector addresses in
-                samp_rate_info
-
- Who:                              Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
- Local Stores/Buffers/Pointers Needed:
-
- Global Stores/Buffers/Pointers Needed:
-
- Outputs:
-
- Pointers and Buffers Modified:
-
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function defines the scalefactor bands for all sampling rates
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3: 1999(E)
-    Subpart 4       p66     (sfb tables)
-                    p111    (4.6.10)
-                    p200    (Annex 4.B.5)
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "sfb.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-const Int16 sfb_96_1024[] =
-{
-    4, 8, 12, 16, 20, 24, 28,
-    32, 36, 40, 44, 48, 52, 56,
-    64, 72, 80, 88, 96, 108, 120,
-    132, 144, 156, 172, 188, 212, 240,
-    276, 320, 384, 448, 512, 576, 640,
-    704, 768, 832, 896, 960, 1024
-};         /* 41 scfbands */
-
-const Int16 sfb_64_1024[] =
-{
-    4, 8, 12, 16, 20, 24, 28,
-    32, 36, 40, 44, 48, 52, 56,
-    64, 72, 80, 88, 100, 112, 124,
-    140, 156, 172, 192, 216, 240, 268,
-    304, 344, 384, 424, 464, 504, 544,
-    584, 624, 664, 704, 744, 784, 824,
-    864, 904, 944, 984, 1024
-};               /* 41 scfbands 47 */
-
-const Int16 sfb_64_128[] =
-{
-    4, 8, 12, 16, 20, 24, 32,
-    40, 48, 64, 92, 128
-};                   /* 12 scfbands */
-
-
-const Int16 sfb_48_1024[] =
-{
-    4,  8,  12, 16, 20, 24, 28,
-    32, 36, 40, 48, 56, 64, 72,
-    80, 88, 96, 108,    120,    132,    144,
-    160,    176,    196,    216,    240,    264,    292,
-    320,    352,    384,    416,    448,    480,    512,
-    544,    576,    608,    640,    672,    704,    736,
-    768,    800,    832,    864,    896,    928,    1024
-};
-/* 49  scfbands*/
-
-const Int16 sfb_48_128[] =
-{
-    4,  8,  12, 16, 20, 28, 36,
-    44, 56, 68, 80, 96, 112, 128
-};         /* 14 scfbands */
-
-const Int16 sfb_32_1024[] =
-{
-    4,  8,  12, 16, 20, 24, 28,
-    32, 36, 40, 48, 56, 64, 72,
-    80, 88, 96, 108,    120,    132,    144,
-    160,    176,    196,    216,    240,    264,    292,
-    320,    352,    384,    416,    448,    480,    512,
-    544,    576,    608,    640,    672,    704,    736,
-    768,    800,    832,    864,    896,    928,    960,
-    992,    1024
-};                         /* 51 scfbands */
-
-const Int16 sfb_24_1024[] =
-{
-    4, 8, 12, 16, 20, 24, 28,
-    32, 36, 40, 44, 52, 60, 68,
-    76, 84, 92, 100, 108, 116, 124,
-    136, 148, 160, 172, 188, 204, 220,
-    240, 260, 284, 308, 336, 364, 396,
-    432, 468, 508, 552, 600, 652, 704,
-    768, 832, 896, 960, 1024
-};              /* 47 scfbands */
-
-const Int16 sfb_24_128[] =
-{
-    4, 8, 12, 16, 20, 24, 28,
-    36, 44, 52, 64, 76, 92, 108,
-    128
-};                                   /* 15 scfbands */
-
-const Int16 sfb_16_1024[] =
-{
-    8, 16, 24, 32, 40, 48, 56,
-    64, 72, 80, 88, 100, 112, 124,
-    136, 148, 160, 172, 184, 196, 212,
-    228, 244, 260, 280, 300, 320, 344,
-    368, 396, 424, 456, 492, 532, 572,
-    616, 664, 716, 772, 832, 896, 960,
-    1024
-};                                  /* 43 scfbands */
-
-const Int16 sfb_16_128[] =
-{
-    4, 8, 12, 16, 20, 24, 28,
-    32, 40, 48, 60, 72, 88, 108,
-    128
-};                                   /* 15 scfbands */
-
-const Int16 sfb_8_1024[] =
-{
-    12, 24, 36, 48, 60, 72, 84,
-    96, 108, 120, 132, 144, 156, 172,
-    188, 204, 220, 236, 252, 268, 288,
-    308, 328, 348, 372, 396, 420, 448,
-    476, 508, 544, 580, 620, 664, 712,
-    764, 820, 880, 944, 1024
-};               /* 40 scfbands */
-
-const Int16 sfb_8_128[] =
-{
-    4, 8, 12, 16, 20, 24, 28,
-    36, 44, 52, 60, 72, 88, 108,
-    128
-};                                   /* 15 scfbands */
-
-const SR_Info samp_rate_info[12] =
-{
-    /* sampling_frequency, #long sfb, #short sfb */
-    /* samp_rate, nsfb1024, nsfb128 */
-    {96000, 41, 12},       /* 96000 */
-    {88200, 41, 12},       /* 88200 */
-    {64000, 47, 12},       /* 64000 */
-    {48000, 49, 14},       /* 48000 */
-    {44100, 49, 14},       /* 44100 */
-    {32000, 51, 14},       /* 32000 */
-    {24000, 47, 15},       /* 24000 */
-    {22050, 47, 15},       /* 22050 */
-    {16000, 43, 15},       /* 16000 */
-    {12000, 43, 15},       /* 12000 */
-    {11025, 43, 15},       /* 11025 */
-    { 8000, 40, 15},       /* 8000  */
-};
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
diff --git a/media/libstagefright/codecs/aacdec/sfb.h b/media/libstagefright/codecs/aacdec/sfb.h
deleted file mode 100644
index 0cc1707..0000000
--- a/media/libstagefright/codecs/aacdec/sfb.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: sfb.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: created to declare scalefactor bands for all sampling rates
-
- Description: Change short to Int16
-
- Description: Eliminated declaration of sfb_96_128 array, values are equal
-              to array sfb_64_128
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- this file declares the scalefactor bands for all sampling rates
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SFB_H
-#define SFB_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_sr_info.h"
-#include    "e_progconfigconst.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-extern  const Int16 sfb_96_1024[];  /* 41 scfbands */
-
-extern const Int16 sfb_64_1024[];  /* 41 scfbands 47 */
-
-extern const Int16 sfb_64_128[];  /* 12 scfbands */
-
-
-extern const Int16 sfb_48_1024[]; /* 49 scfbands */
-
-extern const Int16 sfb_48_128[];  /* 14 scfbands */
-
-extern const Int16 sfb_32_1024[];  /* 51 scfbands */
-
-extern const Int16 sfb_24_1024[];  /* 47 scfbands */
-
-extern const Int16 sfb_24_128[];  /* 15 scfbands */
-
-extern const Int16 sfb_16_1024[];  /* 43 scfbands */
-
-extern const Int16 sfb_16_128[];  /* 15 scfbands */
-
-extern const Int16 sfb_8_1024[];  /* 40 scfbands */
-
-extern const Int16 sfb_8_128[];  /* 15 scfbands */
-
-extern const SR_Info samp_rate_info[12];
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/shellsort.cpp b/media/libstagefright/codecs/aacdec/shellsort.cpp
deleted file mode 100644
index 5feb803..0000000
--- a/media/libstagefright/codecs/aacdec/shellsort.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: shellsort.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-        Sorting routine
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "shellsort.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-void shellsort(Int32 in[], Int32 n)
-{
-
-    Int32     i;
-    Int32     j;
-    Int32     v;
-    Int32     inc = 1;
-
-    do
-    {
-        inc = 3 * inc + 1;
-    }
-    while (inc <= n);
-
-    do
-    {
-        inc = inc / 3;
-        for (i = inc + 1; i <= n; i++)
-        {
-            v = in[i-1];
-            j = i;
-            while (in[j-inc-1] > v)
-            {
-                in[j-1] = in[j-inc-1];
-                j -= inc;
-                if (j <= inc)
-                {
-                    break;
-                }
-            }
-            in[j-1] = v;
-        }
-    }
-    while (inc > 1);
-
-}
-
-#endif
-
diff --git a/media/libstagefright/codecs/aacdec/shellsort.h b/media/libstagefright/codecs/aacdec/shellsort.h
deleted file mode 100644
index a4658e3..0000000
--- a/media/libstagefright/codecs/aacdec/shellsort.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: shellsort.h
- Funtions:
-    get_dse
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-------------------------------------------------------------------------------
-
-
- ----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef SHELLSORT_H
-#define SHELLSORT_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-void shellsort(Int32 in[], Int32 n);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/stereo_2_mono.h b/media/libstagefright/codecs/aacdec/stereo_2_mono.h
deleted file mode 100644
index 3e27c70..0000000
--- a/media/libstagefright/codecs/aacdec/stereo_2_mono.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: stereo_2_mono.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for the declaration of the function stereo_2_mono()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef STEREO_2_MONO_H
-#define STEREO_2_MONO_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-    void stereo_2_mono(
-        const Int16   sourceLeft[],
-        const Int16   sourceRight[],
-        Int16   outputBuffer[],
-        const Int     sourcePointsPerChannel);
-
-    /*----------------------------------------------------------------------------
-    ; END
-    ----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* STEREO_2_MONO_H */
-
diff --git a/media/libstagefright/codecs/aacdec/synthesis_sub_band.cpp b/media/libstagefright/codecs/aacdec/synthesis_sub_band.cpp
deleted file mode 100644
index c1418e3..0000000
--- a/media/libstagefright/codecs/aacdec/synthesis_sub_band.cpp
+++ /dev/null
@@ -1,483 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Filename: synthesis_sub_band.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
-
- Who:                                   Date: MM/DD/YYYY
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
-    Int32 vec[],            Input vector, 32-bit
-    const Int32 *cosTerms,  Cosine Terms
-    Int32 *scratch_mem      Scratch memory
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    Implement root squared of a number
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-#include "pv_audio_type_defs.h"
-#include "fxp_mul32.h"
-#include "dct64.h"
-#include "synthesis_sub_band.h"
-#include "mdst.h"
-#include "dct16.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-#define Qfmt_30(x)   (Int32)(x*((Int32)(1<<30)) + (x>=0?0.5F:-0.5F))
-#define Qfmt_25(x)   (Int32)(x*((Int32)(1<<25))*(1.5625F) + (x>=0?0.5F:-0.5F))
-
-#define SCALE_DOWN_LP   Qfmt_30(0.075000F)  /* 3/40 */
-#define SCALE_DOWN_HQ     Qfmt_30(0.009375F*0.64F)  /* 3/40 * 1/8 */
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-const Int32 CosTable_64[64] =
-{
-    Qfmt_25(0.50003765191555F),   Qfmt_25(40.74468810335183F),   Qfmt_25(0.50033903744282F),   Qfmt_25(13.58429025728446F),
-    Qfmt_25(0.50094271763809F),   Qfmt_25(8.15384860246681F),   Qfmt_25(0.50185051748424F),   Qfmt_25(5.82768837784465F),
-    Qfmt_25(0.50306519130137F),   Qfmt_25(4.53629093696936F),   Qfmt_25(0.50459044322165F),   Qfmt_25(3.71524273832697F),
-    Qfmt_25(0.50643095492855F),   Qfmt_25(3.14746219178191F),   Qfmt_25(0.50859242104981F),   Qfmt_25(2.73164502877394F),
-    Qfmt_25(0.51108159270668F),   Qfmt_25(2.41416000025008F),   Qfmt_25(0.51390632984754F),   Qfmt_25(2.16395781875198F),
-    Qfmt_25(0.51707566313349F),   Qfmt_25(1.96181784857117F),   Qfmt_25(0.52059986630189F),   Qfmt_25(1.79520521907789F),
-    Qfmt_25(0.52449054011472F),   Qfmt_25(1.65559652426412F),   Qfmt_25(0.52876070920749F),   Qfmt_25(1.53699410085250F),
-    Qfmt_25(0.53342493339713F),   Qfmt_25(1.43505508844143F),   Qfmt_25(0.53849943529198F),   Qfmt_25(1.34655762820629F),
-    Qfmt_25(0.54400224638178F),   Qfmt_25(1.26906117169912F),   Qfmt_25(0.54995337418324F),   Qfmt_25(1.20068325572942F),
-    Qfmt_25(0.55637499348989F),   Qfmt_25(1.13994867510150F),   Qfmt_25(0.56329166534170F),   Qfmt_25(1.08568506425801F),
-    Qfmt_25(0.57073058801215F),   Qfmt_25(1.03694904091039F),   Qfmt_25(0.57872188513482F),   Qfmt_25(0.99297296126755F),
-    Qfmt_25(0.58729893709379F),   Qfmt_25(0.95312587439212F),   Qfmt_25(0.59649876302446F),   Qfmt_25(0.91688444618465F),
-    Qfmt_25(0.60636246227215F),   Qfmt_25(0.88381100455962F),   Qfmt_25(0.61693572600507F),   Qfmt_25(0.85353675100661F),
-    Qfmt_25(0.62826943197077F),   Qfmt_25(0.82574877386279F),   Qfmt_25(0.64042033824166F),   Qfmt_25(0.80017989562169F),
-    Qfmt_25(0.65345189537513F),   Qfmt_25(0.77660065823396F),   Qfmt_25(0.66743520092634F),   Qfmt_25(0.75481293911653F),
-    Qfmt_25(0.68245012597642F),   Qfmt_25(0.73464482364786F),   Qfmt_25(0.69858665064723F),   Qfmt_25(0.71594645497057F),
-};
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-
-void synthesis_sub_band_LC(Int32 Sr[], Int16 data[])
-{
-
-    Int32 *temp_o1 = (Int32 *) & data[0];
-
-    Int   i;
-    Int32 *pt_temp_e;
-    Int32 *pt_temp_o = temp_o1;
-    Int32 *pt_temp_x = &Sr[63];
-    Int32 temp1;
-    Int32 temp2;
-    Int32 temp3;
-    Int32 temp11;
-
-    Int16 *pt_data_1;
-    Int16 *pt_data_2;
-
-    Int32 *pt_Sr_1 = Sr;
-    Int16 tmp1;
-    Int16 tmp2;
-    Int16 tmp11;
-    Int16 tmp22;
-    const Int32 *pt_cosTerms = CosTable_48;
-
-
-    temp2 = *(pt_temp_x--);
-    for (i = 20; i != 0; i--)
-    {
-        temp1 = *(pt_Sr_1);
-        temp3 = *(pt_cosTerms++);
-        *(pt_Sr_1++) =   temp1  + temp2;
-        *(pt_temp_o++) = fxp_mul32_Q31((temp1 - temp2), temp3) << 1;
-        temp2 = *(pt_temp_x--);
-    }
-
-    for (i = 12; i != 0; i--)
-    {
-        temp1 = *(pt_Sr_1);
-        temp3 = *(pt_cosTerms++);
-        *(pt_Sr_1++) =   temp1  + temp2;
-        *(pt_temp_o++) = fxp_mul32_Q26((temp1 - temp2), temp3);
-        temp2 = *(pt_temp_x--);
-    }
-
-
-    pv_split_LC(temp_o1, &Sr[32]);
-
-    dct_16(temp_o1, 1);     // Even terms
-    dct_16(&Sr[32], 1);     // Odd  terms
-
-    /* merge */
-
-
-    pt_Sr_1 = &temp_o1[31];
-    pt_temp_e   =  &temp_o1[15];
-    pt_temp_o   =  &Sr[47];
-
-    temp1 = *(pt_temp_o--);
-    *(pt_Sr_1--) = temp1;
-    for (i = 5; i != 0; i--)
-    {
-        temp2 = *(pt_temp_o--);
-        *(pt_Sr_1--) = *(pt_temp_e--);
-        *(pt_Sr_1--) = temp1 + temp2;
-        temp3 = *(pt_temp_o--);
-        *(pt_Sr_1--) = *(pt_temp_e--);
-        *(pt_Sr_1--) = temp2 + temp3;
-        temp1 = *(pt_temp_o--);
-        *(pt_Sr_1--) = *(pt_temp_e--);
-        *(pt_Sr_1--) = temp1 + temp3;
-    }
-
-
-    pv_split_LC(Sr, &Sr[32]);
-
-    dct_16(Sr, 1);     // Even terms
-    dct_16(&Sr[32], 1);     // Odd  terms
-
-
-    pt_temp_x   =  &temp_o1[31];
-    pt_temp_e   =  &Sr[15];
-    pt_temp_o   =  &Sr[47];
-
-    pt_data_1 = &data[95];
-
-    temp2  = *(pt_temp_x--);
-    temp11 = *(pt_temp_x--);
-    temp1  = *(pt_temp_o--);
-
-    *(pt_data_1--) = (Int16) fxp_mul32_Q31(temp2, SCALE_DOWN_LP);
-    *(pt_data_1--) = (Int16) fxp_mul32_Q31(temp1, SCALE_DOWN_LP);
-
-    for (i = 5; i != 0; i--)
-    {
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp11 + temp2), SCALE_DOWN_LP);
-        temp3         = *(pt_temp_x--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31(*(pt_temp_e--), SCALE_DOWN_LP);
-        temp2          = *(pt_temp_o--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp11 + temp3), SCALE_DOWN_LP);
-        temp11         = *(pt_temp_x--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp1 + temp2), SCALE_DOWN_LP);
-
-
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp11 + temp3), SCALE_DOWN_LP);
-        temp1         = *(pt_temp_x--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31(*(pt_temp_e--), SCALE_DOWN_LP);
-        temp3          = *(pt_temp_o--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp11 + temp1), SCALE_DOWN_LP);
-        temp11         = *(pt_temp_x--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp2 + temp3), SCALE_DOWN_LP);
-
-
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp11 + temp1), SCALE_DOWN_LP);
-        temp2         = *(pt_temp_x--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31(*(pt_temp_e--), SCALE_DOWN_LP);
-        temp1          = *(pt_temp_o--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp11 + temp2), SCALE_DOWN_LP);
-        temp11         = *(pt_temp_x--);
-        *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp1 + temp3), SCALE_DOWN_LP);
-    }
-
-    *(pt_data_1--) = (Int16) fxp_mul32_Q31((temp11 + temp2), SCALE_DOWN_LP);
-    *(pt_data_1--) = (Int16) fxp_mul32_Q31(*(pt_temp_e), SCALE_DOWN_LP);
-
-    /* ---- merge ends---- */
-
-
-    pt_data_1 = &data[95];
-    pt_data_2 = &data[96];
-
-    *(pt_data_2++) =   0;
-    tmp1  =  *(pt_data_1--);
-    tmp2  =  *(pt_data_1--);
-    tmp11 =  *(pt_data_1--);
-    tmp22 =  *(pt_data_1--);
-
-    for (i = 7; i != 0; i--)
-    {
-        *(pt_data_2++) = (-tmp1);
-        *(pt_data_2++) = (-tmp2);
-        *(pt_data_2++) = (-tmp11);
-        *(pt_data_2++) = (-tmp22);
-        tmp1  =  *(pt_data_1--);
-        tmp2  =  *(pt_data_1--);
-        tmp11 =  *(pt_data_1--);
-        tmp22 =  *(pt_data_1--);
-    }
-
-
-    *(pt_data_2++) = (-tmp1);
-    *(pt_data_2++) = (-tmp2);
-    *(pt_data_2++) = (-tmp11);
-
-    pt_data_2 = &data[0];
-
-    *(pt_data_2++) =  tmp22;
-    tmp1  =  *(pt_data_1--);
-    tmp2  =  *(pt_data_1--);
-    tmp11 =  *(pt_data_1--);
-    tmp22 =  *(pt_data_1--);
-
-    for (i = 7; i != 0; i--)
-    {
-        *(pt_data_2++) =  tmp1;
-        *(pt_data_2++) =  tmp2;
-        *(pt_data_2++) =  tmp11;
-        *(pt_data_2++) =  tmp22;
-        tmp1  =  *(pt_data_1--);
-        tmp2  =  *(pt_data_1--);
-        tmp11 =  *(pt_data_1--);
-        tmp22 =  *(pt_data_1--);
-    }
-
-    *(pt_data_2++) =  tmp1;
-    *(pt_data_2++) =  tmp2;
-    *(pt_data_2++) =  tmp11;
-    *(pt_data_2)   =  tmp22;
-
-}
-
-
-void synthesis_sub_band_LC_down_sampled(Int32 Sr[], Int16 data[])
-{
-
-    Int i ;
-    Int16 *pt_data_1;
-
-    pt_data_1 = &data[0];
-
-    dct_32(Sr);
-
-    for (i = 0; i < 16; i++)
-    {
-        pt_data_1[   i] = (Int16)(Sr[16-i] >> 5);
-        pt_data_1[16+i] = (Int16)(Sr[i] >> 5);
-        pt_data_1[32+i] = (Int16)(Sr[16+i] >> 5);
-    }
-    for (i = 0; i < 15; i++)
-    {
-        pt_data_1[49+i] = (Int16)(-Sr[31-i] >> 5);
-    }
-    pt_data_1[48] = 0;
-}
-
-
-#ifdef HQ_SBR
-
-void synthesis_sub_band(Int32 Sr[], Int32 Si[], Int16 data[])
-{
-
-
-    Int32 i ;
-    Int16 *pt_data_1;
-    Int16 *pt_data_2;
-    Int32 *pt_Sr_1;
-    Int32 *pt_Sr_2;
-    Int32 *pt_Si_1;
-    Int32 *pt_Si_2;
-
-    Int32 tmp1;
-    Int32 tmp2;
-    Int32 tmp3;
-    Int32 tmp4;
-
-    Int32 cosx;
-    const Int32 *pt_CosTable = CosTable_64;
-
-
-    pt_Sr_1 = &Sr[0];
-    pt_Sr_2 = &Sr[63];
-
-    pt_Si_1 = &Si[0];
-    pt_Si_2 = &Si[63];
-
-
-    tmp3 = *pt_Sr_1;
-
-    for (i = 32; i != 0; i--)
-    {
-        tmp4 = *pt_Si_2;
-        cosx = *(pt_CosTable++);
-        *(pt_Sr_1++) = fxp_mul32_Q31(tmp3, cosx);
-        tmp3 = *pt_Si_1;
-        *(pt_Si_1++) = fxp_mul32_Q31(tmp4, cosx);
-        tmp4 = *pt_Sr_2;
-        cosx = *(pt_CosTable++);
-        *(pt_Si_2--) = fxp_mul32_Q31(tmp3, cosx);
-        *(pt_Sr_2--) = fxp_mul32_Q31(tmp4, cosx);
-        tmp3 = *pt_Sr_1;
-    }
-
-
-    dct_64(Sr, (Int32 *)data);
-    dct_64(Si, (Int32 *)data);
-
-
-    pt_data_1 = &data[0];
-    pt_data_2 = &data[127];
-
-    pt_Sr_1 = &Sr[0];
-    pt_Si_1 = &Si[0];
-
-    tmp1 = *(pt_Sr_1++);
-    tmp3 = *(pt_Sr_1++);
-    tmp2 = *(pt_Si_1++);
-    tmp4 = *(pt_Si_1++);
-
-    for (i = 32; i != 0; i--)
-    {
-        *(pt_data_1++) = (Int16) fxp_mul32_Q31((tmp2 - tmp1), SCALE_DOWN_HQ);
-        *(pt_data_1++) = (Int16) fxp_mul32_Q31(-(tmp3 + tmp4), SCALE_DOWN_HQ);
-        *(pt_data_2--) = (Int16) fxp_mul32_Q31((tmp1 + tmp2), SCALE_DOWN_HQ);
-        *(pt_data_2--) = (Int16) fxp_mul32_Q31((tmp3 - tmp4), SCALE_DOWN_HQ);
-
-        tmp1 = *(pt_Sr_1++);
-        tmp3 = *(pt_Sr_1++);
-        tmp2 = *(pt_Si_1++);
-        tmp4 = *(pt_Si_1++);
-    }
-
-}
-
-
-const Int32 exp_m0_25_phi[32] =
-{
-
-    0x7FFEFE6E,  0x7FEAFB4A, 0x7FC2F827, 0x7F87F505,
-    0x7F38F1E4,  0x7ED6EEC6, 0x7E60EBAB, 0x7DD6E892,
-    0x7D3AE57D,  0x7C89E26D, 0x7BC6DF61, 0x7AEFDC59,
-    0x7A06D958,  0x790AD65C, 0x77FBD367, 0x76D9D079,
-    0x75A6CD92,  0x7460CAB2, 0x7308C7DB, 0x719EC50D,
-    0x7023C248,  0x6E97BF8C, 0x6CF9BCDA, 0x6B4BBA33,
-    0x698CB796,  0x67BDB505, 0x65DEB27F, 0x63EFB005,
-    0x61F1AD97,  0x5FE4AB36, 0x5DC8A8E2, 0x5B9DA69C
-};
-
-void synthesis_sub_band_down_sampled(Int32 Sr[], Int32 Si[], Int16 data[])
-{
-
-    Int16 k;
-    Int16 *pt_data_1;
-    Int32 exp_m0_25;
-    const Int32 *pt_exp = exp_m0_25_phi;
-
-    Int32 *XX = Sr;
-    Int32 *YY = (Int32 *)data;
-    Int32 tmp1;
-    Int32 tmp2;
-
-    for (k = 0; k < 32; k++)
-    {
-        exp_m0_25 = *(pt_exp++);
-        tmp1 = Sr[k];
-        tmp2 = Si[k];
-        XX[k]    = cmplx_mul32_by_16(-tmp1,  tmp2, exp_m0_25);
-        YY[31-k] = cmplx_mul32_by_16(tmp2,  tmp1, exp_m0_25);
-    }
-
-    mdct_32(XX);
-    mdct_32(YY);
-
-    for (k = 0; k < 32; k++)
-    {
-        Si[k] = YY[k];
-    }
-
-    pt_data_1 = data;
-
-    for (k = 0; k < 16; k++)
-    {
-        *(pt_data_1++)  = (Int16)((XX[2*k  ] + Si[2*k  ]) >> 14);
-        *(pt_data_1++)  = (Int16)((XX[2*k+1] - Si[2*k+1]) >> 14);
-    }
-
-    for (k = 15; k > -1; k--)
-    {
-        *(pt_data_1++)  = (Int16)(-(XX[2*k+1] + Si[2*k+1]) >> 14);
-        *(pt_data_1++)  = (Int16)(-(XX[2*k  ] - Si[2*k  ]) >> 14);
-    }
-
-}
-
-
-#endif      /* HQ_SBR */
-
-#endif      /*  AAC_PLUS */
-
-
diff --git a/media/libstagefright/codecs/aacdec/synthesis_sub_band.h b/media/libstagefright/codecs/aacdec/synthesis_sub_band.h
deleted file mode 100644
index 042c488..0000000
--- a/media/libstagefright/codecs/aacdec/synthesis_sub_band.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: synthesis_sub_band.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
-------------------------------------------------------------------------------
-*/
-
-#ifndef SYNTHESIS_SUB_BAND_H
-#define SYNTHESIS_SUB_BAND_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES AND SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-    void synthesis_sub_band_LC(Int32 Sr[], Int16 data[]);
-    void synthesis_sub_band_LC_down_sampled(Int32 Sr[], Int16 data[]);
-
-
-#ifdef HQ_SBR
-
-    void synthesis_sub_band(Int32 Sr[], Int32 Si[], Int16 data[]);
-    void synthesis_sub_band_down_sampled(Int32 Sr[], Int32 Si[], Int16 data[]);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* SYNTHESIS_SUB_BAND_H */
-
diff --git a/media/libstagefright/codecs/aacdec/tns_ar_filter.cpp b/media/libstagefright/codecs/aacdec/tns_ar_filter.cpp
deleted file mode 100644
index db31a63..0000000
--- a/media/libstagefright/codecs/aacdec/tns_ar_filter.cpp
+++ /dev/null
@@ -1,474 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: tns_ar_filter.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Implemented 24-bit fixed point version
-               Optimized C code
-
- Description:
-            - Added OVERFLOW_SHIFT_DOWN to avoid overflow.
-            - Increased precision by using the Q format of the LPC coefficient.
-            - Modified interface to add LPC Q format and scratch memory
-              for the state variables.
-            - Added pv_memset to clear state filter
-            - Updated format for comments (to PV standard)
-            - Updated copyright notice
-
- Description:
-            - Changed multiplication scheme to increase precision. This
-              works better than older version.
-
- Description:
-            - Include log2(order) as a scaling down parameter.
-
- Description:
-            Modified to reflect code review comments
-                - misspelled words, extra comments and explicit requirements
-
- Description:
-            deleted comment about fix Q format (L 107)
-
- Description:  Implemented a more efficient version, which eliminated the use
- of "scratch memory" via introducing a pointer that references the actual
- output.
-
- Description: Removed the parameter "scratch_Int32_buffer" as this space
- in memory is no longer needed by this function.
-
- Description: Removed references to "scratch_Int32_buffer" in the Inputs
- section.
-
- Description:
-    Modified casting to ensure proper operations for different platforms
-
- Description:
-    Per code review comment:
-    Eliminated casting to UInt and Int in b_low and b_high, they are
-    redundant and may add unncessary extra cycles in some platforms
-
- Description: Updated the SW template to include the full pathname to the
- source file and a slightly modified copyright header.
-
- Description: Changed the order of the unsigned * signed multiply so the
- casting to Int32 is performed on the unsigned operand.
-
- Description:
-    Modified 32 by 16 bit multiplications to avoid unnecessary moves to
-    registers. Also split the code (based on flag direction) to simplify
-    pointer's updates
-
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    spec  = spectral input to be shaped by the filter.
-            Fixed point format
-            Int32[]
-            length = spec_length
-
-    spec_length  = length of spec array.
-            const Int
-
-    direction = direction for application of tns filter.
-                +1  filters spectrum from low to high frequencies
-                    (first input to filter is spec[0])
-                -1  filters spectrum from high to low frequencies
-                    (first input to filter is spec[spec_length-1])
-                const Int
-
-    lpc   = array of lpc coefficients, minus lpc[0] which is assumed to be "1"
-            Fixed point format
-            const Int[]
-            length = TNS_MAX_ORDER
-
-    Q_lpc = Q format for the lpc coeffcients (for max. precision, it assumes
-            that all 16 bits are used)
-            const Int
-
-    order = order of the TNS filter (Range of 1 - TNS_MAX_ORDER)
-            Int
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    spec = contains spectral data after application of TNS filter
-           Int32 array
-           length = spec_length
-
-
- Local Stores Modified:
-
- Global Stores Modified:
-
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    A block of spectral data (Int32 spec[]) of length (const Int spec_length)
-    is processed by a simple all-pole filter defined by
-    LPC coefficients passed via (const Int lpc[])
-
-    TNS filter equation
-        y(n) =  x(n) - lpc(2)*y(n-1) - ... - lpc(order+1)*y(n-order)
-
-    The filter calculation is performed in place, i.e. the output is passed
-    back to the calling function via (Int32 spec[])
-
-    The filter's order is defined by the variable (const Int order)
-    The direction of the filter's application is defined by (const Int inc)
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This function should match the functionality of the ISO code.
-    The implementation does support filter orders bigger or equal to 1.
-    The size of the spectral coeffcients has to be bigger or equal than 1.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.8 (Temporal Noise Shaping)
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-    FOR (i=0; i<order; i++)
-        state[i] = 0;
-    ENDFOR
-
-    IF (inc == -1)
-    THEN
-        spec = spec + spec_length - 1;
-    ENDIF
-
-    FOR (i=0; i<spec_length; i++)
-
-        y = *spec;
-
-        FOR (j=0; j<order; j++)
-
-            y -= lpc[j] * state[j];
-
-        ENDFOR
-
-        FOR (j=order-1; j>0; j--)
-
-            state[j] = state[j-1];
-
-        ENDFOR
-
-        state[0] = y;
-
-        *spec = y;
-
-        spec = spec + inc;
-
-    ENDFOR
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-
-   When the code is written for a specific target processor
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_tns_const.h"
-#include "tns_ar_filter.h"
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define MASK_LOW16               0xFFFF
-#define UPPER16                      16
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-Int tns_ar_filter(
-    Int32 spec[],
-    const Int spec_length,
-    const Int direction,
-    const Int32 lpc[],
-    const Int Q_lpc,
-    const Int order)
-{
-
-    Int i;
-    Int j;
-
-    /*
-     * Multiplication related variables
-     */
-
-    Int32 temp;
-
-    /*
-     *  Filter related variables
-     */
-    Int32 y0;
-
-    /*
-     *  Circular buffer to hold the filter's state
-     *  (y[n-1],y[n-2],y[n-3],etc.)
-     *
-     *  p_state and p_lpc should take advantage
-     *  of any special circular buffer instructions
-     *  if this code is hand-optimized in assembly.
-     */
-
-    Int32 *p_state = NULL;
-
-    const Int32 *p_lpc;
-
-
-    Int shift_up;
-    Int shift_down_amount;
-
-    /*
-     *  Pointer to the I/O memory space
-     */
-    Int32 *p_spec = spec;
-
-
-    i = 0;
-    j = order;
-
-    /*
-     *  get the power of 2 that is bigger than the order
-     *  i is the bit counter and j is modified until exceed
-     *  the power of 2 corresponding to TNS_MAX_ORDER
-     */
-
-    while (j < 0x010)
-    {
-        j <<= 1;
-        i++;
-    }
-
-    /*
-     *  5 is the number of bits needed to represent 0x010
-     *  TNS_MAX_ORDER = 20, power of 2 that include 20 is 5
-     */
-    shift_down_amount = 4 - i;
-
-    shift_up = UPPER16 - Q_lpc;
-
-    /*
-     *  shift_down_amount == power of 2 that is bigger than the order - 1
-     */
-
-    shift_down_amount += shift_up;
-
-    if (direction == -1)
-    {
-        p_spec += spec_length - 1;
-
-        for (i = order; i != 0; i--)
-        {
-
-            y0 = *p_spec >> shift_down_amount;
-
-            p_lpc = lpc;
-
-            /* 32 by 32 bit multiplication */
-            for (j = order; j > i; j--)
-            {
-                temp = *p_state++;
-                y0 -= fxp_mul32_Q31(temp, *(p_lpc++)) << shift_up;
-            }
-
-            /*
-            * Record the output in-place
-            */
-            p_state     = p_spec;
-            *(p_spec--) = y0;
-
-        }
-
-        if (spec_length > order)
-        {
-            for (i = (spec_length - order); i != 0; i--)
-            {
-                y0 = *p_spec >> shift_down_amount;
-
-                p_lpc = &(lpc[0]);
-
-                /* 32 by 32 bit multiplication */
-                for (j = order; j != 0; j--)
-                {
-                    temp = *p_state++;
-                    y0 -= fxp_mul32_Q31(temp, *(p_lpc++)) << shift_up;
-                }
-
-                /*
-                 * Record the output in-place
-                 */
-                p_state     = p_spec;
-                *(p_spec--) = y0;
-
-            } /* END for (i = (spec_length - order); i>0; i--) */
-        }
-
-    }
-    else
-    {
-        for (i = order; i != 0; i--)
-        {
-
-            p_lpc =  lpc;
-
-            y0 = 0;
-
-            /* 32 by 32 bit multiplication */
-            for (j = order; j > i; j--)
-            {
-                y0 -= fxp_mul32_Q31(*p_state--, *(p_lpc++));
-            }
-
-            p_state     = p_spec;
-            /*
-            * Record the output in-place
-            */
-            *(p_spec) = (*p_spec >> shift_down_amount) + (y0 << shift_up);
-            p_spec++;
-        }
-
-        if (spec_length > order)
-        {
-            for (i = (spec_length - order); i != 0; i--)
-            {
-                p_lpc =  lpc;
-
-                y0 = 0;
-
-                /* 32 by 32 bit multiplication */
-                for (j = order; j != 0; j--)
-                {
-                    y0 -= fxp_mul32_Q31(*p_state--, *(p_lpc++));
-                }
-
-                p_state     = p_spec;
-                /*
-                 * Record the output in-place
-                 */
-                *(p_spec) = (*p_spec >> shift_down_amount) + (y0 << shift_up);
-                p_spec++;
-
-            } /* END for (i = (spec_length - order); i>0; i--) */
-        }
-    }
-
-    return(shift_down_amount);
-
-
-} /* tns_ar_filter */
diff --git a/media/libstagefright/codecs/aacdec/tns_ar_filter.h b/media/libstagefright/codecs/aacdec/tns_ar_filter.h
deleted file mode 100644
index 2538b4d..0000000
--- a/media/libstagefright/codecs/aacdec/tns_ar_filter.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: tns_ar_filter.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Per request of JT, the lpc coefficients q-format will now
- be transmitted to the function.
-
- Description: Removed the parameter "scratch_Int32_buffer" as this space
- in memory is no longer needed by this function.
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This function includes the function declaration for tns_ar_filter()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef TNS_AR_FILTER_H
-#define TNS_AR_FILTER_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "e_tns_const.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    Int tns_ar_filter(
-        Int32 spec[],
-        const Int spec_length,
-        const Int inc,
-        const Int32 lpc[],
-        const Int lpc_qformat,
-        const Int order);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
diff --git a/media/libstagefright/codecs/aacdec/tns_decode_coef.cpp b/media/libstagefright/codecs/aacdec/tns_decode_coef.cpp
deleted file mode 100644
index 366cce5..0000000
--- a/media/libstagefright/codecs/aacdec/tns_decode_coef.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: tns_decode_coef.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Implemented in 16-bit Fixed Point
-
- Description:  Implemented in 24-bit Fixed Point
-
- Description:  Modified to return the calculated LPC coefficients "in place"
- This saves memory, cycles, etc. because it saves a large temporary
- array being declared on the stack in another function (tns_setup_filter)
-
- Description:  Modified to return the q-format of the lpc coefficients.
-
- Description:  Modified for more reliable overflow protection.  tns_decode_coef
- no longer relies on "reasonable" outputs.  This code should handle all
- possible inputs.
-
- Description:  Modified per review comments.
-
- Description:  Added check condition to avoid numbers with a Q bigger than
-        15 from being passed, otherwise in a 16-bit number the sign is lost.
-
- Description:  Modified to utilize scratch memory techniques, thereby
- eliminating two arrays of size TNS_MAX_ORDER, which were previously declared
- on the stack.
-
- Description: Updated the SW template to include the full pathname to the
- source file and a slightly modified copyright header.
-
- Description:
- (1) Changed the order of the unsigned * signed multiply so the
-     casting to Int32 is performed on the unsigned operand.
-
- (2) Removed some unnecessary casting.
- (3) Fixed a problem where a 16-bit value was casted to 32-bits AFTER
-     a shift.  It should have been cast to 32-bits BEFORE the shifting.
-
-
- Description:  modified precision of coefficients
-
- Who:                                   Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- The inputs and their range are defined in ISO/IEC 14496-3:1999(E)
-                                            Part 3 MPEG-4 Audio
-                                            Subpart 4
-
- Inputs:       order    = RANGE = 1-20
-               const Int
-
-               coef_res = RANGE = 0-1
-               const Int
-
-               lpc_coef = RANGE = -8 to 7 if coef_res = 1   compression OFF
-                                  -4 to 3 if coef_res = 1   compression ON
-                                  -4 to 3 if coef_res = 0   compression OFF
-                                  -2 to 1 if coef_res = 0   compression ON
-
-               [Int *, length TNS_MAX_ORDER]
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    q_lpc     = q_format for the calculated LPC coefs.
-    Int
-
- Pointers and Buffers Modified:
-    lpc_coef  = used to return the calculated LPC coefs in-place.
-    Int *
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-This function calculates the LPC coefs from the encoded coefs...
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-This function should match the functionality of the ISO source code within
-a reasonable tolerance for fixed point errors.
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.8 (Temporal Noise Shaping)
- (2) Markel & Gray Page 95
-     As referenced in the ISO source code
-
- (3) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
- PSEUDOCODE:  (ISO Reference Code)
-
-    int i, m;
-    Real iqfac, iqfac_m;
-    Real lpc_fp[TNS_MAX_ORDER+1];
-    Real sin_result_fp[TNS_MAX_ORDER+1], b[TNS_MAX_ORDER+1];
-
-    Inverse quantization
-    iqfac   = (Real)(((1 << (coef_res-1)) - 0.5) / (PI/2.0));
-    iqfac_m = (Real)(((1 << (coef_res-1)) + 0.5) / (PI/2.0));
-
-    for (i=0; i<order; i++)
-    {
-        sin_result[i+1] =
-        (Real)sin( coef[i] / ((coef[i] >= 0) ? iqfac : iqfac_m) );
-    }
-
-    lpc[0] = 1;
-    for (m=1; m<=order; m++)
-    {
-
-        b[0] = lpc[0];
-        for (i=1; i<m; i++)
-        {
-            b[i] = sin_result[m] * lpc[m-i];
-            b[i] += lpc[i];
-        }
-
-        b[m] = sin_result[m];
-
-
-        for (i=0; i<=m; i++)
-        {
-            lpc[i] = b[i];
-        }
-
-    }
-
-    return;
-
-}
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_tns_const.h"
-#include "tns_decode_coef.h"
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define MASK_LOW16  0xffff
-#define UPPER16     16
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-/*
- * Derivation of tns_tables and q_tns_tables
- *
- * As defined in the ISO source code
- * (with the modification that our coef_res has a range[0,1]
- * The ISO code has a range of [3,4])
- *
- *               pi / 2                              pi / 2
- * iqfac =  --------------------      iqfac_m =  --------------------
- *          (coef_res + 2) - 1/                  (coef_res + 2) + 1/
- *         2                 /2                 2                 /2
- *
- *
- * ... Move 1/2 into denominator
- *
- *              pi                                   pi
- * iqfac =  --------------------      iqfac_m =  --------------------
- *          (coef_res + 3)                        (coef_res + 3)
- *         2               - 1                   2              + 1
- *
- *
- * if a coef is negative, it is multiplied by iqfac_m
- *           if positive, "   "     "         iqfac
- *
- * The range of coefs is limited to  -4:3 if coef_res = 0
- *                                   -8:7 if coef_res = 1
- *
- *
- *
- */
-
-
-const Int32 tns_table[2][16] =
-{
-    {
-        -2114858546,  -1859775393,  -1380375881,  -734482665,
-        0,    931758235,   1678970324,  2093641749
-    },
-    {
-        -2138322861,  -2065504841,  -1922348530,  -1713728946,
-        -1446750378,  -1130504462,   -775760571,   -394599085,
-        0,    446486956,    873460290,   1262259218,
-        1595891361,   1859775393,   2042378317,   2135719508
-    }
-};
-
-
-const Int neg_offset[2] = {4, 8};
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
- FUNCTION NAME: tns_decode_coef
-    Decoder transmitted coefficients for one TNS filter
-----------------------------------------------------------------------------*/
-
-Int tns_decode_coef(
-    const Int   order,
-    const Int   coef_res,
-    Int32 lpc_coef[TNS_MAX_ORDER],
-    Int32 scratchTnsDecCoefMem[2*TNS_MAX_ORDER])
-{
-
-    /* Simple loop counters */
-    Int i;
-    Int m;
-
-    /* Arrays for calculation of the LPC */
-    Int32 *pB = &(scratchTnsDecCoefMem[TNS_MAX_ORDER]);
-
-    Int32 *pA = scratchTnsDecCoefMem;
-
-    Int32 *temp_ptr = NULL;
-
-    /* Pointer for reading/storing the lpc_coef in place */
-    Int32 *pLPC;
-    Int q_lpc = Q_LPC;
-
-    /* TNS table related variables */
-    const Int32 *pTnsTable;
-    Int coef_offset;
-    Int32 table_index;
-    Int shift_amount;
-    Int32 sin_result;
-
-    Int32 tempInt32;
-
-    Int32 max;
-    Int32 mask;
-
-    Int32 mult_high;
-
-    /* Conversion to LPC coefficients Ref. (2) */
-    coef_offset = neg_offset[coef_res];
-    pTnsTable   = tns_table[coef_res];
-
-    m = 0;
-    pLPC = lpc_coef;
-
-
-    /*
-     *  Conversion to LPC coefficients
-     */
-
-    do
-    {
-        table_index = coef_offset + *(pLPC++);
-
-        /* Equiv. to sin_result  = tns_table[coef_res][table_index]; */
-        sin_result = *(pTnsTable + table_index);
-
-        /* sin_result has a range of -0.999 to +0.999 in Q-31 */
-
-        /*
-         * It is important that this for loop is not entered on the first
-         * iteration of the do-while( m < order ) loop.
-         */
-        for (i = m; i > 0; i--)
-        {
-
-            /*
-             * temp_ptr used to optimize index into pA
-             * mult = (Int32)( pA[m-i] * sin_result);
-             */
-
-            mult_high = fxp_mul32_Q31(*(temp_ptr--), sin_result);
-
-            /*
-             *  pB[i] = pA[i] + sin_result * pA[m-i]
-             *
-             *  (mult_high <<1)  eliminates extra sign bit
-             */
-
-            *(pB++) =  *(pA++) + (mult_high << 1);
-
-        } /* END for (i=m; i > 0; i--) */
-
-
-        /* Shift to place pB[m] in q_lpc format */
-
-        *pB =  sin_result >> 12;
-
-        /*
-         * Swapping the pointers here has the same effect
-         * as specifically copying the data from b to a
-         */
-
-        temp_ptr = pA;
-        pA       = pB;
-        pB       = temp_ptr;
-
-        /*
-         *  At this point, pA = pA[m]
-         *             and pB = pB[m]
-         */
-        temp_ptr = pA;
-
-        tempInt32 = *(pA);
-
-        mask = tempInt32 >> 31;
-        tempInt32 ^= mask;
-
-        max = tempInt32;
-
-        /*
-         * It is important that this for loop is not entered on the first
-         * iteration of the do-while( m < order ) loop.
-         */
-        for (i = m; i > 0; i--)
-        {
-            tempInt32 = *(--pA);
-
-            mask = tempInt32 >> 31;
-            tempInt32 ^= mask;
-
-            max |= tempInt32;
-        }
-
-        pB -= m;
-
-        /*
-         * Here, pA = &(pA[0])
-         * and   pB = &(pB[0])
-         */
-
-        if (max >= 0x40000000L)
-        {
-            max >>= 1;
-
-            for (i = m; i > 0; i--)
-            {
-                *(pA++) >>= 1;
-                *(pB++) >>= 1;
-            }
-
-            /* Shift the most recent entry down also */
-            *(pA) >>= 1;
-
-            q_lpc--;
-
-            pA -= m;
-            pB -= m;
-        }
-
-        m++;
-
-    }
-    while (m < order);
-
-
-    /*
-     * The following code compacts
-     * 32-bit LPC coefficients into 16-bit numbers,
-     * shifting by the minimum amount necessary.
-     */
-
-    shift_amount = 0;
-
-    while (max > 32767)
-    {
-        max >>= 1;
-        shift_amount++;
-    }
-
-    /*
-     * This while loop is for protective purposes only.
-     * I have not found data that causes it to be entered.
-     *
-     */
-    if (max != 0)
-    {
-        while (max < 16384)
-        {
-            max <<= 1;
-            shift_amount--;
-        }
-    }
-
-
-    pLPC = lpc_coef;
-
-    if (shift_amount >= 0)
-    {
-
-        for (m = order; m > 0; m--)
-        {
-            *(pLPC++) = *(pA++) << (16 - shift_amount);
-        }
-    }
-
-
-    q_lpc -= shift_amount;
-
-    /*
-     *  make sure that the numbers have some meaning, q_lpc can not be
-     *  bigger than 15 (15 bits + sign)
-     */
-
-    if (q_lpc > 15)
-    {
-        shift_amount = q_lpc - 15;
-        pLPC = lpc_coef;
-
-        for (m = order; m > 0; m--)
-        {
-            *(pLPC++) >>= shift_amount;
-        }
-
-        q_lpc -= shift_amount;
-    }
-
-    return (q_lpc);
-
-} /* tns_decode_coef */
diff --git a/media/libstagefright/codecs/aacdec/tns_decode_coef.h b/media/libstagefright/codecs/aacdec/tns_decode_coef.h
deleted file mode 100644
index a6bac6c..0000000
--- a/media/libstagefright/codecs/aacdec/tns_decode_coef.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: tns_decode_coef.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Modified to return the LPC coefficients in-place, so the
- interface to tns_decode_coef is changed.
-
- Description: Modified to return the q-format of the LPC coefficients.
-
- Description: Modified so that only the function is declared here.  extern
- references to constant tables removed.  Also, new copyright header included.
-
- Description: Modified to include extra parameter, so tns_decode_coef can use
- scratch memory techniques.
-
- Description:
- (1) Modified to include the lines...
-
-    #ifdef __cplusplus
-    extern "C" {
-    #endif
-
-    #ifdef __cplusplus
-    }
-    #endif
-
- (2) Updated the copyright header.
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This function includes the function declaration for tns_decode_coef()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef TNS_DECODE_COEF_H
-#define TNS_DECODE_COEF_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-    Int tns_decode_coef(
-        const Int   order,
-        const Int   coef_res,
-        Int32 lpc_coef[],
-        Int32 scratchTnsDecCoefMem[]);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* TNS_DECODE_COEF */
diff --git a/media/libstagefright/codecs/aacdec/tns_inv_filter.cpp b/media/libstagefright/codecs/aacdec/tns_inv_filter.cpp
deleted file mode 100644
index 631f887..0000000
--- a/media/libstagefright/codecs/aacdec/tns_inv_filter.cpp
+++ /dev/null
@@ -1,421 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: tns_inv_filter.c
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Changes made per review comments.
-
- Description: As requested by JT, the q-format for the LPC coefficients is
- now passed via the parameter lpc_qformat.
-
- Description: For speed, the calculation of the shift amount was pulled
- outside of the loop.
-
- Description:
-    Modified casting to ensure proper operations for different platforms
-
- Description:
-    Simplified MAC operations for filter by eliminating extra variables
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-
-    coef           = spectral input to be shaped by the filter.
-                     Fixed point format
-                     [Int32[], length = num_coef]
-
-    num_coef       = length of spec array.
-                     [const Int]
-
-    direction      = direction for application of tns filter.
-                     +1 applies forward filter
-                     (first input to filter is coef[0])
-                     -1 applies reversed filter
-                     (first input to filter is coef[num_coef-1])
-                     [const Int]
-
-    lpc            = array of lpc coefficients.
-                     Fixed point format Q-11
-                     [const Int[], length = TNS_MAX_ORDER]
-
-    lpc_qformat    = The q-format of the lpc coefficients.
-                     [const Int]
-
-    order          = order of the TNS filter (Range of 1 : TNS_MAX_ORDER)
-                     [const Int]
-
-    scratch_memory = scratch_memory needed for filter operation
-                     [Int[], length = TNS_MAX_ORDER]
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    coef = contains spectral data after application of TNS filter
-           q-format is not modified.
-           Int32 array
-           length = num_coef
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-    A block of spectral data (Int32 coef[]) of length (const Int num_coef)
-    is processed by a simple all-zero filter defined by
-    LPC coefficients passed via (const Int lpc[])
-
-    TNS filter equation
-        y(n) =  x(n) + lpc(2)*x(n-1) + ... + lpc(order+1)*x(n-order)
-
-    The filter calculation is performed in place, i.e. the output is passed
-    back to the calling function via (Int32 coef[])
-
-    In order to avoid overflow, the filter input (Int32 coef[]) must utilize
-    only the lower 16-bits.  The upper 16-bits must be available.
-
-    The filter's order is defined by the variable (const Int order)
-
-    The direction of the filter's application is defined by
-    (const Int direction)
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    [Int32 coef] must store no more than 16 bits of data.
-
-    This is required to utilize methods that do not change the q-format of
-    the input data [Int32 coef], and to make use of a fast
-    16 x 16 bit multiply.
-
-    This function should not be called for order <= 0.
-
-    This function must not be called with lpc_qformat < 5
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.6.4.1 (LTP with TNS)
-        Subpart 4.6.8 (Temporal Noise Shaping)
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    IF (direction == -1)
-    THEN
-        pCoef = pCoef + (num_coef - 1);
-    END IF
-
-    FOR (i = order; i > 0; i--)
-
-        *(pFilterInput) = 0;
-        pFilterInput = pFilterInput + 1;
-
-    END FOR
-
-    wrap_point = 0;
-
-    shift_amt  = (lpc_qformat - 5);
-
-    FOR (i = num_coef; i > 0; i--)
-
-        pLPC = lpc;
-
-        mult = 0;
-
-        FOR (j = wrap_point; j>0; j--)
-
-           tempInt32 = (Int32)(*(pLPC) * *(pFilterInput));
-           tempInt32 = tempInt32 >> 5;
-
-           mult = mult + tempInt32;
-
-           pFilterInput = pFilterInput + 1;
-           pLPC = pLPC + 1;
-
-        ENDFOR
-
-        pFilterInput = scratch_memory;
-
-        FOR (j = (order - wrap_point); j>0; j--)
-
-           tempInt32 = (Int32)(*(pLPC) * *(pFilterInput));
-           tempInt32 = tempInt32 >> 5;
-
-           mult = mult + tempInt32;
-
-           pFilterInput = pFilterInput + 1;
-           pLPC = pLPC + 1;
-
-        ENDFOR
-
-        pFilterInput = pFilterInput - 1;
-        *(pFilterInput) = (Int)(*pCoef);
-
-        mult = mult >> shift_amt;
-
-        *(pCoef) = *(pCoef) + mult;
-
-        pCoef = pCoef + direction;
-
-        wrap_point = wrap_point + 1;
-
-        IF (wrap_point == order)
-        THEN
-            wrap_point = 0;
-        END IF
-
-    END FOR
-
-------------------------------------------------------------------------------
- RESOURCES USED
-
-   When the code is written for a specific target processor
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "tns_inv_filter.h"
-#include "fxp_mul32.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-void tns_inv_filter(
-    Int32 coef[],
-    const Int num_coef,
-    const Int direction,
-    const Int32 lpc[],
-    const Int lpc_qformat,
-    const Int order,
-    Int32 scratch_memory[])
-{
-
-    Int i;
-    Int j;
-    Int shift_amt;
-    Int wrap_point;
-
-    Int32 mult;
-
-    /*
-     * Circular buffer to hold the filter's input
-     *
-     * (x[n-1],x[n-2],x[n-3],etc.)
-     *
-     * This scratch space is necessary, because
-     * the filter's output is returned in-place.
-     *
-     * pFilterInput and pLPC should take advantage
-     * of any special circular buffer instructions
-     * if this code is hand-optimized in assembly.
-     *
-     */
-    Int32 *pFilterInput = scratch_memory;
-
-    const Int32 *pLPC;
-
-    /*
-     * Pointer to the I/O memory space
-     */
-    Int32 *pCoef = coef;
-
-    if (direction == -1)
-    {
-        pCoef += (num_coef - 1);
-    }
-
-    /* Make sure the scratch memory is "clean" */
-    for (i = order; i != 0; i--)
-    {
-        *(pFilterInput++) = 0;
-    }
-
-    wrap_point = 0;
-
-    shift_amt  = (lpc_qformat - 5);
-
-    for (i = num_coef; i > 0; i--)
-    {
-        /*
-         * Copy spectral input into special
-         * filter input buffer.
-         */
-        pLPC = lpc;
-
-        mult = 0;
-
-        /*
-         * wrap_point = 0 when this code is
-         * entered for the first iteration of
-         * for(i=num_coef; i>0; i--)
-         *
-         * So, this first for-loop will be
-         * skipped when i == num_coef.
-         */
-
-        for (j = wrap_point; j > 0; j--)
-        {
-            mult += fxp_mul32_Q31(*(pLPC++), *(pFilterInput++)) >> 5;
-
-        } /* for (j = wrap_point; j>0; j--) */
-
-        /*
-         * pFilterInput has reached &scratch_memory[order-1]
-         * Reset pointer to beginning of filter's state memory
-         */
-        pFilterInput = scratch_memory;
-
-        for (j = (order - wrap_point); j > 0; j--)
-        {
-            mult += fxp_mul32_Q31(*(pLPC++), *(pFilterInput++)) >> 5;
-
-        } /* for (j = wrap_point; j>0; j--) */
-
-
-        /*
-         * Fill the filter's state buffer
-         * avoid obvious casting
-         */
-        *(--pFilterInput) = (*pCoef);
-
-
-        /* Scale the data down so the output q-format is not adjusted.
-         *
-         * Here is an equation, which shows how the spectral coefficients
-         * and lpc coefficients are multiplied and the spectral
-         * coefficient's q-format does not change.
-         *
-         * Q-(coef) * Q-(lpc_qformat) >> 5 = Q-(coef + lpc_q_format - 5)
-         *
-         * Q-(coef + lpc_q_format - 5) >> (lpc_qformat - 5) = Q-(coef)
-         */
-
-        /* Store output in place */
-        *(pCoef) += (mult >> shift_amt);
-
-        /* Adjust pointers and placeholders */
-        pCoef += direction;
-
-        wrap_point++;
-
-        if (wrap_point == order)
-        {
-            wrap_point = 0;
-        }
-
-    } /* for (i = num_coef; i > 0; i--) */
-
-} /* tns_inv_filter */
diff --git a/media/libstagefright/codecs/aacdec/tns_inv_filter.h b/media/libstagefright/codecs/aacdec/tns_inv_filter.h
deleted file mode 100644
index 1b57fc1..0000000
--- a/media/libstagefright/codecs/aacdec/tns_inv_filter.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: tns_inv_filter.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Per request of JT, the lpc coefficients q-format will now
- be transmitted to the function.
-
- Description: The scratch memory was mistakenly declared here as type "Int32"
- It should have been "Int"
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This include file contains the function declaration for
- tns_inv_filter.c
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef TNS_INV_FILTER_H
-#define TNS_INV_FILTER_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-void tns_inv_filter(
-    Int32 coef[],
-    const Int   num_coef,
-    const Int   inc,
-    const Int32 lpc[],
-    const Int   lpc_qformat,
-    const Int   order,
-    Int32 scratch_memory[]);
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/trans4m_freq_2_time_fxp.cpp b/media/libstagefright/codecs/aacdec/trans4m_freq_2_time_fxp.cpp
deleted file mode 100644
index 6ccc023..0000000
--- a/media/libstagefright/codecs/aacdec/trans4m_freq_2_time_fxp.cpp
+++ /dev/null
@@ -1,2604 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Pathname: trans4m_freq_2_time_fxp.c
-  Function: trans4m_freq_2_time_fxp
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
-    changed to decrement loop
-    change wnd_shape from structure to passing parameters
-    modified window tables from UInt to UInt16 to assure proper operation
-    without dubious typecast
-    changed logic to hit most common states first.
-    modified Time_data from Int to Int32 to hold
-    possible overflow before saturation process.
-
- Description:
-    Increase processing on some loop by using more pointers
-    changed interface to avoid passing a pointer for wnd_shape_prev_bk, this
-    element is not change in this function because of this function use
-    in the LTP module
-
- Description:
-    Added rounding to multiplication
-
- Description:
-    Update input description and eliminate unneeded comments
-
- Description:
-    LONG_START_WINDOW was using SHORT_WINDOW instead of
-    HALF_SHORT_WINDOW, causing a for loop to exceed its count
-
- Description:
-    Modified structure of code so exp is not tested before it
-    is initialized.  Also, new structure avoids double-testing
-    of exp_freq = ALL_ZEROS_BUFFER.
-
- Description:
-    The result of a shift is undefined if the right operand is greater than
-    or equal to the number of bits in the left expression's type
-    To avoid undefined shift by 32, a check of the shift has been
-    added, so the function proceeds only when the exponent is less
-    than 32. By design the shift up is related to the global gain,
-    and controlled by the encoder, so saturation is not allowed.
-    In both short and long window, processing is skip if an all zero
-    input buffer or excessive down shift is detected.
-
- Description:
-    Changes according to code review comments. Also, modified if-else
-    structure so the imdct_fxp is not called with an all zero input buffer
-
- Description:
-    Replaced function buffer_normalization by buffer_adaptation, to ease
-    use of 16 bits. Function buffer_normalization becomes  obsolete.
-
- Description:
-    Modified call to imdct_fxp to reflect extended precision use. Added
-    routine buffer_adaptation to extract 16 MSB and keep highest.
-    precision. Modify casting to ensure proper operations for different
-    platforms
-
- Description:
-    Eliminate double access to memory by loading data directly to the
-    time array. Also reduced cycle count and added precision by combining
-    downshifting in only one operation. Added adaptive rounding factor.
-    Change exponent threshold when operations are waived. It is use to be 32
-    but by combining downshifting, this new threshold is now 16. This may
-    avoid unneeded calculations for extremely small numbers.
-
- Description:
-    Per review comments:
-        - Added comments to clarify buffer_adaptation function
-        - Deleted  reference to include file "buffer_normalization.h"
-        - Modified IF-ELSE so long_windows case is considered first
-        - Eliminated extra IF when computing the rounding, so when exp ==0
-          less cycles are used shifting than in an extra if-else
-        - Corrected negative shift when computing rounding factor
-        - Added condition when exp > 16 (for long windows)
-
- Description:
-    Modified IF-ELSE structure so now ALL_ZEROS_BUFFER condition is share
-    with exp > 16 condition. This avoid code duplication for both cases.
-
- Description:
-        - Modified function interface to add output_buffer
-        - Eliminated the 32 bit version of the current output, calculations
-          are placed directly in output_buffer. In this way the buffer
-          Time_data needs only to be 1024 Int32, instead of 2048 (per channel).
-          Also, added the limit macro inside the function (this reduces access
-          to memory).
-        - Updated Pseudo - Code
-
- Description:
-    Per review comments:
-          Corrected line sizes and mispelling,  added comments and swap
-          order or switch statement for ONLY_LONG_SEQUENCE.
-
- Description:
-    Eliminated adaptive rounding due to potential saturation.
-
- Description:
-    Eliminated use of buffer adaptation by shifting this functionality inside
-    the imdct_fxp() routine. Also modified the call to imdct_fxp to accomodate
-    new function interface.
-    Modified macro limit() to save cycles when testing the most common case:
-    no saturation.
-
- Description:
-    Changed new function interface for imdct_fxp().
-
- Description:
-    Replaced for-loop with memset and memcopy.
-
- Who:                         Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    Frequency_data    =  vector with spectral information, size 2048
-                         type Int32
-
-    Time_data         =  buffer with data from previous Frequency to Time
-                         conversion, used for overlap and add, size 1024
-                         type Int32
-
-    Output_buffer     =  place holder for current output,  size 1024
-                         type Int16
-
-    wnd_seq           =  window sequence
-                         type WINDOW_SEQUENCE
-
-    wnd_shape_prev_bk =  previous window shape type
-                         type Int
-
-    wnd_shape_this_bk =  current window shape type
-                         type Int
-
-    Q_format          =  Q format for the input frequency data
-                         type Int
-
-    freq_2_time_buffer[] =  scratch memory for computing FFT
-                         type Int32
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    Output_buffer
-    Time_data
-    Frequency_data
-    pWnd_shape_prev_bk
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-The time/frequency representation of the signal is mapped onto the time
-domain by feeding it into the filterbank module. This module consists of
-an inverse modified discrete cosine transform (IMDCT), and a window and an
-overlap-add function. In order to adapt the time/frequency resolution of the
-filterbank to the characteristics of the input signal, a block switching tool
-is also adopted. N represents the window length, where N is a function of the
-window_sequence. For each channel, the N/2 time-frequency values are
-transformed into the N time domain values via the IMDCT. After applying the
-window function, for each channel, the first half of the sequence is added to
-the second half of the previous block windowed sequence to reconstruct the
-output samples for each channel outi,n.
-
-The adaptation of the time-frequency resolution of the filterbank to the
-characteristics of the input signal is done by shifting between transforms
-whose input lengths are either 2048 or 256 samples. By enabling the block
-switching tool, the following transitions are meaningful:
-
-from ONLY_LONG_SEQUENCE to   { LONG_START_SEQUENCE
-                               ONLY_LONG_SEQUENCE
-
-from LONG_START_SEQUENCE to  { LONG_STOP_SEQUENCE
-                               EIGHT_SHORT_SEQUENCE
-
-from LONG_STOP_SEQUENCE to   { LONG_START_SEQUENCE
-                               ONLY_LONG_SEQUENCE
-
-from EIGHT_SHORT_SEQUENCE to { LONG_STOP_SEQUENCE
-                               EIGHT_SHORT_SEQUENCE
-
-Window shape decisions are made by the encoder on a frame-by-frame-basis.
-The window selected is applicable to the second half of the window function
-only, since the first half is constrained to use the appropriate window
-shape from the preceding frame.
-The 2048 time-domain values x'(i)(n), (i window, n sample) to be windowed are
-the last 1024 values of the previous window_sequence concatenated with 1024
-values of the current block. The formula below shows this fact:
-
-                     |  x(i-1)(n+1024)      for    0 < n < 1024
-            x'(i)(n) {
-                     |  x(i)(n)             for 1024 < n < 2048
-
-
-Buffer Time_data data from previous Frequency to Time conversion, used
-for overlap and add
-
-Once the window shape is selected, the window_shape syntax element is
-initialized. Together with the chosen window_sequence all information needed
-for windowing exist.
-With the window halves described below all window_sequences can be assembled.
-For window_shape == 1, the window coefficients are given by the Kaiser -
-Bessel derived (KBD) window.
-Otherwise, for window_shape == 0, a sine window is employed.
-
-The window length N can be 2048 or 256 for the KBD and the sine window.
-All four window_sequences explained below have a total length of 2048
-samples.
-For all kinds of window_sequences the window_shape of the left half of
-the first transform window is determined by the window shape of the previous
-block.
-
-In the case of EIGHT_SHORT_SEQUENCE the processing is done in-place and
-in descendent order to avoid using extra memory.
-The ordering is as follows:
-
-                                            Pn: Previous data for window n
-                                            Cn:  Current data for window n
-
-
-                                                128 freq.
-                                                 samples
-                  FREQ                          ++++++
-IN                         ===========================
-                                                    \
-                                                      \
-                                                        ->  256 time
-                                                             samples
-
-                                                           P8    C8
-           8                                            #######++++++
-                                                    P7     C7
-           7                                     #######++++++
-           :                                :
-           :                                :
-                            P2    C2
-           2             #######++++++
-                     P1    C1
-           1      #######++++++
-                                                                          TIME
-OUT          ==============================================================
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This module shall implement a scheme to switch between window types
-
-------------------------------------------------------------------------------
- REFERENCES
-
-    [1] ISO 14496-3:1999, pag 111
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-
-
-    IF ( wnd_seq == EIGHT_SHORT_SEQUENCE)
-    THEN
-
-        FOR ( i=0; i<LONG_WINDOW; i++)
-            Time_data[LONG_WINDOW + i] = 0;
-        ENDFOR
-
-        FOR ( wnd=NUM_SHORT_WINDOWS-1; wnd>=0; wnd--)
-
-            pFreqInfo = &Frequency_data[ wnd*SHORT_WINDOW];
-
-            CALL IMDCT( pFreqInfo, SHORT_BLOCK1);
-            MODIFYING(pFreqInfo)
-
-
-            IF (wnd == 0)
-            THEN
-                pShort_Window_1 = &Short_Window[wnd_shape_prev_bk][0];
-            ELSE
-                pShort_Window_1 = &Short_Window[wnd_shape_this_bk][0];
-            ENDIF
-
-            pShort_Window_2   =
-                    &Short_Window[wnd_shape->this_bk][SHORT_WINDOW_m_1];
-
-            FOR( i=0, j=SHORT_WINDOW; i<SHORT_WINDOW; i++, j--)
-                pFreqInfo[             i]  *= pShort_Window_1[i];
-                pFreqInfo[SHORT_WINDOW+i]  *= pShort_Window_2[j];
-            ENDFOR
-
-
-            FOR( i=0; i<SHORT_BLOCK1; i++)
-                Time_data[W_L_STOP_1 + SHORT_WINDOW*wnd + i] += pFreqInfo[i];
-            ENDFOR
-
-        ENDFOR
-
-        FOR ( i=0; i<LONG_WINDOW; i++)
-            temp              = Time_data[i];
-            Output_buffer[i]  = Time_data[i];
-            Time_data[i]      = temp;
-        ENDFOR
-    ELSE
-
-        CALL IMDCT( Frequency_data, LONG_BLOCK1)
-            MODIFYING(Frequency_data)
-
-        SWITCH ( wnd_seq)
-
-            CASE ( ONLY_LONG_SEQUENCE)
-
-                pLong_Window_1 = &Long_Window[wnd_shape_prev_bk][0];
-                pLong_Window_2 =
-                        &Long_Window[wnd_shape_this_bk][LONG_WINDOW_m_1];
-
-                FOR (i=0; i<LONG_WINDOW; i++)
-                    Frequency_data[            i] *= *pLong_Window_1++;
-                    Frequency_data[LONG_WINDOW+i] *= *pLong_Window_2--;
-                ENDFOR
-
-                BREAK
-
-            CASE ( LONG_START_SEQUENCE)
-
-                pLong_Window_1 = &Long_Window[wnd_shape_prev_bk][0];
-
-                FOR ( i=0; i<LONG_WINDOW; i++)
-                    Frequency_data[ i] *= *pLong_Window_1++;
-                ENDFOR
-
-                pShort_Window_1   =
-                        &Short_Window[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-                FOR ( i=0; i<SHORT_WINDOW; i++)
-                    Frequency_data[W_L_START_1 + i] *= *pShort_Window_1--;
-                ENDFOR
-
-                FOR ( i=W_L_START_2; i<LONG_BLOCK1; i++)
-                    Frequency_data[W_L_START_2 + i] = 0;
-                ENDFOR
-
-                BREAK
-
-
-            CASE ( LONG_STOP_SEQUENCE )
-
-                FOR ( i=0; i<W_L_STOP_1; i++)
-                    Frequency_data[ i] = 0;
-                ENDFOR
-
-                pShort_Window_1   = &Short_Window[wnd_shape_prev_bk][0];
-
-                FOR ( i=0; i<SHORT_WINDOW; i++)
-                    Frequency_data[W_L_STOP_1+ i] *= *pShort_Window_1++;
-                ENDFOR
-
-                pLong_Window_1 =
-                        &Long_Window[wnd_shape_this_bk][LONG_WINDOW_m_1];
-
-                FOR ( i=0; i<LONG_WINDOW; i++)
-                    Frequency_data[LONG_WINDOW + i]  *=  *pLong_Window_1--;
-                ENDFOR
-
-                BREAK
-
-        }
-
-
-        FOR ( i=0; i<LONG_WINDOW; i++)
-            Output_buffer[i]  = Frequency_data[i]  + Time_data[i];
-            Time_data[i] = Frequency_data[LONG_WINDOW+i];
-        ENDFOR
-
-    }
-
-    ENDIF
-
-
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "aac_mem_funcs.h"
-#include "window_block_fxp.h"
-#include "imdct_fxp.h"
-
-#include "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; limit(x) saturates any number that exceeds a 16-bit representation into a
-; 16 bit number.
-----------------------------------------------------------------------------*/
-
-#define  ROUNDING_SCALED     (ROUNDING<<(16 - SCALING))
-
-
-#if defined(PV_ARM_V5)
-
-
-__inline Int16 sat(Int32 y)
-{
-    Int32 x;
-    Int32 z;
-    __asm
-    {
-        mov x, ROUNDING_SCALED
-        mov y, y, lsl #(15-SCALING)
-        qdadd z, x, y
-        mov y, z, lsr #16
-    }
-    return((Int16)y);
-}
-
-#define  limiter( y, x)   y = sat(x);
-
-
-
-#elif defined(PV_ARM_GCC_V5)
-
-
-__inline Int16 sat(Int32 y)
-{
-    register Int32 x;
-    register Int32 ra = (Int32)y;
-    register Int32 z = ROUNDING_SCALED;
-
-
-    asm volatile(
-        "mov %0, %1, lsl #5\n\t"    // (15-SCALING) assembler does not take symbols
-        "qdadd %0, %2, %0\n\t"
-        "mov %0, %0, lsr #16"
-    : "=&r*i"(x)
-                : "r"(ra),
-                "r"(z));
-
-    return ((Int16)x);
-}
-
-#define  limiter( y, x)   y = sat(x);
-
-
-#elif defined(PV_ARM_MSC_EVC_V5)
-
-
-#define  limiter( y, x)       z = x<< (15-SCALING); \
-                              y = _DAddSatInt( ROUNDING_SCALED, z)>>16;
-
-
-#else
-
-#define  limiter( y, x)   z = ((x + ROUNDING )>>SCALING); \
-                          if ((z>>15) != (z>>31))         \
-                          {                                    \
-                              z = (z >> 31) ^ INT16_MAX;       \
-                          } \
-                          y = (Int16)(z);
-
-#endif
-
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-#ifdef AAC_PLUS
-
-
-void trans4m_freq_2_time_fxp_1(
-    Int32               Frequency_data[],
-    Int32               Time_data[],
-    Int16               Output_buffer[],
-    WINDOW_SEQUENCE     wnd_seq,
-    Int                 wnd_shape_prev_bk,
-    Int                 wnd_shape_this_bk,
-    Int                 Q_format,
-    Int32               abs_max_per_window[],
-    Int32               freq_2_time_buffer[])
-
-{
-    Int exp;
-    Int shift;
-
-    Int  i;
-    Int  wnd;
-#if !(defined( PV_ARM_GCC_V5)||(PV_ARM_V5))
-    Int32 z;
-#endif
-
-    Int16 *pFreqInfo;
-    Int32 temp;
-    Int32 test;
-
-    Int16 *pFreq_2_Time_data_1;
-    Int16 *pFreq_2_Time_data_2;
-
-    const Int16 *pLong_Window_1;
-    const Int16 *pLong_Window_2;
-    const Int16 *pShort_Window_1;
-    const Int16 *pShort_Window_2;
-
-    Int32 *pOverlap_and_Add_Buffer_1;
-    Int32 *pOverlap_and_Add_Buffer_2;
-
-    Int16  *pOutput_buffer;
-    Int16  *pOutput_buffer_2;
-
-    const Int16 * Long_Window_fxp[NUM_WINDOW_SHAPES];
-    const Int16 * Short_Window_fxp[NUM_WINDOW_SHAPES];
-
-    Long_Window_fxp[0] = Long_Window_sine_fxp;
-    Long_Window_fxp[1] = Long_Window_KBD_fxp;
-    Short_Window_fxp[0] = Short_Window_sine_fxp;
-    Short_Window_fxp[1] = Short_Window_KBD_fxp;
-
-
-    if (wnd_seq != EIGHT_SHORT_SEQUENCE)
-    {
-
-        pFreqInfo = (Int16 *)Frequency_data;
-
-
-        exp = imdct_fxp(
-                  (Int32 *)pFreqInfo,
-                  freq_2_time_buffer,
-                  LONG_BLOCK1,
-                  Q_format,
-                  abs_max_per_window[0]);
-
-
-
-        /*
-         *  The C Programming Language, Second Edition, Kernighan & Ritchie,
-         *  page 206.
-         *  "The result [of a shift] is undefined if the right operand is
-         *  negative, or greater than or equal to the number of bits in the
-         *  left expression's type"
-         *   => avoid shift by 32 or 16
-         */
-
-        if (exp < 16)
-        {
-
-            pFreq_2_Time_data_1 = pFreqInfo;
-
-            switch (wnd_seq)
-            {
-
-                case ONLY_LONG_SEQUENCE:
-                default:
-
-                    pOutput_buffer = Output_buffer;
-
-                    pOverlap_and_Add_Buffer_1 = Time_data;
-
-                    {
-                        const Int16 *pLong_Window_2 = &Long_Window_fxp[wnd_shape_this_bk][LONG_WINDOW_m_1];
-
-                        Int32 * pFreq2T = (Int32 *)pFreqInfo;
-                        Int32 * win = (Int32 *) & Long_Window_fxp[wnd_shape_prev_bk][0];
-                        Int shift = exp + 15 - SCALING;
-
-
-                        Int32 * pFreq2T_2 = &pFreq2T[HALF_LONG_WINDOW];
-
-
-                        for (i = HALF_LONG_WINDOW; i != 0; i--)
-                        {
-                            Int16 win1, win2;
-                            Int32  temp2, test2;
-
-                            Int32  winx;
-
-                            temp2 = *(pFreq2T++);
-                            winx = *(win++);
-
-                            test  = *(pOverlap_and_Add_Buffer_1++);
-                            test2 = *(pOverlap_and_Add_Buffer_1--);
-                            temp  =   fxp_mul_16_by_16bb(temp2, winx) >> shift;
-                            temp2 =   fxp_mul_16_by_16tt(temp2, winx) >> shift;
-                            limiter(*(pOutput_buffer++), (temp + test));
-                            limiter(*(pOutput_buffer++), (temp2 + test2));
-
-                            temp2 = *(pFreq2T_2++);
-
-                            win1  = *(pLong_Window_2--);
-                            win2  = *(pLong_Window_2--);
-                            temp  = fxp_mul_16_by_16bb(temp2, win1) >> shift;
-                            test2 = fxp_mul_16_by_16tb(temp2, win2) >> shift;
-                            *(pOverlap_and_Add_Buffer_1++) = temp;
-                            *(pOverlap_and_Add_Buffer_1++) = test2;
-
-                        }
-                    }
-
-                    break;
-
-                case LONG_START_SEQUENCE:
-
-
-                    pFreq_2_Time_data_2 =
-                        &pFreq_2_Time_data_1[ HALF_LONG_WINDOW];
-
-                    pLong_Window_1 = &Long_Window_fxp[wnd_shape_prev_bk][0];
-                    pLong_Window_2 = &pLong_Window_1[ HALF_LONG_WINDOW];
-
-                    pOverlap_and_Add_Buffer_1 = &Time_data[0];
-                    pOverlap_and_Add_Buffer_2 = &Time_data[HALF_LONG_WINDOW];
-
-                    pOutput_buffer   = Output_buffer;
-                    pOutput_buffer_2 = pOutput_buffer + HALF_LONG_WINDOW;
-
-
-                    shift = exp + 15 - SCALING;
-
-                    for (i = HALF_LONG_WINDOW; i != 0; i--)
-                    {
-
-                        Int16 win1, win2;
-                        Int16  dat1, dat2;
-                        Int32  test1, test2;
-
-                        dat1   = *(pFreq_2_Time_data_1++);
-                        win1   = *(pLong_Window_1++);
-                        test1  = *(pOverlap_and_Add_Buffer_1++);
-
-                        dat2  =  *(pFreq_2_Time_data_2++);
-                        win2  = *(pLong_Window_2++);
-                        test2 = *(pOverlap_and_Add_Buffer_2++);
-
-                        limiter(*(pOutput_buffer++), (test1 + (fxp_mul_16_by_16(dat1, win1) >> shift)));
-
-                        limiter(*(pOutput_buffer_2++), (test2 + (fxp_mul_16_by_16(dat2, win2) >> shift)));
-
-                    }
-
-                    /*
-                     *  data unchanged from  LONG_WINDOW to W_L_START_1
-                     *  only scaled accordingly
-                     */
-
-                    pOverlap_and_Add_Buffer_1 = &Time_data[0];
-                    pFreq_2_Time_data_1       = &pFreqInfo[LONG_WINDOW];
-
-                    exp -= SCALING;
-
-                    if (exp >= 0)
-                    {
-
-                        for (i = (W_L_START_1 - LONG_WINDOW) >> 1; i != 0; i--)
-                        {
-                            *(pOverlap_and_Add_Buffer_1++) =
-                                *(pFreq_2_Time_data_1++) >> exp;
-                            *(pOverlap_and_Add_Buffer_1++) =
-                                *(pFreq_2_Time_data_1++) >> exp;
-
-                        }
-
-                    }
-                    else if (exp < 0)
-                    {
-
-                        Int shift = -exp;
-                        for (i = (W_L_START_1 - LONG_WINDOW) >> 1; i != 0 ; i--)
-                        {
-                            Int32 temp2 = ((Int32) * (pFreq_2_Time_data_1++)) << shift;
-                            *(pOverlap_and_Add_Buffer_1++) = temp2;
-                            temp2 = ((Int32) * (pFreq_2_Time_data_1++)) << shift;
-                            *(pOverlap_and_Add_Buffer_1++) = temp2;
-                        }
-
-                    }
-                    else
-                    {
-
-                        for (i = (W_L_START_1 - LONG_WINDOW) >> 1; i != 0; i--)
-                        {
-                            *(pOverlap_and_Add_Buffer_1++) =
-                                *(pFreq_2_Time_data_1++);
-                            *(pOverlap_and_Add_Buffer_1++) =
-                                *(pFreq_2_Time_data_1++);
-
-                        }
-
-                    }
-
-
-                    pFreq_2_Time_data_1  = &pFreqInfo[W_L_START_1];
-                    pFreq_2_Time_data_2  =
-                        &pFreq_2_Time_data_1[HALF_SHORT_WINDOW];
-
-                    pShort_Window_1   =
-                        &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-                    pShort_Window_2   = pShort_Window_1 - HALF_SHORT_WINDOW;
-
-                    pOverlap_and_Add_Buffer_2 = pOverlap_and_Add_Buffer_1 +
-                                                HALF_SHORT_WINDOW;
-
-
-                    for (i = HALF_SHORT_WINDOW; i != 0; i--)
-                    {
-                        Int16 win1, win2;
-                        Int16  dat1, dat2;
-                        Int32  temp2;
-                        dat1  = (*pFreq_2_Time_data_1++);
-                        dat2  = (*pFreq_2_Time_data_2++);
-                        win1  = *(pShort_Window_1--);
-                        win2  = *(pShort_Window_2--);
-
-                        temp   =   fxp_mul_16_by_16(dat1, win1) >> shift;
-                        *(pOverlap_and_Add_Buffer_1++) = temp;
-
-                        temp2 =   fxp_mul_16_by_16(dat2, win2) >> shift;
-                        *(pOverlap_and_Add_Buffer_2++) = temp2;
-
-
-                    }
-
-
-                    pOverlap_and_Add_Buffer_1 += HALF_SHORT_WINDOW;
-
-                    pv_memset(
-                        pOverlap_and_Add_Buffer_1,
-                        0,
-                        (LONG_BLOCK1 - W_L_START_2)
-                        *sizeof(*pOverlap_and_Add_Buffer_1));
-
-
-                    break;
-
-
-                case LONG_STOP_SEQUENCE:
-
-                    pOverlap_and_Add_Buffer_1 = &Time_data[ W_L_STOP_2];
-
-                    pOutput_buffer         = &Output_buffer[W_L_STOP_2];
-
-                    pFreq_2_Time_data_1      = &pFreqInfo[W_L_STOP_2];
-
-                    exp -= SCALING; /*  !!!! */
-
-                    if (exp > 0)
-                    {
-                        Int16 tmp1 = (*(pFreq_2_Time_data_1++) >> exp);
-                        temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        for (i = (LONG_WINDOW - W_L_STOP_2); i != 0; i--)
-                        {
-                            limiter(*(pOutput_buffer++), (temp + tmp1));
-
-                            tmp1 = *(pFreq_2_Time_data_1++) >> exp;
-                            temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        }
-                    }
-                    else if (exp < 0)
-                    {
-                        shift = -exp;
-                        Int32 temp1 = ((Int32) * (pFreq_2_Time_data_1++)) << shift;
-                        temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        for (i = (LONG_WINDOW - W_L_STOP_2); i != 0; i--)
-                        {
-                            limiter(*(pOutput_buffer++), (temp + temp1));
-
-                            temp1 = ((Int32) * (pFreq_2_Time_data_1++)) << shift;
-                            temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        }
-                    }
-                    else
-                    {
-                        Int16 tmp1 = *(pFreq_2_Time_data_1++);
-                        temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        for (i = (LONG_WINDOW - W_L_STOP_2); i != 0; i--)
-                        {
-                            limiter(*(pOutput_buffer++), (temp + tmp1));
-
-                            tmp1 = *(pFreq_2_Time_data_1++);
-                            temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        }
-                    }
-
-
-                    pShort_Window_1 = &Short_Window_fxp[wnd_shape_prev_bk][0];
-                    pShort_Window_2 = &pShort_Window_1[HALF_SHORT_WINDOW];
-
-                    pFreq_2_Time_data_1 = &pFreqInfo[W_L_STOP_1];
-                    pFreq_2_Time_data_2 =
-                        &pFreq_2_Time_data_1[HALF_SHORT_WINDOW];
-
-                    pOverlap_and_Add_Buffer_1 = &Time_data[ W_L_STOP_1];
-                    pOverlap_and_Add_Buffer_2 = pOverlap_and_Add_Buffer_1
-                                                + HALF_SHORT_WINDOW;
-
-                    pOutput_buffer   = &Output_buffer[W_L_STOP_1];
-                    pOutput_buffer_2 = pOutput_buffer + HALF_SHORT_WINDOW;
-
-                    exp += SCALING;  /* +8 back to what it was */
-
-                    shift = exp + 15 - SCALING;
-
-
-                    for (i = HALF_SHORT_WINDOW; i != 0; i--)
-                    {
-                        Int16 win1;
-                        Int16  dat1;
-
-                        dat1 = *(pFreq_2_Time_data_1++);
-                        win1 = *(pShort_Window_1++);
-                        temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        test  = fxp_mul_16_by_16(dat1, win1);
-
-                        limiter(*(pOutput_buffer++), (temp + (test >> shift)));
-
-                        dat1 = *(pFreq_2_Time_data_2++);
-                        win1 = *(pShort_Window_2++);
-                        temp = *(pOverlap_and_Add_Buffer_2++);
-                        test =  fxp_mul_16_by_16(dat1, win1);
-                        limiter(*(pOutput_buffer_2++), (temp + (test >> shift)));
-
-                    }
-
-
-                    pFreq_2_Time_data_2 = &pFreqInfo[LONG_WINDOW];
-
-                    pOverlap_and_Add_Buffer_1 = Time_data;
-
-                    pOutput_buffer = Output_buffer;
-
-                    pLong_Window_2   =
-                        &Long_Window_fxp[wnd_shape_this_bk][LONG_WINDOW_m_1];
-
-
-                    /*
-                     *  Copy previous time in current buffer, also copy overlap
-                     *  and add buffer
-                     */
-
-                    for (i = W_L_STOP_1; i != 0; i--)
-                    {
-                        Int16 win1;
-                        Int16 dat1;
-
-                        win1 = *(pLong_Window_2--);
-                        dat1 = *pFreq_2_Time_data_2++;
-
-                        limiter(*(pOutput_buffer++), *(pOverlap_and_Add_Buffer_1));
-
-
-                        temp = fxp_mul_16_by_16(dat1, win1) >> shift;
-                        *(pOverlap_and_Add_Buffer_1++) = temp ;
-
-                    }
-
-                    for (i = (LONG_WINDOW - W_L_STOP_1); i != 0; i--)
-                    {
-                        temp = fxp_mul_16_by_16(*pFreq_2_Time_data_2++, *(pLong_Window_2--)) >> shift;
-                        *(pOverlap_and_Add_Buffer_1++) = temp ;
-                    }
-
-
-                    break;
-
-
-
-            } /* switch (wnd_seq) */
-
-        }   /*  if (exp < 16)  */
-
-        else
-        {
-            /* all zeros buffer or excessive down shift */
-
-            /* Overlap and add, setup buffer for next iteration */
-            pOverlap_and_Add_Buffer_1 = &Time_data[0];
-
-            pOutput_buffer = Output_buffer;
-
-            temp  = (*pOverlap_and_Add_Buffer_1++);
-
-            for (i = LONG_WINDOW; i != 0; i--)
-            {
-
-                limiter(*(pOutput_buffer++), temp);
-
-                temp = (*pOverlap_and_Add_Buffer_1++);
-
-            }
-
-            pv_memset(Time_data, 0, LONG_WINDOW*sizeof(Time_data[0]));
-
-
-        }
-
-    }
-    else
-    {
-
-        Int32 *pScrath_mem;
-        Int32 *pScrath_mem_entry;
-        Int32  *pFrequency_data = Frequency_data;
-
-        Int32 * pOverlap_and_Add_Buffer_1;
-        Int32 * pOverlap_and_Add_Buffer_2;
-        Int32 * pOverlap_and_Add_Buffer_1x;
-        Int32 * pOverlap_and_Add_Buffer_2x;
-
-        /*
-         *  Frequency_data is 2*LONG_WINDOW length but only
-         *  the first LONG_WINDOW elements are filled in,
-         *  then the second part can be used as scratch mem,
-         *  then grab data from one window at a time in
-         *  reverse order.
-         *  The upper LONG_WINDOW Int32 are used to hold the
-         *  computed overlap and add, used in the next call to
-         *  this function, and also as sctrach memory
-         */
-
-        /*
-         *  Frequency_data usage for the case EIGHT_SHORT_SEQUENCE
-
-          |<----- Input Freq. data ----->|< Overlap & Add ->| Unused |-Scratch-|
-          |                              |  Store for next  |        |  memory |
-          |                              |  call            |        |         |
-          |                              |                  |        |         |
-          |//////////////////////////////|\\\\\\\\\\\\\\\\\\|--------|+++++++++|
-          |                              |                  |        |         |
-          0                         LONG_WINDOW        LONG_WINDOW   |   2*LONG_WINDOW
-                                                            +        |         |
-                                                       W_L_STOP_2    |         |
-                                                                     |<--   -->|
-                                                                      SHORT_WINDOW +
-                                                                    HALF_SHORT_WINDOW
-          *
-          */
-
-        pOverlap_and_Add_Buffer_1  = &pFrequency_data[
-                                         LONG_WINDOW + 3*SHORT_WINDOW + HALF_SHORT_WINDOW];
-
-        /*
-         *  Initialize to zero, only the firt short window used in overlap
-         *  and add
-         */
-        pv_memset(
-            pOverlap_and_Add_Buffer_1,
-            0,
-            SHORT_WINDOW*sizeof(*pOverlap_and_Add_Buffer_1));
-
-        /*
-         *  Showt windows are evaluated in decresing order. Windows from 7
-         *  to 0 are break down in four cases: window numbers 7 to 5, 4, 3,
-         *  and 2 to 0.
-         *  The data from short windows 3 and 4 is situated at the boundary
-         *  between the 'overlap and add' buffer and the output buffer.
-         */
-        for (wnd = NUM_SHORT_WINDOWS - 1; wnd >= NUM_SHORT_WINDOWS / 2 + 1; wnd--)
-        {
-
-            pFreqInfo = (Int16 *) & pFrequency_data[ wnd*SHORT_WINDOW];
-
-            exp = imdct_fxp(
-                      (Int32 *)pFreqInfo,
-                      freq_2_time_buffer,
-                      SHORT_BLOCK1,
-                      Q_format,
-                      abs_max_per_window[wnd]);
-
-            pOverlap_and_Add_Buffer_1 =
-                &pFrequency_data[ W_L_STOP_1 + SHORT_WINDOW*wnd];
-
-
-            pOverlap_and_Add_Buffer_2 =
-                pOverlap_and_Add_Buffer_1 + SHORT_WINDOW;
-
-            /*
-             *  If all element are zero or if the exponent is bigger than
-             *  16 ( it becomes an undefined shift) ->  skip
-             */
-
-            if (exp < 16)
-            {
-
-
-                pFreq_2_Time_data_1 = &pFreqInfo[0];
-                pFreq_2_Time_data_2 = &pFreqInfo[SHORT_WINDOW];
-
-
-                /*
-                 *  Each of the eight short blocks is windowed separately.
-                 *  Window shape decisions are made on a frame-by-frame
-                 *  basis.
-                 */
-
-                pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-
-                pShort_Window_2   =
-                    &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-
-
-
-                /*
-                 * For short windows from 7 to 5
-                 *                                      |   =========================
-                 *                                      |   |     5     6     7
-                 *               _--_  _--_  _--_  _--_ | _-|-_  _--_  _--_  _--_
-                 *              /    \/    \/    \/    \|/  |  \/    \/    \/    \
-                 *             /     /\    /\    /\    /|\  |  /\    /\    /\     \
-                 *            /     /  \  /  \  /  \  / | \ | /  \  /  \  /  \     \
-                 *           /     /    \/    \/    \/  |  \|/    \/    \     \     \
-                 *      --------------------------------|---[///////////////////////]--------
-                 *
-                 */
-
-
-                shift = exp + 15 - SCALING;
-
-
-                for (i = SHORT_WINDOW; i != 0; i--)
-                {
-                    Int16 win1, win2;
-                    Int16  dat1, dat2;
-
-                    dat2 = *(pFreq_2_Time_data_2++);
-                    win2 = *(pShort_Window_2--);
-                    temp = *pOverlap_and_Add_Buffer_2;
-                    dat1 = *(pFreq_2_Time_data_1++);
-                    win1 = *(pShort_Window_1++);
-
-                    *(pOverlap_and_Add_Buffer_2++) =  temp + (fxp_mul_16_by_16(dat2, win2) >> shift);
-
-                    *(pOverlap_and_Add_Buffer_1++)  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                }
-
-            }   /* if (exp < 16) */
-            else
-            {
-                pv_memset(
-                    pOverlap_and_Add_Buffer_1,
-                    0,
-                    SHORT_WINDOW*sizeof(*pOverlap_and_Add_Buffer_1));
-            }
-
-
-        }/* for ( wnd=NUM_SHORT_WINDOWS-1; wnd>=NUM_SHORT_WINDOWS/2; wnd--) */
-
-
-        wnd = NUM_SHORT_WINDOWS / 2;
-
-        pFreqInfo = (Int16 *) & pFrequency_data[ wnd*SHORT_WINDOW];
-
-        /*
-         *  scratch memory is allocated in an unused part of memory
-         */
-
-
-        pScrath_mem = &pFrequency_data[ 2*LONG_WINDOW - HALF_SHORT_WINDOW];
-
-        pOverlap_and_Add_Buffer_1 = &pFrequency_data[ LONG_WINDOW];
-
-        pOverlap_and_Add_Buffer_2 = pOverlap_and_Add_Buffer_1
-                                    + HALF_SHORT_WINDOW;
-
-
-        exp = imdct_fxp(
-                  (Int32 *)pFreqInfo,
-                  freq_2_time_buffer,
-                  SHORT_BLOCK1,
-                  Q_format,
-                  abs_max_per_window[wnd]);
-
-        /*
-         *  If all element are zero or if the exponent is bigger than
-         *  16 ( it becomes an undefined shift) ->  skip
-         */
-
-
-        if (exp < 16)
-        {
-
-            pFreq_2_Time_data_1 = &pFreqInfo[0];
-            pFreq_2_Time_data_2 = &pFreqInfo[SHORT_WINDOW];
-
-            pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-
-            pShort_Window_2 =
-                &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-
-            /*
-             * For short window 4
-             *                                    ====|===========
-             *                                        |   4
-             *                                    |   |   |      |
-             *                _--_  _--_  _--_  _-|-_ | _-|-_  _-|-_  _--_  _--_
-             *               /    \/    \/    \/  |  \|/  |  \/  |  \/    \/    \
-             *              /     /\    /\    /\  |  /|\  |  /\  |  /\    /\     \
-             *             /     /  \  /  \  /  \ | / | \ | /  \ | /  \  /  \     \
-             *            /     /    \/    \/    \|/  |  \|/    \|/    \/    \     \
-             *      ------------------------------[\\\|\\\|//////]-------------------
-             *           |                        | A | B |   C  |
-             *           |
-             *        W_L_STOP_1
-             */
-
-            shift = exp + 15 - SCALING;
-            {
-                Int16 win1;
-                Int16  dat1;
-                /* -------- segment A ---------------*/
-                dat1 = *(pFreq_2_Time_data_1++);
-                win1 = *(pShort_Window_1++);
-                for (i = HALF_SHORT_WINDOW; i != 0; i--)
-                {
-                    *(pScrath_mem++)  =  fxp_mul_16_by_16(dat1, win1) >> (shift);
-                    dat1 = *(pFreq_2_Time_data_1++);
-                    win1 = *(pShort_Window_1++);
-                }
-
-                /* -------- segment B ---------------*/
-                for (i = HALF_SHORT_WINDOW; i != 0; i--)
-                {
-                    *(pOverlap_and_Add_Buffer_1++)  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                    dat1 = *(pFreq_2_Time_data_1++);
-                    win1 = *(pShort_Window_1++);
-                }
-
-                /* -------- segment C ---------------*/
-                temp = *pOverlap_and_Add_Buffer_2;
-                dat1 = *(pFreq_2_Time_data_2++);
-                win1 = *(pShort_Window_2--);
-
-                for (i = SHORT_WINDOW; i != 0; i--)
-                {
-                    *(pOverlap_and_Add_Buffer_2++)  =  temp + (fxp_mul_16_by_16(dat1, win1) >> shift);
-
-                    temp = *pOverlap_and_Add_Buffer_2;
-                    dat1 = *(pFreq_2_Time_data_2++);
-                    win1 = *(pShort_Window_2--);
-                }
-            }
-
-        }   /* if (exp < 16) */
-        else
-        {
-            pv_memset(
-                pScrath_mem,
-                0,
-                HALF_SHORT_WINDOW*sizeof(*pScrath_mem));
-
-            pv_memset(
-                pOverlap_and_Add_Buffer_1,
-                0,
-                HALF_SHORT_WINDOW*sizeof(*pOverlap_and_Add_Buffer_1));
-        }
-
-
-        wnd = NUM_SHORT_WINDOWS / 2 - 1;
-
-        pFreqInfo = (Int16 *) & pFrequency_data[ wnd*SHORT_WINDOW];
-
-        pScrath_mem_entry =
-            &pFrequency_data[2*LONG_WINDOW - HALF_SHORT_WINDOW - SHORT_WINDOW];
-        pScrath_mem = pScrath_mem_entry;
-
-        pOverlap_and_Add_Buffer_1 = &pFrequency_data[ LONG_WINDOW];
-
-        /* point to end of buffer less HALF_SHORT_WINDOW */
-
-        pOutput_buffer_2 = &Output_buffer[LONG_WINDOW - HALF_SHORT_WINDOW];
-        pOutput_buffer   = pOutput_buffer_2;
-
-        pOverlap_and_Add_Buffer_1x = &Time_data[W_L_STOP_1 + SHORT_WINDOW*(wnd+1)];  /* !!!! */
-
-        exp = imdct_fxp(
-                  (Int32 *)pFreqInfo,
-                  freq_2_time_buffer,
-                  SHORT_BLOCK1,
-                  Q_format,
-                  abs_max_per_window[wnd]);
-
-        /*
-         *  If all element are zero or if the exponent is bigger than
-         *  16 ( it becomes an undefined shift) ->  skip
-         */
-
-        if (exp < 16)
-        {
-
-            pFreq_2_Time_data_1 = &pFreqInfo[0];
-            pFreq_2_Time_data_2 = &pFreqInfo[SHORT_WINDOW];
-
-
-            /*
-             * For short window 3
-             *                             ===========|====
-             *                                    3   |
-             *                             |      |   |   |
-             *               _--_  _--_  _-|-_  _-|-_ | _-|-_  _--_  _--_  _--_
-             *              /    \/    \/  |  \/  |  \|/  |  \/    \/    \/    \
-             *             /     /\    /\  |  /\  |  /|\  |  /\    /\    /\     \
-             *            /     /  \  /  \ | /  \ | / | \ | /  \  /  \  /  \     \
-             *           /     /    \/    \|/    \|/  |  \|/    \/    \     \     \
-             *     -----|------------------[\\\\\\|///|///]--------------------------
-             *          |                  |   A  | B | C |
-             *
-             *      W_L_STOP_1
-             */
-
-
-            pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-
-            pShort_Window_2 =
-                &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-            shift = exp + 15 - SCALING;
-
-
-            Int16 win1;
-            Int16  dat1;
-            /* -------- segment A ---------------*/
-            dat1 = *(pFreq_2_Time_data_1++);
-            win1 = *(pShort_Window_1++);
-            for (i = SHORT_WINDOW; i != 0; i--)
-            {
-                *(pScrath_mem++)  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-                dat1 = *(pFreq_2_Time_data_1++);
-                win1 = *(pShort_Window_1++);
-            }
-
-            dat1 = *(pFreq_2_Time_data_2++);
-            win1 = *(pShort_Window_2--);
-
-            /* -------- segment B ---------------*/
-            for (i = HALF_SHORT_WINDOW; i != 0; i--)
-            {
-                test = fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                temp =  *(pScrath_mem++) + test;
-
-
-                test = *(pOverlap_and_Add_Buffer_1x++);  /* !!!! */
-
-                limiter(*(pOutput_buffer++), (temp + test));
-
-                dat1 = *(pFreq_2_Time_data_2++);
-                win1 = *(pShort_Window_2--);
-
-            }
-
-            /* -------- segment C ---------------*/
-            for (i = HALF_SHORT_WINDOW; i != 0; i--)
-            {
-                temp = fxp_mul_16_by_16(dat1, win1) >> (shift);
-
-                *(pOverlap_and_Add_Buffer_1++) += temp;
-
-                dat1 = *(pFreq_2_Time_data_2++);
-                win1 = *(pShort_Window_2--);
-            }
-
-        }   /* if (exp < 16) */
-        else
-        {
-
-            pv_memset(
-                pScrath_mem,
-                0,
-                SHORT_WINDOW*sizeof(*pScrath_mem));
-
-            pScrath_mem += SHORT_WINDOW;
-
-            temp = *(pScrath_mem++);
-            for (i = HALF_SHORT_WINDOW; i != 0; i--)
-            {
-                limiter(*(pOutput_buffer++), temp);
-                temp = *(pScrath_mem++);
-
-
-            }
-        }
-
-
-        for (wnd = NUM_SHORT_WINDOWS / 2 - 2; wnd >= 0; wnd--)
-        {
-
-
-            pOutput_buffer_2 -= SHORT_WINDOW;
-            pOutput_buffer = pOutput_buffer_2;
-
-            /*
-             * The same memory is used as scratch in every iteration
-             */
-            pScrath_mem = pScrath_mem_entry;
-
-            pOverlap_and_Add_Buffer_2x =
-                &Time_data[W_L_STOP_1 + SHORT_WINDOW*(wnd+1)];
-
-            pFreqInfo = (Int16 *) & pFrequency_data[ wnd*SHORT_WINDOW];
-
-
-
-            exp = imdct_fxp(
-                      (Int32 *)pFreqInfo,
-                      freq_2_time_buffer,
-                      SHORT_BLOCK1,
-                      Q_format,
-                      abs_max_per_window[wnd]);
-
-            /*
-             *  If all element are zero or if the exponent is bigger than
-             *  16 ( it becomes an undefined shift) ->  skip
-             */
-
-            if (exp < 16)
-            {
-
-                pFreq_2_Time_data_1 = &pFreqInfo[0];
-                pFreq_2_Time_data_2 = &pFreqInfo[SHORT_WINDOW];
-
-
-                /*
-                 *  Each of the eight short blocks is windowed separately.
-                 *  Window shape decisions are made on a frame-by-frame
-                 *  basis.
-                 */
-
-                pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-
-                if (wnd == 0)
-                {
-                    pShort_Window_1 =
-                        &Short_Window_fxp[wnd_shape_prev_bk][0];
-                }
-
-                pShort_Window_2   =
-                    &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-
-                /*
-                 * For short windows from 2 to 0
-                 *
-                 *          =========================
-                 *                                       |
-                 *                0     1     2      |   |
-                 *               _--_  _--_  _--_  _-|-_ | _--_  _--_  _--_  _--_
-                 *              /    \/    \/    \/  |  \|/    \/    \/    \/    \
-                 *             /     /\    /\    /\  |  /|\    /\    /\    /\     \
-                 *            /     /  \  /  \  /  \ | / | \  /  \  /  \  /  \     \
-                 *           /     /    \/    \/    \|/  |  \/    \/    \     \     \
-                 *      ----[\\\\\\\\\\\\\\\\\\\\\\\\]---|-----------------------------
-                 *          |
-                 *
-                 *      W_L_STOP_1
-                 */
-
-                shift = exp + 15 - SCALING;
-
-                Int16 dat1 = *(pFreq_2_Time_data_2++);
-                Int16 win1 = *(pShort_Window_2--);
-
-                temp  =  *(pScrath_mem);
-                for (i = SHORT_WINDOW; i != 0; i--)
-                {
-                    test  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                    temp += test;
-
-                    dat1 = *(pFreq_2_Time_data_1++);
-                    win1 = *(pShort_Window_1++);
-
-                    limiter(*(pOutput_buffer++), (temp + *(pOverlap_and_Add_Buffer_2x++)));
-
-
-                    *(pScrath_mem++) = fxp_mul_16_by_16(dat1, win1) >> shift;
-                    dat1 = *(pFreq_2_Time_data_2++);
-                    win1 = *(pShort_Window_2--);
-                    temp  =  *(pScrath_mem);
-
-                }
-
-            }   /* if (exp < 16) */
-            else
-            {
-                test  = *(pScrath_mem);
-                temp  = *(pOverlap_and_Add_Buffer_2x++);
-
-                for (i = SHORT_WINDOW; i != 0; i--)
-                {
-                    limiter(*(pOutput_buffer++), (temp + test));
-
-                    *(pScrath_mem++) = 0;
-                    test  =  *(pScrath_mem);
-                    temp  = *(pOverlap_and_Add_Buffer_2x++);
-
-                }
-            }
-
-        }   /* for ( wnd=NUM_SHORT_WINDOWS/2-1; wnd>=0; wnd--) */
-
-        pOverlap_and_Add_Buffer_2x =  &Time_data[W_L_STOP_1];
-
-        pScrath_mem = pScrath_mem_entry;
-
-        pOutput_buffer_2 -= SHORT_WINDOW;
-        pOutput_buffer = pOutput_buffer_2;
-
-        test  = *(pScrath_mem++);
-        temp  = *(pOverlap_and_Add_Buffer_2x++);
-
-        for (i = SHORT_WINDOW; i != 0; i--)
-        {
-            limiter(*(pOutput_buffer++), (temp + test));
-
-            test  = *(pScrath_mem++);
-            temp  = *(pOverlap_and_Add_Buffer_2x++);
-
-        }
-
-        pOverlap_and_Add_Buffer_1x = Time_data;
-
-        pOutput_buffer = Output_buffer;
-
-
-        temp = *(pOverlap_and_Add_Buffer_1x++);
-
-        for (i = W_L_STOP_1; i != 0; i--)
-        {
-            limiter(*(pOutput_buffer++), temp);
-
-            temp = *(pOverlap_and_Add_Buffer_1x++);
-        }
-
-        pOverlap_and_Add_Buffer_1x = &Time_data[0];
-
-        pOverlap_and_Add_Buffer_2 = &pFrequency_data[LONG_WINDOW];
-
-        /*
-         *  update overlap and add buffer,
-         *  so is ready for next iteration
-         */
-
-        for (int i = 0; i < W_L_STOP_2; i++)
-        {
-            temp = *(pOverlap_and_Add_Buffer_2++);
-            *(pOverlap_and_Add_Buffer_1x++) = temp;
-        }
-
-        pv_memset(
-            pOverlap_and_Add_Buffer_1x,
-            0,
-            W_L_STOP_1*sizeof(*pOverlap_and_Add_Buffer_1x));
-
-    } /* if ( wnd_seq != EIGHT_SHORT_SEQUENCE) */
-
-}
-
-#endif
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-
-
-
-void trans4m_freq_2_time_fxp_2(
-    Int32               Frequency_data[],
-    Int32               Time_data[],
-    WINDOW_SEQUENCE     wnd_seq,
-    Int                 wnd_shape_prev_bk,
-    Int                 wnd_shape_this_bk,
-    Int                 Q_format,
-    Int32               abs_max_per_window[],
-    Int32               freq_2_time_buffer[],
-    Int16               *Interleaved_output)
-
-{
-
-    Int exp;
-    Int shift;
-
-    Int  i;
-    Int  wnd;
-#if !(defined( PV_ARM_GCC_V5)||(PV_ARM_V5))
-    Int32 z;
-#endif
-    Int16 *pFreqInfo;
-    Int32 temp;
-    Int32 test;
-
-    Int16 *pFreq_2_Time_data_1;
-    Int16 *pFreq_2_Time_data_2;
-
-    const Int16 *pLong_Window_1;
-    const Int16 *pLong_Window_2;
-    const Int16 *pShort_Window_1;
-    const Int16 *pShort_Window_2;
-
-    Int32 *pOverlap_and_Add_Buffer_1;
-    Int32 *pOverlap_and_Add_Buffer_2;
-
-    Int16  *pInterleaved_output;
-    Int16  *pInterleaved_output_2;
-
-
-    const Int16 * Long_Window_fxp[NUM_WINDOW_SHAPES];
-    const Int16 * Short_Window_fxp[NUM_WINDOW_SHAPES];
-
-    Long_Window_fxp[0] = Long_Window_sine_fxp;
-    Long_Window_fxp[1] = Long_Window_KBD_fxp;
-    Short_Window_fxp[0] = Short_Window_sine_fxp;
-    Short_Window_fxp[1] = Short_Window_KBD_fxp;
-
-    if (wnd_seq != EIGHT_SHORT_SEQUENCE)
-    {
-
-        pFreqInfo = (Int16 *)Frequency_data;
-
-
-        exp = imdct_fxp(
-                  (Int32 *)pFreqInfo,
-                  freq_2_time_buffer,
-                  LONG_BLOCK1,
-                  Q_format,
-                  abs_max_per_window[0]);
-
-
-        /*
-         *  The C Programming Language, Second Edition, Kernighan & Ritchie,
-         *  page 206.
-         *  "The result [of a shift] is undefined if the right operand is
-         *  negative, or greater than or equal to the number of bits in the
-         *  left expression's type"
-         *   => avoid shift by 32 or 16
-         */
-
-        if (exp < 16)
-        {
-
-            pFreq_2_Time_data_1 = pFreqInfo;
-
-
-            switch (wnd_seq)
-            {
-
-                case ONLY_LONG_SEQUENCE:
-                default:
-
-                {
-                    pOverlap_and_Add_Buffer_1 = Time_data;
-
-                    pInterleaved_output = Interleaved_output;
-
-                    {
-
-                        const Int16 *pLong_Window_2 = &Long_Window_fxp[wnd_shape_this_bk][LONG_WINDOW_m_1];
-
-                        Int32 * pFreq2T   = (Int32 *)pFreqInfo;
-                        Int32 * pFreq2T_2 = &pFreq2T[HALF_LONG_WINDOW];
-                        Int32 * win = (Int32 *) & Long_Window_fxp[wnd_shape_prev_bk][0];
-
-                        Int shift = exp + 15 - SCALING;
-
-                        for (i = HALF_LONG_WINDOW; i != 0; i--)
-                        {
-                            Int16 win1, win2;
-                            Int32  temp2, test2;
-
-                            Int32  winx;
-
-                            temp2 = *(pFreq2T++);
-                            winx = *(win++);
-
-                            test  = *(pOverlap_and_Add_Buffer_1++);
-                            test2 = *(pOverlap_and_Add_Buffer_1--);
-                            temp  =   fxp_mul_16_by_16bb(temp2, winx) >> shift;
-                            temp2 =   fxp_mul_16_by_16tt(temp2, winx) >> shift;
-
-                            limiter(*(pInterleaved_output), (temp + test));
-
-                            limiter(*(pInterleaved_output + 2), (temp2 + test2));
-                            pInterleaved_output += 4;
-
-                            temp2 = *(pFreq2T_2++);
-
-                            win1  = *(pLong_Window_2--);
-                            win2  = *(pLong_Window_2--);
-                            temp  = fxp_mul_16_by_16bb(temp2, win1) >> shift;
-                            test2 = fxp_mul_16_by_16tb(temp2, win2) >> shift;
-
-                            *(pOverlap_and_Add_Buffer_1++) = temp;
-                            *(pOverlap_and_Add_Buffer_1++) = test2;
-                        }
-
-                    }
-
-                }
-
-                break;
-
-                case LONG_START_SEQUENCE:
-
-                    pFreq_2_Time_data_2 =
-                        &pFreq_2_Time_data_1[ HALF_LONG_WINDOW];
-
-                    pLong_Window_1 = &Long_Window_fxp[wnd_shape_prev_bk][0];
-                    pLong_Window_2 = &pLong_Window_1[ HALF_LONG_WINDOW];
-
-                    pOverlap_and_Add_Buffer_1 = &Time_data[0];
-                    pOverlap_and_Add_Buffer_2 = &Time_data[HALF_LONG_WINDOW];
-
-
-                    pInterleaved_output   = Interleaved_output;
-                    pInterleaved_output_2 = pInterleaved_output + (2 * HALF_LONG_WINDOW);
-
-
-                    /*
-                     *  process first  LONG_WINDOW elements
-                     */
-
-                    shift = exp + 15 - SCALING;
-
-                    for (i = HALF_LONG_WINDOW; i != 0; i--)
-                    {
-                        Int16 win1, win2;
-                        Int16  dat1, dat2;
-                        Int32  test1, test2;
-
-                        dat1   = *(pFreq_2_Time_data_1++);
-                        win1   = *(pLong_Window_1++);
-                        test1  = *(pOverlap_and_Add_Buffer_1++);
-
-                        dat2  =  *(pFreq_2_Time_data_2++);
-                        win2  = *(pLong_Window_2++);
-                        test2 = *(pOverlap_and_Add_Buffer_2++);
-
-                        limiter(*(pInterleaved_output), (test1 + (fxp_mul_16_by_16(dat1, win1) >> shift)));
-
-                        pInterleaved_output   += 2;
-
-                        limiter(*(pInterleaved_output_2), (test2 + (fxp_mul_16_by_16(dat2, win2) >> shift)));
-
-                        pInterleaved_output_2    += 2;
-                    }
-
-
-                    /*
-                     *  data unchanged from  LONG_WINDOW to W_L_START_1
-                     *  only scaled accordingly
-                     */
-
-                    pOverlap_and_Add_Buffer_1 = &Time_data[0];
-                    pFreq_2_Time_data_1       = &pFreqInfo[LONG_WINDOW];
-
-                    exp -= SCALING;
-
-                    if (exp >= 0)
-                    {
-
-                        for (i = (W_L_START_1 - LONG_WINDOW) >> 1; i != 0; i--)
-                        {
-                            *(pOverlap_and_Add_Buffer_1++) =
-                                *(pFreq_2_Time_data_1++) >> exp;
-                            *(pOverlap_and_Add_Buffer_1++) =
-                                *(pFreq_2_Time_data_1++) >> exp;
-
-                        }
-
-                    }
-                    else if (exp < 0)
-                    {
-
-                        Int shift = -exp;
-                        for (i = (W_L_START_1 - LONG_WINDOW) >> 1; i != 0 ; i--)
-                        {
-                            Int32 temp2 = ((Int32) * (pFreq_2_Time_data_1++)) << shift;
-                            *(pOverlap_and_Add_Buffer_1++) = temp2;
-                            temp2 = ((Int32) * (pFreq_2_Time_data_1++)) << shift;
-                            *(pOverlap_and_Add_Buffer_1++) = temp2;
-                        }
-
-                    }
-                    else
-                    {
-
-                        for (i = (W_L_START_1 - LONG_WINDOW) >> 1; i != 0; i--)
-                        {
-                            *(pOverlap_and_Add_Buffer_1++) =
-                                *(pFreq_2_Time_data_1++);
-                            *(pOverlap_and_Add_Buffer_1++) =
-                                *(pFreq_2_Time_data_1++);
-
-                        }
-
-                    }
-
-
-                    pFreq_2_Time_data_1  = &pFreqInfo[W_L_START_1];
-                    pFreq_2_Time_data_2  =
-                        &pFreq_2_Time_data_1[HALF_SHORT_WINDOW];
-
-                    pShort_Window_1   =
-                        &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-                    pShort_Window_2   = pShort_Window_1 - HALF_SHORT_WINDOW;
-
-                    pOverlap_and_Add_Buffer_2 = pOverlap_and_Add_Buffer_1 +
-                                                HALF_SHORT_WINDOW;
-
-                    {
-                        Int16 win1, win2;
-                        Int16  dat1, dat2;
-                        Int32  temp2;
-
-                        for (i = HALF_SHORT_WINDOW; i != 0; i--)
-                        {
-
-                            dat1  = (*pFreq_2_Time_data_1++);
-                            dat2  = (*pFreq_2_Time_data_2++);
-                            win1  = *(pShort_Window_1--);
-                            win2  = *(pShort_Window_2--);
-
-                            temp   =   fxp_mul_16_by_16(dat1, win1) >> shift;
-                            *(pOverlap_and_Add_Buffer_1++) = temp;
-
-                            temp2 =   fxp_mul_16_by_16(dat2, win2) >> shift;
-                            *(pOverlap_and_Add_Buffer_2++) = temp2;
-
-                        }
-                    }
-
-                    pOverlap_and_Add_Buffer_1 += HALF_SHORT_WINDOW;
-
-
-                    pv_memset(
-                        pOverlap_and_Add_Buffer_1,
-                        0,
-                        (LONG_BLOCK1 - W_L_START_2)
-                        *sizeof(*pOverlap_and_Add_Buffer_1));
-
-
-                    break;
-
-
-                case LONG_STOP_SEQUENCE:
-
-                    pOverlap_and_Add_Buffer_1 = &Time_data[ W_L_STOP_2];
-
-                    pInterleaved_output    = &Interleaved_output[2*W_L_STOP_2];
-
-                    pFreq_2_Time_data_1      = &pFreqInfo[W_L_STOP_2];
-
-                    exp -= SCALING;
-
-
-                    if (exp > 0)
-                    {
-                        Int16 tmp1 = (*(pFreq_2_Time_data_1++) >> exp);
-                        temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        for (i = (LONG_WINDOW - W_L_STOP_2); i != 0; i--)
-                        {
-                            limiter(*(pInterleaved_output), (temp + tmp1));
-
-                            pInterleaved_output += 2;
-                            tmp1 = *(pFreq_2_Time_data_1++) >> exp;
-                            temp = *(pOverlap_and_Add_Buffer_1++);
-                        }
-                    }
-                    else if (exp < 0)
-                    {
-                        shift = -exp;
-
-                        Int32 temp1 = ((Int32) * (pFreq_2_Time_data_1++)) << shift;
-                        temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        for (i = (LONG_WINDOW - W_L_STOP_2); i != 0; i--)
-                        {
-                            limiter(*(pInterleaved_output), (temp + temp1));
-
-                            pInterleaved_output += 2;
-                            temp1 = ((Int32) * (pFreq_2_Time_data_1++)) << shift;
-                            temp = *(pOverlap_and_Add_Buffer_1++);
-                        }
-                    }
-                    else
-                    {
-                        Int16 tmp1 = *(pFreq_2_Time_data_1++);
-                        temp = *(pOverlap_and_Add_Buffer_1++);
-                        for (i = (LONG_WINDOW - W_L_STOP_2); i != 0; i--)
-                        {
-                            limiter(*(pInterleaved_output), (temp + tmp1));
-
-                            pInterleaved_output += 2;
-                            tmp1 = *(pFreq_2_Time_data_1++);
-                            temp = *(pOverlap_and_Add_Buffer_1++);
-                        }
-                    }
-
-
-
-                    pShort_Window_1 = &Short_Window_fxp[wnd_shape_prev_bk][0];
-                    pShort_Window_2 = &pShort_Window_1[HALF_SHORT_WINDOW];
-
-                    pFreq_2_Time_data_1 = &pFreqInfo[W_L_STOP_1];
-                    pFreq_2_Time_data_2 =
-                        &pFreq_2_Time_data_1[HALF_SHORT_WINDOW];
-
-                    pOverlap_and_Add_Buffer_1 = &Time_data[ W_L_STOP_1];
-                    pOverlap_and_Add_Buffer_2 = pOverlap_and_Add_Buffer_1
-                                                + HALF_SHORT_WINDOW;
-
-
-                    pInterleaved_output   = &Interleaved_output[2*W_L_STOP_1];
-                    pInterleaved_output_2 = pInterleaved_output + (2 * HALF_SHORT_WINDOW);
-
-                    exp += SCALING;  /* +8 back to what it was */
-                    shift = exp + 15 - SCALING;
-
-
-                    for (i = HALF_SHORT_WINDOW; i != 0; i--)
-                    {
-
-                        Int16 win1;
-                        Int16 dat1;
-
-                        dat1 = *(pFreq_2_Time_data_1++);
-                        win1 = *(pShort_Window_1++);
-                        temp = *(pOverlap_and_Add_Buffer_1++);
-
-                        test  = fxp_mul_16_by_16(dat1, win1);
-
-                        limiter(*(pInterleaved_output), (temp + (test >> shift)));
-
-                        pInterleaved_output += 2;
-
-                        dat1 = *(pFreq_2_Time_data_2++);
-                        win1 = *(pShort_Window_2++);
-                        temp = *(pOverlap_and_Add_Buffer_2++);
-                        test =  fxp_mul_16_by_16(dat1, win1);
-
-                        limiter(*(pInterleaved_output_2), (temp + (test >> shift)));
-
-                        pInterleaved_output_2 += 2;
-
-                    }
-
-
-
-                    pFreq_2_Time_data_2 = &pFreqInfo[LONG_WINDOW];
-
-                    pOverlap_and_Add_Buffer_1 = Time_data;
-
-
-                    pInterleaved_output = Interleaved_output;
-
-                    pLong_Window_2   =
-                        &Long_Window_fxp[wnd_shape_this_bk][LONG_WINDOW_m_1];
-
-
-                    /*
-                     *  Copy previous time in current buffer, also copy overlap
-                     *  and add buffer
-                     */
-
-                    for (i = W_L_STOP_1; i != 0; i--)
-                    {
-
-                        Int16 win1;
-                        Int16 dat1;
-
-                        win1 = *(pLong_Window_2--);
-                        dat1 = *pFreq_2_Time_data_2++;
-
-                        limiter(*(pInterleaved_output), *(pOverlap_and_Add_Buffer_1));
-
-                        pInterleaved_output += 2;
-
-                        temp = fxp_mul_16_by_16(dat1, win1) >> shift;
-                        *(pOverlap_and_Add_Buffer_1++) = temp ;
-
-                    }
-
-                    for (i = (LONG_WINDOW - W_L_STOP_1); i != 0; i--)
-                    {
-
-                        temp = fxp_mul_16_by_16(*pFreq_2_Time_data_2++, *(pLong_Window_2--)) >> shift;
-                        *(pOverlap_and_Add_Buffer_1++) = temp ;
-
-                    }
-
-                    break;
-
-
-
-            } /* switch (wnd_seq) */
-
-        }   /*  if (exp < 16)  */
-
-        else
-        {
-            /* all zeros buffer or excessive down shift */
-
-            /* Overlap and add, setup buffer for next iteration */
-            pOverlap_and_Add_Buffer_1 = &Time_data[0];
-
-            pInterleaved_output = Interleaved_output;
-
-
-            temp  = (*pOverlap_and_Add_Buffer_1++);
-            for (i = LONG_WINDOW; i != 0; i--)
-            {
-
-                limiter(*(pInterleaved_output), temp);
-
-                pInterleaved_output += 2;
-                temp  = (*pOverlap_and_Add_Buffer_1++);
-            }
-            pv_memset(Time_data, 0, LONG_WINDOW*sizeof(Time_data[0]));
-        }
-
-    }
-    else
-    {
-
-        Int32 *pScrath_mem;
-        Int32 *pScrath_mem_entry;
-        Int32  *pFrequency_data = Frequency_data;
-
-        Int32 * pOverlap_and_Add_Buffer_1;
-        Int32 * pOverlap_and_Add_Buffer_2;
-        Int32 * pOverlap_and_Add_Buffer_1x;
-        Int32 * pOverlap_and_Add_Buffer_2x;
-
-
-        /*
-         *  Frequency_data is 2*LONG_WINDOW length but only
-         *  the first LONG_WINDOW elements are filled in,
-         *  then the second part can be used as scratch mem,
-         *  then grab data from one window at a time in
-         *  reverse order.
-         *  The upper LONG_WINDOW Int32 are used to hold the
-         *  computed overlap and add, used in the next call to
-         *  this function, and also as sctrach memory
-         */
-
-        /*
-         *  Frequency_data usage for the case EIGHT_SHORT_SEQUENCE
-
-          |<----- Input Freq. data ----->|< Overlap & Add ->| Unused |-Scratch-|
-          |                              |  Store for next  |        |  memory |
-          |                              |  call            |        |         |
-          |                              |                  |        |         |
-          |//////////////////////////////|\\\\\\\\\\\\\\\\\\|--------|+++++++++|
-          |                              |                  |        |         |
-          0                         LONG_WINDOW        LONG_WINDOW   |   2*LONG_WINDOW
-                                                            +        |         |
-                                                       W_L_STOP_2    |         |
-                                                                     |<--   -->|
-                                                                      SHORT_WINDOW +
-                                                                    HALF_SHORT_WINDOW
-          *
-          */
-
-        pOverlap_and_Add_Buffer_1  = &pFrequency_data[
-                                         LONG_WINDOW + 3*SHORT_WINDOW + HALF_SHORT_WINDOW];
-
-        /*
-         *  Initialize to zero, only the firt short window used in overlap
-         *  and add
-         */
-        pv_memset(
-            pOverlap_and_Add_Buffer_1,
-            0,
-            SHORT_WINDOW*sizeof(*pOverlap_and_Add_Buffer_1));
-
-        /*
-         *  Showt windows are evaluated in decresing order. Windows from 7
-         *  to 0 are break down in four cases: window numbers 7 to 5, 4, 3,
-         *  and 2 to 0.
-         *  The data from short windows 3 and 4 is situated at the boundary
-         *  between the 'overlap and add' buffer and the output buffer.
-         */
-        for (wnd = NUM_SHORT_WINDOWS - 1; wnd >= NUM_SHORT_WINDOWS / 2 + 1; wnd--)
-        {
-
-            pFreqInfo = (Int16 *) & pFrequency_data[ wnd*SHORT_WINDOW];
-
-            exp = imdct_fxp(
-                      (Int32 *)pFreqInfo,
-                      freq_2_time_buffer,
-                      SHORT_BLOCK1,
-                      Q_format,
-                      abs_max_per_window[wnd]);
-
-            /*  W_L_STOP_1 == (LONG_WINDOW - SHORT_WINDOW)>>1 */
-            pOverlap_and_Add_Buffer_1 =
-                &pFrequency_data[ W_L_STOP_1 + SHORT_WINDOW*wnd];
-
-
-            pOverlap_and_Add_Buffer_2 =
-                pOverlap_and_Add_Buffer_1 + SHORT_WINDOW;
-
-            /*
-             *  If all element are zero or if the exponent is bigger than
-             *  16 ( it becomes an undefined shift) ->  skip
-             */
-
-            if (exp < 16)
-            {
-
-
-                pFreq_2_Time_data_1 = &pFreqInfo[0];
-                pFreq_2_Time_data_2 = &pFreqInfo[SHORT_WINDOW];
-
-
-                /*
-                 *  Each of the eight short blocks is windowed separately.
-                 *  Window shape decisions are made on a frame-by-frame
-                 *  basis.
-                 */
-
-                pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-
-                pShort_Window_2   =
-                    &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-
-
-
-                /*
-                 * For short windows from 7 to 5
-                 *                                      |   =========================
-                 *                                      |   |     5     6     7
-                 *               _--_  _--_  _--_  _--_ | _-|-_  _--_  _--_  _--_
-                 *              /    \/    \/    \/    \|/  |  \/    \/    \/    \
-                 *             /     /\    /\    /\    /|\  |  /\    /\    /\     \
-                 *            /     /  \  /  \  /  \  / | \ | /  \  /  \  /  \     \
-                 *           /     /    \/    \/    \/  |  \|/    \/    \     \     \
-                 *      --------------------------------|---[///////////////////////]--------
-                 *
-                 */
-
-
-                shift = exp + 15 - SCALING;
-
-
-                for (i = SHORT_WINDOW; i != 0; i--)
-                {
-                    Int16 win1, win2;
-                    Int16  dat1, dat2;
-
-                    dat2 = *(pFreq_2_Time_data_2++);
-                    win2 = *(pShort_Window_2--);
-                    temp = *pOverlap_and_Add_Buffer_2;
-                    dat1 = *(pFreq_2_Time_data_1++);
-                    win1 = *(pShort_Window_1++);
-
-                    *(pOverlap_and_Add_Buffer_2++) =  temp + (fxp_mul_16_by_16(dat2, win2) >> shift);
-
-                    *(pOverlap_and_Add_Buffer_1++)  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                }
-
-            }   /* if (exp < 16) */
-            else
-            {
-                pv_memset(
-                    pOverlap_and_Add_Buffer_1,
-                    0,
-                    SHORT_WINDOW*sizeof(*pOverlap_and_Add_Buffer_1));
-            }
-
-
-        }/* for ( wnd=NUM_SHORT_WINDOWS-1; wnd>=NUM_SHORT_WINDOWS/2; wnd--) */
-
-
-        wnd = NUM_SHORT_WINDOWS / 2;
-
-        pFreqInfo = (Int16 *) & pFrequency_data[ wnd*SHORT_WINDOW];
-
-        /*
-         *  scratch memory is allocated in an unused part of memory
-         */
-
-
-        pScrath_mem = &pFrequency_data[ 2*LONG_WINDOW - HALF_SHORT_WINDOW];
-
-        pOverlap_and_Add_Buffer_1 = &pFrequency_data[ LONG_WINDOW];
-
-        pOverlap_and_Add_Buffer_2 = pOverlap_and_Add_Buffer_1
-                                    + HALF_SHORT_WINDOW;
-
-
-        exp = imdct_fxp(
-                  (Int32 *)pFreqInfo,
-                  freq_2_time_buffer,
-                  SHORT_BLOCK1,
-                  Q_format,
-                  abs_max_per_window[wnd]);
-
-        /*
-         *  If all element are zero or if the exponent is bigger than
-         *  16 ( it becomes an undefined shift) ->  skip
-         */
-
-
-        if (exp < 16)
-        {
-
-            pFreq_2_Time_data_1 = &pFreqInfo[0];
-            pFreq_2_Time_data_2 = &pFreqInfo[SHORT_WINDOW];
-
-            pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-
-            pShort_Window_2 =
-                &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-
-            /*
-             * For short window 4
-             *                                    ====|===========
-             *                                        |   4
-             *                                    |   |   |      |
-             *                _--_  _--_  _--_  _-|-_ | _-|-_  _-|-_  _--_  _--_
-             *               /    \/    \/    \/  |  \|/  |  \/  |  \/    \/    \
-             *              /     /\    /\    /\  |  /|\  |  /\  |  /\    /\     \
-             *             /     /  \  /  \  /  \ | / | \ | /  \ | /  \  /  \     \
-             *            /     /    \/    \/    \|/  |  \|/    \|/    \/    \     \
-             *      ------------------------------[\\\|\\\|//////]-------------------
-             *           |                        | A | B |   C  |
-             *           |
-             *        W_L_STOP_1
-             */
-
-            shift = exp + 15 - SCALING;
-            {
-                Int16 win1;
-                Int16  dat1;
-                /* -------- segment A ---------------*/
-                dat1 = *(pFreq_2_Time_data_1++);
-                win1 = *(pShort_Window_1++);
-                for (i = HALF_SHORT_WINDOW; i != 0; i--)
-                {
-                    *(pScrath_mem++)  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-                    dat1 = *(pFreq_2_Time_data_1++);
-                    win1 = *(pShort_Window_1++);
-                }
-
-                /* -------- segment B ---------------*/
-                for (i = HALF_SHORT_WINDOW; i != 0; i--)
-                {
-                    *(pOverlap_and_Add_Buffer_1++)  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                    dat1 = *(pFreq_2_Time_data_1++);
-                    win1 = *(pShort_Window_1++);
-                }
-
-                /* -------- segment C ---------------*/
-                temp = *pOverlap_and_Add_Buffer_2;
-                dat1 = *(pFreq_2_Time_data_2++);
-                win1 = *(pShort_Window_2--);
-
-                for (i = SHORT_WINDOW; i != 0; i--)
-                {
-                    *(pOverlap_and_Add_Buffer_2++)  =  temp + (fxp_mul_16_by_16(dat1, win1) >> shift);
-
-                    temp = *pOverlap_and_Add_Buffer_2;
-                    dat1 = *(pFreq_2_Time_data_2++);
-                    win1 = *(pShort_Window_2--);
-                }
-            }
-
-        }   /* if (exp < 16) */
-        else
-        {
-            pv_memset(
-                pScrath_mem,
-                0,
-                HALF_SHORT_WINDOW*sizeof(*pScrath_mem));
-
-            pv_memset(
-                pOverlap_and_Add_Buffer_1,
-                0,
-                HALF_SHORT_WINDOW*sizeof(*pOverlap_and_Add_Buffer_1));
-        }
-
-
-        wnd = NUM_SHORT_WINDOWS / 2 - 1;
-
-        pFreqInfo = (Int16 *) & pFrequency_data[ wnd*SHORT_WINDOW];
-
-        pScrath_mem_entry =
-            &pFrequency_data[2*LONG_WINDOW - HALF_SHORT_WINDOW - SHORT_WINDOW];
-
-
-        pScrath_mem = pScrath_mem_entry;
-
-        pOverlap_and_Add_Buffer_1 = &pFrequency_data[ LONG_WINDOW];
-
-        /* point to end of buffer less HALF_SHORT_WINDOW */
-
-        pInterleaved_output_2 = &Interleaved_output[2*(LONG_WINDOW - HALF_SHORT_WINDOW)];
-        pInterleaved_output = pInterleaved_output_2;
-
-        pOverlap_and_Add_Buffer_1x = &Time_data[W_L_STOP_1 + SHORT_WINDOW*(wnd+1)];
-
-
-        exp = imdct_fxp(
-                  (Int32 *)pFreqInfo,
-                  freq_2_time_buffer,
-                  SHORT_BLOCK1,
-                  Q_format,
-                  abs_max_per_window[wnd]);
-
-        /*
-         *  If all element are zero or if the exponent is bigger than
-         *  16 ( it becomes an undefined shift) ->  skip
-         */
-
-        if (exp < 16)
-        {
-
-            pFreq_2_Time_data_1 = &pFreqInfo[0];
-            pFreq_2_Time_data_2 = &pFreqInfo[SHORT_WINDOW];
-
-
-            /*
-             * For short window 3
-             *                             ===========|====
-             *                                    3   |
-             *                             |      |   |   |
-             *               _--_  _--_  _-|-_  _-|-_ | _-|-_  _--_  _--_  _--_
-             *              /    \/    \/  |  \/  |  \|/  |  \/    \/    \/    \
-             *             /     /\    /\  |  /\  |  /|\  |  /\    /\    /\     \
-             *            /     /  \  /  \ | /  \ | / | \ | /  \  /  \  /  \     \
-             *           /     /    \/    \|/    \|/  |  \|/    \/    \     \     \
-             *     -----|------------------[\\\\\\|///|///]--------------------------
-             *          |                  |   A  | B | C |
-             *
-             *      W_L_STOP_1
-             */
-
-
-            pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-
-            pShort_Window_2 =
-                &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-            shift = exp + 15 - SCALING;
-
-            Int16 win1;
-            Int16  dat1;
-            /* -------- segment A ---------------*/
-            dat1 = *(pFreq_2_Time_data_1++);
-            win1 = *(pShort_Window_1++);
-            for (i = SHORT_WINDOW; i != 0; i--)
-            {
-                *(pScrath_mem++)  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-                dat1 = *(pFreq_2_Time_data_1++);
-                win1 = *(pShort_Window_1++);
-            }
-
-            dat1 = *(pFreq_2_Time_data_2++);
-            win1 = *(pShort_Window_2--);
-
-
-            /* -------- segment B ---------------*/
-            for (i = HALF_SHORT_WINDOW; i != 0; i--)
-            {
-                test = fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                temp =  *(pScrath_mem++) + test;
-
-                test = *(pOverlap_and_Add_Buffer_1x++);
-                limiter(*(pInterleaved_output), (temp + test));
-
-
-                pInterleaved_output += 2;
-                dat1 = *(pFreq_2_Time_data_2++);
-                win1 = *(pShort_Window_2--);
-
-            }
-
-            /* -------- segment C ---------------*/
-            for (i = HALF_SHORT_WINDOW; i != 0; i--)
-            {
-
-                temp = fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                *(pOverlap_and_Add_Buffer_1++) += temp;
-
-                dat1 = *(pFreq_2_Time_data_2++);
-                win1 = *(pShort_Window_2--);
-            }
-
-
-        }   /* if (exp < 16) */
-        else
-        {
-
-            pv_memset(
-                pScrath_mem,
-                0,
-                SHORT_WINDOW*sizeof(*pScrath_mem));
-
-            pScrath_mem += SHORT_WINDOW;
-
-            temp = *(pScrath_mem++);
-            for (i = HALF_SHORT_WINDOW; i != 0; i--)
-            {
-                limiter(*(pInterleaved_output), (temp));
-
-                pInterleaved_output += 2;
-                temp = *(pScrath_mem++);
-
-            }
-        }
-
-
-        for (wnd = NUM_SHORT_WINDOWS / 2 - 2; wnd >= 0; wnd--)
-        {
-
-
-            pInterleaved_output_2 -= (SHORT_WINDOW * 2);
-            pInterleaved_output = pInterleaved_output_2;
-
-            /*
-             * The same memory is used as scratch in every iteration
-             */
-            pScrath_mem = pScrath_mem_entry;
-
-            pOverlap_and_Add_Buffer_2x =
-                &Time_data[W_L_STOP_1 + SHORT_WINDOW*(wnd+1)];
-
-            pFreqInfo = (Int16 *) & pFrequency_data[ wnd*SHORT_WINDOW];
-
-
-
-            exp = imdct_fxp(
-                      (Int32 *)pFreqInfo,
-                      freq_2_time_buffer,
-                      SHORT_BLOCK1,
-                      Q_format,
-                      abs_max_per_window[wnd]);
-
-            /*
-             *  If all element are zero or if the exponent is bigger than
-             *  16 ( it becomes an undefined shift) ->  skip
-             */
-
-            if (exp < 16)
-            {
-
-                pFreq_2_Time_data_1 = &pFreqInfo[0];
-                pFreq_2_Time_data_2 = &pFreqInfo[SHORT_WINDOW];
-
-
-                /*
-                 *  Each of the eight short blocks is windowed separately.
-                 *  Window shape decisions are made on a frame-by-frame
-                 *  basis.
-                 */
-
-                pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-
-                if (wnd == 0)
-                {
-                    pShort_Window_1 =
-                        &Short_Window_fxp[wnd_shape_prev_bk][0];
-                }
-
-                pShort_Window_2   =
-                    &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-
-                /*
-                 * For short windows from 2 to 0
-                 *
-                 *          =========================
-                 *                                       |
-                 *                0     1     2      |   |
-                 *               _--_  _--_  _--_  _-|-_ | _--_  _--_  _--_  _--_
-                 *              /    \/    \/    \/  |  \|/    \/    \/    \/    \
-                 *             /     /\    /\    /\  |  /|\    /\    /\    /\     \
-                 *            /     /  \  /  \  /  \ | / | \  /  \  /  \  /  \     \
-                 *           /     /    \/    \/    \|/  |  \/    \/    \     \     \
-                 *      ----[\\\\\\\\\\\\\\\\\\\\\\\\]---|-----------------------------
-                 *          |
-                 *
-                 *      W_L_STOP_1
-                 */
-
-                shift = exp + 15 - SCALING;
-
-                Int16 dat1 = *(pFreq_2_Time_data_2++);
-                Int16 win1 = *(pShort_Window_2--);
-
-                temp  =  *(pScrath_mem);
-                for (i = SHORT_WINDOW; i != 0; i--)
-                {
-                    test  =  fxp_mul_16_by_16(dat1, win1) >> shift;
-
-                    temp += test;
-                    dat1 = *(pFreq_2_Time_data_1++);
-                    win1 = *(pShort_Window_1++);
-
-                    limiter(*(pInterleaved_output), (temp + *(pOverlap_and_Add_Buffer_2x++)));
-
-                    pInterleaved_output += 2;
-
-                    *(pScrath_mem++) = fxp_mul_16_by_16(dat1, win1) >> shift;
-                    dat1 = *(pFreq_2_Time_data_2++);
-                    win1 = *(pShort_Window_2--);
-                    temp  =  *(pScrath_mem);
-
-                }
-
-            }   /* if (exp < 16) */
-            else
-            {
-                test  = *(pScrath_mem);
-                temp  = *(pOverlap_and_Add_Buffer_2x++);
-
-                for (i = SHORT_WINDOW; i != 0; i--)
-                {
-                    limiter(*(pInterleaved_output), (temp + test));
-
-                    pInterleaved_output += 2;
-
-                    *(pScrath_mem++) = 0;
-                    test  =  *(pScrath_mem);
-                    temp  = *(pOverlap_and_Add_Buffer_2x++);
-                }
-            }
-
-        }   /* for ( wnd=NUM_SHORT_WINDOWS/2-1; wnd>=0; wnd--) */
-
-        pOverlap_and_Add_Buffer_2x =  &Time_data[W_L_STOP_1];
-
-        pScrath_mem = pScrath_mem_entry;
-
-        pInterleaved_output_2 -= (SHORT_WINDOW * 2);
-        pInterleaved_output    = pInterleaved_output_2;
-
-        test  = *(pScrath_mem++);
-        temp  = *(pOverlap_and_Add_Buffer_2x++);
-
-        for (i = SHORT_WINDOW; i != 0; i--)
-        {
-            limiter(*(pInterleaved_output), (temp + test));
-
-            pInterleaved_output += 2;
-            test  = *(pScrath_mem++);
-            temp  = *(pOverlap_and_Add_Buffer_2x++);
-
-        }
-
-        pOverlap_and_Add_Buffer_1x = Time_data;
-
-        pInterleaved_output = Interleaved_output;
-
-
-        temp = *(pOverlap_and_Add_Buffer_1x++);
-        for (i = W_L_STOP_1; i != 0; i--)
-        {
-            limiter(*(pInterleaved_output), temp);
-
-            pInterleaved_output += 2;
-            temp = *(pOverlap_and_Add_Buffer_1x++);
-
-        }
-
-        pOverlap_and_Add_Buffer_1x = &Time_data[0];
-
-        pOverlap_and_Add_Buffer_2 = &pFrequency_data[LONG_WINDOW];
-
-        /*
-         *  update overlap and add buffer,
-         *  so is ready for next iteration
-         */
-
-        for (int i = 0; i < W_L_STOP_2; i++)
-        {
-            temp = *(pOverlap_and_Add_Buffer_2++);
-            *(pOverlap_and_Add_Buffer_1x++) = temp;
-        }
-
-        pv_memset(
-            pOverlap_and_Add_Buffer_1x,
-            0,
-            W_L_STOP_1*sizeof(*pOverlap_and_Add_Buffer_1x));
-
-    } /* if ( wnd_seq != EIGHT_SHORT_SEQUENCE) */
-
-
-
-
-}   /* trans4m_freq_2_time_fxp */
-
-
-
-
diff --git a/media/libstagefright/codecs/aacdec/trans4m_time_2_freq_fxp.cpp b/media/libstagefright/codecs/aacdec/trans4m_time_2_freq_fxp.cpp
deleted file mode 100644
index b1b44f0..0000000
--- a/media/libstagefright/codecs/aacdec/trans4m_time_2_freq_fxp.cpp
+++ /dev/null
@@ -1,663 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
-  Pathname: trans4m_time_2_freq_fxp.c
-  Function: trans4m_time_2_freq_fxp
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
-        Modified normalization, so it now happen per window basis, eliminated
-        shifts left or rigth to accomodate TNS inverse filtering. The output
-        is 32 bits but only the lowest 16 are being used.
-        Modified fuction interface
-
- Description: Modified variable names with leading "p" for pointers
-
- Description:
-        Modified call to mdct_fxp to reflect extended precision use. Added routine
-        buffer_adaptation to extract 16 MSB and keep highest precision.
-        Modify casting to ensure proper operations for different platforms
-
- Description:
-        Added comments according to code review
-
- Description:
-        Removed include file "buffer_normalization.h"
-
- Description:
-        Eliminated buffer_adaptation() and embedded its functionality in other
-        functions. Commented out the short window section given that this is
-        not supported by the standards
-
- Description:
-        Added shift down operation for case when the window was equal to one.
-        This was not needed previuosly because buffer_adaptation() was doing
-        it.
-
- Description: Created local version of vectors Long_Window_fxp and
-              Short_Window_fxp. This solve linking problem when using the
-              /ropi option (Read-only position independent) for some
-              compilers.
-
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-    Time2Freq_data    =  buffer with data in the time domain, it holds 2048
-                         points of input time data
-                         Output holds frequency (first 1024 points )
-                         type Int32
-
-    wnd_seq           =  window sequence
-                         type WINDOW_SEQUENCE
-
-    wnd_shape_prev_bk =  previous window shape type
-                         type Int
-
-    wnd_shape_this_bk =  current window shape type
-                         type Int
-
-    pQ_format          =  Holds the Q format of the data in, and data out
-                         type Int *
-
-    mem_4_in_place_FFT[] =  scratch memory for computing FFT, 1024 point
-                         type Int32
-
-
-
- Local Stores/Buffers/Pointers Needed:
-    None
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    Frequency information (1024 pts.) is returned in Time2Freq_data
-    pQ_format content spectral coefficients Q format
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
-The time/frequency representation of the signal is mapped onto the frequency
-domain by feeding it into the filterbank module. This module consists of
-a modified discrete cosine transform (MDCT), (windowing and DCT).
-In order to adapt the time/frequency resolution of the filterbank to the
- characteristics of the input signal, a block switching tool is also
-adopted. N represents the window length, where N is a function of the
-window_sequence. For each channel, the N time values are transformed into the
-N/2 frequency domain values via the MDCT.
-
-The adaptation of the time-frequency resolution of the filterbank to the
-characteristics of the input signal is done by shifting between transforms
-whose input lengths are either 2048 or 256 samples. By enabling the block
-switching tool, the following transitions are meaningful:
-
-from ONLY_LONG_SEQUENCE to   { LONG_START_SEQUENCE
-                               ONLY_LONG_SEQUENCE
-
-from LONG_START_SEQUENCE to  { LONG_STOP_SEQUENCE
-                               EIGHT_SHORT_SEQUENCE
-
-from LONG_STOP_SEQUENCE to   { LONG_START_SEQUENCE
-                               ONLY_LONG_SEQUENCE
-
-from EIGHT_SHORT_SEQUENCE to { LONG_STOP_SEQUENCE
-                               EIGHT_SHORT_SEQUENCE
-
-Window shape decisions are made by the encoder on a frame-by-frame-basis.
-The window selected is applicable to the second half of the window function
-only, since the first half is constrained to use the appropriate window
-shape from the preceding frame.
-The 2048 time-domain values x'(i)(n), (i window, n sample) to be windowed are
-the last 1024 values of the previous window_sequence concatenated with 1024
-values of the current block. The formula below shows this fact:
-
-                     |  x(i-1)(n+1024)      for    0 < n < 1024
-            x'(i)(n) {
-                     |  x(i)(n)             for 1024 < n < 2048
-
-
-
-Once the window shape is selected, the window_shape syntax element is
-initialized. Together with the chosen window_sequence all information needed
-for windowing exist.
-With the window halves described below all window_sequences can be assembled.
-For window_shape == 1, the window coefficients are given by the Kaiser -
-Bessel derived (KBD) window.
-Otherwise, for window_shape == 0, a sine window is employed.
-
-The window length N can be 2048 or 256 for the KBD and the sine window.
-All four window_sequences explained below have a total length of 2048
-samples.
-For all kinds of window_sequences the window_shape of the left half of
-the first transform window is determined by the window shape of the previous
-block.
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This module shall implement a scheme to switch between window types and
-    in turn perform time to frequency transformations
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
-    [1] ISO 14496-3:1999, pag 111
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    IF ( wnd_seq == EIGHT_SHORT_SEQUENCE)
-    THEN
-
-
-        FOR ( wnd=0; wnd<NUM_SHORT_WINDOWS; wnd++)
-
-            time_info = &Time2Freq_data[ W_L_STOP_1 + wnd*SHORT_WINDOW]
-
-            FOR( i=0; i<SHORT_BLOCK1; i++)
-                aux_temp[i] = time_info[i]
-            ENDFOR
-
-
-            IF (wnd == 0)
-            THEN
-                pShort_Window_1 = &Short_Window[wnd_shape_prev_bk][0]
-            ELSE
-                pShort_Window_1 = &Short_Window[wnd_shape_this_bk][0]
-            ENDIF
-
-
-            pShort_Window_2   =
-                    &Short_Window[wnd_shape->this_bk][SHORT_WINDOW_m_1]
-
-            FOR( i=0, j=SHORT_WINDOW; i<SHORT_WINDOW; i++, j--)
-                aux_temp[             i]  *= pShort_Window_1[i]
-                aux_temp[SHORT_WINDOW+i]  *= pShort_Window_2[j]
-            ENDFOR
-
-
-            CALL MDCT( aux_temp, SHORT_BLOCK1)
-            MODIFYING( aux_temp)
-
-            FOR( i=0; i<SHORT_WINDOW; i++)
-                Time2Freq_data[wnd*SHORT_WINDOW + i] = aux_temp[i];
-            ENDFOR
-
-        ENDFOR
-
-    ELSE
-
-        SWITCH ( wnd_seq)
-
-            CASE ( ONLY_LONG_SEQUENCE)
-
-                pLong_Window_1 = &Long_Window[wnd_shape_prev_bk][0]
-                pLong_Window_2 =
-                        &Long_Window[wnd_shape_this_bk][LONG_WINDOW_m_1]
-
-                FOR (i=0; i<LONG_WINDOW; i++)
-                    Time2Freq_data[            i] *= *pLong_Window_1++
-                    Time2Freq_data[LONG_WINDOW+i] *= *pLong_Window_2--
-                ENDFOR
-
-                BREAK
-
-
-            CASE ( LONG_START_SEQUENCE)
-
-                pLong_Window_1 = &Long_Window[wnd_shape_prev_bk][0];
-
-                FOR ( i=0; i<LONG_WINDOW; i++)
-                    Time2Freq_data[ i] *= *pLong_Window_1++;
-                ENDFOR
-
-
-                pShort_Window_1   =
-                        &Short_Window[wnd_shape->this_bk][SHORT_WINDOW_m_1];
-
-                FOR ( i=0; i<SHORT_WINDOW; i++)
-                    Time2Freq_data[W_L_START_1 + i] *= *pShort_Window_1--;
-                ENDFOR
-
-
-                FOR ( i=W_L_START_2; i<LONG_BLOCK1; i++)
-                    Time2Freq_data[W_L_START_2 + i] = 0;
-                ENDFOR
-
-                BREAK
-
-
-            CASE ( LONG_STOP_SEQUENCE )
-
-                FOR ( i=0; i<W_L_STOP_1; i++)
-                    Time2Freq_data[ i] = 0;
-                ENDFOR
-
-
-                pShort_Window_1   = &Short_Window[wnd_shape->prev_bk][0];
-
-                FOR ( i=0; i<SHORT_WINDOW; i++)
-                    Time2Freq_data[W_L_STOP_1+ i] *= *pShort_Window_1++;
-                ENDFOR
-
-
-                pLong_Window_1 =
-                        &Long_Window[wnd_shape->this_bk][LONG_WINDOW_m_1];
-
-                FOR ( i=0; i<LONG_WINDOW; i++)
-                    Time2Freq_data[LONG_WINDOW + i]  *=  *pLong_Window_1--;
-                ENDFOR
-
-                BREAK
-
-
-        }
-
-        MDCT( Time2Freq_data, LONG_BLOCK1);
-        MODIFYING( Time2Freq_data)
-
-    ENDIF
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-
-#include "pv_audio_type_defs.h"
-#include "aac_mem_funcs.h"
-#include "window_block_fxp.h"
-#include "mdct_fxp.h"
-#include "long_term_prediction.h"
-#include    "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void trans4m_time_2_freq_fxp(
-    Int32   Time2Freq_data[],       /* time data size 2048 */
-    WINDOW_SEQUENCE wnd_seq,        /* window sequence */
-    Int     wnd_shape_prev_bk,      /* window shape, current and previous  */
-    Int     wnd_shape_this_bk,
-    Int     *pQ_format,
-    Int32   mem_4_in_place_FFT[])   /* scratch memory for computing FFT */
-{
-
-    Int  i;
-
-    Int32   *pAux_temp_1;
-    Int32   *pAux_temp_2;
-    Int32   *pAux_temp;
-//    Int32   temp;
-    const   Int16 *pLong_Window_1;
-    const   Int16 *pLong_Window_2;
-    const   Int16 *pShort_Window_1;
-    const   Int16 *pShort_Window_2;
-    Int     shift = *pQ_format - 1;
-
-    const Int16 * Long_Window_fxp[NUM_WINDOW_SHAPES];
-    const Int16 * Short_Window_fxp[NUM_WINDOW_SHAPES];
-
-    Long_Window_fxp[0] = Long_Window_sine_fxp;
-    Long_Window_fxp[1] = Long_Window_KBD_fxp;
-    Short_Window_fxp[0] = Short_Window_sine_fxp;
-    Short_Window_fxp[1] = Short_Window_KBD_fxp;
-
-    if (wnd_seq != EIGHT_SHORT_SEQUENCE)
-    {
-
-        pAux_temp = Time2Freq_data;
-
-        *pQ_format = LTP_Q_FORMAT - *pQ_format;
-
-        pAux_temp_1 = pAux_temp;
-
-        switch (wnd_seq)
-        {
-
-            case LONG_START_SEQUENCE:
-
-                pAux_temp_2 = &pAux_temp_1[HALF_LONG_WINDOW];
-
-                pLong_Window_1 = &Long_Window_fxp[wnd_shape_prev_bk][0];
-                pLong_Window_2 = &pLong_Window_1[ HALF_LONG_WINDOW];
-
-
-
-
-                for (i = HALF_LONG_WINDOW; i > 0; i--)
-                {
-
-                    *pAux_temp_1 = fxp_mul32_by_16((*pAux_temp_1), *pLong_Window_1++) >> shift;
-                    pAux_temp_1++;
-                    *pAux_temp_2 = fxp_mul32_by_16((*pAux_temp_2), *pLong_Window_2++) >> shift;
-                    pAux_temp_2++;
-
-                }
-
-
-                /* data unchanged from  LONG_WINDOW to W_L_START_1 */
-                pAux_temp_1 = &pAux_temp[LONG_WINDOW];
-                if (shift)
-                {
-                    for (i = (W_L_START_1 - LONG_WINDOW) >> 1; i != 0; i--)
-                    {
-                        *(pAux_temp_1++) >>= shift;
-                        *(pAux_temp_1++) >>= shift;
-                    }
-                }
-
-
-                pAux_temp_1 = &pAux_temp[W_L_START_1];
-                pAux_temp_2 = &pAux_temp_1[HALF_SHORT_WINDOW];
-
-                pShort_Window_1   =
-                    &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-
-                pShort_Window_2   = pShort_Window_1 - HALF_SHORT_WINDOW;
-
-                for (i = HALF_SHORT_WINDOW; i > 0; i--)
-                {
-
-                    *pAux_temp_1 = fxp_mul32_by_16((*pAux_temp_1), *pShort_Window_1--) >> shift;
-                    pAux_temp_1++;
-                    *pAux_temp_2 = fxp_mul32_by_16((*pAux_temp_2), *pShort_Window_2--) >> shift;
-                    pAux_temp_2++;
-
-                }
-
-                pAux_temp_1 = &pAux_temp[W_L_START_2];
-
-                pv_memset(
-                    pAux_temp_1,
-                    0,
-                    (LONG_BLOCK1 - W_L_START_2)*sizeof(*pAux_temp_1));
-
-                break;
-
-
-            case LONG_STOP_SEQUENCE:
-
-                pv_memset(
-                    pAux_temp_1,
-                    0,
-                    (W_L_STOP_1)*sizeof(*pAux_temp_1));
-
-                pShort_Window_1   = &Short_Window_fxp[wnd_shape_prev_bk][0];
-                pShort_Window_2   = &pShort_Window_1[HALF_SHORT_WINDOW];
-
-                pAux_temp_1      = &pAux_temp_1[W_L_STOP_1];
-                pAux_temp_2      = pAux_temp_1 + HALF_SHORT_WINDOW;
-
-                for (i = HALF_SHORT_WINDOW; i > 0; i--)
-                {
-
-                    *pAux_temp_1 = fxp_mul32_by_16((*pAux_temp_1), *pShort_Window_1++) >> shift;
-                    pAux_temp_1++;
-                    *pAux_temp_2 = fxp_mul32_by_16((*pAux_temp_2), *pShort_Window_2++) >> shift;
-                    pAux_temp_2++;
-
-
-                }
-
-                /* data unchanged from  W_L_STOP_2 to LONG_WINDOW */
-                pAux_temp_1 = &pAux_temp[W_L_STOP_2];
-
-                if (shift)
-                {
-                    for (i = ((LONG_WINDOW - W_L_STOP_2) >> 1); i != 0; i--)
-                    {
-                        *(pAux_temp_1++) >>= shift;
-                        *(pAux_temp_1++) >>= shift;
-                    }
-                }
-
-
-
-                pAux_temp_1 = &pAux_temp[LONG_WINDOW];
-                pAux_temp_2 =  pAux_temp_1 + HALF_LONG_WINDOW;
-
-                pLong_Window_1 =
-                    &Long_Window_fxp[wnd_shape_this_bk][LONG_WINDOW_m_1];
-
-
-                pLong_Window_2   = &pLong_Window_1[-HALF_LONG_WINDOW];
-
-                for (i = HALF_LONG_WINDOW; i > 0; i--)
-                {
-                    *pAux_temp_1 = fxp_mul32_by_16((*pAux_temp_1), *pLong_Window_1--) >> shift;
-                    pAux_temp_1++;
-                    *pAux_temp_2 = fxp_mul32_by_16((*pAux_temp_2), *pLong_Window_2--) >> shift;
-                    pAux_temp_2++;
-
-                }
-
-                break;
-
-            case ONLY_LONG_SEQUENCE:
-            default:
-
-                pAux_temp_2 = &pAux_temp[LONG_WINDOW];
-
-                pLong_Window_1 = &Long_Window_fxp[wnd_shape_prev_bk][0];
-
-
-                pLong_Window_2 =
-                    &Long_Window_fxp[wnd_shape_this_bk][LONG_WINDOW_m_1];
-
-
-                for (i = LONG_WINDOW; i > 0; i--)
-                {
-
-                    *pAux_temp_1 = fxp_mul32_by_16((*pAux_temp_1), *pLong_Window_1++) >> shift;
-                    pAux_temp_1++;
-                    *pAux_temp_2 = fxp_mul32_by_16((*pAux_temp_2), *pLong_Window_2--) >> shift;
-                    pAux_temp_2++;
-                }
-
-                break;
-
-        }   /* end switch ( wnd_seq)  */
-
-
-
-        *pQ_format += mdct_fxp(
-                          pAux_temp,
-                          mem_4_in_place_FFT,
-                          LONG_BLOCK1);
-
-
-    }   /* end if( wnd_seq != EIGHT_SHORT_SEQUENCE) */
-
-
-
-    /*****************************************/
-    /* decoding process for short window */
-    /*****************************************/
-
-    /*
-     * For short window the following code will be applied
-     * in the future when short window is supported in the
-     * standards
-     */
-    /*-------------------------------------------------------------------------
-
-    *        pAux_temp = &mem_4_in_place_FFT[(2*SHORT_BLOCK1)];
-    *
-    *        for ( wnd=0; wnd<NUM_SHORT_WINDOWS; wnd++)
-    *        {
-    *
-    *            pShort_Window_1 = &Short_Window_fxp[wnd_shape_this_bk][0];
-    *
-    *            if (wnd == 0)
-    *            {
-    *                pShort_Window_1 = &Short_Window_fxp[wnd_shape_prev_bk][0];
-    *            }
-    *
-    *            pShort_Window_2   =
-    *                    &Short_Window_fxp[wnd_shape_this_bk][SHORT_WINDOW_m_1];
-    *
-    *            pAux_temp_1 =  pAux_temp;
-    *            pAux_temp_2 = pAux_temp_1 + SHORT_WINDOW;
-    *
-    *            Q_aux = 0;
-    *
-    *            buffer_adaptation (
-    *                &Q_aux,
-    *                &Time2Freq_data[ W_L_STOP_1 + wnd*SHORT_WINDOW],
-    *                (void *) pAux_temp,
-    *                SHORT_BLOCK1,
-    *                USING_INT,
-    *                16);
-    *
-    *
-    *            for ( i=SHORT_WINDOW; i>0; i--)
-    *            {
-    *                temp           = (*pAux_temp_1) * *pShort_Window_1++;
-    *                *pAux_temp_1++ = (temp + 0x08000L) >> 16;
-    *
-    *                temp           = (*pAux_temp_2) * *pShort_Window_2--;
-    *                *pAux_temp_2++ = (temp + 0x08000L) >> 16;
-    *
-    *            }
-    *
-    *
-    *            exp = mdct_fxp(
-    *                pAux_temp,
-    *                mem_4_in_place_FFT,
-    *                SHORT_BLOCK1);
-    *
-    *
-    *            exp += Q_aux;
-    *
-    *            pAux_temp_1  =  pAux_temp;
-    *            pAux_temp_2  =  pAux_temp_1  +  HALF_SHORT_WINDOW;
-    *            pTime_data_1 = &Time2Freq_data[wnd*SHORT_WINDOW];
-    *            pTime_data_2 =  pTime_data_1 + HALF_SHORT_WINDOW;
-    *
-    *
-    *            if (exp > 0)
-    *            {
-    *                for ( i=HALF_SHORT_WINDOW; i>0; i--)
-    *                {
-    *                    *pTime_data_1++ = (*pAux_temp_1++>>exp);
-    *                    *pTime_data_2++ = (*pAux_temp_2++>>exp);
-    *                }
-    *            }
-    *            else if (exp < 0)
-    *            {
-    *                exp = -exp;
-    *                for ( i=HALF_SHORT_WINDOW; i>0; i--)
-    *                {
-    *                    *pTime_data_1++ = (*pAux_temp_1++<<exp);
-    *                    *pTime_data_2++ = (*pAux_temp_2++<<exp);
-    *                }
-    *            }
-    *            else
-    *            {
-    *                for ( i=HALF_SHORT_WINDOW; i>0; i--)
-    *                {
-    *                    *pTime_data_1++ = (*pAux_temp_1++);
-    *                    *pTime_data_2++ = (*pAux_temp_2++);
-    *                }
-    *            }
-    *
-    *        }
-    *
-    *    }
-    *
-    *--------------------------------------------------------------------------*/
-
-}   /* trans4m_time_2_freq_fxp */
diff --git a/media/libstagefright/codecs/aacdec/unpack_idx.cpp b/media/libstagefright/codecs/aacdec/unpack_idx.cpp
deleted file mode 100644
index 9180994..0000000
--- a/media/libstagefright/codecs/aacdec/unpack_idx.cpp
+++ /dev/null
@@ -1,660 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./src/unpack_idx.c
- Function:  unpack_idx
-            unpack_idx_sgn
-            unpack_idx_esc
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:  Modified from original shareware code
-
- Description:  Eliminated 3 divisions and 1 multiplication through a table
- look-up method for calculating 1/mod and constant allocation of 1/mod^3
- and 1/mod^2.
- Eliminated 3 additions through simple optimizations in the code.
- Changed if/else  statement to a switch/case utilizing fall-through.
-
- Description:   Made changes per review comments.  Main improvements were
- in change of switch/case to if statement, and use of temporary variable
- to hold value of *pQuantSpec.
-
- Description: (1) Typecast codeword_indx to Int32 before multiplication, this
-              assures the shift operation happens on a 32-bit product on
-              TI-C55x processor.
-              (2) define temp_spec as Int32 to avoid overflow
-
- Description: Modified per review comments
-              (1) remove the two typecastings of codeword_indx when
-                  pHuffCodebook->dim == DIMENSION_4
-              (2) temp_spec is Int because the result never exceeds 16 bits
-
- Description: Break up and combine unpack index with sign bit reading and for
-              special escape code. Parent function must know which one of the
-              3 functions should be called.
-
- Description: Put back if-statement to get the max.
-
- Description: When searching for the max, there was some instances where the
-              max was compared against a negative number, so the max was never
-              updated (defaulted to 0), leading to block processing in other
-              magnitude sensitive stages.
-
- Who:                       Date:
- Description:
-------------------------------------------------------------------------------
- INPUT AND OUTPUT DEFINITIONS
-
- Inputs:
-          Int  quant_spec[]  = Array for storage of the quantized
-                               spectral coefficients.  Length is either 2 or 4.
-                               See Ref #1, Page 76 for a complete description.
-
-          Int  codeword_indx = The index into the Huffman table.
-                               Range is [1-288]
-
-    const Hcb *pHuffCodebook = Pointer to HuffmanCodebook information.
-
-          BITS  *pInputStream = Pointer to the bitstream buffer.
-          Int *max           = Pointer to maximum coefficient value.
-
- Local Stores/Buffers/Pointers Needed:
-    const UInt div_mod[18]   = An array with the values for 1/mod
-                               stored in Q-formats 13.
-
- Global Stores/Buffers/Pointers Needed:
-    None
-
- Outputs:
-    None
-
- Pointers and Buffers Modified:
-    Int quant_spec[] = Output (the quantized and signed spectral coefficients)
-                       returned via this pointer.
-
- Local Stores Modified:
-    None
-
- Global Stores Modified:
-    None
-
-------------------------------------------------------------------------------
- FUNCTION DESCRIPTION
-
- This function decodes quantized spectral coefficients and decode their signs
- from the input bitstream. Quantized spectral coefficients are transmitted as
- four-tuples or 2-tuples, and this information is conveyed to the function via
- the variable HuffCodebook->dim.
-
- See Reference #1 for a complete description
-------------------------------------------------------------------------------
- REQUIREMENTS
-
- This function shall correctly calculate pQuantSpec[], given the inputs
-
- codeword_indx     = {1-288};
- HuffCodebook->off = {0, 1, 4};
- HuffCodebook->mod = {3, 8, 9, 13, 17};
-
- mod =   LAV + 1 if unsigned codebook
- mod = 2*LAV + 1 if   signed codebook
-
- Range of values for LAV is {2,7,12,16} if unsigned
-                            {1,4}       if   signed
-
- Additionally,
-     LAV <= 2 if dim == 4
-
- This restricts mod ==  3                if dim == 4
-            and mod == {3, 8, 9, 13, 17} if dim == 2
-
- This function will NOT function correctly if fed values that do not
- meet the requirements as stated above.
-
- This limitation on the range of values was determined by analysis
- of Reference #1 (see below.)
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 14496-3:1999(E)
-     Part 3
-        Subpart 4.6.3.3   Decoding Process
-        Subpart 4.6.4     Tables
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC  gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her  own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
- PSEUDO-CODE
-
-    IF (pHuffCodebook->dim == 4)
-        *(pQuantSpec) = codeword_indx/(3^3);
-        codeword_indx = codeword_indx - *(pQuantSpec)*(3^3);
-        *(pQuantSpec) = *(pQuantSpec) - off;
-
-        pQuantSpec    = pQuantSpec + 1;
-
-        *(pQuantSpec) = codeword_indx/(3^2);
-        codeword_indx = codeword_indx - *(pQuantSpec)*(3^2);
-        *(pQuantSpec) = *(pQuantSpec) - off;
-
-        pQuantSpec    = pQuantSpec + 1;
-    ENDIF
-
-        *(pQuantSpec) = codeword_indx/mod;
-        codeword_indx = codeword_indx - (*pQuantSpec)*mod;
-        *(pQuantSpec) = *(pQuantSpec) - off;
-
-        pQuantSpec    = pQuantSpec + 1;
-
-        *(pQuantSpec) = codeword_indx - off;
-
-------------------------------------------------------------------------------
- RESOURCES USED
-   When the code is written for a specific target processor the
-     the resources used should be documented below.
-
- STACK USAGE: [stack count for this module] + [variable to represent
-          stack usage for each subroutine called]
-
-     where: [stack usage variable] = stack usage for [subroutine
-         name] (see [filename].ext)
-
- DATA MEMORY USED: x words
-
- PROGRAM MEMORY USED: x words
-
- CLOCK CYCLES: [cycle count equation for this module] + [variable
-           used to represent cycle count for each subroutine
-           called]
-
-     where: [cycle count variable] = cycle count for [subroutine
-        name] (see [filename].ext)
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "s_hcb.h"
-#include "ibstream.h"
-#include "unpack_idx.h"
-
-#include "fxp_mul32.h"
-
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-#define DIV_3_CUBED    19  /* 19 = 1/27 in Q-9 format    */
-#define THREE_CUBED    27  /* 27 = 3^3                   */
-
-#define DIV_3_SQUARED  57  /* 57 = 1/9  in Q-9 format    */
-#define THREE_SQUARED   9  /*  9 = 3^2                   */
-
-#define Q_FORMAT_MOD   13  /* Q-format for 1/mod table   */
-#define Q_FORMAT_MOD2   9  /* Q-format for DIV_3_SQUARED */
-#define Q_FORMAT_MOD3   9  /* Q-format for DIV_3_CUBED   */
-
-#define LOWER_5_BITS_MASK 0x1F
-
-
-#if ( defined(PV_ARM_V5) || defined(PV_ARM_V4))
-
-__inline Int32 abs1(Int32 x)
-{
-    Int32 z;
-    /*
-        z = x - (x<0);
-        x = z ^ sign(z)
-     */
-    __asm
-    {
-        sub  z, x, x, lsr #31
-        eor  x, z, z, asr #31
-    }
-    return (x);
-}
-
-#define pv_abs(x)   abs1(x)
-
-
-#else
-
-#define pv_abs(x)   ((x) > 0)? (x) : (-x)
-
-#endif
-
-
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL STORE/BUFFER/POINTER DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-/*--------------------------------------------------------------------------
-    Possible values for mod = {3,8,9,13,17}
-
-    There exists "empty" spaces in the table.  These can potentially
-    be utilized by other const tables, if available memory becomes an issue.
----------------------------------------------------------------------------*/
-
-const Int div_mod[18] =   /*   mod   index  Q-format */
-{
-    /* ----------------------- */
-    0xCC,                 /* |      |  0  |          */
-    0xCC,                 /* |      |  1  |          */
-    0xCC,                 /* |      |  2  |          */
-    2731,                 /* |  3   |  3  |   13     */
-    0xCC,                 /* |      |  4  |          */
-    0xCC,                 /* |      |  5  |          */
-    0xCC,                 /* |      |  6  |          */
-    0xCC,                 /* |      |  7  |          */
-    1025,                 /* |  8   |  8  |   13     */
-    911,                 /* |  9   |  9  |   13     */
-    0xCC,                 /* |      | 10  |          */
-    0xCC,                 /* |      | 11  |          */
-    0xCC,                 /* |      | 12  |          */
-    631,                 /* |  13  | 13  |   13     */
-    0xCC,                 /* |      | 14  |          */
-    0xCC,                 /* |      | 15  |          */
-    0xCC,                 /* |      | 16  |          */
-    482,                 /* |  17  | 17  |   13     */
-};
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; FUNCTION CODE
-----------------------------------------------------------------------------*/
-void unpack_idx(
-    Int16   quant_spec[],
-    Int codeword_indx,
-    const Hcb   *pHuffCodebook,
-    BITS  *pInputStream,
-    Int *max)
-{
-    Int16 *pQuantSpec = &quant_spec[0];
-    Int  temp_spec;
-
-    const Int mod = pHuffCodebook->mod;
-    const Int off = pHuffCodebook->off;
-
-    OSCL_UNUSED_ARG(pInputStream);
-
-
-    if (pHuffCodebook->dim == DIMENSION_4)
-    {
-        /* Calculate pQuantSpec[0] */
-
-        temp_spec      = (codeword_indx * DIV_3_CUBED) >> Q_FORMAT_MOD3;
-
-        codeword_indx -= temp_spec * THREE_CUBED;
-
-        temp_spec -= off;
-        *pQuantSpec++  = (Int16)temp_spec;
-
-        temp_spec = pv_abs(temp_spec);
-
-        if (temp_spec > *max)
-        {
-            *max = temp_spec;
-        }
-
-        /* Calculate pQuantSpec[1] */
-        temp_spec      = (codeword_indx * DIV_3_SQUARED) >> Q_FORMAT_MOD2;
-
-        codeword_indx -= temp_spec * THREE_SQUARED;
-
-        temp_spec -= off;
-        *pQuantSpec++  = (Int16)temp_spec;
-
-        temp_spec = pv_abs(temp_spec);
-
-        if (temp_spec > *max)
-        {
-            *max = temp_spec;
-        }
-    }
-
-    /*
-     *  Calculate pQuantSpec[2] if dim == 4
-     *  Calculate pQuantSpec[0] if dim == 2
-     */
-
-    temp_spec      = ((Int32) codeword_indx * div_mod[mod]) >> Q_FORMAT_MOD;
-
-    codeword_indx -= temp_spec * mod;
-
-    temp_spec -= off;
-    *pQuantSpec++  = (Int16)temp_spec;
-
-    temp_spec = pv_abs(temp_spec);
-
-
-    if (temp_spec > *max)
-    {
-        *max = temp_spec;
-    }
-
-    /*
-    *  Calculate pQuantSpec[3] if dim == 4
-    *  Calculate pQuantSpec[1] if dim == 2
-    */
-    codeword_indx -= off;
-    *pQuantSpec    = (Int16)codeword_indx ;
-
-
-    codeword_indx = pv_abs(codeword_indx);
-
-    if (codeword_indx > *max)
-    {
-        *max = codeword_indx;
-    }
-
-
-    return ;
-} /* unpack_idx */
-
-
-void unpack_idx_sgn(
-    Int16   quant_spec[],
-    Int codeword_indx,
-    const Hcb   *pHuffCodebook,
-    BITS  *pInputStream,
-    Int *max)
-{
-    Int16 *pQuantSpec = &quant_spec[0];
-    Int  temp_spec;
-    Int  sgn;
-
-    const Int mod = pHuffCodebook->mod;
-    const Int off = pHuffCodebook->off;
-
-
-
-    if (pHuffCodebook->dim == DIMENSION_4)
-    {
-        /* Calculate pQuantSpec[0] */
-        preload_cache((Int32 *)pQuantSpec);
-        temp_spec      = (codeword_indx * DIV_3_CUBED) >> Q_FORMAT_MOD3;
-
-        codeword_indx -= temp_spec * THREE_CUBED;
-
-        temp_spec -= off;
-        if (temp_spec)
-        {
-            sgn = get1bits(pInputStream);
-
-
-            *pQuantSpec++ = (Int16)((sgn) ? -temp_spec : temp_spec);
-
-            temp_spec = pv_abs(temp_spec);
-
-            if (temp_spec > *max)
-            {
-                *max = temp_spec;
-            }
-
-        }
-        else
-        {
-            *pQuantSpec++ = 0;
-        }
-
-        /* Calculate pQuantSpec[1] */
-        temp_spec      = (codeword_indx * DIV_3_SQUARED) >> Q_FORMAT_MOD2;
-
-        codeword_indx -= temp_spec * THREE_SQUARED;
-
-        temp_spec -= off;
-        if (temp_spec)
-        {
-
-            sgn = get1bits(pInputStream);
-
-            *pQuantSpec++ = (Int16)((sgn) ? -temp_spec : temp_spec);
-
-            temp_spec = pv_abs(temp_spec);
-
-            if (temp_spec > *max)
-            {
-                *max = temp_spec;
-            }
-        }
-        else
-        {
-            *pQuantSpec++ = 0;
-        }
-    }
-
-    /*
-     *  Calculate pQuantSpec[2] if dim == 4
-     *  Calculate pQuantSpec[0] if dim == 2
-     */
-
-    temp_spec      = ((Int32) codeword_indx * div_mod[mod]) >> Q_FORMAT_MOD;
-
-    codeword_indx -= temp_spec * mod;
-
-    temp_spec -= off;
-    if (temp_spec)
-    {
-
-        sgn = get1bits(pInputStream);
-
-        *pQuantSpec++ = (Int16)((sgn) ? -temp_spec : temp_spec);
-
-        temp_spec = pv_abs(temp_spec);
-
-        if (temp_spec > *max)
-        {
-            *max = temp_spec;
-        }
-    }
-    else
-    {
-        *pQuantSpec++ = 0;
-    }
-
-    /*
-     *  Calculate pQuantSpec[3] if dim == 4
-     *  Calculate pQuantSpec[1] if dim == 2
-     */
-    codeword_indx -= off;
-    if (codeword_indx)
-    {
-
-        sgn = get1bits(pInputStream);
-
-        *pQuantSpec = (Int16)((sgn) ? -codeword_indx : codeword_indx);
-
-        codeword_indx = pv_abs(codeword_indx);
-
-        if (codeword_indx > *max)
-        {
-            *max = codeword_indx;
-        }
-    }
-    else
-    {
-        *pQuantSpec = 0;
-    }
-
-    return ;
-} /* unpack_idx_sgn */
-
-
-void unpack_idx_esc(
-    Int16   quant_spec[],
-    Int codeword_indx,
-    const Hcb   *pHuffCodebook,
-    BITS  *pInputStream,
-    Int *max)
-{
-    Int  temp_spec;
-    Int  sgn1 = 0, sgn2 = 0;
-    Int N;
-    Int32 esc_seq;
-
-    const Int mod = pHuffCodebook->mod;
-    const Int off = pHuffCodebook->off;
-
-
-    temp_spec      = ((Int32) codeword_indx * div_mod[mod]) >> Q_FORMAT_MOD;
-
-    codeword_indx -= temp_spec * mod;
-
-    temp_spec -= off;
-    if (temp_spec)
-    {
-        sgn1 = get1bits(pInputStream);
-    }
-
-    codeword_indx -= off;
-    if (codeword_indx)
-    {
-        sgn2 = get1bits(pInputStream);
-    }
-
-
-    if ((temp_spec & LOWER_5_BITS_MASK) == 16)
-    {
-        N = 3;
-        do
-        {
-            N++;
-
-            esc_seq = get1bits(pInputStream);
-
-        }
-        while (esc_seq != 0);
-
-        esc_seq  = getbits(N, pInputStream);
-
-        esc_seq += (1 << N);
-
-
-        temp_spec = (Int)((temp_spec * esc_seq) >> 4);
-
-    }
-
-
-    if (sgn1)
-    {
-        quant_spec[0]  = (Int16)(-temp_spec);
-    }
-    else
-    {
-        quant_spec[0]  = (Int16)temp_spec;
-    }
-
-    temp_spec = pv_abs(temp_spec);
-
-    if (temp_spec > *max)
-    {
-        *max = temp_spec;
-    }
-
-    if ((codeword_indx & LOWER_5_BITS_MASK) == 16)
-    {
-        N = 3;
-        do
-        {
-            N++;
-
-            esc_seq = get1bits(pInputStream);
-
-        }
-        while (esc_seq != 0);
-
-        esc_seq  = getbits(N, pInputStream);
-
-        esc_seq += (1 << N);
-
-        codeword_indx = (Int)((codeword_indx * esc_seq) >> 4);
-    }
-
-
-
-
-    if (sgn2)
-    {
-        quant_spec[1]    = (Int16)(-codeword_indx);
-    }
-    else
-    {
-        quant_spec[1]    = (Int16)codeword_indx;
-    }
-
-
-    codeword_indx = pv_abs(codeword_indx);
-
-    if (codeword_indx > *max)
-    {
-        *max = codeword_indx;
-    }
-
-
-    return ;
-} /* unpack_idx_esc */
diff --git a/media/libstagefright/codecs/aacdec/unpack_idx.h b/media/libstagefright/codecs/aacdec/unpack_idx.h
deleted file mode 100644
index a308c4a..0000000
--- a/media/libstagefright/codecs/aacdec/unpack_idx.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: ./include/unpack_idx.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Who:                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- This header file includes the function definition for unpack_idx()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef UNPACK_IDX_H
-#define UNPACK_IDX_H
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include    "pv_audio_type_defs.h"
-#include    "s_hcb.h"
-#include    "s_bits.h"
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here.
-----------------------------------------------------------------------------*/
-#define DIMENSION_4     4
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; SIMPLE TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; ENUMERATED TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; STRUCTURES TYPEDEF'S
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; GLOBAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-    void unpack_idx(
-        Int16  QuantSpec[],
-        Int  codeword_indx,
-        const Hcb *pHuffCodebook,
-        BITS  *pInputStream,
-        Int *max);
-    void unpack_idx_sgn(
-        Int16  quant_spec[],
-        Int  codeword_indx,
-        const Hcb *pHuffCodebook,
-        BITS  *pInputStream,
-        Int *max);
-    void unpack_idx_esc(
-        Int16  quant_spec[],
-        Int  codeword_indx,
-        const Hcb *pHuffCodebook,
-        BITS  *pInputStream,
-        Int *max);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*----------------------------------------------------------------------------
-; END
-----------------------------------------------------------------------------*/
-#endif
-
-
diff --git a/media/libstagefright/codecs/aacdec/window_block_fxp.h b/media/libstagefright/codecs/aacdec/window_block_fxp.h
deleted file mode 100644
index f936199..0000000
--- a/media/libstagefright/codecs/aacdec/window_block_fxp.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: window_block_fxp.h
-
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
-    modified function definition: Time_data from Int to Int32
-    change wnd_shape from structure to passing parameters
-    delete definition of wnd_shape1, not needed.
-
- Description: Modified based on unit test comments
-
- Description: Change copyright, add () around constants.
-
- Description:
-    changed Long_Window_fxp and Short _Window_fxp tables definition, from
-    "const UInt16 *"  to "const UInt16 * const" to avoid global variable
-    definition.
-
- Description: Updated function trans4m_freq_2_time_fxp definition
-
- Description:  Modified function interface to add output_buffer
-
-
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for window and block switch
-
-
-------------------------------------------------------------------------------
- REFERENCES
-
- (1) ISO/IEC 13818-7 Part 7: Advanced Audo Coding (AAC)
-
-
- (2) MPEG-2 NBC Audio Decoder
-   "This software module was originally developed by AT&T, Dolby
-   Laboratories, Fraunhofer Gesellschaft IIS in the course of development
-   of the MPEG-2 NBC/MPEG-4 Audio standard ISO/IEC 13818-7, 14496-1,2 and
-   3. This software module is an implementation of a part of one or more
-   MPEG-2 NBC/MPEG-4 Audio tools as specified by the MPEG-2 NBC/MPEG-4
-   Audio standard. ISO/IEC gives users of the MPEG-2 NBC/MPEG-4 Audio
-   standards free license to this software module or modifications thereof
-   for use in hardware or software products claiming conformance to the
-   MPEG-2 NBC/MPEG-4 Audio  standards. Those intending to use this software
-   module in hardware or software products are advised that this use may
-   infringe existing patents. The original developer of this software
-   module and his/her company, the subsequent editors and their companies,
-   and ISO/IEC have no liability for use of this software module or
-   modifications thereof in an implementation. Copyright is not released
-   for non MPEG-2 NBC/MPEG-4 Audio conforming products.The original
-   developer retains full right to use the code for his/her own purpose,
-   assign or donate the code to a third party and to inhibit third party
-   from using the code for non MPEG-2 NBC/MPEG-4 Audio conforming products.
-   This copyright notice must be included in all copies or derivative
-   works."
-   Copyright(c)1996.
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef WINDOW_BLOCK_FXP_H
-#define WINDOW_BLOCK_FXP_H
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "e_window_shape.h"
-#include "e_window_sequence.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-#define LONG_WINDOW         (1024)
-#define SHORT_WINDOW        (128)
-
-#define HALF_LONG_WINDOW    (LONG_WINDOW>>1)
-#define HALF_SHORT_WINDOW   (SHORT_WINDOW>>1)
-
-#define NUM_SHORT_WINDOWS   (8)
-#define LONG_WINDOW_m_1     (LONG_WINDOW-1)
-#define SHORT_WINDOW_m_1    (SHORT_WINDOW-1)
-
-    /*
-     *  Limits for window sequences, they are used to build
-     *  each long window, they are defined in the standards
-     */
-#define W_L_START_1         ((3*LONG_WINDOW - SHORT_WINDOW)>>1)
-#define W_L_START_2         ((3*LONG_WINDOW + SHORT_WINDOW)>>1)
-#define W_L_STOP_1          ((LONG_WINDOW - SHORT_WINDOW)>>1)
-#define W_L_STOP_2          ((LONG_WINDOW + SHORT_WINDOW)>>1)
-
-
-#define LONG_BLOCK1          (2*LONG_WINDOW)
-#define SHORT_BLOCK1         (2*SHORT_WINDOW)
-
-
-#define  SCALING    10
-#define  ROUNDING     (1<<(SCALING-1))
-
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-    extern const Int16 Short_Window_KBD_fxp[ SHORT_WINDOW];
-    extern const Int16 Long_Window_KBD_fxp[ LONG_WINDOW];
-    extern const Int16 Short_Window_sine_fxp[ SHORT_WINDOW];
-    extern const Int16 Long_Window_sine_fxp[ LONG_WINDOW];
-
-    extern const Int16 * const Long_Window_fxp[];
-    extern const Int16 * const Short_Window_fxp[];
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-    void trans4m_freq_2_time_fxp(
-        Int32   Frequency_data[],
-        Int32   Time_data[],
-#ifdef AAC_PLUS
-        Int32   Output_buffer[],
-#else
-        Int16   Output_buffer[],
-#endif
-        WINDOW_SEQUENCE wnd_seq,
-        Int     wnd_shape_prev_bk,
-        Int     wnd_shape_this_bk,
-        Int     Q_format,
-        Int32   abs_max_per_window[],
-        Int32   freq_2_time_buffer[] ,
-        Int16   *Interleave_output
-    );
-
-
-
-    void trans4m_freq_2_time_fxp_1(
-        Int32   Frequency_data[],
-        Int32   Time_data[],
-        Int16   Output_buffer[],
-        WINDOW_SEQUENCE wnd_seq,
-        Int     wnd_shape_prev_bk,
-        Int     wnd_shape_this_bk,
-        Int     Q_format,
-        Int32   abs_max_per_window[],
-        Int32   freq_2_time_buffer[]
-    );
-
-
-    void trans4m_freq_2_time_fxp_2(
-        Int32   Frequency_data[],
-        Int32   Time_data[],
-        WINDOW_SEQUENCE wnd_seq,
-        Int     wnd_shape_prev_bk,
-        Int     wnd_shape_this_bk,
-        Int     Q_format,
-        Int32   abs_max_per_window[],
-        Int32   freq_2_time_buffer[] ,
-        Int16   *Interleave_output
-    );
-
-    void trans4m_time_2_freq_fxp(
-        Int32   Time2Freq_data[],
-        WINDOW_SEQUENCE wnd_seq,
-        Int     wnd_shape_prev_bk,
-        Int     wnd_shape_this_bk,
-        Int     *pQ_format,
-        Int32   mem_4_in_place_FFT[]);
-
-    /*----------------------------------------------------------------------------
-    ; END
-    ----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /*  WINDOW_BLOCK_FXP_H */
-
diff --git a/media/libstagefright/codecs/aacdec/window_tables_fxp.cpp b/media/libstagefright/codecs/aacdec/window_tables_fxp.cpp
deleted file mode 100644
index aa04225..0000000
--- a/media/libstagefright/codecs/aacdec/window_tables_fxp.cpp
+++ /dev/null
@@ -1,730 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: window_tables_fxp.c
- Funtions:
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description:
-    changed table content definition from UInt to UInt16.
-
- Description:
-    changed Long_Window_fxp and Short _Window_fxp tables definition, from
-    "const UInt16 *"  to "const UInt16 * const" to avoid global variable
-    definition.
-
- Description:
-    Improved rounding on table elements.
-
- Description: Eliminated structure to avoid assigning addresses to constant
-              tables. This solve linking problem when using the
-              /ropi option (Read-only position independent) for some
-              compilers
-              - Eliminated Long_Window_fxp and Short_Window_fxp as global
-                contants vectors
-
- Who:                       Date:
- Description:
-
-  ------------------------------------------------------------------------------
- MODULE DESCRIPTION
-
-    Window tables
-
-        For a sine table with N  points:
-
-            w_left  = sin(pi/N (n + 1/2))     for 0   =< n < N/2
-
-            w_rigth = sin(pi/N (n + 1/2))     for N/2 =< n < N
-
-
-        For Kaiser-Bessel derived (KBD)
-
-                               n             N/2
-            w_left  =  sqrt(( SUM W(p,a) )/( SUM W(p,a) )   for   0   =< n < N/2
-                              p=0            p=0
-
-
-                             N-n-1           N/2
-            w_rigth =  sqrt(( SUM W(p,a) )/( SUM W(p,a) )   for   N/2 =< n < N
-                              p=0            p=0
-
-
-            W(p,a) see ISO 14496-3, pag 113
-
-------------------------------------------------------------------------------
- REQUIREMENTS
-
-    This module shall implement the fix point verwion of the windowing tables
-
-------------------------------------------------------------------------------
- REFERENCES
-
-    [1] ISO 14496-3, pag 113
-
-------------------------------------------------------------------------------
-*/
-
-
-/*----------------------------------------------------------------------------
-; INCLUDES
-----------------------------------------------------------------------------*/
-#include "pv_audio_type_defs.h"
-#include "window_block_fxp.h"
-
-/*----------------------------------------------------------------------------
-; MACROS
-; Define module specific macros here
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; DEFINES
-; Include all pre-processor statements here. Include conditional
-; compile variables also.
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL FUNCTION DEFINITIONS
-; Function Prototype declaration
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; LOCAL VARIABLE DEFINITIONS
-; Variable declaration - defined here and used outside this module
-----------------------------------------------------------------------------*/
-
-
-/*----------------------------------------------------------------------------
-; EXTERNAL FUNCTION REFERENCES
-; Declare functions defined elsewhere and referenced in this module
-----------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-; EXTERNAL VARIABLES REFERENCES
-; Declare variables used in this module but defined elsewhere
-----------------------------------------------------------------------------*/
-
-
-const Int16 Long_Window_sine_fxp[LONG_WINDOW] =
-{
-
-
-    0x0019,  0x004B,  0x007E,  0x00B0,
-    0x00E2,  0x0114,  0x0147,  0x0179,
-    0x01AB,  0x01DD,  0x0210,  0x0242,
-    0x0274,  0x02A7,  0x02D9,  0x030B,
-    0x033D,  0x0370,  0x03A2,  0x03D4,
-    0x0406,  0x0438,  0x046B,  0x049D,
-    0x04CF,  0x0501,  0x0534,  0x0566,
-    0x0598,  0x05CA,  0x05FC,  0x062F,
-    0x0661,  0x0693,  0x06C5,  0x06F7,
-    0x072A,  0x075C,  0x078E,  0x07C0,
-    0x07F2,  0x0825,  0x0857,  0x0889,
-    0x08BB,  0x08ED,  0x091F,  0x0951,
-    0x0984,  0x09B6,  0x09E8,  0x0A1A,
-    0x0A4C,  0x0A7E,  0x0AB0,  0x0AE2,
-    0x0B14,  0x0B46,  0x0B78,  0x0BAB,
-    0x0BDD,  0x0C0F,  0x0C41,  0x0C73,
-    0x0CA5,  0x0CD7,  0x0D09,  0x0D3B,
-    0x0D6D,  0x0D9F,  0x0DD1,  0x0E03,
-    0x0E35,  0x0E67,  0x0E99,  0x0ECA,
-    0x0EFC,  0x0F2E,  0x0F60,  0x0F92,
-    0x0FC4,  0x0FF6,  0x1028,  0x105A,
-    0x108B,  0x10BD,  0x10EF,  0x1121,
-    0x1153,  0x1185,  0x11B6,  0x11E8,
-    0x121A,  0x124C,  0x127D,  0x12AF,
-    0x12E1,  0x1312,  0x1344,  0x1376,
-    0x13A8,  0x13D9,  0x140B,  0x143C,
-    0x146E,  0x14A0,  0x14D1,  0x1503,
-    0x1534,  0x1566,  0x1598,  0x15C9,
-    0x15FB,  0x162C,  0x165E,  0x168F,
-    0x16C1,  0x16F2,  0x1724,  0x1755,
-    0x1786,  0x17B8,  0x17E9,  0x181B,
-    0x184C,  0x187D,  0x18AF,  0x18E0,
-    0x1911,  0x1942,  0x1974,  0x19A5,
-    0x19D6,  0x1A07,  0x1A39,  0x1A6A,
-    0x1A9B,  0x1ACC,  0x1AFD,  0x1B2E,
-    0x1B60,  0x1B91,  0x1BC2,  0x1BF3,
-    0x1C24,  0x1C55,  0x1C86,  0x1CB7,
-    0x1CE8,  0x1D19,  0x1D4A,  0x1D7B,
-    0x1DAC,  0x1DDC,  0x1E0D,  0x1E3E,
-    0x1E6F,  0x1EA0,  0x1ED1,  0x1F01,
-    0x1F32,  0x1F63,  0x1F94,  0x1FC4,
-    0x1FF5,  0x2026,  0x2056,  0x2087,
-    0x20B7,  0x20E8,  0x2119,  0x2149,
-    0x217A,  0x21AA,  0x21DB,  0x220B,
-    0x223C,  0x226C,  0x229C,  0x22CD,
-    0x22FD,  0x232E,  0x235E,  0x238E,
-    0x23BE,  0x23EF,  0x241F,  0x244F,
-    0x247F,  0x24AF,  0x24E0,  0x2510,
-    0x2540,  0x2570,  0x25A0,  0x25D0,
-    0x2600,  0x2630,  0x2660,  0x2690,
-    0x26C0,  0x26F0,  0x2720,  0x274F,
-    0x277F,  0x27AF,  0x27DF,  0x280F,
-    0x283E,  0x286E,  0x289E,  0x28CD,
-    0x28FD,  0x292D,  0x295C,  0x298C,
-    0x29BB,  0x29EB,  0x2A1A,  0x2A4A,
-    0x2A79,  0x2AA8,  0x2AD8,  0x2B07,
-    0x2B37,  0x2B66,  0x2B95,  0x2BC4,
-    0x2BF4,  0x2C23,  0x2C52,  0x2C81,
-    0x2CB0,  0x2CDF,  0x2D0E,  0x2D3D,
-    0x2D6C,  0x2D9B,  0x2DCA,  0x2DF9,
-    0x2E28,  0x2E57,  0x2E86,  0x2EB5,
-    0x2EE3,  0x2F12,  0x2F41,  0x2F70,
-    0x2F9E,  0x2FCD,  0x2FFC,  0x302A,
-    0x3059,  0x3087,  0x30B6,  0x30E4,
-    0x3113,  0x3141,  0x316F,  0x319E,
-    0x31CC,  0x31FA,  0x3229,  0x3257,
-    0x3285,  0x32B3,  0x32E1,  0x330F,
-    0x333E,  0x336C,  0x339A,  0x33C8,
-    0x33F6,  0x3423,  0x3451,  0x347F,
-    0x34AD,  0x34DB,  0x3509,  0x3536,
-    0x3564,  0x3592,  0x35BF,  0x35ED,
-    0x361A,  0x3648,  0x3676,  0x36A3,
-    0x36D0,  0x36FE,  0x372B,  0x3759,
-    0x3786,  0x37B3,  0x37E0,  0x380E,
-    0x383B,  0x3868,  0x3895,  0x38C2,
-    0x38EF,  0x391C,  0x3949,  0x3976,
-    0x39A3,  0x39D0,  0x39FD,  0x3A29,
-    0x3A56,  0x3A83,  0x3AB0,  0x3ADC,
-    0x3B09,  0x3B35,  0x3B62,  0x3B8E,
-    0x3BBB,  0x3BE7,  0x3C14,  0x3C40,
-    0x3C6C,  0x3C99,  0x3CC5,  0x3CF1,
-    0x3D1D,  0x3D4A,  0x3D76,  0x3DA2,
-    0x3DCE,  0x3DFA,  0x3E26,  0x3E52,
-    0x3E7D,  0x3EA9,  0x3ED5,  0x3F01,
-    0x3F2D,  0x3F58,  0x3F84,  0x3FB0,
-    0x3FDB,  0x4007,  0x4032,  0x405E,
-    0x4089,  0x40B5,  0x40E0,  0x410B,
-    0x4136,  0x4162,  0x418D,  0x41B8,
-    0x41E3,  0x420E,  0x4239,  0x4264,
-    0x428F,  0x42BA,  0x42E5,  0x4310,
-    0x433B,  0x4365,  0x4390,  0x43BB,
-    0x43E5,  0x4410,  0x443B,  0x4465,
-    0x448F,  0x44BA,  0x44E4,  0x450F,
-    0x4539,  0x4563,  0x458D,  0x45B8,
-    0x45E2,  0x460C,  0x4636,  0x4660,
-    0x468A,  0x46B4,  0x46DE,  0x4707,
-    0x4731,  0x475B,  0x4785,  0x47AE,
-    0x47D8,  0x4802,  0x482B,  0x4855,
-    0x487E,  0x48A7,  0x48D1,  0x48FA,
-    0x4923,  0x494D,  0x4976,  0x499F,
-    0x49C8,  0x49F1,  0x4A1A,  0x4A43,
-    0x4A6C,  0x4A95,  0x4ABE,  0x4AE6,
-    0x4B0F,  0x4B38,  0x4B61,  0x4B89,
-    0x4BB2,  0x4BDA,  0x4C03,  0x4C2B,
-    0x4C53,  0x4C7C,  0x4CA4,  0x4CCC,
-    0x4CF4,  0x4D1D,  0x4D45,  0x4D6D,
-    0x4D95,  0x4DBD,  0x4DE5,  0x4E0D,
-    0x4E34,  0x4E5C,  0x4E84,  0x4EAB,
-    0x4ED3,  0x4EFB,  0x4F22,  0x4F4A,
-    0x4F71,  0x4F99,  0x4FC0,  0x4FE7,
-    0x500E,  0x5036,  0x505D,  0x5084,
-    0x50AB,  0x50D2,  0x50F9,  0x5120,
-    0x5147,  0x516D,  0x5194,  0x51BB,
-    0x51E2,  0x5208,  0x522F,  0x5255,
-    0x527C,  0x52A2,  0x52C8,  0x52EF,
-    0x5315,  0x533B,  0x5361,  0x5387,
-    0x53AE,  0x53D4,  0x53FA,  0x541F,
-    0x5445,  0x546B,  0x5491,  0x54B7,
-    0x54DC,  0x5502,  0x5527,  0x554D,
-    0x5572,  0x5598,  0x55BD,  0x55E2,
-    0x5608,  0x562D,  0x5652,  0x5677,
-    0x569C,  0x56C1,  0x56E6,  0x570B,
-    0x5730,  0x5754,  0x5779,  0x579E,
-    0x57C2,  0x57E7,  0x580C,  0x5830,
-    0x5854,  0x5879,  0x589D,  0x58C1,
-    0x58E5,  0x590A,  0x592E,  0x5952,
-    0x5976,  0x599A,  0x59BD,  0x59E1,
-    0x5A05,  0x5A29,  0x5A4C,  0x5A70,
-    0x5A94,  0x5AB7,  0x5ADA,  0x5AFE,
-    0x5B21,  0x5B44,  0x5B68,  0x5B8B,
-    0x5BAE,  0x5BD1,  0x5BF4,  0x5C17,
-    0x5C3A,  0x5C5D,  0x5C7F,  0x5CA2,
-    0x5CC5,  0x5CE7,  0x5D0A,  0x5D2C,
-    0x5D4F,  0x5D71,  0x5D94,  0x5DB6,
-    0x5DD8,  0x5DFA,  0x5E1C,  0x5E3E,
-    0x5E60,  0x5E82,  0x5EA4,  0x5EC6,
-    0x5EE8,  0x5F09,  0x5F2B,  0x5F4D,
-    0x5F6E,  0x5F90,  0x5FB1,  0x5FD2,
-    0x5FF4,  0x6015,  0x6036,  0x6057,
-    0x6078,  0x6099,  0x60BA,  0x60DB,
-    0x60FC,  0x611D,  0x613D,  0x615E,
-    0x617F,  0x619F,  0x61C0,  0x61E0,
-    0x6200,  0x6221,  0x6241,  0x6261,
-    0x6281,  0x62A1,  0x62C1,  0x62E1,
-    0x6301,  0x6321,  0x6341,  0x6360,
-    0x6380,  0x63A0,  0x63BF,  0x63DF,
-    0x63FE,  0x641D,  0x643D,  0x645C,
-    0x647B,  0x649A,  0x64B9,  0x64D8,
-    0x64F7,  0x6516,  0x6535,  0x6554,
-    0x6572,  0x6591,  0x65AF,  0x65CE,
-    0x65EC,  0x660B,  0x6629,  0x6647,
-    0x6666,  0x6684,  0x66A2,  0x66C0,
-    0x66DE,  0x66FC,  0x6719,  0x6737,
-    0x6755,  0x6772,  0x6790,  0x67AE,
-    0x67CB,  0x67E8,  0x6806,  0x6823,
-    0x6840,  0x685D,  0x687A,  0x6897,
-    0x68B4,  0x68D1,  0x68EE,  0x690B,
-    0x6927,  0x6944,  0x6961,  0x697D,
-    0x699A,  0x69B6,  0x69D2,  0x69EE,
-    0x6A0B,  0x6A27,  0x6A43,  0x6A5F,
-    0x6A7B,  0x6A97,  0x6AB2,  0x6ACE,
-    0x6AEA,  0x6B05,  0x6B21,  0x6B3C,
-    0x6B58,  0x6B73,  0x6B8E,  0x6BAA,
-    0x6BC5,  0x6BE0,  0x6BFB,  0x6C16,
-    0x6C31,  0x6C4C,  0x6C66,  0x6C81,
-    0x6C9C,  0x6CB6,  0x6CD1,  0x6CEB,
-    0x6D06,  0x6D20,  0x6D3A,  0x6D54,
-    0x6D6E,  0x6D88,  0x6DA2,  0x6DBC,
-    0x6DD6,  0x6DF0,  0x6E0A,  0x6E23,
-    0x6E3D,  0x6E56,  0x6E70,  0x6E89,
-    0x6EA2,  0x6EBC,  0x6ED5,  0x6EEE,
-    0x6F07,  0x6F20,  0x6F39,  0x6F52,
-    0x6F6B,  0x6F83,  0x6F9C,  0x6FB4,
-    0x6FCD,  0x6FE5,  0x6FFE,  0x7016,
-    0x702E,  0x7046,  0x705F,  0x7077,
-    0x708F,  0x70A6,  0x70BE,  0x70D6,
-    0x70EE,  0x7105,  0x711D,  0x7134,
-    0x714C,  0x7163,  0x717A,  0x7192,
-    0x71A9,  0x71C0,  0x71D7,  0x71EE,
-    0x7205,  0x721C,  0x7232,  0x7249,
-    0x7260,  0x7276,  0x728D,  0x72A3,
-    0x72B9,  0x72D0,  0x72E6,  0x72FC,
-    0x7312,  0x7328,  0x733E,  0x7354,
-    0x7369,  0x737F,  0x7395,  0x73AA,
-    0x73C0,  0x73D5,  0x73EB,  0x7400,
-    0x7415,  0x742A,  0x743F,  0x7454,
-    0x7469,  0x747E,  0x7493,  0x74A8,
-    0x74BC,  0x74D1,  0x74E5,  0x74FA,
-    0x750E,  0x7522,  0x7537,  0x754B,
-    0x755F,  0x7573,  0x7587,  0x759B,
-    0x75AE,  0x75C2,  0x75D6,  0x75E9,
-    0x75FD,  0x7610,  0x7624,  0x7637,
-    0x764A,  0x765E,  0x7671,  0x7684,
-    0x7697,  0x76A9,  0x76BC,  0x76CF,
-    0x76E2,  0x76F4,  0x7707,  0x7719,
-    0x772C,  0x773E,  0x7750,  0x7762,
-    0x7774,  0x7786,  0x7798,  0x77AA,
-    0x77BC,  0x77CE,  0x77DF,  0x77F1,
-    0x7803,  0x7814,  0x7825,  0x7837,
-    0x7848,  0x7859,  0x786A,  0x787B,
-    0x788C,  0x789D,  0x78AE,  0x78BE,
-    0x78CF,  0x78E0,  0x78F0,  0x7901,
-    0x7911,  0x7921,  0x7931,  0x7941,
-    0x7952,  0x7962,  0x7971,  0x7981,
-    0x7991,  0x79A1,  0x79B0,  0x79C0,
-    0x79CF,  0x79DF,  0x79EE,  0x79FD,
-    0x7A0D,  0x7A1C,  0x7A2B,  0x7A3A,
-    0x7A49,  0x7A57,  0x7A66,  0x7A75,
-    0x7A83,  0x7A92,  0x7AA0,  0x7AAF,
-    0x7ABD,  0x7ACB,  0x7AD9,  0x7AE7,
-    0x7AF5,  0x7B03,  0x7B11,  0x7B1F,
-    0x7B2D,  0x7B3A,  0x7B48,  0x7B55,
-    0x7B63,  0x7B70,  0x7B7D,  0x7B8B,
-    0x7B98,  0x7BA5,  0x7BB2,  0x7BBF,
-    0x7BCB,  0x7BD8,  0x7BE5,  0x7BF1,
-    0x7BFE,  0x7C0A,  0x7C17,  0x7C23,
-    0x7C2F,  0x7C3B,  0x7C47,  0x7C53,
-    0x7C5F,  0x7C6B,  0x7C77,  0x7C83,
-    0x7C8E,  0x7C9A,  0x7CA5,  0x7CB1,
-    0x7CBC,  0x7CC7,  0x7CD2,  0x7CDD,
-    0x7CE8,  0x7CF3,  0x7CFE,  0x7D09,
-    0x7D14,  0x7D1E,  0x7D29,  0x7D33,
-    0x7D3E,  0x7D48,  0x7D52,  0x7D5C,
-    0x7D67,  0x7D71,  0x7D7B,  0x7D84,
-    0x7D8E,  0x7D98,  0x7DA2,  0x7DAB,
-    0x7DB5,  0x7DBE,  0x7DC8,  0x7DD1,
-    0x7DDA,  0x7DE3,  0x7DEC,  0x7DF5,
-    0x7DFE,  0x7E07,  0x7E10,  0x7E18,
-    0x7E21,  0x7E29,  0x7E32,  0x7E3A,
-    0x7E42,  0x7E4B,  0x7E53,  0x7E5B,
-    0x7E63,  0x7E6B,  0x7E73,  0x7E7A,
-    0x7E82,  0x7E8A,  0x7E91,  0x7E99,
-    0x7EA0,  0x7EA7,  0x7EAF,  0x7EB6,
-    0x7EBD,  0x7EC4,  0x7ECB,  0x7ED2,
-    0x7ED8,  0x7EDF,  0x7EE6,  0x7EEC,
-    0x7EF3,  0x7EF9,  0x7EFF,  0x7F05,
-    0x7F0C,  0x7F12,  0x7F18,  0x7F1E,
-    0x7F23,  0x7F29,  0x7F2F,  0x7F35,
-    0x7F3A,  0x7F40,  0x7F45,  0x7F4A,
-    0x7F50,  0x7F55,  0x7F5A,  0x7F5F,
-    0x7F64,  0x7F69,  0x7F6D,  0x7F72,
-    0x7F77,  0x7F7B,  0x7F80,  0x7F84,
-    0x7F88,  0x7F8D,  0x7F91,  0x7F95,
-    0x7F99,  0x7F9D,  0x7FA1,  0x7FA4,
-    0x7FA8,  0x7FAC,  0x7FAF,  0x7FB3,
-    0x7FB6,  0x7FB9,  0x7FBD,  0x7FC0,
-    0x7FC3,  0x7FC6,  0x7FC9,  0x7FCC,
-    0x7FCE,  0x7FD1,  0x7FD4,  0x7FD6,
-    0x7FD9,  0x7FDB,  0x7FDD,  0x7FE0,
-    0x7FE2,  0x7FE4,  0x7FE6,  0x7FE8,
-    0x7FEA,  0x7FEB,  0x7FED,  0x7FEF,
-    0x7FF0,  0x7FF2,  0x7FF3,  0x7FF5,
-    0x7FF6,  0x7FF7,  0x7FF8,  0x7FF9,
-    0x7FFA,  0x7FFB,  0x7FFC,  0x7FFC,
-    0x7FFD,  0x7FFD,  0x7FFE,  0x7FFE,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF
-
-};
-
-
-const Int16 Short_Window_sine_fxp[SHORT_WINDOW] =
-{
-
-    0x00C9,  0x025B,  0x03ED,  0x057F,
-    0x0711,  0x08A2,  0x0A33,  0x0BC4,
-    0x0D54,  0x0EE3,  0x1072,  0x1201,
-    0x138F,  0x151C,  0x16A8,  0x1833,
-    0x19BE,  0x1B47,  0x1CCF,  0x1E57,
-    0x1FDD,  0x2161,  0x22E5,  0x2467,
-    0x25E8,  0x2767,  0x28E5,  0x2A61,
-    0x2BDC,  0x2D55,  0x2ECC,  0x3041,
-    0x31B5,  0x3326,  0x3496,  0x3604,
-    0x376F,  0x38D9,  0x3A40,  0x3BA5,
-    0x3D07,  0x3E68,  0x3FC5,  0x4121,
-    0x427A,  0x43D0,  0x4524,  0x4675,
-    0x47C3,  0x490F,  0x4A58,  0x4B9D,
-    0x4CE0,  0x4E20,  0x4F5D,  0x5097,
-    0x51CE,  0x5302,  0x5432,  0x5560,
-    0x568A,  0x57B0,  0x58D3,  0x59F3,
-    0x5B0F,  0x5C28,  0x5D3E,  0x5E4F,
-    0x5F5D,  0x6068,  0x616E,  0x6271,
-    0x6370,  0x646C,  0x6563,  0x6656,
-    0x6746,  0x6832,  0x6919,  0x69FD,
-    0x6ADC,  0x6BB7,  0x6C8E,  0x6D61,
-    0x6E30,  0x6EFB,  0x6FC1,  0x7083,
-    0x7140,  0x71F9,  0x72AE,  0x735E,
-    0x740A,  0x74B2,  0x7555,  0x75F3,
-    0x768D,  0x7722,  0x77B3,  0x783F,
-    0x78C7,  0x794A,  0x79C8,  0x7A41,
-    0x7AB6,  0x7B26,  0x7B91,  0x7BF8,
-    0x7C59,  0x7CB6,  0x7D0E,  0x7D62,
-    0x7DB0,  0x7DFA,  0x7E3E,  0x7E7E,
-    0x7EB9,  0x7EEF,  0x7F21,  0x7F4D,
-    0x7F74,  0x7F97,  0x7FB4,  0x7FCD,
-    0x7FE1,  0x7FF0,  0x7FF9,  0x7FFE
-};
-
-
-
-const Int16 Long_Window_KBD_fxp[LONG_WINDOW] =
-{
-
-    0x000A,  0x000E,  0x0012,  0x0015,
-    0x0019,  0x001C,  0x0020,  0x0023,
-    0x0026,  0x002A,  0x002D,  0x0030,
-    0x0034,  0x0038,  0x003B,  0x003F,
-    0x0043,  0x0047,  0x004B,  0x004F,
-    0x0053,  0x0057,  0x005B,  0x0060,
-    0x0064,  0x0069,  0x006D,  0x0072,
-    0x0077,  0x007C,  0x0081,  0x0086,
-    0x008B,  0x0091,  0x0096,  0x009C,
-    0x00A1,  0x00A7,  0x00AD,  0x00B3,
-    0x00B9,  0x00BF,  0x00C6,  0x00CC,
-    0x00D3,  0x00DA,  0x00E0,  0x00E7,
-    0x00EE,  0x00F5,  0x00FD,  0x0104,
-    0x010C,  0x0113,  0x011B,  0x0123,
-    0x012B,  0x0133,  0x013C,  0x0144,
-    0x014D,  0x0156,  0x015F,  0x0168,
-    0x0171,  0x017A,  0x0183,  0x018D,
-    0x0197,  0x01A1,  0x01AB,  0x01B5,
-    0x01BF,  0x01CA,  0x01D4,  0x01DF,
-    0x01EA,  0x01F5,  0x0200,  0x020C,
-    0x0217,  0x0223,  0x022F,  0x023B,
-    0x0247,  0x0253,  0x0260,  0x026D,
-    0x027A,  0x0287,  0x0294,  0x02A1,
-    0x02AF,  0x02BC,  0x02CA,  0x02D8,
-    0x02E7,  0x02F5,  0x0304,  0x0312,
-    0x0321,  0x0331,  0x0340,  0x034F,
-    0x035F,  0x036F,  0x037F,  0x038F,
-    0x03A0,  0x03B0,  0x03C1,  0x03D2,
-    0x03E3,  0x03F5,  0x0406,  0x0418,
-    0x042A,  0x043C,  0x044F,  0x0461,
-    0x0474,  0x0487,  0x049A,  0x04AE,
-    0x04C1,  0x04D5,  0x04E9,  0x04FD,
-    0x0512,  0x0526,  0x053B,  0x0550,
-    0x0566,  0x057B,  0x0591,  0x05A7,
-    0x05BD,  0x05D3,  0x05EA,  0x0601,
-    0x0618,  0x062F,  0x0646,  0x065E,
-    0x0676,  0x068E,  0x06A6,  0x06BF,
-    0x06D8,  0x06F1,  0x070A,  0x0723,
-    0x073D,  0x0757,  0x0771,  0x078C,
-    0x07A6,  0x07C1,  0x07DC,  0x07F7,
-    0x0813,  0x082F,  0x084B,  0x0867,
-    0x0884,  0x08A0,  0x08BD,  0x08DA,
-    0x08F8,  0x0916,  0x0933,  0x0952,
-    0x0970,  0x098F,  0x09AE,  0x09CD,
-    0x09EC,  0x0A0C,  0x0A2C,  0x0A4C,
-    0x0A6C,  0x0A8D,  0x0AAD,  0x0ACF,
-    0x0AF0,  0x0B11,  0x0B33,  0x0B55,
-    0x0B78,  0x0B9A,  0x0BBD,  0x0BE0,
-    0x0C03,  0x0C27,  0x0C4B,  0x0C6F,
-    0x0C93,  0x0CB8,  0x0CDD,  0x0D02,
-    0x0D27,  0x0D4D,  0x0D73,  0x0D99,
-    0x0DBF,  0x0DE6,  0x0E0C,  0x0E33,
-    0x0E5B,  0x0E82,  0x0EAA,  0x0ED2,
-    0x0EFB,  0x0F23,  0x0F4C,  0x0F75,
-    0x0F9F,  0x0FC8,  0x0FF2,  0x101C,
-    0x1047,  0x1071,  0x109C,  0x10C7,
-    0x10F3,  0x111E,  0x114A,  0x1176,
-    0x11A3,  0x11D0,  0x11FC,  0x122A,
-    0x1257,  0x1285,  0x12B3,  0x12E1,
-    0x130F,  0x133E,  0x136D,  0x139C,
-    0x13CB,  0x13FB,  0x142B,  0x145B,
-    0x148B,  0x14BC,  0x14ED,  0x151E,
-    0x1550,  0x1581,  0x15B3,  0x15E5,
-    0x1618,  0x164A,  0x167D,  0x16B0,
-    0x16E3,  0x1717,  0x174B,  0x177F,
-    0x17B3,  0x17E8,  0x181D,  0x1852,
-    0x1887,  0x18BC,  0x18F2,  0x1928,
-    0x195E,  0x1995,  0x19CB,  0x1A02,
-    0x1A39,  0x1A71,  0x1AA8,  0x1AE0,
-    0x1B18,  0x1B50,  0x1B89,  0x1BC1,
-    0x1BFA,  0x1C34,  0x1C6D,  0x1CA7,
-    0x1CE0,  0x1D1A,  0x1D55,  0x1D8F,
-    0x1DCA,  0x1E05,  0x1E40,  0x1E7B,
-    0x1EB7,  0x1EF2,  0x1F2E,  0x1F6B,
-    0x1FA7,  0x1FE4,  0x2020,  0x205D,
-    0x209B,  0x20D8,  0x2116,  0x2153,
-    0x2191,  0x21D0,  0x220E,  0x224D,
-    0x228B,  0x22CA,  0x2309,  0x2349,
-    0x2388,  0x23C8,  0x2408,  0x2448,
-    0x2488,  0x24C9,  0x2509,  0x254A,
-    0x258B,  0x25CC,  0x260E,  0x264F,
-    0x2691,  0x26D3,  0x2715,  0x2757,
-    0x2799,  0x27DC,  0x281F,  0x2861,
-    0x28A4,  0x28E8,  0x292B,  0x296E,
-    0x29B2,  0x29F6,  0x2A3A,  0x2A7E,
-    0x2AC2,  0x2B06,  0x2B4B,  0x2B8F,
-    0x2BD4,  0x2C19,  0x2C5E,  0x2CA3,
-    0x2CE9,  0x2D2E,  0x2D74,  0x2DB9,
-    0x2DFF,  0x2E45,  0x2E8B,  0x2ED1,
-    0x2F18,  0x2F5E,  0x2FA5,  0x2FEB,
-    0x3032,  0x3079,  0x30C0,  0x3107,
-    0x314E,  0x3195,  0x31DD,  0x3224,
-    0x326C,  0x32B4,  0x32FB,  0x3343,
-    0x338B,  0x33D3,  0x341B,  0x3463,
-    0x34AC,  0x34F4,  0x353D,  0x3585,
-    0x35CE,  0x3616,  0x365F,  0x36A8,
-    0x36F1,  0x373A,  0x3783,  0x37CC,
-    0x3815,  0x385E,  0x38A7,  0x38F0,
-    0x393A,  0x3983,  0x39CC,  0x3A16,
-    0x3A5F,  0x3AA9,  0x3AF2,  0x3B3C,
-    0x3B86,  0x3BCF,  0x3C19,  0x3C63,
-    0x3CAC,  0x3CF6,  0x3D40,  0x3D8A,
-    0x3DD3,  0x3E1D,  0x3E67,  0x3EB1,
-    0x3EFB,  0x3F45,  0x3F8E,  0x3FD8,
-    0x4022,  0x406C,  0x40B6,  0x4100,
-    0x414A,  0x4193,  0x41DD,  0x4227,
-    0x4271,  0x42BB,  0x4304,  0x434E,
-    0x4398,  0x43E1,  0x442B,  0x4475,
-    0x44BE,  0x4508,  0x4551,  0x459B,
-    0x45E4,  0x462E,  0x4677,  0x46C0,
-    0x4709,  0x4753,  0x479C,  0x47E5,
-    0x482E,  0x4877,  0x48C0,  0x4909,
-    0x4951,  0x499A,  0x49E3,  0x4A2B,
-    0x4A74,  0x4ABC,  0x4B04,  0x4B4D,
-    0x4B95,  0x4BDD,  0x4C25,  0x4C6D,
-    0x4CB5,  0x4CFC,  0x4D44,  0x4D8C,
-    0x4DD3,  0x4E1A,  0x4E62,  0x4EA9,
-    0x4EF0,  0x4F37,  0x4F7E,  0x4FC4,
-    0x500B,  0x5051,  0x5098,  0x50DE,
-    0x5124,  0x516A,  0x51B0,  0x51F6,
-    0x523B,  0x5281,  0x52C6,  0x530B,
-    0x5351,  0x5396,  0x53DA,  0x541F,
-    0x5464,  0x54A8,  0x54EC,  0x5530,
-    0x5574,  0x55B8,  0x55FC,  0x563F,
-    0x5683,  0x56C6,  0x5709,  0x574C,
-    0x578F,  0x57D1,  0x5814,  0x5856,
-    0x5898,  0x58DA,  0x591B,  0x595D,
-    0x599E,  0x59E0,  0x5A21,  0x5A61,
-    0x5AA2,  0x5AE3,  0x5B23,  0x5B63,
-    0x5BA3,  0x5BE3,  0x5C22,  0x5C62,
-    0x5CA1,  0x5CE0,  0x5D1F,  0x5D5D,
-    0x5D9C,  0x5DDA,  0x5E18,  0x5E56,
-    0x5E93,  0x5ED1,  0x5F0E,  0x5F4B,
-    0x5F87,  0x5FC4,  0x6000,  0x603D,
-    0x6079,  0x60B4,  0x60F0,  0x612B,
-    0x6166,  0x61A1,  0x61DC,  0x6216,
-    0x6250,  0x628A,  0x62C4,  0x62FE,
-    0x6337,  0x6370,  0x63A9,  0x63E2,
-    0x641A,  0x6452,  0x648A,  0x64C2,
-    0x64F9,  0x6531,  0x6568,  0x659E,
-    0x65D5,  0x660B,  0x6641,  0x6677,
-    0x66AD,  0x66E2,  0x6717,  0x674C,
-    0x6781,  0x67B5,  0x67E9,  0x681D,
-    0x6851,  0x6885,  0x68B8,  0x68EB,
-    0x691D,  0x6950,  0x6982,  0x69B4,
-    0x69E6,  0x6A17,  0x6A48,  0x6A79,
-    0x6AAA,  0x6ADB,  0x6B0B,  0x6B3B,
-    0x6B6A,  0x6B9A,  0x6BC9,  0x6BF8,
-    0x6C27,  0x6C55,  0x6C83,  0x6CB1,
-    0x6CDF,  0x6D0D,  0x6D3A,  0x6D67,
-    0x6D93,  0x6DC0,  0x6DEC,  0x6E18,
-    0x6E44,  0x6E6F,  0x6E9A,  0x6EC5,
-    0x6EF0,  0x6F1A,  0x6F44,  0x6F6E,
-    0x6F98,  0x6FC1,  0x6FEA,  0x7013,
-    0x703C,  0x7064,  0x708C,  0x70B4,
-    0x70DB,  0x7103,  0x712A,  0x7151,
-    0x7177,  0x719D,  0x71C3,  0x71E9,
-    0x720F,  0x7234,  0x7259,  0x727E,
-    0x72A2,  0x72C7,  0x72EB,  0x730E,
-    0x7332,  0x7355,  0x7378,  0x739B,
-    0x73BD,  0x73E0,  0x7402,  0x7424,
-    0x7445,  0x7466,  0x7487,  0x74A8,
-    0x74C9,  0x74E9,  0x7509,  0x7529,
-    0x7548,  0x7568,  0x7587,  0x75A5,
-    0x75C4,  0x75E2,  0x7601,  0x761E,
-    0x763C,  0x7659,  0x7676,  0x7693,
-    0x76B0,  0x76CC,  0x76E9,  0x7705,
-    0x7720,  0x773C,  0x7757,  0x7772,
-    0x778D,  0x77A8,  0x77C2,  0x77DC,
-    0x77F6,  0x780F,  0x7829,  0x7842,
-    0x785B,  0x7874,  0x788C,  0x78A5,
-    0x78BD,  0x78D5,  0x78EC,  0x7904,
-    0x791B,  0x7932,  0x7949,  0x795F,
-    0x7976,  0x798C,  0x79A2,  0x79B7,
-    0x79CD,  0x79E2,  0x79F7,  0x7A0C,
-    0x7A21,  0x7A35,  0x7A4A,  0x7A5E,
-    0x7A72,  0x7A85,  0x7A99,  0x7AAC,
-    0x7ABF,  0x7AD2,  0x7AE5,  0x7AF7,
-    0x7B09,  0x7B1B,  0x7B2D,  0x7B3F,
-    0x7B51,  0x7B62,  0x7B73,  0x7B84,
-    0x7B95,  0x7BA5,  0x7BB6,  0x7BC6,
-    0x7BD6,  0x7BE6,  0x7BF6,  0x7C05,
-    0x7C15,  0x7C24,  0x7C33,  0x7C42,
-    0x7C50,  0x7C5F,  0x7C6D,  0x7C7B,
-    0x7C89,  0x7C97,  0x7CA5,  0x7CB2,
-    0x7CC0,  0x7CCD,  0x7CDA,  0x7CE7,
-    0x7CF3,  0x7D00,  0x7D0C,  0x7D18,
-    0x7D25,  0x7D31,  0x7D3C,  0x7D48,
-    0x7D53,  0x7D5F,  0x7D6A,  0x7D75,
-    0x7D80,  0x7D8B,  0x7D95,  0x7DA0,
-    0x7DAA,  0x7DB4,  0x7DBE,  0x7DC8,
-    0x7DD2,  0x7DDC,  0x7DE5,  0x7DEF,
-    0x7DF8,  0x7E01,  0x7E0A,  0x7E13,
-    0x7E1C,  0x7E25,  0x7E2D,  0x7E36,
-    0x7E3E,  0x7E46,  0x7E4E,  0x7E56,
-    0x7E5E,  0x7E66,  0x7E6D,  0x7E75,
-    0x7E7C,  0x7E83,  0x7E8B,  0x7E92,
-    0x7E99,  0x7EA0,  0x7EA6,  0x7EAD,
-    0x7EB3,  0x7EBA,  0x7EC0,  0x7EC6,
-    0x7ECD,  0x7ED3,  0x7ED9,  0x7EDE,
-    0x7EE4,  0x7EEA,  0x7EF0,  0x7EF5,
-    0x7EFA,  0x7F00,  0x7F05,  0x7F0A,
-    0x7F0F,  0x7F14,  0x7F19,  0x7F1E,
-    0x7F23,  0x7F27,  0x7F2C,  0x7F30,
-    0x7F35,  0x7F39,  0x7F3D,  0x7F41,
-    0x7F46,  0x7F4A,  0x7F4E,  0x7F52,
-    0x7F55,  0x7F59,  0x7F5D,  0x7F60,
-    0x7F64,  0x7F68,  0x7F6B,  0x7F6E,
-    0x7F72,  0x7F75,  0x7F78,  0x7F7B,
-    0x7F7E,  0x7F81,  0x7F84,  0x7F87,
-    0x7F8A,  0x7F8D,  0x7F90,  0x7F92,
-    0x7F95,  0x7F97,  0x7F9A,  0x7F9C,
-    0x7F9F,  0x7FA1,  0x7FA4,  0x7FA6,
-    0x7FA8,  0x7FAA,  0x7FAC,  0x7FAE,
-    0x7FB1,  0x7FB3,  0x7FB5,  0x7FB6,
-    0x7FB8,  0x7FBA,  0x7FBC,  0x7FBE,
-    0x7FBF,  0x7FC1,  0x7FC3,  0x7FC4,
-    0x7FC6,  0x7FC8,  0x7FC9,  0x7FCB,
-    0x7FCC,  0x7FCD,  0x7FCF,  0x7FD0,
-    0x7FD1,  0x7FD3,  0x7FD4,  0x7FD5,
-    0x7FD6,  0x7FD8,  0x7FD9,  0x7FDA,
-    0x7FDB,  0x7FDC,  0x7FDD,  0x7FDE,
-    0x7FDF,  0x7FE0,  0x7FE1,  0x7FE2,
-    0x7FE3,  0x7FE4,  0x7FE4,  0x7FE5,
-    0x7FE6,  0x7FE7,  0x7FE8,  0x7FE8,
-    0x7FE9,  0x7FEA,  0x7FEA,  0x7FEB,
-    0x7FEC,  0x7FEC,  0x7FED,  0x7FEE,
-    0x7FEE,  0x7FEF,  0x7FEF,  0x7FF0,
-    0x7FF0,  0x7FF1,  0x7FF1,  0x7FF2,
-    0x7FF2,  0x7FF3,  0x7FF3,  0x7FF4,
-    0x7FF4,  0x7FF4,  0x7FF5,  0x7FF5,
-    0x7FF6,  0x7FF6,  0x7FF6,  0x7FF7,
-    0x7FF7,  0x7FF7,  0x7FF8,  0x7FF8,
-    0x7FF8,  0x7FF8,  0x7FF9,  0x7FF9,
-    0x7FF9,  0x7FF9,  0x7FFA,  0x7FFA,
-    0x7FFA,  0x7FFA,  0x7FFA,  0x7FFB,
-    0x7FFB,  0x7FFB,  0x7FFB,  0x7FFB,
-    0x7FFC,  0x7FFC,  0x7FFC,  0x7FFC,
-    0x7FFC,  0x7FFC,  0x7FFC,  0x7FFC,
-    0x7FFD,  0x7FFD,  0x7FFD,  0x7FFD,
-    0x7FFD,  0x7FFD,  0x7FFD,  0x7FFD,
-    0x7FFD,  0x7FFD,  0x7FFE,  0x7FFE,
-    0x7FFE,  0x7FFE,  0x7FFE,  0x7FFE,
-    0x7FFE,  0x7FFE,  0x7FFE,  0x7FFE,
-    0x7FFE,  0x7FFE,  0x7FFE,  0x7FFE,
-    0x7FFE,  0x7FFE,  0x7FFE,  0x7FFE,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF
-
-};
-
-
-
-
-const Int16 Short_Window_KBD_fxp[SHORT_WINDOW] =
-{
-
-    0x0001,  0x0004,  0x0008,  0x000D,
-    0x0014,  0x001D,  0x0029,  0x0039,
-    0x004C,  0x0063,  0x0080,  0x00A2,
-    0x00CB,  0x00FB,  0x0133,  0x0174,
-    0x01BE,  0x0214,  0x0275,  0x02E3,
-    0x035E,  0x03E8,  0x0481,  0x052B,
-    0x05E7,  0x06B4,  0x0795,  0x088A,
-    0x0993,  0x0AB2,  0x0BE7,  0x0D32,
-    0x0E94,  0x100E,  0x119F,  0x1347,
-    0x1507,  0x16DE,  0x18CC,  0x1AD0,
-    0x1CEB,  0x1F1A,  0x215F,  0x23B6,
-    0x2620,  0x289C,  0x2B27,  0x2DC0,
-    0x3066,  0x3317,  0x35D2,  0x3894,
-    0x3B5C,  0x3E28,  0x40F6,  0x43C4,
-    0x468F,  0x4956,  0x4C18,  0x4ED1,
-    0x5181,  0x5425,  0x56BC,  0x5944,
-    0x5BBB,  0x5E21,  0x6073,  0x62B1,
-    0x64DA,  0x66EC,  0x68E7,  0x6ACB,
-    0x6C96,  0x6E49,  0x6FE4,  0x7166,
-    0x72D0,  0x7421,  0x755B,  0x767E,
-    0x778A,  0x7881,  0x7962,  0x7A30,
-    0x7AEA,  0x7B92,  0x7C29,  0x7CB0,
-    0x7D28,  0x7D92,  0x7DF0,  0x7E42,
-    0x7E89,  0x7EC7,  0x7EFC,  0x7F2A,
-    0x7F50,  0x7F71,  0x7F8C,  0x7FA3,
-    0x7FB6,  0x7FC5,  0x7FD2,  0x7FDC,
-    0x7FE4,  0x7FEB,  0x7FF0,  0x7FF4,
-    0x7FF7,  0x7FF9,  0x7FFB,  0x7FFC,
-    0x7FFD,  0x7FFE,  0x7FFE,  0x7FFE,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF,
-    0x7FFF,  0x7FFF,  0x7FFF,  0x7FFF
-};
-
diff --git a/media/libstagefright/codecs/aacdec/write_output.h b/media/libstagefright/codecs/aacdec/write_output.h
deleted file mode 100644
index 0085a63..0000000
--- a/media/libstagefright/codecs/aacdec/write_output.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* ------------------------------------------------------------------
- * Copyright (C) 1998-2009 PacketVideo
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- * -------------------------------------------------------------------
- */
-/*
-
- Pathname: write_output.h
-
-------------------------------------------------------------------------------
- REVISION HISTORY
-
- Description: Change function prototype.
-
- Description: Remove CR/LF from unknown editor
-
- Who:                                       Date:
- Description:
-
-------------------------------------------------------------------------------
- INCLUDE DESCRIPTION
-
- Header file for the declaration of the function write_output()
-
-------------------------------------------------------------------------------
-*/
-
-/*----------------------------------------------------------------------------
-; CONTINUE ONLY IF NOT ALREADY DEFINED
-----------------------------------------------------------------------------*/
-#ifndef WRITE_OUTPUT_H
-#define WRITE_OUTPUT_H
-
-#include "pv_audio_type_defs.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; INCLUDES
-    ----------------------------------------------------------------------------*/
-#include "pvmp4audiodecoder_api.h"
-
-    /*----------------------------------------------------------------------------
-    ; MACROS
-    ; Define module specific macros here
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; DEFINES
-    ; Include all pre-processor statements here.
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; EXTERNAL VARIABLES REFERENCES
-    ; Declare variables used in this module but defined elsewhere
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; SIMPLE TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; ENUMERATED TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; STRUCTURES TYPEDEF'S
-    ----------------------------------------------------------------------------*/
-
-    /*----------------------------------------------------------------------------
-    ; GLOBAL FUNCTION DEFINITIONS
-    ; Function Prototype declaration
-    ----------------------------------------------------------------------------*/
-
-#ifndef AAC_PLUS
-
-    Int write_output(
-        const Int16   sourceLeft[],
-        const Int16   sourceRight[],
-        Int16   outputBuffer[],
-        const Int     sourcePointsPerChannel,
-        const Int     sourceChannels,
-        const Int     requestedChannels,
-        const tPVMP4AudioDecoderOutputFormat  outputFormat);
-
-#else
-
-    Int write_output(
-        const Int16   sourceLeft[],
-        const Int16   sourceRight[],
-        Int16   outputBuffer[],
-        const Int     sourcePointsPerChannel,
-        const Int     sourceChannels,
-        const Int     requestedChannels,
-#ifdef PARAMETRICSTEREO
-        Int32 sbrEnablePS,
-#endif
-        const tPVMP4AudioDecoderOutputFormat  outputFormat);
-
-#ifdef AAC_32_BIT_INTERFACE
-
-    Int write_output_1(
-        const Int32   sourceLeft[],
-        const Int32   sourceRight[],
-        Int16   outputBuffer[],
-        const Int     sourcePointsPerChannel,
-        const Int     sourceChannels,
-        const Int     requestedChannels,
-        const tPVMP4AudioDecoderOutputFormat  outputFormat);
-#endif
-
-#endif
-
-    /*----------------------------------------------------------------------------
-    ; END
-    ----------------------------------------------------------------------------*/
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WRITE_OUTPUT_H */
-
-
diff --git a/media/libstagefright/codecs/avc/enc/Android.mk b/media/libstagefright/codecs/avc/enc/Android.mk
index 845d1d3..cffe469 100644
--- a/media/libstagefright/codecs/avc/enc/Android.mk
+++ b/media/libstagefright/codecs/avc/enc/Android.mk
@@ -41,6 +41,7 @@
 
 LOCAL_C_INCLUDES := \
         frameworks/av/media/libstagefright/include \
+        frameworks/native/include/media/hardware \
         frameworks/native/include/media/openmax \
         $(LOCAL_PATH)/src \
         $(LOCAL_PATH)/include \
@@ -61,6 +62,7 @@
         libstagefright_foundation \
         libstagefright_omx \
         libutils \
+        libui
 
 
 LOCAL_MODULE := libstagefright_soft_h264enc
diff --git a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp
index e46463c..81ee419 100644
--- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp
+++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp
@@ -22,11 +22,15 @@
 #include "avcenc_int.h"
 #include "OMX_Video.h"
 
+#include <HardwareAPI.h>
+#include <MetadataBufferType.h>
 #include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/MediaDefs.h>
 #include <media/stagefright/MediaErrors.h>
 #include <media/stagefright/MetaData.h>
 #include <media/stagefright/Utils.h>
+#include <ui/Rect.h>
+#include <ui/GraphicBufferMapper.h>
 
 #include "SoftAVCEncoder.h"
 
@@ -174,6 +178,7 @@
       mVideoFrameRate(30),
       mVideoBitRate(192000),
       mVideoColorFormat(OMX_COLOR_FormatYUV420Planar),
+      mStoreMetaDataInBuffers(false),
       mIDRFrameRefreshIntervalInSec(1),
       mAVCEncProfile(AVC_BASELINE),
       mAVCEncLevel(AVC_LEVEL2),
@@ -451,7 +456,7 @@
                 return OMX_ErrorUndefined;
             }
 
-            if (formatParams->nIndex > 1) {
+            if (formatParams->nIndex > 2) {
                 return OMX_ErrorNoMore;
             }
 
@@ -459,8 +464,10 @@
                 formatParams->eCompressionFormat = OMX_VIDEO_CodingUnused;
                 if (formatParams->nIndex == 0) {
                     formatParams->eColorFormat = OMX_COLOR_FormatYUV420Planar;
-                } else {
+                } else if (formatParams->nIndex == 1) {
                     formatParams->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
+                } else {
+                    formatParams->eColorFormat = OMX_COLOR_FormatAndroidOpaque;
                 }
             } else {
                 formatParams->eCompressionFormat = OMX_VIDEO_CodingAVC;
@@ -532,7 +539,9 @@
 
 OMX_ERRORTYPE SoftAVCEncoder::internalSetParameter(
         OMX_INDEXTYPE index, const OMX_PTR params) {
-    switch (index) {
+    int32_t indexFull = index;
+
+    switch (indexFull) {
         case OMX_IndexParamVideoErrorCorrection:
         {
             return OMX_ErrorNotImplemented;
@@ -563,7 +572,8 @@
             if (def->nPortIndex == 0) {
                 if (def->format.video.eCompressionFormat != OMX_VIDEO_CodingUnused ||
                     (def->format.video.eColorFormat != OMX_COLOR_FormatYUV420Planar &&
-                     def->format.video.eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar)) {
+                     def->format.video.eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar &&
+                     def->format.video.eColorFormat != OMX_COLOR_FormatAndroidOpaque)) {
                     return OMX_ErrorUndefined;
                 }
             } else {
@@ -613,7 +623,7 @@
                 return OMX_ErrorUndefined;
             }
 
-            if (formatParams->nIndex > 1) {
+            if (formatParams->nIndex > 2) {
                 return OMX_ErrorNoMore;
             }
 
@@ -622,7 +632,9 @@
                     ((formatParams->nIndex == 0 &&
                       formatParams->eColorFormat != OMX_COLOR_FormatYUV420Planar) ||
                     (formatParams->nIndex == 1 &&
-                     formatParams->eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar))) {
+                     formatParams->eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar) ||
+                    (formatParams->nIndex == 2 &&
+                     formatParams->eColorFormat != OMX_COLOR_FormatAndroidOpaque) )) {
                     return OMX_ErrorUndefined;
                 }
                 mVideoColorFormat = formatParams->eColorFormat;
@@ -669,6 +681,31 @@
             return OMX_ErrorNone;
         }
 
+        case kStoreMetaDataExtensionIndex:
+        {
+            StoreMetaDataInBuffersParams *storeParams =
+                    (StoreMetaDataInBuffersParams*)params;
+            if (storeParams->nPortIndex != 0) {
+                ALOGE("%s: StoreMetadataInBuffersParams.nPortIndex not zero!",
+                        __FUNCTION__);
+                return OMX_ErrorUndefined;
+            }
+
+            mStoreMetaDataInBuffers = storeParams->bStoreMetaData;
+            ALOGV("StoreMetaDataInBuffers set to: %s",
+                    mStoreMetaDataInBuffers ? " true" : "false");
+
+            if (mStoreMetaDataInBuffers) {
+                mVideoColorFormat == OMX_COLOR_FormatYUV420SemiPlanar;
+                if (mInputFrameData == NULL) {
+                    mInputFrameData =
+                            (uint8_t *) malloc((mVideoWidth * mVideoHeight * 3 ) >> 1);
+                }
+            }
+
+            return OMX_ErrorNone;
+        }
+
         default:
             return SimpleSoftOMXComponent::internalSetParameter(index, params);
     }
@@ -747,6 +784,8 @@
             }
         }
 
+        buffer_handle_t srcBuffer; // for MetaDataMode only
+
         // Get next input video frame
         if (mReadyForNextFrame) {
             // Save the input buffer info so that it can be
@@ -767,8 +806,28 @@
                 videoInput.height = ((mVideoHeight  + 15) >> 4) << 4;
                 videoInput.pitch = ((mVideoWidth + 15) >> 4) << 4;
                 videoInput.coding_timestamp = (inHeader->nTimeStamp + 500) / 1000;  // in ms
-                const void *inData = inHeader->pBuffer + inHeader->nOffset;
-                uint8_t *inputData = (uint8_t *) inData;
+                uint8_t *inputData = NULL;
+                if (mStoreMetaDataInBuffers) {
+                    if (inHeader->nFilledLen != 8) {
+                        ALOGE("MetaData buffer is wrong size! "
+                                "(got %lu bytes, expected 8)", inHeader->nFilledLen);
+                        mSignalledError = true;
+                        notify(OMX_EventError, OMX_ErrorUndefined, 0, 0);
+                        return;
+                    }
+                    inputData =
+                            extractGrallocData(inHeader->pBuffer + inHeader->nOffset,
+                                    &srcBuffer);
+                    if (inputData == NULL) {
+                        ALOGE("Unable to extract gralloc buffer in metadata mode");
+                        mSignalledError = true;
+                        notify(OMX_EventError, OMX_ErrorUndefined, 0, 0);
+                        return;
+                    }
+                    // TODO: Verify/convert pixel format enum
+                } else {
+                    inputData = (uint8_t *)inHeader->pBuffer + inHeader->nOffset;
+                }
 
                 if (mVideoColorFormat != OMX_COLOR_FormatYUV420Planar) {
                     ConvertYUV420SemiPlanarToYUV420Planar(
@@ -793,12 +852,14 @@
                     if (encoderStatus < AVCENC_SUCCESS) {
                         ALOGE("encoderStatus = %d at line %d", encoderStatus, __LINE__);
                         mSignalledError = true;
+                        releaseGrallocData(srcBuffer);
                         notify(OMX_EventError, OMX_ErrorUndefined, 0, 0);
                         return;
                     } else {
                         ALOGV("encoderStatus = %d at line %d", encoderStatus, __LINE__);
                         inQueue.erase(inQueue.begin());
                         inInfo->mOwnedByUs = false;
+                        releaseGrallocData(srcBuffer);
                         notifyEmptyBufferDone(inHeader);
                         return;
                     }
@@ -832,6 +893,7 @@
             if (encoderStatus < AVCENC_SUCCESS) {
                 ALOGE("encoderStatus = %d at line %d", encoderStatus, __LINE__);
                 mSignalledError = true;
+                releaseGrallocData(srcBuffer);
                 notify(OMX_EventError, OMX_ErrorUndefined, 0, 0);
                 return;
             }
@@ -841,6 +903,7 @@
 
         inQueue.erase(inQueue.begin());
         inInfo->mOwnedByUs = false;
+        releaseGrallocData(srcBuffer);
         notifyEmptyBufferDone(inHeader);
 
         outQueue.erase(outQueue.begin());
@@ -884,6 +947,47 @@
     ALOGV("signalBufferReturned: %p", buffer);
 }
 
+OMX_ERRORTYPE SoftAVCEncoder::getExtensionIndex(
+        const char *name, OMX_INDEXTYPE *index) {
+    if (!strcmp(name, "OMX.google.android.index.storeMetaDataInBuffers")) {
+        *(int32_t*)index = kStoreMetaDataExtensionIndex;
+        return OMX_ErrorNone;
+    }
+    return OMX_ErrorUndefined;
+}
+
+uint8_t *SoftAVCEncoder::extractGrallocData(void *data, buffer_handle_t *buffer) {
+    OMX_U32 type = *(OMX_U32*)data;
+    status_t res;
+    if (type != kMetadataBufferTypeGrallocSource) {
+        ALOGE("Data passed in with metadata mode does not have type "
+                "kMetadataBufferTypeGrallocSource (%d), has type %ld instead",
+                kMetadataBufferTypeGrallocSource, type);
+        return NULL;
+    }
+    buffer_handle_t imgBuffer = *(buffer_handle_t*)((uint8_t*)data + 4);
+
+    const Rect rect(mVideoWidth, mVideoHeight);
+    uint8_t *img;
+    res = GraphicBufferMapper::get().lock(imgBuffer,
+            GRALLOC_USAGE_HW_VIDEO_ENCODER,
+            rect, (void**)&img);
+    if (res != OK) {
+        ALOGE("%s: Unable to lock image buffer %p for access", __FUNCTION__,
+                imgBuffer);
+        return NULL;
+    }
+
+    *buffer = imgBuffer;
+    return img;
+}
+
+void SoftAVCEncoder::releaseGrallocData(buffer_handle_t buffer) {
+    if (mStoreMetaDataInBuffers) {
+        GraphicBufferMapper::get().unlock(buffer);
+    }
+}
+
 }  // namespace android
 
 android::SoftOMXComponent *createSoftOMXComponent(
diff --git a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.h b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.h
index a2587c6..23d5ff1 100644
--- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.h
+++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.h
@@ -45,6 +45,10 @@
 
     virtual void onQueueFilled(OMX_U32 portIndex);
 
+    // Override SoftOMXComponent methods
+
+    virtual OMX_ERRORTYPE getExtensionIndex(
+            const char *name, OMX_INDEXTYPE *index);
 
     // Implement MediaBufferObserver
     virtual void signalBufferReturned(MediaBuffer *buffer);
@@ -63,6 +67,10 @@
         kNumBuffers = 2,
     };
 
+    enum {
+        kStoreMetaDataExtensionIndex = OMX_IndexVendorStartUnused + 1
+    };
+
     // OMX input buffer's timestamp and flags
     typedef struct {
         int64_t mTimeUs;
@@ -74,6 +82,7 @@
     int32_t  mVideoFrameRate;
     int32_t  mVideoBitRate;
     int32_t  mVideoColorFormat;
+    bool     mStoreMetaDataInBuffers;
     int32_t  mIDRFrameRefreshIntervalInSec;
     AVCProfile mAVCEncProfile;
     AVCLevel   mAVCEncLevel;
@@ -100,6 +109,9 @@
     OMX_ERRORTYPE releaseEncoder();
     void releaseOutputBuffers();
 
+    uint8_t* extractGrallocData(void *data, buffer_handle_t *buffer);
+    void releaseGrallocData(buffer_handle_t buffer);
+
     DISALLOW_EVIL_CONSTRUCTORS(SoftAVCEncoder);
 };
 
diff --git a/media/libstagefright/codecs/m4v_h263/enc/Android.mk b/media/libstagefright/codecs/m4v_h263/enc/Android.mk
index 484180d..865cc9c 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/Android.mk
+++ b/media/libstagefright/codecs/m4v_h263/enc/Android.mk
@@ -45,6 +45,7 @@
 LOCAL_C_INCLUDES := \
         frameworks/av/media/libstagefright/include \
         frameworks/native/include/media/openmax \
+        frameworks/native/include/media/hardware \
         $(LOCAL_PATH)/src \
         $(LOCAL_PATH)/include \
         $(LOCAL_PATH)/../common/include \
@@ -64,6 +65,7 @@
         libstagefright_foundation \
         libstagefright_omx \
         libutils \
+        libui
 
 
 LOCAL_MODULE := libstagefright_soft_mpeg4enc
diff --git a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp
index a5a2332..8bc0275 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp
+++ b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp
@@ -21,11 +21,15 @@
 #include "mp4enc_api.h"
 #include "OMX_Video.h"
 
+#include <HardwareAPI.h>
+#include <MetadataBufferType.h>
 #include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/MediaDefs.h>
 #include <media/stagefright/MediaErrors.h>
 #include <media/stagefright/MetaData.h>
 #include <media/stagefright/Utils.h>
+#include <ui/Rect.h>
+#include <ui/GraphicBufferMapper.h>
 
 #include "SoftMPEG4Encoder.h"
 
@@ -82,6 +86,7 @@
       mVideoFrameRate(30),
       mVideoBitRate(192000),
       mVideoColorFormat(OMX_COLOR_FormatYUV420Planar),
+      mStoreMetaDataInBuffers(false),
       mIDRFrameRefreshIntervalInSec(1),
       mNumInputFrames(-1),
       mStarted(false),
@@ -321,7 +326,7 @@
                 return OMX_ErrorUndefined;
             }
 
-            if (formatParams->nIndex > 1) {
+            if (formatParams->nIndex > 2) {
                 return OMX_ErrorNoMore;
             }
 
@@ -329,8 +334,10 @@
                 formatParams->eCompressionFormat = OMX_VIDEO_CodingUnused;
                 if (formatParams->nIndex == 0) {
                     formatParams->eColorFormat = OMX_COLOR_FormatYUV420Planar;
-                } else {
+                } else if (formatParams->nIndex == 1) {
                     formatParams->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
+                } else {
+                    formatParams->eColorFormat = OMX_COLOR_FormatAndroidOpaque;
                 }
             } else {
                 formatParams->eCompressionFormat =
@@ -420,7 +427,9 @@
 
 OMX_ERRORTYPE SoftMPEG4Encoder::internalSetParameter(
         OMX_INDEXTYPE index, const OMX_PTR params) {
-    switch (index) {
+    int32_t indexFull = index;
+
+    switch (indexFull) {
         case OMX_IndexParamVideoErrorCorrection:
         {
             return OMX_ErrorNotImplemented;
@@ -451,7 +460,8 @@
             if (def->nPortIndex == 0) {
                 if (def->format.video.eCompressionFormat != OMX_VIDEO_CodingUnused ||
                     (def->format.video.eColorFormat != OMX_COLOR_FormatYUV420Planar &&
-                     def->format.video.eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar)) {
+                     def->format.video.eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar &&
+                     def->format.video.eColorFormat != OMX_COLOR_FormatAndroidOpaque)) {
                     return OMX_ErrorUndefined;
                 }
             } else {
@@ -505,7 +515,7 @@
                 return OMX_ErrorUndefined;
             }
 
-            if (formatParams->nIndex > 1) {
+            if (formatParams->nIndex > 2) {
                 return OMX_ErrorNoMore;
             }
 
@@ -514,7 +524,9 @@
                     ((formatParams->nIndex == 0 &&
                       formatParams->eColorFormat != OMX_COLOR_FormatYUV420Planar) ||
                     (formatParams->nIndex == 1 &&
-                     formatParams->eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar))) {
+                     formatParams->eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar) ||
+                    (formatParams->nIndex == 2 &&
+                     formatParams->eColorFormat != OMX_COLOR_FormatAndroidOpaque) )) {
                     return OMX_ErrorUndefined;
                 }
                 mVideoColorFormat = formatParams->eColorFormat;
@@ -578,6 +590,31 @@
             return OMX_ErrorNone;
         }
 
+        case kStoreMetaDataExtensionIndex:
+        {
+            StoreMetaDataInBuffersParams *storeParams =
+                    (StoreMetaDataInBuffersParams*)params;
+            if (storeParams->nPortIndex != 0) {
+                ALOGE("%s: StoreMetadataInBuffersParams.nPortIndex not zero!",
+                        __FUNCTION__);
+                return OMX_ErrorUndefined;
+            }
+
+            mStoreMetaDataInBuffers = storeParams->bStoreMetaData;
+            ALOGV("StoreMetaDataInBuffers set to: %s",
+                    mStoreMetaDataInBuffers ? " true" : "false");
+
+            if (mStoreMetaDataInBuffers) {
+                mVideoColorFormat == OMX_COLOR_FormatYUV420SemiPlanar;
+                if (mInputFrameData == NULL) {
+                    mInputFrameData =
+                            (uint8_t *) malloc((mVideoWidth * mVideoHeight * 3 ) >> 1);
+                }
+            }
+
+            return OMX_ErrorNone;
+        }
+
         default:
             return SimpleSoftOMXComponent::internalSetParameter(index, params);
     }
@@ -640,9 +677,31 @@
             mSawInputEOS = true;
         }
 
+        buffer_handle_t srcBuffer; // for MetaDataMode only
         if (inHeader->nFilledLen > 0) {
-            const void *inData = inHeader->pBuffer + inHeader->nOffset;
-            uint8_t *inputData = (uint8_t *) inData;
+            uint8_t *inputData = NULL;
+            if (mStoreMetaDataInBuffers) {
+                if (inHeader->nFilledLen != 8) {
+                    ALOGE("MetaData buffer is wrong size! "
+                            "(got %lu bytes, expected 8)", inHeader->nFilledLen);
+                    mSignalledError = true;
+                    notify(OMX_EventError, OMX_ErrorUndefined, 0, 0);
+                    return;
+                }
+                inputData =
+                        extractGrallocData(inHeader->pBuffer + inHeader->nOffset,
+                                &srcBuffer);
+                if (inputData == NULL) {
+                    ALOGE("Unable to extract gralloc buffer in metadata mode");
+                    mSignalledError = true;
+                    notify(OMX_EventError, OMX_ErrorUndefined, 0, 0);
+                        return;
+                }
+                // TODO: Verify/convert pixel format enum
+            } else {
+                inputData = (uint8_t *)inHeader->pBuffer + inHeader->nOffset;
+            }
+
             if (mVideoColorFormat != OMX_COLOR_FormatYUV420Planar) {
                 ConvertYUV420SemiPlanarToYUV420Planar(
                     inputData, mInputFrameData, mVideoWidth, mVideoHeight);
@@ -683,6 +742,7 @@
 
         inQueue.erase(inQueue.begin());
         inInfo->mOwnedByUs = false;
+        releaseGrallocData(srcBuffer);
         notifyEmptyBufferDone(inHeader);
 
         outQueue.erase(outQueue.begin());
@@ -697,6 +757,47 @@
     }
 }
 
+OMX_ERRORTYPE SoftMPEG4Encoder::getExtensionIndex(
+        const char *name, OMX_INDEXTYPE *index) {
+    if (!strcmp(name, "OMX.google.android.index.storeMetaDataInBuffers")) {
+        *(int32_t*)index = kStoreMetaDataExtensionIndex;
+        return OMX_ErrorNone;
+    }
+    return OMX_ErrorUndefined;
+}
+
+uint8_t *SoftMPEG4Encoder::extractGrallocData(void *data, buffer_handle_t *buffer) {
+    OMX_U32 type = *(OMX_U32*)data;
+    status_t res;
+    if (type != kMetadataBufferTypeGrallocSource) {
+        ALOGE("Data passed in with metadata mode does not have type "
+                "kMetadataBufferTypeGrallocSource (%d), has type %ld instead",
+                kMetadataBufferTypeGrallocSource, type);
+        return NULL;
+    }
+    buffer_handle_t imgBuffer = *(buffer_handle_t*)((uint8_t*)data + 4);
+
+    const Rect rect(mVideoWidth, mVideoHeight);
+    uint8_t *img;
+    res = GraphicBufferMapper::get().lock(imgBuffer,
+            GRALLOC_USAGE_HW_VIDEO_ENCODER,
+            rect, (void**)&img);
+    if (res != OK) {
+        ALOGE("%s: Unable to lock image buffer %p for access", __FUNCTION__,
+                imgBuffer);
+        return NULL;
+    }
+
+    *buffer = imgBuffer;
+    return img;
+}
+
+void SoftMPEG4Encoder::releaseGrallocData(buffer_handle_t buffer) {
+    if (mStoreMetaDataInBuffers) {
+        GraphicBufferMapper::get().unlock(buffer);
+    }
+}
+
 }  // namespace android
 
 android::SoftOMXComponent *createSoftOMXComponent(
diff --git a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.h b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.h
index 3e90d54..cc4ea8f 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.h
+++ b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.h
@@ -43,6 +43,11 @@
 
     virtual void onQueueFilled(OMX_U32 portIndex);
 
+    // Override SoftOMXComponent methods
+
+    virtual OMX_ERRORTYPE getExtensionIndex(
+            const char *name, OMX_INDEXTYPE *index);
+
 protected:
     virtual ~SoftMPEG4Encoder();
 
@@ -51,6 +56,10 @@
         kNumBuffers = 2,
     };
 
+    enum {
+        kStoreMetaDataExtensionIndex = OMX_IndexVendorStartUnused + 1
+    };
+
     // OMX input buffer's timestamp and flags
     typedef struct {
         int64_t mTimeUs;
@@ -63,6 +72,7 @@
     int32_t  mVideoFrameRate;
     int32_t  mVideoBitRate;
     int32_t  mVideoColorFormat;
+    bool     mStoreMetaDataInBuffers;
     int32_t  mIDRFrameRefreshIntervalInSec;
 
     int64_t  mNumInputFrames;
@@ -80,6 +90,9 @@
     OMX_ERRORTYPE initEncoder();
     OMX_ERRORTYPE releaseEncoder();
 
+    uint8_t* extractGrallocData(void *data, buffer_handle_t *buffer);
+    void releaseGrallocData(buffer_handle_t buffer);
+
     DISALLOW_EVIL_CONSTRUCTORS(SoftMPEG4Encoder);
 };
 
diff --git a/media/libstagefright/codecs/mp3dec/SoftMP3.cpp b/media/libstagefright/codecs/mp3dec/SoftMP3.cpp
index 8f2a3aa..fb1135c 100644
--- a/media/libstagefright/codecs/mp3dec/SoftMP3.cpp
+++ b/media/libstagefright/codecs/mp3dec/SoftMP3.cpp
@@ -191,10 +191,19 @@
             inInfo->mOwnedByUs = false;
             notifyEmptyBufferDone(inHeader);
 
-            // pad the end of the stream with 529 samples, since that many samples
-            // were trimmed off the beginning when decoding started
-            outHeader->nFilledLen = kPVMP3DecoderDelay * mNumChannels * sizeof(int16_t);
-            memset(outHeader->pBuffer, 0, outHeader->nFilledLen);
+            if (!mIsFirst) {
+                // pad the end of the stream with 529 samples, since that many samples
+                // were trimmed off the beginning when decoding started
+                outHeader->nFilledLen =
+                    kPVMP3DecoderDelay * mNumChannels * sizeof(int16_t);
+
+                memset(outHeader->pBuffer, 0, outHeader->nFilledLen);
+            } else {
+                // Since we never discarded frames from the start, we won't have
+                // to add any padding at the end either.
+                outHeader->nFilledLen = 0;
+            }
+
             outHeader->nFlags = OMX_BUFFERFLAG_EOS;
 
             outQueue.erase(outQueue.begin());
@@ -260,8 +269,11 @@
             // The decoder delay is 529 samples, so trim that many samples off
             // the start of the first output buffer. This essentially makes this
             // decoder have zero delay, which the rest of the pipeline assumes.
-            outHeader->nOffset = kPVMP3DecoderDelay * mNumChannels * sizeof(int16_t);
-            outHeader->nFilledLen = mConfig->outputFrameSize * sizeof(int16_t) - outHeader->nOffset;
+            outHeader->nOffset =
+                kPVMP3DecoderDelay * mNumChannels * sizeof(int16_t);
+
+            outHeader->nFilledLen =
+                mConfig->outputFrameSize * sizeof(int16_t) - outHeader->nOffset;
         } else {
             outHeader->nOffset = 0;
             outHeader->nFilledLen = mConfig->outputFrameSize * sizeof(int16_t);
diff --git a/media/libstagefright/colorconversion/SoftwareRenderer.cpp b/media/libstagefright/colorconversion/SoftwareRenderer.cpp
index 8673bad..2704a37 100644
--- a/media/libstagefright/colorconversion/SoftwareRenderer.cpp
+++ b/media/libstagefright/colorconversion/SoftwareRenderer.cpp
@@ -141,13 +141,12 @@
         const void *data, size_t size, void *platformPrivate) {
     ANativeWindowBuffer *buf;
     int err;
-    if ((err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf)) != 0) {
+    if ((err = native_window_dequeue_buffer_and_wait(mNativeWindow.get(),
+            &buf)) != 0) {
         ALOGW("Surface::dequeueBuffer returned error %d", err);
         return;
     }
 
-    CHECK_EQ(0, mNativeWindow->lockBuffer(mNativeWindow.get(), buf));
-
     GraphicBufferMapper &mapper = GraphicBufferMapper::get();
 
     Rect bounds(mCropWidth, mCropHeight);
@@ -231,7 +230,8 @@
 
     CHECK_EQ(0, mapper.unlock(buf->handle));
 
-    if ((err = mNativeWindow->queueBuffer(mNativeWindow.get(), buf)) != 0) {
+    if ((err = mNativeWindow->queueBuffer(mNativeWindow.get(), buf,
+            -1)) != 0) {
         ALOGW("Surface::queueBuffer returned error %d", err);
     }
     buf = NULL;
diff --git a/media/libstagefright/foundation/AMessage.cpp b/media/libstagefright/foundation/AMessage.cpp
index 8b01ac6..dc42f91 100644
--- a/media/libstagefright/foundation/AMessage.cpp
+++ b/media/libstagefright/foundation/AMessage.cpp
@@ -25,6 +25,7 @@
 #include "AString.h"
 
 #include <binder/Parcel.h>
+#include <media/stagefright/foundation/hexdump.h>
 
 namespace android {
 
@@ -399,9 +400,20 @@
                         "RefBase *%s = %p", item.mName, item.u.refValue);
                 break;
             case kTypeBuffer:
-                tmp = StringPrintf(
-                        "ABuffer *%s = %p", item.mName, item.u.refValue);
+            {
+                sp<ABuffer> buffer = static_cast<ABuffer *>(item.u.refValue);
+
+                if (buffer != NULL && buffer->size() <= 64) {
+                    tmp = StringPrintf("Buffer %s = {\n", item.mName);
+                    hexdump(buffer->data(), buffer->size(), indent + 4, &tmp);
+                    appendIndent(&tmp, indent + 2);
+                    tmp.append("}");
+                } else {
+                    tmp = StringPrintf(
+                            "Buffer *%s = %p", item.mName, buffer.get());
+                }
                 break;
+            }
             case kTypeMessage:
                 tmp = StringPrintf(
                         "AMessage %s = %s",
diff --git a/media/libstagefright/foundation/hexdump.cpp b/media/libstagefright/foundation/hexdump.cpp
index 16c1ca5..a44d832 100644
--- a/media/libstagefright/foundation/hexdump.cpp
+++ b/media/libstagefright/foundation/hexdump.cpp
@@ -29,13 +29,25 @@
 
 namespace android {
 
-void hexdump(const void *_data, size_t size) {
+static void appendIndent(AString *s, int32_t indent) {
+    static const char kWhitespace[] =
+        "                                        "
+        "                                        ";
+
+    CHECK_LT((size_t)indent, sizeof(kWhitespace));
+
+    s->append(kWhitespace, indent);
+}
+
+void hexdump(const void *_data, size_t size, size_t indent, AString *appendTo) {
     const uint8_t *data = (const uint8_t *)_data;
 
     size_t offset = 0;
     while (offset < size) {
         AString line;
 
+        appendIndent(&line, indent);
+
         char tmp[32];
         sprintf(tmp, "%08lx:  ", (unsigned long)offset);
 
@@ -67,7 +79,12 @@
             }
         }
 
-        ALOGI("%s", line.c_str());
+        if (appendTo != NULL) {
+            appendTo->append(line);
+            appendTo->append("\n");
+        } else {
+            ALOGI("%s", line.c_str());
+        }
 
         offset += 16;
     }
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 0cddd2e..93d6429 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -167,11 +167,7 @@
         headers = NULL;
     }
 
-    if (!(mFlags & kFlagIncognito)) {
-        ALOGI("onConnect '%s'", url.c_str());
-    } else {
-        ALOGI("onConnect <URL suppressed>");
-    }
+    ALOGI("onConnect <URL suppressed>");
 
     mMasterURL = url;
 
diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h
index 68380a8..1422687 100644
--- a/media/libstagefright/include/AwesomePlayer.h
+++ b/media/libstagefright/include/AwesomePlayer.h
@@ -166,6 +166,7 @@
     sp<MediaSource> mVideoTrack;
     sp<MediaSource> mVideoSource;
     sp<AwesomeRenderer> mVideoRenderer;
+    bool mVideoRenderingStarted;
     bool mVideoRendererIsPreview;
 
     ssize_t mActiveAudioTrackIndex;
diff --git a/media/libstagefright/include/WVMExtractor.h b/media/libstagefright/include/WVMExtractor.h
index 2b952e2..c43c801 100644
--- a/media/libstagefright/include/WVMExtractor.h
+++ b/media/libstagefright/include/WVMExtractor.h
@@ -33,6 +33,7 @@
     virtual ~WVMLoadableExtractor() {}
 
     virtual int64_t getCachedDurationUs(status_t *finalStatus) = 0;
+    virtual status_t getEstimatedBandwidthKbps(int32_t *kbps) = 0;
     virtual void setAdaptiveStreamingMode(bool adaptive) = 0;
     virtual void setCryptoPluginMode(bool cryptoPluginMode) = 0;
     virtual void setUID(uid_t uid) = 0;
@@ -55,6 +56,9 @@
     // *finalStatus == ERROR_END_OF_STREAM
     int64_t getCachedDurationUs(status_t *finalStatus);
 
+    // Return the current estimated bandwidth
+    status_t getEstimatedBandwidthKbps(int32_t *kbps);
+
     // Set to use adaptive streaming mode by the WV component.
     // If adaptive == true, adaptive streaming mode will be used.
     // Default mode is non-adaptive streaming mode.
diff --git a/services/audioflinger/ExtendedAudioBufferProvider.h b/media/libstagefright/include/chromium_http_stub.h
similarity index 62%
copy from services/audioflinger/ExtendedAudioBufferProvider.h
copy to media/libstagefright/include/chromium_http_stub.h
index 88279b4..869d4ac 100644
--- a/services/audioflinger/ExtendedAudioBufferProvider.h
+++ b/media/libstagefright/include/chromium_http_stub.h
@@ -14,18 +14,17 @@
  * limitations under the License.
  */
 
-#ifndef ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H
-#define ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H
+#ifndef CHROMIUM_HTTP_STUB_H_
+#define CHROMIUM_HTTP_STUB_H_
 
-#include "AudioBufferProvider.h"
+#include <include/HTTPBase.h>
+#include <media/stagefright/DataSource.h>
 
 namespace android {
+extern "C" {
+HTTPBase *createChromiumHTTPDataSource(uint32_t flags);
+DataSource *createDataUriSource(const char *uri);
+}
+}
 
-class ExtendedAudioBufferProvider : public AudioBufferProvider {
-public:
-    virtual size_t  framesReady() const = 0;  // see description at AudioFlinger.h
-};
-
-}   // namespace android
-
-#endif  // ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H
+#endif
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp
index 681e321..29bc733 100644
--- a/media/libstagefright/omx/OMX.cpp
+++ b/media/libstagefright/omx/OMX.cpp
@@ -252,13 +252,16 @@
 status_t OMX::freeNode(node_id node) {
     OMXNodeInstance *instance = findInstance(node);
 
-    ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder());
-    if (index < 0) {
-        // This could conceivably happen if the observer dies at roughly the
-        // same time that a client attempts to free the node explicitly.
-        return OK;
+    {
+        Mutex::Autolock autoLock(mLock);
+        ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder());
+        if (index < 0) {
+            // This could conceivably happen if the observer dies at roughly the
+            // same time that a client attempts to free the node explicitly.
+            return OK;
+        }
+        mLiveNodes.removeItemsAt(index);
     }
-    mLiveNodes.removeItemsAt(index);
 
     instance->observer()->asBinder()->unlinkToDeath(this);
 
@@ -266,7 +269,7 @@
 
     {
         Mutex::Autolock autoLock(mLock);
-        index = mDispatchers.indexOfKey(node);
+        ssize_t index = mDispatchers.indexOfKey(node);
         CHECK(index >= 0);
         mDispatchers.removeItemsAt(index);
     }
diff --git a/media/libstagefright/omx/tests/OMXHarness.cpp b/media/libstagefright/omx/tests/OMXHarness.cpp
index fab1771..4b369ed 100644
--- a/media/libstagefright/omx/tests/OMXHarness.cpp
+++ b/media/libstagefright/omx/tests/OMXHarness.cpp
@@ -515,7 +515,10 @@
 
 static sp<MediaSource> CreateSourceForMime(const char *mime) {
     const char *url = GetURLForMime(mime);
-    CHECK(url != NULL);
+
+    if (url == NULL) {
+        return NULL;
+    }
 
     sp<MediaExtractor> extractor = CreateExtractorFromURI(url);
 
@@ -571,14 +574,22 @@
     const char *mime = GetMimeFromComponentRole(componentRole);
 
     if (!mime) {
-        ALOGI("Cannot perform seek test with this componentRole (%s)",
-             componentRole);
+        printf("  * Cannot perform seek test with this componentRole (%s)\n",
+               componentRole);
 
         return OK;
     }
 
     sp<MediaSource> source = CreateSourceForMime(mime);
 
+    if (source == NULL) {
+        printf("  * Unable to open test content for type '%s', "
+               "skipping test of componentRole %s\n",
+               mime, componentRole);
+
+        return OK;
+    }
+
     sp<MediaSource> seekSource = CreateSourceForMime(mime);
     if (source == NULL || seekSource == NULL) {
         return UNKNOWN_ERROR;
diff --git a/media/libstagefright/tests/Android.mk b/media/libstagefright/tests/Android.mk
index a1e6be7..57fff0b 100644
--- a/media/libstagefright/tests/Android.mk
+++ b/media/libstagefright/tests/Android.mk
@@ -20,9 +20,10 @@
 	libgui \
 	libmedia \
 	libstagefright \
-	libstagefright_omx \
 	libstagefright_foundation \
+	libstagefright_omx \
 	libstlport \
+	libsync \
 	libui \
 	libutils \
 
diff --git a/media/libstagefright/tests/SurfaceMediaSource_test.cpp b/media/libstagefright/tests/SurfaceMediaSource_test.cpp
index 466f521..a61d6a2 100644
--- a/media/libstagefright/tests/SurfaceMediaSource_test.cpp
+++ b/media/libstagefright/tests/SurfaceMediaSource_test.cpp
@@ -90,7 +90,7 @@
             ASSERT_EQ(NO_ERROR, mComposerClient->initCheck());
 
             mSurfaceControl = mComposerClient->createSurface(
-                    String8("Test Surface"), 0,
+                    String8("Test Surface"),
                     getSurfaceWidth(), getSurfaceHeight(),
                     PIXEL_FORMAT_RGB_888, 0);
 
@@ -509,31 +509,31 @@
 // cpu YV12 buffer
 void SurfaceMediaSourceTest::oneBufferPass(int width, int height ) {
     ANativeWindowBuffer* anb;
-    ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
+    ASSERT_EQ(NO_ERROR, native_window_dequeue_buffer_and_wait(mANW.get(), &anb));
     ASSERT_TRUE(anb != NULL);
 
-    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
-    ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(), buf->getNativeBuffer()));
 
     // Fill the buffer with the a checkerboard pattern
     uint8_t* img = NULL;
+    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
     buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
     SurfaceMediaSourceTest::fillYV12Buffer(img, width, height, buf->getStride());
     buf->unlock();
 
-    ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer()));
+    ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer(),
+            -1));
 }
 
 // Dequeuing and queuing the buffer without really filling it in.
 void SurfaceMediaSourceTest::oneBufferPassNoFill(int width, int height ) {
     ANativeWindowBuffer* anb;
-    ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
+    ASSERT_EQ(NO_ERROR, native_window_dequeue_buffer_and_wait(mANW.get(), &anb));
     ASSERT_TRUE(anb != NULL);
 
-    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
-    // ASSERT_EQ(NO_ERROR, mANW->lockBuffer(mANW.get(), buf->getNativeBuffer()));
     // We do not fill the buffer in. Just queue it back.
-    ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer()));
+    sp<GraphicBuffer> buf(new GraphicBuffer(anb, false));
+    ASSERT_EQ(NO_ERROR, mANW->queueBuffer(mANW.get(), buf->getNativeBuffer(),
+            -1));
 }
 
 // Fill a YV12 buffer with a multi-colored checkerboard pattern
@@ -652,7 +652,7 @@
     ANativeWindowBuffer* anb;
 
     // Note: make sure we get an ERROR back when dequeuing!
-    ASSERT_NE(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb));
+    ASSERT_NE(NO_ERROR, native_window_dequeue_buffer_and_wait(mANW.get(), &anb));
 }
 
 // pass multiple buffers from the native_window the SurfaceMediaSource
diff --git a/media/libstagefright/timedtext/TimedTextDriver.cpp b/media/libstagefright/timedtext/TimedTextDriver.cpp
index 42ca1f5..54ce7ac 100644
--- a/media/libstagefright/timedtext/TimedTextDriver.cpp
+++ b/media/libstagefright/timedtext/TimedTextDriver.cpp
@@ -61,7 +61,7 @@
     source = mTextSourceVector.valueFor(index);
     mPlayer->setDataSource(source);
     if (mState == UNINITIALIZED) {
-        mState = PAUSED;
+        mState = PREPARED;
     }
     mCurrentTrackIndex = index;
     return OK;
@@ -74,42 +74,47 @@
             return INVALID_OPERATION;
         case PLAYING:
             return OK;
-        case PAUSED:
+        case PREPARED:
             mPlayer->start();
-            break;
+            mState = PLAYING;
+            return OK;
+        case PAUSED:
+            mPlayer->resume();
+            mState = PLAYING;
+            return OK;
         default:
             TRESPASS();
     }
-    mState = PLAYING;
-    return OK;
+    return UNKNOWN_ERROR;
 }
 
-// TODO: Test if pause() works properly.
-// Scenario 1: start - pause - resume
-// Scenario 2: start - seek
-// Scenario 3: start - pause - seek - resume
 status_t TimedTextDriver::pause() {
     Mutex::Autolock autoLock(mLock);
+    ALOGV("%s() is called", __FUNCTION__);
     switch (mState) {
         case UNINITIALIZED:
             return INVALID_OPERATION;
         case PLAYING:
             mPlayer->pause();
-            break;
+            mState = PAUSED;
+            return OK;
+        case PREPARED:
+            return INVALID_OPERATION;
         case PAUSED:
             return OK;
         default:
             TRESPASS();
     }
-    mState = PAUSED;
-    return OK;
+    return UNKNOWN_ERROR;
 }
 
 status_t TimedTextDriver::selectTrack(size_t index) {
     status_t ret = OK;
     Mutex::Autolock autoLock(mLock);
+    ALOGV("%s() is called", __FUNCTION__);
     switch (mState) {
         case UNINITIALIZED:
+        case PREPARED:
         case PAUSED:
             ret = selectTrack_l(index);
             break;
@@ -128,21 +133,50 @@
 }
 
 status_t TimedTextDriver::unselectTrack(size_t index) {
+    Mutex::Autolock autoLock(mLock);
+    ALOGV("%s() is called", __FUNCTION__);
     if (mCurrentTrackIndex != index) {
         return INVALID_OPERATION;
     }
-    status_t err = pause();
-    if (err != OK) {
-        return err;
+    switch (mState) {
+        case UNINITIALIZED:
+            return INVALID_OPERATION;
+        case PLAYING:
+            mPlayer->pause();
+            mState = UNINITIALIZED;
+            return OK;
+        case PREPARED:
+        case PAUSED:
+            mState = UNINITIALIZED;
+            return OK;
+        default:
+            TRESPASS();
     }
-    Mutex::Autolock autoLock(mLock);
-    mState = UNINITIALIZED;
-    return OK;
+    return UNKNOWN_ERROR;
 }
 
 status_t TimedTextDriver::seekToAsync(int64_t timeUs) {
-    mPlayer->seekToAsync(timeUs);
-    return OK;
+    Mutex::Autolock autoLock(mLock);
+    ALOGV("%s() is called", __FUNCTION__);
+    switch (mState) {
+        case UNINITIALIZED:
+            return INVALID_OPERATION;
+        case PREPARED:
+            mPlayer->seekToAsync(timeUs);
+            mPlayer->pause();
+            mState = PAUSED;
+            return OK;
+        case PAUSED:
+            mPlayer->seekToAsync(timeUs);
+            mPlayer->pause();
+            return OK;
+        case PLAYING:
+            mPlayer->seekToAsync(timeUs);
+            return OK;
+        defaut:
+            TRESPASS();
+    }
+    return UNKNOWN_ERROR;
 }
 
 status_t TimedTextDriver::addInBandTextSource(
diff --git a/media/libstagefright/timedtext/TimedTextPlayer.cpp b/media/libstagefright/timedtext/TimedTextPlayer.cpp
index 9b001cc..e3bdd8a 100644
--- a/media/libstagefright/timedtext/TimedTextPlayer.cpp
+++ b/media/libstagefright/timedtext/TimedTextPlayer.cpp
@@ -18,6 +18,7 @@
 #define LOG_TAG "TimedTextPlayer"
 #include <utils/Log.h>
 
+#include <limits.h>
 #include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/foundation/AMessage.h>
 #include <media/stagefright/timedtext/TimedTextDriver.h>
@@ -30,12 +31,18 @@
 
 namespace android {
 
+// Event should be fired a bit earlier considering the processing time till
+// application actually gets the notification message.
 static const int64_t kAdjustmentProcessingTimeUs = 100000ll;
+static const int64_t kMaxDelayUs = 5000000ll;
 static const int64_t kWaitTimeUsToRetryRead = 100000ll;
+static const int64_t kInvalidTimeUs = INT_MIN;
 
 TimedTextPlayer::TimedTextPlayer(const wp<MediaPlayerBase> &listener)
     : mListener(listener),
       mSource(NULL),
+      mPendingSeekTimeUs(kInvalidTimeUs),
+      mPaused(false),
       mSendSubtitleGeneration(0) {
 }
 
@@ -48,15 +55,17 @@
 }
 
 void TimedTextPlayer::start() {
-    sp<AMessage> msg = new AMessage(kWhatSeek, id());
-    msg->setInt64("seekTimeUs", -1);
-    msg->post();
+    (new AMessage(kWhatStart, id()))->post();
 }
 
 void TimedTextPlayer::pause() {
     (new AMessage(kWhatPause, id()))->post();
 }
 
+void TimedTextPlayer::resume() {
+    (new AMessage(kWhatResume, id()))->post();
+}
+
 void TimedTextPlayer::seekToAsync(int64_t timeUs) {
     sp<AMessage> msg = new AMessage(kWhatSeek, id());
     msg->setInt64("seekTimeUs", timeUs);
@@ -72,10 +81,43 @@
 void TimedTextPlayer::onMessageReceived(const sp<AMessage> &msg) {
     switch (msg->what()) {
         case kWhatPause: {
+            mPaused = true;
+            break;
+        }
+        case kWhatResume: {
+            mPaused = false;
+            if (mPendingSeekTimeUs != kInvalidTimeUs) {
+                seekToAsync(mPendingSeekTimeUs);
+                mPendingSeekTimeUs = kInvalidTimeUs;
+            } else {
+                doRead();
+            }
+            break;
+        }
+        case kWhatStart: {
+            sp<MediaPlayerBase> listener = mListener.promote();
+            if (listener == NULL) {
+                ALOGE("Listener is NULL when kWhatStart is received.");
+                break;
+            }
+            mPaused = false;
+            mPendingSeekTimeUs = kInvalidTimeUs;
+            int32_t positionMs = 0;
+            listener->getCurrentPosition(&positionMs);
+            int64_t seekTimeUs = positionMs * 1000ll;
+
+            notifyListener();
             mSendSubtitleGeneration++;
+            doSeekAndRead(seekTimeUs);
             break;
         }
         case kWhatRetryRead: {
+            int32_t generation = -1;
+            CHECK(msg->findInt32("generation", &generation));
+            if (generation != mSendSubtitleGeneration) {
+                // Drop obsolete msg.
+                break;
+            }
             int64_t seekTimeUs;
             int seekMode;
             if (msg->findInt64("seekTimeUs", &seekTimeUs) &&
@@ -91,9 +133,11 @@
             break;
         }
         case kWhatSeek: {
-            int64_t seekTimeUs = 0;
+            int64_t seekTimeUs = kInvalidTimeUs;
+            // Clear a displayed timed text before seeking.
+            notifyListener();
             msg->findInt64("seekTimeUs", &seekTimeUs);
-            if (seekTimeUs < 0) {
+            if (seekTimeUs == kInvalidTimeUs) {
                 sp<MediaPlayerBase> listener = mListener.promote();
                 if (listener != NULL) {
                     int32_t positionMs = 0;
@@ -101,6 +145,11 @@
                     seekTimeUs = positionMs * 1000ll;
                 }
             }
+            if (mPaused) {
+                mPendingSeekTimeUs = seekTimeUs;
+                break;
+            }
+            mSendSubtitleGeneration++;
             doSeekAndRead(seekTimeUs);
             break;
         }
@@ -108,8 +157,19 @@
             int32_t generation;
             CHECK(msg->findInt32("generation", &generation));
             if (generation != mSendSubtitleGeneration) {
-              // Drop obsolete msg.
-              break;
+                // Drop obsolete msg.
+                break;
+            }
+            // If current time doesn't reach to the fire time,
+            // re-post the message with the adjusted delay time.
+            int64_t fireTimeUs = kInvalidTimeUs;
+            if (msg->findInt64("fireTimeUs", &fireTimeUs)) {
+                // TODO: check if fireTimeUs is not kInvalidTimeUs.
+                int64_t delayUs = delayUsFromCurrentTime(fireTimeUs);
+                if (delayUs > 0) {
+                    msg->post(delayUs);
+                    break;
+                }
             }
             sp<RefBase> obj;
             if (msg->findObject("subtitle", &obj)) {
@@ -162,12 +222,14 @@
     if (err == WOULD_BLOCK) {
         sp<AMessage> msg = new AMessage(kWhatRetryRead, id());
         if (options != NULL) {
-            int64_t seekTimeUs;
-            MediaSource::ReadOptions::SeekMode seekMode;
+            int64_t seekTimeUs = kInvalidTimeUs;
+            MediaSource::ReadOptions::SeekMode seekMode =
+                MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC;
             CHECK(options->getSeekTo(&seekTimeUs, &seekMode));
             msg->setInt64("seekTimeUs", seekTimeUs);
             msg->setInt32("seekMode", seekMode);
         }
+        msg->setInt32("generation", mSendSubtitleGeneration);
         msg->post(kWaitTimeUsToRetryRead);
         return;
     } else if (err != OK) {
@@ -185,49 +247,58 @@
 }
 
 void TimedTextPlayer::postTextEvent(const sp<ParcelEvent>& parcel, int64_t timeUs) {
-    sp<MediaPlayerBase> listener = mListener.promote();
-    if (listener != NULL) {
-        int64_t positionUs, delayUs;
-        int32_t positionMs = 0;
-        listener->getCurrentPosition(&positionMs);
-        positionUs = positionMs * 1000ll;
-
-        if (timeUs <= positionUs + kAdjustmentProcessingTimeUs) {
-            delayUs = 0;
-        } else {
-            delayUs = timeUs - positionUs - kAdjustmentProcessingTimeUs;
-        }
-        postTextEventDelayUs(parcel, delayUs);
+    int64_t delayUs = delayUsFromCurrentTime(timeUs);
+    sp<AMessage> msg = new AMessage(kWhatSendSubtitle, id());
+    msg->setInt32("generation", mSendSubtitleGeneration);
+    if (parcel != NULL) {
+        msg->setObject("subtitle", parcel);
     }
+    msg->setInt64("fireTimeUs", timeUs);
+    msg->post(delayUs);
 }
 
-void TimedTextPlayer::postTextEventDelayUs(const sp<ParcelEvent>& parcel, int64_t delayUs) {
+int64_t TimedTextPlayer::delayUsFromCurrentTime(int64_t fireTimeUs) {
     sp<MediaPlayerBase> listener = mListener.promote();
-    if (listener != NULL) {
-        sp<AMessage> msg = new AMessage(kWhatSendSubtitle, id());
-        msg->setInt32("generation", mSendSubtitleGeneration);
-        if (parcel != NULL) {
-            msg->setObject("subtitle", parcel);
+    if (listener == NULL) {
+        // TODO: it may be better to return kInvalidTimeUs
+        ALOGE("%s: Listener is NULL. (fireTimeUs = %lld)",
+              __FUNCTION__, fireTimeUs);
+        return 0;
+    }
+    int32_t positionMs = 0;
+    listener->getCurrentPosition(&positionMs);
+    int64_t positionUs = positionMs * 1000ll;
+
+    if (fireTimeUs <= positionUs + kAdjustmentProcessingTimeUs) {
+        return 0;
+    } else {
+        int64_t delayUs = fireTimeUs - positionUs - kAdjustmentProcessingTimeUs;
+        if (delayUs > kMaxDelayUs) {
+            return kMaxDelayUs;
         }
-        msg->post(delayUs);
+        return delayUs;
     }
 }
 
 void TimedTextPlayer::notifyError(int error) {
     sp<MediaPlayerBase> listener = mListener.promote();
-    if (listener != NULL) {
-        listener->sendEvent(MEDIA_INFO, MEDIA_INFO_TIMED_TEXT_ERROR, error);
+    if (listener == NULL) {
+        ALOGE("%s(error=%d): Listener is NULL.", __FUNCTION__, error);
+        return;
     }
+    listener->sendEvent(MEDIA_INFO, MEDIA_INFO_TIMED_TEXT_ERROR, error);
 }
 
 void TimedTextPlayer::notifyListener(const Parcel *parcel) {
     sp<MediaPlayerBase> listener = mListener.promote();
-    if (listener != NULL) {
-        if (parcel != NULL && (parcel->dataSize() > 0)) {
-            listener->sendEvent(MEDIA_TIMED_TEXT, 0, 0, parcel);
-        } else {  // send an empty timed text to clear the screen
-            listener->sendEvent(MEDIA_TIMED_TEXT);
-        }
+    if (listener == NULL) {
+        ALOGE("%s: Listener is NULL.", __FUNCTION__);
+        return;
+    }
+    if (parcel != NULL && (parcel->dataSize() > 0)) {
+        listener->sendEvent(MEDIA_TIMED_TEXT, 0, 0, parcel);
+    } else {  // send an empty timed text to clear the screen
+        listener->sendEvent(MEDIA_TIMED_TEXT);
     }
 }
 
diff --git a/media/libstagefright/timedtext/TimedTextPlayer.h b/media/libstagefright/timedtext/TimedTextPlayer.h
index b7e15f8..ec8ed25 100644
--- a/media/libstagefright/timedtext/TimedTextPlayer.h
+++ b/media/libstagefright/timedtext/TimedTextPlayer.h
@@ -40,6 +40,7 @@
 
     void start();
     void pause();
+    void resume();
     void seekToAsync(int64_t timeUs);
     void setDataSource(sp<TimedTextSource> source);
 
@@ -49,6 +50,8 @@
 private:
     enum {
         kWhatPause = 'paus',
+        kWhatResume = 'resm',
+        kWhatStart = 'strt',
         kWhatSeek = 'seek',
         kWhatRetryRead = 'read',
         kWhatSendSubtitle = 'send',
@@ -62,13 +65,15 @@
 
     wp<MediaPlayerBase> mListener;
     sp<TimedTextSource> mSource;
+    int64_t mPendingSeekTimeUs;
+    bool mPaused;
     int32_t mSendSubtitleGeneration;
 
     void doSeekAndRead(int64_t seekTimeUs);
     void doRead(MediaSource::ReadOptions* options = NULL);
     void onTextEvent();
     void postTextEvent(const sp<ParcelEvent>& parcel = NULL, int64_t timeUs = -1);
-    void postTextEventDelayUs(const sp<ParcelEvent>& parcel = NULL, int64_t delayUs = -1);
+    int64_t delayUsFromCurrentTime(int64_t fireTimeUs);
     void notifyError(int error = 0);
     void notifyListener(const Parcel *parcel = NULL);
 
diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.cpp b/media/libstagefright/timedtext/TimedTextSRTSource.cpp
index 1f5d037..eac23ba 100644
--- a/media/libstagefright/timedtext/TimedTextSRTSource.cpp
+++ b/media/libstagefright/timedtext/TimedTextSRTSource.cpp
@@ -79,6 +79,10 @@
     return OK;
 }
 
+sp<MetaData> TimedTextSRTSource::getFormat() {
+    return mMetaData;
+}
+
 status_t TimedTextSRTSource::scanFile() {
     off64_t offset = 0;
     int64_t startTimeUs;
@@ -155,18 +159,16 @@
     while (needMoreData) {
         if ((err = readNextLine(offset, &data)) != OK) {
             if (err == ERROR_END_OF_STREAM) {
-                needMoreData = false;
+                break;
             } else {
                 return err;
             }
         }
 
-        if (needMoreData) {
-            data.trim();
-            if (data.empty()) {
-                // it's an empty line used to separate two subtitles
-                needMoreData = false;
-            }
+        data.trim();
+        if (data.empty()) {
+            // it's an empty line used to separate two subtitles
+            needMoreData = false;
         }
     }
     info->textLen = *offset - info->offset;
@@ -221,35 +223,24 @@
     if (options != NULL && options->getSeekTo(&seekTimeUs, &mode)) {
         int64_t lastEndTimeUs =
                 mTextVector.valueAt(mTextVector.size() - 1).endTimeUs;
-        int64_t firstStartTimeUs = mTextVector.keyAt(0);
-        if (seekTimeUs < 0 || seekTimeUs > lastEndTimeUs) {
+        if (seekTimeUs < 0) {
             return ERROR_OUT_OF_RANGE;
-        } else if (seekTimeUs < firstStartTimeUs) {
-            mIndex = 0;
+        } else if (seekTimeUs >= lastEndTimeUs) {
+            return ERROR_END_OF_STREAM;
         } else {
             // binary search
             size_t low = 0;
             size_t high = mTextVector.size() - 1;
             size_t mid = 0;
-            int64_t currTimeUs;
 
             while (low <= high) {
                 mid = low + (high - low)/2;
-                currTimeUs = mTextVector.keyAt(mid);
-                const int64_t diffTime = currTimeUs - seekTimeUs;
-
-                if (diffTime == 0) {
+                int diff = compareExtendedRangeAndTime(mid, seekTimeUs);
+                if (diff == 0) {
                     break;
-                } else if (diffTime < 0) {
+                } else if (diff < 0) {
                     low = mid + 1;
                 } else {
-                    if ((high == mid + 1)
-                        && (seekTimeUs < mTextVector.keyAt(high))) {
-                        break;
-                    }
-                    if (mid < 1) {
-                        break;
-                    }
                     high = mid - 1;
                 }
             }
@@ -260,6 +251,7 @@
     if (mIndex >= mTextVector.size()) {
         return ERROR_END_OF_STREAM;
     }
+
     const TextInfo &info = mTextVector.valueAt(mIndex);
     *startTimeUs = mTextVector.keyAt(mIndex);
     *endTimeUs = info.endTimeUs;
@@ -289,8 +281,18 @@
     return OK;
 }
 
-sp<MetaData> TimedTextSRTSource::getFormat() {
-    return mMetaData;
+int TimedTextSRTSource::compareExtendedRangeAndTime(size_t index, int64_t timeUs) {
+    CHECK_LT(index, mTextVector.size());
+    int64_t endTimeUs = mTextVector.valueAt(index).endTimeUs;
+    int64_t startTimeUs = (index > 0) ?
+            mTextVector.valueAt(index - 1).endTimeUs : 0;
+    if (timeUs >= startTimeUs && timeUs < endTimeUs) {
+        return 0;
+    } else if (endTimeUs <= timeUs) {
+        return -1;
+    } else {
+        return 1;
+    }
 }
 
 }  // namespace android
diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.h b/media/libstagefright/timedtext/TimedTextSRTSource.h
index 9eeab39..598c200 100644
--- a/media/libstagefright/timedtext/TimedTextSRTSource.h
+++ b/media/libstagefright/timedtext/TimedTextSRTSource.h
@@ -70,6 +70,25 @@
     status_t extractAndAppendLocalDescriptions(
             int64_t timeUs, const AString &text, Parcel *parcel);
 
+    // Compares the time range of the subtitle at index to the given timeUs.
+    // The time range of the subtitle to match with given timeUs is extended to
+    // [endTimeUs of the previous subtitle, endTimeUs of current subtitle).
+    //
+    // This compare function is used to find a next subtitle when read() is
+    // called with seek options. Note that timeUs within gap ranges, such as
+    // [200, 300) in the below example, will be matched to the closest future
+    // subtitle, [300, 400).
+    //
+    // For instance, assuming there are 3 subtitles in mTextVector,
+    // 0: [100, 200)      ----> [0, 200)
+    // 1: [300, 400)      ----> [200, 400)
+    // 2: [500, 600)      ----> [400, 600)
+    // If the 'index' parameter contains 1, this function
+    // returns 0, if timeUs is in [200, 400)
+    // returns -1, if timeUs >= 400,
+    // returns 1, if timeUs < 200.
+    int compareExtendedRangeAndTime(size_t index, int64_t timeUs);
+
     DISALLOW_EVIL_CONSTRUCTORS(TimedTextSRTSource);
 };
 
diff --git a/media/libstagefright/timedtext/test/Android.mk b/media/libstagefright/timedtext/test/Android.mk
new file mode 100644
index 0000000..a5e7ba2
--- /dev/null
+++ b/media/libstagefright/timedtext/test/Android.mk
@@ -0,0 +1,27 @@
+LOCAL_PATH:= $(call my-dir)
+
+# ================================================================
+# Unit tests for libstagefright_timedtext
+# See also /development/testrunner/test_defs.xml
+# ================================================================
+
+# ================================================================
+# A test for TimedTextSRTSource
+# ================================================================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := TimedTextSRTSource_test
+
+LOCAL_MODULE_TAGS := eng tests
+
+LOCAL_SRC_FILES := TimedTextSRTSource_test.cpp
+
+LOCAL_C_INCLUDES := \
+    $(TOP)/external/expat/lib \
+    $(TOP)/frameworks/base/media/libstagefright/timedtext
+
+LOCAL_SHARED_LIBRARIES := \
+    libexpat \
+    libstagefright
+
+include $(BUILD_NATIVE_TEST)
diff --git a/media/libstagefright/timedtext/test/TimedTextSRTSource_test.cpp b/media/libstagefright/timedtext/test/TimedTextSRTSource_test.cpp
new file mode 100644
index 0000000..40e93c7
--- /dev/null
+++ b/media/libstagefright/timedtext/test/TimedTextSRTSource_test.cpp
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "TimedTextSRTSource_test"
+#include <utils/Log.h>
+
+#include <gtest/gtest.h>
+
+#include <binder/Parcel.h>
+#include <media/stagefright/foundation/AString.h>
+#include <media/stagefright/DataSource.h>
+#include <media/stagefright/MediaErrors.h>
+#include <utils/misc.h>
+
+#include <TimedTextSource.h>
+#include <TimedTextSRTSource.h>
+
+namespace android {
+namespace test {
+
+static const int kSecToUsec = 1000000;
+static const int kSecToMsec = 1000;
+static const int kMsecToUsec = 1000;
+
+/* SRT format (http://en.wikipedia.org/wiki/SubRip)
+ *   Subtitle number
+ *   Start time --> End time
+ *   Text of subtitle (one or more lines)
+ *   Blank lines
+ */
+static const char *kSRTString =
+    "1\n00:00:1,000 --> 00:00:1,500\n1\n\n"
+    "2\n00:00:2,000 --> 00:00:2,500\n2\n\n"
+    "3\n00:00:3,000 --> 00:00:3,500\n3\n\n"
+    "4\n00:00:4,000 --> 00:00:4,500\n4\n\n"
+    "5\n00:00:5,000 --> 00:00:5,500\n5\n\n"
+    // edge case : previos end time = next start time
+    "6\n00:00:5,500 --> 00:00:5,800\n6\n\n"
+    "7\n00:00:5,800 --> 00:00:6,000\n7\n\n"
+    "8\n00:00:6,000 --> 00:00:7,000\n8\n\n";
+
+class SRTDataSourceStub : public DataSource {
+public:
+    SRTDataSourceStub(const char *data, size_t size) :
+        mData(data), mSize(size) {}
+    virtual ~SRTDataSourceStub() {}
+
+    virtual status_t initCheck() const {
+        return OK;
+    }
+
+    virtual ssize_t readAt(off64_t offset, void *data, size_t size) {
+        if (offset >= mSize) return 0;
+
+        ssize_t avail = mSize - offset;
+        if (avail > size) {
+            avail = size;
+        }
+        memcpy(data, mData + offset, avail);
+        return avail;
+    }
+
+private:
+    const char *mData;
+    size_t mSize;
+};
+
+class TimedTextSRTSourceTest : public testing::Test {
+protected:
+    void SetUp() {
+        sp<DataSource> stub= new SRTDataSourceStub(
+                kSRTString,
+                strlen(kSRTString));
+        mSource = new TimedTextSRTSource(stub);
+        mSource->start();
+    }
+
+    void CheckStartTimeMs(const Parcel& parcel, int32_t timeMs) {
+        int32_t intval;
+        parcel.setDataPosition(8);
+        parcel.readInt32(&intval);
+        EXPECT_EQ(timeMs, intval);
+    }
+
+    void CheckDataEquals(const Parcel& parcel, const char* content) {
+        int32_t intval;
+        parcel.setDataPosition(16);
+        parcel.readInt32(&intval);
+        parcel.setDataPosition(24);
+        const char* data = (const char*) parcel.readInplace(intval);
+
+        int32_t content_len = strlen(content);
+        EXPECT_EQ(content_len, intval);
+        EXPECT_TRUE(strncmp(data, content, content_len) == 0);
+    }
+
+    sp<TimedTextSource> mSource;
+    int64_t startTimeUs;
+    int64_t endTimeUs;
+    Parcel parcel;
+    AString subtitle;
+    status_t err;
+};
+
+TEST_F(TimedTextSRTSourceTest, readAll) {
+    for (int i = 1; i <= 5; i++) {
+        err = mSource->read(&startTimeUs, &endTimeUs, &parcel);
+        EXPECT_EQ(OK, err);
+        CheckStartTimeMs(parcel, i * kSecToMsec);
+        subtitle = StringPrintf("%d\n\n", i);
+        CheckDataEquals(parcel, subtitle.c_str());
+    }
+    // read edge cases
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel);
+    EXPECT_EQ(OK, err);
+    CheckStartTimeMs(parcel, 5500);
+    subtitle = StringPrintf("6\n\n");
+    CheckDataEquals(parcel, subtitle.c_str());
+
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel);
+    EXPECT_EQ(OK, err);
+    CheckStartTimeMs(parcel, 5800);
+    subtitle = StringPrintf("7\n\n");
+    CheckDataEquals(parcel, subtitle.c_str());
+
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel);
+    EXPECT_EQ(OK, err);
+    CheckStartTimeMs(parcel, 6000);
+    subtitle = StringPrintf("8\n\n");
+    CheckDataEquals(parcel, subtitle.c_str());
+
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel);
+    EXPECT_EQ(ERROR_END_OF_STREAM, err);
+}
+
+TEST_F(TimedTextSRTSourceTest, seekTimeIsEarlierThanFirst) {
+    MediaSource::ReadOptions options;
+    options.setSeekTo(500, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+    EXPECT_EQ(OK, err);
+    EXPECT_EQ(1 * kSecToUsec, startTimeUs);
+    CheckStartTimeMs(parcel, 1 * kSecToMsec);
+}
+
+TEST_F(TimedTextSRTSourceTest, seekTimeIsLaterThanLast) {
+    MediaSource::ReadOptions options;
+    options.setSeekTo(7 * kSecToUsec, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+    EXPECT_EQ(ERROR_END_OF_STREAM, err);
+
+    options.setSeekTo(8 * kSecToUsec, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+    EXPECT_EQ(ERROR_END_OF_STREAM, err);
+}
+
+TEST_F(TimedTextSRTSourceTest, seekTimeIsMatched) {
+    for (int i = 1; i <= 5; i++) {
+        MediaSource::ReadOptions options;
+        options.setSeekTo(i * kSecToUsec, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+        err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+        EXPECT_EQ(OK, err);
+        EXPECT_EQ(i * kSecToUsec, startTimeUs);
+
+        options.setSeekTo(i * kSecToUsec + 100, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+        err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+        EXPECT_EQ(OK, err);
+        EXPECT_EQ(i * kSecToUsec, startTimeUs);
+    }
+}
+
+TEST_F(TimedTextSRTSourceTest, seekTimeInBetweenTwo) {
+    for (int i = 1; i <= 4; i++) {
+        MediaSource::ReadOptions options;
+        options.setSeekTo(i * kSecToUsec + 500000, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+        err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+        EXPECT_EQ(OK, err);
+        EXPECT_EQ((i + 1) * kSecToUsec, startTimeUs);
+
+        options.setSeekTo(i * kSecToUsec + 600000, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+        err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+        EXPECT_EQ(OK, err);
+        EXPECT_EQ((i + 1) * kSecToUsec, startTimeUs);
+    }
+}
+
+TEST_F(TimedTextSRTSourceTest, checkEdgeCase) {
+    MediaSource::ReadOptions options;
+    options.setSeekTo(5500 * kMsecToUsec, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+    EXPECT_EQ(OK, err);
+    EXPECT_EQ(5500 * kMsecToUsec, startTimeUs);
+    subtitle = StringPrintf("6\n\n");
+    CheckDataEquals(parcel, subtitle.c_str());
+
+    options.setSeekTo(5800 * kMsecToUsec, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+    EXPECT_EQ(OK, err);
+    EXPECT_EQ(5800 * kMsecToUsec, startTimeUs);
+    subtitle = StringPrintf("7\n\n");
+    CheckDataEquals(parcel, subtitle.c_str());
+
+    options.setSeekTo(6000 * kMsecToUsec, MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
+    err = mSource->read(&startTimeUs, &endTimeUs, &parcel, &options);
+    EXPECT_EQ(OK, err);
+    EXPECT_EQ(6000 * kMsecToUsec, startTimeUs);
+    subtitle = StringPrintf("8\n\n");
+    CheckDataEquals(parcel, subtitle.c_str());
+}
+
+}  // namespace test
+}  // namespace android
diff --git a/media/libstagefright/wifi-display/ANetworkSession.cpp b/media/libstagefright/wifi-display/ANetworkSession.cpp
new file mode 100644
index 0000000..4ddd778
--- /dev/null
+++ b/media/libstagefright/wifi-display/ANetworkSession.cpp
@@ -0,0 +1,1002 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "NetworkSession"
+#include <utils/Log.h>
+
+#include "ANetworkSession.h"
+#include "ParsedMessage.h"
+
+#include <arpa/inet.h>
+#include <fcntl.h>
+#include <net/if.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/foundation/hexdump.h>
+#include <media/stagefright/Utils.h>
+
+namespace android {
+
+static const size_t kMaxUDPSize = 1500;
+
+struct ANetworkSession::NetworkThread : public Thread {
+    NetworkThread(ANetworkSession *session);
+
+protected:
+    virtual ~NetworkThread();
+
+private:
+    ANetworkSession *mSession;
+
+    virtual bool threadLoop();
+
+    DISALLOW_EVIL_CONSTRUCTORS(NetworkThread);
+};
+
+struct ANetworkSession::Session : public RefBase {
+    enum State {
+        CONNECTING,
+        CONNECTED,
+        LISTENING,
+        DATAGRAM,
+    };
+
+    Session(int32_t sessionID,
+            State state,
+            int s,
+            const sp<AMessage> &notify);
+
+    int32_t sessionID() const;
+    int socket() const;
+    sp<AMessage> getNotificationMessage() const;
+
+    bool isListening() const;
+
+    bool wantsToRead();
+    bool wantsToWrite();
+
+    status_t readMore();
+    status_t writeMore();
+
+    status_t sendRequest(const void *data, ssize_t size);
+
+protected:
+    virtual ~Session();
+
+private:
+    int32_t mSessionID;
+    State mState;
+    int mSocket;
+    sp<AMessage> mNotify;
+    bool mSawReceiveFailure, mSawSendFailure;
+
+    AString mOutBuffer;
+    List<size_t> mOutBufferSizes;
+
+    AString mInBuffer;
+
+    void notifyError(bool send, status_t err, const char *detail);
+    void notify(NotificationReason reason);
+
+    DISALLOW_EVIL_CONSTRUCTORS(Session);
+};
+////////////////////////////////////////////////////////////////////////////////
+
+ANetworkSession::NetworkThread::NetworkThread(ANetworkSession *session)
+    : mSession(session) {
+}
+
+ANetworkSession::NetworkThread::~NetworkThread() {
+}
+
+bool ANetworkSession::NetworkThread::threadLoop() {
+    mSession->threadLoop();
+
+    return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+ANetworkSession::Session::Session(
+        int32_t sessionID,
+        State state,
+        int s,
+        const sp<AMessage> &notify)
+    : mSessionID(sessionID),
+      mState(state),
+      mSocket(s),
+      mNotify(notify),
+      mSawReceiveFailure(false),
+      mSawSendFailure(false) {
+    if (mState == CONNECTED) {
+        struct sockaddr_in localAddr;
+        socklen_t localAddrLen = sizeof(localAddr);
+
+        int res = getsockname(
+                mSocket, (struct sockaddr *)&localAddr, &localAddrLen);
+        CHECK_GE(res, 0);
+
+        struct sockaddr_in remoteAddr;
+        socklen_t remoteAddrLen = sizeof(remoteAddr);
+
+        res = getpeername(
+                mSocket, (struct sockaddr *)&remoteAddr, &remoteAddrLen);
+        CHECK_GE(res, 0);
+
+        in_addr_t addr = ntohl(localAddr.sin_addr.s_addr);
+        AString localAddrString = StringPrintf(
+                "%d.%d.%d.%d",
+                (addr >> 24),
+                (addr >> 16) & 0xff,
+                (addr >> 8) & 0xff,
+                addr & 0xff);
+
+        addr = ntohl(remoteAddr.sin_addr.s_addr);
+        AString remoteAddrString = StringPrintf(
+                "%d.%d.%d.%d",
+                (addr >> 24),
+                (addr >> 16) & 0xff,
+                (addr >> 8) & 0xff,
+                addr & 0xff);
+
+        sp<AMessage> msg = mNotify->dup();
+        msg->setInt32("sessionID", mSessionID);
+        msg->setInt32("reason", kWhatClientConnected);
+        msg->setString("server-ip", localAddrString.c_str());
+        msg->setInt32("server-port", ntohs(localAddr.sin_port));
+        msg->setString("client-ip", remoteAddrString.c_str());
+        msg->setInt32("client-port", ntohs(remoteAddr.sin_port));
+        msg->post();
+    }
+}
+
+ANetworkSession::Session::~Session() {
+    ALOGI("Session %d gone", mSessionID);
+
+    close(mSocket);
+    mSocket = -1;
+}
+
+int32_t ANetworkSession::Session::sessionID() const {
+    return mSessionID;
+}
+
+int ANetworkSession::Session::socket() const {
+    return mSocket;
+}
+
+sp<AMessage> ANetworkSession::Session::getNotificationMessage() const {
+    return mNotify;
+}
+
+bool ANetworkSession::Session::isListening() const {
+    return mState == LISTENING;
+}
+
+bool ANetworkSession::Session::wantsToRead() {
+    return !mSawReceiveFailure && mState != CONNECTING;
+}
+
+bool ANetworkSession::Session::wantsToWrite() {
+    return !mSawSendFailure
+        && (mState == CONNECTING
+            || ((mState == CONNECTED || mState == DATAGRAM)
+                    && !mOutBuffer.empty()));
+}
+
+status_t ANetworkSession::Session::readMore() {
+    if (mState == DATAGRAM) {
+        status_t err;
+        do {
+            sp<ABuffer> buf = new ABuffer(kMaxUDPSize);
+
+            struct sockaddr_in remoteAddr;
+            socklen_t remoteAddrLen = sizeof(remoteAddr);
+
+            ssize_t n;
+            do {
+                n = recvfrom(
+                        mSocket, buf->data(), buf->capacity(), 0,
+                        (struct sockaddr *)&remoteAddr, &remoteAddrLen);
+            } while (n < 0 && errno == EINTR);
+
+            err = OK;
+            if (n < 0) {
+                err = -errno;
+            } else if (n == 0) {
+                err = -ECONNRESET;
+            } else {
+                buf->setRange(0, n);
+
+                int64_t nowUs = ALooper::GetNowUs();
+                buf->meta()->setInt64("arrivalTimeUs", nowUs);
+
+                sp<AMessage> notify = mNotify->dup();
+                notify->setInt32("sessionID", mSessionID);
+                notify->setInt32("reason", kWhatDatagram);
+
+                uint32_t ip = ntohl(remoteAddr.sin_addr.s_addr);
+                notify->setString(
+                        "fromAddr",
+                        StringPrintf(
+                            "%u.%u.%u.%u",
+                            ip >> 24,
+                            (ip >> 16) & 0xff,
+                            (ip >> 8) & 0xff,
+                            ip & 0xff).c_str());
+
+                notify->setInt32("fromPort", ntohs(remoteAddr.sin_port));
+
+                notify->setBuffer("data", buf);
+                notify->post();
+            }
+        } while (err == OK);
+
+        if (err == -EAGAIN) {
+            err = OK;
+        }
+
+        if (err != OK) {
+            notifyError(false /* send */, err, "Recvfrom failed.");
+            mSawReceiveFailure = true;
+        }
+
+        return err;
+    }
+
+    char tmp[512];
+    ssize_t n;
+    do {
+        n = recv(mSocket, tmp, sizeof(tmp), 0);
+    } while (n < 0 && errno == EINTR);
+
+    status_t err = OK;
+
+    if (n > 0) {
+        mInBuffer.append(tmp, n);
+
+#if 0
+        ALOGI("in:");
+        hexdump(tmp, n);
+#endif
+    } else if (n < 0) {
+        err = -errno;
+    } else {
+        err = -ECONNRESET;
+    }
+
+    for (;;) {
+        size_t length;
+
+        if (mInBuffer.size() > 0 && mInBuffer.c_str()[0] == '$') {
+            if (mInBuffer.size() < 4) {
+                break;
+            }
+
+            length = U16_AT((const uint8_t *)mInBuffer.c_str() + 2);
+
+            if (mInBuffer.size() < 4 + length) {
+                break;
+            }
+
+            sp<AMessage> notify = mNotify->dup();
+            notify->setInt32("sessionID", mSessionID);
+            notify->setInt32("reason", kWhatBinaryData);
+            notify->setInt32("channel", mInBuffer.c_str()[1]);
+
+            sp<ABuffer> data = new ABuffer(length);
+            memcpy(data->data(), mInBuffer.c_str() + 4, length);
+
+            int64_t nowUs = ALooper::GetNowUs();
+            data->meta()->setInt64("arrivalTimeUs", nowUs);
+
+            notify->setBuffer("data", data);
+            notify->post();
+
+            mInBuffer.erase(0, 4 + length);
+            continue;
+        }
+
+        sp<ParsedMessage> msg =
+            ParsedMessage::Parse(
+                    mInBuffer.c_str(), mInBuffer.size(), err != OK, &length);
+
+        if (msg == NULL) {
+            break;
+        }
+
+        sp<AMessage> notify = mNotify->dup();
+        notify->setInt32("sessionID", mSessionID);
+        notify->setInt32("reason", kWhatData);
+        notify->setObject("data", msg);
+        notify->post();
+
+#if 1
+        // XXX The dongle sends the wrong content length header on a
+        // SET_PARAMETER request that signals a "wfd_idr_request".
+        // (17 instead of 19).
+        const char *content = msg->getContent();
+        if (content && !memcmp(content, "wfd_idr_request\r\n", 17)) {
+            length += 2;
+        }
+#endif
+
+        mInBuffer.erase(0, length);
+
+        if (err != OK) {
+            break;
+        }
+    }
+
+    if (err != OK) {
+        notifyError(false /* send */, err, "Recv failed.");
+        mSawReceiveFailure = true;
+    }
+
+    return err;
+}
+
+status_t ANetworkSession::Session::writeMore() {
+    if (mState == DATAGRAM) {
+        CHECK(!mOutBufferSizes.empty());
+
+        status_t err;
+        do {
+            size_t size = *mOutBufferSizes.begin();
+
+            CHECK_GE(mOutBuffer.size(), size);
+
+            int n;
+            do {
+                n = send(mSocket, mOutBuffer.c_str(), size, 0);
+            } while (n < 0 && errno == EINTR);
+
+            err = OK;
+
+            if (n > 0) {
+                mOutBufferSizes.erase(mOutBufferSizes.begin());
+                mOutBuffer.erase(0, n);
+            } else if (n < 0) {
+                err = -errno;
+            } else if (n == 0) {
+                err = -ECONNRESET;
+            }
+        } while (err == OK && !mOutBufferSizes.empty());
+
+        if (err == -EAGAIN) {
+            err = OK;
+        }
+
+        if (err != OK) {
+            notifyError(true /* send */, err, "Send datagram failed.");
+            mSawSendFailure = true;
+        }
+
+        return err;
+    }
+
+    if (mState == CONNECTING) {
+        int err;
+        socklen_t optionLen = sizeof(err);
+        CHECK_EQ(getsockopt(mSocket, SOL_SOCKET, SO_ERROR, &err, &optionLen), 0);
+        CHECK_EQ(optionLen, (socklen_t)sizeof(err));
+
+        if (err != 0) {
+            notifyError(kWhatError, -err, "Connection failed");
+            mSawSendFailure = true;
+
+            return UNKNOWN_ERROR;
+        }
+
+        mState = CONNECTED;
+        notify(kWhatConnected);
+
+        return OK;
+    }
+
+    CHECK_EQ(mState, CONNECTED);
+    CHECK(!mOutBuffer.empty());
+
+    ssize_t n;
+    do {
+        n = send(mSocket, mOutBuffer.c_str(), mOutBuffer.size(), 0);
+    } while (n < 0 && errno == EINTR);
+
+    status_t err = OK;
+
+    if (n > 0) {
+        ALOGI("out:");
+        hexdump(mOutBuffer.c_str(), n);
+
+        mOutBuffer.erase(0, n);
+    } else if (n < 0) {
+        err = -errno;
+    } else if (n == 0) {
+        err = -ECONNRESET;
+    }
+
+    if (err != OK) {
+        notifyError(true /* send */, err, "Send failed.");
+        mSawSendFailure = true;
+    }
+
+    return err;
+}
+
+status_t ANetworkSession::Session::sendRequest(const void *data, ssize_t size) {
+    CHECK(mState == CONNECTED || mState == DATAGRAM);
+
+    mOutBuffer.append(
+            (const char *)data,
+            (size >= 0) ? size : strlen((const char *)data));
+
+    if (mState == DATAGRAM) {
+        CHECK_GE(size, 0);
+        mOutBufferSizes.push_back(size);
+    }
+
+    return OK;
+}
+
+void ANetworkSession::Session::notifyError(
+        bool send, status_t err, const char *detail) {
+    sp<AMessage> msg = mNotify->dup();
+    msg->setInt32("sessionID", mSessionID);
+    msg->setInt32("reason", kWhatError);
+    msg->setInt32("send", send);
+    msg->setInt32("err", err);
+    msg->setString("detail", detail);
+    msg->post();
+}
+
+void ANetworkSession::Session::notify(NotificationReason reason) {
+    sp<AMessage> msg = mNotify->dup();
+    msg->setInt32("sessionID", mSessionID);
+    msg->setInt32("reason", reason);
+    msg->post();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+ANetworkSession::ANetworkSession()
+    : mNextSessionID(1) {
+    mPipeFd[0] = mPipeFd[1] = -1;
+}
+
+ANetworkSession::~ANetworkSession() {
+    stop();
+}
+
+status_t ANetworkSession::start() {
+    if (mThread != NULL) {
+        return INVALID_OPERATION;
+    }
+
+    int res = pipe(mPipeFd);
+    if (res != 0) {
+        mPipeFd[0] = mPipeFd[1] = -1;
+        return -errno;
+    }
+
+    mThread = new NetworkThread(this);
+
+    status_t err = mThread->run("ANetworkSession", ANDROID_PRIORITY_AUDIO);
+
+    if (err != OK) {
+        mThread.clear();
+
+        close(mPipeFd[0]);
+        close(mPipeFd[1]);
+        mPipeFd[0] = mPipeFd[1] = -1;
+
+        return err;
+    }
+
+    return OK;
+}
+
+status_t ANetworkSession::stop() {
+    if (mThread == NULL) {
+        return INVALID_OPERATION;
+    }
+
+    mThread->requestExit();
+    interrupt();
+    mThread->requestExitAndWait();
+
+    mThread.clear();
+
+    close(mPipeFd[0]);
+    close(mPipeFd[1]);
+    mPipeFd[0] = mPipeFd[1] = -1;
+
+    return OK;
+}
+
+status_t ANetworkSession::createRTSPClient(
+        const char *host, unsigned port, const sp<AMessage> &notify,
+        int32_t *sessionID) {
+    return createClientOrServer(
+            kModeCreateRTSPClient,
+            NULL /* addr */,
+            0 /* port */,
+            host,
+            port,
+            notify,
+            sessionID);
+}
+
+status_t ANetworkSession::createRTSPServer(
+        const struct in_addr &addr, unsigned port,
+        const sp<AMessage> &notify, int32_t *sessionID) {
+    return createClientOrServer(
+            kModeCreateRTSPServer,
+            &addr,
+            port,
+            NULL /* remoteHost */,
+            0 /* remotePort */,
+            notify,
+            sessionID);
+}
+
+status_t ANetworkSession::createUDPSession(
+        unsigned localPort, const sp<AMessage> &notify, int32_t *sessionID) {
+    return createUDPSession(localPort, NULL, 0, notify, sessionID);
+}
+
+status_t ANetworkSession::createUDPSession(
+        unsigned localPort,
+        const char *remoteHost,
+        unsigned remotePort,
+        const sp<AMessage> &notify,
+        int32_t *sessionID) {
+    return createClientOrServer(
+            kModeCreateUDPSession,
+            NULL /* addr */,
+            localPort,
+            remoteHost,
+            remotePort,
+            notify,
+            sessionID);
+}
+
+status_t ANetworkSession::destroySession(int32_t sessionID) {
+    Mutex::Autolock autoLock(mLock);
+
+    ssize_t index = mSessions.indexOfKey(sessionID);
+
+    if (index < 0) {
+        return -ENOENT;
+    }
+
+    mSessions.removeItemsAt(index);
+
+    interrupt();
+
+    return OK;
+}
+
+// static
+status_t ANetworkSession::MakeSocketNonBlocking(int s) {
+    int flags = fcntl(s, F_GETFL, 0);
+    if (flags < 0) {
+        flags = 0;
+    }
+
+    int res = fcntl(s, F_SETFL, flags | O_NONBLOCK);
+    if (res < 0) {
+        return -errno;
+    }
+
+    return OK;
+}
+
+status_t ANetworkSession::createClientOrServer(
+        Mode mode,
+        const struct in_addr *localAddr,
+        unsigned port,
+        const char *remoteHost,
+        unsigned remotePort,
+        const sp<AMessage> &notify,
+        int32_t *sessionID) {
+    Mutex::Autolock autoLock(mLock);
+
+    *sessionID = 0;
+    status_t err = OK;
+    int s, res;
+    sp<Session> session;
+
+    s = socket(
+            AF_INET,
+            (mode == kModeCreateUDPSession) ? SOCK_DGRAM : SOCK_STREAM,
+            0);
+
+    if (s < 0) {
+        err = -errno;
+        goto bail;
+    }
+
+    if (mode == kModeCreateRTSPServer) {
+        const int yes = 1;
+        res = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));
+
+        if (res < 0) {
+            err = -errno;
+            goto bail2;
+        }
+    }
+
+    if (mode == kModeCreateUDPSession) {
+        int size = 256 * 1024;
+
+        res = setsockopt(s, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
+
+        if (res < 0) {
+            err = -errno;
+            goto bail2;
+        }
+
+        res = setsockopt(s, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size));
+
+        if (res < 0) {
+            err = -errno;
+            goto bail2;
+        }
+    }
+
+    err = MakeSocketNonBlocking(s);
+
+    if (err != OK) {
+        goto bail2;
+    }
+
+    struct sockaddr_in addr;
+    memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
+    addr.sin_family = AF_INET;
+
+    if (mode == kModeCreateRTSPClient) {
+        struct hostent *ent= gethostbyname(remoteHost);
+        if (ent == NULL) {
+            err = -h_errno;
+            goto bail2;
+        }
+
+        addr.sin_addr.s_addr = *(in_addr_t *)ent->h_addr;
+        addr.sin_port = htons(remotePort);
+    } else if (localAddr != NULL) {
+        addr.sin_addr = *localAddr;
+        addr.sin_port = htons(port);
+    } else {
+        addr.sin_addr.s_addr = htonl(INADDR_ANY);
+        addr.sin_port = htons(port);
+    }
+
+    if (mode == kModeCreateRTSPClient) {
+        res = connect(s, (const struct sockaddr *)&addr, sizeof(addr));
+
+        CHECK_LT(res, 0);
+        if (errno == EINPROGRESS) {
+            res = 0;
+        }
+    } else {
+        res = bind(s, (const struct sockaddr *)&addr, sizeof(addr));
+
+        if (res == 0) {
+            if (mode == kModeCreateRTSPServer) {
+                res = listen(s, 4);
+            } else {
+                CHECK_EQ(mode, kModeCreateUDPSession);
+
+                if (remoteHost != NULL) {
+                    struct sockaddr_in remoteAddr;
+                    memset(remoteAddr.sin_zero, 0, sizeof(remoteAddr.sin_zero));
+                    remoteAddr.sin_family = AF_INET;
+                    remoteAddr.sin_port = htons(remotePort);
+
+                    struct hostent *ent= gethostbyname(remoteHost);
+                    if (ent == NULL) {
+                        err = -h_errno;
+                        goto bail2;
+                    }
+
+                    remoteAddr.sin_addr.s_addr = *(in_addr_t *)ent->h_addr;
+
+                    res = connect(
+                            s,
+                            (const struct sockaddr *)&remoteAddr,
+                            sizeof(remoteAddr));
+                }
+            }
+        }
+    }
+
+    if (res < 0) {
+        err = -errno;
+        goto bail2;
+    }
+
+    Session::State state;
+    switch (mode) {
+        case kModeCreateRTSPClient:
+            state = Session::CONNECTING;
+            break;
+
+        case kModeCreateRTSPServer:
+            state = Session::LISTENING;
+            break;
+
+        default:
+            CHECK_EQ(mode, kModeCreateUDPSession);
+            state = Session::DATAGRAM;
+            break;
+    }
+
+    session = new Session(
+            mNextSessionID++,
+            state,
+            s,
+            notify);
+
+    mSessions.add(session->sessionID(), session);
+
+    interrupt();
+
+    *sessionID = session->sessionID();
+
+    goto bail;
+
+bail2:
+    close(s);
+    s = -1;
+
+bail:
+    return err;
+}
+
+status_t ANetworkSession::connectUDPSession(
+        int32_t sessionID, const char *remoteHost, unsigned remotePort) {
+    Mutex::Autolock autoLock(mLock);
+
+    ssize_t index = mSessions.indexOfKey(sessionID);
+
+    if (index < 0) {
+        return -ENOENT;
+    }
+
+    const sp<Session> session = mSessions.valueAt(index);
+    int s = session->socket();
+
+    struct sockaddr_in remoteAddr;
+    memset(remoteAddr.sin_zero, 0, sizeof(remoteAddr.sin_zero));
+    remoteAddr.sin_family = AF_INET;
+    remoteAddr.sin_port = htons(remotePort);
+
+    status_t err = OK;
+    struct hostent *ent= gethostbyname(remoteHost);
+    if (ent == NULL) {
+        err = -h_errno;
+    } else {
+        remoteAddr.sin_addr.s_addr = *(in_addr_t *)ent->h_addr;
+
+        int res = connect(
+                s,
+                (const struct sockaddr *)&remoteAddr,
+                sizeof(remoteAddr));
+
+        if (res < 0) {
+            err = -errno;
+        }
+    }
+
+    return err;
+}
+
+status_t ANetworkSession::sendRequest(
+        int32_t sessionID, const void *data, ssize_t size) {
+    Mutex::Autolock autoLock(mLock);
+
+    ssize_t index = mSessions.indexOfKey(sessionID);
+
+    if (index < 0) {
+        return -ENOENT;
+    }
+
+    const sp<Session> session = mSessions.valueAt(index);
+
+    status_t err = session->sendRequest(data, size);
+
+    interrupt();
+
+    return err;
+}
+
+void ANetworkSession::interrupt() {
+    static const char dummy = 0;
+
+    ssize_t n;
+    do {
+        n = write(mPipeFd[1], &dummy, 1);
+    } while (n < 0 && errno == EINTR);
+
+    if (n < 0) {
+        ALOGW("Error writing to pipe (%s)", strerror(errno));
+    }
+}
+
+void ANetworkSession::threadLoop() {
+    fd_set rs, ws;
+    FD_ZERO(&rs);
+    FD_ZERO(&ws);
+
+    FD_SET(mPipeFd[0], &rs);
+    int maxFd = mPipeFd[0];
+
+    {
+        Mutex::Autolock autoLock(mLock);
+
+        for (size_t i = 0; i < mSessions.size(); ++i) {
+            const sp<Session> &session = mSessions.valueAt(i);
+
+            int s = session->socket();
+
+            if (s < 0) {
+                continue;
+            }
+
+            if (session->wantsToRead()) {
+                FD_SET(s, &rs);
+                if (s > maxFd) {
+                    maxFd = s;
+                }
+            }
+
+            if (session->wantsToWrite()) {
+                FD_SET(s, &ws);
+                if (s > maxFd) {
+                    maxFd = s;
+                }
+            }
+        }
+    }
+
+    int res = select(maxFd + 1, &rs, &ws, NULL, NULL /* tv */);
+
+    if (res == 0) {
+        return;
+    }
+
+    if (res < 0) {
+        if (errno == EINTR) {
+            return;
+        }
+
+        ALOGE("select failed w/ error %d (%s)", errno, strerror(errno));
+        return;
+    }
+
+    if (FD_ISSET(mPipeFd[0], &rs)) {
+        char c;
+        ssize_t n;
+        do {
+            n = read(mPipeFd[0], &c, 1);
+        } while (n < 0 && errno == EINTR);
+
+        if (n < 0) {
+            ALOGW("Error reading from pipe (%s)", strerror(errno));
+        }
+
+        --res;
+    }
+
+    {
+        Mutex::Autolock autoLock(mLock);
+
+        List<sp<Session> > sessionsToAdd;
+
+        for (size_t i = mSessions.size(); res > 0 && i-- > 0;) {
+            const sp<Session> &session = mSessions.valueAt(i);
+
+            int s = session->socket();
+
+            if (s < 0) {
+                continue;
+            }
+
+            if (FD_ISSET(s, &rs) || FD_ISSET(s, &ws)) {
+                --res;
+            }
+
+            if (FD_ISSET(s, &rs)) {
+                if (session->isListening()) {
+                    struct sockaddr_in remoteAddr;
+                    socklen_t remoteAddrLen = sizeof(remoteAddr);
+
+                    int clientSocket = accept(
+                            s, (struct sockaddr *)&remoteAddr, &remoteAddrLen);
+
+                    if (clientSocket >= 0) {
+                        status_t err = MakeSocketNonBlocking(clientSocket);
+
+                        if (err != OK) {
+                            ALOGE("Unable to make client socket non blocking, "
+                                  "failed w/ error %d (%s)",
+                                  err, strerror(-err));
+
+                            close(clientSocket);
+                            clientSocket = -1;
+                        } else {
+                            in_addr_t addr = ntohl(remoteAddr.sin_addr.s_addr);
+
+                            ALOGI("incoming connection from %d.%d.%d.%d:%d "
+                                  "(socket %d)",
+                                  (addr >> 24),
+                                  (addr >> 16) & 0xff,
+                                  (addr >> 8) & 0xff,
+                                  addr & 0xff,
+                                  ntohs(remoteAddr.sin_port),
+                                  clientSocket);
+
+                            sp<Session> clientSession =
+                                // using socket sd as sessionID
+                                new Session(
+                                        mNextSessionID++,
+                                        Session::CONNECTED,
+                                        clientSocket,
+                                        session->getNotificationMessage());
+
+                            sessionsToAdd.push_back(clientSession);
+                        }
+                    } else {
+                        ALOGE("accept returned error %d (%s)",
+                              errno, strerror(errno));
+                    }
+                } else {
+                    status_t err = session->readMore();
+                    if (err != OK) {
+                        ALOGI("readMore on socket %d failed w/ error %d (%s)",
+                              s, err, strerror(-err));
+                    }
+                }
+            }
+
+            if (FD_ISSET(s, &ws)) {
+                status_t err = session->writeMore();
+                if (err != OK) {
+                    ALOGI("writeMore on socket %d failed w/ error %d (%s)",
+                          s, err, strerror(-err));
+                }
+            }
+        }
+
+        while (!sessionsToAdd.empty()) {
+            sp<Session> session = *sessionsToAdd.begin();
+            sessionsToAdd.erase(sessionsToAdd.begin());
+
+            mSessions.add(session->sessionID(), session);
+
+            ALOGI("added clientSession %d", session->sessionID());
+        }
+    }
+}
+
+}  // namespace android
+
diff --git a/media/libstagefright/wifi-display/ANetworkSession.h b/media/libstagefright/wifi-display/ANetworkSession.h
new file mode 100644
index 0000000..8d961ee
--- /dev/null
+++ b/media/libstagefright/wifi-display/ANetworkSession.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef A_NETWORK_SESSION_H_
+
+#define A_NETWORK_SESSION_H_
+
+#include <media/stagefright/foundation/ABase.h>
+#include <utils/KeyedVector.h>
+#include <utils/RefBase.h>
+#include <utils/Thread.h>
+
+#include <netinet/in.h>
+
+namespace android {
+
+struct AMessage;
+
+// Helper class to manage a number of live sockets (datagram and stream-based)
+// on a single thread. Clients are notified about activity through AMessages.
+struct ANetworkSession : public RefBase {
+    ANetworkSession();
+
+    status_t start();
+    status_t stop();
+
+    status_t createRTSPClient(
+            const char *host, unsigned port, const sp<AMessage> &notify,
+            int32_t *sessionID);
+
+    status_t createRTSPServer(
+            const struct in_addr &addr, unsigned port,
+            const sp<AMessage> &notify, int32_t *sessionID);
+
+    status_t createUDPSession(
+            unsigned localPort, const sp<AMessage> &notify, int32_t *sessionID);
+
+    status_t createUDPSession(
+            unsigned localPort,
+            const char *remoteHost,
+            unsigned remotePort,
+            const sp<AMessage> &notify,
+            int32_t *sessionID);
+
+    status_t connectUDPSession(
+            int32_t sessionID, const char *remoteHost, unsigned remotePort);
+
+    status_t destroySession(int32_t sessionID);
+
+    status_t sendRequest(
+            int32_t sessionID, const void *data, ssize_t size = -1);
+
+    enum NotificationReason {
+        kWhatError,
+        kWhatConnected,
+        kWhatClientConnected,
+        kWhatData,
+        kWhatDatagram,
+        kWhatBinaryData,
+    };
+
+protected:
+    virtual ~ANetworkSession();
+
+private:
+    struct NetworkThread;
+    struct Session;
+
+    Mutex mLock;
+    sp<Thread> mThread;
+
+    int32_t mNextSessionID;
+
+    int mPipeFd[2];
+
+    KeyedVector<int32_t, sp<Session> > mSessions;
+
+    enum Mode {
+        kModeCreateUDPSession,
+        kModeCreateRTSPServer,
+        kModeCreateRTSPClient,
+    };
+    status_t createClientOrServer(
+            Mode mode,
+            const struct in_addr *addr,
+            unsigned port,
+            const char *remoteHost,
+            unsigned remotePort,
+            const sp<AMessage> &notify,
+            int32_t *sessionID);
+
+    void threadLoop();
+    void interrupt();
+
+    static status_t MakeSocketNonBlocking(int s);
+
+    DISALLOW_EVIL_CONSTRUCTORS(ANetworkSession);
+};
+
+}  // namespace android
+
+#endif  // A_NETWORK_SESSION_H_
diff --git a/media/libstagefright/wifi-display/Android.mk b/media/libstagefright/wifi-display/Android.mk
new file mode 100644
index 0000000..b035a51
--- /dev/null
+++ b/media/libstagefright/wifi-display/Android.mk
@@ -0,0 +1,78 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+        ANetworkSession.cpp             \
+        ParsedMessage.cpp               \
+        source/Converter.cpp            \
+        source/PlaybackSession.cpp      \
+        source/RepeaterSource.cpp       \
+        source/Serializer.cpp           \
+        source/TSPacketizer.cpp         \
+        source/WifiDisplaySource.cpp    \
+
+LOCAL_C_INCLUDES:= \
+        $(TOP)/frameworks/av/media/libstagefright \
+        $(TOP)/frameworks/native/include/media/openmax \
+        $(TOP)/frameworks/av/media/libstagefright/mpeg2ts \
+
+LOCAL_SHARED_LIBRARIES:= \
+        libbinder                       \
+        libcutils                       \
+        libgui                          \
+        libmedia                        \
+        libstagefright                  \
+        libstagefright_foundation       \
+        libui                           \
+        libutils                        \
+
+LOCAL_MODULE:= libstagefright_wfd
+
+LOCAL_MODULE_TAGS:= optional
+
+include $(BUILD_SHARED_LIBRARY)
+
+################################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+        wfd.cpp                 \
+
+LOCAL_SHARED_LIBRARIES:= \
+        libbinder                       \
+        libgui                          \
+        libmedia                        \
+        libstagefright                  \
+        libstagefright_foundation       \
+        libstagefright_wfd              \
+        libutils                        \
+
+LOCAL_MODULE:= wfd
+
+LOCAL_MODULE_TAGS := debug
+
+include $(BUILD_EXECUTABLE)
+
+################################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+        udptest.cpp                 \
+
+LOCAL_SHARED_LIBRARIES:= \
+        libbinder                       \
+        libgui                          \
+        libmedia                        \
+        libstagefright                  \
+        libstagefright_foundation       \
+        libstagefright_wfd              \
+        libutils                        \
+
+LOCAL_MODULE:= udptest
+
+LOCAL_MODULE_TAGS := debug
+
+include $(BUILD_EXECUTABLE)
diff --git a/media/libstagefright/wifi-display/ParsedMessage.cpp b/media/libstagefright/wifi-display/ParsedMessage.cpp
new file mode 100644
index 0000000..c0e60c3
--- /dev/null
+++ b/media/libstagefright/wifi-display/ParsedMessage.cpp
@@ -0,0 +1,284 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ParsedMessage.h"
+
+#include <ctype.h>
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+
+namespace android {
+
+// static
+sp<ParsedMessage> ParsedMessage::Parse(
+        const char *data, size_t size, bool noMoreData, size_t *length) {
+    sp<ParsedMessage> msg = new ParsedMessage;
+    ssize_t res = msg->parse(data, size, noMoreData);
+
+    if (res < 0) {
+        *length = 0;
+        return NULL;
+    }
+
+    *length = res;
+    return msg;
+}
+
+ParsedMessage::ParsedMessage() {
+}
+
+ParsedMessage::~ParsedMessage() {
+}
+
+bool ParsedMessage::findString(const char *name, AString *value) const {
+    AString key = name;
+    key.tolower();
+
+    ssize_t index = mDict.indexOfKey(key);
+
+    if (index < 0) {
+        value->clear();
+
+        return false;
+    }
+
+    *value = mDict.valueAt(index);
+    return true;
+}
+
+bool ParsedMessage::findInt32(const char *name, int32_t *value) const {
+    AString stringValue;
+
+    if (!findString(name, &stringValue)) {
+        return false;
+    }
+
+    char *end;
+    *value = strtol(stringValue.c_str(), &end, 10);
+
+    if (end == stringValue.c_str() || *end != '\0') {
+        *value = 0;
+        return false;
+    }
+
+    return true;
+}
+
+const char *ParsedMessage::getContent() const {
+    return mContent.c_str();
+}
+
+ssize_t ParsedMessage::parse(const char *data, size_t size, bool noMoreData) {
+    if (size == 0) {
+        return -1;
+    }
+
+    ssize_t lastDictIndex = -1;
+
+    size_t offset = 0;
+    while (offset < size) {
+        size_t lineEndOffset = offset;
+        while (lineEndOffset + 1 < size
+                && (data[lineEndOffset] != '\r'
+                        || data[lineEndOffset + 1] != '\n')) {
+            ++lineEndOffset;
+        }
+
+        if (lineEndOffset + 1 >= size) {
+            return -1;
+        }
+
+        AString line(&data[offset], lineEndOffset - offset);
+
+        if (offset == 0) {
+            // Special handling for the request/status line.
+
+            mDict.add(AString("_"), line);
+            offset = lineEndOffset + 2;
+
+            continue;
+        }
+
+        if (lineEndOffset == offset) {
+            offset += 2;
+            break;
+        }
+
+        if (line.c_str()[0] == ' ' || line.c_str()[0] == '\t') {
+            // Support for folded header values.
+
+            if (lastDictIndex >= 0) {
+                // Otherwise it's malformed since the first header line
+                // cannot continue anything...
+
+                AString &value = mDict.editValueAt(lastDictIndex);
+                value.append(line);
+            }
+
+            offset = lineEndOffset + 2;
+            continue;
+        }
+
+        ssize_t colonPos = line.find(":");
+        if (colonPos >= 0) {
+            AString key(line, 0, colonPos);
+            key.trim();
+            key.tolower();
+
+            line.erase(0, colonPos + 1);
+
+            lastDictIndex = mDict.add(key, line);
+        }
+
+        offset = lineEndOffset + 2;
+    }
+
+    for (size_t i = 0; i < mDict.size(); ++i) {
+        mDict.editValueAt(i).trim();
+    }
+
+    // Found the end of headers.
+
+    int32_t contentLength;
+    if (!findInt32("content-length", &contentLength) || contentLength < 0) {
+        contentLength = 0;
+    }
+
+    size_t totalLength = offset + contentLength;
+
+    if (size < totalLength) {
+        return -1;
+    }
+
+    mContent.setTo(&data[offset], contentLength);
+
+    return totalLength;
+}
+
+void ParsedMessage::getRequestField(size_t index, AString *field) const {
+    AString line;
+    CHECK(findString("_", &line));
+
+    size_t prevOffset = 0;
+    size_t offset = 0;
+    for (size_t i = 0; i <= index; ++i) {
+        ssize_t spacePos = line.find(" ", offset);
+
+        if (spacePos < 0) {
+            spacePos = line.size();
+        }
+
+        prevOffset = offset;
+        offset = spacePos + 1;
+    }
+
+    field->setTo(line, prevOffset, offset - prevOffset - 1);
+}
+
+bool ParsedMessage::getStatusCode(int32_t *statusCode) const {
+    AString statusCodeString;
+    getRequestField(1, &statusCodeString);
+
+    char *end;
+    *statusCode = strtol(statusCodeString.c_str(), &end, 10);
+
+    if (*end != '\0' || end == statusCodeString.c_str()
+            || (*statusCode) < 100 || (*statusCode) > 999) {
+        *statusCode = 0;
+        return false;
+    }
+
+    return true;
+}
+
+AString ParsedMessage::debugString() const {
+    AString line;
+    CHECK(findString("_", &line));
+
+    line.append("\n");
+
+    for (size_t i = 0; i < mDict.size(); ++i) {
+        const AString &key = mDict.keyAt(i);
+        const AString &value = mDict.valueAt(i);
+
+        if (key == AString("_")) {
+            continue;
+        }
+
+        line.append(key);
+        line.append(": ");
+        line.append(value);
+        line.append("\n");
+    }
+
+    line.append("\n");
+    line.append(mContent);
+
+    return line;
+}
+
+// static
+bool ParsedMessage::GetAttribute(
+        const char *s, const char *key, AString *value) {
+    value->clear();
+
+    size_t keyLen = strlen(key);
+
+    for (;;) {
+        while (isspace(*s)) {
+            ++s;
+        }
+
+        const char *colonPos = strchr(s, ';');
+
+        size_t len =
+            (colonPos == NULL) ? strlen(s) : colonPos - s;
+
+        if (len >= keyLen + 1 && s[keyLen] == '=' && !strncmp(s, key, keyLen)) {
+            value->setTo(&s[keyLen + 1], len - keyLen - 1);
+            return true;
+        }
+
+        if (colonPos == NULL) {
+            return false;
+        }
+
+        s = colonPos + 1;
+    }
+}
+
+// static
+bool ParsedMessage::GetInt32Attribute(
+        const char *s, const char *key, int32_t *value) {
+    AString stringValue;
+    if (!GetAttribute(s, key, &stringValue)) {
+        *value = 0;
+        return false;
+    }
+
+    char *end;
+    *value = strtol(stringValue.c_str(), &end, 10);
+
+    if (end == stringValue.c_str() || *end != '\0') {
+        *value = 0;
+        return false;
+    }
+
+    return true;
+}
+
+}  // namespace android
+
diff --git a/media/libstagefright/wifi-display/ParsedMessage.h b/media/libstagefright/wifi-display/ParsedMessage.h
new file mode 100644
index 0000000..e9a1859
--- /dev/null
+++ b/media/libstagefright/wifi-display/ParsedMessage.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <media/stagefright/foundation/ABase.h>
+#include <media/stagefright/foundation/AString.h>
+#include <utils/KeyedVector.h>
+#include <utils/RefBase.h>
+
+namespace android {
+
+// Encapsulates an "HTTP/RTSP style" response, i.e. a status line,
+// key/value pairs making up the headers and an optional body/content.
+struct ParsedMessage : public RefBase {
+    static sp<ParsedMessage> Parse(
+            const char *data, size_t size, bool noMoreData, size_t *length);
+
+    bool findString(const char *name, AString *value) const;
+    bool findInt32(const char *name, int32_t *value) const;
+
+    const char *getContent() const;
+
+    void getRequestField(size_t index, AString *field) const;
+    bool getStatusCode(int32_t *statusCode) const;
+
+    AString debugString() const;
+
+    static bool GetAttribute(const char *s, const char *key, AString *value);
+
+    static bool GetInt32Attribute(
+            const char *s, const char *key, int32_t *value);
+
+
+protected:
+    virtual ~ParsedMessage();
+
+private:
+    KeyedVector<AString, AString> mDict;
+    AString mContent;
+
+    ParsedMessage();
+
+    ssize_t parse(const char *data, size_t size, bool noMoreData);
+
+    DISALLOW_EVIL_CONSTRUCTORS(ParsedMessage);
+};
+
+}  // namespace android
diff --git a/media/libstagefright/wifi-display/source/Converter.cpp b/media/libstagefright/wifi-display/source/Converter.cpp
new file mode 100644
index 0000000..ee05e45
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/Converter.cpp
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "Converter"
+#include <utils/Log.h>
+
+#include "Converter.h"
+
+#include <gui/SurfaceTextureClient.h>
+#include <media/ICrypto.h>
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/MediaCodec.h>
+#include <media/stagefright/MediaDefs.h>
+#include <media/stagefright/MediaErrors.h>
+
+namespace android {
+
+Converter::Converter(
+        const sp<AMessage> &notify,
+        const sp<ALooper> &codecLooper,
+        const sp<AMessage> &format)
+    : mInitCheck(NO_INIT),
+      mNotify(notify),
+      mCodecLooper(codecLooper),
+      mInputFormat(format),
+      mDoMoreWorkPending(false) {
+    mInitCheck = initEncoder();
+}
+
+Converter::~Converter() {
+    if (mEncoder != NULL) {
+        mEncoder->release();
+        mEncoder.clear();
+    }
+}
+
+status_t Converter::initCheck() const {
+    return mInitCheck;
+}
+
+sp<AMessage> Converter::getOutputFormat() const {
+    return mOutputFormat;
+}
+
+status_t Converter::initEncoder() {
+    AString inputMIME;
+    CHECK(mInputFormat->findString("mime", &inputMIME));
+
+    AString outputMIME;
+    bool isAudio = false;
+    if (!strcasecmp(inputMIME.c_str(), MEDIA_MIMETYPE_AUDIO_RAW)) {
+        outputMIME = MEDIA_MIMETYPE_AUDIO_AAC;
+        isAudio = true;
+    } else if (!strcasecmp(inputMIME.c_str(), MEDIA_MIMETYPE_VIDEO_RAW)) {
+        outputMIME = MEDIA_MIMETYPE_VIDEO_AVC;
+    } else {
+        TRESPASS();
+    }
+
+    mEncoder = MediaCodec::CreateByType(
+            mCodecLooper, outputMIME.c_str(), true /* encoder */);
+
+    if (mEncoder == NULL) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    mOutputFormat = mInputFormat->dup();
+    mOutputFormat->setString("mime", outputMIME.c_str());
+
+    if (isAudio) {
+        mOutputFormat->setInt32("bitrate", 64000);      // 64 kBit/sec
+    } else {
+        mOutputFormat->setInt32("bitrate", 5000000);    // 5Mbit/sec
+        mOutputFormat->setInt32("frame-rate", 60);
+        mOutputFormat->setInt32("i-frame-interval", 3);  // Iframes every 3 secs
+    }
+
+    ALOGV("output format is '%s'", mOutputFormat->debugString(0).c_str());
+
+    status_t err = mEncoder->configure(
+            mOutputFormat,
+            NULL /* nativeWindow */,
+            NULL /* crypto */,
+            MediaCodec::CONFIGURE_FLAG_ENCODE);
+
+    if (err != OK) {
+        return err;
+    }
+
+    err = mEncoder->start();
+
+    if (err != OK) {
+        return err;
+    }
+
+    err = mEncoder->getInputBuffers(&mEncoderInputBuffers);
+
+    if (err != OK) {
+        return err;
+    }
+
+    return mEncoder->getOutputBuffers(&mEncoderOutputBuffers);
+}
+
+void Converter::feedAccessUnit(const sp<ABuffer> &accessUnit) {
+    sp<AMessage> msg = new AMessage(kWhatFeedAccessUnit, id());
+    msg->setBuffer("accessUnit", accessUnit);
+    msg->post();
+}
+
+void Converter::signalEOS() {
+    (new AMessage(kWhatInputEOS, id()))->post();
+}
+
+void Converter::notifyError(status_t err) {
+    sp<AMessage> notify = mNotify->dup();
+    notify->setInt32("what", kWhatError);
+    notify->setInt32("err", err);
+    notify->post();
+}
+
+void Converter::onMessageReceived(const sp<AMessage> &msg) {
+    switch (msg->what()) {
+        case kWhatFeedAccessUnit:
+        {
+            sp<ABuffer> accessUnit;
+            CHECK(msg->findBuffer("accessUnit", &accessUnit));
+
+            mInputBufferQueue.push_back(accessUnit);
+
+            feedEncoderInputBuffers();
+
+            scheduleDoMoreWork();
+            break;
+        }
+
+        case kWhatInputEOS:
+        {
+            mInputBufferQueue.push_back(NULL);
+
+            feedEncoderInputBuffers();
+
+            scheduleDoMoreWork();
+            break;
+        }
+
+        case kWhatDoMoreWork:
+        {
+            mDoMoreWorkPending = false;
+            status_t err = doMoreWork();
+
+            if (err != OK) {
+                notifyError(err);
+            } else {
+                scheduleDoMoreWork();
+            }
+            break;
+        }
+
+        default:
+            TRESPASS();
+    }
+}
+
+void Converter::scheduleDoMoreWork() {
+    if (mDoMoreWorkPending) {
+        return;
+    }
+
+    mDoMoreWorkPending = true;
+    (new AMessage(kWhatDoMoreWork, id()))->post(1000ll);
+}
+
+status_t Converter::feedEncoderInputBuffers() {
+    while (!mInputBufferQueue.empty()
+            && !mAvailEncoderInputIndices.empty()) {
+        sp<ABuffer> buffer = *mInputBufferQueue.begin();
+        mInputBufferQueue.erase(mInputBufferQueue.begin());
+
+        size_t bufferIndex = *mAvailEncoderInputIndices.begin();
+        mAvailEncoderInputIndices.erase(mAvailEncoderInputIndices.begin());
+
+        int64_t timeUs = 0ll;
+        uint32_t flags = 0;
+
+        if (buffer != NULL) {
+            CHECK(buffer->meta()->findInt64("timeUs", &timeUs));
+
+            memcpy(mEncoderInputBuffers.itemAt(bufferIndex)->data(),
+                   buffer->data(),
+                   buffer->size());
+
+            void *mediaBuffer;
+            if (buffer->meta()->findPointer("mediaBuffer", &mediaBuffer)
+                    && mediaBuffer != NULL) {
+                mEncoderInputBuffers.itemAt(bufferIndex)->meta()
+                    ->setPointer("mediaBuffer", mediaBuffer);
+
+                buffer->meta()->setPointer("mediaBuffer", NULL);
+            }
+        } else {
+            flags = MediaCodec::BUFFER_FLAG_EOS;
+        }
+
+        status_t err = mEncoder->queueInputBuffer(
+                bufferIndex, 0, (buffer == NULL) ? 0 : buffer->size(),
+                timeUs, flags);
+
+        if (err != OK) {
+            return err;
+        }
+    }
+
+    return OK;
+}
+
+status_t Converter::doMoreWork() {
+    size_t bufferIndex;
+    status_t err = mEncoder->dequeueInputBuffer(&bufferIndex);
+
+    if (err == OK) {
+        mAvailEncoderInputIndices.push_back(bufferIndex);
+        feedEncoderInputBuffers();
+    }
+
+    size_t offset;
+    size_t size;
+    int64_t timeUs;
+    uint32_t flags;
+    err = mEncoder->dequeueOutputBuffer(
+            &bufferIndex, &offset, &size, &timeUs, &flags);
+
+    if (err == OK) {
+        if (flags & MediaCodec::BUFFER_FLAG_EOS) {
+            sp<AMessage> notify = mNotify->dup();
+            notify->setInt32("what", kWhatEOS);
+            notify->post();
+        } else {
+            sp<ABuffer> buffer = new ABuffer(size);
+            buffer->meta()->setInt64("timeUs", timeUs);
+
+            memcpy(buffer->data(),
+                   mEncoderOutputBuffers.itemAt(bufferIndex)->base() + offset,
+                   size);
+
+            if (flags & MediaCodec::BUFFER_FLAG_CODECCONFIG) {
+                mOutputFormat->setBuffer("csd-0", buffer);
+            } else {
+                sp<AMessage> notify = mNotify->dup();
+                notify->setInt32("what", kWhatAccessUnit);
+                notify->setBuffer("accessUnit", buffer);
+                notify->post();
+            }
+        }
+
+        err = mEncoder->releaseOutputBuffer(bufferIndex);
+    } else if (err == -EAGAIN) {
+        err = OK;
+    }
+
+    return err;
+}
+
+}  // namespace android
+
diff --git a/media/libstagefright/wifi-display/source/Converter.h b/media/libstagefright/wifi-display/source/Converter.h
new file mode 100644
index 0000000..6700a32
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/Converter.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef CONVERTER_H_
+
+#define CONVERTER_H_
+
+#include <media/stagefright/foundation/AHandler.h>
+
+namespace android {
+
+struct ABuffer;
+struct MediaCodec;
+
+// Utility class that receives media access units and converts them into
+// media access unit of a different format.
+// Right now this'll convert raw video into H.264 and raw audio into AAC.
+struct Converter : public AHandler {
+    Converter(
+            const sp<AMessage> &notify,
+            const sp<ALooper> &codecLooper,
+            const sp<AMessage> &format);
+
+    status_t initCheck() const;
+
+    sp<AMessage> getOutputFormat() const;
+
+    void feedAccessUnit(const sp<ABuffer> &accessUnit);
+    void signalEOS();
+
+    enum {
+        kWhatAccessUnit,
+        kWhatEOS,
+        kWhatError,
+    };
+
+protected:
+    virtual ~Converter();
+    virtual void onMessageReceived(const sp<AMessage> &msg);
+
+private:
+    enum {
+        kWhatFeedAccessUnit,
+        kWhatInputEOS,
+        kWhatDoMoreWork
+    };
+
+    status_t mInitCheck;
+    sp<AMessage> mNotify;
+    sp<ALooper> mCodecLooper;
+    sp<AMessage> mInputFormat;
+    sp<AMessage> mOutputFormat;
+
+    sp<MediaCodec> mEncoder;
+
+    Vector<sp<ABuffer> > mEncoderInputBuffers;
+    Vector<sp<ABuffer> > mEncoderOutputBuffers;
+
+    List<size_t> mAvailEncoderInputIndices;
+
+    List<sp<ABuffer> > mInputBufferQueue;
+
+    bool mDoMoreWorkPending;
+
+    status_t initEncoder();
+
+    status_t feedEncoderInputBuffers();
+
+    void scheduleDoMoreWork();
+    status_t doMoreWork();
+
+    void notifyError(status_t err);
+
+    DISALLOW_EVIL_CONSTRUCTORS(Converter);
+};
+
+}  // namespace android
+
+#endif  // CONVERTER_H_
+
diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.cpp b/media/libstagefright/wifi-display/source/PlaybackSession.cpp
new file mode 100644
index 0000000..f9223d6
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/PlaybackSession.cpp
@@ -0,0 +1,1000 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "PlaybackSession"
+#include <utils/Log.h>
+
+#include "PlaybackSession.h"
+
+#include "Converter.h"
+#include "RepeaterSource.h"
+#include "Serializer.h"
+#include "TSPacketizer.h"
+
+#include <binder/IServiceManager.h>
+#include <gui/ISurfaceComposer.h>
+#include <gui/SurfaceComposerClient.h>
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/foundation/hexdump.h>
+#include <media/stagefright/AudioSource.h>
+#include <media/stagefright/DataSource.h>
+#include <media/stagefright/MediaDefs.h>
+#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MediaExtractor.h>
+#include <media/stagefright/MediaSource.h>
+#include <media/stagefright/MetaData.h>
+#include <media/stagefright/MPEG2TSWriter.h>
+#include <media/stagefright/SurfaceMediaSource.h>
+#include <media/stagefright/Utils.h>
+#include <ui/DisplayInfo.h>
+
+#include <OMX_IVCommon.h>
+
+#define FAKE_VIDEO      0
+
+namespace android {
+
+static size_t kMaxRTPPacketSize = 1500;
+static size_t kMaxNumTSPacketsPerRTPPacket = (kMaxRTPPacketSize - 12) / 188;
+
+struct WifiDisplaySource::PlaybackSession::Track : public RefBase {
+    Track(const sp<Converter> &converter);
+    Track(const sp<AMessage> &format);
+
+    sp<AMessage> getFormat();
+
+    const sp<Converter> &converter() const;
+    ssize_t packetizerTrackIndex() const;
+
+    void setPacketizerTrackIndex(size_t index);
+
+protected:
+    virtual ~Track();
+
+private:
+    sp<Converter> mConverter;
+    sp<AMessage> mFormat;
+    ssize_t mPacketizerTrackIndex;
+
+    DISALLOW_EVIL_CONSTRUCTORS(Track);
+};
+
+WifiDisplaySource::PlaybackSession::Track::Track(const sp<Converter> &converter)
+    : mConverter(converter),
+      mPacketizerTrackIndex(-1) {
+}
+
+WifiDisplaySource::PlaybackSession::Track::Track(const sp<AMessage> &format)
+    : mFormat(format),
+      mPacketizerTrackIndex(-1) {
+}
+
+WifiDisplaySource::PlaybackSession::Track::~Track() {
+}
+
+sp<AMessage> WifiDisplaySource::PlaybackSession::Track::getFormat() {
+    if (mFormat != NULL) {
+        return mFormat;
+    }
+
+    return mConverter->getOutputFormat();
+}
+
+const sp<Converter> &WifiDisplaySource::PlaybackSession::Track::converter() const {
+    return mConverter;
+}
+
+ssize_t WifiDisplaySource::PlaybackSession::Track::packetizerTrackIndex() const {
+    return mPacketizerTrackIndex;
+}
+
+void WifiDisplaySource::PlaybackSession::Track::setPacketizerTrackIndex(size_t index) {
+    CHECK_LT(mPacketizerTrackIndex, 0);
+    mPacketizerTrackIndex = index;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+WifiDisplaySource::PlaybackSession::PlaybackSession(
+        const sp<ANetworkSession> &netSession,
+        const sp<AMessage> &notify)
+    : mNetSession(netSession),
+      mNotify(notify),
+      mLastLifesignUs(),
+      mTSQueue(new ABuffer(12 + kMaxNumTSPacketsPerRTPPacket * 188)),
+      mPrevTimeUs(-1ll),
+      mUseInterleavedTCP(false),
+      mRTPChannel(0),
+      mRTCPChannel(0),
+      mRTPPort(0),
+      mRTPSessionID(0),
+      mRTCPSessionID(0),
+      mRTPSeqNo(0),
+      mLastNTPTime(0),
+      mLastRTPTime(0),
+      mNumRTPSent(0),
+      mNumRTPOctetsSent(0),
+      mNumSRsSent(0),
+      mSendSRPending(false),
+      mFirstPacketTimeUs(-1ll),
+      mHistoryLength(0)
+#if LOG_TRANSPORT_STREAM
+      ,mLogFile(NULL)
+#endif
+{
+    mTSQueue->setRange(0, 12);
+
+#if LOG_TRANSPORT_STREAM
+    mLogFile = fopen("/system/etc/log.ts", "wb");
+#endif
+}
+
+status_t WifiDisplaySource::PlaybackSession::init(
+        const char *clientIP, int32_t clientRtp, int32_t clientRtcp,
+        bool useInterleavedTCP) {
+    status_t err = setupPacketizer();
+
+    if (err != OK) {
+        return err;
+    }
+
+    if (useInterleavedTCP) {
+        mUseInterleavedTCP = true;
+        mRTPChannel = clientRtp;
+        mRTCPChannel = clientRtcp;
+        mRTPPort = 0;
+        mRTPSessionID = 0;
+        mRTCPSessionID = 0;
+
+        updateLiveness();
+        return OK;
+    }
+
+    mUseInterleavedTCP = false;
+    mRTPChannel = 0;
+    mRTCPChannel = 0;
+
+    int serverRtp;
+
+    sp<AMessage> rtpNotify = new AMessage(kWhatRTPNotify, id());
+    sp<AMessage> rtcpNotify = new AMessage(kWhatRTCPNotify, id());
+    for (serverRtp = 15550;; serverRtp += 2) {
+        int32_t rtpSession;
+        err = mNetSession->createUDPSession(
+                    serverRtp, clientIP, clientRtp,
+                    rtpNotify, &rtpSession);
+
+        if (err != OK) {
+            ALOGI("failed to create RTP socket on port %d", serverRtp);
+            continue;
+        }
+
+        if (clientRtcp < 0) {
+            // No RTCP.
+
+            mRTPPort = serverRtp;
+            mRTPSessionID = rtpSession;
+            mRTCPSessionID = 0;
+
+            ALOGI("rtpSessionId = %d", rtpSession);
+            break;
+        }
+
+        int32_t rtcpSession;
+        err = mNetSession->createUDPSession(
+                serverRtp + 1, clientIP, clientRtcp,
+                rtcpNotify, &rtcpSession);
+
+        if (err == OK) {
+            mRTPPort = serverRtp;
+            mRTPSessionID = rtpSession;
+            mRTCPSessionID = rtcpSession;
+
+            ALOGI("rtpSessionID = %d, rtcpSessionID = %d", rtpSession, rtcpSession);
+            break;
+        }
+
+        ALOGI("failed to create RTCP socket on port %d", serverRtp + 1);
+        mNetSession->destroySession(rtpSession);
+    }
+
+    if (mRTPPort == 0) {
+        return UNKNOWN_ERROR;
+    }
+
+    updateLiveness();
+
+    return OK;
+}
+
+WifiDisplaySource::PlaybackSession::~PlaybackSession() {
+#if LOG_TRANSPORT_STREAM
+    if (mLogFile != NULL) {
+        fclose(mLogFile);
+        mLogFile = NULL;
+    }
+#endif
+
+    mTracks.clear();
+
+    if (mCodecLooper != NULL) {
+        mCodecLooper->stop();
+        mCodecLooper.clear();
+    }
+
+    mPacketizer.clear();
+
+    sp<IServiceManager> sm = defaultServiceManager();
+    sp<IBinder> binder = sm->getService(String16("SurfaceFlinger"));
+    sp<ISurfaceComposer> service = interface_cast<ISurfaceComposer>(binder);
+    CHECK(service != NULL);
+
+    if (mSerializer != NULL) {
+        mSerializer->stop();
+
+        looper()->unregisterHandler(mSerializer->id());
+        mSerializer.clear();
+    }
+
+    if (mSerializerLooper != NULL) {
+        mSerializerLooper->stop();
+        mSerializerLooper.clear();
+    }
+
+    service->connectDisplay(NULL);
+
+    if (mRTCPSessionID != 0) {
+        mNetSession->destroySession(mRTCPSessionID);
+    }
+
+    if (mRTPSessionID != 0) {
+        mNetSession->destroySession(mRTPSessionID);
+    }
+}
+
+int32_t WifiDisplaySource::PlaybackSession::getRTPPort() const {
+    return mRTPPort;
+}
+
+int64_t WifiDisplaySource::PlaybackSession::getLastLifesignUs() const {
+    return mLastLifesignUs;
+}
+
+void WifiDisplaySource::PlaybackSession::updateLiveness() {
+    mLastLifesignUs = ALooper::GetNowUs();
+}
+
+status_t WifiDisplaySource::PlaybackSession::play() {
+    updateLiveness();
+
+    if (mRTCPSessionID != 0) {
+        scheduleSendSR();
+    }
+
+    return mSerializer->start();
+}
+
+status_t WifiDisplaySource::PlaybackSession::pause() {
+    updateLiveness();
+
+    return OK;
+}
+
+void WifiDisplaySource::PlaybackSession::onMessageReceived(
+        const sp<AMessage> &msg) {
+    switch (msg->what()) {
+        case kWhatRTPNotify:
+        case kWhatRTCPNotify:
+        {
+            int32_t reason;
+            CHECK(msg->findInt32("reason", &reason));
+
+            switch (reason) {
+                case ANetworkSession::kWhatError:
+                {
+                    int32_t sessionID;
+                    CHECK(msg->findInt32("sessionID", &sessionID));
+
+                    int32_t err;
+                    CHECK(msg->findInt32("err", &err));
+
+                    int32_t errorOccuredDuringSend;
+                    CHECK(msg->findInt32("send", &errorOccuredDuringSend));
+
+                    AString detail;
+                    CHECK(msg->findString("detail", &detail));
+
+                    if (msg->what() == kWhatRTPNotify
+                            && !errorOccuredDuringSend) {
+                        // This is ok, we don't expect to receive anything on
+                        // the RTP socket.
+                        break;
+                    }
+
+                    ALOGE("An error occurred during %s in session %d "
+                          "(%d, '%s' (%s)).",
+                          errorOccuredDuringSend ? "send" : "receive",
+                          sessionID,
+                          err,
+                          detail.c_str(),
+                          strerror(-err));
+
+                    mNetSession->destroySession(sessionID);
+
+                    if (sessionID == mRTPSessionID) {
+                        mRTPSessionID = 0;
+                    } else if (sessionID == mRTCPSessionID) {
+                        mRTCPSessionID = 0;
+                    }
+
+                    // Inform WifiDisplaySource of our premature death (wish).
+                    sp<AMessage> notify = mNotify->dup();
+                    notify->setInt32("what", kWhatSessionDead);
+                    notify->post();
+                    break;
+                }
+
+                case ANetworkSession::kWhatDatagram:
+                {
+                    int32_t sessionID;
+                    CHECK(msg->findInt32("sessionID", &sessionID));
+
+                    sp<ABuffer> data;
+                    CHECK(msg->findBuffer("data", &data));
+
+                    status_t err;
+                    if (msg->what() == kWhatRTCPNotify) {
+                        err = parseRTCP(data);
+                    }
+                    break;
+                }
+
+                default:
+                    TRESPASS();
+            }
+            break;
+        }
+
+        case kWhatSendSR:
+        {
+            mSendSRPending = false;
+
+            if (mRTCPSessionID == 0) {
+                break;
+            }
+
+            onSendSR();
+
+            scheduleSendSR();
+            break;
+        }
+
+        case kWhatSerializerNotify:
+        {
+            int32_t what;
+            CHECK(msg->findInt32("what", &what));
+
+            if (what == Serializer::kWhatEOS) {
+                ALOGI("input eos");
+
+                for (size_t i = 0; i < mTracks.size(); ++i) {
+#if FAKE_VIDEO
+                    sp<AMessage> msg = new AMessage(kWhatConverterNotify, id());
+                    msg->setInt32("what", Converter::kWhatEOS);
+                    msg->setSize("trackIndex", i);
+                    msg->post();
+#else
+                    mTracks.valueAt(i)->converter()->signalEOS();
+#endif
+                }
+            } else {
+                CHECK_EQ(what, Serializer::kWhatAccessUnit);
+
+                size_t trackIndex;
+                CHECK(msg->findSize("trackIndex", &trackIndex));
+
+                sp<ABuffer> accessUnit;
+                CHECK(msg->findBuffer("accessUnit", &accessUnit));
+
+#if FAKE_VIDEO
+                int64_t timeUs;
+                CHECK(accessUnit->meta()->findInt64("timeUs", &timeUs));
+
+                void *mbuf;
+                CHECK(accessUnit->meta()->findPointer("mediaBuffer", &mbuf));
+
+                ((MediaBuffer *)mbuf)->release();
+                mbuf = NULL;
+
+                sp<AMessage> msg = new AMessage(kWhatConverterNotify, id());
+                msg->setInt32("what", Converter::kWhatAccessUnit);
+                msg->setSize("trackIndex", trackIndex);
+                msg->setBuffer("accessUnit", accessUnit);
+                msg->post();
+#else
+                mTracks.valueFor(trackIndex)->converter()
+                    ->feedAccessUnit(accessUnit);
+#endif
+            }
+            break;
+        }
+
+        case kWhatConverterNotify:
+        {
+            int32_t what;
+            CHECK(msg->findInt32("what", &what));
+
+            size_t trackIndex;
+            CHECK(msg->findSize("trackIndex", &trackIndex));
+
+            if (what == Converter::kWhatAccessUnit) {
+                const sp<Track> &track = mTracks.valueFor(trackIndex);
+
+                uint32_t flags = 0;
+
+                ssize_t packetizerTrackIndex = track->packetizerTrackIndex();
+                if (packetizerTrackIndex < 0) {
+                    flags = TSPacketizer::EMIT_PAT_AND_PMT;
+
+                    packetizerTrackIndex =
+                        mPacketizer->addTrack(track->getFormat());
+
+                    if (packetizerTrackIndex >= 0) {
+                        track->setPacketizerTrackIndex(packetizerTrackIndex);
+                    }
+                }
+
+                if (packetizerTrackIndex >= 0) {
+                    sp<ABuffer> accessUnit;
+                    CHECK(msg->findBuffer("accessUnit", &accessUnit));
+
+                    int64_t timeUs;
+                    CHECK(accessUnit->meta()->findInt64("timeUs", &timeUs));
+
+                    if (mPrevTimeUs < 0ll || mPrevTimeUs + 100000ll >= timeUs) {
+                        flags |= TSPacketizer::EMIT_PCR;
+                        mPrevTimeUs = timeUs;
+                    }
+
+                    sp<ABuffer> packets;
+                    mPacketizer->packetize(
+                            packetizerTrackIndex, accessUnit, &packets, flags);
+
+                    for (size_t offset = 0;
+                            offset < packets->size(); offset += 188) {
+                        bool lastTSPacket = (offset + 188 >= packets->size());
+
+                        appendTSData(
+                                packets->data() + offset,
+                                188,
+                                true /* timeDiscontinuity */,
+                                lastTSPacket /* flush */);
+                    }
+
+#if LOG_TRANSPORT_STREAM
+                    if (mLogFile != NULL) {
+                        fwrite(packets->data(), 1, packets->size(), mLogFile);
+                    }
+#endif
+                }
+            } else if (what == Converter::kWhatEOS) {
+                CHECK_EQ(what, Converter::kWhatEOS);
+
+                ALOGI("output EOS on track %d", trackIndex);
+
+                ssize_t index = mTracks.indexOfKey(trackIndex);
+                CHECK_GE(index, 0);
+
+#if !FAKE_VIDEO
+                const sp<Converter> &converter =
+                    mTracks.valueAt(index)->converter();
+                looper()->unregisterHandler(converter->id());
+#endif
+
+                mTracks.removeItemsAt(index);
+
+                if (mTracks.isEmpty()) {
+                    ALOGI("Reached EOS");
+                }
+            } else {
+                CHECK_EQ(what, Converter::kWhatError);
+
+                status_t err;
+                CHECK(msg->findInt32("err", &err));
+
+                ALOGE("converter signaled error %d", err);
+            }
+            break;
+        }
+
+        default:
+            TRESPASS();
+    }
+}
+
+status_t WifiDisplaySource::PlaybackSession::setupPacketizer() {
+    sp<AMessage> msg = new AMessage(kWhatSerializerNotify, id());
+
+    mSerializerLooper = new ALooper;
+    mSerializerLooper->start();
+
+    mSerializer = new Serializer(
+#if FAKE_VIDEO
+            true /* throttled */
+#else
+            false /* throttled */
+#endif
+            , msg);
+    mSerializerLooper->registerHandler(mSerializer);
+
+    mPacketizer = new TSPacketizer;
+
+#if FAKE_VIDEO
+    DataSource::RegisterDefaultSniffers();
+
+    sp<DataSource> dataSource =
+        DataSource::CreateFromURI(
+                "/system/etc/inception_1500.mp4");
+
+    CHECK(dataSource != NULL);
+
+    sp<MediaExtractor> extractor = MediaExtractor::Create(dataSource);
+    CHECK(extractor != NULL);
+
+    bool haveAudio = false;
+    bool haveVideo = false;
+    for (size_t i = 0; i < extractor->countTracks(); ++i) {
+        sp<MetaData> meta = extractor->getTrackMetaData(i);
+
+        const char *mime;
+        CHECK(meta->findCString(kKeyMIMEType, &mime));
+
+        bool useTrack = false;
+        if (!strncasecmp(mime, "audio/", 6) && !haveAudio) {
+            useTrack = true;
+            haveAudio = true;
+        } else if (!strncasecmp(mime, "video/", 6) && !haveVideo) {
+            useTrack = true;
+            haveVideo = true;
+        }
+
+        if (!useTrack) {
+            continue;
+        }
+
+        sp<MediaSource> source = extractor->getTrack(i);
+
+        ssize_t index = mSerializer->addSource(source);
+        CHECK_GE(index, 0);
+
+        sp<AMessage> format;
+        status_t err = convertMetaDataToMessage(source->getFormat(), &format);
+        CHECK_EQ(err, (status_t)OK);
+
+        mTracks.add(index, new Track(format));
+    }
+    CHECK(haveAudio || haveVideo);
+#else
+    mCodecLooper = new ALooper;
+    mCodecLooper->start();
+
+    DisplayInfo info;
+    SurfaceComposerClient::getDisplayInfo(0, &info);
+
+    // sp<SurfaceMediaSource> source = new SurfaceMediaSource(info.w, info.h);
+    sp<SurfaceMediaSource> source = new SurfaceMediaSource(720, 1280);
+
+    sp<IServiceManager> sm = defaultServiceManager();
+    sp<IBinder> binder = sm->getService(String16("SurfaceFlinger"));
+    sp<ISurfaceComposer> service = interface_cast<ISurfaceComposer>(binder);
+    CHECK(service != NULL);
+
+    service->connectDisplay(source->getBufferQueue());
+
+#if 0
+    {
+        ALOGI("reading buffer");
+
+        CHECK_EQ((status_t)OK, source->start());
+        MediaBuffer *mbuf;
+        CHECK_EQ((status_t)OK, source->read(&mbuf));
+        mbuf->release();
+        mbuf = NULL;
+
+        ALOGI("got buffer");
+    }
+#endif
+
+#if 0
+    ssize_t index = mSerializer->addSource(source);
+#else
+    ssize_t index = mSerializer->addSource(
+            new RepeaterSource(source, 30.0 /* rateHz */));
+#endif
+
+    CHECK_GE(index, 0);
+
+    sp<AMessage> format;
+    status_t err = convertMetaDataToMessage(source->getFormat(), &format);
+    CHECK_EQ(err, (status_t)OK);
+
+    format->setInt32("store-metadata-in-buffers", true);
+
+    format->setInt32(
+            "color-format", OMX_COLOR_FormatAndroidOpaque);
+
+    sp<AMessage> notify = new AMessage(kWhatConverterNotify, id());
+    notify->setSize("trackIndex", index);
+
+    sp<Converter> converter =
+        new Converter(notify, mCodecLooper, format);
+
+    looper()->registerHandler(converter);
+
+    mTracks.add(index, new Track(converter));
+#endif
+
+#if 0
+    sp<AudioSource> audioSource = new AudioSource(
+            AUDIO_SOURCE_MIC,
+            48000 /* sampleRate */,
+            2 /* channelCount */);  // XXX AUDIO_CHANNEL_IN_STEREO?
+
+    CHECK_EQ((status_t)OK, audioSource->initCheck());
+
+    audioSource->setUseLooperTime(true);
+
+    index = mSerializer->addSource(audioSource);
+    CHECK_GE(index, 0);
+
+    sp<AMessage> audioFormat;
+    err = convertMetaDataToMessage(audioSource->getFormat(), &audioFormat);
+    CHECK_EQ(err, (status_t)OK);
+
+    sp<AMessage> audioNotify = new AMessage(kWhatConverterNotify, id());
+    audioNotify->setSize("trackIndex", index);
+
+    converter = new Converter(audioNotify, mCodecLooper, audioFormat);
+    looper()->registerHandler(converter);
+
+    mTracks.add(index, new Track(converter));
+#endif
+
+    return OK;
+}
+
+void WifiDisplaySource::PlaybackSession::scheduleSendSR() {
+    if (mSendSRPending) {
+        return;
+    }
+
+    mSendSRPending = true;
+    (new AMessage(kWhatSendSR, id()))->post(kSendSRIntervalUs);
+}
+
+void WifiDisplaySource::PlaybackSession::addSR(const sp<ABuffer> &buffer) {
+    uint8_t *data = buffer->data() + buffer->size();
+
+    // TODO: Use macros/utility functions to clean up all the bitshifts below.
+
+    data[0] = 0x80 | 0;
+    data[1] = 200;  // SR
+    data[2] = 0;
+    data[3] = 6;
+    data[4] = kSourceID >> 24;
+    data[5] = (kSourceID >> 16) & 0xff;
+    data[6] = (kSourceID >> 8) & 0xff;
+    data[7] = kSourceID & 0xff;
+
+    data[8] = mLastNTPTime >> (64 - 8);
+    data[9] = (mLastNTPTime >> (64 - 16)) & 0xff;
+    data[10] = (mLastNTPTime >> (64 - 24)) & 0xff;
+    data[11] = (mLastNTPTime >> 32) & 0xff;
+    data[12] = (mLastNTPTime >> 24) & 0xff;
+    data[13] = (mLastNTPTime >> 16) & 0xff;
+    data[14] = (mLastNTPTime >> 8) & 0xff;
+    data[15] = mLastNTPTime & 0xff;
+
+    data[16] = (mLastRTPTime >> 24) & 0xff;
+    data[17] = (mLastRTPTime >> 16) & 0xff;
+    data[18] = (mLastRTPTime >> 8) & 0xff;
+    data[19] = mLastRTPTime & 0xff;
+
+    data[20] = mNumRTPSent >> 24;
+    data[21] = (mNumRTPSent >> 16) & 0xff;
+    data[22] = (mNumRTPSent >> 8) & 0xff;
+    data[23] = mNumRTPSent & 0xff;
+
+    data[24] = mNumRTPOctetsSent >> 24;
+    data[25] = (mNumRTPOctetsSent >> 16) & 0xff;
+    data[26] = (mNumRTPOctetsSent >> 8) & 0xff;
+    data[27] = mNumRTPOctetsSent & 0xff;
+
+    buffer->setRange(buffer->offset(), buffer->size() + 28);
+}
+
+void WifiDisplaySource::PlaybackSession::addSDES(const sp<ABuffer> &buffer) {
+    uint8_t *data = buffer->data() + buffer->size();
+    data[0] = 0x80 | 1;
+    data[1] = 202;  // SDES
+    data[4] = kSourceID >> 24;
+    data[5] = (kSourceID >> 16) & 0xff;
+    data[6] = (kSourceID >> 8) & 0xff;
+    data[7] = kSourceID & 0xff;
+
+    size_t offset = 8;
+
+    data[offset++] = 1;  // CNAME
+
+    static const char *kCNAME = "someone@somewhere";
+    data[offset++] = strlen(kCNAME);
+
+    memcpy(&data[offset], kCNAME, strlen(kCNAME));
+    offset += strlen(kCNAME);
+
+    data[offset++] = 7;  // NOTE
+
+    static const char *kNOTE = "Hell's frozen over.";
+    data[offset++] = strlen(kNOTE);
+
+    memcpy(&data[offset], kNOTE, strlen(kNOTE));
+    offset += strlen(kNOTE);
+
+    data[offset++] = 0;
+
+    if ((offset % 4) > 0) {
+        size_t count = 4 - (offset % 4);
+        switch (count) {
+            case 3:
+                data[offset++] = 0;
+            case 2:
+                data[offset++] = 0;
+            case 1:
+                data[offset++] = 0;
+        }
+    }
+
+    size_t numWords = (offset / 4) - 1;
+    data[2] = numWords >> 8;
+    data[3] = numWords & 0xff;
+
+    buffer->setRange(buffer->offset(), buffer->size() + offset);
+}
+
+// static
+uint64_t WifiDisplaySource::PlaybackSession::GetNowNTP() {
+    uint64_t nowUs = ALooper::GetNowUs();
+
+    nowUs += ((70ll * 365 + 17) * 24) * 60 * 60 * 1000000ll;
+
+    uint64_t hi = nowUs / 1000000ll;
+    uint64_t lo = ((1ll << 32) * (nowUs % 1000000ll)) / 1000000ll;
+
+    return (hi << 32) | lo;
+}
+
+void WifiDisplaySource::PlaybackSession::onSendSR() {
+    sp<ABuffer> buffer = new ABuffer(1500);
+    buffer->setRange(0, 0);
+
+    addSR(buffer);
+    addSDES(buffer);
+
+    if (mUseInterleavedTCP) {
+        sp<AMessage> notify = mNotify->dup();
+        notify->setInt32("what", kWhatBinaryData);
+        notify->setInt32("channel", mRTCPChannel);
+        notify->setBuffer("data", buffer);
+        notify->post();
+    } else {
+        mNetSession->sendRequest(
+                mRTCPSessionID, buffer->data(), buffer->size());
+    }
+
+    ++mNumSRsSent;
+}
+
+ssize_t WifiDisplaySource::PlaybackSession::appendTSData(
+        const void *data, size_t size, bool timeDiscontinuity, bool flush) {
+    CHECK_EQ(size, 188);
+
+    CHECK_LE(mTSQueue->size() + size, mTSQueue->capacity());
+
+    memcpy(mTSQueue->data() + mTSQueue->size(), data, size);
+    mTSQueue->setRange(0, mTSQueue->size() + size);
+
+    if (flush || mTSQueue->size() == mTSQueue->capacity()) {
+        // flush
+
+        int64_t nowUs = ALooper::GetNowUs();
+        if (mFirstPacketTimeUs < 0ll) {
+            mFirstPacketTimeUs = nowUs;
+        }
+
+        // 90kHz time scale
+        uint32_t rtpTime = ((nowUs - mFirstPacketTimeUs) * 9ll) / 100ll;
+
+        uint8_t *rtp = mTSQueue->data();
+        rtp[0] = 0x80;
+        rtp[1] = 33 | (timeDiscontinuity ? (1 << 7) : 0);  // M-bit
+        rtp[2] = (mRTPSeqNo >> 8) & 0xff;
+        rtp[3] = mRTPSeqNo & 0xff;
+        rtp[4] = rtpTime >> 24;
+        rtp[5] = (rtpTime >> 16) & 0xff;
+        rtp[6] = (rtpTime >> 8) & 0xff;
+        rtp[7] = rtpTime & 0xff;
+        rtp[8] = kSourceID >> 24;
+        rtp[9] = (kSourceID >> 16) & 0xff;
+        rtp[10] = (kSourceID >> 8) & 0xff;
+        rtp[11] = kSourceID & 0xff;
+
+        ++mRTPSeqNo;
+        ++mNumRTPSent;
+        mNumRTPOctetsSent += mTSQueue->size() - 12;
+
+        mLastRTPTime = rtpTime;
+        mLastNTPTime = GetNowNTP();
+
+        if (mUseInterleavedTCP) {
+            sp<AMessage> notify = mNotify->dup();
+            notify->setInt32("what", kWhatBinaryData);
+
+            sp<ABuffer> data = new ABuffer(mTSQueue->size());
+            memcpy(data->data(), rtp, mTSQueue->size());
+
+            notify->setInt32("channel", mRTPChannel);
+            notify->setBuffer("data", data);
+            notify->post();
+        } else {
+            mNetSession->sendRequest(
+                    mRTPSessionID, rtp, mTSQueue->size());
+        }
+
+        mTSQueue->setInt32Data(mRTPSeqNo - 1);
+        mHistory.push_back(mTSQueue);
+        ++mHistoryLength;
+
+        if (mHistoryLength > kMaxHistoryLength) {
+            mTSQueue = *mHistory.begin();
+            mHistory.erase(mHistory.begin());
+
+            --mHistoryLength;
+        } else {
+            mTSQueue = new ABuffer(12 + kMaxNumTSPacketsPerRTPPacket * 188);
+        }
+
+        mTSQueue->setRange(0, 12);
+    }
+
+    return size;
+}
+
+status_t WifiDisplaySource::PlaybackSession::parseRTCP(
+        const sp<ABuffer> &buffer) {
+    const uint8_t *data = buffer->data();
+    size_t size = buffer->size();
+
+    while (size > 0) {
+        if (size < 8) {
+            // Too short to be a valid RTCP header
+            return ERROR_MALFORMED;
+        }
+
+        if ((data[0] >> 6) != 2) {
+            // Unsupported version.
+            return ERROR_UNSUPPORTED;
+        }
+
+        if (data[0] & 0x20) {
+            // Padding present.
+
+            size_t paddingLength = data[size - 1];
+
+            if (paddingLength + 12 > size) {
+                // If we removed this much padding we'd end up with something
+                // that's too short to be a valid RTP header.
+                return ERROR_MALFORMED;
+            }
+
+            size -= paddingLength;
+        }
+
+        size_t headerLength = 4 * (data[2] << 8 | data[3]) + 4;
+
+        if (size < headerLength) {
+            // Only received a partial packet?
+            return ERROR_MALFORMED;
+        }
+
+        switch (data[1]) {
+            case 200:
+            case 201:  // RR
+            case 202:  // SDES
+            case 203:
+            case 204:  // APP
+                break;
+
+            case 205:  // TSFB (transport layer specific feedback)
+                parseTSFB(data, headerLength);
+                break;
+
+            case 206:  // PSFB (payload specific feedback)
+                hexdump(data, headerLength);
+                break;
+
+            default:
+            {
+                ALOGW("Unknown RTCP packet type %u of size %d",
+                     (unsigned)data[1], headerLength);
+                break;
+            }
+        }
+
+        data += headerLength;
+        size -= headerLength;
+    }
+
+    return OK;
+}
+
+status_t WifiDisplaySource::PlaybackSession::parseTSFB(
+        const uint8_t *data, size_t size) {
+    if ((data[0] & 0x1f) != 1) {
+        return ERROR_UNSUPPORTED;  // We only support NACK for now.
+    }
+
+    uint32_t srcId = U32_AT(&data[8]);
+    if (srcId != kSourceID) {
+        return ERROR_MALFORMED;
+    }
+
+    for (size_t i = 12; i < size; i += 4) {
+        uint16_t seqNo = U16_AT(&data[i]);
+        uint16_t blp = U16_AT(&data[i + 2]);
+
+        List<sp<ABuffer> >::iterator it = mHistory.begin();
+        bool found = false;
+        while (it != mHistory.end()) {
+            const sp<ABuffer> &buffer = *it;
+
+            uint16_t bufferSeqNo = buffer->int32Data() & 0xffff;
+
+            if (bufferSeqNo == seqNo) {
+                mNetSession->sendRequest(
+                        mRTPSessionID, buffer->data(), buffer->size());
+
+                found = true;
+                break;
+            }
+
+            ++it;
+        }
+
+        if (found) {
+            ALOGI("retransmitting seqNo %d", seqNo);
+        } else {
+            ALOGI("seqNo %d no longer available", seqNo);
+        }
+    }
+
+    return OK;
+}
+
+}  // namespace android
+
diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.h b/media/libstagefright/wifi-display/source/PlaybackSession.h
new file mode 100644
index 0000000..a6c9f27
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/PlaybackSession.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef PLAYBACK_SESSION_H_
+
+#define PLAYBACK_SESSION_H_
+
+#include "WifiDisplaySource.h"
+
+namespace android {
+
+struct ABuffer;
+struct Serializer;
+struct TSPacketizer;
+
+#define LOG_TRANSPORT_STREAM    0
+
+// Encapsulates the state of an RTP/RTCP session in the context of wifi
+// display.
+struct WifiDisplaySource::PlaybackSession : public AHandler {
+    PlaybackSession(
+            const sp<ANetworkSession> &netSession, const sp<AMessage> &notify);
+
+    status_t init(
+            const char *clientIP, int32_t clientRtp, int32_t clientRtcp,
+            bool useInterleavedTCP);
+
+    int32_t getRTPPort() const;
+
+    int64_t getLastLifesignUs() const;
+    void updateLiveness();
+
+    status_t play();
+    status_t pause();
+
+    enum {
+        kWhatSessionDead,
+        kWhatBinaryData,
+    };
+
+protected:
+    virtual void onMessageReceived(const sp<AMessage> &msg);
+    virtual ~PlaybackSession();
+
+private:
+    struct Track;
+
+    enum {
+        kWhatSendSR,
+        kWhatRTPNotify,
+        kWhatRTCPNotify,
+        kWhatSerializerNotify,
+        kWhatConverterNotify,
+        kWhatUpdateSurface,
+    };
+
+    static const int64_t kSendSRIntervalUs = 10000000ll;
+    static const uint32_t kSourceID = 0xdeadbeef;
+    static const size_t kMaxHistoryLength = 128;
+
+    sp<ANetworkSession> mNetSession;
+    sp<AMessage> mNotify;
+
+    int64_t mLastLifesignUs;
+
+    sp<ALooper> mSerializerLooper;
+    sp<Serializer> mSerializer;
+    sp<TSPacketizer> mPacketizer;
+    sp<ALooper> mCodecLooper;
+
+    KeyedVector<size_t, sp<Track> > mTracks;
+
+    sp<ABuffer> mTSQueue;
+    int64_t mPrevTimeUs;
+
+    bool mUseInterleavedTCP;
+
+    // in TCP mode
+    int32_t mRTPChannel;
+    int32_t mRTCPChannel;
+
+    // in UDP mode
+    int32_t mRTPPort;
+    int32_t mRTPSessionID;
+    int32_t mRTCPSessionID;
+
+
+    uint32_t mRTPSeqNo;
+
+    uint64_t mLastNTPTime;
+    uint32_t mLastRTPTime;
+    uint32_t mNumRTPSent;
+    uint32_t mNumRTPOctetsSent;
+    uint32_t mNumSRsSent;
+
+    bool mSendSRPending;
+
+    int64_t mFirstPacketTimeUs;
+
+    List<sp<ABuffer> > mHistory;
+    size_t mHistoryLength;
+
+#if LOG_TRANSPORT_STREAM
+    FILE *mLogFile;
+#endif
+
+    void onSendSR();
+    void addSR(const sp<ABuffer> &buffer);
+    void addSDES(const sp<ABuffer> &buffer);
+    static uint64_t GetNowNTP();
+
+    status_t setupPacketizer();
+
+    ssize_t appendTSData(
+            const void *data, size_t size, bool timeDiscontinuity, bool flush);
+
+    void scheduleSendSR();
+
+    status_t parseRTCP(const sp<ABuffer> &buffer);
+    status_t parseTSFB(const uint8_t *data, size_t size);
+
+    DISALLOW_EVIL_CONSTRUCTORS(PlaybackSession);
+};
+
+}  // namespace android
+
+#endif  // PLAYBACK_SESSION_H_
+
diff --git a/media/libstagefright/wifi-display/source/RepeaterSource.cpp b/media/libstagefright/wifi-display/source/RepeaterSource.cpp
new file mode 100644
index 0000000..8af4fdf
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/RepeaterSource.cpp
@@ -0,0 +1,140 @@
+//#define LOG_NDEBUG 0
+#define LOG_TAG "RepeaterSource"
+#include <utils/Log.h>
+
+#include "RepeaterSource.h"
+
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/ALooper.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/MediaBuffer.h>
+#include <media/stagefright/MetaData.h>
+
+namespace android {
+
+RepeaterSource::RepeaterSource(const sp<MediaSource> &source, double rateHz)
+    : mSource(source),
+      mRateHz(rateHz),
+      mBuffer(NULL),
+      mResult(OK),
+      mStartTimeUs(-1ll),
+      mFrameCount(0) {
+}
+
+RepeaterSource::~RepeaterSource() {
+    stop();
+}
+
+status_t RepeaterSource::start(MetaData *params) {
+    status_t err = mSource->start(params);
+
+    if (err != OK) {
+        return err;
+    }
+
+    mBuffer = NULL;
+    mResult = OK;
+    mStartTimeUs = -1ll;
+    mFrameCount = 0;
+
+    mLooper = new ALooper;
+    mLooper->start();
+
+    mReflector = new AHandlerReflector<RepeaterSource>(this);
+    mLooper->registerHandler(mReflector);
+
+    postRead();
+
+    return OK;
+}
+
+status_t RepeaterSource::stop() {
+    if (mLooper != NULL) {
+        mLooper->stop();
+        mLooper.clear();
+
+        mReflector.clear();
+    }
+
+    return mSource->stop();
+}
+
+sp<MetaData> RepeaterSource::getFormat() {
+    return mSource->getFormat();
+}
+
+status_t RepeaterSource::read(
+        MediaBuffer **buffer, const ReadOptions *options) {
+    int64_t seekTimeUs;
+    ReadOptions::SeekMode seekMode;
+    CHECK(options == NULL || !options->getSeekTo(&seekTimeUs, &seekMode));
+
+    int64_t bufferTimeUs = -1ll;
+
+    if (mStartTimeUs < 0ll) {
+        Mutex::Autolock autoLock(mLock);
+        while (mBuffer == NULL && mResult == OK) {
+            mCondition.wait(mLock);
+        }
+
+        mStartTimeUs = ALooper::GetNowUs();
+        bufferTimeUs = mStartTimeUs;
+    } else {
+        bufferTimeUs = mStartTimeUs + (mFrameCount * 1000000ll) / mRateHz;
+
+        int64_t nowUs = ALooper::GetNowUs();
+        int64_t delayUs = bufferTimeUs - nowUs;
+
+        if (delayUs > 0ll) {
+            usleep(delayUs);
+        }
+    }
+
+    Mutex::Autolock autoLock(mLock);
+    if (mResult != OK) {
+        CHECK(mBuffer == NULL);
+        return mResult;
+    }
+
+    mBuffer->add_ref();
+    *buffer = mBuffer;
+    (*buffer)->meta_data()->setInt64(kKeyTime, bufferTimeUs);
+
+    ++mFrameCount;
+
+    return OK;
+}
+
+void RepeaterSource::postRead() {
+    (new AMessage(kWhatRead, mReflector->id()))->post();
+}
+
+void RepeaterSource::onMessageReceived(const sp<AMessage> &msg) {
+    switch (msg->what()) {
+        case kWhatRead:
+        {
+            MediaBuffer *buffer;
+            status_t err = mSource->read(&buffer);
+
+            Mutex::Autolock autoLock(mLock);
+            if (mBuffer != NULL) {
+                mBuffer->release();
+                mBuffer = NULL;
+            }
+            mBuffer = buffer;
+            mResult = err;
+
+            mCondition.broadcast();
+
+            if (err == OK) {
+                postRead();
+            }
+            break;
+        }
+
+        default:
+            TRESPASS();
+    }
+}
+
+}  // namespace android
diff --git a/media/libstagefright/wifi-display/source/RepeaterSource.h b/media/libstagefright/wifi-display/source/RepeaterSource.h
new file mode 100644
index 0000000..31eb5cd
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/RepeaterSource.h
@@ -0,0 +1,55 @@
+#ifndef REPEATER_SOURCE_H_
+
+#define REPEATER_SOURCE_H_
+
+#include <media/stagefright/foundation/ABase.h>
+#include <media/stagefright/foundation/AHandlerReflector.h>
+#include <media/stagefright/MediaSource.h>
+
+namespace android {
+
+// This MediaSource delivers frames at a constant rate by repeating buffers
+// if necessary.
+struct RepeaterSource : public MediaSource {
+    RepeaterSource(const sp<MediaSource> &source, double rateHz);
+
+    virtual status_t start(MetaData *params);
+    virtual status_t stop();
+    virtual sp<MetaData> getFormat();
+
+    virtual status_t read(
+            MediaBuffer **buffer, const ReadOptions *options);
+
+    void onMessageReceived(const sp<AMessage> &msg);
+
+protected:
+    virtual ~RepeaterSource();
+
+private:
+    enum {
+        kWhatRead,
+    };
+
+    Mutex mLock;
+    Condition mCondition;
+
+    sp<MediaSource> mSource;
+    double mRateHz;
+
+    sp<ALooper> mLooper;
+    sp<AHandlerReflector<RepeaterSource> > mReflector;
+
+    MediaBuffer *mBuffer;
+    status_t mResult;
+
+    int64_t mStartTimeUs;
+    int32_t mFrameCount;
+
+    void postRead();
+
+    DISALLOW_EVIL_CONSTRUCTORS(RepeaterSource);
+};
+
+}  // namespace android
+
+#endif // REPEATER_SOURCE_H_
diff --git a/media/libstagefright/wifi-display/source/Serializer.cpp b/media/libstagefright/wifi-display/source/Serializer.cpp
new file mode 100644
index 0000000..bd53fc8
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/Serializer.cpp
@@ -0,0 +1,366 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "Serializer"
+#include <utils/Log.h>
+
+#include "Serializer.h"
+
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/MediaBuffer.h>
+#include <media/stagefright/MediaSource.h>
+#include <media/stagefright/MetaData.h>
+
+namespace android {
+
+struct Serializer::Track : public RefBase {
+    Track(const sp<MediaSource> &source);
+
+    status_t start();
+    status_t stop();
+
+    void readBufferIfNecessary();
+
+    bool reachedEOS() const;
+    int64_t bufferTimeUs() const;
+
+    sp<ABuffer> drainBuffer();
+
+protected:
+    virtual ~Track();
+
+private:
+    sp<MediaSource> mSource;
+
+    bool mStarted;
+    status_t mFinalResult;
+    MediaBuffer *mBuffer;
+    int64_t mBufferTimeUs;
+
+    DISALLOW_EVIL_CONSTRUCTORS(Track);
+};
+
+Serializer::Track::Track(const sp<MediaSource> &source)
+    : mSource(source),
+      mStarted(false),
+      mFinalResult(OK),
+      mBuffer(NULL),
+      mBufferTimeUs(-1ll) {
+}
+
+Serializer::Track::~Track() {
+    stop();
+}
+
+status_t Serializer::Track::start() {
+    if (mStarted) {
+        return OK;
+    }
+
+    status_t err = mSource->start();
+
+    if (err == OK) {
+        mStarted = true;
+    }
+
+    return err;
+}
+
+status_t Serializer::Track::stop() {
+    if (!mStarted) {
+        return OK;
+    }
+
+    if (mBuffer != NULL) {
+        mBuffer->release();
+        mBuffer = NULL;
+
+        mBufferTimeUs = -1ll;
+    }
+
+    status_t err = mSource->stop();
+
+    mStarted = false;
+
+    return err;
+}
+
+void Serializer::Track::readBufferIfNecessary() {
+    if (mBuffer != NULL) {
+        return;
+    }
+
+    mFinalResult = mSource->read(&mBuffer);
+
+    if (mFinalResult != OK) {
+        ALOGI("read failed w/ err %d", mFinalResult);
+        return;
+    }
+
+    CHECK(mBuffer->meta_data()->findInt64(kKeyTime, &mBufferTimeUs));
+}
+
+bool Serializer::Track::reachedEOS() const {
+    return mFinalResult != OK;
+}
+
+int64_t Serializer::Track::bufferTimeUs() const {
+    return mBufferTimeUs;
+}
+
+sp<ABuffer> Serializer::Track::drainBuffer() {
+    sp<ABuffer> accessUnit = new ABuffer(mBuffer->range_length());
+
+    memcpy(accessUnit->data(),
+           (const uint8_t *)mBuffer->data() + mBuffer->range_offset(),
+           mBuffer->range_length());
+
+    accessUnit->meta()->setInt64("timeUs", mBufferTimeUs);
+    accessUnit->meta()->setPointer("mediaBuffer", mBuffer);
+
+    mBuffer = NULL;
+    mBufferTimeUs = -1ll;
+
+    return accessUnit;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+Serializer::Serializer(bool throttle, const sp<AMessage> &notify)
+    : mThrottle(throttle),
+      mNotify(notify),
+      mPollGeneration(0),
+      mStartTimeUs(-1ll) {
+}
+
+Serializer::~Serializer() {
+}
+
+status_t Serializer::postSynchronouslyAndReturnError(
+        const sp<AMessage> &msg) {
+    sp<AMessage> response;
+    status_t err = msg->postAndAwaitResponse(&response);
+
+    if (err != OK) {
+        return err;
+    }
+
+    if (!response->findInt32("err", &err)) {
+        err = OK;
+    }
+
+    return err;
+}
+
+ssize_t Serializer::addSource(const sp<MediaSource> &source) {
+    sp<AMessage> msg = new AMessage(kWhatAddSource, id());
+    msg->setPointer("source", source.get());
+
+    sp<AMessage> response;
+    status_t err = msg->postAndAwaitResponse(&response);
+
+    if (err != OK) {
+        return err;
+    }
+
+    if (!response->findInt32("err", &err)) {
+        size_t index;
+        CHECK(response->findSize("index", &index));
+
+        return index;
+    }
+
+    return err;
+}
+
+status_t Serializer::start() {
+    return postSynchronouslyAndReturnError(new AMessage(kWhatStart, id()));
+}
+
+status_t Serializer::stop() {
+    return postSynchronouslyAndReturnError(new AMessage(kWhatStop, id()));
+}
+
+void Serializer::onMessageReceived(const sp<AMessage> &msg) {
+    switch (msg->what()) {
+        case kWhatAddSource:
+        {
+            ssize_t index = onAddSource(msg);
+
+            sp<AMessage> response = new AMessage;
+
+            if (index < 0) {
+                response->setInt32("err", index);
+            } else {
+                response->setSize("index", index);
+            }
+
+            uint32_t replyID;
+            CHECK(msg->senderAwaitsResponse(&replyID));
+
+            response->postReply(replyID);
+            break;
+        }
+
+        case kWhatStart:
+        case kWhatStop:
+        {
+            status_t err = (msg->what() == kWhatStart) ? onStart() : onStop();
+
+            sp<AMessage> response = new AMessage;
+            response->setInt32("err", err);
+
+            uint32_t replyID;
+            CHECK(msg->senderAwaitsResponse(&replyID));
+
+            response->postReply(replyID);
+            break;
+        }
+
+        case kWhatPoll:
+        {
+            int32_t generation;
+            CHECK(msg->findInt32("generation", &generation));
+
+            if (generation != mPollGeneration) {
+                break;
+            }
+
+            int64_t delayUs = onPoll();
+            if (delayUs >= 0ll) {
+                schedulePoll(delayUs);
+            }
+            break;
+        }
+
+        default:
+            TRESPASS();
+    }
+}
+
+ssize_t Serializer::onAddSource(const sp<AMessage> &msg) {
+    void *obj;
+    CHECK(msg->findPointer("source", &obj));
+
+    sp<MediaSource> source = static_cast<MediaSource *>(obj);
+
+    sp<Track> track = new Track(source);
+    return mTracks.add(track);
+}
+
+status_t Serializer::onStart() {
+    status_t err = OK;
+    for (size_t i = 0; i < mTracks.size(); ++i) {
+        err = mTracks.itemAt(i)->start();
+
+        if (err != OK) {
+            break;
+        }
+    }
+
+    if (err == OK) {
+#if 0
+        schedulePoll();
+#else
+        // XXX the dongle doesn't appear to have setup the RTP connection
+        // fully at the time PLAY is called. We have to delay sending data
+        // for a little bit.
+        schedulePoll(500000ll);
+#endif
+    }
+
+    return err;
+}
+
+status_t Serializer::onStop() {
+    for (size_t i = 0; i < mTracks.size(); ++i) {
+        mTracks.itemAt(i)->stop();
+    }
+
+    cancelPoll();
+
+    return OK;
+}
+
+int64_t Serializer::onPoll() {
+    int64_t minTimeUs = -1ll;
+    ssize_t minTrackIndex = -1;
+
+    for (size_t i = 0; i < mTracks.size(); ++i) {
+        const sp<Track> &track = mTracks.itemAt(i);
+
+        track->readBufferIfNecessary();
+
+        if (!track->reachedEOS()) {
+            int64_t timeUs = track->bufferTimeUs();
+
+            if (minTrackIndex < 0 || timeUs < minTimeUs) {
+                minTimeUs = timeUs;
+                minTrackIndex = i;
+            }
+        }
+    }
+
+    if (minTrackIndex < 0) {
+        sp<AMessage> notify = mNotify->dup();
+        notify->setInt32("what", kWhatEOS);
+        notify->post();
+
+        return -1ll;
+    }
+
+    if (mThrottle) {
+        int64_t nowUs = ALooper::GetNowUs();
+
+        if (mStartTimeUs < 0ll) {
+            mStartTimeUs = nowUs;
+        }
+
+        int64_t lateByUs = nowUs - (minTimeUs + mStartTimeUs);
+
+        if (lateByUs < 0ll) {
+            // Too early
+            return -lateByUs;
+        }
+    }
+
+    sp<AMessage> notify = mNotify->dup();
+
+    notify->setInt32("what", kWhatAccessUnit);
+    notify->setSize("trackIndex", minTrackIndex);
+
+    notify->setBuffer(
+            "accessUnit", mTracks.itemAt(minTrackIndex)->drainBuffer());
+
+    notify->post();
+
+    return 0ll;
+}
+
+void Serializer::schedulePoll(int64_t delayUs) {
+    sp<AMessage> msg = new AMessage(kWhatPoll, id());
+    msg->setInt32("generation", mPollGeneration);
+    msg->post(delayUs);
+}
+
+void Serializer::cancelPoll() {
+    ++mPollGeneration;
+}
+
+}  // namespace android
diff --git a/media/libstagefright/wifi-display/source/Serializer.h b/media/libstagefright/wifi-display/source/Serializer.h
new file mode 100644
index 0000000..07950fa
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/Serializer.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SERIALIZER_H_
+
+#define SERIALIZER_H_
+
+#include <media/stagefright/foundation/AHandler.h>
+#include <utils/Vector.h>
+
+namespace android {
+
+struct AMessage;
+struct MediaSource;
+
+// After adding a number of MediaSource objects and starting the Serializer,
+// it'll emit their access units in order of increasing timestamps.
+struct Serializer : public AHandler {
+    enum {
+        kWhatEOS,
+        kWhatAccessUnit
+    };
+
+    // In throttled operation, data is emitted at a pace corresponding
+    // to the incoming media timestamps.
+    Serializer(bool throttle, const sp<AMessage> &notify);
+
+    ssize_t addSource(const sp<MediaSource> &source);
+
+    status_t start();
+    status_t stop();
+
+protected:
+    virtual void onMessageReceived(const sp<AMessage> &what);
+    virtual ~Serializer();
+
+private:
+    enum {
+        kWhatAddSource,
+        kWhatStart,
+        kWhatStop,
+        kWhatPoll
+    };
+
+    struct Track;
+
+    bool mThrottle;
+    sp<AMessage> mNotify;
+    Vector<sp<Track> > mTracks;
+
+    int32_t mPollGeneration;
+
+    int64_t mStartTimeUs;
+
+    status_t postSynchronouslyAndReturnError(const sp<AMessage> &msg);
+
+    ssize_t onAddSource(const sp<AMessage> &msg);
+    status_t onStart();
+    status_t onStop();
+    int64_t onPoll();
+
+    void schedulePoll(int64_t delayUs = 0ll);
+    void cancelPoll();
+
+    DISALLOW_EVIL_CONSTRUCTORS(Serializer);
+};
+
+}  // namespace android
+
+#endif  // SERIALIZER_H_
+
diff --git a/media/libstagefright/wifi-display/source/TSPacketizer.cpp b/media/libstagefright/wifi-display/source/TSPacketizer.cpp
new file mode 100644
index 0000000..b9a3e9b
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/TSPacketizer.cpp
@@ -0,0 +1,694 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "TSPacketizer"
+#include <utils/Log.h>
+
+#include "TSPacketizer.h"
+#include "include/avc_utils.h"
+
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/foundation/hexdump.h>
+#include <media/stagefright/MediaDefs.h>
+#include <media/stagefright/MediaErrors.h>
+
+#include <arpa/inet.h>
+
+namespace android {
+
+struct TSPacketizer::Track : public RefBase {
+    Track(const sp<AMessage> &format,
+          unsigned PID, unsigned streamType, unsigned streamID);
+
+    unsigned PID() const;
+    unsigned streamType() const;
+    unsigned streamID() const;
+
+    // Returns the previous value.
+    unsigned incrementContinuityCounter();
+
+    bool isAudio() const;
+    bool isVideo() const;
+
+    bool isH264() const;
+    bool lacksADTSHeader() const;
+
+    sp<ABuffer> prependCSD(const sp<ABuffer> &accessUnit) const;
+    sp<ABuffer> prependADTSHeader(const sp<ABuffer> &accessUnit) const;
+
+protected:
+    virtual ~Track();
+
+private:
+    sp<AMessage> mFormat;
+
+    unsigned mPID;
+    unsigned mStreamType;
+    unsigned mStreamID;
+    unsigned mContinuityCounter;
+
+    AString mMIME;
+    Vector<sp<ABuffer> > mCSD;
+
+    DISALLOW_EVIL_CONSTRUCTORS(Track);
+};
+
+TSPacketizer::Track::Track(
+        const sp<AMessage> &format,
+        unsigned PID, unsigned streamType, unsigned streamID)
+    : mFormat(format),
+      mPID(PID),
+      mStreamType(streamType),
+      mStreamID(streamID),
+      mContinuityCounter(0) {
+    CHECK(format->findString("mime", &mMIME));
+
+    if (!strcasecmp(mMIME.c_str(), MEDIA_MIMETYPE_VIDEO_AVC)
+            || !strcasecmp(mMIME.c_str(), MEDIA_MIMETYPE_AUDIO_AAC)) {
+        for (size_t i = 0;; ++i) {
+            sp<ABuffer> csd;
+            if (!format->findBuffer(StringPrintf("csd-%d", i).c_str(), &csd)) {
+                break;
+            }
+
+            mCSD.push(csd);
+        }
+    }
+}
+
+TSPacketizer::Track::~Track() {
+}
+
+unsigned TSPacketizer::Track::PID() const {
+    return mPID;
+}
+
+unsigned TSPacketizer::Track::streamType() const {
+    return mStreamType;
+}
+
+unsigned TSPacketizer::Track::streamID() const {
+    return mStreamID;
+}
+
+unsigned TSPacketizer::Track::incrementContinuityCounter() {
+    unsigned prevCounter = mContinuityCounter;
+
+    if (++mContinuityCounter == 16) {
+        mContinuityCounter = 0;
+    }
+
+    return prevCounter;
+}
+
+bool TSPacketizer::Track::isAudio() const {
+    return !strncasecmp("audio/", mMIME.c_str(), 6);
+}
+
+bool TSPacketizer::Track::isVideo() const {
+    return !strncasecmp("video/", mMIME.c_str(), 6);
+}
+
+bool TSPacketizer::Track::isH264() const {
+    return !strcasecmp(mMIME.c_str(), MEDIA_MIMETYPE_VIDEO_AVC);
+}
+
+bool TSPacketizer::Track::lacksADTSHeader() const {
+    if (strcasecmp(mMIME.c_str(), MEDIA_MIMETYPE_AUDIO_AAC)) {
+        return false;
+    }
+
+    int32_t isADTS;
+    if (mFormat->findInt32("is-adts", &isADTS) && isADTS != 0) {
+        return false;
+    }
+
+    return true;
+}
+
+sp<ABuffer> TSPacketizer::Track::prependCSD(
+        const sp<ABuffer> &accessUnit) const {
+    size_t size = 0;
+    for (size_t i = 0; i < mCSD.size(); ++i) {
+        size += mCSD.itemAt(i)->size();
+    }
+
+    sp<ABuffer> dup = new ABuffer(accessUnit->size() + size);
+    size_t offset = 0;
+    for (size_t i = 0; i < mCSD.size(); ++i) {
+        const sp<ABuffer> &csd = mCSD.itemAt(i);
+
+        memcpy(dup->data() + offset, csd->data(), csd->size());
+        offset += csd->size();
+    }
+
+    memcpy(dup->data() + offset, accessUnit->data(), accessUnit->size());
+
+    return dup;
+}
+
+sp<ABuffer> TSPacketizer::Track::prependADTSHeader(
+        const sp<ABuffer> &accessUnit) const {
+    CHECK_EQ(mCSD.size(), 1u);
+
+    const uint8_t *codec_specific_data = mCSD.itemAt(0)->data();
+
+    const uint32_t aac_frame_length = accessUnit->size() + 7;
+
+    sp<ABuffer> dup = new ABuffer(aac_frame_length);
+
+    unsigned profile = (codec_specific_data[0] >> 3) - 1;
+
+    unsigned sampling_freq_index =
+        ((codec_specific_data[0] & 7) << 1)
+        | (codec_specific_data[1] >> 7);
+
+    unsigned channel_configuration =
+        (codec_specific_data[1] >> 3) & 0x0f;
+
+    uint8_t *ptr = dup->data();
+
+    *ptr++ = 0xff;
+    *ptr++ = 0xf1;  // b11110001, ID=0, layer=0, protection_absent=1
+
+    *ptr++ =
+        profile << 6
+        | sampling_freq_index << 2
+        | ((channel_configuration >> 2) & 1);  // private_bit=0
+
+    // original_copy=0, home=0, copyright_id_bit=0, copyright_id_start=0
+    *ptr++ =
+        (channel_configuration & 3) << 6
+        | aac_frame_length >> 11;
+    *ptr++ = (aac_frame_length >> 3) & 0xff;
+    *ptr++ = (aac_frame_length & 7) << 5;
+
+    // adts_buffer_fullness=0, number_of_raw_data_blocks_in_frame=0
+    *ptr++ = 0;
+
+    memcpy(ptr, accessUnit->data(), accessUnit->size());
+
+    return dup;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+TSPacketizer::TSPacketizer()
+    : mPATContinuityCounter(0),
+      mPMTContinuityCounter(0) {
+    initCrcTable();
+}
+
+TSPacketizer::~TSPacketizer() {
+}
+
+ssize_t TSPacketizer::addTrack(const sp<AMessage> &format) {
+    AString mime;
+    CHECK(format->findString("mime", &mime));
+
+    unsigned PIDStart;
+    bool isVideo = !strncasecmp("video/", mime.c_str(), 6);
+    bool isAudio = !strncasecmp("audio/", mime.c_str(), 6);
+
+    if (isVideo) {
+        PIDStart = 0x1011;
+    } else if (isAudio) {
+        PIDStart = 0x1100;
+    } else {
+        return ERROR_UNSUPPORTED;
+    }
+
+    unsigned streamType;
+    unsigned streamIDStart;
+    unsigned streamIDStop;
+
+    if (!strcasecmp(mime.c_str(), MEDIA_MIMETYPE_VIDEO_AVC)) {
+        streamType = 0x1b;
+        streamIDStart = 0xe0;
+        streamIDStop = 0xef;
+    } else if (!strcasecmp(mime.c_str(), MEDIA_MIMETYPE_AUDIO_AAC)) {
+        streamType = 0x0f;
+        streamIDStart = 0xc0;
+        streamIDStop = 0xdf;
+    } else {
+        return ERROR_UNSUPPORTED;
+    }
+
+    size_t numTracksOfThisType = 0;
+    unsigned PID = PIDStart;
+
+    for (size_t i = 0; i < mTracks.size(); ++i) {
+        const sp<Track> &track = mTracks.itemAt(i);
+
+        if (track->streamType() == streamType) {
+            ++numTracksOfThisType;
+        }
+
+        if ((isAudio && track->isAudio()) || (isVideo && track->isVideo())) {
+            ++PID;
+        }
+    }
+
+    unsigned streamID = streamIDStart + numTracksOfThisType;
+    if (streamID > streamIDStop) {
+        return -ERANGE;
+    }
+
+    sp<Track> track = new Track(format, PID, streamType, streamID);
+    return mTracks.add(track);
+}
+
+status_t TSPacketizer::packetize(
+        size_t trackIndex,
+        const sp<ABuffer> &_accessUnit,
+        sp<ABuffer> *packets,
+        uint32_t flags) {
+    sp<ABuffer> accessUnit = _accessUnit;
+
+    packets->clear();
+
+    if (trackIndex >= mTracks.size()) {
+        return -ERANGE;
+    }
+
+    int64_t timeUs;
+    CHECK(accessUnit->meta()->findInt64("timeUs", &timeUs));
+
+    const sp<Track> &track = mTracks.itemAt(trackIndex);
+
+    if (track->isH264()) {
+        if (IsIDR(accessUnit)) {
+            // prepend codec specific data, i.e. SPS and PPS.
+            accessUnit = track->prependCSD(accessUnit);
+        }
+    } else if (track->lacksADTSHeader()) {
+        accessUnit = track->prependADTSHeader(accessUnit);
+    }
+
+    // 0x47
+    // transport_error_indicator = b0
+    // payload_unit_start_indicator = b1
+    // transport_priority = b0
+    // PID
+    // transport_scrambling_control = b00
+    // adaptation_field_control = b??
+    // continuity_counter = b????
+    // -- payload follows
+    // packet_startcode_prefix = 0x000001
+    // stream_id
+    // PES_packet_length = 0x????
+    // reserved = b10
+    // PES_scrambling_control = b00
+    // PES_priority = b0
+    // data_alignment_indicator = b1
+    // copyright = b0
+    // original_or_copy = b0
+    // PTS_DTS_flags = b10  (PTS only)
+    // ESCR_flag = b0
+    // ES_rate_flag = b0
+    // DSM_trick_mode_flag = b0
+    // additional_copy_info_flag = b0
+    // PES_CRC_flag = b0
+    // PES_extension_flag = b0
+    // PES_header_data_length = 0x05
+    // reserved = b0010 (PTS)
+    // PTS[32..30] = b???
+    // reserved = b1
+    // PTS[29..15] = b??? ???? ???? ???? (15 bits)
+    // reserved = b1
+    // PTS[14..0] = b??? ???? ???? ???? (15 bits)
+    // reserved = b1
+    // the first fragment of "buffer" follows
+
+    size_t numTSPackets;
+    if (accessUnit->size() <= 170) {
+        numTSPackets = 1;
+    } else {
+        numTSPackets = 1 + ((accessUnit->size() - 170) + 183) / 184;
+    }
+
+    if (flags & EMIT_PAT_AND_PMT) {
+        numTSPackets += 2;
+    }
+
+    if (flags & EMIT_PCR) {
+        ++numTSPackets;
+    }
+
+    sp<ABuffer> buffer = new ABuffer(numTSPackets * 188);
+    uint8_t *packetDataStart = buffer->data();
+
+    if (flags & EMIT_PAT_AND_PMT) {
+        // Program Association Table (PAT):
+        // 0x47
+        // transport_error_indicator = b0
+        // payload_unit_start_indicator = b1
+        // transport_priority = b0
+        // PID = b0000000000000 (13 bits)
+        // transport_scrambling_control = b00
+        // adaptation_field_control = b01 (no adaptation field, payload only)
+        // continuity_counter = b????
+        // skip = 0x00
+        // --- payload follows
+        // table_id = 0x00
+        // section_syntax_indicator = b1
+        // must_be_zero = b0
+        // reserved = b11
+        // section_length = 0x00d
+        // transport_stream_id = 0x0000
+        // reserved = b11
+        // version_number = b00001
+        // current_next_indicator = b1
+        // section_number = 0x00
+        // last_section_number = 0x00
+        //   one program follows:
+        //   program_number = 0x0001
+        //   reserved = b111
+        //   program_map_PID = kPID_PMT (13 bits!)
+        // CRC = 0x????????
+
+        if (++mPATContinuityCounter == 16) {
+            mPATContinuityCounter = 0;
+        }
+
+        uint8_t *ptr = packetDataStart;
+        *ptr++ = 0x47;
+        *ptr++ = 0x40;
+        *ptr++ = 0x00;
+        *ptr++ = 0x10 | mPATContinuityCounter;
+        *ptr++ = 0x00;
+
+        const uint8_t *crcDataStart = ptr;
+        *ptr++ = 0x00;
+        *ptr++ = 0xb0;
+        *ptr++ = 0x0d;
+        *ptr++ = 0x00;
+        *ptr++ = 0x00;
+        *ptr++ = 0xc3;
+        *ptr++ = 0x00;
+        *ptr++ = 0x00;
+        *ptr++ = 0x00;
+        *ptr++ = 0x01;
+        *ptr++ = 0xe0 | (kPID_PMT >> 8);
+        *ptr++ = kPID_PMT & 0xff;
+
+        CHECK_EQ(ptr - crcDataStart, 12);
+        uint32_t crc = htonl(crc32(crcDataStart, ptr - crcDataStart));
+        memcpy(ptr, &crc, 4);
+        ptr += 4;
+
+        size_t sizeLeft = packetDataStart + 188 - ptr;
+        memset(ptr, 0xff, sizeLeft);
+
+        packetDataStart += 188;
+
+        // Program Map (PMT):
+        // 0x47
+        // transport_error_indicator = b0
+        // payload_unit_start_indicator = b1
+        // transport_priority = b0
+        // PID = kPID_PMT (13 bits)
+        // transport_scrambling_control = b00
+        // adaptation_field_control = b01 (no adaptation field, payload only)
+        // continuity_counter = b????
+        // skip = 0x00
+        // -- payload follows
+        // table_id = 0x02
+        // section_syntax_indicator = b1
+        // must_be_zero = b0
+        // reserved = b11
+        // section_length = 0x???
+        // program_number = 0x0001
+        // reserved = b11
+        // version_number = b00001
+        // current_next_indicator = b1
+        // section_number = 0x00
+        // last_section_number = 0x00
+        // reserved = b111
+        // PCR_PID = kPCR_PID (13 bits)
+        // reserved = b1111
+        // program_info_length = 0x000
+        //   one or more elementary stream descriptions follow:
+        //   stream_type = 0x??
+        //   reserved = b111
+        //   elementary_PID = b? ???? ???? ???? (13 bits)
+        //   reserved = b1111
+        //   ES_info_length = 0x000
+        // CRC = 0x????????
+
+        if (++mPMTContinuityCounter == 16) {
+            mPMTContinuityCounter = 0;
+        }
+
+        size_t section_length = 5 * mTracks.size() + 4 + 9;
+
+        ptr = packetDataStart;
+        *ptr++ = 0x47;
+        *ptr++ = 0x40 | (kPID_PMT >> 8);
+        *ptr++ = kPID_PMT & 0xff;
+        *ptr++ = 0x10 | mPMTContinuityCounter;
+        *ptr++ = 0x00;
+
+        crcDataStart = ptr;
+        *ptr++ = 0x02;
+        *ptr++ = 0xb0 | (section_length >> 8);
+        *ptr++ = section_length & 0xff;
+        *ptr++ = 0x00;
+        *ptr++ = 0x01;
+        *ptr++ = 0xc3;
+        *ptr++ = 0x00;
+        *ptr++ = 0x00;
+        *ptr++ = 0xe0 | (kPID_PCR >> 8);
+        *ptr++ = kPID_PCR & 0xff;
+        *ptr++ = 0xf0;
+        *ptr++ = 0x00;
+
+        for (size_t i = 0; i < mTracks.size(); ++i) {
+            const sp<Track> &track = mTracks.itemAt(i);
+
+            *ptr++ = track->streamType();
+            *ptr++ = 0xe0 | (track->PID() >> 8);
+            *ptr++ = track->PID() & 0xff;
+            *ptr++ = 0xf0;
+            *ptr++ = 0x00;
+        }
+
+        CHECK_EQ(ptr - crcDataStart, 12 + mTracks.size() * 5);
+        crc = htonl(crc32(crcDataStart, ptr - crcDataStart));
+        memcpy(ptr, &crc, 4);
+        ptr += 4;
+
+        sizeLeft = packetDataStart + 188 - ptr;
+        memset(ptr, 0xff, sizeLeft);
+
+        packetDataStart += 188;
+    }
+
+    if (flags & EMIT_PCR) {
+        // PCR stream
+        // 0x47
+        // transport_error_indicator = b0
+        // payload_unit_start_indicator = b1
+        // transport_priority = b0
+        // PID = kPCR_PID (13 bits)
+        // transport_scrambling_control = b00
+        // adaptation_field_control = b10 (adaptation field only, no payload)
+        // continuity_counter = b0000 (does not increment)
+        // adaptation_field_length = 183
+        // discontinuity_indicator = b0
+        // random_access_indicator = b0
+        // elementary_stream_priority_indicator = b0
+        // PCR_flag = b1
+        // OPCR_flag = b0
+        // splicing_point_flag = b0
+        // transport_private_data_flag = b0
+        // adaptation_field_extension_flag = b0
+        // program_clock_reference_base = b?????????????????????????????????
+        // reserved = b111111
+        // program_clock_reference_extension = b?????????
+
+#if 0
+        int64_t nowUs = ALooper::GetNowUs();
+#else
+        int64_t nowUs = timeUs;
+#endif
+
+        uint64_t PCR = nowUs * 27;  // PCR based on a 27MHz clock
+        uint64_t PCR_base = PCR / 300;
+        uint32_t PCR_ext = PCR % 300;
+
+        uint8_t *ptr = packetDataStart;
+        *ptr++ = 0x47;
+        *ptr++ = 0x40 | (kPID_PCR >> 8);
+        *ptr++ = kPID_PCR & 0xff;
+        *ptr++ = 0x20;
+        *ptr++ = 0xb7;  // adaptation_field_length
+        *ptr++ = 0x10;
+        *ptr++ = (PCR_base >> 25) & 0xff;
+        *ptr++ = (PCR_base >> 17) & 0xff;
+        *ptr++ = (PCR_base >> 9) & 0xff;
+        *ptr++ = ((PCR_base & 1) << 7) | 0x7e | ((PCR_ext >> 8) & 1);
+        *ptr++ = (PCR_ext & 0xff);
+
+        size_t sizeLeft = packetDataStart + 188 - ptr;
+        memset(ptr, 0xff, sizeLeft);
+
+        packetDataStart += 188;
+    }
+
+    uint32_t PTS = (timeUs * 9ll) / 100ll;
+
+    size_t PES_packet_length = accessUnit->size() + 8;
+    bool padding = (accessUnit->size() < (188 - 18));
+
+    if (PES_packet_length >= 65536) {
+        // This really should only happen for video.
+        CHECK(track->isVideo());
+
+        // It's valid to set this to 0 for video according to the specs.
+        PES_packet_length = 0;
+    }
+
+    uint8_t *ptr = packetDataStart;
+    *ptr++ = 0x47;
+    *ptr++ = 0x40 | (track->PID() >> 8);
+    *ptr++ = track->PID() & 0xff;
+    *ptr++ = (padding ? 0x30 : 0x10) | track->incrementContinuityCounter();
+
+    if (padding) {
+        size_t paddingSize = 188 - 18 - accessUnit->size();
+        *ptr++ = paddingSize - 1;
+        if (paddingSize >= 2) {
+            *ptr++ = 0x00;
+            memset(ptr, 0xff, paddingSize - 2);
+            ptr += paddingSize - 2;
+        }
+    }
+
+    *ptr++ = 0x00;
+    *ptr++ = 0x00;
+    *ptr++ = 0x01;
+    *ptr++ = track->streamID();
+    *ptr++ = PES_packet_length >> 8;
+    *ptr++ = PES_packet_length & 0xff;
+    *ptr++ = 0x84;
+    *ptr++ = 0x80;
+    *ptr++ = 0x05;
+    *ptr++ = 0x20 | (((PTS >> 30) & 7) << 1) | 1;
+    *ptr++ = (PTS >> 22) & 0xff;
+    *ptr++ = (((PTS >> 15) & 0x7f) << 1) | 1;
+    *ptr++ = (PTS >> 7) & 0xff;
+    *ptr++ = ((PTS & 0x7f) << 1) | 1;
+
+    // 18 bytes of TS/PES header leave 188 - 18 = 170 bytes for the payload
+
+    size_t sizeLeft = packetDataStart + 188 - ptr;
+    size_t copy = accessUnit->size();
+    if (copy > sizeLeft) {
+        copy = sizeLeft;
+    }
+
+    memcpy(ptr, accessUnit->data(), copy);
+    ptr += copy;
+    CHECK_EQ(sizeLeft, copy);
+    memset(ptr, 0xff, sizeLeft - copy);
+
+    packetDataStart += 188;
+
+    size_t offset = copy;
+    while (offset < accessUnit->size()) {
+        bool padding = (accessUnit->size() - offset) < (188 - 4);
+
+        // for subsequent fragments of "buffer":
+        // 0x47
+        // transport_error_indicator = b0
+        // payload_unit_start_indicator = b0
+        // transport_priority = b0
+        // PID = b0 0001 1110 ???? (13 bits) [0x1e0 + 1 + sourceIndex]
+        // transport_scrambling_control = b00
+        // adaptation_field_control = b??
+        // continuity_counter = b????
+        // the fragment of "buffer" follows.
+
+        uint8_t *ptr = packetDataStart;
+        *ptr++ = 0x47;
+        *ptr++ = 0x00 | (track->PID() >> 8);
+        *ptr++ = track->PID() & 0xff;
+
+        *ptr++ = (padding ? 0x30 : 0x10) | track->incrementContinuityCounter();
+
+        if (padding) {
+            size_t paddingSize = 188 - 4 - (accessUnit->size() - offset);
+            *ptr++ = paddingSize - 1;
+            if (paddingSize >= 2) {
+                *ptr++ = 0x00;
+                memset(ptr, 0xff, paddingSize - 2);
+                ptr += paddingSize - 2;
+            }
+        }
+
+        // 4 bytes of TS header leave 188 - 4 = 184 bytes for the payload
+
+        size_t sizeLeft = packetDataStart + 188 - ptr;
+        size_t copy = accessUnit->size() - offset;
+        if (copy > sizeLeft) {
+            copy = sizeLeft;
+        }
+
+        memcpy(ptr, accessUnit->data() + offset, copy);
+        ptr += copy;
+        CHECK_EQ(sizeLeft, copy);
+        memset(ptr, 0xff, sizeLeft - copy);
+
+        offset += copy;
+        packetDataStart += 188;
+    }
+
+    CHECK(packetDataStart == buffer->data() + buffer->capacity());
+
+    *packets = buffer;
+
+    return OK;
+}
+
+void TSPacketizer::initCrcTable() {
+    uint32_t poly = 0x04C11DB7;
+
+    for (int i = 0; i < 256; i++) {
+        uint32_t crc = i << 24;
+        for (int j = 0; j < 8; j++) {
+            crc = (crc << 1) ^ ((crc & 0x80000000) ? (poly) : 0);
+        }
+        mCrcTable[i] = crc;
+    }
+}
+
+uint32_t TSPacketizer::crc32(const uint8_t *start, size_t size) const {
+    uint32_t crc = 0xFFFFFFFF;
+    const uint8_t *p;
+
+    for (p = start; p < start + size; ++p) {
+        crc = (crc << 8) ^ mCrcTable[((crc >> 24) ^ *p) & 0xFF];
+    }
+
+    return crc;
+}
+
+}  // namespace android
+
diff --git a/media/libstagefright/wifi-display/source/TSPacketizer.h b/media/libstagefright/wifi-display/source/TSPacketizer.h
new file mode 100644
index 0000000..9dbeb27
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/TSPacketizer.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TS_PACKETIZER_H_
+
+#define TS_PACKETIZER_H_
+
+#include <media/stagefright/foundation/ABase.h>
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+#include <utils/Vector.h>
+
+namespace android {
+
+struct ABuffer;
+struct AMessage;
+
+// Forms the packets of a transport stream given access units.
+// Emits metadata tables (PAT and PMT) and timestamp stream (PCR) based
+// on flags.
+struct TSPacketizer : public RefBase {
+    TSPacketizer();
+
+    // Returns trackIndex or error.
+    ssize_t addTrack(const sp<AMessage> &format);
+
+    enum {
+        EMIT_PAT_AND_PMT = 1,
+        EMIT_PCR         = 2,
+    };
+    status_t packetize(
+            size_t trackIndex, const sp<ABuffer> &accessUnit,
+            sp<ABuffer> *packets,
+            uint32_t flags);
+
+protected:
+    virtual ~TSPacketizer();
+
+private:
+    enum {
+        kPID_PMT = 0x100,
+        kPID_PCR = 0x1000,
+    };
+
+    struct Track;
+
+    Vector<sp<Track> > mTracks;
+
+    unsigned mPATContinuityCounter;
+    unsigned mPMTContinuityCounter;
+
+    uint32_t mCrcTable[256];
+
+    void initCrcTable();
+    uint32_t crc32(const uint8_t *start, size_t size) const;
+
+    DISALLOW_EVIL_CONSTRUCTORS(TSPacketizer);
+};
+
+}  // namespace android
+
+#endif  // TS_PACKETIZER_H_
+
diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
new file mode 100644
index 0000000..a998dcd
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
@@ -0,0 +1,1053 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_NDEBUG 0
+#define LOG_TAG "WifiDisplaySource"
+#include <utils/Log.h>
+
+#include "WifiDisplaySource.h"
+#include "PlaybackSession.h"
+#include "ParsedMessage.h"
+
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/MediaErrors.h>
+
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+namespace android {
+
+WifiDisplaySource::WifiDisplaySource(const sp<ANetworkSession> &netSession)
+    : mNetSession(netSession),
+      mSessionID(0),
+      mReaperPending(false),
+      mNextCSeq(1) {
+}
+
+WifiDisplaySource::~WifiDisplaySource() {
+}
+
+status_t WifiDisplaySource::start(const char *iface) {
+    sp<AMessage> msg = new AMessage(kWhatStart, id());
+    msg->setString("iface", iface);
+
+    sp<AMessage> response;
+    status_t err = msg->postAndAwaitResponse(&response);
+
+    if (err != OK) {
+        return err;
+    }
+
+    if (!response->findInt32("err", &err)) {
+        err = OK;
+    }
+
+    return err;
+}
+
+status_t WifiDisplaySource::stop() {
+    sp<AMessage> msg = new AMessage(kWhatStop, id());
+
+    sp<AMessage> response;
+    status_t err = msg->postAndAwaitResponse(&response);
+
+    if (err != OK) {
+        return err;
+    }
+
+    if (!response->findInt32("err", &err)) {
+        err = OK;
+    }
+
+    return err;
+}
+
+void WifiDisplaySource::onMessageReceived(const sp<AMessage> &msg) {
+    switch (msg->what()) {
+        case kWhatStart:
+        {
+            uint32_t replyID;
+            CHECK(msg->senderAwaitsResponse(&replyID));
+
+            AString iface;
+            CHECK(msg->findString("iface", &iface));
+
+            status_t err = OK;
+
+            ssize_t colonPos = iface.find(":");
+
+            unsigned long port;
+
+            if (colonPos >= 0) {
+                const char *s = iface.c_str() + colonPos + 1;
+
+                char *end;
+                port = strtoul(s, &end, 10);
+
+                if (end == s || *end != '\0' || port > 65535) {
+                    err = -EINVAL;
+                } else {
+                    iface.erase(colonPos, iface.size() - colonPos);
+                }
+            } else {
+                port = kWifiDisplayDefaultPort;
+            }
+
+            struct in_addr addr;
+
+            if (err == OK) {
+                if (inet_aton(iface.c_str(), &addr) != 0) {
+                    sp<AMessage> notify = new AMessage(kWhatRTSPNotify, id());
+
+                    err = mNetSession->createRTSPServer(
+                            addr, port, notify, &mSessionID);
+                } else {
+                    err = -EINVAL;
+                }
+            }
+
+            sp<AMessage> response = new AMessage;
+            response->setInt32("err", err);
+            response->postReply(replyID);
+            break;
+        }
+
+        case kWhatRTSPNotify:
+        {
+            int32_t reason;
+            CHECK(msg->findInt32("reason", &reason));
+
+            switch (reason) {
+                case ANetworkSession::kWhatError:
+                {
+                    int32_t sessionID;
+                    CHECK(msg->findInt32("sessionID", &sessionID));
+
+                    int32_t err;
+                    CHECK(msg->findInt32("err", &err));
+
+                    AString detail;
+                    CHECK(msg->findString("detail", &detail));
+
+                    ALOGE("An error occurred in session %d (%d, '%s/%s').",
+                          sessionID,
+                          err,
+                          detail.c_str(),
+                          strerror(-err));
+
+                    mNetSession->destroySession(sessionID);
+
+                    mClientInfos.removeItem(sessionID);
+                    break;
+                }
+
+                case ANetworkSession::kWhatClientConnected:
+                {
+                    int32_t sessionID;
+                    CHECK(msg->findInt32("sessionID", &sessionID));
+
+                    ClientInfo info;
+                    CHECK(msg->findString("client-ip", &info.mRemoteIP));
+                    CHECK(msg->findString("server-ip", &info.mLocalIP));
+                    CHECK(msg->findInt32("server-port", &info.mLocalPort));
+                    info.mPlaybackSessionID = -1;
+
+                    ALOGI("We now have a client (%d) connected.", sessionID);
+
+                    mClientInfos.add(sessionID, info);
+
+                    status_t err = sendM1(sessionID);
+                    CHECK_EQ(err, (status_t)OK);
+                    break;
+                }
+
+                case ANetworkSession::kWhatData:
+                {
+                    onReceiveClientData(msg);
+                    break;
+                }
+
+                default:
+                    TRESPASS();
+            }
+            break;
+        }
+
+        case kWhatStop:
+        {
+            uint32_t replyID;
+            CHECK(msg->senderAwaitsResponse(&replyID));
+
+            for (size_t i = mPlaybackSessions.size(); i-- > 0;) {
+                const sp<PlaybackSession> &playbackSession =
+                    mPlaybackSessions.valueAt(i);
+
+                looper()->unregisterHandler(playbackSession->id());
+                mPlaybackSessions.removeItemsAt(i);
+            }
+
+            status_t err = OK;
+
+            sp<AMessage> response = new AMessage;
+            response->setInt32("err", err);
+            response->postReply(replyID);
+            break;
+        }
+
+        case kWhatReapDeadClients:
+        {
+            mReaperPending = false;
+
+            for (size_t i = mPlaybackSessions.size(); i-- > 0;) {
+                const sp<PlaybackSession> &playbackSession =
+                    mPlaybackSessions.valueAt(i);
+
+                if (playbackSession->getLastLifesignUs()
+                        + kPlaybackSessionTimeoutUs < ALooper::GetNowUs()) {
+                    ALOGI("playback session %d timed out, reaping.",
+                            mPlaybackSessions.keyAt(i));
+
+                    looper()->unregisterHandler(playbackSession->id());
+                    mPlaybackSessions.removeItemsAt(i);
+                }
+            }
+
+            if (!mPlaybackSessions.isEmpty()) {
+                scheduleReaper();
+            }
+            break;
+        }
+
+        case kWhatPlaybackSessionNotify:
+        {
+            int32_t playbackSessionID;
+            CHECK(msg->findInt32("playbackSessionID", &playbackSessionID));
+
+            int32_t what;
+            CHECK(msg->findInt32("what", &what));
+
+            ssize_t index = mPlaybackSessions.indexOfKey(playbackSessionID);
+            if (index >= 0) {
+                const sp<PlaybackSession> &playbackSession =
+                    mPlaybackSessions.valueAt(index);
+
+                if (what == PlaybackSession::kWhatSessionDead) {
+                    ALOGI("playback sessions %d wants to quit.",
+                          playbackSessionID);
+
+                    looper()->unregisterHandler(playbackSession->id());
+                    mPlaybackSessions.removeItemsAt(index);
+                } else {
+                    CHECK_EQ(what, PlaybackSession::kWhatBinaryData);
+
+                    int32_t channel;
+                    CHECK(msg->findInt32("channel", &channel));
+
+                    sp<ABuffer> data;
+                    CHECK(msg->findBuffer("data", &data));
+
+                    CHECK_LE(channel, 0xffu);
+                    CHECK_LE(data->size(), 0xffffu);
+
+                    int32_t sessionID;
+                    CHECK(msg->findInt32("sessionID", &sessionID));
+
+                    char header[4];
+                    header[0] = '$';
+                    header[1] = channel;
+                    header[2] = data->size() >> 8;
+                    header[3] = data->size() & 0xff;
+
+                    mNetSession->sendRequest(
+                            sessionID, header, sizeof(header));
+
+                    mNetSession->sendRequest(
+                            sessionID, data->data(), data->size());
+                }
+            }
+            break;
+        }
+
+        case kWhatKeepAlive:
+        {
+            int32_t sessionID;
+            CHECK(msg->findInt32("sessionID", &sessionID));
+
+            if (mClientInfos.indexOfKey(sessionID) < 0) {
+                // Obsolete event, client is already gone.
+                break;
+            }
+
+            sendM16(sessionID);
+            break;
+        }
+
+        default:
+            TRESPASS();
+    }
+}
+
+void WifiDisplaySource::registerResponseHandler(
+        int32_t sessionID, int32_t cseq, HandleRTSPResponseFunc func) {
+    ResponseID id;
+    id.mSessionID = sessionID;
+    id.mCSeq = cseq;
+    mResponseHandlers.add(id, func);
+}
+
+status_t WifiDisplaySource::sendM1(int32_t sessionID) {
+    AString request = "OPTIONS * RTSP/1.0\r\n";
+    AppendCommonResponse(&request, mNextCSeq);
+
+    request.append(
+            "Require: org.wfa.wfd1.0\r\n"
+            "\r\n");
+
+    status_t err =
+        mNetSession->sendRequest(sessionID, request.c_str(), request.size());
+
+    if (err != OK) {
+        return err;
+    }
+
+    registerResponseHandler(
+            sessionID, mNextCSeq, &WifiDisplaySource::onReceiveM1Response);
+
+    ++mNextCSeq;
+
+    return OK;
+}
+
+status_t WifiDisplaySource::sendM3(int32_t sessionID) {
+    AString body =
+        "wfd_video_formats\r\n"
+        "wfd_audio_codecs\r\n"
+        "wfd_client_rtp_ports\r\n";
+
+    AString request = "GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0\r\n";
+    AppendCommonResponse(&request, mNextCSeq);
+
+    request.append("Content-Type: text/parameters\r\n");
+    request.append(StringPrintf("Content-Length: %d\r\n", body.size()));
+    request.append("\r\n");
+    request.append(body);
+
+    status_t err =
+        mNetSession->sendRequest(sessionID, request.c_str(), request.size());
+
+    if (err != OK) {
+        return err;
+    }
+
+    registerResponseHandler(
+            sessionID, mNextCSeq, &WifiDisplaySource::onReceiveM3Response);
+
+    ++mNextCSeq;
+
+    return OK;
+}
+
+status_t WifiDisplaySource::sendM4(int32_t sessionID) {
+    // wfd_video_formats:
+    // 1 byte "native"
+    // 1 byte "preferred-display-mode-supported" 0 or 1
+    // one or more avc codec structures
+    //   1 byte profile
+    //   1 byte level
+    //   4 byte CEA mask
+    //   4 byte VESA mask
+    //   4 byte HH mask
+    //   1 byte latency
+    //   2 byte min-slice-slice
+    //   2 byte slice-enc-params
+    //   1 byte framerate-control-support
+    //   max-hres (none or 2 byte)
+    //   max-vres (none or 2 byte)
+
+    const ClientInfo &info = mClientInfos.valueFor(sessionID);
+
+    AString body = StringPrintf(
+        "wfd_video_formats: "
+        "30 00 02 02 00000040 00000000 00000000 00 0000 0000 00 none none\r\n"
+        "wfd_audio_codecs: AAC 00000001 00\r\n"  // 2 ch AAC 48kHz
+        "wfd_presentation_URL: rtsp://%s:%d/wfd1.0/streamid=0 none\r\n"
+        "wfd_client_rtp_ports: RTP/AVP/UDP;unicast 19000 0 mode=play\r\n",
+        info.mLocalIP.c_str(), info.mLocalPort);
+
+    AString request = "SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0\r\n";
+    AppendCommonResponse(&request, mNextCSeq);
+
+    request.append("Content-Type: text/parameters\r\n");
+    request.append(StringPrintf("Content-Length: %d\r\n", body.size()));
+    request.append("\r\n");
+    request.append(body);
+
+    status_t err =
+        mNetSession->sendRequest(sessionID, request.c_str(), request.size());
+
+    if (err != OK) {
+        return err;
+    }
+
+    registerResponseHandler(
+            sessionID, mNextCSeq, &WifiDisplaySource::onReceiveM4Response);
+
+    ++mNextCSeq;
+
+    return OK;
+}
+
+status_t WifiDisplaySource::sendM5(int32_t sessionID) {
+    AString body = "wfd_trigger_method: SETUP\r\n";
+
+    AString request = "SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0\r\n";
+    AppendCommonResponse(&request, mNextCSeq);
+
+    request.append("Content-Type: text/parameters\r\n");
+    request.append(StringPrintf("Content-Length: %d\r\n", body.size()));
+    request.append("\r\n");
+    request.append(body);
+
+    status_t err =
+        mNetSession->sendRequest(sessionID, request.c_str(), request.size());
+
+    if (err != OK) {
+        return err;
+    }
+
+    registerResponseHandler(
+            sessionID, mNextCSeq, &WifiDisplaySource::onReceiveM5Response);
+
+    ++mNextCSeq;
+
+    return OK;
+}
+
+status_t WifiDisplaySource::sendM16(int32_t sessionID) {
+    AString request = "GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0\r\n";
+    AppendCommonResponse(&request, mNextCSeq);
+
+    const ClientInfo &info = mClientInfos.valueFor(sessionID);
+    request.append(StringPrintf("Session: %d\r\n", info.mPlaybackSessionID));
+
+    request.append("Content-Length: 0\r\n");
+    request.append("\r\n");
+
+    status_t err =
+        mNetSession->sendRequest(sessionID, request.c_str(), request.size());
+
+    if (err != OK) {
+        return err;
+    }
+
+    registerResponseHandler(
+            sessionID, mNextCSeq, &WifiDisplaySource::onReceiveM16Response);
+
+    ++mNextCSeq;
+
+    return OK;
+}
+
+status_t WifiDisplaySource::onReceiveM1Response(
+        int32_t sessionID, const sp<ParsedMessage> &msg) {
+    int32_t statusCode;
+    if (!msg->getStatusCode(&statusCode)) {
+        return ERROR_MALFORMED;
+    }
+
+    if (statusCode != 200) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    return OK;
+}
+
+status_t WifiDisplaySource::onReceiveM3Response(
+        int32_t sessionID, const sp<ParsedMessage> &msg) {
+    int32_t statusCode;
+    if (!msg->getStatusCode(&statusCode)) {
+        return ERROR_MALFORMED;
+    }
+
+    if (statusCode != 200) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    return sendM4(sessionID);
+}
+
+status_t WifiDisplaySource::onReceiveM4Response(
+        int32_t sessionID, const sp<ParsedMessage> &msg) {
+    int32_t statusCode;
+    if (!msg->getStatusCode(&statusCode)) {
+        return ERROR_MALFORMED;
+    }
+
+    if (statusCode != 200) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    return sendM5(sessionID);
+}
+
+status_t WifiDisplaySource::onReceiveM5Response(
+        int32_t sessionID, const sp<ParsedMessage> &msg) {
+    int32_t statusCode;
+    if (!msg->getStatusCode(&statusCode)) {
+        return ERROR_MALFORMED;
+    }
+
+    if (statusCode != 200) {
+        return ERROR_UNSUPPORTED;
+    }
+
+    return OK;
+}
+
+status_t WifiDisplaySource::onReceiveM16Response(
+        int32_t sessionID, const sp<ParsedMessage> &msg) {
+    // If only the response was required to include a "Session:" header...
+
+    const ClientInfo &info = mClientInfos.valueFor(sessionID);
+
+    ssize_t index = mPlaybackSessions.indexOfKey(info.mPlaybackSessionID);
+    if (index >= 0) {
+        mPlaybackSessions.valueAt(index)->updateLiveness();
+
+        scheduleKeepAlive(sessionID);
+    }
+
+    return OK;
+}
+
+void WifiDisplaySource::scheduleReaper() {
+    if (mReaperPending) {
+        return;
+    }
+
+    mReaperPending = true;
+    (new AMessage(kWhatReapDeadClients, id()))->post(kReaperIntervalUs);
+}
+
+void WifiDisplaySource::scheduleKeepAlive(int32_t sessionID) {
+    // We need to send updates at least 5 secs before the timeout is set to
+    // expire, make sure the timeout is greater than 5 secs to begin with.
+    CHECK_GT(kPlaybackSessionTimeoutUs, 5000000ll);
+
+    sp<AMessage> msg = new AMessage(kWhatKeepAlive, id());
+    msg->setInt32("sessionID", sessionID);
+    msg->post(kPlaybackSessionTimeoutUs - 5000000ll);
+}
+
+void WifiDisplaySource::onReceiveClientData(const sp<AMessage> &msg) {
+    int32_t sessionID;
+    CHECK(msg->findInt32("sessionID", &sessionID));
+
+    sp<RefBase> obj;
+    CHECK(msg->findObject("data", &obj));
+
+    sp<ParsedMessage> data =
+        static_cast<ParsedMessage *>(obj.get());
+
+    ALOGV("session %d received '%s'",
+          sessionID, data->debugString().c_str());
+
+    AString method;
+    AString uri;
+    data->getRequestField(0, &method);
+
+    int32_t cseq;
+    if (!data->findInt32("cseq", &cseq)) {
+        sendErrorResponse(sessionID, "400 Bad Request", -1 /* cseq */);
+        return;
+    }
+
+    if (method.startsWith("RTSP/")) {
+        // This is a response.
+
+        ResponseID id;
+        id.mSessionID = sessionID;
+        id.mCSeq = cseq;
+
+        ssize_t index = mResponseHandlers.indexOfKey(id);
+
+        if (index < 0) {
+            ALOGW("Received unsolicited server response, cseq %d", cseq);
+            return;
+        }
+
+        HandleRTSPResponseFunc func = mResponseHandlers.valueAt(index);
+        mResponseHandlers.removeItemsAt(index);
+
+        status_t err = (this->*func)(sessionID, data);
+
+        if (err != OK) {
+            ALOGW("Response handler for session %d, cseq %d returned "
+                  "err %d (%s)",
+                  sessionID, cseq, err, strerror(-err));
+        }
+    } else {
+        AString version;
+        data->getRequestField(2, &version);
+        if (!(version == AString("RTSP/1.0"))) {
+            sendErrorResponse(sessionID, "505 RTSP Version not supported", cseq);
+            return;
+        }
+
+        if (method == "DESCRIBE") {
+            onDescribeRequest(sessionID, cseq, data);
+        } else if (method == "OPTIONS") {
+            onOptionsRequest(sessionID, cseq, data);
+        } else if (method == "SETUP") {
+            onSetupRequest(sessionID, cseq, data);
+        } else if (method == "PLAY") {
+            onPlayRequest(sessionID, cseq, data);
+        } else if (method == "PAUSE") {
+            onPauseRequest(sessionID, cseq, data);
+        } else if (method == "TEARDOWN") {
+            onTeardownRequest(sessionID, cseq, data);
+        } else if (method == "GET_PARAMETER") {
+            onGetParameterRequest(sessionID, cseq, data);
+        } else if (method == "SET_PARAMETER") {
+            onSetParameterRequest(sessionID, cseq, data);
+        } else {
+            sendErrorResponse(sessionID, "405 Method Not Allowed", cseq);
+        }
+    }
+}
+
+void WifiDisplaySource::onDescribeRequest(
+        int32_t sessionID,
+        int32_t cseq,
+        const sp<ParsedMessage> &data) {
+    int64_t nowUs = ALooper::GetNowUs();
+
+    AString sdp;
+    sdp.append("v=0\r\n");
+
+    sdp.append(StringPrintf(
+                "o=- %lld %lld IN IP4 0.0.0.0\r\n", nowUs, nowUs));
+
+    sdp.append(
+            "o=- 0 0 IN IP4 127.0.0.0\r\n"
+            "s=Sample\r\n"
+            "c=IN IP4 0.0.0.0\r\n"
+            "b=AS:502\r\n"
+            "t=0 0\r\n"
+            "a=control:*\r\n"
+            "a=range:npt=now-\r\n"
+            "m=video 0 RTP/AVP 33\r\n"
+            "a=rtpmap:33 MP2T/90000\r\n"
+            "a=control:\r\n");
+
+    AString response = "RTSP/1.0 200 OK\r\n";
+    AppendCommonResponse(&response, cseq);
+
+    response.append("Content-Type: application/sdp\r\n");
+
+    // response.append("Content-Base: rtsp://0.0.0.0:7236\r\n");
+    response.append(StringPrintf("Content-Length: %d\r\n", sdp.size()));
+    response.append("\r\n");
+    response.append(sdp);
+
+    status_t err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+}
+
+void WifiDisplaySource::onOptionsRequest(
+        int32_t sessionID,
+        int32_t cseq,
+        const sp<ParsedMessage> &data) {
+    int32_t playbackSessionID;
+    sp<PlaybackSession> playbackSession =
+        findPlaybackSession(data, &playbackSessionID);
+
+    if (playbackSession != NULL) {
+        playbackSession->updateLiveness();
+    }
+
+    AString response = "RTSP/1.0 200 OK\r\n";
+    AppendCommonResponse(&response, cseq);
+
+    response.append(
+            "Public: org.wfa.wfd1.0, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, "
+            "GET_PARAMETER, SET_PARAMETER\r\n");
+
+    response.append("\r\n");
+
+    status_t err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+
+    err = sendM3(sessionID);
+    CHECK_EQ(err, (status_t)OK);
+}
+
+void WifiDisplaySource::onSetupRequest(
+        int32_t sessionID,
+        int32_t cseq,
+        const sp<ParsedMessage> &data) {
+    ClientInfo *info = &mClientInfos.editValueFor(sessionID);
+    if (info->mPlaybackSessionID != -1) {
+        // We only support a single playback session per client.
+        // This is due to the reversed keep-alive design in the wfd specs...
+        sendErrorResponse(sessionID, "400 Bad Request", cseq);
+        return;
+    }
+
+    AString transport;
+    if (!data->findString("transport", &transport)) {
+        sendErrorResponse(sessionID, "400 Bad Request", cseq);
+        return;
+    }
+
+    bool useInterleavedTCP = false;
+
+    int clientRtp, clientRtcp;
+    if (transport.startsWith("RTP/AVP/TCP;")) {
+        AString interleaved;
+        if (!ParsedMessage::GetAttribute(
+                    transport.c_str(), "interleaved", &interleaved)
+                || sscanf(interleaved.c_str(), "%d-%d",
+                          &clientRtp, &clientRtcp) != 2) {
+            sendErrorResponse(sessionID, "400 Bad Request", cseq);
+            return;
+        }
+
+        useInterleavedTCP = true;
+    } else if (transport.startsWith("RTP/AVP;unicast;")
+            || transport.startsWith("RTP/AVP/UDP;unicast;")) {
+        bool badRequest = false;
+
+        AString clientPort;
+        if (!ParsedMessage::GetAttribute(
+                    transport.c_str(), "client_port", &clientPort)) {
+            badRequest = true;
+        } else if (sscanf(clientPort.c_str(), "%d-%d",
+                          &clientRtp, &clientRtcp) == 2) {
+        } else if (sscanf(clientPort.c_str(), "%d", &clientRtp) == 1) {
+            // No RTCP.
+            clientRtcp = -1;
+        } else {
+            badRequest = true;
+        }
+
+        if (badRequest) {
+            sendErrorResponse(sessionID, "400 Bad Request", cseq);
+            return;
+        }
+#if 1
+    // The LG dongle doesn't specify client_port=xxx apparently.
+    } else if (transport == "RTP/AVP/UDP;unicast") {
+        clientRtp = 19000;
+        clientRtcp = clientRtp + 1;
+#endif
+    } else {
+        sendErrorResponse(sessionID, "461 Unsupported Transport", cseq);
+        return;
+    }
+
+    int32_t playbackSessionID = makeUniquePlaybackSessionID();
+
+    sp<AMessage> notify = new AMessage(kWhatPlaybackSessionNotify, id());
+    notify->setInt32("playbackSessionID", playbackSessionID);
+    notify->setInt32("sessionID", sessionID);
+
+    sp<PlaybackSession> playbackSession =
+        new PlaybackSession(mNetSession, notify);
+
+    looper()->registerHandler(playbackSession);
+
+    AString uri;
+    data->getRequestField(1, &uri);
+
+    if (strncasecmp("rtsp://", uri.c_str(), 7)) {
+        sendErrorResponse(sessionID, "400 Bad Request", cseq);
+        return;
+    }
+
+    if (!(uri.startsWith("rtsp://") && uri.endsWith("/wfd1.0/streamid=0"))) {
+        sendErrorResponse(sessionID, "404 Not found", cseq);
+        return;
+    }
+
+    status_t err = playbackSession->init(
+            info->mRemoteIP.c_str(),
+            clientRtp,
+            clientRtcp,
+            useInterleavedTCP);
+
+    if (err != OK) {
+        looper()->unregisterHandler(playbackSession->id());
+        playbackSession.clear();
+    }
+
+    switch (err) {
+        case OK:
+            break;
+        case -ENOENT:
+            sendErrorResponse(sessionID, "404 Not Found", cseq);
+            return;
+        default:
+            sendErrorResponse(sessionID, "403 Forbidden", cseq);
+            return;
+    }
+
+    mPlaybackSessions.add(playbackSessionID, playbackSession);
+
+    info->mPlaybackSessionID = playbackSessionID;
+
+    AString response = "RTSP/1.0 200 OK\r\n";
+    AppendCommonResponse(&response, cseq, playbackSessionID);
+
+    if (useInterleavedTCP) {
+        response.append(
+                StringPrintf(
+                    "Transport: RTP/AVP/TCP;interleaved=%d-%d;",
+                    clientRtp, clientRtcp));
+    } else {
+        int32_t serverRtp = playbackSession->getRTPPort();
+
+        if (clientRtcp >= 0) {
+            response.append(
+                    StringPrintf(
+                        "Transport: RTP/AVP;unicast;client_port=%d-%d;"
+                        "server_port=%d-%d\r\n",
+                        clientRtp, clientRtcp, serverRtp, serverRtp + 1));
+        } else {
+            response.append(
+                    StringPrintf(
+                        "Transport: RTP/AVP;unicast;client_port=%d;"
+                        "server_port=%d\r\n",
+                        clientRtp, serverRtp));
+        }
+    }
+
+    response.append("\r\n");
+
+    err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+
+    scheduleReaper();
+    scheduleKeepAlive(sessionID);
+}
+
+void WifiDisplaySource::onPlayRequest(
+        int32_t sessionID,
+        int32_t cseq,
+        const sp<ParsedMessage> &data) {
+    int32_t playbackSessionID;
+    sp<PlaybackSession> playbackSession =
+        findPlaybackSession(data, &playbackSessionID);
+
+    if (playbackSession == NULL) {
+        sendErrorResponse(sessionID, "454 Session Not Found", cseq);
+        return;
+    }
+
+    status_t err = playbackSession->play();
+    CHECK_EQ(err, (status_t)OK);
+
+    AString response = "RTSP/1.0 200 OK\r\n";
+    AppendCommonResponse(&response, cseq, playbackSessionID);
+    response.append("Range: npt=now-\r\n");
+    response.append("\r\n");
+
+    err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+}
+
+void WifiDisplaySource::onPauseRequest(
+        int32_t sessionID,
+        int32_t cseq,
+        const sp<ParsedMessage> &data) {
+    int32_t playbackSessionID;
+    sp<PlaybackSession> playbackSession =
+        findPlaybackSession(data, &playbackSessionID);
+
+    if (playbackSession == NULL) {
+        sendErrorResponse(sessionID, "454 Session Not Found", cseq);
+        return;
+    }
+
+    status_t err = playbackSession->pause();
+    CHECK_EQ(err, (status_t)OK);
+
+    AString response = "RTSP/1.0 200 OK\r\n";
+    AppendCommonResponse(&response, cseq, playbackSessionID);
+    response.append("\r\n");
+
+    err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+}
+
+void WifiDisplaySource::onTeardownRequest(
+        int32_t sessionID,
+        int32_t cseq,
+        const sp<ParsedMessage> &data) {
+    int32_t playbackSessionID;
+    sp<PlaybackSession> playbackSession =
+        findPlaybackSession(data, &playbackSessionID);
+
+    if (playbackSession == NULL) {
+        sendErrorResponse(sessionID, "454 Session Not Found", cseq);
+        return;
+    }
+
+    looper()->unregisterHandler(playbackSession->id());
+    mPlaybackSessions.removeItem(playbackSessionID);
+
+    AString response = "RTSP/1.0 200 OK\r\n";
+    AppendCommonResponse(&response, cseq, playbackSessionID);
+    response.append("\r\n");
+
+    status_t err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+}
+
+void WifiDisplaySource::onGetParameterRequest(
+        int32_t sessionID,
+        int32_t cseq,
+        const sp<ParsedMessage> &data) {
+    int32_t playbackSessionID;
+    sp<PlaybackSession> playbackSession =
+        findPlaybackSession(data, &playbackSessionID);
+
+    if (playbackSession == NULL) {
+        sendErrorResponse(sessionID, "454 Session Not Found", cseq);
+        return;
+    }
+
+    playbackSession->updateLiveness();
+
+    AString response = "RTSP/1.0 200 OK\r\n";
+    AppendCommonResponse(&response, cseq, playbackSessionID);
+    response.append("\r\n");
+
+    status_t err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+}
+
+void WifiDisplaySource::onSetParameterRequest(
+        int32_t sessionID,
+        int32_t cseq,
+        const sp<ParsedMessage> &data) {
+    int32_t playbackSessionID;
+#if 0
+    // XXX the dongle does not include a "Session:" header in this request.
+    sp<PlaybackSession> playbackSession =
+        findPlaybackSession(data, &playbackSessionID);
+
+    if (playbackSession == NULL) {
+        sendErrorResponse(sessionID, "454 Session Not Found", cseq);
+        return;
+    }
+#else
+    CHECK_EQ(mPlaybackSessions.size(), 1u);
+    playbackSessionID = mPlaybackSessions.keyAt(0);
+    sp<PlaybackSession> playbackSession = mPlaybackSessions.valueAt(0);
+#endif
+
+    playbackSession->updateLiveness();
+
+    AString response = "RTSP/1.0 200 OK\r\n";
+    AppendCommonResponse(&response, cseq, playbackSessionID);
+    response.append("\r\n");
+
+    status_t err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+}
+
+// static
+void WifiDisplaySource::AppendCommonResponse(
+        AString *response, int32_t cseq, int32_t playbackSessionID) {
+    time_t now = time(NULL);
+    struct tm *now2 = gmtime(&now);
+    char buf[128];
+    strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S %z", now2);
+
+    response->append("Date: ");
+    response->append(buf);
+    response->append("\r\n");
+
+    response->append("Server: Mine/1.0\r\n");
+
+    if (cseq >= 0) {
+        response->append(StringPrintf("CSeq: %d\r\n", cseq));
+    }
+
+    if (playbackSessionID >= 0ll) {
+        response->append(
+                StringPrintf(
+                    "Session: %d;timeout=%lld\r\n",
+                    playbackSessionID, kPlaybackSessionTimeoutSecs));
+    }
+}
+
+void WifiDisplaySource::sendErrorResponse(
+        int32_t sessionID,
+        const char *errorDetail,
+        int32_t cseq) {
+    AString response;
+    response.append("RTSP/1.0 ");
+    response.append(errorDetail);
+    response.append("\r\n");
+
+    AppendCommonResponse(&response, cseq);
+
+    response.append("\r\n");
+
+    status_t err = mNetSession->sendRequest(sessionID, response.c_str());
+    CHECK_EQ(err, (status_t)OK);
+}
+
+int32_t WifiDisplaySource::makeUniquePlaybackSessionID() const {
+    for (;;) {
+        int32_t playbackSessionID = rand();
+
+        if (playbackSessionID == -1) {
+            // reserved.
+            continue;
+        }
+
+        for (size_t i = 0; i < mPlaybackSessions.size(); ++i) {
+            if (mPlaybackSessions.keyAt(i) == playbackSessionID) {
+                continue;
+            }
+        }
+
+        return playbackSessionID;
+    }
+}
+
+sp<WifiDisplaySource::PlaybackSession> WifiDisplaySource::findPlaybackSession(
+        const sp<ParsedMessage> &data, int32_t *playbackSessionID) const {
+    if (!data->findInt32("session", playbackSessionID)) {
+        *playbackSessionID = 0;
+        return NULL;
+    }
+
+    ssize_t index = mPlaybackSessions.indexOfKey(*playbackSessionID);
+    if (index < 0) {
+        return NULL;
+    }
+
+    return mPlaybackSessions.valueAt(index);
+}
+
+}  // namespace android
+
diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.h b/media/libstagefright/wifi-display/source/WifiDisplaySource.h
new file mode 100644
index 0000000..f56347d
--- /dev/null
+++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.h
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WIFI_DISPLAY_SOURCE_H_
+
+#define WIFI_DISPLAY_SOURCE_H_
+
+#include "ANetworkSession.h"
+
+#include <media/stagefright/foundation/AHandler.h>
+
+namespace android {
+
+struct ParsedMessage;
+
+// Represents the RTSP server acting as a wifi display source.
+// Manages incoming connections, sets up Playback sessions as necessary.
+struct WifiDisplaySource : public AHandler {
+    static const unsigned kWifiDisplayDefaultPort = 7236;
+
+    WifiDisplaySource(const sp<ANetworkSession> &netSession);
+
+    status_t start(const char *iface);
+    status_t stop();
+
+protected:
+    virtual ~WifiDisplaySource();
+    virtual void onMessageReceived(const sp<AMessage> &msg);
+
+private:
+    struct PlaybackSession;
+
+    enum {
+        kWhatStart,
+        kWhatRTSPNotify,
+        kWhatStop,
+        kWhatReapDeadClients,
+        kWhatPlaybackSessionNotify,
+        kWhatKeepAlive,
+    };
+
+    struct ResponseID {
+        int32_t mSessionID;
+        int32_t mCSeq;
+
+        bool operator<(const ResponseID &other) const {
+            return mSessionID < other.mSessionID
+                || (mSessionID == other.mSessionID
+                        && mCSeq < other.mCSeq);
+        }
+    };
+
+    typedef status_t (WifiDisplaySource::*HandleRTSPResponseFunc)(
+            int32_t sessionID, const sp<ParsedMessage> &msg);
+
+    static const int64_t kReaperIntervalUs = 1000000ll;
+
+    static const int64_t kPlaybackSessionTimeoutSecs = 30;
+
+    static const int64_t kPlaybackSessionTimeoutUs =
+        kPlaybackSessionTimeoutSecs * 1000000ll;
+
+    sp<ANetworkSession> mNetSession;
+    int32_t mSessionID;
+
+    struct ClientInfo {
+        AString mRemoteIP;
+        AString mLocalIP;
+        int32_t mLocalPort;
+        int32_t mPlaybackSessionID;
+    };
+    // by sessionID.
+    KeyedVector<int32_t, ClientInfo> mClientInfos;
+
+    bool mReaperPending;
+
+    int32_t mNextCSeq;
+
+    KeyedVector<ResponseID, HandleRTSPResponseFunc> mResponseHandlers;
+
+    KeyedVector<int32_t, sp<PlaybackSession> > mPlaybackSessions;
+
+    status_t sendM1(int32_t sessionID);
+    status_t sendM3(int32_t sessionID);
+    status_t sendM4(int32_t sessionID);
+    status_t sendM5(int32_t sessionID);
+    status_t sendM16(int32_t sessionID);
+
+    status_t onReceiveM1Response(
+            int32_t sessionID, const sp<ParsedMessage> &msg);
+
+    status_t onReceiveM3Response(
+            int32_t sessionID, const sp<ParsedMessage> &msg);
+
+    status_t onReceiveM4Response(
+            int32_t sessionID, const sp<ParsedMessage> &msg);
+
+    status_t onReceiveM5Response(
+            int32_t sessionID, const sp<ParsedMessage> &msg);
+
+    status_t onReceiveM16Response(
+            int32_t sessionID, const sp<ParsedMessage> &msg);
+
+    void registerResponseHandler(
+            int32_t sessionID, int32_t cseq, HandleRTSPResponseFunc func);
+
+    void onReceiveClientData(const sp<AMessage> &msg);
+
+    void onDescribeRequest(
+            int32_t sessionID,
+            int32_t cseq,
+            const sp<ParsedMessage> &data);
+
+    void onOptionsRequest(
+            int32_t sessionID,
+            int32_t cseq,
+            const sp<ParsedMessage> &data);
+
+    void onSetupRequest(
+            int32_t sessionID,
+            int32_t cseq,
+            const sp<ParsedMessage> &data);
+
+    void onPlayRequest(
+            int32_t sessionID,
+            int32_t cseq,
+            const sp<ParsedMessage> &data);
+
+    void onPauseRequest(
+            int32_t sessionID,
+            int32_t cseq,
+            const sp<ParsedMessage> &data);
+
+    void onTeardownRequest(
+            int32_t sessionID,
+            int32_t cseq,
+            const sp<ParsedMessage> &data);
+
+    void onGetParameterRequest(
+            int32_t sessionID,
+            int32_t cseq,
+            const sp<ParsedMessage> &data);
+
+    void onSetParameterRequest(
+            int32_t sessionID,
+            int32_t cseq,
+            const sp<ParsedMessage> &data);
+
+    void sendErrorResponse(
+            int32_t sessionID,
+            const char *errorDetail,
+            int32_t cseq);
+
+    static void AppendCommonResponse(
+            AString *response, int32_t cseq, int32_t playbackSessionID = -1ll);
+
+    void scheduleReaper();
+    void scheduleKeepAlive(int32_t sessionID);
+
+    int32_t makeUniquePlaybackSessionID() const;
+
+    sp<PlaybackSession> findPlaybackSession(
+            const sp<ParsedMessage> &data, int32_t *playbackSessionID) const;
+
+    DISALLOW_EVIL_CONSTRUCTORS(WifiDisplaySource);
+};
+
+}  // namespace android
+
+#endif  // WIFI_DISPLAY_SOURCE_H_
diff --git a/media/libstagefright/wifi-display/wfd.cpp b/media/libstagefright/wifi-display/wfd.cpp
new file mode 100644
index 0000000..5e7d9fd
--- /dev/null
+++ b/media/libstagefright/wifi-display/wfd.cpp
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2012, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "wfd"
+#include <utils/Log.h>
+
+#define SUPPORT_SINK    0
+
+#if SUPPORT_SINK
+#include "sink/WifiDisplaySink.h"
+#endif
+
+#include <binder/ProcessState.h>
+#include <binder/IServiceManager.h>
+#include <media/IMediaPlayerService.h>
+#include <media/stagefright/DataSource.h>
+#include <media/stagefright/foundation/ADebug.h>
+
+namespace android {
+
+static void enableDisableRemoteDisplay(const char *iface) {
+    sp<IServiceManager> sm = defaultServiceManager();
+    sp<IBinder> binder = sm->getService(String16("media.player"));
+
+    sp<IMediaPlayerService> service =
+        interface_cast<IMediaPlayerService>(binder);
+
+    CHECK(service.get() != NULL);
+
+    service->enableRemoteDisplay(iface);
+}
+
+}  // namespace android
+
+static void usage(const char *me) {
+    fprintf(stderr,
+            "usage:\n"
+#if SUPPORT_SINK
+            "           %s -c host[:port]\tconnect to wifi source\n"
+            "           -u uri        \tconnect to an rtsp uri\n"
+#endif
+            "           -e ip[:port]       \tenable remote display\n"
+            "           -d            \tdisable remote display\n",
+            me);
+}
+
+int main(int argc, char **argv) {
+    using namespace android;
+
+    ProcessState::self()->startThreadPool();
+
+    DataSource::RegisterDefaultSniffers();
+
+    AString connectToHost;
+    int32_t connectToPort = -1;
+    AString uri;
+
+    int res;
+    while ((res = getopt(argc, argv, "hc:l:u:e:d")) >= 0) {
+        switch (res) {
+#if SUPPORT_SINK
+            case 'c':
+            {
+                const char *colonPos = strrchr(optarg, ':');
+
+                if (colonPos == NULL) {
+                    connectToHost = optarg;
+                    connectToPort = WifiDisplaySource::kWifiDisplayDefaultPort;
+                } else {
+                    connectToHost.setTo(optarg, colonPos - optarg);
+
+                    char *end;
+                    connectToPort = strtol(colonPos + 1, &end, 10);
+
+                    if (*end != '\0' || end == colonPos + 1
+                            || connectToPort < 1 || connectToPort > 65535) {
+                        fprintf(stderr, "Illegal port specified.\n");
+                        exit(1);
+                    }
+                }
+                break;
+            }
+
+            case 'u':
+            {
+                uri = optarg;
+                break;
+            }
+#endif
+
+            case 'e':
+            {
+                enableDisableRemoteDisplay(optarg);
+                exit(0);
+                break;
+            }
+
+            case 'd':
+            {
+                enableDisableRemoteDisplay(NULL);
+                exit(0);
+                break;
+            }
+
+            case '?':
+            case 'h':
+            default:
+                usage(argv[0]);
+                exit(1);
+        }
+    }
+
+#if SUPPORT_SINK
+    if (connectToPort < 0 && uri.empty()) {
+        fprintf(stderr,
+                "You need to select either source host or uri.\n");
+
+        exit(1);
+    }
+
+    if (connectToPort >= 0 && !uri.empty()) {
+        fprintf(stderr,
+                "You need to either connect to a wfd host or an rtsp url, "
+                "not both.\n");
+        exit(1);
+    }
+
+    sp<ANetworkSession> session = new ANetworkSession;
+    session->start();
+
+    sp<ALooper> looper = new ALooper;
+
+    sp<WifiDisplaySink> sink = new WifiDisplaySink(session);
+    looper->registerHandler(sink);
+
+    if (connectToPort >= 0) {
+        sink->start(connectToHost.c_str(), connectToPort);
+    } else {
+        sink->start(uri.c_str());
+    }
+
+    looper->start(true /* runOnCallingThread */);
+#endif
+
+    return 0;
+}
diff --git a/media/mtp/MtpDevice.cpp b/media/mtp/MtpDevice.cpp
index bf7795c..d672dff 100644
--- a/media/mtp/MtpDevice.cpp
+++ b/media/mtp/MtpDevice.cpp
@@ -667,7 +667,7 @@
 // reads the object's data and writes it to the specified file path
 bool MtpDevice::readObject(MtpObjectHandle handle, const char* destPath, int group, int perm) {
     ALOGD("readObject: %s", destPath);
-    int fd = ::open(destPath, O_RDWR | O_CREAT | O_TRUNC);
+    int fd = ::open(destPath, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
     if (fd < 0) {
         ALOGE("open failed for %s", destPath);
         return false;
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 5606187..662a93d 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -931,7 +931,7 @@
     initialData = ret - MTP_CONTAINER_HEADER_SIZE;
 
     mtp_file_range  mfr;
-    mfr.fd = open(mSendObjectFilePath, O_RDWR | O_CREAT | O_TRUNC);
+    mfr.fd = open(mSendObjectFilePath, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
     if (mfr.fd < 0) {
         result = MTP_RESPONSE_GENERAL_ERROR;
         goto done;
diff --git a/services/audioflinger/Android.mk b/services/audioflinger/Android.mk
index 8473fab..66759d1 100644
--- a/services/audioflinger/Android.mk
+++ b/services/audioflinger/Android.mk
@@ -13,32 +13,6 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_SRC_FILES := \
-    AudioBufferProviderSource.cpp   \
-    AudioStreamOutSink.cpp          \
-    AudioStreamInSource.cpp         \
-    NBAIO.cpp                       \
-    MonoPipe.cpp                    \
-    MonoPipeReader.cpp              \
-    Pipe.cpp                        \
-    PipeReader.cpp                  \
-    roundup.c                       \
-    SourceAudioBufferProvider.cpp
-
-# libsndfile license is incompatible; uncomment to use for local debug only
-#LOCAL_SRC_FILES += LibsndfileSink.cpp LibsndfileSource.cpp
-#LOCAL_C_INCLUDES += path/to/libsndfile/src
-#LOCAL_STATIC_LIBRARIES += libsndfile
-
-# uncomment for systrace
-# LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_AUDIO
-
-LOCAL_MODULE := libnbaio
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
 LOCAL_SRC_FILES:=               \
     AudioFlinger.cpp            \
     AudioMixer.cpp.arm          \
@@ -66,6 +40,7 @@
     libbinder \
     libmedia \
     libmedia_native \
+    libnbaio \
     libhardware \
     libhardware_legacy \
     libeffects \
@@ -74,7 +49,6 @@
 
 LOCAL_STATIC_LIBRARIES := \
     libscheduling_policy \
-    libnbaio \
     libcpustats \
     libmedia_helper
 
@@ -89,7 +63,7 @@
 
 LOCAL_CFLAGS += -DSTATE_QUEUE_INSTANTIATIONS='"StateQueueInstantiations.cpp"'
 
-LOCAL_CFLAGS += -DHAVE_REQUEST_PRIORITY -UFAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE -USOAKER
+LOCAL_CFLAGS += -UFAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE
 
 # uncomment for systrace
 # LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_AUDIO
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index aab9984..14f74b5 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -76,20 +76,14 @@
 #include "FastMixer.h"
 
 // NBAIO implementations
-#include "AudioStreamOutSink.h"
-#include "MonoPipe.h"
-#include "MonoPipeReader.h"
-#include "Pipe.h"
-#include "PipeReader.h"
-#include "SourceAudioBufferProvider.h"
+#include <media/nbaio/AudioStreamOutSink.h>
+#include <media/nbaio/MonoPipe.h>
+#include <media/nbaio/MonoPipeReader.h>
+#include <media/nbaio/Pipe.h>
+#include <media/nbaio/PipeReader.h>
+#include <media/nbaio/SourceAudioBufferProvider.h>
 
-#ifdef HAVE_REQUEST_PRIORITY
 #include "SchedulingPolicyService.h"
-#endif
-
-#ifdef SOAKER
-#include "Soaker.h"
-#endif
 
 // ----------------------------------------------------------------------------
 
@@ -167,6 +161,19 @@
 static uint32_t gScreenState; // incremented by 2 when screen state changes, bit 0 == 1 means "off"
                               // AudioFlinger::setParameters() updates, other threads read w/o lock
 
+// Priorities for requestPriority
+static const int kPriorityAudioApp = 2;
+static const int kPriorityFastMixer = 3;
+
+// IAudioFlinger::createTrack() reports back to client the total size of shared memory area
+// for the track.  The client then sub-divides this into smaller buffers for its use.
+// Currently the client uses double-buffering by default, but doesn't tell us about that.
+// So for now we just assume that client is double-buffered.
+// FIXME It would be better for client to tell AudioFlinger whether it wants double-buffering or
+// N-buffering, so AudioFlinger could allocate the right amount of memory.
+// See the client's minBufCount and mNotificationFramesAct calculations for details.
+static const int kFastTrackMultiplier = 2;
+
 // ----------------------------------------------------------------------------
 
 #ifdef ADD_BATTERY_DATA
@@ -216,9 +223,8 @@
 AudioFlinger::AudioFlinger()
     : BnAudioFlinger(),
       mPrimaryHardwareDev(NULL),
-      mHardwareStatus(AUDIO_HW_IDLE), // see also onFirstRef()
+      mHardwareStatus(AUDIO_HW_IDLE),
       mMasterVolume(1.0f),
-      mMasterVolumeSupportLvl(MVS_NONE),
       mMasterMute(false),
       mNextUniqueId(1),
       mMode(AUDIO_MODE_INVALID),
@@ -247,21 +253,17 @@
     }
 
     mMode = AUDIO_MODE_NORMAL;
-    mMasterVolumeSW = 1.0;
-    mMasterVolume   = 1.0;
-    mHardwareStatus = AUDIO_HW_IDLE;
 }
 
 AudioFlinger::~AudioFlinger()
 {
-
     while (!mRecordThreads.isEmpty()) {
-        // closeInput() will remove first entry from mRecordThreads
-        closeInput(mRecordThreads.keyAt(0));
+        // closeInput_nonvirtual() will remove specified entry from mRecordThreads
+        closeInput_nonvirtual(mRecordThreads.keyAt(0));
     }
     while (!mPlaybackThreads.isEmpty()) {
-        // closeOutput() will remove first entry from mPlaybackThreads
-        closeOutput(mPlaybackThreads.keyAt(0));
+        // closeOutput_nonvirtual() will remove specified entry from mPlaybackThreads
+        closeOutput_nonvirtual(mPlaybackThreads.keyAt(0));
     }
 
     for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
@@ -278,7 +280,9 @@
 };
 #define ARRAY_SIZE(x) (sizeof((x))/sizeof(((x)[0])))
 
-audio_hw_device_t* AudioFlinger::findSuitableHwDev_l(audio_module_handle_t module, uint32_t devices)
+AudioFlinger::AudioHwDevice* AudioFlinger::findSuitableHwDev_l(
+        audio_module_handle_t module,
+        audio_devices_t devices)
 {
     // if module is 0, the request comes from an old policy manager and we should load
     // well known modules
@@ -289,22 +293,23 @@
         }
     } else {
         // check a match for the requested module handle
-        AudioHwDevice *audioHwdevice = mAudioHwDevs.valueFor(module);
-        if (audioHwdevice != NULL) {
-            return audioHwdevice->hwDevice();
+        AudioHwDevice *audioHwDevice = mAudioHwDevs.valueFor(module);
+        if (audioHwDevice != NULL) {
+            return audioHwDevice;
         }
     }
     // then try to find a module supporting the requested device.
     for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
-        audio_hw_device_t *dev = mAudioHwDevs.valueAt(i)->hwDevice();
+        AudioHwDevice *audioHwDevice = mAudioHwDevs.valueAt(i);
+        audio_hw_device_t *dev = audioHwDevice->hwDevice();
         if ((dev->get_supported_devices(dev) & devices) == devices)
-            return dev;
+            return audioHwDevice;
     }
 
     return NULL;
 }
 
-status_t AudioFlinger::dumpClients(int fd, const Vector<String16>& args)
+void AudioFlinger::dumpClients(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -327,11 +332,10 @@
         result.append(buffer);
     }
     write(fd, result.string(), result.size());
-    return NO_ERROR;
 }
 
 
-status_t AudioFlinger::dumpInternals(int fd, const Vector<String16>& args)
+void AudioFlinger::dumpInternals(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -344,10 +348,9 @@
                             (uint32_t)(mStandbyTimeInNsecs / 1000000));
     result.append(buffer);
     write(fd, result.string(), result.size());
-    return NO_ERROR;
 }
 
-status_t AudioFlinger::dumpPermissionDenial(int fd, const Vector<String16>& args)
+void AudioFlinger::dumpPermissionDenial(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -358,7 +361,6 @@
             IPCThreadState::self()->getCallingUid());
     result.append(buffer);
     write(fd, result.string(), result.size());
-    return NO_ERROR;
 }
 
 static bool tryLock(Mutex& mutex)
@@ -440,7 +442,7 @@
         audio_stream_type_t streamType,
         uint32_t sampleRate,
         audio_format_t format,
-        uint32_t channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
         IAudioFlinger::track_flags_t flags,
         const sp<IMemory>& sharedBuffer,
@@ -515,7 +517,7 @@
             if (mPendingSyncEvents[i]->triggerSession() == lSessionId) {
                 if (thread->isValidSyncEvent(mPendingSyncEvents[i])) {
                     if (lStatus == NO_ERROR) {
-                        track->setSyncEvent(mPendingSyncEvents[i]);
+                        (void) track->setSyncEvent(mPendingSyncEvents[i]);
                     } else {
                         mPendingSyncEvents[i]->cancel();
                     }
@@ -610,30 +612,27 @@
         return PERMISSION_DENIED;
     }
 
-    float swmv = value;
-
     Mutex::Autolock _l(mLock);
+    mMasterVolume = value;
 
-    // when hw supports master volume, don't scale in sw mixer
-    if (MVS_NONE != mMasterVolumeSupportLvl) {
-        for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
-            AutoMutex lock(mHardwareLock);
-            audio_hw_device_t *dev = mAudioHwDevs.valueAt(i)->hwDevice();
+    // Set master volume in the HALs which support it.
+    for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
+        AutoMutex lock(mHardwareLock);
+        AudioHwDevice *dev = mAudioHwDevs.valueAt(i);
 
-            mHardwareStatus = AUDIO_HW_SET_MASTER_VOLUME;
-            if (NULL != dev->set_master_volume) {
-                dev->set_master_volume(dev, value);
-            }
-            mHardwareStatus = AUDIO_HW_IDLE;
+        mHardwareStatus = AUDIO_HW_SET_MASTER_VOLUME;
+        if (dev->canSetMasterVolume()) {
+            dev->hwDevice()->set_master_volume(dev->hwDevice(), value);
         }
-
-        swmv = 1.0;
+        mHardwareStatus = AUDIO_HW_IDLE;
     }
 
-    mMasterVolume   = value;
-    mMasterVolumeSW = swmv;
+    // Now set the master volume in each playback thread.  Playback threads
+    // assigned to HALs which do not have master volume support will apply
+    // master volume during the mix operation.  Threads with HALs which do
+    // support master volume will simply ignore the setting.
     for (size_t i = 0; i < mPlaybackThreads.size(); i++)
-        mPlaybackThreads.valueAt(i)->setMasterVolume(swmv);
+        mPlaybackThreads.valueAt(i)->setMasterVolume(value);
 
     return NO_ERROR;
 }
@@ -656,8 +655,9 @@
 
     { // scope for the lock
         AutoMutex lock(mHardwareLock);
+        audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
         mHardwareStatus = AUDIO_HW_SET_MODE;
-        ret = mPrimaryHardwareDev->set_mode(mPrimaryHardwareDev, mode);
+        ret = dev->set_mode(dev, mode);
         mHardwareStatus = AUDIO_HW_IDLE;
     }
 
@@ -684,8 +684,9 @@
     }
 
     AutoMutex lock(mHardwareLock);
+    audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
     mHardwareStatus = AUDIO_HW_SET_MIC_MUTE;
-    ret = mPrimaryHardwareDev->set_mic_mute(mPrimaryHardwareDev, state);
+    ret = dev->set_mic_mute(dev, state);
     mHardwareStatus = AUDIO_HW_IDLE;
     return ret;
 }
@@ -699,22 +700,44 @@
 
     bool state = AUDIO_MODE_INVALID;
     AutoMutex lock(mHardwareLock);
+    audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
     mHardwareStatus = AUDIO_HW_GET_MIC_MUTE;
-    mPrimaryHardwareDev->get_mic_mute(mPrimaryHardwareDev, &state);
+    dev->get_mic_mute(dev, &state);
     mHardwareStatus = AUDIO_HW_IDLE;
     return state;
 }
 
 status_t AudioFlinger::setMasterMute(bool muted)
 {
+    status_t ret = initCheck();
+    if (ret != NO_ERROR) {
+        return ret;
+    }
+
     // check calling permissions
     if (!settingsAllowed()) {
         return PERMISSION_DENIED;
     }
 
     Mutex::Autolock _l(mLock);
-    // This is an optimization, so PlaybackThread doesn't have to look at the one from AudioFlinger
     mMasterMute = muted;
+
+    // Set master mute in the HALs which support it.
+    for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
+        AutoMutex lock(mHardwareLock);
+        AudioHwDevice *dev = mAudioHwDevs.valueAt(i);
+
+        mHardwareStatus = AUDIO_HW_SET_MASTER_MUTE;
+        if (dev->canSetMasterMute()) {
+            dev->hwDevice()->set_master_mute(dev->hwDevice(), muted);
+        }
+        mHardwareStatus = AUDIO_HW_IDLE;
+    }
+
+    // Now set the master mute in each playback thread.  Playback threads
+    // assigned to HALs which do not have master mute support will apply master
+    // mute during the mix operation.  Threads with HALs which do support master
+    // mute will simply ignore the setting.
     for (size_t i = 0; i < mPlaybackThreads.size(); i++)
         mPlaybackThreads.valueAt(i)->setMasterMute(muted);
 
@@ -727,12 +750,6 @@
     return masterVolume_l();
 }
 
-float AudioFlinger::masterVolumeSW() const
-{
-    Mutex::Autolock _l(mLock);
-    return masterVolumeSW_l();
-}
-
 bool AudioFlinger::masterMute() const
 {
     Mutex::Autolock _l(mLock);
@@ -741,23 +758,14 @@
 
 float AudioFlinger::masterVolume_l() const
 {
-    if (MVS_FULL == mMasterVolumeSupportLvl) {
-        float ret_val;
-        AutoMutex lock(mHardwareLock);
-
-        mHardwareStatus = AUDIO_HW_GET_MASTER_VOLUME;
-        ALOG_ASSERT((NULL != mPrimaryHardwareDev) &&
-                    (NULL != mPrimaryHardwareDev->get_master_volume),
-                "can't get master volume");
-
-        mPrimaryHardwareDev->get_master_volume(mPrimaryHardwareDev, &ret_val);
-        mHardwareStatus = AUDIO_HW_IDLE;
-        return ret_val;
-    }
-
     return mMasterVolume;
 }
 
+bool AudioFlinger::masterMute_l() const
+{
+    return mMasterMute;
+}
+
 status_t AudioFlinger::setStreamVolume(audio_stream_type_t stream, float value,
         audio_io_handle_t output)
 {
@@ -876,17 +884,19 @@
             if (mBtNrecIsOff != btNrecIsOff) {
                 for (size_t i = 0; i < mRecordThreads.size(); i++) {
                     sp<RecordThread> thread = mRecordThreads.valueAt(i);
-                    RecordThread::RecordTrack *track = thread->track();
-                    if (track != NULL) {
-                        audio_devices_t device = (audio_devices_t)(
-                                thread->device() & AUDIO_DEVICE_IN_ALL);
-                        bool suspend = audio_is_bluetooth_sco_device(device) && btNrecIsOff;
+                    audio_devices_t device = thread->device() & AUDIO_DEVICE_IN_ALL;
+                    bool suspend = audio_is_bluetooth_sco_device(device) && btNrecIsOff;
+                    // collect all of the thread's session IDs
+                    KeyedVector<int, bool> ids = thread->sessionIds();
+                    // suspend effects associated with those session IDs
+                    for (size_t j = 0; j < ids.size(); ++j) {
+                        int sessionId = ids.keyAt(j);
                         thread->setEffectSuspended(FX_IID_AEC,
                                                    suspend,
-                                                   track->sessionId());
+                                                   sessionId);
                         thread->setEffectSuspended(FX_IID_NS,
                                                    suspend,
-                                                   track->sessionId());
+                                                   sessionId);
                     }
                 }
                 mBtNrecIsOff = btNrecIsOff;
@@ -908,7 +918,7 @@
     {
         Mutex::Autolock _l(mLock);
         thread = checkPlaybackThread_l(ioHandle);
-        if (thread == NULL) {
+        if (thread == 0) {
             thread = checkRecordThread_l(ioHandle);
         } else if (thread == primaryPlaybackThread_l()) {
             // indicate output device change to all input threads for pre processing
@@ -964,7 +974,8 @@
     return String8("");
 }
 
-size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const
+size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t format,
+        audio_channel_mask_t channelMask) const
 {
     status_t ret = initCheck();
     if (ret != NO_ERROR) {
@@ -975,20 +986,17 @@
     mHardwareStatus = AUDIO_HW_GET_INPUT_BUFFER_SIZE;
     struct audio_config config = {
         sample_rate: sampleRate,
-        channel_mask: audio_channel_in_mask_from_count(channelCount),
+        channel_mask: channelMask,
         format: format,
     };
-    size_t size = mPrimaryHardwareDev->get_input_buffer_size(mPrimaryHardwareDev, &config);
+    audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
+    size_t size = dev->get_input_buffer_size(dev, &config);
     mHardwareStatus = AUDIO_HW_IDLE;
     return size;
 }
 
 unsigned int AudioFlinger::getInputFramesLost(audio_io_handle_t ioHandle) const
 {
-    if (ioHandle == 0) {
-        return 0;
-    }
-
     Mutex::Autolock _l(mLock);
 
     RecordThread *recordThread = checkRecordThread_l(ioHandle);
@@ -1011,8 +1019,9 @@
     }
 
     AutoMutex lock(mHardwareLock);
+    audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
     mHardwareStatus = AUDIO_HW_SET_VOICE_VOLUME;
-    ret = mPrimaryHardwareDev->set_voice_volume(mPrimaryHardwareDev, value);
+    ret = dev->set_voice_volume(dev, value);
     mHardwareStatus = AUDIO_HW_IDLE;
 
     return ret;
@@ -1124,16 +1133,16 @@
 // ----------------------------------------------------------------------------
 
 AudioFlinger::ThreadBase::ThreadBase(const sp<AudioFlinger>& audioFlinger, audio_io_handle_t id,
-        uint32_t device, type_t type)
-    :   Thread(false),
+        audio_devices_t device, type_t type)
+    :   Thread(false /*canCallJava*/),
         mType(type),
         mAudioFlinger(audioFlinger), mSampleRate(0), mFrameCount(0), mNormalFrameCount(0),
         // mChannelMask
         mChannelCount(0),
         mFrameSize(1), mFormat(AUDIO_FORMAT_INVALID),
         mParamStatus(NO_ERROR),
-        mStandby(false), mId(id),
-        mDevice(device),
+        mStandby(false), mDevice(device), mId(id),
+        // mName will be set by concrete (non-virtual) subclass
         mDeathRecipient(new PMDeathRecipient(this))
 {
 }
@@ -1226,7 +1235,7 @@
     mLock.unlock();
 }
 
-status_t AudioFlinger::ThreadBase::dumpBase(int fd, const Vector<String16>& args)
+void AudioFlinger::ThreadBase::dumpBase(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -1283,10 +1292,9 @@
     if (locked) {
         mLock.unlock();
     }
-    return NO_ERROR;
 }
 
-status_t AudioFlinger::ThreadBase::dumpEffectChains(int fd, const Vector<String16>& args)
+void AudioFlinger::ThreadBase::dumpEffectChains(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -1301,7 +1309,6 @@
             chain->dump(fd, args);
         }
     }
-    return NO_ERROR;
 }
 
 void AudioFlinger::ThreadBase::acquireWakeLock()
@@ -1397,8 +1404,8 @@
         return;
     }
 
-    KeyedVector <int, sp<SuspendedSessionDesc> > sessionEffects =
-            mSuspendedSessions.editValueAt(index);
+    const KeyedVector <int, sp<SuspendedSessionDesc> >& sessionEffects =
+            mSuspendedSessions.valueAt(index);
 
     for (size_t i = 0; i < sessionEffects.size(); i++) {
         sp<SuspendedSessionDesc> desc = sessionEffects.valueAt(i);
@@ -1424,7 +1431,7 @@
 
     if (suspend) {
         if (index >= 0) {
-            sessionEffects = mSuspendedSessions.editValueAt(index);
+            sessionEffects = mSuspendedSessions.valueAt(index);
         } else {
             mSuspendedSessions.add(sessionId, sessionEffects);
         }
@@ -1432,7 +1439,7 @@
         if (index < 0) {
             return;
         }
-        sessionEffects = mSuspendedSessions.editValueAt(index);
+        sessionEffects = mSuspendedSessions.valueAt(index);
     }
 
 
@@ -1449,7 +1456,7 @@
         } else {
             desc = new SuspendedSessionDesc();
             if (type != NULL) {
-                memcpy(&desc->mType, type, sizeof(effect_uuid_t));
+                desc->mType = *type;
             }
             sessionEffects.add(key, desc);
             ALOGV("updateSuspendedSessions_l() suspend adding effect %08x", key);
@@ -1509,18 +1516,12 @@
 AudioFlinger::PlaybackThread::PlaybackThread(const sp<AudioFlinger>& audioFlinger,
                                              AudioStreamOut* output,
                                              audio_io_handle_t id,
-                                             uint32_t device,
+                                             audio_devices_t device,
                                              type_t type)
     :   ThreadBase(audioFlinger, id, device, type),
         mMixBuffer(NULL), mSuspended(0), mBytesWritten(0),
-        // Assumes constructor is called by AudioFlinger with it's mLock held,
-        // but it would be safer to explicitly pass initial masterMute as parameter
-        mMasterMute(audioFlinger->masterMute_l()),
         // mStreamTypes[] initialized in constructor body
         mOutput(output),
-        // Assumes constructor is called by AudioFlinger with it's mLock held,
-        // but it would be safer to explicitly pass initial masterVolume as parameter
-        mMasterVolume(audioFlinger->masterVolumeSW_l()),
         mLastWriteTime(0), mNumWrites(0), mNumDelayedWrites(0), mInWrite(false),
         mMixerStatus(MIXER_IDLE),
         mMixerStatusIgnoringFastTracks(MIXER_IDLE),
@@ -1531,6 +1532,25 @@
 {
     snprintf(mName, kNameLength, "AudioOut_%X", id);
 
+    // Assumes constructor is called by AudioFlinger with it's mLock held, but
+    // it would be safer to explicitly pass initial masterVolume/masterMute as
+    // parameter.
+    //
+    // If the HAL we are using has support for master volume or master mute,
+    // then do not attenuate or mute during mixing (just leave the volume at 1.0
+    // and the mute set to false).
+    mMasterVolume = audioFlinger->masterVolume_l();
+    mMasterMute = audioFlinger->masterMute_l();
+    if (mOutput && mOutput->audioHwDev) {
+        if (mOutput->audioHwDev->canSetMasterVolume()) {
+            mMasterVolume = 1.0;
+        }
+
+        if (mOutput->audioHwDev->canSetMasterMute()) {
+            mMasterMute = false;
+        }
+    }
+
     readOutputParameters();
 
     // mStreamTypes[AUDIO_STREAM_CNT] is initialized by stream_type_t default constructor
@@ -1549,15 +1569,14 @@
     delete [] mMixBuffer;
 }
 
-status_t AudioFlinger::PlaybackThread::dump(int fd, const Vector<String16>& args)
+void AudioFlinger::PlaybackThread::dump(int fd, const Vector<String16>& args)
 {
     dumpInternals(fd, args);
     dumpTracks(fd, args);
     dumpEffectChains(fd, args);
-    return NO_ERROR;
 }
 
-status_t AudioFlinger::PlaybackThread::dumpTracks(int fd, const Vector<String16>& args)
+void AudioFlinger::PlaybackThread::dumpTracks(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -1605,11 +1624,9 @@
     FastTrackUnderruns underruns = getFastTrackUnderruns(0);
     fdprintf(fd, "Normal mixer raw underrun counters: partial=%u empty=%u\n",
             underruns.mBitFields.mPartial, underruns.mBitFields.mEmpty);
-
-    return NO_ERROR;
 }
 
-status_t AudioFlinger::PlaybackThread::dumpInternals(int fd, const Vector<String16>& args)
+void AudioFlinger::PlaybackThread::dumpInternals(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -1633,8 +1650,6 @@
     fdprintf(fd, "Fast track availMask=%#x\n", mFastTrackAvailMask);
 
     dumpBase(fd, args);
-
-    return NO_ERROR;
 }
 
 // Thread virtuals
@@ -1660,7 +1675,7 @@
         audio_stream_type_t streamType,
         uint32_t sampleRate,
         audio_format_t format,
-        uint32_t channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
         const sp<IMemory>& sharedBuffer,
         int sessionId,
@@ -1688,7 +1703,7 @@
               (
                 (tid != -1) &&
                 ((frameCount == 0) ||
-                (frameCount >= (int) (mFrameCount * 2))) // * 2 is due to SRC jitter, see below
+                (frameCount >= (int) (mFrameCount * kFastTrackMultiplier)))
               )
             ) &&
             // PCM data
@@ -1709,13 +1724,13 @@
         ) {
         // if frameCount not specified, then it defaults to fast mixer (HAL) frame count
         if (frameCount == 0) {
-            frameCount = mFrameCount * 2;   // FIXME * 2 is due to SRC jitter, should be computed
+            frameCount = mFrameCount * kFastTrackMultiplier;
         }
         ALOGV("AUDIO_OUTPUT_FLAG_FAST accepted: frameCount=%d mFrameCount=%d",
                 frameCount, mFrameCount);
       } else {
         ALOGV("AUDIO_OUTPUT_FLAG_FAST denied: isTimed=%d sharedBuffer=%p frameCount=%d "
-                "mFrameCount=%d format=%d isLinear=%d channelMask=%d sampleRate=%d mSampleRate=%d "
+                "mFrameCount=%d format=%d isLinear=%d channelMask=%#x sampleRate=%d mSampleRate=%d "
                 "hasFastMixer=%d tid=%d fastTrackAvailMask=%#x",
                 isTimed, sharedBuffer.get(), frameCount, mFrameCount, format,
                 audio_is_linear_pcm(format),
@@ -1789,7 +1804,7 @@
             track = TimedTrack::create(this, client, streamType, sampleRate, format,
                     channelMask, frameCount, sharedBuffer, sessionId);
         }
-        if (track == NULL || track->getCblk() == NULL || track->name() < 0) {
+        if (track == 0 || track->getCblk() == NULL || track->name() < 0) {
             lStatus = NO_MEMORY;
             goto Exit;
         }
@@ -1804,18 +1819,16 @@
         }
     }
 
-#ifdef HAVE_REQUEST_PRIORITY
     if ((flags & IAudioFlinger::TRACK_FAST) && (tid != -1)) {
         pid_t callingPid = IPCThreadState::self()->getCallingPid();
         // we don't have CAP_SYS_NICE, nor do we want to have it as it's too powerful,
         // so ask activity manager to do this on our behalf
-        int err = requestPriority(callingPid, tid, 1);
+        int err = requestPriority(callingPid, tid, kPriorityAudioApp);
         if (err != 0) {
             ALOGW("Policy SCHED_FIFO priority %d is unavailable for pid %d tid %d; error %d",
-                    1, callingPid, tid, err);
+                    kPriorityAudioApp, callingPid, tid, err);
         }
     }
-#endif
 
     lStatus = NO_ERROR;
 
@@ -1857,13 +1870,25 @@
 void AudioFlinger::PlaybackThread::setMasterVolume(float value)
 {
     Mutex::Autolock _l(mLock);
-    mMasterVolume = value;
+    // Don't apply master volume in SW if our HAL can do it for us.
+    if (mOutput && mOutput->audioHwDev &&
+        mOutput->audioHwDev->canSetMasterVolume()) {
+        mMasterVolume = 1.0;
+    } else {
+        mMasterVolume = value;
+    }
 }
 
 void AudioFlinger::PlaybackThread::setMasterMute(bool muted)
 {
     Mutex::Autolock _l(mLock);
-    setMasterMute_l(muted);
+    // Don't apply master mute in SW if our HAL can do it for us.
+    if (mOutput && mOutput->audioHwDev &&
+        mOutput->audioHwDev->canSetMasterMute()) {
+        mMasterMute = false;
+    } else {
+        mMasterMute = muted;
+    }
 }
 
 void AudioFlinger::PlaybackThread::setStreamVolume(audio_stream_type_t stream, float value)
@@ -2073,7 +2098,7 @@
     return mOutput->stream->get_render_position(mOutput->stream, dspFrames);
 }
 
-uint32_t AudioFlinger::PlaybackThread::hasAudioSession(int sessionId)
+uint32_t AudioFlinger::PlaybackThread::hasAudioSession(int sessionId) const
 {
     Mutex::Autolock _l(mLock);
     uint32_t result = 0;
@@ -2155,7 +2180,7 @@
     for (size_t i = 0; i < mTracks.size(); ++i) {
         sp<Track> track = mTracks[i];
         if (event->triggerSession() == track->sessionId()) {
-            track->setSyncEvent(event);
+            (void) track->setSyncEvent(event);
             return NO_ERROR;
         }
     }
@@ -2163,15 +2188,9 @@
     return NAME_NOT_FOUND;
 }
 
-bool AudioFlinger::PlaybackThread::isValidSyncEvent(const sp<SyncEvent>& event)
+bool AudioFlinger::PlaybackThread::isValidSyncEvent(const sp<SyncEvent>& event) const
 {
-    switch (event->type()) {
-    case AudioSystem::SYNC_EVENT_PRESENTATION_COMPLETE:
-        return true;
-    default:
-        break;
-    }
-    return false;
+    return event->type() == AudioSystem::SYNC_EVENT_PRESENTATION_COMPLETE;
 }
 
 void AudioFlinger::PlaybackThread::threadLoop_removeTracks(const Vector< sp<Track> >& tracksToRemove)
@@ -2192,28 +2211,25 @@
 // ----------------------------------------------------------------------------
 
 AudioFlinger::MixerThread::MixerThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output,
-        audio_io_handle_t id, uint32_t device, type_t type)
+        audio_io_handle_t id, audio_devices_t device, type_t type)
     :   PlaybackThread(audioFlinger, output, id, device, type),
         // mAudioMixer below
-#ifdef SOAKER
-        mSoaker(NULL),
-#endif
         // mFastMixer below
         mFastMixerFutex(0)
         // mOutputSink below
         // mPipeSink below
         // mNormalSink below
 {
-    ALOGV("MixerThread() id=%d device=%d type=%d", id, device, type);
-    ALOGV("mSampleRate=%d, mChannelMask=%d, mChannelCount=%d, mFormat=%d, mFrameSize=%d, "
+    ALOGV("MixerThread() id=%d device=%#x type=%d", id, device, type);
+    ALOGV("mSampleRate=%d, mChannelMask=%#x, mChannelCount=%d, mFormat=%d, mFrameSize=%d, "
             "mFrameCount=%d, mNormalFrameCount=%d",
             mSampleRate, mChannelMask, mChannelCount, mFormat, mFrameSize, mFrameCount,
             mNormalFrameCount);
     mAudioMixer = new AudioMixer(mNormalFrameCount, mSampleRate);
 
     // FIXME - Current mixer implementation only supports stereo output
-    if (mChannelCount == 1) {
-        ALOGE("Invalid audio hardware channel count");
+    if (mChannelCount != FCC_2) {
+        ALOGE("Invalid audio hardware channel count %d", mChannelCount);
     }
 
     // create an NBAIO sink for the HAL output stream, and negotiate
@@ -2267,13 +2283,6 @@
         mTeeSource = teeSource;
 #endif
 
-#ifdef SOAKER
-        // create a soaker as workaround for governor issues
-        mSoaker = new Soaker();
-        // FIXME Soaker should only run when needed, i.e. when FastMixer is not in COLD_IDLE
-        mSoaker->run("Soaker", PRIORITY_LOWEST);
-#endif
-
         // create fast mixer and configure it initially with just one fast track for our submix
         mFastMixer = new FastMixer();
         FastMixerStateQueue *sq = mFastMixer->sq();
@@ -2305,14 +2314,12 @@
 
         // start the fast mixer
         mFastMixer->run("FastMixer", PRIORITY_URGENT_AUDIO);
-#ifdef HAVE_REQUEST_PRIORITY
         pid_t tid = mFastMixer->getTid();
-        int err = requestPriority(getpid_cached, tid, 2);
+        int err = requestPriority(getpid_cached, tid, kPriorityFastMixer);
         if (err != 0) {
             ALOGW("Policy SCHED_FIFO priority %d is unavailable for pid %d tid %d; error %d",
-                    2, getpid_cached, tid, err);
+                    kPriorityFastMixer, getpid_cached, tid, err);
         }
-#endif
 
 #ifdef AUDIO_WATCHDOG
         // create and start the watchdog
@@ -2320,10 +2327,10 @@
         mAudioWatchdog->setDump(&mAudioWatchdogDump);
         mAudioWatchdog->run("AudioWatchdog", PRIORITY_URGENT_AUDIO);
         tid = mAudioWatchdog->getTid();
-        err = requestPriority(getpid_cached, tid, 1);
+        err = requestPriority(getpid_cached, tid, kPriorityFastMixer);
         if (err != 0) {
             ALOGW("Policy SCHED_FIFO priority %d is unavailable for pid %d tid %d; error %d",
-                    1, getpid_cached, tid, err);
+                    kPriorityFastMixer, getpid_cached, tid, err);
         }
 #endif
 
@@ -2370,12 +2377,6 @@
         delete fastTrack->mBufferProvider;
         sq->end(false /*didModify*/);
         delete mFastMixer;
-#ifdef SOAKER
-        if (mSoaker != NULL) {
-            mSoaker->requestExitAndWait();
-        }
-        delete mSoaker;
-#endif
         if (mAudioWatchdog != 0) {
             mAudioWatchdog->requestExit();
             mAudioWatchdog->requestExitAndWait();
@@ -2508,9 +2509,6 @@
 
     // MIXER
     nsecs_t lastWarning = 0;
-if (mType == MIXER) {
-    longStandbyExit = false;
-}
 
     // DUPLICATING
     // FIXME could this be made local to while loop?
@@ -2519,9 +2517,9 @@
     cacheParameters_l();
     sleepTime = idleSleepTime;
 
-if (mType == MIXER) {
-    sleepTimeShift = 0;
-}
+    if (mType == MIXER) {
+        sleepTimeShift = 0;
+    }
 
     CpuStats cpuStats;
     const String8 myName(String8::format("thread %p type %d TID %d", this, mType, gettid()));
@@ -2548,7 +2546,7 @@
 
             // put audio hardware into standby after short delay
             if (CC_UNLIKELY((!mActiveTracks.size() && systemTime() > standbyTime) ||
-                        mSuspended > 0)) {
+                        isSuspended())) {
                 if (!mStandby) {
 
                     threadLoop_standby();
@@ -2602,7 +2600,7 @@
             threadLoop_sleepTime();
         }
 
-        if (mSuspended > 0) {
+        if (isSuspended()) {
             sleepTime = suspendSleepTimeUs();
         }
 
@@ -2635,11 +2633,6 @@
                             ns2ms(delta), mNumDelayedWrites, this);
                     lastWarning = now;
                 }
-                // FIXME this is broken: longStandbyExit should be handled out of the if() and with
-                // a different threshold. Or completely removed for what it is worth anyway...
-                if (mStandby) {
-                    longStandbyExit = true;
-                }
             }
 }
 
@@ -2667,15 +2660,13 @@
         // is now local to this block, but will keep it for now (at least until merge done).
     }
 
-if (mType == MIXER || mType == DIRECT) {
-    // put output stream into standby mode
-    if (!mStandby) {
-        mOutput->stream->common.standby(&mOutput->stream->common);
+    // for DuplicatingThread, standby mode is handled by the outputTracks, otherwise ...
+    if (mType == MIXER || mType == DIRECT) {
+        // put output stream into standby mode
+        if (!mStandby) {
+            mOutput->stream->common.standby(&mOutput->stream->common);
+        }
     }
-}
-if (mType == DUPLICATING) {
-    // for DuplicatingThread, standby mode is handled by the outputTracks
-}
 
     releaseWakeLock();
 
@@ -2794,7 +2785,7 @@
 // shared by MIXER and DIRECT, overridden by DUPLICATING
 void AudioFlinger::PlaybackThread::threadLoop_standby()
 {
-    ALOGV("Audio hardware entering standby, mixer %p, suspend count %u", this, mSuspended);
+    ALOGV("Audio hardware entering standby, mixer %p, suspend count %d", this, mSuspended);
     mOutput->stream->common.standby(&mOutput->stream->common);
 }
 
@@ -2804,9 +2795,10 @@
     int64_t pts;
     status_t status = INVALID_OPERATION;
 
-    if (NULL != mOutput->stream->get_next_write_timestamp) {
-        status = mOutput->stream->get_next_write_timestamp(
-                mOutput->stream, &pts);
+    if (mNormalSink != 0) {
+        status = mNormalSink->getNextWriteTimestamp(&pts);
+    } else {
+        status = mOutputSink->getNextWriteTimestamp(&pts);
     }
 
     if (status != NO_ERROR) {
@@ -2847,11 +2839,10 @@
         } else {
             sleepTime = idleSleepTime;
         }
-    } else if (mBytesWritten != 0 ||
-               (mMixerStatus == MIXER_TRACKS_ENABLED && longStandbyExit)) {
+    } else if (mBytesWritten != 0 || (mMixerStatus == MIXER_TRACKS_ENABLED)) {
         memset (mMixBuffer, 0, mixBufferSize);
         sleepTime = 0;
-        ALOGV_IF((mBytesWritten == 0 && (mMixerStatus == MIXER_TRACKS_ENABLED && longStandbyExit)), "anticipated start");
+        ALOGV_IF((mBytesWritten == 0 && (mMixerStatus == MIXER_TRACKS_ENABLED)), "anticipated start");
     }
     // TODO add standby time extension fct of effect tail
 }
@@ -3229,7 +3220,7 @@
             }
 
             //ALOGV("track %d u=%08x, s=%08x [NOT READY] on thread %p", name, cblk->user, cblk->server, this);
-            if ((track->sharedBuffer() != 0) || track->isTerminated() ||
+            if ((track->sharedBuffer() != 0) ||
                     track->isStopped() || track->isPaused()) {
                 // We have consumed all the buffers of this track.
                 // Remove it from the list of active tracks.
@@ -3249,8 +3240,8 @@
                 track->mUnderrunCount++;
                 // No buffers for this track. Give it a few chances to
                 // fill a buffer, then remove it from active list.
-                if (--(track->mRetryCount) <= 0) {
-                    ALOGV("BUFFER TIMEOUT: remove(%d) from active list on thread %p", name, this);
+                if (--(track->mRetryCount) <= 0 || track->isTerminated()) {
+                    ALOGV_IF(track->mRetryCount <= 0, "BUFFER TIMEOUT: remove(%d) from active list on thread %p", name, this);
                     tracksToRemove->add(track);
                     // indicate to client process that the track was disabled because of underrun;
                     // it will then automatically call start() when data is available
@@ -3373,7 +3364,7 @@
     idleSleepTime = idleSleepTimeUs();
 }
 
-void AudioFlinger::MixerThread::invalidateTracks(audio_stream_type_t streamType)
+void AudioFlinger::PlaybackThread::invalidateTracks(audio_stream_type_t streamType)
 {
     ALOGV ("MixerThread::invalidateTracks() mixer %p, streamType %d, mTracks.size %d",
             this,  streamType, mTracks.size());
@@ -3460,14 +3451,14 @@
 #ifdef ADD_BATTERY_DATA
             // when changing the audio output device, call addBatteryData to notify
             // the change
-            if ((int)mDevice != value) {
+            if (mDevice != value) {
                 uint32_t params = 0;
                 // check whether speaker is on
                 if (value & AUDIO_DEVICE_OUT_SPEAKER) {
                     params |= IMediaPlayerService::kBatteryDataSpeakerOn;
                 }
 
-                int deviceWithoutSpeaker
+                audio_devices_t deviceWithoutSpeaker
                     = AUDIO_DEVICE_OUT_ALL & ~AUDIO_DEVICE_OUT_SPEAKER;
                 // check if any other device (except speaker) is on
                 if (value & deviceWithoutSpeaker ) {
@@ -3482,7 +3473,7 @@
 
             // forward device change to effects that have requested to be
             // aware of attached audio device.
-            mDevice = (uint32_t)value;
+            mDevice = value;
             for (size_t i = 0; i < mEffectChains.size(); i++) {
                 mEffectChains[i]->setDevice_l(mDevice);
             }
@@ -3505,7 +3496,7 @@
                 readOutputParameters();
                 mAudioMixer = new AudioMixer(mNormalFrameCount, mSampleRate);
                 for (size_t i = 0; i < mTracks.size() ; i++) {
-                    int name = getTrackName_l((audio_channel_mask_t)mTracks[i]->mChannelMask);
+                    int name = getTrackName_l(mTracks[i]->mChannelMask);
                     if (name < 0) break;
                     mTracks[i]->mName = name;
                     // limit track sample rate to 2 x new output sample rate
@@ -3539,7 +3530,7 @@
     return reconfig;
 }
 
-status_t AudioFlinger::MixerThread::dumpInternals(int fd, const Vector<String16>& args)
+void AudioFlinger::MixerThread::dumpInternals(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -3593,7 +3584,8 @@
 #define TEE_SINK_READ 1024
                 short buffer[TEE_SINK_READ * FCC_2];
                 size_t count = TEE_SINK_READ;
-                ssize_t actual = teeSource->read(buffer, count);
+                ssize_t actual = teeSource->read(buffer, count,
+                        AudioBufferProvider::kInvalidPTS);
                 bool wasFirstRead = firstRead;
                 firstRead = false;
                 if (actual <= 0) {
@@ -3602,7 +3594,7 @@
                     }
                     break;
                 }
-                ALOG_ASSERT(actual <= count);
+                ALOG_ASSERT(actual <= (ssize_t)count);
                 write(teeFd, buffer, actual * channelCount * sizeof(short));
                 total += actual;
             }
@@ -3624,8 +3616,6 @@
         AudioWatchdogDump wdCopy = mAudioWatchdogDump;
         wdCopy.dump(fd);
     }
-
-    return NO_ERROR;
 }
 
 uint32_t AudioFlinger::MixerThread::idleSleepTimeUs() const
@@ -3651,7 +3641,7 @@
 
 // ----------------------------------------------------------------------------
 AudioFlinger::DirectOutputThread::DirectOutputThread(const sp<AudioFlinger>& audioFlinger,
-        AudioStreamOut* output, audio_io_handle_t id, uint32_t device)
+        AudioStreamOut* output, audio_io_handle_t id, audio_devices_t device)
     :   PlaybackThread(audioFlinger, output, id, device, DIRECT)
         // mLeftVolFloat, mRightVolFloat
 {
@@ -3751,7 +3741,7 @@
             }
 
             //ALOGV("track %d u=%08x, s=%08x [NOT READY]", track->name(), cblk->user, cblk->server);
-            if ((track->sharedBuffer() != 0) || track->isTerminated() ||
+            if ((track->sharedBuffer() != 0) ||
                     track->isStopped() || track->isPaused()) {
                 // We have consumed all the buffers of this track.
                 // Remove it from the list of active tracks.
@@ -3769,8 +3759,8 @@
             } else {
                 // No buffers for this track. Give it a few chances to
                 // fill a buffer, then remove it from active list.
-                if (--(track->mRetryCount) <= 0) {
-                    ALOGV("BUFFER TIMEOUT: remove(%d) from active list", track->name());
+                if (--(track->mRetryCount) <= 0 || track->isTerminated()) {
+                    ALOGV_IF(track->mRetryCount <= 0, "BUFFER TIMEOUT: remove(%d) from active list", track->name());
                     trackToRemove = track;
                 } else {
                     mixerStatus = MIXER_TRACKS_ENABLED;
@@ -4070,6 +4060,7 @@
             return false;
         }
         PlaybackThread *playbackThread = (PlaybackThread *)thread.get();
+        // see note at standby() declaration
         if (playbackThread->standby() && !playbackThread->isSuspended()) {
             ALOGV("DuplicatingThread output track %p on thread %p Not Ready", outputTracks[i].get(), thread.get());
             return false;
@@ -4099,7 +4090,7 @@
             const sp<Client>& client,
             uint32_t sampleRate,
             audio_format_t format,
-            uint32_t channelMask,
+            audio_channel_mask_t channelMask,
             int frameCount,
             const sp<IMemory>& sharedBuffer,
             int sessionId)
@@ -4274,7 +4265,7 @@
             audio_stream_type_t streamType,
             uint32_t sampleRate,
             audio_format_t format,
-            uint32_t channelMask,
+            audio_channel_mask_t channelMask,
             int frameCount,
             const sp<IMemory>& sharedBuffer,
             int sessionId,
@@ -4300,7 +4291,7 @@
         // 16 bit because data is converted to 16 bit before being stored in buffer by AudioTrack
         mCblk->frameSize = audio_is_linear_pcm(format) ? mChannelCount * sizeof(int16_t) : sizeof(uint8_t);
         // to avoid leaking a track name, do not allocate one unless there is an mCblk
-        mName = thread->getTrackName_l((audio_channel_mask_t)channelMask);
+        mName = thread->getTrackName_l(channelMask);
         mCblk->mName = mName;
         if (mName < 0) {
             ALOGE("no more track names available");
@@ -4329,11 +4320,6 @@
 AudioFlinger::PlaybackThread::Track::~Track()
 {
     ALOGV("PlaybackThread::Track destructor");
-    sp<ThreadBase> thread = mThread.promote();
-    if (thread != 0) {
-        Mutex::Autolock _l(thread->mLock);
-        mState = TERMINATED;
-    }
 }
 
 void AudioFlinger::PlaybackThread::Track::destroy()
@@ -4496,8 +4482,6 @@
         }
 
         buffer->raw = getBuffer(s, framesReq);
-        if (buffer->raw == NULL) goto getNextBuffer_exit;
-
         buffer->frameCount = framesReq;
         return NO_ERROR;
     }
@@ -4808,7 +4792,7 @@
         event->cancel();
         return INVALID_OPERATION;
     }
-    TrackBase::setSyncEvent(event);
+    (void) TrackBase::setSyncEvent(event);
     return NO_ERROR;
 }
 
@@ -4821,12 +4805,12 @@
             audio_stream_type_t streamType,
             uint32_t sampleRate,
             audio_format_t format,
-            uint32_t channelMask,
+            audio_channel_mask_t channelMask,
             int frameCount,
             const sp<IMemory>& sharedBuffer,
             int sessionId) {
     if (!client->reserveTimedTrack())
-        return NULL;
+        return 0;
 
     return new TimedTrack(
         thread, client, streamType, sampleRate, format, channelMask, frameCount,
@@ -4839,7 +4823,7 @@
             audio_stream_type_t streamType,
             uint32_t sampleRate,
             audio_format_t format,
-            uint32_t channelMask,
+            audio_channel_mask_t channelMask,
             int frameCount,
             const sp<IMemory>& sharedBuffer,
             int sessionId)
@@ -5061,7 +5045,7 @@
     AudioBufferProvider::Buffer* buffer, int64_t pts)
 {
     if (pts == AudioBufferProvider::kInvalidPTS) {
-        buffer->raw = 0;
+        buffer->raw = NULL;
         buffer->frameCount = 0;
         mTimedAudioOutputOnTime = false;
         return INVALID_OPERATION;
@@ -5076,7 +5060,7 @@
 
         // if we have no timed buffers, then fail
         if (mTimedBufferQueue.isEmpty()) {
-            buffer->raw = 0;
+            buffer->raw = NULL;
             buffer->frameCount = 0;
             return NOT_ENOUGH_DATA;
         }
@@ -5103,7 +5087,7 @@
                 // the transform failed.  this shouldn't happen, but if it does
                 // then just drop this buffer
                 ALOGW("timedGetNextBuffer transform failed");
-                buffer->raw = 0;
+                buffer->raw = NULL;
                 buffer->frameCount = 0;
                 trimTimedBufferQueueHead_l("getNextBuffer; no transform");
                 return NO_ERROR;
@@ -5112,7 +5096,7 @@
             if (mMediaTimeTransformTarget == TimedAudioTrack::COMMON_TIME) {
                 if (OK != mCCHelper.commonTimeToLocalTime(transformedPTS,
                                                           &headLocalPTS)) {
-                    buffer->raw = 0;
+                    buffer->raw = NULL;
                     buffer->frameCount = 0;
                     return INVALID_OPERATION;
                 }
@@ -5334,7 +5318,7 @@
             const sp<Client>& client,
             uint32_t sampleRate,
             audio_format_t format,
-            uint32_t channelMask,
+            audio_channel_mask_t channelMask,
             int frameCount,
             int sessionId)
     :   TrackBase(thread, client, sampleRate, format,
@@ -5355,10 +5339,7 @@
 
 AudioFlinger::RecordThread::RecordTrack::~RecordTrack()
 {
-    sp<ThreadBase> thread = mThread.promote();
-    if (thread != 0) {
-        AudioSystem::releaseInput(thread->id());
-    }
+    ALOGV("%s", __func__);
 }
 
 // AudioBufferProvider interface
@@ -5389,8 +5370,6 @@
         }
 
         buffer->raw = getBuffer(s, framesReq);
-        if (buffer->raw == NULL) goto getNextBuffer_exit;
-
         buffer->frameCount = framesReq;
         return NO_ERROR;
     }
@@ -5418,14 +5397,26 @@
     sp<ThreadBase> thread = mThread.promote();
     if (thread != 0) {
         RecordThread *recordThread = (RecordThread *)thread.get();
-        recordThread->stop(this);
-        TrackBase::reset();
-        // Force overrun condition to avoid false overrun callback until first data is
-        // read from buffer
-        android_atomic_or(CBLK_UNDERRUN_ON, &mCblk->flags);
+        recordThread->mLock.lock();
+        bool doStop = recordThread->stop_l(this);
+        if (doStop) {
+            TrackBase::reset();
+            // Force overrun condition to avoid false overrun callback until first data is
+            // read from buffer
+            android_atomic_or(CBLK_UNDERRUN_ON, &mCblk->flags);
+        }
+        recordThread->mLock.unlock();
+        if (doStop) {
+            AudioSystem::stopInput(recordThread->id());
+        }
     }
 }
 
+/*static*/ void AudioFlinger::RecordThread::RecordTrack::appendDumpHeader(String8& result)
+{
+    result.append("   Clien Fmt Chn mask   Session Buf  S SRate  Serv     User\n");
+}
+
 void AudioFlinger::RecordThread::RecordTrack::dump(char* buffer, size_t size)
 {
     snprintf(buffer, size, "   %05d %03u 0x%08x %05d   %04u %01d %05u  %08x %08x\n",
@@ -5448,7 +5439,7 @@
             DuplicatingThread *sourceThread,
             uint32_t sampleRate,
             audio_format_t format,
-            uint32_t channelMask,
+            audio_channel_mask_t channelMask,
             int frameCount)
     :   Track(playbackThread, NULL, AUDIO_STREAM_CNT, sampleRate, format, channelMask, frameCount,
                 NULL, 0, IAudioFlinger::TRACK_DEFAULT),
@@ -5836,9 +5827,10 @@
         audio_io_handle_t input,
         uint32_t sampleRate,
         audio_format_t format,
-        uint32_t channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
         IAudioFlinger::track_flags_t flags,
+        pid_t tid,
         int *sessionId,
         status_t *status)
 {
@@ -5877,13 +5869,8 @@
             }
         }
         // create new record track. The record track uses one track in mHardwareMixerThread by convention.
-        recordTrack = thread->createRecordTrack_l(client,
-                                                sampleRate,
-                                                format,
-                                                channelMask,
-                                                frameCount,
-                                                lSessionId,
-                                                &lStatus);
+        recordTrack = thread->createRecordTrack_l(client, sampleRate, format, channelMask,
+                                                  frameCount, lSessionId, flags, tid, &lStatus);
     }
     if (lStatus != NO_ERROR) {
         // remove local strong reference to Client before deleting the RecordTrack so that the Client
@@ -5913,19 +5900,24 @@
 }
 
 AudioFlinger::RecordHandle::~RecordHandle() {
-    stop();
+    stop_nonvirtual();
+    mRecordTrack->destroy();
 }
 
 sp<IMemory> AudioFlinger::RecordHandle::getCblk() const {
     return mRecordTrack->getCblk();
 }
 
-status_t AudioFlinger::RecordHandle::start(int event, int triggerSession) {
+status_t AudioFlinger::RecordHandle::start(int /*AudioSystem::sync_event_t*/ event, int triggerSession) {
     ALOGV("RecordHandle::start()");
     return mRecordTrack->start((AudioSystem::sync_event_t)event, triggerSession);
 }
 
 void AudioFlinger::RecordHandle::stop() {
+    stop_nonvirtual();
+}
+
+void AudioFlinger::RecordHandle::stop_nonvirtual() {
     ALOGV("RecordHandle::stop()");
     mRecordTrack->stop();
 }
@@ -5941,13 +5933,13 @@
 AudioFlinger::RecordThread::RecordThread(const sp<AudioFlinger>& audioFlinger,
                                          AudioStreamIn *input,
                                          uint32_t sampleRate,
-                                         uint32_t channels,
+                                         audio_channel_mask_t channelMask,
                                          audio_io_handle_t id,
-                                         uint32_t device) :
+                                         audio_devices_t device) :
     ThreadBase(audioFlinger, id, device, RECORD),
-    mInput(input), mTrack(NULL), mResampler(NULL), mRsmpOutBuffer(NULL), mRsmpInBuffer(NULL),
+    mInput(input), mResampler(NULL), mRsmpOutBuffer(NULL), mRsmpInBuffer(NULL),
     // mRsmpInIndex and mInputBytes set by readInputParameters()
-    mReqChannelCount(popcount(channels)),
+    mReqChannelCount(popcount(channelMask)),
     mReqSampleRate(sampleRate)
     // mBytesRead is only meaningful while active, and so is cleared in start()
     // (but might be better to also clear here for dump?)
@@ -5985,6 +5977,7 @@
 
     nsecs_t lastWarning = 0;
 
+    inputStandBy();
     acquireWakeLock();
 
     // start recording
@@ -5996,10 +5989,7 @@
             Mutex::Autolock _l(mLock);
             checkForNewParameters_l();
             if (mActiveTrack == 0 && mConfigEvents.isEmpty()) {
-                if (!mStandby) {
-                    mInput->stream->common.standby(&mInput->stream->common);
-                    mStandby = true;
-                }
+                standby();
 
                 if (exitPending()) break;
 
@@ -6013,10 +6003,7 @@
             }
             if (mActiveTrack != 0) {
                 if (mActiveTrack->mState == TrackBase::PAUSING) {
-                    if (!mStandby) {
-                        mInput->stream->common.standby(&mInput->stream->common);
-                        mStandby = true;
-                    }
+                    standby();
                     mActiveTrack.clear();
                     mStartStopCond.broadcast();
                 } else if (mActiveTrack->mState == TrackBase::RESUMING) {
@@ -6034,6 +6021,9 @@
                         mStartStopCond.broadcast();
                     }
                     mStandby = false;
+                } else if (mActiveTrack->mState == TrackBase::TERMINATED) {
+                    removeTrack_l(mActiveTrack);
+                    mActiveTrack.clear();
                 }
             }
             lockEffectChains_l(effectChains);
@@ -6068,18 +6058,12 @@
                                 mFormat != AUDIO_FORMAT_PCM_16_BIT) {
                                 memcpy(dst, src, framesIn * mFrameSize);
                             } else {
-                                int16_t *src16 = (int16_t *)src;
-                                int16_t *dst16 = (int16_t *)dst;
                                 if (mChannelCount == 1) {
-                                    while (framesIn--) {
-                                        *dst16++ = *src16;
-                                        *dst16++ = *src16++;
-                                    }
+                                    upmix_to_stereo_i16_from_mono_i16((int16_t *)dst,
+                                            (int16_t *)src, framesIn);
                                 } else {
-                                    while (framesIn--) {
-                                        *dst16++ = (int16_t)(((int32_t)*src16 + (int32_t)*(src16 + 1)) >> 1);
-                                        src16 += 2;
-                                    }
+                                    downmix_to_mono_i16_from_stereo_i16((int16_t *)dst,
+                                            (int16_t *)src, framesIn);
                                 }
                             }
                         }
@@ -6097,7 +6081,7 @@
                                 if (mActiveTrack->mState == TrackBase::ACTIVE) {
                                     // Force input into standby so that it tries to
                                     // recover at next read attempt
-                                    mInput->stream->common.standby(&mInput->stream->common);
+                                    inputStandBy();
                                     usleep(kRecordThreadSleepUs);
                                 }
                                 mRsmpInIndex = mFrameCount;
@@ -6114,18 +6098,14 @@
                     if (mChannelCount == 1 && mReqChannelCount == 1) {
                         framesOut >>= 1;
                     }
-                    mResampler->resample(mRsmpOutBuffer, framesOut, this);
+                    mResampler->resample(mRsmpOutBuffer, framesOut, this /* AudioBufferProvider* */);
                     // ditherAndClamp() works as long as all buffers returned by mActiveTrack->getNextBuffer()
                     // are 32 bit aligned which should be always true.
                     if (mChannelCount == 2 && mReqChannelCount == 1) {
                         ditherAndClamp(mRsmpOutBuffer, mRsmpOutBuffer, framesOut);
                         // the resampler always outputs stereo samples: do post stereo to mono conversion
-                        int16_t *src = (int16_t *)mRsmpOutBuffer;
-                        int16_t *dst = buffer.i16;
-                        while (framesOut--) {
-                            *dst++ = (int16_t)(((int32_t)*src + (int32_t)*(src + 1)) >> 1);
-                            src += 2;
-                        }
+                        downmix_to_mono_i16_from_stereo_i16(buffer.i16, (int16_t *)mRsmpOutBuffer,
+                                framesOut);
                     } else {
                         ditherAndClamp((int32_t *)buffer.raw, mRsmpOutBuffer, framesOut);
                     }
@@ -6151,7 +6131,7 @@
                         }
                     }
                 }
-                mActiveTrack->overflow();
+                mActiveTrack->clearOverflow();
             }
             // client isn't retrieving buffers fast enough
             else {
@@ -6173,12 +6153,13 @@
         effectChains.clear();
     }
 
-    if (!mStandby) {
-        mInput->stream->common.standby(&mInput->stream->common);
-    }
-    mActiveTrack.clear();
+    standby();
 
-    mStartStopCond.broadcast();
+    {
+        Mutex::Autolock _l(mLock);
+        mActiveTrack.clear();
+        mStartStopCond.broadcast();
+    }
 
     releaseWakeLock();
 
@@ -6186,14 +6167,28 @@
     return false;
 }
 
+void AudioFlinger::RecordThread::standby()
+{
+    if (!mStandby) {
+        inputStandBy();
+        mStandby = true;
+    }
+}
+
+void AudioFlinger::RecordThread::inputStandBy()
+{
+    mInput->stream->common.standby(&mInput->stream->common);
+}
 
 sp<AudioFlinger::RecordThread::RecordTrack>  AudioFlinger::RecordThread::createRecordTrack_l(
         const sp<AudioFlinger::Client>& client,
         uint32_t sampleRate,
         audio_format_t format,
-        int channelMask,
+        audio_channel_mask_t channelMask,
         int frameCount,
         int sessionId,
+        IAudioFlinger::track_flags_t flags,
+        pid_t tid,
         status_t *status)
 {
     sp<RecordTrack> track;
@@ -6205,6 +6200,8 @@
         goto Exit;
     }
 
+    // FIXME use flags and tid similar to createTrack_l()
+
     { // scope for mLock
         Mutex::Autolock _l(mLock);
 
@@ -6215,11 +6212,11 @@
             lStatus = NO_MEMORY;
             goto Exit;
         }
+        mTracks.add(track);
 
-        mTrack = track.get();
         // disable AEC and NS if the device is a BT SCO headset supporting those pre processings
-        bool suspend = audio_is_bluetooth_sco_device(
-                (audio_devices_t)(mDevice & AUDIO_DEVICE_IN_ALL)) && mAudioFlinger->btNrecIsOff();
+        bool suspend = audio_is_bluetooth_sco_device(mDevice & AUDIO_DEVICE_IN_ALL) &&
+                        mAudioFlinger->btNrecIsOff();
         setEffectSuspended_l(FX_IID_AEC, suspend, sessionId);
         setEffectSuspended_l(FX_IID_NS, suspend, sessionId);
     }
@@ -6337,50 +6334,97 @@
     }
 }
 
-void AudioFlinger::RecordThread::stop(RecordThread::RecordTrack* recordTrack) {
+bool AudioFlinger::RecordThread::stop_l(RecordThread::RecordTrack* recordTrack) {
     ALOGV("RecordThread::stop");
-    sp<ThreadBase> strongMe = this;
-    {
-        AutoMutex lock(mLock);
-        if (mActiveTrack != 0 && recordTrack == mActiveTrack.get()) {
-            mActiveTrack->mState = TrackBase::PAUSING;
-            // do not wait for mStartStopCond if exiting
-            if (exitPending()) {
-                return;
-            }
-            mStartStopCond.wait(mLock);
-            // if we have been restarted, recordTrack == mActiveTrack.get() here
-            if (mActiveTrack == 0 || recordTrack != mActiveTrack.get()) {
-                mLock.unlock();
-                AudioSystem::stopInput(mId);
-                mLock.lock();
-                ALOGV("Record stopped OK");
-            }
-        }
+    if (recordTrack != mActiveTrack.get() || recordTrack->mState == TrackBase::PAUSING) {
+        return false;
     }
+    recordTrack->mState = TrackBase::PAUSING;
+    // do not wait for mStartStopCond if exiting
+    if (exitPending()) {
+        return true;
+    }
+    mStartStopCond.wait(mLock);
+    // if we have been restarted, recordTrack == mActiveTrack.get() here
+    if (exitPending() || recordTrack != mActiveTrack.get()) {
+        ALOGV("Record stopped OK");
+        return true;
+    }
+    return false;
 }
 
-bool AudioFlinger::RecordThread::isValidSyncEvent(const sp<SyncEvent>& event)
+bool AudioFlinger::RecordThread::isValidSyncEvent(const sp<SyncEvent>& event) const
 {
     return false;
 }
 
 status_t AudioFlinger::RecordThread::setSyncEvent(const sp<SyncEvent>& event)
 {
+#if 0   // This branch is currently dead code, but is preserved in case it will be needed in future
     if (!isValidSyncEvent(event)) {
         return BAD_VALUE;
     }
 
+    int eventSession = event->triggerSession();
+    status_t ret = NAME_NOT_FOUND;
+
     Mutex::Autolock _l(mLock);
 
-    if (mTrack != NULL && event->triggerSession() == mTrack->sessionId()) {
-        mTrack->setSyncEvent(event);
-        return NO_ERROR;
+    for (size_t i = 0; i < mTracks.size(); i++) {
+        sp<RecordTrack> track = mTracks[i];
+        if (eventSession == track->sessionId()) {
+            (void) track->setSyncEvent(event);
+            ret = NO_ERROR;
+        }
     }
-    return NAME_NOT_FOUND;
+    return ret;
+#else
+    return BAD_VALUE;
+#endif
 }
 
-status_t AudioFlinger::RecordThread::dump(int fd, const Vector<String16>& args)
+void AudioFlinger::RecordThread::RecordTrack::destroy()
+{
+    // see comments at AudioFlinger::PlaybackThread::Track::destroy()
+    sp<RecordTrack> keep(this);
+    {
+        sp<ThreadBase> thread = mThread.promote();
+        if (thread != 0) {
+            if (mState == ACTIVE || mState == RESUMING) {
+                AudioSystem::stopInput(thread->id());
+            }
+            AudioSystem::releaseInput(thread->id());
+            Mutex::Autolock _l(thread->mLock);
+            RecordThread *recordThread = (RecordThread *) thread.get();
+            recordThread->destroyTrack_l(this);
+        }
+    }
+}
+
+// destroyTrack_l() must be called with ThreadBase::mLock held
+void AudioFlinger::RecordThread::destroyTrack_l(const sp<RecordTrack>& track)
+{
+    track->mState = TrackBase::TERMINATED;
+    // active tracks are removed by threadLoop()
+    if (mActiveTrack != track) {
+        removeTrack_l(track);
+    }
+}
+
+void AudioFlinger::RecordThread::removeTrack_l(const sp<RecordTrack>& track)
+{
+    mTracks.remove(track);
+    // need anything related to effects here?
+}
+
+void AudioFlinger::RecordThread::dump(int fd, const Vector<String16>& args)
+{
+    dumpInternals(fd, args);
+    dumpTracks(fd, args);
+    dumpEffectChains(fd, args);
+}
+
+void AudioFlinger::RecordThread::dumpInternals(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -6390,11 +6434,6 @@
     result.append(buffer);
 
     if (mActiveTrack != 0) {
-        result.append("Active Track:\n");
-        result.append("   Clien Fmt Chn mask   Session Buf  S SRate  Serv     User\n");
-        mActiveTrack->dump(buffer, SIZE);
-        result.append(buffer);
-
         snprintf(buffer, SIZE, "In index: %d\n", mRsmpInIndex);
         result.append(buffer);
         snprintf(buffer, SIZE, "In size: %d\n", mInputBytes);
@@ -6405,17 +6444,41 @@
         result.append(buffer);
         snprintf(buffer, SIZE, "Out sample rate: %d\n", mReqSampleRate);
         result.append(buffer);
-
-
     } else {
-        result.append("No record client\n");
+        result.append("No active record client\n");
     }
+
     write(fd, result.string(), result.size());
 
     dumpBase(fd, args);
-    dumpEffectChains(fd, args);
+}
 
-    return NO_ERROR;
+void AudioFlinger::RecordThread::dumpTracks(int fd, const Vector<String16>& args)
+{
+    const size_t SIZE = 256;
+    char buffer[SIZE];
+    String8 result;
+
+    snprintf(buffer, SIZE, "Input thread %p tracks\n", this);
+    result.append(buffer);
+    RecordTrack::appendDumpHeader(result);
+    for (size_t i = 0; i < mTracks.size(); ++i) {
+        sp<RecordTrack> track = mTracks[i];
+        if (track != 0) {
+            track->dump(buffer, SIZE);
+            result.append(buffer);
+        }
+    }
+
+    if (mActiveTrack != 0) {
+        snprintf(buffer, SIZE, "\nInput thread %p active tracks\n", this);
+        result.append(buffer);
+        RecordTrack::appendDumpHeader(result);
+        mActiveTrack->dump(buffer, SIZE);
+        result.append(buffer);
+
+    }
+    write(fd, result.string(), result.size());
 }
 
 // AudioBufferProvider interface
@@ -6432,7 +6495,7 @@
             if (mActiveTrack->mState == TrackBase::ACTIVE) {
                 // Force input into standby so that it tries to
                 // recover at next read attempt
-                mInput->stream->common.standby(&mInput->stream->common);
+                inputStandBy();
                 usleep(kRecordThreadSleepUs);
             }
             buffer->raw = NULL;
@@ -6508,25 +6571,30 @@
             // store input device and output device but do not forward output device to audio HAL.
             // Note that status is ignored by the caller for output device
             // (see AudioFlinger::setParameters()
+            audio_devices_t newDevice = mDevice;
             if (value & AUDIO_DEVICE_OUT_ALL) {
-                mDevice &= (uint32_t)~(value & AUDIO_DEVICE_OUT_ALL);
+                newDevice &= ~(value & AUDIO_DEVICE_OUT_ALL);
                 status = BAD_VALUE;
             } else {
-                mDevice &= (uint32_t)~(value & AUDIO_DEVICE_IN_ALL);
+                newDevice &= ~(value & AUDIO_DEVICE_IN_ALL);
                 // disable AEC and NS if the device is a BT SCO headset supporting those pre processings
-                if (mTrack != NULL) {
+                if (mTracks.size() > 0) {
                     bool suspend = audio_is_bluetooth_sco_device(
                             (audio_devices_t)value) && mAudioFlinger->btNrecIsOff();
-                    setEffectSuspended_l(FX_IID_AEC, suspend, mTrack->sessionId());
-                    setEffectSuspended_l(FX_IID_NS, suspend, mTrack->sessionId());
+                    for (size_t i = 0; i < mTracks.size(); i++) {
+                        sp<RecordTrack> track = mTracks[i];
+                        setEffectSuspended_l(FX_IID_AEC, suspend, track->sessionId());
+                        setEffectSuspended_l(FX_IID_NS, suspend, track->sessionId());
+                    }
                 }
             }
-            mDevice |= (uint32_t)value;
+            newDevice |= value;
+            mDevice = newDevice;    // since mDevice is read by other threads, only write to it once
         }
         if (status == NO_ERROR) {
             status = mInput->stream->common.set_parameters(&mInput->stream->common, keyValuePair.string());
             if (status == INVALID_OPERATION) {
-                mInput->stream->common.standby(&mInput->stream->common);
+                inputStandBy();
                 status = mInput->stream->common.set_parameters(&mInput->stream->common,
                         keyValuePair.string());
             }
@@ -6648,7 +6716,7 @@
     return mInput->stream->get_input_frames_lost(mInput->stream);
 }
 
-uint32_t AudioFlinger::RecordThread::hasAudioSession(int sessionId)
+uint32_t AudioFlinger::RecordThread::hasAudioSession(int sessionId) const
 {
     Mutex::Autolock _l(mLock);
     uint32_t result = 0;
@@ -6656,23 +6724,28 @@
         result = EFFECT_SESSION;
     }
 
-    if (mTrack != NULL && sessionId == mTrack->sessionId()) {
-        result |= TRACK_SESSION;
+    for (size_t i = 0; i < mTracks.size(); ++i) {
+        if (sessionId == mTracks[i]->sessionId()) {
+            result |= TRACK_SESSION;
+            break;
+        }
     }
 
     return result;
 }
 
-AudioFlinger::RecordThread::RecordTrack* AudioFlinger::RecordThread::track()
+KeyedVector<int, bool> AudioFlinger::RecordThread::sessionIds() const
 {
+    KeyedVector<int, bool> ids;
     Mutex::Autolock _l(mLock);
-    return mTrack;
-}
-
-AudioFlinger::AudioStreamIn* AudioFlinger::RecordThread::getInput() const
-{
-    Mutex::Autolock _l(mLock);
-    return mInput;
+    for (size_t j = 0; j < mTracks.size(); ++j) {
+        sp<RecordThread::RecordTrack> track = mTracks[j];
+        int sessionId = track->sessionId();
+        if (ids.indexOfKey(sessionId) < 0) {
+            ids.add(sessionId, true);
+        }
+    }
+    return ids;
 }
 
 AudioFlinger::AudioStreamIn* AudioFlinger::RecordThread::clearInput()
@@ -6730,16 +6803,52 @@
         return 0;
     }
 
-    if ((mMasterVolumeSupportLvl != MVS_NONE) &&
-        (NULL != dev->set_master_volume)) {
+    // Check and cache this HAL's level of support for master mute and master
+    // volume.  If this is the first HAL opened, and it supports the get
+    // methods, use the initial values provided by the HAL as the current
+    // master mute and volume settings.
+
+    AudioHwDevice::Flags flags = static_cast<AudioHwDevice::Flags>(0);
+    {  // scope for auto-lock pattern
         AutoMutex lock(mHardwareLock);
+
+        if (0 == mAudioHwDevs.size()) {
+            mHardwareStatus = AUDIO_HW_GET_MASTER_VOLUME;
+            if (NULL != dev->get_master_volume) {
+                float mv;
+                if (OK == dev->get_master_volume(dev, &mv)) {
+                    mMasterVolume = mv;
+                }
+            }
+
+            mHardwareStatus = AUDIO_HW_GET_MASTER_MUTE;
+            if (NULL != dev->get_master_mute) {
+                bool mm;
+                if (OK == dev->get_master_mute(dev, &mm)) {
+                    mMasterMute = mm;
+                }
+            }
+        }
+
         mHardwareStatus = AUDIO_HW_SET_MASTER_VOLUME;
-        dev->set_master_volume(dev, mMasterVolume);
+        if ((NULL != dev->set_master_volume) &&
+            (OK == dev->set_master_volume(dev, mMasterVolume))) {
+            flags = static_cast<AudioHwDevice::Flags>(flags |
+                    AudioHwDevice::AHWD_CAN_SET_MASTER_VOLUME);
+        }
+
+        mHardwareStatus = AUDIO_HW_SET_MASTER_MUTE;
+        if ((NULL != dev->set_master_mute) &&
+            (OK == dev->set_master_mute(dev, mMasterMute))) {
+            flags = static_cast<AudioHwDevice::Flags>(flags |
+                    AudioHwDevice::AHWD_CAN_SET_MASTER_MUTE);
+        }
+
         mHardwareStatus = AUDIO_HW_IDLE;
     }
 
     audio_module_handle_t handle = nextUniqueId();
-    mAudioHwDevs.add(handle, new AudioHwDevice(name, dev));
+    mAudioHwDevs.add(handle, new AudioHwDevice(name, dev, flags));
 
     ALOGI("loadHwModule() Loaded %s audio interface from %s (%s) handle %d",
           name, dev->common.module->name, dev->common.module->id, handle);
@@ -6764,11 +6873,11 @@
         format: pFormat ? *pFormat : AUDIO_FORMAT_DEFAULT,
     };
     audio_stream_out_t *outStream = NULL;
-    audio_hw_device_t *outHwDev;
+    AudioHwDevice *outHwDev;
 
     ALOGV("openOutput(), module %d Device %x, SamplingRate %d, Format %d, Channels %x, flags %x",
               module,
-              (pDevices != NULL) ? (int)*pDevices : 0,
+              (pDevices != NULL) ? *pDevices : 0,
               config.sample_rate,
               config.format,
               config.channel_mask,
@@ -6784,11 +6893,12 @@
     if (outHwDev == NULL)
         return 0;
 
+    audio_hw_device_t *hwDevHal = outHwDev->hwDevice();
     audio_io_handle_t id = nextUniqueId();
 
     mHardwareStatus = AUDIO_HW_OUTPUT_OPEN;
 
-    status = outHwDev->open_output_stream(outHwDev,
+    status = hwDevHal->open_output_stream(hwDevHal,
                                           id,
                                           *pDevices,
                                           (audio_output_flags_t)flags,
@@ -6832,41 +6942,8 @@
 
             AutoMutex lock(mHardwareLock);
             mHardwareStatus = AUDIO_HW_SET_MODE;
-            outHwDev->set_mode(outHwDev, mMode);
-
-            // Determine the level of master volume support the primary audio HAL has,
-            // and set the initial master volume at the same time.
-            float initialVolume = 1.0;
-            mMasterVolumeSupportLvl = MVS_NONE;
-
-            mHardwareStatus = AUDIO_HW_GET_MASTER_VOLUME;
-            if ((NULL != outHwDev->get_master_volume) &&
-                (NO_ERROR == outHwDev->get_master_volume(outHwDev, &initialVolume))) {
-                mMasterVolumeSupportLvl = MVS_FULL;
-            } else {
-                mMasterVolumeSupportLvl = MVS_SETONLY;
-                initialVolume = 1.0;
-            }
-
-            mHardwareStatus = AUDIO_HW_SET_MASTER_VOLUME;
-            if ((NULL == outHwDev->set_master_volume) ||
-                (NO_ERROR != outHwDev->set_master_volume(outHwDev, initialVolume))) {
-                mMasterVolumeSupportLvl = MVS_NONE;
-            }
-            // now that we have a primary device, initialize master volume on other devices
-            for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
-                audio_hw_device_t *dev = mAudioHwDevs.valueAt(i)->hwDevice();
-
-                if ((dev != mPrimaryHardwareDev) &&
-                    (NULL != dev->set_master_volume)) {
-                    dev->set_master_volume(dev, initialVolume);
-                }
-            }
+            hwDevHal->set_mode(hwDevHal, mMode);
             mHardwareStatus = AUDIO_HW_IDLE;
-            mMasterVolumeSW = (MVS_NONE == mMasterVolumeSupportLvl)
-                                    ? initialVolume
-                                    : 1.0;
-            mMasterVolume   = initialVolume;
         }
         return id;
     }
@@ -6897,6 +6974,11 @@
 
 status_t AudioFlinger::closeOutput(audio_io_handle_t output)
 {
+    return closeOutput_nonvirtual(output);
+}
+
+status_t AudioFlinger::closeOutput_nonvirtual(audio_io_handle_t output)
+{
     // keep strong reference on the playback thread so that
     // it is not destroyed while exit() is executed
     sp<PlaybackThread> thread;
@@ -6928,7 +7010,7 @@
         AudioStreamOut *out = thread->clearOutput();
         ALOG_ASSERT(out != NULL, "out shouldn't be NULL");
         // from now on thread->mOutput is NULL
-        out->hwDev->close_output_stream(out->hwDev, out->stream);
+        out->hwDev()->close_output_stream(out->hwDev(), out->stream);
         delete out;
     }
     return NO_ERROR;
@@ -6969,7 +7051,7 @@
                                           audio_devices_t *pDevices,
                                           uint32_t *pSamplingRate,
                                           audio_format_t *pFormat,
-                                          uint32_t *pChannelMask)
+                                          audio_channel_mask_t *pChannelMask)
 {
     status_t status;
     RecordThread *thread = NULL;
@@ -6982,7 +7064,7 @@
     audio_format_t reqFormat = config.format;
     audio_channel_mask_t reqChannels = config.channel_mask;
     audio_stream_in_t *inStream = NULL;
-    audio_hw_device_t *inHwDev;
+    AudioHwDevice *inHwDev;
 
     if (pDevices == NULL || *pDevices == 0) {
         return 0;
@@ -6994,9 +7076,10 @@
     if (inHwDev == NULL)
         return 0;
 
+    audio_hw_device_t *inHwHal = inHwDev->hwDevice();
     audio_io_handle_t id = nextUniqueId();
 
-    status = inHwDev->open_input_stream(inHwDev, id, *pDevices, &config,
+    status = inHwHal->open_input_stream(inHwHal, id, *pDevices, &config,
                                         &inStream);
     ALOGV("openInput() openInputStream returned input %p, SamplingRate %d, Format %d, Channels %x, status %d",
             inStream,
@@ -7012,9 +7095,9 @@
         reqFormat == config.format && config.format == AUDIO_FORMAT_PCM_16_BIT &&
         (config.sample_rate <= 2 * reqSamplingRate) &&
         (popcount(config.channel_mask) <= FCC_2) && (popcount(reqChannels) <= FCC_2)) {
-        ALOGV("openInput() reopening with proposed sampling rate and channels");
+        ALOGV("openInput() reopening with proposed sampling rate and channel mask");
         inStream = NULL;
-        status = inHwDev->open_input_stream(inHwDev, id, *pDevices, &config, &inStream);
+        status = inHwHal->open_input_stream(inHwHal, id, *pDevices, &config, &inStream);
     }
 
     if (status == NO_ERROR && inStream != NULL) {
@@ -7023,7 +7106,7 @@
         // Start record thread
         // RecorThread require both input and output device indication to forward to audio
         // pre processing modules
-        uint32_t device = (*pDevices) | primaryOutputDevice_l();
+        audio_devices_t device = (*pDevices) | primaryOutputDevice_l();
         thread = new RecordThread(this,
                                   input,
                                   reqSamplingRate,
@@ -7036,8 +7119,6 @@
         if (pFormat != NULL) *pFormat = config.format;
         if (pChannelMask != NULL) *pChannelMask = reqChannels;
 
-        input->stream->common.standby(&input->stream->common);
-
         // notify client processes of the new input creation
         thread->audioConfigChanged_l(AudioSystem::INPUT_OPENED);
         return id;
@@ -7048,13 +7129,18 @@
 
 status_t AudioFlinger::closeInput(audio_io_handle_t input)
 {
+    return closeInput_nonvirtual(input);
+}
+
+status_t AudioFlinger::closeInput_nonvirtual(audio_io_handle_t input)
+{
     // keep strong reference on the record thread so that
     // it is not destroyed while exit() is executed
     sp<RecordThread> thread;
     {
         Mutex::Autolock _l(mLock);
         thread = checkRecordThread_l(input);
-        if (thread == NULL) {
+        if (thread == 0) {
             return BAD_VALUE;
         }
 
@@ -7069,7 +7155,7 @@
     AudioStreamIn *in = thread->clearInput();
     ALOG_ASSERT(in != NULL, "in shouldn't be NULL");
     // from now on thread->mInput is NULL
-    in->hwDev->close_input_stream(in->hwDev, in->stream);
+    in->hwDev()->close_input_stream(in->hwDev(), in->stream);
     delete in;
 
     return NO_ERROR;
@@ -7078,21 +7164,11 @@
 status_t AudioFlinger::setStreamOutput(audio_stream_type_t stream, audio_io_handle_t output)
 {
     Mutex::Autolock _l(mLock);
-    MixerThread *dstThread = checkMixerThread_l(output);
-    if (dstThread == NULL) {
-        ALOGW("setStreamOutput() bad output id %d", output);
-        return BAD_VALUE;
-    }
-
     ALOGV("setStreamOutput() stream %d to output %d", stream, output);
-    audioConfigChanged_l(AudioSystem::STREAM_CONFIG_CHANGED, output, &stream);
 
     for (size_t i = 0; i < mPlaybackThreads.size(); i++) {
         PlaybackThread *thread = mPlaybackThreads.valueAt(i).get();
-        if (thread != dstThread && thread->type() != ThreadBase::DIRECT) {
-            MixerThread *srcThread = (MixerThread *)thread;
-            srcThread->invalidateTracks(stream);
-        }
+        thread->invalidateTracks(stream);
     }
 
     return NO_ERROR;
@@ -7186,20 +7262,14 @@
             }
         }
         if (!found) {
+            Mutex::Autolock _l (t->mLock);
             // remove all effects from the chain
             while (ec->mEffects.size()) {
                 sp<EffectModule> effect = ec->mEffects[0];
                 effect->unPin();
-                Mutex::Autolock _l (t->mLock);
                 t->removeEffect_l(effect);
-                for (size_t j = 0; j < effect->mHandles.size(); j++) {
-                    sp<EffectHandle> handle = effect->mHandles[j].promote();
-                    if (handle != 0) {
-                        handle->mEffect.clear();
-                        if (handle->mHasControl && handle->mEnabled) {
-                            t->checkSuspendOnEffectEnabled_l(effect, false, effect->sessionId());
-                        }
-                    }
+                if (effect->purgeHandles()) {
+                    t->checkSuspendOnEffectEnabled_l(effect, false, effect->sessionId());
                 }
                 AudioSystem::unregisterEffect(effect->id());
             }
@@ -7237,14 +7307,14 @@
     for (size_t i = 0; i < mPlaybackThreads.size(); i++) {
         PlaybackThread *thread = mPlaybackThreads.valueAt(i).get();
         AudioStreamOut *output = thread->getOutput();
-        if (output != NULL && output->hwDev == mPrimaryHardwareDev) {
+        if (output != NULL && output->audioHwDev == mPrimaryHardwareDev) {
             return thread;
         }
     }
     return NULL;
 }
 
-uint32_t AudioFlinger::primaryOutputDevice_l() const
+audio_devices_t AudioFlinger::primaryOutputDevice_l() const
 {
     PlaybackThread *thread = primaryPlaybackThread_l();
 
@@ -7401,7 +7471,7 @@
                     // 0 and the effect is not auxiliary, continue enumeration in case
                     // an auxiliary version of this effect type is available
                     found = true;
-                    memcpy(&d, &desc, sizeof(effect_descriptor_t));
+                    d = desc;
                     if (sessionId != AUDIO_SESSION_OUTPUT_MIX ||
                             (desc.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) {
                         break;
@@ -7417,7 +7487,7 @@
             // connect to output mix (Compliance to OpenSL ES)
             if (sessionId == AUDIO_SESSION_OUTPUT_MIX &&
                     (d.flags & EFFECT_FLAG_TYPE_MASK) != EFFECT_FLAG_TYPE_AUXILIARY) {
-                memcpy(&desc, &d, sizeof(effect_descriptor_t));
+                desc = d;
             }
         }
 
@@ -7436,7 +7506,7 @@
         }
 
         // return effect descriptor
-        memcpy(pDesc, &desc, sizeof(effect_descriptor_t));
+        *pDesc = desc;
 
         // If output is not specified try to find a matching audio session ID in one of the
         // output threads.
@@ -7670,7 +7740,7 @@
         }
         // create effect handle and connect it to effect module
         handle = new EffectHandle(effect, client, effectClient, priority);
-        lStatus = effect->addHandle(handle);
+        lStatus = effect->addHandle(handle.get());
         if (enabled != NULL) {
             *enabled = (int)effect->isEnabled();
         }
@@ -7789,7 +7859,7 @@
     return getEffectChain_l(sessionId);
 }
 
-sp<AudioFlinger::EffectChain> AudioFlinger::ThreadBase::getEffectChain_l(int sessionId)
+sp<AudioFlinger::EffectChain> AudioFlinger::ThreadBase::getEffectChain_l(int sessionId) const
 {
     size_t size = mEffectChains.size();
     for (size_t i = 0; i < size; i++) {
@@ -7810,7 +7880,7 @@
 }
 
 void AudioFlinger::ThreadBase::disconnectEffect(const sp<EffectModule>& effect,
-                                                    const wp<EffectHandle>& handle,
+                                                    EffectHandle *handle,
                                                     bool unpinIfLast) {
 
     Mutex::Autolock _l(mLock);
@@ -8002,16 +8072,18 @@
                                         effect_descriptor_t *desc,
                                         int id,
                                         int sessionId)
-    : mThread(thread), mChain(chain), mId(id), mSessionId(sessionId), mEffectInterface(NULL),
-      mStatus(NO_INIT), mState(IDLE), mSuspended(false)
+    : mPinned(sessionId > AUDIO_SESSION_OUTPUT_MIX),
+      mThread(thread), mChain(chain), mId(id), mSessionId(sessionId),
+      mDescriptor(*desc),
+      // mConfig is set by configure() and not used before then
+      mEffectInterface(NULL),
+      mStatus(NO_INIT), mState(IDLE),
+      // mMaxDisableWaitCnt is set by configure() and not used before then
+      // mDisableWaitCnt is set by process() and updateState() and not used before then
+      mSuspended(false)
 {
     ALOGV("Constructor %p", this);
     int lStatus;
-    if (thread == NULL) {
-        return;
-    }
-
-    memcpy(&mDescriptor, desc, sizeof(effect_descriptor_t));
 
     // create effect engine from effect factory
     mStatus = EffectCreate(&desc->uuid, sessionId, thread->id(), &mEffectInterface);
@@ -8025,9 +8097,6 @@
         goto Error;
     }
 
-    if (mSessionId > AUDIO_SESSION_OUTPUT_MIX) {
-        mPinned = true;
-    }
     ALOGV("Constructor success name %s, Interface %p", mDescriptor.name, mEffectInterface);
     return;
 Error:
@@ -8055,38 +8124,41 @@
     }
 }
 
-status_t AudioFlinger::EffectModule::addHandle(const sp<EffectHandle>& handle)
+status_t AudioFlinger::EffectModule::addHandle(EffectHandle *handle)
 {
     status_t status;
 
     Mutex::Autolock _l(mLock);
     int priority = handle->priority();
     size_t size = mHandles.size();
-    sp<EffectHandle> h;
+    EffectHandle *controlHandle = NULL;
     size_t i;
     for (i = 0; i < size; i++) {
-        h = mHandles[i].promote();
-        if (h == 0) continue;
+        EffectHandle *h = mHandles[i];
+        if (h == NULL || h->destroyed_l()) continue;
+        // first non destroyed handle is considered in control
+        if (controlHandle == NULL)
+            controlHandle = h;
         if (h->priority() <= priority) break;
     }
     // if inserted in first place, move effect control from previous owner to this handle
     if (i == 0) {
         bool enabled = false;
-        if (h != 0) {
-            enabled = h->enabled();
-            h->setControl(false/*hasControl*/, true /*signal*/, enabled /*enabled*/);
+        if (controlHandle != NULL) {
+            enabled = controlHandle->enabled();
+            controlHandle->setControl(false/*hasControl*/, true /*signal*/, enabled /*enabled*/);
         }
         handle->setControl(true /*hasControl*/, false /*signal*/, enabled /*enabled*/);
         status = NO_ERROR;
     } else {
         status = ALREADY_EXISTS;
     }
-    ALOGV("addHandle() %p added handle %p in position %d", this, handle.get(), i);
+    ALOGV("addHandle() %p added handle %p in position %d", this, handle, i);
     mHandles.insertAt(handle, i);
     return status;
 }
 
-size_t AudioFlinger::EffectModule::removeHandle(const wp<EffectHandle>& handle)
+size_t AudioFlinger::EffectModule::removeHandle(EffectHandle *handle)
 {
     Mutex::Autolock _l(mLock);
     size_t size = mHandles.size();
@@ -8097,43 +8169,44 @@
     if (i == size) {
         return size;
     }
-    ALOGV("removeHandle() %p removed handle %p in position %d", this, handle.unsafe_get(), i);
+    ALOGV("removeHandle() %p removed handle %p in position %d", this, handle, i);
 
-    bool enabled = false;
-    EffectHandle *hdl = handle.unsafe_get();
-    if (hdl != NULL) {
-        ALOGV("removeHandle() unsafe_get OK");
-        enabled = hdl->enabled();
-    }
     mHandles.removeAt(i);
-    size = mHandles.size();
     // if removed from first place, move effect control from this handle to next in line
-    if (i == 0 && size != 0) {
-        sp<EffectHandle> h = mHandles[0].promote();
-        if (h != 0) {
-            h->setControl(true /*hasControl*/, true /*signal*/ , enabled /*enabled*/);
+    if (i == 0) {
+        EffectHandle *h = controlHandle_l();
+        if (h != NULL) {
+            h->setControl(true /*hasControl*/, true /*signal*/ , handle->enabled() /*enabled*/);
         }
     }
 
     // Prevent calls to process() and other functions on effect interface from now on.
     // The effect engine will be released by the destructor when the last strong reference on
     // this object is released which can happen after next process is called.
-    if (size == 0 && !mPinned) {
+    if (mHandles.size() == 0 && !mPinned) {
         mState = DESTROYED;
     }
 
-    return size;
+    return mHandles.size();
 }
 
-sp<AudioFlinger::EffectHandle> AudioFlinger::EffectModule::controlHandle()
+// must be called with EffectModule::mLock held
+AudioFlinger::EffectHandle *AudioFlinger::EffectModule::controlHandle_l()
 {
-    Mutex::Autolock _l(mLock);
-    return mHandles.size() != 0 ? mHandles[0].promote() : 0;
+    // the first valid handle in the list has control over the module
+    for (size_t i = 0; i < mHandles.size(); i++) {
+        EffectHandle *h = mHandles[i];
+        if (h != NULL && !h->destroyed_l()) {
+            return h;
+        }
+    }
+
+    return NULL;
 }
 
-void AudioFlinger::EffectModule::disconnect(const wp<EffectHandle>& handle, bool unpinIfLast)
+size_t AudioFlinger::EffectModule::disconnect(EffectHandle *handle, bool unpinIfLast)
 {
-    ALOGV("disconnect() %p handle %p", this, handle.unsafe_get());
+    ALOGV("disconnect() %p handle %p", this, handle);
     // keep a strong reference on this EffectModule to avoid calling the
     // destructor before we exit
     sp<EffectModule> keep(this);
@@ -8143,6 +8216,7 @@
             thread->disconnectEffect(keep, handle, unpinIfLast);
         }
     }
+    return mHandles.size();
 }
 
 void AudioFlinger::EffectModule::updateState() {
@@ -8240,7 +8314,6 @@
 
 status_t AudioFlinger::EffectModule::configure()
 {
-    uint32_t channels;
     if (mEffectInterface == NULL) {
         return NO_INIT;
     }
@@ -8251,18 +8324,14 @@
     }
 
     // TODO: handle configuration of effects replacing track process
-    if (thread->channelCount() == 1) {
-        channels = AUDIO_CHANNEL_OUT_MONO;
-    } else {
-        channels = AUDIO_CHANNEL_OUT_STEREO;
-    }
+    audio_channel_mask_t channelMask = thread->channelMask();
 
     if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) {
         mConfig.inputCfg.channels = AUDIO_CHANNEL_OUT_MONO;
     } else {
-        mConfig.inputCfg.channels = channels;
+        mConfig.inputCfg.channels = channelMask;
     }
-    mConfig.outputCfg.channels = channels;
+    mConfig.outputCfg.channels = channelMask;
     mConfig.inputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
     mConfig.outputCfg.format = AUDIO_FORMAT_PCM_16_BIT;
     mConfig.inputCfg.samplingRate = thread->sampleRate();
@@ -8452,8 +8521,8 @@
     if (cmdCode != EFFECT_CMD_GET_PARAM && status == NO_ERROR) {
         uint32_t size = (replySize == NULL) ? 0 : *replySize;
         for (size_t i = 1; i < mHandles.size(); i++) {
-            sp<EffectHandle> h = mHandles[i].promote();
-            if (h != 0) {
+            EffectHandle *h = mHandles[i];
+            if (h != NULL && !h->destroyed_l()) {
                 h->commandExecuted(cmdCode, cmdSize, pCmdData, size, pReplyData);
             }
         }
@@ -8463,8 +8532,14 @@
 
 status_t AudioFlinger::EffectModule::setEnabled(bool enabled)
 {
-
     Mutex::Autolock _l(mLock);
+    return setEnabled_l(enabled);
+}
+
+// must be called with EffectModule::mLock held
+status_t AudioFlinger::EffectModule::setEnabled_l(bool enabled)
+{
+
     ALOGV("setEnabled %p enabled %d", this, enabled);
 
     if (enabled != isEnabled()) {
@@ -8499,8 +8574,8 @@
             return NO_ERROR; // simply ignore as we are being destroyed
         }
         for (size_t i = 1; i < mHandles.size(); i++) {
-            sp<EffectHandle> h = mHandles[i].promote();
-            if (h != 0) {
+            EffectHandle *h = mHandles[i];
+            if (h != NULL && !h->destroyed_l()) {
                 h->setEnabled(enabled);
             }
         }
@@ -8573,14 +8648,14 @@
     return status;
 }
 
-status_t AudioFlinger::EffectModule::setDevice(uint32_t device)
+status_t AudioFlinger::EffectModule::setDevice(audio_devices_t device)
 {
     Mutex::Autolock _l(mLock);
     status_t status = NO_ERROR;
     if (device && (mDescriptor.flags & EFFECT_FLAG_DEVICE_MASK) == EFFECT_FLAG_DEVICE_IND) {
         // audio pre processing modules on RecordThread can receive both output and
         // input device indication in the same call
-        uint32_t dev = device & AUDIO_DEVICE_OUT_ALL;
+        audio_devices_t dev = device & AUDIO_DEVICE_OUT_ALL;
         if (dev) {
             status_t cmdStatus;
             uint32_t size = sizeof(status_t);
@@ -8649,7 +8724,23 @@
     return mSuspended;
 }
 
-status_t AudioFlinger::EffectModule::dump(int fd, const Vector<String16>& args)
+bool AudioFlinger::EffectModule::purgeHandles()
+{
+    bool enabled = false;
+    Mutex::Autolock _l(mLock);
+    for (size_t i = 0; i < mHandles.size(); i++) {
+        EffectHandle *handle = mHandles[i];
+        if (handle != NULL && !handle->destroyed_l()) {
+            handle->effect().clear();
+            if (handle->hasControl()) {
+                enabled = handle->enabled();
+            }
+        }
+    }
+    return enabled;
+}
+
+void AudioFlinger::EffectModule::dump(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -8715,8 +8806,8 @@
     result.append(buffer);
     result.append("\t\t\tPid   Priority Ctrl Locked client server\n");
     for (size_t i = 0; i < mHandles.size(); ++i) {
-        sp<EffectHandle> handle = mHandles[i].promote();
-        if (handle != 0) {
+        EffectHandle *handle = mHandles[i];
+        if (handle != NULL && !handle->destroyed_l()) {
             handle->dump(buffer, SIZE);
             result.append(buffer);
         }
@@ -8729,8 +8820,6 @@
     if (locked) {
         mLock.unlock();
     }
-
-    return NO_ERROR;
 }
 
 // ----------------------------------------------------------------------------
@@ -8746,7 +8835,7 @@
                                         int32_t priority)
     : BnEffect(),
     mEffect(effect), mEffectClient(effectClient), mClient(client), mCblk(NULL),
-    mPriority(priority), mHasControl(false), mEnabled(false)
+    mPriority(priority), mHasControl(false), mEnabled(false), mDestroyed(false)
 {
     ALOGV("constructor %p", this);
 
@@ -8771,8 +8860,15 @@
 AudioFlinger::EffectHandle::~EffectHandle()
 {
     ALOGV("Destructor %p", this);
+
+    if (mEffect == 0) {
+        mDestroyed = true;
+        return;
+    }
+    mEffect->lock();
+    mDestroyed = true;
+    mEffect->unlock();
     disconnect(false);
-    ALOGV("Destructor DONE %p", this);
 }
 
 status_t AudioFlinger::EffectHandle::enable()
@@ -8843,9 +8939,8 @@
     if (mEffect == 0) {
         return;
     }
-    mEffect->disconnect(this, unpinIfLast);
-
-    if (mHasControl && mEnabled) {
+    // restore suspended effects if the disconnected handle was enabled and the last one.
+    if ((mEffect->disconnect(this, unpinIfLast) == 0) && mEnabled) {
         sp<ThreadBase> thread = mEffect->thread().promote();
         if (thread != 0) {
             thread->checkSuspendOnEffectEnabled(mEffect, false, mEffect->sessionId());
@@ -9275,7 +9370,7 @@
 }
 
 // setDevice_l() must be called with PlaybackThread::mLock held
-void AudioFlinger::EffectChain::setDevice_l(uint32_t device)
+void AudioFlinger::EffectChain::setDevice_l(audio_devices_t device)
 {
     size_t size = mEffects.size();
     for (size_t i = 0; i < size; i++) {
@@ -9350,7 +9445,7 @@
     return hasControl;
 }
 
-status_t AudioFlinger::EffectChain::dump(int fd, const Vector<String16>& args)
+void AudioFlinger::EffectChain::dump(int fd, const Vector<String16>& args)
 {
     const size_t SIZE = 256;
     char buffer[SIZE];
@@ -9384,8 +9479,6 @@
     if (locked) {
         mLock.unlock();
     }
-
-    return NO_ERROR;
 }
 
 // must be called with ThreadBase::mLock held
@@ -9401,7 +9494,7 @@
             desc = mSuspendedEffects.valueAt(index);
         } else {
             desc = new SuspendedEffectDesc();
-            memcpy(&desc->mType, type, sizeof(effect_uuid_t));
+            desc->mType = *type;
             mSuspendedEffects.add(type->timeLow, desc);
             ALOGV("setEffectSuspended_l() add entry for %08x", type->timeLow);
         }
@@ -9428,10 +9521,12 @@
                 sp<EffectModule> effect = desc->mEffect.promote();
                 if (effect != 0) {
                     effect->setSuspended(false);
-                    sp<EffectHandle> handle = effect->controlHandle();
-                    if (handle != 0) {
-                        effect->setEnabled(handle->enabled());
+                    effect->lock();
+                    EffectHandle *handle = effect->controlHandle_l();
+                    if (handle != NULL && !handle->destroyed_l()) {
+                        effect->setEnabled_l(handle->enabled());
                     }
+                    effect->unlock();
                 }
                 desc->mEffect.clear();
             }
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index cfd718f..4723cd9 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -45,10 +45,10 @@
 #include <hardware/audio.h>
 #include <hardware/audio_policy.h>
 
-#include "AudioBufferProvider.h"
-#include "ExtendedAudioBufferProvider.h"
+#include <media/AudioBufferProvider.h>
+#include <media/ExtendedAudioBufferProvider.h>
 #include "FastMixer.h"
-#include "NBAIO.h"
+#include <media/nbaio/NBAIO.h>
 #include "AudioWatchdog.h"
 
 #include <powermanager/IPowerManager.h>
@@ -91,7 +91,7 @@
                                 audio_stream_type_t streamType,
                                 uint32_t sampleRate,
                                 audio_format_t format,
-                                uint32_t channelMask,
+                                audio_channel_mask_t channelMask,
                                 int frameCount,
                                 IAudioFlinger::track_flags_t flags,
                                 const sp<IMemory>& sharedBuffer,
@@ -105,9 +105,10 @@
                                 audio_io_handle_t input,
                                 uint32_t sampleRate,
                                 audio_format_t format,
-                                uint32_t channelMask,
+                                audio_channel_mask_t channelMask,
                                 int frameCount,
                                 IAudioFlinger::track_flags_t flags,
+                                pid_t tid,
                                 int *sessionId,
                                 status_t *status);
 
@@ -121,7 +122,6 @@
     virtual     status_t    setMasterMute(bool muted);
 
     virtual     float       masterVolume() const;
-    virtual     float       masterVolumeSW() const;
     virtual     bool        masterMute() const;
 
     virtual     status_t    setStreamVolume(audio_stream_type_t stream, float value,
@@ -142,7 +142,8 @@
 
     virtual     void        registerClient(const sp<IAudioFlingerClient>& client);
 
-    virtual     size_t      getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const;
+    virtual     size_t      getInputBufferSize(uint32_t sampleRate, audio_format_t format,
+                                               audio_channel_mask_t channelMask) const;
 
     virtual audio_io_handle_t openOutput(audio_module_handle_t module,
                                          audio_devices_t *pDevices,
@@ -232,8 +233,8 @@
         virtual ~SyncEvent() {}
 
         void trigger() { Mutex::Autolock _l(mLock); if (mCallback) mCallback(this); }
-        bool isCancelled() { Mutex::Autolock _l(mLock); return (mCallback == NULL); }
-        void cancel() {Mutex::Autolock _l(mLock); mCallback = NULL; }
+        bool isCancelled() const { Mutex::Autolock _l(mLock); return (mCallback == NULL); }
+        void cancel() { Mutex::Autolock _l(mLock); mCallback = NULL; }
         AudioSystem::sync_event_t type() const { return mType; }
         int triggerSession() const { return mTriggerSession; }
         int listenerSession() const { return mListenerSession; }
@@ -245,7 +246,7 @@
           const int mListenerSession;
           sync_event_callback_t mCallback;
           void * const mCookie;
-          Mutex mLock;
+          mutable Mutex mLock;
     };
 
     sp<SyncEvent> createSyncEvent(AudioSystem::sync_event_t type,
@@ -255,6 +256,8 @@
                                         void *cookie);
 
 private:
+    class AudioHwDevice;    // fwd declaration for findSuitableHwDev_l
+
                audio_mode_t getMode() const { return mMode; }
 
                 bool        btNrecIsOff() const { return mBtNrecIsOff; }
@@ -268,17 +271,17 @@
     // RefBase
     virtual     void        onFirstRef();
 
-    audio_hw_device_t*      findSuitableHwDev_l(audio_module_handle_t module, uint32_t devices);
+    AudioHwDevice*          findSuitableHwDev_l(audio_module_handle_t module, audio_devices_t devices);
     void                    purgeStaleEffects_l();
 
     // standby delay for MIXER and DUPLICATING playback threads is read from property
     // ro.audio.flinger_standbytime_ms or defaults to kDefaultStandbyTimeInNsecs
     static nsecs_t          mStandbyTimeInNsecs;
 
-    // Internal dump utilites.
-    status_t dumpPermissionDenial(int fd, const Vector<String16>& args);
-    status_t dumpClients(int fd, const Vector<String16>& args);
-    status_t dumpInternals(int fd, const Vector<String16>& args);
+    // Internal dump utilities.
+    void dumpPermissionDenial(int fd, const Vector<String16>& args);
+    void dumpClients(int fd, const Vector<String16>& args);
+    void dumpInternals(int fd, const Vector<String16>& args);
 
     // --- Client ---
     class Client : public RefBase {
@@ -350,11 +353,11 @@
             RECORD              // Thread class is RecordThread
         };
 
-        ThreadBase (const sp<AudioFlinger>& audioFlinger, audio_io_handle_t id, uint32_t device, type_t type);
+        ThreadBase (const sp<AudioFlinger>& audioFlinger, audio_io_handle_t id, audio_devices_t device, type_t type);
         virtual             ~ThreadBase();
 
-        status_t dumpBase(int fd, const Vector<String16>& args);
-        status_t dumpEffectChains(int fd, const Vector<String16>& args);
+        void dumpBase(int fd, const Vector<String16>& args);
+        void dumpEffectChains(int fd, const Vector<String16>& args);
 
         void clearPowerManager();
 
@@ -380,14 +383,14 @@
                                         const sp<Client>& client,
                                         uint32_t sampleRate,
                                         audio_format_t format,
-                                        uint32_t channelMask,
+                                        audio_channel_mask_t channelMask,
                                         int frameCount,
                                         const sp<IMemory>& sharedBuffer,
                                         int sessionId);
             virtual             ~TrackBase();
 
-            virtual status_t    start(AudioSystem::sync_event_t event = AudioSystem::SYNC_EVENT_NONE,
-                                     int triggerSession = 0) = 0;
+            virtual status_t    start(AudioSystem::sync_event_t event,
+                                     int triggerSession) = 0;
             virtual void        stop() = 0;
                     sp<IMemory> getCblk() const { return mCblkMemory; }
                     audio_track_cblk_t* cblk() const { return mCblk; }
@@ -412,10 +415,17 @@
 
             int channelCount() const { return mChannelCount; }
 
-            uint32_t channelMask() const { return mChannelMask; }
+            audio_channel_mask_t channelMask() const { return mChannelMask; }
 
             int sampleRate() const; // FIXME inline after cblk sr moved
 
+            // Return a pointer to the start of a contiguous slice of the track buffer.
+            // Parameter 'offset' is the requested start position, expressed in
+            // monotonically increasing frame units relative to the track epoch.
+            // Parameter 'frames' is the requested length, also in frame units.
+            // Always returns non-NULL.  It is the caller's responsibility to
+            // verify that this will be successful; the result of calling this
+            // function with invalid 'offset' or 'frames' is undefined.
             void* getBuffer(uint32_t offset, uint32_t frames) const;
 
             bool isStopped() const {
@@ -444,8 +454,9 @@
             /*const*/ sp<Client> mClient;   // see explanation at ~TrackBase() why not const
             sp<IMemory>         mCblkMemory;
             audio_track_cblk_t* mCblk;
-            void*               mBuffer;
-            void*               mBufferEnd;
+            void*               mBuffer;    // start of track buffer, typically in shared memory
+            void*               mBufferEnd; // &mBuffer[mFrameCount * frameSize], where frameSize
+                                            //   is based on mChannelCount and 16-bit samples
             uint32_t            mFrameCount;
             // we don't really need a lock for these
             track_state         mState;
@@ -455,7 +466,7 @@
             bool                mStepServerFailed;
             const int           mSessionId;
             uint8_t             mChannelCount;
-            uint32_t            mChannelMask;
+            audio_channel_mask_t mChannelMask;
             Vector < sp<SyncEvent> >mSyncEvents;
         };
 
@@ -483,14 +494,20 @@
         };
 
         virtual     status_t    initCheck() const = 0;
+
+                    // static externally-visible
                     type_t      type() const { return mType; }
+                    audio_io_handle_t id() const { return mId;}
+
+                    // dynamic externally-visible
                     uint32_t    sampleRate() const { return mSampleRate; }
                     int         channelCount() const { return mChannelCount; }
+                    audio_channel_mask_t channelMask() const { return mChannelMask; }
                     audio_format_t format() const { return mFormat; }
                     // Called by AudioFlinger::frameCount(audio_io_handle_t output) and effects,
                     // and returns the normal mix buffer's frame count.  No API for HAL frame count.
                     size_t      frameCount() const { return mNormalFrameCount; }
-                    void        wakeUp()    { mWaitWorkCV.broadcast(); }
+
         // Should be "virtual status_t requestExitAndWait()" and override same
         // method in Thread, but Thread::requestExitAndWait() is not yet virtual.
                     void        exit();
@@ -501,9 +518,11 @@
                     void        sendConfigEvent(int event, int param = 0);
                     void        sendConfigEvent_l(int event, int param = 0);
                     void        processConfigEvents();
-                    audio_io_handle_t id() const { return mId;}
+
+                    // see note at declaration of mStandby and mDevice
                     bool        standby() const { return mStandby; }
-                    uint32_t    device() const { return mDevice; }
+                    audio_devices_t device() const { return mDevice; }
+
         virtual     audio_stream_t* stream() const = 0;
 
                     sp<EffectHandle> createEffect_l(
@@ -515,7 +534,7 @@
                                         int *enabled,
                                         status_t *status);
                     void disconnectEffect(const sp< EffectModule>& effect,
-                                          const wp<EffectHandle>& handle,
+                                          EffectHandle *handle,
                                           bool unpinIfLast);
 
                     // return values for hasAudioSession (bit field)
@@ -529,7 +548,7 @@
                     // get effect chain corresponding to session Id.
                     sp<EffectChain> getEffectChain(int sessionId);
                     // same as getEffectChain() but must be called with ThreadBase mutex locked
-                    sp<EffectChain> getEffectChain_l(int sessionId);
+                    sp<EffectChain> getEffectChain_l(int sessionId) const;
                     // add an effect chain to the chain list (mEffectChains)
         virtual     status_t addEffectChain_l(const sp<EffectChain>& chain) = 0;
                     // remove an effect chain from the chain list (mEffectChains)
@@ -556,7 +575,7 @@
         virtual     void detachAuxEffect_l(int effectId) {}
                     // returns either EFFECT_SESSION if effects on this audio session exist in one
                     // chain, or TRACK_SESSION if tracks on this audio session exist, or both
-                    virtual uint32_t hasAudioSession(int sessionId) = 0;
+                    virtual uint32_t hasAudioSession(int sessionId) const = 0;
                     // the value returned by default implementation is not important as the
                     // strategy is only meaningful for PlaybackThread which implements this method
                     virtual uint32_t getStrategyForSession_l(int sessionId) { return 0; }
@@ -576,7 +595,7 @@
                                                        int sessionId = AUDIO_SESSION_OUTPUT_MIX);
 
                     virtual status_t    setSyncEvent(const sp<SyncEvent>& event) = 0;
-                    virtual bool        isValidSyncEvent(const sp<SyncEvent>& event) = 0;
+                    virtual bool        isValidSyncEvent(const sp<SyncEvent>& event) const = 0;
 
 
         mutable     Mutex                   mLock;
@@ -598,7 +617,7 @@
                     void        releaseWakeLock_l();
                     void setEffectSuspended_l(const effect_uuid_t *type,
                                               bool suspend,
-                                              int sessionId = AUDIO_SESSION_OUTPUT_MIX);
+                                              int sessionId);
                     // updated mSuspendedSessions when an effect suspended or restored
                     void        updateSuspendedSessions_l(const effect_uuid_t *type,
                                                           bool suspend,
@@ -617,7 +636,7 @@
                     uint32_t                mSampleRate;
                     size_t                  mFrameCount;       // output HAL, direct output, record
                     size_t                  mNormalFrameCount; // normal mixer and effects
-                    uint32_t                mChannelMask;
+                    audio_channel_mask_t    mChannelMask;
                     uint16_t                mChannelCount;
                     size_t                  mFrameSize;
                     audio_format_t          mFormat;
@@ -646,11 +665,19 @@
                     status_t                mParamStatus;
 
                     Vector<ConfigEvent>     mConfigEvents;
-                    bool                    mStandby;
+
+                    // These fields are written and read by thread itself without lock or barrier,
+                    // and read by other threads without lock or barrier via standby() and device().
+                    // Because of the absence of a lock or barrier, any other thread that reads
+                    // these fields must use the information in isolation, or be prepared to deal
+                    // with possibility that it might be inconsistent with other information.
+                    bool                    mStandby;   // Whether thread is currently in standby.
+                    audio_devices_t         mDevice;    // output device for PlaybackThread
+                                                        // input + output devices for RecordThread
+
                     const audio_io_handle_t mId;
                     Vector< sp<EffectChain> > mEffectChains;
-                    uint32_t                mDevice;    // output device for PlaybackThread
-                                                        // input + output devices for RecordThread
+
                     static const int        kNameLength = 16;   // prctl(PR_SET_NAME) limit
                     char                    mName[kNameLength];
                     sp<IPowerManager>       mPowerManager;
@@ -691,7 +718,7 @@
                                         audio_stream_type_t streamType,
                                         uint32_t sampleRate,
                                         audio_format_t format,
-                                        uint32_t channelMask,
+                                        audio_channel_mask_t channelMask,
                                         int frameCount,
                                         const sp<IMemory>& sharedBuffer,
                                         int sessionId,
@@ -708,9 +735,7 @@
                     void        flush();
                     void        destroy();
                     void        mute(bool);
-                    int name() const {
-                        return mName;
-                    }
+                    int         name() const { return mName; }
 
                     audio_stream_type_t streamType() const {
                         return mStreamType;
@@ -767,10 +792,14 @@
             void triggerEvents(AudioSystem::sync_event_t type);
             virtual bool isTimedTrack() const { return false; }
             bool isFastTrack() const { return (mFlags & IAudioFlinger::TRACK_FAST) != 0; }
+
         protected:
 
-            // we don't really need a lock for these
-            volatile bool       mMute;
+            // written by Track::mute() called by binder thread(s), without a mutex or barrier.
+            // read by Track::isMuted() called by playback thread, also without a mutex or barrier.
+            // The lack of mutex or barrier is safe because the mute status is only used by itself.
+            bool                mMute;
+
             // FILLED state is used for suppressing volume ramp at begin of playing
             enum {FS_INVALID, FS_FILLING, FS_FILLED, FS_ACTIVE};
             mutable uint8_t     mFillingUpStatus;
@@ -813,11 +842,11 @@
                                          audio_stream_type_t streamType,
                                          uint32_t sampleRate,
                                          audio_format_t format,
-                                         uint32_t channelMask,
+                                         audio_channel_mask_t channelMask,
                                          int frameCount,
                                          const sp<IMemory>& sharedBuffer,
                                          int sessionId);
-            ~TimedTrack();
+            virtual ~TimedTrack();
 
             class TimedBuffer {
               public:
@@ -856,7 +885,7 @@
                        audio_stream_type_t streamType,
                        uint32_t sampleRate,
                        audio_format_t format,
-                       uint32_t channelMask,
+                       audio_channel_mask_t channelMask,
                        int frameCount,
                        const sp<IMemory>& sharedBuffer,
                        int sessionId);
@@ -905,7 +934,7 @@
                                         DuplicatingThread *sourceThread,
                                         uint32_t sampleRate,
                                         audio_format_t format,
-                                        uint32_t channelMask,
+                                        audio_channel_mask_t channelMask,
                                         int frameCount);
             virtual             ~OutputTrack();
 
@@ -936,10 +965,10 @@
         };  // end of OutputTrack
 
         PlaybackThread (const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output,
-                        audio_io_handle_t id, uint32_t device, type_t type);
+                        audio_io_handle_t id, audio_devices_t device, type_t type);
         virtual             ~PlaybackThread();
 
-                    status_t    dump(int fd, const Vector<String16>& args);
+                    void        dump(int fd, const Vector<String16>& args);
 
         // Thread virtuals
         virtual     status_t    readyToRun();
@@ -984,7 +1013,7 @@
                                     audio_stream_type_t streamType,
                                     uint32_t sampleRate,
                                     audio_format_t format,
-                                    uint32_t channelMask,
+                                    audio_channel_mask_t channelMask,
                                     int frameCount,
                                     const sp<IMemory>& sharedBuffer,
                                     int sessionId,
@@ -996,9 +1025,19 @@
                     AudioStreamOut* clearOutput();
                     virtual audio_stream_t* stream() const;
 
-                    void        suspend() { mSuspended++; }
-                    void        restore() { if (mSuspended > 0) mSuspended--; }
-                    bool        isSuspended() const { return (mSuspended > 0); }
+                    // a very large number of suspend() will eventually wraparound, but unlikely
+                    void        suspend() { (void) android_atomic_inc(&mSuspended); }
+                    void        restore()
+                                    {
+                                        // if restore() is done without suspend(), get back into
+                                        // range so that the next suspend() will operate correctly
+                                        if (android_atomic_dec(&mSuspended) <= 0) {
+                                            android_atomic_release_store(0, &mSuspended);
+                                        }
+                                    }
+                    bool        isSuspended() const
+                                    { return android_atomic_acquire_load(&mSuspended) > 0; }
+
         virtual     String8     getParameters(const String8& keys);
         virtual     void        audioConfigChanged_l(int event, int param = 0);
                     status_t    getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames);
@@ -1012,16 +1051,25 @@
 
                     virtual status_t addEffectChain_l(const sp<EffectChain>& chain);
                     virtual size_t removeEffectChain_l(const sp<EffectChain>& chain);
-                    virtual uint32_t hasAudioSession(int sessionId);
+                    virtual uint32_t hasAudioSession(int sessionId) const;
                     virtual uint32_t getStrategyForSession_l(int sessionId);
 
 
                     virtual status_t setSyncEvent(const sp<SyncEvent>& event);
-                    virtual bool     isValidSyncEvent(const sp<SyncEvent>& event);
+                    virtual bool     isValidSyncEvent(const sp<SyncEvent>& event) const;
+                            void     invalidateTracks(audio_stream_type_t streamType);
+
 
     protected:
         int16_t*                        mMixBuffer;
-        uint32_t                        mSuspended;     // suspend count, > 0 means suspended
+
+        // suspend count, > 0 means suspended.  While suspended, the thread continues to pull from
+        // tracks and mix, but doesn't write to HAL.  A2DP and SCO HAL implementations can't handle
+        // concurrent use of both of them, so Audio Policy Service suspends one of the threads to
+        // workaround that restriction.
+        // 'volatile' means accessed via atomic operations and no lock.
+        volatile int32_t                mSuspended;
+
         int                             mBytesWritten;
     private:
         // mMasterMute is in both PlaybackThread and in AudioFlinger.  When a
@@ -1069,13 +1117,14 @@
 
         void        readOutputParameters();
 
-        virtual status_t    dumpInternals(int fd, const Vector<String16>& args);
-        status_t    dumpTracks(int fd, const Vector<String16>& args);
+        virtual void dumpInternals(int fd, const Vector<String16>& args);
+        void        dumpTracks(int fd, const Vector<String16>& args);
 
         SortedVector< sp<Track> >       mTracks;
         // mStreamTypes[] uses 1 additional stream type internally for the OutputTrack used by DuplicatingThread
         stream_type_t                   mStreamTypes[AUDIO_STREAM_CNT + 1];
         AudioStreamOut                  *mOutput;
+
         float                           mMasterVolume;
         nsecs_t                         mLastWriteTime;
         int                             mNumWrites;
@@ -1100,7 +1149,6 @@
 
         // FIXME move these declarations into the specific sub-class that needs them
         // MIXER only
-        bool                            longStandbyExit;
         uint32_t                        sleepTimeShift;
 
         // same as AudioFlinger::mStandbyTimeInNsecs except for DIRECT which uses a shorter value
@@ -1139,15 +1187,14 @@
         MixerThread (const sp<AudioFlinger>& audioFlinger,
                      AudioStreamOut* output,
                      audio_io_handle_t id,
-                     uint32_t device,
+                     audio_devices_t device,
                      type_t type = MIXER);
         virtual             ~MixerThread();
 
         // Thread virtuals
 
-                    void        invalidateTracks(audio_stream_type_t streamType);
         virtual     bool        checkForNewParameters_l();
-        virtual     status_t    dumpInternals(int fd, const Vector<String16>& args);
+        virtual     void        dumpInternals(int fd, const Vector<String16>& args);
 
     protected:
         virtual     mixer_state prepareTracks_l(Vector< sp<Track> > *tracksToRemove);
@@ -1167,9 +1214,6 @@
 
                     AudioMixer* mAudioMixer;    // normal mixer
     private:
-#ifdef SOAKER
-                    Thread*     mSoaker;
-#endif
                     // one-time initialization, no locks required
                     FastMixer*  mFastMixer;         // non-NULL if there is also a fast mixer
                     sp<AudioWatchdog> mAudioWatchdog; // non-0 if there is an audio watchdog thread
@@ -1198,7 +1242,7 @@
     public:
 
         DirectOutputThread (const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output,
-                            audio_io_handle_t id, uint32_t device);
+                            audio_io_handle_t id, audio_devices_t device);
         virtual                 ~DirectOutputThread();
 
         // Thread virtuals
@@ -1287,7 +1331,7 @@
                                      bool reRegister);
               // return thread associated with primary hardware device, or NULL
               PlaybackThread *primaryPlaybackThread_l() const;
-              uint32_t primaryOutputDevice_l() const;
+              audio_devices_t primaryOutputDevice_l() const;
 
               sp<PlaybackThread> getEffectThread_l(int sessionId, int EffectId);
 
@@ -1321,6 +1365,7 @@
 
     // record thread
     class RecordThread : public ThreadBase, public AudioBufferProvider
+                            // derives from AudioBufferProvider interface for use by resampler
     {
     public:
 
@@ -1331,18 +1376,22 @@
                                         const sp<Client>& client,
                                         uint32_t sampleRate,
                                         audio_format_t format,
-                                        uint32_t channelMask,
+                                        audio_channel_mask_t channelMask,
                                         int frameCount,
                                         int sessionId);
             virtual             ~RecordTrack();
 
-            virtual status_t    start(AudioSystem::sync_event_t event = AudioSystem::SYNC_EVENT_NONE,
-                                     int triggerSession = 0);
+            virtual status_t    start(AudioSystem::sync_event_t event, int triggerSession);
             virtual void        stop();
 
-                    bool        overflow() { bool tmp = mOverflow; mOverflow = false; return tmp; }
+                    void        destroy();
+
+                    // clear the buffer overflow flag
+                    void        clearOverflow() { mOverflow = false; }
+                    // set the buffer overflow flag and return previous value
                     bool        setOverflow() { bool tmp = mOverflow; mOverflow = true; return tmp; }
 
+            static  void        appendDumpHeader(String8& result);
                     void        dump(char* buffer, size_t size);
 
         private:
@@ -1355,19 +1404,25 @@
             virtual status_t getNextBuffer(AudioBufferProvider::Buffer* buffer, int64_t pts = kInvalidPTS);
             // releaseBuffer() not overridden
 
-            bool                mOverflow;
+            bool                mOverflow;  // overflow on most recent attempt to fill client buffer
         };
 
-
                 RecordThread(const sp<AudioFlinger>& audioFlinger,
                         AudioStreamIn *input,
                         uint32_t sampleRate,
-                        uint32_t channels,
+                        audio_channel_mask_t channelMask,
                         audio_io_handle_t id,
-                        uint32_t device);
+                        audio_devices_t device);
                 virtual     ~RecordThread();
 
-        // Thread
+        // no addTrack_l ?
+        void        destroyTrack_l(const sp<RecordTrack>& track);
+        void        removeTrack_l(const sp<RecordTrack>& track);
+
+        void        dumpInternals(int fd, const Vector<String16>& args);
+        void        dumpTracks(int fd, const Vector<String16>& args);
+
+        // Thread virtuals
         virtual bool        threadLoop();
         virtual status_t    readyToRun();
 
@@ -1379,17 +1434,22 @@
                         const sp<AudioFlinger::Client>& client,
                         uint32_t sampleRate,
                         audio_format_t format,
-                        int channelMask,
+                        audio_channel_mask_t channelMask,
                         int frameCount,
                         int sessionId,
+                        IAudioFlinger::track_flags_t flags,
+                        pid_t tid,
                         status_t *status);
 
                 status_t    start(RecordTrack* recordTrack,
                                   AudioSystem::sync_event_t event,
                                   int triggerSession);
-                void        stop(RecordTrack* recordTrack);
-                status_t    dump(int fd, const Vector<String16>& args);
-                AudioStreamIn* getInput() const;
+
+                // ask the thread to stop the specified track, and
+                // return true if the caller should then do it's part of the stopping process
+                bool        stop_l(RecordTrack* recordTrack);
+
+                void        dump(int fd, const Vector<String16>& args);
                 AudioStreamIn* clearInput();
                 virtual audio_stream_t* stream() const;
 
@@ -1405,11 +1465,15 @@
 
         virtual status_t addEffectChain_l(const sp<EffectChain>& chain);
         virtual size_t removeEffectChain_l(const sp<EffectChain>& chain);
-        virtual uint32_t hasAudioSession(int sessionId);
-                RecordTrack* track();
+        virtual uint32_t hasAudioSession(int sessionId) const;
+
+                // Return the set of unique session IDs across all tracks.
+                // The keys are the session IDs, and the associated values are meaningless.
+                // FIXME replace by Set [and implement Bag/Multiset for other uses].
+                KeyedVector<int, bool> sessionIds() const;
 
         virtual status_t setSyncEvent(const sp<SyncEvent>& event);
-        virtual bool     isValidSyncEvent(const sp<SyncEvent>& event);
+        virtual bool     isValidSyncEvent(const sp<SyncEvent>& event) const;
 
         static void syncStartEventCallback(const wp<SyncEvent>& event);
                void handleSyncStartEvent(const sp<SyncEvent>& event);
@@ -1417,9 +1481,16 @@
     private:
                 void clearSyncStartEvent();
 
-                RecordThread();
+                // Enter standby if not already in standby, and set mStandby flag
+                void standby();
+
+                // Call the HAL standby method unconditionally, and don't change mStandby flag
+                void inputStandBy();
+
                 AudioStreamIn                       *mInput;
-                RecordTrack*                        mTrack;
+                SortedVector < sp<RecordTrack> >    mTracks;
+                // mActiveTrack has dual roles:  it indicates the current active track, and
+                // is used together with mStartStopCond to indicate start()/stop() progress
                 sp<RecordTrack>                     mActiveTrack;
                 Condition                           mStartStopCond;
                 AudioResampler                      *mResampler;
@@ -1445,12 +1516,15 @@
         RecordHandle(const sp<RecordThread::RecordTrack>& recordTrack);
         virtual             ~RecordHandle();
         virtual sp<IMemory> getCblk() const;
-        virtual status_t    start(int event, int triggerSession);
+        virtual status_t    start(int /*AudioSystem::sync_event_t*/ event, int triggerSession);
         virtual void        stop();
         virtual status_t onTransact(
             uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags);
     private:
         const sp<RecordThread::RecordTrack> mRecordTrack;
+
+        // for use from destructor
+        void                stop_nonvirtual();
     };
 
     //--- Audio Effect Management
@@ -1510,6 +1584,7 @@
             return mSessionId;
         }
         status_t    setEnabled(bool enabled);
+        status_t    setEnabled_l(bool enabled);
         bool isEnabled() const;
         bool isProcessEnabled() const;
 
@@ -1521,14 +1596,14 @@
         void        setThread(const wp<ThreadBase>& thread) { mThread = thread; }
         const wp<ThreadBase>& thread() { return mThread; }
 
-        status_t addHandle(const sp<EffectHandle>& handle);
-        void disconnect(const wp<EffectHandle>& handle, bool unpinIfLast);
-        size_t removeHandle (const wp<EffectHandle>& handle);
+        status_t addHandle(EffectHandle *handle);
+        size_t disconnect(EffectHandle *handle, bool unpinIfLast);
+        size_t removeHandle(EffectHandle *handle);
 
-        effect_descriptor_t& desc() { return mDescriptor; }
+        const effect_descriptor_t& desc() const { return mDescriptor; }
         wp<EffectChain>&     chain() { return mChain; }
 
-        status_t         setDevice(uint32_t device);
+        status_t         setDevice(audio_devices_t device);
         status_t         setVolume(uint32_t *left, uint32_t *right, bool controller);
         status_t         setMode(audio_mode_t mode);
         status_t         start();
@@ -1536,12 +1611,15 @@
         void             setSuspended(bool suspended);
         bool             suspended() const;
 
-        sp<EffectHandle> controlHandle();
+        EffectHandle*    controlHandle_l();
 
         bool             isPinned() const { return mPinned; }
         void             unPin() { mPinned = false; }
+        bool             purgeHandles();
+        void             lock() { mLock.lock(); }
+        void             unlock() { mLock.unlock(); }
 
-        status_t         dump(int fd, const Vector<String16>& args);
+        void             dump(int fd, const Vector<String16>& args);
 
     protected:
         friend class AudioFlinger;      // for mHandles
@@ -1559,14 +1637,14 @@
 mutable Mutex               mLock;      // mutex for process, commands and handles list protection
         wp<ThreadBase>      mThread;    // parent thread
         wp<EffectChain>     mChain;     // parent effect chain
-        int                 mId;        // this instance unique ID
-        int                 mSessionId; // audio session ID
-        effect_descriptor_t mDescriptor;// effect descriptor received from effect engine
+        const int           mId;        // this instance unique ID
+        const int           mSessionId; // audio session ID
+        const effect_descriptor_t mDescriptor;// effect descriptor received from effect engine
         effect_config_t     mConfig;    // input and output audio configuration
         effect_handle_t  mEffectInterface; // Effect module C API
         status_t            mStatus;    // initialization status
         effect_state        mState;     // current activation state
-        Vector< wp<EffectHandle> > mHandles;    // list of client handles
+        Vector<EffectHandle *> mHandles;    // list of client handles
                     // First handle in mHandles has highest priority and controls the effect module
         uint32_t mMaxDisableWaitCnt;    // maximum grace period before forcing an effect off after
                                         // sending disable command.
@@ -1624,6 +1702,8 @@
         int priority() const { return mPriority; }
         bool hasControl() const { return mHasControl; }
         sp<EffectModule> effect() const { return mEffect; }
+        // destroyed_l() must be called with the associated EffectModule mLock held
+        bool destroyed_l() const { return mDestroyed; }
 
         void dump(char* buffer, size_t size);
 
@@ -1642,6 +1722,8 @@
         bool mHasControl;                   // true if this handle is controlling the effect
         bool mEnabled;                      // cached enable state: needed when the effect is
                                             // restored after being suspended
+        bool mDestroyed;                    // Set to true by destructor. Access with EffectModule
+                                            // mLock held
     };
 
     // the EffectChain class represents a group of effects associated to one audio session.
@@ -1684,7 +1766,7 @@
         sp<EffectModule> getEffectFromId_l(int id);
         sp<EffectModule> getEffectFromType_l(const effect_uuid_t *type);
         bool setVolume_l(uint32_t *left, uint32_t *right);
-        void setDevice_l(uint32_t device);
+        void setDevice_l(audio_devices_t device);
         void setMode_l(audio_mode_t mode);
 
         void setInBuffer(int16_t *buffer, bool ownsBuffer = false) {
@@ -1703,12 +1785,12 @@
 
         void incTrackCnt() { android_atomic_inc(&mTrackCnt); }
         void decTrackCnt() { android_atomic_dec(&mTrackCnt); }
-        int32_t trackCnt() const { return mTrackCnt;}
+        int32_t trackCnt() const { return android_atomic_acquire_load(&mTrackCnt); }
 
         void incActiveTrackCnt() { android_atomic_inc(&mActiveTrackCnt);
                                    mTailBufferCount = mMaxTailBuffers; }
         void decActiveTrackCnt() { android_atomic_dec(&mActiveTrackCnt); }
-        int32_t activeTrackCnt() const { return mActiveTrackCnt;}
+        int32_t activeTrackCnt() const { return android_atomic_acquire_load(&mActiveTrackCnt); }
 
         uint32_t strategy() const { return mStrategy; }
         void setStrategy(uint32_t strategy)
@@ -1725,7 +1807,7 @@
 
         void clearInputBuffer();
 
-        status_t dump(int fd, const Vector<String16>& args);
+        void dump(int fd, const Vector<String16>& args);
 
     protected:
         friend class AudioFlinger;  // for mThread, mEffects
@@ -1760,8 +1842,11 @@
         int mSessionId;             // audio session ID
         int16_t *mInBuffer;         // chain input buffer
         int16_t *mOutBuffer;        // chain output buffer
-        volatile int32_t mActiveTrackCnt;  // number of active tracks connected
-        volatile int32_t mTrackCnt;        // number of tracks connected
+
+        // 'volatile' here means these are accessed with atomic operations instead of mutex
+        volatile int32_t mActiveTrackCnt;    // number of active tracks connected
+        volatile int32_t mTrackCnt;          // number of tracks connected
+
         int32_t mTailBufferCount;   // current effect tail buffer count
         int32_t mMaxTailBuffers;    // maximum effect tail buffers
         bool mOwnInBuffer;          // true if the chain owns its input buffer
@@ -1778,24 +1863,59 @@
         KeyedVector< int, sp<SuspendedEffectDesc> > mSuspendedEffects;
     };
 
+    class AudioHwDevice {
+    public:
+        enum Flags {
+            AHWD_CAN_SET_MASTER_VOLUME  = 0x1,
+            AHWD_CAN_SET_MASTER_MUTE    = 0x2,
+        };
+
+        AudioHwDevice(const char *moduleName,
+                      audio_hw_device_t *hwDevice,
+                      Flags flags)
+            : mModuleName(strdup(moduleName))
+            , mHwDevice(hwDevice)
+            , mFlags(flags) { }
+        /*virtual*/ ~AudioHwDevice() { free((void *)mModuleName); }
+
+        bool canSetMasterVolume() const {
+            return (0 != (mFlags & AHWD_CAN_SET_MASTER_VOLUME));
+        }
+
+        bool canSetMasterMute() const {
+            return (0 != (mFlags & AHWD_CAN_SET_MASTER_MUTE));
+        }
+
+        const char *moduleName() const { return mModuleName; }
+        audio_hw_device_t *hwDevice() const { return mHwDevice; }
+    private:
+        const char * const mModuleName;
+        audio_hw_device_t * const mHwDevice;
+        Flags mFlags;
+    };
+
     // AudioStreamOut and AudioStreamIn are immutable, so their fields are const.
     // For emphasis, we could also make all pointers to them be "const *",
     // but that would clutter the code unnecessarily.
 
     struct AudioStreamOut {
-        audio_hw_device_t*  const hwDev;
+        AudioHwDevice* const audioHwDev;
         audio_stream_out_t* const stream;
 
-        AudioStreamOut(audio_hw_device_t *dev, audio_stream_out_t *out) :
-            hwDev(dev), stream(out) {}
+        audio_hw_device_t* hwDev() const { return audioHwDev->hwDevice(); }
+
+        AudioStreamOut(AudioHwDevice *dev, audio_stream_out_t *out) :
+            audioHwDev(dev), stream(out) {}
     };
 
     struct AudioStreamIn {
-        audio_hw_device_t* const hwDev;
+        AudioHwDevice* const audioHwDev;
         audio_stream_in_t* const stream;
 
-        AudioStreamIn(audio_hw_device_t *dev, audio_stream_in_t *in) :
-            hwDev(dev), stream(in) {}
+        audio_hw_device_t* hwDev() const { return audioHwDev->hwDevice(); }
+
+        AudioStreamIn(AudioHwDevice *dev, audio_stream_in_t *in) :
+            audioHwDev(dev), stream(in) {}
     };
 
     // for mAudioSessionRefs only
@@ -1807,41 +1927,6 @@
         int         mCnt;
     };
 
-    enum master_volume_support {
-        // MVS_NONE:
-        // Audio HAL has no support for master volume, either setting or
-        // getting.  All master volume control must be implemented in SW by the
-        // AudioFlinger mixing core.
-        MVS_NONE,
-
-        // MVS_SETONLY:
-        // Audio HAL has support for setting master volume, but not for getting
-        // master volume (original HAL design did not include a getter).
-        // AudioFlinger needs to keep track of the last set master volume in
-        // addition to needing to set an initial, default, master volume at HAL
-        // load time.
-        MVS_SETONLY,
-
-        // MVS_FULL:
-        // Audio HAL has support both for setting and getting master volume.
-        // AudioFlinger should send all set and get master volume requests
-        // directly to the HAL.
-        MVS_FULL,
-    };
-
-    class AudioHwDevice {
-    public:
-        AudioHwDevice(const char *moduleName, audio_hw_device_t *hwDevice) :
-            mModuleName(strdup(moduleName)), mHwDevice(hwDevice){}
-        ~AudioHwDevice() { free((void *)mModuleName); }
-
-        const char *moduleName() const { return mModuleName; }
-        audio_hw_device_t *hwDevice() const { return mHwDevice; }
-    private:
-        const char * const mModuleName;
-        audio_hw_device_t * const mHwDevice;
-    };
-
     mutable     Mutex                               mLock;
 
                 DefaultKeyedVector< pid_t, wp<Client> >     mClients;   // see ~Client()
@@ -1851,7 +1936,7 @@
                 // always take mLock before mHardwareLock
 
                 // These two fields are immutable after onFirstRef(), so no lock needed to access
-                audio_hw_device_t*                  mPrimaryHardwareDev; // mAudioHwDevs[0] or NULL
+                AudioHwDevice*                      mPrimaryHardwareDev; // mAudioHwDevs[0] or NULL
                 DefaultKeyedVector<audio_module_handle_t, AudioHwDevice*>  mAudioHwDevs;
 
     // for dump, indicates which hardware operation is currently in progress (but not stream ops)
@@ -1875,6 +1960,8 @@
         AUDIO_HW_GET_INPUT_BUFFER_SIZE, // get_input_buffer_size
         AUDIO_HW_GET_MASTER_VOLUME,     // get_master_volume
         AUDIO_HW_GET_PARAMETER,         // get_parameters
+        AUDIO_HW_SET_MASTER_MUTE,       // set_master_mute
+        AUDIO_HW_GET_MASTER_MUTE,       // get_master_mute
     };
 
     mutable     hardware_call_state                 mHardwareStatus;    // for dump only
@@ -1883,11 +1970,10 @@
                 DefaultKeyedVector< audio_io_handle_t, sp<PlaybackThread> >  mPlaybackThreads;
                 stream_type_t                       mStreamTypes[AUDIO_STREAM_CNT];
 
-                // both are protected by mLock
+                // member variables below are protected by mLock
                 float                               mMasterVolume;
-                float                               mMasterVolumeSW;
-                master_volume_support               mMasterVolumeSupportLvl;
                 bool                                mMasterMute;
+                // end of variables protected by mLock
 
                 DefaultKeyedVector< audio_io_handle_t, sp<RecordThread> >    mRecordThreads;
 
@@ -1900,8 +1986,7 @@
                 Vector<AudioSessionRef*> mAudioSessionRefs;
 
                 float       masterVolume_l() const;
-                float       masterVolumeSW_l() const  { return mMasterVolumeSW; }
-                bool        masterMute_l() const    { return mMasterMute; }
+                bool        masterMute_l() const;
                 audio_module_handle_t loadHwModule_l(const char *name);
 
                 Vector < sp<SyncEvent> > mPendingSyncEvents; // sync events awaiting for a session
@@ -1910,6 +1995,9 @@
 private:
     sp<Client>  registerPid_l(pid_t pid);    // always returns non-0
 
+    // for use from destructor
+    status_t    closeOutput_nonvirtual(audio_io_handle_t output);
+    status_t    closeInput_nonvirtual(audio_io_handle_t input);
 };
 
 
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 3e4c55e..a9814a1 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -416,7 +416,7 @@
     case TRACK:
         switch (param) {
         case CHANNEL_MASK: {
-            uint32_t mask = (uint32_t)value;
+            audio_channel_mask_t mask = (audio_channel_mask_t) value;
             if (track.channelMask != mask) {
                 uint32_t channelCount = popcount(mask);
                 ALOG_ASSERT((channelCount <= MAX_NUM_CHANNELS_TO_DOWNMIX) && channelCount);
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 46deae7..6e34cd1 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -23,7 +23,7 @@
 
 #include <utils/threads.h>
 
-#include "AudioBufferProvider.h"
+#include <media/AudioBufferProvider.h>
 #include "AudioResampler.h"
 
 #include <audio_effects/effect_downmix.h>
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index 0d13970..3a2dbe2 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -223,7 +223,7 @@
 audio_io_handle_t AudioPolicyService::getOutput(audio_stream_type_t stream,
                                     uint32_t samplingRate,
                                     audio_format_t format,
-                                    uint32_t channels,
+                                    audio_channel_mask_t channelMask,
                                     audio_output_flags_t flags)
 {
     if (mpAudioPolicy == NULL) {
@@ -231,7 +231,7 @@
     }
     ALOGV("getOutput() tid %d", gettid());
     Mutex::Autolock _l(mLock);
-    return mpAudioPolicy->get_output(mpAudioPolicy, stream, samplingRate, format, channels, flags);
+    return mpAudioPolicy->get_output(mpAudioPolicy, stream, samplingRate, format, channelMask, flags);
 }
 
 status_t AudioPolicyService::startOutput(audio_io_handle_t output,
@@ -271,8 +271,7 @@
 audio_io_handle_t AudioPolicyService::getInput(audio_source_t inputSource,
                                     uint32_t samplingRate,
                                     audio_format_t format,
-                                    uint32_t channels,
-                                    audio_in_acoustics_t acoustics,
+                                    audio_channel_mask_t channelMask,
                                     int audioSession)
 {
     if (mpAudioPolicy == NULL) {
@@ -283,8 +282,9 @@
         return 0;
     }
     Mutex::Autolock _l(mLock);
+    // the audio_in_acoustics_t parameter is ignored by get_input()
     audio_io_handle_t input = mpAudioPolicy->get_input(mpAudioPolicy, inputSource, samplingRate,
-                                                       format, channels, acoustics);
+                                                       format, channelMask, (audio_in_acoustics_t) 0);
 
     if (input == 0) {
         return input;
@@ -373,6 +373,7 @@
     if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         return BAD_VALUE;
     }
+    Mutex::Autolock _l(mLock);
     mpAudioPolicy->init_stream_volume(mpAudioPolicy, stream, indexMin, indexMax);
     return NO_ERROR;
 }
@@ -390,7 +391,7 @@
     if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         return BAD_VALUE;
     }
-
+    Mutex::Autolock _l(mLock);
     if (mpAudioPolicy->set_stream_volume_index_for_device) {
         return mpAudioPolicy->set_stream_volume_index_for_device(mpAudioPolicy,
                                                                 stream,
@@ -411,6 +412,7 @@
     if (uint32_t(stream) >= AUDIO_STREAM_CNT) {
         return BAD_VALUE;
     }
+    Mutex::Autolock _l(mLock);
     if (mpAudioPolicy->get_stream_volume_index_for_device) {
         return mpAudioPolicy->get_stream_volume_index_for_device(mpAudioPolicy,
                                                                 stream,
@@ -439,7 +441,7 @@
     return mpAudioPolicy->get_devices_for_stream(mpAudioPolicy, stream);
 }
 
-audio_io_handle_t AudioPolicyService::getOutputForEffect(effect_descriptor_t *desc)
+audio_io_handle_t AudioPolicyService::getOutputForEffect(const effect_descriptor_t *desc)
 {
     if (mpAudioPolicy == NULL) {
         return NO_INIT;
@@ -448,7 +450,7 @@
     return mpAudioPolicy->get_output_for_effect(mpAudioPolicy, desc);
 }
 
-status_t AudioPolicyService::registerEffect(effect_descriptor_t *desc,
+status_t AudioPolicyService::registerEffect(const effect_descriptor_t *desc,
                                 audio_io_handle_t io,
                                 uint32_t strategy,
                                 int session,
@@ -512,7 +514,7 @@
     for (size_t i = 0; i < effects.size(); i++) {
         effect_descriptor_t desc = effects[i]->descriptor();
         if (i < *count) {
-            memcpy(descriptors + i, &desc, sizeof(effect_descriptor_t));
+            descriptors[i] = desc;
         }
     }
     if (effects.size() > *count) {
@@ -778,7 +780,6 @@
     data->mType = type;
     data->mStream = stream;
     command->mParam = (void *)data;
-    command->mWaitStatus = false;
     Mutex::Autolock _l(mLock);
     insertCommand_l(command);
     ALOGV("AudioCommandThread() adding tone start type %d, stream %d", type, stream);
@@ -790,7 +791,6 @@
     AudioCommand *command = new AudioCommand();
     command->mCommand = STOP_TONE;
     command->mParam = NULL;
-    command->mWaitStatus = false;
     Mutex::Autolock _l(mLock);
     insertCommand_l(command);
     ALOGV("AudioCommandThread() adding tone stop");
@@ -811,11 +811,6 @@
     data->mVolume = volume;
     data->mIO = output;
     command->mParam = data;
-    if (delayMs == 0) {
-        command->mWaitStatus = true;
-    } else {
-        command->mWaitStatus = false;
-    }
     Mutex::Autolock _l(mLock);
     insertCommand_l(command, delayMs);
     ALOGV("AudioCommandThread() adding set volume stream %d, volume %f, output %d",
@@ -841,11 +836,6 @@
     data->mIO = ioHandle;
     data->mKeyValuePairs = String8(keyValuePairs);
     command->mParam = data;
-    if (delayMs == 0) {
-        command->mWaitStatus = true;
-    } else {
-        command->mWaitStatus = false;
-    }
     Mutex::Autolock _l(mLock);
     insertCommand_l(command, delayMs);
     ALOGV("AudioCommandThread() adding set parameter string %s, io %d ,delay %d",
@@ -868,11 +858,6 @@
     VoiceVolumeData *data = new VoiceVolumeData();
     data->mVolume = volume;
     command->mParam = data;
-    if (delayMs == 0) {
-        command->mWaitStatus = true;
-    } else {
-        command->mWaitStatus = false;
-    }
     Mutex::Autolock _l(mLock);
     insertCommand_l(command, delayMs);
     ALOGV("AudioCommandThread() adding set voice volume volume %f", volume);
@@ -891,6 +876,7 @@
     ssize_t i;  // not size_t because i will count down to -1
     Vector <AudioCommand *> removedCommands;
 
+    nsecs_t time = 0;
     command->mTime = systemTime() + milliseconds(delayMs);
 
     // acquire wake lock to make sure delayed commands are processed
@@ -936,6 +922,7 @@
             } else {
                 data2->mKeyValuePairs = param2.toString();
             }
+            time = command2->mTime;
         } break;
 
         case SET_VOLUME: {
@@ -946,6 +933,7 @@
             ALOGV("Filtering out volume command on output %d for stream %d",
                     data->mIO, data->mStream);
             removedCommands.add(command2);
+            time = command2->mTime;
         } break;
         case START_TONE:
         case STOP_TONE:
@@ -967,6 +955,17 @@
     }
     removedCommands.clear();
 
+    // wait for status only if delay is 0 and command time was not modified above
+    if (delayMs == 0 && time == 0) {
+        command->mWaitStatus = true;
+    } else {
+        command->mWaitStatus = false;
+    }
+    // update command time if modified above
+    if (time != 0) {
+        command->mTime = time;
+    }
+
     // insert command at the right place according to its time stamp
     ALOGV("inserting command: %d at index %d, num commands %d",
             command->mCommand, (int)i+1, mAudioCommands.size());
@@ -1422,7 +1421,7 @@
     return af->restoreOutput(output);
 }
 
-// deprecated: replaced by aps_open_input_on_module()
+// deprecated: replaced by aps_open_input_on_module(), and acoustics parameter is ignored
 static audio_io_handle_t aps_open_input(void *service,
                                         audio_devices_t *pDevices,
                                         uint32_t *pSamplingRate,
diff --git a/services/audioflinger/AudioPolicyService.h b/services/audioflinger/AudioPolicyService.h
index fbca000..a086734 100644
--- a/services/audioflinger/AudioPolicyService.h
+++ b/services/audioflinger/AudioPolicyService.h
@@ -64,7 +64,7 @@
     virtual audio_io_handle_t getOutput(audio_stream_type_t stream,
                                         uint32_t samplingRate = 0,
                                         audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                        uint32_t channels = 0,
+                                        audio_channel_mask_t channelMask = 0,
                                         audio_output_flags_t flags =
                                                 AUDIO_OUTPUT_FLAG_NONE);
     virtual status_t startOutput(audio_io_handle_t output,
@@ -77,9 +77,7 @@
     virtual audio_io_handle_t getInput(audio_source_t inputSource,
                                     uint32_t samplingRate = 0,
                                     audio_format_t format = AUDIO_FORMAT_DEFAULT,
-                                    uint32_t channels = 0,
-                                    audio_in_acoustics_t acoustics =
-                                            (audio_in_acoustics_t)0 /*AUDIO_IN_ACOUSTICS_NONE*/,
+                                    audio_channel_mask_t channelMask = 0,
                                     int audioSession = 0);
     virtual status_t startInput(audio_io_handle_t input);
     virtual status_t stopInput(audio_io_handle_t input);
@@ -97,8 +95,8 @@
     virtual uint32_t getStrategyForStream(audio_stream_type_t stream);
     virtual audio_devices_t getDevicesForStream(audio_stream_type_t stream);
 
-    virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc);
-    virtual status_t registerEffect(effect_descriptor_t *desc,
+    virtual audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc);
+    virtual status_t registerEffect(const effect_descriptor_t *desc,
                                     audio_io_handle_t io,
                                     uint32_t strategy,
                                     int session,
diff --git a/services/audioflinger/AudioResampler.h b/services/audioflinger/AudioResampler.h
index 1610e00..dc696d8 100644
--- a/services/audioflinger/AudioResampler.h
+++ b/services/audioflinger/AudioResampler.h
@@ -20,7 +20,7 @@
 #include <stdint.h>
 #include <sys/types.h>
 
-#include "AudioBufferProvider.h"
+#include <media/AudioBufferProvider.h>
 
 namespace android {
 // ----------------------------------------------------------------------------
diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp
index 7652132..fbcc11a 100644
--- a/services/audioflinger/FastMixer.cpp
+++ b/services/audioflinger/FastMixer.cpp
@@ -222,8 +222,8 @@
                     mixBuffer = new short[frameCount * 2];
                     periodNs = (frameCount * 1000000000LL) / sampleRate;    // 1.00
                     underrunNs = (frameCount * 1750000000LL) / sampleRate;  // 1.75
-                    overrunNs = (frameCount * 250000000LL) / sampleRate;    // 0.25
-                    forceNs = (frameCount * 750000000LL) / sampleRate;      // 0.75
+                    overrunNs = (frameCount * 500000000LL) / sampleRate;    // 0.50
+                    forceNs = (frameCount * 950000000LL) / sampleRate;      // 0.95
                     warmupNs = (frameCount * 500000000LL) / sampleRate;     // 0.50
                 } else {
                     periodNs = 0;
@@ -399,8 +399,13 @@
                 ftDump->mUnderruns = underruns;
                 ftDump->mFramesReady = framesReady;
             }
+
+            int64_t pts;
+            if (outputSink == NULL || (OK != outputSink->getNextWriteTimestamp(&pts)))
+                pts = AudioBufferProvider::kInvalidPTS;
+
             // process() is CPU-bound
-            mixer->process(AudioBufferProvider::kInvalidPTS);
+            mixer->process(pts);
             mixBufferState = MIXED;
         } else if (mixBufferState == MIXED) {
             mixBufferState = UNDEFINED;
diff --git a/services/audioflinger/FastMixerState.h b/services/audioflinger/FastMixerState.h
index bc69c9c..6e53f21 100644
--- a/services/audioflinger/FastMixerState.h
+++ b/services/audioflinger/FastMixerState.h
@@ -18,8 +18,8 @@
 #define ANDROID_AUDIO_FAST_MIXER_STATE_H
 
 #include <system/audio.h>
-#include "ExtendedAudioBufferProvider.h"
-#include "NBAIO.h"
+#include <media/ExtendedAudioBufferProvider.h>
+#include <media/nbaio/NBAIO.h>
 
 namespace android {
 
diff --git a/services/audioflinger/MonoPipe.cpp b/services/audioflinger/MonoPipe.cpp
deleted file mode 100644
index f3fc19a..0000000
--- a/services/audioflinger/MonoPipe.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "MonoPipe"
-//#define LOG_NDEBUG 0
-
-#include <cutils/atomic.h>
-#include <cutils/compiler.h>
-#include <utils/Log.h>
-#include <utils/Trace.h>
-#include "MonoPipe.h"
-#include "roundup.h"
-
-namespace android {
-
-MonoPipe::MonoPipe(size_t reqFrames, NBAIO_Format format, bool writeCanBlock) :
-        NBAIO_Sink(format),
-        mReqFrames(reqFrames),
-        mMaxFrames(roundup(reqFrames)),
-        mBuffer(malloc(mMaxFrames * Format_frameSize(format))),
-        mFront(0),
-        mRear(0),
-        mWriteTsValid(false),
-        // mWriteTs
-        mSetpoint((reqFrames * 11) / 16),
-        mWriteCanBlock(writeCanBlock)
-{
-}
-
-MonoPipe::~MonoPipe()
-{
-    free(mBuffer);
-}
-
-ssize_t MonoPipe::availableToWrite() const
-{
-    if (CC_UNLIKELY(!mNegotiated)) {
-        return NEGOTIATE;
-    }
-    // uses mMaxFrames not mReqFrames, so allows "over-filling" the pipe beyond requested limit
-    ssize_t ret = mMaxFrames - (mRear - android_atomic_acquire_load(&mFront));
-    ALOG_ASSERT((0 <= ret) && (ret <= mMaxFrames));
-    return ret;
-}
-
-ssize_t MonoPipe::write(const void *buffer, size_t count)
-{
-    if (CC_UNLIKELY(!mNegotiated)) {
-        return NEGOTIATE;
-    }
-    size_t totalFramesWritten = 0;
-    while (count > 0) {
-        // can't return a negative value, as we already checked for !mNegotiated
-        size_t avail = availableToWrite();
-        size_t written = avail;
-        if (CC_LIKELY(written > count)) {
-            written = count;
-        }
-        size_t rear = mRear & (mMaxFrames - 1);
-        size_t part1 = mMaxFrames - rear;
-        if (part1 > written) {
-            part1 = written;
-        }
-        if (CC_LIKELY(part1 > 0)) {
-            memcpy((char *) mBuffer + (rear << mBitShift), buffer, part1 << mBitShift);
-            if (CC_UNLIKELY(rear + part1 == mMaxFrames)) {
-                size_t part2 = written - part1;
-                if (CC_LIKELY(part2 > 0)) {
-                    memcpy(mBuffer, (char *) buffer + (part1 << mBitShift), part2 << mBitShift);
-                }
-            }
-            android_atomic_release_store(written + mRear, &mRear);
-            totalFramesWritten += written;
-        }
-        if (!mWriteCanBlock) {
-            break;
-        }
-        count -= written;
-        buffer = (char *) buffer + (written << mBitShift);
-        // Simulate blocking I/O by sleeping at different rates, depending on a throttle.
-        // The throttle tries to keep the mean pipe depth near the setpoint, with a slight jitter.
-        uint32_t ns;
-        if (written > 0) {
-            size_t filled = (mMaxFrames - avail) + written;
-            // FIXME cache these values to avoid re-computation
-            if (filled <= mSetpoint / 2) {
-                // pipe is (nearly) empty, fill quickly
-                ns = written * ( 500000000 / Format_sampleRate(mFormat));
-            } else if (filled <= (mSetpoint * 3) / 4) {
-                // pipe is below setpoint, fill at slightly faster rate
-                ns = written * ( 750000000 / Format_sampleRate(mFormat));
-            } else if (filled <= (mSetpoint * 5) / 4) {
-                // pipe is at setpoint, fill at nominal rate
-                ns = written * (1000000000 / Format_sampleRate(mFormat));
-            } else if (filled <= (mSetpoint * 3) / 2) {
-                // pipe is above setpoint, fill at slightly slower rate
-                ns = written * (1150000000 / Format_sampleRate(mFormat));
-            } else if (filled <= (mSetpoint * 7) / 4) {
-                // pipe is overflowing, fill slowly
-                ns = written * (1350000000 / Format_sampleRate(mFormat));
-            } else {
-                // pipe is severely overflowing
-                ns = written * (1750000000 / Format_sampleRate(mFormat));
-            }
-        } else {
-            ns = count * (1350000000 / Format_sampleRate(mFormat));
-        }
-        if (ns > 999999999) {
-            ns = 999999999;
-        }
-        struct timespec nowTs;
-        bool nowTsValid = !clock_gettime(CLOCK_MONOTONIC, &nowTs);
-        // deduct the elapsed time since previous write() completed
-        if (nowTsValid && mWriteTsValid) {
-            time_t sec = nowTs.tv_sec - mWriteTs.tv_sec;
-            long nsec = nowTs.tv_nsec - mWriteTs.tv_nsec;
-            if (nsec < 0) {
-                --sec;
-                nsec += 1000000000;
-            }
-            if (sec == 0) {
-                if ((long) ns > nsec) {
-                    ns -= nsec;
-                } else {
-                    ns = 0;
-                }
-            }
-        }
-        if (ns > 0) {
-            const struct timespec req = {0, ns};
-            nanosleep(&req, NULL);
-        }
-        // record the time that this write() completed
-        if (nowTsValid) {
-            mWriteTs = nowTs;
-            if ((mWriteTs.tv_nsec += ns) >= 1000000000) {
-                mWriteTs.tv_nsec -= 1000000000;
-                ++mWriteTs.tv_sec;
-            }
-        }
-        mWriteTsValid = nowTsValid;
-    }
-    mFramesWritten += totalFramesWritten;
-    return totalFramesWritten;
-}
-
-void MonoPipe::setAvgFrames(size_t setpoint)
-{
-    mSetpoint = setpoint;
-}
-
-}   // namespace android
diff --git a/services/audioflinger/MonoPipe.h b/services/audioflinger/MonoPipe.h
deleted file mode 100644
index f6e2cb3..0000000
--- a/services/audioflinger/MonoPipe.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_AUDIO_MONO_PIPE_H
-#define ANDROID_AUDIO_MONO_PIPE_H
-
-#include <time.h>
-#include "NBAIO.h"
-
-namespace android {
-
-// MonoPipe is similar to Pipe except:
-//  - supports only a single reader, called MonoPipeReader
-//  - write() cannot overrun; instead it will return a short actual count if insufficient space
-//  - write() can optionally block if the pipe is full
-// Like Pipe, it is not multi-thread safe for either writer or reader
-// but writer and reader can be different threads.
-class MonoPipe : public NBAIO_Sink {
-
-    friend class MonoPipeReader;
-
-public:
-    // reqFrames will be rounded up to a power of 2, and all slots are available. Must be >= 2.
-    // Note: whatever shares this object with another thread needs to do so in an SMP-safe way (like
-    // creating it the object before creating the other thread, or storing the object with a
-    // release_store). Otherwise the other thread could see a partially-constructed object.
-    MonoPipe(size_t reqFrames, NBAIO_Format format, bool writeCanBlock = false);
-    virtual ~MonoPipe();
-
-    // NBAIO_Port interface
-
-    //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers,
-    //                          NBAIO_Format counterOffers[], size_t& numCounterOffers);
-    //virtual NBAIO_Format format() const;
-
-    // NBAIO_Sink interface
-
-    //virtual size_t framesWritten() const;
-    //virtual size_t framesUnderrun() const;
-    //virtual size_t underruns() const;
-
-    virtual ssize_t availableToWrite() const;
-    virtual ssize_t write(const void *buffer, size_t count);
-    //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block);
-
-            // average number of frames present in the pipe under normal conditions.
-            // See throttling mechanism in MonoPipe::write()
-            size_t  getAvgFrames() const { return mSetpoint; }
-            void    setAvgFrames(size_t setpoint);
-            size_t  maxFrames() const { return mMaxFrames; }
-
-private:
-    const size_t    mReqFrames;     // as requested in constructor, unrounded
-    const size_t    mMaxFrames;     // always a power of 2
-    void * const    mBuffer;
-    // mFront and mRear will never be separated by more than mMaxFrames.
-    // 32-bit overflow is possible if the pipe is active for a long time, but if that happens it's
-    // safe because we "&" with (mMaxFrames-1) at end of computations to calculate a buffer index.
-    volatile int32_t mFront;        // written by reader with android_atomic_release_store,
-                                    // read by writer with android_atomic_acquire_load
-    volatile int32_t mRear;         // written by writer with android_atomic_release_store,
-                                    // read by reader with android_atomic_acquire_load
-    bool            mWriteTsValid;  // whether mWriteTs is valid
-    struct timespec mWriteTs;       // time that the previous write() completed
-    size_t          mSetpoint;      // target value for pipe fill depth
-    const bool      mWriteCanBlock; // whether write() should block if the pipe is full
-};
-
-}   // namespace android
-
-#endif  // ANDROID_AUDIO_MONO_PIPE_H
diff --git a/services/audioflinger/Soaker.h b/services/audioflinger/Soaker.h
deleted file mode 100644
index 43d9d2f..0000000
--- a/services/audioflinger/Soaker.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _ANDROID_AUDIO_SOAKER_H
-#define _ANDROID_AUDIO_SOAKER_H
-
-#include <utils/Thread.h>
-
-namespace android {
-
-class Soaker : public Thread {
-public:
-    Soaker() : Thread() { }
-    virtual ~Soaker() { }
-protected:
-    virtual bool threadLoop() {
-        int j = 0;
-        for (;;) {
-            for (int i = 0; i < 10000; ++i) {
-                j += i * i;
-            }
-            if (exitPending()) {
-                return false;
-            }
-        }
-        return j < 555555;
-    }
-};
-
-}   // namespace android
-
-#endif  // _ANDROID_AUDIO_SOAKER_H
diff --git a/services/camera/libcameraservice/Android.mk b/services/camera/libcameraservice/Android.mk
index 3cae1f5..1370c62 100644
--- a/services/camera/libcameraservice/Android.mk
+++ b/services/camera/libcameraservice/Android.mk
@@ -7,7 +7,15 @@
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES:=               \
-    CameraService.cpp
+    CameraService.cpp \
+    CameraClient.cpp \
+    Camera2Client.cpp \
+    Camera2Device.cpp \
+    camera2/CameraMetadata.cpp \
+    camera2/Parameters.cpp \
+    camera2/FrameProcessor.cpp \
+    camera2/CaptureProcessor.cpp \
+    camera2/CallbackProcessor.cpp
 
 LOCAL_SHARED_LIBRARIES:= \
     libui \
@@ -18,7 +26,12 @@
     libmedia_native \
     libcamera_client \
     libgui \
-    libhardware
+    libhardware \
+    libsync \
+    libcamera_metadata
+
+LOCAL_C_INCLUDES += \
+    system/media/camera/include
 
 LOCAL_MODULE:= libcameraservice
 
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
new file mode 100644
index 0000000..acd290d
--- /dev/null
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -0,0 +1,2135 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Camera2Client"
+#define ATRACE_TAG ATRACE_TAG_CAMERA
+//#define LOG_NDEBUG 0
+
+#include <utils/Log.h>
+#include <utils/Trace.h>
+
+#include <cutils/properties.h>
+#include <gui/SurfaceTextureClient.h>
+#include <gui/Surface.h>
+#include <media/hardware/MetadataBufferType.h>
+
+#include "Camera2Client.h"
+
+#define ALOG1(...) ALOGD_IF(gLogLevel >= 1, __VA_ARGS__);
+#define ALOG2(...) ALOGD_IF(gLogLevel >= 2, __VA_ARGS__);
+
+namespace android {
+
+using namespace camera2;
+
+static int getCallingPid() {
+    return IPCThreadState::self()->getCallingPid();
+}
+
+static int getCallingUid() {
+    return IPCThreadState::self()->getCallingUid();
+}
+
+// Interface used by CameraService
+
+Camera2Client::Camera2Client(const sp<CameraService>& cameraService,
+        const sp<ICameraClient>& cameraClient,
+        int cameraId,
+        int cameraFacing,
+        int clientPid):
+        Client(cameraService, cameraClient,
+                cameraId, cameraFacing, clientPid),
+        mSharedCameraClient(cameraClient),
+        mParameters(cameraId, cameraFacing),
+        mPreviewStreamId(NO_STREAM),
+        mRecordingStreamId(NO_STREAM),
+        mRecordingHeapCount(kDefaultRecordingHeapCount)
+{
+    ATRACE_CALL();
+    ALOGV("%s: Created client for camera %d", __FUNCTION__, cameraId);
+
+    mDevice = new Camera2Device(cameraId);
+
+    SharedParameters::Lock l(mParameters);
+    l.mParameters.state = Parameters::DISCONNECTED;
+}
+
+status_t Camera2Client::checkPid(const char* checkLocation) const {
+    int callingPid = getCallingPid();
+    if (callingPid == mClientPid) return NO_ERROR;
+
+    ALOGE("%s: attempt to use a locked camera from a different process"
+            " (old pid %d, new pid %d)", checkLocation, mClientPid, callingPid);
+    return PERMISSION_DENIED;
+}
+
+status_t Camera2Client::initialize(camera_module_t *module)
+{
+    ATRACE_CALL();
+    ALOGV("%s: Initializing client for camera %d", __FUNCTION__, mCameraId);
+    status_t res;
+
+    res = mDevice->initialize(module);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: unable to initialize device: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return NO_INIT;
+    }
+
+    res = mDevice->setNotifyCallback(this);
+
+    SharedParameters::Lock l(mParameters);
+
+    res = l.mParameters.initialize(&(mDevice->info()));
+    if (res != OK) {
+        ALOGE("%s: Camera %d: unable to build defaults: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return NO_INIT;
+    }
+
+    mFrameProcessor = new FrameProcessor(this);
+    String8 frameThreadName = String8::format("Camera2Client[%d]::FrameProcessor",
+            mCameraId);
+    mFrameProcessor->run(frameThreadName.string());
+
+    mCaptureProcessor = new CaptureProcessor(this);
+    String8 captureThreadName =
+            String8::format("Camera2Client[%d]::CaptureProcessor", mCameraId);
+    mCaptureProcessor->run(captureThreadName.string());
+
+    mCallbackProcessor = new CallbackProcessor(this);
+    String8 callbackThreadName =
+            String8::format("Camera2Client[%d]::CallbackProcessor", mCameraId);
+    mCallbackProcessor->run(callbackThreadName.string());
+
+    if (gLogLevel >= 1) {
+        ALOGD("%s: Default parameters converted from camera %d:", __FUNCTION__,
+              mCameraId);
+        ALOGD("%s", l.mParameters.paramsFlattened.string());
+    }
+
+    return OK;
+}
+
+Camera2Client::~Camera2Client() {
+    ATRACE_CALL();
+    ALOGV("%s: Camera %d: Shutting down client.", __FUNCTION__, mCameraId);
+
+    mDestructionStarted = true;
+
+    // Rewrite mClientPid to allow shutdown by CameraService
+    mClientPid = getCallingPid();
+    disconnect();
+
+    mFrameProcessor->requestExit();
+    ALOGV("%s: Camera %d: Shutdown complete", __FUNCTION__, mCameraId);
+}
+
+status_t Camera2Client::dump(int fd, const Vector<String16>& args) {
+    String8 result;
+    result.appendFormat("Client2[%d] (%p) PID: %d, dump:\n",
+            mCameraId,
+            getCameraClient()->asBinder().get(),
+            mClientPid);
+    result.append("  State: ");
+#define CASE_APPEND_ENUM(x) case x: result.append(#x "\n"); break;
+
+    const Parameters& p = mParameters.unsafeAccess();
+
+    result.append(Parameters::getStateName(p.state));
+
+    result.append("\n  Current parameters:\n");
+    result.appendFormat("    Preview size: %d x %d\n",
+            p.previewWidth, p.previewHeight);
+    result.appendFormat("    Preview FPS range: %d - %d\n",
+            p.previewFpsRange[0], p.previewFpsRange[1]);
+    result.appendFormat("    Preview HAL pixel format: 0x%x\n",
+            p.previewFormat);
+    result.appendFormat("    Preview transform: %x\n",
+            p.previewTransform);
+    result.appendFormat("    Picture size: %d x %d\n",
+            p.pictureWidth, p.pictureHeight);
+    result.appendFormat("    Jpeg thumbnail size: %d x %d\n",
+            p.jpegThumbSize[0], p.jpegThumbSize[1]);
+    result.appendFormat("    Jpeg quality: %d, thumbnail quality: %d\n",
+            p.jpegQuality, p.jpegThumbQuality);
+    result.appendFormat("    Jpeg rotation: %d\n", p.jpegRotation);
+    result.appendFormat("    GPS tags %s\n",
+            p.gpsEnabled ? "enabled" : "disabled");
+    if (p.gpsEnabled) {
+        result.appendFormat("    GPS lat x long x alt: %f x %f x %f\n",
+                p.gpsCoordinates[0], p.gpsCoordinates[1],
+                p.gpsCoordinates[2]);
+        result.appendFormat("    GPS timestamp: %lld\n",
+                p.gpsTimestamp);
+        result.appendFormat("    GPS processing method: %s\n",
+                p.gpsProcessingMethod.string());
+    }
+
+    result.append("    White balance mode: ");
+    switch (p.wbMode) {
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AWB_AUTO)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AWB_INCANDESCENT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AWB_FLUORESCENT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AWB_WARM_FLUORESCENT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AWB_DAYLIGHT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AWB_CLOUDY_DAYLIGHT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AWB_TWILIGHT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AWB_SHADE)
+        default: result.append("UNKNOWN\n");
+    }
+
+    result.append("    Effect mode: ");
+    switch (p.effectMode) {
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_OFF)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_MONO)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_NEGATIVE)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_SOLARIZE)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_SEPIA)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_POSTERIZE)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_WHITEBOARD)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_BLACKBOARD)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_EFFECT_AQUA)
+        default: result.append("UNKNOWN\n");
+    }
+
+    result.append("    Antibanding mode: ");
+    switch (p.antibandingMode) {
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AE_ANTIBANDING_AUTO)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AE_ANTIBANDING_OFF)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AE_ANTIBANDING_50HZ)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_AE_ANTIBANDING_60HZ)
+        default: result.append("UNKNOWN\n");
+    }
+
+    result.append("    Scene mode: ");
+    switch (p.sceneMode) {
+        case ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED:
+            result.append("AUTO\n"); break;
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_ACTION)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_PORTRAIT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_LANDSCAPE)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_NIGHT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_NIGHT_PORTRAIT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_THEATRE)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_BEACH)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_SNOW)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_SUNSET)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_STEADYPHOTO)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_FIREWORKS)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_SPORTS)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_PARTY)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_CANDLELIGHT)
+        CASE_APPEND_ENUM(ANDROID_CONTROL_SCENE_MODE_BARCODE)
+        default: result.append("UNKNOWN\n");
+    }
+
+    result.append("    Flash mode: ");
+    switch (p.flashMode) {
+        CASE_APPEND_ENUM(Parameters::FLASH_MODE_OFF)
+        CASE_APPEND_ENUM(Parameters::FLASH_MODE_AUTO)
+        CASE_APPEND_ENUM(Parameters::FLASH_MODE_ON)
+        CASE_APPEND_ENUM(Parameters::FLASH_MODE_TORCH)
+        CASE_APPEND_ENUM(Parameters::FLASH_MODE_RED_EYE)
+        CASE_APPEND_ENUM(Parameters::FLASH_MODE_INVALID)
+        default: result.append("UNKNOWN\n");
+    }
+
+    result.append("    Focus mode: ");
+    switch (p.focusMode) {
+        CASE_APPEND_ENUM(Parameters::FOCUS_MODE_AUTO)
+        CASE_APPEND_ENUM(Parameters::FOCUS_MODE_MACRO)
+        CASE_APPEND_ENUM(Parameters::FOCUS_MODE_CONTINUOUS_VIDEO)
+        CASE_APPEND_ENUM(Parameters::FOCUS_MODE_CONTINUOUS_PICTURE)
+        CASE_APPEND_ENUM(Parameters::FOCUS_MODE_EDOF)
+        CASE_APPEND_ENUM(Parameters::FOCUS_MODE_INFINITY)
+        CASE_APPEND_ENUM(Parameters::FOCUS_MODE_FIXED)
+        CASE_APPEND_ENUM(Parameters::FOCUS_MODE_INVALID)
+        default: result.append("UNKNOWN\n");
+    }
+
+    result.append("    Focusing areas:\n");
+    for (size_t i = 0; i < p.focusingAreas.size(); i++) {
+        result.appendFormat("      [ (%d, %d, %d, %d), weight %d ]\n",
+                p.focusingAreas[i].left,
+                p.focusingAreas[i].top,
+                p.focusingAreas[i].right,
+                p.focusingAreas[i].bottom,
+                p.focusingAreas[i].weight);
+    }
+
+    result.appendFormat("    Exposure compensation index: %d\n",
+            p.exposureCompensation);
+
+    result.appendFormat("    AE lock %s, AWB lock %s\n",
+            p.autoExposureLock ? "enabled" : "disabled",
+            p.autoWhiteBalanceLock ? "enabled" : "disabled" );
+
+    result.appendFormat("    Metering areas:\n");
+    for (size_t i = 0; i < p.meteringAreas.size(); i++) {
+        result.appendFormat("      [ (%d, %d, %d, %d), weight %d ]\n",
+                p.meteringAreas[i].left,
+                p.meteringAreas[i].top,
+                p.meteringAreas[i].right,
+                p.meteringAreas[i].bottom,
+                p.meteringAreas[i].weight);
+    }
+
+    result.appendFormat("    Zoom index: %d\n", p.zoom);
+    result.appendFormat("    Video size: %d x %d\n", p.videoWidth,
+            p.videoHeight);
+
+    result.appendFormat("    Recording hint is %s\n",
+            p.recordingHint ? "set" : "not set");
+
+    result.appendFormat("    Video stabilization is %s\n",
+            p.videoStabilization ? "enabled" : "disabled");
+
+    result.append("  Current streams:\n");
+    result.appendFormat("    Preview stream ID: %d\n", mPreviewStreamId);
+    result.appendFormat("    Capture stream ID: %d\n",
+            mCaptureProcessor->getStreamId());
+    result.appendFormat("    Recording stream ID: %d\n", mRecordingStreamId);
+
+    result.append("  Current requests:\n");
+    if (mPreviewRequest.entryCount() != 0) {
+        result.append("    Preview request:\n");
+        write(fd, result.string(), result.size());
+        mPreviewRequest.dump(fd, 2, 6);
+    } else {
+        result.append("    Preview request: undefined\n");
+        write(fd, result.string(), result.size());
+    }
+
+    if (mCaptureRequest.entryCount() != 0) {
+        result = "    Capture request:\n";
+        write(fd, result.string(), result.size());
+        mCaptureRequest.dump(fd, 2, 6);
+    } else {
+        result = "    Capture request: undefined\n";
+        write(fd, result.string(), result.size());
+    }
+
+    if (mRecordingRequest.entryCount() != 0) {
+        result = "    Recording request:\n";
+        write(fd, result.string(), result.size());
+        mRecordingRequest.dump(fd, 2, 6);
+    } else {
+        result = "    Recording request: undefined\n";
+        write(fd, result.string(), result.size());
+    }
+
+    mFrameProcessor->dump(fd, args);
+
+    result = "  Device dump:\n";
+    write(fd, result.string(), result.size());
+
+    status_t res = mDevice->dump(fd, args);
+    if (res != OK) {
+        result = String8::format("   Error dumping device: %s (%d)",
+                strerror(-res), res);
+        write(fd, result.string(), result.size());
+    }
+
+#undef CASE_APPEND_ENUM
+    return NO_ERROR;
+}
+
+// ICamera interface
+
+void Camera2Client::disconnect() {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return;
+
+    if (mDevice == 0) return;
+
+    stopPreviewL();
+
+    if (mPreviewStreamId != NO_STREAM) {
+        mDevice->deleteStream(mPreviewStreamId);
+        mPreviewStreamId = NO_STREAM;
+    }
+
+    mCaptureProcessor->deleteStream();
+
+    if (mRecordingStreamId != NO_STREAM) {
+        mDevice->deleteStream(mRecordingStreamId);
+        mRecordingStreamId = NO_STREAM;
+    }
+
+    mCallbackProcessor->deleteStream();
+
+    mDevice.clear();
+    SharedParameters::Lock l(mParameters);
+    l.mParameters.state = Parameters::DISCONNECTED;
+
+    CameraService::Client::disconnect();
+}
+
+status_t Camera2Client::connect(const sp<ICameraClient>& client) {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+
+    if (mClientPid != 0 && getCallingPid() != mClientPid) {
+        ALOGE("%s: Camera %d: Connection attempt from pid %d; "
+                "current locked to pid %d", __FUNCTION__,
+                mCameraId, getCallingPid(), mClientPid);
+        return BAD_VALUE;
+    }
+
+    mClientPid = getCallingPid();
+
+    mCameraClient = client;
+    mSharedCameraClient = client;
+
+    SharedParameters::Lock l(mParameters);
+    l.mParameters.state = Parameters::STOPPED;
+
+    return OK;
+}
+
+status_t Camera2Client::lock() {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    ALOGV("%s: Camera %d: Lock call from pid %d; current client pid %d",
+            __FUNCTION__, mCameraId, getCallingPid(), mClientPid);
+
+    if (mClientPid == 0) {
+        mClientPid = getCallingPid();
+        return OK;
+    }
+
+    if (mClientPid != getCallingPid()) {
+        ALOGE("%s: Camera %d: Lock call from pid %d; currently locked to pid %d",
+                __FUNCTION__, mCameraId, getCallingPid(), mClientPid);
+        return EBUSY;
+    }
+
+    return OK;
+}
+
+status_t Camera2Client::unlock() {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    ALOGV("%s: Camera %d: Unlock call from pid %d; current client pid %d",
+            __FUNCTION__, mCameraId, getCallingPid(), mClientPid);
+
+    // TODO: Check for uninterruptable conditions
+
+    if (mClientPid == getCallingPid()) {
+        mClientPid = 0;
+        mCameraClient.clear();
+        mSharedCameraClient.clear();
+        return OK;
+    }
+
+    ALOGE("%s: Camera %d: Unlock call from pid %d; currently locked to pid %d",
+            __FUNCTION__, mCameraId, getCallingPid(), mClientPid);
+    return EBUSY;
+}
+
+status_t Camera2Client::setPreviewDisplay(
+        const sp<Surface>& surface) {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+
+    sp<IBinder> binder;
+    sp<ANativeWindow> window;
+    if (surface != 0) {
+        binder = surface->asBinder();
+        window = surface;
+    }
+
+    return setPreviewWindowL(binder,window);
+}
+
+status_t Camera2Client::setPreviewTexture(
+        const sp<ISurfaceTexture>& surfaceTexture) {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+
+    sp<IBinder> binder;
+    sp<ANativeWindow> window;
+    if (surfaceTexture != 0) {
+        binder = surfaceTexture->asBinder();
+        window = new SurfaceTextureClient(surfaceTexture);
+    }
+    return setPreviewWindowL(binder, window);
+}
+
+status_t Camera2Client::setPreviewWindowL(const sp<IBinder>& binder,
+        sp<ANativeWindow> window) {
+    ATRACE_CALL();
+    status_t res;
+
+    if (binder == mPreviewSurface) {
+        ALOGV("%s: Camera %d: New window is same as old window",
+                __FUNCTION__, mCameraId);
+        return NO_ERROR;
+    }
+
+    SharedParameters::Lock l(mParameters);
+    switch (l.mParameters.state) {
+        case Parameters::DISCONNECTED:
+        case Parameters::RECORD:
+        case Parameters::STILL_CAPTURE:
+        case Parameters::VIDEO_SNAPSHOT:
+            ALOGE("%s: Camera %d: Cannot set preview display while in state %s",
+                    __FUNCTION__, mCameraId,
+                    Parameters::getStateName(l.mParameters.state));
+            return INVALID_OPERATION;
+        case Parameters::STOPPED:
+        case Parameters::WAITING_FOR_PREVIEW_WINDOW:
+            // OK
+            break;
+        case Parameters::PREVIEW:
+            // Already running preview - need to stop and create a new stream
+            // TODO: Optimize this so that we don't wait for old stream to drain
+            // before spinning up new stream
+            mDevice->clearStreamingRequest();
+            l.mParameters.state = Parameters::WAITING_FOR_PREVIEW_WINDOW;
+            break;
+    }
+
+    if (mPreviewStreamId != NO_STREAM) {
+        res = mDevice->waitUntilDrained();
+        if (res != OK) {
+            ALOGE("%s: Error waiting for preview to drain: %s (%d)",
+                    __FUNCTION__, strerror(-res), res);
+            return res;
+        }
+        res = mDevice->deleteStream(mPreviewStreamId);
+        if (res != OK) {
+            ALOGE("%s: Unable to delete old preview stream: %s (%d)",
+                    __FUNCTION__, strerror(-res), res);
+            return res;
+        }
+        mPreviewStreamId = NO_STREAM;
+    }
+
+    mPreviewSurface = binder;
+    mPreviewWindow = window;
+
+    if (l.mParameters.state == Parameters::WAITING_FOR_PREVIEW_WINDOW) {
+        return startPreviewL(l.mParameters, false);
+    }
+
+    return OK;
+}
+
+void Camera2Client::setPreviewCallbackFlag(int flag) {
+    ATRACE_CALL();
+    ALOGV("%s: Camera %d: Flag 0x%x", __FUNCTION__, mCameraId, flag);
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( checkPid(__FUNCTION__) != OK) return;
+
+    SharedParameters::Lock l(mParameters);
+    setPreviewCallbackFlagL(l.mParameters, flag);
+}
+
+void Camera2Client::setPreviewCallbackFlagL(Parameters &params, int flag) {
+    status_t res = OK;
+    if (flag & CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK) {
+        ALOGV("%s: setting oneshot", __FUNCTION__);
+        params.previewCallbackOneShot = true;
+    }
+    if (params.previewCallbackFlags != (uint32_t)flag) {
+        params.previewCallbackFlags = flag;
+        switch(params.state) {
+        case Parameters::PREVIEW:
+            res = startPreviewL(params, true);
+            break;
+        case Parameters::RECORD:
+        case Parameters::VIDEO_SNAPSHOT:
+            res = startRecordingL(params, true);
+            break;
+        default:
+            break;
+        }
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to refresh request in state %s",
+                    __FUNCTION__, mCameraId,
+                    Parameters::getStateName(params.state));
+        }
+    }
+
+}
+
+status_t Camera2Client::startPreview() {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+    SharedParameters::Lock l(mParameters);
+    return startPreviewL(l.mParameters, false);
+}
+
+status_t Camera2Client::startPreviewL(Parameters &params, bool restart) {
+    ATRACE_CALL();
+    status_t res;
+    if (params.state >= Parameters::PREVIEW && !restart) {
+        ALOGE("%s: Can't start preview in state %s",
+                __FUNCTION__,
+                Parameters::getStateName(params.state));
+        return INVALID_OPERATION;
+    }
+
+    if (mPreviewWindow == 0) {
+        params.state = Parameters::WAITING_FOR_PREVIEW_WINDOW;
+        return OK;
+    }
+    params.state = Parameters::STOPPED;
+
+    res = updatePreviewStream(params);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to update preview stream: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+    bool callbacksEnabled = params.previewCallbackFlags &
+        CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK;
+    if (callbacksEnabled) {
+        res = mCallbackProcessor->updateStream(params);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to update callback stream: %s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    if (mPreviewRequest.entryCount() == 0) {
+        res = updatePreviewRequest(params);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to create preview request: %s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    if (callbacksEnabled) {
+        uint8_t outputStreams[2] =
+                { mPreviewStreamId, mCallbackProcessor->getStreamId() };
+        res = mPreviewRequest.update(
+                ANDROID_REQUEST_OUTPUT_STREAMS,
+                outputStreams, 2);
+    } else {
+        uint8_t outputStreams[1] = { mPreviewStreamId };
+        res = mPreviewRequest.update(
+                ANDROID_REQUEST_OUTPUT_STREAMS,
+                outputStreams, 1);
+    }
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to set up preview request: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+    res = mPreviewRequest.sort();
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Error sorting preview request: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+
+    res = mDevice->setStreamingRequest(mPreviewRequest);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to set preview request to start preview: "
+                "%s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+    params.state = Parameters::PREVIEW;
+
+    return OK;
+}
+
+void Camera2Client::stopPreview() {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return;
+    stopPreviewL();
+}
+
+void Camera2Client::stopPreviewL() {
+    ATRACE_CALL();
+    Parameters::State state;
+    {
+        SharedParameters::Lock l(mParameters);
+        state = l.mParameters.state;
+    }
+
+    switch (state) {
+        case Parameters::DISCONNECTED:
+            ALOGE("%s: Camera %d: Call before initialized",
+                    __FUNCTION__, mCameraId);
+            break;
+        case Parameters::STOPPED:
+            break;
+        case Parameters::STILL_CAPTURE:
+            ALOGE("%s: Camera %d: Cannot stop preview during still capture.",
+                    __FUNCTION__, mCameraId);
+            break;
+        case Parameters::RECORD:
+            // no break - identical to preview
+        case Parameters::PREVIEW:
+            mDevice->clearStreamingRequest();
+            mDevice->waitUntilDrained();
+            // no break
+        case Parameters::WAITING_FOR_PREVIEW_WINDOW: {
+            SharedParameters::Lock l(mParameters);
+            l.mParameters.state = Parameters::STOPPED;
+            commandStopFaceDetectionL(l.mParameters);
+            break;
+        }
+        default:
+            ALOGE("%s: Camera %d: Unknown state %d", __FUNCTION__, mCameraId,
+                    state);
+    }
+}
+
+bool Camera2Client::previewEnabled() {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return false;
+
+    SharedParameters::Lock l(mParameters);
+    return l.mParameters.state == Parameters::PREVIEW;
+}
+
+status_t Camera2Client::storeMetaDataInBuffers(bool enabled) {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+
+    SharedParameters::Lock l(mParameters);
+    switch (l.mParameters.state) {
+        case Parameters::RECORD:
+        case Parameters::VIDEO_SNAPSHOT:
+            ALOGE("%s: Camera %d: Can't be called in state %s",
+                    __FUNCTION__, mCameraId,
+                    Parameters::getStateName(l.mParameters.state));
+            return INVALID_OPERATION;
+        default:
+            // OK
+            break;
+    }
+
+    l.mParameters.storeMetadataInBuffers = enabled;
+
+    return OK;
+}
+
+status_t Camera2Client::startRecording() {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+    SharedParameters::Lock l(mParameters);
+
+    return startRecordingL(l.mParameters, false);
+}
+
+status_t Camera2Client::startRecordingL(Parameters &params, bool restart) {
+    status_t res;
+    switch (params.state) {
+        case Parameters::STOPPED:
+            res = startPreviewL(params, false);
+            if (res != OK) return res;
+            break;
+        case Parameters::PREVIEW:
+            // Ready to go
+            break;
+        case Parameters::RECORD:
+        case Parameters::VIDEO_SNAPSHOT:
+            // OK to call this when recording is already on, just skip unless
+            // we're looking to restart
+            if (!restart) return OK;
+            break;
+        default:
+            ALOGE("%s: Camera %d: Can't start recording in state %s",
+                    __FUNCTION__, mCameraId,
+                    Parameters::getStateName(params.state));
+            return INVALID_OPERATION;
+    };
+
+    if (!params.storeMetadataInBuffers) {
+        ALOGE("%s: Camera %d: Recording only supported in metadata mode, but "
+                "non-metadata recording mode requested!", __FUNCTION__,
+                mCameraId);
+        return INVALID_OPERATION;
+    }
+
+    res = updateRecordingStream(params);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to update recording stream: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+    bool callbacksEnabled = params.previewCallbackFlags &
+        CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK;
+    if (callbacksEnabled) {
+        res = mCallbackProcessor->updateStream(params);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to update callback stream: %s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    if (mRecordingRequest.entryCount() == 0) {
+        res = updateRecordingRequest(params);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to create recording request: %s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    if (callbacksEnabled) {
+        uint8_t outputStreams[3] =
+                { mPreviewStreamId, mRecordingStreamId,
+                  mCallbackProcessor->getStreamId() };
+        res = mRecordingRequest.update(
+                ANDROID_REQUEST_OUTPUT_STREAMS,
+                outputStreams, 3);
+    } else {
+        uint8_t outputStreams[2] = { mPreviewStreamId, mRecordingStreamId };
+        res = mRecordingRequest.update(
+                ANDROID_REQUEST_OUTPUT_STREAMS,
+                outputStreams, 2);
+    }
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to set up recording request: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+    res = mRecordingRequest.sort();
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Error sorting recording request: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+
+    res = mDevice->setStreamingRequest(mRecordingRequest);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to set recording request to start "
+                "recording: %s (%d)", __FUNCTION__, mCameraId,
+                strerror(-res), res);
+        return res;
+    }
+    if (params.state < Parameters::RECORD) {
+        params.state = Parameters::RECORD;
+    }
+
+    return OK;
+}
+
+void Camera2Client::stopRecording() {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    SharedParameters::Lock l(mParameters);
+
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return;
+
+    switch (l.mParameters.state) {
+        case Parameters::RECORD:
+            // OK to stop
+            break;
+        case Parameters::STOPPED:
+        case Parameters::PREVIEW:
+        case Parameters::STILL_CAPTURE:
+        case Parameters::VIDEO_SNAPSHOT:
+        default:
+            ALOGE("%s: Camera %d: Can't stop recording in state %s",
+                    __FUNCTION__, mCameraId,
+                    Parameters::getStateName(l.mParameters.state));
+            return;
+    };
+
+    // Back to preview. Since record can only be reached through preview,
+    // all preview stream setup should be up to date.
+    res = mDevice->setStreamingRequest(mPreviewRequest);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to switch back to preview request: "
+                "%s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+        return;
+    }
+
+    // TODO: Should recording heap be freed? Can't do it yet since requests
+    // could still be in flight.
+
+    l.mParameters.state = Parameters::PREVIEW;
+}
+
+bool Camera2Client::recordingEnabled() {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+
+    if ( checkPid(__FUNCTION__) != OK) return false;
+
+    return recordingEnabledL();
+}
+
+bool Camera2Client::recordingEnabledL() {
+    ATRACE_CALL();
+    SharedParameters::Lock l(mParameters);
+
+    return (l.mParameters.state == Parameters::RECORD
+            || l.mParameters.state == Parameters::VIDEO_SNAPSHOT);
+}
+
+void Camera2Client::releaseRecordingFrame(const sp<IMemory>& mem) {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( checkPid(__FUNCTION__) != OK) return;
+
+    SharedParameters::Lock l(mParameters);
+
+    // Make sure this is for the current heap
+    ssize_t offset;
+    size_t size;
+    sp<IMemoryHeap> heap = mem->getMemory(&offset, &size);
+    if (heap->getHeapID() != mRecordingHeap->mHeap->getHeapID()) {
+        ALOGW("%s: Camera %d: Mismatched heap ID, ignoring release "
+                "(got %x, expected %x)", __FUNCTION__, mCameraId,
+                heap->getHeapID(), mRecordingHeap->mHeap->getHeapID());
+        return;
+    }
+    uint8_t *data = (uint8_t*)heap->getBase() + offset;
+    uint32_t type = *(uint32_t*)data;
+    if (type != kMetadataBufferTypeGrallocSource) {
+        ALOGE("%s: Camera %d: Recording frame type invalid (got %x, expected %x)",
+                __FUNCTION__, mCameraId, type, kMetadataBufferTypeGrallocSource);
+        return;
+    }
+
+    // Release the buffer back to the recording queue
+
+    buffer_handle_t imgHandle = *(buffer_handle_t*)(data + 4);
+
+    size_t itemIndex;
+    for (itemIndex = 0; itemIndex < mRecordingBuffers.size(); itemIndex++) {
+        const BufferItemConsumer::BufferItem item = mRecordingBuffers[itemIndex];
+        if (item.mBuf != BufferItemConsumer::INVALID_BUFFER_SLOT &&
+                item.mGraphicBuffer->handle == imgHandle) {
+            break;
+        }
+    }
+    if (itemIndex == mRecordingBuffers.size()) {
+        ALOGE("%s: Camera %d: Can't find buffer_handle_t %p in list of "
+                "outstanding buffers", __FUNCTION__, mCameraId, imgHandle);
+        return;
+    }
+
+    ALOGV("%s: Camera %d: Freeing buffer_handle_t %p", __FUNCTION__, mCameraId,
+            imgHandle);
+
+    res = mRecordingConsumer->releaseBuffer(mRecordingBuffers[itemIndex]);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to free recording frame (buffer_handle_t: %p):"
+                "%s (%d)",
+                __FUNCTION__, mCameraId, imgHandle, strerror(-res), res);
+        return;
+    }
+    mRecordingBuffers.replaceAt(itemIndex);
+
+    mRecordingHeapFree++;
+}
+
+status_t Camera2Client::autoFocus() {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+
+    int triggerId;
+    {
+        SharedParameters::Lock l(mParameters);
+        l.mParameters.currentAfTriggerId = ++l.mParameters.afTriggerCounter;
+        triggerId = l.mParameters.currentAfTriggerId;
+    }
+
+    mDevice->triggerAutofocus(triggerId);
+
+    return OK;
+}
+
+status_t Camera2Client::cancelAutoFocus() {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+
+    int triggerId;
+    {
+        SharedParameters::Lock l(mParameters);
+        triggerId = ++l.mParameters.afTriggerCounter;
+    }
+
+    mDevice->triggerCancelAutofocus(triggerId);
+
+    return OK;
+}
+
+status_t Camera2Client::takePicture(int msgType) {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+
+    SharedParameters::Lock l(mParameters);
+    switch (l.mParameters.state) {
+        case Parameters::DISCONNECTED:
+        case Parameters::STOPPED:
+        case Parameters::WAITING_FOR_PREVIEW_WINDOW:
+            ALOGE("%s: Camera %d: Cannot take picture without preview enabled",
+                    __FUNCTION__, mCameraId);
+            return INVALID_OPERATION;
+        case Parameters::PREVIEW:
+        case Parameters::RECORD:
+            // Good to go for takePicture
+            break;
+        case Parameters::STILL_CAPTURE:
+        case Parameters::VIDEO_SNAPSHOT:
+            ALOGE("%s: Camera %d: Already taking a picture",
+                    __FUNCTION__, mCameraId);
+            return INVALID_OPERATION;
+    }
+
+    ALOGV("%s: Camera %d: Starting picture capture", __FUNCTION__, mCameraId);
+
+    res = mCaptureProcessor->updateStream(l.mParameters);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Can't set up still image stream: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+
+    if (mCaptureRequest.entryCount() == 0) {
+        res = updateCaptureRequest(l.mParameters);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Can't create still image capture request: "
+                    "%s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    bool callbacksEnabled = l.mParameters.previewCallbackFlags &
+            CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK;
+    bool recordingEnabled = (l.mParameters.state == Parameters::RECORD);
+
+    int captureStreamId = mCaptureProcessor->getStreamId();
+
+    int streamSwitch = (callbacksEnabled ? 0x2 : 0x0) +
+            (recordingEnabled ? 0x1 : 0x0);
+    switch ( streamSwitch ) {
+        case 0: { // No recording, callbacks
+            uint8_t streamIds[2] = {
+                mPreviewStreamId,
+                captureStreamId
+            };
+            res = mCaptureRequest.update(ANDROID_REQUEST_OUTPUT_STREAMS,
+                    streamIds, 2);
+            break;
+        }
+        case 1: { // Recording
+            uint8_t streamIds[3] = {
+                mPreviewStreamId,
+                mRecordingStreamId,
+                captureStreamId
+            };
+            res = mCaptureRequest.update(ANDROID_REQUEST_OUTPUT_STREAMS,
+                    streamIds, 3);
+            break;
+        }
+        case 2: { // Callbacks
+            uint8_t streamIds[3] = {
+                mPreviewStreamId,
+                mCallbackProcessor->getStreamId(),
+                captureStreamId
+            };
+            res = mCaptureRequest.update(ANDROID_REQUEST_OUTPUT_STREAMS,
+                    streamIds, 3);
+            break;
+        }
+        case 3: { // Both
+            uint8_t streamIds[4] = {
+                mPreviewStreamId,
+                mCallbackProcessor->getStreamId(),
+                mRecordingStreamId,
+                captureStreamId
+            };
+            res = mCaptureRequest.update(ANDROID_REQUEST_OUTPUT_STREAMS,
+                    streamIds, 4);
+            break;
+        }
+    };
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to set up still image capture request: "
+                "%s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+    res = mCaptureRequest.sort();
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to sort capture request: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+
+    CameraMetadata captureCopy = mCaptureRequest;
+    if (captureCopy.entryCount() == 0) {
+        ALOGE("%s: Camera %d: Unable to copy capture request for HAL device",
+                __FUNCTION__, mCameraId);
+        return NO_MEMORY;
+    }
+
+    if (l.mParameters.state == Parameters::PREVIEW) {
+        res = mDevice->clearStreamingRequest();
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to stop preview for still capture: "
+                    "%s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+    // TODO: Capture should be atomic with setStreamingRequest here
+    res = mDevice->capture(captureCopy);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to submit still image capture request: "
+                "%s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+
+    switch (l.mParameters.state) {
+        case Parameters::PREVIEW:
+            l.mParameters.state = Parameters::STILL_CAPTURE;
+            res = commandStopFaceDetectionL(l.mParameters);
+            if (res != OK) {
+                ALOGE("%s: Camera %d: Unable to stop face detection for still capture",
+                        __FUNCTION__, mCameraId);
+                return res;
+            }
+            break;
+        case Parameters::RECORD:
+            l.mParameters.state = Parameters::VIDEO_SNAPSHOT;
+            break;
+        default:
+            ALOGE("%s: Camera %d: Unknown state for still capture!",
+                    __FUNCTION__, mCameraId);
+            return INVALID_OPERATION;
+    }
+
+    return OK;
+}
+
+status_t Camera2Client::setParameters(const String8& params) {
+    ATRACE_CALL();
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+
+    SharedParameters::Lock l(mParameters);
+
+    res = l.mParameters.set(params);
+    if (res != OK) return res;
+
+    res = updateRequests(l.mParameters);
+
+    return res;
+}
+
+String8 Camera2Client::getParameters() const {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+    if ( checkPid(__FUNCTION__) != OK) return String8();
+
+    SharedParameters::ReadLock l(mParameters);
+
+    // TODO: Deal with focus distances
+    return l.mParameters.paramsFlattened;
+}
+
+status_t Camera2Client::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
+    ATRACE_CALL();
+    Mutex::Autolock icl(mICameraLock);
+    status_t res;
+    if ( (res = checkPid(__FUNCTION__) ) != OK) return res;
+
+    ALOGV("%s: Camera %d: Command %d (%d, %d)", __FUNCTION__, mCameraId,
+            cmd, arg1, arg2);
+
+    switch (cmd) {
+        case CAMERA_CMD_START_SMOOTH_ZOOM:
+            return commandStartSmoothZoomL();
+        case CAMERA_CMD_STOP_SMOOTH_ZOOM:
+            return commandStopSmoothZoomL();
+        case CAMERA_CMD_SET_DISPLAY_ORIENTATION:
+            return commandSetDisplayOrientationL(arg1);
+        case CAMERA_CMD_ENABLE_SHUTTER_SOUND:
+            return commandEnableShutterSoundL(arg1 == 1);
+        case CAMERA_CMD_PLAY_RECORDING_SOUND:
+            return commandPlayRecordingSoundL();
+        case CAMERA_CMD_START_FACE_DETECTION:
+            return commandStartFaceDetectionL(arg1);
+        case CAMERA_CMD_STOP_FACE_DETECTION: {
+            SharedParameters::Lock l(mParameters);
+            return commandStopFaceDetectionL(l.mParameters);
+        }
+        case CAMERA_CMD_ENABLE_FOCUS_MOVE_MSG:
+            return commandEnableFocusMoveMsgL(arg1 == 1);
+        case CAMERA_CMD_PING:
+            return commandPingL();
+        case CAMERA_CMD_SET_VIDEO_BUFFER_COUNT:
+            return commandSetVideoBufferCountL(arg1);
+        default:
+            ALOGE("%s: Unknown command %d (arguments %d, %d)",
+                    __FUNCTION__, cmd, arg1, arg2);
+            return BAD_VALUE;
+    }
+}
+
+status_t Camera2Client::commandStartSmoothZoomL() {
+    ALOGE("%s: Unimplemented!", __FUNCTION__);
+    return OK;
+}
+
+status_t Camera2Client::commandStopSmoothZoomL() {
+    ALOGE("%s: Unimplemented!", __FUNCTION__);
+    return OK;
+}
+
+status_t Camera2Client::commandSetDisplayOrientationL(int degrees) {
+    int transform = Parameters::degToTransform(degrees,
+            mCameraFacing == CAMERA_FACING_FRONT);
+    if (transform == -1) {
+        ALOGE("%s: Camera %d: Error setting %d as display orientation value",
+                __FUNCTION__, mCameraId, degrees);
+        return BAD_VALUE;
+    }
+    SharedParameters::Lock l(mParameters);
+    if (transform != l.mParameters.previewTransform &&
+            mPreviewStreamId != NO_STREAM) {
+        mDevice->setStreamTransform(mPreviewStreamId, transform);
+    }
+    l.mParameters.previewTransform = transform;
+    return OK;
+}
+
+status_t Camera2Client::commandEnableShutterSoundL(bool enable) {
+    SharedParameters::Lock l(mParameters);
+    if (enable) {
+        l.mParameters.playShutterSound = true;
+        return OK;
+    }
+
+    // Disabling shutter sound may not be allowed. In that case only
+    // allow the mediaserver process to disable the sound.
+    char value[PROPERTY_VALUE_MAX];
+    property_get("ro.camera.sound.forced", value, "0");
+    if (strncmp(value, "0", 2) != 0) {
+        // Disabling shutter sound is not allowed. Deny if the current
+        // process is not mediaserver.
+        if (getCallingPid() != getpid()) {
+            ALOGE("Failed to disable shutter sound. Permission denied (pid %d)",
+                    getCallingPid());
+            return PERMISSION_DENIED;
+        }
+    }
+
+    l.mParameters.playShutterSound = false;
+    return OK;
+}
+
+status_t Camera2Client::commandPlayRecordingSoundL() {
+    mCameraService->playSound(CameraService::SOUND_RECORDING);
+    return OK;
+}
+
+status_t Camera2Client::commandStartFaceDetectionL(int type) {
+    ALOGV("%s: Camera %d: Starting face detection",
+          __FUNCTION__, mCameraId);
+    status_t res;
+    SharedParameters::Lock l(mParameters);
+    switch (l.mParameters.state) {
+        case Parameters::DISCONNECTED:
+        case Parameters::STOPPED:
+        case Parameters::WAITING_FOR_PREVIEW_WINDOW:
+        case Parameters::STILL_CAPTURE:
+            ALOGE("%s: Camera %d: Cannot start face detection without preview active",
+                    __FUNCTION__, mCameraId);
+            return INVALID_OPERATION;
+        case Parameters::PREVIEW:
+        case Parameters::RECORD:
+        case Parameters::VIDEO_SNAPSHOT:
+            // Good to go for starting face detect
+            break;
+    }
+    // Ignoring type
+    if (l.mParameters.fastInfo.bestFaceDetectMode ==
+            ANDROID_STATS_FACE_DETECTION_OFF) {
+        ALOGE("%s: Camera %d: Face detection not supported",
+                __FUNCTION__, mCameraId);
+        return INVALID_OPERATION;
+    }
+    if (l.mParameters.enableFaceDetect) return OK;
+
+    l.mParameters.enableFaceDetect = true;
+
+    res = updateRequests(l.mParameters);
+
+    return res;
+}
+
+status_t Camera2Client::commandStopFaceDetectionL(Parameters &params) {
+    status_t res = OK;
+    ALOGV("%s: Camera %d: Stopping face detection",
+          __FUNCTION__, mCameraId);
+
+    if (!params.enableFaceDetect) return OK;
+
+    params.enableFaceDetect = false;
+
+    if (params.state == Parameters::PREVIEW
+            || params.state == Parameters::RECORD
+            || params.state == Parameters::VIDEO_SNAPSHOT) {
+        res = updateRequests(params);
+    }
+
+    return res;
+}
+
+status_t Camera2Client::commandEnableFocusMoveMsgL(bool enable) {
+    SharedParameters::Lock l(mParameters);
+    l.mParameters.enableFocusMoveMessages = enable;
+
+    return OK;
+}
+
+status_t Camera2Client::commandPingL() {
+    // Always ping back if access is proper and device is alive
+    SharedParameters::Lock l(mParameters);
+    if (l.mParameters.state != Parameters::DISCONNECTED) {
+        return OK;
+    } else {
+        return NO_INIT;
+    }
+}
+
+status_t Camera2Client::commandSetVideoBufferCountL(size_t count) {
+    if (recordingEnabledL()) {
+        ALOGE("%s: Camera %d: Error setting video buffer count after "
+                "recording was started", __FUNCTION__, mCameraId);
+        return INVALID_OPERATION;
+    }
+
+    // 32 is the current upper limit on the video buffer count for BufferQueue
+    if (count > 32) {
+        ALOGE("%s: Camera %d: Error setting %d as video buffer count value",
+                __FUNCTION__, mCameraId, count);
+        return BAD_VALUE;
+    }
+
+    // Need to reallocate memory for heap
+    if (mRecordingHeapCount != count) {
+        if  (mRecordingHeap != 0) {
+            mRecordingHeap.clear();
+            mRecordingHeap = NULL;
+        }
+        mRecordingHeapCount = count;
+    }
+
+    return OK;
+}
+
+/** Device-related methods */
+
+void Camera2Client::notifyError(int errorCode, int arg1, int arg2) {
+    ALOGE("Error condition %d reported by HAL, arguments %d, %d", errorCode, arg1, arg2);
+}
+
+void Camera2Client::notifyShutter(int frameNumber, nsecs_t timestamp) {
+    ALOGV("%s: Shutter notification for frame %d at time %lld", __FUNCTION__,
+            frameNumber, timestamp);
+}
+
+void Camera2Client::notifyAutoFocus(uint8_t newState, int triggerId) {
+    ALOGV("%s: Autofocus state now %d, last trigger %d",
+            __FUNCTION__, newState, triggerId);
+    bool sendCompletedMessage = false;
+    bool sendMovingMessage = false;
+
+    bool success = false;
+    bool afInMotion = false;
+    {
+        SharedParameters::Lock l(mParameters);
+        switch (l.mParameters.focusMode) {
+            case Parameters::FOCUS_MODE_AUTO:
+            case Parameters::FOCUS_MODE_MACRO:
+                // Don't send notifications upstream if they're not for the current AF
+                // trigger. For example, if cancel was called in between, or if we
+                // already sent a notification about this AF call.
+                if (triggerId != l.mParameters.currentAfTriggerId) break;
+                switch (newState) {
+                    case ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED:
+                        success = true;
+                        // no break
+                    case ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED:
+                        sendCompletedMessage = true;
+                        l.mParameters.currentAfTriggerId = -1;
+                        break;
+                    case ANDROID_CONTROL_AF_STATE_ACTIVE_SCAN:
+                        // Just starting focusing, ignore
+                        break;
+                    case ANDROID_CONTROL_AF_STATE_INACTIVE:
+                    case ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN:
+                    case ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED:
+                    default:
+                        // Unexpected in AUTO/MACRO mode
+                        ALOGE("%s: Unexpected AF state transition in AUTO/MACRO mode: %d",
+                                __FUNCTION__, newState);
+                        break;
+                }
+                break;
+            case Parameters::FOCUS_MODE_CONTINUOUS_VIDEO:
+            case Parameters::FOCUS_MODE_CONTINUOUS_PICTURE:
+                switch (newState) {
+                    case ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED:
+                        success = true;
+                        // no break
+                    case ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED:
+                        // Don't send notifications upstream if they're not for
+                        // the current AF trigger. For example, if cancel was
+                        // called in between, or if we already sent a
+                        // notification about this AF call.
+                        // Send both a 'AF done' callback and a 'AF move' callback
+                        if (triggerId != l.mParameters.currentAfTriggerId) break;
+                        sendCompletedMessage = true;
+                        afInMotion = false;
+                        if (l.mParameters.enableFocusMoveMessages &&
+                                l.mParameters.afInMotion) {
+                            sendMovingMessage = true;
+                        }
+                        l.mParameters.currentAfTriggerId = -1;
+                        break;
+                    case ANDROID_CONTROL_AF_STATE_INACTIVE:
+                        // Cancel was called, or we switched state; care if
+                        // currently moving
+                        afInMotion = false;
+                        if (l.mParameters.enableFocusMoveMessages &&
+                                l.mParameters.afInMotion) {
+                            sendMovingMessage = true;
+                        }
+                        break;
+                    case ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN:
+                        // Start passive scan, inform upstream
+                        afInMotion = true;
+                        // no break
+                    case ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED:
+                        // Stop passive scan, inform upstream
+                        if (l.mParameters.enableFocusMoveMessages) {
+                            sendMovingMessage = true;
+                        }
+                        break;
+                }
+                l.mParameters.afInMotion = afInMotion;
+                break;
+            case Parameters::FOCUS_MODE_EDOF:
+            case Parameters::FOCUS_MODE_INFINITY:
+            case Parameters::FOCUS_MODE_FIXED:
+            default:
+                if (newState != ANDROID_CONTROL_AF_STATE_INACTIVE) {
+                    ALOGE("%s: Unexpected AF state change %d "
+                            "(ID %d) in focus mode %d",
+                          __FUNCTION__, newState, triggerId,
+                            l.mParameters.focusMode);
+                }
+        }
+    }
+    if (sendMovingMessage) {
+        SharedCameraClient::Lock l(mSharedCameraClient);
+        if (l.mCameraClient != 0) {
+            l.mCameraClient->notifyCallback(CAMERA_MSG_FOCUS_MOVE,
+                    afInMotion ? 1 : 0, 0);
+        }
+    }
+    if (sendCompletedMessage) {
+        SharedCameraClient::Lock l(mSharedCameraClient);
+        if (l.mCameraClient != 0) {
+            l.mCameraClient->notifyCallback(CAMERA_MSG_FOCUS,
+                    success ? 1 : 0, 0);
+        }
+    }
+}
+
+void Camera2Client::notifyAutoExposure(uint8_t newState, int triggerId) {
+    ALOGV("%s: Autoexposure state now %d, last trigger %d",
+            __FUNCTION__, newState, triggerId);
+}
+
+void Camera2Client::notifyAutoWhitebalance(uint8_t newState, int triggerId) {
+    ALOGV("%s: Auto-whitebalance state now %d, last trigger %d",
+            __FUNCTION__, newState, triggerId);
+}
+
+int Camera2Client::getCameraId() {
+    return mCameraId;
+}
+
+const sp<Camera2Device>& Camera2Client::getCameraDevice() {
+    return mDevice;
+}
+
+camera2::SharedParameters& Camera2Client::getParameters() {
+    return mParameters;
+}
+
+Camera2Client::SharedCameraClient::Lock::Lock(SharedCameraClient &client):
+        mCameraClient(client.mCameraClient),
+        mSharedClient(client) {
+    mSharedClient.mCameraClientLock.lock();
+}
+
+Camera2Client::SharedCameraClient::Lock::~Lock() {
+    mSharedClient.mCameraClientLock.unlock();
+}
+
+Camera2Client::SharedCameraClient::SharedCameraClient(const sp<ICameraClient>&client):
+        mCameraClient(client) {
+}
+
+Camera2Client::SharedCameraClient& Camera2Client::SharedCameraClient::operator=(
+        const sp<ICameraClient>&client) {
+    Mutex::Autolock l(mCameraClientLock);
+    mCameraClient = client;
+    return *this;
+}
+
+void Camera2Client::SharedCameraClient::clear() {
+    Mutex::Autolock l(mCameraClientLock);
+    mCameraClient.clear();
+}
+
+void Camera2Client::onRecordingFrameAvailable() {
+    ATRACE_CALL();
+    status_t res;
+    sp<Camera2Heap> recordingHeap;
+    size_t heapIdx = 0;
+    nsecs_t timestamp;
+    {
+        SharedParameters::Lock l(mParameters);
+
+        BufferItemConsumer::BufferItem imgBuffer;
+        res = mRecordingConsumer->acquireBuffer(&imgBuffer);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Error receiving recording buffer: %s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return;
+        }
+        timestamp = imgBuffer.mTimestamp;
+
+        mRecordingFrameCount++;
+        ALOGV("OnRecordingFrame: Frame %d", mRecordingFrameCount);
+
+        // TODO: Signal errors here upstream
+        if (l.mParameters.state != Parameters::RECORD &&
+                l.mParameters.state != Parameters::VIDEO_SNAPSHOT) {
+            ALOGV("%s: Camera %d: Discarding recording image buffers received after "
+                    "recording done",
+                    __FUNCTION__, mCameraId);
+            mRecordingConsumer->releaseBuffer(imgBuffer);
+            return;
+        }
+
+        if (mRecordingHeap == 0) {
+            const size_t bufferSize = 4 + sizeof(buffer_handle_t);
+            ALOGV("%s: Camera %d: Creating recording heap with %d buffers of "
+                    "size %d bytes", __FUNCTION__, mCameraId,
+                    mRecordingHeapCount, bufferSize);
+
+            mRecordingHeap = new Camera2Heap(bufferSize, mRecordingHeapCount,
+                    "Camera2Client::RecordingHeap");
+            if (mRecordingHeap->mHeap->getSize() == 0) {
+                ALOGE("%s: Camera %d: Unable to allocate memory for recording",
+                        __FUNCTION__, mCameraId);
+                mRecordingConsumer->releaseBuffer(imgBuffer);
+                return;
+            }
+            for (size_t i = 0; i < mRecordingBuffers.size(); i++) {
+                if (mRecordingBuffers[i].mBuf !=
+                        BufferItemConsumer::INVALID_BUFFER_SLOT) {
+                    ALOGE("%s: Camera %d: Non-empty recording buffers list!",
+                            __FUNCTION__, mCameraId);
+                }
+            }
+            mRecordingBuffers.clear();
+            mRecordingBuffers.setCapacity(mRecordingHeapCount);
+            mRecordingBuffers.insertAt(0, mRecordingHeapCount);
+
+            mRecordingHeapHead = 0;
+            mRecordingHeapFree = mRecordingHeapCount;
+        }
+
+        if ( mRecordingHeapFree == 0) {
+            ALOGE("%s: Camera %d: No free recording buffers, dropping frame",
+                    __FUNCTION__, mCameraId);
+            mRecordingConsumer->releaseBuffer(imgBuffer);
+            return;
+        }
+
+        heapIdx = mRecordingHeapHead;
+        mRecordingHeapHead = (mRecordingHeapHead + 1) % mRecordingHeapCount;
+        mRecordingHeapFree--;
+
+        ALOGV("%s: Camera %d: Timestamp %lld",
+                __FUNCTION__, mCameraId, timestamp);
+
+        ssize_t offset;
+        size_t size;
+        sp<IMemoryHeap> heap =
+                mRecordingHeap->mBuffers[heapIdx]->getMemory(&offset,
+                        &size);
+
+        uint8_t *data = (uint8_t*)heap->getBase() + offset;
+        uint32_t type = kMetadataBufferTypeGrallocSource;
+        *((uint32_t*)data) = type;
+        *((buffer_handle_t*)(data + 4)) = imgBuffer.mGraphicBuffer->handle;
+        ALOGV("%s: Camera %d: Sending out buffer_handle_t %p",
+                __FUNCTION__, mCameraId, imgBuffer.mGraphicBuffer->handle);
+        mRecordingBuffers.replaceAt(imgBuffer, heapIdx);
+        recordingHeap = mRecordingHeap;
+    }
+
+    // Call outside locked parameters to allow re-entrancy from notification
+    SharedCameraClient::Lock l(mSharedCameraClient);
+    if (l.mCameraClient != 0) {
+        l.mCameraClient->dataCallbackTimestamp(timestamp,
+                CAMERA_MSG_VIDEO_FRAME,
+                recordingHeap->mBuffers[heapIdx]);
+    }
+}
+
+/** Utility methods */
+
+status_t Camera2Client::updateRequests(const Parameters &params) {
+    status_t res;
+
+    res = updatePreviewRequest(params);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to update preview request: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+    res = updateCaptureRequest(params);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to update capture request: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+
+    res = updateRecordingRequest(params);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to update recording request: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+
+    if (params.state == Parameters::PREVIEW) {
+        res = mDevice->setStreamingRequest(mPreviewRequest);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Error streaming new preview request: %s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    } else if (params.state == Parameters::RECORD ||
+            params.state == Parameters::VIDEO_SNAPSHOT) {
+        res = mDevice->setStreamingRequest(mRecordingRequest);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Error streaming new record request: %s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+    return res;
+}
+
+status_t Camera2Client::updatePreviewStream(const Parameters &params) {
+    ATRACE_CALL();
+    status_t res;
+
+    if (mPreviewStreamId != NO_STREAM) {
+        // Check if stream parameters have to change
+        uint32_t currentWidth, currentHeight;
+        res = mDevice->getStreamInfo(mPreviewStreamId,
+                &currentWidth, &currentHeight, 0);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Error querying preview stream info: "
+                    "%s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+        if (currentWidth != (uint32_t)params.previewWidth ||
+                currentHeight != (uint32_t)params.previewHeight) {
+            ALOGV("%s: Camera %d: Preview size switch: %d x %d -> %d x %d",
+                    __FUNCTION__, mCameraId, currentWidth, currentHeight,
+                    params.previewWidth, params.previewHeight);
+            res = mDevice->waitUntilDrained();
+            if (res != OK) {
+                ALOGE("%s: Camera %d: Error waiting for preview to drain: "
+                        "%s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+                return res;
+            }
+            res = mDevice->deleteStream(mPreviewStreamId);
+            if (res != OK) {
+                ALOGE("%s: Camera %d: Unable to delete old output stream "
+                        "for preview: %s (%d)", __FUNCTION__, mCameraId,
+                        strerror(-res), res);
+                return res;
+            }
+            mPreviewStreamId = NO_STREAM;
+        }
+    }
+
+    if (mPreviewStreamId == NO_STREAM) {
+        res = mDevice->createStream(mPreviewWindow,
+                params.previewWidth, params.previewHeight,
+                CAMERA2_HAL_PIXEL_FORMAT_OPAQUE, 0,
+                &mPreviewStreamId);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to create preview stream: %s (%d)",
+                    __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    res = mDevice->setStreamTransform(mPreviewStreamId,
+            params.previewTransform);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to set preview stream transform: "
+                "%s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+        return res;
+    }
+
+    return OK;
+}
+
+status_t Camera2Client::updatePreviewRequest(const Parameters &params) {
+    ATRACE_CALL();
+    status_t res;
+    if (mPreviewRequest.entryCount() == 0) {
+        res = mDevice->createDefaultRequest(CAMERA2_TEMPLATE_PREVIEW,
+                &mPreviewRequest);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to create default preview request: "
+                    "%s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    res = updateRequestCommon(&mPreviewRequest, params);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to update common entries of preview "
+                "request: %s (%d)", __FUNCTION__, mCameraId,
+                strerror(-res), res);
+        return res;
+    }
+
+    return OK;
+}
+
+status_t Camera2Client::updateCaptureRequest(const Parameters &params) {
+    ATRACE_CALL();
+    status_t res;
+    if (mCaptureRequest.entryCount() == 0) {
+        res = mDevice->createDefaultRequest(CAMERA2_TEMPLATE_STILL_CAPTURE,
+                &mCaptureRequest);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to create default still image request:"
+                    " %s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    res = updateRequestCommon(&mCaptureRequest, params);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to update common entries of capture "
+                "request: %s (%d)", __FUNCTION__, mCameraId,
+                strerror(-res), res);
+        return res;
+    }
+
+    res = mCaptureRequest.update(ANDROID_JPEG_THUMBNAIL_SIZE,
+            params.jpegThumbSize, 2);
+    if (res != OK) return res;
+    res = mCaptureRequest.update(ANDROID_JPEG_THUMBNAIL_QUALITY,
+            &params.jpegThumbQuality, 1);
+    if (res != OK) return res;
+    res = mCaptureRequest.update(ANDROID_JPEG_QUALITY,
+            &params.jpegQuality, 1);
+    if (res != OK) return res;
+    res = mCaptureRequest.update(
+            ANDROID_JPEG_ORIENTATION,
+            &params.jpegRotation, 1);
+    if (res != OK) return res;
+
+    if (params.gpsEnabled) {
+        res = mCaptureRequest.update(
+                ANDROID_JPEG_GPS_COORDINATES,
+                params.gpsCoordinates, 3);
+        if (res != OK) return res;
+        res = mCaptureRequest.update(
+                ANDROID_JPEG_GPS_TIMESTAMP,
+                &params.gpsTimestamp, 1);
+        if (res != OK) return res;
+        res = mCaptureRequest.update(
+                ANDROID_JPEG_GPS_PROCESSING_METHOD,
+                params.gpsProcessingMethod);
+        if (res != OK) return res;
+    } else {
+        res = mCaptureRequest.erase(ANDROID_JPEG_GPS_COORDINATES);
+        if (res != OK) return res;
+        res = mCaptureRequest.erase(ANDROID_JPEG_GPS_TIMESTAMP);
+        if (res != OK) return res;
+        res = mCaptureRequest.erase(ANDROID_JPEG_GPS_PROCESSING_METHOD);
+        if (res != OK) return res;
+    }
+
+    return OK;
+}
+
+status_t Camera2Client::updateRecordingRequest(const Parameters &params) {
+    ATRACE_CALL();
+    status_t res;
+    if (mRecordingRequest.entryCount() == 0) {
+        res = mDevice->createDefaultRequest(CAMERA2_TEMPLATE_VIDEO_RECORD,
+                &mRecordingRequest);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Unable to create default recording request:"
+                    " %s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    res = updateRequestCommon(&mRecordingRequest, params);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to update common entries of recording "
+                "request: %s (%d)", __FUNCTION__, mCameraId,
+                strerror(-res), res);
+        return res;
+    }
+
+    return OK;
+}
+
+status_t Camera2Client::updateRecordingStream(const Parameters &params) {
+    status_t res;
+
+    if (mRecordingConsumer == 0) {
+        // Create CPU buffer queue endpoint. We need one more buffer here so that we can
+        // always acquire and free a buffer when the heap is full; otherwise the consumer
+        // will have buffers in flight we'll never clear out.
+        mRecordingConsumer = new BufferItemConsumer(
+                GRALLOC_USAGE_HW_VIDEO_ENCODER,
+                mRecordingHeapCount + 1,
+                true);
+        mRecordingConsumer->setFrameAvailableListener(new RecordingWaiter(this));
+        mRecordingConsumer->setName(String8("Camera2Client::RecordingConsumer"));
+        mRecordingWindow = new SurfaceTextureClient(
+            mRecordingConsumer->getProducerInterface());
+        // Allocate memory later, since we don't know buffer size until receipt
+    }
+
+    if (mRecordingStreamId != NO_STREAM) {
+        // Check if stream parameters have to change
+        uint32_t currentWidth, currentHeight;
+        res = mDevice->getStreamInfo(mRecordingStreamId,
+                &currentWidth, &currentHeight, 0);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Error querying recording output stream info: "
+                    "%s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+        if (currentWidth != (uint32_t)params.videoWidth ||
+                currentHeight != (uint32_t)params.videoHeight) {
+            // TODO: Should wait to be sure previous recording has finished
+            res = mDevice->deleteStream(mRecordingStreamId);
+            if (res != OK) {
+                ALOGE("%s: Camera %d: Unable to delete old output stream "
+                        "for recording: %s (%d)", __FUNCTION__, mCameraId,
+                        strerror(-res), res);
+                return res;
+            }
+            mRecordingStreamId = NO_STREAM;
+        }
+    }
+
+    if (mRecordingStreamId == NO_STREAM) {
+        mRecordingFrameCount = 0;
+        res = mDevice->createStream(mRecordingWindow,
+                params.videoWidth, params.videoHeight,
+                CAMERA2_HAL_PIXEL_FORMAT_OPAQUE, 0, &mRecordingStreamId);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Can't create output stream for recording: "
+                    "%s (%d)", __FUNCTION__, mCameraId, strerror(-res), res);
+            return res;
+        }
+    }
+
+    return OK;
+}
+
+status_t Camera2Client::updateRequestCommon(CameraMetadata *request,
+        const Parameters &params) const {
+    ATRACE_CALL();
+    status_t res;
+    res = request->update(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
+            params.previewFpsRange, 2);
+    if (res != OK) return res;
+
+    uint8_t wbMode = params.autoWhiteBalanceLock ?
+            (uint8_t)ANDROID_CONTROL_AWB_LOCKED : params.wbMode;
+    res = request->update(ANDROID_CONTROL_AWB_MODE,
+            &wbMode, 1);
+    if (res != OK) return res;
+    res = request->update(ANDROID_CONTROL_EFFECT_MODE,
+            &params.effectMode, 1);
+    if (res != OK) return res;
+    res = request->update(ANDROID_CONTROL_AE_ANTIBANDING_MODE,
+            &params.antibandingMode, 1);
+    if (res != OK) return res;
+
+    uint8_t controlMode =
+            (params.sceneMode == ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED) ?
+            ANDROID_CONTROL_AUTO : ANDROID_CONTROL_USE_SCENE_MODE;
+    res = request->update(ANDROID_CONTROL_MODE,
+            &controlMode, 1);
+    if (res != OK) return res;
+    if (controlMode == ANDROID_CONTROL_USE_SCENE_MODE) {
+        res = request->update(ANDROID_CONTROL_SCENE_MODE,
+                &params.sceneMode, 1);
+        if (res != OK) return res;
+    }
+
+    uint8_t flashMode = ANDROID_FLASH_OFF;
+    uint8_t aeMode;
+    switch (params.flashMode) {
+        case Parameters::FLASH_MODE_OFF:
+            aeMode = ANDROID_CONTROL_AE_ON; break;
+        case Parameters::FLASH_MODE_AUTO:
+            aeMode = ANDROID_CONTROL_AE_ON_AUTO_FLASH; break;
+        case Parameters::FLASH_MODE_ON:
+            aeMode = ANDROID_CONTROL_AE_ON_ALWAYS_FLASH; break;
+        case Parameters::FLASH_MODE_TORCH:
+            aeMode = ANDROID_CONTROL_AE_ON;
+            flashMode = ANDROID_FLASH_TORCH;
+            break;
+        case Parameters::FLASH_MODE_RED_EYE:
+            aeMode = ANDROID_CONTROL_AE_ON_AUTO_FLASH_REDEYE; break;
+        default:
+            ALOGE("%s: Camera %d: Unknown flash mode %d", __FUNCTION__,
+                    mCameraId, params.flashMode);
+            return BAD_VALUE;
+    }
+    if (params.autoExposureLock) aeMode = ANDROID_CONTROL_AE_LOCKED;
+
+    res = request->update(ANDROID_FLASH_MODE,
+            &flashMode, 1);
+    if (res != OK) return res;
+    res = request->update(ANDROID_CONTROL_AE_MODE,
+            &aeMode, 1);
+    if (res != OK) return res;
+
+    float focusDistance = 0; // infinity focus in diopters
+    uint8_t focusMode;
+    switch (params.focusMode) {
+        case Parameters::FOCUS_MODE_AUTO:
+        case Parameters::FOCUS_MODE_MACRO:
+        case Parameters::FOCUS_MODE_CONTINUOUS_VIDEO:
+        case Parameters::FOCUS_MODE_CONTINUOUS_PICTURE:
+        case Parameters::FOCUS_MODE_EDOF:
+            focusMode = params.focusMode;
+            break;
+        case Parameters::FOCUS_MODE_INFINITY:
+        case Parameters::FOCUS_MODE_FIXED:
+            focusMode = ANDROID_CONTROL_AF_OFF;
+            break;
+        default:
+            ALOGE("%s: Camera %d: Unknown focus mode %d", __FUNCTION__,
+                    mCameraId, params.focusMode);
+            return BAD_VALUE;
+    }
+    res = request->update(ANDROID_LENS_FOCUS_DISTANCE,
+            &focusDistance, 1);
+    if (res != OK) return res;
+    res = request->update(ANDROID_CONTROL_AF_MODE,
+            &focusMode, 1);
+    if (res != OK) return res;
+
+    size_t focusingAreasSize = params.focusingAreas.size() * 5;
+    int32_t *focusingAreas = new int32_t[focusingAreasSize];
+    for (size_t i = 0; i < focusingAreasSize; i += 5) {
+        if (params.focusingAreas[i].weight != 0) {
+            focusingAreas[i + 0] =
+                    params.normalizedXToArray(params.focusingAreas[i].left);
+            focusingAreas[i + 1] =
+                    params.normalizedYToArray(params.focusingAreas[i].top);
+            focusingAreas[i + 2] =
+                    params.normalizedXToArray(params.focusingAreas[i].right);
+            focusingAreas[i + 3] =
+                    params.normalizedYToArray(params.focusingAreas[i].bottom);
+        } else {
+            focusingAreas[i + 0] = 0;
+            focusingAreas[i + 1] = 0;
+            focusingAreas[i + 2] = 0;
+            focusingAreas[i + 3] = 0;
+        }
+        focusingAreas[i + 4] = params.focusingAreas[i].weight;
+    }
+    res = request->update(ANDROID_CONTROL_AF_REGIONS,
+            focusingAreas,focusingAreasSize);
+    if (res != OK) return res;
+    delete[] focusingAreas;
+
+    res = request->update(ANDROID_CONTROL_AE_EXP_COMPENSATION,
+            &params.exposureCompensation, 1);
+    if (res != OK) return res;
+
+    size_t meteringAreasSize = params.meteringAreas.size() * 5;
+    int32_t *meteringAreas = new int32_t[meteringAreasSize];
+    for (size_t i = 0; i < meteringAreasSize; i += 5) {
+        if (params.meteringAreas[i].weight != 0) {
+            meteringAreas[i + 0] =
+                params.normalizedXToArray(params.meteringAreas[i].left);
+            meteringAreas[i + 1] =
+                params.normalizedYToArray(params.meteringAreas[i].top);
+            meteringAreas[i + 2] =
+                params.normalizedXToArray(params.meteringAreas[i].right);
+            meteringAreas[i + 3] =
+                params.normalizedYToArray(params.meteringAreas[i].bottom);
+        } else {
+            meteringAreas[i + 0] = 0;
+            meteringAreas[i + 1] = 0;
+            meteringAreas[i + 2] = 0;
+            meteringAreas[i + 3] = 0;
+        }
+        meteringAreas[i + 4] = params.meteringAreas[i].weight;
+    }
+    res = request->update(ANDROID_CONTROL_AE_REGIONS,
+            meteringAreas, meteringAreasSize);
+    if (res != OK) return res;
+
+    res = request->update(ANDROID_CONTROL_AWB_REGIONS,
+            meteringAreas, meteringAreasSize);
+    if (res != OK) return res;
+    delete[] meteringAreas;
+
+    // Need to convert zoom index into a crop rectangle. The rectangle is
+    // chosen to maximize its area on the sensor
+
+    camera_metadata_ro_entry_t maxDigitalZoom =
+            mParameters.staticInfo(ANDROID_SCALER_AVAILABLE_MAX_ZOOM);
+    float zoomIncrement = (maxDigitalZoom.data.f[0] - 1) /
+            (params.NUM_ZOOM_STEPS-1);
+    float zoomRatio = 1 + zoomIncrement * params.zoom;
+
+    float zoomLeft, zoomTop, zoomWidth, zoomHeight;
+    if (params.previewWidth >= params.previewHeight) {
+        zoomWidth =  params.fastInfo.arrayWidth / zoomRatio;
+        zoomHeight = zoomWidth *
+                params.previewHeight / params.previewWidth;
+    } else {
+        zoomHeight = params.fastInfo.arrayHeight / zoomRatio;
+        zoomWidth = zoomHeight *
+                params.previewWidth / params.previewHeight;
+    }
+    zoomLeft = (params.fastInfo.arrayWidth - zoomWidth) / 2;
+    zoomTop = (params.fastInfo.arrayHeight - zoomHeight) / 2;
+
+    int32_t cropRegion[3] = { zoomLeft, zoomTop, zoomWidth };
+    res = request->update(ANDROID_SCALER_CROP_REGION,
+            cropRegion, 3);
+    if (res != OK) return res;
+
+    // TODO: Decide how to map recordingHint, or whether just to ignore it
+
+    uint8_t vstabMode = params.videoStabilization ?
+            ANDROID_CONTROL_VIDEO_STABILIZATION_ON :
+            ANDROID_CONTROL_VIDEO_STABILIZATION_OFF;
+    res = request->update(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE,
+            &vstabMode, 1);
+    if (res != OK) return res;
+
+    uint8_t faceDetectMode = params.enableFaceDetect ?
+            params.fastInfo.bestFaceDetectMode :
+            (uint8_t)ANDROID_STATS_FACE_DETECTION_OFF;
+    res = request->update(ANDROID_STATS_FACE_DETECT_MODE,
+            &faceDetectMode, 1);
+    if (res != OK) return res;
+
+    return OK;
+}
+
+size_t Camera2Client::calculateBufferSize(int width, int height,
+        int format, int stride) {
+    switch (format) {
+        case HAL_PIXEL_FORMAT_YCbCr_422_SP: // NV16
+            return width * height * 2;
+        case HAL_PIXEL_FORMAT_YCrCb_420_SP: // NV21
+            return width * height * 3 / 2;
+        case HAL_PIXEL_FORMAT_YCbCr_422_I: // YUY2
+            return width * height * 2;
+        case HAL_PIXEL_FORMAT_YV12: {      // YV12
+            size_t ySize = stride * height;
+            size_t uvStride = (stride / 2 + 0xF) & ~0xF;
+            size_t uvSize = uvStride * height / 2;
+            return ySize + uvSize * 2;
+        }
+        case HAL_PIXEL_FORMAT_RGB_565:
+            return width * height * 2;
+        case HAL_PIXEL_FORMAT_RGBA_8888:
+            return width * height * 4;
+        case HAL_PIXEL_FORMAT_RAW_SENSOR:
+            return width * height * 2;
+        default:
+            ALOGE("%s: Unknown preview format: %x",
+                    __FUNCTION__,  format);
+            return 0;
+    }
+}
+
+} // namespace android
diff --git a/services/camera/libcameraservice/Camera2Client.h b/services/camera/libcameraservice/Camera2Client.h
new file mode 100644
index 0000000..b2fd636
--- /dev/null
+++ b/services/camera/libcameraservice/Camera2Client.h
@@ -0,0 +1,247 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_H
+#define ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_H
+
+#include "Camera2Device.h"
+#include "CameraService.h"
+#include "camera2/Parameters.h"
+#include "camera2/FrameProcessor.h"
+#include "camera2/CaptureProcessor.h"
+#include "camera2/CallbackProcessor.h"
+#include <binder/MemoryBase.h>
+#include <binder/MemoryHeapBase.h>
+#include <gui/CpuConsumer.h>
+#include <gui/BufferItemConsumer.h>
+
+namespace android {
+
+/**
+ * Implements the android.hardware.camera API on top of
+ * camera device HAL version 2.
+ */
+class Camera2Client :
+        public CameraService::Client,
+        public Camera2Device::NotificationListener
+{
+public:
+    /**
+     * ICamera interface (see ICamera for details)
+     */
+
+    virtual void            disconnect();
+    virtual status_t        connect(const sp<ICameraClient>& client);
+    virtual status_t        lock();
+    virtual status_t        unlock();
+    virtual status_t        setPreviewDisplay(const sp<Surface>& surface);
+    virtual status_t        setPreviewTexture(
+        const sp<ISurfaceTexture>& surfaceTexture);
+    virtual void            setPreviewCallbackFlag(int flag);
+    virtual status_t        startPreview();
+    virtual void            stopPreview();
+    virtual bool            previewEnabled();
+    virtual status_t        storeMetaDataInBuffers(bool enabled);
+    virtual status_t        startRecording();
+    virtual void            stopRecording();
+    virtual bool            recordingEnabled();
+    virtual void            releaseRecordingFrame(const sp<IMemory>& mem);
+    virtual status_t        autoFocus();
+    virtual status_t        cancelAutoFocus();
+    virtual status_t        takePicture(int msgType);
+    virtual status_t        setParameters(const String8& params);
+    virtual String8         getParameters() const;
+    virtual status_t        sendCommand(int32_t cmd, int32_t arg1, int32_t arg2);
+
+    /**
+     * Interface used by CameraService
+     */
+
+    Camera2Client(const sp<CameraService>& cameraService,
+            const sp<ICameraClient>& cameraClient,
+            int cameraId,
+            int cameraFacing,
+            int clientPid);
+    virtual ~Camera2Client();
+
+    status_t initialize(camera_module_t *module);
+
+    virtual status_t dump(int fd, const Vector<String16>& args);
+
+    /**
+     * Interface used by Camera2Device
+     */
+
+    virtual void notifyError(int errorCode, int arg1, int arg2);
+    virtual void notifyShutter(int frameNumber, nsecs_t timestamp);
+    virtual void notifyAutoFocus(uint8_t newState, int triggerId);
+    virtual void notifyAutoExposure(uint8_t newState, int triggerId);
+    virtual void notifyAutoWhitebalance(uint8_t newState, int triggerId);
+
+    /**
+     * Interface used by independent components of Camera2Client.
+     */
+
+    int getCameraId();
+    const sp<Camera2Device>& getCameraDevice();
+    camera2::SharedParameters& getParameters();
+
+    // Simple class to ensure that access to ICameraClient is serialized by
+    // requiring mCameraClientLock to be locked before access to mCameraClient
+    // is possible.
+    class SharedCameraClient {
+      public:
+        class Lock {
+          public:
+            Lock(SharedCameraClient &client);
+            ~Lock();
+            sp<ICameraClient> &mCameraClient;
+          private:
+            SharedCameraClient &mSharedClient;
+        };
+        SharedCameraClient(const sp<ICameraClient>& client);
+        SharedCameraClient& operator=(const sp<ICameraClient>& client);
+        void clear();
+      private:
+        sp<ICameraClient> mCameraClient;
+        mutable Mutex mCameraClientLock;
+    } mSharedCameraClient;
+
+    static size_t calculateBufferSize(int width, int height,
+            int format, int stride);
+
+private:
+    /** ICamera interface-related private members */
+
+    // Mutex that must be locked by methods implementing the ICamera interface.
+    // Ensures serialization between incoming ICamera calls. All methods below
+    // that append 'L' to the name assume that mICameraLock is locked when
+    // they're called
+    mutable Mutex mICameraLock;
+
+    typedef camera2::Parameters Parameters;
+    typedef camera2::CameraMetadata CameraMetadata;
+
+    status_t setPreviewWindowL(const sp<IBinder>& binder,
+            sp<ANativeWindow> window);
+    status_t startPreviewL(Parameters &params, bool restart);
+    void     stopPreviewL();
+    status_t startRecordingL(Parameters &params, bool restart);
+    bool     recordingEnabledL();
+
+    // Individual commands for sendCommand()
+    status_t commandStartSmoothZoomL();
+    status_t commandStopSmoothZoomL();
+    status_t commandSetDisplayOrientationL(int degrees);
+    status_t commandEnableShutterSoundL(bool enable);
+    status_t commandPlayRecordingSoundL();
+    status_t commandStartFaceDetectionL(int type);
+    status_t commandStopFaceDetectionL(Parameters &params);
+    status_t commandEnableFocusMoveMsgL(bool enable);
+    status_t commandPingL();
+    status_t commandSetVideoBufferCountL(size_t count);
+
+    // Current camera device configuration
+    camera2::SharedParameters mParameters;
+
+    /** Camera device-related private members */
+
+    void     setPreviewCallbackFlagL(Parameters &params, int flag);
+    status_t updateRequests(const Parameters &params);
+
+    // Used with stream IDs
+    static const int NO_STREAM = -1;
+
+    sp<camera2::FrameProcessor> mFrameProcessor;
+
+    /* Preview related members */
+
+    int mPreviewStreamId;
+    CameraMetadata mPreviewRequest;
+    sp<IBinder> mPreviewSurface;
+    sp<ANativeWindow> mPreviewWindow;
+
+    status_t updatePreviewRequest(const Parameters &params);
+    status_t updatePreviewStream(const Parameters &params);
+
+    /** Preview callback related members */
+
+    sp<camera2::CallbackProcessor> mCallbackProcessor;
+
+    /* Still image capture related members */
+
+    sp<camera2::CaptureProcessor> mCaptureProcessor;
+    CameraMetadata mCaptureRequest;
+    status_t updateCaptureRequest(const Parameters &params);
+
+    /* Recording related members */
+
+    int mRecordingStreamId;
+    int mRecordingFrameCount;
+    sp<BufferItemConsumer>    mRecordingConsumer;
+    sp<ANativeWindow>  mRecordingWindow;
+    // Simple listener that forwards frame available notifications from
+    // a CPU consumer to the recording notification
+    class RecordingWaiter: public BufferItemConsumer::FrameAvailableListener {
+      public:
+        RecordingWaiter(Camera2Client *parent) : mParent(parent) {}
+        void onFrameAvailable() { mParent->onRecordingFrameAvailable(); }
+      private:
+        Camera2Client *mParent;
+    };
+    sp<RecordingWaiter>  mRecordingWaiter;
+    CameraMetadata mRecordingRequest;
+    sp<camera2::Camera2Heap> mRecordingHeap;
+
+    static const size_t kDefaultRecordingHeapCount = 8;
+    size_t mRecordingHeapCount;
+    Vector<BufferItemConsumer::BufferItem> mRecordingBuffers;
+    size_t mRecordingHeapHead, mRecordingHeapFree;
+    // Handle new recording image buffers
+    void onRecordingFrameAvailable();
+
+    status_t updateRecordingRequest(const Parameters &params);
+    status_t updateRecordingStream(const Parameters &params);
+
+    /** Notification-related members */
+
+    bool mAfInMotion;
+
+    /** Camera2Device instance wrapping HAL2 entry */
+
+    sp<Camera2Device> mDevice;
+
+    /** Utility members */
+
+    // Verify that caller is the owner of the camera
+    status_t checkPid(const char *checkLocation) const;
+
+    // Update parameters all requests use, based on mParameters
+    status_t updateRequestCommon(CameraMetadata *request, const Parameters &params) const;
+
+    // Map from sensor active array pixel coordinates to normalized camera
+    // parameter coordinates. The former are (0,0)-(array width - 1, array height
+    // - 1), the latter from (-1000,-1000)-(1000,1000)
+    int normalizedXToArray(int x) const;
+    int normalizedYToArray(int y) const;
+    int arrayXToNormalized(int width) const;
+    int arrayYToNormalized(int height) const;
+
+};
+
+}; // namespace android
+
+#endif
diff --git a/services/camera/libcameraservice/Camera2Device.cpp b/services/camera/libcameraservice/Camera2Device.cpp
new file mode 100644
index 0000000..7cac025
--- /dev/null
+++ b/services/camera/libcameraservice/Camera2Device.cpp
@@ -0,0 +1,1093 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Camera2Device"
+//#define LOG_NDEBUG 0
+//#define LOG_NNDEBUG 0  // Per-frame verbose logging
+
+#ifdef LOG_NNDEBUG
+#define ALOGVV(...) ALOGV(__VA_ARGS__)
+#else
+#define ALOGVV(...) ((void)0)
+#endif
+
+#include <utils/Log.h>
+#include "Camera2Device.h"
+
+namespace android {
+
+Camera2Device::Camera2Device(int id):
+        mId(id),
+        mDevice(NULL)
+{
+    ALOGV("%s: Created device for camera %d", __FUNCTION__, id);
+}
+
+Camera2Device::~Camera2Device()
+{
+    ALOGV("%s: Shutting down device for camera %d", __FUNCTION__, mId);
+    if (mDevice) {
+        status_t res;
+        res = mDevice->common.close(&mDevice->common);
+        if (res != OK) {
+            ALOGE("%s: Could not close camera %d: %s (%d)",
+                    __FUNCTION__,
+                    mId, strerror(-res), res);
+        }
+        mDevice = NULL;
+    }
+    ALOGV("%s: Shutdown complete", __FUNCTION__);
+}
+
+status_t Camera2Device::initialize(camera_module_t *module)
+{
+    ALOGV("%s: Initializing device for camera %d", __FUNCTION__, mId);
+
+    status_t res;
+    char name[10];
+    snprintf(name, sizeof(name), "%d", mId);
+
+    res = module->common.methods->open(&module->common, name,
+            reinterpret_cast<hw_device_t**>(&mDevice));
+
+    if (res != OK) {
+        ALOGE("%s: Could not open camera %d: %s (%d)", __FUNCTION__,
+                mId, strerror(-res), res);
+        return res;
+    }
+
+    if (mDevice->common.version != CAMERA_DEVICE_API_VERSION_2_0) {
+        ALOGE("%s: Could not open camera %d: "
+                "Camera device is not version %x, reports %x instead",
+                __FUNCTION__, mId, CAMERA_DEVICE_API_VERSION_2_0,
+                mDevice->common.version);
+        return BAD_VALUE;
+    }
+
+    camera_info info;
+    res = module->get_camera_info(mId, &info);
+    if (res != OK ) return res;
+
+    if (info.device_version != mDevice->common.version) {
+        ALOGE("%s: HAL reporting mismatched camera_info version (%x)"
+                " and device version (%x).", __FUNCTION__,
+                mDevice->common.version, info.device_version);
+        return BAD_VALUE;
+    }
+
+    mDeviceInfo = info.static_camera_characteristics;
+
+    res = mRequestQueue.setConsumerDevice(mDevice);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to connect request queue to device: %s (%d)",
+                __FUNCTION__, mId, strerror(-res), res);
+        return res;
+    }
+    res = mFrameQueue.setProducerDevice(mDevice);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to connect frame queue to device: %s (%d)",
+                __FUNCTION__, mId, strerror(-res), res);
+        return res;
+    }
+
+    res = mDevice->ops->get_metadata_vendor_tag_ops(mDevice, &mVendorTagOps);
+    if (res != OK ) {
+        ALOGE("%s: Camera %d: Unable to retrieve tag ops from device: %s (%d)",
+                __FUNCTION__, mId, strerror(-res), res);
+        return res;
+    }
+
+    setNotifyCallback(NULL);
+
+    return OK;
+}
+
+status_t Camera2Device::dump(int fd, const Vector<String16>& args) {
+
+    String8 result;
+    int detailLevel = 0;
+    int n = args.size();
+    String16 detailOption("-d");
+    for (int i = 0; i + 1 < n; i++) {
+        if (args[i] == detailOption) {
+            String8 levelStr(args[i+1]);
+            detailLevel = atoi(levelStr.string());
+        }
+    }
+
+    result.appendFormat("  Camera2Device[%d] dump (detail level %d):\n",
+            mId, detailLevel);
+
+    if (detailLevel > 0) {
+        result = "    Request queue contents:\n";
+        write(fd, result.string(), result.size());
+        mRequestQueue.dump(fd, args);
+
+        result = "    Frame queue contents:\n";
+        write(fd, result.string(), result.size());
+        mFrameQueue.dump(fd, args);
+    }
+
+    result = "    Active streams:\n";
+    write(fd, result.string(), result.size());
+    for (StreamList::iterator s = mStreams.begin(); s != mStreams.end(); s++) {
+        (*s)->dump(fd, args);
+    }
+
+    result = "    HAL device dump:\n";
+    write(fd, result.string(), result.size());
+
+    status_t res;
+    res = mDevice->ops->dump(mDevice, fd);
+
+    return res;
+}
+
+const camera2::CameraMetadata& Camera2Device::info() const {
+    ALOGVV("%s: E", __FUNCTION__);
+
+    return mDeviceInfo;
+}
+
+status_t Camera2Device::capture(CameraMetadata &request) {
+    ALOGV("%s: E", __FUNCTION__);
+
+    mRequestQueue.enqueue(request.release());
+    return OK;
+}
+
+
+status_t Camera2Device::setStreamingRequest(const CameraMetadata &request) {
+    ALOGV("%s: E", __FUNCTION__);
+    CameraMetadata streamRequest(request);
+    return mRequestQueue.setStreamSlot(streamRequest.release());
+}
+
+status_t Camera2Device::clearStreamingRequest() {
+    return mRequestQueue.setStreamSlot(NULL);
+}
+
+status_t Camera2Device::createStream(sp<ANativeWindow> consumer,
+        uint32_t width, uint32_t height, int format, size_t size, int *id) {
+    status_t res;
+    ALOGV("%s: E", __FUNCTION__);
+
+    sp<StreamAdapter> stream = new StreamAdapter(mDevice);
+
+    res = stream->connectToDevice(consumer, width, height, format, size);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: Unable to create stream (%d x %d, format %x):"
+                "%s (%d)",
+                __FUNCTION__, mId, width, height, format, strerror(-res), res);
+        return res;
+    }
+
+    *id = stream->getId();
+
+    mStreams.push_back(stream);
+    return OK;
+}
+
+status_t Camera2Device::getStreamInfo(int id,
+        uint32_t *width, uint32_t *height, uint32_t *format) {
+    ALOGV("%s: E", __FUNCTION__);
+    bool found = false;
+    StreamList::iterator streamI;
+    for (streamI = mStreams.begin();
+         streamI != mStreams.end(); streamI++) {
+        if ((*streamI)->getId() == id) {
+            found = true;
+            break;
+        }
+    }
+    if (!found) {
+        ALOGE("%s: Camera %d: Stream %d does not exist",
+                __FUNCTION__, mId, id);
+        return BAD_VALUE;
+    }
+
+    if (width) *width = (*streamI)->getWidth();
+    if (height) *height = (*streamI)->getHeight();
+    if (format) *format = (*streamI)->getFormat();
+
+    return OK;
+}
+
+status_t Camera2Device::setStreamTransform(int id,
+        int transform) {
+    ALOGV("%s: E", __FUNCTION__);
+    bool found = false;
+    StreamList::iterator streamI;
+    for (streamI = mStreams.begin();
+         streamI != mStreams.end(); streamI++) {
+        if ((*streamI)->getId() == id) {
+            found = true;
+            break;
+        }
+    }
+    if (!found) {
+        ALOGE("%s: Camera %d: Stream %d does not exist",
+                __FUNCTION__, mId, id);
+        return BAD_VALUE;
+    }
+
+    return (*streamI)->setTransform(transform);
+}
+
+status_t Camera2Device::deleteStream(int id) {
+    ALOGV("%s: E", __FUNCTION__);
+    bool found = false;
+    for (StreamList::iterator streamI = mStreams.begin();
+         streamI != mStreams.end(); streamI++) {
+        if ((*streamI)->getId() == id) {
+            status_t res = (*streamI)->release();
+            if (res != OK) {
+                ALOGE("%s: Unable to release stream %d from HAL device: "
+                        "%s (%d)", __FUNCTION__, id, strerror(-res), res);
+                return res;
+            }
+            mStreams.erase(streamI);
+            found = true;
+            break;
+        }
+    }
+    if (!found) {
+        ALOGE("%s: Camera %d: Unable to find stream %d to delete",
+                __FUNCTION__, mId, id);
+        return BAD_VALUE;
+    }
+    return OK;
+}
+
+status_t Camera2Device::createDefaultRequest(int templateId,
+        CameraMetadata *request) {
+    status_t err;
+    ALOGV("%s: E", __FUNCTION__);
+    camera_metadata_t *rawRequest;
+    err = mDevice->ops->construct_default_request(
+        mDevice, templateId, &rawRequest);
+    request->acquire(rawRequest);
+    return err;
+}
+
+status_t Camera2Device::waitUntilDrained() {
+    static const uint32_t kSleepTime = 50000; // 50 ms
+    static const uint32_t kMaxSleepTime = 10000000; // 10 s
+    ALOGV("%s: E", __FUNCTION__);
+    if (mRequestQueue.getBufferCount() ==
+            CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS) return INVALID_OPERATION;
+
+    // TODO: Set up notifications from HAL, instead of sleeping here
+    uint32_t totalTime = 0;
+    while (mDevice->ops->get_in_progress_count(mDevice) > 0) {
+        usleep(kSleepTime);
+        totalTime += kSleepTime;
+        if (totalTime > kMaxSleepTime) {
+            ALOGE("%s: Waited %d us, requests still in flight", __FUNCTION__,
+                    totalTime);
+            return TIMED_OUT;
+        }
+    }
+    return OK;
+}
+
+status_t Camera2Device::setNotifyCallback(NotificationListener *listener) {
+    status_t res;
+    res = mDevice->ops->set_notify_callback(mDevice, notificationCallback,
+            reinterpret_cast<void*>(listener) );
+    if (res != OK) {
+        ALOGE("%s: Unable to set notification callback!", __FUNCTION__);
+    }
+    return res;
+}
+
+void Camera2Device::notificationCallback(int32_t msg_type,
+        int32_t ext1,
+        int32_t ext2,
+        int32_t ext3,
+        void *user) {
+    NotificationListener *listener = reinterpret_cast<NotificationListener*>(user);
+    ALOGV("%s: Notification %d, arguments %d, %d, %d", __FUNCTION__, msg_type,
+            ext1, ext2, ext3);
+    if (listener != NULL) {
+        switch (msg_type) {
+            case CAMERA2_MSG_ERROR:
+                listener->notifyError(ext1, ext2, ext3);
+                break;
+            case CAMERA2_MSG_SHUTTER: {
+                nsecs_t timestamp = (nsecs_t)ext2 | ((nsecs_t)(ext3) << 32 );
+                listener->notifyShutter(ext1, timestamp);
+                break;
+            }
+            case CAMERA2_MSG_AUTOFOCUS:
+                listener->notifyAutoFocus(ext1, ext2);
+                break;
+            case CAMERA2_MSG_AUTOEXPOSURE:
+                listener->notifyAutoExposure(ext1, ext2);
+                break;
+            case CAMERA2_MSG_AUTOWB:
+                listener->notifyAutoWhitebalance(ext1, ext2);
+                break;
+            default:
+                ALOGE("%s: Unknown notification %d (arguments %d, %d, %d)!",
+                        __FUNCTION__, msg_type, ext1, ext2, ext3);
+        }
+    }
+}
+
+status_t Camera2Device::waitForNextFrame(nsecs_t timeout) {
+    return mFrameQueue.waitForBuffer(timeout);
+}
+
+status_t Camera2Device::getNextFrame(CameraMetadata *frame) {
+    status_t res;
+    camera_metadata_t *rawFrame;
+    res = mFrameQueue.dequeue(&rawFrame);
+    if (rawFrame  == NULL) {
+        return NOT_ENOUGH_DATA;
+    } else if (res == OK) {
+        frame->acquire(rawFrame);
+    }
+    return res;
+}
+
+status_t Camera2Device::triggerAutofocus(uint32_t id) {
+    status_t res;
+    ALOGV("%s: Triggering autofocus, id %d", __FUNCTION__, id);
+    res = mDevice->ops->trigger_action(mDevice,
+            CAMERA2_TRIGGER_AUTOFOCUS, id, 0);
+    if (res != OK) {
+        ALOGE("%s: Error triggering autofocus (id %d)",
+                __FUNCTION__, id);
+    }
+    return res;
+}
+
+status_t Camera2Device::triggerCancelAutofocus(uint32_t id) {
+    status_t res;
+    ALOGV("%s: Canceling autofocus, id %d", __FUNCTION__, id);
+    res = mDevice->ops->trigger_action(mDevice,
+            CAMERA2_TRIGGER_CANCEL_AUTOFOCUS, id, 0);
+    if (res != OK) {
+        ALOGE("%s: Error canceling autofocus (id %d)",
+                __FUNCTION__, id);
+    }
+    return res;
+}
+
+status_t Camera2Device::triggerPrecaptureMetering(uint32_t id) {
+    status_t res;
+    ALOGV("%s: Triggering precapture metering, id %d", __FUNCTION__, id);
+    res = mDevice->ops->trigger_action(mDevice,
+            CAMERA2_TRIGGER_PRECAPTURE_METERING, id, 0);
+    if (res != OK) {
+        ALOGE("%s: Error triggering precapture metering (id %d)",
+                __FUNCTION__, id);
+    }
+    return res;
+}
+
+/**
+ * Camera2Device::NotificationListener
+ */
+
+Camera2Device::NotificationListener::~NotificationListener() {
+}
+
+/**
+ * Camera2Device::MetadataQueue
+ */
+
+Camera2Device::MetadataQueue::MetadataQueue():
+            mDevice(NULL),
+            mFrameCount(0),
+            mCount(0),
+            mStreamSlotCount(0),
+            mSignalConsumer(true)
+{
+    camera2_request_queue_src_ops::dequeue_request = consumer_dequeue;
+    camera2_request_queue_src_ops::request_count = consumer_buffer_count;
+    camera2_request_queue_src_ops::free_request = consumer_free;
+
+    camera2_frame_queue_dst_ops::dequeue_frame = producer_dequeue;
+    camera2_frame_queue_dst_ops::cancel_frame = producer_cancel;
+    camera2_frame_queue_dst_ops::enqueue_frame = producer_enqueue;
+}
+
+Camera2Device::MetadataQueue::~MetadataQueue() {
+    Mutex::Autolock l(mMutex);
+    freeBuffers(mEntries.begin(), mEntries.end());
+    freeBuffers(mStreamSlot.begin(), mStreamSlot.end());
+}
+
+// Connect to camera2 HAL as consumer (input requests/reprocessing)
+status_t Camera2Device::MetadataQueue::setConsumerDevice(camera2_device_t *d) {
+    status_t res;
+    res = d->ops->set_request_queue_src_ops(d,
+            this);
+    if (res != OK) return res;
+    mDevice = d;
+    return OK;
+}
+
+status_t Camera2Device::MetadataQueue::setProducerDevice(camera2_device_t *d) {
+    status_t res;
+    res = d->ops->set_frame_queue_dst_ops(d,
+            this);
+    return res;
+}
+
+// Real interfaces
+status_t Camera2Device::MetadataQueue::enqueue(camera_metadata_t *buf) {
+    ALOGVV("%s: E", __FUNCTION__);
+    Mutex::Autolock l(mMutex);
+
+    mCount++;
+    mEntries.push_back(buf);
+
+    return signalConsumerLocked();
+}
+
+int Camera2Device::MetadataQueue::getBufferCount() {
+    Mutex::Autolock l(mMutex);
+    if (mStreamSlotCount > 0) {
+        return CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS;
+    }
+    return mCount;
+}
+
+status_t Camera2Device::MetadataQueue::dequeue(camera_metadata_t **buf,
+        bool incrementCount)
+{
+    ALOGVV("%s: E", __FUNCTION__);
+    status_t res;
+    Mutex::Autolock l(mMutex);
+
+    if (mCount == 0) {
+        if (mStreamSlotCount == 0) {
+            ALOGVV("%s: Empty", __FUNCTION__);
+            *buf = NULL;
+            mSignalConsumer = true;
+            return OK;
+        }
+        ALOGVV("%s: Streaming %d frames to queue", __FUNCTION__,
+              mStreamSlotCount);
+
+        for (List<camera_metadata_t*>::iterator slotEntry = mStreamSlot.begin();
+                slotEntry != mStreamSlot.end();
+                slotEntry++ ) {
+            size_t entries = get_camera_metadata_entry_count(*slotEntry);
+            size_t dataBytes = get_camera_metadata_data_count(*slotEntry);
+
+            camera_metadata_t *copy =
+                    allocate_camera_metadata(entries, dataBytes);
+            append_camera_metadata(copy, *slotEntry);
+            mEntries.push_back(copy);
+        }
+        mCount = mStreamSlotCount;
+    }
+    ALOGVV("MetadataQueue: deque (%d buffers)", mCount);
+    camera_metadata_t *b = *(mEntries.begin());
+    mEntries.erase(mEntries.begin());
+
+    if (incrementCount) {
+        camera_metadata_entry_t frameCount;
+        res = find_camera_metadata_entry(b,
+                ANDROID_REQUEST_FRAME_COUNT,
+                &frameCount);
+        if (res != OK) {
+            ALOGE("%s: Unable to add frame count: %s (%d)",
+                    __FUNCTION__, strerror(-res), res);
+        } else {
+            *frameCount.data.i32 = mFrameCount;
+        }
+        mFrameCount++;
+    }
+
+    *buf = b;
+    mCount--;
+
+    return OK;
+}
+
+status_t Camera2Device::MetadataQueue::waitForBuffer(nsecs_t timeout)
+{
+    Mutex::Autolock l(mMutex);
+    status_t res;
+    while (mCount == 0) {
+        res = notEmpty.waitRelative(mMutex,timeout);
+        if (res != OK) return res;
+    }
+    return OK;
+}
+
+status_t Camera2Device::MetadataQueue::setStreamSlot(camera_metadata_t *buf)
+{
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock l(mMutex);
+    if (buf == NULL) {
+        freeBuffers(mStreamSlot.begin(), mStreamSlot.end());
+        mStreamSlotCount = 0;
+        return OK;
+    }
+    camera_metadata_t *buf2 = clone_camera_metadata(buf);
+    if (!buf2) {
+        ALOGE("%s: Unable to clone metadata buffer!", __FUNCTION__);
+        return NO_MEMORY;
+    }
+
+    if (mStreamSlotCount > 1) {
+        List<camera_metadata_t*>::iterator deleter = ++mStreamSlot.begin();
+        freeBuffers(++mStreamSlot.begin(), mStreamSlot.end());
+        mStreamSlotCount = 1;
+    }
+    if (mStreamSlotCount == 1) {
+        free_camera_metadata( *(mStreamSlot.begin()) );
+        *(mStreamSlot.begin()) = buf2;
+    } else {
+        mStreamSlot.push_front(buf2);
+        mStreamSlotCount = 1;
+    }
+    return signalConsumerLocked();
+}
+
+status_t Camera2Device::MetadataQueue::setStreamSlot(
+        const List<camera_metadata_t*> &bufs)
+{
+    ALOGV("%s: E", __FUNCTION__);
+    Mutex::Autolock l(mMutex);
+    status_t res;
+
+    if (mStreamSlotCount > 0) {
+        freeBuffers(mStreamSlot.begin(), mStreamSlot.end());
+    }
+    mStreamSlotCount = 0;
+    for (List<camera_metadata_t*>::const_iterator r = bufs.begin();
+         r != bufs.end(); r++) {
+        camera_metadata_t *r2 = clone_camera_metadata(*r);
+        if (!r2) {
+            ALOGE("%s: Unable to clone metadata buffer!", __FUNCTION__);
+            return NO_MEMORY;
+        }
+        mStreamSlot.push_back(r2);
+        mStreamSlotCount++;
+    }
+    return signalConsumerLocked();
+}
+
+status_t Camera2Device::MetadataQueue::dump(int fd,
+        const Vector<String16>& args) {
+    String8 result;
+    status_t notLocked;
+    notLocked = mMutex.tryLock();
+    if (notLocked) {
+        result.append("    (Unable to lock queue mutex)\n");
+    }
+    result.appendFormat("      Current frame number: %d\n", mFrameCount);
+    if (mStreamSlotCount == 0) {
+        result.append("      Stream slot: Empty\n");
+        write(fd, result.string(), result.size());
+    } else {
+        result.appendFormat("      Stream slot: %d entries\n",
+                mStreamSlot.size());
+        int i = 0;
+        for (List<camera_metadata_t*>::iterator r = mStreamSlot.begin();
+             r != mStreamSlot.end(); r++) {
+            result = String8::format("       Stream slot buffer %d:\n", i);
+            write(fd, result.string(), result.size());
+            dump_indented_camera_metadata(*r, fd, 2, 10);
+            i++;
+        }
+    }
+    if (mEntries.size() == 0) {
+        result = "      Main queue is empty\n";
+        write(fd, result.string(), result.size());
+    } else {
+        result = String8::format("      Main queue has %d entries:\n",
+                mEntries.size());
+        int i = 0;
+        for (List<camera_metadata_t*>::iterator r = mEntries.begin();
+             r != mEntries.end(); r++) {
+            result = String8::format("       Queue entry %d:\n", i);
+            write(fd, result.string(), result.size());
+            dump_indented_camera_metadata(*r, fd, 2, 10);
+            i++;
+        }
+    }
+
+    if (notLocked == 0) {
+        mMutex.unlock();
+    }
+
+    return OK;
+}
+
+status_t Camera2Device::MetadataQueue::signalConsumerLocked() {
+    status_t res = OK;
+    notEmpty.signal();
+    if (mSignalConsumer && mDevice != NULL) {
+        mSignalConsumer = false;
+
+        mMutex.unlock();
+        ALOGV("%s: Signaling consumer", __FUNCTION__);
+        res = mDevice->ops->notify_request_queue_not_empty(mDevice);
+        mMutex.lock();
+    }
+    return res;
+}
+
+status_t Camera2Device::MetadataQueue::freeBuffers(
+        List<camera_metadata_t*>::iterator start,
+        List<camera_metadata_t*>::iterator end)
+{
+    while (start != end) {
+        free_camera_metadata(*start);
+        start = mStreamSlot.erase(start);
+    }
+    return OK;
+}
+
+Camera2Device::MetadataQueue* Camera2Device::MetadataQueue::getInstance(
+        const camera2_request_queue_src_ops_t *q)
+{
+    const MetadataQueue* cmq = static_cast<const MetadataQueue*>(q);
+    return const_cast<MetadataQueue*>(cmq);
+}
+
+Camera2Device::MetadataQueue* Camera2Device::MetadataQueue::getInstance(
+        const camera2_frame_queue_dst_ops_t *q)
+{
+    const MetadataQueue* cmq = static_cast<const MetadataQueue*>(q);
+    return const_cast<MetadataQueue*>(cmq);
+}
+
+int Camera2Device::MetadataQueue::consumer_buffer_count(
+        const camera2_request_queue_src_ops_t *q)
+{
+    MetadataQueue *queue = getInstance(q);
+    return queue->getBufferCount();
+}
+
+int Camera2Device::MetadataQueue::consumer_dequeue(
+        const camera2_request_queue_src_ops_t *q,
+        camera_metadata_t **buffer)
+{
+    MetadataQueue *queue = getInstance(q);
+    return queue->dequeue(buffer, true);
+}
+
+int Camera2Device::MetadataQueue::consumer_free(
+        const camera2_request_queue_src_ops_t *q,
+        camera_metadata_t *old_buffer)
+{
+    MetadataQueue *queue = getInstance(q);
+    free_camera_metadata(old_buffer);
+    return OK;
+}
+
+int Camera2Device::MetadataQueue::producer_dequeue(
+        const camera2_frame_queue_dst_ops_t *q,
+        size_t entries, size_t bytes,
+        camera_metadata_t **buffer)
+{
+    camera_metadata_t *new_buffer =
+            allocate_camera_metadata(entries, bytes);
+    if (new_buffer == NULL) return NO_MEMORY;
+    *buffer = new_buffer;
+        return OK;
+}
+
+int Camera2Device::MetadataQueue::producer_cancel(
+        const camera2_frame_queue_dst_ops_t *q,
+        camera_metadata_t *old_buffer)
+{
+    free_camera_metadata(old_buffer);
+    return OK;
+}
+
+int Camera2Device::MetadataQueue::producer_enqueue(
+        const camera2_frame_queue_dst_ops_t *q,
+        camera_metadata_t *filled_buffer)
+{
+    MetadataQueue *queue = getInstance(q);
+    return queue->enqueue(filled_buffer);
+}
+
+/**
+ * Camera2Device::StreamAdapter
+ */
+
+#ifndef container_of
+#define container_of(ptr, type, member) \
+    (type *)((char*)(ptr) - offsetof(type, member))
+#endif
+
+Camera2Device::StreamAdapter::StreamAdapter(camera2_device_t *d):
+        mState(RELEASED),
+        mDevice(d),
+        mId(-1),
+        mWidth(0), mHeight(0), mFormat(0), mSize(0), mUsage(0),
+        mMaxProducerBuffers(0), mMaxConsumerBuffers(0),
+        mTotalBuffers(0),
+        mFormatRequested(0),
+        mActiveBuffers(0),
+        mFrameCount(0),
+        mLastTimestamp(0)
+{
+    camera2_stream_ops::dequeue_buffer = dequeue_buffer;
+    camera2_stream_ops::enqueue_buffer = enqueue_buffer;
+    camera2_stream_ops::cancel_buffer = cancel_buffer;
+    camera2_stream_ops::set_crop = set_crop;
+}
+
+Camera2Device::StreamAdapter::~StreamAdapter() {
+    if (mState != RELEASED) {
+        release();
+    }
+}
+
+status_t Camera2Device::StreamAdapter::connectToDevice(
+        sp<ANativeWindow> consumer,
+        uint32_t width, uint32_t height, int format, size_t size) {
+    status_t res;
+    ALOGV("%s: E", __FUNCTION__);
+
+    if (mState != RELEASED) return INVALID_OPERATION;
+    if (consumer == NULL) {
+        ALOGE("%s: Null consumer passed to stream adapter", __FUNCTION__);
+        return BAD_VALUE;
+    }
+
+    ALOGV("%s: New stream parameters %d x %d, format 0x%x, size %d",
+            __FUNCTION__, width, height, format, size);
+
+    mConsumerInterface = consumer;
+    mWidth = width;
+    mHeight = height;
+    mSize = (format == HAL_PIXEL_FORMAT_BLOB) ? size : 0;
+    mFormatRequested = format;
+
+    // Allocate device-side stream interface
+
+    uint32_t id;
+    uint32_t formatActual;
+    uint32_t usage;
+    uint32_t maxBuffers = 2;
+    res = mDevice->ops->allocate_stream(mDevice,
+            mWidth, mHeight, mFormatRequested, getStreamOps(),
+            &id, &formatActual, &usage, &maxBuffers);
+    if (res != OK) {
+        ALOGE("%s: Device stream allocation failed: %s (%d)",
+                __FUNCTION__, strerror(-res), res);
+        return res;
+    }
+
+    ALOGV("%s: Allocated stream id %d, actual format 0x%x, "
+            "usage 0x%x, producer wants %d buffers", __FUNCTION__,
+            id, formatActual, usage, maxBuffers);
+
+    mId = id;
+    mFormat = formatActual;
+    mUsage = usage;
+    mMaxProducerBuffers = maxBuffers;
+
+    mState = ALLOCATED;
+
+    // Configure consumer-side ANativeWindow interface
+    res = native_window_api_connect(mConsumerInterface.get(),
+            NATIVE_WINDOW_API_CAMERA);
+    if (res != OK) {
+        ALOGE("%s: Unable to connect to native window for stream %d",
+                __FUNCTION__, mId);
+
+        return res;
+    }
+
+    mState = CONNECTED;
+
+    res = native_window_set_usage(mConsumerInterface.get(), mUsage);
+    if (res != OK) {
+        ALOGE("%s: Unable to configure usage %08x for stream %d",
+                __FUNCTION__, mUsage, mId);
+        return res;
+    }
+
+    res = native_window_set_scaling_mode(mConsumerInterface.get(),
+            NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
+    if (res != OK) {
+        ALOGE("%s: Unable to configure stream scaling: %s (%d)",
+                __FUNCTION__, strerror(-res), res);
+        return res;
+    }
+
+    res = setTransform(0);
+    if (res != OK) {
+        return res;
+    }
+
+    if (mFormat == HAL_PIXEL_FORMAT_BLOB) {
+        res = native_window_set_buffers_geometry(mConsumerInterface.get(),
+                mSize, 1, mFormat);
+        if (res != OK) {
+            ALOGE("%s: Unable to configure compressed stream buffer geometry"
+                    " %d x %d, size %d for stream %d",
+                    __FUNCTION__, mWidth, mHeight, mSize, mId);
+            return res;
+        }
+    } else {
+        res = native_window_set_buffers_geometry(mConsumerInterface.get(),
+                mWidth, mHeight, mFormat);
+        if (res != OK) {
+            ALOGE("%s: Unable to configure stream buffer geometry"
+                    " %d x %d, format 0x%x for stream %d",
+                    __FUNCTION__, mWidth, mHeight, mFormat, mId);
+            return res;
+        }
+    }
+
+    int maxConsumerBuffers;
+    res = mConsumerInterface->query(mConsumerInterface.get(),
+            NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &maxConsumerBuffers);
+    if (res != OK) {
+        ALOGE("%s: Unable to query consumer undequeued"
+                " buffer count for stream %d", __FUNCTION__, mId);
+        return res;
+    }
+    mMaxConsumerBuffers = maxConsumerBuffers;
+
+    ALOGV("%s: Consumer wants %d buffers", __FUNCTION__,
+            mMaxConsumerBuffers);
+
+    mTotalBuffers = mMaxConsumerBuffers + mMaxProducerBuffers;
+    mActiveBuffers = 0;
+    mFrameCount = 0;
+    mLastTimestamp = 0;
+
+    res = native_window_set_buffer_count(mConsumerInterface.get(),
+            mTotalBuffers);
+    if (res != OK) {
+        ALOGE("%s: Unable to set buffer count for stream %d",
+                __FUNCTION__, mId);
+        return res;
+    }
+
+    // Register allocated buffers with HAL device
+    buffer_handle_t *buffers = new buffer_handle_t[mTotalBuffers];
+    ANativeWindowBuffer **anwBuffers = new ANativeWindowBuffer*[mTotalBuffers];
+    uint32_t bufferIdx = 0;
+    for (; bufferIdx < mTotalBuffers; bufferIdx++) {
+        res = native_window_dequeue_buffer_and_wait(mConsumerInterface.get(),
+                &anwBuffers[bufferIdx]);
+        if (res != OK) {
+            ALOGE("%s: Unable to dequeue buffer %d for initial registration for "
+                    "stream %d", __FUNCTION__, bufferIdx, mId);
+            goto cleanUpBuffers;
+        }
+
+        buffers[bufferIdx] = anwBuffers[bufferIdx]->handle;
+        ALOGV("%s: Buffer %p allocated", __FUNCTION__, (void*)(buffers[bufferIdx]));
+    }
+
+    ALOGV("%s: Registering %d buffers with camera HAL", __FUNCTION__, mTotalBuffers);
+    res = mDevice->ops->register_stream_buffers(mDevice,
+            mId,
+            mTotalBuffers,
+            buffers);
+    if (res != OK) {
+        ALOGE("%s: Unable to register buffers with HAL device for stream %d",
+                __FUNCTION__, mId);
+    } else {
+        mState = ACTIVE;
+    }
+
+cleanUpBuffers:
+    ALOGV("%s: Cleaning up %d buffers", __FUNCTION__, bufferIdx);
+    for (uint32_t i = 0; i < bufferIdx; i++) {
+        res = mConsumerInterface->cancelBuffer(mConsumerInterface.get(),
+                anwBuffers[i], -1);
+        if (res != OK) {
+            ALOGE("%s: Unable to cancel buffer %d after registration",
+                    __FUNCTION__, i);
+        }
+    }
+    delete[] anwBuffers;
+    delete[] buffers;
+
+    return res;
+}
+
+status_t Camera2Device::StreamAdapter::release() {
+    status_t res;
+    ALOGV("%s: Releasing stream %d", __FUNCTION__, mId);
+    if (mState >= ALLOCATED) {
+        res = mDevice->ops->release_stream(mDevice, mId);
+        if (res != OK) {
+            ALOGE("%s: Unable to release stream %d",
+                    __FUNCTION__, mId);
+            return res;
+        }
+    }
+    if (mState >= CONNECTED) {
+        res = native_window_api_disconnect(mConsumerInterface.get(),
+                NATIVE_WINDOW_API_CAMERA);
+        if (res != OK) {
+            ALOGE("%s: Unable to disconnect stream %d from native window",
+                    __FUNCTION__, mId);
+            return res;
+        }
+    }
+    mId = -1;
+    mState = RELEASED;
+    return OK;
+}
+
+status_t Camera2Device::StreamAdapter::setTransform(int transform) {
+    status_t res;
+    if (mState < CONNECTED) {
+        ALOGE("%s: Cannot set transform on unconnected stream", __FUNCTION__);
+        return INVALID_OPERATION;
+    }
+    res = native_window_set_buffers_transform(mConsumerInterface.get(),
+                                              transform);
+    if (res != OK) {
+        ALOGE("%s: Unable to configure stream transform to %x: %s (%d)",
+                __FUNCTION__, transform, strerror(-res), res);
+    }
+    return res;
+}
+
+status_t Camera2Device::StreamAdapter::dump(int fd,
+        const Vector<String16>& args) {
+    String8 result = String8::format("      Stream %d: %d x %d, format 0x%x\n",
+            mId, mWidth, mHeight, mFormat);
+    result.appendFormat("        size %d, usage 0x%x, requested format 0x%x\n",
+            mSize, mUsage, mFormatRequested);
+    result.appendFormat("        total buffers: %d, dequeued buffers: %d\n",
+            mTotalBuffers, mActiveBuffers);
+    result.appendFormat("        frame count: %d, last timestamp %lld\n",
+            mFrameCount, mLastTimestamp);
+    write(fd, result.string(), result.size());
+    return OK;
+}
+
+const camera2_stream_ops *Camera2Device::StreamAdapter::getStreamOps() {
+    return static_cast<camera2_stream_ops *>(this);
+}
+
+ANativeWindow* Camera2Device::StreamAdapter::toANW(
+        const camera2_stream_ops_t *w) {
+    return static_cast<const StreamAdapter*>(w)->mConsumerInterface.get();
+}
+
+int Camera2Device::StreamAdapter::dequeue_buffer(const camera2_stream_ops_t *w,
+        buffer_handle_t** buffer) {
+    int res;
+    StreamAdapter* stream =
+            const_cast<StreamAdapter*>(static_cast<const StreamAdapter*>(w));
+    if (stream->mState != ACTIVE) {
+        ALOGE("%s: Called when in bad state: %d", __FUNCTION__, stream->mState);
+        return INVALID_OPERATION;
+    }
+
+    ANativeWindow *a = toANW(w);
+    ANativeWindowBuffer* anb;
+    res = native_window_dequeue_buffer_and_wait(a, &anb);
+    if (res != OK) {
+        ALOGE("Stream %d dequeue: Error from native_window: %s (%d)", stream->mId,
+                strerror(-res), res);
+        return res;
+    }
+
+    *buffer = &(anb->handle);
+    stream->mActiveBuffers++;
+
+    ALOGVV("Stream %d dequeue: Buffer %p dequeued", stream->mId, (void*)(**buffer));
+    return res;
+}
+
+int Camera2Device::StreamAdapter::enqueue_buffer(const camera2_stream_ops_t* w,
+        int64_t timestamp,
+        buffer_handle_t* buffer) {
+    StreamAdapter *stream =
+            const_cast<StreamAdapter*>(static_cast<const StreamAdapter*>(w));
+    stream->mFrameCount++;
+    ALOGVV("Stream %d enqueue: Frame %d (%p) captured at %lld ns",
+            stream->mId, mFrameCount, (void*)(*buffer), timestamp);
+    int state = stream->mState;
+    if (state != ACTIVE) {
+        ALOGE("%s: Called when in bad state: %d", __FUNCTION__, state);
+        return INVALID_OPERATION;
+    }
+    ANativeWindow *a = toANW(w);
+    status_t err;
+
+    err = native_window_set_buffers_timestamp(a, timestamp);
+    if (err != OK) {
+        ALOGE("%s: Error setting timestamp on native window: %s (%d)",
+                __FUNCTION__, strerror(-err), err);
+        return err;
+    }
+    err = a->queueBuffer(a,
+            container_of(buffer, ANativeWindowBuffer, handle), -1);
+    if (err != OK) {
+        ALOGE("%s: Error queueing buffer to native window: %s (%d)",
+                __FUNCTION__, strerror(-err), err);
+        return err;
+    }
+
+    stream->mActiveBuffers--;
+    stream->mLastTimestamp = timestamp;
+    return OK;
+}
+
+int Camera2Device::StreamAdapter::cancel_buffer(const camera2_stream_ops_t* w,
+        buffer_handle_t* buffer) {
+    StreamAdapter *stream =
+            const_cast<StreamAdapter*>(static_cast<const StreamAdapter*>(w));
+    ALOGVV("Stream %d cancel: Buffer %p",
+            stream->mId, (void*)(*buffer));
+    if (stream->mState != ACTIVE) {
+        ALOGE("%s: Called when in bad state: %d", __FUNCTION__, stream->mState);
+        return INVALID_OPERATION;
+    }
+
+    ANativeWindow *a = toANW(w);
+    int err = a->cancelBuffer(a,
+            container_of(buffer, ANativeWindowBuffer, handle), -1);
+    if (err != OK) {
+        ALOGE("%s: Error canceling buffer to native window: %s (%d)",
+                __FUNCTION__, strerror(-err), err);
+        return err;
+    }
+
+    stream->mActiveBuffers--;
+    return OK;
+}
+
+int Camera2Device::StreamAdapter::set_crop(const camera2_stream_ops_t* w,
+        int left, int top, int right, int bottom) {
+    int state = static_cast<const StreamAdapter*>(w)->mState;
+    if (state != ACTIVE) {
+        ALOGE("%s: Called when in bad state: %d", __FUNCTION__, state);
+        return INVALID_OPERATION;
+    }
+    ANativeWindow *a = toANW(w);
+    android_native_rect_t crop = { left, top, right, bottom };
+    return native_window_set_crop(a, &crop);
+}
+
+
+}; // namespace android
diff --git a/services/camera/libcameraservice/Camera2Device.h b/services/camera/libcameraservice/Camera2Device.h
new file mode 100644
index 0000000..64f4608
--- /dev/null
+++ b/services/camera/libcameraservice/Camera2Device.h
@@ -0,0 +1,357 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SERVERS_CAMERA_CAMERA2DEVICE_H
+#define ANDROID_SERVERS_CAMERA_CAMERA2DEVICE_H
+
+#include <utils/Condition.h>
+#include <utils/Errors.h>
+#include <utils/List.h>
+#include <utils/Mutex.h>
+#include <utils/RefBase.h>
+#include <utils/String8.h>
+#include <utils/String16.h>
+#include <utils/Vector.h>
+
+#include "hardware/camera2.h"
+#include "camera2/CameraMetadata.h"
+
+namespace android {
+
+class Camera2Device : public virtual RefBase {
+  public:
+    typedef camera2::CameraMetadata CameraMetadata;
+
+    Camera2Device(int id);
+
+    ~Camera2Device();
+
+    status_t initialize(camera_module_t *module);
+
+    status_t dump(int fd, const Vector<String16>& args);
+
+    /**
+     * The device's static characteristics metadata buffer
+     */
+    const CameraMetadata& info() const;
+
+    /**
+     * Submit request for capture. The Camera2Device takes ownership of the
+     * passed-in buffer.
+     */
+    status_t capture(CameraMetadata &request);
+
+    /**
+     * Submit request for streaming. The Camera2Device makes a copy of the
+     * passed-in buffer and the caller retains ownership.
+     */
+    status_t setStreamingRequest(const CameraMetadata &request);
+
+    /**
+     * Clear the streaming request slot.
+     */
+    status_t clearStreamingRequest();
+
+    /**
+     * Create an output stream of the requested size and format.
+     *
+     * If format is CAMERA2_HAL_PIXEL_FORMAT_OPAQUE, then the HAL device selects
+     * an appropriate format; it can be queried with getStreamInfo.
+     *
+     * If format is HAL_PIXEL_FORMAT_COMPRESSED, the size parameter must be
+     * equal to the size in bytes of the buffers to allocate for the stream. For
+     * other formats, the size parameter is ignored.
+     */
+    status_t createStream(sp<ANativeWindow> consumer,
+            uint32_t width, uint32_t height, int format, size_t size,
+            int *id);
+
+    /**
+     * Get information about a given stream.
+     */
+    status_t getStreamInfo(int id,
+            uint32_t *width, uint32_t *height, uint32_t *format);
+
+    /**
+     * Set stream gralloc buffer transform
+     */
+    status_t setStreamTransform(int id, int transform);
+
+    /**
+     * Delete stream. Must not be called if there are requests in flight which
+     * reference that stream.
+     */
+    status_t deleteStream(int id);
+
+    /**
+     * Create a metadata buffer with fields that the HAL device believes are
+     * best for the given use case
+     */
+    status_t createDefaultRequest(int templateId, CameraMetadata *request);
+
+    /**
+     * Wait until all requests have been processed. Returns INVALID_OPERATION if
+     * the streaming slot is not empty, or TIMED_OUT if the requests haven't
+     * finished processing in 10 seconds.
+     */
+    status_t waitUntilDrained();
+
+    /**
+     * Abstract class for HAL notification listeners
+     */
+    class NotificationListener {
+      public:
+        // Refer to the Camera2 HAL definition for notification definitions
+        virtual void notifyError(int errorCode, int arg1, int arg2) = 0;
+        virtual void notifyShutter(int frameNumber, nsecs_t timestamp) = 0;
+        virtual void notifyAutoFocus(uint8_t newState, int triggerId) = 0;
+        virtual void notifyAutoExposure(uint8_t newState, int triggerId) = 0;
+        virtual void notifyAutoWhitebalance(uint8_t newState, int triggerId) = 0;
+      protected:
+        virtual ~NotificationListener();
+    };
+
+    /**
+     * Connect HAL notifications to a listener. Overwrites previous
+     * listener. Set to NULL to stop receiving notifications.
+     */
+    status_t setNotifyCallback(NotificationListener *listener);
+
+    /**
+     * Wait for a new frame to be produced, with timeout in nanoseconds.
+     * Returns TIMED_OUT when no frame produced within the specified duration
+     */
+    status_t waitForNextFrame(nsecs_t timeout);
+
+    /**
+     * Get next metadata frame from the frame queue. Returns NULL if the queue
+     * is empty; caller takes ownership of the metadata buffer.
+     */
+    status_t getNextFrame(CameraMetadata *frame);
+
+    /**
+     * Trigger auto-focus. The latest ID used in a trigger autofocus or cancel
+     * autofocus call will be returned by the HAL in all subsequent AF
+     * notifications.
+     */
+    status_t triggerAutofocus(uint32_t id);
+
+    /**
+     * Cancel auto-focus. The latest ID used in a trigger autofocus/cancel
+     * autofocus call will be returned by the HAL in all subsequent AF
+     * notifications.
+     */
+    status_t triggerCancelAutofocus(uint32_t id);
+
+    /**
+     * Trigger pre-capture metering. The latest ID used in a trigger pre-capture
+     * call will be returned by the HAL in all subsequent AE and AWB
+     * notifications.
+     */
+    status_t triggerPrecaptureMetering(uint32_t id);
+
+  private:
+
+    const int mId;
+    camera2_device_t *mDevice;
+
+    CameraMetadata mDeviceInfo;
+    vendor_tag_query_ops_t *mVendorTagOps;
+
+    /**
+     * Queue class for both sending requests to a camera2 device, and for
+     * receiving frames from a camera2 device.
+     */
+    class MetadataQueue: public camera2_request_queue_src_ops_t,
+                         public camera2_frame_queue_dst_ops_t {
+      public:
+        MetadataQueue();
+        ~MetadataQueue();
+
+        // Interface to camera2 HAL device, either for requests (device is
+        // consumer) or for frames (device is producer)
+        const camera2_request_queue_src_ops_t*   getToConsumerInterface();
+        void setFromConsumerInterface(camera2_device_t *d);
+
+        // Connect queue consumer endpoint to a camera2 device
+        status_t setConsumerDevice(camera2_device_t *d);
+        // Connect queue producer endpoint to a camera2 device
+        status_t setProducerDevice(camera2_device_t *d);
+
+        const camera2_frame_queue_dst_ops_t* getToProducerInterface();
+
+        // Real interfaces. On enqueue, queue takes ownership of buffer pointer
+        // On dequeue, user takes ownership of buffer pointer.
+        status_t enqueue(camera_metadata_t *buf);
+        status_t dequeue(camera_metadata_t **buf, bool incrementCount = true);
+        int      getBufferCount();
+        status_t waitForBuffer(nsecs_t timeout);
+
+        // Set repeating buffer(s); if the queue is empty on a dequeue call, the
+        // queue copies the contents of the stream slot into the queue, and then
+        // dequeues the first new entry. The metadata buffers passed in are
+        // copied.
+        status_t setStreamSlot(camera_metadata_t *buf);
+        status_t setStreamSlot(const List<camera_metadata_t*> &bufs);
+
+        status_t dump(int fd, const Vector<String16>& args);
+
+      private:
+        status_t signalConsumerLocked();
+        status_t freeBuffers(List<camera_metadata_t*>::iterator start,
+                List<camera_metadata_t*>::iterator end);
+
+        camera2_device_t *mDevice;
+
+        Mutex mMutex;
+        Condition notEmpty;
+
+        int mFrameCount;
+
+        int mCount;
+        List<camera_metadata_t*> mEntries;
+        int mStreamSlotCount;
+        List<camera_metadata_t*> mStreamSlot;
+
+        bool mSignalConsumer;
+
+        static MetadataQueue* getInstance(
+            const camera2_frame_queue_dst_ops_t *q);
+        static MetadataQueue* getInstance(
+            const camera2_request_queue_src_ops_t *q);
+
+        static int consumer_buffer_count(
+            const camera2_request_queue_src_ops_t *q);
+
+        static int consumer_dequeue(const camera2_request_queue_src_ops_t *q,
+            camera_metadata_t **buffer);
+
+        static int consumer_free(const camera2_request_queue_src_ops_t *q,
+                camera_metadata_t *old_buffer);
+
+        static int producer_dequeue(const camera2_frame_queue_dst_ops_t *q,
+                size_t entries, size_t bytes,
+                camera_metadata_t **buffer);
+
+        static int producer_cancel(const camera2_frame_queue_dst_ops_t *q,
+            camera_metadata_t *old_buffer);
+
+        static int producer_enqueue(const camera2_frame_queue_dst_ops_t *q,
+                camera_metadata_t *filled_buffer);
+
+    }; // class MetadataQueue
+
+    MetadataQueue mRequestQueue;
+    MetadataQueue mFrameQueue;
+
+    /**
+     * Adapter from an ANativeWindow interface to camera2 device stream ops.
+     * Also takes care of allocating/deallocating stream in device interface
+     */
+    class StreamAdapter: public camera2_stream_ops, public virtual RefBase {
+      public:
+        StreamAdapter(camera2_device_t *d);
+
+        ~StreamAdapter();
+
+        /**
+         * Create a HAL device stream of the requested size and format.
+         *
+         * If format is CAMERA2_HAL_PIXEL_FORMAT_OPAQUE, then the HAL device
+         * selects an appropriate format; it can be queried with getFormat.
+         *
+         * If format is HAL_PIXEL_FORMAT_COMPRESSED, the size parameter must
+         * be equal to the size in bytes of the buffers to allocate for the
+         * stream. For other formats, the size parameter is ignored.
+         */
+        status_t connectToDevice(sp<ANativeWindow> consumer,
+                uint32_t width, uint32_t height, int format, size_t size);
+
+        status_t release();
+
+        status_t setTransform(int transform);
+
+        // Get stream parameters.
+        // Only valid after a successful connectToDevice call.
+        int      getId() const     { return mId; }
+        uint32_t getWidth() const  { return mWidth; }
+        uint32_t getHeight() const { return mHeight; }
+        uint32_t getFormat() const { return mFormat; }
+
+        // Dump stream information
+        status_t dump(int fd, const Vector<String16>& args);
+
+      private:
+        enum {
+            ERROR = -1,
+            RELEASED = 0,
+            ALLOCATED,
+            CONNECTED,
+            ACTIVE
+        } mState;
+
+        sp<ANativeWindow> mConsumerInterface;
+        camera2_device_t *mDevice;
+
+        uint32_t mId;
+        uint32_t mWidth;
+        uint32_t mHeight;
+        uint32_t mFormat;
+        size_t   mSize;
+        uint32_t mUsage;
+        uint32_t mMaxProducerBuffers;
+        uint32_t mMaxConsumerBuffers;
+        uint32_t mTotalBuffers;
+        int mFormatRequested;
+
+        /** Debugging information */
+        uint32_t mActiveBuffers;
+        uint32_t mFrameCount;
+        int64_t  mLastTimestamp;
+
+        const camera2_stream_ops *getStreamOps();
+
+        static ANativeWindow* toANW(const camera2_stream_ops_t *w);
+
+        static int dequeue_buffer(const camera2_stream_ops_t *w,
+                buffer_handle_t** buffer);
+
+        static int enqueue_buffer(const camera2_stream_ops_t* w,
+                int64_t timestamp,
+                buffer_handle_t* buffer);
+
+        static int cancel_buffer(const camera2_stream_ops_t* w,
+                buffer_handle_t* buffer);
+
+        static int set_crop(const camera2_stream_ops_t* w,
+                int left, int top, int right, int bottom);
+    }; // class StreamAdapter
+
+    typedef List<sp<StreamAdapter> > StreamList;
+    StreamList mStreams;
+
+    // Receives HAL notifications and routes them to the NotificationListener
+    static void notificationCallback(int32_t msg_type,
+            int32_t ext1,
+            int32_t ext2,
+            int32_t ext3,
+            void *user);
+
+}; // class Camera2Device
+
+}; // namespace android
+
+#endif
diff --git a/services/camera/libcameraservice/CameraClient.cpp b/services/camera/libcameraservice/CameraClient.cpp
new file mode 100644
index 0000000..562384d
--- /dev/null
+++ b/services/camera/libcameraservice/CameraClient.cpp
@@ -0,0 +1,961 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "CameraClient"
+//#define LOG_NDEBUG 0
+
+#include <cutils/properties.h>
+#include <gui/SurfaceTextureClient.h>
+#include <gui/Surface.h>
+
+#include "CameraClient.h"
+#include "CameraHardwareInterface.h"
+#include "CameraService.h"
+
+namespace android {
+
+#define LOG1(...) ALOGD_IF(gLogLevel >= 1, __VA_ARGS__);
+#define LOG2(...) ALOGD_IF(gLogLevel >= 2, __VA_ARGS__);
+
+static int getCallingPid() {
+    return IPCThreadState::self()->getCallingPid();
+}
+
+static int getCallingUid() {
+    return IPCThreadState::self()->getCallingUid();
+}
+
+CameraClient::CameraClient(const sp<CameraService>& cameraService,
+        const sp<ICameraClient>& cameraClient,
+        int cameraId, int cameraFacing, int clientPid):
+        Client(cameraService, cameraClient,
+                cameraId, cameraFacing, clientPid)
+{
+    int callingPid = getCallingPid();
+    LOG1("CameraClient::CameraClient E (pid %d, id %d)", callingPid, cameraId);
+
+    mHardware = NULL;
+    mMsgEnabled = 0;
+    mSurface = 0;
+    mPreviewWindow = 0;
+    mDestructionStarted = false;
+
+    // Callback is disabled by default
+    mPreviewCallbackFlag = CAMERA_FRAME_CALLBACK_FLAG_NOOP;
+    mOrientation = getOrientation(0, mCameraFacing == CAMERA_FACING_FRONT);
+    mPlayShutterSound = true;
+    LOG1("CameraClient::CameraClient X (pid %d, id %d)", callingPid, cameraId);
+}
+
+status_t CameraClient::initialize(camera_module_t *module) {
+    int callingPid = getCallingPid();
+    LOG1("CameraClient::initialize E (pid %d, id %d)", callingPid, mCameraId);
+
+    char camera_device_name[10];
+    status_t res;
+    snprintf(camera_device_name, sizeof(camera_device_name), "%d", mCameraId);
+
+    mHardware = new CameraHardwareInterface(camera_device_name);
+    res = mHardware->initialize(&module->common);
+    if (res != OK) {
+        ALOGE("%s: Camera %d: unable to initialize device: %s (%d)",
+                __FUNCTION__, mCameraId, strerror(-res), res);
+        return NO_INIT;
+    }
+
+    mHardware->setCallbacks(notifyCallback,
+            dataCallback,
+            dataCallbackTimestamp,
+            (void *)mCameraId);
+
+    // Enable zoom, error, focus, and metadata messages by default
+    enableMsgType(CAMERA_MSG_ERROR | CAMERA_MSG_ZOOM | CAMERA_MSG_FOCUS |
+                  CAMERA_MSG_PREVIEW_METADATA | CAMERA_MSG_FOCUS_MOVE);
+
+    LOG1("CameraClient::initialize X (pid %d, id %d)", callingPid, mCameraId);
+    return OK;
+}
+
+
+// tear down the client
+CameraClient::~CameraClient() {
+    // this lock should never be NULL
+    Mutex* lock = mCameraService->getClientLockById(mCameraId);
+    lock->lock();
+    mDestructionStarted = true;
+    // client will not be accessed from callback. should unlock to prevent dead-lock in disconnect
+    lock->unlock();
+    int callingPid = getCallingPid();
+    LOG1("CameraClient::~CameraClient E (pid %d, this %p)", callingPid, this);
+
+    // set mClientPid to let disconnet() tear down the hardware
+    mClientPid = callingPid;
+    disconnect();
+    LOG1("CameraClient::~CameraClient X (pid %d, this %p)", callingPid, this);
+}
+
+status_t CameraClient::dump(int fd, const Vector<String16>& args) {
+    const size_t SIZE = 256;
+    char buffer[SIZE];
+
+    size_t len = snprintf(buffer, SIZE, "Client[%d] (%p) PID: %d\n",
+            mCameraId,
+            getCameraClient()->asBinder().get(),
+            mClientPid);
+    len = (len > SIZE - 1) ? SIZE - 1 : len;
+    write(fd, buffer, len);
+    return mHardware->dump(fd, args);
+}
+
+// ----------------------------------------------------------------------------
+
+status_t CameraClient::checkPid() const {
+    int callingPid = getCallingPid();
+    if (callingPid == mClientPid) return NO_ERROR;
+
+    ALOGW("attempt to use a locked camera from a different process"
+         " (old pid %d, new pid %d)", mClientPid, callingPid);
+    return EBUSY;
+}
+
+status_t CameraClient::checkPidAndHardware() const {
+    status_t result = checkPid();
+    if (result != NO_ERROR) return result;
+    if (mHardware == 0) {
+        ALOGE("attempt to use a camera after disconnect() (pid %d)", getCallingPid());
+        return INVALID_OPERATION;
+    }
+    return NO_ERROR;
+}
+
+status_t CameraClient::lock() {
+    int callingPid = getCallingPid();
+    LOG1("lock (pid %d)", callingPid);
+    Mutex::Autolock lock(mLock);
+
+    // lock camera to this client if the the camera is unlocked
+    if (mClientPid == 0) {
+        mClientPid = callingPid;
+        return NO_ERROR;
+    }
+
+    // returns NO_ERROR if the client already owns the camera, EBUSY otherwise
+    return checkPid();
+}
+
+status_t CameraClient::unlock() {
+    int callingPid = getCallingPid();
+    LOG1("unlock (pid %d)", callingPid);
+    Mutex::Autolock lock(mLock);
+
+    // allow anyone to use camera (after they lock the camera)
+    status_t result = checkPid();
+    if (result == NO_ERROR) {
+        if (mHardware->recordingEnabled()) {
+            ALOGE("Not allowed to unlock camera during recording.");
+            return INVALID_OPERATION;
+        }
+        mClientPid = 0;
+        LOG1("clear mCameraClient (pid %d)", callingPid);
+        // we need to remove the reference to ICameraClient so that when the app
+        // goes away, the reference count goes to 0.
+        mCameraClient.clear();
+    }
+    return result;
+}
+
+// connect a new client to the camera
+status_t CameraClient::connect(const sp<ICameraClient>& client) {
+    int callingPid = getCallingPid();
+    LOG1("connect E (pid %d)", callingPid);
+    Mutex::Autolock lock(mLock);
+
+    if (mClientPid != 0 && checkPid() != NO_ERROR) {
+        ALOGW("Tried to connect to a locked camera (old pid %d, new pid %d)",
+                mClientPid, callingPid);
+        return EBUSY;
+    }
+
+    if (mCameraClient != 0 && (client->asBinder() == mCameraClient->asBinder())) {
+        LOG1("Connect to the same client");
+        return NO_ERROR;
+    }
+
+    mPreviewCallbackFlag = CAMERA_FRAME_CALLBACK_FLAG_NOOP;
+    mClientPid = callingPid;
+    mCameraClient = client;
+
+    LOG1("connect X (pid %d)", callingPid);
+    return NO_ERROR;
+}
+
+static void disconnectWindow(const sp<ANativeWindow>& window) {
+    if (window != 0) {
+        status_t result = native_window_api_disconnect(window.get(),
+                NATIVE_WINDOW_API_CAMERA);
+        if (result != NO_ERROR) {
+            ALOGW("native_window_api_disconnect failed: %s (%d)", strerror(-result),
+                    result);
+        }
+    }
+}
+
+void CameraClient::disconnect() {
+    int callingPid = getCallingPid();
+    LOG1("disconnect E (pid %d)", callingPid);
+    Mutex::Autolock lock(mLock);
+
+    if (checkPid() != NO_ERROR) {
+        ALOGW("different client - don't disconnect");
+        return;
+    }
+
+    if (mClientPid <= 0) {
+        LOG1("camera is unlocked (mClientPid = %d), don't tear down hardware", mClientPid);
+        return;
+    }
+
+    // Make sure disconnect() is done once and once only, whether it is called
+    // from the user directly, or called by the destructor.
+    if (mHardware == 0) return;
+
+    LOG1("hardware teardown");
+    // Before destroying mHardware, we must make sure it's in the
+    // idle state.
+    // Turn off all messages.
+    disableMsgType(CAMERA_MSG_ALL_MSGS);
+    mHardware->stopPreview();
+    mHardware->cancelPicture();
+    // Release the hardware resources.
+    mHardware->release();
+
+    // Release the held ANativeWindow resources.
+    if (mPreviewWindow != 0) {
+        disconnectWindow(mPreviewWindow);
+        mPreviewWindow = 0;
+        mHardware->setPreviewWindow(mPreviewWindow);
+    }
+    mHardware.clear();
+
+    CameraService::Client::disconnect();
+
+    LOG1("disconnect X (pid %d)", callingPid);
+}
+
+// ----------------------------------------------------------------------------
+
+status_t CameraClient::setPreviewWindow(const sp<IBinder>& binder,
+        const sp<ANativeWindow>& window) {
+    Mutex::Autolock lock(mLock);
+    status_t result = checkPidAndHardware();
+    if (result != NO_ERROR) return result;
+
+    // return if no change in surface.
+    if (binder == mSurface) {
+        return NO_ERROR;
+    }
+
+    if (window != 0) {
+        result = native_window_api_connect(window.get(), NATIVE_WINDOW_API_CAMERA);
+        if (result != NO_ERROR) {
+            ALOGE("native_window_api_connect failed: %s (%d)", strerror(-result),
+                    result);
+            return result;
+        }
+    }
+
+    // If preview has been already started, register preview buffers now.
+    if (mHardware->previewEnabled()) {
+        if (window != 0) {
+            native_window_set_scaling_mode(window.get(),
+                    NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
+            native_window_set_buffers_transform(window.get(), mOrientation);
+            result = mHardware->setPreviewWindow(window);
+        }
+    }
+
+    if (result == NO_ERROR) {
+        // Everything has succeeded.  Disconnect the old window and remember the
+        // new window.
+        disconnectWindow(mPreviewWindow);
+        mSurface = binder;
+        mPreviewWindow = window;
+    } else {
+        // Something went wrong after we connected to the new window, so
+        // disconnect here.
+        disconnectWindow(window);
+    }
+
+    return result;
+}
+
+// set the Surface that the preview will use
+status_t CameraClient::setPreviewDisplay(const sp<Surface>& surface) {
+    LOG1("setPreviewDisplay(%p) (pid %d)", surface.get(), getCallingPid());
+
+    sp<IBinder> binder(surface != 0 ? surface->asBinder() : 0);
+    sp<ANativeWindow> window(surface);
+    return setPreviewWindow(binder, window);
+}
+
+// set the SurfaceTexture that the preview will use
+status_t CameraClient::setPreviewTexture(
+        const sp<ISurfaceTexture>& surfaceTexture) {
+    LOG1("setPreviewTexture(%p) (pid %d)", surfaceTexture.get(),
+            getCallingPid());
+
+    sp<IBinder> binder;
+    sp<ANativeWindow> window;
+    if (surfaceTexture != 0) {
+        binder = surfaceTexture->asBinder();
+        window = new SurfaceTextureClient(surfaceTexture);
+    }
+    return setPreviewWindow(binder, window);
+}
+
+// set the preview callback flag to affect how the received frames from
+// preview are handled.
+void CameraClient::setPreviewCallbackFlag(int callback_flag) {
+    LOG1("setPreviewCallbackFlag(%d) (pid %d)", callback_flag, getCallingPid());
+    Mutex::Autolock lock(mLock);
+    if (checkPidAndHardware() != NO_ERROR) return;
+
+    mPreviewCallbackFlag = callback_flag;
+    if (mPreviewCallbackFlag & CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK) {
+        enableMsgType(CAMERA_MSG_PREVIEW_FRAME);
+    } else {
+        disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
+    }
+}
+
+// start preview mode
+status_t CameraClient::startPreview() {
+    LOG1("startPreview (pid %d)", getCallingPid());
+    return startCameraMode(CAMERA_PREVIEW_MODE);
+}
+
+// start recording mode
+status_t CameraClient::startRecording() {
+    LOG1("startRecording (pid %d)", getCallingPid());
+    return startCameraMode(CAMERA_RECORDING_MODE);
+}
+
+// start preview or recording
+status_t CameraClient::startCameraMode(camera_mode mode) {
+    LOG1("startCameraMode(%d)", mode);
+    Mutex::Autolock lock(mLock);
+    status_t result = checkPidAndHardware();
+    if (result != NO_ERROR) return result;
+
+    switch(mode) {
+        case CAMERA_PREVIEW_MODE:
+            if (mSurface == 0 && mPreviewWindow == 0) {
+                LOG1("mSurface is not set yet.");
+                // still able to start preview in this case.
+            }
+            return startPreviewMode();
+        case CAMERA_RECORDING_MODE:
+            if (mSurface == 0 && mPreviewWindow == 0) {
+                ALOGE("mSurface or mPreviewWindow must be set before startRecordingMode.");
+                return INVALID_OPERATION;
+            }
+            return startRecordingMode();
+        default:
+            return UNKNOWN_ERROR;
+    }
+}
+
+status_t CameraClient::startPreviewMode() {
+    LOG1("startPreviewMode");
+    status_t result = NO_ERROR;
+
+    // if preview has been enabled, nothing needs to be done
+    if (mHardware->previewEnabled()) {
+        return NO_ERROR;
+    }
+
+    if (mPreviewWindow != 0) {
+        native_window_set_scaling_mode(mPreviewWindow.get(),
+                NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
+        native_window_set_buffers_transform(mPreviewWindow.get(),
+                mOrientation);
+    }
+    mHardware->setPreviewWindow(mPreviewWindow);
+    result = mHardware->startPreview();
+
+    return result;
+}
+
+status_t CameraClient::startRecordingMode() {
+    LOG1("startRecordingMode");
+    status_t result = NO_ERROR;
+
+    // if recording has been enabled, nothing needs to be done
+    if (mHardware->recordingEnabled()) {
+        return NO_ERROR;
+    }
+
+    // if preview has not been started, start preview first
+    if (!mHardware->previewEnabled()) {
+        result = startPreviewMode();
+        if (result != NO_ERROR) {
+            return result;
+        }
+    }
+
+    // start recording mode
+    enableMsgType(CAMERA_MSG_VIDEO_FRAME);
+    mCameraService->playSound(CameraService::SOUND_RECORDING);
+    result = mHardware->startRecording();
+    if (result != NO_ERROR) {
+        ALOGE("mHardware->startRecording() failed with status %d", result);
+    }
+    return result;
+}
+
+// stop preview mode
+void CameraClient::stopPreview() {
+    LOG1("stopPreview (pid %d)", getCallingPid());
+    Mutex::Autolock lock(mLock);
+    if (checkPidAndHardware() != NO_ERROR) return;
+
+
+    disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
+    mHardware->stopPreview();
+
+    mPreviewBuffer.clear();
+}
+
+// stop recording mode
+void CameraClient::stopRecording() {
+    LOG1("stopRecording (pid %d)", getCallingPid());
+    Mutex::Autolock lock(mLock);
+    if (checkPidAndHardware() != NO_ERROR) return;
+
+    disableMsgType(CAMERA_MSG_VIDEO_FRAME);
+    mHardware->stopRecording();
+    mCameraService->playSound(CameraService::SOUND_RECORDING);
+
+    mPreviewBuffer.clear();
+}
+
+// release a recording frame
+void CameraClient::releaseRecordingFrame(const sp<IMemory>& mem) {
+    Mutex::Autolock lock(mLock);
+    if (checkPidAndHardware() != NO_ERROR) return;
+    mHardware->releaseRecordingFrame(mem);
+}
+
+status_t CameraClient::storeMetaDataInBuffers(bool enabled)
+{
+    LOG1("storeMetaDataInBuffers: %s", enabled? "true": "false");
+    Mutex::Autolock lock(mLock);
+    if (checkPidAndHardware() != NO_ERROR) {
+        return UNKNOWN_ERROR;
+    }
+    return mHardware->storeMetaDataInBuffers(enabled);
+}
+
+bool CameraClient::previewEnabled() {
+    LOG1("previewEnabled (pid %d)", getCallingPid());
+
+    Mutex::Autolock lock(mLock);
+    if (checkPidAndHardware() != NO_ERROR) return false;
+    return mHardware->previewEnabled();
+}
+
+bool CameraClient::recordingEnabled() {
+    LOG1("recordingEnabled (pid %d)", getCallingPid());
+
+    Mutex::Autolock lock(mLock);
+    if (checkPidAndHardware() != NO_ERROR) return false;
+    return mHardware->recordingEnabled();
+}
+
+status_t CameraClient::autoFocus() {
+    LOG1("autoFocus (pid %d)", getCallingPid());
+
+    Mutex::Autolock lock(mLock);
+    status_t result = checkPidAndHardware();
+    if (result != NO_ERROR) return result;
+
+    return mHardware->autoFocus();
+}
+
+status_t CameraClient::cancelAutoFocus() {
+    LOG1("cancelAutoFocus (pid %d)", getCallingPid());
+
+    Mutex::Autolock lock(mLock);
+    status_t result = checkPidAndHardware();
+    if (result != NO_ERROR) return result;
+
+    return mHardware->cancelAutoFocus();
+}
+
+// take a picture - image is returned in callback
+status_t CameraClient::takePicture(int msgType) {
+    LOG1("takePicture (pid %d): 0x%x", getCallingPid(), msgType);
+
+    Mutex::Autolock lock(mLock);
+    status_t result = checkPidAndHardware();
+    if (result != NO_ERROR) return result;
+
+    if ((msgType & CAMERA_MSG_RAW_IMAGE) &&
+        (msgType & CAMERA_MSG_RAW_IMAGE_NOTIFY)) {
+        ALOGE("CAMERA_MSG_RAW_IMAGE and CAMERA_MSG_RAW_IMAGE_NOTIFY"
+                " cannot be both enabled");
+        return BAD_VALUE;
+    }
+
+    // We only accept picture related message types
+    // and ignore other types of messages for takePicture().
+    int picMsgType = msgType
+                        & (CAMERA_MSG_SHUTTER |
+                           CAMERA_MSG_POSTVIEW_FRAME |
+                           CAMERA_MSG_RAW_IMAGE |
+                           CAMERA_MSG_RAW_IMAGE_NOTIFY |
+                           CAMERA_MSG_COMPRESSED_IMAGE);
+
+    enableMsgType(picMsgType);
+
+    return mHardware->takePicture();
+}
+
+// set preview/capture parameters - key/value pairs
+status_t CameraClient::setParameters(const String8& params) {
+    LOG1("setParameters (pid %d) (%s)", getCallingPid(), params.string());
+
+    Mutex::Autolock lock(mLock);
+    status_t result = checkPidAndHardware();
+    if (result != NO_ERROR) return result;
+
+    CameraParameters p(params);
+    return mHardware->setParameters(p);
+}
+
+// get preview/capture parameters - key/value pairs
+String8 CameraClient::getParameters() const {
+    Mutex::Autolock lock(mLock);
+    if (checkPidAndHardware() != NO_ERROR) return String8();
+
+    String8 params(mHardware->getParameters().flatten());
+    LOG1("getParameters (pid %d) (%s)", getCallingPid(), params.string());
+    return params;
+}
+
+// enable shutter sound
+status_t CameraClient::enableShutterSound(bool enable) {
+    LOG1("enableShutterSound (pid %d)", getCallingPid());
+
+    status_t result = checkPidAndHardware();
+    if (result != NO_ERROR) return result;
+
+    if (enable) {
+        mPlayShutterSound = true;
+        return OK;
+    }
+
+    // Disabling shutter sound may not be allowed. In that case only
+    // allow the mediaserver process to disable the sound.
+    char value[PROPERTY_VALUE_MAX];
+    property_get("ro.camera.sound.forced", value, "0");
+    if (strcmp(value, "0") != 0) {
+        // Disabling shutter sound is not allowed. Deny if the current
+        // process is not mediaserver.
+        if (getCallingPid() != getpid()) {
+            ALOGE("Failed to disable shutter sound. Permission denied (pid %d)", getCallingPid());
+            return PERMISSION_DENIED;
+        }
+    }
+
+    mPlayShutterSound = false;
+    return OK;
+}
+
+status_t CameraClient::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
+    LOG1("sendCommand (pid %d)", getCallingPid());
+    int orientation;
+    Mutex::Autolock lock(mLock);
+    status_t result = checkPidAndHardware();
+    if (result != NO_ERROR) return result;
+
+    if (cmd == CAMERA_CMD_SET_DISPLAY_ORIENTATION) {
+        // Mirror the preview if the camera is front-facing.
+        orientation = getOrientation(arg1, mCameraFacing == CAMERA_FACING_FRONT);
+        if (orientation == -1) return BAD_VALUE;
+
+        if (mOrientation != orientation) {
+            mOrientation = orientation;
+            if (mPreviewWindow != 0) {
+                native_window_set_buffers_transform(mPreviewWindow.get(),
+                        mOrientation);
+            }
+        }
+        return OK;
+    } else if (cmd == CAMERA_CMD_ENABLE_SHUTTER_SOUND) {
+        switch (arg1) {
+            case 0:
+                enableShutterSound(false);
+                break;
+            case 1:
+                enableShutterSound(true);
+                break;
+            default:
+                return BAD_VALUE;
+        }
+        return OK;
+    } else if (cmd == CAMERA_CMD_PLAY_RECORDING_SOUND) {
+        mCameraService->playSound(CameraService::SOUND_RECORDING);
+    } else if (cmd == CAMERA_CMD_SET_VIDEO_BUFFER_COUNT) {
+        // Silently ignore this command
+        return INVALID_OPERATION;
+    } else if (cmd == CAMERA_CMD_PING) {
+        // If mHardware is 0, checkPidAndHardware will return error.
+        return OK;
+    }
+
+    return mHardware->sendCommand(cmd, arg1, arg2);
+}
+
+// ----------------------------------------------------------------------------
+
+void CameraClient::enableMsgType(int32_t msgType) {
+    android_atomic_or(msgType, &mMsgEnabled);
+    mHardware->enableMsgType(msgType);
+}
+
+void CameraClient::disableMsgType(int32_t msgType) {
+    android_atomic_and(~msgType, &mMsgEnabled);
+    mHardware->disableMsgType(msgType);
+}
+
+#define CHECK_MESSAGE_INTERVAL 10 // 10ms
+bool CameraClient::lockIfMessageWanted(int32_t msgType) {
+    int sleepCount = 0;
+    while (mMsgEnabled & msgType) {
+        if (mLock.tryLock() == NO_ERROR) {
+            if (sleepCount > 0) {
+                LOG1("lockIfMessageWanted(%d): waited for %d ms",
+                    msgType, sleepCount * CHECK_MESSAGE_INTERVAL);
+            }
+            return true;
+        }
+        if (sleepCount++ == 0) {
+            LOG1("lockIfMessageWanted(%d): enter sleep", msgType);
+        }
+        usleep(CHECK_MESSAGE_INTERVAL * 1000);
+    }
+    ALOGW("lockIfMessageWanted(%d): dropped unwanted message", msgType);
+    return false;
+}
+
+// Callback messages can be dispatched to internal handlers or pass to our
+// client's callback functions, depending on the message type.
+//
+// notifyCallback:
+//      CAMERA_MSG_SHUTTER              handleShutter
+//      (others)                        c->notifyCallback
+// dataCallback:
+//      CAMERA_MSG_PREVIEW_FRAME        handlePreviewData
+//      CAMERA_MSG_POSTVIEW_FRAME       handlePostview
+//      CAMERA_MSG_RAW_IMAGE            handleRawPicture
+//      CAMERA_MSG_COMPRESSED_IMAGE     handleCompressedPicture
+//      (others)                        c->dataCallback
+// dataCallbackTimestamp
+//      (others)                        c->dataCallbackTimestamp
+//
+// NOTE: the *Callback functions grab mLock of the client before passing
+// control to handle* functions. So the handle* functions must release the
+// lock before calling the ICameraClient's callbacks, so those callbacks can
+// invoke methods in the Client class again (For example, the preview frame
+// callback may want to releaseRecordingFrame). The handle* functions must
+// release the lock after all accesses to member variables, so it must be
+// handled very carefully.
+
+void CameraClient::notifyCallback(int32_t msgType, int32_t ext1,
+        int32_t ext2, void* user) {
+    LOG2("notifyCallback(%d)", msgType);
+
+    Mutex* lock = getClientLockFromCookie(user);
+    if (lock == NULL) return;
+    Mutex::Autolock alock(*lock);
+
+    CameraClient* client =
+            static_cast<CameraClient*>(getClientFromCookie(user));
+    if (client == NULL) return;
+
+    if (!client->lockIfMessageWanted(msgType)) return;
+
+    switch (msgType) {
+        case CAMERA_MSG_SHUTTER:
+            // ext1 is the dimension of the yuv picture.
+            client->handleShutter();
+            break;
+        default:
+            client->handleGenericNotify(msgType, ext1, ext2);
+            break;
+    }
+}
+
+void CameraClient::dataCallback(int32_t msgType,
+        const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata, void* user) {
+    LOG2("dataCallback(%d)", msgType);
+
+    Mutex* lock = getClientLockFromCookie(user);
+    if (lock == NULL) return;
+    Mutex::Autolock alock(*lock);
+
+    CameraClient* client =
+            static_cast<CameraClient*>(getClientFromCookie(user));
+    if (client == NULL) return;
+
+    if (!client->lockIfMessageWanted(msgType)) return;
+    if (dataPtr == 0 && metadata == NULL) {
+        ALOGE("Null data returned in data callback");
+        client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
+        return;
+    }
+
+    switch (msgType & ~CAMERA_MSG_PREVIEW_METADATA) {
+        case CAMERA_MSG_PREVIEW_FRAME:
+            client->handlePreviewData(msgType, dataPtr, metadata);
+            break;
+        case CAMERA_MSG_POSTVIEW_FRAME:
+            client->handlePostview(dataPtr);
+            break;
+        case CAMERA_MSG_RAW_IMAGE:
+            client->handleRawPicture(dataPtr);
+            break;
+        case CAMERA_MSG_COMPRESSED_IMAGE:
+            client->handleCompressedPicture(dataPtr);
+            break;
+        default:
+            client->handleGenericData(msgType, dataPtr, metadata);
+            break;
+    }
+}
+
+void CameraClient::dataCallbackTimestamp(nsecs_t timestamp,
+        int32_t msgType, const sp<IMemory>& dataPtr, void* user) {
+    LOG2("dataCallbackTimestamp(%d)", msgType);
+
+    Mutex* lock = getClientLockFromCookie(user);
+    if (lock == NULL) return;
+    Mutex::Autolock alock(*lock);
+
+    CameraClient* client =
+            static_cast<CameraClient*>(getClientFromCookie(user));
+    if (client == NULL) return;
+
+    if (!client->lockIfMessageWanted(msgType)) return;
+
+    if (dataPtr == 0) {
+        ALOGE("Null data returned in data with timestamp callback");
+        client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
+        return;
+    }
+
+    client->handleGenericDataTimestamp(timestamp, msgType, dataPtr);
+}
+
+// snapshot taken callback
+void CameraClient::handleShutter(void) {
+    if (mPlayShutterSound) {
+        mCameraService->playSound(CameraService::SOUND_SHUTTER);
+    }
+
+    sp<ICameraClient> c = mCameraClient;
+    if (c != 0) {
+        mLock.unlock();
+        c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
+        if (!lockIfMessageWanted(CAMERA_MSG_SHUTTER)) return;
+    }
+    disableMsgType(CAMERA_MSG_SHUTTER);
+
+    mLock.unlock();
+}
+
+// preview callback - frame buffer update
+void CameraClient::handlePreviewData(int32_t msgType,
+                                              const sp<IMemory>& mem,
+                                              camera_frame_metadata_t *metadata) {
+    ssize_t offset;
+    size_t size;
+    sp<IMemoryHeap> heap = mem->getMemory(&offset, &size);
+
+    // local copy of the callback flags
+    int flags = mPreviewCallbackFlag;
+
+    // is callback enabled?
+    if (!(flags & CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK)) {
+        // If the enable bit is off, the copy-out and one-shot bits are ignored
+        LOG2("frame callback is disabled");
+        mLock.unlock();
+        return;
+    }
+
+    // hold a strong pointer to the client
+    sp<ICameraClient> c = mCameraClient;
+
+    // clear callback flags if no client or one-shot mode
+    if (c == 0 || (mPreviewCallbackFlag & CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK)) {
+        LOG2("Disable preview callback");
+        mPreviewCallbackFlag &= ~(CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK |
+                                  CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK |
+                                  CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK);
+        disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
+    }
+
+    if (c != 0) {
+        // Is the received frame copied out or not?
+        if (flags & CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK) {
+            LOG2("frame is copied");
+            copyFrameAndPostCopiedFrame(msgType, c, heap, offset, size, metadata);
+        } else {
+            LOG2("frame is forwarded");
+            mLock.unlock();
+            c->dataCallback(msgType, mem, metadata);
+        }
+    } else {
+        mLock.unlock();
+    }
+}
+
+// picture callback - postview image ready
+void CameraClient::handlePostview(const sp<IMemory>& mem) {
+    disableMsgType(CAMERA_MSG_POSTVIEW_FRAME);
+
+    sp<ICameraClient> c = mCameraClient;
+    mLock.unlock();
+    if (c != 0) {
+        c->dataCallback(CAMERA_MSG_POSTVIEW_FRAME, mem, NULL);
+    }
+}
+
+// picture callback - raw image ready
+void CameraClient::handleRawPicture(const sp<IMemory>& mem) {
+    disableMsgType(CAMERA_MSG_RAW_IMAGE);
+
+    ssize_t offset;
+    size_t size;
+    sp<IMemoryHeap> heap = mem->getMemory(&offset, &size);
+
+    sp<ICameraClient> c = mCameraClient;
+    mLock.unlock();
+    if (c != 0) {
+        c->dataCallback(CAMERA_MSG_RAW_IMAGE, mem, NULL);
+    }
+}
+
+// picture callback - compressed picture ready
+void CameraClient::handleCompressedPicture(const sp<IMemory>& mem) {
+    disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE);
+
+    sp<ICameraClient> c = mCameraClient;
+    mLock.unlock();
+    if (c != 0) {
+        c->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, mem, NULL);
+    }
+}
+
+
+void CameraClient::handleGenericNotify(int32_t msgType,
+    int32_t ext1, int32_t ext2) {
+    sp<ICameraClient> c = mCameraClient;
+    mLock.unlock();
+    if (c != 0) {
+        c->notifyCallback(msgType, ext1, ext2);
+    }
+}
+
+void CameraClient::handleGenericData(int32_t msgType,
+    const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata) {
+    sp<ICameraClient> c = mCameraClient;
+    mLock.unlock();
+    if (c != 0) {
+        c->dataCallback(msgType, dataPtr, metadata);
+    }
+}
+
+void CameraClient::handleGenericDataTimestamp(nsecs_t timestamp,
+    int32_t msgType, const sp<IMemory>& dataPtr) {
+    sp<ICameraClient> c = mCameraClient;
+    mLock.unlock();
+    if (c != 0) {
+        c->dataCallbackTimestamp(timestamp, msgType, dataPtr);
+    }
+}
+
+void CameraClient::copyFrameAndPostCopiedFrame(
+        int32_t msgType, const sp<ICameraClient>& client,
+        const sp<IMemoryHeap>& heap, size_t offset, size_t size,
+        camera_frame_metadata_t *metadata) {
+    LOG2("copyFrameAndPostCopiedFrame");
+    // It is necessary to copy out of pmem before sending this to
+    // the callback. For efficiency, reuse the same MemoryHeapBase
+    // provided it's big enough. Don't allocate the memory or
+    // perform the copy if there's no callback.
+    // hold the preview lock while we grab a reference to the preview buffer
+    sp<MemoryHeapBase> previewBuffer;
+
+    if (mPreviewBuffer == 0) {
+        mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
+    } else if (size > mPreviewBuffer->virtualSize()) {
+        mPreviewBuffer.clear();
+        mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
+    }
+    if (mPreviewBuffer == 0) {
+        ALOGE("failed to allocate space for preview buffer");
+        mLock.unlock();
+        return;
+    }
+    previewBuffer = mPreviewBuffer;
+
+    memcpy(previewBuffer->base(), (uint8_t *)heap->base() + offset, size);
+
+    sp<MemoryBase> frame = new MemoryBase(previewBuffer, 0, size);
+    if (frame == 0) {
+        ALOGE("failed to allocate space for frame callback");
+        mLock.unlock();
+        return;
+    }
+
+    mLock.unlock();
+    client->dataCallback(msgType, frame, metadata);
+}
+
+int CameraClient::getOrientation(int degrees, bool mirror) {
+    if (!mirror) {
+        if (degrees == 0) return 0;
+        else if (degrees == 90) return HAL_TRANSFORM_ROT_90;
+        else if (degrees == 180) return HAL_TRANSFORM_ROT_180;
+        else if (degrees == 270) return HAL_TRANSFORM_ROT_270;
+    } else {  // Do mirror (horizontal flip)
+        if (degrees == 0) {           // FLIP_H and ROT_0
+            return HAL_TRANSFORM_FLIP_H;
+        } else if (degrees == 90) {   // FLIP_H and ROT_90
+            return HAL_TRANSFORM_FLIP_H | HAL_TRANSFORM_ROT_90;
+        } else if (degrees == 180) {  // FLIP_H and ROT_180
+            return HAL_TRANSFORM_FLIP_V;
+        } else if (degrees == 270) {  // FLIP_H and ROT_270
+            return HAL_TRANSFORM_FLIP_V | HAL_TRANSFORM_ROT_90;
+        }
+    }
+    ALOGE("Invalid setDisplayOrientation degrees=%d", degrees);
+    return -1;
+}
+
+}; // namespace android
diff --git a/services/camera/libcameraservice/CameraClient.h b/services/camera/libcameraservice/CameraClient.h
new file mode 100644
index 0000000..256298d
--- /dev/null
+++ b/services/camera/libcameraservice/CameraClient.h
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SERVERS_CAMERA_CAMERACLIENT_H
+#define ANDROID_SERVERS_CAMERA_CAMERACLIENT_H
+
+#include "CameraService.h"
+
+namespace android {
+
+class MemoryHeapBase;
+class CameraHardwareInterface;
+
+class CameraClient : public CameraService::Client
+{
+public:
+    // ICamera interface (see ICamera for details)
+    virtual void            disconnect();
+    virtual status_t        connect(const sp<ICameraClient>& client);
+    virtual status_t        lock();
+    virtual status_t        unlock();
+    virtual status_t        setPreviewDisplay(const sp<Surface>& surface);
+    virtual status_t        setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture);
+    virtual void            setPreviewCallbackFlag(int flag);
+    virtual status_t        startPreview();
+    virtual void            stopPreview();
+    virtual bool            previewEnabled();
+    virtual status_t        storeMetaDataInBuffers(bool enabled);
+    virtual status_t        startRecording();
+    virtual void            stopRecording();
+    virtual bool            recordingEnabled();
+    virtual void            releaseRecordingFrame(const sp<IMemory>& mem);
+    virtual status_t        autoFocus();
+    virtual status_t        cancelAutoFocus();
+    virtual status_t        takePicture(int msgType);
+    virtual status_t        setParameters(const String8& params);
+    virtual String8         getParameters() const;
+    virtual status_t        sendCommand(int32_t cmd, int32_t arg1, int32_t arg2);
+
+    // Interface used by CameraService
+    CameraClient(const sp<CameraService>& cameraService,
+            const sp<ICameraClient>& cameraClient,
+            int cameraId,
+            int cameraFacing,
+            int clientPid);
+    ~CameraClient();
+
+    status_t initialize(camera_module_t *module);
+
+    status_t dump(int fd, const Vector<String16>& args);
+
+private:
+
+    // check whether the calling process matches mClientPid.
+    status_t                checkPid() const;
+    status_t                checkPidAndHardware() const;  // also check mHardware != 0
+
+    // these are internal functions used to set up preview buffers
+    status_t                registerPreviewBuffers();
+
+    // camera operation mode
+    enum camera_mode {
+        CAMERA_PREVIEW_MODE   = 0,  // frame automatically released
+        CAMERA_RECORDING_MODE = 1,  // frame has to be explicitly released by releaseRecordingFrame()
+    };
+    // these are internal functions used for preview/recording
+    status_t                startCameraMode(camera_mode mode);
+    status_t                startPreviewMode();
+    status_t                startRecordingMode();
+
+    // internal function used by sendCommand to enable/disable shutter sound.
+    status_t                enableShutterSound(bool enable);
+
+    // these are static callback functions
+    static void             notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2, void* user);
+    static void             dataCallback(int32_t msgType, const sp<IMemory>& dataPtr,
+            camera_frame_metadata_t *metadata, void* user);
+    static void             dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr, void* user);
+    // handlers for messages
+    void                    handleShutter(void);
+    void                    handlePreviewData(int32_t msgType, const sp<IMemory>& mem,
+            camera_frame_metadata_t *metadata);
+    void                    handlePostview(const sp<IMemory>& mem);
+    void                    handleRawPicture(const sp<IMemory>& mem);
+    void                    handleCompressedPicture(const sp<IMemory>& mem);
+    void                    handleGenericNotify(int32_t msgType, int32_t ext1, int32_t ext2);
+    void                    handleGenericData(int32_t msgType, const sp<IMemory>& dataPtr,
+            camera_frame_metadata_t *metadata);
+    void                    handleGenericDataTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr);
+
+    void                    copyFrameAndPostCopiedFrame(
+        int32_t msgType,
+        const sp<ICameraClient>& client,
+        const sp<IMemoryHeap>& heap,
+        size_t offset, size_t size,
+        camera_frame_metadata_t *metadata);
+
+    int                     getOrientation(int orientation, bool mirror);
+
+    status_t                setPreviewWindow(
+        const sp<IBinder>& binder,
+        const sp<ANativeWindow>& window);
+
+
+    // these are initialized in the constructor.
+    sp<CameraHardwareInterface>     mHardware;       // cleared after disconnect()
+    int                             mPreviewCallbackFlag;
+    int                             mOrientation;     // Current display orientation
+    bool                            mPlayShutterSound;
+
+    // Ensures atomicity among the public methods
+    mutable Mutex                   mLock;
+    // This is a binder of Surface or SurfaceTexture.
+    sp<IBinder>                     mSurface;
+    sp<ANativeWindow>               mPreviewWindow;
+
+    // If the user want us to return a copy of the preview frame (instead
+    // of the original one), we allocate mPreviewBuffer and reuse it if possible.
+    sp<MemoryHeapBase>              mPreviewBuffer;
+
+    // We need to avoid the deadlock when the incoming command thread and
+    // the CameraHardwareInterface callback thread both want to grab mLock.
+    // An extra flag is used to tell the callback thread that it should stop
+    // trying to deliver the callback messages if the client is not
+    // interested in it anymore. For example, if the client is calling
+    // stopPreview(), the preview frame messages do not need to be delivered
+    // anymore.
+
+    // This function takes the same parameter as the enableMsgType() and
+    // disableMsgType() functions in CameraHardwareInterface.
+    void                    enableMsgType(int32_t msgType);
+    void                    disableMsgType(int32_t msgType);
+    volatile int32_t        mMsgEnabled;
+
+    // This function keeps trying to grab mLock, or give up if the message
+    // is found to be disabled. It returns true if mLock is grabbed.
+    bool                    lockIfMessageWanted(int32_t msgType);
+};
+
+}
+
+#endif
diff --git a/services/camera/libcameraservice/CameraHardwareInterface.h b/services/camera/libcameraservice/CameraHardwareInterface.h
index 87a0802..05ac9fa 100644
--- a/services/camera/libcameraservice/CameraHardwareInterface.h
+++ b/services/camera/libcameraservice/CameraHardwareInterface.h
@@ -569,7 +569,7 @@
         int rc;
         ANativeWindow *a = anw(w);
         ANativeWindowBuffer* anb;
-        rc = a->dequeueBuffer(a, &anb);
+        rc = native_window_dequeue_buffer_and_wait(a, &anb);
         if (!rc) {
             *buffer = &anb->handle;
             *stride = anb->stride;
@@ -587,8 +587,7 @@
                       buffer_handle_t* buffer)
     {
         ANativeWindow *a = anw(w);
-        return a->lockBuffer(a,
-                  container_of(buffer, ANativeWindowBuffer, handle));
+        return 0;
     }
 
     static int __enqueue_buffer(struct preview_stream_ops* w,
@@ -596,7 +595,7 @@
     {
         ANativeWindow *a = anw(w);
         return a->queueBuffer(a,
-                  container_of(buffer, ANativeWindowBuffer, handle));
+                  container_of(buffer, ANativeWindowBuffer, handle), -1);
     }
 
     static int __cancel_buffer(struct preview_stream_ops* w,
@@ -604,7 +603,7 @@
     {
         ANativeWindow *a = anw(w);
         return a->cancelBuffer(a,
-                  container_of(buffer, ANativeWindowBuffer, handle));
+                  container_of(buffer, ANativeWindowBuffer, handle), -1);
     }
 
     static int __set_buffer_count(struct preview_stream_ops* w, int count)
diff --git a/services/camera/libcameraservice/CameraHardwareStub.cpp b/services/camera/libcameraservice/CameraHardwareStub.cpp
deleted file mode 100644
index cdfb2f5..0000000
--- a/services/camera/libcameraservice/CameraHardwareStub.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
-**
-** Copyright 2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
-
-#define LOG_TAG "CameraHardwareStub"
-#include <utils/Log.h>
-
-#include "CameraHardwareStub.h"
-#include <utils/threads.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#include "CannedJpeg.h"
-
-namespace android {
-
-CameraHardwareStub::CameraHardwareStub()
-                  : mParameters(),
-                    mPreviewHeap(0),
-                    mRawHeap(0),
-                    mFakeCamera(0),
-                    mPreviewFrameSize(0),
-                    mNotifyCb(0),
-                    mDataCb(0),
-                    mDataCbTimestamp(0),
-                    mCallbackCookie(0),
-                    mMsgEnabled(0),
-                    mCurrentPreviewFrame(0)
-{
-    initDefaultParameters();
-}
-
-void CameraHardwareStub::initDefaultParameters()
-{
-    CameraParameters p;
-
-    p.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, "320x240");
-    p.setPreviewSize(320, 240);
-    p.setPreviewFrameRate(15);
-    p.setPreviewFormat(CameraParameters::PIXEL_FORMAT_YUV420SP);
-
-    p.set(CameraParameters::KEY_SUPPORTED_PICTURE_SIZES, "320x240");
-    p.setPictureSize(320, 240);
-    p.setPictureFormat(CameraParameters::PIXEL_FORMAT_JPEG);
-
-    if (setParameters(p) != NO_ERROR) {
-        ALOGE("Failed to set default parameters?!");
-    }
-}
-
-void CameraHardwareStub::initHeapLocked()
-{
-    // Create raw heap.
-    int picture_width, picture_height;
-    mParameters.getPictureSize(&picture_width, &picture_height);
-    mRawHeap = new MemoryHeapBase(picture_width * picture_height * 3 / 2);
-
-    int preview_width, preview_height;
-    mParameters.getPreviewSize(&preview_width, &preview_height);
-    ALOGD("initHeapLocked: preview size=%dx%d", preview_width, preview_height);
-
-    // Note that we enforce yuv420sp in setParameters().
-    int how_big = preview_width * preview_height * 3 / 2;
-
-    // If we are being reinitialized to the same size as before, no
-    // work needs to be done.
-    if (how_big == mPreviewFrameSize)
-        return;
-
-    mPreviewFrameSize = how_big;
-
-    // Make a new mmap'ed heap that can be shared across processes.
-    // use code below to test with pmem
-    mPreviewHeap = new MemoryHeapBase(mPreviewFrameSize * kBufferCount);
-    // Make an IMemory for each frame so that we can reuse them in callbacks.
-    for (int i = 0; i < kBufferCount; i++) {
-        mBuffers[i] = new MemoryBase(mPreviewHeap, i * mPreviewFrameSize, mPreviewFrameSize);
-    }
-
-    // Recreate the fake camera to reflect the current size.
-    delete mFakeCamera;
-    mFakeCamera = new FakeCamera(preview_width, preview_height);
-}
-
-CameraHardwareStub::~CameraHardwareStub()
-{
-    delete mFakeCamera;
-    mFakeCamera = 0; // paranoia
-}
-
-status_t CameraHardwareStub::setPreviewWindow(const sp<ANativeWindow>& buf)
-{
-    return NO_ERROR;
-}
-
-sp<IMemoryHeap> CameraHardwareStub::getRawHeap() const
-{
-    return mRawHeap;
-}
-
-void CameraHardwareStub::setCallbacks(notify_callback notify_cb,
-                                      data_callback data_cb,
-                                      data_callback_timestamp data_cb_timestamp,
-                                      void* user)
-{
-    Mutex::Autolock lock(mLock);
-    mNotifyCb = notify_cb;
-    mDataCb = data_cb;
-    mDataCbTimestamp = data_cb_timestamp;
-    mCallbackCookie = user;
-}
-
-void CameraHardwareStub::enableMsgType(int32_t msgType)
-{
-    Mutex::Autolock lock(mLock);
-    mMsgEnabled |= msgType;
-}
-
-void CameraHardwareStub::disableMsgType(int32_t msgType)
-{
-    Mutex::Autolock lock(mLock);
-    mMsgEnabled &= ~msgType;
-}
-
-bool CameraHardwareStub::msgTypeEnabled(int32_t msgType)
-{
-    Mutex::Autolock lock(mLock);
-    return (mMsgEnabled & msgType);
-}
-
-// ---------------------------------------------------------------------------
-
-int CameraHardwareStub::previewThread()
-{
-    mLock.lock();
-        // the attributes below can change under our feet...
-
-        int previewFrameRate = mParameters.getPreviewFrameRate();
-
-        // Find the offset within the heap of the current buffer.
-        ssize_t offset = mCurrentPreviewFrame * mPreviewFrameSize;
-
-        sp<MemoryHeapBase> heap = mPreviewHeap;
-
-        // this assumes the internal state of fake camera doesn't change
-        // (or is thread safe)
-        FakeCamera* fakeCamera = mFakeCamera;
-
-        sp<MemoryBase> buffer = mBuffers[mCurrentPreviewFrame];
-
-    mLock.unlock();
-
-    // TODO: here check all the conditions that could go wrong
-    if (buffer != 0) {
-        // Calculate how long to wait between frames.
-        int delay = (int)(1000000.0f / float(previewFrameRate));
-
-        // This is always valid, even if the client died -- the memory
-        // is still mapped in our process.
-        void *base = heap->base();
-
-        // Fill the current frame with the fake camera.
-        uint8_t *frame = ((uint8_t *)base) + offset;
-        fakeCamera->getNextFrameAsYuv420(frame);
-
-        //ALOGV("previewThread: generated frame to buffer %d", mCurrentPreviewFrame);
-
-        // Notify the client of a new frame.
-        if (mMsgEnabled & CAMERA_MSG_PREVIEW_FRAME)
-            mDataCb(CAMERA_MSG_PREVIEW_FRAME, buffer, NULL, mCallbackCookie);
-
-        // Advance the buffer pointer.
-        mCurrentPreviewFrame = (mCurrentPreviewFrame + 1) % kBufferCount;
-
-        // Wait for it...
-        usleep(delay);
-    }
-
-    return NO_ERROR;
-}
-
-status_t CameraHardwareStub::startPreview()
-{
-    Mutex::Autolock lock(mLock);
-    if (mPreviewThread != 0) {
-        // already running
-        return INVALID_OPERATION;
-    }
-    mPreviewThread = new PreviewThread(this);
-    return NO_ERROR;
-}
-
-void CameraHardwareStub::stopPreview()
-{
-    sp<PreviewThread> previewThread;
-
-    { // scope for the lock
-        Mutex::Autolock lock(mLock);
-        previewThread = mPreviewThread;
-    }
-
-    // don't hold the lock while waiting for the thread to quit
-    if (previewThread != 0) {
-        previewThread->requestExitAndWait();
-    }
-
-    Mutex::Autolock lock(mLock);
-    mPreviewThread.clear();
-}
-
-bool CameraHardwareStub::previewEnabled() {
-    return mPreviewThread != 0;
-}
-
-status_t CameraHardwareStub::startRecording()
-{
-    return UNKNOWN_ERROR;
-}
-
-void CameraHardwareStub::stopRecording()
-{
-}
-
-bool CameraHardwareStub::recordingEnabled()
-{
-    return false;
-}
-
-void CameraHardwareStub::releaseRecordingFrame(const sp<IMemory>& mem)
-{
-}
-
-// ---------------------------------------------------------------------------
-
-int CameraHardwareStub::beginAutoFocusThread(void *cookie)
-{
-    CameraHardwareStub *c = (CameraHardwareStub *)cookie;
-    return c->autoFocusThread();
-}
-
-int CameraHardwareStub::autoFocusThread()
-{
-    if (mMsgEnabled & CAMERA_MSG_FOCUS)
-        mNotifyCb(CAMERA_MSG_FOCUS, true, 0, mCallbackCookie);
-    return NO_ERROR;
-}
-
-status_t CameraHardwareStub::autoFocus()
-{
-    Mutex::Autolock lock(mLock);
-    if (createThread(beginAutoFocusThread, this) == false)
-        return UNKNOWN_ERROR;
-    return NO_ERROR;
-}
-
-status_t CameraHardwareStub::cancelAutoFocus()
-{
-    return NO_ERROR;
-}
-
-/*static*/ int CameraHardwareStub::beginPictureThread(void *cookie)
-{
-    CameraHardwareStub *c = (CameraHardwareStub *)cookie;
-    return c->pictureThread();
-}
-
-int CameraHardwareStub::pictureThread()
-{
-    if (mMsgEnabled & CAMERA_MSG_SHUTTER)
-        mNotifyCb(CAMERA_MSG_SHUTTER, 0, 0, mCallbackCookie);
-
-    if (mMsgEnabled & CAMERA_MSG_RAW_IMAGE) {
-        //FIXME: use a canned YUV image!
-        // In the meantime just make another fake camera picture.
-        int w, h;
-        mParameters.getPictureSize(&w, &h);
-        sp<MemoryBase> mem = new MemoryBase(mRawHeap, 0, w * h * 3 / 2);
-        FakeCamera cam(w, h);
-        cam.getNextFrameAsYuv420((uint8_t *)mRawHeap->base());
-        mDataCb(CAMERA_MSG_RAW_IMAGE, mem, NULL, mCallbackCookie);
-    }
-
-    if (mMsgEnabled & CAMERA_MSG_COMPRESSED_IMAGE) {
-        sp<MemoryHeapBase> heap = new MemoryHeapBase(kCannedJpegSize);
-        sp<MemoryBase> mem = new MemoryBase(heap, 0, kCannedJpegSize);
-        memcpy(heap->base(), kCannedJpeg, kCannedJpegSize);
-        mDataCb(CAMERA_MSG_COMPRESSED_IMAGE, mem, NULL, mCallbackCookie);
-    }
-    return NO_ERROR;
-}
-
-status_t CameraHardwareStub::takePicture()
-{
-    stopPreview();
-    if (createThread(beginPictureThread, this) == false)
-        return UNKNOWN_ERROR;
-    return NO_ERROR;
-}
-
-status_t CameraHardwareStub::cancelPicture()
-{
-    return NO_ERROR;
-}
-
-status_t CameraHardwareStub::dump(int fd, const Vector<String16>& args) const
-{
-    const size_t SIZE = 256;
-    char buffer[SIZE];
-    String8 result;
-    AutoMutex lock(&mLock);
-    if (mFakeCamera != 0) {
-        mFakeCamera->dump(fd);
-        mParameters.dump(fd, args);
-        snprintf(buffer, 255, " preview frame(%d), size (%d), running(%s)\n", mCurrentPreviewFrame, mPreviewFrameSize, mPreviewRunning?"true": "false");
-        result.append(buffer);
-    } else {
-        result.append("No camera client yet.\n");
-    }
-    write(fd, result.string(), result.size());
-    return NO_ERROR;
-}
-
-status_t CameraHardwareStub::setParameters(const CameraParameters& params)
-{
-    Mutex::Autolock lock(mLock);
-    // XXX verify params
-
-    if (strcmp(params.getPreviewFormat(),
-        CameraParameters::PIXEL_FORMAT_YUV420SP) != 0) {
-        ALOGE("Only yuv420sp preview is supported");
-        return -1;
-    }
-
-    if (strcmp(params.getPictureFormat(),
-        CameraParameters::PIXEL_FORMAT_JPEG) != 0) {
-        ALOGE("Only jpeg still pictures are supported");
-        return -1;
-    }
-
-    int w, h;
-    params.getPictureSize(&w, &h);
-    if (w != kCannedJpegWidth && h != kCannedJpegHeight) {
-        ALOGE("Still picture size must be size of canned JPEG (%dx%d)",
-             kCannedJpegWidth, kCannedJpegHeight);
-        return -1;
-    }
-
-    mParameters = params;
-    initHeapLocked();
-
-    return NO_ERROR;
-}
-
-CameraParameters CameraHardwareStub::getParameters() const
-{
-    Mutex::Autolock lock(mLock);
-    return mParameters;
-}
-
-status_t CameraHardwareStub::sendCommand(int32_t command, int32_t arg1,
-                                         int32_t arg2)
-{
-    return BAD_VALUE;
-}
-
-void CameraHardwareStub::release()
-{
-}
-
-sp<CameraHardwareInterface> CameraHardwareStub::createInstance()
-{
-    return new CameraHardwareStub();
-}
-
-static CameraInfo sCameraInfo[] = {
-    {
-        CAMERA_FACING_BACK,
-        90,  /* orientation */
-    }
-};
-
-extern "C" int HAL_getNumberOfCameras()
-{
-    return sizeof(sCameraInfo) / sizeof(sCameraInfo[0]);
-}
-
-extern "C" void HAL_getCameraInfo(int cameraId, struct CameraInfo* cameraInfo)
-{
-    memcpy(cameraInfo, &sCameraInfo[cameraId], sizeof(CameraInfo));
-}
-
-extern "C" sp<CameraHardwareInterface> HAL_openCameraHardware(int cameraId)
-{
-    return CameraHardwareStub::createInstance();
-}
-
-}; // namespace android
diff --git a/services/camera/libcameraservice/CameraHardwareStub.h b/services/camera/libcameraservice/CameraHardwareStub.h
deleted file mode 100644
index c6d8756..0000000
--- a/services/camera/libcameraservice/CameraHardwareStub.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-**
-** Copyright 2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
-
-#ifndef ANDROID_HARDWARE_CAMERA_HARDWARE_STUB_H
-#define ANDROID_HARDWARE_CAMERA_HARDWARE_STUB_H
-
-#include "FakeCamera.h"
-#include <utils/threads.h>
-#include <camera/CameraHardwareInterface.h>
-#include <binder/MemoryBase.h>
-#include <binder/MemoryHeapBase.h>
-#include <utils/threads.h>
-
-namespace android {
-
-class CameraHardwareStub : public CameraHardwareInterface {
-public:
-    virtual status_t setPreviewWindow(const sp<ANativeWindow>& buf);
-    virtual sp<IMemoryHeap> getRawHeap() const;
-
-    virtual void        setCallbacks(notify_callback notify_cb,
-                                     data_callback data_cb,
-                                     data_callback_timestamp data_cb_timestamp,
-                                     void* user);
-
-    virtual void        enableMsgType(int32_t msgType);
-    virtual void        disableMsgType(int32_t msgType);
-    virtual bool        msgTypeEnabled(int32_t msgType);
-
-    virtual status_t    startPreview();
-    virtual void        stopPreview();
-    virtual bool        previewEnabled();
-
-    virtual status_t    startRecording();
-    virtual void        stopRecording();
-    virtual bool        recordingEnabled();
-    virtual void        releaseRecordingFrame(const sp<IMemory>& mem);
-
-    virtual status_t    autoFocus();
-    virtual status_t    cancelAutoFocus();
-    virtual status_t    takePicture();
-    virtual status_t    cancelPicture();
-    virtual status_t    dump(int fd, const Vector<String16>& args) const;
-    virtual status_t    setParameters(const CameraParameters& params);
-    virtual CameraParameters  getParameters() const;
-    virtual status_t    sendCommand(int32_t command, int32_t arg1,
-                                    int32_t arg2);
-    virtual void release();
-
-    static sp<CameraHardwareInterface> createInstance();
-
-private:
-                        CameraHardwareStub();
-    virtual             ~CameraHardwareStub();
-
-    static const int kBufferCount = 4;
-
-    class PreviewThread : public Thread {
-        CameraHardwareStub* mHardware;
-    public:
-        PreviewThread(CameraHardwareStub* hw) :
-                Thread(false), mHardware(hw) { }
-        virtual void onFirstRef() {
-            run("CameraPreviewThread", PRIORITY_URGENT_DISPLAY);
-        }
-        virtual bool threadLoop() {
-            mHardware->previewThread();
-            // loop until we need to quit
-            return true;
-        }
-    };
-
-    void initDefaultParameters();
-    void initHeapLocked();
-
-    int previewThread();
-
-    static int beginAutoFocusThread(void *cookie);
-    int autoFocusThread();
-
-    static int beginPictureThread(void *cookie);
-    int pictureThread();
-
-    mutable Mutex       mLock;
-
-    CameraParameters    mParameters;
-
-    sp<MemoryHeapBase>  mPreviewHeap;
-    sp<MemoryHeapBase>  mRawHeap;
-    sp<MemoryBase>      mBuffers[kBufferCount];
-
-    FakeCamera          *mFakeCamera;
-    bool                mPreviewRunning;
-    int                 mPreviewFrameSize;
-
-    // protected by mLock
-    sp<PreviewThread>   mPreviewThread;
-
-    notify_callback    mNotifyCb;
-    data_callback      mDataCb;
-    data_callback_timestamp mDataCbTimestamp;
-    void               *mCallbackCookie;
-
-    int32_t             mMsgEnabled;
-
-    // only used from PreviewThread
-    int                 mCurrentPreviewFrame;
-};
-
-}; // namespace android
-
-#endif
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 385be50..878afde 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -38,14 +38,15 @@
 #include <utils/String16.h>
 
 #include "CameraService.h"
-#include "CameraHardwareInterface.h"
+#include "CameraClient.h"
+#include "Camera2Client.h"
 
 namespace android {
 
 // ----------------------------------------------------------------------------
 // Logging support -- this is for debugging only
 // Use "adb shell dumpsys media.camera -v 1" to change it.
-static volatile int32_t gLogLevel = 0;
+volatile int32_t gLogLevel = 0;
 
 #define LOG1(...) ALOGD_IF(gLogLevel >= 1, __VA_ARGS__);
 #define LOG2(...) ALOGD_IF(gLogLevel >= 2, __VA_ARGS__);
@@ -133,7 +134,6 @@
 sp<ICamera> CameraService::connect(
         const sp<ICameraClient>& cameraClient, int cameraId) {
     int callingPid = getCallingPid();
-    sp<CameraHardwareInterface> hardware = NULL;
 
     LOG1("CameraService::connect E (pid %d, id %d)", callingPid, cameraId);
 
@@ -186,16 +186,31 @@
         return NULL;
     }
 
-    char camera_device_name[10];
-    snprintf(camera_device_name, sizeof(camera_device_name), "%d", cameraId);
+    int deviceVersion;
+    if (mModule->common.module_api_version == CAMERA_MODULE_API_VERSION_2_0) {
+        deviceVersion = info.device_version;
+    } else {
+        deviceVersion = CAMERA_DEVICE_API_VERSION_1_0;
+    }
 
-    hardware = new CameraHardwareInterface(camera_device_name);
-    if (hardware->initialize(&mModule->common) != OK) {
-        hardware.clear();
+    switch(deviceVersion) {
+      case CAMERA_DEVICE_API_VERSION_1_0:
+        client = new CameraClient(this, cameraClient, cameraId,
+                info.facing, callingPid);
+        break;
+      case CAMERA_DEVICE_API_VERSION_2_0:
+        client = new Camera2Client(this, cameraClient, cameraId,
+                info.facing, callingPid);
+        break;
+      default:
+        ALOGE("Unknown camera device HAL version: %d", deviceVersion);
         return NULL;
     }
 
-    client = new Client(this, cameraClient, hardware, cameraId, info.facing, callingPid);
+    if (client->initialize(mModule) != OK) {
+        return NULL;
+    }
+
     mClient[cameraId] = client;
     LOG1("CameraService::connect X (id %d)", cameraId);
     return client;
@@ -335,34 +350,17 @@
 
 CameraService::Client::Client(const sp<CameraService>& cameraService,
         const sp<ICameraClient>& cameraClient,
-        const sp<CameraHardwareInterface>& hardware,
         int cameraId, int cameraFacing, int clientPid) {
     int callingPid = getCallingPid();
     LOG1("Client::Client E (pid %d, id %d)", callingPid, cameraId);
 
     mCameraService = cameraService;
     mCameraClient = cameraClient;
-    mHardware = hardware;
     mCameraId = cameraId;
     mCameraFacing = cameraFacing;
     mClientPid = clientPid;
-    mMsgEnabled = 0;
-    mSurface = 0;
-    mPreviewWindow = 0;
     mDestructionStarted = false;
-    mHardware->setCallbacks(notifyCallback,
-                            dataCallback,
-                            dataCallbackTimestamp,
-                            (void *)cameraId);
 
-    // Enable zoom, error, focus, and metadata messages by default
-    enableMsgType(CAMERA_MSG_ERROR | CAMERA_MSG_ZOOM | CAMERA_MSG_FOCUS |
-                  CAMERA_MSG_PREVIEW_METADATA | CAMERA_MSG_FOCUS_MOVE);
-
-    // Callback is disabled by default
-    mPreviewCallbackFlag = CAMERA_FRAME_CALLBACK_FLAG_NOOP;
-    mOrientation = getOrientation(0, mCameraFacing == CAMERA_FACING_FRONT);
-    mPlayShutterSound = true;
     cameraService->setCameraBusy(cameraId);
     cameraService->loadSound();
     LOG1("Client::Client X (pid %d, id %d)", callingPid, cameraId);
@@ -370,582 +368,7 @@
 
 // tear down the client
 CameraService::Client::~Client() {
-    // this lock should never be NULL
-    Mutex* lock = mCameraService->getClientLockById(mCameraId);
-    lock->lock();
-    mDestructionStarted = true;
-    // client will not be accessed from callback. should unlock to prevent dead-lock in disconnect
-    lock->unlock();
-    int callingPid = getCallingPid();
-    LOG1("Client::~Client E (pid %d, this %p)", callingPid, this);
-
-    // set mClientPid to let disconnet() tear down the hardware
-    mClientPid = callingPid;
-    disconnect();
     mCameraService->releaseSound();
-    LOG1("Client::~Client X (pid %d, this %p)", callingPid, this);
-}
-
-// ----------------------------------------------------------------------------
-
-status_t CameraService::Client::checkPid() const {
-    int callingPid = getCallingPid();
-    if (callingPid == mClientPid) return NO_ERROR;
-
-    ALOGW("attempt to use a locked camera from a different process"
-         " (old pid %d, new pid %d)", mClientPid, callingPid);
-    return EBUSY;
-}
-
-status_t CameraService::Client::checkPidAndHardware() const {
-    status_t result = checkPid();
-    if (result != NO_ERROR) return result;
-    if (mHardware == 0) {
-        ALOGE("attempt to use a camera after disconnect() (pid %d)", getCallingPid());
-        return INVALID_OPERATION;
-    }
-    return NO_ERROR;
-}
-
-status_t CameraService::Client::lock() {
-    int callingPid = getCallingPid();
-    LOG1("lock (pid %d)", callingPid);
-    Mutex::Autolock ilock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-
-    // lock camera to this client if the the camera is unlocked
-    if (mClientPid == 0) {
-        mClientPid = callingPid;
-        return NO_ERROR;
-    }
-
-    // returns NO_ERROR if the client already owns the camera, EBUSY otherwise
-    return checkPid();
-}
-
-status_t CameraService::Client::unlock() {
-    int callingPid = getCallingPid();
-    LOG1("unlock (pid %d)", callingPid);
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-
-    // allow anyone to use camera (after they lock the camera)
-    status_t result = checkPid();
-    if (result == NO_ERROR) {
-        if (mHardware->recordingEnabled()) {
-            ALOGE("Not allowed to unlock camera during recording.");
-            return INVALID_OPERATION;
-        }
-        mClientPid = 0;
-        LOG1("clear mCameraClient (pid %d)", callingPid);
-        // we need to remove the reference to ICameraClient so that when the app
-        // goes away, the reference count goes to 0.
-        mCameraClient.clear();
-    }
-    return result;
-}
-
-// connect a new client to the camera
-status_t CameraService::Client::connect(const sp<ICameraClient>& client) {
-    int callingPid = getCallingPid();
-    LOG1("connect E (pid %d)", callingPid);
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-
-    if (mClientPid != 0 && checkPid() != NO_ERROR) {
-        ALOGW("Tried to connect to a locked camera (old pid %d, new pid %d)",
-                mClientPid, callingPid);
-        return EBUSY;
-    }
-
-    if (mCameraClient != 0 && (client->asBinder() == mCameraClient->asBinder())) {
-        LOG1("Connect to the same client");
-        return NO_ERROR;
-    }
-
-    mPreviewCallbackFlag = CAMERA_FRAME_CALLBACK_FLAG_NOOP;
-    mClientPid = callingPid;
-    mCameraClient = client;
-
-    LOG1("connect X (pid %d)", callingPid);
-    return NO_ERROR;
-}
-
-static void disconnectWindow(const sp<ANativeWindow>& window) {
-    if (window != 0) {
-        status_t result = native_window_api_disconnect(window.get(),
-                NATIVE_WINDOW_API_CAMERA);
-        if (result != NO_ERROR) {
-            ALOGW("native_window_api_disconnect failed: %s (%d)", strerror(-result),
-                    result);
-        }
-    }
-}
-
-void CameraService::Client::disconnect() {
-    int callingPid = getCallingPid();
-    LOG1("disconnect E (pid %d)", callingPid);
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-
-    if (checkPid() != NO_ERROR) {
-        ALOGW("different client - don't disconnect");
-        return;
-    }
-
-    if (mClientPid <= 0) {
-        LOG1("camera is unlocked (mClientPid = %d), don't tear down hardware", mClientPid);
-        return;
-    }
-
-    // Make sure disconnect() is done once and once only, whether it is called
-    // from the user directly, or called by the destructor.
-    if (mHardware == 0) return;
-
-    LOG1("hardware teardown");
-    // Before destroying mHardware, we must make sure it's in the
-    // idle state.
-    // Turn off all messages.
-    disableMsgType(CAMERA_MSG_ALL_MSGS);
-    mHardware->stopPreview();
-    mHardware->cancelPicture();
-    // Release the hardware resources.
-    mHardware->release();
-
-    // Release the held ANativeWindow resources.
-    if (mPreviewWindow != 0) {
-        disconnectWindow(mPreviewWindow);
-        mPreviewWindow = 0;
-        mHardware->setPreviewWindow(mPreviewWindow);
-    }
-    mHardware.clear();
-
-    mCameraService->removeClient(mCameraClient);
-    mCameraService->setCameraFree(mCameraId);
-
-    LOG1("disconnect X (pid %d)", callingPid);
-}
-
-// ----------------------------------------------------------------------------
-
-status_t CameraService::Client::setPreviewWindow(const sp<IBinder>& binder,
-        const sp<ANativeWindow>& window) {
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    status_t result = checkPidAndHardware();
-    if (result != NO_ERROR) return result;
-
-    // return if no change in surface.
-    if (binder == mSurface) {
-        return NO_ERROR;
-    }
-
-    if (window != 0) {
-        result = native_window_api_connect(window.get(), NATIVE_WINDOW_API_CAMERA);
-        if (result != NO_ERROR) {
-            ALOGE("native_window_api_connect failed: %s (%d)", strerror(-result),
-                    result);
-            return result;
-        }
-    }
-
-    // If preview has been already started, register preview buffers now.
-    if (mHardware->previewEnabled()) {
-        if (window != 0) {
-            native_window_set_scaling_mode(window.get(),
-                    NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
-            native_window_set_buffers_transform(window.get(), mOrientation);
-            result = mHardware->setPreviewWindow(window);
-        }
-    }
-
-    if (result == NO_ERROR) {
-        // Everything has succeeded.  Disconnect the old window and remember the
-        // new window.
-        disconnectWindow(mPreviewWindow);
-        mSurface = binder;
-        mPreviewWindow = window;
-    } else {
-        // Something went wrong after we connected to the new window, so
-        // disconnect here.
-        disconnectWindow(window);
-    }
-
-    return result;
-}
-
-// set the Surface that the preview will use
-status_t CameraService::Client::setPreviewDisplay(const sp<Surface>& surface) {
-    LOG1("setPreviewDisplay(%p) (pid %d)", surface.get(), getCallingPid());
-
-    sp<IBinder> binder(surface != 0 ? surface->asBinder() : 0);
-    sp<ANativeWindow> window(surface);
-    return setPreviewWindow(binder, window);
-}
-
-// set the SurfaceTexture that the preview will use
-status_t CameraService::Client::setPreviewTexture(
-        const sp<ISurfaceTexture>& surfaceTexture) {
-    LOG1("setPreviewTexture(%p) (pid %d)", surfaceTexture.get(),
-            getCallingPid());
-
-    sp<IBinder> binder;
-    sp<ANativeWindow> window;
-    if (surfaceTexture != 0) {
-        binder = surfaceTexture->asBinder();
-        window = new SurfaceTextureClient(surfaceTexture);
-    }
-    return setPreviewWindow(binder, window);
-}
-
-// set the preview callback flag to affect how the received frames from
-// preview are handled.
-void CameraService::Client::setPreviewCallbackFlag(int callback_flag) {
-    LOG1("setPreviewCallbackFlag(%d) (pid %d)", callback_flag, getCallingPid());
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    if (checkPidAndHardware() != NO_ERROR) return;
-
-    mPreviewCallbackFlag = callback_flag;
-    if (mPreviewCallbackFlag & CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK) {
-        enableMsgType(CAMERA_MSG_PREVIEW_FRAME);
-    } else {
-        disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
-    }
-}
-
-// start preview mode
-status_t CameraService::Client::startPreview() {
-    LOG1("startPreview (pid %d)", getCallingPid());
-    return startCameraMode(CAMERA_PREVIEW_MODE);
-}
-
-// start recording mode
-status_t CameraService::Client::startRecording() {
-    LOG1("startRecording (pid %d)", getCallingPid());
-    return startCameraMode(CAMERA_RECORDING_MODE);
-}
-
-// start preview or recording
-status_t CameraService::Client::startCameraMode(camera_mode mode) {
-    LOG1("startCameraMode(%d)", mode);
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    status_t result = checkPidAndHardware();
-    if (result != NO_ERROR) return result;
-
-    switch(mode) {
-        case CAMERA_PREVIEW_MODE:
-            if (mSurface == 0 && mPreviewWindow == 0) {
-                LOG1("mSurface is not set yet.");
-                // still able to start preview in this case.
-            }
-            return startPreviewMode();
-        case CAMERA_RECORDING_MODE:
-            if (mSurface == 0 && mPreviewWindow == 0) {
-                ALOGE("mSurface or mPreviewWindow must be set before startRecordingMode.");
-                return INVALID_OPERATION;
-            }
-            return startRecordingMode();
-        default:
-            return UNKNOWN_ERROR;
-    }
-}
-
-status_t CameraService::Client::startPreviewMode() {
-    LOG1("startPreviewMode");
-    status_t result = NO_ERROR;
-
-    // if preview has been enabled, nothing needs to be done
-    if (mHardware->previewEnabled()) {
-        return NO_ERROR;
-    }
-
-    if (mPreviewWindow != 0) {
-        native_window_set_scaling_mode(mPreviewWindow.get(),
-                NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
-        native_window_set_buffers_transform(mPreviewWindow.get(),
-                mOrientation);
-    }
-    mHardware->setPreviewWindow(mPreviewWindow);
-    result = mHardware->startPreview();
-
-    return result;
-}
-
-status_t CameraService::Client::startRecordingMode() {
-    LOG1("startRecordingMode");
-    status_t result = NO_ERROR;
-
-    // if recording has been enabled, nothing needs to be done
-    if (mHardware->recordingEnabled()) {
-        return NO_ERROR;
-    }
-
-    // if preview has not been started, start preview first
-    if (!mHardware->previewEnabled()) {
-        result = startPreviewMode();
-        if (result != NO_ERROR) {
-            return result;
-        }
-    }
-
-    // start recording mode
-    enableMsgType(CAMERA_MSG_VIDEO_FRAME);
-    mCameraService->playSound(SOUND_RECORDING);
-    result = mHardware->startRecording();
-    if (result != NO_ERROR) {
-        ALOGE("mHardware->startRecording() failed with status %d", result);
-    }
-    return result;
-}
-
-// stop preview mode
-void CameraService::Client::stopPreview() {
-    LOG1("stopPreview (pid %d)", getCallingPid());
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    if (checkPidAndHardware() != NO_ERROR) return;
-
-
-    disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
-    mHardware->stopPreview();
-
-    mPreviewBuffer.clear();
-}
-
-// stop recording mode
-void CameraService::Client::stopRecording() {
-    LOG1("stopRecording (pid %d)", getCallingPid());
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    if (checkPidAndHardware() != NO_ERROR) return;
-
-    disableMsgType(CAMERA_MSG_VIDEO_FRAME);
-    mHardware->stopRecording();
-    mCameraService->playSound(SOUND_RECORDING);
-
-    mPreviewBuffer.clear();
-}
-
-// release a recording frame
-void CameraService::Client::releaseRecordingFrame(const sp<IMemory>& mem) {
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    if (checkPidAndHardware() != NO_ERROR) return;
-    mHardware->releaseRecordingFrame(mem);
-}
-
-status_t CameraService::Client::storeMetaDataInBuffers(bool enabled)
-{
-    LOG1("storeMetaDataInBuffers: %s", enabled? "true": "false");
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    if (checkPidAndHardware() != NO_ERROR) {
-        return UNKNOWN_ERROR;
-    }
-    return mHardware->storeMetaDataInBuffers(enabled);
-}
-
-bool CameraService::Client::previewEnabled() {
-    LOG1("previewEnabled (pid %d)", getCallingPid());
-
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    if (checkPidAndHardware() != NO_ERROR) return false;
-    return mHardware->previewEnabled();
-}
-
-bool CameraService::Client::recordingEnabled() {
-    LOG1("recordingEnabled (pid %d)", getCallingPid());
-
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    if (checkPidAndHardware() != NO_ERROR) return false;
-    return mHardware->recordingEnabled();
-}
-
-status_t CameraService::Client::autoFocus() {
-    LOG1("autoFocus (pid %d)", getCallingPid());
-
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    status_t result = checkPidAndHardware();
-    if (result != NO_ERROR) return result;
-
-    return mHardware->autoFocus();
-}
-
-status_t CameraService::Client::cancelAutoFocus() {
-    LOG1("cancelAutoFocus (pid %d)", getCallingPid());
-
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    status_t result = checkPidAndHardware();
-    if (result != NO_ERROR) return result;
-
-    return mHardware->cancelAutoFocus();
-}
-
-// take a picture - image is returned in callback
-status_t CameraService::Client::takePicture(int msgType) {
-    LOG1("takePicture (pid %d): 0x%x", getCallingPid(), msgType);
-
-    Mutex::Autolock iLock(mICameraLock);
-    int picMsgType = 0;
-    { // scope for lock
-        Mutex::Autolock lock(mLock);
-        status_t result = checkPidAndHardware();
-        if (result != NO_ERROR) return result;
-
-        if ((msgType & CAMERA_MSG_RAW_IMAGE) &&
-                (msgType & CAMERA_MSG_RAW_IMAGE_NOTIFY)) {
-            ALOGE("CAMERA_MSG_RAW_IMAGE and CAMERA_MSG_RAW_IMAGE_NOTIFY"
-                    " cannot be both enabled");
-            return BAD_VALUE;
-        }
-
-        // We only accept picture related message types
-        // and ignore other types of messages for takePicture().
-        picMsgType = msgType
-                & (CAMERA_MSG_SHUTTER |
-                        CAMERA_MSG_POSTVIEW_FRAME |
-                        CAMERA_MSG_RAW_IMAGE |
-                        CAMERA_MSG_RAW_IMAGE_NOTIFY |
-                        CAMERA_MSG_COMPRESSED_IMAGE);
-
-    }
-    enableMsgType(picMsgType);
-
-    return mHardware->takePicture();
-}
-
-// set preview/capture parameters - key/value pairs
-status_t CameraService::Client::setParameters(const String8& params) {
-    LOG1("setParameters (pid %d) (%s)", getCallingPid(), params.string());
-
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    status_t result = checkPidAndHardware();
-    if (result != NO_ERROR) return result;
-
-    CameraParameters p(params);
-    return mHardware->setParameters(p);
-}
-
-// get preview/capture parameters - key/value pairs
-String8 CameraService::Client::getParameters() const {
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    if (checkPidAndHardware() != NO_ERROR) return String8();
-
-    String8 params(mHardware->getParameters().flatten());
-    LOG1("getParameters (pid %d) (%s)", getCallingPid(), params.string());
-    return params;
-}
-
-// enable shutter sound
-status_t CameraService::Client::enableShutterSound(bool enable) {
-    LOG1("enableShutterSound (pid %d)", getCallingPid());
-
-    status_t result = checkPidAndHardware();
-    if (result != NO_ERROR) return result;
-
-    if (enable) {
-        mPlayShutterSound = true;
-        return OK;
-    }
-
-    // Disabling shutter sound may not be allowed. In that case only
-    // allow the mediaserver process to disable the sound.
-    char value[PROPERTY_VALUE_MAX];
-    property_get("ro.camera.sound.forced", value, "0");
-    if (strcmp(value, "0") != 0) {
-        // Disabling shutter sound is not allowed. Deny if the current
-        // process is not mediaserver.
-        if (getCallingPid() != getpid()) {
-            ALOGE("Failed to disable shutter sound. Permission denied (pid %d)", getCallingPid());
-            return PERMISSION_DENIED;
-        }
-    }
-
-    mPlayShutterSound = false;
-    return OK;
-}
-
-status_t CameraService::Client::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
-    LOG1("sendCommand (pid %d)", getCallingPid());
-    int orientation;
-    Mutex::Autolock iLock(mICameraLock);
-    Mutex::Autolock lock(mLock);
-    status_t result = checkPidAndHardware();
-    if (result != NO_ERROR) return result;
-
-    if (cmd == CAMERA_CMD_SET_DISPLAY_ORIENTATION) {
-        // Mirror the preview if the camera is front-facing.
-        orientation = getOrientation(arg1, mCameraFacing == CAMERA_FACING_FRONT);
-        if (orientation == -1) return BAD_VALUE;
-
-        if (mOrientation != orientation) {
-            mOrientation = orientation;
-            if (mPreviewWindow != 0) {
-                native_window_set_buffers_transform(mPreviewWindow.get(),
-                        mOrientation);
-            }
-        }
-        return OK;
-    } else if (cmd == CAMERA_CMD_ENABLE_SHUTTER_SOUND) {
-        switch (arg1) {
-            case 0:
-                enableShutterSound(false);
-                break;
-            case 1:
-                enableShutterSound(true);
-                break;
-            default:
-                return BAD_VALUE;
-        }
-        return OK;
-    } else if (cmd == CAMERA_CMD_PLAY_RECORDING_SOUND) {
-        mCameraService->playSound(SOUND_RECORDING);
-    } else if (cmd == CAMERA_CMD_PING) {
-        // If mHardware is 0, checkPidAndHardware will return error.
-        return OK;
-    }
-
-    return mHardware->sendCommand(cmd, arg1, arg2);
-}
-
-// ----------------------------------------------------------------------------
-
-void CameraService::Client::enableMsgType(int32_t msgType) {
-    android_atomic_or(msgType, &mMsgEnabled);
-    mHardware->enableMsgType(msgType);
-}
-
-void CameraService::Client::disableMsgType(int32_t msgType) {
-    android_atomic_and(~msgType, &mMsgEnabled);
-    mHardware->disableMsgType(msgType);
-}
-
-#define CHECK_MESSAGE_INTERVAL 10 // 10ms
-bool CameraService::Client::lockIfMessageWanted(int32_t msgType) {
-    int sleepCount = 0;
-    while (mMsgEnabled & msgType) {
-        if (mLock.tryLock() == NO_ERROR) {
-            if (sleepCount > 0) {
-                LOG1("lockIfMessageWanted(%d): waited for %d ms",
-                    msgType, sleepCount * CHECK_MESSAGE_INTERVAL);
-            }
-            return true;
-        }
-        if (sleepCount++ == 0) {
-            LOG1("lockIfMessageWanted(%d): enter sleep", msgType);
-        }
-        usleep(CHECK_MESSAGE_INTERVAL * 1000);
-    }
-    ALOGW("lockIfMessageWanted(%d): dropped unwanted message", msgType);
-    return false;
 }
 
 // ----------------------------------------------------------------------------
@@ -967,311 +390,12 @@
     // destruction already started, so should not be accessed
     if (client->mDestructionStarted) return NULL;
 
-    // The checks below are not necessary and are for debugging only.
-    if (client->mCameraService.get() != gCameraService) {
-        ALOGE("mismatch service!");
-        return NULL;
-    }
-
-    if (client->mHardware == 0) {
-        ALOGE("mHardware == 0: callback after disconnect()?");
-        return NULL;
-    }
-
     return client;
 }
 
-// Callback messages can be dispatched to internal handlers or pass to our
-// client's callback functions, depending on the message type.
-//
-// notifyCallback:
-//      CAMERA_MSG_SHUTTER              handleShutter
-//      (others)                        c->notifyCallback
-// dataCallback:
-//      CAMERA_MSG_PREVIEW_FRAME        handlePreviewData
-//      CAMERA_MSG_POSTVIEW_FRAME       handlePostview
-//      CAMERA_MSG_RAW_IMAGE            handleRawPicture
-//      CAMERA_MSG_COMPRESSED_IMAGE     handleCompressedPicture
-//      (others)                        c->dataCallback
-// dataCallbackTimestamp
-//      (others)                        c->dataCallbackTimestamp
-//
-// NOTE: the *Callback functions grab mLock of the client before passing
-// control to handle* functions. So the handle* functions must release the
-// lock before calling the ICameraClient's callbacks, so those callbacks can
-// invoke methods in the Client class again (For example, the preview frame
-// callback may want to releaseRecordingFrame). The handle* functions must
-// release the lock after all accesses to member variables, so it must be
-// handled very carefully.
-
-void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1,
-        int32_t ext2, void* user) {
-    LOG2("notifyCallback(%d)", msgType);
-
-    Mutex* lock = getClientLockFromCookie(user);
-    if (lock == NULL) return;
-    Mutex::Autolock alock(*lock);
-
-    Client* client = getClientFromCookie(user);
-    if (client == NULL) return;
-
-    if (!client->lockIfMessageWanted(msgType)) return;
-
-    switch (msgType) {
-        case CAMERA_MSG_SHUTTER:
-            // ext1 is the dimension of the yuv picture.
-            client->handleShutter();
-            break;
-        default:
-            client->handleGenericNotify(msgType, ext1, ext2);
-            break;
-    }
-}
-
-void CameraService::Client::dataCallback(int32_t msgType,
-        const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata, void* user) {
-    LOG2("dataCallback(%d)", msgType);
-
-    Mutex* lock = getClientLockFromCookie(user);
-    if (lock == NULL) return;
-    Mutex::Autolock alock(*lock);
-
-    Client* client = getClientFromCookie(user);
-    if (client == NULL) return;
-
-    if (!client->lockIfMessageWanted(msgType)) return;
-    if (dataPtr == 0 && metadata == NULL) {
-        ALOGE("Null data returned in data callback");
-        client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
-        return;
-    }
-
-    switch (msgType & ~CAMERA_MSG_PREVIEW_METADATA) {
-        case CAMERA_MSG_PREVIEW_FRAME:
-            client->handlePreviewData(msgType, dataPtr, metadata);
-            break;
-        case CAMERA_MSG_POSTVIEW_FRAME:
-            client->handlePostview(dataPtr);
-            break;
-        case CAMERA_MSG_RAW_IMAGE:
-            client->handleRawPicture(dataPtr);
-            break;
-        case CAMERA_MSG_COMPRESSED_IMAGE:
-            client->handleCompressedPicture(dataPtr);
-            break;
-        default:
-            client->handleGenericData(msgType, dataPtr, metadata);
-            break;
-    }
-}
-
-void CameraService::Client::dataCallbackTimestamp(nsecs_t timestamp,
-        int32_t msgType, const sp<IMemory>& dataPtr, void* user) {
-    LOG2("dataCallbackTimestamp(%d)", msgType);
-
-    Mutex* lock = getClientLockFromCookie(user);
-    if (lock == NULL) return;
-    Mutex::Autolock alock(*lock);
-
-    Client* client = getClientFromCookie(user);
-    if (client == NULL) return;
-
-    if (!client->lockIfMessageWanted(msgType)) return;
-
-    if (dataPtr == 0) {
-        ALOGE("Null data returned in data with timestamp callback");
-        client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
-        return;
-    }
-
-    client->handleGenericDataTimestamp(timestamp, msgType, dataPtr);
-}
-
-// snapshot taken callback
-void CameraService::Client::handleShutter(void) {
-    if (mPlayShutterSound) {
-        mCameraService->playSound(SOUND_SHUTTER);
-    }
-
-    sp<ICameraClient> c = mCameraClient;
-    if (c != 0) {
-        mLock.unlock();
-        c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
-        if (!lockIfMessageWanted(CAMERA_MSG_SHUTTER)) return;
-    }
-    disableMsgType(CAMERA_MSG_SHUTTER);
-
-    mLock.unlock();
-}
-
-// preview callback - frame buffer update
-void CameraService::Client::handlePreviewData(int32_t msgType,
-                                              const sp<IMemory>& mem,
-                                              camera_frame_metadata_t *metadata) {
-    ssize_t offset;
-    size_t size;
-    sp<IMemoryHeap> heap = mem->getMemory(&offset, &size);
-
-    // local copy of the callback flags
-    int flags = mPreviewCallbackFlag;
-
-    // is callback enabled?
-    if (!(flags & CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK)) {
-        // If the enable bit is off, the copy-out and one-shot bits are ignored
-        LOG2("frame callback is disabled");
-        mLock.unlock();
-        return;
-    }
-
-    // hold a strong pointer to the client
-    sp<ICameraClient> c = mCameraClient;
-
-    // clear callback flags if no client or one-shot mode
-    if (c == 0 || (mPreviewCallbackFlag & CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK)) {
-        LOG2("Disable preview callback");
-        mPreviewCallbackFlag &= ~(CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK |
-                                  CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK |
-                                  CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK);
-        disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
-    }
-
-    if (c != 0) {
-        // Is the received frame copied out or not?
-        if (flags & CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK) {
-            LOG2("frame is copied");
-            copyFrameAndPostCopiedFrame(msgType, c, heap, offset, size, metadata);
-        } else {
-            LOG2("frame is forwarded");
-            mLock.unlock();
-            c->dataCallback(msgType, mem, metadata);
-        }
-    } else {
-        mLock.unlock();
-    }
-}
-
-// picture callback - postview image ready
-void CameraService::Client::handlePostview(const sp<IMemory>& mem) {
-    disableMsgType(CAMERA_MSG_POSTVIEW_FRAME);
-
-    sp<ICameraClient> c = mCameraClient;
-    mLock.unlock();
-    if (c != 0) {
-        c->dataCallback(CAMERA_MSG_POSTVIEW_FRAME, mem, NULL);
-    }
-}
-
-// picture callback - raw image ready
-void CameraService::Client::handleRawPicture(const sp<IMemory>& mem) {
-    disableMsgType(CAMERA_MSG_RAW_IMAGE);
-
-    ssize_t offset;
-    size_t size;
-    sp<IMemoryHeap> heap = mem->getMemory(&offset, &size);
-
-    sp<ICameraClient> c = mCameraClient;
-    mLock.unlock();
-    if (c != 0) {
-        c->dataCallback(CAMERA_MSG_RAW_IMAGE, mem, NULL);
-    }
-}
-
-// picture callback - compressed picture ready
-void CameraService::Client::handleCompressedPicture(const sp<IMemory>& mem) {
-    disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE);
-
-    sp<ICameraClient> c = mCameraClient;
-    mLock.unlock();
-    if (c != 0) {
-        c->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, mem, NULL);
-    }
-}
-
-
-void CameraService::Client::handleGenericNotify(int32_t msgType,
-    int32_t ext1, int32_t ext2) {
-    sp<ICameraClient> c = mCameraClient;
-    mLock.unlock();
-    if (c != 0) {
-        c->notifyCallback(msgType, ext1, ext2);
-    }
-}
-
-void CameraService::Client::handleGenericData(int32_t msgType,
-    const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata) {
-    sp<ICameraClient> c = mCameraClient;
-    mLock.unlock();
-    if (c != 0) {
-        c->dataCallback(msgType, dataPtr, metadata);
-    }
-}
-
-void CameraService::Client::handleGenericDataTimestamp(nsecs_t timestamp,
-    int32_t msgType, const sp<IMemory>& dataPtr) {
-    sp<ICameraClient> c = mCameraClient;
-    mLock.unlock();
-    if (c != 0) {
-        c->dataCallbackTimestamp(timestamp, msgType, dataPtr);
-    }
-}
-
-void CameraService::Client::copyFrameAndPostCopiedFrame(
-        int32_t msgType, const sp<ICameraClient>& client,
-        const sp<IMemoryHeap>& heap, size_t offset, size_t size,
-        camera_frame_metadata_t *metadata) {
-    LOG2("copyFrameAndPostCopiedFrame");
-    // It is necessary to copy out of pmem before sending this to
-    // the callback. For efficiency, reuse the same MemoryHeapBase
-    // provided it's big enough. Don't allocate the memory or
-    // perform the copy if there's no callback.
-    // hold the preview lock while we grab a reference to the preview buffer
-    sp<MemoryHeapBase> previewBuffer;
-
-    if (mPreviewBuffer == 0) {
-        mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
-    } else if (size > mPreviewBuffer->virtualSize()) {
-        mPreviewBuffer.clear();
-        mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
-    }
-    if (mPreviewBuffer == 0) {
-        ALOGE("failed to allocate space for preview buffer");
-        mLock.unlock();
-        return;
-    }
-    previewBuffer = mPreviewBuffer;
-
-    memcpy(previewBuffer->base(), (uint8_t *)heap->base() + offset, size);
-
-    sp<MemoryBase> frame = new MemoryBase(previewBuffer, 0, size);
-    if (frame == 0) {
-        ALOGE("failed to allocate space for frame callback");
-        mLock.unlock();
-        return;
-    }
-
-    mLock.unlock();
-    client->dataCallback(msgType, frame, metadata);
-}
-
-int CameraService::Client::getOrientation(int degrees, bool mirror) {
-    if (!mirror) {
-        if (degrees == 0) return 0;
-        else if (degrees == 90) return HAL_TRANSFORM_ROT_90;
-        else if (degrees == 180) return HAL_TRANSFORM_ROT_180;
-        else if (degrees == 270) return HAL_TRANSFORM_ROT_270;
-    } else {  // Do mirror (horizontal flip)
-        if (degrees == 0) {           // FLIP_H and ROT_0
-            return HAL_TRANSFORM_FLIP_H;
-        } else if (degrees == 90) {   // FLIP_H and ROT_90
-            return HAL_TRANSFORM_FLIP_H | HAL_TRANSFORM_ROT_90;
-        } else if (degrees == 180) {  // FLIP_H and ROT_180
-            return HAL_TRANSFORM_FLIP_V;
-        } else if (degrees == 270) {  // FLIP_H and ROT_270
-            return HAL_TRANSFORM_FLIP_V | HAL_TRANSFORM_ROT_90;
-        }
-    }
-    ALOGE("Invalid setDisplayOrientation degrees=%d", degrees);
-    return -1;
+void CameraService::Client::disconnect() {
+    mCameraService->removeClient(mCameraClient);
+    mCameraService->setCameraFree(mCameraId);
 }
 
 // ----------------------------------------------------------------------------
@@ -1293,41 +417,81 @@
 }
 
 status_t CameraService::dump(int fd, const Vector<String16>& args) {
-    static const char* kDeadlockedString = "CameraService may be deadlocked\n";
-
-    const size_t SIZE = 256;
-    char buffer[SIZE];
     String8 result;
     if (checkCallingPermission(String16("android.permission.DUMP")) == false) {
-        snprintf(buffer, SIZE, "Permission Denial: "
+        result.appendFormat("Permission Denial: "
                 "can't dump CameraService from pid=%d, uid=%d\n",
                 getCallingPid(),
                 getCallingUid());
-        result.append(buffer);
         write(fd, result.string(), result.size());
     } else {
         bool locked = tryLock(mServiceLock);
         // failed to lock - CameraService is probably deadlocked
         if (!locked) {
-            String8 result(kDeadlockedString);
+            result.append("CameraService may be deadlocked\n");
             write(fd, result.string(), result.size());
         }
 
         bool hasClient = false;
-        for (int i = 0; i < mNumberOfCameras; i++) {
-            sp<Client> client = mClient[i].promote();
-            if (client == 0) continue;
-            hasClient = true;
-            sprintf(buffer, "Client[%d] (%p) PID: %d\n",
-                    i,
-                    client->getCameraClient()->asBinder().get(),
-                    client->mClientPid);
-            result.append(buffer);
+        if (!mModule) {
+            result = String8::format("No camera module available!\n");
             write(fd, result.string(), result.size());
-            client->mHardware->dump(fd, args);
+            return NO_ERROR;
+        }
+
+        result = String8::format("Camera module HAL API version: 0x%x\n",
+                mModule->common.hal_api_version);
+        result.appendFormat("Camera module API version: 0x%x\n",
+                mModule->common.module_api_version);
+        result.appendFormat("Camera module name: %s\n",
+                mModule->common.name);
+        result.appendFormat("Camera module author: %s\n",
+                mModule->common.author);
+        result.appendFormat("Number of camera devices: %d\n\n", mNumberOfCameras);
+        write(fd, result.string(), result.size());
+        for (int i = 0; i < mNumberOfCameras; i++) {
+            result = String8::format("Camera %d static information:\n", i);
+            camera_info info;
+
+            status_t rc = mModule->get_camera_info(i, &info);
+            if (rc != OK) {
+                result.appendFormat("  Error reading static information!\n");
+                write(fd, result.string(), result.size());
+            } else {
+                result.appendFormat("  Facing: %s\n",
+                        info.facing == CAMERA_FACING_BACK ? "BACK" : "FRONT");
+                result.appendFormat("  Orientation: %d\n", info.orientation);
+                int deviceVersion;
+                if (mModule->common.module_api_version <
+                        CAMERA_MODULE_API_VERSION_2_0) {
+                    deviceVersion = CAMERA_DEVICE_API_VERSION_1_0;
+                } else {
+                    deviceVersion = info.device_version;
+                }
+                result.appendFormat("  Device version: 0x%x\n", deviceVersion);
+                if (deviceVersion >= CAMERA_DEVICE_API_VERSION_2_0) {
+                    result.appendFormat("  Device static metadata:\n");
+                    write(fd, result.string(), result.size());
+                    dump_indented_camera_metadata(info.static_camera_characteristics,
+                            fd, 2, 4);
+                } else {
+                    write(fd, result.string(), result.size());
+                }
+            }
+
+            sp<Client> client = mClient[i].promote();
+            if (client == 0) {
+                result = String8::format("  Device is closed, no client instance\n");
+                write(fd, result.string(), result.size());
+                continue;
+            }
+            hasClient = true;
+            result = String8::format("  Device is open. Client instance dump:\n");
+            write(fd, result.string(), result.size());
+            client->dump(fd, args);
         }
         if (!hasClient) {
-            result.append("No camera client yet.\n");
+            result = String8::format("\nNo active camera clients yet.\n");
             write(fd, result.string(), result.size());
         }
 
@@ -1336,14 +500,16 @@
         // change logging level
         int n = args.size();
         for (int i = 0; i + 1 < n; i++) {
-            if (args[i] == String16("-v")) {
+            String16 verboseOption("-v");
+            if (args[i] == verboseOption) {
                 String8 levelStr(args[i+1]);
                 int level = atoi(levelStr.string());
-                sprintf(buffer, "Set Log Level to %d", level);
-                result.append(buffer);
+                result = String8::format("\nSetting log level to %d.\n", level);
                 setLogLevel(level);
+                write(fd, result.string(), result.size());
             }
         }
+
     }
     return NO_ERROR;
 }
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 95ac197..630fca7 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -27,17 +27,18 @@
 
 namespace android {
 
+extern volatile int32_t gLogLevel;
+
 class MemoryHeapBase;
 class MediaPlayer;
-class CameraHardwareInterface;
 
 class CameraService :
     public BinderService<CameraService>,
     public BnCameraService
 {
-    class Client;
     friend class BinderService<CameraService>;
 public:
+    class Client;
     static char const* getServiceName() { return "media.camera"; }
 
                         CameraService();
@@ -68,6 +69,68 @@
     void                playSound(sound_kind kind);
     void                releaseSound();
 
+    class Client : public BnCamera
+    {
+    public:
+        // ICamera interface (see ICamera for details)
+        virtual void          disconnect();
+        virtual status_t      connect(const sp<ICameraClient>& client) = 0;
+        virtual status_t      lock() = 0;
+        virtual status_t      unlock() = 0;
+        virtual status_t      setPreviewDisplay(const sp<Surface>& surface) = 0;
+        virtual status_t      setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture) = 0;
+        virtual void          setPreviewCallbackFlag(int flag) = 0;
+        virtual status_t      startPreview() = 0;
+        virtual void          stopPreview() = 0;
+        virtual bool          previewEnabled() = 0;
+        virtual status_t      storeMetaDataInBuffers(bool enabled) = 0;
+        virtual status_t      startRecording() = 0;
+        virtual void          stopRecording() = 0;
+        virtual bool          recordingEnabled() = 0;
+        virtual void          releaseRecordingFrame(const sp<IMemory>& mem) = 0;
+        virtual status_t      autoFocus() = 0;
+        virtual status_t      cancelAutoFocus() = 0;
+        virtual status_t      takePicture(int msgType) = 0;
+        virtual status_t      setParameters(const String8& params) = 0;
+        virtual String8       getParameters() const = 0;
+        virtual status_t      sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0;
+
+        // Interface used by CameraService
+        Client(const sp<CameraService>& cameraService,
+                const sp<ICameraClient>& cameraClient,
+                int cameraId,
+                int cameraFacing,
+                int clientPid);
+        ~Client();
+
+        // return our camera client
+        const sp<ICameraClient>&    getCameraClient() {
+            return mCameraClient;
+        }
+
+        virtual status_t initialize(camera_module_t *module) = 0;
+
+        virtual status_t dump(int fd, const Vector<String16>& args) = 0;
+
+    protected:
+        static Mutex*        getClientLockFromCookie(void* user);
+        // convert client from cookie. Client lock should be acquired before getting Client.
+        static Client*       getClientFromCookie(void* user);
+
+        // the instance is in the middle of destruction. When this is set,
+        // the instance should not be accessed from callback.
+        // CameraService's mClientLock should be acquired to access this.
+        bool                            mDestructionStarted;
+
+        // these are initialized in the constructor.
+        sp<CameraService>               mCameraService;  // immutable after constructor
+        sp<ICameraClient>               mCameraClient;
+        int                             mCameraId;       // immutable after constructor
+        int                             mCameraFacing;   // immutable after constructor
+        pid_t                           mClientPid;
+
+    };
+
 private:
     Mutex               mServiceLock;
     wp<Client>          mClient[MAX_CAMERAS];  // protected by mServiceLock
@@ -86,147 +149,6 @@
     sp<MediaPlayer>     mSoundPlayer[NUM_SOUNDS];
     int                 mSoundRef;  // reference count (release all MediaPlayer when 0)
 
-    class Client : public BnCamera
-    {
-    public:
-        // ICamera interface (see ICamera for details)
-        virtual void            disconnect();
-        virtual status_t        connect(const sp<ICameraClient>& client);
-        virtual status_t        lock();
-        virtual status_t        unlock();
-        virtual status_t        setPreviewDisplay(const sp<Surface>& surface);
-        virtual status_t        setPreviewTexture(const sp<ISurfaceTexture>& surfaceTexture);
-        virtual void            setPreviewCallbackFlag(int flag);
-        virtual status_t        startPreview();
-        virtual void            stopPreview();
-        virtual bool            previewEnabled();
-        virtual status_t        storeMetaDataInBuffers(bool enabled);
-        virtual status_t        startRecording();
-        virtual void            stopRecording();
-        virtual bool            recordingEnabled();
-        virtual void            releaseRecordingFrame(const sp<IMemory>& mem);
-        virtual status_t        autoFocus();
-        virtual status_t        cancelAutoFocus();
-        virtual status_t        takePicture(int msgType);
-        virtual status_t        setParameters(const String8& params);
-        virtual String8         getParameters() const;
-        virtual status_t        sendCommand(int32_t cmd, int32_t arg1, int32_t arg2);
-    private:
-        friend class CameraService;
-                                Client(const sp<CameraService>& cameraService,
-                                       const sp<ICameraClient>& cameraClient,
-                                       const sp<CameraHardwareInterface>& hardware,
-                                       int cameraId,
-                                       int cameraFacing,
-                                       int clientPid);
-                                ~Client();
-
-        // return our camera client
-        const sp<ICameraClient>&    getCameraClient() { return mCameraClient; }
-
-        // check whether the calling process matches mClientPid.
-        status_t                checkPid() const;
-        status_t                checkPidAndHardware() const;  // also check mHardware != 0
-
-        // these are internal functions used to set up preview buffers
-        status_t                registerPreviewBuffers();
-
-        // camera operation mode
-        enum camera_mode {
-            CAMERA_PREVIEW_MODE   = 0,  // frame automatically released
-            CAMERA_RECORDING_MODE = 1,  // frame has to be explicitly released by releaseRecordingFrame()
-        };
-        // these are internal functions used for preview/recording
-        status_t                startCameraMode(camera_mode mode);
-        status_t                startPreviewMode();
-        status_t                startRecordingMode();
-
-        // internal function used by sendCommand to enable/disable shutter sound.
-        status_t                enableShutterSound(bool enable);
-
-        // these are static callback functions
-        static void             notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2, void* user);
-        static void             dataCallback(int32_t msgType, const sp<IMemory>& dataPtr,
-                                             camera_frame_metadata_t *metadata, void* user);
-        static void             dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr, void* user);
-        static Mutex*        getClientLockFromCookie(void* user);
-        // convert client from cookie. Client lock should be acquired before getting Client.
-        static Client*       getClientFromCookie(void* user);
-        // handlers for messages
-        void                    handleShutter(void);
-        void                    handlePreviewData(int32_t msgType, const sp<IMemory>& mem,
-                                                  camera_frame_metadata_t *metadata);
-        void                    handlePostview(const sp<IMemory>& mem);
-        void                    handleRawPicture(const sp<IMemory>& mem);
-        void                    handleCompressedPicture(const sp<IMemory>& mem);
-        void                    handleGenericNotify(int32_t msgType, int32_t ext1, int32_t ext2);
-        void                    handleGenericData(int32_t msgType, const sp<IMemory>& dataPtr,
-                                                  camera_frame_metadata_t *metadata);
-        void                    handleGenericDataTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr);
-
-        void                    copyFrameAndPostCopiedFrame(
-                                    int32_t msgType,
-                                    const sp<ICameraClient>& client,
-                                    const sp<IMemoryHeap>& heap,
-                                    size_t offset, size_t size,
-                                    camera_frame_metadata_t *metadata);
-
-        int                     getOrientation(int orientation, bool mirror);
-
-        status_t                setPreviewWindow(
-                                    const sp<IBinder>& binder,
-                                    const sp<ANativeWindow>& window);
-
-        // these are initialized in the constructor.
-        sp<CameraService>               mCameraService;  // immutable after constructor
-        sp<ICameraClient>               mCameraClient;
-        int                             mCameraId;       // immutable after constructor
-        int                             mCameraFacing;   // immutable after constructor
-        pid_t                           mClientPid;
-        sp<CameraHardwareInterface>     mHardware;       // cleared after disconnect()
-        int                             mPreviewCallbackFlag;
-        int                             mOrientation;     // Current display orientation
-        bool                            mPlayShutterSound;
-
-        // Ensures atomicity among the public methods
-        mutable Mutex                   mLock;
-        // A lock to synchronize access through the ICamera binder
-        // interface. The entire binder call should be done with mICameraLock
-        // locked, to serialize ICamera access, even when mLock is disabled for
-        // calls to the HAL.
-        mutable Mutex                   mICameraLock;
-        // This is a binder of Surface or SurfaceTexture.
-        sp<IBinder>                     mSurface;
-        sp<ANativeWindow>               mPreviewWindow;
-
-        // If the user want us to return a copy of the preview frame (instead
-        // of the original one), we allocate mPreviewBuffer and reuse it if possible.
-        sp<MemoryHeapBase>              mPreviewBuffer;
-
-        // the instance is in the middle of destruction. When this is set,
-        // the instance should not be accessed from callback.
-        // CameraService's mClientLock should be acquired to access this.
-        bool                            mDestructionStarted;
-
-        // We need to avoid the deadlock when the incoming command thread and
-        // the CameraHardwareInterface callback thread both want to grab mLock.
-        // An extra flag is used to tell the callback thread that it should stop
-        // trying to deliver the callback messages if the client is not
-        // interested in it anymore. For example, if the client is calling
-        // stopPreview(), the preview frame messages do not need to be delivered
-        // anymore.
-
-        // This function takes the same parameter as the enableMsgType() and
-        // disableMsgType() functions in CameraHardwareInterface.
-        void                    enableMsgType(int32_t msgType);
-        void                    disableMsgType(int32_t msgType);
-        volatile int32_t        mMsgEnabled;
-
-        // This function keeps trying to grab mLock, or give up if the message
-        // is found to be disabled. It returns true if mLock is grabbed.
-        bool                    lockIfMessageWanted(int32_t msgType);
-    };
-
     camera_module_t *mModule;
 };
 
diff --git a/services/camera/libcameraservice/CannedJpeg.h b/services/camera/libcameraservice/CannedJpeg.h
deleted file mode 100644
index 6dd99c1..0000000
--- a/services/camera/libcameraservice/CannedJpeg.h
+++ /dev/null
@@ -1,750 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-const int kCannedJpegWidth = 320;
-const int kCannedJpegHeight = 240;
-const int kCannedJpegSize = 8733;
-
-const char kCannedJpeg[] = {
-  0xff,  0xd8,  0xff,  0xe0,  0x00,  0x10,  0x4a,  0x46,  0x49,  0x46,  0x00,  0x01,
-  0x01,  0x01,  0x00,  0x60,  0x00,  0x60,  0x00,  0x00,  0xff,  0xe1,  0x00,  0x66,
-  0x45,  0x78,  0x69,  0x66,  0x00,  0x00,  0x49,  0x49,  0x2a,  0x00,  0x08,  0x00,
-  0x00,  0x00,  0x04,  0x00,  0x1a,  0x01,  0x05,  0x00,  0x01,  0x00,  0x00,  0x00,
-  0x3e,  0x00,  0x00,  0x00,  0x1b,  0x01,  0x05,  0x00,  0x01,  0x00,  0x00,  0x00,
-  0x46,  0x00,  0x00,  0x00,  0x28,  0x01,  0x03,  0x00,  0x01,  0x00,  0x00,  0x00,
-  0x02,  0x00,  0x00,  0x00,  0x31,  0x01,  0x02,  0x00,  0x10,  0x00,  0x00,  0x00,
-  0x4e,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x60,  0x00,  0x00,  0x00,
-  0x01,  0x00,  0x00,  0x00,  0x60,  0x00,  0x00,  0x00,  0x01,  0x00,  0x00,  0x00,
-  0x50,  0x61,  0x69,  0x6e,  0x74,  0x2e,  0x4e,  0x45,  0x54,  0x20,  0x76,  0x33,
-  0x2e,  0x33,  0x36,  0x00,  0xff,  0xdb,  0x00,  0x43,  0x00,  0x03,  0x02,  0x02,
-  0x03,  0x02,  0x02,  0x03,  0x03,  0x03,  0x03,  0x04,  0x03,  0x03,  0x04,  0x05,
-  0x08,  0x05,  0x05,  0x04,  0x04,  0x05,  0x0a,  0x07,  0x07,  0x06,  0x08,  0x0c,
-  0x0a,  0x0c,  0x0c,  0x0b,  0x0a,  0x0b,  0x0b,  0x0d,  0x0e,  0x12,  0x10,  0x0d,
-  0x0e,  0x11,  0x0e,  0x0b,  0x0b,  0x10,  0x16,  0x10,  0x11,  0x13,  0x14,  0x15,
-  0x15,  0x15,  0x0c,  0x0f,  0x17,  0x18,  0x16,  0x14,  0x18,  0x12,  0x14,  0x15,
-  0x14,  0xff,  0xdb,  0x00,  0x43,  0x01,  0x03,  0x04,  0x04,  0x05,  0x04,  0x05,
-  0x09,  0x05,  0x05,  0x09,  0x14,  0x0d,  0x0b,  0x0d,  0x14,  0x14,  0x14,  0x14,
-  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,
-  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,
-  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,
-  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0x14,  0xff,  0xc0,
-  0x00,  0x11,  0x08,  0x00,  0xf0,  0x01,  0x40,  0x03,  0x01,  0x22,  0x00,  0x02,
-  0x11,  0x01,  0x03,  0x11,  0x01,  0xff,  0xc4,  0x00,  0x1f,  0x00,  0x00,  0x01,
-  0x05,  0x01,  0x01,  0x01,  0x01,  0x01,  0x01,  0x00,  0x00,  0x00,  0x00,  0x00,
-  0x00,  0x00,  0x00,  0x01,  0x02,  0x03,  0x04,  0x05,  0x06,  0x07,  0x08,  0x09,
-  0x0a,  0x0b,  0xff,  0xc4,  0x00,  0xb5,  0x10,  0x00,  0x02,  0x01,  0x03,  0x03,
-  0x02,  0x04,  0x03,  0x05,  0x05,  0x04,  0x04,  0x00,  0x00,  0x01,  0x7d,  0x01,
-  0x02,  0x03,  0x00,  0x04,  0x11,  0x05,  0x12,  0x21,  0x31,  0x41,  0x06,  0x13,
-  0x51,  0x61,  0x07,  0x22,  0x71,  0x14,  0x32,  0x81,  0x91,  0xa1,  0x08,  0x23,
-  0x42,  0xb1,  0xc1,  0x15,  0x52,  0xd1,  0xf0,  0x24,  0x33,  0x62,  0x72,  0x82,
-  0x09,  0x0a,  0x16,  0x17,  0x18,  0x19,  0x1a,  0x25,  0x26,  0x27,  0x28,  0x29,
-  0x2a,  0x34,  0x35,  0x36,  0x37,  0x38,  0x39,  0x3a,  0x43,  0x44,  0x45,  0x46,
-  0x47,  0x48,  0x49,  0x4a,  0x53,  0x54,  0x55,  0x56,  0x57,  0x58,  0x59,  0x5a,
-  0x63,  0x64,  0x65,  0x66,  0x67,  0x68,  0x69,  0x6a,  0x73,  0x74,  0x75,  0x76,
-  0x77,  0x78,  0x79,  0x7a,  0x83,  0x84,  0x85,  0x86,  0x87,  0x88,  0x89,  0x8a,
-  0x92,  0x93,  0x94,  0x95,  0x96,  0x97,  0x98,  0x99,  0x9a,  0xa2,  0xa3,  0xa4,
-  0xa5,  0xa6,  0xa7,  0xa8,  0xa9,  0xaa,  0xb2,  0xb3,  0xb4,  0xb5,  0xb6,  0xb7,
-  0xb8,  0xb9,  0xba,  0xc2,  0xc3,  0xc4,  0xc5,  0xc6,  0xc7,  0xc8,  0xc9,  0xca,
-  0xd2,  0xd3,  0xd4,  0xd5,  0xd6,  0xd7,  0xd8,  0xd9,  0xda,  0xe1,  0xe2,  0xe3,
-  0xe4,  0xe5,  0xe6,  0xe7,  0xe8,  0xe9,  0xea,  0xf1,  0xf2,  0xf3,  0xf4,  0xf5,
-  0xf6,  0xf7,  0xf8,  0xf9,  0xfa,  0xff,  0xc4,  0x00,  0x1f,  0x01,  0x00,  0x03,
-  0x01,  0x01,  0x01,  0x01,  0x01,  0x01,  0x01,  0x01,  0x01,  0x00,  0x00,  0x00,
-  0x00,  0x00,  0x00,  0x01,  0x02,  0x03,  0x04,  0x05,  0x06,  0x07,  0x08,  0x09,
-  0x0a,  0x0b,  0xff,  0xc4,  0x00,  0xb5,  0x11,  0x00,  0x02,  0x01,  0x02,  0x04,
-  0x04,  0x03,  0x04,  0x07,  0x05,  0x04,  0x04,  0x00,  0x01,  0x02,  0x77,  0x00,
-  0x01,  0x02,  0x03,  0x11,  0x04,  0x05,  0x21,  0x31,  0x06,  0x12,  0x41,  0x51,
-  0x07,  0x61,  0x71,  0x13,  0x22,  0x32,  0x81,  0x08,  0x14,  0x42,  0x91,  0xa1,
-  0xb1,  0xc1,  0x09,  0x23,  0x33,  0x52,  0xf0,  0x15,  0x62,  0x72,  0xd1,  0x0a,
-  0x16,  0x24,  0x34,  0xe1,  0x25,  0xf1,  0x17,  0x18,  0x19,  0x1a,  0x26,  0x27,
-  0x28,  0x29,  0x2a,  0x35,  0x36,  0x37,  0x38,  0x39,  0x3a,  0x43,  0x44,  0x45,
-  0x46,  0x47,  0x48,  0x49,  0x4a,  0x53,  0x54,  0x55,  0x56,  0x57,  0x58,  0x59,
-  0x5a,  0x63,  0x64,  0x65,  0x66,  0x67,  0x68,  0x69,  0x6a,  0x73,  0x74,  0x75,
-  0x76,  0x77,  0x78,  0x79,  0x7a,  0x82,  0x83,  0x84,  0x85,  0x86,  0x87,  0x88,
-  0x89,  0x8a,  0x92,  0x93,  0x94,  0x95,  0x96,  0x97,  0x98,  0x99,  0x9a,  0xa2,
-  0xa3,  0xa4,  0xa5,  0xa6,  0xa7,  0xa8,  0xa9,  0xaa,  0xb2,  0xb3,  0xb4,  0xb5,
-  0xb6,  0xb7,  0xb8,  0xb9,  0xba,  0xc2,  0xc3,  0xc4,  0xc5,  0xc6,  0xc7,  0xc8,
-  0xc9,  0xca,  0xd2,  0xd3,  0xd4,  0xd5,  0xd6,  0xd7,  0xd8,  0xd9,  0xda,  0xe2,
-  0xe3,  0xe4,  0xe5,  0xe6,  0xe7,  0xe8,  0xe9,  0xea,  0xf2,  0xf3,  0xf4,  0xf5,
-  0xf6,  0xf7,  0xf8,  0xf9,  0xfa,  0xff,  0xda,  0x00,  0x0c,  0x03,  0x01,  0x00,
-  0x02,  0x11,  0x03,  0x11,  0x00,  0x3f,  0x00,  0xf9,  0xd2,  0xa3,  0x95,  0xbb,
-  0x54,  0x84,  0xe0,  0x66,  0xa0,  0x27,  0x27,  0x35,  0xed,  0x9e,  0x50,  0x95,
-  0x2c,  0x4b,  0xc6,  0x6a,  0x35,  0x1b,  0x8e,  0x2a,  0x70,  0x30,  0x28,  0x00,
-  0xa8,  0xe5,  0x6e,  0x71,  0x52,  0x31,  0xda,  0x33,  0x50,  0x13,  0x93,  0x40,
-  0x09,  0x52,  0xc6,  0xb8,  0x19,  0xf5,  0xa6,  0x2a,  0xee,  0x6c,  0x54,  0xd4,
-  0x00,  0x54,  0x52,  0x36,  0x5b,  0x1e,  0x95,  0x23,  0xb6,  0xd5,  0xcd,  0x41,
-  0x40,  0x05,  0x4c,  0x8b,  0xb5,  0x7d,  0xea,  0x34,  0x5d,  0xcd,  0xed,  0x53,
-  0x50,  0x01,  0x50,  0xbb,  0x6e,  0x6f,  0x6a,  0x91,  0xdb,  0x6a,  0xfb,  0xd4,
-  0x34,  0x00,  0x54,  0xe8,  0xbb,  0x57,  0x15,  0x1c,  0x6b,  0x96,  0xcf,  0xa5,
-  0x4b,  0x40,  0x05,  0x42,  0xcd,  0xb9,  0xb3,  0x4f,  0x91,  0xb0,  0x31,  0xeb,
-  0x51,  0x50,  0x02,  0x81,  0x93,  0x53,  0xa8,  0xda,  0x31,  0x51,  0xc4,  0xbc,
-  0xe6,  0xa4,  0xa0,  0x00,  0x9c,  0x0a,  0x81,  0x8e,  0xe3,  0x9a,  0x92,  0x56,
-  0xe3,  0x15,  0x15,  0x00,  0x28,  0x19,  0x38,  0xa9,  0xc0,  0xc0,  0xc5,  0x47,
-  0x12,  0xf7,  0xa9,  0x28,  0x00,  0x27,  0x00,  0x9a,  0x80,  0x9c,  0x9c,  0xd3,
-  0xe5,  0x6e,  0xd5,  0x1d,  0x00,  0x2a,  0x8d,  0xc7,  0x15,  0x3d,  0x32,  0x35,
-  0xc0,  0xcf,  0xad,  0x3e,  0x80,  0x11,  0x8e,  0xd1,  0x9a,  0x82,  0x9f,  0x23,
-  0x64,  0xe3,  0xd2,  0x99,  0x40,  0x0e,  0x45,  0xdc,  0xde,  0xd5,  0x35,  0x36,
-  0x35,  0xc2,  0xfb,  0x9a,  0x75,  0x00,  0x35,  0xdb,  0x6a,  0xfb,  0xd4,  0x34,
-  0xe9,  0x1b,  0x73,  0x7b,  0x0a,  0x6d,  0x00,  0x3e,  0x35,  0xcb,  0x7b,  0x0a,
-  0x96,  0x91,  0x17,  0x6a,  0xd2,  0xd0,  0x03,  0x64,  0x6c,  0x2f,  0xb9,  0xa8,
-  0x69,  0xce,  0xdb,  0x9a,  0x9b,  0xd6,  0x80,  0x1f,  0x12,  0xe4,  0xe7,  0xd2,
-  0xa5,  0xa4,  0x51,  0xb4,  0x62,  0x97,  0xa5,  0x00,  0x67,  0xc9,  0xad,  0xd8,
-  0x91,  0x81,  0x72,  0x9f,  0x9d,  0x47,  0xfd,  0xb3,  0x65,  0xff,  0x00,  0x3f,
-  0x29,  0x5f,  0xa0,  0x1f,  0xf0,  0xe9,  0x6f,  0x09,  0x7f,  0xd0,  0xfb,  0xad,
-  0x7f,  0xe0,  0x24,  0x34,  0x7f,  0xc3,  0xa5,  0xbc,  0x25,  0xff,  0x00,  0x43,
-  0xee,  0xb5,  0xff,  0x00,  0x80,  0x90,  0xd7,  0x3f,  0xb7,  0x87,  0x73,  0x6f,
-  0x63,  0x33,  0xe0,  0x28,  0xf5,  0x9b,  0x11,  0xc9,  0xb9,  0x4c,  0xfd,  0x69,
-  0xff,  0x00,  0xdb,  0x96,  0x1f,  0xf3,  0xf5,  0x1f,  0xe7,  0x5f,  0x7d,  0x7f,
-  0xc3,  0xa5,  0xbc,  0x25,  0xff,  0x00,  0x43,  0xee,  0xb5,  0xff,  0x00,  0x80,
-  0x90,  0xd1,  0xff,  0x00,  0x0e,  0x96,  0xf0,  0x97,  0xfd,  0x0f,  0xba,  0xd7,
-  0xfe,  0x02,  0x43,  0x47,  0xb7,  0x87,  0x70,  0xf6,  0x33,  0x3e,  0x02,  0x93,
-  0x5b,  0xb1,  0x3c,  0x0b,  0x94,  0xc7,  0xd6,  0x99,  0xfd,  0xb3,  0x65,  0xff,
-  0x00,  0x3f,  0x29,  0xf9,  0xd7,  0xe8,  0x07,  0xfc,  0x3a,  0x5b,  0xc2,  0x5f,
-  0xf4,  0x3e,  0xeb,  0x5f,  0xf8,  0x09,  0x0d,  0x1f,  0xf0,  0xe9,  0x6f,  0x09,
-  0x7f,  0xd0,  0xfb,  0xad,  0x7f,  0xe0,  0x24,  0x34,  0xbd,  0xbc,  0x03,  0xd8,
-  0xcc,  0xf8,  0x0e,  0x3d,  0x6a,  0xc1,  0x47,  0x37,  0x29,  0x9f,  0xad,  0x3b,
-  0xfb,  0x72,  0xc3,  0xfe,  0x7e,  0xa3,  0xfc,  0xeb,  0xef,  0xaf,  0xf8,  0x74,
-  0xb7,  0x84,  0xbf,  0xe8,  0x7d,  0xd6,  0xbf,  0xf0,  0x12,  0x1a,  0x3f,  0xe1,
-  0xd2,  0xde,  0x12,  0xff,  0x00,  0xa1,  0xf7,  0x5a,  0xff,  0x00,  0xc0,  0x48,
-  0x69,  0xfb,  0x78,  0x77,  0x0f,  0x63,  0x33,  0xe0,  0x19,  0x35,  0xbb,  0x26,
-  0x3c,  0x5c,  0xa6,  0x3e,  0xb4,  0xdf,  0xed,  0x9b,  0x2f,  0xf9,  0xf9,  0x4a,
-  0xfd,  0x00,  0xff,  0x00,  0x87,  0x4b,  0x78,  0x4b,  0xfe,  0x87,  0xdd,  0x6b,
-  0xff,  0x00,  0x01,  0x21,  0xa3,  0xfe,  0x1d,  0x2d,  0xe1,  0x2f,  0xfa,  0x1f,
-  0x75,  0xaf,  0xfc,  0x04,  0x86,  0x97,  0xb7,  0x80,  0x7b,  0x19,  0x9f,  0x01,
-  0xa6,  0xb5,  0x60,  0xab,  0xff,  0x00,  0x1f,  0x51,  0xe7,  0xeb,  0x4e,  0xfe,
-  0xdc,  0xb0,  0xff,  0x00,  0x9f,  0xa8,  0xff,  0x00,  0x3a,  0xfb,  0xeb,  0xfe,
-  0x1d,  0x2d,  0xe1,  0x2f,  0xfa,  0x1f,  0x75,  0xaf,  0xfc,  0x04,  0x86,  0x8f,
-  0xf8,  0x74,  0xb7,  0x84,  0xbf,  0xe8,  0x7d,  0xd6,  0xbf,  0xf0,  0x12,  0x1a,
-  0x3d,  0xbc,  0x03,  0xd8,  0xcc,  0xf8,  0x05,  0xf5,  0xab,  0x26,  0x6f,  0xf8,
-  0xf9,  0x4c,  0x7d,  0x69,  0xbf,  0xdb,  0x36,  0x5f,  0xf3,  0xf2,  0x9f,  0x9d,
-  0x7e,  0x80,  0x7f,  0xc3,  0xa5,  0xbc,  0x25,  0xff,  0x00,  0x43,  0xee,  0xb5,
-  0xff,  0x00,  0x80,  0x90,  0xd1,  0xff,  0x00,  0x0e,  0x96,  0xf0,  0x97,  0xfd,
-  0x0f,  0xba,  0xd7,  0xfe,  0x02,  0x43,  0x47,  0xb7,  0x80,  0x7b,  0x19,  0x9f,
-  0x02,  0x26,  0xb5,  0x60,  0xab,  0x8f,  0xb5,  0x47,  0xf9,  0xd2,  0xff,  0x00,
-  0x6e,  0x58,  0x7f,  0xcf,  0xd4,  0x7f,  0x9d,  0x7d,  0xf5,  0xff,  0x00,  0x0e,
-  0x96,  0xf0,  0x97,  0xfd,  0x0f,  0xba,  0xd7,  0xfe,  0x02,  0x43,  0x47,  0xfc,
-  0x3a,  0x5b,  0xc2,  0x5f,  0xf4,  0x3e,  0xeb,  0x5f,  0xf8,  0x09,  0x0d,  0x1e,
-  0xde,  0x01,  0xec,  0x66,  0x7c,  0x00,  0xda,  0xd5,  0x93,  0x1c,  0xfd,  0xa5,
-  0x3f,  0x3a,  0x4f,  0xed,  0x8b,  0x2f,  0xf9,  0xf9,  0x4f,  0xce,  0xbf,  0x40,
-  0x3f,  0xe1,  0xd2,  0xde,  0x12,  0xff,  0x00,  0xa1,  0xf7,  0x5a,  0xff,  0x00,
-  0xc0,  0x48,  0x68,  0xff,  0x00,  0x87,  0x4b,  0x78,  0x4b,  0xfe,  0x87,  0xdd,
-  0x6b,  0xff,  0x00,  0x01,  0x21,  0xa7,  0xed,  0xe1,  0xdc,  0x3d,  0x8c,  0xcf,
-  0x81,  0x57,  0x5a,  0xb0,  0x51,  0x8f,  0xb5,  0x47,  0xf9,  0xd1,  0xfd,  0xb9,
-  0x61,  0xff,  0x00,  0x3f,  0x49,  0xf9,  0xd7,  0xdf,  0x5f,  0xf0,  0xe9,  0x6f,
-  0x09,  0x7f,  0xd0,  0xfb,  0xad,  0x7f,  0xe0,  0x24,  0x34,  0x7f,  0xc3,  0xa5,
-  0xbc,  0x25,  0xff,  0x00,  0x43,  0xee,  0xb5,  0xff,  0x00,  0x80,  0x90,  0xd2,
-  0xf6,  0xf0,  0x0f,  0x63,  0x33,  0xe0,  0x06,  0xd6,  0xac,  0x98,  0xe7,  0xed,
-  0x29,  0xf9,  0xd2,  0x0d,  0x62,  0xcb,  0xfe,  0x7e,  0x53,  0xf3,  0xaf,  0xd0,
-  0x0f,  0xf8,  0x74,  0xb7,  0x84,  0xbf,  0xe8,  0x7d,  0xd6,  0xbf,  0xf0,  0x12,
-  0x1a,  0x3f,  0xe1,  0xd2,  0xde,  0x12,  0xff,  0x00,  0xa1,  0xf7,  0x5a,  0xff,
-  0x00,  0xc0,  0x48,  0x69,  0xfb,  0x78,  0x77,  0x0f,  0x63,  0x33,  0xe0,  0x51,
-  0xad,  0xd8,  0x01,  0x8f,  0xb5,  0x47,  0xf9,  0xd0,  0x75,  0xcb,  0x0c,  0x7f,
-  0xc7,  0xca,  0x7e,  0x75,  0xf7,  0xd7,  0xfc,  0x3a,  0x5b,  0xc2,  0x5f,  0xf4,
-  0x3e,  0xeb,  0x5f,  0xf8,  0x09,  0x0d,  0x1f,  0xf0,  0xe9,  0x6f,  0x09,  0x7f,
-  0xd0,  0xfb,  0xad,  0x7f,  0xe0,  0x24,  0x34,  0x7b,  0x78,  0x77,  0x0f,  0x63,
-  0x33,  0xf3,  0xfc,  0xeb,  0x36,  0x44,  0xff,  0x00,  0xc7,  0xca,  0x7e,  0x74,
-  0xa3,  0x58,  0xb1,  0x24,  0x66,  0xe5,  0x31,  0xf5,  0xaf,  0xbf,  0xff,  0x00,
-  0xe1,  0xd2,  0xde,  0x12,  0xff,  0x00,  0xa1,  0xf7,  0x5a,  0xff,  0x00,  0xc0,
-  0x48,  0x68,  0xff,  0x00,  0x87,  0x4b,  0x78,  0x4b,  0xfe,  0x87,  0xdd,  0x6b,
-  0xff,  0x00,  0x01,  0x21,  0xa3,  0xdb,  0xc3,  0xb8,  0x7b,  0x19,  0x9f,  0x02,
-  0xff,  0x00,  0x6d,  0xd8,  0x7f,  0xcf,  0xd4,  0x7f,  0x9d,  0x07,  0x5c,  0xb1,
-  0x03,  0x8b,  0x94,  0xcf,  0xd6,  0xbe,  0xfa,  0xff,  0x00,  0x87,  0x4b,  0x78,
-  0x4b,  0xfe,  0x87,  0xdd,  0x6b,  0xff,  0x00,  0x01,  0x21,  0xa3,  0xfe,  0x1d,
-  0x2d,  0xe1,  0x2f,  0xfa,  0x1f,  0x75,  0xaf,  0xfc,  0x04,  0x86,  0x8f,  0x6f,
-  0x0e,  0xe1,  0xec,  0x66,  0x7e,  0x7f,  0xff,  0x00,  0x6c,  0xd9,  0x7f,  0xcf,
-  0xca,  0x7e,  0x74,  0xab,  0xac,  0x58,  0xe7,  0x9b,  0x94,  0xc7,  0xd6,  0xbe,
-  0xff,  0x00,  0xff,  0x00,  0x87,  0x4b,  0x78,  0x4b,  0xfe,  0x87,  0xdd,  0x6b,
-  0xff,  0x00,  0x01,  0x21,  0xa3,  0xfe,  0x1d,  0x2d,  0xe1,  0x2f,  0xfa,  0x1f,
-  0x75,  0xaf,  0xfc,  0x04,  0x86,  0x8f,  0x6f,  0x0e,  0xe1,  0xec,  0x66,  0x7c,
-  0x0b,  0xfd,  0xb9,  0x61,  0xff,  0x00,  0x3f,  0x51,  0xfe,  0x74,  0x8d,  0xae,
-  0x58,  0xed,  0x38,  0xb9,  0x4c,  0xfd,  0x6b,  0xef,  0xbf,  0xf8,  0x74,  0xb7,
-  0x84,  0xbf,  0xe8,  0x7d,  0xd6,  0xbf,  0xf0,  0x12,  0x1a,  0x3f,  0xe1,  0xd2,
-  0xde,  0x12,  0xff,  0x00,  0xa1,  0xf7,  0x5a,  0xff,  0x00,  0xc0,  0x48,  0x68,
-  0xf6,  0xf0,  0xee,  0x1e,  0xc6,  0x67,  0xe7,  0xff,  0x00,  0xf6,  0xc5,  0x97,
-  0xfc,  0xfc,  0xa7,  0xe7,  0x4e,  0x4d,  0x62,  0xc7,  0x77,  0x37,  0x29,  0xf9,
-  0xd7,  0xdf,  0xdf,  0xf0,  0xe9,  0x6f,  0x09,  0x7f,  0xd0,  0xfb,  0xad,  0x7f,
-  0xe0,  0x24,  0x34,  0x7f,  0xc3,  0xa5,  0xbc,  0x25,  0xff,  0x00,  0x43,  0xee,
-  0xb5,  0xff,  0x00,  0x80,  0x90,  0xd1,  0xed,  0xe1,  0xdc,  0x3d,  0x8c,  0xcf,
-  0x81,  0x7f,  0xb7,  0x2c,  0x3f,  0xe7,  0xea,  0x3f,  0xce,  0x91,  0xf5,  0xcb,
-  0x1c,  0x71,  0x72,  0x9f,  0x9d,  0x7d,  0xf7,  0xff,  0x00,  0x0e,  0x96,  0xf0,
-  0x97,  0xfd,  0x0f,  0xba,  0xd7,  0xfe,  0x02,  0x43,  0x47,  0xfc,  0x3a,  0x5b,
-  0xc2,  0x5f,  0xf4,  0x3e,  0xeb,  0x5f,  0xf8,  0x09,  0x0d,  0x1e,  0xde,  0x1d,
-  0xc3,  0xd8,  0xcc,  0xfc,  0xff,  0x00,  0xfe,  0xd9,  0xb2,  0xff,  0x00,  0x9f,
-  0x94,  0xfc,  0xe9,  0xd1,  0xeb,  0x36,  0x20,  0xe4,  0xdc,  0xa7,  0xe7,  0x5f,
-  0x7f,  0x7f,  0xc3,  0xa5,  0xbc,  0x25,  0xff,  0x00,  0x43,  0xee,  0xb5,  0xff,
-  0x00,  0x80,  0x90,  0xd1,  0xff,  0x00,  0x0e,  0x96,  0xf0,  0x97,  0xfd,  0x0f,
-  0xba,  0xd7,  0xfe,  0x02,  0x43,  0x47,  0xb7,  0x87,  0x70,  0xf6,  0x33,  0x3e,
-  0x05,  0xfe,  0xdc,  0xb0,  0xff,  0x00,  0x9f,  0xa8,  0xff,  0x00,  0x3a,  0x6c,
-  0x9a,  0xdd,  0x89,  0x18,  0x17,  0x29,  0xf9,  0xd7,  0xdf,  0x9f,  0xf0,  0xe9,
-  0x6f,  0x09,  0x7f,  0xd0,  0xfb,  0xad,  0x7f,  0xe0,  0x24,  0x34,  0x7f,  0xc3,
-  0xa5,  0xbc,  0x25,  0xff,  0x00,  0x43,  0xee,  0xb5,  0xff,  0x00,  0x80,  0x90,
-  0xd1,  0xed,  0xe1,  0xdc,  0x3d,  0x8c,  0xcf,  0xbc,  0xa8,  0xa2,  0x8a,  0xf3,
-  0x0e,  0xf0,  0xa2,  0x8a,  0x28,  0x00,  0xa2,  0x8a,  0x28,  0x00,  0xa2,  0x8a,
-  0x28,  0x00,  0xa2,  0x8a,  0x28,  0x00,  0xa2,  0x8a,  0x28,  0x00,  0xa2,  0x8a,
-  0x28,  0x00,  0xa2,  0x8a,  0x28,  0x00,  0xa2,  0xa0,  0xbb,  0xbd,  0xb7,  0xb0,
-  0x88,  0x49,  0x73,  0x3c,  0x56,  0xf1,  0x96,  0x0a,  0x1e,  0x57,  0x0a,  0x09,
-  0x3d,  0x06,  0x4f,  0x7a,  0x9e,  0x95,  0xd3,  0x76,  0xea,  0x01,  0x45,  0x14,
-  0x53,  0x00,  0xa2,  0x8a,  0x28,  0x00,  0xa2,  0x8a,  0x82,  0xda,  0xf6,  0xde,
-  0xf0,  0xca,  0x2d,  0xe7,  0x8a,  0x73,  0x13,  0x98,  0xe4,  0xf2,  0xdc,  0x36,
-  0xc6,  0x1d,  0x54,  0xe3,  0xa1,  0xf6,  0xa4,  0xda,  0x4e,  0xcc,  0x09,  0xe8,
-  0xa2,  0x8a,  0x60,  0x14,  0x51,  0x45,  0x00,  0x14,  0x51,  0x45,  0x00,  0x14,
-  0x51,  0x45,  0x00,  0x14,  0x51,  0x45,  0x00,  0x14,  0x51,  0x45,  0x00,  0x14,
-  0x51,  0x45,  0x00,  0x14,  0x51,  0x45,  0x00,  0x14,  0x51,  0x45,  0x02,  0xb8,
-  0x51,  0x45,  0x14,  0x05,  0xc2,  0x8a,  0x28,  0xa0,  0x2e,  0x14,  0x51,  0x45,
-  0x01,  0x70,  0xa2,  0x8a,  0x28,  0x18,  0x51,  0x45,  0x14,  0x0a,  0xe1,  0x45,
-  0x14,  0x50,  0x17,  0x0a,  0x28,  0xa2,  0x80,  0xb9,  0xca,  0xfc,  0x4a,  0xf0,
-  0x52,  0x78,  0xef,  0xc2,  0xb7,  0x1a,  0x76,  0xef,  0x2e,  0xe5,  0x4f,  0x9d,
-  0x6c,  0xe4,  0xe0,  0x09,  0x00,  0x38,  0xcf,  0xb1,  0xc9,  0x1f,  0x8e,  0x7b,
-  0x57,  0x3d,  0xf0,  0x5b,  0xc7,  0x53,  0x6b,  0xba,  0x6c,  0xda,  0x16,  0xaa,
-  0x5a,  0x3d,  0x73,  0x4a,  0xfd,  0xd4,  0x8b,  0x2f,  0xdf,  0x91,  0x01,  0xc0,
-  0x27,  0xdc,  0x1e,  0x0f,  0xe0,  0x7b,  0xd7,  0xa3,  0x5c,  0xdc,  0xc5,  0x67,
-  0x04,  0x93,  0xcf,  0x2a,  0x43,  0x0c,  0x60,  0xb3,  0xc9,  0x23,  0x05,  0x55,
-  0x1e,  0xa4,  0x9e,  0x95,  0xf3,  0x47,  0xc4,  0x8f,  0x1f,  0xe9,  0x36,  0xdf,
-  0x10,  0xed,  0x3c,  0x41,  0xe1,  0x39,  0x99,  0xaf,  0xa1,  0xe2,  0xea,  0x42,
-  0x98,  0x82,  0x72,  0x38,  0xe3,  0x90,  0x4e,  0x46,  0x41,  0xe9,  0x9c,  0x0c,
-  0x7a,  0xd7,  0xc4,  0x67,  0x98,  0x9a,  0x59,  0x3e,  0x26,  0x9e,  0x64,  0xa6,
-  0x93,  0x7e,  0xec,  0xe3,  0x7d,  0x65,  0x1e,  0xe9,  0x77,  0x8b,  0xd7,  0xd3,
-  0x4b,  0x99,  0x4d,  0xa8,  0xbe,  0x63,  0xe9,  0xca,  0x2b,  0xe4,  0x3d,  0x73,
-  0xe3,  0x3f,  0x8b,  0xb5,  0xc6,  0x6d,  0xfa,  0xb4,  0x96,  0x71,  0x9e,  0x91,
-  0x59,  0x0f,  0x28,  0x0f,  0xc4,  0x7c,  0xdf,  0x99,  0xae,  0x56,  0xe7,  0x5a,
-  0xd4,  0x6f,  0x18,  0xb5,  0xc5,  0xfd,  0xd4,  0xec,  0x7b,  0xc9,  0x33,  0x31,
-  0xfd,  0x4d,  0x78,  0x75,  0xf8,  0xfb,  0x0b,  0x07,  0x6a,  0x14,  0x65,  0x25,
-  0xe6,  0xd2,  0xff,  0x00,  0x32,  0x1d,  0x75,  0xd1,  0x1f,  0x73,  0x51,  0x5f,
-  0x0b,  0xdb,  0xea,  0xf7,  0xf6,  0xad,  0xba,  0x0b,  0xdb,  0x88,  0x58,  0x77,
-  0x8e,  0x56,  0x53,  0xfa,  0x1a,  0xe9,  0xf4,  0x5f,  0x8b,  0xfe,  0x2e,  0xd0,
-  0xd9,  0x7c,  0xad,  0x66,  0x7b,  0x84,  0x1f,  0xf2,  0xce,  0xec,  0xf9,  0xc0,
-  0xff,  0x00,  0xdf,  0x59,  0x23,  0xf0,  0x34,  0xa8,  0x71,  0xf6,  0x1a,  0x4e,
-  0xd5,  0xa8,  0x4a,  0x2b,  0xc9,  0xa7,  0xfe,  0x40,  0xab,  0xae,  0xa8,  0xfa,
-  0x13,  0xe2,  0xff,  0x00,  0x8f,  0xcf,  0x82,  0xfc,  0x3e,  0x21,  0xb3,  0x6d,
-  0xda,  0xcd,  0xfe,  0x62,  0xb5,  0x45,  0xe5,  0x97,  0xb1,  0x7c,  0x7b,  0x67,
-  0x8f,  0x72,  0x3d,  0xea,  0x5f,  0x84,  0x7e,  0x05,  0x6f,  0x04,  0x78,  0x60,
-  0x2d,  0xd1,  0x2d,  0xa9,  0xde,  0xb0,  0x9e,  0xe8,  0x93,  0x9d,  0xad,  0x8e,
-  0x17,  0xf0,  0x1d,  0x4f,  0xa9,  0x35,  0xe2,  0x5e,  0x13,  0xf8,  0x89,  0x61,
-  0xac,  0xfc,  0x49,  0x8f,  0xc4,  0x3e,  0x30,  0x76,  0xcc,  0x68,  0x16,  0xd8,
-  0x43,  0x19,  0x68,  0x61,  0x61,  0xd0,  0x91,  0x92,  0x40,  0x1c,  0x9e,  0x33,
-  0xc9,  0xcd,  0x7d,  0x3b,  0x63,  0x7f,  0x6d,  0xaa,  0x5a,  0x45,  0x75,  0x69,
-  0x3c,  0x77,  0x36,  0xd2,  0x8d,  0xc9,  0x2c,  0x4c,  0x19,  0x58,  0x7b,  0x11,
-  0x5e,  0xde,  0x4d,  0x8b,  0xa3,  0x9d,  0xe3,  0x2a,  0x66,  0x1c,  0xe9,  0xf2,
-  0x5e,  0x30,  0x8f,  0x58,  0xae,  0xb2,  0x6b,  0xbc,  0xbf,  0x05,  0xa1,  0x50,
-  0x6a,  0x6f,  0x98,  0xb1,  0x45,  0x14,  0x57,  0xdc,  0x9b,  0x5c,  0x28,  0xa2,
-  0x8a,  0x02,  0xe1,  0x45,  0x14,  0x50,  0x17,  0x0a,  0x28,  0xa2,  0x80,  0xb8,
-  0x51,  0x45,  0x14,  0x05,  0xc2,  0x8a,  0x28,  0xa0,  0x2e,  0x14,  0x51,  0x45,
-  0x01,  0x70,  0xa2,  0x8a,  0x28,  0x0b,  0x8d,  0xcd,  0x19,  0xa6,  0xe4,  0x51,
-  0x91,  0x55,  0x62,  0x47,  0x66,  0x8c,  0xd3,  0x72,  0x28,  0xc8,  0xa2,  0xc0,
-  0x3b,  0x34,  0x66,  0x9b,  0x91,  0x46,  0x45,  0x16,  0x01,  0xd9,  0xa3,  0x34,
-  0xdc,  0x8a,  0x32,  0x28,  0xb0,  0x0e,  0xcd,  0x19,  0xa6,  0xe4,  0x52,  0xe4,
-  0x51,  0x60,  0xb8,  0xb9,  0xa3,  0x34,  0xdc,  0x8a,  0x32,  0x28,  0xb0,  0x0e,
-  0xdd,  0x46,  0x69,  0xb9,  0x14,  0x64,  0x51,  0x60,  0x1d,  0x9a,  0xa7,  0xac,
-  0x6b,  0x16,  0x9a,  0x0e,  0x9b,  0x71,  0xa8,  0x5f,  0x4c,  0x20,  0xb5,  0x81,
-  0x37,  0xbb,  0x9e,  0xc3,  0xd0,  0x7a,  0x93,  0xd0,  0x0a,  0xb5,  0x91,  0x5f,
-  0x39,  0xfe,  0xd1,  0x1e,  0x37,  0x7d,  0x4b,  0x5a,  0x4f,  0x0f,  0x5b,  0x48,
-  0x45,  0xa5,  0x96,  0x1e,  0x70,  0xa7,  0xef,  0xca,  0x46,  0x40,  0x3f,  0xee,
-  0x83,  0xf9,  0x93,  0xe9,  0x5e,  0x06,  0x79,  0x9a,  0xc3,  0x27,  0xc1,  0x4b,
-  0x12,  0xd5,  0xe5,  0xb4,  0x57,  0x76,  0xff,  0x00,  0xab,  0xbf,  0x24,  0x44,
-  0xe5,  0xca,  0xae,  0x72,  0xbf,  0x12,  0xbe,  0x2a,  0xea,  0x3e,  0x3e,  0xbd,
-  0x78,  0xd5,  0x9e,  0xd3,  0x48,  0x46,  0xfd,  0xd5,  0xa2,  0x9f,  0xbd,  0xe8,
-  0xcf,  0xea,  0x7f,  0x41,  0xdb,  0xd4,  0xc3,  0xe0,  0x5f,  0x85,  0x1a,  0xd7,
-  0x8f,  0xed,  0xe6,  0xb9,  0xb1,  0xf2,  0x2d,  0xed,  0x22,  0x6d,  0x86,  0x7b,
-  0x96,  0x21,  0x59,  0xb1,  0x9c,  0x0c,  0x02,  0x4f,  0x51,  0xf9,  0xd7,  0x19,
-  0x5e,  0xcd,  0xf0,  0x73,  0xe3,  0x16,  0x97,  0xe1,  0x0d,  0x06,  0x4d,  0x23,
-  0x57,  0x49,  0x63,  0x44,  0x95,  0xa5,  0x86,  0x78,  0x53,  0x78,  0x21,  0xba,
-  0xab,  0x0e,  0xb9,  0xcf,  0x7f,  0x7f,  0x6a,  0xfc,  0x1b,  0x2e,  0xa9,  0x87,
-  0xcd,  0xb3,  0x2f,  0x69,  0x9c,  0xd5,  0x6a,  0x2e,  0xfa,  0xde,  0xda,  0xf4,
-  0x57,  0xe8,  0xbf,  0xe1,  0x8e,  0x48,  0xda,  0x52,  0xf7,  0x8f,  0x30,  0xf1,
-  0x57,  0x85,  0x75,  0x0f,  0x06,  0xeb,  0x12,  0x69,  0xba,  0x94,  0x42,  0x3b,
-  0x84,  0x01,  0x83,  0x21,  0xca,  0xba,  0x9e,  0x8c,  0xa7,  0xb8,  0xac,  0x8a,
-  0xed,  0x3e,  0x2c,  0xf8,  0xee,  0x1f,  0x1f,  0xf8,  0x9c,  0x5e,  0xda,  0xc2,
-  0xf0,  0xda,  0x41,  0x08,  0x82,  0x2f,  0x33,  0x01,  0xd8,  0x02,  0x49,  0x63,
-  0xe9,  0xc9,  0x3c,  0x57,  0x17,  0x5e,  0x26,  0x3e,  0x9e,  0x1e,  0x96,  0x2a,
-  0xa4,  0x30,  0xb2,  0xe6,  0xa6,  0x9b,  0xb3,  0xee,  0x88,  0x76,  0xbe,  0x81,
-  0x5a,  0x1a,  0x06,  0x83,  0x7b,  0xe2,  0x7d,  0x5e,  0xdf,  0x4d,  0xd3,  0xe2,
-  0xf3,  0xae,  0xa7,  0x38,  0x55,  0xce,  0x00,  0x00,  0x64,  0x92,  0x7b,  0x00,
-  0x39,  0xac,  0xfa,  0xea,  0x3e,  0x1b,  0x78,  0xc1,  0x7c,  0x0d,  0xe2,  0xcb,
-  0x5d,  0x52,  0x58,  0x4c,  0xf6,  0xe1,  0x5a,  0x39,  0x51,  0x3e,  0xf6,  0xd6,
-  0x18,  0x24,  0x7b,  0x8e,  0x0d,  0x67,  0x83,  0x85,  0x1a,  0x98,  0x8a,  0x70,
-  0xc4,  0x4b,  0x96,  0x0d,  0xae,  0x67,  0xd9,  0x5f,  0x50,  0x56,  0xbe,  0xa6,
-  0x97,  0x8d,  0x7e,  0x0e,  0xeb,  0xde,  0x06,  0xd3,  0x17,  0x50,  0xbb,  0x36,
-  0xf7,  0x56,  0x99,  0x0b,  0x24,  0x96,  0xae,  0x4f,  0x96,  0x4f,  0x4d,  0xc0,
-  0x81,  0xc1,  0x3c,  0x66,  0xa9,  0xfc,  0x3e,  0xf8,  0x93,  0xaa,  0x78,  0x03,
-  0x50,  0x0f,  0x6c,  0xe6,  0x7b,  0x07,  0x6f,  0xdf,  0xd9,  0x3b,  0x7c,  0x8e,
-  0x3d,  0x47,  0xa3,  0x7b,  0xfe,  0x79,  0xaf,  0x45,  0xf8,  0xad,  0xf1,  0xb3,
-  0x47,  0xf1,  0x27,  0x85,  0x26,  0xd2,  0x34,  0x84,  0x9a,  0x67,  0xbb,  0x2b,
-  0xe6,  0xcb,  0x34,  0x7b,  0x04,  0x6a,  0x18,  0x36,  0x07,  0xa9,  0xc8,  0x1e,
-  0xd5,  0xe1,  0x95,  0xf4,  0x39,  0xab,  0xc2,  0x65,  0x79,  0x84,  0x67,  0x93,
-  0x55,  0x6d,  0x24,  0x9d,  0xd3,  0xbd,  0x9f,  0x55,  0x7e,  0xaa,  0xd6,  0xbe,
-  0xfb,  0xd8,  0xb9,  0x5a,  0x32,  0xf7,  0x59,  0xf6,  0xef,  0x86,  0xbc,  0x49,
-  0x63,  0xe2,  0xbd,  0x1a,  0xdf,  0x53,  0xd3,  0xe5,  0xf3,  0x2d,  0xe6,  0x1d,
-  0xfe,  0xf2,  0x1e,  0xea,  0xc3,  0xb1,  0x15,  0xa9,  0x9a,  0xf9,  0x7b,  0xe0,
-  0x27,  0x8d,  0xe4,  0xf0,  0xef,  0x8a,  0x53,  0x4a,  0x9e,  0x43,  0xfd,  0x9f,
-  0xa9,  0x30,  0x8f,  0x69,  0x3c,  0x24,  0xdf,  0xc0,  0xc3,  0xeb,  0xf7,  0x7f,
-  0x11,  0xe9,  0x5f,  0x4f,  0xe4,  0x57,  0xee,  0x3c,  0x3f,  0x9b,  0xc7,  0x39,
-  0xc1,  0x2a,  0xed,  0x5a,  0x6b,  0x49,  0x2f,  0x3f,  0xf2,  0x7b,  0xfe,  0x1d,
-  0x0e,  0xb8,  0x4f,  0x99,  0x5c,  0x76,  0x4d,  0x19,  0xa6,  0xe4,  0x51,  0x91,
-  0x5f,  0x4b,  0x62,  0xc7,  0x64,  0xd1,  0x9a,  0x6e,  0x45,  0x19,  0x14,  0x58,
-  0x2e,  0x3b,  0x34,  0x66,  0x9b,  0x91,  0x46,  0x45,  0x16,  0x0b,  0x8e,  0xcd,
-  0x19,  0xa6,  0xe4,  0x51,  0x91,  0x45,  0x80,  0x76,  0x68,  0xcd,  0x37,  0x34,
-  0x64,  0x51,  0x60,  0xb8,  0xec,  0xd1,  0x9a,  0x6e,  0x45,  0x19,  0x14,  0x58,
-  0x07,  0x64,  0xd1,  0x9a,  0x6e,  0x45,  0x19,  0x14,  0x58,  0x06,  0x6e,  0xa3,
-  0x75,  0x37,  0x34,  0x66,  0xae,  0xc4,  0x5c,  0x76,  0xea,  0x37,  0x53,  0x73,
-  0x46,  0x68,  0xb0,  0x5c,  0x76,  0xea,  0x37,  0x53,  0x73,  0x46,  0x68,  0xb0,
-  0x5c,  0x76,  0xea,  0x37,  0x53,  0x72,  0x28,  0xcd,  0x16,  0x0b,  0x8e,  0xdd,
-  0x46,  0xea,  0x6e,  0x68,  0xcd,  0x16,  0x0b,  0x8e,  0xdd,  0x46,  0xea,  0x6e,
-  0x68,  0xcd,  0x16,  0x0b,  0x8e,  0xdd,  0x46,  0xea,  0xc4,  0xf1,  0x57,  0x8c,
-  0x34,  0xaf,  0x06,  0x69,  0xff,  0x00,  0x6b,  0xd5,  0x2e,  0x44,  0x28,  0xc7,
-  0x08,  0x8a,  0x37,  0x3c,  0x87,  0xd1,  0x47,  0x7f,  0xe5,  0x5c,  0x0d,  0x9f,
-  0xed,  0x1f,  0xe1,  0xcb,  0x8b,  0xc1,  0x14,  0xd6,  0x97,  0xf6,  0xb0,  0x93,
-  0x81,  0x3b,  0xa2,  0xb0,  0x1e,  0xe4,  0x06,  0x27,  0xf2,  0xcd,  0x78,  0xf8,
-  0xac,  0xdf,  0x2f,  0xc0,  0xd4,  0x54,  0x71,  0x35,  0xa3,  0x19,  0x3e,  0x8d,
-  0xfe,  0x7d,  0xbe,  0x64,  0xb9,  0x25,  0xb9,  0xeb,  0x05,  0xf6,  0x82,  0x4f,
-  0x41,  0x5f,  0x10,  0xeb,  0x7a,  0x93,  0xeb,  0x3a,  0xcd,  0xf5,  0xfc,  0x84,
-  0x97,  0xb9,  0x9d,  0xe6,  0x39,  0xff,  0x00,  0x69,  0x89,  0xfe,  0xb5,  0xf6,
-  0xad,  0x8e,  0xa1,  0x6b,  0xab,  0x58,  0xc5,  0x75,  0x69,  0x34,  0x77,  0x36,
-  0xb3,  0x2e,  0xe4,  0x91,  0x0e,  0x55,  0x85,  0x78,  0x5f,  0xfc,  0x2d,  0x5f,
-  0x87,  0x3f,  0xf4,  0x25,  0x27,  0xfe,  0x00,  0xdb,  0xff,  0x00,  0x8d,  0x7c,
-  0x67,  0x18,  0xe1,  0xa8,  0x63,  0x61,  0x87,  0x55,  0x31,  0x31,  0xa7,  0x1f,
-  0x79,  0xab,  0xdd,  0xf3,  0x7c,  0x3a,  0xab,  0x76,  0xfd,  0x4c,  0xea,  0x59,
-  0xdb,  0x53,  0xc4,  0x68,  0xaf,  0x6e,  0xff,  0x00,  0x85,  0xab,  0xf0,  0xe7,
-  0xfe,  0x84,  0xa4,  0xff,  0x00,  0xc0,  0x1b,  0x7f,  0xf1,  0xa3,  0xfe,  0x16,
-  0xaf,  0xc3,  0x9f,  0xfa,  0x12,  0x93,  0xff,  0x00,  0x00,  0x6d,  0xff,  0x00,
-  0xc6,  0xbf,  0x33,  0xfe,  0xc5,  0xc0,  0xff,  0x00,  0xd0,  0x7c,  0x3e,  0xe9,
-  0x7f,  0x91,  0x8f,  0x2a,  0xee,  0x78,  0x8d,  0x15,  0xed,  0xdf,  0xf0,  0xb5,
-  0x7e,  0x1c,  0xff,  0x00,  0xd0,  0x94,  0x9f,  0xf8,  0x03,  0x6f,  0xfe,  0x34,
-  0x7f,  0xc2,  0xd5,  0xf8,  0x73,  0xff,  0x00,  0x42,  0x52,  0x7f,  0xe0,  0x0d,
-  0xbf,  0xf8,  0xd1,  0xfd,  0x8b,  0x81,  0xff,  0x00,  0xa0,  0xf8,  0x7d,  0xd2,
-  0xff,  0x00,  0x20,  0xe5,  0x5d,  0xcf,  0x11,  0xa2,  0xbd,  0xbb,  0xfe,  0x16,
-  0xaf,  0xc3,  0x9f,  0xfa,  0x12,  0x93,  0xff,  0x00,  0x00,  0x6d,  0xff,  0x00,
-  0xc6,  0x8f,  0xf8,  0x5a,  0xbf,  0x0e,  0x7f,  0xe8,  0x4a,  0x4f,  0xfc,  0x01,
-  0xb7,  0xff,  0x00,  0x1a,  0x3f,  0xb1,  0x70,  0x3f,  0xf4,  0x1f,  0x0f,  0xba,
-  0x5f,  0xe4,  0x1c,  0xab,  0xb9,  0xe2,  0x34,  0x57,  0xb7,  0x7f,  0xc2,  0xd5,
-  0xf8,  0x73,  0xff,  0x00,  0x42,  0x52,  0x7f,  0xe0,  0x0d,  0xbf,  0xf8,  0xd1,
-  0xff,  0x00,  0x0b,  0x57,  0xe1,  0xcf,  0xfd,  0x09,  0x49,  0xff,  0x00,  0x80,
-  0x36,  0xff,  0x00,  0xe3,  0x47,  0xf6,  0x2e,  0x07,  0xfe,  0x83,  0xe1,  0xf7,
-  0x4b,  0xfc,  0x83,  0x95,  0x77,  0x3c,  0x52,  0x09,  0xde,  0xda,  0x78,  0xe6,
-  0x89,  0x8a,  0x49,  0x1b,  0x07,  0x56,  0x1d,  0x41,  0x07,  0x20,  0xd7,  0xdb,
-  0xfa,  0x5d,  0xf0,  0xd4,  0x74,  0xdb,  0x4b,  0xb0,  0x30,  0x27,  0x85,  0x25,
-  0x03,  0xfd,  0xe5,  0x07,  0xfa,  0xd7,  0x85,  0xff,  0x00,  0xc2,  0xd5,  0xf8,
-  0x73,  0xff,  0x00,  0x42,  0x52,  0x7f,  0xe0,  0x0d,  0xbf,  0xf8,  0xd7,  0xb6,
-  0x69,  0x1a,  0x95,  0xa5,  0xc7,  0x87,  0xec,  0xaf,  0xe1,  0x55,  0xb3,  0xb1,
-  0x7b,  0x54,  0x99,  0x11,  0xf0,  0x82,  0x28,  0xca,  0x02,  0x01,  0xec,  0x30,
-  0x3f,  0x0e,  0x2b,  0xf4,  0x7e,  0x0e,  0xc2,  0xd0,  0xc1,  0xce,  0xbc,  0x69,
-  0x62,  0x63,  0x51,  0x34,  0x9b,  0x4a,  0xfa,  0x5a,  0xfa,  0xeb,  0xea,  0x6d,
-  0x4e,  0xca,  0xfa,  0x9a,  0x5b,  0xa8,  0xdd,  0x5e,  0x57,  0xab,  0xfe,  0xd1,
-  0x3e,  0x1b,  0xd3,  0xaf,  0x1a,  0x0b,  0x68,  0x6e,  0xf5,  0x15,  0x53,  0x83,
-  0x34,  0x28,  0xaa,  0x87,  0xe9,  0xb8,  0x82,  0x7f,  0x2a,  0xeb,  0xbc,  0x1b,
-  0xf1,  0x07,  0x45,  0xf1,  0xcd,  0xbb,  0xbe,  0x99,  0x70,  0x7c,  0xe8,  0xc6,
-  0x64,  0xb6,  0x98,  0x6d,  0x91,  0x07,  0xa9,  0x1d,  0xc7,  0xb8,  0xc8,  0xaf,
-  0xb7,  0xc3,  0xe7,  0x19,  0x76,  0x2a,  0xb7,  0xd5,  0xe8,  0x56,  0x8c,  0xa7,
-  0xd9,  0x3f,  0xcb,  0xbf,  0xc8,  0xd1,  0x49,  0x3d,  0x2e,  0x74,  0xdb,  0xa8,
-  0xcd,  0x37,  0x34,  0x64,  0x57,  0xb2,  0x55,  0xc7,  0x6e,  0xa3,  0x75,  0x37,
-  0x34,  0x66,  0x8b,  0x05,  0xc7,  0x6e,  0xa3,  0x75,  0x37,  0x34,  0x66,  0x8b,
-  0x05,  0xc7,  0x6e,  0xa3,  0x75,  0x37,  0x34,  0x66,  0x8b,  0x05,  0xc7,  0x6e,
-  0xa3,  0x75,  0x37,  0x34,  0x64,  0x51,  0x60,  0xb8,  0xed,  0xd4,  0x6e,  0xa6,
-  0xe4,  0x51,  0x9a,  0x2c,  0x17,  0x1b,  0x9a,  0x33,  0x51,  0xee,  0xa3,  0x75,
-  0x55,  0x88,  0xb9,  0x26,  0x68,  0xcd,  0x47,  0xba,  0x8d,  0xd4,  0x58,  0x2e,
-  0x49,  0x9a,  0x33,  0x51,  0xee,  0xa3,  0x75,  0x16,  0x15,  0xc9,  0x32,  0x28,
-  0xa8,  0xf7,  0x51,  0xba,  0x8b,  0x0e,  0xe4,  0x99,  0xa3,  0x35,  0x1e,  0xea,
-  0x37,  0x51,  0x60,  0xb9,  0x26,  0x68,  0xcd,  0x47,  0xba,  0x8c,  0xd3,  0xb0,
-  0x5c,  0xf9,  0x7b,  0xe3,  0xb6,  0xaf,  0x3e,  0xa5,  0xf1,  0x0e,  0xf2,  0xde,
-  0x47,  0x26,  0x1b,  0x24,  0x48,  0x62,  0x4e,  0xc0,  0x15,  0x0c,  0x4f,  0xe2,
-  0x58,  0xfe,  0x95,  0xe7,  0x95,  0xda,  0x7c,  0x64,  0xff,  0x00,  0x92,  0x97,
-  0xad,  0xff,  0x00,  0xbf,  0x1f,  0xfe,  0x8a,  0x4a,  0xe2,  0xeb,  0xf9,  0x47,
-  0x3a,  0x9c,  0xaa,  0x66,  0x78,  0x99,  0x49,  0xdd,  0xf3,  0xcb,  0xf0,  0x6d,
-  0x23,  0x92,  0x5b,  0x9e,  0xf7,  0xfb,  0x34,  0xeb,  0x13,  0xcd,  0x67,  0xac,
-  0xe9,  0xb2,  0x39,  0x6b,  0x78,  0x1a,  0x39,  0xa2,  0x04,  0xfd,  0xd2,  0xdb,
-  0x83,  0x0f,  0xc7,  0x68,  0xfd,  0x6b,  0xc1,  0x2b,  0xda,  0xff,  0x00,  0x66,
-  0x73,  0x8b,  0xed,  0x7f,  0xfe,  0xb9,  0xc3,  0xfc,  0xde,  0xbc,  0x52,  0xbd,
-  0x8c,  0xd2,  0x72,  0x9e,  0x4b,  0x97,  0x39,  0x3b,  0xdb,  0xda,  0xaf,  0x92,
-  0x92,  0xb1,  0x4f,  0xe1,  0x41,  0x45,  0x14,  0x57,  0xc6,  0x90,  0x14,  0x51,
-  0x45,  0x00,  0x14,  0x51,  0x45,  0x00,  0x14,  0x51,  0x45,  0x00,  0x15,  0xef,
-  0x7f,  0x13,  0xf5,  0x89,  0xf4,  0xef,  0x82,  0xbe,  0x19,  0xb6,  0x81,  0xca,
-  0x0b,  0xc8,  0x2d,  0x62,  0x94,  0x83,  0xd5,  0x04,  0x3b,  0x88,  0xfc,  0x48,
-  0x15,  0xe0,  0x95,  0xed,  0x7f,  0x17,  0x0f,  0xfc,  0x5a,  0x5f,  0x05,  0xff,
-  0x00,  0xd7,  0x38,  0x3f,  0xf4,  0x45,  0x7d,  0x96,  0x47,  0x39,  0x43,  0x03,
-  0x98,  0x4a,  0x2e,  0xcf,  0x91,  0x7e,  0x32,  0xb3,  0xfc,  0x0a,  0x8e,  0xcc,
-  0xf1,  0x4a,  0xe9,  0xbe,  0x1a,  0x6a,  0xf3,  0xe8,  0xbe,  0x3a,  0xd1,  0x67,
-  0x81,  0xca,  0x99,  0x2e,  0x52,  0x07,  0x00,  0xfd,  0xe4,  0x76,  0x0a,  0xc0,
-  0xfe,  0x07,  0xf4,  0xae,  0x66,  0xb6,  0x3c,  0x1b,  0xff,  0x00,  0x23,  0x7e,
-  0x87,  0xff,  0x00,  0x5f,  0xd0,  0x7f,  0xe8,  0xc5,  0xaf,  0x9b,  0xc0,  0xce,
-  0x54,  0xf1,  0x54,  0xa7,  0x07,  0x66,  0xa4,  0xbf,  0x31,  0x2d,  0xcf,  0xb4,
-  0x33,  0x46,  0x6a,  0x3d,  0xd4,  0x6e,  0xaf,  0xeb,  0x9b,  0x1d,  0x57,  0x24,
-  0xcd,  0x19,  0xa8,  0xf7,  0x51,  0xba,  0x8b,  0x0e,  0xe4,  0x99,  0xa3,  0x35,
-  0x1e,  0xea,  0x37,  0x51,  0x60,  0xb9,  0x26,  0x68,  0xcd,  0x47,  0xba,  0x8d,
-  0xd4,  0x58,  0x2e,  0x49,  0x9a,  0x33,  0x51,  0xee,  0xa3,  0x75,  0x16,  0x15,
-  0xc9,  0x33,  0x46,  0x6a,  0x3d,  0xd4,  0x6e,  0xa2,  0xc3,  0xb8,  0xdd,  0xd4,
-  0x9b,  0xa9,  0xbb,  0xa8,  0xdd,  0x5a,  0x19,  0xdc,  0x7e,  0xea,  0x4d,  0xd4,
-  0xdd,  0xd4,  0x6e,  0xa0,  0x57,  0x1f,  0xba,  0x8d,  0xd4,  0xcd,  0xd4,  0x6e,
-  0xa0,  0x77,  0x1f,  0xba,  0x8d,  0xd4,  0xcd,  0xd4,  0x6e,  0xa4,  0x2b,  0x8f,
-  0xdd,  0x49,  0xba,  0x9b,  0xba,  0x8d,  0xd4,  0xc2,  0xe3,  0xb7,  0x52,  0xee,
-  0xa6,  0x6e,  0xa3,  0x75,  0x20,  0xb9,  0xf2,  0x9f,  0xc6,  0x3f,  0xf9,  0x29,
-  0x5a,  0xdf,  0xfb,  0xf1,  0xff,  0x00,  0xe8,  0xb4,  0xae,  0x32,  0xbb,  0x2f,
-  0x8c,  0x5c,  0xfc,  0x49,  0xd6,  0xff,  0x00,  0xdf,  0x8f,  0xff,  0x00,  0x45,
-  0xa5,  0x71,  0xb5,  0xfc,  0x99,  0x9c,  0x7f,  0xc8,  0xcb,  0x13,  0xfe,  0x39,
-  0xff,  0x00,  0xe9,  0x4c,  0xc1,  0xee,  0x7b,  0x57,  0xec,  0xd2,  0x71,  0x7d,
-  0xaf,  0x7f,  0xd7,  0x38,  0x7f,  0x9b,  0xd7,  0x8a,  0xd7,  0xb4,  0x7e,  0xcd,
-  0x67,  0x17,  0xda,  0xf7,  0xfd,  0x73,  0x87,  0xf9,  0xbd,  0x78,  0xbd,  0x7b,
-  0x19,  0x97,  0xfc,  0x89,  0x32,  0xef,  0xfb,  0x8b,  0xff,  0x00,  0xa5,  0x21,
-  0xbd,  0x90,  0x51,  0x45,  0x15,  0xf2,  0x02,  0x0a,  0x28,  0xa2,  0x80,  0x0a,
-  0x28,  0xa2,  0x80,  0x0a,  0x28,  0xa2,  0x80,  0x0a,  0xf6,  0xaf,  0x8b,  0x47,
-  0x3f,  0x09,  0x7c,  0x17,  0xff,  0x00,  0x5c,  0xe0,  0xff,  0x00,  0xd1,  0x15,
-  0xe2,  0xb5,  0xed,  0x1f,  0x16,  0x4f,  0xfc,  0x5a,  0x6f,  0x06,  0x7f,  0xd7,
-  0x38,  0x3f,  0xf4,  0x45,  0x7d,  0x7e,  0x4d,  0xff,  0x00,  0x22,  0xfc,  0xc3,
-  0xfc,  0x11,  0xff,  0x00,  0xd2,  0x90,  0xd6,  0xcc,  0xf1,  0x7a,  0xd8,  0xf0,
-  0x67,  0xfc,  0x8e,  0x1a,  0x17,  0xfd,  0x7f,  0xc1,  0xff,  0x00,  0xa3,  0x16,
-  0xb1,  0xeb,  0x63,  0xc1,  0xdf,  0xf2,  0x37,  0x68,  0x7f,  0xf5,  0xfd,  0x07,
-  0xfe,  0x8c,  0x5a,  0xf9,  0xbc,  0x27,  0xfb,  0xcd,  0x3f,  0xf1,  0x2f,  0xcc,
-  0x48,  0xfb,  0x2b,  0x75,  0x1b,  0xa9,  0x9b,  0xa8,  0xdd,  0x5f,  0xd8,  0x16,
-  0x37,  0xb8,  0xfd,  0xd4,  0x6e,  0xa6,  0x6e,  0xa3,  0x75,  0x20,  0xb8,  0xed,
-  0xd4,  0xbb,  0xa9,  0x9b,  0xa8,  0xdd,  0x4c,  0x2e,  0x3f,  0x75,  0x26,  0xea,
-  0x6e,  0xea,  0x37,  0x52,  0x0b,  0x8f,  0xdd,  0x49,  0xba,  0x9b,  0xba,  0x8d,
-  0xd4,  0xec,  0x3b,  0x8f,  0xdd,  0x49,  0xba,  0x9b,  0xba,  0x8d,  0xd4,  0x0a,
-  0xe4,  0x74,  0x53,  0x33,  0x4b,  0x93,  0x57,  0x63,  0x3b,  0x8e,  0xa2,  0x9b,
-  0x9a,  0x4c,  0xd1,  0x60,  0xb8,  0xfa,  0x29,  0x99,  0xa3,  0x34,  0x58,  0x2e,
-  0x3f,  0x34,  0x53,  0x33,  0x4b,  0x93,  0x45,  0x82,  0xe3,  0xa8,  0xcd,  0x33,
-  0x34,  0x66,  0x8b,  0x05,  0xc7,  0xd1,  0x4d,  0xc9,  0xa3,  0x26,  0x8b,  0x05,
-  0xcf,  0x96,  0x3e,  0x30,  0x7f,  0xc9,  0x48,  0xd6,  0xbf,  0xdf,  0x8f,  0xff,
-  0x00,  0x45,  0xa5,  0x71,  0xb5,  0xdd,  0xfc,  0x6c,  0xd3,  0xa6,  0xb1,  0xf8,
-  0x85,  0x7f,  0x2c,  0x8a,  0x44,  0x77,  0x4b,  0x1c,  0xd1,  0xb7,  0x66,  0x1b,
-  0x02,  0x9f,  0xd5,  0x4d,  0x70,  0x95,  0xfc,  0x97,  0x9d,  0x42,  0x50,  0xcc,
-  0xf1,  0x31,  0x92,  0xb7,  0xbf,  0x2f,  0xfd,  0x29,  0x90,  0x7b,  0x3f,  0xec,
-  0xdb,  0xff,  0x00,  0x1f,  0xba,  0xef,  0xfd,  0x73,  0x87,  0xf9,  0xbd,  0x78,
-  0xc5,  0x7b,  0x87,  0xec,  0xe3,  0xa7,  0x4d,  0x1c,  0x3a,  0xd5,  0xf3,  0x29,
-  0x58,  0x24,  0x31,  0xc2,  0x8d,  0xfd,  0xe2,  0x37,  0x16,  0xfc,  0xb2,  0x3f,
-  0x3a,  0xf0,  0xfa,  0xf6,  0x73,  0x58,  0x4a,  0x19,  0x26,  0x5b,  0xcc,  0xad,
-  0x7f,  0x6a,  0xff,  0x00,  0xf2,  0x64,  0x01,  0x45,  0x14,  0x57,  0xc6,  0x00,
-  0x51,  0x45,  0x14,  0x00,  0x51,  0x45,  0x14,  0x00,  0x51,  0x45,  0x14,  0x00,
-  0x57,  0xb3,  0xfc,  0x57,  0xff,  0x00,  0x92,  0x51,  0xe0,  0xdf,  0xfa,  0xe7,
-  0x07,  0xfe,  0x88,  0xaf,  0x18,  0xaf,  0x70,  0xf8,  0x9b,  0xa7,  0x4d,  0x79,
-  0xf0,  0x77,  0xc3,  0x37,  0x11,  0x29,  0x74,  0xb5,  0x8a,  0xd9,  0xe4,  0xc7,
-  0x65,  0x30,  0xed,  0xcf,  0xe6,  0x40,  0xfc,  0x6b,  0xec,  0xf2,  0x38,  0x4a,
-  0x78,  0x0c,  0xc1,  0x45,  0x5f,  0xdc,  0x5f,  0x84,  0xae,  0xc0,  0xf0,  0xfa,
-  0xd8,  0xf0,  0x6f,  0xfc,  0x8d,  0xfa,  0x1f,  0xfd,  0x7f,  0x41,  0xff,  0x00,
-  0xa3,  0x16,  0xb1,  0xeb,  0xa2,  0xf8,  0x79,  0xa7,  0x4d,  0xaa,  0x78,  0xdf,
-  0x45,  0x86,  0x15,  0x2c,  0xcb,  0x75,  0x1c,  0xad,  0x8e,  0xca,  0x8c,  0x18,
-  0x9f,  0xc8,  0x57,  0xcd,  0x60,  0x61,  0x29,  0xe2,  0xe9,  0x46,  0x2a,  0xed,
-  0xca,  0x3f,  0x9a,  0x03,  0xeb,  0x9c,  0xd1,  0x4c,  0xcd,  0x2e,  0x4d,  0x7f,
-  0x60,  0x58,  0xbb,  0x8e,  0xa2,  0x99,  0x9a,  0x33,  0x45,  0x82,  0xe3,  0xe8,
-  0xa6,  0x66,  0x8c,  0xd1,  0x60,  0xb8,  0xfa,  0x29,  0x99,  0xa5,  0xc9,  0xa2,
-  0xc1,  0x71,  0xd9,  0xa2,  0x9b,  0x93,  0x49,  0x9a,  0x2c,  0x17,  0x1f,  0x45,
-  0x33,  0x34,  0x66,  0x8b,  0x05,  0xc6,  0x6e,  0xa3,  0x75,  0x30,  0x90,  0x3a,
-  0x9c,  0x51,  0x9a,  0xd2,  0xc6,  0x57,  0x1f,  0xba,  0x8d,  0xd4,  0xda,  0x4c,
-  0xd1,  0x60,  0xb8,  0xfd,  0xd4,  0x6e,  0xa6,  0x02,  0x0f,  0x43,  0x9a,  0x37,
-  0x01,  0xdf,  0x14,  0x58,  0x2e,  0x3f,  0x75,  0x1b,  0xa9,  0xb4,  0x94,  0x58,
-  0x2e,  0x3f,  0x75,  0x1b,  0xa9,  0xb4,  0x80,  0x83,  0xd0,  0xe6,  0x8b,  0x05,
-  0xc7,  0xee,  0xa3,  0x75,  0x30,  0x90,  0x3a,  0x9c,  0x51,  0x9a,  0x2c,  0x17,
-  0x31,  0x3c,  0x5d,  0xe0,  0xcd,  0x2f,  0xc6,  0xb6,  0x2b,  0x6f,  0xa8,  0xc4,
-  0x4b,  0x26,  0x4c,  0x53,  0xc6,  0x71,  0x24,  0x64,  0xf5,  0xc1,  0xfe,  0x87,
-  0x8a,  0xe0,  0x6d,  0x3f,  0x67,  0x7d,  0x32,  0x2b,  0xb0,  0xf7,  0x1a,  0xad,
-  0xcc,  0xf6,  0xe0,  0xe7,  0xca,  0x58,  0xd5,  0x09,  0x1e,  0x85,  0xb2,  0x7f,
-  0x95,  0x7a,  0xd5,  0x25,  0x78,  0x38,  0xcc,  0x87,  0x2c,  0xcc,  0x2b,  0x2a,
-  0xf8,  0x9a,  0x2a,  0x52,  0xef,  0xaa,  0xfb,  0xec,  0xd5,  0xfe,  0x77,  0x0b,
-  0x95,  0xf4,  0xad,  0x32,  0xd3,  0x44,  0xb0,  0x86,  0xca,  0xc6,  0x05,  0xb7,
-  0xb6,  0x88,  0x61,  0x23,  0x4e,  0x83,  0xfc,  0x4f,  0xbd,  0x7c,  0x6b,  0x5f,
-  0x69,  0x57,  0xc5,  0xb5,  0xf9,  0x8f,  0x88,  0xb0,  0x8d,  0x38,  0xe0,  0xe1,
-  0x05,  0x64,  0xb9,  0xec,  0x97,  0xfd,  0xb8,  0x34,  0x14,  0x51,  0x45,  0x7e,
-  0x32,  0x30,  0xa2,  0x8a,  0x28,  0x00,  0xa2,  0x8a,  0x28,  0x00,  0xa2,  0x8a,
-  0x28,  0x00,  0xaf,  0xad,  0xfc,  0x2b,  0x04,  0x57,  0x9e,  0x06,  0xd1,  0xad,
-  0xe7,  0x8d,  0x66,  0x86,  0x4d,  0x3a,  0x04,  0x78,  0xdc,  0x65,  0x58,  0x18,
-  0xd7,  0x20,  0x8a,  0xf9,  0x22,  0xbe,  0xba,  0xf0,  0x67,  0xfc,  0x89,  0xfa,
-  0x17,  0xfd,  0x78,  0x41,  0xff,  0x00,  0xa2,  0xd6,  0xbf,  0x5c,  0xf0,  0xee,
-  0x2a,  0x58,  0x9c,  0x42,  0x7b,  0x72,  0xaf,  0xcc,  0x47,  0x05,  0xab,  0x7e,
-  0xcf,  0x7a,  0x4d,  0xdd,  0xdb,  0x4b,  0x65,  0xa8,  0x4f,  0x63,  0x13,  0x1c,
-  0xf9,  0x25,  0x04,  0x80,  0x7b,  0x02,  0x48,  0x3f,  0x9e,  0x6b,  0xaf,  0xf0,
-  0x57,  0xc3,  0xcd,  0x27,  0xc0,  0xd1,  0xb9,  0xb3,  0x47,  0x9a,  0xee,  0x41,
-  0xb6,  0x4b,  0xa9,  0xb0,  0x5c,  0x8f,  0x41,  0xe8,  0x3d,  0x87,  0xe3,  0x5d,
-  0x36,  0x69,  0x6b,  0xf5,  0x7c,  0x37,  0x0f,  0xe5,  0x78,  0x3a,  0xff,  0x00,
-  0x59,  0xa1,  0x41,  0x46,  0x7d,  0xf5,  0xd3,  0xd1,  0x6c,  0xbe,  0x49,  0x0a,
-  0xe3,  0xb7,  0x51,  0xba,  0x99,  0x9a,  0x03,  0x03,  0xde,  0xbd,  0xfb,  0x05,
-  0xc7,  0xee,  0xa3,  0x75,  0x30,  0x90,  0x06,  0x4f,  0x14,  0x51,  0x60,  0xb8,
-  0xfd,  0xd4,  0x6e,  0xa6,  0xd1,  0x45,  0x82,  0xe3,  0xb7,  0x51,  0xba,  0x98,
-  0x08,  0x3d,  0x0e,  0x68,  0x24,  0x0e,  0xf4,  0x58,  0x2e,  0x3f,  0x75,  0x1b,
-  0xa9,  0x94,  0xb4,  0x58,  0x2e,  0x3b,  0x75,  0x1b,  0xa9,  0x99,  0xa0,  0x10,
-  0x7a,  0x1a,  0x2c,  0x17,  0x31,  0x62,  0xbd,  0x91,  0x46,  0xf7,  0x90,  0x3e,
-  0xd3,  0xf7,  0x1b,  0xa9,  0xad,  0x58,  0xa5,  0x13,  0x46,  0xae,  0xbd,  0x08,
-  0xac,  0x3f,  0x38,  0xff,  0x00,  0x71,  0x3f,  0xef,  0x91,  0x56,  0x52,  0xf1,
-  0xe3,  0x48,  0x55,  0x42,  0x80,  0x7a,  0x80,  0x3d,  0xeb,  0xb2,  0x70,  0xbe,
-  0xc7,  0x9d,  0x4e,  0xaf,  0x2e,  0xec,  0xd6,  0xcd,  0x36,  0x59,  0x44,  0x31,
-  0xb3,  0xb7,  0x41,  0x49,  0xba,  0xb3,  0x1e,  0xf2,  0x49,  0x12,  0x65,  0x60,
-  0x08,  0x1d,  0x01,  0x1e,  0xf5,  0x84,  0x61,  0xcc,  0x75,  0x4e,  0xa7,  0x22,
-  0x1b,  0x2d,  0xec,  0x8c,  0x0b,  0xa4,  0x81,  0x37,  0x1f,  0xb8,  0xbd,  0x7e,
-  0xb4,  0xb1,  0x5e,  0xc8,  0xa0,  0x3b,  0xb8,  0x7d,  0xa7,  0xee,  0x37,  0x5f,
-  0xad,  0x57,  0xf3,  0x8f,  0xf7,  0x13,  0xfe,  0xf9,  0x14,  0x79,  0xc7,  0xfb,
-  0x89,  0xff,  0x00,  0x7c,  0x8a,  0xeb,  0xe5,  0x56,  0xb5,  0x8e,  0x0e,  0x77,
-  0x7b,  0xdc,  0xdd,  0x8e,  0x41,  0x2a,  0x2b,  0xaf,  0x42,  0x33,  0x4e,  0xac,
-  0xa8,  0xef,  0x1d,  0x3c,  0x85,  0x00,  0x05,  0x3d,  0x40,  0x1e,  0xe6,  0xb4,
-  0x77,  0x57,  0x24,  0xa3,  0xca,  0x77,  0xc2,  0x7c,  0xe8,  0x74,  0x92,  0x08,
-  0xd1,  0x99,  0x8f,  0x00,  0x66,  0xb2,  0xa5,  0xbd,  0x91,  0x81,  0x74,  0x70,
-  0x99,  0x38,  0xd8,  0x3a,  0xfd,  0x69,  0xd2,  0x5e,  0x3b,  0xf9,  0xea,  0x40,
-  0x2a,  0x3a,  0x02,  0x3d,  0xc5,  0x55,  0xf3,  0x8f,  0xf7,  0x13,  0xfe,  0xf9,
-  0x15,  0xbc,  0x21,  0x6d,  0xce,  0x6a,  0x95,  0x6f,  0xa2,  0x64,  0xf1,  0x5e,
-  0x48,  0xa3,  0x7b,  0x48,  0x1f,  0x69,  0xfb,  0x8d,  0xd4,  0xd6,  0xac,  0x52,
-  0x89,  0xa3,  0x57,  0x5e,  0x86,  0xb0,  0xfc,  0xe3,  0xfd,  0xc4,  0xff,  0x00,
-  0xbe,  0x45,  0x59,  0x4b,  0xc7,  0x8d,  0x61,  0x0a,  0x14,  0x03,  0xd4,  0x01,
-  0xef,  0x44,  0xe1,  0x7d,  0x85,  0x4e,  0xaf,  0x2e,  0xec,  0xd6,  0xcd,  0x15,
-  0x1e,  0xea,  0x5d,  0xd5,  0xcd,  0x63,  0xba,  0xe3,  0xeb,  0xc0,  0xbc,  0x71,
-  0xf0,  0x57,  0x55,  0x83,  0x57,  0x9e,  0xe7,  0x44,  0x85,  0x6f,  0x6c,  0xa6,
-  0x72,  0xe2,  0x25,  0x70,  0xaf,  0x16,  0x4e,  0x76,  0xe0,  0x91,  0x91,  0xe9,
-  0x8a,  0xf7,  0xad,  0xd4,  0x66,  0xbe,  0x7f,  0x39,  0xc8,  0xf0,  0x99,  0xe5,
-  0x18,  0xd2,  0xc4,  0xdd,  0x72,  0xbb,  0xa6,  0xb7,  0x5d,  0xfb,  0xef,  0xe8,
-  0x17,  0xb1,  0xf2,  0xc5,  0xff,  0x00,  0xc3,  0x5f,  0x12,  0xe9,  0x96,  0x53,
-  0x5d,  0xdd,  0x69,  0x52,  0x43,  0x6f,  0x0a,  0x97,  0x92,  0x42,  0xe8,  0x42,
-  0x81,  0xd4,  0xf0,  0x6b,  0x99,  0xaf,  0xaa,  0xfe,  0x21,  0x9c,  0xf8,  0x1f,
-  0x5c,  0xff,  0x00,  0xaf,  0x47,  0xfe,  0x55,  0xf2,  0xa5,  0x7e,  0x01,  0xc5,
-  0x59,  0x1e,  0x1f,  0x22,  0xc4,  0x53,  0xa3,  0x87,  0x93,  0x92,  0x94,  0x6f,
-  0xef,  0x5b,  0xbd,  0xba,  0x24,  0x5a,  0x77,  0x0a,  0xe9,  0xec,  0xbe,  0x19,
-  0xf8,  0x9b,  0x51,  0xb3,  0x86,  0xea,  0xdb,  0x49,  0x92,  0x5b,  0x79,  0x90,
-  0x49,  0x1b,  0x87,  0x40,  0x19,  0x48,  0xc8,  0x3d,  0x6b,  0x98,  0xaf,  0xac,
-  0x3c,  0x08,  0x71,  0xe0,  0xad,  0x0b,  0xfe,  0xbc,  0xa1,  0xff,  0x00,  0xd0,
-  0x05,  0x57,  0x0a,  0xe4,  0x58,  0x7c,  0xf6,  0xbd,  0x5a,  0x58,  0x89,  0x4a,
-  0x2a,  0x2a,  0xfe,  0xed,  0xbb,  0xdb,  0xaa,  0x60,  0xdd,  0x8f,  0x9e,  0xdb,
-  0xe1,  0x4f,  0x8a,  0xd1,  0x4b,  0x1d,  0x1a,  0x50,  0x00,  0xc9,  0x3e,  0x62,
-  0x7f,  0xf1,  0x55,  0xc9,  0xd7,  0xd9,  0x17,  0x4d,  0xfe,  0x8d,  0x37,  0xfb,
-  0x87,  0xf9,  0x57,  0xc6,  0xf5,  0xd1,  0xc5,  0x9c,  0x3d,  0x86,  0xc8,  0x5d,
-  0x05,  0x87,  0x9c,  0xa5,  0xcf,  0xcd,  0x7e,  0x6b,  0x74,  0xb6,  0xd6,  0x4b,
-  0xb8,  0x27,  0x70,  0xae,  0x87,  0x47,  0xf0,  0x07,  0x88,  0x35,  0xfb,  0x04,
-  0xbd,  0xb0,  0xd3,  0x64,  0xb9,  0xb5,  0x72,  0x42,  0xc8,  0xae,  0xa0,  0x12,
-  0x0e,  0x0f,  0x53,  0xeb,  0x5c,  0xf5,  0x7d,  0x27,  0xf0,  0x54,  0xe3,  0xe1,
-  0xed,  0x8f,  0xfd,  0x74,  0x97,  0xff,  0x00,  0x43,  0x35,  0xe7,  0x70,  0xbe,
-  0x4f,  0x43,  0x3c,  0xc6,  0xcb,  0x0d,  0x5e,  0x4d,  0x25,  0x16,  0xf4,  0xb5,
-  0xee,  0x9a,  0x5d,  0x53,  0xee,  0x0d,  0xd8,  0xf3,  0x1f,  0x0d,  0x7c,  0x12,
-  0xd7,  0xb5,  0x3d,  0x42,  0x31,  0xa9,  0x40,  0x34,  0xdb,  0x20,  0xc0,  0xc8,
-  0xee,  0xea,  0xce,  0x47,  0x70,  0xa0,  0x13,  0xcf,  0xb9,  0xe2,  0xbe,  0x87,
-  0xb7,  0x82,  0x3b,  0x4b,  0x78,  0xa0,  0x89,  0x42,  0x45,  0x12,  0x84,  0x45,
-  0x1d,  0x80,  0x18,  0x02,  0x97,  0x34,  0x9b,  0xab,  0xfa,  0x07,  0x25,  0xe1,
-  0xfc,  0x1e,  0x45,  0x09,  0x47,  0x0d,  0x76,  0xe5,  0xbb,  0x7a,  0xbd,  0x36,
-  0x5a,  0x24,  0xad,  0xf2,  0x22,  0xf7,  0x24,  0xcd,  0x19,  0xa8,  0xf7,  0x51,
-  0xba,  0xbe,  0x96,  0xc1,  0x71,  0xd2,  0x48,  0x22,  0x46,  0x76,  0xe0,  0x0e,
-  0x6b,  0x2a,  0x5b,  0xd9,  0x18,  0x17,  0x47,  0x11,  0xe4,  0xe3,  0x60,  0xeb,
-  0xf5,  0xa7,  0x49,  0x78,  0xef,  0xe7,  0xa9,  0x00,  0xa8,  0xe8,  0x08,  0xf7,
-  0x02,  0xaa,  0xf9,  0xc7,  0xfb,  0x89,  0xff,  0x00,  0x7c,  0x8a,  0xe9,  0x84,
-  0x2d,  0xb9,  0xc5,  0x56,  0xaf,  0x36,  0x89,  0x93,  0xc5,  0x7b,  0x22,  0x8d,
-  0xef,  0x20,  0x7d,  0xa7,  0xee,  0x37,  0x53,  0x5a,  0xd1,  0x4a,  0x26,  0x8d,
-  0x5d,  0x7a,  0x1a,  0xc2,  0xf3,  0x8f,  0xf7,  0x13,  0xfe,  0xf9,  0x15,  0x65,
-  0x2f,  0x1e,  0x34,  0x84,  0x28,  0x50,  0x09,  0xe4,  0x01,  0xef,  0x44,  0xe1,
-  0x7d,  0x85,  0x4e,  0xaf,  0x2e,  0xec,  0xd6,  0xa6,  0xcb,  0x28,  0x86,  0x36,
-  0x76,  0xe8,  0x29,  0x37,  0x56,  0x63,  0xde,  0x3c,  0x89,  0x30,  0x60,  0xa4,
-  0x0e,  0x80,  0x8f,  0x7a,  0xc2,  0x30,  0xe6,  0x3a,  0xa7,  0x53,  0x91,  0x0d,
-  0x96,  0xf6,  0x46,  0x05,  0xd2,  0x40,  0x9b,  0x8f,  0xdc,  0x5e,  0xa3,  0xde,
-  0x96,  0x2b,  0xd9,  0x14,  0x07,  0x77,  0x0f,  0xb4,  0xfd,  0xc6,  0xeb,  0xf5,
-  0xaa,  0xfe,  0x71,  0xfe,  0xe2,  0x7f,  0xdf,  0x22,  0x8f,  0x38,  0xff,  0x00,
-  0x71,  0x3f,  0xef,  0x91,  0x5d,  0x7c,  0xaa,  0xd6,  0xb1,  0xc1,  0xce,  0xef,
-  0x7b,  0x9b,  0xb1,  0xc8,  0x25,  0x45,  0x75,  0xe8,  0x46,  0x69,  0xd5,  0x95,
-  0x1d,  0xe3,  0xa0,  0x81,  0x46,  0x02,  0x9e,  0xa0,  0x0f,  0x72,  0x2b,  0x4b,
-  0x35,  0xc9,  0x28,  0xf2,  0x9d,  0xf0,  0xa9,  0xce,  0x85,  0x92,  0x41,  0x1a,
-  0x33,  0xb7,  0x40,  0x32,  0x6b,  0x2a,  0x5b,  0xd9,  0x1c,  0x17,  0x47,  0x09,
-  0x93,  0x8d,  0x83,  0xaf,  0xd6,  0x9d,  0x25,  0xe3,  0xbf,  0x9e,  0xa4,  0x02,
-  0xa3,  0xa0,  0x23,  0xdc,  0x55,  0x5f,  0x38,  0xff,  0x00,  0x71,  0x3f,  0xef,
-  0x91,  0x5b,  0xc2,  0x16,  0xdc,  0xe6,  0xa9,  0x57,  0x9b,  0x44,  0xc8,  0xea,
-  0x70,  0xa4,  0x88,  0x30,  0x09,  0xff,  0x00,  0xf5,  0xd3,  0x4d,  0xbb,  0x09,
-  0x84,  0x59,  0x1b,  0xbd,  0x7b,  0x56,  0x95,  0xb4,  0x66,  0x18,  0x42,  0x13,
-  0x92,  0x3d,  0x2a,  0xe5,  0x2b,  0x23,  0x2a,  0x70,  0x72,  0x6d,  0x32,  0x7a,
-  0xc8,  0x2a,  0x40,  0x9f,  0x20,  0x8f,  0xff,  0x00,  0x5d,  0x6a,  0xe6,  0xa3,
-  0xb9,  0x8c,  0xcf,  0x09,  0x40,  0x40,  0x27,  0xd6,  0xb1,  0x83,  0xe5,  0x3a,
-  0x6a,  0x47,  0x99,  0x5c,  0xc7,  0xa2,  0xa5,  0x5b,  0x76,  0x69,  0x8c,  0x59,
-  0x1b,  0xbf,  0x4a,  0x3e,  0xce,  0xde,  0x7f,  0x95,  0x91,  0xbb,  0xd7,  0xb5,
-  0x74,  0xdd,  0x1c,  0x3c,  0xac,  0x7a,  0xa9,  0x2d,  0x6f,  0x80,  0x7f,  0xcb,
-  0x1a,  0xd6,  0xa8,  0x6d,  0xe3,  0x30,  0xc2,  0xa8,  0x48,  0x24,  0x77,  0x15,
-  0x26,  0x6b,  0x9a,  0x6f,  0x99,  0x9d,  0xf4,  0xe3,  0xca,  0x8c,  0xb6,  0x52,
-  0x1a,  0xe3,  0x20,  0xff,  0x00,  0x96,  0x15,  0x5e,  0xb6,  0x2e,  0x23,  0x33,
-  0x44,  0xc8,  0x08,  0x04,  0xd6,  0x67,  0xd9,  0xdb,  0xcf,  0xf2,  0xb2,  0x37,
-  0x7a,  0xf6,  0xad,  0xa1,  0x24,  0xd1,  0xcb,  0x52,  0x0e,  0x2d,  0x58,  0x8a,
-  0xa7,  0x0a,  0x48,  0x83,  0x00,  0x9f,  0xff,  0x00,  0x5d,  0x34,  0xdb,  0xb2,
-  0xcc,  0x22,  0xc8,  0xdd,  0xeb,  0xda,  0xb4,  0xad,  0xa3,  0x30,  0xc2,  0xaa,
-  0x4e,  0x48,  0xf4,  0xa2,  0x52,  0xb2,  0x0a,  0x70,  0x72,  0x6d,  0x32,  0x7a,
-  0x29,  0xa4,  0xd1,  0x9a,  0xe5,  0xb1,  0xde,  0x3a,  0x8a,  0x6e,  0x73,  0x41,
-  0x34,  0x58,  0x0e,  0x7f,  0xe2,  0x1f,  0xfc,  0x88,  0xfa,  0xe7,  0xfd,  0x7a,
-  0xbf,  0xf2,  0xaf,  0x95,  0xab,  0xeb,  0x2f,  0x18,  0x58,  0x4b,  0xaa,  0xf8,
-  0x57,  0x56,  0xb4,  0x80,  0x6e,  0x9a,  0x6b,  0x69,  0x15,  0x17,  0xd5,  0xb6,
-  0x9c,  0x0f,  0xce,  0xbe,  0x4e,  0x65,  0x2a,  0x48,  0x20,  0x82,  0x38,  0x20,
-  0xf6,  0xaf,  0xc1,  0x7c,  0x46,  0x84,  0x96,  0x32,  0x84,  0xed,  0xa3,  0x8b,
-  0x5f,  0x73,  0xff,  0x00,  0x82,  0x8d,  0x20,  0x25,  0x7d,  0x5d,  0xe0,  0x5f,
-  0xf9,  0x12,  0xf4,  0x2f,  0xfa,  0xf2,  0x87,  0xff,  0x00,  0x40,  0x15,  0xf2,
-  0x9a,  0x23,  0x48,  0xea,  0x88,  0xa5,  0x9d,  0x8e,  0x02,  0x81,  0x92,  0x4d,
-  0x7d,  0x69,  0xe1,  0x8b,  0x19,  0x34,  0xbf,  0x0d,  0xe9,  0x76,  0x73,  0x71,
-  0x2c,  0x16,  0xd1,  0xc6,  0xe3,  0xd0,  0x85,  0x00,  0xd5,  0x78,  0x73,  0x09,
-  0x3c,  0x56,  0x22,  0x76,  0xd1,  0x45,  0x2f,  0xc7,  0xfe,  0x00,  0x4c,  0xd0,
-  0xba,  0xff,  0x00,  0x8f,  0x69,  0xbf,  0xdc,  0x3f,  0xca,  0xbe,  0x39,  0xaf,
-  0xb1,  0xe5,  0x5f,  0x32,  0x27,  0x4c,  0xe3,  0x72,  0x91,  0x9a,  0xf9,  0x03,
-  0x50,  0xb1,  0x9b,  0x4c,  0xbe,  0xb8,  0xb4,  0x9d,  0x0a,  0x4d,  0x04,  0x86,
-  0x37,  0x53,  0xd8,  0x83,  0x8a,  0xed,  0xf1,  0x22,  0x12,  0xff,  0x00,  0x65,
-  0x9d,  0xb4,  0xf7,  0xd7,  0xfe,  0x92,  0x10,  0x2b,  0xd7,  0xd2,  0x5f,  0x05,
-  0xbf,  0xe4,  0x9f,  0x58,  0xff,  0x00,  0xd7,  0x49,  0x7f,  0xf4,  0x33,  0x5f,
-  0x36,  0xd7,  0xd3,  0x9f,  0x0a,  0x74,  0xe9,  0xb4,  0xbf,  0x01,  0xe9,  0x91,
-  0x4e,  0xa5,  0x24,  0x75,  0x69,  0x76,  0x9e,  0xa0,  0x33,  0x12,  0x3f,  0x42,
-  0x2b,  0xc3,  0xf0,  0xf6,  0x12,  0x96,  0x69,  0x52,  0x49,  0x68,  0xa0,  0xff,
-  0x00,  0x19,  0x44,  0x72,  0xd8,  0xeb,  0xe8,  0xa6,  0xe6,  0x8c,  0xd7,  0xf4,
-  0x3d,  0x8c,  0x87,  0x51,  0x4d,  0xcd,  0x19,  0xa2,  0xc0,  0x65,  0xb2,  0x90,
-  0xd7,  0x19,  0x04,  0x7f,  0xfb,  0x42,  0xab,  0xd6,  0xc5,  0xc4,  0x66,  0x68,
-  0x59,  0x07,  0x04,  0xfa,  0xd6,  0x67,  0xd9,  0xdb,  0xcf,  0xf2,  0xb2,  0x37,
-  0x7a,  0xf6,  0xae,  0xa8,  0x4a,  0xe8,  0xe0,  0xa9,  0x07,  0x16,  0xac,  0x45,
-  0x53,  0x85,  0x24,  0x41,  0x80,  0x4f,  0xff,  0x00,  0xae,  0x9a,  0x6d,  0xd9,
-  0x66,  0x11,  0x64,  0x6e,  0xf5,  0xed,  0x5a,  0x76,  0xd1,  0x98,  0x21,  0x0a,
-  0x48,  0x27,  0xda,  0x89,  0x4a,  0xc8,  0x29,  0xc1,  0xc9,  0xb4,  0xc9,  0xab,
-  0x20,  0xa9,  0x02,  0x7c,  0x82,  0x3f,  0xfd,  0x75,  0xab,  0x9a,  0x8a,  0xe6,
-  0x33,  0x34,  0x45,  0x41,  0xc1,  0xf7,  0xac,  0x60,  0xf9,  0x4e,  0x9a,  0x91,
-  0xe6,  0x46,  0x45,  0x15,  0x28,  0xb7,  0x66,  0x98,  0xc5,  0x91,  0xb8,  0x77,
-  0xed,  0x47,  0xd9,  0xdb,  0xcf,  0xf2,  0xb2,  0x37,  0x7a,  0xf6,  0xae,  0x9b,
-  0xa3,  0x87,  0x95,  0x8f,  0x55,  0x25,  0xad,  0xf0,  0x0f,  0xf9,  0x63,  0x5a,
-  0xd5,  0x0d,  0xba,  0x18,  0x61,  0x54,  0x24,  0x12,  0x3d,  0x2a,  0x4c,  0xd7,
-  0x34,  0xdf,  0x33,  0x3b,  0xe9,  0xc7,  0x95,  0x19,  0x6c,  0xa4,  0x35,  0xc6,
-  0x41,  0xff,  0x00,  0x2c,  0x2a,  0xbd,  0x6c,  0x5c,  0x46,  0x66,  0x85,  0x90,
-  0x1c,  0x13,  0xeb,  0x59,  0x9f,  0x67,  0x6f,  0x3f,  0xca,  0xc8,  0xdd,  0xfa,
-  0x56,  0xd0,  0x92,  0x68,  0xe5,  0xa9,  0x06,  0x9a,  0xb1,  0xa0,  0xd6,  0xc1,
-  0xae,  0x04,  0xb9,  0x39,  0x1d,  0xaa,  0x6a,  0x28,  0xae,  0x76,  0xdb,  0x3a,
-  0xd2,  0xb6,  0xc1,  0x45,  0x14,  0x52,  0x19,  0x0a,  0xdb,  0x05,  0xb8,  0x32,
-  0xe4,  0xe4,  0xf6,  0xa3,  0xec,  0xc3,  0xed,  0x1e,  0x6e,  0x4e,  0x7d,  0x2a,
-  0x6a,  0x2a,  0xb9,  0x99,  0x3c,  0xa8,  0x28,  0xa2,  0x8a,  0x92,  0x82,  0xa1,
-  0xfb,  0x30,  0xfb,  0x47,  0x9b,  0x93,  0x9f,  0x4a,  0x9a,  0x8a,  0x69,  0xd8,
-  0x4d,  0x5f,  0x72,  0x16,  0xb6,  0x0d,  0x70,  0x25,  0xc9,  0xc8,  0xed,  0x53,
-  0x51,  0x45,  0x0d,  0xb6,  0x09,  0x5b,  0x60,  0xa2,  0x8a,  0x29,  0x0c,  0x28,
-  0xa2,  0x8a,  0x00,  0x2b,  0x83,  0xf1,  0x57,  0xc1,  0xdd,  0x1b,  0xc4,  0xb7,
-  0xaf,  0x79,  0x1b,  0xcb,  0xa7,  0x5d,  0x48,  0x73,  0x21,  0x80,  0x02,  0x8e,
-  0x7d,  0x4a,  0x9e,  0xff,  0x00,  0x42,  0x2b,  0xbc,  0xa2,  0xbc,  0xfc,  0x76,
-  0x5f,  0x85,  0xcc,  0xa9,  0xfb,  0x1c,  0x5d,  0x35,  0x38,  0xf9,  0xfe,  0x8f,
-  0x75,  0xf2,  0x1a,  0x6d,  0x1c,  0x3f,  0x84,  0xbe,  0x11,  0xe8,  0xde,  0x16,
-  0xbb,  0x4b,  0xc2,  0xd2,  0x5f,  0xde,  0x27,  0x29,  0x24,  0xf8,  0xda,  0x87,
-  0xd5,  0x54,  0x77,  0xf7,  0x39,  0xae,  0xe2,  0x8a,  0x29,  0xe0,  0xb0,  0x18,
-  0x5c,  0xba,  0x97,  0xb1,  0xc2,  0x53,  0x50,  0x8f,  0x97,  0xeb,  0xd5,  0xfc,
-  0xc2,  0xed,  0x85,  0x71,  0xfe,  0x31,  0xf8,  0x5f,  0xa4,  0x78,  0xc6,  0x6f,
-  0xb4,  0xcd,  0xe6,  0x5a,  0x5e,  0xe3,  0x06,  0xe2,  0x0c,  0x65,  0xc7,  0x6d,
-  0xc0,  0xf5,  0xfe,  0x7e,  0xf5,  0xd8,  0x51,  0x55,  0x8c,  0xc1,  0x61,  0xf1,
-  0xf4,  0x9d,  0x0c,  0x54,  0x14,  0xe2,  0xfa,  0x3f,  0xeb,  0x46,  0x17,  0x68,
-  0xf3,  0xbf,  0x0f,  0x7c,  0x11,  0xd1,  0x74,  0x6b,  0xc4,  0xb9,  0xb9,  0x96,
-  0x5d,  0x49,  0xd0,  0xe5,  0x63,  0x94,  0x05,  0x8f,  0x3e,  0xa5,  0x47,  0x5f,
-  0xc4,  0xe3,  0xda,  0xbd,  0x13,  0xa5,  0x14,  0x56,  0x38,  0x1c,  0xb7,  0x07,
-  0x96,  0x41,  0xd3,  0xc1,  0xd3,  0x50,  0x4f,  0x7b,  0x75,  0xf5,  0x7b,  0xb0,
-  0x6d,  0xb0,  0xa2,  0x8a,  0x2b,  0xd3,  0x10,  0x51,  0x45,  0x14,  0x00,  0x54,
-  0x3f,  0x66,  0x1f,  0x68,  0xf3,  0x72,  0x73,  0xe9,  0x53,  0x51,  0x4d,  0x3b,
-  0x09,  0xab,  0xee,  0x42,  0xd6,  0xc1,  0xae,  0x04,  0xb9,  0x39,  0x1d,  0xaa,
-  0x6a,  0x28,  0xa1,  0xb6,  0xc1,  0x2b,  0x6c,  0x14,  0x51,  0x45,  0x21,  0x90,
-  0xad,  0xb0,  0x5b,  0x83,  0x2e,  0x4e,  0x4f,  0x6a,  0x3e,  0xcc,  0x3e,  0xd1,
-  0xe6,  0xe4,  0xe7,  0xd2,  0xa6,  0xa2,  0xab,  0x99,  0x93,  0xca,  0x82,  0x8a,
-  0x28,  0xa9,  0x28,  0x2a,  0x1f,  0xb3,  0x0f,  0xb4,  0x79,  0xb9,  0x39,  0xf4,
-  0xa9,  0xa8,  0xa6,  0x9d,  0x84,  0xd5,  0xf7,  0x3e,  0x20,  0xff,  0x00,  0x87,
-  0xa6,  0xf8,  0x5b,  0xfe,  0x84,  0x7d,  0x63,  0xff,  0x00,  0x02,  0xa2,  0xa3,
-  0xfe,  0x1e,  0x9b,  0xe1,  0x6f,  0xfa,  0x11,  0xf5,  0x8f,  0xfc,  0x0a,  0x8a,
-  0xbe,  0x17,  0xfe,  0xc6,  0xb2,  0xff,  0x00,  0x9f,  0x64,  0xa7,  0x47,  0xa2,
-  0x59,  0x31,  0xe6,  0xd9,  0x31,  0x45,  0x8e,  0x9e,  0x44,  0x7d,  0xcd,  0xff,
-  0x00,  0x0f,  0x4d,  0xf0,  0xb7,  0xfd,  0x08,  0xfa,  0xc7,  0xfe,  0x05,  0x45,
-  0x47,  0xfc,  0x3d,  0x37,  0xc2,  0xdf,  0xf4,  0x23,  0xeb,  0x1f,  0xf8,  0x15,
-  0x15,  0x7c,  0x3b,  0xfd,  0x87,  0x61,  0xff,  0x00,  0x3e,  0xb1,  0xfe,  0x54,
-  0xd9,  0x34,  0x6b,  0x05,  0x1c,  0x5b,  0x47,  0x9f,  0xa5,  0x16,  0x0e,  0x44,
-  0x7d,  0xc9,  0xff,  0x00,  0x0f,  0x4d,  0xf0,  0xb7,  0xfd,  0x08,  0xfa,  0xc7,
-  0xfe,  0x05,  0x45,  0x47,  0xfc,  0x3d,  0x37,  0xc2,  0xdf,  0xf4,  0x23,  0xeb,
-  0x1f,  0xf8,  0x15,  0x15,  0x7c,  0x2f,  0xfd,  0x8d,  0x65,  0xff,  0x00,  0x3e,
-  0xc9,  0xf9,  0x53,  0xe3,  0xd1,  0x2c,  0x4f,  0x26,  0xd9,  0x31,  0xf4,  0xa2,
-  0xc1,  0xc8,  0x8f,  0xb9,  0x7f,  0xe1,  0xe9,  0xbe,  0x16,  0xff,  0x00,  0xa1,
-  0x1f,  0x58,  0xff,  0x00,  0xc0,  0xa8,  0xa8,  0xff,  0x00,  0x87,  0xa6,  0xf8,
-  0x5b,  0xfe,  0x84,  0x7d,  0x63,  0xff,  0x00,  0x02,  0xa2,  0xaf,  0x87,  0x7f,
-  0xb0,  0xec,  0x3f,  0xe7,  0xd6,  0x3f,  0xca,  0x99,  0x26,  0x8d,  0x62,  0x38,
-  0x16,  0xc9,  0x9a,  0x2c,  0x1c,  0x88,  0xfb,  0x97,  0xfe,  0x1e,  0x9b,  0xe1,
-  0x6f,  0xfa,  0x11,  0xf5,  0x8f,  0xfc,  0x0a,  0x8a,  0x8f,  0xf8,  0x7a,  0x6f,
-  0x85,  0xbf,  0xe8,  0x47,  0xd6,  0x3f,  0xf0,  0x2a,  0x2a,  0xf8,  0x5f,  0xfb,
-  0x1a,  0xcb,  0xfe,  0x7d,  0x93,  0xf2,  0xa9,  0x23,  0xd1,  0x2c,  0x48,  0xc9,
-  0xb6,  0x4f,  0xca,  0x8b,  0x07,  0x22,  0x3e,  0xe4,  0xff,  0x00,  0x87,  0xa6,
-  0xf8,  0x5b,  0xfe,  0x84,  0x7d,  0x63,  0xff,  0x00,  0x02,  0xa2,  0xa3,  0xfe,
-  0x1e,  0x9b,  0xe1,  0x6f,  0xfa,  0x11,  0xf5,  0x8f,  0xfc,  0x0a,  0x8a,  0xbe,
-  0x1d,  0xfe,  0xc3,  0xb0,  0xff,  0x00,  0x9f,  0x58,  0xff,  0x00,  0x2a,  0x64,
-  0x9a,  0x35,  0x88,  0x38,  0x16,  0xc9,  0xf9,  0x51,  0x60,  0xe4,  0x47,  0xdc,
-  0xbf,  0xf0,  0xf4,  0xdf,  0x0b,  0x7f,  0xd0,  0x8f,  0xac,  0x7f,  0xe0,  0x54,
-  0x54,  0x7f,  0xc3,  0xd3,  0x7c,  0x2d,  0xff,  0x00,  0x42,  0x3e,  0xb1,  0xff,
-  0x00,  0x81,  0x51,  0x57,  0xc2,  0xff,  0x00,  0xd8,  0xd6,  0x5f,  0xf3,  0xec,
-  0x9f,  0x95,  0x48,  0x9a,  0x1d,  0x89,  0x19,  0x36,  0xc9,  0xf9,  0x51,  0x60,
-  0xe4,  0x47,  0xdc,  0x9f,  0xf0,  0xf4,  0xdf,  0x0b,  0x7f,  0xd0,  0x8f,  0xac,
-  0x7f,  0xe0,  0x54,  0x54,  0x7f,  0xc3,  0xd3,  0x7c,  0x2d,  0xff,  0x00,  0x42,
-  0x3e,  0xb1,  0xff,  0x00,  0x81,  0x51,  0x57,  0xc3,  0xbf,  0xd8,  0x76,  0x1f,
-  0xf3,  0xeb,  0x1f,  0xe5,  0x51,  0xbe,  0x8d,  0x63,  0x9c,  0x0b,  0x64,  0xfc,
-  0xa8,  0xb0,  0x72,  0x23,  0xee,  0x6f,  0xf8,  0x7a,  0x6f,  0x85,  0xbf,  0xe8,
-  0x47,  0xd6,  0x3f,  0xf0,  0x2a,  0x2a,  0x3f,  0xe1,  0xe9,  0xbe,  0x16,  0xff,
-  0x00,  0xa1,  0x1f,  0x58,  0xff,  0x00,  0xc0,  0xa8,  0xab,  0xe1,  0x7f,  0xec,
-  0x7b,  0x2f,  0xf9,  0xf6,  0x4f,  0xca,  0x9b,  0x2e,  0x9d,  0xa7,  0xdb,  0xed,
-  0x53,  0x67,  0xe6,  0xc8,  0xc0,  0x90,  0xb1,  0xae,  0x4e,  0x3d,  0x68,  0xb0,
-  0x72,  0x23,  0xee,  0xaf,  0xf8,  0x7a,  0x6f,  0x85,  0xbf,  0xe8,  0x47,  0xd6,
-  0x3f,  0xf0,  0x2a,  0x2a,  0x3f,  0xe1,  0xe9,  0xbe,  0x16,  0xff,  0x00,  0xa1,
-  0x1f,  0x58,  0xff,  0x00,  0xc0,  0xa8,  0xab,  0xe1,  0x1f,  0x23,  0x4b,  0xd8,
-  0x1b,  0xec,  0x44,  0x8d,  0xbb,  0x9b,  0x09,  0xf7,  0x06,  0x48,  0xc9,  0xe7,
-  0xd8,  0xfe,  0x54,  0x3d,  0x9e,  0x9e,  0x2e,  0x04,  0x66,  0xcb,  0x60,  0x27,
-  0x68,  0x72,  0xbf,  0x29,  0x3f,  0x5c,  0xd1,  0x60,  0xe4,  0x47,  0xdd,  0xdf,
-  0xf0,  0xf4,  0xdf,  0x0b,  0x7f,  0xd0,  0x8f,  0xac,  0x7f,  0xe0,  0x54,  0x54,
-  0x7f,  0xc3,  0xd3,  0x7c,  0x2d,  0xff,  0x00,  0x42,  0x3e,  0xb1,  0xff,  0x00,
-  0x81,  0x51,  0x57,  0xc1,  0x82,  0xdf,  0x4e,  0x1b,  0xb7,  0xd9,  0x98,  0x88,
-  0x19,  0xda,  0xeb,  0xc9,  0xe7,  0x1c,  0x73,  0xea,  0x45,  0x4d,  0x1d,  0x9e,
-  0x9a,  0x46,  0x0d,  0x91,  0x12,  0x02,  0x41,  0x8c,  0xaf,  0xcd,  0x9c,  0x67,
-  0xd7,  0xd2,  0x8b,  0x07,  0x22,  0x3e,  0xed,  0xff,  0x00,  0x87,  0xa6,  0xf8,
-  0x5b,  0xfe,  0x84,  0x7d,  0x63,  0xff,  0x00,  0x02,  0xa2,  0xa3,  0xfe,  0x1e,
-  0x9b,  0xe1,  0x6f,  0xfa,  0x11,  0xf5,  0x8f,  0xfc,  0x0a,  0x8a,  0xbe,  0x16,
-  0xb7,  0xd3,  0xf4,  0xeb,  0x86,  0x65,  0xfb,  0x1f,  0x96,  0xea,  0x01,  0x2b,
-  0x22,  0xe0,  0xe0,  0xf7,  0xa7,  0x36,  0x8f,  0x62,  0x49,  0xc5,  0xb2,  0x62,
-  0x8b,  0x07,  0x22,  0x3e,  0xe7,  0xff,  0x00,  0x87,  0xa6,  0xf8,  0x5b,  0xfe,
-  0x84,  0x7d,  0x63,  0xff,  0x00,  0x02,  0xa2,  0xa3,  0xfe,  0x1e,  0x9b,  0xe1,
-  0x6f,  0xfa,  0x11,  0xf5,  0x8f,  0xfc,  0x0a,  0x8a,  0xbe,  0x17,  0xfe,  0xc6,
-  0xb2,  0x3f,  0xf2,  0xec,  0x95,  0x30,  0xd0,  0xec,  0x40,  0xff,  0x00,  0x8f,
-  0x64,  0xa2,  0xc1,  0xc8,  0x8f,  0xb8,  0xbf,  0xe1,  0xe9,  0xbe,  0x16,  0xff,
-  0x00,  0xa1,  0x1f,  0x58,  0xff,  0x00,  0xc0,  0xa8,  0xa8,  0xff,  0x00,  0x87,
-  0xa6,  0xf8,  0x5b,  0xfe,  0x84,  0x7d,  0x63,  0xff,  0x00,  0x02,  0xa2,  0xaf,
-  0x87,  0x7f,  0xb1,  0x2c,  0x07,  0xfc,  0xba,  0xc7,  0xf9,  0x54,  0x27,  0x47,
-  0xb2,  0x27,  0xfe,  0x3d,  0x92,  0x8b,  0x07,  0x22,  0x3e,  0xe8,  0xff,  0x00,
-  0x87,  0xa6,  0xf8,  0x5b,  0xfe,  0x84,  0x7d,  0x63,  0xff,  0x00,  0x02,  0xa2,
-  0xa3,  0xfe,  0x1e,  0x9b,  0xe1,  0x6f,  0xfa,  0x11,  0xf5,  0x8f,  0xfc,  0x0a,
-  0x8a,  0xbe,  0x17,  0x1a,  0x2d,  0x91,  0x38,  0xfb,  0x32,  0x54,  0xdf,  0xd8,
-  0x76,  0x1f,  0xf3,  0xea,  0x9f,  0x95,  0x16,  0x0e,  0x44,  0x7d,  0xc5,  0xff,
-  0x00,  0x0f,  0x4d,  0xf0,  0xb7,  0xfd,  0x08,  0xfa,  0xc7,  0xfe,  0x05,  0x45,
-  0x47,  0xfc,  0x3d,  0x37,  0xc2,  0xdf,  0xf4,  0x23,  0xeb,  0x1f,  0xf8,  0x15,
-  0x15,  0x7c,  0x3a,  0x74,  0x4b,  0x00,  0x33,  0xf6,  0x58,  0xff,  0x00,  0x2a,
-  0x84,  0xe8,  0xd6,  0x5f,  0xf3,  0xec,  0x94,  0x58,  0x39,  0x11,  0xf7,  0x47,
-  0xfc,  0x3d,  0x37,  0xc2,  0xdf,  0xf4,  0x23,  0xeb,  0x1f,  0xf8,  0x15,  0x15,
-  0x1f,  0xf0,  0xf4,  0xdf,  0x0b,  0x7f,  0xd0,  0x8f,  0xac,  0x7f,  0xe0,  0x54,
-  0x55,  0xf0,  0xc2,  0xe8,  0xb6,  0x4c,  0x40,  0xfb,  0x32,  0x54,  0xbf,  0xd8,
-  0x76,  0x1f,  0xf3,  0xea,  0x94,  0x58,  0x39,  0x11,  0xf7,  0x17,  0xfc,  0x3d,
-  0x37,  0xc2,  0xdf,  0xf4,  0x23,  0xeb,  0x1f,  0xf8,  0x15,  0x15,  0x1f,  0xf0,
-  0xf4,  0xdf,  0x0b,  0x7f,  0xd0,  0x8f,  0xac,  0x7f,  0xe0,  0x54,  0x55,  0xf0,
-  0xe3,  0x68,  0xb6,  0x0a,  0x09,  0xfb,  0x2c,  0x7f,  0x95,  0x45,  0xfd,  0x8d,
-  0x65,  0xff,  0x00,  0x3e,  0xc9,  0x45,  0x83,  0x91,  0x1f,  0x74,  0x7f,  0xc3,
-  0xd3,  0x7c,  0x2d,  0xff,  0x00,  0x42,  0x3e,  0xb1,  0xff,  0x00,  0x81,  0x51,
-  0x51,  0xff,  0x00,  0x0f,  0x4d,  0xf0,  0xb7,  0xfd,  0x08,  0xfa,  0xc7,  0xfe,
-  0x05,  0x45,  0x5f,  0x0c,  0x26,  0x89,  0x64,  0xcd,  0xff,  0x00,  0x1e,  0xc9,
-  0x52,  0xff,  0x00,  0x61,  0xd8,  0x7f,  0xcf,  0xac,  0x7f,  0x95,  0x16,  0x0e,
-  0x44,  0x7d,  0xc5,  0xff,  0x00,  0x0f,  0x4d,  0xf0,  0xb7,  0xfd,  0x08,  0xfa,
-  0xc7,  0xfe,  0x05,  0x45,  0x47,  0xfc,  0x3d,  0x37,  0xc2,  0xdf,  0xf4,  0x23,
-  0xeb,  0x1f,  0xf8,  0x15,  0x15,  0x7c,  0x38,  0xfa,  0x2d,  0x82,  0xaf,  0xfc,
-  0x7a,  0xc7,  0xf9,  0x54,  0x5f,  0xd8,  0xd6,  0x5f,  0xf3,  0xec,  0x94,  0x58,
-  0x39,  0x11,  0x72,  0xa7,  0x45,  0xda,  0xb8,  0xa8,  0xe3,  0x5c,  0xb6,  0x7d,
-  0x2a,  0x5a,  0xa2,  0xc2,  0xa1,  0x66,  0xdc,  0xd9,  0xa7,  0xc8,  0xd8,  0x18,
-  0xf5,  0xa8,  0xa8,  0x01,  0x40,  0xc9,  0xa9,  0xd4,  0x6d,  0x18,  0xa8,  0xe2,
-  0x5e,  0x73,  0x52,  0x50,  0x00,  0x4e,  0x05,  0x40,  0xc7,  0x71,  0xcd,  0x49,
-  0x2b,  0x71,  0x8a,  0x8a,  0x80,  0x14,  0x0c,  0x9c,  0x54,  0xe0,  0x60,  0x62,
-  0xa3,  0x89,  0x7b,  0xd4,  0x94,  0x00,  0x13,  0x80,  0x4d,  0x40,  0x4e,  0x4e,
-  0x69,  0xf2,  0xb7,  0x6a,  0x8e,  0x80,  0x15,  0x46,  0xe3,  0x8a,  0x9e,  0x99,
-  0x1a,  0xe0,  0x67,  0xd6,  0x9f,  0x40,  0x08,  0xc7,  0x68,  0xcd,  0x41,  0x4f,
-  0x91,  0xb2,  0x71,  0xe9,  0x4c,  0xa0,  0x07,  0x22,  0xee,  0x6f,  0x6a,  0x27,
-  0xb5,  0x59,  0xa4,  0x49,  0x37,  0xbc,  0x6e,  0xbc,  0x06,  0x43,  0x8c,  0x8f,
-  0x43,  0xed,  0x52,  0x46,  0xb8,  0x5f,  0x73,  0x4e,  0xa0,  0x0a,  0xa6,  0xca,
-  0x38,  0xa2,  0x95,  0x41,  0x6f,  0xde,  0x2e,  0xc3,  0xcf,  0x6c,  0x93,  0xff,
-  0x00,  0xb3,  0x1a,  0x87,  0xec,  0x60,  0xca,  0xae,  0xd2,  0x48,  0xe1,  0x4e,
-  0x42,  0x12,  0x36,  0x83,  0xf9,  0x55,  0xa9,  0x1b,  0x73,  0x7b,  0x0a,  0x6d,
-  0x00,  0x57,  0x8b,  0x49,  0xb7,  0x0c,  0xfb,  0x53,  0xcb,  0x0c,  0x00,  0x21,
-  0x38,  0xe8,  0x72,  0x0f,  0xd6,  0xa6,  0x5d,  0x39,  0x17,  0x90,  0xf2,  0x79,
-  0x99,  0x2c,  0x64,  0x27,  0x2c,  0x4e,  0xdc,  0x7e,  0x82,  0xac,  0xa2,  0xed,
-  0x5a,  0x5a,  0x00,  0xad,  0x1d,  0xaa,  0xdb,  0x16,  0x6f,  0x31,  0xe5,  0x91,
-  0xc0,  0x05,  0xe4,  0x39,  0x38,  0x1d,  0xbf,  0x5a,  0x5a,  0x73,  0xb6,  0xe6,
-  0xa6,  0xf5,  0xa0,  0x07,  0xc4,  0xb9,  0x39,  0xf4,  0xa9,  0x69,  0x14,  0x6d,
-  0x18,  0xa5,  0xe9,  0x40,  0x0c,  0x95,  0xb0,  0x31,  0x51,  0x52,  0xb1,  0xdc,
-  0x49,  0xa0,  0x0c,  0x9c,  0x50,  0x03,  0xe2,  0x5e,  0xf5,  0x25,  0x00,  0x60,
-  0x62,  0x82,  0x70,  0x33,  0x40,  0x11,  0xca,  0xdd,  0xaa,  0x3a,  0x52,  0x72,
-  0x73,  0x42,  0x8d,  0xc4,  0x0a,  0x00,  0x92,  0x25,  0xc0,  0xcd,  0x3e,  0x8e,
-  0x94,  0x8c,  0x76,  0x82,  0x68,  0x02,  0x39,  0x5b,  0x27,  0x1e,  0x94,  0xca,
-  0x3a,  0xd3,  0x91,  0x77,  0x35,  0x00,  0x49,  0x1a,  0xe1,  0x7d,  0xcd,  0x3a,
-  0x8a,  0x47,  0x6d,  0xab,  0x40,  0x11,  0xc8,  0xd9,  0x6f,  0x61,  0x4c,  0xa2,
-  0x9d,  0x1a,  0xee,  0x6f,  0x61,  0x40,  0x1f,  0xff,  0xd9
-};
diff --git a/services/camera/libcameraservice/FakeCamera.cpp b/services/camera/libcameraservice/FakeCamera.cpp
deleted file mode 100644
index f3a6a67..0000000
--- a/services/camera/libcameraservice/FakeCamera.cpp
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
-**
-** Copyright 2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
-**
-**     http://www.apache.org/licenses/LICENSE-2.0 
-**
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
-** limitations under the License.
-*/
-
-#define LOG_TAG "FakeCamera"
-#include <utils/Log.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <utils/String8.h>
-
-#include "FakeCamera.h"
-
-
-namespace android {
-
-// TODO: All this rgb to yuv should probably be in a util class.
-
-// TODO: I think something is wrong in this class because the shadow is kBlue
-// and the square color should alternate between kRed and kGreen. However on the
-// emulator screen these are all shades of gray. Y seems ok but the U and V are
-// probably not.
-
-static int tables_initialized = 0;
-uint8_t *gYTable, *gCbTable, *gCrTable;
-
-static int
-clamp(int  x)
-{
-    if (x > 255) return 255;
-    if (x < 0)   return 0;
-    return x;
-}
-
-/* the equation used by the video code to translate YUV to RGB looks like this
- *
- *    Y  = (Y0 - 16)*k0
- *    Cb = Cb0 - 128
- *    Cr = Cr0 - 128
- *
- *    G = ( Y - k1*Cr - k2*Cb )
- *    R = ( Y + k3*Cr )
- *    B = ( Y + k4*Cb )
- *
- */
-
-static const double  k0 = 1.164;
-static const double  k1 = 0.813;
-static const double  k2 = 0.391;
-static const double  k3 = 1.596;
-static const double  k4 = 2.018;
-
-/* let's try to extract the value of Y
- *
- *   G + k1/k3*R + k2/k4*B = Y*( 1 + k1/k3 + k2/k4 )
- *
- *   Y  = ( G + k1/k3*R + k2/k4*B ) / (1 + k1/k3 + k2/k4)
- *   Y0 = ( G0 + k1/k3*R0 + k2/k4*B0 ) / ((1 + k1/k3 + k2/k4)*k0) + 16
- *
- * let define:
- *   kYr = k1/k3
- *   kYb = k2/k4
- *   kYy = k0 * ( 1 + kYr + kYb )
- *
- * we have:
- *    Y  = ( G + kYr*R + kYb*B )
- *    Y0 = clamp[ Y/kYy + 16 ]
- */
-
-static const double kYr = k1/k3;
-static const double kYb = k2/k4;
-static const double kYy = k0*( 1. + kYr + kYb );
-
-static void
-initYtab( void )
-{
-    const  int imax = (int)( (kYr + kYb)*(31 << 2) + (61 << 3) + 0.1 );
-    int    i;
-
-    gYTable = (uint8_t *)malloc(imax);
-
-    for(i=0; i<imax; i++) {
-        int  x = (int)(i/kYy + 16.5);
-        if (x < 16) x = 16;
-        else if (x > 235) x = 235;
-        gYTable[i] = (uint8_t) x;
-    }
-}
-
-/*
- *   the source is RGB565, so adjust for 8-bit range of input values:
- *
- *   G = (pixels >> 3) & 0xFC;
- *   R = (pixels >> 8) & 0xF8;
- *   B = (pixels & 0x1f) << 3;
- *
- *   R2 = (pixels >> 11)      R = R2*8
- *   B2 = (pixels & 0x1f)     B = B2*8
- *
- *   kYr*R = kYr2*R2 =>  kYr2 = kYr*8
- *   kYb*B = kYb2*B2 =>  kYb2 = kYb*8
- *
- *   we want to use integer multiplications:
- *
- *   SHIFT1 = 9
- *
- *   (ALPHA*R2) >> SHIFT1 == R*kYr  =>  ALPHA = kYr*8*(1 << SHIFT1)
- *
- *   ALPHA = kYr*(1 << (SHIFT1+3))
- *   BETA  = kYb*(1 << (SHIFT1+3))
- */
-
-static const int  SHIFT1  = 9;
-static const int  ALPHA   = (int)( kYr*(1 << (SHIFT1+3)) + 0.5 );
-static const int  BETA    = (int)( kYb*(1 << (SHIFT1+3)) + 0.5 );
-
-/*
- *  now let's try to get the values of Cb and Cr
- *
- *  R-B = (k3*Cr - k4*Cb)
- *
- *    k3*Cr = k4*Cb + (R-B)
- *    k4*Cb = k3*Cr - (R-B)
- *
- *  R-G = (k1+k3)*Cr + k2*Cb
- *      = (k1+k3)*Cr + k2/k4*(k3*Cr - (R-B)/k0)
- *      = (k1 + k3 + k2*k3/k4)*Cr - k2/k4*(R-B)
- *
- *  kRr*Cr = (R-G) + kYb*(R-B)
- *
- *  Cr  = ((R-G) + kYb*(R-B))/kRr
- *  Cr0 = clamp(Cr + 128)
- */
-
-static const double  kRr = (k1 + k3 + k2*k3/k4);
-
-static void
-initCrtab( void )
-{
-    uint8_t *pTable;
-    int i;
-
-    gCrTable = (uint8_t *)malloc(768*2);
-
-    pTable = gCrTable + 384;
-    for(i=-384; i<384; i++)
-        pTable[i] = (uint8_t) clamp( i/kRr + 128.5 );
-}
-
-/*
- *  B-G = (k2 + k4)*Cb + k1*Cr
- *      = (k2 + k4)*Cb + k1/k3*(k4*Cb + (R-B))
- *      = (k2 + k4 + k1*k4/k3)*Cb + k1/k3*(R-B)
- *
- *  kBb*Cb = (B-G) - kYr*(R-B)
- *
- *  Cb   = ((B-G) - kYr*(R-B))/kBb
- *  Cb0  = clamp(Cb + 128)
- *
- */
-
-static const double  kBb = (k2 + k4 + k1*k4/k3);
-
-static void
-initCbtab( void )
-{
-    uint8_t *pTable;
-    int i;
-
-    gCbTable = (uint8_t *)malloc(768*2);
-
-    pTable = gCbTable + 384;
-    for(i=-384; i<384; i++)
-        pTable[i] = (uint8_t) clamp( i/kBb + 128.5 );
-}
-
-/*
- *   SHIFT2 = 16
- *
- *   DELTA = kYb*(1 << SHIFT2)
- *   GAMMA = kYr*(1 << SHIFT2)
- */
-
-static const int  SHIFT2 = 16;
-static const int  DELTA  = kYb*(1 << SHIFT2);
-static const int  GAMMA  = kYr*(1 << SHIFT2);
-
-int32_t ccrgb16toyuv_wo_colorkey(uint8_t *rgb16, uint8_t *yuv420,
-        uint32_t *param, uint8_t *table[])
-{
-    uint16_t *inputRGB = (uint16_t*)rgb16;
-    uint8_t *outYUV = yuv420;
-    int32_t width_dst = param[0];
-    int32_t height_dst = param[1];
-    int32_t pitch_dst = param[2];
-    int32_t mheight_dst = param[3];
-    int32_t pitch_src = param[4];
-    uint8_t *y_tab = table[0];
-    uint8_t *cb_tab = table[1];
-    uint8_t *cr_tab = table[2];
-
-    int32_t size16 = pitch_dst*mheight_dst;
-    int32_t i,j,count;
-    int32_t ilimit,jlimit;
-    uint8_t *tempY,*tempU,*tempV;
-    uint16_t pixels;
-    int   tmp;
-uint32_t temp;
-
-    tempY = outYUV;
-    tempU = outYUV + (height_dst * pitch_dst);
-    tempV = tempU + 1;
-
-    jlimit = height_dst;
-    ilimit = width_dst;
-
-    for(j=0; j<jlimit; j+=1)
-    {
-        for (i=0; i<ilimit; i+=2)
-        {
-            int32_t   G_ds = 0, B_ds = 0, R_ds = 0;
-            uint8_t   y0, y1, u, v;
-
-            pixels =  inputRGB[i];
-            temp = (BETA*(pixels & 0x001F) + ALPHA*(pixels>>11) );
-            y0   = y_tab[(temp>>SHIFT1) + ((pixels>>3) & 0x00FC)];
-
-            G_ds    += (pixels>>1) & 0x03E0;
-            B_ds    += (pixels<<5) & 0x03E0;
-            R_ds    += (pixels>>6) & 0x03E0;
-
-            pixels =  inputRGB[i+1];
-            temp = (BETA*(pixels & 0x001F) + ALPHA*(pixels>>11) );
-            y1   = y_tab[(temp>>SHIFT1) + ((pixels>>3) & 0x00FC)];
-
-            G_ds    += (pixels>>1) & 0x03E0;
-            B_ds    += (pixels<<5) & 0x03E0;
-            R_ds    += (pixels>>6) & 0x03E0;
-
-            R_ds >>= 1;
-            B_ds >>= 1;
-            G_ds >>= 1;
-
-            tmp = R_ds - B_ds;
-
-            u = cb_tab[(((B_ds-G_ds)<<SHIFT2) - GAMMA*tmp)>>(SHIFT2+2)];
-            v = cr_tab[(((R_ds-G_ds)<<SHIFT2) + DELTA*tmp)>>(SHIFT2+2)];
-
-            tempY[0] = y0;
-            tempY[1] = y1;
-            tempY += 2;
-
-            if ((j&1) == 0) {
-                tempU[0] = u;
-                tempV[0] = v;
-                tempU += 2;
-                tempV += 2;
-            }
-        }
-
-        inputRGB += pitch_src;
-    }
-
-    return 1;
-}
-
-#define min(a,b) ((a)<(b)?(a):(b))
-#define max(a,b) ((a)>(b)?(a):(b))
-
-static void convert_rgb16_to_yuv420(uint8_t *rgb, uint8_t *yuv, int width, int height)
-{
-    if (!tables_initialized) {
-        initYtab();
-        initCrtab();
-        initCbtab();
-        tables_initialized = 1;
-    }
-
-    uint32_t param[6];
-    param[0] = (uint32_t) width;
-    param[1] = (uint32_t) height;
-    param[2] = (uint32_t) width;
-    param[3] = (uint32_t) height;
-    param[4] = (uint32_t) width;
-    param[5] = (uint32_t) 0;
-
-    uint8_t *table[3];
-    table[0] = gYTable;
-    table[1] = gCbTable + 384;
-    table[2] = gCrTable + 384;
-
-    ccrgb16toyuv_wo_colorkey(rgb, yuv, param, table);
-}
-
-const int FakeCamera::kRed;
-const int FakeCamera::kGreen;
-const int FakeCamera::kBlue;
-
-FakeCamera::FakeCamera(int width, int height)
-          : mTmpRgb16Buffer(0)
-{
-    setSize(width, height);
-}
-
-FakeCamera::~FakeCamera()
-{
-    delete[] mTmpRgb16Buffer;
-}
-
-void FakeCamera::setSize(int width, int height)
-{
-    mWidth = width;
-    mHeight = height;
-    mCounter = 0;
-    mCheckX = 0;
-    mCheckY = 0;
-
-    // This will cause it to be reallocated on the next call
-    // to getNextFrameAsYuv420().
-    delete[] mTmpRgb16Buffer;
-    mTmpRgb16Buffer = 0;
-}
-
-void FakeCamera::getNextFrameAsRgb565(uint16_t *buffer)
-{
-    int size = mWidth / 10;
-
-    drawCheckerboard(buffer, size);
-
-    int x = ((mCounter*3)&255);
-    if(x>128) x = 255 - x;
-    int y = ((mCounter*5)&255);
-    if(y>128) y = 255 - y;
-
-    drawSquare(buffer, x*size/32, y*size/32, (size*5)>>1, (mCounter&0x100)?kRed:kGreen, kBlue);
-
-    mCounter++;
-}
-
-void FakeCamera::getNextFrameAsYuv420(uint8_t *buffer)
-{
-    if (mTmpRgb16Buffer == 0)
-        mTmpRgb16Buffer = new uint16_t[mWidth * mHeight];
-
-    getNextFrameAsRgb565(mTmpRgb16Buffer);
-    convert_rgb16_to_yuv420((uint8_t*)mTmpRgb16Buffer, buffer, mWidth, mHeight);
-}
-
-void FakeCamera::drawSquare(uint16_t *dst, int x, int y, int size, int color, int shadow)
-{
-    int square_xstop, square_ystop, shadow_xstop, shadow_ystop;
-
-    square_xstop = min(mWidth, x+size);
-    square_ystop = min(mHeight, y+size);
-    shadow_xstop = min(mWidth, x+size+(size/4));
-    shadow_ystop = min(mHeight, y+size+(size/4));
-
-    // Do the shadow.
-    uint16_t *sh = &dst[(y+(size/4))*mWidth];
-    for (int j = y + (size/4); j < shadow_ystop; j++) {
-        for (int i = x + (size/4); i < shadow_xstop; i++) {
-            sh[i] &= shadow;
-        }
-        sh += mWidth;
-    }
-
-    // Draw the square.
-    uint16_t *sq = &dst[y*mWidth];
-    for (int j = y; j < square_ystop; j++) {
-        for (int i = x; i < square_xstop; i++) {
-            sq[i] = color;
-        }
-        sq += mWidth;
-    }
-}
-
-void FakeCamera::drawCheckerboard(uint16_t *dst, int size)
-{
-    bool black = true;
-
-    if((mCheckX/size)&1)
-        black = false;
-    if((mCheckY/size)&1)
-        black = !black;
-
-    int county = mCheckY%size;
-    int checkxremainder = mCheckX%size;
-
-    for(int y=0;y<mHeight;y++) {
-        int countx = checkxremainder;
-        bool current = black;
-        for(int x=0;x<mWidth;x++) {
-            dst[y*mWidth+x] = current?0:0xffff;
-            if(countx++ >= size) {
-                countx=0;
-                current = !current;
-            }
-        }
-        if(county++ >= size) {
-            county=0;
-            black = !black;
-        }
-    }
-    mCheckX += 3;
-    mCheckY++;
-}
-
-
-void FakeCamera::dump(int fd) const
-{
-    const size_t SIZE = 256;
-    char buffer[SIZE];
-    String8 result;
-    snprintf(buffer, 255, " width x height (%d x %d), counter (%d), check x-y coordinate(%d, %d)\n", mWidth, mHeight, mCounter, mCheckX, mCheckY);
-    result.append(buffer);
-    ::write(fd, result.string(), result.size());
-}
-
-
-}; // namespace android
diff --git a/services/camera/libcameraservice/FakeCamera.h b/services/camera/libcameraservice/FakeCamera.h
deleted file mode 100644
index 724de20..0000000
--- a/services/camera/libcameraservice/FakeCamera.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-**
-** Copyright 2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
-**
-**     http://www.apache.org/licenses/LICENSE-2.0 
-**
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
-** limitations under the License.
-*/
-
-#ifndef ANDROID_HARDWARE_FAKECAMERA_H
-#define ANDROID_HARDWARE_FAKECAMERA_H
-
-#include <sys/types.h>
-#include <stdint.h>
-
-namespace android {
-
-/*
- * FakeCamera is used in the CameraHardwareStub to provide a fake video feed
- * when the system does not have a camera in hardware.
- * The fake video is a moving black and white checkerboard background with a
- * bouncing gray square in the foreground.
- * This class is not thread-safe.
- *
- * TODO: Since the major methods provides a raw/uncompressed video feed, rename
- * this class to RawVideoSource.
- */
-
-class FakeCamera {
-public:
-    FakeCamera(int width, int height);
-    ~FakeCamera();
-
-    void setSize(int width, int height);
-    void getNextFrameAsYuv420(uint8_t *buffer);
-    // Write to the fd a string representing the current state.
-    void dump(int fd) const;
-
-private:
-    // TODO: remove the uint16_t buffer param everywhere since it is a field of
-    // this class.
-    void getNextFrameAsRgb565(uint16_t *buffer);
-
-    void drawSquare(uint16_t *buffer, int x, int y, int size, int color, int shadow);
-    void drawCheckerboard(uint16_t *buffer, int size);
-
-    static const int kRed = 0xf800;
-    static const int kGreen = 0x07c0;
-    static const int kBlue = 0x003e;
-
-    int         mWidth, mHeight;
-    int         mCounter;
-    int         mCheckX, mCheckY;
-    uint16_t    *mTmpRgb16Buffer;
-};
-
-}; // namespace android
-
-#endif // ANDROID_HARDWARE_FAKECAMERA_H
diff --git a/services/camera/libcameraservice/camera2/CallbackProcessor.cpp b/services/camera/libcameraservice/camera2/CallbackProcessor.cpp
new file mode 100644
index 0000000..854b890
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/CallbackProcessor.cpp
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Camera2Client::CallbackProcessor"
+#define ATRACE_TAG ATRACE_TAG_CAMERA
+//#define LOG_NDEBUG 0
+
+#include <utils/Log.h>
+#include <utils/Trace.h>
+
+#include "CallbackProcessor.h"
+#include <gui/SurfaceTextureClient.h>
+#include "../Camera2Device.h"
+#include "../Camera2Client.h"
+
+
+namespace android {
+namespace camera2 {
+
+CallbackProcessor::CallbackProcessor(wp<Camera2Client> client):
+        Thread(false),
+        mClient(client),
+        mCallbackAvailable(false),
+        mCallbackStreamId(NO_STREAM) {
+}
+
+CallbackProcessor::~CallbackProcessor() {
+    ALOGV("%s: Exit", __FUNCTION__);
+}
+
+void CallbackProcessor::onFrameAvailable() {
+    Mutex::Autolock l(mInputMutex);
+    if (!mCallbackAvailable) {
+        mCallbackAvailable = true;
+        mCallbackAvailableSignal.signal();
+    }
+}
+
+status_t CallbackProcessor::updateStream(const Parameters &params) {
+    ATRACE_CALL();
+    status_t res;
+
+    Mutex::Autolock l(mInputMutex);
+
+    sp<Camera2Client> client = mClient.promote();
+    if (client == 0) return OK;
+    sp<Camera2Device> device = client->getCameraDevice();
+
+    if (mCallbackConsumer == 0) {
+        // Create CPU buffer queue endpoint
+        mCallbackConsumer = new CpuConsumer(kCallbackHeapCount);
+        mCallbackConsumer->setFrameAvailableListener(this);
+        mCallbackConsumer->setName(String8("Camera2Client::CallbackConsumer"));
+        mCallbackWindow = new SurfaceTextureClient(
+            mCallbackConsumer->getProducerInterface());
+    }
+
+    if (mCallbackStreamId != NO_STREAM) {
+        // Check if stream parameters have to change
+        uint32_t currentWidth, currentHeight, currentFormat;
+        res = device->getStreamInfo(mCallbackStreamId,
+                &currentWidth, &currentHeight, &currentFormat);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Error querying callback output stream info: "
+                    "%s (%d)", __FUNCTION__, client->getCameraId(),
+                    strerror(-res), res);
+            return res;
+        }
+        if (currentWidth != (uint32_t)params.previewWidth ||
+                currentHeight != (uint32_t)params.previewHeight ||
+                currentFormat != (uint32_t)params.previewFormat) {
+            // Since size should only change while preview is not running,
+            // assuming that all existing use of old callback stream is
+            // completed.
+            res = device->deleteStream(mCallbackStreamId);
+            if (res != OK) {
+                ALOGE("%s: Camera %d: Unable to delete old output stream "
+                        "for callbacks: %s (%d)", __FUNCTION__, client->getCameraId(),
+                        strerror(-res), res);
+                return res;
+            }
+            mCallbackStreamId = NO_STREAM;
+        }
+    }
+
+    if (mCallbackStreamId == NO_STREAM) {
+        ALOGV("Creating callback stream: %d %d format 0x%x",
+                params.previewWidth, params.previewHeight,
+                params.previewFormat);
+        res = device->createStream(mCallbackWindow,
+                params.previewWidth, params.previewHeight,
+                params.previewFormat, 0, &mCallbackStreamId);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Can't create output stream for callbacks: "
+                    "%s (%d)", __FUNCTION__, client->getCameraId(),
+                    strerror(-res), res);
+            return res;
+        }
+    }
+
+    return OK;
+}
+
+status_t CallbackProcessor::deleteStream() {
+    ATRACE_CALL();
+    status_t res;
+
+    Mutex::Autolock l(mInputMutex);
+
+    if (mCallbackStreamId != NO_STREAM) {
+        sp<Camera2Client> client = mClient.promote();
+        if (client == 0) return OK;
+        sp<Camera2Device> device = client->getCameraDevice();
+
+        device->deleteStream(mCallbackStreamId);
+        mCallbackStreamId = NO_STREAM;
+    }
+    return OK;
+}
+
+int CallbackProcessor::getStreamId() const {
+    Mutex::Autolock l(mInputMutex);
+    return mCallbackStreamId;
+}
+
+void CallbackProcessor::dump(int fd, const Vector<String16>& args) {
+}
+
+bool CallbackProcessor::threadLoop() {
+    status_t res;
+
+    {
+        Mutex::Autolock l(mInputMutex);
+        while (!mCallbackAvailable) {
+            res = mCallbackAvailableSignal.waitRelative(mInputMutex,
+                    kWaitDuration);
+            if (res == TIMED_OUT) return true;
+        }
+        mCallbackAvailable = false;
+    }
+
+    do {
+        sp<Camera2Client> client = mClient.promote();
+        if (client == 0) return false;
+        res = processNewCallback(client);
+    } while (res == OK);
+
+    return true;
+}
+
+status_t CallbackProcessor::processNewCallback(sp<Camera2Client> &client) {
+    ATRACE_CALL();
+    status_t res;
+
+    int callbackHeapId;
+    sp<Camera2Heap> callbackHeap;
+    size_t heapIdx;
+
+    CpuConsumer::LockedBuffer imgBuffer;
+    ALOGV("%s: Getting buffer", __FUNCTION__);
+    res = mCallbackConsumer->lockNextBuffer(&imgBuffer);
+    if (res != OK) {
+        if (res != BAD_VALUE) {
+            ALOGE("%s: Camera %d: Error receiving next callback buffer: "
+                    "%s (%d)", __FUNCTION__, client->getCameraId(), strerror(-res), res);
+        }
+        return res;
+    }
+    ALOGV("%s: Camera %d: Preview callback available", __FUNCTION__,
+            client->getCameraId());
+
+    {
+        SharedParameters::Lock l(client->getParameters());
+
+        if ( l.mParameters.state != Parameters::PREVIEW
+                && l.mParameters.state != Parameters::RECORD
+                && l.mParameters.state != Parameters::VIDEO_SNAPSHOT) {
+            ALOGV("%s: Camera %d: No longer streaming",
+                    __FUNCTION__, client->getCameraId());
+            mCallbackConsumer->unlockBuffer(imgBuffer);
+            return OK;
+        }
+
+        if (! (l.mParameters.previewCallbackFlags &
+                CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK) ) {
+            ALOGV("%s: No longer enabled, dropping", __FUNCTION__);
+            mCallbackConsumer->unlockBuffer(imgBuffer);
+            return OK;
+        }
+        if ((l.mParameters.previewCallbackFlags &
+                        CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK) &&
+                !l.mParameters.previewCallbackOneShot) {
+            ALOGV("%s: One shot mode, already sent, dropping", __FUNCTION__);
+            mCallbackConsumer->unlockBuffer(imgBuffer);
+            return OK;
+        }
+
+        if (imgBuffer.format != l.mParameters.previewFormat) {
+            ALOGE("%s: Camera %d: Unexpected format for callback: "
+                    "%x, expected %x", __FUNCTION__, client->getCameraId(),
+                    imgBuffer.format, l.mParameters.previewFormat);
+            mCallbackConsumer->unlockBuffer(imgBuffer);
+            return INVALID_OPERATION;
+        }
+
+        // In one-shot mode, stop sending callbacks after the first one
+        if (l.mParameters.previewCallbackFlags &
+                CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK) {
+            ALOGV("%s: clearing oneshot", __FUNCTION__);
+            l.mParameters.previewCallbackOneShot = false;
+        }
+    }
+
+    size_t bufferSize = Camera2Client::calculateBufferSize(
+            imgBuffer.width, imgBuffer.height,
+            imgBuffer.format, imgBuffer.stride);
+    size_t currentBufferSize = (mCallbackHeap == 0) ?
+            0 : (mCallbackHeap->mHeap->getSize() / kCallbackHeapCount);
+    if (bufferSize != currentBufferSize) {
+        mCallbackHeap.clear();
+        mCallbackHeap = new Camera2Heap(bufferSize, kCallbackHeapCount,
+                "Camera2Client::CallbackHeap");
+        if (mCallbackHeap->mHeap->getSize() == 0) {
+            ALOGE("%s: Camera %d: Unable to allocate memory for callbacks",
+                    __FUNCTION__, client->getCameraId());
+            mCallbackConsumer->unlockBuffer(imgBuffer);
+            return INVALID_OPERATION;
+        }
+
+        mCallbackHeapHead = 0;
+        mCallbackHeapFree = kCallbackHeapCount;
+    }
+
+    if (mCallbackHeapFree == 0) {
+        ALOGE("%s: Camera %d: No free callback buffers, dropping frame",
+                __FUNCTION__, client->getCameraId());
+        mCallbackConsumer->unlockBuffer(imgBuffer);
+        return OK;
+    }
+
+    heapIdx = mCallbackHeapHead;
+
+    mCallbackHeapHead = (mCallbackHeapHead + 1) & kCallbackHeapCount;
+    mCallbackHeapFree--;
+
+    // TODO: Get rid of this memcpy by passing the gralloc queue all the way
+    // to app
+
+    ssize_t offset;
+    size_t size;
+    sp<IMemoryHeap> heap =
+            mCallbackHeap->mBuffers[heapIdx]->getMemory(&offset,
+                    &size);
+    uint8_t *data = (uint8_t*)heap->getBase() + offset;
+    memcpy(data, imgBuffer.data, bufferSize);
+
+    ALOGV("%s: Freeing buffer", __FUNCTION__);
+    mCallbackConsumer->unlockBuffer(imgBuffer);
+
+    // Call outside parameter lock to allow re-entrancy from notification
+    {
+        Camera2Client::SharedCameraClient::Lock l(client->mSharedCameraClient);
+        if (l.mCameraClient != 0) {
+            ALOGV("%s: Camera %d: Invoking client data callback",
+                    __FUNCTION__, client->getCameraId());
+            l.mCameraClient->dataCallback(CAMERA_MSG_PREVIEW_FRAME,
+                    mCallbackHeap->mBuffers[heapIdx], NULL);
+        }
+    }
+
+    // Only increment free if we're still using the same heap
+    mCallbackHeapFree++;
+
+    ALOGV("%s: exit", __FUNCTION__);
+
+    return OK;
+}
+
+}; // namespace camera2
+}; // namespace android
diff --git a/services/camera/libcameraservice/camera2/CallbackProcessor.h b/services/camera/libcameraservice/camera2/CallbackProcessor.h
new file mode 100644
index 0000000..36c51a3
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/CallbackProcessor.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SERVERS_CAMERA_CAMERA2_CALLBACKPROCESSOR_H
+#define ANDROID_SERVERS_CAMERA_CAMERA2_CALLBACKPROCESSOR_H
+
+#include <utils/Thread.h>
+#include <utils/String16.h>
+#include <utils/Vector.h>
+#include <utils/Mutex.h>
+#include <utils/Condition.h>
+#include <gui/CpuConsumer.h>
+#include "Parameters.h"
+#include "CameraMetadata.h"
+#include "Camera2Heap.h"
+
+namespace android {
+
+class Camera2Client;
+
+namespace camera2 {
+
+/***
+ * Still image capture output image processing
+ */
+class CallbackProcessor:
+            public Thread, public CpuConsumer::FrameAvailableListener {
+  public:
+    CallbackProcessor(wp<Camera2Client> client);
+    ~CallbackProcessor();
+
+    void onFrameAvailable();
+
+    status_t updateStream(const Parameters &params);
+    status_t deleteStream();
+    int getStreamId() const;
+
+    void dump(int fd, const Vector<String16>& args);
+  private:
+    static const nsecs_t kWaitDuration = 10000000; // 10 ms
+    wp<Camera2Client> mClient;
+
+    mutable Mutex mInputMutex;
+    bool mCallbackAvailable;
+    Condition mCallbackAvailableSignal;
+
+    enum {
+        NO_STREAM = -1
+    };
+
+    int mCallbackStreamId;
+    static const size_t kCallbackHeapCount = 6;
+    sp<CpuConsumer>    mCallbackConsumer;
+    sp<ANativeWindow>  mCallbackWindow;
+    sp<Camera2Heap>    mCallbackHeap;
+    int mCallbackHeapId;
+    size_t mCallbackHeapHead, mCallbackHeapFree;
+
+    virtual bool threadLoop();
+
+    status_t processNewCallback(sp<Camera2Client> &client);
+
+};
+
+
+}; //namespace camera2
+}; //namespace android
+
+#endif
diff --git a/services/camera/libcameraservice/camera2/Camera2Heap.h b/services/camera/libcameraservice/camera2/Camera2Heap.h
new file mode 100644
index 0000000..9c72d76
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/Camera2Heap.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROiD_SERVERS_CAMERA_CAMERA2HEAP_H
+#define ANDROiD_SERVERS_CAMERA_CAMERA2HEAP_H
+
+#include <binder/MemoryBase.h>
+#include <binder/MemoryHeapBase.h>
+
+namespace android {
+namespace camera2 {
+
+// Utility class for managing a set of IMemory blocks
+class Camera2Heap : public RefBase {
+  public:
+    Camera2Heap(size_t buf_size, uint_t num_buffers = 1,
+            const char *name = NULL) :
+            mBufSize(buf_size),
+            mNumBufs(num_buffers) {
+        mHeap = new MemoryHeapBase(buf_size * num_buffers, 0, name);
+        mBuffers = new sp<MemoryBase>[mNumBufs];
+        for (uint_t i = 0; i < mNumBufs; i++)
+            mBuffers[i] = new MemoryBase(mHeap,
+                    i * mBufSize,
+                    mBufSize);
+    }
+
+    virtual ~Camera2Heap()
+    {
+        delete [] mBuffers;
+    }
+
+    size_t mBufSize;
+    uint_t mNumBufs;
+    sp<MemoryHeapBase> mHeap;
+    sp<MemoryBase> *mBuffers;
+};
+
+}; // namespace camera2
+}; // namespace android
+
+#endif
diff --git a/services/camera/libcameraservice/camera2/CameraMetadata.cpp b/services/camera/libcameraservice/camera2/CameraMetadata.cpp
new file mode 100644
index 0000000..95377b2
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/CameraMetadata.cpp
@@ -0,0 +1,292 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "CameraMetadata"
+#include <utils/Log.h>
+#include <utils/Errors.h>
+
+#include "CameraMetadata.h"
+
+namespace android {
+
+namespace camera2 {
+CameraMetadata::CameraMetadata() :
+        mBuffer(NULL) {
+}
+
+CameraMetadata::CameraMetadata(size_t entryCapacity, size_t dataCapacity)
+{
+    mBuffer = allocate_camera_metadata(entryCapacity, dataCapacity);
+}
+
+CameraMetadata::CameraMetadata(const CameraMetadata &other) {
+    mBuffer = clone_camera_metadata(other.mBuffer);
+}
+
+CameraMetadata &CameraMetadata::operator=(const CameraMetadata &other) {
+    return operator=(other.mBuffer);
+}
+
+CameraMetadata &CameraMetadata::operator=(const camera_metadata_t *buffer) {
+    if (CC_LIKELY(buffer != mBuffer)) {
+        camera_metadata_t *newBuffer = clone_camera_metadata(buffer);
+        clear();
+        mBuffer = newBuffer;
+    }
+    return *this;
+}
+
+CameraMetadata::~CameraMetadata() {
+    clear();
+}
+
+camera_metadata_t* CameraMetadata::release() {
+    camera_metadata_t *released = mBuffer;
+    mBuffer = NULL;
+    return released;
+}
+
+void CameraMetadata::clear() {
+    if (mBuffer) {
+        free_camera_metadata(mBuffer);
+        mBuffer = NULL;
+    }
+}
+
+void CameraMetadata::acquire(camera_metadata_t *buffer) {
+    clear();
+    mBuffer = buffer;
+}
+
+void CameraMetadata::acquire(CameraMetadata &other) {
+    acquire(other.release());
+}
+
+status_t CameraMetadata::append(const CameraMetadata &other) {
+    return append_camera_metadata(mBuffer, other.mBuffer);
+}
+
+size_t CameraMetadata::entryCount() const {
+    return (mBuffer == NULL) ? 0 :
+            get_camera_metadata_entry_count(mBuffer);
+}
+
+status_t CameraMetadata::sort() {
+    return sort_camera_metadata(mBuffer);
+}
+
+status_t CameraMetadata::checkType(uint32_t tag, uint8_t expectedType) {
+    int tagType = get_camera_metadata_tag_type(tag);
+    if ( CC_UNLIKELY(tagType == -1)) {
+        ALOGE("Update metadata entry: Unknown tag %d", tag);
+        return INVALID_OPERATION;
+    }
+    if ( CC_UNLIKELY(tagType != expectedType) ) {
+        ALOGE("Mismatched tag type when updating entry %s (%d) of type %s; "
+                "got type %s data instead ",
+                get_camera_metadata_tag_name(tag), tag,
+                camera_metadata_type_names[tagType],
+                camera_metadata_type_names[expectedType]);
+        return INVALID_OPERATION;
+    }
+    return OK;
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const int32_t *data, size_t data_count) {
+    status_t res;
+    if ( (res = checkType(tag, TYPE_INT32)) != OK) {
+        return res;
+    }
+    return update(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const uint8_t *data, size_t data_count) {
+    status_t res;
+    if ( (res = checkType(tag, TYPE_BYTE)) != OK) {
+        return res;
+    }
+    return update(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const float *data, size_t data_count) {
+    status_t res;
+    if ( (res = checkType(tag, TYPE_FLOAT)) != OK) {
+        return res;
+    }
+    return update(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const int64_t *data, size_t data_count) {
+    status_t res;
+    if ( (res = checkType(tag, TYPE_INT64)) != OK) {
+        return res;
+    }
+    return update(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const double *data, size_t data_count) {
+    status_t res;
+    if ( (res = checkType(tag, TYPE_DOUBLE)) != OK) {
+        return res;
+    }
+    return update(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const camera_metadata_rational_t *data, size_t data_count) {
+    status_t res;
+    if ( (res = checkType(tag, TYPE_RATIONAL)) != OK) {
+        return res;
+    }
+    return update(tag, (const void*)data, data_count);
+}
+
+status_t CameraMetadata::update(uint32_t tag,
+        const String8 &string) {
+    status_t res;
+    if ( (res = checkType(tag, TYPE_BYTE)) != OK) {
+        return res;
+    }
+    return update(tag, (const void*)string.string(), string.size());
+}
+
+status_t CameraMetadata::update(uint32_t tag, const void *data,
+        size_t data_count) {
+    status_t res;
+    int type = get_camera_metadata_tag_type(tag);
+    if (type == -1) {
+        ALOGE("%s: Tag %d not found", __FUNCTION__, tag);
+        return BAD_VALUE;
+    }
+    size_t data_size = calculate_camera_metadata_entry_data_size(type,
+            data_count);
+
+    res = resizeIfNeeded(1, data_size);
+
+    if (res == OK) {
+        camera_metadata_entry_t entry;
+        res = find_camera_metadata_entry(mBuffer, tag, &entry);
+        if (res == NAME_NOT_FOUND) {
+            res = add_camera_metadata_entry(mBuffer,
+                    tag, data, data_count);
+        } else if (res == OK) {
+            res = update_camera_metadata_entry(mBuffer,
+                    entry.index, data, data_count, NULL);
+        }
+    }
+
+    if (res != OK) {
+        ALOGE("%s: Unable to update metadata entry %s.%s (%x): %s (%d)",
+                __FUNCTION__, get_camera_metadata_section_name(tag),
+                get_camera_metadata_tag_name(tag), tag, strerror(-res), res);
+    }
+    return res;
+}
+
+camera_metadata_entry_t CameraMetadata::find(uint32_t tag) {
+    status_t res;
+    camera_metadata_entry entry;
+    res = find_camera_metadata_entry(mBuffer, tag, &entry);
+    if (CC_UNLIKELY( res != OK )) {
+        entry.count = 0;
+        entry.data.u8 = NULL;
+    }
+    return entry;
+}
+
+camera_metadata_ro_entry_t CameraMetadata::find(uint32_t tag) const {
+    status_t res;
+    camera_metadata_ro_entry entry;
+    res = find_camera_metadata_ro_entry(mBuffer, tag, &entry);
+    if (CC_UNLIKELY( res != OK )) {
+        entry.count = 0;
+        entry.data.u8 = NULL;
+    }
+    return entry;
+}
+
+status_t CameraMetadata::erase(uint32_t tag) {
+    camera_metadata_entry_t entry;
+    status_t res;
+    res = find_camera_metadata_entry(mBuffer, tag, &entry);
+    if (res == NAME_NOT_FOUND) {
+        return OK;
+    } else if (res != OK) {
+        ALOGE("%s: Error looking for entry %s.%s (%x): %s %d",
+                __FUNCTION__,
+                get_camera_metadata_section_name(tag),
+                get_camera_metadata_tag_name(tag), tag, strerror(-res), res);
+        return res;
+    }
+    res = delete_camera_metadata_entry(mBuffer, entry.index);
+    if (res != OK) {
+        ALOGE("%s: Error deleting entry %s.%s (%x): %s %d",
+                __FUNCTION__,
+                get_camera_metadata_section_name(tag),
+                get_camera_metadata_tag_name(tag), tag, strerror(-res), res);
+    }
+    return res;
+}
+
+void CameraMetadata::dump(int fd, int verbosity, int indentation) const {
+    dump_indented_camera_metadata(mBuffer, fd, verbosity, indentation);
+}
+
+status_t CameraMetadata::resizeIfNeeded(size_t extraEntries, size_t extraData) {
+    if (mBuffer == NULL) {
+        mBuffer = allocate_camera_metadata(extraEntries * 2, extraData * 2);
+        if (mBuffer == NULL) {
+            ALOGE("%s: Can't allocate larger metadata buffer", __FUNCTION__);
+            return NO_MEMORY;
+        }
+    } else {
+        size_t currentEntryCount = get_camera_metadata_entry_count(mBuffer);
+        size_t currentEntryCap = get_camera_metadata_entry_capacity(mBuffer);
+        size_t newEntryCount = currentEntryCount +
+                extraEntries;
+        newEntryCount = (newEntryCount > currentEntryCap) ?
+                newEntryCount * 2 : currentEntryCap;
+
+        size_t currentDataCount = get_camera_metadata_data_count(mBuffer);
+        size_t currentDataCap = get_camera_metadata_data_capacity(mBuffer);
+        size_t newDataCount = currentDataCount +
+                extraData;
+        newDataCount = (newDataCount > currentDataCap) ?
+                newDataCount * 2 : currentDataCap;
+
+        if (newEntryCount > currentEntryCap ||
+                newDataCount > currentDataCap) {
+            camera_metadata_t *oldBuffer = mBuffer;
+            mBuffer = allocate_camera_metadata(newEntryCount,
+                    newDataCount);
+            if (mBuffer == NULL) {
+                ALOGE("%s: Can't allocate larger metadata buffer", __FUNCTION__);
+                return NO_MEMORY;
+            }
+            append_camera_metadata(mBuffer, oldBuffer);
+            free_camera_metadata(oldBuffer);
+        }
+    }
+    return OK;
+}
+
+}; // namespace camera2
+}; // namespace android
diff --git a/services/camera/libcameraservice/camera2/CameraMetadata.h b/services/camera/libcameraservice/camera2/CameraMetadata.h
new file mode 100644
index 0000000..340414e
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/CameraMetadata.h
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SERVERS_CAMERA_CAMERA2METADATA_CPP
+#define ANDROID_SERVERS_CAMERA_CAMERA2METADATA_CPP
+
+#include "system/camera_metadata.h"
+#include <utils/String8.h>
+#include <utils/Vector.h>
+
+namespace android {
+namespace camera2 {
+
+/**
+ * A convenience wrapper around the C-based camera_metadata_t library.
+ */
+class CameraMetadata {
+  public:
+    /** Creates an empty object; best used when expecting to acquire contents
+     * from elsewhere */
+    CameraMetadata();
+    /** Creates an object with space for entryCapacity entries, with
+     * dataCapacity extra storage */
+    CameraMetadata(size_t entryCapacity, size_t dataCapacity = 10);
+
+    ~CameraMetadata();
+
+    /** Takes ownership of passed-in buffer */
+    CameraMetadata(camera_metadata_t *buffer);
+    /** Clones the metadata */
+    CameraMetadata(const CameraMetadata &other);
+
+    /**
+     * Assignment clones metadata buffer.
+     */
+    CameraMetadata &operator=(const CameraMetadata &other);
+    CameraMetadata &operator=(const camera_metadata_t *buffer);
+
+    /**
+     * Release a raw metadata buffer to the caller. After this call,
+     * CameraMetadata no longer references the buffer, and the caller takes
+     * responsibility for freeing the raw metadata buffer (using
+     * free_camera_metadata()), or for handing it to another CameraMetadata
+     * instance.
+     */
+    camera_metadata_t* release();
+
+    /**
+     * Clear the metadata buffer and free all storage used by it
+     */
+    void clear();
+
+    /**
+     * Acquire a raw metadata buffer from the caller. After this call,
+     * the caller no longer owns the raw buffer, and must not free or manipulate it.
+     * If CameraMetadata already contains metadata, it is freed.
+     */
+    void acquire(camera_metadata_t* buffer);
+
+    /**
+     * Acquires raw buffer from other CameraMetadata object. After the call, the argument
+     * object no longer has any metadata.
+     */
+    void acquire(CameraMetadata &other);
+
+    /**
+     * Append metadata from another CameraMetadata object.
+     */
+    status_t append(const CameraMetadata &other);
+
+    /**
+     * Number of metadata entries.
+     */
+    size_t entryCount() const;
+
+    /**
+     * Sort metadata buffer for faster find
+     */
+    status_t sort();
+
+    /**
+     * Update metadata entry. Will create entry if it doesn't exist already, and
+     * will reallocate the buffer if insufficient space exists. Overloaded for
+     * the various types of valid data.
+     */
+    status_t update(uint32_t tag,
+            const uint8_t *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const int32_t *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const float *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const int64_t *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const double *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const camera_metadata_rational_t *data, size_t data_count);
+    status_t update(uint32_t tag,
+            const String8 &string);
+
+    template<typename T>
+    status_t update(uint32_t tag, Vector<T> data) {
+        return update(tag, data.array(), data.size());
+    }
+
+    /**
+     * Get metadata entry by tag id
+     */
+    camera_metadata_entry find(uint32_t tag);
+
+    /**
+     * Get metadata entry by tag id, with no editing
+     */
+    camera_metadata_ro_entry find(uint32_t tag) const;
+
+    /**
+     * Delete metadata entry by tag
+     */
+    status_t erase(uint32_t tag);
+
+    /**
+     * Dump contents into FD for debugging. The verbosity levels are
+     * 0: Tag entry information only, no data values
+     * 1: Level 0 plus at most 16 data values per entry
+     * 2: All information
+     *
+     * The indentation parameter sets the number of spaces to add to the start
+     * each line of output.
+     */
+    void dump(int fd, int verbosity = 1, int indentation = 0) const;
+
+  private:
+    camera_metadata_t *mBuffer;
+
+    /**
+     * Check if tag has a given type
+     */
+    status_t checkType(uint32_t tag, uint8_t expectedType);
+
+    /**
+     * Base update entry method
+     */
+    status_t update(uint32_t tag, const void *data, size_t data_count);
+
+    /**
+     * Resize metadata buffer if needed by reallocating it and copying it over.
+     */
+    status_t resizeIfNeeded(size_t extraEntries, size_t extraData);
+
+};
+
+}; // namespace camera2
+}; // namespace android
+
+#endif
diff --git a/services/camera/libcameraservice/camera2/CaptureProcessor.cpp b/services/camera/libcameraservice/camera2/CaptureProcessor.cpp
new file mode 100644
index 0000000..b17f9d2
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/CaptureProcessor.cpp
@@ -0,0 +1,248 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Camera2Client::CaptureProcessor"
+#define ATRACE_TAG ATRACE_TAG_CAMERA
+//#define LOG_NDEBUG 0
+
+#include <utils/Log.h>
+#include <utils/Trace.h>
+
+#include "CaptureProcessor.h"
+#include <gui/SurfaceTextureClient.h>
+#include "../Camera2Device.h"
+#include "../Camera2Client.h"
+
+
+namespace android {
+namespace camera2 {
+
+CaptureProcessor::CaptureProcessor(wp<Camera2Client> client):
+        Thread(false),
+        mClient(client),
+        mCaptureAvailable(false),
+        mCaptureStreamId(NO_STREAM) {
+}
+
+CaptureProcessor::~CaptureProcessor() {
+    ALOGV("%s: Exit", __FUNCTION__);
+}
+
+void CaptureProcessor::onFrameAvailable() {
+    Mutex::Autolock l(mInputMutex);
+    if (!mCaptureAvailable) {
+        mCaptureAvailable = true;
+        mCaptureAvailableSignal.signal();
+    }
+}
+
+status_t CaptureProcessor::updateStream(const Parameters &params) {
+    ATRACE_CALL();
+    ALOGV("%s", __FUNCTION__);
+    status_t res;
+
+    Mutex::Autolock l(mInputMutex);
+
+    sp<Camera2Client> client = mClient.promote();
+    if (client == 0) return OK;
+    sp<Camera2Device> device = client->getCameraDevice();
+
+    // Find out buffer size for JPEG
+    camera_metadata_ro_entry_t maxJpegSize =
+            params.staticInfo(ANDROID_JPEG_MAX_SIZE);
+    if (maxJpegSize.count == 0) {
+        ALOGE("%s: Camera %d: Can't find ANDROID_JPEG_MAX_SIZE!",
+                __FUNCTION__, client->getCameraId());
+        return INVALID_OPERATION;
+    }
+
+    if (mCaptureConsumer == 0) {
+        // Create CPU buffer queue endpoint
+        mCaptureConsumer = new CpuConsumer(1);
+        mCaptureConsumer->setFrameAvailableListener(this);
+        mCaptureConsumer->setName(String8("Camera2Client::CaptureConsumer"));
+        mCaptureWindow = new SurfaceTextureClient(
+            mCaptureConsumer->getProducerInterface());
+        // Create memory for API consumption
+        mCaptureHeap = new Camera2Heap(maxJpegSize.data.i32[0], 1,
+                                       "Camera2Client::CaptureHeap");
+        if (mCaptureHeap->mHeap->getSize() == 0) {
+            ALOGE("%s: Camera %d: Unable to allocate memory for capture",
+                    __FUNCTION__, client->getCameraId());
+            return NO_MEMORY;
+        }
+    }
+
+    if (mCaptureStreamId != NO_STREAM) {
+        // Check if stream parameters have to change
+        uint32_t currentWidth, currentHeight;
+        res = device->getStreamInfo(mCaptureStreamId,
+                &currentWidth, &currentHeight, 0);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Error querying capture output stream info: "
+                    "%s (%d)", __FUNCTION__,
+                    client->getCameraId(), strerror(-res), res);
+            return res;
+        }
+        if (currentWidth != (uint32_t)params.pictureWidth ||
+                currentHeight != (uint32_t)params.pictureHeight) {
+            res = device->deleteStream(mCaptureStreamId);
+            if (res != OK) {
+                ALOGE("%s: Camera %d: Unable to delete old output stream "
+                        "for capture: %s (%d)", __FUNCTION__,
+                        client->getCameraId(), strerror(-res), res);
+                return res;
+            }
+            mCaptureStreamId = NO_STREAM;
+        }
+    }
+
+    if (mCaptureStreamId == NO_STREAM) {
+        // Create stream for HAL production
+        res = device->createStream(mCaptureWindow,
+                params.pictureWidth, params.pictureHeight,
+                HAL_PIXEL_FORMAT_BLOB, maxJpegSize.data.i32[0],
+                &mCaptureStreamId);
+        if (res != OK) {
+            ALOGE("%s: Camera %d: Can't create output stream for capture: "
+                    "%s (%d)", __FUNCTION__, client->getCameraId(),
+                    strerror(-res), res);
+            return res;
+        }
+
+    }
+    return OK;
+}
+
+status_t CaptureProcessor::deleteStream() {
+    ATRACE_CALL();
+    status_t res;
+
+    Mutex::Autolock l(mInputMutex);
+
+    if (mCaptureStreamId != NO_STREAM) {
+        sp<Camera2Client> client = mClient.promote();
+        if (client == 0) return OK;
+        sp<Camera2Device> device = client->getCameraDevice();
+
+        device->deleteStream(mCaptureStreamId);
+        mCaptureStreamId = NO_STREAM;
+    }
+    return OK;
+}
+
+int CaptureProcessor::getStreamId() const {
+    Mutex::Autolock l(mInputMutex);
+    return mCaptureStreamId;
+}
+
+void CaptureProcessor::dump(int fd, const Vector<String16>& args) {
+}
+
+bool CaptureProcessor::threadLoop() {
+    status_t res;
+
+    {
+        Mutex::Autolock l(mInputMutex);
+        while (!mCaptureAvailable) {
+            res = mCaptureAvailableSignal.waitRelative(mInputMutex,
+                    kWaitDuration);
+            if (res == TIMED_OUT) return true;
+        }
+        mCaptureAvailable = false;
+    }
+
+    do {
+        sp<Camera2Client> client = mClient.promote();
+        if (client == 0) return false;
+        res = processNewCapture(client);
+    } while (res == OK);
+
+    return true;
+}
+
+status_t CaptureProcessor::processNewCapture(sp<Camera2Client> &client) {
+    ATRACE_CALL();
+    status_t res;
+    sp<Camera2Heap> captureHeap;
+
+    CpuConsumer::LockedBuffer imgBuffer;
+
+    res = mCaptureConsumer->lockNextBuffer(&imgBuffer);
+    if (res != OK) {
+        if (res != BAD_VALUE) {
+            ALOGE("%s: Camera %d: Error receiving still image buffer: "
+                    "%s (%d)", __FUNCTION__,
+                    client->getCameraId(), strerror(-res), res);
+        }
+        return res;
+    }
+
+    ALOGV("%s: Camera %d: Still capture available", __FUNCTION__,
+            client->getCameraId());
+
+    // TODO: Signal errors here upstream
+    {
+        SharedParameters::Lock l(client->getParameters());
+
+        switch (l.mParameters.state) {
+            case Parameters::STILL_CAPTURE:
+                l.mParameters.state = Parameters::STOPPED;
+                break;
+            case Parameters::VIDEO_SNAPSHOT:
+                l.mParameters.state = Parameters::RECORD;
+                break;
+            default:
+                ALOGE("%s: Camera %d: Still image produced unexpectedly "
+                        "in state %s!",
+                        __FUNCTION__, client->getCameraId(),
+                        Parameters::getStateName(l.mParameters.state));
+                mCaptureConsumer->unlockBuffer(imgBuffer);
+                return BAD_VALUE;
+        }
+    }
+
+    if (imgBuffer.format != HAL_PIXEL_FORMAT_BLOB) {
+        ALOGE("%s: Camera %d: Unexpected format for still image: "
+                "%x, expected %x", __FUNCTION__, client->getCameraId(),
+                imgBuffer.format,
+                HAL_PIXEL_FORMAT_BLOB);
+        mCaptureConsumer->unlockBuffer(imgBuffer);
+        return OK;
+    }
+
+    // TODO: Optimize this to avoid memcopy
+    void* captureMemory = mCaptureHeap->mHeap->getBase();
+    size_t size = mCaptureHeap->mHeap->getSize();
+    memcpy(captureMemory, imgBuffer.data, size);
+
+    mCaptureConsumer->unlockBuffer(imgBuffer);
+
+    captureHeap = mCaptureHeap;
+
+    Camera2Client::SharedCameraClient::Lock l(client->mSharedCameraClient);
+    ALOGV("%s: Sending still image to client", __FUNCTION__);
+    if (l.mCameraClient != 0) {
+        l.mCameraClient->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE,
+                captureHeap->mBuffers[0], NULL);
+    } else {
+        ALOGV("%s: No client!", __FUNCTION__);
+    }
+    return OK;
+}
+
+}; // namespace camera2
+}; // namespace android
diff --git a/services/camera/libcameraservice/camera2/CaptureProcessor.h b/services/camera/libcameraservice/camera2/CaptureProcessor.h
new file mode 100644
index 0000000..8e35739
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/CaptureProcessor.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SERVERS_CAMERA_CAMERA2_CAPTUREPROCESSOR_H
+#define ANDROID_SERVERS_CAMERA_CAMERA2_CAPTUREPROCESSOR_H
+
+#include <utils/Thread.h>
+#include <utils/String16.h>
+#include <utils/Vector.h>
+#include <utils/Mutex.h>
+#include <utils/Condition.h>
+#include <gui/CpuConsumer.h>
+#include "Parameters.h"
+#include "CameraMetadata.h"
+#include "Camera2Heap.h"
+
+namespace android {
+
+class Camera2Client;
+
+namespace camera2 {
+
+/***
+ * Still image capture output image processing
+ */
+class CaptureProcessor:
+            public Thread, public CpuConsumer::FrameAvailableListener {
+  public:
+    CaptureProcessor(wp<Camera2Client> client);
+    ~CaptureProcessor();
+
+    void onFrameAvailable();
+
+    status_t updateStream(const Parameters &params);
+    status_t deleteStream();
+    int getStreamId() const;
+
+    void dump(int fd, const Vector<String16>& args);
+  private:
+    static const nsecs_t kWaitDuration = 10000000; // 10 ms
+    wp<Camera2Client> mClient;
+
+    mutable Mutex mInputMutex;
+    bool mCaptureAvailable;
+    Condition mCaptureAvailableSignal;
+
+    enum {
+        NO_STREAM = -1
+    };
+
+    int mCaptureStreamId;
+    sp<CpuConsumer>    mCaptureConsumer;
+    sp<ANativeWindow>  mCaptureWindow;
+    sp<Camera2Heap>    mCaptureHeap;
+
+    virtual bool threadLoop();
+
+    status_t processNewCapture(sp<Camera2Client> &client);
+
+};
+
+
+}; //namespace camera2
+}; //namespace android
+
+#endif
diff --git a/services/camera/libcameraservice/camera2/FrameProcessor.cpp b/services/camera/libcameraservice/camera2/FrameProcessor.cpp
new file mode 100644
index 0000000..5059754
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/FrameProcessor.cpp
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Camera2Client::FrameProcessor"
+#define ATRACE_TAG ATRACE_TAG_CAMERA
+//#define LOG_NDEBUG 0
+
+#include <utils/Log.h>
+#include <utils/Trace.h>
+
+#include "FrameProcessor.h"
+#include "../Camera2Device.h"
+#include "../Camera2Client.h"
+
+namespace android {
+namespace camera2 {
+
+FrameProcessor::FrameProcessor(wp<Camera2Client> client):
+        Thread(false), mClient(client) {
+}
+
+FrameProcessor::~FrameProcessor() {
+    ALOGV("%s: Exit", __FUNCTION__);
+}
+
+void FrameProcessor::dump(int fd, const Vector<String16>& args) {
+    String8 result("    Latest received frame:\n");
+    write(fd, result.string(), result.size());
+    mLastFrame.dump(fd, 2, 6);
+}
+
+bool FrameProcessor::threadLoop() {
+    status_t res;
+
+    sp<Camera2Device> device;
+    {
+        sp<Camera2Client> client = mClient.promote();
+        if (client == 0) return false;
+        device = client->getCameraDevice();
+    }
+
+    res = device->waitForNextFrame(kWaitDuration);
+    if (res == OK) {
+        sp<Camera2Client> client = mClient.promote();
+        if (client == 0) return false;
+        processNewFrames(client);
+    } else if (res != TIMED_OUT) {
+        ALOGE("Camera2Client::FrameProcessor: Error waiting for new "
+                "frames: %s (%d)", strerror(-res), res);
+    }
+
+    return true;
+}
+
+void FrameProcessor::processNewFrames(sp<Camera2Client> &client) {
+    status_t res;
+    CameraMetadata frame;
+    while ( (res = client->getCameraDevice()->getNextFrame(&frame)) == OK) {
+        camera_metadata_entry_t entry;
+        entry = frame.find(ANDROID_REQUEST_FRAME_COUNT);
+        if (entry.count == 0) {
+            ALOGE("%s: Camera %d: Error reading frame number: %s (%d)",
+                    __FUNCTION__, client->getCameraId(), strerror(-res), res);
+            break;
+        }
+
+        res = processFaceDetect(frame, client);
+        if (res != OK) break;
+
+        mLastFrame.acquire(frame);
+    }
+    if (res != NOT_ENOUGH_DATA) {
+        ALOGE("%s: Camera %d: Error getting next frame: %s (%d)",
+                __FUNCTION__, client->getCameraId(), strerror(-res), res);
+        return;
+    }
+
+    return;
+}
+
+status_t FrameProcessor::processFaceDetect(
+    const CameraMetadata &frame, sp<Camera2Client> &client) {
+    status_t res;
+    camera_metadata_ro_entry_t entry;
+    bool enableFaceDetect;
+    int maxFaces;
+    {
+        SharedParameters::Lock l(client->getParameters());
+        enableFaceDetect = l.mParameters.enableFaceDetect;
+    }
+    entry = frame.find(ANDROID_STATS_FACE_DETECT_MODE);
+
+    // TODO: This should be an error once implementations are compliant
+    if (entry.count == 0) {
+        return OK;
+    }
+
+    uint8_t faceDetectMode = entry.data.u8[0];
+
+    camera_frame_metadata metadata;
+    Vector<camera_face_t> faces;
+    metadata.number_of_faces = 0;
+
+    if (enableFaceDetect && faceDetectMode != ANDROID_STATS_FACE_DETECTION_OFF) {
+        SharedParameters::Lock l(client->getParameters());
+        entry = frame.find(ANDROID_STATS_FACE_RECTANGLES);
+        if (entry.count == 0) {
+            ALOGE("%s: Camera %d: Unable to read face rectangles",
+                    __FUNCTION__, client->getCameraId());
+            return res;
+        }
+        metadata.number_of_faces = entry.count / 4;
+        if (metadata.number_of_faces >
+                l.mParameters.fastInfo.maxFaces) {
+            ALOGE("%s: Camera %d: More faces than expected! (Got %d, max %d)",
+                    __FUNCTION__, client->getCameraId(),
+                    metadata.number_of_faces, l.mParameters.fastInfo.maxFaces);
+            return res;
+        }
+        const int32_t *faceRects = entry.data.i32;
+
+        entry = frame.find(ANDROID_STATS_FACE_SCORES);
+        if (entry.count == 0) {
+            ALOGE("%s: Camera %d: Unable to read face scores",
+                    __FUNCTION__, client->getCameraId());
+            return res;
+        }
+        const uint8_t *faceScores = entry.data.u8;
+
+        const int32_t *faceLandmarks = NULL;
+        const int32_t *faceIds = NULL;
+
+        if (faceDetectMode == ANDROID_STATS_FACE_DETECTION_FULL) {
+            entry = frame.find(ANDROID_STATS_FACE_LANDMARKS);
+            if (entry.count == 0) {
+                ALOGE("%s: Camera %d: Unable to read face landmarks",
+                        __FUNCTION__, client->getCameraId());
+                return res;
+            }
+            faceLandmarks = entry.data.i32;
+
+            entry = frame.find(ANDROID_STATS_FACE_IDS);
+
+            if (entry.count == 0) {
+                ALOGE("%s: Camera %d: Unable to read face IDs",
+                        __FUNCTION__, client->getCameraId());
+                return res;
+            }
+            faceIds = entry.data.i32;
+        }
+
+        faces.setCapacity(metadata.number_of_faces);
+
+        for (int i = 0; i < metadata.number_of_faces; i++) {
+            camera_face_t face;
+
+            face.rect[0] = l.mParameters.arrayXToNormalized(faceRects[i*4 + 0]);
+            face.rect[1] = l.mParameters.arrayYToNormalized(faceRects[i*4 + 1]);
+            face.rect[2] = l.mParameters.arrayXToNormalized(faceRects[i*4 + 2]);
+            face.rect[3] = l.mParameters.arrayYToNormalized(faceRects[i*4 + 3]);
+
+            face.score = faceScores[i];
+            if (faceDetectMode == ANDROID_STATS_FACE_DETECTION_FULL) {
+                face.id = faceIds[i];
+                face.left_eye[0] =
+                        l.mParameters.arrayXToNormalized(faceLandmarks[i*6 + 0]);
+                face.left_eye[1] =
+                        l.mParameters.arrayYToNormalized(faceLandmarks[i*6 + 1]);
+                face.right_eye[0] =
+                        l.mParameters.arrayXToNormalized(faceLandmarks[i*6 + 2]);
+                face.right_eye[1] =
+                        l.mParameters.arrayYToNormalized(faceLandmarks[i*6 + 3]);
+                face.mouth[0] =
+                        l.mParameters.arrayXToNormalized(faceLandmarks[i*6 + 4]);
+                face.mouth[1] =
+                        l.mParameters.arrayYToNormalized(faceLandmarks[i*6 + 5]);
+            } else {
+                face.id = 0;
+                face.left_eye[0] = face.left_eye[1] = -2000;
+                face.right_eye[0] = face.right_eye[1] = -2000;
+                face.mouth[0] = face.mouth[1] = -2000;
+            }
+            faces.push_back(face);
+        }
+
+        metadata.faces = faces.editArray();
+    }
+
+    if (metadata.number_of_faces != 0) {
+        Camera2Client::SharedCameraClient::Lock l(client->mSharedCameraClient);
+        if (l.mCameraClient != NULL) {
+            l.mCameraClient->dataCallback(CAMERA_MSG_PREVIEW_METADATA,
+                    NULL, &metadata);
+        }
+    }
+    return OK;
+}
+
+
+}; // namespace camera2
+}; // namespace android
diff --git a/services/camera/libcameraservice/camera2/FrameProcessor.h b/services/camera/libcameraservice/camera2/FrameProcessor.h
new file mode 100644
index 0000000..2cdf7f0
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/FrameProcessor.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SERVERS_CAMERA_CAMERA2_FRAMEPROCESSOR_H
+#define ANDROID_SERVERS_CAMERA_CAMERA2_FRAMEPROCESSOR_H
+
+#include <utils/Thread.h>
+#include <utils/String16.h>
+#include <utils/Vector.h>
+#include "CameraMetadata.h"
+
+namespace android {
+
+class Camera2Client;
+
+namespace camera2 {
+
+/* Output frame metadata processing thread.  This thread waits for new
+ * frames from the device, and analyzes them as necessary.
+ */
+class FrameProcessor: public Thread {
+  public:
+    FrameProcessor(wp<Camera2Client> client);
+    ~FrameProcessor();
+
+    void dump(int fd, const Vector<String16>& args);
+  private:
+    static const nsecs_t kWaitDuration = 10000000; // 10 ms
+    wp<Camera2Client> mClient;
+
+    virtual bool threadLoop();
+
+    void processNewFrames(sp<Camera2Client> &client);
+    status_t processFaceDetect(const CameraMetadata &frame,
+            sp<Camera2Client> &client);
+
+    CameraMetadata mLastFrame;
+};
+
+
+}; //namespace camera2
+}; //namespace android
+
+#endif
diff --git a/services/camera/libcameraservice/camera2/Parameters.cpp b/services/camera/libcameraservice/camera2/Parameters.cpp
new file mode 100644
index 0000000..2f7d023
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/Parameters.cpp
@@ -0,0 +1,1627 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Camera2::Parameters"
+#define ATRACE_TAG ATRACE_TAG_CAMERA
+//#define LOG_NDEBUG 0
+
+#include <math.h>
+#include <stdlib.h>
+
+#include "Parameters.h"
+#include "system/camera.h"
+#include "camera/CameraParameters.h"
+
+namespace android {
+namespace camera2 {
+
+Parameters::Parameters(int cameraId,
+        int cameraFacing) :
+        cameraId(cameraId),
+        cameraFacing(cameraFacing),
+        info(NULL) {
+}
+
+Parameters::~Parameters() {
+}
+
+status_t Parameters::initialize(const CameraMetadata *info) {
+    status_t res;
+
+    if (info->entryCount() == 0) {
+        ALOGE("%s: No static information provided!", __FUNCTION__);
+        return BAD_VALUE;
+    }
+    Parameters::info = info;
+
+    res = buildFastInfo();
+    if (res != OK) return res;
+
+    CameraParameters params;
+
+    camera_metadata_ro_entry_t availableProcessedSizes =
+        staticInfo(ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES, 2);
+    if (!availableProcessedSizes.count) return NO_INIT;
+
+    // TODO: Pick more intelligently
+    previewWidth = availableProcessedSizes.data.i32[0];
+    previewHeight = availableProcessedSizes.data.i32[1];
+    videoWidth = previewWidth;
+    videoHeight = previewHeight;
+
+    params.setPreviewSize(previewWidth, previewHeight);
+    params.setVideoSize(videoWidth, videoHeight);
+    params.set(CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO,
+            String8::format("%dx%d",
+                    previewWidth, previewHeight));
+    {
+        String8 supportedPreviewSizes;
+        for (size_t i=0; i < availableProcessedSizes.count; i += 2) {
+            if (i != 0) supportedPreviewSizes += ",";
+            supportedPreviewSizes += String8::format("%dx%d",
+                    availableProcessedSizes.data.i32[i],
+                    availableProcessedSizes.data.i32[i+1]);
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES,
+                supportedPreviewSizes);
+        params.set(CameraParameters::KEY_SUPPORTED_VIDEO_SIZES,
+                supportedPreviewSizes);
+    }
+
+    camera_metadata_ro_entry_t availableFpsRanges =
+        staticInfo(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, 2);
+    if (!availableFpsRanges.count) return NO_INIT;
+
+    previewFpsRange[0] = availableFpsRanges.data.i32[0];
+    previewFpsRange[1] = availableFpsRanges.data.i32[1];
+
+    params.set(CameraParameters::KEY_PREVIEW_FPS_RANGE,
+            String8::format("%d,%d",
+                    previewFpsRange[0],
+                    previewFpsRange[1]));
+
+    {
+        String8 supportedPreviewFpsRange;
+        for (size_t i=0; i < availableFpsRanges.count; i += 2) {
+            if (i != 0) supportedPreviewFpsRange += ",";
+            supportedPreviewFpsRange += String8::format("(%d,%d)",
+                    availableFpsRanges.data.i32[i],
+                    availableFpsRanges.data.i32[i+1]);
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_FPS_RANGE,
+                supportedPreviewFpsRange);
+    }
+
+    previewFormat = HAL_PIXEL_FORMAT_YCrCb_420_SP;
+    params.set(CameraParameters::KEY_PREVIEW_FORMAT,
+            formatEnumToString(previewFormat)); // NV21
+
+    previewTransform = degToTransform(0,
+            cameraFacing == CAMERA_FACING_FRONT);
+
+    camera_metadata_ro_entry_t availableFormats =
+        staticInfo(ANDROID_SCALER_AVAILABLE_FORMATS);
+
+    {
+        String8 supportedPreviewFormats;
+        bool addComma = false;
+        for (size_t i=0; i < availableFormats.count; i++) {
+            if (addComma) supportedPreviewFormats += ",";
+            addComma = true;
+            switch (availableFormats.data.i32[i]) {
+            case HAL_PIXEL_FORMAT_YCbCr_422_SP:
+                supportedPreviewFormats +=
+                    CameraParameters::PIXEL_FORMAT_YUV422SP;
+                break;
+            case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+                supportedPreviewFormats +=
+                    CameraParameters::PIXEL_FORMAT_YUV420SP;
+                break;
+            case HAL_PIXEL_FORMAT_YCbCr_422_I:
+                supportedPreviewFormats +=
+                    CameraParameters::PIXEL_FORMAT_YUV422I;
+                break;
+            case HAL_PIXEL_FORMAT_YV12:
+                supportedPreviewFormats +=
+                    CameraParameters::PIXEL_FORMAT_YUV420P;
+                break;
+            case HAL_PIXEL_FORMAT_RGB_565:
+                supportedPreviewFormats +=
+                    CameraParameters::PIXEL_FORMAT_RGB565;
+                break;
+            case HAL_PIXEL_FORMAT_RGBA_8888:
+                supportedPreviewFormats +=
+                    CameraParameters::PIXEL_FORMAT_RGBA8888;
+                break;
+            // Not advertizing JPEG, RAW_SENSOR, etc, for preview formats
+            case HAL_PIXEL_FORMAT_RAW_SENSOR:
+            case HAL_PIXEL_FORMAT_BLOB:
+                addComma = false;
+                break;
+
+            default:
+                ALOGW("%s: Camera %d: Unknown preview format: %x",
+                        __FUNCTION__, cameraId, availableFormats.data.i32[i]);
+                addComma = false;
+                break;
+            }
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_FORMATS,
+                supportedPreviewFormats);
+    }
+
+    // PREVIEW_FRAME_RATE / SUPPORTED_PREVIEW_FRAME_RATES are deprecated, but
+    // still have to do something sane for them
+
+    params.set(CameraParameters::KEY_PREVIEW_FRAME_RATE,
+            previewFpsRange[0]);
+
+    {
+        String8 supportedPreviewFrameRates;
+        for (size_t i=0; i < availableFpsRanges.count; i += 2) {
+            if (i != 0) supportedPreviewFrameRates += ",";
+            supportedPreviewFrameRates += String8::format("%d",
+                    availableFpsRanges.data.i32[i]);
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES,
+                supportedPreviewFrameRates);
+    }
+
+    camera_metadata_ro_entry_t availableJpegSizes =
+        staticInfo(ANDROID_SCALER_AVAILABLE_JPEG_SIZES, 2);
+    if (!availableJpegSizes.count) return NO_INIT;
+
+    // TODO: Pick maximum
+    pictureWidth = availableJpegSizes.data.i32[0];
+    pictureHeight = availableJpegSizes.data.i32[1];
+
+    params.setPictureSize(pictureWidth,
+            pictureHeight);
+
+    {
+        String8 supportedPictureSizes;
+        for (size_t i=0; i < availableJpegSizes.count; i += 2) {
+            if (i != 0) supportedPictureSizes += ",";
+            supportedPictureSizes += String8::format("%dx%d",
+                    availableJpegSizes.data.i32[i],
+                    availableJpegSizes.data.i32[i+1]);
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_PICTURE_SIZES,
+                supportedPictureSizes);
+    }
+
+    params.setPictureFormat(CameraParameters::PIXEL_FORMAT_JPEG);
+    params.set(CameraParameters::KEY_SUPPORTED_PICTURE_FORMATS,
+            CameraParameters::PIXEL_FORMAT_JPEG);
+
+    camera_metadata_ro_entry_t availableJpegThumbnailSizes =
+        staticInfo(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES, 4);
+    if (!availableJpegThumbnailSizes.count) return NO_INIT;
+
+    // TODO: Pick default thumbnail size sensibly
+    jpegThumbSize[0] = availableJpegThumbnailSizes.data.i32[0];
+    jpegThumbSize[1] = availableJpegThumbnailSizes.data.i32[1];
+
+    params.set(CameraParameters::KEY_JPEG_THUMBNAIL_WIDTH,
+            jpegThumbSize[0]);
+    params.set(CameraParameters::KEY_JPEG_THUMBNAIL_HEIGHT,
+            jpegThumbSize[1]);
+
+    {
+        String8 supportedJpegThumbSizes;
+        for (size_t i=0; i < availableJpegThumbnailSizes.count; i += 2) {
+            if (i != 0) supportedJpegThumbSizes += ",";
+            supportedJpegThumbSizes += String8::format("%dx%d",
+                    availableJpegThumbnailSizes.data.i32[i],
+                    availableJpegThumbnailSizes.data.i32[i+1]);
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_JPEG_THUMBNAIL_SIZES,
+                supportedJpegThumbSizes);
+    }
+
+    jpegThumbQuality = 90;
+    params.set(CameraParameters::KEY_JPEG_THUMBNAIL_QUALITY,
+            jpegThumbQuality);
+    jpegQuality = 90;
+    params.set(CameraParameters::KEY_JPEG_QUALITY,
+            jpegQuality);
+    jpegRotation = 0;
+    params.set(CameraParameters::KEY_ROTATION,
+            jpegRotation);
+
+    gpsEnabled = false;
+    gpsProcessingMethod = "unknown";
+    // GPS fields in CameraParameters are not set by implementation
+
+    wbMode = ANDROID_CONTROL_AWB_AUTO;
+    params.set(CameraParameters::KEY_WHITE_BALANCE,
+            CameraParameters::WHITE_BALANCE_AUTO);
+
+    camera_metadata_ro_entry_t availableWhiteBalanceModes =
+        staticInfo(ANDROID_CONTROL_AWB_AVAILABLE_MODES);
+    {
+        String8 supportedWhiteBalance;
+        bool addComma = false;
+        for (size_t i=0; i < availableWhiteBalanceModes.count; i++) {
+            if (addComma) supportedWhiteBalance += ",";
+            addComma = true;
+            switch (availableWhiteBalanceModes.data.u8[i]) {
+            case ANDROID_CONTROL_AWB_AUTO:
+                supportedWhiteBalance +=
+                    CameraParameters::WHITE_BALANCE_AUTO;
+                break;
+            case ANDROID_CONTROL_AWB_INCANDESCENT:
+                supportedWhiteBalance +=
+                    CameraParameters::WHITE_BALANCE_INCANDESCENT;
+                break;
+            case ANDROID_CONTROL_AWB_FLUORESCENT:
+                supportedWhiteBalance +=
+                    CameraParameters::WHITE_BALANCE_FLUORESCENT;
+                break;
+            case ANDROID_CONTROL_AWB_WARM_FLUORESCENT:
+                supportedWhiteBalance +=
+                    CameraParameters::WHITE_BALANCE_WARM_FLUORESCENT;
+                break;
+            case ANDROID_CONTROL_AWB_DAYLIGHT:
+                supportedWhiteBalance +=
+                    CameraParameters::WHITE_BALANCE_DAYLIGHT;
+                break;
+            case ANDROID_CONTROL_AWB_CLOUDY_DAYLIGHT:
+                supportedWhiteBalance +=
+                    CameraParameters::WHITE_BALANCE_CLOUDY_DAYLIGHT;
+                break;
+            case ANDROID_CONTROL_AWB_TWILIGHT:
+                supportedWhiteBalance +=
+                    CameraParameters::WHITE_BALANCE_TWILIGHT;
+                break;
+            case ANDROID_CONTROL_AWB_SHADE:
+                supportedWhiteBalance +=
+                    CameraParameters::WHITE_BALANCE_SHADE;
+                break;
+            // Skipping values not mappable to v1 API
+            case ANDROID_CONTROL_AWB_OFF:
+                addComma = false;
+                break;
+            default:
+                ALOGW("%s: Camera %d: Unknown white balance value: %d",
+                        __FUNCTION__, cameraId,
+                        availableWhiteBalanceModes.data.u8[i]);
+                addComma = false;
+                break;
+            }
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_WHITE_BALANCE,
+                supportedWhiteBalance);
+    }
+
+    effectMode = ANDROID_CONTROL_EFFECT_OFF;
+    params.set(CameraParameters::KEY_EFFECT,
+            CameraParameters::EFFECT_NONE);
+
+    camera_metadata_ro_entry_t availableEffects =
+        staticInfo(ANDROID_CONTROL_AVAILABLE_EFFECTS);
+    if (!availableEffects.count) return NO_INIT;
+    {
+        String8 supportedEffects;
+        bool addComma = false;
+        for (size_t i=0; i < availableEffects.count; i++) {
+            if (addComma) supportedEffects += ",";
+            addComma = true;
+            switch (availableEffects.data.u8[i]) {
+                case ANDROID_CONTROL_EFFECT_OFF:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_NONE;
+                    break;
+                case ANDROID_CONTROL_EFFECT_MONO:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_MONO;
+                    break;
+                case ANDROID_CONTROL_EFFECT_NEGATIVE:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_NEGATIVE;
+                    break;
+                case ANDROID_CONTROL_EFFECT_SOLARIZE:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_SOLARIZE;
+                    break;
+                case ANDROID_CONTROL_EFFECT_SEPIA:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_SEPIA;
+                    break;
+                case ANDROID_CONTROL_EFFECT_POSTERIZE:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_POSTERIZE;
+                    break;
+                case ANDROID_CONTROL_EFFECT_WHITEBOARD:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_WHITEBOARD;
+                    break;
+                case ANDROID_CONTROL_EFFECT_BLACKBOARD:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_BLACKBOARD;
+                    break;
+                case ANDROID_CONTROL_EFFECT_AQUA:
+                    supportedEffects +=
+                        CameraParameters::EFFECT_AQUA;
+                    break;
+                default:
+                    ALOGW("%s: Camera %d: Unknown effect value: %d",
+                        __FUNCTION__, cameraId, availableEffects.data.u8[i]);
+                    addComma = false;
+                    break;
+            }
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_EFFECTS, supportedEffects);
+    }
+
+    antibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_AUTO;
+    params.set(CameraParameters::KEY_ANTIBANDING,
+            CameraParameters::ANTIBANDING_AUTO);
+
+    camera_metadata_ro_entry_t availableAntibandingModes =
+        staticInfo(ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES);
+    if (!availableAntibandingModes.count) return NO_INIT;
+    {
+        String8 supportedAntibanding;
+        bool addComma = false;
+        for (size_t i=0; i < availableAntibandingModes.count; i++) {
+            if (addComma) supportedAntibanding += ",";
+            addComma = true;
+            switch (availableAntibandingModes.data.u8[i]) {
+                case ANDROID_CONTROL_AE_ANTIBANDING_OFF:
+                    supportedAntibanding +=
+                        CameraParameters::ANTIBANDING_OFF;
+                    break;
+                case ANDROID_CONTROL_AE_ANTIBANDING_50HZ:
+                    supportedAntibanding +=
+                        CameraParameters::ANTIBANDING_50HZ;
+                    break;
+                case ANDROID_CONTROL_AE_ANTIBANDING_60HZ:
+                    supportedAntibanding +=
+                        CameraParameters::ANTIBANDING_60HZ;
+                    break;
+                case ANDROID_CONTROL_AE_ANTIBANDING_AUTO:
+                    supportedAntibanding +=
+                        CameraParameters::ANTIBANDING_AUTO;
+                    break;
+                default:
+                    ALOGW("%s: Camera %d: Unknown antibanding value: %d",
+                        __FUNCTION__, cameraId,
+                            availableAntibandingModes.data.u8[i]);
+                    addComma = false;
+                    break;
+            }
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_ANTIBANDING,
+                supportedAntibanding);
+    }
+
+    sceneMode = ANDROID_CONTROL_OFF;
+    params.set(CameraParameters::KEY_SCENE_MODE,
+            CameraParameters::SCENE_MODE_AUTO);
+
+    camera_metadata_ro_entry_t availableSceneModes =
+        staticInfo(ANDROID_CONTROL_AVAILABLE_SCENE_MODES);
+    if (!availableSceneModes.count) return NO_INIT;
+    {
+        String8 supportedSceneModes(CameraParameters::SCENE_MODE_AUTO);
+        bool addComma = true;
+        bool noSceneModes = false;
+        for (size_t i=0; i < availableSceneModes.count; i++) {
+            if (addComma) supportedSceneModes += ",";
+            addComma = true;
+            switch (availableSceneModes.data.u8[i]) {
+                case ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED:
+                    noSceneModes = true;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY:
+                    // Not in old API
+                    addComma = false;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_ACTION:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_ACTION;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_PORTRAIT:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_PORTRAIT;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_LANDSCAPE:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_LANDSCAPE;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_NIGHT:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_NIGHT;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_NIGHT_PORTRAIT:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_NIGHT_PORTRAIT;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_THEATRE:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_THEATRE;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_BEACH:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_BEACH;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_SNOW:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_SNOW;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_SUNSET:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_SUNSET;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_STEADYPHOTO:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_STEADYPHOTO;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_FIREWORKS:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_FIREWORKS;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_SPORTS:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_SPORTS;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_PARTY:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_PARTY;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_CANDLELIGHT:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_CANDLELIGHT;
+                    break;
+                case ANDROID_CONTROL_SCENE_MODE_BARCODE:
+                    supportedSceneModes +=
+                        CameraParameters::SCENE_MODE_BARCODE;
+                    break;
+                default:
+                    ALOGW("%s: Camera %d: Unknown scene mode value: %d",
+                        __FUNCTION__, cameraId,
+                            availableSceneModes.data.u8[i]);
+                    addComma = false;
+                    break;
+            }
+        }
+        if (!noSceneModes) {
+            params.set(CameraParameters::KEY_SUPPORTED_SCENE_MODES,
+                    supportedSceneModes);
+        }
+    }
+
+    camera_metadata_ro_entry_t flashAvailable =
+        staticInfo(ANDROID_FLASH_AVAILABLE, 1, 1);
+    if (!flashAvailable.count) return NO_INIT;
+
+    camera_metadata_ro_entry_t availableAeModes =
+        staticInfo(ANDROID_CONTROL_AE_AVAILABLE_MODES);
+    if (!availableAeModes.count) return NO_INIT;
+
+    if (flashAvailable.data.u8[0]) {
+        flashMode = Parameters::FLASH_MODE_AUTO;
+        params.set(CameraParameters::KEY_FLASH_MODE,
+                CameraParameters::FLASH_MODE_AUTO);
+
+        String8 supportedFlashModes(CameraParameters::FLASH_MODE_OFF);
+        supportedFlashModes = supportedFlashModes +
+            "," + CameraParameters::FLASH_MODE_AUTO +
+            "," + CameraParameters::FLASH_MODE_ON +
+            "," + CameraParameters::FLASH_MODE_TORCH;
+        for (size_t i=0; i < availableAeModes.count; i++) {
+            if (availableAeModes.data.u8[i] ==
+                    ANDROID_CONTROL_AE_ON_AUTO_FLASH_REDEYE) {
+                supportedFlashModes = supportedFlashModes + "," +
+                    CameraParameters::FLASH_MODE_RED_EYE;
+                break;
+            }
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_FLASH_MODES,
+                supportedFlashModes);
+    } else {
+        flashMode = Parameters::FLASH_MODE_OFF;
+        params.set(CameraParameters::KEY_FLASH_MODE,
+                CameraParameters::FLASH_MODE_OFF);
+        params.set(CameraParameters::KEY_SUPPORTED_FLASH_MODES,
+                CameraParameters::FLASH_MODE_OFF);
+    }
+
+    camera_metadata_ro_entry_t minFocusDistance =
+        staticInfo(ANDROID_LENS_MINIMUM_FOCUS_DISTANCE, 1, 1);
+    if (!minFocusDistance.count) return NO_INIT;
+
+    camera_metadata_ro_entry_t availableAfModes =
+        staticInfo(ANDROID_CONTROL_AF_AVAILABLE_MODES);
+    if (!availableAfModes.count) return NO_INIT;
+
+    if (minFocusDistance.data.f[0] == 0) {
+        // Fixed-focus lens
+        focusMode = Parameters::FOCUS_MODE_FIXED;
+        params.set(CameraParameters::KEY_FOCUS_MODE,
+                CameraParameters::FOCUS_MODE_FIXED);
+        params.set(CameraParameters::KEY_SUPPORTED_FOCUS_MODES,
+                CameraParameters::FOCUS_MODE_FIXED);
+    } else {
+        focusMode = Parameters::FOCUS_MODE_AUTO;
+        params.set(CameraParameters::KEY_FOCUS_MODE,
+                CameraParameters::FOCUS_MODE_AUTO);
+        String8 supportedFocusModes(CameraParameters::FOCUS_MODE_INFINITY);
+        bool addComma = true;
+
+        for (size_t i=0; i < availableAfModes.count; i++) {
+            if (addComma) supportedFocusModes += ",";
+            addComma = true;
+            switch (availableAfModes.data.u8[i]) {
+                case ANDROID_CONTROL_AF_AUTO:
+                    supportedFocusModes +=
+                        CameraParameters::FOCUS_MODE_AUTO;
+                    break;
+                case ANDROID_CONTROL_AF_MACRO:
+                    supportedFocusModes +=
+                        CameraParameters::FOCUS_MODE_MACRO;
+                    break;
+                case ANDROID_CONTROL_AF_CONTINUOUS_VIDEO:
+                    supportedFocusModes +=
+                        CameraParameters::FOCUS_MODE_CONTINUOUS_VIDEO;
+                    break;
+                case ANDROID_CONTROL_AF_CONTINUOUS_PICTURE:
+                    supportedFocusModes +=
+                        CameraParameters::FOCUS_MODE_CONTINUOUS_PICTURE;
+                    break;
+                case ANDROID_CONTROL_AF_EDOF:
+                    supportedFocusModes +=
+                        CameraParameters::FOCUS_MODE_EDOF;
+                    break;
+                // Not supported in old API
+                case ANDROID_CONTROL_AF_OFF:
+                    addComma = false;
+                    break;
+                default:
+                    ALOGW("%s: Camera %d: Unknown AF mode value: %d",
+                        __FUNCTION__, cameraId, availableAfModes.data.u8[i]);
+                    addComma = false;
+                    break;
+            }
+        }
+        params.set(CameraParameters::KEY_SUPPORTED_FOCUS_MODES,
+                supportedFocusModes);
+    }
+
+    camera_metadata_ro_entry_t max3aRegions =
+        staticInfo(ANDROID_CONTROL_MAX_REGIONS, 1, 1);
+    if (!max3aRegions.count) return NO_INIT;
+
+    params.set(CameraParameters::KEY_MAX_NUM_FOCUS_AREAS,
+            max3aRegions.data.i32[0]);
+    params.set(CameraParameters::KEY_FOCUS_AREAS,
+            "(0,0,0,0,0)");
+    focusingAreas.clear();
+    focusingAreas.add(Parameters::Area(0,0,0,0,0));
+
+    camera_metadata_ro_entry_t availableFocalLengths =
+        staticInfo(ANDROID_LENS_AVAILABLE_FOCAL_LENGTHS);
+    if (!availableFocalLengths.count) return NO_INIT;
+
+    float minFocalLength = availableFocalLengths.data.f[0];
+    params.setFloat(CameraParameters::KEY_FOCAL_LENGTH, minFocalLength);
+
+    camera_metadata_ro_entry_t sensorSize =
+        staticInfo(ANDROID_SENSOR_PHYSICAL_SIZE, 2, 2);
+    if (!sensorSize.count) return NO_INIT;
+
+    // The fields of view here assume infinity focus, maximum wide angle
+    float horizFov = 180 / M_PI *
+            2 * atanf(sensorSize.data.f[0] / (2 * minFocalLength));
+    float vertFov  = 180 / M_PI *
+            2 * atanf(sensorSize.data.f[1] / (2 * minFocalLength));
+    params.setFloat(CameraParameters::KEY_HORIZONTAL_VIEW_ANGLE, horizFov);
+    params.setFloat(CameraParameters::KEY_VERTICAL_VIEW_ANGLE, vertFov);
+
+    exposureCompensation = 0;
+    params.set(CameraParameters::KEY_EXPOSURE_COMPENSATION,
+                exposureCompensation);
+
+    camera_metadata_ro_entry_t exposureCompensationRange =
+        staticInfo(ANDROID_CONTROL_AE_EXP_COMPENSATION_RANGE, 2, 2);
+    if (!exposureCompensationRange.count) return NO_INIT;
+
+    params.set(CameraParameters::KEY_MAX_EXPOSURE_COMPENSATION,
+            exposureCompensationRange.data.i32[1]);
+    params.set(CameraParameters::KEY_MIN_EXPOSURE_COMPENSATION,
+            exposureCompensationRange.data.i32[0]);
+
+    camera_metadata_ro_entry_t exposureCompensationStep =
+        staticInfo(ANDROID_CONTROL_AE_EXP_COMPENSATION_STEP, 1, 1);
+    if (!exposureCompensationStep.count) return NO_INIT;
+
+    params.setFloat(CameraParameters::KEY_EXPOSURE_COMPENSATION_STEP,
+            (float)exposureCompensationStep.data.r[0].numerator /
+            exposureCompensationStep.data.r[0].denominator);
+
+    autoExposureLock = false;
+    params.set(CameraParameters::KEY_AUTO_EXPOSURE_LOCK,
+            CameraParameters::FALSE);
+    params.set(CameraParameters::KEY_AUTO_EXPOSURE_LOCK_SUPPORTED,
+            CameraParameters::TRUE);
+
+    autoWhiteBalanceLock = false;
+    params.set(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK,
+            CameraParameters::FALSE);
+    params.set(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK_SUPPORTED,
+            CameraParameters::TRUE);
+
+    meteringAreas.add(Parameters::Area(0, 0, 0, 0, 0));
+    params.set(CameraParameters::KEY_MAX_NUM_METERING_AREAS,
+            max3aRegions.data.i32[0]);
+    params.set(CameraParameters::KEY_METERING_AREAS,
+            "(0,0,0,0,0)");
+
+    zoom = 0;
+    params.set(CameraParameters::KEY_ZOOM, zoom);
+    params.set(CameraParameters::KEY_MAX_ZOOM, NUM_ZOOM_STEPS - 1);
+
+    camera_metadata_ro_entry_t maxDigitalZoom =
+        staticInfo(ANDROID_SCALER_AVAILABLE_MAX_ZOOM, 1, 1);
+    if (!maxDigitalZoom.count) return NO_INIT;
+
+    {
+        String8 zoomRatios;
+        float zoom = 1.f;
+        float zoomIncrement = (maxDigitalZoom.data.f[0] - zoom) /
+                (NUM_ZOOM_STEPS-1);
+        bool addComma = false;
+        for (size_t i=0; i < NUM_ZOOM_STEPS; i++) {
+            if (addComma) zoomRatios += ",";
+            addComma = true;
+            zoomRatios += String8::format("%d", static_cast<int>(zoom * 100));
+            zoom += zoomIncrement;
+        }
+        params.set(CameraParameters::KEY_ZOOM_RATIOS, zoomRatios);
+    }
+
+    params.set(CameraParameters::KEY_ZOOM_SUPPORTED,
+            CameraParameters::TRUE);
+    params.set(CameraParameters::KEY_SMOOTH_ZOOM_SUPPORTED,
+            CameraParameters::TRUE);
+
+    params.set(CameraParameters::KEY_FOCUS_DISTANCES,
+            "Infinity,Infinity,Infinity");
+
+    params.set(CameraParameters::KEY_MAX_NUM_DETECTED_FACES_HW,
+            fastInfo.maxFaces);
+    params.set(CameraParameters::KEY_MAX_NUM_DETECTED_FACES_SW,
+            0);
+
+    params.set(CameraParameters::KEY_VIDEO_FRAME_FORMAT,
+            CameraParameters::PIXEL_FORMAT_ANDROID_OPAQUE);
+
+    params.set(CameraParameters::KEY_RECORDING_HINT,
+            CameraParameters::FALSE);
+
+    params.set(CameraParameters::KEY_VIDEO_SNAPSHOT_SUPPORTED,
+            CameraParameters::TRUE);
+
+    params.set(CameraParameters::KEY_VIDEO_STABILIZATION,
+            CameraParameters::FALSE);
+
+    camera_metadata_ro_entry_t availableVideoStabilizationModes =
+        staticInfo(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES);
+    if (!availableVideoStabilizationModes.count) return NO_INIT;
+
+    if (availableVideoStabilizationModes.count > 1) {
+        params.set(CameraParameters::KEY_VIDEO_STABILIZATION_SUPPORTED,
+                CameraParameters::TRUE);
+    } else {
+        params.set(CameraParameters::KEY_VIDEO_STABILIZATION_SUPPORTED,
+                CameraParameters::FALSE);
+    }
+
+    // Set up initial state for non-Camera.Parameters state variables
+
+    storeMetadataInBuffers = true;
+    playShutterSound = true;
+    enableFaceDetect = false;
+
+    enableFocusMoveMessages = false;
+    afTriggerCounter = 0;
+    currentAfTriggerId = -1;
+
+    previewCallbackFlags = 0;
+
+    state = STOPPED;
+
+    paramsFlattened = params.flatten();
+
+    return OK;
+}
+
+status_t Parameters::buildFastInfo() {
+
+    camera_metadata_ro_entry_t activeArraySize =
+        staticInfo(ANDROID_SENSOR_ACTIVE_ARRAY_SIZE, 2, 2);
+    if (!activeArraySize.count) return NO_INIT;
+    int32_t arrayWidth = activeArraySize.data.i32[0];
+    int32_t arrayHeight = activeArraySize.data.i32[1];
+
+    camera_metadata_ro_entry_t availableFaceDetectModes =
+        staticInfo(ANDROID_STATS_AVAILABLE_FACE_DETECT_MODES);
+    if (!availableFaceDetectModes.count) return NO_INIT;
+
+    uint8_t bestFaceDetectMode =
+        ANDROID_STATS_FACE_DETECTION_OFF;
+    for (size_t i = 0 ; i < availableFaceDetectModes.count; i++) {
+        switch (availableFaceDetectModes.data.u8[i]) {
+            case ANDROID_STATS_FACE_DETECTION_OFF:
+                break;
+            case ANDROID_STATS_FACE_DETECTION_SIMPLE:
+                if (bestFaceDetectMode !=
+                        ANDROID_STATS_FACE_DETECTION_FULL) {
+                    bestFaceDetectMode =
+                        ANDROID_STATS_FACE_DETECTION_SIMPLE;
+                }
+                break;
+            case ANDROID_STATS_FACE_DETECTION_FULL:
+                bestFaceDetectMode =
+                    ANDROID_STATS_FACE_DETECTION_FULL;
+                break;
+            default:
+                ALOGE("%s: Camera %d: Unknown face detect mode %d:",
+                        __FUNCTION__, cameraId,
+                        availableFaceDetectModes.data.u8[i]);
+                return NO_INIT;
+        }
+    }
+
+    camera_metadata_ro_entry_t maxFacesDetected =
+        staticInfo(ANDROID_STATS_MAX_FACE_COUNT, 1, 1);
+    if (!maxFacesDetected.count) return NO_INIT;
+
+    int32_t maxFaces = maxFacesDetected.data.i32[0];
+
+    fastInfo.arrayWidth = arrayWidth;
+    fastInfo.arrayHeight = arrayHeight;
+    fastInfo.bestFaceDetectMode = bestFaceDetectMode;
+    fastInfo.maxFaces = maxFaces;
+    return OK;
+}
+
+camera_metadata_ro_entry_t Parameters::staticInfo(uint32_t tag,
+        size_t minCount, size_t maxCount) const {
+    status_t res;
+    camera_metadata_ro_entry_t entry = info->find(tag);
+
+    if (CC_UNLIKELY( entry.count == 0 )) {
+        const char* tagSection = get_camera_metadata_section_name(tag);
+        if (tagSection == NULL) tagSection = "<unknown>";
+        const char* tagName = get_camera_metadata_tag_name(tag);
+        if (tagName == NULL) tagName = "<unknown>";
+
+        ALOGE("Error finding static metadata entry '%s.%s' (%x)",
+                tagSection, tagName, tag);
+    } else if (CC_UNLIKELY(
+            (minCount != 0 && entry.count < minCount) ||
+            (maxCount != 0 && entry.count > maxCount) ) ) {
+        const char* tagSection = get_camera_metadata_section_name(tag);
+        if (tagSection == NULL) tagSection = "<unknown>";
+        const char* tagName = get_camera_metadata_tag_name(tag);
+        if (tagName == NULL) tagName = "<unknown>";
+        ALOGE("Malformed static metadata entry '%s.%s' (%x):"
+                "Expected between %d and %d values, but got %d values",
+                tagSection, tagName, tag, minCount, maxCount, entry.count);
+    }
+
+    return entry;
+}
+
+status_t Parameters::set(const String8& params) {
+    status_t res;
+
+    CameraParameters newParams(params);
+
+    // TODO: Currently ignoring any changes to supposedly read-only parameters
+    // such as supported preview sizes, etc. Should probably produce an error if
+    // they're changed.
+
+    /** Extract and verify new parameters */
+
+    size_t i;
+
+    Parameters validatedParams(*this);
+
+    // PREVIEW_SIZE
+    newParams.getPreviewSize(&validatedParams.previewWidth,
+            &validatedParams.previewHeight);
+
+    if (validatedParams.previewWidth != previewWidth ||
+            validatedParams.previewHeight != previewHeight) {
+        if (state >= PREVIEW) {
+            ALOGE("%s: Preview size cannot be updated when preview "
+                    "is active! (Currently %d x %d, requested %d x %d",
+                    __FUNCTION__,
+                    previewWidth, previewHeight,
+                    validatedParams.previewWidth, validatedParams.previewHeight);
+            return BAD_VALUE;
+        }
+        camera_metadata_ro_entry_t availablePreviewSizes =
+            staticInfo(ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES);
+        for (i = 0; i < availablePreviewSizes.count; i += 2 ) {
+            if ((availablePreviewSizes.data.i32[i] ==
+                    validatedParams.previewWidth) &&
+                (availablePreviewSizes.data.i32[i+1] ==
+                    validatedParams.previewHeight)) break;
+        }
+        if (i == availablePreviewSizes.count) {
+            ALOGE("%s: Requested preview size %d x %d is not supported",
+                    __FUNCTION__, validatedParams.previewWidth,
+                    validatedParams.previewHeight);
+            return BAD_VALUE;
+        }
+    }
+
+    // PREVIEW_FPS_RANGE
+    bool fpsRangeChanged = false;
+    newParams.getPreviewFpsRange(&validatedParams.previewFpsRange[0],
+            &validatedParams.previewFpsRange[1]);
+    if (validatedParams.previewFpsRange[0] != previewFpsRange[0] ||
+            validatedParams.previewFpsRange[1] != previewFpsRange[1]) {
+        fpsRangeChanged = true;
+        camera_metadata_ro_entry_t availablePreviewFpsRanges =
+            staticInfo(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, 2);
+        for (i = 0; i < availablePreviewFpsRanges.count; i += 2) {
+            if ((availablePreviewFpsRanges.data.i32[i] ==
+                    validatedParams.previewFpsRange[0]) &&
+                (availablePreviewFpsRanges.data.i32[i+1] ==
+                    validatedParams.previewFpsRange[1]) ) {
+                break;
+            }
+        }
+        if (i == availablePreviewFpsRanges.count) {
+            ALOGE("%s: Requested preview FPS range %d - %d is not supported",
+                __FUNCTION__, validatedParams.previewFpsRange[0],
+                    validatedParams.previewFpsRange[1]);
+            return BAD_VALUE;
+        }
+        validatedParams.previewFps = validatedParams.previewFpsRange[0];
+    }
+
+    // PREVIEW_FORMAT
+    validatedParams.previewFormat =
+            formatStringToEnum(newParams.getPreviewFormat());
+    if (validatedParams.previewFormat != previewFormat) {
+        if (state >= PREVIEW) {
+            ALOGE("%s: Preview format cannot be updated when preview "
+                    "is active!", __FUNCTION__);
+            return BAD_VALUE;
+        }
+        camera_metadata_ro_entry_t availableFormats =
+            staticInfo(ANDROID_SCALER_AVAILABLE_FORMATS);
+        for (i = 0; i < availableFormats.count; i++) {
+            if (availableFormats.data.i32[i] == validatedParams.previewFormat)
+                break;
+        }
+        if (i == availableFormats.count) {
+            ALOGE("%s: Requested preview format %s (0x%x) is not supported",
+                    __FUNCTION__, newParams.getPreviewFormat(),
+                    validatedParams.previewFormat);
+            return BAD_VALUE;
+        }
+    }
+
+    // PREVIEW_FRAME_RATE
+    // Deprecated, only use if the preview fps range is unchanged this time.
+    // The single-value FPS is the same as the minimum of the range.
+    if (!fpsRangeChanged) {
+        validatedParams.previewFps = newParams.getPreviewFrameRate();
+        if (validatedParams.previewFps != previewFps) {
+            camera_metadata_ro_entry_t availableFrameRates =
+                staticInfo(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
+            for (i = 0; i < availableFrameRates.count; i+=2) {
+                if (availableFrameRates.data.i32[i] ==
+                        validatedParams.previewFps) break;
+            }
+            if (i == availableFrameRates.count) {
+                ALOGE("%s: Requested preview frame rate %d is not supported",
+                        __FUNCTION__, validatedParams.previewFps);
+                return BAD_VALUE;
+            }
+            validatedParams.previewFpsRange[0] =
+                    availableFrameRates.data.i32[i];
+            validatedParams.previewFpsRange[1] =
+                    availableFrameRates.data.i32[i+1];
+        }
+    }
+
+    // PICTURE_SIZE
+    newParams.getPictureSize(&validatedParams.pictureWidth,
+            &validatedParams.pictureHeight);
+    if (validatedParams.pictureWidth == pictureWidth ||
+            validatedParams.pictureHeight == pictureHeight) {
+        camera_metadata_ro_entry_t availablePictureSizes =
+            staticInfo(ANDROID_SCALER_AVAILABLE_JPEG_SIZES);
+        for (i = 0; i < availablePictureSizes.count; i+=2) {
+            if ((availablePictureSizes.data.i32[i] ==
+                    validatedParams.pictureWidth) &&
+                (availablePictureSizes.data.i32[i+1] ==
+                    validatedParams.pictureHeight)) break;
+        }
+        if (i == availablePictureSizes.count) {
+            ALOGE("%s: Requested picture size %d x %d is not supported",
+                    __FUNCTION__, validatedParams.pictureWidth,
+                    validatedParams.pictureHeight);
+            return BAD_VALUE;
+        }
+    }
+
+    // JPEG_THUMBNAIL_WIDTH/HEIGHT
+    validatedParams.jpegThumbSize[0] =
+            newParams.getInt(CameraParameters::KEY_JPEG_THUMBNAIL_WIDTH);
+    validatedParams.jpegThumbSize[1] =
+            newParams.getInt(CameraParameters::KEY_JPEG_THUMBNAIL_HEIGHT);
+    if (validatedParams.jpegThumbSize[0] != jpegThumbSize[0] ||
+            validatedParams.jpegThumbSize[1] != jpegThumbSize[1]) {
+        camera_metadata_ro_entry_t availableJpegThumbSizes =
+            staticInfo(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES);
+        for (i = 0; i < availableJpegThumbSizes.count; i+=2) {
+            if ((availableJpegThumbSizes.data.i32[i] ==
+                    validatedParams.jpegThumbSize[0]) &&
+                (availableJpegThumbSizes.data.i32[i+1] ==
+                    validatedParams.jpegThumbSize[1])) break;
+        }
+        if (i == availableJpegThumbSizes.count) {
+            ALOGE("%s: Requested JPEG thumbnail size %d x %d is not supported",
+                    __FUNCTION__, validatedParams.jpegThumbSize[0],
+                    validatedParams.jpegThumbSize[1]);
+            return BAD_VALUE;
+        }
+    }
+
+    // JPEG_THUMBNAIL_QUALITY
+    validatedParams.jpegThumbQuality =
+            newParams.getInt(CameraParameters::KEY_JPEG_THUMBNAIL_QUALITY);
+    if (validatedParams.jpegThumbQuality < 0 ||
+            validatedParams.jpegThumbQuality > 100) {
+        ALOGE("%s: Requested JPEG thumbnail quality %d is not supported",
+                __FUNCTION__, validatedParams.jpegThumbQuality);
+        return BAD_VALUE;
+    }
+
+    // JPEG_QUALITY
+    validatedParams.jpegQuality =
+            newParams.getInt(CameraParameters::KEY_JPEG_QUALITY);
+    if (validatedParams.jpegQuality < 0 || validatedParams.jpegQuality > 100) {
+        ALOGE("%s: Requested JPEG quality %d is not supported",
+                __FUNCTION__, validatedParams.jpegQuality);
+        return BAD_VALUE;
+    }
+
+    // ROTATION
+    validatedParams.jpegRotation =
+            newParams.getInt(CameraParameters::KEY_ROTATION);
+    if (validatedParams.jpegRotation != 0 &&
+            validatedParams.jpegRotation != 90 &&
+            validatedParams.jpegRotation != 180 &&
+            validatedParams.jpegRotation != 270) {
+        ALOGE("%s: Requested picture rotation angle %d is not supported",
+                __FUNCTION__, validatedParams.jpegRotation);
+        return BAD_VALUE;
+    }
+
+    // GPS
+
+    const char *gpsLatStr =
+            newParams.get(CameraParameters::KEY_GPS_LATITUDE);
+    if (gpsLatStr != NULL) {
+        const char *gpsLongStr =
+                newParams.get(CameraParameters::KEY_GPS_LONGITUDE);
+        const char *gpsAltitudeStr =
+                newParams.get(CameraParameters::KEY_GPS_ALTITUDE);
+        const char *gpsTimeStr =
+                newParams.get(CameraParameters::KEY_GPS_TIMESTAMP);
+        const char *gpsProcMethodStr =
+                newParams.get(CameraParameters::KEY_GPS_PROCESSING_METHOD);
+        if (gpsLongStr == NULL ||
+                gpsAltitudeStr == NULL ||
+                gpsTimeStr == NULL ||
+                gpsProcMethodStr == NULL) {
+            ALOGE("%s: Incomplete set of GPS parameters provided",
+                    __FUNCTION__);
+            return BAD_VALUE;
+        }
+        char *endPtr;
+        errno = 0;
+        validatedParams.gpsCoordinates[0] = strtod(gpsLatStr, &endPtr);
+        if (errno || endPtr == gpsLatStr) {
+            ALOGE("%s: Malformed GPS latitude: %s", __FUNCTION__, gpsLatStr);
+            return BAD_VALUE;
+        }
+        errno = 0;
+        validatedParams.gpsCoordinates[1] = strtod(gpsLongStr, &endPtr);
+        if (errno || endPtr == gpsLongStr) {
+            ALOGE("%s: Malformed GPS longitude: %s", __FUNCTION__, gpsLongStr);
+            return BAD_VALUE;
+        }
+        errno = 0;
+        validatedParams.gpsCoordinates[2] = strtod(gpsAltitudeStr, &endPtr);
+        if (errno || endPtr == gpsAltitudeStr) {
+            ALOGE("%s: Malformed GPS altitude: %s", __FUNCTION__,
+                    gpsAltitudeStr);
+            return BAD_VALUE;
+        }
+        errno = 0;
+        validatedParams.gpsTimestamp = strtoll(gpsTimeStr, &endPtr, 10);
+        if (errno || endPtr == gpsTimeStr) {
+            ALOGE("%s: Malformed GPS timestamp: %s", __FUNCTION__, gpsTimeStr);
+            return BAD_VALUE;
+        }
+        validatedParams.gpsProcessingMethod = gpsProcMethodStr;
+
+        validatedParams.gpsEnabled = true;
+    } else {
+        validatedParams.gpsEnabled = false;
+    }
+
+    // WHITE_BALANCE
+    validatedParams.wbMode = wbModeStringToEnum(
+        newParams.get(CameraParameters::KEY_WHITE_BALANCE) );
+    if (validatedParams.wbMode != wbMode) {
+        camera_metadata_ro_entry_t availableWbModes =
+            staticInfo(ANDROID_CONTROL_AWB_AVAILABLE_MODES);
+        for (i = 0; i < availableWbModes.count; i++) {
+            if (validatedParams.wbMode == availableWbModes.data.u8[i]) break;
+        }
+        if (i == availableWbModes.count) {
+            ALOGE("%s: Requested white balance mode %s is not supported",
+                    __FUNCTION__,
+                    newParams.get(CameraParameters::KEY_WHITE_BALANCE));
+            return BAD_VALUE;
+        }
+    }
+
+    // EFFECT
+    validatedParams.effectMode = effectModeStringToEnum(
+        newParams.get(CameraParameters::KEY_EFFECT) );
+    if (validatedParams.effectMode != effectMode) {
+        camera_metadata_ro_entry_t availableEffectModes =
+            staticInfo(ANDROID_CONTROL_AVAILABLE_EFFECTS);
+        for (i = 0; i < availableEffectModes.count; i++) {
+            if (validatedParams.effectMode == availableEffectModes.data.u8[i]) break;
+        }
+        if (i == availableEffectModes.count) {
+            ALOGE("%s: Requested effect mode \"%s\" is not supported",
+                    __FUNCTION__,
+                    newParams.get(CameraParameters::KEY_EFFECT) );
+            return BAD_VALUE;
+        }
+    }
+
+    // ANTIBANDING
+    validatedParams.antibandingMode = abModeStringToEnum(
+        newParams.get(CameraParameters::KEY_ANTIBANDING) );
+    if (validatedParams.antibandingMode != antibandingMode) {
+        camera_metadata_ro_entry_t availableAbModes =
+            staticInfo(ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES);
+        for (i = 0; i < availableAbModes.count; i++) {
+            if (validatedParams.antibandingMode == availableAbModes.data.u8[i])
+                break;
+        }
+        if (i == availableAbModes.count) {
+            ALOGE("%s: Requested antibanding mode \"%s\" is not supported",
+                    __FUNCTION__,
+                    newParams.get(CameraParameters::KEY_ANTIBANDING));
+            return BAD_VALUE;
+        }
+    }
+
+    // SCENE_MODE
+    validatedParams.sceneMode = sceneModeStringToEnum(
+        newParams.get(CameraParameters::KEY_SCENE_MODE) );
+    if (validatedParams.sceneMode != sceneMode &&
+            validatedParams.sceneMode !=
+            ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED) {
+        camera_metadata_ro_entry_t availableSceneModes =
+            staticInfo(ANDROID_CONTROL_AVAILABLE_SCENE_MODES);
+        for (i = 0; i < availableSceneModes.count; i++) {
+            if (validatedParams.sceneMode == availableSceneModes.data.u8[i])
+                break;
+        }
+        if (i == availableSceneModes.count) {
+            ALOGE("%s: Requested scene mode \"%s\" is not supported",
+                    __FUNCTION__,
+                    newParams.get(CameraParameters::KEY_SCENE_MODE));
+            return BAD_VALUE;
+        }
+    }
+
+    // FLASH_MODE
+    validatedParams.flashMode = flashModeStringToEnum(
+        newParams.get(CameraParameters::KEY_FLASH_MODE) );
+    if (validatedParams.flashMode != flashMode) {
+        camera_metadata_ro_entry_t flashAvailable =
+            staticInfo(ANDROID_FLASH_AVAILABLE, 1, 1);
+        if (!flashAvailable.data.u8[0] &&
+                validatedParams.flashMode != Parameters::FLASH_MODE_OFF) {
+            ALOGE("%s: Requested flash mode \"%s\" is not supported: "
+                    "No flash on device", __FUNCTION__,
+                    newParams.get(CameraParameters::KEY_FLASH_MODE));
+            return BAD_VALUE;
+        } else if (validatedParams.flashMode == Parameters::FLASH_MODE_RED_EYE) {
+            camera_metadata_ro_entry_t availableAeModes =
+                staticInfo(ANDROID_CONTROL_AE_AVAILABLE_MODES);
+            for (i = 0; i < availableAeModes.count; i++) {
+                if (validatedParams.flashMode == availableAeModes.data.u8[i])
+                    break;
+            }
+            if (i == availableAeModes.count) {
+                ALOGE("%s: Requested flash mode \"%s\" is not supported",
+                        __FUNCTION__,
+                        newParams.get(CameraParameters::KEY_FLASH_MODE));
+                return BAD_VALUE;
+            }
+        } else if (validatedParams.flashMode == -1) {
+            ALOGE("%s: Requested flash mode \"%s\" is unknown",
+                    __FUNCTION__,
+                    newParams.get(CameraParameters::KEY_FLASH_MODE));
+            return BAD_VALUE;
+        }
+    }
+
+    // FOCUS_MODE
+    validatedParams.focusMode = focusModeStringToEnum(
+        newParams.get(CameraParameters::KEY_FOCUS_MODE));
+    if (validatedParams.focusMode != focusMode) {
+        validatedParams.currentAfTriggerId = -1;
+        if (validatedParams.focusMode != Parameters::FOCUS_MODE_FIXED) {
+            camera_metadata_ro_entry_t minFocusDistance =
+                staticInfo(ANDROID_LENS_MINIMUM_FOCUS_DISTANCE);
+            if (minFocusDistance.data.f[0] == 0) {
+                ALOGE("%s: Requested focus mode \"%s\" is not available: "
+                        "fixed focus lens",
+                        __FUNCTION__,
+                        newParams.get(CameraParameters::KEY_FOCUS_MODE));
+                return BAD_VALUE;
+            } else if (validatedParams.focusMode !=
+                    Parameters::FOCUS_MODE_INFINITY) {
+                camera_metadata_ro_entry_t availableFocusModes =
+                    staticInfo(ANDROID_CONTROL_AF_AVAILABLE_MODES);
+                for (i = 0; i < availableFocusModes.count; i++) {
+                    if (validatedParams.focusMode ==
+                            availableFocusModes.data.u8[i]) break;
+                }
+                if (i == availableFocusModes.count) {
+                    ALOGE("%s: Requested focus mode \"%s\" is not supported",
+                            __FUNCTION__,
+                            newParams.get(CameraParameters::KEY_FOCUS_MODE));
+                    return BAD_VALUE;
+                }
+            }
+        }
+    } else {
+        validatedParams.currentAfTriggerId = currentAfTriggerId;
+    }
+
+    // FOCUS_AREAS
+    res = parseAreas(newParams.get(CameraParameters::KEY_FOCUS_AREAS),
+            &validatedParams.focusingAreas);
+    size_t max3aRegions =
+        (size_t)staticInfo(ANDROID_CONTROL_MAX_REGIONS, 1, 1).data.i32[0];
+    if (res == OK) res = validateAreas(validatedParams.focusingAreas,
+            max3aRegions);
+    if (res != OK) {
+        ALOGE("%s: Requested focus areas are malformed: %s",
+                __FUNCTION__, newParams.get(CameraParameters::KEY_FOCUS_AREAS));
+        return BAD_VALUE;
+    }
+
+    // EXPOSURE_COMPENSATION
+    validatedParams.exposureCompensation =
+        newParams.getInt(CameraParameters::KEY_EXPOSURE_COMPENSATION);
+    camera_metadata_ro_entry_t exposureCompensationRange =
+        staticInfo(ANDROID_CONTROL_AE_EXP_COMPENSATION_RANGE);
+    if ((validatedParams.exposureCompensation <
+            exposureCompensationRange.data.i32[0]) ||
+        (validatedParams.exposureCompensation >
+            exposureCompensationRange.data.i32[1])) {
+        ALOGE("%s: Requested exposure compensation index is out of bounds: %d",
+                __FUNCTION__, validatedParams.exposureCompensation);
+        return BAD_VALUE;
+    }
+
+    // AUTO_EXPOSURE_LOCK (always supported)
+    validatedParams.autoExposureLock = boolFromString(
+        newParams.get(CameraParameters::KEY_AUTO_EXPOSURE_LOCK));
+
+    // AUTO_WHITEBALANCE_LOCK (always supported)
+    validatedParams.autoWhiteBalanceLock = boolFromString(
+        newParams.get(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK));
+
+    // METERING_AREAS
+    res = parseAreas(newParams.get(CameraParameters::KEY_METERING_AREAS),
+            &validatedParams.meteringAreas);
+    if (res == OK) {
+        res = validateAreas(validatedParams.meteringAreas, max3aRegions);
+    }
+    if (res != OK) {
+        ALOGE("%s: Requested metering areas are malformed: %s",
+                __FUNCTION__,
+                newParams.get(CameraParameters::KEY_METERING_AREAS));
+        return BAD_VALUE;
+    }
+
+    // ZOOM
+    validatedParams.zoom = newParams.getInt(CameraParameters::KEY_ZOOM);
+    if (validatedParams.zoom < 0 || validatedParams.zoom > (int)NUM_ZOOM_STEPS) {
+        ALOGE("%s: Requested zoom level %d is not supported",
+                __FUNCTION__, validatedParams.zoom);
+        return BAD_VALUE;
+    }
+
+    // VIDEO_SIZE
+    newParams.getVideoSize(&validatedParams.videoWidth,
+            &validatedParams.videoHeight);
+    if (validatedParams.videoWidth != videoWidth ||
+            validatedParams.videoHeight != videoHeight) {
+        if (state == RECORD) {
+            ALOGE("%s: Video size cannot be updated when recording is active!",
+                    __FUNCTION__);
+            return BAD_VALUE;
+        }
+        camera_metadata_ro_entry_t availableVideoSizes =
+            staticInfo(ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES);
+        for (i = 0; i < availableVideoSizes.count; i += 2 ) {
+            if ((availableVideoSizes.data.i32[i] ==
+                    validatedParams.videoWidth) &&
+                (availableVideoSizes.data.i32[i+1] ==
+                    validatedParams.videoHeight)) break;
+        }
+        if (i == availableVideoSizes.count) {
+            ALOGE("%s: Requested video size %d x %d is not supported",
+                    __FUNCTION__, validatedParams.videoWidth,
+                    validatedParams.videoHeight);
+            return BAD_VALUE;
+        }
+    }
+
+    // RECORDING_HINT (always supported)
+    validatedParams.recordingHint = boolFromString(
+        newParams.get(CameraParameters::KEY_RECORDING_HINT) );
+
+    // VIDEO_STABILIZATION
+    validatedParams.videoStabilization = boolFromString(
+        newParams.get(CameraParameters::KEY_VIDEO_STABILIZATION) );
+    camera_metadata_ro_entry_t availableVideoStabilizationModes =
+        staticInfo(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES);
+    if (validatedParams.videoStabilization &&
+            availableVideoStabilizationModes.count == 1) {
+        ALOGE("%s: Video stabilization not supported", __FUNCTION__);
+    }
+
+    /** Update internal parameters */
+
+    validatedParams.paramsFlattened = params;
+    *this = validatedParams;
+
+    return OK;
+}
+
+const char* Parameters::getStateName(State state) {
+#define CASE_ENUM_TO_CHAR(x) case x: return(#x); break;
+    switch(state) {
+        CASE_ENUM_TO_CHAR(DISCONNECTED)
+        CASE_ENUM_TO_CHAR(STOPPED)
+        CASE_ENUM_TO_CHAR(WAITING_FOR_PREVIEW_WINDOW)
+        CASE_ENUM_TO_CHAR(PREVIEW)
+        CASE_ENUM_TO_CHAR(RECORD)
+        CASE_ENUM_TO_CHAR(STILL_CAPTURE)
+        CASE_ENUM_TO_CHAR(VIDEO_SNAPSHOT)
+        default:
+            return "Unknown state!";
+            break;
+    }
+#undef CASE_ENUM_TO_CHAR
+}
+
+int Parameters::formatStringToEnum(const char *format) {
+    return
+        !strcmp(format, CameraParameters::PIXEL_FORMAT_YUV422SP) ?
+            HAL_PIXEL_FORMAT_YCbCr_422_SP : // NV16
+        !strcmp(format, CameraParameters::PIXEL_FORMAT_YUV420SP) ?
+            HAL_PIXEL_FORMAT_YCrCb_420_SP : // NV21
+        !strcmp(format, CameraParameters::PIXEL_FORMAT_YUV422I) ?
+            HAL_PIXEL_FORMAT_YCbCr_422_I :  // YUY2
+        !strcmp(format, CameraParameters::PIXEL_FORMAT_YUV420P) ?
+            HAL_PIXEL_FORMAT_YV12 :         // YV12
+        !strcmp(format, CameraParameters::PIXEL_FORMAT_RGB565) ?
+            HAL_PIXEL_FORMAT_RGB_565 :      // RGB565
+        !strcmp(format, CameraParameters::PIXEL_FORMAT_RGBA8888) ?
+            HAL_PIXEL_FORMAT_RGBA_8888 :    // RGB8888
+        !strcmp(format, CameraParameters::PIXEL_FORMAT_BAYER_RGGB) ?
+            HAL_PIXEL_FORMAT_RAW_SENSOR :   // Raw sensor data
+        -1;
+}
+
+const char* Parameters::formatEnumToString(int format) {
+    const char *fmt;
+    switch(format) {
+        case HAL_PIXEL_FORMAT_YCbCr_422_SP: // NV16
+            fmt = CameraParameters::PIXEL_FORMAT_YUV422SP;
+            break;
+        case HAL_PIXEL_FORMAT_YCrCb_420_SP: // NV21
+            fmt = CameraParameters::PIXEL_FORMAT_YUV420SP;
+            break;
+        case HAL_PIXEL_FORMAT_YCbCr_422_I: // YUY2
+            fmt = CameraParameters::PIXEL_FORMAT_YUV422I;
+            break;
+        case HAL_PIXEL_FORMAT_YV12:        // YV12
+            fmt = CameraParameters::PIXEL_FORMAT_YUV420P;
+            break;
+        case HAL_PIXEL_FORMAT_RGB_565:     // RGB565
+            fmt = CameraParameters::PIXEL_FORMAT_RGB565;
+            break;
+        case HAL_PIXEL_FORMAT_RGBA_8888:   // RGBA8888
+            fmt = CameraParameters::PIXEL_FORMAT_RGBA8888;
+            break;
+        case HAL_PIXEL_FORMAT_RAW_SENSOR:
+            ALOGW("Raw sensor preview format requested.");
+            fmt = CameraParameters::PIXEL_FORMAT_BAYER_RGGB;
+            break;
+        default:
+            ALOGE("%s: Unknown preview format: %x",
+                    __FUNCTION__,  format);
+            fmt = NULL;
+            break;
+    }
+    return fmt;
+}
+
+int Parameters::wbModeStringToEnum(const char *wbMode) {
+    return
+        !strcmp(wbMode, CameraParameters::WHITE_BALANCE_AUTO) ?
+            ANDROID_CONTROL_AWB_AUTO :
+        !strcmp(wbMode, CameraParameters::WHITE_BALANCE_INCANDESCENT) ?
+            ANDROID_CONTROL_AWB_INCANDESCENT :
+        !strcmp(wbMode, CameraParameters::WHITE_BALANCE_FLUORESCENT) ?
+            ANDROID_CONTROL_AWB_FLUORESCENT :
+        !strcmp(wbMode, CameraParameters::WHITE_BALANCE_WARM_FLUORESCENT) ?
+            ANDROID_CONTROL_AWB_WARM_FLUORESCENT :
+        !strcmp(wbMode, CameraParameters::WHITE_BALANCE_DAYLIGHT) ?
+            ANDROID_CONTROL_AWB_DAYLIGHT :
+        !strcmp(wbMode, CameraParameters::WHITE_BALANCE_CLOUDY_DAYLIGHT) ?
+            ANDROID_CONTROL_AWB_CLOUDY_DAYLIGHT :
+        !strcmp(wbMode, CameraParameters::WHITE_BALANCE_TWILIGHT) ?
+            ANDROID_CONTROL_AWB_TWILIGHT :
+        !strcmp(wbMode, CameraParameters::WHITE_BALANCE_SHADE) ?
+            ANDROID_CONTROL_AWB_SHADE :
+        -1;
+}
+
+int Parameters::effectModeStringToEnum(const char *effectMode) {
+    return
+        !strcmp(effectMode, CameraParameters::EFFECT_NONE) ?
+            ANDROID_CONTROL_EFFECT_OFF :
+        !strcmp(effectMode, CameraParameters::EFFECT_MONO) ?
+            ANDROID_CONTROL_EFFECT_MONO :
+        !strcmp(effectMode, CameraParameters::EFFECT_NEGATIVE) ?
+            ANDROID_CONTROL_EFFECT_NEGATIVE :
+        !strcmp(effectMode, CameraParameters::EFFECT_SOLARIZE) ?
+            ANDROID_CONTROL_EFFECT_SOLARIZE :
+        !strcmp(effectMode, CameraParameters::EFFECT_SEPIA) ?
+            ANDROID_CONTROL_EFFECT_SEPIA :
+        !strcmp(effectMode, CameraParameters::EFFECT_POSTERIZE) ?
+            ANDROID_CONTROL_EFFECT_POSTERIZE :
+        !strcmp(effectMode, CameraParameters::EFFECT_WHITEBOARD) ?
+            ANDROID_CONTROL_EFFECT_WHITEBOARD :
+        !strcmp(effectMode, CameraParameters::EFFECT_BLACKBOARD) ?
+            ANDROID_CONTROL_EFFECT_BLACKBOARD :
+        !strcmp(effectMode, CameraParameters::EFFECT_AQUA) ?
+            ANDROID_CONTROL_EFFECT_AQUA :
+        -1;
+}
+
+int Parameters::abModeStringToEnum(const char *abMode) {
+    return
+        !strcmp(abMode, CameraParameters::ANTIBANDING_AUTO) ?
+            ANDROID_CONTROL_AE_ANTIBANDING_AUTO :
+        !strcmp(abMode, CameraParameters::ANTIBANDING_OFF) ?
+            ANDROID_CONTROL_AE_ANTIBANDING_OFF :
+        !strcmp(abMode, CameraParameters::ANTIBANDING_50HZ) ?
+            ANDROID_CONTROL_AE_ANTIBANDING_50HZ :
+        !strcmp(abMode, CameraParameters::ANTIBANDING_60HZ) ?
+            ANDROID_CONTROL_AE_ANTIBANDING_60HZ :
+        -1;
+}
+
+int Parameters::sceneModeStringToEnum(const char *sceneMode) {
+    return
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_AUTO) ?
+            ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_ACTION) ?
+            ANDROID_CONTROL_SCENE_MODE_ACTION :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_PORTRAIT) ?
+            ANDROID_CONTROL_SCENE_MODE_PORTRAIT :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_LANDSCAPE) ?
+            ANDROID_CONTROL_SCENE_MODE_LANDSCAPE :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_NIGHT) ?
+            ANDROID_CONTROL_SCENE_MODE_NIGHT :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_NIGHT_PORTRAIT) ?
+            ANDROID_CONTROL_SCENE_MODE_NIGHT_PORTRAIT :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_THEATRE) ?
+            ANDROID_CONTROL_SCENE_MODE_THEATRE :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_BEACH) ?
+            ANDROID_CONTROL_SCENE_MODE_BEACH :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_SNOW) ?
+            ANDROID_CONTROL_SCENE_MODE_SNOW :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_SUNSET) ?
+            ANDROID_CONTROL_SCENE_MODE_SUNSET :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_STEADYPHOTO) ?
+            ANDROID_CONTROL_SCENE_MODE_STEADYPHOTO :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_FIREWORKS) ?
+            ANDROID_CONTROL_SCENE_MODE_FIREWORKS :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_SPORTS) ?
+            ANDROID_CONTROL_SCENE_MODE_SPORTS :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_PARTY) ?
+            ANDROID_CONTROL_SCENE_MODE_PARTY :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_CANDLELIGHT) ?
+            ANDROID_CONTROL_SCENE_MODE_CANDLELIGHT :
+        !strcmp(sceneMode, CameraParameters::SCENE_MODE_BARCODE) ?
+            ANDROID_CONTROL_SCENE_MODE_BARCODE:
+        -1;
+}
+
+Parameters::Parameters::flashMode_t Parameters::flashModeStringToEnum(
+        const char *flashMode) {
+    return
+        !strcmp(flashMode, CameraParameters::FLASH_MODE_OFF) ?
+            Parameters::FLASH_MODE_OFF :
+        !strcmp(flashMode, CameraParameters::FLASH_MODE_AUTO) ?
+            Parameters::FLASH_MODE_AUTO :
+        !strcmp(flashMode, CameraParameters::FLASH_MODE_ON) ?
+            Parameters::FLASH_MODE_ON :
+        !strcmp(flashMode, CameraParameters::FLASH_MODE_RED_EYE) ?
+            Parameters::FLASH_MODE_RED_EYE :
+        !strcmp(flashMode, CameraParameters::FLASH_MODE_TORCH) ?
+            Parameters::FLASH_MODE_TORCH :
+        Parameters::FLASH_MODE_INVALID;
+}
+
+Parameters::Parameters::focusMode_t Parameters::focusModeStringToEnum(
+        const char *focusMode) {
+    return
+        !strcmp(focusMode, CameraParameters::FOCUS_MODE_AUTO) ?
+            Parameters::FOCUS_MODE_AUTO :
+        !strcmp(focusMode, CameraParameters::FOCUS_MODE_INFINITY) ?
+            Parameters::FOCUS_MODE_INFINITY :
+        !strcmp(focusMode, CameraParameters::FOCUS_MODE_MACRO) ?
+            Parameters::FOCUS_MODE_MACRO :
+        !strcmp(focusMode, CameraParameters::FOCUS_MODE_FIXED) ?
+            Parameters::FOCUS_MODE_FIXED :
+        !strcmp(focusMode, CameraParameters::FOCUS_MODE_EDOF) ?
+            Parameters::FOCUS_MODE_EDOF :
+        !strcmp(focusMode, CameraParameters::FOCUS_MODE_CONTINUOUS_VIDEO) ?
+            Parameters::FOCUS_MODE_CONTINUOUS_VIDEO :
+        !strcmp(focusMode, CameraParameters::FOCUS_MODE_CONTINUOUS_PICTURE) ?
+            Parameters::FOCUS_MODE_CONTINUOUS_PICTURE :
+        Parameters::FOCUS_MODE_INVALID;
+}
+
+status_t Parameters::parseAreas(const char *areasCStr,
+        Vector<Parameters::Area> *areas) {
+    static const size_t NUM_FIELDS = 5;
+    areas->clear();
+    if (areasCStr == NULL) {
+        // If no key exists, use default (0,0,0,0,0)
+        areas->push();
+        return OK;
+    }
+    String8 areasStr(areasCStr);
+    ssize_t areaStart = areasStr.find("(", 0) + 1;
+    while (areaStart != 0) {
+        const char* area = areasStr.string() + areaStart;
+        char *numEnd;
+        int vals[NUM_FIELDS];
+        for (size_t i = 0; i < NUM_FIELDS; i++) {
+            errno = 0;
+            vals[i] = strtol(area, &numEnd, 10);
+            if (errno || numEnd == area) return BAD_VALUE;
+            area = numEnd + 1;
+        }
+        areas->push(Parameters::Area(
+            vals[0], vals[1], vals[2], vals[3], vals[4]) );
+        areaStart = areasStr.find("(", areaStart) + 1;
+    }
+    return OK;
+}
+
+status_t Parameters::validateAreas(const Vector<Parameters::Area> &areas,
+                                      size_t maxRegions) {
+    // Definition of valid area can be found in
+    // include/camera/CameraParameters.h
+    if (areas.size() == 0) return BAD_VALUE;
+    if (areas.size() == 1) {
+        if (areas[0].left == 0 &&
+                areas[0].top == 0 &&
+                areas[0].right == 0 &&
+                areas[0].bottom == 0 &&
+                areas[0].weight == 0) {
+            // Single (0,0,0,0,0) entry is always valid (== driver decides)
+            return OK;
+        }
+    }
+    if (areas.size() > maxRegions) {
+        ALOGE("%s: Too many areas requested: %d",
+                __FUNCTION__, areas.size());
+        return BAD_VALUE;
+    }
+
+    for (Vector<Parameters::Area>::const_iterator a = areas.begin();
+         a != areas.end(); a++) {
+        if (a->weight < 1 || a->weight > 1000) return BAD_VALUE;
+        if (a->left < -1000 || a->left > 1000) return BAD_VALUE;
+        if (a->top < -1000 || a->top > 1000) return BAD_VALUE;
+        if (a->right < -1000 || a->right > 1000) return BAD_VALUE;
+        if (a->bottom < -1000 || a->bottom > 1000) return BAD_VALUE;
+        if (a->left >= a->right) return BAD_VALUE;
+        if (a->top >= a->bottom) return BAD_VALUE;
+    }
+    return OK;
+}
+
+bool Parameters::boolFromString(const char *boolStr) {
+    return !boolStr ? false :
+        !strcmp(boolStr, CameraParameters::TRUE) ? true :
+        false;
+}
+
+int Parameters::degToTransform(int degrees, bool mirror) {
+    if (!mirror) {
+        if (degrees == 0) return 0;
+        else if (degrees == 90) return HAL_TRANSFORM_ROT_90;
+        else if (degrees == 180) return HAL_TRANSFORM_ROT_180;
+        else if (degrees == 270) return HAL_TRANSFORM_ROT_270;
+    } else {  // Do mirror (horizontal flip)
+        if (degrees == 0) {           // FLIP_H and ROT_0
+            return HAL_TRANSFORM_FLIP_H;
+        } else if (degrees == 90) {   // FLIP_H and ROT_90
+            return HAL_TRANSFORM_FLIP_H | HAL_TRANSFORM_ROT_90;
+        } else if (degrees == 180) {  // FLIP_H and ROT_180
+            return HAL_TRANSFORM_FLIP_V;
+        } else if (degrees == 270) {  // FLIP_H and ROT_270
+            return HAL_TRANSFORM_FLIP_V | HAL_TRANSFORM_ROT_90;
+        }
+    }
+    ALOGE("%s: Bad input: %d", __FUNCTION__, degrees);
+    return -1;
+}
+
+int Parameters::arrayXToNormalized(int width) const {
+    return width * 2000 / (fastInfo.arrayWidth - 1) - 1000;
+}
+
+int Parameters::arrayYToNormalized(int height) const {
+    return height * 2000 / (fastInfo.arrayHeight - 1) - 1000;
+}
+
+int Parameters::normalizedXToArray(int x) const {
+    return (x + 1000) * (fastInfo.arrayWidth - 1) / 2000;
+}
+
+int Parameters::normalizedYToArray(int y) const {
+    return (y + 1000) * (fastInfo.arrayHeight - 1) / 2000;
+}
+
+}; // namespace camera2
+}; // namespace android
diff --git a/services/camera/libcameraservice/camera2/Parameters.h b/services/camera/libcameraservice/camera2/Parameters.h
new file mode 100644
index 0000000..817d001
--- /dev/null
+++ b/services/camera/libcameraservice/camera2/Parameters.h
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_SERVERS_CAMERA_CAMERA2PARAMETERS_H
+#define ANDROID_SERVERS_CAMERA_CAMERA2PARAMETERS_H
+
+#include <system/graphics.h>
+
+#include <utils/Errors.h>
+#include <utils/Mutex.h>
+#include <utils/String8.h>
+#include <utils/Vector.h>
+
+#include "CameraMetadata.h"
+
+namespace android {
+namespace camera2 {
+
+// Current camera state; this is the full state of the Camera under the old
+// camera API (contents of the CameraParameters object in a more-efficient
+// format, plus other state). The enum values are mostly based off the
+// corresponding camera2 enums, not the camera1 strings. A few are defined here
+// if they don't cleanly map to camera2 values.
+struct Parameters {
+    int cameraId;
+    int cameraFacing;
+
+    int previewWidth, previewHeight;
+    int32_t previewFpsRange[2];
+    int previewFps; // deprecated, here only for tracking changes
+    int previewFormat;
+
+    int previewTransform; // set by CAMERA_CMD_SET_DISPLAY_ORIENTATION
+
+    int pictureWidth, pictureHeight;
+
+    int32_t jpegThumbSize[2];
+    int32_t jpegQuality, jpegThumbQuality;
+    int32_t jpegRotation;
+
+    bool gpsEnabled;
+    double gpsCoordinates[3];
+    int64_t gpsTimestamp;
+    String8 gpsProcessingMethod;
+
+    uint8_t wbMode;
+    uint8_t effectMode;
+    uint8_t antibandingMode;
+    uint8_t sceneMode;
+
+    enum flashMode_t {
+        FLASH_MODE_OFF = 0,
+        FLASH_MODE_AUTO,
+        FLASH_MODE_ON,
+        FLASH_MODE_TORCH,
+        FLASH_MODE_RED_EYE = ANDROID_CONTROL_AE_ON_AUTO_FLASH_REDEYE,
+        FLASH_MODE_INVALID = -1
+    } flashMode;
+
+    enum focusMode_t {
+        FOCUS_MODE_AUTO = ANDROID_CONTROL_AF_AUTO,
+        FOCUS_MODE_MACRO = ANDROID_CONTROL_AF_MACRO,
+        FOCUS_MODE_CONTINUOUS_VIDEO = ANDROID_CONTROL_AF_CONTINUOUS_VIDEO,
+        FOCUS_MODE_CONTINUOUS_PICTURE = ANDROID_CONTROL_AF_CONTINUOUS_PICTURE,
+        FOCUS_MODE_EDOF = ANDROID_CONTROL_AF_EDOF,
+        FOCUS_MODE_INFINITY,
+        FOCUS_MODE_FIXED,
+        FOCUS_MODE_INVALID = -1
+    } focusMode;
+
+    struct Area {
+        int left, top, right, bottom;
+        int weight;
+        Area() {}
+        Area(int left, int top, int right, int bottom, int weight):
+                left(left), top(top), right(right), bottom(bottom),
+                weight(weight) {}
+    };
+    Vector<Area> focusingAreas;
+
+    int32_t exposureCompensation;
+    bool autoExposureLock;
+    bool autoWhiteBalanceLock;
+
+    Vector<Area> meteringAreas;
+
+    int zoom;
+
+    int videoWidth, videoHeight;
+
+    bool recordingHint;
+    bool videoStabilization;
+
+    String8 paramsFlattened;
+
+    // These parameters are also part of the camera API-visible state, but not
+    // directly listed in Camera.Parameters
+    bool storeMetadataInBuffers;
+    bool playShutterSound;
+    bool enableFaceDetect;
+
+    bool enableFocusMoveMessages;
+    int afTriggerCounter;
+    int currentAfTriggerId;
+    bool afInMotion;
+
+    uint32_t previewCallbackFlags;
+    bool previewCallbackOneShot;
+
+    // Overall camera state
+    enum State {
+        DISCONNECTED,
+        STOPPED,
+        WAITING_FOR_PREVIEW_WINDOW,
+        PREVIEW,
+        RECORD,
+        STILL_CAPTURE,
+        VIDEO_SNAPSHOT
+    } state;
+
+    // Number of zoom steps to simulate
+    static const unsigned int NUM_ZOOM_STEPS = 10;
+
+    // Full static camera info, object owned by someone else, such as
+    // Camera2Device.
+    const CameraMetadata *info;
+
+    // Fast-access static device information; this is a subset of the
+    // information available through the staticInfo() method, used for
+    // frequently-accessed values or values that have to be calculated from the
+    // static information.
+    struct DeviceInfo {
+        int32_t arrayWidth;
+        int32_t arrayHeight;
+        uint8_t bestFaceDetectMode;
+        int32_t maxFaces;
+    } fastInfo;
+
+    // Parameter manipulation and setup methods
+
+    Parameters(int cameraId, int cameraFacing);
+    ~Parameters();
+
+    // Sets up default parameters
+    status_t initialize(const CameraMetadata *info);
+
+    // Build fast device info
+    status_t buildFastInfo();
+
+    // Get entry from camera static characteristics information. min/maxCount
+    // are used for error checking the number of values in the entry. 0 for
+    // max/minCount means to do no bounds check in that direction. In case of
+    // error, the entry data pointer is null and the count is 0.
+    camera_metadata_ro_entry_t staticInfo(uint32_t tag,
+            size_t minCount=0, size_t maxCount=0) const;
+
+    // Validate and update camera parameters based on new settings
+    status_t set(const String8 &params);
+
+    // Static methods for debugging and converting between camera1 and camera2
+    // parameters
+
+    static const char *getStateName(State state);
+
+    static int formatStringToEnum(const char *format);
+    static const char *formatEnumToString(int format);
+
+    static int wbModeStringToEnum(const char *wbMode);
+    static int effectModeStringToEnum(const char *effectMode);
+    static int abModeStringToEnum(const char *abMode);
+    static int sceneModeStringToEnum(const char *sceneMode);
+    static flashMode_t flashModeStringToEnum(const char *flashMode);
+    static focusMode_t focusModeStringToEnum(const char *focusMode);
+    static status_t parseAreas(const char *areasCStr,
+            Vector<Area> *areas);
+    static status_t validateAreas(const Vector<Area> &areas,
+                                  size_t maxRegions);
+    static bool boolFromString(const char *boolStr);
+
+    // Map from camera orientation + facing to gralloc transform enum
+    static int degToTransform(int degrees, bool mirror);
+
+    // Transform between (-1000,-1000)-(1000,1000) normalized coords from camera
+    // API and HAL2 (0,0)-(activePixelArray.width/height) coordinates
+    int arrayXToNormalized(int width) const;
+    int arrayYToNormalized(int height) const;
+    int normalizedXToArray(int x) const;
+    int normalizedYToArray(int y) const;
+
+};
+
+// This class encapsulates the Parameters class so that it can only be accessed
+// by constructing a Lock object, which locks the SharedParameter's mutex.
+class SharedParameters {
+  public:
+    SharedParameters(int cameraId, int cameraFacing):
+            mParameters(cameraId, cameraFacing) {
+    }
+
+    template<typename S, typename P>
+    class BaseLock {
+      public:
+        BaseLock(S &p):
+                mParameters(p.mParameters),
+                mSharedParameters(p) {
+            mSharedParameters.mLock.lock();
+        }
+
+        ~BaseLock() {
+            mSharedParameters.mLock.unlock();
+        }
+        P &mParameters;
+      private:
+        // Disallow copying, default construction
+        BaseLock();
+        BaseLock(const BaseLock &);
+        BaseLock &operator=(const BaseLock &);
+        S &mSharedParameters;
+    };
+    typedef BaseLock<SharedParameters, Parameters> Lock;
+    typedef BaseLock<const SharedParameters, const Parameters> ReadLock;
+
+    // Access static info, read-only and immutable, so no lock needed
+    camera_metadata_ro_entry_t staticInfo(uint32_t tag,
+            size_t minCount=0, size_t maxCount=0) const {
+        return mParameters.staticInfo(tag, minCount, maxCount);
+    }
+
+    // Only use for dumping or other debugging
+    const Parameters &unsafeAccess() {
+        return mParameters;
+    }
+  private:
+    Parameters mParameters;
+    mutable Mutex mLock;
+};
+
+
+}; // namespace camera2
+}; // namespace android
+
+#endif
