mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-19 19:03:00 +02:00
avfilter/vf_libvmaf: fix errors while running with psnr=1.
This patch fixes the seg fault which ocuured while running libvmaf filter with option psnr=1. Signed-off-by: ashk43712 <ashk43712@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
committed by
Ronald S. Bultje
parent
0a60cc909e
commit
4c38aa79ec
@@ -40,7 +40,6 @@ typedef struct LIBVMAFContext {
|
|||||||
const AVClass *class;
|
const AVClass *class;
|
||||||
FFFrameSync fs;
|
FFFrameSync fs;
|
||||||
const AVPixFmtDescriptor *desc;
|
const AVPixFmtDescriptor *desc;
|
||||||
char *format;
|
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
double vmaf_score;
|
double vmaf_score;
|
||||||
@@ -149,6 +148,7 @@ static void compute_vmaf_score(LIBVMAFContext *s)
|
|||||||
{
|
{
|
||||||
int (*read_frame)(float *ref_data, float *main_data, float *temp_data,
|
int (*read_frame)(float *ref_data, float *main_data, float *temp_data,
|
||||||
int stride, void *ctx);
|
int stride, void *ctx);
|
||||||
|
char *format;
|
||||||
|
|
||||||
if (s->desc->comp[0].depth <= 8) {
|
if (s->desc->comp[0].depth <= 8) {
|
||||||
read_frame = read_frame_8bit;
|
read_frame = read_frame_8bit;
|
||||||
@@ -156,7 +156,9 @@ static void compute_vmaf_score(LIBVMAFContext *s)
|
|||||||
read_frame = read_frame_10bit;
|
read_frame = read_frame_10bit;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->vmaf_score = compute_vmaf(s->format, s->width, s->height, read_frame, s,
|
format = (char *) s->desc->name;
|
||||||
|
|
||||||
|
s->vmaf_score = compute_vmaf(format, s->width, s->height, read_frame, s,
|
||||||
s->model_path, s->log_path, s->log_fmt, 0, 0,
|
s->model_path, s->log_path, s->log_fmt, 0, 0,
|
||||||
s->enable_transform, s->phone_model, s->psnr,
|
s->enable_transform, s->phone_model, s->psnr,
|
||||||
s->ssim, s->ms_ssim, s->pool);
|
s->ssim, s->ms_ssim, s->pool);
|
||||||
@@ -258,7 +260,6 @@ static int config_input_ref(AVFilterLink *inlink)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int config_output(AVFilterLink *outlink)
|
static int config_output(AVFilterLink *outlink)
|
||||||
{
|
{
|
||||||
AVFilterContext *ctx = outlink->src;
|
AVFilterContext *ctx = outlink->src;
|
||||||
|
|||||||
Reference in New Issue
Block a user