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
26d5a4b6
Commit
26d5a4b6
authored
Apr 25, 2011
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aacdec: Allow selecting float output at runtime.
parent
4c7ad768
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
28 deletions
+10
-28
aacdec.c
libavcodec/aacdec.c
+10
-28
No files found.
libavcodec/aacdec.c
View file @
26d5a4b6
...
...
@@ -557,12 +557,8 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
return
-
1
;
}
/* ffdshow custom code */
#if CONFIG_AUDIO_FLOAT
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLT
;
#else
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
#endif
avctx
->
sample_fmt
=
avctx
->
request_sample_fmt
==
AV_SAMPLE_FMT_FLT
?
AV_SAMPLE_FMT_FLT
:
AV_SAMPLE_FMT_S16
;
AAC_INIT_VLC_STATIC
(
0
,
304
);
AAC_INIT_VLC_STATIC
(
1
,
270
);
...
...
@@ -2179,12 +2175,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
avctx
->
frame_size
=
samples
;
}
/* ffdshow custom code */
#if CONFIG_AUDIO_FLOAT
data_size_tmp
=
samples
*
avctx
->
channels
*
sizeof
(
float
);
#else
data_size_tmp
=
samples
*
avctx
->
channels
*
sizeof
(
int16_t
);
#endif
data_size_tmp
=
samples
*
avctx
->
channels
;
data_size_tmp
*=
avctx
->
sample_fmt
==
AV_SAMPLE_FMT_FLT
?
sizeof
(
float
)
:
sizeof
(
int16_t
);
if
(
*
data_size
<
data_size_tmp
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Output buffer too small (%d) or trying to output too many samples (%d) for this frame.
\n
"
,
...
...
@@ -2194,12 +2186,10 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
*
data_size
=
data_size_tmp
;
if
(
samples
)
{
/* ffdshow custom code */
#if CONFIG_AUDIO_FLOAT
float_interleave
(
data
,
(
const
float
**
)
ac
->
output_data
,
samples
,
avctx
->
channels
);
#else
ac
->
fmt_conv
.
float_to_int16_interleave
(
data
,
(
const
float
**
)
ac
->
output_data
,
samples
,
avctx
->
channels
);
#endif
if
(
avctx
->
sample_fmt
==
AV_SAMPLE_FMT_FLT
)
{
float_interleave
(
data
,
(
const
float
**
)
ac
->
output_data
,
samples
,
avctx
->
channels
);
}
else
ac
->
fmt_conv
.
float_to_int16_interleave
(
data
,
(
const
float
**
)
ac
->
output_data
,
samples
,
avctx
->
channels
);
}
if
(
ac
->
output_configured
)
...
...
@@ -2518,11 +2508,7 @@ AVCodec ff_aac_decoder = {
aac_decode_frame
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Advanced Audio Coding"
),
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
#if CONFIG_AUDIO_FLOAT
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_NONE
#else
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_NONE
#endif
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_NONE
},
.
channel_layouts
=
aac_channel_layout
,
};
...
...
@@ -2542,11 +2528,7 @@ AVCodec ff_aac_latm_decoder = {
.
decode
=
latm_decode_frame
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"AAC LATM (Advanced Audio Codec LATM syntax)"
),
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
#if CONFIG_AUDIO_FLOAT
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_NONE
#else
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_NONE
#endif
AV_SAMPLE_FMT_S16
,
AV_SAMPLE_FMT_FLT
,
AV_SAMPLE_FMT_NONE
},
.
channel_layouts
=
aac_channel_layout
,
};
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