]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/truemotion1.c
Replace int_fast integer types with their sized standard posix counterparts.
[ffmpeg] / libavcodec / truemotion1.c
index eed558c2b18a02b5c1c2c59b81a6e9e2eeda348b..97330d1bb41ee109f15dc4578de5d99b995e1333 100644 (file)
@@ -2,20 +2,20 @@
  * Duck TrueMotion 1.0 Decoder
  * Copyright (C) 2003 Alex Beregszaszi & Mike Melanson
  *
- * 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
  */
 
@@ -35,7 +35,7 @@
 
 #include "avcodec.h"
 #include "dsputil.h"
-#include "libavcore/imgutils.h"
+#include "libavutil/imgutils.h"
 
 #include "truemotion1data.h"
 
@@ -353,7 +353,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
         s->flags = FLAG_KEYFRAME;
 
     if (s->flags & FLAG_SPRITE) {
-        av_log(s->avctx, AV_LOG_INFO, "SPRITE frame found, please report the sample to the developers\n");
+        av_log_ask_for_sample(s->avctx, "SPRITE frame found.\n");
         /* FIXME header.width, height, xoffset and yoffset aren't initialized */
 #if 0
         s->w = header.width;
@@ -370,7 +370,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
             if ((s->w < 213) && (s->h >= 176))
             {
                 s->flags |= FLAG_INTERPOLATED;
-                av_log(s->avctx, AV_LOG_INFO, "INTERPOLATION selected, please report the sample to the developers\n");
+                av_log_ask_for_sample(s->avctx, "INTERPOLATION selected.\n");
             }
         }
     }
@@ -387,7 +387,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
     if ((header.compression & 1) && header.header_type)
         sel_vector_table = pc_tbl2;
     else {
-        if (header.vectable < 4)
+        if (header.vectable > 0 && header.vectable < 4)
             sel_vector_table = tables[header.vectable - 1];
         else {
             av_log(s->avctx, AV_LOG_ERROR, "invalid vector table id (%d)\n", header.vectable);
@@ -409,6 +409,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
         new_pix_fmt != s->avctx->pix_fmt) {
         if (s->frame.data[0])
             s->avctx->release_buffer(s->avctx, &s->frame);
+        s->avctx->sample_aspect_ratio = (AVRational){ 1 << width_shift, 1 };
         s->avctx->pix_fmt = new_pix_fmt;
         avcodec_set_dimensions(s->avctx, s->w, s->h);
         av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int));
@@ -890,7 +891,7 @@ static av_cold int truemotion1_decode_end(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec truemotion1_decoder = {
+AVCodec ff_truemotion1_decoder = {
     "truemotion1",
     AVMEDIA_TYPE_VIDEO,
     CODEC_ID_TRUEMOTION1,