From: rcombs <ffmpegagent@gmail.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 1/2] lavfi/colorspace: add ff_matrix_mul_3x3_vec Date: Thu, 02 Jun 2022 17:57:05 +0000 Message-ID: <fec89f3a61035cadf2c371e187e1f6e84ddc1dcd.1654192626.git.ffmpegagent@gmail.com> (raw) In-Reply-To: <pull.33.ffstaging.FFmpeg.1654192626.ffmpegagent@gmail.com> From: rcombs <rcombs@rcombs.me> Signed-off-by: rcombs <rcombs@rcombs.me> --- libavfilter/colorspace.c | 11 +++++++++++ libavfilter/colorspace.h | 1 + 2 files changed, 12 insertions(+) diff --git a/libavfilter/colorspace.c b/libavfilter/colorspace.c index 7f74fe5113..f0bd14be18 100644 --- a/libavfilter/colorspace.c +++ b/libavfilter/colorspace.c @@ -62,6 +62,17 @@ void ff_matrix_mul_3x3(double dst[3][3], src2[m][1] * src1[1][n] + src2[m][2] * src1[2][n]; } + +void ff_matrix_mul_3x3_vec(double dst[3], const double vec[3], const double mat[3][3]) +{ + int m; + + for (m = 0; m < 3; m++) + dst[m] = vec[0] * mat[m][0] + + vec[1] * mat[m][1] + + vec[2] * mat[m][2]; +} + /* * see e.g. http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html */ diff --git a/libavfilter/colorspace.h b/libavfilter/colorspace.h index 879518d242..4d98b1da2e 100644 --- a/libavfilter/colorspace.h +++ b/libavfilter/colorspace.h @@ -29,6 +29,7 @@ void ff_matrix_invert_3x3(const double in[3][3], double out[3][3]); void ff_matrix_mul_3x3(double dst[3][3], const double src1[3][3], const double src2[3][3]); +void ff_matrix_mul_3x3_vec(double dst[3], const double vec[3], const double mat[3][3]); void ff_fill_rgb2xyz_table(const AVPrimaryCoefficients *coeffs, const AVWhitepointCoefficients *wp, double rgb2xyz[3][3]); -- ffmpeg-codebot _______________________________________________ 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:[~2022-06-02 17:57 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-02 17:57 [FFmpeg-devel] [PATCH 0/2] lavfi/drawutils: improve colorspace support ffmpegagent 2022-06-02 17:57 ` rcombs [this message] 2022-06-02 17:57 ` [FFmpeg-devel] [PATCH 2/2] " rcombs
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=fec89f3a61035cadf2c371e187e1f6e84ddc1dcd.1654192626.git.ffmpegagent@gmail.com \ --to=ffmpegagent@gmail.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