~ubuntu-branches/ubuntu/trusty/libdv/trusty

« back to all changes in this revision

Viewing changes to libdv/bitstream.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2004-07-19 12:19:44 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040719121944-17vuryc01yeyx8hf
Tags: 0.103-2
* debian/rules: Provide separate doc directory for libdv4-dev.
* debian/libdv4-dev.links: No longer symlink doc dir to the one
  from libdv4.
* debian/NEWS: Only install into libdv4-dev. Closes: #259694

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 *  decoder.
13
13
 *
14
14
 *  libdv is free software; you can redistribute it and/or modify it
15
 
 *  under the terms of the GNU General Public License as published by
16
 
 *  the Free Software Foundation; either version 2, or (at your
 
15
 *  under the terms of the GNU Lesser Public License as published by
 
16
 *  the Free Software Foundation; either version 2.1, or (at your
17
17
 *  option) any later version.
18
18
 *   
19
19
 *  libdv is distributed in the hope that it will be useful, but
20
20
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
21
21
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22
 
 *  General Public License for more details.
 
22
 *  Lesser Public License for more details.
23
23
 *   
24
 
 *  You should have received a copy of the GNU General Public License
25
 
 *  along with GNU Make; see the file COPYING.  If not, write to
 
24
 *  You should have received a copy of the GNU Lesser Public License
 
25
 *  along with libdv; see the file COPYING.  If not, write to
26
26
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
27
27
 *
28
28
 *  The libdv homepage is http://libdv.sourceforge.net/.  
38
38
 
39
39
#include "bitstream.h"
40
40
 
41
 
void bitstream_next_buffer(bitstream_t * bs) {
 
41
void _dv_bitstream_next_buffer(bitstream_t * bs) {
42
42
  if (bs->bitstream_next_buffer) {
43
43
    bs->buflen = bs->bitstream_next_buffer(&bs->buf,bs->priv);
44
44
    bs->bufoffset = 0;
45
45
  }
46
46
}
47
47
 
48
 
void bitstream_byte_align(bitstream_t *bs) {
 
48
void _dv_bitstream_byte_align(bitstream_t *bs) {
49
49
  //byte align the bitstream
50
 
bs->bitsread += bs->bits_left & 7;
 
50
  bs->bitsread += bs->bits_left & 7;
51
51
  bs->bits_left = bs->bits_left & ~7;
52
52
  if (!bs->bits_left) {
53
53
    bs->current_word = bs->next_word;
56
56
  }
57
57
}
58
58
 
59
 
bitstream_t *bitstream_init() {
 
59
bitstream_t *_dv_bitstream_init() {
60
60
  bitstream_t *bs = (bitstream_t *)malloc(sizeof(bitstream_t));
61
61
  memset(bs,0,sizeof(bitstream_t));
62
62
 
63
63
  return bs;
64
64
}
65
65
 
66
 
void bitstream_set_fill_func(bitstream_t *bs,uint32_t (*next_function) (uint8_t **,void *),void *priv) {
 
66
void _dv_bitstream_set_fill_func(bitstream_t *bs,uint32_t (*next_function) (uint8_t **,void *),void *priv) {
67
67
  bs->bitstream_next_buffer = next_function;
68
68
  bs->priv = priv;
69
69
 
70
 
  bitstream_next_buffer(bs);
 
70
  _dv_bitstream_next_buffer(bs);
71
71
 
72
72
  bitstream_next_word(bs);
73
73
  bs->current_word = bs->next_word;
76
76
  bs->bitsread = 0;
77
77
}
78
78
 
79
 
void bitstream_new_buffer(bitstream_t *bs,uint8_t *buf,uint32_t len) {
 
79
void _dv_bitstream_new_buffer(bitstream_t *bs,uint8_t *buf,uint32_t len) {
80
80
  bs->buf = buf;
81
81
  bs->buflen = len;
82
82
  bs->bufoffset = 0;
88
88
  bs->bitsread = 0;
89
89
}
90
90
 
91
 
uint32_t bitstream_done(bitstream_t *bs) {
 
91
uint32_t _dv_bitstream_done(bitstream_t *bs) {
92
92
  //FIXME
93
93
  return 0;
94
94
}