From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5058C42818 for ; Fri, 1 Apr 2022 02:27:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6F6D368B23D; Fri, 1 Apr 2022 05:27:10 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4A95168B23C for ; Fri, 1 Apr 2022 05:27:02 +0300 (EEST) Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id 62B34106016E for ; Fri, 1 Apr 2022 02:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1648780022; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=5aX0PpJF9/OW4bLj7IUkGxYRf+7VeMD5qopciND29VU=; b=0KuVf1V0wIiP37cPtayPvyeAmyAldOjRVXOZqdwf3uOpcaTregkK+F0VDrDStCDm 3Hfr/VqzuswHWz/RMix2glyryrs0XqPCrZMfh0ZUFW+d5XxhX8Prb9PTGNG3BYHb/ZG +lOR0JqqRK/MZxCBl1KtmqAlrGetkIN8Ci+RnaHdZ7g8eargsDLcH2zCbwXLbktH1cc afduB9PGMOklNudLx8AxIb+xB5GaSXBwdeyQpFBixzRXN0XRXArVYKkxrIidjsIW98o te0gJQxrPCSNSBKQY7d+D5ug5a7MXktDHPqnU5hrdSWfhNDBS3ia7suMvtilnwrB++U BxA0YzB4aA== Date: Fri, 1 Apr 2022 04:27:02 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: References: <20220401002006.44582-1-leo.izen@gmail.com> <20220401002006.44582-2-leo.izen@gmail.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v11 1/5] avcodec/jpegxl: add Jpeg XL image codec and parser X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 1 Apr 2022, 04:13 by dev@lynne.ee: > 1 Apr 2022, 02:20 by leo.izen@gmail.com: > >> This commit adds support to libavcodec to read and parse >> encoded Jpeg XL images. Jpeg XL is intended to be an >> extended-life replacement to legacy mjpeg. >> --- >> MAINTAINERS | 2 + >> libavcodec/Makefile | 1 + >> libavcodec/codec_desc.c | 9 + >> libavcodec/codec_id.h | 1 + >> libavcodec/jpegxl.h | 43 ++ >> libavcodec/jpegxl_parser.c | 951 +++++++++++++++++++++++++++++++++++++ >> + } >> + } >> + if (header->color_space == FF_JPEGXL_CS_GRAY) { >> + if (header->bits_per_sample <= 8) >> + return alpha ? AV_PIX_FMT_YA8 : AV_PIX_FMT_GRAY8; >> + if (header->bits_per_sample > 16 || header->exp_bits_per_sample) >> + return alpha ? AV_PIX_FMT_NONE : AV_PIX_FMT_GRAYF32; >> + return alpha ? AV_PIX_FMT_YA16 : AV_PIX_FMT_GRAY16; >> + } else if (header->color_space == FF_JPEGXL_CS_RGB >> + || header->color_space == FF_JPEGXL_CS_XYB) { >> + if (header->bits_per_sample <= 8) >> + return alpha ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB24; >> + if (header->bits_per_sample > 16 || header->exp_bits_per_sample) >> + return alpha ? AV_PIX_FMT_GBRAPF32 : AV_PIX_FMT_GBRPF32; >> + return alpha ? AV_PIX_FMT_RGBA64 : AV_PIX_FMT_RGB48; >> + } >> + return AV_PIX_FMT_NONE; >> > > YUV is supported, via the do_YCbCr flag in the spec. I think > we ought to set the pixel format to YUV444P/16 in that case, > as the codec requires YUV to be upsampled during decoding, > and doing unnecessary colorspace conversions inside > decoders is something we don't want. > Decoders are free to change what the parser sets, so if > users link to libjxl, then RGB will be reported as lavf will > decode the first frame during probing. > Otherwise, the native decoder would match what the parser > reports and output YUV444-frames when signalled. > Come to think of it, we better output XYB instead of RGB. But that can be changed later, for now I think it's fine if the parser always reports either RGB or Gray, so this is fine as-is. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".