Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
48055460
Commit
48055460
authored
Jun 14, 2022
by
Giovanni Mascellani
Committed by
Alexandre Julliard
May 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/buffer: Support YV12, I420 and IYUV image formats.
parent
6d1fc909
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
buffer.c
dlls/mfplat/buffer.c
+10
-3
mfplat.c
dlls/mfplat/tests/mfplat.c
+42
-0
No files found.
dlls/mfplat/buffer.c
View file @
48055460
...
...
@@ -1345,6 +1345,9 @@ static p_copy_image_func get_2d_buffer_copy_func(DWORD fourcc)
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'4'
):
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'1'
):
case
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'4'
,
'2'
,
'0'
):
case
MAKEFOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
):
return
copy_image_imc2
;
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
):
...
...
@@ -1389,12 +1392,12 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'4'
):
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'1'
):
plane_size
=
stride
*
3
/
2
*
height
;
break
;
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
):
case
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'4'
,
'2'
,
'0'
):
case
MAKEFOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
):
plane_size
=
stride
*
3
/
2
*
height
;
break
;
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
):
plane_size
=
stride
*
height
*
3
/
2
;
break
;
default:
...
...
@@ -1412,6 +1415,8 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'4'
):
case
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
):
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'1'
):
case
MAKEFOURCC
(
'I'
,
'4'
,
'2'
,
'0'
):
case
MAKEFOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
):
row_alignment
=
MF_128_BYTE_ALIGNMENT
;
break
;
default:
...
...
@@ -1431,6 +1436,8 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'4'
):
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'1'
):
case
MAKEFOURCC
(
'I'
,
'4'
,
'2'
,
'0'
):
case
MAKEFOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
):
max_length
=
pitch
*
height
*
3
/
2
;
break
;
default:
...
...
dlls/mfplat/tests/mfplat.c
View file @
48055460
...
...
@@ -4522,6 +4522,42 @@ image_size_tests[] =
{
&
MFVideoFormat_NV11
,
3
,
2
,
12
,
9
,
384
,
8
,
128
},
{
&
MFVideoFormat_NV11
,
4
,
2
,
12
,
0
,
384
,
12
,
128
},
{
&
MFVideoFormat_NV11
,
320
,
240
,
115200
,
0
,
138240
,
115200
,
384
},
{
&
MFVideoFormat_YV12
,
1
,
1
,
3
,
1
,
192
,
1
,
128
},
{
&
MFVideoFormat_YV12
,
1
,
2
,
6
,
3
,
384
,
2
,
128
},
{
&
MFVideoFormat_YV12
,
1
,
3
,
9
,
4
,
576
,
3
,
128
},
{
&
MFVideoFormat_YV12
,
2
,
1
,
3
,
0
,
192
,
3
,
128
},
{
&
MFVideoFormat_YV12
,
2
,
2
,
6
,
6
,
384
,
6
,
128
},
{
&
MFVideoFormat_YV12
,
2
,
4
,
12
,
0
,
768
,
12
,
128
},
{
&
MFVideoFormat_YV12
,
3
,
2
,
12
,
9
,
384
,
8
,
128
},
{
&
MFVideoFormat_YV12
,
3
,
5
,
30
,
22
,
960
,
20
,
128
},
{
&
MFVideoFormat_YV12
,
4
,
2
,
12
,
0
,
384
,
12
,
128
},
{
&
MFVideoFormat_YV12
,
4
,
3
,
18
,
0
,
576
,
18
,
128
},
{
&
MFVideoFormat_YV12
,
320
,
240
,
115200
,
0
,
138240
,
115200
,
384
},
{
&
MFVideoFormat_I420
,
1
,
1
,
3
,
1
,
192
,
1
,
128
},
{
&
MFVideoFormat_I420
,
1
,
2
,
6
,
3
,
384
,
2
,
128
},
{
&
MFVideoFormat_I420
,
1
,
3
,
9
,
4
,
576
,
3
,
128
},
{
&
MFVideoFormat_I420
,
2
,
1
,
3
,
0
,
192
,
3
,
128
},
{
&
MFVideoFormat_I420
,
2
,
2
,
6
,
6
,
384
,
6
,
128
},
{
&
MFVideoFormat_I420
,
2
,
4
,
12
,
0
,
768
,
12
,
128
},
{
&
MFVideoFormat_I420
,
3
,
2
,
12
,
9
,
384
,
8
,
128
},
{
&
MFVideoFormat_I420
,
3
,
5
,
30
,
22
,
960
,
20
,
128
},
{
&
MFVideoFormat_I420
,
4
,
2
,
12
,
0
,
384
,
12
,
128
},
{
&
MFVideoFormat_I420
,
4
,
3
,
18
,
0
,
576
,
18
,
128
},
{
&
MFVideoFormat_I420
,
320
,
240
,
115200
,
0
,
138240
,
115200
,
384
},
{
&
MFVideoFormat_IYUV
,
1
,
1
,
3
,
1
,
192
,
1
,
128
},
{
&
MFVideoFormat_IYUV
,
1
,
2
,
6
,
3
,
384
,
2
,
128
},
{
&
MFVideoFormat_IYUV
,
1
,
3
,
9
,
4
,
576
,
3
,
128
},
{
&
MFVideoFormat_IYUV
,
2
,
1
,
3
,
0
,
192
,
3
,
128
},
{
&
MFVideoFormat_IYUV
,
2
,
2
,
6
,
6
,
384
,
6
,
128
},
{
&
MFVideoFormat_IYUV
,
2
,
4
,
12
,
0
,
768
,
12
,
128
},
{
&
MFVideoFormat_IYUV
,
3
,
2
,
12
,
9
,
384
,
8
,
128
},
{
&
MFVideoFormat_IYUV
,
3
,
5
,
30
,
22
,
960
,
20
,
128
},
{
&
MFVideoFormat_IYUV
,
4
,
2
,
12
,
0
,
384
,
12
,
128
},
{
&
MFVideoFormat_IYUV
,
4
,
3
,
18
,
0
,
576
,
18
,
128
},
{
&
MFVideoFormat_IYUV
,
320
,
240
,
115200
,
0
,
138240
,
115200
,
384
},
};
static
void
test_MFCalculateImageSize
(
void
)
...
...
@@ -6172,6 +6208,9 @@ static void test_MFCreate2DMediaBuffer(void)
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'4'
):
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'1'
):
case
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'4'
,
'2'
,
'0'
):
case
MAKEFOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
):
ok
(
stride
*
3
/
2
*
ptr
->
height
<=
length2
,
"Insufficient buffer space: expected at least %lu bytes, got only %lu
\n
"
,
stride
*
3
/
2
*
ptr
->
height
,
length2
);
for
(
j
=
0
;
j
<
ptr
->
height
;
j
++
)
...
...
@@ -6223,6 +6262,9 @@ static void test_MFCreate2DMediaBuffer(void)
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'4'
):
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'1'
):
case
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'4'
,
'2'
,
'0'
):
case
MAKEFOURCC
(
'I'
,
'Y'
,
'U'
,
'V'
):
for
(
j
=
0
;
j
<
ptr
->
height
;
j
++
)
for
(
k
=
0
;
k
<
stride
/
2
;
k
++
)
ok
(
data
[
j
*
(
pitch
/
2
)
+
k
]
==
(((
j
+
ptr
->
height
)
%
16
)
<<
4
)
+
(
k
%
16
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment