# encoder-rle4k-cpu **Repository Path**: rle4k/encoder-rle4k-cpu ## Basic Information - **Project Name**: encoder-rle4k-cpu - **Description**: encoder-rle4k-cpu, the rle4k encoder developer by cpu. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-09 - **Last Updated**: 2026-07-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # encoder-rle4k-cpu Open-source **reproducibility package** for the RLE4K CPU bitmap codec and benchmark CLI (`redcli`). [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) ## What this repository contains | Component | Description | |-----------|-------------| | **`redcli`** | Command-line benchmark: DIF load → rasterize → encode/decode → timing | | **`librle4k`** | RLE4K encode/decode (integrated under `redcli/`) | | **Six codecs** | RLE4K, GZIP, LZO2, Snappy, ZSTD, Brotli (via vcpkg on Windows) | | **DIF + rasterizer** | In-tree `.dif` parser and scanline rasterizer | This is a **research reproducibility** tree, not production CAM software. Supported input: **`.dif`** only (not Gerber/GDS). ## Quick start ### Prerequisites - Windows x64 - Visual Studio 2022 (or Build Tools) + CMake 3.16+ - [vcpkg](https://github.com/microsoft/vcpkg) — set `VCPKG_ROOT` (scripts also auto-detect common install paths) ### Install vcpkg One-click (downloads, bootstraps, and configures `VCPKG_ROOT` + PATH automatically): ```powershell .\scripts\setup-vcpkg.ps1 ``` Or do it manually — clone and bootstrap from source: ```powershell git clone https://github.com/microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat $env:VCPKG_ROOT = (Get-Location).Path # persist in your shell profile ``` Alternatively, download the source as a zip from the [vcpkg releases page](https://github.com/microsoft/vcpkg/releases) (or the [master snapshot](https://github.com/microsoft/vcpkg/archive/refs/heads/master.zip)), extract it, run `.\bootstrap-vcpkg.bat`, and set `VCPKG_ROOT`. Full details and the Linux/macOS path are in [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md). ## Installation All commands are run from the **repository root** (`encoder-rle4k-cpu/`), not from inside `scripts/`. ### 1. Get the source ```powershell git clone https://github.com/rle4k/encoder-rle4k-cpu.git cd encoder-rle4k-cpu ``` > Prefer Gitee (China-friendly)? `git clone https://gitee.com/rle4k/encoder-rle4k-cpu.git` ### 2. Install vcpkg (one-click) ```powershell .\scripts\setup-vcpkg.ps1 ``` This downloads the latest vcpkg, runs bootstrap, and persists `VCPKG_ROOT` + PATH automatically. Full manual steps and the Linux/macOS path are in [Install vcpkg](#install-vcpkg) below and [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md). ### 3. Build ```powershell # One-shot build (Release, x64, vcpkg manifest) .\build.bat # equivalent: .\scripts\msbuild.ps1 Release ``` Output: `build/redcli.exe` (NMake) or `build/Release/redcli.exe` (VS generator). Build logs: `build/temp/` (`build_log.txt`, `nmake_output.txt`). ### Configure and run The canonical configuration example is **[docs/redcli.example.json](docs/redcli.example.json)**. After build, a working copy is placed next to the executable as `redcli.json`. Edit it before running: ```powershell cd build copy ..\docs\redcli.example.json redcli.json # optional manual copy .\redcli.exe edit # open in default editor # set "input" to your .dif file or folder, then: .\redcli.exe run ``` Or from the repository root: ```powershell .\build\redcli.exe init # creates ./redcli.json from docs/redcli.example.json .\build\redcli.exe edit .\build\redcli.exe run --input path\to\file.dif ``` ### Tests (optional) Provide your own DIF fixture: ```powershell # Batch test a folder of .dif files (auto-detects data/ or results/): .\scripts\test-folder.ps1 # Single file: .\scripts\test-single-file.ps1 C:\path\to\sample.dif ``` Benchmark output directory defaults to `build/out/` (see config `output_path`). ## Documentation | Document | Topic | |----------|--------| | [docs/README.md](docs/README.md) | Documentation index | | [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Module layout and data flow | | [docs/PIPELINE.md](docs/PIPELINE.md) | CLI commands and benchmark pipeline | | [docs/RASTERIZATION.md](docs/RASTERIZATION.md) | Rasterizer and threading | | [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md) | vcpkg packages and third-party licenses | | [docs/redcli.example.json](docs/redcli.example.json) | Benchmark configuration reference | ## Project layout ``` encoder-rle4k-cpu/ ├── redcli/ # CLI + librle4k + rasterizer sources ├── docs/ # User-facing documentation + redcli.example.json ├── scripts/ # Build and test scripts (msbuild.ps1, run_all.ps1, …) ├── manifest/ # Vendoring alignment manifest (repro sync) ├── CMakeLists.txt ├── vcpkg.json ├── LICENSE └── CONTRIBUTING.md ``` ## Reproducibility This section documents the **exact build environment** used in the paper's benchmark so that reviewers and readers can reproduce the reported results. ### Build Environment | Item | Value | |------|-------| | OS | Windows 11 x64 | | Compiler | MSVC 14.44 (Visual Studio 2022 17.14 Enterprise) | | C++ Standard | C++17 | | MSVC Flags | `/W3 /wd4819 /EHsc` | | Optimization | `/O2` (CMake Release default) | | Runtime | `/MT` (static, `MultiThreaded`) | | CMake | 3.16+ | | vcpkg Baseline | `4bb07a326d9b9bce3703272a509e5bc25dd9cfd5` | | Triplet | `x64-windows-static` | | Hardware | Intel Core i9-13900K, 128 GB RAM | ### Benchmark Libraries (versions pinned via vcpkg) | Library | Version | Format | |---------|---------|--------| | RLE4K | in-tree | Format 0 | | GZIP (zlib) | 1.3.1 | Format 1 | | LZO2 | 2.10 | Format 2 | | Snappy | 1.2.2 | Format 3 | | ZSTD | 1.5.7 | Format 4 | | Brotli | 1.1.0 | Format 5 | Full dependency details in [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md). ## Vendoring note Core RLE4K sources are aligned with **ezdi-encoders** tag `v1.0.0` per `manifest/repro.alignment.yaml`. ## License Released under the [Apache License 2.0](LICENSE). Portions of `librle4k` are vendored from the ezdi encoders product line under the same license; see `manifest/repro.alignment.yaml` for file-level mapping. ## Citation If you use this software in academic work, please cite the associated paper **{A1-RLE4K-CPU-P01 DOI}** and this repository (tag `v0.1.0` or the commit you reproduced). ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md). ## Datasets The benchmark dataset is the **Gerber Sample Files** collection — 64 PCB Gerber RS-274X files. It is mirrored across the following sources; pick whichever is most convenient: | Source | URL | Notes | |--------|-----|-------| | GitHub | `https://github.com/disking-cn/gerber-sample-files` | Clone: `git clone https://github.com/disking-cn/gerber-sample-files` | | Gitee | `https://gitee.com/disking-cn/gerber_sample_files` | Mirror (China-friendly): `git clone https://gitee.com/disking-cn/gerber_sample_files` | | IEEE DataPort | `https://ieee-dataport.org/documents/gerber-sample-files-dataset-64-pcb-gerber-rs-274x-files` | DOI: [10.21227/v40v-jd61](https://dx.doi.org/10.21227/v40v-jd61) | > Note: `redcli` consumes `.dif` input. Before benchmarking, convert the Gerber RS-274X files to `.dif` using **`gbrcli`** (located under `/tools`): > > ```powershell > # Convert a Gerber RS-274X file to .dif (see docs/REQ.md for exact options) > .\tools\gbrcli.exe -o > ``` > > Then point `redcli` at the resulting `.dif` (see [docs/REQ.md](docs/REQ.md) for conversion details).