Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
92806167
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,发现更多精彩内容 >>
提交
92806167
编写于
12月 17, 2014
作者:
P
Paul B Mahol
提交者:
Vittorio Giovara
1月 14, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libswscale: GBRAP input & output and GBRAP16 input support
Signed-off-by:
N
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
上级
9a4aaae3
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
59 addition
and
2 deletion
+59
-2
libswscale/input.c
libswscale/input.c
+15
-0
libswscale/output.c
libswscale/output.c
+8
-1
libswscale/swscale.c
libswscale/swscale.c
+3
-0
libswscale/swscale_internal.h
libswscale/swscale_internal.h
+2
-1
libswscale/swscale_unscaled.c
libswscale/swscale_unscaled.c
+23
-0
libswscale/utils.c
libswscale/utils.c
+3
-0
tests/ref/fate/filter-pixdesc-gbrap
tests/ref/fate/filter-pixdesc-gbrap
+1
-0
tests/ref/fate/filter-pixfmts-copy
tests/ref/fate/filter-pixfmts-copy
+1
-0
tests/ref/fate/filter-pixfmts-null
tests/ref/fate/filter-pixfmts-null
+1
-0
tests/ref/fate/filter-pixfmts-scale
tests/ref/fate/filter-pixfmts-scale
+1
-0
tests/ref/fate/filter-pixfmts-vflip
tests/ref/fate/filter-pixfmts-vflip
+1
-0
未找到文件。
libswscale/input.c
浏览文件 @
92806167
...
...
@@ -596,6 +596,14 @@ static void planar_rgb_to_y(uint8_t *dst, const uint8_t *src[4], int width)
}
}
static
void
planar_rgb_to_a
(
uint8_t
*
_dst
,
const
uint8_t
*
src
[
4
],
int
width
,
int32_t
*
unused
)
{
uint16_t
*
dst
=
(
uint16_t
*
)
_dst
;
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
dst
[
i
]
=
src
[
3
][
i
]
<<
6
;
}
static
void
planar_rgb_to_uv
(
uint8_t
*
dstU
,
uint8_t
*
dstV
,
const
uint8_t
*
src
[
4
],
int
width
)
{
int
i
;
...
...
@@ -745,6 +753,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case
AV_PIX_FMT_GBRP10LE
:
c
->
readChrPlanar
=
planar_rgb10le_to_uv
;
break
;
case
AV_PIX_FMT_GBRAP16LE
:
case
AV_PIX_FMT_GBRP16LE
:
c
->
readChrPlanar
=
planar_rgb16le_to_uv
;
break
;
...
...
@@ -754,9 +763,11 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case
AV_PIX_FMT_GBRP10BE
:
c
->
readChrPlanar
=
planar_rgb10be_to_uv
;
break
;
case
AV_PIX_FMT_GBRAP16BE
:
case
AV_PIX_FMT_GBRP16BE
:
c
->
readChrPlanar
=
planar_rgb16be_to_uv
;
break
;
case
AV_PIX_FMT_GBRAP
:
case
AV_PIX_FMT_GBRP
:
c
->
readChrPlanar
=
planar_rgb_to_uv
;
break
;
...
...
@@ -953,6 +964,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case
AV_PIX_FMT_GBRP10LE
:
c
->
readLumPlanar
=
planar_rgb10le_to_y
;
break
;
case
AV_PIX_FMT_GBRAP16LE
:
case
AV_PIX_FMT_GBRP16LE
:
c
->
readLumPlanar
=
planar_rgb16le_to_y
;
break
;
...
...
@@ -962,9 +974,12 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case
AV_PIX_FMT_GBRP10BE
:
c
->
readLumPlanar
=
planar_rgb10be_to_y
;
break
;
case
AV_PIX_FMT_GBRAP16BE
:
case
AV_PIX_FMT_GBRP16BE
:
c
->
readLumPlanar
=
planar_rgb16be_to_y
;
break
;
case
AV_PIX_FMT_GBRAP
:
c
->
readAlpPlanar
=
planar_rgb_to_a
;
case
AV_PIX_FMT_GBRP
:
c
->
readLumPlanar
=
planar_rgb_to_y
;
break
;
...
...
libswscale/output.c
浏览文件 @
92806167
...
...
@@ -1277,7 +1277,7 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
c
->
dstFormat
);
int
i
;
int
hasAlpha
=
0
;
int
hasAlpha
=
(
desc
->
flags
&
AV_PIX_FMT_FLAG_ALPHA
)
&&
alpSrc
;
uint16_t
**
dest16
=
(
uint16_t
**
)
dest
;
int
SH
=
22
+
7
-
desc
->
comp
[
0
].
depth_minus1
;
...
...
@@ -1329,10 +1329,14 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
dest16
[
0
][
i
]
=
G
>>
SH
;
dest16
[
1
][
i
]
=
B
>>
SH
;
dest16
[
2
][
i
]
=
R
>>
SH
;
if
(
hasAlpha
)
dest16
[
3
][
i
]
=
A
;
}
else
{
dest
[
0
][
i
]
=
G
>>
22
;
dest
[
1
][
i
]
=
B
>>
22
;
dest
[
2
][
i
]
=
R
>>
22
;
if
(
hasAlpha
)
dest
[
3
][
i
]
=
A
;
}
}
if
(
SH
!=
22
&&
(
!
isBE
(
c
->
dstFormat
))
!=
(
!
HAVE_BIGENDIAN
))
{
...
...
@@ -1340,6 +1344,8 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
dest16
[
0
][
i
]
=
av_bswap16
(
dest16
[
0
][
i
]);
dest16
[
1
][
i
]
=
av_bswap16
(
dest16
[
1
][
i
]);
dest16
[
2
][
i
]
=
av_bswap16
(
dest16
[
2
][
i
]);
if
(
hasAlpha
)
dest16
[
3
][
i
]
=
av_bswap16
(
dest16
[
3
][
i
]);
}
}
}
...
...
@@ -1445,6 +1451,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
case
AV_PIX_FMT_GBRP10LE
:
case
AV_PIX_FMT_GBRP16BE
:
case
AV_PIX_FMT_GBRP16LE
:
case
AV_PIX_FMT_GBRAP
:
*
yuv2anyX
=
yuv2gbrp_full_X_c
;
break
;
}
...
...
libswscale/swscale.c
浏览文件 @
92806167
...
...
@@ -269,6 +269,9 @@ static av_always_inline void hyscale(SwsContext *c, int16_t *dst, int dstWidth,
}
else
if
(
c
->
readLumPlanar
&&
!
isAlpha
)
{
c
->
readLumPlanar
(
formatConvBuffer
,
src_in
,
srcW
);
src
=
formatConvBuffer
;
}
else
if
(
c
->
readAlpPlanar
&&
isAlpha
)
{
c
->
readAlpPlanar
(
formatConvBuffer
,
src_in
,
srcW
);
src
=
formatConvBuffer
;
}
if
(
!
c
->
hyscale_fast
)
{
...
...
libswscale/swscale_internal.h
浏览文件 @
92806167
...
...
@@ -458,12 +458,13 @@ typedef struct SwsContext {
/**
* Functions to read planar input, such as planar RGB, and convert
* internally to Y/UV.
* internally to Y/UV
/A
.
*/
/** @{ */
void
(
*
readLumPlanar
)(
uint8_t
*
dst
,
const
uint8_t
*
src
[
4
],
int
width
);
void
(
*
readChrPlanar
)(
uint8_t
*
dstU
,
uint8_t
*
dstV
,
const
uint8_t
*
src
[
4
],
int
width
);
void
(
*
readAlpPlanar
)(
uint8_t
*
dst
,
const
uint8_t
*
src
[
4
],
int
width
);
/** @} */
/**
...
...
libswscale/swscale_unscaled.c
浏览文件 @
92806167
...
...
@@ -488,6 +488,23 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[],
return
srcSliceH
;
}
static
int
planarRgbToplanarRgbWrapper
(
SwsContext
*
c
,
const
uint8_t
*
src
[],
int
srcStride
[],
int
srcSliceY
,
int
srcSliceH
,
uint8_t
*
dst
[],
int
dstStride
[])
{
copyPlane
(
src
[
0
],
srcStride
[
0
],
srcSliceY
,
srcSliceH
,
c
->
srcW
,
dst
[
0
],
dstStride
[
0
]);
copyPlane
(
src
[
1
],
srcStride
[
1
],
srcSliceY
,
srcSliceH
,
c
->
srcW
,
dst
[
1
],
dstStride
[
1
]);
copyPlane
(
src
[
2
],
srcStride
[
2
],
srcSliceY
,
srcSliceH
,
c
->
srcW
,
dst
[
2
],
dstStride
[
2
]);
if
(
dst
[
3
])
fillPlane
(
dst
[
3
],
dstStride
[
3
],
c
->
srcW
,
srcSliceH
,
srcSliceY
,
255
);
return
srcSliceH
;
}
static
void
packedtogbr24p
(
const
uint8_t
*
src
,
int
srcStride
,
uint8_t
*
dst
[],
int
dstStride
[],
int
srcSliceH
,
int
alpha_first
,
int
inc_size
,
int
width
)
...
...
@@ -1054,6 +1071,11 @@ void ff_get_unscaled_swscale(SwsContext *c)
&&
(
!
needsDither
||
(
c
->
flags
&
(
SWS_FAST_BILINEAR
|
SWS_POINT
))))
c
->
swscale
=
rgbToRgbWrapper
;
/* RGB to planar RGB */
if
((
srcFormat
==
AV_PIX_FMT_GBRP
&&
dstFormat
==
AV_PIX_FMT_GBRAP
)
||
(
srcFormat
==
AV_PIX_FMT_GBRAP
&&
dstFormat
==
AV_PIX_FMT_GBRP
))
c
->
swscale
=
planarRgbToplanarRgbWrapper
;
#define isByteRGB(f) ( \
f == AV_PIX_FMT_RGB32 || \
f == AV_PIX_FMT_RGB32_1 || \
...
...
@@ -1077,6 +1099,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_BGRA64
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_GRAY16
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_YA16
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_GBRAP16
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_RGB444
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_RGB48
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_RGB555
)
||
...
...
libswscale/utils.c
浏览文件 @
92806167
...
...
@@ -180,6 +180,9 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[
AV_PIX_FMT_GBRP10BE
]
=
{
1
,
1
},
[
AV_PIX_FMT_GBRP16LE
]
=
{
1
,
0
},
[
AV_PIX_FMT_GBRP16BE
]
=
{
1
,
0
},
[
AV_PIX_FMT_GBRAP
]
=
{
1
,
1
},
[
AV_PIX_FMT_GBRAP16LE
]
=
{
1
,
0
},
[
AV_PIX_FMT_GBRAP16BE
]
=
{
1
,
0
},
[
AV_PIX_FMT_XYZ12BE
]
=
{
0
,
0
,
1
},
[
AV_PIX_FMT_XYZ12LE
]
=
{
0
,
0
,
1
},
};
...
...
tests/ref/fate/filter-pixdesc-gbrap
0 → 100644
浏览文件 @
92806167
pixdesc-gbrap 28d63d5ac84bb33bf3aea48785baa876
tests/ref/fate/filter-pixfmts-copy
浏览文件 @
92806167
...
...
@@ -12,6 +12,7 @@ bgr565be 257cf78afa35dc31e9696f139c916715
bgr565le 1dfdd03995c287e3c754b164bf26a355
bgr8 24bd566170343d06fec6fccfff5abc54
bgra 76a18a5151242fa137133f604cd624d2
gbrap 28d63d5ac84bb33bf3aea48785baa876
gbrp 76204621e200a3cc633012f6720c7005
gbrp10be 2ca4a4a589a7dc461ff186913c7a69e5
gbrp10le 46176f1fcc6e67f9862115fe373f73d3
...
...
tests/ref/fate/filter-pixfmts-null
浏览文件 @
92806167
...
...
@@ -12,6 +12,7 @@ bgr565be 257cf78afa35dc31e9696f139c916715
bgr565le 1dfdd03995c287e3c754b164bf26a355
bgr8 24bd566170343d06fec6fccfff5abc54
bgra 76a18a5151242fa137133f604cd624d2
gbrap 28d63d5ac84bb33bf3aea48785baa876
gbrp 76204621e200a3cc633012f6720c7005
gbrp10be 2ca4a4a589a7dc461ff186913c7a69e5
gbrp10le 46176f1fcc6e67f9862115fe373f73d3
...
...
tests/ref/fate/filter-pixfmts-scale
浏览文件 @
92806167
...
...
@@ -12,6 +12,7 @@ bgr565be 922a2503767036ae9536f4f7823c04ee
bgr565le 3a514a298c6161a071ddf9963c06509d
bgr8 7f007fa6c153a16e808a9c51605a4016
bgra a5e7040f9a80cccd65e5acf2ca09ace5
gbrap 08ea11431bc436d788494d678b3edc6f
gbrp 205c50f8359cb4ba2827a7711dea2cc6
gbrp10be 30b7f9d5ef5da474fb794743146236aa
gbrp10le 2e9949a01fe4c38774728e34795165cc
...
...
tests/ref/fate/filter-pixfmts-vflip
浏览文件 @
92806167
...
...
@@ -12,6 +12,7 @@ bgr565be f19e9a4786395e1ddcd51399c98c9f6c
bgr565le fdb617533e1e7ff512ea5b6b6233e738
bgr8 c60f93fd152c6903391d1fe9decd3547
bgra 7f9b799fb48544e49ce93e91d7f9fca8
gbrap cb0d9cb2813c04a19a346c316c1ffbb9
gbrp 25c1bce192daefab910d51a56b52199e
gbrp10be 6fe980f9ca94cbcdb9e01f4e906fdf19
gbrp10le f793a1d96d3524c6a17e53356c415c4e
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录