Discussion:
[PATCH intel-driver v2 1/7] test: split jpeg test data into header and cpp
(too old to reply)
U. Artie Eoff
2016-09-26 20:11:42 UTC
Permalink
Move static definitions of JPEG TestPatternData into the .cpp
so that multiple files can include the i965_jpeg_test_data.h
header file. Otherwise, there will be "multiple definition"
compiler errors.

Also, change generateSolid to be inline for the same reason.

Signed-off-by: U. Artie Eoff <***@intel.com>
---
test/Makefile.am | 1 +
test/i965_jpeg_test_data.cpp | 762 +++++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 736 +----------------------------------------
3 files changed, 765 insertions(+), 734 deletions(-)
create mode 100644 test/i965_jpeg_test_data.cpp

diff --git a/test/Makefile.am b/test/Makefile.am
index 72dfed5a7aae..0d53e0f6150a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -53,6 +53,7 @@ noinst_HEADERS = \
test_i965_drv_video_SOURCES = \
i965_chipset_test.cpp \
i965_initialize_test.cpp \
+ i965_jpeg_test_data.cpp \
i965_test_fixture.cpp \
i965_jpeg_decode_test.cpp \
object_heap_test.cpp \
diff --git a/test/i965_jpeg_test_data.cpp b/test/i965_jpeg_test_data.cpp
new file mode 100644
index 000000000000..02d092c7d165
--- /dev/null
+++ b/test/i965_jpeg_test_data.cpp
@@ -0,0 +1,762 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+
+namespace JPEG {
+ /**
+ * Test Pattern 1
+ *
+ * Solid Black 10x10
+ *
+ */
+ template<> const bool TestPatternData<1>::m_valid =
+ TestPatternData<1>::initialize<10, 10>(
+
+ generateSolid({0x00, 0x80, 0x80}, {10, 10}),
+
+ {{VA_FOURCC_IMC3, {
+ 0xff,0x00,0x3f,0xfa,0x28,0xa2,0x80,0x3f,0xff,
+ }},
+ {VA_FOURCC_422H, {
+ 0xff,0x00,0x3f,0xfa,0x28,0x00,0xa2,0x80,0x3f,0xff,
+ }},
+ {VA_FOURCC_422V, {
+ 0xff,0x00,0x3f,0xfa,0x28,0x00,0xa2,0x80,0x3f,0xff,
+ }},
+ {VA_FOURCC_411P, {
+ 0xff,0x00,0x3f,0xfa,0x28,0xa2,0x80,0x0a,0x28,0xa2,0x80,0x3f,
+ 0xff,
+ }},
+ {VA_FOURCC_444P, {
+ 0xff,0x00,0x3f,0xfa,0x00,0x28,0x00,0xa0,0x02,0x80,0x3f,0xff,
+ }}}
+ );
+
+
+ /**
+ * Test Pattern 2
+ *
+ * R = red
+ * G = green
+ * B = blue
+ * W = white
+ * K = black
+ * -------------------
+ * R R G G B B W W K K
+ * R R G G B B W W K K
+ * K K R R G G B B W W
+ * K K R R G G B B W W
+ * W W K K R R G G B B
+ * W W K K R R G G B B
+ * B B W W K K R R G G
+ * B B W W K K R R G G
+ * G G B B W W K K R R
+ * G G B B W W K K R R
+ * -------------------
+ *
+ */
+
+ template<> const bool TestPatternData<2>::m_valid =
+ TestPatternData<2>::initialize<10, 10>({
+ // Pixel Y Component
+ 0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,
+ 0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,
+ 0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,
+ 0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,
+ 0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,
+ 0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,
+ 0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,
+ 0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,
+
+ // Pixel U Component
+ 0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,
+ 0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,
+ 0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,
+ 0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,
+ 0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,
+ 0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,
+ 0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,
+ 0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,
+ 0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,
+ 0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,
+
+ // Pixel V Component
+ 0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,
+ 0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,
+ 0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,
+ 0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,
+ 0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,
+ 0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,
+ 0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,
+ 0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,
+ 0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,
+ 0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,
+ },{
+ {VA_FOURCC_IMC3, {
+ 0xf8,0x8b,0xc3,0x7e,0x24,0xf1,0xf7,0xec,0x71,0xe3,0xef,0xd9,
+ 0x8f,0xc6,0x5e,0x0d,0xfd,0xa7,0x7f,0xe1,0x27,0xf0,0x3f,0x89,
+ 0xff,0x00,0xe1,0x74,0xff,0x00,0xc3,0xae,0x3f,0xe0,0xa8,0xff,
+ 0x00,0xf0,0xa5,0xb4,0x5d,0x17,0xfe,0x13,0x5f,0xec,0x5d,0x16,
+ 0x7d,0x2b,0xf6,0xda,0xff,0x00,0x8c,0x25,0xd5,0x60,0xf1,0x46,
+ 0xaf,0xe1,0xbf,0xf8,0x46,0xf5,0x7f,0x14,0x5d,0x7e,0xcf,0x1f,
+ 0xf1,0x90,0xf6,0xb6,0xff,0x00,0xdb,0x1f,0x67,0xff,0x00,0x85,
+ 0xb5,0xf0,0x93,0xcd,0xb5,0x96,0x39,0x2d,0xfd,0x07,0xfe,0x19,
+ 0xbb,0xf6,0x07,0xff,0x00,0xa5,0x63,0x7f,0xf3,0xb4,0x5f,0x19,
+ 0xff,0x00,0xf9,0x7b,0x47,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xf3,0xee,0xbf,0xc5,
+ 0x13,0xff,0x00,0x4f,0x83,0xff,
+ }},
+ });
+
+ /**
+ * Test Pattern 3
+ *
+ * R = red
+ * G = green
+ * B = blue
+ * W = white
+ * C = cyan
+ * M = magenta
+ * Y = yellow
+ * K = black
+ * -------------------
+ * K R B Y G C M K K W
+ * R K R B Y G C M W K
+ * B R K R B Y G C M K
+ * Y B R K R B Y G C M
+ * G Y B R K R B Y G C
+ * C G Y B R K R B Y G
+ * M C G Y B R K R B Y
+ * K M C G Y B R K R K
+ * K W M C G Y B R K R
+ * W K K M C G Y B R K
+ * -------------------
+ *
+ */
+ template<> const bool TestPatternData<3>::m_valid =
+ TestPatternData<3>::initialize<10, 10>({
+ 0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x69,0x00,0x00,0xfe,
+ 0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x69,0xff,0x00,
+ 0x1d,0x4c,0x00,0x4c,0x1d,0xe3,0x96,0xb3,0x69,0x00,
+ 0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x68,
+ 0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,
+ 0xb3,0x96,0xe3,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,
+ 0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,
+ 0x00,0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,
+ 0x00,0xff,0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,
+ 0xff,0x00,0x00,0x68,0xb3,0x96,0xe2,0x1d,0x4c,0x00,
+
+ 0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,0x80,0x80,0x80,
+ 0x55,0x80,0x54,0xff,0x00,0x2c,0xab,0xd4,0x80,0x80,
+ 0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,0x80,
+ 0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,
+ 0x2c,0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,
+ 0xab,0x2c,0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,
+ 0xd4,0xab,0x2c,0x00,0xff,0x54,0x80,0x55,0xff,0x00,
+ 0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x80,0x55,0xff,
+ 0x80,0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x81,0x54,
+ 0x80,0x80,0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x80,
+
+ 0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,0x80,0x80,
+ 0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,0x80,
+ 0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,
+ 0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,
+ 0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x16,0x00,
+ 0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,
+ 0xeb,0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,
+ 0x80,0xeb,0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,
+ 0x80,0x80,0xeb,0x00,0x15,0x95,0x6b,0xff,0x7f,0xff,
+ 0x80,0x80,0x80,0xeb,0x00,0x14,0x95,0x6b,0xff,0x80,
+ },{
+ {VA_FOURCC_IMC3, {
+ 0xf8,0x6f,0xf7,0x5f,0xb0,0x2c,0x5f,0xf2,0xc3,0xf6,0xa8,0xff,
+ 0x00,0x82,0x4e,0x7e,0xd5,0x10,0x7f,0xd4,0x03,0xc4,0x96,0x9e,
+ 0x15,0xb4,0xf1,0x26,0x81,0xff,0x00,0x72,0xe7,0x83,0xac,0x3c,
+ 0x5f,0x61,0xe0,0xef,0x0e,0x7f,0xd4,0x91,0xf0,0xe7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x2e,0xc2,0xe1,0xb0,0x38,0x1c,0x35,0x0c,0x35,0x0a,0x54,0xa3,
+ 0xff,
+ }}
+ });
+
+ /**
+ * Test Pattern 4
+ *
+ * Solid Blue 150x75
+ *
+ */
+ template<> const bool TestPatternData<4>::m_valid =
+ TestPatternData<4>::initialize<150, 75>(
+
+ generateSolid({0x1d, 0xff, 0x6b}, {150, 75}),
+
+ {{VA_FOURCC_IMC3, {
+ 0xfe,0x39,0xe8,0xa2,0x8a,0xff,0x00,0xbf,0x83,0xf9,0x5c,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0xff,
+ }},
+ {VA_FOURCC_422H, {
+ 0xfe,0x39,0xe8,0xaf,0xfb,0xf8,0x3f,0x95,0xc2,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0xff,
+ }},
+ {VA_FOURCC_422V, {
+ 0xfe,0x39,0xe8,0xaf,0xfb,0xf8,0x3f,0x95,0xc2,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x0f,0xff,
+ }},
+ {VA_FOURCC_411P, {
+ 0xfe,0x39,0xe8,0xa2,0x8a,0xff,0x00,0xbf,0x83,0xf9,0x5c,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0xff,
+ }},
+ {VA_FOURCC_444P, {
+ 0xfe,0x39,0xeb,0xfe,0xfe,0x0f,0xe5,0x70,0xa0,0x02,0x80,0x0a,
+ 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
+ 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
+ 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
+ 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
+ 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
+ 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
+ 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
+ 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
+ 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
+ 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
+ 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
+ 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
+ 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
+ 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
+ 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
+ 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
+ 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
+ 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
+ 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
+ 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
+ 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
+ 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
+ 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
+ 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
+ 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
+ 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
+ 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
+ 0x00,0xa0,0x0f,0xff,
+ }}
+ });
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index ad5d8b0f0406..5a01e0ebff6c 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -26,6 +26,7 @@
#define I965_JPEG_TEST_DATA_H

#include <array>
+#include <iostream>
#include <map>
#include <memory>
#include <va/va.h>
@@ -336,7 +337,7 @@ namespace JPEG {
static const bool m_valid;
};

- static const ByteData generateSolid(
+ static inline const ByteData generateSolid(
const std::array<uint8_t, 3>& yuv, const std::array<size_t, 2>& dim)
{
size_t count(dim[0] * dim[1]);
@@ -346,740 +347,7 @@ namespace JPEG {
return data;
}

- /**
- * Test Pattern 1
- *
- * Solid Black 10x10
- *
- */
- template<> const bool TestPatternData<1>::m_valid =
- TestPatternData<1>::initialize<10, 10>(

- generateSolid({0x00, 0x80, 0x80}, {10, 10}),
-
- {{VA_FOURCC_IMC3, {
- 0xff,0x00,0x3f,0xfa,0x28,0xa2,0x80,0x3f,0xff,
- }},
- {VA_FOURCC_422H, {
- 0xff,0x00,0x3f,0xfa,0x28,0x00,0xa2,0x80,0x3f,0xff,
- }},
- {VA_FOURCC_422V, {
- 0xff,0x00,0x3f,0xfa,0x28,0x00,0xa2,0x80,0x3f,0xff,
- }},
- {VA_FOURCC_411P, {
- 0xff,0x00,0x3f,0xfa,0x28,0xa2,0x80,0x0a,0x28,0xa2,0x80,0x3f,
- 0xff,
- }},
- {VA_FOURCC_444P, {
- 0xff,0x00,0x3f,0xfa,0x00,0x28,0x00,0xa0,0x02,0x80,0x3f,0xff,
- }}}
- );
-
-
- /**
- * Test Pattern 2
- *
- * R = red
- * G = green
- * B = blue
- * W = white
- * K = black
- * -------------------
- * R R G G B B W W K K
- * R R G G B B W W K K
- * K K R R G G B B W W
- * K K R R G G B B W W
- * W W K K R R G G B B
- * W W K K R R G G B B
- * B B W W K K R R G G
- * B B W W K K R R G G
- * G G B B W W K K R R
- * G G B B W W K K R R
- * -------------------
- *
- */
-
- template<> const bool TestPatternData<2>::m_valid =
- TestPatternData<2>::initialize<10, 10>({
- // Pixel Y Component
- 0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,
- 0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,
- 0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,
- 0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,
- 0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,
- 0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,
- 0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,
- 0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,
- 0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,
- 0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,
-
- // Pixel U Component
- 0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,
- 0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,
- 0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,
- 0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,
- 0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,
- 0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,
- 0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,
- 0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,
- 0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,
- 0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,
-
- // Pixel V Component
- 0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,
- 0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,
- 0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,
- 0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,
- 0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,
- 0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,
- 0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,
- 0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,
- 0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,
- 0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,
- },{
- {VA_FOURCC_IMC3, {
- 0xf8,0x8b,0xc3,0x7e,0x24,0xf1,0xf7,0xec,0x71,0xe3,0xef,0xd9,
- 0x8f,0xc6,0x5e,0x0d,0xfd,0xa7,0x7f,0xe1,0x27,0xf0,0x3f,0x89,
- 0xff,0x00,0xe1,0x74,0xff,0x00,0xc3,0xae,0x3f,0xe0,0xa8,0xff,
- 0x00,0xf0,0xa5,0xb4,0x5d,0x17,0xfe,0x13,0x5f,0xec,0x5d,0x16,
- 0x7d,0x2b,0xf6,0xda,0xff,0x00,0x8c,0x25,0xd5,0x60,0xf1,0x46,
- 0xaf,0xe1,0xbf,0xf8,0x46,0xf5,0x7f,0x14,0x5d,0x7e,0xcf,0x1f,
- 0xf1,0x90,0xf6,0xb6,0xff,0x00,0xdb,0x1f,0x67,0xff,0x00,0x85,
- 0xb5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,0xc5,
- 0x13,0xff,0x00,0x4f,0x83,0xff,
- }},
- });
-
- /**
- * Test Pattern 3
- *
- * R = red
- * G = green
- * B = blue
- * W = white
- * C = cyan
- * M = magenta
- * Y = yellow
- * K = black
- * -------------------
- * K R B Y G C M K K W
- * R K R B Y G C M W K
- * B R K R B Y G C M K
- * Y B R K R B Y G C M
- * G Y B R K R B Y G C
- * C G Y B R K R B Y G
- * M C G Y B R K R B Y
- * K M C G Y B R K R K
- * K W M C G Y B R K R
- * W K K M C G Y B R K
- * -------------------
- *
- */
- template<> const bool TestPatternData<3>::m_valid =
- TestPatternData<3>::initialize<10, 10>({
- 0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x69,0x00,0x00,0xfe,
- 0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x69,0xff,0x00,
- 0x1d,0x4c,0x00,0x4c,0x1d,0xe3,0x96,0xb3,0x69,0x00,
- 0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x68,
- 0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,
- 0xb3,0x96,0xe3,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,
- 0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,
- 0x00,0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,
- 0x00,0xff,0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,
- 0xff,0x00,0x00,0x68,0xb3,0x96,0xe2,0x1d,0x4c,0x00,
-
- 0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,0x80,0x80,0x80,
- 0x55,0x80,0x54,0xff,0x00,0x2c,0xab,0xd4,0x80,0x80,
- 0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,0x80,
- 0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,
- 0x2c,0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,
- 0xab,0x2c,0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,
- 0xd4,0xab,0x2c,0x00,0xff,0x54,0x80,0x55,0xff,0x00,
- 0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x80,0x55,0xff,
- 0x80,0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x81,0x54,
- 0x80,0x80,0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x80,
-
- 0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,0x80,0x80,
- 0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,0x80,
- 0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,
- 0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,
- 0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x16,0x00,
- 0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,
- 0xeb,0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,
- 0x80,0xeb,0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,
- 0x80,0x80,0xeb,0x00,0x15,0x95,0x6b,0xff,0x7f,0xff,
- 0x80,0x80,0x80,0xeb,0x00,0x14,0x95,0x6b,0xff,0x80,
- },{
- {VA_FOURCC_IMC3, {
- 0xf8,0x6f,0xf7,0x5f,0xb0,0x2c,0x5f,0xf2,0xc3,0xf6,0xa8,0xff,
- 0x00,0x82,0x4e,0x7e,0xd5,0x10,0x7f,0xd4,0x03,0xc4,0x96,0x9e,
- 0x15,0xb4,0xf1,0x26,0x81,0xff,0x00,0x72,0xe7,0x83,0xac,0x3c,
- 0x5f,0x61,0xe0,0xef,0x0e,0x7f,0xd4,0x91,0xf0,0xe7,0xe3,0x27,
- 0xc3,0x9f,0x04,0x7f,0xcd,0x2b,0x83,0xe1,0x5f,0xfc,0x6b,0x77,
- 0xe9,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0x4e,0x19,0xe1,
- 0xfc,0xcb,0x32,0xcc,0xb8,0x7f,0x26,0xc7,0xe6,0x39,0x8e,0x3f,
- 0x26,0xcb,0x71,0x98,0xec,0x7e,0x3b,0x19,0x97,0x61,0xb1,0x18,
- 0xbc,0x6e,0x37,0x17,0x88,0xc3,0x54,0xc4,0x62,0xb1,0x78,0xac,
- 0x45,0x4a,0x95,0xf1,0x38,0x9a,0xf5,0x2a,0x56,0xaf,0x5a,0xa4,
- 0xea,0xd5,0x9c,0xa7,0x29,0x49,0xff,0x00,0xa9,0xdf,0x48,0x4f,
- 0xa4,0x27,0x8f,0xbc,0x05,0xe3,0xef,0x8e,0x1c,0x0b,0xc0,0xbe,
- 0x38,0x78,0xbf,0xc1,0x7c,0x13,0xc1,0x7e,0x2f,0xf8,0x97,0xc2,
- 0x7c,0x1d,0xc1,0xdc,0x27,0xe2,0x5f,0x1a,0x70,0xe7,0x0a,0xf0,
- 0x9f,0x0a,0xf0,0xe7,0x1a,0x67,0x59,0x3f,0x0f,0x70,0xd7,0x0d,
- 0x70,0xf6,0x4f,0x9d,0x60,0xf2,0x8c,0x8b,0x87,0xf2,0x2c,0xa3,
- 0x07,0x84,0xca,0xf2,0x6c,0x9b,0x2b,0xc1,0xe1,0x72,0xec,0xaf,
- 0x2e,0xc2,0xe1,0xb0,0x38,0x1c,0x35,0x0c,0x35,0x0a,0x54,0xa3,
- 0xff,
- }}
- });
-
- /**
- * Test Pattern 4
- *
- * Solid Blue 150x75
- *
- */
- template<> const bool TestPatternData<4>::m_valid =
- TestPatternData<4>::initialize<150, 75>(
-
- generateSolid({0x1d, 0xff, 0x6b}, {150, 75}),
-
- {{VA_FOURCC_IMC3, {
- 0xfe,0x39,0xe8,0xa2,0x8a,0xff,0x00,0xbf,0x83,0xf9,0x5c,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0xff,
- }},
- {VA_FOURCC_422H, {
- 0xfe,0x39,0xe8,0xaf,0xfb,0xf8,0x3f,0x95,0xc2,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0xff,
- }},
- {VA_FOURCC_422V, {
- 0xfe,0x39,0xe8,0xaf,0xfb,0xf8,0x3f,0x95,0xc2,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x0f,0xff,
- }},
- {VA_FOURCC_411P, {
- 0xfe,0x39,0xe8,0xa2,0x8a,0xff,0x00,0xbf,0x83,0xf9,0x5c,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0xff,
- }},
- {VA_FOURCC_444P, {
- 0xfe,0x39,0xeb,0xfe,0xfe,0x0f,0xe5,0x70,0xa0,0x02,0x80,0x0a,
- 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
- 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
- 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
- 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
- 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
- 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
- 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
- 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
- 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
- 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
- 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
- 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
- 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
- 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
- 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
- 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
- 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
- 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
- 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
- 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
- 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
- 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
- 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
- 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
- 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
- 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
- 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
- 0x00,0xa0,0x0f,0xff,
- }}
- });
} // namespace JPEG

#endif
--
2.4.11
U. Artie Eoff
2016-09-26 20:11:43 UTC
Permalink
Put the JPEG decode tests and test data into its own
namespace so that it can be distinguished from encode.

Signed-off-by: U. Artie Eoff <***@intel.com>
---
test/i965_jpeg_decode_test.cpp | 8 ++---
test/i965_jpeg_test_data.cpp | 4 +++
test/i965_jpeg_test_data.h | 81 ++++++++++++++----------------------------
3 files changed, 33 insertions(+), 60 deletions(-)

diff --git a/test/i965_jpeg_decode_test.cpp b/test/i965_jpeg_decode_test.cpp
index 24a30e63c91e..b022c2e67c3e 100644
--- a/test/i965_jpeg_decode_test.cpp
+++ b/test/i965_jpeg_decode_test.cpp
@@ -34,12 +34,9 @@
#include <vector>

namespace JPEG {
+namespace Decode {

-class JPEGDecodeTest : public I965TestFixture
-{
-protected:
- static const VAEntrypoint entrypoint = VAEntrypointVLD;
-};
+class JPEGDecodeTest : public I965TestFixture { };

TEST_F(JPEGDecodeTest, Entrypoint)
{
@@ -324,4 +321,5 @@ INSTANTIATE_TEST_CASE_P(
::testing::Values("IMC3", "422H", "422V", "444P", "411P"))
);

+} // namespace Decode
} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.cpp b/test/i965_jpeg_test_data.cpp
index 02d092c7d165..7f327a588d2f 100644
--- a/test/i965_jpeg_test_data.cpp
+++ b/test/i965_jpeg_test_data.cpp
@@ -25,6 +25,8 @@
#include "i965_jpeg_test_data.h"

namespace JPEG {
+namespace Decode {
+
/**
* Test Pattern 1
*
@@ -759,4 +761,6 @@ namespace JPEG {
0x00,0xa0,0x0f,0xff,
}}
});
+
+} // namespace Decode
} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index 5a01e0ebff6c..d52f58233cc5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -33,13 +33,29 @@
#include <vector>

namespace JPEG {
+ typedef std::vector<uint8_t> ByteData;
+
+ static const VAProfile profile = VAProfileJPEGBaseline;

+ static inline const ByteData generateSolid(
+ const std::array<uint8_t, 3>& yuv, const std::array<size_t, 2>& dim)
+ {
+ size_t count(dim[0] * dim[1]);
+ ByteData data(count, yuv[0]);
+ data.insert(data.end(), count, yuv[1]);
+ data.insert(data.end(), count, yuv[2]);
+ return data;
+ }
+} // namespace JPEG
+
+namespace JPEG {
+namespace Decode {
typedef VAIQMatrixBufferJPEGBaseline IQMatrix;
typedef VAHuffmanTableBufferJPEGBaseline HuffmanTable;
typedef VAPictureParameterBufferJPEGBaseline PictureParameter;
typedef VASliceParameterBufferJPEGBaseline SliceParameter;

- static const VAProfile profile = VAProfileJPEGBaseline;
+ static const VAEntrypoint entrypoint = VAEntrypointVLD;

static const HuffmanTable defaultHuffmanTable = {
load_huffman_table: { 0x01, 0x01 },
@@ -130,29 +146,11 @@ namespace JPEG {
};

static const PictureParameter defaultPictureParameter = {
- picture_width: 10,
- picture_height: 10,
- components: {
- {
- component_id: 1,
- h_sampling_factor: 1,
- v_sampling_factor: 1,
- quantiser_table_selector: 0,
- },
- {
- component_id: 2,
- h_sampling_factor: 1,
- v_sampling_factor: 1,
- quantiser_table_selector: 1,
- },
- {
- component_id: 3,
- h_sampling_factor: 1,
- v_sampling_factor: 1,
- quantiser_table_selector: 1,
- },
- },
- num_components: 3,
+ picture_width: 10,
+ picture_height: 10,
+ /* component_id, h_sampling_factor, v_sampling_factor, quantiser_table_selector */
+ components: {{1,1,1,0}, {2,1,1,1}, {3,1,1,1}},
+ num_components: 3,
};

static const SliceParameter defaultSliceParameter = {
@@ -162,30 +160,14 @@ namespace JPEG {
slice_horizontal_position: 0,
slice_vertical_position: 0,

- components: {
- {
- component_selector: 1,
- dc_table_selector: 0,
- ac_table_selector: 0,
- },
- {
- component_selector: 2,
- dc_table_selector: 1,
- ac_table_selector: 1,
- },
- {
- component_selector: 3,
- dc_table_selector: 1,
- ac_table_selector: 1,
- },
- },
+ /* component_selector, dc_table_selector, ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}},
+
num_components: 3,
restart_interval: 0,
num_mcus: 4,
};

- typedef std::vector<uint8_t> ByteData;
-
class PictureData
{
public:
@@ -336,18 +318,7 @@ namespace JPEG {

static const bool m_valid;
};
-
- static inline const ByteData generateSolid(
- const std::array<uint8_t, 3>& yuv, const std::array<size_t, 2>& dim)
- {
- size_t count(dim[0] * dim[1]);
- ByteData data(count, yuv[0]);
- data.insert(data.end(), count, yuv[1]);
- data.insert(data.end(), count, yuv[2]);
- return data;
- }
-
-
+} // namespace Decode
} // namespace JPEG

#endif
--
2.4.11
Zhao Yakui
2016-09-27 01:33:13 UTC
Permalink
Post by U. Artie Eoff
Put the JPEG decode tests and test data into its own
namespace so that it can be distinguished from encode.
This looks good to me.
Post by U. Artie Eoff
---
test/i965_jpeg_decode_test.cpp | 8 ++---
test/i965_jpeg_test_data.cpp | 4 +++
test/i965_jpeg_test_data.h | 81 ++++++++++++++----------------------------
3 files changed, 33 insertions(+), 60 deletions(-)
diff --git a/test/i965_jpeg_decode_test.cpp b/test/i965_jpeg_decode_test.cpp
index 24a30e63c91e..b022c2e67c3e 100644
--- a/test/i965_jpeg_decode_test.cpp
+++ b/test/i965_jpeg_decode_test.cpp
@@ -34,12 +34,9 @@
#include<vector>
namespace JPEG {
+namespace Decode {
-class JPEGDecodeTest : public I965TestFixture
-{
- static const VAEntrypoint entrypoint = VAEntrypointVLD;
-};
+class JPEGDecodeTest : public I965TestFixture { };
TEST_F(JPEGDecodeTest, Entrypoint)
{
@@ -324,4 +321,5 @@ INSTANTIATE_TEST_CASE_P(
::testing::Values("IMC3", "422H", "422V", "444P", "411P"))
);
+} // namespace Decode
} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.cpp b/test/i965_jpeg_test_data.cpp
index 02d092c7d165..7f327a588d2f 100644
--- a/test/i965_jpeg_test_data.cpp
+++ b/test/i965_jpeg_test_data.cpp
@@ -25,6 +25,8 @@
#include "i965_jpeg_test_data.h"
namespace JPEG {
+namespace Decode {
+
/**
* Test Pattern 1
*
@@ -759,4 +761,6 @@ namespace JPEG {
0x00,0xa0,0x0f,0xff,
}}
});
+
+} // namespace Decode
} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index 5a01e0ebff6c..d52f58233cc5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -33,13 +33,29 @@
#include<vector>
namespace JPEG {
+ typedef std::vector<uint8_t> ByteData;
+
+ static const VAProfile profile = VAProfileJPEGBaseline;
+ static inline const ByteData generateSolid(
+ const std::array<uint8_t, 3>& yuv, const std::array<size_t, 2>& dim)
+ {
+ size_t count(dim[0] * dim[1]);
+ ByteData data(count, yuv[0]);
+ data.insert(data.end(), count, yuv[1]);
+ data.insert(data.end(), count, yuv[2]);
+ return data;
+ }
+} // namespace JPEG
+
+namespace JPEG {
+namespace Decode {
typedef VAIQMatrixBufferJPEGBaseline IQMatrix;
typedef VAHuffmanTableBufferJPEGBaseline HuffmanTable;
typedef VAPictureParameterBufferJPEGBaseline PictureParameter;
typedef VASliceParameterBufferJPEGBaseline SliceParameter;
- static const VAProfile profile = VAProfileJPEGBaseline;
+ static const VAEntrypoint entrypoint = VAEntrypointVLD;
static const HuffmanTable defaultHuffmanTable = {
load_huffman_table: { 0x01, 0x01 },
@@ -130,29 +146,11 @@ namespace JPEG {
};
static const PictureParameter defaultPictureParameter = {
- picture_width: 10,
- picture_height: 10,
- components: {
- {
- component_id: 1,
- h_sampling_factor: 1,
- v_sampling_factor: 1,
- quantiser_table_selector: 0,
- },
- {
- component_id: 2,
- h_sampling_factor: 1,
- v_sampling_factor: 1,
- quantiser_table_selector: 1,
- },
- {
- component_id: 3,
- h_sampling_factor: 1,
- v_sampling_factor: 1,
- quantiser_table_selector: 1,
- },
- },
- num_components: 3,
+ picture_width: 10,
+ picture_height: 10,
+ /* component_id, h_sampling_factor, v_sampling_factor, quantiser_table_selector */
+ components: {{1,1,1,0}, {2,1,1,1}, {3,1,1,1}},
+ num_components: 3,
};
static const SliceParameter defaultSliceParameter = {
@@ -162,30 +160,14 @@ namespace JPEG {
slice_horizontal_position: 0,
slice_vertical_position: 0,
- components: {
- {
- component_selector: 1,
- dc_table_selector: 0,
- ac_table_selector: 0,
- },
- {
- component_selector: 2,
- dc_table_selector: 1,
- ac_table_selector: 1,
- },
- {
- component_selector: 3,
- dc_table_selector: 1,
- ac_table_selector: 1,
- },
- },
+ /* component_selector, dc_table_selector, ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}},
+
num_components: 3,
restart_interval: 0,
num_mcus: 4,
};
- typedef std::vector<uint8_t> ByteData;
-
class PictureData
{
@@ -336,18 +318,7 @@ namespace JPEG {
static const bool m_valid;
};
-
- static inline const ByteData generateSolid(
- const std::array<uint8_t, 3>& yuv, const std::array<size_t, 2>& dim)
- {
- size_t count(dim[0] * dim[1]);
- ByteData data(count, yuv[0]);
- data.insert(data.end(), count, yuv[1]);
- data.insert(data.end(), count, yuv[2]);
- return data;
- }
-
-
+} // namespace Decode
} // namespace JPEG
#endif
U. Artie Eoff
2016-09-26 20:11:44 UTC
Permalink
Add support for calling i965_CreateSurfaces2 so that we
can pass VASurfaceAttributes. This is needed to set a
particular surface pixel format in some tests.

We must call i965_CreateSurfaces2 via the vtable since
it is a static function within the i965_drv_video.c
file... thus hidden.

Signed-off-by: U. Artie Eoff <***@intel.com>
---
test/i965_test_fixture.cpp | 20 ++++++++++++++++----
test/i965_test_fixture.h | 10 +++++++---
2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/test/i965_test_fixture.cpp b/test/i965_test_fixture.cpp
index d7f30c2ed4f3..dd8143031fe9 100644
--- a/test/i965_test_fixture.cpp
+++ b/test/i965_test_fixture.cpp
@@ -97,12 +97,24 @@ I965TestFixture::operator VADisplay()
return m_vaDisplay;
}

-Surfaces I965TestFixture::createSurfaces(int w, int h, int format, size_t count)
+Surfaces I965TestFixture::createSurfaces(int w, int h, int format, size_t count,
+ const SurfaceAttribs& attributes)
{
Surfaces surfaces(count, VA_INVALID_ID);
- EXPECT_STATUS(
- i965_CreateSurfaces(
- *this, w, h, format, surfaces.size(), surfaces.data()));
+ if (attributes.empty()) {
+ EXPECT_STATUS(
+ i965_CreateSurfaces(
+ *this, w, h, format, surfaces.size(), surfaces.data()));
+ } else {
+ VADriverContextP ctx(*this);
+ EXPECT_PTR(ctx);
+ if (ctx)
+ EXPECT_STATUS(
+ ctx->vtable->vaCreateSurfaces2(
+ *this, format, w, h, surfaces.data(), surfaces.size(),
+ const_cast<VASurfaceAttrib*>(attributes.data()),
+ attributes.size()));
+ }

for (size_t i(0); i < count; ++i) {
EXPECT_ID(surfaces[i]);
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 511c791fe9be..5915852c0f4b 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -32,6 +32,7 @@
#include <vector>

typedef std::vector<VASurfaceID> Surfaces;
+typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;

/**
@@ -99,10 +100,13 @@ public:
void terminate();

/**
- * Convenience wrapper for i965_CreateSurfaces. May generate a non-fatal
- * test assertion failure.
+ * Convenience wrapper for i965_CreateSurfaces or i965_CreateSurfaces2.
+ * If SurfaceAttribs are specified then i965_CreateSurfaces2 is used,
+ * otherwise i965_CreateSurfaces is used. May generate a non-fatal test
+ * assertion failure.
*/
- Surfaces createSurfaces(int w, int h, int format, size_t count = 1);
+ Surfaces createSurfaces(int w, int h, int format, size_t count = 1,
+ const SurfaceAttribs& = SurfaceAttribs());

/**
* Convenience wrapper for i965_DestroySurfaces. May generate a non-fatal
--
2.4.11
Zhao Yakui
2016-09-27 01:34:06 UTC
Permalink
Post by U. Artie Eoff
Add support for calling i965_CreateSurfaces2 so that we
can pass VASurfaceAttributes. This is needed to set a
particular surface pixel format in some tests.
We must call i965_CreateSurfaces2 via the vtable since
it is a static function within the i965_drv_video.c
file... thus hidden.
This looks good to me.

Add: Reviewed-by: Zhao Yakui <***@intel.com>

Thanks.
Yakui
Post by U. Artie Eoff
---
test/i965_test_fixture.cpp | 20 ++++++++++++++++----
test/i965_test_fixture.h | 10 +++++++---
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/test/i965_test_fixture.cpp b/test/i965_test_fixture.cpp
index d7f30c2ed4f3..dd8143031fe9 100644
--- a/test/i965_test_fixture.cpp
+++ b/test/i965_test_fixture.cpp
@@ -97,12 +97,24 @@ I965TestFixture::operator VADisplay()
return m_vaDisplay;
}
-Surfaces I965TestFixture::createSurfaces(int w, int h, int format, size_t count)
+Surfaces I965TestFixture::createSurfaces(int w, int h, int format, size_t count,
+ const SurfaceAttribs& attributes)
{
Surfaces surfaces(count, VA_INVALID_ID);
- EXPECT_STATUS(
- i965_CreateSurfaces(
- *this, w, h, format, surfaces.size(), surfaces.data()));
+ if (attributes.empty()) {
+ EXPECT_STATUS(
+ i965_CreateSurfaces(
+ *this, w, h, format, surfaces.size(), surfaces.data()));
+ } else {
+ VADriverContextP ctx(*this);
+ EXPECT_PTR(ctx);
+ if (ctx)
+ EXPECT_STATUS(
+ ctx->vtable->vaCreateSurfaces2(
+ *this, format, w, h, surfaces.data(), surfaces.size(),
+ const_cast<VASurfaceAttrib*>(attributes.data()),
+ attributes.size()));
+ }
for (size_t i(0); i< count; ++i) {
EXPECT_ID(surfaces[i]);
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 511c791fe9be..5915852c0f4b 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -32,6 +32,7 @@
#include<vector>
typedef std::vector<VASurfaceID> Surfaces;
+typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
/**
void terminate();
/**
- * Convenience wrapper for i965_CreateSurfaces. May generate a non-fatal
- * test assertion failure.
+ * Convenience wrapper for i965_CreateSurfaces or i965_CreateSurfaces2.
+ * If SurfaceAttribs are specified then i965_CreateSurfaces2 is used,
+ * otherwise i965_CreateSurfaces is used. May generate a non-fatal test
+ * assertion failure.
*/
- Surfaces createSurfaces(int w, int h, int format, size_t count = 1);
+ Surfaces createSurfaces(int w, int h, int format, size_t count = 1,
+ const SurfaceAttribs& = SurfaceAttribs());
/**
* Convenience wrapper for i965_DestroySurfaces. May generate a non-fatal
U. Artie Eoff
2016-09-26 20:11:47 UTC
Permalink
Common utilities and functions that may be useful for multiple
tests.

Signed-off-by: U. Artie Eoff <***@intel.com>
---
test/Makefile.am | 1 +
test/test_utils.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
create mode 100644 test/test_utils.h

diff --git a/test/Makefile.am b/test/Makefile.am
index 0d53e0f6150a..2e9edda648a4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -48,6 +48,7 @@ noinst_HEADERS = \
i965_jpeg_test_data.h \
i965_test_fixture.h \
test.h \
+ test_utils.h \
$(NULL)

test_i965_drv_video_SOURCES = \
diff --git a/test/test_utils.h b/test/test_utils.h
new file mode 100644
index 000000000000..ee84f7bf45a4
--- /dev/null
+++ b/test/test_utils.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef TEST_UTILS_H
+#define TEST_UTILS_H
+
+#include <random>
+
+template <typename T>
+class RandomValueGenerator
+{
+public:
+ RandomValueGenerator(const T& min, const T& max)
+ : dis(min, max)
+ { }
+
+ const T operator()()
+ {
+ static std::random_device rd;
+ static std::mt19937 gen(rd());
+ return dis(gen);
+ }
+
+private:
+ std::uniform_int_distribution<T> dis;
+};
+
+#endif // TEST_UTILS_H
--
2.4.11
Zhao Yakui
2016-09-27 01:45:33 UTC
Permalink
Post by U. Artie Eoff
Common utilities and functions that may be useful for multiple
tests.
This looks good to me.

Add: Reviewed-by: Zhao Yakui <***@intel.com>

Thanks
Yakui
Post by U. Artie Eoff
---
test/Makefile.am | 1 +
test/test_utils.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
create mode 100644 test/test_utils.h
diff --git a/test/Makefile.am b/test/Makefile.am
index 0d53e0f6150a..2e9edda648a4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -48,6 +48,7 @@ noinst_HEADERS = \
i965_jpeg_test_data.h \
i965_test_fixture.h \
test.h \
+ test_utils.h \
$(NULL)
test_i965_drv_video_SOURCES = \
diff --git a/test/test_utils.h b/test/test_utils.h
new file mode 100644
index 000000000000..ee84f7bf45a4
--- /dev/null
+++ b/test/test_utils.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef TEST_UTILS_H
+#define TEST_UTILS_H
+
+#include<random>
+
+template<typename T>
+class RandomValueGenerator
+{
+ RandomValueGenerator(const T& min, const T& max)
+ : dis(min, max)
+ { }
+
+ const T operator()()
+ {
+ static std::random_device rd;
+ static std::mt19937 gen(rd());
+ return dis(gen);
+ }
+
+ std::uniform_int_distribution<T> dis;
+};
+
+#endif // TEST_UTILS_H
U. Artie Eoff
2016-09-26 20:11:45 UTC
Permalink
Add convenience streamable operators for VA and other common
data structures so that tests can log them as needed.

v2: put std::array stream operators into the std namespace
otherwise gcc 5.x complains.

Signed-off-by: U. Artie Eoff <***@intel.com>
---
test/i965_streamable.h | 361 +++++++++++++++++++++++++++++++++++++++++++++++
test/i965_test_fixture.h | 1 +
2 files changed, 362 insertions(+)
create mode 100644 test/i965_streamable.h

diff --git a/test/i965_streamable.h b/test/i965_streamable.h
new file mode 100644
index 000000000000..1c2f217d0a21
--- /dev/null
+++ b/test/i965_streamable.h
@@ -0,0 +1,361 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef I965_STREAMABLE_H
+#define I965_STREAMABLE_H
+
+#include <array>
+#include <iostream>
+#include <iomanip>
+#include <va/va.h>
+
+namespace std {
+ template <typename T, const size_t S> inline std::ostream&
+ operator<<(std::ostream& os, const std::array<T, S>& a)
+ {
+ os << "{";
+ for (const auto& s : a) {
+ if (&s != &a[0])
+ os << ",";
+ os << s;
+ }
+ return os << "}";
+ }
+
+ template <const size_t S> inline std::ostream&
+ operator<<(std::ostream& os, const std::array<uint8_t, S>& a)
+ {
+ os << "{" << std::hex;
+ for (const auto& s : a) {
+ if (&s != &a[0])
+ os << ",";
+ os << "0x" << std::setfill('0') << std::setw(2) << unsigned(s);
+ }
+ return os << std::dec << "}";
+ }
+}// namespace std
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncPictureParameterBufferJPEG& b)
+{
+ os << "VAEncPictureParameterBufferJPEG (" << &b << ")" << std::endl
+ << " .reconstructed_picture = " << b.reconstructed_picture
+ << std::endl
+
+ << " .picture_width = " << b.picture_width
+ << std::endl
+
+ << " .picture_height = " << b.picture_height
+ << std::endl
+
+ << " .coded_buf = " << b.coded_buf
+ << std::endl
+
+ << " .pic_flags.value = "
+ << std::hex << std::setw(8) << std::setfill('0') << b.pic_flags.value
+ << std::dec
+ << std::endl
+
+ << " ...profile = " << b.pic_flags.bits.profile
+ << " (0 - Baseline, 1 - Extended, 2 - Lossless, 3 - Hierarchical)"
+ << std::endl
+
+ << " ...progressive = " << b.pic_flags.bits.progressive
+ << " (0 - sequential, 1 - extended, 2 - progressive)"
+ << std::endl
+
+ << " ...huffman = " << b.pic_flags.bits.huffman
+ << " (0 - arithmetic, 1 - huffman)"
+ << std::endl
+
+ << " ...interleaved = " << b.pic_flags.bits.interleaved
+ << " (0 - non interleaved, 1 - interleaved)"
+ << std::endl
+
+ << " ...differential = " << b.pic_flags.bits.differential
+ << " (0 - non differential, 1 - differential)"
+ << std::endl
+
+ << " .sample_bit_depth = " << (unsigned)b.sample_bit_depth
+ << std::endl
+
+ << " .num_scan = " << (unsigned)b.num_scan
+ << std::endl
+
+ << " .num_components = " << (unsigned)b.num_components
+ << std::endl
+
+ << " .component_id = "
+ << (unsigned)b.component_id[0] << ","
+ << (unsigned)b.component_id[1] << ","
+ << (unsigned)b.component_id[2] << ","
+ << (unsigned)b.component_id[3] << ","
+ << std::endl
+
+ << " .quantiser_table_selector = "
+ << (unsigned)b.quantiser_table_selector[0] << ","
+ << (unsigned)b.quantiser_table_selector[1] << ","
+ << (unsigned)b.quantiser_table_selector[2] << ","
+ << (unsigned)b.quantiser_table_selector[3] << ","
+ << std::endl
+
+ << " .quality = " << (unsigned)b.quality
+ << std::endl
+ ;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncPictureParameterBufferJPEG* b)
+{
+ os << *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAQMatrixBufferJPEG& b)
+{
+ os << "VAQMatrixBufferJPEG (" << &b << ")" << std::endl;
+
+ os << " .load_lum_quantiser_matrix = " << b.load_lum_quantiser_matrix
+ << std::endl
+ ;
+
+ if (b.load_lum_quantiser_matrix)
+ {
+ os << " .lum_quantiser_matrix = ";
+ for (size_t i(0); i < sizeof(b.lum_quantiser_matrix); ++i) {
+ os << std::hex << std::setw(2) << std::setfill('0')
+ << (unsigned)b.lum_quantiser_matrix[i] << ",";
+ if (((i+1) % 12) == 0)
+ os << std::endl << " ";
+ }
+ os << std::dec << std::endl;
+ }
+
+ os << " .load_chroma_quantiser_matrix = " << b.load_chroma_quantiser_matrix
+ << std::endl
+ ;
+
+ if (b.load_lum_quantiser_matrix)
+ {
+ os << " .chroma_quantiser_matrix = ";
+ for (size_t i(0); i < sizeof(b.chroma_quantiser_matrix); ++i) {
+ os << std::hex << std::setw(2) << std::setfill('0')
+ << (unsigned)b.chroma_quantiser_matrix[i] << ",";
+ if (((i+1) % 12) == 0)
+ os << std::endl << " ";
+ }
+ os << std::dec << std::endl;
+ }
+
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAQMatrixBufferJPEG* b)
+{
+ os << *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAHuffmanTableBufferJPEGBaseline& b)
+{
+ os << "VAHuffmanTableBufferJPEGBaseline (" << &b << ")" << std::endl;
+
+ os << " .load_huffman_table = "
+ << (unsigned)b.load_huffman_table[0] << ","
+ << (unsigned)b.load_huffman_table[1] << ","
+ << std::endl
+ ;
+
+ for (size_t i(0); i < 2; ++i) {
+ unsigned sum(0);
+ os << " .huffman_table[" << i << "].num_dc_codes = ";
+ for (size_t j(0); j < sizeof(b.huffman_table[i].num_dc_codes); ++j) {
+ if (j and (j % 12) == 0)
+ os << std::endl << " ";
+ os << std::hex << std::setfill('0') << std::setw(2)
+ << (unsigned)b.huffman_table[i].num_dc_codes[j] << ","
+ << std::dec
+ ;
+ sum += b.huffman_table[i].num_dc_codes[j];
+ }
+ os << " (sum = " << sum << ")" << std::endl;
+
+ os << " .huffman_table[" << i << "].dc_values = ";
+ for (size_t j(0); j < sizeof(b.huffman_table[i].dc_values); ++j) {
+ if (j and (j % 12) == 0)
+ os << std::endl << " ";
+ os << std::hex << std::setfill('0') << std::setw(2)
+ << (unsigned)b.huffman_table[i].dc_values[j] << ","
+ << std::dec
+ ;
+ }
+ os << std::endl;
+
+ sum = 0;
+ os << " .huffman_table[" << i << "].num_ac_codes = ";
+ for (size_t j(0); j < sizeof(b.huffman_table[i].num_ac_codes); ++j) {
+ if (j and (j % 12) == 0)
+ os << std::endl << " ";
+ os << std::hex << std::setfill('0') << std::setw(2)
+ << (unsigned)b.huffman_table[i].num_ac_codes[j] << ","
+ << std::dec
+ ;
+ sum += b.huffman_table[i].num_ac_codes[j];
+ }
+ os << " (sum = " << sum << ")" << std::endl;
+
+ os << " .huffman_table[" << i << "].ac_values = ";
+ for (size_t j(0); j < sizeof(b.huffman_table[i].ac_values); ++j) {
+ if (j and (j % 12) == 0)
+ os << std::endl << " ";
+ os << std::hex << std::setfill('0') << std::setw(2)
+ << (unsigned)b.huffman_table[i].ac_values[j] << ","
+ << std::dec
+ ;
+ }
+ os << std::endl;
+ }
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAHuffmanTableBufferJPEGBaseline* b)
+{
+ os << *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncSliceParameterBufferJPEG& b)
+{
+ os << "VAEncSliceParameterBufferJPEG (" << &b << ")" << std::endl
+ << " .restart_interval = " << b.restart_interval
+ << std::endl
+
+ << " .num_components = " << b.num_components
+ << std::endl
+ ;
+
+ for (size_t i(0); i < 4; ++i) {
+ os << " .components[" << i << "]" << std::endl
+ << " .component_selector = "
+ << (unsigned)b.components[i].component_selector
+ << std::endl
+
+ << " .dc_table_selector = "
+ << (unsigned)b.components[i].dc_table_selector
+ << std::endl
+
+ << " .ac_table_selector = "
+ << (unsigned)b.components[i].ac_table_selector
+ << std::endl
+ ;
+ }
+
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncSliceParameterBufferJPEG* b)
+{
+ os << *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncPackedHeaderParameterBuffer& b)
+{
+ os << "VAEncPackedHeaderParameterBuffer (" << &b << ")" << std::endl
+ << " .type = " << b.type
+ << std::endl
+ << " .bit_length = " << b.bit_length
+ << std::endl
+ << " .has_emulation_bytes = " << (unsigned)b.has_emulation_bytes
+ << std::endl
+ ;
+
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncPackedHeaderParameterBuffer* b)
+{
+ os << *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAImage& image)
+{
+ os << "VAImage (" << &image << ")"
+ << std::dec << std::endl
+ << " id : " << image.image_id
+ << std::endl
+ << " fourcc : "
+ << std::string(reinterpret_cast<const char*>(&image.format.fourcc), 4)
+ << std::endl
+ << " size : " << image.width << "x" << image.height
+ << std::endl
+ << " planes : " << image.num_planes
+ << std::endl
+ << " offsets : "
+ << "{"
+ << image.offsets[0] << ","
+ << image.offsets[1] << ","
+ << image.offsets[2]
+ << "}"
+ << std::endl
+ << " pitches : "
+ << "{"
+ << image.pitches[0] << ","
+ << image.pitches[1] << ","
+ << image.pitches[2]
+ << "}"
+ << std::endl
+ << " bpp : " << image.format.bits_per_pixel
+ << std::endl
+ << " depth : " << image.format.depth
+ << std::endl
+ << " byteorder: " << image.format.byte_order
+ << std::endl
+ << " rgba mask: "
+ << "{"
+ << image.format.red_mask << ","
+ << image.format.green_mask << ","
+ << image.format.blue_mask << ","
+ << image.format.alpha_mask
+ << "}"
+ << std::endl
+ << " buffer id: " << image.buf
+ << std::endl
+ << " data size: " << image.data_size
+ ;
+ return os;
+}
+
+#endif // I965_STREAMABLE_H
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 5915852c0f4b..d09f31d859b1 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -27,6 +27,7 @@

#include "test.h"
#include "i965_internal_decl.h"
+#include "i965_streamable.h"

#include <string>
#include <vector>
--
2.4.11
Zhao Yakui
2016-09-27 01:36:04 UTC
Permalink
Post by U. Artie Eoff
Add convenience streamable operators for VA and other common
data structures so that tests can log them as needed.
v2: put std::array stream operators into the std namespace
otherwise gcc 5.x complains.
This looks good to me.

Add: Reviewed-by: Zhao Yakui <***@intel.com>

Thanks
Post by U. Artie Eoff
---
test/i965_streamable.h | 361 +++++++++++++++++++++++++++++++++++++++++++++++
test/i965_test_fixture.h | 1 +
2 files changed, 362 insertions(+)
create mode 100644 test/i965_streamable.h
diff --git a/test/i965_streamable.h b/test/i965_streamable.h
new file mode 100644
index 000000000000..1c2f217d0a21
--- /dev/null
+++ b/test/i965_streamable.h
@@ -0,0 +1,361 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef I965_STREAMABLE_H
+#define I965_STREAMABLE_H
+
+#include<array>
+#include<iostream>
+#include<iomanip>
+#include<va/va.h>
+
+namespace std {
+ template<typename T, const size_t S> inline std::ostream&
+ operator<<(std::ostream& os, const std::array<T, S>& a)
+ {
+ os<< "{";
+ for (const auto& s : a) {
+ if (&s !=&a[0])
+ os<< ",";
+ os<< s;
+ }
+ return os<< "}";
+ }
+
+ template<const size_t S> inline std::ostream&
+ operator<<(std::ostream& os, const std::array<uint8_t, S>& a)
+ {
+ os<< "{"<< std::hex;
+ for (const auto& s : a) {
+ if (&s !=&a[0])
+ os<< ",";
+ os<< "0x"<< std::setfill('0')<< std::setw(2)<< unsigned(s);
+ }
+ return os<< std::dec<< "}";
+ }
+}// namespace std
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncPictureParameterBufferJPEG& b)
+{
+ os<< "VAEncPictureParameterBufferJPEG ("<< &b<< ")"<< std::endl
+<< " .reconstructed_picture = "<< b.reconstructed_picture
+<< std::endl
+
+<< " .picture_width = "<< b.picture_width
+<< std::endl
+
+<< " .picture_height = "<< b.picture_height
+<< std::endl
+
+<< " .coded_buf = "<< b.coded_buf
+<< std::endl
+
+<< " .pic_flags.value ="
+<< std::hex<< std::setw(8)<< std::setfill('0')<< b.pic_flags.value
+<< std::dec
+<< std::endl
+
+<< " ...profile = "<< b.pic_flags.bits.profile
+<< " (0 - Baseline, 1 - Extended, 2 - Lossless, 3 - Hierarchical)"
+<< std::endl
+
+<< " ...progressive = "<< b.pic_flags.bits.progressive
+<< " (0 - sequential, 1 - extended, 2 - progressive)"
+<< std::endl
+
+<< " ...huffman = "<< b.pic_flags.bits.huffman
+<< " (0 - arithmetic, 1 - huffman)"
+<< std::endl
+
+<< " ...interleaved = "<< b.pic_flags.bits.interleaved
+<< " (0 - non interleaved, 1 - interleaved)"
+<< std::endl
+
+<< " ...differential = "<< b.pic_flags.bits.differential
+<< " (0 - non differential, 1 - differential)"
+<< std::endl
+
+<< " .sample_bit_depth = "<< (unsigned)b.sample_bit_depth
+<< std::endl
+
+<< " .num_scan = "<< (unsigned)b.num_scan
+<< std::endl
+
+<< " .num_components = "<< (unsigned)b.num_components
+<< std::endl
+
+<< " .component_id ="
+<< (unsigned)b.component_id[0]<< ","
+<< (unsigned)b.component_id[1]<< ","
+<< (unsigned)b.component_id[2]<< ","
+<< (unsigned)b.component_id[3]<< ","
+<< std::endl
+
+<< " .quantiser_table_selector ="
+<< (unsigned)b.quantiser_table_selector[0]<< ","
+<< (unsigned)b.quantiser_table_selector[1]<< ","
+<< (unsigned)b.quantiser_table_selector[2]<< ","
+<< (unsigned)b.quantiser_table_selector[3]<< ","
+<< std::endl
+
+<< " .quality = "<< (unsigned)b.quality
+<< std::endl
+ ;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncPictureParameterBufferJPEG* b)
+{
+ os<< *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAQMatrixBufferJPEG& b)
+{
+ os<< "VAQMatrixBufferJPEG ("<< &b<< ")"<< std::endl;
+
+ os<< " .load_lum_quantiser_matrix = "<< b.load_lum_quantiser_matrix
+<< std::endl
+ ;
+
+ if (b.load_lum_quantiser_matrix)
+ {
+ os<< " .lum_quantiser_matrix = ";
+ for (size_t i(0); i< sizeof(b.lum_quantiser_matrix); ++i) {
+ os<< std::hex<< std::setw(2)<< std::setfill('0')
+<< (unsigned)b.lum_quantiser_matrix[i]<< ",";
+ if (((i+1) % 12) == 0)
+ os<< std::endl<< " ";
+ }
+ os<< std::dec<< std::endl;
+ }
+
+ os<< " .load_chroma_quantiser_matrix = "<< b.load_chroma_quantiser_matrix
+<< std::endl
+ ;
+
+ if (b.load_lum_quantiser_matrix)
+ {
+ os<< " .chroma_quantiser_matrix = ";
+ for (size_t i(0); i< sizeof(b.chroma_quantiser_matrix); ++i) {
+ os<< std::hex<< std::setw(2)<< std::setfill('0')
+<< (unsigned)b.chroma_quantiser_matrix[i]<< ",";
+ if (((i+1) % 12) == 0)
+ os<< std::endl<< " ";
+ }
+ os<< std::dec<< std::endl;
+ }
+
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAQMatrixBufferJPEG* b)
+{
+ os<< *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAHuffmanTableBufferJPEGBaseline& b)
+{
+ os<< "VAHuffmanTableBufferJPEGBaseline ("<< &b<< ")"<< std::endl;
+
+ os<< " .load_huffman_table ="
+<< (unsigned)b.load_huffman_table[0]<< ","
+<< (unsigned)b.load_huffman_table[1]<< ","
+<< std::endl
+ ;
+
+ for (size_t i(0); i< 2; ++i) {
+ unsigned sum(0);
+ os<< " .huffman_table["<< i<< "].num_dc_codes = ";
+ for (size_t j(0); j< sizeof(b.huffman_table[i].num_dc_codes); ++j) {
+ if (j and (j % 12) == 0)
+ os<< std::endl<< " ";
+ os<< std::hex<< std::setfill('0')<< std::setw(2)
+<< (unsigned)b.huffman_table[i].num_dc_codes[j]<< ","
+<< std::dec
+ ;
+ sum += b.huffman_table[i].num_dc_codes[j];
+ }
+ os<< " (sum = "<< sum<< ")"<< std::endl;
+
+ os<< " .huffman_table["<< i<< "].dc_values = ";
+ for (size_t j(0); j< sizeof(b.huffman_table[i].dc_values); ++j) {
+ if (j and (j % 12) == 0)
+ os<< std::endl<< " ";
+ os<< std::hex<< std::setfill('0')<< std::setw(2)
+<< (unsigned)b.huffman_table[i].dc_values[j]<< ","
+<< std::dec
+ ;
+ }
+ os<< std::endl;
+
+ sum = 0;
+ os<< " .huffman_table["<< i<< "].num_ac_codes = ";
+ for (size_t j(0); j< sizeof(b.huffman_table[i].num_ac_codes); ++j) {
+ if (j and (j % 12) == 0)
+ os<< std::endl<< " ";
+ os<< std::hex<< std::setfill('0')<< std::setw(2)
+<< (unsigned)b.huffman_table[i].num_ac_codes[j]<< ","
+<< std::dec
+ ;
+ sum += b.huffman_table[i].num_ac_codes[j];
+ }
+ os<< " (sum = "<< sum<< ")"<< std::endl;
+
+ os<< " .huffman_table["<< i<< "].ac_values = ";
+ for (size_t j(0); j< sizeof(b.huffman_table[i].ac_values); ++j) {
+ if (j and (j % 12) == 0)
+ os<< std::endl<< " ";
+ os<< std::hex<< std::setfill('0')<< std::setw(2)
+<< (unsigned)b.huffman_table[i].ac_values[j]<< ","
+<< std::dec
+ ;
+ }
+ os<< std::endl;
+ }
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAHuffmanTableBufferJPEGBaseline* b)
+{
+ os<< *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncSliceParameterBufferJPEG& b)
+{
+ os<< "VAEncSliceParameterBufferJPEG ("<< &b<< ")"<< std::endl
+<< " .restart_interval = "<< b.restart_interval
+<< std::endl
+
+<< " .num_components = "<< b.num_components
+<< std::endl
+ ;
+
+ for (size_t i(0); i< 4; ++i) {
+ os<< " .components["<< i<< "]"<< std::endl
+<< " .component_selector ="
+<< (unsigned)b.components[i].component_selector
+<< std::endl
+
+<< " .dc_table_selector ="
+<< (unsigned)b.components[i].dc_table_selector
+<< std::endl
+
+<< " .ac_table_selector ="
+<< (unsigned)b.components[i].ac_table_selector
+<< std::endl
+ ;
+ }
+
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncSliceParameterBufferJPEG* b)
+{
+ os<< *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncPackedHeaderParameterBuffer& b)
+{
+ os<< "VAEncPackedHeaderParameterBuffer ("<< &b<< ")"<< std::endl
+<< " .type = "<< b.type
+<< std::endl
+<< " .bit_length = "<< b.bit_length
+<< std::endl
+<< " .has_emulation_bytes = "<< (unsigned)b.has_emulation_bytes
+<< std::endl
+ ;
+
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAEncPackedHeaderParameterBuffer* b)
+{
+ os<< *b;
+ return os;
+}
+
+inline std::ostream&
+operator<<(std::ostream& os, const VAImage& image)
+{
+ os<< "VAImage ("<< &image<< ")"
+<< std::dec<< std::endl
+<< " id : "<< image.image_id
+<< std::endl
+<< " fourcc :"
+<< std::string(reinterpret_cast<const char*>(&image.format.fourcc), 4)
+<< std::endl
+<< " size : "<< image.width<< "x"<< image.height
+<< std::endl
+<< " planes : "<< image.num_planes
+<< std::endl
+<< " offsets :"
+<< "{"
+<< image.offsets[0]<< ","
+<< image.offsets[1]<< ","
+<< image.offsets[2]
+<< "}"
+<< std::endl
+<< " pitches :"
+<< "{"
+<< image.pitches[0]<< ","
+<< image.pitches[1]<< ","
+<< image.pitches[2]
+<< "}"
+<< std::endl
+<< " bpp : "<< image.format.bits_per_pixel
+<< std::endl
+<< " depth : "<< image.format.depth
+<< std::endl
+<< " byteorder: "<< image.format.byte_order
+<< std::endl
+<< " rgba mask:"
+<< "{"
+<< image.format.red_mask<< ","
+<< image.format.green_mask<< ","
+<< image.format.blue_mask<< ","
+<< image.format.alpha_mask
+<< "}"
+<< std::endl
+<< " buffer id: "<< image.buf
+<< std::endl
+<< " data size: "<< image.data_size
+ ;
+ return os;
+}
+
+#endif // I965_STREAMABLE_H
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 5915852c0f4b..d09f31d859b1 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -27,6 +27,7 @@
#include "test.h"
#include "i965_internal_decl.h"
+#include "i965_streamable.h"
#include<string>
#include<vector>
U. Artie Eoff
2016-09-26 20:11:48 UTC
Permalink
Add JPEG encode tests that encode raw I420 and NV12 data
at quality 100 and then decodes them to verify proper
encoding.

Currently, the 7680x4320 I420 test fails because ~40-60
Y-values (i.e. plane 0) in each line from the decoded
bitstream are off by more than 2 of the original raw
I420 values. It is not clear why only this resolution
exhibits this problem.

v2: don't create any input data in test fixture if
jpeg encoding is not supported.

Signed-off-by: U. Artie Eoff <***@intel.com>
---
test/Makefile.am | 1 +
test/i965_jpeg_encode_test.cpp | 699 +++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 198 +++++++++++-
test/i965_test_fixture.h | 1 +
4 files changed, 895 insertions(+), 4 deletions(-)
create mode 100644 test/i965_jpeg_encode_test.cpp

diff --git a/test/Makefile.am b/test/Makefile.am
index 2e9edda648a4..99560f8d8a54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -57,6 +57,7 @@ test_i965_drv_video_SOURCES = \
i965_jpeg_test_data.cpp \
i965_test_fixture.cpp \
i965_jpeg_decode_test.cpp \
+ i965_jpeg_encode_test.cpp \
object_heap_test.cpp \
test_main.cpp \
$(NULL)
diff --git a/test/i965_jpeg_encode_test.cpp b/test/i965_jpeg_encode_test.cpp
new file mode 100644
index 000000000000..08d80c4f75b7
--- /dev/null
+++ b/test/i965_jpeg_encode_test.cpp
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+#include "test_utils.h"
+
+#include <algorithm>
+#include <cstring>
+#include <fstream>
+#include <memory>
+#include <sstream>
+#include <tuple>
+
+namespace JPEG {
+namespace Encode {
+
+class JPEGEncodeTest
+ : public I965TestFixture
+{
+public:
+ JPEGEncodeTest()
+ : I965TestFixture()
+ , config(VA_INVALID_ID) // invalid
+ , context(VA_INVALID_ID) // invalid
+ { }
+
+protected:
+ virtual void TearDown()
+ {
+ if (context != VA_INVALID_ID) {
+ destroyContext(context);
+ context = VA_INVALID_ID;
+ }
+
+ if (config != VA_INVALID_ID) {
+ destroyConfig(config);
+ config = VA_INVALID_ID;
+ }
+
+ I965TestFixture::TearDown();
+ }
+
+ VAConfigID config;
+ VAContextID context;
+};
+
+TEST_F(JPEGEncodeTest, Entrypoint)
+{
+ ConfigAttribs attributes;
+ struct i965_driver_data *i965(*this);
+
+ ASSERT_PTR(i965);
+
+ if (HAS_JPEG_ENCODING(i965)) {
+ config = createConfig(profile, entrypoint, attributes);
+ } else {
+ VAStatus status = i965_CreateConfig(
+ *this, profile, entrypoint, attributes.data(), attributes.size(),
+ &config);
+ EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT, status);
+ EXPECT_INVALID_ID(config);
+ }
+}
+
+class TestInputCreator
+{
+public:
+ typedef std::shared_ptr<TestInputCreator> Shared;
+ typedef std::shared_ptr<const TestInputCreator> SharedConst;
+
+ TestInput::Shared create(const unsigned fourcc) const
+ {
+ const std::array<unsigned, 2> res = getResolution();
+
+ TestInput::Shared input(new TestInput(fourcc, res[0], res[1]));
+ ByteData& bytes = input->bytes;
+
+ RandomValueGenerator<uint8_t> rg(0x00, 0xff);
+ for (size_t i(0); i < input->planes; ++i)
+ std::generate_n(
+ std::back_inserter(bytes), input->sizes[i],
+ [&rg]{ return rg(); });
+ return input;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator& t)
+ {
+ t.repr(os);
+ return os;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::Shared& t)
+ {
+ return os << *t;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::SharedConst& t)
+ {
+ return os << *t;
+ }
+
+protected:
+ virtual std::array<unsigned, 2> getResolution() const = 0;
+ virtual void repr(std::ostream& os) const = 0;
+};
+
+template <typename T>
+const std::string toString(const T& t)
+{
+ std::ostringstream os;
+ os << t;
+ return os.str();
+}
+
+const TestInput::Shared NV12toI420(const TestInput::SharedConst& nv12)
+{
+ TestInput::Shared i420(
+ new TestInput(VA_FOURCC_I420, nv12->width(), nv12->height()));
+
+ i420->bytes = nv12->bytes;
+
+ size_t i(0);
+ auto predicate = [&i](const ByteData::value_type&) {
+ bool isu = ((i % 2) == 0) or (i == 0);
+ ++i;
+ return isu;
+ };
+
+ std::stable_partition(
+ i420->bytes.begin() + i420->offsets[1],
+ i420->bytes.end(), predicate);
+
+ return i420;
+}
+
+#define ASSERT_NO_FAILURE(statement) \
+ statement; \
+ ASSERT_FALSE(HasFailure());
+
+class JPEGEncodeInputTest
+ : public JPEGEncodeTest
+ , public ::testing::WithParamInterface<
+ std::tuple<TestInputCreator::SharedConst, const char*> >
+{
+public:
+ JPEGEncodeInputTest()
+ : JPEGEncodeTest::JPEGEncodeTest()
+ , surfaces() // empty
+ , coded(VA_INVALID_ID) // invalid
+ , renderBuffers() // empty
+ , input() // invalid
+ , output() // empty
+ { }
+
+protected:
+ virtual void SetUp()
+ {
+ JPEGEncodeTest::SetUp();
+
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965))
+ return;
+
+ TestInputCreator::SharedConst creator;
+ std::string sFourcc;
+ std::tie(creator, sFourcc) = GetParam();
+
+ ASSERT_PTR(creator.get()) << "Invalid test input creator parameter";
+
+ ASSERT_EQ(4u, sFourcc.size())
+ << "Invalid fourcc parameter '" << sFourcc << "'";
+
+ unsigned fourcc = VA_FOURCC(
+ sFourcc[0], sFourcc[1], sFourcc[2], sFourcc[3]);
+
+ input = creator->create(fourcc);
+
+ ASSERT_PTR(input.get())
+ << "Unhandled fourcc parameter '" << sFourcc << "'"
+ << " = 0x" << std::hex << fourcc << std::dec;
+
+ ASSERT_EQ(fourcc, input->fourcc);
+
+ RecordProperty("test_input", toString(*input));
+ }
+
+ virtual void TearDown()
+ {
+ for (auto id : renderBuffers) {
+ if (id != VA_INVALID_ID) {
+ destroyBuffer(id);
+ }
+ }
+ renderBuffers.clear();
+
+ if (coded != VA_INVALID_ID) {
+ destroyBuffer(coded);
+ coded = VA_INVALID_ID;
+ }
+
+ if (not surfaces.empty()) {
+ destroySurfaces(surfaces);
+ surfaces.clear();
+ }
+
+ if (std::get<0>(GetParam()).get())
+ std::cout << "Creator: " << std::get<0>(GetParam()) << std::endl;
+ if (input.get())
+ std::cout << "Input : " << input << std::endl;
+
+ JPEGEncodeTest::TearDown();
+ }
+
+ void Encode()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ ASSERT_NO_FAILURE(
+ beginPicture(context, surfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(context, renderBuffers.data(), renderBuffers.size()));
+ ASSERT_NO_FAILURE(
+ endPicture(context));
+ ASSERT_NO_FAILURE(
+ syncSurface(surfaces.front()));
+ ASSERT_NO_FAILURE(
+ VACodedBufferSegment *segment =
+ mapBuffer<VACodedBufferSegment>(coded));
+
+ EXPECT_FALSE(segment->status & VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
+ << "segment->size = " << segment->size;
+ EXPECT_PTR_NULL(segment->next);
+
+ // copy segment buffer to output while stripping the packed header data
+ const size_t headerSize(1);
+ output.resize(segment->size - headerSize, 0x0);
+ std::memcpy(
+ output.data(),
+ reinterpret_cast<uint8_t *>(segment->buf) + headerSize,
+ segment->size - headerSize);
+
+ unmapBuffer(coded);
+
+ // EOI JPEG Marker
+ ASSERT_GE(output.size(), 2u);
+ EXPECT_TRUE(
+ unsigned(0xff) == unsigned(*(output.end() - 2)) and
+ unsigned(0xd9) == unsigned(output.back()))
+ << "Invalid JPEG EOI Marker";
+ }
+
+ void SetUpSurfaces()
+ {
+ SurfaceAttribs attributes(1);
+ attributes.front().flags = VA_SURFACE_ATTRIB_SETTABLE;
+ attributes.front().type = VASurfaceAttribPixelFormat;
+ attributes.front().value.type = VAGenericValueTypeInteger;
+ attributes.front().value.value.i = input->fourcc;
+ surfaces = createSurfaces(input->width(), input->height(),
+ input->format, 1, attributes);
+ }
+
+ void CopyInputToSurface()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ VAImage image;
+ deriveImage(surfaces.front(), image);
+ if (HasFailure())
+ return;
+
+ SCOPED_TRACE(::testing::Message() << std::endl << image);
+
+ RecordProperty("input_image", toString(image));
+
+ EXPECT_EQ(input->planes, image.num_planes);
+ EXPECT_GT(image.data_size, 0u);
+ EXPECT_EQ(input->width(), image.width);
+ EXPECT_EQ(input->height(), image.height);
+ if (HasFailure()) {
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ return;
+ }
+
+ uint8_t *data = mapBuffer<uint8_t>(image.buf);
+ if (HasFailure()) {
+ destroyImage(image);
+ return;
+ }
+
+ std::memset(data, 0, image.data_size);
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = input->widths[i];
+ size_t h = input->heights[i];
+
+ EXPECT_GE(image.pitches[i], w);
+ if (HasFailure())
+ break;
+
+ const ByteData::value_type *source = input->plane(i);
+ uint8_t *dest = data + image.offsets[i];
+ for (size_t r(0); r < h; ++r) {
+ std::memcpy(dest, source, w);
+ source += w;
+ dest += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ }
+
+ void SetUpConfig()
+ {
+ ASSERT_INVALID_ID(config);
+ ConfigAttribs attributes(
+ 1, {type:VAConfigAttribRTFormat, value:input->format});
+ config = createConfig(profile, entrypoint, attributes);
+ }
+
+ void SetUpContext()
+ {
+ ASSERT_INVALID_ID(context);
+ context = createContext(config, input->width(),
+ input->height(), 0, surfaces);
+ }
+
+ void SetUpCodedBuffer()
+ {
+ ASSERT_INVALID_ID(coded);
+ unsigned size =
+ std::accumulate(input->sizes.begin(), input->sizes.end(), 8192u);
+ size *= input->planes;
+ coded = createBuffer(context, VAEncCodedBufferType, size);
+ }
+
+ void SetUpPicture()
+ {
+ input->picture.coded_buf = coded;
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPictureParameterBufferType,
+ sizeof(PictureParameter), 1, &input->picture));
+ }
+
+ void SetUpIQMatrix()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAQMatrixBufferType, sizeof(IQMatrix),
+ 1, &input->matrix));
+ }
+
+ void SetUpHuffmanTables()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAHuffmanTableBufferType,
+ sizeof(HuffmanTable), 1, &input->huffman));
+ }
+
+ void SetUpSlice()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAEncSliceParameterBufferType,
+ sizeof(SliceParameter), 1, &input->slice));
+ }
+
+ void SetUpHeader()
+ {
+ /*
+ * The driver expects a packed JPEG header which it prepends to the
+ * coded buffer segment output. The driver does not appear to inspect
+ * this header, however. So we'll just create a 1-byte packed header
+ * since we really don't care if it contains a "valid" JPEG header.
+ */
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderParameterBufferType,
+ sizeof(VAEncPackedHeaderParameterBuffer)));
+ if (HasFailure())
+ return;
+
+ VAEncPackedHeaderParameterBuffer *packed =
+ mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back());
+ if (HasFailure())
+ return;
+
+ std::memset(packed, 0, sizeof(*packed));
+ packed->type = VAEncPackedHeaderRawData;
+ packed->bit_length = 8;
+ packed->has_emulation_bytes = 0;
+
+ unmapBuffer(renderBuffers.back());
+
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderDataBufferType, 1));
+ }
+
+ Surfaces surfaces;
+ VABufferID coded;
+ Buffers renderBuffers;
+ TestInput::Shared input;
+ ByteData output;
+
+ void VerifyOutput()
+ {
+ // VerifyOutput only supports VA_FOURCC_IMC3 output, currently
+ ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input->fourcc_output);
+ TestInput::SharedConst expect = input;
+ if (input->fourcc == VA_FOURCC_NV12)
+ expect = NV12toI420(input);
+
+ ::JPEG::Decode::PictureData::SharedConst pd =
+ ::JPEG::Decode::PictureData::make(
+ input->fourcc_output, output, input->width(), input->height());
+
+ ASSERT_NO_FAILURE(
+ Surfaces osurfaces = createSurfaces(
+ pd->pparam.picture_width, pd->pparam.picture_height,
+ pd->format));;
+
+ ConfigAttribs attribs(
+ 1, {type:VAConfigAttribRTFormat, value:pd->format});
+ ASSERT_NO_FAILURE(
+ VAConfigID oconfig = createConfig(
+ ::JPEG::profile, ::JPEG::Decode::entrypoint, attribs));
+
+ ASSERT_NO_FAILURE(
+ VAContextID ocontext = createContext(
+ oconfig, pd->pparam.picture_width, pd->pparam.picture_height,
+ 0, osurfaces));
+
+ Buffers buffers;
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceDataBufferType, pd->sparam.slice_data_size,
+ 1, pd->slice.data())));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceParameterBufferType, sizeof(pd->sparam),
+ 1, &pd->sparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,VAPictureParameterBufferType, sizeof(pd->pparam),
+ 1, &pd->pparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAIQMatrixBufferType, sizeof(pd->iqmatrix),
+ 1, &pd->iqmatrix)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAHuffmanTableBufferType, sizeof(pd->huffman),
+ 1, &pd->huffman)));
+
+ ASSERT_NO_FAILURE(beginPicture(ocontext, osurfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(ocontext, buffers.data(), buffers.size()));
+ ASSERT_NO_FAILURE(endPicture(ocontext));
+ ASSERT_NO_FAILURE(syncSurface(osurfaces.front()));
+
+ VAImage image;
+ ASSERT_NO_FAILURE(deriveImage(osurfaces.front(), image));
+ ASSERT_NO_FAILURE(uint8_t *data = mapBuffer<uint8_t>(image.buf));
+
+ auto isClose = [](const uint8_t& a, const uint8_t& b) {
+ return std::abs(int(a)-int(b)) <= 2;
+ };
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = expect->widths[i];
+ size_t h = expect->heights[i];
+
+ const ByteData::value_type *source = expect->plane(i);
+ const uint8_t *result = data + image.offsets[i];
+ ASSERT_GE(image.pitches[i], w);
+ for (size_t r(0); r < h; ++r) {
+ EXPECT_TRUE(std::equal(result, result + w, source, isClose))
+ << "Byte(s) mismatch in plane " << i << " row " << r;
+ source += w;
+ result += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+
+ for (auto id : buffers)
+ destroyBuffer(id);
+
+ destroyImage(image);
+ destroyContext(ocontext);
+ destroyConfig(oconfig);
+ destroySurfaces(osurfaces);
+ }
+};
+
+TEST_P(JPEGEncodeInputTest, Full)
+{
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965)) {
+ RecordProperty("skipped", true);
+ std::cout << "[ SKIPPED ] " << getFullTestName()
+ << " is unsupported on this hardware" << std::endl;
+ return;
+ }
+
+ ASSERT_NO_FAILURE(SetUpSurfaces());
+ ASSERT_NO_FAILURE(SetUpConfig());
+ ASSERT_NO_FAILURE(SetUpContext());
+ ASSERT_NO_FAILURE(SetUpCodedBuffer());
+ ASSERT_NO_FAILURE(SetUpPicture());
+ ASSERT_NO_FAILURE(SetUpIQMatrix());
+ ASSERT_NO_FAILURE(SetUpHuffmanTables());
+ ASSERT_NO_FAILURE(SetUpSlice());
+ ASSERT_NO_FAILURE(SetUpHeader());
+ ASSERT_NO_FAILURE(CopyInputToSurface());
+ ASSERT_NO_FAILURE(Encode());
+
+ VerifyOutput();
+}
+
+class RandomSizeCreator
+ : public TestInputCreator
+{
+protected:
+ std::array<unsigned, 2> getResolution() const
+ {
+ static RandomValueGenerator<unsigned> rg(1, 769);
+ return {rg(), rg()};
+ }
+ void repr(std::ostream& os) const { os << "Random Size"; }
+};
+
+INSTANTIATE_TEST_CASE_P(
+ Random, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(
+ std::vector<TestInputCreator::SharedConst>(
+ 5, TestInputCreator::SharedConst(new RandomSizeCreator))),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+class FixedSizeCreator
+ : public TestInputCreator
+{
+public:
+ FixedSizeCreator(const std::array<unsigned, 2>& resolution)
+ : res(resolution)
+ { }
+
+protected:
+ std::array<unsigned, 2> getResolution() const { return res; }
+ void repr(std::ostream& os) const
+ {
+ os << "Fixed Size " << res[0] << "x" << res[1];
+ }
+
+private:
+ const std::array<unsigned, 2> res;
+};
+
+typedef std::vector<TestInputCreator::SharedConst> InputCreators;
+
+InputCreators generateCommonInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({800, 600})), /* SVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 600})), /* WSVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 768})), /* XGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1152, 864})), /* XGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 720})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 768})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 800})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 1024})), /* SXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1360, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1366, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1440, 900})), /* WXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 900})), /* HD+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 1200})), /* UXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1680, 1050})), /* WSXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1080})), /* FHD */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1200})), /* WUXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1440})), /* WQHD */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1600})), /* WQXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({3640, 2160})), /* UHD (4K) */
+ TestInputCreator::Shared(new FixedSizeCreator({7680, 4320})), /* UHD (8K) */
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Common, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateCommonInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+INSTANTIATE_TEST_CASE_P(
+ Big, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::Values(
+ TestInputCreator::Shared(new FixedSizeCreator({8192, 8192}))
+ ),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateEdgeCaseInputs()
+{
+ std::vector<TestInputCreator::SharedConst> result;
+ for (unsigned i(64); i <= 512; i += 64) {
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i-1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i-1})));
+ }
+
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 1})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 2})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({2, 1})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({2, 2})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 462})));
+
+ return result;
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Edge, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateEdgeCaseInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateMiscInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({150, 75})),
+ TestInputCreator::Shared(new FixedSizeCreator({10, 10})),
+ TestInputCreator::Shared(new FixedSizeCreator({385, 610})),
+ TestInputCreator::Shared(new FixedSizeCreator({1245, 1281})),
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Misc, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateMiscInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+} // namespace Encode
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index d52f58233cc5..490ec941feb5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -25,6 +25,8 @@
#ifndef I965_JPEG_TEST_DATA_H
#define I965_JPEG_TEST_DATA_H

+#include "i965_test_fixture.h"
+
#include <array>
#include <iostream>
#include <map>
@@ -183,6 +185,18 @@ namespace Decode {
const HuffmanTable& huffman = defaultHuffmanTable,
const IQMatrix& iqmatrix = defaultIQMatrix)
{
+ return make(fourcc, slice, W, H, sparam, pparam, huffman, iqmatrix);
+ }
+
+ static SharedConst make(
+ const unsigned fourcc,
+ const ByteData& slice,
+ const unsigned w, const unsigned h,
+ const SliceParameter& sparam = defaultSliceParameter,
+ const PictureParameter& pparam = defaultPictureParameter,
+ const HuffmanTable& huffman = defaultHuffmanTable,
+ const IQMatrix& iqmatrix = defaultIQMatrix)
+ {
Shared pd(
new PictureData {
slice: slice,
@@ -196,8 +210,8 @@ namespace Decode {
);

pd->sparam.slice_data_size = slice.size();
- pd->pparam.picture_width = W;
- pd->pparam.picture_height = H;
+ pd->pparam.picture_width = w;
+ pd->pparam.picture_height = h;

switch(fourcc)
{
@@ -232,8 +246,8 @@ namespace Decode {
/* Calculate num_mcus */
int hfactor = pd->pparam.components[0].h_sampling_factor << 3;
int vfactor = pd->pparam.components[0].v_sampling_factor << 3;
- int wmcu = (W + hfactor - 1) / hfactor;
- int hmcu = (H + vfactor - 1) / vfactor;
+ int wmcu = (w + hfactor - 1) / hfactor;
+ int hmcu = (h + vfactor - 1) / vfactor;
pd->sparam.num_mcus = wmcu * hmcu;

return pd;
@@ -321,4 +335,180 @@ namespace Decode {
} // namespace Decode
} // namespace JPEG

+namespace JPEG {
+namespace Encode {
+ typedef VAQMatrixBufferJPEG IQMatrix;
+ typedef VAHuffmanTableBufferJPEGBaseline HuffmanTable;
+ typedef VAEncPictureParameterBufferJPEG PictureParameter;
+ typedef VAEncSliceParameterBufferJPEG SliceParameter;
+
+ static const VAEntrypoint entrypoint = VAEntrypointEncPicture;
+
+ static const IQMatrix defaultIQMatrix = { /* Quality 50 */
+ load_lum_quantiser_matrix: 1,
+ load_chroma_quantiser_matrix: 1,
+ lum_quantiser_matrix: {
+ 0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
+ 0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
+ 0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
+ 0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
+ 0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
+ 0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
+ 0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
+ 0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
+ },
+ chroma_quantiser_matrix: {
+ 0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
+ 0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ },
+ };
+
+ static const HuffmanTable defaultHuffmanTable =
+ ::JPEG::Decode::defaultHuffmanTable;
+
+ static const PictureParameter defaultPictureParameter = {
+ reconstructed_picture: VA_INVALID_ID,
+ picture_width: 10,
+ picture_height: 10,
+ coded_buf: VA_INVALID_ID,
+ pic_flags: {value: 0x00100},
+ sample_bit_depth: 8,
+ num_scan: 1,
+ num_components: 3,
+ component_id: {0, 1, 2, 0},
+ quantiser_table_selector: {0, 1, 1, 0},
+ quality: 100,
+ };
+
+ static const SliceParameter defaultSliceParameter = {
+ restart_interval: 0,
+ num_components: 3,
+ /* component_selector, dc_table_selector, ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}},
+ };
+
+ class TestInput
+ {
+ public:
+ typedef std::shared_ptr<TestInput> Shared;
+ typedef std::shared_ptr<TestInput> SharedConst;
+
+ TestInput(const unsigned fourcc, const unsigned w, const unsigned h)
+ : bytes() // caller must fill this in after instantiation
+ , picture(defaultPictureParameter)
+ , matrix(defaultIQMatrix)
+ , huffman(defaultHuffmanTable)
+ , slice(defaultSliceParameter)
+ , fourcc(fourcc)
+ , fourcc_output(fourcc)
+ , format(0)
+ , planes(0)
+ , widths{0,0,0}
+ , heights{0,0,0}
+ , offsets{0,0,0}
+ , sizes{0,0,0}
+ {
+ picture.picture_width = ALIGN(w,2);
+ picture.picture_height = ALIGN(h,2);
+
+ switch(fourcc) {
+ case VA_FOURCC('I', '4', '2', '0'):
+ planes = 3;
+ widths = {
+ w +( w & 1),
+ (w + 1) >> 1,
+ (w + 1) >> 1
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ (h + 1) >> 1
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ case VA_FOURCC_NV12:
+ planes = 2;
+ widths = {
+ w + (w & 1),
+ w + (w & 1),
+ 0
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ 0
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ default:
+ return;
+ }
+
+ for (size_t i(0); i < planes; ++i) {
+ sizes[i] = widths[i] * heights[i];
+ }
+
+ for (size_t i(1); i < planes; ++i) {
+ offsets[i] = sizes[i - 1];
+ offsets[i] += offsets[i - 1];
+ }
+ }
+
+ const unsigned width() const
+ {
+ return picture.picture_width;
+ }
+
+ const unsigned height() const
+ {
+ return picture.picture_height;
+ }
+
+ const uint8_t* plane(const size_t i) const
+ {
+ return bytes.data() + offsets[i];
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const TestInput& t)
+ {
+ return os
+ << std::string((char*)(&t.fourcc), 4)
+ << " " << t.width() << "x" << t.height()
+ << " " << t.widths << " " << t.heights
+ << " " << t.sizes << " " << t.offsets
+ ;
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const Shared& t)
+ {
+ return os << *t;
+ }
+
+ ByteData bytes;
+ PictureParameter picture;
+ IQMatrix matrix;
+ HuffmanTable huffman;
+ SliceParameter slice;
+ unsigned fourcc;
+ unsigned fourcc_output;
+ unsigned format;
+ size_t planes;
+ std::array<size_t, 3> widths;
+ std::array<size_t, 3> heights;
+ std::array<size_t, 3> offsets;
+ std::array<size_t, 3> sizes;
+ };
+
+
+} // namespace Encode
+} // namespace JPEG
+
#endif
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 54d85d223789..c805b359e19f 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -35,6 +35,7 @@
typedef std::vector<VASurfaceID> Surfaces;
typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
+typedef std::vector<VABufferID> Buffers;

/**
* This test fixture handles initialization and termination of the i965 driver
--
2.4.11
Zhao Yakui
2016-09-27 01:46:22 UTC
Permalink
Post by U. Artie Eoff
Add JPEG encode tests that encode raw I420 and NV12 data
at quality 100 and then decodes them to verify proper
encoding.
Currently, the 7680x4320 I420 test fails because ~40-60
Y-values (i.e. plane 0) in each line from the decoded
bitstream are off by more than 2 of the original raw
I420 values. It is not clear why only this resolution
exhibits this problem.
v2: don't create any input data in test fixture if
jpeg encoding is not supported.
This looks good to me.

Add: Reviewed-by: Zhao Yakui <***@intel.com>

Thanks
Post by U. Artie Eoff
---
test/Makefile.am | 1 +
test/i965_jpeg_encode_test.cpp | 699 +++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 198 +++++++++++-
test/i965_test_fixture.h | 1 +
4 files changed, 895 insertions(+), 4 deletions(-)
create mode 100644 test/i965_jpeg_encode_test.cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index 2e9edda648a4..99560f8d8a54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -57,6 +57,7 @@ test_i965_drv_video_SOURCES = \
i965_jpeg_test_data.cpp \
i965_test_fixture.cpp \
i965_jpeg_decode_test.cpp \
+ i965_jpeg_encode_test.cpp \
object_heap_test.cpp \
test_main.cpp \
$(NULL)
diff --git a/test/i965_jpeg_encode_test.cpp b/test/i965_jpeg_encode_test.cpp
new file mode 100644
index 000000000000..08d80c4f75b7
--- /dev/null
+++ b/test/i965_jpeg_encode_test.cpp
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+#include "test_utils.h"
+
+#include<algorithm>
+#include<cstring>
+#include<fstream>
+#include<memory>
+#include<sstream>
+#include<tuple>
+
+namespace JPEG {
+namespace Encode {
+
+class JPEGEncodeTest
+ : public I965TestFixture
+{
+ JPEGEncodeTest()
+ : I965TestFixture()
+ , config(VA_INVALID_ID) // invalid
+ , context(VA_INVALID_ID) // invalid
+ { }
+
+ virtual void TearDown()
+ {
+ if (context != VA_INVALID_ID) {
+ destroyContext(context);
+ context = VA_INVALID_ID;
+ }
+
+ if (config != VA_INVALID_ID) {
+ destroyConfig(config);
+ config = VA_INVALID_ID;
+ }
+
+ I965TestFixture::TearDown();
+ }
+
+ VAConfigID config;
+ VAContextID context;
+};
+
+TEST_F(JPEGEncodeTest, Entrypoint)
+{
+ ConfigAttribs attributes;
+ struct i965_driver_data *i965(*this);
+
+ ASSERT_PTR(i965);
+
+ if (HAS_JPEG_ENCODING(i965)) {
+ config = createConfig(profile, entrypoint, attributes);
+ } else {
+ VAStatus status = i965_CreateConfig(
+ *this, profile, entrypoint, attributes.data(), attributes.size(),
+&config);
+ EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT, status);
+ EXPECT_INVALID_ID(config);
+ }
+}
+
+class TestInputCreator
+{
+ typedef std::shared_ptr<TestInputCreator> Shared;
+ typedef std::shared_ptr<const TestInputCreator> SharedConst;
+
+ TestInput::Shared create(const unsigned fourcc) const
+ {
+ const std::array<unsigned, 2> res = getResolution();
+
+ TestInput::Shared input(new TestInput(fourcc, res[0], res[1]));
+ ByteData& bytes = input->bytes;
+
+ RandomValueGenerator<uint8_t> rg(0x00, 0xff);
+ for (size_t i(0); i< input->planes; ++i)
+ std::generate_n(
+ std::back_inserter(bytes), input->sizes[i],
+ [&rg]{ return rg(); });
+ return input;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator& t)
+ {
+ t.repr(os);
+ return os;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::Shared& t)
+ {
+ return os<< *t;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::SharedConst& t)
+ {
+ return os<< *t;
+ }
+
+ virtual std::array<unsigned, 2> getResolution() const = 0;
+ virtual void repr(std::ostream& os) const = 0;
+};
+
+template<typename T>
+const std::string toString(const T& t)
+{
+ std::ostringstream os;
+ os<< t;
+ return os.str();
+}
+
+const TestInput::Shared NV12toI420(const TestInput::SharedConst& nv12)
+{
+ TestInput::Shared i420(
+ new TestInput(VA_FOURCC_I420, nv12->width(), nv12->height()));
+
+ i420->bytes = nv12->bytes;
+
+ size_t i(0);
+ auto predicate = [&i](const ByteData::value_type&) {
+ bool isu = ((i % 2) == 0) or (i == 0);
+ ++i;
+ return isu;
+ };
+
+ std::stable_partition(
+ i420->bytes.begin() + i420->offsets[1],
+ i420->bytes.end(), predicate);
+
+ return i420;
+}
+
+#define ASSERT_NO_FAILURE(statement) \
+ statement; \
+ ASSERT_FALSE(HasFailure());
+
+class JPEGEncodeInputTest
+ : public JPEGEncodeTest
+ , public ::testing::WithParamInterface<
+ std::tuple<TestInputCreator::SharedConst, const char*> >
+{
+ JPEGEncodeInputTest()
+ : JPEGEncodeTest::JPEGEncodeTest()
+ , surfaces() // empty
+ , coded(VA_INVALID_ID) // invalid
+ , renderBuffers() // empty
+ , input() // invalid
+ , output() // empty
+ { }
+
+ virtual void SetUp()
+ {
+ JPEGEncodeTest::SetUp();
+
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965))
+ return;
+
+ TestInputCreator::SharedConst creator;
+ std::string sFourcc;
+ std::tie(creator, sFourcc) = GetParam();
+
+ ASSERT_PTR(creator.get())<< "Invalid test input creator parameter";
+
+ ASSERT_EQ(4u, sFourcc.size())
+<< "Invalid fourcc parameter '"<< sFourcc<< "'";
+
+ unsigned fourcc = VA_FOURCC(
+ sFourcc[0], sFourcc[1], sFourcc[2], sFourcc[3]);
+
+ input = creator->create(fourcc);
+
+ ASSERT_PTR(input.get())
+<< "Unhandled fourcc parameter '"<< sFourcc<< "'"
+<< " = 0x"<< std::hex<< fourcc<< std::dec;
+
+ ASSERT_EQ(fourcc, input->fourcc);
+
+ RecordProperty("test_input", toString(*input));
+ }
+
+ virtual void TearDown()
+ {
+ for (auto id : renderBuffers) {
+ if (id != VA_INVALID_ID) {
+ destroyBuffer(id);
+ }
+ }
+ renderBuffers.clear();
+
+ if (coded != VA_INVALID_ID) {
+ destroyBuffer(coded);
+ coded = VA_INVALID_ID;
+ }
+
+ if (not surfaces.empty()) {
+ destroySurfaces(surfaces);
+ surfaces.clear();
+ }
+
+ if (std::get<0>(GetParam()).get())
+ std::cout<< "Creator: "<< std::get<0>(GetParam())<< std::endl;
+ if (input.get())
+ std::cout<< "Input : "<< input<< std::endl;
+
+ JPEGEncodeTest::TearDown();
+ }
+
+ void Encode()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ ASSERT_NO_FAILURE(
+ beginPicture(context, surfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(context, renderBuffers.data(), renderBuffers.size()));
+ ASSERT_NO_FAILURE(
+ endPicture(context));
+ ASSERT_NO_FAILURE(
+ syncSurface(surfaces.front()));
+ ASSERT_NO_FAILURE(
+ VACodedBufferSegment *segment =
+ mapBuffer<VACodedBufferSegment>(coded));
+
+ EXPECT_FALSE(segment->status& VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
+<< "segment->size = "<< segment->size;
+ EXPECT_PTR_NULL(segment->next);
+
+ // copy segment buffer to output while stripping the packed header data
+ const size_t headerSize(1);
+ output.resize(segment->size - headerSize, 0x0);
+ std::memcpy(
+ output.data(),
+ reinterpret_cast<uint8_t *>(segment->buf) + headerSize,
+ segment->size - headerSize);
+
+ unmapBuffer(coded);
+
+ // EOI JPEG Marker
+ ASSERT_GE(output.size(), 2u);
+ EXPECT_TRUE(
+ unsigned(0xff) == unsigned(*(output.end() - 2)) and
+ unsigned(0xd9) == unsigned(output.back()))
+<< "Invalid JPEG EOI Marker";
+ }
+
+ void SetUpSurfaces()
+ {
+ SurfaceAttribs attributes(1);
+ attributes.front().flags = VA_SURFACE_ATTRIB_SETTABLE;
+ attributes.front().type = VASurfaceAttribPixelFormat;
+ attributes.front().value.type = VAGenericValueTypeInteger;
+ attributes.front().value.value.i = input->fourcc;
+ surfaces = createSurfaces(input->width(), input->height(),
+ input->format, 1, attributes);
+ }
+
+ void CopyInputToSurface()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ VAImage image;
+ deriveImage(surfaces.front(), image);
+ if (HasFailure())
+ return;
+
+ SCOPED_TRACE(::testing::Message()<< std::endl<< image);
+
+ RecordProperty("input_image", toString(image));
+
+ EXPECT_EQ(input->planes, image.num_planes);
+ EXPECT_GT(image.data_size, 0u);
+ EXPECT_EQ(input->width(), image.width);
+ EXPECT_EQ(input->height(), image.height);
+ if (HasFailure()) {
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ return;
+ }
+
+ uint8_t *data = mapBuffer<uint8_t>(image.buf);
+ if (HasFailure()) {
+ destroyImage(image);
+ return;
+ }
+
+ std::memset(data, 0, image.data_size);
+
+ for (size_t i(0); i< image.num_planes; ++i) {
+ size_t w = input->widths[i];
+ size_t h = input->heights[i];
+
+ EXPECT_GE(image.pitches[i], w);
+ if (HasFailure())
+ break;
+
+ const ByteData::value_type *source = input->plane(i);
+ uint8_t *dest = data + image.offsets[i];
+ for (size_t r(0); r< h; ++r) {
+ std::memcpy(dest, source, w);
+ source += w;
+ dest += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ }
+
+ void SetUpConfig()
+ {
+ ASSERT_INVALID_ID(config);
+ ConfigAttribs attributes(
+ 1, {type:VAConfigAttribRTFormat, value:input->format});
+ config = createConfig(profile, entrypoint, attributes);
+ }
+
+ void SetUpContext()
+ {
+ ASSERT_INVALID_ID(context);
+ context = createContext(config, input->width(),
+ input->height(), 0, surfaces);
+ }
+
+ void SetUpCodedBuffer()
+ {
+ ASSERT_INVALID_ID(coded);
+ unsigned size =
+ std::accumulate(input->sizes.begin(), input->sizes.end(), 8192u);
+ size *= input->planes;
+ coded = createBuffer(context, VAEncCodedBufferType, size);
+ }
+
+ void SetUpPicture()
+ {
+ input->picture.coded_buf = coded;
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPictureParameterBufferType,
+ sizeof(PictureParameter), 1,&input->picture));
+ }
+
+ void SetUpIQMatrix()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAQMatrixBufferType, sizeof(IQMatrix),
+ 1,&input->matrix));
+ }
+
+ void SetUpHuffmanTables()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAHuffmanTableBufferType,
+ sizeof(HuffmanTable), 1,&input->huffman));
+ }
+
+ void SetUpSlice()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAEncSliceParameterBufferType,
+ sizeof(SliceParameter), 1,&input->slice));
+ }
+
+ void SetUpHeader()
+ {
+ /*
+ * The driver expects a packed JPEG header which it prepends to the
+ * coded buffer segment output. The driver does not appear to inspect
+ * this header, however. So we'll just create a 1-byte packed header
+ * since we really don't care if it contains a "valid" JPEG header.
+ */
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderParameterBufferType,
+ sizeof(VAEncPackedHeaderParameterBuffer)));
+ if (HasFailure())
+ return;
+
+ VAEncPackedHeaderParameterBuffer *packed =
+ mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back());
+ if (HasFailure())
+ return;
+
+ std::memset(packed, 0, sizeof(*packed));
+ packed->type = VAEncPackedHeaderRawData;
+ packed->bit_length = 8;
+ packed->has_emulation_bytes = 0;
+
+ unmapBuffer(renderBuffers.back());
+
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderDataBufferType, 1));
+ }
+
+ Surfaces surfaces;
+ VABufferID coded;
+ Buffers renderBuffers;
+ TestInput::Shared input;
+ ByteData output;
+
+ void VerifyOutput()
+ {
+ // VerifyOutput only supports VA_FOURCC_IMC3 output, currently
+ ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input->fourcc_output);
+ TestInput::SharedConst expect = input;
+ if (input->fourcc == VA_FOURCC_NV12)
+ expect = NV12toI420(input);
+
+ ::JPEG::Decode::PictureData::SharedConst pd =
+ ::JPEG::Decode::PictureData::make(
+ input->fourcc_output, output, input->width(), input->height());
+
+ ASSERT_NO_FAILURE(
+ Surfaces osurfaces = createSurfaces(
+ pd->pparam.picture_width, pd->pparam.picture_height,
+ pd->format));;
+
+ ConfigAttribs attribs(
+ 1, {type:VAConfigAttribRTFormat, value:pd->format});
+ ASSERT_NO_FAILURE(
+ VAConfigID oconfig = createConfig(
+ ::JPEG::profile, ::JPEG::Decode::entrypoint, attribs));
+
+ ASSERT_NO_FAILURE(
+ VAContextID ocontext = createContext(
+ oconfig, pd->pparam.picture_width, pd->pparam.picture_height,
+ 0, osurfaces));
+
+ Buffers buffers;
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceDataBufferType, pd->sparam.slice_data_size,
+ 1, pd->slice.data())));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceParameterBufferType, sizeof(pd->sparam),
+ 1,&pd->sparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,VAPictureParameterBufferType, sizeof(pd->pparam),
+ 1,&pd->pparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAIQMatrixBufferType, sizeof(pd->iqmatrix),
+ 1,&pd->iqmatrix)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAHuffmanTableBufferType, sizeof(pd->huffman),
+ 1,&pd->huffman)));
+
+ ASSERT_NO_FAILURE(beginPicture(ocontext, osurfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(ocontext, buffers.data(), buffers.size()));
+ ASSERT_NO_FAILURE(endPicture(ocontext));
+ ASSERT_NO_FAILURE(syncSurface(osurfaces.front()));
+
+ VAImage image;
+ ASSERT_NO_FAILURE(deriveImage(osurfaces.front(), image));
+ ASSERT_NO_FAILURE(uint8_t *data = mapBuffer<uint8_t>(image.buf));
+
+ auto isClose = [](const uint8_t& a, const uint8_t& b) {
+ return std::abs(int(a)-int(b))<= 2;
+ };
+
+ for (size_t i(0); i< image.num_planes; ++i) {
+ size_t w = expect->widths[i];
+ size_t h = expect->heights[i];
+
+ const ByteData::value_type *source = expect->plane(i);
+ const uint8_t *result = data + image.offsets[i];
+ ASSERT_GE(image.pitches[i], w);
+ for (size_t r(0); r< h; ++r) {
+ EXPECT_TRUE(std::equal(result, result + w, source, isClose))
+<< "Byte(s) mismatch in plane "<< i<< " row "<< r;
+ source += w;
+ result += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+
+ for (auto id : buffers)
+ destroyBuffer(id);
+
+ destroyImage(image);
+ destroyContext(ocontext);
+ destroyConfig(oconfig);
+ destroySurfaces(osurfaces);
+ }
+};
+
+TEST_P(JPEGEncodeInputTest, Full)
+{
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965)) {
+ RecordProperty("skipped", true);
+ std::cout<< "[ SKIPPED ] "<< getFullTestName()
+<< " is unsupported on this hardware"<< std::endl;
+ return;
+ }
+
+ ASSERT_NO_FAILURE(SetUpSurfaces());
+ ASSERT_NO_FAILURE(SetUpConfig());
+ ASSERT_NO_FAILURE(SetUpContext());
+ ASSERT_NO_FAILURE(SetUpCodedBuffer());
+ ASSERT_NO_FAILURE(SetUpPicture());
+ ASSERT_NO_FAILURE(SetUpIQMatrix());
+ ASSERT_NO_FAILURE(SetUpHuffmanTables());
+ ASSERT_NO_FAILURE(SetUpSlice());
+ ASSERT_NO_FAILURE(SetUpHeader());
+ ASSERT_NO_FAILURE(CopyInputToSurface());
+ ASSERT_NO_FAILURE(Encode());
+
+ VerifyOutput();
+}
+
+class RandomSizeCreator
+ : public TestInputCreator
+{
+ std::array<unsigned, 2> getResolution() const
+ {
+ static RandomValueGenerator<unsigned> rg(1, 769);
+ return {rg(), rg()};
+ }
+ void repr(std::ostream& os) const { os<< "Random Size"; }
+};
+
+INSTANTIATE_TEST_CASE_P(
+ Random, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(
+ std::vector<TestInputCreator::SharedConst>(
+ 5, TestInputCreator::SharedConst(new RandomSizeCreator))),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+class FixedSizeCreator
+ : public TestInputCreator
+{
+ FixedSizeCreator(const std::array<unsigned, 2>& resolution)
+ : res(resolution)
+ { }
+
+ std::array<unsigned, 2> getResolution() const { return res; }
+ void repr(std::ostream& os) const
+ {
+ os<< "Fixed Size "<< res[0]<< "x"<< res[1];
+ }
+
+ const std::array<unsigned, 2> res;
+};
+
+typedef std::vector<TestInputCreator::SharedConst> InputCreators;
+
+InputCreators generateCommonInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({800, 600})), /* SVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 600})), /* WSVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 768})), /* XGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1152, 864})), /* XGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 720})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 768})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 800})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 1024})), /* SXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1360, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1366, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1440, 900})), /* WXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 900})), /* HD+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 1200})), /* UXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1680, 1050})), /* WSXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1080})), /* FHD */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1200})), /* WUXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1440})), /* WQHD */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1600})), /* WQXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({3640, 2160})), /* UHD (4K) */
+ TestInputCreator::Shared(new FixedSizeCreator({7680, 4320})), /* UHD (8K) */
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Common, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateCommonInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+INSTANTIATE_TEST_CASE_P(
+ Big, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::Values(
+ TestInputCreator::Shared(new FixedSizeCreator({8192, 8192}))
+ ),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateEdgeCaseInputs()
+{
+ std::vector<TestInputCreator::SharedConst> result;
+ for (unsigned i(64); i<= 512; i += 64) {
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i-1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i-1})));
+ }
+
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 1})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 2})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({2, 1})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({2, 2})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 462})));
+
+ return result;
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Edge, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateEdgeCaseInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateMiscInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({150, 75})),
+ TestInputCreator::Shared(new FixedSizeCreator({10, 10})),
+ TestInputCreator::Shared(new FixedSizeCreator({385, 610})),
+ TestInputCreator::Shared(new FixedSizeCreator({1245, 1281})),
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Misc, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateMiscInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+} // namespace Encode
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index d52f58233cc5..490ec941feb5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -25,6 +25,8 @@
#ifndef I965_JPEG_TEST_DATA_H
#define I965_JPEG_TEST_DATA_H
+#include "i965_test_fixture.h"
+
#include<array>
#include<iostream>
#include<map>
@@ -183,6 +185,18 @@ namespace Decode {
const HuffmanTable& huffman = defaultHuffmanTable,
const IQMatrix& iqmatrix = defaultIQMatrix)
{
+ return make(fourcc, slice, W, H, sparam, pparam, huffman, iqmatrix);
+ }
+
+ static SharedConst make(
+ const unsigned fourcc,
+ const ByteData& slice,
+ const unsigned w, const unsigned h,
+ const SliceParameter& sparam = defaultSliceParameter,
+ const PictureParameter& pparam = defaultPictureParameter,
+ const HuffmanTable& huffman = defaultHuffmanTable,
+ const IQMatrix& iqmatrix = defaultIQMatrix)
+ {
Shared pd(
new PictureData {
slice: slice,
@@ -196,8 +210,8 @@ namespace Decode {
);
pd->sparam.slice_data_size = slice.size();
- pd->pparam.picture_width = W;
- pd->pparam.picture_height = H;
+ pd->pparam.picture_width = w;
+ pd->pparam.picture_height = h;
switch(fourcc)
{
@@ -232,8 +246,8 @@ namespace Decode {
/* Calculate num_mcus */
int hfactor = pd->pparam.components[0].h_sampling_factor<< 3;
int vfactor = pd->pparam.components[0].v_sampling_factor<< 3;
- int wmcu = (W + hfactor - 1) / hfactor;
- int hmcu = (H + vfactor - 1) / vfactor;
+ int wmcu = (w + hfactor - 1) / hfactor;
+ int hmcu = (h + vfactor - 1) / vfactor;
pd->sparam.num_mcus = wmcu * hmcu;
return pd;
@@ -321,4 +335,180 @@ namespace Decode {
} // namespace Decode
} // namespace JPEG
+namespace JPEG {
+namespace Encode {
+ typedef VAQMatrixBufferJPEG IQMatrix;
+ typedef VAHuffmanTableBufferJPEGBaseline HuffmanTable;
+ typedef VAEncPictureParameterBufferJPEG PictureParameter;
+ typedef VAEncSliceParameterBufferJPEG SliceParameter;
+
+ static const VAEntrypoint entrypoint = VAEntrypointEncPicture;
+
+ static const IQMatrix defaultIQMatrix = { /* Quality 50 */
+ load_lum_quantiser_matrix: 1,
+ load_chroma_quantiser_matrix: 1,
+ lum_quantiser_matrix: {
+ 0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
+ 0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
+ 0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
+ 0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
+ 0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
+ 0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
+ 0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
+ 0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
+ },
+ chroma_quantiser_matrix: {
+ 0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
+ 0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ },
+ };
+
+ static const HuffmanTable defaultHuffmanTable =
+ ::JPEG::Decode::defaultHuffmanTable;
+
+ static const PictureParameter defaultPictureParameter = {
+ reconstructed_picture: VA_INVALID_ID,
+ picture_width: 10,
+ picture_height: 10,
+ coded_buf: VA_INVALID_ID,
+ pic_flags: {value: 0x00100},
+ sample_bit_depth: 8,
+ num_scan: 1,
+ num_components: 3,
+ component_id: {0, 1, 2, 0},
+ quantiser_table_selector: {0, 1, 1, 0},
+ quality: 100,
+ };
+
+ static const SliceParameter defaultSliceParameter = {
+ restart_interval: 0,
+ num_components: 3,
+ /* component_selector, dc_table_selector, ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}},
+ };
+
+ class TestInput
+ {
+ typedef std::shared_ptr<TestInput> Shared;
+ typedef std::shared_ptr<TestInput> SharedConst;
+
+ TestInput(const unsigned fourcc, const unsigned w, const unsigned h)
+ : bytes() // caller must fill this in after instantiation
+ , picture(defaultPictureParameter)
+ , matrix(defaultIQMatrix)
+ , huffman(defaultHuffmanTable)
+ , slice(defaultSliceParameter)
+ , fourcc(fourcc)
+ , fourcc_output(fourcc)
+ , format(0)
+ , planes(0)
+ , widths{0,0,0}
+ , heights{0,0,0}
+ , offsets{0,0,0}
+ , sizes{0,0,0}
+ {
+ picture.picture_width = ALIGN(w,2);
+ picture.picture_height = ALIGN(h,2);
+
+ switch(fourcc) {
+ planes = 3;
+ widths = {
+ w +( w& 1),
+ (w + 1)>> 1,
+ (w + 1)>> 1
+ };
+ heights = {
+ h + (h& 1),
+ (h + 1)>> 1,
+ (h + 1)>> 1
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ planes = 2;
+ widths = {
+ w + (w& 1),
+ w + (w& 1),
+ 0
+ };
+ heights = {
+ h + (h& 1),
+ (h + 1)>> 1,
+ 0
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ return;
+ }
+
+ for (size_t i(0); i< planes; ++i) {
+ sizes[i] = widths[i] * heights[i];
+ }
+
+ for (size_t i(1); i< planes; ++i) {
+ offsets[i] = sizes[i - 1];
+ offsets[i] += offsets[i - 1];
+ }
+ }
+
+ const unsigned width() const
+ {
+ return picture.picture_width;
+ }
+
+ const unsigned height() const
+ {
+ return picture.picture_height;
+ }
+
+ const uint8_t* plane(const size_t i) const
+ {
+ return bytes.data() + offsets[i];
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const TestInput& t)
+ {
+ return os
+<< std::string((char*)(&t.fourcc), 4)
+<< " "<< t.width()<< "x"<< t.height()
+<< " "<< t.widths<< " "<< t.heights
+<< " "<< t.sizes<< " "<< t.offsets
+ ;
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const Shared& t)
+ {
+ return os<< *t;
+ }
+
+ ByteData bytes;
+ PictureParameter picture;
+ IQMatrix matrix;
+ HuffmanTable huffman;
+ SliceParameter slice;
+ unsigned fourcc;
+ unsigned fourcc_output;
+ unsigned format;
+ size_t planes;
+ std::array<size_t, 3> widths;
+ std::array<size_t, 3> heights;
+ std::array<size_t, 3> offsets;
+ std::array<size_t, 3> sizes;
+ };
+
+
+} // namespace Encode
+} // namespace JPEG
+
#endif
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 54d85d223789..c805b359e19f 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -35,6 +35,7 @@
typedef std::vector<VASurfaceID> Surfaces;
typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
+typedef std::vector<VABufferID> Buffers;
/**
* This test fixture handles initialization and termination of the i965 driver
Sean V Kelley
2016-09-28 20:14:43 UTC
Permalink
Post by U. Artie Eoff
Add JPEG encode tests that encode raw I420 and NV12 data
at quality 100 and then decodes them to verify proper
encoding.
Currently, the 7680x4320 I420 test fails because ~40-60
Y-values (i.e. plane 0) in each line from the decoded
bitstream are off by more than 2 of the original raw
I420 values.  It is not clear why only this resolution
exhibits this problem.
Ah this was the one we talked about.  Accepted.

Sean
v2: don't create any input data in test fixture if
jpeg encoding is not supported.

Signed-off-by: U. Artie Eoff <***@intel.com>
---
test/Makefile.am | 1 +
test/i965_jpeg_encode_test.cpp | 699 +++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 198 +++++++++++-
test/i965_test_fixture.h | 1 +
4 files changed, 895 insertions(+), 4 deletions(-)
create mode 100644 test/i965_jpeg_encode_test.cpp

diff --git a/test/Makefile.am b/test/Makefile.am
index 2e9edda648a4..99560f8d8a54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -57,6 +57,7 @@ test_i965_drv_video_SOURCES = \
i965_jpeg_test_data.cpp \
i965_test_fixture.cpp \
i965_jpeg_decode_test.cpp \
+ i965_jpeg_encode_test.cpp \
object_heap_test.cpp \
test_main.cpp \
$(NULL)
diff --git a/test/i965_jpeg_encode_test.cpp b/test/i965_jpeg_encode_test.cpp
new file mode 100644
index 000000000000..08d80c4f75b7
--- /dev/null
+++ b/test/i965_jpeg_encode_test.cpp
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+#include "test_utils.h"
+
+#include <algorithm>
+#include <cstring>
+#include <fstream>
+#include <memory>
+#include <sstream>
+#include <tuple>
+
+namespace JPEG {
+namespace Encode {
+
+class JPEGEncodeTest
+ : public I965TestFixture
+{
+public:
+ JPEGEncodeTest()
+ : I965TestFixture()
+ , config(VA_INVALID_ID) // invalid
+ , context(VA_INVALID_ID) // invalid
+ { }
+
+protected:
+ virtual void TearDown()
+ {
+ if (context != VA_INVALID_ID) {
+ destroyContext(context);
+ context = VA_INVALID_ID;
+ }
+
+ if (config != VA_INVALID_ID) {
+ destroyConfig(config);
+ config = VA_INVALID_ID;
+ }
+
+ I965TestFixture::TearDown();
+ }
+
+ VAConfigID config;
+ VAContextID context;
+};
+
+TEST_F(JPEGEncodeTest, Entrypoint)
+{
+ ConfigAttribs attributes;
+ struct i965_driver_data *i965(*this);
+
+ ASSERT_PTR(i965);
+
+ if (HAS_JPEG_ENCODING(i965)) {
+ config = createConfig(profile, entrypoint, attributes);
+ } else {
+ VAStatus status = i965_CreateConfig(
+ *this, profile, entrypoint, attributes.data(), attributes.size(),
+ &config);
+ EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT, status);
+ EXPECT_INVALID_ID(config);
+ }
+}
+
+class TestInputCreator
+{
+public:
+ typedef std::shared_ptr<TestInputCreator> Shared;
+ typedef std::shared_ptr<const TestInputCreator> SharedConst;
+
+ TestInput::Shared create(const unsigned fourcc) const
+ {
+ const std::array<unsigned, 2> res = getResolution();
+
+ TestInput::Shared input(new TestInput(fourcc, res[0], res[1]));
+ ByteData& bytes = input->bytes;
+
+ RandomValueGenerator<uint8_t> rg(0x00, 0xff);
+ for (size_t i(0); i < input->planes; ++i)
+ std::generate_n(
+ std::back_inserter(bytes), input->sizes[i],
+ [&rg]{ return rg(); });
+ return input;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator& t)
+ {
+ t.repr(os);
+ return os;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::Shared& t)
+ {
+ return os << *t;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::SharedConst& t)
+ {
+ return os << *t;
+ }
+
+protected:
+ virtual std::array<unsigned, 2> getResolution() const = 0;
+ virtual void repr(std::ostream& os) const = 0;
+};
+
+template <typename T>
+const std::string toString(const T& t)
+{
+ std::ostringstream os;
+ os << t;
+ return os.str();
+}
+
+const TestInput::Shared NV12toI420(const TestInput::SharedConst& nv12)
+{
+ TestInput::Shared i420(
+ new TestInput(VA_FOURCC_I420, nv12->width(), nv12->height()));
+
+ i420->bytes = nv12->bytes;
+
+ size_t i(0);
+ auto predicate = [&i](const ByteData::value_type&) {
+ bool isu = ((i % 2) == 0) or (i == 0);
+ ++i;
+ return isu;
+ };
+
+ std::stable_partition(
+ i420->bytes.begin() + i420->offsets[1],
+ i420->bytes.end(), predicate);
+
+ return i420;
+}
+
+#define ASSERT_NO_FAILURE(statement) \
+ statement; \
+ ASSERT_FALSE(HasFailure());
+
+class JPEGEncodeInputTest
+ : public JPEGEncodeTest
+ , public ::testing::WithParamInterface<
+ std::tuple<TestInputCreator::SharedConst, const char*> >
+{
+public:
+ JPEGEncodeInputTest()
+ : JPEGEncodeTest::JPEGEncodeTest()
+ , surfaces() // empty
+ , coded(VA_INVALID_ID) // invalid
+ , renderBuffers() // empty
+ , input() // invalid
+ , output() // empty
+ { }
+
+protected:
+ virtual void SetUp()
+ {
+ JPEGEncodeTest::SetUp();
+
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965))
+ return;
+
+ TestInputCreator::SharedConst creator;
+ std::string sFourcc;
+ std::tie(creator, sFourcc) = GetParam();
+
+ ASSERT_PTR(creator.get()) << "Invalid test input creator parameter";
+
+ ASSERT_EQ(4u, sFourcc.size())
+ << "Invalid fourcc parameter '" << sFourcc << "'";
+
+ unsigned fourcc = VA_FOURCC(
+ sFourcc[0], sFourcc[1], sFourcc[2], sFourcc[3]);
+
+ input = creator->create(fourcc);
+
+ ASSERT_PTR(input.get())
+ << "Unhandled fourcc parameter '" << sFourcc << "'"
+ << " = 0x" << std::hex << fourcc << std::dec;
+
+ ASSERT_EQ(fourcc, input->fourcc);
+
+ RecordProperty("test_input", toString(*input));
+ }
+
+ virtual void TearDown()
+ {
+ for (auto id : renderBuffers) {
+ if (id != VA_INVALID_ID) {
+ destroyBuffer(id);
+ }
+ }
+ renderBuffers.clear();
+
+ if (coded != VA_INVALID_ID) {
+ destroyBuffer(coded);
+ coded = VA_INVALID_ID;
+ }
+
+ if (not surfaces.empty()) {
+ destroySurfaces(surfaces);
+ surfaces.clear();
+ }
+
+ if (std::get<0>(GetParam()).get())
+ std::cout << "Creator: " << std::get<0>(GetParam()) << std::endl;
+ if (input.get())
+ std::cout << "Input : " << input << std::endl;
+
+ JPEGEncodeTest::TearDown();
+ }
+
+ void Encode()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ ASSERT_NO_FAILURE(
+ beginPicture(context, surfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(context, renderBuffers.data(), renderBuffers.size()));
+ ASSERT_NO_FAILURE(
+ endPicture(context));
+ ASSERT_NO_FAILURE(
+ syncSurface(surfaces.front()));
+ ASSERT_NO_FAILURE(
+ VACodedBufferSegment *segment =
+ mapBuffer<VACodedBufferSegment>(coded));
+
+ EXPECT_FALSE(segment->status & VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
+ << "segment->size = " << segment->size;
+ EXPECT_PTR_NULL(segment->next);
+
+ // copy segment buffer to output while stripping the packed header data
+ const size_t headerSize(1);
+ output.resize(segment->size - headerSize, 0x0);
+ std::memcpy(
+ output.data(),
+ reinterpret_cast<uint8_t *>(segment->buf) + headerSize,
+ segment->size - headerSize);
+
+ unmapBuffer(coded);
+
+ // EOI JPEG Marker
+ ASSERT_GE(output.size(), 2u);
+ EXPECT_TRUE(
+ unsigned(0xff) == unsigned(*(output.end() - 2)) and
+ unsigned(0xd9) == unsigned(output.back()))
+ << "Invalid JPEG EOI Marker";
+ }
+
+ void SetUpSurfaces()
+ {
+ SurfaceAttribs attributes(1);
+ attributes.front().flags = VA_SURFACE_ATTRIB_SETTABLE;
+ attributes.front().type = VASurfaceAttribPixelFormat;
+ attributes.front().value.type = VAGenericValueTypeInteger;
+ attributes.front().value.value.i = input->fourcc;
+ surfaces = createSurfaces(input->width(), input->height(),
+ input->format, 1, attributes);
+ }
+
+ void CopyInputToSurface()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ VAImage image;
+ deriveImage(surfaces.front(), image);
+ if (HasFailure())
+ return;
+
+ SCOPED_TRACE(::testing::Message() << std::endl << image);
+
+ RecordProperty("input_image", toString(image));
+
+ EXPECT_EQ(input->planes, image.num_planes);
+ EXPECT_GT(image.data_size, 0u);
+ EXPECT_EQ(input->width(), image.width);
+ EXPECT_EQ(input->height(), image.height);
+ if (HasFailure()) {
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ return;
+ }
+
+ uint8_t *data = mapBuffer<uint8_t>(image.buf);
+ if (HasFailure()) {
+ destroyImage(image);
+ return;
+ }
+
+ std::memset(data, 0, image.data_size);
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = input->widths[i];
+ size_t h = input->heights[i];
+
+ EXPECT_GE(image.pitches[i], w);
+ if (HasFailure())
+ break;
+
+ const ByteData::value_type *source = input->plane(i);
+ uint8_t *dest = data + image.offsets[i];
+ for (size_t r(0); r < h; ++r) {
+ std::memcpy(dest, source, w);
+ source += w;
+ dest += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ }
+
+ void SetUpConfig()
+ {
+ ASSERT_INVALID_ID(config);
+ ConfigAttribs attributes(
+ 1, {type:VAConfigAttribRTFormat, value:input->format});
+ config = createConfig(profile, entrypoint, attributes);
+ }
+
+ void SetUpContext()
+ {
+ ASSERT_INVALID_ID(context);
+ context = createContext(config, input->width(),
+ input->height(), 0, surfaces);
+ }
+
+ void SetUpCodedBuffer()
+ {
+ ASSERT_INVALID_ID(coded);
+ unsigned size =
+ std::accumulate(input->sizes.begin(), input->sizes.end(), 8192u);
+ size *= input->planes;
+ coded = createBuffer(context, VAEncCodedBufferType, size);
+ }
+
+ void SetUpPicture()
+ {
+ input->picture.coded_buf = coded;
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPictureParameterBufferType,
+ sizeof(PictureParameter), 1, &input->picture));
+ }
+
+ void SetUpIQMatrix()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAQMatrixBufferType, sizeof(IQMatrix),
+ 1, &input->matrix));
+ }
+
+ void SetUpHuffmanTables()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAHuffmanTableBufferType,
+ sizeof(HuffmanTable), 1, &input->huffman));
+ }
+
+ void SetUpSlice()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAEncSliceParameterBufferType,
+ sizeof(SliceParameter), 1, &input->slice));
+ }
+
+ void SetUpHeader()
+ {
+ /*
+ * The driver expects a packed JPEG header which it prepends to the
+ * coded buffer segment output. The driver does not appear to inspect
+ * this header, however. So we'll just create a 1-byte packed header
+ * since we really don't care if it contains a "valid" JPEG header.
+ */
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderParameterBufferType,
+ sizeof(VAEncPackedHeaderParameterBuffer)));
+ if (HasFailure())
+ return;
+
+ VAEncPackedHeaderParameterBuffer *packed =
+ mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back());
+ if (HasFailure())
+ return;
+
+ std::memset(packed, 0, sizeof(*packed));
+ packed->type = VAEncPackedHeaderRawData;
+ packed->bit_length = 8;
+ packed->has_emulation_bytes = 0;
+
+ unmapBuffer(renderBuffers.back());
+
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderDataBufferType, 1));
+ }
+
+ Surfaces surfaces;
+ VABufferID coded;
+ Buffers renderBuffers;
+ TestInput::Shared input;
+ ByteData output;
+
+ void VerifyOutput()
+ {
+ // VerifyOutput only supports VA_FOURCC_IMC3 output, currently
+ ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input->fourcc_output);
+ TestInput::SharedConst expect = input;
+ if (input->fourcc == VA_FOURCC_NV12)
+ expect = NV12toI420(input);
+
+ ::JPEG::Decode::PictureData::SharedConst pd =
+ ::JPEG::Decode::PictureData::make(
+ input->fourcc_output, output, input->width(), input->height());
+
+ ASSERT_NO_FAILURE(
+ Surfaces osurfaces = createSurfaces(
+ pd->pparam.picture_width, pd->pparam.picture_height,
+ pd->format));;
+
+ ConfigAttribs attribs(
+ 1, {type:VAConfigAttribRTFormat, value:pd->format});
+ ASSERT_NO_FAILURE(
+ VAConfigID oconfig = createConfig(
+ ::JPEG::profile, ::JPEG::Decode::entrypoint, attribs));
+
+ ASSERT_NO_FAILURE(
+ VAContextID ocontext = createContext(
+ oconfig, pd->pparam.picture_width, pd->pparam.picture_height,
+ 0, osurfaces));
+
+ Buffers buffers;
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceDataBufferType, pd->sparam.slice_data_size,
+ 1, pd->slice.data())));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceParameterBufferType, sizeof(pd->sparam),
+ 1, &pd->sparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,VAPictureParameterBufferType, sizeof(pd->pparam),
+ 1, &pd->pparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAIQMatrixBufferType, sizeof(pd->iqmatrix),
+ 1, &pd->iqmatrix)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAHuffmanTableBufferType, sizeof(pd->huffman),
+ 1, &pd->huffman)));
+
+ ASSERT_NO_FAILURE(beginPicture(ocontext, osurfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(ocontext, buffers.data(), buffers.size()));
+ ASSERT_NO_FAILURE(endPicture(ocontext));
+ ASSERT_NO_FAILURE(syncSurface(osurfaces.front()));
+
+ VAImage image;
+ ASSERT_NO_FAILURE(deriveImage(osurfaces.front(), image));
+ ASSERT_NO_FAILURE(uint8_t *data = mapBuffer<uint8_t>(image.buf));
+
+ auto isClose = [](const uint8_t& a, const uint8_t& b) {
+ return std::abs(int(a)-int(b)) <= 2;
+ };
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = expect->widths[i];
+ size_t h = expect->heights[i];
+
+ const ByteData::value_type *source = expect->plane(i);
+ const uint8_t *result = data + image.offsets[i];
+ ASSERT_GE(image.pitches[i], w);
+ for (size_t r(0); r < h; ++r) {
+ EXPECT_TRUE(std::equal(result, result + w, source, isClose))
+ << "Byte(s) mismatch in plane " << i << " row " << r;
+ source += w;
+ result += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+
+ for (auto id : buffers)
+ destroyBuffer(id);
+
+ destroyImage(image);
+ destroyContext(ocontext);
+ destroyConfig(oconfig);
+ destroySurfaces(osurfaces);
+ }
+};
+
+TEST_P(JPEGEncodeInputTest, Full)
+{
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965)) {
+ RecordProperty("skipped", true);
+ std::cout << "[ SKIPPED ] " << getFullTestName()
+ << " is unsupported on this hardware" << std::endl;
+ return;
+ }
+
+ ASSERT_NO_FAILURE(SetUpSurfaces());
+ ASSERT_NO_FAILURE(SetUpConfig());
+ ASSERT_NO_FAILURE(SetUpContext());
+ ASSERT_NO_FAILURE(SetUpCodedBuffer());
+ ASSERT_NO_FAILURE(SetUpPicture());
+ ASSERT_NO_FAILURE(SetUpIQMatrix());
+ ASSERT_NO_FAILURE(SetUpHuffmanTables());
+ ASSERT_NO_FAILURE(SetUpSlice());
+ ASSERT_NO_FAILURE(SetUpHeader());
+ ASSERT_NO_FAILURE(CopyInputToSurface());
+ ASSERT_NO_FAILURE(Encode());
+
+ VerifyOutput();
+}
+
+class RandomSizeCreator
+ : public TestInputCreator
+{
+protected:
+ std::array<unsigned, 2> getResolution() const
+ {
+ static RandomValueGenerator<unsigned> rg(1, 769);
+ return {rg(), rg()};
+ }
+ void repr(std::ostream& os) const { os << "Random Size"; }
+};
+
+INSTANTIATE_TEST_CASE_P(
+ Random, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(
+ std::vector<TestInputCreator::SharedConst>(
+ 5, TestInputCreator::SharedConst(new RandomSizeCreator))),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+class FixedSizeCreator
+ : public TestInputCreator
+{
+public:
+ FixedSizeCreator(const std::array<unsigned, 2>& resolution)
+ : res(resolution)
+ { }
+
+protected:
+ std::array<unsigned, 2> getResolution() const { return res; }
+ void repr(std::ostream& os) const
+ {
+ os << "Fixed Size " << res[0] << "x" << res[1];
+ }
+
+private:
+ const std::array<unsigned, 2> res;
+};
+
+typedef std::vector<TestInputCreator::SharedConst> InputCreators;
+
+InputCreators generateCommonInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({800, 600})), /* SVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 600})), /* WSVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 768})), /* XGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1152, 864})), /* XGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 720})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 768})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 800})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 1024})), /* SXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1360, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1366, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1440, 900})), /* WXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 900})), /* HD+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 1200})), /* UXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1680, 1050})), /* WSXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1080})), /* FHD */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1200})), /* WUXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1440})), /* WQHD */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1600})), /* WQXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({3640, 2160})), /* UHD (4K) */
+ TestInputCreator::Shared(new FixedSizeCreator({7680, 4320})), /* UHD (8K) */
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Common, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateCommonInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+INSTANTIATE_TEST_CASE_P(
+ Big, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::Values(
+ TestInputCreator::Shared(new FixedSizeCreator({8192, 8192}))
+ ),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateEdgeCaseInputs()
+{
+ std::vector<TestInputCreator::SharedConst> result;
+ for (unsigned i(64); i <= 512; i += 64) {
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i-1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i-1})));
+ }
+
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 1})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 2})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({2, 1})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({2, 2})));
+ result.push_back(TestInputCreator::Shared(new FixedSizeCreator({1, 462})));
+
+ return result;
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Edge, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateEdgeCaseInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateMiscInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({150, 75})),
+ TestInputCreator::Shared(new FixedSizeCreator({10, 10})),
+ TestInputCreator::Shared(new FixedSizeCreator({385, 610})),
+ TestInputCreator::Shared(new FixedSizeCreator({1245, 1281})),
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Misc, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateMiscInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+} // namespace Encode
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index d52f58233cc5..490ec941feb5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -25,6 +25,8 @@
#ifndef I965_JPEG_TEST_DATA_H
#define I965_JPEG_TEST_DATA_H

+#include "i965_test_fixture.h"
+
#include <array>
#include <iostream>
#include <map>
@@ -183,6 +185,18 @@ namespace Decode {
const HuffmanTable& huffman = defaultHuffmanTable,
const IQMatrix& iqmatrix = defaultIQMatrix)
{
+ return make(fourcc, slice, W, H, sparam, pparam, huffman, iqmatrix);
+ }
+
+ static SharedConst make(
+ const unsigned fourcc,
+ const ByteData& slice,
+ const unsigned w, const unsigned h,
+ const SliceParameter& sparam = defaultSliceParameter,
+ const PictureParameter& pparam = defaultPictureParameter,
+ const HuffmanTable& huffman = defaultHuffmanTable,
+ const IQMatrix& iqmatrix = defaultIQMatrix)
+ {
Shared pd(
new PictureData {
slice: slice,
@@ -196,8 +210,8 @@ namespace Decode {
);

pd->sparam.slice_data_size = slice.size();
- pd->pparam.picture_width = W;
- pd->pparam.picture_height = H;
+ pd->pparam.picture_width = w;
+ pd->pparam.picture_height = h;

switch(fourcc)
{
@@ -232,8 +246,8 @@ namespace Decode {
/* Calculate num_mcus */
int hfactor = pd->pparam.components[0].h_sampling_factor << 3;
int vfactor = pd->pparam.components[0].v_sampling_factor << 3;
- int wmcu = (W + hfactor - 1) / hfactor;
- int hmcu = (H + vfactor - 1) / vfactor;
+ int wmcu = (w + hfactor - 1) / hfactor;
+ int hmcu = (h + vfactor - 1) / vfactor;
pd->sparam.num_mcus = wmcu * hmcu;

return pd;
@@ -321,4 +335,180 @@ namespace Decode {
} // namespace Decode
} // namespace JPEG

+namespace JPEG {
+namespace Encode {
+ typedef VAQMatrixBufferJPEG IQMatrix;
+ typedef VAHuffmanTableBufferJPEGBaseline HuffmanTable;
+ typedef VAEncPictureParameterBufferJPEG PictureParameter;
+ typedef VAEncSliceParameterBufferJPEG SliceParameter;
+
+ static const VAEntrypoint entrypoint = VAEntrypointEncPicture;
+
+ static const IQMatrix defaultIQMatrix = { /* Quality 50 */
+ load_lum_quantiser_matrix: 1,
+ load_chroma_quantiser_matrix: 1,
+ lum_quantiser_matrix: {
+ 0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
+ 0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
+ 0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
+ 0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
+ 0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
+ 0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
+ 0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
+ 0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
+ },
+ chroma_quantiser_matrix: {
+ 0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
+ 0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ },
+ };
+
+ static const HuffmanTable defaultHuffmanTable =
+ ::JPEG::Decode::defaultHuffmanTable;
+
+ static const PictureParameter defaultPictureParameter = {
+ reconstructed_picture: VA_INVALID_ID,
+ picture_width: 10,
+ picture_height: 10,
+ coded_buf: VA_INVALID_ID,
+ pic_flags: {value: 0x00100},
+ sample_bit_depth: 8,
+ num_scan: 1,
+ num_components: 3,
+ component_id: {0, 1, 2, 0},
+ quantiser_table_selector: {0, 1, 1, 0},
+ quality: 100,
+ };
+
+ static const SliceParameter defaultSliceParameter = {
+ restart_interval: 0,
+ num_components: 3,
+ /* component_selector, dc_table_selector, ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}},
+ };
+
+ class TestInput
+ {
+ public:
+ typedef std::shared_ptr<TestInput> Shared;
+ typedef std::shared_ptr<TestInput> SharedConst;
+
+ TestInput(const unsigned fourcc, const unsigned w, const unsigned h)
+ : bytes() // caller must fill this in after instantiation
+ , picture(defaultPictureParameter)
+ , matrix(defaultIQMatrix)
+ , huffman(defaultHuffmanTable)
+ , slice(defaultSliceParameter)
+ , fourcc(fourcc)
+ , fourcc_output(fourcc)
+ , format(0)
+ , planes(0)
+ , widths{0,0,0}
+ , heights{0,0,0}
+ , offsets{0,0,0}
+ , sizes{0,0,0}
+ {
+ picture.picture_width = ALIGN(w,2);
+ picture.picture_height = ALIGN(h,2);
+
+ switch(fourcc) {
+ case VA_FOURCC('I', '4', '2', '0'):
+ planes = 3;
+ widths = {
+ w +( w & 1),
+ (w + 1) >> 1,
+ (w + 1) >> 1
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ (h + 1) >> 1
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ case VA_FOURCC_NV12:
+ planes = 2;
+ widths = {
+ w + (w & 1),
+ w + (w & 1),
+ 0
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ 0
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ default:
+ return;
+ }
+
+ for (size_t i(0); i < planes; ++i) {
+ sizes[i] = widths[i] * heights[i];
+ }
+
+ for (size_t i(1); i < planes; ++i) {
+ offsets[i] = sizes[i - 1];
+ offsets[i] += offsets[i - 1];
+ }
+ }
+
+ const unsigned width() const
+ {
+ return picture.picture_width;
+ }
+
+ const unsigned height() const
+ {
+ return picture.picture_height;
+ }
+
+ const uint8_t* plane(const size_t i) const
+ {
+ return bytes.data() + offsets[i];
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const TestInput& t)
+ {
+ return os
+ << std::string((char*)(&t.fourcc), 4)
+ << " " << t.width() << "x" << t.height()
+ << " " << t.widths << " " << t.heights
+ << " " << t.sizes << " " << t.offsets
+ ;
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const Shared& t)
+ {
+ return os << *t;
+ }
+
+ ByteData bytes;
+ PictureParameter picture;
+ IQMatrix matrix;
+ HuffmanTable huffman;
+ SliceParameter slice;
+ unsigned fourcc;
+ unsigned fourcc_output;
+ unsigned format;
+ size_t planes;
+ std::array<size_t, 3> widths;
+ std::array<size_t, 3> heights;
+ std::array<size_t, 3> offsets;
+ std::array<size_t, 3> sizes;
+ };
+
+
+} // namespace Encode
+} // namespace JPEG
+
#endif
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 54d85d223789..c805b359e19f 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -35,6 +35,7 @@
typedef std::vector<VASurfaceID> Surfaces;
typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
+typedef std::vector<VABufferID> Buffers;

/**
* This test fixture handles initialization and termination of the i965 driver
Xiang, Haihao
2016-10-12 19:17:07 UTC
Permalink
Hi Artie,

When I was investigating the issue with the 7680x4320 I420 test, I experienced random failures
with Common/JPEGEncodeInputTest.Full/98 and Common/JPEGEncodeInputTest.Full/97. I guess
it is caused by the test case, did you see this issue in your side? To reproduce the issue, you should run the case a few times.

Thanks
Haihao
-----Original Message-----
Kelley
Sent: Thursday, September 29, 2016 4:15 AM
Subject: Re: [Libva] [PATCH intel-driver v2 7/7] test: add some jpeg encode
tests
Add JPEG encode tests that encode raw I420 and NV12 data
at quality 100 and then decodes them to verify proper
encoding.
Currently, the 7680x4320 I420 test fails because ~40-60
Y-values (i.e. plane 0) in each line from the decoded
bitstream are off by more than 2 of the original raw
I420 values. It is not clear why only this resolution
exhibits this problem.
Ah this was the one we talked about. Accepted.
Sean
v2: don't create any input data in test fixture if
jpeg encoding is not supported.
---
test/Makefile.am | 1 +
test/i965_jpeg_encode_test.cpp | 699
+++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 198 +++++++++++-
test/i965_test_fixture.h | 1 +
4 files changed, 895 insertions(+), 4 deletions(-)
create mode 100644 test/i965_jpeg_encode_test.cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index 2e9edda648a4..99560f8d8a54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -57,6 +57,7 @@ test_i965_drv_video_SOURCES =
\
i965_jpeg_test_data.cpp
\
i965_test_fixture.cpp
\
i965_jpeg_decode_test.cpp
\
+ i965_jpeg_encode_test.cpp
\
object_heap_test.cpp
\
test_main.cpp
\
$(NULL)
diff --git a/test/i965_jpeg_encode_test.cpp
b/test/i965_jpeg_encode_test.cpp
new file mode 100644
index 000000000000..08d80c4f75b7
--- /dev/null
+++ b/test/i965_jpeg_encode_test.cpp
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so,
subject to
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+#include "test_utils.h"
+
+#include <algorithm>
+#include <cstring>
+#include <fstream>
+#include <memory>
+#include <sstream>
+#include <tuple>
+
+namespace JPEG {
+namespace Encode {
+
+class JPEGEncodeTest
+ : public I965TestFixture
+{
+ JPEGEncodeTest()
+ : I965TestFixture()
+ , config(VA_INVALID_ID) // invalid
+ , context(VA_INVALID_ID) // invalid
+ { }
+
+ virtual void TearDown()
+ {
+ if (context != VA_INVALID_ID) {
+ destroyContext(context);
+ context = VA_INVALID_ID;
+ }
+
+ if (config != VA_INVALID_ID) {
+ destroyConfig(config);
+ config = VA_INVALID_ID;
+ }
+
+ I965TestFixture::TearDown();
+ }
+
+ VAConfigID config;
+ VAContextID context;
+};
+
+TEST_F(JPEGEncodeTest, Entrypoint)
+{
+ ConfigAttribs attributes;
+ struct i965_driver_data *i965(*this);
+
+ ASSERT_PTR(i965);
+
+ if (HAS_JPEG_ENCODING(i965)) {
+ config = createConfig(profile, entrypoint, attributes);
+ } else {
+ VAStatus status = i965_CreateConfig(
+ *this, profile, entrypoint, attributes.data(), attributes.size(),
+ &config);
+
EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT,
status);
+ EXPECT_INVALID_ID(config);
+ }
+}
+
+class TestInputCreator
+{
+ typedef std::shared_ptr<TestInputCreator> Shared;
+ typedef std::shared_ptr<const TestInputCreator> SharedConst;
+
+ TestInput::Shared create(const unsigned fourcc) const
+ {
+ const std::array<unsigned, 2> res = getResolution();
+
+ TestInput::Shared input(new TestInput(fourcc, res[0], res[1]));
+ ByteData& bytes = input->bytes;
+
+ RandomValueGenerator<uint8_t> rg(0x00, 0xff);
+ for (size_t i(0); i < input->planes; ++i)
+ std::generate_n(
+ std::back_inserter(bytes), input->sizes[i],
+ [&rg]{ return rg(); });
+ return input;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator& t)
+ {
+ t.repr(os);
+ return os;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::Shared& t)
+ {
+ return os << *t;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::SharedConst& t)
+ {
+ return os << *t;
+ }
+
+ virtual std::array<unsigned, 2> getResolution() const = 0;
+ virtual void repr(std::ostream& os) const = 0;
+};
+
+template <typename T>
+const std::string toString(const T& t)
+{
+ std::ostringstream os;
+ os << t;
+ return os.str();
+}
+
+const TestInput::Shared NV12toI420(const TestInput::SharedConst& nv12)
+{
+ TestInput::Shared i420(
+ new TestInput(VA_FOURCC_I420, nv12->width(), nv12-
Post by U. Artie Eoff
height()));
+
+ i420->bytes = nv12->bytes;
+
+ size_t i(0);
+ auto predicate = [&i](const ByteData::value_type&) {
+ bool isu = ((i % 2) == 0) or (i == 0);
+ ++i;
+ return isu;
+ };
+
+ std::stable_partition(
+ i420->bytes.begin() + i420->offsets[1],
+ i420->bytes.end(), predicate);
+
+ return i420;
+}
+
+#define ASSERT_NO_FAILURE(statement) \
+ statement; \
+ ASSERT_FALSE(HasFailure());
+
+class JPEGEncodeInputTest
+ : public JPEGEncodeTest
+ , public ::testing::WithParamInterface<
+ std::tuple<TestInputCreator::SharedConst, const char*> >
+{
+ JPEGEncodeInputTest()
+ : JPEGEncodeTest::JPEGEncodeTest()
+ , surfaces() // empty
+ , coded(VA_INVALID_ID) // invalid
+ , renderBuffers() // empty
+ , input() // invalid
+ , output() // empty
+ { }
+
+ virtual void SetUp()
+ {
+ JPEGEncodeTest::SetUp();
+
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965))
+ return;
+
+ TestInputCreator::SharedConst creator;
+ std::string sFourcc;
+ std::tie(creator, sFourcc) = GetParam();
+
+ ASSERT_PTR(creator.get()) << "Invalid test input creator parameter";
+
+ ASSERT_EQ(4u, sFourcc.size())
+ << "Invalid fourcc parameter '" << sFourcc << "'";
+
+ unsigned fourcc = VA_FOURCC(
+ sFourcc[0], sFourcc[1], sFourcc[2], sFourcc[3]);
+
+ input = creator->create(fourcc);
+
+ ASSERT_PTR(input.get())
+ << "Unhandled fourcc parameter '" << sFourcc << "'"
+ << " = 0x" << std::hex << fourcc << std::dec;
+
+ ASSERT_EQ(fourcc, input->fourcc);
+
+ RecordProperty("test_input", toString(*input));
+ }
+
+ virtual void TearDown()
+ {
+ for (auto id : renderBuffers) {
+ if (id != VA_INVALID_ID) {
+ destroyBuffer(id);
+ }
+ }
+ renderBuffers.clear();
+
+ if (coded != VA_INVALID_ID) {
+ destroyBuffer(coded);
+ coded = VA_INVALID_ID;
+ }
+
+ if (not surfaces.empty()) {
+ destroySurfaces(surfaces);
+ surfaces.clear();
+ }
+
+ if (std::get<0>(GetParam()).get())
+ std::cout << "Creator: " << std::get<0>(GetParam()) << std::endl;
+ if (input.get())
+ std::cout << "Input : " << input << std::endl;
+
+ JPEGEncodeTest::TearDown();
+ }
+
+ void Encode()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ ASSERT_NO_FAILURE(
+ beginPicture(context, surfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(context, renderBuffers.data(),
renderBuffers.size()));
+ ASSERT_NO_FAILURE(
+ endPicture(context));
+ ASSERT_NO_FAILURE(
+ syncSurface(surfaces.front()));
+ ASSERT_NO_FAILURE(
+ VACodedBufferSegment *segment =
+ mapBuffer<VACodedBufferSegment>(coded));
+
+ EXPECT_FALSE(segment->status &
VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
+ << "segment->size = " << segment->size;
+ EXPECT_PTR_NULL(segment->next);
+
+ // copy segment buffer to output while stripping the packed header data
+ const size_t headerSize(1);
+ output.resize(segment->size - headerSize, 0x0);
+ std::memcpy(
+ output.data(),
+ reinterpret_cast<uint8_t *>(segment->buf) + headerSize,
+ segment->size - headerSize);
+
+ unmapBuffer(coded);
+
+ // EOI JPEG Marker
+ ASSERT_GE(output.size(), 2u);
+ EXPECT_TRUE(
+ unsigned(0xff) == unsigned(*(output.end() - 2)) and
+ unsigned(0xd9) == unsigned(output.back()))
+ << "Invalid JPEG EOI Marker";
+ }
+
+ void SetUpSurfaces()
+ {
+ SurfaceAttribs attributes(1);
+ attributes.front().flags = VA_SURFACE_ATTRIB_SETTABLE;
+ attributes.front().type = VASurfaceAttribPixelFormat;
+ attributes.front().value.type = VAGenericValueTypeInteger;
+ attributes.front().value.value.i = input->fourcc;
+ surfaces = createSurfaces(input->width(), input->height(),
+ input->format, 1, attributes);
+ }
+
+ void CopyInputToSurface()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ VAImage image;
+ deriveImage(surfaces.front(), image);
+ if (HasFailure())
+ return;
+
+ SCOPED_TRACE(::testing::Message() << std::endl << image);
+
+ RecordProperty("input_image", toString(image));
+
+ EXPECT_EQ(input->planes, image.num_planes);
+ EXPECT_GT(image.data_size, 0u);
+ EXPECT_EQ(input->width(), image.width);
+ EXPECT_EQ(input->height(), image.height);
+ if (HasFailure()) {
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ return;
+ }
+
+ uint8_t *data = mapBuffer<uint8_t>(image.buf);
+ if (HasFailure()) {
+ destroyImage(image);
+ return;
+ }
+
+ std::memset(data, 0, image.data_size);
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = input->widths[i];
+ size_t h = input->heights[i];
+
+ EXPECT_GE(image.pitches[i], w);
+ if (HasFailure())
+ break;
+
+ const ByteData::value_type *source = input->plane(i);
+ uint8_t *dest = data + image.offsets[i];
+ for (size_t r(0); r < h; ++r) {
+ std::memcpy(dest, source, w);
+ source += w;
+ dest += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ }
+
+ void SetUpConfig()
+ {
+ ASSERT_INVALID_ID(config);
+ ConfigAttribs attributes(
+ 1, {type:VAConfigAttribRTFormat, value:input->format});
+ config = createConfig(profile, entrypoint, attributes);
+ }
+
+ void SetUpContext()
+ {
+ ASSERT_INVALID_ID(context);
+ context = createContext(config, input->width(),
+ input->height(), 0, surfaces);
+ }
+
+ void SetUpCodedBuffer()
+ {
+ ASSERT_INVALID_ID(coded);
+ unsigned size =
+ std::accumulate(input->sizes.begin(), input->sizes.end(), 8192u);
+ size *= input->planes;
+ coded = createBuffer(context, VAEncCodedBufferType, size);
+ }
+
+ void SetUpPicture()
+ {
+ input->picture.coded_buf = coded;
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPictureParameterBufferType,
+ sizeof(PictureParameter), 1, &input->picture));
+ }
+
+ void SetUpIQMatrix()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAQMatrixBufferType, sizeof(IQMatrix),
+ 1, &input->matrix));
+ }
+
+ void SetUpHuffmanTables()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAHuffmanTableBufferType,
+ sizeof(HuffmanTable), 1, &input->huffman));
+ }
+
+ void SetUpSlice()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAEncSliceParameterBufferType,
+ sizeof(SliceParameter), 1, &input->slice));
+ }
+
+ void SetUpHeader()
+ {
+ /*
+ * The driver expects a packed JPEG header which it prepends to the
+ * coded buffer segment output. The driver does not appear to inspect
+ * this header, however. So we'll just create a 1-byte packed header
+ * since we really don't care if it contains a "valid" JPEG header.
+ */
+ renderBuffers.push_back(
+ createBuffer(context,
VAEncPackedHeaderParameterBufferType,
+ sizeof(VAEncPackedHeaderParameterBuffer)));
+ if (HasFailure())
+ return;
+
+ VAEncPackedHeaderParameterBuffer *packed =
+
mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back());
+ if (HasFailure())
+ return;
+
+ std::memset(packed, 0, sizeof(*packed));
+ packed->type = VAEncPackedHeaderRawData;
+ packed->bit_length = 8;
+ packed->has_emulation_bytes = 0;
+
+ unmapBuffer(renderBuffers.back());
+
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderDataBufferType, 1));
+ }
+
+ Surfaces surfaces;
+ VABufferID coded;
+ Buffers renderBuffers;
+ TestInput::Shared input;
+ ByteData output;
+
+ void VerifyOutput()
+ {
+ // VerifyOutput only supports VA_FOURCC_IMC3 output,
currently
+ ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input-
Post by U. Artie Eoff
fourcc_output);
+ TestInput::SharedConst expect = input;
+ if (input->fourcc == VA_FOURCC_NV12)
+ expect = NV12toI420(input);
+
+ ::JPEG::Decode::PictureData::SharedConst pd =
+ ::JPEG::Decode::PictureData::make(
+ input->fourcc_output, output, input->width(), input-
Post by U. Artie Eoff
height());
+
+ ASSERT_NO_FAILURE(
+ Surfaces osurfaces = createSurfaces(
+ pd->pparam.picture_width, pd->pparam.picture_height,
+ pd->format));;
+
+ ConfigAttribs attribs(
+ 1, {type:VAConfigAttribRTFormat, value:pd->format});
+ ASSERT_NO_FAILURE(
+ VAConfigID oconfig = createConfig(
+ ::JPEG::profile, ::JPEG::Decode::entrypoint, attribs));
+
+ ASSERT_NO_FAILURE(
+ VAContextID ocontext = createContext(
+ oconfig, pd->pparam.picture_width, pd-
Post by U. Artie Eoff
pparam.picture_height,
+ 0, osurfaces));
+
+ Buffers buffers;
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceDataBufferType, pd-
Post by U. Artie Eoff
sparam.slice_data_size,
+ 1, pd->slice.data())));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceParameterBufferType, sizeof(pd-
Post by U. Artie Eoff
sparam),
+ 1, &pd->sparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,VAPictureParameterBufferType, sizeof(pd-
Post by U. Artie Eoff
pparam),
+ 1, &pd->pparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAIQMatrixBufferType, sizeof(pd->iqmatrix),
+ 1, &pd->iqmatrix)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAHuffmanTableBufferType, sizeof(pd-
Post by U. Artie Eoff
huffman),
+ 1, &pd->huffman)));
+
+ ASSERT_NO_FAILURE(beginPicture(ocontext, osurfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(ocontext, buffers.data(), buffers.size()));
+ ASSERT_NO_FAILURE(endPicture(ocontext));
+ ASSERT_NO_FAILURE(syncSurface(osurfaces.front()));
+
+ VAImage image;
+ ASSERT_NO_FAILURE(deriveImage(osurfaces.front(), image));
+ ASSERT_NO_FAILURE(uint8_t *data =
mapBuffer<uint8_t>(image.buf));
+
+ auto isClose = [](const uint8_t& a, const uint8_t& b) {
+ return std::abs(int(a)-int(b)) <= 2;
+ };
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = expect->widths[i];
+ size_t h = expect->heights[i];
+
+ const ByteData::value_type *source = expect->plane(i);
+ const uint8_t *result = data + image.offsets[i];
+ ASSERT_GE(image.pitches[i], w);
+ for (size_t r(0); r < h; ++r) {
+ EXPECT_TRUE(std::equal(result, result + w, source, isClose))
+ << "Byte(s) mismatch in plane " << i << " row " << r;
+ source += w;
+ result += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+
+ for (auto id : buffers)
+ destroyBuffer(id);
+
+ destroyImage(image);
+ destroyContext(ocontext);
+ destroyConfig(oconfig);
+ destroySurfaces(osurfaces);
+ }
+};
+
+TEST_P(JPEGEncodeInputTest, Full)
+{
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965)) {
+ RecordProperty("skipped", true);
+ std::cout << "[ SKIPPED ] " << getFullTestName()
+ << " is unsupported on this hardware" << std::endl;
+ return;
+ }
+
+ ASSERT_NO_FAILURE(SetUpSurfaces());
+ ASSERT_NO_FAILURE(SetUpConfig());
+ ASSERT_NO_FAILURE(SetUpContext());
+ ASSERT_NO_FAILURE(SetUpCodedBuffer());
+ ASSERT_NO_FAILURE(SetUpPicture());
+ ASSERT_NO_FAILURE(SetUpIQMatrix());
+ ASSERT_NO_FAILURE(SetUpHuffmanTables());
+ ASSERT_NO_FAILURE(SetUpSlice());
+ ASSERT_NO_FAILURE(SetUpHeader());
+ ASSERT_NO_FAILURE(CopyInputToSurface());
+ ASSERT_NO_FAILURE(Encode());
+
+ VerifyOutput();
+}
+
+class RandomSizeCreator
+ : public TestInputCreator
+{
+ std::array<unsigned, 2> getResolution() const
+ {
+ static RandomValueGenerator<unsigned> rg(1, 769);
+ return {rg(), rg()};
+ }
+ void repr(std::ostream& os) const { os << "Random Size"; }
+};
+
+INSTANTIATE_TEST_CASE_P(
+ Random, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(
+ std::vector<TestInputCreator::SharedConst>(
+ 5, TestInputCreator::SharedConst(new
RandomSizeCreator))),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+class FixedSizeCreator
+ : public TestInputCreator
+{
+ FixedSizeCreator(const std::array<unsigned, 2>& resolution)
+ : res(resolution)
+ { }
+
+ std::array<unsigned, 2> getResolution() const { return res; }
+ void repr(std::ostream& os) const
+ {
+ os << "Fixed Size " << res[0] << "x" << res[1];
+ }
+
+ const std::array<unsigned, 2> res;
+};
+
+typedef std::vector<TestInputCreator::SharedConst> InputCreators;
+
+InputCreators generateCommonInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({800, 600})), /* SVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 600})), /* WSVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 768})), /* XGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1152, 864})), /* XGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 720})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 768})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 800})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 1024})), /* SXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1360, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1366, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1440, 900})), /* WXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 900})), /* HD+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 1200})), /* UXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1680, 1050})), /* WSXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1080})), /* FHD */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1200})), /* WUXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1440})), /* WQHD */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1600})), /* WQXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({3640, 2160})), /* UHD (4K) */
+ TestInputCreator::Shared(new FixedSizeCreator({7680, 4320})), /* UHD (8K) */
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Common, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateCommonInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+INSTANTIATE_TEST_CASE_P(
+ Big, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::Values(
+ TestInputCreator::Shared(new FixedSizeCreator({8192, 8192}))
+ ),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateEdgeCaseInputs()
+{
+ std::vector<TestInputCreator::SharedConst> result;
+ for (unsigned i(64); i <= 512; i += 64) {
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i-1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i-1})));
+ }
+
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 1})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 2})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 1})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 2})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 462})));
+
+ return result;
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Edge, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateEdgeCaseInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateMiscInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({150, 75})),
+ TestInputCreator::Shared(new FixedSizeCreator({10, 10})),
+ TestInputCreator::Shared(new FixedSizeCreator({385, 610})),
+ TestInputCreator::Shared(new FixedSizeCreator({1245, 1281})),
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Misc, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateMiscInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+} // namespace Encode
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index d52f58233cc5..490ec941feb5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -25,6 +25,8 @@
#ifndef I965_JPEG_TEST_DATA_H
#define I965_JPEG_TEST_DATA_H
+#include "i965_test_fixture.h"
+
#include <array>
#include <iostream>
#include <map>
@@ -183,6 +185,18 @@ namespace Decode {
const HuffmanTable& huffman = defaultHuffmanTable,
const IQMatrix& iqmatrix = defaultIQMatrix)
{
+ return make(fourcc, slice, W, H, sparam, pparam, huffman, iqmatrix);
+ }
+
+ static SharedConst make(
+ const unsigned fourcc,
+ const ByteData& slice,
+ const unsigned w, const unsigned h,
+ const SliceParameter& sparam = defaultSliceParameter,
+ const PictureParameter& pparam = defaultPictureParameter,
+ const HuffmanTable& huffman = defaultHuffmanTable,
+ const IQMatrix& iqmatrix = defaultIQMatrix)
+ {
Shared pd(
new PictureData {
slice: slice,
@@ -196,8 +210,8 @@ namespace Decode {
);
pd->sparam.slice_data_size = slice.size();
- pd->pparam.picture_width = W;
- pd->pparam.picture_height = H;
+ pd->pparam.picture_width = w;
+ pd->pparam.picture_height = h;
switch(fourcc)
{
@@ -232,8 +246,8 @@ namespace Decode {
/* Calculate num_mcus */
int hfactor = pd->pparam.components[0].h_sampling_factor << 3;
int vfactor = pd->pparam.components[0].v_sampling_factor << 3;
- int wmcu = (W + hfactor - 1) / hfactor;
- int hmcu = (H + vfactor - 1) / vfactor;
+ int wmcu = (w + hfactor - 1) / hfactor;
+ int hmcu = (h + vfactor - 1) / vfactor;
pd->sparam.num_mcus = wmcu * hmcu;
return pd;
@@ -321,4 +335,180 @@ namespace Decode {
} // namespace Decode
} // namespace JPEG
+namespace JPEG {
+namespace Encode {
+ typedef VAQMatrixBufferJPEG IQMatrix;
+ typedef VAHuffmanTableBufferJPEGBaseline HuffmanTable;
+ typedef VAEncPictureParameterBufferJPEG PictureParameter;
+ typedef VAEncSliceParameterBufferJPEG SliceParameter;
+
+ static const VAEntrypoint entrypoint = VAEntrypointEncPicture;
+
+ static const IQMatrix defaultIQMatrix = { /* Quality 50 */
+ load_lum_quantiser_matrix: 1,
+ load_chroma_quantiser_matrix: 1,
+ lum_quantiser_matrix: {
+ 0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
+ 0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
+ 0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
+ 0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
+ 0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
+ 0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
+ 0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
+ 0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
+ },
+ chroma_quantiser_matrix: {
+ 0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
+ 0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ },
+ };
+
+ static const HuffmanTable defaultHuffmanTable =
+ ::JPEG::Decode::defaultHuffmanTable;
+
+ static const PictureParameter defaultPictureParameter = {
+ reconstructed_picture: VA_INVALID_ID,
+ picture_width: 10,
+ picture_height: 10,
+ coded_buf: VA_INVALID_ID,
+ pic_flags: {value: 0x00100},
+ sample_bit_depth: 8,
+ num_scan: 1,
+ num_components: 3,
+ component_id: {0, 1, 2, 0},
+ quantiser_table_selector: {0, 1, 1, 0},
+ quality: 100,
+ };
+
+ static const SliceParameter defaultSliceParameter = {
+ restart_interval: 0,
+ num_components: 3,
+ /* component_selector, dc_table_selector, ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}},
+ };
+
+ class TestInput
+ {
+ typedef std::shared_ptr<TestInput> Shared;
+ typedef std::shared_ptr<TestInput> SharedConst;
+
+ TestInput(const unsigned fourcc, const unsigned w, const unsigned h)
+ : bytes() // caller must fill this in after instantiation
+ , picture(defaultPictureParameter)
+ , matrix(defaultIQMatrix)
+ , huffman(defaultHuffmanTable)
+ , slice(defaultSliceParameter)
+ , fourcc(fourcc)
+ , fourcc_output(fourcc)
+ , format(0)
+ , planes(0)
+ , widths{0,0,0}
+ , heights{0,0,0}
+ , offsets{0,0,0}
+ , sizes{0,0,0}
+ {
+ picture.picture_width = ALIGN(w,2);
+ picture.picture_height = ALIGN(h,2);
+
+ switch(fourcc) {
+ planes = 3;
+ widths = {
+ w +( w & 1),
+ (w + 1) >> 1,
+ (w + 1) >> 1
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ (h + 1) >> 1
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ planes = 2;
+ widths = {
+ w + (w & 1),
+ w + (w & 1),
+ 0
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ 0
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ return;
+ }
+
+ for (size_t i(0); i < planes; ++i) {
+ sizes[i] = widths[i] * heights[i];
+ }
+
+ for (size_t i(1); i < planes; ++i) {
+ offsets[i] = sizes[i - 1];
+ offsets[i] += offsets[i - 1];
+ }
+ }
+
+ const unsigned width() const
+ {
+ return picture.picture_width;
+ }
+
+ const unsigned height() const
+ {
+ return picture.picture_height;
+ }
+
+ const uint8_t* plane(const size_t i) const
+ {
+ return bytes.data() + offsets[i];
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const TestInput& t)
+ {
+ return os
+ << std::string((char*)(&t.fourcc), 4)
+ << " " << t.width() << "x" << t.height()
+ << " " << t.widths << " " << t.heights
+ << " " << t.sizes << " " << t.offsets
+ ;
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const Shared& t)
+ {
+ return os << *t;
+ }
+
+ ByteData bytes;
+ PictureParameter picture;
+ IQMatrix matrix;
+ HuffmanTable huffman;
+ SliceParameter slice;
+ unsigned fourcc;
+ unsigned fourcc_output;
+ unsigned format;
+ size_t planes;
+ std::array<size_t, 3> widths;
+ std::array<size_t, 3> heights;
+ std::array<size_t, 3> offsets;
+ std::array<size_t, 3> sizes;
+ };
+
+
+} // namespace Encode
+} // namespace JPEG
+
#endif
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 54d85d223789..c805b359e19f 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -35,6 +35,7 @@
typedef std::vector<VASurfaceID> Surfaces;
typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
+typedef std::vector<VABufferID> Buffers;
/**
* This test fixture handles initialization and termination of the i965 driver
Eoff, Ullysses A
2016-10-12 19:57:53 UTC
Permalink
I have not seen these two (7680x4320 YUY2 and UYVY) fail before on my SKL... I just ran them
both 25 times each and did not get any failures:

"./test_i965_drv_video --gtest_filter=Common/JPEGEncodeInputTest.Full/98 --gtest_repeat=25"
"./test_i965_drv_video --gtest_filter=Common/JPEGEncodeInputTest.Full/97 --gtest_repeat=25"

What is the test failure that you are seeing?

Note that the YUV input data for these tests is random... so in this regard, the test is different
each time it's executed. The random YUV input data can have an effect on the actual size
required for the coded buffer result. So my guess is that the tests could fail for one of two reasons:

1. The user allocated coded buffer is not large enough for the driver's encoding result (i.e. overflow occurs).
2. For some specific random YUV data inputs, the decoded output YUV result does not match.

For the 7680x4320 I420 case, the test always fails due to YUV input/output mismatch. IIRC, the
difference between the failing Y values are within a tolerance of 7 or 8. But these tests only allow
a tolerance of 2.

----
U. Artie
-----Original Message-----
From: Xiang, Haihao
Sent: Wednesday, October 12, 2016 12:17 PM
Subject: RE: [Libva] [PATCH intel-driver v2 7/7] test: add some jpeg encode tests
Hi Artie,
When I was investigating the issue with the 7680x4320 I420 test, I experienced random failures
with Common/JPEGEncodeInputTest.Full/98 and Common/JPEGEncodeInputTest.Full/97. I guess
it is caused by the test case, did you see this issue in your side? To reproduce the issue, you should run the case a few times.
Thanks
Haihao
-----Original Message-----
Kelley
Sent: Thursday, September 29, 2016 4:15 AM
Subject: Re: [Libva] [PATCH intel-driver v2 7/7] test: add some jpeg encode
tests
Add JPEG encode tests that encode raw I420 and NV12 data
at quality 100 and then decodes them to verify proper
encoding.
Currently, the 7680x4320 I420 test fails because ~40-60
Y-values (i.e. plane 0) in each line from the decoded
bitstream are off by more than 2 of the original raw
I420 values. It is not clear why only this resolution
exhibits this problem.
Ah this was the one we talked about. Accepted.
Sean
v2: don't create any input data in test fixture if
jpeg encoding is not supported.
---
test/Makefile.am | 1 +
test/i965_jpeg_encode_test.cpp | 699
+++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 198 +++++++++++-
test/i965_test_fixture.h | 1 +
4 files changed, 895 insertions(+), 4 deletions(-)
create mode 100644 test/i965_jpeg_encode_test.cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index 2e9edda648a4..99560f8d8a54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -57,6 +57,7 @@ test_i965_drv_video_SOURCES =
\
i965_jpeg_test_data.cpp
\
i965_test_fixture.cpp
\
i965_jpeg_decode_test.cpp
\
+ i965_jpeg_encode_test.cpp
\
object_heap_test.cpp
\
test_main.cpp
\
$(NULL)
diff --git a/test/i965_jpeg_encode_test.cpp
b/test/i965_jpeg_encode_test.cpp
new file mode 100644
index 000000000000..08d80c4f75b7
--- /dev/null
+++ b/test/i965_jpeg_encode_test.cpp
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+#include "test_utils.h"
+
+#include <algorithm>
+#include <cstring>
+#include <fstream>
+#include <memory>
+#include <sstream>
+#include <tuple>
+
+namespace JPEG {
+namespace Encode {
+
+class JPEGEncodeTest
+ : public I965TestFixture
+{
+ JPEGEncodeTest()
+ : I965TestFixture()
+ , config(VA_INVALID_ID) // invalid
+ , context(VA_INVALID_ID) // invalid
+ { }
+
+ virtual void TearDown()
+ {
+ if (context != VA_INVALID_ID) {
+ destroyContext(context);
+ context = VA_INVALID_ID;
+ }
+
+ if (config != VA_INVALID_ID) {
+ destroyConfig(config);
+ config = VA_INVALID_ID;
+ }
+
+ I965TestFixture::TearDown();
+ }
+
+ VAConfigID config;
+ VAContextID context;
+};
+
+TEST_F(JPEGEncodeTest, Entrypoint)
+{
+ ConfigAttribs attributes;
+ struct i965_driver_data *i965(*this);
+
+ ASSERT_PTR(i965);
+
+ if (HAS_JPEG_ENCODING(i965)) {
+ config = createConfig(profile, entrypoint, attributes);
+ } else {
+ VAStatus status = i965_CreateConfig(
+ *this, profile, entrypoint, attributes.data(), attributes.size(),
+ &config);
+
EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT,
status);
+ EXPECT_INVALID_ID(config);
+ }
+}
+
+class TestInputCreator
+{
+ typedef std::shared_ptr<TestInputCreator> Shared;
+ typedef std::shared_ptr<const TestInputCreator> SharedConst;
+
+ TestInput::Shared create(const unsigned fourcc) const
+ {
+ const std::array<unsigned, 2> res = getResolution();
+
+ TestInput::Shared input(new TestInput(fourcc, res[0], res[1]));
+ ByteData& bytes = input->bytes;
+
+ RandomValueGenerator<uint8_t> rg(0x00, 0xff);
+ for (size_t i(0); i < input->planes; ++i)
+ std::generate_n(
+ std::back_inserter(bytes), input->sizes[i],
+ [&rg]{ return rg(); });
+ return input;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator& t)
+ {
+ t.repr(os);
+ return os;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::Shared& t)
+ {
+ return os << *t;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::SharedConst& t)
+ {
+ return os << *t;
+ }
+
+ virtual std::array<unsigned, 2> getResolution() const = 0;
+ virtual void repr(std::ostream& os) const = 0;
+};
+
+template <typename T>
+const std::string toString(const T& t)
+{
+ std::ostringstream os;
+ os << t;
+ return os.str();
+}
+
+const TestInput::Shared NV12toI420(const TestInput::SharedConst& nv12)
+{
+ TestInput::Shared i420(
+ new TestInput(VA_FOURCC_I420, nv12->width(), nv12-
Post by U. Artie Eoff
height()));
+
+ i420->bytes = nv12->bytes;
+
+ size_t i(0);
+ auto predicate = [&i](const ByteData::value_type&) {
+ bool isu = ((i % 2) == 0) or (i == 0);
+ ++i;
+ return isu;
+ };
+
+ std::stable_partition(
+ i420->bytes.begin() + i420->offsets[1],
+ i420->bytes.end(), predicate);
+
+ return i420;
+}
+
+#define ASSERT_NO_FAILURE(statement) \
+ statement; \
+ ASSERT_FALSE(HasFailure());
+
+class JPEGEncodeInputTest
+ : public JPEGEncodeTest
+ , public ::testing::WithParamInterface<
+ std::tuple<TestInputCreator::SharedConst, const char*> >
+{
+ JPEGEncodeInputTest()
+ : JPEGEncodeTest::JPEGEncodeTest()
+ , surfaces() // empty
+ , coded(VA_INVALID_ID) // invalid
+ , renderBuffers() // empty
+ , input() // invalid
+ , output() // empty
+ { }
+
+ virtual void SetUp()
+ {
+ JPEGEncodeTest::SetUp();
+
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965))
+ return;
+
+ TestInputCreator::SharedConst creator;
+ std::string sFourcc;
+ std::tie(creator, sFourcc) = GetParam();
+
+ ASSERT_PTR(creator.get()) << "Invalid test input creator parameter";
+
+ ASSERT_EQ(4u, sFourcc.size())
+ << "Invalid fourcc parameter '" << sFourcc << "'";
+
+ unsigned fourcc = VA_FOURCC(
+ sFourcc[0], sFourcc[1], sFourcc[2], sFourcc[3]);
+
+ input = creator->create(fourcc);
+
+ ASSERT_PTR(input.get())
+ << "Unhandled fourcc parameter '" << sFourcc << "'"
+ << " = 0x" << std::hex << fourcc << std::dec;
+
+ ASSERT_EQ(fourcc, input->fourcc);
+
+ RecordProperty("test_input", toString(*input));
+ }
+
+ virtual void TearDown()
+ {
+ for (auto id : renderBuffers) {
+ if (id != VA_INVALID_ID) {
+ destroyBuffer(id);
+ }
+ }
+ renderBuffers.clear();
+
+ if (coded != VA_INVALID_ID) {
+ destroyBuffer(coded);
+ coded = VA_INVALID_ID;
+ }
+
+ if (not surfaces.empty()) {
+ destroySurfaces(surfaces);
+ surfaces.clear();
+ }
+
+ if (std::get<0>(GetParam()).get())
+ std::cout << "Creator: " << std::get<0>(GetParam()) << std::endl;
+ if (input.get())
+ std::cout << "Input : " << input << std::endl;
+
+ JPEGEncodeTest::TearDown();
+ }
+
+ void Encode()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ ASSERT_NO_FAILURE(
+ beginPicture(context, surfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(context, renderBuffers.data(),
renderBuffers.size()));
+ ASSERT_NO_FAILURE(
+ endPicture(context));
+ ASSERT_NO_FAILURE(
+ syncSurface(surfaces.front()));
+ ASSERT_NO_FAILURE(
+ VACodedBufferSegment *segment =
+ mapBuffer<VACodedBufferSegment>(coded));
+
+ EXPECT_FALSE(segment->status &
VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
+ << "segment->size = " << segment->size;
+ EXPECT_PTR_NULL(segment->next);
+
+ // copy segment buffer to output while stripping the packed header data
+ const size_t headerSize(1);
+ output.resize(segment->size - headerSize, 0x0);
+ std::memcpy(
+ output.data(),
+ reinterpret_cast<uint8_t *>(segment->buf) + headerSize,
+ segment->size - headerSize);
+
+ unmapBuffer(coded);
+
+ // EOI JPEG Marker
+ ASSERT_GE(output.size(), 2u);
+ EXPECT_TRUE(
+ unsigned(0xff) == unsigned(*(output.end() - 2)) and
+ unsigned(0xd9) == unsigned(output.back()))
+ << "Invalid JPEG EOI Marker";
+ }
+
+ void SetUpSurfaces()
+ {
+ SurfaceAttribs attributes(1);
+ attributes.front().flags = VA_SURFACE_ATTRIB_SETTABLE;
+ attributes.front().type = VASurfaceAttribPixelFormat;
+ attributes.front().value.type = VAGenericValueTypeInteger;
+ attributes.front().value.value.i = input->fourcc;
+ surfaces = createSurfaces(input->width(), input->height(),
+ input->format, 1, attributes);
+ }
+
+ void CopyInputToSurface()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ VAImage image;
+ deriveImage(surfaces.front(), image);
+ if (HasFailure())
+ return;
+
+ SCOPED_TRACE(::testing::Message() << std::endl << image);
+
+ RecordProperty("input_image", toString(image));
+
+ EXPECT_EQ(input->planes, image.num_planes);
+ EXPECT_GT(image.data_size, 0u);
+ EXPECT_EQ(input->width(), image.width);
+ EXPECT_EQ(input->height(), image.height);
+ if (HasFailure()) {
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ return;
+ }
+
+ uint8_t *data = mapBuffer<uint8_t>(image.buf);
+ if (HasFailure()) {
+ destroyImage(image);
+ return;
+ }
+
+ std::memset(data, 0, image.data_size);
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = input->widths[i];
+ size_t h = input->heights[i];
+
+ EXPECT_GE(image.pitches[i], w);
+ if (HasFailure())
+ break;
+
+ const ByteData::value_type *source = input->plane(i);
+ uint8_t *dest = data + image.offsets[i];
+ for (size_t r(0); r < h; ++r) {
+ std::memcpy(dest, source, w);
+ source += w;
+ dest += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ }
+
+ void SetUpConfig()
+ {
+ ASSERT_INVALID_ID(config);
+ ConfigAttribs attributes(
+ 1, {type:VAConfigAttribRTFormat, value:input->format});
+ config = createConfig(profile, entrypoint, attributes);
+ }
+
+ void SetUpContext()
+ {
+ ASSERT_INVALID_ID(context);
+ context = createContext(config, input->width(),
+ input->height(), 0, surfaces);
+ }
+
+ void SetUpCodedBuffer()
+ {
+ ASSERT_INVALID_ID(coded);
+ unsigned size =
+ std::accumulate(input->sizes.begin(), input->sizes.end(), 8192u);
+ size *= input->planes;
+ coded = createBuffer(context, VAEncCodedBufferType, size);
+ }
+
+ void SetUpPicture()
+ {
+ input->picture.coded_buf = coded;
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPictureParameterBufferType,
+ sizeof(PictureParameter), 1, &input->picture));
+ }
+
+ void SetUpIQMatrix()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAQMatrixBufferType, sizeof(IQMatrix),
+ 1, &input->matrix));
+ }
+
+ void SetUpHuffmanTables()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAHuffmanTableBufferType,
+ sizeof(HuffmanTable), 1, &input->huffman));
+ }
+
+ void SetUpSlice()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAEncSliceParameterBufferType,
+ sizeof(SliceParameter), 1, &input->slice));
+ }
+
+ void SetUpHeader()
+ {
+ /*
+ * The driver expects a packed JPEG header which it prepends to the
+ * coded buffer segment output. The driver does not appear to inspect
+ * this header, however. So we'll just create a 1-byte packed header
+ * since we really don't care if it contains a "valid" JPEG header.
+ */
+ renderBuffers.push_back(
+ createBuffer(context,
VAEncPackedHeaderParameterBufferType,
+ sizeof(VAEncPackedHeaderParameterBuffer)));
+ if (HasFailure())
+ return;
+
+ VAEncPackedHeaderParameterBuffer *packed =
+
mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back());
+ if (HasFailure())
+ return;
+
+ std::memset(packed, 0, sizeof(*packed));
+ packed->type = VAEncPackedHeaderRawData;
+ packed->bit_length = 8;
+ packed->has_emulation_bytes = 0;
+
+ unmapBuffer(renderBuffers.back());
+
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderDataBufferType, 1));
+ }
+
+ Surfaces surfaces;
+ VABufferID coded;
+ Buffers renderBuffers;
+ TestInput::Shared input;
+ ByteData output;
+
+ void VerifyOutput()
+ {
+ // VerifyOutput only supports VA_FOURCC_IMC3 output, currently
+ ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input-
Post by U. Artie Eoff
fourcc_output);
+ TestInput::SharedConst expect = input;
+ if (input->fourcc == VA_FOURCC_NV12)
+ expect = NV12toI420(input);
+
+ ::JPEG::Decode::PictureData::SharedConst pd =
+ ::JPEG::Decode::PictureData::make(
+ input->fourcc_output, output, input->width(), input-
Post by U. Artie Eoff
height());
+
+ ASSERT_NO_FAILURE(
+ Surfaces osurfaces = createSurfaces(
+ pd->pparam.picture_width, pd->pparam.picture_height,
+ pd->format));;
+
+ ConfigAttribs attribs(
+ 1, {type:VAConfigAttribRTFormat, value:pd->format});
+ ASSERT_NO_FAILURE(
+ VAConfigID oconfig = createConfig(
+ ::JPEG::profile, ::JPEG::Decode::entrypoint, attribs));
+
+ ASSERT_NO_FAILURE(
+ VAContextID ocontext = createContext(
+ oconfig, pd->pparam.picture_width, pd-
Post by U. Artie Eoff
pparam.picture_height,
+ 0, osurfaces));
+
+ Buffers buffers;
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceDataBufferType, pd-
Post by U. Artie Eoff
sparam.slice_data_size,
+ 1, pd->slice.data())));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceParameterBufferType, sizeof(pd-
Post by U. Artie Eoff
sparam),
+ 1, &pd->sparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,VAPictureParameterBufferType, sizeof(pd-
Post by U. Artie Eoff
pparam),
+ 1, &pd->pparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAIQMatrixBufferType, sizeof(pd->iqmatrix),
+ 1, &pd->iqmatrix)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAHuffmanTableBufferType, sizeof(pd-
Post by U. Artie Eoff
huffman),
+ 1, &pd->huffman)));
+
+ ASSERT_NO_FAILURE(beginPicture(ocontext, osurfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(ocontext, buffers.data(), buffers.size()));
+ ASSERT_NO_FAILURE(endPicture(ocontext));
+ ASSERT_NO_FAILURE(syncSurface(osurfaces.front()));
+
+ VAImage image;
+ ASSERT_NO_FAILURE(deriveImage(osurfaces.front(), image));
+ ASSERT_NO_FAILURE(uint8_t *data =
mapBuffer<uint8_t>(image.buf));
+
+ auto isClose = [](const uint8_t& a, const uint8_t& b) {
+ return std::abs(int(a)-int(b)) <= 2;
+ };
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = expect->widths[i];
+ size_t h = expect->heights[i];
+
+ const ByteData::value_type *source = expect->plane(i);
+ const uint8_t *result = data + image.offsets[i];
+ ASSERT_GE(image.pitches[i], w);
+ for (size_t r(0); r < h; ++r) {
+ EXPECT_TRUE(std::equal(result, result + w, source, isClose))
+ << "Byte(s) mismatch in plane " << i << " row " << r;
+ source += w;
+ result += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+
+ for (auto id : buffers)
+ destroyBuffer(id);
+
+ destroyImage(image);
+ destroyContext(ocontext);
+ destroyConfig(oconfig);
+ destroySurfaces(osurfaces);
+ }
+};
+
+TEST_P(JPEGEncodeInputTest, Full)
+{
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965)) {
+ RecordProperty("skipped", true);
+ std::cout << "[ SKIPPED ] " << getFullTestName()
+ << " is unsupported on this hardware" << std::endl;
+ return;
+ }
+
+ ASSERT_NO_FAILURE(SetUpSurfaces());
+ ASSERT_NO_FAILURE(SetUpConfig());
+ ASSERT_NO_FAILURE(SetUpContext());
+ ASSERT_NO_FAILURE(SetUpCodedBuffer());
+ ASSERT_NO_FAILURE(SetUpPicture());
+ ASSERT_NO_FAILURE(SetUpIQMatrix());
+ ASSERT_NO_FAILURE(SetUpHuffmanTables());
+ ASSERT_NO_FAILURE(SetUpSlice());
+ ASSERT_NO_FAILURE(SetUpHeader());
+ ASSERT_NO_FAILURE(CopyInputToSurface());
+ ASSERT_NO_FAILURE(Encode());
+
+ VerifyOutput();
+}
+
+class RandomSizeCreator
+ : public TestInputCreator
+{
+ std::array<unsigned, 2> getResolution() const
+ {
+ static RandomValueGenerator<unsigned> rg(1, 769);
+ return {rg(), rg()};
+ }
+ void repr(std::ostream& os) const { os << "Random Size"; }
+};
+
+INSTANTIATE_TEST_CASE_P(
+ Random, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(
+ std::vector<TestInputCreator::SharedConst>(
+ 5, TestInputCreator::SharedConst(new
RandomSizeCreator))),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+class FixedSizeCreator
+ : public TestInputCreator
+{
+ FixedSizeCreator(const std::array<unsigned, 2>& resolution)
+ : res(resolution)
+ { }
+
+ std::array<unsigned, 2> getResolution() const { return res; }
+ void repr(std::ostream& os) const
+ {
+ os << "Fixed Size " << res[0] << "x" << res[1];
+ }
+
+ const std::array<unsigned, 2> res;
+};
+
+typedef std::vector<TestInputCreator::SharedConst> InputCreators;
+
+InputCreators generateCommonInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({800, 600})), /* SVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 600})), /* WSVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 768})), /* XGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1152, 864})), /* XGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 720})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 768})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 800})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 1024})), /* SXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1360, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1366, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1440, 900})), /* WXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 900})), /* HD+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 1200})), /* UXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1680, 1050})), /* WSXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1080})), /* FHD */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1200})), /* WUXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1440})), /* WQHD */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1600})), /* WQXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({3640, 2160})), /* UHD (4K) */
+ TestInputCreator::Shared(new FixedSizeCreator({7680, 4320})), /* UHD (8K) */
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Common, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateCommonInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+INSTANTIATE_TEST_CASE_P(
+ Big, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::Values(
+ TestInputCreator::Shared(new FixedSizeCreator({8192, 8192}))
+ ),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateEdgeCaseInputs()
+{
+ std::vector<TestInputCreator::SharedConst> result;
+ for (unsigned i(64); i <= 512; i += 64) {
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i-1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i-1})));
+ }
+
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 1})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 2})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 1})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 2})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 462})));
+
+ return result;
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Edge, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateEdgeCaseInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateMiscInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({150, 75})),
+ TestInputCreator::Shared(new FixedSizeCreator({10, 10})),
+ TestInputCreator::Shared(new FixedSizeCreator({385, 610})),
+ TestInputCreator::Shared(new FixedSizeCreator({1245, 1281})),
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Misc, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateMiscInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+} // namespace Encode
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index d52f58233cc5..490ec941feb5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -25,6 +25,8 @@
#ifndef I965_JPEG_TEST_DATA_H
#define I965_JPEG_TEST_DATA_H
+#include "i965_test_fixture.h"
+
#include <array>
#include <iostream>
#include <map>
@@ -183,6 +185,18 @@ namespace Decode {
const HuffmanTable& huffman = defaultHuffmanTable,
const IQMatrix& iqmatrix = defaultIQMatrix)
{
+ return make(fourcc, slice, W, H, sparam, pparam, huffman, iqmatrix);
+ }
+
+ static SharedConst make(
+ const unsigned fourcc,
+ const ByteData& slice,
+ const unsigned w, const unsigned h,
+ const SliceParameter& sparam = defaultSliceParameter,
+ const PictureParameter& pparam = defaultPictureParameter,
+ const HuffmanTable& huffman = defaultHuffmanTable,
+ const IQMatrix& iqmatrix = defaultIQMatrix)
+ {
Shared pd(
new PictureData {
slice: slice,
@@ -196,8 +210,8 @@ namespace Decode {
);
pd->sparam.slice_data_size = slice.size();
- pd->pparam.picture_width = W;
- pd->pparam.picture_height = H;
+ pd->pparam.picture_width = w;
+ pd->pparam.picture_height = h;
switch(fourcc)
{
@@ -232,8 +246,8 @@ namespace Decode {
/* Calculate num_mcus */
int hfactor = pd->pparam.components[0].h_sampling_factor << 3;
int vfactor = pd->pparam.components[0].v_sampling_factor << 3;
- int wmcu = (W + hfactor - 1) / hfactor;
- int hmcu = (H + vfactor - 1) / vfactor;
+ int wmcu = (w + hfactor - 1) / hfactor;
+ int hmcu = (h + vfactor - 1) / vfactor;
pd->sparam.num_mcus = wmcu * hmcu;
return pd;
@@ -321,4 +335,180 @@ namespace Decode {
} // namespace Decode
} // namespace JPEG
+namespace JPEG {
+namespace Encode {
+ typedef VAQMatrixBufferJPEG IQMatrix;
+ typedef VAHuffmanTableBufferJPEGBaseline HuffmanTable;
+ typedef VAEncPictureParameterBufferJPEG PictureParameter;
+ typedef VAEncSliceParameterBufferJPEG SliceParameter;
+
+ static const VAEntrypoint entrypoint = VAEntrypointEncPicture;
+
+ static const IQMatrix defaultIQMatrix = { /* Quality 50 */
+ load_lum_quantiser_matrix: 1,
+ load_chroma_quantiser_matrix: 1,
+ lum_quantiser_matrix: {
+ 0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
+ 0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
+ 0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
+ 0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
+ 0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
+ 0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
+ 0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
+ 0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
+ },
+ chroma_quantiser_matrix: {
+ 0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
+ 0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ },
+ };
+
+ static const HuffmanTable defaultHuffmanTable =
+ ::JPEG::Decode::defaultHuffmanTable;
+
+ static const PictureParameter defaultPictureParameter = {
+ reconstructed_picture: VA_INVALID_ID,
+ picture_width: 10,
+ picture_height: 10,
+ coded_buf: VA_INVALID_ID,
+ pic_flags: {value: 0x00100},
+ sample_bit_depth: 8,
+ num_scan: 1,
+ num_components: 3,
+ component_id: {0, 1, 2, 0},
+ quantiser_table_selector: {0, 1, 1, 0},
+ quality: 100,
+ };
+
+ static const SliceParameter defaultSliceParameter = {
+ restart_interval: 0,
+ num_components: 3,
+ /* component_selector, dc_table_selector, ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}},
+ };
+
+ class TestInput
+ {
+ typedef std::shared_ptr<TestInput> Shared;
+ typedef std::shared_ptr<TestInput> SharedConst;
+
+ TestInput(const unsigned fourcc, const unsigned w, const unsigned h)
+ : bytes() // caller must fill this in after instantiation
+ , picture(defaultPictureParameter)
+ , matrix(defaultIQMatrix)
+ , huffman(defaultHuffmanTable)
+ , slice(defaultSliceParameter)
+ , fourcc(fourcc)
+ , fourcc_output(fourcc)
+ , format(0)
+ , planes(0)
+ , widths{0,0,0}
+ , heights{0,0,0}
+ , offsets{0,0,0}
+ , sizes{0,0,0}
+ {
+ picture.picture_width = ALIGN(w,2);
+ picture.picture_height = ALIGN(h,2);
+
+ switch(fourcc) {
+ planes = 3;
+ widths = {
+ w +( w & 1),
+ (w + 1) >> 1,
+ (w + 1) >> 1
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ (h + 1) >> 1
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ planes = 2;
+ widths = {
+ w + (w & 1),
+ w + (w & 1),
+ 0
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ 0
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ return;
+ }
+
+ for (size_t i(0); i < planes; ++i) {
+ sizes[i] = widths[i] * heights[i];
+ }
+
+ for (size_t i(1); i < planes; ++i) {
+ offsets[i] = sizes[i - 1];
+ offsets[i] += offsets[i - 1];
+ }
+ }
+
+ const unsigned width() const
+ {
+ return picture.picture_width;
+ }
+
+ const unsigned height() const
+ {
+ return picture.picture_height;
+ }
+
+ const uint8_t* plane(const size_t i) const
+ {
+ return bytes.data() + offsets[i];
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const TestInput& t)
+ {
+ return os
+ << std::string((char*)(&t.fourcc), 4)
+ << " " << t.width() << "x" << t.height()
+ << " " << t.widths << " " << t.heights
+ << " " << t.sizes << " " << t.offsets
+ ;
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const Shared& t)
+ {
+ return os << *t;
+ }
+
+ ByteData bytes;
+ PictureParameter picture;
+ IQMatrix matrix;
+ HuffmanTable huffman;
+ SliceParameter slice;
+ unsigned fourcc;
+ unsigned fourcc_output;
+ unsigned format;
+ size_t planes;
+ std::array<size_t, 3> widths;
+ std::array<size_t, 3> heights;
+ std::array<size_t, 3> offsets;
+ std::array<size_t, 3> sizes;
+ };
+
+
+} // namespace Encode
+} // namespace JPEG
+
#endif
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 54d85d223789..c805b359e19f 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -35,6 +35,7 @@
typedef std::vector<VASurfaceID> Surfaces;
typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
+typedef std::vector<VABufferID> Buffers;
/**
* This test fixture handles initialization and termination of the i965 driver
Kelley, Sean V
2016-10-12 20:29:48 UTC
Permalink
I’ve not seen any issues in multiple runs either, Haihao. I likewise ran them again today. No failures.

What platform are you testing on?

Sean

On 10/12/16, 12:57 PM, "Libva on behalf of Eoff, Ullysses A" <libva-***@lists.freedesktop.org on behalf of ***@intel.com> wrote:

I have not seen these two (7680x4320 YUY2 and UYVY) fail before on my SKL... I just ran them
both 25 times each and did not get any failures:

"./test_i965_drv_video --gtest_filter=Common/JPEGEncodeInputTest.Full/98 --gtest_repeat=25"
"./test_i965_drv_video --gtest_filter=Common/JPEGEncodeInputTest.Full/97 --gtest_repeat=25"

What is the test failure that you are seeing?

Note that the YUV input data for these tests is random... so in this regard, the test is different
each time it's executed. The random YUV input data can have an effect on the actual size
required for the coded buffer result. So my guess is that the tests could fail for one of two reasons:

1. The user allocated coded buffer is not large enough for the driver's encoding result (i.e. overflow occurs).
2. For some specific random YUV data inputs, the decoded output YUV result does not match.

For the 7680x4320 I420 case, the test always fails due to YUV input/output mismatch. IIRC, the
difference between the failing Y values are within a tolerance of 7 or 8. But these tests only allow
a tolerance of 2.

----
U. Artie
-----Original Message-----
From: Xiang, Haihao
Sent: Wednesday, October 12, 2016 12:17 PM
Subject: RE: [Libva] [PATCH intel-driver v2 7/7] test: add some jpeg encode tests
Hi Artie,
When I was investigating the issue with the 7680x4320 I420 test, I experienced random failures
with Common/JPEGEncodeInputTest.Full/98 and Common/JPEGEncodeInputTest.Full/97. I guess
it is caused by the test case, did you see this issue in your side? To reproduce the issue, you should run the case a few times.
Thanks
Haihao
-----Original Message-----
Kelley
Sent: Thursday, September 29, 2016 4:15 AM
Subject: Re: [Libva] [PATCH intel-driver v2 7/7] test: add some jpeg encode
tests
Add JPEG encode tests that encode raw I420 and NV12 data
at quality 100 and then decodes them to verify proper
encoding.
Currently, the 7680x4320 I420 test fails because ~40-60
Y-values (i.e. plane 0) in each line from the decoded
bitstream are off by more than 2 of the original raw
I420 values. It is not clear why only this resolution
exhibits this problem.
Ah this was the one we talked about. Accepted.
Sean
v2: don't create any input data in test fixture if
jpeg encoding is not supported.
---
test/Makefile.am | 1 +
test/i965_jpeg_encode_test.cpp | 699
+++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 198 +++++++++++-
test/i965_test_fixture.h | 1 +
4 files changed, 895 insertions(+), 4 deletions(-)
create mode 100644 test/i965_jpeg_encode_test.cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index 2e9edda648a4..99560f8d8a54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -57,6 +57,7 @@ test_i965_drv_video_SOURCES =
\
i965_jpeg_test_data.cpp
\
i965_test_fixture.cpp
\
i965_jpeg_decode_test.cpp
\
+ i965_jpeg_encode_test.cpp
\
object_heap_test.cpp
\
test_main.cpp
\
$(NULL)
diff --git a/test/i965_jpeg_encode_test.cpp
b/test/i965_jpeg_encode_test.cpp
new file mode 100644
index 000000000000..08d80c4f75b7
--- /dev/null
+++ b/test/i965_jpeg_encode_test.cpp
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+#include "test_utils.h"
+
+#include <algorithm>
+#include <cstring>
+#include <fstream>
+#include <memory>
+#include <sstream>
+#include <tuple>
+
+namespace JPEG {
+namespace Encode {
+
+class JPEGEncodeTest
+ : public I965TestFixture
+{
+ JPEGEncodeTest()
+ : I965TestFixture()
+ , config(VA_INVALID_ID) // invalid
+ , context(VA_INVALID_ID) // invalid
+ { }
+
+ virtual void TearDown()
+ {
+ if (context != VA_INVALID_ID) {
+ destroyContext(context);
+ context = VA_INVALID_ID;
+ }
+
+ if (config != VA_INVALID_ID) {
+ destroyConfig(config);
+ config = VA_INVALID_ID;
+ }
+
+ I965TestFixture::TearDown();
+ }
+
+ VAConfigID config;
+ VAContextID context;
+};
+
+TEST_F(JPEGEncodeTest, Entrypoint)
+{
+ ConfigAttribs attributes;
+ struct i965_driver_data *i965(*this);
+
+ ASSERT_PTR(i965);
+
+ if (HAS_JPEG_ENCODING(i965)) {
+ config = createConfig(profile, entrypoint, attributes);
+ } else {
+ VAStatus status = i965_CreateConfig(
+ *this, profile, entrypoint, attributes.data(), attributes.size(),
+ &config);
+
EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT,
status);
+ EXPECT_INVALID_ID(config);
+ }
+}
+
+class TestInputCreator
+{
+ typedef std::shared_ptr<TestInputCreator> Shared;
+ typedef std::shared_ptr<const TestInputCreator> SharedConst;
+
+ TestInput::Shared create(const unsigned fourcc) const
+ {
+ const std::array<unsigned, 2> res = getResolution();
+
+ TestInput::Shared input(new TestInput(fourcc, res[0], res[1]));
+ ByteData& bytes = input->bytes;
+
+ RandomValueGenerator<uint8_t> rg(0x00, 0xff);
+ for (size_t i(0); i < input->planes; ++i)
+ std::generate_n(
+ std::back_inserter(bytes), input->sizes[i],
+ [&rg]{ return rg(); });
+ return input;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator& t)
+ {
+ t.repr(os);
+ return os;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::Shared& t)
+ {
+ return os << *t;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator::SharedConst& t)
+ {
+ return os << *t;
+ }
+
+ virtual std::array<unsigned, 2> getResolution() const = 0;
+ virtual void repr(std::ostream& os) const = 0;
+};
+
+template <typename T>
+const std::string toString(const T& t)
+{
+ std::ostringstream os;
+ os << t;
+ return os.str();
+}
+
+const TestInput::Shared NV12toI420(const TestInput::SharedConst& nv12)
+{
+ TestInput::Shared i420(
+ new TestInput(VA_FOURCC_I420, nv12->width(), nv12-
Post by U. Artie Eoff
height()));
+
+ i420->bytes = nv12->bytes;
+
+ size_t i(0);
+ auto predicate = [&i](const ByteData::value_type&) {
+ bool isu = ((i % 2) == 0) or (i == 0);
+ ++i;
+ return isu;
+ };
+
+ std::stable_partition(
+ i420->bytes.begin() + i420->offsets[1],
+ i420->bytes.end(), predicate);
+
+ return i420;
+}
+
+#define ASSERT_NO_FAILURE(statement) \
+ statement; \
+ ASSERT_FALSE(HasFailure());
+
+class JPEGEncodeInputTest
+ : public JPEGEncodeTest
+ , public ::testing::WithParamInterface<
+ std::tuple<TestInputCreator::SharedConst, const char*> >
+{
+ JPEGEncodeInputTest()
+ : JPEGEncodeTest::JPEGEncodeTest()
+ , surfaces() // empty
+ , coded(VA_INVALID_ID) // invalid
+ , renderBuffers() // empty
+ , input() // invalid
+ , output() // empty
+ { }
+
+ virtual void SetUp()
+ {
+ JPEGEncodeTest::SetUp();
+
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965))
+ return;
+
+ TestInputCreator::SharedConst creator;
+ std::string sFourcc;
+ std::tie(creator, sFourcc) = GetParam();
+
+ ASSERT_PTR(creator.get()) << "Invalid test input creator parameter";
+
+ ASSERT_EQ(4u, sFourcc.size())
+ << "Invalid fourcc parameter '" << sFourcc << "'";
+
+ unsigned fourcc = VA_FOURCC(
+ sFourcc[0], sFourcc[1], sFourcc[2], sFourcc[3]);
+
+ input = creator->create(fourcc);
+
+ ASSERT_PTR(input.get())
+ << "Unhandled fourcc parameter '" << sFourcc << "'"
+ << " = 0x" << std::hex << fourcc << std::dec;
+
+ ASSERT_EQ(fourcc, input->fourcc);
+
+ RecordProperty("test_input", toString(*input));
+ }
+
+ virtual void TearDown()
+ {
+ for (auto id : renderBuffers) {
+ if (id != VA_INVALID_ID) {
+ destroyBuffer(id);
+ }
+ }
+ renderBuffers.clear();
+
+ if (coded != VA_INVALID_ID) {
+ destroyBuffer(coded);
+ coded = VA_INVALID_ID;
+ }
+
+ if (not surfaces.empty()) {
+ destroySurfaces(surfaces);
+ surfaces.clear();
+ }
+
+ if (std::get<0>(GetParam()).get())
+ std::cout << "Creator: " << std::get<0>(GetParam()) << std::endl;
+ if (input.get())
+ std::cout << "Input : " << input << std::endl;
+
+ JPEGEncodeTest::TearDown();
+ }
+
+ void Encode()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ ASSERT_NO_FAILURE(
+ beginPicture(context, surfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(context, renderBuffers.data(),
renderBuffers.size()));
+ ASSERT_NO_FAILURE(
+ endPicture(context));
+ ASSERT_NO_FAILURE(
+ syncSurface(surfaces.front()));
+ ASSERT_NO_FAILURE(
+ VACodedBufferSegment *segment =
+ mapBuffer<VACodedBufferSegment>(coded));
+
+ EXPECT_FALSE(segment->status &
VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
+ << "segment->size = " << segment->size;
+ EXPECT_PTR_NULL(segment->next);
+
+ // copy segment buffer to output while stripping the packed header data
+ const size_t headerSize(1);
+ output.resize(segment->size - headerSize, 0x0);
+ std::memcpy(
+ output.data(),
+ reinterpret_cast<uint8_t *>(segment->buf) + headerSize,
+ segment->size - headerSize);
+
+ unmapBuffer(coded);
+
+ // EOI JPEG Marker
+ ASSERT_GE(output.size(), 2u);
+ EXPECT_TRUE(
+ unsigned(0xff) == unsigned(*(output.end() - 2)) and
+ unsigned(0xd9) == unsigned(output.back()))
+ << "Invalid JPEG EOI Marker";
+ }
+
+ void SetUpSurfaces()
+ {
+ SurfaceAttribs attributes(1);
+ attributes.front().flags = VA_SURFACE_ATTRIB_SETTABLE;
+ attributes.front().type = VASurfaceAttribPixelFormat;
+ attributes.front().value.type = VAGenericValueTypeInteger;
+ attributes.front().value.value.i = input->fourcc;
+ surfaces = createSurfaces(input->width(), input->height(),
+ input->format, 1, attributes);
+ }
+
+ void CopyInputToSurface()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ VAImage image;
+ deriveImage(surfaces.front(), image);
+ if (HasFailure())
+ return;
+
+ SCOPED_TRACE(::testing::Message() << std::endl << image);
+
+ RecordProperty("input_image", toString(image));
+
+ EXPECT_EQ(input->planes, image.num_planes);
+ EXPECT_GT(image.data_size, 0u);
+ EXPECT_EQ(input->width(), image.width);
+ EXPECT_EQ(input->height(), image.height);
+ if (HasFailure()) {
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ return;
+ }
+
+ uint8_t *data = mapBuffer<uint8_t>(image.buf);
+ if (HasFailure()) {
+ destroyImage(image);
+ return;
+ }
+
+ std::memset(data, 0, image.data_size);
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = input->widths[i];
+ size_t h = input->heights[i];
+
+ EXPECT_GE(image.pitches[i], w);
+ if (HasFailure())
+ break;
+
+ const ByteData::value_type *source = input->plane(i);
+ uint8_t *dest = data + image.offsets[i];
+ for (size_t r(0); r < h; ++r) {
+ std::memcpy(dest, source, w);
+ source += w;
+ dest += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ }
+
+ void SetUpConfig()
+ {
+ ASSERT_INVALID_ID(config);
+ ConfigAttribs attributes(
+ 1, {type:VAConfigAttribRTFormat, value:input->format});
+ config = createConfig(profile, entrypoint, attributes);
+ }
+
+ void SetUpContext()
+ {
+ ASSERT_INVALID_ID(context);
+ context = createContext(config, input->width(),
+ input->height(), 0, surfaces);
+ }
+
+ void SetUpCodedBuffer()
+ {
+ ASSERT_INVALID_ID(coded);
+ unsigned size =
+ std::accumulate(input->sizes.begin(), input->sizes.end(), 8192u);
+ size *= input->planes;
+ coded = createBuffer(context, VAEncCodedBufferType, size);
+ }
+
+ void SetUpPicture()
+ {
+ input->picture.coded_buf = coded;
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPictureParameterBufferType,
+ sizeof(PictureParameter), 1, &input->picture));
+ }
+
+ void SetUpIQMatrix()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAQMatrixBufferType, sizeof(IQMatrix),
+ 1, &input->matrix));
+ }
+
+ void SetUpHuffmanTables()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAHuffmanTableBufferType,
+ sizeof(HuffmanTable), 1, &input->huffman));
+ }
+
+ void SetUpSlice()
+ {
+ renderBuffers.push_back(
+ createBuffer(context, VAEncSliceParameterBufferType,
+ sizeof(SliceParameter), 1, &input->slice));
+ }
+
+ void SetUpHeader()
+ {
+ /*
+ * The driver expects a packed JPEG header which it prepends to the
+ * coded buffer segment output. The driver does not appear to inspect
+ * this header, however. So we'll just create a 1-byte packed header
+ * since we really don't care if it contains a "valid" JPEG header.
+ */
+ renderBuffers.push_back(
+ createBuffer(context,
VAEncPackedHeaderParameterBufferType,
+ sizeof(VAEncPackedHeaderParameterBuffer)));
+ if (HasFailure())
+ return;
+
+ VAEncPackedHeaderParameterBuffer *packed =
+
mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back());
+ if (HasFailure())
+ return;
+
+ std::memset(packed, 0, sizeof(*packed));
+ packed->type = VAEncPackedHeaderRawData;
+ packed->bit_length = 8;
+ packed->has_emulation_bytes = 0;
+
+ unmapBuffer(renderBuffers.back());
+
+ renderBuffers.push_back(
+ createBuffer(context, VAEncPackedHeaderDataBufferType, 1));
+ }
+
+ Surfaces surfaces;
+ VABufferID coded;
+ Buffers renderBuffers;
+ TestInput::Shared input;
+ ByteData output;
+
+ void VerifyOutput()
+ {
+ // VerifyOutput only supports VA_FOURCC_IMC3 output, currently
+ ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input-
Post by U. Artie Eoff
fourcc_output);
+ TestInput::SharedConst expect = input;
+ if (input->fourcc == VA_FOURCC_NV12)
+ expect = NV12toI420(input);
+
+ ::JPEG::Decode::PictureData::SharedConst pd =
+ ::JPEG::Decode::PictureData::make(
+ input->fourcc_output, output, input->width(), input-
Post by U. Artie Eoff
height());
+
+ ASSERT_NO_FAILURE(
+ Surfaces osurfaces = createSurfaces(
+ pd->pparam.picture_width, pd->pparam.picture_height,
+ pd->format));;
+
+ ConfigAttribs attribs(
+ 1, {type:VAConfigAttribRTFormat, value:pd->format});
+ ASSERT_NO_FAILURE(
+ VAConfigID oconfig = createConfig(
+ ::JPEG::profile, ::JPEG::Decode::entrypoint, attribs));
+
+ ASSERT_NO_FAILURE(
+ VAContextID ocontext = createContext(
+ oconfig, pd->pparam.picture_width, pd-
Post by U. Artie Eoff
pparam.picture_height,
+ 0, osurfaces));
+
+ Buffers buffers;
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceDataBufferType, pd-
Post by U. Artie Eoff
sparam.slice_data_size,
+ 1, pd->slice.data())));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceParameterBufferType, sizeof(pd-
Post by U. Artie Eoff
sparam),
+ 1, &pd->sparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,VAPictureParameterBufferType, sizeof(pd-
Post by U. Artie Eoff
pparam),
+ 1, &pd->pparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAIQMatrixBufferType, sizeof(pd->iqmatrix),
+ 1, &pd->iqmatrix)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAHuffmanTableBufferType, sizeof(pd-
Post by U. Artie Eoff
huffman),
+ 1, &pd->huffman)));
+
+ ASSERT_NO_FAILURE(beginPicture(ocontext, osurfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(ocontext, buffers.data(), buffers.size()));
+ ASSERT_NO_FAILURE(endPicture(ocontext));
+ ASSERT_NO_FAILURE(syncSurface(osurfaces.front()));
+
+ VAImage image;
+ ASSERT_NO_FAILURE(deriveImage(osurfaces.front(), image));
+ ASSERT_NO_FAILURE(uint8_t *data =
mapBuffer<uint8_t>(image.buf));
+
+ auto isClose = [](const uint8_t& a, const uint8_t& b) {
+ return std::abs(int(a)-int(b)) <= 2;
+ };
+
+ for (size_t i(0); i < image.num_planes; ++i) {
+ size_t w = expect->widths[i];
+ size_t h = expect->heights[i];
+
+ const ByteData::value_type *source = expect->plane(i);
+ const uint8_t *result = data + image.offsets[i];
+ ASSERT_GE(image.pitches[i], w);
+ for (size_t r(0); r < h; ++r) {
+ EXPECT_TRUE(std::equal(result, result + w, source, isClose))
+ << "Byte(s) mismatch in plane " << i << " row " << r;
+ source += w;
+ result += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+
+ for (auto id : buffers)
+ destroyBuffer(id);
+
+ destroyImage(image);
+ destroyContext(ocontext);
+ destroyConfig(oconfig);
+ destroySurfaces(osurfaces);
+ }
+};
+
+TEST_P(JPEGEncodeInputTest, Full)
+{
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965)) {
+ RecordProperty("skipped", true);
+ std::cout << "[ SKIPPED ] " << getFullTestName()
+ << " is unsupported on this hardware" << std::endl;
+ return;
+ }
+
+ ASSERT_NO_FAILURE(SetUpSurfaces());
+ ASSERT_NO_FAILURE(SetUpConfig());
+ ASSERT_NO_FAILURE(SetUpContext());
+ ASSERT_NO_FAILURE(SetUpCodedBuffer());
+ ASSERT_NO_FAILURE(SetUpPicture());
+ ASSERT_NO_FAILURE(SetUpIQMatrix());
+ ASSERT_NO_FAILURE(SetUpHuffmanTables());
+ ASSERT_NO_FAILURE(SetUpSlice());
+ ASSERT_NO_FAILURE(SetUpHeader());
+ ASSERT_NO_FAILURE(CopyInputToSurface());
+ ASSERT_NO_FAILURE(Encode());
+
+ VerifyOutput();
+}
+
+class RandomSizeCreator
+ : public TestInputCreator
+{
+ std::array<unsigned, 2> getResolution() const
+ {
+ static RandomValueGenerator<unsigned> rg(1, 769);
+ return {rg(), rg()};
+ }
+ void repr(std::ostream& os) const { os << "Random Size"; }
+};
+
+INSTANTIATE_TEST_CASE_P(
+ Random, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(
+ std::vector<TestInputCreator::SharedConst>(
+ 5, TestInputCreator::SharedConst(new
RandomSizeCreator))),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+class FixedSizeCreator
+ : public TestInputCreator
+{
+ FixedSizeCreator(const std::array<unsigned, 2>& resolution)
+ : res(resolution)
+ { }
+
+ std::array<unsigned, 2> getResolution() const { return res; }
+ void repr(std::ostream& os) const
+ {
+ os << "Fixed Size " << res[0] << "x" << res[1];
+ }
+
+ const std::array<unsigned, 2> res;
+};
+
+typedef std::vector<TestInputCreator::SharedConst> InputCreators;
+
+InputCreators generateCommonInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({800, 600})), /* SVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 600})), /* WSVGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1024, 768})), /* XGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1152, 864})), /* XGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 720})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 768})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 800})), /* WXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1280, 1024})), /* SXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1360, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1366, 768})), /* HD */
+ TestInputCreator::Shared(new FixedSizeCreator({1440, 900})), /* WXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 900})), /* HD+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1600, 1200})), /* UXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({1680, 1050})), /* WSXGA+ */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1080})), /* FHD */
+ TestInputCreator::Shared(new FixedSizeCreator({1920, 1200})), /* WUXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1440})), /* WQHD */
+ TestInputCreator::Shared(new FixedSizeCreator({2560, 1600})), /* WQXGA */
+ TestInputCreator::Shared(new FixedSizeCreator({3640, 2160})), /* UHD (4K) */
+ TestInputCreator::Shared(new FixedSizeCreator({7680, 4320})), /* UHD (8K) */
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Common, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateCommonInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+INSTANTIATE_TEST_CASE_P(
+ Big, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::Values(
+ TestInputCreator::Shared(new FixedSizeCreator({8192, 8192}))
+ ),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateEdgeCaseInputs()
+{
+ std::vector<TestInputCreator::SharedConst> result;
+ for (unsigned i(64); i <= 512; i += 64) {
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i+1, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i, i-1})));
+ result.push_back(
+ TestInputCreator::Shared(new FixedSizeCreator({i-1, i-1})));
+ }
+
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 1})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 2})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 1})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 2})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 462})));
+
+ return result;
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Edge, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateEdgeCaseInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateMiscInputs()
+{
+ return {
+ TestInputCreator::Shared(new FixedSizeCreator({150, 75})),
+ TestInputCreator::Shared(new FixedSizeCreator({10, 10})),
+ TestInputCreator::Shared(new FixedSizeCreator({385, 610})),
+ TestInputCreator::Shared(new FixedSizeCreator({1245, 1281})),
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Misc, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateMiscInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+} // namespace Encode
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index d52f58233cc5..490ec941feb5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -25,6 +25,8 @@
#ifndef I965_JPEG_TEST_DATA_H
#define I965_JPEG_TEST_DATA_H
+#include "i965_test_fixture.h"
+
#include <array>
#include <iostream>
#include <map>
@@ -183,6 +185,18 @@ namespace Decode {
const HuffmanTable& huffman = defaultHuffmanTable,
const IQMatrix& iqmatrix = defaultIQMatrix)
{
+ return make(fourcc, slice, W, H, sparam, pparam, huffman, iqmatrix);
+ }
+
+ static SharedConst make(
+ const unsigned fourcc,
+ const ByteData& slice,
+ const unsigned w, const unsigned h,
+ const SliceParameter& sparam = defaultSliceParameter,
+ const PictureParameter& pparam = defaultPictureParameter,
+ const HuffmanTable& huffman = defaultHuffmanTable,
+ const IQMatrix& iqmatrix = defaultIQMatrix)
+ {
Shared pd(
new PictureData {
slice: slice,
@@ -196,8 +210,8 @@ namespace Decode {
);
pd->sparam.slice_data_size = slice.size();
- pd->pparam.picture_width = W;
- pd->pparam.picture_height = H;
+ pd->pparam.picture_width = w;
+ pd->pparam.picture_height = h;
switch(fourcc)
{
@@ -232,8 +246,8 @@ namespace Decode {
/* Calculate num_mcus */
int hfactor = pd->pparam.components[0].h_sampling_factor << 3;
int vfactor = pd->pparam.components[0].v_sampling_factor << 3;
- int wmcu = (W + hfactor - 1) / hfactor;
- int hmcu = (H + vfactor - 1) / vfactor;
+ int wmcu = (w + hfactor - 1) / hfactor;
+ int hmcu = (h + vfactor - 1) / vfactor;
pd->sparam.num_mcus = wmcu * hmcu;
return pd;
@@ -321,4 +335,180 @@ namespace Decode {
} // namespace Decode
} // namespace JPEG
+namespace JPEG {
+namespace Encode {
+ typedef VAQMatrixBufferJPEG IQMatrix;
+ typedef VAHuffmanTableBufferJPEGBaseline HuffmanTable;
+ typedef VAEncPictureParameterBufferJPEG PictureParameter;
+ typedef VAEncSliceParameterBufferJPEG SliceParameter;
+
+ static const VAEntrypoint entrypoint = VAEntrypointEncPicture;
+
+ static const IQMatrix defaultIQMatrix = { /* Quality 50 */
+ load_lum_quantiser_matrix: 1,
+ load_chroma_quantiser_matrix: 1,
+ lum_quantiser_matrix: {
+ 0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
+ 0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
+ 0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
+ 0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
+ 0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
+ 0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
+ 0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
+ 0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
+ },
+ chroma_quantiser_matrix: {
+ 0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
+ 0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ },
+ };
+
+ static const HuffmanTable defaultHuffmanTable =
+ ::JPEG::Decode::defaultHuffmanTable;
+
+ static const PictureParameter defaultPictureParameter = {
+ reconstructed_picture: VA_INVALID_ID,
+ picture_width: 10,
+ picture_height: 10,
+ coded_buf: VA_INVALID_ID,
+ pic_flags: {value: 0x00100},
+ sample_bit_depth: 8,
+ num_scan: 1,
+ num_components: 3,
+ component_id: {0, 1, 2, 0},
+ quantiser_table_selector: {0, 1, 1, 0},
+ quality: 100,
+ };
+
+ static const SliceParameter defaultSliceParameter = {
+ restart_interval: 0,
+ num_components: 3,
+ /* component_selector, dc_table_selector, ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}},
+ };
+
+ class TestInput
+ {
+ typedef std::shared_ptr<TestInput> Shared;
+ typedef std::shared_ptr<TestInput> SharedConst;
+
+ TestInput(const unsigned fourcc, const unsigned w, const unsigned h)
+ : bytes() // caller must fill this in after instantiation
+ , picture(defaultPictureParameter)
+ , matrix(defaultIQMatrix)
+ , huffman(defaultHuffmanTable)
+ , slice(defaultSliceParameter)
+ , fourcc(fourcc)
+ , fourcc_output(fourcc)
+ , format(0)
+ , planes(0)
+ , widths{0,0,0}
+ , heights{0,0,0}
+ , offsets{0,0,0}
+ , sizes{0,0,0}
+ {
+ picture.picture_width = ALIGN(w,2);
+ picture.picture_height = ALIGN(h,2);
+
+ switch(fourcc) {
+ planes = 3;
+ widths = {
+ w +( w & 1),
+ (w + 1) >> 1,
+ (w + 1) >> 1
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ (h + 1) >> 1
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ planes = 2;
+ widths = {
+ w + (w & 1),
+ w + (w & 1),
+ 0
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ 0
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ return;
+ }
+
+ for (size_t i(0); i < planes; ++i) {
+ sizes[i] = widths[i] * heights[i];
+ }
+
+ for (size_t i(1); i < planes; ++i) {
+ offsets[i] = sizes[i - 1];
+ offsets[i] += offsets[i - 1];
+ }
+ }
+
+ const unsigned width() const
+ {
+ return picture.picture_width;
+ }
+
+ const unsigned height() const
+ {
+ return picture.picture_height;
+ }
+
+ const uint8_t* plane(const size_t i) const
+ {
+ return bytes.data() + offsets[i];
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const TestInput& t)
+ {
+ return os
+ << std::string((char*)(&t.fourcc), 4)
+ << " " << t.width() << "x" << t.height()
+ << " " << t.widths << " " << t.heights
+ << " " << t.sizes << " " << t.offsets
+ ;
+ }
+
+ friend ::std::ostream& operator<<(::std::ostream& os, const Shared& t)
+ {
+ return os << *t;
+ }
+
+ ByteData bytes;
+ PictureParameter picture;
+ IQMatrix matrix;
+ HuffmanTable huffman;
+ SliceParameter slice;
+ unsigned fourcc;
+ unsigned fourcc_output;
+ unsigned format;
+ size_t planes;
+ std::array<size_t, 3> widths;
+ std::array<size_t, 3> heights;
+ std::array<size_t, 3> offsets;
+ std::array<size_t, 3> sizes;
+ };
+
+
+} // namespace Encode
+} // namespace JPEG
+
#endif
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index 54d85d223789..c805b359e19f 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -35,6 +35,7 @@
typedef std::vector<VASurfaceID> Surfaces;
typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
+typedef std::vector<VABufferID> Buffers;
/**
* This test fixture handles initialization and termination of the i965 driver
_______________________________________________
Libva mailing list
***@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libva
Xiang, Haihao
2016-10-13 07:43:17 UTC
Permalink
I’ve not seen any issues in multiple runs either, Haihao.  I likewise
ran them again today.  No failures.
What platform are you testing on?
SKL, and I can't reproduce the issue after rebooting my SKL. Please see
my reply to Altie for more information.

Thanks
Haihao
Sean
On 10/12/16, 12:57 PM, "Libva on behalf of Eoff, Ullysses A" <libva-b
    I have not seen these two (7680x4320 YUY2 and UYVY) fail before
on my SKL... I just ran them
    
    "./test_i965_drv_video --
gtest_filter=Common/JPEGEncodeInputTest.Full/98 --gtest_repeat=25"
    "./test_i965_drv_video --
gtest_filter=Common/JPEGEncodeInputTest.Full/97 --gtest_repeat=25"
    
    What is the test failure that you are seeing?
    
    Note that the YUV input data for these tests is random... so in
this regard, the test is different
    each time it's executed.  The random YUV input data can have an
effect on the actual size
    required for the coded buffer result.  So my guess is that the
    
    1. The user allocated coded buffer is not large enough for the
driver's encoding result (i.e. overflow occurs).
    2. For some specific random YUV data inputs, the decoded output
YUV result does not match.
    
    For the 7680x4320 I420 case, the test always fails due to YUV
input/output mismatch.  IIRC, the
    difference between the failing Y values are within a tolerance of
7 or 8.  But these tests only allow
    a  tolerance of 2.
    
    ----
    U. Artie
    
    
    > -----Original Message-----
    > From: Xiang, Haihao
    > Sent: Wednesday, October 12, 2016 12:17 PM
    > Subject: RE: [Libva] [PATCH intel-driver v2 7/7] test: add some
jpeg encode tests
    >
    >
    > Hi Artie,
    >
    > When I was investigating the issue with the 7680x4320 I420
test, I experienced random failures
    > with Common/JPEGEncodeInputTest.Full/98 and
Common/JPEGEncodeInputTest.Full/97. I guess
    > it is caused by the test case, did you see this issue in your
side? To reproduce the issue, you should run the case a few times.
    >
    > Thanks
    > Haihao
    >
    > >-----Original Message-----
Behalf Of Sean V
    > >Kelley
    > >Sent: Thursday, September 29, 2016 4:15 AM
freedesktop.org
    > >Subject: Re: [Libva] [PATCH intel-driver v2 7/7] test: add
some jpeg encode
    > >tests
    > >
    > >
    > >
    > > Add JPEG encode tests that encode raw I420 and NV12
data
    > > at quality 100 and then decodes them to verify proper
    > > encoding.
    > >
    > > Currently, the 7680x4320 I420 test fails because ~40-
60
    > > Y-values (i.e. plane 0) in each line from the decoded
    > > bitstream are off by more than 2 of the original raw
    > > I420 values.  It is not clear why only this resolution
    > > exhibits this problem.
    > >
    > >
    > >
    > >Ah this was the one we talked about.  Accepted.
    > >
    > >Sean
    > >
    > >
    > >
    > > v2: don't create any input data in test fixture if
    > > jpeg encoding is not supported.
    > >
m
    > > ---
    > >  test/Makefile.am               |   1 +
    > >  test/i965_jpeg_encode_test.cpp | 699
    > >+++++++++++++++++++++++++++++++++++++++++
    > >  test/i965_jpeg_test_data.h     | 198 +++++++++++-
    > >  test/i965_test_fixture.h       |   1 +
    > >  4 files changed, 895 insertions(+), 4 deletions(-)
    > >  create mode 100644 test/i965_jpeg_encode_test.cpp
    > >
    > > diff --git a/test/Makefile.am b/test/Makefile.am
    > > index 2e9edda648a4..99560f8d8a54 100644
    > > --- a/test/Makefile.am
    > > +++ b/test/Makefile.am
    > > \
    > >   i965_jpeg_test_data.cpp
    > > \
    > >   i965_test_fixture.cpp
    > > \
    > >   i965_jpeg_decode_test.cpp
    > > \
    > > + i965_jpeg_encode_test.cpp
    > > \
    > >   object_heap_test.cpp
    > > \
    > >   test_main.cpp
    > > \
    > >   $(NULL)
    > > diff --git a/test/i965_jpeg_encode_test.cpp
    > >b/test/i965_jpeg_encode_test.cpp
    > > new file mode 100644
    > > index 000000000000..08d80c4f75b7
    > > --- /dev/null
    > > +++ b/test/i965_jpeg_encode_test.cpp
    > > +/*
    > > + * Copyright (C) 2016 Intel Corporation. All Rights
Reserved.
    > > + *
    > > + * Permission is hereby granted, free of charge, to
any person
    > >obtaining a
    > > + * copy of this software and associated documentation
files (the
    > > + * "Software"), to deal in the Software without
restriction, including
    > > + * without limitation the rights to use, copy,
modify, merge, publish,
    > > + * distribute, sub license, and/or sell copies of the
Software, and to
    > > + * permit persons to whom the Software is furnished
to do so,
    > >subject to
    > > + *
    > > + * The above copyright notice and this permission
notice (including
    > >the
    > > + * next paragraph) shall be included in all copies or
substantial
    > >portions
    > > + * of the Software.
    > > + *
    > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
OF
    > >ANY KIND, EXPRESS
    > > + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES
    > >OF
    > > + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND
    > >NON-INFRINGEMENT.
    > > + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS
SUPPLIERS BE
    > >LIABLE FOR
    > > + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN
    > >ACTION OF CONTRACT,
    > > + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    > >CONNECTION WITH THE
    > > + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
    > > + */
    > > +
    > > +#include "i965_jpeg_test_data.h"
    > > +#include "test_utils.h"
    > > +
    > > +#include <algorithm>
    > > +#include <cstring>
    > > +#include <fstream>
    > > +#include <memory>
    > > +#include <sstream>
    > > +#include <tuple>
    > > +
    > > +namespace JPEG {
    > > +namespace Encode {
    > > +
    > > +class JPEGEncodeTest
    > > +    : public I965TestFixture
    > > +{
    > > +    JPEGEncodeTest()
    > > +        : I965TestFixture()
    > > +        , config(VA_INVALID_ID) // invalid
    > > +        , context(VA_INVALID_ID) // invalid
    > > +    { }
    > > +
    > > +    virtual void TearDown()
    > > +    {
    > > +        if (context != VA_INVALID_ID) {
    > > +            destroyContext(context);
    > > +            context = VA_INVALID_ID;
    > > +        }
    > > +
    > > +        if (config != VA_INVALID_ID) {
    > > +            destroyConfig(config);
    > > +            config = VA_INVALID_ID;
    > > +        }
    > > +
    > > +        I965TestFixture::TearDown();
    > > +    }
    > > +
    > > +    VAConfigID config;
    > > +    VAContextID context;
    > > +};
    > > +
    > > +TEST_F(JPEGEncodeTest, Entrypoint)
    > > +{
    > > +    ConfigAttribs attributes;
    > > +    struct i965_driver_data *i965(*this);
    > > +
    > > +    ASSERT_PTR(i965);
    > > +
    > > +    if (HAS_JPEG_ENCODING(i965)) {
    > > +        config = createConfig(profile, entrypoint,
attributes);
    > > +    } else {
    > > +        VAStatus status = i965_CreateConfig(
    > > +            *this, profile, entrypoint,
attributes.data(), attributes.size(),
    > > +            &config);
    > > +
    > >EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT,
    > >status);
    > > +        EXPECT_INVALID_ID(config);
    > > +    }
    > > +}
    > > +
    > > +class TestInputCreator
    > > +{
    > > +    typedef std::shared_ptr<TestInputCreator> Shared;
    > > +    typedef std::shared_ptr<const TestInputCreator>
SharedConst;
    > > +
    > > +    TestInput::Shared create(const unsigned fourcc)
const
    > > +    {
    > > +        const std::array<unsigned, 2> res =
getResolution();
    > > +
    > > +        TestInput::Shared input(new TestInput(fourcc,
res[0], res[1]));
    > > +        ByteData& bytes = input->bytes;
    > > +
    > > +        RandomValueGenerator<uint8_t> rg(0x00, 0xff);
    > > +        for (size_t i(0); i < input->planes; ++i)
    > > +            std::generate_n(
    > > +                std::back_inserter(bytes), input-
Post by U. Artie Eoff
sizes[i],
    > > +                [&rg]{ return rg(); });
    > > +        return input;
    > > +    }
    > > +
    > > +    friend ::std::ostream& operator<<(
    > > +        ::std::ostream& os, const TestInputCreator&
t)
    > > +    {
    > > +        t.repr(os);
    > > +        return os;
    > > +    }
    > > +
    > > +    friend ::std::ostream& operator<<(
    > > +        ::std::ostream& os, const
TestInputCreator::Shared& t)
    > > +    {
    > > +        return os << *t;
    > > +    }
    > > +
    > > +    friend ::std::ostream& operator<<(
    > > +        ::std::ostream& os, const
TestInputCreator::SharedConst& t)
    > > +    {
    > > +        return os << *t;
    > > +    }
    > > +
    > > +    virtual std::array<unsigned, 2> getResolution()
const = 0;
    > > +    virtual void repr(std::ostream& os) const = 0;
    > > +};
    > > +
    > > +template <typename T>
    > > +const std::string toString(const T& t)
    > > +{
    > > +    std::ostringstream os;
    > > +    os << t;
    > > +    return os.str();
    > > +}
    > > +
    > > +const TestInput::Shared NV12toI420(const
TestInput::SharedConst&
    > >nv12)
    > > +{
    > > +    TestInput::Shared i420(
    > > +        new TestInput(VA_FOURCC_I420, nv12->width(),
nv12-
    > >>height()));
    > > +
    > > +    i420->bytes = nv12->bytes;
    > > +
    > > +    size_t i(0);
    > > +    auto predicate = [&i](const
ByteData::value_type&) {
    > > +        bool isu = ((i % 2) == 0) or (i == 0);
    > > +        ++i;
    > > +        return isu;
    > > +    };
    > > +
    > > +    std::stable_partition(
    > > +        i420->bytes.begin() + i420->offsets[1],
    > > +        i420->bytes.end(), predicate);
    > > +
    > > +    return i420;
    > > +}
    > > +
    > > +#define ASSERT_NO_FAILURE(statement) \
    > > +    statement; \
    > > +    ASSERT_FALSE(HasFailure());
    > > +
    > > +class JPEGEncodeInputTest
    > > +    : public JPEGEncodeTest
    > > +    , public ::testing::WithParamInterface<
    > > +        std::tuple<TestInputCreator::SharedConst,
const char*> >
    > > +{
    > > +    JPEGEncodeInputTest()
    > > +        : JPEGEncodeTest::JPEGEncodeTest()
    > > +        , surfaces() // empty
    > > +        , coded(VA_INVALID_ID) // invalid
    > > +        , renderBuffers() // empty
    > > +        , input() // invalid
    > > +        , output() // empty
    > > +    { }
    > > +
    > > +    virtual void SetUp()
    > > +    {
    > > +        JPEGEncodeTest::SetUp();
    > > +
    > > +        struct i965_driver_data *i965(*this);
    > > +        ASSERT_PTR(i965);
    > > +        if (not HAS_JPEG_ENCODING(i965))
    > > +            return;
    > > +
    > > +        TestInputCreator::SharedConst creator;
    > > +        std::string sFourcc;
    > > +        std::tie(creator, sFourcc) = GetParam();
    > > +
    > > +        ASSERT_PTR(creator.get()) << "Invalid test
input creator
    > >parameter";
    > > +
    > > +        ASSERT_EQ(4u, sFourcc.size())
    > > +            << "Invalid fourcc parameter '" <<
sFourcc << "'";
    > > +
    > > +        unsigned fourcc = VA_FOURCC(
    > > +            sFourcc[0], sFourcc[1], sFourcc[2],
sFourcc[3]);
    > > +
    > > +        input = creator->create(fourcc);
    > > +
    > > +        ASSERT_PTR(input.get())
    > > +            << "Unhandled fourcc parameter '" <<
sFourcc << "'"
    > > +            << " = 0x" << std::hex << fourcc <<
std::dec;
    > > +
    > > +        ASSERT_EQ(fourcc, input->fourcc);
    > > +
    > > +        RecordProperty("test_input",
toString(*input));
    > > +    }
    > > +
    > > +    virtual void TearDown()
    > > +    {
    > > +        for (auto id : renderBuffers) {
    > > +            if (id != VA_INVALID_ID) {
    > > +                destroyBuffer(id);
    > > +            }
    > > +        }
    > > +        renderBuffers.clear();
    > > +
    > > +        if (coded != VA_INVALID_ID) {
    > > +            destroyBuffer(coded);
    > > +            coded = VA_INVALID_ID;
    > > +        }
    > > +
    > > +        if (not surfaces.empty()) {
    > > +            destroySurfaces(surfaces);
    > > +            surfaces.clear();
    > > +        }
    > > +
    > > +        if (std::get<0>(GetParam()).get())
    > > +            std::cout << "Creator: " <<
std::get<0>(GetParam()) <<
    > >std::endl;
    > > +        if (input.get())
    > > +            std::cout << "Input  : " << input <<
std::endl;
    > > +
    > > +        JPEGEncodeTest::TearDown();
    > > +    }
    > > +
    > > +    void Encode()
    > > +    {
    > > +        ASSERT_FALSE(surfaces.empty());
    > > +
    > > +        ASSERT_NO_FAILURE(
    > > +            beginPicture(context, surfaces.front()));
    > > +        ASSERT_NO_FAILURE(
    > > +            renderPicture(context,
renderBuffers.data(),
    > >renderBuffers.size()));
    > > +        ASSERT_NO_FAILURE(
    > > +            endPicture(context));
    > > +        ASSERT_NO_FAILURE(
    > > +            syncSurface(surfaces.front()));
    > > +        ASSERT_NO_FAILURE(
    > > +            VACodedBufferSegment *segment =
    > > +                mapBuffer<VACodedBufferSegment>(coded
));
    > > +
    > > +        EXPECT_FALSE(segment->status &
    > >VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
    > > +            << "segment->size = " << segment->size;
    > > +        EXPECT_PTR_NULL(segment->next);
    > > +
    > > +        // copy segment buffer to output while
stripping the packed
    > >header data
    > > +        const size_t headerSize(1);
    > > +        output.resize(segment->size - headerSize,
0x0);
    > > +        std::memcpy(
    > > +            output.data(),
    > > +            reinterpret_cast<uint8_t *>(segment->buf)
+ headerSize,
    > > +            segment->size - headerSize);
    > > +
    > > +        unmapBuffer(coded);
    > > +
    > > +        // EOI JPEG Marker
    > > +        ASSERT_GE(output.size(), 2u);
    > > +        EXPECT_TRUE(
    > > +            unsigned(0xff) == unsigned(*(output.end()
- 2)) and
    > > +            unsigned(0xd9) ==
unsigned(output.back()))
    > > +            << "Invalid JPEG EOI Marker";
    > > +    }
    > > +
    > > +    void SetUpSurfaces()
    > > +    {
    > > +        SurfaceAttribs attributes(1);
    > > +        attributes.front().flags =
VA_SURFACE_ATTRIB_SETTABLE;
    > > +        attributes.front().type =
VASurfaceAttribPixelFormat;
    > > +        attributes.front().value.type =
VAGenericValueTypeInteger;
    > > +        attributes.front().value.value.i = input-
Post by U. Artie Eoff
fourcc;
    > > +        surfaces = createSurfaces(input->width(),
input->height(),
    > > +            input->format, 1, attributes);
    > > +    }
    > > +
    > > +    void CopyInputToSurface()
    > > +    {
    > > +        ASSERT_FALSE(surfaces.empty());
    > > +
    > > +        VAImage image;
    > > +        deriveImage(surfaces.front(), image);
    > > +        if (HasFailure())
    > > +            return;
    > > +
    > > +        SCOPED_TRACE(::testing::Message() <<
std::endl << image);
    > > +
    > > +        RecordProperty("input_image",
toString(image));
    > > +
    > > +        EXPECT_EQ(input->planes, image.num_planes);
    > > +        EXPECT_GT(image.data_size, 0u);
    > > +        EXPECT_EQ(input->width(), image.width);
    > > +        EXPECT_EQ(input->height(), image.height);
    > > +        if (HasFailure()) {
    > > +            unmapBuffer(image.buf);
    > > +            destroyImage(image);
    > > +            return;
    > > +        }
    > > +
    > > +        uint8_t *data =
mapBuffer<uint8_t>(image.buf);
    > > +        if (HasFailure()) {
    > > +            destroyImage(image);
    > > +            return;
    > > +        }
    > > +
    > > +        std::memset(data, 0, image.data_size);
    > > +
    > > +        for (size_t i(0); i < image.num_planes; ++i)
{
    > > +            size_t w = input->widths[i];
    > > +            size_t h = input->heights[i];
    > > +
    > > +            EXPECT_GE(image.pitches[i], w);
    > > +            if (HasFailure())
    > > +                break;
    > > +
    > > +            const ByteData::value_type *source =
input->plane(i);
    > > +            uint8_t *dest = data + image.offsets[i];
    > > +            for (size_t r(0); r < h; ++r) {
    > > +                std::memcpy(dest, source, w);
    > > +                source += w;
    > > +                dest += image.pitches[i];
    > > +            }
    > > +        }
    > > +
    > > +        unmapBuffer(image.buf);
    > > +        destroyImage(image);
    > > +    }
    > > +
    > > +    void SetUpConfig()
    > > +    {
    > > +        ASSERT_INVALID_ID(config);
    > > +        ConfigAttribs attributes(
    > > +            1, {type:VAConfigAttribRTFormat,
value:input->format});
    > > +        config = createConfig(profile, entrypoint,
attributes);
    > > +    }
    > > +
    > > +    void SetUpContext()
    > > +    {
    > > +        ASSERT_INVALID_ID(context);
    > > +        context = createContext(config, input-
Post by U. Artie Eoff
width(),
    > > +            input->height(), 0, surfaces);
    > > +    }
    > > +
    > > +    void SetUpCodedBuffer()
    > > +    {
    > > +        ASSERT_INVALID_ID(coded);
    > > +        unsigned size =
    > > +            std::accumulate(input->sizes.begin(),
input->sizes.end(),
    > >8192u);
    > > +        size *= input->planes;
    > > +        coded = createBuffer(context,
VAEncCodedBufferType, size);
    > > +    }
    > > +
    > > +    void SetUpPicture()
    > > +    {
    > > +        input->picture.coded_buf = coded;
    > > +        renderBuffers.push_back(
    > > +            createBuffer(context,
VAEncPictureParameterBufferType,
    > > +                sizeof(PictureParameter), 1, &input-
Post by U. Artie Eoff
picture));
    > > +    }
    > > +
    > > +    void SetUpIQMatrix()
    > > +    {
    > > +        renderBuffers.push_back(
    > > +            createBuffer(context,
VAQMatrixBufferType, sizeof(IQMatrix),
    > > +                1, &input->matrix));
    > > +    }
    > > +
    > > +    void SetUpHuffmanTables()
    > > +    {
    > > +        renderBuffers.push_back(
    > > +            createBuffer(context,
VAHuffmanTableBufferType,
    > > +                sizeof(HuffmanTable), 1, &input-
Post by U. Artie Eoff
huffman));
    > > +    }
    > > +
    > > +    void SetUpSlice()
    > > +    {
    > > +        renderBuffers.push_back(
    > > +            createBuffer(context,
VAEncSliceParameterBufferType,
    > > +                sizeof(SliceParameter), 1, &input-
Post by U. Artie Eoff
slice));
    > > +    }
    > > +
    > > +    void SetUpHeader()
    > > +    {
    > > +        /*
    > > +         * The driver expects a packed JPEG header
which it prepends to
    > >the
    > > +         * coded buffer segment output. The driver
does not appear to
    > >inspect
    > > +         * this header, however.  So we'll just
create a 1-byte packed
    > >header
    > > +         * since we really don't care if it contains
a "valid" JPEG header.
    > > +         */
    > > +        renderBuffers.push_back(
    > > +            createBuffer(context,
    > >VAEncPackedHeaderParameterBufferType,
    > > +                sizeof(VAEncPackedHeaderParameterBuff
er)));
    > > +        if (HasFailure())
    > > +            return;
    > > +
    > > +        VAEncPackedHeaderParameterBuffer *packed =
    > > +
    >
Post by U. Artie Eoff
mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back());
    > > +        if (HasFailure())
    > > +            return;
    > > +
    > > +        std::memset(packed, 0, sizeof(*packed));
    > > +        packed->type = VAEncPackedHeaderRawData;
    > > +        packed->bit_length = 8;
    > > +        packed->has_emulation_bytes = 0;
    > > +
    > > +        unmapBuffer(renderBuffers.back());
    > > +
    > > +        renderBuffers.push_back(
    > > +            createBuffer(context,
VAEncPackedHeaderDataBufferType,
    > >1));
    > > +    }
    > > +
    > > +    Surfaces            surfaces;
    > > +    VABufferID          coded;
    > > +    Buffers             renderBuffers;
    > > +    TestInput::Shared   input;
    > > +    ByteData            output;
    > > +
    > > +    void VerifyOutput()
    > > +    {
    > > +        // VerifyOutput only supports VA_FOURCC_IMC3
output,
    > >currently
    > > +        ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input-
    > >>fourcc_output);
    > > +        TestInput::SharedConst expect = input;
    > > +        if (input->fourcc == VA_FOURCC_NV12)
    > > +            expect = NV12toI420(input);
    > > +
    > > +        ::JPEG::Decode::PictureData::SharedConst pd =
    > > +            ::JPEG::Decode::PictureData::make(
    > > +                input->fourcc_output, output, input-
Post by U. Artie Eoff
width(), input-
    > >>height());
    > > +
    > > +        ASSERT_NO_FAILURE(
    > > +            Surfaces osurfaces = createSurfaces(
    > > +                pd->pparam.picture_width, pd-
Post by U. Artie Eoff
pparam.picture_height,
    > > +                pd->format));;
    > > +
    > > +        ConfigAttribs attribs(
    > > +            1, {type:VAConfigAttribRTFormat,
value:pd->format});
    > > +        ASSERT_NO_FAILURE(
    > > +            VAConfigID oconfig = createConfig(
    > > +                ::JPEG::profile,
::JPEG::Decode::entrypoint, attribs));
    > > +
    > > +        ASSERT_NO_FAILURE(
    > > +            VAContextID ocontext = createContext(
    > > +                oconfig, pd->pparam.picture_width,
pd-
    > >>pparam.picture_height,
    > > +                0, osurfaces));
    > > +
    > > +        Buffers buffers;
    > > +
    > > +        ASSERT_NO_FAILURE(
    > > +            buffers.push_back(
    > > +                createBuffer(
    > > +                    ocontext, VASliceDataBufferType,
pd-
    > >>sparam.slice_data_size,
    > > +                    1, pd->slice.data())));
    > > +
    > > +        ASSERT_NO_FAILURE(
    > > +            buffers.push_back(
    > > +                createBuffer(
    > > +                    ocontext,
VASliceParameterBufferType, sizeof(pd-
    > >>sparam),
    > > +                    1, &pd->sparam)));
    > > +
    > > +        ASSERT_NO_FAILURE(
    > > +            buffers.push_back(
    > > +                createBuffer(
    > > +                    ocontext,VAPictureParameterBuffer
Type, sizeof(pd-
    > >>pparam),
    > > +                    1, &pd->pparam)));
    > > +
    > > +        ASSERT_NO_FAILURE(
    > > +            buffers.push_back(
    > > +                createBuffer(
    > > +                    ocontext, VAIQMatrixBufferType,
sizeof(pd->iqmatrix),
    > > +                    1, &pd->iqmatrix)));
    > > +
    > > +        ASSERT_NO_FAILURE(
    > > +            buffers.push_back(
    > > +                createBuffer(
    > > +                    ocontext,
VAHuffmanTableBufferType, sizeof(pd-
    > >>huffman),
    > > +                    1, &pd->huffman)));
    > > +
    > > +        ASSERT_NO_FAILURE(beginPicture(ocontext,
osurfaces.front()));
    > > +        ASSERT_NO_FAILURE(
    > > +            renderPicture(ocontext, buffers.data(),
buffers.size()));
    > > +        ASSERT_NO_FAILURE(endPicture(ocontext));
    > > +        ASSERT_NO_FAILURE(syncSurface(osurfaces.front
()));
    > > +
    > > +        VAImage image;
    > > +        ASSERT_NO_FAILURE(deriveImage(osurfaces.front
(), image));
    > > +        ASSERT_NO_FAILURE(uint8_t *data =
    > >mapBuffer<uint8_t>(image.buf));
    > > +
    > > +        auto isClose = [](const uint8_t& a, const
uint8_t& b) {
    > > +            return std::abs(int(a)-int(b)) <= 2;
    > > +        };
    > > +
    > > +        for (size_t i(0); i < image.num_planes; ++i)
{
    > > +            size_t w = expect->widths[i];
    > > +            size_t h = expect->heights[i];
    > > +
    > > +            const ByteData::value_type *source =
expect->plane(i);
    > > +            const uint8_t *result = data +
image.offsets[i];
    > > +            ASSERT_GE(image.pitches[i], w);
    > > +            for (size_t r(0); r < h; ++r) {
    > > +                EXPECT_TRUE(std::equal(result, result
+ w, source, isClose))
    > > +                    << "Byte(s) mismatch in plane "
<< i << " row " << r;
    > > +                source += w;
    > > +                result += image.pitches[i];
    > > +            }
    > > +        }
    > > +
    > > +        unmapBuffer(image.buf);
    > > +
    > > +        for (auto id : buffers)
    > > +            destroyBuffer(id);
    > > +
    > > +        destroyImage(image);
    > > +        destroyContext(ocontext);
    > > +        destroyConfig(oconfig);
    > > +        destroySurfaces(osurfaces);
    > > +    }
    > > +};
    > > +
    > > +TEST_P(JPEGEncodeInputTest, Full)
    > > +{
    > > +    struct i965_driver_data *i965(*this);
    > > +    ASSERT_PTR(i965);
    > > +    if (not HAS_JPEG_ENCODING(i965)) {
    > > +        RecordProperty("skipped", true);
    > > +        std::cout << "[  SKIPPED ] " <<
getFullTestName()
    > > +            << " is unsupported on this hardware" <<
std::endl;
    > > +        return;
    > > +    }
    > > +
    > > +    ASSERT_NO_FAILURE(SetUpSurfaces());
    > > +    ASSERT_NO_FAILURE(SetUpConfig());
    > > +    ASSERT_NO_FAILURE(SetUpContext());
    > > +    ASSERT_NO_FAILURE(SetUpCodedBuffer());
    > > +    ASSERT_NO_FAILURE(SetUpPicture());
    > > +    ASSERT_NO_FAILURE(SetUpIQMatrix());
    > > +    ASSERT_NO_FAILURE(SetUpHuffmanTables());
    > > +    ASSERT_NO_FAILURE(SetUpSlice());
    > > +    ASSERT_NO_FAILURE(SetUpHeader());
    > > +    ASSERT_NO_FAILURE(CopyInputToSurface());
    > > +    ASSERT_NO_FAILURE(Encode());
    > > +
    > > +    VerifyOutput();
    > > +}
    > > +
    > > +class RandomSizeCreator
    > > +    : public TestInputCreator
    > > +{
    > > +    std::array<unsigned, 2> getResolution() const
    > > +    {
    > > +        static RandomValueGenerator<unsigned> rg(1,
769);
    > > +        return {rg(), rg()};
    > > +    }
    > > +    void repr(std::ostream& os) const { os << "Random
Size"; }
    > > +};
    > > +
    > > +INSTANTIATE_TEST_CASE_P(
    > > +    Random, JPEGEncodeInputTest,
    > > +    ::testing::Combine(
    > > +        ::testing::ValuesIn(
    > > +            std::vector<TestInputCreator::SharedConst
Post by U. Artie Eoff
(
    > > +                5, TestInputCreator::SharedConst(new
    > >RandomSizeCreator))),
    > > +        ::testing::Values("I420", "NV12")
    > > +    )
    > > +);
    > > +
    > > +class FixedSizeCreator
    > > +    : public TestInputCreator
    > > +{
    > > +    FixedSizeCreator(const std::array<unsigned, 2>&
resolution)
    > > +        : res(resolution)
    > > +    { }
    > > +
    > > +    std::array<unsigned, 2> getResolution() const {
return res; }
    > > +    void repr(std::ostream& os) const
    > > +    {
    > > +        os << "Fixed Size " << res[0] << "x" <<
res[1];
    > > +    }
    > > +
    > > +    const std::array<unsigned, 2> res;
    > > +};
    > > +
    > > +typedef std::vector<TestInputCreator::SharedConst>
InputCreators;
    > > +
    > > +InputCreators generateCommonInputs()
    > > +{
    > > +    return {
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({800, 600})), /*
    > >SVGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1024, 600})), /*
    > >WSVGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1024, 768})), /*
    > >XGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1152, 864})), /*
    > >XGA+ */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1280, 720})), /*
    > >WXGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1280, 768})), /*
    > >WXGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1280, 800})), /*
    > >WXGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1280, 1024})),
    > >/* SXGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1360, 768})), /*
    > >HD */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1366, 768})), /*
    > >HD */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1440, 900})), /*
    > >WXGA+ */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1600, 900})), /*
    > >HD+ */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1600, 1200})),
    > >/* UXGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1680, 1050})),
    > >/* WSXGA+ */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1920, 1080})),
    > >/* FHD */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1920, 1200})),
    > >/* WUXGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({2560, 1440})),
    > >/* WQHD */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({2560, 1600})),
    > >/* WQXGA */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({3640, 2160})),
    > >/* UHD (4K) */
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({7680, 4320})),
    > >/* UHD (8K) */
    > > +    };
    > > +}
    > > +
    > > +INSTANTIATE_TEST_CASE_P(
    > > +    Common, JPEGEncodeInputTest,
    > > +    ::testing::Combine(
    > > +        ::testing::ValuesIn(generateCommonInputs()),
    > > +        ::testing::Values("I420", "NV12")
    > > +    )
    > > +);
    > > +
    > > +INSTANTIATE_TEST_CASE_P(
    > > +    Big, JPEGEncodeInputTest,
    > > +    ::testing::Combine(
    > > +        ::testing::Values(
    > > +            TestInputCreator::Shared(new
FixedSizeCreator({8192, 8192}))
    > > +        ),
    > > +        ::testing::Values("I420", "NV12")
    > > +    )
    > > +);
    > > +
    > > +InputCreators generateEdgeCaseInputs()
    > > +{
    > > +    std::vector<TestInputCreator::SharedConst>
result;
    > > +    for (unsigned i(64); i <= 512; i += 64) {
    > > +        result.push_back(
    > > +            TestInputCreator::Shared(new
FixedSizeCreator({i, i})));
    > > +        result.push_back(
    > > +            TestInputCreator::Shared(new
FixedSizeCreator({i+1, i})));
    > > +        result.push_back(
    > > +            TestInputCreator::Shared(new
FixedSizeCreator({i, i+1})));
    > > +        result.push_back(
    > > +            TestInputCreator::Shared(new
FixedSizeCreator({i+1, i+1})));
    > > +        result.push_back(
    > > +            TestInputCreator::Shared(new
FixedSizeCreator({i-1, i})));
    > > +        result.push_back(
    > > +            TestInputCreator::Shared(new
FixedSizeCreator({i, i-1})));
    > > +        result.push_back(
    > > +            TestInputCreator::Shared(new
FixedSizeCreator({i-1, i-1})));
    > > +    }
    > > +
    > > +    result.push_back(TestInputCreator::Shared(new
    > >FixedSizeCreator({1, 1})));
    > > +    result.push_back(TestInputCreator::Shared(new
    > >FixedSizeCreator({1, 2})));
    > > +    result.push_back(TestInputCreator::Shared(new
    > >FixedSizeCreator({2, 1})));
    > > +    result.push_back(TestInputCreator::Shared(new
    > >FixedSizeCreator({2, 2})));
    > > +    result.push_back(TestInputCreator::Shared(new
    > >FixedSizeCreator({1, 462})));
    > > +
    > > +    return result;
    > > +}
    > > +
    > > +INSTANTIATE_TEST_CASE_P(
    > > +    Edge, JPEGEncodeInputTest,
    > > +    ::testing::Combine(
    > > +        ::testing::ValuesIn(generateEdgeCaseInputs())
,
    > > +        ::testing::Values("I420", "NV12")
    > > +    )
    > > +);
    > > +
    > > +InputCreators generateMiscInputs()
    > > +{
    > > +    return {
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({150, 75})),
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({10, 10})),
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({385, 610})),
    > > +        TestInputCreator::Shared(new
FixedSizeCreator({1245, 1281})),
    > > +    };
    > > +}
    > > +
    > > +INSTANTIATE_TEST_CASE_P(
    > > +    Misc, JPEGEncodeInputTest,
    > > +    ::testing::Combine(
    > > +        ::testing::ValuesIn(generateMiscInputs()),
    > > +        ::testing::Values("I420", "NV12")
    > > +    )
    > > +);
    > > +
    > > +} // namespace Encode
    > > +} // namespace JPEG
    > > diff --git a/test/i965_jpeg_test_data.h
b/test/i965_jpeg_test_data.h
    > > index d52f58233cc5..490ec941feb5 100644
    > > --- a/test/i965_jpeg_test_data.h
    > > +++ b/test/i965_jpeg_test_data.h
    > >  #ifndef I965_JPEG_TEST_DATA_H
    > >  #define I965_JPEG_TEST_DATA_H
    > >
    > > +#include "i965_test_fixture.h"
    > > +
    > >  #include <array>
    > >  #include <iostream>
    > >  #include <map>
    > >              const HuffmanTable& huffman =
defaultHuffmanTable,
    > >              const IQMatrix& iqmatrix =
defaultIQMatrix)
    > >          {
    > > +            return make(fourcc, slice, W, H, sparam,
pparam, huffman,
    > >iqmatrix);
    > > +        }
    > > +
    > > +        static SharedConst make(
    > > +            const unsigned fourcc,
    > > +            const ByteData& slice,
    > > +            const unsigned w, const unsigned h,
    > > +            const SliceParameter& sparam =
defaultSliceParameter,
    > > +            const PictureParameter& pparam =
defaultPictureParameter,
    > > +            const HuffmanTable& huffman =
defaultHuffmanTable,
    > > +            const IQMatrix& iqmatrix =
defaultIQMatrix)
    > > +        {
    > >              Shared pd(
    > >                  new PictureData {
    > >                      slice: slice,
    > >              );
    > >
    > >              pd->sparam.slice_data_size =
slice.size();
    > > -            pd->pparam.picture_width = W;
    > > -            pd->pparam.picture_height = H;
    > > +            pd->pparam.picture_width = w;
    > > +            pd->pparam.picture_height = h;
    > >
    > >              switch(fourcc)
    > >              {
    > >              /* Calculate num_mcus */
    > >              int hfactor = pd-
Post by U. Artie Eoff
pparam.components[0].h_sampling_factor <<
    > >3;
    > >              int vfactor = pd-
Post by U. Artie Eoff
pparam.components[0].v_sampling_factor <<
    > >3;
    > > -            int wmcu = (W + hfactor - 1) / hfactor;
    > > -            int hmcu = (H + vfactor - 1) / vfactor;
    > > +            int wmcu = (w + hfactor - 1) / hfactor;
    > > +            int hmcu = (h + vfactor - 1) / vfactor;
    > >              pd->sparam.num_mcus = wmcu * hmcu;
    > >
    > >              return pd;
    > >  } // namespace Decode
    > >  } // namespace JPEG
    > >
    > > +namespace JPEG {
    > > +namespace Encode {
    > > +    typedef
VAQMatrixBufferJPEG                 IQMatrix;
    > > +    typedef
VAHuffmanTableBufferJPEGBaseline    HuffmanTable;
    > > +    typedef
VAEncPictureParameterBufferJPEG     PictureParameter;
    > > +    typedef
VAEncSliceParameterBufferJPEG       SliceParameter;
    > > +
    > > +    static const VAEntrypoint entrypoint =
VAEntrypointEncPicture;
    > > +
    > > +    static const IQMatrix defaultIQMatrix = { /*
Quality 50 */
    > > +        load_lum_quantiser_matrix: 1,
    > > +        load_chroma_quantiser_matrix: 1,
    > > +        lum_quantiser_matrix: {
    > > +            0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
    > > +            0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
    > > +            0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
    > > +            0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
    > > +            0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
    > > +            0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
    > > +            0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
    > > +            0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
    > > +        },
    > > +        chroma_quantiser_matrix: {
    > > +            0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
    > > +            0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
    > > +            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
    > > +            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
    > > +            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
    > > +            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
    > > +            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
    > > +            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
    > > +        },
    > > +    };
    > > +
    > > +    static const HuffmanTable defaultHuffmanTable =
    > > +        ::JPEG::Decode::defaultHuffmanTable;
    > > +
    > > +    static const PictureParameter
defaultPictureParameter = {
    > > +        reconstructed_picture:      VA_INVALID_ID,
    > > +        picture_width:              10,
    > > +        picture_height:             10,
    > > +        coded_buf:                  VA_INVALID_ID,
    > > +        pic_flags:                  {value: 0x00100},
    > > +        sample_bit_depth:           8,
    > > +        num_scan:                   1,
    > > +        num_components:             3,
    > > +        component_id:               {0, 1, 2, 0},
    > > +        quantiser_table_selector:   {0, 1, 1, 0},
    > > +        quality:                    100,
    > > +    };
    > > +
    > > +    static const SliceParameter defaultSliceParameter
= {
    > > +        restart_interval:   0,
    > > +        num_components:     3,
    > > +        /* component_selector, dc_table_selector,
ac_table_selector */
    > > +        components:         {{1,0,0},{2,1,1},{3,1,1}}
,
    > > +    };
    > > +
    > > +    class TestInput
    > > +    {
    > > +        typedef std::shared_ptr<TestInput> Shared;
    > > +        typedef std::shared_ptr<TestInput>
SharedConst;
    > > +
    > > +        TestInput(const unsigned fourcc, const
unsigned w, const
    > >unsigned h)
    > > +            : bytes() // caller must fill this in
after instantiation
    > > +            , picture(defaultPictureParameter)
    > > +            , matrix(defaultIQMatrix)
    > > +            , huffman(defaultHuffmanTable)
    > > +            , slice(defaultSliceParameter)
    > > +            , fourcc(fourcc)
    > > +            , fourcc_output(fourcc)
    > > +            , format(0)
    > > +            , planes(0)
    > > +            , widths{0,0,0}
    > > +            , heights{0,0,0}
    > > +            , offsets{0,0,0}
    > > +            , sizes{0,0,0}
    > > +        {
    > > +            picture.picture_width = ALIGN(w,2);
    > > +            picture.picture_height = ALIGN(h,2);
    > > +
    > > +            switch(fourcc) {
    > > +                planes = 3;
    > > +                widths = {
    > > +                    w +( w & 1),
    > > +                    (w + 1) >> 1,
    > > +                    (w + 1) >> 1
    > > +                };
    > > +                heights = {
    > > +                    h + (h & 1),
    > > +                    (h + 1) >> 1,
    > > +                    (h + 1) >> 1
    > > +                };
    > > +                format = VA_RT_FORMAT_YUV420;
    > > +                fourcc_output = VA_FOURCC_IMC3;
    > > +                break;
    > > +                planes = 2;
    > > +                widths = {
    > > +                    w + (w & 1),
    > > +                    w + (w & 1),
    > > +                    0
    > > +                };
    > > +                heights = {
    > > +                    h + (h & 1),
    > > +                    (h + 1) >> 1,
    > > +                    0
    > > +                };
    > > +                format = VA_RT_FORMAT_YUV420;
    > > +                fourcc_output = VA_FOURCC_IMC3;
    > > +                break;
    > > +                return;
    > > +            }
    > > +
    > > +            for (size_t i(0); i < planes; ++i) {
    > > +                sizes[i] = widths[i] * heights[i];
    > > +            }
    > > +
    > > +            for (size_t i(1); i < planes; ++i) {
    > > +                offsets[i] = sizes[i - 1];
    > > +                offsets[i] += offsets[i - 1];
    > > +            }
    > > +        }
    > > +
    > > +        const unsigned width() const
    > > +        {
    > > +            return picture.picture_width;
    > > +        }
    > > +
    > > +        const unsigned height() const
    > > +        {
    > > +            return picture.picture_height;
    > > +        }
    > > +
    > > +        const uint8_t* plane(const size_t i) const
    > > +        {
    > > +            return bytes.data() + offsets[i];
    > > +        }
    > > +
    > > +        friend ::std::ostream&
operator<<(::std::ostream& os, const
    > >TestInput& t)
    > > +        {
    > > +            return os
    > > +                << std::string((char*)(&t.fourcc), 4)
    > > +                << " " << t.width() << "x" <<
t.height()
    > > +                << " " << t.widths << " " <<
t.heights
    > > +                << " " << t.sizes << " " << t.offsets
    > > +            ;
    > > +        }
    > > +
    > > +        friend ::std::ostream&
operator<<(::std::ostream& os, const
    > >Shared& t)
    > > +        {
    > > +            return os << *t;
    > > +        }
    > > +
    > > +        ByteData            bytes;
    > > +        PictureParameter    picture;
    > > +        IQMatrix            matrix;
    > > +        HuffmanTable        huffman;
    > > +        SliceParameter      slice;
    > > +        unsigned            fourcc;
    > > +        unsigned            fourcc_output;
    > > +        unsigned            format;
    > > +        size_t              planes;
    > > +        std::array<size_t, 3> widths;
    > > +        std::array<size_t, 3> heights;
    > > +        std::array<size_t, 3> offsets;
    > > +        std::array<size_t, 3> sizes;
    > > +    };
    > > +
    > > +
    > > +} // namespace Encode
    > > +} // namespace JPEG
    > > +
    > >  #endif
    > > diff --git a/test/i965_test_fixture.h
b/test/i965_test_fixture.h
    > > index 54d85d223789..c805b359e19f 100644
    > > --- a/test/i965_test_fixture.h
    > > +++ b/test/i965_test_fixture.h
    > >  typedef std::vector<VASurfaceID> Surfaces;
    > >  typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
    > >  typedef std::vector<VAConfigAttrib> ConfigAttribs;
    > > +typedef std::vector<VABufferID> Buffers;
    > >
    > >  /**
    > >   * This test fixture handles initialization and
termination of the i965
    > >driver
    > >
    
    _______________________________________________
    Libva mailing list
    https://lists.freedesktop.org/mailman/listinfo/libva
    
Sean V Kelley
2016-10-13 19:12:36 UTC
Permalink
If you can reproduce it again, let's track it in Bugzilla.

Sean
Post by Xiang, Haihao
Post by Kelley, Sean V
I’ve not seen any issues in multiple runs either, Haihao. I likewise
ran them again today. No failures.
What platform are you testing on?
SKL, and I can't reproduce the issue after rebooting my SKL. Please see
my reply to Altie for more information.
Thanks
Haihao
Post by Kelley, Sean V
Sean
On 10/12/16, 12:57 PM, "Libva on behalf of Eoff, Ullysses A" <libva-b
I have not seen these two (7680x4320 YUY2 and UYVY) fail before
on my SKL... I just ran them
"./test_i965_drv_video --
gtest_filter=Common/JPEGEncodeInputTest.Full/98 --gtest_repeat=25"
"./test_i965_drv_video --
gtest_filter=Common/JPEGEncodeInputTest.Full/97 --gtest_repeat=25"
What is the test failure that you are seeing?
Note that the YUV input data for these tests is random... so in
this regard, the test is different
each time it's executed. The random YUV input data can have an
effect on the actual size
required for the coded buffer result. So my guess is that the
1. The user allocated coded buffer is not large enough for the
driver's encoding result (i.e. overflow occurs).
2. For some specific random YUV data inputs, the decoded output
YUV result does not match.
For the 7680x4320 I420 case, the test always fails due to YUV
input/output mismatch. IIRC, the
difference between the failing Y values are within a tolerance of
7 or 8. But these tests only allow
a tolerance of 2.
----
U. Artie
-----Original Message-----
From: Xiang, Haihao
Sent: Wednesday, October 12, 2016 12:17 PM
Subject: RE: [Libva] [PATCH intel-driver v2 7/7] test: add some
jpeg encode tests
Hi Artie,
When I was investigating the issue with the 7680x4320 I420
test, I experienced random failures
with Common/JPEGEncodeInputTest.Full/98 and
Common/JPEGEncodeInputTest.Full/97. I guess
it is caused by the test case, did you see this issue in your
side? To reproduce the issue, you should run the case a few times.
Thanks
Haihao
-----Original Message-----
Behalf Of Sean V
Kelley
Sent: Thursday, September 29, 2016 4:15 AM
freedesktop.org
Subject: Re: [Libva] [PATCH intel-driver v2 7/7] test: add
some jpeg encode
tests
Add JPEG encode tests that encode raw I420 and NV12
data
at quality 100 and then decodes them to verify proper
encoding.
Currently, the 7680x4320 I420 test fails because ~40-
60
Y-values (i.e. plane 0) in each line from the decoded
bitstream are off by more than 2 of the original raw
I420 values. It is not clear why only this resolution
exhibits this problem.
Ah this was the one we talked about. Accepted.
Sean
v2: don't create any input data in test fixture if
jpeg encoding is not supported.
m
---
test/Makefile.am | 1 +
test/i965_jpeg_encode_test.cpp | 699
+++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 198 +++++++++++-
test/i965_test_fixture.h | 1 +
4 files changed, 895 insertions(+), 4 deletions(-)
create mode 100644 test/i965_jpeg_encode_test.cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index 2e9edda648a4..99560f8d8a54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -57,6 +57,7 @@ test_i965_drv_video_SOURCES =
\
i965_jpeg_test_data.cpp
\
i965_test_fixture.cpp
\
i965_jpeg_decode_test.cpp
\
+ i965_jpeg_encode_test.cpp
\
object_heap_test.cpp
\
test_main.cpp
\
$(NULL)
diff --git a/test/i965_jpeg_encode_test.cpp
b/test/i965_jpeg_encode_test.cpp
new file mode 100644
index 000000000000..08d80c4f75b7
--- /dev/null
+++ b/test/i965_jpeg_encode_test.cpp
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights
Reserved.
+ *
+ * Permission is hereby granted, free of charge, to
any person
obtaining a
+ * copy of this software and associated documentation
files (the
+ * "Software"), to deal in the Software without
restriction, including
+ * without limitation the rights to use, copy,
modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the
Software, and to
+ * permit persons to whom the Software is furnished
to do so,
subject to
+ *
+ * The above copyright notice and this permission
notice (including
the
+ * next paragraph) shall be included in all copies or
substantial
portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
OF
ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES
OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS
SUPPLIERS BE
LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN
ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+#include "test_utils.h"
+
+#include <algorithm>
+#include <cstring>
+#include <fstream>
+#include <memory>
+#include <sstream>
+#include <tuple>
+
+namespace JPEG {
+namespace Encode {
+
+class JPEGEncodeTest
+ : public I965TestFixture
+{
+ JPEGEncodeTest()
+ : I965TestFixture()
+ , config(VA_INVALID_ID) // invalid
+ , context(VA_INVALID_ID) // invalid
+ { }
+
+ virtual void TearDown()
+ {
+ if (context != VA_INVALID_ID) {
+ destroyContext(context);
+ context = VA_INVALID_ID;
+ }
+
+ if (config != VA_INVALID_ID) {
+ destroyConfig(config);
+ config = VA_INVALID_ID;
+ }
+
+ I965TestFixture::TearDown();
+ }
+
+ VAConfigID config;
+ VAContextID context;
+};
+
+TEST_F(JPEGEncodeTest, Entrypoint)
+{
+ ConfigAttribs attributes;
+ struct i965_driver_data *i965(*this);
+
+ ASSERT_PTR(i965);
+
+ if (HAS_JPEG_ENCODING(i965)) {
+ config = createConfig(profile, entrypoint,
attributes);
+ } else {
+ VAStatus status = i965_CreateConfig(
+ *this, profile, entrypoint,
attributes.data(), attributes.size(),
+ &config);
+
EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT,
status);
+ EXPECT_INVALID_ID(config);
+ }
+}
+
+class TestInputCreator
+{
+ typedef std::shared_ptr<TestInputCreator> Shared;
+ typedef std::shared_ptr<const TestInputCreator>
SharedConst;
+
+ TestInput::Shared create(const unsigned fourcc)
const
+ {
+ const std::array<unsigned, 2> res =
getResolution();
+
+ TestInput::Shared input(new TestInput(fourcc,
res[0], res[1]));
+ ByteData& bytes = input->bytes;
+
+ RandomValueGenerator<uint8_t> rg(0x00, 0xff);
+ for (size_t i(0); i < input->planes; ++i)
+ std::generate_n(
+ std::back_inserter(bytes), input-
sizes[i],
+ [&rg]{ return rg(); });
+ return input;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const TestInputCreator&
t)
+ {
+ t.repr(os);
+ return os;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const
TestInputCreator::Shared& t)
+ {
+ return os << *t;
+ }
+
+ friend ::std::ostream& operator<<(
+ ::std::ostream& os, const
TestInputCreator::SharedConst& t)
+ {
+ return os << *t;
+ }
+
+ virtual std::array<unsigned, 2> getResolution()
const = 0;
+ virtual void repr(std::ostream& os) const = 0;
+};
+
+template <typename T>
+const std::string toString(const T& t)
+{
+ std::ostringstream os;
+ os << t;
+ return os.str();
+}
+
+const TestInput::Shared NV12toI420(const
TestInput::SharedConst&
nv12)
+{
+ TestInput::Shared i420(
+ new TestInput(VA_FOURCC_I420, nv12->width(),
nv12-
Post by U. Artie Eoff
height()));
+
+ i420->bytes = nv12->bytes;
+
+ size_t i(0);
+ auto predicate = [&i](const
ByteData::value_type&) {
+ bool isu = ((i % 2) == 0) or (i == 0);
+ ++i;
+ return isu;
+ };
+
+ std::stable_partition(
+ i420->bytes.begin() + i420->offsets[1],
+ i420->bytes.end(), predicate);
+
+ return i420;
+}
+
+#define ASSERT_NO_FAILURE(statement) \
+ statement; \
+ ASSERT_FALSE(HasFailure());
+
+class JPEGEncodeInputTest
+ : public JPEGEncodeTest
+ , public ::testing::WithParamInterface<
+ std::tuple<TestInputCreator::SharedConst,
const char*> >
+{
+ JPEGEncodeInputTest()
+ : JPEGEncodeTest::JPEGEncodeTest()
+ , surfaces() // empty
+ , coded(VA_INVALID_ID) // invalid
+ , renderBuffers() // empty
+ , input() // invalid
+ , output() // empty
+ { }
+
+ virtual void SetUp()
+ {
+ JPEGEncodeTest::SetUp();
+
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965))
+ return;
+
+ TestInputCreator::SharedConst creator;
+ std::string sFourcc;
+ std::tie(creator, sFourcc) = GetParam();
+
+ ASSERT_PTR(creator.get()) << "Invalid test
input creator
parameter";
+
+ ASSERT_EQ(4u, sFourcc.size())
+ << "Invalid fourcc parameter '" <<
sFourcc << "'";
+
+ unsigned fourcc = VA_FOURCC(
+ sFourcc[0], sFourcc[1], sFourcc[2],
sFourcc[3]);
+
+ input = creator->create(fourcc);
+
+ ASSERT_PTR(input.get())
+ << "Unhandled fourcc parameter '" <<
sFourcc << "'"
+ << " = 0x" << std::hex << fourcc <<
std::dec;
+
+ ASSERT_EQ(fourcc, input->fourcc);
+
+ RecordProperty("test_input",
toString(*input));
+ }
+
+ virtual void TearDown()
+ {
+ for (auto id : renderBuffers) {
+ if (id != VA_INVALID_ID) {
+ destroyBuffer(id);
+ }
+ }
+ renderBuffers.clear();
+
+ if (coded != VA_INVALID_ID) {
+ destroyBuffer(coded);
+ coded = VA_INVALID_ID;
+ }
+
+ if (not surfaces.empty()) {
+ destroySurfaces(surfaces);
+ surfaces.clear();
+ }
+
+ if (std::get<0>(GetParam()).get())
+ std::cout << "Creator: " <<
std::get<0>(GetParam()) <<
std::endl;
+ if (input.get())
+ std::cout << "Input : " << input <<
std::endl;
+
+ JPEGEncodeTest::TearDown();
+ }
+
+ void Encode()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ ASSERT_NO_FAILURE(
+ beginPicture(context, surfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(context,
renderBuffers.data(),
renderBuffers.size()));
+ ASSERT_NO_FAILURE(
+ endPicture(context));
+ ASSERT_NO_FAILURE(
+ syncSurface(surfaces.front()));
+ ASSERT_NO_FAILURE(
+ VACodedBufferSegment *segment =
+ mapBuffer<VACodedBufferSegment>(coded
));
+
+ EXPECT_FALSE(segment->status &
VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
+ << "segment->size = " << segment->size;
+ EXPECT_PTR_NULL(segment->next);
+
+ // copy segment buffer to output while
stripping the packed
header data
+ const size_t headerSize(1);
+ output.resize(segment->size - headerSize,
0x0);
+ std::memcpy(
+ output.data(),
+ reinterpret_cast<uint8_t *>(segment->buf)
+ headerSize,
+ segment->size - headerSize);
+
+ unmapBuffer(coded);
+
+ // EOI JPEG Marker
+ ASSERT_GE(output.size(), 2u);
+ EXPECT_TRUE(
+ unsigned(0xff) == unsigned(*(output.end()
- 2)) and
+ unsigned(0xd9) ==
unsigned(output.back()))
+ << "Invalid JPEG EOI Marker";
+ }
+
+ void SetUpSurfaces()
+ {
+ SurfaceAttribs attributes(1);
+ attributes.front().flags =
VA_SURFACE_ATTRIB_SETTABLE;
+ attributes.front().type =
VASurfaceAttribPixelFormat;
+ attributes.front().value.type =
VAGenericValueTypeInteger;
+ attributes.front().value.value.i = input-
fourcc;
+ surfaces = createSurfaces(input->width(),
input->height(),
+ input->format, 1, attributes);
+ }
+
+ void CopyInputToSurface()
+ {
+ ASSERT_FALSE(surfaces.empty());
+
+ VAImage image;
+ deriveImage(surfaces.front(), image);
+ if (HasFailure())
+ return;
+
+ SCOPED_TRACE(::testing::Message() <<
std::endl << image);
+
+ RecordProperty("input_image",
toString(image));
+
+ EXPECT_EQ(input->planes, image.num_planes);
+ EXPECT_GT(image.data_size, 0u);
+ EXPECT_EQ(input->width(), image.width);
+ EXPECT_EQ(input->height(), image.height);
+ if (HasFailure()) {
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ return;
+ }
+
+ uint8_t *data =
mapBuffer<uint8_t>(image.buf);
+ if (HasFailure()) {
+ destroyImage(image);
+ return;
+ }
+
+ std::memset(data, 0, image.data_size);
+
+ for (size_t i(0); i < image.num_planes; ++i)
{
+ size_t w = input->widths[i];
+ size_t h = input->heights[i];
+
+ EXPECT_GE(image.pitches[i], w);
+ if (HasFailure())
+ break;
+
+ const ByteData::value_type *source =
input->plane(i);
+ uint8_t *dest = data + image.offsets[i];
+ for (size_t r(0); r < h; ++r) {
+ std::memcpy(dest, source, w);
+ source += w;
+ dest += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+ destroyImage(image);
+ }
+
+ void SetUpConfig()
+ {
+ ASSERT_INVALID_ID(config);
+ ConfigAttribs attributes(
+ 1, {type:VAConfigAttribRTFormat,
value:input->format});
+ config = createConfig(profile, entrypoint,
attributes);
+ }
+
+ void SetUpContext()
+ {
+ ASSERT_INVALID_ID(context);
+ context = createContext(config, input-
width(),
+ input->height(), 0, surfaces);
+ }
+
+ void SetUpCodedBuffer()
+ {
+ ASSERT_INVALID_ID(coded);
+ unsigned size =
+ std::accumulate(input->sizes.begin(),
input->sizes.end(),
8192u);
+ size *= input->planes;
+ coded = createBuffer(context,
VAEncCodedBufferType, size);
+ }
+
+ void SetUpPicture()
+ {
+ input->picture.coded_buf = coded;
+ renderBuffers.push_back(
+ createBuffer(context,
VAEncPictureParameterBufferType,
+ sizeof(PictureParameter), 1, &input-
picture));
+ }
+
+ void SetUpIQMatrix()
+ {
+ renderBuffers.push_back(
+ createBuffer(context,
VAQMatrixBufferType, sizeof(IQMatrix),
+ 1, &input->matrix));
+ }
+
+ void SetUpHuffmanTables()
+ {
+ renderBuffers.push_back(
+ createBuffer(context,
VAHuffmanTableBufferType,
+ sizeof(HuffmanTable), 1, &input-
huffman));
+ }
+
+ void SetUpSlice()
+ {
+ renderBuffers.push_back(
+ createBuffer(context,
VAEncSliceParameterBufferType,
+ sizeof(SliceParameter), 1, &input-
slice));
+ }
+
+ void SetUpHeader()
+ {
+ /*
+ * The driver expects a packed JPEG header
which it prepends to
the
+ * coded buffer segment output. The driver
does not appear to
inspect
+ * this header, however. So we'll just
create a 1-byte packed
header
+ * since we really don't care if it contains
a "valid" JPEG header.
+ */
+ renderBuffers.push_back(
+ createBuffer(context,
VAEncPackedHeaderParameterBufferType,
+ sizeof(VAEncPackedHeaderParameterBuff
er)));
+ if (HasFailure())
+ return;
+
+ VAEncPackedHeaderParameterBuffer *packed =
+
mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back());
+ if (HasFailure())
+ return;
+
+ std::memset(packed, 0, sizeof(*packed));
+ packed->type = VAEncPackedHeaderRawData;
+ packed->bit_length = 8;
+ packed->has_emulation_bytes = 0;
+
+ unmapBuffer(renderBuffers.back());
+
+ renderBuffers.push_back(
+ createBuffer(context,
VAEncPackedHeaderDataBufferType,
1));
+ }
+
+ Surfaces surfaces;
+ VABufferID coded;
+ Buffers renderBuffers;
+ TestInput::Shared input;
+ ByteData output;
+
+ void VerifyOutput()
+ {
+ // VerifyOutput only supports VA_FOURCC_IMC3
output,
currently
+ ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input-
Post by U. Artie Eoff
fourcc_output);
+ TestInput::SharedConst expect = input;
+ if (input->fourcc == VA_FOURCC_NV12)
+ expect = NV12toI420(input);
+
+ ::JPEG::Decode::PictureData::SharedConst pd =
+ ::JPEG::Decode::PictureData::make(
+ input->fourcc_output, output, input-
width(), input-
Post by U. Artie Eoff
height());
+
+ ASSERT_NO_FAILURE(
+ Surfaces osurfaces = createSurfaces(
+ pd->pparam.picture_width, pd-
pparam.picture_height,
+ pd->format));;
+
+ ConfigAttribs attribs(
+ 1, {type:VAConfigAttribRTFormat,
value:pd->format});
+ ASSERT_NO_FAILURE(
+ VAConfigID oconfig = createConfig(
+ ::JPEG::profile,
::JPEG::Decode::entrypoint, attribs));
+
+ ASSERT_NO_FAILURE(
+ VAContextID ocontext = createContext(
+ oconfig, pd->pparam.picture_width,
pd-
Post by U. Artie Eoff
pparam.picture_height,
+ 0, osurfaces));
+
+ Buffers buffers;
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VASliceDataBufferType,
pd-
Post by U. Artie Eoff
sparam.slice_data_size,
+ 1, pd->slice.data())));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,
VASliceParameterBufferType, sizeof(pd-
Post by U. Artie Eoff
sparam),
+ 1, &pd->sparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,VAPictureParameterBuffer
Type, sizeof(pd-
Post by U. Artie Eoff
pparam),
+ 1, &pd->pparam)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext, VAIQMatrixBufferType,
sizeof(pd->iqmatrix),
+ 1, &pd->iqmatrix)));
+
+ ASSERT_NO_FAILURE(
+ buffers.push_back(
+ createBuffer(
+ ocontext,
VAHuffmanTableBufferType, sizeof(pd-
Post by U. Artie Eoff
huffman),
+ 1, &pd->huffman)));
+
+ ASSERT_NO_FAILURE(beginPicture(ocontext,
osurfaces.front()));
+ ASSERT_NO_FAILURE(
+ renderPicture(ocontext, buffers.data(),
buffers.size()));
+ ASSERT_NO_FAILURE(endPicture(ocontext));
+ ASSERT_NO_FAILURE(syncSurface(osurfaces.front
()));
+
+ VAImage image;
+ ASSERT_NO_FAILURE(deriveImage(osurfaces.front
(), image));
+ ASSERT_NO_FAILURE(uint8_t *data =
mapBuffer<uint8_t>(image.buf));
+
+ auto isClose = [](const uint8_t& a, const
uint8_t& b) {
+ return std::abs(int(a)-int(b)) <= 2;
+ };
+
+ for (size_t i(0); i < image.num_planes; ++i)
{
+ size_t w = expect->widths[i];
+ size_t h = expect->heights[i];
+
+ const ByteData::value_type *source =
expect->plane(i);
+ const uint8_t *result = data +
image.offsets[i];
+ ASSERT_GE(image.pitches[i], w);
+ for (size_t r(0); r < h; ++r) {
+ EXPECT_TRUE(std::equal(result, result
+ w, source, isClose))
+ << "Byte(s) mismatch in plane "
<< i << " row " << r;
+ source += w;
+ result += image.pitches[i];
+ }
+ }
+
+ unmapBuffer(image.buf);
+
+ for (auto id : buffers)
+ destroyBuffer(id);
+
+ destroyImage(image);
+ destroyContext(ocontext);
+ destroyConfig(oconfig);
+ destroySurfaces(osurfaces);
+ }
+};
+
+TEST_P(JPEGEncodeInputTest, Full)
+{
+ struct i965_driver_data *i965(*this);
+ ASSERT_PTR(i965);
+ if (not HAS_JPEG_ENCODING(i965)) {
+ RecordProperty("skipped", true);
+ std::cout << "[ SKIPPED ] " <<
getFullTestName()
+ << " is unsupported on this hardware" <<
std::endl;
+ return;
+ }
+
+ ASSERT_NO_FAILURE(SetUpSurfaces());
+ ASSERT_NO_FAILURE(SetUpConfig());
+ ASSERT_NO_FAILURE(SetUpContext());
+ ASSERT_NO_FAILURE(SetUpCodedBuffer());
+ ASSERT_NO_FAILURE(SetUpPicture());
+ ASSERT_NO_FAILURE(SetUpIQMatrix());
+ ASSERT_NO_FAILURE(SetUpHuffmanTables());
+ ASSERT_NO_FAILURE(SetUpSlice());
+ ASSERT_NO_FAILURE(SetUpHeader());
+ ASSERT_NO_FAILURE(CopyInputToSurface());
+ ASSERT_NO_FAILURE(Encode());
+
+ VerifyOutput();
+}
+
+class RandomSizeCreator
+ : public TestInputCreator
+{
+ std::array<unsigned, 2> getResolution() const
+ {
+ static RandomValueGenerator<unsigned> rg(1,
769);
+ return {rg(), rg()};
+ }
+ void repr(std::ostream& os) const { os << "Random
Size"; }
+};
+
+INSTANTIATE_TEST_CASE_P(
+ Random, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(
+ std::vector<TestInputCreator::SharedConst
(
+ 5, TestInputCreator::SharedConst(new
RandomSizeCreator))),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+class FixedSizeCreator
+ : public TestInputCreator
+{
+ FixedSizeCreator(const std::array<unsigned, 2>&
resolution)
+ : res(resolution)
+ { }
+
+ std::array<unsigned, 2> getResolution() const {
return res; }
+ void repr(std::ostream& os) const
+ {
+ os << "Fixed Size " << res[0] << "x" <<
res[1];
+ }
+
+ const std::array<unsigned, 2> res;
+};
+
+typedef std::vector<TestInputCreator::SharedConst>
InputCreators;
+
+InputCreators generateCommonInputs()
+{
+ return {
+ TestInputCreator::Shared(new
FixedSizeCreator({800, 600})), /*
SVGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({1024, 600})), /*
WSVGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({1024, 768})), /*
XGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({1152, 864})), /*
XGA+ */
+ TestInputCreator::Shared(new
FixedSizeCreator({1280, 720})), /*
WXGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({1280, 768})), /*
WXGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({1280, 800})), /*
WXGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({1280, 1024})),
/* SXGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({1360, 768})), /*
HD */
+ TestInputCreator::Shared(new
FixedSizeCreator({1366, 768})), /*
HD */
+ TestInputCreator::Shared(new
FixedSizeCreator({1440, 900})), /*
WXGA+ */
+ TestInputCreator::Shared(new
FixedSizeCreator({1600, 900})), /*
HD+ */
+ TestInputCreator::Shared(new
FixedSizeCreator({1600, 1200})),
/* UXGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({1680, 1050})),
/* WSXGA+ */
+ TestInputCreator::Shared(new
FixedSizeCreator({1920, 1080})),
/* FHD */
+ TestInputCreator::Shared(new
FixedSizeCreator({1920, 1200})),
/* WUXGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({2560, 1440})),
/* WQHD */
+ TestInputCreator::Shared(new
FixedSizeCreator({2560, 1600})),
/* WQXGA */
+ TestInputCreator::Shared(new
FixedSizeCreator({3640, 2160})),
/* UHD (4K) */
+ TestInputCreator::Shared(new
FixedSizeCreator({7680, 4320})),
/* UHD (8K) */
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Common, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateCommonInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+INSTANTIATE_TEST_CASE_P(
+ Big, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::Values(
+ TestInputCreator::Shared(new
FixedSizeCreator({8192, 8192}))
+ ),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateEdgeCaseInputs()
+{
+ std::vector<TestInputCreator::SharedConst>
result;
+ for (unsigned i(64); i <= 512; i += 64) {
+ result.push_back(
+ TestInputCreator::Shared(new
FixedSizeCreator({i, i})));
+ result.push_back(
+ TestInputCreator::Shared(new
FixedSizeCreator({i+1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new
FixedSizeCreator({i, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new
FixedSizeCreator({i+1, i+1})));
+ result.push_back(
+ TestInputCreator::Shared(new
FixedSizeCreator({i-1, i})));
+ result.push_back(
+ TestInputCreator::Shared(new
FixedSizeCreator({i, i-1})));
+ result.push_back(
+ TestInputCreator::Shared(new
FixedSizeCreator({i-1, i-1})));
+ }
+
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 1})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 2})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 1})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 2})));
+ result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 462})));
+
+ return result;
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Edge, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateEdgeCaseInputs())
,
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+InputCreators generateMiscInputs()
+{
+ return {
+ TestInputCreator::Shared(new
FixedSizeCreator({150, 75})),
+ TestInputCreator::Shared(new
FixedSizeCreator({10, 10})),
+ TestInputCreator::Shared(new
FixedSizeCreator({385, 610})),
+ TestInputCreator::Shared(new
FixedSizeCreator({1245, 1281})),
+ };
+}
+
+INSTANTIATE_TEST_CASE_P(
+ Misc, JPEGEncodeInputTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(generateMiscInputs()),
+ ::testing::Values("I420", "NV12")
+ )
+);
+
+} // namespace Encode
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h
b/test/i965_jpeg_test_data.h
index d52f58233cc5..490ec941feb5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -25,6 +25,8 @@
#ifndef I965_JPEG_TEST_DATA_H
#define I965_JPEG_TEST_DATA_H
+#include "i965_test_fixture.h"
+
#include <array>
#include <iostream>
#include <map>
@@ -183,6 +185,18 @@ namespace Decode {
const HuffmanTable& huffman =
defaultHuffmanTable,
const IQMatrix& iqmatrix =
defaultIQMatrix)
{
+ return make(fourcc, slice, W, H, sparam,
pparam, huffman,
iqmatrix);
+ }
+
+ static SharedConst make(
+ const unsigned fourcc,
+ const ByteData& slice,
+ const unsigned w, const unsigned h,
+ const SliceParameter& sparam =
defaultSliceParameter,
+ const PictureParameter& pparam =
defaultPictureParameter,
+ const HuffmanTable& huffman =
defaultHuffmanTable,
+ const IQMatrix& iqmatrix =
defaultIQMatrix)
+ {
Shared pd(
new PictureData {
slice: slice,
@@ -196,8 +210,8 @@ namespace Decode {
);
pd->sparam.slice_data_size =
slice.size();
- pd->pparam.picture_width = W;
- pd->pparam.picture_height = H;
+ pd->pparam.picture_width = w;
+ pd->pparam.picture_height = h;
switch(fourcc)
{
@@ -232,8 +246,8 @@ namespace Decode {
/* Calculate num_mcus */
int hfactor = pd-
pparam.components[0].h_sampling_factor <<
3;
int vfactor = pd-
pparam.components[0].v_sampling_factor <<
3;
- int wmcu = (W + hfactor - 1) / hfactor;
- int hmcu = (H + vfactor - 1) / vfactor;
+ int wmcu = (w + hfactor - 1) / hfactor;
+ int hmcu = (h + vfactor - 1) / vfactor;
pd->sparam.num_mcus = wmcu * hmcu;
return pd;
@@ -321,4 +335,180 @@ namespace Decode {
} // namespace Decode
} // namespace JPEG
+namespace JPEG {
+namespace Encode {
+ typedef
VAQMatrixBufferJPEG IQMatrix;
+ typedef
VAHuffmanTableBufferJPEGBaseline HuffmanTable;
+ typedef
VAEncPictureParameterBufferJPEG PictureParameter;
+ typedef
VAEncSliceParameterBufferJPEG SliceParameter;
+
+ static const VAEntrypoint entrypoint =
VAEntrypointEncPicture;
+
+ static const IQMatrix defaultIQMatrix = { /*
Quality 50 */
+ load_lum_quantiser_matrix: 1,
+ load_chroma_quantiser_matrix: 1,
+ lum_quantiser_matrix: {
+ 0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
+ 0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
+ 0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
+ 0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
+ 0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
+ 0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
+ 0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
+ 0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
+ },
+ chroma_quantiser_matrix: {
+ 0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
+ 0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ 0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+ },
+ };
+
+ static const HuffmanTable defaultHuffmanTable =
+ ::JPEG::Decode::defaultHuffmanTable;
+
+ static const PictureParameter
defaultPictureParameter = {
+ reconstructed_picture: VA_INVALID_ID,
+ picture_width: 10,
+ picture_height: 10,
+ coded_buf: VA_INVALID_ID,
+ pic_flags: {value: 0x00100},
+ sample_bit_depth: 8,
+ num_scan: 1,
+ num_components: 3,
+ component_id: {0, 1, 2, 0},
+ quantiser_table_selector: {0, 1, 1, 0},
+ quality: 100,
+ };
+
+ static const SliceParameter defaultSliceParameter
= {
+ restart_interval: 0,
+ num_components: 3,
+ /* component_selector, dc_table_selector,
ac_table_selector */
+ components: {{1,0,0},{2,1,1},{3,1,1}}
,
+ };
+
+ class TestInput
+ {
+ typedef std::shared_ptr<TestInput> Shared;
+ typedef std::shared_ptr<TestInput>
SharedConst;
+
+ TestInput(const unsigned fourcc, const
unsigned w, const
unsigned h)
+ : bytes() // caller must fill this in
after instantiation
+ , picture(defaultPictureParameter)
+ , matrix(defaultIQMatrix)
+ , huffman(defaultHuffmanTable)
+ , slice(defaultSliceParameter)
+ , fourcc(fourcc)
+ , fourcc_output(fourcc)
+ , format(0)
+ , planes(0)
+ , widths{0,0,0}
+ , heights{0,0,0}
+ , offsets{0,0,0}
+ , sizes{0,0,0}
+ {
+ picture.picture_width = ALIGN(w,2);
+ picture.picture_height = ALIGN(h,2);
+
+ switch(fourcc) {
+ planes = 3;
+ widths = {
+ w +( w & 1),
+ (w + 1) >> 1,
+ (w + 1) >> 1
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ (h + 1) >> 1
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ planes = 2;
+ widths = {
+ w + (w & 1),
+ w + (w & 1),
+ 0
+ };
+ heights = {
+ h + (h & 1),
+ (h + 1) >> 1,
+ 0
+ };
+ format = VA_RT_FORMAT_YUV420;
+ fourcc_output = VA_FOURCC_IMC3;
+ break;
+ return;
+ }
+
+ for (size_t i(0); i < planes; ++i) {
+ sizes[i] = widths[i] * heights[i];
+ }
+
+ for (size_t i(1); i < planes; ++i) {
+ offsets[i] = sizes[i - 1];
+ offsets[i] += offsets[i - 1];
+ }
+ }
+
+ const unsigned width() const
+ {
+ return picture.picture_width;
+ }
+
+ const unsigned height() const
+ {
+ return picture.picture_height;
+ }
+
+ const uint8_t* plane(const size_t i) const
+ {
+ return bytes.data() + offsets[i];
+ }
+
+ friend ::std::ostream&
operator<<(::std::ostream& os, const
TestInput& t)
+ {
+ return os
+ << std::string((char*)(&t.fourcc), 4)
+ << " " << t.width() << "x" <<
t.height()
+ << " " << t.widths << " " <<
t.heights
+ << " " << t.sizes << " " << t.offsets
+ ;
+ }
+
+ friend ::std::ostream&
operator<<(::std::ostream& os, const
Shared& t)
+ {
+ return os << *t;
+ }
+
+ ByteData bytes;
+ PictureParameter picture;
+ IQMatrix matrix;
+ HuffmanTable huffman;
+ SliceParameter slice;
+ unsigned fourcc;
+ unsigned fourcc_output;
+ unsigned format;
+ size_t planes;
+ std::array<size_t, 3> widths;
+ std::array<size_t, 3> heights;
+ std::array<size_t, 3> offsets;
+ std::array<size_t, 3> sizes;
+ };
+
+
+} // namespace Encode
+} // namespace JPEG
+
#endif
diff --git a/test/i965_test_fixture.h
b/test/i965_test_fixture.h
index 54d85d223789..c805b359e19f 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -35,6 +35,7 @@
typedef std::vector<VASurfaceID> Surfaces;
typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
+typedef std::vector<VABufferID> Buffers;
/**
* This test fixture handles initialization and
termination of the i965
driver
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
--
Sean V. Kelley <***@intel.com>
Open Source Technology Center / SSG
Intel Corp.
Xiang, Haihao
2016-10-13 07:35:38 UTC
Permalink
Post by Eoff, Ullysses A
I have not seen these two (7680x4320 YUY2 and UYVY) fail before on my
SKL... I just ran them
"./test_i965_drv_video --
gtest_filter=Common/JPEGEncodeInputTest.Full/98 --gtest_repeat=25"
"./test_i965_drv_video --
gtest_filter=Common/JPEGEncodeInputTest.Full/97 --gtest_repeat=25"
What is the test failure that you are seeing?
I saw the message below on my SKL

i965_jpeg_encode_test.cpp:415: Failure
Value of: std::equal(result, result + w, source, isClose)
  Actual: false
Expected: true
Byte(s) mismatch in plane 2 row 4318
i965_jpeg_encode_test.cpp:415: Failure
Value of: std::equal(result, result + w, source, isClose)
  Actual: false
Expected: true
Byte(s) mismatch in plane 2 row 4319
Creator: Fixed Size 7680x4320
Input  : UYVY 7680x4320 {15360,0,0} {4320,0,0} {66355200,0,0} {0,0,0}
[  FAILED  ] Common/JPEGEncodeInputTest.Full/97, where GetParam() =
(Fixed Size 7680x4320, 0x50125b pointing to "UYVY") (5269 ms)

The weird thing is that I can not reproduce this issue any more after
rebooting the machine. Maybe HW was in a bad state before reboot.
Post by Eoff, Ullysses A
Note that the YUV input data for these tests is random... so in this
regard, the test is different
each time it's executed.  The random YUV input data can have an
effect on the actual size
required for the coded buffer result.  So my guess is that the tests
1. The user allocated coded buffer is not large enough for the
driver's encoding result (i.e. overflow occurs).
2. For some specific random YUV data inputs, the decoded output YUV result does not match.
For the 7680x4320 I420 case, the test always fails due to YUV
input/output mismatch.  IIRC, the
difference between the failing Y values are within a tolerance of 7
or 8.  But these tests only allow
a  tolerance of 2.
This issue was fixed by patch below, I tested it on SKL and didn't see
any failure, but I have no other machine to verify the patch.
https://lists.freedesktop.org/archives/libva/2016-October/004616.html

[==========] 514 tests from 14 test cases ran. (469873 ms total)
[  PASS
ED  ] 514 tests.

Thanks
Haihao
Post by Eoff, Ullysses A
----
U. Artie
-----Original Message-----
From: Xiang, Haihao
Sent: Wednesday, October 12, 2016 12:17 PM
Subject: RE: [Libva] [PATCH intel-driver v2 7/7] test: add some jpeg encode tests
Hi Artie,
When I was investigating the issue with the 7680x4320 I420 test, I
experienced random failures
with Common/JPEGEncodeInputTest.Full/98 and
Common/JPEGEncodeInputTest.Full/97. I guess
it is caused by the test case, did you see this issue in your side?
To reproduce the issue, you should run the case a few times.
Thanks
Haihao
-----Original Message-----
Kelley
Sent: Thursday, September 29, 2016 4:15 AM
edesktop.org
Subject: Re: [Libva] [PATCH intel-driver v2 7/7] test: add some jpeg encode
tests
Add JPEG encode tests that encode raw I420 and NV12 data
at quality 100 and then decodes them to verify proper
encoding.
Currently, the 7680x4320 I420 test fails because ~40-60
Y-values (i.e. plane 0) in each line from the decoded
bitstream are off by more than 2 of the original raw
I420 values.  It is not clear why only this resolution
exhibits this problem.
Ah this was the one we talked about.  Accepted.
Sean
v2: don't create any input data in test fixture if
jpeg encoding is not supported.
---
test/Makefile.am               |   1 +
test/i965_jpeg_encode_test.cpp | 699
+++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h     | 198 +++++++++++-
test/i965_test_fixture.h       |   1 +
4 files changed, 895 insertions(+), 4 deletions(-)
create mode 100644 test/i965_jpeg_encode_test.cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index 2e9edda648a4..99560f8d8a54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -57,6 +57,7 @@ test_i965_drv_video_SOURCES =
\
  i965_jpeg_test_data.cpp
\
  i965_test_fixture.cpp
\
  i965_jpeg_decode_test.cpp
\
+ i965_jpeg_encode_test.cpp
\
  object_heap_test.cpp
\
  test_main.cpp
\
  $(NULL)
diff --git a/test/i965_jpeg_encode_test.cpp
b/test/i965_jpeg_encode_test.cpp
new file mode 100644
index 000000000000..08d80c4f75b7
--- /dev/null
+++ b/test/i965_jpeg_encode_test.cpp
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the
Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ *
+ * The above copyright notice and this permission notice
(including
the
+ * next paragraph) shall be included in all copies or
substantial
portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+#include "test_utils.h"
+
+#include <algorithm>
+#include <cstring>
+#include <fstream>
+#include <memory>
+#include <sstream>
+#include <tuple>
+
+namespace JPEG {
+namespace Encode {
+
+class JPEGEncodeTest
+    : public I965TestFixture
+{
+    JPEGEncodeTest()
+        : I965TestFixture()
+        , config(VA_INVALID_ID) // invalid
+        , context(VA_INVALID_ID) // invalid
+    { }
+
+    virtual void TearDown()
+    {
+        if (context != VA_INVALID_ID) {
+            destroyContext(context);
+            context = VA_INVALID_ID;
+        }
+
+        if (config != VA_INVALID_ID) {
+            destroyConfig(config);
+            config = VA_INVALID_ID;
+        }
+
+        I965TestFixture::TearDown();
+    }
+
+    VAConfigID config;
+    VAContextID context;
+};
+
+TEST_F(JPEGEncodeTest, Entrypoint)
+{
+    ConfigAttribs attributes;
+    struct i965_driver_data *i965(*this);
+
+    ASSERT_PTR(i965);
+
+    if (HAS_JPEG_ENCODING(i965)) {
+        config = createConfig(profile, entrypoint,
attributes);
+    } else {
+        VAStatus status = i965_CreateConfig(
+            *this, profile, entrypoint, attributes.data(),
attributes.size(),
+            &config);
+
EXPECT_STATUS_EQ(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT,
status);
+        EXPECT_INVALID_ID(config);
+    }
+}
+
+class TestInputCreator
+{
+    typedef std::shared_ptr<TestInputCreator> Shared;
+    typedef std::shared_ptr<const TestInputCreator>
SharedConst;
+
+    TestInput::Shared create(const unsigned fourcc) const
+    {
+        const std::array<unsigned, 2> res = getResolution();
+
+        TestInput::Shared input(new TestInput(fourcc, res[0],
res[1]));
+        ByteData& bytes = input->bytes;
+
+        RandomValueGenerator<uint8_t> rg(0x00, 0xff);
+        for (size_t i(0); i < input->planes; ++i)
+            std::generate_n(
+                std::back_inserter(bytes), input->sizes[i],
+                [&rg]{ return rg(); });
+        return input;
+    }
+
+    friend ::std::ostream& operator<<(
+        ::std::ostream& os, const TestInputCreator& t)
+    {
+        t.repr(os);
+        return os;
+    }
+
+    friend ::std::ostream& operator<<(
+        ::std::ostream& os, const TestInputCreator::Shared& t)
+    {
+        return os << *t;
+    }
+
+    friend ::std::ostream& operator<<(
+        ::std::ostream& os, const
TestInputCreator::SharedConst& t)
+    {
+        return os << *t;
+    }
+
+    virtual std::array<unsigned, 2> getResolution() const = 0;
+    virtual void repr(std::ostream& os) const = 0;
+};
+
+template <typename T>
+const std::string toString(const T& t)
+{
+    std::ostringstream os;
+    os << t;
+    return os.str();
+}
+
+const TestInput::Shared NV12toI420(const
TestInput::SharedConst&
nv12)
+{
+    TestInput::Shared i420(
+        new TestInput(VA_FOURCC_I420, nv12->width(), nv12-
Post by U. Artie Eoff
height()));
+
+    i420->bytes = nv12->bytes;
+
+    size_t i(0);
+    auto predicate = [&i](const ByteData::value_type&) {
+        bool isu = ((i % 2) == 0) or (i == 0);
+        ++i;
+        return isu;
+    };
+
+    std::stable_partition(
+        i420->bytes.begin() + i420->offsets[1],
+        i420->bytes.end(), predicate);
+
+    return i420;
+}
+
+#define ASSERT_NO_FAILURE(statement) \
+    statement; \
+    ASSERT_FALSE(HasFailure());
+
+class JPEGEncodeInputTest
+    : public JPEGEncodeTest
+    , public ::testing::WithParamInterface<
+        std::tuple<TestInputCreator::SharedConst, const char*>
+{
+    JPEGEncodeInputTest()
+        : JPEGEncodeTest::JPEGEncodeTest()
+        , surfaces() // empty
+        , coded(VA_INVALID_ID) // invalid
+        , renderBuffers() // empty
+        , input() // invalid
+        , output() // empty
+    { }
+
+    virtual void SetUp()
+    {
+        JPEGEncodeTest::SetUp();
+
+        struct i965_driver_data *i965(*this);
+        ASSERT_PTR(i965);
+        if (not HAS_JPEG_ENCODING(i965))
+            return;
+
+        TestInputCreator::SharedConst creator;
+        std::string sFourcc;
+        std::tie(creator, sFourcc) = GetParam();
+
+        ASSERT_PTR(creator.get()) << "Invalid test input
creator
parameter";
+
+        ASSERT_EQ(4u, sFourcc.size())
+            << "Invalid fourcc parameter '" << sFourcc << "'";
+
+        unsigned fourcc = VA_FOURCC(
+            sFourcc[0], sFourcc[1], sFourcc[2], sFourcc[3]);
+
+        input = creator->create(fourcc);
+
+        ASSERT_PTR(input.get())
+            << "Unhandled fourcc parameter '" << sFourcc <<
"'"
+            << " = 0x" << std::hex << fourcc << std::dec;
+
+        ASSERT_EQ(fourcc, input->fourcc);
+
+        RecordProperty("test_input", toString(*input));
+    }
+
+    virtual void TearDown()
+    {
+        for (auto id : renderBuffers) {
+            if (id != VA_INVALID_ID) {
+                destroyBuffer(id);
+            }
+        }
+        renderBuffers.clear();
+
+        if (coded != VA_INVALID_ID) {
+            destroyBuffer(coded);
+            coded = VA_INVALID_ID;
+        }
+
+        if (not surfaces.empty()) {
+            destroySurfaces(surfaces);
+            surfaces.clear();
+        }
+
+        if (std::get<0>(GetParam()).get())
+            std::cout << "Creator: " <<
std::get<0>(GetParam()) <<
std::endl;
+        if (input.get())
+            std::cout << "Input  : " << input << std::endl;
+
+        JPEGEncodeTest::TearDown();
+    }
+
+    void Encode()
+    {
+        ASSERT_FALSE(surfaces.empty());
+
+        ASSERT_NO_FAILURE(
+            beginPicture(context, surfaces.front()));
+        ASSERT_NO_FAILURE(
+            renderPicture(context, renderBuffers.data(),
renderBuffers.size()));
+        ASSERT_NO_FAILURE(
+            endPicture(context));
+        ASSERT_NO_FAILURE(
+            syncSurface(surfaces.front()));
+        ASSERT_NO_FAILURE(
+            VACodedBufferSegment *segment =
+                mapBuffer<VACodedBufferSegment>(coded));
+
+        EXPECT_FALSE(segment->status &
VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK)
+            << "segment->size = " << segment->size;
+        EXPECT_PTR_NULL(segment->next);
+
+        // copy segment buffer to output while stripping the
packed
header data
+        const size_t headerSize(1);
+        output.resize(segment->size - headerSize, 0x0);
+        std::memcpy(
+            output.data(),
+            reinterpret_cast<uint8_t *>(segment->buf) +
headerSize,
+            segment->size - headerSize);
+
+        unmapBuffer(coded);
+
+        // EOI JPEG Marker
+        ASSERT_GE(output.size(), 2u);
+        EXPECT_TRUE(
+            unsigned(0xff) == unsigned(*(output.end() - 2))
and
+            unsigned(0xd9) == unsigned(output.back()))
+            << "Invalid JPEG EOI Marker";
+    }
+
+    void SetUpSurfaces()
+    {
+        SurfaceAttribs attributes(1);
+        attributes.front().flags = VA_SURFACE_ATTRIB_SETTABLE;
+        attributes.front().type = VASurfaceAttribPixelFormat;
+        attributes.front().value.type =
VAGenericValueTypeInteger;
+        attributes.front().value.value.i = input->fourcc;
+        surfaces = createSurfaces(input->width(), input-
Post by U. Artie Eoff
height(),
+            input->format, 1, attributes);
+    }
+
+    void CopyInputToSurface()
+    {
+        ASSERT_FALSE(surfaces.empty());
+
+        VAImage image;
+        deriveImage(surfaces.front(), image);
+        if (HasFailure())
+            return;
+
+        SCOPED_TRACE(::testing::Message() << std::endl <<
image);
+
+        RecordProperty("input_image", toString(image));
+
+        EXPECT_EQ(input->planes, image.num_planes);
+        EXPECT_GT(image.data_size, 0u);
+        EXPECT_EQ(input->width(), image.width);
+        EXPECT_EQ(input->height(), image.height);
+        if (HasFailure()) {
+            unmapBuffer(image.buf);
+            destroyImage(image);
+            return;
+        }
+
+        uint8_t *data = mapBuffer<uint8_t>(image.buf);
+        if (HasFailure()) {
+            destroyImage(image);
+            return;
+        }
+
+        std::memset(data, 0, image.data_size);
+
+        for (size_t i(0); i < image.num_planes; ++i) {
+            size_t w = input->widths[i];
+            size_t h = input->heights[i];
+
+            EXPECT_GE(image.pitches[i], w);
+            if (HasFailure())
+                break;
+
+            const ByteData::value_type *source = input-
Post by U. Artie Eoff
plane(i);
+            uint8_t *dest = data + image.offsets[i];
+            for (size_t r(0); r < h; ++r) {
+                std::memcpy(dest, source, w);
+                source += w;
+                dest += image.pitches[i];
+            }
+        }
+
+        unmapBuffer(image.buf);
+        destroyImage(image);
+    }
+
+    void SetUpConfig()
+    {
+        ASSERT_INVALID_ID(config);
+        ConfigAttribs attributes(
+            1, {type:VAConfigAttribRTFormat, value:input-
Post by U. Artie Eoff
format});
+        config = createConfig(profile, entrypoint,
attributes);
+    }
+
+    void SetUpContext()
+    {
+        ASSERT_INVALID_ID(context);
+        context = createContext(config, input->width(),
+            input->height(), 0, surfaces);
+    }
+
+    void SetUpCodedBuffer()
+    {
+        ASSERT_INVALID_ID(coded);
+        unsigned size =
+            std::accumulate(input->sizes.begin(), input-
Post by U. Artie Eoff
sizes.end(),
8192u);
+        size *= input->planes;
+        coded = createBuffer(context, VAEncCodedBufferType,
size);
+    }
+
+    void SetUpPicture()
+    {
+        input->picture.coded_buf = coded;
+        renderBuffers.push_back(
+            createBuffer(context,
VAEncPictureParameterBufferType,
+                sizeof(PictureParameter), 1, &input-
Post by U. Artie Eoff
picture));
+    }
+
+    void SetUpIQMatrix()
+    {
+        renderBuffers.push_back(
+            createBuffer(context, VAQMatrixBufferType,
sizeof(IQMatrix),
+                1, &input->matrix));
+    }
+
+    void SetUpHuffmanTables()
+    {
+        renderBuffers.push_back(
+            createBuffer(context, VAHuffmanTableBufferType,
+                sizeof(HuffmanTable), 1, &input->huffman));
+    }
+
+    void SetUpSlice()
+    {
+        renderBuffers.push_back(
+            createBuffer(context,
VAEncSliceParameterBufferType,
+                sizeof(SliceParameter), 1, &input->slice));
+    }
+
+    void SetUpHeader()
+    {
+        /*
+         * The driver expects a packed JPEG header which it
prepends to
the
+         * coded buffer segment output. The driver does not
appear to
inspect
+         * this header, however.  So we'll just create a 1-
byte packed
header
+         * since we really don't care if it contains a "valid"
JPEG header.
+         */
+        renderBuffers.push_back(
+            createBuffer(context,
VAEncPackedHeaderParameterBufferType,
+                sizeof(VAEncPackedHeaderParameterBuffer)));
+        if (HasFailure())
+            return;
+
+        VAEncPackedHeaderParameterBuffer *packed =
+
mapBuffer<VAEncPackedHeaderParameterBuffer>(renderBuffers.back())
;
+        if (HasFailure())
+            return;
+
+        std::memset(packed, 0, sizeof(*packed));
+        packed->type = VAEncPackedHeaderRawData;
+        packed->bit_length = 8;
+        packed->has_emulation_bytes = 0;
+
+        unmapBuffer(renderBuffers.back());
+
+        renderBuffers.push_back(
+            createBuffer(context,
VAEncPackedHeaderDataBufferType,
1));
+    }
+
+    Surfaces            surfaces;
+    VABufferID          coded;
+    Buffers             renderBuffers;
+    TestInput::Shared   input;
+    ByteData            output;
+
+    void VerifyOutput()
+    {
+        // VerifyOutput only supports VA_FOURCC_IMC3 output,
currently
+        ASSERT_EQ(unsigned(VA_FOURCC_IMC3), input-
Post by U. Artie Eoff
fourcc_output);
+        TestInput::SharedConst expect = input;
+        if (input->fourcc == VA_FOURCC_NV12)
+            expect = NV12toI420(input);
+
+        ::JPEG::Decode::PictureData::SharedConst pd =
+            ::JPEG::Decode::PictureData::make(
+                input->fourcc_output, output, input->width(),
input-
Post by U. Artie Eoff
height());
+
+        ASSERT_NO_FAILURE(
+            Surfaces osurfaces = createSurfaces(
+                pd->pparam.picture_width, pd-
Post by U. Artie Eoff
pparam.picture_height,
+                pd->format));;
+
+        ConfigAttribs attribs(
+            1, {type:VAConfigAttribRTFormat, value:pd-
Post by U. Artie Eoff
format});
+        ASSERT_NO_FAILURE(
+            VAConfigID oconfig = createConfig(
+                ::JPEG::profile, ::JPEG::Decode::entrypoint,
attribs));
+
+        ASSERT_NO_FAILURE(
+            VAContextID ocontext = createContext(
+                oconfig, pd->pparam.picture_width, pd-
Post by U. Artie Eoff
pparam.picture_height,
+                0, osurfaces));
+
+        Buffers buffers;
+
+        ASSERT_NO_FAILURE(
+            buffers.push_back(
+                createBuffer(
+                    ocontext, VASliceDataBufferType, pd-
Post by U. Artie Eoff
sparam.slice_data_size,
+                    1, pd->slice.data())));
+
+        ASSERT_NO_FAILURE(
+            buffers.push_back(
+                createBuffer(
+                    ocontext, VASliceParameterBufferType,
sizeof(pd-
Post by U. Artie Eoff
sparam),
+                    1, &pd->sparam)));
+
+        ASSERT_NO_FAILURE(
+            buffers.push_back(
+                createBuffer(
+                    ocontext,VAPictureParameterBufferType,
sizeof(pd-
Post by U. Artie Eoff
pparam),
+                    1, &pd->pparam)));
+
+        ASSERT_NO_FAILURE(
+            buffers.push_back(
+                createBuffer(
+                    ocontext, VAIQMatrixBufferType, sizeof(pd-
Post by U. Artie Eoff
iqmatrix),
+                    1, &pd->iqmatrix)));
+
+        ASSERT_NO_FAILURE(
+            buffers.push_back(
+                createBuffer(
+                    ocontext, VAHuffmanTableBufferType,
sizeof(pd-
Post by U. Artie Eoff
huffman),
+                    1, &pd->huffman)));
+
+        ASSERT_NO_FAILURE(beginPicture(ocontext,
osurfaces.front()));
+        ASSERT_NO_FAILURE(
+            renderPicture(ocontext, buffers.data(),
buffers.size()));
+        ASSERT_NO_FAILURE(endPicture(ocontext));
+        ASSERT_NO_FAILURE(syncSurface(osurfaces.front()));
+
+        VAImage image;
+        ASSERT_NO_FAILURE(deriveImage(osurfaces.front(),
image));
+        ASSERT_NO_FAILURE(uint8_t *data =
mapBuffer<uint8_t>(image.buf));
+
+        auto isClose = [](const uint8_t& a, const uint8_t& b)
{
+            return std::abs(int(a)-int(b)) <= 2;
+        };
+
+        for (size_t i(0); i < image.num_planes; ++i) {
+            size_t w = expect->widths[i];
+            size_t h = expect->heights[i];
+
+            const ByteData::value_type *source = expect-
Post by U. Artie Eoff
plane(i);
+            const uint8_t *result = data + image.offsets[i];
+            ASSERT_GE(image.pitches[i], w);
+            for (size_t r(0); r < h; ++r) {
+                EXPECT_TRUE(std::equal(result, result + w,
source, isClose))
+                    << "Byte(s) mismatch in plane " << i << "
row " << r;
+                source += w;
+                result += image.pitches[i];
+            }
+        }
+
+        unmapBuffer(image.buf);
+
+        for (auto id : buffers)
+            destroyBuffer(id);
+
+        destroyImage(image);
+        destroyContext(ocontext);
+        destroyConfig(oconfig);
+        destroySurfaces(osurfaces);
+    }
+};
+
+TEST_P(JPEGEncodeInputTest, Full)
+{
+    struct i965_driver_data *i965(*this);
+    ASSERT_PTR(i965);
+    if (not HAS_JPEG_ENCODING(i965)) {
+        RecordProperty("skipped", true);
+        std::cout << "[  SKIPPED ] " << getFullTestName()
+            << " is unsupported on this hardware" <<
std::endl;
+        return;
+    }
+
+    ASSERT_NO_FAILURE(SetUpSurfaces());
+    ASSERT_NO_FAILURE(SetUpConfig());
+    ASSERT_NO_FAILURE(SetUpContext());
+    ASSERT_NO_FAILURE(SetUpCodedBuffer());
+    ASSERT_NO_FAILURE(SetUpPicture());
+    ASSERT_NO_FAILURE(SetUpIQMatrix());
+    ASSERT_NO_FAILURE(SetUpHuffmanTables());
+    ASSERT_NO_FAILURE(SetUpSlice());
+    ASSERT_NO_FAILURE(SetUpHeader());
+    ASSERT_NO_FAILURE(CopyInputToSurface());
+    ASSERT_NO_FAILURE(Encode());
+
+    VerifyOutput();
+}
+
+class RandomSizeCreator
+    : public TestInputCreator
+{
+    std::array<unsigned, 2> getResolution() const
+    {
+        static RandomValueGenerator<unsigned> rg(1, 769);
+        return {rg(), rg()};
+    }
+    void repr(std::ostream& os) const { os << "Random Size"; }
+};
+
+INSTANTIATE_TEST_CASE_P(
+    Random, JPEGEncodeInputTest,
+    ::testing::Combine(
+        ::testing::ValuesIn(
+            std::vector<TestInputCreator::SharedConst>(
+                5, TestInputCreator::SharedConst(new
RandomSizeCreator))),
+        ::testing::Values("I420", "NV12")
+    )
+);
+
+class FixedSizeCreator
+    : public TestInputCreator
+{
+    FixedSizeCreator(const std::array<unsigned, 2>&
resolution)
+        : res(resolution)
+    { }
+
+    std::array<unsigned, 2> getResolution() const { return
res; }
+    void repr(std::ostream& os) const
+    {
+        os << "Fixed Size " << res[0] << "x" << res[1];
+    }
+
+    const std::array<unsigned, 2> res;
+};
+
+typedef std::vector<TestInputCreator::SharedConst>
InputCreators;
+
+InputCreators generateCommonInputs()
+{
+    return {
+        TestInputCreator::Shared(new FixedSizeCreator({800,
600})), /*
SVGA */
+        TestInputCreator::Shared(new FixedSizeCreator({1024,
600})), /*
WSVGA */
+        TestInputCreator::Shared(new FixedSizeCreator({1024,
768})), /*
XGA */
+        TestInputCreator::Shared(new FixedSizeCreator({1152,
864})), /*
XGA+ */
+        TestInputCreator::Shared(new FixedSizeCreator({1280,
720})), /*
WXGA */
+        TestInputCreator::Shared(new FixedSizeCreator({1280,
768})), /*
WXGA */
+        TestInputCreator::Shared(new FixedSizeCreator({1280,
800})), /*
WXGA */
+        TestInputCreator::Shared(new FixedSizeCreator({1280,
1024})),
/* SXGA */
+        TestInputCreator::Shared(new FixedSizeCreator({1360,
768})), /*
HD */
+        TestInputCreator::Shared(new FixedSizeCreator({1366,
768})), /*
HD */
+        TestInputCreator::Shared(new FixedSizeCreator({1440,
900})), /*
WXGA+ */
+        TestInputCreator::Shared(new FixedSizeCreator({1600,
900})), /*
HD+ */
+        TestInputCreator::Shared(new FixedSizeCreator({1600,
1200})),
/* UXGA */
+        TestInputCreator::Shared(new FixedSizeCreator({1680,
1050})),
/* WSXGA+ */
+        TestInputCreator::Shared(new FixedSizeCreator({1920,
1080})),
/* FHD */
+        TestInputCreator::Shared(new FixedSizeCreator({1920,
1200})),
/* WUXGA */
+        TestInputCreator::Shared(new FixedSizeCreator({2560,
1440})),
/* WQHD */
+        TestInputCreator::Shared(new FixedSizeCreator({2560,
1600})),
/* WQXGA */
+        TestInputCreator::Shared(new FixedSizeCreator({3640,
2160})),
/* UHD (4K) */
+        TestInputCreator::Shared(new FixedSizeCreator({7680,
4320})),
/* UHD (8K) */
+    };
+}
+
+INSTANTIATE_TEST_CASE_P(
+    Common, JPEGEncodeInputTest,
+    ::testing::Combine(
+        ::testing::ValuesIn(generateCommonInputs()),
+        ::testing::Values("I420", "NV12")
+    )
+);
+
+INSTANTIATE_TEST_CASE_P(
+    Big, JPEGEncodeInputTest,
+    ::testing::Combine(
+        ::testing::Values(
+            TestInputCreator::Shared(new
FixedSizeCreator({8192, 8192}))
+        ),
+        ::testing::Values("I420", "NV12")
+    )
+);
+
+InputCreators generateEdgeCaseInputs()
+{
+    std::vector<TestInputCreator::SharedConst> result;
+    for (unsigned i(64); i <= 512; i += 64) {
+        result.push_back(
+            TestInputCreator::Shared(new FixedSizeCreator({i,
i})));
+        result.push_back(
+            TestInputCreator::Shared(new
FixedSizeCreator({i+1, i})));
+        result.push_back(
+            TestInputCreator::Shared(new FixedSizeCreator({i,
i+1})));
+        result.push_back(
+            TestInputCreator::Shared(new
FixedSizeCreator({i+1, i+1})));
+        result.push_back(
+            TestInputCreator::Shared(new FixedSizeCreator({i-
1, i})));
+        result.push_back(
+            TestInputCreator::Shared(new FixedSizeCreator({i,
i-1})));
+        result.push_back(
+            TestInputCreator::Shared(new FixedSizeCreator({i-
1, i-1})));
+    }
+
+    result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 1})));
+    result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 2})));
+    result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 1})));
+    result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({2, 2})));
+    result.push_back(TestInputCreator::Shared(new
FixedSizeCreator({1, 462})));
+
+    return result;
+}
+
+INSTANTIATE_TEST_CASE_P(
+    Edge, JPEGEncodeInputTest,
+    ::testing::Combine(
+        ::testing::ValuesIn(generateEdgeCaseInputs()),
+        ::testing::Values("I420", "NV12")
+    )
+);
+
+InputCreators generateMiscInputs()
+{
+    return {
+        TestInputCreator::Shared(new FixedSizeCreator({150,
75})),
+        TestInputCreator::Shared(new FixedSizeCreator({10,
10})),
+        TestInputCreator::Shared(new FixedSizeCreator({385,
610})),
+        TestInputCreator::Shared(new FixedSizeCreator({1245,
1281})),
+    };
+}
+
+INSTANTIATE_TEST_CASE_P(
+    Misc, JPEGEncodeInputTest,
+    ::testing::Combine(
+        ::testing::ValuesIn(generateMiscInputs()),
+        ::testing::Values("I420", "NV12")
+    )
+);
+
+} // namespace Encode
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h
b/test/i965_jpeg_test_data.h
index d52f58233cc5..490ec941feb5 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -25,6 +25,8 @@
#ifndef I965_JPEG_TEST_DATA_H
#define I965_JPEG_TEST_DATA_H
+#include "i965_test_fixture.h"
+
#include <array>
#include <iostream>
#include <map>
@@ -183,6 +185,18 @@ namespace Decode {
             const HuffmanTable& huffman = defaultHuffmanTable,
             const IQMatrix& iqmatrix = defaultIQMatrix)
         {
+            return make(fourcc, slice, W, H, sparam, pparam,
huffman,
iqmatrix);
+        }
+
+        static SharedConst make(
+            const unsigned fourcc,
+            const ByteData& slice,
+            const unsigned w, const unsigned h,
+            const SliceParameter& sparam =
defaultSliceParameter,
+            const PictureParameter& pparam =
defaultPictureParameter,
+            const HuffmanTable& huffman = defaultHuffmanTable,
+            const IQMatrix& iqmatrix = defaultIQMatrix)
+        {
             Shared pd(
                 new PictureData {
                     slice: slice,
@@ -196,8 +210,8 @@ namespace Decode {
             );
             pd->sparam.slice_data_size = slice.size();
-            pd->pparam.picture_width = W;
-            pd->pparam.picture_height = H;
+            pd->pparam.picture_width = w;
+            pd->pparam.picture_height = h;
             switch(fourcc)
             {
@@ -232,8 +246,8 @@ namespace Decode {
             /* Calculate num_mcus */
             int hfactor = pd-
Post by U. Artie Eoff
pparam.components[0].h_sampling_factor <<
3;
             int vfactor = pd-
Post by U. Artie Eoff
pparam.components[0].v_sampling_factor <<
3;
-            int wmcu = (W + hfactor - 1) / hfactor;
-            int hmcu = (H + vfactor - 1) / vfactor;
+            int wmcu = (w + hfactor - 1) / hfactor;
+            int hmcu = (h + vfactor - 1) / vfactor;
             pd->sparam.num_mcus = wmcu * hmcu;
             return pd;
@@ -321,4 +335,180 @@ namespace Decode {
} // namespace Decode
} // namespace JPEG
+namespace JPEG {
+namespace Encode {
+    typedef VAQMatrixBufferJPEG                 IQMatrix;
+    typedef VAHuffmanTableBufferJPEGBaseline    HuffmanTable;
+    typedef
VAEncPictureParameterBufferJPEG     PictureParameter;
+    typedef
VAEncSliceParameterBufferJPEG       SliceParameter;
+
+    static const VAEntrypoint entrypoint =
VAEntrypointEncPicture;
+
+    static const IQMatrix defaultIQMatrix = { /* Quality 50 */
+        load_lum_quantiser_matrix: 1,
+        load_chroma_quantiser_matrix: 1,
+        lum_quantiser_matrix: {
+            0x10,0x0b,0x0c,0x0e,0x0c,0x0a,0x10,0x0e,
+            0x0d,0x0e,0x12,0x11,0x10,0x13,0x18,0x28,
+            0x1a,0x18,0x16,0x16,0x18,0x31,0x23,0x25,
+            0x1d,0x28,0x3a,0x33,0x3d,0x3c,0x39,0x33,
+            0x38,0x37,0x40,0x48,0x5c,0x4e,0x40,0x44,
+            0x57,0x45,0x37,0x38,0x50,0x6d,0x51,0x57,
+            0x5f,0x62,0x67,0x68,0x67,0x3e,0x4d,0x71,
+            0x79,0x70,0x64,0x78,0x5c,0x65,0x67,0x63,
+        },
+        chroma_quantiser_matrix: {
+            0x11,0x12,0x12,0x18,0x15,0x18,0x2f,0x1a,
+            0x1a,0x2f,0x63,0x42,0x38,0x42,0x63,0x63,
+            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+            0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,
+        },
+    };
+
+    static const HuffmanTable defaultHuffmanTable =
+        ::JPEG::Decode::defaultHuffmanTable;
+
+    static const PictureParameter defaultPictureParameter = {
+        reconstructed_picture:      VA_INVALID_ID,
+        picture_width:              10,
+        picture_height:             10,
+        coded_buf:                  VA_INVALID_ID,
+        pic_flags:                  {value: 0x00100},
+        sample_bit_depth:           8,
+        num_scan:                   1,
+        num_components:             3,
+        component_id:               {0, 1, 2, 0},
+        quantiser_table_selector:   {0, 1, 1, 0},
+        quality:                    100,
+    };
+
+    static const SliceParameter defaultSliceParameter = {
+        restart_interval:   0,
+        num_components:     3,
+        /* component_selector, dc_table_selector,
ac_table_selector */
+        components:         {{1,0,0},{2,1,1},{3,1,1}},
+    };
+
+    class TestInput
+    {
+        typedef std::shared_ptr<TestInput> Shared;
+        typedef std::shared_ptr<TestInput> SharedConst;
+
+        TestInput(const unsigned fourcc, const unsigned w,
const
unsigned h)
+            : bytes() // caller must fill this in after
instantiation
+            , picture(defaultPictureParameter)
+            , matrix(defaultIQMatrix)
+            , huffman(defaultHuffmanTable)
+            , slice(defaultSliceParameter)
+            , fourcc(fourcc)
+            , fourcc_output(fourcc)
+            , format(0)
+            , planes(0)
+            , widths{0,0,0}
+            , heights{0,0,0}
+            , offsets{0,0,0}
+            , sizes{0,0,0}
+        {
+            picture.picture_width = ALIGN(w,2);
+            picture.picture_height = ALIGN(h,2);
+
+            switch(fourcc) {
+                planes = 3;
+                widths = {
+                    w +( w & 1),
+                    (w + 1) >> 1,
+                    (w + 1) >> 1
+                };
+                heights = {
+                    h + (h & 1),
+                    (h + 1) >> 1,
+                    (h + 1) >> 1
+                };
+                format = VA_RT_FORMAT_YUV420;
+                fourcc_output = VA_FOURCC_IMC3;
+                break;
+                planes = 2;
+                widths = {
+                    w + (w & 1),
+                    w + (w & 1),
+                    0
+                };
+                heights = {
+                    h + (h & 1),
+                    (h + 1) >> 1,
+                    0
+                };
+                format = VA_RT_FORMAT_YUV420;
+                fourcc_output = VA_FOURCC_IMC3;
+                break;
+                return;
+            }
+
+            for (size_t i(0); i < planes; ++i) {
+                sizes[i] = widths[i] * heights[i];
+            }
+
+            for (size_t i(1); i < planes; ++i) {
+                offsets[i] = sizes[i - 1];
+                offsets[i] += offsets[i - 1];
+            }
+        }
+
+        const unsigned width() const
+        {
+            return picture.picture_width;
+        }
+
+        const unsigned height() const
+        {
+            return picture.picture_height;
+        }
+
+        const uint8_t* plane(const size_t i) const
+        {
+            return bytes.data() + offsets[i];
+        }
+
+        friend ::std::ostream& operator<<(::std::ostream& os,
const
TestInput& t)
+        {
+            return os
+                << std::string((char*)(&t.fourcc), 4)
+                << " " << t.width() << "x" << t.height()
+                << " " << t.widths << " " << t.heights
+                << " " << t.sizes << " " << t.offsets
+            ;
+        }
+
+        friend ::std::ostream& operator<<(::std::ostream& os,
const
Shared& t)
+        {
+            return os << *t;
+        }
+
+        ByteData            bytes;
+        PictureParameter    picture;
+        IQMatrix            matrix;
+        HuffmanTable        huffman;
+        SliceParameter      slice;
+        unsigned            fourcc;
+        unsigned            fourcc_output;
+        unsigned            format;
+        size_t              planes;
+        std::array<size_t, 3> widths;
+        std::array<size_t, 3> heights;
+        std::array<size_t, 3> offsets;
+        std::array<size_t, 3> sizes;
+    };
+
+
+} // namespace Encode
+} // namespace JPEG
+
#endif
diff --git a/test/i965_test_fixture.h
b/test/i965_test_fixture.h
index 54d85d223789..c805b359e19f 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -35,6 +35,7 @@
typedef std::vector<VASurfaceID> Surfaces;
typedef std::vector<VASurfaceAttrib> SurfaceAttribs;
typedef std::vector<VAConfigAttrib> ConfigAttribs;
+typedef std::vector<VABufferID> Buffers;
/**
  * This test fixture handles initialization and termination of
the i965
driver
U. Artie Eoff
2016-09-26 20:11:46 UTC
Permalink
Add a wrapper that calls the driver i965_SyncSurface.

Signed-off-by: U. Artie Eoff <***@intel.com>
---
test/i965_internal_decl.h | 3 +++
test/i965_test_fixture.cpp | 6 ++++++
test/i965_test_fixture.h | 6 ++++++
3 files changed, 15 insertions(+)

diff --git a/test/i965_internal_decl.h b/test/i965_internal_decl.h
index 1b6fc407168f..dbfcbb87ee26 100644
--- a/test/i965_internal_decl.h
+++ b/test/i965_internal_decl.h
@@ -66,6 +66,9 @@ extern "C" {
extern VAStatus i965_DestroyImage(
VADriverContextP, VAImageID);

+ extern VAStatus i965_SyncSurface(
+ VADriverContextP, VASurfaceID);
+
extern struct hw_codec_info *i965_get_codec_info(int);
extern const struct intel_device_info *i965_get_device_info(int);

diff --git a/test/i965_test_fixture.cpp b/test/i965_test_fixture.cpp
index dd8143031fe9..073a24e1d142 100644
--- a/test/i965_test_fixture.cpp
+++ b/test/i965_test_fixture.cpp
@@ -212,6 +212,12 @@ void I965TestFixture::destroyImage(VAImage &image)
i965_DestroyImage(*this, image.image_id));
}

+void I965TestFixture::syncSurface(VASurfaceID surface)
+{
+ EXPECT_STATUS(
+ i965_SyncSurface(*this, surface));
+}
+
class I965TestFixtureTest
: public I965TestFixture
{
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index d09f31d859b1..54d85d223789 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
@@ -207,6 +207,12 @@ public:
void destroyImage(VAImage &);

/**
+ * Convenience wrapper for i965_SyncSurface. May generate a non-fatal
+ * test assertion failure.
+ */
+ void syncSurface(VASurfaceID);
+
+ /**
* VADisplay implicit and explicit conversion operator.
*/
operator VADisplay();
--
2.4.11
Zhao Yakui
2016-09-27 01:44:48 UTC
Permalink
Post by U. Artie Eoff
Add a wrapper that calls the driver i965_SyncSurface.
This looks good to me.

Thanks
Yakui
Post by U. Artie Eoff
---
test/i965_internal_decl.h | 3 +++
test/i965_test_fixture.cpp | 6 ++++++
test/i965_test_fixture.h | 6 ++++++
3 files changed, 15 insertions(+)
diff --git a/test/i965_internal_decl.h b/test/i965_internal_decl.h
index 1b6fc407168f..dbfcbb87ee26 100644
--- a/test/i965_internal_decl.h
+++ b/test/i965_internal_decl.h
@@ -66,6 +66,9 @@ extern "C" {
extern VAStatus i965_DestroyImage(
VADriverContextP, VAImageID);
+ extern VAStatus i965_SyncSurface(
+ VADriverContextP, VASurfaceID);
+
extern struct hw_codec_info *i965_get_codec_info(int);
extern const struct intel_device_info *i965_get_device_info(int);
diff --git a/test/i965_test_fixture.cpp b/test/i965_test_fixture.cpp
index dd8143031fe9..073a24e1d142 100644
--- a/test/i965_test_fixture.cpp
+++ b/test/i965_test_fixture.cpp
@@ -212,6 +212,12 @@ void I965TestFixture::destroyImage(VAImage&image)
i965_DestroyImage(*this, image.image_id));
}
+void I965TestFixture::syncSurface(VASurfaceID surface)
+{
+ EXPECT_STATUS(
+ i965_SyncSurface(*this, surface));
+}
+
class I965TestFixtureTest
: public I965TestFixture
{
diff --git a/test/i965_test_fixture.h b/test/i965_test_fixture.h
index d09f31d859b1..54d85d223789 100644
--- a/test/i965_test_fixture.h
+++ b/test/i965_test_fixture.h
void destroyImage(VAImage&);
/**
+ * Convenience wrapper for i965_SyncSurface. May generate a non-fatal
+ * test assertion failure.
+ */
+ void syncSurface(VASurfaceID);
+
+ /**
* VADisplay implicit and explicit conversion operator.
*/
operator VADisplay();
Zhao Yakui
2016-09-27 01:30:18 UTC
Permalink
Post by U. Artie Eoff
Move static definitions of JPEG TestPatternData into the .cpp
so that multiple files can include the i965_jpeg_test_data.h
header file. Otherwise, there will be "multiple definition"
compiler errors.
Also, change generateSolid to be inline for the same reason.
This looks good to me.
Post by U. Artie Eoff
---
test/Makefile.am | 1 +
test/i965_jpeg_test_data.cpp | 762 +++++++++++++++++++++++++++++++++++++++++++
test/i965_jpeg_test_data.h | 736 +----------------------------------------
3 files changed, 765 insertions(+), 734 deletions(-)
create mode 100644 test/i965_jpeg_test_data.cpp
diff --git a/test/Makefile.am b/test/Makefile.am
index 72dfed5a7aae..0d53e0f6150a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -53,6 +53,7 @@ noinst_HEADERS = \
test_i965_drv_video_SOURCES = \
i965_chipset_test.cpp \
i965_initialize_test.cpp \
+ i965_jpeg_test_data.cpp \
i965_test_fixture.cpp \
i965_jpeg_decode_test.cpp \
object_heap_test.cpp \
diff --git a/test/i965_jpeg_test_data.cpp b/test/i965_jpeg_test_data.cpp
new file mode 100644
index 000000000000..02d092c7d165
--- /dev/null
+++ b/test/i965_jpeg_test_data.cpp
@@ -0,0 +1,762 @@
+/*
+ * Copyright (C) 2016 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "i965_jpeg_test_data.h"
+
+namespace JPEG {
+ /**
+ * Test Pattern 1
+ *
+ * Solid Black 10x10
+ *
+ */
+ template<> const bool TestPatternData<1>::m_valid =
+ TestPatternData<1>::initialize<10, 10>(
+
+ generateSolid({0x00, 0x80, 0x80}, {10, 10}),
+
+ {{VA_FOURCC_IMC3, {
+ 0xff,0x00,0x3f,0xfa,0x28,0xa2,0x80,0x3f,0xff,
+ }},
+ {VA_FOURCC_422H, {
+ 0xff,0x00,0x3f,0xfa,0x28,0x00,0xa2,0x80,0x3f,0xff,
+ }},
+ {VA_FOURCC_422V, {
+ 0xff,0x00,0x3f,0xfa,0x28,0x00,0xa2,0x80,0x3f,0xff,
+ }},
+ {VA_FOURCC_411P, {
+ 0xff,0x00,0x3f,0xfa,0x28,0xa2,0x80,0x0a,0x28,0xa2,0x80,0x3f,
+ 0xff,
+ }},
+ {VA_FOURCC_444P, {
+ 0xff,0x00,0x3f,0xfa,0x00,0x28,0x00,0xa0,0x02,0x80,0x3f,0xff,
+ }}}
+ );
+
+
+ /**
+ * Test Pattern 2
+ *
+ * R = red
+ * G = green
+ * B = blue
+ * W = white
+ * K = black
+ * -------------------
+ * R R G G B B W W K K
+ * R R G G B B W W K K
+ * K K R R G G B B W W
+ * K K R R G G B B W W
+ * W W K K R R G G B B
+ * W W K K R R G G B B
+ * B B W W K K R R G G
+ * B B W W K K R R G G
+ * G G B B W W K K R R
+ * G G B B W W K K R R
+ * -------------------
+ *
+ */
+
+ template<> const bool TestPatternData<2>::m_valid =
+ TestPatternData<2>::initialize<10, 10>({
+ // Pixel Y Component
+ 0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,
+ 0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,
+ 0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,
+ 0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,
+ 0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,
+ 0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,
+ 0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,
+ 0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,
+
+ // Pixel U Component
+ 0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,
+ 0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,
+ 0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,
+ 0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,
+ 0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,
+ 0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,
+ 0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,
+ 0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,
+ 0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,
+ 0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,
+
+ // Pixel V Component
+ 0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,
+ 0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,
+ 0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,
+ 0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,
+ 0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,
+ 0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,
+ 0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,
+ 0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,
+ 0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,
+ 0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,
+ },{
+ {VA_FOURCC_IMC3, {
+ 0xf8,0x8b,0xc3,0x7e,0x24,0xf1,0xf7,0xec,0x71,0xe3,0xef,0xd9,
+ 0x8f,0xc6,0x5e,0x0d,0xfd,0xa7,0x7f,0xe1,0x27,0xf0,0x3f,0x89,
+ 0xff,0x00,0xe1,0x74,0xff,0x00,0xc3,0xae,0x3f,0xe0,0xa8,0xff,
+ 0x00,0xf0,0xa5,0xb4,0x5d,0x17,0xfe,0x13,0x5f,0xec,0x5d,0x16,
+ 0x7d,0x2b,0xf6,0xda,0xff,0x00,0x8c,0x25,0xd5,0x60,0xf1,0x46,
+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00,0xa0,0x40,0xfd,0xa4,0x7f,0xe4,0xc1,
+ 0xff,0x00,0xe0,0xe7,0x2f,0xfb,0xc2,0xef,0xfe,0xae,0x7d,0x0a,
+ 0x8f,0x0b,0xbf,0xe5,0x4f,0x3f,0xb2,0x7f,0xfe,0xf7,0xaf,0xff,
+ 0x00,0x62,0x8b,0x30,0x0f,0xd9,0xad,0xff,0x00,0x28,0xc1,0xc1,
+ 0x9f,0xf7,0x71,0x7f,0xeb,0xc2,0xe3,0xb3,0xf3,0xee,0xbf,0xc5,
+ 0x13,0xff,0x00,0x4f,0x83,0xff,
+ }},
+ });
+
+ /**
+ * Test Pattern 3
+ *
+ * R = red
+ * G = green
+ * B = blue
+ * W = white
+ * C = cyan
+ * M = magenta
+ * Y = yellow
+ * K = black
+ * -------------------
+ * K R B Y G C M K K W
+ * R K R B Y G C M W K
+ * B R K R B Y G C M K
+ * Y B R K R B Y G C M
+ * G Y B R K R B Y G C
+ * C G Y B R K R B Y G
+ * M C G Y B R K R B Y
+ * K M C G Y B R K R K
+ * K W M C G Y B R K R
+ * W K K M C G Y B R K
+ * -------------------
+ *
+ */
+ template<> const bool TestPatternData<3>::m_valid =
+ TestPatternData<3>::initialize<10, 10>({
+ 0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x69,0x00,0x00,0xfe,
+ 0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x69,0xff,0x00,
+ 0x1d,0x4c,0x00,0x4c,0x1d,0xe3,0x96,0xb3,0x69,0x00,
+ 0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x68,
+ 0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,
+ 0xb3,0x96,0xe3,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,
+ 0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,
+ 0x00,0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,
+ 0x00,0xff,0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,
+ 0xff,0x00,0x00,0x68,0xb3,0x96,0xe2,0x1d,0x4c,0x00,
+
+ 0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,0x80,0x80,0x80,
+ 0x55,0x80,0x54,0xff,0x00,0x2c,0xab,0xd4,0x80,0x80,
+ 0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,0x80,
+ 0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,
+ 0x2c,0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,
+ 0xab,0x2c,0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,
+ 0xd4,0xab,0x2c,0x00,0xff,0x54,0x80,0x55,0xff,0x00,
+ 0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x80,0x55,0xff,
+ 0x80,0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x81,0x54,
+ 0x80,0x80,0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x80,
+
+ 0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,0x80,0x80,
+ 0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,0x80,
+ 0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,
+ 0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,
+ 0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x16,0x00,
+ 0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,
+ 0xeb,0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,
+ 0x80,0xeb,0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,
+ 0x80,0x80,0xeb,0x00,0x15,0x95,0x6b,0xff,0x7f,0xff,
+ 0x80,0x80,0x80,0xeb,0x00,0x14,0x95,0x6b,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f8,0x97,0xc2,
+ 0x7c,0x1d,0xc1,0xdc,0x27,0xe2,0x5f,0x1a,0x70,0xe7,0x0a,0xf0,
+ 0x9f,0x0a,0xf0,0xe7,0x1a,0x67,0x59,0x3f,0x0f,0x70,0xd7,0x0d,
+ 0x70,0xf6,0x4f,0x9d,0x60,0xf2,0x8c,0x8b,0x87,0xf2,0x2c,0xa3,
+ 0x07,0x84,0xca,0xf2,0x6c,0x9b,0x2b,0xc1,0xe1,0x72,0xec,0xaf,
+ 0x2e,0xc2,0xe1,0xb0,0x38,0x1c,0x35,0x0c,0x35,0x0a,0x54,0xa3,
+ 0xff,
+ }}
+ });
+
+ /**
+ * Test Pattern 4
+ *
+ * Solid Blue 150x75
+ *
+ */
+ template<> const bool TestPatternData<4>::m_valid =
+ TestPatternData<4>::initialize<150, 75>(
+
+ generateSolid({0x1d, 0xff, 0x6b}, {150, 75}),
+
+ {{VA_FOURCC_IMC3, {
+ 0xfe,0x39,0xe8,0xa2,0x8a,0xff,0x00,0xbf,0x83,0xf9,0x5c,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x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0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0xff,
+ }},
+ {VA_FOURCC_422V, {
+ 0xfe,0x39,0xe8,0xaf,0xfb,0xf8,0x3f,0x95,0xc2,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
+ 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
+ 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
+ 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
+ 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
+ 0x00,0x28,0xa0,0x0f,0xff,
+ }},
+ {VA_FOURCC_411P, {
+ 0xfe,0x39,0xe8,0xa2,0x8a,0xff,0x00,0xbf,0x83,0xf9,0x5c,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
+ 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00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0x02,0x80,0x0a,0x00,0x28,0x00,
+ 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
+ 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
+ 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
+ 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
+ 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
+ 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
+ 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
+ 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
+ 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
+ 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
+ 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
+ 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
+ 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
+ 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
+ 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
+ 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
+ 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
+ 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
+ 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
+ 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
+ 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
+ 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
+ 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
+ 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
+ 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
+ 0x00,0xa0,0x0f,0xff,
+ }}
+ });
+} // namespace JPEG
diff --git a/test/i965_jpeg_test_data.h b/test/i965_jpeg_test_data.h
index ad5d8b0f0406..5a01e0ebff6c 100644
--- a/test/i965_jpeg_test_data.h
+++ b/test/i965_jpeg_test_data.h
@@ -26,6 +26,7 @@
#define I965_JPEG_TEST_DATA_H
#include<array>
+#include<iostream>
#include<map>
#include<memory>
#include<va/va.h>
@@ -336,7 +337,7 @@ namespace JPEG {
static const bool m_valid;
};
- static const ByteData generateSolid(
+ static inline const ByteData generateSolid(
const std::array<uint8_t, 3>& yuv, const std::array<size_t, 2>& dim)
{
size_t count(dim[0] * dim[1]);
@@ -346,740 +347,7 @@ namespace JPEG {
return data;
}
- /**
- * Test Pattern 1
- *
- * Solid Black 10x10
- *
- */
- template<> const bool TestPatternData<1>::m_valid =
- TestPatternData<1>::initialize<10, 10>(
- generateSolid({0x00, 0x80, 0x80}, {10, 10}),
-
- {{VA_FOURCC_IMC3, {
- 0xff,0x00,0x3f,0xfa,0x28,0xa2,0x80,0x3f,0xff,
- }},
- {VA_FOURCC_422H, {
- 0xff,0x00,0x3f,0xfa,0x28,0x00,0xa2,0x80,0x3f,0xff,
- }},
- {VA_FOURCC_422V, {
- 0xff,0x00,0x3f,0xfa,0x28,0x00,0xa2,0x80,0x3f,0xff,
- }},
- {VA_FOURCC_411P, {
- 0xff,0x00,0x3f,0xfa,0x28,0xa2,0x80,0x0a,0x28,0xa2,0x80,0x3f,
- 0xff,
- }},
- {VA_FOURCC_444P, {
- 0xff,0x00,0x3f,0xfa,0x00,0x28,0x00,0xa0,0x02,0x80,0x3f,0xff,
- }}}
- );
-
-
- /**
- * Test Pattern 2
- *
- * R = red
- * G = green
- * B = blue
- * W = white
- * K = black
- * -------------------
- * R R G G B B W W K K
- * R R G G B B W W K K
- * K K R R G G B B W W
- * K K R R G G B B W W
- * W W K K R R G G B B
- * W W K K R R G G B B
- * B B W W K K R R G G
- * B B W W K K R R G G
- * G G B B W W K K R R
- * G G B B W W K K R R
- * -------------------
- *
- */
-
- template<> const bool TestPatternData<2>::m_valid =
- TestPatternData<2>::initialize<10, 10>({
- // Pixel Y Component
- 0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,
- 0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,
- 0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,
- 0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,0xff,0xff,
- 0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,
- 0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,0x1d,0x1d,
- 0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,
- 0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,0x95,0x95,
- 0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,
- 0x95,0x95,0x1d,0x1d,0xff,0xff,0x00,0x00,0x4c,0x4c,
-
- // Pixel U Component
- 0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,
- 0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,
- 0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,
- 0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,0x80,0x80,
- 0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,
- 0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,0xff,0xff,
- 0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,
- 0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,0x2b,0x2b,
- 0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,
- 0x2b,0x2b,0xff,0xff,0x80,0x80,0x80,0x80,0x54,0x54,
-
- // Pixel V Component
- 0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,
- 0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,
- 0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,
- 0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,0x80,0x80,
- 0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,
- 0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,0x6b,0x6b,
- 0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,
- 0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,0x15,0x15,
- 0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,
- 0x15,0x15,0x6b,0x6b,0x80,0x80,0x80,0x80,0xff,0xff,
- },{
- {VA_FOURCC_IMC3, {
- 0xf8,0x8b,0xc3,0x7e,0x24,0xf1,0xf7,0xec,0x71,0xe3,0xef,0xd9,
- 0x8f,0xc6,0x5e,0x0d,0xfd,0xa7,0x7f,0xe1,0x27,0xf0,0x3f,0x89,
- 0xff,0x00,0xe1,0x74,0xff,0x00,0xc3,0x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x40,0xfd,0xa4,0x7f,0xe4,0xc1,
- 0xff,0x00,0xe0,0xe7,0x2f,0xfb,0xc2,0xef,0xfe,0xae,0x7d,0x0a,
- 0x8f,0x0b,0xbf,0xe5,0x4f,0x3f,0xb2,0x7f,0xfe,0xf7,0xaf,0xff,
- 0x00,0x62,0x8b,0x30,0x0f,0xd9,0xad,0xff,0x00,0x28,0xc1,0xc1,
- 0x9f,0xf7,0x71,0x7f,0xeb,0xc2,0xe3,0xb3,0xf3,0xee,0xbf,0xc5,
- 0x13,0xff,0x00,0x4f,0x83,0xff,
- }},
- });
-
- /**
- * Test Pattern 3
- *
- * R = red
- * G = green
- * B = blue
- * W = white
- * C = cyan
- * M = magenta
- * Y = yellow
- * K = black
- * -------------------
- * K R B Y G C M K K W
- * R K R B Y G C M W K
- * B R K R B Y G C M K
- * Y B R K R B Y G C M
- * G Y B R K R B Y G C
- * C G Y B R K R B Y G
- * M C G Y B R K R B Y
- * K M C G Y B R K R K
- * K W M C G Y B R K R
- * W K K M C G Y B R K
- * -------------------
- *
- */
- template<> const bool TestPatternData<3>::m_valid =
- TestPatternData<3>::initialize<10, 10>({
- 0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x69,0x00,0x00,0xfe,
- 0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x69,0xff,0x00,
- 0x1d,0x4c,0x00,0x4c,0x1d,0xe3,0x96,0xb3,0x69,0x00,
- 0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,0x68,
- 0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,0xb3,
- 0xb3,0x96,0xe3,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,0x96,
- 0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,0xe2,
- 0x00,0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,0x1d,
- 0x00,0xff,0x69,0xb3,0x96,0xe2,0x1d,0x4c,0x00,0x4c,
- 0xff,0x00,0x00,0x68,0xb3,0x96,0xe2,0x1d,0x4c,0x00,
-
- 0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,0x80,0x80,0x80,
- 0x55,0x80,0x54,0xff,0x00,0x2c,0xab,0xd4,0x80,0x80,
- 0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,0x80,
- 0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,0xd4,
- 0x2c,0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,0xab,
- 0xab,0x2c,0x00,0xff,0x55,0x80,0x55,0xff,0x00,0x2c,
- 0xd4,0xab,0x2c,0x00,0xff,0x54,0x80,0x55,0xff,0x00,
- 0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x80,0x55,0xff,
- 0x80,0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x81,0x54,
- 0x80,0x80,0x80,0xd4,0xab,0x2c,0x00,0xff,0x55,0x80,
-
- 0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,0x80,0x80,
- 0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,0x80,
- 0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,0x80,
- 0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,0x00,0xeb,
- 0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x16,0x00,
- 0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,0x15,
- 0xeb,0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,0x95,
- 0x80,0xeb,0x00,0x15,0x95,0x6b,0xff,0x80,0xff,0x6b,
- 0x80,0x80,0xeb,0x00,0x15,0x95,0x6b,0xff,0x7f,0xff,
- 0x80,0x80,0x80,0xeb,0x00,0x14,0x95,0x6b,0xff,0x80,
- },{
- {VA_FOURCC_IMC3, {
- 0xf8,0x6f,0xf7,0x5f,0xb0,0x2c,0x5f,0xf2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75
- *
- */
- template<> const bool TestPatternData<4>::m_valid =
- TestPatternData<4>::initialize<150, 75>(
-
- generateSolid({0x1d, 0xff, 0x6b}, {150, 75}),
-
- {{VA_FOURCC_IMC3, {
- 0xfe,0x39,0xe8,0xa2,0x8a,0xff,0x00,0xbf,0x83,0xf9,0x5c,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0xff,
- }},
- {VA_FOURCC_422H, {
- 0xfe,0x39,0xe8,0xaf,0xfb,0xf8,0x3f,0x95,0xc2,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0xff,
- }},
- {VA_FOURCC_422V, {
- 0xfe,0x39,0xe8,0xaf,0xfb,0xf8,0x3f,0x95,0xc2,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,
- 0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,
- 0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,
- 0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,
- 0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,0x00,0x28,0xa0,0x02,0x8a,
- 0x00,0x28,0xa0,0x0f,0xff,
- }},
- {VA_FOURCC_411P, {
- 0xfe,0x39,0xe8,0xa2,0x8a,0xff,0x00,0xbf,0x83,0xf9,0x5c,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,0xa2,0x8a,0x00,0x28,
- 0xa2,0x8a,0x00,0xff,
- }},
- {VA_FOURCC_444P, {
- 0xfe,0x39,0xeb,0xfe,0xfe,0x0f,0xe5,0x70,0xa0,0x02,0x80,0x0a,
- 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
- 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
- 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
- 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
- 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
- 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
- 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
- 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
- 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
- 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
- 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
- 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
- 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
- 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
- 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
- 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
- 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
- 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
- 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
- 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
- 0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,
- 0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,
- 0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,
- 0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,
- 0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,
- 0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,
- 0x02,0x80,0x0a,0x00,0x28,0x00,0xa0,0x02,0x80,0x0a,0x00,0x28,
- 0x00,0xa0,0x0f,0xff,
- }}
- });
} // namespace JPEG
#endif
Loading...