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,0x8f, + 0x90,0x90,0x90,0x90,0x91,0x91,0x91,0x91,0x92,0x92,0x92,0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fa,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,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,0x9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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,0xa9,0xa9,0xaa,0xaa,0xaa,0xaa,0xab,0xab,0xab,0xab, + 0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x15,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,0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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(); }