From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 4/4] avfilter/deshake: Merge header into its only user
Date: Wed, 1 Nov 2023 10:48:21 +0100
Message-ID: <GV1SPRMB0033EE5A7D85466FF529D15D8FA7A@GV1SPRMB0033.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <GV1SPRMB0033280C6F96AACB191058008FA7A@GV1SPRMB0033.EURP250.PROD.OUTLOOK.COM>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavfilter/deshake.h | 83 ----------------------------------------
libavfilter/vf_deshake.c | 55 +++++++++++++++++++++++++-
2 files changed, 54 insertions(+), 84 deletions(-)
delete mode 100644 libavfilter/deshake.h
diff --git a/libavfilter/deshake.h b/libavfilter/deshake.h
deleted file mode 100644
index 406cbab2f6..0000000000
--- a/libavfilter/deshake.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com>
- * Copyright (C) 2013 Lenny Wang
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFILTER_DESHAKE_H
-#define AVFILTER_DESHAKE_H
-
-#include "config.h"
-#include "avfilter.h"
-#include "transform.h"
-#include "libavutil/pixelutils.h"
-
-
-enum SearchMethod {
- EXHAUSTIVE, ///< Search all possible positions
- SMART_EXHAUSTIVE, ///< Search most possible positions (faster)
- SEARCH_COUNT
-};
-
-typedef struct IntMotionVector {
- int x; ///< Horizontal shift
- int y; ///< Vertical shift
-} IntMotionVector;
-
-typedef struct MotionVector {
- double x; ///< Horizontal shift
- double y; ///< Vertical shift
-} MotionVector;
-
-typedef struct Transform {
- MotionVector vec; ///< Motion vector
- double angle; ///< Angle of rotation
- double zoom; ///< Zoom percentage
-} Transform;
-
-#define MAX_R 64
-
-typedef struct DeshakeContext {
- const AVClass *class;
- int counts[2*MAX_R+1][2*MAX_R+1]; /// < Scratch buffer for motion search
- double *angles; ///< Scratch buffer for block angles
- unsigned angles_size;
- AVFrame *ref; ///< Previous frame
- int rx; ///< Maximum horizontal shift
- int ry; ///< Maximum vertical shift
- int edge; ///< Edge fill method
- int blocksize; ///< Size of blocks to compare
- int contrast; ///< Contrast threshold
- int search; ///< Motion search method
- av_pixelutils_sad_fn sad; ///< Sum of the absolute difference function
- Transform last; ///< Transform from last frame
- int refcount; ///< Number of reference frames (defines averaging window)
- FILE *fp;
- Transform avg;
- int cw; ///< Crop motion search to this box
- int ch;
- int cx;
- int cy;
- char *filename; ///< Motion search detailed log filename
- int opencl;
- int (* transform)(AVFilterContext *ctx, int width, int height, int cw, int ch,
- const float *matrix_y, const float *matrix_uv, enum InterpolateMethod interpolate,
- enum FillMethod fill, AVFrame *in, AVFrame *out);
-} DeshakeContext;
-
-#endif /* AVFILTER_DESHAKE_H */
diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c
index cb062dd11f..299814fd65 100644
--- a/libavfilter/vf_deshake.c
+++ b/libavfilter/vf_deshake.c
@@ -51,15 +51,68 @@
#include "avfilter.h"
#include "internal.h"
+#include "transform.h"
#include "video.h"
#include "libavutil/common.h"
#include "libavutil/file_open.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
+#include "libavutil/pixelutils.h"
#include "libavutil/qsort.h"
-#include "deshake.h"
+
+enum SearchMethod {
+ EXHAUSTIVE, ///< Search all possible positions
+ SMART_EXHAUSTIVE, ///< Search most possible positions (faster)
+ SEARCH_COUNT
+};
+
+typedef struct IntMotionVector {
+ int x; ///< Horizontal shift
+ int y; ///< Vertical shift
+} IntMotionVector;
+
+typedef struct MotionVector {
+ double x; ///< Horizontal shift
+ double y; ///< Vertical shift
+} MotionVector;
+
+typedef struct Transform {
+ MotionVector vec; ///< Motion vector
+ double angle; ///< Angle of rotation
+ double zoom; ///< Zoom percentage
+} Transform;
+
+#define MAX_R 64
+
+typedef struct DeshakeContext {
+ const AVClass *class;
+ int counts[2*MAX_R+1][2*MAX_R+1]; /// < Scratch buffer for motion search
+ double *angles; ///< Scratch buffer for block angles
+ unsigned angles_size;
+ AVFrame *ref; ///< Previous frame
+ int rx; ///< Maximum horizontal shift
+ int ry; ///< Maximum vertical shift
+ int edge; ///< Edge fill method
+ int blocksize; ///< Size of blocks to compare
+ int contrast; ///< Contrast threshold
+ int search; ///< Motion search method
+ av_pixelutils_sad_fn sad; ///< Sum of the absolute difference function
+ Transform last; ///< Transform from last frame
+ int refcount; ///< Number of reference frames (defines averaging window)
+ FILE *fp;
+ Transform avg;
+ int cw; ///< Crop motion search to this box
+ int ch;
+ int cx;
+ int cy;
+ char *filename; ///< Motion search detailed log filename
+ int opencl;
+ int (* transform)(AVFilterContext *ctx, int width, int height, int cw, int ch,
+ const float *matrix_y, const float *matrix_uv, enum InterpolateMethod interpolate,
+ enum FillMethod fill, AVFrame *in, AVFrame *out);
+} DeshakeContext;
#define OFFSET(x) offsetof(DeshakeContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-11-01 9:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 9:45 [FFmpeg-devel] [PATCH 1/4] avutil/x86/pixelutils: Empty MMX state in ff_pixelutils_sad_8x8_mmxext Andreas Rheinhardt
2023-11-01 9:48 ` [FFmpeg-devel] [PATCH 2/4] avfilter/vf_mpdecimate: Remove emms_c Andreas Rheinhardt
2023-11-01 9:48 ` [FFmpeg-devel] [PATCH 3/4] avfilter/vf_deshake: Remove unnecessary emms_c Andreas Rheinhardt
2023-11-01 9:48 ` Andreas Rheinhardt [this message]
2023-11-01 11:02 ` [FFmpeg-devel] [PATCH 1/4] avutil/x86/pixelutils: Empty MMX state in ff_pixelutils_sad_8x8_mmxext Henrik Gramner via ffmpeg-devel
2023-11-01 11:23 ` Andreas Rheinhardt
2023-11-03 11:15 ` Andreas Rheinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=GV1SPRMB0033EE5A7D85466FF529D15D8FA7A@GV1SPRMB0033.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git