Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
a7166242
Commit
a7166242
authored
Sep 10, 2023
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/magicyuvenc: stop hardcoding max possible align
parent
5c87933e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
magicyuvenc.c
libavcodec/magicyuvenc.c
+4
-4
No files found.
libavcodec/magicyuvenc.c
View file @
a7166242
...
@@ -194,10 +194,10 @@ static av_cold int magy_encode_init(AVCodecContext *avctx)
...
@@ -194,10 +194,10 @@ static av_cold int magy_encode_init(AVCodecContext *avctx)
break
;
break
;
}
}
if
(
s
->
correlate
)
{
if
(
s
->
correlate
)
{
s
->
decorrelate_buf
[
0
]
=
av_calloc
(
2U
*
avctx
->
height
,
FFALIGN
(
avctx
->
width
,
16
));
s
->
decorrelate_buf
[
0
]
=
av_calloc
(
2U
*
avctx
->
height
,
FFALIGN
(
avctx
->
width
,
av_cpu_max_align
()
));
if
(
!
s
->
decorrelate_buf
[
0
])
if
(
!
s
->
decorrelate_buf
[
0
])
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
s
->
decorrelate_buf
[
1
]
=
s
->
decorrelate_buf
[
0
]
+
avctx
->
height
*
FFALIGN
(
avctx
->
width
,
16
);
s
->
decorrelate_buf
[
1
]
=
s
->
decorrelate_buf
[
0
]
+
avctx
->
height
*
FFALIGN
(
avctx
->
width
,
av_cpu_max_align
()
);
}
}
ff_llvidencdsp_init
(
&
s
->
llvidencdsp
);
ff_llvidencdsp_init
(
&
s
->
llvidencdsp
);
...
@@ -471,7 +471,7 @@ static int encode_slice(AVCodecContext *avctx, void *tdata,
...
@@ -471,7 +471,7 @@ static int encode_slice(AVCodecContext *avctx, void *tdata,
static
int
predict_slice
(
AVCodecContext
*
avctx
,
void
*
tdata
,
static
int
predict_slice
(
AVCodecContext
*
avctx
,
void
*
tdata
,
int
n
,
int
threadnr
)
int
n
,
int
threadnr
)
{
{
const
int
aligned_width
=
FFALIGN
(
avctx
->
width
,
16
);
const
int
aligned_width
=
FFALIGN
(
avctx
->
width
,
av_cpu_max_align
()
);
MagicYUVContext
*
s
=
avctx
->
priv_data
;
MagicYUVContext
*
s
=
avctx
->
priv_data
;
const
int
slice_height
=
s
->
slice_height
;
const
int
slice_height
=
s
->
slice_height
;
const
int
last_height
=
FFMIN
(
slice_height
,
avctx
->
height
-
n
*
slice_height
);
const
int
last_height
=
FFMIN
(
slice_height
,
avctx
->
height
-
n
*
slice_height
);
...
@@ -484,7 +484,7 @@ static int predict_slice(AVCodecContext *avctx, void *tdata,
...
@@ -484,7 +484,7 @@ static int predict_slice(AVCodecContext *avctx, void *tdata,
s
->
decorrelate_buf
[
1
]
+
n
*
slice_height
*
aligned_width
};
s
->
decorrelate_buf
[
1
]
+
n
*
slice_height
*
aligned_width
};
const
int
decorrelate_linesize
=
aligned_width
;
const
int
decorrelate_linesize
=
aligned_width
;
const
uint8_t
*
const
data
[
4
]
=
{
decorrelated
[
0
],
frame
->
data
[
0
]
+
n
*
slice_height
*
frame
->
linesize
[
0
],
const
uint8_t
*
const
data
[
4
]
=
{
decorrelated
[
0
],
frame
->
data
[
0
]
+
n
*
slice_height
*
frame
->
linesize
[
0
],
decorrelated
[
1
],
frame
->
data
[
3
]
+
n
*
slice_height
*
frame
->
linesize
[
3
]
};
decorrelated
[
1
],
s
->
planes
==
4
?
frame
->
data
[
3
]
+
n
*
slice_height
*
frame
->
linesize
[
3
]
:
NULL
};
const
uint8_t
*
r
,
*
g
,
*
b
;
const
uint8_t
*
r
,
*
g
,
*
b
;
const
int
linesize
[
4
]
=
{
decorrelate_linesize
,
frame
->
linesize
[
0
],
const
int
linesize
[
4
]
=
{
decorrelate_linesize
,
frame
->
linesize
[
0
],
decorrelate_linesize
,
frame
->
linesize
[
3
]
};
decorrelate_linesize
,
frame
->
linesize
[
3
]
};
...
...
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