Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: third_party/qcms/src/transform_util.c

Issue 1215583002: [qcms] lut_inverse_interp16: fix black level inversion error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/qcms/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/qcms/src/transform_util.c
diff --git a/third_party/qcms/src/transform_util.c b/third_party/qcms/src/transform_util.c
index aa08df04bffed7e2d781608b66ace76033d8365d..5cb45f8419e81132b4176eb9cf076bb740c28a97 100644
--- a/third_party/qcms/src/transform_util.c
+++ b/third_party/qcms/src/transform_util.c
@@ -360,6 +360,14 @@ uint16_fract_t lut_inverse_interp16(uint16_t Value, uint16_t LutTable[], int len
return 0;
}
+ // For input 0, return that to maintain black level. Note the binary search
+ // does not. For example, it inverts the standard sRGB gamma curve to 7 at
+ // the origin, causing a black level error.
+
+ if (Value == 0 && NumZeroes) {
+ return 0;
+ }
+
// Seems not a degenerated case... apply binary search
while (r > l) {
« no previous file with comments | « third_party/qcms/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698