[Ffmpeg-devel] swscale import: new version

Luca Abeni lucabe72
Thu Mar 30 17:15:43 CEST 2006


Hi Michael,

On Thu, 2006-03-30 at 17:23 +0200, Michael Niedermayer wrote: 
> Hi
> 
> On Sat, Mar 25, 2006 at 01:23:21AM +0100, Luca Abeni wrote:
> > Hi all,
> > 
> > it took more time than expected, but I finally have the new version of
> > the "import swscale" patch.
> > 
> > I attach:
> > 1) pixelformat-new.diff ---> moves enum PixelFormat from libavcodec to
> > libavutil. Should be pretty safe; can it be applied?
> 
> ok
Good, thanks. I am going to apply it in few moments

[...] 
> > diff -urNp -x CVS /usr/local/src/main/postproc/cpu.h libswscale/cpu.h
> > --- /usr/local/src/main/postproc/cpu.h	1970-01-01 01:00:00.000000000 +0100
> > +++ libswscale/cpu.h	2006-03-25 00:57:18.000000000 +0100
> > @@ -0,0 +1,20 @@
> > +#ifndef __CPU_H__
> > +#define __CPU_H__
> > +
> > +#ifdef ARCH_X86_64
> > +#include "i386/mmx.h"
> 
> iam against including mmx.h unless its absolutely needed which IIRC it isnt
> at all
Ok, I'll just copy the needed defines in cpu.h

[...]
> > +#define IMGFMT_XVMC_MOCO_MPEG2 (IMGFMT_XVMC|0x02)
> > +#define IMGFMT_XVMC_IDCT_MPEG2 (IMGFMT_XVMC|0x82)
> > +
> > +typedef struct {
> > +    void* data;
> > +    int size;
> > +    int id;        // stream id. usually 0x1E0
> > +    int timestamp; // pts, 90000 Hz counter based
> > +} vo_mpegpes_t;
> > +
> > +char *vo_format_name(int format);
> 
> the above 2 abolsutly dont belong to ffmpeg
Ops... Sorry, I just copied the header file without looking at it.
Anyway, I think vo_format_name is called by some functions in swscale (I
am currently providing a dummy implementation in swscaler_glue.c)... How
can I fix this problem? The only solution I can think about right now is
to move avcodec_get_pix_fmt_name() to libavutil (but I do not know if
this is ok), convert format in the ffmpeg equivalent, and then call
avcodec_get_pix_fmt_name().
Or maybe for the moment we can just print the numeric value (and provide
a better solution in a second time)?

> > +int sws_convert(uint8_t* dst[], int dstStride[], int dfmt,
> > +                uint8_t* src[], int srcStride[], int sfmt, 
> > +                int src_width, int src_height)
> > +{
> > +    int res;
> > +    struct SwsContext *ctx;
> > +
> > +    ctx = sws_getContext(src_width, src_height, sfmt, src_width, src_height, dfmt, SWS_BICUBIC, NULL, NULL, NULL);
> > +    if (ctx == NULL) {
> > +        return -1;
> > +    }
> > +
> > +    res = sws_scale(ctx, src, srcStride, 0, src_height, dst, dstStride);
> > +    
> > +    sws_freeContext(ctx);
> > +
> > +    return res;
> > +}
> 
> iam against this, calling sws_getContext every time might be very slow
Ok, point taken...
I was using it to avoid using #ifdef in ffmpeg.c.
I'll think about a better solution, and provide an updated patch in the
next weekend.

				Thanks,
					Luca
-- 
_____________________________________________________________________________
Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !





More information about the ffmpeg-devel mailing list