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

Commit 6f5587a4 authored by Harish Mahendrakar's avatar Harish Mahendrakar Committed by android-build-merger
Browse files

Merge "C2SoftAvcEnc: Allocate output buffer as per clip's dimensions" am: 910201b8

am: e7ac2536

Change-Id: I0369b88c20caa9658391882258db26047fafb8ed
parents 30acc1cd e7ac2536
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ namespace android {
namespace {

constexpr char COMPONENT_NAME[] = "c2.android.avc.encoder";

constexpr uint32_t kMinOutBufferSize = 524288;
void ParseGop(
        const C2StreamGopTuning::output &gop,
        uint32_t *syncInterval, uint32_t *iInterval, uint32_t *maxBframes) {
@@ -440,8 +440,7 @@ C2SoftAvcEnc::C2SoftAvcEnc(
      mSignalledError(false),
      mCodecCtx(nullptr),
      mOutBlock(nullptr),
      // TODO: output buffer size
      mOutBufferSize(524288) {
      mOutBufferSize(kMinOutBufferSize) {

    // If dump is enabled, then open create an empty file
    GENERATE_FILE_NAMES();
@@ -951,6 +950,9 @@ c2_status_t C2SoftAvcEnc::initEncoder() {

    mStride = width;

    // Assume worst case output buffer size to be equal to number of bytes in input
    mOutBufferSize = std::max(width * height * 3 / 2, kMinOutBufferSize);

    // TODO
    mIvVideoColorFormat = IV_YUV_420P;