mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/error_resilience: factor er_supported() check out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
976fc5911c
commit
afb18c5578
@ -768,6 +768,17 @@ void ff_er_frame_start(ERContext *s)
|
|||||||
s->error_occurred = 0;
|
s->error_occurred = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int er_supported(ERContext *s)
|
||||||
|
{
|
||||||
|
if(s->avctx->hwaccel ||
|
||||||
|
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
|
||||||
|
!s->cur_pic ||
|
||||||
|
s->cur_pic->field_picture
|
||||||
|
)
|
||||||
|
return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a slice.
|
* Add a slice.
|
||||||
* @param endx x component of the last macroblock, can be -1
|
* @param endx x component of the last macroblock, can be -1
|
||||||
@ -859,9 +870,7 @@ void ff_er_frame_end(ERContext *s)
|
|||||||
* though it should not crash if enabled. */
|
* though it should not crash if enabled. */
|
||||||
if (!s->avctx->error_concealment || s->error_count == 0 ||
|
if (!s->avctx->error_concealment || s->error_count == 0 ||
|
||||||
s->avctx->lowres ||
|
s->avctx->lowres ||
|
||||||
s->avctx->hwaccel ||
|
!er_supported(s) ||
|
||||||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
|
|
||||||
!s->cur_pic || s->cur_pic->field_picture ||
|
|
||||||
s->error_count == 3 * s->mb_width *
|
s->error_count == 3 * s->mb_width *
|
||||||
(s->avctx->skip_top + s->avctx->skip_bottom)) {
|
(s->avctx->skip_top + s->avctx->skip_bottom)) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user