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
1fee770a
Commit
1fee770a
authored
May 01, 2016
by
foo86
Committed by
James Almer
May 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/dca: move channel counter utility into dca.h
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
2df7d4fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
dca.h
libavcodec/dca.h
+28
-0
dca_exss.c
libavcodec/dca_exss.c
+2
-7
No files found.
libavcodec/dca.h
View file @
1fee770a
...
...
@@ -28,6 +28,7 @@
#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
...
...
@@ -90,6 +91,33 @@ enum DCASpeakerMask {
#define DCA_HAS_STEREO(mask) \
((mask & DCA_SPEAKER_LAYOUT_STEREO) == DCA_SPEAKER_LAYOUT_STEREO)
enum
DCASpeakerPair
{
DCA_SPEAKER_PAIR_C
=
0x0001
,
DCA_SPEAKER_PAIR_LR
=
0x0002
,
DCA_SPEAKER_PAIR_LsRs
=
0x0004
,
DCA_SPEAKER_PAIR_LFE1
=
0x0008
,
DCA_SPEAKER_PAIR_Cs
=
0x0010
,
DCA_SPEAKER_PAIR_LhRh
=
0x0020
,
DCA_SPEAKER_PAIR_LsrRsr
=
0x0040
,
DCA_SPEAKER_PAIR_Ch
=
0x0080
,
DCA_SPEAKER_PAIR_Oh
=
0x0100
,
DCA_SPEAKER_PAIR_LcRc
=
0x0200
,
DCA_SPEAKER_PAIR_LwRw
=
0x0400
,
DCA_SPEAKER_PAIR_LssRss
=
0x0800
,
DCA_SPEAKER_PAIR_LFE2
=
0x1000
,
DCA_SPEAKER_PAIR_LhsRhs
=
0x2000
,
DCA_SPEAKER_PAIR_Chr
=
0x4000
,
DCA_SPEAKER_PAIR_LhrRhr
=
0x8000
};
/**
* Return number of individual channels in DCASpeakerPair mask
*/
static
inline
int
ff_dca_count_chs_for_mask
(
unsigned
int
mask
)
{
return
av_popcount
((
mask
&
0xffff
)
|
((
mask
&
0xae66
)
<<
16
));
}
enum
DCARepresentationType
{
DCA_REPR_TYPE_LtRt
=
2
,
DCA_REPR_TYPE_LhRh
=
3
...
...
libavcodec/dca_exss.c
View file @
1fee770a
...
...
@@ -21,11 +21,6 @@
#include "dcadec.h"
#include "dcadata.h"
static
int
count_chs_for_mask
(
int
mask
)
{
return
av_popcount
(
mask
)
+
av_popcount
(
mask
&
0xae66
);
}
static
void
parse_xll_parameters
(
DCAExssParser
*
s
,
DCAExssAsset
*
asset
)
{
// Size of XLL data in extension substream
...
...
@@ -141,7 +136,7 @@ static int parse_descriptor(DCAExssParser *s, DCAExssAsset *asset)
// Standard loudspeaker layout mask
for
(
i
=
0
;
i
<
spkr_remap_nsets
;
i
++
)
nspeakers
[
i
]
=
count_chs_for_mask
(
get_bits
(
&
s
->
gb
,
spkr_mask_nbits
));
nspeakers
[
i
]
=
ff_dca_
count_chs_for_mask
(
get_bits
(
&
s
->
gb
,
spkr_mask_nbits
));
for
(
i
=
0
;
i
<
spkr_remap_nsets
;
i
++
)
{
// Number of channels to be decoded for speaker remapping
...
...
@@ -470,7 +465,7 @@ int ff_dca_exss_parse(DCAExssParser *s, uint8_t *data, int size)
// Speaker layout mask for mixer output channels
for
(
i
=
0
;
i
<
s
->
nmixoutconfigs
;
i
++
)
s
->
nmixoutchs
[
i
]
=
count_chs_for_mask
(
get_bits
(
&
s
->
gb
,
spkr_mask_nbits
));
s
->
nmixoutchs
[
i
]
=
ff_dca_
count_chs_for_mask
(
get_bits
(
&
s
->
gb
,
spkr_mask_nbits
));
}
}
else
{
s
->
npresents
=
1
;
...
...
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