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
1550f45a
Commit
1550f45a
authored
May 13, 2011
by
Mans Rullgard
Committed by
Ronald S. Bultje
May 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add av_clip_uintp2() function
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
2c9a5172
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
vp8.c
libavcodec/vp8.c
+1
-3
common.h
libavutil/common.h
+15
-0
No files found.
libavcodec/vp8.c
View file @
1550f45a
...
...
@@ -1329,9 +1329,7 @@ static av_always_inline void filter_level_for_mb(VP8Context *s, VP8Macroblock *m
filter_level
+=
s
->
lf_delta
.
mode
[
mb
->
mode
];
}
/* Like av_clip for inputs 0 and max, where max is equal to (2^n-1) */
#define POW2CLIP(x,max) (((x) & ~max) ? (-(x))>>31 & max : (x));
filter_level
=
POW2CLIP
(
filter_level
,
63
);
filter_level
=
av_clip_uintp2
(
filter_level
,
6
);
interior_limit
=
filter_level
;
if
(
s
->
filter
.
sharpness
)
{
...
...
libavutil/common.h
View file @
1550f45a
...
...
@@ -169,6 +169,18 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
else
return
a
;
}
/**
* Clip a signed integer to an unsigned power of two range.
* @param a value to clip
* @param p bit position to clip at
* @return clipped value
*/
static
av_always_inline
av_const
unsigned
av_clip_uintp2_c
(
int
a
,
int
p
)
{
if
(
a
&
~
((
1
<<
p
)
-
1
))
return
-
a
>>
31
&
((
1
<<
p
)
-
1
);
else
return
a
;
}
/**
* Clip a float value into the amin-amax range.
* @param a value to clip
...
...
@@ -362,6 +374,9 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
#ifndef av_clipl_int32
# define av_clipl_int32 av_clipl_int32_c
#endif
#ifndef av_clip_uintp2
# define av_clip_uintp2 av_clip_uintp2_c
#endif
#ifndef av_clipf
# define av_clipf av_clipf_c
#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