diff --git a/ChangeLog b/ChangeLog index 1d74f8c19e9b5926ca33e63f5dfbbb09061536cd..ae7f0d1c6c640c92741fbae1868f9874273a5331 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ mlrtp ChangeLog +Version 0.1.5, November 2018: + * add time util + * add lpccodec Version 0.0.4, November 2018: * Add core: config, Version * Add utils: resample diff --git a/README.md b/README.md index ad21af2a90ad7a7ab67b323e3f39db0d2890b95e..54cc0cf64dcbba675f32b1fd470205765851b1ea 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,6 @@ MLRTP ======= - -Introduction ------------- - -The name MLRTP means 'Minlib RTP'. This library was developed -by [RoseLeBlood](http://twitter.com/padersophia), -As the name suggests the goal of the library is to make it easier to stream -several kinds of media, including (but not limited to) audio and video. For -more detailed information about the library, please refer to the library -documentation. +Mini Libary for RTP License ------- @@ -17,10 +8,3 @@ License The license that applies to the library is the LGPL. The license texts of these license can be found in the files `LICENSE` of the source code archive. - - -Contact -------- - -Questions, comments and bug reports can be sent to -[pba3h11aso@t-online.de](mailto:pba3h11aso@t-online.de) diff --git a/lib/esp32-rtp b/lib/esp32-rtp index c703372d1e9847b29265ddd2d1ac52f0547768d6..fdc6b432586dd07ded182c964fbb7c9129cccb4c 160000 --- a/lib/esp32-rtp +++ b/lib/esp32-rtp @@ -1 +1 @@ -Subproject commit c703372d1e9847b29265ddd2d1ac52f0547768d6 +Subproject commit fdc6b432586dd07ded182c964fbb7c9129cccb4c diff --git a/src/components/codec/lpccodec.cpp b/src/components/codec/lpccodec.cpp index af823efaa052dde189c7421ee4a0bdd599c39dc1..36efea35f432213c7453b8d87a5f282c9cc46063 100644 --- a/src/components/codec/lpccodec.cpp +++ b/src/components/codec/lpccodec.cpp @@ -292,22 +292,18 @@ void LPCEncoder::lpc_init() { m_fYp2 = 0.0; } -LPCDecoder::LPCDecoder() -{ - Reset(); +LPCDecoder::LPCDecoder() { + reset(); } -LPCDecoder::~LPCDecoder() -{ +LPCDecoder::~LPCDecoder() { } -void LPCDecoder::Reset() -{ +void LPCDecoder::reset() { lpc_init(); } -void LPCDecoder::Decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCCODEC_INPUTLEN]) -{ +void LPCDecoder::decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCCODEC_INPUTLEN]) { lpcparams_t params; // period was transmitted in network byte order @@ -318,8 +314,7 @@ void LPCDecoder::Decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCC lpc_synthesize(¶ms,samples); } -void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf) -{ +void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf) { int i, j ; float per, G, k[LPCCODEC_FILTORDER+1]; float u, NewG, Ginc, Newper, perinc; @@ -334,8 +329,7 @@ void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf) if (per == 0.0) G /= sqrt(LPCCODEC_BUFLEN/3.0); - else - { + else { i = (int)((float)LPCCODEC_BUFLEN / per); if (i == 0) i = 1; @@ -347,71 +341,61 @@ void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf) for (i=1; i <= LPCCODEC_FILTORDER; i++) Newk[i] = Oldk[i]; - if (Oldper != 0 && per != 0) - { + if (Oldper != 0 && per != 0) { perinc = (per-Oldper) / LPCCODEC_INPUTLEN; Ginc = (G-OldG) / LPCCODEC_INPUTLEN; for (i=1; i <= LPCCODEC_FILTORDER; i++) kinc[i] = (k[i]-Oldk[i]) / LPCCODEC_INPUTLEN; - } - else - { - perinc = 0.0; - Ginc = 0.0; - for (i=1; i <= LPCCODEC_FILTORDER; i++) - kinc[i] = 0.0; - } + } else { + perinc = 0.0; + Ginc = 0.0; + for (i=1; i <= LPCCODEC_FILTORDER; i++) + kinc[i] = 0.0; + } if (Newper == 0) pitchctr = 0; - for (i=0; i < LPCCODEC_INPUTLEN; i++) - { + for (i=0; i < LPCCODEC_INPUTLEN; i++) { if (Newper == 0) #ifdef NO_LPC_FIX - u = (((double)rand())/(((double)RAND_MAX)+1.0)) * NewG; + u = (((double)rand())/(((double)RAND_MAX)+1.0)) * NewG; #else - u = (((double)rand() / (1.0 + (double)RAND_MAX)) - 0.5) * 1.5874 * NewG; + u = (((double)rand() / (1.0 + (double)RAND_MAX)) - 0.5) * 1.5874 * NewG; #endif // NO_LPC_FIX - else - { - if (pitchctr == 0) - { - u = NewG; - pitchctr = (int) Newper; - } - else - { - u = 0.0; - pitchctr--; - } - } - - f[LPCCODEC_FILTORDER] = u; - for (j=LPCCODEC_FILTORDER; j >= 1; j--) - { - f[j-1] = f[j] - Newk[j] * bp[j-1]; - b[j] = Newk[j] * f[j-1] + bp[j-1]; - bp[j] = b[j]; - } - b[0] = bp[0] = f[0]; - - buf[i] = (int) (b[0] * 32768.0); - - Newper += perinc; - NewG += Ginc; - for (j=1; j <= LPCCODEC_FILTORDER; j++) - Newk[j] += kinc[j]; - } - - Oldper = per; - OldG = G; - for (i=1; i <= LPCCODEC_FILTORDER; i++) - Oldk[i] = k[i]; + else { + if (pitchctr == 0) { + u = NewG; + pitchctr = (int) Newper; + } else { + u = 0.0; + pitchctr--; + } + } + + f[LPCCODEC_FILTORDER] = u; + for (j=LPCCODEC_FILTORDER; j >= 1; j--) { + f[j-1] = f[j] - Newk[j] * bp[j-1]; + b[j] = Newk[j] * f[j-1] + bp[j-1]; + bp[j] = b[j]; + } + b[0] = bp[0] = f[0]; + + buf[i] = (int) (b[0] * 32768.0); + + Newper += perinc; + NewG += Ginc; + for (j=1; j <= LPCCODEC_FILTORDER; j++) + Newk[j] += kinc[j]; + } + + Oldper = per; + OldG = G; + for (i=1; i <= LPCCODEC_FILTORDER; i++) + Oldk[i] = k[i]; } -void LPCDecoder::lpc_init() -{ +void LPCDecoder::lpc_init() { int i; Oldper = 0.0; diff --git a/src/components/codec/lpccodec.h b/src/components/codec/lpccodec.h index aa6553d42dab5fa23f5aa6eaa85a01bb925ae5a8..346adb35d7033c80cc104b41177e01ae1f2f613f 100644 --- a/src/components/codec/lpccodec.h +++ b/src/components/codec/lpccodec.h @@ -46,8 +46,8 @@ class LPCDecoder public: LPCDecoder(); ~LPCDecoder(); - void Reset(); - void Decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCCODEC_INPUTLEN]); + void reset(); + void decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCCODEC_INPUTLEN]); private: void lpc_synthesize(lpcparams_t *params, int *buf); void lpc_init();