Skip to content

Latest commit

 

History

History

src

README.md

Build Instructions

This project only uses C, the build system is a separate C file nob.c (check the structure section)

Requirements:

  • A C11 compatible compiler, tested mainly with gcc on GNU + Linux, cl (a.k.a msvc) on Windows (make sure you are using a 64-bit version)
  • curl on both platforms to download the modified libraries when needed
  • unzip on GNU + Linux or tar on Windows to extract the library bundle

The modified FFmpeg and dav1d libraries are downloaded from the project's "releases" page on GitHub the first time you build if they are missing

Building:

There is a sample project.4coder file along with sample build scripts on this directory. For now it just binds "F1" to compile the inspector (for x11 on the .sh) and F2 to run for "1080_jellyfin.mp4". It's more of an example than something to actually be used

The first time you compile you will have to generate the build tool, simply run (uses gcc by default on GNU + Linux, cl on Windows): gcc nob.c -o nob or cl nob.c

Now you can compile the project with: ./nob(.exe) -target TARGET -platform PLATFORM -mode MODE

The platform libraries are pulled if they are not found. You will be asked if you want to download them now; accept for the project to build

  • TARGET: inspector | reconstructor | tests (see below) | pull (see below)
  • PLATFORM (optional, autodetects if not provided): gnu_linux_x11 | gnu_linux_wayland | windows
  • MODE (optional, defaults to debug): debug | release

For example, to build the inspector for GNU + Linux with X11 with release optimizations: ./nob -target inspector -platform gnu_linux_x11 -mode release

Both GNU + Linux back-ends speak their display protocols directly, so no X11 or Wayland development packages are required

Pulling libs without a specific platform (a.k.a just -target pull) will pull for the OS you are using, if you want to specify you can use pull-windows-libs or pull-gnu-linux-libs

The generated executable will be in the form TARGET_MODE_PLATFORM(.exe) in the build/ directory. Example: build/inspector_release_gnu_linux_x11 or build\inspector_debug_windows.exe.

Running:

You can run the inspector by passing a video path to the executable: build/inspector_...(.exe) -inspect video_path or build/inspector_...(.exe) -eport video_path data_file.dat

Testing:

Testing can be performed with either a whitelist or a blacklist: ./build/tests_...(.exe) -enable TESTS_TO_RUN or ./build/tests_...(.exe) -disable TESTS_TO_EXCLUDE

The flag.h version in this project is modified so list flags consume consecutive values until the next flag. For example, pass -enable arena math. Repeating a list flag is still supported

Not providing any option will run all of the tests.

List of tests (to be expanded):

  • arena: alignment, bounds, and release behavior
  • dyn_arr: dynamic array tests
  • math: macro, numeric helper, and geometry tests
  • input: input state tests
  • utility: platform serialization and endian helper tests
  • renderer: color, rasterization, geometry, and transparency tests
  • threading: platform independent multithreading and frame/render pooling tests

Structure

This includes the following directories:

  1. decode, the AV1 decoding pipeline
  2. docs, information on file and data formats (will have papers and analysis latter)
  3. ds, the data structures used in the projects
  4. export, the -export mode of the inspector
  5. input, input system
  6. inspector, the inspector's main entry point and operations
  7. lib, third-party code used in the project; the modified Windows libraries are included
  8. math, the mathematical functions and objects used in the code
  9. platform, with the platform layers for GNU + Linux (X11 and Wayland) and Windows
  10. renderer, the source code for the software renderer
  11. test_files, files used to test the correctness of the programs. For now this is empty as I didn't write any tests that directly require video data, but I recommend checking the sources for where to get some testing data.
  12. tests, unit tests

The following are present in lib/ (the .h files are in there):

  • nob, the build system (by TSoding)
  • flag, for parsing the build system arguments (by TSoding)
  • astf, for automated testing (by me)
  • "OS_NAME", the modified libraries (FFmpeg and dav1d) pre-compiled for your OS

Inspector

The inspector is a tool to visualize compression data of the videos, such as color channels, chroma channels and inter prediction. See more here

Reconstructor (later)

The reconstructor is a tool to reconstruct 3d models from video data using computer vision. See more on the ideas file here

Profiling

In this project we use both perf and "Intel VTune Profiler" (check sources). Profiling data is not uploaded to GitHub as it's hardware dependent and can be extracted with ease.