]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/eamad.c
suggest to use av_get_bytes_per_sample() in av_get_bits_per_sample_format() doxy
[ffmpeg] / libavcodec / eamad.c
index 7555e4a6a640cb4b651a4eb1931a5bcac4d10ae1..db227815889a471302ce9c9bb9965377a73f8033 100644 (file)
@@ -2,25 +2,25 @@
  * Electronic Arts Madcow Video Decoder
  * Copyright (c) 2007-2009 Peter Ross
  *
- * 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 St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 /**
- * @file libavcodec/eamad.c
+ * @file
  * Electronic Arts Madcow Video Decoder
  * by Peter Ross <pross@xvid.org>
  *
@@ -34,6 +34,7 @@
 #include "aandcttab.h"
 #include "mpeg12.h"
 #include "mpeg12data.h"
+#include "libavutil/imgutils.h"
 
 #define EA_PREAMBLE_SIZE    8
 #define MADk_TAG MKTAG('M', 'A', 'D', 'k')    /* MAD i-frame */
@@ -46,14 +47,14 @@ typedef struct MadContext {
     AVFrame last_frame;
     void *bitstream_buf;
     unsigned int bitstream_buf_size;
-    DECLARE_ALIGNED_16(DCTELEM, block[64]);
+    DECLARE_ALIGNED(16, DCTELEM, block)[64];
 } MadContext;
 
 static void bswap16_buf(uint16_t *dst, const uint16_t *src, int count)
 {
     int i;
     for (i=0; i<count; i++)
-        dst[i] = bswap_16(src[i]);
+        dst[i] = av_bswap16(src[i]);
 }
 
 static av_cold int decode_init(AVCodecContext *avctx)
@@ -260,7 +261,7 @@ static int decode_frame(AVCodecContext *avctx,
     buf += 16;
 
     if (avctx->width != s->width || avctx->height != s->height) {
-        if (avcodec_check_dimensions(avctx, s->width, s->height) < 0)
+        if (av_image_check_size(s->width, s->height, 0, avctx) < 0)
             return -1;
         avcodec_set_dimensions(avctx, s->width, s->height);
         if (t->frame.data[0])
@@ -305,9 +306,9 @@ static av_cold int decode_end(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec eamad_decoder = {
+AVCodec ff_eamad_decoder = {
     "eamad",
-    CODEC_TYPE_VIDEO,
+    AVMEDIA_TYPE_VIDEO,
     CODEC_ID_MAD,
     sizeof(MadContext),
     decode_init,