Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
libavcodec
amr.h
Go to the documentation of this file.
1
/*
2
* Shared functions between AMR codecs
3
*
4
* Copyright (c) 2010 Marcelo Galvao Povoa
5
*
6
* This file is part of Libav.
7
*
8
* Libav is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
12
*
13
* Libav is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with Libav; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
*/
22
23
#ifndef AVCODEC_AMR_H
24
#define AVCODEC_AMR_H
25
26
#include <string.h>
27
28
#include "
avcodec.h
"
29
30
#ifdef AMR_USE_16BIT_TABLES
31
#define R_TABLE_TYPE uint16_t
32
#else
33
#define R_TABLE_TYPE uint8_t
34
#endif
35
51
static
inline
void
ff_amr_bit_reorder
(uint16_t *out,
int
size
,
52
const
uint8_t
*
data
,
53
const
R_TABLE_TYPE
*ord_table)
54
{
55
int
field_size;
56
57
memset(out, 0, size);
58
while
((field_size = *ord_table++)) {
59
int
field = 0;
60
int
field_offset = *ord_table++;
61
while
(field_size--) {
62
int
bit = *ord_table++;
63
field <<= 1;
64
field |= data[bit >> 3] >> (bit & 7) & 1;
65
}
66
out[field_offset >> 1] = field;
67
}
68
}
69
70
#endif
/* AVCODEC_AMR_H */
size
int size
Definition:
twinvq_data.h:11127
uint8_t
uint8_t
Definition:
audio_convert.c:194
data
const char data[16]
Definition:
mxf.c:66
ff_amr_bit_reorder
static void ff_amr_bit_reorder(uint16_t *out, int size, const uint8_t *data, const R_TABLE_TYPE *ord_table)
Fill the frame structure variables from bitstream by parsing the given reordering table that uses the...
Definition:
amr.h:51
avcodec.h
external API header
R_TABLE_TYPE
#define R_TABLE_TYPE
Definition:
amr.h:33