summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/postproc.c
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-09-08 12:44:47 -0400
committerLeo Liu <[email protected]>2017-09-25 09:42:14 -0400
commit96f89f440b9ad5cc2765dfa12265ca756aee83ea (patch)
treec3bd74ee6525f12a17d8c8241b13b8bfed3d1e05 /src/gallium/state_trackers/va/postproc.c
parent4f9e7b127912b64e297134957dd1fc43a36f209f (diff)
st/va/postproc: add a full NV12 deint support from buffer I to P
Before it's impossible to transcode an interlaced video, becasue if in order for encoder to work, we have to force buffer to progessive, but the deint with buffer from I to P is missing. Now along With the new YUV deint full function, it works with weave and bob deint. Also this will benefit transcoding video with scaling parameters. Acked-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/postproc.c')
-rw-r--r--src/gallium/state_trackers/va/postproc.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/va/postproc.c b/src/gallium/state_trackers/va/postproc.c
index 6349691f4b0..44491263167 100644
--- a/src/gallium/state_trackers/va/postproc.c
+++ b/src/gallium/state_trackers/va/postproc.c
@@ -116,9 +116,11 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context,
{
struct pipe_surface **src_surfaces;
struct pipe_surface **dst_surfaces;
+ struct u_rect src_rect;
+ struct u_rect dst_rect;
unsigned i;
- if (src->interlaced != dst->interlaced)
+ if (src->interlaced != dst->interlaced && dst->interlaced)
return VA_STATUS_ERROR_INVALID_SURFACE;
src_surfaces = src->get_surfaces(src);
@@ -129,6 +131,24 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context,
if (!dst_surfaces || !dst_surfaces[0])
return VA_STATUS_ERROR_INVALID_SURFACE;
+ src_rect.x0 = src_region->x;
+ src_rect.y0 = src_region->y;
+ src_rect.x1 = src_region->x + src_region->width;
+ src_rect.y1 = src_region->y + src_region->height;
+
+ dst_rect.x0 = dst_region->x;
+ dst_rect.y0 = dst_region->y;
+ dst_rect.x1 = dst_region->x + dst_region->width;
+ dst_rect.y1 = dst_region->y + dst_region->height;
+
+ if (src->interlaced != dst->interlaced) {
+ vl_compositor_yuv_deint_full(&drv->cstate, &drv->compositor,
+ src, dst, &src_rect, &dst_rect,
+ deinterlace);
+
+ return VA_STATUS_SUCCESS;
+ }
+
for (i = 0; i < VL_MAX_SURFACES; ++i) {
struct pipe_surface *from = src_surfaces[i];
struct pipe_blit_info blit;