Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
7946a5ac
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,发现更多精彩内容 >>
提交
7946a5ac
编写于
12月 24, 2011
作者:
N
Nathan Caldwell
提交者:
Alex Converse
1月 23, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
aacenc: Move saved overlap samples to the beginning of the same buffer as incoming samples.
Signed-off-by:
N
Alex Converse
<
alex.converse@gmail.com
>
上级
9b8e2a87
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
16 deletion
+15
-16
libavcodec/aacenc.c
libavcodec/aacenc.c
+15
-16
未找到文件。
libavcodec/aacenc.c
浏览文件 @
7946a5ac
...
@@ -190,36 +190,34 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
...
@@ -190,36 +190,34 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
float
*
output
=
sce
->
ret
;
float
*
output
=
sce
->
ret
;
if
(
sce
->
ics
.
window_sequence
[
0
]
!=
EIGHT_SHORT_SEQUENCE
)
{
if
(
sce
->
ics
.
window_sequence
[
0
]
!=
EIGHT_SHORT_SEQUENCE
)
{
memcpy
(
output
,
sce
->
saved
,
sizeof
(
output
[
0
])
*
1024
);
memcpy
(
output
,
audio
,
sizeof
(
output
[
0
])
*
1024
);
if
(
sce
->
ics
.
window_sequence
[
0
]
==
LONG_STOP_SEQUENCE
)
{
if
(
sce
->
ics
.
window_sequence
[
0
]
==
LONG_STOP_SEQUENCE
)
{
memset
(
output
,
0
,
sizeof
(
output
[
0
])
*
448
);
memset
(
output
,
0
,
sizeof
(
output
[
0
])
*
448
);
for
(
i
=
448
;
i
<
576
;
i
++
)
for
(
i
=
448
;
i
<
576
;
i
++
)
output
[
i
]
=
sce
->
saved
[
i
]
*
pwindow
[
i
-
448
];
output
[
i
]
=
audio
[
i
]
*
pwindow
[
i
-
448
];
}
}
if
(
sce
->
ics
.
window_sequence
[
0
]
!=
LONG_START_SEQUENCE
)
{
if
(
sce
->
ics
.
window_sequence
[
0
]
!=
LONG_START_SEQUENCE
)
{
for
(
i
=
0
;
i
<
1024
;
i
++
)
{
for
(
i
=
0
;
i
<
1024
;
i
++
)
{
output
[
i
+
1024
]
=
audio
[
i
]
*
lwindow
[
1024
-
i
-
1
];
output
[
i
+
1024
]
=
audio
[
i
+
1024
]
*
lwindow
[
1024
-
i
-
1
];
sce
->
saved
[
i
]
=
audio
[
i
]
*
lwindow
[
i
];
audio
[
i
]
=
audio
[
i
+
1024
]
*
lwindow
[
i
];
}
}
}
else
{
}
else
{
memcpy
(
output
+
1024
,
audio
,
sizeof
(
output
[
0
])
*
448
);
memcpy
(
output
+
1024
,
audio
+
1024
,
sizeof
(
output
[
0
])
*
448
);
for
(;
i
<
576
;
i
++
)
for
(;
i
<
576
;
i
++
)
output
[
i
+
1024
]
=
audio
[
i
]
*
swindow
[
576
-
i
-
1
];
output
[
i
+
1024
]
=
audio
[
i
+
1024
]
*
swindow
[
576
-
i
-
1
];
memset
(
output
+
1024
+
576
,
0
,
sizeof
(
output
[
0
])
*
448
);
memset
(
output
+
1024
+
576
,
0
,
sizeof
(
output
[
0
])
*
448
);
memcpy
(
sce
->
saved
,
audio
,
sizeof
(
sce
->
saved
[
0
])
*
1024
);
memcpy
(
audio
,
audio
+
1024
,
sizeof
(
audio
[
0
])
*
1024
);
}
}
s
->
mdct1024
.
mdct_calc
(
&
s
->
mdct1024
,
sce
->
coeffs
,
output
);
s
->
mdct1024
.
mdct_calc
(
&
s
->
mdct1024
,
sce
->
coeffs
,
output
);
}
else
{
}
else
{
for
(
k
=
0
;
k
<
1024
;
k
+=
128
)
{
for
(
k
=
0
;
k
<
1024
;
k
+=
128
)
{
for
(
i
=
448
+
k
;
i
<
448
+
k
+
256
;
i
++
)
for
(
i
=
448
+
k
;
i
<
448
+
k
+
256
;
i
++
)
output
[
i
-
448
-
k
]
=
(
i
<
1024
)
output
[
i
-
448
-
k
]
=
audio
[
i
];
?
sce
->
saved
[
i
]
:
audio
[
i
-
1024
];
s
->
dsp
.
vector_fmul
(
output
,
output
,
k
?
swindow
:
pwindow
,
128
);
s
->
dsp
.
vector_fmul
(
output
,
output
,
k
?
swindow
:
pwindow
,
128
);
s
->
dsp
.
vector_fmul_reverse
(
output
+
128
,
output
+
128
,
swindow
,
128
);
s
->
dsp
.
vector_fmul_reverse
(
output
+
128
,
output
+
128
,
swindow
,
128
);
s
->
mdct128
.
mdct_calc
(
&
s
->
mdct128
,
sce
->
coeffs
+
k
,
output
);
s
->
mdct128
.
mdct_calc
(
&
s
->
mdct128
,
sce
->
coeffs
+
k
,
output
);
}
}
memcpy
(
sce
->
saved
,
audio
,
sizeof
(
sce
->
saved
[
0
])
*
1024
);
memcpy
(
audio
,
audio
+
1024
,
sizeof
(
audio
[
0
])
*
1024
);
}
}
}
}
...
@@ -468,7 +466,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
...
@@ -468,7 +466,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
uint8_t
*
frame
,
int
buf_size
,
void
*
data
)
uint8_t
*
frame
,
int
buf_size
,
void
*
data
)
{
{
AACEncContext
*
s
=
avctx
->
priv_data
;
AACEncContext
*
s
=
avctx
->
priv_data
;
float
**
samples
=
s
->
planar_samples
,
*
samples2
,
*
la
;
float
**
samples
=
s
->
planar_samples
,
*
samples2
,
*
la
,
*
overlap
;
ChannelElement
*
cpe
;
ChannelElement
*
cpe
;
int
i
,
ch
,
w
,
g
,
chans
,
tag
,
start_ch
;
int
i
,
ch
,
w
,
g
,
chans
,
tag
,
start_ch
;
int
chan_el_counter
[
4
];
int
chan_el_counter
[
4
];
...
@@ -495,7 +493,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
...
@@ -495,7 +493,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
for
(
ch
=
0
;
ch
<
chans
;
ch
++
)
{
for
(
ch
=
0
;
ch
<
chans
;
ch
++
)
{
IndividualChannelStream
*
ics
=
&
cpe
->
ch
[
ch
].
ics
;
IndividualChannelStream
*
ics
=
&
cpe
->
ch
[
ch
].
ics
;
int
cur_channel
=
start_ch
+
ch
;
int
cur_channel
=
start_ch
+
ch
;
samples2
=
&
samples
[
cur_channel
][
0
];
overlap
=
&
samples
[
cur_channel
][
0
];
samples2
=
overlap
+
1024
;
la
=
samples2
+
(
448
+
64
);
la
=
samples2
+
(
448
+
64
);
if
(
!
data
)
if
(
!
data
)
la
=
NULL
;
la
=
NULL
;
...
@@ -524,7 +523,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
...
@@ -524,7 +523,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
for
(
w
=
0
;
w
<
ics
->
num_windows
;
w
++
)
for
(
w
=
0
;
w
<
ics
->
num_windows
;
w
++
)
ics
->
group_len
[
w
]
=
wi
[
ch
].
grouping
[
w
];
ics
->
group_len
[
w
]
=
wi
[
ch
].
grouping
[
w
];
apply_window_and_mdct
(
s
,
&
cpe
->
ch
[
ch
],
samples2
);
apply_window_and_mdct
(
s
,
&
cpe
->
ch
[
ch
],
overlap
);
}
}
start_ch
+=
chans
;
start_ch
+=
chans
;
}
}
...
@@ -652,12 +651,12 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
...
@@ -652,12 +651,12 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
static
av_cold
int
alloc_buffers
(
AVCodecContext
*
avctx
,
AACEncContext
*
s
)
static
av_cold
int
alloc_buffers
(
AVCodecContext
*
avctx
,
AACEncContext
*
s
)
{
{
FF_ALLOCZ_OR_GOTO
(
avctx
,
s
->
buffer
.
samples
,
2
*
1024
*
s
->
channels
*
sizeof
(
s
->
buffer
.
samples
[
0
]),
alloc_fail
);
FF_ALLOCZ_OR_GOTO
(
avctx
,
s
->
buffer
.
samples
,
3
*
1024
*
s
->
channels
*
sizeof
(
s
->
buffer
.
samples
[
0
]),
alloc_fail
);
FF_ALLOCZ_OR_GOTO
(
avctx
,
s
->
cpe
,
sizeof
(
ChannelElement
)
*
s
->
chan_map
[
0
],
alloc_fail
);
FF_ALLOCZ_OR_GOTO
(
avctx
,
s
->
cpe
,
sizeof
(
ChannelElement
)
*
s
->
chan_map
[
0
],
alloc_fail
);
FF_ALLOCZ_OR_GOTO
(
avctx
,
avctx
->
extradata
,
5
+
FF_INPUT_BUFFER_PADDING_SIZE
,
alloc_fail
);
FF_ALLOCZ_OR_GOTO
(
avctx
,
avctx
->
extradata
,
5
+
FF_INPUT_BUFFER_PADDING_SIZE
,
alloc_fail
);
for
(
int
ch
=
0
;
ch
<
s
->
channels
;
ch
++
)
for
(
int
ch
=
0
;
ch
<
s
->
channels
;
ch
++
)
s
->
planar_samples
[
ch
]
=
s
->
buffer
.
samples
+
2
*
1024
*
ch
;
s
->
planar_samples
[
ch
]
=
s
->
buffer
.
samples
+
3
*
1024
*
ch
;
return
0
;
return
0
;
alloc_fail:
alloc_fail:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录