xiph / xiph/opus

LACE / NoLACE and DRED on Fixed Point implementations?

Open
#318 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
3.3k
Forks
808
PR merge metrics
No merged PRs in 30d

Description

Hi,

The new ML algorithms in v1.5 are really impressive. It looks like they're only for implementations of OPUS that are Floating Point.

I'm compiling here for Xtensa LX6 (ESP32) which doesn't have a hard FPU and thus need the Fixed Point implementation to have any real-time audio encoding / decoding.

I haven't really dug into the code, but my guess is the networks are represented in and presented with floating point values.

make clean && ./configure CC=/Users/kevin/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc --host=xtensa --disable-extra-programs --enable-osce --disable-hardening --disable-doc --enable-asm --enable-fixed-point && make CC=/Users/kevin/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc

configure:
------------------------------------------------------------------------
  opus 1.5.1-dirty:  Automatic configuration OK.

    Compiler support:

      C99 var arrays: ................ yes
      C99 lrintf: .................... yes
      Use alloca: .................... no (using var arrays)

    General configuration:

      Floating point support: ........ no
      Fast float approximations: ..... no
      Fixed point debugging: ......... no
      Inline Assembly Optimizations: . No inline ASM for your platform, please send patches
      External Assembly Optimizations: 
      Intrinsics Optimizations: ...... no
      Run-time CPU detection: ........ no
      Custom modes: .................. no
      Assertion checking: ............ no
      Hardening: ..................... no
      Fuzzing: ....................... no
      Check ASM: ..................... no

      API documentation: ............. no
      Extra programs: ................ no
------------------------------------------------------------------------

 Type "make; make install" to compile and install
 Type "make check" to run the test suite

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
  CC       celt/bands.lo
  CC       celt/celt.lo
  CC       celt/celt_encoder.lo
  CC       celt/celt_decoder.lo
In file included from /Users/kevin/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/string.h:180,
                 from celt/os_support.h:41,
                 from celt/celt_decoder.c:37:
celt/celt_decoder.c: In function 'celt_decode_lost':
celt/os_support.h:79:83: error: invalid operands to binary - (have 'float *' and 'celt_sig *' {aka 'int *'})
 #define OPUS_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
                                                                              ~~~~~^~~~~~
celt/celt_decoder.c:914:13: note: in expansion of macro 'OPUS_COPY'
             OPUS_COPY(buf_copy+c*overlap, &decode_mem[c][DECODE_BUFFER_SIZE-N], overlap);
             ^~~~~~~~~
celt/os_support.h:79:83: error: invalid operands to binary - (have 'float *' and 'celt_sig *' {aka 'int *'})
 #define OPUS_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
                                                                              ~~~~~^~~~~~
celt/celt_decoder.c:914:13: note: in expansion of macro 'OPUS_COPY'
             OPUS_COPY(buf_copy+c*overlap, &decode_mem[c][DECODE_BUFFER_SIZE-N], overlap);
             ^~~~~~~~~
make[2]: *** [celt/celt_decoder.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read celt/os_support.h and celt/celt_decoder.c around line 914, then reproduce the failure with the provided fixed-point Xtensa configure and make command. Investigate whether LACE, NoLACE, and DRED are intended to support fixed-point builds; done means the fixed-point build works for the supported algorithms, or the limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.