dts.h

00001 /*
00002  * dts.h
00003  * Copyright (C) 2004 Gildas Bazin <[email protected]>
00004  *
00005  * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
00006  * See http://www.videolan.org/dtsdec.html for updates.
00007  *
00008  * dtsdec is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * dtsdec is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 
00023 #ifndef DTS_H
00024 #define DTS_H
00025 
00026 #define LIBDTS_DOUBLE
00027 
00028 # ifdef __cplusplus
00029 extern "C" {
00030 # endif
00031 
00032 #if defined(LIBDTS_FIXED)
00033 typedef int32_t sample_t;
00034 typedef int32_t level_t;
00035 #elif defined(LIBDTS_DOUBLE)
00036 typedef double sample_t;
00037 typedef double level_t;
00038 #else
00039 typedef float sample_t;
00040 typedef float level_t;
00041 #endif
00042 
00043 typedef struct dts_state_s dts_state_t;
00044 
00045 #define DTS_MONO 0
00046 #define DTS_CHANNEL 1
00047 #define DTS_STEREO 2
00048 #define DTS_STEREO_SUMDIFF 3
00049 #define DTS_STEREO_TOTAL 4
00050 #define DTS_3F 5
00051 #define DTS_2F1R 6
00052 #define DTS_3F1R 7
00053 #define DTS_2F2R 8
00054 #define DTS_3F2R 9
00055 #define DTS_4F2R 10
00056 
00057 #define DTS_DOLBY 101 /* FIXME */
00058 
00059 #define DTS_CHANNEL_MAX  DTS_3F2R /* We don't handle anything above that */
00060 #define DTS_CHANNEL_BITS 6
00061 #define DTS_CHANNEL_MASK 0x3F
00062 
00063 #define DTS_LFE 0x80
00064 #define DTS_ADJUST_LEVEL 0x100
00065 
00066 dts_state_t * dts_init (uint32_t mm_accel);
00067 
00068 int dts_syncinfo (dts_state_t *state, uint8_t * buf, int * flags,
00069                   int * sample_rate, int * bit_rate, int *frame_length);
00070 
00071 int dts_frame (dts_state_t * state, uint8_t * buf, int * flags,
00072                level_t * level, sample_t bias);
00073 
00074 void dts_dynrng (dts_state_t * state,
00075                  level_t (* call) (level_t, void *), void * data);
00076 
00077 int dts_blocks_num (dts_state_t * state);
00078 int dts_block (dts_state_t * state);
00079 
00080 sample_t * dts_samples (dts_state_t * state);
00081 
00082 void dts_free (dts_state_t * state);
00083 
00084 # ifdef __cplusplus
00085 }
00086 # endif
00087 
00088 #endif /* DTS_H */

Generated on Tue Dec 13 14:47:27 2005 for guliverkli by  doxygen 1.4.5