Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
cbf914cf
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,发现更多精彩内容 >>
提交
cbf914cf
编写于
9月 26, 2011
作者:
T
tipok
提交者:
Michael Niedermayer
9月 26, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libaac+ support
Signed-off-by:
N
Michael Niedermayer
<
michaelni@gmx.at
>
上级
023e9960
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
151 addition
and
4 deletion
+151
-4
Changelog
Changelog
+1
-0
LICENSE
LICENSE
+3
-3
configure
configure
+6
-0
doc/general.texi
doc/general.texi
+3
-1
libavcodec/Makefile
libavcodec/Makefile
+1
-0
libavcodec/allcodecs.c
libavcodec/allcodecs.c
+1
-0
libavcodec/libaacplus.c
libavcodec/libaacplus.c
+136
-0
未找到文件。
Changelog
浏览文件 @
cbf914cf
...
...
@@ -72,6 +72,7 @@ version 0.8:
- Demuxer for On2's IVF format
- Pictor/PC Paint decoder
- HE-AAC v2 decoder
- HE-AAC v2 encoding with libaacplus
- libfaad2 wrapper removed
- DTS-ES extension (XCh) decoding support
- native VP8 decoder
...
...
LICENSE
浏览文件 @
cbf914cf
...
...
@@ -41,6 +41,6 @@ is incompatible with the LGPL v2.1 and the GPL v2, but not with version 3 of
those licenses. So to combine the OpenCORE libraries with FFmpeg, the license
version needs to be upgraded by passing --enable-version3 to configure.
The nonfree external librar
y libfaac can be hooked up in FFmpeg. You need to
pass --enable-nonfree to configure to enable it. Employ this option with care
as FFmpeg then becomes nonfree and unredistributable.
The nonfree external librar
ies libfaac and libaacplus can be hooked up in FFmpeg.
You need to pass --enable-nonfree to configure to enable it. Employ this option
with care
as FFmpeg then becomes nonfree and unredistributable.
configure
浏览文件 @
cbf914cf
...
...
@@ -165,6 +165,7 @@ External library support:
--enable-bzlib enable bzlib [autodetect]
--enable-libcelt enable CELT/Opus decoding via libcelt [no]
--enable-frei0r enable frei0r video filtering
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
--enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
...
...
@@ -994,6 +995,7 @@ CONFIG_LIST="
h264pred
hardcoded_tables
huffman
libaacplus
libcdio
libcelt
libdc1394
...
...
@@ -1483,6 +1485,7 @@ vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
h264_parser_select
=
"golomb h264dsp h264pred"
# external libraries
libaacplus_encoder_deps
=
"libaacplus"
libcelt_decoder_deps
=
"libcelt"
libdirac_decoder_deps
=
"libdirac !libschroedinger"
libdirac_encoder_deps
=
"libdirac"
...
...
@@ -2687,6 +2690,7 @@ die_license_disabled gpl libxavs
die_license_disabled gpl libxvid
die_license_disabled gpl x11grab
die_license_disabled nonfree libaacplus
die_license_disabled nonfree libfaac
die_license_disabled version3 libopencore_amrnb
...
...
@@ -3008,6 +3012,7 @@ check_mathfunc truncf
enabled avisynth
&&
require2 vfw32
"windows.h vfw.h"
AVIFileInit
-lavifil32
enabled libcelt
&&
require libcelt celt/celt.h celt_decode
-lcelt0
enabled frei0r
&&
{
check_header frei0r.h
||
die
"ERROR: frei0r.h header not found"
;
}
enabled libaacplus
&&
require
"libaacplus >= 2.0.0"
aacplus.h aacplusEncOpen
-laacplus
enabled libdc1394
&&
require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new
enabled libdirac
&&
require_pkg_config dirac
\
"libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h"
\
...
...
@@ -3339,6 +3344,7 @@ echo "libcdio support ${libcdio-no}"
echo
"libdc1394 support
${
libdc1394
-no
}
"
echo
"libdirac enabled
${
libdirac
-no
}
"
echo
"libfaac enabled
${
libfaac
-no
}
"
echo
"libaacplus enabled
${
libaacplus
-no
}
"
echo
"libgsm enabled
${
libgsm
-no
}
"
echo
"libmp3lame enabled
${
libmp3lame
-no
}
"
echo
"libnut enabled
${
libnut
-no
}
"
...
...
doc/general.texi
浏览文件 @
cbf914cf
...
...
@@ -559,6 +559,8 @@ following image formats are supported:
@multitable @columnfractions .4 .1 .1 .4
@item Name @tab Encoding @tab Decoding @tab Comments
@item 8SVX audio @tab @tab X
@item AAC+ @tab E @tab X
@tab encoding supported through external library libaacplus
@item AAC @tab E @tab X
@tab encoding supported through external library libfaac and libvo-aacenc
@item AC-3 @tab IX @tab X
...
...
@@ -1105,7 +1107,7 @@ These library packages are only available from
@uref
{
http:
//
sourceware.org
/
cygwinports
/
, Cygwin Ports
}
:
@example
yasm, libSDL
-
devel, libdirac
-
devel, libfaac
-
devel, libgsm
-
devel,
yasm, libSDL
-
devel, libdirac
-
devel, libfaac
-
devel, lib
aacplus
-
devel, lib
gsm
-
devel,
libmp
3
lame
-
devel, libschroedinger
1
.
0
-
devel, speex
-
devel, libtheora
-
devel,
libxvidcore
-
devel
@end example
...
...
libavcodec/Makefile
浏览文件 @
cbf914cf
...
...
@@ -579,6 +579,7 @@ OBJS-$(CONFIG_WEBM_MUXER) += xiph.o mpeg4audio.o \
OBJS-$(CONFIG_WTV_DEMUXER)
+=
mpeg4audio.o mpegaudiodata.o
# external codec libraries
OBJS-$(CONFIG_LIBAACPLUS_ENCODER)
+=
libaacplus.o
OBJS-$(CONFIG_LIBCELT_DECODER)
+=
libcelt_dec.o
OBJS-$(CONFIG_LIBDIRAC_DECODER)
+=
libdiracdec.o
OBJS-$(CONFIG_LIBDIRAC_ENCODER)
+=
libdiracenc.o libdirac_libschro.o
...
...
libavcodec/allcodecs.c
浏览文件 @
cbf914cf
...
...
@@ -374,6 +374,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC
(
XSUB
,
xsub
);
/* external libraries */
REGISTER_ENCODER
(
LIBAACPLUS
,
libaacplus
);
REGISTER_DECODER
(
LIBCELT
,
libcelt
);
REGISTER_ENCDEC
(
LIBDIRAC
,
libdirac
);
REGISTER_ENCODER
(
LIBFAAC
,
libfaac
);
...
...
libavcodec/libaacplus.c
0 → 100644
浏览文件 @
cbf914cf
/*
* Interface to libaacplus for aac+ (sbr+ps) encoding
* Copyright (c) 2010 tipok <piratfm@gmail.com>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Interface to libaacplus for aac+ (sbr+ps) encoding.
*/
#include "avcodec.h"
#include <aacplus.h>
typedef
struct
aacPlusAudioContext
{
aacplusEncHandle
aacplus_handle
;
}
aacPlusAudioContext
;
static
av_cold
int
aacPlus_encode_init
(
AVCodecContext
*
avctx
)
{
aacPlusAudioContext
*
s
=
avctx
->
priv_data
;
aacplusEncConfiguration
*
aacplus_cfg
;
unsigned
long
samples_input
,
max_bytes_output
;
/* number of channels */
if
(
avctx
->
channels
<
1
||
avctx
->
channels
>
2
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"encoding %d channel(s) is not allowed
\n
"
,
avctx
->
channels
);
return
-
1
;
}
s
->
aacplus_handle
=
aacplusEncOpen
(
avctx
->
sample_rate
,
avctx
->
channels
,
&
samples_input
,
&
max_bytes_output
);
if
(
!
s
->
aacplus_handle
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"can't open encoder
\n
"
);
return
-
1
;
}
/* check aacplus version */
aacplus_cfg
=
aacplusEncGetCurrentConfiguration
(
s
->
aacplus_handle
);
/* put the options in the configuration struct */
if
(
avctx
->
profile
!=
FF_PROFILE_AAC_LOW
&&
avctx
->
profile
!=
FF_PROFILE_UNKNOWN
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid AAC profile: %d, only LC supported
\n
"
,
avctx
->
profile
);
aacplusEncClose
(
s
->
aacplus_handle
);
return
-
1
;
}
aacplus_cfg
->
bitRate
=
avctx
->
bit_rate
;
aacplus_cfg
->
bandWidth
=
avctx
->
cutoff
;
if
(
avctx
->
flags
&
CODEC_FLAG_GLOBAL_HEADER
)
{
aacplus_cfg
->
outputFormat
=
0
;
//raw aac
}
aacplus_cfg
->
inputFormat
=
AACPLUS_INPUT_16BIT
;
if
(
!
aacplusEncSetConfiguration
(
s
->
aacplus_handle
,
aacplus_cfg
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"libaacplus doesn't support this output format!
\n
"
);
return
-
1
;
}
avctx
->
frame_size
=
samples_input
/
avctx
->
channels
;
avctx
->
coded_frame
=
avcodec_alloc_frame
();
avctx
->
coded_frame
->
key_frame
=
1
;
/* Set decoder specific info */
avctx
->
extradata_size
=
0
;
if
(
avctx
->
flags
&
CODEC_FLAG_GLOBAL_HEADER
)
{
unsigned
char
*
buffer
=
NULL
;
unsigned
long
decoder_specific_info_size
;
if
(
aacplusEncGetDecoderSpecificInfo
(
s
->
aacplus_handle
,
&
buffer
,
&
decoder_specific_info_size
)
==
1
)
{
avctx
->
extradata
=
av_malloc
(
decoder_specific_info_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
avctx
->
extradata_size
=
decoder_specific_info_size
;
memcpy
(
avctx
->
extradata
,
buffer
,
avctx
->
extradata_size
);
}
#undef free
free
(
buffer
);
#define free please_use_av_free
}
return
0
;
}
static
int
aacPlus_encode_frame
(
AVCodecContext
*
avctx
,
unsigned
char
*
frame
,
int
buf_size
,
void
*
data
)
{
aacPlusAudioContext
*
s
=
avctx
->
priv_data
;
int
bytes_written
;
bytes_written
=
aacplusEncEncode
(
s
->
aacplus_handle
,
data
,
avctx
->
frame_size
*
avctx
->
channels
,
frame
,
buf_size
);
return
bytes_written
;
}
static
av_cold
int
aacPlus_encode_close
(
AVCodecContext
*
avctx
)
{
aacPlusAudioContext
*
s
=
avctx
->
priv_data
;
av_freep
(
&
avctx
->
coded_frame
);
av_freep
(
&
avctx
->
extradata
);
aacplusEncClose
(
s
->
aacplus_handle
);
return
0
;
}
AVCodec
ff_libaacplus_encoder
=
{
"libaacplus"
,
AVMEDIA_TYPE_AUDIO
,
CODEC_ID_AAC
,
sizeof
(
aacPlusAudioContext
),
aacPlus_encode_init
,
aacPlus_encode_frame
,
aacPlus_encode_close
,
.
sample_fmts
=
(
const
enum
SampleFormat
[]){
SAMPLE_FMT_S16
,
SAMPLE_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libaacplus AAC+ (Advanced Audio Codec with SBR+PS)"
),
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录