{"id":20256568,"url":"https://github.com/interdigitalinc/versatilefilmgrain","last_synced_at":"2025-04-11T00:22:18.521Z","repository":{"id":104788958,"uuid":"494147059","full_name":"InterDigitalInc/VersatileFilmGrain","owner":"InterDigitalInc","description":"Software model of hardware-friendly film grain synthesis, supporting MPEG FGC SEI and AOM/AV1 parameters","archived":false,"fork":false,"pushed_at":"2024-04-15T08:51:40.000Z","size":158,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-24T12:48:38.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InterDigitalInc.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-05-19T16:24:20.000Z","updated_at":"2024-04-10T14:11:43.000Z","dependencies_parsed_at":"2023-05-29T21:30:29.025Z","dependency_job_id":"6bc6ddb1-adf8-443c-a0f8-99b27b313850","html_url":"https://github.com/InterDigitalInc/VersatileFilmGrain","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterDigitalInc%2FVersatileFilmGrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterDigitalInc%2FVersatileFilmGrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterDigitalInc%2FVersatileFilmGrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterDigitalInc%2FVersatileFilmGrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InterDigitalInc","download_url":"https://codeload.github.com/InterDigitalInc/VersatileFilmGrain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248318929,"owners_count":21083751,"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-14T10:47:14.990Z","updated_at":"2025-04-11T00:22:18.512Z","avatar_url":"https://github.com/InterDigitalInc.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Table of contents:\n1. [ VFGS - Versatile film grain synthesis ](#vfgs)\n2. [ FGC designer ](#fgc-designer)\n\n\u003ca name=\"vfgs\"\u003e\u003c/a\u003e\n# VFGS - Versatile film grain synthesis\n\nSoftware model of hardware-friendly film grain synthesis, supporting FGC SEI message and AOM-registered ITU-T T35 metadata (also called AFGS1).\n\nThis software implements a film grain synthesis method that supports both frequency-filtering and auto-regressive modes of the FGC SEI message, as well as AFGS1 metadata (an other auto-regressive model), while reducing hardware implementation costs compared to SMPTE RDD-5 by doing a sample-based local adaptation, rather than based on a local 8x8 average (which requires line buffers).\n\nThe intent is to provide a \"one for all\" solution, using a single hardware module while supporting different grain models. \n\nDetails of design considerations regarding film grain synthesis can be found in [JVET-AC2020](https://jvet-experts.org/doc_end_user/current_document.php?id=12577) (committee draft of ISO 23007-2 technical report), section 8.\n\nCompared to FGC SEI message, AFGS1 specification supports a larger number of AR coefficients, but does not support local adapation of grain size/shape; it can also specify a chroma grain strength local adaptation from a color mix, which is not implemented in this software.\n\nThis software is designed as a model for hardware designers; it uses the C language, and is organized in separate layers:\n* the hardware layer (in vfgs_hw.c), which performs the actual grain synthesis process, based on grain patterns memory, local adaptation LUTs, and a few other parameters. This is the piece that is potentially implemented in hardware.\n* the firmware layer (in vfgs_fw.c), that converts input model parameters (e.g. FGC SEI) to hardware configuration. This part can be easily modified to adapt to other grain metadata formats, to generate grain patterns in a different way, etc.\n* the outer layer, made of the main program and YUV I/O routines.\n\n## Usage\n\nThis programs takes an input YUV video and a configuration file, and generates an output YUV video.\n\nThe configuration file reflects the contents of an FGC SEI message, and follows the same syntax as in the [VTM](https://vcgit.hhi.fraunhofer.de/jvet/VVCSoftware_VTM); for AFGS1 metadata, a similar syntax is used. Test configuration files can be found in the cfg/ subfolder. A default FGC SEI configuration is used if none is provided.\n\nAn SEI text dump as output by the VTM or HM can also be ingested instead of a configuration file, an example of which is also found in the cfg/ subfolder. Only the first FGC SEI found in the dump is retained. For AFGS1, the .tbl format used in AOM reference software is also supported, but taking only the first configuration found (an example is  provided in the cfg/ subfolder).\n\nWhen the `--gain` option is used, new valid grain parameters are computed internally before further processing.\n\nFull help is provided when typing `vfgs --help`, with default option values indicated in angle brackets [ ]:\n\n```bash\nUsage: vfgs [options] \u003cinput.yuv\u003e \u003coutput.yuv\u003e\n\n   -w,--width    \u003cvalue\u003e           Picture width [1920]\n   -h,--height   \u003cvalue\u003e           Picture height [1080]\n   -b,--bitdepth \u003cvalue\u003e           Input bit depth [10]\n      --outdepth \u003cvalue\u003e           Output bit depth (\u003c= input depth) [same as input]\n   -f,--format   \u003cvalue\u003e           Chroma format (420/422/444) [420]\n   -n,--frames   \u003cvalue\u003e           Number of frames to process (0=all) [0]\n   -s,--seek     \u003cvalue\u003e           Picture start index within input file [0]\n   -r,--seed     \u003cvalue\u003e           Random seed (non-zero 31-bits number)\n   -c,--cfg      [\u003cx\u003e:]\u003cfilename\u003e  Read film grain configuration file, to be applied\n                                   from frame x (defaults to 0). Multiple -c are allowed.\n   -g,--gain     \u003cvalue\u003e           Apply a global scale (in percent) to grain strength\n   --help                          Display this page\n````\n\n## Compilation\n\nCompilation is performed either using `cmake` or typing `gcc src/*.c -o vfgs.exe -mavx2` (adapt -mXXX to your machine)\n\n## Contributing\n\nPlease use fork and pull requests. Examples of welcome contributions:\n- SIMD and GPU acceleration (HW layer)\n- HDL code / HW design (HW layer)\n- Further improved FGC SEI message support (FW layer)\n\n## License\n\nA BSD 3-clause-clear license is applicable. See the [LICENSE](LICENSE) file.\n\n\u003ca name=\"fgc-designer\"\u003e\u003c/a\u003e\n# FGC designer\nA python script called fgc-designer.py is present at the root of the repository. This is a graphical interactive tool that can be used to display and adjust film grain parameters.\n\nAfter loading an FGC configuration file (currently, only FGC SEI in frequency-filtering mode is supported), and selecting the color component, the mouse can be used to adjust intensity interval boundaries, gain and frequency cutoffs (just click and drag). An interval is removed by making it zero-length, and is split by double-clicking.\n\nExternal dependencies are matplotlib and numpy.\n\n## License\n\nA BSD 3-clause-clear license is applicable. See the [LICENSE](LICENSE) file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterdigitalinc%2Fversatilefilmgrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterdigitalinc%2Fversatilefilmgrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterdigitalinc%2Fversatilefilmgrain/lists"}