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
b2c0b80f
Commit
b2c0b80f
authored
Sep 06, 2014
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/ebur128: rework channel weighting definition code
Should fix CID1194399 (Bad bit shift operation)
parent
1654ca7d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
f_ebur128.c
libavfilter/f_ebur128.c
+3
-11
No files found.
libavfilter/f_ebur128.c
View file @
b2c0b80f
...
@@ -363,7 +363,6 @@ static int config_audio_input(AVFilterLink *inlink)
...
@@ -363,7 +363,6 @@ static int config_audio_input(AVFilterLink *inlink)
static
int
config_audio_output
(
AVFilterLink
*
outlink
)
static
int
config_audio_output
(
AVFilterLink
*
outlink
)
{
{
int
i
;
int
i
;
int
idx_bitposn
=
0
;
AVFilterContext
*
ctx
=
outlink
->
src
;
AVFilterContext
*
ctx
=
outlink
->
src
;
EBUR128Context
*
ebur128
=
ctx
->
priv
;
EBUR128Context
*
ebur128
=
ctx
->
priv
;
const
int
nb_channels
=
av_get_channel_layout_nb_channels
(
outlink
->
channel_layout
);
const
int
nb_channels
=
av_get_channel_layout_nb_channels
(
outlink
->
channel_layout
);
...
@@ -379,23 +378,16 @@ static int config_audio_output(AVFilterLink *outlink)
...
@@ -379,23 +378,16 @@ static int config_audio_output(AVFilterLink *outlink)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
for
(
i
=
0
;
i
<
nb_channels
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_channels
;
i
++
)
{
/* find the next bit that is set starting from the right */
while
((
outlink
->
channel_layout
&
1ULL
<<
idx_bitposn
)
==
0
&&
idx_bitposn
<
63
)
idx_bitposn
++
;
/* channel weighting */
/* channel weighting */
if
((
1ULL
<<
idx_bitposn
&
AV_CH_LOW_FREQUENCY
)
||
const
uint16_t
chl
=
av_channel_layout_extract_channel
(
outlink
->
channel_layout
,
i
);
(
1ULL
<<
idx_bitposn
&
AV_CH_LOW_FREQUENCY_2
))
{
if
(
chl
&
(
AV_CH_LOW_FREQUENCY
|
AV_CH_LOW_FREQUENCY_2
))
{
ebur128
->
ch_weighting
[
i
]
=
0
;
ebur128
->
ch_weighting
[
i
]
=
0
;
}
else
if
(
1ULL
<<
idx_bitposn
&
BACK_MASK
)
{
}
else
if
(
chl
&
BACK_MASK
)
{
ebur128
->
ch_weighting
[
i
]
=
1
.
41
;
ebur128
->
ch_weighting
[
i
]
=
1
.
41
;
}
else
{
}
else
{
ebur128
->
ch_weighting
[
i
]
=
1
.
0
;
ebur128
->
ch_weighting
[
i
]
=
1
.
0
;
}
}
idx_bitposn
++
;
if
(
!
ebur128
->
ch_weighting
[
i
])
if
(
!
ebur128
->
ch_weighting
[
i
])
continue
;
continue
;
...
...
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