From 947f933687b9fd4d80b6cad468ddc2b5b20a9c38 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 22 Sep 2012 18:41:25 -0400 Subject: [PATCH 1/3] x86: float_dsp: add SSE version of vector_fmul_scalar() --- libavutil/x86/float_dsp.asm | 29 +++++++++++++++++++++++++++++ libavutil/x86/float_dsp_init.c | 4 ++++ 2 files changed, 33 insertions(+) diff --git a/libavutil/x86/float_dsp.asm b/libavutil/x86/float_dsp.asm index a8857b937c..317df9c3c1 100644 --- a/libavutil/x86/float_dsp.asm +++ b/libavutil/x86/float_dsp.asm @@ -85,3 +85,32 @@ INIT_XMM sse VECTOR_FMAC_SCALAR INIT_YMM avx VECTOR_FMAC_SCALAR + +;------------------------------------------------------------------------------ +; void ff_vector_fmul_scalar(float *dst, const float *src, float mul, int len) +;------------------------------------------------------------------------------ + +%macro VECTOR_FMUL_SCALAR 0 +%if UNIX64 +cglobal vector_fmul_scalar, 3,3,2, dst, src, len +%else +cglobal vector_fmul_scalar, 4,4,3, dst, src, mul, len +%endif +%if ARCH_X86_32 + movss m0, mulm +%elif WIN64 + SWAP 0, 2 +%endif + shufps m0, m0, 0 + lea lenq, [lend*4-mmsize] +.loop: + mova m1, [srcq+lenq] + mulps m1, m0 + mova [dstq+lenq], m1 + sub lenq, mmsize + jge .loop + REP_RET +%endmacro + +INIT_XMM sse +VECTOR_FMUL_SCALAR diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c index d1b0b8c622..d14ec6a377 100644 --- a/libavutil/x86/float_dsp_init.c +++ b/libavutil/x86/float_dsp_init.c @@ -32,6 +32,9 @@ extern void ff_vector_fmac_scalar_sse(float *dst, const float *src, float mul, extern void ff_vector_fmac_scalar_avx(float *dst, const float *src, float mul, int len); +extern void ff_vector_fmul_scalar_sse(float *dst, const float *src, float mul, + int len); + void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp) { int mm_flags = av_get_cpu_flags(); @@ -39,6 +42,7 @@ void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp) if (EXTERNAL_SSE(mm_flags)) { fdsp->vector_fmul = ff_vector_fmul_sse; fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_sse; + fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_sse; } if (EXTERNAL_AVX(mm_flags)) { fdsp->vector_fmul = ff_vector_fmul_avx; From d89f2fa970ed398a77e88da027563548d27acd59 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 11 Nov 2012 13:37:40 +0100 Subject: [PATCH 2/3] configure: Add separate list for libraries and use where appropriate --- configure | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/configure b/configure index eb6986a83c..3d740bf706 100755 --- a/configure +++ b/configure @@ -113,6 +113,7 @@ Component options: --disable-avdevice disable libavdevice build --disable-avcodec disable libavcodec build --disable-avformat disable libavformat build + --disable-avutil disable libavutil build --disable-swscale disable libswscale build --disable-avfilter disable video filter support [no] --disable-avresample disable libavresample build [no] @@ -979,6 +980,16 @@ COMPONENT_LIST=" protocols " +LIBRARY_LIST=" + avcodec + avdevice + avfilter + avformat + avresample + avutil + swscale +" + PROGRAM_LIST=" avconv avplay @@ -988,12 +999,8 @@ PROGRAM_LIST=" CONFIG_LIST=" $COMPONENT_LIST + $LIBRARY_LIST $PROGRAM_LIST - avcodec - avdevice - avfilter - avformat - avresample avisynth bzlib dct @@ -1046,7 +1053,6 @@ CONFIG_LIST=" small sram static - swscale swscale_alpha thumb vaapi @@ -1280,7 +1286,6 @@ HAVE_LIST=" CONFIG_EXTRA=" aandcttables ac3dsp - avutil error_resilience gcrypt golomb @@ -1729,8 +1734,12 @@ scale_filter_deps="swscale" yadif_filter_deps="gpl" # libraries -avdevice_deps="avcodec avformat" -avformat_deps="avcodec" +avcodec_deps="avutil" +avdevice_deps="avutil avcodec avformat" +avfilter_deps="avutil" +avformat_deps="avutil avcodec" +avresample_deps="avutil" +swscale_deps="avutil" # programs avconv_deps="avcodec avfilter avformat avresample swscale @@ -1780,15 +1789,7 @@ target_os_default=$(tolower $(uname -s)) host_os=$target_os_default # configurable options -enable $PROGRAM_LIST - -enable avcodec -enable avdevice -enable avfilter -enable avformat -enable avresample -enable avutil -enable swscale +enable $LIBRARY_LIST $PROGRAM_LIST enable asm enable debug @@ -3844,7 +3845,7 @@ SAMPLES:=${samples:-\$(LIBAV_SAMPLES)} EOF get_version(){ - lcname=$1 + lcname=lib${1} name=$(toupper $lcname) file=$source_path/$lcname/version.h eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file") @@ -3853,13 +3854,7 @@ get_version(){ eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak } -get_version libavcodec -get_version libavdevice -get_version libavfilter -get_version libavformat -get_version libavresample -get_version libavutil -get_version libswscale +map 'get_version $v' $LIBRARY_LIST cat > $TMPH < Date: Sun, 25 Nov 2012 12:38:58 -0500 Subject: [PATCH 3/3] riff: only warn on a bad INFO chunk code size instead of failing fixes Bug 392 --- libavformat/riff.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavformat/riff.c b/libavformat/riff.c index 11e2a6438f..731309201a 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -726,9 +726,10 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size) chunk_code = avio_rl32(pb); chunk_size = avio_rl32(pb); + if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) { - av_log(s, AV_LOG_ERROR, "too big INFO subchunk\n"); - return AVERROR_INVALIDDATA; + av_log(s, AV_LOG_WARNING, "too big INFO subchunk\n"); + break; } chunk_size += (chunk_size & 1); @@ -743,8 +744,8 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size) if (avio_read(pb, value, chunk_size) != chunk_size) { av_free(value); - av_log(s, AV_LOG_ERROR, "premature end of file while reading INFO tag\n"); - return AVERROR_INVALIDDATA; + av_log(s, AV_LOG_WARNING, "premature end of file while reading INFO tag\n"); + break; } value[chunk_size] = 0;