[FFmpeg-devel] [PATCH 1/4] libavutil: Add saturating subtraction functions

2017-12-02 Thread Andrew D'Addesio
Add av_sat_sub32 and av_sat_dsub32 as the subtraction analogues to av_sat_add32/av_sat_dadd32. Also clarify the formulas for dadd32/dsub32. Signed-off-by: Andrew D'Addesio --- libavutil/arm/intmath.h | 16 libavutil/common.h | 32 +++- 2

[FFmpeg-devel] [PATCH 2/4] opus: Fix arithmetic overflows (per RFC8251)

2017-12-02 Thread Andrew D'Addesio
The relevant sections from the RFC are: Sec.6. Integer Wrap-Around in Inverse Gain Computation 32-bit integer overflow in Levinson recursion. Affects silk_is_lpc_stable(). Sec.8. Cap on Band Energy NaN due to large log-energy value. Affects celt_denormalize(). Signed-off-by: Andrew

[FFmpeg-devel] [PATCH 2/4] opus: Fix arithmetic overflows (per RFC8251)

2017-12-02 Thread Andrew D'Addesio
The relevant sections from the RFC are: Sec.6. Integer Wrap-Around in Inverse Gain Computation 32-bit integer overflow in Levinson recursion. Affects silk_is_lpc_stable(). Sec.8. Cap on Band Energy NaN due to large log-energy value. Affects celt_denormalize(). Signed-off-by: Andrew

[FFmpeg-devel] [PATCH 3/4] opus: Add Special Hybrid Folding (per RFC8251)

2017-12-02 Thread Andrew D'Addesio
/opus_testvectors/ Signed-off-by: Andrew D'Addesio --- libavcodec/opus_celt.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c index ff56041..2bbb96b 100644 --- a/libavcodec/opus_celt.c +++ b/libav

[FFmpeg-devel] [PATCH 4/4] opus: Don't invert phase when downmixing to mono (per RFC8251)

2017-12-02 Thread Andrew D'Addesio
When decoding to downmixed mono, don't put the channels out of phase, as they will cancel out and create audible artifacts. (See RFC 8251 sec. 10.) Signed-off-by: Andrew D'Addesio --- libavcodec/opus_pvq.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/op

[FFmpeg-devel] [PATCH 1/4] libavutil: Add saturating subtraction functions

2017-12-02 Thread Andrew D'Addesio
Add av_sat_sub32 and av_sat_dsub32 as the subtraction analogues to av_sat_add32/av_sat_dadd32. Also clarify the formulas for dadd32/dsub32. Signed-off-by: Andrew D'Addesio --- libavutil/arm/intmath.h | 16 libavutil/common.h | 32 +++- 2

[FFmpeg-devel] [PATCH 3/4] opus: Add Special Hybrid Folding (per RFC8251)

2017-12-02 Thread Andrew D'Addesio
/opus_testvectors/ Signed-off-by: Andrew D'Addesio --- libavcodec/opus_celt.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c index ff56041..2bbb96b 100644 --- a/libavcodec/opus_celt.c +++ b/libav

[FFmpeg-devel] [PATCH 4/4] opus: Don't invert phase when downmixing to mono (per RFC8251)

2017-12-02 Thread Andrew D'Addesio
When decoding to downmixed mono, don't put the channels out of phase, as they will cancel out and create audible artifacts. (See RFC 8251 sec. 10.) Signed-off-by: Andrew D'Addesio --- libavcodec/opus_pvq.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/op

Re: [FFmpeg-devel] [PATCH 3/4] opus: Add Special Hybrid Folding (per RFC8251)

2017-12-07 Thread Andrew D'Addesio
On Wed Dec 6 21:42:48 EET 2017, James Almer wrote: > Valgrind apparently complains about this commit, as i mentioned in > another reply to this thread Hi James, thanks for reporting the issue. There's indeed a problem with patch #3 (use-of-uninitialized-memory in norm[] and norm2[]). libopus org