]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dxa.c
fate: separate smacker audio and video tests
[ffmpeg] / libavcodec / dxa.c
index 62e4e0ae82419994069cec17b4125e4954b61260..2684179981a753a9af353a0f38ed2c30b41af22e 100644 (file)
@@ -2,20 +2,20 @@
  * Feeble Files/ScummVM DXA decoder
  * Copyright (c) 2007 Konstantin Shishkov
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -36,7 +36,6 @@
  * Decoder context
  */
 typedef struct DxaDecContext {
-    AVCodecContext *avctx;
     AVFrame pic, prev;
 
     int dsize;
@@ -240,13 +239,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     switch(compr){
     case -1:
         c->pic.key_frame = 0;
-        c->pic.pict_type = FF_P_TYPE;
+        c->pic.pict_type = AV_PICTURE_TYPE_P;
         if(c->prev.data[0])
             memcpy(c->pic.data[0], c->prev.data[0], c->pic.linesize[0] * avctx->height);
         else{ // Should happen only when first frame is 'NULL'
             memset(c->pic.data[0], 0, c->pic.linesize[0] * avctx->height);
             c->pic.key_frame = 1;
-            c->pic.pict_type = FF_I_TYPE;
+            c->pic.pict_type = AV_PICTURE_TYPE_I;
         }
         break;
     case 2:
@@ -254,7 +253,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     case 4:
     case 5:
         c->pic.key_frame = !(compr & 1);
-        c->pic.pict_type = (compr & 1) ? FF_P_TYPE : FF_I_TYPE;
+        c->pic.pict_type = (compr & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
         for(j = 0; j < avctx->height; j++){
             if(compr & 1){
                 for(i = 0; i < avctx->width; i++)
@@ -269,7 +268,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     case 12: // ScummVM coding
     case 13:
         c->pic.key_frame = 0;
-        c->pic.pict_type = FF_P_TYPE;
+        c->pic.pict_type = AV_PICTURE_TYPE_P;
         decode_13(avctx, c, c->pic.data[0], srcptr, c->prev.data[0]);
         break;
     default:
@@ -292,7 +291,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
 {
     DxaDecContext * const c = avctx->priv_data;
 
-    c->avctx = avctx;
     avctx->pix_fmt = PIX_FMT_PAL8;
 
     c->dsize = avctx->width * avctx->height * 2;
@@ -317,16 +315,14 @@ static av_cold int decode_end(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec dxa_decoder = {
-    "dxa",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_DXA,
-    sizeof(DxaDecContext),
-    decode_init,
-    NULL,
-    decode_end,
-    decode_frame,
-    CODEC_CAP_DR1,
-    .long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
+AVCodec ff_dxa_decoder = {
+    .name           = "dxa",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_DXA,
+    .priv_data_size = sizeof(DxaDecContext),
+    .init           = decode_init,
+    .close          = decode_end,
+    .decode         = decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
+    .long_name      = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"),
 };
-