[FFmpeg-devel] [PATCH]HE-AACv1 try 3 (all missing functionality added)
Måns Rullgård
mans
Sun Feb 14 15:31:55 CET 2010
Michael Niedermayer <michaelni at gmx.at> writes:
> On Sat, Feb 13, 2010 at 05:24:21PM +0000, M?ns Rullg?rd wrote:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>>
>> > On Sat, Feb 13, 2010 at 05:31:59PM +0100, Vitor Sessak wrote:
>> > [...]
>> >>> +
>> >>> +static void vector_fmul_scalar_fadd_scalar_c(float *dst, const float
>> >>> *src,
>> >>> + float mul, float add, int
>> >>> len)
>> >>> +{
>> >>> + int i;
>> >>> + for (i = 0; i < len; i++)
>> >>> + dst[i] = src[i] * mul + add;
>> >>> +}
>> >>> +
>> >>
>> >> Did you benchmark if hand-unrolling these loops give any benefit? You know
>> >> that len is a multiple of four, but the compiler don't.
>> >
>> > assert(len>0 && len%4==0);
>> > then the compiler knows it too :)
>>
>> Only if you compile with asserts enabled, which will slow things down
>> immensely in code like this.
>>
>> > and after you looked at what gcc generates if forced to unroll
>> > (theres a flag for that IIRC)
>> > then post a code pessimization bug to the gcc-devels
>> > -> only way to see gcc get better at these things
>>
>> What we need is a "soft assert" whereby we can tell the compiler
>> things we know to be true without any code being generated for it.
>> Some compilers have that already.
>
> a preprocessor could turn an assert() when disabled into a "soft assert"
That would contradict the C spec.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list