videoWorkerTrain.worker.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. ! function(t) {
  2. var e = {};
  3. function r(n) { if (e[n]) return e[n].exports; var a = e[n] = { i: n, l: !1, exports: {} }; return t[n].call(a.exports, a, a.exports, r), a.l = !0, a.exports }
  4. r.m = t, r.c = e, r.d = function(t, e, n) { r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }) }, r.r = function(t) { "undefined" !== typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) }, r.t = function(t, e) {
  5. if (1 & e && (t = r(t)), 8 & e) return t;
  6. if (4 & e && "object" === typeof t && t && t.__esModule) return t;
  7. var n = Object.create(null);
  8. if (r.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t)
  9. for (var a in t) r.d(n, a, function(e) { return t[e] }.bind(null, a));
  10. return n
  11. }, r.n = function(t) { var e = t && t.__esModule ? function() { return t.default } : function() { return t }; return r.d(e, "a", e), e }, r.o = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, r.p = "", r(r.s = 0)
  12. }([function(t, e, r) {
  13. "use strict";
  14. function n(t) { return (n = "function" === typeof Symbol && "symbol" === typeof Symbol.iterator ? function(t) { return typeof t } : function(t) { return t && "function" === typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t })(t) }
  15. if (r.r(e), "undefined" == typeof a) var a = {};
  16. a.MD5 = function(t) {
  17. function e(t) { var e = (t >>> 0).toString(16); return "00000000".substr(0, 8 - e.length) + e }
  18. function r(t, e, r) { return t & e | ~t & r }
  19. function a(t, e, r) { return r & t | ~r & e }
  20. function i(t, e, r) { return t ^ e ^ r }
  21. function o(t, e, r) { return e ^ (t | ~r) }
  22. function _(t, e) { return t[e + 3] << 24 | t[e + 2] << 16 | t[e + 1] << 8 | t[e] }
  23. function u(t) {
  24. for (var e = [], r = 0; r < t.length; r++)
  25. if (t.charCodeAt(r) <= 127) e.push(t.charCodeAt(r));
  26. else
  27. for (var n = encodeURIComponent(t.charAt(r)).substr(1).split("%"), a = 0; a < n.length; a++) e.push(parseInt(n[a], 16));
  28. return e
  29. }
  30. function f(t) { for (var e = new Array(t.length), r = 0; r < t.length; r++) e[r] = t[r]; return e }
  31. var p = null,
  32. c = null;
  33. function s(t, e) { return 4294967295 & t + e }
  34. return "string" == typeof t ? p = u(t) : t.constructor == Array ? 0 === t.length ? p = t : "string" == typeof t[0] ? p = function(t) { for (var e = [], r = 0; r < t.length; r++) e = e.concat(u(t[r])); return e }(t) : "number" == typeof t[0] ? p = t : c = n(t[0]) : "undefined" != typeof ArrayBuffer ? t instanceof ArrayBuffer ? p = f(new Uint8Array(t)) : t instanceof Uint8Array || t instanceof Int8Array ? p = f(t) : t instanceof Uint32Array || t instanceof Int32Array || t instanceof Uint16Array || t instanceof Int16Array || t instanceof Float32Array || t instanceof Float64Array ? p = f(new Uint8Array(t.buffer)) : c = n(t) : c = n(t), c && alert("MD5 type mismatch, cannot process " + c),
  35. function() {
  36. function t(t, e, r, n) {
  37. var a, i, o = v;
  38. v = y, y = h, h = s(h, (a = s(d, s(t, s(e, r)))) << (i = n) & 4294967295 | a >>> 32 - i), d = o
  39. }
  40. var n = p.length;
  41. p.push(128);
  42. var u = p.length % 64;
  43. if (u > 56) {
  44. for (var f = 0; f < 64 - u; f++) p.push(0);
  45. u = p.length % 64
  46. }
  47. for (f = 0; f < 56 - u; f++) p.push(0);
  48. p = p.concat(function(t) { for (var e = [], r = 0; r < 8; r++) e.push(255 & t), t >>>= 8; return e }(8 * n));
  49. var c = 1732584193,
  50. l = 4023233417,
  51. m = 2562383102,
  52. g = 271733878,
  53. d = 0,
  54. h = 0,
  55. y = 0,
  56. v = 0;
  57. for (f = 0; f < p.length / 64; f++) {
  58. d = c;
  59. var b = 64 * f;
  60. t(r(h = l, y = m, v = g), 3614090360, _(p, b), 7), t(r(h, y, v), 3905402710, _(p, b + 4), 12), t(r(h, y, v), 606105819, _(p, b + 8), 17), t(r(h, y, v), 3250441966, _(p, b + 12), 22), t(r(h, y, v), 4118548399, _(p, b + 16), 7), t(r(h, y, v), 1200080426, _(p, b + 20), 12), t(r(h, y, v), 2821735955, _(p, b + 24), 17), t(r(h, y, v), 4249261313, _(p, b + 28), 22), t(r(h, y, v), 1770035416, _(p, b + 32), 7), t(r(h, y, v), 2336552879, _(p, b + 36), 12), t(r(h, y, v), 4294925233, _(p, b + 40), 17), t(r(h, y, v), 2304563134, _(p, b + 44), 22), t(r(h, y, v), 1804603682, _(p, b + 48), 7), t(r(h, y, v), 4254626195, _(p, b + 52), 12), t(r(h, y, v), 2792965006, _(p, b + 56), 17), t(r(h, y, v), 1236535329, _(p, b + 60), 22), t(a(h, y, v), 4129170786, _(p, b + 4), 5), t(a(h, y, v), 3225465664, _(p, b + 24), 9), t(a(h, y, v), 643717713, _(p, b + 44), 14), t(a(h, y, v), 3921069994, _(p, b), 20), t(a(h, y, v), 3593408605, _(p, b + 20), 5), t(a(h, y, v), 38016083, _(p, b + 40), 9), t(a(h, y, v), 3634488961, _(p, b + 60), 14), t(a(h, y, v), 3889429448, _(p, b + 16), 20), t(a(h, y, v), 568446438, _(p, b + 36), 5), t(a(h, y, v), 3275163606, _(p, b + 56), 9), t(a(h, y, v), 4107603335, _(p, b + 12), 14), t(a(h, y, v), 1163531501, _(p, b + 32), 20), t(a(h, y, v), 2850285829, _(p, b + 52), 5), t(a(h, y, v), 4243563512, _(p, b + 8), 9), t(a(h, y, v), 1735328473, _(p, b + 28), 14), t(a(h, y, v), 2368359562, _(p, b + 48), 20), t(i(h, y, v), 4294588738, _(p, b + 20), 4), t(i(h, y, v), 2272392833, _(p, b + 32), 11), t(i(h, y, v), 1839030562, _(p, b + 44), 16), t(i(h, y, v), 4259657740, _(p, b + 56), 23), t(i(h, y, v), 2763975236, _(p, b + 4), 4), t(i(h, y, v), 1272893353, _(p, b + 16), 11), t(i(h, y, v), 4139469664, _(p, b + 28), 16), t(i(h, y, v), 3200236656, _(p, b + 40), 23), t(i(h, y, v), 681279174, _(p, b + 52), 4), t(i(h, y, v), 3936430074, _(p, b), 11), t(i(h, y, v), 3572445317, _(p, b + 12), 16), t(i(h, y, v), 76029189, _(p, b + 24), 23), t(i(h, y, v), 3654602809, _(p, b + 36), 4), t(i(h, y, v), 3873151461, _(p, b + 48), 11), t(i(h, y, v), 530742520, _(p, b + 60), 16), t(i(h, y, v), 3299628645, _(p, b + 8), 23), t(o(h, y, v), 4096336452, _(p, b), 6), t(o(h, y, v), 1126891415, _(p, b + 28), 10), t(o(h, y, v), 2878612391, _(p, b + 56), 15), t(o(h, y, v), 4237533241, _(p, b + 20), 21), t(o(h, y, v), 1700485571, _(p, b + 48), 6), t(o(h, y, v), 2399980690, _(p, b + 12), 10), t(o(h, y, v), 4293915773, _(p, b + 40), 15), t(o(h, y, v), 2240044497, _(p, b + 4), 21), t(o(h, y, v), 1873313359, _(p, b + 32), 6), t(o(h, y, v), 4264355552, _(p, b + 60), 10), t(o(h, y, v), 2734768916, _(p, b + 24), 15), t(o(h, y, v), 1309151649, _(p, b + 52), 21), t(o(h, y, v), 4149444226, _(p, b + 16), 6), t(o(h, y, v), 3174756917, _(p, b + 44), 10), t(o(h, y, v), 718787259, _(p, b + 8), 15), t(o(h, y, v), 3951481745, _(p, b + 36), 21), c = s(c, d), l = s(l, h), m = s(m, y), g = s(g, v)
  61. }
  62. return function(t, r, n, a) { for (var i = "", o = 0, _ = 0, u = 3; u >= 0; u--) o = 255 & (_ = arguments[u]), o <<= 8, o |= 255 & (_ >>>= 8), o <<= 8, o |= 255 & (_ >>>= 8), o <<= 8, i += e(o |= _ >>>= 8); return i }(g, m, l, c).toUpperCase()
  63. }()
  64. };
  65. var i = { log: function() {}, error: function() {}, count: function() {}, info: function() {} };
  66. (function() {
  67. function t() {}
  68. t.createFromElementId = function(e) { for (var r = document.getElementById(e), n = "", a = r.firstChild; a;) 3 === a.nodeType && (n += a.textContent), a = a.nextSibling; var i = new t; return i.type = r.type, i.source = n, i }, t.createFromSource = function(e, r) { var n = new t; return n.type = e, n.source = r, n }
  69. })(),
  70. function() {
  71. function t(t) { this.gl = t, this.program = this.gl.createProgram() }
  72. t.prototype = {
  73. attach: function(t) { this.gl.attachShader(this.program, t.shader) },
  74. link: function() { this.gl.linkProgram(this.program) },
  75. use: function() { this.gl.useProgram(this.program) },
  76. getAttributeLocation: function(t) { return this.gl.getAttribLocation(this.program, t) },
  77. setMatrixUniform: function(t, e) {
  78. var r = this.gl.getUniformLocation(this.program, t);
  79. this.gl.uniformMatrix4fv(r, !1, e)
  80. }
  81. }
  82. }(),
  83. function() {
  84. var t = null;
  85. function e(t, e, r) { this.gl = t, this.size = e, this.texture = t.createTexture(), t.bindTexture(t.TEXTURE_2D, this.texture), this.format = r || t.LUMINANCE, t.texImage2D(t.TEXTURE_2D, 0, this.format, e.w, e.h, 0, this.format, t.UNSIGNED_BYTE, null), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.NEAREST), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.NEAREST), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE) }
  86. e.prototype = {
  87. fill: function(t, e) {
  88. var r = this.gl;
  89. r.bindTexture(r.TEXTURE_2D, this.texture), e ? r.texSubImage2D(r.TEXTURE_2D, 0, 0, 0, this.size.w, this.size.h, this.format, r.UNSIGNED_BYTE, t) : r.texImage2D(r.TEXTURE_2D, 0, this.format, this.size.w, this.size.h, 0, this.format, r.UNSIGNED_BYTE, t)
  90. },
  91. bind: function(e, r, n) {
  92. var a = this.gl;
  93. t || (t = [a.TEXTURE0, a.TEXTURE1, a.TEXTURE2]), a.activeTexture(t[e]), a.bindTexture(a.TEXTURE_2D, this.texture), a.uniform1i(a.getUniformLocation(r.program, n), e)
  94. }
  95. }
  96. }();
  97. var o = function() { this.map = {} };
  98. o.prototype = {
  99. put: function(t, e) { this.map[t] = e },
  100. get: function(t) { return this.map[t] },
  101. containsKey: function(t) { return t in this.map },
  102. containsValue: function(t) {
  103. for (var e in this.map)
  104. if (this.map[e] === t) return !0;
  105. return !1
  106. },
  107. isEmpty: function(t) { return 0 === this.size() },
  108. clear: function() { for (var t in this.map) delete this.map[t] },
  109. remove: function(t) { delete this.map[t] },
  110. keys: function() { var t = new Array; for (var e in this.map) t.push(e); return t },
  111. values: function() { var t = new Array; for (var e in this.map) t.push(this.map[e]); return t },
  112. size: function() { var t = 0; for (var e in this.map) t++; return t }
  113. };
  114. var _ = o;
  115. var u = function() {
  116. var t, e, r, n, a, o, _, u, f, p = null,
  117. c = new Uint8Array,
  118. s = !1;
  119. function l() { p = Module._OpenDecoder(0, 0, 0), l.prototype.setIsFirstFrame(!1) }
  120. return l.prototype = { init: function() { i.log("H264 Decoder init") }, setOutputSize: function(t) { u != 1.5 * t && (u = 1.5 * t, f = Module._malloc(u), c = new Uint8Array(Module.HEAPU8.buffer, f, u)) }, decode: function(i, f) { if (t = Date.now(), e = new Uint8Array(i), c.set(e), r = Module._FrameAlloc(), Module._DecodeFrame(p, c.byteOffset, i.byteLength, u, r), n = Date.now() - t, o = Module._getYLength(r), a = Module._getHeight(r), !l.prototype.isFirstFrame()) return l.prototype.setIsFirstFrame(!0), { firstFrame: !0 }; if (o > 0 && a > 0) { t = Date.now(); var s = new Uint8Array(c); return _ = { data: s, option: { yaddr: Module._getY(r), uaddr: Module._getU(r), vaddr: Module._getV(r), ylen: o, height: a, beforeDecoding: t }, width: o, height: a, codecType: "h264", decodingTime: n, frameType: f }, Module._FrameFree(r), _ } }, setIsFirstFrame: function(t) { s = t }, isFirstFrame: function() { return s }, free: function() { Module._free(f), f = null } }, new l
  121. };
  122. importScripts("./../module/ffmpegasm.js"), addEventListener("message", function(t) {
  123. var e = t.data;
  124. switch (p = t.data.channelId, e.type) {
  125. case "MediaData":
  126. null === f && (f = new s), e.data.rtspInterleave[1], f.parseRTPData(e.data.payload)
  127. }
  128. }, !1), Module.onRuntimeInitialized = function() { Module._RegisterAll(), c("WorkerReady") };
  129. var f = null,
  130. p = null;
  131. function c(t, e, r) { var n = { type: t, data: e, channelId: p, option: r }; "canvasRender" === t ? postMessage(n, [e.buffer]) : postMessage(n) }
  132. var s = function() {
  133. var t = new l,
  134. e = 0,
  135. r = null;
  136. function n() { this.decoder = new u }
  137. return n.prototype = {
  138. init: function(t) {},
  139. parseRTPData: function(n) {
  140. var a = null,
  141. i = {},
  142. o = n[22],
  143. _ = (n[11] << 24) + (n[10] << 16) + (n[9] << 8) + n[8] >>> 0,
  144. u = n.subarray(24 + o, n.length - 8),
  145. f = n.subarray(n.length - 8, n.length),
  146. p = (f[7], f[6], f[5], f[4], (n[19] << 24) + (n[18] << 16) + (n[17] << 8) + n[16] >>> 0),
  147. s = Date.UTC("20" + (p >>> 26), (p >>> 22 & 15) - 1, p >>> 17 & 31, p >>> 12 & 31, p >>> 6 & 63, 63 & p) / 1e3,
  148. l = [];
  149. s += (new Date).getTimezoneOffset() / 60 * 3600;
  150. for (var m = 0; m <= u.length;)
  151. if (0 == u[m])
  152. if (0 == u[m + 1])
  153. if (1 == u[m + 2]) { if (l.push(m), 5 == (31 & u[m += 3]) || 1 == (31 & u[m])) break } else 0 == u[m + 2] ? m++ : m += 3;
  154. else m += 2;
  155. else m += 1;
  156. for (m = 0; m < l.length; m++) switch (a = u.subarray(l[m] + 3, l[m + 1]), 31 & u[l[m] + 3]) {
  157. default: break;
  158. case 1:
  159. "P",
  160. l[m] - 1;
  161. break;
  162. case 5:
  163. "I",
  164. l[m] - 1;
  165. break;
  166. case 28:
  167. break;
  168. case 7:
  169. t.parse(a),
  170. r = t.getSizeInfo().decodeSize;
  171. break;
  172. case 8:
  173. case 6:
  174. case 9:
  175. }
  176. e !== r && (this.decoder.free(), e = r, this.decoder.setOutputSize(e)), i.frameData = null, i.frameData = this.decoder.decode(u), null != i.frameData && null != i.frameData.data && (i.frameData.option.time = s, i.frameData.option.frameNo = _, c("canvasRender", i.frameData.data, i.frameData.option))
  177. }
  178. }, new n
  179. };
  180. function l() {
  181. var t = 7,
  182. e = 7,
  183. r = 2,
  184. n = 3,
  185. a = 4,
  186. i = 5,
  187. o = 8,
  188. u = 16,
  189. f = 32,
  190. p = 255,
  191. c = 0,
  192. s = null;
  193. function l() { c = 0, s = new _ }
  194. function m(r, a) {
  195. var i = a,
  196. o = c + i >> n;
  197. return i = c + a & t, r[o] >> e - (i & e) & 1
  198. }
  199. function g(t, e) {
  200. var r = c >> n,
  201. a = 8 * (r + 1) - c;
  202. if (a < 8)
  203. for (var i = 0; i < 3; i++) {
  204. var o = t[r + i];
  205. o = 0 == i ? o >> a << a : 2 == i ? o & 255 >> 8 - a | 1 << a : 0, t.set([o], r + i)
  206. } else t.set([0], r), t.set([1], r + 1)
  207. }
  208. function d(t, e) {
  209. var r = 0;
  210. if (1 === e) r = m(t, 0);
  211. else
  212. for (var n = 0; n < e; n++) r = (r << 1) + m(t, n);
  213. return c += e, r
  214. }
  215. function h(t, e) {
  216. for (var n = 0, a = 0, i = e; c + i < 8 * t.length && !m(t, i++);) n++;
  217. if (0 === n) return c += 1, 0;
  218. a = 1 << n;
  219. for (var o = n - 1; o >= 0; o--, i++) a |= m(t, i) << o;
  220. return c += n * r + 1, a - 1
  221. }
  222. function y(t, e) { var n = h(t, e); return 1 & n ? (n + 1) / r : -n / r }
  223. function v(t) {
  224. s.put("cpb_cnt_minus1", h(t, 0)), s.put("bit_rate_scale", d(t, a)), s.put("cpb_size_scale", d(t, a));
  225. for (var e = s.get("cpb_cnt_minus1"), r = new Array(e), n = new Array(e), o = new Array(e), _ = 0; _ <= e; _++) r[_] = h(t, 0), n[_] = h(t, 0), o[_] = d(t, 1);
  226. s.put("bit_rate_value_minus1", r), s.put("cpb_size_value_minus1", n), s.put("cbr_flag", o), s.put("initial_cpb_removal_delay_length_minus1", d(t, i)), s.put("cpb_removal_delay_length_minus1", d(t, i)), s.put("dpb_output_delay_length_minus1", d(t, i)), s.put("time_offset_length", d(t, i))
  227. }
  228. return l.prototype = {
  229. parse: function(t) {
  230. c = 0, s.clear(), s.put("forbidden_zero_bit", d(t, 1)), s.put("nal_ref_idc", d(t, r)), s.put("nal_unit_type", d(t, i)), s.put("profile_idc", d(t, o)), s.put("profile_compatibility", d(t, o)), s.put("level_idc", d(t, o)), s.put("seq_parameter_set_id", h(t, 0));
  231. var e = s.get("profile_idc");
  232. if ((100 === e || 110 === e || 122 === e || 244 === e || 44 === e || 83 === e || 86 === e || 118 === e || 128 === e || 138 === e || 139 === e || 134 === e) && (s.put("chroma_format_idc", h(t, 0)), s.get("chroma_format_idc") === n && s.put("separate_colour_plane_flag", d(t, 1)), s.put("bit_depth_luma_minus8", h(t, 0)), s.put("bit_depth_chroma_minus8", h(t, 0)), s.put("qpprime_y_zero_transform_bypass_flag", d(t, 1)), s.put("seq_scaling_matrix_present_flag", d(t, 1)), s.get("seq_scaling_matrix_present_flag"))) {
  233. for (var a = s.get("chroma_format_idc") !== n ? o : 12, _ = new Array(a), l = 0; l < a; l++)
  234. if (_[l] = d(t, 1), _[l])
  235. for (var m = l < 6 ? u : 64, b = 8, T = 8, E = 0; E < m; E++) T && (T = (b + y(t, 0) + 256) % 256), b = 0 === T ? b : T;
  236. s.put("seq_scaling_list_present_flag", _)
  237. }
  238. if (s.put("log2_max_frame_num_minus4", h(t, 0)), s.put("pic_order_cnt_type", h(t, 0)), 0 === s.get("pic_order_cnt_type")) s.put("log2_max_pic_order_cnt_lsb_minus4", h(t, 0));
  239. else if (1 === s.get("pic_order_cnt_type")) { s.put("delta_pic_order_always_zero_flag", d(t, 1)), s.put("offset_for_non_ref_pic", y(t, 0)), s.put("offset_for_top_to_bottom_field", y(t, 0)), s.put("num_ref_frames_in_pic_order_cnt_cycle", h(t, 0)); for (var w = 0; w < s.get("num_ref_frames_in_pic_order_cnt_cycle"); w++) s.put("num_ref_frames_in_pic_order_cnt_cycle", y(t, 0)) }
  240. return s.put("num_ref_frames", h(t, 0)), s.put("gaps_in_frame_num_value_allowed_flag", d(t, 1)), s.put("pic_width_in_mbs_minus1", h(t, 0)), s.put("pic_height_in_map_units_minus1", h(t, 0)), s.put("frame_mbs_only_flag", d(t, 1)), 0 === s.get("frame_mbs_only_flag") && s.put("mb_adaptive_frame_field_flag", d(t, 1)), s.put("direct_8x8_interence_flag", d(t, 1)), s.put("frame_cropping_flag", d(t, 1)), 1 === s.get("frame_cropping_flag") && (s.put("frame_cropping_rect_left_offset", h(t, 0)), s.put("frame_cropping_rect_right_offset", h(t, 0)), s.put("frame_cropping_rect_top_offset", h(t, 0)), s.put("frame_cropping_rect_bottom_offset", h(t, 0))), s.put("vui_parameters_present_flag", d(t, 1)), s.get("vui_parameters_present_flag") && function(t) { s.put("aspect_ratio_info_present_flag", d(t, 1)), s.get("aspect_ratio_info_present_flag") && (s.put("aspect_ratio_idc", d(t, o)), s.get("aspect_ratio_idc") === p && (g(t), s.put("sar_width", d(t, u)), g(t), s.put("sar_height", d(t, u)))), s.put("overscan_info_present_flag", d(t, 1)), s.get("overscan_info_present_flag") && s.put("overscan_appropriate_flag", d(t, 1)), s.put("video_signal_type_present_flag", d(t, 1)), s.get("video_signal_type_present_flag") && (s.put("video_format", d(t, n)), s.put("video_full_range_flag", d(t, 1)), s.put("colour_description_present_flag", d(t, 1)), s.get("colour_description_present_flag") && (s.put("colour_primaries", d(t, o)), s.put("transfer_characteristics", d(t, o)), s.put("matrix_coefficients", d(t, o)))), s.put("chroma_loc_info_present_flag", d(t, 1)), s.get("chroma_loc_info_present_flag") && (s.put("chroma_sample_loc_type_top_field", h(t, 0)), s.put("chroma_sample_loc_type_bottom_field", h(t, 0))), s.put("timing_info_present_flag", d(t, 1)), s.get("timing_info_present_flag") && (s.put("num_units_in_tick", d(t, f)), s.put("time_scale", d(t, f)), s.put("fixed_frame_rate_flag", d(t, 1))), s.put("nal_hrd_parameters_present_flag", d(t, 1)), s.get("nal_hrd_parameters_present_flag") && v(t), s.put("vcl_hrd_parameters_present_flag", d(t, 1)), s.get("vcl_hrd_parameters_present_flag") && v(t), (s.get("nal_hrd_parameters_present_flag") || s.get("vcl_hrd_parameters_present_flag")) && s.put("low_delay_hrd_flag", d(t, 1)), s.put("pic_struct_present_flag", d(t, 1)), s.put("bitstream_restriction_flag", d(t, 1)), s.get("bitstream_restriction_flag") && (s.put("motion_vectors_over_pic_boundaries_flag", d(t, 1)), s.put("max_bytes_per_pic_denom", h(t, 0)), s.put("max_bits_per_mb_denom", h(t, 0))) }(t), !0
  241. },
  242. getSizeInfo: function() {
  243. var t = 0,
  244. e = 0;
  245. 0 === s.get("chroma_format_idc") ? t = e = 0 : 1 === s.get("chroma_format_idc") ? t = e = r : s.get("chroma_format_idc") === r ? (t = r, e = 1) : s.get("chroma_format_idc") === n && (0 === s.get("separate_colour_plane_flag") ? t = e = 1 : 1 === s.get("separate_colour_plane_flag") && (t = e = 0));
  246. var a = s.get("pic_width_in_mbs_minus1") + 1,
  247. i = s.get("pic_height_in_map_units_minus1") + 1,
  248. o = (r - s.get("frame_mbs_only_flag")) * i,
  249. _ = 0,
  250. f = 0,
  251. p = 0,
  252. c = 0;
  253. 1 === s.get("frame_cropping_flag") && (_ = s.get("frame_cropping_rect_left_offset"), f = s.get("frame_cropping_rect_right_offset"), p = s.get("frame_cropping_rect_top_offset"), c = s.get("frame_cropping_rect_bottom_offset"));
  254. var l = a * u * (o * u);
  255. return { width: a * u - t * (_ + f), height: o * u - e * (r - s.get("frame_mbs_only_flag")) * (p + c), decodeSize: l }
  256. },
  257. getSpsValue: function(t) { return s.get(t) },
  258. getCodecInfo: function() { return s.get("profile_idc").toString(u) + (s.get("profile_compatibility") < 15 ? "0" + s.get("profile_compatibility").toString(u) : s.get("profile_compatibility").toString(u)) + s.get("level_idc").toString(u) }
  259. }, new l
  260. }
  261. }]);