Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relicensing requests for BES of originally open sourced files #92

Open
8 tasks
Tracked by #76
OneDeuxTriSeiGo opened this issue Mar 19, 2024 · 0 comments
Open
8 tasks
Tracked by #76

Comments

@OneDeuxTriSeiGo
Copy link

OneDeuxTriSeiGo commented Mar 19, 2024

Parent Issue: #76

The list below are files that are derived from open source files.

Included are the original license, the license declared in the SDK, the license we would like the source file relicensed to, and a diff between the reconstruction and the SDK.

  • include/rtos/rtx/os_tcb.h

    • Originally Apache-2.0

    • Declared BES License in SDK version.

    • Relicense to Apache-2.0

    • Diff of changes (click to view)
      diff --git reconstruction/include/rtos/rtx/os_tcb.h bes/include/rtos/rtx/os_tcb.h
      index 800f7f534a0..83c6a255733 100644
      --- a/include/rtos/rtx/os_tcb.h
      +++ b/include/rtos/rtx/os_tcb.h
      @@ -43,6 +43,16 @@ typedef struct OS_TCB {
        /* A memory space for arm standard library. */
         U32 std_libspace[96/4];
       #endif
      +#if __RTX_CPU_STATISTICS__
      +  U32    swap_in_time;            /* the task schedule in time              */
      +  U32    swap_out_time;           /* the task schedule out time             */
      +  U32    rtime;                   /* the task runing time after startup     */
      +  U8     *name;
      +#if TASK_HUNG_CHECK_ENABLED
      +  U8     hung_check;
      +  U32    hung_check_timeout;
      +#endif
      +#endif /* __RTX_CPU_STATISTICS__*/
      
         /* Task entry point used for uVision debugger                              */
         FUNCP  ptask;                   /* Task entry address                      */
  • rtos/rtx5/RTE_Components.h

    • Originally Apache-2.0

    • No Declared License in SDK version.

    • Relicense to Apache-2.0

    • Diff of changes (click to view)
      diff --git reconstruction/rtos/rtx5/RTE_Components.h bes/rtos/rtx5/RTE_Components.h
      index 03da4e7ef67..717ad1264ca 100644
      --- a/rtos/rtx5/RTE_Components.h
      +++ b/rtos/rtx5/RTE_Components.h
      @@ -1,5 +1,7 @@
       #ifndef RTE_COMPONENTS_H
       #define RTE_COMPONENTS_H
      
      +#include "plat_addr_map.h"
      +#define CMSIS_device_header _TO_STRING(CONCAT_SUFFIX(CHIP_ID_LITERAL, h))
      
       #endif
  • services/interconnection/umm_malloc/umm_malloc.c

    • Originally MIT

    • No Declared License in SDK version.

    • Relicense to MIT

    • Diff of changes (click to view)
      diff --git reconstruction/services/interconnection/umm_malloc/umm_malloc.c bes/services/interconnection/umm_malloc/umm_malloc.c
      index 94d147225d7..a344d14ff95 100644
      --- a/services/interconnection/umm_malloc/umm_malloc.c
      +++ b/services/interconnection/umm_malloc/umm_malloc.c
      @@ -29,11 +29,14 @@
      
       #include <stdio.h>
       #include <string.h>
      +#include "stdint.h"
      +#include "cmsis_os.h"
       #include "dbglog.h"
       #include "umm_malloc.h"
      
       /* Use the default DBGLOG_LEVEL and DBGLOG_FUNCTION */
      
      +unsigned char umm_heap_array[UMM_MALLOC_CFG_HEAP_SIZE];
       /* ------------------------------------------------------------------------- */
      
       UMM_H_ATTPACKPRE typedef struct umm_ptr_t {
      @@ -72,6 +75,40 @@ unsigned short int umm_numblocks = 0;
       #define UMM_PFREE(b)  (UMM_BLOCK(b).body.free.prev)
       #define UMM_DATA(b)   (UMM_BLOCK(b).body.data)
      
      +static osMutexId umm_clock_mutex_id = NULL;
      +osMutexDef(umm_clock_mutex);
      +
      +/* ------------------------------------------------------------------------ */
      +void LOCK_UMM_CLOCK(void)
      +{
      +    if(osMutexWait(umm_clock_mutex_id, osWaitForever) != osOK)
      +        DBGLOG_INFO(1,"%s Error", __func__);
      +}
      +
      +void UNLOCK_UMM_CLOCK(void)
      +{
      +    if(osMutexRelease(umm_clock_mutex_id) != osOK)
      +        DBGLOG_INFO(1,"%s Error", __func__);
      +}
      +
      +/* ------------------------------------------------------------------------ */
      +
      +static void trace_umm_blocks_info( void ) {
      +    unsigned short int blockSize = 0;
      +    unsigned short int cf = 0;
      +
      +    cf = UMM_NFREE(0);
      +    blockSize = blockSize;
      +    DBGLOG_INFO(1, "fisrt free block %d", cf);
      +
      +    while( cf ) {
      +        blockSize = (UMM_NBLOCK(cf) & UMM_BLOCKNO_MASK) - cf;
      +
      +        DBGLOG_INFO(2, "Looking at block %6i size %6i\n", cf, blockSize );
      +
      +        cf = UMM_NFREE(cf);
      +    }
      +}
      
       /* ------------------------------------------------------------------------ */
      
      @@ -145,7 +182,7 @@ static void umm_assimilate_up( unsigned short int c ) {
                * the free list
                */
      
      -        DBGLOG_DEBUG( "Assimilate up to next block, which is FREE\n" );
      +        DBGLOG_DEBUG(2, "%d Assimilate up to next block %d, which is FREE\n", c, UMM_NBLOCK(c));
      
               /* Disconnect the next block from the FREE list */
      
      @@ -177,6 +214,13 @@ void umm_init( void ) {
           /* init heap pointer and size, and memset it to 0 */
           umm_heap = (umm_block *)UMM_MALLOC_CFG_HEAP_ADDR;
           umm_numblocks = (UMM_MALLOC_CFG_HEAP_SIZE / sizeof(umm_block));
      +    DBGLOG_DEBUG(3,  "%s umm_heap %p blocks number %d", __func__, umm_heap, umm_numblocks);
      +
      +    if (umm_clock_mutex_id == NULL)
      +    {
      +        umm_clock_mutex_id = osMutexCreate((osMutex(umm_clock_mutex)));
      +    }
      +
           memset(umm_heap, 0x00, UMM_MALLOC_CFG_HEAP_SIZE);
      
           /* setup initial blank heap structure */
      @@ -238,7 +282,7 @@ void umm_free( void *ptr ) {
           /* If we're being asked to free a NULL pointer, well that's just silly! */
      
           if( (void *)0 == ptr ) {
      -        DBGLOG_DEBUG( "free a null pointer -> do nothing\n" );
      +        DBGLOG_DEBUG(0, "free a null pointer -> do nothing\n" );
      
               return;
           }
      @@ -259,7 +303,7 @@ void umm_free( void *ptr ) {
      
           c = (((char *)ptr)-(char *)(&(umm_heap[0])))/sizeof(umm_block);
      
      -    DBGLOG_DEBUG( "Freeing block %6i\n", c );
      +    DBGLOG_DEBUG(2, "Freeing block %6i %p\n", c, ptr);
      
           /* Now let's assimilate this block with the next one if possible. */
      
      @@ -269,7 +313,7 @@ void umm_free( void *ptr ) {
      
           if( UMM_NBLOCK(UMM_PBLOCK(c)) & UMM_FREELIST_MASK ) {
      
      -        DBGLOG_DEBUG( "Assimilate down to next block, which is FREE\n" );
      +        DBGLOG_DEBUG(1, "Assimilate down to next block %d, which is FREE\n", UMM_PBLOCK(c));
      
               c = umm_assimilate_down(c, UMM_FREELIST_MASK);
           } else {
      @@ -278,7 +322,7 @@ void umm_free( void *ptr ) {
                * of the free list
                */
      
      -        DBGLOG_DEBUG( "Just add to head of free list\n" );
      +        DBGLOG_DEBUG(0, "Just add to head of free list\n" );
      
               UMM_PFREE(UMM_NFREE(0)) = c;
               UMM_NFREE(c)            = UMM_NFREE(0);
      @@ -315,7 +359,7 @@ void *umm_malloc( size_t size ) {
            */
      
           if( 0 == size ) {
      -        DBGLOG_DEBUG( "malloc a block of 0 bytes -> do nothing\n" );
      +        DBGLOG_DEBUG(0, "malloc a block of 0 bytes -> do nothing\n" );
      
               return( (void *)NULL );
           }
      @@ -341,7 +385,7 @@ void *umm_malloc( size_t size ) {
           while( cf ) {
               blockSize = (UMM_NBLOCK(cf) & UMM_BLOCKNO_MASK) - cf;
      
      -        DBGLOG_TRACE( "Looking at block %6i size %6i\n", cf, blockSize );
      +        DBGLOG_DEBUG(2, "Looking at block %6i size %6i\n", cf, blockSize );
      
       #if defined UMM_BEST_FIT
               if( (blockSize >= blocks) && (blockSize < bestSize) ) {
      @@ -374,7 +418,7 @@ void *umm_malloc( size_t size ) {
      
               if( blockSize == blocks ) {
                   /* It's an exact fit and we don't neet to split off a block. */
      -            DBGLOG_DEBUG( "Allocating %6i blocks starting at %6i - exact\n", blocks, cf );
      +            DBGLOG_DEBUG(2, "Allocating %6i blocks starting at %6i - exact\n", blocks, cf );
      
                   /* Disconnect this block from the FREE list */
      
      @@ -382,7 +426,7 @@ void *umm_malloc( size_t size ) {
      
               } else {
                   /* It's not an exact fit and we need to split off a block. */
      -            DBGLOG_DEBUG( "Allocating %6i blocks starting at %6i - existing\n", blocks, cf );
      +            DBGLOG_DEBUG(2, "Allocating %6i blocks starting at %6i - existing\n", blocks, cf );
      
                   /*
                    * split current free block `cf` into two blocks. The first one will be
      @@ -408,7 +452,8 @@ void *umm_malloc( size_t size ) {
           } else {
               /* Out of memory */
      
      -        DBGLOG_DEBUG(  "Can't allocate %5i blocks\n", blocks );
      +        DBGLOG_DEBUG(1,  "Can't allocate %5i blocks\n", blocks );
      +        trace_umm_blocks_info();
      
               /* Release the critical section... */
               UMM_CRITICAL_EXIT();
      @@ -448,7 +493,7 @@ void *umm_realloc( void *ptr, size_t size ) {
            */
      
           if( ((void *)NULL == ptr) ) {
      -        DBGLOG_DEBUG( "realloc the NULL pointer - call malloc()\n" );
      +        DBGLOG_DEBUG(0, "realloc the NULL pointer - call malloc()\n" );
      
               return( umm_malloc(size) );
           }
      @@ -460,7 +505,7 @@ void *umm_realloc( void *ptr, size_t size ) {
            */
      
           if( 0 == size ) {
      -        DBGLOG_DEBUG( "realloc to 0 size, just free the block\n" );
      +        DBGLOG_DEBUG(0, "realloc to 0 size, just free the block\n" );
      
               umm_free( ptr );
      
      @@ -509,7 +554,7 @@ void *umm_realloc( void *ptr, size_t size ) {
               prevBlockSize = (c - UMM_PBLOCK(c));
           }
      
      -    DBGLOG_DEBUG( "realloc blocks %i blockSize %i nextBlockSize %i prevBlockSize %i\n", blocks, blockSize, nextBlockSize, prevBlockSize );
      +    DBGLOG_DEBUG(4, "realloc blocks %i blockSize %i nextBlockSize %i prevBlockSize %i\n", blocks, blockSize, nextBlockSize, prevBlockSize );
      
           /*
            * Ok, now that we're here we know how many blocks we want and the current
      @@ -536,21 +581,21 @@ void *umm_realloc( void *ptr, size_t size ) {
            */
      
           if (blockSize >= blocks) {
      -        DBGLOG_DEBUG( "realloc the same or smaller size block - %i, do nothing\n", blocks );
      +        DBGLOG_DEBUG(1, "realloc the same or smaller size block - %i, do nothing\n", blocks );
               /* This space intentionally left blank */
           } else if ((blockSize + nextBlockSize) >= blocks) {
      -        DBGLOG_DEBUG( "realloc using next block - %i\n", blocks );
      +        DBGLOG_DEBUG(1, "realloc using next block - %i\n", blocks );
               umm_assimilate_up( c );
               blockSize += nextBlockSize;
           } else if ((prevBlockSize + blockSize) >= blocks) {
      -        DBGLOG_DEBUG( "realloc using prev block - %i\n", blocks );
      +        DBGLOG_DEBUG(1, "realloc using prev block - %i\n", blocks );
               umm_disconnect_from_free_list( UMM_PBLOCK(c) );
               c = umm_assimilate_down(c, 0);
               memmove( (void *)&UMM_DATA(c), ptr, curSize );
               ptr = (void *)&UMM_DATA(c);
               blockSize += prevBlockSize;
           } else if ((prevBlockSize + blockSize + nextBlockSize) >= blocks) {
      -        DBGLOG_DEBUG( "realloc using prev and next block - %i\n", blocks );
      +        DBGLOG_DEBUG(1, "realloc using prev and next block - %i\n", blocks );
               umm_assimilate_up( c );
               umm_disconnect_from_free_list( UMM_PBLOCK(c) );
               c = umm_assimilate_down(c, 0);
      @@ -558,14 +603,14 @@ void *umm_realloc( void *ptr, size_t size ) {
               ptr = (void *)&UMM_DATA(c);
               blockSize += (prevBlockSize + nextBlockSize);
           } else {
      -        DBGLOG_DEBUG( "realloc a completely new block %i\n", blocks );
      +        DBGLOG_DEBUG(1, "realloc a completely new block %i\n", blocks );
               void *oldptr = ptr;
               if( (ptr = umm_malloc( size )) ) {
      -            DBGLOG_DEBUG( "realloc %i to a bigger block %i, copy, and free the old\n", blockSize, blocks );
      +            DBGLOG_DEBUG(2, "realloc %i to a bigger block %i, copy, and free the old\n", blockSize, blocks );
                   memcpy( ptr, oldptr, curSize );
                   umm_free( oldptr );
               } else {
      -            DBGLOG_DEBUG( "realloc %i to a bigger block %i failed - return NULL and leave the old block!\n", blockSize, blocks );
      +            DBGLOG_DEBUG(2, "realloc %i to a bigger block %i failed - return NULL and leave the old block!\n", blockSize, blocks );
                   /* This space intentionally left blnk */
               }
               blockSize = blocks;
      @@ -576,7 +621,7 @@ void *umm_realloc( void *ptr, size_t size ) {
            */
      
           if (blockSize > blocks ) {
      -        DBGLOG_DEBUG( "split and free %i blocks from %i\n", blocks, blockSize );
      +        DBGLOG_DEBUG(2, "split and free %i blocks from %i\n", blocks, blockSize );
               umm_split_block( c, blocks, 0 );
               umm_free( (void *)&UMM_DATA(c+blocks) );
           }
  • services/interconnection/umm_malloc/umm_malloc.h

    • Originally MIT

    • No Declared License in SDK version.

    • Relicense to MIT

    • Diff of changes (click to view)
      diff --git reconstruction/services/interconnection/umm_malloc/umm_malloc.h bes/services/interconnection/umm_malloc/umm_malloc.h
      index 9005475ae87..e5ba32e8a61 100644
      --- a/services/interconnection/umm_malloc/umm_malloc.h
      +++ b/services/interconnection/umm_malloc/umm_malloc.h
      @@ -32,7 +32,7 @@ typedef unsigned int                size_t;
      
       /* Start addresses and the size of the heap */
       #define UMM_MALLOC_CFG_HEAP_ADDR (umm_heap_array)
      -#ifdef DUAL_MIC_RECORDING
      +#ifdef __DUAL_MIC_RECORDING__
       #define UMM_MALLOC_CFG_HEAP_SIZE (10 * 1024)
       #else
       #define UMM_MALLOC_CFG_HEAP_SIZE 0x1000 // 4K
  • services/multimedia/audio/process/adp/include/adp_config.h

    • Originally BSD-3

    • No Declared License in SDK version.

    • Relicense to BSD-3

    • Diff of changes (click to view)
      diff --git reconstruction/services/multimedia/audio/process/adp/include/adp_config.h bes/services/multimedia/audio/process/adp/include/adp_config.h
      index 4f7b3b01a10..76443528ffc 100644
      --- a/services/multimedia/audio/process/adp/include/adp_config.h
      +++ b/services/multimedia/audio/process/adp/include/adp_config.h
      @@ -1,8 +1,11 @@
       // Microsoft version of 'inline'
      
      +#ifdef WIN32
       #define inline __inline
      +#endif
      
      
      +//#define FIXED_POINT
      
      
       // In Visual Studio, _M_IX86_FP=1 means /arch:SSE was used, likewise
      @@ -25,4 +28,6 @@
       /* We don't support visibility on Win32 */
       #define EXPORT
      
      +#define USE_STATIC_MEMORY
      
      +#define ADPFILTER_NUM 400
  • services/multimedia/speech/inc/g726.h

    • Originally MIT

    • Declared BES License in SDK version.

    • Relicense to MIT

    • Diff of changes (click to view)
      diff --git reconstruction/services/multimedia/speech/inc/g726.h bes/services/multimedia/speech/inc/g726.h
      index 66d73adff5f..8203ab692a2 100644
      --- a/services/multimedia/speech/inc/g726.h
      +++ b/services/multimedia/speech/inc/g726.h
      @@ -7,8 +7,8 @@
       extern "C" {
       #endif
      
      -extern void g726_Encode(unsigned char *speech,char *bitstream);
      -extern void g726_Decode(char *bitstream,unsigned char *speech);
      +unsigned long g726_Encode(unsigned char *speech,char *bitstream, uint32_t sampleCount, uint8_t isReset);
      +unsigned long g726_Decode(char *bitstream,unsigned char *speech, uint32_t sampleCount, uint8_t isReset);
      
       #ifdef __cplusplus
       }
  • thirdparty/audio_codec_lib/ldac/inc/ldacBT.h

    • Originally Apache-2.0

    • No Declared License in SDK version.

    • Relicense to Apache-2.0

    • Diff of changes (click to view)
      diff --git reconstruction/thirdparty/audio_codec_lib/ldac/inc/ldacBT.h bes/thirdparty/audio_codec_lib/ldac/inc/ldacBT.h
      index 3f3e8f7f4eb..47896c98d6d 100644
      --- a/thirdparty/audio_codec_lib/ldac/inc/ldacBT.h
      +++ b/thirdparty/audio_codec_lib/ldac/inc/ldacBT.h
      @@ -24,8 +24,19 @@ extern "C" {
       #endif /* LDACBT_API  */
      
       /* This file contains the definitions, declarations and macros for an implimentation of
      +#ifdef _ENCODE_ONLY
        * LDAC encode processing.
      +#endif
      +#ifdef _DECODE_ONLY
      + * LDAC decode processing.
      +#endif
      +#ifndef _ENCODE_ONLY
      +#ifndef _DECODE_ONLY
      + * LDAC encode and decode processing.
      +#endif
      +#endif
        *
      +#ifndef _DECODE_ONLY
        * The basic flow of the encode processing is as follows:
        * - The program creates an handle of an LDAC api using ldacBT_get_handle().
        * - The program initialize the handle for encode using ldacBT_init_handle_encode().
      @@ -39,23 +50,60 @@ extern "C" {
        * - The handle may be closed using ldacBT_close_handle() then used again, or released with
        *   ldacBT_free_handle().
        * - The rest of the set functions should be called only if it is needed by the client.
      +#endif // _DECODE_ONLY
      +#ifndef _ENCODE_ONLY
      + * The basic flow of the decode processing is as follows:
      + * - The program creates an handle of an LDAC api using ldacBT_get_handle().
      + * - The program initialize the handle for decode using ldacBT_init_handle_decode().
      + * - The program calls ldacBT_decode() to decode data.
      + * - The handle may be closed using ldacBT_close_handle() then used again, or released with
      + *   ldacBT_free_handle().
      + * - The rest of the set functions should be called only if it is needed by the client.
      +#endif // _ENCODE_ONLY
        *
        *
        * Note for an implimentation
        * - Error processing
        *     When continuous processing for next frame is performed after error detection, following
        *     processing must be carried out using C function provided in the library.
      +#ifdef _ENCODE_ONLY
        *      - Release of internal variables in encode processing using ldacBT_close_handle().
        *      - Allocation and initialization of internal variables in encode processing using
        *        ldacBT_init_handle_encode().
        *     Note that the encoded output for a few frames will not be present just after error recovery.
      +#endif // _ENCODE_ONLY
      +#ifdef _DECODE_ONLY
      + *      - Release of internal variables in decode processing using ldacBT_close_handle().
      + *      - Allocation and initialization of internal variables in decode processing using
      + *        ldacBT_init_handle_decode().
      + *     Note that the first decoded out PCM signal will not be present just after error recovery.
      +#endif // _DECODE_ONLY
      +#ifndef _ENCODE_ONLY
      +#ifndef _DECODE_ONLY
      + *      - Release of internal variables in encode/decode processing using ldacBT_close_handle().
      + *      - Allocation and initialization of internal variables in encode/decode processing using
      + *        ldacBT_init_handle_encode() for encode, ldacBT_init_handle_decode() for decode.
      + *     Note that the encoded output for a few frames will not be present just after error recovery.
      + *     Note that the first decoded out PCM signal will not be present just after error recovery.
      +#endif
      +#endif
        *
      +#ifndef _DECODE_ONLY
        * - Resuming of the encode processing from an interruption
        *     In case of resuming of the encode processing from interruption (such as changing
        *     configuration, seeking and playback), initialization of internal variables in encode
        *     processing must be carried out as error processing described above.
        *     Note that the encoded output for a few frames will not be present just after initialization
        *     as above.
      +#endif
      +#ifndef _ENCODE_ONLY
      + * Resuming of the decode processing from an interruption
      + *     In case of resuming of the decode processing from interruption (such as changing
      + *     configuration, seeking and playback), initialization of internal variables in decode
      + *     processing must be carried out as error processing described above.
      + *     Note that the first decoded out PCM signal will not be present just after initialization
      + *     as above.
      +#endif
        *
        *
        * Glossary
      @@ -117,6 +165,7 @@ typedef enum {
           LDACBT_SMPL_FMT_F32 = 0x5,
       } LDACBT_SMPL_FMT_T;
      
      +#ifndef _DECODE_ONLY
       /* Encode Quality Mode Index. (EQMID)
        *  The configuration of encoding in LDAC will be coordinated by "Encode Quality Mode Index"
        *  parameter. Configurable values are shown below.
      @@ -143,6 +192,7 @@ enum {
        *    | LDACBT_EQMID_MQ |   303kbps  |   330kbps  |
        *     -------------------------------------------
        */
      +#endif
      
       /* Maximum size of the "ldac_transport_frame" sequence at transportation. */
       #define LDACBT_MAX_NBYTES 1024 /* byte */
      @@ -199,8 +249,20 @@ LDACBT_API void ldacBT_close_handle( HANDLE_LDAC_BT hLdacBt );
       LDACBT_API int  ldacBT_get_version( void );
      
       /* Acquisition of the sampling frequency in current configuration.
      +#ifdef _ENCODE_ONLY
        * The LDAC handle must be initialized by API function ldacBT_init_handle_encode() prior to
        * calling this function.
      +#endif
      +#ifdef _DECODE_ONLY
      + * The LDAC handle must be initialized by API function ldacBT_init_handle_decode() prior to
      + * calling this function.
      +#endif
      +#ifndef _ENCODE_ONLY
      +#ifndef _DECODE_ONLY
      + * The LDAC handle must be initialized by API function ldacBT_init_handle_encode() or
      + * ldacBT_init_handle_decode() prior to calling this function.
      +#endif
      +#endif
        *  Format
        *      int  ldacBT_get_sampling_freq( HANDLE_LDAC_BT hLdacBt );
        *  Arguments
      @@ -211,8 +273,20 @@ LDACBT_API int  ldacBT_get_version( void );
       LDACBT_API int  ldacBT_get_sampling_freq( HANDLE_LDAC_BT hLdacBt );
      
       /* Acquisition of the Bit-rate.
      +#ifdef _ENCODE_ONLY
        * The LDAC handle must be initialized by API function ldacBT_init_handle_encode() prior to
        * calling this function.
      +#endif
      +#ifdef _DECODE_ONLY
      + * The LDAC handle must be initialized by API function ldacBT_init_handle_decode() prior to
      + * calling this function.
      +#endif
      +#ifndef _ENCODE_ONLY
      +#ifndef _DECODE_ONLY
      + * The LDAC handle must be initialized by API function ldacBT_init_handle_encode() or
      + * ldacBT_init_handle_decode() prior to calling this function.
      +#endif
      +#endif
        *  Format
        *      int  ldacBT_get_bitrate( HANDLE_LDAC_BT hLdacBt );
        *  Arguments
      @@ -222,6 +296,7 @@ LDACBT_API int  ldacBT_get_sampling_freq( HANDLE_LDAC_BT hLdacBt );
        */
       LDACBT_API int  ldacBT_get_bitrate( HANDLE_LDAC_BT hLdacBt );
      
      +#ifndef _DECODE_ONLY
       /* Initialization of a LDAC handle for encode processing.
        * The LDAC handle must be allocated by API function ldacBT_get_handle() prior to calling this API.
        * "mtu" value should be configured to MTU size of AVDTP Transport Channel, which is determined by
      @@ -346,6 +421,69 @@ LDACBT_API int  ldacBT_alter_eqmid_priority( HANDLE_LDAC_BT hLdacBt, int priorit
        */
       LDACBT_API int  ldacBT_encode( HANDLE_LDAC_BT hLdacBt, void *p_pcm, int *pcm_used,
                                      unsigned char *p_stream, int *stream_sz, int *frame_num );
      +#endif /* _DECODE_ONLY */
      +#ifndef _ENCODE_ONLY
      +/* for decode */
      +/* Initialization of a LDAC handle for decode processing.
      + * The LDAC handle must be allocated by API function ldac_get_handle() prior to calling this
      + * function.
      + * "cm" is configured to channel_mode in LDAC, which is determined by SRC and SNK devices in
      + * Bluetooth transmission.
      + * "sf" is configured to sampling frequency, which is determined by SRC and SNK devices in
      + * Bluetooth transmission.
      + * Reserved arguments must be set to "0".
      + *  Format
      + *      int  ldacBT_init_handle_decode( HANDLE_LDAC_BT hLdacBt, int cm, int sf, int nshift,
      + *                                      int var0, int var1 );
      + *  Arguments
      + *      hLdacBt    HANDLE_LDAC_BT    LDAC handle.
      + *      cm         int               Information of the channel_mode.
      + *      sf         int               Sampling frequency of input LDAC bit stream.
      + *      nshift     int               Reserved, must be "0".
      + *      var0       int               Reserved, must be "0".
      + *      var1       int               Reserved, must be "0".
      + *  Return value
      + *      int : 0 for success, -1 for failure.
      + */
      +LDACBT_API int ldacBT_init_handle_decode( HANDLE_LDAC_BT hLdacBt, int cm, int sf,
      +                                          int var0, int var1, int var2 );
      +
      +/* LDAC decode processing.
      + * The LDAC handle must be initialized by API function ldacBT_init_handle_decode() prior to
      + * calling this function.
      + * < Regarding on input "ldac_transport_frame" >
      + *   The valid data size of "ldac_transport_frame" must be set in "stream_bytes".
      + *   Referenced data size of "ldac_transport_frame" for decode processing will be set in
      + *   "used_bytes" on return.
      + *   As a reading once of "ldac_transport_frame" is performed by internal processing with
      + *   looking ahead of two bytes, "LDAC_MAX_NBYTES+2" bytes must be allocated for
      + *   "ldac_transport_frame" (p_bs) in API function caller side.
      + * < Regarding on output PCM signal >
      + *   "fmt" is configured to output pcm audio format.
      + *   The size of output PCM signal will be set to "wrote_bytes". The value of
      + *   "frame sample" * "Number of channels" * "bit length of pcm sample"/8 will be set in normal.
      + *   The first decoded out PCM signal just after initialization will not be present.
      + *
      + *  Format
      + *      int  ldac_decode ( HANDLE_LDAC_BT hLdacBt, unsigned char * p_bs, unsigned char * p_pcm
      + *                         LDACBT_SMPL_FMT_T fmt, int bs_bytes,
      + *                         int *used_bytes, int *wrote_bytes );
      + *  Arguments
      + *      hLdacBt    HANDLE_LDAC_BT    LDAC handle.
      + *      p_bs       unsigned char *   Pointer to "ldac_transport_frame".
      + *      p_pcm      unsigned char *   Decoded out PCM signal sequence.
      + *      fmt        LDACBT_SMPL_FMT_T Audio format type of output pcm.
      + *      bs_bytes    int *            Data size of input "ldac_transport_frame". Unit: Byte.
      + *      used_bytes  int *            Data size of referenced "ldac_transport_frame". Unit: Byte.
      + *      wrote_bytes int *            Size of decoded out PCM signal. Unit: Byte.
      + *  Return value
      + *      int : 0 for success, -1 for failure.
      + */
      +LDACBT_API int ldacBT_decode( HANDLE_LDAC_BT hLdacBt, unsigned char *p_bs, unsigned char *p_pcm,
      +                              LDACBT_SMPL_FMT_T fmt, int bs_bytes,
      +                              int *used_bytes, int *wrote_bytes );
      +
      +#endif /* _ENCODE_ONLY */
      
       /* Acquisition of previously established error code.
        * The LDAC handle must be allocated by API function ldacBT_get_handle() prior to calling this function.
      @@ -386,6 +524,7 @@ LDACBT_API int  ldacBT_get_error_code( HANDLE_LDAC_BT hLdacBt );
       /*    Non Fatal Error (Handle Level) ********************************************/
       #define LDACBT_ERR_NOT_IMPLEMENTED          128
       #define LDACBT_ERR_NON_FATAL_ENCODE         132
      +#define LDACBT_ERR_RESTRICTED_BY_NUM_FRAMES 255
      
       /*    Fatal Error ***************************************************************/
       #define LDACBT_ERR_FATAL                    256
  • thirdparty/audio_codec_lib/liblhdc-dec/inc/lhdcUtil.h

    • Originally BSD-3

    • No Declared License in SDK version.

    • Relicense to BSD-3.

    • Diff of changes (click to view)
      diff --git reconstruction/thirdparty/audio_codec_lib/liblhdc-dec/inc/lhdcUtil.h bes/thirdparty/audio_codec_lib/liblhdc-dec/inc/lhdcUtil.h
      index 992ab3e4964..01d4ef1ab0b 100644
      --- a/thirdparty/audio_codec_lib/liblhdc-dec/inc/lhdcUtil.h
      +++ b/thirdparty/audio_codec_lib/liblhdc-dec/inc/lhdcUtil.h
      @@ -8,18 +8,7 @@
       #ifndef LHDC_UTIL_H
       #define LHDC_UTIL_H
       
      -#include <stdbool.h>
      -#include <stdint.h>
      -
      -
      -
      -
      -
      -#ifdef __cplusplus
      -extern "C" {
      -#endif
      -// Copy definition from external
      -#define BTIF_BD_ADDR_SIZE    6
      +#include "bluetooth.h"
       
       
       // Define for LHDC stream type.
      @@ -38,14 +27,15 @@ typedef enum {
         LHDCV3_BLOCK_SIZE = 256,
       }lhdc_block_size_t;
       
      -typedef struct savi_bt_local_info_t{
      +typedef struct bes_bt_local_info_t{
           uint8_t bt_addr[BTIF_BD_ADDR_SIZE];
           const char *bt_name;
           uint8_t bt_len;
           uint8_t ble_addr[BTIF_BD_ADDR_SIZE];
           const char *ble_name;
           uint8_t ble_len;
      -} savi_bt_local_info;
      +}bes_bt_local_info;
      +
       
       #define A2DP_LHDC_HDR_LATENCY_LOW   0x00
       #define A2DP_LHDC_HDR_LATENCY_MID   0x01
      @@ -54,10 +44,12 @@ typedef struct savi_bt_local_info_t{
       
       #define A2DP_LHDC_HDR_FRAME_NO_MASK 0xfc
       
      -typedef int (*LHDC_GET_BT_INFO)(savi_bt_local_info * bt_info);
      +typedef int (*LHDC_GET_BT_INFO)(bes_bt_local_info * bt_info);
       
       void lhdcInit(uint32_t bitPerSample, uint32_t sampleRate, uint32_t scaleTo16Bits, lhdc_ver_t version);
      -uint32_t lhdcDecodeProcess(uint8_t * pOutBuf, uint8_t * pInput, uint32_t len);
      +bool lhdcReadyForInput(void);
      +uint32_t lhdcPutData(uint8_t * pInpBuf, uint32_t NumBytes);
      +uint32_t lhdcDecodeProcess(uint8_t * pOutBuf);
       void lhdcDestroy();
       bool lhdcSetLicenseKeyTable(uint8_t * licTable, LHDC_GET_BT_INFO pFunc);
       char * getVersionCode();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant