summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_mvs.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2014-08-10 15:02:36 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-10 17:13:18 +0200
commit84bc45880ae14277cb804569401ddd34274f4764 (patch)
treee405fdf4a5c8c63447dafcfdd3f92deff8ebe94a /libavcodec/hevc_mvs.c
parent43654a22c037a86c23e7aed90660c5ea3971e56d (diff)
hevc_mvs: set candidate availabilities
They might be left uninitialized otherwise since 3ad04608. Fixes ticket #3840. Found-by: Carl Eugen Hoyos <ce@hoyos.ws> Reported-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc_mvs.c')
-rw-r--r--libavcodec/hevc_mvs.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libavcodec/hevc_mvs.c b/libavcodec/hevc_mvs.c
index 1d4c002a1c..3d8276fa8c 100644
--- a/libavcodec/hevc_mvs.c
+++ b/libavcodec/hevc_mvs.c
@@ -677,6 +677,17 @@ b_candidates:
xB0 < s->sps->width &&
PRED_BLOCK_AVAILABLE(B0);
+ // above spatial merge candidate
+ xB1 = x0 + nPbW - 1;
+ yB1 = y0 - 1;
+ is_available_b1 = AVAILABLE(cand_up, B1);
+
+ // above left spatial merge candidate
+ xB2 = x0 - 1;
+ yB2 = y0 - 1;
+ is_available_b2 = AVAILABLE(cand_up_left, B2);
+
+ // above right spatial merge candidate
if (is_available_b0) {
if (MP_MX(B0, pred_flag_index_l0, mxB)) {
goto scalef;
@@ -687,11 +698,6 @@ b_candidates:
}
// above spatial merge candidate
- xB1 = x0 + nPbW - 1;
- yB1 = y0 - 1;
-
- is_available_b1 = AVAILABLE(cand_up, B1);
-
if (is_available_b1) {
if (MP_MX(B1, pred_flag_index_l0, mxB)) {
goto scalef;
@@ -702,10 +708,6 @@ b_candidates:
}
// above left spatial merge candidate
- xB2 = x0 - 1;
- yB2 = y0 - 1;
- is_available_b2 = AVAILABLE(cand_up_left, B2);
-
if (is_available_b2) {
if (MP_MX(B2, pred_flag_index_l0, mxB)) {
goto scalef;