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
b1ef4dc4
Commit
b1ef4dc4
authored
Apr 10, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: add triangular dither support
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
0cff3e13
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
dither.c
libswresample/dither.c
+5
-0
swresample.c
libswresample/swresample.c
+1
-0
swresample.h
libswresample/swresample.h
+1
-0
No files found.
libswresample/dither.c
View file @
b1ef4dc4
...
...
@@ -40,6 +40,11 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
switch
(
method
){
case
SWR_DITHER_RECTANGULAR
:
v
=
((
double
)
seed
)
/
UINT_MAX
-
0
.
5
;
break
;
case
SWR_DITHER_TRIANGULAR
:
v
=
((
double
)
seed
)
/
UINT_MAX
;
seed
=
seed
*
1664525
+
1013904223
;
v
-=
((
double
)
seed
)
/
UINT_MAX
;
break
;
default:
av_assert0
(
0
);
}
...
...
libswresample/swresample.c
View file @
b1ef4dc4
...
...
@@ -55,6 +55,7 @@ static const AVOption options[]={
{
"res"
,
"force resampling"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
SWR_FLAG_RESAMPLE
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"dither"
,
"dither method"
,
OFFSET
(
dither_method
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
SWR_DITHER_NB
-
1
,
0
,
"dither_method"
},
{
"rectangular"
,
"rectangular dither"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
SWR_DITHER_RECTANGULAR
},
INT_MIN
,
INT_MAX
,
0
,
"dither_method"
},
{
"triangular"
,
"triangular dither"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
SWR_DITHER_TRIANGULAR
},
INT_MIN
,
INT_MAX
,
0
,
"dither_method"
},
{
0
}
};
...
...
libswresample/swresample.h
View file @
b1ef4dc4
...
...
@@ -48,6 +48,7 @@
enum
SwrDitherType
{
SWR_DITHER_NONE
=
0
,
SWR_DITHER_RECTANGULAR
,
SWR_DITHER_TRIANGULAR
,
SWR_DITHER_NB
,
///< not part of API/ABI
};
...
...
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