From 6f6b0311a339c748b7be5bc15bd496321b3261b2 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 25 Sep 2012 17:19:34 +0200 Subject: avcodec: Drop some silly commented-out av_log() invocations --- libavcodec/wmadec.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'libavcodec/wmadec.c') diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 5ee3742380..db5900e34a 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; iextradata_size; i++) -// av_log(NULL, AV_LOG_ERROR, "%02X ", extradata[i]); s->use_exp_vlc = flags2 & 0x0001; s->use_bit_reservoir = flags2 & 0x0002; -- cgit v1.2.3 From 9c6cf7f2c9d326281e3eefa67673aabaa9d69940 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 25 Sep 2012 18:28:44 +0200 Subject: avcodec: Drop silly and/or broken printf debug output --- avserver.c | 2 -- libavcodec/error_resilience.c | 4 ---- libavcodec/ffv1.c | 7 +------ libavcodec/h263dec.c | 2 -- libavcodec/h264.c | 3 --- libavcodec/h264_loopfilter.c | 4 ---- libavcodec/h264_parser.c | 1 - libavcodec/ljpegenc.c | 1 - libavcodec/mjpegdec.c | 9 --------- libavcodec/mjpegenc.c | 1 - libavcodec/motion_est.c | 10 ---------- libavcodec/motion_est_template.c | 14 ++------------ libavcodec/mpegvideo_enc.c | 7 ------- libavcodec/msmpeg4.c | 7 +------ libavcodec/msmpeg4enc.c | 3 --- libavcodec/put_bits.h | 3 --- libavcodec/ratecontrol.c | 12 ------------ libavcodec/utils.c | 1 - libavcodec/wmadec.c | 1 - libavcodec/wmv2dec.c | 4 ---- libavcodec/x86/mpegvideo.c | 4 ++-- 21 files changed, 6 insertions(+), 94 deletions(-) (limited to 'libavcodec/wmadec.c') diff --git a/avserver.c b/avserver.c index 6d103bb0a9..94ea0a074f 100644 --- a/avserver.c +++ b/avserver.c @@ -2663,8 +2663,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/error_resilience.c b/libavcodec/error_resilience.c index 53e8bf971e..ae9ef68617 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -699,8 +699,6 @@ skip_last_mv: fixed[mb_xy] = MV_UNCHANGED; } } - - // printf(".%d/%d", changed, score_sum); fflush(stdout); } if (none_left) @@ -711,7 +709,6 @@ skip_last_mv: if (fixed[mb_xy]) fixed[mb_xy] = MV_FROZEN; } - // printf(":"); fflush(stdout); } } @@ -789,7 +786,6 @@ static int is_intra_more_likely(MpegEncContext *s) } } } - // printf("is_intra_likely: %d type:%d\n", is_intra_likely, s->pict_type); return is_intra_likely > 0; } diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 51ead47201..b1358b8de6 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -383,7 +383,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; @@ -432,7 +431,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; } @@ -1117,7 +1116,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, if(!f->ac){ used_count += ff_rac_terminate(c); -//printf("pos=%d\n", used_count); init_put_bits(&f->slice_context[0]->pb, pkt->data + used_count, pkt->size - used_count); }else if (f->ac>1){ int i; @@ -1432,8 +1430,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"); } } @@ -1704,7 +1700,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac if(!f->ac){ bytes_read = c->bytestream - c->bytestream_start - 1; if(bytes_read ==0) av_log(avctx, AV_LOG_ERROR, "error at end of AC stream\n"); //FIXME -//printf("pos=%d\n", bytes_read); init_get_bits(&f->slice_context[0]->gb, buf + bytes_read, (buf_size - bytes_read) * 8); } else { bytes_read = 0; /* avoid warning */ diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index ba7fb8ae12..1231f29e32 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -228,7 +228,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--; @@ -510,7 +509,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 5de7f104ca..068c57a056 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -235,7 +235,6 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, if (dst == NULL) return NULL; - // printf("decoding esc\n"); memcpy(dst, src, i); si = di = i; while (si + 2 < length) { @@ -2134,7 +2133,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) @@ -4049,7 +4047,6 @@ out: 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_loopfilter.c b/libavcodec/h264_loopfilter.c index be750caa6d..b045d2388a 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -583,9 +583,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u // value in IPCM macroblocks. if(bS[0]+bS[1]+bS[2]+bS[3]){ qp = (s->current_picture.f.qscale_table[mb_xy] + s->current_picture.f.qscale_table[mbm_xy] + 1) >> 1; - //tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], s->current_picture.qscale_table[mbn_xy]); tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize); - //{ int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); } chroma_qp_avg[0] = (h->chroma_qp[0] + get_chroma_qp(h, 0, s->current_picture.f.qscale_table[mbm_xy]) + 1) >> 1; chroma_qp_avg[1] = (h->chroma_qp[1] + get_chroma_qp(h, 1, s->current_picture.f.qscale_table[mbm_xy]) + 1) >> 1; if( dir == 0 ) { @@ -668,9 +666,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u // Do not use s->qscale as luma quantizer because it has not the same // value in IPCM macroblocks. qp = s->current_picture.f.qscale_table[mb_xy]; - //tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], s->current_picture.qscale_table[mbn_xy]); tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize); - //{ int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); } if( dir == 0 ) { filter_mb_edgev( &img_y[4*edge << h->pixel_shift], linesize, bS, qp, a, b, h, 0 ); if (chroma) { diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 1ad8e497f1..0464476382 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -37,7 +37,6 @@ static int ff_h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_si int i; uint32_t state; ParseContext *pc = &(h->s.parse_context); -//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/ljpegenc.c b/libavcodec/ljpegenc.c index 41db067342..331ec5ccb6 100644 --- a/libavcodec/ljpegenc.c +++ b/libavcodec/ljpegenc.c @@ -174,7 +174,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 72c9cfa988..7217f4f196 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1178,8 +1178,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); if (i == 2) s->bottom_field = 1; @@ -1191,8 +1189,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; } @@ -1314,8 +1310,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 > 20 && !strncmp(cbuf, "Intel(R) JPEG Library", 21)) || @@ -1605,9 +1599,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; } not_the_end: diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index f976e28759..ebe899326e 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -320,7 +320,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 12e12571b1..f34a3477f7 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]; @@ -1314,7 +1312,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; @@ -1837,15 +1834,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; } @@ -1865,7 +1856,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 136d8b8494..7228744756 100644 --- a/libavcodec/motion_est_template.c +++ b/libavcodec/motion_est_template.c @@ -367,13 +367,11 @@ static int qpel_motion_search(MpegEncContext * s, assert((x) <= xmax);\ assert((y) >= ymin);\ assert((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)<xmin) CHECK_MV_DIR(x-1, y , 0) if(dir!=3 && y>ymin) CHECK_MV_DIR(x , y-1, 1) if(dir!=0 && xfirst_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) @@ -1050,7 +1042,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; } @@ -1080,7 +1071,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) @@ -1110,6 +1101,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/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 4bf4471847..31ba122af4 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1397,7 +1397,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)); } @@ -1444,8 +1443,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) @@ -2396,7 +2393,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(); @@ -2446,7 +2442,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; @@ -2918,7 +2913,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; @@ -3088,7 +3082,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; } diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index c4ef22e74c..2755aa26f6 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -543,7 +543,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; @@ -858,8 +857,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(leftesc3_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); @@ -1056,7 +1052,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); @@ -1182,7 +1178,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 67490b53f6..e6951e8539 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); diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h index f19a7c689b..f32b7fd060 100644 --- a/libavcodec/put_bits.h +++ b/libavcodec/put_bits.h @@ -130,13 +130,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); assert(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); @@ -155,7 +153,6 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value) bit_buf<<=bit_left; bit_buf |= value >> (n - bit_left); 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 de32da2a7c..0772a912c1 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -444,7 +444,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; @@ -623,8 +622,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; } } @@ -669,7 +666,6 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) get_qminmax(&qmin, &qmax, s, pict_type); fps= 1/av_q2d(s->avctx->time_base); -//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; @@ -692,9 +688,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, "%Ld %Ld %Ld %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 @@ -750,9 +743,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 @@ -761,9 +752,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); @@ -888,7 +877,6 @@ 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; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7c02d332b9..a72c434d00 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -551,7 +551,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/wmadec.c b/libavcodec/wmadec.c index db5900e34a..78ada71466 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -851,7 +851,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) diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index b23ebf060f..106e91b269 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){ diff --git a/libavcodec/x86/mpegvideo.c b/libavcodec/x86/mpegvideo.c index 077031af98..3bc93f30e2 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" -- cgit v1.2.3 From 1218777ffd152287244349d4ff9e1cbc84fa2c54 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 21 Aug 2012 12:41:40 +0200 Subject: avcodec: Convert some commented-out printf/av_log instances to av_dlog --- libavcodec/dcadec.c | 4 ++-- libavcodec/ffv1.c | 16 +++++++++++----- libavcodec/flicvideo.c | 4 +++- libavcodec/h263dec.c | 3 ++- libavcodec/h264_cabac.c | 3 ++- libavcodec/imc.c | 2 +- libavcodec/jpegls.c | 2 +- libavcodec/jpeglsdec.c | 10 +++++++--- libavcodec/mjpegdec.c | 15 +++++++-------- libavcodec/motion_est.c | 4 ++-- libavcodec/mpeg12.c | 13 ++++++++----- libavcodec/mpegaudiodec.c | 4 ++-- libavcodec/mpegvideo.c | 12 ++++++------ libavcodec/mpegvideo_enc.c | 10 ++++++---- libavcodec/msmpeg4.c | 15 ++++++++++----- libavcodec/msmpeg4enc.c | 3 ++- libavcodec/ratecontrol.c | 24 ++++++++++++++---------- libavcodec/svq1dec.c | 4 ++-- libavcodec/vc1.c | 5 +++-- libavcodec/vc1dec.c | 3 ++- libavcodec/vp3.c | 3 ++- libavcodec/wmadec.c | 4 +++- libavcodec/wmv2dec.c | 11 +++++++---- 23 files changed, 105 insertions(+), 69 deletions(-) (limited to 'libavcodec/wmadec.c') diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 6b0812cf70..a0a5ea948d 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -704,8 +704,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/ffv1.c b/libavcodec/ffv1.c index b1358b8de6..a257803349 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -401,7 +401,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); @@ -420,7 +421,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); @@ -500,7 +502,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); @@ -1300,7 +1304,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; @@ -1572,7 +1577,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 fe59963964..831ada093b 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -486,7 +486,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/h263dec.c b/libavcodec/h263dec.c index 1231f29e32..f93d79a675 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -215,7 +215,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) diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 88bcc734bb..f2fea5d3f2 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -2027,7 +2027,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); diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 262f4f75cc..8e6b5bfb31 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -742,7 +742,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; } diff --git a/libavcodec/jpegls.c b/libavcodec/jpegls.c index ebe6b85e98..4740f11e05 100644 --- a/libavcodec/jpegls.c +++ b/libavcodec/jpegls.c @@ -85,5 +85,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 48974dd8d3..8a558476c3 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; } @@ -282,8 +282,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 */ off = s->cur_scan - 1; stride = (s->nb_components > 1) ? 3 : 1; diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 7217f4f196..1bcbcfd1d4 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -365,9 +365,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); @@ -892,11 +892,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++; diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index f34a3477f7..932406d35b 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -1720,11 +1720,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 diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index a9626c4026..fd8d71f1b4 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1275,8 +1275,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 = @@ -1843,7 +1845,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; } @@ -1862,8 +1864,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 e6a8b171f6..80acdadc48 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -1383,8 +1383,8 @@ static int mp_decode_layer3(MPADecodeContext *s) FFMAX(0, LAST_BUF_SIZE - s->last_buf_size)); assert((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 d81adca841..592b4f2b2e 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1396,12 +1396,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 || diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 31ba122af4..8325ee0f74 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -957,8 +957,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); @@ -2989,7 +2989,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)); } } @@ -3184,7 +3185,8 @@ static int encode_picture(MpegEncContext *s, int picture_number) s->pict_type= AV_PICTURE_TYPE_I; for(i=0; imb_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); + 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 2755aa26f6..5e562d8478 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; @@ -556,12 +556,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); @@ -836,7 +839,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; @@ -1023,7 +1027,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){ diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c index e6951e8539..4a362c3921 100644 --- a/libavcodec/msmpeg4enc.c +++ b/libavcodec/msmpeg4enc.c @@ -230,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/ratecontrol.c b/libavcodec/ratecontrol.c index 0772a912c1..2cb5eeaefe 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -270,7 +270,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; -//printf("%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; @@ -479,7 +480,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 (qqmax) q=qmax; @@ -706,7 +709,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; @@ -883,11 +887,9 @@ static int init_pass2(MpegEncContext *s) 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; @@ -899,8 +901,10 @@ static int init_pass2(MpegEncContext *s) /* check bitrate calculations and print info */ qscale_sum = 0.0; for(i=0; inum_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/svq1dec.c b/libavcodec/svq1dec.c index c16fd062e3..4af8b42624 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/vc1.c b/libavcodec/vc1.c index cd56499eba..b04d570602 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -652,8 +652,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 986e4adc5e..310172a84d 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5622,7 +5622,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; ff_er_frame_end(s); diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 296f9fca9a..1f5f6c8982 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2073,7 +2073,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 78ada71466..1f9ab61969 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -913,7 +913,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/wmv2dec.c b/libavcodec/wmv2dec.c index 106e91b269..c1fd4ee0a3 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -415,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); -- cgit v1.2.3