Skip to main content

SSIMULACRA2

Under Maintenance

The content in this entry is incomplete & is in the process of being completed.

SSIMULACRA 2 is a visual fidelity metric based on the concept of the multi-scale structural similarity index measure (MS-SSIM), computed in a perceptually relevant color space, adding two other (asymmetric) error maps, and aggregating using two different norms. It is currently the most reputable visual quality metric according to its correlation with subjective results, and is considered a very robust means of comparing encoders. It is debatable whether Butteraugli is better for very high fidelity, but SSIMULACRA 2 is considered the best for medium/low fidelity comparisons. Although it does not feature any inter-frame temporal awareness, it is still considered a very strong metric for video fidelity comparison nonetheless.

While a reference implementation by Cloudinary exists, most people will want to use the rust implementation ssimulacra2_rs.

Installing​

To install ssimulacra2_rs using cargo, run this:

cargo install ssimulacra2_rs

Running​

On Images​

Comparing images is simple, run this:

ssimulacra2_rs image source.png distorted.png

On Videos​

If you want to compare videos, run this:

ssimulacra2_rs video source.mkv distorted.mkv
Graphical visualization

You can optionally output a graph using the -g parameter:

ssimulacra2_rs video source.mkv distorted.mkv -g

Multithreading​

Multithreading with ssimulacra2_rs works, but it scales badly. This is likely due to memory bandwidth limitations. However, the speedup is worth it.

To run multithreaded, use the --frame-threads or -f parameters. For example, to run with 16 threads:

ssimulacra2_rs video source.mkv distorted.mkv -f 16
Thread amount

You should set the amount of threads to half of your actual thread count, as going any higher won't make a difference.

Memory limitation

If you have a small amount of system memory, you may encounter out of memory errors while running with multi-threading. If that's the case, you need to lower the amount of threads.

Frame skipping​

SSIMULACRA 2 is, at its core, an image quality assessment metric, not a video quality one. This means that it does not use any temporal information when applied to videos; just the independent scores of each individual frame. Consequently, it can be applied to a subset of a video's frames, instead of to all of them, to obtain a meaningful estimate of the score in a reduced time.

To run ssimulacra2_rs with frame skip enabled, use the --increment or -i parameters. For example, to compute the score for every 3rd frame:

ssimulacra2_rs video source.mkv distorted.mkv -i 3
Frame skip amount

To avoid biased score estimates, it is recommended to sample frames using an odd value as increment. Prime numbers further reduce the likelihood of sampling bias. Thus increments of 3, 5, 7, 11 or 13 frames are good options to compute score estimates with little deviation to the true score.

In any case, powers of two (2, 4, 8, 16...) should be avoided as increment, due to the way video encoders deal with temporal layers.

Scoring​

The score that SSIMULACRA 2 outputs is simple: a number in range -inf..100. According to the developers of the metric, for image quality assessment, SSIMULACRA 2 scores correlate to subjective visual quality as follows:

  • Very high quality: 90 and above
  • High quality: 70 to 90
  • Medium quality: 50 to 70
  • Low quality: Below 50

For video quality assessment, however, the scores need not be as high for similar subjective visual quality correlation. For example, it is believed that an average score of around 80 corresponds to a "visually lossless" video. Nevertheless, this has not been thoroughly verified.