FFmpeg
Loading...
Searching...
No Matches
amr.h
Go to the documentation of this file.
1/*
2 * AMR storage format helpers
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef AVFORMAT_AMR_H
22#define AVFORMAT_AMR_H
23
24#include <stdint.h>
25
26#include "libavcodec/codec_id.h"
27
28/**
29 * Size of an RFC 4867 storage format frame, including its header byte.
30 *
31 * @return the size in bytes, or 0 for a reserved frame type
32 */
33static inline int ff_amr_frame_size(enum AVCodecID codec_id, int frame_type)
34{
35 static const uint8_t frame_size[2][16] = {
36 { 13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1 },
37 { 18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 0, 0, 0, 0, 1, 1 },
38 };
40}
41
42#endif /* AVFORMAT_AMR_H */
static const uint8_t frame_size[4]
Definition g723_1.h:222
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition codec_id.h:47
@ AV_CODEC_ID_AMR_WB
Definition codec_id.h:441
frame_type
static int ff_amr_frame_size(enum AVCodecID codec_id, int frame_type)
Size of an RFC 4867 storage format frame, including its header byte.
Definition amr.h:33
enum AVCodecID codec_id