cutcutcodec 1.0.post3__py3-none-any.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.
Potentially problematic release.
This version of cutcutcodec might be problematic. Click here for more details.
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/__init__.py +6 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/__main__.py +38 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/c_build.py +33 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/_helper_properties.py +52 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/properties/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/properties/duration.py +83 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/ffprobe.py +637 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/find.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/time_backprop.py +68 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/rate_audio.py +239 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/rate_video.py +97 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/shape.py +107 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/time_backprop.py +183 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/duration.py +162 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/nb_frames.py +159 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/rate.py +102 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/timestamps.py +194 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/container.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/encoder.py +152 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/filter.py +33 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame.py +127 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame_audio.py +205 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame_video.py +322 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/layout.py +206 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/meta_filter.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/muxer.py +184 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/node.py +164 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream.py +182 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream_audio.py +130 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream_video.py +193 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/__init__.py +7 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/ast_to_file.py +125 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/__init__.py +6 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/compatibility.py +734 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/default.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/encodec.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/muxer.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/rate.py +133 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_ast.py +477 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_json.py +104 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_tree.py +190 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/json_to_graph.py +114 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/parse.py +123 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/__init__.py +15 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/dynamic.py +544 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py +612 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/preprocess.py +698 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/printer.py +926 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/tree_to_graph.py +168 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/decision/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/add.py +73 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/remove.py +476 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/exceptions.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/add.py +170 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/cat.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/cut.py +112 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/delay.py +85 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/equation.py +261 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/fir.py +231 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/identity.py +48 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/resample.py +451 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/subclip.py +91 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/cut.py +74 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/audio_cast.py +208 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/video_cast.py +197 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/subclip.py +53 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/add.py +331 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/cat.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/cut.py +113 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/delay.py +84 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/equation.py +265 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/identity.py +48 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/pad.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/subclip.py +91 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/empty.py +73 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/equation.py +56 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/noise.py +243 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/c_fractal.cpython-312-x86_64-linux-gnu.so +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/empty.py +69 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/equation.py +109 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/fractal.c +116 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/geometry.py +100 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/mandelbrot.py +176 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/noise.py +112 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/interfaces/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/interfaces/seedable.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/read_ffmpeg.py +904 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/read_svg.py +145 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/scheduler.py +356 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/write.py +340 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/basic.py +35 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/clean/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/clean/graph.py +80 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/hashes/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/hashes/graph.py +81 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/singleton.py +47 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cuda/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/factor/__init__.py +5 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/factor/proba.py +189 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/generalize/__init__.py +5 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/generalize/delay_to_fir.py +88 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/graph.py +17 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/parallel/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/parallel/buffer.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/utils.py +34 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/audio_5.1_narration.oga +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/intro.webm +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/logo.svg +13 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/project.json +226 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/video.mp4 +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/__main__.py +25 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/actions.py +63 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/app/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/app/app.py +248 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/base.py +50 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/container_input_ffmpeg.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_delay.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_equation.py +45 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_fir.py +58 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_subclip.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_cut.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_delay.py +20 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_subclip.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_delay.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_equation.py +53 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_subclip.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_equation.py +14 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_noise.py +19 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_equation.py +13 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_mandelbrot.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_noise.py +18 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/base.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/default.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/documentation.py +47 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/general.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/interface.py +305 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/loader.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/main.py +62 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edition_tabs.py +34 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/base.py +122 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/filters.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/generators.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry_tabs.py +46 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/_helper.py +54 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/container.py +226 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/doc.py +67 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/encodec.py +289 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/main.py +173 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/edge_properties.py +56 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/main.py +280 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/node.py +44 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/main.py +151 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/menu.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/audio_settings.py +183 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/main.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/video_settings.py +257 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/run.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/main.py +30 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/slider.py +286 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/track.py +97 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/view.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/toolbar.py +29 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/tools.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/audio_player.py +103 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/control.py +96 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/frame_extractor.py +254 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/main.py +115 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/__main__.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/coding_style.py +49 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/generation.py +52 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/install.py +72 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/run.py +58 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/abstract.py +215 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/audio_cast.py +35 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/audio_equation.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/c_memory.py +132 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/compatibility.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/compile.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/encoder.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_cut.py +107 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_delay.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_empty.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/fir.py +143 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/hashes.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/initialisation.py +24 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/muxer.py +22 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/nan_snapshot.py +39 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/read.py +192 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/serialization_equality.py +50 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/snapshot_shape.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/sympy_to_torch.py +135 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/thread_safe.py +77 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/time_range.py +55 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/video_equation.py +77 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/write.py +95 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/utils.py +40 -0
- cutcutcodec-1.0.post3.dist-info/LICENSE +7 -0
- cutcutcodec-1.0.post3.dist-info/METADATA +271 -0
- cutcutcodec-1.0.post3.dist-info/RECORD +233 -0
- cutcutcodec-1.0.post3.dist-info/WHEEL +5 -0
- cutcutcodec-1.0.post3.dist-info/entry_points.txt +6 -0
- cutcutcodec-1.0.post3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Allow to generate a fractal annimation."""
|
|
4
|
+
|
|
5
|
+
from fractions import Fraction
|
|
6
|
+
import math
|
|
7
|
+
import numbers
|
|
8
|
+
import typing
|
|
9
|
+
|
|
10
|
+
from sympy.core.basic import Basic
|
|
11
|
+
from sympy.core.symbol import Symbol
|
|
12
|
+
import torch
|
|
13
|
+
|
|
14
|
+
from cutcutcodec.core.classes.container import ContainerInput
|
|
15
|
+
from cutcutcodec.core.classes.stream import Stream
|
|
16
|
+
from cutcutcodec.core.classes.stream_video import StreamVideo
|
|
17
|
+
from cutcutcodec.core.compilation.parse import parse_to_sympy
|
|
18
|
+
from cutcutcodec.core.compilation.sympy_to_torch import Lambdify
|
|
19
|
+
from cutcutcodec.core.exceptions import OutOfTimeRange
|
|
20
|
+
from cutcutcodec.core.generation.video.c_fractal import mandelbrot
|
|
21
|
+
from cutcutcodec.core.generation.video.fractal.geometry import deduce_all_bounds
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class GeneratorVideoMandelbrot(ContainerInput):
|
|
25
|
+
"""Generation of an annimated mandelbrot fractal.
|
|
26
|
+
|
|
27
|
+
Attributes
|
|
28
|
+
----------
|
|
29
|
+
bounds : tuple[sympy.core.expr.Expr, ...]
|
|
30
|
+
The four i_min, i_max, j_min and j_max bounds expressions of `t` (readonly).
|
|
31
|
+
iterations : sympy.core.expr.Expr
|
|
32
|
+
The maximum number of iterations function based on `t` (readonly).
|
|
33
|
+
|
|
34
|
+
Examples
|
|
35
|
+
--------
|
|
36
|
+
>>> from cutcutcodec.core.generation.video.fractal.mandelbrot import GeneratorVideoMandelbrot
|
|
37
|
+
>>> (stream,) = GeneratorVideoMandelbrot.default().out_streams
|
|
38
|
+
>>> stream.snapshot(0, (10, 8))[..., 0]
|
|
39
|
+
tensor([[ 0, 1, 2, 2, 2, 4, 2, 1],
|
|
40
|
+
[ 0, 1, 2, 2, 3, 16, 4, 2],
|
|
41
|
+
[ 0, 2, 2, 3, 37, 255, 255, 4],
|
|
42
|
+
[ 0, 3, 7, 6, 255, 255, 255, 7],
|
|
43
|
+
[ 0, 4, 10, 255, 255, 255, 255, 4],
|
|
44
|
+
[ 0, 4, 10, 255, 255, 255, 255, 4],
|
|
45
|
+
[ 0, 3, 7, 6, 255, 255, 255, 7],
|
|
46
|
+
[ 0, 2, 2, 3, 37, 255, 255, 4],
|
|
47
|
+
[ 0, 1, 2, 2, 3, 16, 4, 2],
|
|
48
|
+
[ 0, 1, 2, 2, 2, 4, 2, 1]], dtype=torch.uint8)
|
|
49
|
+
>>>
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
def __init__(
|
|
53
|
+
self,
|
|
54
|
+
bounds: dict[str, typing.Union[Basic, numbers.Real, str]],
|
|
55
|
+
iterations: typing.Union[Basic, numbers.Real, str] = 256,
|
|
56
|
+
):
|
|
57
|
+
"""Initialise and create the class.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
bounds : dict[str, str or sympy.Basic]
|
|
62
|
+
The 4 bounds expressions of the complex plan limit of pixels.
|
|
63
|
+
The admitted keys are defined in
|
|
64
|
+
``cutcutcodec.core.generation.video.fractal.geometry.SYMBOLS``.
|
|
65
|
+
If an expression is used, only the symbol `t` is available.
|
|
66
|
+
iterations : str or sympy.Basic
|
|
67
|
+
The expression of the maximum iterations number.
|
|
68
|
+
If a function is used, only the symbol `t` is available.
|
|
69
|
+
The final value is the integer part of the result. It has to be > 0.
|
|
70
|
+
"""
|
|
71
|
+
assert isinstance(bounds, dict), bounds.__class__.__name__
|
|
72
|
+
assert all(isinstance(name, str) for name in bounds), bounds
|
|
73
|
+
all_bounds = {
|
|
74
|
+
name: parse_to_sympy(expr, symbols={"t": Symbol("t", real=True, positive=True)})
|
|
75
|
+
for name, expr in bounds.items()
|
|
76
|
+
}
|
|
77
|
+
assert all(set(map(str, e.free_symbols)).issubset({"t"}) for e in all_bounds.values())
|
|
78
|
+
all_bounds = deduce_all_bounds(**all_bounds)
|
|
79
|
+
iters = parse_to_sympy(iterations, symbols={"t": Symbol("t", real=True, positive=True)})
|
|
80
|
+
|
|
81
|
+
self._bounds = (
|
|
82
|
+
all_bounds["i_min"],
|
|
83
|
+
all_bounds["i_max"],
|
|
84
|
+
all_bounds["j_min"],
|
|
85
|
+
all_bounds["j_max"],
|
|
86
|
+
)
|
|
87
|
+
self._iters = iters
|
|
88
|
+
|
|
89
|
+
super().__init__([_StreamVideoMandelbrot(self)])
|
|
90
|
+
|
|
91
|
+
def _getstate(self) -> dict:
|
|
92
|
+
return {
|
|
93
|
+
"bounds": dict(zip(("i_min", "i_max", "j_min", "j_max"), map(str, self._bounds))),
|
|
94
|
+
"iterations": str(self.iterations),
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
def _setstate(self, in_streams: typing.Iterable[Stream], state: dict) -> None:
|
|
98
|
+
assert state.keys() == {"bounds", "iterations"}, set(state)
|
|
99
|
+
GeneratorVideoMandelbrot.__init__(self, **state)
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def bounds(self) -> tuple[Basic, Basic, Basic, Basic]:
|
|
103
|
+
"""Return the four i_min, i_max, j_min and j_max bounds expressions of `t`."""
|
|
104
|
+
return self._bounds
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def default(cls):
|
|
108
|
+
"""Provide a minimalist example of an instance of this node."""
|
|
109
|
+
return cls(
|
|
110
|
+
bounds={"i_min": -1.12, "i_max": 1.12, "j_min": -2.0, "j_max": 0.47},
|
|
111
|
+
iterations=256,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def iterations(self) -> Basic:
|
|
116
|
+
"""Return the maximum number of iterations function based on `t`."""
|
|
117
|
+
return self._iters
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class _StreamVideoMandelbrot(StreamVideo):
|
|
121
|
+
"""Fractal video stream."""
|
|
122
|
+
|
|
123
|
+
is_space_continuous = True
|
|
124
|
+
is_time_continuous = True
|
|
125
|
+
|
|
126
|
+
def __init__(self, node: GeneratorVideoMandelbrot):
|
|
127
|
+
assert isinstance(node, GeneratorVideoMandelbrot), node.__class__.__name__
|
|
128
|
+
super().__init__(node)
|
|
129
|
+
self._bounds_func = None # cache
|
|
130
|
+
|
|
131
|
+
def _get_func(self) -> callable:
|
|
132
|
+
"""Allow to "compile" bounds and iterations equations at the last moment."""
|
|
133
|
+
if self._bounds_func is None:
|
|
134
|
+
self._bounds_func = Lambdify(
|
|
135
|
+
(*self.node.bounds, self.node.iterations),
|
|
136
|
+
safe=False,
|
|
137
|
+
compile=False,
|
|
138
|
+
)
|
|
139
|
+
return self._bounds_func
|
|
140
|
+
|
|
141
|
+
def _get_complex_map_and_iter_max(
|
|
142
|
+
self, timestamp: Fraction, mask: torch.Tensor
|
|
143
|
+
) -> tuple[torch.Tensor, torch.Tensor, int]:
|
|
144
|
+
"""Compute the complex map, one complex number by pixel."""
|
|
145
|
+
func = self._get_func()
|
|
146
|
+
args = {"t": torch.tensor(timestamp, dtype=torch.float32)} if "t" in func.args else {}
|
|
147
|
+
i_min, i_max, j_min, j_max, iters = func(*args)
|
|
148
|
+
iter_max = int(iters.item())
|
|
149
|
+
assert iter_max > 0, \
|
|
150
|
+
f"for t={timestamp}, {self.node.iterations} gives {iter_max}, it has to be > 0"
|
|
151
|
+
i_min, i_max, j_min, j_max = i_min.item(), i_max.item(), j_min.item(), j_max.item()
|
|
152
|
+
imag, real = torch.meshgrid(
|
|
153
|
+
torch.linspace(i_min, i_max, mask.shape[0], dtype=torch.double),
|
|
154
|
+
torch.linspace(j_min, j_max, mask.shape[1], dtype=torch.double),
|
|
155
|
+
indexing="ij",
|
|
156
|
+
)
|
|
157
|
+
return real, imag, iter_max
|
|
158
|
+
|
|
159
|
+
def _snapshot(self, timestamp: Fraction, mask: torch.Tensor) -> torch.Tensor:
|
|
160
|
+
if timestamp < 0:
|
|
161
|
+
raise OutOfTimeRange(f"there is no audio frame at timestamp {timestamp} (need >= 0)")
|
|
162
|
+
|
|
163
|
+
real, imag, iter_max = self._get_complex_map_and_iter_max(timestamp, mask)
|
|
164
|
+
real = self._to_masked_items(real, mask)
|
|
165
|
+
imag = self._to_masked_items(imag, mask)
|
|
166
|
+
iterations = mandelbrot(real.numpy(force=True), imag.numpy(force=True), iter_max)
|
|
167
|
+
frame = self._from_masked_items(torch.from_numpy(iterations), mask)
|
|
168
|
+
return frame
|
|
169
|
+
|
|
170
|
+
@property
|
|
171
|
+
def beginning(self) -> Fraction:
|
|
172
|
+
return Fraction(0)
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
def duration(self) -> typing.Union[Fraction, float]:
|
|
176
|
+
return math.inf
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Generate a video noise signal."""
|
|
4
|
+
|
|
5
|
+
from fractions import Fraction
|
|
6
|
+
import hashlib
|
|
7
|
+
import math
|
|
8
|
+
import numbers
|
|
9
|
+
import struct
|
|
10
|
+
import typing
|
|
11
|
+
|
|
12
|
+
import numpy as np
|
|
13
|
+
import torch
|
|
14
|
+
|
|
15
|
+
from cutcutcodec.core.classes.container import ContainerInput
|
|
16
|
+
from cutcutcodec.core.classes.stream import Stream
|
|
17
|
+
from cutcutcodec.core.classes.stream_video import StreamVideo
|
|
18
|
+
from cutcutcodec.core.exceptions import OutOfTimeRange
|
|
19
|
+
from cutcutcodec.core.interfaces.seedable import Seedable
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class GeneratorVideoNoise(ContainerInput, Seedable):
|
|
23
|
+
"""Generate a pure noise video signal.
|
|
24
|
+
|
|
25
|
+
Examples
|
|
26
|
+
--------
|
|
27
|
+
>>> from cutcutcodec.core.generation.video.noise import GeneratorVideoNoise
|
|
28
|
+
>>> stream = GeneratorVideoNoise(0).out_streams[0]
|
|
29
|
+
>>> stream.snapshot(0, (13, 9))[..., 0]
|
|
30
|
+
tensor([[127, 38, 184, 235, 108, 176, 146, 203, 68],
|
|
31
|
+
[217, 228, 36, 60, 186, 75, 202, 203, 185],
|
|
32
|
+
[228, 143, 82, 179, 157, 172, 151, 115, 208],
|
|
33
|
+
[221, 219, 169, 189, 199, 214, 134, 31, 23],
|
|
34
|
+
[177, 214, 12, 12, 86, 199, 62, 111, 143],
|
|
35
|
+
[168, 24, 114, 190, 101, 49, 46, 13, 11],
|
|
36
|
+
[217, 230, 254, 40, 216, 192, 196, 67, 127],
|
|
37
|
+
[157, 214, 66, 65, 72, 153, 65, 129, 147],
|
|
38
|
+
[ 24, 92, 187, 202, 171, 182, 40, 63, 240],
|
|
39
|
+
[245, 219, 159, 178, 73, 59, 230, 141, 139],
|
|
40
|
+
[197, 101, 129, 185, 46, 35, 80, 4, 156],
|
|
41
|
+
[156, 145, 73, 60, 130, 234, 92, 195, 18],
|
|
42
|
+
[ 25, 21, 156, 202, 142, 104, 225, 45, 57]], dtype=torch.uint8)
|
|
43
|
+
>>>
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(self, seed: typing.Optional[numbers.Real] = None):
|
|
47
|
+
"""Initialise and create the class.
|
|
48
|
+
|
|
49
|
+
Parameters
|
|
50
|
+
----------
|
|
51
|
+
seed : numbers.Real, optional
|
|
52
|
+
Transmitted to ``cutcutcodec.core.interfaces.seedable.Seedable``.
|
|
53
|
+
"""
|
|
54
|
+
Seedable.__init__(self, seed)
|
|
55
|
+
super().__init__([_StreamVideoNoiseUniform(self)])
|
|
56
|
+
|
|
57
|
+
def _getstate(self) -> dict:
|
|
58
|
+
return self._getstate_seed()
|
|
59
|
+
|
|
60
|
+
def _setstate(self, in_streams: typing.Iterable[Stream], state: dict) -> None:
|
|
61
|
+
assert state.keys() == {"seed"}, set(state)
|
|
62
|
+
self._setstate_seed(state)
|
|
63
|
+
ContainerInput.__init__(self, [_StreamVideoNoiseUniform(self)])
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def default(cls):
|
|
67
|
+
"""Provide a minimalist example of an instance of this node."""
|
|
68
|
+
return cls(0)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class _StreamVideoNoiseUniform(StreamVideo):
|
|
72
|
+
"""Random video stream where each pixel follows a uniform law."""
|
|
73
|
+
|
|
74
|
+
is_space_continuous = True
|
|
75
|
+
is_time_continuous = True
|
|
76
|
+
|
|
77
|
+
def __init__(self, node: GeneratorVideoNoise):
|
|
78
|
+
assert isinstance(node, GeneratorVideoNoise), node.__class__.__name__
|
|
79
|
+
super().__init__(node)
|
|
80
|
+
|
|
81
|
+
def _snapshot(self, timestamp: Fraction, mask: torch.Tensor) -> torch.Tensor:
|
|
82
|
+
if timestamp < 0:
|
|
83
|
+
raise OutOfTimeRange(f"there is no audio frame at timestamp {timestamp} (need >= 0)")
|
|
84
|
+
seed = int.from_bytes(
|
|
85
|
+
hashlib.md5(
|
|
86
|
+
struct.pack(
|
|
87
|
+
"dLL",
|
|
88
|
+
self.node.seed,
|
|
89
|
+
timestamp.numerator % (1 << 64),
|
|
90
|
+
timestamp.denominator % (1 << 64),
|
|
91
|
+
)
|
|
92
|
+
).digest(),
|
|
93
|
+
byteorder="big",
|
|
94
|
+
) % (1 << 64) # solve RuntimeError: Overflow when unpacking long
|
|
95
|
+
return torch.from_numpy(
|
|
96
|
+
np.random.Generator(np.random.SFC64(seed=seed)) # np.random.default_rng(seed=seed)
|
|
97
|
+
.random((*mask.shape, 3), dtype=np.float32)
|
|
98
|
+
)
|
|
99
|
+
# numpy 1.24.1 vs torch 2.0.0 is 11 times faster
|
|
100
|
+
# this version is faster:
|
|
101
|
+
# return torch.from_numpy(
|
|
102
|
+
# np.random.Generator(np.random.SFC64(seed=seed)) # np.random.default_rng(seed=seed)
|
|
103
|
+
# .integers(0, 256, (*mask.shape, 3), dtype=np.uint8)
|
|
104
|
+
# )
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def beginning(self) -> Fraction:
|
|
108
|
+
return Fraction(0)
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def duration(self) -> typing.Union[Fraction, float]:
|
|
112
|
+
return math.inf
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Interface for the nodes that require a random seed."""
|
|
4
|
+
|
|
5
|
+
import hashlib
|
|
6
|
+
import numbers
|
|
7
|
+
import random
|
|
8
|
+
import struct
|
|
9
|
+
import typing
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Seedable:
|
|
13
|
+
"""Interface for appening a seed management.
|
|
14
|
+
|
|
15
|
+
Attributes
|
|
16
|
+
----------
|
|
17
|
+
seed : float
|
|
18
|
+
The value of the seed between [0, 1[ (readonly).
|
|
19
|
+
seed_bytes : bytes
|
|
20
|
+
The hashed version of the seed.
|
|
21
|
+
Contains 32 bytes, ie 256 bits.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
def __init__(self, seed: typing.Optional[numbers.Real] = None):
|
|
25
|
+
"""Initialise and create the class.
|
|
26
|
+
|
|
27
|
+
Parameters
|
|
28
|
+
----------
|
|
29
|
+
seed : numbers.Real, optional
|
|
30
|
+
The random seed to have a repeatability.
|
|
31
|
+
The value must be between 0 included and 1 excluded.
|
|
32
|
+
If not provided, the seed is chosen randomly.
|
|
33
|
+
"""
|
|
34
|
+
if seed is None:
|
|
35
|
+
seed = random.random()
|
|
36
|
+
assert isinstance(seed, numbers.Real), seed.__class__.__name__
|
|
37
|
+
assert 0 <= seed < 1, seed
|
|
38
|
+
self._seed = float(seed)
|
|
39
|
+
self._seed_bytes = None
|
|
40
|
+
|
|
41
|
+
def _getstate_seed(self, state: typing.Optional[dict] = None) -> dict:
|
|
42
|
+
"""Fast helper for getstate."""
|
|
43
|
+
if state is None:
|
|
44
|
+
return {"seed": self._seed}
|
|
45
|
+
return state | {"seed": self._seed}
|
|
46
|
+
|
|
47
|
+
def _setstate_seed(self, state: dict) -> None:
|
|
48
|
+
"""Fast helper for setstate."""
|
|
49
|
+
Seedable.__init__(self, state["seed"])
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def seed(self) -> float:
|
|
53
|
+
"""Return the value of the seed between 0 and 1.
|
|
54
|
+
|
|
55
|
+
Examples
|
|
56
|
+
--------
|
|
57
|
+
>>> from fractions import Fraction
|
|
58
|
+
>>> from cutcutcodec.core.interfaces.seedable import Seedable
|
|
59
|
+
>>> Seedable(0).seed # int
|
|
60
|
+
0.0
|
|
61
|
+
>>> Seedable(Fraction(1, 2)).seed # fraction
|
|
62
|
+
0.5
|
|
63
|
+
>>> Seedable(0.5).seed # float
|
|
64
|
+
0.5
|
|
65
|
+
>>>
|
|
66
|
+
"""
|
|
67
|
+
return self._seed
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def seed_bytes(self) -> bytes:
|
|
71
|
+
r"""Return the bytes seed string, containing 256 bits.
|
|
72
|
+
|
|
73
|
+
Examples
|
|
74
|
+
--------
|
|
75
|
+
>>> from cutcutcodec.core.interfaces.seedable import Seedable
|
|
76
|
+
>>> Seedable(0.25).seed_bytes
|
|
77
|
+
b"'/x\x03m\xb6r\x1f|\xf7DC\x15\xe5\xf66\x04&\xd1L=Dmj\xe8\xa8\x9e\xf7\r\x13@\x02"
|
|
78
|
+
>>>
|
|
79
|
+
"""
|
|
80
|
+
if self._seed_bytes is None:
|
|
81
|
+
self._seed_bytes = hashlib.sha256(struct.pack("d", self._seed)).digest()
|
|
82
|
+
return self._seed_bytes
|