Comment by tombert

25 days ago

Very tangential, but I think a lot about how modern video compression has gotten so unbelievably good that if we went back in time with AV1 or HEVC or something, I'm wondering if we could have had passable video streaming at 240p with something like an ISDN connection.

It would be a tight fit, but I still think within feasibility. We've gotten so good at shrinking video that it kind of feels like wizardry to me. Granted, I'm not sure there existed a computer in the 90s that was powerful enough to encode or decode it.

Many years ago, "8088 Domination" demonstrated full motion video on the original 1981 IBM personal computer:

https://trixter.oldskool.org/2014/06/19/8088-domination-post...

As it turns out, the video was encoded in such a way that it could be played back using the display bandwidth of the original PC, BUT doing that encoding required a modern computer to perform in a reasonable amount of time.

Tangential to the tangent, but turbo codes/LDPC are algorithms for transmitting data over unreliable links with optimal redundancy for a target error rate. They underlie much of modern wireless data transfer, and were known to be possible since Shannon, but nobody had figured out how to actually do it in practise. When they were invented in the '90s everybody reacted with disbelief at first!

  • Your characterization seems... incorrect to me.

    Reed Solomon codes are higher quality but much older and requires a matrix solve (LU decomposition plus yadda yadda, equivalent to inverting a matrix)

    Turbo codes / LDPC are IIRC O(n) instead of O(n^2.5) or whatever the matrix turns out to be.

    -------

    Reed Solomon codes are closer to the Shannon limit but are not scalable, slower than linear and require quadratically or cubically more compute for the data.

    Turbo Codes and LDPC do a shittier job but far far faster. So that makes them actually more ideal in practice even if they are worse than Reed Solomon codes.

    • Reed-Solomon speed varies heavily. For the common case of worst-case recovery on moderately reliable foundations (e.g., file storage on disk) with reasonably sized codes, encoding is bottlenecked by RAM/disk/network bandwidth (wherever you're writing the results), typical decoding is blind concatenation, and worst-case decoding pulls an already solved matrix decomposition out of a cache to decode at line rate as well.

      There's a trick in particular that allows you to rewrite the matmuls as a sequence of vectorized XORs, processing the same number of instruction words as other implementations (give or take control flow) but doing just a stream of zero-data-dependency vectorized math with lots of execution unit support. If you're feeling fancy you can do CSE and also choose the matrix constants minimizing XOR count.

      Even without that, just basic AVX2 tricks get you a few GiB/s.

      Unless the more expensive matrix math you're referring to is supposed to have n be the size of the code rather than the size of the data?

      3 replies →

    • I don't see how classic RS codes could beat Turbo Codes (or LDPC). One of the key innovations of the latter is that they handle soft decoding; i.e., different levels of uncertainty of the incoming bits. It's much better to say that you're only 51% confident that a bit is 0 (when it should be 1) than 100% confident! This is especially important for analog systems (like radios) where the incoming bits naturally come with a confidence value.

      There are soft versions of RS codes, but these came much later and use the same iterative techniques that Turbo/LDPC decoders use.

      1 reply →

I wonder where you'd hit the performance limits vs the algorithmic improvements. On our family pentium 120 playing an mp3 in Winamp took 10-15% of the CPU, so I'm not sure how much headroom there'd be.

But anecdotally I'll share that one of my brother's college roomies was a consultant for RealVideo and was behind their initial codecs. He came back to them with algorithmic improvements a bit later and they just cold shouldered him saying the existing codec was good enough.

So who knows if the biz side folks at the time would have even seen value in better codecs, as unbelievable as that seems to us now in the streaming and zoom call world.

  • > He came back to them with algorithmic improvements a bit later and they just cold shouldered him saying the existing codec was good enough.

    I was involved in dial-up era 'postage stamp' video streaming. 240 pixels in 256 colors and it felt like visiting the future. Good times :-).

    > who knows if the biz side folks at the time would have even seen value in better codecs

    As someone who gradually went from code to the biz side, it's pretty likely they did understand it was better (at least at some levels of 'they'). A lot of times, saying "thanks, but what we have is good enough", especially to an outside contractor, isn't a technical or value judgement. It's more of a generic 'not interested right now'.

    Consumer streaming as a business didn't really happen on one linear ramp. There was a period in the mid-90s I call 'proto-streaming' where there was a lot of early-adopter excitement and experimentation; but it mostly died out and then got rebooted a few years later. Although Real Networks as company did bridge the two eras, it was rough and they survived on corporate training use cases. The streaming reboot is the ramp that can be roughly traced through to today.

    The reason proto-streaming didn't take off wasn't the early codecs, although it's true they weren't good enough yet to succeed. It was that the business models, content supply and distribution infrastructure weren't able to scale yet. So, Real Network's reply may have been the polite shorthand for an internal mtg that was more like a VP ranting "That's great but I got three fires burning the building down right now - and that ain't one of 'em!"

We had video conferencing on a single BRI (128k) with g728 and h264. It was CIF resolution so yes it is possible. And with that loss free ISDN connection the experience wasn't actually that bad. Though this was in the early 2010s where there was still a surprisingly large amount of ISDN around

> Granted, I'm not sure there existed a computer in the 90s that was powerful enough to encode or decode it.

In software, quite possibly not[0].

But I'm sure we could have built hardware decoders that were up to decoding AV1 or HEVC back in the 90s no problem, had those codecs existed at the time.

[0] Somewhat later than the timeframe we're talking about, but I remember with pain the moment I realised my 600MHz Athlon, with 256MB RAM and 32MB GeForce 256 video card, was thoroughly obsolete because it couldn't decode and play the original Half Life 2 preview without stuttering, screen tearing and, indeed, crashing.

When meta released their EnCodec neural net audio compression codec I thought about how the 48khz stereo examples, compressed down to 6 kbps, sounded better than I remember streaming Internet Radio sounded like circa 2003, and would have been able to be streamed realtime, no buffering, on a 14.4 kbps dial up modem (what I was rocking at the time) with a bit of bandwidth to spare for browsin' teh warez sites and .... based on some napkin calcs and assuming a little MMX instruction magic I think completely possible to run the neural net decoder fully real-time on a period-correct AMD Athlon XP 2500+ Barton (overclocked to a 3200+ of course, as all did!).

Man that would have felt like magic...

I'm having trouble finding it but there was an article a while back comparing mp3 speed gains from hardware and software. The hardware was getting better at the pace of Moore's law but the (de)compression speeds for mp3s were far outpacing it, showing that mp3 decoding optimizations were giving orders of magnitude more speedup.

I think this is a common trend for algorithms that are in wide use, where you have Moore's law like behavior on the hardware side and then also software optimizations that give their own order of magnitude speedups.

h264 was used in a homebrew port of Dragons Lair for the Nintendo 64: https://www.youtube.com/watch?v=i89f_CMn7bw

You can technically have some then-contemporary FMV titles run on N64 with a 64MB cart. The hardware lends itself to it because it has the RSP, a secondary MIPS processor with re-programmable microcode. But the best video compression we had at the time was MPEG-2, which just wouldn't cut it.

  • To be fair, the N64 port of Resident Evil 2 is still unbelievably cool and impressive, even being stuck with MPEG-2.

Fairlight made an Amiga demo called "242" in 1993 which featured a few minutes of "full motion video" on a single floppy disk.

It was heavily compressed, monochrome, low frame rate, but used a clever upscaling algorithm on the frames to make it watchable.

https://youtu.be/wAJx5Ud0pLc

Though perhaps doing it on the Amiga is cheating. It was overpowered for its time.

I remember that Nickelodeon had a contest where the winner was given a videophone and was part of some gameshow. I suspect it ran on ISDN.

Edit: There was also video CD, but that was higher bandwidth than ISDN. I also used to download South Park episodes over my dialup modem. They weren't quite real time (IE, it took longer than the playback time to download,) but they were a low multiple. (IE, a 20 minute episode took ~30-40 minutes to download).

  • Actual video CD is over a megabit per second. If you were downloading at half real time over a modem it wouldn't have been nearly as many bits, though maybe it was still MPEG 1? A lot of south park downloads were RealVideo, two generations more advanced than VCD (and two less advanced than HEVC).

  • > I remember that Nickelodeon had a contest where the winner was given a videophone and was part of some gameshow. I suspect it ran on ISDN.

    I won a copy of Sonic the Hedgehog in that contest! AFAIK, it was just a retail copy and a letter; the game might still be at my parents' house, but I certainly don't have the letter. I was not selected to be on the show or anything. I remember watching the scrolling rules when they were doing the promotion and writing down a couple bits of the address every time.

I've seen this in reality - compare the sound of an XM radio from 2003 to a modern one, same codec, same symbol rate, better audio quality. The same is true on digital two way radio (DMR, P25, TETRA, etc) the quality has improved because we can make the codecs do more intensive work, because the hardware is faster.

  • Yep, it's as simple as that: the faster the CPU (and more RAM) the better the compression. This has been known since the 80's when MPEG-2 first came out. It was designed using 1980's technology and despite its limitations has served us well, leading to digital TV and internet video.

  • then why is voice calling still awful? in the 90s they made advertisements for "crystal clear voices" for their mobile networks, these days it is still a pipe dream...

    • Voice calling has several issues.

      a) it's a legacy product that operators don't care about anymore.

      b) latency is important for voice, but modern voice calls have terrible latency. POTS was digitized (for T1/PRI) with g.711 which provides a 8kHz sample rate and 13 or 14 bit samples encoded down to 8 bit. PRI lines were multiplexed one sample at a time. There's a small amount of algorithmic delay, but not much.

      Modern voice calling is packetized, and most systems have packets of at least 20ms, you have more encode/decode time, you probably have a significant sampling buffer, and you may have to wait for network access, so the receiver needs to add a jitter buffer to manage that. Additionally, echo cancelation needs processing time, and it's also harder with longer latency. Some systems use longer packet times to reduce network overhead.

      c) codecs: g.711 has a terrible pass band, GSM codec takes the same inputs and compresses it harder. g.722.2 (amr-wideband) is better, but it requires proper call setup and that is problematic for calls from one carrier to another. If you're calling via apps, there's potential for more flexibility, but you likely get whatever the developer thought was good enough.

      1 reply →

    • it depends on your carrier, I find voice quality to be great on cell calls, unless its verizon.

h.264 is shockingly clever when you get into the nitty gritty. The core transform is a bit like a jpeg frequency transform, but is designed to run entirely in 16 bit integer maths and on 4x4 blocks. Ergo, it would run on MMX.

So, in short, probably. Particularly if you could get a hardware accelerated surface that transformed YUV into RGB.

Well, those modern codecs also take a lot more compute and memory to both decode and encode..