Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
cca81e7e
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,发现更多精彩内容 >>
提交
cca81e7e
编写于
10月 08, 2011
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sws: gbr24p input support
Signed-off-by:
N
Michael Niedermayer
<
michaelni@gmx.at
>
上级
085ea85c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
57 addition
and
2 deletion
+57
-2
libswscale/swscale.c
libswscale/swscale.c
+46
-0
libswscale/swscale_internal.h
libswscale/swscale_internal.h
+9
-1
libswscale/swscale_unscaled.c
libswscale/swscale_unscaled.c
+1
-1
libswscale/utils.c
libswscale/utils.c
+1
-0
未找到文件。
libswscale/swscale.c
浏览文件 @
cca81e7e
...
...
@@ -1769,6 +1769,49 @@ rgb16_32_wrapper(PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7
rgb16_32_wrapper
(
PIX_FMT_RGB565BE
,
rgb16be
,
0
,
0
,
0
,
0
,
0xF800
,
0x07E0
,
0x001F
,
0
,
5
,
11
,
RGB2YUV_SHIFT
+
8
);
rgb16_32_wrapper
(
PIX_FMT_RGB555BE
,
rgb15be
,
0
,
0
,
0
,
0
,
0x7C00
,
0x03E0
,
0x001F
,
0
,
5
,
10
,
RGB2YUV_SHIFT
+
7
);
static
void
gbr24pToY_c
(
uint16_t
*
dst
,
const
uint8_t
*
gsrc
,
const
uint8_t
*
bsrc
,
const
uint8_t
*
rsrc
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
unsigned
int
g
=
gsrc
[
i
];
unsigned
int
b
=
bsrc
[
i
];
unsigned
int
r
=
rsrc
[
i
];
dst
[
i
]
=
(
RY
*
r
+
GY
*
g
+
BY
*
b
+
(
0x801
<<
(
RGB2YUV_SHIFT
-
7
)))
>>
(
RGB2YUV_SHIFT
-
6
);
}
}
static
void
gbr24pToUV_c
(
uint16_t
*
dstU
,
uint16_t
*
dstV
,
const
uint8_t
*
gsrc
,
const
uint8_t
*
bsrc
,
const
uint8_t
*
rsrc
,
int
width
,
enum
PixelFormat
origin
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
unsigned
int
g
=
gsrc
[
i
];
unsigned
int
b
=
bsrc
[
i
];
unsigned
int
r
=
rsrc
[
i
];
dstU
[
i
]
=
(
RU
*
r
+
GU
*
g
+
BU
*
b
+
(
0x4001
<<
(
RGB2YUV_SHIFT
-
7
)))
>>
(
RGB2YUV_SHIFT
-
6
);
dstV
[
i
]
=
(
RV
*
r
+
GV
*
g
+
BV
*
b
+
(
0x4001
<<
(
RGB2YUV_SHIFT
-
7
)))
>>
(
RGB2YUV_SHIFT
-
6
);
}
}
static
void
gbr24pToUV_half_c
(
uint16_t
*
dstU
,
uint16_t
*
dstV
,
const
uint8_t
*
gsrc
,
const
uint8_t
*
bsrc
,
const
uint8_t
*
rsrc
,
int
width
,
enum
PixelFormat
origin
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
unsigned
int
g
=
gsrc
[
2
*
i
]
+
gsrc
[
2
*
i
+
1
];
unsigned
int
b
=
bsrc
[
2
*
i
]
+
bsrc
[
2
*
i
+
1
];
unsigned
int
r
=
rsrc
[
2
*
i
]
+
rsrc
[
2
*
i
+
1
];
dstU
[
i
]
=
(
RU
*
r
+
GU
*
g
+
BU
*
b
+
(
0x4001
<<
(
RGB2YUV_SHIFT
-
6
)))
>>
(
RGB2YUV_SHIFT
-
6
+
1
);
dstV
[
i
]
=
(
RV
*
r
+
GV
*
g
+
BV
*
b
+
(
0x4001
<<
(
RGB2YUV_SHIFT
-
6
)))
>>
(
RGB2YUV_SHIFT
-
6
+
1
);
}
}
static
void
abgrToA_c
(
int16_t
*
dst
,
const
uint8_t
*
src
,
const
uint8_t
*
unused1
,
const
uint8_t
*
unused2
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
...
...
@@ -2838,6 +2881,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
case
PIX_FMT_RGB565BE
:
c
->
chrToYV12
=
rgb16beToUV_half_c
;
break
;
case
PIX_FMT_RGB555LE
:
c
->
chrToYV12
=
rgb15leToUV_half_c
;
break
;
case
PIX_FMT_RGB555BE
:
c
->
chrToYV12
=
rgb15beToUV_half_c
;
break
;
case
PIX_FMT_GBR24P
:
c
->
chrToYV12
=
gbr24pToUV_half_c
;
break
;
}
}
else
{
switch
(
srcFormat
)
{
...
...
@@ -2859,6 +2903,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
case
PIX_FMT_RGB565BE
:
c
->
chrToYV12
=
rgb16beToUV_c
;
break
;
case
PIX_FMT_RGB555LE
:
c
->
chrToYV12
=
rgb15leToUV_c
;
break
;
case
PIX_FMT_RGB555BE
:
c
->
chrToYV12
=
rgb15beToUV_c
;
break
;
case
PIX_FMT_GBR24P
:
c
->
chrToYV12
=
gbr24pToUV_c
;
break
;
}
}
...
...
@@ -2914,6 +2959,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
case
PIX_FMT_RGB48LE
:
c
->
lumToYV12
=
rgb48LEToY_c
;
break
;
case
PIX_FMT_BGR48BE
:
c
->
lumToYV12
=
bgr48BEToY_c
;
break
;
case
PIX_FMT_BGR48LE
:
c
->
lumToYV12
=
bgr48LEToY_c
;
break
;
case
PIX_FMT_GBR24P
:
c
->
lumToYV12
=
gbr24pToY_c
;
break
;
}
if
(
c
->
alpPixBuf
)
{
switch
(
srcFormat
)
{
...
...
libswscale/swscale_internal.h
浏览文件 @
cca81e7e
...
...
@@ -592,6 +592,12 @@ const char *sws_format_name(enum PixelFormat format);
|| (x)==PIX_FMT_YUV422P16BE \
|| (x)==PIX_FMT_YUV444P16BE \
)
#define isPlanar(x) ( \
isPlanarYUV(x) \
|| (x)==PIX_FMT_GBR24P \
)
#define isYUV(x) ( \
(x)==PIX_FMT_UYVY422 \
|| (x)==PIX_FMT_YUYV422 \
...
...
@@ -668,6 +674,7 @@ const char *sws_format_name(enum PixelFormat format);
#define isAnyRGB(x) ( \
isRGBinInt(x) \
|| isBGRinInt(x) \
|| (x)==PIX_FMT_GBR24P \
)
#define isALPHA(x) ( \
(x)==PIX_FMT_BGRA64BE \
...
...
@@ -687,7 +694,8 @@ const char *sws_format_name(enum PixelFormat format);
|| (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_UYVY422 \
|| (x)==PIX_FMT_Y400A \
|| isAnyRGB(x) \
|| isRGBinInt(x) \
|| isBGRinInt(x) \
)
#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || (x) == PIX_FMT_GRAY8A)
...
...
libswscale/swscale_unscaled.c
浏览文件 @
cca81e7e
...
...
@@ -672,7 +672,7 @@ static void reset_ptr(const uint8_t* src[], int format)
{
if
(
!
isALPHA
(
format
))
src
[
3
]
=
NULL
;
if
(
!
isPlanar
YUV
(
format
))
{
if
(
!
isPlanar
(
format
))
{
src
[
3
]
=
src
[
2
]
=
NULL
;
if
(
!
usePal
(
format
))
...
...
libswscale/utils.c
浏览文件 @
cca81e7e
...
...
@@ -142,6 +142,7 @@ const static FormatEntry format_entries[PIX_FMT_NB] = {
[
PIX_FMT_YUV444P9LE
]
=
{
1
,
1
},
[
PIX_FMT_YUV444P10BE
]
=
{
1
,
1
},
[
PIX_FMT_YUV444P10LE
]
=
{
1
,
1
},
[
PIX_FMT_GBR24P
]
=
{
1
,
0
},
};
int
sws_isSupportedInput
(
enum
PixelFormat
pix_fmt
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录