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

Commit 37288179 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7149879 from db5d1490 to sc-release

Change-Id: Ia20aeb511f8790a3b2359770adbd760b4120dee0
parents 8ef9c519 db5d1490
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -877,10 +877,14 @@ void C2SoftAacDec::process(
            work->worklets.front()->output.configUpdate.push_back(
                    C2Param::Copy(currentBoostFactor));

            if (android_get_device_api_level() < __ANDROID_API_S__) {
                // We used to report DRC compression mode in the output format
                // in Q and R, but stopped doing that in S
                C2StreamDrcCompressionModeTuning::input currentCompressMode(0u,
                        (C2Config::drc_compression_mode_t) compressMode);
                work->worklets.front()->output.configUpdate.push_back(
                        C2Param::Copy(currentCompressMode));
            }

            C2StreamDrcEncodedTargetLevelTuning::input currentEncodedTargetLevel(0u,
                    (C2FloatValue) (encTargetLevel*-0.25));
+2 −10
Original line number Diff line number Diff line
@@ -765,21 +765,13 @@ void CCodecConfig::initializeStandardParams() {

    // convert to compression type and add default
    add(ConfigMapper(KEY_AAC_DRC_HEAVY_COMPRESSION, C2_PARAMKEY_DRC_COMPRESSION_MODE, "value")
        .limitTo(D::AUDIO & D::DECODER & (D::CONFIG | D::PARAM | D::READ))
        .withMappers([](C2Value v) -> C2Value {
        .limitTo(D::AUDIO & D::DECODER & (D::CONFIG | D::PARAM))
        .withMapper([](C2Value v) -> C2Value {
            int32_t value;
            if (!v.get(&value) || value < 0) {
                value = property_get_int32(PROP_DRC_OVERRIDE_HEAVY, DRC_DEFAULT_MOBILE_DRC_HEAVY);
            }
            return value == 1 ? C2Config::DRC_COMPRESSION_HEAVY : C2Config::DRC_COMPRESSION_LIGHT;
        },[](C2Value v) -> C2Value {
            int32_t value;
            if (v.get(&value)) {
              return value;
            }
            else {
              return C2Value();
            }
        }));

    // convert to dBFS and add default
+36 −12
Original line number Diff line number Diff line
@@ -570,12 +570,14 @@ static void searchFrac(
    Word16 corr[],     /* i   : normalized correlation  */
    Word16 flag3,      /* i   : subsample resolution
                                (3: =1 / 6: =0)         */
    Flag   *pOverflow
    Flag   *pOverflow,
    enum Mode mode
)
{
    Word16 i;
    Word16 max;
    Word16 corr_int;
    Word16 minPitch;

    /* Test the fractions around T0 and choose the one which maximizes   */
    /* the interpolated normalized correlation.                          */
@@ -593,30 +595,52 @@ static void searchFrac(
        }
    }

    minPitch = (mode == MR122) ? PIT_MIN_MR122 : PIT_MIN;
    if (flag3 == 0)
    {
        /* Limit the fraction value in the interval [-2,-1,0,1,2,3] */

        if (*frac == -3)
        {
            if (*lag > minPitch)
            {
                *frac = 3;
                (*lag)--;
            }
            else
            {
                *frac = -2;
            }
        }
    }
    else
    {
        /* limit the fraction value between -1 and 1 */

        if (*frac == -2)
        {
            if (*lag > minPitch)
            {
                *frac = 1;
                (*lag)--;
            }
        if (*frac == 2)
            else
            {
                *frac = -1;
            }
        }
        else if (*frac == 2)
        {
            if (*lag < PIT_MAX)
            {
                *frac = -1;
                (*lag)++;
            }
            else
            {
                *frac = 1;
            }
        }
    }
}

@@ -1533,20 +1557,20 @@ Word16 Pitch_fr( /* o : pitch period (integer) */

                /* normal search in fractions around T0 */

                searchFrac(&lag, &frac, last_frac, corr, flag3, pOverflow);
                searchFrac(&lag, &frac, last_frac, corr, flag3, pOverflow, mode);

            }
            else if (lag == (tmp_lag - 2))
            {
                /* limit search around T0 to the right side */
                frac = 0;
                searchFrac(&lag, &frac, last_frac, corr, flag3, pOverflow);
                searchFrac(&lag, &frac, last_frac, corr, flag3, pOverflow, mode);
            }
            else if (lag == (tmp_lag + 1))
            {
                /* limit search around T0 to the left side */
                last_frac = 0;
                searchFrac(&lag, &frac, last_frac, corr, flag3, pOverflow);
                searchFrac(&lag, &frac, last_frac, corr, flag3, pOverflow, mode);
            }
            else
            {
@@ -1556,7 +1580,7 @@ Word16 Pitch_fr( /* o : pitch period (integer) */
        }
        else
            /* test the fractions around T0 */
            searchFrac(&lag, &frac, last_frac, corr, flag3, pOverflow);
            searchFrac(&lag, &frac, last_frac, corr, flag3, pOverflow, mode);
    }

    /*-----------------------------------------------------------------------*
+4 −17
Original line number Diff line number Diff line
@@ -598,18 +598,10 @@ void fillMainDataBuf(void *pMem, int32 temp)
        }
        else
        {
            int32 tmp1 = *(ptr++);
            for (int32 nBytes = temp >> 1; nBytes != 0; nBytes--)  /* read main data. */
            for (int32 nBytes = temp; nBytes != 0; nBytes--)  /* read main data. */
            {
                int32 tmp2 = *(ptr++);
                fillDataBuf(&pVars->mainDataStream, tmp1);
                fillDataBuf(&pVars->mainDataStream, tmp2);
                tmp1 = *(ptr++);
            }

            if (temp&1)
            {
                fillDataBuf(&pVars->mainDataStream, tmp1);
                int32 tmp = *(ptr++);
                fillDataBuf(&pVars->mainDataStream, tmp);
            }

            /* adjust circular buffer counter */
@@ -618,14 +610,9 @@ void fillMainDataBuf(void *pMem, int32 temp)
    }
    else
    {
        for (int32 nBytes = temp >> 1; nBytes != 0; nBytes--)  /* read main data. */
        for (int32 nBytes = temp; nBytes != 0; nBytes--)  /* read main data. */
        {
            fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset++  , BUFSIZE)));
            fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset++  , BUFSIZE)));
        }
        if (temp&1)
        {
            fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset  , BUFSIZE)));
        }
    }

+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ cc_test {
        "libaudioeffects",
        "libhardware_headers",
    ],
    gtest: false,
}

cc_test {
@@ -29,4 +30,5 @@ cc_test {
        "-Werror",
        "-Wextra",
    ],
    gtest: false,
}
Loading