{"id":20556108,"url":"https://github.com/irrational-encoding-wizardry/adaptivegrain","last_synced_at":"2025-04-14T13:07:08.215Z","repository":{"id":79365430,"uuid":"531087672","full_name":"Irrational-Encoding-Wizardry/adaptivegrain","owner":"Irrational-Encoding-Wizardry","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-31T13:04:41.000Z","size":3405,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T02:11:40.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Irrational-Encoding-Wizardry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-08-31T13:04:23.000Z","updated_at":"2023-05-03T07:48:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5417712-8814-4a6e-8869-1e6d923436a7","html_url":"https://github.com/Irrational-Encoding-Wizardry/adaptivegrain","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Irrational-Encoding-Wizardry%2Fadaptivegrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Irrational-Encoding-Wizardry%2Fadaptivegrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Irrational-Encoding-Wizardry%2Fadaptivegrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Irrational-Encoding-Wizardry%2Fadaptivegrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Irrational-Encoding-Wizardry","download_url":"https://codeload.github.com/Irrational-Encoding-Wizardry/adaptivegrain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886314,"owners_count":21177643,"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","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":[],"created_at":"2024-11-16T03:24:46.087Z","updated_at":"2025-04-14T13:07:07.888Z","avatar_url":"https://github.com/Irrational-Encoding-Wizardry.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adaptivegrain-rs\nReimplementation of the adaptive\\_grain mask as a Vapoursynth plugin.\nFor a description of the math and the general idea,\nsee [the article](https://kageru.moe/blog/article/adaptivegrain/).\n\n## Usage\n```py\ncore.adg.Mask(clip, luma_scaling: float)\n```\n\nYou must call `std.PlaneStats()` before this plugin\n  (or fill the PlaneStatsAverage frame property using some other method).\nSupported formats are YUV with 8-32 bit precision integer or single precision float.\nHalf precision float input is not supported since no one seems to be using that anyway.\nSince the output is grey and only luma is processed,\n  the subsampling of the input does not matter.\n\nTo replicate the original behaviour of adaptivegrain, a wrapper is provided in kagefunc.\nIt behaves exactly like the original implementation\n  (except for the performance, which is about 3x faster on my machine).\n\n### Parameters\n```\nclip: vapoursynth.VideoNode\n```\nthe input clip to generate a mask for.\n\n```py\nluma_scaling: float = 10.0\n```\nthe luma\\_scaling factor as described in the blog post.\nLower values will make the mask brighter overall.\n\n## Build instructions\nIf you’re on Arch Linux,\n  there’s an [AUR package](https://aur.archlinux.org/packages/vapoursynth-plugin-adaptivegrain-git/) for this plugin.\nOtherwise you’ll have to build and install the package manually.\n```sh\ncargo build --release\n```\nThat’s it. This is Rust, after all.\nNo idea what the minimum version is,\n   but it works with stable rust 1.41.\n   That’s all I know.\nBinaries for Windows and Linux are in the release tab.\n\n## FAQ\n**What’s the no-fma dll? Which one do I need?**\n\nThere are two Windows builds of the plugin, one for CPUs that support\n   [FMA instructions](https://en.wikipedia.org/wiki/FMA_instruction_set) and one for those that don’t.  \nIf your CPU is a Haswell (for Intel) or Piledriver (for AMD) or newer,\n   you can use the regular version (which is about 20% faster).\nOtherwise, grab no-fma.  \nThe Linux build uses fma instructions.\nI trust that if you’re a Linux user on older hardware,\n  you know how to compile your own binaries.\n\n**Why do I have to call std.PlaneStats() manually?**\n\n~~Because I didn’t want to reimplement it. `kagefunc.adaptive_grain(clip, show_mask=True)` does that for you and then just returns the mask.~~\nBecause I was too dumb to realize [this](http://www.vapoursynth.com/doc/api/vapoursynth.h.html#invoke) exists.\nI’ll fix that at some point.™\n\n**Why doesn’t this also add grain?**\n\nI was going to do that originally,\n  but I didn’t want to reimplement grain\n  when we already have a working grain filter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firrational-encoding-wizardry%2Fadaptivegrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firrational-encoding-wizardry%2Fadaptivegrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firrational-encoding-wizardry%2Fadaptivegrain/lists"}