[FFmpeg-cvslog] avfilter/vf_v360: fill unused regions too for orthographic output format
Paul B Mahol
git at videolan.org
Sun Aug 22 15:10:31 EEST 2021
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Aug 22 14:00:04 2021 +0200| [da6aab45e42a41b2b5750f7f36cb7da7de26c4ed] | committer: Paul B Mahol
avfilter/vf_v360: fill unused regions too for orthographic output format
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da6aab45e42a41b2b5750f7f36cb7da7de26c4ed
---
libavfilter/vf_v360.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index b6e9acf5dc..58915c5487 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -2055,13 +2055,20 @@ static int orthographic_to_xyz(const V360Context *s,
const float r = hypotf(x, y);
const float theta = asinf(r);
- vec[0] = x;
- vec[1] = y;
vec[2] = cosf(theta);
+ if (vec[2] > 0) {
+ vec[0] = x;
+ vec[1] = y;
- normalize_vector(vec);
+ normalize_vector(vec);
+ return 1;
+ } else {
+ vec[0] = 0;
+ vec[1] = 0;
+ vec[2] = 1;
- return 1;
+ return 0;
+ }
}
/**
More information about the ffmpeg-cvslog
mailing list