Mercurial > libavcodec.hg
changeset 7831:8195c970d077 libavcodec
Rename error_resilience to error_recognition.
author | michael |
---|---|
date | Mon, 08 Sep 2008 18:18:49 +0000 |
parents | 3da762190370 |
children | 573f52f011c0 |
files | ac3dec.c avcodec.h error_resilience.c h261dec.c h263.c h263dec.c h264.c mpeg12.c mpegaudio.h mpegaudiodec.c mpegvideo.c mpegvideo.h msmpeg4.c utils.c |
diffstat | 14 files changed, 30 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/ac3dec.c Mon Sep 08 18:18:29 2008 +0000 +++ b/ac3dec.c Mon Sep 08 18:18:49 2008 +0000 @@ -216,7 +216,7 @@ 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 @@ } /* 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;
--- a/avcodec.h Mon Sep 08 18:18:29 2008 +0000 +++ b/avcodec.h Mon Sep 08 18:18:49 2008 +0000 @@ -1136,12 +1136,12 @@ 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
--- a/error_resilience.c Mon Sep 08 18:18:29 2008 +0000 +++ b/error_resilience.c Mon Sep 08 18:18:49 2008 +0000 @@ -603,7 +603,7 @@ } 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 @@ return; } - if(!s->error_resilience) return; + if(!s->error_recognition) return; mask &= ~VP_START; if(status & (AC_ERROR|AC_END)){ @@ -680,7 +680,7 @@ 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 @@ } #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
--- a/h261dec.c Mon Sep 08 18:18:29 2008 +0000 +++ b/h261dec.c Mon Sep 08 18:18:49 2008 +0000 @@ -135,7 +135,7 @@ 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; }
--- a/h263.c Mon Sep 08 18:18:29 2008 +0000 +++ b/h263.c Mon Sep 08 18:18:49 2008 +0000 @@ -2569,7 +2569,7 @@ }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 @@ 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 @@ 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 @@ } #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 @@ 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 @@ 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;
--- a/h263dec.c Mon Sep 08 18:18:29 2008 +0000 +++ b/h263dec.c Mon Sep 08 18:18:49 2008 +0000 @@ -295,7 +295,7 @@ 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;
--- a/h264.c Mon Sep 08 18:18:29 2008 +0000 +++ b/h264.c Mon Sep 08 18:18:49 2008 +0000 @@ -7255,7 +7255,7 @@ } 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; }
--- a/mpeg12.c Mon Sep 08 18:18:29 2008 +0000 +++ b/mpeg12.c Mon Sep 08 18:18:49 2008 +0000 @@ -1344,7 +1344,7 @@ 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 @@ 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 @@ && 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 @@ 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);
--- a/mpegaudio.h Mon Sep 08 18:18:29 2008 +0000 +++ b/mpegaudio.h Mon Sep 08 18:18:49 2008 +0000 @@ -116,7 +116,7 @@ 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;
--- a/mpegaudiodec.c Mon Sep 08 18:18:29 2008 +0000 +++ b/mpegaudiodec.c Mon Sep 08 18:18:49 2008 +0000 @@ -327,7 +327,7 @@ #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 @@ 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 @@ 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; }
--- a/mpegvideo.c Mon Sep 08 18:18:29 2008 +0000 +++ b/mpegvideo.c Mon Sep 08 18:18:49 2008 +0000 @@ -915,7 +915,7 @@ } 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 */
--- a/mpegvideo.h Mon Sep 08 18:18:29 2008 +0000 +++ b/mpegvideo.h Mon Sep 08 18:18:49 2008 +0000 @@ -479,7 +479,7 @@ 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;
--- a/msmpeg4.c Mon Sep 08 18:18:29 2008 +0000 +++ b/msmpeg4.c Mon Sep 08 18:18:49 2008 +0000 @@ -1822,7 +1822,7 @@ 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{
--- a/utils.c Mon Sep 08 18:18:29 2008 +0000 +++ b/utils.c Mon Sep 08 18:18:49 2008 +0000 @@ -499,7 +499,7 @@ {"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 @@ {"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"},