diff options
author | Michel Bardiaux <mbardiaux@peaktime.be> | 2003-11-03 13:26:22 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-11-03 13:26:22 +0000 |
commit | 9b879566789379631f02b83be367ca55c88a1ae9 (patch) | |
tree | ee2b274b74329eb94548dc6c85bc966485c75d2a /libavcodec/msmpeg4.c | |
parent | 8bae9ddc91f6a083d420494bbd652d8258649066 (diff) | |
download | ffmpeg-9b879566789379631f02b83be367ca55c88a1ae9.tar.gz |
av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
Originally committed as revision 2469 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msmpeg4.c')
-rw-r--r-- | libavcodec/msmpeg4.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index d62c572cb0..b3f61a26de 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -1238,7 +1238,7 @@ return -1; int start_code, num; start_code = (get_bits(&s->gb, 16)<<16) | get_bits(&s->gb, 16); if(start_code!=0x00000100){ - fprintf(stderr, "invalid startcode\n"); + av_log(s->avctx, AV_LOG_ERROR, "invalid startcode\n"); return -1; } @@ -1248,7 +1248,7 @@ return -1; s->pict_type = get_bits(&s->gb, 2) + 1; if (s->pict_type != I_TYPE && s->pict_type != P_TYPE){ - fprintf(stderr, "invalid picture type\n"); + av_log(s->avctx, AV_LOG_ERROR, "invalid picture type\n"); return -1; } #if 0 @@ -1260,7 +1260,7 @@ return -1; #endif s->qscale = get_bits(&s->gb, 5); if(s->qscale==0){ - fprintf(stderr, "invalid qscale\n"); + av_log(s->avctx, AV_LOG_ERROR, "invalid qscale\n"); return -1; } @@ -1268,7 +1268,7 @@ return -1; code = get_bits(&s->gb, 5); if(s->msmpeg4_version==1){ if(code==0 || code>s->mb_height){ - fprintf(stderr, "invalid slice height %d\n", code); + av_log(s->avctx, AV_LOG_ERROR, "invalid slice height %d\n", code); return -1; } @@ -1276,7 +1276,7 @@ return -1; }else{ /* 0x17: one slice, 0x18: two slices, ... */ if (code < 0x17){ - fprintf(stderr, "error, slice code was %X\n", code); + av_log(s->avctx, AV_LOG_ERROR, "error, slice code was %X\n", code); return -1; } @@ -1314,7 +1314,7 @@ return -1; } s->no_rounding = 1; if(s->avctx->debug&FF_DEBUG_PICT_INFO) - printf("qscale:%d rlc:%d rl:%d dc:%d mbrl:%d slice:%d \n", + av_log(s->avctx, AV_LOG_DEBUG, "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d slice:%d \n", s->qscale, s->rl_chroma_table_index, s->rl_table_index, @@ -1362,7 +1362,7 @@ return -1; } if(s->avctx->debug&FF_DEBUG_PICT_INFO) - printf("skip:%d rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d \n", + av_log(s->avctx, AV_LOG_DEBUG, "skip:%d rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d \n", s->use_skip_mb_code, s->rl_table_index, s->rl_chroma_table_index, @@ -1410,11 +1410,11 @@ int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) { s->flipflop_rounding= 0; if(s->msmpeg4_version != 2) - printf("ext header missing, %d left\n", left); + av_log(s->avctx, AV_LOG_ERROR, "ext header missing, %d left\n", left); } else { - fprintf(stderr, "I frame too long, ignoring ext header\n"); + av_log(s->avctx, AV_LOG_ERROR, "I frame too long, ignoring ext header\n"); } return 0; @@ -1517,7 +1517,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) else code = get_vlc2(&s->gb, v1_inter_cbpc_vlc.table, V1_INTER_CBPC_VLC_BITS, 3); if(code<0 || code>7){ - fprintf(stderr, "cbpc %d invalid at %d %d\n", code, s->mb_x, s->mb_y); + av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", code, s->mb_x, s->mb_y); return -1; } @@ -1531,7 +1531,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) else cbp= get_vlc2(&s->gb, v1_intra_cbpc_vlc.table, V1_INTRA_CBPC_VLC_BITS, 1); if(cbp<0 || cbp>3){ - fprintf(stderr, "cbpc %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y); + av_log(s->avctx, AV_LOG_ERROR, "cbpc %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y); return -1; } } @@ -1541,7 +1541,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) cbpy= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); if(cbpy<0){ - fprintf(stderr, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y); + av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y); return -1; } @@ -1570,7 +1570,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) for (i = 0; i < 6; i++) { if (msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) { - fprintf(stderr,"\nerror while decoding block: %d x %d (%d)\n", s->mb_x, s->mb_y, i); + av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", s->mb_x, s->mb_y, i); return -1; } } @@ -1662,7 +1662,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) for (i = 0; i < 6; i++) { if (msmpeg4_decode_block(s, block[i], i, (cbp >> (5 - i)) & 1, NULL) < 0) { - fprintf(stderr,"\nerror while decoding block: %d x %d (%d)\n", s->mb_x, s->mb_y, i); + av_log(s->avctx, AV_LOG_ERROR, "\nerror while decoding block: %d x %d (%d)\n", s->mb_x, s->mb_y, i); return -1; } } @@ -1688,20 +1688,20 @@ static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, level = msmpeg4_decode_dc(s, n, &dc_pred_dir); if (level < 0){ - fprintf(stderr, "dc overflow- block: %d qscale: %d//\n", n, s->qscale); + av_log(s->avctx, AV_LOG_ERROR, "dc overflow- block: %d qscale: %d//\n", n, s->qscale); if(s->inter_intra_pred) level=0; else return -1; } if (n < 4) { rl = &rl_table[s->rl_table_index]; if(level > 256*s->y_dc_scale){ - fprintf(stderr, "dc overflow+ L qscale: %d//\n", s->qscale); + av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ L qscale: %d//\n", s->qscale); if(!s->inter_intra_pred) return -1; } } else { rl = &rl_table[3 + s->rl_chroma_table_index]; if(level > 256*s->c_dc_scale){ - fprintf(stderr, "dc overflow+ C qscale: %d//\n", s->qscale); + av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ C qscale: %d//\n", s->qscale); if(!s->inter_intra_pred) return -1; } } @@ -1770,7 +1770,7 @@ static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, if(s->qscale<8){ ll= SHOW_UBITS(re, &s->gb, 3); SKIP_BITS(re, &s->gb, 3); if(ll==0){ - if(SHOW_UBITS(re, &s->gb, 1)) printf("cool a new vlc code ,contact the ffmpeg developers and upload the file\n"); + if(SHOW_UBITS(re, &s->gb, 1)) av_log(s->avctx, AV_LOG_ERROR, "cool a new vlc code ,contact the ffmpeg developers and upload the file\n"); SKIP_BITS(re, &s->gb, 1); ll=8; } @@ -1891,10 +1891,10 @@ static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, if(i&(~63)){ const int left= s->gb.size_in_bits - get_bits_count(&s->gb); if(((i+192 == 64 && level/qmul==-1) || s->error_resilience<=1) && left>=0){ - fprintf(stderr, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y); + av_log(s->avctx, AV_LOG_ERROR, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y); break; }else{ - fprintf(stderr, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y); + av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y); return -1; } } @@ -1940,7 +1940,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) level = get_vlc2(&s->gb, dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); } if (level < 0){ - fprintf(stderr, "illegal dc vlc\n"); + av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n"); return -1; } @@ -1987,7 +1987,7 @@ static int msmpeg4_decode_motion(MpegEncContext * s, code = get_vlc2(&s->gb, mv->vlc.table, MV_VLC_BITS, 2); if (code < 0){ - fprintf(stderr, "illegal MV code at %d %d\n", s->mb_x, s->mb_y); + av_log(s->avctx, AV_LOG_ERROR, "illegal MV code at %d %d\n", s->mb_x, s->mb_y); return -1; } if (code == mv->n) { |