Earlier quoted context omitted.
I don't know if I'm underestimating HN's reach but I doubt we did that, probably traffic from a much bigger aggregator/forum
Hacker news doesn't generate much traffic, despite what people are saying. The host here has a limit of 160000 files served each day. That is extremely low. If the site has an icon, css, a js file and a few images it's 10 files each visit. That's will limit it to 16k visits/day. If there are more files loaded it might just handle a few thousand visits, and they have received more than that from HN now.
Dav2d
121–130 of 212 posts
Re: Dav2d
#122Earlier quoted context omitted.
Encoder and decoder writers frequently need extremely fine grain control over SIMD instructions in order to get good performance. The way they weave these instructions can be very hard to express with a high level language. Further, there's a ton of work with arrays and importantly parts of arrays. They can, for example, need to extract every other element up to 1/2 the array. Unfortunately, rust has runtime array bo…
Performance should not be priority #1. Security should be. Why do we slow down all CPUs to prevent SPECTRE attacks yet continue to write in C? As rav1d shows, the perf loss is far less to migrate from C to Rust than it is to apply SPECTRE mitigations, and adding a sandbox around a memory-unsafe codec is going to be way more expensive again than using Rust code to start.
For a web browser, or a server in a bank, sure. For anything else, questionable.
> adding a sandbox around a memory-unsafe codec is going to be way more expensive
In modern world, overhead of strong sandboxes is surprisingly small. A nuclear but most reliable option is hardware assisted VM. On modern computers with SLAT and virtualized IO the overhead for most use cases is negligible. If you want something lighter weight, can use a multi-user nature of all modern OS kernels and isolate into a separate process with restricted permissions. Sandboxing overhead is approximately zero.
Re: Dav2d
#123Earlier quoted context omitted.
He only mentioned decode complexity. Would be interesting to know the average encode complexity compared to AV1.
Encoding speed even on Mac Studio is atrocious, it’s in range of single frames per second as opposed to realtime+ for even h265
Re: Dav2d
#124Not to be confused with Da4vid (world-class hacker and owner of the Black sun) or D4vd (rap artist and alleged murderer)
Re: Dav2d
#125Not to be confused with Da4vid (world-class hacker and owner of the Black sun) or D4vd (rap artist and alleged murderer)
Or Dave2D, popular tech youtuber
Re: Dav2d
#126Sorry if this sounds naive, but does it make sense to write a codec library in C/ASM considering how well Rust is progressing, especially when, as the author puts it, AV2 decoding is roughly five times more complex than AV1 decoding ?
yes it makes sense to use C/ASM here, but if you're curious, there is a rust port of dav1d named rav1d: https://github.com/memorysafety/rav1d it's not much slower than the original C/ASM implementation (last i checked ~5%?) but that matters here
I am not sure if it is that much safer than the C version when raw assembly is still required.
Re: Dav2d
#127Earlier quoted context omitted.
Intel's Arc dGPUs were really compelling for dedicated AV1 encode and decode, especially the small form factor of some cards. You could even fit it as a secondary card in a PC dedicated to recording and encode workflows for OBS. Hope we get a similar option with future lineups that support AV2, especially given how popular video creation and streaming are now.
Is there a compelling reason encoding needs to be done locally? The point of encoding is to reduce downstream bandwidth for the viewer, and upstream bandwidth for the distribution network. The content creator only needs to upload it once.
An uncompressed 1080p, 60fps video with 24-bit color depth would need around 3Gbps to be streamed. And even if you don't need to stream it, that would still consume a sizeable portion of the write throughput of the fastest SSDs currently available; if you go up to 4K, you'd actually exceed that by a lot (not to mention, 1tb of storage would last for about 10 minutes of video).
Re: Dav2d
#128Earlier quoted context omitted.
Performance should not be priority #1. Security should be. Why do we slow down all CPUs to prevent SPECTRE attacks yet continue to write in C? As rav1d shows, the perf loss is far less to migrate from C to Rust than it is to apply SPECTRE mitigations, and adding a sandbox around a memory-unsafe codec is going to be way more expensive again than using Rust code to start.
> As rav1d shows rav1d is not a full rewrite of dav1d to rust. So it really doesn't show that. It's currently C + rust + asm. I don't think we can say anything about what this does or does not prove about the performance of safe code. > Performance should not be priority #1. Security should be. Entirely depends on the application. The reason rust has `unsafe` is because there's some situations where performance needs…
Why shouldn't safety be the default? If you really want to, it wouldn't be too hard to maintain a patch on top of rustc to drop the bounds checks if you want to compile object files without them.
Software decoding has a safety culture problem, and we need to talk about it.
Re: Dav2d
#129Re: Dav2d
#130Earlier quoted context omitted.
Is there a compelling reason encoding needs to be done locally? The point of encoding is to reduce downstream bandwidth for the viewer, and upstream bandwidth for the distribution network. The content creator only needs to upload it once.
Yes. An uncompressed 1080p, 60fps video with 24-bit color depth would need around 3Gbps to be streamed. And even if you don't need to stream it, that would still consume a sizeable portion of the write throughput of the fastest SSDs currently available; if you go up to 4K, you'd actually exceed that by a lot (not to mention, 1tb of storage would last for about 10 minutes of video).