Commit ce258fa4 authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Janne Grunau

Normatively allow invalid global motion parameters

parent bb1a9352
Pipeline #2801 passed with stages
in 5 minutes and 57 seconds
......@@ -3071,6 +3071,9 @@ int dav1d_submit_frame(Dav1dContext *const c) {
} else {
f->svc[i][0].scale = 0;
}
f->gmv_warp_allowed[i] = f->frame_hdr.gmv[i].type > WM_TYPE_TRANSLATION &&
!f->frame_hdr.force_integer_mv &&
!dav1d_get_shear_params(&f->frame_hdr.gmv[i]);
}
}
......
......@@ -132,6 +132,7 @@ struct Dav1dFrameContext {
const uint8_t *prev_segmap;
unsigned refpoc[7], refrefpoc[7][7];
int ref_coded_width[7];
uint8_t gmv_warp_allowed[7];
CdfThreadContext in_cdf, out_cdf;
struct {
Dav1dData data;
......
......@@ -41,7 +41,6 @@
#include "src/levels.h"
#include "src/obu.h"
#include "src/ref.h"
#include "src/warpmv.h"
static int parse_seq_hdr(Dav1dContext *const c, GetBits *const gb,
Av1SequenceHeader *const hdr)
......@@ -994,9 +993,6 @@ static int parse_frame_hdr(Dav1dContext *const c, GetBits *const gb) {
mat[0] = dav1d_get_bits_subexp(gb, ref_mat[0] >> shift, bits) * (1 << shift);
mat[1] = dav1d_get_bits_subexp(gb, ref_mat[1] >> shift, bits) * (1 << shift);
if (dav1d_get_shear_params(&hdr->gmv[i]))
goto error;
}
}
#if DEBUG_FRAME_HDR
......
......@@ -1169,11 +1169,9 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize
const Dav1dThreadPicture *const refp = &f->refp[b->ref[0]];
const enum Filter2d filter_2d = b->filter2d;
if (imin(bw4, bh4) > 1 && !f->frame_hdr.force_integer_mv &&
((b->inter_mode == GLOBALMV &&
f->frame_hdr.gmv[b->ref[0]].type > WM_TYPE_TRANSLATION) ||
(b->motion_mode == MM_WARP &&
t->warpmv.type > WM_TYPE_TRANSLATION)))
if (imin(bw4, bh4) > 1 &&
((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
(b->motion_mode == MM_WARP && t->warpmv.type > WM_TYPE_TRANSLATION)))
{
res = warp_affine(t, dst, NULL, f->cur.stride[0], b_dim, 0, refp,
b->motion_mode == MM_WARP ? &t->warpmv :
......@@ -1285,11 +1283,9 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize
if (res) return res;
}
} else {
if (imin(cbw4, cbh4) > 1 && !f->frame_hdr.force_integer_mv &&
((b->inter_mode == GLOBALMV &&
f->frame_hdr.gmv[b->ref[0]].type > WM_TYPE_TRANSLATION) ||
(b->motion_mode == MM_WARP &&
t->warpmv.type > WM_TYPE_TRANSLATION)))
if (imin(cbw4, cbh4) > 1 &&
((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
(b->motion_mode == MM_WARP && t->warpmv.type > WM_TYPE_TRANSLATION)))
{
for (int pl = 0; pl < 2; pl++) {
res = warp_affine(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff, NULL,
......@@ -1368,9 +1364,7 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize
for (int i = 0; i < 2; i++) {
const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
if (b->inter_mode == GLOBALMV_GLOBALMV && !f->frame_hdr.force_integer_mv &&
f->frame_hdr.gmv[b->ref[i]].type > WM_TYPE_TRANSLATION)
{
if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
res = warp_affine(t, NULL, tmp[i], bw4 * 4, b_dim, 0, refp,
&f->frame_hdr.gmv[b->ref[i]]);
if (res) return res;
......@@ -1413,8 +1407,7 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize
for (int i = 0; i < 2; i++) {
const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
if (b->inter_mode == GLOBALMV_GLOBALMV &&
imin(cbw4, cbh4) > 1 && !f->frame_hdr.force_integer_mv &&
f->frame_hdr.gmv[b->ref[i]].type > WM_TYPE_TRANSLATION)
imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
{
res = warp_affine(t, NULL, tmp[i], bw4 * 2, b_dim, 1 + pl,
refp, &f->frame_hdr.gmv[b->ref[i]]);
......
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