Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prisma

Prisma is a high-performance, from-scratch media transcoder written in C++26.

Features

  • From-Scratch Implementation: Core decoding and encoding algorithms are implemented natively.
  • SIMD Acceleration: PNG decoding utilizes SIMD for vectorized spatial defiltering, achieving speeds exceeding 2 GB/s.
  • Zero-Overhead Memory: Designed to minimize allocations and prevent zero-initialization overhead during encoding.
  • Media Filtering: Built-in core manipulations, including Grayscale and Invert operations.

Current Codec Support

Images

  • BMP: Uncompressed bitmap support (Decode/Encode).
  • PNG: Lossless Deflate-based support (Decode/Encode) with SIMD-accelerated Up-filtering.

Audio

  • WAV: Uncompressed PCM audio over RIFF container (Decode/Encode).
  • FLAC (Planned): Lossy MPEG-1 Audio Layer III codec decoding.

Build

Using Nix

If you use Nix

nix develop

This will instantly drop you into a shell with GCC 16, CMake, Ninja, libdeflate, and CLI11 perfectly configured.

Manual Prerequisites

Compilation

mkdir build
cd build
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
ninja

Usage

Run directly with Nix

If you have Nix installed, you can instantly run the latest version of Prisma directly from GitHub without cloning the repository or manually installing any dependencies:

nix run github:piyush-1337/prisma -- info <input_file>

Inspect Media

Extracts and parses headers to provide information about the media format without fully decoding the payload.

./prisma info <input_file>

Transcode Media

Converts media from one format to another, optionally applying spatial filters.

./prisma convert -i <input_file> -o <output_file> [options]

Benchmarks

Run on an Intel i5-12450HX (8C/12T, 4.4 GHz) with -O3 -march=native (AVX2).

Codec Decode Encode
PNG 2.30 GiB/s 617 MiB/s
BMP 4.05 GiB/s 3.42 GiB/s
WAV 13.04 GiB/s 17.79 GiB/s
cmake -B build -G Ninja -DPRISMA_BUILD_BENCH=ON
ninja -C build
cd build && ./bench/prisma_bench

About

A lightweight multimedia transcoder CLI

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages