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

Nedeljko Babic Nedeljko.Babic at imgtec.com
Fri Nov 14 12:44:23 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
>

This is fixed point multiplication ...
Maybe it would be clearer if I put this in comment?

>
>> +     *
>> +     * @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
>

Should I order the fields in AVFixedDSPContext the be in the same order as fields
in AVFloatDSPContext (for the fields that are supported in both structures), or
sould I just add fields that are added with this patch to 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?
>

I forgot to change the pasted text... :) sorry...

>
>> +     * @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;
>>  


More information about the ffmpeg-devel mailing list