diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-12-17 11:25:29 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-12-17 11:25:29 +0000 |
commit | 59b571c1e45f6ed3bef7589ae026a1526a07be88 (patch) | |
tree | 77c9181b13e74811d794d20d48e83d849c3db438 /libavcodec | |
parent | a8140ad5aba418a89bfbd48577f453cdf2448edf (diff) | |
download | ffmpeg-59b571c1e45f6ed3bef7589ae026a1526a07be88.tar.gz |
more debug output
Originally committed as revision 1338 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h263.c | 4 | ||||
-rw-r--r-- | libavcodec/mpeg12.c | 10 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 10 | ||||
-rw-r--r-- | libavcodec/mpegvideo.h | 2 | ||||
-rw-r--r-- | libavcodec/ratecontrol.c | 18 |
5 files changed, 32 insertions, 12 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 80fcd13e19..bbeea3abd4 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -4552,11 +4552,11 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ s->b_code=1; if(s->avctx->debug&FF_DEBUG_PICT_INFO){ - printf("qp:%d fc:%d bc:%d type:%s size:%d pro:%d alt:%d top:%d qpel:%d part:%d resync:%d w:%d a:%d\n", + printf("qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d\n", s->qscale, s->f_code, s->b_code, s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")), gb->size,s->progressive_sequence, s->alternate_scan, s->top_field_first, - s->quarter_sample, s->data_partitioning, s->resync_marker, s->num_sprite_warping_points, + s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points, s->sprite_warping_accuracy); } diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 36cf98319f..074e10d93a 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -736,6 +736,7 @@ static int mpeg_decode_mb(MpegEncContext *s, s->mv[1][0][0] = s->last_mv[1][0][0]; s->mv[1][0][1] = s->last_mv[1][0][1]; } + s->mb_skiped = 1; return 0; } @@ -1617,6 +1618,15 @@ static int mpeg_decode_slice(AVCodecContext *avctx, s->first_slice = 0; if(MPV_frame_start(s, avctx) < 0) return DECODE_SLICE_FATAL_ERROR; + + if(s->avctx->debug&FF_DEBUG_PICT_INFO){ + printf("qp:%d fc:%d%d%d%d %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n", + s->qscale, s->mpeg_f_code[0][0],s->mpeg_f_code[0][1],s->mpeg_f_code[1][0],s->mpeg_f_code[1][1], + s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")), + s->progressive_sequence ? "pro" :"", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"", + s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors, + s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :""); + } } init_get_bits(&s->gb, buf, buf_size); diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 87eb882ea1..a7808e107b 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -914,7 +914,6 @@ alloc: void MPV_frame_end(MpegEncContext *s) { int i; - /* draw edge for correct motion prediction if outside */ if(s->codec_id!=CODEC_ID_SVQ1){ if (s->pict_type != B_TYPE && !s->intra_only && !(s->flags&CODEC_FLAG_EMU_EDGE)) { @@ -3466,6 +3465,15 @@ static void dct_unquantize_h263_c(MpegEncContext *s, } } +char ff_get_pict_type_char(int pict_type){ + switch(pict_type){ + case I_TYPE: return 'I'; + case P_TYPE: return 'P'; + case B_TYPE: return 'B'; + case S_TYPE: return 'S'; + } +} + AVCodec mpeg1video_encoder = { "mpeg1video", CODEC_TYPE_VIDEO, diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 41e92835d9..ca0054418f 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -553,6 +553,8 @@ void ff_clean_intra_table_entries(MpegEncContext *s); void ff_init_scantable(MpegEncContext *s, ScanTable *st, const UINT8 *src_scantable); void ff_error_resilience(MpegEncContext *s); void ff_draw_horiz_band(MpegEncContext *s); +char ff_get_pict_type_char(int pict_type); + extern int ff_bit_exact; diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index e4f2340c74..1fcb60a3db 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -330,7 +330,7 @@ static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, doubl const int pict_type= rce->new_pict_type; const double last_p_q = rcc->last_qscale_for[P_TYPE]; const double last_non_b_q= rcc->last_qscale_for[rcc->last_non_b_pict_type]; - + if (pict_type==I_TYPE && (a->i_quant_factor>0.0 || rcc->last_non_b_pict_type==P_TYPE)) q= last_p_q *ABS(a->i_quant_factor) + a->i_quant_offset; else if(pict_type==B_TYPE && a->b_quant_factor>0.0) @@ -339,6 +339,7 @@ static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, doubl /* last qscale / qdiff stuff */ if(rcc->last_non_b_pict_type==pict_type || pict_type!=I_TYPE){ double last_q= rcc->last_qscale_for[pict_type]; + if (q > last_q + a->max_qdiff) q= last_q + a->max_qdiff; else if(q < last_q - a->max_qdiff) q= last_q - a->max_qdiff; } @@ -658,17 +659,16 @@ float ff_rate_estimate_qscale(MpegEncContext *s) assert(q>0.0); } -//printf("qmin:%d, qmax:%d, q:%f\n", qmin, qmax, q); - + + if(s->avctx->debug&FF_DEBUG_RC){ + printf("%c qp:%d<%2.1f<%d %d want:%d total:%d comp:%f st_q:%2.2f size:%d var:%d/%d br:%d fps:%d\n", + ff_get_pict_type_char(pict_type), qmin, q, qmax, picture_number, (int)wanted_bits/1000, (int)s->total_bits/1000, + br_compensation, short_term_q, s->frame_bits, pic->mb_var_sum, pic->mc_mb_var_sum, s->bit_rate/1000, (int)fps + ); + } if (q<qmin) q=qmin; else if(q>qmax) q=qmax; - -// printf("%f %d %d %d\n", q, picture_number, (int)wanted_bits, (int)s->total_bits); - -//printf("diff:%d comp:%f st_q:%f last_size:%d type:%d\n", (int)diff, br_compensation, -// short_term_q, s->frame_bits, pict_type); -//printf("%d %d\n", s->bit_rate, (int)fps); if(s->adaptive_quant) adaptive_quantization(s, q); |