[FFmpeg-soc] [soc]: r5602 - in indeo5: indeo5.c ivi_common.c ivi_common.h

kostya subversion at mplayerhq.hu
Wed Jan 27 17:12:56 CET 2010


Author: kostya
Date: Wed Jan 27 17:12:56 2010
New Revision: 5602

Log:
make IVI_DEBUG a defined value instead of simply #define

Modified:
   indeo5/indeo5.c
   indeo5/ivi_common.c
   indeo5/ivi_common.h

Modified: indeo5/indeo5.c
==============================================================================
--- indeo5/indeo5.c	Wed Jan 27 17:10:03 2010	(r5601)
+++ indeo5/indeo5.c	Wed Jan 27 17:12:56 2010	(r5602)
@@ -34,8 +34,6 @@
 #include "ivi_common.h"
 #include "indeo5data.h"
 
-#define IVI_DEBUG
-
 /**
  *  Indeo5 frame types.
  */
@@ -78,9 +76,7 @@ typedef struct {
     uint8_t         is_scalable;
     uint32_t        lock_word;
     IVIPicConfig    pic_conf;
-#ifdef IVI_DEBUG
     int32_t         gop_num;         ///< gop number
-#endif
 } IVI5DecContext;
 
 //! static vlc tables (initialized at startup)
@@ -340,9 +336,7 @@ static int decode_pic_hdr(IVI5DecContext
     if (ctx->frame_type == FRAMETYPE_INTRA) {
         if (decode_gop_header(ctx, avctx))
             return -1;
-#ifdef IVI_DEBUG
         ctx->gop_num++;
-#endif
     }
 
     if (ctx->frame_type != FRAMETYPE_NULL) {
@@ -461,17 +455,12 @@ static int decode_band_hdr(IVI5DecContex
         band->blk_vlc = &blk_vlc_tabs[7]; /* select the default macroblock huffman table */
 
     /* get band checksum if present */
-#ifdef IVI_DEBUG
     if (get_bits1(&ctx->gb)) {
         band->checksum = get_bits(&ctx->gb, 16);
         band->checksum_present = 1;
     } else {
         band->checksum_present = 0;
     }
-#else
-    if (get_bits1(&ctx->gb))
-        skip_bits(&ctx->gb, 16); /* ignore band checksum */
-#endif
 
     band->glob_quant = get_bits(&ctx->gb, 5); /* band global quant */
 
@@ -641,9 +630,7 @@ static int decode_band(IVI5DecContext *c
 {
     int         result, i, t, idx1, idx2;
     IVITile     *tile;
-#ifdef IVI_DEBUG
     uint16_t    chksum;
-#endif
 
     /* setup buffer pointers according with the buffer switch */
     band->buf     = band->bufs[ctx->dst_buf];
@@ -720,8 +707,7 @@ static int decode_band(IVI5DecContext *c
         FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]);
     }
 
-#ifdef IVI_DEBUG
-    if (band->checksum_present) {
+    if (IVI_DEBUG && band->checksum_present) {
         chksum = ivi_calc_band_checksum(band);
         if (chksum != band->checksum) {
             av_log(avctx, AV_LOG_ERROR,
@@ -729,7 +715,6 @@ static int decode_band(IVI5DecContext *c
                    band->plane, band->band_num, band->checksum, chksum);
         }
     }
-#endif
 
     return result;
 }
@@ -829,9 +814,7 @@ static av_cold int decode_init(AVCodecCo
         return -1;
     }
 
-#ifdef IVI_DEBUG
     ctx->gop_num = -1;
-#endif
 
     /* needed here! Otherwise "avctx->get_buffer" won't be initialized!!! */
     avctx->pix_fmt = PIX_FMT_YUV410P;

Modified: indeo5/ivi_common.c
==============================================================================
--- indeo5/ivi_common.c	Wed Jan 27 17:10:03 2010	(r5601)
+++ indeo5/ivi_common.c	Wed Jan 27 17:12:56 2010	(r5602)
@@ -353,10 +353,8 @@ int ff_ivi_decode_blocks(GetBitContext *
                         break;
                     pos = band->scan[scan_pos];
 
-                #ifdef IVI_DEBUG
-                    if (!val)
+                    if (IVI_DEBUG && !val)
                         av_log(NULL, AV_LOG_ERROR, "Val = 0 encountered!\n");
-                #endif
 
                     q = (base_tab[pos] * scale_tab[quant]) >> 8;
                     if (q > 1)
@@ -507,7 +505,7 @@ void ff_ivi_process_empty_tile(AVCodecCo
 }
 
 
-#ifdef IVI_DEBUG
+#if IVI_DEBUG
 uint16_t ivi_calc_band_checksum (IVIBandDesc *band)
 {
     int         x, y;

Modified: indeo5/ivi_common.h
==============================================================================
--- indeo5/ivi_common.h	Wed Jan 27 17:10:03 2010	(r5601)
+++ indeo5/ivi_common.h	Wed Jan 27 17:12:56 2010	(r5602)
@@ -33,7 +33,7 @@
 #include "get_bits.h"
 #include <stdint.h>
 
-#define IVI_DEBUG
+#define IVI_DEBUG 1
 
 #define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes
 
@@ -135,11 +135,9 @@ typedef struct {
     void (*inv_transform)(int32_t *in, int16_t *out, uint32_t pitch, uint8_t *flags); ///< inverse transform function pointer
     void (*dc_transform) (int32_t *in, int16_t *out, uint32_t pitch, int blk_size);   ///< dc transform function pointer, it may be NULL
     uint8_t         is_2d_trans;    ///< 1 indicates that the two-dimensional inverse transform is used
-#ifdef IVI_DEBUG
     uint16_t        checksum;        ///< for debug purposes
     int32_t         checksum_present;
     uint32_t        bufsize;         ///< band buffer size in bytes
-#endif
     const uint8_t   *intra_base;     ///< quantization matrix for intra blocks
     const uint8_t   *inter_base;     ///< quantization matrix for inter blocks
     const uint8_t   *intra_scale;    ///< quantization coefficient for intra blocks
@@ -304,7 +302,7 @@ void ff_ivi_process_empty_tile(AVCodecCo
  */
 void ff_ivi_output_plane(const IVIPlaneDesc *plane, uint8_t *dst, const int dst_pitch);
 
-#ifdef IVI_DEBUG
+#if IVI_DEBUG
 /**
  *  Calculates band checksum from band data.
  */
@@ -313,7 +311,7 @@ uint16_t ivi_calc_band_checksum (IVIBand
 /**
  *  Verifies that band data lies in range.
  */
-int ivi_check_band (IVIBandDesc *band, uint8_t *ref, int pitch);
+int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch);
 #endif
 
 #endif /* AVCODEC_IVI_COMMON_H */


More information about the FFmpeg-soc mailing list