[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / cores / AudioEngine / Utils / AEConvert.h
1 #pragma once
2 /*
3  *      Copyright (C) 2010-2013 Team XBMC
4  *      http://xbmc.org
5  *
6  *  This Program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This Program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with XBMC; see the file COPYING.  If not, see
18  *  <http://www.gnu.org/licenses/>.
19  *
20  */
21
22 #include <stdint.h>
23 #include "../AEAudioFormat.h"
24
25 class CAEConvert{
26 private:
27   static unsigned int U8_Float    (uint8_t *data, const unsigned int samples, float   *dest);
28   static unsigned int S8_Float    (uint8_t *data, const unsigned int samples, float   *dest);
29   static unsigned int S16LE_Float (uint8_t *data, const unsigned int samples, float   *dest);
30   static unsigned int S16BE_Float (uint8_t *data, const unsigned int samples, float   *dest);
31   static unsigned int S24LE4_Float(uint8_t *data, const unsigned int samples, float   *dest);
32   static unsigned int S24BE4_Float(uint8_t *data, const unsigned int samples, float   *dest);
33   static unsigned int S24LE3_Float(uint8_t *data, const unsigned int samples, float   *dest);
34   static unsigned int S24BE3_Float(uint8_t *data, const unsigned int samples, float   *dest);
35   static unsigned int S32LE_Float (uint8_t *data, const unsigned int samples, float   *dest);
36   static unsigned int S32BE_Float (uint8_t *data, const unsigned int samples, float   *dest);
37   static unsigned int DOUBLE_Float(uint8_t *data, const unsigned int samples, float   *dest);
38
39   static unsigned int Float_U8    (float   *data, const unsigned int samples, uint8_t *dest);
40   static unsigned int Float_S8    (float   *data, const unsigned int samples, uint8_t *dest);
41   static unsigned int Float_S16LE (float   *data, const unsigned int samples, uint8_t *dest);
42   static unsigned int Float_S16BE (float   *data, const unsigned int samples, uint8_t *dest);
43   static unsigned int Float_S24NE4(float   *data, const unsigned int samples, uint8_t *dest);
44   static unsigned int Float_S24NE3(float   *data, const unsigned int samples, uint8_t *dest);
45   static unsigned int Float_S32LE (float   *data, const unsigned int samples, uint8_t *dest);
46   static unsigned int Float_S32BE (float   *data, const unsigned int samples, uint8_t *dest);
47   static unsigned int Float_DOUBLE(float   *data, const unsigned int samples, uint8_t *dest);
48
49   static unsigned int S32LE_Float_Neon (uint8_t *data, const unsigned int samples, float   *dest);
50   static unsigned int S32BE_Float_Neon (uint8_t *data, const unsigned int samples, float   *dest);
51   static unsigned int Float_S32LE_Neon (float   *data, const unsigned int samples, uint8_t *dest);
52   static unsigned int Float_S32BE_Neon (float   *data, const unsigned int samples, uint8_t *dest);
53
54 public:
55   typedef unsigned int (*AEConvertToFn)(uint8_t *data, const unsigned int samples, float   *dest);
56   typedef unsigned int (*AEConvertFrFn)(float   *data, const unsigned int samples, uint8_t *dest);
57
58   static AEConvertToFn ToFloat(enum AEDataFormat dataFormat);
59   static AEConvertFrFn FrFloat(enum AEDataFormat dataFormat);
60 };
61