Message ID | 20230401174737.85192-3-chemag@gmail.com |
---|---|
State | Accepted |
Commit | c0f89dccc88b3c5fac180f1b4d4a1ac2f679c470 |
Headers | show |
Series | [FFmpeg-devel,1/3] lavfi/vf_psnr: add warning when color ranges differ | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
Hi, I think the warning is probably OK, but maybe better to put it into config_input_ref along with the other input checks. On Sat, Apr 1, 2023 at 10:48 AM Chema Gonzalez <chemag@gmail.com> wrote: > --- > libavfilter/vf_libvmaf.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c > index 2586f37d99..67f0d6a22f 100644 > --- a/libavfilter/vf_libvmaf.c > +++ b/libavfilter/vf_libvmaf.c > @@ -141,6 +141,13 @@ static int do_vmaf(FFFrameSync *fs) > if (ctx->is_disabled || !ref) > return ff_filter_frame(ctx->outputs[0], dist); > > + if (dist->color_range != ref->color_range) { > + av_log(ctx, AV_LOG_WARNING, "distorted and reference " > + "frames use different color ranges (%s != %s)\n", > + av_color_range_name(dist->color_range), > + av_color_range_name(ref->color_range)); > + } > + > err = copy_picture_data(ref, &pic_ref, s->bpc); > if (err) { > av_log(s, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n"); > -- > 2.39.2 > Thanks, Kyle
Hi Kyle, Thanks for your answer. I couldn't find how to access the color range from the filter_frame function. I checked other filters that access `AVFrame.color_range`, and all of them do it in the filter_frame function, not in the config_props one. This includes vf_blackdetect.c, vf_iccgen.c, vf_libplacebo.c, vf_premultiply.c, vf_scale.c, and vf_scale_vaapi.c. Thanks again, -Chema On Mon, Apr 17, 2023 at 12:09 PM Kyle Swanson <k@ylo.ph> wrote: > > Hi, > > I think the warning is probably OK, but maybe better to put it into config_input_ref along with the other input checks. > > On Sat, Apr 1, 2023 at 10:48 AM Chema Gonzalez <chemag@gmail.com> wrote: >> >> --- >> libavfilter/vf_libvmaf.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c >> index 2586f37d99..67f0d6a22f 100644 >> --- a/libavfilter/vf_libvmaf.c >> +++ b/libavfilter/vf_libvmaf.c >> @@ -141,6 +141,13 @@ static int do_vmaf(FFFrameSync *fs) >> if (ctx->is_disabled || !ref) >> return ff_filter_frame(ctx->outputs[0], dist); >> >> + if (dist->color_range != ref->color_range) { >> + av_log(ctx, AV_LOG_WARNING, "distorted and reference " >> + "frames use different color ranges (%s != %s)\n", >> + av_color_range_name(dist->color_range), >> + av_color_range_name(ref->color_range)); >> + } >> + >> err = copy_picture_data(ref, &pic_ref, s->bpc); >> if (err) { >> av_log(s, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n"); >> -- >> 2.39.2 > > > Thanks, > Kyle
Hi, On Mon, Apr 17, 2023 at 10:14 PM Chema Gonzalez <chema@berkeley.edu> wrote: > Hi Kyle, > > Thanks for your answer. > > I couldn't find how to access the color range from the filter_frame > function. I checked other filters that access `AVFrame.color_range`, > and all of them do it in the filter_frame function, not in the > config_props one. This includes vf_blackdetect.c, vf_iccgen.c, > vf_libplacebo.c, vf_premultiply.c, vf_scale.c, and vf_scale_vaapi.c. > > Thanks again, > -Chema > Went over this at VDD, haasn will push the patch. Thanks, Kyle
diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c index 2586f37d99..67f0d6a22f 100644 --- a/libavfilter/vf_libvmaf.c +++ b/libavfilter/vf_libvmaf.c @@ -141,6 +141,13 @@ static int do_vmaf(FFFrameSync *fs) if (ctx->is_disabled || !ref) return ff_filter_frame(ctx->outputs[0], dist); + if (dist->color_range != ref->color_range) { + av_log(ctx, AV_LOG_WARNING, "distorted and reference " + "frames use different color ranges (%s != %s)\n", + av_color_range_name(dist->color_range), + av_color_range_name(ref->color_range)); + } + err = copy_picture_data(ref, &pic_ref, s->bpc); if (err) { av_log(s, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n");