mpegts: Fix bit-depth storage for jpeg-xs

As per ISO/IEC 21122-3 2019:

> Sample_Bitdepth code shall specify directly the bitdepth of the components
minus 1

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3945

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7775>
This commit is contained in:
Edward Hervey 2024-10-29 09:49:50 +01:00 committed by GStreamer Marge Bot
parent fb16abcd73
commit 0942dc57dd
2 changed files with 2 additions and 2 deletions

View file

@ -1865,7 +1865,7 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream,
/* interlace-mode, sampling, depth */ /* interlace-mode, sampling, depth */
gst_caps_set_simple (caps, "width", G_TYPE_INT, jpegxs.horizontal_size, gst_caps_set_simple (caps, "width", G_TYPE_INT, jpegxs.horizontal_size,
"height", G_TYPE_INT, jpegxs.vertical_size, "depth", G_TYPE_INT, "height", G_TYPE_INT, jpegxs.vertical_size, "depth", G_TYPE_INT,
(jpegxs.schar >> 4) & 0xf, NULL); ((jpegxs.schar >> 4) & 0xf) + 1, NULL);
switch (jpegxs.schar & 0xf) { switch (jpegxs.schar & 0xf) {
case 0: case 0:
gst_caps_set_simple (caps, "sampling", G_TYPE_STRING, "YCbCr-4:2:2", gst_caps_set_simple (caps, "sampling", G_TYPE_STRING, "YCbCr-4:2:2",

View file

@ -525,7 +525,7 @@ gst_base_ts_mux_jpegxs_descriptor (GstBaseTsMux * mux,
} }
{ {
guint16 schar = (depth & 0xf) << 4; guint16 schar = ((depth - 1) & 0xf) << 4;
/* FIXME : Support all other variants */ /* FIXME : Support all other variants */
if (!g_strcmp0 (sampling, "YCbCr-4:2:2")) { if (!g_strcmp0 (sampling, "YCbCr-4:2:2")) {
schar |= 0; schar |= 0;