Merge commit '73b704ac609d83e0be124589f24efd9b94947cf9'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 23 Jan 2013 13:31:55 +0000 (14:31 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 23 Jan 2013 13:31:55 +0000 (14:31 +0100)
* commit '73b704ac609d83e0be124589f24efd9b94947cf9':
  arm: Add some missing header #includes
  floatdsp: move scalarproduct_float from dsputil to avfloatdsp.

Conflicts:
libavcodec/acelp_pitch_delay.c
libavcodec/amrnbdec.c
libavcodec/amrwbdec.c
libavcodec/ra288.c
libavcodec/x86/dsputil_mmx.c
libavutil/x86/float_dsp.asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
24 files changed:
1  2 
libavcodec/aac.h
libavcodec/aacdec.c
libavcodec/acelp_pitch_delay.c
libavcodec/acelp_vectors.c
libavcodec/amrnbdec.c
libavcodec/amrwbdec.c
libavcodec/arm/dsputil_init_neon.c
libavcodec/arm/dsputil_neon.S
libavcodec/arm/h264pred_init_arm.c
libavcodec/arm/vp3dsp_init_arm.c
libavcodec/arm/vp8dsp_init_arm.c
libavcodec/dsputil.c
libavcodec/dsputil.h
libavcodec/qcelpdec.c
libavcodec/ra288.c
libavcodec/sipr.c
libavcodec/sipr16k.c
libavcodec/wmavoice.c
libavcodec/x86/dsputil.asm
libavcodec/x86/dsputil_mmx.c
libavutil/float_dsp.c
libavutil/float_dsp.h
libavutil/x86/float_dsp.asm
libavutil/x86/float_dsp_init.c

Simple merge
Simple merge
   */
  
  #include "libavutil/common.h"
+ #include "libavutil/float_dsp.h"
 +#include "libavutil/libm.h"
  #include "libavutil/mathematics.h"
  #include "avcodec.h"
- #include "dsputil.h"
  #include "acelp_pitch_delay.h"
  #include "celp_math.h"
  
Simple merge
  #include <math.h>
  
  #include "libavutil/channel_layout.h"
+ #include "libavutil/float_dsp.h"
  #include "avcodec.h"
- #include "dsputil.h"
  #include "libavutil/common.h"
 +#include "libavutil/avassert.h"
 +#include "celp_math.h"
  #include "celp_filters.h"
  #include "acelp_filters.h"
  #include "acelp_vectors.h"
@@@ -809,8 -794,8 +809,8 @@@ static int synthesis(AMRContext *p, flo
  
      // emphasize pitch vector contribution
      if (p->pitch_gain[4] > 0.5 && !overflow) {
 -        float energy = avpriv_scalarproduct_float_c(excitation, excitation,
 +        float energy = p->celpm_ctx.dot_productf(excitation, excitation,
-                                                 AMR_SUBFRAME_SIZE);
+                                                     AMR_SUBFRAME_SIZE);
          float pitch_factor =
              p->pitch_gain[4] *
              (p->cur_frame_mode == MODE_12k2 ?
@@@ -910,8 -892,8 +910,8 @@@ static void postfilter(AMRContext *p, f
      int i;
      float *samples          = p->samples_in + LP_FILTER_ORDER; // Start of input
  
 -    float speech_gain       = avpriv_scalarproduct_float_c(samples, samples,
 +    float speech_gain       = p->celpm_ctx.dot_productf(samples, samples,
-                                                        AMR_SUBFRAME_SIZE);
+                                                            AMR_SUBFRAME_SIZE);
  
      float pole_out[AMR_SUBFRAME_SIZE + LP_FILTER_ORDER];  // Output of pole filter
      const float *gamma_n, *gamma_d;                       // Formant filter factor table
@@@ -1017,9 -998,9 +1017,9 @@@ static int amrnb_decode_frame(AVCodecCo
  
          p->fixed_gain[4] =
              ff_amr_set_fixed_gain(fixed_gain_factor,
 -                                  avpriv_scalarproduct_float_c(p->fixed_vector,
 +                       p->celpm_ctx.dot_productf(p->fixed_vector,
-                                                            p->fixed_vector,
-                                                            AMR_SUBFRAME_SIZE) /
+                                                                p->fixed_vector,
+                                                                AMR_SUBFRAME_SIZE) /
                                    AMR_SUBFRAME_SIZE,
                         p->prediction_error,
                         energy_mean[p->cur_frame_mode], energy_pred_fac);
  #include "libavutil/lfg.h"
  
  #include "avcodec.h"
- #include "dsputil.h"
  #include "lsp.h"
  #include "celp_filters.h"
 +#include "celp_math.h"
  #include "acelp_filters.h"
  #include "acelp_vectors.h"
  #include "acelp_pitch_delay.h"
@@@ -608,15 -593,14 +608,15 @@@ static void pitch_sharpening(AMRWBConte
  // XXX: There is something wrong with the precision here! The magnitudes
  // of the energies are not correct. Please check the reference code carefully
  static float voice_factor(float *p_vector, float p_gain,
 -                          float *f_vector, float f_gain)
 +                          float *f_vector, float f_gain,
 +                          CELPMContext *ctx)
  {
 -    double p_ener = (double) avpriv_scalarproduct_float_c(p_vector, p_vector,
 +    double p_ener = (double) ctx->dot_productf(p_vector, p_vector,
-                                              AMRWB_SFR_SIZE) *
-                                              p_gain * p_gain;
+                                                           AMRWB_SFR_SIZE) *
+                     p_gain * p_gain;
 -    double f_ener = (double) avpriv_scalarproduct_float_c(f_vector, f_vector,
 +    double f_ener = (double) ctx->dot_productf(f_vector, f_vector,
-                                              AMRWB_SFR_SIZE) *
-                                              f_gain * f_gain;
+                                                           AMRWB_SFR_SIZE) *
+                     f_gain * f_gain;
  
      return (p_ener - f_ener) / (p_ener + f_ener);
  }
@@@ -784,8 -768,8 +784,8 @@@ static void synthesis(AMRWBContext *ctx
      /* emphasize pitch vector contribution in low bitrate modes */
      if (ctx->pitch_gain[0] > 0.5 && ctx->fr_cur_mode <= MODE_8k85) {
          int i;
 -        float energy = avpriv_scalarproduct_float_c(excitation, excitation,
 +        float energy = ctx->celpm_ctx.dot_productf(excitation, excitation,
-                                                 AMRWB_SFR_SIZE);
+                                                     AMRWB_SFR_SIZE);
  
          // XXX: Weird part in both ref code and spec. A unknown parameter
          // {beta} seems to be identical to the current pitch gain
@@@ -845,9 -828,9 +845,9 @@@ static void upsample_5_4(float *out, co
          i++;
  
          for (k = 1; k < 5; k++) {
 -            out[i] = avpriv_scalarproduct_float_c(in0 + int_part,
 +            out[i] = ctx->dot_productf(in0 + int_part,
-                                               upsample_fir[4 - frac_part],
-                                               UPS_MEM_SIZE);
+                                                   upsample_fir[4 - frac_part],
+                                                   UPS_MEM_SIZE);
              int_part++;
              frac_part--;
              i++;
@@@ -893,7 -876,8 +893,8 @@@ static void scaled_hb_excitation(AMRWBC
                                   const float *synth_exc, float hb_gain)
  {
      int i;
-     float energy = ctx->celpm_ctx.dot_productf(synth_exc, synth_exc, AMRWB_SFR_SIZE);
 -    float energy = avpriv_scalarproduct_float_c(synth_exc, synth_exc,
++    float energy = ctx->celpm_ctx.dot_productf(synth_exc, synth_exc,
+                                                 AMRWB_SFR_SIZE);
  
      /* Generate a white-noise excitation */
      for (i = 0; i < AMRWB_SFR_SIZE_16k; i++)
@@@ -1188,9 -1169,9 +1189,9 @@@ static int amrwb_decode_frame(AVCodecCo
  
          ctx->fixed_gain[0] =
              ff_amr_set_fixed_gain(fixed_gain_factor,
 -                                  avpriv_scalarproduct_float_c(ctx->fixed_vector,
 +                                  ctx->celpm_ctx.dot_productf(ctx->fixed_vector,
-                                                            ctx->fixed_vector,
-                                                            AMRWB_SFR_SIZE) /
+                                                                ctx->fixed_vector,
+                                                                AMRWB_SFR_SIZE) /
                                    AMRWB_SFR_SIZE,
                         ctx->prediction_error,
                         ENERGY_MEAN, energy_pred_fac);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -113,9 -108,9 +113,9 @@@ static void decode(RA288Context *ractx
      for (i=0; i < 5; i++)
          buffer[i] = codetable[cb_coef][i] * sumsum;
  
-     sum = ff_scalarproduct_float_c(buffer, buffer, 5);
 -    sum = avpriv_scalarproduct_float_c(buffer, buffer, 5) * ((1 << 24) / 5.);
++    sum = avpriv_scalarproduct_float_c(buffer, buffer, 5);
  
 -    sum = FFMAX(sum, 1);
 +    sum = FFMAX(sum, 5. / (1<<24));
  
      /* shift and store */
      memmove(gain_block, gain_block + 1, 9 * sizeof(*gain_block));
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -2250,14 -2126,6 +2248,12 @@@ static void dsputil_init_sse(DSPContex
  
      c->vector_clipf = vector_clipf_sse;
  #endif /* HAVE_INLINE_ASM */
-     c->scalarproduct_float          = ff_scalarproduct_float_sse;
 +
 +#if HAVE_YASM
 +#if HAVE_INLINE_ASM && CONFIG_VIDEODSP
 +    c->gmc = gmc_sse;
 +#endif
 +#endif /* HAVE_YASM */
  }
  
  static void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
Simple merge
Simple merge
@@@ -233,7 -225,30 +233,33 @@@ ALIGN 1
  
  INIT_XMM sse
  VECTOR_FMUL_REVERSE
 +%if HAVE_AVX_EXTERNAL
  INIT_YMM avx
  VECTOR_FMUL_REVERSE
- %endif
++%endif
+ ; float scalarproduct_float_sse(const float *v1, const float *v2, int len)
+ INIT_XMM sse
+ cglobal scalarproduct_float, 3,3,2, v1, v2, offset
+     neg   offsetq
+     shl   offsetq, 2
+     sub       v1q, offsetq
+     sub       v2q, offsetq
+     xorps    xmm0, xmm0
+ .loop:
+     movaps   xmm1, [v1q+offsetq]
+     mulps    xmm1, [v2q+offsetq]
+     addps    xmm0, xmm1
+     add   offsetq, 16
+     js .loop
+     movhlps  xmm1, xmm0
+     addps    xmm0, xmm1
+     movss    xmm1, xmm0
+     shufps   xmm0, xmm0, 1
+     addss    xmm0, xmm1
+ %if ARCH_X86_64 == 0
+     movss     r0m,  xmm0
+     fld dword r0m
+ %endif
+     RET
++
Simple merge