Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
bf5d46d8
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,发现更多精彩内容 >>
提交
bf5d46d8
编写于
9月 28, 2011
作者:
M
Mans Rullgard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dca: NEON optimised high freq VQ decoding
Signed-off-by:
N
Mans Rullgard
<
mans@mansr.com
>
上级
6326afd5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
69 addition
and
9 deletion
+69
-9
libavcodec/arm/dca.h
libavcodec/arm/dca.h
+49
-0
libavcodec/dca.c
libavcodec/dca.c
+19
-8
libavcodec/dcadata.h
libavcodec/dcadata.h
+1
-1
未找到文件。
libavcodec/arm/dca.h
0 → 100644
浏览文件 @
bf5d46d8
/*
* Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_ARM_DCA_H
#define AVCODEC_ARM_DCA_H
#include <stdint.h>
#include "config.h"
#if HAVE_NEON && HAVE_INLINE_ASM
#define int8x8_fmul_int32 int8x8_fmul_int32
static
inline
void
int8x8_fmul_int32
(
float
*
dst
,
const
int8_t
*
src
,
int
scale
)
{
__asm__
(
"vcvt.f32.s32 %2, %2, #4
\n
"
"vld1.8 {d0}, [%1,:64]
\n
"
"vmovl.s8 q0, d0
\n
"
"vmovl.s16 q1, d1
\n
"
"vmovl.s16 q0, d0
\n
"
"vcvt.f32.s32 q0, q0
\n
"
"vcvt.f32.s32 q1, q1
\n
"
"vmul.f32 q0, q0, %y2
\n
"
"vmul.f32 q1, q1, %y2
\n
"
"vst1.32 {q0-q1}, [%m0,:128]
\n
"
:
"=Um"
(
*
(
float
(
*
)[
8
])
dst
)
:
"r"
(
src
),
"x"
(
scale
)
:
"d0"
,
"d1"
,
"d2"
,
"d3"
);
}
#endif
#endif
/* AVCODEC_ARM_DCA_H */
libavcodec/dca.c
浏览文件 @
bf5d46d8
...
...
@@ -42,6 +42,10 @@
#include "dcadsp.h"
#include "fmtconvert.h"
#if ARCH_ARM
# include "arm/dca.h"
#endif
//#define TRACE
#define DCA_PRIM_CHANNELS_MAX (7)
...
...
@@ -320,7 +324,7 @@ typedef struct {
int
lfe_scale_factor
;
/* Subband samples history (for ADPCM) */
float
subband_samples_hist
[
DCA_PRIM_CHANNELS_MAX
][
DCA_SUBBANDS
][
4
];
DECLARE_ALIGNED
(
16
,
float
,
subband_samples_hist
)
[
DCA_PRIM_CHANNELS_MAX
][
DCA_SUBBANDS
][
4
];
DECLARE_ALIGNED
(
32
,
float
,
subband_fir_hist
)[
DCA_PRIM_CHANNELS_MAX
][
512
];
DECLARE_ALIGNED
(
32
,
float
,
subband_fir_noidea
)[
DCA_PRIM_CHANNELS_MAX
][
32
];
int
hist_index
[
DCA_PRIM_CHANNELS_MAX
];
...
...
@@ -1057,6 +1061,16 @@ static int decode_blockcode(int code, int levels, int *values)
static
const
uint8_t
abits_sizes
[
7
]
=
{
7
,
10
,
12
,
13
,
15
,
17
,
19
};
static
const
uint8_t
abits_levels
[
7
]
=
{
3
,
5
,
7
,
9
,
13
,
17
,
25
};
#ifndef int8x8_fmul_int32
static
inline
void
int8x8_fmul_int32
(
float
*
dst
,
const
int8_t
*
src
,
int
scale
)
{
float
fscale
=
scale
/
16
.
0
;
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
dst
[
i
]
=
src
[
i
]
*
fscale
;
}
#endif
static
int
dca_subsubframe
(
DCAContext
*
s
,
int
base_channel
,
int
block_index
)
{
int
k
,
l
;
...
...
@@ -1161,19 +1175,16 @@ static int dca_subsubframe(DCAContext * s, int base_channel, int block_index)
for
(
l
=
s
->
vq_start_subband
[
k
];
l
<
s
->
subband_activity
[
k
];
l
++
)
{
/* 1 vector -> 32 samples but we only need the 8 samples
* for this subsubframe. */
int
m
;
int
hfvq
=
s
->
high_freq_vq
[
k
][
l
]
;
if
(
!
s
->
debug_flag
&
0x01
)
{
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"Stream with high frequencies VQ coding
\n
"
);
s
->
debug_flag
|=
0x01
;
}
for
(
m
=
0
;
m
<
8
;
m
++
)
{
subband_samples
[
k
][
l
][
m
]
=
high_freq_vq
[
s
->
high_freq_vq
[
k
][
l
]][
subsubframe
*
8
+
m
]
*
(
float
)
s
->
scale_factor
[
k
][
l
][
0
]
/
16
.
0
;
}
int8x8_fmul_int32
(
subband_samples
[
k
][
l
],
&
high_freq_vq
[
hfvq
][
subsubframe
*
8
],
s
->
scale_factor
[
k
][
l
][
0
]);
}
}
...
...
libavcodec/dcadata.h
浏览文件 @
bf5d46d8
...
...
@@ -4224,7 +4224,7 @@ static const float lossless_quant_d[32] = {
/* Vector quantization tables */
static
const
int8_t
high_freq_vq
[
1024
][
32
]
=
DECLARE_ALIGNED
(
8
,
static
const
int8_t
,
high_freq_vq
)
[
1024
][
32
]
=
{
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录