Browse Source

mpegaudiodsp: Change type of array stride parameters to ptrdiff_t

This avoids SIMD-optimized functions having to sign-extend their
stride argument manually to be able to do pointer arithmetic.
tags/n3.3
Diego Biurrun 9 years ago
parent
commit
2caa93b813
5 changed files with 14 additions and 11 deletions
  1. +0
    -1
      libavcodec/aarch64/mpegaudiodsp_neon.S
  2. +10
    -6
      libavcodec/mpegaudiodsp.h
  3. +2
    -2
      libavcodec/mpegaudiodsp_template.c
  4. +1
    -1
      libavcodec/ppc/mpegaudiodsp_altivec.c
  5. +1
    -1
      libavcodec/x86/mpegaudiodsp.c

+ 0
- 1
libavcodec/aarch64/mpegaudiodsp_neon.S View File

@@ -34,7 +34,6 @@ endconst
.macro apply_window type, st
function ff_mpadsp_apply_window_\type\()_neon, export=1
mov x7, x0
sxtw x4, w4 // incr
add x8, x0, #512<<2
ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x7], #64
ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x7], #64


+ 10
- 6
libavcodec/mpegaudiodsp.h View File

@@ -19,14 +19,18 @@
#ifndef AVCODEC_MPEGAUDIODSP_H
#define AVCODEC_MPEGAUDIODSP_H

#include <stddef.h>
#include <stdint.h>

#include "libavutil/common.h"

typedef struct MPADSPContext {
void (*apply_window_float)(float *synth_buf, float *window,
int *dither_state, float *samples, int incr);
int *dither_state, float *samples,
ptrdiff_t incr);
void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
int *dither_state, int16_t *samples, int incr);
int *dither_state, int16_t *samples,
ptrdiff_t incr);
void (*dct32_float)(float *dst, const float *src);
void (*dct32_fixed)(int *dst, const int *src);
void (*imdct36_blocks_float)(float *out, float *buf, float *in,
@@ -45,13 +49,13 @@ extern const int32_t ff_mpa_enwindow[257];
void ff_mpa_synth_filter_fixed(MPADSPContext *s,
int32_t *synth_buf_ptr, int *synth_buf_offset,
int32_t *window, int *dither_state,
int16_t *samples, int incr,
int16_t *samples, ptrdiff_t incr,
int32_t *sb_samples);

void ff_mpa_synth_filter_float(MPADSPContext *s,
float *synth_buf_ptr, int *synth_buf_offset,
float *window, int *dither_state,
float *samples, int incr,
float *samples, ptrdiff_t incr,
float *sb_samples);

void ff_mpadsp_init_aarch64(MPADSPContext *s);
@@ -64,10 +68,10 @@ void ff_mpa_synth_init_fixed(int32_t *window);

void ff_mpadsp_apply_window_float(float *synth_buf, float *window,
int *dither_state, float *samples,
int incr);
ptrdiff_t incr);
void ff_mpadsp_apply_window_fixed(int32_t *synth_buf, int32_t *window,
int *dither_state, int16_t *samples,
int incr);
ptrdiff_t incr);

void ff_imdct36_blocks_float(float *out, float *buf, float *in,
int count, int switch_point, int block_type);


+ 2
- 2
libavcodec/mpegaudiodsp_template.c View File

@@ -120,7 +120,7 @@ DECLARE_ALIGNED(16, MPA_INT, RENAME(ff_mpa_synth_window))[512+256];

void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, MPA_INT *window,
int *dither_state, OUT_INT *samples,
int incr)
ptrdiff_t incr)
{
register const MPA_INT *w, *w2, *p;
int j;
@@ -176,7 +176,7 @@ void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, MPA_INT *window,
void RENAME(ff_mpa_synth_filter)(MPADSPContext *s, MPA_INT *synth_buf_ptr,
int *synth_buf_offset,
MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr,
OUT_INT *samples, ptrdiff_t incr,
MPA_INT *sb_samples)
{
MPA_INT *synth_buf;


+ 1
- 1
libavcodec/ppc/mpegaudiodsp_altivec.c View File

@@ -90,7 +90,7 @@ static void apply_window(const float *buf, const float *win1,
}

static void apply_window_mp3(float *in, float *win, int *unused, float *out,
int incr)
ptrdiff_t incr)
{
LOCAL_ALIGNED_16(float, suma, [17]);
LOCAL_ALIGNED_16(float, sumb, [17]);


+ 1
- 1
libavcodec/x86/mpegaudiodsp.c View File

@@ -100,7 +100,7 @@ static void apply_window(const float *buf, const float *win1,
}

static void apply_window_mp3(float *in, float *win, int *unused, float *out,
int incr)
ptrdiff_t incr)
{
LOCAL_ALIGNED_16(float, suma, [17]);
LOCAL_ALIGNED_16(float, sumb, [17]);


Loading…
Cancel
Save