[SCM] libav/experimental: ati vcr2 uv swap

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:36:57 UTC 2013


The following commit has been merged in the experimental branch:
commit ff862be5ed2d7d6799ee23e04c5fbee0c1e1f987
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Sat Jul 26 00:49:46 2003 +0000

    ati vcr2 uv swap
    
    Originally committed as revision 2084 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 46c0162..62734b4 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1791,6 +1791,12 @@ static void mpeg_decode_extension(AVCodecContext *avctx,
     }
 }
 
+static void exchange_uv(AVFrame *f){
+    uint8_t *t= f->data[1];
+    f->data[1]= f->data[2];
+    f->data[2]= t;
+}
+
 #define DECODE_SLICE_FATAL_ERROR -2
 #define DECODE_SLICE_ERROR -1
 #define DECODE_SLICE_OK 0
@@ -1945,8 +1951,14 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
         MPV_decode_mb(s, s->block);
 
         if (++s->mb_x >= s->mb_width) {
+            if(s->avctx->codec_tag == ff_get_fourcc("VCR2"))
+                exchange_uv((AVFrame*)s->current_picture_ptr);
+
             ff_draw_horiz_band(s, 16*s->mb_y, 16);
 
+            if(s->avctx->codec_tag == ff_get_fourcc("VCR2"))
+                exchange_uv((AVFrame*)s->current_picture_ptr);
+
             s->mb_x = 0;
             s->mb_y++;
 
@@ -2033,6 +2045,9 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
                  ff_print_debug_info(s, s->last_picture_ptr);
             }
         }
+        if(s->avctx->codec_tag == ff_get_fourcc("VCR2"))
+            exchange_uv(pict);
+
         return 1;
     } else {
         return 0;
@@ -2164,6 +2179,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
     s->width = avctx->width;
     s->height = avctx->height;
     avctx->has_b_frames= 0; //true?
+    s->low_delay= 1;
     s->avctx = avctx;
     
     if (MPV_common_init(s) < 0)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list