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