vspackrgb 1.0.0__cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
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.
- vspackrgb/__init__.py +7 -0
- vspackrgb/cython.cpython-314-x86_64-linux-gnu.so +0 -0
- vspackrgb/cython.pyi +22 -0
- vspackrgb/helpers.py +149 -0
- vspackrgb/numpy.py +70 -0
- vspackrgb/py.typed +0 -0
- vspackrgb/python.py +53 -0
- vspackrgb-1.0.0.dist-info/METADATA +114 -0
- vspackrgb-1.0.0.dist-info/RECORD +11 -0
- vspackrgb-1.0.0.dist-info/WHEEL +7 -0
- vspackrgb-1.0.0.dist-info/licenses/LICENSE +21 -0
vspackrgb/__init__.py
ADDED
|
Binary file
|
vspackrgb/cython.pyi
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import ctypes
|
|
2
|
+
|
|
3
|
+
def pack_bgra_8bit(
|
|
4
|
+
b_data: ctypes.Array[ctypes.c_uint8],
|
|
5
|
+
g_data: ctypes.Array[ctypes.c_uint8],
|
|
6
|
+
r_data: ctypes.Array[ctypes.c_uint8],
|
|
7
|
+
width: int,
|
|
8
|
+
height: int,
|
|
9
|
+
src_stride: int,
|
|
10
|
+
dest_ptr: int,
|
|
11
|
+
dest_stride: int,
|
|
12
|
+
) -> None: ...
|
|
13
|
+
def pack_rgb30_10bit(
|
|
14
|
+
r_data: ctypes.Array[ctypes.c_uint16],
|
|
15
|
+
g_data: ctypes.Array[ctypes.c_uint16],
|
|
16
|
+
b_data: ctypes.Array[ctypes.c_uint16],
|
|
17
|
+
width: int,
|
|
18
|
+
height: int,
|
|
19
|
+
samples_per_row: int,
|
|
20
|
+
dest_ptr: int,
|
|
21
|
+
dest_stride: int,
|
|
22
|
+
) -> None: ...
|
vspackrgb/helpers.py
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""VapourSynth frame packing helpers."""
|
|
2
|
+
|
|
3
|
+
import ctypes
|
|
4
|
+
from collections.abc import Callable
|
|
5
|
+
from typing import Literal, Protocol, overload
|
|
6
|
+
|
|
7
|
+
import vapoursynth as vs
|
|
8
|
+
|
|
9
|
+
from . import cython, numpy, python
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def packrgb(clip: vs.VideoNode, backend: Literal["cython", "numpy", "python"] = "cython") -> vs.VideoNode:
|
|
13
|
+
"""
|
|
14
|
+
Pack a planar RGB clip into a display-ready format.
|
|
15
|
+
|
|
16
|
+
Converts RGB24 to interleaved BGRA (32-bit) or RGB30 to packed RGB30 (10-bit per channel) format,
|
|
17
|
+
stored in a GRAY32 clip
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
clip: Input clip in RGB24 or RGB30 format.
|
|
21
|
+
backend: Packing backend ("cython", "numpy", "python"). "python" is *very* slow.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
GRAY32 clip with packed pixel data.
|
|
25
|
+
|
|
26
|
+
Raises:
|
|
27
|
+
ValueError: If format or backend is unsupported or resolution is variable.
|
|
28
|
+
"""
|
|
29
|
+
if 0 in [clip.width, clip.height]:
|
|
30
|
+
raise ValueError("Variable resolution clips are not supported")
|
|
31
|
+
|
|
32
|
+
match clip.format.id, backend:
|
|
33
|
+
case (vs.RGB24, "cython"):
|
|
34
|
+
pack_fn = _make_pack_frame_8bit(cython.pack_bgra_8bit)
|
|
35
|
+
case (vs.RGB24, "numpy"):
|
|
36
|
+
pack_fn = _make_pack_frame_8bit(numpy.pack_bgra_8bit)
|
|
37
|
+
case (vs.RGB24, "python"):
|
|
38
|
+
pack_fn = _make_pack_frame_8bit(python.pack_bgra_8bit)
|
|
39
|
+
case (vs.RGB30, "cython"):
|
|
40
|
+
pack_fn = _make_pack_frame_10bit(cython.pack_rgb30_10bit)
|
|
41
|
+
case (vs.RGB30, "numpy"):
|
|
42
|
+
pack_fn = _make_pack_frame_10bit(numpy.pack_rgb30_10bit)
|
|
43
|
+
case (vs.RGB30, "python"):
|
|
44
|
+
pack_fn = _make_pack_frame_10bit(python.pack_rgb30_10bit)
|
|
45
|
+
case _:
|
|
46
|
+
raise ValueError("Unsupported input format or backend")
|
|
47
|
+
|
|
48
|
+
blank = clip.std.BlankClip(format=vs.GRAY32, keep=True)
|
|
49
|
+
|
|
50
|
+
return vs.core.std.ModifyFrame(blank, [clip, blank], pack_fn)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class _ModifyFrameFunction(Protocol):
|
|
54
|
+
def __call__(self, *, n: int, f: list[vs.VideoFrame]) -> vs.VideoFrame: ...
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _make_pack_frame_8bit(pack_bgra_8bit: Callable[..., None]) -> _ModifyFrameFunction:
|
|
58
|
+
def _pack_frame(n: int, f: list[vs.VideoFrame]) -> vs.VideoFrame:
|
|
59
|
+
frame_src, frame_dst = f[0], f[1].copy()
|
|
60
|
+
|
|
61
|
+
width, height = frame_src.width, frame_src.height
|
|
62
|
+
src_stride = frame_src.get_stride(0)
|
|
63
|
+
dst_stride = frame_dst.get_stride(0)
|
|
64
|
+
dst_ptr = frame_dst.get_write_ptr(0).value
|
|
65
|
+
|
|
66
|
+
if dst_ptr is None:
|
|
67
|
+
raise ValueError("Destination frame pointer is NULL")
|
|
68
|
+
|
|
69
|
+
b_plane = get_plane_buffer(frame_src, 2)
|
|
70
|
+
g_plane = get_plane_buffer(frame_src, 1)
|
|
71
|
+
r_plane = get_plane_buffer(frame_src, 0)
|
|
72
|
+
|
|
73
|
+
pack_bgra_8bit(b_plane, g_plane, r_plane, width, height, src_stride, dst_ptr, dst_stride)
|
|
74
|
+
|
|
75
|
+
return frame_dst
|
|
76
|
+
|
|
77
|
+
return _pack_frame
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _make_pack_frame_10bit(pack_rgb30_10bit: Callable[..., None]) -> _ModifyFrameFunction:
|
|
81
|
+
def _pack_frame(n: int, f: list[vs.VideoFrame]) -> vs.VideoFrame:
|
|
82
|
+
frame_src, frame_dst = f[0], f[1].copy()
|
|
83
|
+
|
|
84
|
+
width, height = frame_src.width, frame_src.height
|
|
85
|
+
src_stride = frame_src.get_stride(0)
|
|
86
|
+
samples_per_row = src_stride // 2
|
|
87
|
+
dst_stride = frame_dst.get_stride(0)
|
|
88
|
+
dst_ptr = frame_dst.get_write_ptr(0).value
|
|
89
|
+
|
|
90
|
+
if dst_ptr is None:
|
|
91
|
+
raise ValueError("Destination frame pointer is NULL")
|
|
92
|
+
|
|
93
|
+
r_plane = get_plane_buffer(frame_src, 0, bytes_per_sample=2)
|
|
94
|
+
g_plane = get_plane_buffer(frame_src, 1, bytes_per_sample=2)
|
|
95
|
+
b_plane = get_plane_buffer(frame_src, 2, bytes_per_sample=2)
|
|
96
|
+
|
|
97
|
+
pack_rgb30_10bit(r_plane, g_plane, b_plane, width, height, samples_per_row, dst_ptr, dst_stride)
|
|
98
|
+
|
|
99
|
+
return frame_dst
|
|
100
|
+
|
|
101
|
+
return _pack_frame
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@overload
|
|
105
|
+
def get_plane_buffer(
|
|
106
|
+
frame: vs.VideoFrame, plane: int, bytes_per_sample: Literal[1] = 1
|
|
107
|
+
) -> ctypes.Array[ctypes.c_uint8]: ...
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@overload
|
|
111
|
+
def get_plane_buffer(
|
|
112
|
+
frame: vs.VideoFrame, plane: int, bytes_per_sample: Literal[2]
|
|
113
|
+
) -> ctypes.Array[ctypes.c_uint16]: ...
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def get_plane_buffer(
|
|
117
|
+
frame: vs.VideoFrame, plane: int, bytes_per_sample: int = 1
|
|
118
|
+
) -> ctypes.Array[ctypes.c_uint8] | ctypes.Array[ctypes.c_uint16]:
|
|
119
|
+
"""
|
|
120
|
+
Get a ctypes array from a VideoFrame plane.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
frame: VideoFrame to read from.
|
|
124
|
+
plane: Plane index (0=R, 1=G, 2=B for RGB).
|
|
125
|
+
bytes_per_sample: 1 for 8-bit, 2 for 10/16-bit.
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
ctypes array of the plane's pixel data.
|
|
129
|
+
|
|
130
|
+
Raises:
|
|
131
|
+
ValueError: If pointer is NULL or bytes_per_sample invalid.
|
|
132
|
+
"""
|
|
133
|
+
stride = frame.get_stride(plane)
|
|
134
|
+
height = frame.height
|
|
135
|
+
ptr = frame.get_read_ptr(plane)
|
|
136
|
+
|
|
137
|
+
if (ptr_val := ptr.value) is None:
|
|
138
|
+
raise ValueError(f"Plane {plane} pointer is NULL")
|
|
139
|
+
|
|
140
|
+
buf_size = stride * height
|
|
141
|
+
|
|
142
|
+
if bytes_per_sample == 1:
|
|
143
|
+
c_buffer = (ctypes.c_uint8 * buf_size).from_address(ptr_val)
|
|
144
|
+
elif bytes_per_sample == 2:
|
|
145
|
+
c_buffer = (ctypes.c_uint16 * (buf_size // 2)).from_address(ptr_val)
|
|
146
|
+
else:
|
|
147
|
+
raise ValueError(f"Unsupported bytes_per_sample: {bytes_per_sample}")
|
|
148
|
+
|
|
149
|
+
return c_buffer
|
vspackrgb/numpy.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""NumPy-accelerated RGB packing functions."""
|
|
2
|
+
|
|
3
|
+
import ctypes
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def pack_bgra_8bit(
|
|
7
|
+
b_data: ctypes.Array[ctypes.c_uint8],
|
|
8
|
+
g_data: ctypes.Array[ctypes.c_uint8],
|
|
9
|
+
r_data: ctypes.Array[ctypes.c_uint8],
|
|
10
|
+
width: int,
|
|
11
|
+
height: int,
|
|
12
|
+
src_stride: int,
|
|
13
|
+
dest_ptr: int,
|
|
14
|
+
dest_stride: int,
|
|
15
|
+
) -> None:
|
|
16
|
+
"""Pack planar 8-bit RGB to interleaved BGRA, writing to dest buffer."""
|
|
17
|
+
import numpy as np
|
|
18
|
+
|
|
19
|
+
b_arr = np.frombuffer(b_data, dtype=np.uint8).reshape((height, src_stride))[:, :width]
|
|
20
|
+
g_arr = np.frombuffer(g_data, dtype=np.uint8).reshape((height, src_stride))[:, :width]
|
|
21
|
+
r_arr = np.frombuffer(r_data, dtype=np.uint8).reshape((height, src_stride))[:, :width]
|
|
22
|
+
|
|
23
|
+
bgra = np.empty((height, width, 4), dtype=np.uint8)
|
|
24
|
+
bgra[:, :, 0] = b_arr
|
|
25
|
+
bgra[:, :, 1] = g_arr
|
|
26
|
+
bgra[:, :, 2] = r_arr
|
|
27
|
+
bgra[:, :, 3] = 255 # Full alpha
|
|
28
|
+
|
|
29
|
+
out = (ctypes.c_uint8 * (dest_stride * height)).from_address(dest_ptr)
|
|
30
|
+
out_arr = np.frombuffer(out, dtype=np.uint8).reshape((height, dest_stride))
|
|
31
|
+
|
|
32
|
+
row_bytes = width * 4
|
|
33
|
+
out_arr[:, :row_bytes] = bgra.reshape((height, row_bytes))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def pack_rgb30_10bit(
|
|
37
|
+
r_data: ctypes.Array[ctypes.c_uint16],
|
|
38
|
+
g_data: ctypes.Array[ctypes.c_uint16],
|
|
39
|
+
b_data: ctypes.Array[ctypes.c_uint16],
|
|
40
|
+
width: int,
|
|
41
|
+
height: int,
|
|
42
|
+
samples_per_row: int,
|
|
43
|
+
dest_ptr: int,
|
|
44
|
+
dest_stride: int,
|
|
45
|
+
) -> None:
|
|
46
|
+
"""Pack planar 10-bit RGB to RGB30 (0xC0RRGGBB), writing to dest buffer."""
|
|
47
|
+
import numpy as np
|
|
48
|
+
|
|
49
|
+
r_arr = np.frombuffer(r_data, dtype=np.uint16).reshape((height, samples_per_row))[:, :width]
|
|
50
|
+
g_arr = np.frombuffer(g_data, dtype=np.uint16).reshape((height, samples_per_row))[:, :width]
|
|
51
|
+
b_arr = np.frombuffer(b_data, dtype=np.uint16).reshape((height, samples_per_row))[:, :width]
|
|
52
|
+
|
|
53
|
+
dest_samples_per_row = dest_stride // 4
|
|
54
|
+
out = (ctypes.c_uint32 * (dest_samples_per_row * height)).from_address(dest_ptr)
|
|
55
|
+
out_arr = np.frombuffer(out, dtype=np.uint32).reshape((height, dest_samples_per_row))
|
|
56
|
+
out_view = out_arr[:, :width]
|
|
57
|
+
|
|
58
|
+
# Pack into RGB30: high 2 bits = 0b11 (alpha), R(10) | G(10) | B(10)
|
|
59
|
+
temp = np.empty((height, width), dtype=np.uint32)
|
|
60
|
+
|
|
61
|
+
# R << 20 into temp, then add alpha mask
|
|
62
|
+
np.left_shift(r_arr, 20, out=temp, dtype=np.uint32)
|
|
63
|
+
temp |= 0xC0000000
|
|
64
|
+
|
|
65
|
+
# G << 10, add to temp
|
|
66
|
+
np.left_shift(g_arr, 10, out=out_view, dtype=np.uint32)
|
|
67
|
+
temp |= out_view
|
|
68
|
+
|
|
69
|
+
# B (just cast) and final OR into output
|
|
70
|
+
np.add(temp, b_arr, out=out_view, dtype=np.uint32)
|
vspackrgb/py.typed
ADDED
|
File without changes
|
vspackrgb/python.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Pure Python RGB packing (reference only, too slow for real-time)."""
|
|
2
|
+
|
|
3
|
+
import ctypes
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def pack_bgra_8bit(
|
|
7
|
+
b_data: ctypes.Array[ctypes.c_uint8],
|
|
8
|
+
g_data: ctypes.Array[ctypes.c_uint8],
|
|
9
|
+
r_data: ctypes.Array[ctypes.c_uint8],
|
|
10
|
+
width: int,
|
|
11
|
+
height: int,
|
|
12
|
+
src_stride: int,
|
|
13
|
+
dest_ptr: int,
|
|
14
|
+
dest_stride: int,
|
|
15
|
+
) -> None:
|
|
16
|
+
"""Pack planar 8-bit RGB to interleaved BGRA, writing to dest buffer."""
|
|
17
|
+
out = (ctypes.c_uint8 * (dest_stride * height)).from_address(dest_ptr)
|
|
18
|
+
|
|
19
|
+
for y in range(height):
|
|
20
|
+
src_row = y * src_stride
|
|
21
|
+
dst_row = y * dest_stride
|
|
22
|
+
|
|
23
|
+
for x in range(width):
|
|
24
|
+
dst_offset = dst_row + x * 4
|
|
25
|
+
out[dst_offset + 0] = b_data[src_row + x]
|
|
26
|
+
out[dst_offset + 1] = g_data[src_row + x]
|
|
27
|
+
out[dst_offset + 2] = r_data[src_row + x]
|
|
28
|
+
out[dst_offset + 3] = 255
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def pack_rgb30_10bit(
|
|
32
|
+
r_data: ctypes.Array[ctypes.c_uint16],
|
|
33
|
+
g_data: ctypes.Array[ctypes.c_uint16],
|
|
34
|
+
b_data: ctypes.Array[ctypes.c_uint16],
|
|
35
|
+
width: int,
|
|
36
|
+
height: int,
|
|
37
|
+
samples_per_row: int,
|
|
38
|
+
dest_ptr: int,
|
|
39
|
+
dest_stride: int,
|
|
40
|
+
) -> None:
|
|
41
|
+
"""Pack planar 10-bit RGB to RGB30 (0xC0RRGGBB), writing to dest buffer."""
|
|
42
|
+
out = (ctypes.c_uint32 * ((dest_stride // 4) * height)).from_address(dest_ptr)
|
|
43
|
+
dest_samples_per_row = dest_stride // 4
|
|
44
|
+
|
|
45
|
+
for y in range(height):
|
|
46
|
+
src_row = y * samples_per_row
|
|
47
|
+
dst_row = y * dest_samples_per_row
|
|
48
|
+
|
|
49
|
+
for x in range(width):
|
|
50
|
+
r = r_data[src_row + x]
|
|
51
|
+
g = g_data[src_row + x]
|
|
52
|
+
b = b_data[src_row + x]
|
|
53
|
+
out[dst_row + x] = 0xC0000000 | (r << 20) | (g << 10) | b
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vspackrgb
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: RGB packing for VapourSynth frames
|
|
5
|
+
Project-URL: Source Code, https://github.com/Jaded-Encoding-Thaumaturgy/vs-view/tree/main/src/vspackrgb
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/Jaded-Encoding-Thaumaturgy/vs-view/issues
|
|
7
|
+
Project-URL: Contact, https://discord.gg/XTpc6Fa9eB
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026 Jaded Encoding Thaumaturgy
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Keywords: aarch64,arm,arm64,cython,packing,rgb,vapoursynth
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
33
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
34
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
39
|
+
Classifier: Typing :: Typed
|
|
40
|
+
Requires-Python: >=3.12
|
|
41
|
+
Requires-Dist: vapoursynth
|
|
42
|
+
Provides-Extra: numpy
|
|
43
|
+
Requires-Dist: numpy>=2.0.0; extra == 'numpy'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# vspackrgb
|
|
47
|
+
|
|
48
|
+
RGB packing for VapourSynth frames.
|
|
49
|
+
|
|
50
|
+
Converts planar RGB VapourSynth clips into display-ready packed formats:
|
|
51
|
+
|
|
52
|
+
- **RGB24 → BGRA** (8-bit interleaved)
|
|
53
|
+
- **RGB30 → RGB30** (10-bit packed, 2-bit alpha)
|
|
54
|
+
|
|
55
|
+
Output is stored in a GRAY32 clip.
|
|
56
|
+
|
|
57
|
+
## Benchmarks
|
|
58
|
+
|
|
59
|
+
### Blank clip with `keep=True`
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
RGB24 Packing (1920x1080)
|
|
63
|
+
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┓
|
|
64
|
+
┃ Backend ┃ Frames ┃ Time ┃ FPS ┃
|
|
65
|
+
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━┩
|
|
66
|
+
│ vszip.PackRGB │ 6000 │ 2.186s │ 2745.14 │
|
|
67
|
+
│ libp2p.Pack │ 6000 │ 2.867s │ 2092.89 │
|
|
68
|
+
│ akarin.Expr │ 6000 │ 2.802s │ 2141.23 │
|
|
69
|
+
│ vspackrgb (cython) │ 6000 │ 8.998s │ 666.84 │
|
|
70
|
+
│ vspackrgb (numpy) │ 6000 │ 20.182s │ 297.30 │
|
|
71
|
+
│ vspackrgb (python) │ 30 │ 13.706s │ 2.19 │
|
|
72
|
+
└────────────────────┴────────┴─────────┴─────────┘
|
|
73
|
+
|
|
74
|
+
RGB30 Packing (1920x1080)
|
|
75
|
+
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┓
|
|
76
|
+
┃ Backend ┃ Frames ┃ Time ┃ FPS ┃
|
|
77
|
+
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━┩
|
|
78
|
+
│ vszip.PackRGB │ 6000 │ 2.842s │ 2111.21 │
|
|
79
|
+
│ libp2p.Pack │ 6000 │ 2.817s │ 2129.78 │
|
|
80
|
+
│ akarin.Expr │ 6000 │ 2.866s │ 2093.62 │
|
|
81
|
+
│ vspackrgb (cython) │ 6000 │ 8.750s │ 685.72 │
|
|
82
|
+
│ vspackrgb (numpy) │ 6000 │ 30.640s │ 195.83 │
|
|
83
|
+
│ vspackrgb (python) │ 30 │ 11.968s │ 2.51 │
|
|
84
|
+
└────────────────────┴────────┴─────────┴─────────┘
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Real world scenario
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
RGB24 Packing (1920x1080)
|
|
91
|
+
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
|
|
92
|
+
┃ Backend ┃ Frames ┃ Time ┃ FPS ┃
|
|
93
|
+
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
|
|
94
|
+
│ vszip.PackRGB │ 6000 │ 8.623s │ 695.79 │
|
|
95
|
+
│ libp2p.Pack │ 6000 │ 9.450s │ 634.93 │
|
|
96
|
+
│ akarin.Expr │ 6000 │ 9.395s │ 638.65 │
|
|
97
|
+
│ vspackrgb (cython) │ 6000 │ 12.231s │ 490.57 │
|
|
98
|
+
│ vspackrgb (numpy) │ 6000 │ 23.421s │ 256.18 │
|
|
99
|
+
│ vspackrgb (python) │ 30 │ 13.840s │ 2.17 │
|
|
100
|
+
└────────────────────┴────────┴─────────┴────────┘
|
|
101
|
+
|
|
102
|
+
RGB30 Packing (1920x1080)
|
|
103
|
+
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
|
|
104
|
+
┃ Backend ┃ Frames ┃ Time ┃ FPS ┃
|
|
105
|
+
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
|
|
106
|
+
│ vszip.PackRGB │ 6000 │ 10.623s │ 564.79 │
|
|
107
|
+
│ libp2p.Pack │ 6000 │ 10.874s │ 551.77 │
|
|
108
|
+
│ akarin.Expr │ 6000 │ 10.655s │ 563.13 │
|
|
109
|
+
│ vspackrgb (cython) │ 6000 │ 13.503s │ 444.35 │
|
|
110
|
+
│ vspackrgb (numpy) │ 6000 │ 36.062s │ 166.38 │
|
|
111
|
+
│ vspackrgb (python) │ 30 │ 12.055s │ 2.49 │
|
|
112
|
+
└────────────────────┴────────┴─────────┴────────┘
|
|
113
|
+
|
|
114
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
vspackrgb/__init__.py,sha256=wfzPuwYQr1jStRk896mp8u6TgrSprAnsas78wXLXRkM,131
|
|
2
|
+
vspackrgb/cython.cpython-314-x86_64-linux-gnu.so,sha256=HHxEBkBkKA2Pk-qE3_cvM06ojh0EFSgKv9z__sY9d1Q,1571056
|
|
3
|
+
vspackrgb/cython.pyi,sha256=NrJkV9M1SfJ5QWjQtIPsNNLxUz2hP7QFt2YddBqB198,537
|
|
4
|
+
vspackrgb/helpers.py,sha256=XSUtzMrclKS3vjN7iR42_mtntqzC3UHFc2gOpOpuDUU,4984
|
|
5
|
+
vspackrgb/numpy.py,sha256=lJjYNhFiY8ibgneygW-gsZC_R5hU-3-qSrqdG1gCaqk,2485
|
|
6
|
+
vspackrgb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
vspackrgb/python.py,sha256=Sj7thHtXX69biSarMawtPqYqqh0m8ZU-lgn3hJ00QEI,1653
|
|
8
|
+
vspackrgb-1.0.0.dist-info/METADATA,sha256=wgAgNH5Qt3d_dsmssBr_2LJp0G2B4ifM8nFkKM2O1hw,6314
|
|
9
|
+
vspackrgb-1.0.0.dist-info/WHEEL,sha256=nEHiLHY71DlJuQytFfdiSsqM8nj_w2dKX7OfeVPo0ho,187
|
|
10
|
+
vspackrgb-1.0.0.dist-info/RECORD,,
|
|
11
|
+
vspackrgb-1.0.0.dist-info/licenses/LICENSE,sha256=Am5mgDbqE74Pmbmv59-OsvKODDcWpkVPUdaXhhj5CdI,1083
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jaded Encoding Thaumaturgy
|
|
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.
|