Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
39f75645
Commit
39f75645
authored
Sep 01, 2016
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: add unscaled copy from yuv420p10 to p010
parent
1c37be6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
swscale_unscaled.c
libswscale/swscale_unscaled.c
+44
-0
No files found.
libswscale/swscale_unscaled.c
View file @
39f75645
...
...
@@ -197,6 +197,45 @@ static int nv12ToPlanarWrapper(SwsContext *c, const uint8_t *src[],
return
srcSliceH
;
}
static
int
planarToP010Wrapper
(
SwsContext
*
c
,
const
uint8_t
*
src8
[],
int
srcStride
[],
int
srcSliceY
,
int
srcSliceH
,
uint8_t
*
dstParam8
[],
int
dstStride
[])
{
const
uint16_t
**
src
=
(
const
uint16_t
**
)
src8
;
uint16_t
*
dstY
=
(
uint16_t
*
)(
dstParam8
[
0
]
+
dstStride
[
0
]
*
srcSliceY
);
uint16_t
*
dstUV
=
(
uint16_t
*
)(
dstParam8
[
1
]
+
dstStride
[
1
]
*
srcSliceY
/
2
);
int
x
,
y
;
av_assert0
(
!
(
srcStride
[
0
]
%
2
||
srcStride
[
1
]
%
2
||
srcStride
[
2
]
%
2
||
dstStride
[
0
]
%
2
||
dstStride
[
1
]
%
2
));
for
(
y
=
0
;
y
<
srcSliceH
;
y
++
)
{
uint16_t
*
tdstY
=
dstY
;
const
uint16_t
*
tsrc0
=
src
[
0
];
for
(
x
=
c
->
srcW
;
x
>
0
;
x
--
)
{
*
tdstY
++
=
*
tsrc0
++
<<
6
;
}
src
[
0
]
+=
srcStride
[
0
]
/
2
;
dstY
+=
dstStride
[
0
]
/
2
;
if
(
!
(
y
&
1
))
{
uint16_t
*
tdstUV
=
dstUV
;
const
uint16_t
*
tsrc1
=
src
[
1
];
const
uint16_t
*
tsrc2
=
src
[
2
];
for
(
x
=
c
->
srcW
/
2
;
x
>
0
;
x
--
)
{
*
tdstUV
++
=
*
tsrc1
++
<<
6
;
*
tdstUV
++
=
*
tsrc2
++
<<
6
;
}
src
[
1
]
+=
srcStride
[
1
]
/
2
;
src
[
2
]
+=
srcStride
[
2
]
/
2
;
dstUV
+=
dstStride
[
1
]
/
2
;
}
}
return
srcSliceH
;
}
static
int
planarToYuy2Wrapper
(
SwsContext
*
c
,
const
uint8_t
*
src
[],
int
srcStride
[],
int
srcSliceY
,
int
srcSliceH
,
uint8_t
*
dstParam
[],
int
dstStride
[])
...
...
@@ -1601,6 +1640,11 @@ void ff_get_unscaled_swscale(SwsContext *c)
!
(
flags
&
SWS_ACCURATE_RND
)
&&
(
c
->
dither
==
SWS_DITHER_BAYER
||
c
->
dither
==
SWS_DITHER_AUTO
)
&&
!
(
dstH
&
1
))
{
c
->
swscale
=
ff_yuv2rgb_get_func_ptr
(
c
);
}
/* yuv420p10_to_p010 */
if
((
srcFormat
==
AV_PIX_FMT_YUV420P10
||
srcFormat
==
AV_PIX_FMT_YUVA420P10
)
&&
dstFormat
==
AV_PIX_FMT_P010
)
{
c
->
swscale
=
planarToP010Wrapper
;
}
if
(
srcFormat
==
AV_PIX_FMT_YUV410P
&&
!
(
dstH
&
3
)
&&
(
dstFormat
==
AV_PIX_FMT_YUV420P
||
dstFormat
==
AV_PIX_FMT_YUVA420P
)
&&
...
...
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