Commit 39de31cc authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpeg4video: Reorder operations to reduce accesses to err_recognition

About 9 cpu cycle faster mpeg4_decode_mb()
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b71528d8
......@@ -230,21 +230,21 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level,
} else {
level += pred;
ret = level;
if (s->avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) {
}
level *= scale;
if (level & (~2047)) {
if (!s->encoding && (s->avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE))) {
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 > 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))
......
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