libavcodec/mpeg4audio.h
Go to the documentation of this file.
00001 /*
00002  * MPEG-4 Audio common header
00003  * Copyright (c) 2008 Baptiste Coudurier <baptiste.coudurier@free.fr>
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  */
00021 
00022 #ifndef AVCODEC_MPEG4AUDIO_H
00023 #define AVCODEC_MPEG4AUDIO_H
00024 
00025 #include <stdint.h>
00026 #include "get_bits.h"
00027 #include "put_bits.h"
00028 
00029 typedef struct {
00030     int object_type;
00031     int sampling_index;
00032     int sample_rate;
00033     int chan_config;
00034     int sbr; 
00035     int ext_object_type;
00036     int ext_sampling_index;
00037     int ext_sample_rate;
00038     int ext_chan_config;
00039     int channels;
00040     int ps;  
00041 } MPEG4AudioConfig;
00042 
00043 extern const int avpriv_mpeg4audio_sample_rates[16];
00044 extern const uint8_t ff_mpeg4audio_channels[8];
00045 
00054 int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
00055                                  int bit_size, int sync_extension);
00056 
00057 enum AudioObjectType {
00058     AOT_NULL,
00059                                // Support?                Name
00060     AOT_AAC_MAIN,              
00061     AOT_AAC_LC,                
00062     AOT_AAC_SSR,               
00063     AOT_AAC_LTP,               
00064     AOT_SBR,                   
00065     AOT_AAC_SCALABLE,          
00066     AOT_TWINVQ,                
00067     AOT_CELP,                  
00068     AOT_HVXC,                  
00069     AOT_TTSI             = 12, 
00070     AOT_MAINSYNTH,             
00071     AOT_WAVESYNTH,             
00072     AOT_MIDI,                  
00073     AOT_SAFX,                  
00074     AOT_ER_AAC_LC,             
00075     AOT_ER_AAC_LTP       = 19, 
00076     AOT_ER_AAC_SCALABLE,       
00077     AOT_ER_TWINVQ,             
00078     AOT_ER_BSAC,               
00079     AOT_ER_AAC_LD,             
00080     AOT_ER_CELP,               
00081     AOT_ER_HVXC,               
00082     AOT_ER_HILN,               
00083     AOT_ER_PARAM,              
00084     AOT_SSC,                   
00085     AOT_PS,                    
00086     AOT_SURROUND,              
00087     AOT_ESCAPE,                
00088     AOT_L1,                    
00089     AOT_L2,                    
00090     AOT_L3,                    
00091     AOT_DST,                   
00092     AOT_ALS,                   
00093     AOT_SLS,                   
00094     AOT_SLS_NON_CORE,          
00095     AOT_ER_AAC_ELD,            
00096     AOT_SMR_SIMPLE,            
00097     AOT_SMR_MAIN,              
00098     AOT_USAC_NOSBR,            
00099     AOT_SAOC,                  
00100     AOT_LD_SURROUND,           
00101     AOT_USAC,                  
00102 };
00103 
00104 #define MAX_PCE_SIZE 304 ///<Maximum size of a PCE including the 3-bit ID_PCE
00105 
00106 
00107 int avpriv_copy_pce_data(PutBitContext *pb, GetBitContext *gb);
00108 
00109 #endif /* AVCODEC_MPEG4AUDIO_H */