summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorMark Thompson <[email protected]>2017-03-01 20:07:09 +0000
committerChristian König <[email protected]>2017-03-06 14:05:05 +0100
commit0798fddb5000f2b1edffc693ec65236a680ce61f (patch)
treed9ea0082c51b8662cecbcdf65e953043972b86b7 /src/gallium/state_trackers
parentc93a157078591847a226265edf1c701d81635fc1 (diff)
st/va: Fix forward/backward referencing for deinterlacing
The VAAPI documentation is not very clear here, but the intent appears to be that a forward reference is forward from a frame in the past, not forward to a frame in the future (that is, forward as in forward prediction, not as in a forward reference in source code). This interpretation is derived from other implementations, in particular the i965 driver and the gstreamer client. In order to match those other implementations, this patch swaps the meaning of forward and backward references as they currently appear for motion-adaptive deinterlacing. Signed-off-by: Mark Thompson <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/va/postproc.c10
-rw-r--r--src/gallium/state_trackers/va/surface.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/va/postproc.c b/src/gallium/state_trackers/va/postproc.c
index 01e240f0167..fbec69aec35 100644
--- a/src/gallium/state_trackers/va/postproc.c
+++ b/src/gallium/state_trackers/va/postproc.c
@@ -184,13 +184,13 @@ vlVaApplyDeint(vlVaDriver *drv, vlVaContext *context,
{
vlVaSurface *prevprev, *prev, *next;
- if (param->num_forward_references < 1 ||
- param->num_backward_references < 2)
+ if (param->num_forward_references < 2 ||
+ param->num_backward_references < 1)
return current;
- prevprev = handle_table_get(drv->htab, param->backward_references[1]);
- prev = handle_table_get(drv->htab, param->backward_references[0]);
- next = handle_table_get(drv->htab, param->forward_references[0]);
+ prevprev = handle_table_get(drv->htab, param->forward_references[1]);
+ prev = handle_table_get(drv->htab, param->forward_references[0]);
+ next = handle_table_get(drv->htab, param->backward_references[0]);
if (!prevprev || !prev || !next)
return current;
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 0e1dbe0b109..b129e6c74f4 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -845,8 +845,8 @@ vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
case VAProcFilterDeinterlacing: {
VAProcFilterParameterBufferDeinterlacing *deint = buf->data;
if (deint->algorithm == VAProcDeinterlacingMotionAdaptive) {
- pipeline_cap->num_forward_references = 1;
- pipeline_cap->num_backward_references = 2;
+ pipeline_cap->num_forward_references = 2;
+ pipeline_cap->num_backward_references = 1;
}
break;
}