Commit c0f154bb authored by Jerome Borsboom's avatar Jerome Borsboom Committed by Paul B Mahol

avcodec/vc1_pred: set ref_field_type earlier

scaleforsame_y references ref_field_type. Therefore, it needs to be set
before scaleforsame is called.

Fixes #2557.
Signed-off-by: 's avatarJerome Borsboom <jerome.borsboom@carpalis.nl>
parent 8592ae1a
...@@ -341,6 +341,8 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, ...@@ -341,6 +341,8 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
} else } else
opposite = 0; opposite = 0;
if (opposite) { if (opposite) {
v->mv_f[dir][xy + v->blocks_off] = 1;
v->ref_field_type[dir] = !v->cur_field_type;
if (a_valid && !a_f) { if (a_valid && !a_f) {
field_predA[0] = scaleforopp(v, field_predA[0], 0, dir); field_predA[0] = scaleforopp(v, field_predA[0], 0, dir);
field_predA[1] = scaleforopp(v, field_predA[1], 1, dir); field_predA[1] = scaleforopp(v, field_predA[1], 1, dir);
...@@ -353,9 +355,9 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, ...@@ -353,9 +355,9 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
field_predC[0] = scaleforopp(v, field_predC[0], 0, dir); field_predC[0] = scaleforopp(v, field_predC[0], 0, dir);
field_predC[1] = scaleforopp(v, field_predC[1], 1, dir); field_predC[1] = scaleforopp(v, field_predC[1], 1, dir);
} }
v->mv_f[dir][xy + v->blocks_off] = 1;
v->ref_field_type[dir] = !v->cur_field_type;
} else { } else {
v->mv_f[dir][xy + v->blocks_off] = 0;
v->ref_field_type[dir] = v->cur_field_type;
if (a_valid && a_f) { if (a_valid && a_f) {
field_predA[0] = scaleforsame(v, n, field_predA[0], 0, dir); field_predA[0] = scaleforsame(v, n, field_predA[0], 0, dir);
field_predA[1] = scaleforsame(v, n, field_predA[1], 1, dir); field_predA[1] = scaleforsame(v, n, field_predA[1], 1, dir);
...@@ -368,8 +370,6 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, ...@@ -368,8 +370,6 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
field_predC[0] = scaleforsame(v, n, field_predC[0], 0, dir); field_predC[0] = scaleforsame(v, n, field_predC[0], 0, dir);
field_predC[1] = scaleforsame(v, n, field_predC[1], 1, dir); field_predC[1] = scaleforsame(v, n, field_predC[1], 1, dir);
} }
v->mv_f[dir][xy + v->blocks_off] = 0;
v->ref_field_type[dir] = v->cur_field_type;
} }
if (a_valid) { if (a_valid) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment