[FFmpeg-devel] [PATCH] opus_pvq_search.asm: Handle zero vector input differently.

Rostislav Pehlivanov atomnuker at gmail.com
Fri Aug 25 18:48:40 EEST 2017


On 25 August 2017 at 16:38, Ivan Kalvachev <ikalvachev at gmail.com> wrote:

> Instead of returning all zeroes as result and Syy=1.0,
> place all the K pulses in the first element y[0]
> and return Syy=K*K.
>
> This is how the original opus function handles the case.
> This is how the existing pvq_search_c handles the case.
>
> Also, according to Rostislav, the encoded all zeros vector
> would be decoded as such y[0]=K vector, before dequantization.
> So it is better to do that explicitly and calculate
> the proper gain in the encoder.
> --
>
> I must point out that ppp_pvq_search_c() does generate
> y[0]=-K vector, not +K.
> This is because FFSIGN(0.0) returns -1.
> I do consider this bug, however I'm not quite sure what
> is the best way to handle it.
>
>
I don't think its a bug, celt_cwrsi() also has the same behavior (and
doesn't use FFSIGN) so FF_SIGN returning -1 in the encoder matches what
celt_cwrsi() would see.
Could you send a V2 which outputs a -K in y[0] instead?


More information about the ffmpeg-devel mailing list