blob: 3bd235fc3807b977bd6c917269d4a8e961f94df8 [file] [log] [blame]
Benny Prijono7ffd7752008-03-17 14:07:53 +00001/* $Id$ */
2/*
3 * Copyright (C)2003-2008 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19/*
20 * Based on implementation found in Carnegie Mellon Speech Group Software
21 * depository (ftp://ftp.cs.cmu.edu/project/fgdata/index.html). No copyright
22 * was claimed in the original source codes.
23 */
24#ifndef __PJMEDIA_CODEC_G722_ENC_H__
25#define __PJMEDIA_CODEC_G722_ENC_H__
26
27#include <pjmedia-codec/types.h>
28
29/* Encoder state */
30typedef struct g722_enc_t {
31 /* PCM low band */
32 int slow;
33 int detlow;
34 int spl;
35 int szl;
36 int rlt [3];
37 int al [3];
38 int apl [3];
39 int plt [3];
40 int dlt [7];
41 int bl [7];
42 int bpl [7];
43 int sgl [7];
44 int nbl;
45
46 /* PCM high band*/
47 int shigh;
48 int dethigh;
49 int sph;
50 int szh;
51 int rh [3];
52 int ah [3];
53 int aph [3];
54 int ph [3];
55 int dh [7];
56 int bh [7];
57 int bph [7];
58 int sgh [7];
59 int nbh;
60
61 /* QMF signal history */
62 int x[24];
63} g722_enc_t;
64
65
66PJ_DECL(pj_status_t) g722_enc_init(g722_enc_t *enc);
67
68PJ_DECL(pj_status_t) g722_enc_encode(g722_enc_t *enc,
69 pj_int16_t in[],
70 pj_size_t nsamples,
71 void *out,
72 pj_size_t *out_size);
73
74PJ_DECL(pj_status_t) g722_enc_deinit(g722_enc_t *enc);
75
76#endif /* __PJMEDIA_CODEC_G722_ENC_H__ */
77