# avisynth/avisynthplus architecture

> Architecture diagram of the GitHub repository avisynth/avisynthplus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/avisynth/avisynthplus
- Repository: https://github.com/avisynth/avisynthplus

## Overview

AviSynth+ is a scriptable video frameserver: a host uses its API to create a script environment, scripts describe clip/filter operations, and the resulting clips provide frames to the host. Its capabilities include built-in video and audio filters, format conversion and resampling, plugin loading, AVI input, and CPU/device-aware processing. The graph preserves major subsystems from the tree and source index; some filter and plugin relationships are documented only by their module locations, so those links are dashed and unverified.

Main entry points: [`avs_core/core/InternalEnvironment.h`](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/InternalEnvironment.h) (Script Environment), [`avs_core/convert/convert_planar.cpp`](https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert_planar.cpp) (Pixel Conversion), [`avs_core/core/FilterGraph.cpp`](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/FilterGraph.cpp) (Filter Graph), [`avs_core/core/parser/scriptparser.cpp`](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/parser/scriptparser.cpp) (Script Parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Host API and Runtime"]
  node_api_surface["Plugin API<br/>[avisynth.h]"]
  node_environment["Script Environment"]
  node_runtime_core["Runtime Core<br/>[internal.h]"]
  node_strings["Runtime Strings<br/>[strings.h]"]
end

subgraph group_script["Scripting and Plugins"]
  node_parser["Script Parser<br/>[scriptparser.cpp]"]
  node_expressions["Expression Engine<br/>[expression.h]"]
  node_function_api["Function Dispatch<br/>[function.h]"]
  node_plugins["Plugin Manager<br/>[PluginManager.cpp]"]
  node_filter_graph["Filter Graph<br/>[FilterGraph.cpp]"]
end

subgraph group_media["Media Processing"]
  node_builtin_filters["Built-in Filters<br/>[source.cpp]"]
  node_expression_filter["Expr Filter<br/>[exprfilter.cpp]"]
  node_resampling["Resampling<br/>[resample.cpp]"]
  node_resample_api["Resample Definitions<br/>[resample.h]"]
  node_conversion["Pixel Conversion<br/>[convert_planar.cpp]"]
  node_conversion_api["Conversion Interfaces<br/>[convert.h]"]
  node_conversion_bits["Bit Conversion<br/>[convert_bits.h]"]
  node_conversion_helpers["Conversion Helpers<br/>[convert_helper.h]"]
  node_simd["SIMD Kernels"]
end

subgraph group_io["Sources and Devices"]
  node_avi_source["AVI Source<br/>[AVIReadHandler.cpp]"]
  node_device_manager["Device Manager<br/>[DeviceManager.cpp]"]
  node_plugins_extra["External Filters"]
end

node_host(("Host Application"))

node_host -.->|"uses API"| node_api_surface
node_api_surface -.->|"exposes runtime"| node_environment
node_environment -->|"dispatches functions"| node_function_api
node_environment -->|"manages plugins"| node_plugins
node_plugins -->|"registers functions"| node_environment
node_plugins -->|"uses strings"| node_strings
node_parser -->|"uses environment"| node_environment
node_parser -->|"parses expressions"| node_expressions
node_parser -.->|"builds scripts"| node_function_api
node_environment -.->|"constructs graph"| node_filter_graph
node_filter_graph -.->|"evaluates clips"| node_builtin_filters
node_filter_graph -.->|"requests frames"| node_avi_source
node_builtin_filters -.->|"uses resampling"| node_resampling
node_resampling -->|"uses definitions"| node_resample_api
node_resampling -->|"uses conversion"| node_conversion
node_conversion -->|"implements interface"| node_conversion_api
node_conversion -->|"uses helpers"| node_conversion_helpers
node_conversion -->|"uses bit conversion"| node_conversion_bits
node_conversion -.->|"uses SIMD"| node_simd
node_expression_filter -->|"uses conversion"| node_conversion
node_device_manager -->|"uses environment"| node_environment
node_device_manager -.->|"wraps clips"| node_filter_graph
node_plugins_extra -.->|"implements plugins"| node_api_surface
node_host -.->|"receives frames"| node_avi_source

click node_api_surface "https://github.com/avisynth/avisynthplus/blob/master/avs_core/include/avisynth.h"
click node_environment "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/InternalEnvironment.h"
click node_runtime_core "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/internal.h"
click node_strings "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/strings.h"
click node_parser "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/parser/scriptparser.cpp"
click node_expressions "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/parser/expression.h"
click node_function_api "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/function.h"
click node_plugins "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/PluginManager.cpp"
click node_filter_graph "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/FilterGraph.cpp"
click node_builtin_filters "https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/source.cpp"
click node_expression_filter "https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/exprfilter/exprfilter.cpp"
click node_resampling "https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/resample.cpp"
click node_resample_api "https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/resample.h"
click node_conversion "https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert_planar.cpp"
click node_conversion_api "https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert.h"
click node_conversion_bits "https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert_bits.h"
click node_conversion_helpers "https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert_helper.h"
click node_avi_source "https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/AviSource/AVIReadHandler.cpp"
click node_device_manager "https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/DeviceManager.cpp"
click node_plugins_extra "https://github.com/avisynth/avisynthplus/tree/master/plugins"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api_surface,node_environment,node_runtime_core,node_strings toneBlue
class node_parser,node_expressions,node_function_api,node_plugins,node_filter_graph toneAmber
class node_builtin_filters,node_expression_filter,node_resampling,node_resample_api,node_conversion,node_conversion_api,node_conversion_bits,node_conversion_helpers,node_simd toneMint
class node_avi_source,node_device_manager,node_plugins_extra toneRose
class node_host toneIndigo
```

## Components

### Host API and Runtime

- [Plugin API](https://github.com/avisynth/avisynthplus/blob/master/avs_core/include/avisynth.h): `avs_core/include/avisynth.h`
- [Script Environment](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/InternalEnvironment.h): `avs_core/core/InternalEnvironment.h`
- [Runtime Core](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/internal.h): `avs_core/core/internal.h`
- [Runtime Strings](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/strings.h): `avs_core/core/strings.h`

### Scripting and Plugins

- [Script Parser](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/parser/scriptparser.cpp): `avs_core/core/parser/scriptparser.cpp`
- [Expression Engine](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/parser/expression.h): `avs_core/core/parser/expression.h`
- [Function Dispatch](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/function.h): `avs_core/core/function.h`
- [Plugin Manager](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/PluginManager.cpp): `avs_core/core/PluginManager.cpp`
- [Filter Graph](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/FilterGraph.cpp): `avs_core/core/FilterGraph.cpp`

### Media Processing

- [Built-in Filters](https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/source.cpp): `avs_core/filters/source.cpp`
- [Expr Filter](https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/exprfilter/exprfilter.cpp): `avs_core/filters/exprfilter/exprfilter.cpp`
- [Resampling](https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/resample.cpp): `avs_core/filters/resample.cpp`
- [Resample Definitions](https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/resample.h): `avs_core/filters/resample.h`
- [Pixel Conversion](https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert_planar.cpp): `avs_core/convert/convert_planar.cpp`
- [Conversion Interfaces](https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert.h): `avs_core/convert/convert.h`
- [Bit Conversion](https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert_bits.h): `avs_core/convert/convert_bits.h`
- [Conversion Helpers](https://github.com/avisynth/avisynthplus/blob/master/avs_core/convert/convert_helper.h): `avs_core/convert/convert_helper.h`
- **SIMD Kernels**

### Sources and Devices

- [AVI Source](https://github.com/avisynth/avisynthplus/blob/master/avs_core/filters/AviSource/AVIReadHandler.cpp): `avs_core/filters/AviSource/AVIReadHandler.cpp`
- [Device Manager](https://github.com/avisynth/avisynthplus/blob/master/avs_core/core/DeviceManager.cpp): `avs_core/core/DeviceManager.cpp`
- [External Filters](https://github.com/avisynth/avisynthplus/tree/master/plugins): `plugins`

### Other components

- **Host Application**

## Connections

- Host Application → Plugin API: uses API (evidence: `README.md`)
- Plugin API → Script Environment: exposes runtime (evidence: `avs_core/include/avisynth.h`)
- Script Environment → Function Dispatch: dispatches functions (evidence: `avs_core/core/InternalEnvironment.h`)
- Script Environment → Plugin Manager: manages plugins (evidence: `avs_core/core/PluginManager.cpp`)
- Plugin Manager → Script Environment: registers functions (evidence: `avs_core/core/PluginManager.cpp`)
- Plugin Manager → Runtime Strings: uses strings (evidence: `avs_core/core/PluginManager.cpp`)
- Script Parser → Script Environment: uses environment (evidence: `avs_core/core/parser/scriptparser.cpp`)
- Script Parser → Expression Engine: parses expressions
- Script Parser → Function Dispatch: builds scripts
- Script Environment → Filter Graph: constructs graph
- Filter Graph → Built-in Filters: evaluates clips
- Filter Graph → AVI Source: requests frames
- Built-in Filters → Resampling: uses resampling
- Resampling → Resample Definitions: uses definitions (evidence: `avs_core/filters/resample.cpp`)
- Resampling → Pixel Conversion: uses conversion (evidence: `avs_core/filters/resample.cpp`)
- Pixel Conversion → Conversion Interfaces: implements interface (evidence: `avs_core/convert/convert_planar.cpp`)
- Pixel Conversion → Conversion Helpers: uses helpers (evidence: `avs_core/convert/convert_planar.cpp`)
- Pixel Conversion → Bit Conversion: uses bit conversion (evidence: `avs_core/convert/convert_planar.cpp`)
- Pixel Conversion → SIMD Kernels: uses SIMD
- Expr Filter → Pixel Conversion: uses conversion (evidence: `avs_core/filters/exprfilter/exprfilter.cpp`)
- Device Manager → Script Environment: uses environment (evidence: `avs_core/core/DeviceManager.cpp`)
- Device Manager → Filter Graph: wraps clips
- External Filters → Plugin API: implements plugins (evidence: `README.md`)
- Host Application → AVI Source: receives frames (evidence: `README.md`)
