]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/kmvc.c
h264: make slice threading work with deblocking_filter=1
[ffmpeg] / libavcodec / kmvc.c
index 42a1e01c84cba5e6569ae62de4f49ce3990606a4..ca6b79fa7c5db9c45b2b6af37b1aa69dfaea30a3 100644 (file)
@@ -30,6 +30,7 @@
 #include "avcodec.h"
 #include "bytestream.h"
 #include "internal.h"
+#include "libavutil/common.h"
 
 #define KMVC_KEYFRAME 0x80
 #define KMVC_PALETTE  0x40
@@ -55,7 +56,7 @@ typedef struct BitBuf {
     int bitbuf;
 } BitBuf;
 
-#define BLK(data, x, y)  data[(x) + (y) * 320]
+#define BLK(data, x, y)  data[av_clip((x) + (y) * 320, 0, 320 * 200 -1)]
 
 #define kmvc_init_getbits(bb, g)  bb.bits = 7; bb.bitbuf = bytestream2_get_byte(g);
 
@@ -399,11 +400,11 @@ static av_cold int decode_init(AVCodecContext * avctx)
 
 AVCodec ff_kmvc_decoder = {
     .name           = "kmvc",
+    .long_name      = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = AV_CODEC_ID_KMVC,
     .priv_data_size = sizeof(KmvcContext),
     .init           = decode_init,
     .decode         = decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .long_name      = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
+    .capabilities   = AV_CODEC_CAP_DR1,
 };