[FFmpeg-soc] [soc]: r4437 - wmapro/wma3dec.c
faust3
subversion at mplayerhq.hu
Fri Jun 12 11:41:55 CEST 2009
Author: faust3
Date: Fri Jun 12 11:41:54 2009
New Revision: 4437
Log:
use dprintf instead of defining another debug macro
Modified:
wmapro/wma3dec.c
Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c Fri Jun 12 11:31:53 2009 (r4436)
+++ wmapro/wma3dec.c Fri Jun 12 11:41:54 2009 (r4437)
@@ -81,12 +81,6 @@
#include "dsputil.h"
#include "wma.h"
-#ifdef TRACE
-#define DBG av_log
-#else
-#define DBG(...)
-#endif
-
/** current decoder limitations */
#define WMAPRO_MAX_CHANNELS 8 ///< max number of handled channels
#define MAX_SUBFRAMES 32 ///< max number of subframes per channel
@@ -318,7 +312,7 @@ static av_cold int decode_init(AVCodecCo
s->decode_flags = AV_RL16(edata_ptr+14);
channel_mask = AV_RL32(edata_ptr+2);
// s->sample_bit_depth = AV_RL16(edata_ptr);
-#ifdef TRACE
+#ifdef DEBUG
/** dump the extradata */
for (i=0 ; i<avctx->extradata_size ; i++)
av_log(avctx, AV_LOG_DEBUG, "[%x] ",avctx->extradata[i]);
@@ -681,7 +675,7 @@ static int decode_tilehdr(WMA3DecodeCont
int i;
int offset = 0;
for (i=0;i<s->channel[c].num_subframes;i++) {
- DBG(s->avctx, AV_LOG_DEBUG,"frame[%i] channel[%i] subframe[%i]"
+ dprintf(s->avctx, "frame[%i] channel[%i] subframe[%i]"
" len %i\n",s->frame_num,c,i,s->channel[c].subframe_len[i]);
s->channel[c].subframe_offset[i] = offset;
offset += s->channel[c].subframe_len[i];
@@ -903,7 +897,7 @@ static int decode_coeffs(WMA3DecodeConte
int zero_init = 0;
int rl_switchmask = (s->subframe_len>>8);
- DBG(s->avctx,AV_LOG_DEBUG,"decode coefficients for channel %i\n",c);
+ dprintf(s->avctx, "decode coefficients for channel %i\n",c);
vlctable = get_bits1(&s->gb);
vlc = &coef_vlc[vlctable];
@@ -1252,7 +1246,7 @@ static int decode_subframe(WMA3DecodeCon
}
}
- DBG(s->avctx, AV_LOG_DEBUG,
+ dprintf(s->avctx,
"processing subframe with offset %i len %i\n",offset,subframe_len);
/** get a list of all channels that contain the estimated block */
@@ -1279,7 +1273,7 @@ static int decode_subframe(WMA3DecodeCon
s->parsed_all_subframes = 1;
- DBG(s->avctx, AV_LOG_DEBUG,"subframe is part of %i channels\n",
+ dprintf(s->avctx, "subframe is part of %i channels\n",
s->channels_for_cur_subframe);
/** calculate number of scale factor bands and their offsets */
@@ -1400,7 +1394,7 @@ static int decode_subframe(WMA3DecodeCon
return 0;
}
- DBG(s->avctx,AV_LOG_DEBUG,"BITSTREAM: subframe header length was %i\n",
+ dprintf(s->avctx, "BITSTREAM: subframe header length was %i\n",
get_bits_count(&s->gb) - s->subframe_offset);
/** parse coefficients */
@@ -1411,7 +1405,7 @@ static int decode_subframe(WMA3DecodeCon
decode_coeffs(s,c);
}
- DBG(s->avctx,AV_LOG_DEBUG,"BITSTREAM: subframe length was %i\n",
+ dprintf(s->avctx, "BITSTREAM: subframe length was %i\n",
get_bits_count(&s->gb) - s->subframe_offset);
if (transmit_coeffs) {
@@ -1491,7 +1485,7 @@ static int decode_frame(WMA3DecodeContex
if (s->len_prefix)
len = get_bits(gb,s->log2_frame_size);
- DBG(s->avctx,AV_LOG_DEBUG,"decoding frame with length %x\n",len);
+ dprintf(s->avctx, "decoding frame with length %x\n",len);
/** decode tile information */
if (decode_tilehdr(s)) {
@@ -1509,7 +1503,7 @@ static int decode_frame(WMA3DecodeContex
/** read drc info */
if (s->dynamic_range_compression) {
s->drc_gain = get_bits(gb,8);
- DBG(s->avctx,AV_LOG_DEBUG,"drc_gain %i\n",s->drc_gain);
+ dprintf(s->avctx, "drc_gain %i\n",s->drc_gain);
}
/** no idea what these are for, might be the number of samples
@@ -1520,18 +1514,18 @@ static int decode_frame(WMA3DecodeContex
/** usually true for the first frame */
if (get_bits1(gb)) {
skip = get_bits(gb,av_log2(s->samples_per_frame * 2));
- DBG(s->avctx,AV_LOG_DEBUG,"start skip: %i\n",skip);
+ dprintf(s->avctx, "start skip: %i\n",skip);
}
/** sometimes true for the last frame */
if (get_bits1(gb)) {
skip = get_bits(gb,av_log2(s->samples_per_frame * 2));
- DBG(s->avctx,AV_LOG_DEBUG,"end skip: %i\n",skip);
+ dprintf(s->avctx, "end skip: %i\n",skip);
}
}
- DBG(s->avctx,AV_LOG_DEBUG,"BITSTREAM: frame header length was %i\n",
+ dprintf(s->avctx, "BITSTREAM: frame header length was %i\n",
get_bits_count(gb) - s->frame_offset);
/** reset subframe states */
@@ -1706,7 +1700,7 @@ static int decode_packet(AVCodecContext
/** get number of bits that need to be added to the previous frame */
num_bits_prev_frame = get_bits(&gb, s->log2_frame_size);
- DBG(avctx, AV_LOG_DEBUG, "packet[%d]: nbpf %x\n", avctx->frame_number,
+ dprintf(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
num_bits_prev_frame);
/** check for packet loss */
@@ -1722,14 +1716,14 @@ static int decode_packet(AVCodecContext
/** append the previous frame data to the remaining data from the
previous packet to create a full frame */
save_bits(s, &gb, num_bits_prev_frame, 1);
- DBG(avctx, AV_LOG_DEBUG, "accumulated %x bits of frame data\n",
+ dprintf(avctx, "accumulated %x bits of frame data\n",
s->num_saved_bits - s->frame_offset);
/** decode the cross packet frame if it is valid */
if (!s->packet_loss)
decode_frame(s);
} else if (s->num_saved_bits - s->frame_offset) {
- DBG(avctx, AV_LOG_DEBUG, "ignoring %x previously saved bits\n",
+ dprintf(avctx, "ignoring %x previously saved bits\n",
s->num_saved_bits - s->frame_offset);
}
@@ -1747,7 +1741,7 @@ static int decode_packet(AVCodecContext
more_frames = decode_frame(s);
if (!more_frames) {
- DBG(avctx, AV_LOG_DEBUG, "no more frames\n");
+ dprintf(avctx, "no more frames\n");
}
} else
more_frames = 0;
More information about the FFmpeg-soc
mailing list