diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2015-12-08 01:55:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2015-12-08 01:55:41 +0300 |
commit | 8b704f5ce2d0666b5b6dc3fb6881b1e6b2dff1bd (patch) | |
tree | 359d9493c51d28d6ef8de880c6befe324fb9682b /src/main.cpp | |
parent | ac9a328f40be52aec6665d021d1a42a0d5258d7b (diff) | |
download | atracdenc-8b704f5ce2d0666b5b6dc3fb6881b1e6b2dff1bd.tar.gz |
support of short window for encoding (without transient detection)
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 546ee83..4ef6118 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,7 +41,8 @@ static string GetHelp() { "\n -i input file" "\n -o output file" "\nAdvanced options:\n --bfuidxconst\t Set constant amount of used BFU. WARNING: It is not a lowpass filter! Do not use it to cut off hi frequency." - "\n --bfuidxfast\t enable fast search of BFU amount"; + "\n --bfuidxfast\t enable fast search of BFU amount" + "\n --shortonly[=mask] use short window (32 sample) for all blocks. Mask (specifyed without space) is used to set this option only for given band"; } int main(int argc, char* const* argv) { @@ -52,6 +53,7 @@ int main(int argc, char* const* argv) { { "help", no_argument, NULL, 'h' }, { "bfuidxconst", required_argument, NULL, 1}, { "bfuidxfast", no_argument, NULL, 2}, + { "shortonly", optional_argument, NULL, 3}, { "mono", no_argument, NULL, 'm'}, { NULL, 0, NULL, 0} }; @@ -63,6 +65,8 @@ int main(int argc, char* const* argv) { uint32_t bfuIdxConst = 0; //0 - auto, no const bool fastBfuNumSearch = false; bool mono = false; + TAtrac1EncodeSettings::EWindowMode windowMode = TAtrac1EncodeSettings::EWindowMode::EWM_LONG_ONLY; + uint32_t winMask = 7; while ((ch = getopt_long(argc, argv, "edhi:o:m", longopts, NULL)) != -1) { switch (ch) { case 'e': @@ -99,7 +103,16 @@ int main(int argc, char* const* argv) { case 2: fastBfuNumSearch = true; break; - + case 3: + windowMode = TAtrac1EncodeSettings::EWindowMode::EWM_SHORT_ONLY; + if (optarg) { + winMask = stoi(optarg); + } + cout << "Explicit short window mode specified, bands: low - " << + ((winMask & 1) ? "short": "long") << ", mid - " << + ((winMask & 2) ? "short": "long") << ", hi - " << + ((winMask & 4) ? "short": "long") << endl; + break; default: printUsage(myName); } @@ -146,7 +159,8 @@ int main(int argc, char* const* argv) { } TAtrac1Processor atrac1Processor(move(aeaIO), mono); - auto atracLambda = (mode == E_DECODE) ? atrac1Processor.GetDecodeLambda() : atrac1Processor.GetEncodeLambda(TAtrac1EncodeSettings(bfuIdxConst, fastBfuNumSearch, TAtrac1EncodeSettings::EWindowMode::EWM_LONG_ONLY)); + auto atracLambda = (mode == E_DECODE) ? atrac1Processor.GetDecodeLambda() : + atrac1Processor.GetEncodeLambda(TAtrac1EncodeSettings(bfuIdxConst, fastBfuNumSearch, windowMode, winMask)); uint64_t processed = 0; try { while (totalSamples/4 > (processed = pcmEngine->ApplyProcess(512, atracLambda))) |