1cabdff1aSopenharmony_ci/*
2cabdff1aSopenharmony_ci * Common code between Nellymoser encoder and decoder
3cabdff1aSopenharmony_ci * Copyright (c) 2007 a840bda5870ba11f19698ff6eb9581dfb0f95fa5,
4cabdff1aSopenharmony_ci *                    539459aeb7d425140b62a3ec7dbf6dc8e408a306, and
5cabdff1aSopenharmony_ci *                    520e17cd55896441042b14df2566a6eb610ed444
6cabdff1aSopenharmony_ci * Copyright (c) 2007 Loic Minier <lool at dooz.org>
7cabdff1aSopenharmony_ci *                    Benjamin Larsson
8cabdff1aSopenharmony_ci *
9cabdff1aSopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
10cabdff1aSopenharmony_ci * copy of this software and associated documentation files (the "Software"),
11cabdff1aSopenharmony_ci * to deal in the Software without restriction, including without limitation
12cabdff1aSopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13cabdff1aSopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
14cabdff1aSopenharmony_ci * Software is furnished to do so, subject to the following conditions:
15cabdff1aSopenharmony_ci *
16cabdff1aSopenharmony_ci * The above copyright notice and this permission notice shall be included in
17cabdff1aSopenharmony_ci * all copies or substantial portions of the Software.
18cabdff1aSopenharmony_ci *
19cabdff1aSopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20cabdff1aSopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21cabdff1aSopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22cabdff1aSopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23cabdff1aSopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24cabdff1aSopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25cabdff1aSopenharmony_ci * DEALINGS IN THE SOFTWARE.
26cabdff1aSopenharmony_ci */
27cabdff1aSopenharmony_ci
28cabdff1aSopenharmony_ci/**
29cabdff1aSopenharmony_ci * @file
30cabdff1aSopenharmony_ci * The 3 alphanumeric copyright notices are md5summed they are from the original
31cabdff1aSopenharmony_ci * implementors. The original code is available from http://code.google.com/p/nelly2pcm/
32cabdff1aSopenharmony_ci */
33cabdff1aSopenharmony_ci
34cabdff1aSopenharmony_ci#ifndef AVCODEC_NELLYMOSER_H
35cabdff1aSopenharmony_ci#define AVCODEC_NELLYMOSER_H
36cabdff1aSopenharmony_ci
37cabdff1aSopenharmony_ci#include <stdint.h>
38cabdff1aSopenharmony_ci
39cabdff1aSopenharmony_ci#define NELLY_BANDS       23
40cabdff1aSopenharmony_ci#define NELLY_BLOCK_LEN   64
41cabdff1aSopenharmony_ci#define NELLY_HEADER_BITS 116
42cabdff1aSopenharmony_ci#define NELLY_DETAIL_BITS 198
43cabdff1aSopenharmony_ci#define NELLY_BUF_LEN     128
44cabdff1aSopenharmony_ci#define NELLY_FILL_LEN    124
45cabdff1aSopenharmony_ci#define NELLY_BIT_CAP     6
46cabdff1aSopenharmony_ci#define NELLY_BASE_OFF    4228
47cabdff1aSopenharmony_ci#define NELLY_BASE_SHIFT  19
48cabdff1aSopenharmony_ci#define NELLY_SAMPLES     (2 * NELLY_BUF_LEN)
49cabdff1aSopenharmony_ci
50cabdff1aSopenharmony_ciextern const float    ff_nelly_dequantization_table[127];
51cabdff1aSopenharmony_ciextern const uint8_t  ff_nelly_band_sizes_table[NELLY_BANDS];
52cabdff1aSopenharmony_ciextern const uint16_t ff_nelly_init_table[64];
53cabdff1aSopenharmony_ciextern const int16_t  ff_nelly_delta_table[32];
54cabdff1aSopenharmony_ci
55cabdff1aSopenharmony_civoid ff_nelly_get_sample_bits(const float *buf, int *bits);
56cabdff1aSopenharmony_ci
57cabdff1aSopenharmony_ci#endif /* AVCODEC_NELLYMOSER_H */
58