[FFmpeg-devel] [PATCH] avcodec/aacps: move checks for valid length outside the stereo_interpolate dsp function
James Almer
jamrial at gmail.com
Sat Jun 3 20:04:31 EEST 2017
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavcodec/aacps.c | 7 ++++---
libavcodec/x86/aacpsdsp.asm | 6 ------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/libavcodec/aacps.c b/libavcodec/aacps.c
index 29de8a5ea7..473da7bd43 100644
--- a/libavcodec/aacps.c
+++ b/libavcodec/aacps.c
@@ -979,9 +979,10 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
h_step[1][2] = AAC_MSUB31_V3(H21[1][e+1][b], h[1][2], width);
h_step[1][3] = AAC_MSUB31_V3(H22[1][e+1][b], h[1][3], width);
}
- ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd](
- l[k] + 1 + start, r[k] + 1 + start,
- h, h_step, stop - start);
+ if (stop - start)
+ ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd](
+ l[k] + 1 + start, r[k] + 1 + start,
+ h, h_step, stop - start);
}
}
}
diff --git a/libavcodec/x86/aacpsdsp.asm b/libavcodec/x86/aacpsdsp.asm
index 4548bb4257..1eb0136b81 100644
--- a/libavcodec/x86/aacpsdsp.asm
+++ b/libavcodec/x86/aacpsdsp.asm
@@ -91,8 +91,6 @@ INIT_XMM sse3
cglobal ps_stereo_interpolate, 5, 5, 6, l, r, h, h_step, n
movaps m0, [hq]
movaps m1, [h_stepq]
- cmp nd, 0
- jle .ret
unpcklps m4, m0, m0
unpckhps m0, m0
unpcklps m5, m1, m1
@@ -115,7 +113,6 @@ align 16
movhps [rq+nq], m2
add nq, 8
jl .loop
-.ret:
REP_RET
;***************************************************************************
@@ -125,8 +122,6 @@ align 16
;***************************************************************************
INIT_XMM sse3
cglobal ps_stereo_interpolate_ipdopd, 5, 5, 10, l, r, h, h_step, n
- cmp nd, 0
- jle .ret
movaps m0, [hq]
movaps m1, [hq+mmsize]
%if ARCH_X86_64
@@ -166,7 +161,6 @@ align 16
movhps [rq+nq], m2
add nq, 8
jl .loop
-.ret:
REP_RET
;*******************************************************************
--
2.13.0
More information about the ffmpeg-devel
mailing list