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
87c1783c
Commit
87c1783c
authored
Mar 19, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snowenc: move runs from stack to heap.
Fixes ticket1082 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
fc8ed111
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
snow.h
libavcodec/snow.h
+1
-0
snowenc.c
libavcodec/snowenc.c
+7
-5
No files found.
libavcodec/snow.h
View file @
87c1783c
...
...
@@ -163,6 +163,7 @@ typedef struct SnowContext{
MpegEncContext
m
;
// needed for motion estimation, should not be used for anything else, the idea is to eventually make the motion estimation independent of MpegEncContext, so this will be removed then (FIXME/XXX)
uint8_t
*
scratchbuf
;
int
*
runs
;
}
SnowContext
;
/* Tables */
...
...
libavcodec/snowenc.c
View file @
87c1783c
...
...
@@ -248,6 +248,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
}
s
->
runs
=
av_malloc
(
avctx
->
width
*
avctx
->
height
*
sizeof
(
*
s
->
runs
));
return
0
;
}
...
...
@@ -834,7 +836,6 @@ static int encode_subband_c0run(SnowContext *s, SubBand *b, const IDWTELEM *src,
if
(
1
){
int
run
=
0
;
int
runs
[
w
*
h
];
int
run_index
=
0
;
int
max_index
;
...
...
@@ -868,7 +869,7 @@ static int encode_subband_c0run(SnowContext *s, SubBand *b, const IDWTELEM *src,
}
if
(
!
(
/*ll|*/
l
|
lt
|
t
|
rt
|
p
)){
if
(
v
){
runs
[
run_index
++
]
=
run
;
s
->
runs
[
run_index
++
]
=
run
;
run
=
0
;
}
else
{
run
++
;
...
...
@@ -877,9 +878,9 @@ static int encode_subband_c0run(SnowContext *s, SubBand *b, const IDWTELEM *src,
}
}
max_index
=
run_index
;
runs
[
run_index
++
]
=
run
;
s
->
runs
[
run_index
++
]
=
run
;
run_index
=
0
;
run
=
runs
[
run_index
++
];
run
=
s
->
runs
[
run_index
++
];
put_symbol2
(
&
s
->
c
,
b
->
state
[
30
],
max_index
,
0
);
if
(
run_index
<=
max_index
)
...
...
@@ -923,7 +924,7 @@ static int encode_subband_c0run(SnowContext *s, SubBand *b, const IDWTELEM *src,
put_rac
(
&
s
->
c
,
&
b
->
state
[
0
][
context
],
!!
v
);
}
else
{
if
(
!
run
){
run
=
runs
[
run_index
++
];
run
=
s
->
runs
[
run_index
++
];
if
(
run_index
<=
max_index
)
put_symbol2
(
&
s
->
c
,
b
->
state
[
1
],
run
,
3
);
...
...
@@ -1897,6 +1898,7 @@ static av_cold int encode_end(AVCodecContext *avctx)
if
(
s
->
input_picture
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
input_picture
);
av_free
(
avctx
->
stats_out
);
av_freep
(
&
s
->
runs
);
return
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