notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new code to collect/use more stats, some debug tools
[picodrive.git]
/
Pico
/
sound
/
mix.c
diff --git
a/Pico/sound/mix.c
b/Pico/sound/mix.c
index
4d68f1d
..
c344fba
100644
(file)
--- a/
Pico/sound/mix.c
+++ b/
Pico/sound/mix.c
@@
-1,3
+1,6
@@
+// some code for sample mixing
+// (c) Copyright 2006-2007, Grazvydas "notaz" Ignotas
+
#define MAXOUT (+32767)
#define MINOUT (-32768)
#define MAXOUT (+32767)
#define MINOUT (-32768)
@@
-39,16
+42,33
@@
void mix_32_to_16_mono(short *dest, int *src, int count)
}
}
-/* unimplemented... */
void mix_16h_to_32(int *dest_buf, short *mp3_buf, int count)
{
void mix_16h_to_32(int *dest_buf, short *mp3_buf, int count)
{
+ while (count--)
+ {
+ *dest_buf++ += *mp3_buf++ >> 1;
+ }
}
void mix_16h_to_32_s1(int *dest_buf, short *mp3_buf, int count)
{
}
void mix_16h_to_32_s1(int *dest_buf, short *mp3_buf, int count)
{
+ count >>= 1;
+ while (count--)
+ {
+ *dest_buf++ += *mp3_buf++ >> 1;
+ *dest_buf++ += *mp3_buf++ >> 1;
+ mp3_buf += 1*2;
+ }
}
void mix_16h_to_32_s2(int *dest_buf, short *mp3_buf, int count)
{
}
void mix_16h_to_32_s2(int *dest_buf, short *mp3_buf, int count)
{
+ count >>= 1;
+ while (count--)
+ {
+ *dest_buf++ += *mp3_buf++ >> 1;
+ *dest_buf++ += *mp3_buf++ >> 1;
+ mp3_buf += 3*2;
+ }
}
}