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
ca364a5b
Commit
ca364a5b
authored
Jun 06, 2011
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: extract SWS_FULL_CHR_H_INT conditional into init code.
parent
b3b28b08
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
40 deletions
+28
-40
swscale_altivec.c
libswscale/ppc/swscale_altivec.c
+1
-1
swscale.c
libswscale/swscale.c
+21
-39
swscale_template.c
libswscale/x86/swscale_template.c
+6
-0
No files found.
libswscale/ppc/swscale_altivec.c
View file @
ca364a5b
...
...
@@ -415,7 +415,7 @@ void ff_sws_init_swScale_altivec(SwsContext *c)
/* The following list of supported dstFormat values should
* match what's found in the body of ff_yuv2packedX_altivec() */
if
(
!
(
c
->
flags
&
SWS_BITEXACT
)
&&
!
c
->
alpPixBuf
&&
if
(
!
(
c
->
flags
&
(
SWS_BITEXACT
|
SWS_FULL_CHR_H_INT
)
)
&&
!
c
->
alpPixBuf
&&
(
c
->
dstFormat
==
PIX_FMT_ABGR
||
c
->
dstFormat
==
PIX_FMT_BGRA
||
c
->
dstFormat
==
PIX_FMT_BGR24
||
c
->
dstFormat
==
PIX_FMT_RGB24
||
c
->
dstFormat
==
PIX_FMT_RGBA
||
c
->
dstFormat
==
PIX_FMT_ARGB
))
{
...
...
libswscale/swscale.c
View file @
ca364a5b
...
...
@@ -1770,52 +1770,30 @@ static int swScale(SwsContext *c, const uint8_t* src[],
}
else
{
assert
(
lumSrcPtr
+
vLumFilterSize
-
1
<
lumPixBuf
+
vLumBufSize
*
2
);
assert
(
chrUSrcPtr
+
vChrFilterSize
-
1
<
chrUPixBuf
+
vChrBufSize
*
2
);
if
(
vLumFilterSize
==
1
&&
vChrFilterSize
==
2
)
{
//unscaled RGB
if
(
c
->
yuv2packed1
&&
vLumFilterSize
==
1
&&
vChrFilterSize
==
2
)
{
//unscaled RGB
int
chrAlpha
=
vChrFilter
[
2
*
dstY
+
1
];
if
(
flags
&
SWS_FULL_CHR_H_INT
)
{
yuv2rgbX_c_full
(
c
,
//FIXME write a packed1_full function
vLumFilter
+
dstY
*
vLumFilterSize
,
lumSrcPtr
,
vLumFilterSize
,
vChrFilter
+
dstY
*
vChrFilterSize
,
chrUSrcPtr
,
chrVSrcPtr
,
vChrFilterSize
,
alpSrcPtr
,
dest
,
dstW
,
dstY
);
}
else
{
c
->
yuv2packed1
(
c
,
*
lumSrcPtr
,
*
chrUSrcPtr
,
*
(
chrUSrcPtr
+
1
),
*
chrVSrcPtr
,
*
(
chrVSrcPtr
+
1
),
alpPixBuf
?
*
alpSrcPtr
:
NULL
,
dest
,
dstW
,
chrAlpha
,
dstFormat
,
flags
,
dstY
);
}
}
else
if
(
vLumFilterSize
==
2
&&
vChrFilterSize
==
2
)
{
//bilinear upscale RGB
}
else
if
(
c
->
yuv2packed2
&&
vLumFilterSize
==
2
&&
vChrFilterSize
==
2
)
{
//bilinear upscale RGB
int
lumAlpha
=
vLumFilter
[
2
*
dstY
+
1
];
int
chrAlpha
=
vChrFilter
[
2
*
dstY
+
1
];
lumMmxFilter
[
2
]
=
lumMmxFilter
[
3
]
=
vLumFilter
[
2
*
dstY
]
*
0x10001
;
chrMmxFilter
[
2
]
=
chrMmxFilter
[
3
]
=
vChrFilter
[
2
*
chrDstY
]
*
0x10001
;
if
(
flags
&
SWS_FULL_CHR_H_INT
)
{
yuv2rgbX_c_full
(
c
,
//FIXME write a packed2_full function
vLumFilter
+
dstY
*
vLumFilterSize
,
lumSrcPtr
,
vLumFilterSize
,
vChrFilter
+
dstY
*
vChrFilterSize
,
chrUSrcPtr
,
chrVSrcPtr
,
vChrFilterSize
,
alpSrcPtr
,
dest
,
dstW
,
dstY
);
}
else
{
c
->
yuv2packed2
(
c
,
*
lumSrcPtr
,
*
(
lumSrcPtr
+
1
),
*
chrUSrcPtr
,
*
(
chrUSrcPtr
+
1
),
*
chrVSrcPtr
,
*
(
chrVSrcPtr
+
1
),
alpPixBuf
?
*
alpSrcPtr
:
NULL
,
alpPixBuf
?
*
(
alpSrcPtr
+
1
)
:
NULL
,
dest
,
dstW
,
lumAlpha
,
chrAlpha
,
dstY
);
}
}
else
{
//general RGB
if
(
flags
&
SWS_FULL_CHR_H_INT
)
{
yuv2rgbX_c_full
(
c
,
vLumFilter
+
dstY
*
vLumFilterSize
,
lumSrcPtr
,
vLumFilterSize
,
vChrFilter
+
dstY
*
vChrFilterSize
,
chrUSrcPtr
,
chrVSrcPtr
,
vChrFilterSize
,
alpSrcPtr
,
dest
,
dstW
,
dstY
);
}
else
{
c
->
yuv2packedX
(
c
,
vLumFilter
+
dstY
*
vLumFilterSize
,
lumSrcPtr
,
vLumFilterSize
,
vChrFilter
+
dstY
*
vChrFilterSize
,
chrUSrcPtr
,
chrVSrcPtr
,
vChrFilterSize
,
alpSrcPtr
,
dest
,
dstW
,
dstY
);
}
}
}
}
else
{
// hmm looks like we can't use MMX here without overwriting this array's tail
const
int16_t
**
lumSrcPtr
=
(
const
int16_t
**
)
lumPixBuf
+
lumBufIndex
+
firstLumSrcY
-
lastInLumBuf
+
vLumBufSize
;
const
int16_t
**
chrUSrcPtr
=
(
const
int16_t
**
)
chrUPixBuf
+
chrBufIndex
+
firstChrSrcY
-
lastInChrBuf
+
vChrBufSize
;
...
...
@@ -1900,9 +1878,13 @@ static void sws_init_swScale_c(SwsContext *c)
c
->
yuv2yuv1
=
yuv2yuv1_c
;
c
->
yuv2yuvX
=
yuv2yuvX_c
;
}
if
(
c
->
flags
&
SWS_FULL_CHR_H_INT
)
{
c
->
yuv2packedX
=
yuv2rgbX_c_full
;
}
else
{
c
->
yuv2packed1
=
yuv2packed1_c
;
c
->
yuv2packed2
=
yuv2packed2_c
;
c
->
yuv2packedX
=
yuv2packedX_c
;
}
c
->
hScale
=
hScale_c
;
...
...
libswscale/x86/swscale_template.c
View file @
ca364a5b
...
...
@@ -2193,6 +2193,7 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
if
(
c
->
flags
&
SWS_ACCURATE_RND
)
{
c
->
yuv2yuv1
=
RENAME
(
yuv2yuv1_ar
);
c
->
yuv2yuvX
=
RENAME
(
yuv2yuvX_ar
);
if
(
!
(
c
->
flags
&
SWS_FULL_CHR_H_INT
))
{
switch
(
c
->
dstFormat
)
{
case
PIX_FMT_RGB32
:
c
->
yuv2packedX
=
RENAME
(
yuv2rgb32_X_ar
);
break
;
case
PIX_FMT_BGR24
:
c
->
yuv2packedX
=
RENAME
(
yuv2bgr24_X_ar
);
break
;
...
...
@@ -2201,9 +2202,11 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
case
PIX_FMT_YUYV422
:
c
->
yuv2packedX
=
RENAME
(
yuv2yuyv422_X_ar
);
break
;
default:
break
;
}
}
}
else
{
c
->
yuv2yuv1
=
RENAME
(
yuv2yuv1
);
c
->
yuv2yuvX
=
RENAME
(
yuv2yuvX
);
if
(
!
(
c
->
flags
&
SWS_FULL_CHR_H_INT
))
{
switch
(
c
->
dstFormat
)
{
case
PIX_FMT_RGB32
:
c
->
yuv2packedX
=
RENAME
(
yuv2rgb32_X
);
break
;
case
PIX_FMT_BGR24
:
c
->
yuv2packedX
=
RENAME
(
yuv2bgr24_X
);
break
;
...
...
@@ -2213,6 +2216,9 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
default:
break
;
}
}
}
}
if
(
!
(
c
->
flags
&
SWS_FULL_CHR_H_INT
))
{
switch
(
c
->
dstFormat
)
{
case
PIX_FMT_RGB32
:
c
->
yuv2packed1
=
RENAME
(
yuv2rgb32_1
);
...
...
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