OSDN Git Service

test: jpeg/enc: add tests for Y800 inputs
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 28 Sep 2016 20:36:11 +0000 (13:36 -0700)
committerSean V Kelley <seanvk@posteo.de>
Mon, 3 Oct 2016 18:31:24 +0000 (11:31 -0700)
Add support for Y800 input data for jpeg encode tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
test/i965_jpeg_encode_test.cpp
test/i965_jpeg_test_data.cpp
test/i965_jpeg_test_data.h

index 789d4f3..86473a9 100644 (file)
@@ -481,7 +481,7 @@ INSTANTIATE_TEST_CASE_P(
         ::testing::ValuesIn(
             std::vector<TestInputCreator::SharedConst>(
                 5, TestInputCreator::SharedConst(new RandomSizeCreator))),
-        ::testing::Values("I420", "NV12", "UYVY", "YUY2")
+        ::testing::Values("I420", "NV12", "UYVY", "YUY2", "Y800")
     )
 );
 
@@ -515,7 +515,7 @@ INSTANTIATE_TEST_CASE_P(
     Common, JPEGEncodeInputTest,
     ::testing::Combine(
         ::testing::ValuesIn(generateCommonInputs()),
-        ::testing::Values("I420", "NV12", "UYVY", "YUY2")
+        ::testing::Values("I420", "NV12", "UYVY", "YUY2", "Y800")
     )
 );
 
@@ -525,7 +525,7 @@ INSTANTIATE_TEST_CASE_P(
         ::testing::Values(
             TestInputCreator::Shared(new FixedSizeCreator({8192, 8192}))
         ),
-        ::testing::Values("I420", "NV12", "UYVY", "YUY2")
+        ::testing::Values("I420", "NV12", "UYVY", "YUY2", "Y800")
     )
 );
 
@@ -562,7 +562,7 @@ INSTANTIATE_TEST_CASE_P(
     Edge, JPEGEncodeInputTest,
     ::testing::Combine(
         ::testing::ValuesIn(generateEdgeCaseInputs()),
-        ::testing::Values("I420", "NV12", "UYVY", "YUY2")
+        ::testing::Values("I420", "NV12", "UYVY", "YUY2", "Y800")
     )
 );
 
@@ -580,7 +580,7 @@ INSTANTIATE_TEST_CASE_P(
     Misc, JPEGEncodeInputTest,
     ::testing::Combine(
         ::testing::ValuesIn(generateMiscInputs()),
-        ::testing::Values("I420", "NV12", "UYVY", "YUY2")
+        ::testing::Values("I420", "NV12", "UYVY", "YUY2", "Y800")
     )
 );
 
index 6ca2d27..956f7cf 100644 (file)
@@ -809,6 +809,14 @@ namespace Encode {
             t->format = VA_RT_FORMAT_YUV422;
             t->fourcc_output = VA_FOURCC_422H;
             break;
+        case VA_FOURCC_Y800:
+            t->planes = 1;
+            t->widths = {w + (w & 1), 0, 0};
+            t->heights = {h + (h & 1), 0, 0};
+            t->format = VA_RT_FORMAT_YUV400;
+            t->fourcc_output = VA_FOURCC_Y800;
+            t->picture.num_components = 1;
+            break;
         default:
             return Shared(); // fourcc is unsupported
         }
@@ -944,6 +952,10 @@ namespace Encode {
                 std::stable_partition(
                     result->begin(1), result->end(2), IsEvenIndex());
             }
+        } else if (fourcc_output == VA_FOURCC_Y800) {
+            if (fourcc == VA_FOURCC_Y800) {
+                return shared_from_this();
+            }
         }
 
         return result;
index f3113f5..938fb06 100644 (file)
@@ -237,6 +237,14 @@ namespace Decode {
                 pd->format = VA_RT_FORMAT_YUV444;
                 pd->pparam.components[0].h_sampling_factor = 1;
                 pd->pparam.components[0].v_sampling_factor = 1;
+                break;
+            case VA_FOURCC_Y800:
+                pd->format = VA_RT_FORMAT_YUV400;
+                pd->pparam.components[0].h_sampling_factor = 1;
+                pd->pparam.components[0].h_sampling_factor = 1;
+                pd->pparam.num_components = 1;
+                pd->sparam.num_components = 1;
+                break;
             default:
                 break;
             }