[FFmpeg-soc] [PATCH] AMR-WB Decoder

Vitor Sessak vitor1001 at gmail.com
Fri Sep 3 10:19:09 CEST 2010


On 08/30/2010 02:31 PM, Vitor Sessak wrote:
> On 08/27/2010 11:13 PM, Marcelo Galvão Póvoa wrote:
>> On 26 August 2010 18:55, Vitor Sessak<vitor1001 at gmail.com>  wrote:
>>> Marcelo Galvão Póvoa wrote:


[...]

>>>> +/**
>>>> + * Apply to synthesis a 2nd order high-pass filter
>>>> + *
>>>> + * @param[out] out                 Buffer for filtered output
>>>> + * @param[in] hpf_coef             Filter coefficients as used below
>>>> + * @param[in,out] mem              State from last filtering 
>>>> (updated)
>>>> + * @param[in] in                   Input speech data
>>>> + *
>>>> + * @remark It is safe to pass the same array in in and out parameters
>>>> + */
>>>> +static void high_pass_filter(float *out, const float hpf_coef[2][3],
>>>> +                             float mem[4], const float *in)
>>>> +{
>>>> +    int i;
>>>> +    float *x = mem - 1, *y = mem + 2; // previous inputs and outputs
>>>> +
>>>> +    for (i = 0; i<  AMRWB_SFR_SIZE; i++) {
>>>> +        float x0 = in[i];
>>>> +
>>>> +        out[i] = hpf_coef[0][0] * x0   + hpf_coef[1][0] * y[0] +
>>>> +                 hpf_coef[0][1] * x[1] + hpf_coef[1][1] * y[1] +
>>>> +                 hpf_coef[0][2] * x[2];
>>>> +
>>>> +        y[1] = y[0];
>>>> +        y[0] = out[i];
>>>> +
>>>> +        x[2] = x[1];
>>>> +        x[1] = x0;
>>>> +    }
>>>> +}
>>> acelp_filter.c:ff_acelp_apply_order_2_transfer_function()
>>>
>> Are you sure? I can't see them as equivalent, could you explain?
>
> I'll give a better look at it soon...

Try the attached patch, it practically does not change the output:

deus-23k85.awbstddev:    0.08 PSNR:118.01 MAXDIFF:    1 bytes:  
1054720/  1054720
seed-12k65.awbstddev:    0.06 PSNR:119.94 MAXDIFF:    1 bytes:   
327680/   327680
seed-14k25.awbstddev:    0.06 PSNR:119.59 MAXDIFF:    1 bytes:   
327680/   327680
seed-15k85.awbstddev:    0.06 PSNR:119.92 MAXDIFF:    1 bytes:   
327680/   327680
seed-18k25.awbstddev:    0.07 PSNR:119.32 MAXDIFF:    1 bytes:   
327680/   327680
seed-19k85.awbstddev:    0.07 PSNR:119.20 MAXDIFF:    1 bytes:   
327680/   327680
seed-23k05.awbstddev:    0.07 PSNR:119.35 MAXDIFF:    1 bytes:   
327680/   327680
seed-23k85.awbstddev:    0.07 PSNR:119.42 MAXDIFF:    1 bytes:   
327680/   327680
seed-6k60.awbstddev:    0.06 PSNR:119.61 MAXDIFF:    1 bytes:   
327680/   327680
seed-8k85.awbstddev:    0.07 PSNR:119.19 MAXDIFF:    1 bytes:   
327680/   327680

-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: highpass.diff
Type: text/x-patch
Size: 1430 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20100903/99969445/attachment.bin>


More information about the FFmpeg-soc mailing list