Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
e2babb9b
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,发现更多精彩内容 >>
提交
e2babb9b
编写于
6月 09, 2011
作者:
R
Ronald S. Bultje
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
swscale: rearrange code.
This way the code in the file is less cluttered all-over-the- place.
上级
85e9e3a9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
83 addition
and
83 deletion
+83
-83
libswscale/swscale.c
libswscale/swscale.c
+83
-83
未找到文件。
libswscale/swscale.c
浏览文件 @
e2babb9b
...
...
@@ -329,6 +329,33 @@ 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
,
uint8_t
*
uDest
,
uint8_t
*
vDest
,
uint8_t
*
aDest
,
int
dstW
,
int
chrDstW
)
{
int
i
;
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
int
val
=
(
lumSrc
[
i
]
+
64
)
>>
7
;
dest
[
i
]
=
av_clip_uint8
(
val
);
}
if
(
uDest
)
for
(
i
=
0
;
i
<
chrDstW
;
i
++
)
{
int
u
=
(
chrUSrc
[
i
]
+
64
)
>>
7
;
int
v
=
(
chrVSrc
[
i
]
+
64
)
>>
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
]
+
64
)
>>
7
;
aDest
[
i
]
=
av_clip_uint8
(
val
);
}
}
static
void
yuv2nv12X_c
(
SwsContext
*
c
,
const
int16_t
*
lumFilter
,
const
int16_t
**
lumSrc
,
int
lumFilterSize
,
const
int16_t
*
chrFilter
,
const
int16_t
**
chrUSrc
,
...
...
@@ -996,6 +1023,46 @@ static void yuv2rgbX_c_full(SwsContext *c, const int16_t *lumFilter,
}
}
/**
* vertical bilinear scale YV12 to RGB
*/
static
void
yuv2packed2_c
(
SwsContext
*
c
,
const
uint16_t
*
buf0
,
const
uint16_t
*
buf1
,
const
uint16_t
*
ubuf0
,
const
uint16_t
*
ubuf1
,
const
uint16_t
*
vbuf0
,
const
uint16_t
*
vbuf1
,
const
uint16_t
*
abuf0
,
const
uint16_t
*
abuf1
,
uint8_t
*
dest
,
int
dstW
,
int
yalpha
,
int
uvalpha
,
int
y
)
{
int
yalpha1
=
4095
-
yalpha
;
int
uvalpha1
=
4095
-
uvalpha
;
int
i
;
YSCALE_YUV_2_ANYRGB_C
(
YSCALE_YUV_2_RGB2_C
,
YSCALE_YUV_2_PACKED2_C
(
void
,
0
),
YSCALE_YUV_2_MONO2_C
)
}
/**
* YV12 to RGB without scaling or interpolating
*/
static
void
yuv2packed1_c
(
SwsContext
*
c
,
const
uint16_t
*
buf0
,
const
uint16_t
*
ubuf0
,
const
uint16_t
*
ubuf1
,
const
uint16_t
*
vbuf0
,
const
uint16_t
*
vbuf1
,
const
uint16_t
*
abuf0
,
uint8_t
*
dest
,
int
dstW
,
int
uvalpha
,
enum
PixelFormat
dstFormat
,
int
flags
,
int
y
)
{
const
int
yalpha1
=
0
;
int
i
;
const
uint16_t
*
buf1
=
buf0
;
//FIXME needed for RGB1/BGR1
const
int
yalpha
=
4096
;
//FIXME ...
if
(
uvalpha
<
2048
)
{
YSCALE_YUV_2_ANYRGB_C
(
YSCALE_YUV_2_RGB1_C
,
YSCALE_YUV_2_PACKED1_C
(
void
,
0
),
YSCALE_YUV_2_MONO2_C
)
}
else
{
YSCALE_YUV_2_ANYRGB_C
(
YSCALE_YUV_2_RGB1B_C
,
YSCALE_YUV_2_PACKED1B_C
(
void
,
0
),
YSCALE_YUV_2_MONO2_C
)
}
}
static
av_always_inline
void
fillPlane
(
uint8_t
*
plane
,
int
stride
,
int
width
,
int
height
,
int
y
,
uint8_t
val
)
...
...
@@ -1111,22 +1178,6 @@ BGR2Y(uint16_t, bgr15ToY, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RY<<10, GY<<5, BY
BGR2Y
(
uint16_t
,
rgb16ToY
,
0
,
0
,
0
,
0xF800
,
0x07E0
,
0x001F
,
RY
,
GY
<<
5
,
BY
<<
11
,
RGB2YUV_SHIFT
+
8
)
BGR2Y
(
uint16_t
,
rgb15ToY
,
0
,
0
,
0
,
0x7C00
,
0x03E0
,
0x001F
,
RY
,
GY
<<
5
,
BY
<<
10
,
RGB2YUV_SHIFT
+
7
)
static
void
abgrToA_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
dst
[
i
]
=
src
[
4
*
i
];
}
}
static
void
rgbaToA_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
dst
[
i
]
=
src
[
4
*
i
+
3
];
}
}
#define BGR2UV(type, name, shr, shg, shb, shp, maskr, maskg, maskb, RU, GU, BU, RV, GV, BV, S) \
static void name ## _c(uint8_t *dstU, uint8_t *dstV, \
const uint8_t *src, const uint8_t *dummy, \
...
...
@@ -1171,6 +1222,22 @@ BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<
BGR2UV
(
uint16_t
,
rgb16ToUV
,
0
,
0
,
0
,
0
,
0xF800
,
0x07E0
,
0x001F
,
RU
,
GU
<<
5
,
BU
<<
11
,
RV
,
GV
<<
5
,
BV
<<
11
,
RGB2YUV_SHIFT
+
8
)
BGR2UV
(
uint16_t
,
rgb15ToUV
,
0
,
0
,
0
,
0
,
0x7C00
,
0x03E0
,
0x001F
,
RU
,
GU
<<
5
,
BU
<<
10
,
RV
,
GV
<<
5
,
BV
<<
10
,
RGB2YUV_SHIFT
+
7
)
static
void
abgrToA_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
dst
[
i
]
=
src
[
4
*
i
];
}
}
static
void
rgbaToA_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
dst
[
i
]
=
src
[
4
*
i
+
3
];
}
}
static
void
palToY_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
pal
)
{
int
i
;
...
...
@@ -1217,73 +1284,6 @@ static void monoblack2Y_c(uint8_t *dst, const uint8_t *src,
}
}
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
,
uint8_t
*
uDest
,
uint8_t
*
vDest
,
uint8_t
*
aDest
,
int
dstW
,
int
chrDstW
)
{
int
i
;
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
int
val
=
(
lumSrc
[
i
]
+
64
)
>>
7
;
dest
[
i
]
=
av_clip_uint8
(
val
);
}
if
(
uDest
)
for
(
i
=
0
;
i
<
chrDstW
;
i
++
)
{
int
u
=
(
chrUSrc
[
i
]
+
64
)
>>
7
;
int
v
=
(
chrVSrc
[
i
]
+
64
)
>>
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
]
+
64
)
>>
7
;
aDest
[
i
]
=
av_clip_uint8
(
val
);
}
}
/**
* vertical bilinear scale YV12 to RGB
*/
static
void
yuv2packed2_c
(
SwsContext
*
c
,
const
uint16_t
*
buf0
,
const
uint16_t
*
buf1
,
const
uint16_t
*
ubuf0
,
const
uint16_t
*
ubuf1
,
const
uint16_t
*
vbuf0
,
const
uint16_t
*
vbuf1
,
const
uint16_t
*
abuf0
,
const
uint16_t
*
abuf1
,
uint8_t
*
dest
,
int
dstW
,
int
yalpha
,
int
uvalpha
,
int
y
)
{
int
yalpha1
=
4095
-
yalpha
;
int
uvalpha1
=
4095
-
uvalpha
;
int
i
;
YSCALE_YUV_2_ANYRGB_C
(
YSCALE_YUV_2_RGB2_C
,
YSCALE_YUV_2_PACKED2_C
(
void
,
0
),
YSCALE_YUV_2_MONO2_C
)
}
/**
* YV12 to RGB without scaling or interpolating
*/
static
void
yuv2packed1_c
(
SwsContext
*
c
,
const
uint16_t
*
buf0
,
const
uint16_t
*
ubuf0
,
const
uint16_t
*
ubuf1
,
const
uint16_t
*
vbuf0
,
const
uint16_t
*
vbuf1
,
const
uint16_t
*
abuf0
,
uint8_t
*
dest
,
int
dstW
,
int
uvalpha
,
enum
PixelFormat
dstFormat
,
int
flags
,
int
y
)
{
const
int
yalpha1
=
0
;
int
i
;
const
uint16_t
*
buf1
=
buf0
;
//FIXME needed for RGB1/BGR1
const
int
yalpha
=
4096
;
//FIXME ...
if
(
uvalpha
<
2048
)
{
YSCALE_YUV_2_ANYRGB_C
(
YSCALE_YUV_2_RGB1_C
,
YSCALE_YUV_2_PACKED1_C
(
void
,
0
),
YSCALE_YUV_2_MONO2_C
)
}
else
{
YSCALE_YUV_2_ANYRGB_C
(
YSCALE_YUV_2_RGB1B_C
,
YSCALE_YUV_2_PACKED1B_C
(
void
,
0
),
YSCALE_YUV_2_MONO2_C
)
}
}
//FIXME yuy2* can read up to 7 samples too much
static
void
yuy2ToY_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录