Does lossless decompression always generate the same result?

Given lossy compression formats (for images, audio, video, etc.) and given that it only works with the same compressed input file, does the same decompression algorithm always make the same conclusion? What about the different tastes of decompressors, do they generate the same result with the same input? I read somewhere that some jpeg decompression algorithms trade quality for speed, which means that they will not produce the same result.

So, to summarize, given that we can know both the compression and decompression algorithms used, will we rely on the output, which is always the same. Is it possible to obtain deterministic behavior by controlling which algorithms to use?

Note. This does not have to output the original input.

+5
source share
1 answer

It depends on the compression standard. Modern standards, such as H.264, have strict specifications and reference decoders, and any compatible decoder should output the exact same bit by bit as the reference decoder (modulo errors, of course). Older video codecs (such as MPEG-4 Part 2) do not describe the complete process in sufficient detail, so different implementations may output slightly different data (looking about the same, but with slight differences in rounding). With inter-frame codecs, where future frames depend on earlier ones, such rounding errors can accumulate.

For audio codecs, a compatible decoder should basically come close to the reference signal, taking into account some implementation / rounding differences.

In most cases, quality trading for speed is done in the encoder, but some decoders also have options for deviating from standards to increase decoding speed but not display the exact correct image.

So, it all depends on what codec standards you use (regardless of whether they are written accurately enough to provide independent implementations of the bytexate) and the actual decoder implementations.

+3
source

Source: https://habr.com/ru/post/1200306/


All Articles