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

conrad subversion at mplayerhq.hu
Mon Nov 10 04:11:43 CET 2008


Author: conrad
Date: Mon Nov 10 04:11:43 2008
New Revision: 3785

Log:
Rename frame_decoding to decoding


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	Mon Nov 10 04:11:43 2008
@@ -548,7 +548,7 @@ START_TIMER
         vect2[1] >>= s->chroma_vshift;
     }
 
-    switch(s->frame_decoding.mv_precision) {
+    switch(s->decoding.mv_precision) {
     case 0:
         refxstart1 = (xs + vect1[0]) << 1;
         refystart1 = (ys + vect1[1]) << 1;
@@ -615,11 +615,11 @@ START_TIMER
             int val2;
             int val;
 
-            if (s->frame_decoding.mv_precision == 0) {
+            if (s->decoding.mv_precision == 0) {
                 /* No interpolation.  */
                 val1 = refline1[(x + vect1[0]) << 1];
                 val2 = refline2[(x + vect2[0]) << 1];
-            } else if (s->frame_decoding.mv_precision == 1) {
+            } else if (s->decoding.mv_precision == 1) {
                 /* Halfpel interpolation.  */
                 val1 = refline1[(x << 1) + vect1[0]];
                 val2 = refline2[(x << 1) + vect2[0]];
@@ -627,7 +627,7 @@ START_TIMER
                 /* Position in halfpel interpolated frame.  */
                 int hx1, hx2;
 
-                if (s->frame_decoding.mv_precision == 2) {
+                if (s->decoding.mv_precision == 2) {
                     /* Do qpel interpolation.  */
                     hx1 = ((x << 2) + vect1[0]) >> 1;
                     hx2 = ((x << 2) + vect2[0]) >> 1;
@@ -651,17 +651,17 @@ START_TIMER
                 val1 += w1[1] * refline1[hx1               + 1];
                 val1 += w1[2] * refline1[hx1 + s->refwidth    ];
                 val1 += w1[3] * refline1[hx1 + s->refwidth + 1];
-                val1 >>= s->frame_decoding.mv_precision;
+                val1 >>= s->decoding.mv_precision;
 
                 val2 += w2[0] * refline2[hx2                  ];
                 val2 += w2[1] * refline2[hx2               + 1];
                 val2 += w2[2] * refline2[hx2 + s->refwidth    ];
                 val2 += w2[3] * refline2[hx2 + s->refwidth + 1];
-                val2 >>= s->frame_decoding.mv_precision;
+                val2 >>= s->decoding.mv_precision;
             }
 
-            val1 *= s->frame_decoding.picture_weight_ref1;
-            val2 *= s->frame_decoding.picture_weight_ref2;
+            val1 *= s->decoding.picture_weight_ref1;
+            val2 *= s->decoding.picture_weight_ref2;
             val = val1 + val2;
             if (border) {
                 val *= spatialwt[bx];
@@ -732,7 +732,7 @@ START_TIMER
         vect[1] >>= s->chroma_vshift;
     }
 
-    switch(s->frame_decoding.mv_precision) {
+    switch(s->decoding.mv_precision) {
     case 0:
         refxstart = (xs + vect[0]) << 1;
         refystart = (ys + vect[1]) << 1;
@@ -777,17 +777,17 @@ START_TIMER
         for (x = xs; x < xstop; x++) {
             int val;
 
-            if (s->frame_decoding.mv_precision == 0) {
+            if (s->decoding.mv_precision == 0) {
                 /* No interpolation.  */
                 val = refline[(x + vect[0]) << 1];
-            } else if (s->frame_decoding.mv_precision == 1) {
+            } else if (s->decoding.mv_precision == 1) {
                 /* Halfpel interpolation.  */
                 val = refline[(x << 1) + vect[0]];
             } else {
                 /* Position in halfpel interpolated frame.  */
                 int hx;
 
-                if (s->frame_decoding.mv_precision == 2) {
+                if (s->decoding.mv_precision == 2) {
                     /* Do qpel interpolation.  */
                     hx = ((x << 2) + vect[0]) >> 1;
                     val = 2;
@@ -806,11 +806,11 @@ START_TIMER
                 val += w[1] * refline[hx               + 1];
                 val += w[2] * refline[hx + s->refwidth    ];
                 val += w[3] * refline[hx + s->refwidth + 1];
-                val >>= s->frame_decoding.mv_precision;
+                val >>= s->decoding.mv_precision;
             }
 
-            val *= s->frame_decoding.picture_weight_ref1
-                 + s->frame_decoding.picture_weight_ref2;
+            val *= s->decoding.picture_weight_ref1
+                 + s->decoding.picture_weight_ref2;
 
             if (border) {
                 val *= spatialwt[bx];
@@ -858,7 +858,7 @@ void motion_comp_dc_block(DiracContext *
     ys = FFMAX(ystart, 0);
     xs = FFMAX(xstart, 0);
 
-    dcval <<= s->frame_decoding.picture_weight_precision;
+    dcval <<= s->decoding.picture_weight_precision;
 
     spatialwt = &s->spatialwt[s->xblen * (ys - ystart)];
     line = &coeffs[s->width * ys];
@@ -907,17 +907,17 @@ int dirac_motion_compensation(DiracConte
     if (comp == 0) {
         s->width  = s->source.luma_width;
         s->height = s->source.luma_height;
-        s->xblen  = s->frame_decoding.luma_xblen;
-        s->yblen  = s->frame_decoding.luma_yblen;
-        s->xbsep  = s->frame_decoding.luma_xbsep;
-        s->ybsep  = s->frame_decoding.luma_ybsep;
+        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.chroma_width;
         s->height = s->source.chroma_height;
-        s->xblen  = s->frame_decoding.chroma_xblen;
-        s->yblen  = s->frame_decoding.chroma_yblen;
-        s->xbsep  = s->frame_decoding.chroma_xbsep;
-        s->ybsep  = s->frame_decoding.chroma_ybsep;
+        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->xoffset = (s->xblen - s->xbsep) / 2;
@@ -926,7 +926,7 @@ int dirac_motion_compensation(DiracConte
     vbits      = av_log2(s->yoffset) + 2;
 
     s->total_wt_bits = hbits + vbits
-                       + s->frame_decoding.picture_weight_precision;
+                       + s->decoding.picture_weight_precision;
 
     s->refwidth = (s->width + 2 * s->xblen) << 1;
     s->refheight = (s->height + 2 * s->yblen) << 1;

Modified: dirac/libavcodec/dirac.h
==============================================================================
--- dirac/libavcodec/dirac.h	(original)
+++ dirac/libavcodec/dirac.h	Mon Nov 10 04:11:43 2008
@@ -199,7 +199,7 @@ typedef struct DiracContext {
     int16_t *mcpic;
 
     struct source_parameters source;
-    struct decoding_parameters frame_decoding;
+    struct decoding_parameters decoding;
 
     unsigned int codeblock_mode;
     unsigned int codeblocksh[7]; /* XXX: 7 levels.  */
@@ -278,8 +278,8 @@ typedef enum {
  */
 static int inline subband_width(DiracContext *s, int level) {
     if (level == 0)
-        return s->padded_width >> s->frame_decoding.wavelet_depth;
-    return s->padded_width >> (s->frame_decoding.wavelet_depth - level + 1);
+        return s->padded_width >> s->decoding.wavelet_depth;
+    return s->padded_width >> (s->decoding.wavelet_depth - level + 1);
 }
 
 /**
@@ -290,8 +290,8 @@ static int inline subband_width(DiracCon
  */
 static int inline subband_height(DiracContext *s, int level) {
     if (level == 0)
-        return s->padded_height >> s->frame_decoding.wavelet_depth;
-    return s->padded_height >> (s->frame_decoding.wavelet_depth - level + 1);
+        return s->padded_height >> s->decoding.wavelet_depth;
+    return s->padded_height >> (s->decoding.wavelet_depth - level + 1);
 }
 
 static int inline coeff_quant_factor(int idx) {

Modified: dirac/libavcodec/diracdec.c
==============================================================================
--- dirac/libavcodec/diracdec.c	(original)
+++ dirac/libavcodec/diracdec.c	Mon Nov 10 04:11:43 2008
@@ -450,30 +450,30 @@ static int dirac_unpack_prediction_param
         return -1;
 
     if (idx == 0) {
-        s->frame_decoding.luma_xblen = svq3_get_ue_golomb(gb);
-        s->frame_decoding.luma_yblen = svq3_get_ue_golomb(gb);
-        s->frame_decoding.luma_xbsep = svq3_get_ue_golomb(gb);
-        s->frame_decoding.luma_ybsep = svq3_get_ue_golomb(gb);
+        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);
     } else {
-        s->frame_decoding.luma_xblen = ff_dirac_block_param_defaults[idx - 1].xblen;
-        s->frame_decoding.luma_yblen = ff_dirac_block_param_defaults[idx - 1].yblen;
-        s->frame_decoding.luma_xbsep = ff_dirac_block_param_defaults[idx - 1].xbsep;
-        s->frame_decoding.luma_ybsep = ff_dirac_block_param_defaults[idx - 1].ybsep;
+        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;
     }
 
     /* Setup the blen and bsep parameters for the chroma
        component.  */
-    s->frame_decoding.chroma_xblen = (s->frame_decoding.luma_xblen
+    s->decoding.chroma_xblen = (s->decoding.luma_xblen
                                       >> s->chroma_hshift);
-    s->frame_decoding.chroma_yblen = (s->frame_decoding.luma_yblen
+    s->decoding.chroma_yblen = (s->decoding.luma_yblen
                                       >> s->chroma_vshift);
-    s->frame_decoding.chroma_xbsep = (s->frame_decoding.luma_xbsep
+    s->decoding.chroma_xbsep = (s->decoding.luma_xbsep
                                       >> s->chroma_hshift);
-    s->frame_decoding.chroma_ybsep = (s->frame_decoding.luma_ybsep
+    s->decoding.chroma_ybsep = (s->decoding.luma_ybsep
                                       >> s->chroma_vshift);
 
     /* Read motion vector precision.  */
-    s->frame_decoding.mv_precision = svq3_get_ue_golomb(gb);
+    s->decoding.mv_precision = svq3_get_ue_golomb(gb);
 
     /* Read the global motion compensation parameters.  */
     s->globalmc_flag = get_bits1(gb);
@@ -514,16 +514,16 @@ static int dirac_unpack_prediction_param
     svq3_get_ue_golomb(gb);
 
     /* Default weights */
-    s->frame_decoding.picture_weight_precision = 1;
-    s->frame_decoding.picture_weight_ref1      = 1;
-    s->frame_decoding.picture_weight_ref2      = 1;
+    s->decoding.picture_weight_precision = 1;
+    s->decoding.picture_weight_ref1      = 1;
+    s->decoding.picture_weight_ref2      = 1;
 
     /* Override reference picture weights.  */
     if (get_bits1(gb)) {
-        s->frame_decoding.picture_weight_precision = svq3_get_ue_golomb(gb);
-        s->frame_decoding.picture_weight_ref1 = dirac_get_se_golomb(gb);
+        s->decoding.picture_weight_precision = svq3_get_ue_golomb(gb);
+        s->decoding.picture_weight_ref1 = dirac_get_se_golomb(gb);
         if (s->refs == 2)
-            s->frame_decoding.picture_weight_ref2 = dirac_get_se_golomb(gb);
+            s->decoding.picture_weight_ref2 = dirac_get_se_golomb(gb);
     }
 
     return 0;
@@ -669,9 +669,9 @@ static int dirac_unpack_prediction_data(
 #define DIVRNDUP(a, b) ((a + b - 1) / b)
 
     s->sbwidth  = DIVRNDUP(s->source.luma_width,
-                           (s->frame_decoding.luma_xbsep << 2));
+                           (s->decoding.luma_xbsep << 2));
     s->sbheight = DIVRNDUP(s->source.luma_height,
-                           (s->frame_decoding.luma_ybsep << 2));
+                           (s->decoding.luma_ybsep << 2));
     s->blwidth  = s->sbwidth  << 2;
     s->blheight = s->sbheight << 2;
 
@@ -776,7 +776,7 @@ static void decode_component(DiracContex
     subband_dc(s, coeffs);
 
     /* Unpack all other subbands at all levels.  */
-    for (level = 1; level <= s->frame_decoding.wavelet_depth; level++) {
+    for (level = 1; level <= s->decoding.wavelet_depth; level++) {
         for (orientation = 1; orientation <= subband_hh; orientation++)
             subband(s, coeffs, level, orientation);
     }
@@ -793,7 +793,7 @@ int dirac_idwt(DiracContext *s, int16_t 
     int level;
     int width, height;
 
-    for (level = 1; level <= s->frame_decoding.wavelet_depth; level++) {
+    for (level = 1; level <= s->decoding.wavelet_depth; level++) {
         width  = subband_width(s, level);
         height = subband_height(s, level);
 
@@ -984,18 +984,18 @@ static int parse_frame(DiracContext *s)
         if (s->wavelet_idx > 6)
             return -1;
 
-        s->frame_decoding.wavelet_depth = svq3_get_ue_golomb(gb);
+        s->decoding.wavelet_depth = svq3_get_ue_golomb(gb);
 
         /* Codeblock paramaters (core syntax only) */
         if (get_bits1(gb)) {
-            for (i = 0; i <= s->frame_decoding.wavelet_depth; i++) {
+            for (i = 0; i <= s->decoding.wavelet_depth; i++) {
                 s->codeblocksh[i] = svq3_get_ue_golomb(gb);
                 s->codeblocksv[i] = svq3_get_ue_golomb(gb);
             }
 
             s->codeblock_mode = svq3_get_ue_golomb(gb);
         } else
-            for (i = 0; i <= s->frame_decoding.wavelet_depth; i++)
+            for (i = 0; i <= s->decoding.wavelet_depth; i++)
                 s->codeblocksh[i] = s->codeblocksv[i] = 1;
     }
 
@@ -1004,13 +1004,13 @@ static int parse_frame(DiracContext *s)
 
     /* Round up to a multiple of 2^depth.  */
     s->padded_luma_width    = CALC_PADDING(s->source.luma_width,
-                                           s->frame_decoding.wavelet_depth);
+                                           s->decoding.wavelet_depth);
     s->padded_luma_height   = CALC_PADDING(s->source.luma_height,
-                                           s->frame_decoding.wavelet_depth);
+                                           s->decoding.wavelet_depth);
     s->padded_chroma_width  = CALC_PADDING(s->source.chroma_width,
-                                           s->frame_decoding.wavelet_depth);
+                                           s->decoding.wavelet_depth);
     s->padded_chroma_height = CALC_PADDING(s->source.chroma_height,
-                                           s->frame_decoding.wavelet_depth);
+                                           s->decoding.wavelet_depth);
 
     return 0;
 }



More information about the FFmpeg-soc mailing list