ditherAndClamp from libaudioutils not AudioMixer

Change-Id: I1e8a00c81efefd956fe9e4d9b58557373320e322
diff --git a/libvideoeditor/lvpp/Android.mk b/libvideoeditor/lvpp/Android.mk
index fdcd316..e2d8417 100755
--- a/libvideoeditor/lvpp/Android.mk
+++ b/libvideoeditor/lvpp/Android.mk
@@ -49,6 +49,7 @@
 
 
 LOCAL_SHARED_LIBRARIES := \
+    libaudioutils      \
     libbinder          \
     libutils           \
     libcutils          \
@@ -65,6 +66,7 @@
 
 
 LOCAL_C_INCLUDES += \
+    $(TOP)/system/media/audio_utils/include \
     $(TOP)/frameworks/base/core/jni \
     $(TOP)/frameworks/base/include \
     $(TOP)/frameworks/base/include/media \
diff --git a/libvideoeditor/lvpp/VideoEditorSRC.cpp b/libvideoeditor/lvpp/VideoEditorSRC.cpp
index 5ea95b0..3e8c498 100755
--- a/libvideoeditor/lvpp/VideoEditorSRC.cpp
+++ b/libvideoeditor/lvpp/VideoEditorSRC.cpp
@@ -18,6 +18,7 @@
 #define LOG_TAG "VideoEditorSRC"
 
 #include "VideoEditorSRC.h"
+#include <audio_utils/primitives.h>
 #include <media/stagefright/MetaData.h>
 #include <media/stagefright/MediaDebug.h>
 #include <media/stagefright/MediaBuffer.h>
@@ -146,7 +147,7 @@
         MediaBuffer* outBuffer = new MediaBuffer(outBufferSize);
 
         // Convert back to 2 channels and 16 bits
-        AudioMixer::ditherAndClamp(
+        ditherAndClamp(
                 (int32_t *)((uint8_t*)outBuffer->data() + outBuffer->range_offset()),
                 pTmpBuffer, outFrameCnt);
         free(pTmpBuffer);
diff --git a/libvideoeditor/vss/src/Android.mk b/libvideoeditor/vss/src/Android.mk
index 2001f0d..14f8f80 100755
--- a/libvideoeditor/vss/src/Android.mk
+++ b/libvideoeditor/vss/src/Android.mk
@@ -52,7 +52,7 @@
 
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_SHARED_LIBRARIES := libcutils libutils
+LOCAL_SHARED_LIBRARIES := libcutils libutils libaudioutils
 
 LOCAL_STATIC_LIBRARIES := \
     libvideoeditor_osal \
@@ -62,6 +62,7 @@
     libvideoeditor_stagefrightshells
 
 LOCAL_C_INCLUDES += \
+    $(TOP)/system/media/audio_utils/include \
     $(TOP)/frameworks/base/include \
     $(TOP)/frameworks/media/libvideoeditor/osal/inc \
     $(TOP)/frameworks/media/libvideoeditor/vss/inc \
diff --git a/libvideoeditor/vss/src/VideoEditorResampler.cpp b/libvideoeditor/vss/src/VideoEditorResampler.cpp
index 6064baf..768cbd8 100755
--- a/libvideoeditor/vss/src/VideoEditorResampler.cpp
+++ b/libvideoeditor/vss/src/VideoEditorResampler.cpp
@@ -15,6 +15,7 @@
  */
 
 #define LOG_NDEBUG 1
+#include <audio_utils/primitives.h>
 #include <utils/Log.h>
 #include "AudioMixer.h"
 #include "VideoEditorResampler.h"
@@ -161,7 +162,7 @@
     context->mResampler->resample((int32_t *)pTmpBuffer,
        (size_t)outFrameCount, (VideoEditorResampler *)resamplerContext);
     // Convert back to 16 bits
-    AudioMixer::ditherAndClamp((int32_t*)out, pTmpBuffer, outFrameCount);
+    ditherAndClamp((int32_t*)out, pTmpBuffer, outFrameCount);
     free(pTmpBuffer);
     pTmpBuffer = NULL;
 }