frontends/va: Fix deinterlace bottom field first flag
authorThong Thai <thong.thai@amd.com>
Thu, 21 May 2020 23:40:13 +0000 (19:40 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 22 May 2020 18:23:53 +0000 (18:23 +0000)
Fixes an issue with mpv, where deinterlacing causes the picture to be
offset by one line every other frame in the video.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5157>

src/gallium/frontends/va/postproc.c

index 1845883284468747cfe6132805e1df6d17b7c037..bd1228b391661f806a373be905278c72f07f11d0 100644 (file)
@@ -321,7 +321,7 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex
          VAProcFilterParameterBufferDeinterlacing *deint = buf->data;
          switch (deint->algorithm) {
          case VAProcDeinterlacingBob:
-            if (deint->flags & VA_DEINTERLACING_BOTTOM_FIELD)
+            if (deint->flags & VA_DEINTERLACING_BOTTOM_FIELD_FIRST)
                deinterlace = VL_COMPOSITOR_BOB_BOTTOM;
             else
                deinterlace = VL_COMPOSITOR_BOB_TOP;
@@ -333,7 +333,7 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex
 
          case VAProcDeinterlacingMotionAdaptive:
             src = vlVaApplyDeint(drv, context, param, src,
-                                !!(deint->flags & VA_DEINTERLACING_BOTTOM_FIELD));
+                                !!(deint->flags & VA_DEINTERLACING_BOTTOM_FIELD_FIRST));
             break;
 
          default: