This MR also includes some test code cleanup based on comments [here.](https://gitlab.winehq.org/wine/wine/-/merge_requests/9206#note_120681)
From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx10_43/tests/d3dx10.c | 81 +++++++++-------------------------- 1 file changed, 20 insertions(+), 61 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index cb03b3c20a0..04f3aad7ff5 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -1702,6 +1702,20 @@ static inline void check_texture3d_desc_(uint32_t line, const D3D10_TEXTURE3D_DE expected->MiscFlags, desc->MiscFlags); }
+#define check_texture3d_desc_values(desc, width, height, depth, mip_levels, format, usage, bind_flags, \ + cpu_access_flags, misc_flags, wine_todo) \ + check_texture3d_desc_values_(__LINE__, desc, width, height, depth, mip_levels, format, usage, bind_flags, \ + cpu_access_flags, misc_flags, wine_todo) +static inline void check_texture3d_desc_values_(uint32_t line, const D3D10_TEXTURE3D_DESC *desc, uint32_t width, + uint32_t height, uint32_t depth, uint32_t mip_levels, DXGI_FORMAT format, D3D10_USAGE usage, + uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, BOOL wine_todo) +{ + const D3D10_TEXTURE3D_DESC expected_desc = { width, height, depth, mip_levels, format, usage, bind_flags, + cpu_access_flags, misc_flags }; + + check_texture3d_desc_(line, desc, &expected_desc, wine_todo); +} + /* * Taken from the d3d10core tests. If there's a missing resource type or * texture format checking function, check to see if it exists there first. @@ -1961,40 +1975,9 @@ static void check_resource_info(ID3D10Resource *resource, const struct test_imag hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&texture_2d); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ID3D10Texture2D_GetDesc(texture_2d, &desc_2d); - ok_(__FILE__, line)(desc_2d.Width == expected_width, - "Got unexpected Width %u, expected %u.\n", - desc_2d.Width, expected_width); - ok_(__FILE__, line)(desc_2d.Height == expected_height, - "Got unexpected Height %u, expected %u.\n", - desc_2d.Height, expected_height); - ok_(__FILE__, line)(desc_2d.MipLevels == expected_mip_levels, - "Got unexpected MipLevels %u, expected %u.\n", - desc_2d.MipLevels, expected_mip_levels); - ok_(__FILE__, line)(desc_2d.ArraySize == image->expected_info.ArraySize, - "Got unexpected ArraySize %u, expected %u.\n", - desc_2d.ArraySize, image->expected_info.ArraySize); - ok_(__FILE__, line)(desc_2d.Format == image->expected_info.Format, - "Got unexpected Format %u, expected %u.\n", - desc_2d.Format, image->expected_info.Format); - ok_(__FILE__, line)(desc_2d.SampleDesc.Count == 1, - "Got unexpected SampleDesc.Count %u, expected %u\n", - desc_2d.SampleDesc.Count, 1); - ok_(__FILE__, line)(desc_2d.SampleDesc.Quality == 0, - "Got unexpected SampleDesc.Quality %u, expected %u\n", - desc_2d.SampleDesc.Quality, 0); - ok_(__FILE__, line)(desc_2d.Usage == D3D10_USAGE_DEFAULT, - "Got unexpected Usage %u, expected %u\n", - desc_2d.Usage, D3D10_USAGE_DEFAULT); - ok_(__FILE__, line)(desc_2d.BindFlags == D3D10_BIND_SHADER_RESOURCE, - "Got unexpected BindFlags %#x, expected %#x\n", - desc_2d.BindFlags, D3D10_BIND_SHADER_RESOURCE); - ok_(__FILE__, line)(desc_2d.CPUAccessFlags == 0, - "Got unexpected CPUAccessFlags %#x, expected %#x\n", - desc_2d.CPUAccessFlags, 0); - ok_(__FILE__, line)(desc_2d.MiscFlags == image->expected_info.MiscFlags, - "Got unexpected MiscFlags %#x, expected %#x.\n", - desc_2d.MiscFlags, image->expected_info.MiscFlags); - + check_texture2d_desc_values_(line, &desc_2d, expected_width, expected_height, expected_mip_levels, + image->expected_info.ArraySize, image->expected_info.Format, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, image->expected_info.MiscFlags, FALSE); ID3D10Texture2D_Release(texture_2d); break;
@@ -2002,33 +1985,9 @@ static void check_resource_info(ID3D10Resource *resource, const struct test_imag hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture3D, (void **)&texture_3d); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ID3D10Texture3D_GetDesc(texture_3d, &desc_3d); - ok_(__FILE__, line)(desc_3d.Width == expected_width, - "Got unexpected Width %u, expected %u.\n", - desc_3d.Width, expected_width); - ok_(__FILE__, line)(desc_3d.Height == expected_height, - "Got unexpected Height %u, expected %u.\n", - desc_3d.Height, expected_height); - ok_(__FILE__, line)(desc_3d.Depth == image->expected_info.Depth, - "Got unexpected Depth %u, expected %u.\n", - desc_3d.Depth, image->expected_info.Depth); - ok_(__FILE__, line)(desc_3d.MipLevels == expected_mip_levels, - "Got unexpected MipLevels %u, expected %u.\n", - desc_3d.MipLevels, expected_mip_levels); - ok_(__FILE__, line)(desc_3d.Format == image->expected_info.Format, - "Got unexpected Format %u, expected %u.\n", - desc_3d.Format, image->expected_info.Format); - ok_(__FILE__, line)(desc_3d.Usage == D3D10_USAGE_DEFAULT, - "Got unexpected Usage %u, expected %u\n", - desc_3d.Usage, D3D10_USAGE_DEFAULT); - ok_(__FILE__, line)(desc_3d.BindFlags == D3D10_BIND_SHADER_RESOURCE, - "Got unexpected BindFlags %#x, expected %#x\n", - desc_3d.BindFlags, D3D10_BIND_SHADER_RESOURCE); - ok_(__FILE__, line)(desc_3d.CPUAccessFlags == 0, - "Got unexpected CPUAccessFlags %#x, expected %#x\n", - desc_3d.CPUAccessFlags, 0); - ok_(__FILE__, line)(desc_3d.MiscFlags == image->expected_info.MiscFlags, - "Got unexpected MiscFlags %#x, expected %#x.\n", - desc_3d.MiscFlags, image->expected_info.MiscFlags); + check_texture3d_desc_values_(line, &desc_3d, expected_width, expected_height, image->expected_info.Depth, + expected_mip_levels, image->expected_info.Format, D3D10_USAGE_DEFAULT, D3D10_BIND_SHADER_RESOURCE, + 0, image->expected_info.MiscFlags, FALSE); ID3D10Texture3D_Release(texture_3d); break;
From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx11_43/tests/d3dx11.c | 81 +++++++++-------------------------- 1 file changed, 20 insertions(+), 61 deletions(-)
diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 2c071b54a6c..671a7b7002c 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -1651,6 +1651,20 @@ static inline void check_texture3d_desc_(uint32_t line, const D3D11_TEXTURE3D_DE expected->MiscFlags, desc->MiscFlags); }
+#define check_texture3d_desc_values(desc, width, height, depth, mip_levels, format, usage, bind_flags, \ + cpu_access_flags, misc_flags, wine_todo) \ + check_texture3d_desc_values_(__LINE__, desc, width, height, depth, mip_levels, format, usage, bind_flags, \ + cpu_access_flags, misc_flags, wine_todo) +static inline void check_texture3d_desc_values_(uint32_t line, const D3D11_TEXTURE3D_DESC *desc, uint32_t width, + uint32_t height, uint32_t depth, uint32_t mip_levels, DXGI_FORMAT format, D3D11_USAGE usage, + uint32_t bind_flags, uint32_t cpu_access_flags, uint32_t misc_flags, BOOL wine_todo) +{ + const D3D11_TEXTURE3D_DESC expected_desc = { width, height, depth, mip_levels, format, usage, bind_flags, + cpu_access_flags, misc_flags }; + + check_texture3d_desc_(line, desc, &expected_desc, wine_todo); +} + /* * Taken from the d3d11 tests. If there's a missing resource type or * texture format checking function, check to see if it exists there first. @@ -1899,40 +1913,9 @@ static void check_resource_info(ID3D11Resource *resource, const struct test_imag hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&texture_2d); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ID3D11Texture2D_GetDesc(texture_2d, &desc_2d); - ok_(__FILE__, line)(desc_2d.Width == expected_width, - "Got unexpected Width %u, expected %u.\n", - desc_2d.Width, expected_width); - ok_(__FILE__, line)(desc_2d.Height == expected_height, - "Got unexpected Height %u, expected %u.\n", - desc_2d.Height, expected_height); - ok_(__FILE__, line)(desc_2d.MipLevels == expected_mip_levels, - "Got unexpected MipLevels %u, expected %u.\n", - desc_2d.MipLevels, expected_mip_levels); - ok_(__FILE__, line)(desc_2d.ArraySize == image->expected_info.ArraySize, - "Got unexpected ArraySize %u, expected %u.\n", - desc_2d.ArraySize, image->expected_info.ArraySize); - ok_(__FILE__, line)(desc_2d.Format == image->expected_info.Format, - "Got unexpected Format %u, expected %u.\n", - desc_2d.Format, image->expected_info.Format); - ok_(__FILE__, line)(desc_2d.SampleDesc.Count == 1, - "Got unexpected SampleDesc.Count %u, expected %u\n", - desc_2d.SampleDesc.Count, 1); - ok_(__FILE__, line)(desc_2d.SampleDesc.Quality == 0, - "Got unexpected SampleDesc.Quality %u, expected %u\n", - desc_2d.SampleDesc.Quality, 0); - ok_(__FILE__, line)(desc_2d.Usage == D3D11_USAGE_DEFAULT, - "Got unexpected Usage %u, expected %u\n", - desc_2d.Usage, D3D11_USAGE_DEFAULT); - ok_(__FILE__, line)(desc_2d.BindFlags == D3D11_BIND_SHADER_RESOURCE, - "Got unexpected BindFlags %#x, expected %#x\n", - desc_2d.BindFlags, D3D11_BIND_SHADER_RESOURCE); - ok_(__FILE__, line)(desc_2d.CPUAccessFlags == 0, - "Got unexpected CPUAccessFlags %#x, expected %#x\n", - desc_2d.CPUAccessFlags, 0); - ok_(__FILE__, line)(desc_2d.MiscFlags == image->expected_info.MiscFlags, - "Got unexpected MiscFlags %#x, expected %#x.\n", - desc_2d.MiscFlags, image->expected_info.MiscFlags); - + check_texture2d_desc_values_(line, &desc_2d, expected_width, expected_height, expected_mip_levels, + image->expected_info.ArraySize, image->expected_info.Format, 1, 0, D3D10_USAGE_DEFAULT, + D3D10_BIND_SHADER_RESOURCE, 0, image->expected_info.MiscFlags, FALSE); ID3D11Texture2D_Release(texture_2d); break;
@@ -1940,33 +1923,9 @@ static void check_resource_info(ID3D11Resource *resource, const struct test_imag hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture3D, (void **)&texture_3d); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ID3D11Texture3D_GetDesc(texture_3d, &desc_3d); - ok_(__FILE__, line)(desc_3d.Width == expected_width, - "Got unexpected Width %u, expected %u.\n", - desc_3d.Width, expected_width); - ok_(__FILE__, line)(desc_3d.Height == expected_height, - "Got unexpected Height %u, expected %u.\n", - desc_3d.Height, expected_height); - ok_(__FILE__, line)(desc_3d.Depth == image->expected_info.Depth, - "Got unexpected Depth %u, expected %u.\n", - desc_3d.Depth, image->expected_info.Depth); - ok_(__FILE__, line)(desc_3d.MipLevels == expected_mip_levels, - "Got unexpected MipLevels %u, expected %u.\n", - desc_3d.MipLevels, expected_mip_levels); - ok_(__FILE__, line)(desc_3d.Format == image->expected_info.Format, - "Got unexpected Format %u, expected %u.\n", - desc_3d.Format, image->expected_info.Format); - ok_(__FILE__, line)(desc_3d.Usage == D3D11_USAGE_DEFAULT, - "Got unexpected Usage %u, expected %u\n", - desc_3d.Usage, D3D11_USAGE_DEFAULT); - ok_(__FILE__, line)(desc_3d.BindFlags == D3D11_BIND_SHADER_RESOURCE, - "Got unexpected BindFlags %#x, expected %#x\n", - desc_3d.BindFlags, D3D11_BIND_SHADER_RESOURCE); - ok_(__FILE__, line)(desc_3d.CPUAccessFlags == 0, - "Got unexpected CPUAccessFlags %#x, expected %#x\n", - desc_3d.CPUAccessFlags, 0); - ok_(__FILE__, line)(desc_3d.MiscFlags == image->expected_info.MiscFlags, - "Got unexpected MiscFlags %#x, expected %#x.\n", - desc_3d.MiscFlags, image->expected_info.MiscFlags); + check_texture3d_desc_values_(line, &desc_3d, expected_width, expected_height, image->expected_info.Depth, + expected_mip_levels, image->expected_info.Format, D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, + 0, image->expected_info.MiscFlags, FALSE); ID3D11Texture3D_Release(texture_3d); break;
From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx9_36/tests/d3dx9_test_images.h | 920 ++++++++++++++++++++++++ dlls/d3dx9_36/tests/surface.c | 270 ++++--- dlls/d3dx9_36/tests/texture.c | 137 ++++ dlls/d3dx9_36/tests/volume.c | 134 +++- 4 files changed, 1351 insertions(+), 110 deletions(-)
diff --git a/dlls/d3dx9_36/tests/d3dx9_test_images.h b/dlls/d3dx9_36/tests/d3dx9_test_images.h index e9ee1623134..49fa4135ca6 100644 --- a/dlls/d3dx9_36/tests/d3dx9_test_images.h +++ b/dlls/d3dx9_36/tests/d3dx9_test_images.h @@ -20,6 +20,7 @@ */
#include <stdint.h> +#include <assert.h> #define COBJMACROS #include "d3dx9tex.h"
@@ -868,6 +869,771 @@ static const uint8_t dds_24bit_8_8[] = 0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00 };
+static const uint8_t a8r8g8b8_16_16[] = +{ + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x8d,0x8e,0x8e,0x8e,0x8e,0x8f,0x8f,0x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f8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_16_16_point_filter_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x08,0x08,0x08,0x08,0x0a,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0c,0x0e,0x0e,0x0e,0x0e, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a,0x2c,0x2c,0x2c,0x2c,0x2e,0x2e,0x2e,0x2e, + 0x40,0x40,0x40,0x40,0x42,0x42,0x42,0x42,0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46, + 0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a,0x4c,0x4c,0x4c,0x4c,0x4e,0x4e,0x4e,0x4e, + 0x60,0x60,0x60,0x60,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x68,0x68,0x68,0x68,0x6a,0x6a,0x6a,0x6a,0x6c,0x6c,0x6c,0x6c,0x6e,0x6e,0x6e,0x6e, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x88,0x88,0x88,0x88,0x8a,0x8a,0x8a,0x8a,0x8c,0x8c,0x8c,0x8c,0x8e,0x8e,0x8e,0x8e, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xa8,0xa8,0xa8,0xa8,0xaa,0xaa,0xaa,0xaa,0xac,0xac,0xac,0xac,0xae,0xae,0xae,0xae, + 0xc0,0xc0,0xc0,0xc0,0xc2,0xc2,0xc2,0xc2,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, + 0xc8,0xc8,0xc8,0xc8,0xca,0xca,0xca,0xca,0xcc,0xcc,0xcc,0xcc,0xce,0xce,0xce,0xce, + 0xe0,0xe0,0xe0,0xe0,0xe2,0xe2,0xe2,0xe2,0xe4,0xe4,0xe4,0xe4,0xe6,0xe6,0xe6,0xe6, + 0xe8,0xe8,0xe8,0xe8,0xea,0xea,0xea,0xea,0xec,0xec,0xec,0xec,0xee,0xee,0xee,0xee, +}; + +static const uint8_t a8r8g8b8_16_16_linear_filter_8_8[] = +{ + 0x09,0x09,0x09,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x0f,0x0f,0x0f,0x0f, + 0x11,0x11,0x11,0x11,0x13,0x13,0x13,0x13,0x15,0x15,0x15,0x15,0x17,0x17,0x17,0x17, + 0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x2f,0x2f,0x2f,0x2f, + 0x31,0x31,0x31,0x31,0x33,0x33,0x33,0x33,0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37, + 0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57, + 0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x77,0x77,0x77,0x77, + 0x89,0x89,0x89,0x89,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x97,0x97,0x97,0x97, + 0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xaf,0xaf,0xaf,0xaf, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7, + 0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd3,0xd3,0xd3,0xd3,0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7, + 0xe9,0xe9,0xe9,0xe9,0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xef,0xef,0xef,0xef, + 0xf1,0xf1,0xf1,0xf1,0xf3,0xf3,0xf3,0xf3,0xf5,0xf5,0xf5,0xf5,0xf7,0xf7,0xf7,0xf7, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_8_8[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1d,0x1d,0x1d,0x1d,0x1f,0x1f,0x1f,0x1f, + 0x21,0x21,0x21,0x21,0x23,0x23,0x23,0x23,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26, + 0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x2f,0x2f,0x2f,0x2f, + 0x31,0x31,0x31,0x31,0x33,0x33,0x33,0x33,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36, + 0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56, + 0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76, + 0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96, + 0xaa,0xaa,0xaa,0xaa,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xaf,0xaf,0xaf,0xaf, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb6,0xb6,0xb6,0xb6, + 0xca,0xca,0xca,0xca,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd3,0xd3,0xd3,0xd3,0xd5,0xd5,0xd5,0xd5,0xd6,0xd6,0xd6,0xd6, + 0xda,0xda,0xda,0xda,0xdb,0xdb,0xdb,0xdb,0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf, + 0xe1,0xe1,0xe1,0xe1,0xe3,0xe3,0xe3,0xe3,0xe5,0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_8_8_32bit[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1d,0x1d,0x1d,0x1d,0x1f,0x1f,0x1f,0x1f, + 0x21,0x21,0x21,0x21,0x23,0x23,0x23,0x23,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26, + 0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2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0xe6, +}; + +static const uint8_t a8r8g8b8_16_16_point_filter_7_7[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x09,0x09,0x09,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x29,0x29,0x29,0x29, + 0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x40,0x40,0x40,0x40,0x42,0x42,0x42,0x42, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x4d,0x4d,0x4d,0x4d,0x60,0x60,0x60,0x60,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64, + 0x66,0x66,0x66,0x66,0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0xb0,0xb0,0xb0,0xb0, + 0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6,0xb9,0xb9,0xb9,0xb9, + 0xbb,0xbb,0xbb,0xbb,0xbd,0xbd,0xbd,0xbd,0xd0,0xd0,0xd0,0xd0,0xd2,0xd2,0xd2,0xd2, + 0xd4,0xd4,0xd4,0xd4,0xd6,0xd6,0xd6,0xd6,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd, +}; + +static const uint8_t a8r8g8b8_16_16_linear_filter_7_7[] = +{ + 0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12, + 0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16,0x19,0x19,0x19,0x19,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x62,0x62,0x62,0x62,0x79,0x79,0x79,0x79,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x9d,0x9d,0x9d,0x9d,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xc2,0xc2,0xc2,0xc2, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xd0,0xd0,0xd0,0xd0,0xe6,0xe6,0xe6,0xe6,0xe9,0xe9,0xe9,0xe9, + 0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xf0,0xf0,0xf0,0xf0,0xf2,0xf2,0xf2,0xf2, + 0xf4,0xf4,0xf4,0xf4, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_7_7[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1e,0x1e,0x1e,0x1e,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3c,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x61,0x61,0x61,0x61,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85, + 0x9e,0x9e,0x9e,0x9e,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xc3,0xc3,0xc3,0xc3, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf,0xe1,0xe1,0xe1,0xe1,0xe4,0xe4,0xe4,0xe4, + 0xe5,0xe5,0xe5,0xe5, +}; + +static const uint8_t a8r8g8b8_6_6[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_6_6_point_filter_3_3[] = +{ + 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50, + 0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8, + 0xd0,0xd0,0xd0,0xd0, +}; +static const uint8_t a8r8g8b8_6_6_linear_filter_3_3[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a, + 0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2, + 0xe9,0xe9,0xe9,0xe9, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_3_3[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_dither_filter_3_3[] = +{ + 0x2e,0x2e,0x2e,0x2e,0x41,0x41,0x41,0x41,0x55,0x55,0x55,0x55,0x6e,0x6e,0x6e,0x6e, + 0x82,0x82,0x82,0x82,0x95,0x95,0x95,0x95,0xb0,0xb0,0xb0,0xb0,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_point_filter_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x24,0x24,0x24,0x24,0x30,0x30,0x30,0x30, + 0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58, + 0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xc4,0xc4,0xc4,0xc4,0xd0,0xd0,0xd0,0xd0, +}; + +static const uint8_t a8r8g8b8_6_6_linear_filter_4_4[] = +{ + 0x0d,0x0d,0x0d,0x0d,0x1f,0x1f,0x1f,0x1f,0x31,0x31,0x31,0x31,0x43,0x43,0x43,0x43, + 0x49,0x49,0x49,0x49,0x5b,0x5b,0x5b,0x5b,0x6d,0x6d,0x6d,0x6d,0x7f,0x7f,0x7f,0x7f, + 0x85,0x85,0x85,0x85,0x97,0x97,0x97,0x97,0xa9,0xa9,0xa9,0xa9,0xbb,0xbb,0xbb,0xbb, + 0xc1,0xc1,0xc1,0xc1,0xd3,0xd3,0xd3,0xd3,0xe5,0xe5,0xe5,0xe5,0xf4,0xf4,0xf4,0xf4, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_4_4[] = +{ + 0x27,0x27,0x27,0x27,0x33,0x33,0x33,0x33,0x45,0x45,0x45,0x45,0x51,0x51,0x51,0x51, + 0x4f,0x4f,0x4f,0x4f,0x5b,0x5b,0x5b,0x5b,0x6d,0x6d,0x6d,0x6d,0x79,0x79,0x79,0x79, + 0x8b,0x8b,0x8b,0x8b,0x97,0x97,0x97,0x97,0xa9,0xa9,0xa9,0xa9,0xb5,0xb5,0xb5,0xb5, + 0xb3,0xb3,0xb3,0xb3,0xbf,0xbf,0xbf,0xbf,0xd1,0xd1,0xd1,0xd1,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_point_filter_12_12[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70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d0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_linear_filter_12_12[] = +{ + 0x50,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60, + 0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x0b,0x0b,0x0b,0x0b, + 0x10,0x10,0x10,0x10,0x15,0x15,0x15,0x15,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x15,0x15,0x15,0x15,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xb0,0xb0,0xb0,0xb0,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xb0,0xb0,0xb0,0xb0,0xb5,0xb5,0xb5,0xb5, +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,0x6d,0x60,0x60,0x60,0x60, + 0x1b,0x1b,0x1b,0x1b,0x0d,0x0d,0x0d,0x0d,0x10,0x10,0x10,0x10,0x15,0x15,0x15,0x15, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b, + 0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35,0x38,0x38,0x38,0x38,0x2b,0x2b,0x2b,0x2b, + 0x25,0x25,0x25,0x25,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x43,0x43,0x43,0x43,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x2d,0x2d,0x2d,0x2d,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x58,0x58,0x58,0x58,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x43,0x43,0x43,0x43,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x58,0x58,0x58,0x58,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 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8,0xbb,0xbb,0xbb,0xbb,0xc0,0xc0,0xc0,0xc0, + 0xc5,0xc5,0xc5,0xc5,0xcb,0xcb,0xcb,0xcb,0xd0,0xd0,0xd0,0xd0,0xd5,0xd5,0xd5,0xd5, + 0xdb,0xdb,0xdb,0xdb,0xe0,0xe0,0xe0,0xe0,0xe3,0xe3,0xe3,0xe3,0xd5,0xd5,0xd5,0xd5, + 0x90,0x90,0x90,0x90,0x83,0x83,0x83,0x83,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xa0,0xa0,0xa0,0xa0, +}; + +static const uint8_t a8r8g8b8_4_4_point_filter_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_linear_filter_8_8[] = +{ + 0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x44,0x44,0x44,0x44, + 0x4c,0x4c,0x4c,0x4c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54, + 0x1c,0x1c,0x1c,0x1c,0x14,0x14,0x14,0x14,0x1c,0x1c,0x1c,0x1c,0x24,0x24,0x24,0x24, + 0x2c,0x2c,0x2c,0x2c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34, + 0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x44,0x44,0x44,0x44, + 0x4c,0x4c,0x4c,0x4c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54, + 0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x64,0x64,0x64,0x64, + 0x6c,0x6c,0x6c,0x6c,0x74,0x74,0x74,0x74,0x7c,0x7c,0x7c,0x7c,0x74,0x74,0x74,0x74, + 0x7c,0x7c,0x7c,0x7c,0x74,0x74,0x74,0x74,0x7c,0x7c,0x7c,0x7c,0x84,0x84,0x84,0x84, + 0x8c,0x8c,0x8c,0x8c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94, + 0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0xa4,0xa4,0xa4,0xa4, + 0xac,0xac,0xac,0xac,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4, + 0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xc4,0xc4,0xc4,0xc4, + 0xcc,0xcc,0xcc,0xcc,0xd4,0xd4,0xd4,0xd4,0xdc,0xdc,0xdc,0xdc,0xd4,0xd4,0xd4,0xd4, + 0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0xa4,0xa4,0xa4,0xa4, + 0xac,0xac,0xac,0xac,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4, +}; + +static const uint8_t a8r8g8b8_8_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x8d,0x8e,0x8e,0x8e,0x8e,0x8f,0x8f,0x8f,0x8f, + 0x90,0x90,0x90,0x90,0x91,0x91,0x91,0x91,0x92,0x92,0x92,0x92,0x93,0x93,0x93,0x93, + 0x94,0x94,0x94,0x94,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96,0x97,0x97,0x97,0x97, + 0x98,0x98,0x98,0x98,0x99,0x99,0x99,0x99,0x9a,0x9a,0x9a,0x9a,0x9b,0x9b,0x9b,0x9b, + 0x9c,0x9c,0x9c,0x9c,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e,0x9f,0x9f,0x9f,0x9f, + 0xa0,0xa0,0xa0,0xa0,0xa1,0xa1,0xa1,0xa1,0xa2,0xa2,0xa2,0xa2,0xa3,0xa3,0xa3,0xa3, + 0xa4,0xa4,0xa4,0xa4,0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa7,0xa7,0xa7,0xa7, + 0xa8,0xa8,0xa8,0xa8,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xab,0xab,0xab,0xab, + 0xac,0xac,0xac,0xac,0xad,0xad,0xad,0xad,0xae,0xae,0xae,0xae,0xaf,0xaf,0xaf,0xaf, + 0xb0,0xb0,0xb0,0xb0,0xb1,0xb1,0xb1,0xb1,0xb2,0x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0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6,0xe7,0xe7,0xe7,0xe7, + 0xe8,0xe8,0xe8,0xe8,0xe9,0xe9,0xe9,0xe9,0xea,0xea,0xea,0xea,0xeb,0xeb,0xeb,0xeb, + 0xec,0xec,0xec,0xec,0xed,0xed,0xed,0xed,0xee,0xee,0xee,0xee,0xef,0xef,0xef,0xef, + 0xf0,0xf0,0xf0,0xf0,0xf1,0xf1,0xf1,0xf1,0xf2,0xf2,0xf2,0xf2,0xf3,0xf3,0xf3,0xf3, + 0xf4,0xf4,0xf4,0xf4,0xf5,0xf5,0xf5,0xf5,0xf6,0xf6,0xf6,0xf6,0xf7,0xf7,0xf7,0xf7, + 0xf8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x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,0xf6,0xf6,0xf7,0xf7,0xf7,0xf7, + 0xf8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_8_8_8_point_filter_4_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xb0,0xb0,0xb0,0xb0,0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6, + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xb0,0xb0,0xb0,0xb0,0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6, +}; + +static const uint8_t a8r8g8b8_8_8_8_linear_filter_4_4_4[] = +{ + 0x25,0x25,0x25,0x25,0x27,0x27,0x27,0x27,0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x45,0x45,0x45,0x45,0x47,0x47,0x47,0x47,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57,0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b, + 0xa5,0xa5,0xa5,0xa5,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0x25,0x25,0x25,0x25,0x27,0x27,0x27,0x27,0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x45,0x45,0x45,0x45,0x47,0x47,0x47,0x47,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57,0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b, + 0xa5,0xa5,0xa5,0xa5,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_8_8_8_triangle_filter_4_4_4[] = +{ + 0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e, + 0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xba,0xba,0xba,0xba, + 0xc1,0xc1,0xc1,0xc1,0xc3,0xc3,0xc3,0xc3,0xc5,0xc5,0xc5,0xc5,0xc6,0xc6,0xc6,0xc6, + 0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a, + 0x61,0x61,0x61,0x61,0x63,0x63,0x63,0x63,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e, + 0xa5,0xa5,0xa5,0xa5,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xba,0xba,0xba,0xba, + 0xc1,0xc1,0xc1,0xc1,0xc3,0xc3,0xc3,0xc3,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, +}; + +static const uint8_t a8r8g8b8_8_8_8_triangle_filter_4_4_4_32bit[] = +{ + 0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x58,0x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+static const uint8_t a8r8g8b8_8_8_8_box_filter_4_4_4_32bit[] = +{ + 0x25,0x25,0x25,0x25,0x27,0x27,0x27,0x27,0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x45,0x45,0x45,0x45,0x47,0x47,0x47,0x47,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57,0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b, + 0xa4,0xa4,0xa4,0xa4,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb4,0xb4,0xb4,0xb4,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0x25,0x25,0x25,0x25,0x27,0x27,0x27,0x27,0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x45,0x45,0x45,0x45,0x47,0x47,0x47,0x47,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57,0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b, + 0xa4,0xa4,0xa4,0xa4,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb4,0xb4,0xb4,0xb4,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_6_6_6[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_6_6_6_point_filter_3_3_3[] = +{ + 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50, + 0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8, + 0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30, + 0x50,0x50,0x50,0x50,0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0, + 0xb8,0xb8,0xb8,0xb8,0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18, + 0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50,0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80, + 0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8,0xd0,0xd0,0xd0,0xd0, +}; + +static const uint8_t a8r8g8b8_6_6_6_linear_filter_3_3_3[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a, + 0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2, + 0xe9,0xe9,0xe9,0xe9,0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a, + 0x6a,0x6a,0x6a,0x6a,0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba, + 0xd2,0xd2,0xd2,0xd2,0xe9,0xe9,0xe9,0xe9,0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32, + 0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a,0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a, + 0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2,0xe9,0xe9,0xe9,0xe9, +}; + +static const uint8_t a8r8g8b8_6_6_6_triangle_filter_3_3_3[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54, + 0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf, + 0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41, + 0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96, + 0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_6_triangle_dither_filter_3_3_3[] = +{ + 0x2e,0x2e,0x2e,0x2e,0x41,0x41,0x41,0x41,0x55,0x55,0x55,0x55,0x6e,0x6e,0x6e,0x6e, + 0x82,0x82,0x82,0x82,0x95,0x95,0x95,0x95,0xb0,0xb0,0xb0,0xb0,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54, + 0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf, + 0xc3,0xc3,0xc3,0xc3,0xd5,0xd5,0xd5,0xd5,0x2e,0x2e,0x2e,0x2e,0x41,0x41,0x41,0x41, + 0x55,0x55,0x55,0x55,0x6e,0x6e,0x6e,0x6e,0x82,0x82,0x82,0x82,0x95,0x95,0x95,0x95, + 0xb0,0xb0,0xb0,0xb0,0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6, +}; + static inline const char *debug_d3dformat(D3DFORMAT format_id) { switch (format_id) @@ -944,6 +1710,50 @@ static inline const char *debug_d3dformat(D3DFORMAT format_id) } }
+static inline uint32_t get_bpp_for_d3dformat(D3DFORMAT format) +{ + switch (format) + { + case D3DFMT_A32B32G32R32F: + return 16; + + case D3DFMT_A16B16G16R16: + case D3DFMT_Q16W16V16U16: + return 8; + + case D3DFMT_Q8W8V8U8: + case D3DFMT_A8B8G8R8: + case D3DFMT_A8R8G8B8: + case D3DFMT_V16U16: + case D3DFMT_G16R16: + case D3DFMT_R32F: + return 4; + + case D3DFMT_R8G8B8: + return 3; + + case D3DFMT_A4R4G4B4: + case D3DFMT_X1R5G5B5: + case D3DFMT_A1R5G5B5: + case D3DFMT_R5G6B5: + case D3DFMT_V8U8: + case D3DFMT_A8P8: + return 2; + + case D3DFMT_R3G3B2: + case D3DFMT_DXT5: + case D3DFMT_DXT4: + case D3DFMT_A4L4: + case D3DFMT_L8: + case D3DFMT_P8: + return 1; + + default: + assert(0 && "Need to add format to get_bpp_for_d3dformat()."); + return 0; + } +} + #define check_image_info(info, width, height, depth, mip_levels, format, resource_type, image_file_format, wine_todo) \ check_image_info_(__FILE__, __LINE__, info, width, height, depth, mip_levels, format, resource_type, \ image_file_format, wine_todo) @@ -1145,6 +1955,16 @@ exit: } }
+static inline void set_box(D3DBOX *box, UINT left, UINT top, UINT right, UINT bottom, UINT front, UINT back) +{ + box->Left = left; + box->Top = top; + box->Right = right; + box->Bottom = bottom; + box->Front = front; + box->Back = back; +} + static inline BOOL compare_uint(uint32_t x, uint32_t y, uint32_t max_diff) { uint32_t diff = x > y ? x - y : y - x; @@ -1179,3 +1999,103 @@ static inline void _check_volume_readback_pixel_4bpp(const char *file, uint32_t uint32_t color = get_volume_readback_color(rb, x, y, z); todo_wine_if(todo) ok_(file, line)(color == expected_color, "Got color 0x%08x, expected 0x%08x.\n", color, expected_color); } + +static inline BOOL check_readback_pixel_4bpp_rgba(const void *got, const void *expected, uint32_t max_diff) +{ + const uint32_t *a = got; + const uint32_t *b = expected; + + return compare_color_4bpp(*a, *b, max_diff); +} + +typedef BOOL (*check_readback_pixel_func)(const void *, const void *, uint32_t); +static inline check_readback_pixel_func get_readback_pixel_func_for_d3dformat(D3DFORMAT format) +{ + switch (format) + { + case D3DFMT_A8B8G8R8: + case D3DFMT_A8R8G8B8: + return check_readback_pixel_4bpp_rgba; + + default: + assert(0 && "Need to add format to get_readback_pixel_func_for_d3dformat()."); + return 0; + } +} + +#define check_test_readback(got, got_row_pitch, got_slice_pitch, expected, width, height, depth, format, max_diff) \ + _check_test_readback(__FILE__, __LINE__, got, got_row_pitch, got_slice_pitch, expected, width, height, depth, \ + format, max_diff) +static inline void _check_test_readback(const char *file, uint32_t line, const void *got, int32_t got_row_pitch, + int32_t got_slice_pitch, const void *expected, uint32_t width, uint32_t height, uint32_t depth, + D3DFORMAT format, uint32_t max_diff) +{ + check_readback_pixel_func check_readback_pixel = get_readback_pixel_func_for_d3dformat(format); + unsigned int x, y, z, mismatch_count, expected_row_pitch, expected_slice_pitch; + const unsigned int fmt_bpp = get_bpp_for_d3dformat(format); + + expected_row_pitch = fmt_bpp * width; + expected_slice_pitch = expected_row_pitch * height; + mismatch_count = 0; + for (z = 0; z < depth; ++z) + { + const uint8_t *expected_slice = ((const uint8_t *)expected) + z * expected_slice_pitch; + const uint8_t *got_slice = ((const uint8_t *)got) + z * got_slice_pitch; + + for (y = 0; y < height; ++y) + { + const uint8_t *expected_row = expected_slice + y * expected_row_pitch; + const uint8_t *got_row = got_slice + y * got_row_pitch; + + for (x = 0; x < width; ++x) + { + const uint8_t *expected_ptr = expected_row + x * fmt_bpp; + const uint8_t *got_ptr = got_row + x * fmt_bpp; + + if (!check_readback_pixel(got_ptr, expected_ptr, max_diff)) + mismatch_count++; + } + } + } + ok_(file, line)(!mismatch_count, "Unexpected number of mismatched pixels %u.\n", mismatch_count); +} + +static inline IDirect3DDevice9 *create_device(HWND *window) +{ + D3DPRESENT_PARAMETERS present_parameters = { 0 }; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + HRESULT hr; + HWND wnd; + + *window = NULL; + + if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0, + 640, 480, NULL, NULL, NULL, NULL))) + { + skip("Couldn't create application window.\n"); + return NULL; + } + + if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) + { + skip("Couldn't create IDirect3D9 object.\n"); + DestroyWindow(wnd); + return NULL; + } + + present_parameters.Windowed = TRUE; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, + &present_parameters, &device); + IDirect3D9_Release(d3d); + if (FAILED(hr)) + { + skip("Failed to create IDirect3DDevice9 object %#lx.\n", hr); + DestroyWindow(wnd); + return NULL; + } + + *window = wnd; + return device; +} diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 7789a709e84..20f3866ded3 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -133,46 +133,6 @@ static HRESULT create_file(const char *filename, const unsigned char *data, cons return D3DERR_INVALIDCALL; }
-static IDirect3DDevice9 *create_device(HWND *window) -{ - D3DPRESENT_PARAMETERS present_parameters = { 0 }; - IDirect3DDevice9 *device; - IDirect3D9 *d3d; - HRESULT hr; - HWND wnd; - - *window = NULL; - - if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0, - 640, 480, NULL, NULL, NULL, NULL))) - { - skip("Couldn't create application window.\n"); - return NULL; - } - - if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) - { - skip("Couldn't create IDirect3D9 object.\n"); - DestroyWindow(wnd); - return NULL; - } - - present_parameters.Windowed = TRUE; - present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; - hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, - &present_parameters, &device); - IDirect3D9_Release(d3d); - if (FAILED(hr)) - { - skip("Failed to create IDirect3DDevice9 object %#lx.\n", hr); - DestroyWindow(wnd); - return NULL; - } - - *window = wnd; - return device; -} - /* fills dds_header with reasonable default values */ static void fill_dds_header(struct dds_header *header) { @@ -1193,50 +1153,6 @@ static const uint8_t a8p8_2_2_expected[] = 0x00,0x00,0x00,0x10,0x00,0x00,0x40,0x20,0x00,0x00,0x80,0x30,0xff,0xff,0xff,0x40, };
-static uint32_t get_bpp_for_d3dformat(D3DFORMAT format) -{ - switch (format) - { - case D3DFMT_A32B32G32R32F: - return 16; - - case D3DFMT_A16B16G16R16: - case D3DFMT_Q16W16V16U16: - return 8; - - case D3DFMT_Q8W8V8U8: - case D3DFMT_A8B8G8R8: - case D3DFMT_A8R8G8B8: - case D3DFMT_V16U16: - case D3DFMT_G16R16: - case D3DFMT_R32F: - return 4; - - case D3DFMT_R8G8B8: - return 3; - - case D3DFMT_A4R4G4B4: - case D3DFMT_X1R5G5B5: - case D3DFMT_A1R5G5B5: - case D3DFMT_R5G6B5: - case D3DFMT_V8U8: - case D3DFMT_A8P8: - return 2; - - case D3DFMT_R3G3B2: - case D3DFMT_DXT5: - case D3DFMT_DXT4: - case D3DFMT_A4L4: - case D3DFMT_L8: - case D3DFMT_P8: - return 1; - - default: - assert(0 && "Need to add format to get_bpp_for_d3dformat()."); - return 0; - } -} - static void test_format_conversion(IDirect3DDevice9 *device) { struct @@ -2221,22 +2137,6 @@ static const uint8_t q8w8v8u8_4_4_expected[] = 0xac,0x9c,0x8c,0xbc,0xec,0xdc,0xcc,0xfc,0x2b,0x1b,0x0b,0x3b,0x6b,0x5b,0x4b,0x7b, };
-static const uint8_t a8r8g8b8_4_4[] = -{ - 0x00,0xff,0x00,0x80,0x00,0xff,0x00,0x80,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, - 0x80,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, -}; - -static const uint8_t a8r8g8b8_4_4_expected[] = -{ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, - 0x80,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, - 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, -}; - static const uint8_t a4r4g4b4_4_4[] = { 0xff,0x00,0x0f,0x00,0x00,0xf0,0x00,0x0f,0xf0,0x00,0xf0,0x00,0xf0,0x00,0xf0,0x00, @@ -2324,6 +2224,21 @@ static const uint8_t r3g3b2_4_4_expected[] = static BOOL is_dxt_d3dformat(D3DFORMAT fmt); static void test_color_key(void) { + static const uint8_t a8r8g8b8_4_4[] = + { + 0x00,0xff,0x00,0x80,0x00,0xff,0x00,0x80,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x80,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + }; + static const uint8_t a8r8g8b8_4_4_expected[] = + { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x80,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + 0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff, + }; + static const struct { D3DFORMAT src_format; @@ -5219,6 +5134,160 @@ static void test_D3DXSaveSurfaceToFile(IDirect3DDevice9 *device) IDirect3DSurface9_Release(surface); }
+static void test_image_filters(void) +{ + static const struct + { + DWORD filter; + const char *name; + } + test_filters[] = + { + { D3DX_FILTER_POINT, "D3DX_FILTER_POINT" }, + { D3DX_FILTER_LINEAR, "D3DX_FILTER_LINEAR" }, + { D3DX_FILTER_TRIANGLE, "D3DX_FILTER_TRIANGLE" }, + { D3DX_FILTER_BOX, "D3DX_FILTER_BOX" }, + }; + static const struct + { + const RECT src_rect; + const void *src_data; + D3DFORMAT format; + + unsigned int dst_width; + unsigned int dst_height; + struct + { + const void *expected_dst_data; + const void *expected_dst_data_32; + BOOL todo; + } + filter_expected[4]; + } tests[] = + { + { + { 0, 0, 16, 16 }, a8r8g8b8_16_16, D3DFMT_A8R8G8B8, 8, 8, + { + { a8r8g8b8_16_16_point_filter_8_8 }, + { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_16_16_triangle_filter_8_8, a8r8g8b8_16_16_triangle_filter_8_8_32bit, .todo = TRUE }, + /* Linear and box filters match. */ + { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, + }, + }, + { + { 0, 0, 16, 16 }, a8r8g8b8_16_16, D3DFMT_A8R8G8B8, 7, 7, + { + { a8r8g8b8_16_16_point_filter_7_7, 0, }, + { a8r8g8b8_16_16_linear_filter_7_7, .todo = TRUE }, + { a8r8g8b8_16_16_triangle_filter_7_7, .todo = TRUE }, + /* + * If scaling down to a size that isn't a power of two, the + * box filter is replaced with the triangle filter. + */ + { a8r8g8b8_16_16_triangle_filter_7_7, .todo = TRUE }, + }, + }, + { + { 0, 0, 6, 6 }, a8r8g8b8_6_6, D3DFMT_A8R8G8B8, 3, 3, + { + { a8r8g8b8_6_6_point_filter_3_3, 0, }, + { a8r8g8b8_6_6_linear_filter_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_triangle_filter_3_3, .todo = TRUE }, + /* + * If scaling down to a size that is half but isn't a power of + * two, the box filter is replaced with the linear filter. + */ + { a8r8g8b8_6_6_linear_filter_3_3, .todo = TRUE }, + }, + }, + { + { 0, 0, 6, 6 }, a8r8g8b8_6_6, D3DFMT_A8R8G8B8, 4, 4, + { + { a8r8g8b8_6_6_point_filter_4_4, 0, }, + { a8r8g8b8_6_6_linear_filter_4_4, .todo = TRUE }, + { a8r8g8b8_6_6_triangle_filter_4_4, .todo = TRUE }, + /* + * If scaling down to a size that is not half and isn't a power of + * two, the box filter is replaced with the triangle filter. + */ + { a8r8g8b8_6_6_triangle_filter_4_4, .todo = TRUE }, + }, + }, + { + { 0, 0, 4, 4 }, a8r8g8b8_4_4, D3DFMT_A8R8G8B8, 12, 12, + { + { a8r8g8b8_4_4_point_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_triangle_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_triangle_filter_12_12, .todo = TRUE }, + }, + }, + { + { 0, 0, 4, 4 }, a8r8g8b8_4_4, D3DFMT_A8R8G8B8, 8, 8, + { + { a8r8g8b8_4_4_point_filter_8_8 }, + /* + * When scaling up by 2, linear and triangle filters behave + * the same. + */ + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + }, + }, + }; + const uint8_t *expected_dst; + IDirect3DDevice9 *device; + D3DLOCKED_RECT lock_rect; + IDirect3DSurface9 *surf; + uint32_t src_pitch; + unsigned int i, j; + HRESULT hr; + HWND hwnd; + + if (!(device = create_device(&hwnd))) + return; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const unsigned int fmt_bpp = get_bpp_for_d3dformat(tests[i].format); + + winetest_push_context("Test %u", i); + + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, tests[i].dst_width, tests[i].dst_height, + tests[i].format, D3DPOOL_SCRATCH, &surf, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + src_pitch = fmt_bpp * (tests[i].src_rect.right - tests[i].src_rect.left); + for (j = 0; j < ARRAY_SIZE(test_filters); ++j) + { + winetest_push_context("Filter %s", test_filters[j].name); + + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, tests[i].src_data, tests[i].format, + src_pitch, NULL, &tests[i].src_rect, test_filters[j].filter, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (sizeof(void *) == 4 && tests[i].filter_expected[j].expected_dst_data_32) + expected_dst = tests[i].filter_expected[j].expected_dst_data_32; + else + expected_dst = tests[i].filter_expected[j].expected_dst_data; + + IDirect3DSurface9_LockRect(surf, &lock_rect, NULL, D3DLOCK_READONLY); + todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, + expected_dst, tests[i].dst_width, tests[i].dst_height, 1, tests[i].format, 0); + IDirect3DSurface9_UnlockRect(surf); + + winetest_pop_context(); + } + + check_release((IUnknown *)surf, 0); + winetest_pop_context(); + } + + check_release((IUnknown *)device, 0); + DestroyWindow(hwnd); +} + START_TEST(surface) { HWND wnd; @@ -5261,4 +5330,5 @@ START_TEST(surface) DestroyWindow(wnd);
test_color_key(); + test_image_filters(); } diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index f3f45a8eacd..a87152fc2ac 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -1077,8 +1077,14 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) IDirect3DTexture9 *tex; IDirect3DCubeTexture9 *cubetex; IDirect3DVolumeTexture9 *voltex; + D3DLOCKED_RECT lock_rect; + IDirect3DSurface9 *surf; + D3DLOCKED_BOX lock_box; + IDirect3DVolume9 *vol; + D3DBOX box; HRESULT hr; uint32_t i; + RECT rect;
hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 5, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &tex, NULL);
@@ -1221,6 +1227,137 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) else skip("Failed to create volume texture\n");
+ /* Test D3DXFilterTexture() D3DX_DEFAULT behavior. */ + hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &tex, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DTexture9_GetSurfaceLevel(tex, 0, &surf); + SetRect(&rect, 0, 0, 16, 16); + + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, a8r8g8b8_16_16, D3DFMT_A8R8G8B8, 64, NULL, + &rect, D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DSurface9_Release(surf); + + /* Default matches D3DX_FILTER_BOX. */ + hr = D3DXFilterTexture((IDirect3DBaseTexture9 *)tex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DTexture9_LockRect(tex, 1, &lock_rect, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, a8r8g8b8_16_16_linear_filter_8_8, 8, 8, 1, + D3DFMT_A8R8G8B8, 0); + IDirect3DTexture9_UnlockRect(tex, 1); + IDirect3DTexture9_Release(tex); + + /* Test with a non power of 2 texture size. */ + hr = IDirect3DDevice9_CreateTexture(device, 6, 6, 2, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &tex, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DTexture9_GetSurfaceLevel(tex, 0, &surf); + SetRect(&rect, 0, 0, 6, 6); + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, a8r8g8b8_6_6, D3DFMT_A8R8G8B8, 24, NULL, + &rect, D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DSurface9_Release(surf); + + /* + * MSDN claims non power of 2 textures default to + * D3DX_FILTER_BOX | D3DX_FILTER_DITHER, which doesn't make much sense. + * It's actually D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER, which matches + * the behavior of using D3DX_DEFAULT as the filter argument for all other + * functions. + */ + hr = D3DXFilterTexture((IDirect3DBaseTexture9 *)tex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DTexture9_LockRect(tex, 1, &lock_rect, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, a8r8g8b8_6_6_triangle_dither_filter_3_3, 3, 3, 1, + D3DFMT_A8R8G8B8, 0); + IDirect3DTexture9_UnlockRect(tex, 1); + + /* + * Do the same thing as D3DXFilterTexture() using D3DXLoadSurfaceFromMemory() + * to confirm behavior. + */ + IDirect3DTexture9_GetSurfaceLevel(tex, 1, &surf); + SetRect(&rect, 0, 0, 6, 6); + hr = D3DXLoadSurfaceFromMemory(surf, NULL, NULL, a8r8g8b8_6_6, D3DFMT_A8R8G8B8, 24, NULL, + &rect, D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DSurface9_Release(surf); + + IDirect3DTexture9_LockRect(tex, 1, &lock_rect, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, a8r8g8b8_6_6_triangle_dither_filter_3_3, 3, 3, 1, + D3DFMT_A8R8G8B8, 0); + IDirect3DTexture9_UnlockRect(tex, 1); + + IDirect3DTexture9_Release(tex); + + /* D3DX_DEFAULT behavior for volume textures. */ + hr = IDirect3DDevice9_CreateVolumeTexture(device, 8, 8, 8, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &voltex, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolumeTexture9_GetVolumeLevel(voltex, 0, &vol); + set_box(&box, 0, 0, 8, 8, 0, 8); + + hr = D3DXLoadVolumeFromMemory(vol, NULL, NULL, a8r8g8b8_8_8_8, D3DFMT_A8R8G8B8, 32, 256, NULL, &box, + D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolume9_Release(vol); + + /* Default matches D3DX_FILTER_BOX. */ + hr = D3DXFilterTexture((IDirect3DBaseTexture9 *)voltex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DVolumeTexture9_LockBox(voltex, 1, &lock_box, NULL, D3DLOCK_READONLY); + if (sizeof(void *) == 4) + { + todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_8_8_8_box_filter_4_4_4_32bit, 4, 4, 4, D3DFMT_A8R8G8B8, 0); + } + else + { + todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_8_8_8_linear_filter_4_4_4, 4, 4, 4, D3DFMT_A8R8G8B8, 0); + } + IDirect3DVolumeTexture9_UnlockBox(voltex, 1); + IDirect3DVolumeTexture9_Release(voltex); + + /* Test with a non power of 2 volume texture size. */ + hr = IDirect3DDevice9_CreateVolumeTexture(device, 6, 6, 6, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &voltex, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolumeTexture9_GetVolumeLevel(voltex, 0, &vol); + set_box(&box, 0, 0, 6, 6, 0, 6); + + hr = D3DXLoadVolumeFromMemory(vol, NULL, NULL, a8r8g8b8_6_6_6, D3DFMT_A8R8G8B8, 24, 144, NULL, &box, + D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolume9_Release(vol); + + /* + * Default on non power of 2 volume texture, matches + * D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER. + */ + hr = D3DXFilterTexture((IDirect3DBaseTexture9 *)voltex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DVolumeTexture9_LockBox(voltex, 1, &lock_box, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_6_6_6_triangle_dither_filter_3_3_3, 3, 3, 3, D3DFMT_A8R8G8B8, 0); + IDirect3DVolumeTexture9_UnlockBox(voltex, 1); + + IDirect3DVolumeTexture9_GetVolumeLevel(voltex, 1, &vol); + set_box(&box, 0, 0, 6, 6, 0, 6); + + hr = D3DXLoadVolumeFromMemory(vol, NULL, NULL, a8r8g8b8_6_6_6, D3DFMT_A8R8G8B8, 24, 144, NULL, &box, + D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + IDirect3DVolume9_Release(vol); + + IDirect3DVolumeTexture9_LockBox(voltex, 1, &lock_box, NULL, D3DLOCK_READONLY); + todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_6_6_6_triangle_dither_filter_3_3_3, 3, 3, 3, D3DFMT_A8R8G8B8, 0); + IDirect3DVolumeTexture9_UnlockBox(voltex, 1); + IDirect3DVolumeTexture9_Release(voltex); + /* Test textures with D3DUSAGE_AUTOGENMIPMAP usage */ if (!is_autogenmipmap_supported(device, D3DRTYPE_TEXTURE)) { diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index 4acebe1a181..9ed435e5edd 100644 --- a/dlls/d3dx9_36/tests/volume.c +++ b/dlls/d3dx9_36/tests/volume.c @@ -23,6 +23,13 @@ #include "d3dx9tex.h" #include "d3dx9_test_images.h"
+#define check_release(obj, exp) _check_release(__LINE__, obj, exp) +static inline void _check_release(unsigned int line, IUnknown *obj, int exp) +{ + int ref = IUnknown_Release(obj); + ok_(__FILE__, line)(ref == exp, "Invalid refcount. Expected %d, got %d\n", exp, ref); +} + #define check_pixel_4bpp(box, x, y, z, color) _check_pixel_4bpp(__LINE__, box, x, y, z, color) static inline void _check_pixel_4bpp(unsigned int line, const D3DLOCKED_BOX *box, int x, int y, int z, DWORD expected_color) { @@ -37,16 +44,6 @@ static inline void _check_pixel_8bpp(unsigned int line, const D3DLOCKED_BOX *box ok_(__FILE__, line)(color == expected_color, "Got color %#I64x, expected %#I64x.\n", color, expected_color); }
-static inline void set_box(D3DBOX *box, UINT left, UINT top, UINT right, UINT bottom, UINT front, UINT back) -{ - box->Left = left; - box->Top = top; - box->Right = right; - box->Bottom = bottom; - box->Front = front; - box->Back = back; -} - static void test_D3DXLoadVolumeFromMemory(IDirect3DDevice9 *device) { int i, x, y, z; @@ -659,6 +656,121 @@ static void test_d3dx_save_volume_to_file(IDirect3DDevice9 *device) IDirect3DVolumeTexture9_Release(volume_texture); }
+static void test_image_filters(void) +{ + static const struct + { + DWORD filter; + const char *name; + } + test_filters[] = + { + { D3DX_FILTER_POINT, "D3DX_FILTER_POINT" }, + { D3DX_FILTER_LINEAR, "D3DX_FILTER_LINEAR" }, + { D3DX_FILTER_TRIANGLE, "D3DX_FILTER_TRIANGLE" }, + { D3DX_FILTER_BOX, "D3DX_FILTER_BOX" }, + }; + static const struct + { + const D3DBOX src_box; + const void *src_data; + D3DFORMAT format; + + unsigned int dst_width; + unsigned int dst_height; + unsigned int dst_depth; + struct + { + const void *expected_dst_data; + const void *expected_dst_data_32; + BOOL todo; + } + filter_expected[4]; + } tests[] = + { + { + { 0, 0, 8, 8, 0, 8 }, a8r8g8b8_8_8_8, D3DFMT_A8R8G8B8, 4, 4, 4, + { + { a8r8g8b8_8_8_8_point_filter_4_4_4 }, + { a8r8g8b8_8_8_8_linear_filter_4_4_4, .todo = TRUE }, + { + a8r8g8b8_8_8_8_triangle_filter_4_4_4, a8r8g8b8_8_8_8_triangle_filter_4_4_4_32bit, + .todo = TRUE + }, + /* Linear and box filters match on 64bit, but not 32bit. */ + { + a8r8g8b8_8_8_8_linear_filter_4_4_4, a8r8g8b8_8_8_8_box_filter_4_4_4_32bit, + .todo = TRUE + }, + }, + }, + { + { 0, 0, 6, 6, 0, 6 }, a8r8g8b8_6_6_6, D3DFMT_A8R8G8B8, 3, 3, 3, + { + { a8r8g8b8_6_6_6_point_filter_3_3_3 }, + { a8r8g8b8_6_6_6_linear_filter_3_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_6_triangle_filter_3_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_6_linear_filter_3_3_3, .todo = TRUE }, + }, + }, + }; + IDirect3DVolumeTexture9 *volume_texture; + uint32_t src_pitch, src_slice_pitch; + const uint8_t *expected_dst; + D3DLOCKED_BOX locked_box; + IDirect3DVolume9 *volume; + IDirect3DDevice9 *device; + unsigned int i, j; + HRESULT hr; + HWND hwnd; + + if (!(device = create_device(&hwnd))) + return; + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const unsigned int fmt_bpp = get_bpp_for_d3dformat(tests[i].format); + + winetest_push_context("Test %u", i); + + hr = IDirect3DDevice9_CreateVolumeTexture(device, tests[i].dst_width, tests[i].dst_height, tests[i].dst_depth, 1, + 0, tests[i].format, D3DPOOL_SCRATCH, &volume_texture, NULL); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + + IDirect3DVolumeTexture9_GetVolumeLevel(volume_texture, 0, &volume); + + src_pitch = fmt_bpp * (tests[i].src_box.Right - tests[i].src_box.Left); + src_slice_pitch = src_pitch * (tests[i].src_box.Back - tests[i].src_box.Front); + for (j = 0; j < ARRAY_SIZE(test_filters); ++j) + { + winetest_push_context("Filter %s", test_filters[j].name); + + hr = D3DXLoadVolumeFromMemory(volume, NULL, NULL, tests[i].src_data, tests[i].format, src_pitch, + src_slice_pitch, NULL, &tests[i].src_box, test_filters[j].filter, 0); + ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr); + if (sizeof(void *) == 4 && tests[i].filter_expected[j].expected_dst_data_32) + expected_dst = tests[i].filter_expected[j].expected_dst_data_32; + else + expected_dst = tests[i].filter_expected[j].expected_dst_data; + + IDirect3DVolume9_LockBox(volume, &locked_box, NULL, D3DLOCK_READONLY); + todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(locked_box.pBits, locked_box.RowPitch, + locked_box.SlicePitch, expected_dst, tests[i].dst_width, tests[i].dst_height, tests[i].dst_depth, + tests[i].format, 0); + IDirect3DVolume9_UnlockBox(volume); + + winetest_pop_context(); + } + + check_release((IUnknown *)volume_texture, 1); + check_release((IUnknown *)volume, 0); + winetest_pop_context(); + } + + check_release((IUnknown *)device, 0); + DestroyWindow(hwnd); +} + START_TEST(volume) { HWND wnd; @@ -700,4 +812,6 @@ START_TEST(volume) IDirect3DDevice9_Release(device); IDirect3D9_Release(d3d); DestroyWindow(wnd); + + test_image_filters(); }
From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx10_43/tests/d3dx10.c | 1072 +++++++++++++++++++++++++++++++++ 1 file changed, 1072 insertions(+)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 04f3aad7ff5..67fff3e0f6f 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -23,6 +23,7 @@ #include "wine/wined3d.h" #include "wine/test.h" #include <stdint.h> +#include <assert.h>
static const D3DX10_IMAGE_LOAD_INFO d3dx10_default_load_info = { @@ -832,6 +833,780 @@ static const uint8_t test_wmp_data[] = 0xff,0xff,0xff,0xff };
+/* + * Image filter test pixels. + */ +static const uint8_t a8r8g8b8_16_16[] = +{ + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x8d,0x8e,0x8e,0x8e,0x8e,0x8f,0x8f,0x8f,0x8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8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_16_16_point_filter_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x08,0x08,0x08,0x08,0x0a,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0c,0x0e,0x0e,0x0e,0x0e, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a,0x2c,0x2c,0x2c,0x2c,0x2e,0x2e,0x2e,0x2e, + 0x40,0x40,0x40,0x40,0x42,0x42,0x42,0x42,0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46, + 0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a,0x4c,0x4c,0x4c,0x4c,0x4e,0x4e,0x4e,0x4e, + 0x60,0x60,0x60,0x60,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x68,0x68,0x68,0x68,0x6a,0x6a,0x6a,0x6a,0x6c,0x6c,0x6c,0x6c,0x6e,0x6e,0x6e,0x6e, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x88,0x88,0x88,0x88,0x8a,0x8a,0x8a,0x8a,0x8c,0x8c,0x8c,0x8c,0x8e,0x8e,0x8e,0x8e, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xa8,0xa8,0xa8,0xa8,0xaa,0xaa,0xaa,0xaa,0xac,0xac,0xac,0xac,0xae,0xae,0xae,0xae, + 0xc0,0xc0,0xc0,0xc0,0xc2,0xc2,0xc2,0xc2,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, + 0xc8,0xc8,0xc8,0xc8,0xca,0xca,0xca,0xca,0xcc,0xcc,0xcc,0xcc,0xce,0xce,0xce,0xce, + 0xe0,0xe0,0xe0,0xe0,0xe2,0xe2,0xe2,0xe2,0xe4,0xe4,0xe4,0xe4,0xe6,0xe6,0xe6,0xe6, + 0xe8,0xe8,0xe8,0xe8,0xea,0xea,0xea,0xea,0xec,0xec,0xec,0xec,0xee,0xee,0xee,0xee, +}; + +static const uint8_t a8r8g8b8_16_16_linear_filter_8_8[] = +{ + 0x08,0x08,0x08,0x08,0x0a,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0c,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x15,0x15,0x15,0x15,0x17,0x17,0x17,0x17, + 0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x2f,0x2f,0x2f,0x2f, + 0x31,0x31,0x31,0x31,0x33,0x33,0x33,0x33,0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37, + 0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a,0x4c,0x4c,0x4c,0x4c,0x4e,0x4e,0x4e,0x4e, + 0x50,0x50,0x50,0x50,0x52,0x52,0x52,0x52,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x77,0x77,0x77,0x77, + 0x89,0x89,0x89,0x89,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x97,0x97,0x97,0x97, + 0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xaf,0xaf,0xaf,0xaf, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7, + 0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd3,0xd3,0xd3,0xd3,0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7, + 0xe9,0xe9,0xe9,0xe9,0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xef,0xef,0xef,0xef, + 0xf1,0xf1,0xf1,0xf1,0xf3,0xf3,0xf3,0xf3,0xf5,0xf5,0xf5,0xf5,0xf7,0xf7,0xf7,0xf7, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_8_8[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1c,0x1c,0x1c,0x1c,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b,0x2c,0x2c,0x2c,0x2c,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6c,0x6c,0x6c,0x6c,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76, + 0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96, + 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xac,0xac,0xac,0xae,0xae,0xae,0xae, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb6,0xb6,0xb6,0xb6, + 0xca,0xca,0xca,0xca,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd2,0xd2,0xd2,0xd2,0xd5,0xd5,0xd5,0xd5,0xd6,0xd6,0xd6,0xd6, + 0xda,0xda,0xda,0xda,0xdb,0xdb,0xdb,0xdb,0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf, + 0xe1,0xe1,0xe1,0xe1,0xe3,0xe3,0xe3,0xe3,0xe5,0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_8_8_32bit[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1c,0x1c,0x1c,0x1c,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a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e6, +}; + +static const uint8_t a8r8g8b8_16_16_box_filter_8_8[] = +{ + 0x09,0x09,0x09,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x0f,0x0f,0x0f,0x0f, + 0x11,0x11,0x11,0x11,0x13,0x13,0x13,0x13,0x15,0x15,0x15,0x15,0x17,0x17,0x17,0x17, + 0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x2f,0x2f,0x2f,0x2f, + 0x31,0x31,0x31,0x31,0x33,0x33,0x33,0x33,0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37, + 0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57, + 0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x77,0x77,0x77,0x77, + 0x89,0x89,0x89,0x89,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x97,0x97,0x97,0x97, + 0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xaf,0xaf,0xaf,0xaf, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7, + 0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd3,0xd3,0xd3,0xd3,0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7, + 0xe9,0xe9,0xe9,0xe9,0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xef,0xef,0xef,0xef, + 0xf1,0xf1,0xf1,0xf1,0xf3,0xf3,0xf3,0xf3,0xf5,0xf5,0xf5,0xf5,0xf7,0xf7,0xf7,0xf7, +}; + +static const uint8_t a8r8g8b8_16_16_point_filter_7_7[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x09,0x09,0x09,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x29,0x29,0x29,0x29, + 0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x40,0x40,0x40,0x40,0x42,0x42,0x42,0x42, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x4d,0x4d,0x4d,0x4d,0x60,0x60,0x60,0x60,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64, + 0x66,0x66,0x66,0x66,0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0xb0,0xb0,0xb0,0xb0, + 0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6,0xb9,0xb9,0xb9,0xb9, + 0xbb,0xbb,0xbb,0xbb,0xbd,0xbd,0xbd,0xbd,0xd0,0xd0,0xd0,0xd0,0xd2,0xd2,0xd2,0xd2, + 0xd4,0xd4,0xd4,0xd4,0xd6,0xd6,0xd6,0xd6,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd, +}; + +static const uint8_t a8r8g8b8_16_16_linear_filter_7_7[] = +{ + 0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12, + 0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16,0x19,0x19,0x19,0x19,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x62,0x62,0x62,0x62,0x79,0x79,0x79,0x79,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x9d,0x9d,0x9d,0x9d,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xc2,0xc2,0xc2,0xc2, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xd0,0xd0,0xd0,0xd0,0xe6,0xe6,0xe6,0xe6,0xe9,0xe9,0xe9,0xe9, + 0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xf0,0xf0,0xf0,0xf0,0xf2,0xf2,0xf2,0xf2, + 0xf4,0xf4,0xf4,0xf4, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_7_7[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1e,0x1e,0x1e,0x1e,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3c,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x61,0x61,0x61,0x61,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85, + 0x9e,0x9e,0x9e,0x9e,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xc3,0xc3,0xc3,0xc3, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf,0xe1,0xe1,0xe1,0xe1,0xe4,0xe4,0xe4,0xe4, + 0xe5,0xe5,0xe5,0xe5, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_7_7_32bit[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1d,0x1d,0x1d,0x1d,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3c,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x61,0x61,0x61,0x61,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85, + 0x9e,0x9e,0x9e,0x9e,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xc3,0xc3,0xc3,0xc3, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf,0xe1,0xe1,0xe1,0xe1,0xe4,0xe4,0xe4,0xe4, + 0xe5,0xe5,0xe5,0xe5, +}; + +static const uint8_t a8r8g8b8_6_6[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_6_6_point_filter_3_3[] = +{ + 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50, + 0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8, + 0xd0,0xd0,0xd0,0xd0, +}; +static const uint8_t a8r8g8b8_6_6_linear_filter_3_3[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a, + 0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2, + 0xe9,0xe9,0xe9,0xe9, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_3_3[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_3_3_32bit[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6e,0x6e,0x6e,0x6e, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_point_filter_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x24,0x24,0x24,0x24,0x30,0x30,0x30,0x30, + 0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58, + 0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xc4,0xc4,0xc4,0xc4,0xd0,0xd0,0xd0,0xd0, +}; + +static const uint8_t a8r8g8b8_6_6_linear_filter_4_4[] = +{ + 0x0d,0x0d,0x0d,0x0d,0x1f,0x1f,0x1f,0x1f,0x31,0x31,0x31,0x31,0x43,0x43,0x43,0x43, + 0x49,0x49,0x49,0x49,0x5b,0x5b,0x5b,0x5b,0x6d,0x6d,0x6d,0x6d,0x7f,0x7f,0x7f,0x7f, + 0x85,0x85,0x85,0x85,0x97,0x97,0x97,0x97,0xa9,0xa9,0xa9,0xa9,0xbb,0xbb,0xbb,0xbb, + 0xc1,0xc1,0xc1,0xc1,0xd3,0xd3,0xd3,0xd3,0xe5,0xe5,0xe5,0xe5,0xf4,0xf4,0xf4,0xf4, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_4_4[] = +{ + 0x27,0x27,0x27,0x27,0x33,0x33,0x33,0x33,0x45,0x45,0x45,0x45,0x51,0x51,0x51,0x51, + 0x4f,0x4f,0x4f,0x4f,0x5b,0x5b,0x5b,0x5b,0x6d,0x6d,0x6d,0x6d,0x79,0x79,0x79,0x79, + 0x8b,0x8b,0x8b,0x8b,0x97,0x97,0x97,0x97,0xa9,0xa9,0xa9,0xa9,0xb5,0xb5,0xb5,0xb5, + 0xb3,0xb3,0xb3,0xb3,0xbf,0xbf,0xbf,0xbf,0xd1,0xd1,0xd1,0xd1,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_point_filter_12_12[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_linear_filter_12_12[] = +{ + 0x50,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60, + 0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x0b,0x0b,0x0b,0x0b, + 0x10,0x10,0x10,0x10,0x15,0x15,0x15,0x15,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x15,0x15,0x15,0x15,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xb0,0xb0,0xb0,0xb0,0xa0,0xa0,0x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x43,0x43,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x60,0x60,0x60,0x60, + 0x1b,0x1b,0x1b,0x1b,0x0d,0x0d,0x0d,0x0d,0x10,0x10,0x10,0x10,0x15,0x15,0x15,0x15, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b, + 0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35,0x38,0x38,0x38,0x38,0x2b,0x2b,0x2b,0x2b, + 0x25,0x25,0x25,0x25,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x43,0x43,0x43,0x43,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x2d,0x2d,0x2d,0x2d,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x58,0x58,0x58,0x58,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x43,0x43,0x43,0x43,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x58,0x58,0x58,0x58,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x6d,0x6d,0x6d,0x6d,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x98,0x98,0x98,0x98,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x83,0x83,0x83,0x83,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0x98,0x98,0x98,0x98,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xb0,0xb0,0xb0,0xb0,0xb5,0xb5,0xb5,0xb5, + 0xbb,0xbb,0xbb,0xbb,0xc0,0xc0,0xc0,0xc0,0xc3,0xc3,0xc3,0xc3,0xb5,0xb5,0xb5,0xb5, + 0xbb,0xbb,0xbb,0xbb,0xad,0xad,0xad,0xad,0xb0,0xb0,0xb0,0xb0,0xb5,0xb5,0xb5,0xb5, + 0xbb,0xbb,0xbb,0xbb,0xc0,0xc0,0xc0,0xc0,0xc5,0xc5,0xc5,0xc5,0xcb,0xcb,0xcb,0xcb, + 0xd0,0xd0,0xd0,0xd0,0xd5,0xd5,0xd5,0xd5,0xd8,0xd8,0xd8,0xd8,0xcb,0xcb,0xcb,0xcb, + 0xc5,0xc5,0xc5,0xc5,0xb8,0xb8,0xb8,0xb8,0xbb,0xbb,0xbb,0xbb,0xc0,0xc0,0xc0,0xc0, + 0xc5,0xc5,0xc5,0xc5,0xcb,0xcb,0xcb,0xcb,0xd0,0xd0,0xd0,0xd0,0xd5,0xd5,0xd5,0xd5, + 0xdb,0xdb,0xdb,0xdb,0xe0,0xe0,0xe0,0xe0,0xe3,0xe3,0xe3,0xe3,0xd5,0xd5,0xd5,0xd5, + 0x90,0x90,0x90,0x90,0x83,0x83,0x83,0x83,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xa0,0xa0,0xa0,0xa0, +}; + +static const uint8_t a8r8g8b8_4_4_point_filter_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_linear_filter_8_8[] = +{ + 0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x44,0x44,0x44,0x44, + 0x4c,0x4c,0x4c,0x4c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54, + 0x1c,0x1c,0x1c,0x1c,0x14,0x14,0x14,0x14,0x1c,0x1c,0x1c,0x1c,0x24,0x24,0x24,0x24, + 0x2c,0x2c,0x2c,0x2c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34, + 0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34,0x3c,0x3c,0x3c,0x3c,0x44,0x44,0x44,0x44, + 0x4c,0x4c,0x4c,0x4c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54, + 0x5c,0x5c,0x5c,0x5c,0x54,0x54,0x54,0x54,0x5c,0x5c,0x5c,0x5c,0x64,0x64,0x64,0x64, + 0x6c,0x6c,0x6c,0x6c,0x74,0x74,0x74,0x74,0x7c,0x7c,0x7c,0x7c,0x74,0x74,0x74,0x74, + 0x7c,0x7c,0x7c,0x7c,0x74,0x74,0x74,0x74,0x7c,0x7c,0x7c,0x7c,0x84,0x84,0x84,0x84, + 0x8c,0x8c,0x8c,0x8c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94, + 0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0xa4,0xa4,0xa4,0xa4, + 0xac,0xac,0xac,0xac,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4, + 0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xc4,0xc4,0xc4,0xc4, + 0xcc,0xcc,0xcc,0xcc,0xd4,0xd4,0xd4,0xd4,0xdc,0xdc,0xdc,0xdc,0xd4,0xd4,0xd4,0xd4, + 0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0xa4,0xa4,0xa4,0xa4, + 0xac,0xac,0xac,0xac,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4, +}; + +static const uint8_t a8r8g8b8_8_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x8d,0x8e,0x8e,0x8e,0x8e,0x8f,0x8f,0x8f,0x8f, + 0x90,0x90,0x90,0x90,0x91,0x91,0x91,0x91,0x92,0x92,0x92,0x92,0x93,0x93,0x93,0x93, + 0x94,0x94,0x94,0x94,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96,0x97,0x97,0x97,0x97, + 0x98,0x98,0x98,0x98,0x99,0x99,0x99,0x99,0x9a,0x9a,0x9a,0x9a,0x9b,0x9b,0x9b,0x9b, + 0x9c,0x9c,0x9c,0x9c,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e,0x9f,0x9f,0x9f,0x9f, + 0xa0,0xa0,0xa0,0xa0,0xa1,0xa1,0xa1,0xa1,0xa2,0xa2,0xa2,0xa2,0xa3,0xa3,0xa3,0xa3, + 0xa4,0xa4,0xa4,0xa4,0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa7,0xa7,0xa7,0xa7, + 0xa8,0xa8,0xa8,0xa8,0xa9,0xa9,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12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,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0xee,0xee,0xee,0xee,0xef,0xef,0xef,0xef, + 0xf0,0xf0,0xf0,0xf0,0xf1,0xf1,0xf1,0xf1,0xf2,0xf2,0xf2,0xf2,0xf3,0xf3,0xf3,0xf3, + 0xf4,0xf4,0xf4,0xf4,0xf5,0xf5,0xf5,0xf5,0xf6,0xf6,0xf6,0xf6,0xf7,0xf7,0xf7,0xf7, + 0xf8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_8_8_8_point_filter_4_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xb0,0xb0,0xb0,0xb0,0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6, + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xb0,0xb0,0xb0,0xb0,0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6, +}; + +static const uint8_t a8r8g8b8_8_8_8_linear_filter_4_4_4[] = +{ + 0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0xa5,0xa5,0xa5,0xa5,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0xa5,0xa5,0xa5,0xa5,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_8_8_8_triangle_filter_4_4_4[] = +{ + 0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3c,0x3c,0x3c,0x3c,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e, + 0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa8,0xa8,0xa8,0xa8,0xaa,0xaa,0xaa,0xaa, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xba,0xba,0xba,0xba, + 0xc1,0xc1,0xc1,0xc1,0xc3,0xc3,0xc3,0xc3,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, + 0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3c,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e, + 0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xba,0xba,0xba,0xba, + 0xc1,0xc1,0xc1,0xc1,0xc3,0xc3,0xc3,0xc3,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, +}; + +static const uint8_t a8r8g8b8_8_8_8_box_filter_4_4_4[] = +{ + 0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0xa4,0xa4,0xa4,0xa4,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb4,0xb4,0xb4,0xb4,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0xa4,0xa4,0xa4,0xa4,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb4,0xb4,0xb4,0xb4,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_6_6_6[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_6_6_6_point_filter_3_3_3[] = +{ + 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50, + 0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8, + 0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30, + 0x50,0x50,0x50,0x50,0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0, + 0xb8,0xb8,0xb8,0xb8,0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18, + 0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50,0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80, + 0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8,0xd0,0xd0,0xd0,0xd0, +}; + +static const uint8_t a8r8g8b8_6_6_6_linear_filter_3_3_3[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a, + 0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2, + 0xe9,0xe9,0xe9,0xe9,0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a, + 0x6a,0x6a,0x6a,0x6a,0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba, + 0xd2,0xd2,0xd2,0xd2,0xe9,0xe9,0xe9,0xe9,0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32, + 0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a,0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a, + 0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2,0xe9,0xe9,0xe9,0xe9, +}; + +static const uint8_t a8r8g8b8_6_6_6_triangle_filter_3_3_3[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54, + 0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf, + 0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41, + 0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96, + 0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6, +}; + static const char *test_fx_source = "cbuffer cb : register(b1)\n" "{\n" @@ -1818,6 +2593,36 @@ static void get_texture3d_readback(ID3D10Texture3D *texture, unsigned int sub_re ID3D10Device_Release(device); }
+static void get_resource_readback(ID3D10Resource *resource, + unsigned int sub_resource_idx, struct resource_readback *rb) +{ + D3D10_RESOURCE_DIMENSION d; + + ID3D10Resource_GetType(resource, &d); + switch (d) + { + case D3D10_RESOURCE_DIMENSION_BUFFER: + assert(0 && "Need to import get_buffer_readback() from d3d10core."); + return; + + case D3D10_RESOURCE_DIMENSION_TEXTURE1D: + assert(0 && "Need to import get_texture1d_readback() from d3d10core."); + return; + + case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + get_texture_readback((ID3D10Texture2D *)resource, sub_resource_idx, rb); + return; + + case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + get_texture3d_readback((ID3D10Texture3D *)resource, sub_resource_idx, rb); + return; + + default: + assert(0 && "Invalid resource dimension."); + return; + } +} + static void *get_readback_data(struct resource_readback *rb, uint32_t x, uint32_t y, uint32_t z, unsigned byte_width) { return (uint8_t *)rb->map_desc.pData + z * rb->map_desc.DepthPitch + y * rb->map_desc.RowPitch + x * byte_width; @@ -1851,6 +2656,65 @@ static void release_resource_readback(struct resource_readback *rb) ID3D10Resource_Release(rb->resource); }
+static inline BOOL check_readback_pixel_4bpp_rgba(const void *got, const void *expected, uint32_t max_diff) +{ + const uint32_t c1 = *(const uint32_t *)got; + const uint32_t c2 = *(const uint32_t *)expected; + + return compare_uint(c1 & 0xff, c2 & 0xff, max_diff) + && compare_uint((c1 >> 8) & 0xff, (c2 >> 8) & 0xff, max_diff) + && compare_uint((c1 >> 16) & 0xff, (c2 >> 16) & 0xff, max_diff) + && compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff); +} + +typedef BOOL (*check_readback_pixel_func)(const void *, const void *, uint32_t); +static inline check_readback_pixel_func get_readback_pixel_func_for_dxgi_format(DXGI_FORMAT format) +{ + switch (format) + { + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_B8G8R8A8_UNORM: + return check_readback_pixel_4bpp_rgba; + + default: + assert(0 && "Need to add format to get_readback_pixel_func_for_dxgi_format()."); + return 0; + } +} + +#define check_test_readback(rb, expected, width, height, depth, format, max_diff) \ + _check_test_readback(__FILE__, __LINE__, rb, expected, width, height, depth, format, max_diff) +static void _check_test_readback(const char *file, uint32_t line, struct resource_readback *rb, + const void *expected, uint32_t width, uint32_t height, uint32_t depth, DXGI_FORMAT format, uint32_t max_diff) +{ + check_readback_pixel_func check_readback_pixel = get_readback_pixel_func_for_dxgi_format(format); + unsigned int x, y, z, mismatch_count, expected_row_pitch, expected_slice_pitch; + const unsigned int fmt_bpp = (get_bpp_from_format(format) + 7) / 8; + + expected_row_pitch = fmt_bpp * width; + expected_slice_pitch = expected_row_pitch * height; + mismatch_count = 0; + for (z = 0; z < depth; ++z) + { + const uint8_t *expected_slice = ((const uint8_t *)expected) + z * expected_slice_pitch; + + for (y = 0; y < height; ++y) + { + const uint8_t *expected_row = expected_slice + y * expected_row_pitch; + + for (x = 0; x < width; ++x) + { + const uint8_t *got_ptr = get_readback_data(rb, x, y, z, fmt_bpp); + const uint8_t *expected_ptr = expected_row + x * fmt_bpp; + + if (!check_readback_pixel(got_ptr, expected_ptr, max_diff)) + mismatch_count++; + } + } + } + ok_(file, line)(!mismatch_count, "Unexpected number of mismatched pixels %u.\n", mismatch_count); +} + #define check_readback_data_u32(a, b, c) check_readback_data_u32_(__LINE__, a, b, c) static void check_readback_data_u32_(unsigned int line, struct resource_readback *rb, const RECT *rect, uint32_t expected) @@ -4529,6 +5393,213 @@ static void test_create_texture(void) ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); }
+static void test_image_filters(void) +{ + static const struct + { + DWORD filter; + const char *name; + } + test_filters[] = + { + { D3DX10_FILTER_POINT, "D3DX10_FILTER_POINT" }, + { D3DX10_FILTER_LINEAR, "D3DX10_FILTER_LINEAR" }, + { D3DX10_FILTER_TRIANGLE, "D3DX10_FILTER_TRIANGLE" }, + { D3DX10_FILTER_BOX, "D3DX10_FILTER_BOX" }, + }; + static const struct + { + unsigned int src_width; + unsigned int src_height; + unsigned int src_depth; + const void *src_data; + DXGI_FORMAT format; + + unsigned int dst_width; + unsigned int dst_height; + unsigned int dst_depth; + struct + { + const void *expected_dst_data; + const void *expected_dst_data_32; + BOOL todo; + } + filter_expected[4]; + } tests[] = + { + { + 16, 16, 1, a8r8g8b8_16_16, DXGI_FORMAT_R8G8B8A8_UNORM, 8, 8, 1, + { + { a8r8g8b8_16_16_point_filter_8_8 }, + { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_16_16_triangle_filter_8_8, a8r8g8b8_16_16_triangle_filter_8_8_32bit, .todo = TRUE }, + { a8r8g8b8_16_16_box_filter_8_8, .todo = TRUE }, + }, + }, + { + 16, 16, 1, a8r8g8b8_16_16, DXGI_FORMAT_R8G8B8A8_UNORM, 7, 7, 1, + { + { a8r8g8b8_16_16_point_filter_7_7, 0, }, + { a8r8g8b8_16_16_linear_filter_7_7, .todo = TRUE }, + { a8r8g8b8_16_16_triangle_filter_7_7, a8r8g8b8_16_16_triangle_filter_7_7_32bit, .todo = TRUE }, + /* + * If scaling down to a size that isn't a power of two, the + * box filter is replaced with the triangle filter. + */ + { a8r8g8b8_16_16_triangle_filter_7_7, a8r8g8b8_16_16_triangle_filter_7_7_32bit, .todo = TRUE }, + }, + }, + { + 6, 6, 1, a8r8g8b8_6_6, DXGI_FORMAT_R8G8B8A8_UNORM, 3, 3, 1, + { + { a8r8g8b8_6_6_point_filter_3_3, 0, }, + { a8r8g8b8_6_6_linear_filter_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_triangle_filter_3_3, a8r8g8b8_6_6_triangle_filter_3_3_32bit, .todo = TRUE }, + /* + * If scaling down to a size that is half but isn't a power of + * two, the box filter is replaced with the linear filter. + */ + { a8r8g8b8_6_6_linear_filter_3_3, .todo = TRUE }, + }, + }, + { + 6, 6, 1, a8r8g8b8_6_6, DXGI_FORMAT_R8G8B8A8_UNORM, 4, 4, 1, + { + { a8r8g8b8_6_6_point_filter_4_4, 0, }, + { a8r8g8b8_6_6_linear_filter_4_4, .todo = TRUE }, + { a8r8g8b8_6_6_triangle_filter_4_4, .todo = TRUE }, + /* + * If scaling down to a size that is not half and isn't a power of + * two, the box filter is replaced with the triangle filter. + */ + { a8r8g8b8_6_6_triangle_filter_4_4, .todo = TRUE }, + }, + }, + { + 4, 4, 1, a8r8g8b8_4_4, DXGI_FORMAT_R8G8B8A8_UNORM, 12, 12, 1, + { + { a8r8g8b8_4_4_point_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_triangle_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_triangle_filter_12_12, .todo = TRUE }, + }, + }, + /* 5. */ + { + 4, 4, 1, a8r8g8b8_4_4, DXGI_FORMAT_R8G8B8A8_UNORM, 8, 8, 1, + { + { a8r8g8b8_4_4_point_filter_8_8 }, + /* + * When scaling up by 2, linear and triangle filters behave + * the same. + */ + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + }, + }, + { + 8, 8, 8, a8r8g8b8_8_8_8, DXGI_FORMAT_R8G8B8A8_UNORM, 4, 4, 4, + { + { a8r8g8b8_8_8_8_point_filter_4_4_4 }, + { a8r8g8b8_8_8_8_linear_filter_4_4_4, .todo = TRUE }, + { a8r8g8b8_8_8_8_triangle_filter_4_4_4, .todo = TRUE }, + { a8r8g8b8_8_8_8_box_filter_4_4_4, .todo = TRUE }, + }, + }, + { + 6, 6, 6, a8r8g8b8_6_6_6, DXGI_FORMAT_R8G8B8A8_UNORM, 3, 3, 3, + { + { a8r8g8b8_6_6_6_point_filter_3_3_3 }, + { a8r8g8b8_6_6_6_linear_filter_3_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_6_triangle_filter_3_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_6_linear_filter_3_3_3, .todo = TRUE }, + }, + }, + }; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + BYTE data[8192]; + } dds; + D3DX10_IMAGE_LOAD_INFO load_info; + const uint8_t *expected_dst; + struct resource_readback rb; + ID3D10Resource *resource; + ID3D10Device *device; + uint32_t src_pitch; + unsigned int i, j; + HRESULT hr; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + dds.magic = MAKEFOURCC('D','D','S',' '); + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const unsigned int fmt_bpp = (get_bpp_from_format(tests[i].format) + 7) / 8; + unsigned int dds_size = sizeof(dds); + + winetest_push_context("Test %u", i); + + load_info = d3dx10_default_load_info; + load_info.Width = tests[i].dst_width; + load_info.Height = tests[i].dst_height; + load_info.Depth = tests[i].dst_depth; + load_info.MipLevels = 1; + + src_pitch = fmt_bpp * tests[i].src_width; + dds_size += fmt_bpp * tests[i].src_width * tests[i].src_height * tests[i].src_depth; + + if (tests[i].src_depth > 1) + { + set_dxt10_dds_header(&dds.header, DDS_DEPTH, tests[i].src_width, tests[i].src_height, tests[i].src_depth, + 1, src_pitch, 0, 0); + set_dds_header_dxt10(&dds.dxt10, tests[i].format, D3D10_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0); + } + else + { + set_dxt10_dds_header(&dds.header, 0, tests[i].src_width, tests[i].src_height, 0, 1, src_pitch, 0, 0); + set_dds_header_dxt10(&dds.dxt10, tests[i].format, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0); + } + memcpy(dds.data, tests[i].src_data, tests[i].src_width * tests[i].src_height * tests[i].src_depth * fmt_bpp); + + for (j = 0; j < ARRAY_SIZE(test_filters); ++j) + { + winetest_push_context("Filter %s", test_filters[j].name); + + load_info.Filter = load_info.MipFilter = test_filters[j].filter; + hr = D3DX10CreateTextureFromMemory(device, &dds, dds_size, &load_info, NULL, &resource, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + if (sizeof(void *) == 4 && tests[i].filter_expected[j].expected_dst_data_32) + expected_dst = tests[i].filter_expected[j].expected_dst_data_32; + else + expected_dst = tests[i].filter_expected[j].expected_dst_data; + + get_resource_readback(resource, 0, &rb); + todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(&rb, expected_dst, tests[i].dst_width, + tests[i].dst_height, tests[i].dst_depth, tests[i].format, 0); + release_resource_readback(&rb); + ID3D10Resource_Release(resource); + + winetest_pop_context(); + } + + winetest_pop_context(); + } + + CoUninitialize(); + ok(!ID3D10Device_Release(device), "Unexpected refcount.\n"); +} + #define check_rect(rect, left, top, right, bottom) _check_rect(__LINE__, rect, left, top, right, bottom) static inline void _check_rect(unsigned int line, const RECT *rect, int left, int top, int right, int bottom) { @@ -6017,4 +7088,5 @@ START_TEST(d3dx10) test_preprocess_shader(); test_legacy_dds_header_image_info(); test_dxt10_dds_header_image_info(); + test_image_filters(); }
From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx11_43/tests/d3dx11.c | 1079 +++++++++++++++++++++++++++++++++ 1 file changed, 1079 insertions(+)
diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index 671a7b7002c..e1a72f51909 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -23,6 +23,7 @@ #include "wine/wined3d.h" #include "wine/test.h" #include <stdint.h> +#include <assert.h>
static const D3DX11_IMAGE_LOAD_INFO d3dx11_default_load_info = { @@ -832,6 +833,780 @@ static const uint8_t test_wmp_data[] = 0xff,0xff,0xff,0xff };
+/* + * Image filter test pixels. + */ +static const uint8_t a8r8g8b8_16_16[] = +{ + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,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0xef,0xef,0xef,0xef, + 0xf0,0xf0,0xf0,0xf0,0xf1,0xf1,0xf1,0xf1,0xf2,0xf2,0xf2,0xf2,0xf3,0xf3,0xf3,0xf3, + 0xf4,0xf4,0xf4,0xf4,0xf5,0xf5,0xf5,0xf5,0xf6,0xf6,0xf6,0xf6,0xf7,0xf7,0xf7,0xf7, + 0xf8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_16_16_point_filter_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x08,0x08,0x08,0x08,0x0a,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0c,0x0e,0x0e,0x0e,0x0e, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a,0x2c,0x2c,0x2c,0x2c,0x2e,0x2e,0x2e,0x2e, + 0x40,0x40,0x40,0x40,0x42,0x42,0x42,0x42,0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46, + 0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a,0x4c,0x4c,0x4c,0x4c,0x4e,0x4e,0x4e,0x4e, + 0x60,0x60,0x60,0x60,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x68,0x68,0x68,0x68,0x6a,0x6a,0x6a,0x6a,0x6c,0x6c,0x6c,0x6c,0x6e,0x6e,0x6e,0x6e, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x88,0x88,0x88,0x88,0x8a,0x8a,0x8a,0x8a,0x8c,0x8c,0x8c,0x8c,0x8e,0x8e,0x8e,0x8e, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xa8,0xa8,0xa8,0xa8,0xaa,0xaa,0xaa,0xaa,0xac,0xac,0xac,0xac,0xae,0xae,0xae,0xae, + 0xc0,0xc0,0xc0,0xc0,0xc2,0xc2,0xc2,0xc2,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, + 0xc8,0xc8,0xc8,0xc8,0xca,0xca,0xca,0xca,0xcc,0xcc,0xcc,0xcc,0xce,0xce,0xce,0xce, + 0xe0,0xe0,0xe0,0xe0,0xe2,0xe2,0xe2,0xe2,0xe4,0xe4,0xe4,0xe4,0xe6,0xe6,0xe6,0xe6, + 0xe8,0xe8,0xe8,0xe8,0xea,0xea,0xea,0xea,0xec,0xec,0xec,0xec,0xee,0xee,0xee,0xee, +}; + +static const uint8_t a8r8g8b8_16_16_linear_filter_8_8[] = +{ + 0x08,0x08,0x08,0x08,0x0a,0x0a,0x0a,0x0a,0x0c,0x0c,0x0c,0x0c,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x15,0x15,0x15,0x15,0x17,0x17,0x17,0x17, + 0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x2f,0x2f,0x2f,0x2f, + 0x31,0x31,0x31,0x31,0x33,0x33,0x33,0x33,0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37, + 0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a,0x4c,0x4c,0x4c,0x4c,0x4e,0x4e,0x4e,0x4e, + 0x50,0x50,0x50,0x50,0x52,0x52,0x52,0x52,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x77,0x77,0x77,0x77, + 0x89,0x89,0x89,0x89,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x97,0x97,0x97,0x97, + 0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xaf,0xaf,0xaf,0xaf, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7, + 0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd3,0xd3,0xd3,0xd3,0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7, + 0xe9,0xe9,0xe9,0xe9,0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xef,0xef,0xef,0xef, + 0xf1,0xf1,0xf1,0xf1,0xf3,0xf3,0xf3,0xf3,0xf5,0xf5,0xf5,0xf5,0xf7,0xf7,0xf7,0xf7, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_8_8[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1c,0x1c,0x1c,0x1c,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b,0x2c,0x2c,0x2c,0x2c,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6c,0x6c,0x6c,0x6c,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76, + 0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96, + 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xac,0xac,0xac,0xae,0xae,0xae,0xae, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb6,0xb6,0xb6,0xb6, + 0xca,0xca,0xca,0xca,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd2,0xd2,0xd2,0xd2,0xd5,0xd5,0xd5,0xd5,0xd6,0xd6,0xd6,0xd6, + 0xda,0xda,0xda,0xda,0xdb,0xdb,0xdb,0xdb,0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf, + 0xe1,0xe1,0xe1,0xe1,0xe3,0xe3,0xe3,0xe3,0xe5,0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_8_8_32bit[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1c,0x1c,0x1c,0x1c,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2a,0x2c,0x2c,0x2c,0x2c,0x2e,0x2e,0x2e,0x2e, + 0x30,0x30,0x30,0x30,0x33,0x33,0x33,0x33,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4a,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76, + 0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96, + 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xac,0xac,0xac,0xac,0xae,0xae,0xae,0xae, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb6,0xb6,0xb6,0xb6, + 0xca,0xca,0xca,0xca,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd2,0xd2,0xd2,0xd2,0xd5,0xd5,0xd5,0xd5,0xd6,0xd6,0xd6,0xd6, + 0xda,0xda,0xda,0xda,0xdb,0xdb,0xdb,0xdb,0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf, + 0xe1,0xe1,0xe1,0xe1,0xe3,0xe3,0xe3,0xe3,0xe5,0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6, +}; + +static const uint8_t a8r8g8b8_16_16_box_filter_8_8[] = +{ + 0x09,0x09,0x09,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x0f,0x0f,0x0f,0x0f, + 0x11,0x11,0x11,0x11,0x13,0x13,0x13,0x13,0x15,0x15,0x15,0x15,0x17,0x17,0x17,0x17, + 0x29,0x29,0x29,0x29,0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x2f,0x2f,0x2f,0x2f, + 0x31,0x31,0x31,0x31,0x33,0x33,0x33,0x33,0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37, + 0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b,0x4d,0x4d,0x4d,0x4d,0x4f,0x4f,0x4f,0x4f, + 0x51,0x51,0x51,0x51,0x53,0x53,0x53,0x53,0x55,0x55,0x55,0x55,0x57,0x57,0x57,0x57, + 0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x6f,0x6f,0x6f,0x6f, + 0x71,0x71,0x71,0x71,0x73,0x73,0x73,0x73,0x75,0x75,0x75,0x75,0x77,0x77,0x77,0x77, + 0x89,0x89,0x89,0x89,0x8b,0x8b,0x8b,0x8b,0x8d,0x8d,0x8d,0x8d,0x8f,0x8f,0x8f,0x8f, + 0x91,0x91,0x91,0x91,0x93,0x93,0x93,0x93,0x95,0x95,0x95,0x95,0x97,0x97,0x97,0x97, + 0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xaf,0xaf,0xaf,0xaf, + 0xb1,0xb1,0xb1,0xb1,0xb3,0xb3,0xb3,0xb3,0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7, + 0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb,0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf, + 0xd1,0xd1,0xd1,0xd1,0xd3,0xd3,0xd3,0xd3,0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7, + 0xe9,0xe9,0xe9,0xe9,0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xef,0xef,0xef,0xef, + 0xf1,0xf1,0xf1,0xf1,0xf3,0xf3,0xf3,0xf3,0xf5,0xf5,0xf5,0xf5,0xf7,0xf7,0xf7,0xf7, +}; + +static const uint8_t a8r8g8b8_16_16_point_filter_7_7[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x09,0x09,0x09,0x09,0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x29,0x29,0x29,0x29, + 0x2b,0x2b,0x2b,0x2b,0x2d,0x2d,0x2d,0x2d,0x40,0x40,0x40,0x40,0x42,0x42,0x42,0x42, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x49,0x49,0x49,0x49,0x4b,0x4b,0x4b,0x4b, + 0x4d,0x4d,0x4d,0x4d,0x60,0x60,0x60,0x60,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64, + 0x66,0x66,0x66,0x66,0x69,0x69,0x69,0x69,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0xb0,0xb0,0xb0,0xb0, + 0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6,0xb9,0xb9,0xb9,0xb9, + 0xbb,0xbb,0xbb,0xbb,0xbd,0xbd,0xbd,0xbd,0xd0,0xd0,0xd0,0xd0,0xd2,0xd2,0xd2,0xd2, + 0xd4,0xd4,0xd4,0xd4,0xd6,0xd6,0xd6,0xd6,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd, +}; + +static const uint8_t a8r8g8b8_16_16_linear_filter_7_7[] = +{ + 0x0b,0x0b,0x0b,0x0b,0x0d,0x0d,0x0d,0x0d,0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12, + 0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16,0x19,0x19,0x19,0x19,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3d,0x3d,0x3d,0x3d,0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x62,0x62,0x62,0x62,0x79,0x79,0x79,0x79,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x9d,0x9d,0x9d,0x9d,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab,0xc2,0xc2,0xc2,0xc2, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xd0,0xd0,0xd0,0xd0,0xe6,0xe6,0xe6,0xe6,0xe9,0xe9,0xe9,0xe9, + 0xeb,0xeb,0xeb,0xeb,0xed,0xed,0xed,0xed,0xf0,0xf0,0xf0,0xf0,0xf2,0xf2,0xf2,0xf2, + 0xf4,0xf4,0xf4,0xf4, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_7_7[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1e,0x1e,0x1e,0x1e,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3c,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x61,0x61,0x61,0x61,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85, + 0x9e,0x9e,0x9e,0x9e,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xc3,0xc3,0xc3,0xc3, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf,0xe1,0xe1,0xe1,0xe1,0xe4,0xe4,0xe4,0xe4, + 0xe5,0xe5,0xe5,0xe5, +}; + +static const uint8_t a8r8g8b8_16_16_triangle_filter_7_7_32bit[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b,0x1d,0x1d,0x1d,0x1d,0x20,0x20,0x20,0x20, + 0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x30,0x30,0x30,0x30, + 0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36,0x39,0x39,0x39,0x39, + 0x3b,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3c,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56, + 0x59,0x59,0x59,0x59,0x5b,0x5b,0x5b,0x5b,0x5d,0x5d,0x5d,0x5d,0x60,0x60,0x60,0x60, + 0x61,0x61,0x61,0x61,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b,0x7d,0x7d,0x7d,0x7d, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85, + 0x9e,0x9e,0x9e,0x9e,0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4, + 0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xc3,0xc3,0xc3,0xc3, + 0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xcd,0xcd,0xcd,0xcd,0xcf,0xcf,0xcf,0xcf,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0xdd,0xdd,0xdd,0xdd,0xdf,0xdf,0xdf,0xdf,0xe1,0xe1,0xe1,0xe1,0xe4,0xe4,0xe4,0xe4, + 0xe5,0xe5,0xe5,0xe5, +}; + +static const uint8_t a8r8g8b8_6_6[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_6_6_point_filter_3_3[] = +{ + 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50, + 0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8, + 0xd0,0xd0,0xd0,0xd0, +}; +static const uint8_t a8r8g8b8_6_6_linear_filter_3_3[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a, + 0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2, + 0xe9,0xe9,0xe9,0xe9, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_3_3[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_3_3_32bit[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6e,0x6e,0x6e,0x6e, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6, +}; + +static const uint8_t a8r8g8b8_6_6_point_filter_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x24,0x24,0x24,0x24,0x30,0x30,0x30,0x30, + 0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58, + 0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xc4,0xc4,0xc4,0xc4,0xd0,0xd0,0xd0,0xd0, +}; + +static const uint8_t a8r8g8b8_6_6_linear_filter_4_4[] = +{ + 0x0d,0x0d,0x0d,0x0d,0x1f,0x1f,0x1f,0x1f,0x31,0x31,0x31,0x31,0x43,0x43,0x43,0x43, + 0x49,0x49,0x49,0x49,0x5b,0x5b,0x5b,0x5b,0x6d,0x6d,0x6d,0x6d,0x7f,0x7f,0x7f,0x7f, + 0x85,0x85,0x85,0x85,0x97,0x97,0x97,0x97,0xa9,0xa9,0xa9,0xa9,0xbb,0xbb,0xbb,0xbb, + 0xc1,0xc1,0xc1,0xc1,0xd3,0xd3,0xd3,0xd3,0xe5,0xe5,0xe5,0xe5,0xf4,0xf4,0xf4,0xf4, +}; + +static const uint8_t a8r8g8b8_6_6_triangle_filter_4_4[] = +{ + 0x27,0x27,0x27,0x27,0x33,0x33,0x33,0x33,0x45,0x45,0x45,0x45,0x51,0x51,0x51,0x51, + 0x4f,0x4f,0x4f,0x4f,0x5b,0x5b,0x5b,0x5b,0x6d,0x6d,0x6d,0x6d,0x79,0x79,0x79,0x79, + 0x8b,0x8b,0x8b,0x8b,0x97,0x97,0x97,0x97,0xa9,0xa9,0xa9,0xa9,0xb5,0xb5,0xb5,0xb5, + 0xb3,0xb3,0xb3,0xb3,0xbf,0xbf,0xbf,0xbf,0xd1,0xd1,0xd1,0xd1,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_point_filter_12_12[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x60,0x60,0x60,0x60, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0xa0,0xa0,0xa0,0xa0, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, + 0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xe0,0xe0,0xe0,0xe0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_linear_filter_12_12[] = +{ + 0x50,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60, + 0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x0b,0x0b,0x0b,0x0b, + 0x10,0x10,0x10,0x10,0x15,0x15,0x15,0x15,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x15,0x15,0x15,0x15,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x80,0x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0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xb0,0xb0,0xb0,0xb0,0xa0,0xa0,0xa0,0xa0, +}; + +static const uint8_t a8r8g8b8_4_4_triangle_filter_12_12[] = +{ + 0x50,0x50,0x50,0x50,0x43,0x43,0x43,0x43,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x60,0x60,0x60,0x60, + 0x1b,0x1b,0x1b,0x1b,0x0d,0x0d,0x0d,0x0d,0x10,0x10,0x10,0x10,0x15,0x15,0x15,0x15, + 0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20,0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b, + 0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35,0x38,0x38,0x38,0x38,0x2b,0x2b,0x2b,0x2b, + 0x25,0x25,0x25,0x25,0x18,0x18,0x18,0x18,0x1b,0x1b,0x1b,0x1b,0x20,0x20,0x20,0x20, + 0x25,0x25,0x25,0x25,0x2b,0x2b,0x2b,0x2b,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x43,0x43,0x43,0x43,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x2d,0x2d,0x2d,0x2d,0x30,0x30,0x30,0x30,0x35,0x35,0x35,0x35, + 0x3b,0x3b,0x3b,0x3b,0x40,0x40,0x40,0x40,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x58,0x58,0x58,0x58,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x43,0x43,0x43,0x43,0x45,0x45,0x45,0x45,0x4b,0x4b,0x4b,0x4b, + 0x50,0x50,0x50,0x50,0x55,0x55,0x55,0x55,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x6d,0x6d,0x6d,0x6d,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x58,0x58,0x58,0x58,0x5b,0x5b,0x5b,0x5b,0x60,0x60,0x60,0x60, + 0x65,0x65,0x65,0x65,0x6b,0x6b,0x6b,0x6b,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x83,0x83,0x83,0x83,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x6d,0x6d,0x6d,0x6d,0x70,0x70,0x70,0x70,0x75,0x75,0x75,0x75, + 0x7b,0x7b,0x7b,0x7b,0x80,0x80,0x80,0x80,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x98,0x98,0x98,0x98,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x83,0x83,0x83,0x83,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0x98,0x98,0x98,0x98,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xb0,0xb0,0xb0,0xb0,0xb5,0xb5,0xb5,0xb5, + 0xbb,0xbb,0xbb,0xbb,0xc0,0xc0,0xc0,0xc0,0xc3,0xc3,0xc3,0xc3,0xb5,0xb5,0xb5,0xb5, + 0xbb,0xbb,0xbb,0xbb,0xad,0xad,0xad,0xad,0xb0,0xb0,0xb0,0xb0,0xb5,0xb5,0xb5,0xb5, + 0xbb,0xbb,0xbb,0xbb,0xc0,0xc0,0xc0,0xc0,0xc5,0xc5,0xc5,0xc5,0xcb,0xcb,0xcb,0xcb, + 0xd0,0xd0,0xd0,0xd0,0xd5,0xd5,0xd5,0xd5,0xd8,0xd8,0xd8,0xd8,0xcb,0xcb,0xcb,0xcb, + 0xc5,0xc5,0xc5,0xc5,0xb8,0xb8,0xb8,0xb8,0xbb,0xbb,0xbb,0xbb,0xc0,0xc0,0xc0,0xc0, + 0xc5,0xc5,0xc5,0xc5,0xcb,0xcb,0xcb,0xcb,0xd0,0xd0,0xd0,0xd0,0xd5,0xd5,0xd5,0xd5, + 0xdb,0xdb,0xdb,0xdb,0xe0,0xe0,0xe0,0xe0,0xe3,0xe3,0xe3,0xe3,0xd5,0xd5,0xd5,0xd5, + 0x90,0x90,0x90,0x90,0x83,0x83,0x83,0x83,0x85,0x85,0x85,0x85,0x8b,0x8b,0x8b,0x8b, + 0x90,0x90,0x90,0x90,0x95,0x95,0x95,0x95,0x9b,0x9b,0x9b,0x9b,0xa0,0xa0,0xa0,0xa0, + 0xa5,0xa5,0xa5,0xa5,0xab,0xab,0xab,0xab,0xad,0xad,0xad,0xad,0xa0,0xa0,0xa0,0xa0, +}; + +static const uint8_t a8r8g8b8_4_4_point_filter_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x50,0x50,0x50,0x50,0x50,0x50,0x50,0x50, + 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0,0xb0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, + 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0, + 0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, +}; + +static const uint8_t a8r8g8b8_4_4_linear_filter_8_8[] = +{ + 0x3c,0x3c,0x3c,0x3c,0x34,0x34,0x34,0x34,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0x9c,0x9c,0x9c,0x9c,0x94,0x94,0x94,0x94,0x9c,0x9c,0x9c,0x9c,0xa4,0xa4,0xa4,0xa4, + 0xac,0xac,0xac,0xac,0xb4,0xb4,0xb4,0xb4,0xbc,0xbc,0xbc,0xbc,0xb4,0xb4,0xb4,0xb4, +}; + +static const uint8_t a8r8g8b8_8_8_8[] = +{ + 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03, + 0x04,0x04,0x04,0x04,0x05,0x05,0x05,0x05,0x06,0x06,0x06,0x06,0x07,0x07,0x07,0x07, + 0x08,0x08,0x08,0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x8d,0x8e,0x8e,0x8e,0x8e,0x8f,0x8f,0x8f,0x8f, + 0x90,0x90,0x90,0x90,0x91,0x91,0x91,0x91,0x92,0x92,0x92,0x92,0x93,0x93,0x93,0x93, + 0x94,0x94,0x94,0x94,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96,0x97,0x97,0x97,0x97, + 0x98,0x98,0x98,0x98,0x99,0x99,0x99,0x99,0x9a,0x9a,0x9a,0x9a,0x9b,0x9b,0x9b,0x9b, + 0x9c,0x9c,0x9c,0x9c,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e,0x9f,0x9f,0x9f,0x9f, + 0xa0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0x08,0x09,0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0b, + 0x0c,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x0f, + 0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x12,0x12,0x12,0x12,0x13,0x13,0x13,0x13, + 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,0x17, + 0x18,0x18,0x18,0x18,0x19,0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1b, + 0x1c,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x1f, + 0x20,0x20,0x20,0x20,0x21,0x21,0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,0x23,0x23, + 0x24,0x24,0x24,0x24,0x25,0x25,0x25,0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,0x27, + 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2b, + 0x2c,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x2f, + 0x30,0x30,0x30,0x30,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x33,0x33,0x33,0x33, + 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x35,0x36,0x36,0x36,0x36,0x37,0x37,0x37,0x37, + 0x38,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3b, + 0x3c,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x3f, + 0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x43,0x43,0x43,0x43, + 0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x47,0x47,0x47,0x47, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4b, + 0x4c,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x4f, + 0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x52,0x52,0x52,0x52,0x53,0x53,0x53,0x53, + 0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x57,0x57,0x57,0x57, + 0x58,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5b, + 0x5c,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x5f, + 0x60,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63, + 0x64,0x64,0x64,0x64,0x65,0x65,0x65,0x65,0x66,0x66,0x66,0x66,0x67,0x67,0x67,0x67, + 0x68,0x68,0x68,0x68,0x69,0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6b, + 0x6c,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x6f, + 0x70,0x70,0x70,0x70,0x71,0x71,0x71,0x71,0x72,0x72,0x72,0x72,0x73,0x73,0x73,0x73, + 0x74,0x74,0x74,0x74,0x75,0x75,0x75,0x75,0x76,0x76,0x76,0x76,0x77,0x77,0x77,0x77, + 0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b, + 0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f, + 0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83, + 0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x87,0x87,0x87,0x87, + 0x88,0x88,0x88,0x88,0x89,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8b,0x8b,0x8b,0x8b, + 0x8c,0x8c,0x8c,0x8c,0x8d,0x8d,0x8d,0x8d,0x8e,0x8e,0x8e,0x8e,0x8f,0x8f,0x8f,0x8f, + 0x90,0x90,0x90,0x90,0x91,0x91,0x91,0x91,0x92,0x92,0x92,0x92,0x93,0x93,0x93,0x93, + 0x94,0x94,0x94,0x94,0x95,0x95,0x95,0x95,0x96,0x96,0x96,0x96,0x97,0x97,0x97,0x97, + 0x98,0x98,0x98,0x98,0x99,0x99,0x99,0x99,0x9a,0x9a,0x9a,0x9a,0x9b,0x9b,0x9b,0x9b, + 0x9c,0x9c,0x9c,0x9c,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e,0x9f,0x9f,0x9f,0x9f, + 0xa0,0xa0,0xa0,0xa0,0xa1,0xa1,0xa1,0xa1,0xa2,0xa2,0xa2,0xa2,0xa3,0xa3,0xa3,0xa3, + 0xa4,0xa4,0xa4,0xa4,0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa7,0xa7,0xa7,0xa7, + 0xa8,0xa8,0xa8,0xa8,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xab,0xab,0xab,0xab, + 0xac,0xac,0xac,0xac,0xad,0xad,0xad,0xad,0xae,0xae,0xae,0xae,0xaf,0xaf,0xaf,0xaf, + 0xb0,0xb0,0xb0,0xb0,0xb1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e4,0xe4,0xe4,0xe4,0xe5,0xe5,0xe5,0xe5,0xe6,0xe6,0xe6,0xe6,0xe7,0xe7,0xe7,0xe7, + 0xe8,0xe8,0xe8,0xe8,0xe9,0xe9,0xe9,0xe9,0xea,0xea,0xea,0xea,0xeb,0xeb,0xeb,0xeb, + 0xec,0xec,0xec,0xec,0xed,0xed,0xed,0xed,0xee,0xee,0xee,0xee,0xef,0xef,0xef,0xef, + 0xf0,0xf0,0xf0,0xf0,0xf1,0xf1,0xf1,0xf1,0xf2,0xf2,0xf2,0xf2,0xf3,0xf3,0xf3,0xf3, + 0xf4,0xf4,0xf4,0xf4,0xf5,0xf5,0xf5,0xf5,0xf6,0xf6,0xf6,0xf6,0xf7,0xf7,0xf7,0xf7, + 0xf8,0xf8,0xf8,0xf8,0xf9,0xf9,0xf9,0xf9,0xfa,0xfa,0xfa,0xfa,0xfb,0xfb,0xfb,0xfb, + 0xfc,0xfc,0xfc,0xfc,0xfd,0xfd,0xfd,0xfd,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_8_8_8_point_filter_4_4_4[] = +{ + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xb0,0xb0,0xb0,0xb0,0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6, + 0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x04,0x04,0x04,0x04,0x06,0x06,0x06,0x06, + 0x10,0x10,0x10,0x10,0x12,0x12,0x12,0x12,0x14,0x14,0x14,0x14,0x16,0x16,0x16,0x16, + 0x20,0x20,0x20,0x20,0x22,0x22,0x22,0x22,0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26, + 0x30,0x30,0x30,0x30,0x32,0x32,0x32,0x32,0x34,0x34,0x34,0x34,0x36,0x36,0x36,0x36, + 0x80,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x84,0x84,0x84,0x84,0x86,0x86,0x86,0x86, + 0x90,0x90,0x90,0x90,0x92,0x92,0x92,0x92,0x94,0x94,0x94,0x94,0x96,0x96,0x96,0x96, + 0xa0,0xa0,0xa0,0xa0,0xa2,0xa2,0xa2,0xa2,0xa4,0xa4,0xa4,0xa4,0xa6,0xa6,0xa6,0xa6, + 0xb0,0xb0,0xb0,0xb0,0xb2,0xb2,0xb2,0xb2,0xb4,0xb4,0xb4,0xb4,0xb6,0xb6,0xb6,0xb6, +}; + +static const uint8_t a8r8g8b8_8_8_8_linear_filter_4_4_4[] = +{ + 0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0xa5,0xa5,0xa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e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e, + 0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa8,0xa8,0xa8,0xa8,0xaa,0xaa,0xaa,0xaa, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xba,0xba,0xba,0xba, + 0xc1,0xc1,0xc1,0xc1,0xc3,0xc3,0xc3,0xc3,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, + 0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3c,0x3e,0x3e,0x3e,0x3e, + 0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x55,0x55,0x55,0x55,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x64,0x64,0x64,0x64,0x66,0x66,0x66,0x66, + 0x99,0x99,0x99,0x99,0x9b,0x9b,0x9b,0x9b,0x9d,0x9d,0x9d,0x9d,0x9e,0x9e,0x9e,0x9e, + 0xa5,0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa6,0xa9,0xa9,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa, + 0xb5,0xb5,0xb5,0xb5,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xba,0xba,0xba,0xba, + 0xc1,0xc1,0xc1,0xc1,0xc3,0xc3,0xc3,0xc3,0xc4,0xc4,0xc4,0xc4,0xc6,0xc6,0xc6,0xc6, +}; + +static const uint8_t a8r8g8b8_8_8_8_box_filter_4_4_4[] = +{ + 0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0xa4,0xa4,0xa4,0xa4,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb4,0xb4,0xb4,0xb4,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, + 0x24,0x24,0x24,0x24,0x26,0x26,0x26,0x26,0x28,0x28,0x28,0x28,0x2a,0x2a,0x2a,0x2a, + 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x39,0x39,0x39,0x39,0x3b,0x3b,0x3b,0x3b, + 0x44,0x44,0x44,0x44,0x46,0x46,0x46,0x46,0x48,0x48,0x48,0x48,0x4a,0x4a,0x4a,0x4a, + 0x54,0x54,0x54,0x54,0x56,0x56,0x56,0x56,0x58,0x58,0x58,0x58,0x5a,0x5a,0x5a,0x5a, + 0xa4,0xa4,0xa4,0xa4,0xa7,0xa7,0xa7,0xa7,0xa9,0xa9,0xa9,0xa9,0xab,0xab,0xab,0xab, + 0xb4,0xb4,0xb4,0xb4,0xb7,0xb7,0xb7,0xb7,0xb9,0xb9,0xb9,0xb9,0xbb,0xbb,0xbb,0xbb, + 0xc5,0xc5,0xc5,0xc5,0xc7,0xc7,0xc7,0xc7,0xc9,0xc9,0xc9,0xc9,0xcb,0xcb,0xcb,0xcb, + 0xd5,0xd5,0xd5,0xd5,0xd7,0xd7,0xd7,0xd7,0xd9,0xd9,0xd9,0xd9,0xdb,0xdb,0xdb,0xdb, +}; + +static const uint8_t a8r8g8b8_6_6_6[] = +{ + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x0c,0x0c,0x0c,0x0c,0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24, + 0x30,0x30,0x30,0x30,0x3c,0x3c,0x3c,0x3c,0x28,0x28,0x28,0x28,0x34,0x34,0x34,0x34, + 0x40,0x40,0x40,0x40,0x4c,0x4c,0x4c,0x4c,0x58,0x58,0x58,0x58,0x64,0x64,0x64,0x64, + 0x50,0x50,0x50,0x50,0x5c,0x5c,0x5c,0x5c,0x68,0x68,0x68,0x68,0x74,0x74,0x74,0x74, + 0x80,0x80,0x80,0x80,0x8c,0x8c,0x8c,0x8c,0x78,0x78,0x78,0x78,0x84,0x84,0x84,0x84, + 0x90,0x90,0x90,0x90,0x9c,0x9c,0x9c,0x9c,0xa8,0xa8,0xa8,0xa8,0xb4,0xb4,0xb4,0xb4, + 0xa0,0xa0,0xa0,0xa0,0xac,0xac,0xac,0xac,0xb8,0xb8,0xb8,0xb8,0xc4,0xc4,0xc4,0xc4, + 0xd0,0xd0,0xd0,0xd0,0xdc,0xdc,0xdc,0xdc,0xc8,0xc8,0xc8,0xc8,0xd4,0xd4,0xd4,0xd4, + 0xe0,0xe0,0xe0,0xe0,0xec,0xec,0xec,0xec,0xf8,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff, +}; + +static const uint8_t a8r8g8b8_6_6_6_point_filter_3_3_3[] = +{ + 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50, + 0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8, + 0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x30,0x30,0x30,0x30, + 0x50,0x50,0x50,0x50,0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80,0xa0,0xa0,0xa0,0xa0, + 0xb8,0xb8,0xb8,0xb8,0xd0,0xd0,0xd0,0xd0,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x18, + 0x30,0x30,0x30,0x30,0x50,0x50,0x50,0x50,0x68,0x68,0x68,0x68,0x80,0x80,0x80,0x80, + 0xa0,0xa0,0xa0,0xa0,0xb8,0xb8,0xb8,0xb8,0xd0,0xd0,0xd0,0xd0, +}; + +static const uint8_t a8r8g8b8_6_6_6_linear_filter_3_3_3[] = +{ + 0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a, + 0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2, + 0xe9,0xe9,0xe9,0xe9,0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32,0x4a,0x4a,0x4a,0x4a, + 0x6a,0x6a,0x6a,0x6a,0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a,0xba,0xba,0xba,0xba, + 0xd2,0xd2,0xd2,0xd2,0xe9,0xe9,0xe9,0xe9,0x1a,0x1a,0x1a,0x1a,0x32,0x32,0x32,0x32, + 0x4a,0x4a,0x4a,0x4a,0x6a,0x6a,0x6a,0x6a,0x82,0x82,0x82,0x82,0x9a,0x9a,0x9a,0x9a, + 0xba,0xba,0xba,0xba,0xd2,0xd2,0xd2,0xd2,0xe9,0xe9,0xe9,0xe9, +}; + +static const uint8_t a8r8g8b8_6_6_6_triangle_filter_3_3_3[] = +{ + 0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f, + 0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3, + 0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41,0x54,0x54,0x54,0x54, + 0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96,0xaf,0xaf,0xaf,0xaf, + 0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6,0x2d,0x2d,0x2d,0x2d,0x41,0x41,0x41,0x41, + 0x54,0x54,0x54,0x54,0x6f,0x6f,0x6f,0x6f,0x82,0x82,0x82,0x82,0x96,0x96,0x96,0x96, + 0xaf,0xaf,0xaf,0xaf,0xc3,0xc3,0xc3,0xc3,0xd6,0xd6,0xd6,0xd6, +}; + static const struct test_image { const uint8_t *data; @@ -1368,6 +2143,13 @@ static ID3DX11ThreadPumpVtbl D3DX11ThreadPumpVtbl = }; static ID3DX11ThreadPump thread_pump = { &D3DX11ThreadPumpVtbl };
+static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff) +{ + unsigned int diff = x > y ? x - y : y - x; + + return diff <= max_diff; +} + static char *get_str_a(const WCHAR *wstr) { static char buffer[MAX_PATH]; @@ -1772,6 +2554,36 @@ static void get_texture3d_readback(ID3D11Texture3D *texture, unsigned int sub_re ID3D11Device_Release(device); }
+static void get_resource_readback(ID3D11Resource *resource, + unsigned int sub_resource_idx, struct resource_readback *rb) +{ + D3D11_RESOURCE_DIMENSION d; + + ID3D11Resource_GetType(resource, &d); + switch (d) + { + case D3D11_RESOURCE_DIMENSION_BUFFER: + assert(0 && "Need to import get_buffer_readback() from d3d11 tests."); + return; + + case D3D11_RESOURCE_DIMENSION_TEXTURE1D: + assert(0 && "Need to import get_texture1d_readback() from d3d11 tests."); + return; + + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: + get_texture_readback((ID3D11Texture2D *)resource, sub_resource_idx, rb); + return; + + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: + get_texture3d_readback((ID3D11Texture3D *)resource, sub_resource_idx, rb); + return; + + default: + assert(0 && "Invalid resource dimension."); + return; + } +} + static void *get_readback_data(struct resource_readback *rb, uint32_t x, uint32_t y, uint32_t z, unsigned byte_width) { return (uint8_t *)rb->map_desc.pData + z * rb->map_desc.DepthPitch + y * rb->map_desc.RowPitch + x * byte_width; @@ -1789,6 +2601,65 @@ static void release_resource_readback(struct resource_readback *rb) ID3D11DeviceContext_Release(rb->immediate_context); }
+static inline BOOL check_readback_pixel_4bpp_rgba(const void *got, const void *expected, uint32_t max_diff) +{ + const uint32_t c1 = *(const uint32_t *)got; + const uint32_t c2 = *(const uint32_t *)expected; + + return compare_uint(c1 & 0xff, c2 & 0xff, max_diff) + && compare_uint((c1 >> 8) & 0xff, (c2 >> 8) & 0xff, max_diff) + && compare_uint((c1 >> 16) & 0xff, (c2 >> 16) & 0xff, max_diff) + && compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff); +} + +typedef BOOL (*check_readback_pixel_func)(const void *, const void *, uint32_t); +static inline check_readback_pixel_func get_readback_pixel_func_for_dxgi_format(DXGI_FORMAT format) +{ + switch (format) + { + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_B8G8R8A8_UNORM: + return check_readback_pixel_4bpp_rgba; + + default: + assert(0 && "Need to add format to get_readback_pixel_func_for_dxgi_format()."); + return 0; + } +} + +#define check_test_readback(rb, expected, width, height, depth, format, max_diff) \ + _check_test_readback(__FILE__, __LINE__, rb, expected, width, height, depth, format, max_diff) +static void _check_test_readback(const char *file, uint32_t line, struct resource_readback *rb, + const void *expected, uint32_t width, uint32_t height, uint32_t depth, DXGI_FORMAT format, uint32_t max_diff) +{ + check_readback_pixel_func check_readback_pixel = get_readback_pixel_func_for_dxgi_format(format); + unsigned int x, y, z, mismatch_count, expected_row_pitch, expected_slice_pitch; + const unsigned int fmt_bpp = (get_bpp_from_format(format) + 7) / 8; + + expected_row_pitch = fmt_bpp * width; + expected_slice_pitch = expected_row_pitch * height; + mismatch_count = 0; + for (z = 0; z < depth; ++z) + { + const uint8_t *expected_slice = ((const uint8_t *)expected) + z * expected_slice_pitch; + + for (y = 0; y < height; ++y) + { + const uint8_t *expected_row = expected_slice + y * expected_row_pitch; + + for (x = 0; x < width; ++x) + { + const uint8_t *got_ptr = get_readback_data(rb, x, y, z, fmt_bpp); + const uint8_t *expected_ptr = expected_row + x * fmt_bpp; + + if (!check_readback_pixel(got_ptr, expected_ptr, max_diff)) + mismatch_count++; + } + } + } + ok_(file, line)(!mismatch_count, "Unexpected number of mismatched pixels %u.\n", mismatch_count); +} + #define check_readback_data_u32(a, b, c) check_readback_data_u32_(__LINE__, a, b, c) static void check_readback_data_u32_(unsigned int line, struct resource_readback *rb, const RECT *rect, uint32_t expected) @@ -3357,6 +4228,213 @@ static void test_create_texture(void) ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); }
+static void test_image_filters(void) +{ + static const struct + { + DWORD filter; + const char *name; + } + test_filters[] = + { + { D3DX11_FILTER_POINT, "D3DX11_FILTER_POINT" }, + { D3DX11_FILTER_LINEAR, "D3DX11_FILTER_LINEAR" }, + { D3DX11_FILTER_TRIANGLE, "D3DX11_FILTER_TRIANGLE" }, + { D3DX11_FILTER_BOX, "D3DX11_FILTER_BOX" }, + }; + static const struct + { + unsigned int src_width; + unsigned int src_height; + unsigned int src_depth; + const void *src_data; + DXGI_FORMAT format; + + unsigned int dst_width; + unsigned int dst_height; + unsigned int dst_depth; + struct + { + const void *expected_dst_data; + const void *expected_dst_data_32; + BOOL todo; + } + filter_expected[4]; + } tests[] = + { + { + 16, 16, 1, a8r8g8b8_16_16, DXGI_FORMAT_R8G8B8A8_UNORM, 8, 8, 1, + { + { a8r8g8b8_16_16_point_filter_8_8 }, + { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_16_16_triangle_filter_8_8, a8r8g8b8_16_16_triangle_filter_8_8_32bit, .todo = TRUE }, + { a8r8g8b8_16_16_box_filter_8_8, .todo = TRUE }, + }, + }, + { + 16, 16, 1, a8r8g8b8_16_16, DXGI_FORMAT_R8G8B8A8_UNORM, 7, 7, 1, + { + { a8r8g8b8_16_16_point_filter_7_7, 0, }, + { a8r8g8b8_16_16_linear_filter_7_7, .todo = TRUE }, + { a8r8g8b8_16_16_triangle_filter_7_7, a8r8g8b8_16_16_triangle_filter_7_7_32bit, .todo = TRUE }, + /* + * If scaling down to a size that isn't a power of two, the + * box filter is replaced with the triangle filter. + */ + { a8r8g8b8_16_16_triangle_filter_7_7, a8r8g8b8_16_16_triangle_filter_7_7_32bit, .todo = TRUE }, + }, + }, + { + 6, 6, 1, a8r8g8b8_6_6, DXGI_FORMAT_R8G8B8A8_UNORM, 3, 3, 1, + { + { a8r8g8b8_6_6_point_filter_3_3, 0, }, + { a8r8g8b8_6_6_linear_filter_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_triangle_filter_3_3, a8r8g8b8_6_6_triangle_filter_3_3_32bit, .todo = TRUE }, + /* + * If scaling down to a size that is half but isn't a power of + * two, the box filter is replaced with the linear filter. + */ + { a8r8g8b8_6_6_linear_filter_3_3, .todo = TRUE }, + }, + }, + { + 6, 6, 1, a8r8g8b8_6_6, DXGI_FORMAT_R8G8B8A8_UNORM, 4, 4, 1, + { + { a8r8g8b8_6_6_point_filter_4_4, 0, }, + { a8r8g8b8_6_6_linear_filter_4_4, .todo = TRUE }, + { a8r8g8b8_6_6_triangle_filter_4_4, .todo = TRUE }, + /* + * If scaling down to a size that is not half and isn't a power of + * two, the box filter is replaced with the triangle filter. + */ + { a8r8g8b8_6_6_triangle_filter_4_4, .todo = TRUE }, + }, + }, + { + 4, 4, 1, a8r8g8b8_4_4, DXGI_FORMAT_R8G8B8A8_UNORM, 12, 12, 1, + { + { a8r8g8b8_4_4_point_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_triangle_filter_12_12, .todo = TRUE }, + { a8r8g8b8_4_4_triangle_filter_12_12, .todo = TRUE }, + }, + }, + /* 5. */ + { + 4, 4, 1, a8r8g8b8_4_4, DXGI_FORMAT_R8G8B8A8_UNORM, 8, 8, 1, + { + { a8r8g8b8_4_4_point_filter_8_8 }, + /* + * When scaling up by 2, linear and triangle filters behave + * the same. + */ + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_4_4_linear_filter_8_8, .todo = TRUE }, + }, + }, + { + 8, 8, 8, a8r8g8b8_8_8_8, DXGI_FORMAT_R8G8B8A8_UNORM, 4, 4, 4, + { + { a8r8g8b8_8_8_8_point_filter_4_4_4 }, + { a8r8g8b8_8_8_8_linear_filter_4_4_4, .todo = TRUE }, + { a8r8g8b8_8_8_8_triangle_filter_4_4_4, .todo = TRUE }, + { a8r8g8b8_8_8_8_box_filter_4_4_4, .todo = TRUE }, + }, + }, + { + 6, 6, 6, a8r8g8b8_6_6_6, DXGI_FORMAT_R8G8B8A8_UNORM, 3, 3, 3, + { + { a8r8g8b8_6_6_6_point_filter_3_3_3 }, + { a8r8g8b8_6_6_6_linear_filter_3_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_6_triangle_filter_3_3_3, .todo = TRUE }, + { a8r8g8b8_6_6_6_linear_filter_3_3_3, .todo = TRUE }, + }, + }, + }; + struct + { + DWORD magic; + struct dds_header header; + struct dds_header_dxt10 dxt10; + BYTE data[8192]; + } dds; + D3DX11_IMAGE_LOAD_INFO load_info; + const uint8_t *expected_dst; + struct resource_readback rb; + ID3D11Resource *resource; + ID3D11Device *device; + uint32_t src_pitch; + unsigned int i, j; + HRESULT hr; + + device = create_device(); + if (!device) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + CoInitialize(NULL); + + dds.magic = MAKEFOURCC('D','D','S',' '); + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + const unsigned int fmt_bpp = (get_bpp_from_format(tests[i].format) + 7) / 8; + unsigned int dds_size = sizeof(dds); + + winetest_push_context("Test %u", i); + + load_info = d3dx11_default_load_info; + load_info.Width = tests[i].dst_width; + load_info.Height = tests[i].dst_height; + load_info.Depth = tests[i].dst_depth; + load_info.MipLevels = 1; + + src_pitch = fmt_bpp * tests[i].src_width; + dds_size += fmt_bpp * tests[i].src_width * tests[i].src_height * tests[i].src_depth; + + if (tests[i].src_depth > 1) + { + set_dxt10_dds_header(&dds.header, DDS_DEPTH, tests[i].src_width, tests[i].src_height, tests[i].src_depth, + 1, src_pitch, 0, 0); + set_dds_header_dxt10(&dds.dxt10, tests[i].format, D3D11_RESOURCE_DIMENSION_TEXTURE3D, 0, 1, 0); + } + else + { + set_dxt10_dds_header(&dds.header, 0, tests[i].src_width, tests[i].src_height, 0, 1, src_pitch, 0, 0); + set_dds_header_dxt10(&dds.dxt10, tests[i].format, D3D11_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0); + } + memcpy(dds.data, tests[i].src_data, tests[i].src_width * tests[i].src_height * tests[i].src_depth * fmt_bpp); + + for (j = 0; j < ARRAY_SIZE(test_filters); ++j) + { + winetest_push_context("Filter %s", test_filters[j].name); + + load_info.Filter = load_info.MipFilter = test_filters[j].filter; + hr = D3DX11CreateTextureFromMemory(device, &dds, dds_size, &load_info, NULL, &resource, NULL); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + if (sizeof(void *) == 4 && tests[i].filter_expected[j].expected_dst_data_32) + expected_dst = tests[i].filter_expected[j].expected_dst_data_32; + else + expected_dst = tests[i].filter_expected[j].expected_dst_data; + + get_resource_readback(resource, 0, &rb); + todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(&rb, expected_dst, tests[i].dst_width, + tests[i].dst_height, tests[i].dst_depth, tests[i].format, 0); + release_resource_readback(&rb); + ID3D11Resource_Release(resource); + + winetest_pop_context(); + } + + winetest_pop_context(); + } + + CoUninitialize(); + ok(!ID3D11Device_Release(device), "Unexpected refcount.\n"); +} + static BOOL create_directory(const WCHAR *dir) { WCHAR path[MAX_PATH]; @@ -3528,4 +4606,5 @@ START_TEST(d3dx11) test_create_texture(); test_legacy_dds_header_image_info(); test_dxt10_dds_header_image_info(); + test_image_filters(); }
From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx10_43/tests/d3dx10.c | 7 +- dlls/d3dx11_43/tests/d3dx11.c | 7 +- dlls/d3dx9_36/d3dx_helpers.c | 141 ++++++++++++++++++++++++++++++++++ dlls/d3dx9_36/d3dx_helpers.h | 6 ++ dlls/d3dx9_36/tests/surface.c | 2 +- dlls/d3dx9_36/tests/texture.c | 8 +- dlls/d3dx9_36/tests/volume.c | 8 +- dlls/d3dx9_36/texture.c | 6 -- 8 files changed, 166 insertions(+), 19 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 67fff3e0f6f..3ea4499f20e 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -5423,6 +5423,7 @@ static void test_image_filters(void) const void *expected_dst_data; const void *expected_dst_data_32; BOOL todo; + uint32_t max_diff; } filter_expected[4]; } tests[] = @@ -5433,7 +5434,7 @@ static void test_image_filters(void) { a8r8g8b8_16_16_point_filter_8_8 }, { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, { a8r8g8b8_16_16_triangle_filter_8_8, a8r8g8b8_16_16_triangle_filter_8_8_32bit, .todo = TRUE }, - { a8r8g8b8_16_16_box_filter_8_8, .todo = TRUE }, + { a8r8g8b8_16_16_box_filter_8_8 }, }, }, { @@ -5504,7 +5505,7 @@ static void test_image_filters(void) { a8r8g8b8_8_8_8_point_filter_4_4_4 }, { a8r8g8b8_8_8_8_linear_filter_4_4_4, .todo = TRUE }, { a8r8g8b8_8_8_8_triangle_filter_4_4_4, .todo = TRUE }, - { a8r8g8b8_8_8_8_box_filter_4_4_4, .todo = TRUE }, + { a8r8g8b8_8_8_8_box_filter_4_4_4, .max_diff = 1 }, }, }, { @@ -5586,7 +5587,7 @@ static void test_image_filters(void)
get_resource_readback(resource, 0, &rb); todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(&rb, expected_dst, tests[i].dst_width, - tests[i].dst_height, tests[i].dst_depth, tests[i].format, 0); + tests[i].dst_height, tests[i].dst_depth, tests[i].format, tests[i].filter_expected[j].max_diff); release_resource_readback(&rb); ID3D10Resource_Release(resource);
diff --git a/dlls/d3dx11_43/tests/d3dx11.c b/dlls/d3dx11_43/tests/d3dx11.c index e1a72f51909..c441d732041 100644 --- a/dlls/d3dx11_43/tests/d3dx11.c +++ b/dlls/d3dx11_43/tests/d3dx11.c @@ -4258,6 +4258,7 @@ static void test_image_filters(void) const void *expected_dst_data; const void *expected_dst_data_32; BOOL todo; + uint32_t max_diff; } filter_expected[4]; } tests[] = @@ -4268,7 +4269,7 @@ static void test_image_filters(void) { a8r8g8b8_16_16_point_filter_8_8 }, { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, { a8r8g8b8_16_16_triangle_filter_8_8, a8r8g8b8_16_16_triangle_filter_8_8_32bit, .todo = TRUE }, - { a8r8g8b8_16_16_box_filter_8_8, .todo = TRUE }, + { a8r8g8b8_16_16_box_filter_8_8 }, }, }, { @@ -4339,7 +4340,7 @@ static void test_image_filters(void) { a8r8g8b8_8_8_8_point_filter_4_4_4 }, { a8r8g8b8_8_8_8_linear_filter_4_4_4, .todo = TRUE }, { a8r8g8b8_8_8_8_triangle_filter_4_4_4, .todo = TRUE }, - { a8r8g8b8_8_8_8_box_filter_4_4_4, .todo = TRUE }, + { a8r8g8b8_8_8_8_box_filter_4_4_4, .max_diff = 1 }, }, }, { @@ -4421,7 +4422,7 @@ static void test_image_filters(void)
get_resource_readback(resource, 0, &rb); todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(&rb, expected_dst, tests[i].dst_width, - tests[i].dst_height, tests[i].dst_depth, tests[i].format, 0); + tests[i].dst_height, tests[i].dst_depth, tests[i].format, tests[i].filter_expected[j].max_diff); release_resource_readback(&rb); ID3D11Resource_Release(resource);
diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 69a54ed4188..684bc50e5eb 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -467,6 +467,17 @@ uint32_t d3dx_get_max_mip_levels_for_size(uint32_t width, uint32_t height, uint3 return mip_levels; }
+static BOOL d3dx_size_is_half(struct volume *src, struct volume *dst) +{ + return (max(src->width / 2, 1) == dst->width) && (max(src->height / 2, 1) == dst->height) + && (max(src->depth / 2, 1) == dst->depth); +} + +static BOOL d3dx_size_is_pow2(struct volume *size) +{ + return is_pow2(size->width) && is_pow2(size->height) && is_pow2(size->depth); +} + static const char *debug_volume(const struct volume *volume) { if (!volume) @@ -2587,6 +2598,118 @@ static void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT s } }
+static void check_color_key(struct d3dx_color *color, const struct d3dx_color_key *color_key, + const struct pixel_format_desc *ck_format) +{ + struct d3dx_color tmp; + DWORD ck_pixel = 0; + unsigned int i; + + tmp = *color; + format_from_d3dx_color(ck_format, &tmp, (BYTE *)&ck_pixel); + for (i = 0; i < 4; ++i) + { + const uint8_t ck_channel = (ck_pixel >> (24 - (i * 8))) & 0xff; + + if ((ck_channel < color_key->color_key_min[i]) || (ck_channel > color_key->color_key_max[i])) + break; + } + + if (i == 4) + tmp.value.x = tmp.value.y = tmp.value.z = tmp.value.w = 0.0f; + + *color = tmp; +} + +static inline void vec4_add(struct vec4 *out, const struct vec4 *in) +{ + out->x += in->x; + out->y += in->y; + out->z += in->z; + out->w += in->w; +} + +static inline void vec4_scale(struct vec4 *out, const float scale) +{ + out->x *= scale; + out->y *= scale; + out->z *= scale; + out->w *= scale; +} + +static void box_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, + const struct volume *src_size, const struct pixel_format_desc *src_format, BYTE *dst, UINT dst_row_pitch, + UINT dst_slice_pitch, const struct volume *dst_size, const struct pixel_format_desc *dst_format, + const struct d3dx_color_key *color_key, const PALETTEENTRY *palette) +{ + /* Color keys are always represented in D3DFMT_A8R8G8B8 format. */ + const struct pixel_format_desc *ck_format = color_key ? get_d3dx_pixel_format_info(D3DX_PIXEL_FORMAT_B8G8R8A8_UNORM) : NULL; + struct argb_conversion_info conv_info, ck_conv_info; + struct d3dx_color color, tmp; + unsigned int i; + UINT x, y, z; + + TRACE("src %p, src_row_pitch %u, src_slice_pitch %u, src_size %p, src_format %p, dst %p, " + "dst_row_pitch %u, dst_slice_pitch %u, dst_size %p, dst_format %p, color_key %s, palette %p.\n", + src, src_row_pitch, src_slice_pitch, src_size, src_format, dst, dst_row_pitch, dst_slice_pitch, dst_size, + dst_format, debug_d3dx_color_key(color_key), palette); + + init_argb_conversion_info(src_format, dst_format, &conv_info); + + if (color_key) + init_argb_conversion_info(src_format, ck_format, &ck_conv_info); + + color.rgb_range = get_range_for_component_type(src_format->rgb_type); + color.a_range = get_range_for_component_type(src_format->a_type); + for (z = 0; z < src_size->depth; z += 2) + { + BYTE *dst_slice_ptr = dst + (z >> 1) * dst_slice_pitch; + const BYTE *src_slice_ptr = src + src_slice_pitch * z; + + for (y = 0; y < src_size->height; y += 2) + { + const BYTE *src_row_ptr = src_slice_ptr + src_row_pitch * y; + BYTE *dst_ptr = dst_slice_ptr + (y >> 1) * dst_row_pitch; + + for (x = 0; x < src_size->width; x += 2) + { + const BYTE *src_ptr = src_row_ptr + x * src_format->bytes_per_pixel; + + memset(&color.value, 0, sizeof(color.value)); + for (i = 0; i < (src_size->depth > 1 ? 2 : 1); ++i) + { + const BYTE *ptr = src_ptr + i * src_slice_pitch; + + format_to_d3dx_color(src_format, ptr, palette, &tmp); + if (color_key) + check_color_key(&tmp, color_key, ck_format); + vec4_add(&color.value, &tmp.value); + + format_to_d3dx_color(src_format, ptr + src_format->bytes_per_pixel, palette, &tmp); + if (color_key) + check_color_key(&tmp, color_key, ck_format); + vec4_add(&color.value, &tmp.value); + + ptr += src_row_pitch; + format_to_d3dx_color(src_format, ptr, palette, &tmp); + if (color_key) + check_color_key(&tmp, color_key, ck_format); + vec4_add(&color.value, &tmp.value); + + format_to_d3dx_color(src_format, ptr + src_format->bytes_per_pixel, palette, &tmp); + if (color_key) + check_color_key(&tmp, color_key, ck_format); + vec4_add(&color.value, &tmp.value); + } + + vec4_scale(&color.value, src_size->depth > 1 ? 0.125f : 0.25f); + format_from_d3dx_color(dst_format, &color, dst_ptr); + dst_ptr += dst_format->bytes_per_pixel; + } + } + } +} + static HRESULT d3dx_pixels_decompress(struct d3dx_pixels *pixels, const struct pixel_format_desc *desc, BOOL is_dst, void **out_memory, uint32_t *out_row_pitch, uint32_t *out_slice_pitch, const struct pixel_format_desc **out_desc) @@ -3046,6 +3169,18 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, return E_NOTIMPL; }
+ /* + * Check to see if we potentially need to change to linear or triangle + * filtering. + */ + if ((filter_flags & 0xf) == D3DX_FILTER_BOX) + { + if (d3dx_size_is_half(&src_size, &dst_size)) + filter_flags = !d3dx_size_is_pow2(&src_size) ? ((filter_flags & ~0xf) | D3DX_FILTER_LINEAR) : filter_flags; + else + filter_flags = (filter_flags & ~0xf) | D3DX_FILTER_TRIANGLE; + } + if (is_index_format(src_desc) && (src_desc->block_width > 1)) { uint32_t unpacked_row_pitch, unpacked_slice_pitch; @@ -3147,6 +3282,12 @@ HRESULT d3dx_load_pixels_from_pixels(struct d3dx_pixels *dst_pixels, (BYTE *)dst_pixels->data, dst_pixels->row_pitch, dst_pixels->slice_pitch, &dst_size, dst_desc, d3dx_ck, src_pixels->palette); } + else if ((filter_flags & 0xf) == D3DX_FILTER_BOX) + { + box_filter_argb_pixels(src_pixels->data, src_pixels->row_pitch, src_pixels->slice_pitch, &src_size, + src_desc, (BYTE *)dst_pixels->data, dst_pixels->row_pitch, dst_pixels->slice_pitch, &dst_size, + dst_desc, d3dx_ck, src_pixels->palette); + } else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */ { if ((filter_flags & 0xf) != D3DX_FILTER_POINT) diff --git a/dlls/d3dx9_36/d3dx_helpers.h b/dlls/d3dx9_36/d3dx_helpers.h index 16cadadc94b..d5523cab1ed 100644 --- a/dlls/d3dx9_36/d3dx_helpers.h +++ b/dlls/d3dx9_36/d3dx_helpers.h @@ -394,6 +394,12 @@ static inline BOOL is_conversion_to_supported(const struct pixel_format_desc *fo && !is_unknown_format(format); }
+/* Returns TRUE if num is a power of 2, FALSE if not, or if 0 */ +static inline BOOL is_pow2(UINT num) +{ + return !(num & (num - 1)); +} + HRESULT d3dx_validate_filter(uint32_t filter);
const struct pixel_format_desc *get_d3dx_pixel_format_info(enum d3dx_pixel_format_id format); diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 20f3866ded3..c72c4a01877 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -5172,7 +5172,7 @@ static void test_image_filters(void) { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, { a8r8g8b8_16_16_triangle_filter_8_8, a8r8g8b8_16_16_triangle_filter_8_8_32bit, .todo = TRUE }, /* Linear and box filters match. */ - { a8r8g8b8_16_16_linear_filter_8_8, .todo = TRUE }, + { a8r8g8b8_16_16_linear_filter_8_8 }, }, }, { diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index a87152fc2ac..74f8b2fc85e 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -1243,7 +1243,7 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
IDirect3DTexture9_LockRect(tex, 1, &lock_rect, NULL, D3DLOCK_READONLY); - todo_wine check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, a8r8g8b8_16_16_linear_filter_8_8, 8, 8, 1, + check_test_readback(lock_rect.pBits, lock_rect.Pitch, 0, a8r8g8b8_16_16_linear_filter_8_8, 8, 8, 1, D3DFMT_A8R8G8B8, 0); IDirect3DTexture9_UnlockRect(tex, 1); IDirect3DTexture9_Release(tex); @@ -1310,12 +1310,12 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) IDirect3DVolumeTexture9_LockBox(voltex, 1, &lock_box, NULL, D3DLOCK_READONLY); if (sizeof(void *) == 4) { - todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, - a8r8g8b8_8_8_8_box_filter_4_4_4_32bit, 4, 4, 4, D3DFMT_A8R8G8B8, 0); + check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + a8r8g8b8_8_8_8_box_filter_4_4_4_32bit, 4, 4, 4, D3DFMT_A8R8G8B8, 1); } else { - todo_wine check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, + check_test_readback(lock_box.pBits, lock_box.RowPitch, lock_box.SlicePitch, a8r8g8b8_8_8_8_linear_filter_4_4_4, 4, 4, 4, D3DFMT_A8R8G8B8, 0); } IDirect3DVolumeTexture9_UnlockBox(voltex, 1); diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index 9ed435e5edd..c0bde08c93a 100644 --- a/dlls/d3dx9_36/tests/volume.c +++ b/dlls/d3dx9_36/tests/volume.c @@ -684,6 +684,7 @@ static void test_image_filters(void) const void *expected_dst_data; const void *expected_dst_data_32; BOOL todo; + uint32_t max_diff; } filter_expected[4]; } tests[] = @@ -700,7 +701,10 @@ static void test_image_filters(void) /* Linear and box filters match on 64bit, but not 32bit. */ { a8r8g8b8_8_8_8_linear_filter_4_4_4, a8r8g8b8_8_8_8_box_filter_4_4_4_32bit, - .todo = TRUE +#ifndef _WIN64 + /* We match exactly on 64-bit, but not 32-bit. */ + .max_diff = 1 +#endif }, }, }, @@ -756,7 +760,7 @@ static void test_image_filters(void) IDirect3DVolume9_LockBox(volume, &locked_box, NULL, D3DLOCK_READONLY); todo_wine_if(tests[i].filter_expected[j].todo) check_test_readback(locked_box.pBits, locked_box.RowPitch, locked_box.SlicePitch, expected_dst, tests[i].dst_width, tests[i].dst_height, tests[i].dst_depth, - tests[i].format, 0); + tests[i].format, tests[i].filter_expected[j].max_diff); IDirect3DVolume9_UnlockBox(volume);
winetest_pop_context(); diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 0873b686497..799ff1e82ca 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -24,12 +24,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
-/* Returns TRUE if num is a power of 2, FALSE if not, or if 0 */ -static BOOL is_pow2(UINT num) -{ - return !(num & (num - 1)); -} - static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex, int face, UINT level, struct IDirect3DSurface9 **surf) {