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
d2d8ac24
Commit
d2d8ac24
authored
Dec 12, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_uspp: Allocate qp storage after qp_stride is known
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
327c5292
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
vf_uspp.c
libavfilter/vf_uspp.c
+10
-9
No files found.
libavfilter/vf_uspp.c
View file @
d2d8ac24
...
...
@@ -306,15 +306,6 @@ static int config_input(AVFilterLink *inlink)
return
AVERROR
(
EINVAL
);
}
if
(
!
uspp
->
use_bframe_qp
)
{
/* we are assuming here the qp blocks will not be smaller that 16x16 */
uspp
->
non_b_qp_alloc_size
=
FF_CEIL_RSHIFT
(
width
,
4
)
*
FF_CEIL_RSHIFT
(
height
,
4
);
uspp
->
non_b_qp_table
=
av_calloc
(
uspp
->
non_b_qp_alloc_size
,
sizeof
(
*
uspp
->
non_b_qp_table
));
if
(
!
uspp
->
non_b_qp_table
)
return
AVERROR
(
ENOMEM
);
}
for
(
i
=
0
;
i
<
3
;
i
++
)
{
int
is_chroma
=
!!
i
;
int
w
=
((
width
+
4
*
BLOCK
-
1
)
&
(
~
(
2
*
BLOCK
-
1
)))
>>
is_chroma
;
...
...
@@ -391,6 +382,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
w
=
FF_CEIL_RSHIFT
(
qp_stride
,
4
);
h
=
FF_CEIL_RSHIFT
(
inlink
->
h
,
4
);
}
if
(
w
*
h
>
uspp
->
non_b_qp_alloc_size
)
{
int
ret
=
av_reallocp_array
(
&
uspp
->
non_b_qp_table
,
w
,
h
);
if
(
ret
<
0
)
{
uspp
->
non_b_qp_alloc_size
=
0
;
return
ret
;
}
uspp
->
non_b_qp_alloc_size
=
w
*
h
;
}
av_assert0
(
w
*
h
<=
uspp
->
non_b_qp_alloc_size
);
memcpy
(
uspp
->
non_b_qp_table
,
qp_table
,
w
*
h
);
}
...
...
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