Commit 4ccde216 authored by Michael Niedermayer's avatar Michael Niedermayer

support decoding mpeg4 with buggy dc clipping

Originally committed as revision 3108 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent a7137a04
......@@ -17,7 +17,7 @@ extern "C" {
#define FFMPEG_VERSION_INT 0x000408
#define FFMPEG_VERSION "0.4.8"
#define LIBAVCODEC_BUILD 4712
#define LIBAVCODEC_BUILD 4713
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION
......@@ -849,6 +849,7 @@ typedef struct AVCodecContext {
#define FF_BUG_DIRECT_BLOCKSIZE 512
#define FF_BUG_EDGE 1024
#define FF_BUG_HPEL_CHROMA 2048
#define FF_BUG_DC_CLIP 4096
//#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100%
/**
......
......@@ -2440,7 +2440,12 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *di
}
}
level *=scale;
if(level&(~2047)) level= level<0 ? 0 : 2047;
if(level&(~2047)){
if(level<0)
level=0;
else if(!(s->workaround_bugs&FF_BUG_DC_CLIP))
level=2047;
}
dc_val[0]= level;
return ret;
......
......@@ -548,6 +548,9 @@ retry:
if(s->xvid_build && s->xvid_build<=12)
s->workaround_bugs|= FF_BUG_EDGE;
if(s->xvid_build && s->xvid_build<=32)
s->workaround_bugs|= FF_BUG_DC_CLIP;
#define SET_QPEL_FUNC(postfix1, postfix2) \
s->dsp.put_ ## postfix1 = ff_put_ ## postfix2;\
s->dsp.put_no_rnd_ ## postfix1 = ff_put_no_rnd_ ## postfix2;\
......@@ -562,6 +565,9 @@ retry:
if(s->lavc_build && s->lavc_build<4670){
s->workaround_bugs|= FF_BUG_EDGE;
}
if(s->lavc_build && s->lavc_build<=4712)
s->workaround_bugs|= FF_BUG_DC_CLIP;
if(s->divx_version)
s->workaround_bugs|= FF_BUG_DIRECT_BLOCKSIZE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment