| Message ID | 20251202134544.662446-9-bryan.odonoghue@linaro.org |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
|
| Related | show |
Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes: > Add the ability to apply a int blacklevel gain against the demosaiced data > prior to application of colour correction data. > > We calculate the index into the RGB black-level table so that we can apply > the black level when we sample the input prior to the demosiac operation. s/demosiac/demosaic/ > > Don't do this when using the lookup tables as the black level is > already calculated in those. The two paragraphs are confusing, they probably try to say that the black level should be subtracted only in GPU ISP? With the commit message improved: Reviewed-by: Milan Zamazal <mzamazal@redhat.com> > Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > --- > src/libcamera/shaders/bayer_1x_packed.frag | 3 +++ > src/libcamera/shaders/bayer_unpacked.frag | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/src/libcamera/shaders/bayer_1x_packed.frag b/src/libcamera/shaders/bayer_1x_packed.frag > index db8c2a0b3..7036fe278 100644 > --- a/src/libcamera/shaders/bayer_1x_packed.frag > +++ b/src/libcamera/shaders/bayer_1x_packed.frag > @@ -66,6 +66,7 @@ uniform vec2 tex_bayer_first_red; > > uniform sampler2D tex_y; > uniform mat3 ccm; > +uniform vec3 blacklevel; > > void main(void) > { > @@ -213,6 +214,8 @@ void main(void) > vec3(patterns.y, C, patterns.x) : > vec3(patterns.wz, C)); > > + rgb = rgb - blacklevel; > + > /* > * CCM is a 3x3 in the format > * > diff --git a/src/libcamera/shaders/bayer_unpacked.frag b/src/libcamera/shaders/bayer_unpacked.frag > index 06d80f3dd..f0d8cd1e2 100644 > --- a/src/libcamera/shaders/bayer_unpacked.frag > +++ b/src/libcamera/shaders/bayer_unpacked.frag > @@ -25,6 +25,7 @@ varying vec4 center; > varying vec4 yCoord; > varying vec4 xCoord; > uniform mat3 ccm; > +uniform vec3 blacklevel; > > void main(void) { > vec3 rgb; > @@ -108,6 +109,8 @@ void main(void) { > vec3(PATTERN.w, C, PATTERN.z) : > vec3(PATTERN.yx, C)); > > + rgb = rgb - blacklevel; > + > /* > * CCM is a 3x3 in the format > *
diff --git a/src/libcamera/shaders/bayer_1x_packed.frag b/src/libcamera/shaders/bayer_1x_packed.frag index db8c2a0b3..7036fe278 100644 --- a/src/libcamera/shaders/bayer_1x_packed.frag +++ b/src/libcamera/shaders/bayer_1x_packed.frag @@ -66,6 +66,7 @@ uniform vec2 tex_bayer_first_red; uniform sampler2D tex_y; uniform mat3 ccm; +uniform vec3 blacklevel; void main(void) { @@ -213,6 +214,8 @@ void main(void) vec3(patterns.y, C, patterns.x) : vec3(patterns.wz, C)); + rgb = rgb - blacklevel; + /* * CCM is a 3x3 in the format * diff --git a/src/libcamera/shaders/bayer_unpacked.frag b/src/libcamera/shaders/bayer_unpacked.frag index 06d80f3dd..f0d8cd1e2 100644 --- a/src/libcamera/shaders/bayer_unpacked.frag +++ b/src/libcamera/shaders/bayer_unpacked.frag @@ -25,6 +25,7 @@ varying vec4 center; varying vec4 yCoord; varying vec4 xCoord; uniform mat3 ccm; +uniform vec3 blacklevel; void main(void) { vec3 rgb; @@ -108,6 +109,8 @@ void main(void) { vec3(PATTERN.w, C, PATTERN.z) : vec3(PATTERN.yx, C)); + rgb = rgb - blacklevel; + /* * CCM is a 3x3 in the format *
Add the ability to apply a int blacklevel gain against the demosaiced data prior to application of colour correction data. We calculate the index into the RGB black-level table so that we can apply the black level when we sample the input prior to the demosiac operation. Don't do this when using the lookup tables as the black level is already calculated in those. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- src/libcamera/shaders/bayer_1x_packed.frag | 3 +++ src/libcamera/shaders/bayer_unpacked.frag | 3 +++ 2 files changed, 6 insertions(+)