The top/bottom of the barrel are each coded as two semicircles inside a square block in the frame. Mask out the parts of the square that lie outside of these semicircles, so they are made transparent when alpha_mask=1. Fixes the other part of #9725.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -3744,6 +3744,7 @@ static int barrelsplit_to_xyz(const V360Context *s, · 3743 unmodified lines | ||
| 3744 | 3744 | const float x = (i + 0.5f) / width; |
| 3745 | 3745 | const float y = (j + 0.5f) / height; |
| 3746 | 3746 | float l_x, l_y, l_z; |
| 3747 | + int ret; | |
| 3747 | 3748 | |
| 3748 | 3749 | if (x < 2.f / 3.f) { |
| 3749 | 3750 | const float scalew = s->fout_pad > 0 ? 1.f - s->fout_pad / (width * 2.f / 3.f) : 1.f - s->out_pad; |
| @@ -3762,6 +3763,8 @@ static int barrelsplit_to_xyz(const V360Context *s, · 12 unmodified lines | ||
| 3762 | 3763 | l_x = cos_theta * sin_phi; |
| 3763 | 3764 | l_y = sin_theta; |
| 3764 | 3765 | l_z = cos_theta * cos_phi; |
| 3766 | + | |
| 3767 | + ret = 1; | |
| 3765 | 3768 | } else { |
| 3766 | 3769 | const float scalew = s->fout_pad > 0 ? 1.f - s->fout_pad / (width / 3.f) : 1.f - s->out_pad; |
| 3767 | 3770 | const float scaleh = s->fout_pad > 0 ? 1.f - s->fout_pad / (height / 4.f) : 1.f - s->out_pad; |
| @@ -3787,13 +3790,14 @@ static int barrelsplit_to_xyz(const V360Context *s, · 19 unmodified lines | ||
| 3787 | 3790 | l_x = (0.5f - uf) / scalew; |
| 3788 | 3791 | l_y = 0.5f * dir_vert; |
| 3789 | 3792 | l_z = (vf - 0.5f) * dir_vert / scaleh; |
| 3793 | + ret = (l_x * l_x * scalew * scalew + l_z * l_z * scaleh * scaleh) < 0.5f * 0.5f; | |
| 3790 | 3794 | } |
| 3791 | 3795 | |
| 3792 | 3796 | vec[0] = l_x; |
| 3793 | 3797 | vec[1] = l_y; |
| 3794 | 3798 | vec[2] = l_z; |
| 3795 | 3799 | |
| 3796 | − return 1; | |
| 3800 | + return ret; | |
| 3797 | 3801 | } |
| 3798 | 3802 | |
| 3799 | 3803 | /** |