M4MCS_InternalConfig.h revision 7c9d8018755adf1857571125ba1b3598c96ea506
1/*
2 * Copyright (C) 2004-2011 NXP Software
3 * Copyright (C) 2011 The Android Open Source Project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/**
19 *************************************************************************
20 * @file   M4MCS_API.h
21 * @brief  MCS internal constant values settings
22 * @note   This header file is not public
23 *************************************************************************
24 **/
25
26#ifndef __M4MCS_INTERNALCONFIG_H__
27#define __M4MCS_INTERNALCONFIG_H__
28
29
30/**
31 * Definition of max AU size */
32#define M4MCS_AUDIO_MAX_CHUNK_SIZE        7168 /**< add mp3 encoder and writer,
33                                                    max bitrate is now 320kbps instead of 128kbps
34                                                    so this value has to be increased accordingly
35                                                    = ((sizeof(M4OSA_UInt8)*max_channel_number)+3
36                                                    to take a margin(after tests, 2 was not enough
37                                                    ))*MAX_PCM_GRANULARITY_SAMPLES*/
38                                                    /**< Before: 4000*//**< Magical */
39
40/**
41 * Video max AU and fragment size */
42#define M4MCS_VIDEO_MIN_COMPRESSION_RATIO   0.8 /**< Magical. Used to define the max AU size */
43#define M4MCS_VIDEO_CHUNK_AU_SIZE_RATIO     1.2 /**< Magical. Used to define the max chunk size */
44
45/**
46 * Various Magicals */
47#define M4MCS_WRITER_AUDIO_STREAM_ID        1
48#define M4MCS_WRITER_VIDEO_STREAM_ID        2
49
50/**
51 * Granularity for audio encoder */
52 /**< minimum number of samples to pass in AMR encoding case */
53#define M4MCS_PCM_AMR_GRANULARITY_SAMPLES 160
54/**< minimum number of samples to pass in AAC encoding case */
55#define M4MCS_PCM_AAC_GRANULARITY_SAMPLES 1024
56/**< minimum number of samples to pass in MP3 encoding case */
57#define M4MCS_PCM_MP3_GRANULARITY_SAMPLES 576
58
59#define M4MCS_AUDIO_MAX_AU_SIZE           1024  /**< add mp3 encoder and writer
60                                                This value is not used anymore, now the max AU
61                                                size is computed dynamically according to the
62                                                number of channels,the max PCM granularity sample
63                                                and a margin.*/
64                                                /**< Before: 1024*//**< Magical */
65/**
66 * Writer file and moov size estimation */
67#define M4MCS_MOOV_OVER_FILESIZE_RATIO    1.04  /**< magical moov size is less than 4%
68                                                     of file size in average */
69
70/**
71 * If 3gp file does not contain an STSS table (no rap frames),
72   jump backward to a specified limit */
73#define M4MCS_NO_STSS_JUMP_POINT          40000 /**< 40 s */
74
75#endif /* __M4MCS_INTERNALCONFIG_H__ */
76
77