cutcutcodec 1.2.1__tar.gz → 1.2.2__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.
- {cutcutcodec-1.2.1/cutcutcodec.egg-info → cutcutcodec-1.2.2}/PKG-INFO +5 -1
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/README.rst +1 -0
- cutcutcodec-1.2.2/c_build.py +47 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/__init__.py +1 -1
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/ffprobe.py +1 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/stream/rate_audio.py +2 -2
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/stream/rate_video.py +2 -2
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/stream/shape.py +2 -2
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/stream/time_backprop.py +2 -2
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/node.py +9 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/colorspace/func.py +2 -2
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/export/compatibility.py +8 -9
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/export/rate.py +2 -2
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py +2 -2
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/equation.py +1 -1
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/equation.py +1 -1
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/resize.py +25 -25
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/fractal/fractal.c +58 -76
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/fractal/mandelbrot.py +1 -1
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/io/__init__.py +6 -29
- cutcutcodec-1.2.2/cutcutcodec/core/io/cst.py +84 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/io/read_ffmpeg.py +98 -106
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/io/read_ffmpeg_color.py +11 -11
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/io/scheduler.py +3 -3
- cutcutcodec-1.2.2/cutcutcodec/core/opti/cache/basic.py +67 -0
- cutcutcodec-1.2.2/cutcutcodec/core/opti/parallel/__init__.py +7 -0
- cutcutcodec-1.2.2/cutcutcodec/core/opti/parallel/buffer.py +174 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/utils.py +3 -4
- cutcutcodec-1.2.2/cutcutcodec/core/signal/metric.c +578 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/utils.py +33 -17
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2/cutcutcodec.egg-info}/PKG-INFO +5 -1
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec.egg-info/SOURCES.txt +3 -2
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec.egg-info/requires.txt +4 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec.egg-info/top_level.txt +1 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/pyproject.toml +5 -2
- cutcutcodec-1.2.1/c_build.py +0 -32
- cutcutcodec-1.2.1/cutcutcodec/core/opti/cache/basic.py +0 -36
- cutcutcodec-1.2.1/cutcutcodec/core/opti/parallel/__init__.py +0 -3
- cutcutcodec-1.2.1/cutcutcodec/core/opti/parallel/buffer.py +0 -90
- cutcutcodec-1.2.1/media/logo.svg +0 -13
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/LICENSE +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/__main__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/config/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/config/config.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/_helper_properties.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/audio/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/audio/properties/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/audio/properties/duration.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/graph/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/graph/find.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/graph/time_backprop.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/stream/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/video/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/video/properties/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/video/properties/duration.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/video/properties/nb_frames.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/video/properties/rate.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/analysis/video/properties/timestamps.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/container.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/encoder.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/filter.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/frame.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/frame_audio.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/frame_video.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/layout.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/meta_filter.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/muxer.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/stream.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/stream_audio.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/classes/stream_video.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/colorspace/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/colorspace/cst.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/ast_to_file.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/export/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/export/default.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/export/encodec.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/export/muxer.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/graph_to_ast.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/graph_to_json.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/graph_to_tree.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/json_to_graph.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/parse.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/sympy_to_torch/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/sympy_to_torch/dynamic.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/sympy_to_torch/memory_check.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/sympy_to_torch/preprocess.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/sympy_to_torch/printer.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/sympy_to_torch/printer_atom.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/tree_to_graph.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/decision/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/factor/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/factor/proba.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/generalize/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/generalize/delay_to_fir.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/operation/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/operation/add.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/edit/operation/remove.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/exceptions.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/add.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/cat.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/cut.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/delay.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/fir.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/resample.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/subclip.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/audio/wiener.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/cut.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/identity.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/mix/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/mix/audio_cast.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/mix/video_cast.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/subclip.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/add.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/cat.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/colorspace.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/cut.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/delay.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/pad.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/patch.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/speed.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/filter/video/subclip.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/audio/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/audio/empty.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/audio/equation.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/audio/noise.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/empty.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/equation.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/fractal/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/fractal/geometry.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/noise.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/interfaces/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/interfaces/seedable.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/io/pix_map.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/io/read_image.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/io/read_svg.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/io/write_ffmpeg.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/nn/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/nn/dataaug/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/nn/dataaug/image.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/nn/loader.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/nn/model/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/nn/model/compression/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/nn/model/compression/img_cgavaenn.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/cache/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/cache/clean/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/cache/clean/graph.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/cache/hashes/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/cache/hashes/graph.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/cache/singleton.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/cuda/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/opti/graph.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/signal/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/signal/psd.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/signal/window.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/examples/audio_5.1_narration.oga +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/examples/intro.webm +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/examples/logo.png +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/examples/logo.svg +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/examples/project.json +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/examples/video.mp4 +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/__init__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/__main__.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/coding_style.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/install.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/run.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/abstract.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/audio_cast.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/audio_equation.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/c_memory.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/colorspace.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/compatibility.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/encoder.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/filter_cut.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/filter_delay.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/filter_empty.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/fir.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/initialisation.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/mandelbrot.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/muxer.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/nan_snapshot.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/pad.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/read.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/sympy_to_torch.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/thread_safe.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/video_equation.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/testing/tests/write.py +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec.egg-info/dependency_links.txt +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec.egg-info/entry_points.txt +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/docs/build/html/_static/check-solid.svg +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/docs/build/html/_static/copy-button.svg +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/docs/build/html/_static/css/fonts/fontawesome-webfont.svg +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/docs/build/html/_static/nbsphinx-broken-thumbnail.svg +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/docs/build/html/_static/nbsphinx-no-thumbnail.svg +0 -0
- {cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: cutcutcodec
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: video editing software
|
|
5
5
|
Author-email: "Robin RICHARD (robinechuca)" <serveurpython.oz@gmail.com>
|
|
6
6
|
Maintainer-email: "Robin RICHARD (robinechuca)" <serveurpython.oz@gmail.com>
|
|
@@ -81,6 +81,9 @@ Provides-Extra: test
|
|
|
81
81
|
Requires-Dist: pydocstyle<=6.1.1; extra == "test"
|
|
82
82
|
Requires-Dist: pylama[all,toml]; extra == "test"
|
|
83
83
|
Requires-Dist: pytest; extra == "test"
|
|
84
|
+
Provides-Extra: gui
|
|
85
|
+
Requires-Dist: jupyter; extra == "gui"
|
|
86
|
+
Requires-Dist: matplotlib; extra == "gui"
|
|
84
87
|
|
|
85
88
|
.. rst syntax: https://deusyss.developpez.com/tutoriels/Python/SphinxDoc/
|
|
86
89
|
.. version conv: https://peps.python.org/pep-0440/
|
|
@@ -175,3 +178,4 @@ Video
|
|
|
175
178
|
#. Resize and crop (high quality, no aliasing).
|
|
176
179
|
#. Overlaying video tracks (with transparency control).
|
|
177
180
|
#. Apply an arbitrary equation one several video streams.
|
|
181
|
+
#. Fast C implementation of the ``psnr``, ``mse`` and ``ssim`` metrics.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""The rules of compilation for setuptools."""
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
pyenv virtualenv-delete test
|
|
7
|
+
find . -name "*.so" | xargs rm
|
|
8
|
+
pyenv virtualenv 3.13 test
|
|
9
|
+
pyenv activate test
|
|
10
|
+
pip install .[doc]
|
|
11
|
+
python
|
|
12
|
+
from cutcutcodec.core.filter.video.metric import ssim
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import sys
|
|
17
|
+
|
|
18
|
+
from setuptools import Extension
|
|
19
|
+
from setuptools.command.build_py import build_py as _build_py
|
|
20
|
+
|
|
21
|
+
sys.path.insert(0, os.getcwd()) # it is required to find cutcutcodec
|
|
22
|
+
from cutcutcodec.utils import get_compilation_rules, get_project_root
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Build(_build_py):
|
|
26
|
+
"""Builder to compile c files."""
|
|
27
|
+
|
|
28
|
+
def run(self):
|
|
29
|
+
self.run_command("build_ext")
|
|
30
|
+
return super().run()
|
|
31
|
+
|
|
32
|
+
def initialize_options(self):
|
|
33
|
+
super().initialize_options()
|
|
34
|
+
if self.distribution.ext_modules is None:
|
|
35
|
+
self.distribution.ext_modules = []
|
|
36
|
+
rules = get_compilation_rules()
|
|
37
|
+
root = get_project_root()
|
|
38
|
+
for file in (
|
|
39
|
+
file_root / basename
|
|
40
|
+
for file_root, _, files in root.walk()
|
|
41
|
+
for basename in files
|
|
42
|
+
if basename.endswith(".c")
|
|
43
|
+
):
|
|
44
|
+
file = file.relative_to(root.parent)
|
|
45
|
+
self.distribution.ext_modules.append(
|
|
46
|
+
Extension(".".join(file.with_suffix("").parts), sources=[str(file)], **rules)
|
|
47
|
+
)
|
|
@@ -538,6 +538,7 @@ def get_slices_metadata(
|
|
|
538
538
|
for time_key in ("best_effort_timestamp", "pts", "pkt_pts", "dts", "pkt_dts"):
|
|
539
539
|
if (time := data.get(time_key, "N/A")) != "N/A":
|
|
540
540
|
if (time := float(int(time) * times_base[stream_index])) > progress_bar.n:
|
|
541
|
+
progress_bar.total = max(progress_bar.total, time)
|
|
541
542
|
progress_bar.update(time - progress_bar.n)
|
|
542
543
|
break
|
|
543
544
|
|
|
@@ -27,8 +27,8 @@ from cutcutcodec.core.io.read_ffmpeg import ContainerInputFFMPEG
|
|
|
27
27
|
RATE_ESTIMATORS = {} # to each node stream class, associate the func to find the optimal rate
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
def _add_estimator(node_cls: type) ->
|
|
31
|
-
def _add_func(func) ->
|
|
30
|
+
def _add_estimator(node_cls: type) -> callable:
|
|
31
|
+
def _add_func(func) -> callable:
|
|
32
32
|
RATE_ESTIMATORS[node_cls] = func
|
|
33
33
|
return func
|
|
34
34
|
return _add_func
|
|
@@ -14,8 +14,8 @@ from cutcutcodec.core.io.read_ffmpeg import ContainerInputFFMPEG
|
|
|
14
14
|
FPS_ESTIMATORS = {} # to each node stream class, associate the func to find the optimal rate
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def _add_estimator(node_cls: type) ->
|
|
18
|
-
def _add_func(func) ->
|
|
17
|
+
def _add_estimator(node_cls: type) -> callable:
|
|
18
|
+
def _add_func(func) -> callable:
|
|
19
19
|
FPS_ESTIMATORS[node_cls] = func
|
|
20
20
|
return func
|
|
21
21
|
return _add_func
|
|
@@ -17,8 +17,8 @@ from cutcutcodec.core.io.read_svg import ContainerInputSVG
|
|
|
17
17
|
SHAPE_ESTIMATORS = {} # to each node stream class, associate the func to find the optimal rate
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
def _add_estimator(node_cls: type) ->
|
|
21
|
-
def _add_func(func) ->
|
|
20
|
+
def _add_estimator(node_cls: type) -> callable:
|
|
21
|
+
def _add_func(func) -> callable:
|
|
22
22
|
SHAPE_ESTIMATORS[node_cls] = func
|
|
23
23
|
return func
|
|
24
24
|
return _add_func
|
|
@@ -16,8 +16,8 @@ from cutcutcodec.core.filter.video.delay import FilterVideoDelay
|
|
|
16
16
|
SLICE_ESTIMATORS = {} # to each node stream class, associate the func to find the time translation
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
def _add_estimator(node_cls: type) ->
|
|
20
|
-
def _add_func(func) ->
|
|
19
|
+
def _add_estimator(node_cls: type) -> callable:
|
|
20
|
+
def _add_func(func) -> callable:
|
|
21
21
|
SLICE_ESTIMATORS[node_cls] = func
|
|
22
22
|
return func
|
|
23
23
|
return _add_func
|
|
@@ -49,6 +49,15 @@ class Node(abc.ABC):
|
|
|
49
49
|
return False # not compare out_streams to avoide infinite loop
|
|
50
50
|
return True
|
|
51
51
|
|
|
52
|
+
def __enter__(self) -> typing.Self:
|
|
53
|
+
"""To allow context manager."""
|
|
54
|
+
return self
|
|
55
|
+
|
|
56
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
57
|
+
"""Exit the context manager."""
|
|
58
|
+
for stream in self.in_streams:
|
|
59
|
+
stream.node.__exit__(exc_type, exc_val, exc_tb)
|
|
60
|
+
|
|
52
61
|
def __getstate__(self) -> tuple[typing.Iterable[Stream], dict]:
|
|
53
62
|
"""Allow ``pickle`` to serialize efficiently."""
|
|
54
63
|
return self.in_streams, self.getstate()
|
|
@@ -59,10 +59,10 @@ def convert(
|
|
|
59
59
|
assert isinstance(src, str), src.__class__.__name__
|
|
60
60
|
assert isinstance(dst, str), dst.__class__.__name__
|
|
61
61
|
if len(src_space := [p for p in SYMBS if src.lower().startswith(p)]) != 1:
|
|
62
|
-
raise ValueError(f"failed to understand the src space {src}")
|
|
62
|
+
raise ValueError(f"failed to understand the src space {src}, {src_space}")
|
|
63
63
|
src_space = src_space.pop()
|
|
64
64
|
if len(dst_space := [p for p in SYMBS if dst.lower().startswith(p)]) != 1:
|
|
65
|
-
raise ValueError(f"failed to understand the dst space {dst}")
|
|
65
|
+
raise ValueError(f"failed to understand the dst space {dst}, {dst_space}")
|
|
66
66
|
dst_space = dst_space.pop()
|
|
67
67
|
primaries_src = [p for p in PRIMARIES if p in src.lower()]
|
|
68
68
|
primaries_src = primaries_src.pop() if primaries_src else None
|
{cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/export/compatibility.py
RENAMED
|
@@ -575,16 +575,15 @@ class Compatibilities(metaclass=MetaSingleton):
|
|
|
575
575
|
>>> from fractions import Fraction
|
|
576
576
|
>>> from pprint import pprint
|
|
577
577
|
>>> from cutcutcodec.core.compilation.export.compatibility import Compatibilities
|
|
578
|
-
>>>
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
{'dirac': [('vc2', 'avi'),
|
|
582
|
-
...
|
|
583
|
-
('vc2', 'wtv')],
|
|
578
|
+
>>> comp = Compatibilities().codecs_video(pix_fmt="yuv444p12le", rate=Fraction(120))
|
|
579
|
+
>>> pprint(comp["hevc"]) # doctest: +ELLIPSIS
|
|
580
|
+
[('libx265', 'flv'),
|
|
584
581
|
...
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
582
|
+
('libx265', 'vob')]
|
|
583
|
+
>>> pprint(comp["libdav1d"]) # doctest: +ELLIPSIS
|
|
584
|
+
[('libaom-av1', 'avi'),
|
|
585
|
+
...
|
|
586
|
+
('librav1e', 'webm')]
|
|
588
587
|
>>>
|
|
589
588
|
"""
|
|
590
589
|
encoders = sorted(AllEncoders().video) # sorted, not list because dict is sorted
|
|
@@ -42,7 +42,7 @@ def available_audio_rates(encoders: typing.Iterable[str]) -> typing.Union[None,
|
|
|
42
42
|
[8000, 12000, 16000, 24000, 48000]
|
|
43
43
|
>>>
|
|
44
44
|
"""
|
|
45
|
-
assert
|
|
45
|
+
assert isinstance(encoders, typing.Iterable), encoders.__class__.__name__
|
|
46
46
|
common_rates = set()
|
|
47
47
|
for encoder in encoders:
|
|
48
48
|
if (rates := Encoder(encoder).audio_rates) is None:
|
|
@@ -84,7 +84,7 @@ def suggest_audio_rate(
|
|
|
84
84
|
"""
|
|
85
85
|
assert isinstance(stream, StreamAudio), stream.__class__.__name__
|
|
86
86
|
if choices is not None:
|
|
87
|
-
assert
|
|
87
|
+
assert isinstance(choices, typing.Iterable), choices.__class__.__name__
|
|
88
88
|
choices = set(choices)
|
|
89
89
|
assert all(isinstance(r, int) for r in choices), choices
|
|
90
90
|
assert all(r > 0 for r in choices), choices
|
{cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py
RENAMED
|
@@ -33,7 +33,7 @@ from cutcutcodec.utils import get_compilation_rules
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def _cast_lambdify_c(
|
|
36
|
-
func:
|
|
36
|
+
func: callable, input_args: dict[str, typing.Union[numbers.Real, torch.Tensor]]
|
|
37
37
|
) -> typing.Union[torch.Tensor, tuple[torch.Tensor]]:
|
|
38
38
|
"""Cast the tensors into flat c continuous numpy array and cast back before return.
|
|
39
39
|
|
|
@@ -123,7 +123,7 @@ def _cast_lambdify_c(
|
|
|
123
123
|
return torch.from_numpy(out).reshape(shape)
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
def _lambdify_c(code: str) ->
|
|
126
|
+
def _lambdify_c(code: str) -> callable:
|
|
127
127
|
"""Compile the C source code and import the func.
|
|
128
128
|
|
|
129
129
|
Parameters
|
|
@@ -172,7 +172,7 @@ class _StreamAudioEquation(StreamAudio):
|
|
|
172
172
|
super().__init__(node)
|
|
173
173
|
self._signals_func = None # cache
|
|
174
174
|
|
|
175
|
-
def _get_signals_func(self) ->
|
|
175
|
+
def _get_signals_func(self) -> callable:
|
|
176
176
|
"""Allow to "compile" equations at the last moment."""
|
|
177
177
|
if self._signals_func is None:
|
|
178
178
|
free_symbs = Tuple(*self.node.signals).free_symbols
|
|
@@ -159,7 +159,7 @@ class _StreamVideoEquation(StreamVideo):
|
|
|
159
159
|
self._fields = None # cache
|
|
160
160
|
self._fileds_mask = None
|
|
161
161
|
|
|
162
|
-
def _get_colors_func(self) ->
|
|
162
|
+
def _get_colors_func(self) -> callable:
|
|
163
163
|
"""Allow to "compile" equations at the last moment."""
|
|
164
164
|
if self._colors_func is None:
|
|
165
165
|
free_symbs = Tuple(*self.node.colors).free_symbols
|
|
@@ -33,7 +33,7 @@ def _resize(image: np.ndarray, shape: tuple[int, int], copy: bool) -> np.ndarray
|
|
|
33
33
|
image = cv2.resize( # 10 times faster than torchvision.transforms.v2.functional.resize
|
|
34
34
|
image,
|
|
35
35
|
dsize=(width, height),
|
|
36
|
-
interpolation=(cv2.
|
|
36
|
+
interpolation=(cv2.INTER_LANCZOS4 if enlarge else cv2.INTER_AREA), # for antialiasing
|
|
37
37
|
)
|
|
38
38
|
if enlarge and np.issubdtype(image.dtype, np.floating):
|
|
39
39
|
image = np.clip(image, 0.0, 1.0, out=image)
|
|
@@ -224,12 +224,12 @@ class FilterVideoResize(Filter):
|
|
|
224
224
|
>>> (stream_out,) = FilterVideoResize([stream_in], (4, 6), keep_ratio=True).out_streams
|
|
225
225
|
>>> stream_out.snapshot(0, (8, 9)).convert(1)[..., 0]
|
|
226
226
|
tensor([[0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
|
|
227
|
-
[0.
|
|
228
|
-
[0.
|
|
229
|
-
[0.
|
|
230
|
-
[0.
|
|
231
|
-
[0.
|
|
232
|
-
[0.
|
|
227
|
+
[0.5866, 0.4670, 0.3995, 0.4464, 0.4259, 0.3350, 0.1897, 0.1025, 0.1142],
|
|
228
|
+
[0.5095, 0.6204, 0.6410, 0.4723, 0.3990, 0.4812, 0.5390, 0.4913, 0.4245],
|
|
229
|
+
[0.4987, 0.6738, 0.7806, 0.6340, 0.5265, 0.6353, 0.7835, 0.7586, 0.6572],
|
|
230
|
+
[0.5877, 0.4707, 0.5004, 0.7429, 0.7577, 0.5788, 0.4987, 0.4818, 0.4790],
|
|
231
|
+
[0.6685, 0.3844, 0.1571, 0.4173, 0.7007, 0.5451, 0.2300, 0.3524, 0.6429],
|
|
232
|
+
[0.7850, 0.4343, 0.0535, 0.0743, 0.5272, 0.5781, 0.1937, 0.4503, 0.9598],
|
|
233
233
|
[0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000]])
|
|
234
234
|
>>> stream_out.snapshot(0, (4, 3)).convert(1)[..., 0]
|
|
235
235
|
tensor([[0.0000, 0.0000, 0.0000],
|
|
@@ -247,26 +247,26 @@ class FilterVideoResize(Filter):
|
|
|
247
247
|
>>> # deformation
|
|
248
248
|
>>> (stream_out,) = FilterVideoResize([stream_in], (4, 6), keep_ratio=False).out_streams
|
|
249
249
|
>>> stream_out.snapshot(0, (8, 9))[..., 0]
|
|
250
|
-
tensor([[0.
|
|
251
|
-
[0.
|
|
252
|
-
[0.
|
|
253
|
-
[0.
|
|
254
|
-
[0.
|
|
255
|
-
[0.
|
|
256
|
-
[0.
|
|
257
|
-
[
|
|
250
|
+
tensor([[0.5186, 0.2040, 0.1217, 0.6263, 1.0000, 0.8228, 0.4027, 0.5082, 0.8317],
|
|
251
|
+
[0.5837, 0.4015, 0.2937, 0.5282, 0.8607, 0.8669, 0.5844, 0.4760, 0.5484],
|
|
252
|
+
[0.6039, 0.6970, 0.5962, 0.3657, 0.5604, 0.9367, 0.8844, 0.4597, 0.1515],
|
|
253
|
+
[0.4040, 0.7688, 0.7883, 0.2821, 0.3852, 0.9566, 1.0000, 0.5497, 0.1524],
|
|
254
|
+
[0.1668, 0.6130, 0.7582, 0.3105, 0.4186, 0.9009, 0.9197, 0.6914, 0.5459],
|
|
255
|
+
[0.2929, 0.5605, 0.6228, 0.3390, 0.4971, 0.8122, 0.7501, 0.7327, 0.8138],
|
|
256
|
+
[0.7253, 0.6989, 0.5109, 0.3182, 0.5178, 0.7448, 0.6579, 0.6546, 0.7545],
|
|
257
|
+
[1.0000, 0.8142, 0.4661, 0.2942, 0.5099, 0.7171, 0.6343, 0.5901, 0.6479]])
|
|
258
258
|
>>> stream_out.snapshot(0, (4, 3))[..., 0]
|
|
259
|
-
tensor([[0.
|
|
260
|
-
[0.
|
|
261
|
-
[0.
|
|
262
|
-
[0.
|
|
259
|
+
tensor([[0.2721, 0.9769, 0.4960],
|
|
260
|
+
[0.7737, 0.4440, 0.4901],
|
|
261
|
+
[0.5577, 0.4625, 0.7313],
|
|
262
|
+
[0.7737, 0.5130, 0.6131]])
|
|
263
263
|
>>> stream_out.snapshot(0, (6, 5))[..., 0]
|
|
264
|
-
tensor([[0.
|
|
265
|
-
[0.
|
|
266
|
-
[0.
|
|
267
|
-
[0.
|
|
268
|
-
[0.
|
|
269
|
-
[0.
|
|
264
|
+
tensor([[0.4298, 0.1972, 1.0000, 0.4729, 0.7146],
|
|
265
|
+
[0.6007, 0.4248, 0.7106, 0.7914, 0.3603],
|
|
266
|
+
[0.5545, 0.6820, 0.3978, 1.0000, 0.2288],
|
|
267
|
+
[0.2864, 0.6698, 0.4334, 0.9205, 0.6380],
|
|
268
|
+
[0.5371, 0.5082, 0.5150, 0.7171, 0.7786],
|
|
269
|
+
[0.9398, 0.4087, 0.5103, 0.6623, 0.6369]])
|
|
270
270
|
>>>
|
|
271
271
|
"""
|
|
272
272
|
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
/* Fast generation of fractal. */
|
|
2
2
|
|
|
3
3
|
#define PY_SSIZE_T_CLEAN
|
|
4
|
-
// for detection and management of nestead threads
|
|
5
|
-
#include <unistd.h>
|
|
6
|
-
#include <sys/syscall.h>
|
|
7
|
-
#ifndef SYS_gettid
|
|
8
|
-
#error 'SYS_gettid unavailable on this system'
|
|
9
|
-
#endif
|
|
10
|
-
#define gettid() ((pid_t)syscall(SYS_gettid))
|
|
11
|
-
// classical imports
|
|
12
4
|
#include <numpy/arrayobject.h>
|
|
13
5
|
#include <omp.h>
|
|
14
6
|
#include <complex.h>
|
|
15
7
|
#include <Python.h>
|
|
8
|
+
#include "cutcutcodec/core/opti/parallel/threading.h"
|
|
16
9
|
|
|
17
10
|
|
|
18
11
|
float compute_mandelbrot_longdouble(
|
|
@@ -212,7 +205,7 @@ void mandelbrot_double(float* iters, double* cst_reals, double* cst_imags, const
|
|
|
212
205
|
}
|
|
213
206
|
|
|
214
207
|
|
|
215
|
-
static PyObject* py_mandelbrot(PyObject* self, PyObject* args, PyObject* kwargs) {
|
|
208
|
+
static PyObject* py_mandelbrot(PyObject* Py_UNUSED(self), PyObject* args, PyObject* kwargs) {
|
|
216
209
|
// declaration
|
|
217
210
|
static char *kwlist[] = {"cpx_plan", "iterations", "inper2", "threads", "out", NULL};
|
|
218
211
|
PyArrayObject *cpx_plan, *fractal = NULL;
|
|
@@ -220,7 +213,6 @@ static PyObject* py_mandelbrot(PyObject* self, PyObject* args, PyObject* kwargs)
|
|
|
220
213
|
int inper2 = 1;
|
|
221
214
|
npy_intp shape[2];
|
|
222
215
|
|
|
223
|
-
|
|
224
216
|
// parse and check
|
|
225
217
|
if ( !PyArg_ParseTupleAndKeywords(
|
|
226
218
|
args, kwargs, "O!|l$plO!", kwlist,
|
|
@@ -239,17 +231,7 @@ static PyObject* py_mandelbrot(PyObject* self, PyObject* args, PyObject* kwargs)
|
|
|
239
231
|
}
|
|
240
232
|
|
|
241
233
|
// set omp nbr threads
|
|
242
|
-
|
|
243
|
-
if ( gettid() == getpid() ) {
|
|
244
|
-
omp_set_num_threads(omp_get_num_procs());
|
|
245
|
-
} else {
|
|
246
|
-
omp_set_num_threads(1);
|
|
247
|
-
}
|
|
248
|
-
} else if ( threads < 0 ) {
|
|
249
|
-
omp_set_num_threads(omp_get_num_procs());
|
|
250
|
-
} else {
|
|
251
|
-
omp_set_num_threads(threads);
|
|
252
|
-
}
|
|
234
|
+
set_num_threads(threads);
|
|
253
235
|
|
|
254
236
|
// alloc fractal
|
|
255
237
|
if ( fractal == NULL ) {
|
|
@@ -299,61 +281,61 @@ static PyObject* py_mandelbrot(PyObject* self, PyObject* args, PyObject* kwargs)
|
|
|
299
281
|
|
|
300
282
|
static PyMethodDef fractalMethods[] = {
|
|
301
283
|
{
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
284
|
+
"mandelbrot", (PyCFunction)py_mandelbrot, METH_VARARGS | METH_KEYWORDS,
|
|
285
|
+
R"(Compute a mandelbrot grayscale image in C language.
|
|
286
|
+
|
|
287
|
+
For each pixel, given by a complex point :math:`c`, compute :math:`n` iterations of the suite:
|
|
288
|
+
|
|
289
|
+
.. math::
|
|
290
|
+
|
|
291
|
+
\begin{cases}
|
|
292
|
+
z_0 = 0 \\
|
|
293
|
+
z_{n+1} = z_n^2 + c \\
|
|
294
|
+
\end{cases}
|
|
295
|
+
|
|
296
|
+
Parameters
|
|
297
|
+
----------
|
|
298
|
+
cpx_plan : np.ndarray
|
|
299
|
+
The 2d complex plane that associates the constant :math:`c` to each pixel.
|
|
300
|
+
If the real part is ``nan``, The corresponding pixel will not be initialized.
|
|
301
|
+
This array doesn't has to be c contiguous.
|
|
302
|
+
iterations : int, default=256
|
|
303
|
+
The maximum number of iterations before declaring that the sequence does not diverge.
|
|
304
|
+
It must be >= 1 and <= 2147483647.
|
|
305
|
+
inper2 : boolean, default=True
|
|
306
|
+
If True (default), performs a test for each pixel to determine whether
|
|
307
|
+
the pixel in question is in the cardioid or in the main disk.
|
|
308
|
+
If False, calculates the sequence directly without prior testing.
|
|
309
|
+
threads : int, optional
|
|
310
|
+
Defines the number of threads.
|
|
311
|
+
The value -1 means that the function uses as many calculation threads as there are cores.
|
|
312
|
+
The default value (0) allows the same behavior as (-1) if the function
|
|
313
|
+
is called in the main thread, otherwise (1) to avoid nested threads.
|
|
314
|
+
Any other positive value corresponds to the number of threads used.
|
|
315
|
+
out : np.ndarray[np.float32], optional
|
|
316
|
+
If provided, set the result in this array and return it.
|
|
317
|
+
This array doesn't has to be c contiguous.
|
|
318
|
+
|
|
319
|
+
Returns
|
|
320
|
+
-------
|
|
321
|
+
fractal : np.ndarray[np.float32]
|
|
322
|
+
The convergence speed of the suite in [0, 1].
|
|
323
|
+
1 means it converges and 0 it diverges.
|
|
324
|
+
The shape is the same as ``cpx_plan``.
|
|
325
|
+
|
|
326
|
+
Examples
|
|
327
|
+
--------
|
|
328
|
+
>>> import numpy as np
|
|
329
|
+
>>> from cutcutcodec.core.generation.video.fractal.fractal import mandelbrot
|
|
330
|
+
>>> y, x = np.meshgrid(
|
|
331
|
+
... np.linspace(1, -1, 2000, dtype=np.float128), # imaginary part, -y axis
|
|
332
|
+
... np.linspace(-2, 1, 3000, dtype=np.float128), # real part, x axis
|
|
333
|
+
... indexing="ij",
|
|
334
|
+
... )
|
|
335
|
+
>>> cpx_plan = x + 1j*y
|
|
336
|
+
>>> fractal = mandelbrot(cpx_plan)
|
|
337
|
+
>>>
|
|
338
|
+
)"
|
|
357
339
|
},
|
|
358
340
|
{NULL, NULL, 0, NULL}
|
|
359
341
|
};
|
{cutcutcodec-1.2.1 → cutcutcodec-1.2.2}/cutcutcodec/core/generation/video/fractal/mandelbrot.py
RENAMED
|
@@ -123,7 +123,7 @@ class _StreamVideoMandelbrot(StreamVideo):
|
|
|
123
123
|
super().__init__(node)
|
|
124
124
|
self._bounds_func = None # cache
|
|
125
125
|
|
|
126
|
-
def _get_func(self) ->
|
|
126
|
+
def _get_func(self) -> callable:
|
|
127
127
|
"""Allow to "compile" bounds and iterations equations at the last moment."""
|
|
128
128
|
if self._bounds_func is None:
|
|
129
129
|
self._bounds_func = Lambdify(
|
|
@@ -8,37 +8,14 @@ import typing
|
|
|
8
8
|
|
|
9
9
|
from cutcutcodec.core.exceptions import DecodeError
|
|
10
10
|
from cutcutcodec.core.classes.node import Node
|
|
11
|
+
from .cst import AUDIO_SUFFIXES, VIDEO_SUFFIXES, IMAGE_SUFFIXES
|
|
11
12
|
from .read_ffmpeg_color import ContainerInputFFMPEGColor
|
|
12
13
|
from .read_image import ContainerInputImage
|
|
13
14
|
from .read_svg import ContainerInputSVG
|
|
14
15
|
from .write_ffmpeg import ContainerOutputFFMPEG
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
".avif",
|
|
19
|
-
".bmp", ".dib",
|
|
20
|
-
".exr",
|
|
21
|
-
".hdr", ".pic",
|
|
22
|
-
".heic",
|
|
23
|
-
".jp2", ".jpg2", ".jpeg2000", ".jpg2000",
|
|
24
|
-
".jpeg", ".jpg", ".jpe",
|
|
25
|
-
".kra",
|
|
26
|
-
".pbm", ".pgm", ".ppm", ".pxm", ".pnm",
|
|
27
|
-
".pfm",
|
|
28
|
-
".png",
|
|
29
|
-
".psd",
|
|
30
|
-
".sgi",
|
|
31
|
-
".sr", ".ras",
|
|
32
|
-
".tif", ".tiff",
|
|
33
|
-
".webp",
|
|
34
|
-
".xbm",
|
|
35
|
-
}
|
|
36
|
-
VIDEO_SUFFIXES = {
|
|
37
|
-
".avi", ".gif", ".m2ts", ".mkv", ".mp4", ".ogv", ".vob", ".webm"
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
__all__ = ["read", "IMAGE_SUFFIXES", "VIDEO_SUFFIXES"]
|
|
18
|
+
__all__ = ["read", "write", "AUDIO_SUFFIXES", "IMAGE_SUFFIXES", "VIDEO_SUFFIXES"]
|
|
42
19
|
|
|
43
20
|
|
|
44
21
|
def read(filename: typing.Union[str, bytes, pathlib.Path], **kwargs) -> Node:
|
|
@@ -66,7 +43,7 @@ def read(filename: typing.Union[str, bytes, pathlib.Path], **kwargs) -> Node:
|
|
|
66
43
|
extension = pathlib.Path(filename).suffix.lower()
|
|
67
44
|
|
|
68
45
|
# simple case where extension is knowned
|
|
69
|
-
if extension in VIDEO_SUFFIXES:
|
|
46
|
+
if extension in VIDEO_SUFFIXES | AUDIO_SUFFIXES:
|
|
70
47
|
return ContainerInputFFMPEGColor(filename, **kwargs)
|
|
71
48
|
if extension in IMAGE_SUFFIXES:
|
|
72
49
|
return ContainerInputImage(filename, **kwargs)
|
|
@@ -74,14 +51,14 @@ def read(filename: typing.Union[str, bytes, pathlib.Path], **kwargs) -> Node:
|
|
|
74
51
|
return ContainerInputSVG(filename, **kwargs)
|
|
75
52
|
|
|
76
53
|
# case we have to try
|
|
77
|
-
logging.warning("
|
|
54
|
+
logging.warning("unknown extension %s, try several readers", extension)
|
|
78
55
|
try:
|
|
79
56
|
return ContainerInputSVG(filename, **kwargs)
|
|
80
57
|
except DecodeError:
|
|
81
58
|
try:
|
|
82
|
-
return ContainerInputImage(filename, **kwargs)
|
|
83
|
-
except DecodeError:
|
|
84
59
|
return ContainerInputFFMPEGColor(filename, **kwargs)
|
|
60
|
+
except DecodeError:
|
|
61
|
+
return ContainerInputImage(filename, **kwargs)
|
|
85
62
|
|
|
86
63
|
|
|
87
64
|
def write(*args, **kwargs):
|