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

Add calculations for YUV / planar images #479

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

anishmgoyal
Copy link
Collaborator

Also, create format definitions for YUV images.

@anishmgoyal anishmgoyal force-pushed the addYUVPlanarCalculations branch 2 times, most recently from 8e74f39 to 4bce41e Compare June 6, 2024 20:56
third_party/OpenXR-SDK-Source Outdated Show resolved Hide resolved
include/ppx/graphics_util.h Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
src/ppx/graphics_util.cpp Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
@anishmgoyal anishmgoyal force-pushed the addYUVPlanarCalculations branch from 4bce41e to c9ed717 Compare June 7, 2024 19:09
@anishmgoyal anishmgoyal force-pushed the addYUVPlanarCalculations branch from 2aa3d29 to 71f2228 Compare June 7, 2024 19:45
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
third_party/OpenXR-SDK-Source Outdated Show resolved Hide resolved
src/ppx/grfx/grfx_format.cpp Outdated Show resolved Hide resolved
src/ppx/grfx/grfx_format.cpp Outdated Show resolved Hide resolved
src/ppx/grfx/grfx_format.cpp Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
src/ppx/graphics_util.cpp Outdated Show resolved Hide resolved
@anishmgoyal anishmgoyal force-pushed the addYUVPlanarCalculations branch from e14a6a3 to e588acf Compare June 10, 2024 18:29
Also, create format definitions for YUV images.
Put self-header at the top, and C++ std headers after, before project-
wide headers.
@anishmgoyal anishmgoyal force-pushed the addYUVPlanarCalculations branch from 279d8a5 to 9f6e6a6 Compare June 10, 2024 18:33
src/ppx/graphics_util.cpp Show resolved Hide resolved
src/ppx/graphics_util.cpp Show resolved Hide resolved
Add a quick explanation of what chroma subsampling is / how it affects
how pixels are stored.
// Splits the frames from a raw video, based on the format of the frames,
// and metadata such as height and width. This assumes raw video, with no
// metadata in the file itself, and no audio tracks (such as a camera
// feed). Returns if the operation succeeded.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Returns if the operation succeeded"? Did you mean to say "Returns X", cause couldn't it return error code as well?

std::vector<char> buffer(frameSize);
size_t totalRead = 0;
while (totalRead < fileSize) {
const size_t bytesRead = file.Read(buffer.data(), frameSize);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this safe to do after a std::move operation? Would buffer have frameSize capacity?

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.

4 participants