allow DLL export

This commit is contained in:
Christian R. Helmrich 2020-01-24 21:00:38 +01:00
parent 4aa2845972
commit ea83d1b439
6 changed files with 172 additions and 21 deletions

View File

@ -11,8 +11,8 @@ exhale currently makes use of all frequency-domain (FD) coding tools
in the scalefactor based MDCT processing path, except for predictive
joint stereo, which is still being integrated. Its objective is high
quality mono, stereo, and multichannel coding at medium and high bit
rates, so the parametric USAC coding tools (ACELP, TCX, Enhanced SBR
and MPEG Surround with Unified Stereo coding) won't be integrated.
rates, so the lower-rate USAC coding tools (ACELP, TCX, Enhanced SBR
and MPEG Surround with Unified Stereo coding) won't be integrated.
____________________________________________________________________
@ -114,6 +114,6 @@ select `Custom` under "Encoder" and enter the following information:
Development
-----------
If you're interested in contributing to exhale, please contact one of
If you are interested in contributing to exhale, please email one of
the developers. Merge requests with fixes and/or speedups are highly
appreciated.

View File

@ -1,4 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 11.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{EC0D1500-2018-1700-4865-6C6D72696368}") = "exhaleLib", "src\lib\exhaleLib_vs2012.vcxproj", "{EC0D1501-2018-1700-4865-6C6D72696368}"
EndProject
@ -13,6 +13,8 @@ Global
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release DLL|Win32 = Release DLL|Win32
Release DLL|x64 = Release DLL|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EC0D1501-2018-1700-4865-6C6D72696368}.Debug|Win32.ActiveCfg = Debug|Win32
@ -23,6 +25,10 @@ Global
{EC0D1501-2018-1700-4865-6C6D72696368}.Release|Win32.Build.0 = Release|Win32
{EC0D1501-2018-1700-4865-6C6D72696368}.Release|x64.ActiveCfg = Release|x64
{EC0D1501-2018-1700-4865-6C6D72696368}.Release|x64.Build.0 = Release|x64
{EC0D1501-2018-1700-4865-6C6D72696368}.Release DLL|Win32.ActiveCfg = Release DLL|Win32
{EC0D1501-2018-1700-4865-6C6D72696368}.Release DLL|Win32.Build.0 = Release DLL|Win32
{EC0D1501-2018-1700-4865-6C6D72696368}.Release DLL|x64.ActiveCfg = Release DLL|x64
{EC0D1501-2018-1700-4865-6C6D72696368}.Release DLL|x64.Build.0 = Release DLL|x64
{EC0D1502-2018-1700-4865-6C6D72696368}.Debug|Win32.ActiveCfg = Debug|Win32
{EC0D1502-2018-1700-4865-6C6D72696368}.Debug|Win32.Build.0 = Debug|Win32
{EC0D1502-2018-1700-4865-6C6D72696368}.Debug|x64.ActiveCfg = Debug|x64
@ -31,6 +37,10 @@ Global
{EC0D1502-2018-1700-4865-6C6D72696368}.Release|Win32.Build.0 = Release|Win32
{EC0D1502-2018-1700-4865-6C6D72696368}.Release|x64.ActiveCfg = Release|x64
{EC0D1502-2018-1700-4865-6C6D72696368}.Release|x64.Build.0 = Release|x64
{EC0D1502-2018-1700-4865-6C6D72696368}.Release DLL|Win32.ActiveCfg = Release|Win32
{EC0D1502-2018-1700-4865-6C6D72696368}.Release DLL|Win32.Build.0 = Release|Win32
{EC0D1502-2018-1700-4865-6C6D72696368}.Release DLL|x64.ActiveCfg = Release|x64
{EC0D1502-2018-1700-4865-6C6D72696368}.Release DLL|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,5 +1,5 @@
/* exhaleDecl.h - header file with declarations for exhale DLL export under Windows
* written by C. R. Helmrich, last modified in 2019 - see License.htm for legal notices
/* exhaleDecl.h - header file with declarations for exhale DLL ex-/import under Windows
* written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
*
* The copyright in this software is being made available under a Modified BSD-Style License
* and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
@ -11,12 +11,22 @@
#ifndef _EXHALE_DECL_H_
#define _EXHALE_DECL_H_
#if defined (_WIN32) || defined (WIN32) || defined (_WIN64) || defined (WIN64)
# ifdef EXHALE_DYN_LINK
# define EXHALE_DECL __declspec (dllexport)
# else
# define EXHALE_DECL
# endif
#endif
#include "../src/lib/exhaleEnc.h"
// DLL constructor
extern "C" EXHALE_DECL ExhaleEncoder* exhaleCreate (int32_t* const, unsigned char* const, const unsigned, const unsigned,
const unsigned, const unsigned, const unsigned, const bool, const bool);
// DLL destructor
extern "C" EXHALE_DECL unsigned exhaleDelete (ExhaleEncoder*);
// DLL initializer
extern "C" EXHALE_DECL unsigned exhaleInitEncoder (ExhaleEncoder*, unsigned char* const, uint32_t* const);
// DLL lookahead encoder
extern "C" EXHALE_DECL unsigned exhaleEncodeLookahead (ExhaleEncoder*);
// DLL frame encoder
extern "C" EXHALE_DECL unsigned exhaleEncodeFrame (ExhaleEncoder*);
#endif // _EXHALE_DECL_H_

View File

@ -1,5 +1,5 @@
/* version.h - header file with major and minor library version numbers as characters
* written by C. R. Helmrich, last modified in 2019 - see License.htm for legal notices
* written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
*
* The copyright in this software is being made available under a Modified BSD-Style License
* and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
@ -15,5 +15,5 @@
# define EXHALELIB_VERSION_MINOR "0"
#endif
#ifndef EXHALELIB_VERSION_BUGFIX
# define EXHALELIB_VERSION_BUGFIX "RC" // "RC" or ".0", ".1", ...
# define EXHALELIB_VERSION_BUGFIX ".0" // "RC" or ".0", ".1", ...
#endif

View File

@ -1,5 +1,5 @@
/* exhaleEnc.h - header file for class providing Extended HE-AAC encoding capability
* written by C. R. Helmrich, last modified in 2019 - see License.htm for legal notices
* written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
*
* The copyright in this software is being made available under a Modified BSD-Style License
* and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
@ -22,6 +22,16 @@
#include "specGapFilling.h"
#include "tempAnalysis.h"
#if defined (_WIN32) || defined (WIN32) || defined (_WIN64) || defined (WIN64)
# ifdef EXHALE_DYN_LINK
# define EXHALE_DECL __declspec (dllexport)
# else
# define EXHALE_DECL
# endif
#else
# define EXHALE_DECL
#endif
// constant and experimental macro
#define WIN_SCALE double (1 << 23)
#define EE_OPT_TNS_SPEC_RANGE 1
@ -56,7 +66,7 @@ typedef enum USAC_CCFL : short
} USAC_CCFL;
// overall xHE-AAC encoding class
class ExhaleEncoder
class EXHALE_DECL ExhaleEncoder
{
private:
@ -140,4 +150,53 @@ public:
}; // ExhaleEncoder
#ifdef EXHALE_DYN_LINK
// DLL constructor
extern "C" EXHALE_DECL ExhaleEncoder* exhaleCreate (int32_t* const inputPcmData, unsigned char* const outputAuData,
const unsigned sampleRate = 44100, const unsigned numChannels = 2,
const unsigned frameLength = 1024, const unsigned indepPeriod = 45,
const unsigned varBitRateMode = 3, const bool useNoiseFilling = true,
const bool useEcodisExt = false)
{
return new ExhaleEncoder (inputPcmData, outputAuData, sampleRate, numChannels, frameLength, indepPeriod, varBitRateMode
#if !RESTRICT_TO_AAC
, useNoiseFilling, useEcodisExt
#endif
);
}
// DLL destructor
extern "C" EXHALE_DECL unsigned exhaleDelete (ExhaleEncoder* exhaleEnc)
{
if (exhaleEnc != nullptr) { exhaleEnc->~ExhaleEncoder (); return 0; }
return USHRT_MAX; // error
}
// DLL initializer
extern "C" EXHALE_DECL unsigned exhaleInitEncoder (ExhaleEncoder* exhaleEnc, unsigned char* const audioConfigBuffer,
uint32_t* const audioConfigBytes = nullptr)
{
if (exhaleEnc != nullptr) return exhaleEnc->initEncoder (audioConfigBuffer, audioConfigBytes);
return USHRT_MAX; // error
}
// DLL lookahead encoder
extern "C" EXHALE_DECL unsigned exhaleEncodeLookahead (ExhaleEncoder* exhaleEnc)
{
if (exhaleEnc != nullptr) return exhaleEnc->encodeLookahead ();
return USHRT_MAX; // error
}
// DLL frame encoder
extern "C" EXHALE_DECL unsigned exhaleEncodeFrame (ExhaleEncoder* exhaleEnc)
{
if (exhaleEnc != nullptr) return exhaleEnc->encodeFrame ();
return USHRT_MAX; // error
}
#endif
#endif // _EXHALE_ENC_H_

View File

@ -17,6 +17,14 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|Win32">
<Configuration>Release DLL</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release DLL|x64">
<Configuration>Release DLL</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{EC0D1501-2018-1700-4865-6C6D72696368}</ProjectGuid>
@ -46,6 +54,18 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
@ -60,6 +80,12 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IntDir>$(SolutionDir)build\$(PlatformToolset)\$(Platform)\$(Configuration)\</IntDir>
@ -79,6 +105,16 @@
<IntDir>$(SolutionDir)build\$(PlatformToolset)\$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)lib\$(PlatformToolset)\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(SolutionDir)build\$(PlatformToolset)\$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)lib\$(PlatformToolset)\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(SolutionDir)build\$(PlatformToolset)\$(Platform)\$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)lib\$(PlatformToolset)\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)include</AdditionalIncludeDirectories>
@ -90,7 +126,6 @@
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
@ -106,7 +141,6 @@
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
@ -124,7 +158,6 @@
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>false</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@ -144,7 +177,44 @@
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>false</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)include</AdditionalIncludeDirectories>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>MaxSpeed</Optimization>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>exhaleLibPch.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>WIN32;NDEBUG;EXHALE_DYN_LINK;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWarningAsError>false</TreatWarningAsError>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>false</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)include</AdditionalIncludeDirectories>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<Optimization>MaxSpeed</Optimization>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>exhaleLibPch.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>WIN32;NDEBUG;EXHALE_DYN_LINK;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TreatWarningAsError>false</TreatWarningAsError>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<GenerateDebugInformation>false</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@ -176,6 +246,8 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="lappedTransform.cpp" />
<ClCompile Include="linearPrediction.cpp" />