From 789bdc3270fa537914eacc77208a194c9eed2e53 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 3 Nov 2014 16:47:28 +0100 Subject: Enable afterburner by default and deprecate -a --- README.md | 8 ++++---- src/dabplus-enc.cpp | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f2267e0..cd5f67d 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ This illustrates the fifo input over standard input of *dabplus-enc*. sox -t alsa $ALSASRC -b 16 -t raw - rate 32k channels 2 | \ dabplus-enc -r 32000 -l \ - -i - -b $BITRATE -f raw -a -o $DST -p 53 + -i - -b $BITRATE -f raw -o $DST -p 53 The -p 53 sets the padlen, compatible with the default mot-encoder setting. mot-encoder needs to be given the same value for this option. @@ -142,7 +142,7 @@ Live Stream encoding and preparing for DAB muxer, with FIFO to odr-dabmux, 48kHz arecord. arecord -t raw -f S16_LE -c 2 -r 48000 -D plughw:CARD=Loopback,DEV=0,SUBDEV=0 | \ - dabplus-enc -l -a -b $BITRATE -f raw -c 2 -r 48000 -i /dev/stdin -o - | \ + dabplus-enc -l -b $BITRATE -f raw -c 2 -r 48000 -i /dev/stdin -o - | \ mbuffer -q -m 10k -P 100 -s 360 > station1.fifo Here we are using the ALSA plughw feature. @@ -163,14 +163,14 @@ Scenario 6 ---------- Wave file encoding, for non-realtime processing - dabplus-enc -a -b $BITRATE -i wave_file.wav -o station1.dabp + dabplus-enc -b $BITRATE -i wave_file.wav -o station1.dabp Scenario 7 ---------- JACK input: Instead of -i (file input) or -d (ALSA input), use -j *name*, where *name* specifies the JACK name for the encoder: - dabplus-enc -j myenc -l -b $BITRATE -f raw -a -o $DST + dabplus-enc -j myenc -l -b $BITRATE -f raw -o $DST The samplerate of the JACK server should be 32kHz or 48kHz. diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp index 79824c8..a28d6b2 100644 --- a/src/dabplus-enc.cpp +++ b/src/dabplus-enc.cpp @@ -98,7 +98,7 @@ void usage(const char* name) { #endif " Encoder parameters:\n" " -b, --bitrate={ 8, 16, ..., 192 } Output bitrate in kbps. Must be a multiple of 8.\n" - " -a, --afterburner Turn on AAC encoder quality increaser.\n" + " -A, --no-afterburner Disable AAC encoder quality increaser.\n" " -c, --channels={ 1, 2 } Nb of input channels (default: 2).\n" " -r, --rate={ 32000, 48000 } Input sample rate (default: 48000).\n" " --aaclc Force the usage of AAC-LC (no SBR, no PS)\n" @@ -209,6 +209,9 @@ int prepare_aac_encoder( fprintf(stderr, "Unable to set the afterburner mode\n"); return 1; } + if (!afterburner) { + fprintf(stderr, "Warning: Afterburned disabled!\n"); + } if (aacEncEncode(handle, NULL, NULL, NULL, NULL) != AACENC_OK) { fprintf(stderr, "Unable to initialize the encoder\n"); return 1; @@ -245,7 +248,7 @@ int main(int argc, char *argv[]) int sample_rate=48000, channels=2; const int bytes_per_sample = 2; void *rs_handler = NULL; - bool afterburner = false; + bool afterburner = true; bool inFifoSilence = false; bool drift_compensation = false; AACENC_InfoStruct info = { 0 }; @@ -291,6 +294,7 @@ int main(int argc, char *argv[]) {"rate", required_argument, 0, 'r'}, {"silence", required_argument, 0, 's'}, {"secret-key", required_argument, 0, 'k'}, + {"no-afterburner",no_argument, 0, 'A'}, {"afterburner", no_argument, 0, 'a'}, {"drift-comp", no_argument, 0, 'D'}, {"help", no_argument, 0, 'h'}, @@ -309,7 +313,7 @@ int main(int argc, char *argv[]) int index; while(ch != -1) { - ch = getopt_long(argc, argv, "ahDlb:c:f:i:j:k:o:r:d:p:P:s:", longopts, &index); + ch = getopt_long(argc, argv, "aAhDlb:c:f:i:j:k:o:r:d:p:P:s:", longopts, &index); switch (ch) { case 0: // AAC-LC aot = AOT_DABPLUS_AAC_LC; @@ -324,7 +328,10 @@ int main(int argc, char *argv[]) inFifoSilence = true; break; case 'a': - afterburner = true; + fprintf(stderr, "Warning, -a option does not exist anymore!\n"); + break; + case 'A': + afterburner = false; break; case 'b': subchannel_index = atoi(optarg) / 8; -- cgit v1.2.3