{"id":18782069,"url":"https://github.com/gpuopen-librariesandsdks/brotli_g_sdk","last_synced_at":"2025-07-28T18:06:29.740Z","repository":{"id":63577426,"uuid":"567387880","full_name":"GPUOpen-LibrariesAndSDKs/brotli_g_sdk","owner":"GPUOpen-LibrariesAndSDKs","description":"Brotli-G SDK provides an improved lossless compression ratio with GPU decompression support than the standard Brotli compression algorithm maintained by the IETF (also known as RFC7932)","archived":false,"fork":false,"pushed_at":"2024-04-18T14:23:24.000Z","size":16803,"stargazers_count":169,"open_issues_count":6,"forks_count":12,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-07T11:04:46.361Z","etag":null,"topics":["brotli","compression","gpu","web"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GPUOpen-LibrariesAndSDKs.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":"2022-11-17T17:23:21.000Z","updated_at":"2025-03-07T15:16:36.000Z","dependencies_parsed_at":"2024-04-17T14:30:13.351Z","dependency_job_id":"b4078732-e254-4ff4-a218-a4f11f677a7a","html_url":"https://github.com/GPUOpen-LibrariesAndSDKs/brotli_g_sdk","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/GPUOpen-LibrariesAndSDKs/brotli_g_sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2Fbrotli_g_sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2Fbrotli_g_sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2Fbrotli_g_sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2Fbrotli_g_sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GPUOpen-LibrariesAndSDKs","download_url":"https://codeload.github.com/GPUOpen-LibrariesAndSDKs/brotli_g_sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GPUOpen-LibrariesAndSDKs%2Fbrotli_g_sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267560499,"owners_count":24107499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["brotli","compression","gpu","web"],"created_at":"2024-11-07T20:34:43.345Z","updated_at":"2025-07-28T18:06:29.599Z","avatar_url":"https://github.com/GPUOpen-LibrariesAndSDKs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brotli-G SDK\nThis project contains the specifications and reference implementations for the Brotli-G compression format: \n \n[Brotli-G Bitstream Spec](docs/Brotli_G_Bitstream_Format.pdf)\n\nThe use of this technical documentation is goverened by the [License](LICENSE.txt).\n\n# Source\n\n* `src/decoder/BrotliGCompute.hlsl` - start here to read the HLSL source of the GPU decompressor\n* `src/decoder/PageDecoder.cpp`     - start here to read the source of the CPU decompressor\n* `src/BrotligDecoder.cpp`          - this contains the code driving the CPU decompressor\n* `src/encoder/PageEncoder.cpp`     - start here to read the source of the compressor\n* `src/BrotligEncoder.cpp`          - entry point for the compressor\n\n\n## Getting Started\n\nThe repo uses CMake build system. Install CMake \u003e= 3.11 if not installed.\n\n## Building\n\nRun \"Build.bat\" from a Visual Studio Developer Command Prompt to generate build files. Open the build files in compiler of choice and compile. Outputs are static libraries `build\\external\\brotli\\Release\\brotli.lib` and `build\\Release\\brotlig.lib`.\n\n## Usage\n\nTo use in a visual studio project, include `inc` `external` and `external\\brotli\\c\\include` as include directories and link `build\\external\\brotli\\Release\\brotli.lib` and `build\\Release\\brotlig.lib` as external libraries.\n \nRelevant header files:\n* `inc/BrotligEncoder.h` - function declarations for Brotli-G compressor \n* `inc/BrotligDecoder.h` - function declarations for Brotli-G CPU decompressor\n* `inc/BrotliG.h`        - Brolti-G API header file for both compressor and CPU decompressor\n* `inc/DataStream.h`     - data structures for Brotli-G datastream\n\nCode examples:\n\n```\n// Compression\nvoid Compress(size_t srcSize, uint8_t* src, size_t\u0026 dstSize, uint8_t*\u0026 dst, BrotligDataconditionParams dcParams)\n{\n    dstSize = BrotliG::MaxCompressedSize(srcSize);\n    dst = new uint8_t[dstSize];\n\t\n    size_t actualSize = 0;\n\t\n    BrotliG::Encode(\n\t\t\tsrcSize, \t\t// input size (bytes) \n\t\t\tsrc, \t\t\t// input data\n\t\t\t\u0026actualSize,\t\t// actual compressed size (bytes) \n\t\t\tdst, \t\t\t// compressed output\n\t\t\t65536,\t\t\t// page size (bytes)\n\t\t\tdcParams,\t\t// data pre-conditioning parameters\n\t\t\tnullptr\t\t\t// handle to an application defined progress function\n\t\t);\n\t\n    dstSize = actualSize;\n}\n```\n```\n// CPU Decompression\nvoid DecompressCPU(size_t srcSize, uint8_t* src, size_t\u0026 dstSize, uint8_t*\u0026 dst)\n{\n   dstSize = BrotliG::DecompressedSize(src);\n   dst = new uint8_t[dstSize];\n   \n   size_t actualSize = 0;\n\t\n   BrotliG::DecodeCPU(\n\t\t\tsrcSize, \t\t// compressed size (bytes) \n\t\t\tsrc, \t\t\t// compressed data\n\t\t\t\u0026actualSize,\t\t// decompressed size (bytes) \n\t\t\tdst, \t\t\t// decompressed output\n\t\t\tnullptr\t\t\t// handle to an application defined progress function\n\t\t);\n\t\t\n   dstSize = actualSize;\n}\n```\n\nExample root signature for BrotliGCompute.hlsl:\n\n```\nCD3DX12_ROOT_PARAMETER1 rootParameters[RootParametersCount];\nrootParameters[RootSRVInput].InitAsShaderResourceView(0);\t// Compressed data buffer (SRV input)\nrootParameters[RootUAVControl].InitAsUnorderedAccessView(0);\t// Compressed data control buffer (UAV input)\nrootParameters[RootUAVOutput].InitAsUnorderedAccessView(1);\t// Decompressed data buffer (UAV output)\n```\n## Sample\n\nSource code of a sample demostrating the usage of Brotli-G APIs is provided in the `sample` directory.`Build.bat` builds the sample by default. \n\nSample build output `bin\\Release\\brotlig.exe`. \n\nUsing the sample:\n* BrotliG cpu compression:    `brotlig.exe \u003cfilepath\u003e`\n* BrotliG cpu deccompression: `brotlig.exe \u003cfilepath\u003e.brotlig`\n* BrotliG gpu decompression:  `brotlig.exe -gpu \u003cfilepath\u003e.brotlig`\n* Help:                       `brotlig.exe` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpuopen-librariesandsdks%2Fbrotli_g_sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpuopen-librariesandsdks%2Fbrotli_g_sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpuopen-librariesandsdks%2Fbrotli_g_sdk/lists"}