From: Elizabeth Figura zfigura@codeweavers.com
This is a more natural and findable place for them.
Compression byte check is dropped since even different Windows versions don't seem to produce the same compressed bytes, and a reimplementation certainly won't. --- dlls/ir50_32/tests/Makefile.in | 3 +- dlls/ir50_32/tests/ir50_32.c | 127 +++++++++++++++ dlls/{mf => ir50_32}/tests/iv50frame.bin | Bin dlls/ir50_32/tests/resource.rc | 26 +++ dlls/ir50_32/tests/rgb24frame.bmp | Bin 0 -> 27702 bytes dlls/mf/tests/resource.rc | 4 - dlls/mf/tests/transform.c | 196 ----------------------- 7 files changed, 155 insertions(+), 201 deletions(-) rename dlls/{mf => ir50_32}/tests/iv50frame.bin (100%) create mode 100644 dlls/ir50_32/tests/resource.rc create mode 100644 dlls/ir50_32/tests/rgb24frame.bmp
diff --git a/dlls/ir50_32/tests/Makefile.in b/dlls/ir50_32/tests/Makefile.in index 6be99cf493e..504377f6941 100644 --- a/dlls/ir50_32/tests/Makefile.in +++ b/dlls/ir50_32/tests/Makefile.in @@ -2,4 +2,5 @@ TESTDLL = ir50_32.dll IMPORTS = msvfw32
SOURCES = \ - ir50_32.c + ir50_32.c \ + resource.rc diff --git a/dlls/ir50_32/tests/ir50_32.c b/dlls/ir50_32/tests/ir50_32.c index c5820fb312f..1321b8c877a 100644 --- a/dlls/ir50_32/tests/ir50_32.c +++ b/dlls/ir50_32/tests/ir50_32.c @@ -143,7 +143,134 @@ static void test_formats(void) ok(!ret, "Got %Id.\n", ret); }
+static void test_compress(void) +{ + const void *res_data, *rgb_data; + BITMAPINFO rgb_info, iv50_info; + BYTE iv50_data[0x5100]; + HRSRC resource; + LRESULT ret; + DWORD flags; + HIC hic; + + resource = FindResourceW(NULL, L"rgb24frame.bmp", (const WCHAR *)RT_RCDATA); + res_data = LockResource(LoadResource(GetModuleHandleW(NULL), resource)); + memcpy(&rgb_info, ((BITMAPFILEHEADER *)res_data) + 1, sizeof(BITMAPINFOHEADER)); + rgb_data = ((const char *)res_data) + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); + + hic = ICOpen(ICTYPE_VIDEO, mmioFOURCC('i','v','5','0'), ICMODE_COMPRESS); + ok(!!hic, "Failed to open codec.\n"); + + ret = ICCompressQuery(hic, &rgb_info, NULL); + todo_wine ok(!ret, "Got %Id.\n", ret); + if (ret) + { + ICClose(hic); + return; + } + + ret = ICCompressGetSize(hic, &rgb_info, NULL); + ok(ret == 0x5100, "Got %Id.\n", ret); + + ret = ICCompressGetFormatSize(hic, &rgb_info); + ok(ret == sizeof(BITMAPINFOHEADER), "Got %Id.\n", ret); + + memset(&iv50_info, 0xcc, sizeof(iv50_info)); + ret = ICCompressGetFormat(hic, &rgb_info, &iv50_info); + ok(!ret, "Got %Id.\n", ret); + ok(iv50_info.bmiHeader.biSize == sizeof(BITMAPINFOHEADER), "Got size %lu.\n", iv50_info.bmiHeader.biSize); + ok(iv50_info.bmiHeader.biWidth == 96, "Got width %ld.\n", iv50_info.bmiHeader.biWidth); + ok(iv50_info.bmiHeader.biHeight == 96, "Got height %ld.\n", iv50_info.bmiHeader.biHeight); + ok(iv50_info.bmiHeader.biPlanes == 1, "Got %u planes.\n", iv50_info.bmiHeader.biPlanes); + ok(iv50_info.bmiHeader.biBitCount == 24, "Got depth %u.\n", iv50_info.bmiHeader.biBitCount); + ok(iv50_info.bmiHeader.biCompression == mmioFOURCC('I','V','5','0'), + "Got compression %#lx.\n", iv50_info.bmiHeader.biCompression); + ok(iv50_info.bmiHeader.biSizeImage == 0x5100, "Got image size %lu.\n", iv50_info.bmiHeader.biSizeImage); + ok(!iv50_info.bmiHeader.biXPelsPerMeter, "Got horizontal resolution %ld.\n", iv50_info.bmiHeader.biXPelsPerMeter); + ok(!iv50_info.bmiHeader.biYPelsPerMeter, "Got vertical resolution %ld.\n", iv50_info.bmiHeader.biYPelsPerMeter); + ok(!iv50_info.bmiHeader.biClrUsed, "Got %lu used colours.\n", iv50_info.bmiHeader.biClrUsed); + ok(!iv50_info.bmiHeader.biClrImportant, "Got %lu important colours.\n", iv50_info.bmiHeader.biClrImportant); + ok(iv50_info.bmiColors[0].rgbRed == 0xcc, "Expected colours to be unmodified.\n"); + + ret = ICCompressQuery(hic, &rgb_info, &iv50_info); + ok(!ret, "Got %Id.\n", ret); + + ret = ICCompressBegin(hic, &rgb_info, &iv50_info); + ok(!ret, "Got %Id.\n", ret); + memset(iv50_data, 0xcd, sizeof(iv50_data)); + ret = ICCompress(hic, ICCOMPRESS_KEYFRAME, &iv50_info.bmiHeader, iv50_data, + &rgb_info.bmiHeader, (void *)rgb_data, NULL, &flags, 1, 0, 0, NULL, NULL); + ok(!ret, "Got %Id.\n", ret); + ok(flags == AVIIF_KEYFRAME, "got flags %#lx\n", flags); + ok(iv50_info.bmiHeader.biSizeImage < 0x5100, "Got size %ld.\n", iv50_info.bmiHeader.biSizeImage); + ret = ICCompressEnd(hic); + ok(!ret, "Got %Id.\n", ret); + + ret = ICClose(hic); + ok(!ret, "Got %Id.\n", ret); +} + +static void test_decompress(void) +{ + const BYTE *expect_rgb_data; + BYTE rgb_data[96 * 96 * 3]; + unsigned int diff = 0; + void *iv50_data; + HRSRC resource; + LRESULT ret; + HIC hic; + + BITMAPINFO iv50_info = + { + .bmiHeader.biSize = sizeof(BITMAPINFOHEADER), + .bmiHeader.biWidth = 96, + .bmiHeader.biHeight = 96, + .bmiHeader.biPlanes = 1, + .bmiHeader.biBitCount = 24, + .bmiHeader.biCompression = mmioFOURCC('I','V','5','0'), + }; + static const BITMAPINFO rgb_info = + { + .bmiHeader.biSize = sizeof(BITMAPINFOHEADER), + .bmiHeader.biWidth = 96, + .bmiHeader.biHeight = 96, + .bmiHeader.biPlanes = 1, + .bmiHeader.biBitCount = 24, + .bmiHeader.biCompression = BI_RGB, + .bmiHeader.biSizeImage = 96 * 96 * 3, + }; + + resource = FindResourceW(NULL, L"iv50frame.bin", (const WCHAR *)RT_RCDATA); + iv50_data = LockResource(LoadResource(GetModuleHandleW(NULL), resource)); + iv50_info.bmiHeader.biSizeImage = SizeofResource(GetModuleHandleW(NULL), resource); + + hic = ICOpen(ICTYPE_VIDEO, mmioFOURCC('i','v','5','0'), ICMODE_DECOMPRESS); + ok(!!hic, "Failed to open codec.\n"); + + ret = ICDecompressBegin(hic, &iv50_info, &rgb_info); + ok(!ret, "Got %Id.\n", ret); + ret = ICDecompress(hic, 0, &iv50_info.bmiHeader, iv50_data, + (BITMAPINFOHEADER *)&rgb_info.bmiHeader, rgb_data); + ok(!ret, "Got %Id.\n", ret); + ret = ICDecompressEnd(hic); + todo_wine ok(!ret, "Got %Id.\n", ret); + + resource = FindResourceW(NULL, L"rgb24frame.bmp", (const WCHAR *)RT_RCDATA); + expect_rgb_data = ((const BYTE *)LockResource(LoadResource(GetModuleHandleW(NULL), resource))) + + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); + + for (unsigned int i = 0; i < rgb_info.bmiHeader.biSizeImage; ++i) + diff += abs((int)rgb_data[i] - (int)expect_rgb_data[i]); + diff = diff * 100 / 256 / rgb_info.bmiHeader.biSizeImage; + ok(diff < 4, "Got %u%% difference.\n", diff); + + ret = ICClose(hic); + ok(!ret, "Got %Id.\n", ret); +} + START_TEST(ir50_32) { test_formats(); + test_compress(); + test_decompress(); } diff --git a/dlls/mf/tests/iv50frame.bin b/dlls/ir50_32/tests/iv50frame.bin similarity index 100% rename from dlls/mf/tests/iv50frame.bin rename to dlls/ir50_32/tests/iv50frame.bin diff --git a/dlls/ir50_32/tests/resource.rc b/dlls/ir50_32/tests/resource.rc new file mode 100644 index 00000000000..cc2167f8f74 --- /dev/null +++ b/dlls/ir50_32/tests/resource.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2023 Rémi Bernon for CodeWeavers + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "windef.h" + +/* @makedep: rgb24frame.bmp */ +rgb24frame.bmp RCDATA rgb24frame.bmp + +/* The above frame, encoded using native ir50_32.dll. */ +/* @makedep: iv50frame.bin */ +iv50frame.bin RCDATA iv50frame.bin diff --git a/dlls/ir50_32/tests/rgb24frame.bmp b/dlls/ir50_32/tests/rgb24frame.bmp new file mode 100644 index 0000000000000000000000000000000000000000..899e10fd68994f32331a45ae4878344e0a4a5452 GIT binary patch literal 27702 zcmZ?rHOpZD12YB&1`P%Vh6E^PWRL)hGeG4b90-}6H#;?dZf5?h^xS#Fo1I!XBRPL= za^bAl!r2gZZvL$F{Mp$BGcxn$Lf8;-h?>Nr8Sw>kGjr#q7tG4eotv6Jdw8?c^Jga( z&PvRm8(%a7!p_c}n^`a;H*Yp11TqVt;t(~-1+!y|W~JuO&CZ*ho;xoyf0(nA^XH}( z&WJ6Xom@Bz!cNbhotr-^GjDD-IAn73q2drV@da}ei)N%3%*xE2mzqC2J9qBzW+xVc za#MWKjKuu85O!w442Z9D^JYWX5OIi_*rHj<1)u;#%Y(@IaU`%o*(z^tHYoedPA{C1 znh#1Ri3QLy3NsHP=f{!22GvRhpj?(-I3qJ3l>1Ua#W=Jq%FLggp9d<Ra|=MS!<e0) zJGU@@Mse=!%A8pcHpK7gd7x4{xnMS^5(l%9%cbms8M(Qj`aM4vRMQP(c5eQx;@sJ# zc{9qhLA7}?%)hAxvp`9xa7KFGTnHOd7Nr-=%FUadS2#1HaCT17jI4q=!<(H|G$W&6 zPIk`p+|q@S2^|UP(<&;Lq~y#ftyz+qGaFL=K*}OWTL@D2X64SxD43d)H#4nZ`tW9F z<;_efn4Xa}Grw$JbX<2_=H#-9<>`6TDymnc<j>5^o10!Z1C)@!twDIZC^>I>X5O^a z+?nb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lls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index 873d373e079..ff7fb6d8b0c 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -161,10 +161,6 @@ rgb555frame.bmp RCDATA rgb555frame.bmp /* @makedep: rgb555frame-flip.bmp */ rgb555frame-flip.bmp RCDATA rgb555frame-flip.bmp
-/* Generated from running the tests on Windows */ -/* @makedep: iv50frame.bin */ -iv50frame.bin RCDATA iv50frame.bin - /* Generated from running the tests on Windows */ /* @makedep: rgb24frame.bmp */ rgb24frame.bmp RCDATA rgb24frame.bmp diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 4578dbac591..87ce4ded382 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -60,7 +60,6 @@ DEFINE_GUID(MFVideoFormat_WMV_Unknown,0x7ce12ca9,0xbfbf,0x43d9,0x9d,0x00,0x82,0x DEFINE_MEDIATYPE_GUID(MFVideoFormat_ABGR32,D3DFMT_A8B8G8R8); DEFINE_MEDIATYPE_GUID(MFVideoFormat_P208,MAKEFOURCC('P','2','0','8')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_VC1S,MAKEFOURCC('V','C','1','S')); -DEFINE_MEDIATYPE_GUID(MEDIASUBTYPE_IV50,MAKEFOURCC('I','V','5','0'));
DEFINE_GUID(mft_output_sample_incomplete,0xffffff,0xffff,0xffff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff);
@@ -10360,199 +10359,6 @@ failed: CoUninitialize(); }
-static void test_iv50_encoder(void) -{ - static const BITMAPINFOHEADER expect_iv50 = - { - .biSize = sizeof(BITMAPINFOHEADER), - .biWidth = 0x60, .biHeight = 0x60, - .biPlanes = 1, .biBitCount = 0x18, - .biCompression = mmioFOURCC('I','V','5','0'), - .biSizeImage = 0x5100, - }; - const struct buffer_desc iv50_buffer_desc = - { - .length = 0x2e8, - }; - const struct sample_desc iv50_sample_desc = - { - .buffer_count = 1, .buffers = &iv50_buffer_desc, - }; - const BYTE *res_data; - BYTE rgb_data[0x6c00], iv50_data[0x5100]; - BITMAPINFO rgb_info, iv50_info; - IMFCollection *collection; - DWORD flags, res_len, ret; - IMFSample *sample; - LRESULT res; - HRESULT hr; - HIC hic; - - load_resource(L"rgb555frame.bmp", (const BYTE **)&res_data, &res_len); - res_data += 2 + 3 * sizeof(DWORD); - res_len -= 2 + 3 * sizeof(DWORD); - rgb_info.bmiHeader = *(BITMAPINFOHEADER *)res_data; - memcpy(rgb_data, res_data + sizeof(BITMAPINFOHEADER), res_len - sizeof(BITMAPINFOHEADER)); - - hic = ICOpen(ICTYPE_VIDEO, expect_iv50.biCompression, ICMODE_COMPRESS); - if (!hic) - { - todo_wine - win_skip("ICOpen failed to created IV50 compressor.\n"); - return; - } - - res = ICCompressQuery(hic, &rgb_info, NULL); - todo_wine - ok(!res, "got res %#Ix\n", res); - if (res) - goto done; - - res = ICCompressGetSize(hic, &rgb_info, NULL); - ok(res == expect_iv50.biSizeImage, "got res %#Ix\n", res); - - res = ICCompressGetFormatSize(hic, &rgb_info); - ok(res == sizeof(BITMAPINFOHEADER), "got res %#Ix\n", res); - res = ICCompressGetFormat(hic, &rgb_info, &iv50_info); - ok(!res, "got res %#Ix\n", res); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biSize); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biWidth); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biHeight); - check_member(iv50_info.bmiHeader, expect_iv50, "%#x", biPlanes); - check_member(iv50_info.bmiHeader, expect_iv50, "%#x", biBitCount); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biCompression); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biSizeImage); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biXPelsPerMeter); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biYPelsPerMeter); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biClrUsed); - check_member(iv50_info.bmiHeader, expect_iv50, "%#lx", biClrImportant); - res = ICCompressQuery(hic, &rgb_info, &iv50_info); - ok(!res, "got res %#Ix\n", res); - - res = ICCompressBegin(hic, &rgb_info, &iv50_info); - ok(!res, "got res %#Ix\n", res); - memset(iv50_data, 0xcd, sizeof(iv50_data)); - res = ICCompress(hic, ICCOMPRESS_KEYFRAME, &iv50_info.bmiHeader, iv50_data, &rgb_info.bmiHeader, rgb_data, - NULL, &flags, 1, 0, 0, NULL, NULL); - ok(!res, "got res %#Ix\n", res); - ok(flags == 0x10, "got flags %#lx\n", flags); - ok(iv50_info.bmiHeader.biSizeImage == 0x2e8, "got res %#Ix\n", res); - res = ICCompressEnd(hic); - ok(!res, "got res %#Ix\n", res); - - hr = MFCreateCollection(&collection); - ok(hr == S_OK, "got hr %#lx\n", hr); - sample = create_sample(iv50_data, iv50_info.bmiHeader.biSizeImage); - ok(!!sample, "got sample %p\n", sample); - hr = IMFSample_SetSampleTime(sample, 0); - ok(hr == S_OK, "got hr %#lx\n", hr); - hr = IMFSample_SetSampleDuration(sample, 0); - ok(hr == S_OK, "got hr %#lx\n", hr); - hr = IMFCollection_AddElement(collection, (IUnknown *)sample); - ok(hr == S_OK, "got hr %#lx\n", hr); - ret = check_mf_sample_collection(collection, &iv50_sample_desc, L"iv50frame.bin"); - ok(ret == 0, "got %lu%% diff\n", ret); - IMFCollection_Release(collection); - -done: - res = ICClose(hic); - ok(!res, "got res %#Ix\n", res); -} - -static void test_iv50_decoder(void) -{ - static const BITMAPINFOHEADER expect_iv50 = - { - .biSize = sizeof(BITMAPINFOHEADER), - .biWidth = 0x60, .biHeight = 0x60, - .biPlanes = 1, .biBitCount = 24, - .biCompression = mmioFOURCC('I','V','5','0'), - .biSizeImage = 0x2e8, - }; - static const BITMAPINFOHEADER expect_rgb = - { - .biSize = sizeof(BITMAPINFOHEADER), - .biWidth = 0x60, .biHeight = 0x60, - .biPlanes = 1, .biBitCount = 24, - .biCompression = BI_RGB, - .biSizeImage = 96 * 96 * 3, - }; - const struct buffer_desc rgb_buffer_desc = - { - .length = 96 * 96 * 3, - .compare = compare_rgb24, .compare_rect = {.right = 82, .bottom = 84}, - .dump = dump_rgb24, .size = {.cx = 96, .cy = 96}, - }; - const struct sample_desc rgb_sample_desc = - { - .buffer_count = 1, .buffers = &rgb_buffer_desc, - }; - const BYTE *res_data; - BYTE rgb_data[0x6c00], iv50_data[0x5100]; - BITMAPINFO rgb_info, iv50_info; - IMFCollection *collection; - DWORD res_len, ret; - IMFSample *sample; - LRESULT res; - HRESULT hr; - HIC hic; - - load_resource(L"iv50frame.bin", (const BYTE **)&res_data, &res_len); - memcpy(iv50_data, res_data, res_len); - - iv50_info.bmiHeader = expect_iv50; - hic = ICOpen(ICTYPE_VIDEO, expect_iv50.biCompression, ICMODE_DECOMPRESS); - if (!hic) - { - todo_wine - win_skip("ICOpen failed to created IV50 decompressor.\n"); - return; - } - - res = ICDecompressGetFormat(hic, &iv50_info, &rgb_info); - ok(!res, "got res %#Ix\n", res); - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biSize); - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biWidth); - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biHeight); - check_member(rgb_info.bmiHeader, expect_rgb, "%#x", biPlanes); - todo_wine - check_member(rgb_info.bmiHeader, expect_rgb, "%#x", biBitCount); - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biCompression); - todo_wine - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biSizeImage); - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biXPelsPerMeter); - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biYPelsPerMeter); - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biClrUsed); - check_member(rgb_info.bmiHeader, expect_rgb, "%#lx", biClrImportant); - rgb_info.bmiHeader = expect_rgb; - - res = ICDecompressBegin(hic, &iv50_info, &rgb_info); - ok(!res, "got res %#Ix\n", res); - res = ICDecompress(hic, 0, &iv50_info.bmiHeader, iv50_data, &rgb_info.bmiHeader, rgb_data); - ok(!res, "got res %#Ix\n", res); - res = ICDecompressEnd(hic); - todo_wine - ok(!res, "got res %#Ix\n", res); - - res = ICClose(hic); - ok(!res, "got res %#Ix\n", res); - - - hr = MFCreateCollection(&collection); - ok(hr == S_OK, "got hr %#lx\n", hr); - sample = create_sample(rgb_data, rgb_info.bmiHeader.biSizeImage); - ok(!!sample, "got sample %p\n", sample); - hr = IMFSample_SetSampleTime(sample, 0); - ok(hr == S_OK, "got hr %#lx\n", hr); - hr = IMFSample_SetSampleDuration(sample, 0); - ok(hr == S_OK, "got hr %#lx\n", hr); - hr = IMFCollection_AddElement(collection, (IUnknown *)sample); - ok(hr == S_OK, "got hr %#lx\n", hr); - ret = check_mf_sample_collection(collection, &rgb_sample_desc, L"rgb24frame.bmp"); - ok(ret <= 4, "got %lu%% diff\n", ret); - IMFCollection_Release(collection); -} - static IMFSample *create_d3d_sample(IMFVideoSampleAllocator *allocator, const void *data, ULONG size) { IMFMediaBuffer *media_buffer; @@ -11143,8 +10949,6 @@ START_TEST(transform) test_video_processor(FALSE); test_video_processor(TRUE); test_mp3_decoder(); - test_iv50_encoder(); - test_iv50_decoder();
test_h264_with_dxgi_manager(); test_h264_decoder_concat_streams();