Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
1402ee72
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,发现更多精彩内容 >>
提交
1402ee72
编写于
10月 26, 2008
作者:
B
Benjamin Larsson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix dca decoder with non simd float2int16 conversion
Originally committed as revision 15714 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
49c91c34
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
8 deletion
+16
-8
libavcodec/dca.c
libavcodec/dca.c
+16
-8
未找到文件。
libavcodec/dca.c
浏览文件 @
1402ee72
...
...
@@ -67,7 +67,6 @@ enum DCAMode {
#define DCA_LFE 0x80
#define HEADER_SIZE 14
#define CONVERT_BIAS 384
#define DCA_MAX_FRAME_SIZE 16384
...
...
@@ -159,7 +158,8 @@ typedef struct {
int
hist_index
[
DCA_PRIM_CHANNELS_MAX
];
int
output
;
///< type of output
int
bias
;
///< output bias
float
add_bias
;
///< output bias
float
scale_bias
;
///< output scale
DECLARE_ALIGNED_16
(
float
,
samples
[
1536
]);
/* 6 * 256 = 1536, might only need 5 */
const
float
*
samples_chanptr
[
6
];
...
...
@@ -230,8 +230,6 @@ static int dca_parse_frame_header(DCAContext * s)
static
const
int
bitlen
[
11
]
=
{
0
,
1
,
2
,
2
,
2
,
2
,
3
,
3
,
3
,
3
,
3
};
static
const
int
thr
[
11
]
=
{
0
,
1
,
3
,
3
,
3
,
3
,
7
,
7
,
7
,
7
,
7
};
s
->
bias
=
CONVERT_BIAS
;
init_get_bits
(
&
s
->
gb
,
s
->
dca_buffer
,
s
->
dca_buffer_size
*
8
);
/* Sync code */
...
...
@@ -748,7 +746,7 @@ static void lfe_interpolation_fir(int decimation_select,
//FIXME the coeffs are symetric, fix that
for
(
j
=
0
;
j
<
512
/
decifactor
;
j
++
)
rTmp
+=
samples_in
[
deciindex
-
j
]
*
prCoeff
[
k
+
j
*
decifactor
];
samples_out
[
interp_index
++
]
=
rTmp
/
scale
+
bias
;
samples_out
[
interp_index
++
]
=
(
rTmp
*
scale
)
+
bias
;
}
}
}
...
...
@@ -984,8 +982,8 @@ static int dca_subsubframe(DCAContext * s)
/* static float pcm_to_double[8] =
{32768.0, 32768.0, 524288.0, 524288.0, 0, 8388608.0, 8388608.0};*/
qmf_32_subbands
(
s
,
k
,
subband_samples
[
k
],
&
s
->
samples
[
256
*
k
],
M_SQRT1_2
/*pcm_to_double[s->source_pcm_res] */
,
0
/*s->bias */
);
M_SQRT1_2
*
s
->
scale_bias
/*pcm_to_double[s->source_pcm_res] */
,
s
->
add_bias
);
}
/* Down mixing */
...
...
@@ -1003,7 +1001,7 @@ static int dca_subsubframe(DCAContext * s)
s
->
lfe_data
+
lfe_samples
+
2
*
s
->
lfe
*
subsubframe
,
&
s
->
samples
[
256
*
i_channels
],
256
.
0
,
0
/* s->bias */
);
(
1
.
0
/
256
.
0
)
*
s
->
scale_bias
,
s
->
add_bias
);
/* Outputs 20bits pcm samples */
}
...
...
@@ -1214,6 +1212,16 @@ static av_cold int dca_decode_init(AVCodecContext * avctx)
for
(
i
=
0
;
i
<
6
;
i
++
)
s
->
samples_chanptr
[
i
]
=
s
->
samples
+
i
*
256
;
avctx
->
sample_fmt
=
SAMPLE_FMT_S16
;
if
(
s
->
dsp
.
float_to_int16
==
ff_float_to_int16_c
)
{
s
->
add_bias
=
385
.
0
f
;
s
->
scale_bias
=
1
.
0
/
32768
.
0
;
}
else
{
s
->
add_bias
=
0
.
0
f
;
s
->
scale_bias
=
1
.
0
;
}
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录