mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avcodec/libjxldec: produce rgbf32 and rgbaf32 frames
These pixel formats have always been supported by libjxl, but at the time this plugin was written, they were not in FFmpeg yet. Now that they are in FFmpeg, we should support them. Signed-off-by: Leo Izen <leo.izen@gmail.com>
This commit is contained in:
parent
4013b8d3f0
commit
f6ef6a853c
@ -130,10 +130,11 @@ static enum AVPixelFormat libjxl_get_pix_fmt(AVCodecContext *avctx, LibJxlDecode
|
||||
return basic_info->alpha_bits ? AV_PIX_FMT_YA8 : AV_PIX_FMT_GRAY8;
|
||||
}
|
||||
if (basic_info->exponent_bits_per_sample || basic_info->bits_per_sample > 16) {
|
||||
if (basic_info->alpha_bits)
|
||||
return AV_PIX_FMT_NONE;
|
||||
format->data_type = JXL_TYPE_FLOAT;
|
||||
return AV_PIX_FMT_GRAYF32;
|
||||
if (!basic_info->alpha_bits) {
|
||||
format->data_type = JXL_TYPE_FLOAT;
|
||||
return AV_PIX_FMT_GRAYF32;
|
||||
}
|
||||
av_log(avctx, AV_LOG_WARNING, "Downsampling gray+alpha float to 16-bit integer via libjxl\n");
|
||||
}
|
||||
format->data_type = JXL_TYPE_UINT16;
|
||||
return basic_info->alpha_bits ? AV_PIX_FMT_YA16 : AV_PIX_FMT_GRAY16;
|
||||
@ -145,10 +146,10 @@ static enum AVPixelFormat libjxl_get_pix_fmt(AVCodecContext *avctx, LibJxlDecode
|
||||
format->data_type = JXL_TYPE_UINT8;
|
||||
return basic_info->alpha_bits ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB24;
|
||||
}
|
||||
if (basic_info->exponent_bits_per_sample)
|
||||
av_log(avctx, AV_LOG_WARNING, "Downsampling float to 16-bit integer via libjxl\n");
|
||||
else if (basic_info->bits_per_sample > 16)
|
||||
av_log(avctx, AV_LOG_WARNING, "Downsampling larger integer to 16-bit via libjxl\n");
|
||||
if (basic_info->exponent_bits_per_sample || basic_info->bits_per_sample > 16) {
|
||||
format->data_type = JXL_TYPE_FLOAT;
|
||||
return basic_info->alpha_bits ? AV_PIX_FMT_RGBAF32 : AV_PIX_FMT_RGBF32;
|
||||
}
|
||||
format->data_type = JXL_TYPE_UINT16;
|
||||
return basic_info->alpha_bits ? AV_PIX_FMT_RGBA64 : AV_PIX_FMT_RGB48;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user