]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Rename error_resilience to error_recognizion.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 8 Sep 2008 18:18:49 +0000 (18:18 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 8 Sep 2008 18:18:49 +0000 (18:18 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15270 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

15 files changed:
ffplay.c
libavcodec/ac3dec.c
libavcodec/avcodec.h
libavcodec/error_resilience.c
libavcodec/h261dec.c
libavcodec/h263.c
libavcodec/h263dec.c
libavcodec/h264.c
libavcodec/mpeg12.c
libavcodec/mpegaudio.h
libavcodec/mpegaudiodec.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo.h
libavcodec/msmpeg4.c
libavcodec/utils.c

index 7fe54924c6e8e655fa0f348bef625bffd2274155..5bb3e09af13c657aa5c3c04d823927966414c00e 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -207,7 +207,7 @@ static int idct = FF_IDCT_AUTO;
 static enum AVDiscard skip_frame= AVDISCARD_DEFAULT;
 static enum AVDiscard skip_idct= AVDISCARD_DEFAULT;
 static enum AVDiscard skip_loop_filter= AVDISCARD_DEFAULT;
-static int error_resilience = FF_ER_CAREFUL;
+static int error_recognition = FF_ER_CAREFUL;
 static int error_concealment = 3;
 static int decoder_reorder_pts= 0;
 
@@ -1734,7 +1734,7 @@ static int stream_component_open(VideoState *is, int stream_index)
     enc->skip_frame= skip_frame;
     enc->skip_idct= skip_idct;
     enc->skip_loop_filter= skip_loop_filter;
-    enc->error_resilience= error_resilience;
+    enc->error_recognition= error_recognition;
     enc->error_concealment= error_concealment;
     if (!codec ||
         avcodec_open(enc, codec) < 0)
@@ -2489,7 +2489,7 @@ static const OptionDef options[] = {
     { "skipframe", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_frame}, "", "" },
     { "skipidct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_idct}, "", "" },
     { "idct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&idct}, "set idct algo",  "algo" },
-    { "er", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_resilience}, "set error detection threshold (0-4)",  "threshold" },
+    { "er", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_recognition}, "set error detection threshold (0-4)",  "threshold" },
     { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_concealment}, "set error concealment options",  "bit_mask" },
     { "sync", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
     { "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
index 1a22126d8cd298c2aefb2966ea376254975865dc..5e568a9ae72f19e468ec7e891190470024d87615 100644 (file)
@@ -216,7 +216,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
     s->downmixed = 1;
 
     /* allocate context input buffer */
-    if (avctx->error_resilience >= FF_ER_CAREFUL) {
+    if (avctx->error_recognition >= FF_ER_CAREFUL) {
         s->input_buffer = av_mallocz(AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
         if (!s->input_buffer)
             return AVERROR_NOMEM;
@@ -1186,7 +1186,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
     }
 
     /* check for crc mismatch */
-    if(err != AC3_PARSE_ERROR_FRAME_SIZE && avctx->error_resilience >= FF_ER_CAREFUL) {
+    if(err != AC3_PARSE_ERROR_FRAME_SIZE && avctx->error_recognition >= FF_ER_CAREFUL) {
         if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) {
             av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
             err = AC3_PARSE_ERROR_CRC;
index 73d90f52e76e62a74055d0d3bf2bcda93d25bf85..c7e1b648bfd86805fcd5b39544e6fe757c428e30 100644 (file)
@@ -1136,12 +1136,12 @@ typedef struct AVCodecContext {
     float b_quant_offset;
 
     /**
-     * Error resilience; higher values will detect more errors but may
+     * Error recognization; higher values will detect more errors but may
      * misdetect some more or less valid parts as errors.
      * - encoding: unused
      * - decoding: Set by user.
      */
-    int error_resilience;
+    int error_recognition;
 #define FF_ER_CAREFUL         1
 #define FF_ER_COMPLIANT       2
 #define FF_ER_AGGRESSIVE      3
index 59254a4146fb34bd7dd7c87b2b367d627d01e3db..381ae27171746fab7486fdf9a4353f2fad43a639 100644 (file)
@@ -603,7 +603,7 @@ static int is_intra_more_likely(MpegEncContext *s){
 }
 
 void ff_er_frame_start(MpegEncContext *s){
-    if(!s->error_resilience) return;
+    if(!s->error_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;
@@ -627,7 +627,7 @@ void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int en
         return;
     }
 
-    if(!s->error_resilience) return;
+    if(!s->error_recognition) return;
 
     mask &= ~VP_START;
     if(status & (AC_ERROR|AC_END)){
@@ -680,7 +680,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_resilience || s->error_count==0 ||
+    if(!s->error_recognition || s->error_count==0 ||
        s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
 
     if(s->current_picture.motion_val[0] == NULL){
@@ -756,7 +756,7 @@ void ff_er_frame_end(MpegEncContext *s){
     }
 #endif
     /* handle missing slices */
-    if(s->error_resilience>=4){
+    if(s->error_recognition>=4){
         int end_ok=1;
 
         for(i=s->mb_num-2; i>=s->mb_width+100; i--){ //FIXME +100 hack
index 5369830c47c5cd29bd75d7b5aceb3562538a5202..3f21eb8263fc030c59e71ceb387ac5ac5fa09339 100644 (file)
@@ -135,7 +135,7 @@ static int h261_decode_gob_header(H261Context *h){
 
     if(s->qscale==0) {
         av_log(s->avctx, AV_LOG_ERROR, "qscale has forbidden 0 value\n");
-        if (s->avctx->error_resilience >= FF_ER_COMPLIANT)
+        if (s->avctx->error_recognition >= FF_ER_COMPLIANT)
             return -1;
     }
 
index 95ad1f3ed110525845e398d5a7a74610b9467f75..e4909957428bee4d95e2f5129d1cbaa37c2f29aa 100644 (file)
@@ -2569,7 +2569,7 @@ static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, int level, int *di
     }else{
         level += pred;
         ret= level;
-        if(s->error_resilience>=3){
+        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;
@@ -4588,7 +4588,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_resilience >= FF_ER_COMPLIANT)
+                if(s->error_recognition >= FF_ER_COMPLIANT)
                     return -1;
             }
             if (level == 255)
@@ -4708,7 +4708,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_resilience>=2){
+                if(s->error_recognition>=2){
                     av_log(s->avctx, AV_LOG_ERROR, "dc marker bit missing\n");
                     return -1;
                 }
@@ -4874,7 +4874,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
                     }
 
 #if 0
-                    if(s->error_resilience >= FF_ER_COMPLIANT){
+                    if(s->error_recognition >= FF_ER_COMPLIANT){
                         const int abs_level= FFABS(level);
                         if(abs_level<=MAX_LEVEL && run<=MAX_RUN){
                             const int run1= run - rl->max_run[last][abs_level] - 1;
@@ -4882,7 +4882,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
                                 av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, vlc encoding possible\n");
                                 return -1;
                             }
-                            if(s->error_resilience > FF_ER_COMPLIANT){
+                            if(s->error_recognition > FF_ER_COMPLIANT){
                                 if(abs_level <= rl->max_level[last][run]*2){
                                     av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n");
                                     return -1;
@@ -4899,7 +4899,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
                     else         level= level * qmul - qadd;
 
                     if((unsigned)(level + 2048) > 4095){
-                        if(s->error_resilience > FF_ER_COMPLIANT){
+                        if(s->error_recognition > FF_ER_COMPLIANT){
                             if(level > 2560 || level<-2560){
                                 av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc, qp=%d\n", s->qscale);
                                 return -1;
index de1f146c3cb1891a6dcb3827fa27934435bcd1ce..5603ec543a7587dd0d7cf3a94386c460744a6923 100644 (file)
@@ -295,7 +295,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_resilience>=3)
+        if((s->workaround_bugs&FF_BUG_NO_PADDING) && s->error_recognition>=3)
             max_extra+= 48;
         else if((s->workaround_bugs&FF_BUG_NO_PADDING))
             max_extra+= 256*256*256*64;
index 98866c77af1a20f63a3900b81ccafe5cdf70f85a..e888f76100535c6a3d17a01babf1d09ad2053790 100644 (file)
@@ -7255,7 +7255,7 @@ static void execute_decode_slices(H264Context *h, int context_count){
     } else {
         for(i = 1; i < context_count; i++) {
             hx = h->thread_context[i];
-            hx->s.error_resilience = avctx->error_resilience;
+            hx->s.error_recognition = avctx->error_recognition;
             hx->s.error_count = 0;
         }
 
index 966fa489013d2444917cad65ed83f4c3e3be6054..54779ac9d7d99c6e93728f0a29f24bb037cac784 100644 (file)
@@ -1344,7 +1344,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
     if (s->pict_type == FF_P_TYPE || s->pict_type == FF_B_TYPE) {
         s->full_pel[0] = get_bits1(&s->gb);
         f_code = get_bits(&s->gb, 3);
-        if (f_code == 0 && avctx->error_resilience >= FF_ER_COMPLIANT)
+        if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
             return -1;
         s->mpeg_f_code[0][0] = f_code;
         s->mpeg_f_code[0][1] = f_code;
@@ -1352,7 +1352,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
     if (s->pict_type == FF_B_TYPE) {
         s->full_pel[1] = get_bits1(&s->gb);
         f_code = get_bits(&s->gb, 3);
-        if (f_code == 0 && avctx->error_resilience >= FF_ER_COMPLIANT)
+        if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
             return -1;
         s->mpeg_f_code[1][0] = f_code;
         s->mpeg_f_code[1][1] = f_code;
@@ -1776,7 +1776,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
                             && s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/;
 
                 if(left < 0 || (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10)
-                   || (avctx->error_resilience >= FF_ER_AGGRESSIVE && left>8)){
+                   || (avctx->error_recognition >= FF_ER_AGGRESSIVE && left>8)){
                     av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n", left, show_bits(&s->gb, FFMIN(left, 23)));
                     return -1;
                 }else
@@ -1947,7 +1947,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
     s->aspect_ratio_info= get_bits(&s->gb, 4);
     if (s->aspect_ratio_info == 0) {
         av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n");
-        if (avctx->error_resilience >= FF_ER_COMPLIANT)
+        if (avctx->error_recognition >= FF_ER_COMPLIANT)
             return -1;
     }
     s->frame_rate_index = get_bits(&s->gb, 4);
index bf79d3b58c74352b0e85a0cbca7cf96c40457102..21de2da20d5a2669aae505ec7a2ec274c43a4366 100644 (file)
@@ -116,7 +116,7 @@ typedef struct MPADecodeContext {
     void (*compute_antialias)(struct MPADecodeContext *s, struct GranuleDef *g);
     int adu_mode; ///< 0 for standard mp3, 1 for adu formatted mp3
     int dither_state;
-    int error_resilience;
+    int error_recognition;
     AVCodecContext* avctx;
 } MPADecodeContext;
 
index 34538797fbc6adf9f36672bcd4bc9991ea56ab68..ce8021754633c1b887e45bfd658862145aa63891 100644 (file)
@@ -327,7 +327,7 @@ static int decode_init(AVCodecContext * avctx)
 #else
     avctx->sample_fmt= SAMPLE_FMT_S16;
 #endif
-    s->error_resilience= avctx->error_resilience;
+    s->error_recognition= avctx->error_recognition;
 
     if(avctx->antialias_algo != FF_AA_FLOAT)
         s->compute_antialias= compute_antialias_integer;
@@ -1565,7 +1565,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
                 s_index -= 4;
                 skip_bits_long(&s->gb, last_pos - pos);
                 av_log(s->avctx, AV_LOG_INFO, "overread, skip %d enddists: %d %d\n", last_pos - pos, end_pos-pos, end_pos2-pos);
-                if(s->error_resilience >= FF_ER_COMPLIANT)
+                if(s->error_recognition >= FF_ER_COMPLIANT)
                     s_index=0;
                 break;
             }
@@ -1602,7 +1602,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
     if (bits_left < 0/* || bits_left > 500*/) {
         av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
         s_index=0;
-    }else if(bits_left > 0 && s->error_resilience >= FF_ER_AGGRESSIVE){
+    }else if(bits_left > 0 && s->error_recognition >= FF_ER_AGGRESSIVE){
         av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
         s_index=0;
     }
index 845bc39b833f51063a0b8eef4e97641eda749f62..ce52a0cabc50c53fea945bc0562d1da1f9d571c8 100644 (file)
@@ -915,7 +915,7 @@ alloc:
     }
 
     s->hurry_up= s->avctx->hurry_up;
-    s->error_resilience= avctx->error_resilience;
+    s->error_recognition= avctx->error_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 */
index d2c46e31cb107bdb6bcf496763d80a71fae4a521..86247c2ce15644c672974ce23acb4bd16a4f1269 100644 (file)
@@ -479,7 +479,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_resilience;
+    int error_recognition;
 
     ParseContext parse_context;
 
index 16fdd8608cb8582277e80584e7bb37eb9b758250..5165d25c8828d67144b04467295c8c77e56e187f 100644 (file)
@@ -1822,7 +1822,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
             i-= 192;
             if(i&(~63)){
                 const int left= s->gb.size_in_bits - get_bits_count(&s->gb);
-                if(((i+192 == 64 && level/qmul==-1) || s->error_resilience<=1) && left>=0){
+                if(((i+192 == 64 && level/qmul==-1) || s->error_recognition<=1) && left>=0){
                     av_log(s->avctx, AV_LOG_ERROR, "ignoring overflow at %d %d\n", s->mb_x, s->mb_y);
                     break;
                 }else{
index 6b86e554a6e290d43cdb32ad4259673802d09b4c..cf00d2552cf6edcc84618f582a9bfca630dbd7ee 100644 (file)
@@ -499,7 +499,7 @@ static const AVOption options[]={
 {"inofficial", "allow inofficial extensions", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_INOFFICIAL, INT_MIN, INT_MAX, V|D|E, "strict"},
 {"experimental", "allow non standardized experimental things", 0, FF_OPT_TYPE_CONST, FF_COMPLIANCE_EXPERIMENTAL, INT_MIN, INT_MAX, V|D|E, "strict"},
 {"b_qoffset", "qp offset between P and B frames", OFFSET(b_quant_offset), FF_OPT_TYPE_FLOAT, 1.25, -FLT_MAX, FLT_MAX, V|E},
-{"er", "set error resilience strategy", OFFSET(error_resilience), FF_OPT_TYPE_INT, FF_ER_CAREFUL, INT_MIN, INT_MAX, A|V|D, "er"},
+{"er", "set error detection aggressivity", OFFSET(error_recognition), FF_OPT_TYPE_INT, FF_ER_CAREFUL, INT_MIN, INT_MAX, A|V|D, "er"},
 {"careful", NULL, 0, FF_OPT_TYPE_CONST, FF_ER_CAREFUL, INT_MIN, INT_MAX, V|D, "er"},
 {"compliant", NULL, 0, FF_OPT_TYPE_CONST, FF_ER_COMPLIANT, INT_MIN, INT_MAX, V|D, "er"},
 {"aggressive", NULL, 0, FF_OPT_TYPE_CONST, FF_ER_AGGRESSIVE, INT_MIN, INT_MAX, V|D, "er"},
@@ -575,7 +575,7 @@ static const AVOption options[]={
 {"skip", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_SKIP, INT_MIN, INT_MAX, V|D, "debug"},
 {"startcode", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_STARTCODE, INT_MIN, INT_MAX, V|D, "debug"},
 {"pts", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_PTS, INT_MIN, INT_MAX, V|D, "debug"},
-{"er", "error resilience", 0, FF_OPT_TYPE_CONST, FF_DEBUG_ER, INT_MIN, INT_MAX, V|D, "debug"},
+{"er", "error recognition", 0, FF_OPT_TYPE_CONST, FF_DEBUG_ER, INT_MIN, INT_MAX, V|D, "debug"},
 {"mmco", "memory management control operations (H.264)", 0, FF_OPT_TYPE_CONST, FF_DEBUG_MMCO, INT_MIN, INT_MAX, V|D, "debug"},
 {"bugs", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_BUGS, INT_MIN, INT_MAX, V|D, "debug"},
 {"vis_qp", "visualize quantization parameter (QP), lower QP are tinted greener", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_QP, INT_MIN, INT_MAX, V|D, "debug"},