[MPlayer-dev-eng] [PATCH] mp3lib: Align output so that movaps can be used instead of movups
Guillaume Poirier
gpoirier at mplayerhq.hu
Mon Jun 4 10:00:00 CEST 2007
Hi,
Zuxy Meng wrote:
> Hi,
>
> 2007/6/4, Alban Bedel <albeu at free.fr>:
>> On Mon, 4 Jun 2007 14:54:01 +0800
>> "Zuxy Meng" <zuxy.meng at gmail.com> wrote:
>>
>>>>> The attached patch aligns output address of dct64 functions to 16-byte
>>>>> boundary, so movaps can be used instead of movups in dct64_sse,
>>>>> resulting in 2.5% faster decode.
>>>> I think it's better to use DECLARE_ALIGNED_16() macros. If they aren't
>>>> available in mp3lib, then I think it's OK to add #include the relevant
>>>> file from lavc.
>>>>
>>>> If someone disagrees with this, please speak up!
>>> I did a grep and found that outside ffmpeg, mplayer uses
>>> __attribute__((aligned())) directly, as is the case for existing code
>>> in mp3lib (see dct64_k7.c for example).
>> I expected this :) MPlayer is full of various crap, the right solution is
>> evidently to fix the crap and not propagating it.
>
> OK I followed Guillaume's advice but got many warnings from
> libavcodec/dsputil.h:
> In file included from ../libavcodec/dsputil.h:33,
> from dct64_sse.c:8:
> ../libavcodec/avcodec.h:2501: warning: 'ImgReSampleContext' is deprecated
> ../libavcodec/avcodec.h:2507: warning: 'ImgReSampleContext' is deprecated
> In file included from dct64_sse.c:8:
> ../libavcodec/dsputil.h: In function 'copy_block2':
> ../libavcodec/dsputil.h:683: warning: implicit declaration of function 'ST16'
> ../libavcodec/dsputil.h:683: warning: implicit declaration of function 'LD16'
> ../libavcodec/dsputil.h: In function 'copy_block4':
> ../libavcodec/dsputil.h:694: warning: implicit declaration of function 'ST32'
> ../libavcodec/dsputil.h:694: warning: implicit declaration of function 'LD32'
>
> I don't know if it's desirable.
No, I don't think it is. Please include libavutil/mem.h and use
DECLARE_ALIGNED(a,b,c), and that should do it.
Alternatively, maybe DECLARE_ALIGNED_16() and friends should be moved
to a different, separate include, but that's probably overkill.
Guillaume
More information about the MPlayer-dev-eng
mailing list