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
aaca69c1
Commit
aaca69c1
authored
May 24, 2011
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: remove swScale_{c,MMX,MMX2} duplication.
parent
c4fd283a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
302 deletions
+28
-302
swscale.c
libswscale/swscale.c
+5
-10
swscale_template.c
libswscale/swscale_template.c
+10
-0
swscale_template.c
libswscale/x86/swscale_template.c
+13
-292
No files found.
libswscale/swscale.c
View file @
aaca69c1
...
...
@@ -1214,18 +1214,13 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
sws_init_swScale_c
(
c
);
#if HAVE_MMX2
// ordered per speed fastest first
if
(
cpu_flags
&
AV_CPU_FLAG_MMX2
)
{
sws_init_swScale_MMX2
(
c
);
return
swScale_MMX2
;
}
else
#endif
#if HAVE_MMX
if
(
cpu_flags
&
AV_CPU_FLAG_MMX
)
{
if
(
cpu_flags
&
AV_CPU_FLAG_MMX
)
sws_init_swScale_MMX
(
c
);
return
swScale_MMX
;
}
else
#endif
#if HAVE_MMX2
if
(
cpu_flags
&
AV_CPU_FLAG_MMX2
)
sws_init_swScale_MMX2
(
c
);
#endif
#if HAVE_ALTIVEC
if
(
cpu_flags
&
AV_CPU_FLAG_ALTIVEC
)
...
...
libswscale/swscale_template.c
View file @
aaca69c1
...
...
@@ -485,6 +485,11 @@ inline static void hcscale_c(SwsContext *c, uint16_t *dst, long dstWidth,
#define DEBUG_SWSCALE_BUFFERS 0
#define DEBUG_BUFFERS(...) if (DEBUG_SWSCALE_BUFFERS) av_log(c, AV_LOG_DEBUG, __VA_ARGS__)
#if HAVE_MMX
static
void
updateMMXDitherTables
(
SwsContext
*
c
,
int
dstY
,
int
lumBufIndex
,
int
chrBufIndex
,
int
lastInLumBuf
,
int
lastInChrBuf
);
#endif
static
int
swScale_c
(
SwsContext
*
c
,
const
uint8_t
*
src
[],
int
srcStride
[],
int
srcSliceY
,
int
srcSliceH
,
uint8_t
*
dst
[],
int
dstStride
[])
{
...
...
@@ -656,6 +661,7 @@ static int swScale_c(SwsContext *c, const uint8_t* src[], int srcStride[],
if
(
!
enough_lines
)
break
;
//we can't output a dstY line so let's try with the next slice
if
(
HAVE_MMX
)
updateMMXDitherTables
(
c
,
dstY
,
lumBufIndex
,
chrBufIndex
,
lastInLumBuf
,
lastInChrBuf
);
if
(
dstY
<
dstH
-
2
)
{
const
int16_t
**
lumSrcPtr
=
(
const
int16_t
**
)
lumPixBuf
+
lumBufIndex
+
firstLumSrcY
-
lastInLumBuf
+
vLumBufSize
;
const
int16_t
**
chrSrcPtr
=
(
const
int16_t
**
)
chrPixBuf
+
chrBufIndex
+
firstChrSrcY
-
lastInChrBuf
+
vChrBufSize
;
...
...
@@ -780,6 +786,10 @@ static int swScale_c(SwsContext *c, const uint8_t* src[], int srcStride[],
if
((
dstFormat
==
PIX_FMT_YUVA420P
)
&&
!
alpPixBuf
)
fillPlane
(
dst
[
3
],
dstStride
[
3
],
dstW
,
dstY
-
lastDstY
,
lastDstY
,
255
);
if
(
HAVE_MMX2
&&
av_get_cpu_flags
()
&
AV_CPU_FLAG_MMX2
)
__asm__
volatile
(
"sfence"
:::
"memory"
);
emms_c
();
/* store changed local vars back in the context */
c
->
dstY
=
dstY
;
c
->
lumBufIndex
=
lumBufIndex
;
...
...
libswscale/x86/swscale_template.c
View file @
aaca69c1
This diff is collapsed.
Click to expand it.
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