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

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


Author: conrad
Date: Tue Nov 11 09:38:14 2008
New Revision: 3815

Log:
Merge luma/chroma x/y sep/len into two elem arrays


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

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Tue Nov 11 09:38:14 2008
@@ -1093,18 +1093,14 @@ int dirac_motion_compensation(DiracConte
     if (comp == 0) {
         s->width  = s->source.luma_width;
         s->height = s->source.luma_height;
-        s->xblen  = s->decoding.luma_xblen;
-        s->yblen  = s->decoding.luma_yblen;
-        s->xbsep  = s->decoding.luma_xbsep;
-        s->ybsep  = s->decoding.luma_ybsep;
     } else {
         s->width  = s->source.luma_width  >> s->chroma_hshift;
         s->height = s->source.luma_height >> s->chroma_vshift;
-        s->xblen  = s->decoding.chroma_xblen;
-        s->yblen  = s->decoding.chroma_yblen;
-        s->xbsep  = s->decoding.chroma_xbsep;
-        s->ybsep  = s->decoding.chroma_ybsep;
     }
+    s->xblen  = s->decoding.xblen[!!comp];
+    s->yblen  = s->decoding.yblen[!!comp];
+    s->xbsep  = s->decoding.xbsep[!!comp];
+    s->ybsep  = s->decoding.ybsep[!!comp];
 
     s->xoffset = (s->xblen - s->xbsep) / 2;
     s->yoffset = (s->yblen - s->ybsep) / 2;

Modified: dirac/libavcodec/dirac.h
==============================================================================
--- dirac/libavcodec/dirac.h	(original)
+++ dirac/libavcodec/dirac.h	Tue Nov 11 09:38:14 2008
@@ -103,21 +103,16 @@ typedef struct {
 struct decoding_parameters {
     uint8_t wavelet_depth;          ///< depth of the IDWT
 
-    uint8_t luma_xbsep;
-    uint8_t luma_xblen;
-    uint8_t luma_ybsep;
-    uint8_t luma_yblen;
+    uint8_t xbsep[2];
+    uint8_t xblen[2];
+    uint8_t ybsep[2];
+    uint8_t yblen[2];
 
     uint8_t mv_precision;
 
     int16_t picture_weight_ref1;
     int16_t picture_weight_ref2;
     unsigned int picture_weight_precision;
-
-    uint8_t chroma_xbsep;
-    uint8_t chroma_xblen;
-    uint8_t chroma_ybsep;
-    uint8_t chroma_yblen;
 };
 
 struct globalmc_parameters {

Modified: dirac/libavcodec/diracdec.c
==============================================================================
--- dirac/libavcodec/diracdec.c	(original)
+++ dirac/libavcodec/diracdec.c	Tue Nov 11 09:38:14 2008
@@ -273,23 +273,23 @@ static int dirac_unpack_prediction_param
         return -1;
 
     if (idx == 0) {
-        s->decoding.luma_xblen = svq3_get_ue_golomb(gb);
-        s->decoding.luma_yblen = svq3_get_ue_golomb(gb);
-        s->decoding.luma_xbsep = svq3_get_ue_golomb(gb);
-        s->decoding.luma_ybsep = svq3_get_ue_golomb(gb);
+        s->decoding.xblen[0] = svq3_get_ue_golomb(gb);
+        s->decoding.yblen[0] = svq3_get_ue_golomb(gb);
+        s->decoding.xbsep[0] = svq3_get_ue_golomb(gb);
+        s->decoding.ybsep[0] = svq3_get_ue_golomb(gb);
     } else {
-        s->decoding.luma_xblen = ff_dirac_block_param_defaults[idx - 1].xblen;
-        s->decoding.luma_yblen = ff_dirac_block_param_defaults[idx - 1].yblen;
-        s->decoding.luma_xbsep = ff_dirac_block_param_defaults[idx - 1].xbsep;
-        s->decoding.luma_ybsep = ff_dirac_block_param_defaults[idx - 1].ybsep;
+        s->decoding.xblen[0] = ff_dirac_block_param_defaults[idx - 1].xblen;
+        s->decoding.yblen[0] = ff_dirac_block_param_defaults[idx - 1].yblen;
+        s->decoding.xbsep[0] = ff_dirac_block_param_defaults[idx - 1].xbsep;
+        s->decoding.ybsep[0] = ff_dirac_block_param_defaults[idx - 1].ybsep;
     }
 
     /* Setup the blen and bsep parameters for the chroma
        component. */
-    s->decoding.chroma_xblen = s->decoding.luma_xblen >> s->chroma_hshift;
-    s->decoding.chroma_yblen = s->decoding.luma_yblen >> s->chroma_vshift;
-    s->decoding.chroma_xbsep = s->decoding.luma_xbsep >> s->chroma_hshift;
-    s->decoding.chroma_ybsep = s->decoding.luma_ybsep >> s->chroma_vshift;
+    s->decoding.xblen[1] = s->decoding.xblen[0] >> s->chroma_hshift;
+    s->decoding.yblen[1] = s->decoding.yblen[0] >> s->chroma_vshift;
+    s->decoding.xbsep[1] = s->decoding.xbsep[0] >> s->chroma_hshift;
+    s->decoding.ybsep[1] = s->decoding.ybsep[0] >> s->chroma_vshift;
 
     /* Read motion vector precision. */
     s->decoding.mv_precision = svq3_get_ue_golomb(gb);
@@ -489,9 +489,9 @@ static int dirac_unpack_block_motion_dat
 #define DIVRNDUP(a, b) ((a + b - 1) / b)
 
     s->sbwidth  = DIVRNDUP(s->source.luma_width,
-                           (s->decoding.luma_xbsep << 2));
+                           (s->decoding.xbsep[0] << 2));
     s->sbheight = DIVRNDUP(s->source.luma_height,
-                           (s->decoding.luma_ybsep << 2));
+                           (s->decoding.ybsep[0] << 2));
     s->blwidth  = s->sbwidth  << 2;
     s->blheight = s->sbheight << 2;
 



More information about the FFmpeg-soc mailing list