[PATCH] Implement Fortemedia SMA processing.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-01-06 01:32, Alban Browaeys wrote:
>  From 853a4d96bf2624ef30f86cf4819382949d039c87 Mon Sep 17 00:00:00 2001
> From: Alban Browaeys<prahal at yahoo.com>
> Date: Wed, 5 Jan 2011 17:13:04 +0100
> Subject: [PATCH] Implement Fortemedia SMA processing.
>
> Those small array microphones returns two channels of opposite
> phase thus the default remap in pulseaudio doing the sum output
> silence.

Sounds very useful, but...

> +void pa_fmaudiosma_run(pa_fmaudiosma *fs, const uint8_t *rec, uint8_t *out, int n) {
> +    unsigned i;
> +
> +    float *d, *s;
> +    int n_frames = n / (sizeof(float) *  2);
> +    memset(out, 0, n_frames * sizeof (float) * 2);
> +
> +    d = (float *)out;
> +    s = (float *)rec;
> +    for (i = n_frames; i>  0; i--, s += 2, d += 2)
> +	d[0] = d[1] = s[0] - (s[0] + s[1]);

"s[0] - (s[0] + s[1])" can be simplified to "-s[1]", unless my junior 
high math fails me completely. Are you sure you don't mean "s[0] - s[1]"?

-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux