{"id":39817703,"url":"https://github.com/dbry/adpcm-xq","last_synced_at":"2026-01-18T12:52:47.014Z","repository":{"id":40524136,"uuid":"45325952","full_name":"dbry/adpcm-xq","owner":"dbry","description":"Xtreme Quality IMA-ADPCM Encoder / Decoder","archived":false,"fork":false,"pushed_at":"2024-10-17T20:24:32.000Z","size":53,"stargazers_count":211,"open_issues_count":4,"forks_count":45,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-20T07:07:07.053Z","etag":null,"topics":["adpcm","audio-encoder","canned-content"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-01T02:42:55.000Z","updated_at":"2024-10-17T20:24:36.000Z","dependencies_parsed_at":"2024-09-18T00:30:25.243Z","dependency_job_id":"8b8cee6e-1027-4422-ba3e-d5954133ea05","html_url":"https://github.com/dbry/adpcm-xq","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dbry/adpcm-xq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbry%2Fadpcm-xq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbry%2Fadpcm-xq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbry%2Fadpcm-xq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbry%2Fadpcm-xq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbry","download_url":"https://codeload.github.com/dbry/adpcm-xq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbry%2Fadpcm-xq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adpcm","audio-encoder","canned-content"],"created_at":"2026-01-18T12:52:46.552Z","updated_at":"2026-01-18T12:52:47.006Z","avatar_url":"https://github.com/dbry.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ADPCM-XQ\n\nXtreme Quality ADPCM Encoder/Decoder\n\nCopyright (c) 2024 David Bryant.\n\nAll Rights Reserved.\n\nDistributed under the [BSD Software License](https://github.com/dbry/adpcm-xq/blob/master/license.txt).\n\n## What is this?\n\nWhile very popular at the end of the last century, ADPCM is no longer a\ncommon audio encoding format, and is certainly not recommended as a general\npurpose encoder. However, it requires minimal CPU resources for decoding,\nand so still is ideally suited for certain embedded games and applications\nthat contain canned audio samples.\n\nThis encoder combines two different techniques to achieve higher quality\nthan existing ADPCM encoders while remaining fully compatible with standard\ndecoders. The first is dynamic noise shaping, which shifts the quantization\nnoise up or down in frequency based on the spectrum of the source signal.\nThis technique is identical to the algorithm used in WavPack's lossy mode\nand can make any audible quantization noise much less annoying (or, in some\ncases, inaudible).\n\nThe other technique is \"lookahead\" in which the encoder exhaustively\nsearches ahead to find the optimum coding sequence based on future samples.\nThis process can reduce the quantization noise from about 1 to 10 dB (depending\non the source) and also reduces or eliminates the harmonic content in the\nnoise that sometimes plagues ADPCM. Unfortunately, at its maximum settings\nthis can be very slow, but this should be relatively irrelevant if the\nencoder is being used to generate canned samples.\n\n**Adpcm-xq** consists of three standard C files and a header file ([adpcm-lib.h](adpcm-lib.h)).\nIt can be used as a stand-alone command-line program implemented in [adpcm-xq.c](adpcm-xq.c),\nor the library, which consists of [adpcm-lib.c](adpcm-lib.c) and [adpcm-dns.c](adpcm-dns.c),\ncan be built into and utilized by another application. The library portion has\nbeen designed with maximum portability in mind and should work correctly even\non 16-bit and big-endian architectures.\n\n## What's New?\n\nThe latest version of **adpcm-xq** has many enhancements including greatly\nimproved performance of the conversion and the ability to calculate and display\nthe quantization noise introduced in the operation.\n[See all the details here.](https://github.com/dbry/adpcm-xq/releases/tag/v0.5)\n\n## Variations\n\nThere are several forms and variations of IMA ADPCM encoding. The one handled\nby **adpcm-xq** is the canonical one used in Microsoft WAV files. The audio is\ndivided into fixed-sized blocks that include a 4-byte header (or 8-byte for\nstereo) that includes the first sample. The size of the blocks is stored in the\nWAV header and the audio nibbles are ordered least-significant temporally first.\n\nThe latest version of adpcm-xq also includes 2-bit, 3-bit and 5-bit ADPCM. These\nare **not well-supported at all** (and some support is buggy) but they might be\nuseful if this library is decoding them in situations where more compression\nor higher quality is desired. BTW, [Rockbox](https://www.rockbox.org/) provides\nexcellent support for them!\n\nSome applications like games and consoles that decode IMA ADPCM in hardware or\nmicrocode use modified versions of IMA ADPCM that do not use headers and do not\ndivide the audio into blocks or frames of any kind. The decoding parameters are\nsimply initialized to zero and the audio nibbles continue uninterrupted to the\nend of the clip. I have created an experimental version that will generate two\nvariations of this data. One is standard nibble order and the other is reversed\nnibble order (sometimes called **Intel/DVI4** or **ADP4** and is the format used in\nAIFF files). These formats are only writable as \"raw\" by the **adpcm-xq** command-line\nprogram because they are not representable in WAV files, and they cannot\nbe decoded by the program either (for the same reason), however the library\nitself handles them. [The experimental branch is here.](https://github.com/dbry/adpcm-xq/commits/new-formats/)\n\n## Building\n\nTo build the command-line tool (**ADPCM-XQ**) on Linux:\n\n\u003e $ gcc -O3 *.c -lm -o adpcm-xq\n\non Darwin/Mac:\n\n\u003e $ cmake -DCMAKE_OSX_ARCHITECTURES=\"arm64;x86_64\" . ; make\n\non MS Visual Studio:\n\n\u003e C:\\cl -O3 adpcm-xq.c adpcm-lib.c adpcm-dns.c\n\n## Help\n\n```\n ADPCM-XQ   Xtreme Quality IMA-ADPCM WAV Encoder / Decoder   Version 0.5\n Copyright (c) 2024 David Bryant. All Rights Reserved.\n\n Usage:     ADPCM-XQ [-options] infile.wav outfile.wav\n\n Operation: conversion is performed based on the type of the infile\n          (either encode 16-bit PCM to 4-bit IMA-ADPCM or decode back)\n\n Options:  -[0-16]= encode lookahead samples (default = 3, max = 16)\n           -b\u003cn\u003e  = override auto block size, 2^n bytes (n = 8-15)\n           -d     = decode only (fail on WAV file already PCM)\n           -e     = encode only (fail on WAV file already ADPCM)\n           -f     = encode flat noise (no noise shaping, aka -s0.0)\n           -h     = display this help message\n           -n     = measure and report quantization noise\n           -q     = quiet mode (display errors only)\n           -r     = raw output (little-endian, no WAV header written)\n           -s\u003cn\u003e  = override default noise shaping, (-1.0 \u003c n \u003c= 1.0)\n           -v     = verbose (display lots of info)\n           -w\u003cn\u003e  = override default 4-bit ADPCM width (2 \u003c= n \u003c= 5)\n           -x     = exhaustive search (old behavior, very slow at depth)\n           -y     = overwrite outfile if it exists\n\n Web:       Visit www.github.com/dbry/adpcm-xq for latest version and info\n\n```\n\n## Caveats\n\n- Unknown RIFF chunk types are correctly parsed on input files, but are not\npassed to the output file.\n\n- In some situations, at high lookahead levels, the operation can get very slow\nor even seem to be stuck, however this will happen at much higher lookahead depths\nthan before. The default level 3 should always be fine and then the user can\nsimply try increasing levels until the time becomes untenable. The new quantization\nnoise option (**-n**) can be used to determine if higher levels are providing\nimprovement (lower numbers are better). Note that the flat noise option (**-f**)\nwill provide the lowest *measured* noise, but the default dynamic noise shaping\nmay provide *less audible* noise.\n\n- Pipes are not yet supported.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbry%2Fadpcm-xq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbry%2Fadpcm-xq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbry%2Fadpcm-xq/lists"}