summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-22 20:38:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-22 20:38:42 +0200
commitd5227ceff13e52eddf1fd02e0042ebc9aa628791 (patch)
treeca15b06625ef047c64caab1069ee39643df4fa8a
parentd9b264bc73723ce538d72f28a4a8fb4f85af7eca (diff)
parent9c1db92ad372d4cd69e0490e691c56e4097cb193 (diff)
Merge commit '9c1db92ad372d4cd69e0490e691c56e4097cb193'
* commit '9c1db92ad372d4cd69e0490e691c56e4097cb193': mpegvideo: Drop err_recognition Conflicts: libavcodec/h263dec.c libavcodec/ituh263dec.c libavcodec/mpeg4video.h libavcodec/mpeg4videodec.c libavcodec/msmpeg4dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h263dec.c4
-rw-r--r--libavcodec/ituh263dec.c2
-rw-r--r--libavcodec/mpeg4video.h2
-rw-r--r--libavcodec/mpeg4videodec.c8
-rw-r--r--libavcodec/mpegvideo.c2
-rw-r--r--libavcodec/mpegvideo.h1
-rw-r--r--libavcodec/msmpeg4dec.c4
7 files changed, 11 insertions, 12 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 7faf12009b..1c68ec12e7 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -287,7 +287,7 @@ static int decode_slice(MpegEncContext *s)
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);
- if (s->err_recognition & AV_EF_IGNORE_ERR)
+ if (s->avctx->err_recognition & AV_EF_IGNORE_ERR)
continue;
return AVERROR_INVALIDDATA;
}
@@ -376,7 +376,7 @@ static int decode_slice(MpegEncContext *s)
/* buggy padding but the frame should still end approximately at
* the bitstream end */
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;
else if ((s->workaround_bugs & FF_BUG_NO_PADDING))
max_extra += 256 * 256 * 256 * 64;
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 8398dd9ab6..c41e600809 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -460,7 +460,7 @@ static int h263_decode_block(MpegEncContext * s, int16_t * block,
level = get_bits(&s->gb, 8);
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);
- if(s->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT))
+ if (s->avctx->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT))
return -1;
}
if (level == 255)
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index 43650bb007..b945f09a3e 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -230,7 +230,7 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level,
} else {
level += pred;
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) {
av_log(s->avctx, AV_LOG_ERROR,
"dc<0 at %dx%d\n", s->mb_x, s->mb_y);
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index cbcc7509ef..cbae9a04ff 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -571,7 +571,7 @@ static inline int mpeg4_decode_dc(MpegEncContext *s, int n, int *dir_ptr)
if (code > 8) {
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");
return -1;
}
@@ -1086,7 +1086,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
if (SHOW_UBITS(re, &s->gb, 1) == 0) {
av_log(s->avctx, AV_LOG_ERROR,
"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;
}
SKIP_CACHE(re, &s->gb, 1);
@@ -1097,7 +1097,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
if (SHOW_UBITS(re, &s->gb, 1) == 0) {
av_log(s->avctx, AV_LOG_ERROR,
"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;
}
@@ -1132,7 +1132,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
level = level * qmul - qadd;
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) {
av_log(s->avctx, AV_LOG_ERROR,
"|level| overflow in 3. esc, qp=%d\n",
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 61c9fae57c..bca50894a1 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -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
* it might change for mpeg4 and we can't do it in the header
* decode as init is not called for mpeg4 there yet */
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index f667bb0e85..fd56eb4712 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -489,7 +489,6 @@ typedef struct MpegEncContext {
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 next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed b frames
- int err_recognition;
ParseContext parse_context;
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 942a181f57..c492fdbe48 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -843,7 +843,9 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
i-= 192;
if(i&(~63)){
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);
i = 63;
break;