[FFmpeg-soc] [soc]: r1161 - qcelp/qcelpdec.c

Michael Niedermayer michaelni at gmx.at
Wed Aug 22 21:35:41 CEST 2007


Hi

On Wed, Aug 22, 2007 at 09:18:09PM +0200, reynaldo wrote:
> Author: reynaldo
> Date: Wed Aug 22 21:18:09 2007
> New Revision: 1161
> 
> Log:
> - Corrected some spec-not-clear-enough issues. Pitch filter/pre-filter
> need to be applyed on pitch-subframe steps. With this fixes we get RI
> compliant results but with an small (order 10^-5) drift when hammsinc
> gets used.
> 
[...]
> @@ -60,16 +60,16 @@ static int qcelp_decode_close(AVCodecCon
>  
>  static float qcelp_hammsinc(float i)
>  {
> -    return (sin(M_PI*i)/(M_PI*i))*(0.5+0.46*cos(M_PI*i/4));
> +    return (sin(M_PI*i)/(M_PI*i))*(0.5+0.46*cos(M_PI*i/4.0));
>  }

cosmetic


>  
> -static void qcelp_update_pitchf_mem(float *pitchf_mem, float last)
> +static void qcelp_update_pitchf_mem(float *pitchf_mem, float *last)
>  {
> -    float tmp[144];
> +    float tmp[150];
>  
> -    memcpy(tmp, pitchf_mem+1, 143*sizeof(float));
> -    pitchf_mem[143]=last;
> -    memcpy(pitchf_mem, tmp, 143*sizeof(float));
> +    memcpy(tmp, pitchf_mem+40, 110*sizeof(float));
> +    memcpy(tmp+110, last, 40*sizeof(float));
> +    memcpy(pitchf_mem, tmp, 150*sizeof(float));
>  }

see memmove()


[...]
> @@ -422,7 +422,7 @@ static int qcelp_do_pitchfilter(QCELPFra
>              pfrac=frame->data+QCELP_PFRAC0_POS;
>  
>              /**
> -             * Compute Gain & Lag
> +             * Compute Gain & Lag for the whole frame
>               */
>  
>              for(i=0; i<4; i++)
> @@ -432,7 +432,7 @@ static int qcelp_do_pitchfilter(QCELPFra
>                  if(step == 2) /* become pitch pre-filter */
>                      gain[i]=0.5*FFMIN(gain[i],1.0);
>  
> -                lag[i]  =plag[i]+16;
> +                lag[i]=plag[i]+16;

hmm

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

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- 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-soc/attachments/20070822/e9a48b09/attachment.pgp>


More information about the FFmpeg-soc mailing list