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

Commit 9bd71a01 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Camera: Update max HEIC buffer calculation" into sc-dev am: 3b979b5d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/15146744

Change-Id: Ie7a5ac141eb62312d033a04b05fb115e06fc6c8a
parents c9a07e41 3b979b5d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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>
@@ -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;
}
+1 −0
Original line number Diff line number Diff line
@@ -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: