summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va
diff options
context:
space:
mode:
authorMark Thompson <[email protected]>2017-07-15 19:51:56 +0100
committerEmil Velikov <[email protected]>2017-07-17 15:24:56 +0100
commit63dcfed81f011dae5ca68af3369433be28135415 (patch)
tree29c1144b5bc99808c6dc85256dced14d80053038 /src/gallium/state_trackers/va
parent4168c162c5bcbbfc6c712466b9c3d7d0dbac06e5 (diff)
st/va: Fix scaling list ordering for H.265
Mesa here requires the scaling lists in diagonal scan order, but VAAPI passes them in raster scan order. Therefore, rearrange the elements when copying. v2: Move scan tables to vl_zscan.c. Fix type in size assertion. Cc: [email protected] Signed-off-by: Mark Thompson <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r--src/gallium/state_trackers/va/picture_hevc.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/va/picture_hevc.c b/src/gallium/state_trackers/va/picture_hevc.c
index 28743ee7aa6..e879259ae1f 100644
--- a/src/gallium/state_trackers/va/picture_hevc.c
+++ b/src/gallium/state_trackers/va/picture_hevc.c
@@ -25,6 +25,7 @@
*
**************************************************************************/
+#include "vl/vl_zscan.h"
#include "va_private.h"
void vlVaHandlePictureParameterBufferHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)
@@ -179,14 +180,32 @@ void vlVaHandlePictureParameterBufferHEVC(vlVaDriver *drv, vlVaContext *context,
void vlVaHandleIQMatrixBufferHEVC(vlVaContext *context, vlVaBuffer *buf)
{
VAIQMatrixBufferHEVC *h265 = buf->data;
+ int i, j;
- assert(buf->size >= sizeof(VAIQMatrixBufferH264) && buf->num_elements == 1);
- memcpy(&context->desc.h265.pps->sps->ScalingList4x4, h265->ScalingList4x4, 6 * 16);
- memcpy(&context->desc.h265.pps->sps->ScalingList8x8, h265->ScalingList8x8, 6 * 64);
- memcpy(&context->desc.h265.pps->sps->ScalingList16x16, h265->ScalingList16x16, 6 * 64);
- memcpy(&context->desc.h265.pps->sps->ScalingList32x32, h265->ScalingList32x32, 2 * 64);
- memcpy(&context->desc.h265.pps->sps->ScalingListDCCoeff16x16, h265->ScalingListDC16x16, 6);
- memcpy(&context->desc.h265.pps->sps->ScalingListDCCoeff32x32, h265->ScalingListDC32x32, 2);
+ assert(buf->size >= sizeof(VAIQMatrixBufferHEVC) && buf->num_elements == 1);
+
+ for (i = 0; i < 6; i++) {
+ for (j = 0; j < 16; j++)
+ context->desc.h265.pps->sps->ScalingList4x4[i][j] =
+ h265->ScalingList4x4[i][vl_zscan_h265_up_right_diagonal_16[j]];
+
+ for (j = 0; j < 64; j++) {
+ context->desc.h265.pps->sps->ScalingList8x8[i][j] =
+ h265->ScalingList8x8[i][vl_zscan_h265_up_right_diagonal[j]];
+ context->desc.h265.pps->sps->ScalingList16x16[i][j] =
+ h265->ScalingList16x16[i][vl_zscan_h265_up_right_diagonal[j]];
+
+ if (i < 2)
+ context->desc.h265.pps->sps->ScalingList32x32[i][j] =
+ h265->ScalingList32x32[i][vl_zscan_h265_up_right_diagonal[j]];
+ }
+
+ context->desc.h265.pps->sps->ScalingListDCCoeff16x16[i] =
+ h265->ScalingListDC16x16[i];
+ if (i < 2)
+ context->desc.h265.pps->sps->ScalingListDCCoeff32x32[i] =
+ h265->ScalingListDC32x32[i];
+ }
}
void vlVaHandleSliceParameterBufferHEVC(vlVaContext *context, vlVaBuffer *buf)