Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
93681fbd
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,发现更多精彩内容 >>
提交
93681fbd
编写于
5月 26, 2011
作者:
R
Ronald S. Bultje
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
swscale: fix compile on ppc.
上级
e758573a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
34 deletion
+45
-34
libswscale/ppc/swscale_altivec_template.c
libswscale/ppc/swscale_altivec_template.c
+16
-14
libswscale/ppc/swscale_template.c
libswscale/ppc/swscale_template.c
+16
-9
libswscale/ppc/yuv2rgb_altivec.c
libswscale/ppc/yuv2rgb_altivec.c
+9
-8
libswscale/swscale_internal.h
libswscale/swscale_internal.h
+4
-3
未找到文件。
libswscale/ppc/swscale_altivec_template.c
浏览文件 @
93681fbd
...
...
@@ -86,9 +86,11 @@ altivec_packIntArrayToCharArray(int *val, uint8_t* dest, int dstW)
}
static
inline
void
yuv2yuvX_altivec_real
(
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrSrc
,
int
chrFilterSize
,
uint8_t
*
dest
,
uint8_t
*
uDest
,
uint8_t
*
vDest
,
int
dstW
,
int
chrDstW
)
yuv2yuvX_altivec_real
(
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrUSrc
,
const
int16_t
**
chrVSrc
,
int
chrFilterSize
,
uint8_t
*
dest
,
uint8_t
*
uDest
,
uint8_t
*
vDest
,
int
dstW
,
int
chrDstW
)
{
const
vector
signed
int
vini
=
{(
1
<<
18
),
(
1
<<
18
),
(
1
<<
18
),
(
1
<<
18
)};
register
int
i
,
j
;
...
...
@@ -159,22 +161,22 @@ yuv2yuvX_altivec_real(const int16_t *lumFilter, const int16_t **lumSrc, int lumF
vChrFilter
=
vec_perm
(
vChrFilter
,
vChrFilter
,
perm0
);
vChrFilter
=
vec_splat
(
vChrFilter
,
0
);
// chrFilter[j] is loaded 8 times in vChrFilter
perm
=
vec_lvsl
(
0
,
chrSrc
[
j
]);
l1
=
vec_ld
(
0
,
chrSrc
[
j
]);
l1_V
=
vec_ld
(
2048
<<
1
,
chr
Src
[
j
]);
perm
=
vec_lvsl
(
0
,
chr
U
Src
[
j
]);
l1
=
vec_ld
(
0
,
chr
U
Src
[
j
]);
l1_V
=
vec_ld
(
0
,
chrV
Src
[
j
]);
for
(
i
=
0
;
i
<
(
chrDstW
-
7
);
i
+=
8
)
{
int
offset
=
i
<<
2
;
vector
signed
short
l2
=
vec_ld
((
i
<<
1
)
+
16
,
chrSrc
[
j
]);
vector
signed
short
l2_V
=
vec_ld
((
(
i
+
2048
)
<<
1
)
+
16
,
chr
Src
[
j
]);
vector
signed
short
l2
=
vec_ld
((
i
<<
1
)
+
16
,
chr
U
Src
[
j
]);
vector
signed
short
l2_V
=
vec_ld
((
i
<<
1
)
+
16
,
chrV
Src
[
j
]);
vector
signed
int
v1
=
vec_ld
(
offset
,
u
);
vector
signed
int
v2
=
vec_ld
(
offset
+
16
,
u
);
vector
signed
int
v1_V
=
vec_ld
(
offset
,
v
);
vector
signed
int
v2_V
=
vec_ld
(
offset
+
16
,
v
);
vector
signed
short
ls
=
vec_perm
(
l1
,
l2
,
perm
);
// chr
Src[j][i] ... chr
Src[j][i+7]
vector
signed
short
ls_V
=
vec_perm
(
l1_V
,
l2_V
,
perm
);
// chr
Src[j][i+2048] ... chrSrc[j][i+2055
]
vector
signed
short
ls
=
vec_perm
(
l1
,
l2
,
perm
);
// chr
USrc[j][i] ... chrU
Src[j][i+7]
vector
signed
short
ls_V
=
vec_perm
(
l1_V
,
l2_V
,
perm
);
// chr
VSrc[j][i] ... chrVSrc[j][i
]
vector
signed
int
i1
=
vec_mule
(
vChrFilter
,
ls
);
vector
signed
int
i2
=
vec_mulo
(
vChrFilter
,
ls
);
...
...
@@ -182,9 +184,9 @@ yuv2yuvX_altivec_real(const int16_t *lumFilter, const int16_t **lumSrc, int lumF
vector
signed
int
i2_V
=
vec_mulo
(
vChrFilter
,
ls_V
);
vector
signed
int
vf1
=
vec_mergeh
(
i1
,
i2
);
vector
signed
int
vf2
=
vec_mergel
(
i1
,
i2
);
// chr
Src[j][i] * chrFilter[j] ... chr
Src[j][i+7] * chrFilter[j]
vector
signed
int
vf2
=
vec_mergel
(
i1
,
i2
);
// chr
USrc[j][i] * chrFilter[j] ... chrU
Src[j][i+7] * chrFilter[j]
vector
signed
int
vf1_V
=
vec_mergeh
(
i1_V
,
i2_V
);
vector
signed
int
vf2_V
=
vec_mergel
(
i1_V
,
i2_V
);
// chr
Src[j][i] * chrFilter[j] ... chr
Src[j][i+7] * chrFilter[j]
vector
signed
int
vf2_V
=
vec_mergel
(
i1_V
,
i2_V
);
// chr
VSrc[j][i] * chrFilter[j] ... chrV
Src[j][i+7] * chrFilter[j]
vector
signed
int
vo1
=
vec_add
(
v1
,
vf1
);
vector
signed
int
vo2
=
vec_add
(
v2
,
vf2
);
...
...
@@ -200,8 +202,8 @@ yuv2yuvX_altivec_real(const int16_t *lumFilter, const int16_t **lumSrc, int lumF
l1_V
=
l2_V
;
}
for
(
;
i
<
chrDstW
;
i
++
)
{
u
[
i
]
+=
chrSrc
[
j
][
i
]
*
chrFilter
[
j
];
v
[
i
]
+=
chr
Src
[
j
][
i
+
2048
]
*
chrFilter
[
j
];
u
[
i
]
+=
chr
U
Src
[
j
][
i
]
*
chrFilter
[
j
];
v
[
i
]
+=
chr
VSrc
[
j
][
i
]
*
chrFilter
[
j
];
}
}
altivec_packIntArrayToCharArray
(
u
,
uDest
,
chrDstW
);
...
...
libswscale/ppc/swscale_template.c
浏览文件 @
93681fbd
...
...
@@ -24,21 +24,28 @@
#endif
#if COMPILE_TEMPLATE_ALTIVEC
static
inline
void
RENAME
(
yuv2yuvX
)(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrSrc
,
int
chrFilterSize
,
const
int16_t
**
alpSrc
,
uint8_t
*
dest
,
uint8_t
*
uDest
,
uint8_t
*
vDest
,
uint8_t
*
aDest
,
long
dstW
,
long
chrDstW
)
static
inline
void
RENAME
(
yuv2yuvX
)(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrUSrc
,
const
int16_t
**
chrVSrc
,
int
chrFilterSize
,
const
int16_t
**
alpSrc
,
uint8_t
*
dest
,
uint8_t
*
uDest
,
uint8_t
*
vDest
,
uint8_t
*
aDest
,
long
dstW
,
long
chrDstW
)
{
yuv2yuvX_altivec_real
(
lumFilter
,
lumSrc
,
lumFilterSize
,
chrFilter
,
chrSrc
,
chrFilterSize
,
chrFilter
,
chr
USrc
,
chrV
Src
,
chrFilterSize
,
dest
,
uDest
,
vDest
,
dstW
,
chrDstW
);
}
/**
* vertical scale YV12 to RGB
*/
static
inline
void
RENAME
(
yuv2packedX
)(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrSrc
,
int
chrFilterSize
,
const
int16_t
**
alpSrc
,
uint8_t
*
dest
,
long
dstW
,
long
dstY
)
static
inline
void
RENAME
(
yuv2packedX
)(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrUSrc
,
const
int16_t
**
chrVSrc
,
int
chrFilterSize
,
const
int16_t
**
alpSrc
,
uint8_t
*
dest
,
long
dstW
,
long
dstY
)
{
/* The following list of supported dstFormat values should
match what's found in the body of ff_yuv2packedX_altivec() */
...
...
@@ -47,11 +54,11 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, const int16_t *lumFilter,
c
->
dstFormat
==
PIX_FMT_BGR24
||
c
->
dstFormat
==
PIX_FMT_RGB24
||
c
->
dstFormat
==
PIX_FMT_RGBA
||
c
->
dstFormat
==
PIX_FMT_ARGB
))
ff_yuv2packedX_altivec
(
c
,
lumFilter
,
lumSrc
,
lumFilterSize
,
chrFilter
,
chrSrc
,
chrFilterSize
,
chrFilter
,
chr
USrc
,
chrV
Src
,
chrFilterSize
,
dest
,
dstW
,
dstY
);
else
yuv2packedXinC
(
c
,
lumFilter
,
lumSrc
,
lumFilterSize
,
chrFilter
,
chrSrc
,
chrFilterSize
,
chrFilter
,
chr
USrc
,
chrV
Src
,
chrFilterSize
,
alpSrc
,
dest
,
dstW
,
dstY
);
}
#endif
...
...
libswscale/ppc/yuv2rgb_altivec.c
浏览文件 @
93681fbd
...
...
@@ -778,10 +778,11 @@ void ff_yuv2rgb_init_tables_altivec(SwsContext *c, const int inv_table[4], int b
void
ff_yuv2packedX_altivec
(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrSrc
,
int
chrFilterSize
,
uint8_t
*
dest
,
int
dstW
,
int
dstY
)
ff_yuv2packedX_altivec
(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrUSrc
,
const
int16_t
**
chrVSrc
,
int
chrFilterSize
,
uint8_t
*
dest
,
int
dstW
,
int
dstY
)
{
int
i
,
j
;
vector
signed
short
X
,
X0
,
X1
,
Y0
,
U0
,
V0
,
Y1
,
U1
,
V1
,
U
,
V
;
...
...
@@ -816,9 +817,9 @@ ff_yuv2packedX_altivec(SwsContext *c,
V
=
RND
;
/* extract 8 coeffs from U,V */
for
(
j
=
0
;
j
<
chrFilterSize
;
j
++
)
{
X
=
vec_ld
(
0
,
&
chrSrc
[
j
][
i
/
2
]);
X
=
vec_ld
(
0
,
&
chr
U
Src
[
j
][
i
/
2
]);
U
=
vec_mradds
(
X
,
CCoeffs
[
j
],
U
);
X
=
vec_ld
(
0
,
&
chr
Src
[
j
][
i
/
2
+
2048
]);
X
=
vec_ld
(
0
,
&
chr
VSrc
[
j
][
i
/
2
]);
V
=
vec_mradds
(
X
,
CCoeffs
[
j
],
V
);
}
...
...
@@ -894,9 +895,9 @@ ff_yuv2packedX_altivec(SwsContext *c,
V
=
RND
;
/* extract 8 coeffs from U,V */
for
(
j
=
0
;
j
<
chrFilterSize
;
j
++
)
{
X
=
vec_ld
(
0
,
&
chrSrc
[
j
][
i
/
2
]);
X
=
vec_ld
(
0
,
&
chr
U
Src
[
j
][
i
/
2
]);
U
=
vec_mradds
(
X
,
CCoeffs
[
j
],
U
);
X
=
vec_ld
(
0
,
&
chr
Src
[
j
][
i
/
2
+
2048
]);
X
=
vec_ld
(
0
,
&
chr
VSrc
[
j
][
i
/
2
]);
V
=
vec_mradds
(
X
,
CCoeffs
[
j
],
V
);
}
...
...
libswscale/swscale_internal.h
浏览文件 @
93681fbd
...
...
@@ -333,9 +333,10 @@ SwsFunc ff_yuv2rgb_init_mlib(SwsContext *c);
SwsFunc
ff_yuv2rgb_init_altivec
(
SwsContext
*
c
);
SwsFunc
ff_yuv2rgb_get_func_ptr_bfin
(
SwsContext
*
c
);
void
ff_bfin_get_unscaled_swscale
(
SwsContext
*
c
);
void
ff_yuv2packedX_altivec
(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrSrc
,
int
chrFilterSize
,
void
ff_yuv2packedX_altivec
(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrUSrc
,
const
int16_t
**
chrVSrc
,
int
chrFilterSize
,
uint8_t
*
dest
,
int
dstW
,
int
dstY
);
const
char
*
sws_format_name
(
enum
PixelFormat
format
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录