$Id$ changes
[swftools.git] / lib / bladeenc / loop.h
1 /*
2                         (c) Copyright 1998-2000 - Tord Jansson
3                         ======================================
4
5                 This file is part of the BladeEnc MP3 Encoder, based on
6                 ISO's reference code for MPEG Layer 3 compression, and might
7                 contain smaller or larger sections that are directly taken
8                 from ISO's reference code.
9
10                 All changes to the ISO reference code herein are either
11                 copyrighted by Tord Jansson (tord.jansson@swipnet.se)
12                 or sublicensed to Tord Jansson by a third party.
13
14         BladeEnc is free software; you can redistribute this file
15         and/or modify it under the terms of the GNU Lesser General Public
16         License as published by the Free Software Foundation; either
17         version 2.1 of the License, or (at your option) any later version.
18
19
20
21         ------------    Changes    ------------
22
23         2000-12-11  Andre Piotrowski
24
25         -       reformatted, redesigned
26 */
27
28 /**********************************************************************
29  * ISO MPEG Audio Subgroup Software Simulation Group (1996)
30  * ISO 13818-3 MPEG-2 Audio Encoder - Lower Sampling Frequency Extension
31  *
32  * $Id: loop.h,v 1.1 2004/05/08 12:18:53 kramm Exp $
33  *
34  * $Log: loop.h,v $
35  * Revision 1.1  2004/05/08 12:18:53  kramm
36  * Version 0.94.1 of the bladeenc mp3 encoder
37  *
38  * Revision 1.1  2002/01/10 17:30:00  kramm
39  * Version 0.94.1 of the bladeenc mp3 encoder
40  *
41  * Revision 1.1  1996/02/14 04:04:23  rowlands
42  * Initial revision
43  *
44  * Received from Mike Coleman
45  **********************************************************************/
46
47 /**********************************************************************
48  *   date   programmers                comment                        *
49  * 25. 6.92  Toshiyuki Ishino          Ver 1.0                        *
50  * 29.10.92  Masahiro Iwadare          Ver 2.0                        *
51  * 17. 4.93  Masahiro Iwadare          Updated for IS Modification    *
52  *                                                                    *
53  *********************************************************************/
54
55 #ifndef         __LOOP__
56 #define         __LOOP__
57
58
59
60
61 #include "common.h"
62 #include "l3side.h"
63
64
65
66
67
68 /*      #define SBLIMIT                 32 */
69 #define CBLIMIT                 21
70
71 #define SFB_LMAX                22
72 #define SFB_SMAX                13
73
74
75
76
77 extern  int                             fInit_iteration_loop;
78 /* NOT NEEDED
79 extern  int                             fInit_huffman_read_flag;
80 */
81
82
83 extern  int                             pretab[];
84
85
86 struct  scalefac_struct
87 {
88         int l[23];
89         int s[14];
90 };
91
92 extern  struct scalefac_struct          sfBandIndex[];  /* Table B.8 -- in loop.c */
93
94
95
96
97
98 void                                    iteration_loop
99 (
100         double                                  pe[][2],
101         double                                  xr_org[2][2][576],
102         III_psy_ratio                   *ratio,
103         III_side_info_t                 *l3_side,
104         int                                             l3_enc[2][2][576],
105         int                                             mean_bits,
106         int                                             stereo,
107         double                                  xr_dec[2][2][576],
108         III_scalefac_t                  *scalefac,
109         frame_params                    *fr_ps,
110         int                                             ancillary_pad,
111         int                                             bitsPerFrame
112 );
113
114 int                                             my_nint (double in);
115
116 void                                    fixStatic_loop (void);
117
118 void                                    genNoisePowTab (void);
119
120
121
122
123
124 #endif          /* __LOOP__ */