Skip to content
Brion Vibber edited this page Mar 6, 2014 · 1 revision
  1. Device specs
  • SoC: Nvidia Tegra 3
  • CPU ISA: armv7
  • CPU cores: 4, max 1.30 GHz
  • OS: Windows RT 8.1
  • Browser: Internet Explorer 11
  1. Browser features
  • Uint8ClampedArray: no
  • Uint32Array view on top of CanvasImageData buffer: no
  • Web audio: no (uses Flash fallback)
  • WebGL: yes (test me)
  • Workers: yes (test me)
  • Transferable: yes BUT does not work for ArrayBuffer!
  1. Status

Currently everything runs on the UI thread and maxes out one of 4 CPU cores with unacceptable performance. Colorspace conversion and drawing are slowed down by the limited old CanvasPixelArray interface, which on other browsers is replaced by Uint8ClampedArray which integrates with Arraybuffer.

Moving colorspace conversion and drawing to WebGL could significantly reduce total CPU usage. Maik made some tests with Broadway.js’s WebGL surface but had some errors, there may be unimplemented required features. :(

In the meantime, have sped up the colorspace conversion by doing it in the drawing phase so we can poke directly into the CanvasPixelArray and don’t have to replicate the clamped Uint8 logic in a function. Speeding up the copy of YUV data out of the heap a little by using a 32-bit array for the copy, on the assumption that width*height (full and decimated) is always a multiple of 4.

Moving decoding to a worker should help distribute CPU usage between cores slightly better. Full multi-core decoding would make much better use of the CPU cores but may not be feasible in the emscripten model… decoder-work branch attempts to move the entire decoder to a worker, leaving the YUV conversion in the foreground. Not getting clear results yet, need better smoothness metrics.

Audio output via Flash shim is working pretty great now, though A/V sync is flaky on even 160p on this device (sync is great on faster machines running Windows 8 x64).

  1. Testing

CPU usage can be measured by firing up ‘Task Manager’ on the Windows RT desktop. Note that the F12 Developer Tools are only available in the desktop version of Internet Explorer.