History

avcodec/libjxldec: fix gamma22 and gamma28 recognition

Gamma 2.2 and Gamma 2.8 are tagged in the file as 0.45455 and 0.35714, respectively (i.e. 1/2.2 and 1/2.8). Trying to identify them as 2.2 and 2.8 instead of these values will cause the transfer function to not properly be recognized. This patch fixes this.

Leo Izen committed 3 years ago

Commit 9d5e6691 parent ab8cde61 file · +2 −2Browse files

Unified · Split

libavcodec/libjxldec.c+2−2
@@ -167,9 +167,9 @@ static enum AVColorTransferCharacteristic libjxl_get_trc(void *avctx, const JxlC · 166 unmodified lines
167167 case JXL_TRANSFER_FUNCTION_DCI: return AVCOL_TRC_SMPTE428;
168168 case JXL_TRANSFER_FUNCTION_HLG: return AVCOL_TRC_ARIB_STD_B67;
169169 case JXL_TRANSFER_FUNCTION_GAMMA:
170− if (jxl_color->gamma > 2.199 && jxl_color->gamma < 2.201)
170+ if (jxl_color->gamma > 0.45355 && jxl_color->gamma < 0.45555)
171171 return AVCOL_TRC_GAMMA22;
172− else if (jxl_color->gamma > 2.799 && jxl_color->gamma < 2.801)
172+ else if (jxl_color->gamma > 0.35614 && jxl_color->gamma < 0.35814)
173173 return AVCOL_TRC_GAMMA28;
174174 else
175175 av_log(avctx, AV_LOG_WARNING, "Unsupported gamma transfer: %f\n", jxl_color->gamma);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t