Imported Upstream version 6.1
[platform/upstream/ffmpeg.git] / libavcodec / wnv1.c
index 6251c00..ffc9174 100644 (file)
@@ -29,8 +29,8 @@
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
 #include "codec_internal.h"
+#include "decode.h"
 #include "get_bits.h"
-#include "internal.h"
 
 static const uint8_t code_tab[16][2] = {
     {  7, 1 }, {  8, 3 }, {  6, 3 }, { 9, 4 }, {  5, 4 }, { 10, 5 }, {  4, 5 },
@@ -69,7 +69,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
 
     if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
         return ret;
-    p->key_frame = 1;
+    p->flags |= AV_FRAME_FLAG_KEY;
 
     if ((ret = init_get_bits8(&gb, buf + 8, buf_size - 8)) < 0)
         return ret;
@@ -115,10 +115,10 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
 
 static av_cold void wnv1_init_static(void)
 {
-    INIT_VLC_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16,
+    VLC_INIT_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16,
                                  &code_tab[0][1], 2,
                                  &code_tab[0][0], 2, 1,
-                                 -7, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS);
+                                 -7, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS);
 }
 
 static av_cold int decode_init(AVCodecContext *avctx)
@@ -137,11 +137,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
 const FFCodec ff_wnv1_decoder = {
     .p.name         = "wnv1",
-    .p.long_name    = NULL_IF_CONFIG_SMALL("Winnov WNV1"),
+    CODEC_LONG_NAME("Winnov WNV1"),
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_WNV1,
     .init           = decode_init,
     FF_CODEC_DECODE_CB(decode_frame),
     .p.capabilities = AV_CODEC_CAP_DR1,
-    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };