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

Commit f74a2fe8 authored by William Escande's avatar William Escande
Browse files

Link AptX and AptXHD encoder into Bt

Statically link the encoder lib in order to provide them into the apex
Remove the apex external loading rule

Bug: 226572369
Test: manual testing
Tag: #refactor
Change-Id: I45adfe7ca51c304b8fc09ee30ce6e810bf9f0e3e
parent d7709205
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -10,7 +10,5 @@
  ],
  "name": "com.android.btservices",
  "requireNativeLibs": [
    "libaptX_encoder.so",
    "libaptXHD_encoder.so"
  ]
}
+19 −0
Original line number Diff line number Diff line
cc_library_static {
    name: "libaptx_enc",
    host_supported: true,
    export_include_dirs: ["include"],
    srcs: [
        "src/aptXbtenc.c",
        "src/ProcessSubband.c",
        "src/QmfConv.c",
        "src/QuantiseDifference.c",
    ],
    cflags: ["-O2", "-Werror", "-Wall", "-Wextra"],
    min_sdk_version: "Tiramisu",
    apex_available: [
        "com.android.btservices",
    ],
    visibility: [
        "//packages/modules/Bluetooth:__subpackages__",
    ],
}
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
#ifndef APTXBTENC_H
#define APTXBTENC_H

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif
+3 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ typedef struct {
/* Outer QMF filter for Enhanced aptX is a symmetrical 32-tap filter (16
 * different coefficients). The table in defined in QmfConv.c */
#ifndef _STDQMFOUTERCOEFF
const int32_t Qmf_outerCoeffs[12] = {
static const int32_t Qmf_outerCoeffs[12] = {
    /* (C(1/30)C(3/28)), C(5/26), C(7/24) */
    0xFE6302DA,
    0xFFFFDA75,
@@ -59,7 +59,7 @@ const int32_t Qmf_outerCoeffs[12] = {
    0xFC7F02B0,
};
#else
const int32_t Qmf_outerCoeffs[16] = {
static const int32_t Qmf_outerCoeffs[16] = {
    730,    -413,    -9611, 43626, -121026, 269973, -585547, 2801966,
    697128, -160481, 27611, 8478,  -10043,  3511,   688,     -897,
};
@@ -67,7 +67,7 @@ const int32_t Qmf_outerCoeffs[16] = {

/* Each inner QMF filter for Enhanced aptX is a symmetrical 32-tap filter (16
 * different coefficients) */
const int32_t Qmf_innerCoeffs[16] = {
static const int32_t Qmf_innerCoeffs[16] = {
    1033,   -584,    -13592, 61697, -171156, 381799, -828088, 3962579,
    985888, -226954, 39048,  11990, -14203,  4966,   973,     -1268,
};
+1 −1
Original line number Diff line number Diff line
@@ -16,6 +16,6 @@
#ifndef SWVERSION_H
#define SWVERSION_H

const char* swversion = "1.0.0";
static const char* swversion = "1.0.0";

#endif  // SWVERSION_H
Loading