[FFmpeg-devel] [PATCH 2/2] Add SIPR decoder for 5k0, 6k5 and 8k5 modes

Michael Niedermayer michaelni
Wed Dec 30 23:41:08 CET 2009


On Mon, Dec 28, 2009 at 11:32:56PM +0100, Vitor Sessak wrote:
> Michael Niedermayer wrote:
>> On Mon, Dec 21, 2009 at 03:43:02PM +0100, Vitor Sessak wrote:
>>   
>>> Michael Niedermayer wrote:
>>>     
>>>> On Sat, Dec 19, 2009 at 03:17:37PM +0100, Vitor Sessak wrote:
>>>>       
>>>>> Michael Niedermayer wrote:
>>>>>         
>>>>>> On Fri, Dec 18, 2009 at 06:07:45PM +0100, Vitor Sessak wrote:
>>>>>>           
>>>>>>> Diego Biurrun wrote:
>>>>>>>             
>>>>>>>> On Fri, Dec 18, 2009 at 05:52:13PM +0100, Vitor Sessak wrote:
>>>>>>>>               
>>>>>
>
> [...]
>
>>>>> +static void lsp2lpc_sipr(const double *isp, float *Az)
>>>>> +{
>>>>> +    int lp_half_order = LP_FILTER_ORDER >> 1;
>>>>> +    double pa[lp_half_order+1], qa[lp_half_order];
>>>>> +    int i,j;
>>>>> +
>>>>> +    ff_lsp2polyf(isp    , pa, lp_half_order    );
>>>>> +    ff_lsp2polyf(isp + 1, qa, lp_half_order - 1);
>>>>> +
>>>>>         
>>
>>   
>>>>> +    for (i = lp_half_order-1; i > 1; i--)
>>>>> +        qa[i] -= qa[i-2];
>>>>> +
>>>>> +    for (i = 1, j = LP_FILTER_ORDER - 1; i < lp_half_order; i++, j--) 
>>>>> {
>>>>> +        float paf = (pa[i] + qa[i]) * 0.5;
>>>>> +        float qaf = (pa[i] - qa[i]) * 0.5;
>>>>> +
>>>>> +        Az[i-1]  = paf + qaf * isp[LP_FILTER_ORDER - 1];
>>>>> +        Az[j-1]  = qaf + paf * isp[LP_FILTER_ORDER - 1];
>>>>>         
>>
>>     paf=  pa[i]           *(1+isp[LP_FILTER_ORDER - 1]);
>>     qaf= (qa[i] - qa[i-2])*(1-isp[LP_FILTER_ORDER - 1]);
>>     Az[i-1]  = (paf + qaf)*0.5;
>>     Az[j-1]  = (paf - qaf)*0.5;
>>   
>
> done as suggested.
>
>> btw what value does isp[LP_FILTER_ORDER - 1] have?
>> its not 1 or -1 or something trivial ?
>>   
>
> no :(
>
> New patch attached, together with Diego's cosmetics.
[...]
> +#define L_INTERPOL       11
> +
> +#define LSFQ_DIFF_MIN    50.0
> +
> +#define LP_FILTER_ORDER  10
> +#define L_SUBFR_SIPR     48

these could benefit from doxy


[...]
> +typedef struct {
> +    AVCodecContext *avctx;
> +    DSPContext dsp;
> +
> +    SiprModeParam m;
> +    SiprMode mode;
> +

> +    float past_gain_pit;

pit? pitch? 


> +    float lsf_hist[LP_FILTER_ORDER];
> +
> +    float excitation[L_INTERPOL + PITCH_DELAY_MAX + 5*L_SUBFR_SIPR];
> +
> +    DECLARE_ALIGNED_16(float, synth_buf[LP_FILTER_ORDER + 5*L_SUBFR_SIPR + 6]);
> +
> +    float lsp_history[16];

you mix _history and _hist, please dont do this


> +    float gain_mem;
> +    float energy_history[4];

> +    float ymem[2];

some variables would benefit from doxy, this is one of them

ive no further comments, remaining review left to our celp experts

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091230/53a001f2/attachment.pgp>



More information about the ffmpeg-devel mailing list