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
b264e5ca
Commit
b264e5ca
authored
Oct 29, 2011
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pointless per-frame malloc/free.
Signed-off-by:
Reimar Döffinger
<
Reimar.Doeffinger@gmx.de
>
parent
25a6c594
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
proresenc.c
libavcodec/proresenc.c
+7
-12
No files found.
libavcodec/proresenc.c
View file @
b264e5ca
...
...
@@ -441,10 +441,10 @@ static int prores_encode_picture(AVCodecContext *avctx, AVFrame *pic,
{
int
mb_width
=
(
avctx
->
width
+
15
)
>>
4
;
int
mb_height
=
(
avctx
->
height
+
15
)
>>
4
;
int
hdr_size
,
sl_size
,
*
slice_sizes
;
int
sl
,
mb_y
,
sl_data_size
,
qp
;
int
hdr_size
,
sl_size
;
int
mb_y
,
sl_data_size
,
qp
;
int
unsafe_bot
,
unsafe_right
;
uint8_t
*
sl_data
;
uint8_t
*
sl_data
,
*
sl_data_sizes
;
int
slice_per_line
=
0
,
rem
=
mb_width
;
for
(
int
i
=
av_log2
(
DEFAULT_SLICE_MB_WIDTH
);
i
>=
0
;
--
i
)
{
...
...
@@ -453,9 +453,9 @@ static int prores_encode_picture(AVCodecContext *avctx, AVFrame *pic,
}
qp
=
qp_start_table
[
avctx
->
profile
];
slice_sizes
=
av_malloc
(
slice_per_line
*
mb_height
*
sizeof
(
int
))
;
sl
=
0
;
hdr_size
=
8
;
sl_data_size
=
buf_size
-
hdr_size
;
sl_data
=
buf
+
hdr_size
+
(
slice_per_line
*
mb_height
*
2
);
hdr_size
=
8
;
sl_data_size
=
buf_size
-
hdr_size
;
sl
_data_sizes
=
buf
+
hdr_size
;
sl_data
=
sl_data_sizes
+
(
slice_per_line
*
mb_height
*
2
);
for
(
mb_y
=
0
;
mb_y
<
mb_height
;
mb_y
++
)
{
int
mb_x
=
0
;
int
slice_mb_count
=
DEFAULT_SLICE_MB_WIDTH
;
...
...
@@ -469,7 +469,7 @@ static int prores_encode_picture(AVCodecContext *avctx, AVFrame *pic,
sl_size
=
encode_slice
(
avctx
,
pic
,
mb_x
,
mb_y
,
slice_mb_count
,
sl_data
,
sl_data_size
,
unsafe_bot
||
unsafe_right
,
&
qp
);
slice_sizes
[
sl
++
]
=
sl_size
;
bytestream_put_be16
(
&
sl_data_sizes
,
sl_size
)
;
sl_data
+=
sl_size
;
sl_data_size
-=
sl_size
;
mb_x
+=
slice_mb_count
;
...
...
@@ -481,11 +481,6 @@ static int prores_encode_picture(AVCodecContext *avctx, AVFrame *pic,
AV_WB16
(
buf
+
5
,
slice_per_line
*
mb_height
);
buf
[
7
]
=
av_log2
(
DEFAULT_SLICE_MB_WIDTH
)
<<
4
;
for
(
int
i
=
0
;
i
<
slice_per_line
*
mb_height
;
i
++
)
AV_WB16
(
buf
+
hdr_size
+
(
i
<<
1
),
slice_sizes
[
i
]);
av_free
(
slice_sizes
);
return
sl_data
-
buf
;
}
...
...
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