summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/surface.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2015-12-13 11:44:13 +0100
committerChristian König <[email protected]>2016-01-18 10:59:32 +0100
commiteaf7ec9cfc5165f461bddc365aaaf6cb25c2d9bd (patch)
treeb7d02f9aa3ab35579186db776409826676ce6141 /src/gallium/state_trackers/va/surface.c
parentad20be1f30ef5d11bcacef38a921cb778c504dd2 (diff)
st/va: add motion adaptive deinterlacing v2
v2: minor cleanup Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/surface.c')
-rw-r--r--src/gallium/state_trackers/va/surface.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index f23a88901f5..84a94949c47 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -691,13 +691,14 @@ vlVaQueryVideoProcFilterCaps(VADriverContextP ctx, VAContextID context,
case VAProcFilterDeinterlacing: {
VAProcFilterCapDeinterlacing *deint = filter_caps;
- if (*num_filter_caps < 2) {
- *num_filter_caps = 2;
+ if (*num_filter_caps < 3) {
+ *num_filter_caps = 3;
return VA_STATUS_ERROR_MAX_NUM_EXCEEDED;
}
deint[i++].type = VAProcDeinterlacingBob;
deint[i++].type = VAProcDeinterlacingWeave;
+ deint[i++].type = VAProcDeinterlacingMotionAdaptive;
break;
}
@@ -750,9 +751,24 @@ vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
for (i = 0; i < num_filters; i++) {
vlVaBuffer *buf = handle_table_get(VL_VA_DRIVER(ctx)->htab, filters[i]);
+ VAProcFilterParameterBufferBase *filter;
- if (!buf || buf->type >= VABufferTypeMax)
+ if (!buf || buf->type != VAProcFilterParameterBufferType)
return VA_STATUS_ERROR_INVALID_BUFFER;
+
+ filter = buf->data;
+ switch (filter->type) {
+ case VAProcFilterDeinterlacing: {
+ VAProcFilterParameterBufferDeinterlacing *deint = buf->data;
+ if (deint->algorithm == VAProcDeinterlacingMotionAdaptive) {
+ pipeline_cap->num_forward_references = 1;
+ pipeline_cap->num_backward_references = 2;
+ }
+ break;
+ }
+ default:
+ return VA_STATUS_ERROR_UNIMPLEMENTED;
+ }
}
return VA_STATUS_SUCCESS;