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

Commit 65d06cb4 authored by William Escande's avatar William Escande
Browse files

Apply and fix clang-tidy on aptx and aptxhd

Bug: 226572369
Test: Build
Change-Id: I26f4b725659c7b1cfbf76a1e91eaec49e280966b
parent 2ee3ac8c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@

#include "AptxParameters.h"

XBT_INLINE_ int32_t packCodeword(Encoder_data* EncoderDataPt,
XBT_INLINE_ int16_t packCodeword(Encoder_data* EncoderDataPt,
                                 uint32_t aligned) {
  int32_t syncContribution;
  int32_t hhCode;
@@ -58,7 +58,7 @@ XBT_INLINE_ int32_t packCodeword(Encoder_data* EncoderDataPt,
               ((EncoderDataPt->m_qdata[HL].qCode & 0x3L) << 11) |
               ((EncoderDataPt->m_qdata[HH].qCode & 0x7L) << 13);
  }
  return codeword;
  return (int16_t)codeword;
}

#endif  // CODEWORDPACKER_H
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
 *
 *----------------------------------------------------------------------------*/

#include "AptxParameters.h"
#include "Qmf.h"

void AsmQmfConvO(const int16_t* p1dl_buffPtr, const int16_t* p2dl_buffPtr,
                 const int32_t* coeffPtr, int32_t* convSumDiff) {
+5 −4
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ void quantiseDifferenceHL(const int32_t diffSignal, const int32_t ditherVal,
  if (tmp_round0 == 0x40000000L) acc--;
  _delta = -delta << 8;

  acc = acc << 4;
  acc = (int32_t)((uint32_t)acc << 4);

  /* Form (absDiffSignal * 0.125) - (acc * delta), which is the final distance
   * signal used to determine if dithering alters the quantised code value or
@@ -373,7 +373,7 @@ void quantiseDifferenceHH(const int32_t diffSignal, const int32_t ditherVal,
  if (tmp_round0 == 0x40000000L) acc--;
  _delta = -delta << 8;

  acc = acc << 4;
  acc = (int32_t)((uint32_t)acc << 4);

  /* Form (absDiffSignal * 0.125) - (acc * delta), which is the final distance
   * signal used to determine if dithering alters the quantised code value or
@@ -518,7 +518,8 @@ void quantiseDifferenceLL(const int32_t diffSignal, const int32_t ditherVal,
  if (tmp_round0 == 0x40000000L) acc--;
  _delta = -delta << 8;

  acc = acc << 4;
  acc = (int32_t)((uint32_t)acc << 4);

  /* Form (absDiffSignal * 0.125) - (acc * delta), which is the final distance
   * signal used to determine if dithering alters the quantised code value or
   * not. */
@@ -661,7 +662,7 @@ void quantiseDifferenceLH(const int32_t diffSignal, const int32_t ditherVal,
  if (tmp_round0 == 0x40000000L) acc--;
  _delta = -delta << 8;

  acc = acc << 4;
  acc = (int32_t)((uint32_t)acc << 4);

  /* Form (absDiffSignal * 0.125) - (acc * delta), which is the final distance
   * signal used to determine if dithering alters the quantised code value or
+3 −5
Original line number Diff line number Diff line
@@ -71,16 +71,14 @@ XBT_INLINE_ void updatePredictorPoleCoefficients(
    PoleCoeffDataPt->m_poleAdaptDelayLine.s16.h =
        PoleCoeffDataPt->m_poleAdaptDelayLine.s16.l;
    PoleCoeffDataPt->m_poleAdaptDelayLine.s16.l = -1;
  }
  if (adaptSum == 0L) {
  } else if (adaptSum == 0L) {
    sgnP[k] = 0L;
    sgnP[k_1] = 0L;
    sgnP[k_2] = 0L;
    PoleCoeffDataPt->m_poleAdaptDelayLine.s16.h =
        PoleCoeffDataPt->m_poleAdaptDelayLine.s16.l;
    PoleCoeffDataPt->m_poleAdaptDelayLine.s16.l = 1;
  }
  if (adaptSum > 0L) {
  } else {  // adaptSum > 0L
    sgnP[k] = oneQ22;
    sgnP[k_1] = ((int32_t)PoleCoeffDataPt->m_poleAdaptDelayLine.s16.l) << 22;
    sgnP[k_2] = ((int32_t)PoleCoeffDataPt->m_poleAdaptDelayLine.s16.h) << 22;
@@ -129,7 +127,7 @@ XBT_INLINE_ void updatePredictorPoleCoefficients(
   * back out. */
  acc2 = PoleCoeffDataPt->m_poleCoeff[a2] << 8;
  acc2 -= PoleCoeffDataPt->m_poleCoeff[a2] << 1;
  Bacc <<= 8;
  Bacc = (int32_t)((uint32_t)Bacc << 8);
  Bacc += acc2;

  tmp2_round0 = (int16_t)Bacc & 0x01FFL;
+2 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ static const int32_t IQuant_tableLogT[32] = {
    28160 * 256, 28776 * 256, 29408 * 256, 30048 * 256, 30704 * 256,
    31376 * 256, 32064 * 256};

void clearmem(void* mem, int32_t sz) {
static void clearmem(void* mem, int32_t sz) {
  int8_t* m = (int8_t*)mem;
  int32_t i = 0;
  for (; i < sz; i++) {
@@ -183,7 +183,7 @@ APTXBTENCEXPORT int aptxbtenc_encodestereo(void* _state, void* _pcmL,
  int32_t* pcmL = (int32_t*)_pcmL;
  int32_t* pcmR = (int32_t*)_pcmR;
  int16_t* buffer = (int16_t*)_buffer;
  int32_t tmp_reg;
  int16_t tmp_reg;
  int16_t tmp_out;
  // Feed the PCM to the dual aptX encoders
  aptxEncode(pcmL, &state->m_qmf_l, &state->m_encoderData[0]);
Loading