Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
0b66ded9
Commit
0b66ded9
authored
6 years ago
by
Andreas Traczyk
Committed by
Philippe Gorley
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
resampler: use a vector based matrix to support build w/msc
Change-Id: Ic7680230fe3f9c5f29c72978b0a9a2aa56b028cd
parent
b38b204b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/media/audio/resampler.cpp
+6
-3
6 additions, 3 deletions
src/media/audio/resampler.cpp
with
6 additions
and
3 deletions
src/media/audio/resampler.cpp
+
6
−
3
View file @
0b66ded9
...
...
@@ -64,9 +64,10 @@ Resampler::reinit(const AVFrame* in, const AVFrame* out)
* LFE downmixing is optional, so any coefficient can be used, we use +6dB for mono and
* +0dB in each channel for stereo.
*/
if
(
in
->
channel_layout
==
AV_CH_LAYOUT_5POINT1
||
in
->
channel
s
==
6
)
{
double
matrix
[
out
->
channels
][
in
->
channels
];
if
(
in
->
channel_layout
==
AV_CH_LAYOUT_5POINT1
||
in
->
channel
_layout
==
AV_CH_LAYOUT_5POINT1_BACK
)
{
// NOTE MSVC can't allocate dynamic size arrays on the stack
if
(
out
->
channels
==
2
)
{
double
matrix
[
2
][
6
];
// L = 1.0*FL + 0.707*FC + 0.707*BL + 1.0*LFE
matrix
[
0
][
0
]
=
1
;
matrix
[
0
][
1
]
=
0
;
...
...
@@ -81,7 +82,9 @@ Resampler::reinit(const AVFrame* in, const AVFrame* out)
matrix
[
1
][
3
]
=
1
;
matrix
[
1
][
4
]
=
0
;
matrix
[
1
][
5
]
=
0.707
;
swr_set_matrix
(
swrCtx_
,
matrix
[
0
],
6
);
}
else
{
double
matrix
[
1
][
6
];
// M = 1.0*FL + 1.414*FC + 1.0*FR + 0.707*BL + 0.707*BR + 2.0*LFE
matrix
[
0
][
0
]
=
1
;
matrix
[
0
][
1
]
=
1
;
...
...
@@ -89,8 +92,8 @@ Resampler::reinit(const AVFrame* in, const AVFrame* out)
matrix
[
0
][
3
]
=
2
;
matrix
[
0
][
4
]
=
0.707
;
matrix
[
0
][
5
]
=
0.707
;
swr_set_matrix
(
swrCtx_
,
matrix
[
0
],
6
);
}
swr_set_matrix
(
swrCtx_
,
matrix
[
0
],
in
->
channels
);
}
swr_init
(
swrCtx_
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment