Re: [FFmpeg-devel] [PATCH] avfilter/vf_lut3d: support remaping negative values in the prelut

2020-09-06 Thread Paul B Mahol
On Sat, Sep 05, 2020 at 02:13:01PM -0700, mindm...@gmail.com wrote:
> From: Mark Reid 
> 
> ---
>  libavfilter/vf_lut3d.c | 8 +++-
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
> index 6730a424ce..988f6c8b55 100644
> --- a/libavfilter/vf_lut3d.c
> +++ b/libavfilter/vf_lut3d.c
> @@ -878,18 +878,16 @@ static int parse_cinespace(AVFilterContext *ctx, FILE 
> *f)
>  

lgtm
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avfilter/vf_lut3d: support remaping negative values in the prelut

2020-09-05 Thread Mark Reid
On Sat, Sep 5, 2020 at 2:13 PM  wrote:

> From: Mark Reid 
>
> ---
>  libavfilter/vf_lut3d.c | 8 +++-
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
> index 6730a424ce..988f6c8b55 100644
> --- a/libavfilter/vf_lut3d.c
> +++ b/libavfilter/vf_lut3d.c
> @@ -878,18 +878,16 @@ static int parse_cinespace(AVFilterContext *ctx,
> FILE *f)
>
>  prelut_sizes[i] = npoints;
>  in_min[i] = FLT_MAX;
> -in_max[i] = FLT_MIN;
> +in_max[i] = -FLT_MAX;
>  out_min[i] = FLT_MAX;
> -out_max[i] = FLT_MIN;
> -
> -last = FLT_MIN;
> +out_max[i] = -FLT_MAX;
>
>  for (int j = 0; j < npoints; j++) {
>  NEXT_FLOAT_OR_GOTO(v, end)
>  in_min[i] = FFMIN(in_min[i], v);
>  in_max[i] = FFMAX(in_max[i], v);
>  in_prelut[i][j] = v;
> -if (v < last) {
> +if (j > 0 && v < last) {
>  av_log(ctx, AV_LOG_ERROR, "Invalid file, non
> increasing prelut.\n");
>  ret = AVERROR(ENOMEM);
>  goto end;
> --
> 2.27.0
>
>
Sorry I meant to include this in the email.

Here is a sample cinespace lut that remaps negative values in the prelut
https://www.dropbox.com/s/7e4j7r264y0bueu/log_prelut.csp
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avfilter/vf_lut3d: support remaping negative values in the prelut

2020-09-05 Thread mindmark
From: Mark Reid 

---
 libavfilter/vf_lut3d.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 6730a424ce..988f6c8b55 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -878,18 +878,16 @@ static int parse_cinespace(AVFilterContext *ctx, FILE *f)
 
 prelut_sizes[i] = npoints;
 in_min[i] = FLT_MAX;
-in_max[i] = FLT_MIN;
+in_max[i] = -FLT_MAX;
 out_min[i] = FLT_MAX;
-out_max[i] = FLT_MIN;
-
-last = FLT_MIN;
+out_max[i] = -FLT_MAX;
 
 for (int j = 0; j < npoints; j++) {
 NEXT_FLOAT_OR_GOTO(v, end)
 in_min[i] = FFMIN(in_min[i], v);
 in_max[i] = FFMAX(in_max[i], v);
 in_prelut[i][j] = v;
-if (v < last) {
+if (j > 0 && v < last) {
 av_log(ctx, AV_LOG_ERROR, "Invalid file, non 
increasing prelut.\n");
 ret = AVERROR(ENOMEM);
 goto end;
-- 
2.27.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".