]> git.sesse.net Git - vlc/blob - include/lpcm_decoder.h
Ajout des fichiers pour la gestion du lpcm.
[vlc] / include / lpcm_decoder.h
1 /*****************************************************************************
2  * lpcm_decoder.h : lpcm decoder interface
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  *
6  * Authors:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public
19  * License along with this program; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *****************************************************************************/
23
24 typedef struct lpcmdec_s lpcmdec_t;
25
26 typedef struct lpcm_sync_info_s {
27     int sample_rate;    /* sample rate in Hz */
28     int frame_size;     /* frame size in bytes */
29     int bit_rate;       /* nominal bit rate in kbps */
30 } lpcm_sync_info_t;
31
32 typedef struct lpcm_byte_stream_s {
33     u8 * p_byte;
34     u8 * p_end;
35     void * info;
36 } lpcm_byte_stream_t;
37
38
39 int lpcm_init (lpcmdec_t * p_lpcmdec);
40 int lpcm_sync_frame (lpcmdec_t * p_lpcmdec, lpcm_sync_info_t * p_sync_info);
41 int lpcm_decode_frame (lpcmdec_t * p_lcpmdec, s16 * buffer);
42 //static lpcm_byte_stream_t * lpcm_byte_stream (lcpmdec_t * p_lpcmdec);
43
44
45 void lpcm_byte_stream_next (lpcm_byte_stream_t * p_byte_stream);
46
47 typedef struct lpcm_bit_stream_s {
48     u32 buffer;
49     int i_available;
50     lpcm_byte_stream_t byte_stream;
51
52 } lpcm_bit_stream_t;
53
54 struct lpcmdec_s {
55     /*
56      * Input properties
57      */
58
59     /* The bit stream structure handles the PES stream at the bit level */
60     lpcm_bit_stream_t   bit_stream;
61 };
62
63
64 static lpcm_byte_stream_t * lpcm_byte_stream (lpcmdec_t * p_lpcmdec)
65 {
66     return &(p_lpcmdec->bit_stream.byte_stream);
67 }