diff --git a/include/upipe-av/upipe_av_pixfmt.h b/include/upipe-av/upipe_av_pixfmt.h index 4ebe62762..92d6f1078 100644 --- a/include/upipe-av/upipe_av_pixfmt.h +++ b/include/upipe-av/upipe_av_pixfmt.h @@ -134,6 +134,8 @@ upipe_av_pixfmt_to_format(enum AVPixelFormat pix_fmt) return &uref_pic_flow_format_nv12; case AV_PIX_FMT_NV16: return &uref_pic_flow_format_nv16; + case AV_PIX_FMT_NV20LE: + return &uref_pic_flow_format_nv20le; #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 27, 100) case AV_PIX_FMT_NV24: return &uref_pic_flow_format_nv24; @@ -228,6 +230,7 @@ static inline enum AVPixelFormat AV_PIX_FMT_RGBA64BE, AV_PIX_FMT_NV12, AV_PIX_FMT_NV16, + AV_PIX_FMT_NV20LE, #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 27, 100) AV_PIX_FMT_NV24, #endif diff --git a/include/upipe/uref_pic_flow_formats.h b/include/upipe/uref_pic_flow_formats.h index eb174fe22..ffe965947 100644 --- a/include/upipe/uref_pic_flow_formats.h +++ b/include/upipe/uref_pic_flow_formats.h @@ -432,6 +432,12 @@ UREF_PIC_FLOW_FORMAT(nv16, 1, { 1, 1, 1, "y8", 8 }, { 2, 1, 2, "u8v8", 16 }); +/** @This is the description of the nv20le format: 10 bit samples in the low + * bits of little-endian 16 bit words, u and v interleaved. */ +UREF_PIC_FLOW_FORMAT(nv20le, 1, + { 1, 1, 2, "y10l", 10 }, + { 2, 1, 4, "u10v10l", 20 }); + /** @This is the description of the nv24 format. */ UREF_PIC_FLOW_FORMAT(nv24, 1, { 1, 1, 1, "y8", 8 }, @@ -494,6 +500,7 @@ UREF_PIC_FLOW_FORMAT(p010le, 1, Do(rgba64be, ## __VA_ARGS__) \ Do(nv12, ## __VA_ARGS__) \ Do(nv16, ## __VA_ARGS__) \ + Do(nv20le, ## __VA_ARGS__) \ Do(nv24, ## __VA_ARGS__) \ Do(gbrp, ## __VA_ARGS__) \ Do(p010le, ## __VA_ARGS__) \ diff --git a/lib/upipe-filters/upipe_audio_bar.c b/lib/upipe-filters/upipe_audio_bar.c index 2a338835b..8bab0b396 100644 --- a/lib/upipe-filters/upipe_audio_bar.c +++ b/lib/upipe-filters/upipe_audio_bar.c @@ -207,11 +207,11 @@ static void copy_color10(uint8_t **dst, const size_t *strides, if (dst[4] != NULL) { // u10v10l uint16_t *d = (uint16_t*)&dst[4][(row / vsubs[4]) * strides[4] + - 2 * col / hsubs[4]]; + 4 * col / hsubs[4]]; for (int i = 0; i < w / hsubs[4]; i++) { - d[i * 2] = color[1]; - d[i * 2 + 1] = color[2]; + d[i * 2] = color[1] << 2; + d[i * 2 + 1] = color[2] << 2; } } }