summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-08-28 23:07:33 -0400
committerLeo Liu <[email protected]>2017-09-07 13:32:36 -0400
commit15d4d44d9b2467484b95f71d76224b7de2da5e40 (patch)
tree464ea75e06e0504b09b9a21c45433e20739be8bc /src
parentcadeb73f6bb5f33877f3bbd6536594f22e20d580 (diff)
st/va: move YUV content to deinterlaced buffer when reallocated for encoder
v2: use deinterlace common function v3: make sure deinterlace only Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/va/picture.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
index ee099fad6ee..19df52cb83e 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -660,13 +660,22 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
}
if (realloc) {
- surf->buffer->destroy(surf->buffer);
+ struct pipe_video_buffer *old_buf = surf->buffer;
if (vlVaHandleSurfaceAllocate(ctx, surf, &surf->templat) != VA_STATUS_SUCCESS) {
mtx_unlock(&drv->mutex);
return VA_STATUS_ERROR_ALLOCATION_FAILED;
}
+ if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
+ if (old_buf->interlaced)
+ vl_compositor_yuv_deint(&drv->cstate, &drv->compositor, old_buf, surf->buffer);
+ else
+ /* Can't convert from progressive to interlaced yet */
+ return VA_STATUS_ERROR_INVALID_SURFACE;
+ }
+
+ old_buf->destroy(old_buf);
context->target = surf->buffer;
}