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