195 Commits

Author SHA1 Message Date
jpark37
607ee098c5 obs-filters: Handle premultiplied alpha input
Mostly by converting to straight alpha in shader when necessary.
2021-04-28 18:09:52 -07:00
Ryan Foster
8946f02270 obs-filters: Use correct branding for NVIDIA Noise Removal
The feature name is "Noise Removal" with that exact capitalization.
"NVIDIA Noise Removal" or "Noise Removal, powered by NVIDIA Broadcast"
are the two valid options for displaying this feature name in the UI.
2021-04-27 15:29:08 -04:00
Richard Stanway
61964d519c obs-filters: Check NVAFX is enabled before using mutexes
Fixes a crash on destroy if NVAFX wasn't actually available.
2021-04-25 19:51:20 +02:00
pkv
a5fab92d6f obs-filters: Better describe denoiser methods in menu
The description of the noise suppression methods was updated to
reflect cpu usage and quality in a more accurate manner.
2021-04-25 09:34:45 -07:00
pkv
535f4765ff obs-filters: RTX denoiser, initialize only output channels
This reduces the initialization from 8 to the actual number of output
channels.
2021-04-25 09:24:07 -07:00
Richard Stanway
64c353c019 obs-filters: Initialize NVIDIA AFX in a thread
Initializing NVAFX is slow as it has to load large models and can cause
significant impact to OBS' startup time. This moves NVAFX initialization
into a separate thread. NVAFX does not appear to be reentrant across
threads, hence a global mutex is also used to avoid reentrancy issues.

The downside of this change is that the first few seconds of audio after
adding the filter or starting OBS will not be filtered, but this is
unlikely to cause any real-world issues.
2021-04-25 09:24:07 -07:00
jpark37
92eb756dab obs-filters: Increase luma key precision 2021-04-13 12:43:25 -07:00
jpark37
7bcd0d25cf obs-filters: Increase brightness precision
Necessary for adjusting colors near black.
2021-04-13 04:48:36 -07:00
jpark37
54656af340 obs-filters: Add color settings to correction v2
Restore color tint/overlay functionality, but with separate controls for
tinting (multiply) and overlay (add).
2021-04-09 06:45:13 -07:00
pkv
38d17acdbb obs-filters: Code cleanup for RTX denoiser
This minor code cleanup commit does the following:
- sets defaults intensity of RTX denoiser to max.
- adds an initialization check of nvafx.
- splits nvafx initialization from channel allocation for better
readibility of the code.
- moves the intensity update from the filter_audio process function
to the plugin update function.
- logs the error code in case nvafx returns an error when running.
(useful for devs; I haven't translated the error codes which are
available in the sdk).
2021-04-05 03:11:51 -07:00
pkv
b46e9bba85 obs-filters: Fix initialization of RTX denoiser
This fixes issue #4441.
The issue occurs when adding the noise suppression filter for the
first time. Rnnoise or speex are the default noise suppression
methods. Line 344 returns which prevents initialization and
allocation for nvafx (rtx denoiser).
With the fix, initialization of nvafx occurs when swapping methods.
2021-04-05 03:11:51 -07:00
jpark37
593835c227 obs-filters: Perform chroma key in nonlinear space
Don't want to deal with regressions from using linear space right now.
2021-04-04 00:58:38 -07:00
jpark37
185df01a96 obs-filters: Use new pattern for SRGB support 2021-04-04 00:58:38 -07:00
Richard Stanway
db7daa6eaf obs-filters: Simplify NVAFX SDK path lookup 2021-03-16 20:34:15 +01:00
Richard Stanway
d8a434bcc8 obs-filters: Minor code cleanup
Remove some unused variables, fix const qualifier and remove printfs.
2021-03-16 20:34:15 +01:00
pkv
54892b27db obs-filters: Add RTX denoiser
This adds RTX denoiser filter to be used with RTX GPUs.
(from Nvidia Audio Effects SDK)
2021-03-13 12:17:11 -08:00
jpark37
0e803c4443 obs-filters: Fix unused parameters 2021-01-29 21:50:32 -08:00
jpark37
b460f025ed obs-filters: Fix pow arguments
GLSL does not auto-promote float to vector where HLSL does.
2021-01-23 01:53:11 -08:00
jpark37
a11e34615d obs-filters: Apply sharpness filter in linear space 2021-01-21 07:57:57 -08:00
jpark37
346af9cc87 obs-filters: Apply scale filter in linear space 2021-01-21 07:57:57 -08:00
jpark37
19d897e3d3 obs-filters: Apply image mask filter in linear space
Also fix an existing stale texture crash when reseting to defaults.
2021-01-21 07:57:57 -08:00
jpark37
d16919b8a0 obs-filters: Apply GPU delay filter in linear space 2021-01-21 07:57:57 -08:00
jpark37
ad2527765f obs-filters: Apply luma key filter in linear space
Also switch from 601 to 709 luma coefficients to match other filters.
2021-01-21 07:57:43 -08:00
jpark37
e66d49cd83 obs-filters: Apply color key filter in linear space
Also consolidate behavior of contrast/brightness/gamma across chroma
key, color correction, and color key filters. The contrast range has
been expanded to approximtely match the range when the filter applied to
nonlinear colors.
2021-01-21 07:57:15 -08:00
jpark37
22a7fd1cf3 obs-filters: Apply color grade filter in linear space 2021-01-21 07:57:15 -08:00
jpark37
e812a133ee obs-filters: Apply color correction filter in linear space
The newly versioned filter also has color overlay removed. We can add it
back if the demand is there, but I'd rather not maintain it.

Also consolidate behavior of contrast/brightness/gamma across chroma
key, color correction, and color key filters. The contrast range has
been expanded to approximtely match the range when the filter applied to
nonlinear colors.
2021-01-21 07:56:34 -08:00
jpark37
47da18e26c obs-filters: Apply chroma key filter in linear space
Also consolidate behavior of contrast/brightness/gamma across chroma
key, color correction, and color key filters. The contrast range has
been expanded to approximtely match the range when the filter applied to
nonlinear colors.
2021-01-21 07:55:50 -08:00
jpark37
2de056e32c obs-filters: Fix color overlay in color correction
Use color picker with alpha to restore color overlay functionality.
2021-01-11 11:52:50 -08:00
Gol-D-Ace
7368a2c7cc Update translations from Crowdin 2020-12-14 00:29:44 +01:00
Gol-D-Ace
7ab98ca00f Update translations from Crowdin 2020-11-25 20:11:39 +01:00
jpark37
3564e446ff rnnoise: Explicit double to float conversions 2020-11-04 04:45:07 -08:00
Florian Zwoch
bac24c2ca6 obs-filter: Fix potential symbol clashing on Linux
RNNoise symbols may collide with external ones provided by
libcodec2.so which FFMPEG may pull in automatically. Changing
the visibility of these symbols will guarantee the use of the
internal ones and not pick some (potential incompatible) from
outside.

fixes #3561
2020-10-16 05:26:25 -07:00
Gol-D-Ace
c66ebde080 Update translations from Crowdin 2020-09-27 23:07:27 +02:00
jp9000
e2bad8e79d obs-filters: Remove unnecessary files 2020-09-09 09:29:11 -07:00
jp9000
0608506e98 obs-filters: Use builtin rnnoise dep if not found 2020-09-09 09:25:11 -07:00
Kurt Kartaltepe
a2f5c323da obs-filters: Cleanup CMake
This file has become a mess of people hacking in fixes so this cleans it
up to make sense again.
2020-08-27 09:02:36 -07:00
Jim
aef10d46c4
Merge pull request #3322 from kkartaltepe/unused-var-cleanup
obs-filters/obs-outputs: Cleanup unused var warns
2020-08-23 12:40:54 -07:00
Kurt Kartaltepe
43da6eacd0 obs-filters/obs-outputs: Cleanup unused var warns
Fix unused variables when compiling without rnnoise
Fix unused variable warnings in GCC when using assert() in release
2020-08-23 12:09:59 -07:00
craftwar
f4ee271cd2 obs-filters: Fix building without noise reduction 2020-08-23 17:05:16 +08:00
Jérémy Farnaud
7e39109a86 obs-filters: Add option to use RNNoise for noise reduction
This commit adds support to using Xiph and Mozilla RNNoise library for
noise reduction.

RNNoise is a small library using an AI approach to noise reduction
using a pre-trained model like RTX Voice. But unlike RTX Voice, it is
very tiny, use CPU instead of GPU and only use little resources.
Obviously it is not as efficient but will effectively remove background
noise. It uses more CPU than the existing libspeex-based noise
reduction but it also sounds sounds way better.

RNNoise support is added to the noise reduction effect. It can be
enabled with a checkbox in the effect configuration. RNNoise has no
settings.
2020-08-18 11:25:21 -07:00
Clayton Groeneveld
990a07dc18 UI, obs-ffmpeg, obs-filters: Fix compile warnings 2020-07-16 23:15:13 -05:00
Richard Stanway
79981889c6 obs-filters: Misc code cleanups detected by PVS Studio 2020-05-24 18:09:42 +02:00
Jim
665180350d
Merge pull request #2657 from hselasky/improvement
libobs: Implement and use better scaling function for 64-bit integers
2020-05-21 18:07:53 -07:00
Jim
04e6a39de9
Merge pull request #2551 from jpark37/cube-lut-enhance
Implement CUBE LUT domain properly, tetrahedral interpolation for 3D LUTs
2020-05-20 18:09:56 -07:00
jp9000
7993179466 cmake: Add cmake folders 2020-05-13 06:52:37 -07:00
Georges Basile Stavracas Neto
bbf08b34d2 obs-filters: Add a user label to the LUT filter
While discussing the Flatpak RFC [1], it was spotted that the
LUT filter couldn't open the file selection dialog. It was
explained, then, that the proper formats were either composed
of "User Label (file extensions)", or "file extensions", and
the LUT filter was setting "(file extensions)" without the
actual user label.

While this works on a standard Qt file selection dialog, it
cannot be properly formatted as a set of D-Bus filters, thus
breaking the sandbox integration.

Add a simple user label to the LUT file filter.

[1] https://github.com/obsproject/rfcs/pull/21#issuecomment-619106757
2020-04-24 17:18:47 -03:00
Colin Edwards
55e2985026
Merge pull request #1944 from WizardCM/windows-rc-definition
CMake: Build Windows modules with file descriptors
2020-04-18 18:27:22 -05:00
jpark37
34d70c6832 obs-filters: 3D LUT tetrahedral interpolation
As requested by Adobe CUBE spec.
2020-04-08 17:00:45 -07:00
Hans Petter Selasky
0e4ea14ba1 libobs: Implement and use better scaling function for 64-bit integers
As os_gettime_ns() gets large the current scaling methods, mostly by casting
to uint64_t, may lead to numerical overflows. Sweep the code and use
util_mul_div64() where applicable.

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
2020-04-05 20:27:28 +02:00
jpark37
3aef198921 obs-filters: Implement CUBE LUT domain properly
Previously assuming zero to one instead of respecting values.
2020-03-22 18:25:32 -07:00