[vlc-commits] [Git][videolan/vlc][master] opengl: handle downscaled luminance components
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Wed Mar 16 16:45:19 UTC 2022
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
05572e3f by Romain Vimont at 2022-03-16T15:39:54+00:00
opengl: handle downscaled luminance components
Commit d8aebc365d81e76d4d502e7f97464f8fb3d65482 said:
> The texture scaling factor represents how a plane is scaled compared
> to the first plane, so by definition, the first plane is not scaled
> (its ratio is 1:1).
However, with YUY2 pictures, half the horizontal resolution is currently
lost by the interop. Therefore, until this is fixed, the sampler must
scale accordingly.
This reverts commit d8aebc365d81e76d4d502e7f97464f8fb3d65482.
Fixes #26682
- - - - -
1 changed file:
- modules/video_output/opengl/importer.c
Changes:
=====================================
modules/video_output/opengl/importer.c
=====================================
@@ -341,8 +341,14 @@ vlc_gl_importer_Update(struct vlc_gl_importer *importer, picture_t *picture)
/* The transformation is the same for all planes, even with power-of-two
* textures. */
- float scale_w = glfmt->tex_widths[0];
- float scale_h = glfmt->tex_heights[0];
+ /* FIXME The first plane may have a ratio != 1:1, because with YUV 4:2:2
+ * formats, the Y2 value is ignored so half the horizontal resolution
+ * is lost, see interop_yuv_base_init(). Once this is fixed, the
+ * multiplication by den/num may be removed. */
+ float scale_w = glfmt->tex_widths[0] * interop->texs[0].w.den
+ / interop->texs[0].w.num;
+ float scale_h = glfmt->tex_heights[0] * interop->texs[0].h.den
+ / interop->texs[0].h.num;
/* Warning: if NPOT is not supported a larger texture is
allocated. This will cause right and bottom coordinates to
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/05572e3fd57c332280987f835ca047f005f5328e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/05572e3fd57c332280987f835ca047f005f5328e
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list