Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
ffmpeg
Commits
b61d2782
Commit
b61d2782
authored
Apr 26, 2008
by
Baptiste Coudurier
Browse files
use mpeg4audio common code
Originally committed as revision 12988 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
86c90cc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
libavcodec/mpegaudiodec.c
libavcodec/mpegaudiodec.c
+9
-5
No files found.
libavcodec/mpegaudiodec.c
View file @
b61d2782
...
...
@@ -2475,9 +2475,11 @@ static int decode_frame_adu(AVCodecContext * avctx,
#endif
/* CONFIG_MP3ADU_DECODER */
#ifdef CONFIG_MP3ON4_DECODER
#include "mpeg4audio.h"
/* Next 3 arrays are indexed by channel config number (passed via codecdata) */
static
const
uint8_t
mp3Frames
[
16
]
=
{
0
,
1
,
1
,
2
,
3
,
3
,
4
,
5
,
2
};
/* number of mp3 decoder instances */
static
const
uint8_t
mp3Channels
[
16
]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
8
,
4
};
/* total output channels */
/* offsets into output buffer, assume output order is FL FR BL BR C LFE */
static
const
uint8_t
chan_offset
[
9
][
5
]
=
{
{
0
},
...
...
@@ -2495,6 +2497,7 @@ static const uint8_t chan_offset[9][5] = {
static
int
decode_init_mp3on4
(
AVCodecContext
*
avctx
)
{
MP3On4DecodeContext
*
s
=
avctx
->
priv_data
;
MPEG4AudioConfig
cfg
;
int
i
;
if
((
avctx
->
extradata_size
<
2
)
||
(
avctx
->
extradata
==
NULL
))
{
...
...
@@ -2502,13 +2505,14 @@ static int decode_init_mp3on4(AVCodecContext * avctx)
return
-
1
;
}
s
->
chan_cfg
=
(((
unsigned
char
*
)
avctx
->
extradata
)[
1
]
>>
3
)
&
0x0f
;
s
->
frames
=
mp3Frames
[
s
->
chan_cfg
];
if
(
!
s
->
frames
)
{
ff_mpeg4audio_get_config
(
&
cfg
,
avctx
->
extradata
,
avctx
->
extradata_size
);
if
(
!
cfg
.
chan_config
||
cfg
.
chan_config
>
7
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid channel config number.
\n
"
);
return
-
1
;
}
avctx
->
channels
=
mp3Channels
[
s
->
chan_cfg
];
s
->
chan_cfg
=
cfg
.
chan_config
;
s
->
frames
=
mp3Frames
[
s
->
chan_cfg
];
avctx
->
channels
=
ff_mpeg4audio_channels
[
s
->
chan_cfg
];
/* Init the first mp3 decoder in standard way, so that all tables get builded
* We replace avctx->priv_data with the context of the first decoder so that
...
...
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