<p>In practice there are significant differences: many perceptual hashes aren't (designed to be) reversible, and perceptual hashes usually map to a much lower-dimensional space than video compression.</p>
<p>Formally, one important difference is that perceptual hashing does not require an inverse (a corresponding decompression/unhashing function).</p>

CC BY-SA 4.0
2021-08-24T22:36:30.243Z
Yes. Note that lossy codecs generally are not strictly invertible (isomorphic) either, merely right inverses (sectioned).
Corbin
CC BY-SA 4.0
2021-08-24T21:34:33.337Z
2021-08-24T21:34:33.337Z
D.W.
<p>Without loss of generality, I'll only talk about video, but this should apply to any sort of signal.</p>
<p>A perceptual hash function (<a href="https://en.wikipedia.org/wiki/Perceptual_hashing" rel="nofollow noreferrer">WP</a>) maps videos to fingerprints such that each fingerprint's preimage is closed under chosen transformations on the original videos. By definition, the typical such function prescales all videos to a unit cube (<a href="https://en.wikipedia.org/wiki/Unit_cube" rel="nofollow noreferrer">WP</a>), so the preimage closure typically includes scaling transformations.</p>
<p>A video codec (<a href="https://en.wikipedia.org/wiki/Video_codec" rel="nofollow noreferrer">WP</a>) consists of a pair of functions, a compression function and a decompression function. The compression function maps videos to archives such that recompressing a decompressed archive (hopefully) is the identity function. Another way to phrase this is that decompression is a section (<a href="https://en.wikipedia.org/wiki/Section_%28category_theory%29" rel="nofollow noreferrer">WP</a>) of compression. The typical video codec is not quite scale-invariant, because of non-square pixels, but generally maps each frame to a unit square.</p>
<p>These definitions are extremely similar, and there is clear functional overlap. In one direction, <a href="https://www.phash.org/" rel="nofollow noreferrer">pHash</a> fingerprints can be visualized as blurry versions of the original image; in the other direction, the original reverse-engineering of HD-DVD (<a href="https://en.wikipedia.org/wiki/BackupHDDVD" rel="nofollow noreferrer">WP</a>) was facilitated by a known-plaintext attack against MPEG frame layouts, because black/blank frames have predictable MPEG encoding.</p>
<p><strong>Is there a formal connection between these two constructions?</strong> If so, does it indeed apply to any sort of signal?</p>

<hash-function>
Are perceptual hashes connected to audio/video compression?
Corbin
# Are perceptual hashes connected to audio/video compression?

(Asked by: username_0 on 2021-08-24)

Without loss of generality, I'll only talk about video, but this should apply to any sort of signal.

A perceptual hash function ([WP](https://en.wikipedia.org/wiki/Perceptual_hashing)) maps videos to fingerprints such that each fingerprint's preimage is closed under chosen transformations on the original videos. By definition, the typical such function prescales all videos to a unit cube ([WP](https://en.wikipedia.org/wiki/Unit_cube)), so the preimage closure typically includes scaling transformations.

A video codec ([WP](https://en.wikipedia.org/wiki/Video_codec)) consists of a pair of functions, a compression function and a decompression function. The compression function maps videos to archives such that recompressing a decompressed archive (hopefully) is the identity function. Another way to phrase this is that decompression is a section ([WP](https://en.wikipedia.org/wiki/Section_%28category_theory%29)) of compression. The typical video codec is not quite scale-invariant, because of non-square pixels, but generally maps each frame to a unit square.

These definitions are extremely similar, and there is clear functional overlap. In one direction, [pHash](https://www.phash.org/) fingerprints can be visualized as blurry versions of the original image; in the other direction, the original reverse-engineering of HD-DVD ([WP](https://en.wikipedia.org/wiki/BackupHDDVD)) was facilitated by a known-plaintext attack against MPEG frame layouts, because black/blank frames have predictable MPEG encoding.

**Is there a formal connection between these two constructions?** If so, does it indeed apply to any sort of signal?

**Tags:** hash-function


---

## 1 answers

### Answer by username_1 on 2021-08-24. Score: 1

In practice there are significant differences: many perceptual hashes aren't (designed to be) reversible, and perceptual hashes usually map to a much lower-dimensional space than video compression.

Formally, one important difference is that perceptual hashing does not require an inverse (a corresponding decompression/unhashing function).

> **Comments:**
> **username_0**: Yes. Note that lossy codecs generally are not strictly invertible (isomorphic) either, merely right inverses (sectioned).  

---

