From: Lynne <dev@lynne.ee>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v11 1/5] avcodec/jpegxl: add Jpeg XL image codec and parser
Date: Fri, 1 Apr 2022 04:27:02 +0200 (CEST)
Message-ID: <MzXwd5K--B-2@lynne.ee> (raw)
In-Reply-To: <MzXt_Xh--3-2@lynne.ee-MzXtdZd----2>
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".
next prev parent reply other threads:[~2022-04-01 2:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 0:20 [FFmpeg-devel] [PATCH v11 0/5] Jpeg XL Patch Set Leo Izen
2022-04-01 0:20 ` [FFmpeg-devel] [PATCH v11 1/5] avcodec/jpegxl: add Jpeg XL image codec and parser Leo Izen
2022-04-01 2:13 ` Lynne
[not found] ` <MzXt_Xh--3-2@lynne.ee-MzXtdZd----2>
2022-04-01 2:27 ` Lynne [this message]
2022-04-01 0:20 ` [FFmpeg-devel] [PATCH v11 2/5] avcodec/libjxl: add Jpeg XL decoding via libjxl Leo Izen
2022-04-01 0:20 ` [FFmpeg-devel] [PATCH v11 3/5] avcodec/libjxl: add Jpeg XL encoding " Leo Izen
2022-04-01 0:20 ` [FFmpeg-devel] [PATCH v11 4/5] avformat/image2: add Jpeg XL as image2 format Leo Izen
2022-04-01 0:20 ` [FFmpeg-devel] [PATCH v11 5/5] fate/jpegxl: add Jpeg XL demux and parse FATE test Leo Izen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MzXwd5K--B-2@lynne.ee \
--to=dev@lynne.ee \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git