From f91893ab1b9187d71a1c9709f8b7fc2ad8047ddf Mon Sep 17 00:00:00 2001 From: piratfm Date: Tue, 16 Apr 2013 18:26:06 +0300 Subject: less noise --- README.md | 5 +- aac-enc-dabplus.c | 4 ++ bootstrap | 123 +++++++++++++++++++++++++++++++++++++++++ libAACenc/src/aacenc.cpp | 2 +- libAACenc/src/bitenc.cpp | 2 +- libMpegTPEnc/src/tpenc_dab.cpp | 7 ++- 6 files changed, 135 insertions(+), 8 deletions(-) create mode 100755 bootstrap diff --git a/README.md b/README.md index d5bb047..6d61fa2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ fdk-aac-dabplus A standalone library of the Fraunhofer FDK AAC code from Android. -This is 960-frames version of codec. Used for DAB+/DRM boradcast encoding. +This is 960-frames version of codec. Used for DAB+ boradcast encoding. Usage: @@ -17,5 +17,4 @@ aac-enc-dabplus [OPTION...] -f, --format={ wav, raw } Set input file format (default: wav). -c, --channels={ 1, 2 } Nb of input channels for raw input (default: 2). -r, --rate={ 32000, 48000 } Sample rate for raw input (default: 48000). - -t, --adts Set ADTS output format (for debugging). - -l, --lp Set frame size to 1024 instead of 960. + diff --git a/aac-enc-dabplus.c b/aac-enc-dabplus.c index 977077a..29e40a8 100644 --- a/aac-enc-dabplus.c +++ b/aac-enc-dabplus.c @@ -250,6 +250,10 @@ int main(int argc, char *argv[]) { fprintf(stderr, "Unable to set the wav channel order\n"); return 1; } + if (aacEncoder_SetParam(handle, AACENC_GRANULE_LENGTH, 960) != AACENC_OK) { + fprintf(stderr, "Unable to set the AOT\n"); + return 1; + } if (aacEncoder_SetParam(handle, AACENC_TRANSMUX, TT_DABPLUS) != AACENC_OK) { fprintf(stderr, "Unable to set the RAW transmux\n"); return 1; diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..79de673 --- /dev/null +++ b/bootstrap @@ -0,0 +1,123 @@ +#! /bin/sh + +# bootstrap: the ultimate bootstrap/autogen.sh script for autotools projects +# Copyright (c) 2002, 2003, 2004, 2005, 2006 Sam Hocevar +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the Do What The Fuck You Want To +# Public License, Version 2, as published by Sam Hocevar. See +# http://sam.zoy.org/wtfpl/COPYING for more details. +# +# The latest version of this script can be found at the following place: +# http://sam.zoy.org/autotools/ + +# Die if an error occurs +set -e + +# Guess whether we are using configure.ac or configure.in +if test -f configure.ac; then + conffile="configure.ac" +elif test -f configure.in; then + conffile="configure.in" +else + echo "$0: could not find configure.ac or configure.in" + exit 1 +fi + +# Check for needed features +auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^ )]*\).*/\1/p' $conffile`" +libtool="`grep -q '^[ \t]*A._PROG_LIBTOOL' $conffile && echo yes || echo no`" +header="`grep -q '^[ \t]*A._CONFIG_HEADER' $conffile && echo yes || echo no`" +aclocalflags="`sed -ne 's/^[ \t]*ACLOCAL_AMFLAGS[ \t]*=//p' Makefile.am`" + +# Check for automake +amvers="no" +for v in "-1.11" "111" "-1.10" "110" "-1.9" "19" "-1.8" "18" "-1.7" "17" "-1.6" "16" "-1.5" "15"; do + if automake${v} --version >/dev/null 2>&1; then + amvers="${v}" + break + fi +done + +if test "${amvers}" = "no" && automake --version > /dev/null 2>&1; then + amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`" + if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then + amvers="no" + else + amvers="" + fi +fi + +if test "$amvers" = "no"; then + echo "$0: you need automake version 1.5 or later" + exit 1 +fi + +# Check for autoconf +acvers="no" +for v in "" "259" "253"; do + if autoconf${v} --version >/dev/null 2>&1; then + acvers="${v}" + break + fi +done + +if test "$acvers" = "no"; then + echo "$0: you need autoconf" + exit 1 +fi + +# Check for libtool +if test "$libtool" = "yes"; then + libtoolize="no" + if glibtoolize --version >/dev/null 2>&1; then + libtoolize="glibtoolize" + else + for v in "16" "15" "" "14"; do + if libtoolize${v} --version >/dev/null 2>&1; then + libtoolize="libtoolize${v}" + break + fi + done + fi + + if test "$libtoolize" = "no"; then + echo "$0: you need libtool" + exit 1 + fi +fi + +# Remove old cruft +for x in aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh; do rm -f $x autotools/$x; if test -n "$auxdir"; then rm -f "$auxdir/$x"; fi; done +rm -Rf autom4te.cache +if test -n "$auxdir"; then + if test ! -d "$auxdir"; then + mkdir "$auxdir" + fi + aclocalflags="${aclocalflags} -I $auxdir" +fi + +# Explain what we are doing from now +set -x + +# Bootstrap package +if test "$libtool" = "yes"; then + ${libtoolize} --copy --force + if test -n "$auxdir" -a ! "$auxdir" = "." -a -f "ltmain.sh"; then + echo "$0: working around a minor libtool issue" + mv ltmain.sh "$auxdir/" + fi +fi + +aclocal${amvers} ${aclocalflags} +autoconf${acvers} +if test "$header" = "yes"; then + autoheader${acvers} +fi +#add --include-deps if you want to bootstrap with any other compiler than gcc +#automake${amvers} --add-missing --copy --include-deps +automake${amvers} --foreign --add-missing --copy + +# Remove cruft that we no longer want +rm -Rf autom4te.cache + diff --git a/libAACenc/src/aacenc.cpp b/libAACenc/src/aacenc.cpp index 89a8830..16e28a2 100644 --- a/libAACenc/src/aacenc.cpp +++ b/libAACenc/src/aacenc.cpp @@ -973,7 +973,7 @@ AAC_ENCODER_ERROR FDKaacEnc_EncodeFrame( HANDLE_AAC_ENC hAacEnc, /*-------------------------------------------- */ /* for ( all sub frames ) ... */ - fprintf(stderr, "totalBits=%d, qcOut->totalBits=%d, qcOut->totFillBits=%d\n", totalBits, qcOut->totalBits, qcOut->totFillBits); + //fprintf(stderr, "totalBits=%d, qcOut->totalBits=%d, qcOut->totFillBits=%d\n", totalBits, qcOut->totalBits, qcOut->totFillBits); /* write bitstream header */ transportEnc_WriteAccessUnit( hTpEnc, diff --git a/libAACenc/src/bitenc.cpp b/libAACenc/src/bitenc.cpp index 3b969de..cd68398 100644 --- a/libAACenc/src/bitenc.cpp +++ b/libAACenc/src/bitenc.cpp @@ -1479,7 +1479,7 @@ AAC_ENCODER_ERROR FDKaacEnc_WriteBitstream(HANDLE_TRANSPORTENC hTpEnc, return AAC_ENC_WRITTEN_BITS_ERROR; } - fprintf(stderr, "ErrorStatus=%d", ErrorStatus); + //fprintf(stderr, "ErrorStatus=%d", ErrorStatus); return ErrorStatus; } diff --git a/libMpegTPEnc/src/tpenc_dab.cpp b/libMpegTPEnc/src/tpenc_dab.cpp index afdac78..cad5da5 100644 --- a/libMpegTPEnc/src/tpenc_dab.cpp +++ b/libMpegTPEnc/src/tpenc_dab.cpp @@ -379,7 +379,7 @@ void dabWrite_EndRawDataBlock(HANDLE_DAB hDab, writeBitsLastBlock = offset_end - FDKgetValidBits(hBs); dabWrite_FillRawDataBlock(hBs, writeBitsLastBlock); FDKsyncCache(hBs); - fprintf(stderr, "FIL-element written=%d\n", writeBitsLastBlock); + //fprintf(stderr, "FIL-element written=%d\n", writeBitsLastBlock); writeBitsLastBlock=writeBits; } #endif @@ -397,7 +397,8 @@ void dabWrite_EndRawDataBlock(HANDLE_DAB hDab, writeBits=writeBitsLastBlock; INT frameLen = (FDKgetValidBits(hBs) - hDab->subFrameStartBit) >> 3; - fprintf(stderr, "frame=%d, offset writeBits=%d\n", frameLen, writeBits); + //fprintf(stderr, "frame=%d, offset writeBits=%d\n", frameLen, writeBits); + FDK_ASSERT(FDKgetValidBits(hBs) % 8 == 0); //only aligned au's FDK_ASSERT(hDab->subchannels_num*110*8 >= FDKgetValidBits(hBs)+2*8); //don't overlap superframe @@ -405,7 +406,7 @@ void dabWrite_EndRawDataBlock(HANDLE_DAB hDab, FDKpushFor(&bsWriter, hDab->subFrameStartBit); FDKcrcReset(&hDab->crcInfo); hDab->crcIndex = FDKcrcStartReg(&hDab->crcInfo, &bsWriter, 0); -#if 1 +#if 0 if (hDab->currentBlock == hDab->num_raw_blocks) { INT offset_size = hDab->subchannels_num*110*8 - 2*8 - FDKgetValidBits(hBs); //fprintf(stderr, "offset_size=%d\n", offset_size >> 3); -- cgit v1.2.3