Jean-Baptiste Kempf
๐ค SpeakerAppearances Over Time
Podcast Appearances
assembly language and machine code instructions for you based off your C code.
And there's a specific flavor of assembly that we use in FFmpeg that's called SIMD, single instruction multiple data.
So this means, for example, say I want to add five to a number in scalar assembly.
So this is what's known as you work on an individual element.
So I have a number 10 and I want to add five.
I use the add instruction.
and I add five to 10 and I get 15.
With SIMD, I can have a whole vector of 16 different numbers that could all be different.
If I want to add five to that, I can run one instruction, and that one instruction sums all 16 elements.
And that, as you can imagine, lends itself very well to video.
Video is a pixel grid, so I can perform operations on multiple pixels at the same time.
The key thing that we do differently in FFmpeg is we don't use any abstractions or any major abstractions on top of that.
There's a part of the world that uses what's known as intrinsics.
These are C functions that behave very similarly but not quite the same to writing assembly by hand.
The registers that data is stored in on the CPU, the compiler allocates those for you.
And so the key thing to understand was when we write SIMD is we have a 10X, not percentage, 10X to 50X speed improvement.
That function is 62X.
That's nuts.
On the FFmpeg account, as you know, posts and tweets a lot about that to try and say, hey, we're doing this stuff.
For the last two years, they go crazy.