"Nemosoft Unv." wrote: > On 31-May-01 Ben Bridgwater wrote: > > The way I've structured it is to allow for individual optimized > > conversions, so > > any of my C implementations could be individually replaced with > > MMX/whatever > > implementations). Since this is intended for use with repeated (video) > > conversions, you first request a converter function (converter = > > GetConverter(imageDesc1, imageDesc2), which internally does a table lookup > > for a corresponding converter), and then use it to perform conversions > > (converter(imageDescIn, imageDescOut). > > A few questions beforehand: > - does your library have a dynamic list of convertors, or just a huge matrix? It's just a static list right now. If you're thinking in terms of dynamically adding MMX converters only if the processor support them, then another way would be just to always add them to the list and put the smarts in the GetConverter() - return you an MMX/whatever accelerated converter if one exists and the machine supports it, else the default one (if it exists - most do). > - can you query all available convertors? There's no reason the application couldn't search the list of converters, but I've never had the need. Bear in mind that the image descriptors can be built dynamically (e.g. to match an XImage matching your display), so it's easy for example to ask for a converter that'll convert from a V4L format to your display format. - you don't have to search for it. > - how difficult would it be to make the selection of the optimized assembly > routines dynamic? That is, during initialization the right code for that > processor is put in the list; I would not want to build different libraries > for different processor subtypes (MMX, SSE, 3Dnow, etc), but rather one x86 > library that can be installed on all system. See above - I'd tend just to add them to the list and put the processor detection and smart selection into the GetConverter() routine. Bear in mind that I don't have any MMX converters right now, although of course there are many around (e.g. from SDL, Hermes, the DVD/AVI players etc) that could be added. > I picked the x86 platform because that´s where I work on (and program in > assembly as well), but is this the only one that has these kind of > extensions? Maybe the 68000 CPUs have this? 68000 doesn't, but PowerPC has Altivec, and SPARC has VIS. Ben