[Libva] [PATCH intel-driver v2 2/7] test: wrap jpeg decode tests and data in namespace
Zhao Yakui
yakui.zhao at intel.com
Tue Sep 27 01:33:13 UTC 2016
On 09/27/2016 04:11 AM, U. Artie Eoff wrote:
> 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.
Add: Reviewed-by: Zhao Yakui <yakui.zhao at intel.com>
> Signed-off-by: U. Artie Eoff<ullysses.a.eoff at 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
More information about the Libva
mailing list