Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
c4deb90c
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,发现更多精彩内容 >>
提交
c4deb90c
编写于
11月 16, 2011
作者:
C
Clément Bœsch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
swr: use "swri_" prefix instead of "swr_" for the private API.
上级
64db5a1a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
22 deletion
+22
-22
libswresample/rematrix.c
libswresample/rematrix.c
+2
-2
libswresample/resample.c
libswresample/resample.c
+5
-5
libswresample/swresample.c
libswresample/swresample.c
+8
-8
libswresample/swresample_internal.h
libswresample/swresample_internal.h
+7
-7
未找到文件。
libswresample/rematrix.c
浏览文件 @
c4deb90c
...
...
@@ -84,7 +84,7 @@ static int sane_layout(int64_t layout){
return
1
;
}
int
swr_rematrix_init
(
SwrContext
*
s
){
int
swr
i
_rematrix_init
(
SwrContext
*
s
){
int
i
,
j
,
out_i
;
double
matrix
[
64
][
64
]
=
{{
0
}};
int64_t
unaccounted
=
s
->
in_ch_layout
&
~
s
->
out_ch_layout
;
...
...
@@ -239,7 +239,7 @@ int swr_rematrix_init(SwrContext *s){
return
0
;
}
int
swr_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
){
int
swr
i
_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
){
int
out_i
,
in_i
,
i
,
j
;
av_assert0
(
out
->
ch_count
==
av_get_channel_layout_nb_channels
(
s
->
out_ch_layout
));
...
...
libswresample/resample.c
浏览文件 @
c4deb90c
...
...
@@ -199,7 +199,7 @@ static int build_filter(FELEM *filter, double factor, int tap_count, int phase_c
return
0
;
}
ResampleContext
*
swr_resample_init
(
ResampleContext
*
c
,
int
out_rate
,
int
in_rate
,
int
filter_size
,
int
phase_shift
,
int
linear
,
double
cutoff
){
ResampleContext
*
swr
i
_resample_init
(
ResampleContext
*
c
,
int
out_rate
,
int
in_rate
,
int
filter_size
,
int
phase_shift
,
int
linear
,
double
cutoff
){
double
factor
=
FFMIN
(
out_rate
*
cutoff
/
in_rate
,
1
.
0
);
int
phase_count
=
1
<<
phase_shift
;
...
...
@@ -238,7 +238,7 @@ error:
return
NULL
;
}
void
swr_resample_free
(
ResampleContext
**
c
){
void
swr
i
_resample_free
(
ResampleContext
**
c
){
if
(
!*
c
)
return
;
av_freep
(
&
(
*
c
)
->
filter_bank
);
...
...
@@ -252,7 +252,7 @@ void swr_compensate(struct SwrContext *s, int sample_delta, int compensation_dis
c
->
dst_incr
=
c
->
ideal_dst_incr
-
c
->
ideal_dst_incr
*
(
int64_t
)
sample_delta
/
compensation_distance
;
}
int
swr_resample
(
ResampleContext
*
c
,
short
*
dst
,
const
short
*
src
,
int
*
consumed
,
int
src_size
,
int
dst_size
,
int
update_ctx
){
int
swr
i
_resample
(
ResampleContext
*
c
,
short
*
dst
,
const
short
*
src
,
int
*
consumed
,
int
src_size
,
int
dst_size
,
int
update_ctx
){
int
dst_index
,
i
;
int
index
=
c
->
index
;
int
frac
=
c
->
frac
;
...
...
@@ -341,11 +341,11 @@ av_log(NULL, AV_LOG_DEBUG, "%d %d %d\n", c->dst_incr, c->ideal_dst_incr, c->comp
return
dst_index
;
}
int
swr_multiple_resample
(
ResampleContext
*
c
,
AudioData
*
dst
,
int
dst_size
,
AudioData
*
src
,
int
src_size
,
int
*
consumed
){
int
swr
i
_multiple_resample
(
ResampleContext
*
c
,
AudioData
*
dst
,
int
dst_size
,
AudioData
*
src
,
int
src_size
,
int
*
consumed
){
int
i
,
ret
=
-
1
;
for
(
i
=
0
;
i
<
dst
->
ch_count
;
i
++
){
ret
=
swr_resample
(
c
,
(
short
*
)
dst
->
ch
[
i
],
(
const
short
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
ret
=
swr
i
_resample
(
c
,
(
short
*
)
dst
->
ch
[
i
],
(
const
short
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
}
return
ret
;
...
...
libswresample/swresample.c
浏览文件 @
c4deb90c
...
...
@@ -122,7 +122,7 @@ void swr_free(SwrContext **ss){
swri_audio_convert_free
(
&
s
->
in_convert
);
swri_audio_convert_free
(
&
s
->
out_convert
);
swri_audio_convert_free
(
&
s
->
full_convert
);
swr_resample_free
(
&
s
->
resample
);
swr
i
_resample_free
(
&
s
->
resample
);
}
av_freep
(
ss
);
...
...
@@ -168,9 +168,9 @@ int swr_init(SwrContext *s){
if
(
s
->
out_sample_rate
!=
s
->
in_sample_rate
||
(
s
->
flags
&
SWR_FLAG_RESAMPLE
)){
s
->
resample
=
swr_resample_init
(
s
->
resample
,
s
->
out_sample_rate
,
s
->
in_sample_rate
,
16
,
10
,
0
,
0
.
8
);
s
->
resample
=
swr
i
_resample_init
(
s
->
resample
,
s
->
out_sample_rate
,
s
->
in_sample_rate
,
16
,
10
,
0
,
0
.
8
);
}
else
swr_resample_free
(
&
s
->
resample
);
swr
i
_resample_free
(
&
s
->
resample
);
if
(
s
->
int_sample_fmt
!=
AV_SAMPLE_FMT_S16
&&
s
->
resample
){
av_log
(
s
,
AV_LOG_ERROR
,
"Resampling only supported with internal s16 currently
\n
"
);
//FIXME
return
-
1
;
...
...
@@ -238,7 +238,7 @@ av_assert0(s->out.ch_count);
s
->
in_buffer
.
planar
=
s
->
postin
.
planar
=
s
->
midbuf
.
planar
=
s
->
preout
.
planar
=
1
;
if
(
s
->
rematrix
&&
swr_rematrix_init
(
s
)
<
0
)
if
(
s
->
rematrix
&&
swr
i
_rematrix_init
(
s
)
<
0
)
return
-
1
;
return
0
;
...
...
@@ -392,10 +392,10 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun
if
(
postin
!=
midbuf
)
out_count
=
resample
(
s
,
midbuf
,
out_count
,
postin
,
in_count
);
if
(
midbuf
!=
preout
)
swr_rematrix
(
s
,
preout
,
midbuf
,
out_count
,
preout
==
out
);
swr
i
_rematrix
(
s
,
preout
,
midbuf
,
out_count
,
preout
==
out
);
}
else
{
if
(
postin
!=
midbuf
)
swr_rematrix
(
s
,
midbuf
,
postin
,
in_count
,
midbuf
==
out
);
swr
i
_rematrix
(
s
,
midbuf
,
postin
,
in_count
,
midbuf
==
out
);
if
(
midbuf
!=
preout
)
out_count
=
resample
(
s
,
preout
,
out_count
,
midbuf
,
in_count
);
}
...
...
@@ -439,7 +439,7 @@ static int resample(SwrContext *s, AudioData *out_param, int out_count,
int
ret
,
size
,
consumed
;
if
(
!
s
->
resample_in_constraint
&&
s
->
in_buffer_count
){
buf_set
(
&
tmp
,
&
s
->
in_buffer
,
s
->
in_buffer_index
);
ret
=
swr_multiple_resample
(
s
->
resample
,
&
out
,
out_count
,
&
tmp
,
s
->
in_buffer_count
,
&
consumed
);
ret
=
swr
i
_multiple_resample
(
s
->
resample
,
&
out
,
out_count
,
&
tmp
,
s
->
in_buffer_count
,
&
consumed
);
out_count
-=
ret
;
ret_sum
+=
ret
;
buf_set
(
&
out
,
&
out
,
ret
);
...
...
@@ -459,7 +459,7 @@ static int resample(SwrContext *s, AudioData *out_param, int out_count,
if
(
in_count
&&
!
s
->
in_buffer_count
){
s
->
in_buffer_index
=
0
;
ret
=
swr_multiple_resample
(
s
->
resample
,
&
out
,
out_count
,
&
in
,
in_count
,
&
consumed
);
ret
=
swr
i
_multiple_resample
(
s
->
resample
,
&
out
,
out_count
,
&
in
,
in_count
,
&
consumed
);
out_count
-=
ret
;
ret_sum
+=
ret
;
buf_set
(
&
out
,
&
out
,
ret
);
...
...
libswresample/swresample_internal.h
浏览文件 @
c4deb90c
...
...
@@ -70,12 +70,12 @@ typedef struct SwrContext { //FIXME find unused fields
//TODO callbacks for asm optims
}
SwrContext
;
struct
ResampleContext
*
swr_resample_init
(
struct
ResampleContext
*
,
int
out_rate
,
int
in_rate
,
int
filter_size
,
int
phase_shift
,
int
linear
,
double
cutoff
);
void
swr_resample_free
(
struct
ResampleContext
**
c
);
int
swr_multiple_resample
(
struct
ResampleContext
*
c
,
AudioData
*
dst
,
int
dst_size
,
AudioData
*
src
,
int
src_size
,
int
*
consumed
);
void
swr_resample_compensate
(
struct
ResampleContext
*
c
,
int
sample_delta
,
int
compensation_distance
);
int
swr_resample
(
struct
ResampleContext
*
c
,
short
*
dst
,
const
short
*
src
,
int
*
consumed
,
int
src_size
,
int
dst_size
,
int
update_ctx
);
struct
ResampleContext
*
swr
i
_resample_init
(
struct
ResampleContext
*
,
int
out_rate
,
int
in_rate
,
int
filter_size
,
int
phase_shift
,
int
linear
,
double
cutoff
);
void
swr
i
_resample_free
(
struct
ResampleContext
**
c
);
int
swr
i
_multiple_resample
(
struct
ResampleContext
*
c
,
AudioData
*
dst
,
int
dst_size
,
AudioData
*
src
,
int
src_size
,
int
*
consumed
);
void
swr
i
_resample_compensate
(
struct
ResampleContext
*
c
,
int
sample_delta
,
int
compensation_distance
);
int
swr
i
_resample
(
struct
ResampleContext
*
c
,
short
*
dst
,
const
short
*
src
,
int
*
consumed
,
int
src_size
,
int
dst_size
,
int
update_ctx
);
int
swr_rematrix_init
(
SwrContext
*
s
);
int
swr_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
);
int
swr
i
_rematrix_init
(
SwrContext
*
s
);
int
swr
i
_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录