Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
b405f4e9
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,发现更多精彩内容 >>
提交
b405f4e9
编写于
7月 14, 2013
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
swscale: Add support to specify chroma position
Signed-off-by:
N
Michael Niedermayer
<
michaelni@gmx.at
>
上级
53c853e0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
10 deletion
+37
-10
libswscale/options.c
libswscale/options.c
+5
-0
libswscale/swscale_internal.h
libswscale/swscale_internal.h
+4
-0
libswscale/utils.c
libswscale/utils.c
+27
-9
libswscale/version.h
libswscale/version.h
+1
-1
未找到文件。
libswscale/options.c
浏览文件 @
b405f4e9
...
...
@@ -64,6 +64,11 @@ static const AVOption options[] = {
{
"param0"
,
"scaler param 0"
,
OFFSET
(
param
[
0
]),
AV_OPT_TYPE_DOUBLE
,
{
.
dbl
=
SWS_PARAM_DEFAULT
},
INT_MIN
,
INT_MAX
,
VE
},
{
"param1"
,
"scaler param 1"
,
OFFSET
(
param
[
1
]),
AV_OPT_TYPE_DOUBLE
,
{
.
dbl
=
SWS_PARAM_DEFAULT
},
INT_MIN
,
INT_MAX
,
VE
},
{
"src_v_chr_pos"
,
"source vertical chroma position in luma grid/256"
,
OFFSET
(
src_v_chr_pos
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
512
,
VE
},
{
"src_h_chr_pos"
,
"source horizontal chroma position in luma grid/256"
,
OFFSET
(
src_h_chr_pos
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
512
,
VE
},
{
"dst_v_chr_pos"
,
"source vertical chroma position in luma grid/256"
,
OFFSET
(
dst_v_chr_pos
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
512
,
VE
},
{
"dst_h_chr_pos"
,
"source horizontal chroma position in luma grid/256"
,
OFFSET
(
dst_h_chr_pos
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
512
,
VE
},
{
NULL
}
};
...
...
libswscale/swscale_internal.h
浏览文件 @
b405f4e9
...
...
@@ -382,6 +382,10 @@ typedef struct SwsContext {
int
dst0Alpha
;
int
srcXYZ
;
int
dstXYZ
;
int
src_h_chr_pos
;
int
dst_h_chr_pos
;
int
src_v_chr_pos
;
int
dst_v_chr_pos
;
int
yuv2rgb_y_offset
;
int
yuv2rgb_y_coeff
;
int
yuv2rgb_v2r_coeff
;
...
...
libswscale/utils.c
浏览文件 @
b405f4e9
...
...
@@ -252,12 +252,21 @@ static double getSplineCoeff(double a, double b, double c, double d,
dist
-
1
.
0
);
}
static
av_cold
int
get_local_pos
(
SwsContext
*
s
,
int
chr_subsample
,
int
pos
,
int
dir
)
{
if
(
pos
<
0
)
{
pos
=
(
128
<<
chr_subsample
)
-
128
;
}
pos
+=
128
;
// relative to ideal left edge
return
pos
>>
chr_subsample
;
}
static
av_cold
int
initFilter
(
int16_t
**
outFilter
,
int32_t
**
filterPos
,
int
*
outFilterSize
,
int
xInc
,
int
srcW
,
int
dstW
,
int
filterAlign
,
int
one
,
int
flags
,
int
cpu_flags
,
SwsVector
*
srcFilter
,
SwsVector
*
dstFilter
,
double
param
[
2
])
double
param
[
2
]
,
int
srcPos
,
int
dstPos
)
{
int
i
;
int
filterSize
;
...
...
@@ -273,7 +282,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
// NOTE: the +3 is for the MMX(+1) / SSE(+3) scaler which reads over the end
FF_ALLOC_OR_GOTO
(
NULL
,
*
filterPos
,
(
dstW
+
3
)
*
sizeof
(
**
filterPos
),
fail
);
if
(
FFABS
(
xInc
-
0x10000
)
<
10
)
{
// unscaled
if
(
FFABS
(
xInc
-
0x10000
)
<
10
&&
srcPos
==
dstPos
)
{
// unscaled
int
i
;
filterSize
=
1
;
FF_ALLOCZ_OR_GOTO
(
NULL
,
filter
,
...
...
@@ -290,7 +299,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
FF_ALLOC_OR_GOTO
(
NULL
,
filter
,
dstW
*
sizeof
(
*
filter
)
*
filterSize
,
fail
);
xDstInSrc
=
xInc
/
2
-
0x8000
;
xDstInSrc
=
((
srcPos
*
xInc
)
>>
8
)
-
((
dstPos
*
0x8000
)
>>
7
)
;
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
int
xx
=
(
xDstInSrc
-
((
filterSize
-
1
)
<<
15
)
+
(
1
<<
15
))
>>
16
;
...
...
@@ -306,7 +315,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
FF_ALLOC_OR_GOTO
(
NULL
,
filter
,
dstW
*
sizeof
(
*
filter
)
*
filterSize
,
fail
);
xDstInSrc
=
xInc
/
2
-
0x8000
;
xDstInSrc
=
((
srcPos
*
xInc
)
>>
8
)
-
((
dstPos
*
0x8000
)
>>
7
)
;
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
int
xx
=
(
xDstInSrc
-
((
filterSize
-
1
)
<<
15
)
+
(
1
<<
15
))
>>
16
;
int
j
;
...
...
@@ -357,7 +366,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
FF_ALLOC_OR_GOTO
(
NULL
,
filter
,
dstW
*
sizeof
(
*
filter
)
*
filterSize
,
fail
);
xDstInSrc
=
xInc
-
0x10000
;
xDstInSrc
=
((
srcPos
*
xInc
)
>>
7
)
-
((
dstPos
*
0x10000
)
>>
7
)
;
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
int
xx
=
(
xDstInSrc
-
((
filterSize
-
2
)
<<
16
))
/
(
1
<<
17
);
int
j
;
...
...
@@ -1392,14 +1401,18 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
srcW
,
dstW
,
filterAlign
,
1
<<
14
,
(
flags
&
SWS_BICUBLIN
)
?
(
flags
|
SWS_BICUBIC
)
:
flags
,
cpu_flags
,
srcFilter
->
lumH
,
dstFilter
->
lumH
,
c
->
param
)
<
0
)
c
->
param
,
get_local_pos
(
c
,
0
,
0
,
0
),
get_local_pos
(
c
,
0
,
0
,
0
))
<
0
)
goto
fail
;
if
(
initFilter
(
&
c
->
hChrFilter
,
&
c
->
hChrFilterPos
,
&
c
->
hChrFilterSize
,
c
->
chrXInc
,
c
->
chrSrcW
,
c
->
chrDstW
,
filterAlign
,
1
<<
14
,
(
flags
&
SWS_BICUBLIN
)
?
(
flags
|
SWS_BILINEAR
)
:
flags
,
cpu_flags
,
srcFilter
->
chrH
,
dstFilter
->
chrH
,
c
->
param
)
<
0
)
c
->
param
,
get_local_pos
(
c
,
c
->
chrSrcHSubSample
,
c
->
src_h_chr_pos
,
0
),
get_local_pos
(
c
,
c
->
chrDstHSubSample
,
c
->
dst_h_chr_pos
,
0
))
<
0
)
goto
fail
;
}
}
// initialize horizontal stuff
...
...
@@ -1415,14 +1428,19 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
c
->
lumYInc
,
srcH
,
dstH
,
filterAlign
,
(
1
<<
12
),
(
flags
&
SWS_BICUBLIN
)
?
(
flags
|
SWS_BICUBIC
)
:
flags
,
cpu_flags
,
srcFilter
->
lumV
,
dstFilter
->
lumV
,
c
->
param
)
<
0
)
c
->
param
,
get_local_pos
(
c
,
0
,
0
,
1
),
get_local_pos
(
c
,
0
,
0
,
1
))
<
0
)
goto
fail
;
if
(
initFilter
(
&
c
->
vChrFilter
,
&
c
->
vChrFilterPos
,
&
c
->
vChrFilterSize
,
c
->
chrYInc
,
c
->
chrSrcH
,
c
->
chrDstH
,
filterAlign
,
(
1
<<
12
),
(
flags
&
SWS_BICUBLIN
)
?
(
flags
|
SWS_BILINEAR
)
:
flags
,
cpu_flags
,
srcFilter
->
chrV
,
dstFilter
->
chrV
,
c
->
param
)
<
0
)
c
->
param
,
get_local_pos
(
c
,
c
->
chrSrcVSubSample
,
c
->
src_v_chr_pos
,
1
),
get_local_pos
(
c
,
c
->
chrDstVSubSample
,
c
->
dst_v_chr_pos
,
1
))
<
0
)
goto
fail
;
#if HAVE_ALTIVEC
...
...
libswscale/version.h
浏览文件 @
b405f4e9
...
...
@@ -27,7 +27,7 @@
#include "libavutil/avutil.h"
#define LIBSWSCALE_VERSION_MAJOR 2
#define LIBSWSCALE_VERSION_MINOR
3
#define LIBSWSCALE_VERSION_MINOR
4
#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录