[FFmpeg-soc] [soc]: r3818 - in dirac/libavcodec: dirac.c diracdec.c

conrad subversion at mplayerhq.hu
Tue Nov 11 09:38:20 CET 2008


Author: conrad
Date: Tue Nov 11 09:38:20 2008
New Revision: 3818

Log:
Simplify


Modified:
   dirac/libavcodec/dirac.c
   dirac/libavcodec/diracdec.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Tue Nov 11 09:38:20 2008
@@ -1090,13 +1090,8 @@ int dirac_motion_compensation(DiracConte
     int xstop, ystop;
     int hbits, vbits;
 
-    if (comp == 0) {
-        s->width  = s->source.width;
-        s->height = s->source.height;
-    } else {
-        s->width  = s->source.width  >> s->chroma_hshift;
-        s->height = s->source.height >> s->chroma_vshift;
-    }
+    s->width  = s->source.width  >> (comp ? s->chroma_hshift : 0);
+    s->height = s->source.height >> (comp ? s->chroma_vshift : 0);
     s->xblen  = s->decoding.xblen[!!comp];
     s->yblen  = s->decoding.yblen[!!comp];
     s->xbsep  = s->decoding.xbsep[!!comp];

Modified: dirac/libavcodec/diracdec.c
==============================================================================
--- dirac/libavcodec/diracdec.c	(original)
+++ dirac/libavcodec/diracdec.c	Tue Nov 11 09:38:20 2008
@@ -665,14 +665,12 @@ static int dirac_decode_frame_internal(D
         uint8_t *frame = s->picture.data[comp];
         int width, height;
 
+        width  = s->source.width  >> (comp ? s->chroma_hshift : 0);
+        height = s->source.height >> (comp ? s->chroma_vshift : 0);
         if (comp == 0) {
-            width            = s->source.width;
-            height           = s->source.height;
             s->padded_width  = s->padded_luma_width;
             s->padded_height = s->padded_luma_height;
         } else {
-            width            = s->source.width  >> s->chroma_hshift;
-            height           = s->source.height >> s->chroma_vshift;
             s->padded_width  = s->padded_chroma_width;
             s->padded_height = s->padded_chroma_height;
         }



More information about the FFmpeg-soc mailing list