summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/vo.rst3
-rw-r--r--video/out/opengl/lcms.c2
-rw-r--r--video/out/opengl/video.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst
index 21341d98c6..0beaee59a5 100644
--- a/DOCS/man/vo.rst
+++ b/DOCS/man/vo.rst
@@ -1098,8 +1098,7 @@ Available video output drivers are:
``3dlut-size=<r>x<g>x<b>``
Size of the 3D LUT generated from the ICC profile in each dimension.
- Default is 64x64x64.
- Sizes must be a power of two, and 512 at most.
+ Default is 64x64x64. Sizes may range from 2 to 512.
``icc-contrast=<0-100000>``
Specifies an upper limit on the target device's contrast ratio.
diff --git a/video/out/opengl/lcms.c b/video/out/opengl/lcms.c
index 7cf2d42466..ec352cde05 100644
--- a/video/out/opengl/lcms.c
+++ b/video/out/opengl/lcms.c
@@ -59,7 +59,7 @@ static bool parse_3dlut_size(const char *arg, int *p1, int *p2, int *p3)
return false;
for (int n = 0; n < 3; n++) {
int s = ((int[]) { *p1, *p2, *p3 })[n];
- if (s < 2 || s > 512 || ((s - 1) & s))
+ if (s < 2 || s > 512)
return false;
}
return true;
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index d403f6211a..901e208cab 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -631,8 +631,10 @@ static bool gl_video_get_lut3d(struct gl_video *p, enum mp_csp_prim prim,
gl->ActiveTexture(GL_TEXTURE0 + TEXUNIT_3DLUT);
gl->BindTexture(GL_TEXTURE_3D, p->lut_3d_texture);
+ gl->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
gl->TexImage3D(GL_TEXTURE_3D, 0, GL_RGB16, lut3d->size[0], lut3d->size[1],
lut3d->size[2], 0, GL_RGB, GL_UNSIGNED_SHORT, lut3d->data);
+ gl->PixelStorei(GL_UNPACK_ALIGNMENT, 4);
gl->TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
gl->TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl->TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);