Skip to content
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

kvazaar: ensure input pucture dimensions are divisible by 8 #1037

Closed

Conversation

DarthSim
Copy link
Contributor

Hey there 👋

Kvazaar requires dimensions of the input kvz_picture to be divisible by 8. Otherwise, encoding fails and aborts the whole program. Unfortunately, Kvazaar's API doesn't do this for us.

@farindk
Copy link
Contributor

farindk commented Nov 14, 2023

The better way to do that is probably to implement query_encoded_size in the encoder plugin (version 3). I can have a look at that.

Or we may need both. A quick test gave me this result

heif-enc: image.c:59: kvz_image_alloc: Assertion `(width % 2) == 0' failed.

So I assume query_encoded_size should round up to multiples of 2 and then maybe we have to allocate images with multiples of 8 to match some memory alignment issues?

@farindk
Copy link
Contributor

farindk commented Nov 14, 2023

I have implemented this in a different way (see above). Please check whether this is also ok on your data.

@DarthSim
Copy link
Contributor Author

It works, thanks! 👍

@farindk
Copy link
Contributor

farindk commented Nov 14, 2023

Thanks for testing and your initial patch.

@farindk farindk closed this Nov 14, 2023
@DarthSim DarthSim deleted the feature/fix-kvazaar-pic-size branch November 14, 2023 22:23
DarthSim pushed a commit to DarthSim/libheif that referenced this pull request Nov 14, 2023
DarthSim pushed a commit to DarthSim/libheif that referenced this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants