Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
a65bdceb
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a65bdceb
编写于
7月 08, 2012
作者:
D
Diego Biurrun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
x86: mmx2 ---> mmxext in variable names
上级
652f5185
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
56 addition
and
45 deletion
+56
-45
libswscale/swscale_internal.h
libswscale/swscale_internal.h
+5
-5
libswscale/utils.c
libswscale/utils.c
+46
-34
libswscale/x86/swscale_template.c
libswscale/x86/swscale_template.c
+5
-6
未找到文件。
libswscale/swscale_internal.h
浏览文件 @
a65bdceb
...
...
@@ -307,12 +307,12 @@ typedef struct SwsContext {
int
vChrFilterSize
;
///< Vertical filter size for chroma pixels.
//@}
int
lumMmx
2FilterCodeSize
;
///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.
int
chrMmx
2FilterCodeSize
;
///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
uint8_t
*
lumMmx
2FilterCode
;
///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
uint8_t
*
chrMmx
2FilterCode
;
///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
int
lumMmx
extFilterCodeSize
;
///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes.
int
chrMmx
extFilterCodeSize
;
///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes.
uint8_t
*
lumMmx
extFilterCode
;
///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes.
uint8_t
*
chrMmx
extFilterCode
;
///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes.
int
canMMX
2
BeUsed
;
int
canMMX
EXT
BeUsed
;
int
dstY
;
///< Last destination vertical line output from last slice.
int
flags
;
///< Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc...
...
...
libswscale/utils.c
浏览文件 @
a65bdceb
...
...
@@ -1001,18 +1001,18 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
(
FFALIGN
(
srcW
,
16
)
*
2
*
FFALIGN
(
c
->
srcBpc
,
8
)
>>
3
)
+
16
,
fail
);
if
(
INLINE_MMXEXT
(
cpu_flags
)
&&
c
->
srcBpc
==
8
&&
c
->
dstBpc
<=
10
)
{
c
->
canMMX
2
BeUsed
=
(
dstW
>=
srcW
&&
(
dstW
&
31
)
==
0
&&
(
srcW
&
15
)
==
0
)
?
1
:
0
;
if
(
!
c
->
canMMX
2
BeUsed
&&
dstW
>=
srcW
&&
(
srcW
&
15
)
==
0
c
->
canMMX
EXT
BeUsed
=
(
dstW
>=
srcW
&&
(
dstW
&
31
)
==
0
&&
(
srcW
&
15
)
==
0
)
?
1
:
0
;
if
(
!
c
->
canMMX
EXT
BeUsed
&&
dstW
>=
srcW
&&
(
srcW
&
15
)
==
0
&&
(
flags
&
SWS_FAST_BILINEAR
))
{
if
(
flags
&
SWS_PRINT_INFO
)
av_log
(
c
,
AV_LOG_INFO
,
"output width is not a multiple of 32 -> no MMXEXT scaler
\n
"
);
}
if
(
usesHFilter
)
c
->
canMMX
2
BeUsed
=
0
;
c
->
canMMX
EXT
BeUsed
=
0
;
}
else
c
->
canMMX
2
BeUsed
=
0
;
c
->
canMMX
EXT
BeUsed
=
0
;
c
->
chrXInc
=
(((
int64_t
)
c
->
chrSrcW
<<
16
)
+
(
c
->
chrDstW
>>
1
))
/
c
->
chrDstW
;
c
->
chrYInc
=
(((
int64_t
)
c
->
chrSrcH
<<
16
)
+
(
c
->
chrDstH
>>
1
))
/
c
->
chrDstH
;
...
...
@@ -1025,7 +1025,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
* correct variant would be like the vertical one, but that would require
* some special code for the first and last pixel */
if
(
flags
&
SWS_FAST_BILINEAR
)
{
if
(
c
->
canMMX
2
BeUsed
)
{
if
(
c
->
canMMX
EXT
BeUsed
)
{
c
->
lumXInc
+=
20
;
c
->
chrXInc
+=
20
;
}
...
...
@@ -1042,38 +1042,50 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
{
#if HAVE_MMXEXT_INLINE
// can't downscale !!!
if
(
c
->
canMMX
2
BeUsed
&&
(
flags
&
SWS_FAST_BILINEAR
))
{
c
->
lumMmx
2
FilterCodeSize
=
initMMX2HScaler
(
dstW
,
c
->
lumXInc
,
NULL
,
NULL
,
NULL
,
8
);
c
->
chrMmx
2
FilterCodeSize
=
initMMX2HScaler
(
c
->
chrDstW
,
c
->
chrXInc
,
NULL
,
NULL
,
NULL
,
4
);
if
(
c
->
canMMX
EXT
BeUsed
&&
(
flags
&
SWS_FAST_BILINEAR
))
{
c
->
lumMmx
ext
FilterCodeSize
=
initMMX2HScaler
(
dstW
,
c
->
lumXInc
,
NULL
,
NULL
,
NULL
,
8
);
c
->
chrMmx
ext
FilterCodeSize
=
initMMX2HScaler
(
c
->
chrDstW
,
c
->
chrXInc
,
NULL
,
NULL
,
NULL
,
4
);
#if USE_MMAP
c
->
lumMmx2FilterCode
=
mmap
(
NULL
,
c
->
lumMmx2FilterCodeSize
,
PROT_READ
|
PROT_WRITE
,
MAP_PRIVATE
|
MAP_ANONYMOUS
,
-
1
,
0
);
c
->
chrMmx2FilterCode
=
mmap
(
NULL
,
c
->
chrMmx2FilterCodeSize
,
PROT_READ
|
PROT_WRITE
,
MAP_PRIVATE
|
MAP_ANONYMOUS
,
-
1
,
0
);
c
->
lumMmxextFilterCode
=
mmap
(
NULL
,
c
->
lumMmxextFilterCodeSize
,
PROT_READ
|
PROT_WRITE
,
MAP_PRIVATE
|
MAP_ANONYMOUS
,
-
1
,
0
);
c
->
chrMmxextFilterCode
=
mmap
(
NULL
,
c
->
chrMmxextFilterCodeSize
,
PROT_READ
|
PROT_WRITE
,
MAP_PRIVATE
|
MAP_ANONYMOUS
,
-
1
,
0
);
#elif HAVE_VIRTUALALLOC
c
->
lumMmx2FilterCode
=
VirtualAlloc
(
NULL
,
c
->
lumMmx2FilterCodeSize
,
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
);
c
->
chrMmx2FilterCode
=
VirtualAlloc
(
NULL
,
c
->
chrMmx2FilterCodeSize
,
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
);
c
->
lumMmxextFilterCode
=
VirtualAlloc
(
NULL
,
c
->
lumMmxextFilterCodeSize
,
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
);
c
->
chrMmxextFilterCode
=
VirtualAlloc
(
NULL
,
c
->
chrMmxextFilterCodeSize
,
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
);
#else
c
->
lumMmx
2FilterCode
=
av_malloc
(
c
->
lumMmx2
FilterCodeSize
);
c
->
chrMmx
2FilterCode
=
av_malloc
(
c
->
chrMmx2
FilterCodeSize
);
c
->
lumMmx
extFilterCode
=
av_malloc
(
c
->
lumMmxext
FilterCodeSize
);
c
->
chrMmx
extFilterCode
=
av_malloc
(
c
->
chrMmxext
FilterCodeSize
);
#endif
if
(
!
c
->
lumMmx
2FilterCode
||
!
c
->
chrMmx2
FilterCode
)
if
(
!
c
->
lumMmx
extFilterCode
||
!
c
->
chrMmxext
FilterCode
)
return
AVERROR
(
ENOMEM
);
FF_ALLOCZ_OR_GOTO
(
c
,
c
->
hLumFilter
,
(
dstW
/
8
+
8
)
*
sizeof
(
int16_t
),
fail
);
FF_ALLOCZ_OR_GOTO
(
c
,
c
->
hChrFilter
,
(
c
->
chrDstW
/
4
+
8
)
*
sizeof
(
int16_t
),
fail
);
FF_ALLOCZ_OR_GOTO
(
c
,
c
->
hLumFilterPos
,
(
dstW
/
2
/
8
+
8
)
*
sizeof
(
int32_t
),
fail
);
FF_ALLOCZ_OR_GOTO
(
c
,
c
->
hChrFilterPos
,
(
c
->
chrDstW
/
2
/
4
+
8
)
*
sizeof
(
int32_t
),
fail
);
initMMX2HScaler
(
dstW
,
c
->
lumXInc
,
c
->
lumMmx
2
FilterCode
,
initMMX2HScaler
(
dstW
,
c
->
lumXInc
,
c
->
lumMmx
ext
FilterCode
,
c
->
hLumFilter
,
c
->
hLumFilterPos
,
8
);
initMMX2HScaler
(
c
->
chrDstW
,
c
->
chrXInc
,
c
->
chrMmx
2
FilterCode
,
initMMX2HScaler
(
c
->
chrDstW
,
c
->
chrXInc
,
c
->
chrMmx
ext
FilterCode
,
c
->
hChrFilter
,
c
->
hChrFilterPos
,
4
);
#if USE_MMAP
mprotect
(
c
->
lumMmx
2FilterCode
,
c
->
lumMmx2
FilterCodeSize
,
PROT_EXEC
|
PROT_READ
);
mprotect
(
c
->
chrMmx
2FilterCode
,
c
->
chrMmx2
FilterCodeSize
,
PROT_EXEC
|
PROT_READ
);
mprotect
(
c
->
lumMmx
extFilterCode
,
c
->
lumMmxext
FilterCodeSize
,
PROT_EXEC
|
PROT_READ
);
mprotect
(
c
->
chrMmx
extFilterCode
,
c
->
chrMmxext
FilterCodeSize
,
PROT_EXEC
|
PROT_READ
);
#endif
}
else
#endif
/* HAVE_MMXEXT_INLINE */
...
...
@@ -1651,21 +1663,21 @@ void sws_freeContext(SwsContext *c)
#if HAVE_MMX_INLINE
#if USE_MMAP
if
(
c
->
lumMmx
2
FilterCode
)
munmap
(
c
->
lumMmx
2FilterCode
,
c
->
lumMmx2
FilterCodeSize
);
if
(
c
->
chrMmx
2
FilterCode
)
munmap
(
c
->
chrMmx
2FilterCode
,
c
->
chrMmx2
FilterCodeSize
);
if
(
c
->
lumMmx
ext
FilterCode
)
munmap
(
c
->
lumMmx
extFilterCode
,
c
->
lumMmxext
FilterCodeSize
);
if
(
c
->
chrMmx
ext
FilterCode
)
munmap
(
c
->
chrMmx
extFilterCode
,
c
->
chrMmxext
FilterCodeSize
);
#elif HAVE_VIRTUALALLOC
if
(
c
->
lumMmx
2
FilterCode
)
VirtualFree
(
c
->
lumMmx
2
FilterCode
,
0
,
MEM_RELEASE
);
if
(
c
->
chrMmx
2
FilterCode
)
VirtualFree
(
c
->
chrMmx
2
FilterCode
,
0
,
MEM_RELEASE
);
if
(
c
->
lumMmx
ext
FilterCode
)
VirtualFree
(
c
->
lumMmx
ext
FilterCode
,
0
,
MEM_RELEASE
);
if
(
c
->
chrMmx
ext
FilterCode
)
VirtualFree
(
c
->
chrMmx
ext
FilterCode
,
0
,
MEM_RELEASE
);
#else
av_free
(
c
->
lumMmx
2
FilterCode
);
av_free
(
c
->
chrMmx
2
FilterCode
);
av_free
(
c
->
lumMmx
ext
FilterCode
);
av_free
(
c
->
chrMmx
ext
FilterCode
);
#endif
c
->
lumMmx
2
FilterCode
=
NULL
;
c
->
chrMmx
2
FilterCode
=
NULL
;
c
->
lumMmx
ext
FilterCode
=
NULL
;
c
->
chrMmx
ext
FilterCode
=
NULL
;
#endif
/* HAVE_MMX_INLINE */
av_freep
(
&
c
->
yuvTable
);
...
...
libswscale/x86/swscale_template.c
浏览文件 @
a65bdceb
...
...
@@ -1378,7 +1378,7 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
{
int32_t
*
filterPos
=
c
->
hLumFilterPos
;
int16_t
*
filter
=
c
->
hLumFilter
;
void
*
mmx
2FilterCode
=
c
->
lumMmx2
FilterCode
;
void
*
mmx
extFilterCode
=
c
->
lumMmxext
FilterCode
;
int
i
;
#if defined(PIC)
uint64_t
ebxsave
;
...
...
@@ -1451,7 +1451,7 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
#endif
#endif
::
"m"
(
src
),
"m"
(
dst
),
"m"
(
filter
),
"m"
(
filterPos
),
"m"
(
mmx
2
FilterCode
)
"m"
(
mmx
ext
FilterCode
)
#if defined(PIC)
,
"m"
(
ebxsave
)
#endif
...
...
@@ -1474,7 +1474,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
{
int32_t
*
filterPos
=
c
->
hChrFilterPos
;
int16_t
*
filter
=
c
->
hChrFilter
;
void
*
mmx
2FilterCode
=
c
->
chrMmx2
FilterCode
;
void
*
mmx
extFilterCode
=
c
->
chrMmxext
FilterCode
;
int
i
;
#if defined(PIC)
DECLARE_ALIGNED
(
8
,
uint64_t
,
ebxsave
);
...
...
@@ -1535,7 +1535,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
#endif
#endif
::
"m"
(
src1
),
"m"
(
dst1
),
"m"
(
filter
),
"m"
(
filterPos
),
"m"
(
mmx
2
FilterCode
),
"m"
(
src2
),
"m"
(
dst2
)
"m"
(
mmx
ext
FilterCode
),
"m"
(
src2
),
"m"
(
dst2
)
#if defined(PIC)
,
"m"
(
ebxsave
)
#endif
...
...
@@ -1617,8 +1617,7 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
if
(
c
->
srcBpc
==
8
&&
c
->
dstBpc
<=
10
)
{
// Use the new MMX scaler if the MMXEXT one can't be used (it is faster than the x86 ASM one).
#if COMPILE_TEMPLATE_MMXEXT
if
(
c
->
flags
&
SWS_FAST_BILINEAR
&&
c
->
canMMX2BeUsed
)
{
if
(
c
->
flags
&
SWS_FAST_BILINEAR
&&
c
->
canMMXEXTBeUsed
)
{
c
->
hyscale_fast
=
RENAME
(
hyscale_fast
);
c
->
hcscale_fast
=
RENAME
(
hcscale_fast
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录