-
-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: AVIF input with dimensions that are not a multiple of 8 #232
Comments
Hello. |
Actually, I consider this a bug in the encoder and/or specification. The |
For example I saved 100x100 AVIF via libheif. I understand that encoder(libaom) works like that. If the difference is below 8 pixels we can consider it as feature. |
I tried to add writing a 'clap' box that will remove the padded border. But the problem is that in order to write the 'clap' box, I need to know the size of the encoded image. However, that is not easily available. I've asked the rav1e whether there is a ways to get this without parsing the AV1 stream: xiph/rav1e#2477 |
For AVIF this should now be resolved with 07b7c81. |
Awesome, it would be great if you can do a bug-fix release. |
2f91ec1 should now handle odd image sizes well for AVIF and HEIF. It also should handle well HEIF image sizes < 16 pixels. |
I can test it. Should I compile develop branch and deploy it? |
Yes, please. I'd like to merge this soon to 'master' and tag a new release. |
Loading AVIF with any dimensions works for me now. Just when saving it is cropped to a multiple of 2. |
@novomesk Right, that was still old code in the AOM encoder plugin. I've changed it in the commit above. The rav1e encoder plugin didn't do the rounding. |
@farindk I've tested the latest code on the |
@lovell Thanks. BTW: it is not cropping according to the |
I have tried it but I get following error when I compile vips with it and try to encode image:
|
@adityapatadia Yes, sorry. During some apparently simple code cleanup, I added a wrong assert(), not related to this issue. Should be fixed now. |
Hello, processing the cosmos_frame01000_yuv420_10bpc_bt2020_hlg_q50.avif sample image with libheif:
heif_image_handle_get_height( heif_handle )
returns 858heif_image_get_height( heif_image, heif_channel_interleaved )
returns 864I suspect this may be due to the AV1 decoder working with 8x8 blocks internally.
The
heif-info
tool appears to use the former (from theispe
box?):The
heif-convert
tool appears to use the latter:$ heif-convert cosmos_frame01000_yuv420_10bpc_bt2020_hlg_q50.avif out.png && file out.png File contains 1 images Written to out.png out.png: PNG image data, 2048 x 864, 16-bit/color RGB, non-interlaced
Note the pixel "stretching" at the bottom of this output from row 859 onwards:
Is this difference in dimensions the expected behaviour of libheif's public API and CLI tools?
The text was updated successfully, but these errors were encountered: