[FFmpeg-devel] [PATCH 04/15] libavcodec/libavutil: Implementation of AAC_fixed_decoder (LC-module) [4/5]

Michael Niedermayer michaelni at gmx.at
Sun Nov 9 17:17:24 CET 2014


On Fri, Nov 07, 2014 at 04:08:08PM +0100, Nedeljko Babic wrote:
> From: Djordje Pesut <djordje.pesut at imgtec.com>
> 
> Add fixed point implementation
[...]

> diff --git a/libavutil/fixed_dsp.h b/libavutil/fixed_dsp.h
> index ff6f365..3035d19 100644
> --- a/libavutil/fixed_dsp.h
> +++ b/libavutil/fixed_dsp.h
> @@ -54,6 +54,25 @@
>  #include "libavcodec/mathops.h"
>  
>  typedef struct AVFixedDSPContext {
> +    /* assume len is a multiple of 16, and arrays are 32-byte aligned */
> +
> +    /**
> +     * Calculate the product of two vectors of integers and store the result in
> +     * a vector of integers.

vector_fmul works with fixed point numbers or scales down integers
it doesnt just multiply them


> +     *
> +     * @param dst  output vector
> +     *             constraints: 32-byte aligned
> +     * @param src0 first input vector
> +     *             constraints: 32-byte aligned
> +     * @param src1 second input vector
> +     *             constraints: 32-byte aligned
> +     * @param len  number of elements in the input
> +     *             constraints: multiple of 16
> +     */
> +    void (*vector_fmul)(int *dst, const int *src0, const int *src1,
> +                        int len);

this breaks ABI, new fields can only be added at the end


> +
> +    void (*vector_fmul_reverse)(int *dst, const int *src0, const int *src1, int len);
>      /**
>       * Overlap/add with window function.
>       * Used primarily by MDCT-based audio codecs.
> @@ -92,6 +111,40 @@ typedef struct AVFixedDSPContext {
>       */
>      void (*vector_fmul_window)(int32_t *dst, const int32_t *src0, const int32_t *src1, const int32_t *win, int len);
>  
> +    /**
> +     * Calculate the product of two vectors of integers, add a third vector of
> +     * integers and store the result in a vector of integers.
> +     *
> +     * @param dst  output vector
> +     *             constraints: 32-byte aligned
> +     * @param src0 first input vector
> +     *             constraints: 32-byte aligned
> +     * @param src1 second input vector
> +     *             constraints: 32-byte aligned
> +     * @param src1 third input vector
> +     *             constraints: 32-byte aligned
> +     * @param len  number of elements in the input
> +     *             constraints: multiple of 16
> +     */
> +    void (*vector_fmul_add)(int *dst, const int *src0, const int *src1,
> +                            const int *src2, int len);
> +

> +    /**
> +     * Calculate the scalar product of two vectors of floats.

floats ? scalarproduct_fixed?


> +     * @param v1  first vector, 16-byte aligned
> +     * @param v2  second vector, 16-byte aligned
> +     * @param len length of vectors, multiple of 4
> +     */
> +    int (*scalarproduct_fixed)(const int *v1, const int *v2, int len);


> +
> +    /**
> +     * Calculate the sum and difference of two vectors of integers.
> +     *
> +     * @param v1  first input vector, sum output, 16-byte aligned
> +     * @param v2  second input vector, difference output, 16-byte aligned
> +     * @param len length of vectors, multiple of 4
> +     */
> +    void (*butterflies_fixed)(int *av_restrict v1, int *av_restrict v2, int len);
>  } AVFixedDSPContext;
>  
>  /**
> -- 
> 1.8.2.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141109/4f593128/attachment.asc>


More information about the ffmpeg-devel mailing list