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;
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)
{ "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" },
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;
}
/* 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;
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
}
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;
return;
}
- if(!s->error_resilience) return;
+ if(!s->error_recognition) return;
mask &= ~VP_START;
if(status & (AC_ERROR|AC_END)){
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){
}
#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
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;
}
}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;
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)
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;
}
}
#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;
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;
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;
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;
} 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;
}
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;
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;
&& 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
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);
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;
#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;
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;
}
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;
}
}
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 */
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;
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{
{"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"},
{"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"},