[Ffmpeg-devel] [RFC] ZMBV encoder

Kostya kostya.shishkov
Thu Dec 7 05:35:30 CET 2006


On Tue, Dec 05, 2006 at 03:52:01PM +0100, Michael Niedermayer wrote:
> Hi
> 
[...]
> [...]
> > Index: libavcodec/zmbvenc.c
> > ===================================================================
> > --- libavcodec/zmbvenc.c	(revision 0)
> > +++ libavcodec/zmbvenc.c	(revision 0)
> [...]
> > +/*
> > + * Encoder context
> > + */
> 
> doxygen compatibility ...

fixed
 
> [...]
> 
> > +    c->curfrm = c->curfrm++;
> 
> what is this?

forcing keyframe every n frames

> 
> [...]
> 
> > +    avctx->has_b_frames = 0;
> 
> this looks wrong, if its != 0 thats a fatal error, setting it to 0 doesnt
> seem correct

Got there from decoder, dropped
 
> > +
> > +    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 ?

Nothing, changed to 127 as it is not possible to store bigger value
 
> > +
> > +    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

Changed, that was borrowed from lcl.c
 
> > +    }
> > +
> > +    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

Redone as PNG does that

> except these patch ok

applied

> [...]
> 
> -- 
> 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