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

JPG is taken from JPEG stream or manually from RAW? #233

Open
Uzver123 opened this issue Sep 29, 2024 · 6 comments
Open

JPG is taken from JPEG stream or manually from RAW? #233

Uzver123 opened this issue Sep 29, 2024 · 6 comments
Labels

Comments

@Uzver123
Copy link

I wonder how JPG is taken using phone JPEG stream or converted from RAW data internally by FreeDCam?

@KillerInk
Copy link
Owner

its using the jpeg stream. freedcam itself dont have a demosaic algo. what you get in the viewer is from libraw.
greets

@Uzver123
Copy link
Author

its using the jpeg stream. freedcam itself dont have a demosaic algo. what you get in the viewer is from libraw.

Then how FreeDcam has different options for sharpening from standard off/fast/high/zsl that offered in Camera2API?

image

@KillerInk
Copy link
Owner

well there ist the default camera2 api from android, and there are hidden keys offered by the manufacturs that are device/brand specific.
the hidden keys can get read with reflections.

public void readVendorKeys(CameraCharacteristics cameraCharacteristics, Class keyclass) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
ArrayList<CaptureRequest.Key> keys = null;
if (get_mProperties() != null)
{
keys = getAllvendorKeysApi29(cameraCharacteristics, keyclass);
}
else if (getNativeCopy() != null)
{
keys = getAllvendorKeysApi26(cameraCharacteristics, keyclass);
}
if (keys != null)
{
for (CaptureRequest.Key b : keys)
{
Log.d(TAG, b.getName());
availiblekeys.add(b.getName());
}
}
else Log.d(TAG, "No vendorKeys found " + Build.VERSION.SDK + " " + Build.VERSION.SDK_INT);
}

but if a key is present, it does not mean it works.
so there is alot try and error involved.
sometimes its also needed, to bring the camera into a different operation mode(opcode) to get a key working.

@Uzver123
Copy link
Author

I have phone OnePlus 8 Pro if i take photo in OpenCamera with sharpening off it shows good on preview, but when i take photo it somehow switches sharpening to max there is no difference between sharpening off and high settings for JPG.

In freeDcam if i set sharpening to zero it really is zero, i wonder what's the difference and if understanding this difference can help me locate the way OnePlus alters JPG so i can disable it (i have root).

@KillerInk
Copy link
Owner

Don't know how good you coding skills are. But you have two possibilities
First mod the camera apk you need.
Second if it's a qcom socs, mod libchromatix.lib that the jpeg stream don't use sharpening.
When I played with it there was only one. But these days I think, is one for every mode.

@Uzver123
Copy link
Author

its using the jpeg stream. freedcam itself dont have a demosaic algo. what you get in the viewer is from libraw.
greets

By the way FreeDcam has re-mosaic algo? i know someone who is used it for forcing re-mosaic for camera sensor that had no HW-remosaic in full resolution mode, but when i tried that did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants