avfilter/vf_vidstab(detect|transform): Deduplicate pixel formats

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/369/head
Andreas Rheinhardt 3 years ago
parent e54b9bb8a2
commit 688696790c
  1. 11
      libavfilter/vf_vidstabdetect.c
  2. 11
      libavfilter/vf_vidstabtransform.c
  3. 8
      libavfilter/vidstabutils.c
  4. 2
      libavfilter/vidstabutils.h

@ -84,16 +84,7 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx)
{ {
// If you add something here also add it in vidstabutils.c return ff_set_common_formats_from_list(ctx, ff_vidstab_pix_fmts);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_NONE
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
} }
static int config_input(AVFilterLink *inlink) static int config_input(AVFilterLink *inlink)

@ -123,16 +123,7 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx)
{ {
// If you add something here also add it in vidstabutils.c return ff_set_common_formats_from_list(ctx, ff_vidstab_pix_fmts);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_NONE
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
} }

@ -20,6 +20,14 @@
#include "vidstabutils.h" #include "vidstabutils.h"
const enum AVPixelFormat ff_vidstab_pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_NONE
};
/** convert AV's pixelformat to vid.stab pixelformat */ /** convert AV's pixelformat to vid.stab pixelformat */
VSPixelFormat ff_av2vs_pixfmt(AVFilterContext *ctx, enum AVPixelFormat pf) VSPixelFormat ff_av2vs_pixfmt(AVFilterContext *ctx, enum AVPixelFormat pf)
{ {

@ -25,6 +25,8 @@
#include "avfilter.h" #include "avfilter.h"
extern const enum AVPixelFormat ff_vidstab_pix_fmts[];
/* Conversion routines between libav* and vid.stab */ /* Conversion routines between libav* and vid.stab */
/** /**

Loading…
Cancel
Save