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
644f021c
Commit
644f021c
authored
Dec 30, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aacdec: simplify dmono
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6d386619
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
aac.h
libavcodec/aac.h
+1
-2
aacdec.c
libavcodec/aacdec.c
+5
-6
No files found.
libavcodec/aac.h
View file @
644f021c
...
...
@@ -309,8 +309,7 @@ typedef struct AACContext {
* @name Japanese DTV specific extension
* @{
*/
int
enable_jp_dmono
;
///< enable japanese DTV specific 'dual mono'
int
dmono_mode
;
///< select the channel to decode in dual mono.
int
dmono_mode
;
///< 0->not dmono, 1->use first channel, 2->use second channel
/** @} */
DECLARE_ALIGNED
(
32
,
float
,
temp
)[
128
];
...
...
libavcodec/aacdec.c
View file @
644f021c
...
...
@@ -2435,7 +2435,7 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
* WITHOUT specifying PCE.
* thus, set dual mono as default.
*/
if
(
ac
->
enable_jp_dmono
&&
ac
->
oc
[
0
].
status
==
OC_NONE
)
{
if
(
ac
->
dmono_mode
&&
ac
->
oc
[
0
].
status
==
OC_NONE
)
{
layout_map_tags
=
2
;
layout_map
[
0
][
0
]
=
layout_map
[
1
][
0
]
=
TYPE_SCE
;
layout_map
[
0
][
2
]
=
layout_map
[
1
][
2
]
=
AAC_CHANNEL_FRONT
;
...
...
@@ -2588,7 +2588,7 @@ 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
;
/* for dual-mono audio (SCE + SCE) */
is_dmono
=
ac
->
enable_jp_dmono
&&
sce_count
==
2
&&
is_dmono
=
ac
->
dmono_mode
&&
sce_count
==
2
&&
ac
->
oc
[
1
].
channel_layout
==
(
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
);
if
(
samples
)
{
...
...
@@ -2598,9 +2598,9 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
*
got_frame_ptr
=
!!
samples
;
if
(
is_dmono
)
{
if
(
ac
->
dmono_mode
==
0
)
if
(
ac
->
dmono_mode
==
1
)
((
AVFrame
*
)
data
)
->
data
[
1
]
=
((
AVFrame
*
)
data
)
->
data
[
0
];
else
if
(
ac
->
dmono_mode
==
1
)
else
if
(
ac
->
dmono_mode
==
2
)
((
AVFrame
*
)
data
)
->
data
[
0
]
=
((
AVFrame
*
)
data
)
->
data
[
1
];
}
...
...
@@ -2658,10 +2658,9 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
}
}
ac
->
enable_jp_dmono
=
!!
jp_dualmono
;
ac
->
dmono_mode
=
0
;
if
(
jp_dualmono
&&
jp_dualmono_size
>
0
)
ac
->
dmono_mode
=
*
jp_dualmono
;
ac
->
dmono_mode
=
1
+
*
jp_dualmono
;
init_get_bits
(
&
gb
,
buf
,
buf_size
*
8
);
...
...
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