From 8919fee7d259a4f8feb2aac6941ac21915be7b6e Mon Sep 17 00:00:00 2001 From: Tim Walker Date: Wed, 12 Sep 2012 17:09:31 +0200 Subject: [PATCH 1/8] lavu/audioconvert: add a second low frequency channel. Can be used by DTS-HD, TrueHD and E-AC-3, among others. Signed-off-by: Justin Ruggles --- doc/APIchanges | 3 +++ libavutil/audioconvert.c | 1 + libavutil/audioconvert.h | 1 + libavutil/version.h | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 7e1ffd0801..48fe09771d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2011-04-18 API changes, most recent first: +2012-09-12 - xxxxxxx - lavu 51.41.0 - audioconvert.h + Added AV_CH_LOW_FREQUENCY_2 channel mask value. + 2012-09-04 - xxxxxxx - lavu 51.40.0 - opt.h Reordered the fields in default_val in AVOption, changed which default_val field is used for which AVOptionType. diff --git a/libavutil/audioconvert.c b/libavutil/audioconvert.c index 09750ff435..113b9d782d 100644 --- a/libavutil/audioconvert.c +++ b/libavutil/audioconvert.c @@ -53,6 +53,7 @@ static const char * const channel_names[] = { [32] = "WR", /* wide right */ [33] = "SDL", /* surround direct left */ [34] = "SDR", /* surround direct right */ + [35] = "LFE2", /* low frequency 2 */ }; static const char *get_channel_name(int channel_id) diff --git a/libavutil/audioconvert.h b/libavutil/audioconvert.h index 7e79097855..73076cba79 100644 --- a/libavutil/audioconvert.h +++ b/libavutil/audioconvert.h @@ -62,6 +62,7 @@ #define AV_CH_WIDE_RIGHT 0x0000000100000000ULL #define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL #define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL +#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL /** Channel mask value used for AVCodecContext.request_channel_layout to indicate that the user requests the channel order of the decoder output diff --git a/libavutil/version.h b/libavutil/version.h index 293a65b08f..6342baefb2 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -37,7 +37,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 40 +#define LIBAVUTIL_VERSION_MINOR 41 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ From 3844572887e613d0292d7545c4f2a33e3e207882 Mon Sep 17 00:00:00 2001 From: Tim Walker Date: Wed, 12 Sep 2012 17:09:32 +0200 Subject: [PATCH 2/8] mlp_parser: avoid mapping multiple disctinct TrueHD channels to the same Libav channel. Signed-off-by: Justin Ruggles --- libavcodec/mlp_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c index 016252cfb6..4c1cf9bd65 100644 --- a/libavcodec/mlp_parser.c +++ b/libavcodec/mlp_parser.c @@ -83,10 +83,10 @@ static const uint64_t thd_layout[13] = { AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT, // LRrs AV_CH_BACK_CENTER, // Cs AV_CH_TOP_CENTER, // Ts - AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, // LRsd + AV_CH_SURROUND_DIRECT_LEFT|AV_CH_SURROUND_DIRECT_RIGHT, // LRsd AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT, // LRw AV_CH_TOP_FRONT_CENTER, // Cvh - AV_CH_LOW_FREQUENCY // LFE2 + AV_CH_LOW_FREQUENCY_2, // LFE2 }; static int mlp_samplerate(int in) From b901c30da606ade7427fbfb0f9651cc5bfb953a7 Mon Sep 17 00:00:00 2001 From: Tim Walker Date: Wed, 12 Sep 2012 17:09:33 +0200 Subject: [PATCH 3/8] lavr/audio_mix_matrix: acknowledge the existence of LFE2. Signed-off-by: Justin Ruggles --- libavresample/audio_mix_matrix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavresample/audio_mix_matrix.c b/libavresample/audio_mix_matrix.c index 3fbc4a4264..01a93367ef 100644 --- a/libavresample/audio_mix_matrix.c +++ b/libavresample/audio_mix_matrix.c @@ -54,6 +54,7 @@ #define WIDE_RIGHT 32 #define SURROUND_DIRECT_LEFT 33 #define SURROUND_DIRECT_RIGHT 34 +#define LOW_FREQUENCY_2 35 #define SQRT3_2 1.22474487139158904909 /* sqrt(3/2) */ From 97cb9236cf3c45eb8a8fba8b88bdde6ece3f496f Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 11 Sep 2012 17:55:11 +0100 Subject: [PATCH 4/8] ac3: move ac3_downmix() from dsputil to ac3dsp Signed-off-by: Mans Rullgard --- libavcodec/ac3dec.c | 40 ++---------- libavcodec/ac3dec.h | 3 - libavcodec/ac3dsp.c | 26 ++++++++ libavcodec/ac3dsp.h | 3 + libavcodec/dsputil.c | 4 -- libavcodec/dsputil.h | 1 - libavcodec/x86/ac3dsp_init.c | 119 +++++++++++++++++++++++++++++++++++ libavcodec/x86/dsputil_mmx.c | 111 -------------------------------- 8 files changed, 154 insertions(+), 153 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index daa0702460..37426c6158 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -620,34 +620,6 @@ static inline void do_imdct(AC3DecodeContext *s, int channels) } } -/** - * Downmix the output to mono or stereo. - */ -void ff_ac3_downmix_c(float (*samples)[256], float (*matrix)[2], - int out_ch, int in_ch, int len) -{ - int i, j; - float v0, v1; - if (out_ch == 2) { - for (i = 0; i < len; i++) { - v0 = v1 = 0.0f; - for (j = 0; j < in_ch; j++) { - v0 += samples[j][i] * matrix[j][0]; - v1 += samples[j][i] * matrix[j][1]; - } - samples[0][i] = v0; - samples[1][i] = v1; - } - } else if (out_ch == 1) { - for (i = 0; i < len; i++) { - v0 = 0.0f; - for (j = 0; j < in_ch; j++) - v0 += samples[j][i] * matrix[j][0]; - samples[0][i] = v0; - } - } -} - /** * Upmix delay samples from stereo to original channel layout. */ @@ -1266,19 +1238,19 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) do_imdct(s, s->channels); if (downmix_output) { - s->dsp.ac3_downmix(s->output, s->downmix_coeffs, - s->out_channels, s->fbw_channels, 256); + s->ac3dsp.downmix(s->output, s->downmix_coeffs, + s->out_channels, s->fbw_channels, 256); } } else { if (downmix_output) { - s->dsp.ac3_downmix(s->transform_coeffs + 1, s->downmix_coeffs, - s->out_channels, s->fbw_channels, 256); + s->ac3dsp.downmix(s->transform_coeffs + 1, s->downmix_coeffs, + s->out_channels, s->fbw_channels, 256); } if (downmix_output && !s->downmixed) { s->downmixed = 1; - s->dsp.ac3_downmix(s->delay, s->downmix_coeffs, s->out_channels, - s->fbw_channels, 128); + s->ac3dsp.downmix(s->delay, s->downmix_coeffs, s->out_channels, + s->fbw_channels, 128); } do_imdct(s, s->out_channels); diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h index 56c6553477..a2625a6023 100644 --- a/libavcodec/ac3dec.h +++ b/libavcodec/ac3dec.h @@ -221,9 +221,6 @@ int ff_eac3_parse_header(AC3DecodeContext *s); */ void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch); -void ff_ac3_downmix_c(float (*samples)[256], float (*matrix)[2], - int out_ch, int in_ch, int len); - /** * Apply spectral extension to each channel by copying lower frequency * coefficients to higher frequency bins and applying side information to diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c index b751aec902..41f79b9f0f 100644 --- a/libavcodec/ac3dsp.c +++ b/libavcodec/ac3dsp.c @@ -171,6 +171,31 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs) } } +static void ac3_downmix_c(float (*samples)[256], float (*matrix)[2], + int out_ch, int in_ch, int len) +{ + int i, j; + float v0, v1; + if (out_ch == 2) { + for (i = 0; i < len; i++) { + v0 = v1 = 0.0f; + for (j = 0; j < in_ch; j++) { + v0 += samples[j][i] * matrix[j][0]; + v1 += samples[j][i] * matrix[j][1]; + } + samples[0][i] = v0; + samples[1][i] = v1; + } + } else if (out_ch == 1) { + for (i = 0; i < len; i++) { + v0 = 0.0f; + for (j = 0; j < in_ch; j++) + v0 += samples[j][i] * matrix[j][0]; + samples[0][i] = v0; + } + } +} + av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact) { c->ac3_exponent_min = ac3_exponent_min_c; @@ -182,6 +207,7 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact) c->update_bap_counts = ac3_update_bap_counts_c; c->compute_mantissa_size = ac3_compute_mantissa_size_c; c->extract_exponents = ac3_extract_exponents_c; + c->downmix = ac3_downmix_c; if (ARCH_ARM) ff_ac3dsp_init_arm(c, bit_exact); diff --git a/libavcodec/ac3dsp.h b/libavcodec/ac3dsp.h index 8eeafd68ac..723d1096ae 100644 --- a/libavcodec/ac3dsp.h +++ b/libavcodec/ac3dsp.h @@ -125,6 +125,9 @@ typedef struct AC3DSPContext { int (*compute_mantissa_size)(uint16_t mant_cnt[6][16]); void (*extract_exponents)(uint8_t *exp, int32_t *coef, int nb_coefs); + + void (*downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, + int in_ch, int len); } AC3DSPContext; void ff_ac3dsp_init (AC3DSPContext *c, int bit_exact); diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index d38464b033..5c705ea169 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -36,7 +36,6 @@ #include "mathops.h" #include "mpegvideo.h" #include "config.h" -#include "ac3dec.h" #include "vorbis.h" uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP] = {0, }; @@ -2862,9 +2861,6 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) #if CONFIG_VORBIS_DECODER c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling; -#endif -#if CONFIG_AC3_DECODER - c->ac3_downmix = ff_ac3_downmix_c; #endif c->vector_fmul_reverse = vector_fmul_reverse_c; c->vector_fmul_add = vector_fmul_add_c; diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index bb70428e2a..6ce41df006 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -374,7 +374,6 @@ typedef struct DSPContext { /* assume len is a multiple of 4, and arrays are 16-byte aligned */ void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize); - void (*ac3_downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len); /* assume len is a multiple of 16, and arrays are 32-byte aligned */ void (*vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len); /* assume len is a multiple of 8, and src arrays are 16-byte aligned */ diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c index d1c45dd2ac..b23a9a1aeb 100644 --- a/libavcodec/x86/ac3dsp_init.c +++ b/libavcodec/x86/ac3dsp_init.c @@ -19,9 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/mem.h" #include "libavutil/x86/asm.h" #include "libavutil/x86/cpu.h" #include "dsputil_mmx.h" +#include "libavcodec/ac3.h" #include "libavcodec/ac3dsp.h" extern void ff_ac3_exponent_min_mmx (uint8_t *exp, int num_reuse_blocks, int nb_coefs); @@ -49,6 +51,119 @@ extern void ff_ac3_extract_exponents_3dnow(uint8_t *exp, int32_t *coef, int nb_c extern void ff_ac3_extract_exponents_sse2 (uint8_t *exp, int32_t *coef, int nb_coefs); extern void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs); +#if HAVE_SSE_INLINE + +#define IF1(x) x +#define IF0(x) + +#define MIX5(mono, stereo) \ + __asm__ volatile ( \ + "movss 0(%2), %%xmm5 \n" \ + "movss 8(%2), %%xmm6 \n" \ + "movss 24(%2), %%xmm7 \n" \ + "shufps $0, %%xmm5, %%xmm5 \n" \ + "shufps $0, %%xmm6, %%xmm6 \n" \ + "shufps $0, %%xmm7, %%xmm7 \n" \ + "1: \n" \ + "movaps (%0, %1), %%xmm0 \n" \ + "movaps 0x400(%0, %1), %%xmm1 \n" \ + "movaps 0x800(%0, %1), %%xmm2 \n" \ + "movaps 0xc00(%0, %1), %%xmm3 \n" \ + "movaps 0x1000(%0, %1), %%xmm4 \n" \ + "mulps %%xmm5, %%xmm0 \n" \ + "mulps %%xmm6, %%xmm1 \n" \ + "mulps %%xmm5, %%xmm2 \n" \ + "mulps %%xmm7, %%xmm3 \n" \ + "mulps %%xmm7, %%xmm4 \n" \ + stereo("addps %%xmm1, %%xmm0 \n") \ + "addps %%xmm1, %%xmm2 \n" \ + "addps %%xmm3, %%xmm0 \n" \ + "addps %%xmm4, %%xmm2 \n" \ + mono("addps %%xmm2, %%xmm0 \n") \ + "movaps %%xmm0, (%0, %1) \n" \ + stereo("movaps %%xmm2, 0x400(%0, %1) \n") \ + "add $16, %0 \n" \ + "jl 1b \n" \ + : "+&r"(i) \ + : "r"(samples[0] + len), "r"(matrix) \ + : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \ + "%xmm4", "%xmm5", "%xmm6", "%xmm7",) \ + "memory" \ + ); + +#define MIX_MISC(stereo) \ + __asm__ volatile ( \ + "1: \n" \ + "movaps (%3, %0), %%xmm0 \n" \ + stereo("movaps %%xmm0, %%xmm1 \n") \ + "mulps %%xmm4, %%xmm0 \n" \ + stereo("mulps %%xmm5, %%xmm1 \n") \ + "lea 1024(%3, %0), %1 \n" \ + "mov %5, %2 \n" \ + "2: \n" \ + "movaps (%1), %%xmm2 \n" \ + stereo("movaps %%xmm2, %%xmm3 \n") \ + "mulps (%4, %2), %%xmm2 \n" \ + stereo("mulps 16(%4, %2), %%xmm3 \n") \ + "addps %%xmm2, %%xmm0 \n" \ + stereo("addps %%xmm3, %%xmm1 \n") \ + "add $1024, %1 \n" \ + "add $32, %2 \n" \ + "jl 2b \n" \ + "movaps %%xmm0, (%3, %0) \n" \ + stereo("movaps %%xmm1, 1024(%3, %0) \n") \ + "add $16, %0 \n" \ + "jl 1b \n" \ + : "+&r"(i), "=&r"(j), "=&r"(k) \ + : "r"(samples[0] + len), "r"(matrix_simd + in_ch), \ + "g"((intptr_t) - 32 * (in_ch - 1)) \ + : "memory" \ + ); + +static void ac3_downmix_sse(float (*samples)[256], float (*matrix)[2], + int out_ch, int in_ch, int len) +{ + int (*matrix_cmp)[2] = (int(*)[2])matrix; + intptr_t i, j, k; + + i = -len * sizeof(float); + if (in_ch == 5 && out_ch == 2 && + !(matrix_cmp[0][1] | matrix_cmp[2][0] | + matrix_cmp[3][1] | matrix_cmp[4][0] | + (matrix_cmp[1][0] ^ matrix_cmp[1][1]) | + (matrix_cmp[0][0] ^ matrix_cmp[2][1]))) { + MIX5(IF0, IF1); + } else if (in_ch == 5 && out_ch == 1 && + matrix_cmp[0][0] == matrix_cmp[2][0] && + matrix_cmp[3][0] == matrix_cmp[4][0]) { + MIX5(IF1, IF0); + } else { + DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4]; + j = 2 * in_ch * sizeof(float); + __asm__ volatile ( + "1: \n" + "sub $8, %0 \n" + "movss (%2, %0), %%xmm4 \n" + "movss 4(%2, %0), %%xmm5 \n" + "shufps $0, %%xmm4, %%xmm4 \n" + "shufps $0, %%xmm5, %%xmm5 \n" + "movaps %%xmm4, (%1, %0, 4) \n" + "movaps %%xmm5, 16(%1, %0, 4) \n" + "jg 1b \n" + : "+&r"(j) + : "r"(matrix_simd), "r"(matrix) + : "memory" + ); + if (out_ch == 2) { + MIX_MISC(IF1); + } else { + MIX_MISC(IF0); + } + } +} + +#endif /* HAVE_SSE_INLINE */ + av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact) { int mm_flags = av_get_cpu_flags(); @@ -89,4 +204,8 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact) c->extract_exponents = ff_ac3_extract_exponents_ssse3; } } + + if (INLINE_SSE(mm_flags)) { + c->downmix = ac3_downmix_sse; + } } diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 136a5b1ee3..659b549281 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -28,7 +28,6 @@ #include "libavcodec/h264dsp.h" #include "libavcodec/mpegvideo.h" #include "libavcodec/simple_idct.h" -#include "libavcodec/ac3dec.h" #include "dsputil_mmx.h" #include "idct_xvid.h" @@ -2248,115 +2247,6 @@ static void vorbis_inverse_coupling_sse(float *mag, float *ang, int blocksize) } } -#define IF1(x) x -#define IF0(x) - -#define MIX5(mono, stereo) \ - __asm__ volatile ( \ - "movss 0(%2), %%xmm5 \n" \ - "movss 8(%2), %%xmm6 \n" \ - "movss 24(%2), %%xmm7 \n" \ - "shufps $0, %%xmm5, %%xmm5 \n" \ - "shufps $0, %%xmm6, %%xmm6 \n" \ - "shufps $0, %%xmm7, %%xmm7 \n" \ - "1: \n" \ - "movaps (%0, %1), %%xmm0 \n" \ - "movaps 0x400(%0, %1), %%xmm1 \n" \ - "movaps 0x800(%0, %1), %%xmm2 \n" \ - "movaps 0xc00(%0, %1), %%xmm3 \n" \ - "movaps 0x1000(%0, %1), %%xmm4 \n" \ - "mulps %%xmm5, %%xmm0 \n" \ - "mulps %%xmm6, %%xmm1 \n" \ - "mulps %%xmm5, %%xmm2 \n" \ - "mulps %%xmm7, %%xmm3 \n" \ - "mulps %%xmm7, %%xmm4 \n" \ - stereo("addps %%xmm1, %%xmm0 \n") \ - "addps %%xmm1, %%xmm2 \n" \ - "addps %%xmm3, %%xmm0 \n" \ - "addps %%xmm4, %%xmm2 \n" \ - mono("addps %%xmm2, %%xmm0 \n") \ - "movaps %%xmm0, (%0, %1) \n" \ - stereo("movaps %%xmm2, 0x400(%0, %1) \n") \ - "add $16, %0 \n" \ - "jl 1b \n" \ - : "+&r"(i) \ - : "r"(samples[0] + len), "r"(matrix) \ - : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \ - "%xmm4", "%xmm5", "%xmm6", "%xmm7",) \ - "memory" \ - ); - -#define MIX_MISC(stereo) \ - __asm__ volatile ( \ - "1: \n" \ - "movaps (%3, %0), %%xmm0 \n" \ - stereo("movaps %%xmm0, %%xmm1 \n") \ - "mulps %%xmm4, %%xmm0 \n" \ - stereo("mulps %%xmm5, %%xmm1 \n") \ - "lea 1024(%3, %0), %1 \n" \ - "mov %5, %2 \n" \ - "2: \n" \ - "movaps (%1), %%xmm2 \n" \ - stereo("movaps %%xmm2, %%xmm3 \n") \ - "mulps (%4, %2), %%xmm2 \n" \ - stereo("mulps 16(%4, %2), %%xmm3 \n") \ - "addps %%xmm2, %%xmm0 \n" \ - stereo("addps %%xmm3, %%xmm1 \n") \ - "add $1024, %1 \n" \ - "add $32, %2 \n" \ - "jl 2b \n" \ - "movaps %%xmm0, (%3, %0) \n" \ - stereo("movaps %%xmm1, 1024(%3, %0) \n") \ - "add $16, %0 \n" \ - "jl 1b \n" \ - : "+&r"(i), "=&r"(j), "=&r"(k) \ - : "r"(samples[0] + len), "r"(matrix_simd + in_ch), \ - "g"((intptr_t) - 32 * (in_ch - 1)) \ - : "memory" \ - ); - -static void ac3_downmix_sse(float (*samples)[256], float (*matrix)[2], - int out_ch, int in_ch, int len) -{ - int (*matrix_cmp)[2] = (int(*)[2])matrix; - intptr_t i, j, k; - - i = -len * sizeof(float); - if (in_ch == 5 && out_ch == 2 && - !(matrix_cmp[0][1] | matrix_cmp[2][0] | - matrix_cmp[3][1] | matrix_cmp[4][0] | - (matrix_cmp[1][0] ^ matrix_cmp[1][1]) | - (matrix_cmp[0][0] ^ matrix_cmp[2][1]))) { - MIX5(IF0, IF1); - } else if (in_ch == 5 && out_ch == 1 && - matrix_cmp[0][0] == matrix_cmp[2][0] && - matrix_cmp[3][0] == matrix_cmp[4][0]) { - MIX5(IF1, IF0); - } else { - DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4]; - j = 2 * in_ch * sizeof(float); - __asm__ volatile ( - "1: \n" - "sub $8, %0 \n" - "movss (%2, %0), %%xmm4 \n" - "movss 4(%2, %0), %%xmm5 \n" - "shufps $0, %%xmm4, %%xmm4 \n" - "shufps $0, %%xmm5, %%xmm5 \n" - "movaps %%xmm4, (%1, %0, 4) \n" - "movaps %%xmm5, 16(%1, %0, 4) \n" - "jg 1b \n" - : "+&r"(j) - : "r"(matrix_simd), "r"(matrix) - : "memory" - ); - if (out_ch == 2) { - MIX_MISC(IF1); - } else { - MIX_MISC(IF0); - } - } -} - #if HAVE_6REGS static void vector_fmul_window_3dnowext(float *dst, const float *src0, const float *src1, const float *win, @@ -2849,7 +2739,6 @@ static void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx, int mm_flags) } c->vorbis_inverse_coupling = vorbis_inverse_coupling_sse; - c->ac3_downmix = ac3_downmix_sse; #if HAVE_6REGS c->vector_fmul_window = vector_fmul_window_sse; From b9141aa346b736adffd27e1a98bd12aa7b628a8f Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 11 Sep 2012 22:11:25 +0200 Subject: [PATCH 5/8] swscale: Remove two bogus asserts --- libswscale/swscale.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 4f0a049b3d..edd3b728ee 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -628,8 +628,6 @@ static int swScale(SwsContext *c, const uint8_t *src[], } } } else { - assert(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize * 2); - assert(chrUSrcPtr + vChrFilterSize - 1 < chrUPixBuf + vChrBufSize * 2); if (c->yuv2packed1 && vLumFilterSize == 1 && vChrFilterSize <= 2) { // unscaled RGB int chrAlpha = vChrFilterSize == 1 ? 0 : vChrFilter[2 * dstY + 1]; From 91ff4e83ca7f8cb64540ef2eb2c7e48b7e2cc8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 13 Sep 2012 11:18:25 +0300 Subject: [PATCH 6/8] x86: ac3dsp: Only refer to the ac3_downmix_sse symbol if it has been declared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes building without inline assembly. Signed-off-by: Martin Storsjö --- libavcodec/x86/ac3dsp_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c index b23a9a1aeb..5008d65676 100644 --- a/libavcodec/x86/ac3dsp_init.c +++ b/libavcodec/x86/ac3dsp_init.c @@ -205,7 +205,9 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact) } } +#if HAVE_SSE_INLINE if (INLINE_SSE(mm_flags)) { c->downmix = ac3_downmix_sse; } +#endif } From 7b07fab5675a616749ba6b9d0dfd89f1b51bdb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 13 Sep 2012 12:34:17 +0300 Subject: [PATCH 7/8] os_support: Include io.h instead of direct.h on mingw32ce MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows CE doesn't have neither mkdir nor _mkdir officially (only CreateDirectoryW), but mingw32ce has compat wrappers with these names (declared in io.h since direct.h is unavailable). Signed-off-by: Martin Storsjö --- libavformat/os_support.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/os_support.h b/libavformat/os_support.h index 533b06beee..4ec37bdc77 100644 --- a/libavformat/os_support.h +++ b/libavformat/os_support.h @@ -39,7 +39,11 @@ #endif /* defined(__MINGW32__) && !defined(__MINGW32CE__) */ #ifdef _WIN32 +#ifdef __MINGW32CE__ +#include +#else #include +#endif #define mkdir(a, b) _mkdir(a) #else #include From ca6b544ac9d07dcd4d151d5729f0bf52f4f8653d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 13 Sep 2012 14:26:10 +0300 Subject: [PATCH 8/8] os_support: Choose between direct.h and io.h using a configure check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- configure | 2 ++ libavformat/os_support.h | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 5afdab9efd..2e28124348 100755 --- a/configure +++ b/configure @@ -1132,6 +1132,7 @@ HAVE_LIST=" dev_ic_bt8xx_h dev_video_bktr_ioctl_bt848_h dev_video_meteor_ioctl_meteor_h + direct_h dlfcn_h dlopen dos_paths @@ -3175,6 +3176,7 @@ check_func_headers windows.h MapViewOfFile check_func_headers windows.h Sleep check_func_headers windows.h VirtualAlloc +check_header direct.h check_header dlfcn.h check_header dxva.h check_header dxva2api.h diff --git a/libavformat/os_support.h b/libavformat/os_support.h index 4ec37bdc77..1bf79ebc6d 100644 --- a/libavformat/os_support.h +++ b/libavformat/os_support.h @@ -39,10 +39,10 @@ #endif /* defined(__MINGW32__) && !defined(__MINGW32CE__) */ #ifdef _WIN32 -#ifdef __MINGW32CE__ -#include -#else +#if HAVE_DIRECT_H #include +#elif HAVE_IO_H +#include #endif #define mkdir(a, b) _mkdir(a) #else