[FFmpeg-devel] AMR-NB decoder

Michael Niedermayer michaelni
Sat Aug 8 20:53:57 CEST 2009


On Sat, Aug 08, 2009 at 04:09:39PM +0100, Colin McQuillan wrote:
> 2009/8/8 Michael Niedermayer <michaelni at gmx.at>:
> > On Fri, Aug 07, 2009 at 08:23:53PM +0100, Colin McQuillan wrote:
> >> 2009/8/6 Michael Niedermayer <michaelni at gmx.at>:
> >> > On Wed, Aug 05, 2009 at 05:51:36PM +0100, Colin McQuillan wrote:
> >> >> Attached is a patch for an AMR-NB decoder.
> 
> [...]
> 
> >> > that should e a seperate patch
> >>
> >> I'll leave this one until I investigate a version for sparse vectors. Attached:
> >>
> >> 1. Helper functions for gain control in floating-point codecs
> >> I couldn't find a similar fixed point function to copy the function name.
> >>
> >> 2. Floating-point version of ff_acelp_high_pass_filter
> >
> >> ?acelp_vectors.c | ? 22 ++++++++++++++++++++++
> >> ?acelp_vectors.h | ? 27 +++++++++++++++++++++++++++
> >> ?2 files changed, 49 insertions(+)
> >> f1abbee9b62c1779fd5fb1c634d4ab4294d8611d ?get-set-energyf.patch
> >> Index: libavcodec/acelp_vectors.c
> >> ===================================================================
> >> --- libavcodec/acelp_vectors.c ? ? ? ?(revision 19606)
> >> +++ libavcodec/acelp_vectors.c ? ? ? ?(working copy)
> >> @@ -155,3 +155,25 @@
> >> ? ? ? ? ?out[i] = weight_coeff_a * in_a[i]
> >> ? ? ? ? ? ? ? ? + weight_coeff_b * in_b[i];
> >> ?}
> >> +
> >> +float ff_energyf(const float *v, int length)
> >> +{
> >> + ? ?float sum = 0;
> >> + ? ?int i;
> >> +
> >> + ? ?for (i = 0; i < length; i++)
> >> + ? ? ? ?sum += v[i] * v[i];
> >> +
> >> + ? ?return sum;
> >> +}
> >
> > ff_dot_productf)(
> 
> Do you mean that ff_energyf is redundant? I've taken it out.

hmm well, as you say it that way, ff_energyf() could be faster due to
fewer mem reads, if that is te case in practice it could be kept


[...]
> Index: libavcodec/acelp_vectors.h
> ===================================================================
> --- libavcodec/acelp_vectors.h	(revision 19574)
> +++ libavcodec/acelp_vectors.h	(working copy)
> @@ -164,4 +164,22 @@
>  void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b,
>                               float weight_coeff_a, float weight_coeff_b, int length);
>  
> +/**
> + * Set the energy of a vector by scaling
> + *
> + * @param v_out output vector
> + * @param v_in vector to set energy of
> + * @param energy new energy

> + * @param length vectors length

i dont like how you use the term length here, the length of a vector is
something different



> + *
> + * @note If v is zero (or its energy underflows), the output is zero.
> + *       This is the behavior of AGC in the AMR reference decoder. The QCELP
> + *       reference decoder seems to have undefined behavior.
> + *
> + * TIA/EIA/IS-733 2.4.8.3-2/3/4/5, 2.4.8.6
> + * 3GPP TS 26.090 6.1 (6)
> + */
> +void ff_set_energyf(float *v_out, const float *v_in, float energy,
> +                    const int length);
> +
>  #endif /* AVCODEC_ACELP_VECTORS_H */


> Index: libavcodec/qcelpdec.c
> ===================================================================
> --- libavcodec/qcelpdec.c	(revision 19574)
> +++ libavcodec/qcelpdec.c	(working copy)

not maintained by me


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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- 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/20090808/b4f49a92/attachment.pgp>



More information about the ffmpeg-devel mailing list