[FFmpeg-devel] cavs.c DECLARE_ALIGNED in ff_cavs_filter
Stefan Gehrer
stefan.gehrer
Mon Feb 15 17:39:06 CET 2010
Stefan Gehrer wrote:
> Hi,
>
> Reimar D?ffinger wrote:
>> Hello,
>> currently there is this code in cavs.c:
>> DECLARE_ALIGNED_8(uint8_t, bs[8]);
>> The reason for it is that kind of code:
>>> *((uint64_t *)bs) = 0x0202020202020202ULL;
>>> if( *((uint64_t *)bs) ) {
>>
>> I thought of "solving" this via a union, but is this code really this
>> speed critical that we need such a mess?
>
> My impression is that in lavc code that is on the macroblock level
> or smaller units is usually considered speed-critical enough to
> make such things acceptable.
>
>> Can't we just use memset for the writes and e.g. AV_RN64 for the read?
I benchmarked it (on x86) to not make a difference, so I
followed Reimar's suggestion to use memset and AV_RN64.
Stefan
More information about the ffmpeg-devel
mailing list