MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_er_frame_end

Function ff_er_frame_end

libavcodec/error_resilience.c:910–1368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908}
909
910void ff_er_frame_end(ERContext *s, int *decode_error_flags)
911{
912 int *linesize = NULL;
913 int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error;
914 int distance;
915 int threshold_part[4] = { 100, 100, 100 };
916 int threshold = 50;
917 int is_intra_likely;
918 int size = s->b8_stride * 2 * s->mb_height;
919 int guessed_mb_type;
920
921 /* We do not support ER of field pictures yet,
922 * though it should not crash if enabled. */
923 if (!s->avctx->error_concealment || !atomic_load(&s->error_count) ||
924 s->avctx->lowres ||
925 !er_supported(s) ||
926 atomic_load(&s->error_count) == 3 * s->mb_width *
927 (s->avctx->skip_top + s->avctx->skip_bottom)) {
928 return;
929 }
930 linesize = s->cur_pic.f->linesize;
931
932 if ( s->avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO
933 && (FFALIGN(s->avctx->height, 16)&16)
934 && atomic_load(&s->error_count) == 3 * s->mb_width * (s->avctx->skip_top + s->avctx->skip_bottom + 1)) {
935 for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
936 int status = s->error_status_table[mb_x + (s->mb_height - 1) * s->mb_stride];
937 if (status != 0x7F)
938 break;
939 }
940
941 if (mb_x == s->mb_width) {
942 av_log(s->avctx, AV_LOG_DEBUG, "ignoring last missing slice\n");
943 return;
944 }
945 }
946
947 if (s->last_pic.f) {
948 if (s->last_pic.f->width != s->cur_pic.f->width ||
949 s->last_pic.f->height != s->cur_pic.f->height ||
950 s->last_pic.f->format != s->cur_pic.f->format) {
951 av_log(s->avctx, AV_LOG_WARNING, "Cannot use previous picture in error concealment\n");
952 memset(&s->last_pic, 0, sizeof(s->last_pic));
953 }
954 }
955 if (s->next_pic.f) {
956 if (s->next_pic.f->width != s->cur_pic.f->width ||
957 s->next_pic.f->height != s->cur_pic.f->height ||
958 s->next_pic.f->format != s->cur_pic.f->format) {
959 av_log(s->avctx, AV_LOG_WARNING, "Cannot use next picture in error concealment\n");
960 memset(&s->next_pic, 0, sizeof(s->next_pic));
961 }
962 }
963
964 if (!s->cur_pic.motion_val[0] || !s->cur_pic.ref_index[0]) {
965 av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
966
967 for (i = 0; i < 2; i++) {

Callers 9

decode_wmv9Function · 0.85
rv10_decode_packetFunction · 0.85
rv10_decode_frameFunction · 0.85
ff_h263_decode_frameFunction · 0.85
finish_frameFunction · 0.85
ff_rv34_decode_frameFunction · 0.85
slice_endFunction · 0.85
vc1_decode_frameFunction · 0.85
decode_nal_unitsFunction · 0.85

Calls 13

er_supportedFunction · 0.85
av_logFunction · 0.85
av_callocFunction · 0.85
av_get_picture_type_charFunction · 0.85
is_intra_more_likelyFunction · 0.85
ff_thread_progress_awaitFunction · 0.85
guess_mvFunction · 0.85
guess_dcFunction · 0.85
filter181Function · 0.85
put_dcFunction · 0.85
h_block_filterFunction · 0.85
v_block_filterFunction · 0.85

Tested by

no test coverage detected