Commit d5227cef authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '9c1db92a'

* commit '9c1db92a':
  mpegvideo: Drop err_recognition

Conflicts:
	libavcodec/h263dec.c
	libavcodec/ituh263dec.c
	libavcodec/mpeg4video.h
	libavcodec/mpeg4videodec.c
	libavcodec/msmpeg4dec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents d9b264bc 9c1db92a
...@@ -287,7 +287,7 @@ static int decode_slice(MpegEncContext *s) ...@@ -287,7 +287,7 @@ static int decode_slice(MpegEncContext *s)
ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
s->mb_x, s->mb_y, ER_MB_ERROR & part_mask); s->mb_x, s->mb_y, ER_MB_ERROR & part_mask);
if (s->err_recognition & AV_EF_IGNORE_ERR) if (s->avctx->err_recognition & AV_EF_IGNORE_ERR)
continue; continue;
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
...@@ -376,7 +376,7 @@ static int decode_slice(MpegEncContext *s) ...@@ -376,7 +376,7 @@ static int decode_slice(MpegEncContext *s)
/* buggy padding but the frame should still end approximately at /* buggy padding but the frame should still end approximately at
* the bitstream end */ * the bitstream end */
if ((s->workaround_bugs & FF_BUG_NO_PADDING) && if ((s->workaround_bugs & FF_BUG_NO_PADDING) &&
(s->err_recognition & (AV_EF_BUFFER|AV_EF_AGGRESSIVE))) (s->avctx->err_recognition & (AV_EF_BUFFER|AV_EF_AGGRESSIVE)))
max_extra += 48; max_extra += 48;
else if ((s->workaround_bugs & FF_BUG_NO_PADDING)) else if ((s->workaround_bugs & FF_BUG_NO_PADDING))
max_extra += 256 * 256 * 256 * 64; max_extra += 256 * 256 * 256 * 64;
......
...@@ -460,7 +460,7 @@ static int h263_decode_block(MpegEncContext * s, int16_t * block, ...@@ -460,7 +460,7 @@ static int h263_decode_block(MpegEncContext * s, int16_t * block,
level = get_bits(&s->gb, 8); level = get_bits(&s->gb, 8);
if((level&0x7F) == 0){ if((level&0x7F) == 0){
av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y); av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y);
if(s->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT)) if (s->avctx->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT))
return -1; return -1;
} }
if (level == 255) if (level == 255)
......
...@@ -230,7 +230,7 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level, ...@@ -230,7 +230,7 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level,
} else { } else {
level += pred; level += pred;
ret = level; ret = level;
if (s->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) { if (s->avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) {
if (level < 0) { if (level < 0) {
av_log(s->avctx, AV_LOG_ERROR, av_log(s->avctx, AV_LOG_ERROR,
"dc<0 at %dx%d\n", s->mb_x, s->mb_y); "dc<0 at %dx%d\n", s->mb_x, s->mb_y);
......
...@@ -571,7 +571,7 @@ static inline int mpeg4_decode_dc(MpegEncContext *s, int n, int *dir_ptr) ...@@ -571,7 +571,7 @@ static inline int mpeg4_decode_dc(MpegEncContext *s, int n, int *dir_ptr)
if (code > 8) { if (code > 8) {
if (get_bits1(&s->gb) == 0) { /* marker */ if (get_bits1(&s->gb) == 0) { /* marker */
if (s->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT)) { if (s->avctx->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT)) {
av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n"); av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n");
return -1; return -1;
} }
...@@ -1086,7 +1086,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block, ...@@ -1086,7 +1086,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
if (SHOW_UBITS(re, &s->gb, 1) == 0) { if (SHOW_UBITS(re, &s->gb, 1) == 0) {
av_log(s->avctx, AV_LOG_ERROR, av_log(s->avctx, AV_LOG_ERROR,
"1. marker bit missing in 3. esc\n"); "1. marker bit missing in 3. esc\n");
if (!(s->err_recognition & AV_EF_IGNORE_ERR)) if (!(s->avctx->err_recognition & AV_EF_IGNORE_ERR))
return -1; return -1;
} }
SKIP_CACHE(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1);
...@@ -1097,7 +1097,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block, ...@@ -1097,7 +1097,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
if (SHOW_UBITS(re, &s->gb, 1) == 0) { if (SHOW_UBITS(re, &s->gb, 1) == 0) {
av_log(s->avctx, AV_LOG_ERROR, av_log(s->avctx, AV_LOG_ERROR,
"2. marker bit missing in 3. esc\n"); "2. marker bit missing in 3. esc\n");
if (!(s->err_recognition & AV_EF_IGNORE_ERR)) if (!(s->avctx->err_recognition & AV_EF_IGNORE_ERR))
return -1; return -1;
} }
...@@ -1132,7 +1132,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block, ...@@ -1132,7 +1132,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
level = level * qmul - qadd; level = level * qmul - qadd;
if ((unsigned)(level + 2048) > 4095) { if ((unsigned)(level + 2048) > 4095) {
if (s->err_recognition & (AV_EF_BITSTREAM|AV_EF_AGGRESSIVE)) { if (s->avctx->err_recognition & (AV_EF_BITSTREAM|AV_EF_AGGRESSIVE)) {
if (level > 2560 || level < -2560) { if (level > 2560 || level < -2560) {
av_log(s->avctx, AV_LOG_ERROR, av_log(s->avctx, AV_LOG_ERROR,
"|level| overflow in 3. esc, qp=%d\n", "|level| overflow in 3. esc, qp=%d\n",
......
...@@ -1966,8 +1966,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) ...@@ -1966,8 +1966,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
} }
} }
s->err_recognition = avctx->err_recognition;
/* set dequantizer, we can't do it during init as /* set dequantizer, we can't do it during init as
* it might change for mpeg4 and we can't do it in the header * it might change for mpeg4 and we can't do it in the header
* decode as init is not called for mpeg4 there yet */ * decode as init is not called for mpeg4 there yet */
......
...@@ -489,7 +489,6 @@ typedef struct MpegEncContext { ...@@ -489,7 +489,6 @@ typedef struct MpegEncContext {
GetBitContext last_resync_gb; ///< used to search for the next resync marker GetBitContext last_resync_gb; ///< used to search for the next resync marker
int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only) int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed b frames int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed b frames
int err_recognition;
ParseContext parse_context; ParseContext parse_context;
......
...@@ -843,7 +843,9 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, ...@@ -843,7 +843,9 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
i-= 192; i-= 192;
if(i&(~63)){ if(i&(~63)){
const int left= get_bits_left(&s->gb); const int left= get_bits_left(&s->gb);
if(((i+192 == 64 && level/qmul==-1) || !(s->err_recognition&(AV_EF_BITSTREAM|AV_EF_COMPLIANT))) && left>=0){ if (((i + 192 == 64 && level / qmul == -1) ||
!(s->avctx->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT))) &&
left >= 0) {
av_log(s->avctx, AV_LOG_ERROR, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y); av_log(s->avctx, AV_LOG_ERROR, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y);
i = 63; i = 63;
break; break;
......
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