Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ffmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Samuel Mira
ffmpeg
Commits
0b60fc94
Commit
0b60fc94
authored
12 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
swr: reorder the operations in the noise shaping code
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ead3a2a3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libswresample/dither.c
+1
-0
1 addition, 0 deletions
libswresample/dither.c
libswresample/dither_template.c
+3
-2
3 additions, 2 deletions
libswresample/dither_template.c
with
4 additions
and
2 deletions
libswresample/dither.c
+
1
−
0
View file @
0b60fc94
...
...
@@ -118,6 +118,7 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo
if
(
s
->
dither
.
method
>
SWR_DITHER_NS
)
{
s
->
dither
.
noise
.
bps
=
4
;
s
->
dither
.
noise
.
fmt
=
AV_SAMPLE_FMT_FLTP
;
s
->
dither
.
noise_scale
=
1
;
}
return
0
;
...
...
This diff is collapsed.
Click to expand it.
libswresample/dither_template.c
+
3
−
2
View file @
0b60fc94
...
...
@@ -34,12 +34,13 @@ void RENAME(swri_noise_shaping)(SwrContext *s, AudioData *srcs, AudioData *noise
DELEM
*
data
=
(
DELEM
*
)
srcs
->
ch
[
ch
];
pos
=
s
->
dither
.
ns_pos
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
double
d1
,
d
=
data
[
i
];
double
d1
,
d
=
data
[
i
]
*
S_1
;
for
(
j
=
0
;
j
<
taps
;
j
++
)
d
-=
s
->
dither
.
ns_coeffs
[
j
]
*
s
->
dither
.
ns_errors
[
ch
][
pos
+
j
];
pos
=
pos
?
pos
-
1
:
pos
-
1
+
taps
;
d1
=
rint
(
(
d
+
noise
[
i
])
*
S_1
)
*
S
;
d1
=
rint
(
d
+
noise
[
i
]);
s
->
dither
.
ns_errors
[
ch
][
pos
+
taps
]
=
s
->
dither
.
ns_errors
[
ch
][
pos
]
=
d1
-
d
;
d1
*=
S
;
CLIP
(
d1
);
data
[
i
]
=
d1
;
}
...
...
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