[FFmpeg-devel] [PATCH 02/12] Add fill_float to dsputil

Måns Rullgård mans
Tue Sep 29 17:20:48 CEST 2009


Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:

> On Sun, Sep 27, 2009 at 11:49:18AM +0100, Mans Rullgard wrote:
>> ---
>>  libavcodec/dsputil.c |    7 +++++++
>>  libavcodec/dsputil.h |    1 +
>>  2 files changed, 8 insertions(+), 0 deletions(-)
>> 
>> diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
>> index 16f2d25..2ffb1ba 100644
>> --- a/libavcodec/dsputil.c
>> +++ b/libavcodec/dsputil.c
>> @@ -4055,6 +4055,12 @@ WRAPPER8_16_SQ(quant_psnr8x8_c, quant_psnr16_c)
>>  WRAPPER8_16_SQ(rd8x8_c, rd16_c)
>>  WRAPPER8_16_SQ(bit8x8_c, bit16_c)
>>  
>> +static void fill_float_c(float *dst, float v, int n)
>> +{
>> +    while (n--)
>> +        *dst++ = v;
>> +}

[...]

>> @@ -385,6 +385,7 @@ typedef struct DSPContext {
>>      void (*ac3_downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len);
>>      /* no alignment needed */
>>      void (*flac_compute_autocorr)(const int32_t *data, int len, int lag, double *autoc);
>> +    void (*fill_float)(float *dst, float v, int n);
>>      /* assume len is a multiple of 8, and arrays are 16-byte aligned */
>>      void (*vector_fmul)(float *dst, const float *src, int len);
>>      void (*vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len);
>
> I'm not sure if a fill_uint32 wouldn't be better, since it is more
> versatile and maybe even faster/easier to SIMGify (I seem to remember
> that I encountered a few other functions that implement their own 32 bit
> fill, but maybe I imagine it).

I also have the feeling I've seen that somewhere, but I couldn't find
it by searching for the obvious patterns.  For an asm implementation,
the declared type of the argument shouldn't really make much
difference.

> Of course it would be a bit uglier to use...

In the case at hand, Michael wanted it inlined anyway, so the
discussion is moot as far as wma is concerned..

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list