提交 8fc6c2b5 编写于 作者: M Michael Niedermayer

detect old xvid with fourcc=DIVX

remove "this file was encoded with ..." stuff (use debug=4096 if u want to know that)

Originally committed as revision 2253 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 2187d948
......@@ -979,6 +979,7 @@ typedef struct AVCodecContext {
#define FF_DEBUG_PTS 0x00000200
#define FF_DEBUG_ER 0x00000400
#define FF_DEBUG_MMCO 0x00000800
#define FF_DEBUG_BUGS 0x00001000
/**
* error.
......
......@@ -4781,13 +4781,6 @@ static int decode_user_data(MpegEncContext *s, GetBitContext *gb){
s->divx_version= ver;
s->divx_build= build;
s->divx_packed= e==3 && last=='p';
if(s->picture_number==0){
printf("This file was encoded with DivX%d Build%d", ver, build);
if(s->divx_packed)
printf("p\n");
else
printf("\n");
}
}
/* ffmpeg detection */
......@@ -4803,16 +4796,12 @@ static int decode_user_data(MpegEncContext *s, GetBitContext *gb){
if(e==4){
s->ffmpeg_version= ver*256*256 + ver2*256 + ver3;
s->lavc_build= build;
if(s->picture_number==0)
printf("This file was encoded with libavcodec build %d\n", build);
}
/* xvid detection */
e=sscanf(buf, "XviD%d", &build);
if(e==1){
s->xvid_build= build;
if(s->picture_number==0)
printf("This file was encoded with XviD build %d\n", build);
}
//printf("User Data: %s\n", buf);
......@@ -4982,12 +4971,12 @@ 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,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%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 rnd:%d vot:%d%s\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_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first,
s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points,
s->sprite_warping_accuracy, 1-s->no_rounding);
s->sprite_warping_accuracy, 1-s->no_rounding, s->vo_type, s->vol_control_parameters ? " VOLC" : " ");
}
if(!s->scalability){
......
......@@ -484,6 +484,10 @@ retry:
if(s->xvid_build==0 && s->divx_version==0 && s->lavc_build==0){
if(s->avctx->codec_tag == ff_get_fourcc("XVID") || s->avctx->codec_tag == ff_get_fourcc("XVIX"))
s->xvid_build= -1;
if(s->avctx->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==1
&& s->padding_bug_score > 0 && s->low_delay) // XVID with modified fourcc
s->xvid_build= -1;
if(s->avctx->codec_tag == ff_get_fourcc("DIVX") && s->vo_type==0 && s->vol_control_parameters==0)
s->divx_version= 400; //divx 4
......@@ -577,6 +581,11 @@ retry:
SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_old_c)
}
if(avctx->debug & FF_DEBUG_BUGS)
printf("bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n",
s->workaround_bugs, s->lavc_build, s->xvid_build, s->divx_version, s->divx_build,
s->divx_packed ? "p" : "");
#if 0 // dump bits per frame / qp / complexity
{
static FILE *f=NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册