Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2336c76d
Commit
2336c76d
authored
Nov 29, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ra288: Use avpriv_float_dsp_alloc()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b0464212
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
ra288.c
libavcodec/ra288.c
+16
-4
No files found.
libavcodec/ra288.c
View file @
2336c76d
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
#define RA288_BLOCKS_PER_FRAME 32
#define RA288_BLOCKS_PER_FRAME 32
typedef
struct
{
typedef
struct
{
AVFloatDSPContext
fdsp
;
AVFloatDSPContext
*
fdsp
;
DECLARE_ALIGNED
(
32
,
float
,
sp_lpc
)[
FFALIGN
(
36
,
16
)];
///< LPC coefficients for speech data (spec: A)
DECLARE_ALIGNED
(
32
,
float
,
sp_lpc
)[
FFALIGN
(
36
,
16
)];
///< LPC coefficients for speech data (spec: A)
DECLARE_ALIGNED
(
32
,
float
,
gain_lpc
)[
FFALIGN
(
10
,
16
)];
///< LPC coefficients for gain (spec: GB)
DECLARE_ALIGNED
(
32
,
float
,
gain_lpc
)[
FFALIGN
(
10
,
16
)];
///< LPC coefficients for gain (spec: GB)
...
@@ -59,6 +59,15 @@ typedef struct {
...
@@ -59,6 +59,15 @@ typedef struct {
float
gain_rec
[
11
];
float
gain_rec
[
11
];
}
RA288Context
;
}
RA288Context
;
static
av_cold
int
ra288_decode_close
(
AVCodecContext
*
avctx
)
{
RA288Context
*
ractx
=
avctx
->
priv_data
;
av_freep
(
&
ractx
->
fdsp
);
return
0
;
}
static
av_cold
int
ra288_decode_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
ra288_decode_init
(
AVCodecContext
*
avctx
)
{
{
RA288Context
*
ractx
=
avctx
->
priv_data
;
RA288Context
*
ractx
=
avctx
->
priv_data
;
...
@@ -72,7 +81,9 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
...
@@ -72,7 +81,9 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
avpriv_float_dsp_init
(
&
ractx
->
fdsp
,
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
ractx
->
fdsp
=
avpriv_float_dsp_alloc
(
avctx
->
flags
&
CODEC_FLAG_BITEXACT
);
if
(
!
ractx
->
fdsp
)
return
AVERROR
(
ENOMEM
);
return
0
;
return
0
;
}
}
...
@@ -146,7 +157,7 @@ static void do_hybrid_window(RA288Context *ractx,
...
@@ -146,7 +157,7 @@ static void do_hybrid_window(RA288Context *ractx,
av_assert2
(
order
>=
0
);
av_assert2
(
order
>=
0
);
ractx
->
fdsp
.
vector_fmul
(
work
,
window
,
hist
,
FFALIGN
(
order
+
n
+
non_rec
,
16
));
ractx
->
fdsp
->
vector_fmul
(
work
,
window
,
hist
,
FFALIGN
(
order
+
n
+
non_rec
,
16
));
convolve
(
buffer1
,
work
+
order
,
n
,
order
);
convolve
(
buffer1
,
work
+
order
,
n
,
order
);
convolve
(
buffer2
,
work
+
order
+
n
,
non_rec
,
order
);
convolve
(
buffer2
,
work
+
order
+
n
,
non_rec
,
order
);
...
@@ -173,7 +184,7 @@ static void backward_filter(RA288Context *ractx,
...
@@ -173,7 +184,7 @@ static void backward_filter(RA288Context *ractx,
do_hybrid_window
(
ractx
,
order
,
n
,
non_rec
,
temp
,
hist
,
rec
,
window
);
do_hybrid_window
(
ractx
,
order
,
n
,
non_rec
,
temp
,
hist
,
rec
,
window
);
if
(
!
compute_lpc_coefs
(
temp
,
order
,
lpc
,
0
,
1
,
1
))
if
(
!
compute_lpc_coefs
(
temp
,
order
,
lpc
,
0
,
1
,
1
))
ractx
->
fdsp
.
vector_fmul
(
lpc
,
lpc
,
tab
,
FFALIGN
(
order
,
16
));
ractx
->
fdsp
->
vector_fmul
(
lpc
,
lpc
,
tab
,
FFALIGN
(
order
,
16
));
memmove
(
hist
,
hist
+
n
,
move_size
*
sizeof
(
*
hist
));
memmove
(
hist
,
hist
+
n
,
move_size
*
sizeof
(
*
hist
));
}
}
...
@@ -235,5 +246,6 @@ AVCodec ff_ra_288_decoder = {
...
@@ -235,5 +246,6 @@ AVCodec ff_ra_288_decoder = {
.
priv_data_size
=
sizeof
(
RA288Context
),
.
priv_data_size
=
sizeof
(
RA288Context
),
.
init
=
ra288_decode_init
,
.
init
=
ra288_decode_init
,
.
decode
=
ra288_decode_frame
,
.
decode
=
ra288_decode_frame
,
.
close
=
ra288_decode_close
,
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
CODEC_CAP_DR1
,
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment