From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 2/4] lavfi/vf_v360: factorize vector computation for barrelsplit
Date: Thu, 19 May 2022 15:47:26 +0200
Message-ID: <20220519134728.15354-2-anton@khirnov.net> (raw)
In-Reply-To: <20220519134728.15354-1-anton@khirnov.net>
---
libavfilter/vf_v360.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 8f36d207c9..620a995733 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -3765,6 +3765,7 @@ static int barrelsplit_to_xyz(const V360Context *s,
const float scaleh = s->fout_pad > 0 ? 1.f - s->fout_pad / (height / 4.f) : 1.f - s->out_pad;
const int face = floorf(y * 4.f);
+ const float dir_vert = (face == 1 || face == 3) ? 1.0f : -1.0f;
float uf, vf;
uf = x * 3.f - 2.f;
@@ -3774,36 +3775,23 @@ static int barrelsplit_to_xyz(const V360Context *s,
vf = y * 2.f;
uf = 1.f - uf;
vf = 0.5f - vf;
-
- l_x = (0.5f - uf) / scalew;
- l_y = -0.5f;
- l_z = (0.5f - vf) / scaleh;
break;
case 1:
vf = y * 2.f;
uf = 1.f - uf;
vf = 1.f - (vf - 0.5f);
-
- l_x = (0.5f - uf) / scalew;
- l_y = 0.5f;
- l_z = (-0.5f + vf) / scaleh;
break;
case 2:
vf = y * 2.f - 0.5f;
vf = 1.f - (1.f - vf);
-
- l_x = (0.5f - uf) / scalew;
- l_y = -0.5f;
- l_z = (0.5f - vf) / scaleh;
break;
case 3:
vf = y * 2.f - 1.5f;
-
- l_x = (0.5f - uf) / scalew;
- l_y = 0.5f;
- l_z = (-0.5f + vf) / scaleh;
break;
}
+ l_x = (0.5f - uf) / scalew;
+ l_y = 0.5f * dir_vert;
+ l_z = (vf - 0.5f) * dir_vert / scaleh;
}
vec[0] = l_x;
--
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:[~2022-05-19 13:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-19 13:47 [FFmpeg-devel] [PATCH 1/4] lavfi/vf_v360: drop nonsense inline specifier Anton Khirnov
2022-05-19 13:47 ` Anton Khirnov [this message]
2022-05-19 13:47 ` [FFmpeg-devel] [PATCH 3/4] lavfi/vf_v360: fix barrelsplit transform with padding Anton Khirnov
2022-05-19 13:47 ` [FFmpeg-devel] [PATCH 4/4] lavfi/vf_v360: implement output mask for barrelsplit Anton Khirnov
2022-05-24 11:57 ` [FFmpeg-devel] [PATCH 1/4] lavfi/vf_v360: drop nonsense inline specifier Anton Khirnov
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=20220519134728.15354-2-anton@khirnov.net \
--to=anton@khirnov.net \
--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