-
Notifications
You must be signed in to change notification settings - Fork 0
4. FGSEditor Overview
As you have seen in the previous pages, manually writing filmgrn1 files and balancing IIR filters to achieve a specific grain aesthetic is incredibly difficult and prone to mathematical instability.
FGSEditor abstracts all of this complexity away. It provides a visual, real-time environment where you can shape scaling curves, adjust intensities, and manage temporal events without ever touching raw code. The software automatically handles the mathematical limits and visualizes the results.
Here is a detailed overview of the FGSEditor workspace and how to integrate it into your video encoding pipeline.
Instead of manually typing Auto-Regressive coefficients, FGSEditor provides powerful built-in generators:
FGSEditor offers presets ranging from small "digital" noise to large "8mm" clumps. Larger grain sizes are achieved by automatically scaling the AR coefficients.
Presets range from 0 to 13 and manage both the intensity and the size of the grain:
- Preset 0: Acts as a sort of photon noise (no spatial correlation), which is significantly more effective than simple dithering.
- Presets 1 to 3: Excellent for debanding purposes.
- Presets 4+: Introduce actual, heavier grain, designed for scenarios where proper regraining is necessary.
Based on the official SVT-AV1-Essential implementation, this model simulates realistic camera sensor noise based on physics, eliminating the need for manual curve drawing.
- Parameters: Adjust ISO strength, Sensor Format (e.g., 8mm, 16mm, 35mm, IMAX), and Transfer Functions (SDR, HDR/PQ, HLG).
- Synergy: This feature can be combined with Grain Size presets to create highly realistic grain patterns that match specific film stocks.
The primary interface is designed for surgical modification of a single FGS event, providing three main control areas:
-
Interactive Plotter: A graphical environment where you can click and drag points to define scaling curves (
sY,sCb,sCr). This determines the grain intensity distribution across different luminance and chrominance levels. - Sidebar Controls: A comprehensive panel for adjusting global parameters like AR coefficients, scaling shifts, and applying the presets mentioned above.
- Grain Preview: A real-time plot at the bottom of the interface rendering the mathematical grain based on the AFGS1 specification.
Note
Mathematical vs. Psychovisual Strength: The Grain Preview displays the exact variance injected into the pixels. Due to human "Luma Masking," the same grain strength often appears vibrant in mid-tones but becomes less perceptible in very dark or very bright areas.
FGSEditor performs real-time validation of your parameters to prevent digital artifacts and mathematical divergence. Understanding these alerts is critical.
Indicated by a bright red ar_coeff_shift box in the Sidebar.
-
What it means: Your AR coefficients are mathematically unstable (their sum exceeds the limits of the chosen
shift). - Effect: The grain generator will diverge, producing static blocks or severe artifacts instead of noise.
-
How to Fix: FGSEditor will warn you immediately. You must increase the
ar_coeff_shiftvalue or decrease the individualcXcoefficients until the red warning disappears.
- What it means: The synthesized noise added directly to the decoded image pixels exceeds the color depth limits (0-255 for 8-bit).
- Effect: Exceeding this legal range causes external clipping, altering the grain's energy and destroying fine image textures under a blanket of clamped white/black pixels.
- How to Fix: Lower the intensity of the curve points where the red triangles appear.
For projects requiring temporal grain changes (e.g., a movie with different film stocks or a grainy scene followed by a clean one), the Timeline Editor allows you to manage multiple FGS events:
- Event Tracking: Visualize every grain change across the video's duration.
- Temporal Precision: Modify start and end times for specific segments using Frames, Seconds, or Timecodes.
-
Open Video: Drag and drop an MKV file into FGSEditor. It will automatically use
grav1synthto extract any existing FGS metadata. - Save & Apply: Once you are happy with the grain, clicking save generates a new output video file with your updated grain parameters applied, leaving your original source file completely untouched.