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 B00DD42814 for ; Fri, 1 Apr 2022 02:13:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7700D68B23D; Fri, 1 Apr 2022 05:13:49 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 19F2668B0FD for ; Fri, 1 Apr 2022 05:13:42 +0300 (EEST) Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id 91D1810601E1 for ; Fri, 1 Apr 2022 02:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1648779221; 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=zB+IVw2l+igKvYKEtmpGwnoToi7HXYUVPIb0HMcVE34=; b=jmD/0IYcfjEE4NSVVd65UkIbigbKMAQTgzS9COGHp7Uor248fUHSGs6JBDksFRiJ kAVMVu5qrEt4Dqi42LjfjUPIDB961YpZB9YEi1m1fAXBl2kBtbvklTCbp55AckSUksj tofYlotjbZ4i9hrwpWI+OruauuMbqnIgRTTazJYSdmVGgN+HtdO86IKcLYn5RzjrljA vDnsP46rfdyOIwXjMk5DQa1lT3Hf+ePFT/Vh6JvzqHlhi1TzOWZZxGCyEKh1THQHsr9 4xvCX3qzoWs00rzCjaOxMEU9tDmgZYEz4pSgmtEDWn22CmUb7Cxdhi3GvbB6wE8SWuA +V7g9xiEIA== Date: Fri, 1 Apr 2022 04:13:41 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: <20220401002006.44582-2-leo.izen@gmail.com> 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, 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. _______________________________________________ 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".