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

Difference between ( 'Y', '8', ' ', ' ' ) and ('Y', '8', '0', '0') #705

Open
Gaebobman opened this issue May 23, 2024 · 1 comment
Open

Comments

@Gaebobman
Copy link

Hi,

I'm currently working on a project involving the Purethermal3 and Flir Lepton3.5.
I want to support the Y8 format or Y16 format in my project.

To achieve this, I'm modifying some code within libuvc. I checked the Groupgets fork of libuvc (https://github.com/groupgets/libuvc). Inside their code, specifically in libuvc/src/stream.c, I found some lines that look like this:

switch(format) {
    /* Define new formats here */
    ABS_FMT(UVC_FRAME_FORMAT_ANY, 2,
      {UVC_FRAME_FORMAT_UNCOMPRESSED, UVC_FRAME_FORMAT_COMPRESSED})

  // ~~~~~~
    FMT(UVC_FRAME_FORMAT_GRAY8,
      {'Y',  '8',  ' ',  ' ', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
    FMT(UVC_FRAME_FORMAT_Y16,
      {'Y',  '1',  '6',  ' ', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
// ~~~
    ABS_FMT(UVC_FRAME_FORMAT_COMPRESSED, 1,
      {UVC_FRAME_FORMAT_MJPEG})
    FMT(UVC_FRAME_FORMAT_MJPEG,
      {'M',  'J',  'P',  'G'})

    default:
      return NULL;
  }

However, some other implementations, which were built to support previous versions of the Purethermal board, implement it like this:

FMT(UVC_FRAME_FORMAT_GRAY8,
		{'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})

I want to know the difference between ('Y', '8', ' ', ' ') and ('Y', '8', '0', '0').

Thank you.

@MrAdi149
Copy link

('Y', '8', ' ', ' '): This likely represents a basic or generic YUV format with 8 bits per Y component (luma/brightness). The spaces indicate that the specific sub-format or chroma (color) information is not explicitly defined or is flexible.
('Y', '8', '0', '0'): This might represent a more specific YUV sub-format, potentially YUV 4:2:0. The '0' characters could indicate a particular chroma subsampling scheme where the color information is sampled at half the horizontal and vertical resolution of the luma

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

No branches or pull requests

2 participants