[FFmpeg-cvslog] lavc: convert error_recognition to err_recognition.

Dustin Brody git at videolan.org
Tue Dec 13 00:59:44 CET 2011


ffmpeg | branch: master | Dustin Brody <libav at parsoma.net> | Wed Dec  7 08:51:36 2011 -0500| [5b22d6e1323989b078ad097c5b50dddbbf0fe251] | committer: Anton Khirnov

lavc: convert error_recognition to err_recognition.

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b22d6e1323989b078ad097c5b50dddbbf0fe251
---

 libavcodec/error_resilience.c |    8 ++++----
 libavcodec/h263dec.c          |    2 +-
 libavcodec/h264.c             |    2 +-
 libavcodec/ituh263dec.c       |    2 +-
 libavcodec/mpeg4video.h       |    2 +-
 libavcodec/mpeg4videodec.c    |    4 ++--
 libavcodec/mpegvideo.c        |    2 +-
 libavcodec/mpegvideo.h        |    2 +-
 libavcodec/msmpeg4.c          |    2 +-
 9 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index a2e911b..354e6b0 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -703,7 +703,7 @@ static int is_intra_more_likely(MpegEncContext *s){
 }
 
 void ff_er_frame_start(MpegEncContext *s){
-    if(!s->error_recognition) return;
+    if(!s->err_recognition) return;
 
     memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_stride*s->mb_height*sizeof(uint8_t));
     s->error_count= 3*s->mb_num;
@@ -731,7 +731,7 @@ void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int en
         return;
     }
 
-    if(!s->error_recognition) return;
+    if(!s->err_recognition) return;
 
     mask &= ~VP_START;
     if(status & (AC_ERROR|AC_END)){
@@ -787,7 +787,7 @@ void ff_er_frame_end(MpegEncContext *s){
     int size = s->b8_stride * 2 * s->mb_height;
     Picture *pic= s->current_picture_ptr;
 
-    if(!s->error_recognition || s->error_count==0 || s->avctx->lowres ||
+    if(!s->err_recognition || s->error_count==0 || s->avctx->lowres ||
        s->avctx->hwaccel ||
        s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
        s->picture_structure != PICT_FRAME || // we do not support ER of field pictures yet, though it should not crash if enabled
@@ -859,7 +859,7 @@ void ff_er_frame_end(MpegEncContext *s){
     }
 
     /* handle missing slices */
-    if(s->error_recognition>=4){
+    if(s->err_recognition&AV_EF_EXPLODE){
         int end_ok=1;
 
         for(i=s->mb_num-2; i>=s->mb_width+100; i--){ //FIXME +100 hack
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 48f8240..71ff2fe 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -310,7 +310,7 @@ static int decode_slice(MpegEncContext *s){
             max_extra+= 17;
 
         /* buggy padding but the frame should still end approximately at the bitstream end */
-        if((s->workaround_bugs&FF_BUG_NO_PADDING) && s->error_recognition>=3)
+        if((s->workaround_bugs&FF_BUG_NO_PADDING) && (s->err_recognition&AV_EF_BUFFER))
             max_extra+= 48;
         else if((s->workaround_bugs&FF_BUG_NO_PADDING))
             max_extra+= 256*256*256*64;
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 7a1af56..4bcec7c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3704,7 +3704,7 @@ static int execute_decode_slices(H264Context *h, int context_count){
     } else {
         for(i = 1; i < context_count; i++) {
             hx = h->thread_context[i];
-            hx->s.error_recognition = avctx->error_recognition;
+            hx->s.err_recognition = avctx->err_recognition;
             hx->s.error_count = 0;
         }
 
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index a234c2a..dceb62b 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -484,7 +484,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * 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->error_recognition >= FF_ER_COMPLIANT)
+                if(s->err_recognition & AV_EF_BITSTREAM)
                     return -1;
             }
             if (level == 255)
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index d34e731..9f6f431 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -174,7 +174,7 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *di
     }else{
         level += pred;
         ret= level;
-        if(s->error_recognition>=3){
+        if(s->err_recognition&AV_EF_BITSTREAM){
             if(level<0){
                 av_log(s->avctx, AV_LOG_ERROR, "dc<0 at %dx%d\n", s->mb_x, s->mb_y);
                 return -1;
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 2807d50..8bc30fd 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -520,7 +520,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->error_recognition>=2){
+                if(s->err_recognition&AV_EF_BITSTREAM){
                     av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n");
                     return -1;
                 }
@@ -994,7 +994,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
                     else         level= level * qmul - qadd;
 
                     if((unsigned)(level + 2048) > 4095){
-                        if(s->error_recognition > FF_ER_COMPLIANT){
+                        if(s->err_recognition & AV_EF_BITSTREAM){
                             if(level > 2560 || level<-2560){
                                 av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc, qp=%d\n", s->qscale);
                                 return -1;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f2651c8..27e9f10 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1305,7 +1305,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
         }
     }
 
-    s->error_recognition= avctx->error_recognition;
+    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 01df491..599e354 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -487,7 +487,7 @@ 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 error_recognition;
+    int err_recognition;
 
     ParseContext parse_context;
 
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 84e6249..ee2ae3d 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -1810,7 +1810,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
             i-= 192;
             if(i&(~63)){
                 const int left= get_bits_left(&s->gb);
-                if(((i+192 == 64 && level/qmul==-1) || s->error_recognition<=1) && left>=0){
+                if(((i+192 == 64 && level/qmul==-1) || !(s->err_recognition&AV_EF_BITSTREAM)) && left>=0){
                     av_log(s->avctx, AV_LOG_ERROR, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y);
                     break;
                 }else{



More information about the ffmpeg-cvslog mailing list