audioflinger: use resample coefficients from audio-resampler library.
-Add a separate quality VERY_HIGH_QUALITY in resampler
-Use resample coefficients audio-resampler library for
quality VERY_HIGH_QUALITY.
-This improves the quality of resampled output.
Bug: 7024293
Change-Id: Ia44142413bed5f5963d7eab7846eec877a2415e4
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/services/audioflinger/AudioResampler.cpp b/services/audioflinger/AudioResampler.cpp
index fbb54cf..5c1c905 100644
--- a/services/audioflinger/AudioResampler.cpp
+++ b/services/audioflinger/AudioResampler.cpp
@@ -23,8 +23,8 @@
#include <cutils/log.h>
#include <cutils/properties.h>
#include "AudioResampler.h"
-#if 0
#include "AudioResamplerSinc.h"
+#if 0
#include "AudioResamplerCubic.h"
#endif
@@ -106,11 +106,14 @@
ALOGV("Create cubic Resampler");
resampler = new AudioResamplerCubic(bitDepth, inChannelCount, sampleRate);
break;
- case HIGH_QUALITY:
- ALOGV("Create sinc Resampler");
- resampler = new AudioResamplerSinc(bitDepth, inChannelCount, sampleRate);
- break;
#endif
+ case HIGH_QUALITY:
+ ALOGV("Create HIGH_QUALITY sinc Resampler");
+ resampler = new AudioResamplerSinc(bitDepth, inChannelCount, sampleRate);
+ case VERY_HIGH_QUALITY:
+ ALOGV("Create VERY_HIGH_QUALITY sinc Resampler = %d",quality);
+ resampler = new AudioResamplerSinc(bitDepth, inChannelCount, sampleRate, quality);
+ break;
}
// initialize resampler