]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/zmbvenc.c
Remove duplicated dot product code. Use dsputil's
[ffmpeg] / libavcodec / zmbvenc.c
index fbefa7cafccaccff8450f38118c6d26c899c9ae9..79478de510bd6fc9253fdadc88b1d71fa67cbfbe 100644 (file)
@@ -246,7 +246,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
     int lvl = 9;
 
     for(i=1; i<256; i++)
-        score_tab[i]= -i * log2(i/256.0) * 256;
+        score_tab[i]= -i * log(i/(double)(ZMBV_BLOCK*ZMBV_BLOCK)) * (256/M_LN2);
 
     c->avctx = avctx;
 
@@ -300,6 +300,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
         return -1;
     }
 
+    avctx->coded_frame = (AVFrame*)&c->pic;
+
     return 0;
 }
 
@@ -329,6 +331,6 @@ AVCodec zmbv_encoder = {
     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"),
 };