Menu
Sign In Search Podcasts Charts People & Topics Add Podcast API Blog Pricing

Jean-Baptiste Kempf

๐Ÿ‘ค Speaker
2148 total appearances

Appearances Over Time

Podcast Appearances

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

assembly language and machine code instructions for you based off your C code.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

And there's a specific flavor of assembly that we use in FFmpeg that's called SIMD, single instruction multiple data.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

So this means, for example, say I want to add five to a number in scalar assembly.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

So this is what's known as you work on an individual element.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

So I have a number 10 and I want to add five.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

I use the add instruction.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

and I add five to 10 and I get 15.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

With SIMD, I can have a whole vector of 16 different numbers that could all be different.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

If I want to add five to that, I can run one instruction, and that one instruction sums all 16 elements.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

And that, as you can imagine, lends itself very well to video.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

Video is a pixel grid, so I can perform operations on multiple pixels at the same time.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

The key thing that we do differently in FFmpeg is we don't use any abstractions or any major abstractions on top of that.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

There's a part of the world that uses what's known as intrinsics.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

These are C functions that behave very similarly but not quite the same to writing assembly by hand.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

The registers that data is stored in on the CPU, the compiler allocates those for you.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

And so the key thing to understand was when we write SIMD is we have a 10X, not percentage, 10X to 50X speed improvement.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

That function is 62X.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

That's nuts.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

On the FFmpeg account, as you know, posts and tweets a lot about that to try and say, hey, we're doing this stuff.

Lex Fridman Podcast
#496 โ€“ FFmpeg: The Incredible Technology Behind Video on the Internet

For the last two years, they go crazy.