You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/error_resilience: Merge surrounding status checks
Simplifies code and is also faster Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -376,7 +376,7 @@ static void v_block_filter(ERContext *s, uint8_t *dst, int w, int h,
|
|||||||
static void guess_mv(ERContext *s)
|
static void guess_mv(ERContext *s)
|
||||||
{
|
{
|
||||||
uint8_t *fixed = s->er_temp_buffer;
|
uint8_t *fixed = s->er_temp_buffer;
|
||||||
#define MV_FROZEN 3
|
#define MV_FROZEN 4
|
||||||
#define MV_CHANGED 2
|
#define MV_CHANGED 2
|
||||||
#define MV_UNCHANGED 1
|
#define MV_UNCHANGED 1
|
||||||
const int mb_stride = s->mb_stride;
|
const int mb_stride = s->mb_stride;
|
||||||
@@ -467,27 +467,19 @@ static void guess_mv(ERContext *s)
|
|||||||
av_assert1(s->last_pic.f && s->last_pic.f->data[0]);
|
av_assert1(s->last_pic.f && s->last_pic.f->data[0]);
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
if (mb_x > 0 && fixed[mb_xy - 1] == MV_FROZEN)
|
if (mb_x > 0)
|
||||||
j = 1;
|
j |= fixed[mb_xy - 1];
|
||||||
if (mb_x + 1 < mb_width && fixed[mb_xy + 1] == MV_FROZEN)
|
if (mb_x + 1 < mb_width)
|
||||||
j = 1;
|
j |= fixed[mb_xy + 1];
|
||||||
if (mb_y > 0 && fixed[mb_xy - mb_stride] == MV_FROZEN)
|
if (mb_y > 0)
|
||||||
j = 1;
|
j |= fixed[mb_xy - mb_stride];
|
||||||
if (mb_y + 1 < mb_height && fixed[mb_xy + mb_stride] == MV_FROZEN)
|
if (mb_y + 1 < mb_height)
|
||||||
j = 1;
|
j |= fixed[mb_xy + mb_stride];
|
||||||
if (j == 0)
|
|
||||||
|
if (!(j & MV_FROZEN))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
j = 0;
|
if (!(j & MV_CHANGED) && pass > 1)
|
||||||
if (mb_x > 0 && fixed[mb_xy - 1 ] == MV_CHANGED)
|
|
||||||
j = 1;
|
|
||||||
if (mb_x + 1 < mb_width && fixed[mb_xy + 1 ] == MV_CHANGED)
|
|
||||||
j = 1;
|
|
||||||
if (mb_y > 0 && fixed[mb_xy - mb_stride] == MV_CHANGED)
|
|
||||||
j = 1;
|
|
||||||
if (mb_y + 1 < mb_height && fixed[mb_xy + mb_stride] == MV_CHANGED)
|
|
||||||
j = 1;
|
|
||||||
if (j == 0 && pass > 1)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
none_left = 0;
|
none_left = 0;
|
||||||
|
Reference in New Issue
Block a user