[FFmpeg-devel] [PATCH 1/5] add AV_CPU_FLAG_BFIN for libswscale

Janne Grunau janne-ffmpeg
Tue Sep 28 01:46:18 CEST 2010


On Tue, Sep 28, 2010 at 12:17:10AM +0100, M?ns Rullg?rd wrote:
> Janne Grunau <janne-ffmpeg at jannau.net> writes:
> 
> > ---
> >  libavutil/cpu.c |    1 +
> >  libavutil/cpu.h |    1 +
> >  2 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> > index 1548530..12c230d 100644
> > --- a/libavutil/cpu.c
> > +++ b/libavutil/cpu.c
> > @@ -27,6 +27,7 @@ int av_get_cpu_flags(void)
> >          return flags;
> >
> >      if (ARCH_ARM) flags = ff_get_cpu_flags_arm();
> > +    if (ARCH_BFIN) flags = AV_CPU_FLAG_BFIN;
> >      if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
> >      if (ARCH_X86) flags = ff_get_cpu_flags_x86();
> >
> > diff --git a/libavutil/cpu.h b/libavutil/cpu.h
> > index 71cc265..6412a54 100644
> > --- a/libavutil/cpu.h
> > +++ b/libavutil/cpu.h
> > @@ -38,6 +38,7 @@
> >  #define AV_CPU_FLAG_SSE42        0x0200 ///< Nehalem SSE4.2 functions
> >  #define AV_CPU_FLAG_IWMMXT       0x0100 ///< XScale IWMMXT
> >  #define AV_CPU_FLAG_ALTIVEC      0x0001 ///< standard
> > +#define AV_CPU_FLAG_BFIN         0x0001
> 
> What is the point of this?  Blackfin is not optional on Blackfin any
> more than x86 is optional on such CPUs.

The difference is that there is no x86 optimized code but libswscale
has Blackfin optimized code/asm.
libswscale seems to use the SWS_CPU_CAPS more as runtime selectable
algorithm switches. The only minor advantage I see with this approach is
runtime switching between general C code and Blackfin specific code.

It is unfortunately necessary for preserving behaviour when using the old
interface.

Janne



More information about the ffmpeg-devel mailing list