[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec zmbv.c, NONE, 1.1 Makefile, 1.240, 1.241 avcodec.h, 1.450, 1.451 allcodecs.c, 1.128, 1.129

Alexander Strasser eclipse7
Sun Feb 12 18:08:55 CET 2006


Hi,

Mike Melanson CVS wrote:
> Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
> In directory mail:/var2/tmp/cvs-serv16881/libavcodec
> 
> Modified Files:
> 	Makefile avcodec.h allcodecs.c 
> Added Files:
> 	zmbv.c 
> Log Message:
> dosbox native ZMBV decoder, courtesy of Kostya

  nice

[...]
> static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
> {
>     ZmbvContext * const c = (ZmbvContext *)avctx->priv_data;
>     uint8_t *outptr;
> #ifdef CONFIG_ZLIB
>     int zret = Z_OK; // Zlib return code
> #endif

  here zret is #ifdef'd

>     int len = buf_size;
>     int hi_ver, lo_ver;
> 
>     if(c->pic.data[0])
>             avctx->release_buffer(avctx, &c->pic);
> 
>     c->pic.reference = 1;
>     c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
>     if(avctx->get_buffer(avctx, &c->pic) < 0){
>         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>         return -1;
>     }
> 
>     outptr = c->pic.data[0]; // Output image pointer
> 
>     /* parse header */
>     c->flags = buf[0];
>     buf++; len--;
>     if(c->flags & ZMBV_KEYFRAME) {
>         hi_ver = buf[0];
>         lo_ver = buf[1];
>         c->comp = buf[2];
>         c->fmt = buf[3];
>         c->bw = buf[4];
>         c->bh = buf[5];
> 
>         buf += 6;
>         len -= 6;
>         av_log(avctx, AV_LOG_DEBUG, "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh);
>         if(hi_ver != 0 || lo_ver != 1) {
>             av_log(avctx, AV_LOG_ERROR, "Unsupported version %i.%i\n", hi_ver, lo_ver);
>             return -1;
>         }
>         if(c->bw == 0 || c->bh == 0) {
>             av_log(avctx, AV_LOG_ERROR, "Unsupported block size %ix%i\n", c->bw, c->bh);
>         }
>         if(c->comp != 0 && c->comp != 1) {
>             av_log(avctx, AV_LOG_ERROR, "Unsupported compression type %i\n", c->comp);
>             return -1;
>         }
>         if(c->fmt != ZMBV_FMT_8BPP && c->fmt != ZMBV_FMT_24BPP) {
>             av_log(avctx, AV_LOG_ERROR, "Unsupported (for now) format %i\n", c->fmt);
>             return -1;
>         }
>         zret = inflateReset(&c->zstream);
>         if (zret != Z_OK) {
>             av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
>             return -1;
>         }

  and here it gets compiled in unconditionally with a call to
inflateReset() or iow compile error if no zlib configured

[...]

  Is the zmbv decoder considedered to work in some cases without zlib?
If not we should somehow deactivate it in configure and remove the
#ifdefs from zmbv.c .


  Alex (beastd)





More information about the ffmpeg-cvslog mailing list