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
1f1df07c
Commit
1f1df07c
authored
May 10, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/drawutils: attempt to fix subsampling.
parent
32475f56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
drawutils.c
libavfilter/drawutils.c
+13
-9
No files found.
libavfilter/drawutils.c
View file @
1f1df07c
...
...
@@ -93,7 +93,7 @@ int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t
int
hsub1
=
(
plane
==
1
||
plane
==
2
)
?
hsub
:
0
;
pixel_step
[
plane
]
=
1
;
line_size
=
(
w
>>
hsub1
)
*
pixel_step
[
plane
];
line_size
=
FF_CEIL_RSHIFT
(
w
,
hsub1
)
*
pixel_step
[
plane
];
line
[
plane
]
=
av_malloc
(
line_size
);
memset
(
line
[
plane
],
dst_color
[
plane
],
line_size
);
}
...
...
@@ -112,11 +112,13 @@ void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4],
for
(
plane
=
0
;
plane
<
4
&&
dst
[
plane
];
plane
++
)
{
int
hsub1
=
plane
==
1
||
plane
==
2
?
hsub
:
0
;
int
vsub1
=
plane
==
1
||
plane
==
2
?
vsub
:
0
;
int
width
=
FF_CEIL_RSHIFT
(
w
,
hsub1
);
int
height
=
FF_CEIL_RSHIFT
(
h
,
vsub1
);
p
=
dst
[
plane
]
+
(
y
>>
vsub1
)
*
dst_linesize
[
plane
];
for
(
i
=
0
;
i
<
(
h
>>
vsub1
)
;
i
++
)
{
for
(
i
=
0
;
i
<
height
;
i
++
)
{
memcpy
(
p
+
(
x
>>
hsub1
)
*
pixelstep
[
plane
],
src
[
plane
],
(
w
>>
hsub1
)
*
pixelstep
[
plane
]);
src
[
plane
],
width
*
pixelstep
[
plane
]);
p
+=
dst_linesize
[
plane
];
}
}
...
...
@@ -132,11 +134,13 @@ void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4],
for
(
plane
=
0
;
plane
<
4
&&
dst
[
plane
];
plane
++
)
{
int
hsub1
=
plane
==
1
||
plane
==
2
?
hsub
:
0
;
int
vsub1
=
plane
==
1
||
plane
==
2
?
vsub
:
0
;
int
width
=
FF_CEIL_RSHIFT
(
w
,
hsub1
);
int
height
=
FF_CEIL_RSHIFT
(
h
,
vsub1
);
p
=
dst
[
plane
]
+
(
y
>>
vsub1
)
*
dst_linesize
[
plane
];
for
(
i
=
0
;
i
<
(
h
>>
vsub1
)
;
i
++
)
{
for
(
i
=
0
;
i
<
height
;
i
++
)
{
memcpy
(
p
+
(
x
>>
hsub1
)
*
pixelstep
[
plane
],
src
[
plane
]
+
src_linesize
[
plane
]
*
(
i
+
(
y2
>>
vsub1
)),
(
w
>>
hsub1
)
*
pixelstep
[
plane
]);
src
[
plane
]
+
src_linesize
[
plane
]
*
(
i
+
(
y2
>>
vsub1
)),
width
*
pixelstep
[
plane
]);
p
+=
dst_linesize
[
plane
];
}
}
...
...
@@ -233,8 +237,8 @@ void ff_copy_rectangle2(FFDrawContext *draw,
for
(
plane
=
0
;
plane
<
draw
->
nb_planes
;
plane
++
)
{
p
=
pointer_at
(
draw
,
src
,
src_linesize
,
plane
,
src_x
,
src_y
);
q
=
pointer_at
(
draw
,
dst
,
dst_linesize
,
plane
,
dst_x
,
dst_y
);
wp
=
(
w
>>
draw
->
hsub
[
plane
])
*
draw
->
pixelstep
[
plane
];
hp
=
(
h
>>
draw
->
vsub
[
plane
]);
wp
=
FF_CEIL_RSHIFT
(
w
,
draw
->
hsub
[
plane
])
*
draw
->
pixelstep
[
plane
];
hp
=
FF_CEIL_RSHIFT
(
h
,
draw
->
vsub
[
plane
]);
for
(
y
=
0
;
y
<
hp
;
y
++
)
{
memcpy
(
q
,
p
,
wp
);
p
+=
src_linesize
[
plane
];
...
...
@@ -252,8 +256,8 @@ void ff_fill_rectangle(FFDrawContext *draw, FFDrawColor *color,
for
(
plane
=
0
;
plane
<
draw
->
nb_planes
;
plane
++
)
{
p0
=
pointer_at
(
draw
,
dst
,
dst_linesize
,
plane
,
dst_x
,
dst_y
);
wp
=
(
w
>>
draw
->
hsub
[
plane
]);
hp
=
(
h
>>
draw
->
vsub
[
plane
]);
wp
=
FF_CEIL_RSHIFT
(
w
,
draw
->
hsub
[
plane
]);
hp
=
FF_CEIL_RSHIFT
(
h
,
draw
->
vsub
[
plane
]);
if
(
!
hp
)
return
;
p
=
p0
;
...
...
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