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

10bit dynamic range #45

Open
mattipee opened this issue Oct 18, 2017 · 8 comments
Open

10bit dynamic range #45

mattipee opened this issue Oct 18, 2017 · 8 comments

Comments

@mattipee
Copy link

Hi, this might be of interest.

I've been playing with the ov534 linux kernel module to add gamma, framerates <1fps, etc, and used your register initialisation routines to get raw output working.

By setting DSP_Ctrl4[0], video format to RAW10 and framesize to 0x017700, I've managed to capture 10bit raw.

Four pixels every five bytes, with the lsb's packed into the fifth byte:
11111111 22222222 33333333 44444444 44332211

@cdoty
Copy link

cdoty commented Oct 18, 2017

Is the mode limited to 320x240?

@mattipee
Copy link
Author

mattipee commented Oct 18, 2017

Is the mode limited to 320x240?

I've only tried 640x480, which works.

@bakercp
Copy link

bakercp commented Dec 13, 2017

@cdoty What settings were you using to get < 1fps?

@mattipee
Copy link
Author

Suggest opening another issue for frame rates. I don't know how accurate these values are in terms of the actual resultant frame rate, but for VGA I currently have:

...
{2, 0x09, 0x01, 0x02},
{1, 0x18, 0x01, 0x02},
{0.9, 0x31, 0x81, 0x09},
{0.8, 0x2e, 0x41, 0x07},
{0.7, 0x3d, 0x41, 0x06},
{0.6, 0x18, 0x01, 0x04},
{0.5, 0x31, 0x01, 0x02},
{0.4, 0x2e, 0x01, 0x03},
{0.3, 0x31, 0x01, 0x04},
{0.2, 0x2b, 0x01, 0x08},
{0.1, 0x3f, 0x01, 0x0a}

Note that the type of fps has to change. In the kernel module, I had to modify gspca.h/c and include fixed values for numerator/denominator also.

@mattipee
Copy link
Author

Can anyone confirm if 10bit works for them?

@bakercp
Copy link

bakercp commented Dec 13, 2017

Thanks for those entries @mattipee -- I hope to try 10-bit in the next few days -- if / when I do, I'll report back.

@mattipee
Copy link
Author

mattipee commented Dec 13, 2017

I don't know what downstream support you'll have for 10-bit, but 8-bit conversion is as simple as dropping every 5th byte - you might test by checking for non-null before you drop. Alternatively, 10-bit to 16bit is relatively easy too, you can left-align the relevant bits from the 5th byte and pad with 0s to create each low-byte. You may already appreciate all of that, but I expect you'll need to implement one or the other. Good luck, @bakercp.

Here's a snippet for reference:

#define OUTPUT_FORMAT 0x03
#define VIDEO_FORMAT 0x10
#define FRAMESIZE_1 0x01
#define FRAMESIZE_2 0x77
#define FRAMESIZE_3 0x00
#define PIX_FMT V4L2_PIX_FMT_SGRBG10P
#define BYTES_PER_LINE (640*1.25)
#define SIZE_IMAGE (640*480*1.25)

You could also use:

#define OUTPUT_FORMAT 0x03
#define VIDEO_FORMAT 0x20
#define FRAMESIZE_1 0x02
#define FRAMESIZE_2 0x58
#define FRAMESIZE_3 0x00
#define PIX_FMT V4L2_PIX_FMT_SGRBG10
#define BYTES_PER_LINE (640*2)
#define SIZE_IMAGE (640*480*2)

But note that (from memory), the 10 bits are right aligned.

@mattipee
Copy link
Author

mattipee commented Dec 14, 2017

@bakercp

...with the most important change of course being from:

{ 0x67, 0x02 },

to:

{ 0x67, 0x03 }, // set DSP_Ctrl4[0]

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

3 participants