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
3b924294
Commit
3b924294
authored
Jan 13, 2011
by
Justin Ruggles
Committed by
Mans Rullgard
Jan 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ac3enc: use dsputil functions in apply_window()
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
6eabb0d3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
ac3enc.c
libavcodec/ac3enc.c
+2
-2
ac3enc_fixed.c
libavcodec/ac3enc_fixed.c
+1
-1
ac3enc_float.c
libavcodec/ac3enc_float.c
+6
-10
No files found.
libavcodec/ac3enc.c
View file @
3b924294
...
@@ -161,7 +161,7 @@ static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
...
@@ -161,7 +161,7 @@ static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
static
void
mdct512
(
AC3MDCTContext
*
mdct
,
CoefType
*
out
,
SampleType
*
in
);
static
void
mdct512
(
AC3MDCTContext
*
mdct
,
CoefType
*
out
,
SampleType
*
in
);
static
void
apply_window
(
SampleType
*
output
,
const
SampleType
*
input
,
static
void
apply_window
(
DSPContext
*
dsp
,
SampleType
*
output
,
const
SampleType
*
input
,
const
SampleType
*
window
,
int
n
);
const
SampleType
*
window
,
int
n
);
static
int
normalize_samples
(
AC3EncodeContext
*
s
);
static
int
normalize_samples
(
AC3EncodeContext
*
s
);
...
@@ -262,7 +262,7 @@ static void apply_mdct(AC3EncodeContext *s)
...
@@ -262,7 +262,7 @@ static void apply_mdct(AC3EncodeContext *s)
AC3Block
*
block
=
&
s
->
blocks
[
blk
];
AC3Block
*
block
=
&
s
->
blocks
[
blk
];
const
SampleType
*
input_samples
=
&
s
->
planar_samples
[
ch
][
blk
*
AC3_BLOCK_SIZE
];
const
SampleType
*
input_samples
=
&
s
->
planar_samples
[
ch
][
blk
*
AC3_BLOCK_SIZE
];
apply_window
(
s
->
windowed_samples
,
input_samples
,
s
->
mdct
.
window
,
AC3_WINDOW_SIZE
);
apply_window
(
&
s
->
dsp
,
s
->
windowed_samples
,
input_samples
,
s
->
mdct
.
window
,
AC3_WINDOW_SIZE
);
block
->
exp_shift
[
ch
]
=
normalize_samples
(
s
);
block
->
exp_shift
[
ch
]
=
normalize_samples
(
s
);
...
...
libavcodec/ac3enc_fixed.c
View file @
3b924294
...
@@ -251,7 +251,7 @@ static void mdct512(AC3MDCTContext *mdct, int32_t *out, int16_t *in)
...
@@ -251,7 +251,7 @@ static void mdct512(AC3MDCTContext *mdct, int32_t *out, int16_t *in)
/**
/**
* Apply KBD window to input samples prior to MDCT.
* Apply KBD window to input samples prior to MDCT.
*/
*/
static
void
apply_window
(
int16_t
*
output
,
const
int16_t
*
input
,
static
void
apply_window
(
DSPContext
*
dsp
,
int16_t
*
output
,
const
int16_t
*
input
,
const
int16_t
*
window
,
int
n
)
const
int16_t
*
window
,
int
n
)
{
{
int
i
;
int
i
;
...
...
libavcodec/ac3enc_float.c
View file @
3b924294
...
@@ -48,17 +48,19 @@ static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
...
@@ -48,17 +48,19 @@ static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
int
nbits
)
int
nbits
)
{
{
float
*
window
;
float
*
window
;
int
n
,
n2
;
int
i
,
n
,
n2
;
n
=
1
<<
nbits
;
n
=
1
<<
nbits
;
n2
=
n
>>
1
;
n2
=
n
>>
1
;
window
=
av_malloc
(
n
2
*
sizeof
(
*
window
));
window
=
av_malloc
(
n
*
sizeof
(
*
window
));
if
(
!
window
)
{
if
(
!
window
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Cannot allocate memory.
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Cannot allocate memory.
\n
"
);
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
ff_kbd_window_init
(
window
,
5
.
0
,
n2
);
ff_kbd_window_init
(
window
,
5
.
0
,
n2
);
for
(
i
=
0
;
i
<
n2
;
i
++
)
window
[
n
-
1
-
i
]
=
window
[
i
];
mdct
->
window
=
window
;
mdct
->
window
=
window
;
return
ff_mdct_init
(
&
mdct
->
fft
,
nbits
,
0
,
-
2
.
0
/
n
);
return
ff_mdct_init
(
&
mdct
->
fft
,
nbits
,
0
,
-
2
.
0
/
n
);
...
@@ -79,16 +81,10 @@ static void mdct512(AC3MDCTContext *mdct, float *out, float *in)
...
@@ -79,16 +81,10 @@ static void mdct512(AC3MDCTContext *mdct, float *out, float *in)
/**
/**
* Apply KBD window to input samples prior to MDCT.
* Apply KBD window to input samples prior to MDCT.
*/
*/
static
void
apply_window
(
float
*
output
,
const
float
*
input
,
static
void
apply_window
(
DSPContext
*
dsp
,
float
*
output
,
const
float
*
input
,
const
float
*
window
,
int
n
)
const
float
*
window
,
int
n
)
{
{
int
i
;
dsp
->
vector_fmul
(
output
,
input
,
window
,
n
);
int
n2
=
n
>>
1
;
for
(
i
=
0
;
i
<
n2
;
i
++
)
{
output
[
i
]
=
input
[
i
]
*
window
[
i
];
output
[
n
-
i
-
1
]
=
input
[
n
-
i
-
1
]
*
window
[
i
];
}
}
}
...
...
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