• Lynne's avatar
    opusdsp: adjust and optimize C function to match assembly · 6b22e28f
    Lynne authored
    The C and asm versions behaved differently _outside_ of the codec.
    
    The C version returned pre-multiplied 'state' for the next execution
    to use right away, while the assembly version outputted non-multiplied
    'state' for the next execution to multiply to save instructions.
    Since the initial state when initialized or seeking is always 0,
    and since C and asm versions were never mixed, there was no issue.
    
    However, comparing outputs directly in checkasm doesn't work without
    dividing the initial state by CELT_EMPH_COEFF and multiplying the
    returned state by CELT_EMPH_COEFF for the assembly function.
    
    Since its actually faster to do this in C as well, copy the behavior the
    asm versions use. As a reminder, the initial state 0 is divided by
    CELT_EMPH_COEFF on seek and init (just in case in the future this is
    changed, its technically more correct to init with CELT_EMPH_COEFF than 0,
    however when seeking this will result in more audiable pops, unlike with 0
    where the output gets in sync over a few samples).
    6b22e28f
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...