summaryrefslogtreecommitdiffstats
path: root/libSBRdec/src/sbr_scale.h
blob: b1614cb777dd158c0692c8b89db0db64401528f6 (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
/****************************************************************************

                     (C) Copyright Fraunhofer IIS (2005)
                               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.


   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.

 $Id$

*******************************************************************************/
/*!
\file
\brief Sbr scaling factors, $Revision: 36841 $
To deal with the dynamic range in the different processing stages, a
fixed point specific code has to rely on scaling factors. A floating
point code carries a scaling factor -- the exponent -- for each value,
so scaling is not necessary there.

The output of the core decoder (low band) is scaled up to cover as much
as possible bits for each value. As high band and low band are processed
in different algorithm sections, they require their own scaling
factors. In addition, any static buffers, e.g. filter states, require a
separate scaling factor as well. The code takes care to do the proper
adjustment, if scaling factors of a filter state and the time signal differ.

\sa #QMF_SCALE_FACTOR, \ref documentationOverview
*/

#ifndef __SBR_SCALE_H
#define __SBR_SCALE_H

/*!
\verbatim
  scale:
    0             left aligned e.g. |max| >=0.5
    FRACT_BITS-1  zero e.g |max| = 0
\endverbatim

  Dynamic scaling is used to achieve sufficient accuracy even when the signal
  energy is low.  The dynamic framing of SBR produces a variable overlap area
  where samples from the previous QMF-Analysis are stored. Depending on the
  start position and stop position of the current SBR envelopes, the processing
  buffer consists of differently scaled regions like illustrated in the below
  figure.

  \image html scales.png Scale
*/


#endif