Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
4709f721
Commit
4709f721
authored
Jan 21, 2016
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: Use AV_CEIL_RSHIFT where needed
parent
e8030714
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
vf_gradfun.c
libavfilter/vf_gradfun.c
+2
-2
vf_interlace.c
libavfilter/vf_interlace.c
+4
-2
vf_unsharp.c
libavfilter/vf_unsharp.c
+3
-6
No files found.
libavfilter/vf_gradfun.c
View file @
4709f721
...
@@ -172,8 +172,8 @@ static int config_input(AVFilterLink *inlink)
...
@@ -172,8 +172,8 @@ static int config_input(AVFilterLink *inlink)
if
(
!
s
->
buf
)
if
(
!
s
->
buf
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
s
->
chroma_w
=
-
((
-
inlink
->
w
)
>>
hsub
);
s
->
chroma_w
=
AV_CEIL_RSHIFT
(
inlink
->
w
,
hsub
);
s
->
chroma_h
=
-
((
-
inlink
->
h
)
>>
vsub
);
s
->
chroma_h
=
AV_CEIL_RSHIFT
(
inlink
->
h
,
vsub
);
s
->
chroma_r
=
av_clip
(((((
s
->
radius
>>
hsub
)
+
(
s
->
radius
>>
vsub
))
/
2
)
+
1
)
&
~
1
,
4
,
32
);
s
->
chroma_r
=
av_clip
(((((
s
->
radius
>>
hsub
)
+
(
s
->
radius
>>
vsub
))
/
2
)
+
1
)
&
~
1
,
4
,
32
);
return
0
;
return
0
;
...
...
libavfilter/vf_interlace.c
View file @
4709f721
...
@@ -138,8 +138,10 @@ static void copy_picture_field(InterlaceContext *s,
...
@@ -138,8 +138,10 @@ static void copy_picture_field(InterlaceContext *s,
int
plane
,
j
;
int
plane
,
j
;
for
(
plane
=
0
;
plane
<
desc
->
nb_components
;
plane
++
)
{
for
(
plane
=
0
;
plane
<
desc
->
nb_components
;
plane
++
)
{
int
cols
=
(
plane
==
1
||
plane
==
2
)
?
-
(
-
inlink
->
w
)
>>
hsub
:
inlink
->
w
;
int
cols
=
(
plane
==
1
||
plane
==
2
)
?
AV_CEIL_RSHIFT
(
inlink
->
w
,
hsub
)
int
lines
=
(
plane
==
1
||
plane
==
2
)
?
-
(
-
inlink
->
h
)
>>
vsub
:
inlink
->
h
;
:
inlink
->
w
;
int
lines
=
(
plane
==
1
||
plane
==
2
)
?
AV_CEIL_RSHIFT
(
inlink
->
h
,
vsub
)
:
inlink
->
h
;
uint8_t
*
dstp
=
dst_frame
->
data
[
plane
];
uint8_t
*
dstp
=
dst_frame
->
data
[
plane
];
const
uint8_t
*
srcp
=
src_frame
->
data
[
plane
];
const
uint8_t
*
srcp
=
src_frame
->
data
[
plane
];
...
...
libavfilter/vf_unsharp.c
View file @
4709f721
...
@@ -48,9 +48,6 @@
...
@@ -48,9 +48,6 @@
#define MIN_SIZE 3
#define MIN_SIZE 3
#define MAX_SIZE 13
#define MAX_SIZE 13
/* right-shift and round-up */
#define SHIFTUP(x,shift) (-((-(x))>>(shift)))
typedef
struct
FilterParam
{
typedef
struct
FilterParam
{
int
msize_x
;
///< matrix width
int
msize_x
;
///< matrix width
int
msize_y
;
///< matrix height
int
msize_y
;
///< matrix height
...
@@ -182,7 +179,7 @@ static int config_props(AVFilterLink *link)
...
@@ -182,7 +179,7 @@ static int config_props(AVFilterLink *link)
unsharp
->
vsub
=
desc
->
log2_chroma_h
;
unsharp
->
vsub
=
desc
->
log2_chroma_h
;
init_filter_param
(
link
->
dst
,
&
unsharp
->
luma
,
"luma"
,
link
->
w
);
init_filter_param
(
link
->
dst
,
&
unsharp
->
luma
,
"luma"
,
link
->
w
);
init_filter_param
(
link
->
dst
,
&
unsharp
->
chroma
,
"chroma"
,
SHIFTUP
(
link
->
w
,
unsharp
->
hsub
));
init_filter_param
(
link
->
dst
,
&
unsharp
->
chroma
,
"chroma"
,
AV_CEIL_RSHIFT
(
link
->
w
,
unsharp
->
hsub
));
return
0
;
return
0
;
}
}
...
@@ -208,8 +205,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
...
@@ -208,8 +205,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
UnsharpContext
*
unsharp
=
link
->
dst
->
priv
;
UnsharpContext
*
unsharp
=
link
->
dst
->
priv
;
AVFilterLink
*
outlink
=
link
->
dst
->
outputs
[
0
];
AVFilterLink
*
outlink
=
link
->
dst
->
outputs
[
0
];
AVFrame
*
out
;
AVFrame
*
out
;
int
cw
=
SHIFTUP
(
link
->
w
,
unsharp
->
hsub
);
int
cw
=
AV_CEIL_RSHIFT
(
link
->
w
,
unsharp
->
hsub
);
int
ch
=
SHIFTUP
(
link
->
h
,
unsharp
->
vsub
);
int
ch
=
AV_CEIL_RSHIFT
(
link
->
h
,
unsharp
->
vsub
);
out
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
out
=
ff_get_video_buffer
(
outlink
,
outlink
->
w
,
outlink
->
h
);
if
(
!
out
)
{
if
(
!
out
)
{
...
...
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