Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
34e8d147
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,发现更多精彩内容 >>
提交
34e8d147
编写于
9月 30, 2011
作者:
K
Kieran Kunhya
提交者:
Ronald S. Bultje
10月 22, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Split out yuv2yuv1 luma and chroma in order to make them generic DSP functions
Signed-off-by:
N
Ronald S. Bultje
<
rsbultje@gmail.com
>
上级
9abc9873
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
47 deletion
+29
-47
libswscale/swscale.c
libswscale/swscale.c
+15
-27
libswscale/swscale_internal.h
libswscale/swscale_internal.h
+10
-16
libswscale/x86/swscale_template.c
libswscale/x86/swscale_template.c
+4
-4
未找到文件。
libswscale/swscale.c
浏览文件 @
34e8d147
...
...
@@ -386,34 +386,14 @@ static void yuv2yuvX_c(SwsContext *c, const int16_t *lumFilter,
}
}
static
void
yuv2yuv1_c
(
SwsContext
*
c
,
const
int16_t
*
lumSrc
,
const
int16_t
*
chrUSrc
,
const
int16_t
*
chrVSrc
,
const
int16_t
*
alpSrc
,
uint8_t
*
dest
[
4
],
int
dstW
,
int
chrDstW
)
static
void
yuv2yuv1_c
(
const
int16_t
*
src
,
uint8_t
*
dest
,
int
dstW
,
const
uint8_t
*
dither
,
int
offset
)
{
uint8_t
*
yDest
=
dest
[
0
],
*
uDest
=
dest
[
1
],
*
vDest
=
dest
[
2
],
*
aDest
=
CONFIG_SWSCALE_ALPHA
?
dest
[
3
]
:
NULL
;
int
i
;
const
uint8_t
*
lumDither
=
c
->
lumDither8
,
*
chrDither
=
c
->
chrDither8
;
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
int
val
=
(
lumSrc
[
i
]
+
lumDither
[
i
&
7
])
>>
7
;
yD
est
[
i
]
=
av_clip_uint8
(
val
);
int
val
=
(
src
[
i
]
+
dither
[(
i
+
offset
)
&
7
])
>>
7
;
d
est
[
i
]
=
av_clip_uint8
(
val
);
}
if
(
uDest
)
for
(
i
=
0
;
i
<
chrDstW
;
i
++
)
{
int
u
=
(
chrUSrc
[
i
]
+
chrDither
[
i
&
7
])
>>
7
;
int
v
=
(
chrVSrc
[
i
]
+
chrDither
[(
i
+
3
)
&
7
])
>>
7
;
uDest
[
i
]
=
av_clip_uint8
(
u
);
vDest
[
i
]
=
av_clip_uint8
(
v
);
}
if
(
CONFIG_SWSCALE_ALPHA
&&
aDest
)
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
int
val
=
(
alpSrc
[
i
]
+
lumDither
[
i
&
7
])
>>
7
;
aDest
[
i
]
=
av_clip_uint8
(
val
);
}
}
static
void
yuv2nv12X_c
(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
...
...
@@ -2582,10 +2562,18 @@ static int swScale(SwsContext *c, const uint8_t* src[],
const
int
chrSkipMask
=
(
1
<<
c
->
chrDstVSubSample
)
-
1
;
if
((
dstY
&
chrSkipMask
)
||
isGray
(
dstFormat
))
dest
[
1
]
=
dest
[
2
]
=
NULL
;
//FIXME split functions in lumi / chromi
const
int16_t
*
alpBuf
=
(
CONFIG_SWSCALE_ALPHA
&&
alpPixBuf
)
?
alpSrcPtr
[
0
]
:
NULL
;
if
(
c
->
yuv2yuv1
&&
vLumFilterSize
==
1
&&
vChrFilterSize
==
1
)
{
// unscaled YV12
const
int16_t
*
alpBuf
=
(
CONFIG_SWSCALE_ALPHA
&&
alpPixBuf
)
?
alpSrcPtr
[
0
]
:
NULL
;
yuv2yuv1
(
c
,
lumSrcPtr
[
0
],
chrUSrcPtr
[
0
],
chrVSrcPtr
[
0
],
alpBuf
,
dest
,
dstW
,
chrDstW
);
yuv2yuv1
(
lumSrcPtr
[
0
],
dest
[
0
],
dstW
,
c
->
lumDither8
,
0
);
if
(
dest
[
1
]){
yuv2yuv1
(
chrUSrcPtr
[
0
],
dest
[
1
],
chrDstW
,
c
->
chrDither8
,
0
);
yuv2yuv1
(
chrVSrcPtr
[
0
],
dest
[
2
],
chrDstW
,
c
->
chrDither8
,
3
);
}
if
(
alpBuf
&&
dest
[
3
])
yuv2yuv1
(
alpBuf
,
dest
[
3
],
dstW
,
c
->
lumDither8
,
0
);
}
else
{
//General YV12
yuv2yuvX
(
c
,
vLumFilter
+
dstY
*
vLumFilterSize
,
lumSrcPtr
,
vLumFilterSize
,
...
...
libswscale/swscale_internal.h
浏览文件 @
34e8d147
...
...
@@ -59,28 +59,22 @@ typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t* src[],
int
srcStride
[],
int
srcSliceY
,
int
srcSliceH
,
uint8_t
*
dst
[],
int
dstStride
[]);
/**
* Write one line of horizontally scaled
Y/U/V/A
to planar output
* Write one line of horizontally scaled
data
to planar output
* without any additional vertical scaling (or point-scaling).
*
* @param c SWS scaling context
* @param lumSrc scaled luma (Y) source data, 15bit for 8-10bit output,
* 19-bit for 16bit output (in int32_t)
* @param chrUSrc scaled chroma (U) source data, 15bit for 8-10bit output,
* @param src scaled source data, 15bit for 8-10bit output,
* 19-bit for 16bit output (in int32_t)
* @param chrVSrc scaled chroma (V) source data, 15bit for 8-10bit output,
* 19-bit for 16bit output (in int32_t)
* @param alpSrc scaled alpha (A) source data, 15bit for 8-10bit output,
* 19-bit for 16bit output (in int32_t)
* @param dest pointer to the 4 output planes (Y/U/V/A). For >8bit
* @param dest pointer to the output plane. For >8bit
* output, this is in uint16_t
* @param dstW width of dest[0], dest[3], lumSrc and alpSrc in pixels
* @param chrDstW width of dest[1], dest[2], chrUSrc and chrVSrc
* @param dstW width of destination in pixels
* @param dither ordered dither array of type int16_t and size 8
* @param offset Dither offset
*/
typedef
void
(
*
yuv2planar1_fn
)
(
struct
SwsContext
*
c
,
const
int16_t
*
lumSrc
,
const
int16_t
*
chrUSrc
,
const
int16_t
*
chrVSrc
,
const
int16_t
*
alpSrc
,
uint8_t
*
dest
[
4
],
int
dstW
,
int
chrDstW
);
typedef
void
(
*
yuv2planar1_fn
)
(
const
int16_t
*
src
,
uint8_t
*
dest
,
int
dstW
,
const
uint8_t
*
dither
,
int
offset
);
/**
* Write one line of horizontally scaled Y/U/V/A to planar output
* with multi-point vertical scaling between input pixels.
...
...
libswscale/x86/swscale_template.c
浏览文件 @
34e8d147
...
...
@@ -2103,8 +2103,8 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
dstFormat
!=
PIX_FMT_NV12
&&
dstFormat
!=
PIX_FMT_NV21
)
{
if
(
!
(
c
->
flags
&
SWS_BITEXACT
))
{
if
(
c
->
flags
&
SWS_ACCURATE_RND
)
{
c
->
yuv2yuv1
=
RENAME
(
yuv2yuv1_ar
);
c
->
yuv2yuvX
=
RENAME
(
yuv2yuvX_ar
);
//
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
;
...
...
@@ -2116,8 +2116,8 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
}
}
}
else
{
c
->
yuv2yuv1
=
RENAME
(
yuv2yuv1
);
c
->
yuv2yuvX
=
RENAME
(
yuv2yuvX
);
//
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录