]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/zmbv.c
lavc: remove disabled FF_API_IDCT cruft
[ffmpeg] / libavcodec / zmbv.c
index 8e0db8b5313e008a87ff78ceb239a1b4e5d0002f..8cf6a0cb5bfedbc34e5eafe0b08ad6ad7d6cdc3d 100644 (file)
@@ -54,7 +54,6 @@ enum ZmbvFormat {
  */
 typedef struct ZmbvContext {
     AVCodecContext *avctx;
-    AVFrame pic;
 
     int bpp;
     unsigned int decomp_size;
@@ -400,6 +399,7 @@ static int zmbv_decode_intra(ZmbvContext *c)
 
 static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 {
+    AVFrame *frame = data;
     const uint8_t *buf = avpkt->data;
     int buf_size = avpkt->size;
     ZmbvContext * const c = avctx->priv_data;
@@ -408,12 +408,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
     int hi_ver, lo_ver, ret;
     uint8_t *tmp;
 
-    if (c->pic.data[0])
-            avctx->release_buffer(avctx, &c->pic);
-
-    c->pic.reference = 1;
-    c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
-    if ((ret = ff_get_buffer(avctx, &c->pic)) < 0) {
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;
     }
@@ -428,6 +423,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
         c->fmt = buf[3];
         c->bw = buf[4];
         c->bh = buf[5];
+        c->decode_intra = NULL;
+        c->decode_xor = NULL;
 
         buf += 6;
         len -= 6;
@@ -522,12 +519,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
         c->decomp_len = c->zstream.total_out;
     }
     if (c->flags & ZMBV_KEYFRAME) {
-        c->pic.key_frame = 1;
-        c->pic.pict_type = AV_PICTURE_TYPE_I;
+        frame->key_frame = 1;
+        frame->pict_type = AV_PICTURE_TYPE_I;
         c->decode_intra(c);
     } else {
-        c->pic.key_frame = 0;
-        c->pic.pict_type = AV_PICTURE_TYPE_P;
+        frame->key_frame = 0;
+        frame->pict_type = AV_PICTURE_TYPE_P;
         if (c->decomp_len)
             c->decode_xor(c);
     }
@@ -537,7 +534,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
         uint8_t *out, *src;
         int i, j;
 
-        out = c->pic.data[0];
+        out = frame->data[0];
         src = c->cur;
         switch (c->fmt) {
         case ZMBV_FMT_8BPP:
@@ -548,7 +545,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
                     out[i * 3 + 2] = c->pal[(*src) * 3 + 2];
                     src++;
                 }
-                out += c->pic.linesize[0];
+                out += frame->linesize[0];
             }
             break;
         case ZMBV_FMT_15BPP:
@@ -560,7 +557,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
                     out[i * 3 + 1] = (tmp & 0x03E0) >> 2;
                     out[i * 3 + 2] = (tmp & 0x001F) << 3;
                 }
-                out += c->pic.linesize[0];
+                out += frame->linesize[0];
             }
             break;
         case ZMBV_FMT_16BPP:
@@ -572,7 +569,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
                     out[i * 3 + 1] = (tmp & 0x07E0) >> 3;
                     out[i * 3 + 2] = (tmp & 0x001F) << 3;
                 }
-                out += c->pic.linesize[0];
+                out += frame->linesize[0];
             }
             break;
 #ifdef ZMBV_ENABLE_24BPP
@@ -580,7 +577,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
             for (j = 0; j < c->height; j++) {
                 memcpy(out, src, c->width * 3);
                 src += c->width * 3;
-                out += c->pic.linesize[0];
+                out += frame->linesize[0];
             }
             break;
 #endif //ZMBV_ENABLE_24BPP
@@ -591,7 +588,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
                     src += 4;
                     AV_WB24(out+(i*3), tmp);
                 }
-                out += c->pic.linesize[0];
+                out += frame->linesize[0];
             }
             break;
         default:
@@ -600,7 +597,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
         FFSWAP(uint8_t *, c->cur, c->prev);
     }
     *got_frame = 1;
-    *(AVFrame*)data = c->pic;
 
     /* always report that the buffer was completely consumed */
     return buf_size;
@@ -651,8 +647,6 @@ static av_cold int decode_end(AVCodecContext *avctx)
 
     av_freep(&c->decomp_buf);
 
-    if (c->pic.data[0])
-        avctx->release_buffer(avctx, &c->pic);
     inflateEnd(&c->zstream);
     av_freep(&c->cur);
     av_freep(&c->prev);