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
8652a2c2
Commit
8652a2c2
authored
May 19, 2017
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decode: fix the code reducing cropping to preserve alignment
Currently it does not work at all. Bug-Id: 1058
parent
c3f0357b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
decode.c
libavcodec/decode.c
+7
-1
No files found.
libavcodec/decode.c
View file @
8652a2c2
...
@@ -525,6 +525,7 @@ static int apply_cropping(AVCodecContext *avctx, AVFrame *frame)
...
@@ -525,6 +525,7 @@ static int apply_cropping(AVCodecContext *avctx, AVFrame *frame)
/* adjust the offsets to avoid breaking alignment */
/* adjust the offsets to avoid breaking alignment */
if
(
!
(
avctx
->
flags
&
AV_CODEC_FLAG_UNALIGNED
))
{
if
(
!
(
avctx
->
flags
&
AV_CODEC_FLAG_UNALIGNED
))
{
int
log2_crop_align
=
frame
->
crop_left
?
av_ctz
(
frame
->
crop_left
)
:
INT_MAX
;
int
min_log2_align
=
INT_MAX
;
int
min_log2_align
=
INT_MAX
;
for
(
i
=
0
;
frame
->
data
[
i
];
i
++
)
{
for
(
i
=
0
;
frame
->
data
[
i
];
i
++
)
{
...
@@ -532,8 +533,13 @@ static int apply_cropping(AVCodecContext *avctx, AVFrame *frame)
...
@@ -532,8 +533,13 @@ static int apply_cropping(AVCodecContext *avctx, AVFrame *frame)
min_log2_align
=
FFMIN
(
log2_align
,
min_log2_align
);
min_log2_align
=
FFMIN
(
log2_align
,
min_log2_align
);
}
}
/* we assume, and it should always be true, that the data alignment is
* related to the cropping alignment by a constant power-of-2 factor */
if
(
log2_crop_align
<
min_log2_align
)
return
AVERROR_BUG
;
if
(
min_log2_align
<
5
)
{
if
(
min_log2_align
<
5
)
{
frame
->
crop_left
&=
~
((
1
<<
min_log2_align
)
-
1
);
frame
->
crop_left
&=
~
((
1
<<
(
5
+
log2_crop_align
-
min_log2_align
)
)
-
1
);
calc_cropping_offsets
(
offsets
,
frame
,
desc
);
calc_cropping_offsets
(
offsets
,
frame
,
desc
);
}
}
}
}
...
...
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