[v3,07/21] ipa: libipa: gamma: Static assert lookup node count
diff mbox series

Message ID 20260918120949.191668-8-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • libcamera: rcar-gen4 + rpp-x1
Related show

Commit Message

Barnabás Pőcze Sept. 18, 2026, 12:09 p.m. UTC
Require at least 2, which is reasonable.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/ipa/libipa/gamma.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kieran Bingham Sept. 18, 2026, 4:35 p.m. UTC | #1
Quoting Barnabás Pőcze (2026-09-18 13:09:35)
> Require at least 2, which is reasonable.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  src/ipa/libipa/gamma.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/ipa/libipa/gamma.h b/src/ipa/libipa/gamma.h
> index 9954f94ba2..e5ac3f96f5 100644
> --- a/src/ipa/libipa/gamma.h
> +++ b/src/ipa/libipa/gamma.h
> @@ -63,6 +63,8 @@ protected:
>  template<unsigned int NLutNodes, typename UQ>
>  class GammaAlgorithm : public GammaAlgorithmBase
>  {
> +       static_assert(NLutNodes >= 2);
> +

2 sounds quite low, but I don't know what an expected reasonable minimum
is, other than ... more than one so ...


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>  public:
>         GammaAlgorithm()
>                 : GammaAlgorithmBase(NLutNodes)
> -- 
> 2.55.0
>
Barnabás Pőcze Sept. 21, 2026, 10:33 a.m. UTC | #2
2026. 09. 18. 18:35 keltezéssel, Kieran Bingham írta:
> Quoting Barnabás Pőcze (2026-09-18 13:09:35)
>> Require at least 2, which is reasonable.
>>
>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>> ---
>>   src/ipa/libipa/gamma.h | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/src/ipa/libipa/gamma.h b/src/ipa/libipa/gamma.h
>> index 9954f94ba2..e5ac3f96f5 100644
>> --- a/src/ipa/libipa/gamma.h
>> +++ b/src/ipa/libipa/gamma.h
>> @@ -63,6 +63,8 @@ protected:
>>   template<unsigned int NLutNodes, typename UQ>
>>   class GammaAlgorithm : public GammaAlgorithmBase
>>   {
>> +       static_assert(NLutNodes >= 2);
>> +
> 
> 2 sounds quite low, but I don't know what an expected reasonable minimum
> is, other than ... more than one so ...

"reasonable" might have been an overstatement to be honest,
it's just the absolute minimum for the algorithm.


> 
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
>>   public:
>>          GammaAlgorithm()
>>                  : GammaAlgorithmBase(NLutNodes)
>> -- 
>> 2.55.0
>>

Patch
diff mbox series

diff --git a/src/ipa/libipa/gamma.h b/src/ipa/libipa/gamma.h
index 9954f94ba2..e5ac3f96f5 100644
--- a/src/ipa/libipa/gamma.h
+++ b/src/ipa/libipa/gamma.h
@@ -63,6 +63,8 @@  protected:
 template<unsigned int NLutNodes, typename UQ>
 class GammaAlgorithm : public GammaAlgorithmBase
 {
+	static_assert(NLutNodes >= 2);
+
 public:
 	GammaAlgorithm()
 		: GammaAlgorithmBase(NLutNodes)