Merge latest green fx-team changeset and mozilla-central

This commit is contained in:
Ed Morley 2013-11-12 15:09:49 +00:00
Родитель d9263fbf50 f3fd933326
Коммит 08528ae4ff
125 изменённых файлов: 43915 добавлений и 1020 удалений

Просмотреть файл

@ -50,6 +50,10 @@ ifneq (,$(filter WINNT Darwin Android,$(OS_TARGET)))
DEFINES += -DMOZ_SHARED_MOZGLUE=1
endif
ifneq (,$(filter rtsp,$(NECKO_PROTOCOLS)))
DEFINES += -DMOZ_RTSP
endif
ifdef MOZ_PKG_MANIFEST_P
$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) FORCE
$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@)

Просмотреть файл

@ -1081,7 +1081,7 @@ pref("devtools.commands.dir", "");
// Enable the app manager
pref("devtools.appmanager.enabled", true);
pref("devtools.appmanager.lastTab", "help");
pref("devtools.appmanager.firstrun", true);
pref("devtools.appmanager.manifestEditor.enabled", false);
// Toolbox preferences

Просмотреть файл

@ -162,13 +162,16 @@ let UI = {
if (!this.connected) {
return;
}
let app = this.store.object.apps.all.filter(a => a.manifestURL == manifest)[0];
getTargetForApp(this.connection.client,
this.listTabsResponse.webappsActor,
manifest).then((target) => {
top.UI.openAndShowToolboxForTarget(target, app.name, app.iconURL);
gDevTools.showToolbox(target,
null,
devtools.Toolbox.HostType.WINDOW).then(toolbox => {
this.connection.once(Connection.Events.DISCONNECTED, () => {
toolbox.destroy();
});
});
}, console.error);
},

Просмотреть файл

@ -7,176 +7,76 @@ Cu.import("resource:///modules/devtools/gDevTools.jsm");
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const {require} = devtools;
const {ConnectionManager, Connection} = require("devtools/client/connection-manager");
const promise = require("sdk/core/promise");
const prefs = require('sdk/preferences/service');
let connection;
let UI = {
_toolboxTabCursor: 0,
_handledTargets: new Map(),
connection: null,
init: function() {
this.onLoad = this.onLoad.bind(this);
this.onUnload = this.onUnload.bind(this);
this.onMessage = this.onMessage.bind(this);
this.onConnected = this.onConnected.bind(this);
this.onDisconnected = this.onDisconnected.bind(this);
window.addEventListener("load", this.onLoad);
window.addEventListener("unload", this.onUnload);
window.addEventListener("message", this.onMessage);
},
onLoad: function() {
window.removeEventListener("load", this.onLoad);
let defaultPanel = prefs.get("devtools.appmanager.lastTab");
let panelExists = !!document.querySelector("." + defaultPanel + "-panel");
this.selectTab(panelExists ? defaultPanel : "projects");
},
onUnload: function() {
window.removeEventListener("unload", this.onUnload);
window.removeEventListener("message", this.onMessage);
if (this.connection) {
this.connection.off(Connection.Status.CONNECTED, this.onConnected);
this.connection.off(Connection.Status.DISCONNECTED, this.onDisconnected);
}
},
onMessage: function(event) {
try {
let json = JSON.parse(event.data);
switch (json.name) {
case "connection":
let cid = +json.cid;
for (let c of ConnectionManager.connections) {
if (c.uid == cid) {
this.onNewConnection(c);
break;
}
window.addEventListener("message", function(event) {
try {
let json = JSON.parse(event.data);
switch (json.name) {
case "connection":
let cid = +json.cid;
for (let c of ConnectionManager.connections) {
if (c.uid == cid) {
connection = c;
onNewConnection();
break;
}
break;
case "closeHelp":
this.selectTab("projects");
break;
case "toolbox-raise":
this.selectTab(json.uid);
break;
case "toolbox-close":
this.closeToolboxTab(json.uid);
break;
default:
Cu.reportError("Unknown message: " + json.name);
}
} catch(e) { Cu.reportError(e); }
// Forward message
let panels = document.querySelectorAll(".panel");
for (let frame of panels) {
frame.contentWindow.postMessage(event.data, "*");
}
},
selectTabFromButton: function(button) {
if (!button.hasAttribute("panel"))
return;
this.selectTab(button.getAttribute("panel"));
},
selectTab: function(panel) {
let isToolboxTab = false;
for (let type of ["button", "panel"]) {
let oldSelection = document.querySelector("." + type + "[selected]");
let newSelection = document.querySelector("." + panel + "-" + type);
if (oldSelection) oldSelection.removeAttribute("selected");
if (newSelection) {
newSelection.scrollIntoView(false);
newSelection.setAttribute("selected", "true");
if (newSelection.classList.contains("toolbox")) {
isToolboxTab = true;
}
}
break;
case "closeHelp":
selectTab("projects");
break;
default:
Cu.reportError("Unknown message: " + json.name);
}
if (!isToolboxTab) {
prefs.set("devtools.appmanager.lastTab", panel);
}
},
} catch(e) { Cu.reportError(e); }
onNewConnection: function(connection) {
this.connection = connection;
this.connection.on(Connection.Status.CONNECTED, this.onConnected);
this.connection.on(Connection.Status.DISCONNECTED, this.onDisconnected);
},
// Forward message
let panels = document.querySelectorAll(".panel");
for (let frame of panels) {
frame.contentWindow.postMessage(event.data, "*");
}
}, false);
onConnected: function() {
document.querySelector("#content").classList.add("connected");
},
window.addEventListener("unload", function onUnload() {
window.removeEventListener("unload", onUnload);
if (connection) {
connection.off(Connection.Status.CONNECTED, onConnected);
connection.off(Connection.Status.DISCONNECTED, onDisconnected);
}
});
onDisconnected: function() {
for (let [,toolbox] of this._handledTargets) {
if (toolbox) {
toolbox.destroy();
}
}
this._handledTargets.clear();
document.querySelector("#content").classList.remove("connected");
},
function onNewConnection() {
connection.on(Connection.Status.CONNECTED, onConnected);
connection.on(Connection.Status.DISCONNECTED, onDisconnected);
}
createToolboxTab: function(name, iconURL, uid) {
let button = document.createElement("button");
button.className = "button toolbox " + uid + "-button";
button.setAttribute("panel", uid);
button.textContent = name;
button.setAttribute("style", "background-image: url(" + iconURL + ")");
let toolboxTabs = document.querySelector("#toolbox-tabs");
toolboxTabs.appendChild(button);
let iframe = document.createElement("iframe");
iframe.setAttribute("flex", "1");
iframe.className = "panel toolbox " + uid + "-panel";
let panels = document.querySelector("#tab-panels");
panels.appendChild(iframe);
this.selectTab(uid);
return iframe;
},
function onConnected() {
document.querySelector("#content").classList.add("connected");
}
closeToolboxTab: function(uid) {
let buttonToDestroy = document.querySelector("." + uid + "-button");
let panelToDestroy = document.querySelector("." + uid + "-panel");
function onDisconnected() {
document.querySelector("#content").classList.remove("connected");
}
if (buttonToDestroy.hasAttribute("selected")) {
let lastTab = prefs.get("devtools.appmanager.lastTab");
this.selectTab(lastTab);
}
buttonToDestroy.remove();
panelToDestroy.remove();
},
openAndShowToolboxForTarget: function(target, name, icon) {
let host = devtools.Toolbox.HostType.CUSTOM;
if (!this._handledTargets.has(target)) {
let uid = "uid" + this._toolboxTabCursor++;
let iframe = this.createToolboxTab(name, icon, uid);
let options = { customIframe: iframe , uid: uid };
this._handledTargets.set(target, null);
return gDevTools.showToolbox(target, null, host, options).then(toolbox => {
this._handledTargets.set(target, toolbox);
toolbox.once("destroyed", () => {
this._handledTargets.delete(target)
});
});
} else {
let toolbox = this._handledTargets.get(target);
if (!toolbox) {
// Target is handled, but toolbox is still being
// created.
return promise.resolve(null);
}
return gDevTools.showToolbox(target, null, host);
}
function selectTab(id) {
for (let type of ["button", "panel"]) {
let oldSelection = document.querySelector("." + type + "[selected]");
let newSelection = document.querySelector("." + id + "-" + type);
if (oldSelection) oldSelection.removeAttribute("selected");
if (newSelection) newSelection.setAttribute("selected", "true");
}
if (id != "help") {
// Might be the first time the user is accessing the actual app manager
prefs.set("devtools.appmanager.firstrun", false);
}
}
UI.init();
let firstRun = prefs.get("devtools.appmanager.firstrun");
if (firstRun) {
selectTab("help");
} else {
selectTab("projects");
}

Просмотреть файл

@ -22,11 +22,11 @@
<vbox id="root" flex="1">
<hbox id="content" flex="1">
<vbox id="tabs" onclick="UI.selectTabFromButton(event.target)">
<button class="button projects-button" panel="projects">&index.projects2;</button>
<button class="button device-button" panel="device">&index.device2;</button>
<vbox id="toolbox-tabs" flex="1"/>
<button class="button help-button" panel="help">&index.help;</button>
<vbox id="tabs">
<button class="button projects-button" onclick="selectTab('projects')">&index.projects2;</button>
<button class="button device-button" onclick="selectTab('device')">&index.device2;</button>
<spacer flex="1"/>
<button class="button help-button" onclick="selectTab('help')">&index.help;</button>
</vbox>
<hbox id="tab-panels" flex="1">
<iframe flex="1" class="panel projects-panel" src="chrome://browser/content/devtools/app-manager/projects.xhtml"/>

Просмотреть файл

@ -360,15 +360,25 @@ let UI = {
loop(0);
return deferred.promise;
};
let onTargetReady = (target) => {
// Finally, when it's finally opened, display the toolbox
let deferred = promise.defer();
gDevTools.showToolbox(target,
null,
devtools.Toolbox.HostType.WINDOW).then(toolbox => {
this.connection.once(Connection.Events.DISCONNECTED, () => {
toolbox.destroy();
});
deferred.resolve(toolbox);
});
return deferred.promise;
};
// First try to open the app
this.start(project)
.then(null, onFailedToStart)
.then(onStarted)
.then((target) =>
top.UI.openAndShowToolboxForTarget(target,
project.manifest.name,
project.icon))
.then(onTargetReady)
.then(() => {
// And only when the toolbox is opened, release the button
button.disabled = false;

Просмотреть файл

@ -206,13 +206,11 @@ DevTools.prototype = {
* The id of the tool to show
* @param {Toolbox.HostType} hostType
* The type of host (bottom, window, side)
* @param {object} hostOptions
* Options for host specifically
*
* @return {Toolbox} toolbox
* The toolbox that was opened
*/
showToolbox: function(target, toolId, hostType, hostOptions) {
showToolbox: function(target, toolId, hostType) {
let deferred = promise.defer();
let toolbox = this._toolboxes.get(target);
@ -235,7 +233,7 @@ DevTools.prototype = {
}
else {
// No toolbox for target, create one
toolbox = new devtools.Toolbox(target, toolId, hostType, hostOptions);
toolbox = new devtools.Toolbox(target, toolId, hostType);
this._toolboxes.set(target, toolbox);

Просмотреть файл

@ -22,4 +22,3 @@ support-files = head.js
[browser_toolbox_window_shortcuts.js]
[browser_toolbox_window_title_changes.js]
[browser_toolbox_zoom.js]
[browser_toolbox_custom_host.js]

Просмотреть файл

@ -1,60 +0,0 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
Cu.import("resource://gre/modules/Services.jsm");
let temp = {}
Cu.import("resource:///modules/devtools/gDevTools.jsm", temp);
let DevTools = temp.DevTools;
Cu.import("resource://gre/modules/devtools/LayoutHelpers.jsm", temp);
let LayoutHelpers = temp.LayoutHelpers;
Cu.import("resource://gre/modules/devtools/Loader.jsm", temp);
let devtools = temp.devtools;
let Toolbox = devtools.Toolbox;
let toolbox, iframe, target, tab;
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
target = TargetFactory.forTab(gBrowser.selectedTab);
window.addEventListener("message", onMessage);
iframe = document.createElement("iframe");
document.documentElement.appendChild(iframe);
gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) {
gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true);
let options = {customIframe: iframe};
gDevTools.showToolbox(target, null, Toolbox.HostType.CUSTOM, options)
.then(testCustomHost, console.error)
.then(null, console.error);
}, true);
content.location = "data:text/html,test custom host";
function onMessage(event) {
info("onMessage: " + event.data);
let json = JSON.parse(event.data);
if (json.name == "toolbox-close") {
ok("Got the `toolbox-close` message");
cleanup();
}
}
function testCustomHost(toolbox) {
is(toolbox.doc.defaultView.top, window, "Toolbox is included in browser.xul");
is(toolbox.doc, iframe.contentDocument, "Toolbox is in the custom iframe");
executeSoon(() => gBrowser.removeCurrentTab());
}
function cleanup() {
window.removeEventListener("message", onMessage);
iframe.remove();
finish();
}
}

Просмотреть файл

@ -10,7 +10,6 @@ let promise = require("sdk/core/promise");
let EventEmitter = require("devtools/shared/event-emitter");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/devtools/DOMHelpers.jsm");
/**
* A toolbox host represents an object that contains a toolbox (e.g. the
@ -24,8 +23,7 @@ Cu.import("resource:///modules/devtools/DOMHelpers.jsm");
exports.Hosts = {
"bottom": BottomHost,
"side": SidebarHost,
"window": WindowHost,
"custom": CustomHost
"window": WindowHost
}
/**
@ -63,18 +61,18 @@ BottomHost.prototype = {
this._nbox.appendChild(this.frame);
let frameLoad = function() {
this.frame.removeEventListener("DOMContentLoaded", frameLoad, true);
this.emit("ready", this.frame);
deferred.resolve(this.frame);
}.bind(this);
this.frame.tooltip = "aHTMLTooltip";
this.frame.addEventListener("DOMContentLoaded", frameLoad, true);
// we have to load something so we can switch documents if we have to
this.frame.setAttribute("src", "about:blank");
let domHelper = new DOMHelpers(this.frame.contentWindow);
domHelper.onceDOMReady(frameLoad);
focusTab(this.hostTab);
return deferred.promise;
@ -274,59 +272,6 @@ WindowHost.prototype = {
}
}
/**
* Host object for the toolbox in its own tab
*/
function CustomHost(hostTab, options) {
this.frame = options.customIframe;
this.uid = options.uid;
EventEmitter.decorate(this);
}
CustomHost.prototype = {
type: "custom",
_sendMessageToTopWindow: function CH__sendMessageToTopWindow(msg) {
// It's up to the custom frame owner (parent window) to honor
// "close" or "raise" instructions.
let topWindow = this.frame.ownerDocument.defaultView;
let json = {name:"toolbox-" + msg, uid: this.uid}
topWindow.postMessage(JSON.stringify(json), "*");
},
/**
* Create a new xul window to contain the toolbox.
*/
create: function CH_create() {
return promise.resolve(this.frame);
},
/**
* Raise the host.
*/
raise: function CH_raise() {
this._sendMessageToTopWindow("raise");
},
/**
* Set the toolbox title.
*/
setTitle: function CH_setTitle(title) {
// Not supported
},
/**
* Destroy the window.
*/
destroy: function WH_destroy() {
if (!this._destroyed) {
this._destroyed = true;
this._sendMessageToTopWindow("close");
}
return promise.resolve(null);
}
}
/**
* Switch to the given tab in a browser and focus the browser window
*/

Просмотреть файл

@ -19,7 +19,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/devtools/gDevTools.jsm");
Cu.import("resource:///modules/devtools/scratchpad-manager.jsm");
Cu.import("resource:///modules/devtools/DOMHelpers.jsm");
loader.lazyGetter(this, "Hosts", () => require("devtools/framework/toolbox-hosts").Hosts);
@ -56,10 +55,8 @@ loader.lazyGetter(this, "Requisition", () => {
* Tool to select initially
* @param {Toolbox.HostType} hostType
* Type of host that will host the toolbox (e.g. sidebar, window)
* @param {object} hostOptions
* Options for host specifically
*/
function Toolbox(target, selectedTool, hostType, hostOptions) {
function Toolbox(target, selectedTool, hostType) {
this._target = target;
this._toolPanels = new Map();
this._telemetry = new Telemetry();
@ -82,7 +79,7 @@ function Toolbox(target, selectedTool, hostType, hostOptions) {
}
this._defaultToolId = selectedTool;
this._host = this._createHost(hostType, hostOptions);
this._host = this._createHost(hostType);
EventEmitter.decorate(this);
@ -102,8 +99,7 @@ exports.Toolbox = Toolbox;
Toolbox.HostType = {
BOTTOM: "bottom",
SIDE: "side",
WINDOW: "window",
CUSTOM: "custom"
WINDOW: "window"
};
Toolbox.prototype = {
@ -191,6 +187,8 @@ Toolbox.prototype = {
let deferred = promise.defer();
let domReady = () => {
iframe.removeEventListener("DOMContentLoaded", domReady, true);
this.isReady = true;
let closeButton = this.doc.getElementById("toolbox-close");
@ -213,11 +211,9 @@ Toolbox.prototype = {
});
};
iframe.addEventListener("DOMContentLoaded", domReady, true);
iframe.setAttribute("src", this._URL);
let domHelper = new DOMHelpers(iframe.contentWindow);
domHelper.onceDOMReady(domReady);
return deferred.promise;
});
},
@ -391,7 +387,6 @@ Toolbox.prototype = {
for (let type in Toolbox.HostType) {
let position = Toolbox.HostType[type];
if (position == this.hostType ||
position == Toolbox.HostType.CUSTOM ||
(!sideEnabled && position == Toolbox.HostType.SIDE)) {
continue;
}
@ -560,6 +555,8 @@ Toolbox.prototype = {
vbox.appendChild(iframe);
let onLoad = () => {
iframe.removeEventListener("DOMContentLoaded", onLoad, true);
let built = definition.build(iframe.contentWindow, this);
promise.resolve(built).then((panel) => {
this._toolPanels.set(id, panel);
@ -569,25 +566,8 @@ Toolbox.prototype = {
});
};
iframe.addEventListener("DOMContentLoaded", onLoad, true);
iframe.setAttribute("src", definition.url);
// Depending on the host, iframe.contentWindow is not always
// defined at this moment. If it is not defined, we use an
// event listener on the iframe DOM node. If it's defined,
// we use the chromeEventHandler. We can't use a listener
// on the DOM node every time because this won't work
// if the (xul chrome) iframe is loaded in a content docshell.
if (iframe.contentWindow) {
let domHelper = new DOMHelpers(iframe.contentWindow);
domHelper.onceDOMReady(onLoad);
} else {
let callback = () => {
iframe.removeEventListener("DOMContentLoaded", callback);
onLoad();
}
iframe.addEventListener("DOMContentLoaded", callback);
}
return deferred.promise;
},
@ -752,13 +732,13 @@ Toolbox.prototype = {
* @return {Host} host
* The created host object
*/
_createHost: function(hostType, options) {
_createHost: function(hostType) {
if (!Hosts[hostType]) {
throw new Error("Unknown hostType: " + hostType);
}
// clean up the toolbox if its window is closed
let newHost = new Hosts[hostType](this.target.tab, options);
let newHost = new Hosts[hostType](this.target.tab);
newHost.on("window-closed", this.destroy);
return newHost;
},
@ -786,9 +766,7 @@ Toolbox.prototype = {
this._host = newHost;
if (this.hostType != Toolbox.HostType.CUSTOM) {
Services.prefs.setCharPref(this._prefs.LAST_HOST, this._host.type);
}
Services.prefs.setCharPref(this._prefs.LAST_HOST, this._host.type);
this._buildDockButtons();
this._addKeysToWindow();

Просмотреть файл

@ -2,10 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
this.EXPORTED_SYMBOLS = ["DOMHelpers"];
/**
@ -17,9 +13,6 @@ this.EXPORTED_SYMBOLS = ["DOMHelpers"];
* The content window, owning the document to traverse.
*/
this.DOMHelpers = function DOMHelpers(aWindow) {
if (!aWindow) {
throw new Error("window can't be null or undefined");
}
this.window = aWindow;
};
@ -127,30 +120,5 @@ DOMHelpers.prototype = {
{
delete this.window;
delete this.treeWalker;
},
/**
* A simple way to be notified (once) when a window becomes
* interactive (DOMContentLoaded).
*
* It is based on the chromeEventHandler. This is useful when
* chrome iframes are loaded in content docshells (in Firefox
* tabs for example).
*/
onceDOMReady: function Helpers_onLocationChange(callback) {
let window = this.window;
let docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
let onReady = function(event) {
if (event.target == window.document) {
docShell.chromeEventHandler.removeEventListener("DOMContentLoaded", onReady, false);
// If in `callback` the URL of the window is changed and a listener to DOMContentLoaded
// is attached, the event we just received will be also be caught by the new listener.
// We want to avoid that so we execute the callback in the next queue.
Services.tm.mainThread.dispatch(callback, 0);
}
}
docShell.chromeEventHandler.addEventListener("DOMContentLoaded", onReady, false);
}
};

Просмотреть файл

@ -12,7 +12,6 @@
#banners-and-logs {
display: flex;
flex-grow: 1;
}
#logs {

Просмотреть файл

@ -14,10 +14,6 @@
background: #252C33;
}
#toolbox-tabs {
overflow-y: auto;
}
.button {
width: 80px;
height: 85px;
@ -58,12 +54,6 @@
display: none;
}
.button.toolbox {
background-repeat: no-repeat;
background-position: center 15px;
background-size: 40px 40px;
}
.projects-button {
background: url('chrome://browser/skin/devtools/app-manager/index-icons.svg') no-repeat;
background-position: left -5px;

Просмотреть файл

@ -10,12 +10,25 @@ dnl The necessary comma after the tuple can't be put here because it
dnl can mess around with things like:
dnl AC_SOMETHING(foo,AC_SUBST(),bar)
define([AC_SUBST],
[ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', r''' [$]$1 ''')
AC_DIVERT_POP()dnl
])])
])])])
dnl Like AC_SUBST, but makes the value available as a set in python,
dnl with values got from the value of the environment variable, split on
dnl whitespaces.
define([AC_SUBST_SET],
[ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_SET_$1], ,
[define([AC_SUBST_SET_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', set(r''' [$]$1 '''.split()))
AC_DIVERT_POP()dnl
])])])
dnl Wrap AC_DEFINE to store values in a format suitable for python.
dnl autoconf's AC_DEFINE still needs to be used to fill confdefs.h,
@ -80,6 +93,7 @@ cat > $CONFIG_STATUS <<EOF
# coding=$encoding
import os
import types
dnl topsrcdir is the top source directory in native form, as opposed to a
dnl form suitable for make.
topsrcdir = '''${WIN_TOP_SRC:-$srcdir}'''
@ -103,7 +117,7 @@ rm confdefs.pytmp confdefs.h
cat >> $CONFIG_STATUS <<\EOF
] ]
substs = [(name[1:-1], value[1:-1]) for name, value in [
substs = [(name[1:-1], value[1:-1] if isinstance(value, types.StringTypes) else value) for name, value in [
EOF
dnl The MOZ_DIVERSION_SUBST output diversion contains AC_SUBSTs, in the

Просмотреть файл

@ -53,7 +53,7 @@ else
REPORT_BUILD = $(info $(shell $(PYTHON) $(MOZILLA_DIR)/config/rebuild_check.py $@ $^))
endif
else
REPORT_BUILD = $(info $(if $(filter $(DEPTH)/%,$@),$(@:$(DEPTH)/%=%),$(notdir $@)))
REPORT_BUILD = $(info $(notdir $@))
endif
ifeq ($(OS_ARCH),OS2)
@ -1536,12 +1536,10 @@ install_targets_sanity = $(if $(filter-out $(notdir $@),$(notdir $(<))),$(error
$(sort $(foreach tier,$(INSTALL_TARGETS_TIERS),$(INSTALL_TARGETS_FILES_$(tier)))):
$(install_targets_sanity)
$(REPORT_BUILD)
$(call install_cmd,$(IFLAGS1) "$<" "$(@D)")
$(sort $(foreach tier,$(INSTALL_TARGETS_TIERS),$(INSTALL_TARGETS_EXECUTABLES_$(tier)))):
$(install_targets_sanity)
$(REPORT_BUILD)
$(call install_cmd,$(IFLAGS2) "$<" "$(@D)")
################################################################################
@ -1603,7 +1601,6 @@ $(foreach tier,$(PP_TARGETS_TIERS), \
PP_TARGETS_ALL_RESULTS := $(sort $(foreach tier,$(PP_TARGETS_TIERS),$(PP_TARGETS_RESULTS_$(tier))))
$(PP_TARGETS_ALL_RESULTS):
$(if $(filter-out $(notdir $@),$(notdir $(<:.in=))),$(error Looks like $@ has an unexpected dependency on $< which breaks PP_TARGETS))
$(REPORT_BUILD)
$(RM) "$@"
$(call py_action,preprocessor,--depend $(MDDEPDIR)/$(@F).pp $(PP_TARGET_FLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) "$<" -o "$@")

Просмотреть файл

@ -3979,6 +3979,9 @@ MOZ_DISABLE_CRYPTOLEGACY=
NSS_DISABLE_DBM=
NECKO_COOKIES=1
NECKO_PROTOCOLS_DEFAULT="about app data file ftp http res viewsource websocket wyciwyg device"
if test -n "$MOZ_RTSP"; then
NECKO_PROTOCOLS_DEFAULT="$NECKO_PROTOCOLS_DEFAULT rtsp"
fi
USE_ARM_KUSER=
BUILD_CTYPES=1
MOZ_USE_NATIVE_POPUP_WINDOWS=
@ -7289,14 +7292,6 @@ if test -n "$MOZ_B2G_FM"; then
fi
AC_SUBST(MOZ_B2G_FM)
dnl ========================================================
dnl = Enable Rtsp Protocol for B2G (Gonk usually)
dnl ========================================================
if test -n "$MOZ_RTSP"; then
AC_DEFINE(MOZ_RTSP)
fi
AC_SUBST(MOZ_RTSP)
dnl ========================================================
dnl = Enable Bluetooth Interface for B2G (Gonk usually)
dnl ========================================================
@ -8105,7 +8100,7 @@ done],
NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
dnl Remove dupes
NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
AC_SUBST(NECKO_PROTOCOLS)
AC_SUBST_SET(NECKO_PROTOCOLS)
for p in $NECKO_PROTOCOLS; do
AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_PROTOCOL_$p"

Просмотреть файл

@ -34,4 +34,7 @@ DEPRECATED_OPERATION(LenientThis)
DEPRECATED_OPERATION(GetPreventDefault)
DEPRECATED_OPERATION(GetSetUserData)
DEPRECATED_OPERATION(MozGetAsFile)
DEPRECATED_OPERATION(UseOfCaptureEvents)
DEPRECATED_OPERATION(UseOfReleaseEvents)
DEPRECATED_OPERATION(UseOfDOM3LoadMethod)
DEPRECATED_OPERATION(ShowModalDialog)

Просмотреть файл

@ -412,6 +412,72 @@ ParseTypeAttribute(const nsAString& aType, JSVersion* aVersion)
return true;
}
bool
CSPAllowsInlineScript(nsIScriptElement *aElement, nsIDocument *aDocument)
{
nsCOMPtr<nsIContentSecurityPolicy> csp;
nsresult rv = aDocument->NodePrincipal()->GetCsp(getter_AddRefs(csp));
NS_ENSURE_SUCCESS(rv, false);
if (!csp) {
// no CSP --> allow
return true;
}
bool reportViolation = false;
bool allowInlineScript = true;
rv = csp->GetAllowsInlineScript(&reportViolation, &allowInlineScript);
NS_ENSURE_SUCCESS(rv, false);
bool foundNonce = false;
nsAutoString nonce;
if (!allowInlineScript) {
nsCOMPtr<nsIContent> scriptContent = do_QueryInterface(aElement);
foundNonce = scriptContent->GetAttr(kNameSpaceID_None, nsGkAtoms::nonce, nonce);
if (foundNonce) {
// We can overwrite the outparams from GetAllowsInlineScript because
// if the nonce is correct, then we don't want to report the original
// inline violation (it has been whitelisted by the nonce), and if
// the nonce is incorrect, then we want to return just the specific
// "nonce violation" rather than both a "nonce violation" and
// a generic "inline violation".
rv = csp->GetAllowsNonce(nonce, nsIContentPolicy::TYPE_SCRIPT,
&reportViolation, &allowInlineScript);
NS_ENSURE_SUCCESS(rv, false);
}
}
if (reportViolation) {
// gather information to log with violation report
nsIURI* uri = aDocument->GetDocumentURI();
nsAutoCString asciiSpec;
uri->GetAsciiSpec(asciiSpec);
nsAutoString scriptText;
aElement->GetScriptText(scriptText);
// cap the length of the script sample at 40 chars
if (scriptText.Length() > 40) {
scriptText.Truncate(40);
scriptText.AppendLiteral("...");
}
// The type of violation to report is determined by whether there was
// a nonce present.
unsigned short violationType = foundNonce ?
nsIContentSecurityPolicy::VIOLATION_TYPE_NONCE_SCRIPT :
nsIContentSecurityPolicy::VIOLATION_TYPE_INLINE_SCRIPT;
csp->LogViolationDetails(violationType, NS_ConvertUTF8toUTF16(asciiSpec),
scriptText, aElement->GetScriptLineNumber(), nonce);
}
if (!allowInlineScript) {
NS_ASSERTION(reportViolation,
"CSP blocked inline script but is not reporting a violation");
return false;
}
return true;
}
bool
nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
{
@ -619,63 +685,9 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
return false;
}
nsCOMPtr<nsIContentSecurityPolicy> csp;
rv = mDocument->NodePrincipal()->GetCsp(getter_AddRefs(csp));
NS_ENSURE_SUCCESS(rv, false);
if (csp) {
PR_LOG(gCspPRLog, PR_LOG_DEBUG, ("New ScriptLoader ****with CSP****"));
bool reportViolation = false;
bool allowInlineScript = true;
rv = csp->GetAllowsInlineScript(&reportViolation, &allowInlineScript);
NS_ENSURE_SUCCESS(rv, false);
bool foundNonce = false;
nsAutoString nonce;
if (!allowInlineScript) {
foundNonce = scriptContent->GetAttr(kNameSpaceID_None, nsGkAtoms::nonce, nonce);
if (foundNonce) {
// We can overwrite the outparams from GetAllowsInlineScript because
// if the nonce is correct, then we don't want to report the original
// inline violation (it has been whitelisted by the nonce), and if
// the nonce is incorrect, then we want to return just the specific
// "nonce violation" rather than both a "nonce violation" and
// a generic "inline violation".
rv = csp->GetAllowsNonce(nonce, nsIContentPolicy::TYPE_SCRIPT,
&reportViolation, &allowInlineScript);
NS_ENSURE_SUCCESS(rv, false);
}
}
if (reportViolation) {
// gather information to log with violation report
nsIURI* uri = mDocument->GetDocumentURI();
nsAutoCString asciiSpec;
uri->GetAsciiSpec(asciiSpec);
nsAutoString scriptText;
aElement->GetScriptText(scriptText);
// cap the length of the script sample at 40 chars
if (scriptText.Length() > 40) {
scriptText.Truncate(40);
scriptText.AppendLiteral("...");
}
// The type of violation to report is determined by whether there was
// a nonce present.
unsigned short violationType = foundNonce ?
nsIContentSecurityPolicy::VIOLATION_TYPE_NONCE_SCRIPT :
nsIContentSecurityPolicy::VIOLATION_TYPE_INLINE_SCRIPT;
csp->LogViolationDetails(violationType, NS_ConvertUTF8toUTF16(asciiSpec),
scriptText, aElement->GetScriptLineNumber(), nonce);
}
if (!allowInlineScript) {
NS_ASSERTION(reportViolation,
"CSP blocked inline script but is not reporting a violation");
return false;
}
// Does CSP allow this inline script to run?
if (!CSPAllowsInlineScript(aElement, mDocument)) {
return false;
}
// Inline scripts ignore ther CORS mode and are always CORS_NONE

Двоичные данные
content/html/content/test/test_bug615595.html

Двоичный файл не отображается.

Просмотреть файл

@ -143,15 +143,6 @@ static bool ConvertToMidasInternalCommand(const nsAString & inCommandID,
// ==================================================================
// =
// ==================================================================
static void
ReportUseOfDeprecatedMethod(nsHTMLDocument* aDoc, const char* aWarning)
{
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM Events"), aDoc,
nsContentUtils::eDOM_PROPERTIES,
aWarning);
}
static nsresult
RemoveFromAgentSheets(nsCOMArray<nsIStyleSheet> &aAgentSheets, const nsAString& url)
{
@ -2134,14 +2125,14 @@ nsHTMLDocument::GetSelection(ErrorResult& rv)
NS_IMETHODIMP
nsHTMLDocument::CaptureEvents(int32_t aEventFlags)
{
ReportUseOfDeprecatedMethod(this, "UseOfCaptureEventsWarning");
WarnOnceAbout(nsIDocument::eUseOfCaptureEvents);
return NS_OK;
}
NS_IMETHODIMP
nsHTMLDocument::ReleaseEvents(int32_t aEventFlags)
{
ReportUseOfDeprecatedMethod(this, "UseOfReleaseEventsWarning");
WarnOnceAbout(nsIDocument::eUseOfReleaseEvents);
return NS_OK;
}

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsIPrincipal.h"
#include "mozilla/dom/HTMLMediaElement.h"
#endif
#ifdef MOZ_RTSP
#ifdef NECKO_PROTOCOL_rtsp
#include "RtspOmxDecoder.h"
#include "RtspOmxReader.h"
#endif
@ -244,7 +244,7 @@ static char const *const gMpegAudioCodecs[2] = {
};
#endif
#ifdef MOZ_RTSP
#ifdef NECKO_PROTOCOL_rtsp
static const char* const gRtspTypes[2] = {
"RTSP",
nullptr
@ -260,7 +260,7 @@ IsRtspSupportedType(const nsACString& aMimeType)
/* static */
bool DecoderTraits::DecoderWaitsForOnConnected(const nsACString& aMimeType) {
#ifdef MOZ_RTSP
#ifdef NECKO_PROTOCOL_rtsp
return CodecListContains(gRtspTypes, aMimeType);
#else
return false;
@ -486,7 +486,7 @@ DecoderTraits::CreateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
decoder = new MediaOmxDecoder();
}
#endif
#ifdef MOZ_RTSP
#ifdef NECKO_PROTOCOL_rtsp
if (IsRtspSupportedType(aType)) {
decoder = new RtspOmxDecoder();
}

Просмотреть файл

@ -1706,7 +1706,7 @@ MediaDecoder::IsWebMEnabled()
}
#endif
#ifdef MOZ_RTSP
#ifdef NECKO_PROTOCOL_rtsp
bool
MediaDecoder::IsRtspEnabled()
{

Просмотреть файл

@ -188,6 +188,7 @@ destroying the MediaDecoder object.
#include "MediaStreamGraph.h"
#include "AudioChannelCommon.h"
#include "AbstractMediaDecoder.h"
#include "necko-config.h"
class nsIStreamListener;
class nsIMemoryReporter;
@ -771,7 +772,7 @@ public:
#ifdef MOZ_WEBM
static bool IsWebMEnabled();
#endif
#ifdef MOZ_RTSP
#ifdef NECKO_PROTOCOL_rtsp
static bool IsRtspEnabled();
#endif

Просмотреть файл

@ -18,7 +18,7 @@ SOURCES += [
'OmxDecoder.cpp',
]
if CONFIG['MOZ_RTSP']:
if 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
EXPORTS += [
'RtspOmxDecoder.h',
'RtspOmxReader.h',

Просмотреть файл

@ -274,15 +274,6 @@ XMLDocument::SetAsync(bool aAsync)
return NS_OK;
}
static void
ReportUseOfDeprecatedMethod(nsIDocument *aDoc, const char* aWarning)
{
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM3 Load"), aDoc,
nsContentUtils::eDOM_PROPERTIES,
aWarning);
}
NS_IMETHODIMP
XMLDocument::Load(const nsAString& aUrl, bool *aReturn)
{
@ -302,7 +293,7 @@ XMLDocument::Load(const nsAString& aUrl, ErrorResult& aRv)
return false;
}
ReportUseOfDeprecatedMethod(this, "UseOfDOM3LoadMethodWarning");
WarnOnceAbout(nsIDocument::eUseOfDOM3LoadMethod);
nsCOMPtr<nsIDocument> callingDoc = nsContentUtils::GetDocumentFromContext();

Просмотреть файл

@ -32,7 +32,7 @@ function afterChangeCharset(event) {
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 87, "Child doc should decode as utf-16 subsequently");
is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "UTF-16", "Child doc should report UTF-16 subsequently");
is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "UTF-16LE", "Child doc should report UTF-16LE subsequently");
gBrowser.removeCurrentTab();
finish();

Просмотреть файл

@ -6962,27 +6962,23 @@ nsGlobalWindow::SetResizable(bool aResizable)
return NS_OK;
}
static void
ReportUseOfDeprecatedMethod(nsGlobalWindow* aWindow, const char* aWarning)
{
nsCOMPtr<nsIDocument> doc = aWindow->GetExtantDoc();
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM Events"), doc,
nsContentUtils::eDOM_PROPERTIES,
aWarning);
}
NS_IMETHODIMP
nsGlobalWindow::CaptureEvents(int32_t aEventFlags)
{
ReportUseOfDeprecatedMethod(this, "UseOfCaptureEventsWarning");
if (mDoc) {
mDoc->WarnOnceAbout(nsIDocument::eUseOfCaptureEvents);
}
return NS_OK;
}
NS_IMETHODIMP
nsGlobalWindow::ReleaseEvents(int32_t aEventFlags)
{
ReportUseOfDeprecatedMethod(this, "UseOfReleaseEventsWarning");
if (mDoc) {
mDoc->WarnOnceAbout(nsIDocument::eUseOfReleaseEvents);
}
return NS_OK;
}

Просмотреть файл

@ -47,6 +47,8 @@ public:
#define ZERO_SIZE(kind, mSize) mSize(0),
FOR_EACH_SIZE(ZERO_SIZE)
#undef ZERO_SIZE
mDOMEventTargetsCount(0),
mDOMEventListenersCount(0),
mArenaStats(),
mMallocSizeOf(aMallocSizeOf)
{}

Просмотреть файл

@ -16,9 +16,6 @@ OnBeforeUnloadTitle=Are you sure?
OnBeforeUnloadMessage=This page is asking you to confirm that you want to leave - data you have entered may not be saved.
OnBeforeUnloadStayButton=Stay on Page
OnBeforeUnloadLeaveButton=Leave Page
UseOfCaptureEventsWarning=Use of captureEvents() is deprecated. To upgrade your code, use the DOM 2 addEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.addEventListener
UseOfReleaseEventsWarning=Use of releaseEvents() is deprecated. To upgrade your code, use the DOM 2 removeEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.removeEventListener
UseOfDOM3LoadMethodWarning=Use of Document.load() is deprecated. To upgrade your code, use the DOM XMLHttpRequest object. For more help https://developer.mozilla.org/en/XMLHttpRequest
UnexpectedCanvasVariantStyle=canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a string, a CanvasGradient, or a CanvasPattern was ignored.
EmptyGetElementByIdParam=Empty string passed to getElementById().
LowMemoryTitle=Warning: Low memory
@ -137,5 +134,11 @@ GetPreventDefaultWarning=Use of getPreventDefault() is deprecated. Use defaultP
GetSetUserDataWarning=Use of getUserData() or setUserData() is deprecated. Use WeakMap or element.dataset instead.
# LOCALIZATION NOTE: Do not translate "mozGetAsFile" or "toBlob"
MozGetAsFileWarning=The non-standard mozGetAsFile method is deprecated and will soon be removed. Use the standard toBlob method instead.
# LOCALIZATION NOTE: Do not translate "captureEvents()" or "addEventListener()"
UseOfCaptureEventsWarning=Use of captureEvents() is deprecated. To upgrade your code, use the DOM 2 addEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.addEventListener
# LOCALIZATION NOTE: Do not translate "releaseEvents()" or "removeEventListener()"
UseOfReleaseEventsWarning=Use of releaseEvents() is deprecated. To upgrade your code, use the DOM 2 removeEventListener() method. For more help http://developer.mozilla.org/en/docs/DOM:element.removeEventListener
# LOCALIZATION NOTE: Do not translate "document.load()" or "XMLHttpRequest"
UseOfDOM3LoadMethodWarning=Use of document.load() is deprecated. To upgrade your code, use the DOM XMLHttpRequest object. For more help https://developer.mozilla.org/en/XMLHttpRequest
# LOCALIZATION NOTE: Do not translate "window.showModalDialog()" or "window.open()"
ShowModalDialogWarning=Use of window.showModalDialog() is deprecated. Use window.open() instead. For more help https://developer.mozilla.org/en-US/docs/Web/API/Window.open

Просмотреть файл

@ -8,7 +8,11 @@
interface nsIUDPSocketInternal;
%{ C++
#include "mozilla/net/DNS.h"
namespace mozilla {
namespace net {
union NetAddr;
}
}
%}
native NetAddr(mozilla::net::NetAddr);
[ptr] native NetAddrPtr(mozilla::net::NetAddr);

Просмотреть файл

@ -469,9 +469,9 @@ GetTextNode(nsISelection *selection, nsEditor *editor) {
}
#ifdef DEBUG
#define ASSERT_PASSWORD_LENGTHS_EQUAL() \
if (IsPasswordEditor()) { \
if (IsPasswordEditor() && mEditor->GetRoot()) { \
int32_t txtLen; \
mEditor->GetTextLength(&txtLen); \
mEditor->GetTextLength(&txtLen); \
NS_ASSERTION(mPasswordText.Length() == uint32_t(txtLen), \
"password length not equal to number of asterisks"); \
}

Просмотреть файл

@ -893,7 +893,7 @@ public:
return mOpaqueRect;
}
void SetPermitSubpixelAA(bool aPermitSubpixelAA) {
virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) {
mPermitSubpixelAA = aPermitSubpixelAA;
}

Просмотреть файл

@ -848,6 +848,14 @@ DrawTargetCairo::Fill(const Path *aPath,
DrawPattern(aPattern, StrokeOptions(), aOptions, DRAW_FILL);
}
void
DrawTargetCairo::SetPermitSubpixelAA(bool aPermitSubpixelAA)
{
DrawTarget::SetPermitSubpixelAA(aPermitSubpixelAA);
cairo_surface_set_subpixel_antialiasing(mSurface,
aPermitSubpixelAA ? CAIRO_SUBPIXEL_ANTIALIASING_ENABLED : CAIRO_SUBPIXEL_ANTIALIASING_DISABLED);
}
void
DrawTargetCairo::FillGlyphs(ScaledFont *aFont,
const GlyphBuffer &aBuffer,
@ -1120,6 +1128,13 @@ DrawTargetCairo::InitAlreadyReferenced(cairo_surface_t* aSurface, const IntSize&
mSize = aSize;
mFormat = CairoContentToGfxFormat(cairo_surface_get_content(aSurface));
if (mFormat == FORMAT_B8G8R8A8 ||
mFormat == FORMAT_R8G8B8A8) {
SetPermitSubpixelAA(false);
} else {
SetPermitSubpixelAA(true);
}
return true;
}

Просмотреть файл

@ -60,6 +60,8 @@ public:
virtual TemporaryRef<SourceSurface> Snapshot();
virtual IntSize GetSize();
virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA);
virtual bool LockBits(uint8_t** aData, IntSize* aSize,
int32_t* aStride, SurfaceFormat* aFormat);
virtual void ReleaseBits(uint8_t* aData);

Просмотреть файл

@ -0,0 +1,35 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_GFX_2D_HELPERS_H_
#define MOZILLA_GFX_2D_HELPERS_H_
#include "2D.h"
namespace mozilla {
namespace gfx {
class AutoSaveTransform
{
public:
AutoSaveTransform(DrawTarget *aTarget)
: mDrawTarget(aTarget),
mOldTransform(aTarget->GetTransform())
{
}
~AutoSaveTransform()
{
mDrawTarget->SetTransform(mOldTransform);
}
private:
RefPtr<DrawTarget> mDrawTarget;
Matrix mOldTransform;
};
} // namespace gfx
} // namespace mozilla
#endif // MOZILLA_GFX_2D_HELPERS_H_

Просмотреть файл

@ -21,6 +21,7 @@ EXPORTS.mozilla.gfx += [
'Blur.h',
'BorrowedContext.h',
'DataSurfaceHelpers.h',
'Helpers.h',
'Matrix.h',
'PathHelpers.h',
'Point.h',

Просмотреть файл

@ -10,9 +10,12 @@
#include "nsIWidget.h"
#include "gfx2DGlue.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/Helpers.h"
#include "gfxUtils.h"
#include <algorithm>
#include "ImageContainer.h"
#define PIXMAN_DONT_DEFINE_STDINT
#include "pixman.h" // for pixman_f_transform, etc
namespace mozilla {
using namespace mozilla::gfx;
@ -330,6 +333,84 @@ DrawSurfaceWithTextureCoords(DrawTarget *aDest,
}
}
static pixman_transform
Matrix3DToPixman(const gfx3DMatrix& aMatrix)
{
pixman_f_transform transform;
transform.m[0][0] = aMatrix._11;
transform.m[0][1] = aMatrix._21;
transform.m[0][2] = aMatrix._41;
transform.m[1][0] = aMatrix._12;
transform.m[1][1] = aMatrix._22;
transform.m[1][2] = aMatrix._42;
transform.m[2][0] = aMatrix._14;
transform.m[2][1] = aMatrix._24;
transform.m[2][2] = aMatrix._44;
pixman_transform result;
pixman_transform_from_pixman_f_transform(&result, &transform);
return result;
}
static void
PixmanTransform(DataSourceSurface* aDest,
DataSourceSurface* aSource,
const gfx3DMatrix& aTransform,
gfxPoint aDestOffset)
{
IntSize destSize = aDest->GetSize();
pixman_image_t* dest = pixman_image_create_bits(PIXMAN_a8r8g8b8,
destSize.width,
destSize.height,
(uint32_t*)aDest->GetData(),
aDest->Stride());
IntSize srcSize = aSource->GetSize();
pixman_image_t* src = pixman_image_create_bits(PIXMAN_a8r8g8b8,
srcSize.width,
srcSize.height,
(uint32_t*)aSource->GetData(),
aSource->Stride());
NS_ABORT_IF_FALSE(src && dest, "Failed to create pixman images?");
pixman_transform pixTransform = Matrix3DToPixman(aTransform);
pixman_transform pixTransformInverted;
// If the transform is singular then nothing would be drawn anyway, return here
if (!pixman_transform_invert(&pixTransformInverted, &pixTransform)) {
pixman_image_unref(dest);
pixman_image_unref(src);
return;
}
pixman_image_set_transform(src, &pixTransformInverted);
pixman_image_composite32(PIXMAN_OP_SRC,
src,
nullptr,
dest,
aDestOffset.x,
aDestOffset.y,
0,
0,
0,
0,
destSize.width,
destSize.height);
pixman_image_unref(dest);
pixman_image_unref(src);
}
static inline IntRect
RoundOut(Rect r)
{
r.RoundOut();
return IntRect(r.x, r.y, r.width, r.height);
}
void
BasicCompositor::DrawQuad(const gfx::Rect& aRect,
const gfx::Rect& aClipRect,
@ -337,20 +418,51 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
gfx::Float aOpacity,
const gfx::Matrix4x4 &aTransform)
{
DrawTarget *dest = mRenderTarget->mDrawTarget;
RefPtr<DrawTarget> buffer = mRenderTarget
? mRenderTarget->mDrawTarget
: mDrawTarget;
if (!aTransform.Is2D()) {
NS_WARNING("Can't handle 3D transforms yet!");
return;
// For 2D drawing, |dest| and |buffer| are the same surface. For 3D drawing,
// |dest| is a temporary surface.
RefPtr<DrawTarget> dest = buffer;
buffer->PushClipRect(aClipRect);
AutoSaveTransform autoSaveTransform(dest);
Matrix newTransform;
Rect transformBounds;
gfx3DMatrix new3DTransform;
IntPoint offset = mRenderTarget->GetOrigin();
if (aTransform.Is2D()) {
newTransform = aTransform.As2D();
} else {
// Create a temporary surface for the transform.
dest = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(RoundOut(aRect).Size(), FORMAT_B8G8R8A8);
if (!dest) {
return;
}
// Get the bounds post-transform.
To3DMatrix(aTransform, new3DTransform);
gfxRect bounds = new3DTransform.TransformBounds(ThebesRect(aRect));
bounds.IntersectRect(bounds, gfxRect(offset.x, offset.y, buffer->GetSize().width, buffer->GetSize().height));
transformBounds = ToRect(bounds);
transformBounds.RoundOut();
// Propagate the coordinate offset to our 2D draw target.
newTransform.Translate(transformBounds.x, transformBounds.y);
// When we apply the 3D transformation, we do it against a temporary
// surface, so undo the coordinate offset.
new3DTransform = new3DTransform * gfx3DMatrix::Translation(-transformBounds.x, -transformBounds.y, 0);
transformBounds.MoveTo(0, 0);
}
dest->PushClipRect(aClipRect);
Matrix oldTransform = dest->GetTransform();
Matrix newTransform = aTransform.As2D();
IntPoint offset = mRenderTarget->GetOrigin();
newTransform.Translate(-offset.x, -offset.y);
dest->SetTransform(newTransform);
buffer->SetTransform(newTransform);
RefPtr<SourceSurface> sourceMask;
Matrix maskTransform;
@ -414,13 +526,28 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
}
}
if (!aTransform.Is2D()) {
dest->Flush();
RefPtr<SourceSurface> snapshot = dest->Snapshot();
RefPtr<DataSourceSurface> source = snapshot->GetDataSurface();
RefPtr<DataSourceSurface> temp =
Factory::CreateDataSourceSurface(RoundOut(transformBounds).Size(), FORMAT_B8G8R8A8);
if (!temp) {
return;
}
PixmanTransform(temp, source, new3DTransform, gfxPoint(0, 0));
buffer->DrawSurface(temp, transformBounds, transformBounds);
}
if (aEffectChain.mSecondaryEffects[EFFECT_MASK]) {
EffectMask *effectMask = static_cast<EffectMask*>(aEffectChain.mSecondaryEffects[EFFECT_MASK].get());
static_cast<DeprecatedTextureHost*>(effectMask->mMaskTexture)->Unlock();
}
dest->SetTransform(oldTransform);
dest->PopClip();
buffer->PopClip();
}
void

Просмотреть файл

@ -1666,9 +1666,9 @@ jsdContext::GetOptions(uint32_t *_rval)
| (JS::ContextOptionsRef(mJSCx).dontReportUncaught() ? JSOPTION_DONT_REPORT_UNCAUGHT : 0)
| (JS::ContextOptionsRef(mJSCx).noDefaultCompartmentObject() ? JSOPTION_NO_DEFAULT_COMPARTMENT_OBJECT : 0)
| (JS::ContextOptionsRef(mJSCx).noScriptRval() ? JSOPTION_NO_SCRIPT_RVAL : 0)
| (JS::ContextOptionsRef(mJSCx).strictMode() ? JSOPTION_STRICT_MODE : 0)
| (JS::ContextOptionsRef(mJSCx).baseline() ? JSOPTION_BASELINE : 0)
| (JS::ContextOptionsRef(mJSCx).typeInference() ? JSOPTION_TYPE_INFERENCE : 0)
| (JS::ContextOptionsRef(mJSCx).strictMode() ? JSOPTION_STRICT_MODE : 0)
| (JS::ContextOptionsRef(mJSCx).ion() ? JSOPTION_ION : 0)
| (JS::ContextOptionsRef(mJSCx).asmJS() ? JSOPTION_ASMJS : 0);
return NS_OK;
@ -1692,9 +1692,9 @@ jsdContext::SetOptions(uint32_t options)
.setDontReportUncaught(options & JSOPTION_DONT_REPORT_UNCAUGHT)
.setNoDefaultCompartmentObject(options & JSOPTION_NO_DEFAULT_COMPARTMENT_OBJECT)
.setNoScriptRval(options & JSOPTION_NO_SCRIPT_RVAL)
.setStrictMode(options & JSOPTION_STRICT_MODE)
.setBaseline(options & JSOPTION_BASELINE)
.setTypeInference(options & JSOPTION_TYPE_INFERENCE)
.setStrictMode(options & JSOPTION_STRICT_MODE)
.setIon(options & JSOPTION_ION)
.setAsmJS(options & JSOPTION_ASMJS);
return NS_OK;

Просмотреть файл

@ -216,15 +216,18 @@ GetGCNumber();
class JS_PUBLIC_API(AutoAssertNoGC)
{
#ifdef DEBUG
JSRuntime *runtime;
size_t gcNumber;
public:
AutoAssertNoGC();
AutoAssertNoGC(JSRuntime *rt);
~AutoAssertNoGC();
#else
public:
/* Prevent unreferenced local warnings in opt builds. */
AutoAssertNoGC() {}
AutoAssertNoGC(JSRuntime *) {}
#endif
};

Просмотреть файл

@ -10,12 +10,25 @@ dnl The necessary comma after the tuple can't be put here because it
dnl can mess around with things like:
dnl AC_SOMETHING(foo,AC_SUBST(),bar)
define([AC_SUBST],
[ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', r''' [$]$1 ''')
AC_DIVERT_POP()dnl
])])
])])])
dnl Like AC_SUBST, but makes the value available as a set in python,
dnl with values got from the value of the environment variable, split on
dnl whitespaces.
define([AC_SUBST_SET],
[ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_SET_$1], ,
[define([AC_SUBST_SET_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', set(r''' [$]$1 '''.split()))
AC_DIVERT_POP()dnl
])])])
dnl Wrap AC_DEFINE to store values in a format suitable for python.
dnl autoconf's AC_DEFINE still needs to be used to fill confdefs.h,
@ -80,6 +93,7 @@ cat > $CONFIG_STATUS <<EOF
# coding=$encoding
import os
import types
dnl topsrcdir is the top source directory in native form, as opposed to a
dnl form suitable for make.
topsrcdir = '''${WIN_TOP_SRC:-$srcdir}'''
@ -103,7 +117,7 @@ rm confdefs.pytmp confdefs.h
cat >> $CONFIG_STATUS <<\EOF
] ]
substs = [(name[1:-1], value[1:-1]) for name, value in [
substs = [(name[1:-1], value[1:-1] if isinstance(value, types.StringTypes) else value) for name, value in [
EOF
dnl The MOZ_DIVERSION_SUBST output diversion contains AC_SUBSTs, in the

Просмотреть файл

@ -53,7 +53,7 @@ else
REPORT_BUILD = $(info $(shell $(PYTHON) $(MOZILLA_DIR)/config/rebuild_check.py $@ $^))
endif
else
REPORT_BUILD = $(info $(if $(filter $(DEPTH)/%,$@),$(@:$(DEPTH)/%=%),$(notdir $@)))
REPORT_BUILD = $(info $(notdir $@))
endif
ifeq ($(OS_ARCH),OS2)
@ -1536,12 +1536,10 @@ install_targets_sanity = $(if $(filter-out $(notdir $@),$(notdir $(<))),$(error
$(sort $(foreach tier,$(INSTALL_TARGETS_TIERS),$(INSTALL_TARGETS_FILES_$(tier)))):
$(install_targets_sanity)
$(REPORT_BUILD)
$(call install_cmd,$(IFLAGS1) "$<" "$(@D)")
$(sort $(foreach tier,$(INSTALL_TARGETS_TIERS),$(INSTALL_TARGETS_EXECUTABLES_$(tier)))):
$(install_targets_sanity)
$(REPORT_BUILD)
$(call install_cmd,$(IFLAGS2) "$<" "$(@D)")
################################################################################
@ -1603,7 +1601,6 @@ $(foreach tier,$(PP_TARGETS_TIERS), \
PP_TARGETS_ALL_RESULTS := $(sort $(foreach tier,$(PP_TARGETS_TIERS),$(PP_TARGETS_RESULTS_$(tier))))
$(PP_TARGETS_ALL_RESULTS):
$(if $(filter-out $(notdir $@),$(notdir $(<:.in=))),$(error Looks like $@ has an unexpected dependency on $< which breaks PP_TARGETS))
$(REPORT_BUILD)
$(RM) "$@"
$(call py_action,preprocessor,--depend $(MDDEPDIR)/$(@F).pp $(PP_TARGET_FLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) "$<" -o "$@")

Просмотреть файл

@ -174,8 +174,7 @@ struct FreeSpan
* there as offsets from the arena start.
*/
static size_t encodeOffsets(size_t firstOffset, size_t lastOffset) {
/* Check that we can pack the offsets into uint16_t. */
JS_STATIC_ASSERT(ArenaShift < 16);
static_assert(ArenaShift < 16, "Check that we can pack offsets into uint16_t.");
JS_ASSERT(firstOffset <= ArenaSize);
JS_ASSERT(lastOffset < ArenaSize);
JS_ASSERT(firstOffset <= ((lastOffset + 1) & ~size_t(1)));
@ -445,17 +444,9 @@ struct ArenaHeader : public JS::shadow::ArenaHeader
size_t allocatedDuringIncremental : 1;
size_t markOverflow : 1;
size_t auxNextLink : JS_BITS_PER_WORD - 8 - 1 - 1 - 1;
static void staticAsserts() {
/* We must be able to fit the allockind into uint8_t. */
JS_STATIC_ASSERT(FINALIZE_LIMIT <= 255);
/*
* auxNextLink packing assumes that ArenaShift has enough bits
* to cover allocKind and hasDelayedMarking.
*/
JS_STATIC_ASSERT(ArenaShift >= 8 + 1 + 1 + 1);
}
static_assert(ArenaShift >= 8 + 1 + 1 + 1,
"ArenaHeader::auxNextLink packing assumes that ArenaShift has enough bits to "
"cover allocKind and hasDelayedMarking.");
inline uintptr_t address() const;
inline Chunk *chunk() const;
@ -472,7 +463,7 @@ struct ArenaHeader : public JS::shadow::ArenaHeader
JS_ASSERT(!hasDelayedMarking);
zone = zoneArg;
JS_STATIC_ASSERT(FINALIZE_LIMIT <= 255);
static_assert(FINALIZE_LIMIT <= 255, "We must be able to fit the allockind into uint8_t.");
allocKind = size_t(kind);
/* See comments in FreeSpan::allocateFromNewArena. */
@ -592,6 +583,8 @@ struct Arena
bool finalize(FreeOp *fop, AllocKind thingKind, size_t thingSize);
};
static_assert(sizeof(Arena) == ArenaSize, "The hardcoded arena size must match the struct size.");
inline size_t
ArenaHeader::getThingSize() const
{
@ -599,6 +592,16 @@ ArenaHeader::getThingSize() const
return Arena::thingSize(getAllocKind());
}
/*
* The tail of the chunk info is shared between all chunks in the system, both
* nursery and tenured. This structure is locatable from any GC pointer by
* aligning to 1MiB.
*/
struct ChunkTrailer
{
JSRuntime *runtime;
};
/* The chunk header (located at the end of the chunk to preserve arena alignment). */
struct ChunkInfo
{
@ -632,8 +635,8 @@ struct ChunkInfo
/* Number of GC cycles this chunk has survived. */
uint32_t age;
/* This is findable from any address in the Chunk by aligning to 1MiB. */
JSRuntime *runtime;
/* Information shared by all Chunk types. */
ChunkTrailer trailer;
};
/*
@ -669,6 +672,7 @@ const size_t BytesPerArenaWithHeader = ArenaSize + ArenaBitmapBytes;
const size_t ChunkDecommitBitmapBytes = ChunkSize / ArenaSize / JS_BITS_PER_BYTE;
const size_t ChunkBytesAvailable = ChunkSize - sizeof(ChunkInfo) - ChunkDecommitBitmapBytes;
const size_t ArenasPerChunk = ChunkBytesAvailable / BytesPerArenaWithHeader;
static_assert(ArenasPerChunk == 252, "Do not accidentally change our heap's density.");
/* A chunk bitmap contains enough mark bits for all the cells in a chunk. */
struct ChunkBitmap
@ -720,12 +724,10 @@ struct ChunkBitmap
}
uintptr_t *arenaBits(ArenaHeader *aheader) {
/*
* We assume that the part of the bitmap corresponding to the arena
* has the exact number of words so we do not need to deal with a word
* that covers bits from two arenas.
*/
JS_STATIC_ASSERT(ArenaBitmapBits == ArenaBitmapWords * JS_BITS_PER_WORD);
static_assert(ArenaBitmapBits == ArenaBitmapWords * JS_BITS_PER_WORD,
"We assume that the part of the bitmap corresponding to the arena "
"has the exact number of words so we do not need to deal with a word "
"that covers bits from two arenas.");
uintptr_t *word, unused;
getMarkWordAndMask(reinterpret_cast<Cell *>(aheader->address()), BLACK, &word, &unused);
@ -733,8 +735,10 @@ struct ChunkBitmap
}
};
JS_STATIC_ASSERT(ArenaBitmapBytes * ArenasPerChunk == sizeof(ChunkBitmap));
JS_STATIC_ASSERT(js::gc::ChunkMarkBitmapBits == ArenaBitmapBits * ArenasPerChunk);
static_assert(ArenaBitmapBytes * ArenasPerChunk == sizeof(ChunkBitmap),
"Ensure our ChunkBitmap actually covers all arenas.");
static_assert(js::gc::ChunkMarkBitmapBits == ArenaBitmapBits * ArenasPerChunk,
"Ensure that the mark bitmap has the right number of bits.");
typedef BitArray<ArenasPerChunk> PerArenaBitmap;
@ -743,7 +747,8 @@ const size_t ChunkPadSize = ChunkSize
- sizeof(ChunkBitmap)
- sizeof(PerArenaBitmap)
- sizeof(ChunkInfo);
JS_STATIC_ASSERT(ChunkPadSize < BytesPerArenaWithHeader);
static_assert(ChunkPadSize < BytesPerArenaWithHeader,
"If the chunk padding is larger than an arena, we should have one more arena.");
/*
* Chunks contain arenas and associated data structures (mark bitmap, delayed
@ -836,9 +841,14 @@ struct Chunk
inline void addArenaToFreeList(JSRuntime *rt, ArenaHeader *aheader);
};
JS_STATIC_ASSERT(sizeof(Chunk) == ChunkSize);
JS_STATIC_ASSERT(js::gc::ChunkMarkBitmapOffset == offsetof(Chunk, bitmap));
JS_STATIC_ASSERT(js::gc::ChunkRuntimeOffset == offsetof(Chunk, info) + offsetof(ChunkInfo, runtime));
static_assert(sizeof(Chunk) == ChunkSize,
"Ensure the hardcoded chunk size definition actually matches the struct.");
static_assert(js::gc::ChunkMarkBitmapOffset == offsetof(Chunk, bitmap),
"The hardcoded API bitmap offset must match the actual offset.");
static_assert(js::gc::ChunkRuntimeOffset == offsetof(Chunk, info) +
offsetof(ChunkInfo, trailer) +
offsetof(ChunkTrailer, runtime),
"The hardcoded API runtime offset must match the actual offset.");
inline uintptr_t
ArenaHeader::address() const
@ -960,7 +970,7 @@ Cell::arenaHeader() const
inline JSRuntime *
Cell::runtimeFromMainThread() const
{
JSRuntime *rt = chunk()->info.runtime;
JSRuntime *rt = chunk()->info.trailer.runtime;
JS_ASSERT(CurrentThreadCanAccessRuntime(rt));
return rt;
}
@ -974,7 +984,7 @@ Cell::shadowRuntimeFromMainThread() const
inline JSRuntime *
Cell::runtimeFromAnyThread() const
{
return chunk()->info.runtime;
return chunk()->info.trailer.runtime;
}
inline JS::shadow::Runtime *

Просмотреть файл

@ -60,7 +60,7 @@ js::Nursery::init()
JS_POISON(heap, FreshNursery, NurserySize);
#endif
for (int i = 0; i < NumNurseryChunks; ++i)
chunk(i).runtime = rt;
chunk(i).trailer.runtime = rt;
JS_ASSERT(isEnabled());
return true;
@ -648,7 +648,7 @@ js::Nursery::sweep(JSRuntime *rt)
/* Poison the nursery contents so touching a freed object will crash. */
JS_POISON((void *)start(), SweptNursery, NurserySize - sizeof(JSRuntime *));
for (int i = 0; i < NumNurseryChunks; ++i)
chunk(i).runtime = runtime();
chunk(i).trailer.runtime = runtime();
if (rt->gcZeal_ == ZealGenerationalGCValue) {
/* Undo any grow or shrink the collection may have done. */

Просмотреть файл

@ -155,16 +155,17 @@ class Nursery
static const size_t MaxNurserySlots = 100;
/* The amount of space in the mapped nursery available to allocations. */
static const size_t NurseryChunkUsableSize = gc::ChunkSize - sizeof(JSRuntime *);
static const size_t NurseryChunkUsableSize = gc::ChunkSize - sizeof(gc::ChunkTrailer);
struct NurseryChunkLayout {
char data[NurseryChunkUsableSize];
JSRuntime *runtime;
gc::ChunkTrailer trailer;
uintptr_t start() { return uintptr_t(&data); }
uintptr_t end() { return uintptr_t(&runtime); }
uintptr_t end() { return uintptr_t(&trailer); }
};
static_assert(sizeof(NurseryChunkLayout) == gc::ChunkSize,
"Nursery chunk size must match gc::Chunk size.");
NurseryChunkLayout &chunk(int index) const {
JS_STATIC_ASSERT(sizeof(NurseryChunkLayout) == gc::ChunkSize);
JS_ASSERT(index < NumNurseryChunks);
JS_ASSERT(start());
return reinterpret_cast<NurseryChunkLayout *>(start())[index];

Просмотреть файл

@ -6537,7 +6537,7 @@ js::IsAsmJSCompilationAvailable(JSContext *cx, unsigned argc, Value *vp)
bool available = JSC::MacroAssembler::supportsFloatingPoint() &&
cx->gcSystemPageSize() == AsmJSPageSize &&
!cx->compartment()->debugMode() &&
cx->options().asmJS();
cx->compartment()->options().asmJS(cx);
args.rval().set(BooleanValue(available));
return true;

Просмотреть файл

@ -296,7 +296,7 @@ struct BaselineScript
inline bool
IsBaselineEnabled(JSContext *cx)
{
return cx->options().baseline();
return cx->compartment()->options().baseline(cx);
}
MethodStatus

Просмотреть файл

@ -371,8 +371,8 @@ void FinishOffThreadBuilder(IonBuilder *builder);
static inline bool
IsIonEnabled(JSContext *cx)
{
return cx->options().ion() &&
cx->options().baseline() &&
return cx->compartment()->options().ion(cx) &&
cx->compartment()->options().baseline(cx) &&
cx->typeInferenceEnabled();
}

Просмотреть файл

@ -2506,6 +2506,36 @@ class AutoHoldZone
} /* anonymous namespace */
bool
JS::CompartmentOptions::baseline(JSContext *cx) const
{
return baselineOverride_.get(cx->options().baseline());
}
bool
JS::CompartmentOptions::typeInference(const ExclusiveContext *cx) const
{
/* Unlike the other options that can be overriden on a per compartment
* basis, the default value for the typeInference option is stored on the
* compartment's type zone, rather than the current JSContext. Type zones
* copy this default value over from the current JSContext when they are
* created.
*/
return typeInferenceOverride_.get(cx->compartment()->zone()->types.inferenceEnabled);
}
bool
JS::CompartmentOptions::ion(JSContext *cx) const
{
return ionOverride_.get(cx->options().ion());
}
bool
JS::CompartmentOptions::asmJS(JSContext *cx) const
{
return asmJSOverride_.get(cx->options().asmJS());
}
JS::CompartmentOptions &
JS::CompartmentOptions::setZone(ZoneSpecifier spec)
{
@ -2520,6 +2550,18 @@ JS::CompartmentOptions::setSameZoneAs(JSObject *obj)
return *this;
}
JS::CompartmentOptions &
JS::CompartmentOptionsRef(JSCompartment *compartment)
{
return compartment->options();
}
JS::CompartmentOptions &
JS::CompartmentOptionsRef(JSContext *cx)
{
return cx->compartment()->options();
}
JS_PUBLIC_API(JSObject *)
JS_NewGlobalObject(JSContext *cx, const JSClass *clasp, JSPrincipals *principals,
JS::OnNewGlobalHookOption hookOption,

Просмотреть файл

@ -1440,9 +1440,9 @@ class JS_PUBLIC_API(ContextOptions) {
dontReportUncaught_(false),
noDefaultCompartmentObject_(false),
noScriptRval_(false),
strictMode_(false),
baseline_(false),
typeInference_(false),
strictMode_(false),
ion_(false),
asmJS_(false)
{
@ -1528,6 +1528,16 @@ class JS_PUBLIC_API(ContextOptions) {
return *this;
}
bool strictMode() const { return strictMode_; }
ContextOptions &setStrictMode(bool flag) {
strictMode_ = flag;
return *this;
}
ContextOptions &toggleStrictMode() {
strictMode_ = !strictMode_;
return *this;
}
bool baseline() const { return baseline_; }
ContextOptions &setBaseline(bool flag) {
baseline_ = flag;
@ -1548,16 +1558,6 @@ class JS_PUBLIC_API(ContextOptions) {
return *this;
}
bool strictMode() const { return strictMode_; }
ContextOptions &setStrictMode(bool flag) {
strictMode_ = flag;
return *this;
}
ContextOptions &toggleStrictMode() {
strictMode_ = !strictMode_;
return *this;
}
bool ion() const { return ion_; }
ContextOptions &setIon(bool flag) {
ion_ = flag;
@ -1587,9 +1587,9 @@ class JS_PUBLIC_API(ContextOptions) {
bool dontReportUncaught_ : 1;
bool noDefaultCompartmentObject_ : 1;
bool noScriptRval_ : 1;
bool strictMode_ : 1;
bool baseline_ : 1;
bool typeInference_ : 1;
bool strictMode_ : 1;
bool ion_ : 1;
bool asmJS_ : 1;
};
@ -2546,26 +2546,43 @@ enum ZoneSpecifier {
class JS_PUBLIC_API(CompartmentOptions)
{
union {
ZoneSpecifier spec;
void *pointer; // js::Zone* is not exposed in the API.
} zone_;
JSVersion version_;
public:
bool invisibleToDebugger;
class Override {
public:
Override() : mode_(Default) {}
bool get(bool defaultValue) const {
if (mode_ == Default)
return defaultValue;
return mode_ == ForceTrue;
};
void set(bool overrideValue) {
mode_ = overrideValue ? ForceTrue : ForceFalse;
};
void reset() {
mode_ = Default;
}
private:
enum Mode {
Default,
ForceTrue,
ForceFalse
};
Mode mode_;
};
explicit CompartmentOptions()
: version_(JSVERSION_UNKNOWN)
, invisibleToDebugger(false)
, invisibleToDebugger_(false)
{
zone_.spec = JS::FreshZone;
}
CompartmentOptions &setZone(ZoneSpecifier spec);
CompartmentOptions &setSameZoneAs(JSObject *obj);
JSVersion version() const { return version_; }
CompartmentOptions &setVersion(JSVersion aVersion) {
MOZ_ASSERT(aVersion != JSVERSION_UNKNOWN);
version_ = aVersion;
@ -2576,21 +2593,51 @@ class JS_PUBLIC_API(CompartmentOptions)
// of the embedding, and references to them should never leak out to script.
// This flag causes the this compartment to skip firing onNewGlobalObject
// and makes addDebuggee a no-op for this global.
CompartmentOptions &setInvisibleToDebugger(bool invisible) {
invisibleToDebugger = invisible;
bool invisibleToDebugger() { return invisibleToDebugger_; }
CompartmentOptions &setInvisibleToDebugger(bool flag) {
invisibleToDebugger_ = flag;
return *this;
}
ZoneSpecifier zoneSpecifier() const { return zone_.spec; }
bool baseline(JSContext *cx) const;
Override &baselineOverride() { return baselineOverride_; }
JSVersion version() const { return version_; }
bool typeInference(const js::ExclusiveContext *cx) const;
Override &typeInferenceOverride() { return typeInferenceOverride_; }
bool ion(JSContext *cx) const;
Override &ionOverride() { return ionOverride_; }
bool asmJS(JSContext *cx) const;
Override &asmJSOverride() { return asmJSOverride_; }
void *zonePointer() const {
JS_ASSERT(uintptr_t(zone_.pointer) > uintptr_t(JS::SystemZone));
return zone_.pointer;
}
ZoneSpecifier zoneSpecifier() const { return zone_.spec; }
CompartmentOptions &setZone(ZoneSpecifier spec);
CompartmentOptions &setSameZoneAs(JSObject *obj);
private:
JSVersion version_;
bool invisibleToDebugger_;
Override baselineOverride_;
Override typeInferenceOverride_;
Override ionOverride_;
Override asmJSOverride_;
union {
ZoneSpecifier spec;
void *pointer; // js::Zone* is not exposed in the API.
} zone_;
};
JS_PUBLIC_API(CompartmentOptions &)
CompartmentOptionsRef(JSCompartment *compartment);
JS_PUBLIC_API(CompartmentOptions &)
CompartmentOptionsRef(JSContext *cx);
// During global creation, we fire notifications to callbacks registered
// via the Debugger API. These callbacks are arbitrary script, and can touch
// the global in arbitrary ways. When that happens, the global should not be

Просмотреть файл

@ -453,7 +453,7 @@ namespace js {
inline bool
ExclusiveContext::typeInferenceEnabled() const
{
return compartment_->zone()->types.inferenceEnabled;
return compartment_->options().typeInference(this);
}
inline js::Handle<js::GlobalObject*>

Просмотреть файл

@ -113,7 +113,8 @@ const AllocKind gc::slotsToThingKind[] = {
/* 16 */ FINALIZE_OBJECT16
};
JS_STATIC_ASSERT(JS_ARRAY_LENGTH(slotsToThingKind) == SLOTS_TO_THING_KIND_LIMIT);
static_assert(JS_ARRAY_LENGTH(slotsToThingKind) == SLOTS_TO_THING_KIND_LIMIT,
"We have defined a slot count for each kind.");
const uint32_t Arena::ThingSizes[] = {
sizeof(JSObject), /* FINALIZE_OBJECT0 */
@ -276,9 +277,8 @@ ArenaHeader::checkSynchronizedWithFreeList() const
/* static */ void
Arena::staticAsserts()
{
JS_STATIC_ASSERT(sizeof(Arena) == ArenaSize);
JS_STATIC_ASSERT(JS_ARRAY_LENGTH(ThingSizes) == FINALIZE_LIMIT);
JS_STATIC_ASSERT(JS_ARRAY_LENGTH(FirstThingOffsets) == FINALIZE_LIMIT);
static_assert(JS_ARRAY_LENGTH(ThingSizes) == FINALIZE_LIMIT, "We have defined all thing sizes.");
static_assert(JS_ARRAY_LENGTH(FirstThingOffsets) == FINALIZE_LIMIT, "We have defined all offsets.");
}
template<typename T>
@ -654,7 +654,7 @@ Chunk::init(JSRuntime *rt)
info.numArenasFree = ArenasPerChunk;
info.numArenasFreeCommitted = ArenasPerChunk;
info.age = 0;
info.runtime = rt;
info.trailer.runtime = rt;
/* Initialize the arena header state. */
for (unsigned i = 0; i < ArenasPerChunk; i++) {
@ -742,7 +742,7 @@ Chunk::fetchNextDecommittedArena()
decommittedArenas.unset(offset);
Arena *arena = &arenas[offset];
MarkPagesInUse(info.runtime, arena, ArenaSize);
MarkPagesInUse(info.trailer.runtime, arena, ArenaSize);
arena->aheader.setAsNotAllocated();
return &arena->aheader;
@ -5328,15 +5328,18 @@ JS::GetGCNumber()
}
JS::AutoAssertNoGC::AutoAssertNoGC()
: runtime(js::TlsPerThreadData.get()->runtimeFromMainThread())
{
gcNumber = runtime->gcNumber;
}
JS::AutoAssertNoGC::AutoAssertNoGC(JSRuntime *rt)
: runtime(rt), gcNumber(rt->gcNumber)
{
JSRuntime *rt = js::TlsPerThreadData.get()->runtimeFromMainThread();
gcNumber = rt ? rt->gcNumber : size_t(-1);
}
JS::AutoAssertNoGC::~AutoAssertNoGC()
{
JSRuntime *rt = js::TlsPerThreadData.get()->runtimeFromMainThread();
if (rt)
MOZ_ASSERT(gcNumber == rt->gcNumber, "GC ran inside an AutoAssertNoGC scope");
MOZ_ASSERT(gcNumber == runtime->gcNumber, "GC ran inside an AutoAssertNoGC scope.");
}
#endif

Просмотреть файл

@ -3598,6 +3598,14 @@ EscapeForShell(AutoCStringVector &argv)
}
#endif
Vector<const char*, 4, js::SystemAllocPolicy> sPropagatedFlags;
static bool
PropagateFlagToNestedShells(const char *flag)
{
return sPropagatedFlags.append(flag);
}
static bool
NestedShell(JSContext *cx, unsigned argc, jsval *vp)
{
@ -3614,6 +3622,13 @@ NestedShell(JSContext *cx, unsigned argc, jsval *vp)
if (!argv.append(strdup(sArgv[0])))
return false;
// Propagate selected flags from the current shell
for (unsigned i = 0; i < sPropagatedFlags.length(); i++) {
char *cstr = strdup(sPropagatedFlags[i]);
if (!cstr || !argv.append(cstr))
return false;
}
// The arguments to nestedShell are stringified and append to argv.
RootedString str(cx);
for (unsigned i = 0; i < args.length(); i++) {

Просмотреть файл

@ -1333,7 +1333,7 @@ void
Debugger::slowPathOnNewGlobalObject(JSContext *cx, Handle<GlobalObject *> global)
{
JS_ASSERT(!JS_CLIST_IS_EMPTY(&cx->runtime()->onNewGlobalObjectWatchers));
if (global->compartment()->options().invisibleToDebugger)
if (global->compartment()->options().invisibleToDebugger())
return;
/*
@ -1951,7 +1951,7 @@ Debugger::addAllGlobalsAsDebuggees(JSContext *cx, unsigned argc, Value *vp)
THIS_DEBUGGER(cx, argc, vp, "addAllGlobalsAsDebuggees", args, dbg);
AutoDebugModeGC dmgc(cx->runtime());
for (CompartmentsIter c(cx->runtime(), SkipAtoms); !c.done(); c.next()) {
if (c == dbg->object->compartment() || c->options().invisibleToDebugger)
if (c == dbg->object->compartment() || c->options().invisibleToDebugger())
continue;
c->zone()->scheduledForDestruction = false;
GlobalObject *global = c->maybeGlobal();
@ -2134,7 +2134,7 @@ Debugger::addDebuggeeGlobal(JSContext *cx,
// with certain testing aides we expose in the shell, so just make addDebuggee
// throw in that case.
JSCompartment *debuggeeCompartment = global->compartment();
if (debuggeeCompartment->options().invisibleToDebugger) {
if (debuggeeCompartment->options().invisibleToDebugger()) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr,
JSMSG_DEBUG_CANT_DEBUG_GLOBAL);
return false;

Просмотреть файл

@ -701,7 +701,7 @@ Debugger::onNewScript(JSContext *cx, HandleScript script, GlobalObject *compileA
JS_ASSERT_IF(script->compileAndGo, compileAndGoGlobal == &script->uninlinedGlobal());
// We early return in slowPathOnNewScript for self-hosted scripts, so we can
// ignore those in our assertion here.
JS_ASSERT_IF(!script->compartment()->options().invisibleToDebugger &&
JS_ASSERT_IF(!script->compartment()->options().invisibleToDebugger() &&
!script->selfHosted,
script->compartment()->firedOnNewGlobalObject);
JS_ASSERT_IF(!script->compileAndGo, !compileAndGoGlobal);

Просмотреть файл

@ -1683,7 +1683,8 @@ ForkJoinSlice::ForkJoinSlice(PerThreadData *perThreadData,
numSlices(numSlices),
bailoutRecord(bailoutRecord),
shared(shared),
acquiredContext_(false)
acquiredContext_(false),
nogc_(shared->runtime())
{
/*
* Unsafely set the zone. This is used to track malloc counters and to

Просмотреть файл

@ -390,6 +390,10 @@ class ForkJoinSlice : public ThreadSafeContext
ForkJoinShared *const shared;
bool acquiredContext_;
// ForkJoinSlice is allocated on the stack. It would be dangerous to GC
// with it live because of the GC pointer fields stored in the context.
JS::AutoAssertNoGC nogc_;
};
// Locks a JSContext for its scope. Be very careful, because locking a

Просмотреть файл

@ -4514,11 +4514,11 @@ nsRect nsIFrame::GetScreenRectInAppUnits() const
// Returns the offset from this frame to the closest geometric parent that
// has a view. Also returns the containing view or null in case of error
NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset,
nsView** aView) const
void
nsIFrame::GetOffsetFromView(nsPoint& aOffset, nsView** aView) const
{
NS_PRECONDITION(nullptr != aView, "null OUT parameter pointer");
nsIFrame* frame = const_cast<nsFrame*>(this);
nsIFrame* frame = const_cast<nsIFrame*>(this);
*aView = nullptr;
aOffset.MoveTo(0, 0);
@ -4526,9 +4526,10 @@ NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset,
aOffset += frame->GetPosition();
frame = frame->GetParent();
} while (frame && !frame->HasView());
if (frame)
if (frame) {
*aView = frame->GetView();
return NS_OK;
}
}
nsIWidget*
@ -5760,9 +5761,10 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsPresContext* aPresContext,
nsRect tempRect = resultFrame->GetRect();
nsPoint offset;
nsView * view; //used for call of get offset from view
result = resultFrame->GetOffsetFromView(offset, &view);
if (NS_FAILED(result))
return result;
resultFrame->GetOffsetFromView(offset, &view);
if (!view) {
return NS_ERROR_FAILURE;
}
point.y = tempRect.height + offset.y;
//special check. if we allow non-text selection then we can allow a hit location to fall before a table.

Просмотреть файл

@ -198,7 +198,6 @@ public:
virtual void SetPrevInFlow(nsIFrame*) MOZ_OVERRIDE;
virtual nsIFrame* GetNextInFlowVirtual() const MOZ_OVERRIDE;
virtual void SetNextInFlow(nsIFrame*) MOZ_OVERRIDE;
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsView** aView) const MOZ_OVERRIDE;
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
NS_IMETHOD IsSelectable(bool* aIsSelectable, uint8_t* aSelectStyle) const MOZ_OVERRIDE;

Просмотреть файл

@ -2039,8 +2039,7 @@ public:
* Returns the offset from this frame to the closest geometric parent that
* has a view. Also returns the containing view or null in case of error
*/
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset,
nsView** aView) const = 0;
void GetOffsetFromView(nsPoint& aOffset, nsView** aView) const;
/**
* Returns the nearest widget containing this frame. If this frame has a

Просмотреть файл

@ -71,11 +71,19 @@ ogg_sync_init
ogg_sync_pageseek
ogg_sync_reset
ogg_sync_wrote
vorbis_analysis
vorbis_analysis_blockout
vorbis_analysis_buffer
vorbis_analysis_init
vorbis_analysis_headerout
vorbis_analysis_wrote
vorbis_block_clear
vorbis_block_init
vorbis_comment_add_tag
vorbis_comment_clear
vorbis_comment_init
vorbis_dsp_clear
vorbis_encode_init_vbr
vorbis_info_clear
vorbis_info_init
vorbis_packet_blocksize

Просмотреть файл

@ -10,12 +10,6 @@
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
%ifdef ANDROID
%define INPUT_TYPE_COLOR_UNSUPPORTED
%elifdef MOZ_WIDGET_GONK
%define INPUT_TYPE_COLOR_UNSUPPORTED
%endif
*|*::-moz-fieldset-content {
display: block;
unicode-bidi: inherit;
@ -459,7 +453,7 @@ input[type="file"] > button[type="button"] {
}
/* colored part of the color selector button */
input[type="color"]::-moz-color-swatch {
input[type="color"]:-moz-system-metric(color-picker-available)::-moz-color-swatch {
width: 100%;
height: 100%;
min-width: 40px;
@ -547,9 +541,7 @@ input[type="radio"]:hover:active {
/* Non text-related properties for buttons: these ones are shared with
input[type="color"] */
button,
%ifndef INPUT_TYPE_COLOR_UNSUPPORTED
input[type="color"],
%endif
input[type="color"]:-moz-system-metric(color-picker-available),
input[type="reset"],
input[type="button"],
input[type="submit"] {
@ -593,9 +585,7 @@ button {
}
button:hover,
%ifndef INPUT_TYPE_COLOR_UNSUPPORTED
input[type="color"]:hover,
%endif
input[type="color"]:-moz-system-metric(color-picker-available):hover,
input[type="reset"]:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
@ -610,9 +600,7 @@ input[type="submit"]:hover {
}
button:active:hover,
%ifndef INPUT_TYPE_COLOR_UNSUPPORTED
input[type="color"]:active:hover,
%endif
input[type="color"]:-moz-system-metric(color-picker-available):active:hover,
input[type="reset"]:active:hover,
input[type="button"]:active:hover,
input[type="submit"]:active:hover {
@ -629,9 +617,7 @@ input[type="submit"]:active:hover {
}
button::-moz-focus-inner,
%ifndef INPUT_TYPE_COLOR_UNSUPPORTED
input[type="color"]::-moz-focus-inner,
%endif
input[type="color"]:-moz-system-metric(color-picker-available)::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
@ -641,9 +627,7 @@ input[type="file"] > button[type="button"]::-moz-focus-inner {
}
button:-moz-focusring::-moz-focus-inner,
%ifndef INPUT_TYPE_COLOR_UNSUPPORTED
input[type="color"]:-moz-focusring::-moz-focus-inner,
%endif
input[type="color"]:-moz-system-metric(color-picker-available):-moz-focusring::-moz-focus-inner,
input[type="reset"]:-moz-focusring::-moz-focus-inner,
input[type="button"]:-moz-focusring::-moz-focus-inner,
input[type="submit"]:-moz-focusring::-moz-focus-inner,
@ -652,10 +636,8 @@ input[type="file"] > button[type="button"]:-moz-focusring::-moz-focus-inner {
}
button:disabled:active, button:disabled,
%ifndef INPUT_TYPE_COLOR_UNSUPPORTED
input[type="color"]:disabled:active,
input[type="color"]:disabled,
%endif
input[type="color"]:-moz-system-metric(color-picker-available):disabled:active,
input[type="color"]:-moz-system-metric(color-picker-available):disabled,
input[type="reset"]:disabled:active,
input[type="reset"]:disabled,
input[type="button"]:disabled:active,

Просмотреть файл

@ -468,69 +468,72 @@ nsStyleUtil::CSPAllowsInlineStyle(nsIContent* aContent,
return false;
}
if (csp) {
bool reportViolation;
bool allowInlineStyle = true;
rv = csp->GetAllowsInlineStyle(&reportViolation, &allowInlineStyle);
if (NS_FAILED(rv)) {
if (aRv)
*aRv = rv;
return false;
}
if (!csp) {
// No CSP --> the style is allowed
return true;
}
bool foundNonce = false;
nsAutoString nonce;
// If inline styles are allowed ('unsafe-inline'), skip the (irrelevant)
// nonce check
if (!allowInlineStyle) {
// We can only find a nonce if aContent is provided
foundNonce = !!aContent &&
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::nonce, nonce);
if (foundNonce) {
// We can overwrite the outparams from GetAllowsInlineStyle because
// if the nonce is correct, then we don't want to report the original
// inline violation (it has been whitelisted by the nonce), and if
// the nonce is incorrect, then we want to return just the specific
// "nonce violation" rather than both a "nonce violation" and
// a generic "inline violation".
rv = csp->GetAllowsNonce(nonce, nsIContentPolicy::TYPE_STYLESHEET,
&reportViolation, &allowInlineStyle);
if (NS_FAILED(rv)) {
if (aRv)
*aRv = rv;
return false;
}
bool reportViolation;
bool allowInlineStyle = true;
rv = csp->GetAllowsInlineStyle(&reportViolation, &allowInlineStyle);
if (NS_FAILED(rv)) {
if (aRv)
*aRv = rv;
return false;
}
bool foundNonce = false;
nsAutoString nonce;
// If inline styles are allowed ('unsafe-inline'), skip the (irrelevant)
// nonce check
if (!allowInlineStyle) {
// We can only find a nonce if aContent is provided
foundNonce = !!aContent &&
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::nonce, nonce);
if (foundNonce) {
// We can overwrite the outparams from GetAllowsInlineStyle because
// if the nonce is correct, then we don't want to report the original
// inline violation (it has been whitelisted by the nonce), and if
// the nonce is incorrect, then we want to return just the specific
// "nonce violation" rather than both a "nonce violation" and
// a generic "inline violation".
rv = csp->GetAllowsNonce(nonce, nsIContentPolicy::TYPE_STYLESHEET,
&reportViolation, &allowInlineStyle);
if (NS_FAILED(rv)) {
if (aRv)
*aRv = rv;
return false;
}
}
if (reportViolation) {
// This inline style is not allowed by CSP, so report the violation
nsAutoCString asciiSpec;
aSourceURI->GetAsciiSpec(asciiSpec);
nsAutoString styleText(aStyleText);
// cap the length of the style sample at 40 chars.
if (styleText.Length() > 40) {
styleText.Truncate(40);
styleText.AppendLiteral("...");
}
// The type of violation to report is determined by whether there was
// a nonce present.
unsigned short violationType = foundNonce ?
nsIContentSecurityPolicy::VIOLATION_TYPE_NONCE_STYLE :
nsIContentSecurityPolicy::VIOLATION_TYPE_INLINE_STYLE;
csp->LogViolationDetails(violationType, NS_ConvertUTF8toUTF16(asciiSpec),
styleText, aLineNumber, nonce);
}
if (!allowInlineStyle) {
NS_ASSERTION(reportViolation,
"CSP blocked inline style but is not reporting a violation");
// The inline style should be blocked.
return false;
}
}
// No CSP or a CSP that allows inline styles.
if (reportViolation) {
// This inline style is not allowed by CSP, so report the violation
nsAutoCString asciiSpec;
aSourceURI->GetAsciiSpec(asciiSpec);
nsAutoString styleText(aStyleText);
// cap the length of the style sample at 40 chars.
if (styleText.Length() > 40) {
styleText.Truncate(40);
styleText.AppendLiteral("...");
}
// The type of violation to report is determined by whether there was
// a nonce present.
unsigned short violationType = foundNonce ?
nsIContentSecurityPolicy::VIOLATION_TYPE_NONCE_STYLE :
nsIContentSecurityPolicy::VIOLATION_TYPE_INLINE_STYLE;
csp->LogViolationDetails(violationType, NS_ConvertUTF8toUTF16(asciiSpec),
styleText, aLineNumber, nonce);
}
if (!allowInlineStyle) {
NS_ASSERTION(reportViolation,
"CSP blocked inline style but is not reporting a violation");
// The inline style should be blocked.
return false;
}
// CSP allows inline styles.
return true;
}

Просмотреть файл

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The nestegg git repository is: git://github.com/kinetiknz/nestegg.git
The git commit ID used was 7d0f6d22b5a332ce47b95bc19dc259f204d339e1.
The git commit ID used was 26d262114af191b6654cbd5d24ec02e4b6bdb1cd.

Просмотреть файл

@ -67,6 +67,8 @@ extern "C" {
#define NESTEGG_CODEC_VP8 0 /**< Track uses Google On2 VP8 codec. */
#define NESTEGG_CODEC_VORBIS 1 /**< Track uses Xiph Vorbis codec. */
#define NESTEGG_CODEC_VP9 2 /**< Track uses Google On2 VP9 codec. */
#define NESTEGG_CODEC_OPUS 3 /**< Track uses Xiph Opus codec. */
#define NESTEGG_VIDEO_MONO 0 /**< Track is mono video. */
#define NESTEGG_VIDEO_STEREO_LEFT_RIGHT 1 /**< Track is side-by-side stereo video. Left first. */

Просмотреть файл

@ -20,7 +20,7 @@
/*
restore pointer to the structure by a pointer to its field
*/
#define structof(p,t,f) ((t*)(- offsetof(t,f) + (char*)(p)))
#define structof(p,t,f) ((t*)(- (ptrdiff_t) offsetof(t,f) + (char*)(p)))
/*
* redefine for the target compiler

Просмотреть файл

@ -128,7 +128,9 @@ enum ebml_type_enum {
/* Track IDs */
#define TRACK_ID_VP8 "V_VP8"
#define TRACK_ID_VP9 "V_VP9"
#define TRACK_ID_VORBIS "A_VORBIS"
#define TRACK_ID_OPUS "A_OPUS"
enum vint_mask {
MASK_NONE,
@ -1422,9 +1424,8 @@ ne_find_cue_position_for_track(nestegg * ctx, struct ebml_list_node * node, unsi
if (ne_map_track_number_to_index(ctx, track_number, &t) != 0)
return NULL;
if (t == track) {
if (t == track)
return pos;
}
node = node->next;
}
@ -1550,9 +1551,9 @@ ne_buffer_read(void * buffer, size_t length, void * user_data)
int rv = 1;
size_t available = sb->length - sb->offset;
if (available < length) {
if (available < length)
return 0;
}
memcpy(buffer, sb->buffer + sb->offset, length);
sb->offset += length;
@ -1577,9 +1578,8 @@ ne_buffer_seek(int64_t offset, int whence, void * user_data)
break;
}
if (o < 0 || o > (int64_t) sb->length) {
if (o < 0 || o > (int64_t) sb->length)
return -1;
}
sb->offset = o;
return 0;
@ -1933,9 +1933,15 @@ nestegg_track_codec_id(nestegg * ctx, unsigned int track)
if (strcmp(codec_id, TRACK_ID_VP8) == 0)
return NESTEGG_CODEC_VP8;
if (strcmp(codec_id, TRACK_ID_VP9) == 0)
return NESTEGG_CODEC_VP9;
if (strcmp(codec_id, TRACK_ID_VORBIS) == 0)
return NESTEGG_CODEC_VORBIS;
if (strcmp(codec_id, TRACK_ID_OPUS) == 0)
return NESTEGG_CODEC_OPUS;
return -1;
}

Просмотреть файл

@ -8,5 +8,3 @@ https://svn.xiph.org/tags/vorbis/libvorbis-1.3.3@18190
Some files are renamed during the copy to prevent clashes with object
file names with other Mozilla libraries.
alloca.diff - Bug 469639 - Failed to build firefox trunk on OpenSolaris

Просмотреть файл

@ -0,0 +1,436 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: vorbis encode-engine setup
last mod: $Id: vorbisenc.h 17021 2010-03-24 09:29:41Z xiphmont $
********************************************************************/
/** \file
* Libvorbisenc is a convenient API for setting up an encoding
* environment using libvorbis. Libvorbisenc encapsulates the
* actions needed to set up the encoder properly.
*/
#ifndef _OV_ENC_H_
#define _OV_ENC_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include "codec.h"
/**
* This is the primary function within libvorbisenc for setting up managed
* bitrate modes.
*
* Before this function is called, the \ref vorbis_info
* struct should be initialized by using vorbis_info_init() from the libvorbis
* API. After encoding, vorbis_info_clear() should be called.
*
* The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set
* constraints for the encoded file. This function uses these settings to
* select the appropriate encoding mode and set it up.
*
* \param vi Pointer to an initialized \ref vorbis_info struct.
* \param channels The number of channels to be encoded.
* \param rate The sampling rate of the source audio.
* \param max_bitrate Desired maximum bitrate (limit). -1 indicates unset.
* \param nominal_bitrate Desired average, or central, bitrate. -1 indicates unset.
* \param min_bitrate Desired minimum bitrate. -1 indicates unset.
*
* \return Zero for success, and negative values for failure.
*
* \retval 0 Success.
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
* \retval OV_EINVAL Invalid setup request, eg, out of range argument.
* \retval OV_EIMPL Unimplemented mode; unable to comply with bitrate request.
*/
extern int vorbis_encode_init(vorbis_info *vi,
long channels,
long rate,
long max_bitrate,
long nominal_bitrate,
long min_bitrate);
/**
* This function performs step-one of a three-step bitrate-managed encode
* setup. It functions similarly to the one-step setup performed by \ref
* vorbis_encode_init but allows an application to make further encode setup
* tweaks using \ref vorbis_encode_ctl before finally calling \ref
* vorbis_encode_setup_init to complete the setup process.
*
* Before this function is called, the \ref vorbis_info struct should be
* initialized by using vorbis_info_init() from the libvorbis API. After
* encoding, vorbis_info_clear() should be called.
*
* The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set
* constraints for the encoded file. This function uses these settings to
* select the appropriate encoding mode and set it up.
*
* \param vi Pointer to an initialized vorbis_info struct.
* \param channels The number of channels to be encoded.
* \param rate The sampling rate of the source audio.
* \param max_bitrate Desired maximum bitrate (limit). -1 indicates unset.
* \param nominal_bitrate Desired average, or central, bitrate. -1 indicates unset.
* \param min_bitrate Desired minimum bitrate. -1 indicates unset.
*
* \return Zero for success, and negative for failure.
*
* \retval 0 Success
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
* \retval OV_EINVAL Invalid setup request, eg, out of range argument.
* \retval OV_EIMPL Unimplemented mode; unable to comply with bitrate request.
*/
extern int vorbis_encode_setup_managed(vorbis_info *vi,
long channels,
long rate,
long max_bitrate,
long nominal_bitrate,
long min_bitrate);
/**
* This function performs step-one of a three-step variable bitrate
* (quality-based) encode setup. It functions similarly to the one-step setup
* performed by \ref vorbis_encode_init_vbr() but allows an application to
* make further encode setup tweaks using \ref vorbis_encode_ctl() before
* finally calling \ref vorbis_encode_setup_init to complete the setup
* process.
*
* Before this function is called, the \ref vorbis_info struct should be
* initialized by using \ref vorbis_info_init() from the libvorbis API. After
* encoding, vorbis_info_clear() should be called.
*
* \param vi Pointer to an initialized vorbis_info struct.
* \param channels The number of channels to be encoded.
* \param rate The sampling rate of the source audio.
* \param quality Desired quality level, currently from -0.1 to 1.0 (lo to hi).
*
* \return Zero for success, and negative values for failure.
*
* \retval 0 Success
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
* \retval OV_EINVAL Invalid setup request, eg, out of range argument.
* \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request.
*/
extern int vorbis_encode_setup_vbr(vorbis_info *vi,
long channels,
long rate,
float quality
);
/**
* This is the primary function within libvorbisenc for setting up variable
* bitrate ("quality" based) modes.
*
*
* Before this function is called, the vorbis_info struct should be
* initialized by using vorbis_info_init() from the libvorbis API. After
* encoding, vorbis_info_clear() should be called.
*
* \param vi Pointer to an initialized vorbis_info struct.
* \param channels The number of channels to be encoded.
* \param rate The sampling rate of the source audio.
* \param base_quality Desired quality level, currently from -0.1 to 1.0 (lo to hi).
*
*
* \return Zero for success, or a negative number for failure.
*
* \retval 0 Success
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
* \retval OV_EINVAL Invalid setup request, eg, out of range argument.
* \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request.
*/
extern int vorbis_encode_init_vbr(vorbis_info *vi,
long channels,
long rate,
float base_quality
);
/**
* This function performs the last stage of three-step encoding setup, as
* described in the API overview under managed bitrate modes.
*
* Before this function is called, the \ref vorbis_info struct should be
* initialized by using vorbis_info_init() from the libvorbis API, one of
* \ref vorbis_encode_setup_managed() or \ref vorbis_encode_setup_vbr() called to
* initialize the high-level encoding setup, and \ref vorbis_encode_ctl()
* called if necessary to make encoding setup changes.
* vorbis_encode_setup_init() finalizes the highlevel encoding structure into
* a complete encoding setup after which the application may make no further
* setup changes.
*
* After encoding, vorbis_info_clear() should be called.
*
* \param vi Pointer to an initialized \ref vorbis_info struct.
*
* \return Zero for success, and negative values for failure.
*
* \retval 0 Success.
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
*
* \retval OV_EINVAL Attempt to use vorbis_encode_setup_init() without first
* calling one of vorbis_encode_setup_managed() or vorbis_encode_setup_vbr() to
* initialize the high-level encoding setup
*
*/
extern int vorbis_encode_setup_init(vorbis_info *vi);
/**
* This function implements a generic interface to miscellaneous encoder
* settings similar to the classic UNIX 'ioctl()' system call. Applications
* may use vorbis_encode_ctl() to query or set bitrate management or quality
* mode details by using one of several \e request arguments detailed below.
* vorbis_encode_ctl() must be called after one of
* vorbis_encode_setup_managed() or vorbis_encode_setup_vbr(). When used
* to modify settings, \ref vorbis_encode_ctl() must be called before \ref
* vorbis_encode_setup_init().
*
* \param vi Pointer to an initialized vorbis_info struct.
*
* \param number Specifies the desired action; See \ref encctlcodes "the list
* of available requests".
*
* \param arg void * pointing to a data structure matching the request
* argument.
*
* \retval 0 Success. Any further return information (such as the result of a
* query) is placed into the storage pointed to by *arg.
*
* \retval OV_EINVAL Invalid argument, or an attempt to modify a setting after
* calling vorbis_encode_setup_init().
*
* \retval OV_EIMPL Unimplemented or unknown request
*/
extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
/**
* \deprecated This is a deprecated interface. Please use vorbis_encode_ctl()
* with the \ref ovectl_ratemanage2_arg struct and \ref
* OV_ECTL_RATEMANAGE2_GET and \ref OV_ECTL_RATEMANAGE2_SET calls in new code.
*
* The \ref ovectl_ratemanage_arg structure is used with vorbis_encode_ctl()
* and the \ref OV_ECTL_RATEMANAGE_GET, \ref OV_ECTL_RATEMANAGE_SET, \ref
* OV_ECTL_RATEMANAGE_AVG, \ref OV_ECTL_RATEMANAGE_HARD calls in order to
* query and modify specifics of the encoder's bitrate management
* configuration.
*/
struct ovectl_ratemanage_arg {
int management_active; /**< nonzero if bitrate management is active*/
/** hard lower limit (in kilobits per second) below which the stream bitrate
will never be allowed for any given bitrate_hard_window seconds of time.*/
long bitrate_hard_min;
/** hard upper limit (in kilobits per second) above which the stream bitrate
will never be allowed for any given bitrate_hard_window seconds of time.*/
long bitrate_hard_max;
/** the window period (in seconds) used to regulate the hard bitrate minimum
and maximum*/
double bitrate_hard_window;
/** soft lower limit (in kilobits per second) below which the average bitrate
tracker will start nudging the bitrate higher.*/
long bitrate_av_lo;
/** soft upper limit (in kilobits per second) above which the average bitrate
tracker will start nudging the bitrate lower.*/
long bitrate_av_hi;
/** the window period (in seconds) used to regulate the average bitrate
minimum and maximum.*/
double bitrate_av_window;
/** Regulates the relative centering of the average and hard windows; in
libvorbis 1.0 and 1.0.1, the hard window regulation overlapped but
followed the average window regulation. In libvorbis 1.1 a bit-reservoir
interface replaces the old windowing interface; the older windowing
interface is simulated and this field has no effect.*/
double bitrate_av_window_center;
};
/**
* \name struct ovectl_ratemanage2_arg
*
* The ovectl_ratemanage2_arg structure is used with vorbis_encode_ctl() and
* the OV_ECTL_RATEMANAGE2_GET and OV_ECTL_RATEMANAGE2_SET calls in order to
* query and modify specifics of the encoder's bitrate management
* configuration.
*
*/
struct ovectl_ratemanage2_arg {
int management_active; /**< nonzero if bitrate management is active */
/** Lower allowed bitrate limit in kilobits per second */
long bitrate_limit_min_kbps;
/** Upper allowed bitrate limit in kilobits per second */
long bitrate_limit_max_kbps;
long bitrate_limit_reservoir_bits; /**<Size of the bitrate reservoir in bits */
/** Regulates the bitrate reservoir's preferred fill level in a range from 0.0
* to 1.0; 0.0 tries to bank bits to buffer against future bitrate spikes, 1.0
* buffers against future sudden drops in instantaneous bitrate. Default is
* 0.1
*/
double bitrate_limit_reservoir_bias;
/** Average bitrate setting in kilobits per second */
long bitrate_average_kbps;
/** Slew rate limit setting for average bitrate adjustment; sets the minimum
* time in seconds the bitrate tracker may swing from one extreme to the
* other when boosting or damping average bitrate.
*/
double bitrate_average_damping;
};
/**
* \name vorbis_encode_ctl() codes
*
* \anchor encctlcodes
*
* These values are passed as the \c number parameter of vorbis_encode_ctl().
* The type of the referent of that function's \c arg pointer depends on these
* codes.
*/
/*@{*/
/**
* Query the current encoder bitrate management setting.
*
*Argument: <tt>struct ovectl_ratemanage2_arg *</tt>
*
* Used to query the current encoder bitrate management setting. Also used to
* initialize fields of an ovectl_ratemanage2_arg structure for use with
* \ref OV_ECTL_RATEMANAGE2_SET.
*/
#define OV_ECTL_RATEMANAGE2_GET 0x14
/**
* Set the current encoder bitrate management settings.
*
* Argument: <tt>struct ovectl_ratemanage2_arg *</tt>
*
* Used to set the current encoder bitrate management settings to the values
* listed in the ovectl_ratemanage2_arg. Passing a NULL pointer will disable
* bitrate management.
*/
#define OV_ECTL_RATEMANAGE2_SET 0x15
/**
* Returns the current encoder hard-lowpass setting (kHz) in the double
* pointed to by arg.
*
* Argument: <tt>double *</tt>
*/
#define OV_ECTL_LOWPASS_GET 0x20
/**
* Sets the encoder hard-lowpass to the value (kHz) pointed to by arg. Valid
* lowpass settings range from 2 to 99.
*
* Argument: <tt>double *</tt>
*/
#define OV_ECTL_LOWPASS_SET 0x21
/**
* Returns the current encoder impulse block setting in the double pointed
* to by arg.
*
* Argument: <tt>double *</tt>
*/
#define OV_ECTL_IBLOCK_GET 0x30
/**
* Sets the impulse block bias to the the value pointed to by arg.
*
* Argument: <tt>double *</tt>
*
* Valid range is -15.0 to 0.0 [default]. A negative impulse block bias will
* direct to encoder to use more bits when incoding short blocks that contain
* strong impulses, thus improving the accuracy of impulse encoding.
*/
#define OV_ECTL_IBLOCK_SET 0x31
/**
* Returns the current encoder coupling setting in the int pointed
* to by arg.
*
* Argument: <tt>int *</tt>
*/
#define OV_ECTL_COUPLING_GET 0x40
/**
* Enables/disables channel coupling in multichannel encoding according to arg.
*
* Argument: <tt>int *</tt>
*
* Zero disables channel coupling for multichannel inputs, nonzer enables
* channel coupling. Setting has no effect on monophonic encoding or
* multichannel counts that do not offer coupling. At present, coupling is
* available for stereo and 5.1 encoding.
*/
#define OV_ECTL_COUPLING_SET 0x41
/* deprecated rate management supported only for compatibility */
/**
* Old interface to querying bitrate management settings.
*
* Deprecated after move to bit-reservoir style management in 1.1 rendered
* this interface partially obsolete.
* \deprecated Please use \ref OV_ECTL_RATEMANAGE2_GET instead.
*
* Argument: <tt>struct ovectl_ratemanage_arg *</tt>
*/
#define OV_ECTL_RATEMANAGE_GET 0x10
/**
* Old interface to modifying bitrate management settings.
*
* deprecated after move to bit-reservoir style management in 1.1 rendered
* this interface partially obsolete.
*
* \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
*
* Argument: <tt>struct ovectl_ratemanage_arg *</tt>
*/
#define OV_ECTL_RATEMANAGE_SET 0x11
/**
* Old interface to setting average-bitrate encoding mode.
*
* Deprecated after move to bit-reservoir style management in 1.1 rendered
* this interface partially obsolete.
*
* \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
*
* Argument: <tt>struct ovectl_ratemanage_arg *</tt>
*/
#define OV_ECTL_RATEMANAGE_AVG 0x12
/**
* Old interface to setting bounded-bitrate encoding modes.
*
* deprecated after move to bit-reservoir style management in 1.1 rendered
* this interface partially obsolete.
*
* \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
*
* Argument: <tt>struct ovectl_ratemanage_arg *</tt>
*/
#define OV_ECTL_RATEMANAGE_HARD 0x13
/*@}*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,260 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: key floor settings
last mod: $Id: floor_all.h 17050 2010-03-26 01:34:42Z xiphmont $
********************************************************************/
#include "vorbis/codec.h"
#include "backends.h"
#include "books/floor/floor_books.h"
static const static_codebook*const _floor_128x4_books[]={
&_huff_book_line_128x4_class0,
&_huff_book_line_128x4_0sub0,
&_huff_book_line_128x4_0sub1,
&_huff_book_line_128x4_0sub2,
&_huff_book_line_128x4_0sub3,
};
static const static_codebook*const _floor_256x4_books[]={
&_huff_book_line_256x4_class0,
&_huff_book_line_256x4_0sub0,
&_huff_book_line_256x4_0sub1,
&_huff_book_line_256x4_0sub2,
&_huff_book_line_256x4_0sub3,
};
static const static_codebook*const _floor_128x7_books[]={
&_huff_book_line_128x7_class0,
&_huff_book_line_128x7_class1,
&_huff_book_line_128x7_0sub1,
&_huff_book_line_128x7_0sub2,
&_huff_book_line_128x7_0sub3,
&_huff_book_line_128x7_1sub1,
&_huff_book_line_128x7_1sub2,
&_huff_book_line_128x7_1sub3,
};
static const static_codebook*const _floor_256x7_books[]={
&_huff_book_line_256x7_class0,
&_huff_book_line_256x7_class1,
&_huff_book_line_256x7_0sub1,
&_huff_book_line_256x7_0sub2,
&_huff_book_line_256x7_0sub3,
&_huff_book_line_256x7_1sub1,
&_huff_book_line_256x7_1sub2,
&_huff_book_line_256x7_1sub3,
};
static const static_codebook*const _floor_128x11_books[]={
&_huff_book_line_128x11_class1,
&_huff_book_line_128x11_class2,
&_huff_book_line_128x11_class3,
&_huff_book_line_128x11_0sub0,
&_huff_book_line_128x11_1sub0,
&_huff_book_line_128x11_1sub1,
&_huff_book_line_128x11_2sub1,
&_huff_book_line_128x11_2sub2,
&_huff_book_line_128x11_2sub3,
&_huff_book_line_128x11_3sub1,
&_huff_book_line_128x11_3sub2,
&_huff_book_line_128x11_3sub3,
};
static const static_codebook*const _floor_128x17_books[]={
&_huff_book_line_128x17_class1,
&_huff_book_line_128x17_class2,
&_huff_book_line_128x17_class3,
&_huff_book_line_128x17_0sub0,
&_huff_book_line_128x17_1sub0,
&_huff_book_line_128x17_1sub1,
&_huff_book_line_128x17_2sub1,
&_huff_book_line_128x17_2sub2,
&_huff_book_line_128x17_2sub3,
&_huff_book_line_128x17_3sub1,
&_huff_book_line_128x17_3sub2,
&_huff_book_line_128x17_3sub3,
};
static const static_codebook*const _floor_256x4low_books[]={
&_huff_book_line_256x4low_class0,
&_huff_book_line_256x4low_0sub0,
&_huff_book_line_256x4low_0sub1,
&_huff_book_line_256x4low_0sub2,
&_huff_book_line_256x4low_0sub3,
};
static const static_codebook*const _floor_1024x27_books[]={
&_huff_book_line_1024x27_class1,
&_huff_book_line_1024x27_class2,
&_huff_book_line_1024x27_class3,
&_huff_book_line_1024x27_class4,
&_huff_book_line_1024x27_0sub0,
&_huff_book_line_1024x27_1sub0,
&_huff_book_line_1024x27_1sub1,
&_huff_book_line_1024x27_2sub0,
&_huff_book_line_1024x27_2sub1,
&_huff_book_line_1024x27_3sub1,
&_huff_book_line_1024x27_3sub2,
&_huff_book_line_1024x27_3sub3,
&_huff_book_line_1024x27_4sub1,
&_huff_book_line_1024x27_4sub2,
&_huff_book_line_1024x27_4sub3,
};
static const static_codebook*const _floor_2048x27_books[]={
&_huff_book_line_2048x27_class1,
&_huff_book_line_2048x27_class2,
&_huff_book_line_2048x27_class3,
&_huff_book_line_2048x27_class4,
&_huff_book_line_2048x27_0sub0,
&_huff_book_line_2048x27_1sub0,
&_huff_book_line_2048x27_1sub1,
&_huff_book_line_2048x27_2sub0,
&_huff_book_line_2048x27_2sub1,
&_huff_book_line_2048x27_3sub1,
&_huff_book_line_2048x27_3sub2,
&_huff_book_line_2048x27_3sub3,
&_huff_book_line_2048x27_4sub1,
&_huff_book_line_2048x27_4sub2,
&_huff_book_line_2048x27_4sub3,
};
static const static_codebook*const _floor_512x17_books[]={
&_huff_book_line_512x17_class1,
&_huff_book_line_512x17_class2,
&_huff_book_line_512x17_class3,
&_huff_book_line_512x17_0sub0,
&_huff_book_line_512x17_1sub0,
&_huff_book_line_512x17_1sub1,
&_huff_book_line_512x17_2sub1,
&_huff_book_line_512x17_2sub2,
&_huff_book_line_512x17_2sub3,
&_huff_book_line_512x17_3sub1,
&_huff_book_line_512x17_3sub2,
&_huff_book_line_512x17_3sub3,
};
static const static_codebook*const _floor_Xx0_books[]={
0
};
static const static_codebook*const *const _floor_books[11]={
_floor_128x4_books,
_floor_256x4_books,
_floor_128x7_books,
_floor_256x7_books,
_floor_128x11_books,
_floor_128x17_books,
_floor_256x4low_books,
_floor_1024x27_books,
_floor_2048x27_books,
_floor_512x17_books,
_floor_Xx0_books,
};
static const vorbis_info_floor1 _floor[11]={
/* 0: 128 x 4 */
{
1,{0},{4},{2},{0},
{{1,2,3,4}},
4,{0,128, 33,8,16,70},
60,30,500, 1.,18., 128
},
/* 1: 256 x 4 */
{
1,{0},{4},{2},{0},
{{1,2,3,4}},
4,{0,256, 66,16,32,140},
60,30,500, 1.,18., 256
},
/* 2: 128 x 7 */
{
2,{0,1},{3,4},{2,2},{0,1},
{{-1,2,3,4},{-1,5,6,7}},
4,{0,128, 14,4,58, 2,8,28,90},
60,30,500, 1.,18., 128
},
/* 3: 256 x 7 */
{
2,{0,1},{3,4},{2,2},{0,1},
{{-1,2,3,4},{-1,5,6,7}},
4,{0,256, 28,8,116, 4,16,56,180},
60,30,500, 1.,18., 256
},
/* 4: 128 x 11 */
{
4,{0,1,2,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
{{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
2,{0,128, 8,33, 4,16,70, 2,6,12, 23,46,90},
60,30,500, 1,18., 128
},
/* 5: 128 x 17 */
{
6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
{{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
2,{0,128, 12,46, 4,8,16, 23,33,70, 2,6,10, 14,19,28, 39,58,90},
60,30,500, 1,18., 128
},
/* 6: 256 x 4 (low bitrate version) */
{
1,{0},{4},{2},{0},
{{1,2,3,4}},
4,{0,256, 66,16,32,140},
60,30,500, 1.,18., 256
},
/* 7: 1024 x 27 */
{
8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
{{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
2,{0,1024, 93,23,372, 6,46,186,750, 14,33,65, 130,260,556,
3,10,18,28, 39,55,79,111, 158,220,312, 464,650,850},
60,30,500, 3,18., 1024
},
/* 8: 2048 x 27 */
{
8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
{{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
2,{0,2048, 186,46,744, 12,92,372,1500, 28,66,130, 260,520,1112,
6,20,36,56, 78,110,158,222, 316,440,624, 928,1300,1700},
60,30,500, 3,18., 2048
},
/* 9: 512 x 17 */
{
6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
{{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
2,{0,512, 46,186, 16,33,65, 93,130,278,
7,23,39, 55,79,110, 156,232,360},
60,30,500, 1,18., 512
},
/* 10: X x 0 (LFE floor; edge posts only) */
{
0,{0}, {0},{0},{-1},
{{-1}},
2,{0,12},
60,30,500, 1.,18., 10
},
};

Просмотреть файл

@ -0,0 +1,51 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: 11kHz settings
last mod: $Id: psych_11.h 16227 2009-07-08 06:58:46Z xiphmont $
********************************************************************/
static const double _psy_lowpass_11[3]={4.5,5.5,30.,};
static const att3 _psy_tone_masteratt_11[3]={
{{ 30, 25, 12}, 0, 0}, /* 0 */
{{ 30, 25, 12}, 0, 0}, /* 0 */
{{ 20, 0, -14}, 0, 0}, /* 0 */
};
static const vp_adjblock _vp_tonemask_adj_11[3]={
/* adjust for mode zero */
/* 63 125 250 500 1 2 4 8 16 */
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* 0 */
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /* 1 */
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 2 */
};
static const noise3 _psy_noisebias_11[3]={
/* 63 125 250 500 1k 2k 4k 8k 16k*/
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99},
{-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 4, 5, 5, 10, 99, 99, 99},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99},
{-15,-15,-15,-15,-10,-10, -5, -5, -5, 0, 0, 0, 0, 0, 99, 99, 99},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 99, 99, 99},
{-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99},
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},
};
static const double _noise_thresh_11[3]={ .3,.5,.5 };

Просмотреть файл

@ -0,0 +1,133 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: 16kHz settings
last mod: $Id: psych_16.h 16227 2009-07-08 06:58:46Z xiphmont $
********************************************************************/
/* stereo mode by base quality level */
static const adj_stereo _psy_stereo_modes_16[4]={
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
{{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
{ 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
{ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
{{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
{ 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
{ 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
{{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
{ 5, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
};
static const double _psy_lowpass_16[4]={6.5,8,30.,99.};
static const att3 _psy_tone_masteratt_16[4]={
{{ 30, 25, 12}, 0, 0}, /* 0 */
{{ 25, 22, 12}, 0, 0}, /* 0 */
{{ 20, 12, 0}, 0, 0}, /* 0 */
{{ 15, 0, -14}, 0, 0}, /* 0 */
};
static const vp_adjblock _vp_tonemask_adj_16[4]={
/* adjust for mode zero */
/* 63 125 250 500 1 2 4 8 16 */
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 0 */
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 1 */
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
{{-30,-30,-30,-30,-30,-26,-20,-10, -5, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
};
static const noise3 _psy_noisebias_16_short[4]={
/* 63 125 250 500 1k 2k 4k 8k 16k*/
{{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 10, 10, 10, 10, 12, 12, 14, 20},
{-15,-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 5, 5, 6, 8, 8, 15},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
{{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 6, 6, 6, 6, 8, 10, 12, 20},
{-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5, 4, 5, 6, 8, 8, 15},
{-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}},
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 12},
{-20,-20,-20,-20,-16,-12,-20,-14,-10,-10, -8, 0, 0, 0, 0, 2, 5},
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
{{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6},
{-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10,-10,-10, -6},
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
};
static const noise3 _psy_noisebias_16_impulse[4]={
/* 63 125 250 500 1k 2k 4k 8k 16k*/
{{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 10, 10, 10, 10, 12, 12, 14, 20},
{-15,-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 5, 5, 6, 8, 8, 15},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
{{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 4, 4, 4, 5, 5, 6, 8, 15},
{-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5, 0, 0, 0, 0, 4, 10},
{-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}},
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 4, 10},
{-20,-20,-20,-20,-16,-12,-20,-14,-10,-10,-10,-10,-10,-10,-10, -7, -5},
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
{{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6},
{-30,-30,-30,-30,-26,-22,-20,-18,-18,-18,-20,-20,-20,-20,-20,-20,-16},
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
};
static const noise3 _psy_noisebias_16[4]={
/* 63 125 250 500 1k 2k 4k 8k 16k*/
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 6, 8, 8, 10, 10, 10, 14, 20},
{-10,-10,-10,-10,-10, -5, -2, -2, 0, 0, 0, 4, 5, 6, 8, 8, 15},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 6, 6, 6, 6, 8, 10, 12, 20},
{-15,-15,-15,-15,-15,-10, -5, -5, 0, 0, 0, 4, 5, 6, 8, 8, 15},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 12},
{-20,-20,-20,-20,-16,-12,-20,-10, -5, -5, 0, 0, 0, 0, 0, 2, 5},
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
{{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6},
{-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10,-10,-10, -6},
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
};
static const noiseguard _psy_noiseguards_16[4]={
{10,10,-1},
{10,10,-1},
{20,20,-1},
{20,20,-1},
};
static const double _noise_thresh_16[4]={ .3,.5,.5,.5 };
static const int _noise_start_16[3]={ 256,256,9999 };
static const int _noise_part_16[4]={ 8,8,8,8 };
static const int _psy_ath_floater_16[4]={
-100,-100,-100,-105,
};
static const int _psy_ath_abs_16[4]={
-130,-130,-130,-140,
};

Просмотреть файл

@ -0,0 +1,642 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: key psychoacoustic settings for 44.1/48kHz
last mod: $Id: psych_44.h 16962 2010-03-11 07:30:34Z xiphmont $
********************************************************************/
/* preecho trigger settings *****************************************/
static const vorbis_info_psy_global _psy_global_44[5]={
{8, /* lines per eighth octave */
{20.f,14.f,12.f,12.f,12.f,12.f,12.f},
{-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
-6.f,
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
},
{8, /* lines per eighth octave */
{14.f,10.f,10.f,10.f,10.f,10.f,10.f},
{-40.f,-30.f,-25.f,-25.f,-25.f,-25.f,-25.f}, 2,-80.f,
-6.f,
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
},
{8, /* lines per eighth octave */
{12.f,10.f,10.f,10.f,10.f,10.f,10.f},
{-20.f,-20.f,-15.f,-15.f,-15.f,-15.f,-15.f}, 0,-80.f,
-6.f,
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
},
{8, /* lines per eighth octave */
{10.f,8.f,8.f,8.f,8.f,8.f,8.f},
{-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-80.f,
-6.f,
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
},
{8, /* lines per eighth octave */
{10.f,6.f,6.f,6.f,6.f,6.f,6.f},
{-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f,
-6.f,
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
},
};
/* noise compander lookups * low, mid, high quality ****************/
static const compandblock _psy_compand_44[6]={
/* sub-mode Z short */
{{
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
8, 9,10,11,12,13,14, 15, /* 15dB */
16,17,18,19,20,21,22, 23, /* 23dB */
24,25,26,27,28,29,30, 31, /* 31dB */
32,33,34,35,36,37,38, 39, /* 39dB */
}},
/* mode_Z nominal short */
{{
0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */
7, 7, 7, 7, 6, 6, 6, 7, /* 15dB */
7, 8, 9,10,11,12,13, 14, /* 23dB */
15,16,17,17,17,18,18, 19, /* 31dB */
19,19,20,21,22,23,24, 25, /* 39dB */
}},
/* mode A short */
{{
0, 1, 2, 3, 4, 5, 5, 5, /* 7dB */
6, 6, 6, 5, 4, 4, 4, 4, /* 15dB */
4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */
7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */
11,12,13,14,15,16,17, 18, /* 39dB */
}},
/* sub-mode Z long */
{{
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
8, 9,10,11,12,13,14, 15, /* 15dB */
16,17,18,19,20,21,22, 23, /* 23dB */
24,25,26,27,28,29,30, 31, /* 31dB */
32,33,34,35,36,37,38, 39, /* 39dB */
}},
/* mode_Z nominal long */
{{
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
8, 9,10,11,12,12,13, 13, /* 15dB */
13,14,14,14,15,15,15, 15, /* 23dB */
16,16,17,17,17,18,18, 19, /* 31dB */
19,19,20,21,22,23,24, 25, /* 39dB */
}},
/* mode A long */
{{
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
8, 8, 7, 6, 5, 4, 4, 4, /* 15dB */
4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */
7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */
11,12,13,14,15,16,17, 18, /* 39dB */
}}
};
/* tonal masking curve level adjustments *************************/
static const vp_adjblock _vp_tonemask_adj_longblock[12]={
/* 63 125 250 500 1 2 4 8 16 */
{{ -3, -8,-13,-15,-10,-10,-10,-10,-10,-10,-10, 0, 0, 0, 0, 0, 0}}, /* -1 */
/* {{-15,-15,-15,-15,-10, -8, -4, -2, 0, 0, 0, 10, 0, 0, 0, 0, 0}}, 0 */
{{ -4,-10,-14,-16,-15,-14,-13,-12,-12,-12,-11, -1, -1, -1, -1, -1, 0}}, /* 0 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 5, 0, 0, 0, 0, 0}}, 1 */
{{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1, -1, -1, 0}}, /* 1 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 2 */
{{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -6, -3, -1, -1, -1, 0}}, /* 2 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 3 */
{{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2, -1, -1, 0}}, /* 3 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, *//* 4 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 4 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 5 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 5 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 6 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2, 0}}, /* 6 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 7 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 7 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 8 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 8 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 9 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 9 */
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 10 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 10 */
};
static const vp_adjblock _vp_tonemask_adj_otherblock[12]={
/* 63 125 250 500 1 2 4 8 16 */
{{ -3, -8,-13,-15,-10,-10, -9, -9, -9, -9, -9, 1, 1, 1, 1, 1, 1}}, /* -1 */
/* {{-20,-20,-20,-20,-14,-12,-10, -8, -4, 0, 0, 10, 0, 0, 0, 0, 0}}, 0 */
{{ -4,-10,-14,-16,-14,-13,-12,-12,-11,-11,-10, 0, 0, 0, 0, 0, 0}}, /* 0 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 5, 0, 0, 0, 0, 0}}, 1 */
{{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1, 0, 0, 0}}, /* 1 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 2 */
{{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -5, -2, -1, 0, 0, 0}}, /* 2 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 3 */
{{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2, 0, 0, 0}}, /* 3 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 4 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 4 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 5 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 5 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 6 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2, 0}}, /* 6 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 7 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 7 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 8 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 8 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 9 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 9 */
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 10 */
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 10 */
};
/* noise bias (transition block) */
static const noise3 _psy_noisebias_trans[12]={
/* 63 125 250 500 1k 2k 4k 8k 16k*/
/* -1 */
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
{-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
/* 0
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
{-30,-30,-30,-30,-26,-22,-20,-14, -8, -4, 0, 0, 0, 0, 2, 4, 10},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
{{{-15,-15,-15,-15,-15,-12, -6, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
{-30,-30,-30,-30,-26,-22,-20,-14, -8, -4, 0, 0, 0, 0, 2, 3, 6},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},
/* 1
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 1, 4},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
/* 2
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, */
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -2, -1, 0, 3},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -7, -4}}},
/* 3
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 2},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
/* 4
{{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
{{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1, 1},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
/* 5
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
{-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2},
{-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}}, */
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
{-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1, 0},
{-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},
/* 6
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
{-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1},
{-34,-34,-34,-34,-30,-26,-24,-18,-17,-15,-15,-15,-15,-13,-13,-12, -8}}},*/
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
{-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2, 0},
{-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},
/* 7
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
{-32,-32,-32,-32,-28,-24,-24,-18,-14,-12,-10, -8, -8, -8, -6, -4, 0},
{-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},*/
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
{-32,-32,-32,-32,-28,-24,-24,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
{-34,-34,-34,-34,-30,-26,-26,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
/* 8
{{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7},
{-36,-36,-36,-36,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
{-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
{{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7},
{-36,-36,-36,-36,-30,-30,-30,-24,-20,-16,-16,-16,-16,-14,-12,-10, -7},
{-36,-36,-36,-36,-34,-30,-28,-26,-24,-30,-30,-30,-30,-30,-30,-24,-20}}},
/* 9
{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
{-36,-36,-36,-36,-34,-32,-32,-28,-20,-16,-16,-16,-16,-14,-12,-10, -7},
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
{-38,-38,-38,-38,-36,-34,-34,-30,-24,-20,-20,-20,-20,-18,-16,-12,-10},
{-40,-40,-40,-40,-40,-40,-40,-38,-35,-35,-35,-35,-35,-35,-35,-35,-30}}},
/* 10 */
{{{-30,-30,-30,-30,-30,-30,-30,-28,-20,-14,-14,-14,-14,-14,-14,-12,-10},
{-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20},
{-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
};
/* noise bias (long block) */
static const noise3 _psy_noisebias_long[12]={
/*63 125 250 500 1k 2k 4k 8k 16k*/
/* -1 */
{{{-10,-10,-10,-10,-10, -4, 0, 0, 0, 6, 6, 6, 6, 10, 10, 12, 20},
{-20,-20,-20,-20,-20,-20,-10, -2, 0, 0, 0, 0, 0, 2, 4, 6, 15},
{-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
/* 0 */
/* {{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10},
{-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 0, 0, 2, 4, 10},
{-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
{{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10},
{-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 0, 0, 2, 3, 6},
{-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},
/* 1 */
/* {{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
{{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 1, 4},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
/* 2 */
/* {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6},
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
{{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -2, -1, 0, 3},
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
/* 3 */
/* {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6},
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
{{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 2},
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -5}}},
/* 4 */
/* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5},
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1, 1},
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -7}}},
/* 5 */
/* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
{-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2},
{-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},*/
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
{-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1, 0},
{-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -8}}},
/* 6 */
/* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
{-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1},
{-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12, -8}}},*/
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
{-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2, 0},
{-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12,-10}}},
/* 7 */
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
{-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -6, -4, 0},
{-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}},
/* 8 */
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 0, 0, 0, 0, 1, 2, 3, 7},
{-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -8, -6, -2},
{-28,-28,-28,-28,-28,-28,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
/* 9 */
{{{-22,-22,-22,-22,-22,-22,-22,-18,-14, -8, -4, -4, -4, -4, -4, -2, 2},
{-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-12,-10, -7},
{-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
/* 10 */
{{{-24,-24,-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-14,-14,-14,-12,-10},
{-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-20},
{-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
};
/* noise bias (impulse block) */
static const noise3 _psy_noisebias_impulse[12]={
/* 63 125 250 500 1k 2k 4k 8k 16k*/
/* -1 */
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
{-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
/* 0 */
/* {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20},
{-30,-30,-30,-30,-26,-22,-20,-14, -6, -2, 0, 0, 0, 0, 2, 4, 10},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20},
{-30,-30,-30,-30,-26,-22,-20,-14, -6, -2, 0, 0, 0, 0, 2, 3, 6},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
/* 1 */
{{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -4, -4, -2, -2, -2, -2, 2},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8,-10,-10, -8, -8, -8, -6, -4}}},
/* 2 */
{{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
/* 3 */
{{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
/* 4 */
{{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
/* 5 */
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
{-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2},
{-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},
/* 6
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
{-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4},
{-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},*/
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
{-34,-34,-34,-34,-30,-30,-30,-24,-16,-16,-16,-16,-16,-16,-14,-14,-12},
{-36,-36,-36,-36,-36,-34,-28,-24,-20,-20,-20,-20,-20,-20,-20,-18,-16}}},
/* 7 */
/* {{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11},
{-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10},
{-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},*/
{{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11},
{-34,-34,-34,-34,-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-24,-22},
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
/* 8 */
/* {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1, 3, 3, 5, 10},
{-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
{-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
{{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1, 3, 3, 5, 10},
{-34,-34,-34,-34,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-24},
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
/* 9 */
/* {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
{-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18},
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
{-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26},
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
/* 10 */
{{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12},
{-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-26},
{-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
};
/* noise bias (padding block) */
static const noise3 _psy_noisebias_padding[12]={
/* 63 125 250 500 1k 2k 4k 8k 16k*/
/* -1 */
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
{-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
/* 0 */
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, 2, 3, 6, 6, 8, 10},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -4, -4, -2, 0, 2}}},
/* 1 */
{{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -6, -4, -2, 0}}},
/* 2 */
/* {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},*/
{{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, 0, 0, 2, 6},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
/* 3 */
{{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, 0, 0, 2, 6},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
/* 4 */
{{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, -1, 0, 2, 6},
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
/* 5 */
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
{-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -3, -3, -3, -3, -2, 0, 4},
{-34,-34,-34,-34,-30,-26,-24,-18,-14,-10,-10,-10,-10,-10, -8, -5, -3}}},
/* 6 */
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
{-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -4, -4, -4, -4, -3, -1, 4},
{-34,-34,-34,-34,-34,-30,-26,-20,-16,-13,-13,-13,-13,-13,-11, -8, -6}}},
/* 7 */
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
{-34,-34,-34,-34,-30,-30,-30,-24,-16,-10, -8, -6, -6, -6, -5, -3, 1},
{-34,-34,-34,-34,-32,-32,-28,-22,-18,-16,-16,-16,-16,-16,-14,-12,-10}}},
/* 8 */
{{{-22,-22,-22,-22,-22,-20,-14,-10, -4, 0, 0, 0, 0, 3, 5, 5, 11},
{-34,-34,-34,-34,-30,-30,-30,-24,-16,-12,-10, -8, -8, -8, -7, -5, -2},
{-36,-36,-36,-36,-36,-34,-28,-22,-20,-20,-20,-20,-20,-20,-20,-16,-14}}},
/* 9 */
{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -2, -2, -2, -2, 0, 2, 6},
{-36,-36,-36,-36,-34,-32,-32,-24,-16,-12,-12,-12,-12,-12,-10, -8, -5},
{-40,-40,-40,-40,-40,-40,-40,-32,-26,-24,-24,-24,-24,-24,-24,-20,-18}}},
/* 10 */
{{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-12,-12,-12,-12,-12,-10, -8},
{-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-25,-25,-25,-25,-25,-25,-15},
{-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
};
static const noiseguard _psy_noiseguards_44[4]={
{3,3,15},
{3,3,15},
{10,10,100},
{10,10,100},
};
static const int _psy_tone_suppress[12]={
-20,-20,-20,-20,-20,-24,-30,-40,-40,-45,-45,-45,
};
static const int _psy_tone_0dB[12]={
90,90,95,95,95,95,105,105,105,105,105,105,
};
static const int _psy_noise_suppress[12]={
-20,-20,-24,-24,-24,-24,-30,-40,-40,-45,-45,-45,
};
static const vorbis_info_psy _psy_info_template={
/* blockflag */
-1,
/* ath_adjatt, ath_maxatt */
-140.,-140.,
/* tonemask att boost/decay,suppr,curves */
{0.f,0.f,0.f}, 0.,0., -40.f, {0.},
/*noisemaskp,supp, low/high window, low/hi guard, minimum */
1, -0.f, .5f, .5f, 0,0,0,
/* noiseoffset*3, noisecompand, max_curve_dB */
{{-1},{-1},{-1}},{-1},105.f,
/* noise normalization - noise_p, start, partition, thresh. */
0,-1,-1,0.,
};
/* ath ****************/
static const int _psy_ath_floater[12]={
-100,-100,-100,-100,-100,-100,-105,-105,-105,-105,-110,-120,
};
static const int _psy_ath_abs[12]={
-130,-130,-130,-130,-140,-140,-140,-140,-140,-140,-140,-150,
};
/* stereo setup. These don't map directly to quality level, there's
an additional indirection as several of the below may be used in a
single bitmanaged stream
****************/
/* various stereo possibilities */
/* stereo mode by base quality level */
static const adj_stereo _psy_stereo_modes_44[12]={
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -1 */
{{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 0, 0, 0, 0},
{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 4, 3},
{ 1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8},
{ 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 */
{{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 1, 0, 0, 0, 0, 0},
{ 8, 8, 8, 8, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 3},
{ 1, 2, 3, 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 8, 8},
{ 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 */
{{ 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0},
{ 8, 8, 8, 8, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 3},
{ 1, 2, 3, 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 8, 8},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 */
{{ 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 0, 0, 0, 0, 0},
{ 8, 8, 6, 6, 5, 5, 4, 4, 4, 4, 4, 4, 3, 2, 1},
{ 3, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 */
{{ 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
{ 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 1},
{ 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 10, 10, 10, 10, 10},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 */
{{ 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 2, 1, 0},
{ 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 */
{{ 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0},
{ 6, 7, 8, 8, 8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 */
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 3, 3, 3, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 8, 8, 8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 */
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 3, 3, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 8, 8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 */
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 */
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 */
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
};
/* tone master attenuation by base quality mode and bitrate tweak */
static const att3 _psy_tone_masteratt_44[12]={
{{ 35, 21, 9}, 0, 0}, /* -1 */
{{ 30, 20, 8}, -2, 1.25}, /* 0 */
/* {{ 25, 14, 4}, 0, 0}, *//* 1 */
{{ 25, 12, 2}, 0, 0}, /* 1 */
/* {{ 20, 10, -2}, 0, 0}, *//* 2 */
{{ 20, 9, -3}, 0, 0}, /* 2 */
{{ 20, 9, -4}, 0, 0}, /* 3 */
{{ 20, 9, -4}, 0, 0}, /* 4 */
{{ 20, 6, -6}, 0, 0}, /* 5 */
{{ 20, 3, -10}, 0, 0}, /* 6 */
{{ 18, 1, -14}, 0, 0}, /* 7 */
{{ 18, 0, -16}, 0, 0}, /* 8 */
{{ 18, -2, -16}, 0, 0}, /* 9 */
{{ 12, -2, -20}, 0, 0}, /* 10 */
};
/* lowpass by mode **************/
static const double _psy_lowpass_44[12]={
/* 15.1,15.8,16.5,17.9,20.5,48.,999.,999.,999.,999.,999. */
13.9,15.1,15.8,16.5,17.2,18.9,20.1,48.,999.,999.,999.,999.
};
/* noise normalization **********/
static const int _noise_start_short_44[11]={
/* 16,16,16,16,32,32,9999,9999,9999,9999 */
32,16,16,16,32,9999,9999,9999,9999,9999,9999
};
static const int _noise_start_long_44[11]={
/* 128,128,128,256,512,512,9999,9999,9999,9999 */
256,128,128,256,512,9999,9999,9999,9999,9999,9999
};
static const int _noise_part_short_44[11]={
8,8,8,8,8,8,8,8,8,8,8
};
static const int _noise_part_long_44[11]={
32,32,32,32,32,32,32,32,32,32,32
};
static const double _noise_thresh_44[11]={
/* .2,.2,.3,.4,.5,.5,9999.,9999.,9999.,9999., */
.2,.2,.2,.4,.6,9999.,9999.,9999.,9999.,9999.,9999.,
};
static const double _noise_thresh_5only[2]={
.5,.5,
};

Просмотреть файл

@ -0,0 +1,101 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: 8kHz psychoacoustic settings
last mod: $Id: psych_8.h 16227 2009-07-08 06:58:46Z xiphmont $
********************************************************************/
static const att3 _psy_tone_masteratt_8[3]={
{{ 32, 25, 12}, 0, 0}, /* 0 */
{{ 30, 25, 12}, 0, 0}, /* 0 */
{{ 20, 0, -14}, 0, 0}, /* 0 */
};
static const vp_adjblock _vp_tonemask_adj_8[3]={
/* adjust for mode zero */
/* 63 125 250 500 1 2 4 8 16 */
{{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */
{{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */
{{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 1 */
};
static const noise3 _psy_noisebias_8[3]={
/* 63 125 250 500 1k 2k 4k 8k 16k*/
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 8, 8, 8, 10, 10, 99, 99, 99},
{-10,-10,-10,-10, -5, -5, -5, 0, 0, 4, 4, 4, 4, 4, 99, 99, 99},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 8, 8, 8, 10, 10, 99, 99, 99},
{-10,-10,-10,-10,-10,-10, -5, -5, -5, 0, 0, 0, 0, 0, 99, 99, 99},
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 99, 99, 99},
{-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99},
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},
};
/* stereo mode by base quality level */
static const adj_stereo _psy_stereo_modes_8[3]={
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
{{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
{ 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
{{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
{ 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
{{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
};
static const noiseguard _psy_noiseguards_8[2]={
{10,10,-1},
{10,10,-1},
};
static const compandblock _psy_compand_8[2]={
{{
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
8, 8, 9, 9,10,10,11, 11, /* 15dB */
12,12,13,13,14,14,15, 15, /* 23dB */
16,16,17,17,17,18,18, 19, /* 31dB */
19,19,20,21,22,23,24, 25, /* 39dB */
}},
{{
0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */
7, 7, 6, 6, 5, 5, 4, 4, /* 15dB */
3, 3, 3, 4, 5, 6, 7, 8, /* 23dB */
9,10,11,12,13,14,15, 16, /* 31dB */
17,18,19,20,21,22,23, 24, /* 39dB */
}},
};
static const double _psy_lowpass_8[3]={3.,4.,4.};
static const int _noise_start_8[2]={
64,64,
};
static const int _noise_part_8[2]={
8,8,
};
static const int _psy_ath_floater_8[3]={
-100,-100,-105,
};
static const int _psy_ath_abs_8[3]={
-130,-130,-140,
};

Просмотреть файл

@ -0,0 +1,163 @@
/********************************************************************
* *
* This FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel residue templates 16/22kHz
last mod: $Id: residue_16.h 16962 2010-03-11 07:30:34Z xiphmont $
********************************************************************/
/***** residue backends *********************************************/
static const static_bookblock _resbook_16s_0={
{
{0},
{0,0,&_16c0_s_p1_0},
{0},
{0,0,&_16c0_s_p3_0},
{0,0,&_16c0_s_p4_0},
{0,0,&_16c0_s_p5_0},
{0,0,&_16c0_s_p6_0},
{&_16c0_s_p7_0,&_16c0_s_p7_1},
{&_16c0_s_p8_0,&_16c0_s_p8_1},
{&_16c0_s_p9_0,&_16c0_s_p9_1,&_16c0_s_p9_2}
}
};
static const static_bookblock _resbook_16s_1={
{
{0},
{0,0,&_16c1_s_p1_0},
{0},
{0,0,&_16c1_s_p3_0},
{0,0,&_16c1_s_p4_0},
{0,0,&_16c1_s_p5_0},
{0,0,&_16c1_s_p6_0},
{&_16c1_s_p7_0,&_16c1_s_p7_1},
{&_16c1_s_p8_0,&_16c1_s_p8_1},
{&_16c1_s_p9_0,&_16c1_s_p9_1,&_16c1_s_p9_2}
}
};
static const static_bookblock _resbook_16s_2={
{
{0},
{0,0,&_16c2_s_p1_0},
{0,0,&_16c2_s_p2_0},
{0,0,&_16c2_s_p3_0},
{0,0,&_16c2_s_p4_0},
{&_16c2_s_p5_0,&_16c2_s_p5_1},
{&_16c2_s_p6_0,&_16c2_s_p6_1},
{&_16c2_s_p7_0,&_16c2_s_p7_1},
{&_16c2_s_p8_0,&_16c2_s_p8_1},
{&_16c2_s_p9_0,&_16c2_s_p9_1,&_16c2_s_p9_2}
}
};
static const vorbis_residue_template _res_16s_0[]={
{2,0,32, &_residue_44_mid,
&_huff_book__16c0_s_single,&_huff_book__16c0_s_single,
&_resbook_16s_0,&_resbook_16s_0},
};
static const vorbis_residue_template _res_16s_1[]={
{2,0,32, &_residue_44_mid,
&_huff_book__16c1_s_short,&_huff_book__16c1_s_short,
&_resbook_16s_1,&_resbook_16s_1},
{2,0,32, &_residue_44_mid,
&_huff_book__16c1_s_long,&_huff_book__16c1_s_long,
&_resbook_16s_1,&_resbook_16s_1}
};
static const vorbis_residue_template _res_16s_2[]={
{2,0,32, &_residue_44_high,
&_huff_book__16c2_s_short,&_huff_book__16c2_s_short,
&_resbook_16s_2,&_resbook_16s_2},
{2,0,32, &_residue_44_high,
&_huff_book__16c2_s_long,&_huff_book__16c2_s_long,
&_resbook_16s_2,&_resbook_16s_2}
};
static const vorbis_mapping_template _mapres_template_16_stereo[3]={
{ _map_nominal, _res_16s_0 }, /* 0 */
{ _map_nominal, _res_16s_1 }, /* 1 */
{ _map_nominal, _res_16s_2 }, /* 2 */
};
static const static_bookblock _resbook_16u_0={
{
{0},
{0,0,&_16u0__p1_0},
{0,0,&_16u0__p2_0},
{0,0,&_16u0__p3_0},
{0,0,&_16u0__p4_0},
{0,0,&_16u0__p5_0},
{&_16u0__p6_0,&_16u0__p6_1},
{&_16u0__p7_0,&_16u0__p7_1,&_16u0__p7_2}
}
};
static const static_bookblock _resbook_16u_1={
{
{0},
{0,0,&_16u1__p1_0},
{0,0,&_16u1__p2_0},
{0,0,&_16u1__p3_0},
{0,0,&_16u1__p4_0},
{0,0,&_16u1__p5_0},
{0,0,&_16u1__p6_0},
{&_16u1__p7_0,&_16u1__p7_1},
{&_16u1__p8_0,&_16u1__p8_1},
{&_16u1__p9_0,&_16u1__p9_1,&_16u1__p9_2}
}
};
static const static_bookblock _resbook_16u_2={
{
{0},
{0,0,&_16u2_p1_0},
{0,0,&_16u2_p2_0},
{0,0,&_16u2_p3_0},
{0,0,&_16u2_p4_0},
{&_16u2_p5_0,&_16u2_p5_1},
{&_16u2_p6_0,&_16u2_p6_1},
{&_16u2_p7_0,&_16u2_p7_1},
{&_16u2_p8_0,&_16u2_p8_1},
{&_16u2_p9_0,&_16u2_p9_1,&_16u2_p9_2}
}
};
static const vorbis_residue_template _res_16u_0[]={
{1,0,32, &_residue_44_low_un,
&_huff_book__16u0__single,&_huff_book__16u0__single,
&_resbook_16u_0,&_resbook_16u_0},
};
static const vorbis_residue_template _res_16u_1[]={
{1,0,32, &_residue_44_mid_un,
&_huff_book__16u1__short,&_huff_book__16u1__short,
&_resbook_16u_1,&_resbook_16u_1},
{1,0,32, &_residue_44_mid_un,
&_huff_book__16u1__long,&_huff_book__16u1__long,
&_resbook_16u_1,&_resbook_16u_1}
};
static const vorbis_residue_template _res_16u_2[]={
{1,0,32, &_residue_44_hi_un,
&_huff_book__16u2__short,&_huff_book__16u2__short,
&_resbook_16u_2,&_resbook_16u_2},
{1,0,32, &_residue_44_hi_un,
&_huff_book__16u2__long,&_huff_book__16u2__long,
&_resbook_16u_2,&_resbook_16u_2}
};
static const vorbis_mapping_template _mapres_template_16_uncoupled[3]={
{ _map_nominal_u, _res_16u_0 }, /* 0 */
{ _map_nominal_u, _res_16u_1 }, /* 1 */
{ _map_nominal_u, _res_16u_2 }, /* 2 */
};

Просмотреть файл

@ -0,0 +1,292 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel residue templates for 32/44.1/48kHz
last mod: $Id: residue_44.h 16962 2010-03-11 07:30:34Z xiphmont $
********************************************************************/
#include "vorbis/codec.h"
#include "backends.h"
#include "books/coupled/res_books_stereo.h"
/***** residue backends *********************************************/
static const vorbis_info_residue0 _residue_44_low={
0,-1, -1, 9,-1,-1,
/* 0 1 2 3 4 5 6 7 */
{0},
{-1},
{ 0, 1, 2, 2, 4, 8, 16, 32},
{ 0, 0, 0,999, 4, 8, 16, 32},
};
static const vorbis_info_residue0 _residue_44_mid={
0,-1, -1, 10,-1,-1,
/* 0 1 2 3 4 5 6 7 8 */
{0},
{-1},
{ 0, 1, 1, 2, 2, 4, 8, 16, 32},
{ 0, 0,999, 0,999, 4, 8, 16, 32},
};
static const vorbis_info_residue0 _residue_44_high={
0,-1, -1, 10,-1,-1,
/* 0 1 2 3 4 5 6 7 8 */
{0},
{-1},
{ 0, 1, 2, 4, 8, 16, 32, 71,157},
{ 0, 1, 2, 3, 4, 8, 16, 71,157},
};
static const static_bookblock _resbook_44s_n1={
{
{0},{0,0,&_44cn1_s_p1_0},{0,0,&_44cn1_s_p2_0},
{0,0,&_44cn1_s_p3_0},{0,0,&_44cn1_s_p4_0},{0,0,&_44cn1_s_p5_0},
{&_44cn1_s_p6_0,&_44cn1_s_p6_1},{&_44cn1_s_p7_0,&_44cn1_s_p7_1},
{&_44cn1_s_p8_0,&_44cn1_s_p8_1,&_44cn1_s_p8_2}
}
};
static const static_bookblock _resbook_44sm_n1={
{
{0},{0,0,&_44cn1_sm_p1_0},{0,0,&_44cn1_sm_p2_0},
{0,0,&_44cn1_sm_p3_0},{0,0,&_44cn1_sm_p4_0},{0,0,&_44cn1_sm_p5_0},
{&_44cn1_sm_p6_0,&_44cn1_sm_p6_1},{&_44cn1_sm_p7_0,&_44cn1_sm_p7_1},
{&_44cn1_sm_p8_0,&_44cn1_sm_p8_1,&_44cn1_sm_p8_2}
}
};
static const static_bookblock _resbook_44s_0={
{
{0},{0,0,&_44c0_s_p1_0},{0,0,&_44c0_s_p2_0},
{0,0,&_44c0_s_p3_0},{0,0,&_44c0_s_p4_0},{0,0,&_44c0_s_p5_0},
{&_44c0_s_p6_0,&_44c0_s_p6_1},{&_44c0_s_p7_0,&_44c0_s_p7_1},
{&_44c0_s_p8_0,&_44c0_s_p8_1,&_44c0_s_p8_2}
}
};
static const static_bookblock _resbook_44sm_0={
{
{0},{0,0,&_44c0_sm_p1_0},{0,0,&_44c0_sm_p2_0},
{0,0,&_44c0_sm_p3_0},{0,0,&_44c0_sm_p4_0},{0,0,&_44c0_sm_p5_0},
{&_44c0_sm_p6_0,&_44c0_sm_p6_1},{&_44c0_sm_p7_0,&_44c0_sm_p7_1},
{&_44c0_sm_p8_0,&_44c0_sm_p8_1,&_44c0_sm_p8_2}
}
};
static const static_bookblock _resbook_44s_1={
{
{0},{0,0,&_44c1_s_p1_0},{0,0,&_44c1_s_p2_0},
{0,0,&_44c1_s_p3_0},{0,0,&_44c1_s_p4_0},{0,0,&_44c1_s_p5_0},
{&_44c1_s_p6_0,&_44c1_s_p6_1},{&_44c1_s_p7_0,&_44c1_s_p7_1},
{&_44c1_s_p8_0,&_44c1_s_p8_1,&_44c1_s_p8_2}
}
};
static const static_bookblock _resbook_44sm_1={
{
{0},{0,0,&_44c1_sm_p1_0},{0,0,&_44c1_sm_p2_0},
{0,0,&_44c1_sm_p3_0},{0,0,&_44c1_sm_p4_0},{0,0,&_44c1_sm_p5_0},
{&_44c1_sm_p6_0,&_44c1_sm_p6_1},{&_44c1_sm_p7_0,&_44c1_sm_p7_1},
{&_44c1_sm_p8_0,&_44c1_sm_p8_1,&_44c1_sm_p8_2}
}
};
static const static_bookblock _resbook_44s_2={
{
{0},{0,0,&_44c2_s_p1_0},{0,0,&_44c2_s_p2_0},{0,0,&_44c2_s_p3_0},
{0,0,&_44c2_s_p4_0},{0,0,&_44c2_s_p5_0},{0,0,&_44c2_s_p6_0},
{&_44c2_s_p7_0,&_44c2_s_p7_1},{&_44c2_s_p8_0,&_44c2_s_p8_1},
{&_44c2_s_p9_0,&_44c2_s_p9_1,&_44c2_s_p9_2}
}
};
static const static_bookblock _resbook_44s_3={
{
{0},{0,0,&_44c3_s_p1_0},{0,0,&_44c3_s_p2_0},{0,0,&_44c3_s_p3_0},
{0,0,&_44c3_s_p4_0},{0,0,&_44c3_s_p5_0},{0,0,&_44c3_s_p6_0},
{&_44c3_s_p7_0,&_44c3_s_p7_1},{&_44c3_s_p8_0,&_44c3_s_p8_1},
{&_44c3_s_p9_0,&_44c3_s_p9_1,&_44c3_s_p9_2}
}
};
static const static_bookblock _resbook_44s_4={
{
{0},{0,0,&_44c4_s_p1_0},{0,0,&_44c4_s_p2_0},{0,0,&_44c4_s_p3_0},
{0,0,&_44c4_s_p4_0},{0,0,&_44c4_s_p5_0},{0,0,&_44c4_s_p6_0},
{&_44c4_s_p7_0,&_44c4_s_p7_1},{&_44c4_s_p8_0,&_44c4_s_p8_1},
{&_44c4_s_p9_0,&_44c4_s_p9_1,&_44c4_s_p9_2}
}
};
static const static_bookblock _resbook_44s_5={
{
{0},{0,0,&_44c5_s_p1_0},{0,0,&_44c5_s_p2_0},{0,0,&_44c5_s_p3_0},
{0,0,&_44c5_s_p4_0},{0,0,&_44c5_s_p5_0},{0,0,&_44c5_s_p6_0},
{&_44c5_s_p7_0,&_44c5_s_p7_1},{&_44c5_s_p8_0,&_44c5_s_p8_1},
{&_44c5_s_p9_0,&_44c5_s_p9_1,&_44c5_s_p9_2}
}
};
static const static_bookblock _resbook_44s_6={
{
{0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0},
{0,0,&_44c6_s_p4_0},
{&_44c6_s_p5_0,&_44c6_s_p5_1},
{&_44c6_s_p6_0,&_44c6_s_p6_1},
{&_44c6_s_p7_0,&_44c6_s_p7_1},
{&_44c6_s_p8_0,&_44c6_s_p8_1},
{&_44c6_s_p9_0,&_44c6_s_p9_1,&_44c6_s_p9_2}
}
};
static const static_bookblock _resbook_44s_7={
{
{0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0},
{0,0,&_44c7_s_p4_0},
{&_44c7_s_p5_0,&_44c7_s_p5_1},
{&_44c7_s_p6_0,&_44c7_s_p6_1},
{&_44c7_s_p7_0,&_44c7_s_p7_1},
{&_44c7_s_p8_0,&_44c7_s_p8_1},
{&_44c7_s_p9_0,&_44c7_s_p9_1,&_44c7_s_p9_2}
}
};
static const static_bookblock _resbook_44s_8={
{
{0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0},
{0,0,&_44c8_s_p4_0},
{&_44c8_s_p5_0,&_44c8_s_p5_1},
{&_44c8_s_p6_0,&_44c8_s_p6_1},
{&_44c8_s_p7_0,&_44c8_s_p7_1},
{&_44c8_s_p8_0,&_44c8_s_p8_1},
{&_44c8_s_p9_0,&_44c8_s_p9_1,&_44c8_s_p9_2}
}
};
static const static_bookblock _resbook_44s_9={
{
{0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0},
{0,0,&_44c9_s_p4_0},
{&_44c9_s_p5_0,&_44c9_s_p5_1},
{&_44c9_s_p6_0,&_44c9_s_p6_1},
{&_44c9_s_p7_0,&_44c9_s_p7_1},
{&_44c9_s_p8_0,&_44c9_s_p8_1},
{&_44c9_s_p9_0,&_44c9_s_p9_1,&_44c9_s_p9_2}
}
};
static const vorbis_residue_template _res_44s_n1[]={
{2,0,32, &_residue_44_low,
&_huff_book__44cn1_s_short,&_huff_book__44cn1_sm_short,
&_resbook_44s_n1,&_resbook_44sm_n1},
{2,0,32, &_residue_44_low,
&_huff_book__44cn1_s_long,&_huff_book__44cn1_sm_long,
&_resbook_44s_n1,&_resbook_44sm_n1}
};
static const vorbis_residue_template _res_44s_0[]={
{2,0,16, &_residue_44_low,
&_huff_book__44c0_s_short,&_huff_book__44c0_sm_short,
&_resbook_44s_0,&_resbook_44sm_0},
{2,0,32, &_residue_44_low,
&_huff_book__44c0_s_long,&_huff_book__44c0_sm_long,
&_resbook_44s_0,&_resbook_44sm_0}
};
static const vorbis_residue_template _res_44s_1[]={
{2,0,16, &_residue_44_low,
&_huff_book__44c1_s_short,&_huff_book__44c1_sm_short,
&_resbook_44s_1,&_resbook_44sm_1},
{2,0,32, &_residue_44_low,
&_huff_book__44c1_s_long,&_huff_book__44c1_sm_long,
&_resbook_44s_1,&_resbook_44sm_1}
};
static const vorbis_residue_template _res_44s_2[]={
{2,0,16, &_residue_44_mid,
&_huff_book__44c2_s_short,&_huff_book__44c2_s_short,
&_resbook_44s_2,&_resbook_44s_2},
{2,0,32, &_residue_44_mid,
&_huff_book__44c2_s_long,&_huff_book__44c2_s_long,
&_resbook_44s_2,&_resbook_44s_2}
};
static const vorbis_residue_template _res_44s_3[]={
{2,0,16, &_residue_44_mid,
&_huff_book__44c3_s_short,&_huff_book__44c3_s_short,
&_resbook_44s_3,&_resbook_44s_3},
{2,0,32, &_residue_44_mid,
&_huff_book__44c3_s_long,&_huff_book__44c3_s_long,
&_resbook_44s_3,&_resbook_44s_3}
};
static const vorbis_residue_template _res_44s_4[]={
{2,0,16, &_residue_44_mid,
&_huff_book__44c4_s_short,&_huff_book__44c4_s_short,
&_resbook_44s_4,&_resbook_44s_4},
{2,0,32, &_residue_44_mid,
&_huff_book__44c4_s_long,&_huff_book__44c4_s_long,
&_resbook_44s_4,&_resbook_44s_4}
};
static const vorbis_residue_template _res_44s_5[]={
{2,0,16, &_residue_44_mid,
&_huff_book__44c5_s_short,&_huff_book__44c5_s_short,
&_resbook_44s_5,&_resbook_44s_5},
{2,0,32, &_residue_44_mid,
&_huff_book__44c5_s_long,&_huff_book__44c5_s_long,
&_resbook_44s_5,&_resbook_44s_5}
};
static const vorbis_residue_template _res_44s_6[]={
{2,0,16, &_residue_44_high,
&_huff_book__44c6_s_short,&_huff_book__44c6_s_short,
&_resbook_44s_6,&_resbook_44s_6},
{2,0,32, &_residue_44_high,
&_huff_book__44c6_s_long,&_huff_book__44c6_s_long,
&_resbook_44s_6,&_resbook_44s_6}
};
static const vorbis_residue_template _res_44s_7[]={
{2,0,16, &_residue_44_high,
&_huff_book__44c7_s_short,&_huff_book__44c7_s_short,
&_resbook_44s_7,&_resbook_44s_7},
{2,0,32, &_residue_44_high,
&_huff_book__44c7_s_long,&_huff_book__44c7_s_long,
&_resbook_44s_7,&_resbook_44s_7}
};
static const vorbis_residue_template _res_44s_8[]={
{2,0,16, &_residue_44_high,
&_huff_book__44c8_s_short,&_huff_book__44c8_s_short,
&_resbook_44s_8,&_resbook_44s_8},
{2,0,32, &_residue_44_high,
&_huff_book__44c8_s_long,&_huff_book__44c8_s_long,
&_resbook_44s_8,&_resbook_44s_8}
};
static const vorbis_residue_template _res_44s_9[]={
{2,0,16, &_residue_44_high,
&_huff_book__44c9_s_short,&_huff_book__44c9_s_short,
&_resbook_44s_9,&_resbook_44s_9},
{2,0,32, &_residue_44_high,
&_huff_book__44c9_s_long,&_huff_book__44c9_s_long,
&_resbook_44s_9,&_resbook_44s_9}
};
static const vorbis_mapping_template _mapres_template_44_stereo[]={
{ _map_nominal, _res_44s_n1 }, /* -1 */
{ _map_nominal, _res_44s_0 }, /* 0 */
{ _map_nominal, _res_44s_1 }, /* 1 */
{ _map_nominal, _res_44s_2 }, /* 2 */
{ _map_nominal, _res_44s_3 }, /* 3 */
{ _map_nominal, _res_44s_4 }, /* 4 */
{ _map_nominal, _res_44s_5 }, /* 5 */
{ _map_nominal, _res_44s_6 }, /* 6 */
{ _map_nominal, _res_44s_7 }, /* 7 */
{ _map_nominal, _res_44s_8 }, /* 8 */
{ _map_nominal, _res_44s_9 }, /* 9 */
};

Просмотреть файл

@ -0,0 +1,451 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel residue templates for 32/44.1/48kHz uncoupled
last mod: $Id$
********************************************************************/
#include "vorbis/codec.h"
#include "backends.h"
#include "books/coupled/res_books_51.h"
/***** residue backends *********************************************/
static const vorbis_info_residue0 _residue_44p_lo={
0,-1, -1, 7,-1,-1,
/* 0 1 2 3 4 5 6 7 8 */
{0},
{-1},
{ 0, 1, 2, 7, 17, 31},
{ 0, 0, 99, 7, 17, 31},
};
static const vorbis_info_residue0 _residue_44p={
0,-1, -1, 8,-1,-1,
/* 0 1 2 3 4 5 6 7 8 */
{0},
{-1},
{ 0, 1, 1, 2, 7, 17, 31},
{ 0, 0, 99, 99, 7, 17, 31},
};
static const vorbis_info_residue0 _residue_44p_hi={
0,-1, -1, 8,-1,-1,
/* 0 1 2 3 4 5 6 7 8 */
{0},
{-1},
{ 0, 1, 2, 4, 7, 17, 31},
{ 0, 1, 2, 4, 7, 17, 31},
};
static const vorbis_info_residue0 _residue_44p_lfe={
0,-1, -1, 2,-1,-1,
/* 0 1 2 3 4 5 6 7 8 */
{0},
{-1},
{ 32},
{ -1}
};
static const static_bookblock _resbook_44p_n1={
{
{0},
{0,&_44pn1_p1_0},
{&_44pn1_p2_0,&_44pn1_p2_1,0},
{&_44pn1_p3_0,&_44pn1_p3_1,0},
{&_44pn1_p4_0,&_44pn1_p4_1,0},
{&_44pn1_p5_0,&_44pn1_p5_1,&_44pn1_p4_1},
{&_44pn1_p6_0,&_44pn1_p6_1,&_44pn1_p6_2},
}
};
static const static_bookblock _resbook_44p_0={
{
{0},
{0,&_44p0_p1_0},
{&_44p0_p2_0,&_44p0_p2_1,0},
{&_44p0_p3_0,&_44p0_p3_1,0},
{&_44p0_p4_0,&_44p0_p4_1,0},
{&_44p0_p5_0,&_44p0_p5_1,&_44p0_p4_1},
{&_44p0_p6_0,&_44p0_p6_1,&_44p0_p6_2},
}
};
static const static_bookblock _resbook_44p_1={
{
{0},
{0,&_44p1_p1_0},
{&_44p1_p2_0,&_44p1_p2_1,0},
{&_44p1_p3_0,&_44p1_p3_1,0},
{&_44p1_p4_0,&_44p1_p4_1,0},
{&_44p1_p5_0,&_44p1_p5_1,&_44p1_p4_1},
{&_44p1_p6_0,&_44p1_p6_1,&_44p1_p6_2},
}
};
static const static_bookblock _resbook_44p_2={
{
{0},
{0,0,&_44p2_p1_0},
{0,&_44p2_p2_0,0},
{&_44p2_p3_0,&_44p2_p3_1,0},
{&_44p2_p4_0,&_44p2_p4_1,0},
{&_44p2_p5_0,&_44p2_p5_1,0},
{&_44p2_p6_0,&_44p2_p6_1,&_44p2_p5_1},
{&_44p2_p7_0,&_44p2_p7_1,&_44p2_p7_2,&_44p2_p7_3}
}
};
static const static_bookblock _resbook_44p_3={
{
{0},
{0,0,&_44p3_p1_0},
{0,&_44p3_p2_0,0},
{&_44p3_p3_0,&_44p3_p3_1,0},
{&_44p3_p4_0,&_44p3_p4_1,0},
{&_44p3_p5_0,&_44p3_p5_1,0},
{&_44p3_p6_0,&_44p3_p6_1,&_44p3_p5_1},
{&_44p3_p7_0,&_44p3_p7_1,&_44p3_p7_2,&_44p3_p7_3}
}
};
static const static_bookblock _resbook_44p_4={
{
{0},
{0,0,&_44p4_p1_0},
{0,&_44p4_p2_0,0},
{&_44p4_p3_0,&_44p4_p3_1,0},
{&_44p4_p4_0,&_44p4_p4_1,0},
{&_44p4_p5_0,&_44p4_p5_1,0},
{&_44p4_p6_0,&_44p4_p6_1,&_44p4_p5_1},
{&_44p4_p7_0,&_44p4_p7_1,&_44p4_p7_2,&_44p4_p7_3}
}
};
static const static_bookblock _resbook_44p_5={
{
{0},
{0,0,&_44p5_p1_0},
{0,&_44p5_p2_0,0},
{&_44p5_p3_0,&_44p5_p3_1,0},
{&_44p5_p4_0,&_44p5_p4_1,0},
{&_44p5_p5_0,&_44p5_p5_1,0},
{&_44p5_p6_0,&_44p5_p6_1,&_44p5_p5_1},
{&_44p5_p7_0,&_44p5_p7_1,&_44p5_p7_2,&_44p5_p7_3}
}
};
static const static_bookblock _resbook_44p_6={
{
{0},
{0,0,&_44p6_p1_0},
{0,&_44p6_p2_0,0},
{&_44p6_p3_0,&_44p6_p3_1,0},
{&_44p6_p4_0,&_44p6_p4_1,0},
{&_44p6_p5_0,&_44p6_p5_1,0},
{&_44p6_p6_0,&_44p6_p6_1,&_44p6_p5_1},
{&_44p6_p7_0,&_44p6_p7_1,&_44p6_p7_2,&_44p6_p7_3}
}
};
static const static_bookblock _resbook_44p_7={
{
{0},
{0,0,&_44p7_p1_0},
{0,&_44p7_p2_0,0},
{&_44p7_p3_0,&_44p7_p3_1,0},
{&_44p7_p4_0,&_44p7_p4_1,0},
{&_44p7_p5_0,&_44p7_p5_1,0},
{&_44p7_p6_0,&_44p7_p6_1,&_44p7_p5_1},
{&_44p7_p7_0,&_44p7_p7_1,&_44p7_p7_2,&_44p7_p7_3}
}
};
static const static_bookblock _resbook_44p_8={
{
{0},
{0,0,&_44p8_p1_0},
{0,&_44p8_p2_0,0},
{&_44p8_p3_0,&_44p8_p3_1,0},
{&_44p8_p4_0,&_44p8_p4_1,0},
{&_44p8_p5_0,&_44p8_p5_1,0},
{&_44p8_p6_0,&_44p8_p6_1,&_44p8_p5_1},
{&_44p8_p7_0,&_44p8_p7_1,&_44p8_p7_2,&_44p8_p7_3}
}
};
static const static_bookblock _resbook_44p_9={
{
{0},
{0,0,&_44p9_p1_0},
{0,&_44p9_p2_0,0},
{&_44p9_p3_0,&_44p9_p3_1,0},
{&_44p9_p4_0,&_44p9_p4_1,0},
{&_44p9_p5_0,&_44p9_p5_1,0},
{&_44p9_p6_0,&_44p9_p6_1,&_44p9_p5_1},
{&_44p9_p7_0,&_44p9_p7_1,&_44p9_p7_2,&_44p9_p7_3}
}
};
static const static_bookblock _resbook_44p_ln1={
{
{&_44pn1_l0_0,&_44pn1_l0_1,0},
{&_44pn1_l1_0,&_44pn1_p6_1,&_44pn1_p6_2},
}
};
static const static_bookblock _resbook_44p_l0={
{
{&_44p0_l0_0,&_44p0_l0_1,0},
{&_44p0_l1_0,&_44p0_p6_1,&_44p0_p6_2},
}
};
static const static_bookblock _resbook_44p_l1={
{
{&_44p1_l0_0,&_44p1_l0_1,0},
{&_44p1_l1_0,&_44p1_p6_1,&_44p1_p6_2},
}
};
static const static_bookblock _resbook_44p_l2={
{
{&_44p2_l0_0,&_44p2_l0_1,0},
{&_44p2_l1_0,&_44p2_p7_2,&_44p2_p7_3},
}
};
static const static_bookblock _resbook_44p_l3={
{
{&_44p3_l0_0,&_44p3_l0_1,0},
{&_44p3_l1_0,&_44p3_p7_2,&_44p3_p7_3},
}
};
static const static_bookblock _resbook_44p_l4={
{
{&_44p4_l0_0,&_44p4_l0_1,0},
{&_44p4_l1_0,&_44p4_p7_2,&_44p4_p7_3},
}
};
static const static_bookblock _resbook_44p_l5={
{
{&_44p5_l0_0,&_44p5_l0_1,0},
{&_44p5_l1_0,&_44p5_p7_2,&_44p5_p7_3},
}
};
static const static_bookblock _resbook_44p_l6={
{
{&_44p6_l0_0,&_44p6_l0_1,0},
{&_44p6_l1_0,&_44p6_p7_2,&_44p6_p7_3},
}
};
static const static_bookblock _resbook_44p_l7={
{
{&_44p7_l0_0,&_44p7_l0_1,0},
{&_44p7_l1_0,&_44p7_p7_2,&_44p7_p7_3},
}
};
static const static_bookblock _resbook_44p_l8={
{
{&_44p8_l0_0,&_44p8_l0_1,0},
{&_44p8_l1_0,&_44p8_p7_2,&_44p8_p7_3},
}
};
static const static_bookblock _resbook_44p_l9={
{
{&_44p9_l0_0,&_44p9_l0_1,0},
{&_44p9_l1_0,&_44p9_p7_2,&_44p9_p7_3},
}
};
static const vorbis_info_mapping0 _map_nominal_51[2]={
{2, {0,0,0,0,0,1}, {0,2}, {0,2}, 4,{0,3,0,0},{2,4,1,3}},
{2, {0,0,0,0,0,1}, {1,2}, {1,2}, 4,{0,3,0,0},{2,4,1,3}}
};
static const vorbis_info_mapping0 _map_nominal_51u[2]={
{2, {0,0,0,0,0,1}, {0,2}, {0,2}, 0,{0},{0}},
{2, {0,0,0,0,0,1}, {1,2}, {1,2}, 0,{0},{0}}
};
static const vorbis_residue_template _res_44p51_n1[]={
{2,0,30, &_residue_44p_lo,
&_huff_book__44pn1_short,&_huff_book__44pn1_short,
&_resbook_44p_n1,&_resbook_44p_n1},
{2,0,30, &_residue_44p_lo,
&_huff_book__44pn1_long,&_huff_book__44pn1_long,
&_resbook_44p_n1,&_resbook_44p_n1},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44pn1_lfe,&_huff_book__44pn1_lfe,
&_resbook_44p_ln1,&_resbook_44p_ln1}
};
static const vorbis_residue_template _res_44p51_0[]={
{2,0,15, &_residue_44p_lo,
&_huff_book__44p0_short,&_huff_book__44p0_short,
&_resbook_44p_0,&_resbook_44p_0},
{2,0,30, &_residue_44p_lo,
&_huff_book__44p0_long,&_huff_book__44p0_long,
&_resbook_44p_0,&_resbook_44p_0},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p0_lfe,&_huff_book__44p0_lfe,
&_resbook_44p_l0,&_resbook_44p_l0}
};
static const vorbis_residue_template _res_44p51_1[]={
{2,0,15, &_residue_44p_lo,
&_huff_book__44p1_short,&_huff_book__44p1_short,
&_resbook_44p_1,&_resbook_44p_1},
{2,0,30, &_residue_44p_lo,
&_huff_book__44p1_long,&_huff_book__44p1_long,
&_resbook_44p_1,&_resbook_44p_1},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p1_lfe,&_huff_book__44p1_lfe,
&_resbook_44p_l1,&_resbook_44p_l1}
};
static const vorbis_residue_template _res_44p51_2[]={
{2,0,15, &_residue_44p,
&_huff_book__44p2_short,&_huff_book__44p2_short,
&_resbook_44p_2,&_resbook_44p_2},
{2,0,30, &_residue_44p,
&_huff_book__44p2_long,&_huff_book__44p2_long,
&_resbook_44p_2,&_resbook_44p_2},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p2_lfe,&_huff_book__44p2_lfe,
&_resbook_44p_l2,&_resbook_44p_l2}
};
static const vorbis_residue_template _res_44p51_3[]={
{2,0,15, &_residue_44p,
&_huff_book__44p3_short,&_huff_book__44p3_short,
&_resbook_44p_3,&_resbook_44p_3},
{2,0,30, &_residue_44p,
&_huff_book__44p3_long,&_huff_book__44p3_long,
&_resbook_44p_3,&_resbook_44p_3},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p3_lfe,&_huff_book__44p3_lfe,
&_resbook_44p_l3,&_resbook_44p_l3}
};
static const vorbis_residue_template _res_44p51_4[]={
{2,0,15, &_residue_44p,
&_huff_book__44p4_short,&_huff_book__44p4_short,
&_resbook_44p_4,&_resbook_44p_4},
{2,0,30, &_residue_44p,
&_huff_book__44p4_long,&_huff_book__44p4_long,
&_resbook_44p_4,&_resbook_44p_4},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p4_lfe,&_huff_book__44p4_lfe,
&_resbook_44p_l4,&_resbook_44p_l4}
};
static const vorbis_residue_template _res_44p51_5[]={
{2,0,15, &_residue_44p_hi,
&_huff_book__44p5_short,&_huff_book__44p5_short,
&_resbook_44p_5,&_resbook_44p_5},
{2,0,30, &_residue_44p_hi,
&_huff_book__44p5_long,&_huff_book__44p5_long,
&_resbook_44p_5,&_resbook_44p_5},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p5_lfe,&_huff_book__44p5_lfe,
&_resbook_44p_l5,&_resbook_44p_l5}
};
static const vorbis_residue_template _res_44p51_6[]={
{2,0,15, &_residue_44p_hi,
&_huff_book__44p6_short,&_huff_book__44p6_short,
&_resbook_44p_6,&_resbook_44p_6},
{2,0,30, &_residue_44p_hi,
&_huff_book__44p6_long,&_huff_book__44p6_long,
&_resbook_44p_6,&_resbook_44p_6},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
&_resbook_44p_l6,&_resbook_44p_l6}
};
static const vorbis_residue_template _res_44p51_7[]={
{2,0,15, &_residue_44p_hi,
&_huff_book__44p7_short,&_huff_book__44p7_short,
&_resbook_44p_7,&_resbook_44p_7},
{2,0,30, &_residue_44p_hi,
&_huff_book__44p7_long,&_huff_book__44p7_long,
&_resbook_44p_7,&_resbook_44p_7},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
&_resbook_44p_l6,&_resbook_44p_l6}
};
static const vorbis_residue_template _res_44p51_8[]={
{2,0,15, &_residue_44p_hi,
&_huff_book__44p8_short,&_huff_book__44p8_short,
&_resbook_44p_8,&_resbook_44p_8},
{2,0,30, &_residue_44p_hi,
&_huff_book__44p8_long,&_huff_book__44p8_long,
&_resbook_44p_8,&_resbook_44p_8},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
&_resbook_44p_l6,&_resbook_44p_l6}
};
static const vorbis_residue_template _res_44p51_9[]={
{2,0,15, &_residue_44p_hi,
&_huff_book__44p9_short,&_huff_book__44p9_short,
&_resbook_44p_9,&_resbook_44p_9},
{2,0,30, &_residue_44p_hi,
&_huff_book__44p9_long,&_huff_book__44p9_long,
&_resbook_44p_9,&_resbook_44p_9},
{1,2,6, &_residue_44p_lfe,
&_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
&_resbook_44p_l6,&_resbook_44p_l6}
};
static const vorbis_mapping_template _mapres_template_44_51[]={
{ _map_nominal_51, _res_44p51_n1 }, /* -1 */
{ _map_nominal_51, _res_44p51_0 }, /* 0 */
{ _map_nominal_51, _res_44p51_1 }, /* 1 */
{ _map_nominal_51, _res_44p51_2 }, /* 2 */
{ _map_nominal_51, _res_44p51_3 }, /* 3 */
{ _map_nominal_51, _res_44p51_4 }, /* 4 */
{ _map_nominal_51u, _res_44p51_5 }, /* 5 */
{ _map_nominal_51u, _res_44p51_6 }, /* 6 */
{ _map_nominal_51u, _res_44p51_7 }, /* 7 */
{ _map_nominal_51u, _res_44p51_8 }, /* 8 */
{ _map_nominal_51u, _res_44p51_9 }, /* 9 */
};

Просмотреть файл

@ -0,0 +1,318 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel residue templates for 32/44.1/48kHz uncoupled
last mod: $Id: residue_44u.h 16962 2010-03-11 07:30:34Z xiphmont $
********************************************************************/
#include "vorbis/codec.h"
#include "backends.h"
#include "books/uncoupled/res_books_uncoupled.h"
/***** residue backends *********************************************/
static const vorbis_info_residue0 _residue_44_low_un={
0,-1, -1, 8,-1,-1,
{0},
{-1},
{ 0, 1, 1, 2, 2, 4, 28},
{ -1, 25, -1, 45, -1, -1, -1}
};
static const vorbis_info_residue0 _residue_44_mid_un={
0,-1, -1, 10,-1,-1,
/* 0 1 2 3 4 5 6 7 8 9 */
{0},
{-1},
{ 0, 1, 1, 2, 2, 4, 4, 16, 60},
{ -1, 30, -1, 50, -1, 80, -1, -1, -1}
};
static const vorbis_info_residue0 _residue_44_hi_un={
0,-1, -1, 10,-1,-1,
/* 0 1 2 3 4 5 6 7 8 9 */
{0},
{-1},
{ 0, 1, 2, 4, 8, 16, 32, 71,157},
{ -1, -1, -1, -1, -1, -1, -1, -1, -1}
};
/* mapping conventions:
only one submap (this would change for efficient 5.1 support for example)*/
/* Four psychoacoustic profiles are used, one for each blocktype */
static const vorbis_info_mapping0 _map_nominal_u[2]={
{1, {0,0,0,0,0,0}, {0}, {0}, 0,{0},{0}},
{1, {0,0,0,0,0,0}, {1}, {1}, 0,{0},{0}}
};
static const static_bookblock _resbook_44u_n1={
{
{0},
{0,0,&_44un1__p1_0},
{0,0,&_44un1__p2_0},
{0,0,&_44un1__p3_0},
{0,0,&_44un1__p4_0},
{0,0,&_44un1__p5_0},
{&_44un1__p6_0,&_44un1__p6_1},
{&_44un1__p7_0,&_44un1__p7_1,&_44un1__p7_2}
}
};
static const static_bookblock _resbook_44u_0={
{
{0},
{0,0,&_44u0__p1_0},
{0,0,&_44u0__p2_0},
{0,0,&_44u0__p3_0},
{0,0,&_44u0__p4_0},
{0,0,&_44u0__p5_0},
{&_44u0__p6_0,&_44u0__p6_1},
{&_44u0__p7_0,&_44u0__p7_1,&_44u0__p7_2}
}
};
static const static_bookblock _resbook_44u_1={
{
{0},
{0,0,&_44u1__p1_0},
{0,0,&_44u1__p2_0},
{0,0,&_44u1__p3_0},
{0,0,&_44u1__p4_0},
{0,0,&_44u1__p5_0},
{&_44u1__p6_0,&_44u1__p6_1},
{&_44u1__p7_0,&_44u1__p7_1,&_44u1__p7_2}
}
};
static const static_bookblock _resbook_44u_2={
{
{0},
{0,0,&_44u2__p1_0},
{0,0,&_44u2__p2_0},
{0,0,&_44u2__p3_0},
{0,0,&_44u2__p4_0},
{0,0,&_44u2__p5_0},
{&_44u2__p6_0,&_44u2__p6_1},
{&_44u2__p7_0,&_44u2__p7_1,&_44u2__p7_2}
}
};
static const static_bookblock _resbook_44u_3={
{
{0},
{0,0,&_44u3__p1_0},
{0,0,&_44u3__p2_0},
{0,0,&_44u3__p3_0},
{0,0,&_44u3__p4_0},
{0,0,&_44u3__p5_0},
{&_44u3__p6_0,&_44u3__p6_1},
{&_44u3__p7_0,&_44u3__p7_1,&_44u3__p7_2}
}
};
static const static_bookblock _resbook_44u_4={
{
{0},
{0,0,&_44u4__p1_0},
{0,0,&_44u4__p2_0},
{0,0,&_44u4__p3_0},
{0,0,&_44u4__p4_0},
{0,0,&_44u4__p5_0},
{&_44u4__p6_0,&_44u4__p6_1},
{&_44u4__p7_0,&_44u4__p7_1,&_44u4__p7_2}
}
};
static const static_bookblock _resbook_44u_5={
{
{0},
{0,0,&_44u5__p1_0},
{0,0,&_44u5__p2_0},
{0,0,&_44u5__p3_0},
{0,0,&_44u5__p4_0},
{0,0,&_44u5__p5_0},
{0,0,&_44u5__p6_0},
{&_44u5__p7_0,&_44u5__p7_1},
{&_44u5__p8_0,&_44u5__p8_1},
{&_44u5__p9_0,&_44u5__p9_1,&_44u5__p9_2}
}
};
static const static_bookblock _resbook_44u_6={
{
{0},
{0,0,&_44u6__p1_0},
{0,0,&_44u6__p2_0},
{0,0,&_44u6__p3_0},
{0,0,&_44u6__p4_0},
{0,0,&_44u6__p5_0},
{0,0,&_44u6__p6_0},
{&_44u6__p7_0,&_44u6__p7_1},
{&_44u6__p8_0,&_44u6__p8_1},
{&_44u6__p9_0,&_44u6__p9_1,&_44u6__p9_2}
}
};
static const static_bookblock _resbook_44u_7={
{
{0},
{0,0,&_44u7__p1_0},
{0,0,&_44u7__p2_0},
{0,0,&_44u7__p3_0},
{0,0,&_44u7__p4_0},
{0,0,&_44u7__p5_0},
{0,0,&_44u7__p6_0},
{&_44u7__p7_0,&_44u7__p7_1},
{&_44u7__p8_0,&_44u7__p8_1},
{&_44u7__p9_0,&_44u7__p9_1,&_44u7__p9_2}
}
};
static const static_bookblock _resbook_44u_8={
{
{0},
{0,0,&_44u8_p1_0},
{0,0,&_44u8_p2_0},
{0,0,&_44u8_p3_0},
{0,0,&_44u8_p4_0},
{&_44u8_p5_0,&_44u8_p5_1},
{&_44u8_p6_0,&_44u8_p6_1},
{&_44u8_p7_0,&_44u8_p7_1},
{&_44u8_p8_0,&_44u8_p8_1},
{&_44u8_p9_0,&_44u8_p9_1,&_44u8_p9_2}
}
};
static const static_bookblock _resbook_44u_9={
{
{0},
{0,0,&_44u9_p1_0},
{0,0,&_44u9_p2_0},
{0,0,&_44u9_p3_0},
{0,0,&_44u9_p4_0},
{&_44u9_p5_0,&_44u9_p5_1},
{&_44u9_p6_0,&_44u9_p6_1},
{&_44u9_p7_0,&_44u9_p7_1},
{&_44u9_p8_0,&_44u9_p8_1},
{&_44u9_p9_0,&_44u9_p9_1,&_44u9_p9_2}
}
};
static const vorbis_residue_template _res_44u_n1[]={
{1,0,32, &_residue_44_low_un,
&_huff_book__44un1__short,&_huff_book__44un1__short,
&_resbook_44u_n1,&_resbook_44u_n1},
{1,0,32, &_residue_44_low_un,
&_huff_book__44un1__long,&_huff_book__44un1__long,
&_resbook_44u_n1,&_resbook_44u_n1}
};
static const vorbis_residue_template _res_44u_0[]={
{1,0,16, &_residue_44_low_un,
&_huff_book__44u0__short,&_huff_book__44u0__short,
&_resbook_44u_0,&_resbook_44u_0},
{1,0,32, &_residue_44_low_un,
&_huff_book__44u0__long,&_huff_book__44u0__long,
&_resbook_44u_0,&_resbook_44u_0}
};
static const vorbis_residue_template _res_44u_1[]={
{1,0,16, &_residue_44_low_un,
&_huff_book__44u1__short,&_huff_book__44u1__short,
&_resbook_44u_1,&_resbook_44u_1},
{1,0,32, &_residue_44_low_un,
&_huff_book__44u1__long,&_huff_book__44u1__long,
&_resbook_44u_1,&_resbook_44u_1}
};
static const vorbis_residue_template _res_44u_2[]={
{1,0,16, &_residue_44_low_un,
&_huff_book__44u2__short,&_huff_book__44u2__short,
&_resbook_44u_2,&_resbook_44u_2},
{1,0,32, &_residue_44_low_un,
&_huff_book__44u2__long,&_huff_book__44u2__long,
&_resbook_44u_2,&_resbook_44u_2}
};
static const vorbis_residue_template _res_44u_3[]={
{1,0,16, &_residue_44_low_un,
&_huff_book__44u3__short,&_huff_book__44u3__short,
&_resbook_44u_3,&_resbook_44u_3},
{1,0,32, &_residue_44_low_un,
&_huff_book__44u3__long,&_huff_book__44u3__long,
&_resbook_44u_3,&_resbook_44u_3}
};
static const vorbis_residue_template _res_44u_4[]={
{1,0,16, &_residue_44_low_un,
&_huff_book__44u4__short,&_huff_book__44u4__short,
&_resbook_44u_4,&_resbook_44u_4},
{1,0,32, &_residue_44_low_un,
&_huff_book__44u4__long,&_huff_book__44u4__long,
&_resbook_44u_4,&_resbook_44u_4}
};
static const vorbis_residue_template _res_44u_5[]={
{1,0,16, &_residue_44_mid_un,
&_huff_book__44u5__short,&_huff_book__44u5__short,
&_resbook_44u_5,&_resbook_44u_5},
{1,0,32, &_residue_44_mid_un,
&_huff_book__44u5__long,&_huff_book__44u5__long,
&_resbook_44u_5,&_resbook_44u_5}
};
static const vorbis_residue_template _res_44u_6[]={
{1,0,16, &_residue_44_mid_un,
&_huff_book__44u6__short,&_huff_book__44u6__short,
&_resbook_44u_6,&_resbook_44u_6},
{1,0,32, &_residue_44_mid_un,
&_huff_book__44u6__long,&_huff_book__44u6__long,
&_resbook_44u_6,&_resbook_44u_6}
};
static const vorbis_residue_template _res_44u_7[]={
{1,0,16, &_residue_44_mid_un,
&_huff_book__44u7__short,&_huff_book__44u7__short,
&_resbook_44u_7,&_resbook_44u_7},
{1,0,32, &_residue_44_mid_un,
&_huff_book__44u7__long,&_huff_book__44u7__long,
&_resbook_44u_7,&_resbook_44u_7}
};
static const vorbis_residue_template _res_44u_8[]={
{1,0,16, &_residue_44_hi_un,
&_huff_book__44u8__short,&_huff_book__44u8__short,
&_resbook_44u_8,&_resbook_44u_8},
{1,0,32, &_residue_44_hi_un,
&_huff_book__44u8__long,&_huff_book__44u8__long,
&_resbook_44u_8,&_resbook_44u_8}
};
static const vorbis_residue_template _res_44u_9[]={
{1,0,16, &_residue_44_hi_un,
&_huff_book__44u9__short,&_huff_book__44u9__short,
&_resbook_44u_9,&_resbook_44u_9},
{1,0,32, &_residue_44_hi_un,
&_huff_book__44u9__long,&_huff_book__44u9__long,
&_resbook_44u_9,&_resbook_44u_9}
};
static const vorbis_mapping_template _mapres_template_44_uncoupled[]={
{ _map_nominal_u, _res_44u_n1 }, /* -1 */
{ _map_nominal_u, _res_44u_0 }, /* 0 */
{ _map_nominal_u, _res_44u_1 }, /* 1 */
{ _map_nominal_u, _res_44u_2 }, /* 2 */
{ _map_nominal_u, _res_44u_3 }, /* 3 */
{ _map_nominal_u, _res_44u_4 }, /* 4 */
{ _map_nominal_u, _res_44u_5 }, /* 5 */
{ _map_nominal_u, _res_44u_6 }, /* 6 */
{ _map_nominal_u, _res_44u_7 }, /* 7 */
{ _map_nominal_u, _res_44u_8 }, /* 8 */
{ _map_nominal_u, _res_44u_9 }, /* 9 */
};

Просмотреть файл

@ -0,0 +1,109 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel residue templates 8/11kHz
last mod: $Id: residue_8.h 16962 2010-03-11 07:30:34Z xiphmont $
********************************************************************/
#include "vorbis/codec.h"
#include "backends.h"
/***** residue backends *********************************************/
static const static_bookblock _resbook_8s_0={
{
{0},
{0,0,&_8c0_s_p1_0},
{0},
{0,0,&_8c0_s_p3_0},
{0,0,&_8c0_s_p4_0},
{0,0,&_8c0_s_p5_0},
{0,0,&_8c0_s_p6_0},
{&_8c0_s_p7_0,&_8c0_s_p7_1},
{&_8c0_s_p8_0,&_8c0_s_p8_1},
{&_8c0_s_p9_0,&_8c0_s_p9_1,&_8c0_s_p9_2}
}
};
static const static_bookblock _resbook_8s_1={
{
{0},
{0,0,&_8c1_s_p1_0},
{0},
{0,0,&_8c1_s_p3_0},
{0,0,&_8c1_s_p4_0},
{0,0,&_8c1_s_p5_0},
{0,0,&_8c1_s_p6_0},
{&_8c1_s_p7_0,&_8c1_s_p7_1},
{&_8c1_s_p8_0,&_8c1_s_p8_1},
{&_8c1_s_p9_0,&_8c1_s_p9_1,&_8c1_s_p9_2}
}
};
static const vorbis_residue_template _res_8s_0[]={
{2,0,32, &_residue_44_mid,
&_huff_book__8c0_s_single,&_huff_book__8c0_s_single,
&_resbook_8s_0,&_resbook_8s_0},
};
static const vorbis_residue_template _res_8s_1[]={
{2,0,32, &_residue_44_mid,
&_huff_book__8c1_s_single,&_huff_book__8c1_s_single,
&_resbook_8s_1,&_resbook_8s_1},
};
static const vorbis_mapping_template _mapres_template_8_stereo[2]={
{ _map_nominal, _res_8s_0 }, /* 0 */
{ _map_nominal, _res_8s_1 }, /* 1 */
};
static const static_bookblock _resbook_8u_0={
{
{0},
{0,0,&_8u0__p1_0},
{0,0,&_8u0__p2_0},
{0,0,&_8u0__p3_0},
{0,0,&_8u0__p4_0},
{0,0,&_8u0__p5_0},
{&_8u0__p6_0,&_8u0__p6_1},
{&_8u0__p7_0,&_8u0__p7_1,&_8u0__p7_2}
}
};
static const static_bookblock _resbook_8u_1={
{
{0},
{0,0,&_8u1__p1_0},
{0,0,&_8u1__p2_0},
{0,0,&_8u1__p3_0},
{0,0,&_8u1__p4_0},
{0,0,&_8u1__p5_0},
{0,0,&_8u1__p6_0},
{&_8u1__p7_0,&_8u1__p7_1},
{&_8u1__p8_0,&_8u1__p8_1},
{&_8u1__p9_0,&_8u1__p9_1,&_8u1__p9_2}
}
};
static const vorbis_residue_template _res_8u_0[]={
{1,0,32, &_residue_44_low_un,
&_huff_book__8u0__single,&_huff_book__8u0__single,
&_resbook_8u_0,&_resbook_8u_0},
};
static const vorbis_residue_template _res_8u_1[]={
{1,0,32, &_residue_44_mid_un,
&_huff_book__8u1__single,&_huff_book__8u1__single,
&_resbook_8u_1,&_resbook_8u_1},
};
static const vorbis_mapping_template _mapres_template_8_uncoupled[2]={
{ _map_nominal_u, _res_8u_0 }, /* 0 */
{ _map_nominal_u, _res_8u_1 }, /* 1 */
};

Просмотреть файл

@ -0,0 +1,143 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: 11kHz settings
last mod: $Id: setup_11.h 16894 2010-02-12 20:32:12Z xiphmont $
********************************************************************/
#include "psych_11.h"
static const int blocksize_11[2]={
512,512
};
static const int _floor_mapping_11a[]={
6,6
};
static const int *_floor_mapping_11[]={
_floor_mapping_11a
};
static const double rate_mapping_11[3]={
8000.,13000.,44000.,
};
static const double rate_mapping_11_uncoupled[3]={
12000.,20000.,50000.,
};
static const double quality_mapping_11[3]={
-.1,.0,1.
};
static const ve_setup_data_template ve_setup_11_stereo={
2,
rate_mapping_11,
quality_mapping_11,
2,
9000,
15000,
blocksize_11,
blocksize_11,
_psy_tone_masteratt_11,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_11,
NULL,
_vp_tonemask_adj_11,
_psy_noiseguards_8,
_psy_noisebias_11,
_psy_noisebias_11,
NULL,
NULL,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_8_mapping,
NULL,
{_noise_start_8,_noise_start_8},
{_noise_part_8,_noise_part_8},
_noise_thresh_11,
_psy_ath_floater_8,
_psy_ath_abs_8,
_psy_lowpass_11,
_psy_global_44,
_global_mapping_8,
_psy_stereo_modes_8,
_floor_books,
_floor,
1,
_floor_mapping_11,
_mapres_template_8_stereo
};
static const ve_setup_data_template ve_setup_11_uncoupled={
2,
rate_mapping_11_uncoupled,
quality_mapping_11,
-1,
9000,
15000,
blocksize_11,
blocksize_11,
_psy_tone_masteratt_11,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_11,
NULL,
_vp_tonemask_adj_11,
_psy_noiseguards_8,
_psy_noisebias_11,
_psy_noisebias_11,
NULL,
NULL,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_8_mapping,
NULL,
{_noise_start_8,_noise_start_8},
{_noise_part_8,_noise_part_8},
_noise_thresh_11,
_psy_ath_floater_8,
_psy_ath_abs_8,
_psy_lowpass_11,
_psy_global_44,
_global_mapping_8,
_psy_stereo_modes_8,
_floor_books,
_floor,
1,
_floor_mapping_11,
_mapres_template_8_uncoupled
};

Просмотреть файл

@ -0,0 +1,153 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: 16kHz settings
last mod: $Id: setup_16.h 16894 2010-02-12 20:32:12Z xiphmont $
********************************************************************/
#include "psych_16.h"
#include "residue_16.h"
static const int blocksize_16_short[3]={
1024,512,512
};
static const int blocksize_16_long[3]={
1024,1024,1024
};
static const int _floor_mapping_16a[]={
9,3,3
};
static const int _floor_mapping_16b[]={
9,9,9
};
static const int *_floor_mapping_16[]={
_floor_mapping_16a,
_floor_mapping_16b
};
static const double rate_mapping_16[4]={
12000.,20000.,44000.,86000.
};
static const double rate_mapping_16_uncoupled[4]={
16000.,28000.,64000.,100000.
};
static const double _global_mapping_16[4]={ 1., 2., 3., 4. };
static const double quality_mapping_16[4]={ -.1,.05,.5,1. };
static const double _psy_compand_16_mapping[4]={ 0., .8, 1., 1.};
static const ve_setup_data_template ve_setup_16_stereo={
3,
rate_mapping_16,
quality_mapping_16,
2,
15000,
19000,
blocksize_16_short,
blocksize_16_long,
_psy_tone_masteratt_16,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_16,
_vp_tonemask_adj_16,
_vp_tonemask_adj_16,
_psy_noiseguards_16,
_psy_noisebias_16_impulse,
_psy_noisebias_16_short,
_psy_noisebias_16_short,
_psy_noisebias_16,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_16_mapping,
_psy_compand_16_mapping,
{_noise_start_16,_noise_start_16},
{ _noise_part_16, _noise_part_16},
_noise_thresh_16,
_psy_ath_floater_16,
_psy_ath_abs_16,
_psy_lowpass_16,
_psy_global_44,
_global_mapping_16,
_psy_stereo_modes_16,
_floor_books,
_floor,
2,
_floor_mapping_16,
_mapres_template_16_stereo
};
static const ve_setup_data_template ve_setup_16_uncoupled={
3,
rate_mapping_16_uncoupled,
quality_mapping_16,
-1,
15000,
19000,
blocksize_16_short,
blocksize_16_long,
_psy_tone_masteratt_16,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_16,
_vp_tonemask_adj_16,
_vp_tonemask_adj_16,
_psy_noiseguards_16,
_psy_noisebias_16_impulse,
_psy_noisebias_16_short,
_psy_noisebias_16_short,
_psy_noisebias_16,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_16_mapping,
_psy_compand_16_mapping,
{_noise_start_16,_noise_start_16},
{ _noise_part_16, _noise_part_16},
_noise_thresh_16,
_psy_ath_floater_16,
_psy_ath_abs_16,
_psy_lowpass_16,
_psy_global_44,
_global_mapping_16,
_psy_stereo_modes_16,
_floor_books,
_floor,
2,
_floor_mapping_16,
_mapres_template_16_uncoupled
};

Просмотреть файл

@ -0,0 +1,128 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: 22kHz settings
last mod: $Id: setup_22.h 17026 2010-03-25 05:00:27Z xiphmont $
********************************************************************/
static const double rate_mapping_22[4]={
15000.,20000.,44000.,86000.
};
static const double rate_mapping_22_uncoupled[4]={
16000.,28000.,50000.,90000.
};
static const double _psy_lowpass_22[4]={9.5,11.,30.,99.};
static const ve_setup_data_template ve_setup_22_stereo={
3,
rate_mapping_22,
quality_mapping_16,
2,
19000,
26000,
blocksize_16_short,
blocksize_16_long,
_psy_tone_masteratt_16,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_16,
_vp_tonemask_adj_16,
_vp_tonemask_adj_16,
_psy_noiseguards_16,
_psy_noisebias_16_impulse,
_psy_noisebias_16_short,
_psy_noisebias_16_short,
_psy_noisebias_16,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_16_mapping,
_psy_compand_16_mapping,
{_noise_start_16,_noise_start_16},
{ _noise_part_16, _noise_part_16},
_noise_thresh_16,
_psy_ath_floater_16,
_psy_ath_abs_16,
_psy_lowpass_22,
_psy_global_44,
_global_mapping_16,
_psy_stereo_modes_16,
_floor_books,
_floor,
2,
_floor_mapping_16,
_mapres_template_16_stereo
};
static const ve_setup_data_template ve_setup_22_uncoupled={
3,
rate_mapping_22_uncoupled,
quality_mapping_16,
-1,
19000,
26000,
blocksize_16_short,
blocksize_16_long,
_psy_tone_masteratt_16,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_16,
_vp_tonemask_adj_16,
_vp_tonemask_adj_16,
_psy_noiseguards_16,
_psy_noisebias_16_impulse,
_psy_noisebias_16_short,
_psy_noisebias_16_short,
_psy_noisebias_16,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_16_mapping,
_psy_compand_16_mapping,
{_noise_start_16,_noise_start_16},
{ _noise_part_16, _noise_part_16},
_noise_thresh_16,
_psy_ath_floater_16,
_psy_ath_abs_16,
_psy_lowpass_22,
_psy_global_44,
_global_mapping_16,
_psy_stereo_modes_16,
_floor_books,
_floor,
2,
_floor_mapping_16,
_mapres_template_16_uncoupled
};

Просмотреть файл

@ -0,0 +1,132 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel settings for 32kHz
last mod: $Id: setup_32.h 16894 2010-02-12 20:32:12Z xiphmont $
********************************************************************/
static const double rate_mapping_32[12]={
18000.,28000.,35000.,45000.,56000.,60000.,
75000.,90000.,100000.,115000.,150000.,190000.,
};
static const double rate_mapping_32_un[12]={
30000.,42000.,52000.,64000.,72000.,78000.,
86000.,92000.,110000.,120000.,140000.,190000.,
};
static const double _psy_lowpass_32[12]={
12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99.
};
static const ve_setup_data_template ve_setup_32_stereo={
11,
rate_mapping_32,
quality_mapping_44,
2,
26000,
40000,
blocksize_short_44,
blocksize_long_44,
_psy_tone_masteratt_44,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_otherblock,
_vp_tonemask_adj_longblock,
_vp_tonemask_adj_otherblock,
_psy_noiseguards_44,
_psy_noisebias_impulse,
_psy_noisebias_padding,
_psy_noisebias_trans,
_psy_noisebias_long,
_psy_noise_suppress,
_psy_compand_44,
_psy_compand_short_mapping,
_psy_compand_long_mapping,
{_noise_start_short_44,_noise_start_long_44},
{_noise_part_short_44,_noise_part_long_44},
_noise_thresh_44,
_psy_ath_floater,
_psy_ath_abs,
_psy_lowpass_32,
_psy_global_44,
_global_mapping_44,
_psy_stereo_modes_44,
_floor_books,
_floor,
2,
_floor_mapping_44,
_mapres_template_44_stereo
};
static const ve_setup_data_template ve_setup_32_uncoupled={
11,
rate_mapping_32_un,
quality_mapping_44,
-1,
26000,
40000,
blocksize_short_44,
blocksize_long_44,
_psy_tone_masteratt_44,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_otherblock,
_vp_tonemask_adj_longblock,
_vp_tonemask_adj_otherblock,
_psy_noiseguards_44,
_psy_noisebias_impulse,
_psy_noisebias_padding,
_psy_noisebias_trans,
_psy_noisebias_long,
_psy_noise_suppress,
_psy_compand_44,
_psy_compand_short_mapping,
_psy_compand_long_mapping,
{_noise_start_short_44,_noise_start_long_44},
{_noise_part_short_44,_noise_part_long_44},
_noise_thresh_44,
_psy_ath_floater,
_psy_ath_abs,
_psy_lowpass_32,
_psy_global_44,
_global_mapping_44,
NULL,
_floor_books,
_floor,
2,
_floor_mapping_44,
_mapres_template_44_uncoupled
};

Просмотреть файл

@ -0,0 +1,117 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel settings for 44.1/48kHz
last mod: $Id: setup_44.h 16962 2010-03-11 07:30:34Z xiphmont $
********************************************************************/
#include "modes/floor_all.h"
#include "modes/residue_44.h"
#include "modes/psych_44.h"
static const double rate_mapping_44_stereo[12]={
22500.,32000.,40000.,48000.,56000.,64000.,
80000.,96000.,112000.,128000.,160000.,250001.
};
static const double quality_mapping_44[12]={
-.1,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0
};
static const int blocksize_short_44[11]={
512,256,256,256,256,256,256,256,256,256,256
};
static const int blocksize_long_44[11]={
4096,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048
};
static const double _psy_compand_short_mapping[12]={
0.5, 1., 1., 1.3, 1.6, 2., 2., 2., 2., 2., 2., 2.
};
static const double _psy_compand_long_mapping[12]={
3.5, 4., 4., 4.3, 4.6, 5., 5., 5., 5., 5., 5., 5.
};
static const double _global_mapping_44[12]={
/* 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.5, 4., 4. */
0., 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.7, 4., 4.
};
static const int _floor_mapping_44a[11]={
1,0,0,2,2,4,5,5,5,5,5
};
static const int _floor_mapping_44b[11]={
8,7,7,7,7,7,7,7,7,7,7
};
static const int _floor_mapping_44c[11]={
10,10,10,10,10,10,10,10,10,10,10
};
static const int *_floor_mapping_44[]={
_floor_mapping_44a,
_floor_mapping_44b,
_floor_mapping_44c,
};
static const ve_setup_data_template ve_setup_44_stereo={
11,
rate_mapping_44_stereo,
quality_mapping_44,
2,
40000,
50000,
blocksize_short_44,
blocksize_long_44,
_psy_tone_masteratt_44,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_otherblock,
_vp_tonemask_adj_longblock,
_vp_tonemask_adj_otherblock,
_psy_noiseguards_44,
_psy_noisebias_impulse,
_psy_noisebias_padding,
_psy_noisebias_trans,
_psy_noisebias_long,
_psy_noise_suppress,
_psy_compand_44,
_psy_compand_short_mapping,
_psy_compand_long_mapping,
{_noise_start_short_44,_noise_start_long_44},
{_noise_part_short_44,_noise_part_long_44},
_noise_thresh_44,
_psy_ath_floater,
_psy_ath_abs,
_psy_lowpass_44,
_psy_global_44,
_global_mapping_44,
_psy_stereo_modes_44,
_floor_books,
_floor,
2,
_floor_mapping_44,
_mapres_template_44_stereo
};

Просмотреть файл

@ -0,0 +1,74 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel settings for 44.1/48kHz 5.1 surround modes
last mod: $Id$
********************************************************************/
#include "modes/residue_44p51.h"
static const double rate_mapping_44p51[12]={
14000.,20000.,28000.,38000.,46000.,54000.,
75000.,96000.,120000.,140000.,180000.,240001.
};
static const ve_setup_data_template ve_setup_44_51={
11,
rate_mapping_44p51,
quality_mapping_44,
6,
40000,
70000,
blocksize_short_44,
blocksize_long_44,
_psy_tone_masteratt_44,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_otherblock,
_vp_tonemask_adj_longblock,
_vp_tonemask_adj_otherblock,
_psy_noiseguards_44,
_psy_noisebias_impulse,
_psy_noisebias_padding,
_psy_noisebias_trans,
_psy_noisebias_long,
_psy_noise_suppress,
_psy_compand_44,
_psy_compand_short_mapping,
_psy_compand_long_mapping,
{_noise_start_short_44,_noise_start_long_44},
{_noise_part_short_44,_noise_part_long_44},
_noise_thresh_44,
_psy_ath_floater,
_psy_ath_abs,
_psy_lowpass_44,
_psy_global_44,
_global_mapping_44,
_psy_stereo_modes_44,
_floor_books,
_floor,
3,
_floor_mapping_44,
_mapres_template_44_51
};

Просмотреть файл

@ -0,0 +1,74 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: toplevel settings for 44.1/48kHz uncoupled modes
last mod: $Id: setup_44u.h 16962 2010-03-11 07:30:34Z xiphmont $
********************************************************************/
#include "modes/residue_44u.h"
static const double rate_mapping_44_un[12]={
32000.,48000.,60000.,70000.,80000.,86000.,
96000.,110000.,120000.,140000.,160000.,240001.
};
static const ve_setup_data_template ve_setup_44_uncoupled={
11,
rate_mapping_44_un,
quality_mapping_44,
-1,
40000,
50000,
blocksize_short_44,
blocksize_long_44,
_psy_tone_masteratt_44,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_otherblock,
_vp_tonemask_adj_longblock,
_vp_tonemask_adj_otherblock,
_psy_noiseguards_44,
_psy_noisebias_impulse,
_psy_noisebias_padding,
_psy_noisebias_trans,
_psy_noisebias_long,
_psy_noise_suppress,
_psy_compand_44,
_psy_compand_short_mapping,
_psy_compand_long_mapping,
{_noise_start_short_44,_noise_start_long_44},
{_noise_part_short_44,_noise_part_long_44},
_noise_thresh_44,
_psy_ath_floater,
_psy_ath_abs,
_psy_lowpass_44,
_psy_global_44,
_global_mapping_44,
_psy_stereo_modes_44,
_floor_books,
_floor,
2,
_floor_mapping_44,
_mapres_template_44_uncoupled
};

Просмотреть файл

@ -0,0 +1,149 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: 8kHz settings
last mod: $Id: setup_8.h 16894 2010-02-12 20:32:12Z xiphmont $
********************************************************************/
#include "psych_8.h"
#include "residue_8.h"
static const int blocksize_8[2]={
512,512
};
static const int _floor_mapping_8a[]={
6,6
};
static const int *_floor_mapping_8[]={
_floor_mapping_8a
};
static const double rate_mapping_8[3]={
6000.,9000.,32000.,
};
static const double rate_mapping_8_uncoupled[3]={
8000.,14000.,42000.,
};
static const double quality_mapping_8[3]={
-.1,.0,1.
};
static const double _psy_compand_8_mapping[3]={ 0., 1., 1.};
static const double _global_mapping_8[3]={ 1., 2., 3. };
static const ve_setup_data_template ve_setup_8_stereo={
2,
rate_mapping_8,
quality_mapping_8,
2,
8000,
9000,
blocksize_8,
blocksize_8,
_psy_tone_masteratt_8,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_8,
NULL,
_vp_tonemask_adj_8,
_psy_noiseguards_8,
_psy_noisebias_8,
_psy_noisebias_8,
NULL,
NULL,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_8_mapping,
NULL,
{_noise_start_8,_noise_start_8},
{_noise_part_8,_noise_part_8},
_noise_thresh_5only,
_psy_ath_floater_8,
_psy_ath_abs_8,
_psy_lowpass_8,
_psy_global_44,
_global_mapping_8,
_psy_stereo_modes_8,
_floor_books,
_floor,
1,
_floor_mapping_8,
_mapres_template_8_stereo
};
static const ve_setup_data_template ve_setup_8_uncoupled={
2,
rate_mapping_8_uncoupled,
quality_mapping_8,
-1,
8000,
9000,
blocksize_8,
blocksize_8,
_psy_tone_masteratt_8,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_8,
NULL,
_vp_tonemask_adj_8,
_psy_noiseguards_8,
_psy_noisebias_8,
_psy_noisebias_8,
NULL,
NULL,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_8_mapping,
NULL,
{_noise_start_8,_noise_start_8},
{_noise_part_8,_noise_part_8},
_noise_thresh_5only,
_psy_ath_floater_8,
_psy_ath_abs_8,
_psy_lowpass_8,
_psy_global_44,
_global_mapping_8,
_psy_stereo_modes_8,
_floor_books,
_floor,
1,
_floor_mapping_8,
_mapres_template_8_uncoupled
};

Просмотреть файл

@ -0,0 +1,225 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: catch-all toplevel settings for q modes only
last mod: $Id: setup_X.h 16894 2010-02-12 20:32:12Z xiphmont $
********************************************************************/
static const double rate_mapping_X[12]={
-1.,-1.,-1.,-1.,-1.,-1.,
-1.,-1.,-1.,-1.,-1.,-1.
};
static const ve_setup_data_template ve_setup_X_stereo={
11,
rate_mapping_X,
quality_mapping_44,
2,
50000,
200000,
blocksize_short_44,
blocksize_long_44,
_psy_tone_masteratt_44,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_otherblock,
_vp_tonemask_adj_longblock,
_vp_tonemask_adj_otherblock,
_psy_noiseguards_44,
_psy_noisebias_impulse,
_psy_noisebias_padding,
_psy_noisebias_trans,
_psy_noisebias_long,
_psy_noise_suppress,
_psy_compand_44,
_psy_compand_short_mapping,
_psy_compand_long_mapping,
{_noise_start_short_44,_noise_start_long_44},
{_noise_part_short_44,_noise_part_long_44},
_noise_thresh_44,
_psy_ath_floater,
_psy_ath_abs,
_psy_lowpass_44,
_psy_global_44,
_global_mapping_44,
_psy_stereo_modes_44,
_floor_books,
_floor,
2,
_floor_mapping_44,
_mapres_template_44_stereo
};
static const ve_setup_data_template ve_setup_X_uncoupled={
11,
rate_mapping_X,
quality_mapping_44,
-1,
50000,
200000,
blocksize_short_44,
blocksize_long_44,
_psy_tone_masteratt_44,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_otherblock,
_vp_tonemask_adj_longblock,
_vp_tonemask_adj_otherblock,
_psy_noiseguards_44,
_psy_noisebias_impulse,
_psy_noisebias_padding,
_psy_noisebias_trans,
_psy_noisebias_long,
_psy_noise_suppress,
_psy_compand_44,
_psy_compand_short_mapping,
_psy_compand_long_mapping,
{_noise_start_short_44,_noise_start_long_44},
{_noise_part_short_44,_noise_part_long_44},
_noise_thresh_44,
_psy_ath_floater,
_psy_ath_abs,
_psy_lowpass_44,
_psy_global_44,
_global_mapping_44,
NULL,
_floor_books,
_floor,
2,
_floor_mapping_44,
_mapres_template_44_uncoupled
};
static const ve_setup_data_template ve_setup_XX_stereo={
2,
rate_mapping_X,
quality_mapping_8,
2,
0,
8000,
blocksize_8,
blocksize_8,
_psy_tone_masteratt_8,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_8,
NULL,
_vp_tonemask_adj_8,
_psy_noiseguards_8,
_psy_noisebias_8,
_psy_noisebias_8,
NULL,
NULL,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_8_mapping,
NULL,
{_noise_start_8,_noise_start_8},
{_noise_part_8,_noise_part_8},
_noise_thresh_5only,
_psy_ath_floater_8,
_psy_ath_abs_8,
_psy_lowpass_8,
_psy_global_44,
_global_mapping_8,
_psy_stereo_modes_8,
_floor_books,
_floor,
1,
_floor_mapping_8,
_mapres_template_8_stereo
};
static const ve_setup_data_template ve_setup_XX_uncoupled={
2,
rate_mapping_X,
quality_mapping_8,
-1,
0,
8000,
blocksize_8,
blocksize_8,
_psy_tone_masteratt_8,
_psy_tone_0dB,
_psy_tone_suppress,
_vp_tonemask_adj_8,
NULL,
_vp_tonemask_adj_8,
_psy_noiseguards_8,
_psy_noisebias_8,
_psy_noisebias_8,
NULL,
NULL,
_psy_noise_suppress,
_psy_compand_8,
_psy_compand_8_mapping,
NULL,
{_noise_start_8,_noise_start_8},
{_noise_part_8,_noise_part_8},
_noise_thresh_5only,
_psy_ath_floater_8,
_psy_ath_abs_8,
_psy_lowpass_8,
_psy_global_44,
_global_mapping_8,
_psy_stereo_modes_8,
_floor_books,
_floor,
1,
_floor_mapping_8,
_mapres_template_8_uncoupled
};

Просмотреть файл

@ -26,10 +26,6 @@
#include "misc.h"
#ifdef SOLARIS
#define HAVE_ALLOCA_H
#endif
#ifndef _V_IFDEFJAIL_H_
# define _V_IFDEFJAIL_H_

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -8,6 +8,7 @@ MODULE = 'vorbis'
EXPORTS.vorbis += [
'include/vorbis/codec.h',
'include/vorbis/vorbisenc.h',
]
LIBRARY_NAME = 'vorbis'
@ -33,8 +34,11 @@ SOURCES += [
'lib/vorbis_smallft.c',
'lib/vorbis_synthesis.c',
'lib/vorbis_window.c',
'lib/vorbisenc.c',
]
LOCAL_INCLUDES += ['lib']
if CONFIG['OS_ARCH'] == 'AIX':
DEFINES['alloca'] = '__alloca'

Просмотреть файл

@ -2,6 +2,8 @@
#
# Copies the needed files from a directory containing the original
# libvorbis source that we need for the Mozilla HTML5 media support.
mkdir -p ./lib
mkdir -p ./include/vorbis
cp $1/lib/envelope.h ./lib/envelope.h
cp $1/lib/lpc.h ./lib/lpc.h
cp $1/lib/highlevel.h ./lib/highlevel.h
@ -47,4 +49,35 @@ cp $1/COPYING ./COPYING
cp $1/README ./README
cp $1/AUTHORS ./AUTHORS
# Encoder support
cp $1/lib/vorbisenc.c ./lib/vorbisenc.c
cp $1/include/vorbis/vorbisenc.h ./include/vorbis/vorbisenc.h
mkdir -p ./lib/modes
cp $1/lib/modes/setup_44.h ./lib/modes/setup_44.h
cp $1/lib/modes/setup_44u.h ./lib/modes/setup_44u.h
cp $1/lib/modes/setup_44p51.h ./lib/modes/setup_44p51.h
cp $1/lib/modes/setup_32.h ./lib/modes/setup_32.h
cp $1/lib/modes/setup_8.h ./lib/modes/setup_8.h
cp $1/lib/modes/setup_11.h ./lib/modes/setup_11.h
cp $1/lib/modes/setup_16.h ./lib/modes/setup_16.h
cp $1/lib/modes/setup_22.h ./lib/modes/setup_22.h
cp $1/lib/modes/setup_X.h ./lib/modes/setup_X.h
cp $1/lib/modes/floor_all.h ./lib/modes/floor_all.h
cp $1/lib/modes/residue_44.h ./lib/modes/residue_44.h
cp $1/lib/modes/residue_44u.h ./lib/modes/residue_44u.h
cp $1/lib/modes/residue_44p51.h ./lib/modes/residue_44p51.h
cp $1/lib/modes/residue_8.h ./lib/modes/residue_8.h
cp $1/lib/modes/residue_16.h ./lib/modes/residue_16.h
cp $1/lib/modes/psych_44.h ./lib/modes/psych_44.h
cp $1/lib/modes/psych_8.h ./lib/modes/psych_8.h
cp $1/lib/modes/psych_11.h ./lib/modes/psych_11.h
cp $1/lib/modes/psych_16.h ./lib/modes/psych_16.h
mkdir -p ./lib/books/coupled
mkdir -p ./lib/books/floor
mkdir -p ./lib/books/uncoupled
cp $1/lib/books/coupled/res_books_stereo.h ./lib/books/coupled/
cp $1/lib/books/coupled/res_books_51.h ./lib/books/coupled/
cp $1/lib/books/floor/floor_books.h ./lib/books/floor/
cp $1/lib/books/uncoupled/res_books_uncoupled.h ./lib/books/uncoupled/
# Add any patches against upstream here.

Просмотреть файл

@ -7,7 +7,11 @@
#include "nsISupports.idl"
%{ C++
#include "mozilla/net/DNS.h"
namespace mozilla {
namespace net {
union NetAddr;
}
}
%}
native NetAddr(mozilla::net::NetAddr);

Просмотреть файл

@ -4,15 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
LOCAL_INCLUDES += -I$(topsrcdir)/dom/base
ifdef MOZ_RTSP
LOCAL_INCLUDES += -I$(topsrcdir)/netwerk/protocol/rtsp/controller
LOCAL_INCLUDES += -I$(topsrcdir)/netwerk/protocol/rtsp/rtsp
endif
ifdef MOZ_ENABLE_QTNETWORK
LOCAL_INCLUDES += -I$(srcdir)/../../system/qt
OS_INCLUDES += $(MOZ_QT_CFLAGS)
endif

Просмотреть файл

@ -525,7 +525,7 @@ Seer::EnsureInitStorage()
stmt = nullptr;
rv = mDB->CreateStatement(
NS_LITERAL_CSTRING("UPDATE moz_startups SET startups = :startup_count "
NS_LITERAL_CSTRING("UPDATE moz_startups SET startups = :startup_count, "
"last_startup = :startup_time;\n"),
getter_AddRefs(stmt));
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -7,8 +7,9 @@
#include "StreamingProtocolService.h"
#include "mozilla/net/NeckoChild.h"
#include "nsIURI.h"
#include "necko-config.h"
#ifdef MOZ_RTSP
#ifdef NECKO_PROTOCOL_rtsp
#include "RtspControllerChild.h"
#include "RtspController.h"
#endif

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше