diff mbox series

[FFmpeg-devel] avcodec/libjxlenc: use reciprocol gamma for GAMMA22 and GAMMA28

Message ID 20230404141831.51853-1-leo.izen@gmail.com
State New
Headers show
Series [FFmpeg-devel] avcodec/libjxlenc: use reciprocol gamma for GAMMA22 and GAMMA28 | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Leo Izen April 4, 2023, 2:18 p.m. UTC
libjxl rejects JxlColorEncoding->gamma 2.2f or 2.8f and expects
0.45455f or 0.35714f, respectively.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
---
 libavcodec/libjxlenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Leo Izen April 12, 2023, 3:18 p.m. UTC | #1
On 4/4/23 10:18, Leo Izen wrote:
> libjxl rejects JxlColorEncoding->gamma 2.2f or 2.8f and expects
> 0.45455f or 0.35714f, respectively.

Pushed as 1179bb703e35.
diff mbox series

Patch

diff --git a/libavcodec/libjxlenc.c b/libavcodec/libjxlenc.c
index 897452f575..82dfe189d6 100644
--- a/libavcodec/libjxlenc.c
+++ b/libavcodec/libjxlenc.c
@@ -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 = 0.45455;
         break;
     case AVCOL_TRC_GAMMA28:
         jxl_color.transfer_function = JXL_TRANSFER_FUNCTION_GAMMA;
-        jxl_color.gamma = 2.8;
+        jxl_color.gamma = 0.35714;
         break;
     default:
         if (pix_desc->flags & AV_PIX_FMT_FLAG_FLOAT) {