Closed dreampiggy closed 1 year ago
any update?
I' have a try with libavif's YUVToRGB16
convert method, instead of current conversion written using Apple's vImage.
Seems this image use Color Space transfer function AVIF_TRANSFER_CHARACTERISTICS_SMPTE2084
which is not supported by CGColorSpace. Different naming, CGColorSpace has PQ
suffix one
However, it supported by CVPixelBuffer and CoreVideo: https://developer.apple.com/documentation/corevideo/kcvimagebuffertransferfunction_smpte_st_2084_pq
We can use the CoreVideo, which use CVPixelBuffer
(instead of current vImage_Buffer), and call VTCreateCGImageFromCVPixelBuffer(https://developer.apple.com/documentation/videotoolbox/1536089-vtcreatecgimagefromcvpixelbuffer) to get CGImage
A stupid solution:
avifImageRGBToYUV
😂 @ledyba-z
Seems this code is from you ?
I'll decide to revert back to old avifImageRGBToYUV
(slow but work) and color space convert for those non-supported image. Any idea or can you have time for help ? Seems the color space convert is complicated beyond my knowledge.
Should I hack to just use kCGColorSpaceITUR_2100_PQ in RGB instead ?😂 Looks visible similar
Sample: example.avif.zip
Seems HDR contents ?