pcm_volume: rename pcm_dither() to pcm_volume_dither()
This commit is contained in:
parent
b7b5e3f9c3
commit
6768581c41
|
@ -37,7 +37,8 @@ pcm_add_8(int8_t *buffer1, const int8_t *buffer2,
|
|||
int32_t sample2 = *buffer2++;
|
||||
|
||||
sample1 = ((sample1 * volume1 + sample2 * volume2) +
|
||||
pcm_dither() + PCM_VOLUME_1 / 2) / PCM_VOLUME_1;
|
||||
pcm_volume_dither() + PCM_VOLUME_1 / 2)
|
||||
/ PCM_VOLUME_1;
|
||||
|
||||
*buffer1++ = pcm_range(sample1, 8);
|
||||
--num_samples;
|
||||
|
@ -53,7 +54,8 @@ pcm_add_16(int16_t *buffer1, const int16_t *buffer2,
|
|||
int32_t sample2 = *buffer2++;
|
||||
|
||||
sample1 = ((sample1 * volume1 + sample2 * volume2) +
|
||||
pcm_dither() + PCM_VOLUME_1 / 2) / PCM_VOLUME_1;
|
||||
pcm_volume_dither() + PCM_VOLUME_1 / 2)
|
||||
/ PCM_VOLUME_1;
|
||||
|
||||
*buffer1++ = pcm_range(sample1, 16);
|
||||
--num_samples;
|
||||
|
@ -69,7 +71,8 @@ pcm_add_24(int32_t *buffer1, const int32_t *buffer2,
|
|||
int64_t sample2 = *buffer2++;
|
||||
|
||||
sample1 = ((sample1 * volume1 + sample2 * volume2) +
|
||||
pcm_dither() + PCM_VOLUME_1 / 2) / PCM_VOLUME_1;
|
||||
pcm_volume_dither() + PCM_VOLUME_1 / 2)
|
||||
/ PCM_VOLUME_1;
|
||||
|
||||
*buffer1++ = pcm_range(sample1, 24);
|
||||
--num_samples;
|
||||
|
|
|
@ -34,7 +34,8 @@ pcm_volume_change_8(int8_t *buffer, unsigned num_samples, int volume)
|
|||
while (num_samples > 0) {
|
||||
int32_t sample = *buffer;
|
||||
|
||||
sample = (sample * volume + pcm_dither() + PCM_VOLUME_1 / 2)
|
||||
sample = (sample * volume + pcm_volume_dither() +
|
||||
PCM_VOLUME_1 / 2)
|
||||
/ PCM_VOLUME_1;
|
||||
|
||||
*buffer++ = pcm_range(sample, 8);
|
||||
|
@ -48,7 +49,8 @@ pcm_volume_change_16(int16_t *buffer, unsigned num_samples, int volume)
|
|||
while (num_samples > 0) {
|
||||
int32_t sample = *buffer;
|
||||
|
||||
sample = (sample * volume + pcm_dither() + PCM_VOLUME_1 / 2)
|
||||
sample = (sample * volume + pcm_volume_dither() +
|
||||
PCM_VOLUME_1 / 2)
|
||||
/ PCM_VOLUME_1;
|
||||
|
||||
*buffer++ = pcm_range(sample, 16);
|
||||
|
@ -62,7 +64,8 @@ pcm_volume_change_24(int32_t *buffer, unsigned num_samples, int volume)
|
|||
while (num_samples > 0) {
|
||||
int64_t sample = *buffer;
|
||||
|
||||
sample = (sample * volume + pcm_dither() + PCM_VOLUME_1 / 2)
|
||||
sample = (sample * volume + pcm_volume_dither() +
|
||||
PCM_VOLUME_1 / 2)
|
||||
/ PCM_VOLUME_1;
|
||||
|
||||
*buffer++ = pcm_range(sample, 24);
|
||||
|
|
|
@ -41,7 +41,7 @@ pcm_float_to_volume(float volume)
|
|||
}
|
||||
|
||||
static inline int
|
||||
pcm_dither(void)
|
||||
pcm_volume_dither(void)
|
||||
{
|
||||
static unsigned long state;
|
||||
uint32_t r;
|
||||
|
|
Loading…
Reference in New Issue