[FFmpeg-devel] PATCH libswscale yuv2rgbtst infastructure

Michael Niedermayer michaelni
Tue May 1 18:35:52 CEST 2007


Hi

On Tue, May 01, 2007 at 09:36:24AM -0400, Marc Hoffman wrote:
[...]
>  > 
>  > 
>  > > +#include "rgb2rgb.h"
>  > > +
>  > > +#define ACCL (SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN)
>  > 
>  > hmm
> 
> ? how do I do this better than?  I thought about just setting the
> flags to 0 but that doesn't seem right.

ive not thought about how to do it properly ...
its just clear that 
SWS_CPU_CAPS_ALTIVEC and MMX amongth others at th same time cant be correct


> 
>  > 
>  > 
>  > > +#define NITERS 10
>  > > +
>  > > +
>  > > +#if defined(__MINGW32__) || defined(CONFIG_OS2)
>  > > +static int64_t getutime(void)
>  > > +{
>  > > +    return av_gettime();
>  > > +}
>  > > +#else
>  > > +static int64_t getutime(void)
>  > > +{
>  > > +    struct rusage rusage;
>  > > +
>  > > +    getrusage(RUSAGE_SELF, &rusage);
>  > > +    return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec;
>  > > +}
>  > > +#endif
>  > 
>  > by how much does variance decrease if rusage.ru_utime is used?
>  > if you dont know or its not much then please remove this
> 
> so are you saying just use av_gettime?

iam saying use a standard functiom which is always available
(like av_gettime()) or provide some arguments why a non standard function
is worth the extra code ...


[...]
>  > > +
>  > > +    exit (0);
>  > 
>  > return 0
> done.
> 
> I'm also thinking that we should check this
> 
>     sws->flags |=  ACCL;
>     csc_accl =  yuv2rgb_get_func_ptr (sws);
>     sws->flags &=  ~(ACCL);
>     csc_c    =  yuv2rgb_get_func_ptr (sws);
> 
> +    if (csc_c == csc_accl) {
> +       av_log (0,0, "%s: no accelerator found\n", sws_format_name (c->dstFormat))
> +       return 0;
> +    }
> 
>     csc_accl(sws, src, strides, 0, h   , dst, dstrides);
>     csc_c   (sws, src, strides, 0, h   , ref, dstrides);
> 
> What do you think?

good idea

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070501/59fc3968/attachment.pgp>



More information about the ffmpeg-devel mailing list