Dav2d

(jbkempf.com)

490 points by captain_bender22 hours ago

25 comments

  • celsoazevedo19 hours ago
    &quot;Too Many Requests&quot;<p>- <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20260531130034&#x2F;https:&#x2F;&#x2F;jbkempf.com&#x2F;blog&#x2F;2026&#x2F;dav2d&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20260531130034&#x2F;https:&#x2F;&#x2F;jbkempf.c...</a><p>- <a href="https:&#x2F;&#x2F;archive.md&#x2F;ln5UE" rel="nofollow">https:&#x2F;&#x2F;archive.md&#x2F;ln5UE</a>
    • cozzyd8 hours ago
      Should have used AV2
    • kaka31419 hours ago
      Too much traffic from HN?<p>``` Too Many Requests The page you have tried to access is not available because the owner of the file you are trying to access has exceeded our short term bandwidth limits. Please try again shortly.<p>Details: Actioning this file would cause &quot;jbkempf.com&#x2F;&#x2F;blog&#x2F;2026&#x2F;dav2d&#x2F;&quot; to exceed the per-day file actions limit of 160000 actions, try again later ```
      • BetterThanSober18 hours ago
        I don&#x27;t know if I&#x27;m underestimating HN&#x27;s reach but I doubt we did that, probably traffic from a much bigger aggregator&#x2F;forum
        • jezzamon18 hours ago
          You are underestimating HN&#x27;s reach, this happens all the time. As someone who has been on the front page of HN it&#x27;s a pretty big rush in traffic!
          • pstuart16 hours ago
            I&#x27;d wager that the load is amplified by other sites that treat HN as a goldmine of tasty links.
        • NorwegianDude15 hours ago
          Hacker news doesn&#x27;t generate much traffic, despite what people are saying.<p>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&#x27;s 10 files each visit. That&#x27;s will limit it to 16k visits&#x2F;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.
          • Anduia11 hours ago
            Well, if every asset request hits the origin (no CDN, no caching...) that would be a misconfiguration of the website. It should never happen for a blog.
          • SonOfLilit9 hours ago
            A decade ago I was on the front page and saw ~16k uniques&#x2F;hour I think?
          • ethin15 hours ago
            Wait really? I&#x27;m not really sure what to think and I posted before I saw this... I wonder why the limit is so low?
        • kaka31410 hours ago
          Yeah, it&#x27;s hard to tell thb, just a guess. But potentially the site also misconfigured their server, causing too much cache misses and hitting the server direclty.
        • reactordev7 hours ago
          The HN hug of death is real. If you aren’t prepared, it can set fire to your server room.
          • claytongulick5 hours ago
            Oldtimers &#x27;round these parts call it &quot;slashdotted&quot;
      • hideout_berlin19 hours ago
        i had that too once i used dyndns address my linux apache crashed when some one posted it here
  • jordand21 hours ago
    &#x27;AV2 decoding is roughly five times more complex than AV1 decoding. In practice, that means software running on today’s hardware will struggle to decode AV2 in real time without careful, architecture-specific optimization&#x27;<p>AV1 software decoding is already very intensive so AV2 decoding benchmarks are the next thing that would be really interesting (or mortifying) to see.
    • kmfrk20 hours ago
      Intel&#x27;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.<p>Hope we get a similar option with future lineups that support AV2, especially given how popular video creation and streaming are now.
      • thrownthatway18 hours ago
        Is there a compelling reason encoding needs to be done locally?<p>The point of encoding is to reduce downstream bandwidth for the viewer, and upstream bandwidth for the distribution network.<p>The content creator only needs to upload it once.
        • esposm0314 hours ago
          Yes.<p>An uncompressed 1080p, 60fps video with 24-bit color depth would need around 3Gbps to be streamed. And even if you don&#x27;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&#x27;d actually exceed that by a lot (not to mention, 1tb of storage would last for about 10 minutes of video).
          • Forgeties7912 hours ago
            Who is regularly watching uncompressed videos outside of production environments? That’s got to be a very small population.
            • gblargg3 hours ago
              The context was remotely encoding the video, which would require sending the uncompressed stream.
          • Ecco13 hours ago
            Using raw uncompressed bitrate is a bit disingenuous. How about comparing an older, widely supported codec like H.264 as a baseline?
            • gblargg3 hours ago
              If you compressed it with H.264, it wouldn&#x27;t make much sense to send it remotely to be encoded with a better codec.
            • overfeed7 hours ago
              &gt; Using raw uncompressed bitrate is a bit disingenuous<p>It is not disingenuous given the context. Gp was responding to ggp&#x27;s hypothetical:<p>&gt;&gt; Is there a compelling reason encoding needs to be done locally?
        • phkahler18 hours ago
          If you don&#x27;t encode locally as the video is created, you either need to store RAW frames which takes enormous amount of storage, or you use a different format and suffer quality loss by transcending.
          • tverbeure9 hours ago
            &gt; you use a different format and suffer quality loss by transcending.<p>Compressing to AV1&#x2F;h264&#x2F;265 etc is really only done for the final version, but that doesn&#x27;t mean that videos are stored in RAW format during editing, where it is very common to store frames locally in Apple ProRes, Avid DNxHD, or some other compressed format that&#x27;s targeted towards professional editing.<p>Contrary to AV1 or whatever similar format which offer compression ratios of 1000x and more, these formats have a compression ratio of around 10x. They are very simple, and the quality loss is low enough that it doesn&#x27;t matter. They also tend to store images with 30 bits per pixel instead of the 24 bpp that&#x27;s normally used for streaming.
            • Forgeties793 hours ago
              You’re not wrong but I do think it’s worth clarifying that any professional production with a budget, even a modest one, is generally being shot with a raw codec -&gt; edited&#x2F;colored with proxies -&gt; rendered with the original raw codec where they compress for the final cut.<p>ProRes and the like are used for proxies or quick and dirty productions that are mostly shooting their look in camera because of a fast turnaround time. This is usually event work on a budget or something for social media.
        • halJordan18 hours ago
          Well yes? The platforms only accept certain resolution&#x2F;bitrates and also most of America isnt running 1gig up. They&#x27;re running 5-30 mbps up. So yeah they need to encode it.
          • thrownthatway15 hours ago
            &gt; They&#x27;re running 5-30 mbps up<p>Do you not have 98% high speed 5G coverage?
            • ihattendorf13 hours ago
              Data caps make that hard. While everyone likes to claim unlimited data, I&#x27;m not aware of any providers that don&#x27;t have a heavy data user clause where they&#x27;ll deprioritize your data if you&#x27;re a top ~5% data user (usually somewhere over ~1TB&#x2F;month).<p>You also will need _some_ sort of encoding locally before uploading, even if it&#x27;s minimal, which could lead to issues when encoded again (although there are codecs available to minimize this).
            • Forgeties792 hours ago
              Just over half the world’s smartphone users do (meaning almost half don’t), and certain countries&#x2F;areas have way more coverage than others. And a massive number of people have limited data per month, which means it’s also a cost concern.<p>Leaner delivery is not just ethical, but it also makes better business sense.
        • IshKebab18 hours ago
          Video calls &amp; streaming.
          • sysguest16 hours ago
            this<p>for other cases, I can just wait more for my cpu&#x2F;gpu&#x2F;cloud to do the job
    • mrbluecoat21 hours ago
      I came to post this as well. Until widespread, inexpensive hardware catches up to a 2018 codec, AV# will remain a niche ideal.
      • breve21 hours ago
        Hardly niche. My laptop isn&#x27;t new and it has hardware AV1 decoding and encoding. My 10 year old iPhone 7 can play 1080p AV1 video in software for over 200 minutes with VLC. The iPhone 7 was released in 2016, a year and a half before AV1. The dav1d decoder is mighty.<p>Netflix uses AV1: <a href="https:&#x2F;&#x2F;netflixtechblog.com&#x2F;av1-now-powering-30-of-netflix-streaming-02f592242d80" rel="nofollow">https:&#x2F;&#x2F;netflixtechblog.com&#x2F;av1-now-powering-30-of-netflix-s...</a><p>YouTube uses AV1. It&#x27;s tough to be more mainstream than that.<p>Right click on a YouTube video and select Stats for Nerds. If your system is capable of it, chances are it will be playing back in AV1.<p>Most of the YouTube videos I watch these days are AV1 encodes. Sometimes it&#x27;s in VP9 and occasionally it&#x27;s H.264.
        • weiliddat20 hours ago
          Supported is different from doing it well though. You do notice the performance hit even on TVs that playback YouTube videos on AV1.<p>Even on 1080p videos running on AV1 on 1x, the TV system bogs down and any kind of interaction has a variable 1-3s lag. On some TVs if you do 1.25x the TV automatically &quot;downgrades&quot; the resolution to 480p to avoid dropping frames.<p>I wish there was an option to still use VP9 &#x2F; H.264 on those systems (even limited to 1080p).
          • Dylan1680717 hours ago
            More reason to never use the builtin stuff in a tv. Cheap sticks can handle decoding fine.
          • Gigachad7 hours ago
            My TV lags out even when doing nothing. So I use it as a dumb panel and let another device handle the streaming and decoding. Also has the benefit of blocking LG from loading adverts all over the UI.
          • TingPing19 hours ago
            Youtube artificially limits the resolution, on mine if you cast the exact same video it doesn’t impose that limit and works fine.
        • jordand20 hours ago
          Yeah I could imagine the AV1 codec sticking around for a very long while, even as a fallback for AV2. There&#x27;s still hundreds of millions of people out there using old&#x2F;cheap devices (especially in developing countries) where that battery drain from software decoding is a big problem, so AV2 would be nonviable.
          • ZeroGravitas19 hours ago
            Some of the early use of VP9 and AV1 was Netflix serving video to people in developing countries. Their metered bandwidth was more of a bottleneck than the CPU playback.
        • sylware20 hours ago
          Same. Mostly AV1, sometimes VP9, and rarely h264.<p>What&#x27;s missing mostly: live streams which are h264.<p>Currently, and I say currently, dav1d is so fast, no worries on that side.
    • jbk21 hours ago
      &gt; AV1 software decoding is already very intensive so AV2 decoding benchmarks are the next thing that would be really interesting (or mortifying) to see.<p>Yes, this is going to be fun to watch.
  • genxy18 hours ago
    A codec spec isn&#x27;t done until there is at least one decoder developed in the field. So reference + 1. The field implementations often become the de facto spec.<p>Reading the MPEG1 specs back in the 90s as a child opened my eyes to how to define complex systems. For a media coding standard, they spent most of their time saying how to interpret encoded bytes, which I realized is genius. Be descriptive about decoding and you don&#x27;t have to be prescriptive about encoding. Encoding is where you can apply all the creativity, but you need to provide a way to have a shared understanding of the encoded bytes.
  • pantalaimon15 hours ago
    I&#x27;m not quite convinced a 25% reduction in size is worth effectively obsoleting all devices that have hardware decoders for AV1 but will struggle to decode AV2
    • amiga38615 hours ago
      Modern video services perform multiple encodings with different codecs, bitrates and screen dimensions, and serve up the most appropriate format that the client device can decode. Youtube has hundreds of format variants:<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;MartinEesmaa&#x2F;2f4b261cb90a47e9c41ba115a011a4aa" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;MartinEesmaa&#x2F;2f4b261cb90a47e9c41ba11...</a><p>Devices with AV1 hardware decoding - rare as they are - won&#x27;t be obsoleted for a long time.
      • Gigachad7 hours ago
        Even devices that don&#x27;t aren&#x27;t becoming obsolete. My M1 macbook does not have a hardware decoder and youtube seems to choose AV1 whenever it&#x27;s available. The software decoder does not noticeably warm the laptop.
    • breve11 hours ago
      When you host videos with near 17 <i>billion</i> views you&#x27;re going to want to stream those videos in as few bits as possible:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=XqZsoesa55w" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=XqZsoesa55w</a><p>That extra 25% becomes worth it.<p>Nothing will become obsolete. AV1 will stick around for a long time. And YouTube still does H.264 encodes to support old devices.
    • toast08 hours ago
      A new codec doesn&#x27;t obsolete old devices. At least, not right away.<p>Studios still release new dvds with mpeg2 video. Online videos tend to be available in many codecs. Video conferencing tends to negotiate to best available or has settled on ancient codecs and won&#x27;t change quickly.
  • anoncow21 hours ago
    I thought this was about Dave2D
    • ltheanine18 hours ago
      Yeah I suppose it’s named after dav1d but still seems like a pretty unfortunate name collision.
    • cozzyd8 hours ago
      Soon to be decodable with dav2d!
    • fitzroymckay17 hours ago
      same
    • adithyassekhar20 hours ago
      Same
    • xk916 hours ago
      Exactly
  • plopilop20 hours ago
    Seems like the blog succumbed to the HN hug of death (`Actioning this file would cause &quot;jbkempf.com&#x2F;&#x2F;blog&#x2F;2026&#x2F;dav2d&#x2F;&quot; to exceed the per-day file actions limit of 160000 actions, try again later`), is there a copy available somewhere?
    • juliie19 hours ago
      it got archived by the wayback machine: <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20260531115337&#x2F;https:&#x2F;&#x2F;jbkempf.com&#x2F;blog&#x2F;2026&#x2F;dav2d&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20260531115337&#x2F;https:&#x2F;&#x2F;jbkempf.c...</a>
  • mudkipdev15 hours ago
    &gt; The page you have tried to access is not available because the owner of the file you are trying to access has exceeded our short term bandwidth limits. Please try again shortly.<p>HN hug of death
  • ethin15 hours ago
    Ouch, looks like the HN hug of death struck again. Gives me error 429.
  • Slurpee9921 hours ago
    <p><pre><code> ... improvements around 25% compared to AV1 AV2 decoding is roughly five times more complex than AV1 decoding </code></pre> I&#x27;m not sure what these two lines mean or if we can compare them, any help?
    • whynotmaybe21 hours ago
      I understood it as compression is 25% better : a quality of 10mbps in av1 can be achieved with 8mbps in Av2. But, it needs 5 times more compute power for this 25% gain.
    • jbk21 hours ago
      &gt; I&#x27;m not sure what these two lines mean or if we can compare them, any help?<p>AV2 saves 25% bandwidth at the cost of 5x more decoding complexity.
      • 0x1ceb00da21 hours ago
        What does &quot;complexity&quot; mean here? Computation required?
        • BillStrong20 hours ago
          Yes, much higher computation required to encode it, and decode it, both.
          • Caspy719 hours ago
            He only mentioned decode complexity. Would be interesting to know the average encode complexity compared to AV1.
            • kiicia15 hours ago
              Encoding speed even on Mac Studio is atrocious, it’s in range of single frames per second as opposed to realtime+ for even h265
              • F3nd014 hours ago
                The specification for AV2 has only been finalised very recently, so performant encoders have not yet been developed. Meaningful comparison to older codecs like H265 and AV1 will only be possible once that has changed. (It&#x27;ll be slower, but almost certainly not one-frame-per-second slow.)
        • WD-4218 hours ago
          dav1d is the av1 decoder and it’s an insane feat of engineering. Written in assembly, it even eschews the normal c calling convention to get even better performance.
          • IshKebab18 hours ago
            The normal C calling convention is really only for cross-binary calls (e.g. between shared libraries). If you&#x27;re not doing that you can ignore it; it&#x27;s not a weird thing to do. It would be odd to strictly follow it in assembly and I assume compilers don&#x27;t either.
            • adgjlsfhk110 hours ago
              Unfortunately, in absence of inlining, compilers mostly respect calling convention even when they don&#x27;t have to.
        • simjnd20 hours ago
          Yes
    • croes21 hours ago
      Smaller files but harder to decode
  • ChrisArchitect15 hours ago
    Related:<p><i>The AV2 Video Standard Has Released (Final v1.0 Specification)</i><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=48340910">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=48340910</a>
  • philipallstar4 hours ago
    &gt; Let dav2d be.<p>This is an odd signoff. Are people having a go at dav2d?
  • avaer8 hours ago
    If decode is becoming so complicated and expensive the hardware can&#x27;t handle it, why not just go full neural, send latents, and run decode on tensor cores?<p>The answer is probably the same as for why not AV2 everything; a lot of hardware couldn&#x27;t support it today. But in 10 years?<p>It seems we&#x27;re running up against fundamental limits of human-engineered video codecs at this point. There might be a lesson in there.
    • Dylan168078 hours ago
      What makes you think that would use less resources?<p>And it&#x27;s not really hardware hitting limits, it&#x27;s specifically software decoding on somewhat weaker machines.
      • avaer7 hours ago
        It could help in the same way that running things in a shader uses less resources than running it on CPU. You&#x27;re flattening the pipeline, and you can optimize better with simpler primitives and less branches.
    • itishappy8 hours ago
      This is a software decoder designed to run on general purpose hardware.<p>Adding custom hardware like tensor cores to the stack would serves a different use case.
      • avaer7 hours ago
        Right, I&#x27;m sure it&#x27;s way faster in specialized hardware.<p>What I&#x27;m saying is the performance problem is a &quot;code smell&quot;. The algorithms are getting so complicated that perhaps we are approaching fundamental limits of heuristiccs; we might get better + faster results ditching &quot;smart&quot; algorithms and just learning the codec in a much higher dimensional space.<p>Again specialized hardware, but a different approach to it.
  • remix200021 hours ago
    &gt; Make it fast on older desktop, by writing asm for SSSE3+ chips<p>I guess 5 years ago (around the time when Intel stopped making SSE-only chips) is technically &quot;older&quot;, but I wouldn&#x27;t prioritize avx2 when devices intended for consuming media definitely experience much less pressure to upgrade than workstations…
    • otherjason19 hours ago
      Almost every Intel CPU released since 2013 has AVX2 support. Some Atom SKUs were longer holdouts, but the fraction of x86 CPUs shipped in the last decade that have AVX2 support is very high.
  • GaggiX21 hours ago
    I would love to see comparisons with AV1 on very low bitrates.
    • UnlockedSecrets21 hours ago
      Return of the 8MB Shrek encodes?
      • MaxikCZ21 hours ago
        <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20210416200451&#x2F;https:&#x2F;&#x2F;cdn.discordapp.com&#x2F;attachments&#x2F;677266163994198020&#x2F;832698449828118548&#x2F;Shrek.mkv" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20210416200451&#x2F;https:&#x2F;&#x2F;cdn.disco...</a><p>Shrek 1 at 8.34MB including audio.. insane
        • coldpie20 hours ago
          Video resolution: 128x72, hahah. Late 90s RealPlayer postage stamp video is back! To its credit, that whole movie is probably smaller than RealPlayer itself was.
        • asimovDev1 hour ago
          I once watched an entire movie (around 90 mins) on a Nokia 6303. This reminds me of that
        • ant6n19 hours ago
          There&#x27;s a 64MB game boy advance cartridge with shrek on it [1]. Looks pretty horrible [2]. But the GBA only has 16KB fast &#x2F; 256KB slow RAM, and a 16MHz CPU.<p>[1] <a href="https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;Shrek-Video-GBA" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;Shrek-Video-GBA</a> [2] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=CyOfPZQl4MI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=CyOfPZQl4MI</a>
        • GaggiX20 hours ago
          I love this, hope to see a AV2 version at 8MB
      • lostmsu20 hours ago
        6MB should be enough for everyone!
  • arikrahman13 hours ago
    What&#x27;s next, Dav4d?
  • the__alchemist20 hours ago
    Not to be confused with Da4vid (world-class hacker and owner of the Black sun) or D4vd (rap artist and alleged murderer)
    • staindk20 hours ago
      Or Dave2D, popular tech youtuber
      • nick__m14 hours ago
        This thread made me think of this song&#x2F;sketch from Kids in the Hall.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dEGCdVADLWY" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dEGCdVADLWY</a>
      • tosti20 hours ago
        Or dave, the command to start Dangerous Dave.
    • F3nd014 hours ago
      I don’t think the chances of confusion between a niche celebrity and a video decoder are very big.
    • JoshTriplett20 hours ago
      &gt; Not to be confused with Da4vid (world-class hacker and owner of the Black sun)<p>*Da5id
  • husky821 hours ago
    Is codex working on novel decoders 24&#x2F;7? I hope
    • cozzyd19 hours ago
      One would imagine given the name that it would specialize in codecs
      • singhkays11 hours ago
        Codex is actually short for `Code Execution`
  • latentsea4 hours ago
    Wait until you try d4vid, it&#x27;s killer.
    • Barbing4 hours ago
      (A child murder joke) <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;D4vd" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;D4vd</a>
  • poly2it21 hours ago
    Sorry if this sounds naive, but does it make sense to write a codec library in C&#x2F;ASM considering how well Rust is progressing, especially when, as the author puts it, <i>AV2 decoding is roughly five times more complex than AV1 decoding</i>?
    • Arodex21 hours ago
      The algorithms deployed in these kind of codecs take into account not only human vision and mathematical laws of information, but also nitty-gritty details of how computers work, which are optimally exploited by directly having humans write detailed assembly rather than a compiler make a best guess and effort.
      • alkonaut3 hours ago
        Surely 100% of these low level features are availale in rust too? I understand it is a massive undertaking and builds off the previous codec(s) but writing these things by hand such as inline assembly seems to be as easy if not easier in Rust?<p>And as soon as you walk into concurrency territory for a complex codec like this then it seems almost impossible for humans to do correctly while retaining safety.
        • rafaelmn56 minutes ago
          Why ? If it&#x27;s shared reads and scoped writes (read-only look up, output to a thread owned buffer span) concurrency seems pretty straightforward.<p>Rust can only prove a limited subset of correct programs to be safe, when you&#x27;re doing bare metal stuff you&#x27;ve often not in that subsystem and drop down to unsafe. I&#x27;m guessing there&#x27;s always stuff that&#x27;s not perf critical and can live in Rust sandbox - so not saying no wins - but it doesn&#x27;t sound like Rust is a no-brainer.
    • jbk21 hours ago
      Because it&#x27;s 5 times more complex, you need to get the maximum performance available. Therefore more ASM than ever.<p>Rust does not bring more performance. Just more safety.
      • alkonaut3 hours ago
        It brings tooling that is a LOT easier. Just things like dependency management, test running and so on is so much better in Rust than in C, even if you happen to write the exact same code because you basically write unsafe code and hand rolled assembly for many things. I think this is people using the tool they know rather than the best tool (And if you know a tool well, it might become the best tool for the job because of that). It could be because a huge chunk of existing code can be re-used. But all else being equal (existing code, existing developers don&#x27;t exist) I refuse to believe a codec should ever be written in C ever again.
      • cesarb15 hours ago
        &gt; Rust does not bring more performance. Just more safety.<p>Though more safety can in some cases bring a bit more performance. For instance, with Rust you can often avoid &quot;defensive copies&quot; of objects.
        • itishappy8 hours ago
          When writing a high performance video codec avoiding defensive copies of objects is something you want always, not just often.<p>C makes it easy to be fast but hard to be safe. Rust makes it easy to be safe but hard to be fast.<p>Also note that video codecs tend to wrap C or Rust around handcrafted ASM. Performance is king.
      • LoganDark19 hours ago
        The safety can be worth it in certain cases. Like when handling untrusted input. And it&#x27;s not just Rust: look at WUFFS for example. WUFFS can actually rival handwritten implementations in certain cases.
        • xp8418 hours ago
          Are video codecs in the present day able to be sandboxed? In my fantasies at least I’d like the worst a malicious video file can do is cause garbage output or cause the codec to crash.<p>Forgive the ignorance, I have worked entirely in the abstracted layers of the stack, and mostly web.
          • adgjlsfhk19 hours ago
            not really. they&#x27;re mostly pure assembly and sandboxing assembly isn&#x27;t really a things
            • nullpoint4205 hours ago
              yes it is. all modern operating systems sandbox assembly. that&#x27;s how it works.
        • throawayonthe19 hours ago
          but not these cases
          • bigyabai15 hours ago
            It really should be, though: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;FORCEDENTRY" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;FORCEDENTRY</a>
          • IshKebab18 hours ago
            I don&#x27;t see why not. What makes you think this is unique?
            • adgjlsfhk19 hours ago
              WUFFS like approaches work better for algorithms like lz77 that are substantially bandwidth constrained. for something like a video codec, the computational intensity is much higher so you need better codegen to reach max speed
    • cogman1021 hours ago
      Encoder and decoder writers frequently need extremely fine grain control over SIMD instructions in order to get good performance.<p>The way they weave these instructions can be very hard to express with a high level language.<p>Further, there&#x27;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&#x2F;2 the array. Unfortunately, rust has runtime array bounds checks which make writing that sort of code slower. The compiler can elade those checks, but usually only in simple cases.<p>The authors would be writing a bunch of unsafe rust to get the performance they want and rust makes that more painful on purpose.<p>I like rust, but C&#x2F;ASM really is the right choice here. This is one of the few cases where rust&#x27;s safety is a major detriment.
      • dcsommer16 hours ago
        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.
        • Const-me14 hours ago
          &gt; Performance should not be priority #1. Security should be.<p>For a web browser, or a server in a bank, sure. For anything else, questionable.<p>&gt; adding a sandbox around a memory-unsafe codec is going to be way more expensive<p>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.
        • cogman1015 hours ago
          &gt; As rav1d shows<p>rav1d is not a full rewrite of dav1d to rust. So it really doesn&#x27;t show that. It&#x27;s currently C + rust + asm.<p>I don&#x27;t think we can say anything about what this does or does not prove about the performance of safe code.<p>&gt; Performance should not be priority #1. Security should be.<p>Entirely depends on the application. The reason rust has `unsafe` is because there&#x27;s some situations where performance needs to preempt potential security problems.
          • dcsommer13 hours ago
            Codecs are difficult and expensive to develop. Therefore they get reused in many contexts, including security critical ones. Sandboxing is shown over and over to not be a great security solution, so what this means in practice is that security-critical software that needs software decoding get pwned because software engineers don&#x27;t care to prioritize it in the first place.<p>Why shouldn&#x27;t safety be the default? If you really want to, it wouldn&#x27;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.<p>Software decoding has a safety culture problem, and we need to talk about it.
            • cogman1013 hours ago
              &gt; Why shouldn&#x27;t safety be the default?<p>Because safe code isn&#x27;t fast enough to decode live video.<p>&gt; If you really want to, it wouldn&#x27;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.<p>Yeah, but then you are undermining safety in a critical way that does lead to security vulnerabilities (buffer overflow). And you are also now maintaining and requiring other devs for a project to use a custom version of rustc. That&#x27;s certainly part of the reason that&#x27;s simply not happened.<p>But another major part of it is that encoders end up with a lot of custom ASM regardless. That custom ASM is going to be where vulnerabilities end up. You don&#x27;t really escape that by using rust.<p>If you are already abandoning where you critically need safety the most for performance, then why pick a language that additionally penalizes you for using unsafe constructs?<p>&gt; Software decoding has a safety culture problem, and we need to talk about it.<p>Compilers and languages have an optimization problem that we need to talk about. SIMD optimizations remain a very hard thing for compilers to get right. We should talk about what it&#x27;d take to make compilers better and the reasons for why codec devs need to drop down to asm instead of using a high level compiler.<p>There might not be a solution to this problem, there are reasons for it.
              • Dylan168078 hours ago
                &gt; Because safe code isn&#x27;t fast enough to decode live video.<p>I strongly doubt that.<p>And if any implementation of AV2 can be &quot;fast enough&quot;, then there should be no question at all that we can write &quot;fast enough&quot; safe decoders for every other codec. Absolutely no way safe code is inherently that much slower.
            • imtringued3 hours ago
              What&#x27;s supposed to be the big source of unsafety in codecs though? Feels like the problem here is that C developers are ruining the reputation of C with their garbage code.<p>Bounds checking as a source of slowdown is overrated in a niche where you&#x27;re working on fixed size blocks. It feels like the C developers are getting the parts outside the ASM kernels wrong.
    • muhbaasu21 hours ago
      The ffmpeg devs have said many times in public that they routinely get speedups of 10x or more over C code. I&#x27;m not a reputable source on this myself but I highly recommend looking into their channels, mails, or posts.
    • nmz17 hours ago
      <a href="https:&#x2F;&#x2F;youtu.be&#x2F;nepKKz-MzFM&amp;t=7195" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;nepKKz-MzFM&amp;t=7195</a><p>If you can stand Lex Friedman for a bit, the VLC authors talk about why you use ASM for a video decoder instead of pure C or rust.
    • throawayonthe19 hours ago
      yes it makes sense to use C&#x2F;ASM here, but if you&#x27;re curious, there is a rust port of dav1d named rav1d: <a href="https:&#x2F;&#x2F;github.com&#x2F;memorysafety&#x2F;rav1d" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;memorysafety&#x2F;rav1d</a><p>it&#x27;s not <i>much</i> slower than the original C&#x2F;ASM implementation (last i checked ~5%?) but that matters here
      • nick__m14 hours ago
        It&#x27;s a Rust&#x2F;ASM port, look there: <a href="https:&#x2F;&#x2F;github.com&#x2F;memorysafety&#x2F;rav1d&#x2F;blob&#x2F;main&#x2F;src&#x2F;ext&#x2F;x86&#x2F;x86inc.asm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;memorysafety&#x2F;rav1d&#x2F;blob&#x2F;main&#x2F;src&#x2F;ext&#x2F;x86&#x2F;...</a><p>I am not sure if it is that much safer than the C version when raw assembly is still required.
      • Thaxll15 hours ago
        It is much slower than 5%, there were other independent tests that put it around 20%.
      • stukenov16 hours ago
        there&#x27;s a rav2d now too fwiw — <a href="https:&#x2F;&#x2F;github.com&#x2F;stukenov&#x2F;rav2d" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;stukenov&#x2F;rav2d</a> same playbook: safe Rust + asm kernels via FFI. just shipped 0.1.0.
    • stukenov16 hours ago
      fyi the Rust port already exists: <a href="https:&#x2F;&#x2F;github.com&#x2F;stukenov&#x2F;rav2d" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;stukenov&#x2F;rav2d</a> you keep the hand-written asm via FFI, rest is safe Rust. same trick rav1d uses.
    • Telaneo21 hours ago
      Go ask FFmpeg what they&#x27;re writing their encoders and decoders in.
      • Gigachad7 hours ago
        Just don&#x27;t try reporting a security issue to them.
        • Telaneo5 hours ago
          Is this a reference to this: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=45785291">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=45785291</a> ?<p>If so, FFmpeg&#x27;s stance is very understandable in my opinion.
          • Gigachad5 hours ago
            Somewhat, but somewhat not. Yes it&#x27;s a very obscure format, and yes it&#x27;s partially a marketing stunt from Google for their AI tools. But it&#x27;s also a real bug which is exploitable on ffmpeg. And we have seen in the past that state sponsored hacking groups specifically target media decoders with obscure formats that aren&#x27;t often tested or known about.<p>Media decoders are one of the highest risk programs since they deal with untrusted user input and are incredibly complex. So just because a large project like ffmpeg uses C, doesn&#x27;t mean there isn&#x27;t very good reason to consider a language like Rust for saftey reasons.
            • Telaneo4 hours ago
              If Google want secure encoders and decoders, then they can donate money or patches. Since they don&#x27;t, the clearly don&#x27;t actually care all that much, or are just mooching of volunteers&#x27; goodwill.<p>The disadvantage in speed when using Rust is pretty obvious.[1] When it comes to video encoding and decoding, I and FFmpeg care a lot more about speed than memory safety. So those reasons have been considered and largely discounted.<p>[1] <a href="https:&#x2F;&#x2F;xcancel.com&#x2F;FFmpeg&#x2F;status&#x2F;1924137645988356437" rel="nofollow">https:&#x2F;&#x2F;xcancel.com&#x2F;FFmpeg&#x2F;status&#x2F;1924137645988356437</a> (to be fair, this is only transpiled from C, so it could probably be optimised further, but that apparently needed a 20k USD bounty to then not even happen (as far as I can tell))<p>[2] <a href="https:&#x2F;&#x2F;www.memorysafety.org&#x2F;blog&#x2F;rav1d-perf-bounty&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.memorysafety.org&#x2F;blog&#x2F;rav1d-perf-bounty&#x2F;</a>
      • latexr21 hours ago
        That isn’t particularly helpful to someone asking a question in good faith. What others are using doesn’t clarify <i>why</i> they are using it. Plus, FFmpeg is itself a decade older than Rust. The OP is asking about starting a new project today.
        • Telaneo20 hours ago
          &gt; What others are using doesn’t clarify why they are using it.<p>It does if you ask them, or at least research the topic at hand.
          • latexr18 hours ago
            Isn’t that just the same as answering “Google it”, then? We’re on a discussion forum, where matter experts visit, talking about a specific topic. If one can’t ask their questions in this highly relevant situation, where can they? The point of HN is supposed to be gratifying curiosity.
    • IshKebab17 hours ago
      I don&#x27;t know why you&#x27;ve been down-voted. It definitely isn&#x27;t an optimal decision. A video codec isn&#x27;t <i>all</i> assembly. There&#x27;s plenty of plain unsafe C code. E.g. this is the first random file I clicked. It has a ton of raw C pointer stuff just begging to be exploited.<p><a href="https:&#x2F;&#x2F;code.videolan.org&#x2F;videolan&#x2F;dav2d&#x2F;-&#x2F;blob&#x2F;main&#x2F;src&#x2F;data.c?ref_type=heads" rel="nofollow">https:&#x2F;&#x2F;code.videolan.org&#x2F;videolan&#x2F;dav2d&#x2F;-&#x2F;blob&#x2F;main&#x2F;src&#x2F;dat...</a><p>There is a project to write an AV1 decoder in Rust: Rav1d (really stretching the name here).<p><a href="https:&#x2F;&#x2F;github.com&#x2F;memorysafety&#x2F;rav1d" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;memorysafety&#x2F;rav1d</a><p>They got within 5% of the performance of dav1d and held a contest to close the gap but I think I read somewhere that this wasn&#x27;t achieved.<p><a href="https:&#x2F;&#x2F;www.memorysafety.org&#x2F;blog&#x2F;rav1d-perf-bounty&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.memorysafety.org&#x2F;blog&#x2F;rav1d-perf-bounty&#x2F;</a><p>They claimed<p>&gt; This is enough of a difference to be a problem for potential adopters, and, frankly, it just bothers us.<p>But in my opinion nobody actually cares about 5% in absolute terms. It&#x27;s likely just Rust naysayers using that as an excuse.<p>I think the likely reason for dav2d using C is that they can reuse lots of code and infrastructure from dav1d. But I agree it would be much better if they worked on Rav2d instead (these names!). You can hardly complain about a 5% overhead if you&#x27;re opting in to 5x more decoding complexity.
      • stukenov16 hours ago
        funny you mention it — rav2d exists now: <a href="https:&#x2F;&#x2F;github.com&#x2F;stukenov&#x2F;rav2d" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;stukenov&#x2F;rav2d</a> full C-to-Rust port, asm kernels still via FFI like rav1d does. early (0.1.0) but passes conformance against dav2d.
      • skelpmargyar12 hours ago
        Of course any random C file is going to have pointers. Where can anything in the linked code be exploited? It seems like they&#x27;re testing for bad input data with asserts to catch bugs in some functions, and properly validating bad inputs in others. Just because they&#x27;re writing C doesn&#x27;t mean it&#x27;s vulnerable.<p>How can you claim nobody cares about 5%? A 5% performance increase is significant. And video decoding is not always for playback, where 5% may not matter as much.
    • MattRix21 hours ago
      Yes? There is 5x more code to optimize the ASM for.
  • spiral0917 hours ago
    [dead]
  • latexr21 hours ago
    When AV1 was first announced, I got the impression the name was chosen partly as a pun&#x2F;reference&#x2F;homage to AVI, the classic but outdated format with used to be popular. Then when I saw Dav1d, OK, good way to continue the pun.<p>But now with AV2 and Dav2d, that completely breaks. Are we eventually going to get AV3&#x2F;Dav3d and AV4&#x2F;Dav4d, which will read like Ave&#x2F;Daved and Ava&#x2F;Davad? Seems a bit awkward. Was the idea from the start to have the 1 be the version number, and have it specifically be part of the name?
    • p1mrx19 hours ago
      I think it&#x27;s a reasonable decision. The only people who will interact with dav2d by name are codec nerds, and a simple increment makes the lineage more obvious to that audience.
    • BetterThanSober18 hours ago
      I&#x27;m pretty sure it is a homage. As for dav1d it&#x27;s not a reference decoder (although partially funded by AOM iirc) so they might not know that the next iteration will simply be AV2, we have h264, h265, h266 naming though<p>Tangent but I cannot wait for h269 (or h267 for the younger gen)
    • xp8419 hours ago
      As with all naming schemes in the tech world, I am sure no future scenarios, including successor names, were ever considered
    • jl621 hours ago
      1dav2codecs?<p>2av2furious?
      • Hendrikto20 hours ago
        And then AV3: Tokyo Drift, and after that AV Episode 1.
        • xp8419 hours ago
          Or go the Apple Watch naming scheme route.<p>Just “AV”<p>Next, AV Series 1 and 2 (released simultaneously)<p>Later, AV Edition but it costs $10,000
          • brnt16 hours ago
            AV360. AV365. AV2030. AVXP. AV8. AV10. Perhaps some here will be around for AV95.<p>Young AV?
        • BillStrong20 hours ago
          Already predicting which versions to avoid, huh.
    • Arubis21 hours ago
      Da5id could potentially work as a Snow Crash reference.
    • WhrRTheBaboons21 hours ago
      &gt; experience Dav... Now in 3D!
    • latexr18 hours ago
      I’m fascinated by the flurry of downvotes to a simple commentary and question, especially when the replies are normal. If you’re one of the downvotes, please do share what you found offensive about my comment, I am genuinely interested in what you perceived as problematic.
  • yieldcrv19 hours ago
    D4vd
  • aetherspawn21 hours ago
    Ok whose idea was ‘Wiener filtering’
    • cogman1021 hours ago
      Norbert Wiener in the 1940s. He invented the technique.<p>It&#x27;s a semi-common last name.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Wiener_filter?wprov=sfla1" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Wiener_filter?wprov=sfla1</a>
    • hactually13 hours ago
      standard in DSP. Super cool and can be used on stock trades and other predictive markets.
  • Eldodi21 hours ago
    How is AV2 expected to avoid the patent-pool issues AV1 ran into?<p>AV1 was designed as royalty-free, but Sisvel’s pool and the recent Dolby&#x2F;Snap proved the contrary.<p><a href="https:&#x2F;&#x2F;accessadvance.com&#x2F;2026&#x2F;03&#x2F;24&#x2F;access-advance-licensor-sues-snap-inc-for-av1-and-hevc-patent-infringement&#x2F;" rel="nofollow">https:&#x2F;&#x2F;accessadvance.com&#x2F;2026&#x2F;03&#x2F;24&#x2F;access-advance-licensor...</a>
    • UnlockedSecrets21 hours ago
      They filed a suit, henceforth making a claim of an issue...... They haven&#x27;t &quot;proved&quot; anything other then they have lawyers on staff that can file some paperwork until the suit is settled in court...
    • AndrewDucker21 hours ago
      How does that prove anything?<p>They&#x27;re claiming that there are patents, but that doesn&#x27;t mean there are.
      • Eldodi21 hours ago
        Dolby is only the most recent case, Sisvel consorsium actually bills licences per device:<p>Consumer Display Device: EUR 0.32<p>Consumer Non-Display Device: EUR 0.11<p>(source here: <a href="https:&#x2F;&#x2F;www.sisvel.com&#x2F;licensing-programmes&#x2F;audio-and-video-coding-decoding&#x2F;video-coding-platform-av1&#x2F;#tab-licence-terms" rel="nofollow">https:&#x2F;&#x2F;www.sisvel.com&#x2F;licensing-programmes&#x2F;audio-and-video-...</a>)
        • zamadatix21 hours ago
          Sisvel allows you to pay them if you believe their claims, they haven&#x27;t actually taken anyone not paying to court yet to prove that. The only court cases for VP9&#x2F;AV1 from Sisvel so far have been their patents being found invalid&#x2F;irrelevant.<p>Dolby is somewhat more interesting in that rather than scare tactics, media hype, and attempting to form a pool about it they are actually taking a patent assertion claim to court.
        • justinclift20 hours ago
          That crowd are just deeply concerned one of their lucrative revenue streams is disappearing.<p>So they seem to be attempting to pull a fast one and use unproven claims to try and convert their competitor into a replacement revenue source.<p>It&#x27;ll probably be a case of whoever has the best lawyers + contacts + persistence wins.<p>But it&#x27;ll be interesting if discovery shows evidence they know they don&#x27;t have a case and are trying it anyway. &quot;Piercing the corporate veil&quot; can theoretically be a consequence of that AFAIK.
        • UnlockedSecrets21 hours ago
          How does how they bill for their product, matter in terms of if their lawsuit holds merit?
        • croes21 hours ago
          That doesn’t prove their claims are valid.<p>I can claim the same and offer licenses per device.
        • silotis21 hours ago
          Can you point to any other patent lawsuit over AV1? AFAIK the Dolby case is the first.
    • adgjlsfhk19 hours ago
      Sorry, I have a patent on questioning whether open source codecs are parent encumbered. Venmo me $1000 or you will be speaking to my lawyers
    • Arodex21 hours ago
      Every single AV2 news here in the last week has seen exactly the same question.<p>Either go back read the answers there first, or I will assume you are part of a FUD campaign (yes, I know HN guidelines, but again <i>every single AV2 news in the last week</i> has seen the same rhetorical &quot;questions&quot; as top &quot;comments&quot;).
    • croes21 hours ago
      No codec can ever avoid patent-pool claims.
  • kingstnap20 hours ago
    This seems like an interesting case to test AI agents on.<p>Like we had weird examples like C compilers and Bun. This is a much more interesting example because its highly nontrivial.<p>AV1 exists, Dav1d exists. Lets see AI take the AV2 spec and Dav1d code and try to make a working high performance AV2 decoder.