[Bf-blender-cvs] [6fb8743] master: OpenCOlorIO: Add explicit linearSRGB -> sRGB lookup table

Sergey Sharybin noreply at git.blender.org
Thu Sep 15 15:57:29 CEST 2016


Commit: 6fb874369c31649de7232235b0114344bfdb8e92
Author: Sergey Sharybin
Date:   Thu Sep 15 15:08:20 2016 +0200
Branches: master
https://developer.blender.org/rB6fb874369c31649de7232235b0114344bfdb8e92

OpenCOlorIO: Add explicit linearSRGB -> sRGB lookup table

Previously converting from linear space to SRGB was doing rather
slow inverted 1D lookup. Adding explicit inverse LUT gives 20%
speedup of OpenGL render.

Next question is: why do we even bother with sRGB conversion here,
OpenGL is already in the proper space so in theory we can avoid
quite some color space conversions. In any case, having this case
optimized in nice anyway.

===================================================================

M	release/datafiles/colormanagement/config.ocio
A	release/datafiles/colormanagement/luts/srgb_inv.spi1d

===================================================================

diff --git a/release/datafiles/colormanagement/config.ocio b/release/datafiles/colormanagement/config.ocio
index c2bfd3b..924a140 100644
--- a/release/datafiles/colormanagement/config.ocio
+++ b/release/datafiles/colormanagement/config.ocio
@@ -247,6 +247,7 @@ colorspaces:
     allocation: uniform
     allocationvars: [-0.125, 4.875]
     to_reference: !<FileTransform> {src: srgb.spi1d, interpolation: linear}
+    from_reference: !<FileTransform> {src: srgb_inv.spi1d, interpolation: linear}
 
   - !<ColorSpace>
     name: VD16
diff --git a/release/datafiles/colormanagement/luts/srgb_inv.spi1d b/release/datafiles/colormanagement/luts/srgb_inv.spi1d
new file mode 100644
index 0000000..2c1452f
--- /dev/null
+++ b/release/datafiles/colormanagement/luts/srgb_inv.spi1d
@@ -0,0 +1,65567 @@
+Version 1
+From -0.00967492260062 40.4600768322
+Length 65561
+Components 1
+{
+        -0.1250000000000104
+        -0.11702456997145604
+        -0.10904913994290168
+        -0.10107370991434733
+        -0.09309827988579296
+        -0.0851228498572386
+        -0.07714741982868423
+        -0.06917198980012987
+        -0.0611965597715755
+        -0.05322112974302114
+        -0.045245699714466785
+        -0.03727026968591242
+        -0.02929483965735805
+        -0.02131940962880368
+        -0.013343979600249337
+        -0.00536854957169497
+        0.0026068804568593965
+        0.010582310485413764
+        0.01855774051396813
+        0.026533170542522477
+        0.03450860057107684
+        0.04242127131742316
+        0.04966122909244714
+        0.056260201931676114
+        0.06235220012514372
+        0.0680307887431286
+        0.07336426762816567
+        0.07840424805962154
+        0.0831908247246071
+        0.08775585933030919
+        0.09212515427514542
+        0.09631994226697205
+        0.1003579373970962
+        0.1042540955170489
+        0.10802117631963587
+        0.11167016674868888
+        0.11521060529691904
+        0.11865083408806257
+        0.12199819743021392
+        0.12525920007695024
+        0.12843963473636816
+        0.13154468581259388
+        0.13457901456662716
+        0.13754682959869283
+        0.1404519456228731
+        0.14329783282055583
+        0.14608765855041497
+        0.14882432280999883
+        0.15151048855323906
+        0.15414860774510222
+        0.15674094386188792
+        0.1592895914108321
+        0.16179649293656145
+        0.1642634538978275
+        0.16669215573080126
+        0.1690841673612563
+        0.17144095538435214
+        0.17376389309525853
+        0.1760542685248608
+        0.17831329161094808
+        0.18054210061559325
+        0.1827417678830924
+        0.1849133050192061
+        0.1870576675610369
+        0.18917575919728902
+        0.19126843559056186
+        0.19333650784647366
+        0.19538074566858338
+        0.19740188023310656
+        0.19940060681316712
+        0.20137758717867327
+        0.2033334517947603
+        0.20526880183902724
+        0.20718421105544027
+        0.20908022746073562
+        0.21095737491737282
+        0.21281615458553998
+        0.2146570462653533
+        0.21648050963920246
+        0.21828698542314723
+        0.22007689643534878
+        0.22185064858870612
+        0.2236086318141473
+        0.22535122092038873
+        0.22707877639540952
+        0.22879164515438416
+        0.2304901612383678
+        0.2321746464676293
+        0.2338454110531673
+        0.2355027541696253
+        0.23714696449253414
+        0.23877832070255106
+        0.24039709195913206
+        0.2420035383458664
+        0.2435979112895112
+        0.2451804539545943
+        0.24675140161529874
+        0.24831098200620277
+        0.2498594156533221
+        0.25139691618678495
+        0.25292369063636727
+        0.25443993971101914
+        0.2559458580634255
+        0.2574416345405671
+        0.25892745242117376
+        0.26040348964089466
+        0.2618699190059524
+        0.26332690839599027
+        0.2647746209567698
+        0.26621321528333314
+        0.2676428455941966
+        0.26906366189710595
+        0.2704758101468457
+        0.2718794323955622
+        0.27327466693602787
+        0.27466164843824675
+        0.27604050807977504
+        0.27741137367010443
+        0.27877436976943515
+        0.2801296178021439
+        0.28147723616523207
+        0.28281734033202344
+        0.2841500429513604
+        0.28547545394253687
+        0.2867936805861869
+        0.2881048276113387
+        0.28940899727882796
+        0.2907062894612551
+        0.29199680171965936
+        0.29328062937707167
+        0.29455786558910085
+        0.29582860141169665
+        0.2970929258662268
+        0.29835092600199575
+        0.2996026869563277
+        0.30084829201232743
+        0.3020878226544282
+        0.3033213586218286
+        0.30454897795991553
+        0.305770757069765
+        0.30698677075580755
+        0.3081970922717406
+        0.3094017933647652
+        0.31060094431822166
+        0.31179461399269437
+        0.3129828698656508
+        0.31416577806967966
+        0.3153434034293866
+        0.3165158094970058
+        0.31768305858678003
+        0.3188452118081615
+        0.32000232909788306
+        0.3211544692509443
+        0.322301689950559
+        0.3234440477971047
+        0.324581598336115
+        0.3257143960853536
+        0.32684249456100467
+        0.32796594630301673
+        0.32908480289963127
+        0.3301991150111289
+        0.33130893239282266
+        0.33241430391732807
+        0.33351527759613625
+        0.334611900600518
+        0.3357042192817825
+        0.33679227919091587
+        0.33787612509762205
+        0.3389558010087876
+        0.3400313501863928
+        0.34110281516488744
+        0.3421702377680521
+        0.343233659125363
+        0.3442931196878771
+        0.3453486592436559
+        0.3464003169327436
+        0.347448131261715
+        0.3484921401178078
+        0.34953238078265525
+        0.3505688899456305
+        0.3516017037168178
+        0.35263085763962254
+        0.3536563867030321
+        0.35467832535353966
+        0.3556967075067415
+        0.3567115665586197
+        0.35772293539651945
+        0.3587308464098318
+        0.3597353315003909
+        0.36073642209259493
+        0.3617341491432607
+        0.3627285431512185
+        0.3637196341666574
+        0.3647074518002276
+        0.36569202523190786
+        0.3666733832196455
+        0.3676515541077763
+        0.3686265658352298
+        0.36959844594352864
+        0.3705672215845863
+        0.37153291952831047
+        0.3724955661700178
+        0.37345518753766527
+        0.3744118092989043
+        0.37536545676796235
+        0.3763161549123569
+        0.37726392835944816
+        0.378208801402833
+        0.37915079800858703
+        0.38008994182135725
+        0.38102625617031105
+        0.38195976407494514
+        0.3828904882507577
+        0.3838184511147892
+        0.384743674791034
+        0.38566618111572765
+        0.386585991642512
+        0.3875031276474834
+        0.38841761013412507
+        0.3893294598381286
+        0.3902386972321066
+        0.3911453425301997
+        0.39204941569258167
+        0.3929509364298629
+        0.3938499242073987
+        0.3947463982495016
+        0.3956403775435616
+        0.3965318808440777
+        0.39742092667660095
+        0.3983075333415934
+        0.39919171891820365
+        0.4000735012679621
+        0.4009528980383977
+        0.40182992666657763
+        0.40270460438257333
+        0.40357694821285295
+        0.4044469749836036
+        0.40531470132398467
+        0.4061801436693128
+        0.407043318264183
+        0.40790424116552426
+        0.4087629282455935
+        0.4096193951949089
+        0.4104736575251232
+        0.41132573057184
+        0.4121756294973727
+        0.41302336929344924
+        0.4138689647838623
+        0.41471243062706786
+        0.4155537813187316
+        0.4163930311942263
+        0.41723019443108
+        0.4180652850513761
+        0.41889831692410795
+        0.41972930376748724
+        0.4205582591512084
+        0.4213851964986696
+        0.4222101290891513
+        0.42303307005995383
+        0.4238540324084942
+        0.4246730289943636
+        0.42549007254134663
+        0.42630517563940246
+        0.42711835074660903
+        0.4279296101910722
+        0.4287389661727984
+        0.4295464307655339
+        0.43035201591857
+        0.43115573345851527
+        0.4319575950910362
+        0.43275761240256566
+        0.43355579686198076
+        0.4343521598222514
+        0.43514671252205805
+        0.4359394660873821
+        0.4367304315330669
+        0.43751961976435216
+        0.43830704157838046
+        0.4390927076656784
+        0.4398766286116108
+        0.4406588148978106
+        0.4414392769035834
+        0.44221802490728773
+        0.44299506908769193
+        0.443770419525308
+        0.4445440862037016
+        0.44531607901078113
+        0.4460864077400641
+        0.44685508209192243
+        0.44762211167480676
+        0.4483875060064502
+        0.4491512745150527
+        0.4499134265404436
+        0.4506739713352282
+        0.4514329180659122
+        0.4521902758140098
+        0.4529460535771325
+        0.453700260270061
+        0.4544529047257984
+        0.4552039956966076
+        0.4559535418550314
+        0.45670155179489597
+        0.45744803403229856
+        0.45819299700657895
+        0.45893644908127657
+        0.4596783985450706
+        0.4604188536127069
+        0.46115782242590925
+        0.46189531305427695
+        0.46263133349616753
+        0.4633658916795668
+        0.46409899546294425
+        0.4648306526360962
+        0.4655608709209748
+        0.4662896579725057
+        0.4670170213793911
+        0.46774296866490334
+        0.46846750728766356
+        0.4691906446424103
+        0.46991238806075614
+        0.4706327448119319
+        0.47135172210352166
+        0.4720693270821847
+        0.4727855668343674
+        0.4735004483870056
+        0.4742139787082144
+        0.47492616470796983
+        0.4756370132387791
+       

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list