ffmpeg-bb/tests/ref/vsynth/vsynth3-mjpeg-huffman
Andreas Rheinhardt ff9f3fb607 avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort entries by length
It is unnecessary, as we already have the entries sorted by
probability and therefore implicitly by length. All we need
on top of that to build the tree is the number of entries
of a given length.
Doing so gives a 3.6% speedup of ff_mjpeg_encode_huffman_close()
here; it also saves about 640B of .text here.

The new code puts values with higher probability to the left
of the tree. The old code did not and therefore
the FATE checksums needed to be updated. Due to MJPEG's
0xFF unescaping file sizes as well as file checksums
needed to be updated; the decoded picture hashes stayed
the same. Given that codes on the left of the tree have
on average fewer bits set than codes on the right, the
file sizes mostly improve (all except vsynth3-mjpeg-444).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-04-18 08:40:17 +02:00

5 lines
277 B
Plaintext

52b7c3884957ac81fe1b8e1ecf40827b *tests/data/fate/vsynth3-mjpeg-huffman.avi
48152 tests/data/fate/vsynth3-mjpeg-huffman.avi
a6daba607898eb6e1a172c2368084a67 *tests/data/fate/vsynth3-mjpeg-huffman.out.rawvideo
stddev: 8.61 PSNR: 29.43 MAXDIFF: 58 bytes: 86700/ 86700