-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fall back to HE/ELD-SBR when trying to encode non-stereo material in …
…HEv2 or ELDv2.
- Loading branch information
Showing
5 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* BoCA - BonkEnc Component Architecture | ||
* Copyright (C) 2007-2022 Robert Kausch <[email protected]> | ||
* Copyright (C) 2007-2024 Robert Kausch <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
|
@@ -159,6 +159,11 @@ Bool BoCA::EncoderCoreAudio::Activate() | |
Int kbps = config->GetIntValue(ConfigureCoreAudio::ConfigID, "Bitrate", 64); | ||
Bool mp4Container = config->GetIntValue(ConfigureCoreAudio::ConfigID, "MP4Container", True); | ||
|
||
/* Fall back to HE/ELD-SBR if HEv2/ELDv2 is selected for non-stereo input. | ||
*/ | ||
if (codec == CA::kAudioFormatMPEG4AAC_HE_V2 && format.channels != 2) codec = CA::kAudioFormatMPEG4AAC_HE; | ||
if (codec == CA::kOptionalAudioFormatMPEG4AAC_ELD_V2 && format.channels != 2) codec = CA::kOptionalAudioFormatMPEG4AAC_ELD_SBR; | ||
|
||
/* Fill out source format description. | ||
*/ | ||
CA::AudioStreamBasicDescription sourceFormat = { 0 }; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* BoCA - BonkEnc Component Architecture | ||
* Copyright (C) 2007-2021 Robert Kausch <[email protected]> | ||
* Copyright (C) 2007-2024 Robert Kausch <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
|
@@ -38,6 +38,11 @@ BoCA::SuperWorker::SuperWorker(const Config *config, const Format &iFormat) : pr | |
CA::UInt32 codec = config->GetIntValue(ConfigureCoreAudio::ConfigID, "Codec", CA::kAudioFormatMPEG4AAC); | ||
Int kbps = config->GetIntValue(ConfigureCoreAudio::ConfigID, "Bitrate", 64); | ||
|
||
/* Fall back to HE/ELD-SBR if HEv2/ELDv2 is selected for non-stereo input. | ||
*/ | ||
if (codec == CA::kAudioFormatMPEG4AAC_HE_V2 && format.channels != 2) codec = CA::kAudioFormatMPEG4AAC_HE; | ||
if (codec == CA::kOptionalAudioFormatMPEG4AAC_ELD_V2 && format.channels != 2) codec = CA::kOptionalAudioFormatMPEG4AAC_ELD_SBR; | ||
|
||
/* Fill out source format description. | ||
*/ | ||
CA::AudioStreamBasicDescription sourceFormat = { 0 }; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* BoCA - BonkEnc Component Architecture | ||
* Copyright (C) 2007-2022 Robert Kausch <[email protected]> | ||
* Copyright (C) 2007-2024 Robert Kausch <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
|
@@ -171,6 +171,11 @@ Bool BoCA::EncoderCoreAudioConnect::Activate() | |
Int kbps = config->GetIntValue(ConfigureCoreAudio::ConfigID, "Bitrate", 64); | ||
Bool mp4Container = config->GetIntValue(ConfigureCoreAudio::ConfigID, "MP4Container", True); | ||
|
||
/* Fall back to HE/ELD-SBR if HEv2/ELDv2 is selected for non-stereo input. | ||
*/ | ||
if (codec == CA::kAudioFormatMPEG4AAC_HE_V2 && format.channels != 2) codec = CA::kAudioFormatMPEG4AAC_HE; | ||
if (codec == CA::kAudioFormatMPEG4AAC_ELD_V2 && format.channels != 2) codec = CA::kAudioFormatMPEG4AAC_ELD_SBR; | ||
|
||
/* Get file type of output file. | ||
*/ | ||
fileType = mp4Container ? CA::kAudioFileM4AType : CA::kAudioFileAAC_ADTSType; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* BoCA - BonkEnc Component Architecture | ||
* Copyright (C) 2007-2021 Robert Kausch <[email protected]> | ||
* Copyright (C) 2007-2024 Robert Kausch <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
|
@@ -36,6 +36,10 @@ BoCA::SuperWorker::SuperWorker(const Config *config, const Format &iFormat) : pr | |
Int quality = config->GetIntValue(ConfigureFDKAAC::ConfigID, "Quality", 4); | ||
Int bandwidth = config->GetIntValue(ConfigureFDKAAC::ConfigID, "Bandwidth", 0); | ||
|
||
/* Fall back to HE if HEv2 is selected for non-stereo input. | ||
*/ | ||
if (aacType == AOT_PS && format.channels != 2) aacType = AOT_SBR; | ||
|
||
/* Create and configure FDK AAC encoder. | ||
*/ | ||
ex_aacEncOpen(&handle, 0x07, format.channels); | ||
|