Commit 2caa93b8 authored by Diego Biurrun's avatar Diego Biurrun

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.
parent 15b4f494
...@@ -34,7 +34,6 @@ endconst ...@@ -34,7 +34,6 @@ endconst
.macro apply_window type, st .macro apply_window type, st
function ff_mpadsp_apply_window_\type\()_neon, export=1 function ff_mpadsp_apply_window_\type\()_neon, export=1
mov x7, x0 mov x7, x0
sxtw x4, w4 // incr
add x8, x0, #512<<2 add x8, x0, #512<<2
ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x7], #64 ld1 {v0.4s,v1.4s,v2.4s,v3.4s}, [x7], #64
ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x7], #64 ld1 {v4.4s,v5.4s,v6.4s,v7.4s}, [x7], #64
......
...@@ -19,14 +19,18 @@ ...@@ -19,14 +19,18 @@
#ifndef AVCODEC_MPEGAUDIODSP_H #ifndef AVCODEC_MPEGAUDIODSP_H
#define AVCODEC_MPEGAUDIODSP_H #define AVCODEC_MPEGAUDIODSP_H
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "libavutil/common.h" #include "libavutil/common.h"
typedef struct MPADSPContext { typedef struct MPADSPContext {
void (*apply_window_float)(float *synth_buf, float *window, 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, 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_float)(float *dst, const float *src);
void (*dct32_fixed)(int *dst, const int *src); void (*dct32_fixed)(int *dst, const int *src);
void (*imdct36_blocks_float)(float *out, float *buf, float *in, void (*imdct36_blocks_float)(float *out, float *buf, float *in,
...@@ -45,13 +49,13 @@ extern const int32_t ff_mpa_enwindow[257]; ...@@ -45,13 +49,13 @@ extern const int32_t ff_mpa_enwindow[257];
void ff_mpa_synth_filter_fixed(MPADSPContext *s, void ff_mpa_synth_filter_fixed(MPADSPContext *s,
int32_t *synth_buf_ptr, int *synth_buf_offset, int32_t *synth_buf_ptr, int *synth_buf_offset,
int32_t *window, int *dither_state, int32_t *window, int *dither_state,
int16_t *samples, int incr, int16_t *samples, ptrdiff_t incr,
int32_t *sb_samples); int32_t *sb_samples);
void ff_mpa_synth_filter_float(MPADSPContext *s, void ff_mpa_synth_filter_float(MPADSPContext *s,
float *synth_buf_ptr, int *synth_buf_offset, float *synth_buf_ptr, int *synth_buf_offset,
float *window, int *dither_state, float *window, int *dither_state,
float *samples, int incr, float *samples, ptrdiff_t incr,
float *sb_samples); float *sb_samples);
void ff_mpadsp_init_aarch64(MPADSPContext *s); void ff_mpadsp_init_aarch64(MPADSPContext *s);
...@@ -64,10 +68,10 @@ void ff_mpa_synth_init_fixed(int32_t *window); ...@@ -64,10 +68,10 @@ void ff_mpa_synth_init_fixed(int32_t *window);
void ff_mpadsp_apply_window_float(float *synth_buf, float *window, void ff_mpadsp_apply_window_float(float *synth_buf, float *window,
int *dither_state, float *samples, int *dither_state, float *samples,
int incr); ptrdiff_t incr);
void ff_mpadsp_apply_window_fixed(int32_t *synth_buf, int32_t *window, void ff_mpadsp_apply_window_fixed(int32_t *synth_buf, int32_t *window,
int *dither_state, int16_t *samples, int *dither_state, int16_t *samples,
int incr); ptrdiff_t incr);
void ff_imdct36_blocks_float(float *out, float *buf, float *in, void ff_imdct36_blocks_float(float *out, float *buf, float *in,
int count, int switch_point, int block_type); int count, int switch_point, int block_type);
......
...@@ -120,7 +120,7 @@ DECLARE_ALIGNED(16, MPA_INT, RENAME(ff_mpa_synth_window))[512+256]; ...@@ -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, void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, MPA_INT *window,
int *dither_state, OUT_INT *samples, int *dither_state, OUT_INT *samples,
int incr) ptrdiff_t incr)
{ {
register const MPA_INT *w, *w2, *p; register const MPA_INT *w, *w2, *p;
int j; int j;
...@@ -176,7 +176,7 @@ void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, MPA_INT *window, ...@@ -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, void RENAME(ff_mpa_synth_filter)(MPADSPContext *s, MPA_INT *synth_buf_ptr,
int *synth_buf_offset, int *synth_buf_offset,
MPA_INT *window, int *dither_state, MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr, OUT_INT *samples, ptrdiff_t incr,
MPA_INT *sb_samples) MPA_INT *sb_samples)
{ {
MPA_INT *synth_buf; MPA_INT *synth_buf;
......
...@@ -90,7 +90,7 @@ static void apply_window(const float *buf, const float *win1, ...@@ -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, 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, suma, [17]);
LOCAL_ALIGNED_16(float, sumb, [17]); LOCAL_ALIGNED_16(float, sumb, [17]);
......
...@@ -100,7 +100,7 @@ static void apply_window(const float *buf, const float *win1, ...@@ -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, 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, suma, [17]);
LOCAL_ALIGNED_16(float, sumb, [17]); LOCAL_ALIGNED_16(float, sumb, [17]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment