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
a2c92e60
Commit
a2c92e60
authored
Apr 11, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: pass context to swri_get_dither()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f8a237a3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
dither.c
libswresample/dither.c
+3
-3
swresample.c
libswresample/swresample.c
+1
-1
swresample_internal.h
libswresample/swresample_internal.h
+1
-1
No files found.
libswresample/dither.c
View file @
a2c92e60
...
...
@@ -21,7 +21,7 @@
#include "libavutil/avassert.h"
#include "swresample_internal.h"
void
swri_get_dither
(
void
*
dst
,
int
len
,
unsigned
seed
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
,
enum
SwrDitherType
method
)
{
void
swri_get_dither
(
SwrContext
*
s
,
void
*
dst
,
int
len
,
unsigned
seed
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
)
{
double
scale
=
0
;
#define TMP_EXTRA 2
double
*
tmp
=
av_malloc
((
len
+
TMP_EXTRA
)
*
sizeof
(
double
));
...
...
@@ -40,7 +40,7 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
double
v
;
seed
=
seed
*
1664525
+
1013904223
;
switch
(
method
){
switch
(
s
->
dither_
method
){
case
SWR_DITHER_RECTANGULAR
:
v
=
((
double
)
seed
)
/
UINT_MAX
-
0
.
5
;
break
;
case
SWR_DITHER_TRIANGULAR
:
case
SWR_DITHER_TRIANGULAR_HIGHPASS
:
...
...
@@ -56,7 +56,7 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
for
(
i
=
0
;
i
<
len
;
i
++
){
double
v
;
switch
(
method
){
switch
(
s
->
dither_
method
){
case
SWR_DITHER_RECTANGULAR
:
case
SWR_DITHER_TRIANGULAR
:
v
=
tmp
[
i
];
...
...
libswresample/swresample.c
View file @
a2c92e60
...
...
@@ -527,7 +527,7 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
return
ret
;
if
(
ret
)
for
(
ch
=
0
;
ch
<
s
->
dither
.
ch_count
;
ch
++
)
swri_get_dither
(
s
->
dither
.
ch
[
ch
],
s
->
dither
.
count
,
12345678913579
<<
ch
,
s
->
out_sample_fmt
,
s
->
int_sample_fmt
,
s
->
dither_method
);
swri_get_dither
(
s
,
s
->
dither
.
ch
[
ch
],
s
->
dither
.
count
,
12345678913579
<<
ch
,
s
->
out_sample_fmt
,
s
->
int_sample_fmt
);
av_assert0
(
s
->
dither
.
ch_count
==
preout
->
ch_count
);
if
(
s
->
dither_pos
+
out_count
>
s
->
dither
.
count
)
...
...
libswresample/swresample_internal.h
View file @
a2c92e60
...
...
@@ -94,6 +94,6 @@ int swri_rematrix_init(SwrContext *s);
int
swri_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
);
void
swri_sum2
(
enum
AVSampleFormat
format
,
void
*
dst
,
const
void
*
src0
,
const
void
*
src1
,
float
coef0
,
float
coef1
,
int
len
);
void
swri_get_dither
(
void
*
dst
,
int
len
,
unsigned
seed
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
,
enum
SwrDitherType
type
);
void
swri_get_dither
(
SwrContext
*
s
,
void
*
dst
,
int
len
,
unsigned
seed
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
);
#endif
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