[vlc-commits] [Git][videolan/vlc][master] 3 commits: opengl/sampler: don't pass redundant information
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Oct 12 08:22:38 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
32e2efff by Steve Lhomme at 2023-10-12T07:55:43+00:00
opengl/sampler: don't pass redundant information
The chroma is already in the chroma description.
- - - - -
58f56f35 by Steve Lhomme at 2023-10-12T07:55:43+00:00
opengl/sw: don't pass redundant information
The chroma is already in the chroma description.
- - - - -
2a5e910d by Steve Lhomme at 2023-10-12T07:55:43+00:00
opengl/sw: only check YUV status when needed
No need to check if we're going to reject the chroma anyway.
- - - - -
2 changed files:
- modules/video_output/opengl/interop_sw.c
- modules/video_output/opengl/sampler.c
Changes:
=====================================
modules/video_output/opengl/interop_sw.c
=====================================
@@ -434,7 +434,7 @@ static bool fixGLFormat(struct vlc_gl_interop *interop, GLint* intfmt, GLint* fm
static int
interop_yuv_base_init(struct vlc_gl_interop *interop,
- vlc_fourcc_t chroma, const vlc_chroma_description_t *desc)
+ const vlc_chroma_description_t *desc)
{
struct interop_formats
{
@@ -460,7 +460,7 @@ interop_yuv_base_init(struct vlc_gl_interop *interop,
if (desc->plane_count == 1)
{
- if (chroma == VLC_CODEC_VUYA)
+ if (desc->fcc == VLC_CODEC_VUYA)
{
interop->tex_count = 2;
interop->texs[0] = (struct vlc_gl_tex_cfg) {
@@ -471,7 +471,7 @@ interop_yuv_base_init(struct vlc_gl_interop *interop,
}
else if (desc->pixel_size != 2)
{
- msg_Warn(interop->gl, "unsupported chroma %.4s", (char*)&chroma);
+ msg_Warn(interop->gl, "unsupported chroma %.4s", (char*)&desc->fcc);
return VLC_EGENERIC;
}
@@ -653,7 +653,6 @@ static int
opengl_interop_init(struct vlc_gl_interop *interop,
vlc_fourcc_t chroma, video_color_space_t yuv_space)
{
- bool is_yuv = vlc_fourcc_IsYUV(chroma);
const vlc_chroma_description_t *desc =
vlc_fourcc_GetChromaDescription(chroma);
if (!desc)
@@ -670,8 +669,8 @@ opengl_interop_init(struct vlc_gl_interop *interop,
return VLC_SUCCESS;
}
- if (is_yuv)
- return interop_yuv_base_init(interop, chroma, desc);
+ if (vlc_fourcc_IsYUV(chroma))
+ return interop_yuv_base_init(interop, desc);
return interop_rgb_base_init(interop, chroma);
}
=====================================
modules/video_output/opengl/sampler.c
=====================================
@@ -175,7 +175,7 @@ init_conv_matrix(float conv_matrix_out[],
}
static int
-sampler_yuv_base_init(struct vlc_gl_sampler *sampler, vlc_fourcc_t chroma,
+sampler_yuv_base_init(struct vlc_gl_sampler *sampler,
const vlc_chroma_description_t *desc,
video_color_space_t yuv_space)
{
@@ -188,7 +188,7 @@ sampler_yuv_base_init(struct vlc_gl_sampler *sampler, vlc_fourcc_t chroma,
if (desc->pixel_size == 2)
{
- if (chroma != VLC_CODEC_P010 && chroma != VLC_CODEC_P016) {
+ if (desc->fcc != VLC_CODEC_P010 && desc->fcc != VLC_CODEC_P016) {
/* Do a bit shift if samples are stored on LSB. */
float yuv_range_correction = (float)((1 << 16) - 1)
/ ((1 << desc->pixel_bits) - 1);
@@ -234,8 +234,8 @@ sampler_yuv_base_init(struct vlc_gl_sampler *sampler, vlc_fourcc_t chroma,
*
* This is equivalent to swap columns 1 and 2.
*/
- bool swap_uv = chroma == VLC_CODEC_YV12 || chroma == VLC_CODEC_YV9 ||
- chroma == VLC_CODEC_NV21;
+ bool swap_uv = desc->fcc == VLC_CODEC_YV12 || desc->fcc == VLC_CODEC_YV9 ||
+ desc->fcc == VLC_CODEC_NV21;
if (swap_uv)
{
/* Remember, the matrix in column-major order */
@@ -471,7 +471,6 @@ xyz12_shader_init(struct vlc_gl_sampler *sampler)
static int
opengl_init_swizzle(struct vlc_gl_sampler *sampler,
const char *swizzle_per_tex[],
- vlc_fourcc_t chroma,
const vlc_chroma_description_t *desc)
{
if (desc->plane_count == 4)
@@ -498,7 +497,7 @@ opengl_init_swizzle(struct vlc_gl_sampler *sampler,
* V Y1 U Y2 => GBR
* Y1 V Y2 U => RAG
*/
- switch (chroma)
+ switch (desc->fcc)
{
case VLC_CODEC_UYVY:
swizzle_per_tex[0] = "g";
@@ -738,10 +737,10 @@ opengl_fragment_shader_init(struct vlc_gl_sampler *sampler, bool expose_planes)
if (is_yuv)
{
- ret = sampler_yuv_base_init(sampler, chroma, desc, yuv_space);
+ ret = sampler_yuv_base_init(sampler, desc, yuv_space);
if (ret != VLC_SUCCESS)
return ret;
- ret = opengl_init_swizzle(sampler, swizzle_per_tex, chroma, desc);
+ ret = opengl_init_swizzle(sampler, swizzle_per_tex, desc);
if (ret != VLC_SUCCESS)
return ret;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/702e8c8abfeb05c06657af88494aab55a990431c...2a5e910dd38f5238a302fcdc07354805c916220e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/702e8c8abfeb05c06657af88494aab55a990431c...2a5e910dd38f5238a302fcdc07354805c916220e
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