-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proprietary internal encoder structure for HD
The structure provided in this commit has been reconstructed based on the aptXHD-1.0.0-ARMv7A library build.
- Loading branch information
Showing
12 changed files
with
559 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
/* | ||
* aptxHD100.h | ||
* Copyright (c) 2017-2018 Arkadiusz Bokowy | ||
* | ||
* This file is a part of [open]aptx. | ||
* | ||
* This project is licensed under the terms of the MIT license. | ||
* | ||
*/ | ||
|
||
#ifndef OPENAPTX_APTXHD100_H_ | ||
#define OPENAPTX_APTXHD100_H_ | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define APTXHD_CHANNELS 2 | ||
|
||
enum aptXHD_subband { | ||
APTXHD_SUBBAND_LL = 0, | ||
APTXHD_SUBBAND_LH = 1, | ||
APTXHD_SUBBAND_HL = 2, | ||
APTXHD_SUBBAND_HH = 3, | ||
__APTXHD_SUBBAND_MAX | ||
}; | ||
|
||
typedef struct aptXHD_subband_params_100_t { | ||
int32_t *p1; | ||
int32_t *bit16_sl1; | ||
int32_t *p3; | ||
int32_t *dith16_sf1; | ||
int32_t *mLamb16; | ||
int32_t *incr16; | ||
/* number of used bits */ | ||
int32_t bits; | ||
int32_t unk1; | ||
int32_t unk2; | ||
/* width of prediction filter */ | ||
int32_t filter_width; | ||
} __attribute__ ((packed)) aptXHD_subband_params_100; | ||
|
||
typedef struct aptXHD_prediction_filter_100_t { | ||
int32_t width; | ||
int32_t arr1[24]; | ||
int16_t sign1; | ||
int16_t sign2; | ||
int32_t unk2; | ||
int32_t unk3; | ||
int32_t subband_param_unk3_2; | ||
int32_t arr2[48]; | ||
int32_t i; | ||
int32_t subband_param_unk3_3; | ||
int32_t unk5; | ||
int32_t unk6; | ||
int32_t unk7; | ||
int32_t unk8; | ||
} __attribute__ ((packed)) aptXHD_prediction_filter_100; | ||
|
||
typedef struct aptXHD_inverter_100_t { | ||
int32_t *subband_param_p1; | ||
int32_t *subband_param_bit16_sl1; | ||
int32_t *subband_param_dith16_sf1; | ||
int32_t *subband_param_incr16; | ||
int32_t subband_param_unk1; | ||
int32_t subband_param_unk2; | ||
int32_t unk9; | ||
int32_t unk10; | ||
int32_t unk11; | ||
int32_t *log; | ||
} __attribute__ ((packed)) aptXHD_inverter_100; | ||
|
||
typedef struct aptXHD_processor_100_t { | ||
aptXHD_prediction_filter_100 filter; | ||
aptXHD_inverter_100 inverter; | ||
} __attribute__ ((packed)) aptXHD_processor_100; | ||
|
||
typedef struct aptXHD_quantizer_100_t { | ||
int32_t subband_param_bits; | ||
int32_t *subband_param_p1; | ||
int32_t *subband_param_bit16_sl1; | ||
int32_t *subband_param_p3; | ||
int32_t *subband_param_mLamb16; | ||
int32_t unk1; | ||
int32_t unk2; | ||
int32_t unk3; | ||
} __attribute__ ((packed)) aptXHD_quantizer_100; | ||
|
||
typedef struct aptXHD_subband_encoder_100_t { | ||
aptXHD_processor_100 processor[__APTXHD_SUBBAND_MAX]; | ||
int32_t codeword; | ||
int32_t dither_sign; | ||
int32_t dither[__APTXHD_SUBBAND_MAX]; | ||
aptXHD_quantizer_100 quantizer[__APTXHD_SUBBAND_MAX]; | ||
} __attribute__ ((packed)) aptXHD_subband_encoder_100; | ||
|
||
typedef struct aptXHD_QMF_analyzer_100_t { | ||
int32_t outer[2][32]; | ||
int32_t inner[4][32]; | ||
int32_t i_inner; | ||
int32_t i_outer; | ||
} __attribute__ ((packed)) aptXHD_QMF_analyzer_100; | ||
|
||
typedef struct aptXHD_encoder_t { | ||
int32_t swap; | ||
int32_t sync; | ||
aptXHD_subband_encoder_100 encoder[APTXHD_CHANNELS]; | ||
aptXHD_QMF_analyzer_100 analyzer[APTXHD_CHANNELS]; | ||
} __attribute__ ((packed)) aptXHD_encoder_100; | ||
|
||
void AsmQmfConvO(const int32_t a1[16], const int32_t a2[16], const int32_t coeffs[16], int32_t out[3]); | ||
void AsmQmfConvI(const int32_t a1[16], const int32_t a2[16], const int32_t coeffs[16], int32_t out[2]); | ||
int32_t BsearchLH(uint32_t a, int32_t b, const int32_t data[9]); | ||
void quantiseDifferenceLL(int32_t diff, int32_t dither, int32_t c, aptXHD_quantizer_100 *q); | ||
void quantiseDifferenceLH(int32_t diff, int32_t dither, int32_t c, aptXHD_quantizer_100 *q); | ||
void quantiseDifferenceHL(int32_t diff, int32_t dither, int32_t c, aptXHD_quantizer_100 *q); | ||
void quantiseDifferenceHH(int32_t diff, int32_t dither, int32_t c, aptXHD_quantizer_100 *q); | ||
void aptxEncode(int32_t pcm[4], aptXHD_QMF_analyzer_100 *a, aptXHD_subband_encoder_100 *e); | ||
void processSubband(int32_t a, int32_t dither, aptXHD_prediction_filter_100 *f, aptXHD_inverter_100 *i); | ||
void processSubbandLL(int32_t a, int32_t dither, aptXHD_prediction_filter_100 *f, aptXHD_inverter_100 *i); | ||
void processSubbandHL(int32_t a, int32_t dither, aptXHD_prediction_filter_100 *f, aptXHD_inverter_100 *i); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* main.c | ||
* Copyright (c) 2017-2018 Arkadiusz Bokowy | ||
* | ||
* This file is a part of [open]aptx. | ||
* | ||
* This project is licensed under the terms of the MIT license. | ||
* | ||
*/ | ||
|
||
#if HAVE_CONFIG_H | ||
# include "config.h" | ||
#endif | ||
|
||
#include "openaptx.h" | ||
#include "aptxHD100.h" | ||
|
||
#include <string.h> | ||
|
||
static aptXHD_encoder_100 aptXHD_encoder; | ||
|
||
int aptxhdbtenc_init( | ||
APTXENC enc, | ||
bool swap) { | ||
|
||
aptXHD_encoder_100 *e = (aptXHD_encoder_100 *)enc; | ||
size_t i, ii; | ||
|
||
memset(e, 0, sizeof(*e)); | ||
|
||
return 0; | ||
} | ||
|
||
int aptxhdbtenc_encodestereo( | ||
APTXENC enc, | ||
const int32_t pcmL[4], | ||
const int32_t pcmR[4], | ||
uint32_t code[2]) { | ||
|
||
aptXHD_encoder_100 *enc_ = (aptXHD_encoder_100 *)enc; | ||
|
||
return 0; | ||
} | ||
|
||
const char *aptxhdbtenc_build(void) { | ||
return PACKAGE_STRING; | ||
} | ||
|
||
const char *aptxhdbtenc_version(void) { | ||
return VERSION; | ||
} | ||
|
||
size_t SizeofAptxhdbtenc(void) { | ||
return sizeof(aptXHD_encoder); | ||
} | ||
|
||
APTXENC NewAptxhdEnc(bool swap) { | ||
aptxhdbtenc_init(&aptXHD_encoder, swap); | ||
return &aptXHD_encoder; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* heval-hd100.c | ||
* Copyright (c) 2017-2018 Arkadiusz Bokowy | ||
* | ||
* This file is a part of [open]aptx. | ||
* | ||
* This project is licensed under the terms of the MIT license. | ||
* | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <time.h> | ||
|
||
#include "aptxHD100.h" | ||
#include "inspect-hd100.h" | ||
#include "openaptx.h" | ||
|
||
int main(int argc, char *argv[]) { | ||
|
||
size_t count; | ||
int ret = 0; | ||
|
||
if (argc == 2) { | ||
count = atoi(argv[1]); | ||
srand(time(NULL)); | ||
} | ||
else if (argc == 3) { | ||
count = atoi(argv[1]); | ||
srand(atoi(argv[2])); | ||
} | ||
else { | ||
printf("usage: %s [COUNT [SEED]]\n", argv[0]); | ||
return -1; | ||
} | ||
|
||
printf("== HEURISTIC EVALUATION ==\n"); | ||
|
||
return ret; | ||
} |
Oops, something went wrong.