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
c39637f3
Commit
c39637f3
authored
Jun 12, 2015
by
Przemysław Sobala
Committed by
Michael Niedermayer
Jun 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavcodec/imgconvert.c: support left band while cropping
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
d0061e77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
imgconvert.c
libavcodec/imgconvert.c
+3
-3
No files found.
libavcodec/imgconvert.c
View file @
c39637f3
...
...
@@ -201,12 +201,14 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
int
y_shift
;
int
x_shift
;
int
max_step
[
4
];
if
(
pix_fmt
<
0
||
pix_fmt
>=
AV_PIX_FMT_NB
)
return
-
1
;
y_shift
=
desc
->
log2_chroma_h
;
x_shift
=
desc
->
log2_chroma_w
;
av_image_fill_max_pixsteps
(
max_step
,
NULL
,
desc
);
if
(
is_yuv_planar
(
desc
))
{
dst
->
data
[
0
]
=
src
->
data
[
0
]
+
(
top_band
*
src
->
linesize
[
0
])
+
left_band
;
...
...
@@ -215,9 +217,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
}
else
{
if
(
top_band
%
(
1
<<
y_shift
)
||
left_band
%
(
1
<<
x_shift
))
return
-
1
;
if
(
left_band
)
//FIXME add support for this too
return
-
1
;
dst
->
data
[
0
]
=
src
->
data
[
0
]
+
(
top_band
*
src
->
linesize
[
0
])
+
left_band
;
dst
->
data
[
0
]
=
src
->
data
[
0
]
+
(
top_band
*
src
->
linesize
[
0
])
+
(
left_band
*
max_step
[
0
]);
}
dst
->
linesize
[
0
]
=
src
->
linesize
[
0
];
...
...
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