libheif icon indicating copy to clipboard operation
libheif copied to clipboard

Added import color matrix for Y4M

Open Jamaika1 opened this issue 3 years ago • 2 comments

Jamaika1 avatar Mar 28 '22 06:03 Jamaika1

Could you provide me with a link to some Y4M files with these headers or some command lines showing how to generate them?

farindk avatar Aug 30 '22 18:08 farindk

This patch is only 8bit. heifenc.exe image_21447_24bit.y4m -v -q 100 --no-alpha -p preset=placebo -p chroma=444 --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_y4m.heif To convert Y4M 10bit to AVIF 10bit, the converter must be completely rebuilt. So I recommend ffmpeg. ffmpeg.exe -i image_21447_30bit.y4m -vf scale=1920:1080:in_color_matrix=bt2020_ncl:in_range=full:out_color_matrix=bt2020_ncl:out_range=full,format=yuv422p10le image_21447_30bit.avif

Jamaika1 avatar Aug 30 '22 19:08 Jamaika1

My garbage Despite many attempts, I failed to reach 8bit for the colorsample 422 converter. Test heifenc.exe image_21447_24bit_yuv444p.y4m -v -b 8 -q 90 --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_yuv444p.heif OK heifenc.exe image_21447_24bit_yuv422p.y4m -v -b 8 -q 90 --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_yuv422p.heif Fail. HEIF isn't created and converted to RGB24

--- construct_pipeline
from: colorspace=YCbCr chroma=422 bpp(R)=8 alpha=no nclx=no
to: colorspace=YCbCr chroma=420 bpp(R)=8 alpha=no nclx=yes
> 15Op_YCbCr_to_RGBIhE
> 15Op_RGB_to_YCbCrIhE
input spec: colorspace=YCbCr chroma=422 bpp(Y)=8

heifenc.exe image_21447_24bit_yuv420p.y4m -v -b 8 -q 90 --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_yuv420p.heif OK heifenc.exe image_21447_24bit_yuv444p.y4m -v -b 8 -q 90 --no-alpha -p chroma=444 --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_yuv444p1.heif OK heifenc.exe image_21447_24bit_yuv422p.y4m -v -b 8 -q 90 --no-alpha -p chroma=422 --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_yuv422p1.heif Fail. It is unknown why HEIF forms 10bit. This information is invisible to AOM.

x265 [info]: Main 4:2:2 10 Intra profile, Level-6 (Main tier)

It is possible that these are x265 bugs or the plugin is incompatible with the lowest codec versions. heifenc.exe image_21447_24bit_yuv420p.y4m -v -b 8 -q 90 --no-alpha -p chroma=420 --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_yuv420p1.heif OK

heifenc.exe image_21447_24bit_yuv420p.y4m -v -b 8 -q 90 --no-alpha -p chroma=444 --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_yuv420p2.heif OK heifenc.exe image_21447_24bit_yuv444p.y4m -v -b 8 -q 90 --no-alpha -p chroma=420 --matrix_coefficients=6 --full_range_flag=0 -o image_21447_24bit_yuv420p3.heif OK

Jamaika1 avatar Oct 29 '22 11:10 Jamaika1