History

avfilter/vf_v360: improve interpolation for equirect input at poles

Paul B Mahol committed 6 years ago

Commit 8f3df1d1 parent be82dc11 file · +18 −2Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_v360.c+18−2
@@ -639,6 +639,22 @@ static inline int reflecty(int y, int h) · 638 unmodified lines
639 return y;639 return y;
640}640}
641 641
642/**
643 * Reflect x operation for equirect.
644 *
645 * @param x input horizontal position
646 * @param y input vertical position
647 * @param w input width
648 * @param h input height
649 */
650static inline int ereflectx(int x, int y, int w, int h)
651{
652 if (y < 0 || y >= h)
653 x += w / 2;
654
655 return mod(x, w);
656}
657
642/**658/**
643 * Reflect x operation.659 * Reflect x operation.
644 *660 *
@@ -1745,8 +1761,8 @@ static int xyz_to_equirect(const V360Context *s, · 1100 unmodified lines
1745 1761
1746 for (int i = 0; i < 4; i++) {1762 for (int i = 0; i < 4; i++) {
1747 for (int j = 0; j < 4; j++) {1763 for (int j = 0; j < 4; j++) {
1748 us[i][j] = mod(ui + j - 1, width);1764 us[i][j] = ereflectx(ui + j - 1, vi + i - 1, width, height);
1749 vs[i][j] = av_clip(vi + i - 1, 0, height - 1);1765 vs[i][j] = reflecty(vi + i - 1, height);
1750 }1766 }
1751 }1767 }
1752 1768

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t