Repository navigation
emberwave v0.10.0
More for Metal clients: the Y, Cb and Cr planes in textures, the fastest way to the GPU; the RGB picture into textures with a copy rather than a draw; and decoding on the client's own queue, which needs no wait and one texture.
Added
- The Y, Cb and Cr planes in textures, for Metal clients that convert the colours themselves (decision D41, #64).
emberwave_texture_create_planemakes a one-channel texture (MTLPixelFormatR8Unorm) of one plane's size, for that plane.emberwave_decoder_decode_plane_texturescopies the planes of the frame into three of them and waits. They hold the stream's samples, byte for byte.- The fastest way to the GPU: on an Apple M3 Max a 4K frame takes 1.0 to 1.1 ms, against 1.3 to 1.4 ms into an RGB texture, and a 1080p frame 0.45 ms against 0.56 ms. In 4:2:0 they take 1.5 bytes a pixel, where RGBA takes 4.
- In Rust,
Decoder::encode_to_plane_textures,decode_assembled_to_plane_texturesandcreate_plane_texture, andPLANE_FORMAT.
- Decoding on the Metal client's own queue, without waiting (decision D43, #62, #63).
emberwave_context_create_metalmakes a context on the client'sid<MTLDevice>andid<MTLCommandQueue>.- On it,
emberwave_decoder_submit_textureandemberwave_decoder_submit_plane_texturesreturn once the work is on the queue. Metal runs the client's command buffers committed afterwards after the decode, and the next decode after them, so one texture takes every frame. - On an Apple M3 Max a 4K frame takes the decoding thread 0.26 ms instead of 1.3 ms, and the client's draw completes as early as after the waiting decode, at 1080p 0.1 ms earlier.
- In Rust,
Decoder::submit_assembled_to_textureandsubmit_assembled_to_plane_textures, andGpuContext::device_descriptorandfrom_devicefor a context on a device made elsewhere.
Changed
- A decoder's packed planes have rows of a multiple of 256 bytes, so that copies take them into textures: 7% more memory for them at 1080p, and as much more to read back to the CPU.
- The RGB picture goes into a texture with a copy, not a draw, when the texture takes copies (
COPY_DST) and the picture's width is a multiple of 64 pixels, as 720p, 1080p, 1440p and 4K are (decision D42, #70). The colour conversion writes blue first for a BGRA texture. On an Apple M3 Max a 4K frame into a texture through the C API takes 1.3 to 1.4 ms instead of 1.5 ms, and a 1080p frame 0.56 ms instead of 0.71 ms. The textures ofemberwave_texture_createandDecoder::create_texturetake copies. The browser player still draws its canvas, as wgpu offers no copies into one.