explaingit

ffmpeg/asm-lessons

11,871Audience · developerComplexity · 5/5Setup · hard

TLDR

A structured course by the FFmpeg project teaching assembly language programming, the lowest-level instructions a CPU executes, aimed at developers who want to understand and contribute to FFmpeg's hand-optimized video processing code.

Mindmap

mindmap
  root((FFmpeg asm-lessons))
    What it does
      Teach assembly
      FFmpeg contribution prep
      CPU-level understanding
    Prerequisites
      C and pointers
      Vector math basics
    Topics
      Scalar vs vector ops
      SIMD registers
      Video processing
    Extras
      Discord support
      Translations available
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Work through the lesson sequence to build enough assembly knowledge to read and understand FFmpeg's hand-written SIMD optimizations for video encoding.

USE CASE 2

Use the lessons as a reference to learn how modern CPUs handle scalar versus vector operations before attempting to write performance-critical multimedia code.

USE CASE 3

Contribute assembly-level optimizations to the FFmpeg project after completing the course and passing the paired assignments.

Tech stack

AssemblyC

Getting it running

Difficulty · hard Time to first run · 1day+

Requires solid C knowledge including pointers, plus high-school-level vector math, assignments were not yet uploaded at time of writing.

In plain English

This repository contains a set of lessons on assembly language programming, produced by the FFmpeg project. Assembly language is the lowest-level human-readable form of instructions that a computer processor actually executes. Most programmers work in higher-level languages like Python or JavaScript and never touch it, but understanding assembly reveals what is happening inside the machine at a fundamental level. The lessons are specifically aimed at the style of assembly used inside FFmpeg, a widely used open-source toolkit for processing audio and video files. The FFmpeg codebase contains a large amount of hand-written assembly to squeeze out maximum speed from modern processors, particularly for video encoding and decoding tasks. These lessons are designed to help people reach the point where they can understand and contribute to that code. The course requires two things before you start: familiarity with the C programming language (especially pointers), and high school level mathematics including the difference between scalar values and vectors. Assignments paired with each lesson exist but had not been uploaded to the repository at the time of writing. The README is brief and the course content lives in the lesson files themselves rather than in this description. A Discord server is available for asking questions. The lessons are also available in French, Spanish, Turkish, and Chinese translations.

Copy-paste prompts

Prompt 1
I'm working through the FFmpeg asm-lessons course. I understand C pointers but am new to assembly. Explain what a SIMD register is, why FFmpeg uses hand-written assembly for video decoding loops, and show me a minimal x86-64 assembly example that adds two arrays element-by-element.
Prompt 2
Using what the FFmpeg asm-lessons teach, help me write an x86-64 assembly function that takes two float arrays and a count, multiplies them element-by-element using SSE2 instructions, and stores the result in a third array.
Prompt 3
I've finished the FFmpeg asm-lessons and want to submit a patch. Show me how to write an AVX2-optimized version of a simple horizontal sum function in NASM syntax, following FFmpeg's coding conventions for assembly files.
Open on GitHub → Explain another repo

← ffmpeg on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.