Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3479356 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera: Filter out unaligned HEIF gainmap resolutions" into main

parents 65881cf0 5f768c05
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -1311,8 +1311,12 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo3::deriveHeicUltraHDRTag
        int32_t height = std::get<1>(it);
        int32_t gainmapWidth = std::get<0>(it) / HeicCompositeStream::kGainmapScale;
        int32_t gainmapHeight = std::get<1>(it) / HeicCompositeStream::kGainmapScale;
        if (camera3::HeicCompositeStream::isSizeSupportedByHeifEncoder(width, height,
                &useHeic, &useGrid, &stall, nullptr /*hevcName*/, kFrameworkHeicAllowSWCodecs) &&
        // Support gainmap sizes that are sufficiently aligned so CPU specific copy
        // optimizations can be utilized without side effects.
        if (((gainmapWidth % 64) == 0) && ((gainmapHeight % 2) == 0) &&
                camera3::HeicCompositeStream::isSizeSupportedByHeifEncoder(width, height,
                    &useHeic, &useGrid, &stall, nullptr /*hevcName*/,
                    kFrameworkHeicAllowSWCodecs) &&
                camera3::HeicCompositeStream::isSizeSupportedByHeifEncoder(gainmapWidth,
                    gainmapHeight, &useHeic, &useGrid, &stall, nullptr /*hevcName*/,
                    kFrameworkHeicAllowSWCodecs)) {