AI Poised to Transform Video Compression Landscape
spectrum.ieee.org
spectrum.ieee.org
Humans not only design for compression quality, we also really focus on cost. And we design direct to what is cheap in hardware: integer adds, shifts, binary logic.
I do believe a different paradigm of ML is necessary for this particular application. The neural primitives used need to be more closely related to transistors than to matrix multiplications.
The gravitas will shift to enabling matrix math rather than algorithms being designed for special hardware.
Matrices are the new paradigm.
My point was that if training could emit an efficient video codec as a network of logic gates, rather than as a dense array of neural network weights, it might just produce something practical for video playback on mobile devices and video processing at hyperscale.
That is exactly the same path that led us to GPGPU, which in turn derived to using GPUs to accelerate neural nets. In every step of the way it was about repurposing existing hardware that was designed for something else and was thus suboptimal.
A small number of videos are going to be viewed millions of times. For these few videos it’s worth the compute to do the best possible compression.
There’s no reason the same video formats and decoding hardware can’t be used for both. The high compute version can use an ML model to figure out how to optimize the bandwidth budget across every scene while the cheap version uses some easy heuristics.
This is a common incorrect assumption. You have to balance ratio with speed, otherwise you end up with something that spends more time decompressing than actually downloading, as is literally the case today with XZ. this is why alternatives like Zstandard are getting popular. 9 times faster decompressing for 10% worse ratio.
There's been rumblings about how Google's AI edge would lead to jumps in video and image coding but nothing big seems to have happened yet, though lots of micro-optimisations appear to be ML based.
Some suggested that the AV1 throw a bunch of tools at it spec design was built for AI to use.
Possibly VMAF is the biggest ML impact on codecs so far.
Shot or scene based detection can be used to place your I, P, and B frames in better locations for example.
For those that don't know, an I frame is a keyframe, a still image. P and B frame are predictions off of other frames (such as a keyframe). Frames within the same shot or scene are likely to be similar to one another, so having awareness of that contextual information can help you place for example a keyframe at precisely the start of that shot or scene, and predict everything in that shot or scene off of that.
The main advantage of ML for video compression is that people accept giant ML models, so you can hide a lot of common "features" in there. The disadvantage is that classical codecs are macroblock-based for a reason; you can't just process a whole frame at a time, nobody has the memory bandwidth for that.
I think it's not so abstract at all. The relationship feels fundamental.
Encoder, decoder, codec. Compression, entropy, lossiness, ...
There's been some cool stuff in the speech area: https://ai.googleblog.com/2021/02/lyra-new-very-low-bitrate-...
Also from Microsoft: https://techcommunity.microsoft.com/t5/microsoft-teams-blog/...
There's actually a pretty nice read from one of the key figures in data compression field - Matt Mahoney: "Text Compression as a Test for Artificial Intelligence" [1]. Some interesting reads are also on his personal website, though a bit outdated now: https://mattmahoney.net/dc/rationale.html
[1] https://static.aminer.org/pdf/PDF/000/014/009/text_compressi...
I don't know how much better AI can do in practice.
If you sit down and really think through how an intraframe compression technique works - something like JPEG or MPEG - You may come to the conclusion that we are already playing with the fringes of our reality.
Consider The DCT and quantization. When a piece of information is transformed by The DCT, we talk about "energy compaction". That is to say, we took a block of information and determined how to represent it as a perfect (lossless) arrangement of amplitudes at given frequencies. This results in most of the important information (in human terms) condensing around the DC component in the top-left corner. We then use something explicitly engineered (i.e. 'trained') on the human visual system to quantize these figures into levels the computer can tolerate (incurring loss). Zig-zag encoding is practically an emergent mathematical mandate at this point...
Then, take a long look at how we are doing interframe compression. Forward & backward difference frames, frames that are differences of differences, predicted vectors of information, etc. A lot of this is very obvious, but there are tradeoffs to be made that perhaps a human should be in charge of - I.e. subjective measures of latency in video streaming relative to group-of-picture size.
Consider this - How could an AI system improve on techniques that optimize for the Human Visual System? A very large part of our multimedia compression today comes from strategically sacrificing information that is subjectively worthless to humans.
All that said, I am sure you can find some low-hanging fruit. For example, if you go and ask ChatGPT to make JPEG work better, it may helpfully suggest swapping Huffman for arithmetic coding. Not exactly a groundbreaking discovery in my book, but it would make a big difference.
Roughly 10% improvement I believe.
One way it may believed that AI may improve upon the traditional methods you mention is the assumption that AI can learn a tighter optimisation for the human system (than humans can handcraft)
Exactly that. AI could recognize what is important in a frame and use less compression there, while using pattern generation for high entropy parts which are not important.
In the context of video, that means not spending bits on things like wall textures, plants, buildings, crowds, details of misc objects, etc.
Coming soon, you show AI the script and the poster of the movie you want to compress, and then it just makes shit up on the fly when you hit play. There is no compression! The movie will be unique to each viewer as the algo will take a seed from each playback device and create the music, images, dialog all on the fly.
A 2 hour movie in <1MB of storage
I mean, it's fine for stuff that doesn't really matter like video conferencing or TV/films, but I think you'd be mad to use this for CCTV or science or whatever.
https://machinelearning.apple.com/research/neural-engine-tra...
I wonder if coupling an AI to help find self-similar portions of the image could revive this idea?
not sure about actual implementations
I got super into the concept of fractal compression when I was young, and then became pretty disillusioned at how primitive the techniques turned out to be. IIRC it wasn’t much more than “divide the image into, say 16x16 blocks, then search for 8x8 blocks which are similar to a 50% scaled version of a large block, and store the delta”. Young me was hoping for some cool math, but it was more like brute force motion compensation within a single image.
When AI is using a LLM dataset to fill in the gaps, it becomes a problem, because it's guessing what should be there when the "natural" noise would be better depicting nothing. Predictive vectors such as SVG use smooth images. i think the rasterization of a dataset turns single pixels into quasi-intelligible datapoints, but when treated indendently by a dumb AI, ends up rendering eye balls on a forehead. This is your problem, not mine. Please fix it.
That Xerox bug is interesting- I once used a Parallel port cable to print to an Apple Laser Printer from the 90s, until Windows 7 no longer supported the driver. I don't remember how many megabytes were transferred for large print jobs, but it seemed to take a while. I thought- perhaps it would be better if it sent the data in low-byte, text only code, so that the printer-side can reconstruct text using hard-coded translation the as opposed rendering all the bitmap- and while some data was xferred as a JPEG, perhaps it was compressed, and thus altered.