[FFmpeg-cvslog] avcodec: Drop some silly commented-out av_log() invocations

Diego Biurrun git at videolan.org
Mon Oct 1 16:28:47 CEST 2012


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Sep 25 17:19:34 2012 +0200| [6f6b0311a339c748b7be5bc15bd496321b3261b2] | committer: Diego Biurrun

avcodec: Drop some silly commented-out av_log() invocations

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6f6b0311a339c748b7be5bc15bd496321b3261b2
---

 libavcodec/aaccoder.c      |    3 ---
 libavcodec/adpcm.c         |    1 -
 libavcodec/cook.c          |    9 ++-------
 libavcodec/dnxhddec.c      |   10 +---------
 libavcodec/golomb.h        |    2 --
 libavcodec/h264_cabac.c    |   13 ++-----------
 libavcodec/imc.c           |    2 --
 libavcodec/mpegaudiodec.c  |    5 -----
 libavcodec/mpegvideo.c     |    1 -
 libavcodec/mpegvideo_enc.c |    8 --------
 libavcodec/parser.c        |    1 -
 libavcodec/rv10.c          |    7 +------
 libavcodec/vc1.c           |    2 --
 libavcodec/vorbis.c        |    4 +---
 libavcodec/wmadec.c        |    2 --
 libavcodec/wmaenc.c        |    1 -
 16 files changed, 7 insertions(+), 64 deletions(-)

diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index c2b0e24..d65d8d9 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/adpcm.c b/libavcodec/adpcm.c
index 19772b0..a48cee2 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -356,7 +356,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 0e7c497..1dec398 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -420,11 +420,9 @@ static void categorize(COOKContext *q, COOKSubpacket *p, int *quant_index_table,
 
     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;
 
@@ -925,10 +923,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/dnxhddec.c b/libavcodec/dnxhddec.c
index 00db8a1..5230305 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -208,18 +208,14 @@ 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]);
 
     for (i = 1; ; i++) {
         UPDATE_CACHE(bs, &ctx->gb);
         GET_VLC(index1, bs, &ctx->gb, ctx->ac_vlc.table,
                 DNXHD_VLC_BITS, 2);
-        //av_log(ctx->avctx, AV_LOG_DEBUG, "index %d\n", index1);
         level = ctx->cid_table->ac_level[index1];
-        if (!level) { /* EOB */
-            //av_log(ctx->avctx, AV_LOG_DEBUG, "EOB\n");
+        if (!level) /* EOB */
             break;
-        }
 
         sign = SHOW_SBITS(bs, &ctx->gb, 1);
         SKIP_BITS(bs, &ctx->gb, 1);
@@ -242,14 +238,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 = (2*level+1) * qscale * weight_matrix[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;
     }
 
@@ -279,7 +272,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);
 
     for (i = 0; i < 8; i++) {
         ctx->dsp.clear_block(ctx->blocks[i]);
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 3fdec0b..6f95a67 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -463,8 +463,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/h264_cabac.c b/libavcodec/h264_cabac.c
index 2bf08b5..88bcc73 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1815,7 +1815,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);
@@ -1826,7 +1825,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 {
@@ -1844,7 +1842,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")
@@ -2351,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 ) {
@@ -2367,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;
                         }
@@ -2380,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 ) {
@@ -2392,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/imc.c b/libavcodec/imc.c
index e452baf..262f4f7 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -781,8 +781,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/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index ead0e1d..e6a8b17 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -885,9 +885,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;
             }
@@ -961,9 +959,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;
         }
@@ -986,7 +982,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_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
         s_index=0;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 5033135..d81adca 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1758,7 +1758,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 726f65f..4bf4471 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1233,10 +1233,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;
@@ -1308,9 +1304,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;
@@ -1501,7 +1494,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);
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index dd2d836..03f327e 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -152,7 +152,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/rv10.c b/libavcodec/rv10.c
index a236846..e01742f 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -373,7 +373,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;
@@ -392,11 +391,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/vc1.c b/libavcodec/vc1.c
index de75aac..cd56499 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -394,8 +394,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;
diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c
index 16fb998..78a2467 100644
--- a/libavcodec/vorbis.c
+++ b/libavcodec/vorbis.c
@@ -62,10 +62,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/wmadec.c b/libavcodec/wmadec.c
index 5ee3742..db5900e 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;
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 8c93e0d..b439548 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -86,7 +86,6 @@ static int encode_init(AVCodecContext * avctx){
     avctx->block_align = s->block_align;
     avctx->bit_rate    = avctx->block_align * 8LL * avctx->sample_rate /
                          s->frame_len;
-//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



More information about the ffmpeg-cvslog mailing list