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

Commit 183676c4 authored by Ray Essick's avatar Ray Essick
Browse files

Signal minimum quality needs to underlying codec

Pass signals through to underlying codec indicating when codec is
responsible for meeting minimum quality standards.

Bug: 192086044
Test: VQ test harness
Change-Id: Icc0d8e748992bd8103894332fc72b7f4fb60f818
parent 1cc5b43d
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -2392,22 +2392,24 @@ typedef C2StreamParam<C2Info, C2EasyBoolValue, kParamIndexTunnelStartRender>
        C2StreamTunnelStartRender;
constexpr char C2_PARAMKEY_TUNNEL_START_RENDER[] = "output.tunnel-start-render";

C2ENUM(C2PlatformConfig::encoding_quality_level_t, uint32_t,
    NONE,
    S_HANDHELD,
    S_HANDHELD_PC
);

namespace android {

/**
 * Encoding quality level signaling.
 *
 * Signal the 'minimum encoding quality' introduced in Android 12/S. It indicates
 * whether the underlying codec is expected to take extra steps to ensure quality meets the
 * appropriate minimum. A value of NONE indicates that the codec is not to apply
 * any minimum quality bar requirements. Other values indicate that the codec is to apply
 * a minimum quality bar, with the exact quality bar being decided by the parameter value.
 */
typedef C2GlobalParam<C2Setting,
        C2SimpleValueStruct<C2EasyEnum<C2PlatformConfig::encoding_quality_level_t>>,
        kParamIndexEncodingQualityLevel> C2EncodingQualityLevel;
constexpr char C2_PARAMKEY_ENCODING_QUALITY_LEVEL[] = "algo.encoding-quality-level";

}
C2ENUM(C2PlatformConfig::encoding_quality_level_t, uint32_t,
    NONE = 0,
    S_HANDHELD = 1              // corresponds to VMAF=70
);

/// @}

+2 −0
Original line number Diff line number Diff line
@@ -909,6 +909,8 @@ void CCodecConfig::initializeStandardParams() {
            }
        }));

    add(ConfigMapper("android._encoding-quality-level", C2_PARAMKEY_ENCODING_QUALITY_LEVEL, "value")
        .limitTo(D::ENCODER & (D::CONFIG | D::PARAM)));
    add(ConfigMapper(KEY_QUALITY, C2_PARAMKEY_QUALITY, "value")
        .limitTo(D::ENCODER & (D::CONFIG | D::PARAM)));
    add(ConfigMapper(KEY_FLAC_COMPRESSION_LEVEL, C2_PARAMKEY_COMPLEXITY, "value")