~ubuntu-branches/debian/jessie/scummvm/jessie

« back to all changes in this revision

Viewing changes to common/dct.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-08-10 00:50:36 UTC
  • mfrom: (1.2.22)
  • Revision ID: package-import@ubuntu.com-20140810005036-wls6i0dsxqfxu70g
Tags: 1.7.0+dfsg-1
* New upstream release [July 2014].
  - remove old/obsolete patches.
  + added new "drop1test.patch" to disable problematic test.
  + build with "--disable-eventrecorder" to avoid FTBFS in tests.
  + added "libjpeg-dev" and "libfaad-dev" to Build-Depends.
* Install all arch-independent files (themes, game data, etc.).
* Build-time re-compression of "classic" theme.
* Added "debian/gbp.conf".
* Standards-Version to 3.9.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 * modify it under the terms of the GNU General Public License
9
9
 * as published by the Free Software Foundation; either version 2
10
10
 * of the License, or (at your option) any later version.
11
 
 
 
11
 *
12
12
 * This program is distributed in the hope that it will be useful,
13
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
15
 * GNU General Public License for more details.
16
 
 
 
16
 *
17
17
 * You should have received a copy of the GNU General Public License
18
18
 * along with this program; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
73
73
void DCT::calcDCTI(float *data) {
74
74
        int n = 1 << _bits;
75
75
 
76
 
        float next = -0.5 * (data[0] - data[n]);
 
76
        float next = -0.5f * (data[0] - data[n]);
77
77
 
78
78
        for (int i = 0; i < (n / 2); i++) {
79
79
                float tmp1 = data[i    ];
87
87
 
88
88
                next += c;
89
89
 
90
 
                tmp1 = (tmp1 + tmp2) * 0.5;
 
90
                tmp1 = (tmp1 + tmp2) * 0.5f;
91
91
 
92
92
                data[i    ] = tmp1 - s;
93
93
                data[n - i] = tmp1 + s;
113
113
 
114
114
                s *= tmp1 - tmp2;
115
115
 
116
 
                tmp1 = (tmp1 + tmp2) * 0.5;
 
116
                tmp1 = (tmp1 + tmp2) * 0.5f;
117
117
 
118
118
                data[i        ] = tmp1 + s;
119
119
                data[n - i - 1] = tmp1 - s;
121
121
 
122
122
        _rdft->calc(data);
123
123
 
124
 
        float next = data[1] * 0.5;
 
124
        float next = data[1] * 0.5f;
125
125
 
126
126
        data[1] *= -1;
127
127
 
143
143
        int n = 1 << _bits;
144
144
 
145
145
        float next  = data[n - 1];
146
 
        float inv_n = 1.0 / n;
 
146
        float inv_n = 1.0f / n;
147
147
 
148
148
        for (int i = n - 2; i >= 2; i -= 2) {
149
149
                float val1 = data[i    ];
184
184
                float s = SIN(n, 2 * i);
185
185
 
186
186
                s   *=  tmp1 + tmp2;
187
 
                tmp1 = (tmp1 - tmp2) * 0.5;
 
187
                tmp1 = (tmp1 - tmp2) * 0.5f;
188
188
 
189
189
                data[i    ] = s + tmp1;
190
190
                data[n - i] = s - tmp1;
194
194
 
195
195
        _rdft->calc(data);
196
196
 
197
 
        data[0] *= 0.5;
 
197
        data[0] *= 0.5f;
198
198
 
199
199
        for (int i = 1; i < (n - 2); i += 2) {
200
200
                data[i + 1] +=  data[i - 1];