From: Brendan McGrath bmcgrath@codeweavers.com
These tests ensure that the transform will work with input and output buffers that have differing height values. --- dlls/mf/tests/nv12frame-extra-height-2d.bmp | Bin 0 -> 78902 bytes dlls/mf/tests/nv12frame-extra-height.bmp | Bin 0 -> 59190 bytes dlls/mf/tests/resource.rc | 12 +++ dlls/mf/tests/rgb32frame-extra-height.bmp | Bin 0 -> 43062 bytes dlls/mf/tests/transform.c | 92 +++++++++++++++++++- 5 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 dlls/mf/tests/nv12frame-extra-height-2d.bmp create mode 100644 dlls/mf/tests/nv12frame-extra-height.bmp create mode 100644 dlls/mf/tests/rgb32frame-extra-height.bmp
diff --git a/dlls/mf/tests/nv12frame-extra-height-2d.bmp b/dlls/mf/tests/nv12frame-extra-height-2d.bmp new file mode 100644 index 0000000000000000000000000000000000000000..42c90555126aa84f3f743aa36f1dd7a73c14c433 GIT binary patch literal 78902 zcmeI3F;3k;5QfPOe1wQ9TmY1kP*YIQAmsu<La9=_LzIt(6YvnCc(;f|q-_ut1&V}H zQNRs0YpOBDt{$G%*q(2#eKO+3zxV(C8E-7{ZGZdk#@pCVpI_2!)BKs{r;X3)GmXD* zpS_Q!Z6njpgAhWroUpfJ-+6DzzSD+3{K<e_2B?2K@5hjP_`}~a17oNG&-Y--zSH*X z{TSA6&Hp+5AA~u;gVVEkpXSZw>O&L$1H2zYcH!^4f50F9^nbq@p#J@`@Ae<?hd=$_ zZw9D;zwGJ%zS+Yc{`7y}8JIZ#yXHJH2Y9e|5r3yS)%X9fAHcq=9r*k1AMl4i{oii} zsDHogdH(xm4}bX6|9xiw{_to2?>7U~zhCw<*#BKGo5&pC!PRbDra9I3|F9pxzN;Ph z`|cm`hd=$_Zw9D;zwCMb`(_V+_|yM=X8`{2XaDav1Ju7?_A}W3Ep|2|bASim_v0eX zslNY*{Q&k|?ZDr6|A0UI>HmH+K>hn=&-33md-%hj{_i^j@P|M9f4>=^{{6C_!T#^~ z_AxRCc<|>T{z!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m&tN;K2
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/nv12frame-extra-height.bmp b/dlls/mf/tests/nv12frame-extra-height.bmp new file mode 100644 index 0000000000000000000000000000000000000000..082d0dc15a5c858bd61f13af721eed0c7c95cb22 GIT binary patch literal 59190 zcmeI5v1(f}6hPBIc%M)_)jtrEG0p73Ll#4za}1_a=C_56_L48~ON|HrMZg(NrVL&} zCJ*)>sCrF@Xt_}7R#)vi64ziv?vqcBu7oi7>+tl)$**?mU%&YH=Ht7MPbZ)Kt8c%@ z-`~8yR(0(N7~lX7-~bNb01n^)4&XpH9N7EwKas%T_Rc-~SS{930s92@t-J8IUBB>$ zf0y?V{KtR%k2?FbXC}@+oPYjl2dMwHYZ(6UXa9}ff49}#5eW<~?%ku0*!v&YC$Mkb zg}?3kg+KheyocaF{^LLAA1eo_Khz&9_eyv!{^NfM9$L*I(f?&rIU<3<!?|mG#NPkF zK7oDfF8poRFZ|)(<vj%d@gM&=|5!Od{h|I?xmUt-@gM(7@X%@wiT=+9Jx3%kxEi{d zkJ$Sk*e9@W-G#sH`h`FIyS#_sKmOxC=N~Hvs6W&nEB8uxF8<?x2_9O_A<_TIX6J|m z22U^U+DGjD59|}zx9-B<cKyO1{$1Wf@E`y2pYxBE1JobtkCl5RJQx4*zXT7h=8)+B zXnb%)0)v}3cj+Vc{s;C6>|1x?Z@Yfs5C1OjA^4B~_|N&r$^q&R^~cJ+5}u3y_+NsD zR&z-7zki%MB7wnc?aq9}-v7Wpfqm;P{B74S{Ndl_Jp}*pAOAW3SUEubq5fF8SHg4g zAOB16&}t5e{>R>1@ON>)_YOC>;Q$Wc01n^)4&VR|-~bNb01n^)4&-*As%uBU00(dY z2XFufZ~zBz00%naKt+Q<cM0sZ+w&@D+UfV?myyB;J~9D$G_yZj?e-XypOtp{E%{}n z@PUs^KpxHP&r-WJVg1ogza+nm6h82g3CN?F{h6t^u>Pp0pOIf?3Lp5$1mw}Y{!Fyn zbvS?R^b_*SNZ|t?nSeZ+*`JYiyA11(cKQ+dWu)+dk4!)w&FoKKyPbvgM>~C={4!Gb zz(*z^k7o8KtQNe300bbAk3e_7`NSuOK;^&YOZ%S)+}<tLAG`KvBfm^EH=k;*+b`}v z+Ot^eX0PVtmx<=)(^R_s;XL$5H+xf&UnZKH&!DH<uZE#Ny4eRk^2<bX^V#fl`_oJ4 zk8bwOj{Gvw+<e9d-G1{H`lFkDd?3F}G&i5)RJXs@p+CCWk5lr?M04{A|J%HSz@HJ2 LZxa~(+XQ|B;m5&E
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index 8eb147c90e6..4d986626cc0 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -137,6 +137,18 @@ abgr32frame-crop.bmp RCDATA abgr32frame-crop.bmp /* @makedep: rgb32frame-grabber.bmp */ rgb32frame-grabber.bmp RCDATA rgb32frame-grabber.bmp
+/* Generated from running the tests on Windows */ +/* @makedep: rgb32frame-extra-height.bmp */ +rgb32frame-extra-height.bmp RCDATA rgb32frame-extra-height.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-extra-height.bmp */ +nv12frame-extra-height.bmp RCDATA nv12frame-extra-height.bmp + +/* Generated from running the tests on Windows */ +/* @makedep: nv12frame-extra-height-2d.bmp */ +nv12frame-extra-height-2d.bmp RCDATA nv12frame-extra-height-2d.bmp + /* Generated from running the tests on Windows */ /* @makedep: rgb555frame.bmp */ rgb555frame.bmp RCDATA rgb555frame.bmp diff --git a/dlls/mf/tests/rgb32frame-extra-height.bmp b/dlls/mf/tests/rgb32frame-extra-height.bmp new file mode 100644 index 0000000000000000000000000000000000000000..eec9635493dc3ccdf9abe3094644ebba2b2537e2 GIT binary patch literal 43062 zcmeI)!D$;o7>421#dYME3RHm4Ne?L@kOFje1;&s93@##&4sy>a9i#y%zbxas=3AKj zt4A<G#?0>M)uTo13f+I+KQFJhecgYo@ukMs8oT8~-Pi5y|Cc}B?@#r}(0~C37+`<_ z1{h#~fg3Pza?1<+s!bdQN4|Gk(0{H0{q>()VD8@e*MDw-xqIhd|G5R`?wx=A=N6c| zcmCV<Uuxw>*5Jp_ig*|s+Gp+0{q)ZpCJy!2Kk?IjF8};@H=L}WfBq9c-RJVpe|N*l z`uXqcf9}c?b^p=am&f7rKl-omI_h6%!B*%vx()sHAGNcEdHnOg1;?Y$fq(u-?QCHl z|NL*k@#u5lzpejWz2-*N;OYCr@cAF@v-anH`sWQ3hx+TE_~|~EfBw50PS(#q|B0XO zbNT1LyWwR0{P*>Ltgj6iS%cHv-{JE=+Gp+0{q)ZpCJy!2Kk?IjF8};@H=L}WfBq9c z-RJVpe|N*l`uXqce_4+8JKsjq;M?+N`20_@Uvn>R^`HCx)nETxJ{IxMKmT<d=5YPE z<!);|cgG*cpS3J?+z$WzcXYefniKzZ@~3_}#7G+aUOo+d_Idrhq<!p9|GDp9{q;|d zpWWy3&wqEr$@=-{Kk?IjF8};@H=L}W|Hl3YuGx%S=P~E{Yh#*e#sC8hFu(u<3^2d| g0}L?000V0nSnB&Hh6W5UzyJdbFu(u<4BUo+e~HF~KL7v#
literal 0 HcmV?d00001
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index ffb3de92e2c..575d884e195 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -7647,6 +7647,7 @@ static void test_video_processor(BOOL use_2d_buffer)
static const MFVideoArea actual_aperture = {.Area={82,84}}; static const DWORD actual_width = 96, actual_height = 96, nv12_aligned_width = 128; + static const DWORD extra_height = actual_height + 0x10; const struct attribute_desc rgb32_with_aperture[] = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), @@ -7680,6 +7681,13 @@ static void test_video_processor(BOOL use_2d_buffer) ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, actual_height, .required = TRUE), {0}, }; + const struct attribute_desc nv12_extra_height[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12, .required = TRUE), + ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, extra_height, .required = TRUE), + {0}, + }; const struct attribute_desc rgb32_default_stride[] = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), @@ -7687,6 +7695,14 @@ static void test_video_processor(BOOL use_2d_buffer) ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, actual_height, .required = TRUE), {0}, }; + const struct attribute_desc rgb32_extra_height[] = + { + ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), + ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32, .required = TRUE), + ATTR_RATIO(MF_MT_FRAME_SIZE, actual_width, extra_height, .required = TRUE), + ATTR_UINT32(MF_MT_DEFAULT_STRIDE, actual_width * 4), + {0}, + }; const struct attribute_desc rgb32_negative_stride[] = { ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video, .required = TRUE), @@ -7805,6 +7821,18 @@ static void test_video_processor(BOOL use_2d_buffer) .sample_time = 0, .sample_duration = 10000000, .buffer_count = 1, .buffers = &rgb32_crop_buffer_2d_desc, }; + const struct buffer_desc rgb32_extra_height_buffer_desc = + { + .length = actual_width * extra_height * 4, + .compare = compare_rgb32, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_rgb32, .size = {.cx = actual_width, .cy = extra_height}, + }; + const struct sample_desc rgb32_extra_height_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &rgb32_extra_height_buffer_desc, + };
const struct buffer_desc rgb555_buffer_desc = { @@ -7844,6 +7872,31 @@ static void test_video_processor(BOOL use_2d_buffer) .buffer_count = 1, .buffers = &nv12_buffer_2d_desc, };
+ const struct buffer_desc nv12_extra_height_buffer_desc = + { + .length = actual_width * extra_height * 3 / 2, + .compare = compare_nv12, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_nv12, .size = {.cx = actual_width, .cy = extra_height}, + }; + const struct sample_desc nv12_extra_height_sample_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &nv12_extra_height_buffer_desc, + }; + const struct buffer_desc nv12_extra_height_buffer_2d_desc = + { + .length = nv12_aligned_width * extra_height * 3 / 2, + .compare = compare_nv12, .compare_rect = {.top = 12, .right = 82, .bottom = 96}, + .dump = dump_nv12, .size = {.cx = nv12_aligned_width, .cy = extra_height}, + }; + const struct sample_desc nv12_extra_height_sample_2d_desc = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 10000000, + .buffer_count = 1, .buffers = &nv12_extra_height_buffer_2d_desc, + }; + const struct transform_desc { const struct attribute_desc *input_type_desc; @@ -8013,6 +8066,22 @@ static void test_video_processor(BOOL use_2d_buffer) .output_sample_desc = &rgb32_crop_sample_desc, .output_sample_2d_desc = &rgb32_crop_sample_2d_desc, .delta = 3, /* Windows returns 3 */ }, + { /* Test 19 */ + .input_type_desc = nv12_default_stride, .input_bitmap = L"nv12frame.bmp", + .input_buffer_desc = use_2d_buffer ? nv12_default_stride : NULL, + .output_type_desc = rgb32_extra_height, .output_bitmap = L"rgb32frame-extra-height.bmp", + .output_buffer_desc = use_2d_buffer ? rgb32_extra_height : NULL, + .output_sample_desc = &rgb32_extra_height_sample_desc, .output_sample_2d_desc = &rgb32_extra_height_sample_desc, + .todo = TRUE, + }, + { /* Test 20 */ + .input_type_desc = rgb32_positive_stride, .input_bitmap = L"rgb32frame.bmp", + .input_buffer_desc = use_2d_buffer ? rgb32_positive_stride : NULL, + .output_type_desc = nv12_extra_height, .output_bitmap = L"nv12frame-extra-height.bmp", .output_bitmap_2d = L"nv12frame-extra-height-2d.bmp", + .output_buffer_desc = use_2d_buffer ? nv12_extra_height : NULL, + .output_sample_desc = &nv12_extra_height_sample_desc, .output_sample_2d_desc = &nv12_extra_height_sample_2d_desc, + .todo = TRUE, + }, };
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_NV12}; @@ -8372,6 +8441,16 @@ static void test_video_processor(BOOL use_2d_buffer) output_info.cbSize = actual_aperture.Area.cx * actual_aperture.Area.cy * 4; check_mft_get_output_stream_info(transform, S_OK, &output_info); } + else if (test->output_sample_desc == &nv12_extra_height_sample_desc) + { + output_info.cbSize = actual_width * extra_height * 3 / 2; + check_mft_get_output_stream_info(transform, S_OK, &output_info); + } + else if (test->output_sample_desc == &rgb32_extra_height_sample_desc) + { + output_info.cbSize = actual_width * extra_height * 4; + check_mft_get_output_stream_info(transform, S_OK, &output_info); + } else { output_info.cbSize = actual_width * actual_height * 4; @@ -8393,6 +8472,16 @@ static void test_video_processor(BOOL use_2d_buffer) input_info.cbSize = 82 * 84 * 4; check_mft_get_input_stream_info(transform, S_OK, &input_info); } + else if (test->input_type_desc == nv12_extra_height) + { + input_info.cbSize = actual_width * extra_height * 3 / 2; + check_mft_get_input_stream_info(transform, S_OK, &input_info); + } + else if (test->input_type_desc == rgb32_extra_height) + { + input_info.cbSize = actual_width * extra_height * 4; + check_mft_get_input_stream_info(transform, S_OK, &input_info); + } else { input_info.cbSize = actual_width * actual_height * 4; @@ -8400,7 +8489,8 @@ static void test_video_processor(BOOL use_2d_buffer) }
load_resource(test->input_bitmap, &input_data, &input_data_len); - if (test->input_type_desc == nv12_default_stride || test->input_type_desc == nv12_with_aperture) + if (test->input_type_desc == nv12_default_stride || test->input_type_desc == nv12_with_aperture + || test->input_type_desc == nv12_extra_height) { /* skip BMP header and RGB data from the dump */ length = *(DWORD *)(input_data + 2);