diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2010-04-09 18:12:59 +0400 |
commit | efbc9d9043ff8ff92716ddd00a5f61412d535593 (patch) | |
tree | 8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpeg4video.h | |
parent | df6b139a6d9027156f614b68687e039e3a5854db (diff) |
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpeg4video.h')
-rw-r--r-- | src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpeg4video.h | 69 |
1 files changed, 27 insertions, 42 deletions
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpeg4video.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpeg4video.h index 5d22919cc..bf8762657 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpeg4video.h +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/mpeg4video.h @@ -81,8 +81,8 @@ extern const uint16_t ff_mpeg4_resync_prefix[8]; extern const uint8_t mpeg4_dc_threshold[8]; void mpeg4_encode_mb(MpegEncContext *s, - DCTELEM block[6][64], - int motion_x, int motion_y); + DCTELEM block[6][64], + int motion_x, int motion_y); void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, int dir); void ff_set_mpeg4_time(MpegEncContext * s); @@ -129,18 +129,15 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *di int16_t *dc_val; /* find prediction */ - if(n < 4) - { + if (n < 4) { scale = s->y_dc_scale; - } - else - { + } else { scale = s->c_dc_scale; } if(IS_3IV1) - scale = 8; + scale= 8; - wrap = s->block_wrap[n]; + wrap= s->block_wrap[n]; dc_val = s->dc_val[0] + s->block_index[n]; /* B C @@ -151,61 +148,49 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *di c = dc_val[ - wrap]; /* outside slice handling (we can't do that by memset as we need the dc for error resilience) */ - if(s->first_slice_line && n != 3) - { - if(n != 2) b = c = 1024; - if(n != 1 && s->mb_x == s->resync_mb_x) b = a = 1024; + if(s->first_slice_line && n!=3){ + if(n!=2) b=c= 1024; + if(n!=1 && s->mb_x == s->resync_mb_x) b=a= 1024; } - if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1) - { - if(n == 0 || n == 4 || n == 5) - b = 1024; + if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1){ + if(n==0 || n==4 || n==5) + b=1024; } - if(abs(a - b) < abs(b - c)) - { + if (abs(a - b) < abs(b - c)) { pred = c; *dir_ptr = 1; /* top */ - } - else - { + } else { pred = a; *dir_ptr = 0; /* left */ } /* we assume pred is positive */ pred = FASTDIV((pred + (scale >> 1)), scale); - if(encoding) - { + if(encoding){ ret = level - pred; - } - else - { + }else{ level += pred; - ret = level; - if(s->error_recognition >= 3) - { - if(level < 0) - { + ret= level; + if(s->error_recognition>=3){ + if(level<0){ av_log(s->avctx, AV_LOG_ERROR, "dc<0 at %dx%d\n", s->mb_x, s->mb_y); return -1; } - if(level * scale > 2048 + scale) - { + if(level*scale > 2048 + scale){ av_log(s->avctx, AV_LOG_ERROR, "dc overflow at %dx%d\n", s->mb_x, s->mb_y); return -1; } } } - level *= scale; - if(level&(~2047)) - { - if(level < 0) - level = 0; - else if(!(s->workaround_bugs & FF_BUG_DC_CLIP)) - level = 2047; + level *=scale; + if(level&(~2047)){ + if(level<0) + level=0; + else if(!(s->workaround_bugs&FF_BUG_DC_CLIP)) + level=2047; } - dc_val[0] = level; + dc_val[0]= level; return ret; } |