package {
    default_applicable_licenses: [
        "frameworks_av_media_codecs_amrwb_enc_license",
    ],
}

// Added automatically by a large-scale-change
// See: http://go/android-license-faq
license {
    name: "frameworks_av_media_codecs_amrwb_enc_license",
    visibility: [":__subpackages__"],
    license_kinds: [
        "SPDX-license-identifier-Apache-2.0",
    ],
    license_text: [
        "NOTICE",
    ],
}

cc_library_static {
    name: "libstagefright_amrwbenc",
    vendor_available: true,
    min_sdk_version: "29",
    apex_available: [
        "//apex_available:platform",
        "com.android.media.swcodec",
    ],

    srcs: [
        "src/autocorr.c",
        "src/az_isp.c",
        "src/bits.c",
        "src/c2t64fx.c",
        "src/c4t64fx.c",
        "src/convolve.c",
        "src/cor_h_x.c",
        "src/decim54.c",
        "src/deemph.c",
        "src/dtx.c",
        "src/g_pitch.c",
        "src/gpclip.c",
        "src/homing.c",
        "src/hp400.c",
        "src/hp50.c",
        "src/hp6k.c",
        "src/hp_wsp.c",
        "src/int_lpc.c",
        "src/isp_az.c",
        "src/isp_isf.c",
        "src/lag_wind.c",
        "src/levinson.c",
        "src/log2.c",
        "src/lp_dec2.c",
        "src/math_op.c",
        "src/oper_32b.c",
        "src/p_med_ol.c",
        "src/pit_shrp.c",
        "src/pitch_f4.c",
        "src/pred_lt4.c",
        "src/preemph.c",
        "src/q_gain2.c",
        "src/q_pulse.c",
        "src/qisf_ns.c",
        "src/qpisf_2s.c",
        "src/random.c",
        "src/residu.c",
        "src/scale.c",
        "src/stream.c",
        "src/syn_filt.c",
        "src/updt_tar.c",
        "src/util.c",
        "src/voAMRWBEnc.c",
        "src/voicefac.c",
        "src/wb_vad.c",
        "src/weight_a.c",
        "src/mem_align.c",
    ],

    arch: {
        arm: {
            srcs: [
                "src/asm/ARMV7/convolve_neon.s",
                "src/asm/ARMV7/cor_h_vec_neon.s",
                "src/asm/ARMV7/Deemph_32_neon.s",
                "src/asm/ARMV7/Dot_p_neon.s",
                "src/asm/ARMV7/Filt_6k_7k_neon.s",
                "src/asm/ARMV7/Norm_Corr_neon.s",
                "src/asm/ARMV7/pred_lt4_1_neon.s",
                "src/asm/ARMV7/residu_asm_neon.s",
                "src/asm/ARMV7/scale_sig_neon.s",
                "src/asm/ARMV7/Syn_filt_32_neon.s",
                "src/asm/ARMV7/syn_filt_neon.s",
            ],

            cflags: [
                "-DARM",
                "-DARMV7",
                "-DASM_OPT",
            ],
            local_include_dirs: [
                "src/asm/ARMV7",
            ],

            instruction_set: "arm",
        },
    },

    local_include_dirs: ["src"],
    export_include_dirs: ["inc"],

    shared_libs: [
        "libstagefright_enc_common",
        "liblog",
    ],

    cflags: ["-Werror"],
    sanitize: {
        cfi: true,
    },

    host_supported: true,
    target: {
        darwin: {
            enabled: false,
        },
    },
}
