~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/splay/mpegAudioBitWindow.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  bitwindow class
 
3
  Copyright (C) 2000  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
#include "mpegAudioBitWindow.h"
 
15
 
 
16
 
 
17
 
 
18
 
 
19
 
 
20
 
 
21
int  MpegAudioBitWindow::getCanReadBits() {
 
22
  int p=bitindex>>3;
 
23
  int bytes=point - p;
 
24
  int bits=bytes*8+(bitindex&7);
 
25
  cout << "point:"<<point
 
26
       << " p:"<<p
 
27
       << " bytes:"<<bytes
 
28
       <<" bitindex:"<<bitindex<<" can read:"<<bits<<endl;
 
29
  return bits;
 
30
}
 
31
 
 
32
void MpegAudioBitWindow::wrap(void) {
 
33
  int p=bitindex>>3;
 
34
  point&=(WINDOWSIZE-1);
 
35
 
 
36
  if(p>=point) {
 
37
    for(register int i=4;i<point;i++)
 
38
      buffer[WINDOWSIZE+i]=buffer[i];
 
39
  }
 
40
  *((int *)(buffer+WINDOWSIZE))=*((int *)buffer);
 
41
}