mirror of https://github.com/thesofproject/sof.git
test: volume: remove unused code
Volume component no longer does format conversion. Remove the unused test code. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This commit is contained in:
parent
93d159d7fb
commit
68866f2c1f
|
@ -312,95 +312,6 @@ static void verify_s32_to_s24_s32(struct processing_module *mod,
|
|||
}
|
||||
#endif /* CONFIG_FORMAT_S32LE */
|
||||
|
||||
#if 0
|
||||
|
||||
#if CONFIG_FORMAT_S16LE && (CONFIG_FORMAT_S24LE || CONFIG_FORMAT_S32LE)
|
||||
static void verify_s16_to_sX(struct comp_dev *dev, struct comp_buffer *sink,
|
||||
struct comp_buffer *source)
|
||||
{
|
||||
struct vol_data *cd = comp_get_drvdata(dev);
|
||||
const int16_t *src = (int16_t *)source->r_ptr;
|
||||
const int32_t *dst = (int32_t *)sink->w_ptr;
|
||||
double processed;
|
||||
int32_t dst_sample;
|
||||
int32_t sample;
|
||||
int channels = sink->channels;
|
||||
int channel;
|
||||
int delta;
|
||||
int i;
|
||||
int shift = 0;
|
||||
|
||||
/* get shift value */
|
||||
if (cd->sink_format == SOF_IPC_FRAME_S24_4LE)
|
||||
shift = 8;
|
||||
else if (cd->sink_format == SOF_IPC_FRAME_S32_LE)
|
||||
shift = 0;
|
||||
|
||||
for (i = 0; i < sink->size / sizeof(uint32_t); i += channels) {
|
||||
for (channel = 0; channel < channels; channel++) {
|
||||
processed = 65536.0 * (double)src[i + channel] *
|
||||
(double)cd->volume[channel] /
|
||||
(double)VOL_ZERO_DB + 0.5 * (1 << shift);
|
||||
if (processed > INT32_MAX)
|
||||
processed = INT32_MAX;
|
||||
|
||||
if (processed < INT32_MIN)
|
||||
processed = INT32_MIN;
|
||||
|
||||
sample = ((int32_t)processed) >> shift;
|
||||
dst_sample = dst[i + channel];
|
||||
delta = dst_sample - sample;
|
||||
if (delta > 1 || delta < -1)
|
||||
assert_int_equal(dst_sample, sample);
|
||||
|
||||
if (shift && (dst_sample < INT24_MIN ||
|
||||
dst_sample > INT24_MAX))
|
||||
assert_int_equal(dst_sample, sample);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void verify_sX_to_s16(struct comp_dev *dev, struct comp_buffer *sink,
|
||||
struct comp_buffer *source)
|
||||
{
|
||||
struct vol_data *cd = comp_get_drvdata(dev);
|
||||
const int32_t *src = (int32_t *)source->r_ptr;
|
||||
const int16_t *dst = (int16_t *)sink->w_ptr;
|
||||
double processed;
|
||||
int channels = dev->params.channels;
|
||||
int channel;
|
||||
int delta;
|
||||
int i;
|
||||
int shift = 0;
|
||||
int16_t sample;
|
||||
|
||||
/* get shift value */
|
||||
if (cd->source_format == SOF_IPC_FRAME_S24_4LE)
|
||||
shift = 8;
|
||||
|
||||
for (i = 0; i < sink->size / sizeof(uint16_t); i += channels) {
|
||||
for (channel = 0; channel < channels; channel++) {
|
||||
processed = (double)(src[i + channel] << shift) *
|
||||
(double)cd->volume[channel] /
|
||||
(double)VOL_ZERO_DB;
|
||||
processed = processed / 65536.0 + 0.5;
|
||||
if (processed > INT16_MAX)
|
||||
processed = INT16_MAX;
|
||||
|
||||
if (processed < INT16_MIN)
|
||||
processed = INT16_MIN;
|
||||
|
||||
sample = (int16_t)processed;
|
||||
delta = dst[i + channel] - sample;
|
||||
if (delta > 1 || delta < -1)
|
||||
assert_int_equal(dst[i + channel], sample);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_FORMAT_S16LE && (CONFIG_FORMAT_S24LE || CONFIG_FORMAT_S32LE) */
|
||||
|
||||
#endif
|
||||
|
||||
static void test_audio_vol(void **state)
|
||||
{
|
||||
struct vol_test_state *vol_state = *state;
|
||||
|
|
Loading…
Reference in New Issue