*/
/**
- * @file zmbvenc.c
+ * @file libavcodec/zmbvenc.c
* Zip Motion Blocks Video encoder
*/
#include <stdio.h>
#include <stdlib.h>
+#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include <zlib.h>
AVFrame * const p = &c->pic;
uint8_t *src, *prev;
uint32_t *palptr;
- int zret = Z_OK;
int len = 0;
int keyframe, chpal;
int fl;
c->zstream.next_out = c->comp_buf;
c->zstream.avail_out = c->comp_size;
c->zstream.total_out = 0;
- if((zret = deflate(&c->zstream, Z_SYNC_FLUSH)) != Z_OK){
+ if(deflate(&c->zstream, Z_SYNC_FLUSH) != Z_OK){
av_log(avctx, AV_LOG_ERROR, "Error compressing data\n");
return -1;
}
int lvl = 9;
for(i=1; i<256; i++)
- score_tab[i]= -i * log2(i/(double)(ZMBV_BLOCK*ZMBV_BLOCK)) * 256;
+ score_tab[i]= -i * log(i/(double)(ZMBV_BLOCK*ZMBV_BLOCK)) * (256/M_LN2);
c->avctx = avctx;
- c->pic.data[0] = NULL;
c->curfrm = 0;
c->keyint = avctx->keyint_min;
c->range = 8;
return -1;
}
+ avctx->coded_frame = (AVFrame*)&c->pic;
+
return 0;
}
encode_init,
encode_frame,
encode_end,
- .pix_fmts = (enum PixelFormat[]){PIX_FMT_PAL8, -1},
- .long_name = "Zip Motion Blocks Video",
+ .pix_fmts = (enum PixelFormat[]){PIX_FMT_PAL8, PIX_FMT_NONE},
+ .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
};