diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 38f4b228..dd860cbd 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -10,7 +10,7 @@ "name": "vuio", "displayName": "VuIO Media Server", "description": "Browse, search and cast your VuIO media library — and control the TVs and speakers on your network — from Claude.", - "version": "0.0.44", + "version": "0.0.45", "author": { "name": "vyrti", "url": "https://github.com/vuiodev" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ad1b2cc..6ba50b37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: with: components: rustfmt - name: Check formatting - run: cargo fmt --all -- --check + run: cargo fmt -p vuio-core -p vuio-cli -p vuio-cast -p vuio-web -- --check # =================================================================== # The web interface ships compiled into the binary. @@ -130,7 +130,7 @@ jobs: target/ key: clippy-${{ matrix.os }}-${{ hashFiles('**/Cargo.lock') }} - name: Run Clippy - run: cargo clippy --all-targets --all-features -- -D clippy::all -D warnings + run: cargo clippy -p vuio-core -p vuio-cli -p vuio-cast -p vuio-web --all-targets --all-features -- -D clippy::all -D warnings # =================================================================== # Guard the published API of vuio-core. @@ -233,11 +233,21 @@ jobs: run: cargo check -p vuio-core --no-default-features - name: Build each feature alone run: | - for feature in casting dashboard diagnostics mcp metadata web-ui; do + for feature in casting dashboard diagnostics mcp mediainfo metadata web-ui \ + demux transcode transcode-ac3 transcode-dts transcode-aac; do echo "::group::$feature" cargo check -p vuio-core --no-default-features --features "$feature" echo "::endgroup::" done + # The transcode features are on by default, which makes their *absence* + # the path that rots unnoticed. Everything else here proves a feature + # builds; this proves the server still builds and behaves without one. + - name: Build with the decoders dropped + run: | + cargo check -p vuio-core --no-default-features \ + --features casting,dashboard,diagnostics,mcp,mediainfo,metadata,web-ui + cargo test -p vuio-core --lib --no-default-features \ + --features casting,dashboard,diagnostics,mcp,mediainfo,metadata,web-ui,unstable-internals - name: Build with everything run: cargo check -p vuio-core --all-features @@ -338,9 +348,9 @@ jobs: run: | sudo apt-get update if [ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]; then - sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross elif [ "${{ matrix.target }}" == "armv7-unknown-linux-gnueabihf" ]; then - sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross + sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross fi - name: Configure cross-linker (Linux ARM) if: runner.os == 'Linux' && (matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'armv7-unknown-linux-gnueabihf') @@ -383,7 +393,7 @@ jobs: mem: "6144" cache-after-prepare: true prepare: | - pkg install -y curl bash git + pkg install -y curl bash git cmake curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal run: | set -e @@ -421,7 +431,7 @@ jobs: mem: "6144" cache-after-prepare: true prepare: | - pkg install -y curl bash git rust + pkg install -y curl bash git rust cmake run: | set -e rustc -vV @@ -500,9 +510,9 @@ jobs: run: | sudo apt-get update if [ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]; then - sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross elif [ "${{ matrix.target }}" == "armv7-unknown-linux-gnueabihf" ]; then - sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross + sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross fi - name: Configure cross-linker (Linux ARM) if: runner.os == 'Linux' && (matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'armv7-unknown-linux-gnueabihf') @@ -542,7 +552,7 @@ jobs: mem: "6144" cache-after-prepare: true prepare: | - pkg install -y curl bash git + pkg install -y curl bash git cmake curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal run: | set -e @@ -613,7 +623,7 @@ jobs: mem: "6144" cache-after-prepare: true prepare: | - pkg install -y curl bash git rust + pkg install -y curl bash git rust cmake run: | set -e rustc -vV diff --git a/Cargo.toml b/Cargo.toml index e4cada3c..d9a1f857 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,24 @@ members = [ # Development tool, `publish = false`. Kept out of `vuio-cli` so the crate that # ships the binary does not carry its dependencies. "crates/vuio-bench", + + # Our AC-3 / E-AC-3 codec — forked from oxideav-ac3, now maintained here. + # Not a default member for the same reason the vendored crates are not: its + # 100-plus tests (several of which shell out to ffmpeg) stay off the release + # path, while `cargo build` still compiles the library via vuio-core. + "crates/vuio-codec-ac3", + + # The DTS decoder and the shared codec runtime, vendored verbatim from + # github.com/OxideAV by `scripts/vendor-oxideav.sh`. Members so cargo + # resolves the path deps and `cargo test -p oxideav-dts` works; deliberately + # not default members, so their own test and bench targets stay off the + # release path — the same reasoning that keeps `vuio-bench` out, and the + # reason a plain `cargo build` still compiles them (vuio-core depends on + # them) without building their tests. + "crates/vendor/oxideav-core", + "crates/vendor/oxideav-dts", + "crates/vendor/libxaac-sys", + "crates/vendor/xaac-rs", ] # `vuio-bench` is deliberately not a default member. Cargo unifies features across @@ -22,6 +40,41 @@ default-members = [ ] resolver = "2" +[patch.crates-io] +libxaac-sys = { path = "crates/vendor/libxaac-sys" } +xaac-rs = { path = "crates/vendor/xaac-rs" } + +# Optimizing codecs, encoders, and demuxers in dev profile gives fast real-time +# audio decoding and encoding without requiring release rebuilds. +[profile.dev.package.oxideav-core] +opt-level = 3 +[profile.dev.package.vuio-codec-ac3] +opt-level = 3 +[profile.dev.package.oxideav-dts] +opt-level = 3 +[profile.dev.package.xaac-rs] +opt-level = 3 +[profile.dev.package.libxaac-sys] +opt-level = 3 +[profile.dev.package.symphonia] +opt-level = 3 +[profile.dev.package.symphonia-core] +opt-level = 3 +[profile.dev.package.symphonia-format-mkv] +opt-level = 3 +[profile.dev.package.symphonia-format-riff] +opt-level = 3 +[profile.dev.package.symphonia-format-isomp4] +opt-level = 3 +[profile.dev.package.symphonia-bundle-flac] +opt-level = 3 +[profile.dev.package.symphonia-bundle-mp3] +opt-level = 3 +[profile.dev.package.symphonia-codec-aac] +opt-level = 3 +[profile.dev.package.symphonia-codec-pcm] +opt-level = 3 + [profile.release] opt-level = 3 lto = "fat" diff --git a/Dockerfile b/Dockerfile index 3ec73d48..1dd0d1cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,10 +37,19 @@ RUN RUST_TARGET=$(cat /tmp/rust_target) && \ # Copy the workspace and build the server. Only this layer rebuilds when source # changes. `--bin vuio` skips the generate_test_media helper binary. +# +# VUIO_CARGO_FLAGS is for trimming the image. The default build is the whole +# server, including the AC-3/E-AC-3/DTS decoders — the person whose television +# plays a film silently is not going to rebuild an image to fix it. An operator +# who knows their renderers and wants the ~6 MB of decoder out can pass, e.g.: +# +# --build-arg VUIO_CARGO_FLAGS="--no-default-features \ +# --features casting,dashboard,diagnostics,mcp,mediainfo,metadata,web-ui" +ARG VUIO_CARGO_FLAGS="" COPY Cargo.toml Cargo.lock ./ COPY crates ./crates RUN RUST_TARGET=$(cat /tmp/rust_target) && \ - cargo build --release --locked --target $RUST_TARGET --package vuio-cli --bin vuio && \ + cargo build --release --locked --target $RUST_TARGET --package vuio-cli --bin vuio $VUIO_CARGO_FLAGS && \ cp target/$RUST_TARGET/release/vuio /tmp/vuio # ---- Final Stage ---- diff --git a/claude/mcpb/manifest.json b/claude/mcpb/manifest.json index b1d423f2..4e865f8d 100644 --- a/claude/mcpb/manifest.json +++ b/claude/mcpb/manifest.json @@ -2,7 +2,7 @@ "manifest_version": "0.3", "name": "vuio", "display_name": "VuIO Media Server", - "version": "0.0.44", + "version": "0.0.45", "description": "Browse, search and cast your VuIO media library from Claude.", "long_description": "Connects Claude to a VuIO media server on your network. Search the library, browse folders, build playlists, and cast to DLNA, Chromecast and AirPlay devices.\n\nThis bundle runs `vuio mcp`, which bridges Claude's stdio connection to a VuIO server that is already running. It does not start a server or open the library database itself — point it at the machine that does.", "author": { diff --git a/claude/plugin/.claude-plugin/plugin.json b/claude/plugin/.claude-plugin/plugin.json index aa03c42f..acbfc8d8 100644 --- a/claude/plugin/.claude-plugin/plugin.json +++ b/claude/plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "vuio", "displayName": "VuIO Media Server", - "version": "0.0.44", + "version": "0.0.45", "description": "Browse, search and cast your VuIO media library — and control the TVs and speakers on your network — from Claude.", "author": { "name": "vyrti", diff --git a/compare.md b/compare.md new file mode 100644 index 00000000..420c696b --- /dev/null +++ b/compare.md @@ -0,0 +1,138 @@ +# Feature Comparison: VuIO vs Jellyfin, Plex, Emby & MiniDLNA + +A comprehensive technical and functional comparison between **VuIO** and popular media server solutions: **Jellyfin**, **Plex Media Server**, **Emby**, **MiniDLNA (ReadyMedia)**, and **Universal Media Server (UMS)**. + +--- + +## 1. High-Level Overview & Philosophy + +| Aspect | VuIO | Jellyfin | Plex | Emby | MiniDLNA | Universal Media Server | +|---|---|---|---|---|---|---| +| **Core Philosophy** | Ultra-lightweight, high-performance, single-binary, AI-native media hub | Full-featured open-source self-hosted Netflix-style media platform | Commercial media ecosystem with cloud accounts and client apps | Commercial media platform with open/closed hybrid model | Minimalist background DLNA daemon | Java-based transcoding DLNA/UPnP server | +| **Language & Runtime** | Pure **Rust** (Tokio, Axum, SQLite) | **C# / .NET** (ASP.NET Core) | **C++** (Proprietary) | **C# / .NET** | **C** | **Java** (JVM) | +| **License** | **MIT / Apache-2.0** (100% FOSS) | **GPL-2.0** (100% FOSS) | **Proprietary** / Freemium (Plex Pass) | **Proprietary** / Freemium (Emby Premiere) | **GPL-2.0** (100% FOSS) | **GPL-2.0** (100% FOSS) | +| **RAM Usage (Idle / Active)** | **~25 MB – 80 MB** | 400 MB – 1.5 GB+ | 350 MB – 1.2 GB+ | 300 MB – 1.0 GB+ | **~15 MB – 50 MB** | 500 MB – 2.0 GB+ | +| **Distribution** | **Single standalone binary** (~15 MB) | Large runtime (~300 MB+ installed) | Large installer / image (~400 MB+) | Large installer / image (~300 MB+) | Lightweight binary + config | Large JAR + dependencies | +| **External Dependencies** | **None** (Self-contained) | .NET Runtime, FFmpeg | Proprietary codecs, Transcoder | FFmpeg, .NET | libjpeg, libsqlite3, libav | Java JRE, FFmpeg, MPlayer | +| **Cloud Account Required** | ❌ **No** (100% local) | ❌ **No** (100% local) | ⚠️ **Yes** (Plex.tv account & auth) | ⚠️ Optional (Emby Connect) | ❌ **No** | ❌ **No** | + +--- + +## 2. Comprehensive Feature Matrix + +### 📺 Protocols, Playback & Streaming + +| Feature | VuIO | Jellyfin | Plex | Emby | MiniDLNA | Universal Media Server | +|---|---|---|---|---|---|---| +| **DLNA / UPnP Media Server** | ✅ Full (SSDP, mDNS, DIDL-Lite, browse cache) | ✅ Basic | ✅ Basic | ✅ Basic | ✅ Full | ✅ Full | +| **Google Cast / Chromecast** | ✅ Native direct casting (Rust `ring` TLS) | ✅ Via web/app client | ✅ Via web/app client | ✅ Via web/app client | ❌ None | ⚠️ Limited | +| **AirPlay Video / Audio** | ✅ Native AirPlay discovery & streaming | ❌ Via third-party | ❌ Via third-party | ❌ Via third-party | ❌ None | ❌ None | +| **HLS Stream In-Browser** | ✅ Yes (segmented on-the-fly HLS) | ✅ Yes | ✅ Yes | ✅ Yes | ❌ None | ✅ Yes | +| **HTTP Byte-Range Streaming** | ✅ Yes (Sub-millisecond 4K seek) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | +| **Live Radio Broadcasting** | ✅ Yes (Synchronous playout clock + P2P discovery) | ❌ None | ⚠️ Live TV / Audio plugins | ⚠️ Live TV plugins | ❌ None | ⚠️ Web streams | +| **Sidecar SRT to WebVTT** | ✅ Dynamic on-the-fly (Zero disk I/O) | ✅ Yes | ✅ Yes | ✅ Yes | ❌ None | ⚠️ Transcode | +| **Audio Transcoding** | ✅ AC-3, E-AC-3, DTS → LPCM / AAC-LC | ✅ Full FFmpeg | ✅ Full FFmpeg | ✅ Full FFmpeg | ❌ None | ✅ Full FFmpeg | +| **Video Passthrough Remuxing** | ✅ Zero-copy H.264/HEVC remuxing | ✅ Yes | ✅ Yes | ✅ Yes | ❌ None | ✅ Yes | +| **Heavy Video Re-encoding** | ❌ Deliberately omitted (Low CPU focus) | ✅ Full (GPU NVENC/VAAPI/QSV) | ✅ Full (GPU NVENC/QSV - Paid) | ✅ Full (GPU NVENC/QSV - Paid) | ❌ None | ✅ Full (CPU/GPU) | + +--- + +### 🤖 AI Agent, Automation & Developer Experience + +| Feature | VuIO | Jellyfin | Plex | Emby | MiniDLNA | Universal Media Server | +|---|---|---|---|---|---|---| +| **Model Context Protocol (MCP)** | ✅ **Native MCP (2026-07-28)** for Claude, ChatGPT, LLM agents | ❌ None | ❌ None | ❌ None | ❌ None | ❌ None | +| **AI Assistant Control** | ✅ Browse, search, play, cast via AI agents | ❌ Custom scripts only | ❌ Custom scripts only | ❌ Custom scripts only | ❌ None | ❌ None | +| **REST API** | ✅ Clean, lightweight JSON API | ✅ Large REST API | ✅ XML/JSON API | ✅ Large REST API | ❌ None | ⚠️ Web API | +| **OpenAPI / Swagger Spec** | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes | ❌ No | ❌ No | +| **Live Config Hot-Reload** | ✅ 21 of 25 settings live reload (0 restart) | ⚠️ Partial | ⚠️ Partial | ⚠️ Partial | ❌ Requires restart | ⚠️ Partial | +| **Self-Updating Binary** | ✅ Built-in (`vuio --update`) | ❌ Package manager only | ⚠️ In-app (Plex Pass) | ⚠️ In-app | ❌ Package manager only | ⚠️ In-app | + +--- + +### 📚 Metadata & Library Management + +| Feature | VuIO | Jellyfin | Plex | Emby | MiniDLNA | Universal Media Server | +|---|---|---|---|---|---|---| +| **Metadata Scraping Providers** | ✅ TMDb, OMDb, TVmaze, MusicBrainz, Discogs, Last.fm, Genius, AniList, Jikan, Kitsu | ✅ TMDb, TheTVDB, OMDb, MusicBrainz | ✅ Plex Media Agent (Proprietary) | ✅ TMDb, TheTVDB, MusicBrainz | ❌ Embedded tags only | ⚠️ TMDb, MusicBrainz | +| **Anime-Specific Metadata** | ✅ AniList, Jikan (MyAnimeList), Kitsu | ⚠️ Via community plugins | ⚠️ Via third-party agents | ⚠️ Via community plugins | ❌ None | ❌ None | +| **Music Tag Extraction** | ✅ ID3v1/v2, FLAC/Vorbis, MP4/AAC, RIFF tags | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Basic ID3/FLAC | ✅ Basic | +| **Playlist Formats** | ✅ M3U, M3U8, PLS auto-discovery | ✅ M3U, Web playlists | ✅ Proprietary | ✅ M3U, Web playlists | ✅ M3U, PLS | ✅ M3U, PLS | +| **Live Filesystem Watcher** | ✅ Real-time async notify watcher | ✅ Yes | ✅ Yes | ✅ Yes | ✅ inotify (Linux only) | ✅ Yes | +| **Database Engine** | ✅ Embedded SQLite with WAL mode & memory cache | SQLite / EF Core | SQLite (Custom tuned) | SQLite | SQLite | H2 / SQLite | + +--- + +### 🌐 User Interface & Client Ecosystem + +| Feature | VuIO | Jellyfin | Plex | Emby | MiniDLNA | Universal Media Server | +|---|---|---|---|---|---|---| +| **Web Interface** | ✅ Dual UI: Modern Svelte (`:8090`) + Light Dashboard (`:8080`) | ✅ Modern Vue/React Web UI | ✅ Feature-rich Web UI | ✅ Feature-rich Web UI | ❌ Basic status page only | ✅ Basic web interface | +| **Dedicated Mobile Apps** | ⚠️ Use standard DLNA / Cast / Web UI | ✅ iOS & Android (FOSS) | ✅ iOS & Android (Paid/IAP) | ✅ iOS & Android (Paid/IAP) | ❌ Standard DLNA apps | ❌ Standard DLNA apps | +| **Dedicated Smart TV Apps** | ⚠️ Native DLNA / AirPlay / Cast to all TVs | ✅ Android TV, Roku, Apple TV, LG webOS, Tizen | ✅ All Smart TV app stores | ✅ All Smart TV app stores | ⚠️ Native DLNA | ⚠️ Native DLNA | +| **Multi-User Profiles** | ⚠️ Network CIDR / admin auth token | ✅ Granular user accounts & watch history | ✅ Home users & cloud sharing | ✅ Granular user accounts | ❌ None | ❌ None | + +--- + +### 📊 Observability, Cloud-Native & Deployment + +| Feature | VuIO | Jellyfin | Plex | Emby | MiniDLNA | Universal Media Server | +|---|---|---|---|---|---|---| +| **Prometheus Metrics** | ✅ Native (`/metrics` Prometheus exposition) | ⚠️ Via community plugin | ⚠️ Via third-party exporters | ⚠️ Via plugin | ❌ None | ❌ None | +| **Kubernetes Health Probes** | ✅ Native `/healthz` & `/readyz` | ⚠️ Web UI HTTP probe | ⚠️ Web UI HTTP probe | ⚠️ Web UI HTTP probe | ❌ None | ❌ None | +| **Helm Chart** | ✅ Official Helm chart (`oci://ghcr.io/...`) | ⚠️ Community charts | ⚠️ Community charts | ⚠️ Community charts | ❌ None | ❌ None | +| **Log Streaming Endpoint** | ✅ Native `/logs` for Grafana Loki/Alloy | ❌ File/Systemd logs only | ❌ File/Plex logs only | ❌ File logs only | ❌ Systemd only | ❌ File logs only | +| **Docker Footprint** | ✅ Minimal scratch/distroless container (~25 MB) | ⚠️ ~500 MB – 1 GB | ⚠️ ~800 MB+ | ⚠️ ~600 MB+ | ⚠️ ~50 MB | ⚠️ ~600 MB+ | +| **Linux Distro Packages** | ✅ DEB, RPM, APK (Alpine), Arch (Pacman), Musl, Tarballs | ⚠️ DEB, RPM, Flatpak | ⚠️ DEB, RPM, Snap | ⚠️ DEB, RPM, Flatpak | ✅ Distro repos | ⚠️ Tarball / Flatpak | + +--- + +## 3. In-Depth Head-to-Head Comparison + +### VuIO vs Jellyfin +* **Resource Efficiency**: VuIO uses ~25 MB of RAM and boots in milliseconds, whereas Jellyfin runs on the .NET runtime consuming 400 MB to 1+ GB RAM. +* **Architecture**: VuIO is a single compiled binary without external dependencies (no runtime or separate FFmpeg executable needed). Jellyfin is a full web application platform. +* **Modern Protocols**: VuIO includes native Chromecast and AirPlay senders directly in the backend and supports the AI Model Context Protocol (MCP). Jellyfin relies on client apps and standard web streams. +* **When to choose Jellyfin**: If you want multi-user parental control profiles, remote watch-together synchronization, or heavy on-the-fly video resolution/bitrate downscaling for remote mobile streaming. +* **When to choose VuIO**: If you want a blazingly fast, lightweight local media server that streams directly to TVs, Chromecast, and AirPlay with zero bloat and full AI agent interoperability. + +--- + +### VuIO vs Plex +* **Privacy & Telemetry**: VuIO has **zero telemetry, zero phone-home, and no account requirements**. Plex requires authenticating through `plex.tv` cloud servers and collects user metrics. +* **Licensing & Cost**: VuIO is 100% Free and Open Source (MIT / Apache-2.0). Plex locks features (hardware transcoding, mobile playback, offline sync, DVR) behind the paid **Plex Pass**. +* **Simplicity**: VuIO can be launched by running a single binary pointing at a folder: `./vuio /media`. Plex requires complex installation, claiming servers, and cloud account linking. +* **When to choose Plex**: If you want turnkey commercial client applications on every app store with cloud-managed remote access sharing with friends/family. +* **When to choose VuIO**: If you value privacy, open-source software, low memory usage, and zero cloud dependency. + +--- + +### VuIO vs MiniDLNA (ReadyMedia) +* **Modern Web Interface & Experience**: MiniDLNA has no user interface (only a raw plain-text status page). VuIO provides a modern Svelte 5 web player interface with audio/video scrubbing and album art. +* **Casting & Playback**: MiniDLNA only speaks DLNA/UPnP. VuIO streams to DLNA, Google Cast / Chromecast, AirPlay, and in-browser HLS. +* **Metadata**: MiniDLNA only extracts embedded ID3/MP4 tags and cannot scrape posters, summaries, or ratings from TMDb, OMDb, MusicBrainz, or AniList. +* **Maintainability**: MiniDLNA is written in legacy C with manual memory management; VuIO is written in memory-safe asynchronous Rust. +* **When to choose VuIO**: VuIO is the modern, drop-in replacement for MiniDLNA with rich web capabilities, multi-protocol casting, and metadata enrichment while maintaining the same lightweight resource footprint. + +--- + +### VuIO vs Universal Media Server (UMS) +* **Runtime & Overhead**: UMS is built in Java and requires a heavy Java Runtime Environment (JRE), consuming high RAM and CPU cycles. VuIO is native machine code. +* **AI & Cloud-Native Integration**: VuIO provides first-class Prometheus metrics, Kubernetes probes, log streaming, and AI MCP integration. UMS is a desktop-focused Java utility. + +--- + +## 4. Summary: When Should You Use VuIO? + +``` + VU IO + "The High-Performance, AI-Ready Modern Media Hub" + ────────────────────────────────────────────────────────────────── + ✔ Low Resource Consumption (~25 MB RAM, instant startup) + ✔ Single Standalone Binary (Zero runtime dependencies) + ✔ Multi-Protocol Streaming (DLNA + Chromecast + AirPlay + Web HLS) + ✔ AI Agent & MCP Support (Claude, ChatGPT, Local LLM integration) + ✔ Rich Metadata Enrichment (TMDb, OMDb, MusicBrainz, AniList) + ✔ Live Radio Broadcasting (P2P synced station streaming) + ✔ 100% Local & Private (No cloud accounts, no paywalls, open source) +``` diff --git a/config.example.toml b/config.example.toml index d1d4a225..3e66a516 100644 --- a/config.example.toml +++ b/config.example.toml @@ -34,6 +34,8 @@ watch_for_changes = true supported_extensions = [ "mp4", "mkv", "avi", "mov", "wmv", "flv", "webm", "m4v", "mpg", "mpeg", "3gp", "ogv", "mp3", "flac", "wav", "aac", "ogg", "wma", "m4a", "opus", "ape", + # Elementary Dolby and DTS streams, decoded for renderers that cannot play them. + "ac3", "eac3", "ec3", "dts", "jpg", "jpeg", "png", "gif", "bmp", "webp", "tiff", "svg", "heif", "heic", "avif" ] # cleanup_deleted_files = true # Drop files the startup scan finds gone @@ -121,3 +123,42 @@ port = 8090 # Must differ from server.port # Whether a fetched title outranks the one read from the file's own tags. # prefer_online_titles = true # request_timeout_seconds = 15 + +# Audio for TVs that cannot decode AC-3, Dolby Digital Plus or DTS. +# Those codecs are licensed, and a set sold without the licence plays the +# picture and nothing else. When this is on, such a film is offered twice — the +# original and an already-decoded version — and the TV plays whichever it can. +# A TV that was already fine is unaffected. +[transcode] +enabled = true +# What the decoded version is delivered as. +# ac3 Dolby Digital, which is what a television was built to decode. The +# only one that keeps a film's surround: a DTS 5.1 soundtrack arrives +# as AC-3 5.1 at 640 kbps rather than folded down to a stereo pair. +# Constant-bitrate, so an audio item gets an exact Content-Length and +# real byte-range seeking +# aac about a third of that, lossy, and folded down to stereo in every +# case. The encoder's output size is not known ahead of time, so an +# audio item carries no Content-Length and cannot be scrubbed +# lpcm uncompressed, seekable, about 1.5 Mbps. Audio items only — a film's +# soundtrack shares a transport stream with the picture, where PCM at +# 1.5 Mbps a channel does not fit, so a film falls back to ac3 +# A film's picture is copied through untouched whatever this says. To a +# television it goes as a transport stream, seekable by byte; to the browser +# player as fragmented MP4 with AAC, because no browser decodes AC-3. +audio_format = "ac3" +# Operating mode for transcode advertisement: +# enabled transcode is available; original stream listed first, transcode as alternative +# forced transcode is forced; only transcoded stream is offered so every TV plays it +# disabled transcode is disabled +mode = "enabled" +# Sessions allowed at once, shared between TVs and the browser player. Past this +# a further request is refused rather than queued. +# +# Set high on purpose. A television opens three connections within a second of +# pressing play — one to play on, one to read the end of the file, and one to +# play on again — so a low ceiling refuses the one it meant to play on and the +# film never starts. The work is cheap besides: the picture is passed through +# and so is Dolby, and only a DTS soundtrack is really decoded. Lower it only if +# you have a genuine reason to cap the CPU. +max_concurrent = 100 diff --git a/crates/vendor/libxaac-sys/.cargo-ok b/crates/vendor/libxaac-sys/.cargo-ok new file mode 100644 index 00000000..5f8b7958 --- /dev/null +++ b/crates/vendor/libxaac-sys/.cargo-ok @@ -0,0 +1 @@ +{"v":1} \ No newline at end of file diff --git a/crates/vendor/libxaac-sys/.cargo_vcs_info.json b/crates/vendor/libxaac-sys/.cargo_vcs_info.json new file mode 100644 index 00000000..a69bb372 --- /dev/null +++ b/crates/vendor/libxaac-sys/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "df357b887a1aa96398f9eb319931ee51cf3377fe" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/crates/vendor/libxaac-sys/Cargo.toml b/crates/vendor/libxaac-sys/Cargo.toml new file mode 100644 index 00000000..27e7d5d6 --- /dev/null +++ b/crates/vendor/libxaac-sys/Cargo.toml @@ -0,0 +1,70 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2024" +rust-version = "1.85" +name = "libxaac-sys" +version = "0.1.0" +authors = ["Yehor Smoliakov "] +build = "build.rs" +links = "xaac" +include = [ + "Cargo.toml", + "README.md", + "build.rs", + "wrapper.h", + "examples/**", + "src/**", + "libxaac/**", +] +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false +description = "Rust FFI bindings to the libxaac AAC/xHE-AAC encoder and decoder library" +documentation = "https://docs.rs/libxaac-sys" +readme = "README.md" +keywords = [ + "aac", + "xhe-aac", + "ffi", + "bindings", + "audio", +] +categories = [ + "external-ffi-bindings", + "multimedia::audio", +] +license = "Apache-2.0" + +[features] +bundled = [] +default = [ + "bundled", + "static", +] +dynamic = [] +static = [] + +[lib] +name = "libxaac_sys" +path = "src/lib.rs" + +[[example]] +name = "sample" +path = "examples/sample.rs" + +[dependencies] + +[build-dependencies] +cc = "1.0" diff --git a/crates/vendor/libxaac-sys/Cargo.toml.orig b/crates/vendor/libxaac-sys/Cargo.toml.orig new file mode 100644 index 00000000..e8c9d57b --- /dev/null +++ b/crates/vendor/libxaac-sys/Cargo.toml.orig @@ -0,0 +1,38 @@ +[package] +name = "libxaac-sys" +version = "0.1.0" +edition = "2024" +rust-version = "1.85" +authors = ["Yehor Smoliakov "] +description = "Rust FFI bindings to the libxaac AAC/xHE-AAC encoder and decoder library" +readme = "README.md" +license = "Apache-2.0" +documentation = "https://docs.rs/libxaac-sys" +keywords = ["aac", "xhe-aac", "ffi", "bindings", "audio"] +categories = ["external-ffi-bindings", "multimedia::audio"] +links = "xaac" +include = [ + "Cargo.toml", + "README.md", + "build.rs", + "wrapper.h", + "examples/**", + "src/**", + "libxaac/**", +] + +[features] +default = ["bundled", "static"] +bundled = [] +static = [] +dynamic = [] + +[dependencies] + +[build-dependencies] +bindgen = "0.72" + +[profile.release] +lto = true +codegen-units = 1 +strip = "symbols" diff --git a/crates/vendor/libxaac-sys/README.md b/crates/vendor/libxaac-sys/README.md new file mode 100644 index 00000000..d5006908 --- /dev/null +++ b/crates/vendor/libxaac-sys/README.md @@ -0,0 +1,55 @@ +# libxaac-sys + +Rust FFI bindings for the vendored `libxaac` C library. + +This crate exposes low-level bindings to the `libxaac` encoder and decoder APIs. +By default it builds the bundled upstream sources and does not require a system +installation of `libxaac`. + +Upstream project: + +## Features + +- `bundled`: + Build the vendored `libxaac` sources with CMake. Enabled by default. +- `static`: + Prefer static linking. Enabled by default. +- `dynamic`: + Prefer dynamic linking when using a system-provided `libxaac`. + +`static` and `dynamic` are mutually exclusive. + +## Linking Modes + +Default: + +```toml +[dependencies] +libxaac-sys = "0.1" +``` + +Bundled static build: + +```toml +[dependencies] +libxaac-sys = { version = "0.1", features = ["bundled", "static"] } +``` + +System dynamic linking: + +```toml +[dependencies] +libxaac-sys = { version = "0.1", default-features = false, features = ["dynamic"] } +``` + +System static linking: + +```toml +[dependencies] +libxaac-sys = { version = "0.1", default-features = false, features = ["static"] } +``` + +## License + +This crate is licensed under Apache-2.0. The vendored upstream `libxaac` +sources are included under their Apache-2.0 license in `libxaac/LICENSE`. diff --git a/crates/vendor/libxaac-sys/build.rs b/crates/vendor/libxaac-sys/build.rs new file mode 100644 index 00000000..33fa6375 --- /dev/null +++ b/crates/vendor/libxaac-sys/build.rs @@ -0,0 +1,225 @@ +use std::env; +use std::path::{Path, PathBuf}; +use std::process::Command; + +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-changed=wrapper.h"); + println!("cargo:rerun-if-changed=libxaac"); + + let bundled = env::var_os("CARGO_FEATURE_BUNDLED").is_some(); + let prefer_static = env::var_os("CARGO_FEATURE_STATIC").is_some(); + let prefer_dynamic = env::var_os("CARGO_FEATURE_DYNAMIC").is_some(); + + assert!( + !(prefer_static && prefer_dynamic), + "`static` and `dynamic` features are mutually exclusive" + ); + + let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("missing manifest dir")); + let source_dir = manifest_dir.join("libxaac"); + let out_dir = PathBuf::from(env::var("OUT_DIR").expect("missing OUT_DIR")); + + if bundled { + let processor = cmake_processor(); + let build_dir = out_dir.join("cmake-build"); + + if build_dir.exists() { + std::fs::remove_dir_all(&build_dir) + .unwrap_or_else(|err| panic!("failed to clean {}: {err}", build_dir.display())); + } + + let compiler = cc::Build::new().get_compiler(); + let c_compiler = compiler.path(); + + let target = env::var("TARGET").unwrap_or_default(); + let host = env::var("HOST").unwrap_or_default(); + let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default(); + + let mut cmake_cmd = Command::new("cmake"); + cmake_cmd + .arg("-S") + .arg(&source_dir) + .arg("-B") + .arg(&build_dir) + .arg(format!("-DCMAKE_SYSTEM_PROCESSOR={processor}")) + .arg("-DCMAKE_POSITION_INDEPENDENT_CODE=ON"); + + let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default(); + let is_msvc = env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc"); + let generator = env::var("CMAKE_GENERATOR").unwrap_or_default(); + + if is_msvc && (generator.is_empty() || generator.starts_with("Visual Studio")) { + let vs_arch = match target_arch.as_str() { + "x86_64" => "x64", + "aarch64" => "ARM64", + "x86" | "i686" | "i586" => "Win32", + "arm" | "thumbv7a" | "thumbv7neon" => "ARM", + other => other, + }; + cmake_cmd.arg("-A").arg(vs_arch); + } else if target != host { + let system_name = match target_os.as_str() { + "linux" => "Linux", + "windows" => "Windows", + "macos" | "ios" => "Darwin", + "freebsd" => "FreeBSD", + "android" => "Android", + _ => "Generic", + }; + cmake_cmd.arg(format!("-DCMAKE_SYSTEM_NAME={system_name}")); + cmake_cmd.arg(format!("-DCMAKE_C_COMPILER={}", c_compiler.display())); + cmake_cmd.arg(format!("-DCMAKE_ASM_COMPILER={}", c_compiler.display())); + } + + // libxaac builds 32-bit arm as `-mfloat-abi=softfp` unless told + // otherwise, and softfp leaves __ARM_PCS_VFP undefined — so glibc's + // gnu/stubs.h reaches for gnu/stubs-soft.h, which an + // `arm-linux-gnueabihf` sysroot does not ship. The Rust triple is the + // only thing here that knows which ABI was meant. + if processor == "aarch32" { + let abi = if target.ends_with("hf") { + "hard" + } else { + "softfp" + }; + cmake_cmd.arg(format!("-DLIBXAAC_ARM_FLOAT_ABI={abi}")); + } + + run(&mut cmake_cmd); + // Never `Debug`. MSVC's Debug configuration adds /RTC1, which it will + // not accept beside the /O2 this library's cmake asks for, and it links + // the debug CRT while rustc links the release one whatever the cargo + // profile says — so a dev build mixed the two. RelWithDebInfo keeps the + // symbols with neither problem, and the workspace already asks for + // opt-level 3 on this package in dev. Single-config generators ignore + // `--config` entirely, so this is a Windows-only distinction. + let config_type = if env::var("PROFILE").unwrap_or_default() == "release" { + "Release" + } else { + "RelWithDebInfo" + }; + + run(Command::new("cmake") + .arg("--build") + .arg(&build_dir) + .arg("--config") + .arg(config_type) + .arg("--target") + .arg("libxaacenc") + .arg("libxaacdec")); + + let find_lib = |base_name: &str| -> (PathBuf, String) { + let candidates = [ + format!("lib{base_name}.a"), + format!("{base_name}.a"), + format!("lib{base_name}.lib"), + format!("{base_name}.lib"), + ]; + for candidate in &candidates { + if let Some(p) = find_file(&build_dir, candidate) { + let stem = p.file_stem().unwrap().to_str().unwrap().to_string(); + return (p, stem); + } + } + panic!( + "failed to locate library for {base_name} under {}", + build_dir.display() + ); + }; + + let (enc_path, enc_stem) = find_lib("xaacenc"); + let (dec_path, dec_stem) = find_lib("xaacdec"); + + let enc_dir = enc_path + .parent() + .expect("static library missing parent directory"); + let dec_dir = dec_path + .parent() + .expect("static library missing parent directory"); + + println!("cargo:rustc-link-search=native={}", enc_dir.display()); + if dec_dir != enc_dir { + println!("cargo:rustc-link-search=native={}", dec_dir.display()); + } + + let is_msvc = env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc"); + let (enc_link, dec_link) = if is_msvc { + (enc_stem, dec_stem) + } else { + ( + enc_stem + .strip_prefix("lib") + .unwrap_or(&enc_stem) + .to_string(), + dec_stem + .strip_prefix("lib") + .unwrap_or(&dec_stem) + .to_string(), + ) + }; + + let link_kind = if bundled || prefer_static { + "static" + } else { + "dylib" + }; + + println!("cargo:rustc-link-lib={link_kind}={enc_link}"); + println!("cargo:rustc-link-lib={link_kind}={dec_link}"); + } + + if bundled && prefer_dynamic { + println!( + "cargo:warning=`dynamic` requested with `bundled`, but vendored libxaac only builds static libraries; using static linking" + ); + } + + if !bundled { + let link_kind = if prefer_static { "static" } else { "dylib" }; + + println!("cargo:rustc-link-lib={link_kind}=xaacenc"); + println!("cargo:rustc-link-lib={link_kind}=xaacdec"); + } + + let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default(); + if target_os != "windows" { + println!("cargo:rustc-link-lib=m"); + } +} + +fn cmake_processor() -> &'static str { + match env::var("CARGO_CFG_TARGET_ARCH").as_deref() { + Ok("x86_64") => "x86_64", + Ok("x86") => "i686", + Ok("aarch64") => "aarch64", + Ok("arm") => "aarch32", + Ok(other) => panic!("unsupported target arch: {other}"), + Err(_) => panic!("missing CARGO_CFG_TARGET_ARCH"), + } +} + +fn find_file(dir: &Path, file_name: &str) -> Option { + if !dir.exists() { + return None; + } + + let entries = std::fs::read_dir(dir).ok()?; + for entry in entries.flatten() { + let path = entry.path(); + if path.is_dir() { + if let Some(found) = find_file(&path, file_name) { + return Some(found); + } + } else if path.file_name().and_then(|name| name.to_str()) == Some(file_name) { + return Some(path); + } + } + + None +} + +fn run(command: &mut Command) { + let status = command.status().expect("failed to spawn command"); + assert!(status.success(), "command failed with status {status}"); +} diff --git a/crates/vendor/libxaac-sys/examples/sample.rs b/crates/vendor/libxaac-sys/examples/sample.rs new file mode 100644 index 00000000..425adc28 --- /dev/null +++ b/crates/vendor/libxaac-sys/examples/sample.rs @@ -0,0 +1,183 @@ +use std::alloc::{Layout, alloc_zeroed, dealloc}; +use std::ffi::{CStr, c_void}; +use std::mem::{align_of, size_of, zeroed}; +use std::ptr; + +use libxaac_sys::{ + AOT_AAC_LC, DEFAULT_MEM_ALIGN_8, IA_API_CMD_GET_API_SIZE, IA_MEMTYPE_INPUT, IA_MEMTYPE_OUTPUT, + ia_lib_info_struct, ixheaacd_dec_api, ixheaacd_get_lib_id_strings, ixheaace_delete, + ixheaace_get_lib_id_strings, ixheaace_process, ixheaace_user_config_struct, ixheaace_version, +}; + +fn main() { + print_library_versions(); + print_decoder_api_size(); + + let (mut config, pcm_input_size) = build_encoder_config(); + + let create_status = unsafe { + libxaac_sys::ixheaace_create( + (&mut config.input_config as *mut _) as *mut c_void, + (&mut config.output_config as *mut _) as *mut c_void, + ) + }; + assert_eq!(create_status, 0, "ixheaace_create failed: {create_status}"); + + let process_obj = config.output_config.pv_ia_process_api_obj; + let in_buf = config.output_config.mem_info_table[IA_MEMTYPE_INPUT as usize].mem_ptr as *mut u8; + let out_buf = + config.output_config.mem_info_table[IA_MEMTYPE_OUTPUT as usize].mem_ptr as *const u8; + + unsafe { + ptr::write_bytes(in_buf, 0, pcm_input_size); + } + + let asc_len = config.output_config.i_out_bytes as usize; + println!("encoder input frame bytes: {pcm_input_size}"); + if asc_len != 0 { + println!("audio specific config bytes: {:02x?}", unsafe { + std::slice::from_raw_parts(out_buf, asc_len) + }); + } + + let process_status = unsafe { + ixheaace_process( + process_obj, + (&mut config.input_config as *mut _) as *mut c_void, + (&mut config.output_config as *mut _) as *mut c_void, + ) + }; + assert_eq!( + process_status, 0, + "ixheaace_process failed: {process_status}" + ); + + let encoded_len = config.output_config.i_out_bytes as usize; + let encoded = unsafe { std::slice::from_raw_parts(out_buf, encoded_len) }; + println!("encoded silent AAC frame bytes: {encoded_len}"); + println!( + "first frame prefix: {:02x?}", + &encoded[..encoded.len().min(16)] + ); + + let delete_status = + unsafe { ixheaace_delete((&mut config.output_config as *mut _) as *mut c_void) }; + assert_eq!(delete_status, 0, "ixheaace_delete failed: {delete_status}"); +} + +fn build_encoder_config() -> (ixheaace_user_config_struct, usize) { + let mut config: ixheaace_user_config_struct = unsafe { zeroed() }; + + config.output_config.malloc_xheaace = Some(xaac_alloc); + config.output_config.free_xheaace = Some(xaac_free); + + config.input_config.ui_pcm_wd_sz = 16; + config.input_config.i_bitrate = 48_000; + config.input_config.frame_length = 1024; + config.input_config.aot = AOT_AAC_LC as i32; + config.input_config.i_channels = 2; + config.input_config.i_samp_freq = 44_100; + config.input_config.i_native_samp_freq = 44_100; + config.input_config.i_mps_tree_config = -1; + config.input_config.i_use_mps = 0; + config.input_config.i_use_adts = 0; + config.input_config.i_use_es = 1; + config.input_config.random_access_interval = 0; + + config.input_config.aac_config.sample_rate = 44_100; + config.input_config.aac_config.bitrate = 48_000; + config.input_config.aac_config.num_channels_in = 2; + config.input_config.aac_config.num_channels_out = 2; + config.input_config.aac_config.use_tns = 1; + config.input_config.aac_config.bitreservoir_size = 768; + config.input_config.aac_config.length = 1024 * 2 * 2; + + let pcm_input_size = config.input_config.frame_length as usize + * config.input_config.i_channels as usize + * (config.input_config.ui_pcm_wd_sz as usize / 8); + + (config, pcm_input_size) +} + +fn print_library_versions() { + let mut enc_version: ixheaace_version = unsafe { zeroed() }; + let mut dec_version = unsafe { zeroed::() }; + + let enc_status = + unsafe { ixheaace_get_lib_id_strings((&mut enc_version as *mut _) as *mut c_void) }; + assert_eq!( + enc_status, 0, + "ixheaace_get_lib_id_strings failed: {enc_status}" + ); + unsafe { ixheaacd_get_lib_id_strings((&mut dec_version as *mut _) as *mut c_void) }; + + println!( + "encoder: {} {}", + c_string(enc_version.p_lib_name), + c_string(enc_version.p_version_num) + ); + println!( + "decoder: {} {}", + c_string(dec_version.p_lib_name), + c_string(dec_version.p_version_num) + ); +} + +fn print_decoder_api_size() { + let mut api_size = 0u32; + let status = unsafe { + ixheaacd_dec_api( + ptr::null_mut(), + IA_API_CMD_GET_API_SIZE as i32, + 0, + (&mut api_size as *mut _) as *mut c_void, + ) + }; + assert_eq!(status, 0, "ixheaacd_dec_api(GET_API_SIZE) failed: {status}"); + println!("decoder api object size: {api_size} bytes"); +} + +fn c_string(ptr: *mut i8) -> String { + if ptr.is_null() { + return "".to_owned(); + } + + unsafe { CStr::from_ptr(ptr) } + .to_string_lossy() + .into_owned() +} + +unsafe extern "C" fn xaac_alloc(size: u32, alignment: u32) -> *mut c_void { + let requested_align = alignment.max(DEFAULT_MEM_ALIGN_8).next_power_of_two() as usize; + let header_words = 2 * size_of::(); + let total_size = size as usize + requested_align + header_words; + let layout = Layout::from_size_align(total_size, align_of::()).unwrap(); + let base = unsafe { alloc_zeroed(layout) }; + if base.is_null() { + return ptr::null_mut(); + } + + let aligned_addr = + (base as usize + header_words + requested_align - 1) & !(requested_align - 1); + let aligned = aligned_addr as *mut u8; + let meta = unsafe { aligned.cast::().sub(2) }; + unsafe { + meta.write(base as usize); + meta.add(1).write(total_size); + } + aligned.cast() +} + +unsafe extern "C" fn xaac_free(ptr: *mut c_void) { + if ptr.is_null() { + return; + } + + let meta = unsafe { (ptr as *mut usize).sub(2) }; + let base = unsafe { meta.read() } as *mut u8; + let total_size = unsafe { meta.add(1).read() }; + let layout = Layout::from_size_align(total_size, align_of::()).unwrap(); + unsafe { + dealloc(base, layout); + } +} diff --git a/crates/vendor/libxaac-sys/libxaac/.github/workflows/cifuzz.yml b/crates/vendor/libxaac-sys/libxaac/.github/workflows/cifuzz.yml new file mode 100644 index 00000000..a7f489ad --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/.github/workflows/cifuzz.yml @@ -0,0 +1,27 @@ +name: CIFuzz +on: [pull_request] +jobs: + Fuzzing: + runs-on: ubuntu-latest + strategy: + matrix: + sanitizer: [address, memory] + steps: + - name: Build Fuzzers + id: build + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'libxaac' + language: c++ + - name: Run Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'libxaac' + language: c++ + fuzz-seconds: 600 + - name: Upload Crash + uses: actions/upload-artifact@v4 + if: failure() && steps.build.outcome == 'success' + with: + name: artifacts + path: ./out/artifacts diff --git a/crates/vendor/libxaac-sys/libxaac/.github/workflows/cmake.yml b/crates/vendor/libxaac-sys/libxaac/.github/workflows/cmake.yml new file mode 100644 index 00000000..0ec6d70b --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/.github/workflows/cmake.yml @@ -0,0 +1,23 @@ +name: CMake + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + BUILD_TYPE: Release + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/out -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + + - name: Build + run: cmake --build ${{github.workspace}}/out --config ${{env.BUILD_TYPE}} diff --git a/crates/vendor/libxaac-sys/libxaac/Android.bp b/crates/vendor/libxaac-sys/libxaac/Android.bp new file mode 100644 index 00000000..99f361d0 --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/Android.bp @@ -0,0 +1,523 @@ +package { + default_applicable_licenses: ["external_libxaac_license"], +} + +// Added automatically by a large-scale-change +// +// large-scale-change included anything that looked like it might be a license +// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. +// +// Please consider removing redundant or irrelevant files from 'license_text:'. +// See: http://go/android-license-faq +license { + name: "external_libxaac_license", + visibility: [":__subpackages__"], + license_kinds: [ + "SPDX-license-identifier-Apache-2.0", + ], + license_text: [ + "LICENSE", + "NOTICE", + ], +} + +cc_library_static { + name: "libxaacdec", + + vendor_available: true, + host_supported: true, + cflags: [ + "-O3", + "-DLOUDNESS_LEVELING_SUPPORT", + ], + + export_include_dirs: [ + "common", + "decoder", + "decoder/drc_src", + ], + + srcs: [ + "common/ixheaac_esbr_fft.c", + "common/ixheaac_esbr_rom.c", + "common/ixheaac_fft_ifft_32x32_rom.c", + "decoder/ixheaacd_aacdecoder.c", + "decoder/ixheaacd_aacpluscheck.c", + "decoder/ixheaacd_aac_ec.c", + "decoder/ixheaacd_aac_imdct.c", + "decoder/ixheaacd_aac_rom.c", + "decoder/ixheaacd_aac_tns.c", + "decoder/ixheaacd_acelp_bitparse.c", + "decoder/ixheaacd_acelp_decode.c", + "decoder/ixheaacd_acelp_mdct.c", + "decoder/ixheaacd_acelp_tools.c", + "decoder/ixheaacd_adts_crc_check.c", + "decoder/ixheaacd_api.c", + "decoder/ixheaacd_arith_dec.c", + "decoder/ixheaacd_avq_dec.c", + "decoder/ixheaacd_avq_rom.c", + "decoder/ixheaacd_basic_funcs.c", + "decoder/ixheaacd_basic_ops.c", + "decoder/ixheaacd_bitbuffer.c", + "decoder/ixheaacd_block.c", + "decoder/ixheaacd_channel.c", + "decoder/ixheaacd_common_initfuncs.c", + "decoder/ixheaacd_common_lpfuncs.c", + "decoder/ixheaacd_common_rom.c", + "decoder/ixheaacd_create.c", + "decoder/ixheaacd_decode_main.c", + "decoder/ixheaacd_drc_freq_dec.c", + "decoder/ixheaacd_dsp_fft32x32s.c", + "decoder/ixheaacd_ec_rom.c", + "decoder/ixheaacd_env_calc.c", + "decoder/ixheaacd_env_dec.c", + "decoder/ixheaacd_env_extr.c", + "decoder/ixheaacd_esbr_envcal.c", + "decoder/ixheaacd_esbr_polyphase.c", + "decoder/ixheaacd_ext_ch_ele.c", + "decoder/ixheaacd_fft.c", + "decoder/ixheaacd_fft_ifft_32x32.c", + "decoder/ixheaacd_freq_sca.c", + "decoder/ixheaacd_fwd_alias_cnx.c", + "decoder/ixheaacd_hbe_dft_trans.c", + "decoder/ixheaacd_hbe_trans.c", + "decoder/ixheaacd_headerdecode.c", + "decoder/ixheaacd_hufftables.c", + "decoder/ixheaacd_huff_code_reorder.c", + "decoder/ixheaacd_huff_tools.c", + "decoder/ixheaacd_hybrid.c", + "decoder/ixheaacd_imdct.c", + "decoder/ixheaacd_initfuncs.c", + "decoder/ixheaacd_init_config.c", + "decoder/ixheaacd_latmdemux.c", + "decoder/ixheaacd_ld_mps_config.c", + "decoder/ixheaacd_ld_mps_dec.c", + "decoder/ixheaacd_longblock.c", + "decoder/ixheaacd_lpc.c", + "decoder/ixheaacd_lpc_dec.c", + "decoder/ixheaacd_lpfuncs.c", + "decoder/ixheaacd_lpp_tran.c", + "decoder/ixheaacd_lt_predict.c", + "decoder/ixheaacd_mps_apply_common.c", + "decoder/ixheaacd_mps_apply_m1.c", + "decoder/ixheaacd_mps_apply_m2.c", + "decoder/ixheaacd_mps_bitdec.c", + "decoder/ixheaacd_mps_blind.c", + "decoder/ixheaacd_mps_calc_m1m2_common.c", + "decoder/ixheaacd_mps_calc_m1m2_emm.c", + "decoder/ixheaacd_mps_calc_m1m2_tree_515x.c", + "decoder/ixheaacd_mps_calc_m1m2_tree_51sx.c", + "decoder/ixheaacd_mps_calc_m1m2_tree_52xx.c", + "decoder/ixheaacd_mps_calc_m1m2_tree_727x.c", + "decoder/ixheaacd_mps_calc_m1m2_tree_757x.c", + "decoder/ixheaacd_mps_dec.c", + "decoder/ixheaacd_mps_decorr.c", + "decoder/ixheaacd_mps_get_index.c", + "decoder/ixheaacd_mps_hybrid_filt.c", + "decoder/ixheaacd_mps_initfuncs.c", + "decoder/ixheaacd_mps_m1m2_common.c", + "decoder/ixheaacd_mps_mdct_2_qmf.c", + "decoder/ixheaacd_mps_parse.c", + "decoder/ixheaacd_mps_polyphase.c", + "decoder/ixheaacd_mps_poly_filt.c", + "decoder/ixheaacd_mps_pre_mix.c", + "decoder/ixheaacd_mps_process.c", + "decoder/ixheaacd_mps_reshape_bb_env.c", + "decoder/ixheaacd_mps_res_block.c", + "decoder/ixheaacd_mps_res_channel.c", + "decoder/ixheaacd_mps_res_channel_info.c", + "decoder/ixheaacd_mps_res_longblock.c", + "decoder/ixheaacd_mps_res_pns_js_thumb.c", + "decoder/ixheaacd_mps_res_pulsedata.c", + "decoder/ixheaacd_mps_res_tns.c", + "decoder/ixheaacd_mps_rom.c", + "decoder/ixheaacd_mps_smoothing.c", + "decoder/ixheaacd_mps_temp_process.c", + "decoder/ixheaacd_mps_temp_reshape.c", + "decoder/ixheaacd_mps_tonality.c", + "decoder/ixheaacd_multichannel.c", + "decoder/ixheaacd_peak_limiter.c", + "decoder/ixheaacd_pns_js_thumb.c", + "decoder/ixheaacd_pred_vec_block.c", + "decoder/ixheaacd_process.c", + "decoder/ixheaacd_ps_bitdec.c", + "decoder/ixheaacd_ps_dec.c", + "decoder/ixheaacd_ps_dec_flt.c", + "decoder/ixheaacd_pvc_rom.c", + "decoder/ixheaacd_qmf_dec.c", + "decoder/ixheaacd_rev_vlc.c", + "decoder/ixheaacd_rom.c", + "decoder/ixheaacd_sbrdecoder.c", + "decoder/ixheaacd_sbrdec_initfuncs.c", + "decoder/ixheaacd_sbrdec_lpfuncs.c", + "decoder/ixheaacd_sbr_crc.c", + "decoder/ixheaacd_sbr_dec.c", + "decoder/ixheaacd_sbr_rom.c", + "decoder/ixheaacd_spectrum_dec.c", + "decoder/ixheaacd_stereo.c", + "decoder/ixheaacd_tcx_fwd_alcnx.c", + "decoder/ixheaacd_tcx_fwd_mdct.c", + "decoder/ixheaacd_thumb_ps_dec.c", + "decoder/ixheaacd_tns.c", + "decoder/ixheaacd_usac_ec.c", + "decoder/ixheaacd_Windowing.c", + "decoder/drc_src/impd_drc_api.c", + "decoder/drc_src/impd_drc_bitbuffer.c", + "decoder/drc_src/impd_drc_dec.c", + "decoder/drc_src/impd_drc_dynamic_payload.c", + "decoder/drc_src/impd_drc_eq.c", + "decoder/drc_src/impd_drc_extr_delta_coded_info.c", + "decoder/drc_src/impd_drc_filter_bank.c", + "decoder/drc_src/impd_drc_gain_dec.c", + "decoder/drc_src/impd_drc_gain_decoder.c", + "decoder/drc_src/impd_drc_init.c", + "decoder/drc_src/impd_drc_interface_decoder.c", + "decoder/drc_src/impd_drc_loudness_control.c", + "decoder/drc_src/impd_drc_main_td_process.c", + "decoder/drc_src/impd_drc_multiband.c", + "decoder/drc_src/impd_drc_parametric_dec.c", + "decoder/drc_src/impd_drc_peak_limiter.c", + "decoder/drc_src/impd_drc_process.c", + "decoder/drc_src/impd_drc_rom.c", + "decoder/drc_src/impd_drc_selection_process.c", + "decoder/drc_src/impd_drc_selection_process_drcset_selection.c", + "decoder/drc_src/impd_drc_selection_process_init.c", + "decoder/drc_src/impd_drc_shape_filter.c", + "decoder/drc_src/impd_drc_static_payload.c", + ], + + sanitize: { + misc_undefined: [ + "unsigned-integer-overflow", + "signed-integer-overflow", + "bounds", + ], + cfi: true, + config: { + cfi_assembly_support: true, + }, + }, + + arch: { + arm: { + cflags: [ + ], + + local_include_dirs: [ + "decoder/armv7", + ], + + srcs: [ + "decoder/generic/ixheaacd_function_selector_generic.c", + "decoder/generic/ixheaacd_qmf_dec_generic.c", + "decoder/armv7/ixheaacd_fft_armv7.c", + "decoder/armv7/ixheaacd_function_selector_armv7.c", + "decoder/armv7/ixheaacd_qmf_dec_armv7.c", + "decoder/armv7/ixheaacd_aac_ld_dec_rearrange.s", + "decoder/armv7/ixheaacd_apply_rot.s", + "decoder/armv7/ixheaacd_apply_scale_fac.s", + "decoder/armv7/ixheaacd_autocorr_st2.s", + "decoder/armv7/ixheaacd_auto_corr.s", + "decoder/armv7/ixheaacd_calcmaxspectralline.s", + "decoder/armv7/ixheaacd_calc_post_twid.s", + "decoder/armv7/ixheaacd_calc_pre_twid.s", + "decoder/armv7/ixheaacd_complex_fft_p2.s", + "decoder/armv7/ixheaacd_complex_ifft_p2.s", + "decoder/armv7/ixheaacd_conv_ergtoamplitude.s", + "decoder/armv7/ixheaacd_conv_ergtoamplitudelp.s", + "decoder/armv7/ixheaacd_cos_sin_mod.s", + "decoder/armv7/ixheaacd_dct3_32.s", + "decoder/armv7/ixheaacd_decorr_filter2.s", + "decoder/armv7/ixheaacd_dec_DCT2_64_asm.s", + "decoder/armv7/ixheaacd_eld_decoder_sbr_pre_twiddle.s", + "decoder/armv7/ixheaacd_enery_calc_per_subband.s", + "decoder/armv7/ixheaacd_esbr_cos_sin_mod_loop1.s", + "decoder/armv7/ixheaacd_esbr_cos_sin_mod_loop2.s", + "decoder/armv7/ixheaacd_esbr_fwd_modulation.s", + "decoder/armv7/ixheaacd_esbr_qmfsyn64_winadd.s", + "decoder/armv7/ixheaacd_esbr_radix4bfly.s", + "decoder/armv7/ixheaacd_expsubbandsamples.s", + "decoder/armv7/ixheaacd_ffr_divide16.s", + "decoder/armv7/ixheaacd_fft32x32_ld2_armv7.s", + "decoder/armv7/ixheaacd_fft_15_ld.s", + "decoder/armv7/ixheaacd_fwd_modulation.s", + "decoder/armv7/ixheaacd_harm_idx_zerotwolp.s", + "decoder/armv7/ixheaacd_imdct_using_fft.s", + "decoder/armv7/ixheaacd_inv_dit_fft_8pt.s", + "decoder/armv7/ixheaacd_lap1.s", + "decoder/armv7/ixheaacd_mps_complex_fft_64_asm.s", + "decoder/armv7/ixheaacd_mps_synt_out_calc.s", + "decoder/armv7/ixheaacd_mps_synt_post_fft_twiddle.s", + "decoder/armv7/ixheaacd_mps_synt_post_twiddle.s", + "decoder/armv7/ixheaacd_mps_synt_pre_twiddle.s", + "decoder/armv7/ixheaacd_no_lap1.s", + "decoder/armv7/ixheaacd_overlap_add1.s", + "decoder/armv7/ixheaacd_overlap_add2.s", + "decoder/armv7/ixheaacd_post_radix_compute2.s", + "decoder/armv7/ixheaacd_post_radix_compute4.s", + "decoder/armv7/ixheaacd_post_twiddle.s", + "decoder/armv7/ixheaacd_post_twiddle_overlap.s", + "decoder/armv7/ixheaacd_pre_twiddle_compute.s", + "decoder/armv7/ixheaacd_radix4_bfly.s", + "decoder/armv7/ixheaacd_rescale_subbandsamples.s", + "decoder/armv7/ixheaacd_sbr_imdct_using_fft.s", + "decoder/armv7/ixheaacd_sbr_qmfanal32_winadds.s", + "decoder/armv7/ixheaacd_sbr_qmfanal32_winadds_eld.s", + "decoder/armv7/ixheaacd_sbr_qmfsyn64_winadd.s", + "decoder/armv7/ixheaacd_shiftrountine.s", + "decoder/armv7/ixheaacd_shiftrountine_with_rnd_eld.s", + "decoder/armv7/ixheaacd_shiftrountine_with_round.s", + "decoder/armv7/ixheaacd_shiftrountine_with_round_hq.s", + "decoder/armv7/ixheaacd_tns_ar_filter_fixed.s", + "decoder/armv7/ixheaacd_tns_ar_filter_fixed_32x16.s", + "decoder/armv7/ixheaacd_tns_parcor2lpc_32x16.s", + ], + }, + + arm64: { + cflags: [ + ], + + local_include_dirs: [ + "decoder/armv8", + ], + + srcs: [ + "decoder/armv8/ixheaacd_function_selector_armv8.c", + "decoder/armv8/ixheaacd_qmf_dec_armv8.c", + "decoder/armv8/ixheaacd_apply_scale_factors.s", + "decoder/armv8/ixheaacd_calcmaxspectralline.s", + "decoder/armv8/ixheaacd_cos_sin_mod_loop1.s", + "decoder/armv8/ixheaacd_cos_sin_mod_loop2.s", + "decoder/armv8/ixheaacd_fft32x32_ld2_armv8.s", + "decoder/armv8/ixheaacd_imdct_using_fft.s", + "decoder/armv8/ixheaacd_inv_dit_fft_8pt.s", + "decoder/armv8/ixheaacd_no_lap1.s", + "decoder/armv8/ixheaacd_overlap_add1.s", + "decoder/armv8/ixheaacd_overlap_add2.s", + "decoder/armv8/ixheaacd_postradixcompute4.s", + "decoder/armv8/ixheaacd_post_twiddle.s", + "decoder/armv8/ixheaacd_post_twiddle_overlap.s", + "decoder/armv8/ixheaacd_pre_twiddle.s", + "decoder/armv8/ixheaacd_sbr_imdct_using_fft.s", + "decoder/armv8/ixheaacd_sbr_qmfsyn64_winadd.s", + "decoder/armv8/ixheaacd_sbr_qmf_analysis32_neon.s", + "decoder/armv8/ixheaacd_shiftrountine_with_round.s", + "decoder/armv8/ixheaacd_shiftrountine_with_round_eld.s", + ], + }, + + x86: { + cflags: [ + ], + + local_include_dirs: [ + ], + + srcs: [ + "decoder/generic/ixheaacd_qmf_dec_generic.c", + "decoder/x86/ixheaacd_function_selector_x86.c", + ], + }, + + x86_64: { + cflags: [ + ], + + local_include_dirs: [ + ], + + srcs: [ + "decoder/generic/ixheaacd_qmf_dec_generic.c", + "decoder/x86_64/ixheaacd_function_selector_x86_64.c", + ], + }, + + riscv64: { + cflags: [ + ], + + local_include_dirs: [ + ], + + srcs: [ + "decoder/generic/ixheaacd_qmf_dec_generic.c", + "decoder/generic/ixheaacd_function_selector_generic.c", + ], + }, + }, +} + +cc_library_static { + name: "libxaacenc", + + vendor_available: true, + host_supported: true, + cflags: [ + "-O3", + "-DLOUDNESS_LEVELING_SUPPORT", + ], + + export_include_dirs: [ + "common", + "encoder", + "encoder/drc_src", + ], + + srcs: [ + "common/ixheaac_esbr_fft.c", + "common/ixheaac_esbr_rom.c", + "common/ixheaac_fft_ifft_32x32_rom.c", + "encoder/iusace_acelp_enc.c", + "encoder/iusace_acelp_rom.c", + "encoder/iusace_acelp_tools.c", + "encoder/iusace_arith_enc.c", + "encoder/iusace_avq_enc.c", + "encoder/iusace_avq_rom.c", + "encoder/iusace_block_switch.c", + "encoder/iusace_bitbuffer.c", + "encoder/iusace_enc_fac.c", + "encoder/iusace_enc_main.c", + "encoder/iusace_esbr_inter_tes.c", + "encoder/iusace_esbr_pvc.c", + "encoder/iusace_esbr_pvc_rom.c", + "encoder/iusace_esbr_rom.c", + "encoder/iusace_fd_fac.c", + "encoder/iusace_fft.c", + "encoder/iusace_lpc.c", + "encoder/iusace_lpc_avq.c", + "encoder/iusace_lpd_enc.c", + "encoder/iusace_lpd_rom.c", + "encoder/iusace_lpd_utils.c", + "encoder/iusace_ms.c", + "encoder/iusace_psy_rom.c", + "encoder/iusace_psy_mod.c", + "encoder/iusace_psy_utils.c", + "encoder/iusace_rom.c", + "encoder/iusace_tcx_enc.c", + "encoder/iusace_tcx_mdct.c", + "encoder/iusace_tns_usac.c", + "encoder/iusace_windowing.c", + "encoder/iusace_write_bitstream.c", + "encoder/ixheaace_adjust_threshold.c", + "encoder/ixheaace_api.c", + "encoder/ixheaace_asc_write.c", + "encoder/ixheaace_basic_ops.c", + "encoder/ixheaace_bitbuffer.c", + "encoder/ixheaace_bitbuffer_hp.c", + "encoder/ixheaace_bits_count.c", + "encoder/ixheaace_block_switch.c", + "encoder/ixheaace_calc_ms_band_energy.c", + "encoder/ixheaace_channel_map.c", + "encoder/ixheaace_common_rom.c", + "encoder/ixheaace_cplx_pred.c", + "encoder/ixheaace_dynamic_bits.c", + "encoder/ixheaace_enc_init.c", + "encoder/ixheaace_enc_main.c", + "encoder/ixheaace_fd_enc.c", + "encoder/ixheaace_fd_mdct.c", + "encoder/ixheaace_fd_qc_adjthr.c", + "encoder/ixheaace_fd_qc_util.c", + "encoder/ixheaace_fd_quant.c", + "encoder/ixheaace_fft.c", + "encoder/ixheaace_group_data.c", + "encoder/ixheaace_huffman_rom.c", + "encoder/ixheaace_hybrid.c", + "encoder/ixheaace_hybrid_init.c", + "encoder/ixheaace_interface.c", + "encoder/ixheaace_loudness_measurement.c", + "encoder/ixheaace_mdct_480.c", + "encoder/ixheaace_mps_bitstream.c", + "encoder/ixheaace_mps_dct.c", + "encoder/ixheaace_mps_delay.c", + "encoder/ixheaace_mps_dmx_tdom_enh.c", + "encoder/ixheaace_mps_enc.c", + "encoder/ixheaace_mps_filter.c", + "encoder/ixheaace_mps_frame_windowing.c", + "encoder/ixheaace_mps_huff_tab.c", + "encoder/ixheaace_mps_hybrid_filter.c", + "encoder/ixheaace_mps_nlc_enc.c", + "encoder/ixheaace_mps_onset_detect.c", + "encoder/ixheaace_mps_param_extract.c", + "encoder/ixheaace_mps_polyphase.c", + "encoder/ixheaace_mps_qmf.c", + "encoder/ixheaace_mps_rom.c", + "encoder/ixheaace_mps_static_gain.c", + "encoder/ixheaace_mps_tools_rom.c", + "encoder/ixheaace_mps_tree.c", + "encoder/ixheaace_mps_vector_functions.c", + "encoder/ixheaace_ms_stereo.c", + "encoder/ixheaace_nf.c", + "encoder/ixheaace_ps_bitenc.c", + "encoder/ixheaace_ps_enc.c", + "encoder/ixheaace_ps_enc_init.c", + "encoder/ixheaace_psy_configuration.c", + "encoder/ixheaace_psy_mod.c", + "encoder/ixheaace_psy_utils.c", + "encoder/ixheaace_psy_utils_spreading.c", + "encoder/ixheaace_qc_main_hp.c", + "encoder/ixheaace_qc_util.c", + "encoder/ixheaace_quant.c", + "encoder/ixheaace_radix2_fft.c", + "encoder/ixheaace_resampler.c", + "encoder/ixheaace_resampler_init.c", + "encoder/ixheaace_rom.c", + "encoder/ixheaace_sbr_code_envelope.c", + "encoder/ixheaace_sbr_code_envelope_lp.c", + "encoder/ixheaace_sbr_crc.c", + "encoder/ixheaace_sbr_env_est.c", + "encoder/ixheaace_sbr_env_est_init.c", + "encoder/ixheaace_sbr_frame_info_gen.c", + "encoder/ixheaace_sbr_freq_scaling.c", + "encoder/ixheaace_sbr_hbe_dft_trans.c", + "encoder/ixheaace_sbr_hbe_fft_ifft_32x32.c", + "encoder/ixheaace_sbr_hbe_polyphase.c", + "encoder/ixheaace_sbr_hbe_trans.c", + "encoder/ixheaace_sbr_inv_filtering_estimation.c", + "encoder/ixheaace_sbr_main.c", + "encoder/ixheaace_sbr_misc.c", + "encoder/ixheaace_sbr_missing_harmonics_det.c", + "encoder/ixheaace_sbr_noise_floor_est.c", + "encoder/ixheaace_sbr_qmf_enc.c", + "encoder/ixheaace_sbr_qmf_enc_init.c", + "encoder/ixheaace_sbr_rom.c", + "encoder/ixheaace_sbr_ton_corr.c", + "encoder/ixheaace_sbr_ton_corr_hp.c", + "encoder/ixheaace_sbr_tran_det.c", + "encoder/ixheaace_sbr_tran_det_hp.c", + "encoder/ixheaace_sbr_write_bitstream.c", + "encoder/ixheaace_sf_estimation.c", + "encoder/ixheaace_signal_classifier.c", + "encoder/ixheaace_signal_classifier_rom.c", + "encoder/ixheaace_static_bits.c", + "encoder/ixheaace_stereo_preproc.c", + "encoder/ixheaace_tns.c", + "encoder/ixheaace_tns_hp.c", + "encoder/ixheaace_tns_init.c", + "encoder/ixheaace_tns_params.c", + "encoder/ixheaace_write_adts_adif.c", + "encoder/ixheaace_write_bitstream.c", + "encoder/drc_src/impd_drc_api.c", + "encoder/drc_src/impd_drc_enc.c", + "encoder/drc_src/impd_drc_gain_calculator.c", + "encoder/drc_src/impd_drc_gain_enc.c", + "encoder/drc_src/impd_drc_mux.c", + "encoder/drc_src/impd_drc_tables.c", + "encoder/drc_src/impd_drc_uni_drc_eq.c", + "encoder/drc_src/impd_drc_uni_drc_filter_bank.c", + ], + + sanitize: { + misc_undefined: [ + "unsigned-integer-overflow", + "signed-integer-overflow", + "bounds", + ], + cfi: true, + config: { + cfi_assembly_support: true, + }, + }, +} + +subdirs = ["test"] diff --git a/crates/vendor/libxaac-sys/libxaac/CMakeLists.txt b/crates/vendor/libxaac-sys/libxaac/CMakeLists.txt new file mode 100644 index 00000000..85e04314 --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.5.1) +project(libxaac C ASM) + +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|ARM64)$") + set(CMAKE_SYSTEM_PROCESSOR "aarch64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$") + set(CMAKE_SYSTEM_PROCESSOR "x86_64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86)$") + set(CMAKE_SYSTEM_PROCESSOR "i686") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|aarch32)$") + set(CMAKE_SYSTEM_PROCESSOR "aarch32") +endif() + +option(BUILD64 "Build for 64 bit" OFF) +option(BUILD_TESTS "Build tests and fuzzers" OFF) +set(XAAC_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") +set(XAAC_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}") +find_package(Threads REQUIRED) + +set(CMAKE_STATIC_LIBRARY_PREFIX "") + +include("${XAAC_ROOT}/cmake/utils.cmake") + +libxaac_add_compile_options() +libxaac_add_definitions() + +if(NOT COMPILER_HAS_SANITIZER) + libxaac_set_link_libraries() +endif() + +include("${XAAC_ROOT}/common/common.cmake") +include("${XAAC_ROOT}/decoder/libxaacdec.cmake") +include("${XAAC_ROOT}/encoder/libxaacenc.cmake") + +if(BUILD_TESTS) + include("${XAAC_ROOT}/test/decoder/xaacdec.cmake") + include("${XAAC_ROOT}/fuzzer/xaac_dec_fuzzer.cmake") + include("${XAAC_ROOT}/test/encoder/xaacenc.cmake") + include("${XAAC_ROOT}/fuzzer/xaac_enc_fuzzer.cmake") +endif() + diff --git a/crates/vendor/libxaac-sys/libxaac/LICENSE b/crates/vendor/libxaac-sys/libxaac/LICENSE new file mode 100644 index 00000000..edcd8c28 --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright (c) 2018, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/crates/vendor/libxaac-sys/libxaac/METADATA b/crates/vendor/libxaac-sys/libxaac/METADATA new file mode 100644 index 00000000..d97975ca --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/METADATA @@ -0,0 +1,3 @@ +third_party { + license_type: NOTICE +} diff --git a/crates/vendor/libxaac-sys/libxaac/MODULE_LICENSE_APACHE2 b/crates/vendor/libxaac-sys/libxaac/MODULE_LICENSE_APACHE2 new file mode 100644 index 00000000..e69de29b diff --git a/crates/vendor/libxaac-sys/libxaac/NOTICE b/crates/vendor/libxaac-sys/libxaac/NOTICE new file mode 100644 index 00000000..75ec98bc --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/NOTICE @@ -0,0 +1,19 @@ +/****************************************************************************** + * * + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ***************************************************************************** + * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore +*/ diff --git a/crates/vendor/libxaac-sys/libxaac/OWNERS b/crates/vendor/libxaac-sys/libxaac/OWNERS new file mode 100644 index 00000000..528d32c4 --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/OWNERS @@ -0,0 +1,3 @@ +# owners for external/libxaac +include platform/frameworks/av:/media/janitors/codec_OWNERS +essick@google.com diff --git a/crates/vendor/libxaac-sys/libxaac/PREUPLOAD.cfg b/crates/vendor/libxaac-sys/libxaac/PREUPLOAD.cfg new file mode 100644 index 00000000..ecf8b8ef --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/PREUPLOAD.cfg @@ -0,0 +1,2 @@ +[Hook Scripts] +mainline_hook = ${REPO_ROOT}/frameworks/av/tools/mainline_hook_project.sh diff --git a/crates/vendor/libxaac-sys/libxaac/README.experimental b/crates/vendor/libxaac-sys/libxaac/README.experimental new file mode 100644 index 00000000..515d685d --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/README.experimental @@ -0,0 +1,5 @@ +This xaac codec (external/xaac) is experimental; it is not yet intended +to be used on production devices. + +This codec should not be configured into any production Android device +that is intended to be shipped. diff --git a/crates/vendor/libxaac-sys/libxaac/README.md b/crates/vendor/libxaac-sys/libxaac/README.md new file mode 100644 index 00000000..d1224b70 --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/README.md @@ -0,0 +1,102 @@ +# Introduction to libxaac + +Extended HE-AAC, the latest innovation member of the MPEG AAC codec family, is ideally suited for adaptive bit rate streaming and digital radio applications. Extended HE-AAC bridges the gap between speech and audio coding and ensures consistent high-quality audio for all signal types, including speech, music, and mixed material. It is the required audio codec for DRM (Digital Radio Mondiale). When it comes to coding, the codec is incredibly effective, generating high-quality audio for music and speech at bitrates as low as 6 kbit/s for mono and 12 kbit/s for stereo services. By switching to extremely low bitrate streams, Extended HE-AAC streaming apps and streaming radio players can provide uninterrupted playback even during very congested network conditions. + +As the Extended High Efficiency AAC Profile is a logical evolution of the MPEG Audio's popular AAC Family profiles, the codec supports AAC-LC, HE-AACv1 (AAC+) and HE-AACv2 (eAAC+) audio object type encoding. The bitrate that was saved with AAC family tools can be used to enhance video quality. Extended HE-AAC is a well-liked option for a number of applications since it is a strong and effective audio codec that provides high-quality audio at low bitrates. + +![Architecture](docs/libxaac_block_diagram.jpg) + +One of the key features of libxaac (refer to above image) is that it has support for AAC-LD (Low Delay), AAC-ELD (Enhanced Low Delay), and AAC-ELDv2 (Enhanced Low Delay version 2) modes. AAC-LD mode provides low latency encoding, making it suitable for applications such as interactive communication and live audio streaming. It helps to reduce the delay in the encoding process to improve the real-time performance of the system. AAC-ELD mode improves the low-delay performance of HE-AAC by reducing the coding delay while maintaining high audio quality. It was observed that minimum delay it can achieve is 15ms. In order to achieve low delay coding scheme and low bitrate, it uses the Low Delay SBR tool. AAC-ELDv2 is the most advanced version of AAC-based low delay coding. It provides an enhanced version of AAC-ELD, which provides even lower coding delay and higher audio quality. + +MPEG-D USAC, also known as Unified Speech and Audio Coding, is designed to provide high-quality audio coding at low bit rates. MPEG-D USAC combines advanced audio coding techniques with state-of-the-art speech coding algorithms to achieve significant compression gains while maintaining perceptual audio quality. The standard supports a wide range of audio content, including music, speech, and mixed audio, making it versatile for different use cases. With its ability to deliver high-fidelity audio at reduced bit rates, MPEG-D USAC plays a crucial role in optimizing bandwidth usage and enhancing the user experience in the digital audio domain. + +Overall, libxaac, with support for AAC-LD, AAC-ELD, and AAC-ELDv2 modes, is a versatile audio coding technology that can be used for a wide range of applications, such as broadcasting, streaming, and teleconferencing which requires high-quality audio compression with minimal delay. + +Also, the libxaac supports MPEG-D DRC (Dynamic Range Control) for the Extended HE-AAC profile in both encoder and decoder. MPEG-D DRC offers a bitrate efficient representation of dynamically compressed versions of an audio signal. This is achieved by adding a low-bitrate DRC metadata stream to the audio signal. DRC includes dedicated sections for metadata-based loudness leveling, clipping prevention, ducking, and for generating a fade-in and fade-out to supplement the main dynamic range compression functionality. The DRC effects available at the DRC decoder are generated at the DRC encoder side. At the DRC decoder side, the audio signal may be played back without applying DRC, or an appropriate DRC effect is selected and applied based on the given playback scenario. It offers flexible solutions to efficiently support the widespread demand for technologies such as loudness normalization and dynamic range compression for various playback scenarios. + +#### Note +* The operating points for MPEG-D USAC (along with MPEG-D DRC) in libxaac encoder is currently restricted to 64 kbps and 96 kbps. It is recommended to use the encoder at these operating points only. The support shall be extended to other operating points soon. +* Further Quality enhancements for AAC-ELD and AAC-ELDv2 modes may be pushed as quality assessment is in progress. + +# Building the libxaac decoder and encoder + +## Building for AOSP +* Makefile for building the libxaac decoder and encoder library is provided in root(`libxaac/`) folder. +* Makefile for building the libxaac decoder and encoder testbench is provided in `test` folder. +* Build the library followed by the application using the below commands: +Go to root directory +``` +$ mm +``` + +## Using CMake +Users can also use cmake to build for `x86`, `x86_64`, `armv7`, `armv8` and Windows (MSVS project) platforms. + +### Creating MSVS project files +To create MSVS project files for the libxaac decoder and encoder from cmake, run the following commands: +``` +Go to the root directory(libxaac/). +Create a new folder in the project root directory and move to the newly created folder. + +$ cd +$ mkdir bin +$ cd bin +$ cmake -G "Visual Studio 15 2017" .. +``` + +Above command will create Win32 version of MSVS workspace +To create MSVS project files for Win64 version from cmake, run the following commands: +``` +$ mkdir cmake_build +$ cd cmake_build +$ cmake -G "Visual Studio 15 2017 Win64" .. +``` +The above command creates MSVS 2017 project files. If the version is different, modify the generator name accordingly. + +### Building for native platforms +Run the following commands to build the libxaac decoder and encoder for native platform: +``` +Go to the root directory(libxaac/). +Create a new folder in the project root directory and move to the newly created folder. + +$ cd +$ mkdir bin +$ cd bin +$ cmake .. +$ make +``` + +### Cross-compiler based builds +Ensure to edit the file cmake/toolchains/*_toolchain.cmake to set proper paths in host for corresponding platforms. + +### Building for x86_32 on a x86_64 Linux machine +``` +$ cd +$ mkdir build +$ cd build +$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/x86_toolchain.cmake +$ make +``` + +### Building for aarch32/aarch64 +Update 'CMAKE_C_COMPILER', 'CMAKE_CXX_COMPILER', 'CMAKE_C_COMPILER_AR', and 'CMAKE_CXX_COMPILER_AR' in CMAKE_TOOLCHAIN_FILE passed below +``` +$ cd +$ mkdir build +$ cd build +``` + +### For aarch64 +``` +$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch64_toolchain.cmake +$ make +``` + +### For aarch32 +``` +$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch32_toolchain.cmake +$ make +``` + +### For API and testbench usage of decoder, please refer [`README_dec.md`](README_dec.md) +### For API and testbench usage of encoder, please refer [`README_enc.md`](README_enc.md) diff --git a/crates/vendor/libxaac-sys/libxaac/README_dec.md b/crates/vendor/libxaac-sys/libxaac/README_dec.md new file mode 100644 index 00000000..3db93207 --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/README_dec.md @@ -0,0 +1,245 @@ + + +# Introduction to libxaac decoder APIs + +## Decoder APIs + +A single API is used to get and set configurations and execute the decode thread, based on command index passed. +* ia_xheaacd_dec_api + +| **API Command** | **API Sub Command** | **Description** | +|------|------|------| +|IA_API_CMD_GET_LIB_ID_STRINGS | IA_CMD_TYPE_LIB_NAME | Gets the decoder library name | +|IA_API_CMD_GET_LIB_ID_STRINGS | IA_CMD_TYPE_LIB_VERSION | Gets the decoder version | +|IA_API_CMD_GET_API_SIZE | 0 | Gets the memory requirements size of the API | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS | Sets the configuration parameters of the libxaac decoder to default values | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS | Sets the attributes(size, priority, alignment) of all memory types required by the application onto the memory structure | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_PROCESS | Search for the valid header, does header decode to get the parameters and initializes state and configuration structure | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_DONE_QUERY | Checks if the initialization process has completed | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_PCM_WDSZ | Sets the bit width of the output PCM samples. The value has to be 16 | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_SAMP_FREQ | Sets the core AAC sampling frequency for RAW header decoding | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE | Sets the value of DRC effect type | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS | Sets the value of DRC target loudness | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX | Sets the parameter whether the output needs to be down-mix to mono(1) or not(0) | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_TOSTEREO | Sets the flag to disable interleave mono to stereo | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DSAMPLE | Sets the parameter whether the output needs to be downsampled(1) or not(0) | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_ISMP4 | Sets the flag to 0 or 1 to indicate whether given test vector is an mp4 file or not | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_MAX_CHANNEL | Sets the maximum number of channels present. Its maximum value is 2 for stereo library and 8 for multichannel library | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_COUP_CHANNEL | Sets the number of coupling channels to be used for coupling. It can take values from 0 to 16. This command is supported only if the library has multichannel support | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX_STEREO | Sets the flag of downmixing n number of channels to stereo. Can be 0 or 1. This command is supported only if the library has multichannel support | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_DISABLE_SYNC | Sets the flag of ADTS syncing or not ADTS syncing as 0 or 1 | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_AUTO_SBR_UPSAMPLE | Sets the parameter auto SBR upsample to 0 or 1. Used in case of stream changing from SBR present to SBR not present | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_CUT | Sets the value of DRC cut factor | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_BOOST | Sets the value of DRC boost factor | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_HEAVY_COMP | Sets the parameter to either enable/disable DRC heavy compression | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMESIZE | Sets the parameter whether decoder should decode for frame length 480 or 512 | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_LD_TESTING | Sets the flag to enable LD testing in decoder | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_HQ_ESBR | Sets the flag to enable/disable high quality eSBR | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_PS_ENABLE | Sets the flag to indicate the presence of PS data in eSBR bit stream | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_PEAK_LIMITER | Sets the flag to disable/enable peak limiter | +|IA_API_CMD_SET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG | Sets to flag to indicate whether decoder should decode for frame length 960 or 1024 | +|IA_API_CMD_SET_CONFIG_PARAM | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_TARGET_LEVEL | Sets the value of DRC target level | +|IA_API_CMD_SET_CONFIG_PARAM | IA_XHEAAC_DEC_CONFIG_ERROR_CONCEALMENT | Sets the flag to disable/enable error concealment | +|IA_API_CMD_SET_CONFIG_PARAM | IA_XHEAAC_DEC_CONFIG_PARAM_ESBR | Sets the flag to disable/enable eSBR | +|IA_API_CMD_GET_N_MEMTABS | 0 | Gets the number of memory types | +|IA_API_CMD_GET_N_TABLES | 0 | Gets the number of tables | +|IA_API_CMD_GET_MEM_INFO_SIZE | 0 | Gets the size of the memory type being referred to by the index | +|IA_API_CMD_GET_MEM_INFO_ALIGNMENT | 0 | Gets the alignment information of the memory-type being referred to by the index | +|IA_API_CMD_GET_MEM_INFO_TYPE | 0 | Gets the type of memory being referred to by the index | +|IA_API_CMD_SET_MEM_PTR | 0 | Sets the pointer to the memory being referred to by the index to the input value | +|IA_API_CMD_GET_TABLE_INFO_SIZE | 0 | Gets the size of the memory type being referred to by the index | +|IA_API_CMD_GET_TABLE_INFO_ALIGNMENT | 0 | Gets the alignment information of the memory-type being referred to by the index | +|IA_API_CMD_GET_TABLE_PTR | 0 | Gets the address of the current location of the table | +|IA_API_CMD_SET_TABLE_PTR | 0 | Sets the relocated table address | +|IA_API_CMD_GET_MEMTABS_SIZE | 0 | Gets the size of the memory structures | +|IA_API_CMD_SET_MEMTABS_PTR | 0 | Sets the memory structure pointer in the library to the allocated value | +|IA_API_CMD_INPUT_OVER | 0 | Signals the end of bit-stream to the library | +|IA_API_CMD_SET_INPUT_BYTES | 0 | Sets the number of bytes available in the input buffer for initialization | +|IA_API_CMD_GET_CURIDX_INPUT_BUF | 0 | Gets the number of input buffer bytes consumed by the last initialization | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_PCM_WDSZ | Gets the output PCM word size | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_SAMP_FREQ | Gets the sampling frequency | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_NUM_CHANNELS | Gets the output number of channels | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MASK | Gets the channel mask | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MODE | Gets the channel mode. (Mono or PS/Stereo/Dual-mono) | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_SBR_MODE | Gets the SBR mode (Present/ Not Present) | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE | Gets the value of DRC effect type | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS | Gets the value of DRC target loudness | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_LOUD_NORM | Gets the value of DRC loudness normalization level | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_PARAM_AOT | Gets the value of audio object type | +|IA_API_CMD_GET_CONFIG_PARAM | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_LOUDNESS_LEVELING | Gets the value of loudness leveling flag | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_PTR | Gets the extension element pointer | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_EXT_ELE_BUF_SIZES | Gets the extension element buffer sizes | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_NUM_ELE | Gets the number of configuration elements | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_NUM_CONFIG_EXT | Gets the number of extension elements | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_GAIN_PAYLOAD_LEN | Gets the gain payload length | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_GAIN_PAYLOAD_BUF | Gets the gain payload buffer | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_CONFIG_GET_NUM_PRE_ROLL_FRAMES | Gets the number of preroll frames | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_DRC_IS_CONFIG_CHANGED | Gets the value of DRC config change flag | +|IA_API_CMD_GET_CONFIG_PARAM | IA_ENHAACPLUS_DEC_DRC_APPLY_CROSSFADE | Gets the value of DRC crossfade flag | +|IA_API_CMD_EXECUTE | IA_CMD_TYPE_DO_EXECUTE | Executes the decode thread | +|IA_API_CMD_EXECUTE | IA_CMD_TYPE_DONE_QUERY | Checks if the end of decode has been reached | +|IA_API_CMD_GET_OUTPUT_BYTES | 0 | Gets the number of bytes output by the decoder in the last frame | + +### Aliases for some of the macros exist as XHEAAC + +| **Macro** | **Alias** | +|------|------| +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_PCM_WDSZ | IA_XHEAAC_DEC_CONFIG_PARAM_PCM_WDSZ | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_SAMP_FREQ | IA_XHEAAC_DEC_CONFIG_PARAM_SAMP_FREQ | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_NUM_CHANNELS | IA_XHEAAC_DEC_CONFIG_PARAM_NUM_CHANNELS | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MASK | IA_XHEAAC_DEC_CONFIG_PARAM_CHANNEL_MASK | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_CHANNEL_MODE | IA_XHEAAC_DEC_CONFIG_PARAM_CHANNEL_MODE | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_SBR_MODE | IA_XHEAAC_DEC_CONFIG_PARAM_SBR_MODE | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_EFFECT_TYPE | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_TARGET_LOUDNESS | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_LOUD_NORM | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_LOUD_NORM | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX | IA_XHEAAC_DEC_CONFIG_PARAM_DOWNMIX | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_TOSTEREO | IA_XHEAAC_DEC_CONFIG_PARAM_TOSTEREO | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DSAMPLE | IA_XHEAAC_DEC_CONFIG_PARAM_DSAMPLE | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_ISMP4 | IA_XHEAAC_DEC_CONFIG_PARAM_MP4FLAG | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_MAX_CHANNEL | IA_XHEAAC_DEC_CONFIG_PARAM_MAX_CHANNEL | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_COUP_CHANNEL | IA_XHEAAC_DEC_CONFIG_PARAM_COUP_CHANNEL | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DOWNMIX_STEREO | IA_XHEAAC_DEC_CONFIG_PARAM_DOWNMIX_STEREO | +|IA_ENHAACPLUS_DEC_CONFIG_DISABLE_SYNC | IA_XHEAAC_DEC_CONFIG_DISABLE_SYNC | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_AUTO_SBR_UPSAMPLE | IA_XHEAAC_DEC_CONFIG_PARAM_AUTO_SBR_UPSAMPLE | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_CUT | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_CUT | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_BOOST | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_BOOST | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_DRC_HEAVY_COMP | IA_XHEAAC_DEC_CONFIG_PARAM_DRC_HEAVY_COMP | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMESIZE | IA_XHEAAC_DEC_CONFIG_PARAM_FRAMESIZE | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_LD_TESTING | IA_XHEAAC_DEC_CONFIG_PARAM_LD_TESTING | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_HQ_ESBR | IA_XHEAAC_DEC_CONFIG_PARAM_HQ_ESBR | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_PS_ENABLE | IA_XHEAAC_DEC_CONFIG_PARAM_PS_ENABLE | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_AOT | IA_XHEAAC_DEC_CONFIG_PARAM_AOT | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_PEAK_LIMITER | IA_XHEAAC_DEC_CONFIG_PARAM_PEAK_LIMITER | +|IA_ENHAACPLUS_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG | IA_XHEAAC_DEC_CONFIG_PARAM_FRAMELENGTH_FLAG | + +## DRC APIs + +A single API is used to get and set configurations and execute the decode thread, based on command index passed. +* ia_drc_dec_api + +| **API Command** | **API Sub Command** | **Description** | +|------|------|------| +|IA_API_CMD_GET_API_SIZE | 0 | Gets the memory requirements size of the API | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_API_PRE_CONFIG_PARAMS | Sets the configuration parameters of the libxaac decoder to default values | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_API_POST_CONFIG_PARAMS | Sets the attributes(size, priority, alignment) of all memory types required by the application onto the memory structure | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_PROCESS | Search for the valid header, does header decode to get the parameters and initializes state and configuration structure | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_CPY_BSF_BUFF | Sets the bitstream split format buffer | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_CPY_IC_BSF_BUFF | Sets the configuration bitstream split format buffer | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_CPY_IL_BSF_BUFF | Sets the loudness bitstream split format buffer | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_CPY_IN_BSF_BUFF | Sets the interface bitstream split format buffer | +|IA_API_CMD_INIT | IA_CMD_TYPE_INIT_SET_BUFF_PTR | Sets the input buffer pointer | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_SAMP_FREQ | Sets the sampling frequency of the input stream/data | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS | Sets the number of channels in the input stream/data | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_PCM_WDSZ | Sets the PCM word size of the input data | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_BITS_FORMAT | Sets the bit stream format | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_INT_PRESENT | Sets the DRC decoders interface present flag to 1 or 0 | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_FRAME_SIZE | Sets the frame size | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_DRC_EFFECT_TYPE | Sets the value of DRC effect type | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_DRC_TARGET_LOUDNESS | Sets the value of DRC target loudness | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_DRC_LOUD_NORM | Sets the value of DRC loudness normalization level | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_APPLY_CROSSFADE | Sets the value of DRC crossfade flag | +|IA_API_CMD_SET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_CONFIG_CHANGED | Sets the value of DRC config change flag | +|IA_API_CMD_GET_MEM_INFO_SIZE | 0 | Gets the size of the memory type being referred to by the index | +|IA_API_CMD_GET_MEMTABS_SIZE | 0 | Gets the size of the memory structures | +|IA_API_CMD_SET_MEMTABS_PTR | 0 | Sets the memory structure pointer in the library to the allocated value | +|IA_API_CMD_GET_N_MEMTABS | 0 | Gets the number of memory types | +|IA_API_CMD_SET_INPUT_BYTES | 0 | Sets the number of bytes available in the input buffer for initialization | +|IA_API_CMD_GET_MEM_INFO_ALIGNMENT | 0 | Gets the alignment information of the memory-type being referred to by the index | +|IA_API_CMD_GET_MEM_INFO_TYPE | 0 | Gets the type of memory being referred to by the index | +|IA_API_CMD_SET_MEM_PTR | 0 | Sets the pointer to the memory being referred to by the index to the input value | +|IA_API_CMD_SET_INPUT_BYTES_BS | 0 | Sets the number of bytes to be processed in bitstream split format | +|IA_API_CMD_SET_INPUT_BYTES_IC_BS | 0 | Sets the number of bytes to be processed in configuration bitstream split format | +|IA_API_CMD_SET_INPUT_BYTES_IL_BS | 0 | Sets the number of bytes to be processed in loudness bitstream split format | +|IA_API_CMD_GET_CONFIG_PARAM | IA_DRC_DEC_CONFIG_PARAM_NUM_CHANNELS | Gets the output number of channels | +|IA_API_CMD_EXECUTE | IA_CMD_TYPE_DO_EXECUTE | Executes the decode thread | + +## Flowchart of calling sequence + +![API Flowchart](docs/Api_flowchart_dec.png) + +# Running the libxaac decoder + +The libxaac decoder can be run by providing command-line parameters(CLI options) directly or by providing a parameter file as a command line argument. + +Command line usage : +``` + -ifile: -imeta: -ofile: [options] + +[options] can be, +[-mp4:] +[-pcmsz:] +[-dmix:] +[-esbr_hq:] +[-esbr_ps:] +[-tostereo:] +[-dsample:] +[-drc_cut_fac:] +[-drc_boost_fac:] +[-drc_target_level:] +[-drc_heavy_comp:] +[-effect:] +[-target_loudness:] +[-nosync:] +[-sbrup:] +[-flflag:} +[-fs:] +[-maxchannel:] +[-coupchannel:] +[-downmix:] +[-fs480:] +[-ld_testing:] +[-peak_limiter_off:] +[-err_conceal:] +[-esbr:] +[-loudness_leveling:] + +where, + is the input AAC-LC/HE-AACv1/HE-AACv2/AAC-LD/AAC-ELD/AAC-ELDv2/USAC file name. + is a text file which contains metadata. To be given when -mp4:1 is enabled. + is the output file name. + is a flag that should be set to 1 when passing raw stream along with meta data text file. + is the bits per sample info. value can be 16 or 24. + is to enable/disable always mono output. Default 1. + is to enable/disable high quality eSBR. Default 0. + is to indicate eSBR with PS. Default 0. + is to enable/disable always interleaved to stereo output. Default 1. + is to enable/disable down-sampled SBR output. Default auto identification from header. + is to set DRC cut factor value. Default value is 1. + is to set DRC boost factor. Default value is 1. + is to set DRC target reference level. Default value is 108. + is to enable/disable DRC heavy compression. Default value is 0. + is to set DRC effect type. Default value is 0. + is to set target loudness level. Default value is -24. + is to disable the ADTS/ADIF sync search i.e when enabled the decoder expects the header to be at the start of input buffer. Default 0. + is to enable(1) or disable(0) auto SBR upsample in case of stream changing from SBR present to SBR not present. Default 1. + is flag for decoding framelength of 1024 or 960. 1 to decode 960 frame length, 0 to decode 1024 frame length. + Frame length value in the GA header will override this option. Default 0. + is to indicate the core AAC sample rate for a RAW stream. If this is specified no other file format headers are searched for. + is the number of maxiumum channels the input may have. Default is 6 for multichannel libraries and 2 for stereo libraries. + is element instance tag of independent coupling channel to be mixed. Default is 0. + is flag for Downmix. Give 1 to get stereo (downmix) output. Default is 0. + is to indicate ld frame size. 0 is for 512 frame length, 1 is for 480 frame length. Default value is 512 (0). + is to enable/disable ld decoder testing. Default value is 0. + is to enable/disable peak limiter. Default value is 0. + is to enable/disable error concealment. Default value is 0. + is to enable/disable eSBR. Default value is 1. + is to enable / disable loudness leveling. Default value is 1. + +``` +Note: `loudness_leveling_flag` is applicable only if `LOUDNESS_LEVELING_SUPPORT` macro is enabled. +Sample CLI: +``` + -ifile:in_file.aac -ofile:out_file.wav -pcmsz:16 +``` + +# Validating the libxaac decoder + +Conformance testing for AAC/HE-AACv1/HE-AACv2 mainly involves comparing +decoder under test output with the ISO and 3GPP reference decoded output. + +Testing for USAC is done using encoded streams generated using ISO USAC +reference encoder. The output generated by libxaac USAC decoder is +compared against the output generated by ISO USAC decoder for 16-bit +conformance on the respective(ARMv7, ARMv8, X86_32, X86_64) platforms. + diff --git a/crates/vendor/libxaac-sys/libxaac/README_enc.md b/crates/vendor/libxaac-sys/libxaac/README_enc.md new file mode 100644 index 00000000..b80b1e2b --- /dev/null +++ b/crates/vendor/libxaac-sys/libxaac/README_enc.md @@ -0,0 +1,123 @@ +# Introduction libxaac encoder APIs + +# Encoder APIs + +| **API Call** | **Description** | +|------|------| +|ixheaace_get_lib_id_strings| Gets the encoder library name and version number details | +|ixheaace_create| Sets the encoder configuration parameters, gets the memory requirements and allocates required memory | +|ixheaace_process| Encodes the input frame data | +|ixheaace_delete| Frees the allocated memories for the encoder | + +## Flowchart of calling sequence +![API Flowchart](docs/Api_flowchart_enc.png) + +# Audio Object Types(AOT) +| **AOT** | **Description** | +|------|------| +|2|AAC-LC| +|5|HE-AACv1| +|23|AAC-LD| +|29|HE-AACv2| +|39|AAC-ELD| +|42|USAC| + +# Running the libxaac encoder +The libxaac encoder can be run by providing command-line parameters(CLI options) directly or by providing a parameter file as a command line argument. +The reference paramfile is placed in `encoder\test` directory(paramfilesimple.txt) +The configuration file for DRC is placed in `encoder\test` directory(impd_drc_config_params.txt). Please make sure this file is placed in the same directory as the executable. + +# Command line usage : +``` + -ifile: -ofile: [options] +(or) + -paramfile: +[options] can be, +[-br:] +[-mps:] +[-adts:] +[-tns:] +[-nf:] +[-cmpx_pred:] +[-framesize:] +[-aot:] +[-esbr:] +[-full_bandwidth:] +[-max_out_buffer_per_ch:] +[-tree_cfg:] +[-usac:] +[-ccfl_idx:] +[-pvc_enc:] +[-harmonic_sbr:] +[-esbr_hq:] +[-drc:] +[-inter_tes_enc:] +[-rap:] +[-stream_id:] + +where, + is the parameter file with multiple commands + is the input 16-bit WAV or PCM file name + is the output ADTS/ES file name + is the bit-rate in bits per second. Default value is 48000. + Valid values are 0 (disable MPS) and 1 (enable MPS). Default is 0. + Valid values are 0 ( No ADTS header) and 1 ( generate ADTS header). Default is 0. + Valid values are 0 (disable TNS) and 1 (enable TNS). Default is 1. + controls usage of noise filling in encoding. Default 0. + controls usage of complex prediction in encoding. Default is 0. + is the framesize to be used. + For AOT 23, 39 (LD core coder profiles) valid values are 480 and 512. Default is 512. + For AOT 2, 5, 29 (LC core coder profiles) valid values are 960 and 1024. Default is 1024. + For AOT 42 (USAC profile) valid values are 768 and 1024. Default is 1024. + is the Audio object type. + 2 for AAC-LC + 5 for HE-AACv1(Legacy SBR) + 23 for AAC-LD + 29 for HE-AACv2 + 39 for AAC-ELD + 42 for USAC + Default is 2 for AAC-LC. + Valid values are 0 (disable eSBR) and 1 (enable eSBR). Default is 0 for HE-AACv1 profile (legacy SBR) and 1 for USAC profile. + Enable use of full bandwidth of input. Valid values are 0(disable full bandwidth) and 1(enable full bandwidth). Default is 0. + is the maximum size of bit reservoir to be used. Valid values are from -1 to 6144. -1 will omit use of bit reservoir. Default is 384. + MPS tree config + 0 for '212' + 1 for '5151' + 2 for '5152' + 3 for '525' + Default 0 for stereo input and 1 for 6ch input. + USAC encoding mode to be chose + 0 for 'usac_switched' + 1 for 'usac_fd' + 2 for 'usac_td' + Default 'usac_fd' + is the core coder framelength index for USAC encoder. + Valid values are 0, 1, 2, 3, 4. eSBR enabling is implicit + 0 - Core coder framelength of USAC is 768 and eSBR is disabled + 1 - Core coder framelength of USAC is 1024 and eSBR is disabled + 2 - Core coder framelength of USAC is 768 and eSBR ratio 8:3 + 3 - Core coder framelength of USAC is 1024 and eSBR ratio 2:1 + 4 - Core coder framelength of USAC is 1024 and eSBR ratio 4:1 + Valid values are 0 (disable PVC encoding) and 1 (enable PVC encoding). Default is 0. + Valid values are 0 (disable harmonic SBR) and 1 (enable harmonic SBR). Default is 0. + Valid values are 0 (disable high quality eSBR) and 1 (enable high quality eSBR). Default is 0. + Valid values are 0 (disable DRC encoding) and 1 (enable DRC encoding). Default is 0. + Valid values are 0 (disable inter-TES encoding) and 1 (enable inter-TES encoding). Default is 0. + is the time interval between audio preroll frames in ms. It is applicable only for AOT 42. Valid values are -1 (Audio preroll sent only at beginning of file) and greater than 1000 ms. Default is -1. + It is the stream id used to uniquely identify configuration of a stream within a set of associated streams. It is applicable only for AOT 42. Valid values are 0 to 65535. Any value outside this range is type-casted to a value of unsigned short type. Default is 0. + is used to discard algorithmic delay from the decoded file. It is applicable only for AOT 42. Valid values are 0 and 1. Default is 1." + +``` +Sample CLI: +``` +-ifile:input_file.wav -ofile:out_file.aac -br: –aot: