mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
float_dsp: Use LOCAL_ALIGNED for instead of DECLARE_ALIGNED within functions
This fixes fate-float_dsp-test on RVCT 4.0. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
606cc8afa1
commit
ae23809184
@ -143,7 +143,9 @@ av_cold void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int bit_exact)
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
#include "internal.h"
|
||||||
#include "lfg.h"
|
#include "lfg.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
@ -206,8 +208,8 @@ static int compare_doubles(const double *a, const double *b, int len,
|
|||||||
static int test_vector_fmul(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
static int test_vector_fmul(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
||||||
const float *v1, const float *v2)
|
const float *v1, const float *v2)
|
||||||
{
|
{
|
||||||
DECLARE_ALIGNED(32, float, cdst)[LEN];
|
LOCAL_ALIGNED(32, float, cdst, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, odst)[LEN];
|
LOCAL_ALIGNED(32, float, odst, [LEN]);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cdsp->vector_fmul(cdst, v1, v2, LEN);
|
cdsp->vector_fmul(cdst, v1, v2, LEN);
|
||||||
@ -223,8 +225,8 @@ static int test_vector_fmul(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
|||||||
static int test_vector_fmac_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
static int test_vector_fmac_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
||||||
const float *v1, const float *src0, float scale)
|
const float *v1, const float *src0, float scale)
|
||||||
{
|
{
|
||||||
DECLARE_ALIGNED(32, float, cdst)[LEN];
|
LOCAL_ALIGNED(32, float, cdst, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, odst)[LEN];
|
LOCAL_ALIGNED(32, float, odst, [LEN]);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
memcpy(cdst, v1, LEN * sizeof(*v1));
|
memcpy(cdst, v1, LEN * sizeof(*v1));
|
||||||
@ -242,8 +244,8 @@ static int test_vector_fmac_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *c
|
|||||||
static int test_vector_fmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
static int test_vector_fmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
||||||
const float *v1, float scale)
|
const float *v1, float scale)
|
||||||
{
|
{
|
||||||
DECLARE_ALIGNED(32, float, cdst)[LEN];
|
LOCAL_ALIGNED(32, float, cdst, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, odst)[LEN];
|
LOCAL_ALIGNED(32, float, odst, [LEN]);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cdsp->vector_fmul_scalar(cdst, v1, scale, LEN);
|
cdsp->vector_fmul_scalar(cdst, v1, scale, LEN);
|
||||||
@ -258,8 +260,8 @@ static int test_vector_fmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *c
|
|||||||
static int test_vector_dmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
static int test_vector_dmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
||||||
const double *v1, double scale)
|
const double *v1, double scale)
|
||||||
{
|
{
|
||||||
DECLARE_ALIGNED(32, double, cdst)[LEN];
|
LOCAL_ALIGNED(32, double, cdst, [LEN]);
|
||||||
DECLARE_ALIGNED(32, double, odst)[LEN];
|
LOCAL_ALIGNED(32, double, odst, [LEN]);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cdsp->vector_dmul_scalar(cdst, v1, scale, LEN);
|
cdsp->vector_dmul_scalar(cdst, v1, scale, LEN);
|
||||||
@ -275,8 +277,8 @@ static int test_vector_dmul_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *c
|
|||||||
static int test_vector_fmul_window(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
static int test_vector_fmul_window(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
||||||
const float *v1, const float *v2, const float *v3)
|
const float *v1, const float *v2, const float *v3)
|
||||||
{
|
{
|
||||||
DECLARE_ALIGNED(32, float, cdst)[LEN];
|
LOCAL_ALIGNED(32, float, cdst, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, odst)[LEN];
|
LOCAL_ALIGNED(32, float, odst, [LEN]);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cdsp->vector_fmul_window(cdst, v1, v2, v3, LEN / 2);
|
cdsp->vector_fmul_window(cdst, v1, v2, v3, LEN / 2);
|
||||||
@ -292,8 +294,8 @@ static int test_vector_fmul_window(AVFloatDSPContext *fdsp, AVFloatDSPContext *c
|
|||||||
static int test_vector_fmul_add(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
static int test_vector_fmul_add(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
||||||
const float *v1, const float *v2, const float *v3)
|
const float *v1, const float *v2, const float *v3)
|
||||||
{
|
{
|
||||||
DECLARE_ALIGNED(32, float, cdst)[LEN];
|
LOCAL_ALIGNED(32, float, cdst, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, odst)[LEN];
|
LOCAL_ALIGNED(32, float, odst, [LEN]);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cdsp->vector_fmul_add(cdst, v1, v2, v3, LEN);
|
cdsp->vector_fmul_add(cdst, v1, v2, v3, LEN);
|
||||||
@ -308,8 +310,8 @@ static int test_vector_fmul_add(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp
|
|||||||
static int test_vector_fmul_reverse(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
static int test_vector_fmul_reverse(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
||||||
const float *v1, const float *v2)
|
const float *v1, const float *v2)
|
||||||
{
|
{
|
||||||
DECLARE_ALIGNED(32, float, cdst)[LEN];
|
LOCAL_ALIGNED(32, float, cdst, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, odst)[LEN];
|
LOCAL_ALIGNED(32, float, odst, [LEN]);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cdsp->vector_fmul_reverse(cdst, v1, v2, LEN);
|
cdsp->vector_fmul_reverse(cdst, v1, v2, LEN);
|
||||||
@ -324,10 +326,10 @@ static int test_vector_fmul_reverse(AVFloatDSPContext *fdsp, AVFloatDSPContext *
|
|||||||
static int test_butterflies_float(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
static int test_butterflies_float(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
|
||||||
const float *v1, const float *v2)
|
const float *v1, const float *v2)
|
||||||
{
|
{
|
||||||
DECLARE_ALIGNED(32, float, cv1)[LEN];
|
LOCAL_ALIGNED(32, float, cv1, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, cv2)[LEN];
|
LOCAL_ALIGNED(32, float, cv2, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, ov1)[LEN];
|
LOCAL_ALIGNED(32, float, ov1, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, ov2)[LEN];
|
LOCAL_ALIGNED(32, float, ov2, [LEN]);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
memcpy(cv1, v1, LEN * sizeof(*v1));
|
memcpy(cv1, v1, LEN * sizeof(*v1));
|
||||||
@ -368,11 +370,11 @@ int main(int argc, char **argv)
|
|||||||
AVFloatDSPContext fdsp, cdsp;
|
AVFloatDSPContext fdsp, cdsp;
|
||||||
AVLFG lfg;
|
AVLFG lfg;
|
||||||
|
|
||||||
DECLARE_ALIGNED(32, float, src0)[LEN];
|
LOCAL_ALIGNED(32, float, src0, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, src1)[LEN];
|
LOCAL_ALIGNED(32, float, src1, [LEN]);
|
||||||
DECLARE_ALIGNED(32, float, src2)[LEN];
|
LOCAL_ALIGNED(32, float, src2, [LEN]);
|
||||||
DECLARE_ALIGNED(32, double, dbl_src0)[LEN];
|
LOCAL_ALIGNED(32, double, dbl_src0, [LEN]);
|
||||||
DECLARE_ALIGNED(32, double, dbl_src1)[LEN];
|
LOCAL_ALIGNED(32, double, dbl_src1, [LEN]);
|
||||||
|
|
||||||
if (argc > 2 && !strcmp(argv[1], "-s"))
|
if (argc > 2 && !strcmp(argv[1], "-s"))
|
||||||
seed = strtoul(argv[2], NULL, 10);
|
seed = strtoul(argv[2], NULL, 10);
|
||||||
|
Loading…
Reference in New Issue
Block a user