annotate pcm_tablegen.c @ 11588:480a999ce2c4 libavcodec

Add support for PS sync extensions.
author alexc
date Thu, 08 Apr 2010 06:04:41 +0000
parents 7d324b40c3d6
children 59f399926c12
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11571
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
1 /*
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
2 * Generate a header file for hardcoded PCM tables
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
3 *
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
4 * Copyright (c) 2010 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
5 *
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
6 * This file is part of FFmpeg.
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
7 *
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
10 * License as published by the Free Software Foundation; either
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
11 * version 2.1 of the License, or (at your option) any later version.
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
12 *
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
16 * Lesser General Public License for more details.
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
17 *
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
19 * License along with FFmpeg; if not, write to the Free Software
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
21 */
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
22
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
23 #include <stdlib.h>
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
24 #define CONFIG_HARDCODED_TABLES 0
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
25 #include "pcm_tablegen.h"
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
26 #include "tableprint.h"
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
27
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
28 int main(void)
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
29 {
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
30 pcm_alaw_tableinit();
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
31 pcm_ulaw_tableinit();
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
32
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
33 write_fileheader();
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
34
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
35 printf("static const uint8_t linear_to_alaw[1 << 14] = {\n");
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
36 write_uint8_array(linear_to_alaw, 1 << 14);
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
37 printf("};\n");
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
38
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
39 printf("static const uint8_t linear_to_ulaw[1 << 14] = {\n");
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
40 write_uint8_array(linear_to_ulaw, 1 << 14);
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
41 printf("};\n");
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
42
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
43 return 0;
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
44 }
7d324b40c3d6 Allow hardcoding of ulaw and alaw tables.
reimar
parents:
diff changeset
45