From 667fb97a650dcf9ad50327c7b51f8a95d1e16077 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 3 Jul 2012 20:14:09 -0700 Subject: [PATCH 01/10] dct/fft-test: use a replacement getopt() if the system has none present. This allows compiling and running these tests on systems lacking a built- in version of getopt(), such as MSVC. Signed-off-by: Anton Khirnov --- compat/getopt.c | 84 +++++++++++++++++++++++++++++++++++++++++++ configure | 2 ++ libavcodec/dct-test.c | 7 ++++ libavcodec/fft-test.c | 6 ++++ 4 files changed, 99 insertions(+) create mode 100644 compat/getopt.c diff --git a/compat/getopt.c b/compat/getopt.c new file mode 100644 index 0000000000..3a873b27ee --- /dev/null +++ b/compat/getopt.c @@ -0,0 +1,84 @@ +/* + * 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 + */ + +/* + * This file was copied from the following newsgroup posting: + * + * Newsgroups: mod.std.unix + * Subject: public domain AT&T getopt source + * Date: 3 Nov 85 19:34:15 GMT + * + * Here's something you've all been waiting for: the AT&T public domain + * source for getopt(3). It is the code which was given out at the 1985 + * UNIFORUM conference in Dallas. I obtained it by electronic mail + * directly from AT&T. The people there assure me that it is indeed + * in the public domain. + */ + +#define EOF (-1) + +static int opterr = 1; +static int optind = 1; +static int optopt; +static char *optarg; + +#undef fprintf + +static int getopt(int argc, char *argv[], char *opts) +{ + static int sp = 1; + int c; + char *cp; + + if (sp == 1) + if (optind >= argc || + argv[optind][0] != '-' || argv[optind][1] == '\0') + return EOF; + else if (!strcmp(argv[optind], "--")) { + optind++; + return EOF; + } + optopt = c = argv[optind][sp]; + if (c == ':' || (cp = strchr(opts, c)) == NULL) { + fprintf(stderr, ": illegal option -- %c\n", c); + if (argv[optind][++sp] == '\0') { + optind++; + sp = 1; + } + return '?'; + } + if (*++cp == ':') { + if (argv[optind][sp+1] != '\0') + optarg = &argv[optind++][sp+1]; + else if(++optind >= argc) { + fprintf(stderr, ": option requires an argument -- %c\n", c); + sp = 1; + return '?'; + } else + optarg = argv[optind++]; + sp = 1; + } else { + if (argv[optind][++sp] == '\0') { + sp = 1; + optind++; + } + optarg = NULL; + } + + return c; +} diff --git a/configure b/configure index 2888c72ba0..4d83d4bd9f 100755 --- a/configure +++ b/configure @@ -1083,6 +1083,7 @@ HAVE_LIST=" fork getaddrinfo gethrtime + getopt GetProcessAffinityMask GetProcessMemoryInfo GetProcessTimes @@ -2862,6 +2863,7 @@ check_func fcntl check_func fork check_func getaddrinfo $network_extralibs check_func gethrtime +check_func getopt check_func getrusage check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss check_func gettimeofday diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 4647642080..ceff448ae7 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -25,10 +25,13 @@ * Started from sample code by Juan J. Sierralta P. */ +#include "config.h" #include #include #include +#if HAVE_UNISTD_H #include +#endif #include #include "libavutil/cpu.h" @@ -474,6 +477,10 @@ static void help(void) "-t speed test\n"); } +#if !HAVE_GETOPT +#include "compat/getopt.c" +#endif + int main(int argc, char **argv) { int test_idct = 0, test_248_dct = 0; diff --git a/libavcodec/fft-test.c b/libavcodec/fft-test.c index 75941a1071..1e4675019c 100644 --- a/libavcodec/fft-test.c +++ b/libavcodec/fft-test.c @@ -34,7 +34,9 @@ #include "rdft.h" #endif #include +#if HAVE_UNISTD_H #include +#endif #include #include @@ -229,6 +231,10 @@ enum tf_transform { TRANSFORM_DCT, }; +#if !HAVE_GETOPT +#include "compat/getopt.c" +#endif + int main(int argc, char **argv) { FFTComplex *tab, *tab1, *tab_ref; From 372597e5381c097455a7b73849254d56083eb056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 29 Jun 2012 10:52:18 +0300 Subject: [PATCH 02/10] libavcodec: Add more AAC profiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The numerical values of the profiles are the MPEG4 Audio Object Type values, minus one. Signed-off-by: Martin Storsjö --- libavcodec/avcodec.h | 4 ++++ libavcodec/options_table.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a1103e903f..0c962cc423 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2714,6 +2714,10 @@ typedef struct AVCodecContext { #define FF_PROFILE_AAC_LOW 1 #define FF_PROFILE_AAC_SSR 2 #define FF_PROFILE_AAC_LTP 3 +#define FF_PROFILE_AAC_HE 4 +#define FF_PROFILE_AAC_HE_V2 28 +#define FF_PROFILE_AAC_LD 22 +#define FF_PROFILE_AAC_ELD 38 #define FF_PROFILE_DTS 20 #define FF_PROFILE_DTS_ES 30 diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index 7f5b643150..4f903cc9de 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -316,6 +316,10 @@ static const AVOption options[]={ {"aac_low", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_LOW }, INT_MIN, INT_MAX, A|E, "profile"}, {"aac_ssr", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_SSR }, INT_MIN, INT_MAX, A|E, "profile"}, {"aac_ltp", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_LTP }, INT_MIN, INT_MAX, A|E, "profile"}, +{"aac_he", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_HE }, INT_MIN, INT_MAX, A|E, "profile"}, +{"aac_he_v2", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_HE_V2 }, INT_MIN, INT_MAX, A|E, "profile"}, +{"aac_ld", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_LD }, INT_MIN, INT_MAX, A|E, "profile"}, +{"aac_eld", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_ELD }, INT_MIN, INT_MAX, A|E, "profile"}, {"dts", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS }, INT_MIN, INT_MAX, A|E, "profile"}, {"dts_es", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_ES }, INT_MIN, INT_MAX, A|E, "profile"}, {"dts_96_24", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_96_24 }, INT_MIN, INT_MAX, A|E, "profile"}, From 37eeb5e273cdea19a7c9979e0d032dbc0868df88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 28 Jun 2012 16:46:24 +0300 Subject: [PATCH 03/10] Support AAC encoding via the external library fdk-aac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- Changelog | 1 + configure | 5 + doc/general.texi | 12 +- libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/libfdk-aacenc.c | 384 +++++++++++++++++++++++++++++++++++++ libavcodec/version.h | 2 +- 7 files changed, 403 insertions(+), 3 deletions(-) create mode 100644 libavcodec/libfdk-aacenc.c diff --git a/Changelog b/Changelog index 2fb5e3d09b..c56740c856 100644 --- a/Changelog +++ b/Changelog @@ -33,6 +33,7 @@ version : - Microsoft ATC Screen decoder - RTSP listen mode - TechSmith Screen Codec 2 decoder +- AAC encoding via libfdk-aac version 0.8: diff --git a/configure b/configure index 4d83d4bd9f..397be73907 100755 --- a/configure +++ b/configure @@ -170,6 +170,7 @@ External library support: --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] --enable-libfaac enable FAAC support via libfaac [no] + --enable-libfdk-aac enable AAC support via libfdk-aac [no] --enable-libfreetype enable libfreetype [no] --enable-libgsm enable GSM support via libgsm [no] --enable-libilbc enable iLBC de/encoding via libilbc [no] @@ -943,6 +944,7 @@ CONFIG_LIST=" libcdio libdc1394 libfaac + libfdk_aac libfreetype libgsm libilbc @@ -1448,6 +1450,7 @@ h264_parser_select="golomb h264dsp h264pred" # external libraries libfaac_encoder_deps="libfaac" +libfdk_aac_encoder_deps="libfdk_aac" libgsm_decoder_deps="libgsm" libgsm_encoder_deps="libgsm" libgsm_ms_decoder_deps="libgsm" @@ -2968,6 +2971,7 @@ enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32 enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; } enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac +enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc @@ -3259,6 +3263,7 @@ echo "gnutls enabled ${gnutls-no}" echo "libcdio support ${libcdio-no}" echo "libdc1394 support ${libdc1394-no}" echo "libfaac enabled ${libfaac-no}" +echo "libfdk-aac enabled ${libfdk_aac-no}" echo "libgsm enabled ${libgsm-no}" echo "libilbc enabled ${libilbc-no}" echo "libmp3lame enabled ${libmp3lame-no}" diff --git a/doc/general.texi b/doc/general.texi index 7e9cfaf550..fcac1143f8 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -18,8 +18,8 @@ explicitly requested by passing the appropriate flags to @section OpenCORE and VisualOn libraries -Spun off Google Android sources, OpenCore and VisualOn libraries provide -encoders for a number of audio codecs. +Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer +libraries provide encoders for a number of audio codecs. @float NOTE OpenCORE and VisualOn libraries are under the Apache License 2.0 @@ -55,6 +55,14 @@ Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the instructions for installing the library. Then pass @code{--enable-libvo-amrwbenc} to configure to enable it. +@subsection Fraunhofer AAC library + +Libav can make use of the Fraunhofer AAC library for AAC encoding. + +Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the +instructions for installing the library. +Then pass @code{--enable-libfdk-aac} to configure to enable it. + @section LAME Libav can make use of the LAME library for MP3 encoding. diff --git a/libavcodec/Makefile b/libavcodec/Makefile index ac97d34058..8d38ca24b7 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -595,6 +595,7 @@ OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o # external codec libraries OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o audio_frame_queue.o +OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o audio_frame_queue.o OBJS-$(CONFIG_LIBGSM_DECODER) += libgsm.o OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsm.o OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsm.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 068f191b0b..bd48728ace 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -380,6 +380,7 @@ void avcodec_register_all(void) /* external libraries */ REGISTER_ENCODER (LIBFAAC, libfaac); + REGISTER_ENCODER (LIBFDK_AAC, libfdk_aac); REGISTER_ENCDEC (LIBGSM, libgsm); REGISTER_ENCDEC (LIBGSM_MS, libgsm_ms); REGISTER_ENCDEC (LIBILBC, libilbc); diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c new file mode 100644 index 0000000000..6fda53ca60 --- /dev/null +++ b/libavcodec/libfdk-aacenc.c @@ -0,0 +1,384 @@ +/* + * AAC encoder wrapper + * Copyright (c) 2012 Martin Storsjo + * + * 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 + */ + +#include + +#include "avcodec.h" +#include "audio_frame_queue.h" +#include "internal.h" +#include "libavutil/audioconvert.h" +#include "libavutil/opt.h" + +typedef struct AACContext { + const AVClass *class; + HANDLE_AACENCODER handle; + int afterburner; + int eld_sbr; + int signaling; + + AudioFrameQueue afq; +} AACContext; + +static const AVOption aac_enc_options[] = { + { "afterburner", "Afterburner (improved quality)", offsetof(AACContext, afterburner), AV_OPT_TYPE_INT, { 1 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM }, + { "eld_sbr", "Enable SBR for ELD (for SBR in other configurations, use the -profile parameter)", offsetof(AACContext, eld_sbr), AV_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM }, + { "signaling", "SBR/PS signaling style", offsetof(AACContext, signaling), AV_OPT_TYPE_INT, { -1 }, -1, 2, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" }, + { "default", "Choose signaling implicitly (explicit hierarchical by default, implicit if global header is disabled)", 0, AV_OPT_TYPE_CONST, { -1 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" }, + { "implicit", "Implicit backwards compatible signaling", 0, AV_OPT_TYPE_CONST, { 0 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" }, + { "explicit_sbr", "Explicit SBR, implicit PS signaling", 0, AV_OPT_TYPE_CONST, { 1 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" }, + { "explicit_hierarchical", "Explicit hierarchical signaling", 0, AV_OPT_TYPE_CONST, { 2 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM, "signaling" }, + { NULL } +}; + +static const AVClass aac_enc_class = { + "libfdk_aac", av_default_item_name, aac_enc_options, LIBAVUTIL_VERSION_INT +}; + +static const char *aac_get_error(AACENC_ERROR err) +{ + switch (err) { + case AACENC_OK: + return "No error"; + case AACENC_INVALID_HANDLE: + return "Invalid handle"; + case AACENC_MEMORY_ERROR: + return "Memory allocation error"; + case AACENC_UNSUPPORTED_PARAMETER: + return "Unsupported parameter"; + case AACENC_INVALID_CONFIG: + return "Invalid config"; + case AACENC_INIT_ERROR: + return "Initialization error"; + case AACENC_INIT_AAC_ERROR: + return "AAC library initialization error"; + case AACENC_INIT_SBR_ERROR: + return "SBR library initialization error"; + case AACENC_INIT_TP_ERROR: + return "Transport library initialization error"; + case AACENC_INIT_META_ERROR: + return "Metadata library initialization error"; + case AACENC_ENCODE_ERROR: + return "Encoding error"; + case AACENC_ENCODE_EOF: + return "End of file"; + default: + return "Unknown error"; + } +} + +static int aac_encode_close(AVCodecContext *avctx) +{ + AACContext *s = avctx->priv_data; + + if (s->handle) + aacEncClose(&s->handle); +#if FF_API_OLD_ENCODE_AUDIO + av_freep(&avctx->coded_frame); +#endif + av_freep(&avctx->extradata); + ff_af_queue_close(&s->afq); + + return 0; +} + +static av_cold int aac_encode_init(AVCodecContext *avctx) +{ + AACContext *s = avctx->priv_data; + int ret = AVERROR(EINVAL); + AACENC_InfoStruct info = { 0 }; + CHANNEL_MODE mode; + AACENC_ERROR err; + int aot = FF_PROFILE_AAC_LOW + 1; + int sce = 0, cpe = 0; + + if ((err = aacEncOpen(&s->handle, 0, avctx->channels)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n", + aac_get_error(err)); + goto error; + } + + if (avctx->profile != FF_PROFILE_UNKNOWN) + aot = avctx->profile + 1; + + if ((err = aacEncoder_SetParam(s->handle, AACENC_AOT, aot)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set the AOT %d: %s\n", + aot, aac_get_error(err)); + goto error; + } + + if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_sbr) { + if ((err = aacEncoder_SetParam(s->handle, AACENC_SBR_MODE, + 1)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n", + aac_get_error(err)); + goto error; + } + } + + if ((err = aacEncoder_SetParam(s->handle, AACENC_SAMPLERATE, + avctx->sample_rate)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set the sample rate %d: %s\n", + avctx->sample_rate, aac_get_error(err)); + goto error; + } + + switch (avctx->channels) { + case 1: mode = MODE_1; sce = 1; cpe = 0; break; + case 2: mode = MODE_2; sce = 0; cpe = 1; break; + case 3: mode = MODE_1_2; sce = 1; cpe = 1; break; + case 4: mode = MODE_1_2_1; sce = 2; cpe = 1; break; + case 5: mode = MODE_1_2_2; sce = 1; cpe = 2; break; + case 6: mode = MODE_1_2_2_1; sce = 2; cpe = 2; break; + default: + av_log(avctx, AV_LOG_ERROR, + "Unsupported number of channels %d\n", avctx->channels); + goto error; + } + + if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELMODE, + mode)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, + "Unable to set channel mode %d: %s\n", mode, aac_get_error(err)); + goto error; + } + + if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELORDER, + 1)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, + "Unable to set wav channel order %d: %s\n", + mode, aac_get_error(err)); + goto error; + } + + if (avctx->flags & CODEC_FLAG_QSCALE) { + int mode = avctx->global_quality; + if (mode < 1 || mode > 5) { + av_log(avctx, AV_LOG_WARNING, + "VBR quality %d out of range, should be 1-5\n", mode); + mode = av_clip(mode, 1, 5); + } + if ((err = aacEncoder_SetParam(s->handle, AACENC_BITRATEMODE, + mode)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set the VBR bitrate mode %d: %s\n", + mode, aac_get_error(err)); + goto error; + } + } else { + if (avctx->bit_rate <= 0) { + if (avctx->profile == FF_PROFILE_AAC_HE_V2) { + sce = 1; + cpe = 0; + } + avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44; + if (avctx->profile == FF_PROFILE_AAC_HE || + avctx->profile == FF_PROFILE_AAC_HE_V2 || + s->eld_sbr) + avctx->bit_rate /= 2; + } + if ((err = aacEncoder_SetParam(s->handle, AACENC_BITRATE, + avctx->bit_rate)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set the bitrate %d: %s\n", + avctx->bit_rate, aac_get_error(err)); + goto error; + } + } + + /* Choose bitstream format - if global header is requested, use + * raw access units, otherwise use ADTS. */ + if ((err = aacEncoder_SetParam(s->handle, AACENC_TRANSMUX, + avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 0 : 2)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set the transmux format: %s\n", + aac_get_error(err)); + goto error; + } + + /* If no signaling mode is chosen, use explicit hierarchical signaling + * if using mp4 mode (raw access units, with global header) and + * implicit signaling if using ADTS. */ + if (s->signaling < 0) + s->signaling = avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 2 : 0; + + if ((err = aacEncoder_SetParam(s->handle, AACENC_SIGNALING_MODE, + s->signaling)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set signaling mode %d: %s\n", + s->signaling, aac_get_error(err)); + goto error; + } + + if ((err = aacEncoder_SetParam(s->handle, AACENC_AFTERBURNER, + s->afterburner)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set afterburner to %d: %s\n", + s->afterburner, aac_get_error(err)); + goto error; + } + + if ((err = aacEncEncode(s->handle, NULL, NULL, NULL, NULL)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to initialize the encoder: %s\n", + aac_get_error(err)); + return AVERROR(EINVAL); + } + + if ((err = aacEncInfo(s->handle, &info)) != AACENC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to get encoder info: %s\n", + aac_get_error(err)); + goto error; + } + +#if FF_API_OLD_ENCODE_AUDIO + avctx->coded_frame = avcodec_alloc_frame(); + if (!avctx->coded_frame) { + ret = AVERROR(ENOMEM); + goto error; + } +#endif + avctx->frame_size = info.frameLength; + avctx->delay = info.encoderDelay; + ff_af_queue_init(avctx, &s->afq); + + if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) { + avctx->extradata_size = info.confSize; + avctx->extradata = av_mallocz(avctx->extradata_size + + FF_INPUT_BUFFER_PADDING_SIZE); + if (!avctx->extradata) { + ret = AVERROR(ENOMEM); + goto error; + } + + memcpy(avctx->extradata, info.confBuf, info.confSize); + } + return 0; +error: + aac_encode_close(avctx); + return ret; +} + +static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, + const AVFrame *frame, int *got_packet_ptr) +{ + AACContext *s = avctx->priv_data; + AACENC_BufDesc in_buf = { 0 }, out_buf = { 0 }; + AACENC_InArgs in_args = { 0 }; + AACENC_OutArgs out_args = { 0 }; + int in_buffer_identifier = IN_AUDIO_DATA; + int in_buffer_size, in_buffer_element_size; + int out_buffer_identifier = OUT_BITSTREAM_DATA; + int out_buffer_size, out_buffer_element_size; + void *in_ptr, *out_ptr; + int ret; + AACENC_ERROR err; + + /* handle end-of-stream small frame and flushing */ + if (!frame) { + in_args.numInSamples = -1; + } else { + in_ptr = frame->data[0]; + in_buffer_size = 2 * avctx->channels * frame->nb_samples; + in_buffer_element_size = 2; + + in_args.numInSamples = avctx->channels * frame->nb_samples; + in_buf.numBufs = 1; + in_buf.bufs = &in_ptr; + in_buf.bufferIdentifiers = &in_buffer_identifier; + in_buf.bufSizes = &in_buffer_size; + in_buf.bufElSizes = &in_buffer_element_size; + + /* add current frame to the queue */ + if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) + return ret; + } + + /* The maximum packet size is 6144 bits aka 768 bytes per channel. */ + if ((ret = ff_alloc_packet(avpkt, FFMAX(8192, 768 * avctx->channels)))) { + av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n"); + return ret; + } + + out_ptr = avpkt->data; + out_buffer_size = avpkt->size; + out_buffer_element_size = 1; + out_buf.numBufs = 1; + out_buf.bufs = &out_ptr; + out_buf.bufferIdentifiers = &out_buffer_identifier; + out_buf.bufSizes = &out_buffer_size; + out_buf.bufElSizes = &out_buffer_element_size; + + if ((err = aacEncEncode(s->handle, &in_buf, &out_buf, &in_args, + &out_args)) != AACENC_OK) { + if (!frame && err == AACENC_ENCODE_EOF) + return 0; + av_log(avctx, AV_LOG_ERROR, "Unable to encode frame: %s\n", + aac_get_error(err)); + return AVERROR(EINVAL); + } + + if (!out_args.numOutBytes) + return 0; + + /* Get the next frame pts & duration */ + ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts, + &avpkt->duration); + + avpkt->size = out_args.numOutBytes; + *got_packet_ptr = 1; + return 0; +} + +static const AVProfile profiles[] = { + { FF_PROFILE_AAC_LOW, "LC" }, + { FF_PROFILE_AAC_HE, "HE-AAC" }, + { FF_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { FF_PROFILE_AAC_LD, "LD" }, + { FF_PROFILE_AAC_ELD, "ELD" }, + { FF_PROFILE_UNKNOWN }, +}; + +static const AVCodecDefault aac_encode_defaults[] = { + { "b", "0" }, + { NULL } +}; + +static const uint64_t aac_channel_layout[] = { + AV_CH_LAYOUT_MONO, + AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_SURROUND, + AV_CH_LAYOUT_4POINT0, + AV_CH_LAYOUT_5POINT0_BACK, + AV_CH_LAYOUT_5POINT1_BACK, + 0, +}; + +AVCodec ff_libfdk_aac_encoder = { + .name = "libfdk_aac", + .type = AVMEDIA_TYPE_AUDIO, + .id = CODEC_ID_AAC, + .priv_data_size = sizeof(AACContext), + .init = aac_encode_init, + .encode2 = aac_encode_frame, + .close = aac_encode_close, + .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY, + .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + AV_SAMPLE_FMT_NONE }, + .long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), + .priv_class = &aac_enc_class, + .defaults = aac_encode_defaults, + .profiles = profiles, + .channel_layouts = aac_channel_layout, +}; diff --git a/libavcodec/version.h b/libavcodec/version.h index 6f47df96cf..48db12e50a 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -27,7 +27,7 @@ */ #define LIBAVCODEC_VERSION_MAJOR 54 -#define LIBAVCODEC_VERSION_MINOR 18 +#define LIBAVCODEC_VERSION_MINOR 19 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ From 7d605d51155a3e2d5a57a8c63feddd721003de92 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 10 Jul 2012 22:17:26 +0200 Subject: [PATCH 04/10] configure: Drop redundant mxf_d10 test dependency declaration The mxf_d10 test depends on avconv, which depends on avfilter, so there is no need to declare an avfilter dependency for the mxf_d10 test. --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 397be73907..fd3a398231 100755 --- a/configure +++ b/configure @@ -1599,7 +1599,6 @@ test_deps(){ done } -mxf_d10_test_deps="avfilter" seek_lavf_mxf_d10_test_deps="mxf_d10_test" test_deps _muxer _demuxer \ From d648de61e63360d27c06890ca14213c62abc2e39 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 10 Jul 2012 18:21:45 +0200 Subject: [PATCH 05/10] build: Add missing build rules for the ISMV muxer --- libavcodec/Makefile | 1 + libavformat/Makefile | 3 +++ 2 files changed, 4 insertions(+) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 8d38ca24b7..1e4ed69fa3 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -570,6 +570,7 @@ OBJS-$(CONFIG_FLAC_MUXER) += flacdec.o flacdata.o flac.o OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o OBJS-$(CONFIG_IFF_DEMUXER) += iff.o +OBJS-$(CONFIG_ISMV_MUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_LATM_MUXER) += mpeg4audio.o OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o \ flacdec.o flacdata.o flac.o diff --git a/libavformat/Makefile b/libavformat/Makefile index bf219c2581..554adbd21d 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -118,6 +118,9 @@ OBJS-$(CONFIG_IMAGE2PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE2PIPE_MUXER) += img2enc.o img2.o OBJS-$(CONFIG_INGENIENT_DEMUXER) += ingenientdec.o rawdec.o OBJS-$(CONFIG_IPMOVIE_DEMUXER) += ipmovie.o +OBJS-$(CONFIG_ISMV_MUXER) += movenc.o isom.o avc.o \ + movenchint.o rtpenc_chain.o \ + mov_chan.o OBJS-$(CONFIG_ISS_DEMUXER) += iss.o OBJS-$(CONFIG_IV8_DEMUXER) += iv8.o OBJS-$(CONFIG_IVF_DEMUXER) += ivfdec.o From b7884ff7af91c741d3629c150b998c989eef6d8c Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 10 Jul 2012 18:39:23 +0200 Subject: [PATCH 06/10] build: Fix MP2 muxer dependencies --- libavcodec/Makefile | 1 + libavformat/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 1e4ed69fa3..3eb862d8f6 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -578,6 +578,7 @@ OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \ flacdec.o flacdata.o flac.o \ mpegaudiodata.o +OBJS-$(CONFIG_MP2_MUXER) += mpegaudiodata.o mpegaudiodecheader.o OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o ac3tab.o OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o diff --git a/libavformat/Makefile b/libavformat/Makefile index 554adbd21d..a5a331efd6 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -149,7 +149,7 @@ OBJS-$(CONFIG_MOV_DEMUXER) += mov.o isom.o mov_chan.o OBJS-$(CONFIG_MOV_MUXER) += movenc.o isom.o avc.o \ movenchint.o rtpenc_chain.o \ mov_chan.o -OBJS-$(CONFIG_MP2_MUXER) += mp3enc.o rawenc.o +OBJS-$(CONFIG_MP2_MUXER) += mp3enc.o rawenc.o id3v2enc.o OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o OBJS-$(CONFIG_MPC_DEMUXER) += mpc.o apetag.o From a519463366238a7ec05d2bb76c4a67f42cf60ece Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 10 Jul 2012 18:42:13 +0200 Subject: [PATCH 07/10] build: Fix CAF demuxer dependencies --- libavcodec/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 3eb862d8f6..01159f6a8b 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -562,7 +562,8 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o # libavformat dependencies OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o OBJS-$(CONFIG_ADX_DEMUXER) += adx.o -OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o +OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \ + ac3tab.o OBJS-$(CONFIG_DV_DEMUXER) += dv_profile.o OBJS-$(CONFIG_DV_MUXER) += dv_profile.o OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o flacdata.o flac.o From 8eea8fdcebfa4ceaeba8aa6d3e68d56268c5bdf9 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 10 Jul 2012 18:32:41 +0200 Subject: [PATCH 08/10] flac: Move flac functions shared between libraries to flac common code This fixes a number of flac-related build dependencies. --- libavcodec/Makefile | 24 +++++++------- libavcodec/flac.c | 74 ++++++++++++++++++++++++++++++++++++++++++++ libavcodec/flacdec.c | 73 ------------------------------------------- 3 files changed, 85 insertions(+), 86 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 01159f6a8b..ee4ac7532c 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -566,19 +566,18 @@ OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \ ac3tab.o OBJS-$(CONFIG_DV_DEMUXER) += dv_profile.o OBJS-$(CONFIG_DV_MUXER) += dv_profile.o -OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o flacdata.o flac.o -OBJS-$(CONFIG_FLAC_MUXER) += flacdec.o flacdata.o flac.o +OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o +OBJS-$(CONFIG_FLAC_MUXER) += flac.o flacdata.o OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o OBJS-$(CONFIG_IFF_DEMUXER) += iff.o OBJS-$(CONFIG_ISMV_MUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_LATM_MUXER) += mpeg4audio.o -OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o \ - flacdec.o flacdata.o flac.o +OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o \ + flac.o flacdata.o OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o -OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \ - flacdec.o flacdata.o flac.o \ - mpegaudiodata.o +OBJS-$(CONFIG_MATROSKA_MUXER) += mpeg4audio.o mpegaudiodata.o \ + flac.o flacdata.o xiph.o OBJS-$(CONFIG_MP2_MUXER) += mpegaudiodata.o mpegaudiodecheader.o OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o ac3tab.o @@ -586,14 +585,13 @@ OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o mpeg4audio.o OBJS-$(CONFIG_MPEGTS_DEMUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o -OBJS-$(CONFIG_OGG_DEMUXER) += flacdec.o flacdata.o flac.o \ - dirac.o mpeg12data.o vorbis_parser.o -OBJS-$(CONFIG_OGG_MUXER) += xiph.o flacdec.o flacdata.o flac.o +OBJS-$(CONFIG_OGG_DEMUXER) += flac.o flacdata.o dirac.o \ + mpeg12data.o vorbis_parser.o +OBJS-$(CONFIG_OGG_MUXER) += xiph.o flac.o flacdata.o OBJS-$(CONFIG_RTP_MUXER) += mpeg4audio.o mpegvideo.o xiph.o OBJS-$(CONFIG_SPDIF_DEMUXER) += aacadtsdec.o mpeg4audio.o -OBJS-$(CONFIG_WEBM_MUXER) += xiph.o mpeg4audio.o \ - flacdec.o flacdata.o flac.o \ - mpegaudiodata.o +OBJS-$(CONFIG_WEBM_MUXER) += mpeg4audio.o mpegaudiodata.o \ + xiph.o flac.o flacdata.o OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o # external codec libraries diff --git a/libavcodec/flac.c b/libavcodec/flac.c index ac36376cdc..d624beb61f 100644 --- a/libavcodec/flac.c +++ b/libavcodec/flac.c @@ -20,6 +20,9 @@ */ #include "libavutil/crc.h" +#include "libavutil/log.h" +#include "bytestream.h" +#include "get_bits.h" #include "flac.h" #include "flacdata.h" @@ -150,3 +153,74 @@ int ff_flac_get_max_frame_size(int blocksize, int ch, int bps) return count; } + +int avpriv_flac_is_extradata_valid(AVCodecContext *avctx, + enum FLACExtradataFormat *format, + uint8_t **streaminfo_start) +{ + if (!avctx->extradata || avctx->extradata_size < FLAC_STREAMINFO_SIZE) { + av_log(avctx, AV_LOG_ERROR, "extradata NULL or too small.\n"); + return 0; + } + if (AV_RL32(avctx->extradata) != MKTAG('f','L','a','C')) { + /* extradata contains STREAMINFO only */ + if (avctx->extradata_size != FLAC_STREAMINFO_SIZE) { + av_log(avctx, AV_LOG_WARNING, "extradata contains %d bytes too many.\n", + FLAC_STREAMINFO_SIZE-avctx->extradata_size); + } + *format = FLAC_EXTRADATA_FORMAT_STREAMINFO; + *streaminfo_start = avctx->extradata; + } else { + if (avctx->extradata_size < 8+FLAC_STREAMINFO_SIZE) { + av_log(avctx, AV_LOG_ERROR, "extradata too small.\n"); + return 0; + } + *format = FLAC_EXTRADATA_FORMAT_FULL_HEADER; + *streaminfo_start = &avctx->extradata[8]; + } + return 1; +} + +void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, + const uint8_t *buffer) +{ + GetBitContext gb; + init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8); + + skip_bits(&gb, 16); /* skip min blocksize */ + s->max_blocksize = get_bits(&gb, 16); + if (s->max_blocksize < FLAC_MIN_BLOCKSIZE) { + av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\n", + s->max_blocksize); + s->max_blocksize = 16; + } + + skip_bits(&gb, 24); /* skip min frame size */ + s->max_framesize = get_bits_long(&gb, 24); + + s->samplerate = get_bits_long(&gb, 20); + s->channels = get_bits(&gb, 3) + 1; + s->bps = get_bits(&gb, 5) + 1; + + avctx->channels = s->channels; + avctx->sample_rate = s->samplerate; + avctx->bits_per_raw_sample = s->bps; + + s->samples = get_bits_long(&gb, 32) << 4; + s->samples |= get_bits(&gb, 4); + + skip_bits_long(&gb, 64); /* md5 sum */ + skip_bits_long(&gb, 64); /* md5 sum */ +} + +void avpriv_flac_parse_block_header(const uint8_t *block_header, + int *last, int *type, int *size) +{ + int tmp = bytestream_get_byte(&block_header); + if (last) + *last = tmp & 0x80; + if (type) + *type = tmp & 0x7F; + if (size) + *size = bytestream_get_be24(&block_header); +} diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 89819e31fb..53070a348c 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -75,33 +75,6 @@ static const int64_t flac_channel_layouts[6] = { static void allocate_buffers(FLACContext *s); -int avpriv_flac_is_extradata_valid(AVCodecContext *avctx, - enum FLACExtradataFormat *format, - uint8_t **streaminfo_start) -{ - if (!avctx->extradata || avctx->extradata_size < FLAC_STREAMINFO_SIZE) { - av_log(avctx, AV_LOG_ERROR, "extradata NULL or too small.\n"); - return 0; - } - if (AV_RL32(avctx->extradata) != MKTAG('f','L','a','C')) { - /* extradata contains STREAMINFO only */ - if (avctx->extradata_size != FLAC_STREAMINFO_SIZE) { - av_log(avctx, AV_LOG_WARNING, "extradata contains %d bytes too many.\n", - FLAC_STREAMINFO_SIZE-avctx->extradata_size); - } - *format = FLAC_EXTRADATA_FORMAT_STREAMINFO; - *streaminfo_start = avctx->extradata; - } else { - if (avctx->extradata_size < 8+FLAC_STREAMINFO_SIZE) { - av_log(avctx, AV_LOG_ERROR, "extradata too small.\n"); - return 0; - } - *format = FLAC_EXTRADATA_FORMAT_FULL_HEADER; - *streaminfo_start = &avctx->extradata[8]; - } - return 1; -} - static void flac_set_bps(FLACContext *s) { enum AVSampleFormat req = s->avctx->request_sample_fmt; @@ -175,52 +148,6 @@ static void allocate_buffers(FLACContext *s) } } -void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, - const uint8_t *buffer) -{ - GetBitContext gb; - init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8); - - skip_bits(&gb, 16); /* skip min blocksize */ - s->max_blocksize = get_bits(&gb, 16); - if (s->max_blocksize < FLAC_MIN_BLOCKSIZE) { - av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\n", - s->max_blocksize); - s->max_blocksize = 16; - } - - skip_bits(&gb, 24); /* skip min frame size */ - s->max_framesize = get_bits_long(&gb, 24); - - s->samplerate = get_bits_long(&gb, 20); - s->channels = get_bits(&gb, 3) + 1; - s->bps = get_bits(&gb, 5) + 1; - - avctx->channels = s->channels; - avctx->sample_rate = s->samplerate; - avctx->bits_per_raw_sample = s->bps; - - s->samples = get_bits_long(&gb, 32) << 4; - s->samples |= get_bits(&gb, 4); - - skip_bits_long(&gb, 64); /* md5 sum */ - skip_bits_long(&gb, 64); /* md5 sum */ - - dump_headers(avctx, s); -} - -void avpriv_flac_parse_block_header(const uint8_t *block_header, - int *last, int *type, int *size) -{ - int tmp = bytestream_get_byte(&block_header); - if (last) - *last = tmp & 0x80; - if (type) - *type = tmp & 0x7F; - if (size) - *size = bytestream_get_be24(&block_header); -} - /** * Parse the STREAMINFO from an inline header. * @param s the flac decoding context From b896008271cc8b8af2b7c57aa8c0efa5a4cf9168 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 10 Jul 2012 18:42:34 +0200 Subject: [PATCH 09/10] build: Fix FLAC demuxer dependencies --- libavcodec/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index ee4ac7532c..53412d0100 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -566,7 +566,8 @@ OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \ ac3tab.o OBJS-$(CONFIG_DV_DEMUXER) += dv_profile.o OBJS-$(CONFIG_DV_MUXER) += dv_profile.o -OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o +OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o \ + vorbis_parser.o xiph.o OBJS-$(CONFIG_FLAC_MUXER) += flac.o flacdata.o OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o From 0da29727eadcc4e1f1ed661d1db4caed6ceb17c9 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 10 Jul 2012 18:42:56 +0200 Subject: [PATCH 10/10] build: Fix Ogg demuxer dependencies --- libavcodec/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 53412d0100..28e62f6f55 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -586,8 +586,9 @@ OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_MPEGTS_MUXER) += mpegvideo.o mpeg4audio.o OBJS-$(CONFIG_MPEGTS_DEMUXER) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o -OBJS-$(CONFIG_OGG_DEMUXER) += flac.o flacdata.o dirac.o \ - mpeg12data.o vorbis_parser.o +OBJS-$(CONFIG_OGG_DEMUXER) += xiph.o flac.o flacdata.o \ + mpeg12data.o vorbis_parser.o \ + dirac.o OBJS-$(CONFIG_OGG_MUXER) += xiph.o flac.o flacdata.o OBJS-$(CONFIG_RTP_MUXER) += mpeg4audio.o mpegvideo.o xiph.o OBJS-$(CONFIG_SPDIF_DEMUXER) += aacadtsdec.o mpeg4audio.o