psy_data.h revision e2e838afcf03e603a41a0455846eaf9614537c16
1/*
2 ** Copyright 2003-2010, VisualOn, Inc.
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 **     http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16/*******************************************************************************
17	File:		psy_data.h
18
19	Content:	Psychoacoustic data and structures
20
21*******************************************************************************/
22
23#ifndef _PSY_DATA_H
24#define _PSY_DATA_H
25
26#include "block_switch.h"
27#include "tns.h"
28
29/*
30  the structs can be implemented as unions
31*/
32
33typedef struct{
34  Word32 sfbLong[MAX_GROUPED_SFB];
35  Word32 sfbShort[TRANS_FAC][MAX_SFB_SHORT];
36}SFB_THRESHOLD; /* Word16 size: 260 */
37
38typedef struct{
39  Word32 sfbLong[MAX_GROUPED_SFB];
40  Word32 sfbShort[TRANS_FAC][MAX_SFB_SHORT];
41}SFB_ENERGY; /* Word16 size: 260 */
42
43typedef struct{
44  Word32 sfbLong;
45  Word32 sfbShort[TRANS_FAC];
46}SFB_ENERGY_SUM; /* Word16 size: 18 */
47
48
49typedef struct{
50  BLOCK_SWITCHING_CONTROL   blockSwitchingControl;          /* block switching */
51  Word16                    *mdctDelayBuffer;               /* mdct delay buffer [BLOCK_SWITCHING_OFFSET]*/
52  Word32                    sfbThresholdnm1[MAX_SFB];       /* PreEchoControl */
53  Word16                    mdctScalenm1;                   /* scale of last block's mdct (PreEchoControl) */
54
55  SFB_THRESHOLD             sfbThreshold;                   /* adapt           */
56  SFB_ENERGY                sfbEnergy;                      /* sfb Energy      */
57  SFB_ENERGY                sfbEnergyMS;
58  SFB_ENERGY_SUM            sfbEnergySum;
59  SFB_ENERGY_SUM            sfbEnergySumMS;
60  SFB_ENERGY                sfbSpreadedEnergy;
61
62  Word32                    *mdctSpectrum;                  /* mdct spectrum [FRAME_LEN_LONG] */
63  Word16                    mdctScale;                      /* scale of mdct   */
64}PSY_DATA; /* Word16 size: 4 + 87 + 102 + 360 + 360 + 360 + 18 + 18 + 360 = 1669 */
65
66#endif /* _PSY_DATA_H */
67