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
2790d7a9
Commit
2790d7a9
authored
Feb 18, 2011
by
Young Han Lee
Committed by
Ronald S. Bultje
Mar 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aacenc: remove the data arrays
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
c9256246
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
aacenc.c
libavcodec/aacenc.c
+15
-13
aacenc.h
libavcodec/aacenc.h
+2
-3
No files found.
libavcodec/aacenc.c
View file @
2790d7a9
...
...
@@ -225,40 +225,41 @@ static void apply_window_and_mdct(AVCodecContext *avctx, AACEncContext *s,
const
float
*
lwindow
=
sce
->
ics
.
use_kb_window
[
0
]
?
ff_aac_kbd_long_1024
:
ff_sine_1024
;
const
float
*
swindow
=
sce
->
ics
.
use_kb_window
[
0
]
?
ff_aac_kbd_short_128
:
ff_sine_128
;
const
float
*
pwindow
=
sce
->
ics
.
use_kb_window
[
1
]
?
ff_aac_kbd_short_128
:
ff_sine_128
;
float
*
output
=
sce
->
ret
;
if
(
sce
->
ics
.
window_sequence
[
0
]
!=
EIGHT_SHORT_SEQUENCE
)
{
memcpy
(
s
->
output
,
sce
->
saved
,
sizeof
(
float
)
*
1024
);
memcpy
(
output
,
sce
->
saved
,
sizeof
(
float
)
*
1024
);
if
(
sce
->
ics
.
window_sequence
[
0
]
==
LONG_STOP_SEQUENCE
)
{
memset
(
s
->
output
,
0
,
sizeof
(
s
->
output
[
0
])
*
448
);
memset
(
output
,
0
,
sizeof
(
output
[
0
])
*
448
);
for
(
i
=
448
;
i
<
576
;
i
++
)
s
->
output
[
i
]
=
sce
->
saved
[
i
]
*
pwindow
[
i
-
448
];
output
[
i
]
=
sce
->
saved
[
i
]
*
pwindow
[
i
-
448
];
for
(
i
=
576
;
i
<
704
;
i
++
)
s
->
output
[
i
]
=
sce
->
saved
[
i
];
output
[
i
]
=
sce
->
saved
[
i
];
}
if
(
sce
->
ics
.
window_sequence
[
0
]
!=
LONG_START_SEQUENCE
)
{
for
(
i
=
0
;
i
<
1024
;
i
++
)
{
s
->
output
[
i
+
1024
]
=
audio
[
i
*
chans
]
*
lwindow
[
1024
-
i
-
1
];
output
[
i
+
1024
]
=
audio
[
i
*
chans
]
*
lwindow
[
1024
-
i
-
1
];
sce
->
saved
[
i
]
=
audio
[
i
*
chans
]
*
lwindow
[
i
];
}
}
else
{
for
(
i
=
0
;
i
<
448
;
i
++
)
s
->
output
[
i
+
1024
]
=
audio
[
i
*
chans
];
output
[
i
+
1024
]
=
audio
[
i
*
chans
];
for
(;
i
<
576
;
i
++
)
s
->
output
[
i
+
1024
]
=
audio
[
i
*
chans
]
*
swindow
[
576
-
i
-
1
];
memset
(
s
->
output
+
1024
+
576
,
0
,
sizeof
(
s
->
output
[
0
])
*
448
);
output
[
i
+
1024
]
=
audio
[
i
*
chans
]
*
swindow
[
576
-
i
-
1
];
memset
(
output
+
1024
+
576
,
0
,
sizeof
(
output
[
0
])
*
448
);
for
(
i
=
0
;
i
<
1024
;
i
++
)
sce
->
saved
[
i
]
=
audio
[
i
*
chans
];
}
ff_mdct_calc
(
&
s
->
mdct1024
,
sce
->
coeffs
,
s
->
output
);
ff_mdct_calc
(
&
s
->
mdct1024
,
sce
->
coeffs
,
output
);
}
else
{
for
(
k
=
0
;
k
<
1024
;
k
+=
128
)
{
for
(
i
=
448
+
k
;
i
<
448
+
k
+
256
;
i
++
)
s
->
output
[
i
-
448
-
k
]
=
(
i
<
1024
)
output
[
i
-
448
-
k
]
=
(
i
<
1024
)
?
sce
->
saved
[
i
]
:
audio
[(
i
-
1024
)
*
chans
];
s
->
dsp
.
vector_fmul
(
s
->
output
,
s
->
output
,
k
?
swindow
:
pwindow
,
128
);
s
->
dsp
.
vector_fmul_reverse
(
s
->
output
+
128
,
s
->
output
+
128
,
swindow
,
128
);
ff_mdct_calc
(
&
s
->
mdct128
,
sce
->
coeffs
+
k
,
s
->
output
);
s
->
dsp
.
vector_fmul
(
output
,
output
,
k
?
swindow
:
pwindow
,
128
);
s
->
dsp
.
vector_fmul_reverse
(
output
+
128
,
output
+
128
,
swindow
,
128
);
ff_mdct_calc
(
&
s
->
mdct128
,
sce
->
coeffs
+
k
,
output
);
}
for
(
i
=
0
;
i
<
1024
;
i
++
)
sce
->
saved
[
i
]
=
audio
[
i
*
chans
];
...
...
@@ -597,6 +598,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
}
for
(
j
=
0
;
j
<
chans
;
j
++
)
{
s
->
cur_channel
=
start_ch
+
j
;
s
->
scoefs
=
cpe
->
ch
[
j
].
ret
;
encode_individual_channel
(
avctx
,
s
,
&
cpe
->
ch
[
j
],
cpe
->
common_window
);
}
start_ch
+=
chans
;
...
...
libavcodec/aacenc.h
View file @
2790d7a9
...
...
@@ -52,8 +52,7 @@ typedef struct AACEncContext {
FFTContext
mdct1024
;
///< long (1024 samples) frame transform context
FFTContext
mdct128
;
///< short (128 samples) frame transform context
DSPContext
dsp
;
DECLARE_ALIGNED
(
16
,
FFTSample
,
output
)[
2048
];
///< temporary buffer for MDCT input coefficients
int16_t
*
samples
;
///< saved preprocessed input
int16_t
*
samples
;
///< saved preprocessed input
int
samplerate_index
;
///< MPEG-4 samplerate index
...
...
@@ -64,8 +63,8 @@ typedef struct AACEncContext {
int
cur_channel
;
int
last_frame
;
float
lambda
;
float
*
scoefs
;
///< scaled coefficients
DECLARE_ALIGNED
(
16
,
int
,
qcoefs
)[
96
];
///< quantized coefficients
DECLARE_ALIGNED
(
16
,
float
,
scoefs
)[
1024
];
///< scaled coefficients
}
AACEncContext
;
#endif
/* AVCODEC_AACENC_H */
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