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

How is the data shared between the functions?

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

Because there's a convention, what's known as a calling convention.

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

And what David does for optimal reasons is create its own calling convention sometimes.

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

So if I want to call Lex Friedman's library, we've got to agree on a convention so that I can share data with you in the assembly language space.

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

And one of the challenges in assembly is every operating, well, not every operating system, but there are at least four that I can think of on x86.

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

Linux 32-bit, Windows 32-bit, Windows 64, Linux 64.

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

They all have their own calling conventions.

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

And so one of the amazing things Lauren Merritt did, who we talked about before, was create a very lightweight abstraction layer.

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

So you could write your assembly code once and it handled all the calling convention stuff for you.

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

which was always a problem because you had to manage four different variants.

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

But David takes this even further.

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

For speed reasons, it does its own calling convention within itself to bypass the kind of rules, the rules of sort of functions and say, okay, actually I'm going to call a function this way because I know it's within my library.

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

Does it have to be special to every single operating system?

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

Well, if it's custom, no, but the challenge is...

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

In general, yes.

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

And in terms of each instruction set.

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

So the thing to also emphasize is we do this on every instruction set.

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

So every instruction set has its own handwritten assembly, which is even more crazy.

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

And that matrix has got bigger in recent years because of RISC-V, because of...

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

ARM64 because of the new SVE.