Skip to main content

PyPI version

WTC

WTC is an extension of the lzma compression format, specifically designed to make osu!std replays smaller before storing them. It reduces the size of certain datatypes in the original .osr format, achieving ~40% lossy compression ratios.

Part Original lzma datatype WTC datatype
w (ms since preivous frame) Long (8 bytes) 24bit Integer (3 bytes)
x (x-cord) Float (4 bytes) Short (2 bytes)
y (y-cord) Float (4 bytes) Short (2 bytes)
z (bit combination of keypresses) Integer (4 bytes) Char (1 byte)

This compresses the original 20 byte frame to an 8 byte frame, but not without losses. Precision is lost on w, x, and y, but not z, because the keypressed bit combination will never go above 4 bits for osu!standard. Though it may be larger for other gamemodes such as 7k mania, this compressor is explicitly for osu!standard.

WTC compression achieves an average of 40% ±5 compression (Not a formally calculated number - simply based on experience).

Installation:

$ pip install git+git://github.com/osu-anticheat/wtc-lzma-compressor

Usage:

import wtc

# to compress an lzma bytestring
wtc_bytestring = wtc.compress(lzma_bytestring)

# to decompress a wtc bytestring into an lzma bytestring
lzma_bytestring = wtc.decompress(wtc_bytestring)

# compress and decompress are (almost) inverse operations, so lzma_bytestring ≈ wtc.decompress(wtc.compress(lzma_bytestring)).
# some precision is lost, so the strings are not identical.

Metadata

Release files for wtc 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wtc 1.2.1
File Size Uploaded
wtc-1.2.1.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wtc 1.2.1
File Interpreter ABI Platform
wtc-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / wtc-1.2.1.tar.gz

Download URL wtc-1.2.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2c3ba44acf2967f3af01f690cbfcf6338f35596c590b17a0e41fc5f8188368d4
BLAKE2b-256 checksum
How to use checksums
d5ef58ef78870331571390dd32517e74858b2c458266f55fcb8d9ccff3ee9b16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

Release files / wtc-1.2.1-py3-none-any.whl

Download URL wtc-1.2.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e011d6a880b4454d34b52ce15fdddbdae81b0acbc48d35c3e9da208266bc4fff
BLAKE2b-256 checksum
How to use checksums
96cb9bdc1e73da3a436d8bdd7daa443a73332f126fddf783474cb7104e6020bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page