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>
5 lines
297 B
Plaintext
5 lines
297 B
Plaintext
af1ed7a7536b2a84e8b91b2bbbfa4f9c *tests/data/fate/vsynth1-mjpeg-trell-huffman.avi
|
|
1360828 tests/data/fate/vsynth1-mjpeg-trell-huffman.avi
|
|
548de4f6098cbc3d8b65574bb93faf09 *tests/data/fate/vsynth1-mjpeg-trell-huffman.out.rawvideo
|
|
stddev: 7.67 PSNR: 30.42 MAXDIFF: 62 bytes: 7603200/ 7603200
|