Mercurial > libavcodec.hg
diff mpeg12.c @ 4652:6679d37a3338 libavcodec
Give context to dprintf
| author | mbardiaux |
|---|---|
| date | Mon, 12 Mar 2007 12:36:41 +0000 |
| parents | fd9e324b3978 |
| children | f0ce30e115ac |
line wrap: on
line diff
--- a/mpeg12.c Sun Mar 11 21:01:33 2007 +0000 +++ b/mpeg12.c Mon Mar 12 12:36:41 2007 +0000 @@ -996,7 +996,7 @@ next_coef: #if 0 if (level != 0) - dprintf("level[%d]=%d\n", i, level); + dprintf(s->avctx, "level[%d]=%d\n", i, level); #endif /* encode using VLC */ if (level != 0) { @@ -1115,7 +1115,7 @@ int i, j, k, cbp, val, mb_type, motion_type; const int mb_block_count = 4 + (1<< s->chroma_format); - dprintf("decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y); + dprintf(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y); assert(s->mb_skipped==0); @@ -1199,7 +1199,7 @@ mb_type = btype2mb_type[ mb_type ]; break; } - dprintf("mb_type=%x\n", mb_type); + dprintf(s->avctx, "mb_type=%x\n", mb_type); // motion_type = 0; /* avoid warning */ if (IS_INTRA(mb_type)) { s->dsp.clear_blocks(s->block[0]); @@ -1309,7 +1309,7 @@ for(i=0;i<2;i++) { if (USES_LIST(mb_type, i)) { s->mv_dir |= (MV_DIR_FORWARD >> i); - dprintf("motion_type=%d\n", motion_type); + dprintf(s->avctx, "motion_type=%d\n", motion_type); switch(motion_type) { case MT_FRAME: /* or MT_16X8 */ if (s->picture_structure == PICT_FRAME) { @@ -1350,12 +1350,12 @@ s->last_mv[i][j][0]); s->last_mv[i][j][0] = val; s->mv[i][j][0] = val; - dprintf("fmx=%d\n", val); + dprintf(s->avctx, "fmx=%d\n", val); val = mpeg_decode_motion(s, s->mpeg_f_code[i][1], s->last_mv[i][j][1] >> 1); s->last_mv[i][j][1] = val << 1; s->mv[i][j][1] = val; - dprintf("fmy=%d\n", val); + dprintf(s->avctx, "fmy=%d\n", val); } } else { mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED; @@ -1580,7 +1580,7 @@ dc += diff; s->last_dc[component] = dc; block[0] = dc<<3; - dprintf("dc=%d diff=%d\n", dc, diff); + dprintf(s->avctx, "dc=%d diff=%d\n", dc, diff); i = 0; { OPEN_READER(re, &s->gb); @@ -1954,7 +1954,7 @@ dc += diff; s->last_dc[component] = dc; block[0] = dc << (3 - s->intra_dc_precision); - dprintf("dc=%d\n", block[0]); + dprintf(s->avctx, "dc=%d\n", block[0]); mismatch = block[0] ^ 1; i = 0; if (s->intra_vlc_format) @@ -2305,7 +2305,7 @@ s1->frame_rate_ext.num = get_bits(&s->gb, 2)+1; s1->frame_rate_ext.den = get_bits(&s->gb, 5)+1; - dprintf("sequence extension\n"); + dprintf(s->avctx, "sequence extension\n"); s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG2VIDEO; s->avctx->sub_id = 2; /* indicates mpeg2 found */ @@ -2377,7 +2377,7 @@ { int i, v, j; - dprintf("matrix extension\n"); + dprintf(s->avctx, "matrix extension\n"); if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { @@ -2448,15 +2448,15 @@ } /* composite display not parsed */ - dprintf("intra_dc_precision=%d\n", s->intra_dc_precision); - dprintf("picture_structure=%d\n", s->picture_structure); - dprintf("top field first=%d\n", s->top_field_first); - dprintf("repeat first field=%d\n", s->repeat_first_field); - dprintf("conceal=%d\n", s->concealment_motion_vectors); - dprintf("intra_vlc_format=%d\n", s->intra_vlc_format); - dprintf("alternate_scan=%d\n", s->alternate_scan); - dprintf("frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct); - dprintf("progressive_frame=%d\n", s->progressive_frame); + dprintf(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision); + dprintf(s->avctx, "picture_structure=%d\n", s->picture_structure); + dprintf(s->avctx, "top field first=%d\n", s->top_field_first); + dprintf(s->avctx, "repeat first field=%d\n", s->repeat_first_field); + dprintf(s->avctx, "conceal=%d\n", s->concealment_motion_vectors); + dprintf(s->avctx, "intra_vlc_format=%d\n", s->intra_vlc_format); + dprintf(s->avctx, "alternate_scan=%d\n", s->alternate_scan); + dprintf(s->avctx, "frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct); + dprintf(s->avctx, "progressive_frame=%d\n", s->progressive_frame); } static void mpeg_decode_extension(AVCodecContext *avctx, @@ -2635,7 +2635,7 @@ ret = mpeg_decode_mb(s, s->block); s->chroma_qscale= s->qscale; - dprintf("ret=%d\n", ret); + dprintf(s->avctx, "ret=%d\n", ret); if (ret < 0) return -1; @@ -2858,10 +2858,10 @@ s->chroma_intra_matrix[j] = v; } #ifdef DEBUG - dprintf("intra matrix present\n"); + dprintf(s->avctx, "intra matrix present\n"); for(i=0;i<64;i++) - dprintf(" %d", s->intra_matrix[s->dsp.idct_permutation[i]]); - dprintf("\n"); + dprintf(s->avctx, " %d", s->intra_matrix[s->dsp.idct_permutation[i]]); + dprintf(s->avctx, "\n"); #endif } else { for(i=0;i<64;i++) { @@ -2883,10 +2883,10 @@ s->chroma_inter_matrix[j] = v; } #ifdef DEBUG - dprintf("non intra matrix present\n"); + dprintf(s->avctx, "non intra matrix present\n"); for(i=0;i<64;i++) - dprintf(" %d", s->inter_matrix[s->dsp.idct_permutation[i]]); - dprintf("\n"); + dprintf(s->avctx, " %d", s->inter_matrix[s->dsp.idct_permutation[i]]); + dprintf(s->avctx, "\n"); #endif } else { for(i=0;i<64;i++) { @@ -3086,7 +3086,7 @@ int ret, input_size; AVFrame *picture = data; MpegEncContext *s2 = &s->mpeg_enc_ctx; - dprintf("fill_buffer\n"); + dprintf(avctx, "fill_buffer\n"); if (buf_size == 0) { /* special case for last picture */ @@ -3334,7 +3334,7 @@ if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) ) return -1; if( !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD) ){ - dprintf("mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n"); + dprintf(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n"); } mpeg_decode_init(avctx); s = avctx->priv_data;
