[pulseaudio-discuss] [PATCH v2] resampler: Fix volume on downmix to mono

David Henningsson david.henningsson at canonical.com
Wed Aug 15 00:32:32 PDT 2012


On 08/09/2012 06:49 PM, Tanu Kaskinen wrote:
> On Thu, 2012-08-09 at 14:21 +0200, David Henningsson wrote:
>> Patch credit: kwanghui
>>
>> When downmixing to mono, we should average the signal instead of
>> summing it to avoid clipping.
>
> I believe the "correct" thing to do is to sum when downmixing and to
> divide when upmixing. That won't help with the clipping problem in most
> cases, though. It would help when the downmixing follows upmixing, but I
> guess that pretty much never happens.
>
> So, I'm leaning towards agreeing with this patch.
>
>> @@ -759,12 +759,19 @@ static void calc_map_table(pa_resampler *r) {
>>                * best to pass it to L+R.
>>                */
>>
>> -            if (a == b || a == PA_CHANNEL_POSITION_MONO || b == PA_CHANNEL_POSITION_MONO) {
>> +            if (a == b || a == PA_CHANNEL_POSITION_MONO) {
>>                   m->map_table_f[oc][ic] = 1.0;
>>
>>                   oc_connected = TRUE;
>>                   ic_connected[ic] = TRUE;
>>               }
>> +            else if (b == PA_CHANNEL_POSITION_MONO) {
>> +                if(n_ic)
>
> Missing space.
>

Pushed (with space added). Thanks.


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


More information about the pulseaudio-discuss mailing list