by tombert · 3w ago · 0 comments
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.
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.
in action on 16Mhz 286 Packard Bell Victory, fullscreen at 30FPS https://www.youtube.com/watch?v=fEJPLT_rSRY
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.
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?
I think this line says everything about your assumptions.
RAID-6 or other filesystems use extremely small ReedSolomon codes so these caching methods are possible.
But let's say you have a moderately sized (well, moderate for LDPC anyway) 65535-sized Reed Solomon problem (the maximum Reed Solomon that fits in 2^16 bits). Even with just 1% redundancy that's 655 parity.
Now consider the possible errors to solve for: 20 erasures means you have ~65535 choose 20 combinations of matricies to cache.
Or roughly 10^77 matricies you need to pre solve and cache to handle 20 erasures. Aka basically impossible.
----------
Now if you have 40 hard drives and are dealing with 3 or 4 errors tops, well sure caching is good and solves everything.
Reed Solomon is a perfect Maximally Distance code. For small n it's perfect.
For larger or even just moderate N (kilobytes for packets), it's too unwieldy. LDPC and Turbo Codes (which are imperfect codes) fill in the gap and allow for larger sizes as long as you give up on perfection.
There are soft versions of RS codes, but these came much later and use the same iterative techniques that Turbo/LDPC decoders use.
Reed Solomon codes are literally perfect, or more mathematically they are Maximum Distance Codes (https://en.wikipedia.org/wiki/Singleton_bound)
Turbo Codes and LDPC are provably imperfect, failing this property. However, they are very close to perfect (like 99.999999% perfect in practice).
Now the issue with Reed Solomon is that matrix factorization / effective matrix inverse. It's basically impossible to run Reed Solomon above say, 16 bits or 65536 elements or so (2 bytes at that point so 128kB). Because the matrix to solve this would be 65536 x 65536 x 2 bytes or like 8Gb or something.
Hmmm, I guess modern computers can handle 8GB lol. But you get the gist, the O(n^2) is a problem.
LDPC and Turbo Codes are linear. So a 4MB LDPC is gonna be you know... Actually possible on modern computers... While a 4MB Reed Solomon Code will need some number of exabytes to just build the damn decoding matrix. (32 bits times 4MB squared or something like that)
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.
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!"
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.
Man that would have felt like magic...
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.
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.
It was heavily compressed, monochrome, low frame rate, but used a clever upscaling algorithm on the frames to make it watchable.
Though perhaps doing it on the Amiga is cheating. It was overpowered for its time.
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).
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.
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.
GSM.. the added comfort noise was weird to me the first time I heard it while roaming.
In an alternate universe where HEVC existed in the 90's, conceivably intel could have included hardware to assist in decoding it.
320x240 is less than 1% the size of 3840x2160
So, in short, probably. Particularly if you could get a hardware accelerated surface that transformed YUV into RGB.
https://holmesrpi.org/Books/NumComp2/WebPages/NumComp/Is%20T...