[FFmpeg-devel] [PATCH 1/5] lavfi/colorspace: Add namespace prefix to global functions

Song, Ruiling ruiling.song at intel.com
Mon Jun 25 04:34:12 EEST 2018



> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
> Mark Thompson
> Sent: Monday, June 25, 2018 2:26 AM
> To: ffmpeg-devel at ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH 1/5] lavfi/colorspace: Add namespace prefix to
> global functions
> 
> ---
>  libavfilter/colorspace.c        | 13 +++++++------
>  libavfilter/colorspace.h        | 10 ++++++----
>  libavfilter/vf_colorspace.c     | 22 +++++++++++-----------
>  libavfilter/vf_tonemap_opencl.c |  8 ++++----
>  4 files changed, 28 insertions(+), 25 deletions(-)
> 
> diff --git a/libavfilter/colorspace.c b/libavfilter/colorspace.c
> index 7fd7bdf0d9..9a61318e8a 100644
> --- a/libavfilter/colorspace.c
> +++ b/libavfilter/colorspace.c
> @@ -20,7 +20,7 @@
>  #include "colorspace.h"
> 
> 
> -void invert_matrix3x3(const double in[3][3], double out[3][3])
> +void ff_invert_matrix3x3(const double in[3][3], double out[3][3])
>  {
>      double m00 = in[0][0], m01 = in[0][1], m02 = in[0][2],
>             m10 = in[1][0], m11 = in[1][1], m12 = in[1][2],
> @@ -47,7 +47,8 @@ void invert_matrix3x3(const double in[3][3], double
> out[3][3])
>      }
>  }
> 
> -void mul3x3(double dst[3][3], const double src1[3][3], const double src2[3][3])
> +void ff_mul3x3(double dst[3][3],
> +               const double src1[3][3], const double src2[3][3])
>  {
>      int m, n;
> 
> @@ -60,9 +61,9 @@ void mul3x3(double dst[3][3], const double src1[3][3],
> const double src2[3][3])
>  /*
>   * see e.g.
> http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
>   */
> -void fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
> -                        const struct WhitepointCoefficients *wp,
> -                        double rgb2xyz[3][3])
> +void ff_fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
> +                           const struct WhitepointCoefficients *wp,
> +                           double rgb2xyz[3][3])
>  {
>      double i[3][3], sr, sg, sb, zw;
> 
> @@ -73,7 +74,7 @@ void fill_rgb2xyz_table(const struct PrimaryCoefficients
> *coeffs,
>      rgb2xyz[2][0] = (1.0 - coeffs->xr - coeffs->yr) / coeffs->yr;
>      rgb2xyz[2][1] = (1.0 - coeffs->xg - coeffs->yg) / coeffs->yg;
>      rgb2xyz[2][2] = (1.0 - coeffs->xb - coeffs->yb) / coeffs->yb;
> -    invert_matrix3x3(rgb2xyz, i);
> +    ff_invert_matrix3x3(rgb2xyz, i);
>      zw = 1.0 - wp->xw - wp->yw;
>      sr = i[0][0] * wp->xw + i[0][1] * wp->yw + i[0][2] * zw;
>      sg = i[1][0] * wp->xw + i[1][1] * wp->yw + i[1][2] * zw;
> diff --git a/libavfilter/colorspace.h b/libavfilter/colorspace.h
> index d330917bd3..065c90fc52 100644
> --- a/libavfilter/colorspace.h
> +++ b/libavfilter/colorspace.h
> @@ -34,8 +34,10 @@ struct WhitepointCoefficients {
>      double xw, yw;
>  };
> 
> -void invert_matrix3x3(const double in[3][3], double out[3][3]);
> -void mul3x3(double dst[3][3], const double src1[3][3], const double src2[3][3]);
> -void fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
> -                        const struct WhitepointCoefficients *wp, double rgb2xyz[3][3]);
> +void ff_invert_matrix3x3(const double in[3][3], double out[3][3]);
> +void ff_mul3x3(double dst[3][3],
> +               const double src1[3][3], const double src2[3][3]);
> +void ff_fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
> +                           const struct WhitepointCoefficients *wp,
> +                           double rgb2xyz[3][3]);
I am basically ok with the patch. But I am not sure whether below function names would be more applicable as now they are under 'ff_' prefix.
ff_matrix_inverse_3x3()
ff_matrix_mul_3x3()

Ruiling


More information about the ffmpeg-devel mailing list