Skip to content

Conversation

@naushir
Copy link
Collaborator

@naushir naushir commented Jan 10, 2025

No description provided.

For YUV420/422 formats, it may be desirable to preserve the subsampling
factor when computing Y and U/V strides. In such cases, double the U/V
stride to get the Y stride .

Signed-off-by: Naushir Patuck <[email protected]>
@njhollinghurst
Copy link
Collaborator

Do we ever want to not preserve the ratio? At least for the default stride calculation.

Can you explain the purpose of the stringy formats? I assume it is to avoid a dependency on V4L2. Does V4L2 or libcamera provide a way to get the identical strings?

@naushir
Copy link
Collaborator Author

naushir commented Jan 13, 2025

Do we ever want to not preserve the ratio? At least for the default stride calculation.

It's a bit more wasteful on memory so perhaps useful in the right circumstances. I think all the regression tests also expect this to be false.

Can you explain the purpose of the stringy formats? I assume it is to avoid a dependency on V4L2. Does V4L2 or libcamera provide a way to get the identical strings?

It's just for convenience, see use in src/examples/convert.cpp. Completely separate from v4l2/libcamera enums. I did consider enums, but having free form strings is much easer to manage.

@njhollinghurst
Copy link
Collaborator

LGTM

Add helpers to convert from the pisp format integer description to a
string and vice-versa. Note that for the latter, this may result in a
one to many mapping, and the first matching string is returned.

Signed-off-by: Naushir Patuck <[email protected]>
Ensure we set either the Bayer or RGB input flag depending on the input
format used.

Signed-off-by: Naushir Patuck <[email protected]>
@naushir naushir force-pushed the utils branch 2 times, most recently from 2c8f14a to ae8e876 Compare January 15, 2025 12:43
@naushir
Copy link
Collaborator Author

naushir commented Jan 15, 2025

Updated with support for mplanar formats.

@naushir naushir force-pushed the utils branch 4 times, most recently from 9091efa to 4965a1e Compare January 15, 2025 13:45
@naushir naushir merged commit 9e178fd into main Jan 15, 2025
5 of 7 checks passed
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.

3 participants