5 #include <mcrt_denoise/denoiser/Denoiser.h> 6 #include <scene_rdl2/common/grid_util/FloatValueTracker.h> 7 #include <scene_rdl2/common/math/Viewport.h> 8 #include <scene_rdl2/common/rec_time/RecTime.h> 18 using DenoiseEngine = ClientReceiverFb::DenoiseEngine;
19 using SnapshotBuffCallBack = std::function<void(std::vector<float>& buff)>;
22 : mDenoiseEngine(ClientReceiverFb::DenoiseEngine::OPTIX)
26 , mDenoiseUseAlbedo(
false)
27 , mDenoiseUseNormals(
false)
28 , mLatencyTracker(sKeepMaxItems)
29 , mDenoiseTimeTracker(sKeepMaxItems)
30 , mDenoiseMinInterval(0.0f)
31 , mPrevEvalTimingResult(0.0f)
34 void resetTimingInfo();
36 bool denoiseBeauty(
const DenoiseEngine engine,
37 const float latencySec,
40 const scene_rdl2::math::Viewport* roi,
41 const SnapshotBuffCallBack& beautyInputSnapshot,
42 const SnapshotBuffCallBack& albedoInputSnapshot,
43 const SnapshotBuffCallBack& normalInputSnapshot,
44 const int outputNumChan,
45 std::vector<float>& beautyOutput,
48 bool denoiseBeauty888(
const DenoiseEngine engine,
49 const float latencySec,
52 const scene_rdl2::math::Viewport* roi,
53 const SnapshotBuffCallBack& beautyInputSnapshot,
54 const SnapshotBuffCallBack& albedoInputSnapshot,
55 const SnapshotBuffCallBack& normalInputSnapshot,
56 std::vector<unsigned char>& beautyOutput,
60 const std::string& getErrorMsg()
const {
return mErrorMsg; }
62 std::string showStatus()
const;
65 bool setupDenoiser(
const DenoiseEngine engine,
66 const int width,
const int height,
const scene_rdl2::math::Viewport* roi,
67 const SnapshotBuffCallBack& albedoInputCallBack,
68 const SnapshotBuffCallBack& normalInputCallBack);
70 const float* inputBuff(
const SnapshotBuffCallBack& callBack, std::vector<float>& buff)
const;
71 float* outputBuff(std::vector<float>& buff,
int numChan)
const;
72 void copyDenoisedResultToOut(
const int outputNumChan, std::vector<float>& beautyOutput)
const;
74 void denoiseActionTimingTrackStart(
const float latencySec);
75 bool denoiseActionIntervalTest();
76 void denoiseActionTimingUpdate();
80 DenoiseEngine mDenoiseEngine;
82 std::vector<float> mBeautyInput;
83 std::vector<float> mAlbedoInput;
84 std::vector<float> mNormalInput;
85 std::vector<float> mDenoisedResult;
90 bool mDenoiseUseAlbedo;
91 bool mDenoiseUseNormals;
92 std::unique_ptr<moonray::denoiser::Denoiser> mDenoiser;
94 std::string mErrorMsg;
96 scene_rdl2::rec_time::RecTime mDenoiseActionInterval;
97 scene_rdl2::rec_time::RecTime mDenoiseAction;
99 static constexpr
int sKeepMaxItems = 10;
100 scene_rdl2::grid_util::FloatValueTracker mLatencyTracker;
101 scene_rdl2::grid_util::FloatValueTracker mDenoiseTimeTracker;
103 float mDenoiseMinInterval;
104 float mPrevEvalTimingResult;
Definition: ClientReceiverConsoleDriver.cc:9
Definition: ClientReceiverDenoiser.h:15
– ProgressiveFrame message decoder for frontend client –