[Ffmpeg-devel] [RFC] ZMBV encoder

Michael Niedermayer michaelni
Tue Dec 5 15:52:01 CET 2006


Hi

On Tue, Dec 05, 2006 at 02:17:11PM +0200, Kostya wrote:
> On Mon, Dec 04, 2006 at 04:59:35PM +0100, Michael Niedermayer wrote:
> > Hi
> > 
> > On Mon, Dec 04, 2006 at 08:13:57AM +0200, Kostya wrote:
> > > Here is my ZMBV encoder for encoding palettized videos.
> > 
> > > Index: libavcodec/zmbvenc.c
> > > ===================================================================
> > > --- libavcodec/zmbvenc.c	(revision 0)
> > > +++ libavcodec/zmbvenc.c	(revision 0)
> > [...]
> > > +
> > > +#define ZMBV_KEYFRAME 1
> > > +#define ZMBV_DELTAPAL 2
> > 
> > duplicate from zmbv.c
> 
> What do you suggest? Creating separate header is overkill.

ok leave it where it is ...


[...]
> Index: libavcodec/zmbvenc.c
> ===================================================================
> --- libavcodec/zmbvenc.c	(revision 0)
> +++ libavcodec/zmbvenc.c	(revision 0)
[...]
> +/*
> + * Encoder context
> + */

doxygen compatibility ...


[...]

> +    c->curfrm = c->curfrm++;

what is this?


[...]

> +    avctx->has_b_frames = 0;

this looks wrong, if its != 0 thats a fatal error, setting it to 0 doesnt
seem correct


> +
> +    c->pic.data[0] = NULL;
> +    c->curfrm = 0;
> +    c->keyint = avctx->keyint_min;
> +    c->range = 8;
> +    if(avctx->me_range > 0)
> +        c->range = FFMIN(avctx->me_range, 16);

whats the problem with range > 16 ?


> +
> +    if(avctx->compression_level >= 0)
> +        lvl = avctx->compression_level;
> +    if(lvl < 0 || lvl > 9){
> +        av_log(avctx, AV_LOG_ERROR, "Compression level should be 0-9, not %i\n", lvl);
> +        return 1;

most of lav* uses negative numbers to indicate errors


> +    }
> +
> +    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
> +        return 1;
> +    }
> +
> +#ifdef CONFIG_ZLIB
> +    // Needed if zlib unused or init aborted before deflateInit
> +    memset(&(c->zstream), 0, sizeof(z_stream));
> +#else
> +    av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");
> +    return 1;
> +#endif

hmm maybe the whole file shouldnt be compiled if zlib isnt available

except these patch ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali




More information about the ffmpeg-devel mailing list