Browse Source

support decoding mpeg4 with buggy dc clipping

Originally committed as revision 3108 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 22 years ago
parent
commit
4ccde216cd
3 changed files with 14 additions and 2 deletions
  1. +2
    -1
      libavcodec/avcodec.h
  2. +6
    -1
      libavcodec/h263.c
  3. +6
    -0
      libavcodec/h263dec.c

+ 2
- 1
libavcodec/avcodec.h View File

@@ -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%
/**


+ 6
- 1
libavcodec/h263.c View File

@@ -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;


+ 6
- 0
libavcodec/h263dec.c View File

@@ -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;


Loading…
Cancel
Save