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
74fdb7a0
Commit
74fdb7a0
authored
Oct 23, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sws: factorize v*Filter use
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
4d31f420
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
swscale.c
libswscale/swscale.c
+10
-7
No files found.
libswscale/swscale.c
View file @
74fdb7a0
...
...
@@ -2473,8 +2473,6 @@ static int swScale(SwsContext *c, const uint8_t* src[],
int16_t
*
vChrFilterPos
=
c
->
vChrFilterPos
;
int16_t
*
hLumFilterPos
=
c
->
hLumFilterPos
;
int16_t
*
hChrFilterPos
=
c
->
hChrFilterPos
;
int16_t
*
vLumFilter
=
c
->
vLumFilter
;
int16_t
*
vChrFilter
=
c
->
vChrFilter
;
int16_t
*
hLumFilter
=
c
->
hLumFilter
;
int16_t
*
hChrFilter
=
c
->
hChrFilter
;
int32_t
*
lumMmxFilter
=
c
->
lumMmxFilter
;
...
...
@@ -2662,27 +2660,32 @@ static int swScale(SwsContext *c, const uint8_t* src[],
const
int16_t
**
chrUSrcPtr
=
(
const
int16_t
**
)
chrUPixBuf
+
chrBufIndex
+
firstChrSrcY
-
lastInChrBuf
+
vChrBufSize
;
const
int16_t
**
chrVSrcPtr
=
(
const
int16_t
**
)
chrVPixBuf
+
chrBufIndex
+
firstChrSrcY
-
lastInChrBuf
+
vChrBufSize
;
const
int16_t
**
alpSrcPtr
=
(
CONFIG_SWSCALE_ALPHA
&&
alpPixBuf
)
?
(
const
int16_t
**
)
alpPixBuf
+
lumBufIndex
+
firstLumSrcY
-
lastInLumBuf
+
vLumBufSize
:
NULL
;
int16_t
*
vLumFilter
=
c
->
vLumFilter
;
int16_t
*
vChrFilter
=
c
->
vChrFilter
;
if
(
isPlanarYUV
(
dstFormat
)
||
dstFormat
==
PIX_FMT_GRAY8
)
{
//YV12 like
const
int
chrSkipMask
=
(
1
<<
c
->
chrDstVSubSample
)
-
1
;
vLumFilter
+=
dstY
*
vLumFilterSize
;
vChrFilter
+=
chrDstY
*
vChrFilterSize
;
if
(
vLumFilterSize
==
1
)
{
yuv2plane1
(
lumSrcPtr
[
0
],
dest
[
0
],
dstW
,
c
->
lumDither8
,
0
);
}
else
{
yuv2planeX
(
vLumFilter
+
dstY
*
vLumFilterSize
,
vLumFilterSize
,
yuv2planeX
(
vLumFilter
,
vLumFilterSize
,
lumSrcPtr
,
dest
[
0
],
dstW
,
c
->
lumDither8
,
0
);
}
if
(
!
((
dstY
&
chrSkipMask
)
||
isGray
(
dstFormat
)))
{
if
(
yuv2nv12cX
)
{
yuv2nv12cX
(
c
,
vChrFilter
+
chrDstY
*
vChrFilterSize
,
vChrFilterSize
,
chrUSrcPtr
,
chrVSrcPtr
,
dest
[
1
],
chrDstW
);
yuv2nv12cX
(
c
,
vChrFilter
,
vChrFilterSize
,
chrUSrcPtr
,
chrVSrcPtr
,
dest
[
1
],
chrDstW
);
}
else
if
(
vChrFilterSize
==
1
)
{
yuv2plane1
(
chrUSrcPtr
[
0
],
dest
[
1
],
chrDstW
,
c
->
chrDither8
,
0
);
yuv2plane1
(
chrVSrcPtr
[
0
],
dest
[
2
],
chrDstW
,
c
->
chrDither8
,
3
);
}
else
{
yuv2planeX
(
vChrFilter
+
chrDstY
*
vChrFilterSize
,
vChrFilterSize
,
yuv2planeX
(
vChrFilter
,
vChrFilterSize
,
chrUSrcPtr
,
dest
[
1
],
chrDstW
,
c
->
chrDither8
,
0
);
yuv2planeX
(
vChrFilter
+
chrDstY
*
vChrFilterSize
,
vChrFilterSize
,
yuv2planeX
(
vChrFilter
,
vChrFilterSize
,
chrVSrcPtr
,
dest
[
2
],
chrDstW
,
c
->
chrDither8
,
3
);
}
}
...
...
@@ -2691,7 +2694,7 @@ static int swScale(SwsContext *c, const uint8_t* src[],
if
(
vLumFilterSize
==
1
)
{
yuv2plane1
(
alpSrcPtr
[
0
],
dest
[
3
],
dstW
,
c
->
lumDither8
,
0
);
}
else
{
yuv2planeX
(
vLumFilter
+
dstY
*
vLumFilterSize
,
vLumFilterSize
,
yuv2planeX
(
vLumFilter
,
vLumFilterSize
,
alpSrcPtr
,
dest
[
3
],
dstW
,
c
->
lumDither8
,
0
);
}
}
...
...
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