changeset 733:7da52fc20726 libavcodec

DV ntsc support, 411P colorspace added
author arpi_esp
date Mon, 07 Oct 2002 21:28:33 +0000
parents bf4304c46cda
children 2d6b3e3d6c6f
files avcodec.h dv.c
diffstat 2 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Mon Oct 07 02:03:21 2002 +0000
+++ b/avcodec.h	Mon Oct 07 21:28:33 2002 +0000
@@ -64,7 +64,8 @@
     PIX_FMT_YUV444P,
     PIX_FMT_RGBA32,
     PIX_FMT_BGRA32,
-    PIX_FMT_YUV410P
+    PIX_FMT_YUV410P,
+    PIX_FMT_YUV411P
 };
 
 /* currently unused, may be used if 24/32 bits samples ever supported */
--- a/dv.c	Mon Oct 07 02:03:21 2002 +0000
+++ b/dv.c	Mon Oct 07 21:28:33 2002 +0000
@@ -521,6 +521,14 @@
         nb_dif_segs = 10;
     }
 
+    /* XXX: is it correct to assume that 420 is always used in PAL
+       mode ? */
+    s->sampling_411 = !dsf;
+    if (s->sampling_411)
+        mb_pos_ptr = dv_place_411;
+    else
+        mb_pos_ptr = dv_place_420;
+
     /* (re)alloc picture if needed */
     if (s->width != width || s->height != height) {
         for(i=0;i<3;i++)
@@ -530,7 +538,7 @@
             s->linesize[i] = width;
             if (i >= 1) {
                 size >>= 2;
-                s->linesize[i] >>= 1;
+                s->linesize[i] >>= s->sampling_411 ? 2 : 1;
             }
             s->current_picture[i] = av_malloc(size);
             if (!s->current_picture[i])
@@ -540,14 +548,6 @@
         s->height = height;
     }
 
-    /* XXX: is it correct to assume that 420 is always used in PAL
-       mode ? */
-    s->sampling_411 = !dsf;
-    if (s->sampling_411)
-        mb_pos_ptr = dv_place_411;
-    else
-        mb_pos_ptr = dv_place_420;
-    
     /* for each DIF segment */
     buf_ptr = buf;
     for (ds = 0; ds < nb_dif_segs; ds++) {
@@ -568,7 +568,7 @@
     avctx->width = width;
     avctx->height = height;
     if (s->sampling_411)
-        avctx->pix_fmt = PIX_FMT_YUV420P; /* XXX: incorrect, add PIX_FMT_YUV411P */
+        avctx->pix_fmt = PIX_FMT_YUV411P;
     else
         avctx->pix_fmt = PIX_FMT_YUV420P;
     if (dsf)