avfilter/vf_ssim360: compute the barrel density once per row

The cos() value only depends on the row, but it was computed for every
pixel in the row. No change in output.

Found during a code review sweep of ffmpeg using an LLM.
This commit is contained in:
romainhedouin authored and Baptiste Coudurier committed 2026-10-17 18:40:29 +00:00
1 parent 2193727b88
commit 94b8431a55
1 file changed
+1 -1
+1 -1
View File
@@ -1498,8 +1498,8 @@ static int generate_density_map(SSIM360Context *s, int w, int h)
case PROJECTION_BARREL:
// side face
for (int i = 0; i < h; i++) {
d = cos(((0.5 + i) / h - 0.5) * DEFAULT_EXPANSION_COEF * M_PI_2);
for (int j = 0; j < w * 4 / 5; j++) {
d = cos(((0.5 + i) / h - 0.5) * DEFAULT_EXPANSION_COEF * M_PI_2);
s->density.value[i * w + j] = d * d * d;
}
}