Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ add_library(
${enc_dic}/ldaclib.c
)

target_link_libraries(ldac_enc_lib m)

add_executable(ldac_encoder ldac_enc_test.c)
add_executable(ldac_decoder ldac_dec_test.c)
add_executable(auto_test auto_test.c)


target_link_libraries(ldac_encoder ldac_enc_lib)
target_link_libraries(ldac_decoder ldac_dec_lib)
target_link_libraries(ldac_decoder ldac_dec_lib m)
endif()
4 changes: 4 additions & 0 deletions auto_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef __linux__
#include <unistd.h>
#endif

int main()
{

Expand Down
12 changes: 7 additions & 5 deletions ldac_dec_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ typedef char ID[4];
typedef union {
struct {
ID groupID;
long size;
uint32_t size;
ID riffType;
};
uint8_t data[0xc];
Expand All @@ -112,8 +112,8 @@ typedef union {
typedef union {
struct {
ID chunkID;
long chunkSize;
short wFormatTag;
uint32_t chunkSize;
uint16_t wFormatTag;
uint16_t wChannels;
uint32_t dwSamplesPerSec;
uint32_t dwAvgBytesPerSec;
Expand All @@ -127,7 +127,7 @@ typedef union {
typedef union {
struct {
ID chunkID;
long chunkSize;
uint32_t chunkSize;
};
uint8_t data[8];
} DATACHUNK;
Expand Down Expand Up @@ -254,9 +254,9 @@ int main(int argc, char *argv[]) {
#if __WIN32
unsigned __int64 t0 = *(
unsigned __int64 *)(0x7FFE0000 + 0x8); // like QueryUnbiasedInterruptTime
__int64 npack = 0;
#endif

__int64 npack = 0;

while ((streamSize - used_Stream_count) > streamUsed) {

Expand All @@ -265,7 +265,9 @@ int main(int argc, char *argv[]) {
frame_size, &streamUsed, &out_pcm_szie);
out_pcm_count += out_pcm_szie;
used_Stream_count += streamUsed;
#if __WIN32
npack += 1;
#endif
}
if (result != 0) {
printf("%s\r\n",get_error_code_string(ldacBT_get_error_code(ldacBT_dec_handle)));
Expand Down
12 changes: 7 additions & 5 deletions ldac_enc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ typedef char ID[4];
typedef union {
struct {
ID groupID;
long size;
uint32_t size;
ID riffType;
};
uint8_t data[0xc];
Expand All @@ -112,8 +112,8 @@ typedef union {
typedef union {
struct {
ID chunkID;
long chunkSize;
short wFormatTag;
uint32_t chunkSize;
uint16_t wFormatTag;
uint16_t wChannels;
uint32_t dwSamplesPerSec;
uint32_t dwAvgBytesPerSec;
Expand All @@ -126,7 +126,7 @@ typedef union {
typedef union {
struct {
ID chunkID;
long chunkSize;
uint32_t chunkSize;
};
uint8_t data[8];
} DATACHUNK;
Expand Down Expand Up @@ -255,15 +255,17 @@ int main(int argc, char *argv[]) {
#if __WIN32
unsigned __int64 t0 = *(
unsigned __int64 *)(0x7FFE0000 + 0x8); // like QueryUnbiasedInterruptTime
#endif
__int64 npack = 0;
#endif
while ((input_pcm_size - pcmUsedcount) >= pcmUsed) {
result |=
ldacBT_encode(ldacBT_enc_handle, input_pcm + pcmUsedcount, &pcmUsed,
pStream + streamoutputcount, &streamSize, &frameNum);
pcmUsedcount += pcmUsed;
streamoutputcount += streamSize;
#if __WIN32
npack += 1;
#endif
}
// ldacBT_encode(ldacBT_enc_handle, input_pcm + 44 + pcmUsed, &pcmUsed,
// pStream, &streamSize, &frameNum);
Expand Down