]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/transform: Stop exporting internal functions
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 24 Feb 2021 13:52:04 +0000 (14:52 +0100)
committerJames Almer <jamrial@gmail.com>
Tue, 27 Apr 2021 13:43:11 +0000 (10:43 -0300)
avfilter_transform, avfilter_(add|sub|mult)_matrix are not part of the
public API (transform.h is not a public header), yet they are currently
exported because of their name. This commit changes this:
avfilter_transform is renamed to ff_affine_transform; the other
functions are just removed as they have never been used at all.

Found-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavfilter/transform.c
libavfilter/transform.h
libavfilter/vf_deshake.c

index f4f9e0a47d9fa6f3e9f92ae3e678449877907011..1f91436f7356acaa5756935c2307ad58be87dd2f 100644 (file)
@@ -122,28 +122,7 @@ void ff_get_matrix(
     matrix[8] = 1;
 }
 
-void avfilter_add_matrix(const float *m1, const float *m2, float *result)
-{
-    int i;
-    for (i = 0; i < 9; i++)
-        result[i] = m1[i] + m2[i];
-}
-
-void avfilter_sub_matrix(const float *m1, const float *m2, float *result)
-{
-    int i;
-    for (i = 0; i < 9; i++)
-        result[i] = m1[i] - m2[i];
-}
-
-void avfilter_mul_matrix(const float *m1, float scalar, float *result)
-{
-    int i;
-    for (i = 0; i < 9; i++)
-        result[i] = m1[i] * scalar;
-}
-
-int avfilter_transform(const uint8_t *src, uint8_t *dst,
+int ff_affine_transform(const uint8_t *src, uint8_t *dst,
                         int src_stride, int dst_stride,
                         int width, int height, const float *matrix,
                         enum InterpolateMethod interpolate,
index 9b0c19ceca97d6432eaa2145dae0620a5dbc547e..0344f9c228e86557b357220fec0bd50d9d2e7722 100644 (file)
@@ -83,33 +83,6 @@ void ff_get_matrix(
     float *matrix
 );
 
-/**
- * Add two matrices together. result = m1 + m2.
- *
- * @param m1     9-item transformation matrix
- * @param m2     9-item transformation matrix
- * @param result 9-item transformation matrix
- */
-void avfilter_add_matrix(const float *m1, const float *m2, float *result);
-
-/**
- * Subtract one matrix from another. result = m1 - m2.
- *
- * @param m1     9-item transformation matrix
- * @param m2     9-item transformation matrix
- * @param result 9-item transformation matrix
- */
-void avfilter_sub_matrix(const float *m1, const float *m2, float *result);
-
-/**
- * Multiply a matrix by a scalar value. result = m1 * scalar.
- *
- * @param m1     9-item transformation matrix
- * @param scalar a number
- * @param result 9-item transformation matrix
- */
-void avfilter_mul_matrix(const float *m1, float scalar, float *result);
-
 /**
  * Do an affine transformation with the given interpolation method. This
  * multiplies each vector [x,y,1] by the matrix and then interpolates to
@@ -126,7 +99,7 @@ void avfilter_mul_matrix(const float *m1, float scalar, float *result);
  * @param fill        edge fill method
  * @return negative on error
  */
-int avfilter_transform(const uint8_t *src, uint8_t *dst,
+int ff_affine_transform(const uint8_t *src, uint8_t *dst,
                         int src_stride, int dst_stride,
                         int width, int height, const float *matrix,
                         enum InterpolateMethod interpolate,
index 28a541b94a7f4479a6c1f93bc846743f20be86b5..877139935134cd575e2a625a1d103d6bde1aa7fd 100644 (file)
@@ -330,8 +330,9 @@ static int deshake_transform_c(AVFilterContext *ctx,
 
     for (i = 0; i < 3; i++) {
         // Transform the luma and chroma planes
-        ret = avfilter_transform(in->data[i], out->data[i], in->linesize[i], out->linesize[i],
-                                 plane_w[i], plane_h[i], matrixs[i], interpolate, fill);
+        ret = ff_affine_transform(in->data[i], out->data[i], in->linesize[i],
+                                  out->linesize[i], plane_w[i], plane_h[i],
+                                  matrixs[i], interpolate, fill);
         if (ret < 0)
             return ret;
     }