Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
ec9a5deb
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,发现更多精彩内容 >>
提交
ec9a5deb
编写于
4月 26, 2011
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mp3enc: drop sum and count bytes instead of bitrates from decoded headers.
Signed-off-by:
N
Michael Niedermayer
<
michaelni@gmx.at
>
上级
7d624756
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
9 deletion
+5
-9
libavformat/mp3enc.c
libavformat/mp3enc.c
+5
-9
未找到文件。
libavformat/mp3enc.c
浏览文件 @
ec9a5deb
...
...
@@ -172,7 +172,6 @@ typedef struct MP3Context {
uint32_t
want
;
uint32_t
seen
;
uint32_t
pos
;
uint64_t
sum
;
uint64_t
bag
[
VBR_NUM_BAGS
];
}
toc
;
}
xing_header
;
...
...
@@ -277,7 +276,6 @@ static int mp3_write_xing(AVFormatContext *s)
mp3
->
xing_header
.
toc
.
want
=
1
;
mp3
->
xing_header
.
toc
.
seen
=
0
;
mp3
->
xing_header
.
toc
.
pos
=
0
;
mp3
->
xing_header
.
toc
.
sum
=
0
;
avio_wb32
(
s
->
pb
,
0
);
// frames
avio_wb32
(
s
->
pb
,
0
);
// size
...
...
@@ -296,7 +294,7 @@ static int mp3_write_xing(AVFormatContext *s)
* Add a frame to XING data.
* Following lame's "VbrTag.c".
*/
static
void
mp3_xing_add_frame
(
AVFormatContext
*
s
,
AVPacket
*
pkt
,
MPADecodeHeader
*
c
)
static
void
mp3_xing_add_frame
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
MP3Context
*
mp3
=
s
->
priv_data
;
struct
xing_header
*
xing_header
=
&
mp3
->
xing_header
;
...
...
@@ -305,10 +303,9 @@ static void mp3_xing_add_frame(AVFormatContext *s, AVPacket *pkt, MPADecodeHeade
++
xing_header
->
frames
;
xing_header
->
size
+=
pkt
->
size
;
toc
->
sum
+=
c
->
bit_rate
/
1000
;
if
(
toc
->
want
==
++
toc
->
seen
)
{
toc
->
bag
[
toc
->
pos
]
=
toc
->
sum
;
toc
->
bag
[
toc
->
pos
]
=
xing_header
->
size
;
if
(
VBR_NUM_BAGS
==
++
toc
->
pos
)
{
/* shrink table to half size by throwing away each second bag. */
...
...
@@ -342,8 +339,7 @@ static void mp3_fix_xing(AVFormatContext *s)
for
(
i
=
1
;
i
<
VBR_TOC_SIZE
;
++
i
)
{
int
j
=
(
int
)
floor
(
scale
*
i
);
int
seek_point
=
(
int
)
floor
(
256
.
0
*
toc
->
bag
[
j
]
/
toc
->
sum
);
int
seek_point
=
(
int
)
floor
(
256
.
0
*
toc
->
bag
[
j
]
/
xing_header
->
size
);
avio_w8
(
s
->
pb
,
(
uint8_t
)(
seek_point
<
256
?
seek_point
:
255
));
}
...
...
@@ -414,9 +410,9 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
MPADecodeHeader
c
;
int
base
;
#ifdef FILTER_VBR_HEADERS
ff_mpegaudio_decode_header
(
&
c
,
AV_RB32
(
pkt
->
data
));
#ifdef FILTER_VBR_HEADERS
/* filter out XING and INFO headers. */
base
=
4
+
xing_offtbl
[
c
.
lsf
==
1
][
c
.
nb_channels
==
1
];
...
...
@@ -435,7 +431,7 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
#endif
if
(
0
<
mp3
->
xing_header
.
offset
)
mp3_xing_add_frame
(
s
,
pkt
,
&
c
);
mp3_xing_add_frame
(
s
,
pkt
);
return
ff_raw_write_packet
(
s
,
pkt
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录