lavfi/vidstab: miscelenaous cosmetics and typo fixes.
This commit is contained in:
parent
4364e1f150
commit
017051266b
@ -55,7 +55,7 @@ static const AVOption vidstabdetect_options[]= {
|
||||
{"show", "0: draw nothing (def); 1,2: show fields and transforms", OFFSETC(show), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 2, FLAGS},
|
||||
{"tripod", "virtual tripod mode (if >0): motion is compared to a reference"
|
||||
" reference frame (frame # is the value) (def: 0)", OFFSETC(virtualTripod), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS},
|
||||
{NULL},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
AVFILTER_DEFINE_CLASS(vidstabdetect);
|
||||
@ -80,7 +80,6 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
}
|
||||
|
||||
vsMotionDetectionCleanup(md);
|
||||
|
||||
}
|
||||
|
||||
static int query_formats(AVFilterContext *ctx)
|
||||
@ -98,7 +97,6 @@ static int query_formats(AVFilterContext *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int config_input(AVFilterLink *inlink)
|
||||
{
|
||||
AVFilterContext *ctx = inlink->dst;
|
||||
@ -123,7 +121,7 @@ static int config_input(AVFilterLink *inlink)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
// set values that are not initializes by the options
|
||||
// set values that are not initialized by the options
|
||||
sd->conf.algo = 1;
|
||||
sd->conf.modName = "vidstabdetect";
|
||||
if (vsMotionDetectInit(md, &sd->conf, &fi) != VS_OK) {
|
||||
|
@ -62,7 +62,7 @@ static const AVOption vidstabtransform_options[]= {
|
||||
AV_OPT_TYPE_CONST, {.i64 = VSCropBorder }, 0, 0, FLAGS, "crop"},
|
||||
{"invert", "1: invert transforms (def: 0)", OFFSETC(invert),
|
||||
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
|
||||
{"relative", "consider transforms as 0: abslute, 1: relative (def)", OFFSETC(relative),
|
||||
{"relative", "consider transforms as 0: absolute, 1: relative (def)", OFFSETC(relative),
|
||||
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, FLAGS},
|
||||
{"zoom", "percentage to zoom >0: zoom in, <0 zoom out (def: 0)", OFFSETC(zoom),
|
||||
AV_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, 100, FLAGS},
|
||||
@ -80,7 +80,7 @@ static const AVOption vidstabtransform_options[]= {
|
||||
AV_OPT_TYPE_CONST, {.i64 = VS_BiCubic },0, 0, FLAGS, "interpol"},
|
||||
{"tripod", "if 1: virtual tripod mode (equiv. to relative=0:smoothing=0)", OFFSET(tripod),
|
||||
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
|
||||
{NULL},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
AVFILTER_DEFINE_CLASS(vidstabtransform);
|
||||
@ -239,7 +239,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
}
|
||||
if (out == in) { // inplace
|
||||
vsTransformPrepare(td, &inframe, &inframe);
|
||||
}else{ // seperate frames
|
||||
} else { // separate frames
|
||||
VSFrame outframe;
|
||||
for (plane = 0; plane < vsTransformGetDestFrameInfo(td)->planes; plane++) {
|
||||
outframe.data[plane] = out->data[plane];
|
||||
@ -289,6 +289,4 @@ AVFilter avfilter_vf_vidstabtransform = {
|
||||
.inputs = avfilter_vf_vidstabtransform_inputs,
|
||||
.outputs = avfilter_vf_vidstabtransform_outputs,
|
||||
.priv_class = &vidstabtransform_class,
|
||||
|
||||
};
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
#include "vidstabutils.h"
|
||||
|
||||
|
||||
/** convert AV's pixelformat to vid.stab pixelformat */
|
||||
VSPixelFormat av_2_vs_pixel_format(AVFilterContext *ctx, enum AVPixelFormat pf){
|
||||
VSPixelFormat av_2_vs_pixel_format(AVFilterContext *ctx, enum AVPixelFormat pf)
|
||||
{
|
||||
switch (pf) {
|
||||
case AV_PIX_FMT_YUV420P: return PF_YUV420P;
|
||||
case AV_PIX_FMT_YUV422P: return PF_YUV422P;
|
||||
@ -41,14 +41,14 @@ VSPixelFormat av_2_vs_pixel_format(AVFilterContext *ctx, enum AVPixelFormat pf){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** struct to hold a valid context for logging from within vid.stab lib */
|
||||
typedef struct {
|
||||
const AVClass *class;
|
||||
} VS2AVLogCtx;
|
||||
|
||||
/** wrapper to log vs_log into av_log */
|
||||
static int vs_2_av_log_wrapper(int type, const char* tag, const char* format, ...){
|
||||
static int vs_2_av_log_wrapper(int type, const char *tag, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
VS2AVLogCtx ctx;
|
||||
AVClass class = {
|
||||
@ -66,7 +66,8 @@ static int vs_2_av_log_wrapper(int type, const char* tag, const char* format, ..
|
||||
}
|
||||
|
||||
/** sets the memory allocation function and logging constants to av versions */
|
||||
void vs_set_mem_and_log_functions(void){
|
||||
void vs_set_mem_and_log_functions(void)
|
||||
{
|
||||
vs_malloc = av_malloc;
|
||||
vs_zalloc = av_mallocz;
|
||||
vs_realloc = av_realloc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user