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

Commit 978bfc96 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "C2SoftAomEnc: Configure level in the encoder" into main am: f8978deb...

Merge "C2SoftAomEnc: Configure level in the encoder" into main am: f8978deb am: fa8df28d am: 5b0c2c1e am: fa8a860e am: 2c4eed1b

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



Change-Id: Ia32ef64327367824c5940bfc733716c8fefd0163
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5c4e9e58 2c4eed1b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ C2SoftAomEnc::IntfImpl::IntfImpl(const std::shared_ptr<C2ReflectorHelper>& helpe

    addParameter(DefineParam(mProfileLevel, C2_PARAMKEY_PROFILE_LEVEL)
                         .withDefault(new C2StreamProfileLevelInfo::output(0u, PROFILE_AV1_0,
                                                                           LEVEL_AV1_4_1))
                                                                           LEVEL_AV1_2))
                         .withFields({
                                 C2F(mProfileLevel, profile).equalTo(PROFILE_AV1_0),
                                 C2F(mProfileLevel, level)
@@ -305,6 +305,10 @@ C2R C2SoftAomEnc::IntfImpl::CodedColorAspectsSetter(
    return C2R::Ok();
}

uint32_t C2SoftAomEnc::IntfImpl::getLevel_l() const {
        return mProfileLevel->level - LEVEL_AV1_2;
}

C2SoftAomEnc::C2SoftAomEnc(const char* name, c2_node_id_t id,
                           const std::shared_ptr<IntfImpl>& intfImpl)
    : SimpleC2Component(std::make_shared<SimpleInterface<IntfImpl>>(name, id, intfImpl)),
@@ -381,6 +385,9 @@ static int MapC2ComplexityToAOMSpeed (int c2Complexity) {
aom_codec_err_t C2SoftAomEnc::setupCodecParameters() {
    aom_codec_err_t codec_return = AOM_CODEC_OK;

    codec_return = aom_codec_control(mCodecContext, AV1E_SET_TARGET_SEQ_LEVEL_IDX, mAV1EncLevel);
    if (codec_return != AOM_CODEC_OK) goto BailOut;

    codec_return = aom_codec_control(mCodecContext, AOME_SET_CPUUSED,
                                     MapC2ComplexityToAOMSpeed(mComplexity->value));
    if (codec_return != AOM_CODEC_OK) goto BailOut;
@@ -535,6 +542,7 @@ status_t C2SoftAomEnc::initEncoder() {
        mColorAspects = mIntf->getCodedColorAspects_l();
        mQuality = mIntf->getQuality_l();
        mComplexity = mIntf->getComplexity_l();
        mAV1EncLevel = mIntf->getLevel_l();
    }


+3 −0
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ struct C2SoftAomEnc : public SimpleC2Component {

    bool mIs10Bit;

    uint32_t mAV1EncLevel;

    std::shared_ptr<C2StreamPictureSizeInfo::input> mSize;
    std::shared_ptr<C2StreamIntraRefreshTuning::output> mIntraRefresh;
    std::shared_ptr<C2StreamFrameRateInfo::output> mFrameRate;
@@ -152,6 +154,7 @@ class C2SoftAomEnc::IntfImpl : public SimpleInterface<void>::BaseParams {
    static C2R ColorAspectsSetter(bool mayBlock, C2P<C2StreamColorAspectsInfo::input>& me);
    static C2R CodedColorAspectsSetter(bool mayBlock, C2P<C2StreamColorAspectsInfo::output>& me,
                                       const C2P<C2StreamColorAspectsInfo::input>& coded);
    uint32_t getLevel_l() const;

  private:
    std::shared_ptr<C2StreamUsageTuning::input> mUsage;