Loading services/camera/libcameraservice/api2/HeicCompositeStream.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #define LOG_TAG "Camera3-HeicCompositeStream" #define ATRACE_TAG ATRACE_TAG_CAMERA #define ALIGN(x, mask) ( ((x) + (mask) - 1) & ~((mask) - 1) ) //#define LOG_NDEBUG 0 #include <linux/memfd.h> Loading Loading @@ -1380,7 +1381,9 @@ status_t HeicCompositeStream::initializeCodec(uint32_t width, uint32_t height, mOutputWidth = width; mOutputHeight = height; mAppSegmentMaxSize = calcAppSegmentMaxSize(cameraDevice->info()); mMaxHeicBufferSize = mOutputWidth * mOutputHeight * 3 / 2 + mAppSegmentMaxSize; mMaxHeicBufferSize = ALIGN(mOutputWidth, HeicEncoderInfoManager::kGridWidth) * ALIGN(mOutputHeight, HeicEncoderInfoManager::kGridHeight) * 3 / 2 + mAppSegmentMaxSize; return OK; } Loading services/camera/libcameraservice/api2/HeicEncoderInfoManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public: bool isSizeSupported(int32_t width, int32_t height, bool* useHeic, bool* useGrid, int64_t* stall, AString* hevcName) const; // kGridWidth and kGridHeight should be 2^n static const auto kGridWidth = 512; static const auto kGridHeight = 512; private: Loading Loading
services/camera/libcameraservice/api2/HeicCompositeStream.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #define LOG_TAG "Camera3-HeicCompositeStream" #define ATRACE_TAG ATRACE_TAG_CAMERA #define ALIGN(x, mask) ( ((x) + (mask) - 1) & ~((mask) - 1) ) //#define LOG_NDEBUG 0 #include <linux/memfd.h> Loading Loading @@ -1380,7 +1381,9 @@ status_t HeicCompositeStream::initializeCodec(uint32_t width, uint32_t height, mOutputWidth = width; mOutputHeight = height; mAppSegmentMaxSize = calcAppSegmentMaxSize(cameraDevice->info()); mMaxHeicBufferSize = mOutputWidth * mOutputHeight * 3 / 2 + mAppSegmentMaxSize; mMaxHeicBufferSize = ALIGN(mOutputWidth, HeicEncoderInfoManager::kGridWidth) * ALIGN(mOutputHeight, HeicEncoderInfoManager::kGridHeight) * 3 / 2 + mAppSegmentMaxSize; return OK; } Loading
services/camera/libcameraservice/api2/HeicEncoderInfoManager.h +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public: bool isSizeSupported(int32_t width, int32_t height, bool* useHeic, bool* useGrid, int64_t* stall, AString* hevcName) const; // kGridWidth and kGridHeight should be 2^n static const auto kGridWidth = 512; static const auto kGridHeight = 512; private: Loading