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
b54bf2d6
Commit
b54bf2d6
authored
Aug 18, 2008
by
Kostya Shishkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add okayed parts for AAC encoder
Originally committed as revision 14821 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
ca048266
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
aacenc.c
libavcodec/aacenc.c
+14
-4
No files found.
libavcodec/aacenc.c
View file @
b54bf2d6
...
...
@@ -162,6 +162,12 @@ typedef struct {
MDCTContext
mdct1024
;
///< long (1024 samples) frame transform context
MDCTContext
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
int
samplerate_index
;
///< MPEG-4 samplerate index
ChannelElement
*
cpe
;
///< channel elements
AACPsyContext
psy
;
///< psychoacoustic model context
int
last_frame
;
}
AACEncContext
;
...
...
@@ -221,7 +227,9 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
s
->
samples
=
av_malloc
(
2
*
1024
*
avctx
->
channels
*
sizeof
(
s
->
samples
[
0
]));
s
->
cpe
=
av_mallocz
(
sizeof
(
ChannelElement
)
*
aac_chan_configs
[
avctx
->
channels
-
1
][
0
]);
if
(
ff_aac_psy_init
(
&
s
->
psy
,
avctx
,
AAC_PSY_3GPP
,
aac_chan_configs
[
avctx
->
channels
-
1
][
0
],
0
,
s
->
swb_sizes1024
,
s
->
swb_num1024
,
s
->
swb_sizes128
,
s
->
swb_num128
)
<
0
){
if
(
ff_aac_psy_init
(
&
s
->
psy
,
avctx
,
AAC_PSY_3GPP
,
aac_chan_configs
[
avctx
->
channels
-
1
][
0
],
0
,
s
->
swb_sizes1024
,
s
->
swb_num1024
,
s
->
swb_sizes128
,
s
->
swb_num128
)
<
0
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"Cannot initialize selected model.
\n
"
);
return
-
1
;
}
...
...
@@ -256,7 +264,7 @@ static void put_ics_info(AVCodecContext *avctx, IndividualChannelStream *info)
/**
* Encode pulse data.
*/
static
void
encode_pulses
(
A
VCodecContext
*
avctx
,
A
ACEncContext
*
s
,
Pulse
*
pulse
,
int
channel
)
static
void
encode_pulses
(
AACEncContext
*
s
,
Pulse
*
pulse
,
int
channel
)
{
int
i
;
...
...
@@ -274,7 +282,7 @@ static void encode_pulses(AVCodecContext *avctx, AACEncContext *s, Pulse *pulse,
/**
* Encode spectral coefficients processed by psychoacoustic model.
*/
static
void
encode_spectral_coeffs
(
A
VCodecContext
*
avctx
,
A
ACEncContext
*
s
,
ChannelElement
*
cpe
,
int
channel
)
static
void
encode_spectral_coeffs
(
AACEncContext
*
s
,
ChannelElement
*
cpe
,
int
channel
)
{
int
start
,
i
,
w
,
w2
,
wg
;
...
...
@@ -287,7 +295,9 @@ static void encode_spectral_coeffs(AVCodecContext *avctx, AACEncContext *s, Chan
continue
;
}
for
(
w2
=
w
;
w2
<
w
+
cpe
->
ch
[
channel
].
ics
.
group_len
[
wg
];
w2
++
){
encode_band_coeffs
(
s
,
cpe
,
channel
,
start
+
w2
*
128
,
cpe
->
ch
[
channel
].
ics
.
swb_sizes
[
i
],
cpe
->
ch
[
channel
].
band_type
[
w
*
16
+
i
]);
encode_band_coeffs
(
s
,
cpe
,
channel
,
start
+
w2
*
128
,
cpe
->
ch
[
channel
].
ics
.
swb_sizes
[
i
],
cpe
->
ch
[
channel
].
band_type
[
w
*
16
+
i
]);
}
start
+=
cpe
->
ch
[
channel
].
ics
.
swb_sizes
[
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