X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fh263.c;h=3d4ba83863ffd68c525cd3588c4ebafed5b0ad69;hb=2407a7c10f0922d3e2f867665ae559627ccdc77f;hp=43ec7964cc04dd62772a9f5f5af303aeed36b151;hpb=898d5d5daa9ddce8242e464205ed41113ef87119;p=ffmpeg diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 43ec7964cc0..3d4ba83863f 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -138,6 +138,23 @@ int h263_get_picture_format(int width, int height) return format; } +static void show_pict_info(MpegEncContext *s){ + av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n", + s->qscale, av_get_pict_type_char(s->pict_type), + s->gb.size_in_bits, 1-s->no_rounding, + s->obmc ? " AP" : "", + s->umvplus ? " UMV" : "", + s->h263_long_vectors ? " LONG" : "", + s->h263_plus ? " +" : "", + s->h263_aic ? " AIC" : "", + s->alt_inter_vlc ? " AIV" : "", + s->modified_quant ? " MQ" : "", + s->loop_filter ? " LOOP" : "", + s->h263_slice_structured ? " SS" : "", + s->avctx->time_base.den, s->avctx->time_base.num + ); +} + #ifdef CONFIG_ENCODERS static void aspect_to_info(MpegEncContext * s, AVRational aspect){ @@ -893,7 +910,7 @@ void mpeg4_encode_mb(MpegEncContext * s, int i, cbp; if(s->pict_type==B_TYPE){ - static const int mb_type_table[8]= {-1, 2, 3, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */ + static const int mb_type_table[8]= {-1, 3, 2, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */ int mb_type= mb_type_table[s->mv_dir]; if(s->mb_x==0){ @@ -2347,6 +2364,8 @@ static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_n { int vo_ver_id; + if (!ENABLE_MPEG4_ENCODER) return; + if(s->max_b_frames || s->quarter_sample){ vo_ver_id= 5; s->vo_type= ADV_SIMPLE_VO_TYPE; @@ -2448,8 +2467,6 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) int time_incr; int time_div, time_mod; - if (!ENABLE_MPEG4_ENCODER) return; - if(s->pict_type==I_TYPE){ if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){ if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy @@ -5060,7 +5077,7 @@ int h263_decode_picture_header(MpegEncContext *s) format = get_bits(&s->gb, 3); dprintf(s->avctx, "ufep=1, format: %d\n", format); s->custom_pcf= get_bits1(&s->gb); - s->umvplus = get_bits(&s->gb, 1); /* Unrestricted Motion Vector */ + s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */ if (get_bits1(&s->gb) != 0) { av_log(s->avctx, AV_LOG_ERROR, "Syntax-based Arithmetic Coding (SAC) not supported\n"); } @@ -5212,20 +5229,7 @@ int h263_decode_picture_header(MpegEncContext *s) } if(s->avctx->debug&FF_DEBUG_PICT_INFO){ - av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n", - s->qscale, av_get_pict_type_char(s->pict_type), - s->gb.size_in_bits, 1-s->no_rounding, - s->obmc ? " AP" : "", - s->umvplus ? " UMV" : "", - s->h263_long_vectors ? " LONG" : "", - s->h263_plus ? " +" : "", - s->h263_aic ? " AIC" : "", - s->alt_inter_vlc ? " AIV" : "", - s->modified_quant ? " MQ" : "", - s->loop_filter ? " LOOP" : "", - s->h263_slice_structured ? " SS" : "", - s->avctx->time_base.den, s->avctx->time_base.num - ); + show_pict_info(s); } #if 1 if (s->pict_type == I_TYPE && s->codec_tag == ff_get_fourcc("ZYGO")){ @@ -6120,11 +6124,7 @@ int intel_h263_decode_picture_header(MpegEncContext *s) av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n"); return -1; /* SAC: off */ } - if (get_bits1(&s->gb) != 0) { - s->obmc= 1; - av_log(s->avctx, AV_LOG_ERROR, "Advanced Prediction Mode not supported\n"); -// return -1; /* advanced prediction mode: off */ - } + s->obmc= get_bits1(&s->gb); if (get_bits1(&s->gb) != 0) { av_log(s->avctx, AV_LOG_ERROR, "PB frame mode no supported\n"); return -1; /* PB frame mode */ @@ -6145,6 +6145,9 @@ int intel_h263_decode_picture_header(MpegEncContext *s) s->y_dc_scale_table= s->c_dc_scale_table= ff_mpeg1_dc_scale_table; + if(s->avctx->debug&FF_DEBUG_PICT_INFO) + show_pict_info(s); + return 0; }