Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions .github/actions/setup-akarin/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
enable-cache: true

- name: Install dependencies
run: uv sync --locked --all-extras --no-install-package vapoursynth
run: uv sync --locked --extra basic --extra denoise

- name: Run Ruff check
id: ruff_check
Expand Down
19 changes: 1 addition & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ env:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
vapoursynth-version: [73]
python-version: ["3.12", "3.14"]

steps:
- name: Checkout repository
uses: actions/checkout@v6
Expand All @@ -42,19 +36,8 @@ jobs:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Set up VapourSynth ${{ matrix.vapoursynth-version }}
uses: Jaded-Encoding-Thaumaturgy/setup-vapoursynth@v1
with:
vapoursynth-version: ${{ matrix.vapoursynth-version }}
python-version: ${{ matrix.python-version }}

- name: Set up akarin
uses: ./.github/actions/setup-akarin
with:
akarin-version: 6d7c733b3014a42be75299427b5c35f56f02a47a

- name: Install dependencies
run: uv sync --locked --all-extras --group test --no-dev
run: uv sync --locked --no-dev --group test --extra basic --extra kernels --extra expr --extra rg

- name: Run tests
run: uv run pytest --cov-report=term-missing:skip-covered --cov=vskernels --cov=vstools --cov=vsexprtools tests
Expand Down
129 changes: 120 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

[build-system]
requires = ["hatchling>=1.27.0", "versioningit"]
build-backend = "hatchling.build"

[project]
name = "vsjetpack"
dynamic = ["version"]
Expand Down Expand Up @@ -42,26 +47,126 @@ classifiers = [
"Typing :: Typed",
]
dependencies = [
"VapourSynth>=69",
"vapoursynth>=73",
"jetpytools~=2.2.1",
"numpy>=2.0.0",
"typing_extensions>=4.15.0; python_version<'3.13'",
]

[project.optional-dependencies]
full = ["scipy>=1.16.0", "rich>=14.0.0", "psutil>=7.0.0"]

[project.urls]
Documentation = "https://jaded-encoding-thaumaturgy.github.io/vs-jetpack/"
"Source Code" = "https://github.com/Jaded-Encoding-Thaumaturgy/vs-jetpack"
Tracker = "https://github.com/Jaded-Encoding-Thaumaturgy/vs-jetpack/issues"
"Contact" = "https://discord.gg/XTpc6Fa9eB"

[project.optional-dependencies]
basic = [
# Python Packages
"scipy>=1.16.0",
"rich>=14.0.0",
"psutil>=7.0.0",

# VapourSynth plugins
"vapoursynth-akarin>=1.3.0",
"vapoursynth-fmtconv>=31",
"vapoursynth-vszip>=13.0.0",
"vapoursynth-bestsource>=17.0",
"vapoursynth-scxvid>=3.0",
]
source = [
"vapoursynth-d2vsource>=1.4",
"vapoursynth-dvdsrc2>=3.0",
"vapoursynth-ffms2>=5.2.0",
]
kernels = [
"vapoursynth-resize2>=0.4.2",
"vapoursynth-descale>=12",
"vs-placebo>=2.0.2",
]
expr = ["vsjetpack[basic]"]
rg = [
"vsjetpack[kernels]",
"vsjetpack[expr]",
"vapoursynth-awarp>=3.0",
"vapoursynth-zsmooth>=0.15.4",
]
mask = [
"vsjetpack[source]",
"vsjetpack[rg]",
"vapoursynth-adaptivegrain>=0.5.0",
"vapoursynth-edgemasks>=4.0",
"vapoursynth-hysteresis>=1.1.3",
"vapoursynth-subtext>=6.0",
]
scale = ["vsjetpack[mask]"]
aa = [
"vsjetpack[scale]",
"vapoursynth-bwdif>=5.0",
"vapoursynth-eedi3>=9.0",
"vapoursynth-sangnom>=43",
"vapoursynth-sneedif>=4.2",
"vapoursynth-znedi3>=2.1",
]
denoise = [
"vsjetpack[aa]",
"vapoursynth-bm3d>=10.0",
"vapoursynth-bm3dcpu>=2.16.4 ; platform_machine == 'x86_64' and (platform_system == 'Linux' or platform_system == 'Windows')",
# "bm3dmetal ; platform_system == 'Darwin",
"vapoursynth-dctfilter>=3.1",
"dfttest2[gcc]>=10 ; platform_machine != 'x86_64'",
"dfttest2[cpu]>=10 ; platform_machine == 'x86_64'",
"vapoursynth-deblock>=8.0",
"vapoursynth-manipmv>=1.3.0",
"vapoursynth-mvtools>=26",
"vapoursynth-nlm-ispc>=3",
"vapoursynth-wnnm>=3",
]
dehalo = ["vsjetpack[denoise]"]
deinterlace = [
"vsjetpack[denoise]",
"vapoursynth-dmetrics>=2.0",
"vapoursynth-vivtc>=2.0",
]
deband = ["vsjetpack[denoise]", "vsnoise>=1.2"]
cl = ["vapoursynth-knlmeanscl>=1.2"]
nvidia = [
"dfttest2[cufft,nvrtc]>=10",
"vapoursynth-dfttest2-cuda>=10", # Explicitly specify this one so it's properly resolved through uv --index
"vapoursynth-bm3dcuda>=2.16",
"vapoursynth-bilateralgpu>=14",
"vapoursynth-nlm-cuda>=4",
]
amd = [
"vsjetpack[cl]",
"dfttest2[hipfft,hiprtc]>=10",
"vapoursynth-bm3dhip>=2.16",
]
full = [
"vsjetpack[basic]",
"vsjetpack[source]",
"vsjetpack[kernels]",
"vsjetpack[expr]",
"vsjetpack[rg]",
"vsjetpack[mask]",
"vsjetpack[scale]",
"vsjetpack[aa]",
"vsjetpack[denoise]",
"vsjetpack[dehalo]",
"vsjetpack[deinterlace]",
"vsjetpack[deband]",

"vsjetpack[cl]",
# "dfttest",
# "eedi2",
# "vs-mlrt",
]

full-nvidia = ["vsjetpack[full]", "vsjetpack[nvidia]"]
full-amd = ["vsjetpack[full]", "vsjetpack[amd]"]

[dependency-groups]
dev = [
"mypy~=2.0.0",
"pytest>=9.0.0, <10.0.0",
"pytest-cov>=6.2.1, <8.0.0",
"ruff~=0.15.0",
"prek>=0.3.6",
"scipy-stubs>=1.16.0.0",
Expand Down Expand Up @@ -90,9 +195,15 @@ doc = [
"vstransitions==0.1.4",
]

[build-system]
requires = ["hatchling>=1.27.0", "versioningit"]
build-backend = "hatchling.build"
[tool.uv.sources]
vapoursynth-dfttest2-cuda = { index = "vs-wheels" }
vapoursynth-ffms2 = { index = "vs-wheels" }
vapoursynth-fmtconv = { index = "vs-wheels" }

[[tool.uv.index]]
name = "vs-wheels"
url = "https://jaded-encoding-thaumaturgy.github.io/vs-wheels/simple"
explicit = true

[tool.hatch.build]
artifacts = ["vsjetpack/_version.py"]
Expand Down
89 changes: 0 additions & 89 deletions stubs/dfttest2.pyi

This file was deleted.

36 changes: 30 additions & 6 deletions tests/vstools/functions/test_heuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,39 @@
def test_video_heuristics_props_none() -> None:
heuristics, assumed = video_heuristics(clip, None, assumed_return=True)

assert heuristics == {"matrix_in": 6, "primaries_in": 6, "transfer_in": 6, "range_in": 1, "chromaloc_in": 0}
assert assumed == ["_Matrix", "_Primaries", "_Transfer", "_ColorRange", "_ChromaLocation"]
assert heuristics == {
"matrix_in": 6,
"primaries_in": 6,
"transfer_in": 6,
"range_in": vs.RANGE_LIMITED,
"chromaloc_in": 0,
}
assert assumed == ["_Matrix", "_Primaries", "_Transfer", "_Range", "_ChromaLocation"]


def test_video_heuristics_props_false() -> None:
heuristics, assumed = video_heuristics(clip, False, assumed_return=True)

assert heuristics == {"matrix_in": 6, "primaries_in": 6, "transfer_in": 6, "range_in": 1, "chromaloc_in": 0}
assert assumed == ["_Matrix", "_Primaries", "_Transfer", "_ColorRange", "_ChromaLocation"]
assert heuristics == {
"matrix_in": 6,
"primaries_in": 6,
"transfer_in": 6,
"range_in": vs.RANGE_LIMITED,
"chromaloc_in": 0,
}
assert assumed == ["_Matrix", "_Primaries", "_Transfer", "_Range", "_ChromaLocation"]


def test_video_heuristics_props_true() -> None:
heuristics, assumed = video_heuristics(clip, True, assumed_return=True)

assert heuristics == {"matrix_in": 1, "primaries_in": 6, "transfer_in": 6, "range_in": 0, "chromaloc_in": 0}
assert heuristics == {
"matrix_in": 1,
"primaries_in": 6,
"transfer_in": 6,
"range_in": vs.RANGE_FULL,
"chromaloc_in": 0,
}
assert assumed == ["_Primaries", "_Transfer", "_ChromaLocation"]


Expand All @@ -33,5 +51,11 @@ def test_video_heuristics_props_frameprops() -> None:

heuristics, assumed = video_heuristics(clip, props, assumed_return=True)

assert heuristics == {"matrix_in": 1, "primaries_in": 6, "transfer_in": 6, "range_in": 0, "chromaloc_in": 2}
assert heuristics == {
"matrix_in": 1,
"primaries_in": 6,
"transfer_in": 6,
"range_in": vs.RANGE_FULL,
"chromaloc_in": 2,
}
assert assumed == ["_Primaries", "_Transfer"]
Loading
Loading