Blender V5.3
denoiser_oidn.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
10#include "util/thread.h"
11
13
14/* Implementation of a CPU based denoiser which uses OpenImageDenoise library. */
15class OIDNDenoiser : public Denoiser {
16 public:
17 /* Forwardly declared state which might be using compile-flag specific fields, such as
18 * OpenImageDenoise device and filter handles. */
19 class State;
20
21 OIDNDenoiser(Device *denoiser_device, const DenoiseParams &params);
22
23 bool denoise_buffer(const BufferParams &buffer_params,
24 const BufferParams &denoised_buffer_params,
25 RenderBuffers *render_buffers,
26 int num_samples,
27 bool allow_inplace_modification,
28 float2 pixel_jitter) override;
29
30#ifdef WITH_OPENIMAGEDENOISE
31 OIDNDenoiserBase base_;
32
33 bool denoise_create_if_needed(const class OIDNDenoiseContext &context);
34 bool denoise_run(class OIDNDenoiseContext &context, const PassType pass_type);
35 bool commit_and_execute_filter(OIDNFilter filter);
36 void set_common_filter_params(OIDNFilter filter);
37#endif
38
39 protected:
40 /* We only perform one denoising at a time, since OpenImageDenoise itself is multithreaded.
41 * Use this mutex whenever images are passed to the OIDN and needs to be denoised. */
43};
44
Denoiser(Device *denoiser_device, const DenoiseParams &params)
Definition denoiser.cpp:252
bool denoise_buffer(const BufferParams &buffer_params, const BufferParams &denoised_buffer_params, RenderBuffers *render_buffers, int num_samples, bool allow_inplace_modification, float2 pixel_jitter) override
OIDNDenoiser(Device *denoiser_device, const DenoiseParams &params)
static thread_mutex mutex_
#define CCL_NAMESPACE_END
PassType
std::mutex thread_mutex
Definition thread.h:27