aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-01 15:51:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-01 16:12:38 +0200
commit31ab1575e59e33957864d1bdf13253f8d366ccba (patch)
tree074dd6605a3d7e0a42b6cd12d2f071fe25d3d25a /libavcodec
parentadc5539e7b94a94114d591d83e7ae63f52b5916f (diff)
parent1218777ffd152287244349d4ff9e1cbc84fa2c54 (diff)
downloadffmpeg-31ab1575e59e33957864d1bdf13253f8d366ccba.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: avcodec: Convert some commented-out printf/av_log instances to av_dlog avcodec: Drop silly and/or broken printf debug output avcodec: Drop some silly commented-out av_log() invocations avformat: Convert some commented-out printf/av_log instances to av_dlog avformat: Remove non-compiling and/or silly commented-out printf/av_log statements Remove some silly disabled code. ac3dec: ensure get_buffer() gets a buffer for the correct number of channels Conflicts: libavcodec/dnxhddec.c libavcodec/ffv1.c libavcodec/h264.c libavcodec/h264_parser.c libavcodec/mjpegdec.c libavcodec/motion_est_template.c libavcodec/mpegaudiodec.c libavcodec/mpegvideo_enc.c libavcodec/put_bits.h libavcodec/ratecontrol.c libavcodec/wmaenc.c libavdevice/timefilter.c libavformat/asfdec.c libavformat/avidec.c libavformat/avienc.c libavformat/flvenc.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aaccoder.c3
-rw-r--r--libavcodec/ac3dec.c1
-rw-r--r--libavcodec/adpcm.c1
-rw-r--r--libavcodec/cook.c9
-rw-r--r--libavcodec/dcadec.c4
-rw-r--r--libavcodec/dnxhddec.c5
-rw-r--r--libavcodec/error_resilience.c3
-rw-r--r--libavcodec/ffv1.c21
-rw-r--r--libavcodec/flicvideo.c4
-rw-r--r--libavcodec/golomb.h2
-rw-r--r--libavcodec/h263dec.c5
-rw-r--r--libavcodec/h264.c3
-rw-r--r--libavcodec/h264_cabac.c16
-rw-r--r--libavcodec/h264_parser.c1
-rw-r--r--libavcodec/imc.c4
-rw-r--r--libavcodec/jpegls.c2
-rw-r--r--libavcodec/jpeglsdec.c10
-rw-r--r--libavcodec/ljpegenc.c1
-rw-r--r--libavcodec/mjpegdec.c24
-rw-r--r--libavcodec/mjpegenc.c1
-rw-r--r--libavcodec/motion_est.c14
-rw-r--r--libavcodec/motion_est_template.c14
-rw-r--r--libavcodec/mpeg12.c13
-rw-r--r--libavcodec/mpegaudiodec.c9
-rw-r--r--libavcodec/mpegvideo.c13
-rw-r--r--libavcodec/mpegvideo_enc.c28
-rw-r--r--libavcodec/msmpeg4.c22
-rw-r--r--libavcodec/msmpeg4enc.c6
-rw-r--r--libavcodec/parser.c1
-rw-r--r--libavcodec/put_bits.h3
-rw-r--r--libavcodec/ratecontrol.c36
-rw-r--r--libavcodec/rv10.c7
-rw-r--r--libavcodec/svq1dec.c4
-rw-r--r--libavcodec/utils.c1
-rw-r--r--libavcodec/vc1.c7
-rw-r--r--libavcodec/vc1dec.c3
-rw-r--r--libavcodec/vorbis.c4
-rw-r--r--libavcodec/vp3.c3
-rw-r--r--libavcodec/wmadec.c7
-rw-r--r--libavcodec/wmaenc.c1
-rw-r--r--libavcodec/wmv2dec.c15
-rw-r--r--libavcodec/x86/mpegvideo.c4
42 files changed, 120 insertions, 215 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index e66dcb8405..994de286c9 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -585,7 +585,6 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
q0 = coef2minsf(q0f);
//maximum scalefactor index is when maximum coefficient after quantizing is still not zero
q1 = coef2maxsf(q1f);
- //av_log(NULL, AV_LOG_ERROR, "q0 %d, q1 %d\n", q0, q1);
if (q1 - q0 > 60) {
int q0low = q0;
int q1high = q1;
@@ -593,7 +592,6 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
int qnrg = av_clip_uint8(log2f(sqrtf(qnrgf/qcnt))*4 - 31 + SCALE_ONE_POS - SCALE_DIV_512);
q1 = qnrg + 30;
q0 = qnrg - 30;
- //av_log(NULL, AV_LOG_ERROR, "q0 %d, q1 %d\n", q0, q1);
if (q0 < q0low) {
q1 += q0low - q0;
q0 = q0low;
@@ -602,7 +600,6 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
q1 = q1high;
}
}
- //av_log(NULL, AV_LOG_ERROR, "q0 %d, q1 %d\n", q0, q1);
for (i = 0; i < TRELLIS_STATES; i++) {
paths[0][i].cost = 0.0f;
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index c608de83e2..674de7a62b 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1377,6 +1377,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
/* get output buffer */
+ avctx->channels = s->out_channels;
s->frame.nb_samples = s->num_blocks * 256;
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index c779f8b572..852549638b 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -353,7 +353,6 @@ static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_
//read bits & initial values
nb_bits = get_bits(&gb, 2)+2;
- //av_log(NULL,AV_LOG_INFO,"nb_bits: %d\n", nb_bits);
table = swf_index_tables[nb_bits-2];
k0 = 1 << (nb_bits-2);
signmask = 1 << (nb_bits-1);
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 19c48ed633..cca97e3046 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -420,11 +420,9 @@ static void categorize(COOKContext *q, COOKSubpacket *p, const int *quant_index_
bits_left = p->bits_per_subpacket - get_bits_count(&q->gb);
- if (bits_left > q->samples_per_channel) {
+ if (bits_left > q->samples_per_channel)
bits_left = q->samples_per_channel +
((bits_left - q->samples_per_channel) * 5) / 8;
- //av_log(q->avctx, AV_LOG_ERROR, "bits_left = %d\n",bits_left);
- }
bias = -32;
@@ -936,10 +934,7 @@ static int decode_subpacket(COOKContext *q, COOKSubpacket *p,
{
int sub_packet_size = p->size;
int res;
- /* packet dump */
- // for (i = 0; i < sub_packet_size ; i++)
- // av_log(q->avctx, AV_LOG_ERROR, "%02x", inbuffer[i]);
- // av_log(q->avctx, AV_LOG_ERROR, "\n");
+
memset(q->decode_buffer_1, 0, sizeof(q->decode_buffer_1));
decode_bytes_and_gain(q, p, inbuffer, &p->gains1);
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 07a29f5b99..4e9f957660 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -861,8 +861,8 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
}
if (s->bitalloc[j][k] > 26) {
- // av_log(s->avctx, AV_LOG_DEBUG, "bitalloc index [%i][%i] too big (%i)\n",
- // j, k, s->bitalloc[j][k]);
+ av_dlog(s->avctx, "bitalloc index [%i][%i] too big (%i)\n",
+ j, k, s->bitalloc[j][k]);
return AVERROR_INVALIDDATA;
}
}
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index ea2074b66b..bbf89bf938 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -223,7 +223,6 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,
ctx->last_dc[component] += level;
}
block[0] = ctx->last_dc[component];
- //av_log(ctx->avctx, AV_LOG_DEBUG, "dc %d\n", block[0]);
i = 0;
@@ -256,14 +255,11 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,
}
j = ctx->scantable.permutated[i];
- //av_log(ctx->avctx, AV_LOG_DEBUG, "j %d\n", j);
- //av_log(ctx->avctx, AV_LOG_DEBUG, "level %d, weight %d\n", level, weight_matrix[i]);
level *= scale[i];
if (level_bias < 32 || weight_matrix[i] != level_bias)
level += level_bias;
level >>= level_shift;
- //av_log(NULL, AV_LOG_DEBUG, "i %d, j %d, end level %d\n", i, j, level);
block[j] = (level^sign) - sign;
UPDATE_CACHE(bs, &ctx->gb);
@@ -297,7 +293,6 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, int x, int y)
qscale = get_bits(&ctx->gb, 11);
skip_bits1(&ctx->gb);
- //av_log(ctx->avctx, AV_LOG_DEBUG, "qscale %d\n", qscale);
if (qscale != ctx->last_qscale) {
for (i = 0; i < 64; i++) {
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 6ae06f2ad1..7ddc5ac052 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -724,8 +724,6 @@ skip_last_mv:
fixed[mb_xy] = MV_UNCHANGED;
}
}
-
- // printf(".%d/%d", changed, score_sum); fflush(stdout);
}
if (none_left)
@@ -736,7 +734,6 @@ skip_last_mv:
if (fixed[mb_xy])
fixed[mb_xy] = MV_FROZEN;
}
- // printf(":"); fflush(stdout);
}
}
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 572bcbb2df..7c68b2f602 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -405,7 +405,6 @@ static inline void update_vlc_state(VlcState * const state, const int v){
static inline void put_vlc_symbol(PutBitContext *pb, VlcState * const state, int v, int bits){
int i, k, code;
-//printf("final: %d ", v);
v = fold(v - state->bias, bits);
i= state->count;
@@ -424,7 +423,8 @@ static inline void put_vlc_symbol(PutBitContext *pb, VlcState * const state, int
code= v ^ ((2*state->drift + state->count)>>31);
#endif
-//printf("v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code, state->bias, state->error_sum, state->drift, state->count, k);
+ av_dlog(NULL, "v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code,
+ state->bias, state->error_sum, state->drift, state->count, k);
set_sr_golomb(pb, code, k, 12, bits);
update_vlc_state(state, v);
@@ -443,7 +443,8 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int
assert(k<=8);
v= get_sr_golomb(gb, k, 12, bits);
-//printf("v:%d bias:%d error:%d drift:%d count:%d k:%d", v, state->bias, state->error_sum, state->drift, state->count, k);
+ av_dlog(NULL, "v:%d bias:%d error:%d drift:%d count:%d k:%d",
+ v, state->bias, state->error_sum, state->drift, state->count, k);
#if 0 // JPEG LS
if(k==0 && 2*state->drift <= - state->count) v ^= (-1);
@@ -454,7 +455,7 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int
ret= fold(v + state->bias, bits);
update_vlc_state(state, v);
-//printf("final: %d\n", ret);
+
return ret;
}
@@ -523,7 +524,9 @@ static av_always_inline int encode_line(FFV1Context *s, int w,
}
}
-// printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, (int)put_bits_count(&s->pb));
+ av_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
+ run_count, run_index, run_mode, x,
+ (int)put_bits_count(&s->pb));
if(run_mode == 0)
put_vlc_symbol(&s->pb, &p->vlc_state[context], diff, bits);
@@ -1488,7 +1491,8 @@ static av_always_inline void decode_line(FFV1Context *s, int w,
}else
diff= get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);
-// printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, get_bits_count(&s->gb));
+ av_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
+ run_count, run_index, run_mode, x, get_bits_count(&s->gb));
}
if(sign) diff= -diff;
@@ -1734,8 +1738,6 @@ static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale){
while(len--){
quant_table[i] = scale*v;
i++;
-//printf("%2d ",v);
-//if(i%16==0) printf("\n");
}
}
@@ -1945,7 +1947,8 @@ static int read_header(FFV1Context *f){
return -1;
}
-//printf("%d %d %d\n", f->chroma_h_shift, f->chroma_v_shift,f->avctx->pix_fmt);
+ av_dlog(f->avctx, "%d %d %d\n",
+ f->chroma_h_shift, f->chroma_v_shift, f->avctx->pix_fmt);
if(f->version < 2){
context_count= read_quant_tables(c, f->quant_table);
if(context_count < 0){
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 81ae360f72..6a11122698 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -539,7 +539,9 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
/* For some reason, it seems that non-palettized flics do
* include one of these chunks in their first frame.
* Why I do not know, it seems rather extraneous. */
-/* av_log(avctx, AV_LOG_ERROR, "Unexpected Palette chunk %d in non-paletised FLC\n",chunk_type);*/
+ av_dlog(avctx,
+ "Unexpected Palette chunk %d in non-palettized FLC\n",
+ chunk_type);
bytestream2_skip(&g2, chunk_size - 6);
break;
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 50d786b6d5..0ce1b34959 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -465,8 +465,6 @@ static inline void set_te_golomb(PutBitContext *pb, int i, int range){
* write signed exp golomb code. 16 bits at most.
*/
static inline void set_se_golomb(PutBitContext *pb, int i){
-// if (i>32767 || i<-32767)
-// av_log(NULL,AV_LOG_ERROR,"value out of range %d\n", i);
#if 0
if(i<=0) i= -2*i;
else i= 2*i-1;
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index ef1b6ed62c..fd5047f73a 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -221,7 +221,8 @@ static int decode_slice(MpegEncContext *s){
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
// s->mb_skipped = 0;
-//printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
+ av_dlog(s, "%d %d %06X\n",
+ ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
ret= s->decode_mb(s, s->block);
if (s->pict_type!=AV_PICTURE_TYPE_B)
@@ -234,7 +235,6 @@ static int decode_slice(MpegEncContext *s){
if(s->loop_filter)
ff_h263_loop_filter(s);
-//printf("%d %d %d %06X\n", s->mb_x, s->mb_y, s->gb.size*8 - get_bits_count(&s->gb), show_bits(&s->gb, 24));
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, ER_MB_END&part_mask);
s->padding_bug_score--;
@@ -538,7 +538,6 @@ retry:
if(s->divx_version>=0)
s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE;
-//printf("padding_bug_score: %d\n", s->padding_bug_score);
if(s->divx_version==501 && s->divx_build==20020416)
s->padding_bug_score= 256*256*256*64;
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index fe3bac0eae..9c79f35189 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -254,7 +254,6 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src,
}
}
- // printf("decoding esc\n");
memcpy(dst, src, i);
si = di = i;
while (si + 2 < length) {
@@ -2135,7 +2134,6 @@ static int init_poc(H264Context *h)
h->poc_msb = h->prev_poc_msb - max_poc_lsb;
else
h->poc_msb = h->prev_poc_msb;
- // printf("poc: %d %d\n", h->poc_msb, h->poc_lsb);
field_poc[0] =
field_poc[1] = h->poc_msb + h->poc_lsb;
if (s->picture_structure == PICT_FRAME)
@@ -4149,7 +4147,6 @@ not_extra:
assert(pict->data[0] || !*data_size);
ff_print_debug_info(s, pict);
- // printf("out %d\n", (int)pict->data[0]);
return get_consumed_bytes(s, buf_index, buf_size);
}
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 1c4288a79b..a064292dac 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1814,7 +1814,6 @@ static av_always_inline void decode_cabac_luma_residual( H264Context *h, const u
MpegEncContext * const s = &h->s;
int qscale = p == 0 ? s->qscale : h->chroma_qp[p-1];
if( IS_INTRA16x16( mb_type ) ) {
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 DC\n" );
AV_ZERO128(h->mb_luma_dc[p]+0);
AV_ZERO128(h->mb_luma_dc[p]+8);
AV_ZERO128(h->mb_luma_dc[p]+16);
@@ -1825,7 +1824,6 @@ static av_always_inline void decode_cabac_luma_residual( H264Context *h, const u
qmul = h->dequant4_coeff[p][qscale];
for( i4x4 = 0; i4x4 < 16; i4x4++ ) {
const int index = 16*p + i4x4;
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 AC:%d\n", index );
decode_cabac_residual_nondc(h, h->mb + (16*index << pixel_shift), ctx_cat[1][p], index, scan + 1, qmul, 15);
}
} else {
@@ -1843,7 +1841,6 @@ static av_always_inline void decode_cabac_luma_residual( H264Context *h, const u
qmul = h->dequant4_coeff[cqm][qscale];
for( i4x4 = 0; i4x4 < 4; i4x4++ ) {
const int index = 16*p + 4*i8x8 + i4x4;
- //av_log( s->avctx, AV_LOG_ERROR, "Luma4x4: %d\n", index );
//START_TIMER
decode_cabac_residual_nondc(h, h->mb + (16*index << pixel_shift), ctx_cat[2][p], index, scan, qmul, 16);
//STOP_TIMER("decode_residual")
@@ -2029,7 +2026,8 @@ decode_intra_mb:
int pred = pred_intra_mode( h, i );
h->intra4x4_pred_mode_cache[ scan8[i] ] = decode_cabac_mb_intra4x4_pred_mode( h, pred );
- //av_log( s->avctx, AV_LOG_ERROR, "i4x4 pred=%d mode=%d\n", pred, h->intra4x4_pred_mode_cache[ scan8[i] ] );
+ av_dlog(s->avctx, "i4x4 pred=%d mode=%d\n", pred,
+ h->intra4x4_pred_mode_cache[scan8[i]]);
}
}
write_back_intra_pred_mode(h);
@@ -2350,12 +2348,10 @@ decode_intra_mb:
} else if (CHROMA422) {
if( cbp&0x30 ){
int c;
- for( c = 0; c < 2; c++ ) {
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-DC\n",c );
+ for (c = 0; c < 2; c++)
decode_cabac_residual_dc_422(h, h->mb + ((256 + 16*16*c) << pixel_shift), 3,
CHROMA_DC_BLOCK_INDEX + c,
chroma422_dc_scan, 8);
- }
}
if( cbp&0x20 ) {
@@ -2366,7 +2362,6 @@ decode_intra_mb:
for (i8x8 = 0; i8x8 < 2; i8x8++) {
for (i = 0; i < 4; i++) {
const int index = 16 + 16 * c + 8*i8x8 + i;
- //av_log(s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16);
decode_cabac_residual_nondc(h, mb, 4, index, scan + 1, qmul, 15);
mb += 16<<pixel_shift;
}
@@ -2379,10 +2374,8 @@ decode_intra_mb:
} else /* yuv420 */ {
if( cbp&0x30 ){
int c;
- for( c = 0; c < 2; c++ ) {
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-DC\n",c );
+ for (c = 0; c < 2; c++)
decode_cabac_residual_dc(h, h->mb + ((256 + 16*16*c) << pixel_shift), 3, CHROMA_DC_BLOCK_INDEX+c, chroma_dc_scan, 4);
- }
}
if( cbp&0x20 ) {
@@ -2391,7 +2384,6 @@ decode_intra_mb:
qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]];
for( i = 0; i < 4; i++ ) {
const int index = 16 + 16 * c + i;
- //av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16 );
decode_cabac_residual_nondc(h, h->mb + (16*index << pixel_shift), 4, index, scan + 1, qmul, 15);
}
}
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index d042edcc7f..2628195844 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -39,7 +39,6 @@ static int ff_h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_si
ParseContext *pc = &(h->s.parse_context);
int next_avc= h->is_avc ? 0 : buf_size;
-//printf("first %02X%02X%02X%02X\n", buf[0], buf[1],buf[2],buf[3]);
// mb_addr= pc->mb_addr - 1;
state= pc->state;
if(state>13)
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 73f1de3ac7..d12c7551e9 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -743,7 +743,7 @@ static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx)
cw = 0;
if (get_bits_count(&q->gb) + cw_len > 512) {
- // av_log(NULL, 0, "Band %i coeff %i cw_len %i\n", i, j, cw_len);
+ av_dlog(NULL, "Band %i coeff %i cw_len %i\n", i, j, cw_len);
return AVERROR_INVALIDDATA;
}
@@ -782,8 +782,6 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
return AVERROR_PATCHWELCOME;
}
-// av_log(avctx, AV_LOG_DEBUG, "stream_format_code = %d\n", stream_format_code);
-
if (stream_format_code & 0x04)
chctx->decoder_reset = 1;
diff --git a/libavcodec/jpegls.c b/libavcodec/jpegls.c
index f1ce16e0d8..dc5c9cfab1 100644
--- a/libavcodec/jpegls.c
+++ b/libavcodec/jpegls.c
@@ -83,5 +83,5 @@ void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all){
}
if(s->reset==0 || reset_all) s->reset= 64;
-// av_log(NULL, AV_LOG_DEBUG, "[JPEG-LS RESET] T=%i,%i,%i\n", s->T1, s->T2, s->T3);
+ av_dlog(NULL, "[JPEG-LS RESET] T=%i,%i,%i\n", s->T1, s->T2, s->T3);
}
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 879922a0e0..f89c515195 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -78,7 +78,7 @@ int ff_jpegls_decode_lse(MJpegDecodeContext *s)
av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id);
return -1;
}
-// av_log(s->avctx, AV_LOG_DEBUG, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
+ av_dlog(s->avctx, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
return 0;
}
@@ -285,8 +285,12 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
else
shift = point_transform + (16 - s->bits);
-// av_log(s->avctx, AV_LOG_DEBUG, "JPEG-LS params: %ix%i NEAR=%i MV=%i T(%i,%i,%i) RESET=%i, LIMIT=%i, qbpp=%i, RANGE=%i\n",s->width,s->height,state->near,state->maxval,state->T1,state->T2,state->T3,state->reset,state->limit,state->qbpp, state->range);
-// av_log(s->avctx, AV_LOG_DEBUG, "JPEG params: ILV=%i Pt=%i BPP=%i, scan = %i\n", ilv, point_transform, s->bits, s->cur_scan);
+ av_dlog(s->avctx, "JPEG-LS params: %ix%i NEAR=%i MV=%i T(%i,%i,%i) RESET=%i, LIMIT=%i, qbpp=%i, RANGE=%i\n",
+ s->width, s->height, state->near, state->maxval,
+ state->T1, state->T2, state->T3,
+ state->reset, state->limit, state->qbpp, state->range);
+ av_dlog(s->avctx, "JPEG params: ILV=%i Pt=%i BPP=%i, scan = %i\n",
+ ilv, point_transform, s->bits, s->cur_scan);
if(ilv == 0) { /* separate planes */
stride = (s->nb_components > 1) ? 3 : 1;
off = av_clip(s->cur_scan - 1, 0, stride);
diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
index aa6abe9888..8703a6efdd 100644
--- a/libavcodec/ljpegenc.c
+++ b/libavcodec/ljpegenc.c
@@ -180,7 +180,6 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
int pred;
ptr = p->data[i] + (linesize * (v * mb_y + y)) + (h * mb_x + x); //FIXME optimize this crap
-//printf("%d %d %d %d %8X\n", mb_x, mb_y, x, y, ptr);
PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
if(i==0)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index d829b1b53f..677dfb275f 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -436,9 +436,9 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
for (i = 0; i < 3; i++)
s->linesize[i] = s->picture_ptr->linesize[i] << s->interlaced;
-// printf("%d %d %d %d %d %d\n",
-// s->width, s->height, s->linesize[0], s->linesize[1],
-// s->interlaced, s->avctx->height);
+ av_dlog(s->avctx, "%d %d %d %d %d %d\n",
+ s->width, s->height, s->linesize[0], s->linesize[1],
+ s->interlaced, s->avctx->height);
if (len != (8 + (3 * nb_components)))
av_log(s->avctx, AV_LOG_DEBUG, "decode_sof0: error, len(%d) mismatch\n", len);
@@ -1047,11 +1047,10 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
return AVERROR_INVALIDDATA;
}
}
- // av_log(s->avctx, AV_LOG_DEBUG, "mb: %d %d processed\n",
- // mb_y, mb_x);
- // av_log(NULL, AV_LOG_DEBUG, "%d %d %d %d %d %d %d %d \n",
- // mb_x, mb_y, x, y, c, s->bottom_field,
- // (v * mb_y + y) * 8, (h * mb_x + x) * 8);
+ av_dlog(s->avctx, "mb: %d %d processed\n", mb_y, mb_x);
+ av_dlog(s->avctx, "%d %d %d %d %d %d %d %d \n",
+ mb_x, mb_y, x, y, c, s->bottom_field,
+ (v * mb_y + y) * 8, (h * mb_x + x) * 8);
if (++x == h) {
x = 0;
y++;
@@ -1331,8 +1330,6 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
4bytes field_size_less_padding
*/
s->buggy_avid = 1;
-// if (s->first_picture)
-// printf("mjpeg: workarounding buggy AVID\n");
i = get_bits(&s->gb, 8); len--;
av_log(s->avctx, AV_LOG_DEBUG, "polarity %d\n", i);
#if 0
@@ -1341,8 +1338,6 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
skip_bits(&s->gb, 32);
len -= 10;
#endif
-// if (s->interlace_polarity)
-// printf("mjpeg: interlace polarity: %d\n", s->interlace_polarity);
goto out;
}
@@ -1464,8 +1459,6 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
/* buggy avid, it puts EOI only at every 10th frame */
if (!strcmp(cbuf, "AVID")) {
s->buggy_avid = 1;
- // if (s->first_picture)
- // printf("mjpeg: workarounding buggy AVID\n");
} else if (!strcmp(cbuf, "CS=ITU601"))
s->cs_itu601 = 1;
else if ((len > 31 && !strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32)) ||
@@ -1741,9 +1734,6 @@ eoi_parser:
av_log(avctx, AV_LOG_ERROR,
"mjpeg: unsupported coding type (%x)\n", start_code);
break;
-// default:
-// printf("mjpeg: unsupported marker (%x)\n", start_code);
-// break;
}
/* eof process start code */
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 4c4170382f..b3ead99eab 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -339,7 +339,6 @@ static void escape_FF(MpegEncContext *s, int start)
int v= buf[i];
if(v==0xFF){
-//printf("%d %d\n", i, ff_count);
buf[i+ff_count]= 0;
ff_count--;
}
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index a85605770d..1e4aa84bef 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -395,12 +395,10 @@ static int sad_hpel_motion_search(MpegEncContext * s,
assert(flags == 0);
if(c->skip){
-// printf("S");
*mx_ptr = 0;
*my_ptr = 0;
return dmin;
}
-// printf("N");
pix = c->src[src_index][0];
@@ -1325,7 +1323,6 @@ static int ff_estimate_motion_b(MpegEncContext * s,
if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
dmin= get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1);
-//printf("%d %d %d %d//", s->mb_x, s->mb_y, mx, my);
// s->mb_type[mb_y*s->mb_width + mb_x]= mb_type;
mv_table[mot_xy][0]= mx;
mv_table[mot_xy][1]= my;
@@ -1734,11 +1731,11 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
c->skip=0;
bmin= ff_estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code) + 2*penalty_factor;
-//printf(" %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]);
+ av_dlog(s, " %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]);
c->skip=0;
fbmin= bidir_refine(s, mb_x, mb_y) + penalty_factor;
-//printf("%d %d %d %d\n", dmin, fmin, bmin, fbmin);
+ av_dlog(s, "%d %d %d %d\n", dmin, fmin, bmin, fbmin);
if(s->flags & CODEC_FLAG_INTERLACED_ME){
//FIXME mb type penalty
@@ -1848,15 +1845,9 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
best_score= score[i];
best_fcode= i;
}
-// printf("%d %d\n", i, score[i]);
}
-// printf("fcode: %d type: %d\n", i, s->pict_type);
return best_fcode;
-/* for(i=0; i<=MAX_FCODE; i++){
- printf("%d ", mv_num[i]);
- }
- printf("\n");*/
}else{
return 1;
}
@@ -1876,7 +1867,6 @@ void ff_fix_long_p_mvs(MpegEncContext * s)
if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
-//printf("%d no:%d %d//\n", clip, noclip, f_code);
if(s->flags&CODEC_FLAG_4MV){
const int wrap= s->b8_stride;
diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c
index 0d732590d0..07bfc00bf7 100644
--- a/libavcodec/motion_est_template.c
+++ b/libavcodec/motion_est_template.c
@@ -363,13 +363,11 @@ static int qpel_motion_search(MpegEncContext * s,
av_assert2((x) <= xmax);\
av_assert2((y) >= ymin);\
av_assert2((y) <= ymax);\
-/*printf("check_mv %d %d\n", x, y);*/\
if(map[index]!=key){\
d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
map[index]= key;\
score_map[index]= d;\
d += (mv_penalty[((x)<<shift)-pred_x] + mv_penalty[((y)<<shift)-pred_y])*penalty_factor;\
-/*printf("score:%d\n", d);*/\
COPY3_IF_LT(dmin, d, best[0], x, best[1], y)\
}\
}
@@ -387,13 +385,11 @@ static int qpel_motion_search(MpegEncContext * s,
{\
const unsigned key = ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\
const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\
-/*printf("check_mv_dir %d %d %d\n", x, y, new_dir);*/\
if(map[index]!=key){\
d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
map[index]= key;\
score_map[index]= d;\
d += (mv_penalty[((x)<<shift)-pred_x] + mv_penalty[((y)<<shift)-pred_y])*penalty_factor;\
-/*printf("score:%d\n", d);*/\
if(d<dmin){\
best[0]=x;\
best[1]=y;\
@@ -444,7 +440,6 @@ static av_always_inline int small_diamond_search(MpegEncContext * s, int *best,
const int y= best[1];
next_dir=-1;
-//printf("%d", dir);
if(dir!=2 && x>xmin) CHECK_MV_DIR(x-1, y , 0)
if(dir!=3 && y>ymin) CHECK_MV_DIR(x , y-1, 1)
if(dir!=0 && x<xmax) CHECK_MV_DIR(x+1, y , 2)
@@ -656,13 +651,11 @@ static int full_search(MpegEncContext * s, int *best, int dmin,
{\
const unsigned key = ((ay)<<ME_MAP_MV_BITS) + (ax) + map_generation;\
const int index= (((ay)<<ME_MAP_SHIFT) + (ax))&(ME_MAP_SIZE-1);\
-/*printf("sab check %d %d\n", ax, ay);*/\
if(map[index]!=key){\
d= cmp(s, ax, ay, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\
map[index]= key;\
score_map[index]= d;\
d += (mv_penalty[((ax)<<shift)-pred_x] + mv_penalty[((ay)<<shift)-pred_y])*penalty_factor;\
-/*printf("score: %d\n", d);*/\
if(d < minima[minima_count-1].height){\
int j=0;\
\
@@ -970,7 +963,6 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int
*mx_ptr= best[0];
*my_ptr= best[1];
-// printf("%d %d %d \n", best[0], best[1], dmin);
return dmin;
}
@@ -1016,7 +1008,7 @@ static int epzs_motion_search4(MpegEncContext * s,
map_generation= update_map_generation(c);
dmin = 1000000;
-//printf("%d %d %d %d //",xmin, ymin, xmax, ymax);
+
/* first line */
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
@@ -1046,7 +1038,6 @@ static int epzs_motion_search4(MpegEncContext * s,
*mx_ptr= best[0];
*my_ptr= best[1];
-// printf("%d %d %d \n", best[0], best[1], dmin);
return dmin;
}
@@ -1076,7 +1067,7 @@ static int epzs_motion_search2(MpegEncContext * s,
map_generation= update_map_generation(c);
dmin = 1000000;
-//printf("%d %d %d %d //",xmin, ymin, xmax, ymax);
+
/* first line */
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
@@ -1106,6 +1097,5 @@ static int epzs_motion_search2(MpegEncContext * s,
*mx_ptr= best[0];
*my_ptr= best[1];
-// printf("%d %d %d \n", best[0], best[1], dmin);
return dmin;
}
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 1d3d40d9b8..4683f011db 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1326,8 +1326,10 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
//res_change_ffmpeg_aspect.ts 4/3 225/44 ->4/3
//widescreen-issue562.mpg 4/3 16/9 -> 16/9
// s->avctx->sample_aspect_ratio = av_mul_q(s->avctx->sample_aspect_ratio, (AVRational) {s->width, s->height});
-//av_log(NULL, AV_LOG_ERROR, "A %d/%d\n", ff_mpeg2_aspect[s->aspect_ratio_info].num, ff_mpeg2_aspect[s->aspect_ratio_info].den);
-//av_log(NULL, AV_LOG_ERROR, "B %d/%d\n", s->avctx->sample_aspect_ratio.num, s->avctx->sample_aspect_ratio.den);
+ av_dlog(avctx, "A %d/%d\n",
+ ff_mpeg2_aspect[s->aspect_ratio_info].num, ff_mpeg2_aspect[s->aspect_ratio_info].den);
+ av_dlog(avctx, "B %d/%d\n", s->avctx->sample_aspect_ratio.num,
+ s->avctx->sample_aspect_ratio.den);
}
} else {
s->avctx->sample_aspect_ratio =
@@ -1881,7 +1883,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
}
eos: // end of slice
*buf += (get_bits_count(&s->gb)-1)/8;
-//printf("y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
+ av_dlog(s, "y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
return 0;
}
@@ -1900,8 +1902,9 @@ static int slice_decode_thread(AVCodecContext *c, void *arg)
ret = mpeg_decode_slice(s, mb_y, &buf, s->gb.buffer_end - buf);
emms_c();
-//av_log(c, AV_LOG_DEBUG, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
-//ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, s->start_mb_y, s->end_mb_y, s->error_count);
+ av_dlog(c, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
+ ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y,
+ s->start_mb_y, s->end_mb_y, s->error_count);
if (ret < 0) {
if (c->err_recognition & AV_EF_EXPLODE)
return ret;
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 46ce874e90..6ef1f6b427 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -892,9 +892,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
int pos = get_bits_count(&s->gb);
if (pos >= end_pos){
-// av_log(NULL, AV_LOG_ERROR, "pos: %d %d %d %d\n", pos, end_pos, end_pos2, s_index);
switch_buffer(s, &pos, &end_pos, &end_pos2);
-// av_log(NULL, AV_LOG_ERROR, "new pos: %d %d\n", pos, end_pos);
if (pos >= end_pos)
break;
}
@@ -968,9 +966,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
s_index=0;
break;
}
-// av_log(NULL, AV_LOG_ERROR, "pos2: %d %d %d %d\n", pos, end_pos, end_pos2, s_index);
switch_buffer(s, &pos, &end_pos, &end_pos2);
-// av_log(NULL, AV_LOG_ERROR, "new pos2: %d %d %d\n", pos, end_pos, s_index);
if (pos >= end_pos)
break;
}
@@ -993,7 +989,6 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
}
/* skip extension bits */
bits_left = end_pos2 - get_bits_count(&s->gb);
-//av_log(NULL, AV_LOG_ERROR, "left:%d buf:%p\n", bits_left, s->in_gb.buffer);
if (bits_left < 0 && (s->err_recognition & (AV_EF_BUFFER|AV_EF_COMPLIANT))) {
av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
s_index=0;
@@ -1406,8 +1401,8 @@ static int mp_decode_layer3(MPADecodeContext *s)
int extrasize = av_clip(get_bits_left(&s->gb) >> 3, 0, EXTRABYTES);
av_assert1((get_bits_count(&s->gb) & 7) == 0);
/* now we get bits from the main_data_begin offset */
- av_dlog(s->avctx, "seekback: %d\n", main_data_begin);
- //av_log(NULL, AV_LOG_ERROR, "backstep:%d, lastbuf:%d\n", main_data_begin, s->last_buf_size);
+ av_dlog(s->avctx, "seekback:%d, lastbuf:%d\n",
+ main_data_begin, s->last_buf_size);
memcpy(s->last_buf + s->last_buf_size, ptr, extrasize);
s->in_gb = s->gb;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 9e1f67c016..461ecaf88f 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1383,12 +1383,12 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
if (!s->dropable)
s->next_picture_ptr = s->current_picture_ptr;
}
- /* av_log(s->avctx, AV_LOG_DEBUG, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n",
- s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr,
- s->last_picture_ptr ? s->last_picture_ptr->f.data[0] : NULL,
- s->next_picture_ptr ? s->next_picture_ptr->f.data[0] : NULL,
- s->current_picture_ptr ? s->current_picture_ptr->f.data[0] : NULL,
- s->pict_type, s->dropable); */
+ av_dlog(s->avctx, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n",
+ s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr,
+ s->last_picture_ptr ? s->last_picture_ptr->f.data[0] : NULL,
+ s->next_picture_ptr ? s->next_picture_ptr->f.data[0] : NULL,
+ s->current_picture_ptr ? s->current_picture_ptr->f.data[0] : NULL,
+ s->pict_type, s->dropable);
if (s->codec_id != AV_CODEC_ID_H264) {
if ((s->last_picture_ptr == NULL ||
@@ -1738,7 +1738,6 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict)
else
av_log(s->avctx, AV_LOG_DEBUG, " ");
}
- // av_log(s->avctx, AV_LOG_DEBUG, " ");
}
av_log(s->avctx, AV_LOG_DEBUG, "\n");
}
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 4322d65e73..d7aad625c3 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1011,8 +1011,8 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg)
if (pic_arg->linesize[2] != s->uvlinesize)
direct = 0;
- //av_log(AV_LOG_DEBUG, "%d %d %d %d\n",pic_arg->linesize[0],
- // pic_arg->linesize[1], s->linesize, s->uvlinesize);
+ av_dlog(s->avctx, "%d %d %d %d\n", pic_arg->linesize[0],
+ pic_arg->linesize[1], s->linesize, s->uvlinesize);
if (direct) {
i = ff_find_unused_picture(s, 1);
@@ -1291,10 +1291,6 @@ static int select_input_picture(MpegEncContext *s)
if (s->picture_in_gop_number < s->gop_size &&
skip_check(s, s->input_picture[0], s->next_picture_ptr)) {
// FIXME check that te gop check above is +-1 correct
- //av_log(NULL, AV_LOG_DEBUG, "skip %p %"PRId64"\n",
- // s->input_picture[0]->f.data[0],
- // s->input_picture[0]->pts);
-
if (s->input_picture[0]->f.type == FF_BUFFER_TYPE_SHARED) {
for (i = 0; i < 4; i++)
s->input_picture[0]->f.data[i] = NULL;
@@ -1366,9 +1362,6 @@ static int select_input_picture(MpegEncContext *s)
}
emms_c();
- //static int b_count = 0;
- //b_count += b_frames;
- //av_log(s->avctx, AV_LOG_DEBUG, "b_frames: %d\n", b_count);
for (i = b_frames - 1; i >= 0; i--) {
int type = s->input_picture[i]->f.pict_type;
@@ -1462,7 +1455,6 @@ no_output_pic:
ff_copy_picture(&s->current_picture, s->current_picture_ptr);
s->picture_number = s->new_picture.f.display_picture_number;
- //printf("dpn:%d\n", s->picture_number);
} else {
memset(&s->new_picture, 0, sizeof(Picture));
}
@@ -1508,8 +1500,6 @@ int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
s->pict_type = s->new_picture.f.pict_type;
//emms_c();
- //printf("qs:%f %f %d\n", s->new_picture.quality,
- // s->current_picture.quality, s->qscale);
ff_MPV_frame_start(s, avctx);
vbv_retry:
if (encode_picture(s, s->picture_number) < 0)
@@ -1558,7 +1548,6 @@ vbv_retry:
s->time_base = s->last_time_base;
s->last_non_b_time = s->time - s->pp_time;
}
- //av_log(NULL, AV_LOG_ERROR, "R:%d ", s->next_lambda);
for (i = 0; i < context_count; i++) {
PutBitContext *pb = &s->thread_context[i]->pb;
init_put_bits(pb, pb->buf, pb->buf_end - pb->buf);
@@ -2463,7 +2452,6 @@ static int encode_thread(AVCodecContext *c, void *arg){
uint8_t bit_buf2[2][MAX_MB_BYTES];
uint8_t bit_buf_tex[2][MAX_MB_BYTES];
PutBitContext pb[2], pb2[2], tex_pb[2];
-//printf("%d->%d\n", s->resync_mb_y, s->end_mb_y);
ff_check_alignment();
@@ -2518,7 +2506,6 @@ static int encode_thread(AVCodecContext *c, void *arg){
s->first_slice_line = 1;
s->ptr_lastgob = s->pb.buf;
for(mb_y= s->start_mb_y; mb_y < s->end_mb_y; mb_y++) {
-// printf("row %d at %X\n", s->mb_y, (int)s);
s->mb_x=0;
s->mb_y= mb_y;
@@ -2992,7 +2979,6 @@ static int encode_thread(AVCodecContext *c, void *arg){
s->mb_intra= 0;
motion_x= s->mv[0][0][0] = s->b_forw_mv_table[xy][0];
motion_y= s->mv[0][0][1] = s->b_forw_mv_table[xy][1];
-// printf(" %d %d ", motion_x, motion_y);
break;
case CANDIDATE_MB_TYPE_FORWARD_I:
s->mv_dir = MV_DIR_FORWARD;
@@ -3069,7 +3055,8 @@ static int encode_thread(AVCodecContext *c, void *arg){
if(CONFIG_H263_ENCODER && s->out_format == FMT_H263)
ff_h263_loop_filter(s);
}
-//printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_stride, put_bits_count(&s->pb));
+ av_dlog(s->avctx, "MB %d %d bits\n",
+ s->mb_x + s->mb_y * s->mb_stride, put_bits_count(&s->pb));
}
}
@@ -3162,7 +3149,6 @@ static int estimate_qp(MpegEncContext *s, int dry_run){
//FIXME broken
}else
s->lambda = s->current_picture.f.quality;
-//printf("%d %d\n", s->avctx->global_quality, s->current_picture.quality);
update_qscale(s);
return 0;
}
@@ -3272,8 +3258,10 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s->pict_type= AV_PICTURE_TYPE_I;
for(i=0; i<s->mb_stride*s->mb_height; i++)
s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
-//printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
- if(s->msmpeg4_version >= 3) s->no_rounding=1;
+ if(s->msmpeg4_version >= 3)
+ s->no_rounding=1;
+ av_dlog(s, "Scene change detected, encoding as I Frame %d %d\n",
+ s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
}
if(!s->umvplus){
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 917d04a906..0f8b57e0f8 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -380,7 +380,7 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
int code, val, sign, shift;
code = get_vlc2(&s->gb, v2_mv_vlc.table, V2_MV_VLC_BITS, 2);
-// printf("MV code %d at %d %d pred: %d\n", code, s->mb_x,s->mb_y, pred);
+ av_dlog(s, "MV code %d at %d %d pred: %d\n", code, s->mb_x,s->mb_y, pred);
if (code < 0)
return 0xffff;
@@ -547,7 +547,6 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
if (!s->mb_intra) {
int mx, my;
-//printf("P at %d %d\n", s->mb_x, s->mb_y);
if(s->per_mb_rl_table && cbp){
s->rl_table_index = decode012(&s->gb);
s->rl_chroma_table_index = s->rl_table_index;
@@ -561,12 +560,15 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
s->mv[0][0][1] = my;
*mb_type_ptr = MB_TYPE_L0 | MB_TYPE_16x16;
} else {
-//printf("I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp&3)? 1 : 0) +((cbp&0x3C)? 2 : 0), show_bits(&s->gb, 24));
+ av_dlog(s, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
+ ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0),
+ show_bits(&s->gb, 24));
s->ac_pred = get_bits1(&s->gb);
*mb_type_ptr = MB_TYPE_INTRA;
if(s->inter_intra_pred){
s->h263_aic_dir= get_vlc2(&s->gb, ff_inter_intra_vlc.table, INTER_INTRA_VLC_BITS, 1);
-// printf("%d%d %d %d/", s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
+ av_dlog(s, "%d%d %d %d/",
+ s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
}
if(s->per_mb_rl_table && cbp){
s->rl_table_index = decode012(&s->gb);
@@ -841,7 +843,8 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s)
s->no_rounding = 0;
}
}
-//printf("%d %d %d %d %d\n", s->pict_type, s->bit_rate, s->inter_intra_pred, s->width, s->height);
+ av_dlog(s->avctx, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
+ s->inter_intra_pred, s->width, s->height);
s->esc3_level_length= 0;
s->esc3_run_length= 0;
@@ -862,8 +865,6 @@ int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size)
s->flipflop_rounding= get_bits1(&s->gb);
else
s->flipflop_rounding= 0;
-
-// printf("fps:%2d bps:%2d roundingType:%1d\n", fps, s->bit_rate/1024, s->flipflop_rounding);
}
else if(left<length+8)
{
@@ -1030,7 +1031,8 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
last= SHOW_UBITS(re, &s->gb, 1); SKIP_BITS(re, &s->gb, 1);
if(!s->esc3_level_length){
int ll;
- //printf("ESC-3 %X at %d %d\n", show_bits(&s->gb, 24), s->mb_x, s->mb_y);
+ av_dlog(s->avctx, "ESC-3 %X at %d %d\n",
+ show_bits(&s->gb, 24), s->mb_x, s->mb_y);
if(s->qscale<8){
ll= SHOW_UBITS(re, &s->gb, 3); SKIP_BITS(re, &s->gb, 3);
if(ll==0){
@@ -1047,7 +1049,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
s->esc3_level_length= ll;
s->esc3_run_length= SHOW_UBITS(re, &s->gb, 2) + 3; SKIP_BITS(re, &s->gb, 2);
-//printf("level length:%d, run length: %d\n", ll, s->esc3_run_length);
UPDATE_CACHE(re, &s->gb);
}
run= SHOW_UBITS(re, &s->gb, s->esc3_run_length);
@@ -1060,7 +1061,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
SKIP_BITS(re, &s->gb, s->esc3_level_length);
if(sign) level= -level;
}
-//printf("level: %d, run: %d at %d %d\n", level, run, s->mb_x, s->mb_y);
+
#if 0 // waste of time / this will detect very few errors
{
const int abs_level= FFABS(level);
@@ -1186,7 +1187,6 @@ int ff_msmpeg4_decode_motion(MpegEncContext * s,
return -1;
}
if (code == mv->n) {
-//printf("MV ESC %X at %d %d\n", show_bits(&s->gb, 24), s->mb_x, s->mb_y);
mx = get_bits(&s->gb, 6);
my = get_bits(&s->gb, 6);
} else {
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index 0e9d116e3c..458ec09526 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -193,9 +193,6 @@ static void find_best_tables(MpegEncContext * s)
}
}
-// printf("type:%d, best:%d, qp:%d, var:%d, mcvar:%d, size:%d //\n",
-// s->pict_type, best, s->qscale, s->mb_var_sum, s->mc_mb_var_sum, best_size);
-
if(s->pict_type==AV_PICTURE_TYPE_P) chroma_best= best;
memset(s->ac_stats, 0, sizeof(int)*(MAX_LEVEL+1)*(MAX_RUN+1)*2*2*2);
@@ -233,7 +230,8 @@ void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
s->per_mb_rl_table = 0;
if(s->msmpeg4_version==4)
s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==AV_PICTURE_TYPE_P);
-//printf("%d %d %d %d %d\n", s->pict_type, s->bit_rate, s->inter_intra_pred, s->width, s->height);
+ av_dlog(s, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
+ s->inter_intra_pred, s->width, s->height);
if (s->pict_type == AV_PICTURE_TYPE_I) {
s->slice_height= s->mb_height/1;
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index df5ecb3b87..a85db1a02f 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -150,7 +150,6 @@ int av_parser_parse2(AVCodecParserContext *s,
/* WARNING: the returned index can be negative */
index = s->parser->parser_parse(s, avctx, (const uint8_t **)poutbuf, poutbuf_size, buf, buf_size);
-//av_log(NULL, AV_LOG_DEBUG, "parser: in:%"PRId64", %"PRId64", out:%"PRId64", %"PRId64", in:%d out:%d id:%d\n", pts, dts, s->last_pts, s->last_dts, buf_size, *poutbuf_size, avctx->codec_id);
/* update the file pointer */
if (*poutbuf_size) {
/* fill the data for the current frame */
diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index e83f72194e..f02965e300 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -131,13 +131,11 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
unsigned int bit_buf;
int bit_left;
- // printf("put_bits=%d %x\n", n, value);
av_assert2(n <= 31 && value < (1U << n));
bit_buf = s->bit_buf;
bit_left = s->bit_left;
- // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
/* XXX: optimize */
#ifdef BITSTREAM_WRITER_LE
bit_buf |= value << (32 - bit_left);
@@ -158,7 +156,6 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
bit_buf |= value >> (n - bit_left);
av_assert2(s->buf_ptr+3<s->buf_end);
AV_WB32(s->buf_ptr, bit_buf);
- //printf("bitbuf = %08x\n", bit_buf);
s->buf_ptr+=4;
bit_left+=32 - n;
bit_buf = value;
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index b9f581f5da..8f8647c058 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -283,7 +283,8 @@ int ff_vbv_update(MpegEncContext *s, int frame_size){
const double min_rate= s->avctx->rc_min_rate/fps;
const double max_rate= s->avctx->rc_max_rate/fps;
-//av_log(0,0, "%d %f %d %f %f\n", buffer_size, rcc->buffer_index, frame_size, min_rate, max_rate);
+ av_dlog(s, "%d %f %d %f %f\n",
+ buffer_size, rcc->buffer_index, frame_size, min_rate, max_rate);
if(buffer_size){
int left;
@@ -457,7 +458,6 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce, double q,
if(s->avctx->rc_qmod_freq && frame_num%s->avctx->rc_qmod_freq==0 && pict_type==AV_PICTURE_TYPE_P)
q*= s->avctx->rc_qmod_amp;
-//printf("q:%f\n", q);
/* buffer overflow/underflow protection */
if(buffer_size){
double expected_size= rcc->buffer_index;
@@ -493,7 +493,9 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce, double q,
}
}
}
-//printf("q:%f max:%f min:%f size:%f index:%d bits:%f agr:%f\n", q,max_rate, min_rate, buffer_size, rcc->buffer_index, bits, s->avctx->rc_buffer_aggressivity);
+ av_dlog(s, "q:%f max:%f min:%f size:%f index:%f agr:%f\n",
+ q, max_rate, min_rate, buffer_size, rcc->buffer_index,
+ s->avctx->rc_buffer_aggressivity);
if(s->avctx->rc_qsquish==0.0 || qmin==qmax){
if (q<qmin) q=qmin;
else if(q>qmax) q=qmax;
@@ -636,8 +638,6 @@ static void adaptive_quantization(MpegEncContext *s, double q){
if (intq > qmax) intq= qmax;
else if(intq < qmin) intq= qmin;
-//if(i%s->mb_width==0) printf("\n");
-//printf("%2d%3d ", intq, ff_sqrt(s->mc_mb_var[i]));
s->lambda_table[mb_xy]= intq;
}
}
@@ -682,7 +682,6 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
get_qminmax(&qmin, &qmax, s, pict_type);
fps= get_fps(s->avctx);
-//printf("input_pic_num:%d pic_num:%d frame_rate:%d\n", s->input_picture_number, s->picture_number, s->frame_rate);
/* update predictors */
if(picture_number>2 && !dry_run){
const int last_var= s->last_pict_type == AV_PICTURE_TYPE_I ? rcc->last_mb_var_sum : rcc->last_mc_mb_var_sum;
@@ -706,9 +705,6 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
else
dts_pic= s->last_picture_ptr;
-//if(dts_pic)
-// av_log(NULL, AV_LOG_ERROR, "%"PRId64" %"PRId64" %"PRId64" %d\n", s->current_picture_ptr->pts, s->user_specified_pts, dts_pic->pts, picture_number);
-
if (!dts_pic || dts_pic->f.pts == AV_NOPTS_VALUE)
wanted_bits= (uint64_t)(s->bit_rate*(double)picture_number/fps);
else
@@ -727,7 +723,8 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
assert(pict_type == rce->new_pict_type);
q= rce->new_qscale / br_compensation;
-//printf("%f %f %f last:%d var:%d type:%d//\n", q, rce->new_qscale, br_compensation, s->frame_bits, var, pict_type);
+ av_dlog(s, "%f %f %f last:%d var:%d type:%d//\n", q, rce->new_qscale,
+ br_compensation, s->frame_bits, var, pict_type);
}else{
rce->pict_type=
rce->new_pict_type= pict_type;
@@ -764,9 +761,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
return -1;
assert(q>0.0);
-//printf("%f ", q);
q= get_diff_limited_q(s, rce, q);
-//printf("%f ", q);
assert(q>0.0);
if(pict_type==AV_PICTURE_TYPE_P || s->intra_only){ //FIXME type dependent blur like in 2-pass
@@ -775,9 +770,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
rcc->short_term_qsum+= q;
rcc->short_term_qcount++;
-//printf("%f ", q);
q= short_term_q= rcc->short_term_qsum/rcc->short_term_qcount;
-//printf("%f ", q);
}
assert(q>0.0);
@@ -908,18 +901,15 @@ static int init_pass2(MpegEncContext *s)
double bits;
rce->new_qscale= modify_qscale(s, rce, blurred_qscale[i], i);
bits= qp2bits(rce, rce->new_qscale) + rce->mv_bits + rce->misc_bits;
-//printf("%d %f\n", rce->new_bits, blurred_qscale[i]);
bits += 8*ff_vbv_update(s, bits);
rce->expected_bits= expected_bits;
expected_bits += bits;
}
- /*
- av_log(s->avctx, AV_LOG_INFO,
- "expected_bits: %f all_available_bits: %d rate_factor: %f\n",
- expected_bits, (int)all_available_bits, rate_factor);
- */
+ av_dlog(s->avctx,
+ "expected_bits: %f all_available_bits: %d rate_factor: %f\n",
+ expected_bits, (int)all_available_bits, rate_factor);
if(expected_bits > all_available_bits) {
rate_factor-= step;
++toobig;
@@ -931,8 +921,10 @@ static int init_pass2(MpegEncContext *s)
/* check bitrate calculations and print info */
qscale_sum = 0.0;
for(i=0; i<rcc->num_entries; i++){
- /* av_log(s->avctx, AV_LOG_DEBUG, "[lavc rc] entry[%d].new_qscale = %.3f qp = %.3f\n",
- i, rcc->entry[i].new_qscale, rcc->entry[i].new_qscale / FF_QP2LAMBDA); */
+ av_dlog(s, "[lavc rc] entry[%d].new_qscale = %.3f qp = %.3f\n",
+ i,
+ rcc->entry[i].new_qscale,
+ rcc->entry[i].new_qscale / FF_QP2LAMBDA);
qscale_sum += av_clip(rcc->entry[i].new_qscale / FF_QP2LAMBDA, s->avctx->qmin, s->avctx->qmax);
}
assert(toobig <= 40);
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index c50727f1ca..49072dea9f 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -399,7 +399,6 @@ static int rv20_decode_picture_header(RVDecContext *rv)
mb_pos = ff_h263_decode_mba(s);
-//av_log(s->avctx, AV_LOG_DEBUG, "%d\n", seq);
seq |= s->time &~0x7FFF;
if(seq - s->time > 0x4000) seq -= 0x8000;
if(seq - s->time < -0x4000) seq += 0x8000;
@@ -418,11 +417,7 @@ static int rv20_decode_picture_header(RVDecContext *rv)
ff_mpeg4_init_direct_mv(s);
}
}
-// printf("%d %d %d %d %d\n", seq, (int)s->time, (int)s->last_non_b_time, s->pp_time, s->pb_time);
-/*for(i=0; i<32; i++){
- av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
-}
-av_log(s->avctx, AV_LOG_DEBUG, "\n");*/
+
s->no_rounding= get_bits1(&s->gb);
if(RV_GET_MINOR_VER(rv->sub_id) <= 1 && s->pict_type == AV_PICTURE_TYPE_B)
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index ba240ac74d..2e5600a54a 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -521,8 +521,8 @@ static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) {
csum = ff_svq1_packet_checksum (bitbuf->buffer, bitbuf->size_in_bits>>3, csum);
-// av_log(s->avctx, AV_LOG_INFO, "%s checksum (%02x) for packet data\n",
-// (csum == 0) ? "correct" : "incorrect", csum);
+ av_dlog(s->avctx, "%s checksum (%02x) for packet data\n",
+ (csum == 0) ? "correct" : "incorrect", csum);
}
if ((s->f_code ^ 0x10) >= 0x50) {
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c462a9d51e..36ac878540 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -610,7 +610,6 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
pic->data[i] = NULL;
// pic->base[i]=NULL;
- //printf("R%X\n", pic->opaque);
if (s->debug & FF_DEBUG_BUFFERS)
av_log(s, AV_LOG_DEBUG, "default_release_buffer called on pic %p, %d "
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index d7352d3671..56c5bf9932 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -395,8 +395,6 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo
v->res_rtm_flag = get_bits1(gb); //reserved
}
if (!v->res_rtm_flag) {
-// av_log(avctx, AV_LOG_ERROR,
-// "0 for reserved RES_RTM_FLAG is forbidden\n");
av_log(avctx, AV_LOG_ERROR,
"Old WMV3 version detected, some frames may be decoded incorrectly\n");
//return -1;
@@ -663,8 +661,9 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
v->x8_type = get_bits1(gb);
} else
v->x8_type = 0;
-//av_log(v->s.avctx, AV_LOG_INFO, "%c Frame: QP=[%i]%i (+%i/2) %i\n",
-// (v->s.pict_type == AV_PICTURE_TYPE_P) ? 'P' : ((v->s.pict_type == AV_PICTURE_TYPE_I) ? 'I' : 'B'), pqindex, v->pq, v->halfpq, v->rangeredfrm);
+ av_dlog(v->s.avctx, "%c Frame: QP=[%i]%i (+%i/2) %i\n",
+ (v->s.pict_type == AV_PICTURE_TYPE_P) ? 'P' : ((v->s.pict_type == AV_PICTURE_TYPE_I) ? 'I' : 'B'),
+ pqindex, v->pq, v->halfpq, v->rangeredfrm);
if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_P)
v->use_ic = 0;
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 9412a79192..cbf9562d2a 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5637,7 +5637,8 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s->linesize >>= 1;
s->uvlinesize >>= 1;
}
-//av_log(s->avctx, AV_LOG_INFO, "Consumed %i/%i bits\n", get_bits_count(&s->gb), s->gb.size_in_bits);
+ av_dlog(s->avctx, "Consumed %i/%i bits\n",
+ get_bits_count(&s->gb), s->gb.size_in_bits);
// if (get_bits_count(&s->gb) > buf_size * 8)
// return -1;
if(s->error_occurred && s->pict_type == AV_PICTURE_TYPE_B)
diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c
index 90227dd9f9..adf08b5fb9 100644
--- a/libavcodec/vorbis.c
+++ b/libavcodec/vorbis.c
@@ -66,10 +66,8 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
for (p = 0; (bits[p] == 0) && (p < num); ++p)
;
- if (p == num) {
-// av_log(vc->avccontext, AV_LOG_INFO, "An empty codebook. Heh?! \n");
+ if (p == num)
return 0;
- }
codes[p] = 0;
if (bits[p] > 32)
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 0f112c22aa..80d54cc198 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2068,7 +2068,8 @@ static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
return -1;
}
token = get_bits(gb, 5);
- //av_log(avctx, AV_LOG_DEBUG, "hti %d hbits %x token %d entry : %d size %d\n", s->hti, s->hbits, token, s->entries, s->huff_code_size);
+ av_dlog(avctx, "hti %d hbits %x token %d entry : %d size %d\n",
+ s->hti, s->hbits, token, s->entries, s->huff_code_size);
s->huffman_table[s->hti][token][0] = s->hbits;
s->huffman_table[s->hti][token][1] = s->huff_code_size;
s->entries++;
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 39e50a4ffd..6bd1a821fd 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -95,8 +95,6 @@ static int wma_decode_init(AVCodecContext * avctx)
} else if (avctx->codec->id == AV_CODEC_ID_WMAV2 && avctx->extradata_size >= 6) {
flags2 = AV_RL16(extradata+4);
}
-// for(i=0; i<avctx->extradata_size; i++)
-// av_log(NULL, AV_LOG_ERROR, "%02X ", extradata[i]);
s->use_exp_vlc = flags2 & 0x0001;
s->use_bit_reservoir = flags2 & 0x0002;
@@ -866,7 +864,6 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
}
if (s->last_superframe_len > 0) {
- // printf("skip=%d\n", s->last_bitoffset);
/* add bit_offset bits to last frame */
if ((s->last_superframe_len + ((bit_offset + 7) >> 3)) >
MAX_CODED_SUPERFRAME_SIZE)
@@ -929,7 +926,9 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
samples += s->nb_channels * s->frame_len;
}
-//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d outbytes:%d eaten:%d\n", s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len, (int8_t *)samples - (int8_t *)data, s->block_align);
+ av_dlog(s->avctx, "%d %d %d %d outbytes:%d eaten:%d\n",
+ s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len,
+ (int8_t *)samples - (int8_t *)data, s->block_align);
*got_frame_ptr = 1;
*(AVFrame *)data = s->frame;
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index c803ba2a7d..835bc39ce8 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -82,7 +82,6 @@ static int encode_init(AVCodecContext * avctx){
(avctx->sample_rate * 8);
s->block_align = FFMIN(s->block_align, MAX_CODED_SUPERFRAME_SIZE);
avctx->block_align = s->block_align;
-//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d\n", s->block_align, avctx->bit_rate, s->frame_len, avctx->sample_rate);
avctx->frame_size = avctx->delay = s->frame_len;
#if FF_API_OLD_ENCODE_AUDIO
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 6217bbad7a..df11c219da 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -244,8 +244,6 @@ static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){
else
w->hshift= 0;
-//printf("%d %d ", *mx_ptr, *my_ptr);
-
return 0;
}
@@ -314,7 +312,6 @@ static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n,
// const uint8_t *scantable= w->abt_type-1 ? w->abt_scantable[1].permutated : w->abt_scantable[0].scantable;
sub_cbp= sub_cbp_table[ decode012(&s->gb) ];
-// printf("S%d", sub_cbp);
if(sub_cbp&1){
if (ff_msmpeg4_decode_block(s, block, n, 1, scantable) < 0)
@@ -385,7 +382,6 @@ int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
if (!s->mb_intra) {
int mx, my;
-//printf("P at %d %d\n", s->mb_x, s->mb_y);
wmv2_pred_motion(w, &mx, &my);
if(cbp){
@@ -419,13 +415,16 @@ int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
}
}
} else {
-//if(s->pict_type==AV_PICTURE_TYPE_P)
-// printf("%d%d ", s->inter_intra_pred, cbp);
-//printf("I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp&3)? 1 : 0) +((cbp&0x3C)? 2 : 0), show_bits(&s->gb, 24));
+ if (s->pict_type==AV_PICTURE_TYPE_P)
+ av_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
+ av_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
+ ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0),
+ show_bits(&s->gb, 24));
s->ac_pred = get_bits1(&s->gb);
if(s->inter_intra_pred){
s->h263_aic_dir= get_vlc2(&s->gb, ff_inter_intra_vlc.table, INTER_INTRA_VLC_BITS, 1);
-// printf("%d%d %d %d/", s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
+ av_dlog(s->avctx, "%d%d %d %d/",
+ s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
}
if(s->per_mb_rl_table && cbp){
s->rl_table_index = decode012(&s->gb);
diff --git a/libavcodec/x86/mpegvideo.c b/libavcodec/x86/mpegvideo.c
index 2d475abe01..7c7ca87a13 100644
--- a/libavcodec/x86/mpegvideo.c
+++ b/libavcodec/x86/mpegvideo.c
@@ -51,7 +51,7 @@ static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
nCoeffs=63;
else
nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-//printf("%d %d ", qmul, qadd);
+
__asm__ volatile(
"movd %1, %%mm6 \n\t" //qmul
"packssdw %%mm6, %%mm6 \n\t"
@@ -114,7 +114,7 @@ static void dct_unquantize_h263_inter_mmx(MpegEncContext *s,
assert(s->block_last_index[n]>=0 || s->h263_aic);
nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
-//printf("%d %d ", qmul, qadd);
+
__asm__ volatile(
"movd %1, %%mm6 \n\t" //qmul
"packssdw %%mm6, %%mm6 \n\t"