summaryrefslogtreecommitdiffstats
path: root/libAACdec/src/conceal_types.h
blob: 5b5eb81a7dfae800515a8747b38b7b0d41d436ab (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*****************************  MPEG-4 AAC Decoder  **************************

                        (C) Copyright Fraunhofer IIS (2004)
                               All Rights Reserved

    Please be advised that this software and/or program delivery is
    Confidential Information of Fraunhofer and subject to and covered by the

    Fraunhofer IIS Software Evaluation Agreement
    between Google Inc. and  Fraunhofer
    effective and in full force since March 1, 2012.

    You may use this software and/or program only under the terms and
    conditions described in the above mentioned Fraunhofer IIS Software
    Evaluation Agreement. Any other and/or further use requires a separate agreement.


   $Id$
   Author(s):   Christian Griebel
   Description: Error concealment structs and types

   This software and/or program is protected by copyright law and international
   treaties. Any reproduction or distribution of this software and/or program,
   or any portion of it, may result in severe civil and criminal penalties, and
   will be prosecuted to the maximum extent possible under law.

******************************************************************************/

#ifndef CONCEAL_TYPES_H
#define CONCEAL_TYPES_H



#include "machine_type.h"
#include "common_fix.h"

#include "rvlc_info.h"


#define CONCEAL_MAX_NUM_FADE_FACTORS      ( 16 )

 #define FIXP_CNCL        FIXP_DBL
 #define FL2FXCONST_CNCL  FL2FXCONST_DBL
 #define FX_DBL2FX_CNCL
 #define FX_CNCL2FX_DBL
 #define CNCL_FRACT_BITS  DFRACT_BITS

/* Warning: Do not ever change these values. */
typedef enum
{
  ConcealMethodNone  = -1,
  ConcealMethodMute  =  0,
  ConcealMethodNoise =  1,
  ConcealMethodInter =  2,
  ConcealMethodTonal =  3

} CConcealmentMethod;


typedef enum
{
  ConcealState_Ok,
  ConcealState_Single,
  ConcealState_FadeIn,
  ConcealState_Mute,
  ConcealState_FadeOut

} CConcealmentState;


typedef struct
{
  FIXP_SGL  fadeOutFactor[CONCEAL_MAX_NUM_FADE_FACTORS];
  FIXP_SGL  fadeInFactor [CONCEAL_MAX_NUM_FADE_FACTORS];

  CConcealmentMethod  method;

  int  numFadeOutFrames;
  int  numFadeInFrames;
  int  numMuteReleaseFrames;
  int  comfortNoiseLevel;

} CConcealParams;



typedef struct
{
  CConcealParams *pConcealParams;

  FIXP_CNCL spectralCoefficient[1024];
  SHORT     specScale[8];

  INT    iRandomPhase;
  INT    prevFrameOk[2];
  INT    cntFadeFrames;
  INT    cntValidFrames;

  SHORT aRvlcPreviousScaleFactor[RVLC_MAX_SFB];  /* needed once per channel */
  UCHAR aRvlcPreviousCodebook[RVLC_MAX_SFB];     /* needed once per channel */
  SCHAR rvlcPreviousScaleFactorOK;
  SCHAR rvlcPreviousBlockType;


  SCHAR  lastRenderMode;

  UCHAR  windowShape;
  UCHAR  windowSequence;
  UCHAR  lastWinGrpLen;

  CConcealmentState concealState;

} CConcealmentInfo;


#endif /* #ifndef CONCEAL_TYPES_H */