Skip to content
Snippets Groups Projects
Commit 036e365c authored by Amber-Sophia Schröck's avatar Amber-Sophia Schröck
Browse files

Update readme

parent e2bfc8d8
No related branches found
No related tags found
No related merge requests found
mlrtp ChangeLog mlrtp ChangeLog
Version 0.1.5, November 2018:
* add time util
* add lpccodec
Version 0.0.4, November 2018: Version 0.0.4, November 2018:
* Add core: config, Version * Add core: config, Version
* Add utils: resample * Add utils: resample
......
MLRTP MLRTP
======= =======
Mini Libary for RTP
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.
License License
------- -------
...@@ -17,10 +8,3 @@ License ...@@ -17,10 +8,3 @@ License
The license that applies to the library is the LGPL. The license texts of these 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 license can be found in the files `LICENSE` of the
source code archive. source code archive.
Contact
-------
Questions, comments and bug reports can be sent to
[pba3h11aso@t-online.de](mailto:pba3h11aso@t-online.de)
esp32-rtp @ fdc6b432
Subproject commit c703372d1e9847b29265ddd2d1ac52f0547768d6 Subproject commit fdc6b432586dd07ded182c964fbb7c9129cccb4c
...@@ -292,22 +292,18 @@ void LPCEncoder::lpc_init() { ...@@ -292,22 +292,18 @@ void LPCEncoder::lpc_init() {
m_fYp2 = 0.0; m_fYp2 = 0.0;
} }
LPCDecoder::LPCDecoder() LPCDecoder::LPCDecoder() {
{ reset();
Reset();
} }
LPCDecoder::~LPCDecoder() LPCDecoder::~LPCDecoder() {
{
} }
void LPCDecoder::Reset() void LPCDecoder::reset() {
{
lpc_init(); 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; lpcparams_t params;
// period was transmitted in network byte order // period was transmitted in network byte order
...@@ -318,8 +314,7 @@ void LPCDecoder::Decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCC ...@@ -318,8 +314,7 @@ void LPCDecoder::Decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCC
lpc_synthesize(&params,samples); lpc_synthesize(&params,samples);
} }
void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf) void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf) {
{
int i, j ; int i, j ;
float per, G, k[LPCCODEC_FILTORDER+1]; float per, G, k[LPCCODEC_FILTORDER+1];
float u, NewG, Ginc, Newper, perinc; float u, NewG, Ginc, Newper, perinc;
...@@ -334,8 +329,7 @@ void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf) ...@@ -334,8 +329,7 @@ void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf)
if (per == 0.0) if (per == 0.0)
G /= sqrt(LPCCODEC_BUFLEN/3.0); G /= sqrt(LPCCODEC_BUFLEN/3.0);
else else {
{
i = (int)((float)LPCCODEC_BUFLEN / per); i = (int)((float)LPCCODEC_BUFLEN / per);
if (i == 0) if (i == 0)
i = 1; i = 1;
...@@ -347,71 +341,61 @@ void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf) ...@@ -347,71 +341,61 @@ void LPCDecoder::lpc_synthesize(lpcparams_t *params, int *buf)
for (i=1; i <= LPCCODEC_FILTORDER; i++) for (i=1; i <= LPCCODEC_FILTORDER; i++)
Newk[i] = Oldk[i]; Newk[i] = Oldk[i];
if (Oldper != 0 && per != 0) if (Oldper != 0 && per != 0) {
{
perinc = (per-Oldper) / LPCCODEC_INPUTLEN; perinc = (per-Oldper) / LPCCODEC_INPUTLEN;
Ginc = (G-OldG) / LPCCODEC_INPUTLEN; Ginc = (G-OldG) / LPCCODEC_INPUTLEN;
for (i=1; i <= LPCCODEC_FILTORDER; i++) for (i=1; i <= LPCCODEC_FILTORDER; i++)
kinc[i] = (k[i]-Oldk[i]) / LPCCODEC_INPUTLEN; kinc[i] = (k[i]-Oldk[i]) / LPCCODEC_INPUTLEN;
} } else {
else perinc = 0.0;
{ Ginc = 0.0;
perinc = 0.0; for (i=1; i <= LPCCODEC_FILTORDER; i++)
Ginc = 0.0; kinc[i] = 0.0;
for (i=1; i <= LPCCODEC_FILTORDER; i++) }
kinc[i] = 0.0;
}
if (Newper == 0) if (Newper == 0)
pitchctr = 0; pitchctr = 0;
for (i=0; i < LPCCODEC_INPUTLEN; i++) for (i=0; i < LPCCODEC_INPUTLEN; i++) {
{
if (Newper == 0) if (Newper == 0)
#ifdef NO_LPC_FIX #ifdef NO_LPC_FIX
u = (((double)rand())/(((double)RAND_MAX)+1.0)) * NewG; u = (((double)rand())/(((double)RAND_MAX)+1.0)) * NewG;
#else #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 #endif // NO_LPC_FIX
else else {
{ if (pitchctr == 0) {
if (pitchctr == 0) u = NewG;
{ pitchctr = (int) Newper;
u = NewG; } else {
pitchctr = (int) Newper; u = 0.0;
} pitchctr--;
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];
f[LPCCODEC_FILTORDER] = u; bp[j] = b[j];
for (j=LPCCODEC_FILTORDER; j >= 1; j--) }
{ b[0] = bp[0] = f[0];
f[j-1] = f[j] - Newk[j] * bp[j-1];
b[j] = Newk[j] * f[j-1] + bp[j-1]; buf[i] = (int) (b[0] * 32768.0);
bp[j] = b[j];
} Newper += perinc;
b[0] = bp[0] = f[0]; NewG += Ginc;
for (j=1; j <= LPCCODEC_FILTORDER; j++)
buf[i] = (int) (b[0] * 32768.0); Newk[j] += kinc[j];
}
Newper += perinc;
NewG += Ginc; Oldper = per;
for (j=1; j <= LPCCODEC_FILTORDER; j++) OldG = G;
Newk[j] += kinc[j]; for (i=1; i <= LPCCODEC_FILTORDER; i++)
} Oldk[i] = k[i];
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; int i;
Oldper = 0.0; Oldper = 0.0;
......
...@@ -46,8 +46,8 @@ class LPCDecoder ...@@ -46,8 +46,8 @@ class LPCDecoder
public: public:
LPCDecoder(); LPCDecoder();
~LPCDecoder(); ~LPCDecoder();
void Reset(); void reset();
void Decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCCODEC_INPUTLEN]); void decode(unsigned char frame[LPCCODEC_OUTPUTLEN],int samples[LPCCODEC_INPUTLEN]);
private: private:
void lpc_synthesize(lpcparams_t *params, int *buf); void lpc_synthesize(lpcparams_t *params, int *buf);
void lpc_init(); void lpc_init();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment