From: Takashi Iwai <tiwai@suse.de>
To: Niklas Werner <bergtroll@gmx.li>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: usb-audio
Date: Thu, 30 Oct 2003 20:46:42 +0100 [thread overview]
Message-ID: <s5hoevywlst.wl@alsa2.suse.de> (raw)
In-Reply-To: <200310301342.14872.bergtroll@gmx.li>
[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]
At Thu, 30 Oct 2003 13:42:14 +0100,
Niklas Werner wrote:
>
> Am Donnerstag, 30. Oktober 2003 13:17 schrieb Takashi Iwai:
> > At Wed, 29 Oct 2003 23:26:07 +0100,
> >
> > Niklas Werner wrote:
> > > Am Mittwoch, 29. Oktober 2003 19:24 wurde geschrieben:
> > > > At Tue, 28 Oct 2003 20:18:35 +0100,
> > > >
> > > >
> > > > hmm, it seems that a wrong label is used. the label should be
> > > > conv_xx12_xx21 (= conv_labels[35]). something is really broken.
> > > >
> > > > could you check stepwise the loop there?
> > >
> > > still checking (any tips on speeding this up (I'm trying "step 80000"
> > > atm?), seems to happen after the first set of frames (=16384) is
> > > processed.
> >
> > in the first process, did it go to conv_xx12_xx21 properly?
>
> nope:
>
> 0x0fd422f4 184 goto *conv;
> (gdb) si
> 299 conv_1234_xx21: as_u16(dst) = bswap_16(as_u32c(src) >> 16); goto
hmm, really weird.
meanwhile, i rewrote snd_pcm_linear_convert() without goto trick.
could you try the attached patch?
Takashi
[-- Attachment #2: pcm_linear_flatten.dif --]
[-- Type: application/octet-stream, Size: 20401 bytes --]
Index: alsa-lib/src/pcm/pcm_linear.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-lib/src/pcm/pcm_linear.c,v
retrieving revision 1.41
diff -u -r1.41 pcm_linear.c
--- alsa-lib/src/pcm/pcm_linear.c 25 Jul 2003 16:56:36 -0000 1.41
+++ alsa-lib/src/pcm/pcm_linear.c 30 Oct 2003 19:41:54 -0000
@@ -157,37 +157,396 @@
}
}
+#define as_u8(ptr) (*(u_int8_t*)(ptr))
+#define as_u16(ptr) (*(u_int16_t*)(ptr))
+#define as_u32(ptr) (*(u_int32_t*)(ptr))
+#define as_u64(ptr) (*(u_int64_t*)(ptr))
+#define as_s8(ptr) (*(int8_t*)(ptr))
+#define as_s16(ptr) (*(int16_t*)(ptr))
+#define as_s32(ptr) (*(int32_t*)(ptr))
+#define as_s64(ptr) (*(int64_t*)(ptr))
+#define as_float(ptr) (*(float_t*)(ptr))
+#define as_double(ptr) (*(double_t*)(ptr))
+
+#define as_u8c(ptr) (*(const u_int8_t*)(ptr))
+#define as_u16c(ptr) (*(const u_int16_t*)(ptr))
+#define as_u32c(ptr) (*(const u_int32_t*)(ptr))
+#define as_u64c(ptr) (*(const u_int64_t*)(ptr))
+#define as_s8c(ptr) (*(const int8_t*)(ptr))
+#define as_s16c(ptr) (*(const int16_t*)(ptr))
+#define as_s32c(ptr) (*(const int32_t*)(ptr))
+#define as_s64c(ptr) (*(const int64_t*)(ptr))
+#define as_floatc(ptr) (*(const float_t*)(ptr))
+#define as_doublec(ptr) (*(const double_t*)(ptr))
+
+#define l_conv_xxx1_xxx1 (as_u8(dst) = as_u8c(src))
+#define l_conv_xxx1_xx10 (as_u16(dst) = (u_int16_t)as_u8c(src) << 8)
+#define l_conv_xxx1_xx01 (as_u16(dst) = (u_int16_t)as_u8c(src))
+#define l_conv_xxx1_x100 (as_u32(dst) = (u_int32_t)as_u8c(src))
+#define l_conv_xxx1_001x (as_u32(dst) = (u_int32_t)as_u8c(src) << 8)
+#define l_conv_xxx1_1000 (as_u32(dst) = (u_int32_t)as_u8c(src) << 24)
+#define l_conv_xxx1_0001 (as_u32(dst) = (u_int32_t)as_u8c(src))
+#define l_conv_xxx1_xxx9 (as_u8(dst) = as_u8c(src) ^ 0x80)
+#define l_conv_xxx1_xx90 (as_u16(dst) = (u_int16_t)(as_u8c(src) ^ 0x80) << 8)
+#define l_conv_xxx1_xx09 (as_u16(dst) = (u_int16_t)(as_u8c(src) ^ 0x80))
+#define l_conv_xxx1_x900 (as_u32(dst) = (u_int32_t)(as_u8c(src) ^ 0x80) << 16)
+#define l_conv_xxx1_009x (as_u32(dst) = (u_int32_t)(as_u8c(src) ^ 0x80) << 8)
+#define l_conv_xxx1_9000 (as_u32(dst) = (u_int32_t)(as_u8c(src) ^ 0x80) << 24)
+#define l_conv_xxx1_0009 (as_u32(dst) = (u_int32_t)(as_u8c(src) ^ 0x80))
+#define l_conv_xx12_xxx1 (as_u8(dst) = as_u16c(src) >> 8)
+#define l_conv_xx12_xx12 (as_u16(dst) = as_u16c(src))
+#define l_conv_xx12_xx21 (as_u16(dst) = bswap_16(as_u16c(src)))
+#define l_conv_xx12_x120 (as_u32(dst) = (u_int32_t)as_u16c(src) << 8)
+#define l_conv_xx12_021x (as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src)) << 8)
+#define l_conv_xx12_1200 (as_u32(dst) = (u_int32_t)as_u16c(src) << 16)
+#define l_conv_xx12_0021 (as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src)))
+#define l_conv_xx12_xxx9 (as_u8(dst) = (as_u16c(src) >> 8) ^ 0x80)
+#define l_conv_xx12_xx92 (as_u16(dst) = as_u16c(src) ^ 0x8000)
+#define l_conv_xx12_xx29 (as_u16(dst) = bswap_16(as_u16c(src)) ^ 0x80)
+#define l_conv_xx12_x920 (as_u32(dst) = (u_int32_t)(as_u16c(src) ^ 0x8000) << 8)
+#define l_conv_xx12_029x (as_u32(dst) = (u_int32_t)(bswap_16(as_u16c(src)) ^ 0x80) << 8)
+#define l_conv_xx12_9200 (as_u32(dst) = (u_int32_t)(as_u16c(src) ^ 0x8000) << 16)
+#define l_conv_xx12_0029 (as_u32(dst) = (u_int32_t)(bswap_16(as_u16c(src)) ^ 0x80))
+#define l_conv_xx12_xxx2 (as_u8(dst) = as_u16c(src) & 0xff)
+#define l_conv_xx12_x210 (as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src)) << 8)
+#define l_conv_xx12_012x (as_u32(dst) = (u_int32_t)as_u16c(src) << 8)
+#define l_conv_xx12_2100 (as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src)) << 16)
+#define l_conv_xx12_0012 (as_u32(dst) = (u_int32_t)as_u16c(src))
+#define l_conv_xx12_xxxA (as_u8(dst) = (as_u16c(src) ^ 0x80) & 0xff)
+#define l_conv_xx12_xxA1 (as_u16(dst) = bswap_16(as_u16c(src) ^ 0x80))
+#define l_conv_xx12_xx1A (as_u16(dst) = as_u16c(src) ^ 0x80)
+#define l_conv_xx12_xA10 (as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src) ^ 0x80) << 8)
+#define l_conv_xx12_01Ax (as_u32(dst) = (u_int32_t)(as_u16c(src) ^ 0x80) << 8)
+#define l_conv_xx12_A100 (as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src) ^ 0x80) << 16)
+#define l_conv_xx12_001A (as_u32(dst) = (u_int32_t)(as_u16c(src) ^ 0x80))
+#define l_conv_x123_xxx1 (as_u8(dst) = as_u32c(src) >> 16)
+#define l_conv_x123_xx12 (as_u16(dst) = as_u32c(src) >> 8)
+#define l_conv_x123_xx21 (as_u16(dst) = bswap_16(as_u32c(src) >> 8))
+#define l_conv_x123_x123 (as_u32(dst) = as_u32c(src))
+#define l_conv_x123_321x (as_u32(dst) = bswap_32(as_u32c(src)))
+#define l_conv_x123_1230 (as_u32(dst) = as_u32c(src) << 8)
+#define l_conv_x123_0321 (as_u32(dst) = bswap_32(as_u32c(src)) >> 8)
+#define l_conv_x123_xxx9 (as_u8(dst) = (as_u32c(src) >> 16) ^ 0x80)
+#define l_conv_x123_xx92 (as_u16(dst) = (as_u32c(src) >> 8) ^ 0x8000)
+#define l_conv_x123_xx29 (as_u16(dst) = bswap_16(as_u32c(src) >> 8) ^ 0x80)
+#define l_conv_x123_x923 (as_u32(dst) = as_u32c(src) ^ 0x800000)
+#define l_conv_x123_329x (as_u32(dst) = bswap_32(as_u32c(src)) ^ 0x8000)
+#define l_conv_x123_9230 (as_u32(dst) = (as_u32c(src) ^ 0x800000) << 8)
+#define l_conv_x123_0329 (as_u32(dst) = (bswap_32(as_u32c(src)) >> 8) ^ 0x80)
+#define l_conv_123x_xxx3 (as_u8(dst) = (as_u32c(src) >> 8) & 0xff)
+#define l_conv_123x_xx32 (as_u16(dst) = bswap_16(as_u32c(src) >> 8))
+#define l_conv_123x_xx23 (as_u16(dst) = (as_u32c(src) >> 8) & 0xffff)
+#define l_conv_123x_x321 (as_u32(dst) = bswap_32(as_u32c(src)))
+#define l_conv_123x_123x (as_u32(dst) = as_u32c(src))
+#define l_conv_123x_3210 (as_u32(dst) = bswap_32(as_u32c(src)) << 8)
+#define l_conv_123x_0123 (as_u32(dst) = as_u32c(src) >> 8)
+#define l_conv_123x_xxxB (as_u8(dst) = ((as_u32c(src) >> 8) & 0xff) ^ 0x80)
+#define l_conv_123x_xxB2 (as_u16(dst) = bswap_16((as_u32c(src) >> 8) ^ 0x80))
+#define l_conv_123x_xx2B (as_u16(dst) = ((as_u32c(src) >> 8) & 0xffff) ^ 0x80)
+#define l_conv_123x_xB21 (as_u32(dst) = bswap_32(as_u32c(src)) ^ 0x800000)
+#define l_conv_123x_12Bx (as_u32(dst) = as_u32c(src) ^ 0x8000)
+#define l_conv_123x_B210 (as_u32(dst) = bswap_32(as_u32c(src) ^ 0x8000) << 8)
+#define l_conv_123x_012B (as_u32(dst) = (as_u32c(src) >> 8) ^ 0x80)
+#define l_conv_1234_xxx1 (as_u8(dst) = as_u32c(src) >> 24)
+#define l_conv_1234_xx12 (as_u16(dst) = as_u32c(src) >> 16)
+#define l_conv_1234_xx21 (as_u16(dst) = bswap_16(as_u32c(src) >> 16))
+#define l_conv_1234_x123 (as_u32(dst) = as_u32c(src) >> 8)
+#define l_conv_1234_321x (as_u32(dst) = bswap_32(as_u32c(src)) << 8)
+#define l_conv_1234_1234 (as_u32(dst) = as_u32c(src))
+#define l_conv_1234_4321 (as_u32(dst) = bswap_32(as_u32c(src)))
+#define l_conv_1234_xxx9 (as_u8(dst) = (as_u32c(src) >> 24) ^ 0x80)
+#define l_conv_1234_xx92 (as_u16(dst) = (as_u32c(src) >> 16) ^ 0x8000)
+#define l_conv_1234_xx29 (as_u16(dst) = bswap_16(as_u32c(src) >> 16) ^ 0x80)
+#define l_conv_1234_x923 (as_u32(dst) = (as_u32c(src) >> 8) ^ 0x800000)
+#define l_conv_1234_329x (as_u32(dst) = (bswap_32(as_u32c(src)) ^ 0x80) << 8)
+#define l_conv_1234_9234 (as_u32(dst) = as_u32c(src) ^ 0x80000000)
+#define l_conv_1234_4329 (as_u32(dst) = bswap_32(as_u32c(src)) ^ 0x80)
+#define l_conv_1234_xxx4 (as_u8(dst) = as_u32c(src) & 0xff)
+#define l_conv_1234_xx43 (as_u16(dst) = bswap_16(as_u32c(src)))
+#define l_conv_1234_xx34 (as_u16(dst) = as_u32c(src) & 0xffff)
+#define l_conv_1234_x432 (as_u32(dst) = bswap_32(as_u32c(src)) >> 8)
+#define l_conv_1234_234x (as_u32(dst) = as_u32c(src) << 8)
+#define l_conv_1234_xxxC (as_u8(dst) = (as_u32c(src) & 0xff) ^ 0x80)
+#define l_conv_1234_xxC3 (as_u16(dst) = bswap_16(as_u32c(src) ^ 0x80))
+#define l_conv_1234_xx3C (as_u16(dst) = (as_u32c(src) & 0xffff) ^ 0x80)
+#define l_conv_1234_xC32 (as_u32(dst) = (bswap_32(as_u32c(src)) >> 8) ^ 0x800000)
+#define l_conv_1234_23Cx (as_u32(dst) = (as_u32c(src) ^ 0x80) << 8)
+#define l_conv_1234_C321 (as_u32(dst) = bswap_32(as_u32c(src) ^ 0x80))
+#define l_conv_1234_123C (as_u32(dst) = as_u32c(src) ^ 0x80)
+
+#define DEF_CONV(cname,convertor) \
+static void snd_pcm_linear_##cname(const char *src, char *dst, int src_step, int dst_step, int frames) \
+{ \
+ while (frames-- > 0) { \
+ convertor; \
+ src += src_step; \
+ dst += dst_step; \
+ }\
+}
+
+DEF_CONV(conv_xxx1_xxx1,l_conv_xxx1_xxx1);
+DEF_CONV(conv_xxx1_xx10,l_conv_xxx1_xx10);
+DEF_CONV(conv_xxx1_xx01,l_conv_xxx1_xx01);
+DEF_CONV(conv_xxx1_x100,l_conv_xxx1_x100);
+DEF_CONV(conv_xxx1_001x,l_conv_xxx1_001x);
+DEF_CONV(conv_xxx1_1000,l_conv_xxx1_1000);
+DEF_CONV(conv_xxx1_0001,l_conv_xxx1_0001);
+DEF_CONV(conv_xxx1_xxx9,l_conv_xxx1_xxx9);
+DEF_CONV(conv_xxx1_xx90,l_conv_xxx1_xx90);
+DEF_CONV(conv_xxx1_xx09,l_conv_xxx1_xx09);
+DEF_CONV(conv_xxx1_x900,l_conv_xxx1_x900);
+DEF_CONV(conv_xxx1_009x,l_conv_xxx1_009x);
+DEF_CONV(conv_xxx1_9000,l_conv_xxx1_9000);
+DEF_CONV(conv_xxx1_0009,l_conv_xxx1_0009);
+DEF_CONV(conv_xx12_xxx1,l_conv_xx12_xxx1);
+DEF_CONV(conv_xx12_xx12,l_conv_xx12_xx12);
+DEF_CONV(conv_xx12_xx21,l_conv_xx12_xx21);
+DEF_CONV(conv_xx12_x120,l_conv_xx12_x120);
+DEF_CONV(conv_xx12_021x,l_conv_xx12_021x);
+DEF_CONV(conv_xx12_1200,l_conv_xx12_1200);
+DEF_CONV(conv_xx12_0021,l_conv_xx12_0021);
+DEF_CONV(conv_xx12_xxx9,l_conv_xx12_xxx9);
+DEF_CONV(conv_xx12_xx92,l_conv_xx12_xx92);
+DEF_CONV(conv_xx12_xx29,l_conv_xx12_xx29);
+DEF_CONV(conv_xx12_x920,l_conv_xx12_x920);
+DEF_CONV(conv_xx12_029x,l_conv_xx12_029x);
+DEF_CONV(conv_xx12_9200,l_conv_xx12_9200);
+DEF_CONV(conv_xx12_0029,l_conv_xx12_0029);
+DEF_CONV(conv_xx12_xxx2,l_conv_xx12_xxx2);
+DEF_CONV(conv_xx12_x210,l_conv_xx12_x210);
+DEF_CONV(conv_xx12_012x,l_conv_xx12_012x);
+DEF_CONV(conv_xx12_2100,l_conv_xx12_2100);
+DEF_CONV(conv_xx12_0012,l_conv_xx12_0012);
+DEF_CONV(conv_xx12_xxxA,l_conv_xx12_xxxA);
+DEF_CONV(conv_xx12_xxA1,l_conv_xx12_xxA1);
+DEF_CONV(conv_xx12_xx1A,l_conv_xx12_xx1A);
+DEF_CONV(conv_xx12_xA10,l_conv_xx12_xA10);
+DEF_CONV(conv_xx12_01Ax,l_conv_xx12_01Ax);
+DEF_CONV(conv_xx12_A100,l_conv_xx12_A100);
+DEF_CONV(conv_xx12_001A,l_conv_xx12_001A);
+DEF_CONV(conv_x123_xxx1,l_conv_x123_xxx1);
+DEF_CONV(conv_x123_xx12,l_conv_x123_xx12);
+DEF_CONV(conv_x123_xx21,l_conv_x123_xx21);
+DEF_CONV(conv_x123_x123,l_conv_x123_x123);
+DEF_CONV(conv_x123_321x,l_conv_x123_321x);
+DEF_CONV(conv_x123_1230,l_conv_x123_1230);
+DEF_CONV(conv_x123_0321,l_conv_x123_0321);
+DEF_CONV(conv_x123_xxx9,l_conv_x123_xxx9);
+DEF_CONV(conv_x123_xx92,l_conv_x123_xx92);
+DEF_CONV(conv_x123_xx29,l_conv_x123_xx29);
+DEF_CONV(conv_x123_x923,l_conv_x123_x923);
+DEF_CONV(conv_x123_329x,l_conv_x123_329x);
+DEF_CONV(conv_x123_9230,l_conv_x123_9230);
+DEF_CONV(conv_x123_0329,l_conv_x123_0329);
+DEF_CONV(conv_123x_xxx3,l_conv_123x_xxx3);
+DEF_CONV(conv_123x_xx32,l_conv_123x_xx32);
+DEF_CONV(conv_123x_xx23,l_conv_123x_xx23);
+DEF_CONV(conv_123x_x321,l_conv_123x_x321);
+DEF_CONV(conv_123x_123x,l_conv_123x_123x);
+DEF_CONV(conv_123x_3210,l_conv_123x_3210);
+DEF_CONV(conv_123x_0123,l_conv_123x_0123);
+DEF_CONV(conv_123x_xxxB,l_conv_123x_xxxB);
+DEF_CONV(conv_123x_xxB2,l_conv_123x_xxB2);
+DEF_CONV(conv_123x_xx2B,l_conv_123x_xx2B);
+DEF_CONV(conv_123x_xB21,l_conv_123x_xB21);
+DEF_CONV(conv_123x_12Bx,l_conv_123x_12Bx);
+DEF_CONV(conv_123x_B210,l_conv_123x_B210);
+DEF_CONV(conv_123x_012B,l_conv_123x_012B);
+DEF_CONV(conv_1234_xxx1,l_conv_1234_xxx1);
+DEF_CONV(conv_1234_xx12,l_conv_1234_xx12);
+DEF_CONV(conv_1234_xx21,l_conv_1234_xx21);
+DEF_CONV(conv_1234_x123,l_conv_1234_x123);
+DEF_CONV(conv_1234_321x,l_conv_1234_321x);
+DEF_CONV(conv_1234_1234,l_conv_1234_1234);
+DEF_CONV(conv_1234_4321,l_conv_1234_4321);
+DEF_CONV(conv_1234_xxx9,l_conv_1234_xxx9);
+DEF_CONV(conv_1234_xx92,l_conv_1234_xx92);
+DEF_CONV(conv_1234_xx29,l_conv_1234_xx29);
+DEF_CONV(conv_1234_x923,l_conv_1234_x923);
+DEF_CONV(conv_1234_329x,l_conv_1234_329x);
+DEF_CONV(conv_1234_9234,l_conv_1234_9234);
+DEF_CONV(conv_1234_4329,l_conv_1234_4329);
+DEF_CONV(conv_1234_xxx4,l_conv_1234_xxx4);
+DEF_CONV(conv_1234_xx43,l_conv_1234_xx43);
+DEF_CONV(conv_1234_xx34,l_conv_1234_xx34);
+DEF_CONV(conv_1234_x432,l_conv_1234_x432);
+DEF_CONV(conv_1234_234x,l_conv_1234_234x);
+DEF_CONV(conv_1234_xxxC,l_conv_1234_xxxC);
+DEF_CONV(conv_1234_xxC3,l_conv_1234_xxC3);
+DEF_CONV(conv_1234_xx3C,l_conv_1234_xx3C);
+DEF_CONV(conv_1234_xC32,l_conv_1234_xC32);
+DEF_CONV(conv_1234_23Cx,l_conv_1234_23Cx);
+DEF_CONV(conv_1234_C321,l_conv_1234_C321);
+DEF_CONV(conv_1234_123C,l_conv_1234_123C);
+
+#undef as_u8
+#undef as_u16
+#undef as_u32
+#undef as_s8
+#undef as_s16
+#undef as_s32
+#undef as_float
+#undef as_double
+
+#undef as_u8c
+#undef as_u16c
+#undef as_u32c
+#undef as_s8c
+#undef as_s16c
+#undef as_s32c
+#undef as_floatc
+#undef as_doublec
+
+typedef void (*snd_pcm_linear_conv_t)(const char *, char *, int, int, int);
+static snd_pcm_linear_conv_t linear_conv_table[4 * 2 * 2 * 4 * 2] = {
+ snd_pcm_linear_conv_xxx1_xxx1, /* 8h -> 8h */
+ snd_pcm_linear_conv_xxx1_xxx1, /* 8h -> 8s */
+ snd_pcm_linear_conv_xxx1_xx10, /* 8h -> 16h */
+ snd_pcm_linear_conv_xxx1_xx01, /* 8h -> 16s */
+ snd_pcm_linear_conv_xxx1_x100, /* 8h -> 24h */
+ snd_pcm_linear_conv_xxx1_001x, /* 8h -> 24s */
+ snd_pcm_linear_conv_xxx1_1000, /* 8h -> 32h */
+ snd_pcm_linear_conv_xxx1_0001, /* 8h -> 32s */
+ snd_pcm_linear_conv_xxx1_xxx9, /* 8h ^> 8h */
+ snd_pcm_linear_conv_xxx1_xxx9, /* 8h ^> 8s */
+ snd_pcm_linear_conv_xxx1_xx90, /* 8h ^> 16h */
+ snd_pcm_linear_conv_xxx1_xx09, /* 8h ^> 16s */
+ snd_pcm_linear_conv_xxx1_x900, /* 8h ^> 24h */
+ snd_pcm_linear_conv_xxx1_009x, /* 8h ^> 24s */
+ snd_pcm_linear_conv_xxx1_9000, /* 8h ^> 32h */
+ snd_pcm_linear_conv_xxx1_0009, /* 8h ^> 32s */
+ snd_pcm_linear_conv_xxx1_xxx1, /* 8s -> 8h */
+ snd_pcm_linear_conv_xxx1_xxx1, /* 8s -> 8s */
+ snd_pcm_linear_conv_xxx1_xx10, /* 8s -> 16h */
+ snd_pcm_linear_conv_xxx1_xx01, /* 8s -> 16s */
+ snd_pcm_linear_conv_xxx1_x100, /* 8s -> 24h */
+ snd_pcm_linear_conv_xxx1_001x, /* 8s -> 24s */
+ snd_pcm_linear_conv_xxx1_1000, /* 8s -> 32h */
+ snd_pcm_linear_conv_xxx1_0001, /* 8s -> 32s */
+ snd_pcm_linear_conv_xxx1_xxx9, /* 8s ^> 8h */
+ snd_pcm_linear_conv_xxx1_xxx9, /* 8s ^> 8s */
+ snd_pcm_linear_conv_xxx1_xx90, /* 8s ^> 16h */
+ snd_pcm_linear_conv_xxx1_xx09, /* 8s ^> 16s */
+ snd_pcm_linear_conv_xxx1_x900, /* 8s ^> 24h */
+ snd_pcm_linear_conv_xxx1_009x, /* 8s ^> 24s */
+ snd_pcm_linear_conv_xxx1_9000, /* 8s ^> 32h */
+ snd_pcm_linear_conv_xxx1_0009, /* 8s ^> 32s */
+ snd_pcm_linear_conv_xx12_xxx1, /* 16h -> 8h */
+ snd_pcm_linear_conv_xx12_xxx1, /* 16h -> 8s */
+ snd_pcm_linear_conv_xx12_xx12, /* 16h -> 16h */
+ snd_pcm_linear_conv_xx12_xx21, /* 16h -> 16s */
+ snd_pcm_linear_conv_xx12_x120, /* 16h -> 24h */
+ snd_pcm_linear_conv_xx12_021x, /* 16h -> 24s */
+ snd_pcm_linear_conv_xx12_1200, /* 16h -> 32h */
+ snd_pcm_linear_conv_xx12_0021, /* 16h -> 32s */
+ snd_pcm_linear_conv_xx12_xxx9, /* 16h ^> 8h */
+ snd_pcm_linear_conv_xx12_xxx9, /* 16h ^> 8s */
+ snd_pcm_linear_conv_xx12_xx92, /* 16h ^> 16h */
+ snd_pcm_linear_conv_xx12_xx29, /* 16h ^> 16s */
+ snd_pcm_linear_conv_xx12_x920, /* 16h ^> 24h */
+ snd_pcm_linear_conv_xx12_029x, /* 16h ^> 24s */
+ snd_pcm_linear_conv_xx12_9200, /* 16h ^> 32h */
+ snd_pcm_linear_conv_xx12_0029, /* 16h ^> 32s */
+ snd_pcm_linear_conv_xx12_xxx2, /* 16s -> 8h */
+ snd_pcm_linear_conv_xx12_xxx2, /* 16s -> 8s */
+ snd_pcm_linear_conv_xx12_xx21, /* 16s -> 16h */
+ snd_pcm_linear_conv_xx12_xx12, /* 16s -> 16s */
+ snd_pcm_linear_conv_xx12_x210, /* 16s -> 24h */
+ snd_pcm_linear_conv_xx12_012x, /* 16s -> 24s */
+ snd_pcm_linear_conv_xx12_2100, /* 16s -> 32h */
+ snd_pcm_linear_conv_xx12_0012, /* 16s -> 32s */
+ snd_pcm_linear_conv_xx12_xxxA, /* 16s ^> 8h */
+ snd_pcm_linear_conv_xx12_xxxA, /* 16s ^> 8s */
+ snd_pcm_linear_conv_xx12_xxA1, /* 16s ^> 16h */
+ snd_pcm_linear_conv_xx12_xx1A, /* 16s ^> 16s */
+ snd_pcm_linear_conv_xx12_xA10, /* 16s ^> 24h */
+ snd_pcm_linear_conv_xx12_01Ax, /* 16s ^> 24s */
+ snd_pcm_linear_conv_xx12_A100, /* 16s ^> 32h */
+ snd_pcm_linear_conv_xx12_001A, /* 16s ^> 32s */
+ snd_pcm_linear_conv_x123_xxx1, /* 24h -> 8h */
+ snd_pcm_linear_conv_x123_xxx1, /* 24h -> 8s */
+ snd_pcm_linear_conv_x123_xx12, /* 24h -> 16h */
+ snd_pcm_linear_conv_x123_xx21, /* 24h -> 16s */
+ snd_pcm_linear_conv_x123_x123, /* 24h -> 24h */
+ snd_pcm_linear_conv_x123_321x, /* 24h -> 24s */
+ snd_pcm_linear_conv_x123_1230, /* 24h -> 32h */
+ snd_pcm_linear_conv_x123_0321, /* 24h -> 32s */
+ snd_pcm_linear_conv_x123_xxx9, /* 24h ^> 8h */
+ snd_pcm_linear_conv_x123_xxx9, /* 24h ^> 8s */
+ snd_pcm_linear_conv_x123_xx92, /* 24h ^> 16h */
+ snd_pcm_linear_conv_x123_xx29, /* 24h ^> 16s */
+ snd_pcm_linear_conv_x123_x923, /* 24h ^> 24h */
+ snd_pcm_linear_conv_x123_329x, /* 24h ^> 24s */
+ snd_pcm_linear_conv_x123_9230, /* 24h ^> 32h */
+ snd_pcm_linear_conv_x123_0329, /* 24h ^> 32s */
+ snd_pcm_linear_conv_123x_xxx3, /* 24s -> 8h */
+ snd_pcm_linear_conv_123x_xxx3, /* 24s -> 8s */
+ snd_pcm_linear_conv_123x_xx32, /* 24s -> 16h */
+ snd_pcm_linear_conv_123x_xx23, /* 24s -> 16s */
+ snd_pcm_linear_conv_123x_x321, /* 24s -> 24h */
+ snd_pcm_linear_conv_123x_123x, /* 24s -> 24s */
+ snd_pcm_linear_conv_123x_3210, /* 24s -> 32h */
+ snd_pcm_linear_conv_123x_0123, /* 24s -> 32s */
+ snd_pcm_linear_conv_123x_xxxB, /* 24s ^> 8h */
+ snd_pcm_linear_conv_123x_xxxB, /* 24s ^> 8s */
+ snd_pcm_linear_conv_123x_xxB2, /* 24s ^> 16h */
+ snd_pcm_linear_conv_123x_xx2B, /* 24s ^> 16s */
+ snd_pcm_linear_conv_123x_xB21, /* 24s ^> 24h */
+ snd_pcm_linear_conv_123x_12Bx, /* 24s ^> 24s */
+ snd_pcm_linear_conv_123x_B210, /* 24s ^> 32h */
+ snd_pcm_linear_conv_123x_012B, /* 24s ^> 32s */
+ snd_pcm_linear_conv_1234_xxx1, /* 32h -> 8h */
+ snd_pcm_linear_conv_1234_xxx1, /* 32h -> 8s */
+ snd_pcm_linear_conv_1234_xx12, /* 32h -> 16h */
+ snd_pcm_linear_conv_1234_xx21, /* 32h -> 16s */
+ snd_pcm_linear_conv_1234_x123, /* 32h -> 24h */
+ snd_pcm_linear_conv_1234_321x, /* 32h -> 24s */
+ snd_pcm_linear_conv_1234_1234, /* 32h -> 32h */
+ snd_pcm_linear_conv_1234_4321, /* 32h -> 32s */
+ snd_pcm_linear_conv_1234_xxx9, /* 32h ^> 8h */
+ snd_pcm_linear_conv_1234_xxx9, /* 32h ^> 8s */
+ snd_pcm_linear_conv_1234_xx92, /* 32h ^> 16h */
+ snd_pcm_linear_conv_1234_xx29, /* 32h ^> 16s */
+ snd_pcm_linear_conv_1234_x923, /* 32h ^> 24h */
+ snd_pcm_linear_conv_1234_329x, /* 32h ^> 24s */
+ snd_pcm_linear_conv_1234_9234, /* 32h ^> 32h */
+ snd_pcm_linear_conv_1234_4329, /* 32h ^> 32s */
+ snd_pcm_linear_conv_1234_xxx4, /* 32s -> 8h */
+ snd_pcm_linear_conv_1234_xxx4, /* 32s -> 8s */
+ snd_pcm_linear_conv_1234_xx43, /* 32s -> 16h */
+ snd_pcm_linear_conv_1234_xx34, /* 32s -> 16s */
+ snd_pcm_linear_conv_1234_x432, /* 32s -> 24h */
+ snd_pcm_linear_conv_1234_234x, /* 32s -> 24s */
+ snd_pcm_linear_conv_1234_4321, /* 32s -> 32h */
+ snd_pcm_linear_conv_1234_1234, /* 32s -> 32s */
+ snd_pcm_linear_conv_1234_xxxC, /* 32s ^> 8h */
+ snd_pcm_linear_conv_1234_xxxC, /* 32s ^> 8s */
+ snd_pcm_linear_conv_1234_xxC3, /* 32s ^> 16h */
+ snd_pcm_linear_conv_1234_xx3C, /* 32s ^> 16s */
+ snd_pcm_linear_conv_1234_xC32, /* 32s ^> 24h */
+ snd_pcm_linear_conv_1234_23Cx, /* 32s ^> 24s */
+ snd_pcm_linear_conv_1234_C321, /* 32s ^> 32h */
+ snd_pcm_linear_conv_1234_123C, /* 32s ^> 32s */
+};
+
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
unsigned int channels, snd_pcm_uframes_t frames,
unsigned int convidx)
{
-#define CONV_LABELS
-#include "plugin_ops.h"
-#undef CONV_LABELS
- void *conv = conv_labels[convidx];
unsigned int channel;
+ snd_pcm_linear_conv_t func = linear_conv_table[convidx];
for (channel = 0; channel < channels; ++channel) {
const char *src;
char *dst;
int src_step, dst_step;
- snd_pcm_uframes_t frames1;
const snd_pcm_channel_area_t *src_area = &src_areas[channel];
const snd_pcm_channel_area_t *dst_area = &dst_areas[channel];
src = snd_pcm_channel_area_addr(src_area, src_offset);
dst = snd_pcm_channel_area_addr(dst_area, dst_offset);
src_step = snd_pcm_channel_area_step(src_area);
dst_step = snd_pcm_channel_area_step(dst_area);
- frames1 = frames;
- while (frames1-- > 0) {
- goto *conv;
-#define CONV_END after
-#include "plugin_ops.h"
-#undef CONV_END
- after:
- src += src_step;
- dst += dst_step;
- }
+ func(src, dst, src_step, dst_step, frames);
}
}
next prev parent reply other threads:[~2003-10-30 19:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-27 18:03 usb-audio Antonio Willy Malara
2003-10-27 18:16 ` usb-audio Takashi Iwai
2003-10-27 19:53 ` usb-audio Antonio Willy Malara
2003-10-28 10:11 ` usb-audio Takashi Iwai
2003-10-28 10:41 ` usb-audio Niklas Werner
2003-10-28 11:10 ` usb-audio Takashi Iwai
2003-10-28 11:48 ` usb-audio Niklas Werner
2003-10-28 12:13 ` usb-audio Takashi Iwai
2003-10-28 12:42 ` usb-audio Niklas Werner
2003-10-28 13:28 ` usb-audio Takashi Iwai
2003-10-28 18:25 ` usb-audio Takashi Iwai
2003-10-28 19:18 ` usb-audio Niklas Werner
2003-10-29 18:24 ` usb-audio Takashi Iwai
2003-10-29 22:26 ` usb-audio Niklas Werner
2003-10-30 12:17 ` usb-audio Takashi Iwai
2003-10-30 12:42 ` usb-audio Niklas Werner
2003-10-30 19:46 ` Takashi Iwai [this message]
2003-10-31 8:23 ` usb-audio Niklas Werner
2003-10-31 11:02 ` usb-audio Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hoevywlst.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=bergtroll@gmx.li \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox