vsfgs 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. vsfgs-0.5.0/.gitattributes +2 -0
  2. vsfgs-0.5.0/.github/workflows/build-wheels.yml +99 -0
  3. vsfgs-0.5.0/.gitignore +47 -0
  4. vsfgs-0.5.0/LICENSE +21 -0
  5. vsfgs-0.5.0/PKG-INFO +131 -0
  6. vsfgs-0.5.0/README.md +103 -0
  7. vsfgs-0.5.0/include/VSHelper4.h +217 -0
  8. vsfgs-0.5.0/include/VapourSynth4.h +545 -0
  9. vsfgs-0.5.0/meson.build +30 -0
  10. vsfgs-0.5.0/pyproject.toml +43 -0
  11. vsfgs-0.5.0/src/cherry_seeds.h +142 -0
  12. vsfgs-0.5.0/src/vs_fgs.cpp +181 -0
  13. vsfgs-0.5.0/static_fgs_test.txt +9 -0
  14. vsfgs-0.5.0/subprojects/.wraplock +0 -0
  15. vsfgs-0.5.0/subprojects/dav1d/.gitignore +10 -0
  16. vsfgs-0.5.0/subprojects/dav1d/.gitlab-ci.yml +933 -0
  17. vsfgs-0.5.0/subprojects/dav1d/CONTRIBUTING.md +56 -0
  18. vsfgs-0.5.0/subprojects/dav1d/COPYING +23 -0
  19. vsfgs-0.5.0/subprojects/dav1d/NEWS +478 -0
  20. vsfgs-0.5.0/subprojects/dav1d/README.md +168 -0
  21. vsfgs-0.5.0/subprojects/dav1d/THANKS.md +35 -0
  22. vsfgs-0.5.0/subprojects/dav1d/doc/Doxyfile.in.in +23 -0
  23. vsfgs-0.5.0/subprojects/dav1d/doc/PATENTS +108 -0
  24. vsfgs-0.5.0/subprojects/dav1d/doc/dav1d_logo.png +0 -0
  25. vsfgs-0.5.0/subprojects/dav1d/doc/dav1d_logo.svg +1 -0
  26. vsfgs-0.5.0/subprojects/dav1d/doc/meson.build +51 -0
  27. vsfgs-0.5.0/subprojects/dav1d/examples/dav1dplay.c +792 -0
  28. vsfgs-0.5.0/subprojects/dav1d/examples/dp_fifo.c +147 -0
  29. vsfgs-0.5.0/subprojects/dav1d/examples/dp_fifo.h +63 -0
  30. vsfgs-0.5.0/subprojects/dav1d/examples/dp_renderer.h +149 -0
  31. vsfgs-0.5.0/subprojects/dav1d/examples/dp_renderer_placebo.c +437 -0
  32. vsfgs-0.5.0/subprojects/dav1d/examples/dp_renderer_sdl.c +175 -0
  33. vsfgs-0.5.0/subprojects/dav1d/examples/meson.build +78 -0
  34. vsfgs-0.5.0/subprojects/dav1d/gcovr.cfg +4 -0
  35. vsfgs-0.5.0/subprojects/dav1d/include/common/attributes.h +213 -0
  36. vsfgs-0.5.0/subprojects/dav1d/include/common/bitdepth.h +93 -0
  37. vsfgs-0.5.0/subprojects/dav1d/include/common/dump.h +92 -0
  38. vsfgs-0.5.0/subprojects/dav1d/include/common/frame.h +45 -0
  39. vsfgs-0.5.0/subprojects/dav1d/include/common/intops.h +84 -0
  40. vsfgs-0.5.0/subprojects/dav1d/include/common/validate.h +61 -0
  41. vsfgs-0.5.0/subprojects/dav1d/include/compat/gcc/stdatomic.h +51 -0
  42. vsfgs-0.5.0/subprojects/dav1d/include/compat/getopt.h +92 -0
  43. vsfgs-0.5.0/subprojects/dav1d/include/compat/msvc/stdatomic.h +82 -0
  44. vsfgs-0.5.0/subprojects/dav1d/include/dav1d/common.h +96 -0
  45. vsfgs-0.5.0/subprojects/dav1d/include/dav1d/data.h +117 -0
  46. vsfgs-0.5.0/subprojects/dav1d/include/dav1d/dav1d.h +329 -0
  47. vsfgs-0.5.0/subprojects/dav1d/include/dav1d/headers.h +440 -0
  48. vsfgs-0.5.0/subprojects/dav1d/include/dav1d/meson.build +36 -0
  49. vsfgs-0.5.0/subprojects/dav1d/include/dav1d/picture.h +157 -0
  50. vsfgs-0.5.0/subprojects/dav1d/include/dav1d/version.h +50 -0
  51. vsfgs-0.5.0/subprojects/dav1d/include/meson.build +34 -0
  52. vsfgs-0.5.0/subprojects/dav1d/include/vcs_version.h.in +2 -0
  53. vsfgs-0.5.0/subprojects/dav1d/meson.build +618 -0
  54. vsfgs-0.5.0/subprojects/dav1d/meson_options.txt +70 -0
  55. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/aarch64-android.meson +15 -0
  56. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/aarch64-linux-clang.meson +16 -0
  57. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/aarch64-linux.meson +12 -0
  58. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/aarch64-w64-mingw32.meson +16 -0
  59. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/arm-android.meson +15 -0
  60. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/arm64-iPhoneOS.meson +27 -0
  61. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/armv7-w64-mingw32.meson +16 -0
  62. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/i686-linux32.meson +15 -0
  63. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/i686-w64-mingw32.meson +16 -0
  64. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/loongarch64-linux.meson +13 -0
  65. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/riscv64-linux-clang.meson +16 -0
  66. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/riscv64-linux.meson +12 -0
  67. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/wasm32.meson +15 -0
  68. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/wasm64.meson +15 -0
  69. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/x86-android.meson +15 -0
  70. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/x86_64-android.meson +15 -0
  71. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/x86_64-iPhoneSimulator.meson +27 -0
  72. vsfgs-0.5.0/subprojects/dav1d/package/crossfiles/x86_64-w64-mingw32.meson +16 -0
  73. vsfgs-0.5.0/subprojects/dav1d/package/snap/snapcraft.yaml +24 -0
  74. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/cdef.S +540 -0
  75. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/cdef16.S +233 -0
  76. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/cdef_tmpl.S +515 -0
  77. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/filmgrain.S +2039 -0
  78. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/filmgrain16.S +2137 -0
  79. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/ipred.S +2958 -0
  80. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/ipred16.S +3276 -0
  81. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/itx.S +3368 -0
  82. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/itx16.S +3632 -0
  83. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/loopfilter.S +868 -0
  84. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/loopfilter16.S +859 -0
  85. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/looprestoration.S +729 -0
  86. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/looprestoration16.S +757 -0
  87. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/looprestoration_common.S +216 -0
  88. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/looprestoration_tmpl.S +410 -0
  89. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/mc.S +3345 -0
  90. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/mc16.S +3658 -0
  91. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/msac.S +588 -0
  92. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/refmvs.S +303 -0
  93. vsfgs-0.5.0/subprojects/dav1d/src/arm/32/util.S +202 -0
  94. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/cdef.S +520 -0
  95. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/cdef16.S +229 -0
  96. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/cdef_tmpl.S +510 -0
  97. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/filmgrain.S +2015 -0
  98. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/filmgrain16.S +1999 -0
  99. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/ipred.S +5232 -0
  100. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/ipred16.S +5711 -0
  101. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/itx.S +3261 -0
  102. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/itx16.S +3652 -0
  103. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/loopfilter.S +1128 -0
  104. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/loopfilter16.S +924 -0
  105. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/looprestoration.S +1303 -0
  106. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/looprestoration16.S +1388 -0
  107. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/looprestoration_common.S +334 -0
  108. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/looprestoration_tmpl.S +704 -0
  109. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/mc.S +3574 -0
  110. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/mc16.S +3833 -0
  111. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/mc16_sve.S +1649 -0
  112. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/mc_dotprod.S +1880 -0
  113. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/msac.S +595 -0
  114. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/refmvs.S +545 -0
  115. vsfgs-0.5.0/subprojects/dav1d/src/arm/64/util.S +295 -0
  116. vsfgs-0.5.0/subprojects/dav1d/src/arm/arm-arch.h +68 -0
  117. vsfgs-0.5.0/subprojects/dav1d/src/arm/asm-offsets.h +58 -0
  118. vsfgs-0.5.0/subprojects/dav1d/src/arm/asm.S +367 -0
  119. vsfgs-0.5.0/subprojects/dav1d/src/arm/cdef.h +88 -0
  120. vsfgs-0.5.0/subprojects/dav1d/src/arm/cpu.c +218 -0
  121. vsfgs-0.5.0/subprojects/dav1d/src/arm/cpu.h +41 -0
  122. vsfgs-0.5.0/subprojects/dav1d/src/arm/filmgrain.h +204 -0
  123. vsfgs-0.5.0/subprojects/dav1d/src/arm/ipred.h +326 -0
  124. vsfgs-0.5.0/subprojects/dav1d/src/arm/itx.h +83 -0
  125. vsfgs-0.5.0/subprojects/dav1d/src/arm/loopfilter.h +45 -0
  126. vsfgs-0.5.0/subprojects/dav1d/src/arm/looprestoration.h +1131 -0
  127. vsfgs-0.5.0/subprojects/dav1d/src/arm/mc.h +107 -0
  128. vsfgs-0.5.0/subprojects/dav1d/src/arm/msac.h +52 -0
  129. vsfgs-0.5.0/subprojects/dav1d/src/arm/refmvs.h +59 -0
  130. vsfgs-0.5.0/subprojects/dav1d/src/cdef.h +71 -0
  131. vsfgs-0.5.0/subprojects/dav1d/src/cdef_apply.h +39 -0
  132. vsfgs-0.5.0/subprojects/dav1d/src/cdef_apply_tmpl.c +308 -0
  133. vsfgs-0.5.0/subprojects/dav1d/src/cdef_tmpl.c +340 -0
  134. vsfgs-0.5.0/subprojects/dav1d/src/cdf.c +4065 -0
  135. vsfgs-0.5.0/subprojects/dav1d/src/cdf.h +154 -0
  136. vsfgs-0.5.0/subprojects/dav1d/src/cpu.c +129 -0
  137. vsfgs-0.5.0/subprojects/dav1d/src/cpu.h +136 -0
  138. vsfgs-0.5.0/subprojects/dav1d/src/ctx.c +65 -0
  139. vsfgs-0.5.0/subprojects/dav1d/src/ctx.h +89 -0
  140. vsfgs-0.5.0/subprojects/dav1d/src/data.c +149 -0
  141. vsfgs-0.5.0/subprojects/dav1d/src/data.h +56 -0
  142. vsfgs-0.5.0/subprojects/dav1d/src/dav1d.rc.in +32 -0
  143. vsfgs-0.5.0/subprojects/dav1d/src/decode.c +3749 -0
  144. vsfgs-0.5.0/subprojects/dav1d/src/decode.h +35 -0
  145. vsfgs-0.5.0/subprojects/dav1d/src/dequant_tables.c +229 -0
  146. vsfgs-0.5.0/subprojects/dav1d/src/dequant_tables.h +37 -0
  147. vsfgs-0.5.0/subprojects/dav1d/src/env.h +520 -0
  148. vsfgs-0.5.0/subprojects/dav1d/src/ext/x86/x86inc.asm +2005 -0
  149. vsfgs-0.5.0/subprojects/dav1d/src/fg_apply.h +58 -0
  150. vsfgs-0.5.0/subprojects/dav1d/src/fg_apply_tmpl.c +241 -0
  151. vsfgs-0.5.0/subprojects/dav1d/src/filmgrain.h +84 -0
  152. vsfgs-0.5.0/subprojects/dav1d/src/filmgrain_tmpl.c +445 -0
  153. vsfgs-0.5.0/subprojects/dav1d/src/getbits.c +164 -0
  154. vsfgs-0.5.0/subprojects/dav1d/src/getbits.h +71 -0
  155. vsfgs-0.5.0/subprojects/dav1d/src/internal.h +471 -0
  156. vsfgs-0.5.0/subprojects/dav1d/src/intra_edge.c +148 -0
  157. vsfgs-0.5.0/subprojects/dav1d/src/intra_edge.h +73 -0
  158. vsfgs-0.5.0/subprojects/dav1d/src/ipred.h +94 -0
  159. vsfgs-0.5.0/subprojects/dav1d/src/ipred_prepare.h +108 -0
  160. vsfgs-0.5.0/subprojects/dav1d/src/ipred_prepare_tmpl.c +204 -0
  161. vsfgs-0.5.0/subprojects/dav1d/src/ipred_tmpl.c +782 -0
  162. vsfgs-0.5.0/subprojects/dav1d/src/itx.h +111 -0
  163. vsfgs-0.5.0/subprojects/dav1d/src/itx_1d.c +1082 -0
  164. vsfgs-0.5.0/subprojects/dav1d/src/itx_1d.h +53 -0
  165. vsfgs-0.5.0/subprojects/dav1d/src/itx_tmpl.c +311 -0
  166. vsfgs-0.5.0/subprojects/dav1d/src/levels.h +289 -0
  167. vsfgs-0.5.0/subprojects/dav1d/src/lf_apply.h +48 -0
  168. vsfgs-0.5.0/subprojects/dav1d/src/lf_apply_tmpl.c +466 -0
  169. vsfgs-0.5.0/subprojects/dav1d/src/lf_mask.c +468 -0
  170. vsfgs-0.5.0/subprojects/dav1d/src/lf_mask.h +83 -0
  171. vsfgs-0.5.0/subprojects/dav1d/src/lib.c +762 -0
  172. vsfgs-0.5.0/subprojects/dav1d/src/log.c +57 -0
  173. vsfgs-0.5.0/subprojects/dav1d/src/log.h +47 -0
  174. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/cdef.S +2249 -0
  175. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/cdef.h +53 -0
  176. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/cpu.c +49 -0
  177. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/cpu.h +37 -0
  178. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/ipred.S +4260 -0
  179. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/ipred.h +96 -0
  180. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/itx.S +4781 -0
  181. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/itx.h +119 -0
  182. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/loongson_asm.S +777 -0
  183. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/loongson_util.S +192 -0
  184. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/loopfilter.S +1215 -0
  185. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/loopfilter.h +52 -0
  186. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/looprestoration.S +1956 -0
  187. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/looprestoration.h +107 -0
  188. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/looprestoration_inner.c +338 -0
  189. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/mc.S +6145 -0
  190. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/mc.h +96 -0
  191. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/msac.S +612 -0
  192. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/msac.h +50 -0
  193. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/refmvs.S +701 -0
  194. vsfgs-0.5.0/subprojects/dav1d/src/loongarch/refmvs.h +48 -0
  195. vsfgs-0.5.0/subprojects/dav1d/src/loopfilter.h +57 -0
  196. vsfgs-0.5.0/subprojects/dav1d/src/loopfilter_tmpl.c +276 -0
  197. vsfgs-0.5.0/subprojects/dav1d/src/looprestoration.h +79 -0
  198. vsfgs-0.5.0/subprojects/dav1d/src/looprestoration_tmpl.c +1384 -0
  199. vsfgs-0.5.0/subprojects/dav1d/src/lr_apply.h +47 -0
  200. vsfgs-0.5.0/subprojects/dav1d/src/lr_apply_tmpl.c +204 -0
  201. vsfgs-0.5.0/subprojects/dav1d/src/mc.h +166 -0
  202. vsfgs-0.5.0/subprojects/dav1d/src/mc_tmpl.c +1006 -0
  203. vsfgs-0.5.0/subprojects/dav1d/src/mem.c +311 -0
  204. vsfgs-0.5.0/subprojects/dav1d/src/mem.h +152 -0
  205. vsfgs-0.5.0/subprojects/dav1d/src/meson.build +410 -0
  206. vsfgs-0.5.0/subprojects/dav1d/src/msac.c +220 -0
  207. vsfgs-0.5.0/subprojects/dav1d/src/msac.h +110 -0
  208. vsfgs-0.5.0/subprojects/dav1d/src/obu.c +1695 -0
  209. vsfgs-0.5.0/subprojects/dav1d/src/obu.h +36 -0
  210. vsfgs-0.5.0/subprojects/dav1d/src/pal.c +81 -0
  211. vsfgs-0.5.0/subprojects/dav1d/src/pal.h +43 -0
  212. vsfgs-0.5.0/subprojects/dav1d/src/picture.c +333 -0
  213. vsfgs-0.5.0/subprojects/dav1d/src/picture.h +122 -0
  214. vsfgs-0.5.0/subprojects/dav1d/src/ppc/cdef.h +61 -0
  215. vsfgs-0.5.0/subprojects/dav1d/src/ppc/cdef_tmpl.c +636 -0
  216. vsfgs-0.5.0/subprojects/dav1d/src/ppc/cpu.c +49 -0
  217. vsfgs-0.5.0/subprojects/dav1d/src/ppc/cpu.h +38 -0
  218. vsfgs-0.5.0/subprojects/dav1d/src/ppc/dav1d_types.h +58 -0
  219. vsfgs-0.5.0/subprojects/dav1d/src/ppc/itx.h +65 -0
  220. vsfgs-0.5.0/subprojects/dav1d/src/ppc/itx_tmpl.c +2006 -0
  221. vsfgs-0.5.0/subprojects/dav1d/src/ppc/loopfilter.h +47 -0
  222. vsfgs-0.5.0/subprojects/dav1d/src/ppc/loopfilter_tmpl.c +1690 -0
  223. vsfgs-0.5.0/subprojects/dav1d/src/ppc/looprestoration.h +48 -0
  224. vsfgs-0.5.0/subprojects/dav1d/src/ppc/looprestoration_tmpl.c +321 -0
  225. vsfgs-0.5.0/subprojects/dav1d/src/ppc/mc.h +46 -0
  226. vsfgs-0.5.0/subprojects/dav1d/src/ppc/mc_tmpl.c +554 -0
  227. vsfgs-0.5.0/subprojects/dav1d/src/ppc/utils.h +105 -0
  228. vsfgs-0.5.0/subprojects/dav1d/src/qm.c +4715 -0
  229. vsfgs-0.5.0/subprojects/dav1d/src/qm.h +37 -0
  230. vsfgs-0.5.0/subprojects/dav1d/src/recon.h +106 -0
  231. vsfgs-0.5.0/subprojects/dav1d/src/recon_tmpl.c +2310 -0
  232. vsfgs-0.5.0/subprojects/dav1d/src/ref.c +85 -0
  233. vsfgs-0.5.0/subprojects/dav1d/src/ref.h +77 -0
  234. vsfgs-0.5.0/subprojects/dav1d/src/refmvs.c +940 -0
  235. vsfgs-0.5.0/subprojects/dav1d/src/refmvs.h +178 -0
  236. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/cdef.S +703 -0
  237. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/cdef16.S +689 -0
  238. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/cpu.S +49 -0
  239. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/filmgrain.S +250 -0
  240. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/filmgrain16.S +266 -0
  241. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/ipred.S +682 -0
  242. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/ipred16.S +620 -0
  243. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/itx.S +2073 -0
  244. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/mc.S +1579 -0
  245. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/mc16.S +135 -0
  246. vsfgs-0.5.0/subprojects/dav1d/src/riscv/64/pal.S +95 -0
  247. vsfgs-0.5.0/subprojects/dav1d/src/riscv/asm-offsets.h +44 -0
  248. vsfgs-0.5.0/subprojects/dav1d/src/riscv/asm.S +151 -0
  249. vsfgs-0.5.0/subprojects/dav1d/src/riscv/cdef.h +16 -0
  250. vsfgs-0.5.0/subprojects/dav1d/src/riscv/cpu.c +50 -0
  251. vsfgs-0.5.0/subprojects/dav1d/src/riscv/cpu.h +41 -0
  252. vsfgs-0.5.0/subprojects/dav1d/src/riscv/filmgrain.h +48 -0
  253. vsfgs-0.5.0/subprojects/dav1d/src/riscv/ipred.h +88 -0
  254. vsfgs-0.5.0/subprojects/dav1d/src/riscv/itx.h +60 -0
  255. vsfgs-0.5.0/subprojects/dav1d/src/riscv/mc.h +111 -0
  256. vsfgs-0.5.0/subprojects/dav1d/src/riscv/pal.h +39 -0
  257. vsfgs-0.5.0/subprojects/dav1d/src/scan.c +375 -0
  258. vsfgs-0.5.0/subprojects/dav1d/src/scan.h +40 -0
  259. vsfgs-0.5.0/subprojects/dav1d/src/tables.c +1020 -0
  260. vsfgs-0.5.0/subprojects/dav1d/src/tables.h +125 -0
  261. vsfgs-0.5.0/subprojects/dav1d/src/thread.h +196 -0
  262. vsfgs-0.5.0/subprojects/dav1d/src/thread_data.h +40 -0
  263. vsfgs-0.5.0/subprojects/dav1d/src/thread_task.c +919 -0
  264. vsfgs-0.5.0/subprojects/dav1d/src/thread_task.h +53 -0
  265. vsfgs-0.5.0/subprojects/dav1d/src/warpmv.c +209 -0
  266. vsfgs-0.5.0/subprojects/dav1d/src/warpmv.h +39 -0
  267. vsfgs-0.5.0/subprojects/dav1d/src/wedge.c +299 -0
  268. vsfgs-0.5.0/subprojects/dav1d/src/wedge.h +96 -0
  269. vsfgs-0.5.0/subprojects/dav1d/src/win32/thread.c +99 -0
  270. vsfgs-0.5.0/subprojects/dav1d/src/x86/cdef.h +87 -0
  271. vsfgs-0.5.0/subprojects/dav1d/src/x86/cdef16_avx2.asm +877 -0
  272. vsfgs-0.5.0/subprojects/dav1d/src/x86/cdef16_avx512.asm +622 -0
  273. vsfgs-0.5.0/subprojects/dav1d/src/x86/cdef16_sse.asm +1033 -0
  274. vsfgs-0.5.0/subprojects/dav1d/src/x86/cdef_avx2.asm +1771 -0
  275. vsfgs-0.5.0/subprojects/dav1d/src/x86/cdef_avx512.asm +860 -0
  276. vsfgs-0.5.0/subprojects/dav1d/src/x86/cdef_sse.asm +1357 -0
  277. vsfgs-0.5.0/subprojects/dav1d/src/x86/cpu.c +98 -0
  278. vsfgs-0.5.0/subprojects/dav1d/src/x86/cpu.h +44 -0
  279. vsfgs-0.5.0/subprojects/dav1d/src/x86/cpuid.asm +55 -0
  280. vsfgs-0.5.0/subprojects/dav1d/src/x86/filmgrain.h +83 -0
  281. vsfgs-0.5.0/subprojects/dav1d/src/x86/filmgrain16_avx2.asm +2229 -0
  282. vsfgs-0.5.0/subprojects/dav1d/src/x86/filmgrain16_avx512.asm +930 -0
  283. vsfgs-0.5.0/subprojects/dav1d/src/x86/filmgrain16_sse.asm +3415 -0
  284. vsfgs-0.5.0/subprojects/dav1d/src/x86/filmgrain_avx2.asm +2092 -0
  285. vsfgs-0.5.0/subprojects/dav1d/src/x86/filmgrain_avx512.asm +813 -0
  286. vsfgs-0.5.0/subprojects/dav1d/src/x86/filmgrain_common.asm +46 -0
  287. vsfgs-0.5.0/subprojects/dav1d/src/x86/filmgrain_sse.asm +3223 -0
  288. vsfgs-0.5.0/subprojects/dav1d/src/x86/ipred.h +153 -0
  289. vsfgs-0.5.0/subprojects/dav1d/src/x86/ipred16_avx2.asm +4987 -0
  290. vsfgs-0.5.0/subprojects/dav1d/src/x86/ipred16_avx512.asm +2659 -0
  291. vsfgs-0.5.0/subprojects/dav1d/src/x86/ipred16_sse.asm +4103 -0
  292. vsfgs-0.5.0/subprojects/dav1d/src/x86/ipred_avx2.asm +5362 -0
  293. vsfgs-0.5.0/subprojects/dav1d/src/x86/ipred_avx512.asm +3143 -0
  294. vsfgs-0.5.0/subprojects/dav1d/src/x86/ipred_sse.asm +5402 -0
  295. vsfgs-0.5.0/subprojects/dav1d/src/x86/itx.h +307 -0
  296. vsfgs-0.5.0/subprojects/dav1d/src/x86/itx16_avx2.asm +8599 -0
  297. vsfgs-0.5.0/subprojects/dav1d/src/x86/itx16_avx512.asm +6056 -0
  298. vsfgs-0.5.0/subprojects/dav1d/src/x86/itx16_sse.asm +8135 -0
  299. vsfgs-0.5.0/subprojects/dav1d/src/x86/itx_avx2.asm +5542 -0
  300. vsfgs-0.5.0/subprojects/dav1d/src/x86/itx_avx512.asm +7507 -0
  301. vsfgs-0.5.0/subprojects/dav1d/src/x86/itx_sse.asm +6533 -0
  302. vsfgs-0.5.0/subprojects/dav1d/src/x86/loopfilter.h +69 -0
  303. vsfgs-0.5.0/subprojects/dav1d/src/x86/loopfilter16_avx2.asm +1161 -0
  304. vsfgs-0.5.0/subprojects/dav1d/src/x86/loopfilter16_avx512.asm +912 -0
  305. vsfgs-0.5.0/subprojects/dav1d/src/x86/loopfilter16_sse.asm +1793 -0
  306. vsfgs-0.5.0/subprojects/dav1d/src/x86/loopfilter_avx2.asm +1569 -0
  307. vsfgs-0.5.0/subprojects/dav1d/src/x86/loopfilter_avx512.asm +1529 -0
  308. vsfgs-0.5.0/subprojects/dav1d/src/x86/loopfilter_sse.asm +2348 -0
  309. vsfgs-0.5.0/subprojects/dav1d/src/x86/looprestoration.h +94 -0
  310. vsfgs-0.5.0/subprojects/dav1d/src/x86/looprestoration16_avx2.asm +2689 -0
  311. vsfgs-0.5.0/subprojects/dav1d/src/x86/looprestoration16_avx512.asm +2524 -0
  312. vsfgs-0.5.0/subprojects/dav1d/src/x86/looprestoration16_sse.asm +3467 -0
  313. vsfgs-0.5.0/subprojects/dav1d/src/x86/looprestoration_avx2.asm +2339 -0
  314. vsfgs-0.5.0/subprojects/dav1d/src/x86/looprestoration_avx512.asm +2122 -0
  315. vsfgs-0.5.0/subprojects/dav1d/src/x86/looprestoration_sse.asm +3502 -0
  316. vsfgs-0.5.0/subprojects/dav1d/src/x86/mc.h +216 -0
  317. vsfgs-0.5.0/subprojects/dav1d/src/x86/mc16_avx2.asm +6793 -0
  318. vsfgs-0.5.0/subprojects/dav1d/src/x86/mc16_avx512.asm +6119 -0
  319. vsfgs-0.5.0/subprojects/dav1d/src/x86/mc16_sse.asm +10109 -0
  320. vsfgs-0.5.0/subprojects/dav1d/src/x86/mc_avx2.asm +6563 -0
  321. vsfgs-0.5.0/subprojects/dav1d/src/x86/mc_avx512.asm +5524 -0
  322. vsfgs-0.5.0/subprojects/dav1d/src/x86/mc_sse.asm +10144 -0
  323. vsfgs-0.5.0/subprojects/dav1d/src/x86/msac.asm +671 -0
  324. vsfgs-0.5.0/subprojects/dav1d/src/x86/msac.h +75 -0
  325. vsfgs-0.5.0/subprojects/dav1d/src/x86/pal.asm +641 -0
  326. vsfgs-0.5.0/subprojects/dav1d/src/x86/pal.h +50 -0
  327. vsfgs-0.5.0/subprojects/dav1d/src/x86/refmvs.asm +935 -0
  328. vsfgs-0.5.0/subprojects/dav1d/src/x86/refmvs.h +66 -0
  329. vsfgs-0.5.0/subprojects/dav1d/subprojects/checkasm.wrap +4 -0
  330. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/cdef.c +144 -0
  331. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/checkasm.c +113 -0
  332. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/filmgrain.c +401 -0
  333. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/internal.h +66 -0
  334. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/ipred.c +306 -0
  335. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/itx.c +328 -0
  336. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/loopfilter.c +203 -0
  337. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/looprestoration.c +214 -0
  338. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/mc.c +792 -0
  339. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/msac.c +311 -0
  340. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/pal.c +72 -0
  341. vsfgs-0.5.0/subprojects/dav1d/tests/checkasm/refmvs.c +353 -0
  342. vsfgs-0.5.0/subprojects/dav1d/tests/dav1d_argon.bash +196 -0
  343. vsfgs-0.5.0/subprojects/dav1d/tests/header_test.c +33 -0
  344. vsfgs-0.5.0/subprojects/dav1d/tests/libfuzzer/alloc_fail.c +102 -0
  345. vsfgs-0.5.0/subprojects/dav1d/tests/libfuzzer/alloc_fail.h +35 -0
  346. vsfgs-0.5.0/subprojects/dav1d/tests/libfuzzer/dav1d_fuzzer.c +199 -0
  347. vsfgs-0.5.0/subprojects/dav1d/tests/libfuzzer/dav1d_fuzzer.h +37 -0
  348. vsfgs-0.5.0/subprojects/dav1d/tests/libfuzzer/main.c +100 -0
  349. vsfgs-0.5.0/subprojects/dav1d/tests/libfuzzer/meson.build +101 -0
  350. vsfgs-0.5.0/subprojects/dav1d/tests/meson.build +146 -0
  351. vsfgs-0.5.0/subprojects/dav1d/tests/seek_stress.c +243 -0
  352. vsfgs-0.5.0/subprojects/dav1d/tools/compat/getopt.c +556 -0
  353. vsfgs-0.5.0/subprojects/dav1d/tools/dav1d.c +393 -0
  354. vsfgs-0.5.0/subprojects/dav1d/tools/dav1d.manifest +10 -0
  355. vsfgs-0.5.0/subprojects/dav1d/tools/dav1d.rc.in +33 -0
  356. vsfgs-0.5.0/subprojects/dav1d/tools/dav1d_cli_parse.c +471 -0
  357. vsfgs-0.5.0/subprojects/dav1d/tools/dav1d_cli_parse.h +55 -0
  358. vsfgs-0.5.0/subprojects/dav1d/tools/input/annexb.c +196 -0
  359. vsfgs-0.5.0/subprojects/dav1d/tools/input/demuxer.h +46 -0
  360. vsfgs-0.5.0/subprojects/dav1d/tools/input/input.c +140 -0
  361. vsfgs-0.5.0/subprojects/dav1d/tools/input/input.h +42 -0
  362. vsfgs-0.5.0/subprojects/dav1d/tools/input/ivf.c +209 -0
  363. vsfgs-0.5.0/subprojects/dav1d/tools/input/parse.h +111 -0
  364. vsfgs-0.5.0/subprojects/dav1d/tools/input/section5.c +188 -0
  365. vsfgs-0.5.0/subprojects/dav1d/tools/meson.build +121 -0
  366. vsfgs-0.5.0/subprojects/dav1d/tools/output/md5.c +314 -0
  367. vsfgs-0.5.0/subprojects/dav1d/tools/output/muxer.h +52 -0
  368. vsfgs-0.5.0/subprojects/dav1d/tools/output/null.c +44 -0
  369. vsfgs-0.5.0/subprojects/dav1d/tools/output/output.c +261 -0
  370. vsfgs-0.5.0/subprojects/dav1d/tools/output/output.h +48 -0
  371. vsfgs-0.5.0/subprojects/dav1d/tools/output/xxhash.c +142 -0
  372. vsfgs-0.5.0/subprojects/dav1d/tools/output/y4m2.c +150 -0
  373. vsfgs-0.5.0/subprojects/dav1d/tools/output/yuv.c +103 -0
  374. vsfgs-0.5.0/vsfgs/__init__.py +246 -0
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,99 @@
1
+ name: Build and Publish Wheels
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ release:
9
+ types:
10
+ - published
11
+
12
+ jobs:
13
+ build_wheels:
14
+ name: Build wheels on ${{ matrix.os }}
15
+ runs-on: ${{ matrix.os }}
16
+ strategy:
17
+ matrix:
18
+ include:
19
+ - os: ubuntu-latest
20
+ arch: x86_64
21
+ - os: ubuntu-24.04-arm
22
+ arch: aarch64
23
+ - os: windows-latest
24
+ arch: AMD64
25
+ - os: macos-latest
26
+ arch: "x86_64 arm64"
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ submodules: recursive
32
+
33
+ - name: Build wheels
34
+ uses: pypa/cibuildwheel@v4.1.0
35
+ env:
36
+ CIBW_ARCHS: ${{ matrix.arch }}
37
+ CIBW_BEFORE_ALL_LINUX: "if command -v apk; then apk add nasm; elif command -v dnf; then dnf install -y nasm; elif command -v yum; then yum install -y nasm; else apt-get update && apt-get install -y nasm; fi"
38
+ CIBW_BEFORE_ALL_WINDOWS: "choco install nasm"
39
+ CIBW_BEFORE_ALL_MACOS: "export HOMEBREW_NO_AUTO_UPDATE=1; export HOMEBREW_NO_REQUIRE_TAP_TRUST=1; brew install nasm"
40
+ CIBW_SKIP: "cp39-* cp310-* cp311-* cp312-* *t-*"
41
+ CIBW_TEST_COMMAND: "python -c \"import vsfgs\""
42
+ CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *-win_arm64 *-macosx_arm64"
43
+
44
+ - name: Upload wheels as artifact
45
+ uses: actions/upload-artifact@v4
46
+ with:
47
+ name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}
48
+ path: ./wheelhouse/*.whl
49
+
50
+ build_sdist:
51
+ name: Build source distribution
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ with:
56
+ submodules: recursive
57
+
58
+ - name: Set up Python 3.13
59
+ uses: actions/setup-python@v5
60
+ with:
61
+ python-version: '3.13'
62
+
63
+ - name: Install nasm (needed by meson setup for dav1d)
64
+ run: sudo apt-get update && sudo apt-get install -y nasm
65
+
66
+ - name: Install build tool
67
+ run: python -m pip install build
68
+
69
+ - name: Build sdist
70
+ run: python -m build --sdist
71
+
72
+ - name: Upload sdist as artifact
73
+ uses: actions/upload-artifact@v4
74
+ with:
75
+ name: cibw-sdist
76
+ path: dist/*.tar.gz
77
+
78
+ publish_pypi:
79
+ name: Publish to PyPI
80
+ needs: [build_wheels, build_sdist]
81
+ if: github.event_name == 'release' && github.event.action == 'published'
82
+ runs-on: ubuntu-latest
83
+
84
+ permissions:
85
+ id-token: write
86
+ contents: read
87
+
88
+ steps:
89
+ - name: Download artifacts
90
+ uses: actions/download-artifact@v4
91
+ with:
92
+ pattern: cibw-*
93
+ path: dist
94
+ merge-multiple: true
95
+
96
+ - name: Publish package to PyPI
97
+ uses: pypa/gh-action-pypi-publish@release/v1
98
+ with:
99
+ packages-dir: dist
vsfgs-0.5.0/.gitignore ADDED
@@ -0,0 +1,47 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+
5
+ *.so
6
+ *.pyd
7
+ *.dll
8
+ *.lib
9
+ *.exp
10
+ *.obj
11
+ *.o
12
+ *.a
13
+
14
+ build/
15
+ dist/
16
+ .mesonpy-*/
17
+ *.egg-info/
18
+ .eggs/
19
+ *.egg
20
+
21
+ .venv/
22
+ venv/
23
+ ENV/
24
+ env/
25
+
26
+ .vscode/
27
+ .idea/
28
+ *.swp
29
+ *.swo
30
+ .vs/
31
+
32
+ .DS_Store
33
+
34
+ test.vpy
35
+ dynamic_fgs_test.txt
36
+ bench_tmp.vpy
37
+ bench_results.json
38
+ bench_runner.py
39
+
40
+ subprojects/*/build*/
41
+ .ninja_*
42
+ build.bat
43
+ /.vsjet
44
+ /typings
45
+ test.vpy
46
+ test.vpy
47
+ heavy_fgs.txt
vsfgs-0.5.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 vs-fgs contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
vsfgs-0.5.0/PKG-INFO ADDED
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.1
2
+ Name: vsfgs
3
+ Version: 0.5.0
4
+ Summary: A VapourSynth plugin for applying Film Grain Synthesis (FGS) using the dav1d engine.
5
+ Keywords: vapoursynth,film-grain,fgs,dav1d,video-processing,afgs1,av1,simd
6
+ Author: PingWer74
7
+ License: MIT
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Intended Audience :: End Users/Desktop
11
+ Classifier: Topic :: Multimedia :: Video
12
+ Classifier: Topic :: Multimedia :: Video :: Non-Linear Editor
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: C++
18
+ Classifier: Programming Language :: Assembly
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Environment :: Plugins
21
+ Project-URL: Repository, https://github.com/PingWer/vs-fgs
22
+ Project-URL: Issues, https://github.com/PingWer/vs-fgs/issues
23
+ Requires-Python: >=3.13
24
+ Requires-Dist: vapoursynth>=74
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest; extra == "dev"
27
+ Description-Content-Type: text/markdown
28
+
29
+ # vs-fgs
30
+
31
+ A VapourSynth plugin for applying Film Grain Synthesis (FGS) using the [dav1d](https://code.videolan.org/videolan/dav1d) engine.
32
+
33
+ Since `dav1d` is widely regarded as the best and fastest AV1 decoder available, its FGS engine is fully spec-compliant with **AFGS1** (AOMedia Film Grain Synthesis 1), guaranteeing highly accurate, performant, and standardized grain generation.
34
+
35
+ `vsfgs` parses standard FGS text files and applies film grain to the input clip natively in **8-bit, 10-bit, or 12-bit YUV**. It also handles automatic dithering if the input bit depth is higher.
36
+
37
+ ## Installation
38
+ ```bash
39
+ pip install vsfgs
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ ```python
45
+ import vapoursynth as vs
46
+ import vsfgs
47
+
48
+ core = vs.core
49
+
50
+ # 1. Load your video
51
+ clip = core.lsmas.LWLibavSource("source.mkv")
52
+
53
+ # 2. Apply Film Grain
54
+ # - ignore_chroma: If True, grain is only applied to Luma (Chroma is copied).
55
+ # - static: If True, uses the seed from the FGS table for all frames (if dynamic FGS, per event). If False, rotates the seed for each frame.
56
+ # - simd: Hardware SIMD architecture ('auto', 'avx512', 'avx2', 'sse41', 'sse3', 'sse2', or 'none'/'c' for plain C). Defaults to 'auto'.
57
+ clip = vsfgs.apply_fgs(clip, "grain_table.txt", ignore_chroma=False, static=False, simd="auto")
58
+
59
+ clip.set_output()
60
+ ```
61
+
62
+ ### Frame Properties
63
+
64
+ For each processed frame, `vsfgs` outputs the exact seed integer used during synthesis into the VapourSynth frame properties map: **`FGS_Seed`**
65
+
66
+
67
+ ## Advanced Customization
68
+
69
+ `vsfgs` allows for extreme and advanced customization of the film grain pattern. The logic for synthesizing grain relies on a detailed parameter table.
70
+ For an advanced visual editor to fine-tune these parameters and for more details on the grain configuration, please refer to the **FGSEditor** wiki:
71
+ [https://github.com/PingWer/FGSEditor](https://github.com/PingWer/FGSEditor)
72
+
73
+ ## Performance & Compatibility
74
+
75
+ `vsfgs` uses `dav1d`'s hand-written Assembly instructions (AVX-512, AVX2, SSE3 ...), resulting in extremely high throughput with almost zero overhead.
76
+
77
+ **Platform Support:**
78
+
79
+ | OS | Architecture | Supported | Tested |
80
+ | :--- | :--- | :---: | :---: |
81
+ | **Windows** | x86_64, ARM64 | ✅ | ✅ |
82
+ | **Linux** | x86_64, aarch64 | ✅ | ❌ |
83
+ | **macOS** | x86_64, Apple Silicon | ✅ | ❌ |
84
+
85
+ **Benchmark Comparison** *(2,000 frames of real 1080p source via `BestSource`)*:
86
+ Tests measure clean frame throughput and processor scaling across native chroma sub-samplings, comparing `vsfgs` against `Grainer.GAUSS` (from `vsdeband`). It also demonstrates the speedup of `dav1d`'s hardware SIMD Assembly optimizations over unvectorized reference C code (`simd='none'`).
87
+
88
+ | Format | Baseline (BestSource + 16b) | `vsfgs` (SIMD: Auto / AVX-512) | `vsfgs` (SIMD: None / Plain C) | `Grainer.GAUSS` (`vsdeband`) |
89
+ | --- | --- | --- | --- | --- |
90
+ | **YUV420P16** | ~1128 FPS | **~557 FPS** | ~514 FPS | ~347 FPS |
91
+ | **YUV422P16** | ~866 FPS | **~434 FPS** | ~425 FPS | ~322 FPS |
92
+ | **YUV444P16** | ~649 FPS | **~305 FPS** | ~299 FPS | ~279 FPS |
93
+
94
+ ## Building from Source
95
+
96
+ To compile the plugin manually, you must have a working C++ toolchain and Meson setup. The plugin depends on `dav1d`, which will be built automatically as a Meson subproject.
97
+
98
+ ### Prerequisites
99
+
100
+ - **Python 3.13+** (or newer)
101
+ - **C++ Compiler**: GCC/Clang (Linux/macOS) or MSVC (Windows)
102
+ - **Meson & Ninja**: Build system (`pip install meson ninja`)
103
+ - **nasm**: Highly recommended for x86/x64 systems to enable `dav1d` assembly optimizations (drastically improves grain synthesis performance).
104
+ - *Windows*: `choco install nasm`
105
+ - *Linux*: `sudo apt-get install nasm` or `sudo dnf install nasm`
106
+ - *macOS*: `brew install nasm`
107
+
108
+ ### Build Steps
109
+
110
+ 1. Clone the repository recursively to fetch the `dav1d` submodule:
111
+ ```bash
112
+ git clone --recursive https://github.com/PingWer/vs-fgs.git
113
+ cd vs-fgs
114
+ ```
115
+
116
+ 2. Build and install the plugin directly into your active Python environment:
117
+ ```bash
118
+ pip install .
119
+ ```
120
+
121
+ ### Standalone Build (Without Python Installation)
122
+
123
+ If you only want to compile the VapourSynth plugin binary (DLL/SO/DYLIB) without installing it via pip, you can use Meson directly:
124
+
125
+ ```bash
126
+ meson setup build --buildtype=release
127
+ meson compile -C build
128
+ ```
129
+ ## License
130
+
131
+ This project is licensed under the **MIT License**.
vsfgs-0.5.0/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # vs-fgs
2
+
3
+ A VapourSynth plugin for applying Film Grain Synthesis (FGS) using the [dav1d](https://code.videolan.org/videolan/dav1d) engine.
4
+
5
+ Since `dav1d` is widely regarded as the best and fastest AV1 decoder available, its FGS engine is fully spec-compliant with **AFGS1** (AOMedia Film Grain Synthesis 1), guaranteeing highly accurate, performant, and standardized grain generation.
6
+
7
+ `vsfgs` parses standard FGS text files and applies film grain to the input clip natively in **8-bit, 10-bit, or 12-bit YUV**. It also handles automatic dithering if the input bit depth is higher.
8
+
9
+ ## Installation
10
+ ```bash
11
+ pip install vsfgs
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```python
17
+ import vapoursynth as vs
18
+ import vsfgs
19
+
20
+ core = vs.core
21
+
22
+ # 1. Load your video
23
+ clip = core.lsmas.LWLibavSource("source.mkv")
24
+
25
+ # 2. Apply Film Grain
26
+ # - ignore_chroma: If True, grain is only applied to Luma (Chroma is copied).
27
+ # - static: If True, uses the seed from the FGS table for all frames (if dynamic FGS, per event). If False, rotates the seed for each frame.
28
+ # - simd: Hardware SIMD architecture ('auto', 'avx512', 'avx2', 'sse41', 'sse3', 'sse2', or 'none'/'c' for plain C). Defaults to 'auto'.
29
+ clip = vsfgs.apply_fgs(clip, "grain_table.txt", ignore_chroma=False, static=False, simd="auto")
30
+
31
+ clip.set_output()
32
+ ```
33
+
34
+ ### Frame Properties
35
+
36
+ For each processed frame, `vsfgs` outputs the exact seed integer used during synthesis into the VapourSynth frame properties map: **`FGS_Seed`**
37
+
38
+
39
+ ## Advanced Customization
40
+
41
+ `vsfgs` allows for extreme and advanced customization of the film grain pattern. The logic for synthesizing grain relies on a detailed parameter table.
42
+ For an advanced visual editor to fine-tune these parameters and for more details on the grain configuration, please refer to the **FGSEditor** wiki:
43
+ [https://github.com/PingWer/FGSEditor](https://github.com/PingWer/FGSEditor)
44
+
45
+ ## Performance & Compatibility
46
+
47
+ `vsfgs` uses `dav1d`'s hand-written Assembly instructions (AVX-512, AVX2, SSE3 ...), resulting in extremely high throughput with almost zero overhead.
48
+
49
+ **Platform Support:**
50
+
51
+ | OS | Architecture | Supported | Tested |
52
+ | :--- | :--- | :---: | :---: |
53
+ | **Windows** | x86_64, ARM64 | ✅ | ✅ |
54
+ | **Linux** | x86_64, aarch64 | ✅ | ❌ |
55
+ | **macOS** | x86_64, Apple Silicon | ✅ | ❌ |
56
+
57
+ **Benchmark Comparison** *(2,000 frames of real 1080p source via `BestSource`)*:
58
+ Tests measure clean frame throughput and processor scaling across native chroma sub-samplings, comparing `vsfgs` against `Grainer.GAUSS` (from `vsdeband`). It also demonstrates the speedup of `dav1d`'s hardware SIMD Assembly optimizations over unvectorized reference C code (`simd='none'`).
59
+
60
+ | Format | Baseline (BestSource + 16b) | `vsfgs` (SIMD: Auto / AVX-512) | `vsfgs` (SIMD: None / Plain C) | `Grainer.GAUSS` (`vsdeband`) |
61
+ | --- | --- | --- | --- | --- |
62
+ | **YUV420P16** | ~1128 FPS | **~557 FPS** | ~514 FPS | ~347 FPS |
63
+ | **YUV422P16** | ~866 FPS | **~434 FPS** | ~425 FPS | ~322 FPS |
64
+ | **YUV444P16** | ~649 FPS | **~305 FPS** | ~299 FPS | ~279 FPS |
65
+
66
+ ## Building from Source
67
+
68
+ To compile the plugin manually, you must have a working C++ toolchain and Meson setup. The plugin depends on `dav1d`, which will be built automatically as a Meson subproject.
69
+
70
+ ### Prerequisites
71
+
72
+ - **Python 3.13+** (or newer)
73
+ - **C++ Compiler**: GCC/Clang (Linux/macOS) or MSVC (Windows)
74
+ - **Meson & Ninja**: Build system (`pip install meson ninja`)
75
+ - **nasm**: Highly recommended for x86/x64 systems to enable `dav1d` assembly optimizations (drastically improves grain synthesis performance).
76
+ - *Windows*: `choco install nasm`
77
+ - *Linux*: `sudo apt-get install nasm` or `sudo dnf install nasm`
78
+ - *macOS*: `brew install nasm`
79
+
80
+ ### Build Steps
81
+
82
+ 1. Clone the repository recursively to fetch the `dav1d` submodule:
83
+ ```bash
84
+ git clone --recursive https://github.com/PingWer/vs-fgs.git
85
+ cd vs-fgs
86
+ ```
87
+
88
+ 2. Build and install the plugin directly into your active Python environment:
89
+ ```bash
90
+ pip install .
91
+ ```
92
+
93
+ ### Standalone Build (Without Python Installation)
94
+
95
+ If you only want to compile the VapourSynth plugin binary (DLL/SO/DYLIB) without installing it via pip, you can use Meson directly:
96
+
97
+ ```bash
98
+ meson setup build --buildtype=release
99
+ meson compile -C build
100
+ ```
101
+ ## License
102
+
103
+ This project is licensed under the **MIT License**.
@@ -0,0 +1,217 @@
1
+ /*****************************************************************************
2
+ * Copyright (c) 2012-2020 Fredrik Mellbin
3
+ * --- Legal stuff ---
4
+ * This program is free software. It comes without any warranty, to
5
+ * the extent permitted by applicable law. You can redistribute it
6
+ * and/or modify it under the terms of the Do What The Fuck You Want
7
+ * To Public License, Version 2, as published by Sam Hocevar. See
8
+ * http://sam.zoy.org/wtfpl/COPYING for more details.
9
+ *****************************************************************************/
10
+
11
+ #ifndef VSHELPER4_H
12
+ #define VSHELPER4_H
13
+
14
+ #include <limits.h>
15
+ #include <stdint.h>
16
+ #include <stdlib.h>
17
+ #include <string.h>
18
+ #include <assert.h>
19
+ #include <math.h>
20
+ #include <float.h>
21
+ #ifdef _WIN32
22
+ #include <malloc.h>
23
+ #endif
24
+ #include "VapourSynth4.h"
25
+
26
+ #define VSH_STD_PLUGIN_ID "com.vapoursynth.std"
27
+ #define VSH_RESIZE_PLUGIN_ID "com.vapoursynth.resize"
28
+ #define VSH_TEXT_PLUGIN_ID "com.vapoursynth.text"
29
+
30
+ #ifdef __cplusplus
31
+ namespace vsh {
32
+ #define VSH4_MANGLE_FUNCTION_NAME(name) name
33
+ #define VSH4_BOOLEAN_TYPE bool
34
+ #else
35
+ #define VSH4_MANGLE_FUNCTION_NAME(name) vsh_##name
36
+ #define VSH4_BOOLEAN_TYPE int
37
+ #endif
38
+
39
+ /* Visual Studio doesn't recognize inline in c mode */
40
+ #if defined(_MSC_VER) && !defined(__cplusplus)
41
+ #define inline _inline
42
+ #endif
43
+
44
+ /* A kinda portable definition of the C99 restrict keyword (or its unofficial C++ equivalent) */
45
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* Available in C99 */
46
+ #define VS_RESTRICT restrict
47
+ #elif defined(__cplusplus) || defined(_MSC_VER) /* Almost all relevant C++ compilers support it so just assume it works */
48
+ #define VS_RESTRICT __restrict
49
+ #else /* Not supported */
50
+ #define VS_RESTRICT
51
+ #endif
52
+
53
+ #ifdef _WIN32
54
+ #define VSH_ALIGNED_MALLOC(pptr, size, alignment) do { *(pptr) = _aligned_malloc((size), (alignment)); } while (0)
55
+ #define VSH_ALIGNED_FREE(ptr) do { _aligned_free((ptr)); } while (0)
56
+ #else
57
+ #define VSH_ALIGNED_MALLOC(pptr, size, alignment) do { if(posix_memalign((void**)(pptr), (alignment), (size))) *((void**)pptr) = NULL; } while (0)
58
+ #define VSH_ALIGNED_FREE(ptr) do { free((ptr)); } while (0)
59
+ #endif
60
+
61
+ #define VSMAX(a,b) ((a) > (b) ? (a) : (b))
62
+ #define VSMIN(a,b) ((a) > (b) ? (b) : (a))
63
+
64
+ #ifdef __cplusplus
65
+ /* A nicer templated malloc for all the C++ users out there */
66
+ #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)
67
+ template<typename T = void>
68
+ #else
69
+ template<typename T>
70
+ #endif
71
+ static inline T *vsh_aligned_malloc(size_t size, size_t alignment) {
72
+ #ifdef _WIN32
73
+ return (T *)_aligned_malloc(size, alignment);
74
+ #else
75
+ void *tmp = NULL;
76
+ if (posix_memalign(&tmp, alignment, size))
77
+ tmp = 0;
78
+ return (T *)tmp;
79
+ #endif
80
+ }
81
+
82
+ static inline void vsh_aligned_free(void *ptr) {
83
+ VSH_ALIGNED_FREE(ptr);
84
+ }
85
+ #endif /* __cplusplus */
86
+
87
+ /* convenience function for checking if the format never changes between frames */
88
+ static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isConstantVideoFormat)(const VSVideoInfo *vi) {
89
+ return vi->height > 0 && vi->width > 0 && vi->format.colorFamily != cfUndefined;
90
+ }
91
+
92
+ /* convenience function to check if two clips have the same format (unknown/changeable will be considered the same too) */
93
+ static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameVideoFormat)(const VSVideoFormat *v1, const VSVideoFormat *v2) {
94
+ return v1->colorFamily == v2->colorFamily && v1->sampleType == v2->sampleType && v1->bitsPerSample == v2->bitsPerSample && v1->subSamplingW == v2->subSamplingW && v1->subSamplingH == v2->subSamplingH;
95
+ }
96
+
97
+ /* convenience function to check if a clip has the same format as a format id */
98
+ static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameVideoPresetFormat)(unsigned presetFormat, const VSVideoFormat *v, VSCore *core, const VSAPI *vsapi) {
99
+ return vsapi->queryVideoFormatID(v->colorFamily, v->sampleType, v->bitsPerSample, v->subSamplingW, v->subSamplingH, core) == presetFormat;
100
+ }
101
+
102
+ /* convenience function to check for if two clips have the same format (but not framerate) while also including width and height (unknown/changeable will be considered the same too) */
103
+ static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameVideoInfo)(const VSVideoInfo *v1, const VSVideoInfo *v2) {
104
+ return v1->height == v2->height && v1->width == v2->width && VSH4_MANGLE_FUNCTION_NAME(isSameVideoFormat)(&v1->format, &v2->format);
105
+ }
106
+
107
+ /* convenience function to check for if two clips have the same format while also including samplerate (unknown/changeable will be considered the same too) */
108
+ static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameAudioFormat)(const VSAudioFormat *a1, const VSAudioFormat *a2) {
109
+ return a1->bitsPerSample == a2->bitsPerSample && a1->sampleType == a2->sampleType && a1->channelLayout == a2->channelLayout;
110
+ }
111
+
112
+ /* convenience function to check for if two clips have the same format while also including samplerate (unknown/changeable will be considered the same too) */
113
+ static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(isSameAudioInfo)(const VSAudioInfo *a1, const VSAudioInfo *a2) {
114
+ return a1->sampleRate == a2->sampleRate && VSH4_MANGLE_FUNCTION_NAME(isSameAudioFormat)(&a1->format, &a2->format);
115
+ }
116
+
117
+ /* multiplies and divides a rational number, such as a frame duration, in place and reduces the result */
118
+ static inline void VSH4_MANGLE_FUNCTION_NAME(muldivRational)(int64_t *num, int64_t *den, int64_t mul, int64_t div) {
119
+ /* do nothing if the rational number is invalid */
120
+ if (!*den)
121
+ return;
122
+
123
+ /* nobody wants to accidentally divide by zero */
124
+ assert(div);
125
+
126
+ int64_t a, b;
127
+ *num *= mul;
128
+ *den *= div;
129
+ a = *num;
130
+ b = *den;
131
+ while (b != 0) {
132
+ int64_t t = a;
133
+ a = b;
134
+ b = t % b;
135
+ }
136
+ if (a < 0)
137
+ a = -a;
138
+ *num /= a;
139
+ *den /= a;
140
+ }
141
+
142
+ /* reduces a rational number */
143
+ static inline void VSH4_MANGLE_FUNCTION_NAME(reduceRational)(int64_t *num, int64_t *den) {
144
+ VSH4_MANGLE_FUNCTION_NAME(muldivRational)(num, den, 1, 1);
145
+ }
146
+
147
+ /* add two rational numbers and reduces the result */
148
+ static inline void VSH4_MANGLE_FUNCTION_NAME(addRational)(int64_t *num, int64_t *den, int64_t addnum, int64_t addden) {
149
+ /* do nothing if the rational number is invalid */
150
+ if (!*den)
151
+ return;
152
+
153
+ /* nobody wants to accidentally add an invalid rational number */
154
+ assert(addden);
155
+
156
+ if (*den == addden) {
157
+ *num += addnum;
158
+ } else {
159
+ int64_t temp = addden;
160
+ addnum *= *den;
161
+ addden *= *den;
162
+ *num *= temp;
163
+ *den *= temp;
164
+
165
+ *num += addnum;
166
+
167
+ VSH4_MANGLE_FUNCTION_NAME(reduceRational)(num, den);
168
+ }
169
+ }
170
+
171
+ /* converts an int64 to int with saturation, useful to silence warnings when reading int properties among other things */
172
+ static inline int VSH4_MANGLE_FUNCTION_NAME(int64ToIntS)(int64_t i) {
173
+ if (i > INT_MAX)
174
+ return INT_MAX;
175
+ else if (i < INT_MIN)
176
+ return INT_MIN;
177
+ else return (int)i;
178
+ }
179
+
180
+ /* converts a double to float with saturation, useful to silence warnings when reading float properties among other things */
181
+ static inline float VSH4_MANGLE_FUNCTION_NAME(doubleToFloatS)(double d) {
182
+ return (float)d;
183
+ }
184
+
185
+ static inline void VSH4_MANGLE_FUNCTION_NAME(bitblt)(void *dstp, ptrdiff_t dst_stride, const void *srcp, ptrdiff_t src_stride, size_t row_size, size_t height) {
186
+ if (height) {
187
+ if (src_stride == dst_stride && src_stride == (ptrdiff_t)row_size) {
188
+ memcpy(dstp, srcp, row_size * height);
189
+ } else {
190
+ const uint8_t *srcp8 = (const uint8_t *)srcp;
191
+ uint8_t *dstp8 = (uint8_t *)dstp;
192
+ size_t i;
193
+ for (i = 0; i < height; i++) {
194
+ memcpy(dstp8, srcp8, row_size);
195
+ srcp8 += src_stride;
196
+ dstp8 += dst_stride;
197
+ }
198
+ }
199
+ }
200
+ }
201
+
202
+ /* check if the frame dimensions are valid for a given format */
203
+ /* returns non-zero for valid width and height */
204
+ static inline VSH4_BOOLEAN_TYPE VSH4_MANGLE_FUNCTION_NAME(areValidDimensions)(const VSVideoFormat *fi, int width, int height) {
205
+ return !(width % (1 << fi->subSamplingW) || height % (1 << fi->subSamplingH));
206
+ }
207
+
208
+ /* Visual Studio doesn't recognize inline in c mode */
209
+ #if defined(_MSC_VER) && !defined(__cplusplus)
210
+ #undef inline
211
+ #endif
212
+
213
+ #ifdef __cplusplus
214
+ }
215
+ #endif
216
+
217
+ #endif