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

« back to all changes in this revision

Viewing changes to mpeglib/lib/splay/synthesis.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
  header for synthesis
 
3
  Copyright (C) 2001  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
 
 
15
#include "synthesis.h"
 
16
 
 
17
Synthesis::Synthesis() {
 
18
 
 
19
  int i;
 
20
  outpos=0;
 
21
  calcbufferoffset=15;
 
22
  currentcalcbuffer=0;
 
23
 
 
24
  for(i=CALCBUFFERSIZE-1;i>=0;i--)
 
25
    calcbuffer[LS][0][i]=calcbuffer[LS][1][i]=
 
26
    calcbuffer[RS][0][i]=calcbuffer[RS][1][i]=0.0;
 
27
  
 
28
  initialize_dct64();
 
29
  initialize_dct64_downsample();
 
30
}
 
31
 
 
32
 
 
33
Synthesis::~Synthesis() {
 
34
}
 
35
 
 
36
 
 
37
void Synthesis::doSynth(int lDownSample,int lOutputStereo,
 
38
                        REAL *fractionL,REAL *fractionR) {
 
39
  switch(lDownSample) {
 
40
  case false:
 
41
    synth_Std(lOutputStereo,fractionL,fractionR);
 
42
    break;
 
43
  case true:
 
44
    synth_Down(lOutputStereo,fractionL,fractionR);
 
45
    break;
 
46
  default:
 
47
    cout << "unknown downsample parameter"<<lDownSample<<endl;
 
48
    exit(0);
 
49
  } 
 
50
}
 
51
 
 
52
  
 
53
void Synthesis::doMP3Synth(int lDownSample,int lOutputStereo,
 
54
                           REAL in[2][SSLIMIT][SBLIMIT]) {
 
55
 
 
56
  switch(lDownSample) {
 
57
  case false:
 
58
    synthMP3_Std(lOutputStereo,in);
 
59
    break;
 
60
  case true:
 
61
    synthMP3_Down(lOutputStereo,in);
 
62
    break;
 
63
  default:
 
64
    cout << "unknown downsample parameter:"<<lDownSample<<endl;
 
65
    exit(0);
 
66
  }
 
67
}
 
68
 
 
69