diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 19:03:04 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 19:03:10 +0100 |
commit | b37b0a58e38438c2673aa0b02e6ae640ad3d3e9a (patch) | |
tree | 73dc6d314faf8879e814520b56cf3b4cb4b12b11 | |
parent | 44e4a86c8afca4ac1f7498ff4419364b839a15f9 (diff) | |
parent | 5bc69f38c1af71fbcbfb4b5efa77d0aeb5424c04 (diff) | |
download | ffmpeg-b37b0a58e38438c2673aa0b02e6ae640ad3d3e9a.tar.gz |
Merge commit '5bc69f38c1af71fbcbfb4b5efa77d0aeb5424c04'
* commit '5bc69f38c1af71fbcbfb4b5efa77d0aeb5424c04':
error_resilience: do not require mbintra/skip tables
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/error_resilience.c | 7 | ||||
-rw-r--r-- | libavcodec/h264.c | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 4fa7bc4e21..716fd60a2a 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -1024,7 +1024,7 @@ void ff_er_frame_end(ERContext *s) const int mb_xy = s->mb_index2xy[i]; int error = s->error_status_table[mb_xy]; - if (!s->mbskip_table[mb_xy]) // FIXME partition specific + if (s->mbskip_table && !s->mbskip_table[mb_xy]) // FIXME partition specific distance++; if (error & (1 << error_type)) distance = 0; @@ -1297,11 +1297,12 @@ ec_clean: const int mb_xy = s->mb_index2xy[i]; int error = s->error_status_table[mb_xy]; - if (s->cur_pic.f->pict_type != AV_PICTURE_TYPE_B && + if (s->mbskip_table && s->cur_pic.f->pict_type != AV_PICTURE_TYPE_B && (error & (ER_DC_ERROR | ER_MV_ERROR | ER_AC_ERROR))) { s->mbskip_table[mb_xy] = 0; } - s->mbintra_table[mb_xy] = 1; + if (s->mbintra_table) + s->mbintra_table[mb_xy] = 1; } for (i = 0; i < 2; i++) { diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 7ba7d0601b..f2d0a1069d 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -405,8 +405,6 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp) av_freep(&hx->er.mb_index2xy); av_freep(&hx->er.error_status_table); av_freep(&hx->er.er_temp_buffer); - av_freep(&hx->er.mbintra_table); - av_freep(&hx->er.mbskip_table); if (free_rbsp) { av_freep(&hx->rbsp_buffer); @@ -546,11 +544,6 @@ int ff_h264_context_init(H264Context *h) FF_ALLOCZ_OR_GOTO(h->avctx, er->error_status_table, mb_array_size * sizeof(uint8_t), fail); - FF_ALLOC_OR_GOTO(h->avctx, er->mbintra_table, mb_array_size, fail); - memset(er->mbintra_table, 1, mb_array_size); - - FF_ALLOCZ_OR_GOTO(h->avctx, er->mbskip_table, mb_array_size + 2, fail); - FF_ALLOC_OR_GOTO(h->avctx, er->er_temp_buffer, h->mb_height * h->mb_stride, fail); |