summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2016-09-26 13:11:43 -0700
committerSean V Kelley <seanvk@posteo.de>2016-09-28 12:55:14 -0700
commit55050bdfb168ec17db081bfa57ddedfd3e8ed222 (patch)
treee0772023cb1c88d0b4b1dd46f496fa0db3e44647 /test
parente9a32664f9086146d6dab15e72f6ed980add5f8a (diff)
test: wrap jpeg decode tests and data in namespace
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 <ullysses.a.eoff@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Diffstat (limited to 'test')
-rw-r--r--test/i965_jpeg_decode_test.cpp8
-rw-r--r--test/i965_jpeg_test_data.cpp4
-rw-r--r--test/i965_jpeg_test_data.h81
3 files changed, 33 insertions, 60 deletions
diff --git a/test/i965_jpeg_decode_test.cpp b/test/i965_jpeg_decode_test.cpp
index 24a30e6..b022c2e 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 02d092c..7f327a5 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 5a01e0e..d52f582 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