@vunk/plus 1.6.7 → 1.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/SendOutlined.mjs +8 -6
- package/components/SharedSystems.mjs +290 -72
- package/components/WebGLRenderer.mjs +32 -20
- package/components/WebGPURenderer.mjs +48 -10
- package/components/agent-chat-provider/index.d.ts +7 -0
- package/components/agent-chat-provider/index.mjs +7 -4
- package/components/agent-chat-provider/src/api.d.ts +3 -0
- package/components/agent-chat-provider/src/const-roles.d.ts +8 -0
- package/components/agent-chat-provider/src/const.d.ts +1 -0
- package/components/agent-chat-provider/src/index.vue.d.ts +22 -0
- package/components/agent-chat-provider/src/types.d.ts +50 -0
- package/components/agent-chat-provider/src/use.d.ts +5 -0
- package/components/avatar/index.d.ts +4 -0
- package/components/avatar/index.mjs +2 -2
- package/components/avatar/src/ctx.d.ts +6 -0
- package/components/avatar/src/index.vue.d.ts +180 -0
- package/components/avatar/src/types.d.ts +1 -0
- package/components/broadcasting-markdown/index.d.ts +7 -0
- package/components/broadcasting-markdown/index.mjs +78 -158
- package/components/broadcasting-markdown/src/const.d.ts +13 -0
- package/components/broadcasting-markdown/src/ctx.d.ts +129 -0
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +104 -0
- package/components/broadcasting-markdown/src/index.vue.d.ts +439 -0
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +79 -0
- package/components/broadcasting-markdown/src/speech-error.vue.d.ts +67 -0
- package/components/broadcasting-markdown/src/types.d.ts +26 -0
- package/components/broadcasting-markdown/src/use.d.ts +21 -0
- package/components/browserAll.mjs +333 -562
- package/components/bubble-list/index.d.ts +5 -0
- package/components/bubble-list/index.mjs +91 -72
- package/components/bubble-list/src/ctx.d.ts +32 -0
- package/components/bubble-list/src/index.vue.d.ts +810 -0
- package/components/bubble-list/src/types.d.ts +4 -0
- package/components/bubble-templates/index.d.ts +4 -0
- package/components/bubble-templates/index.mjs +83 -68
- package/components/bubble-templates/src/index.vue.d.ts +595 -0
- package/components/bubble-templates/src/types.d.ts +40 -0
- package/components/chat-independent/index.d.ts +4 -0
- package/components/chat-independent/index.mjs +136 -115
- package/components/chat-independent/src/const.d.ts +13 -0
- package/components/chat-independent/src/ctx.d.ts +21 -0
- package/components/chat-independent/src/index.vue.d.ts +2429 -0
- package/components/chat-independent/src/types.d.ts +13 -0
- package/components/colorToUniform.mjs +2 -0
- package/components/index.d.ts +0 -0
- package/components/index2.mjs +11896 -8381
- package/components/init.mjs +1724 -998
- package/components/lottie-animation/index.d.ts +4 -0
- package/components/lottie-animation/index.mjs +2 -2
- package/components/lottie-animation/src/ctx.d.ts +10 -0
- package/components/lottie-animation/src/index.vue.d.ts +21 -0
- package/components/lottie-animation/src/types.d.ts +4 -0
- package/components/metahuman-broadcasting/index.d.ts +5 -0
- package/components/metahuman-broadcasting/index.mjs +57 -40
- package/components/metahuman-broadcasting/src/ctx.d.ts +57 -0
- package/components/metahuman-broadcasting/src/index.vue.d.ts +885 -0
- package/components/metahuman-broadcasting/src/types.d.ts +1 -0
- package/components/monaco-editor/index.d.ts +5 -0
- package/components/monaco-editor/index.mjs +2 -2
- package/components/monaco-editor/src/ctx.d.ts +23 -0
- package/components/monaco-editor/src/index.vue.d.ts +40 -0
- package/components/monaco-editor/src/types.d.ts +1 -0
- package/components/monaco-environment/index.d.ts +4 -0
- package/components/monaco-environment/index.mjs +1 -1
- package/components/monaco-environment/src/ctx.d.ts +8 -0
- package/components/monaco-environment/src/index.vue.d.ts +2 -0
- package/components/monaco-environment/src/types.d.ts +1 -0
- package/components/pixi-frame/index.d.ts +11 -0
- package/components/pixi-frame/index.mjs +2 -2
- package/components/pixi-frame/src/apng.vue.d.ts +161 -0
- package/components/pixi-frame/src/bitmap.vue.d.ts +158 -0
- package/components/pixi-frame/src/core.vue.d.ts +173 -0
- package/components/pixi-frame/src/ctx.d.ts +55 -0
- package/components/pixi-frame/src/index.vue.d.ts +591 -0
- package/components/pixi-frame/src/provider.vue.d.ts +2 -0
- package/components/pixi-frame/src/types.d.ts +17 -0
- package/components/pixi-frame/src/use.d.ts +16 -0
- package/components/pixi-frame/src/useSprite.d.ts +12 -0
- package/components/pixi-frame/src/video.vue.d.ts +159 -0
- package/components/pixi-frame/src/view.vue.d.ts +29 -0
- package/components/recorder-button/index.d.ts +4 -0
- package/components/recorder-button/index.mjs +2 -2
- package/components/recorder-button/src/ctx.d.ts +41 -0
- package/components/recorder-button/src/index.vue.d.ts +333 -0
- package/components/recorder-button/src/speech-to-text.d.ts +1 -0
- package/components/recorder-button/src/types.d.ts +7 -0
- package/components/routes-menu-content/index.d.ts +4 -0
- package/components/routes-menu-content/index.mjs +5 -5
- package/components/routes-menu-content/src/ctx.d.ts +17 -0
- package/components/routes-menu-content/src/index.vue.d.ts +350 -0
- package/components/routes-menu-content/src/item/core/ctx.d.ts +18 -0
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +185 -0
- package/components/routes-menu-content/src/item/ctx.d.ts +14 -0
- package/components/routes-menu-content/src/item/index.vue.d.ts +316 -0
- package/components/routes-menu-content/src/types.d.ts +1 -0
- package/components/sender/index.css +0 -8
- package/components/sender/index.d.ts +4 -0
- package/components/sender/index.mjs +101 -69
- package/components/sender/src/SenderHeader.vue.d.ts +270 -0
- package/components/sender/src/ctx.d.ts +64 -0
- package/components/sender/src/index.vue.d.ts +779 -0
- package/components/sender/src/types.d.ts +1 -0
- package/components/speech-button/index.d.ts +4 -0
- package/components/speech-button/index.mjs +14 -7
- package/components/speech-button/src/LoadingIcon.vue.d.ts +2 -0
- package/components/speech-button/src/RecordingIcon.vue.d.ts +2 -0
- package/components/speech-button/src/ctx.d.ts +10 -0
- package/components/speech-button/src/index.vue.d.ts +22 -0
- package/components/speech-button/src/types.d.ts +1 -0
- package/components/table-columns/index.d.ts +5 -0
- package/components/table-columns/index.mjs +6 -3
- package/components/table-columns/src/ctx.d.ts +59 -0
- package/components/table-columns/src/el-ctx.d.ts +57 -0
- package/components/table-columns/src/index.vue.d.ts +266 -0
- package/components/table-columns/src/types.d.ts +21 -0
- package/components/tables-v1/index.d.ts +5 -0
- package/components/tables-v1/index.mjs +3 -3
- package/components/tables-v1/src/ctx.d.ts +280 -0
- package/components/tables-v1/src/el-ctx.d.ts +262 -0
- package/components/tables-v1/src/index.vue.d.ts +3054 -0
- package/components/tables-v1/src/types.d.ts +3 -0
- package/components/tables-v1-checkbox/index.d.ts +5 -0
- package/components/tables-v1-checkbox/index.mjs +33 -269
- package/components/tables-v1-checkbox/src/ctx.d.ts +313 -0
- package/components/tables-v1-checkbox/src/index.vue.d.ts +3831 -0
- package/components/tables-v1-checkbox/src/types.d.ts +1 -0
- package/components/text/index.d.ts +4 -0
- package/components/text/index.mjs +52 -42
- package/components/text/src/ctx.d.ts +341 -0
- package/components/text/src/index.vue.d.ts +4593 -0
- package/components/text/src/types.d.ts +1 -0
- package/components/typing-markdown/index.d.ts +4 -0
- package/components/typing-markdown/index.mjs +2 -2
- package/components/typing-markdown/src/core.d.ts +2 -0
- package/components/typing-markdown/src/ctx.d.ts +41 -0
- package/components/typing-markdown/src/index.vue.d.ts +75 -0
- package/components/typing-markdown/src/types.d.ts +1 -0
- package/components/vditor/index.d.ts +5 -0
- package/components/vditor/index.mjs +9 -5
- package/components/vditor/src/ctx.d.ts +38 -0
- package/components/vditor/src/handle-fullscreen.vue.d.ts +18 -0
- package/components/vditor/src/handle-value.vue.d.ts +18 -0
- package/components/vditor/src/index.vue.d.ts +143 -0
- package/components/vditor/src/types.d.ts +9 -0
- package/components/vditor/src/use.d.ts +4 -0
- package/components/webworkerAll.mjs +1 -1
- package/composables/el-breakpoints/index.d.ts +5 -5
- package/composables/recorder/index.mjs +191 -288
- package/icons/end/index.mjs +3 -3
- package/icons/end/src/avatar.d.ts +2 -11
- package/icons/end/src/icon.d.ts +2 -56
- package/icons/keyboard/index.mjs +3 -3
- package/icons/keyboard/src/avatar.d.ts +2 -11
- package/icons/keyboard/src/icon.d.ts +2 -56
- package/icons/start/index.mjs +3 -3
- package/icons/start/src/avatar.d.ts +2 -11
- package/icons/start/src/icon.d.ts +2 -56
- package/icons/voice/index.mjs +2 -2
- package/icons/voice/src/avatar.d.ts +2 -11
- package/icons/voice/src/icon.d.ts +2 -56
- package/index.css +0 -8
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { noop } from '@vunk/shared/function';
|
|
2
|
-
import {
|
|
2
|
+
import { waiting, sleep } from '@vunk/shared/promise';
|
|
3
3
|
import { ref, shallowRef, unref } from 'vue';
|
|
4
4
|
|
|
5
5
|
const LogLevels = {
|
|
6
|
+
silent: Number.NEGATIVE_INFINITY,
|
|
6
7
|
fatal: 0,
|
|
7
8
|
error: 0,
|
|
8
9
|
warn: 1,
|
|
@@ -10,6 +11,9 @@ const LogLevels = {
|
|
|
10
11
|
info: 3,
|
|
11
12
|
success: 3,
|
|
12
13
|
fail: 3,
|
|
14
|
+
ready: 3,
|
|
15
|
+
start: 3,
|
|
16
|
+
box: 3,
|
|
13
17
|
debug: 4,
|
|
14
18
|
trace: 5,
|
|
15
19
|
verbose: Number.POSITIVE_INFINITY
|
|
@@ -67,25 +71,11 @@ const LogTypes = {
|
|
|
67
71
|
}
|
|
68
72
|
};
|
|
69
73
|
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
const prototype = Object.getPrototypeOf(value);
|
|
75
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
if (Symbol.iterator in value) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
if (Symbol.toStringTag in value) {
|
|
82
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
83
|
-
}
|
|
84
|
-
return true;
|
|
74
|
+
function isObject(value) {
|
|
75
|
+
return value !== null && typeof value === "object";
|
|
85
76
|
}
|
|
86
|
-
|
|
87
77
|
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
88
|
-
if (!
|
|
78
|
+
if (!isObject(defaults)) {
|
|
89
79
|
return _defu(baseObject, {}, namespace);
|
|
90
80
|
}
|
|
91
81
|
const object = Object.assign({}, defaults);
|
|
@@ -99,7 +89,7 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
|
99
89
|
}
|
|
100
90
|
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
101
91
|
object[key] = [...value, ...object[key]];
|
|
102
|
-
} else if (
|
|
92
|
+
} else if (isObject(value) && isObject(object[key])) {
|
|
103
93
|
object[key] = _defu(
|
|
104
94
|
value,
|
|
105
95
|
object[key],
|
|
@@ -137,14 +127,6 @@ function isLogObj(arg) {
|
|
|
137
127
|
let paused = false;
|
|
138
128
|
const queue = [];
|
|
139
129
|
class Consola {
|
|
140
|
-
options;
|
|
141
|
-
_lastLog;
|
|
142
|
-
_mockFn;
|
|
143
|
-
/**
|
|
144
|
-
* Creates an instance of Consola with specified options or defaults.
|
|
145
|
-
*
|
|
146
|
-
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
147
|
-
*/
|
|
148
130
|
constructor(options = {}) {
|
|
149
131
|
const types = options.types || LogTypes;
|
|
150
132
|
this.options = defu(
|
|
@@ -182,19 +164,9 @@ class Consola {
|
|
|
182
164
|
}
|
|
183
165
|
this._lastLog = {};
|
|
184
166
|
}
|
|
185
|
-
/**
|
|
186
|
-
* Gets the current log level of the Consola instance.
|
|
187
|
-
*
|
|
188
|
-
* @returns {number} The current log level.
|
|
189
|
-
*/
|
|
190
167
|
get level() {
|
|
191
168
|
return this.options.level;
|
|
192
169
|
}
|
|
193
|
-
/**
|
|
194
|
-
* Sets the minimum log level that will be output by the instance.
|
|
195
|
-
*
|
|
196
|
-
* @param {number} level - The new log level to set.
|
|
197
|
-
*/
|
|
198
170
|
set level(level) {
|
|
199
171
|
this.options.level = _normalizeLogLevel(
|
|
200
172
|
level,
|
|
@@ -202,27 +174,12 @@ class Consola {
|
|
|
202
174
|
this.options.level
|
|
203
175
|
);
|
|
204
176
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Displays a prompt to the user and returns the response.
|
|
207
|
-
* Throw an error if `prompt` is not supported by the current configuration.
|
|
208
|
-
*
|
|
209
|
-
* @template T
|
|
210
|
-
* @param {string} message - The message to display in the prompt.
|
|
211
|
-
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
212
|
-
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
213
|
-
*/
|
|
214
177
|
prompt(message, opts) {
|
|
215
178
|
if (!this.options.prompt) {
|
|
216
179
|
throw new Error("prompt is not supported!");
|
|
217
180
|
}
|
|
218
181
|
return this.options.prompt(message, opts);
|
|
219
182
|
}
|
|
220
|
-
/**
|
|
221
|
-
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
222
|
-
*
|
|
223
|
-
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
224
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
225
|
-
*/
|
|
226
183
|
create(options) {
|
|
227
184
|
const instance = new Consola({
|
|
228
185
|
...this.options,
|
|
@@ -233,12 +190,6 @@ class Consola {
|
|
|
233
190
|
}
|
|
234
191
|
return instance;
|
|
235
192
|
}
|
|
236
|
-
/**
|
|
237
|
-
* Creates a new Consola instance with the specified default log object properties.
|
|
238
|
-
*
|
|
239
|
-
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
240
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
241
|
-
*/
|
|
242
193
|
withDefaults(defaults) {
|
|
243
194
|
return this.create({
|
|
244
195
|
...this.options,
|
|
@@ -248,39 +199,19 @@ class Consola {
|
|
|
248
199
|
}
|
|
249
200
|
});
|
|
250
201
|
}
|
|
251
|
-
/**
|
|
252
|
-
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
253
|
-
*
|
|
254
|
-
* @param {string} tag - The tag to include in each log of the new instance.
|
|
255
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
256
|
-
*/
|
|
257
202
|
withTag(tag) {
|
|
258
203
|
return this.withDefaults({
|
|
259
204
|
tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
|
|
260
205
|
});
|
|
261
206
|
}
|
|
262
|
-
/**
|
|
263
|
-
* Adds a custom reporter to the Consola instance.
|
|
264
|
-
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
265
|
-
*
|
|
266
|
-
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
267
|
-
* @returns {Consola} The current Consola instance.
|
|
268
|
-
*/
|
|
269
207
|
addReporter(reporter) {
|
|
270
208
|
this.options.reporters.push(reporter);
|
|
271
209
|
return this;
|
|
272
210
|
}
|
|
273
|
-
/**
|
|
274
|
-
* Removes a custom reporter from the Consola instance.
|
|
275
|
-
* If no reporter is specified, all reporters will be removed.
|
|
276
|
-
*
|
|
277
|
-
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
278
|
-
* @returns {Consola} The current Consola instance.
|
|
279
|
-
*/
|
|
280
211
|
removeReporter(reporter) {
|
|
281
212
|
if (reporter) {
|
|
282
213
|
const i = this.options.reporters.indexOf(reporter);
|
|
283
|
-
if (i
|
|
214
|
+
if (i >= 0) {
|
|
284
215
|
return this.options.reporters.splice(i, 1);
|
|
285
216
|
}
|
|
286
217
|
} else {
|
|
@@ -288,12 +219,6 @@ class Consola {
|
|
|
288
219
|
}
|
|
289
220
|
return this;
|
|
290
221
|
}
|
|
291
|
-
/**
|
|
292
|
-
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
293
|
-
*
|
|
294
|
-
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
295
|
-
* @returns {Consola} The current Consola instance.
|
|
296
|
-
*/
|
|
297
222
|
setReporters(reporters) {
|
|
298
223
|
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
299
224
|
return this;
|
|
@@ -306,9 +231,6 @@ class Consola {
|
|
|
306
231
|
this.restoreConsole();
|
|
307
232
|
this.restoreStd();
|
|
308
233
|
}
|
|
309
|
-
/**
|
|
310
|
-
* Overrides console methods with Consola logging methods for consistent logging.
|
|
311
|
-
*/
|
|
312
234
|
wrapConsole() {
|
|
313
235
|
for (const type in this.options.types) {
|
|
314
236
|
if (!console["__" + type]) {
|
|
@@ -317,9 +239,6 @@ class Consola {
|
|
|
317
239
|
console[type] = this[type].raw;
|
|
318
240
|
}
|
|
319
241
|
}
|
|
320
|
-
/**
|
|
321
|
-
* Restores the original console methods, removing Consola overrides.
|
|
322
|
-
*/
|
|
323
242
|
restoreConsole() {
|
|
324
243
|
for (const type in this.options.types) {
|
|
325
244
|
if (console["__" + type]) {
|
|
@@ -328,9 +247,6 @@ class Consola {
|
|
|
328
247
|
}
|
|
329
248
|
}
|
|
330
249
|
}
|
|
331
|
-
/**
|
|
332
|
-
* Overrides standard output and error streams to redirect them through Consola.
|
|
333
|
-
*/
|
|
334
250
|
wrapStd() {
|
|
335
251
|
this._wrapStream(this.options.stdout, "log");
|
|
336
252
|
this._wrapStream(this.options.stderr, "log");
|
|
@@ -346,9 +262,6 @@ class Consola {
|
|
|
346
262
|
this[type].raw(String(data).trim());
|
|
347
263
|
};
|
|
348
264
|
}
|
|
349
|
-
/**
|
|
350
|
-
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
351
|
-
*/
|
|
352
265
|
restoreStd() {
|
|
353
266
|
this._restoreStream(this.options.stdout);
|
|
354
267
|
this._restoreStream(this.options.stderr);
|
|
@@ -362,15 +275,9 @@ class Consola {
|
|
|
362
275
|
delete stream.__write;
|
|
363
276
|
}
|
|
364
277
|
}
|
|
365
|
-
/**
|
|
366
|
-
* Pauses logging, queues incoming logs until resumed.
|
|
367
|
-
*/
|
|
368
278
|
pauseLogs() {
|
|
369
279
|
paused = true;
|
|
370
280
|
}
|
|
371
|
-
/**
|
|
372
|
-
* Resumes logging, processing any queued logs.
|
|
373
|
-
*/
|
|
374
281
|
resumeLogs() {
|
|
375
282
|
paused = false;
|
|
376
283
|
const _queue = queue.splice(0);
|
|
@@ -378,11 +285,6 @@ class Consola {
|
|
|
378
285
|
item[0]._logFn(item[1], item[2]);
|
|
379
286
|
}
|
|
380
287
|
}
|
|
381
|
-
/**
|
|
382
|
-
* Replaces logging methods with mocks if a mock function is provided.
|
|
383
|
-
*
|
|
384
|
-
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
385
|
-
*/
|
|
386
288
|
mockTypes(mockFn) {
|
|
387
289
|
const _mockFn = mockFn || this.options.mockFn;
|
|
388
290
|
this._mockFn = _mockFn;
|
|
@@ -505,10 +407,6 @@ function createConsola$1(options = {}) {
|
|
|
505
407
|
}
|
|
506
408
|
|
|
507
409
|
class BrowserReporter {
|
|
508
|
-
options;
|
|
509
|
-
defaultColor;
|
|
510
|
-
levelColorMap;
|
|
511
|
-
typeColorMap;
|
|
512
410
|
constructor(options) {
|
|
513
411
|
this.options = { ...options };
|
|
514
412
|
this.defaultColor = "#7f8c8d";
|
|
@@ -1203,7 +1101,7 @@ https://github.com/xiangyuecn/Recorder
|
|
|
1203
1101
|
s=Fy;
|
|
1204
1102
|
}else { s=filterFn?filterFn(s):s; }
|
|
1205
1103
|
|
|
1206
|
-
if(s>0x7FFF) s=0x7FFF; else if(s<-
|
|
1104
|
+
if(s>0x7FFF) s=0x7FFF; else if(s<-0x8000) s=-0x8000; //Int16越界处理
|
|
1207
1105
|
if(useSum) _sum+=Math.abs(s);
|
|
1208
1106
|
res[pos]=s;
|
|
1209
1107
|
idx++;
|
|
@@ -1241,7 +1139,7 @@ https://github.com/xiangyuecn/Recorder
|
|
|
1241
1139
|
var afterVal=after<il ? F2 : beforeVal; //后个点越界了,忽略不计
|
|
1242
1140
|
var val=beforeVal+(afterVal-beforeVal)*atPoint;
|
|
1243
1141
|
|
|
1244
|
-
if(val>0x7FFF) val=0x7FFF; else if(val<-
|
|
1142
|
+
if(val>0x7FFF) val=0x7FFF; else if(val<-0x8000) val=-0x8000; //Int16越界处理
|
|
1245
1143
|
if(useSum) _sum+=Math.abs(val);
|
|
1246
1144
|
res[idx]=val;
|
|
1247
1145
|
|
|
@@ -4522,14 +4420,14 @@ function Presets() {
|
|
|
4522
4420
|
* </PRE>
|
|
4523
4421
|
*/
|
|
4524
4422
|
var abr_switch_map = [
|
|
4525
|
-
new ABRPresets(8, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -30, 11, 0.0012, 1), /* 8, impossible to use in stereo */
|
|
4526
|
-
new ABRPresets(16, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -25, 11, 0.0010, 1), /* 16 */
|
|
4527
|
-
new ABRPresets(24, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -20, 11, 0.0010, 1), /* 24 */
|
|
4528
|
-
new ABRPresets(32, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -15, 11, 0.0010, 1), /* 32 */
|
|
4529
|
-
new ABRPresets(40, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -10, 11, 0.0009, 1), /* 40 */
|
|
4530
|
-
new ABRPresets(48, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -10, 11, 0.0009, 1), /* 48 */
|
|
4531
|
-
new ABRPresets(56, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -6, 11, 0.0008, 1), /* 56 */
|
|
4532
|
-
new ABRPresets(64, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -2, 11, 0.0008, 1), /* 64 */
|
|
4423
|
+
new ABRPresets(8, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -30.0, 11, 0.0012, 1), /* 8, impossible to use in stereo */
|
|
4424
|
+
new ABRPresets(16, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -25.0, 11, 0.0010, 1), /* 16 */
|
|
4425
|
+
new ABRPresets(24, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -20.0, 11, 0.0010, 1), /* 24 */
|
|
4426
|
+
new ABRPresets(32, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -15.0, 11, 0.0010, 1), /* 32 */
|
|
4427
|
+
new ABRPresets(40, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -10.0, 11, 0.0009, 1), /* 40 */
|
|
4428
|
+
new ABRPresets(48, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -10.0, 11, 0.0009, 1), /* 48 */
|
|
4429
|
+
new ABRPresets(56, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -6.0, 11, 0.0008, 1), /* 56 */
|
|
4430
|
+
new ABRPresets(64, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -2.0, 11, 0.0008, 1), /* 64 */
|
|
4533
4431
|
new ABRPresets(80, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, .0, 8, 0.0007, 1), /* 80 */
|
|
4534
4432
|
new ABRPresets(96, 9, 9, 0, 2.50, 6.60, 145, 0, 0.95, 0, 1.0, 5.5, 0.0006, 1), /* 96 */
|
|
4535
4433
|
new ABRPresets(112, 9, 9, 0, 2.25, 6.60, 145, 0, 0.95, 0, 2.0, 4.5, 0.0005, 1), /* 112 */
|
|
@@ -7175,7 +7073,7 @@ function QuantizePVT() {
|
|
|
7175
7073
|
/*
|
|
7176
7074
|
* work in progress, don't rely on it too much
|
|
7177
7075
|
*/
|
|
7178
|
-
gfc.ATH.floor = 10. * Math_log10(ATHmdct(gfp, -1));
|
|
7076
|
+
gfc.ATH.floor = 10. * Math_log10(ATHmdct(gfp, -1.));
|
|
7179
7077
|
}
|
|
7180
7078
|
|
|
7181
7079
|
/**
|
|
@@ -7581,7 +7479,7 @@ function QuantizePVT() {
|
|
|
7581
7479
|
/* 0 dB relative to masking */
|
|
7582
7480
|
var tot_noise_db = 0;
|
|
7583
7481
|
/* -200 dB relative to masking */
|
|
7584
|
-
var max_noise = -20;
|
|
7482
|
+
var max_noise = -20.0;
|
|
7585
7483
|
var j = 0;
|
|
7586
7484
|
var scalefac = cod_info.scalefac;
|
|
7587
7485
|
var scalefacPos = 0;
|
|
@@ -8533,6 +8431,7 @@ function Quantize() {
|
|
|
8533
8431
|
var best_part2_3_length = 9999999;
|
|
8534
8432
|
var bEndOfSearch = false;
|
|
8535
8433
|
var bRefine = false;
|
|
8434
|
+
var best_ggain_pass1 = 0;
|
|
8536
8435
|
|
|
8537
8436
|
bin_search_StepSize(gfc, cod_info, targ_bits, ch, xrpow);
|
|
8538
8437
|
|
|
@@ -8654,11 +8553,12 @@ function Quantize() {
|
|
|
8654
8553
|
if (++age > search_limit
|
|
8655
8554
|
&& best_noise_info.over_count == 0)
|
|
8656
8555
|
break;
|
|
8657
|
-
if ((gfc.noise_shaping_amp == 3) && bRefine)
|
|
8658
|
-
;
|
|
8556
|
+
if ((gfc.noise_shaping_amp == 3) && bRefine && age > 30)
|
|
8557
|
+
break;
|
|
8659
8558
|
if ((gfc.noise_shaping_amp == 3)
|
|
8660
|
-
&& bRefine
|
|
8661
|
-
|
|
8559
|
+
&& bRefine
|
|
8560
|
+
&& (cod_info_w.global_gain - best_ggain_pass1) > 15)
|
|
8561
|
+
break;
|
|
8662
8562
|
}
|
|
8663
8563
|
}
|
|
8664
8564
|
} while ((cod_info_w.global_gain + cod_info_w.scalefac_scale) < 255);
|
|
@@ -8751,7 +8651,7 @@ function Quantize() {
|
|
|
8751
8651
|
function NewMDCT() {
|
|
8752
8652
|
|
|
8753
8653
|
var enwindow = [
|
|
8754
|
-
-
|
|
8654
|
+
-4.77e-07 * 0.740951125354959 / 2.384e-06,
|
|
8755
8655
|
1.03951e-04 * 0.740951125354959 / 2.384e-06,
|
|
8756
8656
|
9.53674e-04 * 0.740951125354959 / 2.384e-06,
|
|
8757
8657
|
2.841473e-03 * 0.740951125354959 / 2.384e-06,
|
|
@@ -8763,13 +8663,13 @@ function NewMDCT() {
|
|
|
8763
8663
|
1.91212e-04 * 0.740951125354959 / 2.384e-06,
|
|
8764
8664
|
2.283096e-03 * 0.740951125354959 / 2.384e-06,
|
|
8765
8665
|
1.6994476e-02 * 0.740951125354959 / 2.384e-06,
|
|
8766
|
-
-
|
|
8767
|
-
-
|
|
8768
|
-
-
|
|
8769
|
-
-
|
|
8666
|
+
-1.8756866e-02 * 0.740951125354959 / 2.384e-06,
|
|
8667
|
+
-2.630711e-03 * 0.740951125354959 / 2.384e-06,
|
|
8668
|
+
-2.47478e-04 * 0.740951125354959 / 2.384e-06,
|
|
8669
|
+
-1.4782e-05 * 0.740951125354959 / 2.384e-06,
|
|
8770
8670
|
9.063471690191471e-01, 1.960342806591213e-01,
|
|
8771
8671
|
|
|
8772
|
-
-
|
|
8672
|
+
-4.77e-07 * 0.773010453362737 / 2.384e-06,
|
|
8773
8673
|
1.05858e-04 * 0.773010453362737 / 2.384e-06,
|
|
8774
8674
|
9.30786e-04 * 0.773010453362737 / 2.384e-06,
|
|
8775
8675
|
2.521515e-03 * 0.773010453362737 / 2.384e-06,
|
|
@@ -8781,13 +8681,13 @@ function NewMDCT() {
|
|
|
8781
8681
|
1.65462e-04 * 0.773010453362737 / 2.384e-06,
|
|
8782
8682
|
2.110004e-03 * 0.773010453362737 / 2.384e-06,
|
|
8783
8683
|
1.6112804e-02 * 0.773010453362737 / 2.384e-06,
|
|
8784
|
-
-
|
|
8785
|
-
-
|
|
8786
|
-
-
|
|
8787
|
-
-
|
|
8684
|
+
-1.9634247e-02 * 0.773010453362737 / 2.384e-06,
|
|
8685
|
+
-2.803326e-03 * 0.773010453362737 / 2.384e-06,
|
|
8686
|
+
-2.77042e-04 * 0.773010453362737 / 2.384e-06,
|
|
8687
|
+
-1.6689e-05 * 0.773010453362737 / 2.384e-06,
|
|
8788
8688
|
8.206787908286602e-01, 3.901806440322567e-01,
|
|
8789
8689
|
|
|
8790
|
-
-
|
|
8690
|
+
-4.77e-07 * 0.803207531480645 / 2.384e-06,
|
|
8791
8691
|
1.07288e-04 * 0.803207531480645 / 2.384e-06,
|
|
8792
8692
|
9.02653e-04 * 0.803207531480645 / 2.384e-06,
|
|
8793
8693
|
2.174854e-03 * 0.803207531480645 / 2.384e-06,
|
|
@@ -8799,13 +8699,13 @@ function NewMDCT() {
|
|
|
8799
8699
|
1.40190e-04 * 0.803207531480645 / 2.384e-06,
|
|
8800
8700
|
1.937389e-03 * 0.803207531480645 / 2.384e-06,
|
|
8801
8701
|
1.5233517e-02 * 0.803207531480645 / 2.384e-06,
|
|
8802
|
-
-
|
|
8803
|
-
-
|
|
8804
|
-
-
|
|
8805
|
-
-
|
|
8702
|
+
-2.0506859e-02 * 0.803207531480645 / 2.384e-06,
|
|
8703
|
+
-2.974033e-03 * 0.803207531480645 / 2.384e-06,
|
|
8704
|
+
-3.07560e-04 * 0.803207531480645 / 2.384e-06,
|
|
8705
|
+
-1.8120e-05 * 0.803207531480645 / 2.384e-06,
|
|
8806
8706
|
7.416505462720353e-01, 5.805693545089249e-01,
|
|
8807
8707
|
|
|
8808
|
-
-
|
|
8708
|
+
-4.77e-07 * 0.831469612302545 / 2.384e-06,
|
|
8809
8709
|
1.08242e-04 * 0.831469612302545 / 2.384e-06,
|
|
8810
8710
|
8.68797e-04 * 0.831469612302545 / 2.384e-06,
|
|
8811
8711
|
1.800537e-03 * 0.831469612302545 / 2.384e-06,
|
|
@@ -8817,13 +8717,13 @@ function NewMDCT() {
|
|
|
8817
8717
|
1.16348e-04 * 0.831469612302545 / 2.384e-06,
|
|
8818
8718
|
1.766682e-03 * 0.831469612302545 / 2.384e-06,
|
|
8819
8719
|
1.4358521e-02 * 0.831469612302545 / 2.384e-06,
|
|
8820
|
-
-
|
|
8821
|
-
-
|
|
8822
|
-
-
|
|
8823
|
-
-
|
|
8720
|
+
-2.1372318e-02 * 0.831469612302545 / 2.384e-06,
|
|
8721
|
+
-3.14188e-03 * 0.831469612302545 / 2.384e-06,
|
|
8722
|
+
-3.39031e-04 * 0.831469612302545 / 2.384e-06,
|
|
8723
|
+
-1.9550e-05 * 0.831469612302545 / 2.384e-06,
|
|
8824
8724
|
6.681786379192989e-01, 7.653668647301797e-01,
|
|
8825
8725
|
|
|
8826
|
-
-
|
|
8726
|
+
-4.77e-07 * 0.857728610000272 / 2.384e-06,
|
|
8827
8727
|
1.08719e-04 * 0.857728610000272 / 2.384e-06,
|
|
8828
8728
|
8.29220e-04 * 0.857728610000272 / 2.384e-06,
|
|
8829
8729
|
1.399517e-03 * 0.857728610000272 / 2.384e-06,
|
|
@@ -8835,13 +8735,13 @@ function NewMDCT() {
|
|
|
8835
8735
|
9.3937e-05 * 0.857728610000272 / 2.384e-06,
|
|
8836
8736
|
1.597881e-03 * 0.857728610000272 / 2.384e-06,
|
|
8837
8737
|
1.3489246e-02 * 0.857728610000272 / 2.384e-06,
|
|
8838
|
-
-
|
|
8839
|
-
-
|
|
8840
|
-
-
|
|
8841
|
-
-
|
|
8738
|
+
-2.2228718e-02 * 0.857728610000272 / 2.384e-06,
|
|
8739
|
+
-3.306866e-03 * 0.857728610000272 / 2.384e-06,
|
|
8740
|
+
-3.71456e-04 * 0.857728610000272 / 2.384e-06,
|
|
8741
|
+
-2.1458e-05 * 0.857728610000272 / 2.384e-06,
|
|
8842
8742
|
5.993769336819237e-01, 9.427934736519954e-01,
|
|
8843
8743
|
|
|
8844
|
-
-
|
|
8744
|
+
-4.77e-07 * 0.881921264348355 / 2.384e-06,
|
|
8845
8745
|
1.08719e-04 * 0.881921264348355 / 2.384e-06,
|
|
8846
8746
|
7.8392e-04 * 0.881921264348355 / 2.384e-06,
|
|
8847
8747
|
9.71317e-04 * 0.881921264348355 / 2.384e-06,
|
|
@@ -8853,13 +8753,13 @@ function NewMDCT() {
|
|
|
8853
8753
|
7.2956e-05 * 0.881921264348355 / 2.384e-06,
|
|
8854
8754
|
1.432419e-03 * 0.881921264348355 / 2.384e-06,
|
|
8855
8755
|
1.2627602e-02 * 0.881921264348355 / 2.384e-06,
|
|
8856
|
-
-
|
|
8857
|
-
-
|
|
8858
|
-
-
|
|
8859
|
-
-
|
|
8756
|
+
-2.3074150e-02 * 0.881921264348355 / 2.384e-06,
|
|
8757
|
+
-3.467083e-03 * 0.881921264348355 / 2.384e-06,
|
|
8758
|
+
-4.04358e-04 * 0.881921264348355 / 2.384e-06,
|
|
8759
|
+
-2.3365e-05 * 0.881921264348355 / 2.384e-06,
|
|
8860
8760
|
5.345111359507916e-01, 1.111140466039205e+00,
|
|
8861
8761
|
|
|
8862
|
-
-
|
|
8762
|
+
-9.54e-07 * 0.903989293123443 / 2.384e-06,
|
|
8863
8763
|
1.08242e-04 * 0.903989293123443 / 2.384e-06,
|
|
8864
8764
|
7.31945e-04 * 0.903989293123443 / 2.384e-06,
|
|
8865
8765
|
5.15938e-04 * 0.903989293123443 / 2.384e-06,
|
|
@@ -8871,13 +8771,13 @@ function NewMDCT() {
|
|
|
8871
8771
|
5.2929e-05 * 0.903989293123443 / 2.384e-06,
|
|
8872
8772
|
1.269817e-03 * 0.903989293123443 / 2.384e-06,
|
|
8873
8773
|
1.1775017e-02 * 0.903989293123443 / 2.384e-06,
|
|
8874
|
-
-
|
|
8875
|
-
-
|
|
8876
|
-
-
|
|
8877
|
-
-
|
|
8774
|
+
-2.3907185e-02 * 0.903989293123443 / 2.384e-06,
|
|
8775
|
+
-3.622532e-03 * 0.903989293123443 / 2.384e-06,
|
|
8776
|
+
-4.38213e-04 * 0.903989293123443 / 2.384e-06,
|
|
8777
|
+
-2.5272e-05 * 0.903989293123443 / 2.384e-06,
|
|
8878
8778
|
4.729647758913199e-01, 1.268786568327291e+00,
|
|
8879
8779
|
|
|
8880
|
-
-
|
|
8780
|
+
-9.54e-07 * 0.92387953251128675613 / 2.384e-06,
|
|
8881
8781
|
1.06812e-04 * 0.92387953251128675613 / 2.384e-06,
|
|
8882
8782
|
6.74248e-04 * 0.92387953251128675613 / 2.384e-06,
|
|
8883
8783
|
3.3379e-05 * 0.92387953251128675613 / 2.384e-06,
|
|
@@ -8889,17 +8789,17 @@ function NewMDCT() {
|
|
|
8889
8789
|
3.4332e-05 * 0.92387953251128675613 / 2.384e-06,
|
|
8890
8790
|
1.111031e-03 * 0.92387953251128675613 / 2.384e-06,
|
|
8891
8791
|
1.0933399e-02 * 0.92387953251128675613 / 2.384e-06,
|
|
8892
|
-
-
|
|
8893
|
-
-
|
|
8894
|
-
-
|
|
8895
|
-
-
|
|
8792
|
+
-2.4725437e-02 * 0.92387953251128675613 / 2.384e-06,
|
|
8793
|
+
-3.771782e-03 * 0.92387953251128675613 / 2.384e-06,
|
|
8794
|
+
-4.72546e-04 * 0.92387953251128675613 / 2.384e-06,
|
|
8795
|
+
-2.7657e-05 * 0.92387953251128675613 / 2.384e-06,
|
|
8896
8796
|
4.1421356237309504879e-01, /* tan(PI/8) */
|
|
8897
8797
|
1.414213562373095e+00,
|
|
8898
8798
|
|
|
8899
|
-
-
|
|
8799
|
+
-9.54e-07 * 0.941544065183021 / 2.384e-06,
|
|
8900
8800
|
1.05381e-04 * 0.941544065183021 / 2.384e-06,
|
|
8901
8801
|
6.10352e-04 * 0.941544065183021 / 2.384e-06,
|
|
8902
|
-
-
|
|
8802
|
+
-4.75883e-04 * 0.941544065183021 / 2.384e-06,
|
|
8903
8803
|
3.4055710e-02 * 0.941544065183021 / 2.384e-06,
|
|
8904
8804
|
4.649162e-03 * 0.941544065183021 / 2.384e-06,
|
|
8905
8805
|
9.35555e-04 * 0.941544065183021 / 2.384e-06,
|
|
@@ -8908,16 +8808,16 @@ function NewMDCT() {
|
|
|
8908
8808
|
1.7166e-05 * 0.941544065183021 / 2.384e-06,
|
|
8909
8809
|
9.56535e-04 * 0.941544065183021 / 2.384e-06,
|
|
8910
8810
|
1.0103703e-02 * 0.941544065183021 / 2.384e-06,
|
|
8911
|
-
-
|
|
8912
|
-
-
|
|
8913
|
-
-
|
|
8914
|
-
-
|
|
8811
|
+
-2.5527000e-02 * 0.941544065183021 / 2.384e-06,
|
|
8812
|
+
-3.914356e-03 * 0.941544065183021 / 2.384e-06,
|
|
8813
|
+
-5.07355e-04 * 0.941544065183021 / 2.384e-06,
|
|
8814
|
+
-3.0041e-05 * 0.941544065183021 / 2.384e-06,
|
|
8915
8815
|
3.578057213145241e-01, 1.546020906725474e+00,
|
|
8916
8816
|
|
|
8917
|
-
-
|
|
8817
|
+
-9.54e-07 * 0.956940335732209 / 2.384e-06,
|
|
8918
8818
|
1.02520e-04 * 0.956940335732209 / 2.384e-06,
|
|
8919
8819
|
5.39303e-04 * 0.956940335732209 / 2.384e-06,
|
|
8920
|
-
-
|
|
8820
|
+
-1.011848e-03 * 0.956940335732209 / 2.384e-06,
|
|
8921
8821
|
3.3659935e-02 * 0.956940335732209 / 2.384e-06,
|
|
8922
8822
|
4.703045e-03 * 0.956940335732209 / 2.384e-06,
|
|
8923
8823
|
9.15051e-04 * 0.956940335732209 / 2.384e-06,
|
|
@@ -8926,100 +8826,100 @@ function NewMDCT() {
|
|
|
8926
8826
|
9.54e-07 * 0.956940335732209 / 2.384e-06,
|
|
8927
8827
|
8.06808e-04 * 0.956940335732209 / 2.384e-06,
|
|
8928
8828
|
9.287834e-03 * 0.956940335732209 / 2.384e-06,
|
|
8929
|
-
-
|
|
8930
|
-
-
|
|
8931
|
-
-
|
|
8932
|
-
-
|
|
8829
|
+
-2.6310921e-02 * 0.956940335732209 / 2.384e-06,
|
|
8830
|
+
-4.048824e-03 * 0.956940335732209 / 2.384e-06,
|
|
8831
|
+
-5.42164e-04 * 0.956940335732209 / 2.384e-06,
|
|
8832
|
+
-3.2425e-05 * 0.956940335732209 / 2.384e-06,
|
|
8933
8833
|
3.033466836073424e-01, 1.662939224605090e+00,
|
|
8934
8834
|
|
|
8935
|
-
-
|
|
8835
|
+
-1.431e-06 * 0.970031253194544 / 2.384e-06,
|
|
8936
8836
|
9.9182e-05 * 0.970031253194544 / 2.384e-06,
|
|
8937
8837
|
4.62532e-04 * 0.970031253194544 / 2.384e-06,
|
|
8938
|
-
-
|
|
8838
|
+
-1.573563e-03 * 0.970031253194544 / 2.384e-06,
|
|
8939
8839
|
3.3225536e-02 * 0.970031253194544 / 2.384e-06,
|
|
8940
8840
|
4.737377e-03 * 0.970031253194544 / 2.384e-06,
|
|
8941
8841
|
8.91685e-04 * 0.970031253194544 / 2.384e-06,
|
|
8942
8842
|
6.6280e-05 * 0.970031253194544 / 2.384e-06, /* 5 */
|
|
8943
8843
|
4.292e-06 * 0.970031253194544 / 2.384e-06,
|
|
8944
|
-
-
|
|
8844
|
+
-1.3828e-05 * 0.970031253194544 / 2.384e-06,
|
|
8945
8845
|
6.61850e-04 * 0.970031253194544 / 2.384e-06,
|
|
8946
8846
|
8.487225e-03 * 0.970031253194544 / 2.384e-06,
|
|
8947
|
-
-
|
|
8948
|
-
-
|
|
8949
|
-
-
|
|
8950
|
-
-
|
|
8847
|
+
-2.7073860e-02 * 0.970031253194544 / 2.384e-06,
|
|
8848
|
+
-4.174709e-03 * 0.970031253194544 / 2.384e-06,
|
|
8849
|
+
-5.76973e-04 * 0.970031253194544 / 2.384e-06,
|
|
8850
|
+
-3.4809e-05 * 0.970031253194544 / 2.384e-06,
|
|
8951
8851
|
2.504869601913055e-01, 1.763842528696710e+00,
|
|
8952
8852
|
|
|
8953
|
-
-
|
|
8853
|
+
-1.431e-06 * 0.98078528040323 / 2.384e-06,
|
|
8954
8854
|
9.5367e-05 * 0.98078528040323 / 2.384e-06,
|
|
8955
8855
|
3.78609e-04 * 0.98078528040323 / 2.384e-06,
|
|
8956
|
-
-
|
|
8856
|
+
-2.161503e-03 * 0.98078528040323 / 2.384e-06,
|
|
8957
8857
|
3.2754898e-02 * 0.98078528040323 / 2.384e-06,
|
|
8958
8858
|
4.752159e-03 * 0.98078528040323 / 2.384e-06,
|
|
8959
8859
|
8.66413e-04 * 0.98078528040323 / 2.384e-06,
|
|
8960
8860
|
6.2943e-05 * 0.98078528040323 / 2.384e-06, /* 4 */
|
|
8961
8861
|
3.815e-06 * 0.98078528040323 / 2.384e-06,
|
|
8962
|
-
-
|
|
8862
|
+
-2.718e-05 * 0.98078528040323 / 2.384e-06,
|
|
8963
8863
|
5.22137e-04 * 0.98078528040323 / 2.384e-06,
|
|
8964
8864
|
7.703304e-03 * 0.98078528040323 / 2.384e-06,
|
|
8965
|
-
-
|
|
8966
|
-
-
|
|
8967
|
-
-
|
|
8968
|
-
-
|
|
8865
|
+
-2.7815342e-02 * 0.98078528040323 / 2.384e-06,
|
|
8866
|
+
-4.290581e-03 * 0.98078528040323 / 2.384e-06,
|
|
8867
|
+
-6.11782e-04 * 0.98078528040323 / 2.384e-06,
|
|
8868
|
+
-3.7670e-05 * 0.98078528040323 / 2.384e-06,
|
|
8969
8869
|
1.989123673796580e-01, 1.847759065022573e+00,
|
|
8970
8870
|
|
|
8971
|
-
-
|
|
8871
|
+
-1.907e-06 * 0.989176509964781 / 2.384e-06,
|
|
8972
8872
|
9.0122e-05 * 0.989176509964781 / 2.384e-06,
|
|
8973
8873
|
2.88486e-04 * 0.989176509964781 / 2.384e-06,
|
|
8974
|
-
-
|
|
8874
|
+
-2.774239e-03 * 0.989176509964781 / 2.384e-06,
|
|
8975
8875
|
3.2248020e-02 * 0.989176509964781 / 2.384e-06,
|
|
8976
8876
|
4.748821e-03 * 0.989176509964781 / 2.384e-06,
|
|
8977
8877
|
8.38757e-04 * 0.989176509964781 / 2.384e-06,
|
|
8978
8878
|
5.9605e-05 * 0.989176509964781 / 2.384e-06, /* 3 */
|
|
8979
8879
|
3.338e-06 * 0.989176509964781 / 2.384e-06,
|
|
8980
|
-
-
|
|
8880
|
+
-3.9577e-05 * 0.989176509964781 / 2.384e-06,
|
|
8981
8881
|
3.88145e-04 * 0.989176509964781 / 2.384e-06,
|
|
8982
8882
|
6.937027e-03 * 0.989176509964781 / 2.384e-06,
|
|
8983
|
-
-
|
|
8984
|
-
-
|
|
8985
|
-
-
|
|
8986
|
-
-
|
|
8883
|
+
-2.8532982e-02 * 0.989176509964781 / 2.384e-06,
|
|
8884
|
+
-4.395962e-03 * 0.989176509964781 / 2.384e-06,
|
|
8885
|
+
-6.46591e-04 * 0.989176509964781 / 2.384e-06,
|
|
8886
|
+
-4.0531e-05 * 0.989176509964781 / 2.384e-06,
|
|
8987
8887
|
1.483359875383474e-01, 1.913880671464418e+00,
|
|
8988
8888
|
|
|
8989
|
-
-
|
|
8889
|
+
-1.907e-06 * 0.995184726672197 / 2.384e-06,
|
|
8990
8890
|
8.4400e-05 * 0.995184726672197 / 2.384e-06,
|
|
8991
8891
|
1.91689e-04 * 0.995184726672197 / 2.384e-06,
|
|
8992
|
-
-
|
|
8892
|
+
-3.411293e-03 * 0.995184726672197 / 2.384e-06,
|
|
8993
8893
|
3.1706810e-02 * 0.995184726672197 / 2.384e-06,
|
|
8994
8894
|
4.728317e-03 * 0.995184726672197 / 2.384e-06,
|
|
8995
8895
|
8.09669e-04 * 0.995184726672197 / 2.384e-06,
|
|
8996
8896
|
5.579e-05 * 0.995184726672197 / 2.384e-06,
|
|
8997
8897
|
3.338e-06 * 0.995184726672197 / 2.384e-06,
|
|
8998
|
-
-
|
|
8898
|
+
-5.0545e-05 * 0.995184726672197 / 2.384e-06,
|
|
8999
8899
|
2.59876e-04 * 0.995184726672197 / 2.384e-06,
|
|
9000
8900
|
6.189346e-03 * 0.995184726672197 / 2.384e-06,
|
|
9001
|
-
-
|
|
9002
|
-
-
|
|
9003
|
-
-
|
|
9004
|
-
-
|
|
8901
|
+
-2.9224873e-02 * 0.995184726672197 / 2.384e-06,
|
|
8902
|
+
-4.489899e-03 * 0.995184726672197 / 2.384e-06,
|
|
8903
|
+
-6.80923e-04 * 0.995184726672197 / 2.384e-06,
|
|
8904
|
+
-4.3392e-05 * 0.995184726672197 / 2.384e-06,
|
|
9005
8905
|
9.849140335716425e-02, 1.961570560806461e+00,
|
|
9006
8906
|
|
|
9007
|
-
-
|
|
8907
|
+
-2.384e-06 * 0.998795456205172 / 2.384e-06,
|
|
9008
8908
|
7.7724e-05 * 0.998795456205172 / 2.384e-06,
|
|
9009
8909
|
8.8215e-05 * 0.998795456205172 / 2.384e-06,
|
|
9010
|
-
-
|
|
8910
|
+
-4.072189e-03 * 0.998795456205172 / 2.384e-06,
|
|
9011
8911
|
3.1132698e-02 * 0.998795456205172 / 2.384e-06,
|
|
9012
8912
|
4.691124e-03 * 0.998795456205172 / 2.384e-06,
|
|
9013
8913
|
7.79152e-04 * 0.998795456205172 / 2.384e-06,
|
|
9014
8914
|
5.2929e-05 * 0.998795456205172 / 2.384e-06,
|
|
9015
8915
|
2.861e-06 * 0.998795456205172 / 2.384e-06,
|
|
9016
|
-
-
|
|
8916
|
+
-6.0558e-05 * 0.998795456205172 / 2.384e-06,
|
|
9017
8917
|
1.37329e-04 * 0.998795456205172 / 2.384e-06,
|
|
9018
8918
|
5.462170e-03 * 0.998795456205172 / 2.384e-06,
|
|
9019
|
-
-
|
|
9020
|
-
-
|
|
9021
|
-
-
|
|
9022
|
-
-
|
|
8919
|
+
-2.9890060e-02 * 0.998795456205172 / 2.384e-06,
|
|
8920
|
+
-4.570484e-03 * 0.998795456205172 / 2.384e-06,
|
|
8921
|
+
-7.14302e-04 * 0.998795456205172 / 2.384e-06,
|
|
8922
|
+
-4.6253e-05 * 0.998795456205172 / 2.384e-06,
|
|
9023
8923
|
4.912684976946725e-02, 1.990369453344394e+00,
|
|
9024
8924
|
|
|
9025
8925
|
3.5780907e-02 * Util.SQRT2 * 0.5 / 2.384e-06,
|
|
@@ -9034,9 +8934,12 @@ function NewMDCT() {
|
|
|
9034
8934
|
3.0526638e-02 / 2.384e-06, 4.638195e-03 / 2.384e-06,
|
|
9035
8935
|
7.47204e-04 / 2.384e-06, 4.9591e-05 / 2.384e-06,
|
|
9036
8936
|
4.756451e-03 / 2.384e-06, 2.1458e-05 / 2.384e-06,
|
|
9037
|
-
-
|
|
8937
|
+
-6.9618e-05 / 2.384e-06, /* 2.384e-06/2.384e-06 */
|
|
9038
8938
|
];
|
|
9039
8939
|
|
|
8940
|
+
var NS = 12;
|
|
8941
|
+
var NL = 36;
|
|
8942
|
+
|
|
9040
8943
|
var win = [
|
|
9041
8944
|
[
|
|
9042
8945
|
2.382191739347913e-13,
|
|
@@ -9059,25 +8962,25 @@ function NewMDCT() {
|
|
|
9059
8962
|
8.371015190102974e-13,
|
|
9060
8963
|
2.599706096327376e-13,
|
|
9061
8964
|
|
|
9062
|
-
-
|
|
9063
|
-
-
|
|
9064
|
-
-
|
|
9065
|
-
-
|
|
9066
|
-
-
|
|
9067
|
-
-
|
|
9068
|
-
-
|
|
9069
|
-
-
|
|
9070
|
-
-
|
|
9071
|
-
|
|
9072
|
-
-
|
|
9073
|
-
-
|
|
9074
|
-
-
|
|
9075
|
-
-
|
|
9076
|
-
-
|
|
9077
|
-
-
|
|
9078
|
-
-
|
|
9079
|
-
-
|
|
9080
|
-
-
|
|
8965
|
+
-5.456116108943412e-12,
|
|
8966
|
+
-4.878985199565852e-12,
|
|
8967
|
+
-4.240448995017367e-12,
|
|
8968
|
+
-3.559909094758252e-12,
|
|
8969
|
+
-2.858043359288076e-12,
|
|
8970
|
+
-2.156177623817898e-12,
|
|
8971
|
+
-1.475637723558783e-12,
|
|
8972
|
+
-8.371015190102975e-13,
|
|
8973
|
+
-2.599706096327376e-13,
|
|
8974
|
+
|
|
8975
|
+
-2.382191739347923e-13,
|
|
8976
|
+
-6.423305872147843e-13,
|
|
8977
|
+
-9.400849094049696e-13,
|
|
8978
|
+
-1.122435026096556e-12,
|
|
8979
|
+
-1.183840321267481e-12,
|
|
8980
|
+
-1.122435026096556e-12,
|
|
8981
|
+
-9.400849094049694e-13,
|
|
8982
|
+
-6.423305872147840e-13,
|
|
8983
|
+
-2.382191739347918e-13,
|
|
9081
8984
|
],
|
|
9082
8985
|
[
|
|
9083
8986
|
2.382191739347913e-13,
|
|
@@ -9100,15 +9003,15 @@ function NewMDCT() {
|
|
|
9100
9003
|
8.371015190102975e-13,
|
|
9101
9004
|
2.599706096327376e-13,
|
|
9102
9005
|
|
|
9103
|
-
-
|
|
9104
|
-
-
|
|
9105
|
-
-
|
|
9106
|
-
-
|
|
9107
|
-
-
|
|
9108
|
-
-
|
|
9109
|
-
-
|
|
9110
|
-
-
|
|
9111
|
-
-
|
|
9006
|
+
-5.461314069809755e-12,
|
|
9007
|
+
-4.921085770524055e-12,
|
|
9008
|
+
-4.343405037091838e-12,
|
|
9009
|
+
-3.732668368707687e-12,
|
|
9010
|
+
-3.093523840190885e-12,
|
|
9011
|
+
-2.430835727329465e-12,
|
|
9012
|
+
-1.734679010007751e-12,
|
|
9013
|
+
-9.748253656609281e-13,
|
|
9014
|
+
-2.797435120168326e-13,
|
|
9112
9015
|
|
|
9113
9016
|
0.000000000000000e+00,
|
|
9114
9017
|
0.000000000000000e+00,
|
|
@@ -9116,9 +9019,9 @@ function NewMDCT() {
|
|
|
9116
9019
|
0.000000000000000e+00,
|
|
9117
9020
|
0.000000000000000e+00,
|
|
9118
9021
|
0.000000000000000e+00,
|
|
9119
|
-
-
|
|
9120
|
-
-
|
|
9121
|
-
-
|
|
9022
|
+
-2.283748241799531e-13,
|
|
9023
|
+
-4.037858874020686e-13,
|
|
9024
|
+
-2.146547464825323e-13,
|
|
9122
9025
|
],
|
|
9123
9026
|
[
|
|
9124
9027
|
1.316524975873958e-01, /* win[SHORT_TYPE] */
|
|
@@ -9139,19 +9042,19 @@ function NewMDCT() {
|
|
|
9139
9042
|
0.64278760968653936292,
|
|
9140
9043
|
0.34202014332566882393,
|
|
9141
9044
|
0.93969262078590842791,
|
|
9142
|
-
-0.
|
|
9143
|
-
-0.
|
|
9045
|
+
-0.17364817766693030343,
|
|
9046
|
+
-0.76604444311897790243,
|
|
9144
9047
|
0.86602540378443870761,
|
|
9145
9048
|
0.500000000000000e+00,
|
|
9146
9049
|
|
|
9147
|
-
-
|
|
9148
|
-
-
|
|
9149
|
-
-
|
|
9150
|
-
-
|
|
9151
|
-
-
|
|
9152
|
-
-
|
|
9153
|
-
-
|
|
9154
|
-
-
|
|
9050
|
+
-5.144957554275265e-01, /* ca */
|
|
9051
|
+
-4.717319685649723e-01,
|
|
9052
|
+
-3.133774542039019e-01,
|
|
9053
|
+
-1.819131996109812e-01,
|
|
9054
|
+
-9.457419252642064e-02,
|
|
9055
|
+
-4.096558288530405e-02,
|
|
9056
|
+
-1.419856857247115e-02,
|
|
9057
|
+
-3.699974673760037e-03,
|
|
9155
9058
|
|
|
9156
9059
|
8.574929257125442e-01, /* cs */
|
|
9157
9060
|
8.817419973177052e-01,
|
|
@@ -9183,25 +9086,25 @@ function NewMDCT() {
|
|
|
9183
9086
|
9.748253656609281e-13,
|
|
9184
9087
|
2.797435120168326e-13,
|
|
9185
9088
|
|
|
9186
|
-
-
|
|
9187
|
-
-
|
|
9188
|
-
-
|
|
9189
|
-
-
|
|
9190
|
-
-
|
|
9191
|
-
-
|
|
9192
|
-
-
|
|
9193
|
-
-
|
|
9194
|
-
-
|
|
9195
|
-
|
|
9196
|
-
-
|
|
9197
|
-
-
|
|
9198
|
-
-
|
|
9199
|
-
-
|
|
9200
|
-
-
|
|
9201
|
-
-
|
|
9202
|
-
-
|
|
9203
|
-
-
|
|
9204
|
-
-
|
|
9089
|
+
-5.456116108943413e-12,
|
|
9090
|
+
-4.878985199565852e-12,
|
|
9091
|
+
-4.240448995017367e-12,
|
|
9092
|
+
-3.559909094758253e-12,
|
|
9093
|
+
-2.858043359288075e-12,
|
|
9094
|
+
-2.156177623817898e-12,
|
|
9095
|
+
-1.475637723558782e-12,
|
|
9096
|
+
-8.371015190102975e-13,
|
|
9097
|
+
-2.599706096327376e-13,
|
|
9098
|
+
|
|
9099
|
+
-2.382191739347913e-13,
|
|
9100
|
+
-6.423305872147834e-13,
|
|
9101
|
+
-9.400849094049688e-13,
|
|
9102
|
+
-1.122435026096556e-12,
|
|
9103
|
+
-1.183840321267481e-12,
|
|
9104
|
+
-1.122435026096556e-12,
|
|
9105
|
+
-9.400849094049688e-13,
|
|
9106
|
+
-6.423305872147841e-13,
|
|
9107
|
+
-2.382191739347918e-13,
|
|
9205
9108
|
]
|
|
9206
9109
|
];
|
|
9207
9110
|
|
|
@@ -9792,7 +9695,7 @@ function NewMDCT() {
|
|
|
9792
9695
|
abort();//fix cc 精简
|
|
9793
9696
|
}
|
|
9794
9697
|
if (type == Encoder.SHORT_TYPE) {
|
|
9795
|
-
for (var k = -
|
|
9698
|
+
for (var k = -NS / 4; k < 0; k++) {
|
|
9796
9699
|
var w = win[Encoder.SHORT_TYPE][k + 3];
|
|
9797
9700
|
mdct_enc[mdct_encPos + k * 3 + 9] = band0[9 + k][order[band]]
|
|
9798
9701
|
* w - band0[8 - k][order[band]];
|
|
@@ -9810,7 +9713,7 @@ function NewMDCT() {
|
|
|
9810
9713
|
mdct_short(mdct_enc, mdct_encPos);
|
|
9811
9714
|
} else {
|
|
9812
9715
|
var work = new_float(18);
|
|
9813
|
-
for (var k = -
|
|
9716
|
+
for (var k = -NL / 4; k < 0; k++) {
|
|
9814
9717
|
var a, b;
|
|
9815
9718
|
a = win[type][k + 27]
|
|
9816
9719
|
* band1[k + 9][order[band]]
|
|
@@ -11870,9 +11773,9 @@ function PsyModel() {
|
|
|
11870
11773
|
}
|
|
11871
11774
|
|
|
11872
11775
|
var fircoef = [
|
|
11873
|
-
-
|
|
11874
|
-
-
|
|
11875
|
-
-
|
|
11776
|
+
-8.65163e-18 * 2, -0.00851586 * 2, -6.74764e-18 * 2, 0.0209036 * 2,
|
|
11777
|
+
-3.36639e-17 * 2, -0.0438162 * 2, -1.54175e-17 * 2, 0.0931738 * 2,
|
|
11778
|
+
-5.52212e-17 * 2, -0.313819 * 2
|
|
11876
11779
|
];
|
|
11877
11780
|
|
|
11878
11781
|
this.L3psycho_anal_ns = function (gfp, buffer, bufPos, gr_out, masking_ratio, masking_MS_ratio, percep_entropy, percep_MS_entropy, energy, blocktype_d) {
|
|
@@ -12246,7 +12149,7 @@ function PsyModel() {
|
|
|
12246
12149
|
tempy = 15.811389 + 7.5 * tempx - 17.5
|
|
12247
12150
|
* Math.sqrt(1.0 + tempx * tempx);
|
|
12248
12151
|
|
|
12249
|
-
if (tempy <= -60)
|
|
12152
|
+
if (tempy <= -60.0)
|
|
12250
12153
|
return 0.0;
|
|
12251
12154
|
|
|
12252
12155
|
tempx = Math.exp((x + tempy) * LN_TO_LOG10);
|
|
@@ -12612,7 +12515,7 @@ function PsyModel() {
|
|
|
12612
12515
|
* minval this is an ISO MPEG1 thing, dont know if it is really
|
|
12613
12516
|
* needed
|
|
12614
12517
|
*/
|
|
12615
|
-
x = (-7 + bval[i] * 7.0 / 12.0);
|
|
12518
|
+
x = (-7.0 + bval[i] * 7.0 / 12.0);
|
|
12616
12519
|
if (bval[i] > 12) {
|
|
12617
12520
|
x *= 1 + Math.log(1 + x) * 3.1;
|
|
12618
12521
|
}
|
|
@@ -12634,7 +12537,7 @@ function PsyModel() {
|
|
|
12634
12537
|
fft.init_fft(gfc);
|
|
12635
12538
|
|
|
12636
12539
|
/* setup temporal masking */
|
|
12637
|
-
gfc.decay = Math.exp(-1 * LOG10
|
|
12540
|
+
gfc.decay = Math.exp(-1.0 * LOG10
|
|
12638
12541
|
/ (temporalmask_sustain_sec * sfreq / 192.0));
|
|
12639
12542
|
|
|
12640
12543
|
{
|
|
@@ -12660,7 +12563,7 @@ function PsyModel() {
|
|
|
12660
12563
|
* per second
|
|
12661
12564
|
*/
|
|
12662
12565
|
var frame_duration = (576. * gfc.mode_gr / sfreq);
|
|
12663
|
-
gfc.ATH.decay = Math.pow(10., -12 / 10. * frame_duration);
|
|
12566
|
+
gfc.ATH.decay = Math.pow(10., -12. / 10. * frame_duration);
|
|
12664
12567
|
gfc.ATH.adjust = 0.01;
|
|
12665
12568
|
/* minimum, for leading low loudness */
|
|
12666
12569
|
gfc.ATH.adjustLimit = 1.0;
|
|
@@ -12751,7 +12654,7 @@ function PsyModel() {
|
|
|
12751
12654
|
*/
|
|
12752
12655
|
|
|
12753
12656
|
// the following Hack allows to ask for the lowest value
|
|
12754
|
-
if (f <
|
|
12657
|
+
if (f < -.3)
|
|
12755
12658
|
f = 3410;
|
|
12756
12659
|
|
|
12757
12660
|
// convert to khz
|
|
@@ -12981,7 +12884,7 @@ function Lame() {
|
|
|
12981
12884
|
gfc.RadioGain = 0;
|
|
12982
12885
|
gfc.AudiophileGain = 0;
|
|
12983
12886
|
gfc.noclipGainChange = 0;
|
|
12984
|
-
gfc.noclipScale = -1;
|
|
12887
|
+
gfc.noclipScale = -1.0;
|
|
12985
12888
|
|
|
12986
12889
|
gfp.preset = 0;
|
|
12987
12890
|
|
|
@@ -13838,7 +13741,7 @@ function Lame() {
|
|
|
13838
13741
|
|
|
13839
13742
|
/* initialize internal adaptive ATH settings -jd */
|
|
13840
13743
|
gfc.ATH.aaSensitivityP = Math.pow(10.0, gfp.athaa_sensitivity
|
|
13841
|
-
/ -10);
|
|
13744
|
+
/ -10.0);
|
|
13842
13745
|
|
|
13843
13746
|
if (gfp.short_blocks == null) {
|
|
13844
13747
|
gfp.short_blocks = ShortBlock.short_block_allowed;
|