DngUtils: Remove coefficient scaling code
This is moved to the calling code to account for different scaling
needed for different metadata.
Test: DngCreator CTS tests continue to pass, inspecting saved DNGs shows expected values.
Bug: 74641761
Change-Id: Icbfe452b1523df4e440428a432bc3e90147b3cc8
diff --git a/media/img_utils/src/DngUtils.cpp b/media/img_utils/src/DngUtils.cpp
index 67ec244..9ac7e2a 100644
--- a/media/img_utils/src/DngUtils.cpp
+++ b/media/img_utils/src/DngUtils.cpp
@@ -302,29 +302,14 @@
normalizedOCX = CLAMP(normalizedOCX, 0, 1);
normalizedOCY = CLAMP(normalizedOCY, 0, 1);
- // Conversion factors from Camera2 K factors to DNG spec. K factors:
- //
- // Note: these are necessary because our unit system assumes a
- // normalized max radius of sqrt(2), whereas the DNG spec's
- // WarpRectilinear opcode assumes a normalized max radius of 1.
- // Thus, each K coefficient must include the domain scaling
- // factor (the DNG domain is scaled by sqrt(2) to emulate the
- // domain used by the Camera2 specification).
-
- const double c_0 = sqrt(2);
- const double c_1 = 2 * sqrt(2);
- const double c_2 = 4 * sqrt(2);
- const double c_3 = 8 * sqrt(2);
- const double c_4 = 2;
- const double c_5 = 2;
-
- const double coeffs[] = { c_0 * kCoeffs[0],
- c_1 * kCoeffs[1],
- c_2 * kCoeffs[2],
- c_3 * kCoeffs[3],
- c_4 * kCoeffs[4],
- c_5 * kCoeffs[5] };
-
+ double coeffs[6] = {
+ kCoeffs[0],
+ kCoeffs[1],
+ kCoeffs[2],
+ kCoeffs[3],
+ kCoeffs[4],
+ kCoeffs[5]
+ };
return addWarpRectilinear(/*numPlanes*/1,
/*opticalCenterX*/normalizedOCX,