ref: 20752cb184977741be1df2c9adf0a634c4b1690b
parent: ca1868c93be4a7a8b500359310f4719ac10dab03
author: Sam Leitch <[email protected]>
date: Sun Mar 9 18:58:09 EDT 2014
Removed the last of the Broadway.js code as it's all been rewritten. Moved uglification to Rakefile for consistency. Created new minified file based on current version.
--- a/js/Gruntfile.js
+++ /dev/null
@@ -1,38 +1,0 @@
-module.exports = function(grunt) {
- grunt.initConfig({
-
- uglify: {
- options: {
- mangle: false
- },
- minlibs: {
- files: {
- 'dist/h264bsd.min.js': ['h264bsd_asm.js',' sylvester.js', 'glUtils.js', 'util.js', 'canvas.js', 'h264bsd.js']
- }
- }
- },
-
- concat: {
- libs: {
- src: ['h264bsd_asm.js',' sylvester.js', 'glUtils.js', 'util.js', 'canvas.js', 'h264bsd.js'],
- dest: 'dist/h264bsd.min.js'
- }
- },
-
- //grunt-clean
- clean: {
- dist: 'dist/',
- options: {
- force:true
- }
- }
- });
-
- grunt.loadNpmTasks('grunt-contrib-clean');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-concat');
-
-
- // Default task.
- grunt.registerTask('default', ['clean', 'uglify']);
-};
--- a/js/Rakefile
+++ b/js/Rakefile
@@ -25,9 +25,29 @@
sh "emcc #{o_files.join(' ')} -s TOTAL_MEMORY=268435456 -s EXPORTED_FUNCTIONS='[\"#{export_functions.join('", "')}\"]' #{EMCC_FLAGS} -o h264bsd_asm.js"
end
+source_files = [
+ "h264bsd_asm.js",
+ "h264bsd_decoder.js",
+ "h264bsd_canvas.js",
+]
+
+file "h264bsd.min.js" => source_files do
+ sh "uglifyjs #{source_files.join(' ')} -c -o h264bsd.min.js"
+end
+
+task :compress => ["h264bsd.min.js"]
+
task :clean do
o_files.each{|o| FileUtils.rm_f(o)}
FileUtils.rm_f("h264bsd_asm.js")
+ FileUtils.rm_f("h264bsd.min.js")
end
-task :default => ["h264bsd_asm.js"]
\ No newline at end of file
+desc "Check for prereq tools"
+task :setup do
+ sh("emcc --version") { |ok, res| fail("Can't find emscripten binaries.") unless ok }
+ sh("uglifyjs --version") { |ok, res| fail("Can't find UglifyJS2 tool for minification.") unless ok }
+ puts("Ready to go")
+end
+
+task :default => [:setup, "h264bsd.min.js"]
--- a/js/canvas.js
+++ /dev/null
@@ -1,552 +1,0 @@
-/*
- * This file wraps several WebGL constructs and provides a simple, single texture based WebGLCanvas as well as a
- * specialized YUVWebGLCanvas that can handle YUV->RGB conversion.
- */
-
-/**
- * Represents a WebGL shader script.
- */
-var Script = (function script() {
- function constructor() {}
-
- constructor.createFromElementId = function(id) {
- var script = document.getElementById(id);
-
- // Didn't find an element with the specified ID, abort.
- assert(script , "Could not find shader with ID: " + id);
-
- // Walk through the source element's children, building the shader source string.
- var source = "";
- var currentChild = script .firstChild;
- while(currentChild) {
- if (currentChild.nodeType == 3) {
- source += currentChild.textContent;
- }
- currentChild = currentChild.nextSibling;
- }
-
- var res = new constructor();
- res.type = script.type;
- res.source = source;
- return res;
- };
-
- constructor.createFromSource = function(type, source) {
- var res = new constructor();
- res.type = type;
- res.source = source;
- return res;
- }
- return constructor;
-})();
-
-/**
- * Represents a WebGL shader object and provides a mechanism to load shaders from HTML
- * script tags.
- */
-var Shader = (function shader() {
- function constructor(gl, script) {
-
- // Now figure out what type of shader script we have, based on its MIME type.
- if (script.type == "x-shader/x-fragment") {
- this.shader = gl.createShader(gl.FRAGMENT_SHADER);
- } else if (script.type == "x-shader/x-vertex") {
- this.shader = gl.createShader(gl.VERTEX_SHADER);
- } else {
- error("Unknown shader type: " + script.type);
- return;
- }
-
- // Send the source to the shader object.
- gl.shaderSource(this.shader, script.source);
-
- // Compile the shader program.
- gl.compileShader(this.shader);
-
- // See if it compiled successfully.
- if (!gl.getShaderParameter(this.shader, gl.COMPILE_STATUS)) {
- error("An error occurred compiling the shaders: " + gl.getShaderInfoLog(this.shader));
- return;
- }
- }
- return constructor;
-})();
-
-var Program = (function () {
- function constructor(gl) {
- this.gl = gl;
- this.program = this.gl.createProgram();
- }
- constructor.prototype = {
- attach: function (shader) {
- this.gl.attachShader(this.program, shader.shader);
- },
- link: function () {
- this.gl.linkProgram(this.program);
- // If creating the shader program failed, alert.
- assert(this.gl.getProgramParameter(this.program, this.gl.LINK_STATUS),
- "Unable to initialize the shader program.");
- },
- use: function () {
- this.gl.useProgram(this.program);
- },
- getAttributeLocation: function(name) {
- return this.gl.getAttribLocation(this.program, name);
- },
- setMatrixUniform: function(name, array) {
- var uniform = this.gl.getUniformLocation(this.program, name);
- this.gl.uniformMatrix4fv(uniform, false, array);
- }
- };
- return constructor;
-})();
-
-/**
- * Represents a WebGL texture object.
- */
-var Texture = (function texture() {
- function constructor(gl, size, format) {
- this.gl = gl;
- this.size = size;
- this.texture = gl.createTexture();
- gl.bindTexture(gl.TEXTURE_2D, this.texture);
- this.format = format ? format : gl.LUMINANCE;
- gl.texImage2D(gl.TEXTURE_2D, 0, this.format, size.w, size.h, 0, this.format, gl.UNSIGNED_BYTE, null);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
- }
- var textureIDs = null;
- constructor.prototype = {
- fill: function(textureData, useTexSubImage2D) {
- var gl = this.gl;
- assert(textureData.length >= this.size.w * this.size.h,
- "Texture size mismatch, data:" + textureData.length + ", texture: " + this.size.w * this.size.h);
- gl.bindTexture(gl.TEXTURE_2D, this.texture);
- if (useTexSubImage2D) {
- gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.size.w , this.size.h, this.format, gl.UNSIGNED_BYTE, textureData);
- } else {
- // texImage2D seems to be faster, thus keeping it as the default
- gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.size.w, this.size.h, 0, this.format, gl.UNSIGNED_BYTE, textureData);
- }
- },
- bind: function(n, program, name) {
- var gl = this.gl;
- if (!textureIDs) {
- textureIDs = [gl.TEXTURE0, gl.TEXTURE1, gl.TEXTURE2];
- }
- gl.activeTexture(textureIDs[n]);
- gl.bindTexture(gl.TEXTURE_2D, this.texture);
- gl.uniform1i(gl.getUniformLocation(program.program, name), n);
- }
- };
- return constructor;
-})();
-
-/**
- * Generic WebGL backed canvas that sets up: a quad to paint a texture on, appropriate vertex/fragment shaders,
- * scene parameters and other things. Specialized versions of this class can be created by overriding several
- * initialization methods.
- *
- * <code>
- * var canvas = new WebGLCanvas(document.getElementById('canvas'), new Size(512, 512);
- * canvas.texture.fill(data);
- * canvas.drawScene();
- * </code>
- */
-var WebGLCanvas = (function () {
-
- var vertexShaderScript = Script.createFromSource("x-shader/x-vertex", text([
- "attribute vec3 aVertexPosition;",
- "attribute vec2 aTextureCoord;",
- "uniform mat4 uMVMatrix;",
- "uniform mat4 uPMatrix;",
- "varying highp vec2 vTextureCoord;",
- "void main(void) {",
- " gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);",
- " vTextureCoord = aTextureCoord;",
- "}"
- ]));
-
- var fragmentShaderScript = Script.createFromSource("x-shader/x-fragment", text([
- "precision highp float;",
- "varying highp vec2 vTextureCoord;",
- "uniform sampler2D texture;",
- "void main(void) {",
- " gl_FragColor = texture2D(texture, vTextureCoord);",
- "}"
- ]));
-
- function constructor(canvas, size, useFrameBuffer) {
- this.canvas = canvas;
- this.size = size;
- this.canvas.width = size.w;
- this.canvas.height = size.h;
-
- this.onInitWebGL();
- this.onInitShaders();
- initBuffers.call(this);
- if (useFrameBuffer) {
- initFramebuffer.call(this);
- }
- this.onInitTextures();
- initScene.call(this);
- }
-
- /**
- * Initialize a frame buffer so that we can render off-screen.
- */
- function initFramebuffer() {
- var gl = this.gl;
-
- // Create framebuffer object and texture.
- this.framebuffer = gl.createFramebuffer();
- gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);
- this.framebufferTexture = new Texture(this.gl, this.size, gl.RGB);
-
- // Create and allocate renderbuffer for depth data.
- var renderbuffer = gl.createRenderbuffer();
- gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
- gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, this.size.w, this.size.h);
-
- // Attach texture and renderbuffer to the framebuffer.
- gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.framebufferTexture.texture, 0);
- gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbuffer);
- }
-
- /**
- * Initialize vertex and texture coordinate buffers for a plane.
- */
- function initBuffers() {
- var tmp;
- var gl = this.gl;
-
- // Create vertex position buffer.
- this.quadVPBuffer = gl.createBuffer();
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadVPBuffer);
- tmp = [
- 1.0, 1.0, 0.0,
- -1.0, 1.0, 0.0,
- 1.0, -1.0, 0.0,
- -1.0, -1.0, 0.0];
-
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tmp), gl.STATIC_DRAW);
- this.quadVPBuffer.itemSize = 3;
- this.quadVPBuffer.numItems = 4;
-
- /*
- +--------------------+
- | -1,1 (1) | 1,1 (0)
- | |
- | |
- | |
- | |
- | |
- | -1,-1 (3) | 1,-1 (2)
- +--------------------+
- */
-
- var scaleX = 1.0;
- var scaleY = 1.0;
-
- // Create vertex texture coordinate buffer.
- this.quadVTCBuffer = gl.createBuffer();
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadVTCBuffer);
- tmp = [
- scaleX, 0.0,
- 0.0, 0.0,
- scaleX, scaleY,
- 0.0, scaleY,
- ];
- gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(tmp), gl.STATIC_DRAW);
- }
-
- function mvIdentity() {
- this.mvMatrix = Matrix.I(4);
- }
-
- function mvMultiply(m) {
- this.mvMatrix = this.mvMatrix.x(m);
- }
-
- function mvTranslate(m) {
- mvMultiply.call(this, Matrix.Translation($V([m[0], m[1], m[2]])).ensure4x4());
- }
-
- function setMatrixUniforms() {
- this.program.setMatrixUniform("uPMatrix", new Float32Array(this.perspectiveMatrix.flatten()));
- this.program.setMatrixUniform("uMVMatrix", new Float32Array(this.mvMatrix.flatten()));
- }
-
- function initScene() {
- var gl = this.gl;
-
- // Establish the perspective with which we want to view the
- // scene. Our field of view is 45 degrees, with a width/height
- // ratio of 640:480, and we only want to see objects between 0.1 units
- // and 100 units away from the camera.
-
- this.perspectiveMatrix = makePerspective(45, 1, 0.1, 100.0);
-
- // Set the drawing position to the "identity" point, which is
- // the center of the scene.
- mvIdentity.call(this);
-
- // Now move the drawing position a bit to where we want to start
- // drawing the square.
- mvTranslate.call(this, [0.0, 0.0, -2.4]);
-
- // Draw the cube by binding the array buffer to the cube's vertices
- // array, setting attributes, and pushing it to GL.
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadVPBuffer);
- gl.vertexAttribPointer(this.vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0);
-
- // Set the texture coordinates attribute for the vertices.
-
- gl.bindBuffer(gl.ARRAY_BUFFER, this.quadVTCBuffer);
- gl.vertexAttribPointer(this.textureCoordAttribute, 2, gl.FLOAT, false, 0, 0);
-
- this.onInitSceneTextures();
-
- setMatrixUniforms.call(this);
-
- if (this.framebuffer) {
- console.log("Bound Frame Buffer");
- gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);
- }
- }
-
- constructor.prototype = {
- toString: function() {
- return "WebGLCanvas Size: " + this.size;
- },
- checkLastError: function (operation) {
- var err = this.gl.getError();
- if (err != this.gl.NO_ERROR) {
- var name = this.glNames[err];
- name = (name !== undefined) ? name + "(" + err + ")":
- ("Unknown WebGL ENUM (0x" + value.toString(16) + ")");
- if (operation) {
- console.log("WebGL Error: %s, %s", operation, name);
- } else {
- console.log("WebGL Error: %s", name);
- }
- console.trace();
- }
- },
- onInitWebGL: function () {
- try {
- this.gl = this.canvas.getContext("experimental-webgl");
- } catch(e) {}
-
- if (!this.gl) {
- error("Unable to initialize WebGL. Your browser may not support it.");
- }
- if (this.glNames) {
- return;
- }
- this.glNames = {};
- for (var propertyName in this.gl) {
- if (typeof this.gl[propertyName] == 'number') {
- this.glNames[this.gl[propertyName]] = propertyName;
- }
- }
- },
- onInitShaders: function() {
- this.program = new Program(this.gl);
- this.program.attach(new Shader(this.gl, vertexShaderScript));
- this.program.attach(new Shader(this.gl, fragmentShaderScript));
- this.program.link();
- this.program.use();
- this.vertexPositionAttribute = this.program.getAttributeLocation("aVertexPosition");
- this.gl.enableVertexAttribArray(this.vertexPositionAttribute);
- this.textureCoordAttribute = this.program.getAttributeLocation("aTextureCoord");;
- this.gl.enableVertexAttribArray(this.textureCoordAttribute);
- },
- onInitTextures: function () {
- var gl = this.gl;
- this.texture = new Texture(gl, this.size, gl.RGB);
- },
- onInitSceneTextures: function () {
- this.texture.bind(0, this.program, "texture");
- },
- drawScene: function() {
- this.gl.drawArrays(this.gl.TRIANGLE_STRIP, 0, 4);
- },
- readPixels: function(buffer) {
- var gl = this.gl;
- gl.readPixels(0, 0, this.size.w, this.size.h, gl.RGB, gl.UNSIGNED_BYTE, buffer);
- }
- };
- return constructor;
-})();
-
-var YUVWebGLCanvas = (function () {
- var vertexShaderScript = Script.createFromSource("x-shader/x-vertex", text([
- "attribute vec3 aVertexPosition;",
- "attribute vec2 aTextureCoord;",
- "uniform mat4 uMVMatrix;",
- "uniform mat4 uPMatrix;",
- "varying highp vec2 vTextureCoord;",
- "void main(void) {",
- " gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);",
- " vTextureCoord = aTextureCoord;",
- "}"
- ]));
-
- var fragmentShaderScriptOld = Script.createFromSource("x-shader/x-fragment", text([
- "precision highp float;",
- "varying highp vec2 vTextureCoord;",
- "uniform sampler2D YTexture;",
- "uniform sampler2D UTexture;",
- "uniform sampler2D VTexture;",
-
- "void main(void) {",
- " vec3 YUV = vec3",
- " (",
- " texture2D(YTexture, vTextureCoord).x * 1.1643828125, // premultiply Y",
- " texture2D(UTexture, vTextureCoord).x,",
- " texture2D(VTexture, vTextureCoord).x",
- " );",
- " gl_FragColor = vec4",
- " (",
- " YUV.x + 1.59602734375 * YUV.z - 0.87078515625,",
- " YUV.x - 0.39176171875 * YUV.y - 0.81296875 * YUV.z + 0.52959375,",
- " YUV.x + 2.017234375 * YUV.y - 1.081390625,",
- " 1",
- " );",
- "}"
- ]));
-
- var fragmentShaderScriptSimple = Script.createFromSource("x-shader/x-fragment", text([
- "precision highp float;",
- "varying highp vec2 vTextureCoord;",
- "uniform sampler2D YTexture;",
- "uniform sampler2D UTexture;",
- "uniform sampler2D VTexture;",
-
- "void main(void) {",
- " gl_FragColor = texture2D(YTexture, vTextureCoord);",
- "}"
- ]));
-
- var fragmentShaderScript = Script.createFromSource("x-shader/x-fragment", text([
- "precision highp float;",
- "varying highp vec2 vTextureCoord;",
- "uniform sampler2D YTexture;",
- "uniform sampler2D UTexture;",
- "uniform sampler2D VTexture;",
- "const mat4 YUV2RGB = mat4",
- "(",
- " 1.1643828125, 0, 1.59602734375, -.87078515625,",
- " 1.1643828125, -.39176171875, -.81296875, .52959375,",
- " 1.1643828125, 2.017234375, 0, -1.081390625,",
- " 0, 0, 0, 1",
- ");",
-
- "void main(void) {",
- " gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;",
- "}"
- ]));
-
-
- function constructor(canvas, size) {
- WebGLCanvas.call(this, canvas, size);
- }
-
- constructor.prototype = inherit(WebGLCanvas, {
- onInitShaders: function() {
- this.program = new Program(this.gl);
- this.program.attach(new Shader(this.gl, vertexShaderScript));
- this.program.attach(new Shader(this.gl, fragmentShaderScript));
- this.program.link();
- this.program.use();
- this.vertexPositionAttribute = this.program.getAttributeLocation("aVertexPosition");
- this.gl.enableVertexAttribArray(this.vertexPositionAttribute);
- this.textureCoordAttribute = this.program.getAttributeLocation("aTextureCoord");;
- this.gl.enableVertexAttribArray(this.textureCoordAttribute);
- },
- onInitTextures: function () {
- this.YTexture = new Texture(this.gl, this.size);
- this.UTexture = new Texture(this.gl, this.size.getHalfSize());
- this.VTexture = new Texture(this.gl, this.size.getHalfSize());
- },
- onInitSceneTextures: function () {
- this.YTexture.bind(0, this.program, "YTexture");
- this.UTexture.bind(1, this.program, "UTexture");
- this.VTexture.bind(2, this.program, "VTexture");
- },
- fillYUVTextures: function(y, u, v) {
- this.YTexture.fill(y);
- this.UTexture.fill(u);
- this.VTexture.fill(v);
- },
- toString: function() {
- return "YUVCanvas Size: " + this.size;
- }
- });
-
- return constructor;
-})();
-
-
-var FilterWebGLCanvas = (function () {
- var vertexShaderScript = Script.createFromSource("x-shader/x-vertex", text([
- "attribute vec3 aVertexPosition;",
- "attribute vec2 aTextureCoord;",
- "uniform mat4 uMVMatrix;",
- "uniform mat4 uPMatrix;",
- "varying highp vec2 vTextureCoord;",
- "void main(void) {",
- " gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);",
- " vTextureCoord = aTextureCoord;",
- "}"
- ]));
-
- var fragmentShaderScript = Script.createFromSource("x-shader/x-fragment", text([
- "precision highp float;",
- "varying highp vec2 vTextureCoord;",
- "uniform sampler2D FTexture;",
-
- "void main(void) {",
- " gl_FragColor = texture2D(FTexture, vTextureCoord);",
- "}"
- ]));
-
-
- function constructor(canvas, size, useFrameBuffer) {
- WebGLCanvas.call(this, canvas, size, useFrameBuffer);
- }
-
- constructor.prototype = inherit(WebGLCanvas, {
- onInitShaders: function() {
- this.program = new Program(this.gl);
- this.program.attach(new Shader(this.gl, vertexShaderScript));
- this.program.attach(new Shader(this.gl, fragmentShaderScript));
- this.program.link();
- this.program.use();
- this.vertexPositionAttribute = this.program.getAttributeLocation("aVertexPosition");
- this.gl.enableVertexAttribArray(this.vertexPositionAttribute);
- this.textureCoordAttribute = this.program.getAttributeLocation("aTextureCoord");
- this.gl.enableVertexAttribArray(this.textureCoordAttribute);
- },
- onInitTextures: function () {
- console.log("creatingTextures: size: " + this.size);
- this.FTexture = new Texture(this.gl, this.size, this.gl.RGB);
- },
- onInitSceneTextures: function () {
- this.FTexture.bind(0, this.program, "FTexture");
- },
- process: function(buffer, output) {
- this.FTexture.fill(buffer);
- this.drawScene();
- this.readPixels(output);
- },
- toString: function() {
- return "FilterWebGLCanvas Size: " + this.size;
- }
- });
-
- return constructor;
-})();
\ No newline at end of file
--- a/js/dist/h264bsd.min.js
+++ /dev/null
@@ -1,11 +1,0 @@
-function globalEval(x){eval.call(null,x)}function assert(condition,text){condition||abort("Assertion failed: "+text)}function ccall(ident,returnType,argTypes,args){return ccallFunc(getCFunc(ident),returnType,argTypes,args)}function getCFunc(ident){try{var func=Module["_"+ident];func||(func=eval("_"+ident))}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function ccallFunc(func,returnType,argTypes,args){function toC(value,type){if("string"==type){if(null===value||void 0===value||0===value)return 0;value=intArrayFromString(value),type="array"}if("array"==type){stack||(stack=Runtime.stackSave());var ret=Runtime.stackAlloc(value.length);return writeArrayToMemory(value,ret),ret}return value}function fromC(value,type){return"string"==type?Pointer_stringify(value):(assert("array"!=type),value)}var stack=0,i=0,cArgs=args?args.map(function(arg){return toC(arg,argTypes[i++])}):[],ret=fromC(func.apply(null,cArgs),returnType);return stack&&Runtime.stackRestore(stack),ret}function cwrap(ident,returnType,argTypes){var func=getCFunc(ident);return function(){return ccallFunc(func,returnType,argTypes,Array.prototype.slice.call(arguments))}}function setValue(ptr,value,type){switch(type=type||"i8","*"===type.charAt(type.length-1)&&(type="i32"),type){case"i1":HEAP8[ptr]=value;break;case"i8":HEAP8[ptr]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}function getValue(ptr,type){switch(type=type||"i8","*"===type.charAt(type.length-1)&&(type="i32"),type){case"i1":return HEAP8[ptr];case"i8":return HEAP8[ptr];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}function allocate(slab,types,allocator,ptr){var zeroinit,size;"number"==typeof slab?(zeroinit=!0,size=slab):(zeroinit=!1,size=slab.length);var ret,singleType="string"==typeof types?types:null;if(ret=allocator==ALLOC_NONE?ptr:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===allocator?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length)),zeroinit){var stop,ptr=ret;for(assert(0==(3&ret)),stop=ret+(-4&size);stop>ptr;ptr+=4)HEAP32[ptr>>2]=0;for(stop=ret+size;stop>ptr;)HEAP8[0|ptr++]=0;return ret}if("i8"===singleType)return slab.subarray||slab.slice?HEAPU8.set(slab,ret):HEAPU8.set(new Uint8Array(slab),ret),ret;for(var type,typeSize,previousType,i=0;size>i;){var curr=slab[i];"function"==typeof curr&&(curr=Runtime.getFunctionIndex(curr)),type=singleType||types[i],0!==type?("i64"==type&&(type="i32"),setValue(ret+i,curr,type),previousType!==type&&(typeSize=Runtime.getNativeTypeSize(type),previousType=type),i+=typeSize):i++}return ret}function Pointer_stringify(ptr,length){for(var t,hasUtf=!1,i=0;;){if(t=HEAPU8[ptr+i|0],t>=128)hasUtf=!0;else if(0==t&&!length)break;if(i++,length&&i==length)break}length||(length=i);var ret="";if(!hasUtf){for(var curr,MAX_CHUNK=1024;length>0;)curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK))),ret=ret?ret+curr:curr,ptr+=MAX_CHUNK,length-=MAX_CHUNK;return ret}var utf8=new Runtime.UTF8Processor;for(i=0;length>i;i++)t=HEAPU8[ptr+i|0],ret+=utf8.processCChar(t);return ret}function UTF16ToString(ptr){for(var i=0,str="";;){var codeUnit=HEAP16[ptr+2*i>>1];if(0==codeUnit)return str;++i,str+=String.fromCharCode(codeUnit)}}function stringToUTF16(str,outPtr){for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr+2*i>>1]=codeUnit}HEAP16[outPtr+2*str.length>>1]=0}function UTF32ToString(ptr){for(v
\ No newline at end of file
-var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0),Module._memset=_memset;var _llvm_memset_p0i8_i32=_memset;Module._memcpy=_memcpy;var _llvm_memcpy_p0i8_p0i8_i32=_memcpy,_llvm_memset_p0i8_i64=_memset,___errno_state=0,ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};Module._strlen=_strlen;var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not availabl
\ No newline at end of file
-if(err)throw err===ERRNO_CODES.EISDIR&&(err=ERRNO_CODES.EPERM),new FS.ErrnoError(err);if(!parent.node_ops.unlink)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isMountpoint(node))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);parent.node_ops.unlink(parent,name),FS.destroyNode(node)},readlink:function(path){var lookup=FS.lookupPath(path,{follow:!1}),link=lookup.node;if(!link.node_ops.readlink)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return link.node_ops.readlink(link)},stat:function(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow}),node=lookup.node;if(!node.node_ops.getattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return node.node_ops.getattr(node)},lstat:function(path){return FS.stat(path,!0)},chmod:function(path,mode,dontFollow){var node;if("string"==typeof path){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else node=path;if(!node.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);node.node_ops.setattr(node,{mode:4095&mode|-4096&node.mode,timestamp:Date.now()})},lchmod:function(path,mode){FS.chmod(path,mode,!0)},fchmod:function(fd,mode){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);FS.chmod(stream.node,mode)},chown:function(path,uid,gid,dontFollow){var node;if("string"==typeof path){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else node=path;if(!node.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);node.node_ops.setattr(node,{timestamp:Date.now()})},lchown:function(path,uid,gid){FS.chown(path,uid,gid,!0)},fchown:function(fd,uid,gid){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);FS.chown(stream.node,uid,gid)},truncate:function(path,len){if(0>len)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var node;if("string"==typeof path){var lookup=FS.lookupPath(path,{follow:!0});node=lookup.node}else node=path;if(!node.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isDir(node.mode))throw new FS.ErrnoError(ERRNO_CODES.EISDIR);if(!FS.isFile(node.mode))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var err=FS.nodePermissions(node,"w");if(err)throw new FS.ErrnoError(err);node.node_ops.setattr(node,{size:len,timestamp:Date.now()})},ftruncate:function(fd,len){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(0===(2097155&stream.flags))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);FS.truncate(stream.node,len)},utime:function(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:!0}),node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})},open:function(path,flags,mode,fd_start,fd_end){flags="string"==typeof flags?FS.modeStringToFlags(flags):flags,mode="undefined"==typeof mode?438:mode,mode=64&flags?4095&mode|32768:0;var node;if("object"==typeof path)node=path;else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(131072&flags)});node=lookup.node}catch(e){}}if(64&flags)if(node){if(128&flags)throw new FS.ErrnoError(ERRNO_CODES.EEXIST)}else node=FS.mknod(path,mode,0);if(!node)throw new FS.ErrnoError(ERRNO_CODES.ENOENT);FS.isChrdev(node.mode)&&(flags&=-513);var err=FS.mayOpen(node,flags);if(err)throw new FS.ErrnoError(err);512&flags&&FS.truncate(node,0),flags&=-641;var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:!0,position:0,stream_ops:node.stream_ops,ungotten:[],error:!1},fd_start,fd_end);return stream.stream_ops.open&&stream.stream_ops.open(stream),!Module.logReadFiles||1&flags||(FS.readFiles||(FS.readFiles={}),path in FS.readFiles||(FS.readFiles[path]=1,Module.printErr("read file: "+path))),stream},close:function(stream){try{stream.stream_ops.close&&stream.stream_ops.close(stream)}catch(e){throw e}finally{FS.closeStream(stream.fd)}},llseek:function(stream,offset,whence){if(!stream.seekable||!stream.stream_ops.llseek)throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);return stream.stream_ops.llseek(stream,offset,whence)},read:function(stream,buffer,offset,length,position){if(0>length||0>position)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if(1===(2097155&stream.fla
\ No newline at end of file
-x*=cw/rect.width,y*=ch/rect.height,Browser.mouseMovementX=x-Browser.mouseX,Browser.mouseMovementY=y-Browser.mouseY,Browser.mouseX=x,Browser.mouseY=y}},xhrLoad:function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,!0),xhr.responseType="arraybuffer",xhr.onload=function(){200==xhr.status||0==xhr.status&&xhr.response?onload(xhr.response):onerror()},xhr.onerror=onerror,xhr.send(null)},asyncLoad:function(url,onload,onerror,noRunDep){Browser.xhrLoad(url,function(arrayBuffer){assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).'),onload(new Uint8Array(arrayBuffer)),noRunDep||removeRunDependency("al "+url)},function(){if(!onerror)throw'Loading data file "'+url+'" failed.';onerror()}),noRunDep||addRunDependency("al "+url)},resizeListeners:[],updateResizeListeners:function(){var canvas=Module.canvas;Browser.resizeListeners.forEach(function(listener){listener(canvas.width,canvas.height)})},setCanvasSize:function(width,height,noUpdates){var canvas=Module.canvas;canvas.width=width,canvas.height=height,noUpdates||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){var canvas=Module.canvas;if(this.windowedWidth=canvas.width,this.windowedHeight=canvas.height,canvas.width=screen.width,canvas.height=screen.height,"undefined"!=typeof SDL){var flags=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];flags=8388608|flags,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=flags}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){var canvas=Module.canvas;if(canvas.width=this.windowedWidth,canvas.height=this.windowedHeight,"undefined"!=typeof SDL){var flags=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];flags=-8388609&flags,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=flags}Browser.updateResizeListeners()}};if(___errno_state=Runtime.staticAlloc(4),HEAP32[___errno_state>>2]=0,Module.requestFullScreen=function(lockPointer,resizeCanvas){Browser.requestFullScreen(lockPointer,resizeCanvas)},Module.requestAnimationFrame=function(func){Browser.requestAnimationFrame(func)},Module.setCanvasSize=function(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},FS.staticInit(),__ATINIT__.unshift({func:function(){Module.noFSInit||FS.init.initialized||FS.init()}}),__ATMAIN__.push({func:function(){FS.ignorePermissions=!1}}),__ATEXIT__.push({func:function(){FS.quit()}}),Module.FS_createFolder=FS.createFolder,Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createLink=FS.createLink,Module.FS_createDevice=FS.createDevice,__ATINIT__.unshift({func:function(){TTY.init()}}),__ATEXIT__.push({func:function(){TTY.shutdown()}}),TTY.utf8=new Runtime.UTF8Processor,ENVIRONMENT_IS_NODE){var fs=require("fs");NODEFS.staticInit()}STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+5242880,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(TOTAL_MEMORY>DYNAMIC_BASE,"TOTAL_MEMORY not big enough for stack");var Math_min=Math.min,asm=function(global,env,buffer){"use asm";function ax(a){a|=0;var b=0;return b=i,i=i+a|0,i=i+7&-8,b|0}function ay(){return i|0}function az(a){a|=0,i=a}function aA(a,b){a|=0,b|=0,(o|0)==0&&(o=a,p=b)}function aD(a){a|=0,B=a}function aE(a){a|=0,C=a}function aF(a){a|=0,D=a}function aG(a){a|=0,E=a}function aH(a){a|=0,F=a}function aI(a){a|=0,G=a}function aJ(a){a|=0,H=a}function aK(a){a|=0,I=a}function aL(a){a|=0,J=a}function aM(a){a|=0,K=a}function aN(){}function aO(b,e,f,g){b|=0,e|=0,f|=0,g|=0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;L1:do{if(e>>>0>3){if((a[b]|0)!=0){h=19;break}if((a[b+1|0]|0)!=0){h=19;break}if(i=a[b+2|0]|0,(i&255)>>>0>=2){h=19;break}L6:do if((e|0)!=3){for(j=2,k=b+3|0,l=3,m=-3,n=i;;){if((n<<24>>24|0)==0)o=j+1|
\ No newline at end of file
-break}cl=ci-cj|0,ck=((cl|0)<0?-cl|0:cl)>>>0>3|0}else ck=2;while(0);c[z>>2]=ck,cj=aq+50|0,ci=aq+176|0,bB=b[ci>>1]|0,a4=b[b2>>1]|0,cl=aq+178|0,cm=b[cl>>1]|0,cn=b[b5>>1]|0;do if((b[cj>>1]|0)==0){if((b[b3>>1]|0)!=0){co=2;break}if(cp=bB-a4|0,((cp|0)<0?-cp|0:cp)>>>0>3){co=1;break}cp=cm-cn|0,co=((cp|0)<0?-cp|0:cp)>>>0>3|0}else co=2;while(0);c[y>>2]=co,cn=aq+56|0,cm=aq+188|0,a4=b[cm>>1]|0,bB=b[b6>>1]|0,cp=aq+190|0,cq=b[cp>>1]|0,cr=b[b9>>1]|0;do if((b[cn>>1]|0)==0){if((b[b7>>1]|0)!=0){cs=2;break}if(ct=a4-bB|0,((ct|0)<0?-ct|0:ct)>>>0>3){cs=1;break}ct=cq-cr|0,cs=((ct|0)<0?-ct|0:ct)>>>0>3|0}else cs=2;while(0);c[x>>2]=cs,cr=aq+58|0,cq=aq+192|0,bB=b[cq>>1]|0,a4=b[ca>>1]|0,ct=aq+194|0,cu=b[ct>>1]|0,cv=b[cd>>1]|0;do if((b[cr>>1]|0)==0){if((b[cb>>1]|0)!=0){cw=2;break}if(cx=bB-a4|0,((cx|0)<0?-cx|0:cx)>>>0>3){cw=1;break}cx=cu-cv|0,cw=((cx|0)<0?-cx|0:cx)>>>0>3|0}else cw=2;while(0);c[w>>2]=cw,cv=aq+30|0,cu=b[aS>>1]|0,a4=b[aM>>1]|0,bB=b[ba>>1]|0,cx=b[bV>>1]|0;do if((b[cv>>1]|0)==0){if((b[aq+28>>1]|0)!=0){cy=2;break}if(cz=cu-a4|0,((cz|0)<0?-cz|0:cz)>>>0>3){cy=1;break}cz=bB-cx|0,cy=((cz|0)<0?-cz|0:cz)>>>0>3|0}else cy=2;while(0);c[T>>2]=cy,cx=aq+36|0,bB=b[bG>>1]|0,a4=b[aS>>1]|0,cu=b[a_>>1]|0,bV=b[ba>>1]|0;do if((b[cx>>1]|0)==0){if((b[cv>>1]|0)!=0){cA=2;break}if(aM=bB-a4|0,((aM|0)<0?-aM|0:aM)>>>0>3){cA=1;break}if(aM=cu-bV|0,((aM|0)<0?-aM|0:aM)>>>0>3){cA=1;break}cA=(c[aq+120>>2]|0)!=(c[aq+116>>2]|0)|0}else cA=2;while(0);c[S>>2]=cA,bV=b[a2>>1]|0,cu=b[bG>>1]|0,a4=b[bY>>1]|0,bB=b[a_>>1]|0;do if((b[aq+38>>1]|0)==0){if((b[cx>>1]|0)!=0){cB=2;break}if(cv=bV-cu|0,((cv|0)<0?-cv|0:cv)>>>0>3){cB=1;break}cv=a4-bB|0,cB=((cv|0)<0?-cv|0:cv)>>>0>3|0}else cB=2;while(0);c[R>>2]=cB,bB=b[bU>>1]|0,a4=b[bE>>1]|0,cu=b[aO>>1]|0,bV=b[bT>>1]|0;do if((b[bW>>1]|0)==0){if((b[be>>1]|0)!=0){cC=2;break}if(cx=bB-a4|0,((cx|0)<0?-cx|0:cx)>>>0>3){cC=1;break}cx=cu-bV|0,cC=((cx|0)<0?-cx|0:cx)>>>0>3|0}else cC=2;while(0);c[Q>>2]=cC,bV=b[a0>>1]|0,cu=b[bU>>1]|0,a4=b[aL>>1]|0,bB=b[aO>>1]|0;do if((b[aH>>1]|0)==0){if((b[bW>>1]|0)!=0){cD=2;break}if(be=bV-cu|0,((be|0)<0?-be|0:be)>>>0>3){cD=1;break}if(be=a4-bB|0,((be|0)<0?-be|0:be)>>>0>3){cD=1;break}cD=(c[aq+120>>2]|0)!=(c[aq+116>>2]|0)|0}else cD=2;while(0);c[P>>2]=cD,bB=b[aQ>>1]|0,a4=b[a0>>1]|0,cu=b[a6>>1]|0,bV=b[aL>>1]|0;do if((b[a8>>1]|0)==0){if((b[aH>>1]|0)!=0){cE=2;break}if(bW=bB-a4|0,((bW|0)<0?-bW|0:bW)>>>0>3){cE=1;break}bW=cu-bV|0,cE=((bW|0)<0?-bW|0:bW)>>>0>3|0}else cE=2;while(0);c[O>>2]=cE,bV=b[b2>>1]|0,cu=b[bc>>1]|0,a4=b[b5>>1]|0,bB=b[b1>>1]|0;do if((b[b3>>1]|0)==0){if((b[b$>>1]|0)!=0){cF=2;break}if(aH=bV-cu|0,((aH|0)<0?-aH|0:aH)>>>0>3){cF=1;break}aH=a4-bB|0,cF=((aH|0)<0?-aH|0:aH)>>>0>3|0}else cF=2;while(0);c[N>>2]=cF,bB=b[b6>>1]|0,a4=b[b2>>1]|0,cu=b[b9>>1]|0,bV=b[b5>>1]|0;do if((b[b7>>1]|0)==0){if((b[b3>>1]|0)!=0){cG=2;break}if(b$=bB-a4|0,((b$|0)<0?-b$|0:b$)>>>0>3){cG=1;break}if(b$=cu-bV|0,((b$|0)<0?-b$|0:b$)>>>0>3){cG=1;break}cG=(c[aq+128>>2]|0)!=(c[aq+124>>2]|0)|0}else cG=2;while(0);c[M>>2]=cG,bV=b[ca>>1]|0,cu=b[b6>>1]|0,a4=b[cd>>1]|0,bB=b[b9>>1]|0;do if((b[cb>>1]|0)==0){if((b[b7>>1]|0)!=0){cH=2;break}if(b3=bV-cu|0,((b3|0)<0?-b3|0:b3)>>>0>3){cH=1;break}b3=a4-bB|0,cH=((b3|0)<0?-b3|0:b3)>>>0>3|0}else cH=2;while(0);c[L>>2]=cH,bB=b[ci>>1]|0,a4=b[ce>>1]|0,cu=b[cl>>1]|0,bV=b[ch>>1]|0;do if((b[cj>>1]|0)==0){if((b[cf>>1]|0)!=0){cI=2;break}if(b7=bB-a4|0,((b7|0)<0?-b7|0:b7)>>>0>3){cI=1;break}b7=cu-bV|0,cI=((b7|0)<0?-b7|0:b7)>>>0>3|0}else cI=2;while(0);c[K>>2]=cI,bV=b[cm>>1]|0,cu=b[ci>>1]|0,a4=b[cp>>1]|0,bB=b[cl>>1]|0;do if((b[cn>>1]|0)==0){if((b[cj>>1]|0)!=0){cJ=2;break}if(cf=bV-cu|0,((cf|0)<0?-cf|0:cf)>>>0>3){cJ=1;break}if(cf=a4-bB|0,((cf|0)<0?-cf|0:cf)>>>0>3){cJ=1;break}cJ=(c[aq+128>>2]|0)!=(c[aq+124>>2]|0)|0}else cJ=2;while(0);c[J>>2]=cJ,bB=b[cq>>1]|0,a4=b[cm>>1]|0,cu=b[ct>>1]|0,bV=b[cp>>1]|0;do if((b[cr>>1]|0)==0){if((b[cn>>1]|0)!=0){cK=2;break}if(cj=bB-a4|0,((cj|0)<0?-cj|0:cj)>>>0>3){cK=1;break}cj=cu-bV|0,cK=((cj|0)<0?-cj|0:cj)>>>0>3|0}else cK=2;while(0);c[I>>2]=cK;break}aU(aq,e)}while(0);if((aE|0)!=0)break;if((c[H>>2]|0)!=0)break;if((c[G>>2]|0)!=0)break;if((c[F>>2]|0)!=0)break;if((c[E>>2]|0)!=0)break;if((c[D>>2]|0)!=0)break;if((c[C>>2]
\ No newline at end of file
-}if((c[a+(s*40|0)+8>>2]|0)<=(j|0)){t=r;break L8}}if(cG(a+(r*40|0)|0,a+(s*40|0)|0,40)|0,s>>>0<g>>>0){p=s,q=14;break L6}r=s}for(;;){if(r=u-g|0,s=c[a+(r*40|0)+20>>2]|0,(s|0)!=0&(s-1|0)>>>0<2){if(s=c[a+(r*40|0)+8>>2]|0,(s|0)>(j|0)){t=u;break L8}if(v=a+(u*40|0)|0,!((s|0)<(j|0))){x=v;break L6}w=v}else w=a+(u*40|0)|0;if(cG(w|0,a+(r*40|0)|0,40)|0,r>>>0<g>>>0){p=r,q=14;break L6}u=r}}while(0);x=a+(t*40|0)|0}while(0);(q|0)==14&&(q=0,x=a+(p*40|0)|0),o=x,c[o>>2]=k,c[o+4>>2]=l,c[x+8>>2]=j,o=x+12|0,r=c[e+4>>2]|0,c[o>>2]=c[e>>2],c[o+4>>2]=r,c[x+20>>2]=n,c[x+24>>2]=m,r=x+28|0,c[r>>2]=c[f>>2],c[r+4>>2]=c[f+4>>2],c[r+8>>2]=c[f+8>>2],h=h+1|0}while(h>>>0<b>>>0)}g>>>=1}while((g|0)!=0);i=d}function bb(a,b){a|=0,b|=0;var d=0,e=0;do if(b>>>0>16)d=0;else{if(e=c[(c[a+4>>2]|0)+(b<<2)>>2]|0,(e|0)==0){d=0;break}if((c[e+20>>2]|0)>>>0<=1){d=0;break}d=c[e>>2]|0}while(0);return d|0}function bc(a){a|=0;var b=0;return b=(c[a>>2]|0)+((c[a+28>>2]|0)*40|0)|0,c[a+8>>2]=b,c[b>>2]|0}function bd(a,b,d,e,f,g){a|=0,b|=0,d|=0,e|=0,f|=0,g|=0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if(c[a+36>>2]=65535,h=e>>>0>1?e:1,c[a+24>>2]=h,e=a+28|0,i=(g|0)==0?d:h,c[e>>2]=i,c[a+32>>2]=f,c[a+56>>2]=g,c[a+44>>2]=0,c[a+40>>2]=0,c[a+48>>2]=0,g=cD(680)|0,f=g,h=a|0,c[h>>2]=f,(g|0)==0)return j=65535,j|0;cF(g|0,0,680)|0;do if((i|0)==-1)k=0;else{for(g=b*384|0|47,d=0,l=f;;){if(c[l+(d*40|0)+4>>2]=cD(g)|0,m=c[h>>2]|0,n=c[m+(d*40|0)+4>>2]|0,(n|0)==0){j=65535,o=11;break}if(c[m+(d*40|0)>>2]=n+(-n&15),n=d+1|0,p=c[e>>2]|0,n>>>0>=(p+1|0)>>>0){o=7;break}d=n,l=c[h>>2]|0}if((o|0)==11)return j|0;if((o|0)==7){k=(p<<4)+16|0;break}}while(0);return p=cD(68)|0,c[a+4>>2]=p,o=cD(k)|0,c[a+12>>2]=o,(p|0)==0|(o|0)==0?(j=65535,j|0):(cF(p|0,0,68)|0,c[a+20>>2]=0,c[a+16>>2]=0,j=0,j|0)}function be(a,b,d,e,f,g){a|=0,b|=0,d|=0,e|=0,f|=0,g|=0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;h=a|0,i=c[h>>2]|0;do if((i|0)==0)j=0;else{if(k=a+28|0,(c[k>>2]|0)==-1){j=i;break}for(l=0,m=i;;){if(cE(c[m+(l*40|0)+4>>2]|0),c[(c[h>>2]|0)+(l*40|0)+4>>2]=0,n=l+1|0,o=c[h>>2]|0,!(n>>>0<((c[k>>2]|0)+1|0)>>>0)){j=o;break}l=n,m=o}}while(0);return cE(j),c[h>>2]=0,h=a+4|0,cE(c[h>>2]|0),c[h>>2]=0,h=a+12|0,cE(c[h>>2]|0),c[h>>2]=0,bd(a,b,d,e,f,g)|0}function bf(a){a|=0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=a|0,d=c[b>>2]|0;do if((d|0)==0)e=0;else{if(f=a+28|0,(c[f>>2]|0)==-1){e=d;break}for(g=0,h=d;;){if(cE(c[h+(g*40|0)+4>>2]|0),c[(c[b>>2]|0)+(g*40|0)+4>>2]=0,i=g+1|0,j=c[b>>2]|0,!(i>>>0<((c[f>>2]|0)+1|0)>>>0)){e=j;break}g=i,h=j}}while(0);cE(e),c[b>>2]=0,b=a+4|0,cE(c[b>>2]|0),c[b>>2]=0,b=a+12|0,cE(c[b>>2]|0),c[b>>2]=0}function bg(a){a|=0;var b=0,d=0,e=0;if(b=a+40|0,(c[b>>2]|0)!=0){d=a|0,e=a+4|0,a=0;do c[(c[e>>2]|0)+(a<<2)>>2]=(c[d>>2]|0)+(a*40|0),a=a+1|0;while(a>>>0<(c[b>>2]|0)>>>0)}}function bh(a,b,d,e){a|=0,b|=0,d|=0,e|=0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0;if(f=a+16|0,c[f>>2]=0,c[a+20>>2]=0,(e|0)==0)return g=0,g|0;e=a+48|0,h=c[e>>2]|0,i=(h|0)==(b|0);L4:do if(i)j=37;else{if(k=a+32|0,l=((h+1|0)>>>0)%((c[k>>2]|0)>>>0)|0,(l|0)==(b|0)){j=37;break}m=a+28|0,n=a|0,o=c[(c[n>>2]|0)+((c[m>>2]|0)*40|0)>>2]|0,p=a+40|0,q=a+24|0,r=a+44|0,s=a+56|0,t=a+12|0,u=l;L7:for(;;){if(l=c[p>>2]|0,(l|0)==0)v=0;else for(w=0,x=l;;){if(l=c[n>>2]|0,((c[l+(w*40|0)+20>>2]|0)-1|0)>>>0<2?(y=c[l+(w*40|0)+12>>2]|0,z=y>>>0>u>>>0?y-(c[k>>2]|0)|0:y,c[l+(w*40|0)+8>>2]=z,A=c[p>>2]|0):A=x,l=w+1|0,!(l>>>0<A>>>0)){v=A;break}w=l,x=A}do if(v>>>0>=(c[q>>2]|0)>>>0){if((v|0)==0){g=1,j=51;break L7}for(x=c[n>>2]|0,w=-1,l=0,y=0;;){if(((c[x+(y*40|0)+20>>2]|0)-1|0)>>>0<2?(B=c[x+(y*40|0)+8>>2]|0,C=(B|0)<(l|0)|(w|0)==-1,D=C?B:l,E=C?y:w):(D=l,E=w),C=y+1|0,!(C>>>0<v>>>0))break;w=E,l=D,y=C}if((E|0)<=-1){g=1,j=50;break L7}if(c[x+(E*40|0)+20>>2]=0,c[p>>2]=(c[p>>2]|0)-1,(c[(c[n>>2]|0)+(E*40|0)+24>>2]|0)!=0)break;c[r>>2]=(c[r>>2]|0)-1}while(0);if(y=c[r>>2]|0,l=c[m>>2]|0,y>>>0<l>>>0)F=l;else for(w=l,l=y;;){do if((c[s>>2]|0)==0){for(y=c[n>>2]|0,C=0,B=2147483647,G=0;;){if((c[y+(C*40|0)+24>>2]|0)==0?(H=G,I=B):(J=c[y+(C*40|0)+16>>2]|0,K=(J|0)<(B|0),H=K?y+(C*40|0)|0:G,I=K?J:B),J=C+1|0,J>>>0>w>>>0)brea
\ No newline at end of file
-}function bq(b,e,f,g,h,i){b|=0,e|=0,f|=0,g|=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)|0),l=a[z]|0,D=a[A]|0,E=a[B]|0,F=a[C]|0;do{if((51>>>(i>>>0)&1|0)==0){if(G=o-1|0,H=(G<<4)+p|0,I=a[e+H|0]|0,J=a[e+(H+1)|0]|0,K=a[e+(H+2)|0]|0,L=a[e+(H+3)|0]|0,M=a[e+(H+4)|0]|0,N=a[e+(H+5)|0]|0,O=a[e+(H+6)|0]|0,P=a[e+(H+7)|0]|0,m){Q=h+G|0,R=I,S=J,T=K,U=L,V=M,W=N,X=O,Y=P;break}Q=e+(H-1)|0,R=I,S=J,T=K,U=L,V=M,W=N,X=O,Y=P;break}Q=g+p|0,R=a[g+(p+1)|0]|0,S=a[g+(p+2)|0]|0,T=a[g+(p+3)|0]|0,U=a[g+(p+4)|0]|0,V=a[g+(p+5)|0]|0,W=a[g+(p+6)|0]|0,X=a[g+(p+7)|0]|0,Y=a[g+(p+8)|0]|0}while(0);switch(m=a[Q]|0,w|0){case 0:if(r){_=1,$=52;break L1}P=(T&255)<<16|(U&255)<<24|(S&255)<<8|R&255,aa=P,ab=P,ac=P,ad=P;break;case 1:if(!k){_=1,$=53;break L1}aa=Z(l&255,16843009)|0,ab=Z(D&255,16843009)|0,ac=Z(E&255,16843009)|0,ad=Z(F&255,16843009)|0;break;case 2:do if(s){if(k){ae=((l&255)+2+(D&255)+(E&255)+(F&255)|0)>>>2&255;break}if(r){ae=-128;break}ae=((U&255)+2+(T&255)+(S&255)+(R&255)|0)>>>2&255}else ae=((l&255)+4+(D&255)+(E&255)+(F&255)+(U&255)+(T&255)+(S&255)+(R&255)|0)>>>3&255;while(0);P=Z(ae&255,16843009)|0,aa=P,ab=P,ac=P,ad=P;break;case 3:if(r){_=1,$=54;break L1}P=(x|0)==0,O=S&255,N=T&255,M=N+2|0,L=U&255,K=L+2|0,J=(K+O+(N<<1)|0)>>>2&255,N=(P?U:V)&255,I=(M+(L<<1)+N|0)>>>2&255,L=(P?U:W)&255,H=(K+L+(N<<1)|0)>>>2,K=H&255,G=(P?U:X)&255,af=(N+2+G+(L<<1)|0)>>>2,N=af&255,ag=(P?U:Y)&255,P=(L+2+ag+(G<<1)|0)>>>2,aa=J<<8|H<<24|(M+(R&255)+(O<<1)|0)>>>2&255|I<<16,ab=K<<16|J|af<<24|I<<8,ac=I|K<<8|P<<24|N<<16,ad=(G+2+(ag*3|0)|0)>>>2<<24|K|N<<8|P<<16&16711680;break;case 4:if(s|(y|0)==0){_=1,$=55;break L1}P=R&255,N=m&255,K=l&255,ag=P+2|0,G=(ag+K+(N<<1)|0)>>>2,I=G&255,af=S&255,J=N+2|0,N=((P<<1)+af+J|0)>>>2,P=N&255,O=T&255,M=((af<<1)+O+ag|0)>>>2,ag=D&255,H=(ag+(K<<1)+J|0)>>>2&255,J=E&255,L=(K+2+(ag<<1)+J|0)>>>2&255,aa=M<<16&16711680|((U&255)+2+af+(O<<1)|0)>>>2<<24|I|P<<8,ab=H|M<<24|P<<16|I<<8,ac=N<<24|L|I<<16|H<<8,ad=(ag+2+(J<<1)+(F&255)|0)>>>2&255|L<<8|G<<24|H<<16;break;case 5:if(s|(y|0)==0){_=1,$=56;break L1}H=m&255,G=R&255,L=(G+1+H|0)>>>1&255,J=S&255,ag=(J+2+(G<<1)+H|0)>>>2&255,I=l&255,N=G+2|0,P=(N+I+(H<<1)|0)>>>2&255,M=(J+1+G|0)>>>1&255,G=T&255,O=((J<<1)+G+N|0)>>>2,N=(G+1+J|0)>>>1,af=U&255,K=D&255,aa=N<<16&16711680|(af+1+G|0)>>>1<<24|M<<8|L,ab=O<<16&16711680|(af+2+J+(G<<1)|0)>>>2<<24|P|ag<<8,ac=M<<16|N<<24|(K+2+(I<<1)+H|0)>>>2&255|L<<8,ad=O<<24|(I+2+(E&255)+(K<<1)|0)>>>2&255|ag<<16|P<<8;break;case 6:if(s|(y|0)==0){_=1,$=57;break L1}P=m&255,ag=l&255,K=ag+1|0,I=(K+P|0)>>>1&255,O=D&255,L=((ag<<1)+2+O+P|0)>>>2,H=(K+O|0)>>>1&255,K=E&255,N=ag+2|0,ag=(N+(O<<1)+K|0)>>>2,M=(O+1+K|0)>>>1&255,G=F&255,J=R&255,af=(N+J+(P<<1)|0)>>>2,N=S&255,aa=I|((T&255)+2+(N<<1)+J|0)>>>2<<24|(N+2+(J<<1)+P|0)>>>2<<16&16711680|af<<8&65280,ab=L<<8&65280|H|I<<16|af<<24,ac=M|H<<16|ag<<8&65280|L<<24,ad=ag<<24|M<<16|(K+1+G|0)>>>1&255|(O+2+(K<<1)+G|0)>>>2<<8&65280;break;case 7:if(r){_=1,$=58;break L1}G=(x|0)==0,K=R&255,O=S&255,M=T&255,ag=(M+1+O|0)>>>1&255,L=U&255,H=L+1|0,af=(H+M|0)>>>1&255,I=(G?U:V)&255,P=(H+I|0)>>>1,H=M+2|0,J=L+2|0,N=(J+O+(M<<1)|0)>>>2&255,M=(H+(L<<1)+I|0)>>>2&255,L=(G?U:W)&255,ah=(J+L+(I<<1)|0
\ No newline at end of file
-do if((e|0)<0)n=4;else{if((e+5+j|0)>>>0>g>>>0|(f|0)<0){n=4;break}(k+f|0)>>>0>h>>>0?n=4:(o=b,p=e,q=f,r=g)}while(0);if((n|0)==4&&(n=m,m=j+5|0,bM(b,n,e,f,g,h,m,k,m),o=n,p=0,q=0,r=m),(k|0)==0)return void(i=l);for(m=j>>>2,n=(m|0)==0,h=r-j|0,g=16-j|0,j=m<<2,f=o+(p+5+(Z(q,r)|0))|0,r=k,k=c;;){if(n)s=f,t=k;else{for(c=k+j|0,q=f,p=m,o=d[f-1|0]|0,e=d[f-2|0]|0,b=d[f-3|0]|0,u=d[f-4|0]|0,v=d[f-5|0]|0,w=k;;){if(x=u+o|0,y=d[q]|0,a[w]=a[(v+16-x-(x<<2)+y+((b+e|0)*20|0)>>5)+1808|0]|0,x=y+b|0,z=d[q+1|0]|0,a[w+1|0]=a[(u+16-x-(x<<2)+z+((e+o|0)*20|0)>>5)+1808|0]|0,x=z+e|0,A=d[q+2|0]|0,a[w+2|0]=a[(b+16-x-(x<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i=i+1792|0,n=m|0,o=m+448|0;do if((f|0)<0)p=5;else{if((f+5+k|0)>>>0>h>>>0|(g|0)<0){p=5;break}if((g+5+l|0)>>>0>j>>>0){p=5;break}q=b,r=f+5|0,s=g,t=h,
\ No newline at end of file
-if((c[(c[m>>2]|0)+(n<<2)>>2]|0)>>>0>k>>>0){g=1;break}n=n+1|0}return g|0}if((l|0)!=2){if((l-3|0)>>>0<3){if(!((c[f+36>>2]|0)>>>0>k>>>0))break;return g=1,g|0}if((l|0)!=6)break;if(!((c[f+40>>2]|0)>>>0<k>>>0))break;return g=1,g|0}for(n=i-1|0,m=f+24|0,o=f+28|0,p=0;;){if(p>>>0>=n>>>0)break L7;if(q=c[(c[m>>2]|0)+(p<<2)>>2]|0,r=c[(c[o>>2]|0)+(p<<2)>>2]|0,!(q>>>0<=r>>>0&r>>>0<k>>>0)){g=1,s=39;break}if(((q>>>0)%(j>>>0)|0)>>>0>((r>>>0)%(j>>>0)|0)>>>0){g=1,s=38;break}p=p+1|0}if((s|0)==38)return g|0;if((s|0)==39)return g|0}while(0);k=a+4|0,f=c[k>>2]|0;do{if((f|0)!=256){if(i=a+3380|0,(c[i>>2]|0)==0){if((f|0)==(b|0))break;if(j=a+8|0,(h|0)==(c[j>>2]|0)){c[k>>2]=b,c[a+12>>2]=c[e>>2];break}if((d|0)==0)return g=1,g|0;c[k>>2]=b,s=c[e>>2]|0,c[a+12>>2]=s,p=c[s+4>>2]|0,c[j>>2]=p,j=c[a+20+(p<<2)>>2]|0,c[a+16>>2]=j,p=j+52|0,s=j+56|0,c[a+1176>>2]=Z(c[s>>2]|0,c[p>>2]|0)|0,c[a+1340>>2]=c[p>>2],c[a+1344>>2]=c[s>>2],c[i>>2]=1;break}if(c[i>>2]=0,i=a+1212|0,cE(c[i>>2]|0),c[i>>2]=0,s=a+1172|0,cE(c[s>>2]|0),p=c[a+1176>>2]|0,j=p*216|0,o=cD(j)|0,m=o,c[i>>2]=m,i=cD(p<<2)|0,c[s>>2]=i,(o|0)==0|(i|0)==0)return g=65535,g|0;cF(o|0,0,j|0)|0,j=a+16|0,bC(m,c[(c[j>>2]|0)+52>>2]|0,p),p=c[j>>2]|0;L47:do if((c[a+1216>>2]|0)==0){if((c[p+16>>2]|0)==2){t=1;break}do if((c[p+80>>2]|0)!=0){if(j=c[p+84>>2]|0,(c[j+920>>2]|0)==0)break;if((c[j+944>>2]|0)==0){t=1;break L47}}while(0);t=0}else t=1;while(0);if(l=Z(c[p+56>>2]|0,c[p+52>>2]|0)|0,j=be(a+1220|0,l,c[p+88>>2]|0,c[p+44>>2]|0,c[p+12>>2]|0,t)|0,(j|0)==0)break;return g=j,g|0}c[k>>2]=b,s=c[e>>2]|0,c[a+12>>2]=s,j=c[s+4>>2]|0,c[a+8>>2]=j,s=c[a+20+(j<<2)>>2]|0,c[a+16>>2]=s,j=s+52|0,i=s+56|0,c[a+1176>>2]=Z(c[i>>2]|0,c[j>>2]|0)|0,c[a+1340>>2]=c[j>>2],c[a+1344>>2]=c[i>>2],c[a+3380>>2]=1}while(0);return g=0,g|0}function cf(a){a|=0;var b=0,d=0;if(c[a+1196>>2]=0,c[a+1192>>2]=0,b=a+1176|0,(c[b>>2]|0)!=0){d=a+1212|0,a=0;do c[(c[d>>2]|0)+(a*216|0)+4>>2]=0,c[(c[d>>2]|0)+(a*216|0)+196>>2]=0,a=a+1|0;while(a>>>0<(c[b>>2]|0)>>>0)}}function cg(a){return a|=0,(c[a+1188>>2]|0)==0|0}function ch(a){a|=0;var b=0,d=0,e=0,f=0,g=0;do{if((c[a+1404>>2]|0)==0){if((c[a+1196>>2]|0)!=(c[a+1176>>2]|0))break;return b=1,b|0}if(d=c[a+1176>>2]|0,(d|0)==0)return b=1,b|0;e=c[a+1212>>2]|0,f=0,g=0;do g=((c[e+(f*216|0)+196>>2]|0)!=0)+g|0,f=f+1|0;while(f>>>0<d>>>0);if((g|0)!=(d|0))break;return b=1,b|0}while(0);return b=0,b|0}function ci(a,b){a|=0,b|=0;var d=0;d=c[a+16>>2]|0,b2(c[a+1172>>2]|0,c[a+12>>2]|0,b,c[d+52>>2]|0,c[d+56>>2]|0)}function cj(a,b,d,e){a|=0,b|=0,d|=0,e|=0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;if(f=i,i=i+48|0,g=f|0,h=f+8|0,j=f+16|0,k=f+24|0,l=f+32|0,m=f+40|0,c[e>>2]=0,n=b|0,o=c[n>>2]|0,(o-6|0)>>>0<6|(o-13|0)>>>0<6)return c[e>>2]=1,p=0,i=f,p|0;if(!((o|0)==1|(o|0)==5))return p=0,i=f,p|0;if(o=d+1300|0,q=d+1332|0,(c[q>>2]|0)!=0&&(c[e>>2]=1,c[q>>2]=0),q=b4(a,g)|0,(q|0)!=0)return p=q,i=f,p|0;if(q=c[d+148+(c[g>>2]<<2)>>2]|0,(q|0)==0)return p=65520,i=f,p|0;if(g=c[q+4>>2]|0,r=c[d+20+(g<<2)>>2]|0,(r|0)==0)return p=65520,i=f,p|0;s=c[d+8>>2]|0;do if(!((s|0)==32|(g|0)==(s|0))){if((c[n>>2]|0)==5)break;return p=65520,i=f,p|0}while(0);s=c[d+1304>>2]|0,g=c[b+4>>2]|0;do if((s|0)!=(g|0)){if(!((s|0)==0|(g|0)==0))break;c[e>>2]=1}while(0);if(g=o|0,s=(c[n>>2]|0)==5,(c[g>>2]|0)==5?s||(t=17):s&&(t=17),(t|0)==17&&(c[e>>2]=1),t=r+12|0,(b5(a,c[t>>2]|0,h)|0)!=0)return p=1,i=f,p|0;if(s=d+1308|0,u=c[h>>2]|0,(c[s>>2]|0)!=(u|0)&&(c[s>>2]=u,c[e>>2]=1),(c[n>>2]|0)==5){if((b6(a,c[t>>2]|0,5,j)|0)!=0)return p=1,i=f,p|0;do if((c[g>>2]|0)==5){if(t=d+1312|0,u=c[t>>2]|0,s=c[j>>2]|0,(u|0)==(s|0)){v=u,w=t;break}c[e>>2]=1,v=s,w=t}else v=c[j>>2]|0,w=d+1312|0;while(0);c[w>>2]=v}v=c[r+16>>2]|0;do if((v|0)==0){if((b7(a,r,c[n>>2]|0,k)|0)!=0)return p=1,i=f,p|0;if(w=d+1316|0,j=c[k>>2]|0,(c[w>>2]|0)!=(j|0)&&(c[w>>2]=j,c[e>>2]=1),(c[q+8>>2]|0)==0)break;if(j=b8(a,r,c[n>>2]|0,l)|0,(j|0)!=0)return p=j,i=f,p|0;if(j=d+1320|0,w=c[l>>2]|0,(c[j>>2]|0)==(w|0))break;c[j>>2]=w,c[e>>2]=1}else if((v|0)==1){if((c[r+24>>2]|0)!=0)break;if(w=q+8|0,j=m|0,g=b9(a,r,c[n>>2]|0,c[w>>2]|0,j)|0,(g|0)!=0)return p=g,i=f,p|0;if(g=d+1324|0,t=c[j>>2]|0,(c[g>>2]|0)!=(t|0)&&(c[g>>2]=t,c[e>>2]=1),(c[w>>2]
\ No newline at end of file
-}while(0);if(m=7464+(aJ<<2)|0,c[ad+28>>2]=aJ,c[ad+20>>2]=0,c[ad+16>>2]=0,Z=c[1791]|0,Q=1<<aJ,(Z&Q|0)==0){c[1791]=Z|Q,c[m>>2]=K,c[ad+24>>2]=m,c[ad+12>>2]=ad,c[ad+8>>2]=ad;break}for(aK=(aJ|0)==31?0:25-(aJ>>>1)|0,Q=_<<aK,Z=c[m>>2]|0;;){if((c[Z+4>>2]&-8|0)==(_|0))break;if(aL=Z+16+(Q>>>31<<2)|0,m=c[aL>>2]|0,(m|0)==0){T=331;break}Q<<=1,Z=m}if((T|0)==331){if(aL>>>0<(c[1794]|0)>>>0)return ao(),0;c[aL>>2]=K,c[ad+24>>2]=Z,c[ad+12>>2]=ad,c[ad+8>>2]=ad;break}if(Q=Z+8|0,_=c[Q>>2]|0,m=c[1794]|0,Z>>>0<m>>>0)return ao(),0;if(_>>>0<m>>>0)return ao(),0;c[_+12>>2]=K,c[Q>>2]=K,c[ad+8>>2]=_,c[ad+12>>2]=Z,c[ad+24>>2]=0;break}S=c[1794]|0,(S|0)==0|ab>>>0<S>>>0&&(c[1794]=ab),c[1902]=ab,c[1903]=aa,c[1905]=0,c[1799]=c[1784],c[1798]=-1,S=0;do Y=S<<1,ac=7200+(Y<<2)|0,c[7200+(Y+3<<2)>>2]=ac,c[7200+(Y+2<<2)>>2]=ac,S=S+1|0;while(S>>>0<32);S=ab+8|0,ae=(S&7|0)==0?0:-S&7,S=aa-40-ae|0,c[1796]=ab+ae,c[1793]=S,c[ab+(ae+4)>>2]=S|1,c[ab+(aa-36)>>2]=40,c[1797]=c[1788]}while(0);if(ad=c[1793]|0,ad>>>0<=o>>>0)break;return _=ad-o|0,c[1793]=_,ad=c[1796]|0,Q=ad,c[1796]=Q+o,c[Q+(o+4)>>2]=_|1,c[ad+4>>2]=o|3,n=ad+8|0,n|0}while(0);return c[(am()|0)>>2]=12,n=0,n|0}function cE(a){a|=0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;if((a|0)!=0){b=a-8|0,d=b,e=c[1794]|0,b>>>0<e>>>0&&ao(),f=c[a-4>>2]|0,g=f&3,(g|0)==1&&ao(),h=f&-8,i=a+(h-8)|0,j=i;L10:do if((f&1|0)==0){if(k=c[b>>2]|0,(g|0)==0)return;if(l=-8-k|0,m=a+l|0,n=m,o=k+h|0,m>>>0<e>>>0&&ao(),(n|0)==(c[1795]|0)){if(p=a+(h-4)|0,(c[p>>2]&3|0)!=3){q=n,r=o;break}return c[1792]=o,c[p>>2]=c[p>>2]&-2,c[a+(l+4)>>2]=o|1,void(c[i>>2]=o)}if(p=k>>>3,k>>>0<256){k=c[a+(l+8)>>2]|0,s=c[a+(l+12)>>2]|0,t=7200+(p<<1<<2)|0;do if((k|0)!=(t|0)){if(k>>>0<e>>>0&&ao(),(c[k+12>>2]|0)==(n|0))break;ao()}while(0);if((s|0)==(k|0)){c[1790]=c[1790]&~(1<<p),q=n,r=o;break}do if((s|0)==(t|0))u=s+8|0;else{if(s>>>0<e>>>0&&ao(),v=s+8|0,(c[v>>2]|0)==(n|0)){u=v;break}ao()}while(0);c[k+12>>2]=s,c[u>>2]=k,q=n,r=o;break}t=m,p=c[a+(l+24)>>2]|0,v=c[a+(l+12)>>2]|0;do if((v|0)==(t|0)){if(w=a+(l+20)|0,x=c[w>>2]|0,(x|0)==0){if(y=a+(l+16)|0,z=c[y>>2]|0,(z|0)==0){A=0;break}B=z,C=y}else B=x,C=w;for(;;)if(w=B+20|0,x=c[w>>2]|0,(x|0)==0){if(w=B+16|0,x=c[w>>2]|0,(x|0)==0)break;B=x,C=w}else B=x,C=w;if(!(C>>>0<e>>>0)){c[C>>2]=0,A=B;break}ao()}else{if(w=c[a+(l+8)>>2]|0,w>>>0<e>>>0&&ao(),x=w+12|0,(c[x>>2]|0)!=(t|0)&&ao(),y=v+8|0,(c[y>>2]|0)==(t|0)){c[x>>2]=v,c[y>>2]=w,A=v;break}ao()}while(0);if((p|0)==0){q=n,r=o;break}v=a+(l+28)|0,m=7464+(c[v>>2]<<2)|0;do{if((t|0)==(c[m>>2]|0)){if(c[m>>2]=A,(A|0)!=0)break;c[1791]=c[1791]&~(1<<c[v>>2]),q=n,r=o;break L10}if(p>>>0<(c[1794]|0)>>>0&&ao(),k=p+16|0,(c[k>>2]|0)==(t|0)?c[k>>2]=A:c[p+20>>2]=A,(A|0)==0){q=n,r=o;break L10}}while(0);A>>>0<(c[1794]|0)>>>0&&ao(),c[A+24>>2]=p,t=c[a+(l+16)>>2]|0;do if((t|0)!=0){if(!(t>>>0<(c[1794]|0)>>>0)){c[A+16>>2]=t,c[t+24>>2]=A;break}ao()}while(0);if(t=c[a+(l+20)>>2]|0,(t|0)==0){q=n,r=o;break}if(!(t>>>0<(c[1794]|0)>>>0)){c[A+20>>2]=t,c[t+24>>2]=A,q=n,r=o;break}ao()}else q=d,r=h;while(0);d=q,d>>>0>=i>>>0&&ao(),A=a+(h-4)|0,e=c[A>>2]|0,(e&1|0)==0&&ao();do{if((e&2|0)==0){if((j|0)==(c[1796]|0)){if(B=(c[1793]|0)+r|0,c[1793]=B,c[1796]=q,c[q+4>>2]=B|1,(q|0)!=(c[1795]|0))return;return c[1795]=0,void(c[1792]=0)}if((j|0)==(c[1795]|0))return B=(c[1792]|0)+r|0,c[1792]=B,c[1795]=q,c[q+4>>2]=B|1,void(c[d+B>>2]=B);B=(e&-8)+r|0,C=e>>>3;L112:do if(e>>>0<256){u=c[a+h>>2]|0,g=c[a+(h|4)>>2]|0,b=7200+(C<<1<<2)|0;do if((u|0)!=(b|0)){if(u>>>0<(c[1794]|0)>>>0&&ao(),(c[u+12>>2]|0)==(j|0))break;ao()}while(0);if((g|0)==(u|0)){c[1790]=c[1790]&~(1<<C);break}do if((g|0)==(b|0))D=g+8|0;else{if(g>>>0<(c[1794]|0)>>>0&&ao(),f=g+8|0,(c[f>>2]|0)==(j|0)){D=f;break}ao()}while(0);c[u+12>>2]=g,c[D>>2]=u}else{b=i,f=c[a+(h+16)>>2]|0,t=c[a+(h|4)>>2]|0;do if((t|0)==(b|0)){if(p=a+(h+12)|0,v=c[p>>2]|0,(v|0)==0){if(m=a+(h+8)|0,k=c[m>>2]|0,(k|0)==0){E=0;break}F=k,G=m}else F=v,G=p;for(;;)if(p=F+20|0,v=c[p>>2]|0,(v|0)==0){if(p=F+16|0,v=c[p>>2]|0,(v|0)==0)break;F=v,G=p}else F=v,G=p;if(!(G>>>0<(c[1794]|0)>>>0)){c[G>>2]=0,E=F;break}ao()}else{if(p=c[a+h
\ No newline at end of file
-var scaleX=1,scaleY=1;this.quadVTCBuffer=gl.createBuffer(),gl.bindBuffer(gl.ARRAY_BUFFER,this.quadVTCBuffer),tmp=[scaleX,0,0,0,scaleX,scaleY,0,scaleY],gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(tmp),gl.STATIC_DRAW)}function mvIdentity(){this.mvMatrix=Matrix.I(4)}function mvMultiply(m){this.mvMatrix=this.mvMatrix.x(m)}function mvTranslate(m){mvMultiply.call(this,Matrix.Translation($V([m[0],m[1],m[2]])).ensure4x4())}function setMatrixUniforms(){this.program.setMatrixUniform("uPMatrix",new Float32Array(this.perspectiveMatrix.flatten())),this.program.setMatrixUniform("uMVMatrix",new Float32Array(this.mvMatrix.flatten()))}function initScene(){var gl=this.gl;this.perspectiveMatrix=makePerspective(45,1,.1,100),mvIdentity.call(this),mvTranslate.call(this,[0,0,-2.4]),gl.bindBuffer(gl.ARRAY_BUFFER,this.quadVPBuffer),gl.vertexAttribPointer(this.vertexPositionAttribute,3,gl.FLOAT,!1,0,0),gl.bindBuffer(gl.ARRAY_BUFFER,this.quadVTCBuffer),gl.vertexAttribPointer(this.textureCoordAttribute,2,gl.FLOAT,!1,0,0),this.onInitSceneTextures(),setMatrixUniforms.call(this),this.framebuffer&&(console.log("Bound Frame Buffer"),gl.bindFramebuffer(gl.FRAMEBUFFER,this.framebuffer))}var vertexShaderScript=Script.createFromSource("x-shader/x-vertex",text(["attribute vec3 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat4 uMVMatrix;","uniform mat4 uPMatrix;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);"," vTextureCoord = aTextureCoord;","}"])),fragmentShaderScript=Script.createFromSource("x-shader/x-fragment",text(["precision highp float;","varying highp vec2 vTextureCoord;","uniform sampler2D texture;","void main(void) {"," gl_FragColor = texture2D(texture, vTextureCoord);","}"]));return constructor.prototype={toString:function(){return"WebGLCanvas Size: "+this.size},checkLastError:function(operation){var err=this.gl.getError();if(err!=this.gl.NO_ERROR){var name=this.glNames[err];name=void 0!==name?name+"("+err+")":"Unknown WebGL ENUM (0x"+value.toString(16)+")",operation?console.log("WebGL Error: %s, %s",operation,name):console.log("WebGL Error: %s",name),console.trace()}},onInitWebGL:function(){try{this.gl=this.canvas.getContext("experimental-webgl")}catch(e){}if(this.gl||error("Unable to initialize WebGL. Your browser may not support it."),!this.glNames){this.glNames={};for(var propertyName in this.gl)"number"==typeof this.gl[propertyName]&&(this.glNames[this.gl[propertyName]]=propertyName)}},onInitShaders:function(){this.program=new Program(this.gl),this.program.attach(new Shader(this.gl,vertexShaderScript)),this.program.attach(new Shader(this.gl,fragmentShaderScript)),this.program.link(),this.program.use(),this.vertexPositionAttribute=this.program.getAttributeLocation("aVertexPosition"),this.gl.enableVertexAttribArray(this.vertexPositionAttribute),this.textureCoordAttribute=this.program.getAttributeLocation("aTextureCoord"),this.gl.enableVertexAttribArray(this.textureCoordAttribute)},onInitTextures:function(){var gl=this.gl;this.texture=new Texture(gl,this.size,gl.RGB)},onInitSceneTextures:function(){this.texture.bind(0,this.program,"texture")},drawScene:function(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)},readPixels:function(buffer){var gl=this.gl;gl.readPixels(0,0,this.size.w,this.size.h,gl.RGB,gl.UNSIGNED_BYTE,buffer)}},constructor}(),YUVWebGLCanvas=function(){function constructor(canvas,size){WebGLCanvas.call(this,canvas,size)}var vertexShaderScript=Script.createFromSource("x-shader/x-vertex",text(["attribute vec3 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat4 uMVMatrix;","uniform mat4 uPMatrix;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);"," vTextureCoord = aTextureCoord;","}"])),fragmentShaderScript=(Script.createFromSource("x-shader/x-fragment",text(["precision highp float;","varying highp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","void main(void) {"," vec3 YUV = vec3"," (
\ No newline at end of file
--- a/js/glUtils.js
+++ /dev/null
@@ -1,193 +1,0 @@
-// augment Sylvester some
-Matrix.Translation = function (v)
-{
- if (v.elements.length == 2) {
- var r = Matrix.I(3);
- r.elements[2][0] = v.elements[0];
- r.elements[2][1] = v.elements[1];
- return r;
- }
-
- if (v.elements.length == 3) {
- var r = Matrix.I(4);
- r.elements[0][3] = v.elements[0];
- r.elements[1][3] = v.elements[1];
- r.elements[2][3] = v.elements[2];
- return r;
- }
-
- throw "Invalid length for Translation";
-}
-
-Matrix.prototype.flatten = function ()
-{
- var result = [];
- if (this.elements.length == 0)
- return [];
-
-
- for (var j = 0; j < this.elements[0].length; j++)
- for (var i = 0; i < this.elements.length; i++)
- result.push(this.elements[i][j]);
- return result;
-}
-
-Matrix.prototype.ensure4x4 = function()
-{
- if (this.elements.length == 4 &&
- this.elements[0].length == 4)
- return this;
-
- if (this.elements.length > 4 ||
- this.elements[0].length > 4)
- return null;
-
- for (var i = 0; i < this.elements.length; i++) {
- for (var j = this.elements[i].length; j < 4; j++) {
- if (i == j)
- this.elements[i].push(1);
- else
- this.elements[i].push(0);
- }
- }
-
- for (var i = this.elements.length; i < 4; i++) {
- if (i == 0)
- this.elements.push([1, 0, 0, 0]);
- else if (i == 1)
- this.elements.push([0, 1, 0, 0]);
- else if (i == 2)
- this.elements.push([0, 0, 1, 0]);
- else if (i == 3)
- this.elements.push([0, 0, 0, 1]);
- }
-
- return this;
-};
-
-Matrix.prototype.make3x3 = function()
-{
- if (this.elements.length != 4 ||
- this.elements[0].length != 4)
- return null;
-
- return Matrix.create([[this.elements[0][0], this.elements[0][1], this.elements[0][2]],
- [this.elements[1][0], this.elements[1][1], this.elements[1][2]],
- [this.elements[2][0], this.elements[2][1], this.elements[2][2]]]);
-};
-
-Vector.prototype.flatten = function ()
-{
- return this.elements;
-};
-
-function mht(m) {
- var s = "";
- if (m.length == 16) {
- for (var i = 0; i < 4; i++) {
- s += "<span style='font-family: monospace'>[" + m[i*4+0].toFixed(4) + "," + m[i*4+1].toFixed(4) + "," + m[i*4+2].toFixed(4) + "," + m[i*4+3].toFixed(4) + "]</span><br>";
- }
- } else if (m.length == 9) {
- for (var i = 0; i < 3; i++) {
- s += "<span style='font-family: monospace'>[" + m[i*3+0].toFixed(4) + "," + m[i*3+1].toFixed(4) + "," + m[i*3+2].toFixed(4) + "]</font><br>";
- }
- } else {
- return m.toString();
- }
- return s;
-}
-
-//
-// gluLookAt
-//
-function makeLookAt(ex, ey, ez,
- cx, cy, cz,
- ux, uy, uz)
-{
- var eye = $V([ex, ey, ez]);
- var center = $V([cx, cy, cz]);
- var up = $V([ux, uy, uz]);
-
- var mag;
-
- var z = eye.subtract(center).toUnitVector();
- var x = up.cross(z).toUnitVector();
- var y = z.cross(x).toUnitVector();
-
- var m = $M([[x.e(1), x.e(2), x.e(3), 0],
- [y.e(1), y.e(2), y.e(3), 0],
- [z.e(1), z.e(2), z.e(3), 0],
- [0, 0, 0, 1]]);
-
- var t = $M([[1, 0, 0, -ex],
- [0, 1, 0, -ey],
- [0, 0, 1, -ez],
- [0, 0, 0, 1]]);
- return m.x(t);
-}
-
-//
-// glOrtho
-//
-function makeOrtho(left, right,
- bottom, top,
- znear, zfar)
-{
- var tx = -(right+left)/(right-left);
- var ty = -(top+bottom)/(top-bottom);
- var tz = -(zfar+znear)/(zfar-znear);
-
- return $M([[2/(right-left), 0, 0, tx],
- [0, 2/(top-bottom), 0, ty],
- [0, 0, -2/(zfar-znear), tz],
- [0, 0, 0, 1]]);
-}
-
-//
-// gluPerspective
-//
-function makePerspective(fovy, aspect, znear, zfar)
-{
- var ymax = znear * Math.tan(fovy * Math.PI / 360.0);
- var ymin = -ymax;
- var xmin = ymin * aspect;
- var xmax = ymax * aspect;
-
- return makeFrustum(xmin, xmax, ymin, ymax, znear, zfar);
-}
-
-//
-// glFrustum
-//
-function makeFrustum(left, right,
- bottom, top,
- znear, zfar)
-{
- var X = 2*znear/(right-left);
- var Y = 2*znear/(top-bottom);
- var A = (right+left)/(right-left);
- var B = (top+bottom)/(top-bottom);
- var C = -(zfar+znear)/(zfar-znear);
- var D = -2*zfar*znear/(zfar-znear);
-
- return $M([[X, 0, A, 0],
- [0, Y, B, 0],
- [0, 0, C, D],
- [0, 0, -1, 0]]);
-}
-
-//
-// glOrtho
-//
-function makeOrtho(left, right, bottom, top, znear, zfar)
-{
- var tx = - (right + left) / (right - left);
- var ty = - (top + bottom) / (top - bottom);
- var tz = - (zfar + znear) / (zfar - znear);
-
- return $M([[2 / (right - left), 0, 0, tx],
- [0, 2 / (top - bottom), 0, ty],
- [0, 0, -2 / (zfar - znear), tz],
- [0, 0, 0, 1]]);
-}
-
--- a/js/h264bsd.js
+++ /dev/null
@@ -1,423 +1,0 @@
-//
-// Copyright (c) 2013 Sam Leitch. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//
-
-/*
- * This class wraps the details of the h264bsd library.
- * Module object is an Emscripten module provided globally by h264bsd_asm.js
- * targetElement element is an HTML element that will emit events that should
- * be listened for when H264 images are ready to be displayed
- * forceRGB boolean Says whether the YUV->RGB decoding should be used (even
- * in the presence of the WebGL canvas)
- */
-function H264Decoder(Module, targetElement, forceRGB) {
- var self = this;
- self.Module = Module;
- self.released = false;
- self.yuvCanvas = null;
- self.pStorage = H264Decoder.h264bsdAlloc_(self.Module);
- H264Decoder.h264bsdInit_(self.Module, self.pStorage, 0);
- self.targetElement = targetElement;
-
- //If we are using RGB
- if (forceRGB){
- self.useWebGL = false;
- self.precision = 32768;
-
- //Calculate all of the YUV->RGB coefficients
- self.co_y = Math.floor((1.164 * self.precision) + 0.5);
- self.co_rv = Math.floor((1.596 * self.precision) + 0.5);
- self.co_gu = Math.floor((0.391 * self.precision) + 0.5);
- self.co_gv = Math.floor((0.813 * self.precision) + 0.5);
- self.co_bu = Math.floor((2.018 * self.precision) + 0.5);
-
- self.coefficients_y = [];
- for(var i = 0; i < 256; i++)
- {
- self.coefficients_y[i] = self.co_y * (i - 16) + (self.precision / 2);
- }
-
- self.coefficients_rv = [];
- for(var i = 0; i < 256; i++)
- {
- self.coefficients_rv[i] = self.co_rv * (i - 128);
- }
-
- self.coefficients_gu = [];
- for(var i = 0; i < 256; i++)
- {
- self.coefficients_gu[i] = self.co_gu * (i - 128);
- }
-
- self.coefficients_gv = [];
- for(var i = 0; i < 256; i++)
- {
- self.coefficients_gv[i] = self.co_gv * (i - 128);
- }
-
- self.coefficients_bu = [];
- for(var i = 0; i < 256; i++)
- {
- self.coefficients_bu[i] = self.co_bu * (i - 128);
- }
- }else{
- //Check if we can use WebGL (as this dictates the output pipline)
- self.useWebGL = H264Decoder.detectWebGl_();
- }
-};
-
-H264Decoder.RDY = 0;
-H264Decoder.PIC_RDY = 1;
-H264Decoder.HDRS_RDY = 2;
-H264Decoder.ERROR = 3;
-H264Decoder.PARAM_SET_ERROR = 4;
-H264Decoder.MEMALLOC_ERROR = 5;
-
-//Clean up memory used by the decoder
-H264Decoder.prototype.release = function() {
- var self = this;
- if(self.released) return;
-
- self.released = true;
- self.h264bsdShutdown_(self.pStorage);
- self.h264bsdFree_(self.pStorage);
-};
-
-//Takes an array buffer of bytes and returns a UInt8Array of the decoded bytes
-H264Decoder.prototype.decode = function(data) {
- var self = this;
- if(typeof data === 'undefined' || !(data instanceof ArrayBuffer)) {
- throw new Error("data must be a ArrayBuffer instance")
- }
-
- data = new Uint8Array(data);
-
- var pData = 0; //The offset into the heap when decoding
- var pAlloced = 0; //The original pointer to the data buffer (for freeing)
- var pBytesRead = 0; //Pointer to bytesRead
- var length = data.byteLength; //The byte-wise length of the data to decode
- var bytesRead = 0; //The number of bytes read from a decode operation
- var retCode = 0; //Return code from a decode operation
- var lastPicId = 0; //ID of the last picture decoded
-
- //Get a pointer into the heap were our decoded bytes will live
- pData = pAlloced = self.malloc_(length);
- self.Module.HEAPU8.set(data, pData);
-
- //get a pointer to where bytesRead will be stored: Uint32 = 4 bytes
- pBytesRead = self.malloc_(4);
-
- var loopBody = function() {
- if(length <= 0) {
- cleanup();
- return;
- }
-
- retCode = self.h264bsdDecode_(self.pStorage, pData, length, lastPicId, pBytesRead);
- bytesRead = self.Module.getValue(pBytesRead, 'i32');
- switch(retCode){
- case H264Decoder.PIC_RDY:
- lastPicId++;
- var evt = new CustomEvent("pictureReady", {
- detail: self.getNextOutputPicture()
- });
-
- if (self.targetElement != null){
- //Raise the event on the displaying canvas element
- self.targetElement.dispatchEvent(evt);
- }
- break;
- }
-
- length = length - bytesRead;
- pData = pData + bytesRead;
-
- setTimeout(loopBody, 0);
- }
-
- var cleanup = function() {
- if(pAlloced != 0) {
- self.free_(pAlloced);
- }
-
- if(pBytesRead != 0) {
- self.free_(pBytesRead);
- }
- }
-
- loopBody();
-};
-
-H264Decoder.prototype.getNextOutputPicture = function(){
- var self = this;
- var length = self.getYUVLength_(self.pStorage);
-
- var pPicId = self.malloc_(4);
- var picId = 0;
-
- var pIsIdrPic = self.malloc_(4);
- var isIdrPic = 0;
-
- var pNumErrMbs = self.malloc_(4);
- var numErrMbs = 0;
-
- var pBytes = self.h264bsdNextOutputPicture_(self.pStorage, pPicId, pIsIdrPic, pNumErrMbs);
- var bytes = null;
-
- //We don't really use these
- picId = self.Module.getValue(pPicId, 'i32');
- isIdrPic = self.Module.getValue(pIsIdrPic, 'i32');
- numErrMbs = self.Module.getValue(pNumErrMbs, 'i32');
-
- bytes = self.Module.HEAPU8.subarray(pBytes, (pBytes + length));
-
- self.free_(pPicId);
- self.free_(pIsIdrPic);
- self.free_(pNumErrMbs);
-
- var ret = {};
- var croppingInfo = self.getCroppingInfo_(self.pStorage);
-
- //Return bytes according to the requested format
- var mbWidth = self.h264bsdPicWidth_(self.pStorage)*16;
- var mbHeight = self.h264bsdPicHeight_(self.pStorage)*16;
- if (self.useWebGL){
- ret = {
- encoding: 'YUV',
- picture: bytes,
- height: croppingInfo.height,
- width: croppingInfo.width,
- mbWidth: mbWidth,
- mbHeight: mbHeight
- };
- }else{
- ret = {
- encoding: 'RGB',
- picture: H264Decoder.convertYUV2RGB_(bytes, croppingInfo, self, mbWidth, mbHeight),
- height: croppingInfo.height,
- width: croppingInfo.width,
- mbWidth: mbWidth,
- mbHeight: mbHeight
- };
- }
-
- return ret;
-};
-
-
-H264Decoder.prototype.getCroppingInfo_ = function(pStorage){
- var self = this;
-
- var pCroppingFlag = self.malloc_(4);
- var croppingFlag = 0;
-
- var pLeftOffset = self.malloc_(4);
- var leftOffset = 0;
-
- var pWidth = self.malloc_(4);
- var width = 0;
-
- var pTopOffset = self.malloc_(4);
- var topOffset = 0;
-
- var pHeight = self.malloc_(4);
- var height = 0;
-
-
- self.h264bsdCroppingParams_(pStorage, pCroppingFlag, pLeftOffset, pWidth, pTopOffset, pHeight);
-
- croppingFlag = self.Module.getValue(pCroppingFlag, 'i32');
- leftOffset = self.Module.getValue(pLeftOffset, 'i32');
- width = self.Module.getValue(pWidth, 'i32');
- topOffset = self.Module.getValue(pTopOffset, 'i32');
- height = self.Module.getValue(pHeight, 'i32');
-
- var result = {
- 'width': width,
- 'height': height,
- 'top': topOffset,
- 'left': leftOffset
- };
- return result;
-};
-
-H264Decoder.prototype.getYUVLength_ = function(pStorage){
- var width = self.h264bsdPicWidth_(pStorage);
- var height = self.h264bsdPicHeight_(pStorage);
- return (width * 16 * height * 16) + (2 * width * 16 * height * 8);
-};
-
-//http://www.browserleaks.com/webgl#howto-detect-webgl
-H264Decoder.detectWebGl_ = function()
-{
- if (!!window.WebGLRenderingContext) {
- var canvas = document.createElement("canvas"),
- names = ["webgl", "experimental-webgl", "moz-webgl", "webkit-3d"],
- context = false;
- for(var i=0;i<4;i++) {
- try {
- context = canvas.getContext(names[i]);
- if (context && typeof context.getParameter == "function") {
- // WebGL is enabled
- return true;
- }
- } catch(e) {}
- }
- // WebGL is supported, but disabled
- return false;
- }
- // WebGL not supported
- return false;
-};
-
-//If WebGL Canvas is not availble, this will convert an array of yuv bytes into an array of rgb bytes
-H264Decoder.convertYUV2RGB_ = function(yuvBytes, croppingInfo, exCtx, mbWidth, mbHeight){
- var width = mbWidth - croppingInfo.left;
- var height = mbHeight - croppingInfo.top;
- var rgbBytes = new Uint8ClampedArray(4 * height * width);
-
- var lumaSize = width * height;
- var chromaSize = lumaSize >> 2;
-
- var planeY_off = 0;
- var planeU_off = lumaSize;
- var planeV_off = lumaSize + chromaSize;
-
- var stride_Y_h_off;
- var stride_UV_h_off;
- var stride_RGBA_off;
- for (var h=0;h<height;h++) {
- stride_Y_h_off = (width)*h;
- stride_UV_h_off = (width>>1)*(h>>1);
- stride_RGBA_off = (width<<2)*h;
- for (var w=0; w<width; w++) {
- var Y = yuvBytes[planeY_off+ w+stride_Y_h_off];
- stride_UV_off = (w>>1)+stride_UV_h_off;
- var U = (yuvBytes[planeU_off+ stride_UV_off]);
- var V = (yuvBytes[planeV_off+ stride_UV_off]);
-
- var R = exCtx.coefficients_y[Y] + exCtx.coefficients_rv[V];
- var G = exCtx.coefficients_y[Y] - exCtx.coefficients_gu[U] - exCtx.coefficients_gv[V];
- var B = exCtx.coefficients_y[Y] + exCtx.coefficients_bu[U];
-
- R = R >> 15; // div by 32768
- G = G >> 15;
- B = B >> 15;
-
- var outputData_pos = (w<<2)+stride_RGBA_off;
- rgbBytes[0+outputData_pos] = R;
- rgbBytes[1+outputData_pos] = G;
- rgbBytes[2+outputData_pos] = B;
- rgbBytes[3+outputData_pos] = 255;
- }
- }
-
- return rgbBytes;
-};
-
-// u32 h264bsdDecode(storage_t *pStorage, u8 *byteStrm, u32 len, u32 picId, u32 *readBytes);
-H264Decoder.prototype.h264bsdDecode_ = function(pStorage, pBytes, len, picId, pBytesRead) {
- return this.Module.ccall('h264bsdDecode', Number,
- [Number, Number, Number, Number, Number],
- [pStorage, pBytes, len, picId, pBytesRead]);
-};
-
-// storage_t* h264bsdAlloc();
-H264Decoder.prototype.h264bsdAlloc_ = function() {
- return this.Module.ccall('h264bsdAlloc', Number);
-};
-
-// void h264bsdFree(storage_t *pStorage);
-H264Decoder.prototype.h264bsdFree_ = function(pStorage) {
- this.Module.ccall('h264bsdFree', null, [Number], [pStorage]);
-};
-
-// u32 h264bsdInit(storage_t *pStorage, u32 noOutputReordering);
-H264Decoder.prototype.h264bsdInit_ = function(pStorage, noOutputReordering) {
- return this.Module.ccall('h264bsdInit', Number, [Number, Number], [pStorage, noOutputReordering]);
-};
-
-//void h264bsdShutdown(storage_t *pStorage);
-H264Decoder.prototype.h264bsdShutdown_ = function(pStorage) {
- this.Module.ccall('h264bsdShutdown', null, [Number], [pStorage]);
-};
-
-// u8* h264bsdNextOutputPicture(storage_t *pStorage, u32 *picId, u32 *isIdrPic, u32 *numErrMbs);
-H264Decoder.prototype.h264bsdNextOutputPicture_ = function(pStorage, pPicId, pIsIdrPic, pNumErrMbs) {
- return this.Module.ccall('h264bsdNextOutputPicture',
- Number,
- [Number, Number, Number, Number],
- [pStorage, pPicId, pIsIdrPic, pNumErrMbs]);
-};
-
-// u32 h264bsdPicWidth(storage_t *pStorage);
-H264Decoder.prototype.h264bsdPicWidth_ = function(pStorage) {
- return this.Module.ccall('h264bsdPicWidth', Number, [Number], [pStorage]);
-};
-
-// u32 h264bsdPicHeight(storage_t *pStorage);
-H264Decoder.prototype.h264bsdPicHeight_ = function(pStorage) {
- return this.Module.ccall('h264bsdPicHeight', Number, [Number], [pStorage]);
-};
-
-// void h264bsdCroppingParams(storage_t *pStorage, u32 *croppingFlag, u32 *left, u32 *width, u32 *top, u32 *height);
-H264Decoder.prototype.h264bsdCroppingParams_ = function(pStorage, pCroppingFlag, pLeft, pWidth, pTop, pHeight) {
- return this.Module.ccall('h264bsdCroppingParams',
- Number,
- [Number, Number, Number, Number, Number, Number, Number],
- [pStorage, pCroppingFlag, pLeft, pWidth, pTop, pHeight]);
-};
-
-// u32 h264bsdCheckValidParamSets(storage_t *pStorage);
-H264Decoder.prototype.h264bsdCheckValidParamSets_ = function(pStorage){
- return this.Module.ccall('h264bsdCheckValidParamSets', Number, [Number], [pStorage]);
-};
-
-// u32* h264bsdNextOutputPictureARGB(storage_t *pStorage, u32 *picId, u32 *isIdrPic, u32 *numErrMbs);
-H264Decoder.prototype.h264bsdNextOutputPictureARGB_ = function(pStorage, pPicId, pIsIdrPic, pNumErrMbs){
- return this.Module.ccall('h264bsdNextOutputPictureARGB',
- Number,
- [Number, Number, Number, Number],
- [pStorage, pPicId, pIsIdrPic, pNumErrMbs]);
-};
-
-//void h264bsdConvertToARGB(u32 width, u32 height, u8* data, u32 *rgbData);
-H264Decoder.prototype.h264bsdConvertToARGB_ = function(width, height, pData, pRgbData){
- this.Module.ccall('h264bsdConvertToARGB',
- Number,
- [Number, Number, Number, Number],
- [width, height, pData, pRgbData]);
-};
-
-// void* malloc(size_t size);
-H264Decoder.prototype.malloc_ = function(size){
- return this.Module.ccall('malloc', Number, [Number], [size]);
-};
-
-// void free(void* ptr);
-H264Decoder.prototype.free_ = function(ptr){
- return this.Module.ccall('free', null, [Number], [ptr]);
-};
-
-// void* memcpy(void* dest, void* src, size_t size);
-H264Decoder.prototype.memcpy_ = function(length){
- return this.Module.ccall('malloc', Number, [Number, Number, Number], [dest, src, size]);
-};
--- /dev/null
+++ b/js/h264bsd.min.js
@@ -1,0 +1,10 @@
+function e(a){throw a}function r(){return function(){}}function ga(a){eval.call(m,a)}function ha(){return w}function ia(a){w=a}function ja(a){switch(a){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===a[a.length-1]?ka:"i"===a[0]?(a=parseInt(a.substr(1)),z(0===a%8),a/8):0}}function la(a,b,c){c&&c.length?(c.splice||(c=Array.prototype.slice.call(c)),c.splice(0,0,b),s["dynCall_"+a].apply(m,c)):s["dynCall_"+a].call(m,b)}function na(){var a=[],b=0;this.Ba=function(c){if(c&=255,0==a.length)return 0==(128&c)?String.fromCharCode(c):(a.push(c),b=192==(224&c)?1:224==(240&c)?2:3,"");if(b&&(a.push(c),b--,b>0))return"";var c=a[0],d=a[1],f=a[2],h=a[3];return 2==a.length?c=String.fromCharCode((31&c)<<6|63&d):3==a.length?c=String.fromCharCode((15&c)<<12|(63&d)<<6|63&f):(c=(7&c)<<18|(63&d)<<12|(63&f)<<6|63&h,c=String.fromCharCode(Math.floor((c-65536)/1024)+55296,(c-65536)%1024+56320)),a.length=0,c},this.Eb=function(a){for(var a=unescape(encodeURIComponent(a)),b=[],f=0;f<a.length;f++)b.push(a.charCodeAt(f));return b}}function oa(a){var b=w;return w=w+a|0,w=w+7&-8,b}function pa(a){var b=B;return B=B+a|0,B=B+7&-8,b}function qa(a){var b=E;return E=E+a|0,E=E+7&-8,E>=F&&H("Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+F+", or (2) set Module.TOTAL_MEMORY before the program runs."),b}function ra(a,b){return Math.ceil(a/(b?b:8))*(b?b:8)}function z(a,b){a||H("Assertion failed: "+b)}function xa(a){try{var b=s["_"+a];b||(b=eval("_"+a))}catch(c){}return z(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(a,b,c,d){function f(a,b){if("string"==b){if(a===m||a===i||0===a)return 0;a=J(a),b="array"}if("array"==b){h||(h=ha());var c=oa(a.length);return ya(a,c),c}return a}var h=0,g=0,d=d?d.map(function(a){return f(a,c[g++])}):[];return a=a.apply(m,d),"string"==b?b=za(a):(z("array"!=b),b=a),h&&ia(h),b}function Aa(a,b,c){switch(c=c||"i8","*"===c.charAt(c.length-1)&&(c="i32"),c){case"i1":K[a]=b;break;case"i8":K[a]=b;break;case"i16":L[a>>1]=b;break;case"i32":M[a>>2]=b;break;case"i64":va=[b>>>0,(ua=b,1<=+Ba(ua)?ua>0?(0|Ca(+Da(ua/4294967296),4294967295))>>>0:~~+Ea((ua-+(~~ua>>>0))/4294967296)>>>0:0)],M[a>>2]=va[0],M[a+4>>2]=va[1];break;case"float":Fa[a>>2]=b;break;case"double":Ga[a>>3]=b;break;default:H("invalid type for setValue: "+c)}}function N(a,b,c,d){var f,h;"number"==typeof a?(f=l,h=a):(f=q,h=a.length);var g="string"==typeof b?b:m,c=c==Ia?d:[Ja,oa,pa,qa][c===i?Ha:c](Math.max(h,g?1:b.length));if(f){for(d=c,z(0==(3&c)),a=c+(-4&h);a>d;d+=4)M[d>>2]=0;for(a=c+h;a>d;)K[0|d++]=0;return c}if("i8"===g)return a.subarray||a.slice?O.set(a,c):O.set(new Uint8Array(a),c),c;for(var j,n,d=0;h>d;){var x=a[d];"function"==typeof x&&(x=sa.Ud(x)),f=g||b[d],0===f?d++:("i64"==f&&(f="i32"),Aa(c+d,x,f),n!==f&&(j=ja(f),n=f),d+=j)}return c}function za(a,b){for(var d,c=q,f=0;;){if(d=O[a+f|0],d>=128)c=l;else if(0==d&&!b)break;if(f++,b&&f==b)break}b||(b=f);var h="";if(!c){for(;b>0;)d=String.fromCharCode.apply(String,O.subarray(a,a+Math.min(b,1024))),h=h?h+d:d,a+=1024,b-=1024;return h}for(c=new na,f=0;b>f;f++)d=O[a+f|0],h+=c.Ba(d);return h}function Ka(a){try{if("Object._main"==a||"_main"==a)return"main()";if("number"==typeof a&&(a=za(a)),"_"!==a[0]||"_"!==a[1]||"Z"!==a[2])return a;switch(a[3]){case"n":return"operator new()";case"d":return"operator delete()"}var b=3,c={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},d=[],f=l,h=function(g,n,x){var p,n=n||1/0,D="",u=[];if("N"===a[b]){for(b++,"K"===a[b]&&b++,p=[];"E"!==a[b];)if("S"===a[b]){b++;var A=a.indexOf("_",b);p.push(d[a.substring(b,A)||0]||"?"),b=A+1}else if("C"===a[b])p.push(p[p.length-1]),b+=2;else{var A=parseInt(a.substr(b)),G=A.toString().length;if(!A||!G){b--;break}var I=a.substr(b+G,A);p.push(I),d.push(I),b+=G+A}if(b++,p=p.join("::"),n-
\ No newline at end of file
+var kb=ra(N(12,"i8",Ha),8);z(0==kb%8),s._memset=lb,s._memcpy=mb;var S={Y:1,ea:2,sd:3,pc:4,N:5,Ja:6,Mb:7,Mc:8,da:9,$b:10,X:11,Cd:11,mb:12,fb:13,kc:14,Yc:15,Yb:16,Ga:17,Dd:18,Ha:19,Zc:20,ra:21,u:22,Hc:23,lb:24,cd:25,zd:26,lc:27,Uc:28,ua:29,pd:30,Ac:31,hd:32,hc:33,md:34,Qc:42,nc:43,ac:44,rc:45,sc:46,tc:47,zc:48,Ad:49,Kc:50,qc:51,fc:35,Nc:37,Rb:52,Ub:53,Ed:54,Ic:55,Vb:56,Wb:57,gc:35,Xb:59,Wc:60,Lc:61,wd:62,Vc:63,Rc:64,Sc:65,od:66,Oc:67,Pb:68,td:69,bc:70,jd:71,Cc:72,ic:73,Tb:74,dd:76,Sb:77,nd:78,uc:79,vc:80,yc:81,xc:82,wc:83,Xc:38,Ia:39,Dc:36,sa:40,ta:95,gd:96,ec:104,Jc:105,Qb:97,ld:91,ad:88,Tc:92,qd:108,dc:111,Nb:98,cc:103,Gc:101,Ec:100,xd:110,mc:112,ib:113,jb:115,gb:114,hb:89,Bc:90,kd:93,rd:94,Ob:99,Fc:102,kb:106,fa:107,yd:109,Bd:87,jc:122,ud:116,bd:95,Pc:123,oc:84,ed:75,Zb:125,$c:131,fd:130,vd:86},nb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"},ob=0,tb=[],wb={open:function(a){var b=
\ No newline at end of file
+}while(0);do if((g|0)==0)P=0,Q=0,R=0,S=0,T=M,U=0,V=0,W=O;else{if((c[b-216+196>>2]|0)==0){P=0,Q=0,R=0,S=0,T=M,U=0,V=0,W=O;break}F=t-1|0,G=q<<4,r=q<<5,z=q*48|0,s=(d[w+(F+G)|0]|0)+(d[w+F|0]|0)+(d[w+(F+r)|0]|0)+(d[w+(F+z)|0]|0)|0,j=q<<6,h=F+j|0,F=(d[w+(h+G)|0]|0)+(d[w+h|0]|0)+(d[w+(h+r)|0]|0)+(d[w+(h+z)|0]|0)|0,n=h+j|0,h=(d[w+(n+G)|0]|0)+(d[w+n|0]|0)+(d[w+(n+r)|0]|0)+(d[w+(n+z)|0]|0)|0,o=n+j|0,j=(d[w+(o+G)|0]|0)+(d[w+o|0]|0)+(d[w+(o+r)|0]|0)+(d[w+(o+z)|0]|0)|0,z=F+s|0,o=z+O+h+j|0,c[m>>2]=o,r=z-h-j|0,c[m+16>>2]=r,P=s,Q=F,R=h,S=j,T=M+1|0,U=1,V=r,W=o}while(0);do if((q-1|0)==(g|0))X=0,Y=0,Z=0,$=0,aa=0,ab=T,ac=U,ad=V,ae=W;else{if((c[b+412>>2]|0)==0){X=0,Y=0,Z=0,$=0,aa=0,ab=T,ac=U,ad=V,ae=W;break}O=t+16|0,o=q<<4,r=q<<5,j=q*48|0,h=(d[w+(O+o)|0]|0)+(d[w+O|0]|0)+(d[w+(O+r)|0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S=aK,R=aJ,Q=aI}bi(e,ab),i=k}function aY(a){a|=0;var b=0,
\ No newline at end of file
+b$=-2147483648}else{if(!aJ)break L478;aJ=(aU+1|0)>>>1,b$=(aU&1|0)!=0?aJ:-aJ|0}c[e+2388>>2]=b$}if(!a6)break;if(aJ=c[aH>>2]|0,aH=(c[aQ+32>>2]|0)+aJ+(c[e+2388>>2]|0)|0,(((aJ|0)<(aH|0)?aJ:aH)|0)!=0)break L478}while(0);do if((c[a5+68>>2]|0)!=0){if((by(at,Q)|0)!=0)break L478;if(aS=c[Q>>2]|0,c[e+2392>>2]=aS,aS>>>0<=127)break;av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=9584,a8|0))|0,i=a8;break L478}while(0);if(aS=c[aG>>2]|0,(aS|0)==0|(aS|0)==5){if(aI=bu(at)|0,(bv(at,1)|0)!=0)break;aE=aI>>>31,c[e+2396>>2]=aE;do{if((aE|0)==0){if(aI=c[a5+48>>2]|0,aI>>>0>16){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=8792,a8|0))|0,i=a8;break L478}c[e+2400>>2]=aI;break}if((by(at,Q)|0)!=0)break L478;if(aI=c[Q>>2]|0,aI>>>0>15){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=9128,a8|0))|0,i=a8;break L478}c[e+2400>>2]=aI+1;break}while(0);b0=c[aG>>2]|0}else b0=aS;do if((b0|0)==0|(b0|0)==5){if(aE=e+2424|0,aI=c[e+2400>>2]|0,aP=c[aX>>2]|0,(aE|0)==0)return am(6672,9360,481,12456),0;if((aI|0)==0)return am(6512,9360,482,12456),0;if((aP|0)==0)return am(6360,9360,483,12456),0;if(aH=bu(at)|0,(bv(at,1)|0)!=0)break L478;if(aJ=aH>>>31,c[aE>>2]=aJ,(aJ|0)==0)break;b1=0;L583:for(;;){if(b1>>>0>aI>>>0){aw=682;break}if((by(at,P)|0)!=0)break L478;if(aJ=c[P>>2]|0,aJ>>>0>3){aw=685;break}c[e+2428+(b1*12|0)>>2]=aJ;do if(aJ>>>0<2){if((by(at,O)|0)!=0)break L478;if(aE=c[O>>2]|0,aE>>>0>=aP>>>0){aw=689;break L583}c[e+2428+(b1*12|0)+4>>2]=aE+1}else{if((aJ|0)!=2)break;if((by(at,O)|0)!=0)break L478;c[e+2428+(b1*12|0)+8>>2]=c[O>>2]}while(0);if((c[P>>2]|0)==3){aw=695;break}b1=b1+1|0}if((aw|0)==682){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=6296,a8|0))|0,i=a8;break L478}if((aw|0)==685){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=6192,a8|0))|0,i=a8;break L478}if((aw|0)==689){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=6168,a8|0))|0,i=a8;break L478}if((aw|0)==695){if((b1|0)!=0)break;av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=6144,a8|0))|0,i=a8;break L478}}while(0);do if((a2|0)!=0){if(aX=c[aQ+44>>2]|0,!((ba|0)==6|(ba|0)==5|(ba|0)==1))return am(6864,9360,590,13216),0;if(aS=bu(at)|0,aG=(bv(at,1)|0)==0,aP=aG?aS>>>31:-1,aS=(aP|0)==-1,a6){if(aS)break L478;if(c[e+2632>>2]=aP,aG=bu(at)|0,(bv(at,1)|0)!=0)break L478;if(aI=aG>>>31,c[e+2636>>2]=aI,(aX|0)!=0|(aI|0)==0)break;av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=6832,a8|0))|0,i=a8;break L478}if(aS)break L478;if(c[e+2640>>2]=aP,(aP|0)==0)break;for(aP=(aX<<1)+2|0,aS=0,aI=0,aG=0,aT=0,aJ=0;;){if(aJ>>>0>aP>>>0){aw=709;break}if((by(at,N)|0)!=0)break L478;if(aE=c[N>>2]|0,aE>>>0>6){aw=712;break}if(c[e+2644+(aJ*20|0)>>2]=aE,(aE|0)==3|(aE|0)==1){if((by(at,M)|0)!=0)break L478;c[e+2644+(aJ*20|0)+4>>2]=(c[M>>2]|0)+1,b2=c[N>>2]|0}else b2=aE;if((b2|0)==2){if((by(at,M)|0)!=0)break L478;c[e+2644+(aJ*20|0)+8>>2]=c[M>>2],b3=c[N>>2]|0}else b3=b2;if((b3|0)==6|(b3|0)==3){if((by(at,M)|0)!=0)break L478;c[e+2644+(aJ*20|0)+12>>2]=c[M>>2],b4=c[N>>2]|0}else b4=b3;if((b4|0)==4){if((by(at,M)|0)!=0)break L478;if(aE=c[M>>2]|0,aE>>>0>aX>>>0){aw=725;break}c[e+2644+(aJ*20|0)+16>>2]=(aE|0)==0?65535:aE-1,b5=aT+1|0,b6=c[N>>2]|0}else b5=aT,b6=b4;if(b7=((b6|0)==5)+aG|0,b8=((b6|0)!=0&b6>>>0<4&1)+aS|0,b9=((b6|0)==6)+aI|0,(b6|0)==0){aw=731;break}aS=b8,aI=b9,aG=b7,aT=b5,aJ=aJ+1|0}if((aw|0)==709){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=6792,a8|0))|0,i=a8;break L478}if((aw|0)==712){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=6728,a8|0))|0,i=a8;break L478}if((aw|0)==725){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=6696,a8|0))|0,i=a8;break L478}if((aw|0)==731){if(b5>>>0>1|b7>>>0>1|b9>>>0>1)break L478;if((b8|0)==0|(b7|0)==0)break;break L478}}while(0);if(c[I>>2]=0,aJ=by(at,I)|0,aT=c[I>>2]|0,aG=(aJ|0)==0,(aT|0)==-1){if(aG)break;ca=-2147483648}else{if(!aG)break;aG=(aT+1|0)>>>1,ca=(aT&1|0)!=0?aG:-aG|0}if(c[e+2404>>2]=ca,((c[a5+52>>2]|0)+ca|0)>>>0>51){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=8592,a8|0))|0,i=a8;break}L657:do if((c[a5+60>>2]|0)!=0){if((by(at,Q)|0)!=0)break L478;if(aG=c[Q>>2]|0,c[e+2408>>2]=aG,aG>>>0>2){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=8392,a8|0))|0,i=a8;break L478}if((aG|0)==1)break;c[H>>2]=0,aG=by(at,H)|0,aT=c[H>>2]|0,aJ=(aG|0)==0;do{if((aT|0)!=-1){if(!aJ)break L478;if(aG=(aT+1|0)>>>1,aI=(aT&1|0)!=0?aG:-a
\ No newline at end of file
+break}if(aE=bu(at)|0,(bv(at,1)|0)!=0){aw=361;break}if(a6=ar+48|0,c[a6>>2]=aE>>>31,(by(at,ab)|0)!=0){aw=361;break}if(aE=ar+52|0,c[aE>>2]=(c[ab>>2]|0)+1,(by(at,ab)|0)!=0){aw=361;break}if(aF=ar+56|0,c[aF>>2]=(c[ab>>2]|0)+1,a5=bu(at)|0,(bv(at,1)|0)!=0){aw=361;break}if((a5|0)>-1){av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=10336,a8|0))|0,i=a8,aw=361;break}if(bu(at)|0,(bv(at,1)|0)!=0){aw=361;break}if(a5=bu(at)|0,(bv(at,1)|0)!=0){aw=361;break}aQ=ar+60|0,c[aQ>>2]=a5>>>31;do{if((a5|0)<0){if(ay=ar+64|0,(by(at,ay)|0)!=0){aw=361;break L1368}if(aJ=ar+68|0,(by(at,aJ)|0)!=0){aw=361;break L1368}if(dj=ar+72|0,(by(at,dj)|0)!=0){aw=361;break L1368}if(aM=ar+76|0,(by(at,aM)|0)!=0){aw=361;break L1368}if(aT=c[aE>>2]|0,(c[ay>>2]|0)<=((aT<<3)+~c[aJ>>2]|0)&&(aJ=c[aF>>2]|0,(c[dj>>2]|0)<=((aJ<<3)+~c[aM>>2]|0))){eu=aT,ev=aJ;break}av(c[m>>2]|0,5224,(a8=i,i=i+8|0,c[a8>>2]=1e4,a8|0))|0,i=a8,aw=361;break L1368}eu=c[aE>>2]|0,ev=c[aF>>2]|0}while(0);if(a5=_(eu,ev)|0,(a5|0)==0)return am(5120,9512,394,12752),0;switch(c[ax>>2]|0){case 11:ew=396,ex=345600,aw=287;break;case 12:ew=396,ex=912384,aw=287;break;case 13:ew=396,ex=912384,aw=287;break;case 20:ew=396,ex=912384,aw=287;break;case 21:ew=792,ex=1824768,aw=287;break;case 22:ew=1620,ex=3110400,aw=287;break;case 30:ew=1620,ex=3110400,aw=287;break;case 31:ew=3600,ex=6912e3,aw=287;break;case 32:ew=5120,ex=7864320,aw=287;break;case 40:ew=8192,ex=12582912,aw=287;break;case 41:ew=8192,ex=12582912,aw=287;break;case 42:ew=8704,ex=13369344,aw=287;break;case 50:ew=22080,ex=42393600,aw=287;break;case 51:ew=36864,ex=70778880,aw=287;break;case 10:ew=99,ex=152064,aw=287;break;default:aw=288}do if((aw|0)==287){if(ew>>>0<a5>>>0){aw=288;break}aJ=(ex>>>0)/((a5*384|0)>>>0)|0,aT=aJ>>>0<16?aJ:16,c[ab>>2]=aT,aJ=c[a4>>2]|0,aJ>>>0>aT>>>0?(ey=aJ,aw=290):ez=aT}while(0);if((aw|0)==288&&(c[ab>>2]=2147483647,ey=c[a4>>2]|0,aw=290),(aw|0)==290&&(c[ab>>2]=ey,ez=ey),a5=ar+88|0,c[a5>>2]=ez,aT=bu(at)|0,(bv(at,1)|0)!=0){aw=361;break}aJ=ar+80|0,c[aJ>>2]=aT>>>31;do if((aT|0)<0){if(aM=bA(952)|0,dj=ar+84|0,c[dj>>2]=aM,(aM|0)==0){aw=361;break L1368}if(bC(aM|0,0,952)|0,ay=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}c[aM>>2]=ay>>>31;do if((ay|0)<0){if(aS=bu(at)|0,(bv(at,8)|0)!=0){eA=dj;break L1368}if(aL=aS>>>24,c[aM+4>>2]=aL,(aL|0)!=255)break;if(aL=bu(at)|0,(bv(at,16)|0)!=0){eA=dj;break L1368}if(c[aM+8>>2]=aL>>>16,aL=bu(at)|0,(bv(at,16)|0)!=0){eA=dj;break L1368}c[aM+12>>2]=aL>>>16}while(0);if(ay=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}if(c[aM+16>>2]=ay>>>31,(ay|0)<0){if(ay=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}c[aM+20>>2]=ay>>>31}if(ay=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}c[aM+24>>2]=ay>>>31;do if((ay|0)<0){if(aL=bu(at)|0,(bv(at,3)|0)!=0){eA=dj;break L1368}if(c[aM+28>>2]=aL>>>29,aL=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}if(c[aM+32>>2]=aL>>>31,aL=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}if(c[aM+36>>2]=aL>>>31,(aL|0)>=0){c[aM+40>>2]=2,c[aM+44>>2]=2,c[aM+48>>2]=2;break}if(aL=bu(at)|0,(bv(at,8)|0)!=0){eA=dj;break L1368}if(c[aM+40>>2]=aL>>>24,aL=bu(at)|0,(bv(at,8)|0)!=0){eA=dj;break L1368}if(c[aM+44>>2]=aL>>>24,aL=bu(at)|0,(bv(at,8)|0)!=0){eA=dj;break L1368}c[aM+48>>2]=aL>>>24}else c[aM+28>>2]=5,c[aM+40>>2]=2,c[aM+44>>2]=2,c[aM+48>>2]=2;while(0);if(ay=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}if(c[aM+52>>2]=ay>>>31,(ay|0)<0){if(ay=aM+56|0,(by(at,ay)|0)!=0){eA=dj;break L1368}if((c[ay>>2]|0)>>>0>5){eA=dj;break L1368}if(ay=aM+60|0,(by(at,ay)|0)!=0){eA=dj;break L1368}if((c[ay>>2]|0)>>>0>5){eA=dj;break L1368}}if(ay=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}if(c[aM+64>>2]=ay>>>31,(ay|0)<0){if(ay=bu(at)|0,(bv(at,32)|0)==-1|(ay|0)==0){eA=dj;break L1368}if(c[aM+68>>2]=ay,ay=bu(at)|0,(bv(at,32)|0)==-1|(ay|0)==0){eA=dj;break L1368}if(c[aM+72>>2]=ay,ay=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}c[aM+76>>2]=ay>>>31}if(ay=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}if(aL=aM+80|0,c[aL>>2]=ay>>>31,aS=aM+84|0,(ay|0)<0){if((bz(at,aS)|0)!=0){eA=dj;break L1368}}else c[aS>>2]=1,c[aM+96>>2]=288000001,c[aM+224>>2]=288000001,c[aM+480>>2]=24,c[aM+484>>2]=24,c[aM+488>>2]=24,c[aM+492>>2]=24;if(aS=bu(at)|0,(bv(at,1)|0)!=0){eA=dj;break L1368}if(ay=aM+496|0,
\ No newline at end of file
+if(gS=gZ-gX|0,((gS|0)<0?-gS|0:gS)>>>0>=ha>>>0)break;gS=g2+c0|0,eV=d[gS]|0,gR=g2+ch|0,f0=d[gR]|0;do{if(gW>>>0<g3>>>0){if(fb=eV-gT|0,((fb|0)<0?-fb|0:fb)>>>0<ha>>>0?(fb=gT+g1+gX|0,a[g_]=(gZ+4+(fb<<1)+eV|0)>>>3,a[g$]=(fb+2+eV|0)>>>2,a[gS]=(fb+4+(eV*3|0)+(d[g2+c$|0]<<1)|0)>>>3):a[g_]=(gT+2+(g1<<1)+gZ|0)>>>2,fb=f0-gX|0,((fb|0)<0?-fb|0:fb)>>>0>=ha>>>0)break;fb=gX+gT+gZ|0,a[g2]=(g1+4+(fb<<1)+f0|0)>>>3,a[gV]=(fb+2+f0|0)>>>2,a[gR]=(fb+4+(f0*3|0)+(d[g2+c5|0]<<1)|0)>>>3;break L2246}a[g_]=(gT+2+(g1<<1)+gZ|0)>>>2}while(0);a[g2]=(g1+2+gX+(gZ<<1)|0)>>>2}while(0);if(gZ=g5-1|0,(gZ|0)==0)break L2235;g5=gZ,g2=g2+1|0}for(g2=d[(c[n+(hD*12|0)>>2]|0)+(e5-1)|0]|0,g5=-g2|0,g3=g2+1|0,gZ=16,gX=hC;;){g1=gX+c1|0,gT=d[g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aJ,hY=0;;){hb=hX+4|0,g7=c[hb>>2]|0,(g7|0)!=0&&(aZ(hV,g7,c2,aE),aZ(hU,c[hb>>2]|0,c2,aE)),hb=hX+36|0,g7=c[hb>>2]|0,(g7|0)!=0&&(aZ(hV+c7|0,g7,c2,aE),aZ(hU+c7|0,c[hb>>2]|0,c2,aE)),hb=hX+16|0,g7=hX+20|0,he=c[g7>>2]|0,(he|0)!=0&&(aZ(hV+4|0,he,c3,aE),aZ(hU+4|0,c[g7>>2]|0,c3,aE)),g7=hX+52|0,he=c[g7>>2]|0,(he|0)!=0&&(aZ(hV+aN|0,he,c3,aE),aZ(hU+aN|0,c[g7>>2]|0,c3,aE)),g7=hX|0,he=c[g7>>2]|0,e7=hX+8|0,hd=c[e7>>2]|0;do if((he|0)==(hd|0)){if((he|0)!=(c[hb>>2]|0)){aw=1730;break}if((he|0)!=(c[hX+24>>2]|0)){aw=1730;break}if((he|0)==0)break;e5=n+(hY*12|0)|0,a_(hV,he,e5,aE),a_(hU,c[g7>>2]|0,e5,aE)}else aw=1730;while(0);do if((aw|0)==1730){if(aw=0,(he|0)==0?hZ=hd:(e5=n+(hY*12|0)|0,a$(hV,he,e5,aE),a$(hU,c[g7>>2]|0,e5,aE),hZ=c[e7>>2]|0),(hZ|0)!=0&&(e5=n+(hY*12|0)|0,a$(hV+2|0,hZ,e5,aE),a$(hU+2|0,c[e7>>2]|0,e5,aE)),e5=hb|0,g9=c[e5>>2]|0,(g9|0)!=0&&(dF=n+(hY*12|0)|0,a$(hV+4|0,g9,dF,aE),a$(hU+4|0,c[e5>>2]|0,dF,aE)),dF=hX+24|0,e5=c[dF>>2]|0,(e5|0)==0)break;g9=n+(hY*12|0)|0,a$(hV+6|0,e5,g9,aE),a$(hU+6|0,c[dF>>2]|0,g9,aE)}while(0);if(hb=hW+1|0,!(hb>>>0<2))break;hU=hU+ch|0,hV=hV+ch|0,hW=hb,hX=hX+64|0,hY=2}eE=c[aQ>>2]|0}while(0);if(aT=dm+1|0,gn=(aT|0)==(aL|0),hb=(gn&1)+dq|0
\ No newline at end of file
+}while(0);ab=(m|0)==0;L119:do if(aj>>>0<7){if(ab)return am(10056,10184,718,11040),0;G=(l|0)==0,at=e+200|0,x=e+4|0,Z=e+204|0,Y=e+208|0,ac=e+212|0,ao=0;L191:for(;;){if(E=e+82+ao|0,(d[E]|0)>>>0>=9){aB=125;break}switch(av=15928+(ao<<3)|0,ar=c[av+4>>2]|0,c[av>>2]|0){case 0:aM=c[at>>2]|0,aB=132;break;case 1:aM=c[Z>>2]|0,aB=132;break;case 2:aM=c[Y>>2]|0,aB=132;break;case 3:aM=c[ac>>2]|0,aB=132;break;case 4:aM=e,aB=132;break;case 255:aN=0,aO=0;break;default:aB=127;break L191}do if((aB|0)==132){if(aB=0,(aM|0)==0){aN=0,aO=0;break}if(av=(c[x>>2]|0)==(c[aM+4>>2]|0),ap=av&1,G|av^1){aN=aM,aO=ap;break}if(av=c[aM>>2]|0,av>>>0>=32){aB=135;break L191}aN=aM,aO=av>>>0<6?0:ap}while(0);switch(K=15224+(ao<<3)|0,H=c[K+4>>2]|0,c[K>>2]|0){case 0:aP=c[at>>2]|0,aB=143;break;case 1:aP=c[Z>>2]|0,aB=143;break;case 2:aP=c[Y>>2]|0,aB=143;break;case 3:aP=c[ac>>2]|0,aB=143;break;case 4:aP=e,aB=143;break;case 255:aB=144;break;default:aB=138;break L191}do if((aB|0)==143){if(aB=0,(aP|0)==0){aB=144;break}if(K=(c[x>>2]|0)==(c[aP+4>>2]|0),ap=K&1,G|K^1)aQ=ap;else{if(K=c[aP>>2]|0,K>>>0>=32){aB=147;break L191}aQ=K>>>0<6?0:ap}if(ap=(aO|0)!=0,K=(aQ|0)==0,K|ap^1){aR=2,aS=ap,aT=K,aU=1;break}if(K=c[aN>>2]|0,K>>>0>=32){aB=151;break L191}if(aV=(K|0)==6?d[(ar&255)+(aN+82)|0]|0:2,K=c[aP>>2]|0,K>>>0>=32){aB=155;break L191}aW=(K|0)==6?d[(H&255)+(aP+82)|0]|0:2,aR=aV>>>0<aW>>>0?aV:aW,aS=ap,aT=0,aU=0}while(0);switch((aB|0)==144&&(aB=0,aR=2,aS=(aO|0)!=0,aT=1,aU=1),(c[f+12+(ao<<2)>>2]|0)==0?(H=c[f+76+(ao<<2)>>2]|0,aX=(H>>>0>=aR>>>0)+H|0):aX=aR,a[E]=aX,c[14520+(ao<<3)>>2]|0){case 0:aY=c[at>>2]|0,aB=167;break;case 1:aY=c[Z>>2]|0,aB=167;break;case 2:aY=c[Y>>2]|0,aB=167;break;case 3:aY=c[ac>>2]|0,aB=167;break;case 4:aY=e,aB=167;break;case 255:aZ=0;break;default:aB=162;break L191}do if((aB|0)==167){if(aB=0,(aY|0)==0){aZ=0;break}if(H=(c[x>>2]|0)==(c[aY+4>>2]|0),ar=H&1,G|H^1){aZ=ar;break}if(H=c[aY>>2]|0,H>>>0>=32){aB=170;break L191}aZ=H>>>0<6?0:ar}while(0);switch(c[13816+(ao<<3)>>2]|0){case 0:a_=c[at>>2]|0,aB=178;break;case 1:a_=c[Z>>2]|0,aB=178;break;case 2:a_=c[Y>>2]|0,aB=178;break;case 3:a_=c[ac>>2]|0,aB=178;break;case 4:a_=e,aB=178;break;case 255:a$=0;break;default:aB=173;break L191}do if((aB|0)==178){if(aB=0,(a_|0)==0){a$=0;break}if(E=(c[x>>2]|0)==(c[a_+4>>2]|0),ar=E&1,G|E^1){a$=ar;break}if(E=c[a_>>2]|0,E>>>0>=32){aB=181;break L191}a$=E>>>0<6?0:ar}while(0);ar=c[2608+(ao<<2)>>2]|0,E=c[2544+(ao<<2)>>2]|0,H=(1285>>>(ao>>>0)&1|0)!=0,H?(a0=p+E|0,a1=p+(E+1)|0,a2=p+(E+2)|0,a3=p+(E+3)|0):(ap=(E<<4)+ar|0,a0=m+(ap-1)|0,a1=m+(ap+15)|0,a2=m+(ap+31)|0,a3=m+(ap+47)|0),ap=a[a0]|0,K=a[a1]|0,av=a[a2]|0,aa=a[a3]|0;do{if((51>>>(ao>>>0)&1|0)==0){if(ah=E-1|0,$=(ah<<4)+ar|0,F=a[m+$|0]|0,aq=a[m+($+1)|0]|0,ax=a[m+($+2)|0]|0,al=a[m+($+3)|0]|0,an=a[m+($+4)|0]|0,aw=a[m+($+5)|0]|0,af=a[m+($+6)|0]|0,J=a[m+($+7)|0]|0,H){a4=p+ah|0,a5=F,a6=aq,a7=ax,a8=al,a9=an,ba=aw,bb=af,bc=J;break}a4=m+($-1)|0,a5=F,a6=aq,a7=ax,a8=al,a9=an,ba=aw,bb=af,bc=J;break}a4=o+ar|0,a5=a[o+(ar+1)|0]|0,a6=a[o+(ar+2)|0]|0,a7=a[o+(ar+3)|0]|0,a8=a[o+(ar+4)|0]|0,a9=a[o+(ar+5)|0]|0,ba=a[o+(ar+6)|0]|0,bb=a[o+(ar+7)|0]|0,bc=a[o+(ar+8)|0]|0}while(0);switch(H=a[a4]|0,aX|0){case 0:if(aT){C=1,aB=584;break L191}J=(a7&255)<<16|(a8&255)<<24|(a6&255)<<8|a5&255,bd=J,be=J,bf=J,bg=J;break;case 1:if(!aS){C=1,aB=585;break L191}bd=_(ap&255,16843009)|0,be=_(K&255,16843009)|0,bf=_(av&255,16843009)|0,bg=_(aa&255,16843009)|0;break;case 2:do if(aU){if(aS){bh=((ap&255)+2+(K&255)+(av&255)+(aa&255)|0)>>>2,aB=202;break}if(aT){bk=-128;break}bh=((a8&255)+2+(a7&255)+(a6&255)+(a5&255)|0)>>>2,aB=202}else bh=((ap&255)+4+(K&255)+(av&255)+(aa&255)+(a8&255)+(a7&255)+(a6&255)+(a5&255)|0)>>>3,aB=202;while(0);if((aB|0)==202){if(aB=0,!(bh>>>0<256)){aB=203;break L191}bk=bh&255}J=_(bk&255,16843009)|0,bd=J,be=J,bf=J,bg=J;break;case 3:if(aT){C=1,aB=586;break L191}J=(aZ|0)==0,af=a6&255,aw=a7&255,an=aw+2|0,al=a8&255,ax=al+2|0,aq=(af+ax+(aw<<1)|0)>>>2&255,aw=(J?a8:a9)&255,F=(aw+(al<<1)+an|0)>>>2&255,al=(J?a8:ba)&255,$=(ax+al+(aw<<1)|0)>>>2,ax=$&255,ah=(J?a8:bb)&255,L=(aw+2+ah+(al<<1)|0)>>>2,aw=L&255,ae=(J?a8:bc)&255,J=(al+2+ae+(ah<<1)|0)>>>2,bd=F<<16|$<<24|aq<<8|((a5&255)+an+(af<<1)|0)>>>
\ No newline at end of file
+break}if(dk=(dg<<4)+dh|0,dm=m+dk|0,c4=k+dh+(_(dg,r)|0)|0,dg=u+c4|0,(dm&3|0)!=0){aB=554;break}if((dg&3|0)!=0){aB=556;break}if(dh=c[dl>>2]|0,(dh|0)==16777215?(dl=dg,c9=c[m+(dk+16)>>2]|0,c[dl>>2]=c[dm>>2],c[dl+(bH<<2)>>2]=c9,c9=c[m+(dk+48)>>2]|0,c[dl+(q<<2)>>2]=c[m+(dk+32)>>2],c[dl+(e<<2)>>2]=c9):(c9=d[m+(dk+1)|0]|0,dl=c[f+328+(c0<<6)+4>>2]|0,a[dg]=a[1264+(dh+512+(d[dm]|0))|0]|0,dm=d[m+(dk+2)|0]|0,dh=c[f+328+(c0<<6)+8>>2]|0,a[u+(c4+1)|0]=a[1264+((c9|512)+dl)|0]|0,dl=d[m+(dk+3)|0]|0,c9=c[f+328+(c0<<6)+12>>2]|0,a[u+(c4+2)|0]=a[1264+(dh+512+dm)|0]|0,a[u+(c4+3)|0]=a[1264+(c9+512+dl)|0]|0,dl=c4+r|0,c4=d[m+(dk+17)|0]|0,c9=c[f+328+(c0<<6)+20>>2]|0,a[u+dl|0]=a[1264+((c[f+328+(c0<<6)+16>>2]|0)+512+(d[m+(dk+16)|0]|0))|0]|0,dm=d[m+(dk+18)|0]|0,dh=c[f+328+(c0<<6)+24>>2]|0,a[u+(dl+1)|0]=a[1264+((c4|512)+c9)|0]|0,c9=d[m+(dk+19)|0]|0,c4=c[f+328+(c0<<6)+28>>2]|0,a[u+(dl+2)|0]=a[1264+(dh+512+dm)|0]|0,a[u+(dl+3)|0]=a[1264+(c4+512+c9)|0]|0,c9=dl+r|0,dl=d[m+(dk+33)|0]|0,c4=c[f+328+(c0<<6)+36>>2]|0,a[u+c9|0]=a[1264+((c[f+328+(c0<<6)+32>>2]|0)+512+(d[m+(dk+32)|0]|0))|0]|0,dm=d[m+(dk+34)|0]|0,dh=c[f+328+(c0<<6)+40>>2]|0,a[u+(c9+1)|0]=a[1264+((dl|512)+c4)|0]|0,c4=d[m+(dk+35)|0]|0,dl=c[f+328+(c0<<6)+44>>2]|0,a[u+(c9+2)|0]=a[1264+(dh+512+dm)|0]|0,a[u+(c9+3)|0]=a[1264+(dl+512+c4)|0]|0,c4=c9+r|0,c9=d[m+(dk+49)|0]|0,dl=c[f+328+(c0<<6)+52>>2]|0,a[u+c4|0]=a[1264+((c[f+328+(c0<<6)+48>>2]|0)+512+(d[m+(dk+48)|0]|0))|0]|0,dm=d[m+(dk+50)|0]|0,dh=c[f+328+(c0<<6)+56>>2]|0,a[u+(c4+1)|0]=a[1264+((c9|512)+dl)|0]|0,dl=d[m+(dk+51)|0]|0,dk=c[f+328+(c0<<6)+60>>2]|0,a[u+(c4+2)|0]=a[1264+(dh+512+dm)|0]|0,a[u+(c4+3)|0]=a[1264+(dk+512+dl)|0]|0),dl=c0+1|0,!(dl>>>0<16)){aB=561;break}c0=dl}if((aB|0)==552)return am(4536,8160,217,10464),0;if((aB|0)==554)return am(4256,8160,222,10464),0;if((aB|0)==556)return am(10232,8160,223,10464),0;if((aB|0)==561){for(c0=g<<3&2147483640,g=m+256|0,r=m+320|0,m=w+v+bI|0,bI=c0>>>2,v=c0>>>1,w=v+bI|0,e=16;;){if(q=e&3,bH=c[2608+(q<<2)>>2]|0,k=c[2544+(q<<2)>>2]|0,q=f+328+(e<<6)|0,(q|0)==0){aB=563;break}if(dl=e>>>0>19,dk=dl?r:g,c4=(k<<3)+bH|0,dm=dk+c4|0,dh=m+bH+(dl?s:0)+(_(k,c0)|0)|0,k=u+dh|0,(dm&3|0)!=0){aB=565;break}if((k&3|0)!=0){aB=567;break}if(dl=c[q>>2]|0,(dl|0)==16777215?(q=k,bH=c[dk+(c4+8)>>2]|0,c[q>>2]=c[dm>>2],c[q+(bI<<2)>>2]=bH,bH=c[dk+(c4+24)>>2]|0,c[q+(v<<2)>>2]=c[dk+(c4+16)>>2],c[q+(w<<2)>>2]=bH):(bH=d[dk+(c4+1)|0]|0,q=c[f+328+(e<<6)+4>>2]|0,a[k]=a[1264+(dl+512+(d[dm]|0))|0]|0,dm=d[dk+(c4+2)|0]|0,dl=c[f+328+(e<<6)+8>>2]|0,a[u+(dh+1)|0]=a[1264+((bH|512)+q)|0]|0,q=d[dk+(c4+3)|0]|0,bH=c[f+328+(e<<6)+12>>2]|0,a[u+(dh+2)|0]=a[1264+(dl+512+dm)|0]|0,a[u+(dh+3)|0]=a[1264+(bH+512+q)|0]|0,q=dh+c0|0,dh=d[dk+(c4+9)|0]|0,bH=c[f+328+(e<<6)+20>>2]|0,a[u+q|0]=a[1264+((c[f+328+(e<<6)+16>>2]|0)+512+(d[dk+(c4+8)|0]|0))|0]|0,dm=d[dk+(c4+10)|0]|0,dl=c[f+328+(e<<6)+24>>2]|0,a[u+(q+1)|0]=a[1264+((dh|512)+bH)|0]|0,bH=d[dk+(c4+11)|0]|0,dh=c[f+328+(e<<6)+28>>2]|0,a[u+(q+2)|0]=a[1264+(dl+512+dm)|0]|0,a[u+(q+3)|0]=a[1264+(dh+512+bH)|0]|0,bH=q+c0|0,q=d[dk+(c4+17)|0]|0,dh=c[f+328+(e<<6)+36>>2]|0,a[u+bH|0]=a[1264+((c[f+328+(e<<6)+32>>2]|0)+512+(d[dk+(c4+16)|0]|0))|0]|0,dm=d[dk+(c4+18)|0]|0,dl=c[f+328+(e<<6)+40>>2]|0,a[u+(bH+1)|0]=a[1264+((q|512)+dh)|0]|0,dh=d[dk+(c4+19)|0]|0,q=c[f+328+(e<<6)+44>>2]|0,a[u+(bH+2)|0]=a[1264+(dl+512+dm)|0]|0,a[u+(bH+3)|0]=a[1264+(q+512+dh)|0]|0,dh=bH+c0|0,bH=d[dk+(c4+25)|0]|0,q=c[f+328+(e<<6)+52>>2]|0,a[u+dh|0]=a[1264+((c[f+328+(e<<6)+48>>2]|0)+512+(d[dk+(c4+24)|0]|0))|0]|0,dm=d[dk+(c4+26)|0]|0,dl=c[f+328+(e<<6)+56>>2]|0,a[u+(dh+1)|0]=a[1264+((bH|512)+q)|0]|0,q=d[dk+(c4+27)|0]|0,c4=c[f+328+(e<<6)+60>>2]|0,a[u+(dh+2)|0]=a[1264+(dl+512+dm)|0]|0,a[u+(dh+3)|0]=a[1264+(c4+512+q)|0]|0),q=e+1|0,!(q>>>0<24)){C=0,aB=628;break}e=q}if((aB|0)==563)return am(4536,8160,282,10464),0;if((aB|0)==565)return am(4256,8160,296,10464),0;if((aB|0)==567)return am(10232,8160,297,10464),0;if((aB|0)==628)return i=n,C|0}return 0}function bl(d,e,f){d|=0,e|=0,f|=0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;if(e>>>0>=24)return am(5408,10016,823,12960),0;if(g=a[15932+(e<<3)|0]|0,h=a[15228+(e<<3)|0]|0,i=(c[15224+(e<<3)>>2]|0)==4,(c[15928+(e<<3)>>2]|0)==4)return e=b[f+((g&255)<<1)
\ No newline at end of file
+}if(i=f+1|0,j=g>>>1,(j|0)==0){h=i;break}f=i,g=j}return g=h+4|0,(g|0)!=32?(bv(a,h+5|0)|0,g>>>0>=32?(am(7656,8944,79,11544),0):(f=bu(a)|0,(bv(a,g)|0)!=0?(e=1,e|0):(d=f>>>((28-h|0)>>>0),(d|0)==-1?(e=1,e|0):(c[b>>2]=(1<<g)-1+d,e=0,e|0)))):(c[b>>2]=0,bv(a,32)|0,d=bu(a)|0,(bv(a,1)|0)==0&(d|0)<0?(d=bu(a)|0,(bv(a,32)|0)==-1?(e=1,e|0):(d|0)==0?(c[b>>2]=-1,e=0,e|0):(d|0)==1?(c[b>>2]=-1,e=1,e|0):(e=1,e|0)):(e=1,e|0))}function bz(a,b){a|=0,b|=0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;if((a|0)==0)return am(6344,8768,413,13112),0;if((b|0)==0)return am(7e3,8768,414,13112),0;if(d=b|0,e=by(a,d)|0,(e|0)!=0)return f=e,f|0;if(e=(c[d>>2]|0)+1|0,c[d>>2]=e,e>>>0>32)return f=1,f|0;if(e=bu(a)|0,(bv(a,4)|0)!=0)return f=1,f|0;if(g=b+4|0,c[g>>2]=e>>>28,e=bu(a)|0,(bv(a,4)|0)!=0)return f=1,f|0;h=b+8|0,c[h>>2]=e>>>28;L19:do if((c[d>>2]|0)!=0){for(e=0;;){if(i=b+12+(e<<2)|0,j=by(a,i)|0,(j|0)!=0){f=j,k=23;break}if(j=c[i>>2]|0,(j|0)==-1){f=1,k=24;break}if(l=j+1|0,c[i>>2]=l,c[i>>2]=l<<(c[g>>2]|0)+6,l=b+140+(e<<2)|0,i=by(a,l)|0,(i|0)!=0){f=i,k=25;break}if(i=c[l>>2]|0,(i|0)==-1){f=1,k=26;break}if(j=i+1|0,c[l>>2]=j,c[l>>2]=j<<(c[h>>2]|0)+4,j=bu(a)|0,(bv(a,1)|0)!=0){f=1,k=27;break}if(c[b+268+(e<<2)>>2]=j>>>31,e=e+1|0,e>>>0>=(c[d>>2]|0)>>>0)break L19}if((k|0)==23)return f|0;if((k|0)==24)return f|0;if((k|0)==25)return f|0;if((k|0)==26)return f|0;if((k|0)==27)return f|0}while(0);return k=bu(a)|0,(bv(a,5)|0)!=0?(f=1,f|0):(c[b+396>>2]=(k>>>27)+1,k=bu(a)|0,(bv(a,5)|0)!=0?(f=1,f|0):(c[b+400>>2]=(k>>>27)+1,k=bu(a)|0,(bv(a,5)|0)!=0?(f=1,f|0):(c[b+404>>2]=(k>>>27)+1,k=bu(a)|0,(bv(a,5)|0)!=0?(f=1,f|0):(c[b+408>>2]=k>>>27,f=0,f|0))))}function bA(a){a|=0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ab=0,ac=0,ad=0,ae=0,af=0,ag=0,ah=0,ai=0,ak=0,am=0,an=0,ao=0,ap=0,aq=0,ar=0,as=0,at=0,av=0,ay=0,az=0,aA=0,aB=0,aC=0,aD=0,aE=0,aF=0,aG=0,aH=0,aI=0,aJ=0,aK=0,aL=0;do{if(a>>>0<245){if(b=a>>>0<11?16:a+11&-8,d=b>>>3,e=c[4044]|0,f=e>>>(d>>>0),(f&3|0)!=0){g=(f&1^1)+d|0,h=g<<1,i=16216+(h<<2)|0,j=16216+(h+2<<2)|0,h=c[j>>2]|0,k=h+8|0,l=c[k>>2]|0;do{if((i|0)!=(l|0)){if(l>>>0<(c[4048]|0)>>>0)return au(),0;if(m=l+12|0,(c[m>>2]|0)==(h|0)){c[m>>2]=i,c[j>>2]=l;break}return au(),0}c[4044]=e&~(1<<g)}while(0);return l=g<<3,c[h+4>>2]=l|3,j=h+(l|4)|0,c[j>>2]=c[j>>2]|1,n=k,n|0}if(b>>>0<=(c[4046]|0)>>>0){o=b;break}if((f|0)!=0){j=2<<d,l=f<<d&(j|-j),j=(l&-l)-1|0,l=j>>>12&16,i=j>>>(l>>>0),j=i>>>5&8,m=i>>>(j>>>0),i=m>>>2&4,p=m>>>(i>>>0),m=p>>>1&2,q=p>>>(m>>>0),p=q>>>1&1,r=(j|l|i|m|p)+(q>>>(p>>>0))|0,p=r<<1,q=16216+(p<<2)|0,m=16216+(p+2<<2)|0,p=c[m>>2]|0,i=p+8|0,l=c[i>>2]|0;do{if((q|0)!=(l|0)){if(l>>>0<(c[4048]|0)>>>0)return au(),0;if(j=l+12|0,(c[j>>2]|0)==(p|0)){c[j>>2]=q,c[m>>2]=l;break}return au(),0}c[4044]=e&~(1<<r)}while(0);if(l=r<<3,m=l-b|0,c[p+4>>2]=b|3,q=p,e=q+b|0,c[q+(b|4)>>2]=m|1,c[q+l>>2]=m,l=c[4046]|0,(l|0)!=0){q=c[4049]|0,d=l>>>3,l=d<<1,f=16216+(l<<2)|0,k=c[4044]|0,h=1<<d;do{if((k&h|0)!=0){if(d=16216+(l+2<<2)|0,g=c[d>>2]|0,g>>>0>=(c[4048]|0)>>>0){s=g,t=d;break}return au(),0}c[4044]=k|h,s=f,t=16216+(l+2<<2)|0}while(0);c[t>>2]=q,c[s+12>>2]=q,c[q+8>>2]=s,c[q+12>>2]=f}return c[4046]=m,c[4049]=e,n=i,n|0}if(l=c[4045]|0,(l|0)==0){o=b;break}for(h=(l&-l)-1|0,l=h>>>12&16,k=h>>>(l>>>0),h=k>>>5&8,p=k>>>(h>>>0),k=p>>>2&4,r=p>>>(k>>>0),p=r>>>1&2,d=r>>>(p>>>0),r=d>>>1&1,g=c[16480+((h|l|k|p|r)+(d>>>(r>>>0))<<2)>>2]|0,r=g,d=g,p=(c[g+4>>2]&-8)-b|0;;){if(g=c[r+16>>2]|0,(g|0)==0){if(k=c[r+20>>2]|0,(k|0)==0)break;u=k}else u=g;g=(c[u+4>>2]&-8)-b|0,k=g>>>0<p>>>0,r=u,d=k?u:d,p=k?g:p}if(r=d,i=c[4048]|0,r>>>0<i>>>0)return au(),0;if(e=r+b|0,m=e,r>>>0>=e>>>0)return au(),0;e=c[d+24>>2]|0,f=c[d+12>>2]|0;do{if((f|0)==(d|0)){if(q=d+20|0,g=c[q>>2]|0,(g|0)==0){if(k=d+16|0,l=c[k>>2]|0,(l|0)==0){v=0;break}w=l,x=k}else w=g,x=q;for(;;)if(q=w+20|0,g=c[q>>2]|0,(g|0)==0){if(q=w+16|0,g=c[q>>2]|0,(g|0)==0)break;w=g,x=q}else w=g,x=q;if(x>>>0<i>>>0)return au(),0;c[x>>2]=0,v=w;break}if(q=c[d+8>>2]|0,q>>>0<i>>>0)return au(),0;if(g=q+12|0,(c[g>>2]|0)!=(d|0))return au(),0;
\ No newline at end of file
+module._free(pPicId),module._free(pIsIdrPic),module._free(pNumErrMbs);var outputSizeMB=this.outputSizeMB(),outputLength=16*outputSizeMB.width*outputSizeMB.height*16*4,outputBytes=new Uint8Array(module.HEAPU8.subarray(pBytes,pBytes+outputLength));return outputBytes},H264bsdDecoder.prototype.outputSizeMB=function(){var module=this.module,pStorage=this.pStorage,width=module._h264bsdPicWidth(pStorage),height=module._h264bsdPicHeight(pStorage);return{width:width,height:height}},H264bsdDecoder.prototype.croppingInfo=function(){var module=this.module,pStorage=this.pStorage,pCroppingFlag=self.malloc_(4),pLeftOffset=self.malloc_(4),pWidth=self.malloc_(4),pTopOffset=self.malloc_(4),pHeight=self.malloc_(4);module._h264bsdCroppingParams(pStorage,pCroppingFlag,pLeftOffset,pWidth,pTopOffset,pHeight);var croppingFlag=self.Module.getValue(pCroppingFlag,"i32"),leftOffset=self.Module.getValue(pLeftOffset,"i32"),width=self.Module.getValue(pWidth,"i32"),topOffset=self.Module.getValue(pTopOffset,"i32"),height=self.Module.getValue(pHeight,"i32");return module._free(pCroppingFlag),module._free(pLeftOffset),module._free(pWidth),module._free(pTopOffset),module._free(pHeight),0===croppingFlag?null:{width:width,height:height,top:topOffset,left:leftOffset}},H264bsdCanvas.prototype.initContextGL=function(){for(var canvas=this.canvasElement,gl=null,validContextNames=["webgl","experimental-webgl","moz-webgl","webkit-3d"],nameIndex=0;!gl&&nameIndex<validContextNames.length;){var contextName=validContextNames[nameIndex];try{gl=canvas.getContext(contextName)}catch(e){gl=null}gl&&"function"==typeof gl.getParameter||(gl=null),++nameIndex}this.contextGL=gl},H264bsdCanvas.prototype.initProgram=function(){var gl=this.contextGL,vertexShaderScript=["attribute vec4 vertexPos;","attribute vec4 texturePos;","varying vec2 textureCoord;","void main()","{","gl_Position = vertexPos;","textureCoord = texturePos.xy;","}"].join("\n"),fragmentShaderScript=["precision highp float;","varying highp vec2 textureCoord;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","const mat4 YUV2RGB = mat4","(","1.1643828125, 0, 1.59602734375, -.87078515625,","1.1643828125, -.39176171875, -.81296875, .52959375,","1.1643828125, 2.017234375, 0, -1.081390625,","0, 0, 0, 1",");","void main(void) {","highp float y = texture2D(ySampler, textureCoord).r;","highp float u = texture2D(uSampler, textureCoord).r;","highp float v = texture2D(vSampler, textureCoord).r;","gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;","}"].join("\n"),vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,vertexShaderScript),gl.compileShader(vertexShader),gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)||console.log("Vertex shader failed to compile: "+gl.getShaderInfoLog(vertexShader));var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,fragmentShaderScript),gl.compileShader(fragmentShader),gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)||console.log("Fragment shader failed to compile: "+gl.getShaderInfoLog(fragmentShader));var program=gl.createProgram();gl.attachShader(program,vertexShader),gl.attachShader(program,fragmentShader),gl.linkProgram(program),gl.getProgramParameter(program,gl.LINK_STATUS)||console.log("Program failed to compile: "+gl.getProgramInfoLog(program)),gl.useProgram(program),this.shaderProgram=program},H264bsdCanvas.prototype.initBuffers=function(){var gl=this.contextGL,program=this.shaderProgram,vertexPosBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,vertexPosBuffer),gl.bufferData(gl.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),gl.STATIC_DRAW);var vertexPosRef=gl.getAttribLocation(program,"vertexPos");gl.enableVertexAttribArray(vertexPosRef),gl.vertexAttribPointer(vertexPosRef,2,gl.FLOAT,!1,0,0);var texturePosBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,texturePosBuffer),gl.bufferData(gl.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),gl.STATIC_DRAW);var texturePosRef=gl.getAttribLocation(program,"texturePos");gl.enableVertexAttribArray(texturePosRef),gl.vertexAttr
\ No newline at end of file
--- a/js/h264bsd_decoder.js
+++ b/js/h264bsd_decoder.js
@@ -129,7 +129,7 @@
* Pictures can be accessed using nextOutputPicture() or nextOutputPictureRGBA()
* decode() will return H264bsdDecoder.NO_INPUT when there is no more data to be decoded.
*/
-H264bsdDecoder.prototype.decode = function(picId) {
+H264bsdDecoder.prototype.decode = function() {
var module = this.module;
var pStorage = this.pStorage;
var pInput = this.pInput;
--- a/js/package.json
+++ /dev/null
@@ -1,16 +1,0 @@
-{
- "name": "h264bsd_dist_builder",
- "description": "Minifies and concatenates all of the files needed for H264Bsd.js",
- "version": "0.0.1",
- "private": true,
- "author": {
- "name": "Chris Jarabek",
- "email": "[email protected]"
- },
- "dependencies": {
- "grunt" : "*",
- "grunt-contrib-uglify": "*",
- "grunt-contrib-clean": "*"
- },
- "title": "H264BSD"
-}
--- a/js/sylvester.js
+++ /dev/null
@@ -1,1 +1,0 @@
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9 17={3i:\'0.1.3\',16:1e-6};l v(){}v.23={e:l(i){8(i<1||i>7.4.q)?w:7.4[i-1]},2R:l(){8 7.4.q},1u:l(){8 F.1x(7.2u(7))},24:l(a){9 n=7.4.q;9 V=a.4||a;o(n!=V.q){8 1L}J{o(F.13(7.4[n-1]-V[n-1])>17.16){8 1L}}H(--n);8 2x},1q:l(){8 v.u(7.4)},1b:l(a){9 b=[];7.28(l(x,i){b.19(a(x,i))});8 v.u(b)},28:l(a){9 n=7.4.q,k=n,i;J{i=k-n;a(7.4[i],i+1)}H(--n)},2q:l(){9 r=7.1u();o(r===0){8 7.1q()}8 7.1b(l(x){8 x/r})},1C:l(a){9 V=a.4||a;9 n=7.4.q,k=n,i;o(n!=V.q){8 w}9 b=0,1D=0,1F=0;7.28(l(x,i){b+=x*V[i-1];1D+=x*x;1F+=V[i-1]*V[i-1]});1D=F.1x(1D);1F=F.1x(1F);o(1D*1F===0){8 w}9 c=b/(1D*1F);o(c<-1){c=-1}o(c>1){c=1}8 F.37(c)},1m:l(a){9 b=7.1C(a);8(b===w)?w:(b<=17.16)},34:l(a){9 b=7.1C(a);8(b===w)?w:(F.13(b-F.1A)<=17.16)},2k:l(a){9 b=7.2u(a);8(b===w)?w:(F.13(b)<=17.16)},2j:l(a){9 V=a.4||a;o(7.4.q!=V.q){8 w}8 7.1b(l(x,i){8 x+V[i-1]})},2C:l(a){9 V=a.4||a;o(7.4.q!=V.q){8 w}8 7.1b(l(x,i){8 x-V[i-1]})},22:l(k){8 7.1b(l(x){8 x*k})},x:l(k){8 7.22(k)},2u:l(a){9 V=a.4||a;9 i,2g=0,n=7.4.q;o(n!=V.q){8 w}J{2g+=7.4[n-1]*V[n-1]}H(--n);8 2g},2f:l(a){9 B=a.4||a;o(7.4.q!=3||B.q!=3){8 w}9 A=7.4;8 v.u([(A[1]*B[2])-(A[2]*B[1]),(A[2]*B[0])-(A[0]*B[2]),(A[0]*B[1])-(A[1]*B[0])])},2A:l(){9 m=0,n=7.4.q,k=n,i;J{i=k-n;o(F.13(7.4[i])>F.13(m)){m=7.4[i]}}H(--n);8 m},2Z:l(x){9 a=w,n=7.4.q,k=n,i;J{i=k-n;o(a===w&&7.4[i]==x){a=i+1}}H(--n);8 a},3g:l(){8 S.2X(7.4)},2d:l(){8 7.1b(l(x){8 F.2d(x)})},2V:l(x){8 7.1b(l(y){8(F.13(y-x)<=17.16)?x:y})},1o:l(a){o(a.K){8 a.1o(7)}9 V=a.4||a;o(V.q!=7.4.q){8 w}9 b=0,2b;7.28(l(x,i){2b=x-V[i-1];b+=2b*2b});8 F.1x(b)},3a:l(a){8 a.1h(7)},2T:l(a){8 a.1h(7)},1V:l(t,a){9 V,R,x,y,z;2S(7.4.q){27 2:V=a.4||a;o(V.q!=2){8 w}R=S.1R(t).4;x=7.4[0]-V[0];y=7.4[1]-V[1];8 v.u([V[0]+R[0][0]*x+R[0][1]*y,V[1]+R[1][0]*x+R[1][1]*y]);1I;27 3:o(!a.U){8 w}9 C=a.1r(7).4;R=S.1R(t,a.U).4;x=7.4[0]-C[0];y=7.4[1]-C[1];z=7.4[2]-C[2];8 v.u([C[0]+R[0][0]*x+R[0][1]*y+R[0][2]*z,C[1]+R[1][0]*x+R[1][1]*y+R[1][2]*z,C[2]+R[2][0]*x+R[2][1]*y+R[2][2]*z]);1I;2P:8 w}},1t:l(a){o(a.K){9 P=7.4.2O();9 C=a.1r(P).4;8 v.u([C[0]+(C[0]-P[0]),C[1]+(C[1]-P[1]),C[2]+(C[2]-(P[2]||0))])}1d{9 Q=a.4||a;o(7.4.q!=Q.q){8 w}8 7.1b(l(x,i){8 Q[i-1]+(Q[i-1]-x)})}},1N:l(){9 V=7.1q();2S(V.4.q){27 3:1I;27 2:V.4.19(0);1I;2P:8 w}8 V},2n:l(){8\'[\'+7.4.2K(\', \')+\']\'},26:l(a){7.4=(a.4||a).2O();8 7}};v.u=l(a){9 V=25 v();8 V.26(a)};v.i=v.u([1,0,0]);v.j=v.u([0,1,0]);v.k=v.u([0,0,1]);v.2J=l(n){9 a=[];J{a.19(F.2F())}H(--n);8 v.u(a)};v.1j=l(n){9 a=[];J{a.19(0)}H(--n);8 v.u(a)};l S(){}S.23={e:l(i,j){o(i<1||i>7.4.q||j<1||j>7.4[0].q){8 w}8 7.4[i-1][j-1]},33:l(i){o(i>7.4.q){8 w}8 v.u(7.4[i-1])},2E:l(j){o(j>7.4[0].q){8 w}9 a=[],n=7.4.q,k=n,i;J{i=k-n;a.19(7.4[i][j-1])}H(--n);8 v.u(a)},2R:l(){8{2D:7.4.q,1p:7.4[0].q}},2D:l(){8 7.4.q},1p:l(){8 7.4[0].q},24:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(7.4.q!=M.q||7.4[0].q!=M[0].q){8 1L}9 b=7.4.q,15=b,i,G,10=7.4[0].q,j;J{i=15-b;G=10;J{j=10-G;o(F.13(7.4[i][j]-M[i][j])>17.16){8 1L}}H(--G)}H(--b);8 2x},1q:l(){8 S.u(7.4)},1b:l(a){9 b=[],12=7.4.q,15=12,i,G,10=7.4[0].q,j;J{i=15-12;G=10;b[i]=[];J{j=10-G;b[i][j]=a(7.4[i][j],i+1,j+1)}H(--G)}H(--12);8 S.u(b)},2i:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}8(7.4.q==M.q&&7.4[0].q==M[0].q)},2j:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2i(M)){8 w}8 7.1b(l(x,i,j){8 x+M[i-1][j-1]})},2C:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2i(M)){8 w}8 7.1b(l(x,i,j){8 x-M[i-1][j-1]})},2B:l(a){9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}8(7.4[0].q==M.q)},22:l(a){o(!a.4){8 7.1b(l(x){8 x*a})}9 b=a.1u?2x:1L;9 M=a.4||a;o(1g(M[0][0])==\'1f\'){M=S.u(M).4}o(!7.2B(M)){8 w}9 d=7.4.q,15=d,i,G,10=M[0].q,j;9 e=7.4[0].q,4=[],21,20,c;J{i=15-d;4[i]=[];G=10;J{j=10-G;21=0;20=e;J{c=e-20;21+=7.4[i][c]*M[c][j]}H(--20);4[i][j]=21}H(--G)}H(--d);9 M=S.u(4);8 b?M.2E(1):M},x:l(a){8 7.22(a)},32:l(a,b,c,d){9 e=[],12=c,i,G,j;9 f=7.4.q,1p=7.4
\ No newline at end of file
--- a/js/util.js
+++ /dev/null
@@ -1,69 +1,0 @@
-function error(message) {
- console.error(message);
- console.trace();
-}
-
-function assert(condition, message) {
- if (!condition) {
- error(message);
- }
-}
-
-function isPowerOfTwo(x) {
- return (x & (x - 1)) == 0;
-}
-
-/**
- * Joins a list of lines using a newline separator, not the fastest
- * thing in the world but good enough for initialization code.
- */
-function text(lines) {
- return lines.join("\n");
-}
-
-/**
- * Rounds up to the next highest power of two.
- */
-function nextHighestPowerOfTwo(x) {
- --x;
- for (var i = 1; i < 32; i <<= 1) {
- x = x | x >> i;
- }
- return x + 1;
-}
-
-/**
- * Represents a 2-dimensional size value.
- */
-var Size = (function size() {
- function constructor(w, h) {
- this.w = w;
- this.h = h;
- }
- constructor.prototype = {
- toString: function () {
- return "(" + this.w + ", " + this.h + ")";
- },
- getHalfSize: function() {
- return new Size(this.w >>> 1, this.h >>> 1);
- },
- length: function() {
- return this.w * this.h;
- }
- }
- return constructor;
-})();
-
-/**
- * Creates a new prototype object derived from another objects prototype along with a list of additional properties.
- *
- * @param base object whose prototype to use as the created prototype object's prototype
- * @param properties additional properties to add to the created prototype object
- */
-function inherit(base, properties) {
- var prot = Object.create(base.prototype);
- for (var p in properties) {
- prot[p] = properties[p];
- }
- return prot;
-}
\ No newline at end of file
--- a/test/h264bsd.html
+++ b/test/h264bsd.html
@@ -14,7 +14,7 @@
<script src="../js/h264bsd_decoder.js"></script>
<script src="../js/h264bsd_canvas.js"></script>
- <!--<script src="../js/dist/h264bsd.min.js"></script>-->
+ <!--<script src="../js/h264bsd.min.js"></script>-->
<script type="text/javascript">
var canvas = document.getElementById('canvas');