From 3bffbb446d5dd1d4872d075b21e6dda8bf3606e0 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Mon, 15 Jun 2020 17:54:28 +0300 Subject: [PATCH] - more work on EVS --- src/engine/config.h | 5 +- src/engine/media/MT_CodecList.cpp | 8 +- src/engine/media/MT_CodecList.h | 1 + src/engine/media/MT_EvsCodec.cpp | 120 ++++++++++- src/engine/media/MT_EvsCodec.h | 186 +++--------------- src/libs/libevs/lib_com/ACcontextMapping.cpp | 4 + src/libs/libevs/lib_com/ari.cpp | 3 + src/libs/libevs/lib_com/ari_hm.cpp | 4 + src/libs/libevs/lib_com/arith_coder.cpp | 5 +- src/libs/libevs/lib_com/basop32.cpp | 4 +- .../libevs/lib_dec/ACcontextMapping_dec.cpp | 4 + src/libs/libevs/lib_dec/acelp_core_dec.cpp | 4 + .../libevs/lib_dec/acelp_core_switch_dec.cpp | 3 + src/libs/libevs/lib_dec/amr_wb_dec.cpp | 4 + src/libs/libevs/lib_dec/ari_dec.cpp | 2 + src/libs/libevs/lib_dec/ari_hm_dec.cpp | 4 + src/libs/libevs/lib_dec/arith_coder_dec.cpp | 3 + src/libs/libevs/lib_dec/avq_dec.cpp | 4 + .../libevs/lib_enc/ACcontextMapping_enc.cpp | 3 + src/libs/libevs/lib_enc/acelp_core_enc.cpp | 4 + .../libevs/lib_enc/acelp_core_switch_enc.cpp | 4 + src/libs/libevs/lib_enc/acelp_enc_util.cpp | 3 + src/libs/libevs/lib_enc/amr_wb_enc.cpp | 4 + src/libs/libevs/lib_enc/analy_lp.cpp | 3 + src/libs/libevs/lib_enc/analy_sp.cpp | 4 + src/libs/libevs/lib_enc/ari_enc.cpp | 4 +- src/libs/libevs/lib_enc/ari_hm_enc.cpp | 3 + src/libs/libevs/lib_enc/arith_coder_enc.cpp | 3 + src/libs/libevs/lib_enc/avq_cod.cpp | 4 + 29 files changed, 236 insertions(+), 171 deletions(-) diff --git a/src/engine/config.h b/src/engine/config.h index 420a69b2..5bc3a729 100644 --- a/src/engine/config.h +++ b/src/engine/config.h @@ -1,4 +1,4 @@ -/* Copyright(C) 2007-2015 VoIP objects (voipobjects.com) +/* Copyright(C) 2007-2020 VoIP objects (voipobjects.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -79,6 +79,9 @@ #define MT_GSMEFR_PAYLOADTYPE -1 #define MT_GSMEFR_CODECNAME "GERAN-EFR" +#define MT_EVS_PAYLOADTYPE -1 +#define MT_EVS_CODECNAME "EVS" + // OPUS codec defines // #define USE_OPUS_CODEC #define MT_OPUS_CODEC_PT -1 diff --git a/src/engine/media/MT_CodecList.cpp b/src/engine/media/MT_CodecList.cpp index b5c69855..32c3db06 100644 --- a/src/engine/media/MT_CodecList.cpp +++ b/src/engine/media/MT_CodecList.cpp @@ -1,7 +1,8 @@ -/* Copyright(C) 2007-2019 VoIPobjects (voipobjects.com) +/* Copyright(C) 2007-2020 VoIPobjects (voipobjects.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include #include "../config.h" #include "MT_CodecList.h" @@ -11,7 +12,7 @@ # include "MT_AmrCodec.h" #endif -#include +#include "MT_EvsCodec.h" using namespace MT; @@ -60,6 +61,9 @@ CodecList::CodecList(const Settings& settings) #ifndef TARGET_ANDROID mFactoryList.push_back(new GsmHrCodec::GsmHrFactory(mSettings.mGsmHrPayloadType)); #endif + + if (mSettings.mEvsPayloadType != -1) + mFactoryList.push_back(new EVSCodec::EVSFactory(EVSCodec::StreamParameters())); } CodecList::~CodecList() diff --git a/src/engine/media/MT_CodecList.h b/src/engine/media/MT_CodecList.h index 58f602b3..0ad81a7e 100644 --- a/src/engine/media/MT_CodecList.h +++ b/src/engine/media/MT_CodecList.h @@ -44,6 +44,7 @@ public: int mGsmFrPayloadLength = 33; // Expected GSM payload length int mGsmHrPayloadType = MT_GSMHR_PAYLOADTYPE; int mGsmEfrPayloadType = MT_GSMEFR_PAYLOADTYPE; + int mEvsPayloadType = MT_EVS_PAYLOADTYPE; struct OpusSpec { diff --git a/src/engine/media/MT_EvsCodec.cpp b/src/engine/media/MT_EvsCodec.cpp index ad84fda0..a5e744bc 100644 --- a/src/engine/media/MT_EvsCodec.cpp +++ b/src/engine/media/MT_EvsCodec.cpp @@ -1,6 +1,122 @@ #include "MT_EvsCodec.h" -//bool + + +/*-------------------------------------------------------------------* +* rate2AMRWB_IOmode() +* +* lookup AMRWB IO mode +*-------------------------------------------------------------------*/ + +static Word16 rate2AMRWB_IOmode( + Word32 rate /* i: bit rate */ +); + +/*Revers Function*/ +extern Word16 AMRWB_IOmode2rate( + Word32 mode +); + +/*-------------------------------------------------------------------* +* rate2EVSmode() +* +* lookup EVS mode +*-------------------------------------------------------------------*/ +extern Word16 rate2EVSmode( + Word32 rate /* i: bit rate */ +); + +/*Revers Function*/ +extern Word16 EVSmode2rate( + Word32 mode +); + +#define CMR_OFF -1 +#define CMR_ON 0 +#define CMR_ONLY 1 + + +static const std::map> BitrateToBandwidth_Tab{ + {5900, {NB, WB}}, + {7200, {NB, WB}}, + {8000, {NB, WB}}, + {9600, {NB, WB, SWB}}, + {13200, {NB, WB, SWB}}, //if channel aware mode - WB, SWB + {16400, {NB, WB, SWB, FB}}, + {24400, {NB, WB, SWB, FB}}, + {32000, {WB, SWB, FB}}, + {48000, {WB, SWB, FB}}, + {64000, {WB, SWB, FB}}, + {96000, {WB, SWB, FB}}, + {128000, {WB, SWB, FB}} +}; + +/* Protected payload size/Fixed bitrate to EVS ()*/ +static const std::map Bitrate2PayloadSize_EVSAMR_WB{ + /*{bitrate, payload size}*/ + { SID_1k75, 56}, //AMR-WB I/O SIB + {ACELP_6k60, 136}, + {ACELP_8k85, 184}, + {ACELP_12k65, 256}, + {ACELP_14k25, 288}, + {ACELP_15k85, 320}, + {ACELP_18k25, 368}, + {ACELP_19k85, 400}, + {ACELP_23k05, 464}, + {ACELP_23k85, 480} +}; + +static const std::map Bitrate2PayloadSize_EVS{ + /*{bitrate, payload size}*/ + {FRAME__NO_DATA, 0}, + {SID_2k40, 48}, //EVS Primary SID + {PPP_NELP_2k80, 56}, //special for full header + {ACELP_7k20, 144}, + {ACELP_8k00, 160}, + {ACELP_9k60, 192}, + {ACELP_13k20, 264}, + {ACELP_16k40, 328}, + {ACELP_24k40, 488}, + {ACELP_32k, 640}, + {ACELP_48k, 960}, + {ACELP_64k, 1280}, + {HQ_96k, 1920}, + {HQ_128k, 2560} +}; + +/* Protected payload size/Fixed bitrate to EVS ()*/ +static const std::map FixedPayload_EVSPrimary{ + /*{payload size , bitrate}*/ + {48, 2400}, //EVS Primary SID + {56, 2800}, //special for full header + {144, 7200}, + {160, 8000}, + {192, 9600}, + {264, 13200}, + {328, 16400}, + {488, 24400}, + {640, 32000}, + {960, 48000}, + {1280, 64000}, + {1920, 96000}, + {2560, 128000} +}; + +static const std::map FixedPayload_EVSAMR_WB{ + /*{payload size , bitrate}*/ + {136, 6600}, + {184, 8850}, + {256, 12650}, + {288, 14250}, + {320, 15850}, + {368, 18250}, + {400, 19850}, + {464, 23050}, + {480, 23850} +}; + +namespace MT +{ EVSCodec::EVSFactory::EVSFactory(StreamParameters sp) : _sp(sp) {} @@ -204,3 +320,5 @@ void EVSCodec::initDecoder(const StreamParameters& sp) srand(static_cast(time(nullptr))); } + +} // end of namespace MT diff --git a/src/engine/media/MT_EvsCodec.h b/src/engine/media/MT_EvsCodec.h index 6a62aed2..c10618e7 100644 --- a/src/engine/media/MT_EvsCodec.h +++ b/src/engine/media/MT_EvsCodec.h @@ -10,172 +10,27 @@ #include #include -extern "C" { - //#include "lib_dec/EvsRXlib.h" - #include "libevs/lib_com/prot.h" -} +#include "config.h" +#include "MT_Codec.h" -/*-------------------------------------------------------------------* -* rate2AMRWB_IOmode() -* -* lookup AMRWB IO mode -*-------------------------------------------------------------------*/ +#include "libevs/lib_com/prot.h" -static Word16 rate2AMRWB_IOmode( - Word32 rate /* i: bit rate */ -); +namespace MT { -/*Revers Function*/ -extern Word16 AMRWB_IOmode2rate( - Word32 mode -); - -/*-------------------------------------------------------------------* -* rate2EVSmode() -* -* lookup EVS mode -*-------------------------------------------------------------------*/ -extern Word16 rate2EVSmode( - Word32 rate /* i: bit rate */ -); - -/*Revers Function*/ -extern Word16 EVSmode2rate( - Word32 mode -); - -class Codec; -typedef std::shared_ptr PCodec; - -#define CMR_OFF -1 -#define CMR_ON 0 -#define CMR_ONLY 1 - - -static const std::map> BitrateToBandwidth_Tab{ - {5900, {NB, WB}}, - {7200, {NB, WB}}, - {8000, {NB, WB}}, - {9600, {NB, WB, SWB}}, - {13200, {NB, WB, SWB}}, //if channel aware mode - WB, SWB - {16400, {NB, WB, SWB, FB}}, - {24400, {NB, WB, SWB, FB}}, - {32000, {WB, SWB, FB}}, - {48000, {WB, SWB, FB}}, - {64000, {WB, SWB, FB}}, - {96000, {WB, SWB, FB}}, - {128000, {WB, SWB, FB}} -}; - -/* Protected payload size/Fixed bitrate to EVS ()*/ -static const std::map Bitrate2PayloadSize_EVSAMR_WB{ - /*{bitrate, payload size}*/ - { SID_1k75, 56}, //AMR-WB I/O SIB - {ACELP_6k60, 136}, - {ACELP_8k85, 184}, - {ACELP_12k65, 256}, - {ACELP_14k25, 288}, - {ACELP_15k85, 320}, - {ACELP_18k25, 368}, - {ACELP_19k85, 400}, - {ACELP_23k05, 464}, - {ACELP_23k85, 480} -}; - -static const std::map Bitrate2PayloadSize_EVS{ - /*{bitrate, payload size}*/ - {FRAME__NO_DATA, 0}, - {SID_2k40, 48}, //EVS Primary SID - {PPP_NELP_2k80, 56}, //special for full header - {ACELP_7k20, 144}, - {ACELP_8k00, 160}, - {ACELP_9k60, 192}, - {ACELP_13k20, 264}, - {ACELP_16k40, 328}, - {ACELP_24k40, 488}, - {ACELP_32k, 640}, - {ACELP_48k, 960}, - {ACELP_64k, 1280}, - {HQ_96k, 1920}, - {HQ_128k, 2560} -}; - -/* Protected payload size/Fixed bitrate to EVS ()*/ -static const std::map FixedPayload_EVSPrimary{ - /*{payload size , bitrate}*/ - {48, 2400}, //EVS Primary SID - {56, 2800}, //special for full header - {144, 7200}, - {160, 8000}, - {192, 9600}, - {264, 13200}, - {328, 16400}, - {488, 24400}, - {640, 32000}, - {960, 48000}, - {1280, 64000}, - {1920, 96000}, - {2560, 128000} -}; - -static const std::map FixedPayload_EVSAMR_WB{ - /*{payload size , bitrate}*/ - {136, 6600}, - {184, 8850}, - {256, 12650}, - {288, 14250}, - {320, 15850}, - {368, 18250}, - {400, 19850}, - {464, 23050}, - {480, 23850} -}; - -struct StreamParameters { - bool mime = false; - bool fh_only = false; /*not use*/ - int CRMByte = CMR_OFF;/*not use*/ - int br = 0; /*not use*/ - int bw = NB; - int ptime = 20; -}; //Emulated SDP config/meadia type parameters - -class Codec -{ -public: - class Factory - { - public: - virtual ~Factory() {} - virtual const char* name() = 0; - virtual int samplerate() = 0; - virtual int payloadType() = 0; - virtual PCodec create() = 0; - - virtual int channels() = 0; - }; - virtual ~Codec() {} - virtual const char* name() = 0; - virtual int samplerate() = 0; - virtual float timestampUnit() { return float(1.0 / samplerate()); } - virtual int pcmLength() = 0; - virtual int frameTime() = 0; - virtual int rtpLength() = 0; - virtual int channels() { return 1; } - virtual int encode(const void* input, int inputBytes, void* output, int outputCapacity) = 0; - virtual int decode(const void* input, int inputBytes, void* output, int outputCapacity) = 0; - virtual int plc(int lostFrames, void* output, int outputCapacity) = 0; - - // Returns size of codec in memory - virtual int getSize() const { return 0; }; -}; class EVSCodec : public Codec { -private: - Decoder_State* st_dec; - //Encoder_State_fx* st_enc; - StreamParameters sp; +public: + // Emulated SDP config/media type parameters + struct StreamParameters + { + bool mime = false; + bool fh_only = false; /*not use*/ + int CRMByte = -1/*CMR_OFF*/; /*not use*/ + int br = 0; /*not use*/ + int bw = NB; + int ptime = 20; + }; public: class EVSFactory : public Factory @@ -185,7 +40,7 @@ public: public: EVSFactory(StreamParameters sp); - const char* name() { return "EVS"; }; + const char* name() { return MT_EVS_CODECNAME; }; int samplerate(); int payloadType(); PCodec create(); @@ -196,7 +51,7 @@ public: EVSCodec(const StreamParameters& sp); ~EVSCodec() override; - const char* name() { return "EVS"; }; + const char* name() { return MT_EVS_CODECNAME; }; int samplerate(); int samplerate(int CodecMode); // DEC or ENC defined in cnst.h int pcmLength(); @@ -206,5 +61,12 @@ public: int encode(const void* input, int inputBytes, void* output, int outputCapacity); int decode(const void* input, int inputBytes, void* output, int outputCapacity); int plc(int lostFrames, void* output, int outputCapacity) ; + +private: + Decoder_State* st_dec; + //Encoder_State_fx* st_enc; + StreamParameters sp; void initDecoder(const StreamParameters& sp); }; + +} // End of namespace diff --git a/src/libs/libevs/lib_com/ACcontextMapping.cpp b/src/libs/libevs/lib_com/ACcontextMapping.cpp index dae44216..9171785f 100644 --- a/src/libs/libevs/lib_com/ACcontextMapping.cpp +++ b/src/libs/libevs/lib_com/ACcontextMapping.cpp @@ -6,6 +6,8 @@ #include "cnst.h" #include "prot.h" +namespace evs { + /*-------------------------------------------------------------------* * get_next_coeff_mapped() @@ -71,3 +73,5 @@ int update_mixed_context( return (ctx & 0xf) * 16 + t + 13; } + +} // end of namespace evs diff --git a/src/libs/libevs/lib_com/ari.cpp b/src/libs/libevs/lib_com/ari.cpp index c95c1961..7258e536 100644 --- a/src/libs/libevs/lib_com/ari.cpp +++ b/src/libs/libevs/lib_com/ari.cpp @@ -14,6 +14,7 @@ #define int32 int #endif +namespace evs { /*--------------------------------------------------------------- @@ -37,3 +38,5 @@ long mul_sbc_14bits(long r,long c) /*function in line*/ } + +} // end of namespace diff --git a/src/libs/libevs/lib_com/ari_hm.cpp b/src/libs/libevs/lib_com/ari_hm.cpp index 41b582c3..0d35691d 100644 --- a/src/libs/libevs/lib_com/ari_hm.cpp +++ b/src/libs/libevs/lib_com/ari_hm.cpp @@ -10,6 +10,8 @@ #include "prot.h" #include "rom_com.h" +namespace evs { + /*-------------------------------------------------------------------* * UnmapIndex() @@ -268,3 +270,5 @@ void tcx_hm_modify_envelope( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_com/arith_coder.cpp b/src/libs/libevs/lib_com/arith_coder.cpp index 831b443b..5f2b1efc 100644 --- a/src/libs/libevs/lib_com/arith_coder.cpp +++ b/src/libs/libevs/lib_com/arith_coder.cpp @@ -10,8 +10,7 @@ #include "basop_util.h" #include "basop_proto_func.h" - - +namespace evs { /*-------------------------------------------------------* * expfp() @@ -508,3 +507,5 @@ void tcx_arith_render_envelope( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_com/basop32.cpp b/src/libs/libevs/lib_com/basop32.cpp index 520b0e8f..7c698754 100644 --- a/src/libs/libevs/lib_com/basop32.cpp +++ b/src/libs/libevs/lib_com/basop32.cpp @@ -130,7 +130,9 @@ HISTORY: #include #include "stl.h" +namespace evs { +} /*___________________________________________________________________________ | | | Local Functions | @@ -2535,6 +2537,6 @@ Word32 L_msu0 (Word32 L_var3, Word16 var1, Word16 var2) return(L_var_out); } - +} // end of namespace evs /* end of file */ diff --git a/src/libs/libevs/lib_dec/ACcontextMapping_dec.cpp b/src/libs/libevs/lib_dec/ACcontextMapping_dec.cpp index d321e726..a003c96e 100644 --- a/src/libs/libevs/lib_dec/ACcontextMapping_dec.cpp +++ b/src/libs/libevs/lib_dec/ACcontextMapping_dec.cpp @@ -7,6 +7,8 @@ #include "rom_com.h" #include "prot.h" +namespace evs { + /*-------------------------------------------------------------------* * ACcontextMapping_decode2_no_mem_s17_LC() * @@ -276,3 +278,5 @@ long ACcontextMapping_decode2_no_mem_s17_LC( /* o: resQBits */ return resQBits; } + +} // end of namespace EVS diff --git a/src/libs/libevs/lib_dec/acelp_core_dec.cpp b/src/libs/libevs/lib_dec/acelp_core_dec.cpp index 64b26996..78e7fcbd 100644 --- a/src/libs/libevs/lib_dec/acelp_core_dec.cpp +++ b/src/libs/libevs/lib_dec/acelp_core_dec.cpp @@ -7,6 +7,8 @@ #include "rom_com.h" #include "prot.h" +namespace evs { + /*-------------------------------------------------------------------* * acelp_core_dec() * @@ -917,3 +919,5 @@ void acelp_core_dec( return; } + +} // end of namespace EVS diff --git a/src/libs/libevs/lib_dec/acelp_core_switch_dec.cpp b/src/libs/libevs/lib_dec/acelp_core_switch_dec.cpp index 6ee78ceb..e1d3e2fa 100644 --- a/src/libs/libevs/lib_dec/acelp_core_switch_dec.cpp +++ b/src/libs/libevs/lib_dec/acelp_core_switch_dec.cpp @@ -7,6 +7,7 @@ #include "rom_com.h" #include "prot.h" +namespace evs { /*---------------------------------------------------------------------* * Local functions @@ -558,3 +559,5 @@ static void decod_gen_voic_core_switch( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_dec/amr_wb_dec.cpp b/src/libs/libevs/lib_dec/amr_wb_dec.cpp index 4bdbfe18..081764f2 100644 --- a/src/libs/libevs/lib_dec/amr_wb_dec.cpp +++ b/src/libs/libevs/lib_dec/amr_wb_dec.cpp @@ -8,6 +8,8 @@ #include "prot.h" +namespace evs { + /*------------------------------------------------------------------* * amr_wb_dec() * @@ -863,3 +865,5 @@ void amr_wb_dec( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_dec/ari_dec.cpp b/src/libs/libevs/lib_dec/ari_dec.cpp index 77c4dd95..b56cd715 100644 --- a/src/libs/libevs/lib_dec/ari_dec.cpp +++ b/src/libs/libevs/lib_dec/ari_dec.cpp @@ -10,6 +10,7 @@ #include "assert.h" #include "basop_util.h" +namespace evs { /*--------------------------------------------------------------- @@ -637,3 +638,4 @@ long ari_decode_14bits_sign(const int *ptr, long bp, long bits, int *res, Tastat return bp; } +} // end of namespace diff --git a/src/libs/libevs/lib_dec/ari_hm_dec.cpp b/src/libs/libevs/lib_dec/ari_hm_dec.cpp index f7db14ba..405b3833 100644 --- a/src/libs/libevs/lib_dec/ari_hm_dec.cpp +++ b/src/libs/libevs/lib_dec/ari_hm_dec.cpp @@ -10,6 +10,8 @@ #include "prot.h" #include "rom_com.h" +namespace evs { + /*-------------------------------------------------------------------* * DecodeIndex() * @@ -125,3 +127,5 @@ void tcx_hm_decode( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_dec/arith_coder_dec.cpp b/src/libs/libevs/lib_dec/arith_coder_dec.cpp index 4916b6b4..e63beffc 100644 --- a/src/libs/libevs/lib_dec/arith_coder_dec.cpp +++ b/src/libs/libevs/lib_dec/arith_coder_dec.cpp @@ -11,6 +11,7 @@ #include "basop_util.h" #include "basop_proto_func.h" +namespace evs { /*-------------------------------------------------------* * tcx_arith_decode() @@ -180,3 +181,5 @@ void tcx_arith_decode_envelope( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_dec/avq_dec.cpp b/src/libs/libevs/lib_dec/avq_dec.cpp index 57811b32..ba92c97b 100644 --- a/src/libs/libevs/lib_dec/avq_dec.cpp +++ b/src/libs/libevs/lib_dec/avq_dec.cpp @@ -8,6 +8,8 @@ #include "options.h" #include "cnst.h" +namespace evs { + /*-----------------------------------------------------------------* * AVQ_demuxdec() @@ -218,3 +220,5 @@ void AVQ_dec_lpc( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_enc/ACcontextMapping_enc.cpp b/src/libs/libevs/lib_enc/ACcontextMapping_enc.cpp index dc75aedc..dfed518b 100644 --- a/src/libs/libevs/lib_enc/ACcontextMapping_enc.cpp +++ b/src/libs/libevs/lib_enc/ACcontextMapping_enc.cpp @@ -8,6 +8,7 @@ #include "rom_com.h" #include "prot.h" +namespace evs { /*-------------------------------------------------------------------* * ACcontextMapping_encode2_no_mem_s17_LC() @@ -634,3 +635,5 @@ int ACcontextMapping_encode2_estimate_no_mem_s17_LC( return nbits_old; } + +} // end of namespace diff --git a/src/libs/libevs/lib_enc/acelp_core_enc.cpp b/src/libs/libevs/lib_enc/acelp_core_enc.cpp index 381626c7..039901f1 100644 --- a/src/libs/libevs/lib_enc/acelp_core_enc.cpp +++ b/src/libs/libevs/lib_enc/acelp_core_enc.cpp @@ -10,6 +10,8 @@ #include "rom_com.h" #include "prot.h" +namespace evs { + /*-------------------------------------------------------------------* * acelp_core_enc() * @@ -583,3 +585,5 @@ void acelp_core_enc( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_enc/acelp_core_switch_enc.cpp b/src/libs/libevs/lib_enc/acelp_core_switch_enc.cpp index 061779cb..c58a4602 100644 --- a/src/libs/libevs/lib_enc/acelp_core_switch_enc.cpp +++ b/src/libs/libevs/lib_enc/acelp_core_switch_enc.cpp @@ -11,6 +11,8 @@ #include "prot.h" #include "prot.h" +namespace evs { + /*---------------------------------------------------------------------* * Local functions *---------------------------------------------------------------------*/ @@ -436,3 +438,5 @@ static void bwe_switch_enc( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_enc/acelp_enc_util.cpp b/src/libs/libevs/lib_enc/acelp_enc_util.cpp index 809d6b16..4e2cd7b8 100644 --- a/src/libs/libevs/lib_enc/acelp_enc_util.cpp +++ b/src/libs/libevs/lib_enc/acelp_enc_util.cpp @@ -11,6 +11,7 @@ #include "cnst.h" #include "rom_com.h" +namespace evs { /*-------------------------------------------------------------------* * E_ACELP_toeplitz_mul() @@ -45,3 +46,5 @@ void E_ACELP_toeplitz_mul( return; } + +} // end of namespace evs diff --git a/src/libs/libevs/lib_enc/amr_wb_enc.cpp b/src/libs/libevs/lib_enc/amr_wb_enc.cpp index 06354c90..1afa06d7 100644 --- a/src/libs/libevs/lib_enc/amr_wb_enc.cpp +++ b/src/libs/libevs/lib_enc/amr_wb_enc.cpp @@ -10,6 +10,8 @@ #include "rom_com.h" #include "prot.h" +namespace evs { + /*-------------------------------------------------------------------* * amr_wb_enc() * @@ -537,3 +539,5 @@ void amr_wb_enc( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_enc/analy_lp.cpp b/src/libs/libevs/lib_enc/analy_lp.cpp index b0944eb0..84ee7ce7 100644 --- a/src/libs/libevs/lib_enc/analy_lp.cpp +++ b/src/libs/libevs/lib_enc/analy_lp.cpp @@ -7,6 +7,8 @@ #include "rom_com.h" #include "prot.h" +namespace evs { + /*-------------------------------------------------------------------* * analy_lp() * @@ -141,3 +143,4 @@ void analy_lp_AMR_WB( return; } +// end of namespace diff --git a/src/libs/libevs/lib_enc/analy_sp.cpp b/src/libs/libevs/lib_enc/analy_sp.cpp index 7d014d45..6c87061d 100644 --- a/src/libs/libevs/lib_enc/analy_sp.cpp +++ b/src/libs/libevs/lib_enc/analy_sp.cpp @@ -9,6 +9,8 @@ #include "rom_com.h" #include "prot.h" +namespace evs { + static void find_enr( const float data[], float band[], float *ptE, float *Etot, const short min_band, const short max_band, float *Bin_E, const short bin_freq, float *band_ener ); @@ -207,3 +209,5 @@ static void find_enr( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_enc/ari_enc.cpp b/src/libs/libevs/lib_enc/ari_enc.cpp index 169cb9f7..5fbf36fa 100644 --- a/src/libs/libevs/lib_enc/ari_enc.cpp +++ b/src/libs/libevs/lib_enc/ari_enc.cpp @@ -10,8 +10,7 @@ #include "assert.h" #include "basop_util.h" - - +namespace evs { /** * \brief Copy state @@ -408,3 +407,4 @@ long ari_done_cbr_encoding_14bits(int *ptr, long bp, long bits, Tastat *s) return bp; } +} // end of namespace diff --git a/src/libs/libevs/lib_enc/ari_hm_enc.cpp b/src/libs/libevs/lib_enc/ari_hm_enc.cpp index 6d58d2ca..0e8a81de 100644 --- a/src/libs/libevs/lib_enc/ari_hm_enc.cpp +++ b/src/libs/libevs/lib_enc/ari_hm_enc.cpp @@ -11,6 +11,7 @@ #include "prot.h" #include "rom_com.h" +namespace evs { /*-------------------------------------------------------------------* * EncodeIndex() @@ -587,3 +588,5 @@ void tcx_hm_analyse( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_enc/arith_coder_enc.cpp b/src/libs/libevs/lib_enc/arith_coder_enc.cpp index b09c81d9..bfa3fe36 100644 --- a/src/libs/libevs/lib_enc/arith_coder_enc.cpp +++ b/src/libs/libevs/lib_enc/arith_coder_enc.cpp @@ -14,6 +14,7 @@ #include "basop_util.h" #include "basop_proto_func.h" +namespace evs { /*-------------------------------------------------------------------* * Local constants @@ -623,3 +624,5 @@ void tcx_arith_encode_envelope( return; } + +} // end of namespace diff --git a/src/libs/libevs/lib_enc/avq_cod.cpp b/src/libs/libevs/lib_enc/avq_cod.cpp index 8767fdb0..f7dac446 100644 --- a/src/libs/libevs/lib_enc/avq_cod.cpp +++ b/src/libs/libevs/lib_enc/avq_cod.cpp @@ -7,6 +7,8 @@ #include "prot.h" #include "rom_com.h" +namespace evs { + /*-------------------------------------------------------------------* * Function AVQ_cod() * * * @@ -377,3 +379,5 @@ void AVQ_cod_lpc( return; } + +} // end of namespace