diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-25 20:16:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-25 21:04:32 +0100 |
commit | cafc72bd7bc4fb7672717e0e599405dbc59f3b5d (patch) | |
tree | af9accaacd2601f3e707fe5549faccb2eefacad9 /libavcodec/error_resilience.c | |
parent | c6c888e996126b7189d27f16ba2aed38f8cff680 (diff) | |
download | ffmpeg-cafc72bd7bc4fb7672717e0e599405dbc59f3b5d.tar.gz |
avcodec/error_resilience: Factor block parity check out
This makes the code noticably faster when there are lots of blocks
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/error_resilience.c')
-rw-r--r-- | libavcodec/error_resilience.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index 2790599744..79ac75a58a 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -450,7 +450,7 @@ static void guess_mv(ERContext *s) changed = 0; for (mb_y = 0; mb_y < mb_height; mb_y++) { - for (mb_x = 0; mb_x < s->mb_width; mb_x++) { + for (mb_x = (mb_y ^ pass) & 1; mb_x < s->mb_width; mb_x+=2) { const int mb_xy = mb_x + mb_y * s->mb_stride; int mv_predictor[8][2] = { { 0 } }; int ref[8] = { 0 }; @@ -461,9 +461,6 @@ static void guess_mv(ERContext *s) const int mot_index = (mb_x + mb_y * mot_stride) * mot_step; int prev_x = 0, prev_y = 0, prev_ref = 0; - if ((mb_x ^ mb_y ^ pass) & 1) - continue; - if (fixed[mb_xy] == MV_FROZEN) continue; av_assert1(!IS_INTRA(s->cur_pic.mb_type[mb_xy])); |