\doxysection{private.\+h}
\label{private_8h_source}\index{src/codec/private.h@{src/codec/private.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{comment}{/* GMR-\/1 AMBE vocoder private header */}}
\DoxyCodeLine{2 }
\DoxyCodeLine{3 \textcolor{comment}{/* (C) 2011-\/2019 by Sylvain Munaut <tnt@246tNt.com>}}
\DoxyCodeLine{4 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{5 \textcolor{comment}{ *}}
\DoxyCodeLine{6 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{7 \textcolor{comment}{ * it under the terms of the GNU Affero General Public License as published by}}
\DoxyCodeLine{8 \textcolor{comment}{ * the Free Software Foundation; either version 3 of the License, or}}
\DoxyCodeLine{9 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{10 \textcolor{comment}{ *}}
\DoxyCodeLine{11 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{12 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{13 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{14 \textcolor{comment}{ * GNU Affero General Public License for more details.}}
\DoxyCodeLine{15 \textcolor{comment}{ *}}
\DoxyCodeLine{16 \textcolor{comment}{ * You should have received a copy of the GNU Affero General Public License}}
\DoxyCodeLine{17 \textcolor{comment}{ * along with this program.  If not, see <http://www.gnu.org/licenses/>.}}
\DoxyCodeLine{18 \textcolor{comment}{ */}}
\DoxyCodeLine{19 }
\DoxyCodeLine{20 \textcolor{preprocessor}{\#ifndef \_\_OSMO\_GMR1\_CODEC\_PRIVATE\_H\_\_}}
\DoxyCodeLine{21 \textcolor{preprocessor}{\#define \_\_OSMO\_GMR1\_CODEC\_PRIVATE\_H\_\_}}
\DoxyCodeLine{22 }
\DoxyCodeLine{32 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{33 }
\DoxyCodeLine{34 }
\DoxyCodeLine{35 \textcolor{preprocessor}{\#define AMBE\_RATE 8000          }}
\DoxyCodeLine{39 \textcolor{keyword}{enum} ambe\_frame\_type}
\DoxyCodeLine{40 \{}
\DoxyCodeLine{41         AMBE\_SPEECH,         }
\DoxyCodeLine{42         AMBE\_SILENCE,               }
\DoxyCodeLine{43         AMBE\_TONE,             }
\DoxyCodeLine{44 \};}
\DoxyCodeLine{45 }
\DoxyCodeLine{47 \textcolor{keyword}{struct }ambe\_raw\_params}
\DoxyCodeLine{48 \{}
\DoxyCodeLine{49         uint8\_t pitch;             }
\DoxyCodeLine{50         uint8\_t pitch\_interp;       }
\DoxyCodeLine{51         uint8\_t gain;               }
\DoxyCodeLine{52         uint8\_t v\_uv;               }
\DoxyCodeLine{54         uint8\_t sf1\_prba12;   }
\DoxyCodeLine{55         uint8\_t sf1\_prba34;   }
\DoxyCodeLine{56         uint8\_t sf1\_prba57;   }
\DoxyCodeLine{57         uint8\_t sf1\_hoc[4];      }
\DoxyCodeLine{59         uint8\_t sf0\_mag\_interp;   }
\DoxyCodeLine{60         uint8\_t sf0\_perr\_14; }
\DoxyCodeLine{61         uint8\_t sf0\_perr\_58; }
\DoxyCodeLine{62 \};}
\DoxyCodeLine{63 }
\DoxyCodeLine{65 \textcolor{keyword}{struct }ambe\_subframe}
\DoxyCodeLine{66 \{}
\DoxyCodeLine{67         \textcolor{keywordtype}{float} f0;               }
\DoxyCodeLine{68         \textcolor{keywordtype}{float} f0log;               }
\DoxyCodeLine{69         \textcolor{keywordtype}{float} w0;             }
\DoxyCodeLine{70         \textcolor{keywordtype}{int} L;                  }
\DoxyCodeLine{71         \textcolor{keywordtype}{int} Lb[4];              }
\DoxyCodeLine{72         \textcolor{keywordtype}{int} v\_uv[8];            }
\DoxyCodeLine{73         \textcolor{keywordtype}{int} Vl[56];           }
\DoxyCodeLine{74         \textcolor{keywordtype}{float} gain;         }
\DoxyCodeLine{75         \textcolor{keywordtype}{float} Mlog[56];         }
\DoxyCodeLine{76         \textcolor{keywordtype}{float} Ml[56];         }
\DoxyCodeLine{77 \};}
\DoxyCodeLine{78 }
\DoxyCodeLine{80 \textcolor{keyword}{struct }ambe\_synth}
\DoxyCodeLine{81 \{}
\DoxyCodeLine{82         int16\_t u\_prev;           }
\DoxyCodeLine{83         \textcolor{keywordtype}{float} uw\_prev[121];      }
\DoxyCodeLine{84         \textcolor{keywordtype}{float} psi1;         }
\DoxyCodeLine{85         \textcolor{keywordtype}{float} phi[56];               }
\DoxyCodeLine{86         \textcolor{keywordtype}{float} SE;             }
\DoxyCodeLine{87 \};}
\DoxyCodeLine{88 }
\DoxyCodeLine{90 \textcolor{keyword}{struct }ambe\_decoder}
\DoxyCodeLine{91 \{}
\DoxyCodeLine{92         \textcolor{keywordtype}{float} tone\_phase\_f1;       }
\DoxyCodeLine{93         \textcolor{keywordtype}{float} tone\_phase\_f2;       }
\DoxyCodeLine{95         \textcolor{keyword}{struct }ambe\_subframe sf\_prev;       }
\DoxyCodeLine{97         \textcolor{keyword}{struct }ambe\_synth synth; }
\DoxyCodeLine{98 \};}
\DoxyCodeLine{99 }
\DoxyCodeLine{100 \textcolor{comment}{/* From ambe.c */}}
\DoxyCodeLine{101 \textcolor{keywordtype}{void} ambe\_decode\_init(\textcolor{keyword}{struct} ambe\_decoder *dec);}
\DoxyCodeLine{102 \textcolor{keywordtype}{void} ambe\_decode\_fini(\textcolor{keyword}{struct} ambe\_decoder *dec);}
\DoxyCodeLine{103 }
\DoxyCodeLine{104 \textcolor{keywordtype}{int} ambe\_decode\_frame(\textcolor{keyword}{struct} ambe\_decoder *dec,}
\DoxyCodeLine{105                       int16\_t *audio, \textcolor{keywordtype}{int} N,}
\DoxyCodeLine{106                       \textcolor{keyword}{const} uint8\_t *frame, \textcolor{keywordtype}{int} bad);}
\DoxyCodeLine{107 \textcolor{keywordtype}{int} ambe\_decode\_dtx(\textcolor{keyword}{struct} ambe\_decoder *dec,}
\DoxyCodeLine{108                     int16\_t *audio, \textcolor{keywordtype}{int} N);}
\DoxyCodeLine{109 }
\DoxyCodeLine{110 \textcolor{comment}{/* From frame.c */}}
\DoxyCodeLine{111 \textcolor{keywordtype}{void} ambe\_frame\_unpack\_raw(\textcolor{keyword}{struct} ambe\_raw\_params *rp, \textcolor{keyword}{const} uint8\_t *frame);}
\DoxyCodeLine{112 \textcolor{keywordtype}{void} ambe\_frame\_decode\_params(\textcolor{keyword}{struct} ambe\_subframe *sf,}
\DoxyCodeLine{113                               \textcolor{keyword}{struct} ambe\_subframe *sf\_prev,}
\DoxyCodeLine{114                               \textcolor{keyword}{struct} ambe\_raw\_params *rp);}
\DoxyCodeLine{115 \textcolor{keywordtype}{void} ambe\_subframe\_expand(\textcolor{keyword}{struct} ambe\_subframe *sf);}
\DoxyCodeLine{116 }
\DoxyCodeLine{117 \textcolor{comment}{/* From math.c */}}
\DoxyCodeLine{118 \textcolor{preprocessor}{\#define M\_PIf (3.141592653589793f)      }}
\DoxyCodeLine{120 \textcolor{keywordtype}{float} cosf\_fast(\textcolor{keywordtype}{float} angle);}
\DoxyCodeLine{121 \textcolor{keywordtype}{float} sinf\_fast(\textcolor{keywordtype}{float} angle);}
\DoxyCodeLine{122 \textcolor{keywordtype}{void} ambe\_fdct(\textcolor{keywordtype}{float} *out, \textcolor{keywordtype}{float} *in, \textcolor{keywordtype}{int} N, \textcolor{keywordtype}{int} M);}
\DoxyCodeLine{123 \textcolor{keywordtype}{void} ambe\_idct(\textcolor{keywordtype}{float} *out, \textcolor{keywordtype}{float} *in, \textcolor{keywordtype}{int} N, \textcolor{keywordtype}{int} M);}
\DoxyCodeLine{124 \textcolor{keywordtype}{void} ambe\_fdft\_fc(\textcolor{keywordtype}{float} *out\_i, \textcolor{keywordtype}{float} *out\_q, \textcolor{keywordtype}{float} *in, \textcolor{keywordtype}{int} N, \textcolor{keywordtype}{int} M);}
\DoxyCodeLine{125 \textcolor{keywordtype}{void} ambe\_idft\_cf(\textcolor{keywordtype}{float} *out, \textcolor{keywordtype}{float} *in\_i, \textcolor{keywordtype}{float} *in\_q, \textcolor{keywordtype}{int} N, \textcolor{keywordtype}{int} M);}
\DoxyCodeLine{126 }
\DoxyCodeLine{127 \textcolor{comment}{/* From synth.c */}}
\DoxyCodeLine{128 \textcolor{keywordtype}{void} ambe\_synth\_init(\textcolor{keyword}{struct} ambe\_synth *synth);}
\DoxyCodeLine{129 \textcolor{keywordtype}{void} ambe\_synth\_enhance(\textcolor{keyword}{struct} ambe\_synth *synth, \textcolor{keyword}{struct} ambe\_subframe *sf);}
\DoxyCodeLine{130 \textcolor{keywordtype}{void} ambe\_synth\_audio(\textcolor{keyword}{struct} ambe\_synth *synth, int16\_t *audio,}
\DoxyCodeLine{131                       \textcolor{keyword}{struct} ambe\_subframe *sf,}
\DoxyCodeLine{132                       \textcolor{keyword}{struct} ambe\_subframe *sf\_prev);}
\DoxyCodeLine{133 }
\DoxyCodeLine{134 \textcolor{comment}{/* From tables.c */}}
\DoxyCodeLine{135 \textcolor{keyword}{extern} \textcolor{keyword}{const} uint8\_t ambe\_hpg\_tbl[48][4];}
\DoxyCodeLine{136 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_gain\_tbl[256][2];}
\DoxyCodeLine{137 \textcolor{keyword}{extern} \textcolor{keyword}{const} uint16\_t ambe\_v\_uv\_tbl[64];}
\DoxyCodeLine{138 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_prba12\_tbl[128][2];}
\DoxyCodeLine{139 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_prba34\_tbl[64][2];}
\DoxyCodeLine{140 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_prba57\_tbl[128][3];}
\DoxyCodeLine{141 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_hoc0\_tbl[128][4];}
\DoxyCodeLine{142 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_hoc1\_tbl[64][4];}
\DoxyCodeLine{143 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_hoc2\_tbl[64][4];}
\DoxyCodeLine{144 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_hoc3\_tbl[64][4];}
\DoxyCodeLine{145 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_sf0\_interp\_tbl[4];}
\DoxyCodeLine{146 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_sf0\_perr14\_tbl[64][4];}
\DoxyCodeLine{147 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keywordtype}{float} ambe\_sf0\_perr58\_tbl[32][4];}
\DoxyCodeLine{148 }
\DoxyCodeLine{149 \textcolor{comment}{/* From tone.c */}}
\DoxyCodeLine{150 \textcolor{keywordtype}{int} ambe\_decode\_tone(\textcolor{keyword}{struct} ambe\_decoder *dec,}
\DoxyCodeLine{151                      int16\_t *audio, \textcolor{keywordtype}{int} N, \textcolor{keyword}{const} uint8\_t *frame);}
\DoxyCodeLine{152 }
\DoxyCodeLine{153 }
\DoxyCodeLine{156 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_\_OSMO\_GMR1\_CODEC\_PRIVATE\_H\_\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
