avcodec/libjxlenc: use reciprocol gamma for GAMMA22 and GAMMA28

libjxl rejects JxlColorEncoding->gamma 2.2f or 2.8f and expects
1/2.2f or 1/2.8f, respectively.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
This commit is contained in:
Leo Izen 2023-04-04 10:16:21 -04:00
parent 00a062b8d5
commit 1179bb703e
No known key found for this signature in database
GPG Key ID: 5A71C331FD2FA19A
1 changed files with 2 additions and 2 deletions

View File

@ -335,11 +335,11 @@ static int libjxl_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFra
break;
case AVCOL_TRC_GAMMA22:
jxl_color.transfer_function = JXL_TRANSFER_FUNCTION_GAMMA;
jxl_color.gamma = 2.2;
jxl_color.gamma = 1/2.2f;
break;
case AVCOL_TRC_GAMMA28:
jxl_color.transfer_function = JXL_TRANSFER_FUNCTION_GAMMA;
jxl_color.gamma = 2.8;
jxl_color.gamma = 1/2.8f;
break;
default:
if (pix_desc->flags & AV_PIX_FMT_FLAG_FLOAT) {