/*
* Copyright (C) 2026 Linux Studio Plugins Project
* (C) 2026 Vladimir Sadovnikov
*
* This file is part of lsp-runtime-lib
* Created on: 25 янв. 2026 г.
*
* lsp-runtime-lib is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* lsp-runtime-lib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with lsp-runtime-lib. If not, see .
*/
#include
#include
#include
#include
namespace lsp
{
// Data for g1 testing
const uint8_t src_g1[] = { 0xaa, 0xaa };
const uint8_t dst_g1_to_g2_x10[] = { 0xcc, 0xcc, 0x0c };
const uint8_t dst_g1_to_g2_x15[] = { 0xcc, 0xcc, 0xcc, 0x0c };
const uint8_t dst_g1_to_a2_x9[] = { 0xcc, 0xcc, 0x00 };
const uint8_t dst_g1_to_a2_x15[] = { 0xcc, 0xcc, 0xcc, 0x0c };
const uint8_t dst_g1_to_g4_x10[] = { 0xf0, 0xf0, 0xf0, 0xf0, 0xf0 };
const uint8_t dst_g1_to_g4_x15[] = { 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00 };
const uint8_t dst_g1_to_a4_x9[] = { 0xf0, 0xf0, 0xf0, 0xf0, 0x00 };
const uint8_t dst_g1_to_a4_x15[] = { 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00 };
const uint8_t dst_g1_to_g8_x10[] = { 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff };
const uint8_t dst_g1_to_g8_x15[] = { 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00 };
const uint8_t dst_g1_to_a8_x9[] = { 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00 };
const uint8_t dst_g1_to_a8_x14[] = { 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff };
const uint8_t dst_g1_to_rgb888_x10[] = {
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff
};
const uint8_t dst_g1_to_rgb888_x15[] = {
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00
};
const uint8_t dst_g1_to_rgba8888_x10[] = {
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff
};
const uint8_t dst_g1_to_rgba8888_x15[] = {
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff
};
const uint8_t dst_g1_to_prgba8888_x10[] = {
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
};
const uint8_t dst_g1_to_prgba8888_x15[] = {
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00
};
// Data for a1 testing
const uint8_t src_a1[] = { 0x55, 0x55 };
const uint8_t dst_a1_to_g2_x10[] = { 0x33, 0x33, 0x03 };
const uint8_t dst_a1_to_g2_x15[] = { 0x33, 0x33, 0x33, 0x33 };
const uint8_t dst_a1_to_a2_x9[] = { 0x33, 0x33, 0x03 };
const uint8_t dst_a1_to_a2_x15[] = { 0x33, 0x33, 0x33, 0x33 };
const uint8_t dst_a1_to_g4_x10[] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f };
const uint8_t dst_a1_to_g4_x15[] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f };
const uint8_t dst_a1_to_a4_x9[] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f };
const uint8_t dst_a1_to_a4_x15[] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f };
const uint8_t dst_a1_to_g8_x10[] = { 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00 };
const uint8_t dst_a1_to_g8_x15[] = { 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff };
const uint8_t dst_a1_to_a8_x9[] = { 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff };
const uint8_t dst_a1_to_a8_x14[] = { 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00 };
const uint8_t dst_a1_to_rgb888_x10[] = {
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00
};
const uint8_t dst_a1_to_rgb888_x15[] = {
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff
};
const uint8_t dst_a1_to_rgba8888_x10[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
};
const uint8_t dst_a1_to_rgba8888_x15[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0xff
};
const uint8_t dst_a1_to_prgba8888_x10[] = {
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
};
const uint8_t dst_a1_to_prgba8888_x15[] = {
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff
};
// Data for g2 testing
const uint8_t src_g2[] = { 0xe4, 0xe4, 0xe4, 0xe4 };
const uint8_t dst_g2_to_g1_x10[] = { 0xcc, 0x00 };
const uint8_t dst_g2_to_g1_x15[] = { 0xcc, 0x4c };
const uint8_t dst_g2_to_a1_x9[] = { 0xcc, 0x00 };
const uint8_t dst_g2_to_a1_x15[] = { 0xcc, 0x4c };
const uint8_t dst_g2_to_g4_x10[] = { 0x50, 0xfa, 0x50, 0xfa, 0x50 };
const uint8_t dst_g2_to_g4_x15[] = { 0x50, 0xfa, 0x50, 0xfa, 0x50, 0xfa, 0x50, 0x0a };
const uint8_t dst_g2_to_a4_x9[] = { 0x50, 0xfa, 0x50, 0xfa, 0x00 };
const uint8_t dst_g2_to_a4_x15[] = { 0x50, 0xfa, 0x50, 0xfa, 0x50, 0xfa, 0x50, 0x0a };
const uint8_t dst_g2_to_g8_x10[] = { 0x00, 0x55, 0xaa, 0xff, 0x00, 0x55, 0xaa, 0xff, 0x00, 0x55 };
const uint8_t dst_g2_to_g8_x15[] = {
0x00, 0x55, 0xaa, 0xff, 0x00, 0x55, 0xaa, 0xff,
0x00, 0x55, 0xaa, 0xff, 0x00, 0x55, 0xaa
};
const uint8_t dst_g2_to_a8_x9[] = { 0x00, 0x55, 0xaa, 0xff, 0x00, 0x55, 0xaa, 0xff, 0x00 };
const uint8_t dst_g2_to_a8_x14[] = {
0x00, 0x55, 0xaa, 0xff, 0x00, 0x55, 0xaa, 0xff,
0x00, 0x55, 0xaa, 0xff, 0x00, 0x55
};
const uint8_t dst_g2_to_rgb888_x10[] = {
0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xaa, 0xaa,
0xaa, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x55,
0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x55, 0x55, 0x55
};
const uint8_t dst_g2_to_rgb888_x15[] = {
0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xaa, 0xaa,
0xaa, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x55,
0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0xaa, 0xaa,
0xaa, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x55,
0x55, 0x55, 0xaa, 0xaa, 0xaa
};
const uint8_t dst_g2_to_rgba8888_x10[] = {
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff
};
const uint8_t dst_g2_to_rgba8888_x15[] = {
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff
};
const uint8_t dst_g2_to_prgba8888_x10[] = {
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff
};
const uint8_t dst_g2_to_prgba8888_x15[] = {
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55, 0xff,
0xaa, 0xaa, 0xaa, 0xff
};
// Data for a2 testing
const uint8_t src_a2[] = { 0xd8, 0xd8, 0xd8, 0xd8 };
const uint8_t dst_a2_to_g1_x10[] = { 0xaa, 0x02 };
const uint8_t dst_a2_to_g1_x15[] = { 0xaa, 0x2a };
const uint8_t dst_a2_to_a1_x9[] = { 0xaa, 0x00 };
const uint8_t dst_a2_to_a1_x15[] = { 0xaa, 0x2a };
const uint8_t dst_a2_to_g4_x10[] = { 0xa0, 0xf5, 0xa0, 0xf5, 0xa0 };
const uint8_t dst_a2_to_g4_x15[] = { 0xa0, 0xf5, 0xa0, 0xf5, 0xa0, 0xf5, 0xa0, 0x05 };
const uint8_t dst_a2_to_a4_x9[] = { 0xa0, 0xf5, 0xa0, 0xf5, 0x00 };
const uint8_t dst_a2_to_a4_x15[] = { 0xa0, 0xf5, 0xa0, 0xf5, 0xa0, 0xf5, 0xa0, 0x05 };
const uint8_t dst_a2_to_g8_x10[] = { 0x00, 0xaa, 0x55, 0xff, 0x00, 0xaa, 0x55, 0xff, 0x00, 0xaa };
const uint8_t dst_a2_to_g8_x15[] = {
0x00, 0xaa, 0x55, 0xff, 0x00, 0xaa, 0x55, 0xff,
0x00, 0xaa, 0x55, 0xff, 0x00, 0xaa, 0x55
};
const uint8_t dst_a2_to_a8_x9[] = { 0x00, 0xaa, 0x55, 0xff, 0x00, 0xaa, 0x55, 0xff, 0x00 };
const uint8_t dst_a2_to_a8_x14[] = {
0x00, 0xaa, 0x55, 0xff, 0x00, 0xaa, 0x55, 0xff,
0x00, 0xaa, 0x55, 0xff, 0x00, 0xaa
};
const uint8_t dst_a2_to_rgb888_x10[] = {
0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0x55, 0x55,
0x55, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xaa,
0xaa, 0xaa, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa
};
const uint8_t dst_a2_to_rgb888_x15[] = {
0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0x55, 0x55,
0x55, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xaa,
0xaa, 0xaa, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0x55, 0x55,
0x55, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xaa,
0xaa, 0xaa, 0x55, 0x55, 0x55
};
const uint8_t dst_a2_to_rgba8888_x10[] = {
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xaa,
0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xaa,
0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xaa
};
const uint8_t dst_a2_to_rgba8888_x15[] = {
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xaa,
0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xaa,
0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xaa,
0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xaa,
0xff, 0xff, 0xff, 0x55
};
const uint8_t dst_a2_to_prgba8888_x10[] = {
0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa,
0x55, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa,
0x55, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa
};
const uint8_t dst_a2_to_prgba8888_x15[] = {
0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa,
0x55, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa,
0x55, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa,
0x55, 0x55, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa,
0x55, 0x55, 0x55, 0x55
};
// Data for g4 testing
const uint8_t src_g4[] = { 0x81, 0x92, 0xa3, 0xb4, 0xc5, 0xd6, 0xe7, 0xf1 };
const uint8_t dst_g4_to_g1_x10[] = { 0xaa, 0x02 };
const uint8_t dst_g4_to_g1_x15[] = { 0xaa, 0x2a };
const uint8_t dst_g4_to_a1_x9[] = { 0xaa, 0x00 };
const uint8_t dst_g4_to_a1_x15[] = { 0xaa, 0x2a };
const uint8_t dst_g4_to_g2_x10[] = { 0x88, 0x98, 0x0d };
const uint8_t dst_g4_to_g2_x15[] = { 0x88, 0x98, 0xdd, 0x0d };
const uint8_t dst_g4_to_a2_x9[] = { 0x88, 0x98, 0x01 };
const uint8_t dst_g4_to_a2_x13[] = { 0x88, 0x98, 0xdd, 0x01 };
const uint8_t dst_g4_to_g8_x10[] = { 0x11, 0x88, 0x22, 0x99, 0x33, 0xaa, 0x44, 0xbb, 0x55, 0xcc };
const uint8_t dst_g4_to_g8_x15[] = {
0x11, 0x88, 0x22, 0x99, 0x33, 0xaa, 0x44, 0xbb,
0x55, 0xcc, 0x66, 0xdd, 0x77, 0xee, 0x11
};
const uint8_t dst_g4_to_a8_x9[] = { 0x11, 0x88, 0x22, 0x99, 0x33, 0xaa, 0x44, 0xbb, 0x55 };
const uint8_t dst_g4_to_a8_x13[] = {
0x11, 0x88, 0x22, 0x99, 0x33, 0xaa, 0x44, 0xbb,
0x55, 0xcc, 0x66, 0xdd, 0x77
};
const uint8_t dst_g4_to_rgb888_x10[] = {
0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x22, 0x22,
0x22, 0x99, 0x99, 0x99, 0x33, 0x33, 0x33, 0xaa,
0xaa, 0xaa, 0x44, 0x44, 0x44, 0xbb, 0xbb, 0xbb,
0x55, 0x55, 0x55, 0xcc, 0xcc, 0xcc
};
const uint8_t dst_g4_to_rgb888_x15[] = {
0x11, 0x11, 0x11, 0x88, 0x88, 0x88, 0x22, 0x22,
0x22, 0x99, 0x99, 0x99, 0x33, 0x33, 0x33, 0xaa,
0xaa, 0xaa, 0x44, 0x44, 0x44, 0xbb, 0xbb, 0xbb,
0x55, 0x55, 0x55, 0xcc, 0xcc, 0xcc, 0x66, 0x66,
0x66, 0xdd, 0xdd, 0xdd, 0x77, 0x77, 0x77, 0xee,
0xee, 0xee, 0x11, 0x11, 0x11
};
const uint8_t dst_g4_to_rgba8888_x10[] = {
0x11, 0x11, 0x11, 0xff, 0x88, 0x88, 0x88, 0xff,
0x22, 0x22, 0x22, 0xff, 0x99, 0x99, 0x99, 0xff,
0x33, 0x33, 0x33, 0xff, 0xaa, 0xaa, 0xaa, 0xff,
0x44, 0x44, 0x44, 0xff, 0xbb, 0xbb, 0xbb, 0xff,
0x55, 0x55, 0x55, 0xff, 0xcc, 0xcc, 0xcc, 0xff
};
const uint8_t dst_g4_to_rgba8888_x15[] = {
0x11, 0x11, 0x11, 0xff, 0x88, 0x88, 0x88, 0xff,
0x22, 0x22, 0x22, 0xff, 0x99, 0x99, 0x99, 0xff,
0x33, 0x33, 0x33, 0xff, 0xaa, 0xaa, 0xaa, 0xff,
0x44, 0x44, 0x44, 0xff, 0xbb, 0xbb, 0xbb, 0xff,
0x55, 0x55, 0x55, 0xff, 0xcc, 0xcc, 0xcc, 0xff,
0x66, 0x66, 0x66, 0xff, 0xdd, 0xdd, 0xdd, 0xff,
0x77, 0x77, 0x77, 0xff, 0xee, 0xee, 0xee, 0xff,
0x11, 0x11, 0x11, 0xff
};
const uint8_t dst_g4_to_prgba8888_x10[] = {
0x11, 0x11, 0x11, 0xff, 0x88, 0x88, 0x88, 0xff,
0x22, 0x22, 0x22, 0xff, 0x99, 0x99, 0x99, 0xff,
0x33, 0x33, 0x33, 0xff, 0xaa, 0xaa, 0xaa, 0xff,
0x44, 0x44, 0x44, 0xff, 0xbb, 0xbb, 0xbb, 0xff,
0x55, 0x55, 0x55, 0xff, 0xcc, 0xcc, 0xcc, 0xff
};
const uint8_t dst_g4_to_prgba8888_x15[] = {
0x11, 0x11, 0x11, 0xff, 0x88, 0x88, 0x88, 0xff,
0x22, 0x22, 0x22, 0xff, 0x99, 0x99, 0x99, 0xff,
0x33, 0x33, 0x33, 0xff, 0xaa, 0xaa, 0xaa, 0xff,
0x44, 0x44, 0x44, 0xff, 0xbb, 0xbb, 0xbb, 0xff,
0x55, 0x55, 0x55, 0xff, 0xcc, 0xcc, 0xcc, 0xff,
0x66, 0x66, 0x66, 0xff, 0xdd, 0xdd, 0xdd, 0xff,
0x77, 0x77, 0x77, 0xff, 0xee, 0xee, 0xee, 0xff,
0x11, 0x11, 0x11, 0xff
};
// Data for a4 testing
const uint8_t src_a4[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x7e, 0x1f };
const uint8_t dst_a4_to_g1_x10[] = { 0x55, 0x01 };
const uint8_t dst_a4_to_g1_x15[] = { 0x55, 0x55 };
const uint8_t dst_a4_to_a1_x9[] = { 0x55, 0x01 };
const uint8_t dst_a4_to_a1_x14[] = { 0x55, 0x15 };
const uint8_t dst_a4_to_g2_x10[] = { 0x22, 0x62, 0x07 };
const uint8_t dst_a4_to_g2_x15[] = { 0x22, 0x62, 0x77, 0x37 };
const uint8_t dst_a4_to_a2_x9[] = { 0x22, 0x62, 0x03 };
const uint8_t dst_a4_to_a2_x13[] = { 0x22, 0x62, 0x77, 0x03 };
const uint8_t dst_a4_to_g8_x10[] = { 0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44, 0xcc, 0x55 };
const uint8_t dst_a4_to_g8_x15[] = {
0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44,
0xcc, 0x55, 0xdd, 0x66, 0xee, 0x77, 0xff
};
const uint8_t dst_a4_to_a8_x9[] = { 0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44, 0xcc };
const uint8_t dst_a4_to_a8_x13[] = {
0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44,
0xcc, 0x55, 0xdd, 0x66, 0xee
};
const uint8_t dst_a4_to_rgb888_x10[] = {
0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x99, 0x99,
0x99, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0x33,
0x33, 0x33, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55
};
const uint8_t dst_a4_to_rgb888_x15[] = {
0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x99, 0x99,
0x99, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0x33,
0x33, 0x33, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0xdd, 0xdd,
0xdd, 0x66, 0x66, 0x66, 0xee, 0xee, 0xee, 0x77,
0x77, 0x77, 0xff, 0xff, 0xff
};
const uint8_t dst_a4_to_rgba8888_x10[] = {
0xff, 0xff, 0xff, 0x88, 0xff, 0xff, 0xff, 0x11,
0xff, 0xff, 0xff, 0x99, 0xff, 0xff, 0xff, 0x22,
0xff, 0xff, 0xff, 0xaa, 0xff, 0xff, 0xff, 0x33,
0xff, 0xff, 0xff, 0xbb, 0xff, 0xff, 0xff, 0x44,
0xff, 0xff, 0xff, 0xcc, 0xff, 0xff, 0xff, 0x55
};
const uint8_t dst_a4_to_rgba8888_x15[] = {
0xff, 0xff, 0xff, 0x88, 0xff, 0xff, 0xff, 0x11,
0xff, 0xff, 0xff, 0x99, 0xff, 0xff, 0xff, 0x22,
0xff, 0xff, 0xff, 0xaa, 0xff, 0xff, 0xff, 0x33,
0xff, 0xff, 0xff, 0xbb, 0xff, 0xff, 0xff, 0x44,
0xff, 0xff, 0xff, 0xcc, 0xff, 0xff, 0xff, 0x55,
0xff, 0xff, 0xff, 0xdd, 0xff, 0xff, 0xff, 0x66,
0xff, 0xff, 0xff, 0xee, 0xff, 0xff, 0xff, 0x77,
0xff, 0xff, 0xff, 0xff
};
const uint8_t dst_a4_to_prgba8888_x10[] = {
0x88, 0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x11,
0x99, 0x99, 0x99, 0x99, 0x22, 0x22, 0x22, 0x22,
0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x33, 0x33,
0xbb, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55
};
const uint8_t dst_a4_to_prgba8888_x15[] = {
0x88, 0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x11,
0x99, 0x99, 0x99, 0x99, 0x22, 0x22, 0x22, 0x22,
0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x33, 0x33,
0xbb, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55,
0xdd, 0xdd, 0xdd, 0xdd, 0x66, 0x66, 0x66, 0x66,
0xee, 0xee, 0xee, 0xee, 0x77, 0x77, 0x77, 0x77,
0xff, 0xff, 0xff, 0xff
};
// Data for g8 testing
const uint8_t src_g8[] = { 0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44, 0xcc, 0x55, 0xdd, 0x55, 0xee, 0x66, 0xff, 0x77 };
const uint8_t dst_g8_to_g1_x10[] = { 0x55, 0x01 };
const uint8_t dst_g8_to_g1_x15[] = { 0x55, 0x55 };
const uint8_t dst_g8_to_a1_x9[] = { 0x55, 0x01 };
const uint8_t dst_g8_to_a1_x15[] = { 0x55, 0x55 };
const uint8_t dst_g8_to_g2_x10[] = { 0x22, 0x62, 0x07};
const uint8_t dst_g8_to_g2_x15[] = { 0x22, 0x62, 0x77, 0x37 };
const uint8_t dst_g8_to_a2_x9[] = { 0x22, 0x62, 0x03 };
const uint8_t dst_g8_to_a2_x13[] = { 0x22, 0x62, 0x77, 0x03 };
const uint8_t dst_g8_to_g4_x10[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c };
const uint8_t dst_g8_to_g4_x15[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x5d, 0x6e, 0x0f };
const uint8_t dst_g8_to_a4_x9[] = { 0x18, 0x29, 0x3a, 0x4b, 0x0c };
const uint8_t dst_g8_to_a4_x13[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x5d, 0x0e };
const uint8_t dst_g8_to_rgb888_x10[] = {
0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x99, 0x99,
0x99, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0x33,
0x33, 0x33, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55
};
const uint8_t dst_g8_to_rgb888_x15[] = {
0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x99, 0x99,
0x99, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0x33,
0x33, 0x33, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0xdd, 0xdd,
0xdd, 0x55, 0x55, 0x55, 0xee, 0xee, 0xee, 0x66,
0x66, 0x66, 0xff, 0xff, 0xff
};
const uint8_t dst_g8_to_rgba8888_x10[] = {
0x88, 0x88, 0x88, 0xff, 0x11, 0x11, 0x11, 0xff,
0x99, 0x99, 0x99, 0xff, 0x22, 0x22, 0x22, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0x33, 0x33, 0x33, 0xff,
0xbb, 0xbb, 0xbb, 0xff, 0x44, 0x44, 0x44, 0xff,
0xcc, 0xcc, 0xcc, 0xff, 0x55, 0x55, 0x55, 0xff
};
const uint8_t dst_g8_to_rgba8888_x15[] = {
0x88, 0x88, 0x88, 0xff, 0x11, 0x11, 0x11, 0xff,
0x99, 0x99, 0x99, 0xff, 0x22, 0x22, 0x22, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0x33, 0x33, 0x33, 0xff,
0xbb, 0xbb, 0xbb, 0xff, 0x44, 0x44, 0x44, 0xff,
0xcc, 0xcc, 0xcc, 0xff, 0x55, 0x55, 0x55, 0xff,
0xdd, 0xdd, 0xdd, 0xff, 0x55, 0x55, 0x55, 0xff,
0xee, 0xee, 0xee, 0xff, 0x66, 0x66, 0x66, 0xff,
0xff, 0xff, 0xff, 0xff
};
const uint8_t dst_g8_to_prgba8888_x10[] = {
0x88, 0x88, 0x88, 0xff, 0x11, 0x11, 0x11, 0xff,
0x99, 0x99, 0x99, 0xff, 0x22, 0x22, 0x22, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0x33, 0x33, 0x33, 0xff,
0xbb, 0xbb, 0xbb, 0xff, 0x44, 0x44, 0x44, 0xff,
0xcc, 0xcc, 0xcc, 0xff, 0x55, 0x55, 0x55, 0xff
};
const uint8_t dst_g8_to_prgba8888_x15[] = {
0x88, 0x88, 0x88, 0xff, 0x11, 0x11, 0x11, 0xff,
0x99, 0x99, 0x99, 0xff, 0x22, 0x22, 0x22, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0x33, 0x33, 0x33, 0xff,
0xbb, 0xbb, 0xbb, 0xff, 0x44, 0x44, 0x44, 0xff,
0xcc, 0xcc, 0xcc, 0xff, 0x55, 0x55, 0x55, 0xff,
0xdd, 0xdd, 0xdd, 0xff, 0x55, 0x55, 0x55, 0xff,
0xee, 0xee, 0xee, 0xff, 0x66, 0x66, 0x66, 0xff,
0xff, 0xff, 0xff, 0xff
};
// Data for a8 testing
const uint8_t src_a8[] = { 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44, 0xcc, 0x55, 0xdd, 0x55, 0xee, 0x66, 0xff, 0x77, 0x88 };
const uint8_t dst_a8_to_g1_x10[] = { 0xaa, 0x02 };
const uint8_t dst_a8_to_g1_x15[] = { 0xaa, 0x2a };
const uint8_t dst_a8_to_a1_x9[] = { 0xaa, 0x00 };
const uint8_t dst_a8_to_a1_x15[] = { 0xaa, 0x2a };
const uint8_t dst_a8_to_g2_x10[] = { 0x88, 0xd8, 0x0d };
const uint8_t dst_a8_to_g2_x15[] = { 0x88, 0xd8, 0xdd, 0x1d };
const uint8_t dst_a8_to_a2_x9[] = { 0x88, 0xd8, 0x01 };
const uint8_t dst_a8_to_a2_x13[] = { 0x88, 0xd8, 0xdd, 0x01 };
const uint8_t dst_a8_to_g4_x10[] = { 0x91, 0xa2, 0xb3, 0xc4, 0xd5 };
const uint8_t dst_a8_to_g4_x15[] = { 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe5, 0xf6, 0x07 };
const uint8_t dst_a8_to_a4_x9[] = { 0x91, 0xa2, 0xb3, 0xc4, 0x05 };
const uint8_t dst_a8_to_a4_x13[] = { 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe5, 0x06 };
const uint8_t dst_a8_to_rgb888_x10[] = {
0x11, 0x11, 0x11, 0x99, 0x99, 0x99, 0x22, 0x22,
0x22, 0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x33, 0xbb,
0xbb, 0xbb, 0x44, 0x44, 0x44, 0xcc, 0xcc, 0xcc,
0x55, 0x55, 0x55, 0xdd, 0xdd, 0xdd
};
const uint8_t dst_a8_to_rgb888_x15[] = {
0x11, 0x11, 0x11, 0x99, 0x99, 0x99, 0x22, 0x22,
0x22, 0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x33, 0xbb,
0xbb, 0xbb, 0x44, 0x44, 0x44, 0xcc, 0xcc, 0xcc,
0x55, 0x55, 0x55, 0xdd, 0xdd, 0xdd, 0x55, 0x55,
0x55, 0xee, 0xee, 0xee, 0x66, 0x66, 0x66, 0xff,
0xff, 0xff, 0x77, 0x77, 0x77
};
const uint8_t dst_a8_to_rgba8888_x10[] = {
0xff, 0xff, 0xff, 0x11, 0xff, 0xff, 0xff, 0x99,
0xff, 0xff, 0xff, 0x22, 0xff, 0xff, 0xff, 0xaa,
0xff, 0xff, 0xff, 0x33, 0xff, 0xff, 0xff, 0xbb,
0xff, 0xff, 0xff, 0x44, 0xff, 0xff, 0xff, 0xcc,
0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff, 0xdd
};
const uint8_t dst_a8_to_rgba8888_x15[] = {
0xff, 0xff, 0xff, 0x11, 0xff, 0xff, 0xff, 0x99,
0xff, 0xff, 0xff, 0x22, 0xff, 0xff, 0xff, 0xaa,
0xff, 0xff, 0xff, 0x33, 0xff, 0xff, 0xff, 0xbb,
0xff, 0xff, 0xff, 0x44, 0xff, 0xff, 0xff, 0xcc,
0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff, 0xdd,
0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff, 0xee,
0xff, 0xff, 0xff, 0x66, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x77
};
const uint8_t dst_a8_to_prgba8888_x10[] = {
0x11, 0x11, 0x11, 0x11, 0x99, 0x99, 0x99, 0x99,
0x22, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0xaa,
0x33, 0x33, 0x33, 0x33, 0xbb, 0xbb, 0xbb, 0xbb,
0x44, 0x44, 0x44, 0x44, 0xcc, 0xcc, 0xcc, 0xcc,
0x55, 0x55, 0x55, 0x55, 0xdd, 0xdd, 0xdd, 0xdd
};
const uint8_t dst_a8_to_prgba8888_x15[] = {
0x11, 0x11, 0x11, 0x11, 0x99, 0x99, 0x99, 0x99,
0x22, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0xaa,
0x33, 0x33, 0x33, 0x33, 0xbb, 0xbb, 0xbb, 0xbb,
0x44, 0x44, 0x44, 0x44, 0xcc, 0xcc, 0xcc, 0xcc,
0x55, 0x55, 0x55, 0x55, 0xdd, 0xdd, 0xdd, 0xdd,
0x55, 0x55, 0x55, 0x55, 0xee, 0xee, 0xee, 0xee,
0x66, 0x66, 0x66, 0x66, 0xff, 0xff, 0xff, 0xff,
0x77, 0x77, 0x77, 0x77
};
// Data for rgb888 testing
const uint8_t src_rgb888[] = {
0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x99, 0x99,
0x99, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0x33,
0x33, 0x33, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0xdd, 0xdd,
0xdd, 0x66, 0x66, 0x66, 0xee, 0xee, 0xee, 0x77,
0x77, 0x77, 0xff, 0xff, 0xff, 0x77, 0x77, 0x77
};
const uint8_t dst_rgb888_to_g1_x10[] = { 0x55, 0x01 };
const uint8_t dst_rgb888_to_g1_x15[] = { 0x55, 0x55 };
const uint8_t dst_rgb888_to_a1_x9[] = { 0x55, 0x01 };
const uint8_t dst_rgb888_to_a1_x15[] = { 0x55, 0x55 };
const uint8_t dst_rgb888_to_g2_x10[] = { 0x22, 0x62, 0x07};
const uint8_t dst_rgb888_to_g2_x15[] = { 0x22, 0x62, 0x77, 0x37 };
const uint8_t dst_rgb888_to_a2_x9[] = { 0x22, 0x62, 0x03 };
const uint8_t dst_rgb888_to_a2_x13[] = { 0x22, 0x62, 0x77, 0x03 };
const uint8_t dst_rgb888_to_g4_x10[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c };
const uint8_t dst_rgb888_to_g4_x15[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x7e, 0x0f };
const uint8_t dst_rgb888_to_a4_x9[] = { 0x18, 0x29, 0x3a, 0x4b, 0x0c };
const uint8_t dst_rgb888_to_a4_x13[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x0e };
const uint8_t dst_rgb888_to_g8_x10[] = {
0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44,
0xcc, 0x55
};
const uint8_t dst_rgb888_to_g8_x15[] = {
0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44,
0xcc, 0x55, 0xdd, 0x66, 0xee, 0x77, 0xff
};
const uint8_t dst_rgb888_to_a8_x9[] = {
0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44,
0xcc
};
const uint8_t dst_rgb888_to_a8_x13[] = {
0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44,
0xcc, 0x55, 0xdd, 0x66, 0xee
};
const uint8_t dst_rgb888_to_rgba8888_x10[] = {
0x88, 0x88, 0x88, 0xff, 0x11, 0x11, 0x11, 0xff,
0x99, 0x99, 0x99, 0xff, 0x22, 0x22, 0x22, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0x33, 0x33, 0x33, 0xff,
0xbb, 0xbb, 0xbb, 0xff, 0x44, 0x44, 0x44, 0xff,
0xcc, 0xcc, 0xcc, 0xff, 0x55, 0x55, 0x55, 0xff
};
const uint8_t dst_rgb888_to_rgba8888_x15[] = {
0x88, 0x88, 0x88, 0xff, 0x11, 0x11, 0x11, 0xff,
0x99, 0x99, 0x99, 0xff, 0x22, 0x22, 0x22, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0x33, 0x33, 0x33, 0xff,
0xbb, 0xbb, 0xbb, 0xff, 0x44, 0x44, 0x44, 0xff,
0xcc, 0xcc, 0xcc, 0xff, 0x55, 0x55, 0x55, 0xff,
0xdd, 0xdd, 0xdd, 0xff, 0x66, 0x66, 0x66, 0xff,
0xee, 0xee, 0xee, 0xff, 0x77, 0x77, 0x77, 0xff,
0xff, 0xff, 0xff, 0xff
};
const uint8_t dst_rgb888_to_prgba8888_x10[] = {
0x88, 0x88, 0x88, 0xff, 0x11, 0x11, 0x11, 0xff,
0x99, 0x99, 0x99, 0xff, 0x22, 0x22, 0x22, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0x33, 0x33, 0x33, 0xff,
0xbb, 0xbb, 0xbb, 0xff, 0x44, 0x44, 0x44, 0xff,
0xcc, 0xcc, 0xcc, 0xff, 0x55, 0x55, 0x55, 0xff
};
const uint8_t dst_rgb888_to_prgba8888_x15[] = {
0x88, 0x88, 0x88, 0xff, 0x11, 0x11, 0x11, 0xff,
0x99, 0x99, 0x99, 0xff, 0x22, 0x22, 0x22, 0xff,
0xaa, 0xaa, 0xaa, 0xff, 0x33, 0x33, 0x33, 0xff,
0xbb, 0xbb, 0xbb, 0xff, 0x44, 0x44, 0x44, 0xff,
0xcc, 0xcc, 0xcc, 0xff, 0x55, 0x55, 0x55, 0xff,
0xdd, 0xdd, 0xdd, 0xff, 0x66, 0x66, 0x66, 0xff,
0xee, 0xee, 0xee, 0xff, 0x77, 0x77, 0x77, 0xff,
0xff, 0xff, 0xff, 0xff
};
// Data for rgba8888 testing
const uint8_t src_rgba8888[] = {
0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x11, 0x88,
0x99, 0x99, 0x99, 0x22, 0x22, 0x22, 0x22, 0x99,
0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x33, 0x33, 0xaa,
0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44, 0x44, 0xbb,
0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x55, 0xcc,
0xdd, 0xdd, 0xdd, 0x66, 0x66, 0x66, 0x66, 0xdd,
0xee, 0xee, 0xee, 0x77, 0x77, 0x77, 0x77, 0xee,
0xff, 0xff, 0xff, 0x11, 0x11, 0x11, 0x11, 0xff,
};
const uint8_t dst_rgba8888_to_g1_x10[] = { 0x55, 0x01 };
const uint8_t dst_rgba8888_to_g1_x15[] = { 0x55, 0x55 };
const uint8_t dst_rgba8888_to_a1_x9[] = { 0xaa, 0x00 };
const uint8_t dst_rgba8888_to_a1_x15[] = { 0xaa, 0x2a };
const uint8_t dst_rgba8888_to_g2_x10[] = { 0x22, 0x62, 0x07};
const uint8_t dst_rgba8888_to_g2_x15[] = { 0x22, 0x62, 0x77, 0x37 };
const uint8_t dst_rgba8888_to_a2_x9[] = { 0x88, 0x98, 0x01 };
const uint8_t dst_rgba8888_to_a2_x13[] = { 0x88, 0x98, 0xdd, 0x01 };
const uint8_t dst_rgba8888_to_g4_x10[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c };
const uint8_t dst_rgba8888_to_g4_x15[] = { 0x18, 0x29, 0x3a, 0x4b, 0x5c, 0x6d, 0x7e, 0x0f };
const uint8_t dst_rgba8888_to_a4_x9[] = { 0x81, 0x92, 0xa3, 0xb4, 0x05 };
const uint8_t dst_rgba8888_to_a4_x13[] = { 0x81, 0x92, 0xa3, 0xb4, 0xc5, 0xd6, 0x07 };
const uint8_t dst_rgba8888_to_g8_x10[] = {
0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44,
0xcc, 0x55
};
const uint8_t dst_rgba8888_to_g8_x15[] = {
0x88, 0x11, 0x99, 0x22, 0xaa, 0x33, 0xbb, 0x44,
0xcc, 0x55, 0xdd, 0x66, 0xee, 0x77, 0xff
};
const uint8_t dst_rgba8888_to_a8_x9[] = {
0x11, 0x88, 0x22, 0x99, 0x33, 0xaa, 0x44, 0xbb,
0x55
};
const uint8_t dst_rgba8888_to_a8_x13[] = {
0x11, 0x88, 0x22, 0x99, 0x33, 0xaa, 0x44, 0xbb,
0x55, 0xcc, 0x66, 0xdd, 0x77
};
const uint8_t dst_rgba8888_to_rgb888_x15[] = {
0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x99, 0x99,
0x99, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0x33,
0x33, 0x33, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0xdd, 0xdd,
0xdd, 0x66, 0x66, 0x66, 0xee, 0xee, 0xee, 0x77,
0x77, 0x77, 0xff, 0xff, 0xff
};
const uint8_t dst_rgba8888_to_rgb888_x10[] = {
0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x99, 0x99,
0x99, 0x22, 0x22, 0x22, 0xaa, 0xaa, 0xaa, 0x33,
0x33, 0x33, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44,
0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55
};
const uint8_t dst_rgba8888_to_prgba8888_x10[] = {
0x09, 0x09, 0x09, 0x11, 0x09, 0x09, 0x09, 0x88,
0x14, 0x14, 0x14, 0x22, 0x14, 0x14, 0x14, 0x99,
0x22, 0x22, 0x22, 0x33, 0x22, 0x22, 0x22, 0xaa,
0x31, 0x31, 0x31, 0x44, 0x31, 0x31, 0x31, 0xbb,
0x44, 0x44, 0x44, 0x55, 0x44, 0x44, 0x44, 0xcc
};
const uint8_t dst_rgba8888_to_prgba8888_x15[] = {
0x09, 0x09, 0x09, 0x11, 0x09, 0x09, 0x09, 0x88,
0x14, 0x14, 0x14, 0x22, 0x14, 0x14, 0x14, 0x99,
0x22, 0x22, 0x22, 0x33, 0x22, 0x22, 0x22, 0xaa,
0x31, 0x31, 0x31, 0x44, 0x31, 0x31, 0x31, 0xbb,
0x44, 0x44, 0x44, 0x55, 0x44, 0x44, 0x44, 0xcc,
0x58, 0x58, 0x58, 0x66, 0x58, 0x58, 0x58, 0xdd,
0x6f, 0x6f, 0x6f, 0x77, 0x6f, 0x6f, 0x6f, 0xee,
0x11, 0x11, 0x11, 0x11
};
// Data for prgba8888 testing
const uint8_t src_prgba8888[] = {
0x88, 0x88, 0x88, 0x88, 0x11, 0x11, 0x11, 0x00,
0x99, 0x99, 0x99, 0x99, 0x22, 0x22, 0x22, 0x00,
0xaa, 0xaa, 0xaa, 0xaa, 0x33, 0x33, 0x33, 0x00,
0xbb, 0xbb, 0xbb, 0xbb, 0x44, 0x44, 0x44, 0x00,
0xcc, 0xcc, 0xcc, 0xcc, 0x55, 0x55, 0x55, 0x00,
0xdd, 0xdd, 0xdd, 0xdd, 0x66, 0x66, 0x66, 0x00,
0xee, 0xee, 0xee, 0xee, 0x77, 0x77, 0x77, 0x00,
0xff, 0xff, 0xff, 0xff, 0x11, 0x11, 0x11, 0x00
};
const uint8_t dst_prgba8888_to_g1_x10[] = { 0x55, 0x01 };
const uint8_t dst_prgba8888_to_g1_x15[] = { 0x55, 0x55 };
const uint8_t dst_prgba8888_to_a1_x9[] = { 0x55, 0x01 };
const uint8_t dst_prgba8888_to_a1_x15[] = { 0x55, 0x55 };
const uint8_t dst_prgba8888_to_g2_x10[] = { 0x33, 0x33, 0x03 };
const uint8_t dst_prgba8888_to_g2_x15[] = { 0x33, 0x33, 0x33, 0x33 };
const uint8_t dst_prgba8888_to_a2_x9[] = { 0x22, 0x22, 0x03 };
const uint8_t dst_prgba8888_to_a2_x13[] = { 0x22, 0x22, 0x33, 0x03 };
const uint8_t dst_prgba8888_to_g4_x10[] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f };
const uint8_t dst_prgba8888_to_g4_x15[] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f };
const uint8_t dst_prgba8888_to_a4_x9[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c };
const uint8_t dst_prgba8888_to_a4_x13[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e };
const uint8_t dst_prgba8888_to_g8_x10[] = {
0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00,
0xff, 0x00
};
const uint8_t dst_prgba8888_to_g8_x15[] = {
0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00,
0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff
};
const uint8_t dst_prgba8888_to_a8_x9[] = {
0x88, 0x00, 0x99, 0x00, 0xaa, 0x00, 0xbb, 0x00,
0xcc
};
const uint8_t dst_prgba8888_to_a8_x13[] = {
0x88, 0x00, 0x99, 0x00, 0xaa, 0x00, 0xbb, 0x00,
0xcc, 0x00, 0xdd, 0x00, 0xee
};
const uint8_t dst_prgba8888_to_rgb888_x10[] = {
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00
};
const uint8_t dst_prgba8888_to_rgb888_x15[] = {
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff
};
const uint8_t dst_prgba8888_to_rgba8888_x10[] = {
0xff, 0xff, 0xff, 0x88, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x99, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xaa, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xbb, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xcc, 0x00, 0x00, 0x00, 0x00
};
const uint8_t dst_prgba8888_to_rgba8888_x15[] = {
0xff, 0xff, 0xff, 0x88, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x99, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xaa, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xbb, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xcc, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xdd, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff
};
}
UTEST_BEGIN("runtime.mm", pixel)
void test_conversion(
const uint8_t *dst, size_t dst_size, mm::pixel_format_t dst_fmt,
const uint8_t *src, size_t src_size, mm::pixel_format_t src_fmt,
size_t pixels)
{
printf("Testing pixel conversion %s -> %s (%d pixels)...\n",
mm::pixel_format_name(src_fmt), mm::pixel_format_name(dst_fmt), int(pixels));
const mm::pixel_conversion_t conv = mm::pixel_convert_function(dst_fmt, src_fmt);
UTEST_ASSERT(conv != NULL);
ByteBuffer dbuf(dst_size);
ByteBuffer rbuf(dst_size);
ByteBuffer sbuf(src_size);
memcpy(rbuf.data(), dst, dst_size);
memcpy(sbuf.data(), src, src_size);
conv(dbuf.data(), sbuf.data(), pixels);
dbuf.dump("dbuf");
rbuf.dump("rbuf");
UTEST_ASSERT(!sbuf.corrupted());
UTEST_ASSERT(!dbuf.corrupted());
UTEST_ASSERT(memcmp(dbuf.data(), dst, dst_size) == 0);
}
#define TEST_CONV(dst, dst_fmt, src, src_fmt, pixels) \
test_conversion(dst, sizeof(dst)/sizeof(dst[0]), dst_fmt, src, sizeof(src)/sizeof(src[0]), src_fmt, pixels)
void test_g1_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_g1, mm::PIXFMT_G1, count);
TEST_FMT(dst_g1_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_g1_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_g1_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_g1_to_a2_x15, mm::PIXFMT_A2, 15);
TEST_FMT(dst_g1_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_g1_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_g1_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_g1_to_a4_x15, mm::PIXFMT_A4, 15);
TEST_FMT(dst_g1_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_g1_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_g1_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_g1_to_a8_x14, mm::PIXFMT_A8, 14);
TEST_FMT(dst_g1_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_g1_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_g1_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_g1_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_g1_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_g1_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_a1_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_a1, mm::PIXFMT_A1, count);
TEST_FMT(dst_a1_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_a1_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_a1_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_a1_to_a2_x15, mm::PIXFMT_A2, 15);
TEST_FMT(dst_a1_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_a1_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_a1_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_a1_to_a4_x15, mm::PIXFMT_A4, 15);
TEST_FMT(dst_a1_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_a1_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_a1_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_a1_to_a8_x14, mm::PIXFMT_A8, 14);
TEST_FMT(dst_a1_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_a1_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_a1_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_a1_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_a1_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_a1_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_g2_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_g2, mm::PIXFMT_G2, count);
TEST_FMT(dst_g2_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_g2_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_g2_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_g2_to_a1_x15, mm::PIXFMT_A1, 15);
TEST_FMT(dst_g2_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_g2_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_g2_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_g2_to_a4_x15, mm::PIXFMT_A4, 15);
TEST_FMT(dst_g2_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_g2_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_g2_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_g2_to_a8_x14, mm::PIXFMT_A8, 14);
TEST_FMT(dst_g2_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_g2_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_g2_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_g2_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_g2_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_g2_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_a2_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_a2, mm::PIXFMT_A2, count);
TEST_FMT(dst_a2_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_a2_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_a2_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_a2_to_a1_x15, mm::PIXFMT_A1, 15);
TEST_FMT(dst_a2_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_a2_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_a2_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_a2_to_a4_x15, mm::PIXFMT_A4, 15);
TEST_FMT(dst_a2_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_a2_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_a2_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_a2_to_a8_x14, mm::PIXFMT_A8, 14);
TEST_FMT(dst_a2_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_a2_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_a2_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_a2_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_a2_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_a2_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_g4_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_g4, mm::PIXFMT_G4, count);
TEST_FMT(dst_g4_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_g4_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_g4_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_g4_to_a1_x15, mm::PIXFMT_A1, 15);
TEST_FMT(dst_g4_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_g4_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_g4_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_g4_to_a2_x13, mm::PIXFMT_A2, 13);
TEST_FMT(dst_g4_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_g4_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_g4_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_g4_to_a8_x13, mm::PIXFMT_A8, 13);
TEST_FMT(dst_g4_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_g4_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_g4_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_g4_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_g4_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_g4_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_a4_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_a4, mm::PIXFMT_A4, count);
TEST_FMT(dst_a4_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_a4_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_a4_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_a4_to_a1_x14, mm::PIXFMT_A1, 14);
TEST_FMT(dst_a4_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_a4_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_a4_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_a4_to_a2_x13, mm::PIXFMT_A2, 13);
TEST_FMT(dst_a4_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_a4_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_a4_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_a4_to_a8_x13, mm::PIXFMT_A8, 13);
TEST_FMT(dst_a4_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_a4_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_a4_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_a4_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_a4_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_a4_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_g8_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_g8, mm::PIXFMT_G8, count);
TEST_FMT(dst_g8_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_g8_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_g8_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_g8_to_a1_x15, mm::PIXFMT_A1, 15);
TEST_FMT(dst_g8_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_g8_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_g8_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_g8_to_a2_x13, mm::PIXFMT_A2, 13);
TEST_FMT(dst_g8_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_g8_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_g8_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_g8_to_a4_x13, mm::PIXFMT_A4, 13);
TEST_FMT(dst_g8_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_g8_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_g8_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_g8_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_g8_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_g8_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_a8_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_a8, mm::PIXFMT_A8, count);
TEST_FMT(dst_a8_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_a8_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_a8_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_a8_to_a1_x15, mm::PIXFMT_A1, 15);
TEST_FMT(dst_a8_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_a8_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_a8_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_a8_to_a2_x13, mm::PIXFMT_A2, 13);
TEST_FMT(dst_a8_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_a8_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_a8_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_a8_to_a4_x13, mm::PIXFMT_A4, 13);
TEST_FMT(dst_a8_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_a8_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_a8_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_a8_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_a8_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_a8_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_rgb888_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_rgb888, mm::PIXFMT_RGB888, count);
TEST_FMT(dst_rgb888_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_rgb888_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_rgb888_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_rgb888_to_a1_x15, mm::PIXFMT_A1, 15);
TEST_FMT(dst_rgb888_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_rgb888_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_rgb888_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_rgb888_to_a2_x13, mm::PIXFMT_A2, 13);
TEST_FMT(dst_rgb888_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_rgb888_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_rgb888_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_rgb888_to_a4_x13, mm::PIXFMT_A4, 13);
TEST_FMT(dst_rgb888_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_rgb888_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_rgb888_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_rgb888_to_a8_x13, mm::PIXFMT_A8, 13);
TEST_FMT(dst_rgb888_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_rgb888_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
TEST_FMT(dst_rgb888_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_rgb888_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_rgba8888_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_rgba8888, mm::PIXFMT_RGBA8888, count);
TEST_FMT(dst_rgba8888_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_rgba8888_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_rgba8888_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_rgba8888_to_a1_x15, mm::PIXFMT_A1, 15);
TEST_FMT(dst_rgba8888_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_rgba8888_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_rgba8888_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_rgba8888_to_a2_x13, mm::PIXFMT_A2, 13);
TEST_FMT(dst_rgba8888_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_rgba8888_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_rgba8888_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_rgba8888_to_a4_x13, mm::PIXFMT_A4, 13);
TEST_FMT(dst_rgba8888_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_rgba8888_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_rgba8888_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_rgba8888_to_a8_x13, mm::PIXFMT_A8, 13);
TEST_FMT(dst_rgba8888_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_rgba8888_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_rgba8888_to_prgba8888_x10, mm::PIXFMT_PRGBA8888, 10);
TEST_FMT(dst_rgba8888_to_prgba8888_x15, mm::PIXFMT_PRGBA8888, 15);
#undef TEST_FMT
}
void test_prgba8888_conversion()
{
#define TEST_FMT(buf, fmt, count) TEST_CONV(buf, fmt, src_prgba8888, mm::PIXFMT_PRGBA8888, count);
TEST_FMT(dst_prgba8888_to_g1_x10, mm::PIXFMT_G1, 10);
TEST_FMT(dst_prgba8888_to_g1_x15, mm::PIXFMT_G1, 15);
TEST_FMT(dst_prgba8888_to_a1_x9, mm::PIXFMT_A1, 9);
TEST_FMT(dst_prgba8888_to_a1_x15, mm::PIXFMT_A1, 15);
TEST_FMT(dst_prgba8888_to_g2_x10, mm::PIXFMT_G2, 10);
TEST_FMT(dst_prgba8888_to_g2_x15, mm::PIXFMT_G2, 15);
TEST_FMT(dst_prgba8888_to_a2_x9, mm::PIXFMT_A2, 9);
TEST_FMT(dst_prgba8888_to_a2_x13, mm::PIXFMT_A2, 13);
TEST_FMT(dst_prgba8888_to_g4_x10, mm::PIXFMT_G4, 10);
TEST_FMT(dst_prgba8888_to_g4_x15, mm::PIXFMT_G4, 15);
TEST_FMT(dst_prgba8888_to_a4_x9, mm::PIXFMT_A4, 9);
TEST_FMT(dst_prgba8888_to_a4_x13, mm::PIXFMT_A4, 13);
TEST_FMT(dst_prgba8888_to_g8_x10, mm::PIXFMT_G8, 10);
TEST_FMT(dst_prgba8888_to_g8_x15, mm::PIXFMT_G8, 15);
TEST_FMT(dst_prgba8888_to_a8_x9, mm::PIXFMT_A8, 9);
TEST_FMT(dst_prgba8888_to_a8_x13, mm::PIXFMT_A8, 13);
TEST_FMT(dst_prgba8888_to_rgb888_x10, mm::PIXFMT_RGB888, 10);
TEST_FMT(dst_prgba8888_to_rgb888_x15, mm::PIXFMT_RGB888, 15);
TEST_FMT(dst_prgba8888_to_rgba8888_x10, mm::PIXFMT_RGBA8888, 10);
TEST_FMT(dst_prgba8888_to_rgba8888_x15, mm::PIXFMT_RGBA8888, 15);
#undef TEST_FMT
}
UTEST_MAIN
{
test_g1_conversion();
test_a1_conversion();
test_g2_conversion();
test_a2_conversion();
test_g4_conversion();
test_a4_conversion();
test_g8_conversion();
test_a8_conversion();
test_rgb888_conversion();
test_rgba8888_conversion();
test_prgba8888_conversion();
}
UTEST_END;