aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nsmp3dec/polyphase.h
blob: 0d221274febcc5787b1e7bb8f6991b77bfd01ef8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*************************************************************************** *
*                    MPEG Layer3-Audio Decoder
*                  © 1997-2006 by Fraunhofer IIS
 *                        All Rights Reserved
 *
 *   filename: polyphase.h
 *   project : ISO/MPEG-Decoder
 *   author  : Stefan Gewinner
 *   date    : 1998-05-26
 *   contents/description: polyphase class - HEADER
 *
 *
\***************************************************************************/

/*
 * $Date: 2011/02/14 14:48:56 $
 * $Id: polyphase.h,v 1.6 2011/02/14 14:48:56 bigg Exp $
 */

#pragma once
//#ifndef __POLYPHASE_H__
//#define __POLYPHASE_H__

/* ------------------------ includes --------------------------------------*/

#include "mpeg.h"
#include "foundation/align.h"
/*-------------------------------------------------------------------------*/

#define HAN_SIZE 512

/*-------------------------------------------------------------------------*/

// Class for (inverse) Polyphase calculation.

class CPolyphase
{

public:

  CPolyphase(const MPEG_INFO &_info);

  ~CPolyphase() {}

  void Init();
  float *Apply(POLYSPECTRUM &sample, float *pPcm, int frms=18);
	static void Reorder(int channels, POLYSPECTRUM &output, const SPECTRUM &input);
protected:

  int   bufOffset;
	NALIGN(16) float syn_buf[2][HAN_SIZE];

  const MPEG_INFO &info ;      // info-structure

  void window_band_m(int bufOffset, float *out_samples) const;
  void window_band_s(int bufOffset, float *out_samples) const;
};

/*-------------------------------------------------------------------------*/
//#endif