avfilter/vf_framerate: change blend factor precision
[ffmpeg.git] / libavcodec / tscc2.c
index 92210f7..a8c7ee7 100644 (file)
 
 #define BITSTREAM_READER_LE
 #include "avcodec.h"
-#include "get_bits.h"
 #include "bytestream.h"
+#include "get_bits.h"
 #include "internal.h"
+#include "mathops.h"
 #include "tscc2data.h"
 
 typedef struct TSCC2Context {
@@ -179,7 +180,7 @@ static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set,
                 if (bpos >= 16)
                     return AVERROR_INVALIDDATA;
                 val = sign_extend(ac >> 4, 8);
-                c->block[tscc2_zigzag[bpos++]] = val;
+                c->block[ff_zigzag_scan[bpos++]] = val;
             }
             tscc2_idct4_put(c->block, q, dst + k * 4, stride);
         }
@@ -234,18 +235,15 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_INVALIDDATA;
     }
 
-    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
-        return ret;
-    }
-
     if (frame_type == 0) {
-        *got_frame      = 1;
-        if ((ret = av_frame_ref(data, c->pic)) < 0)
-            return ret;
-
+        // Skip duplicate frames
         return buf_size;
     }
 
+    if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
+        return ret;
+    }
+
     if (bytestream2_get_bytes_left(&gb) < 4) {
         av_log(avctx, AV_LOG_ERROR, "Frame is too short\n");
         return AVERROR_INVALIDDATA;
@@ -384,5 +382,5 @@ AVCodec ff_tscc2_decoder = {
     .init           = tscc2_decode_init,
     .close          = tscc2_decode_end,
     .decode         = tscc2_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
+    .capabilities   = AV_CODEC_CAP_DR1,
 };