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
ffd21230
Commit
ffd21230
authored
Dec 23, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aac: decode directly to the user-provided AVFrame
parent
a3de4010
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
aac.h
libavcodec/aac.h
+1
-1
aacdec.c
libavcodec/aacdec.c
+7
-10
No files found.
libavcodec/aac.h
View file @
ffd21230
...
...
@@ -262,7 +262,7 @@ typedef struct ChannelElement {
*/
typedef
struct
AACContext
{
AVCodecContext
*
avctx
;
AVFrame
frame
;
AVFrame
*
frame
;
int
is_saved
;
///< Set if elements have stored overlap from previous frame.
DynamicRangeControl
che_drc
;
...
...
libavcodec/aacdec.c
View file @
ffd21230
...
...
@@ -180,8 +180,8 @@ static int frame_configure_elements(AVCodecContext *avctx)
}
/* get output buffer */
ac
->
frame
.
nb_samples
=
2048
;
if
((
ret
=
ff_get_buffer
(
avctx
,
&
ac
->
frame
))
<
0
)
{
ac
->
frame
->
nb_samples
=
2048
;
if
((
ret
=
ff_get_buffer
(
avctx
,
ac
->
frame
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
ret
;
}
...
...
@@ -189,7 +189,7 @@ static int frame_configure_elements(AVCodecContext *avctx)
/* map output channel pointers to AVFrame data */
for
(
ch
=
0
;
ch
<
avctx
->
channels
;
ch
++
)
{
if
(
ac
->
output_element
[
ch
])
ac
->
output_element
[
ch
]
->
ret
=
(
float
*
)
ac
->
frame
.
extended_data
[
ch
];
ac
->
output_element
[
ch
]
->
ret
=
(
float
*
)
ac
->
frame
->
extended_data
[
ch
];
}
return
0
;
...
...
@@ -918,9 +918,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
cbrt_tableinit
();
avcodec_get_frame_defaults
(
&
ac
->
frame
);
avctx
->
coded_frame
=
&
ac
->
frame
;
return
0
;
}
...
...
@@ -2389,6 +2386,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
int
err
,
elem_id
;
int
samples
=
0
,
multiplier
,
audio_found
=
0
,
pce_found
=
0
;
ac
->
frame
=
data
;
if
(
show_bits
(
gb
,
12
)
==
0xfff
)
{
if
(
parse_adts_frame_header
(
ac
,
gb
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error decoding AAC frame header.
\n
"
);
...
...
@@ -2503,10 +2502,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
multiplier
=
(
ac
->
oc
[
1
].
m4ac
.
sbr
==
1
)
?
ac
->
oc
[
1
].
m4ac
.
ext_sample_rate
>
ac
->
oc
[
1
].
m4ac
.
sample_rate
:
0
;
samples
<<=
multiplier
;
if
(
samples
)
{
ac
->
frame
.
nb_samples
=
samples
;
*
(
AVFrame
*
)
data
=
ac
->
frame
;
}
if
(
samples
)
ac
->
frame
->
nb_samples
=
samples
;
*
got_frame_ptr
=
!!
samples
;
if
(
ac
->
oc
[
1
].
status
&&
audio_found
)
{
...
...
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