aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--ffserver.c2
-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
-rw-r--r--libavdevice/timefilter.c7
-rw-r--r--libavformat/asfdec.c49
-rw-r--r--libavformat/assdec.c2
-rw-r--r--libavformat/avidec.c24
-rw-r--r--libavformat/ffmdec.c3
-rw-r--r--libavformat/flvenc.c3
-rw-r--r--libavformat/h263dec.c2
-rw-r--r--libavformat/movenc.c1
-rw-r--r--libavformat/mpeg.c2
-rw-r--r--libavformat/mpegenc.c9
-rw-r--r--libavformat/mpegts.c6
-rw-r--r--libavformat/mpegtsenc.c2
-rw-r--r--libavformat/mxfenc.c2
-rw-r--r--libavformat/nutenc.c4
-rw-r--r--libavformat/rmdec.c5
-rw-r--r--libavformat/rtsp.c2
-rw-r--r--libavformat/swfdec.c1
-rw-r--r--libavformat/utils.c11
-rw-r--r--tools/pktdumper.c1
62 files changed, 176 insertions, 297 deletions
diff --git a/ffserver.c b/ffserver.c
index 1eae3adff3..480e6fc15b 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2689,8 +2689,6 @@ static int http_receive_data(HTTPContext *c)
/* a packet has been received : write it in the store, except
if header */
if (c->data_count > FFM_PACKET_SIZE) {
-
- // printf("writing pos=0x%"PRIx64" size=0x%"PRIx64"\n", feed->feed_write_index, feed->feed_size);
/* XXX: use llseek or url_seek */
lseek(c->feed_fd, feed->feed_write_index, SEEK_SET);
if (write(c->feed_fd, c->buffer, FFM_PACKET_SIZE) < 0) {
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"
diff --git a/libavdevice/timefilter.c b/libavdevice/timefilter.c
index f05792ebc3..330f26e367 100644
--- a/libavdevice/timefilter.c
+++ b/libavdevice/timefilter.c
@@ -103,15 +103,8 @@ int main(void)
double ideal[SAMPLES];
double samples[SAMPLES];
double samplet[SAMPLES];
-#if 1
for (n0 = 0; n0 < 40; n0 = 2 * n0 + 1) {
for (n1 = 0; n1 < 10; n1 = 2 * n1 + 1) {
-#else
- {
- {
- n0 = 7;
- n1 = 1;
-#endif
double best_error = 1000000000;
double bestpar0 = 1;
double bestpar1 = 1;
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index b1b8eeb303..b58cf28064 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -21,6 +21,7 @@
//#define DEBUG
+#include "libavutil/attributes.h"
#include "libavutil/bswap.h"
#include "libavutil/common.h"
#include "libavutil/avstring.h"
@@ -420,9 +421,6 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
avio_rl16(pb); //ds_data_size
avio_r8(pb); //ds_silence_data
}
- //printf("Descrambling: ps:%d cs:%d ds:%d s:%d sd:%d\n",
- // asf_st->ds_packet_size, asf_st->ds_chunk_size,
- // asf_st->ds_data_size, asf_st->ds_span, asf_st->ds_silence_data);
if (asf_st->ds_span > 1) {
if (!asf_st->ds_chunk_size
|| (asf_st->ds_packet_size/asf_st->ds_chunk_size <= 1)
@@ -443,7 +441,6 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
st->codec->bits_per_coded_sample = avio_rl16(pb); /* depth */
tag1 = avio_rl32(pb);
avio_skip(pb, 20);
- // av_log(s, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX);
if (sizeX > 40) {
st->codec->extradata_size = sizeX - 40;
st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
@@ -614,16 +611,18 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
for(i=0;i<n;i++) {
char name[1024];
+ int av_unused value_type;
avio_rl16(pb); //lang_list_index
stream_num= avio_rl16(pb);
name_len= avio_rl16(pb);
- avio_skip(pb, 2); /* value_type */
+ value_type = avio_rl16(pb); /* value_type */
value_len= avio_rl32(pb);
if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
avio_skip(pb, name_len - ret);
- //av_log(s, AV_LOG_ERROR, "%d %d %d %d %d <%s>\n", i, stream_num, name_len, value_type, value_len, name);
+ av_dlog(s, "%d %d %d %d %d <%s>\n",
+ i, stream_num, name_len, value_type, value_len, name);
value_num= avio_rl16(pb);//we should use get_value() here but it does not work 2 is le16 here but le32 elsewhere
avio_skip(pb, value_len - 2);
@@ -689,9 +688,7 @@ static int asf_read_header(AVFormatContext *s)
uint64_t gpos= avio_tell(pb);
ff_get_guid(pb, &g);
gsize = avio_rl64(pb);
- av_dlog(s, "%08"PRIx64": ", gpos);
print_guid(&g);
- av_dlog(s, " size=0x%"PRIx64"\n", gsize);
if (!ff_guidcmp(&g, &ff_asf_data_header)) {
asf->data_object_offset = avio_tell(pb);
// if not streaming, gsize is not unlimited (how?), and there is enough space in the file..
@@ -784,7 +781,9 @@ static int asf_read_header(AVFormatContext *s)
&st->sample_aspect_ratio.num,
asf->dar[0].num, asf->dar[0].den, INT_MAX);
-//av_log(s, AV_LOG_INFO, "i=%d, st->codec->codec_type:%d, dar %d:%d sar=%d:%d\n", i, st->codec->codec_type, dar[i].num, dar[i].den, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
+ av_dlog(s, "i=%d, st->codec->codec_type:%d, asf->dar %d:%d sar=%d:%d\n",
+ i, st->codec->codec_type, asf->dar[i].num, asf->dar[i].den,
+ st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
// copy and convert language codes to the frontend
if (asf->streams[i].stream_language_index < 128) {
@@ -926,7 +925,9 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
DO_2BITS(asf->packet_property >> 4, asf->packet_seq, 0);
DO_2BITS(asf->packet_property >> 2, asf->packet_frag_offset, 0);
DO_2BITS(asf->packet_property, asf->packet_replic_size, 0);
-//printf("key:%d stream:%d seq:%d offset:%d replic_size:%d\n", asf->packet_key_frame, asf->stream_index, asf->packet_seq, //asf->packet_frag_offset, asf->packet_replic_size);
+ av_dlog(asf, "key:%d stream:%d seq:%d offset:%d replic_size:%d\n",
+ asf->packet_key_frame, asf->stream_index, asf->packet_seq,
+ asf->packet_frag_offset, asf->packet_replic_size);
if (rsize+asf->packet_replic_size > asf->packet_size_left) {
av_log(s, AV_LOG_ERROR, "packet_replic_size %d is invalid\n", asf->packet_replic_size);
return AVERROR_INVALIDDATA;
@@ -939,9 +940,6 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
}
asf->packet_frag_timestamp = avio_rl32(pb); // timestamp
if(asf->packet_replic_size >= 8+38+4){
-// for(i=0; i<asf->packet_replic_size-8; i++)
-// av_log(s, AV_LOG_DEBUG, "%02X ",avio_r8(pb));
-// av_log(s, AV_LOG_DEBUG, "\n");
avio_skip(pb, 10);
ts0= avio_rl64(pb);
ts1= avio_rl64(pb);
@@ -980,10 +978,8 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
asf->packet_padsize -= diff;
}
}
- //printf("Fragsize %d\n", asf->packet_frag_size);
} else {
asf->packet_frag_size = asf->packet_size_left - rsize;
- //printf("Using rest %d %d %d\n", asf->packet_frag_size, asf->packet_size_left, rsize);
}
if (asf->packet_replic_size == 1) {
asf->packet_multi_size = asf->packet_frag_size;
@@ -991,7 +987,6 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
return AVERROR_INVALIDDATA;
}
asf->packet_size_left -= rsize;
- //printf("___objsize____ %d %d rs:%d\n", asf->packet_obj_size, asf->packet_frag_offset, rsize);
return 0;
}
@@ -1017,7 +1012,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
|| asf->packet_segments < 1) {
//asf->packet_size_left <= asf->packet_padsize) {
int ret = asf->packet_size_left + asf->packet_padsize;
- //printf("PacketLeftSize:%d Pad:%d Pos:%"PRId64"\n", asf->packet_size_left, asf->packet_padsize, avio_tell(pb));
assert(ret>=0);
/* fail safe */
avio_skip(pb, ret);
@@ -1064,7 +1058,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
continue;
}
asf->packet_multi_size -= asf->packet_obj_size;
- //printf("COMPRESS size %d %d %d ms:%d\n", asf->packet_obj_size, asf->packet_frag_timestamp, asf->packet_size_left, asf->packet_multi_size);
}
if( /*asf->packet_frag_size == asf->packet_obj_size*/
asf_st->frag_offset + asf->packet_frag_size <= asf_st->pkt.size
@@ -1100,9 +1093,11 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
asf_st->palette_changed = 0;
}
}
-//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
-//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & AV_PKT_FLAG_KEY,
-//s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO, asf->packet_obj_size);
+ av_dlog(asf, "new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
+ asf->stream_index, asf->packet_key_frame,
+ asf_st->pkt.flags & AV_PKT_FLAG_KEY,
+ s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO,
+ asf->packet_obj_size);
if (s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
asf->packet_key_frame = 1;
if (asf->packet_key_frame)
@@ -1110,9 +1105,9 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
}
/* read data */
- //printf("READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n",
- // s->packet_size, asf_st->pkt.size, asf->packet_frag_offset,
- // asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data);
+ av_dlog(asf, "READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n",
+ s->packet_size, asf_st->pkt.size, asf->packet_frag_offset,
+ asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data);
asf->packet_size_left -= asf->packet_frag_size;
if (asf->packet_size_left < 0)
continue;
@@ -1174,8 +1169,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
int row = off / asf_st->ds_span;
int col = off % asf_st->ds_span;
int idx = row + col * asf_st->ds_packet_size / asf_st->ds_chunk_size;
- //printf("off:%d row:%d col:%d idx:%d\n", off, row, col, idx);
-
assert(offset + asf_st->ds_chunk_size <= asf_st->pkt.size);
assert(idx+1 <= asf_st->pkt.size / asf_st->ds_chunk_size);
memcpy(newdata + offset,
@@ -1190,7 +1183,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
}
asf_st->frag_offset = 0;
*pkt= asf_st->pkt;
- //printf("packet %d %d\n", asf_st->pkt.size, asf->packet_frag_size);
asf_st->pkt.size = 0;
asf_st->pkt.data = 0;
asf_st->pkt.side_data_elems = 0;
@@ -1280,7 +1272,6 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
if (avio_seek(s->pb, pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;
-//printf("asf_read_pts\n");
asf_reset_header(s);
for(;;){
if (av_read_frame(s, pkt) < 0){
@@ -1308,8 +1299,6 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
}
*ppos= pos;
-//printf("found keyframe at %"PRId64" stream %d stamp:%"PRId64"\n", *ppos, stream_index, pts);
-
return pts;
}
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 687869107c..835fd8a55d 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -60,7 +60,7 @@ static int64_t get_pts(const uint8_t *p)
if(sscanf(p, "%*[^,],%d:%d:%d%*c%d", &hour, &min, &sec, &hsec) != 4)
return AV_NOPTS_VALUE;
-// av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d [%s]\n", i, hour, min, sec, hsec, p);
+ av_dlog(NULL, "%d %d %d %d [%s]\n", hour, min, sec, hsec, p);
min+= 60*hour;
sec+= 60*min;
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index de945829f4..b4c5fe8d0c 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -545,7 +545,8 @@ static int avi_read_header(AVFormatContext *s)
}
ast->sample_size = avio_rl32(pb); /* sample ssize */
ast->cum_len *= FFMAX(1, ast->sample_size);
-// av_log(s, AV_LOG_DEBUG, "%d %d %d %d\n", ast->rate, ast->scale, ast->start, ast->sample_size);
+ av_dlog(s, "%"PRIu32" %"PRIu32" %d\n",
+ ast->rate, ast->scale, ast->sample_size);
switch(tag1) {
case MKTAG('v', 'i', 'd', 's'):
@@ -743,7 +744,9 @@ static int avi_read_header(AVFormatContext *s)
if(active_aspect.num && active_aspect.den && active.num && active.den){
st->sample_aspect_ratio= av_div_q(active_aspect, active);
-//av_log(s, AV_LOG_ERROR, "vprp %d/%d %d/%d\n", active_aspect.num, active_aspect.den, active.num, active.den);
+ av_dlog(s, "vprp %d/%d %d/%d\n",
+ active_aspect.num, active_aspect.den,
+ active.num, active.den);
}
size -= 9*4;
}
@@ -921,7 +924,8 @@ start_sync:
size= d[4] + (d[5]<<8) + (d[6]<<16) + (d[7]<<24);
n= get_stream_idx(d+2);
-//av_log(s, AV_LOG_DEBUG, "%X %X %X %X %X %X %X %X %"PRId64" %d %d\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n);
+ av_dlog(s, "%X %X %X %X %X %X %X %X %"PRId64" %u %d\n",
+ d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n);
if(i + (uint64_t)size > avi->fsize || d[0] > 127)
continue;
@@ -931,7 +935,6 @@ start_sync:
||(d[0] == 'J' && d[1] == 'U' && d[2] == 'N' && d[3] == 'K')
||(d[0] == 'i' && d[1] == 'd' && d[2] == 'x' && d[3] == '1')){
avio_skip(pb, size);
-//av_log(s, AV_LOG_DEBUG, "SKIP\n");
goto start_sync;
}
@@ -1010,7 +1013,6 @@ start_sync:
if (exit_early)
return 0;
-//av_log(s, AV_LOG_DEBUG, "OK\n");
if(d[2]*256+d[3] == ast->prefix)
ast->prefix_count++;
else{
@@ -1073,7 +1075,8 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
ts = av_rescale_q(ts, st->time_base, (AVRational){FFMAX(1, ast->sample_size), AV_TIME_BASE});
-// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d/%d %"PRId64"\n", ts, st->time_base.num, st->time_base.den, ast->frame_offset);
+ av_dlog(s, "%"PRId64" %d/%d %"PRId64"\n", ts,
+ st->time_base.num, st->time_base.den, ast->frame_offset);
if(ts < best_ts){
best_ts= ts;
best_st= st;
@@ -1093,13 +1096,11 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
best_ast->frame_offset= best_st->index_entries[i].timestamp;
}
-// av_log(s, AV_LOG_DEBUG, "%d\n", i);
if(i>=0){
int64_t pos= best_st->index_entries[i].pos;
pos += best_ast->packet_size - best_ast->remaining;
if(avio_seek(s->pb, pos + 8, SEEK_SET) < 0)
return AVERROR_EOF;
-// av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos);
av_assert0(best_ast->remaining <= best_ast->packet_size);
@@ -1168,7 +1169,9 @@ resync:
// pkt->dts += ast->start;
if(ast->sample_size)
pkt->dts /= ast->sample_size;
-//av_log(s, AV_LOG_DEBUG, "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d base:%d st:%d size:%d\n", pkt->dts, ast->frame_offset, ast->scale, ast->rate, ast->sample_size, AV_TIME_BASE, avi->stream_index, size);
+ av_dlog(s, "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d base:%d st:%d size:%d\n",
+ pkt->dts, ast->frame_offset, ast->scale, ast->rate,
+ ast->sample_size, AV_TIME_BASE, avi->stream_index, size);
pkt->stream_index = avi->stream_index;
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
@@ -1457,7 +1460,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
pos = st->index_entries[index].pos;
timestamp = st->index_entries[index].timestamp / FFMAX(ast->sample_size, 1);
-// av_log(s, AV_LOG_DEBUG, "XX %"PRId64" %d %"PRId64"\n", timestamp, index, st->index_entries[index].timestamp);
+ av_dlog(s, "XX %"PRId64" %d %"PRId64"\n",
+ timestamp, index, st->index_entries[index].timestamp);
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
/* One and only one real stream for DV in AVI, and it has video */
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index df9ac8d9fc..c6d9fab9cf 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -246,9 +246,6 @@ static void adjust_write_index(AVFormatContext *s)
ffm->write_index += pos_max;
}
- //printf("Adjusted write index from %"PRId64" to %"PRId64": pts=%0.6f\n", orig_write_index, ffm->write_index, pts / 1000000.);
- //printf("pts range %0.6f - %0.6f\n", get_dts(s, 0) / 1000000. , get_dts(s, ffm->file_size - 2 * FFM_PACKET_SIZE) / 1000000. );
-
end:
avio_seek(pb, ptr, SEEK_SET);
}
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 97c00bf79e..c528bf5bef 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -446,9 +446,6 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
uint8_t *data = NULL;
int flags = -1, flags_size, ret;
- av_dlog(s, "type:%s pts:%"PRId64" dts:%"PRId64" size:%d\n",
- av_get_media_type_string(enc->codec_type), pkt->pts, pkt->dts, size);
-
if (enc->codec_id == AV_CODEC_ID_VP6 || enc->codec_id == AV_CODEC_ID_VP6F ||
enc->codec_id == AV_CODEC_ID_VP6A || enc->codec_id == AV_CODEC_ID_AAC)
flags_size = 2;
diff --git a/libavformat/h263dec.c b/libavformat/h263dec.c
index 8afacad8b7..667fdbdcbb 100644
--- a/libavformat/h263dec.c
+++ b/libavformat/h263dec.c
@@ -55,8 +55,6 @@ static int h263_probe(AVProbeData *p)
last_gn= gn;
}
}
-//av_log(NULL, AV_LOG_ERROR, "h263_probe: psc:%d invalid:%d res_change:%d\n", valid_psc, invalid_psc, res_change);
-//h263_probe: psc:3 invalid:0 res_change:0 (1588/recent_ffmpeg_parses_mpg_incorrectly.mpg)
if(valid_psc > 2*invalid_psc + 2*res_change + 3){
return 50;
}else if(valid_psc > 2*invalid_psc)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index ded2859719..6de5306c0b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2196,7 +2196,6 @@ static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
mov_write_psp_udta_tag(pb, LIBAVCODEC_IDENT, "eng", 0x04);
mov_write_psp_udta_tag(pb, title->value, "eng", 0x01);
-// snprintf(dt,32,"%04d/%02d/%02d %02d:%02d:%02d",t_st->tm_year+1900,t_st->tm_mon+1,t_st->tm_mday,t_st->tm_hour,t_st->tm_min,t_st->tm_sec);
mov_write_psp_udta_tag(pb, "2006/04/01 11:11:11", "und", 0x03);
update_size(pb, pos2);
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 54125ae9a2..22e7869961 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -85,7 +85,6 @@ static int mpegps_probe(AVProbeData *p)
if(vid+audio > invalid+1) /* invalid VDR files nd short PES streams */
score= AVPROBE_SCORE_MAX/4;
-//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d %d len:%d\n", sys, priv1, pspack,vid, audio, invalid, p->buf_size);
if(sys>invalid && sys*9 <= pspack*10)
return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg
if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9)
@@ -223,7 +222,6 @@ static int mpegps_read_pes_header(AVFormatContext *s,
size = MAX_SYNC_SIZE;
startcode = find_next_start_code(s->pb, &size, &m->header_state);
last_sync = avio_tell(s->pb);
- //printf("startcode=%x pos=0x%"PRIx64"\n", startcode, avio_tell(s->pb));
if (startcode < 0){
if(url_feof(s->pb))
return AVERROR_EOF;
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 28e652551b..e2a96bc631 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1006,7 +1006,10 @@ retry:
}
if(timestamp_packet){
-//av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f scr:%f stream:%d\n", timestamp_packet->dts/90000.0, timestamp_packet->pts/90000.0, scr/90000.0, best_i);
+ av_dlog(ctx, "dts:%f pts:%f scr:%f stream:%d\n",
+ timestamp_packet->dts / 90000.0,
+ timestamp_packet->pts / 90000.0,
+ scr / 90000.0, best_i);
es_size= flush_packet(ctx, best_i, timestamp_packet->pts, timestamp_packet->dts, scr, trailer_size);
}else{
assert(av_fifo_size(stream->fifo) == trailer_size);
@@ -1065,7 +1068,9 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
dts += 2*preload;
}
-//av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", dts/90000.0, pts/90000.0, pkt->flags, pkt->stream_index, pts != AV_NOPTS_VALUE);
+ av_dlog(ctx, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n",
+ dts / 90000.0, pts / 90000.0, pkt->flags,
+ pkt->stream_index, pts != AV_NOPTS_VALUE);
if (!stream->premux_packet)
stream->next_packet = &stream->premux_packet;
*stream->next_packet=
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index c39cf45d7b..6316d6178e 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -423,7 +423,8 @@ static int get_packet_size(const uint8_t *buf, int size)
score = analyze(buf, size, TS_PACKET_SIZE, NULL);
dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);
fec_score= analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);
-// av_log(NULL, AV_LOG_DEBUG, "score: %d, dvhs_score: %d, fec_score: %d \n", score, dvhs_score, fec_score);
+ av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",
+ score, dvhs_score, fec_score);
if (score > fec_score && score > dvhs_score) return TS_PACKET_SIZE;
else if(dvhs_score > score && dvhs_score > fec_score) return TS_DVHS_PACKET_SIZE;
@@ -1878,7 +1879,8 @@ static int mpegts_probe(AVProbeData *p)
score = analyze(p->buf, TS_PACKET_SIZE *check_count, TS_PACKET_SIZE , NULL)*CHECK_COUNT/check_count;
dvhs_score= analyze(p->buf, TS_DVHS_PACKET_SIZE*check_count, TS_DVHS_PACKET_SIZE, NULL)*CHECK_COUNT/check_count;
fec_score = analyze(p->buf, TS_FEC_PACKET_SIZE *check_count, TS_FEC_PACKET_SIZE , NULL)*CHECK_COUNT/check_count;
-// av_log(NULL, AV_LOG_DEBUG, "score: %d, dvhs_score: %d, fec_score: %d \n", score, dvhs_score, fec_score);
+ av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",
+ score, dvhs_score, fec_score);
// we need a clear definition for the returned score otherwise things will become messy sooner or later
if (score > fec_score && score > dvhs_score && score > 6) return AVPROBE_SCORE_MAX + score - CHECK_COUNT;
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index eba7312fbd..0b7a678157 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1098,7 +1098,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
do {
p = avpriv_mpv_find_start_code(p, buf_end, &state);
- //av_log(s, AV_LOG_INFO, "nal %d\n", state & 0x1f);
+ av_dlog(s, "nal %d\n", state & 0x1f);
} while (p < buf_end && (state & 0x1f) != 9 &&
(state & 0x1f) != 5 && (state & 0x1f) != 1);
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 6fdc70448b..220b3e47eb 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2107,7 +2107,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
}
*out = pktl->pkt;
- //av_log(s, AV_LOG_DEBUG, "out st:%d dts:%lld\n", (*out).stream_index, (*out).dts);
+ av_dlog(s, "out st:%d dts:%lld\n", (*out).stream_index, (*out).dts);
s->packet_buffer = pktl->next;
if(s->streams[pktl->pkt.stream_index]->last_in_packet_buffer == pktl)
s->streams[pktl->pkt.stream_index]->last_in_packet_buffer= NULL;
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index d3db102589..f719c8ea59 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -96,16 +96,12 @@ static int find_header_idx(AVFormatContext *s, AVCodecContext *c, int size, int
int i;
int len= find_expected_header(c, size, frame_type, out);
-//av_log(NULL, AV_LOG_ERROR, "expected_h len=%d size=%d codec_id=%d\n", len, size, c->codec_id);
-
for(i=1; i<nut->header_count; i++){
if( len == nut->header_len[i]
&& !memcmp(out, nut->header[i], len)){
-// av_log(NULL, AV_LOG_ERROR, "found %d\n", i);
return i;
}
}
-// av_log(NULL, AV_LOG_ERROR, "nothing found\n");
return 0;
}
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 3cbf3f590f..a69017dc09 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -358,7 +358,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
st->codec->codec_tag = avio_rl32(pb);
st->codec->codec_id = ff_codec_get_id(ff_rm_codec_tags,
st->codec->codec_tag);
-// av_log(s, AV_LOG_DEBUG, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0'));
+ av_dlog(s, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0'));
if (st->codec->codec_id == AV_CODEC_ID_NONE)
goto fail1;
st->codec->width = avio_rb16(pb);
@@ -1002,7 +1002,8 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
}
if((flags&2) && (seq&0x7F) == 1){
-// av_log(s, AV_LOG_DEBUG, "%d %d-%d %"PRId64" %d\n", flags, stream_index2, stream_index, dts, seq);
+ av_dlog(s, "%d %d-%d %"PRId64" %d\n",
+ flags, stream_index2, stream_index, dts, seq);
av_add_index_entry(st, pos, dts, 0, 0, AVINDEX_KEYFRAME);
if(stream_index2 == stream_index)
break;
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index bfebe40c81..80f1047c5d 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -155,8 +155,6 @@ static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end)
get_word_sep(buf, sizeof(buf), "-", &p);
av_parse_time(end, buf, 1);
}
-// av_log(NULL, AV_LOG_DEBUG, "Range Start: %lld\n", *start);
-// av_log(NULL, AV_LOG_DEBUG, "Range End: %lld\n", *end);
}
static int get_sockaddr(const char *buf, struct sockaddr_storage *sock)
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 86ea6dec9e..3967d82ef3 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -45,7 +45,6 @@ static int get_swf_tag(AVIOContext *pb, int *len_ptr)
if (len == 0x3f) {
len = avio_rl32(pb);
}
-// av_log(NULL, AV_LOG_DEBUG, "Tag: %d - Len: %d\n", tag, len);
*len_ptr = len;
return tag;
}
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7940037782..b3298f8fbd 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1113,8 +1113,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts)
presentation_delayed = 1;
-// av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%s, dts:%s cur_dts:%s st:%d pc:%p duration:%d\n",
-// presentation_delayed, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), pkt->stream_index, pc, pkt->duration);
+ av_dlog(NULL, "IN delayed:%d pts:%s, dts:%s cur_dts:%s st:%d pc:%p duration:%d\n",
+ presentation_delayed, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), pkt->stream_index, pc, pkt->duration);
/* interpolate PTS and DTS if they are not present */
//We skip H264 currently because delay and has_b_frames are not reliably set
if((delay==0 || (delay==1 && pc)) && st->codec->codec_id != AV_CODEC_ID_H264){
@@ -1182,8 +1182,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if(pkt->dts > st->cur_dts)
st->cur_dts = pkt->dts;
-// av_log(NULL, AV_LOG_ERROR, "OUTdelayed:%d/%d pts:%s, dts:%s cur_dts:%s\n",
-// presentation_delayed, delay, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts));
+ av_dlog(NULL, "OUTdelayed:%d/%d pts:%s, dts:%s cur_dts:%s\n",
+ presentation_delayed, delay, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts));
/* update flags */
if (is_intra_only(st->codec))
@@ -3536,7 +3536,8 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
return AVERROR(EINVAL);
}
-// av_log(s, AV_LOG_DEBUG, "av_write_frame: pts2:%s dts2:%s\n", av_ts2str(pkt->pts), av_ts2str(pkt->dts));
+ av_dlog(s, "av_write_frame: pts2:%s dts2:%s\n",
+ av_ts2str(pkt->pts), av_ts2str(pkt->dts));
st->cur_dts= pkt->dts;
st->pts.val= pkt->dts;
diff --git a/tools/pktdumper.c b/tools/pktdumper.c
index 2a80b25d98..920397bcae 100644
--- a/tools/pktdumper.c
+++ b/tools/pktdumper.c
@@ -113,7 +113,6 @@ int main(int argc, char **argv)
(pkt.flags & AV_PKT_FLAG_KEY) ? 'K' : '_');
printf(PKTFILESUFF "\n", pktnum, pkt.stream_index, pkt.pts, pkt.size,
(pkt.flags & AV_PKT_FLAG_KEY) ? 'K' : '_');
- //printf("open(\"%s\")\n", pktfilename);
if (!nowrite) {
fd = open(pktfilename, O_WRONLY | O_CREAT, 0644);
err = write(fd, pkt.data, pkt.size);