Loading media/codec2/components/aom/C2SoftAomEnc.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -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)), Loading Loading @@ -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; Loading Loading @@ -535,6 +542,7 @@ status_t C2SoftAomEnc::initEncoder() { mColorAspects = mIntf->getCodedColorAspects_l(); mQuality = mIntf->getQuality_l(); mComplexity = mIntf->getComplexity_l(); mAV1EncLevel = mIntf->getLevel_l(); } Loading media/codec2/components/aom/C2SoftAomEnc.h +3 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading
media/codec2/components/aom/C2SoftAomEnc.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -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)), Loading Loading @@ -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; Loading Loading @@ -535,6 +542,7 @@ status_t C2SoftAomEnc::initEncoder() { mColorAspects = mIntf->getCodedColorAspects_l(); mQuality = mIntf->getQuality_l(); mComplexity = mIntf->getComplexity_l(); mAV1EncLevel = mIntf->getLevel_l(); } Loading
media/codec2/components/aom/C2SoftAomEnc.h +3 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading