diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2019-05-15 01:14:42 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2019-05-15 01:14:42 +0300 |
commit | ed9629395ce9696164c1d617d573a47982e82169 (patch) | |
tree | 5dbe92165b9fa3750740331b7af165d0aaab88c3 /src/atrac | |
parent | 218e2163453deac6f7a74765a21258b5c566a8cc (diff) | |
download | atracdenc-ed9629395ce9696164c1d617d573a47982e82169.tar.gz |
Support for MS Windows platform
- VS build (2017 tested)
- Media Foundation Framework support to read/write pcm data (instead of
libsndfile)
Diffstat (limited to 'src/atrac')
-rw-r--r-- | src/atrac/atrac1.cpp | 2 | ||||
-rw-r--r-- | src/atrac/atrac1.h | 3 | ||||
-rw-r--r-- | src/atrac/atrac1_bitalloc.cpp | 9 | ||||
-rw-r--r-- | src/atrac/atrac1_bitalloc.h | 10 | ||||
-rw-r--r-- | src/atrac/atrac1_dequantiser.cpp | 2 | ||||
-rw-r--r-- | src/atrac/atrac1_dequantiser.h | 2 | ||||
-rw-r--r-- | src/atrac/atrac1_qmf.h | 2 | ||||
-rw-r--r-- | src/atrac/atrac3.cpp | 2 | ||||
-rw-r--r-- | src/atrac/atrac3.h | 3 | ||||
-rw-r--r-- | src/atrac/atrac3_bitstream.cpp | 6 | ||||
-rw-r--r-- | src/atrac/atrac3_bitstream.h | 6 | ||||
-rw-r--r-- | src/atrac/atrac3_qmf.h | 2 | ||||
-rw-r--r-- | src/atrac/atrac_psy_common.cpp | 2 | ||||
-rw-r--r-- | src/atrac/atrac_psy_common.h | 2 | ||||
-rw-r--r-- | src/atrac/atrac_scale.cpp | 2 | ||||
-rw-r--r-- | src/atrac/atrac_scale.h | 2 |
16 files changed, 31 insertions, 26 deletions
diff --git a/src/atrac/atrac1.cpp b/src/atrac/atrac1.cpp index b96fa30..f7e6c61 100644 --- a/src/atrac/atrac1.cpp +++ b/src/atrac/atrac1.cpp @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac1.h b/src/atrac/atrac1.h index 460c86d..45d1bdf 100644 --- a/src/atrac/atrac1.h +++ b/src/atrac/atrac1.h @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -22,6 +22,7 @@ #include <map> #include <math.h> #include "../bitstream/bitstream.h" +#include "../config.h" namespace NAtracDEnc { namespace NAtrac1 { diff --git a/src/atrac/atrac1_bitalloc.cpp b/src/atrac/atrac1_bitalloc.cpp index 1a7b155..ae6ad2f 100644 --- a/src/atrac/atrac1_bitalloc.cpp +++ b/src/atrac/atrac1_bitalloc.cpp @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -23,6 +23,7 @@ #include <math.h> #include <cassert> #include "../bitstream/bitstream.h" +#include "../env.h" namespace NAtracDEnc { namespace NAtrac1 { @@ -217,6 +218,12 @@ uint32_t TAtrac1SimpleBitAlloc::Write(const std::vector<TScaledBlock>& scaledBlo return BfuAmountTab[bfuIdx]; } +TAtrac1BitStreamWriter::TAtrac1BitStreamWriter(TAea* container) + : Container(container) +{ + NEnv::SetRoundFloat(); +}; + void TAtrac1BitStreamWriter::WriteBitStream(const vector<uint32_t>& bitsPerEachBlock, const std::vector<TScaledBlock>& scaledBlocks, uint32_t bfuAmountIdx, diff --git a/src/atrac/atrac1_bitalloc.h b/src/atrac/atrac1_bitalloc.h index 695defc..2478ddb 100644 --- a/src/atrac/atrac1_bitalloc.h +++ b/src/atrac/atrac1_bitalloc.h @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -24,7 +24,6 @@ #include <vector> #include <map> #include <cstdint> -#include <cfenv> namespace NAtracDEnc { namespace NAtrac1 { @@ -50,11 +49,8 @@ public: class TAtrac1BitStreamWriter : public virtual TAtrac1Data { TAea* Container; public: - explicit TAtrac1BitStreamWriter(TAea* container) - : Container(container) - { - fesetround(FE_TONEAREST); - }; + explicit TAtrac1BitStreamWriter(TAea* container); + void WriteBitStream(const std::vector<uint32_t>& bitsPerEachBlock, const std::vector<TScaledBlock>& scaledBlocks, uint32_t bfuAmountIdx, const TBlockSize& blockSize); }; diff --git a/src/atrac/atrac1_dequantiser.cpp b/src/atrac/atrac1_dequantiser.cpp index 9cc0666..a259f42 100644 --- a/src/atrac/atrac1_dequantiser.cpp +++ b/src/atrac/atrac1_dequantiser.cpp @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac1_dequantiser.h b/src/atrac/atrac1_dequantiser.h index 80e1e9c..d3c25bd 100644 --- a/src/atrac/atrac1_dequantiser.h +++ b/src/atrac/atrac1_dequantiser.h @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac1_qmf.h b/src/atrac/atrac1_qmf.h index efcf2c1..8b3e5e4 100644 --- a/src/atrac/atrac1_qmf.h +++ b/src/atrac/atrac1_qmf.h @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac3.cpp b/src/atrac/atrac3.cpp index 8236a92..82fb34b 100644 --- a/src/atrac/atrac3.cpp +++ b/src/atrac/atrac3.cpp @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac3.h b/src/atrac/atrac3.h index b6594e5..eb97808 100644 --- a/src/atrac/atrac3.h +++ b/src/atrac/atrac3.h @@ -12,11 +12,12 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once +#include "../config.h" #include <math.h> #include <cstdint> #include <vector> diff --git a/src/atrac/atrac3_bitstream.cpp b/src/atrac/atrac3_bitstream.cpp index 8a391db..d39faa2 100644 --- a/src/atrac/atrac3_bitstream.cpp +++ b/src/atrac/atrac3_bitstream.cpp @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -196,7 +196,7 @@ void TAtrac3BitStreamWriter::EncodeSpecs(const TSingleChannelElement& sce, NBitS int mt[MaxSpecs]; const vector<TScaledBlock>& scaledBlocks = sce.ScaledBlocks; - auto allocation = CreateAllocation(sce, bitsUsed, mt); + const auto& allocation = CreateAllocation(sce, bitsUsed, mt); const vector<uint32_t>& precisionPerEachBlocks = allocation.second; EncodeTonalComponents(sce, precisionPerEachBlocks, bitStream); const uint32_t numBlocks = precisionPerEachBlocks.size(); //number of blocks to save @@ -471,7 +471,7 @@ void TAtrac3BitStreamWriter::WriteSoundUnit(const vector<TSingleChannelElement>& assert(s < 8); } } - const uint16_t bitsUsedByGainInfoAndHeader = bitStream->GetSizeInBits(); + const uint16_t bitsUsedByGainInfoAndHeader = (uint16_t)bitStream->GetSizeInBits(); usedBits[channel] = bitsUsedByGainInfoAndHeader; assert(bitStream->GetSizeInBits() == usedBits[channel]); } diff --git a/src/atrac/atrac3_bitstream.h b/src/atrac/atrac3_bitstream.h index b65e212..24c2ca7 100644 --- a/src/atrac/atrac3_bitstream.h +++ b/src/atrac/atrac3_bitstream.h @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -25,7 +25,7 @@ #include "atrac_scale.h" #include <vector> #include <utility> -#include <cfenv> +#include "../env.h" namespace NAtracDEnc { namespace NAtrac3 { @@ -89,7 +89,7 @@ public: , Params(params) , BfuIdxConst(bfuIdxConst) { - fesetround(FE_TONEAREST); + NEnv::SetRoundFloat(); } void WriteSoundUnit(const std::vector<TSingleChannelElement>& singleChannelElements); diff --git a/src/atrac/atrac3_qmf.h b/src/atrac/atrac3_qmf.h index 49f9dcd..6f26d54 100644 --- a/src/atrac/atrac3_qmf.h +++ b/src/atrac/atrac3_qmf.h @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac_psy_common.cpp b/src/atrac/atrac_psy_common.cpp index 8ff86a1..257b8f3 100644 --- a/src/atrac/atrac_psy_common.cpp +++ b/src/atrac/atrac_psy_common.cpp @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac_psy_common.h b/src/atrac/atrac_psy_common.h index 45a0706..dc1e65e 100644 --- a/src/atrac/atrac_psy_common.h +++ b/src/atrac/atrac_psy_common.h @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac_scale.cpp b/src/atrac/atrac_scale.cpp index a8a6fda..f24f7b0 100644 --- a/src/atrac/atrac_scale.cpp +++ b/src/atrac/atrac_scale.cpp @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/atrac/atrac_scale.h b/src/atrac/atrac_scale.h index c992c03..eadb6bd 100644 --- a/src/atrac/atrac_scale.h +++ b/src/atrac/atrac_scale.h @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with AtracDEnc; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ |