Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76521 - mplayer-1.0_pre6 has no amd64 optimisation (libavcodec)
Summary: mplayer-1.0_pre6 has no amd64 optimisation (libavcodec)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-03 07:55 UTC by Grégoire Favre
Modified: 2005-01-11 13:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grégoire Favre 2005-01-03 07:55:00 UTC
The libavcodec that come with mplayer is not the one we could find in the CVS which has amd64 asm optimisation (speed improvment of about 120% or even more depending on the test: really great).

Reproducible: Always
Steps to Reproduce:
1.Do a mencoder of a file with the mplayer from the ebuild and watch the fps (in my current test 24 fps)
2.Do the same with mencoder build from CVS of libavcodec and see the fps (in my current case 72 fps YES !!!)




Well, I don't think I really need to paste info about it...
Comment 1 Craig Chasseur 2005-01-03 16:12:40 UTC
Interestingly, when emerging mplayer-1.0_pre6 on amd64, if you change the config.mak file so that the optimization lines read as follows:

TARGET_ARCH_X86_64 = yes
TARGET_WIN32 = no
TARGET_CPU=x86_64
TARGET_MMX = yes
TARGET_MMX2 = yes
TARGET_3DNOW = yes
TARGET_3DNOWEX = yes
TARGET_SSE = yes
TARGET_ALTIVEC = no

And also change config.h to include:

#define HAVE_3DNOW 1
#define HAVE_3DNOWEX 1
#define HAVE_MMX 1
#define HAVE_MMX2 1
#define HAVE_SSE 1
#define HAVE_SSE2 1

Then mplayer builds with support for all relevant SIMD assembly. On my system (dual opteron 244) it is stable and provides a VAST speed improvement over the pure C implementation of mplayer/libavcodec.

I should note that I do have 3dnow, 3dnowex, mmx, mmx2, sse, sse2 all in my use flags, so theoretically the ebuild for mplayer-1.0_pre6 should enable these features in the $myconf variable that is passed to the configure script. However, whenever I run ACCEPT_KEYWORDS="~amd64" emerge mplayer, I wind up with a config that has the optimizations disabled. Running ./configure --enable-mmx --enable-mmx2 --enable-3dnow --enable-3dnowex --enable-sse from inside the source directory produces a config that has the optimizations enabled, however.

Is there some sort of logic in portage that only pays attention to the mmx/sse/3dnow/etc. USE flags if the arch is i386? If so, we really ought to change that, since more and more developers are introducing asm optimizations that are compatible with amd64 as well.
Comment 2 Craig Chasseur 2005-01-03 16:19:09 UTC
I should mention that, in the above case, where I successfully compile mplayer with optimizations, mplayer reports the following on startup:

"Cannot test OS support for SSE, disabling to be safe."

Of course, Linux on amd64 supports sse just fine, so if anyone knows why this is happening, I'd be much obliged if they let me know.
Comment 3 Chris White (RETIRED) gentoo-dev 2005-01-03 20:47:58 UTC
Looks like mplayer needs package.mask-ing removed for amd64 arch for sse, mmx, mmx2, and 3dnow stuff.  They'll need to handle that one.
Comment 4 Danny van Dyk (RETIRED) gentoo-dev 2005-01-11 13:43:36 UTC
Nope. AMD64 Team decided that all packages that support amd64-SIMD assembler
will be enabled to use that assembler by default.

Nobody will need to enable USE="sse mmx" or similar on amd64:
a) that code _will_ be used nonetheless.
b) those flags are and will be use.masked.

FIXED