---
title: "ClikaRT::processor"
sidebar_label: "processor"
description: "Namespace ClikaRT::processor"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--namespace">namespace</span>

## Namespaces

| Name | Description |
| --- | --- |
| [`ClikaRT::processor::processor_defaults`](./processor_defaults/index.md) | Default knob values the `from_args` factories apply when an argument is left `{}` (the documented HuggingFace/PIL defaults). Named here so callers see them in the header, `arg.value_or(kImageDefault…)`, without reading the docs. The library `static_assert`s each against its internal default, so these and the internal defaults are one source of truth (a drift is a compile error). |

## Classes

| Name | Description |
| --- | --- |
| [`AudioProcessOptions`](./AudioProcessOptions.md) | Per-call overrides for [`AudioProcessor::process`](./AudioProcessor.md#process). Only the knobs the pipeline reads fresh each call are here; nothing that would invalidate the processor's precomputed window / DFT / mel-filterbank tensors or its output-shape contract (sampling rate, FFT/window geometry, mel-bank geometry, feature type). A set field replaces the loaded config's value for THAT call only. [`norm_mean`](./AudioProcessOptions.md#norm_mean)/[`norm_std`](./AudioProcessOptions.md#norm_std) are scalar operands (element `[0]` is read); both fields OWN their values. |
| [`AudioProcessor`](./AudioProcessor.md) | A config-driven audio feature processor. Move-only. |
| [`AudioProcessorConfig`](./AudioProcessorConfig.md) | Settable configuration for an [`AudioProcessor`](./AudioProcessor.md) (raw waveform / log-mel / filterbank). Default-constructed to the log-mel defaults; tune the STFT/mel knobs, or round-trip a `preprocessor_config.json` through [`from_json`](./AudioProcessorConfig.md#from_json) / [`to_json`](./AudioProcessorConfig.md#to_json). Move-only. |
| [`ImageProcessOptions`](./ImageProcessOptions.md) | Per-call overrides for [`ImageProcessor::process`](./ImageProcessor.md#process) / `process_batch`. Every field is optional: a set field replaces the loaded config's value for THAT call only; an unset field keeps the config. Resolution is field-wise; setting [`resize`](./ImageProcessOptions.md#resize) does not flip [`do_resize`](./ImageProcessOptions.md#do_resize) (mirror of the HuggingFace per-call kwargs). The per-image dynamic-resize path (a target computed from the input image, e.g. an aspect-preserving patch-budget fit) rides [`resize`](./ImageProcessOptions.md#resize). |
| [`ImageProcessor`](./ImageProcessor.md) | A config-driven static image preprocessor. Move-only. |
| [`ImageProcessorConfig`](./ImageProcessorConfig.md) | Settable configuration for an [`ImageProcessor`](./ImageProcessor.md) (convert-rgb → resize → center-crop → rescale → normalize → pad). Default-constructed to the documented HuggingFace defaults (resize + rescale by 1/255 + normalize on; crop + pad off); tune with the fluent setters, or round-trip a `preprocessor_config.json` through [`from_json`](./ImageProcessorConfig.md#from_json) / [`to_json`](./ImageProcessorConfig.md#to_json). Move-only. |
| [`ProcessedVideo`](./ProcessedVideo.md) | A processed clip PLUS the sampling metadata a timestamp/alignment video model needs upstream (which frames were sampled, at what times). Returned by [`VideoProcessor::process_with_indices`](./VideoProcessor.md#process_with_indices), the generic seam that lets a model build grid\_thw / timestamp tokens from [`frame_indices`](./ProcessedVideo.md#frame_indices) + [`pts_seconds`](./ProcessedVideo.md#pts_seconds) without folding any model-specific logic into [ClikaRT](../../index.md). |
| [`Processor`](./Processor.md) | A multimodal preprocessor bundle: the OPTIONAL per-modality sub-processors a model directory provides (a tokenizer + one media processor: audio / image / video). Move-only. |
| [`VideoMetadata`](./VideoMetadata.md) | Timing metadata for a decoded clip (only [`fps`](./VideoMetadata.md#fps)-based sampling consults it). |
| [`VideoProcessOptions`](./VideoProcessOptions.md) | Per-call overrides for [`VideoProcessor::process`](./VideoProcessor.md#process): the temporal sampling knobs, plus per-frame spatial overrides forwarded to the inner image pipeline. A set field replaces the loaded config's value for THAT call only. |
| [`VideoProcessor`](./VideoProcessor.md) | A config-driven video preprocessor: temporal frame sampling composed over the channels-last image pipeline. Move-only. |
| [`VideoProcessorConfig`](./VideoProcessorConfig.md) | Settable configuration for a [`VideoProcessor`](./VideoProcessor.md): the per-frame [`ImageProcessorConfig`](./ImageProcessorConfig.md) plus temporal sampling ([`num_frames`](./VideoProcessorConfig.md#num_frames) / [`fps`](./VideoProcessorConfig.md#fps)). Move-only. |

## Enumerations

### enum ImageResample {#ImageResample}

<div class="api-signature">

`enum class` **`ImageResample`** `:` `std::uint8_t`

</div>

Resampling filter for the image resize step, in the PIL/HuggingFace `resample` vocabulary. Enum values ARE the PIL codes a `preprocessor_config.json` carries, so a config round-trips exactly.

| Enumerator | Value | Description |
| --- | --- | --- |
| `Nearest` | `0` | PIL NEAREST. |
| `Bilinear` | `2` | PIL BILINEAR. |
| `Bicubic` | `3` | PIL BICUBIC (the HuggingFace default). |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 36

</div>

### enum AudioFeatureType {#AudioFeatureType}

<div class="api-signature">

`enum class` **`AudioFeatureType`** `:` `std::uint8_t`

</div>

Which standard feature pipeline an [`AudioProcessor`](./AudioProcessor.md) runs.

| Enumerator | Value | Description |
| --- | --- | --- |
| `Raw` | `0` | raw mono waveform `[1, S]` + normalization |
| `LogMel` |  | log-mel spectrogram `[1, T, n_mels]` |
| `KaldiFbank` |  | kaldi-style log-mel filterbank `[1, T, n_mels]` |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 165

</div>

### enum MelScale {#MelScale}

<div class="api-signature">

`enum class` **`MelScale`** `:` `std::uint8_t`

</div>

Mel-scale hertz↔mel mapping (the analytic curve behind the filterbank).

| Enumerator | Value | Description |
| --- | --- | --- |
| `Htk` | `0` |  |
| `Slaney` |  |  |
| `Kaldi` |  |  |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 172

</div>

### enum MelNorm {#MelNorm}

<div class="api-signature">

`enum class` **`MelNorm`** `:` `std::uint8_t`

</div>

Mel filterbank area normalization.

| Enumerator | Value | Description |
| --- | --- | --- |
| `None` | `0` |  |
| `Slaney` |  |  |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 175

</div>

### enum LogMode {#LogMode}

<div class="api-signature">

`enum class` **`LogMode`** `:` `std::uint8_t`

</div>

How the mel/power spectrum is compressed before normalization.

| Enumerator | Value | Description |
| --- | --- | --- |
| `None` | `0` | leave the (linear) power/mel spectrum |
| `Log` |  | natural log |
| `Log10` |  | base-10 log |
| `Db` |  | 10·log10 (power → decibels) |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 178

</div>

### enum WindowFunction {#WindowFunction}

<div class="api-signature">

`enum class` **`WindowFunction`** `:` `std::uint8_t`

</div>

STFT analysis window function (rectangular = `None`).

| Enumerator | Value | Description |
| --- | --- | --- |
| `Hann` | `0` | Hann cosine window (the default). |
| `Hamming` |  | Hamming window. |
| `None` |  | rectangular (no windowing) |
| `Povey` |  | Kaldi's Povey window (a Hann-family power variant). |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 186

</div>

### enum StftPadStyle {#StftPadStyle}

<div class="api-signature">

`enum class` **`StftPadStyle`** `:` `std::uint8_t`

</div>

How the `center` pad distributes around the signal.

| Enumerator | Value | Description |
| --- | --- | --- |
| `Center` | `0` | symmetric n\_fft/2 each side (the torch STFT convention) |
| `Semicausal` |  | LEFT-only n\_fft/2 reflect pad (a streaming front-end sees no future samples) |
| `SemicausalWindow` |  | left-only ZERO pad of win\_length/2; frames win\_length+1 samples and drops the trailing one (the USM law), the FFT zero-extends each frame to n\_fft |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 194

</div>

### enum LogFloorMode {#LogFloorMode}

<div class="api-signature">

`enum class` **`LogFloorMode`** `:` `std::uint8_t`

</div>

How the mel floor guards the log: clamp to the floor (`log(max(x, floor))`) or add it (`log(x + floor)`).

| Enumerator | Value | Description |
| --- | --- | --- |
| `Clamp` | `0` |  |
| `Additive` |  |  |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 205

</div>

### enum AudioNormKind {#AudioNormKind}

<div class="api-signature">

`enum class` **`AudioNormKind`** `:` `std::uint8_t`

</div>

Output normalization kind (operands set alongside).

| Enumerator | Value | Description |
| --- | --- | --- |
| `None` | `0` |  |
| `ZeroMeanUnitVar` |  | per-utterance zero-mean unit-variance |
| `GlobalMeanStd` |  | subtract `norm_mean`, divide by `norm_std` (scalar operands) |

<div class="api-declared">

Declared in `ClikaRT/processor/config.h`, line 208

</div>

## `ClikaRT/processor/config.h` {#config-h}

```cpp
#include <ClikaRT/processor/config.h>
```

Public, settable configuration for the media preprocessors. Build a processor from EXPLICIT arguments instead of a model directory: default-construct a config (sensible defaults, no file needed), tune the knobs, and hand it to the matching processor's `from_config`. Or inspect what a loaded config resolved to by serializing it with `to_json`.

Each config type PIMPL-wraps its internal parameter set; the accepted schema round-trips through `from_json` / `to_json` (a `preprocessor_config.json`-shaped object), and the common knobs have direct fluent setters.

## `ClikaRT/tokenizer/tokenizer.h` {#tokenizer-h}

```cpp
#include <ClikaRT/tokenizer/tokenizer.h>
```

Text \<-\> token-id conversion.
