Skip to content

Instantly share code, notes, and snippets.

View gatoatigrado's full-sized avatar

zora tung gatoatigrado

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gatoatigrado on github.
  • I am gatoatigrado (https://keybase.io/gatoatigrado) on keybase.
  • I have a public key ASCBg1juVDDpJu57lEyNMc_33whKTa_5s3YJMjX0CJWnnwo

To claim this, I am signing this object:

@gatoatigrado
gatoatigrado / unittest.diff
Created December 25, 2017 21:13
GUnit integration & LUT unit test
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3e2f2c..e1e4dd4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -310,7 +310,24 @@ find_package(ZLIB REQUIRED)
if(WITH_SYSTEM_KLT)
find_package(KLT REQUIRED)
endif()
-
+find_package(Threads)
@gatoatigrado
gatoatigrado / profile_rt.py
Created December 24, 2017 18:52
Profiling script
# -*- coding: utf-8 -*-
"""Runs RawTherapee benchmarking"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import os
import os.path
import subprocess
@gatoatigrado
gatoatigrado / lcms.diff
Created December 24, 2017 18:49
LCMS manual function inlining
diff --git a/src/cmslut.c b/src/cmslut.c
index 3c0c245..6c7edfd 100644
--- a/src/cmslut.c
+++ b/src/cmslut.c
@@ -24,6 +24,9 @@
//---------------------------------------------------------------------------------
//
+#include <stdio.h>
+#include <stdint-gcc.h>
@gatoatigrado
gatoatigrado / gist:f6870f1ba7ac6eb39a7b559d776e0593
Created December 23, 2017 23:13
Entire RawTherapee profile
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
40.35 1.40 1.40 318 0.00 0.00 rtengine::RawImageSource::amaze_demosaic_RT(int, int, int, int, array2D<float>&, array2D<float>&, array2D<float>&, array2D<float>&)
34.01 2.58 1.18 1 1.18 1.18 rtengine::ImProcFunctions::rgbProc(rtengine::Imagefloat*, rtengine::LabImage*, rtengine::PipetteBuffer*, LUT<float>&, LUT<float>&, LUT<float>&, rtengine::SHMap*, int, LUT<float>&, LUT<float>&, LUT<float>&, float, float, rtengine::ColorGradientCurve const&, rtengine::OpacityCurve const&, bool, LUT<float>&, LUT<float>&, rtengine::ToneCurve const&, rtengine::ToneCurve const&, rtengine::ToneCurve const&, rtengine::ToneCurve const&, double&, double&, double&, float&, float&, float&, double, int, int, rtengine::DCPProfile*, rtengine::DCPProfile::ApplyState const&, LUT<unsigned int>&)
4.61 2.74 0
@gatoatigrado
gatoatigrado / test.diff
Created December 23, 2017 22:50
rawtherapee benchmark hack
diff --git a/rtengine/StopWatch.h b/rtengine/StopWatch.h
index 9e4400b..4a4ca65 100644
--- a/rtengine/StopWatch.h
+++ b/rtengine/StopWatch.h
@@ -19,6 +19,7 @@
* Author: reine
*/
+#define BENCHMARK
#ifndef STOPWATCH_H
@gatoatigrado
gatoatigrado / gist:c0009ec97b64ecbc8def720c28a0de3e
Created December 23, 2017 20:46
RawTherapee new BENCHFUN output
oliver:/tmp> time rawtherapee-cli -Y -t -p ~/.config/RawTherapee/profiles/SonyDefault.pp3 -c /tmp/test.arw
RawTherapee, version 5.3-347-g6001676, command line
Processing: /tmp/test.arw
sony_arw2_load_raw took 160 ms
Merging procparams #0
scaleColors took 57 ms
amaze_demosaic_RT took 1446 ms
stage_init took 2653 ms
stage_denoise took 0 ms
stage_transform took 169 ms
@gatoatigrado
gatoatigrado / gist:6fc0cc7dcac58ef759aa8d2cce17b3e9
Created December 23, 2017 20:43
Running gprof on RawTherapee
oliver:/tmp> gprof $(which rawtherapee-cli) gmon.out | head -20
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
25.57 1.45 1.45 318 0.00 0.00 rtengine::RawImageSource::amaze_demosaic_RT(int, int, int, int, array2D<float>&, array2D<float>&, array2D<float>&, array2D<float>&)
22.58 2.73 1.28 1 1.28 1.28 rtengine::ImProcFunctions::rgbProc(rtengine::Imagefloat*, rtengine::LabImage*, rtengine::PipetteBuffer*, LUT<float>&, LUT<float>&, LUT<float>&, rtengine::SHMap*, int, LUT<float>&, LUT<float>&, LUT<float>&, float, float, rtengine::ColorGradientCurve const&, rtengine::OpacityCurve const&, bool, LUT<float>&, LUT<float>&, rtengine::ToneCurve const&, rtengine::ToneCurve const&, rtengine::ToneCurve const&, rtengine::ToneCurve const&, double&, double&, doubl
@gatoatigrado
gatoatigrado / gist:96374dbafd3082f0b019
Last active August 29, 2015 14:12
Tiff processing on the GPU [ ntung.com/hacks/tiff-gpu-processing ]
# -*- coding: utf-8 -*-
"""
Testing tiff processing on the gpu
"""
from __future__ import absolute_import
from __future__ import print_function
import math