]> Cypherpunks repositories - gostls13.git/commit
image/jpeg: correct and test reference slowFDCT and slowIDCT
authorRuss Cox <rsc@golang.org>
Fri, 19 Sep 2025 15:36:11 +0000 (08:36 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 25 Sep 2025 14:54:28 +0000 (07:54 -0700)
commit92e093467f3ca3e348b2c933c24d1803efe4c006
tree4c74de9d769b67e4c97d6865d8ce22b3af79254f
parent27c7bbc51c812570e534d0aa0a8dc8733e5e3abf
image/jpeg: correct and test reference slowFDCT and slowIDCT

The reference implementations slowFDCT and slowIDCT were not
rounding correctly, making the test not as good as it could be.
Before, the real implementations were required to always produce
values within ±2 of the reference; now, with no changes,
the real implementations produce values within ±1 of the (corrected)
reference.

Also tighten the test to return an error not just on a single value
exceeding tolerance but also on too many values at exactly that
tolerance.

Change-Id: I3dd6ca7582178fef972fb812d848f7a0158a6ed8
Reviewed-on: https://go-review.googlesource.com/c/go/+/705517
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/image/jpeg/dct_test.go
src/image/jpeg/writer_test.go